Skip to content

Commit 1346c7a

Browse files
committed
Refactors type definitions to improve reusability
Moves ColorVariant type definition above BootstrapVariant and updates BootstrapVariant to extend ColorVariant instead of duplicating color values. Improves code maintainability by eliminating duplication and establishing a clear hierarchy between the two type definitions.
1 parent 8f7767b commit 1346c7a

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

client/src/components/Common/index.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
import type { IconDefinition } from "@fortawesome/fontawesome-svg-core";
22
import type { RawLocation } from "vue-router";
33

4+
/**
5+
* Basic color variants for components that only support
6+
* color-based styling like alerts, badges, and backgrounds (no outline variants).
7+
*/
8+
export type ColorVariant = "primary" | "secondary" | "success" | "danger" | "warning" | "info" | "light" | "dark";
9+
410
/**
511
* Bootstrap Vue variants for styling components.
12+
* Includes basic color variants plus outline variants for buttons and modals.
613
*/
714
export type BootstrapVariant =
8-
| "primary"
9-
| "secondary"
10-
| "success"
11-
| "danger"
12-
| "warning"
13-
| "info"
14-
| "light"
15+
| ColorVariant
1516
| "link"
16-
| "dark"
1717
| "outline-primary"
1818
| "outline-secondary"
1919
| "outline-success"
@@ -24,9 +24,6 @@ export type BootstrapVariant =
2424
| "outline-link"
2525
| "outline-dark";
2626

27-
// TODO: Not sure if this is the best place for this type
28-
export type ColorVariant = "primary" | "secondary" | "success" | "danger" | "warning" | "info" | "light" | "dark";
29-
3027
/**
3128
* Represents a breadcrumb item in the BreadcrumbHeading component.
3229
* Each item can have a title, an optional URL to navigate to, and optional additional text

0 commit comments

Comments
 (0)