Skip to content

Commit e922a29

Browse files
committed
Move ColorVariant into componentVariants.ts
ColorVariant lives with the other component variant types inside BaseComponents/ so G-components don't need to reach back into @/components/Common to get their own types. Common/index.ts re-exports for the app-code consumers that still import it from there. Prep work for carving BaseComponents into a @galaxyproject/galaxy-ui workspace package -- the package needs its types self-contained.
1 parent 776df11 commit e922a29

3 files changed

Lines changed: 11 additions & 6 deletions

File tree

client/src/components/BaseComponents/GTip.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<script setup lang="ts">
22
import { computed, onUnmounted, ref } from "vue";
33
4-
import type { ColorVariant } from "@/components/Common";
54
import { useMarkdown } from "@/composables/markdown";
65
6+
import type { ColorVariant } from "./componentVariants";
7+
78
interface Props {
89
/** List of tip messages. Supports markdown formatting. Must contain at least one entry. */
910
tips: string[];

client/src/components/BaseComponents/componentVariants.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
export type ComponentColor = "grey" | "blue" | "green" | "yellow" | "orange" | "red";
22
export type ComponentSize = "small" | "medium" | "large";
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
export type ComponentSizeClassList = {
511
[_key in `g-${ComponentSize}`]?: true;
612
};

client/src/components/Common/index.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
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";
4+
import type { ColorVariant } from "@/components/BaseComponents/componentVariants";
5+
6+
export type { ColorVariant } from "@/components/BaseComponents/componentVariants";
97

108
/**
119
* Bootstrap Vue variants for styling components.

0 commit comments

Comments
 (0)