design-system-next 2.11.17 → 2.11.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/dist/design-system-next.es.js +6885 -6987
  2. package/dist/design-system-next.es.js.gz +0 -0
  3. package/dist/design-system-next.umd.js +12 -12
  4. package/dist/design-system-next.umd.js.gz +0 -0
  5. package/dist/main.css +1 -1
  6. package/dist/main.css.gz +0 -0
  7. package/dist/package.json.d.ts +1 -1
  8. package/package.json +1 -1
  9. package/src/assets/scripts/border-radius.ts +15 -15
  10. package/src/assets/scripts/colors.ts +134 -134
  11. package/src/assets/scripts/max-width.ts +11 -11
  12. package/src/assets/scripts/spacing.ts +23 -23
  13. package/src/assets/scripts/utilities.ts +15 -15
  14. package/src/assets/styles/tailwind.css +6 -18
  15. package/src/components/accordion/accordion.ts +43 -43
  16. package/src/components/accordion/use-accordion.ts +43 -43
  17. package/src/components/avatar/avatar.ts +64 -64
  18. package/src/components/badge/badge.ts +43 -43
  19. package/src/components/banner/banner.ts +20 -20
  20. package/src/components/button/button.ts +72 -72
  21. package/src/components/button/button.vue +15 -15
  22. package/src/components/calendar/calendar.ts +89 -89
  23. package/src/components/card/card.ts +52 -52
  24. package/src/components/checkbox/checkbox.ts +45 -45
  25. package/src/components/chips/chips.ts +95 -95
  26. package/src/components/collapsible/collapsible.ts +21 -21
  27. package/src/components/collapsible/collapsible.vue +27 -27
  28. package/src/components/date-picker/__tests__/date-picker.test.ts +112 -112
  29. package/src/components/date-picker/date-picker.ts +157 -157
  30. package/src/components/dropdown/__tests__/dropdown-fixes.spec.ts +106 -106
  31. package/src/components/dropdown/__tests__/dropdown-value-types.spec.ts +213 -213
  32. package/src/components/dropdown/dropdown.ts +4 -0
  33. package/src/components/dropdown/dropdown.vue +2 -0
  34. package/src/components/dropdown/fix-multi-number.ts +92 -92
  35. package/src/components/dropdown/use-dropdown.ts +488 -488
  36. package/src/components/empty-state/empty-state.ts +50 -50
  37. package/src/components/file-upload/file-upload.ts +87 -87
  38. package/src/components/floating-action/floating-action.ts +12 -12
  39. package/src/components/input/input-contact-number/input-contact-number.ts +83 -83
  40. package/src/components/input/input-email/input-email.vue +17 -17
  41. package/src/components/input/input-password/use-input-password.ts +19 -19
  42. package/src/components/input/input-search/input-search.vue +13 -13
  43. package/src/components/input/input-url/input-url.vue +20 -20
  44. package/src/components/input/input-username/input-username.vue +17 -17
  45. package/src/components/input/input.vue +72 -72
  46. package/src/components/list/ladderized-list/ladderized-list.ts +39 -39
  47. package/src/components/list/list.ts +4 -0
  48. package/src/components/list/list.vue +33 -24
  49. package/src/components/logo/logo.ts +43 -43
  50. package/src/components/logo/logo.vue +14 -14
  51. package/src/components/logo/use-logo.ts +41 -41
  52. package/src/components/lozenge/lozenge.ts +61 -61
  53. package/src/components/modal/modal.ts +45 -45
  54. package/src/components/progress-bar/progress-bar.ts +39 -39
  55. package/src/components/radio/radio.ts +42 -42
  56. package/src/components/select/select.ts +144 -144
  57. package/src/components/sidenav/sidenav.ts +172 -173
  58. package/src/components/sidenav/sidenav.vue +211 -126
  59. package/src/components/sidenav/use-sidenav.ts +85 -76
  60. package/src/components/sidepanel/sidepanel.ts +104 -100
  61. package/src/components/sidepanel/sidepanel.vue +55 -55
  62. package/src/components/sidepanel/stacking-sidepanel/stacking-sidepanel.ts +16 -16
  63. package/src/components/sidepanel/stacking-sidepanel/stacking-sidepanel.vue +39 -39
  64. package/src/components/sidepanel/use-sidepanel.ts +5 -2
  65. package/src/components/slider/slider.ts +38 -38
  66. package/src/components/snackbar/snack/snack.ts +71 -71
  67. package/src/components/snackbar/use-snackbar.ts +34 -34
  68. package/src/components/status/status.ts +19 -19
  69. package/src/components/status/status.vue +13 -13
  70. package/src/components/stepper/step/step.ts +47 -47
  71. package/src/components/stepper/stepper.ts +47 -47
  72. package/src/components/stepper/stepper.vue +34 -34
  73. package/src/components/switch/switch.ts +42 -42
  74. package/src/components/table/table-actions/table-actions.ts +42 -42
  75. package/src/components/table/table-actions/table-actions.vue +40 -40
  76. package/src/components/table/table-chips-title/table-chips-title.ts +27 -27
  77. package/src/components/table/table-chips-title/table-chips-title.vue +32 -32
  78. package/src/components/table/table-chips-title/use-table-chips-title.ts +22 -22
  79. package/src/components/table/table-lozenge-title/table-lozenge-title.ts +23 -23
  80. package/src/components/table/table-lozenge-title/table-lozenge-title.vue +26 -26
  81. package/src/components/table/table-lozenge-title/use-table-lozenge-title.ts +21 -21
  82. package/src/components/table/table-pagination/table-pagination.ts +63 -63
  83. package/src/components/table/table-pagination/table-pagination.vue +72 -72
  84. package/src/components/table/table.ts +173 -173
  85. package/src/components/tabs/tabs.ts +43 -43
  86. package/src/components/textarea/textarea.ts +72 -72
  87. package/src/components/textarea/textarea.vue +45 -45
  88. package/src/components/time-picker/time-picker.ts +69 -69
  89. package/src/components/tooltip/tooltip.ts +44 -46
  90. package/src/components/tooltip/tooltip.vue +4 -1
  91. package/src/components/tooltip/use-tooltip.ts +13 -13
  92. package/src/examples/dropdown-number-multi-select.vue +76 -76
  93. package/src/stores/useSnackbarStore.ts +44 -44
  94. package/src/vite-env.d.ts +0 -6
@@ -1,72 +1,72 @@
1
- <template>
2
- <div :class="inputClasses.baseClasses">
3
- <label v-if="props.label" :for="id" :class="inputClasses.labelClasses">
4
- {{ props.label }}
5
- </label>
6
-
7
- <div :class="inputClasses.inputTextBaseClasses">
8
- <div v-if="$slots.prefix" :class="inputClasses.prefixSlotClasses">
9
- <slot name="prefix" />
10
- </div>
11
- <input
12
- v-bind="$attrs"
13
- :id="props.id"
14
- ref="inputTextRef"
15
- :class="[inputClasses.inputTextClasses, { 'number-input': props.type === 'number' }]"
16
- :placeholder="props.placeholder"
17
- :type="props.type"
18
- :minlength="props.minLength"
19
- :maxlength="props.maxLength"
20
- :value="modelValue"
21
- :disabled="props.disabled"
22
- :readonly="props.readonly"
23
- @input="onInput"
24
- />
25
- <div v-if="$slots.trailing" :class="inputClasses.trailingSlotClasses">
26
- <slot name="trailing" />
27
- </div>
28
- <div v-if="$slots.icon" :class="inputClasses.iconSlotClasses" @click="disableClickEvent">
29
- <slot name="icon" />
30
- </div>
31
- </div>
32
-
33
- <div v-if="props.displayHelper || props.showCharCount" :class="inputClasses.helperContainerClasses">
34
- <div v-if="props.displayHelper" :class="inputClasses.helperClasses">
35
- <slot name="helperMessage">
36
- <Icon v-if="props.helperIcon" :icon="props.helperIcon" width="20px" height="20px" />
37
- <span>{{ props.helperText }}</span>
38
- </slot>
39
- </div>
40
- <div v-if="props.showCharCount" :class="inputClasses.charCountClasses">
41
- {{ currentLength }}{{ props.maxLength ? '/' + props.maxLength : '' }}
42
- </div>
43
- </div>
44
- </div>
45
- </template>
46
-
47
- <script setup lang="ts">
48
- import { useSlots } from 'vue';
49
-
50
- import { Icon } from '@iconify/vue';
51
-
52
- import { inputPropTypes, inputEmitTypes } from './input';
53
- import { useInput } from './use-input';
54
-
55
- const emit = defineEmits(inputEmitTypes);
56
- const props = defineProps(inputPropTypes);
57
- const slots = useSlots();
58
-
59
- const { inputClasses, inputTextRef, onInput, disableClickEvent, currentLength } = useInput(props, emit, slots);
60
- </script>
61
-
62
- <style scoped>
63
- .number-input::-webkit-outer-spin-button,
64
- .number-input::-webkit-inner-spin-button {
65
- margin: 0;
66
- -webkit-appearance: none;
67
- }
68
-
69
- .number-input {
70
- -moz-appearance: textfield;
71
- }
72
- </style>
1
+ <template>
2
+ <div :class="inputClasses.baseClasses">
3
+ <label v-if="props.label" :for="id" :class="inputClasses.labelClasses">
4
+ {{ props.label }}
5
+ </label>
6
+
7
+ <div :class="inputClasses.inputTextBaseClasses">
8
+ <div v-if="$slots.prefix" :class="inputClasses.prefixSlotClasses">
9
+ <slot name="prefix" />
10
+ </div>
11
+ <input
12
+ v-bind="$attrs"
13
+ :id="props.id"
14
+ ref="inputTextRef"
15
+ :class="[inputClasses.inputTextClasses, { 'number-input': props.type === 'number' }]"
16
+ :placeholder="props.placeholder"
17
+ :type="props.type"
18
+ :minlength="props.minLength"
19
+ :maxlength="props.maxLength"
20
+ :value="modelValue"
21
+ :disabled="props.disabled"
22
+ :readonly="props.readonly"
23
+ @input="onInput"
24
+ />
25
+ <div v-if="$slots.trailing" :class="inputClasses.trailingSlotClasses">
26
+ <slot name="trailing" />
27
+ </div>
28
+ <div v-if="$slots.icon" :class="inputClasses.iconSlotClasses" @click="disableClickEvent">
29
+ <slot name="icon" />
30
+ </div>
31
+ </div>
32
+
33
+ <div v-if="props.displayHelper || props.showCharCount" :class="inputClasses.helperContainerClasses">
34
+ <div v-if="props.displayHelper" :class="inputClasses.helperClasses">
35
+ <slot name="helperMessage">
36
+ <Icon v-if="props.helperIcon" :icon="props.helperIcon" width="20px" height="20px" />
37
+ <span>{{ props.helperText }}</span>
38
+ </slot>
39
+ </div>
40
+ <div v-if="props.showCharCount" :class="inputClasses.charCountClasses">
41
+ {{ currentLength }}{{ props.maxLength ? '/' + props.maxLength : '' }}
42
+ </div>
43
+ </div>
44
+ </div>
45
+ </template>
46
+
47
+ <script setup lang="ts">
48
+ import { useSlots } from 'vue';
49
+
50
+ import { Icon } from '@iconify/vue';
51
+
52
+ import { inputPropTypes, inputEmitTypes } from './input';
53
+ import { useInput } from './use-input';
54
+
55
+ const emit = defineEmits(inputEmitTypes);
56
+ const props = defineProps(inputPropTypes);
57
+ const slots = useSlots();
58
+
59
+ const { inputClasses, inputTextRef, onInput, disableClickEvent, currentLength } = useInput(props, emit, slots);
60
+ </script>
61
+
62
+ <style scoped>
63
+ .number-input::-webkit-outer-spin-button,
64
+ .number-input::-webkit-inner-spin-button {
65
+ margin: 0;
66
+ -webkit-appearance: none;
67
+ }
68
+
69
+ .number-input {
70
+ -moz-appearance: textfield;
71
+ }
72
+ </style>
@@ -1,39 +1,39 @@
1
- import type { PropType, ExtractPropTypes } from 'vue';
2
- import { MenuListType } from '../list';
3
- export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
4
-
5
- export const ladderizedListPropTypes = {
6
- modelValue: {
7
- type: Array as PropType<string[]>,
8
- required: true,
9
- default: [],
10
- },
11
- menuList: {
12
- type: Array as PropType<MenuListType[]>,
13
- required: true,
14
- default: [],
15
- },
16
- menuLevel: {
17
- type: Number,
18
- default: 0,
19
- },
20
- searchableMenu: {
21
- type: Boolean,
22
- default: false,
23
- },
24
- searchableMenuPlaceholder: {
25
- type: String,
26
- default: 'Search...',
27
- },
28
- removeCurrentLevelInBackLabel: {
29
- type: Boolean,
30
- default: false,
31
- },
32
- };
33
-
34
- export const ladderizedListEmitTypes = {
35
- 'update:modelValue': (value: string[]) => value,
36
- };
37
-
38
- export type LadderizedListPropTypes = ExtractPropTypes<typeof ladderizedListPropTypes>;
39
- export type LadderizedListEmitTypes = typeof ladderizedListEmitTypes;
1
+ import type { PropType, ExtractPropTypes } from 'vue';
2
+ import { MenuListType } from '../list';
3
+ export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
4
+
5
+ export const ladderizedListPropTypes = {
6
+ modelValue: {
7
+ type: Array as PropType<string[]>,
8
+ required: true,
9
+ default: [],
10
+ },
11
+ menuList: {
12
+ type: Array as PropType<MenuListType[]>,
13
+ required: true,
14
+ default: [],
15
+ },
16
+ menuLevel: {
17
+ type: Number,
18
+ default: 0,
19
+ },
20
+ searchableMenu: {
21
+ type: Boolean,
22
+ default: false,
23
+ },
24
+ searchableMenuPlaceholder: {
25
+ type: String,
26
+ default: 'Search...',
27
+ },
28
+ removeCurrentLevelInBackLabel: {
29
+ type: Boolean,
30
+ default: false,
31
+ },
32
+ };
33
+
34
+ export const ladderizedListEmitTypes = {
35
+ 'update:modelValue': (value: string[]) => value,
36
+ };
37
+
38
+ export type LadderizedListPropTypes = ExtractPropTypes<typeof ladderizedListPropTypes>;
39
+ export type LadderizedListEmitTypes = typeof ladderizedListEmitTypes;
@@ -80,6 +80,10 @@ export const listPropTypes = {
80
80
  type: Boolean,
81
81
  default: false,
82
82
  },
83
+ dropdown: {
84
+ type: Boolean,
85
+ default: false,
86
+ },
83
87
  };
84
88
 
85
89
  export const listEmitTypes = {
@@ -26,9 +26,9 @@
26
26
  >
27
27
  <spr-checkbox v-if="props.multiSelect" :checked="isItemSelected(item)" />
28
28
  <div :class="[item.textColor, 'spr-flex spr-flex-row spr-items-center spr-gap-size-spacing-3xs']">
29
- <span v-if="item.icon" :class="[item.iconColor, 'spr-mt-[2px]']"
30
- ><icon :icon="item.icon" width="20px" height="20px"
31
- /></span>
29
+ <span v-if="item.icon" :class="[item.iconColor, 'spr-mt-[2px]']">
30
+ <icon :icon="item.icon" width="20px" height="20px" />
31
+ </span>
32
32
  <div class="spr-flex spr-flex-auto spr-flex-col spr-justify-start">
33
33
  <span class="spr-text-left spr-text-xs">
34
34
  {{ item.text }}
@@ -38,16 +38,20 @@
38
38
  </span>
39
39
  </div>
40
40
  </div>
41
- <Icon
42
- v-if="isItemSelected(item) && !props.multiSelect && !props.noCheck"
43
- class="spr-text-color-brand-base spr-w-[1.39em]"
44
- icon="ph:check"
45
- />
46
- <Icon
47
- v-else-if="props.ladderized && item.sublevel && item.sublevel?.length > 0"
48
- class="spr-text-color-weak spr-size-4"
49
- icon="ph:caret-right"
50
- />
41
+ <template v-if="!props.multiSelect && !props.dropdown">
42
+ <Icon
43
+ v-if="isItemSelected(item) && !props.noCheck"
44
+ class="spr-text-color-brand-base spr-w-[1.39em]"
45
+ icon="ph:check"
46
+ />
47
+ </template>
48
+ <template v-if="props.ladderized">
49
+ <Icon
50
+ v-if="item.sublevel && item.sublevel?.length > 0"
51
+ class="spr-text-color-weak spr-size-4"
52
+ icon="ph:caret-right"
53
+ />
54
+ </template>
51
55
  </div>
52
56
  </div>
53
57
  </div>
@@ -86,20 +90,25 @@
86
90
  'spr-body-xs-regular spr-text-color-base spr-text-left',
87
91
  { 'spr-text-color-disabled': item.disabled },
88
92
  ]"
89
- >{{ item.subtext }}</span
90
93
  >
94
+ {{ item.subtext }}
95
+ </span>
91
96
  </div>
92
97
  </div>
93
- <Icon
94
- v-if="isItemSelected(item) && !props.multiSelect && !props.noCheck"
95
- class="spr-text-color-brand-base spr-w-[1.39em]"
96
- icon="ph:check"
97
- />
98
- <Icon
99
- v-else-if="props.ladderized && item.sublevel && item.sublevel?.length > 0"
100
- class="spr-text-color-weak spr-size-4"
101
- icon="ph:caret-right"
102
- />
98
+ <template v-if="!props.multiSelect && !props.dropdown">
99
+ <Icon
100
+ v-if="isItemSelected(item) && !props.noCheck"
101
+ class="spr-text-color-brand-base spr-w-[1.39em]"
102
+ icon="ph:check"
103
+ />
104
+ </template>
105
+ <template v-if="props.ladderized">
106
+ <Icon
107
+ v-if="item.sublevel && item.sublevel?.length > 0"
108
+ class="spr-text-color-weak spr-size-4"
109
+ icon="ph:caret-right"
110
+ />
111
+ </template>
103
112
  </div>
104
113
  </template>
105
114
  <template v-else>
@@ -1,43 +1,43 @@
1
- import type { PropType, ExtractPropTypes } from 'vue';
2
-
3
- const LOGO_THEMES = ['white', 'dark', 'gray', 'green'] as const;
4
- const LOGO_NAMES = [
5
- 'benchmark',
6
- 'ecosystem',
7
- 'engage',
8
- 'finances',
9
- 'hr-mobile',
10
- 'hr',
11
- 'inbound',
12
- 'insight',
13
- 'readycash',
14
- 'readywage',
15
- 'payroll',
16
- 'performance-plus',
17
- 'procurement',
18
- 'professional-services',
19
- 'recruit',
20
- 'recruit-plus',
21
- 'sail',
22
- 'sidekick',
23
- 'wellness',
24
- ] as const;
25
-
26
- export const logoPropTypes = {
27
- name: {
28
- type: String as PropType<(typeof LOGO_NAMES)[number]>,
29
- validator: (value: (typeof LOGO_NAMES)[number]) => LOGO_NAMES.includes(value),
30
- default: 'hr',
31
- },
32
- theme: {
33
- type: String as PropType<(typeof LOGO_THEMES)[number]>,
34
- validator: (value: (typeof LOGO_THEMES)[number]) => LOGO_THEMES.includes(value),
35
- default: 'dark',
36
- },
37
- width: {
38
- type: [String, Number] as PropType<string | number>,
39
- default: '50', // If number, it will be treated as px
40
- },
41
- };
42
-
43
- export type LogoPropTypes = ExtractPropTypes<typeof logoPropTypes>;
1
+ import type { PropType, ExtractPropTypes } from 'vue';
2
+
3
+ const LOGO_THEMES = ['white', 'dark', 'gray', 'green'] as const;
4
+ const LOGO_NAMES = [
5
+ 'benchmark',
6
+ 'ecosystem',
7
+ 'engage',
8
+ 'finances',
9
+ 'hr-mobile',
10
+ 'hr',
11
+ 'inbound',
12
+ 'insight',
13
+ 'readycash',
14
+ 'readywage',
15
+ 'payroll',
16
+ 'performance-plus',
17
+ 'procurement',
18
+ 'professional-services',
19
+ 'recruit',
20
+ 'recruit-plus',
21
+ 'sail',
22
+ 'sidekick',
23
+ 'wellness',
24
+ ] as const;
25
+
26
+ export const logoPropTypes = {
27
+ name: {
28
+ type: String as PropType<(typeof LOGO_NAMES)[number]>,
29
+ validator: (value: (typeof LOGO_NAMES)[number]) => LOGO_NAMES.includes(value),
30
+ default: 'hr',
31
+ },
32
+ theme: {
33
+ type: String as PropType<(typeof LOGO_THEMES)[number]>,
34
+ validator: (value: (typeof LOGO_THEMES)[number]) => LOGO_THEMES.includes(value),
35
+ default: 'dark',
36
+ },
37
+ width: {
38
+ type: [String, Number] as PropType<string | number>,
39
+ default: '50', // If number, it will be treated as px
40
+ },
41
+ };
42
+
43
+ export type LogoPropTypes = ExtractPropTypes<typeof logoPropTypes>;
@@ -1,14 +1,14 @@
1
- <template>
2
- <div>
3
- <img v-bind="$attrs" :src="logoSrc" :alt="logoTitle" :title="logoTitle" :width="width" />
4
- </div>
5
- </template>
6
-
7
- <script lang="ts" setup>
8
- import { useLogo } from './use-logo';
9
- import { logoPropTypes } from './logo';
10
-
11
- const props = defineProps(logoPropTypes);
12
-
13
- const { logoSrc, logoTitle } = useLogo(props);
14
- </script>
1
+ <template>
2
+ <div>
3
+ <img v-bind="$attrs" :src="logoSrc" :alt="logoTitle" :title="logoTitle" :width="width" />
4
+ </div>
5
+ </template>
6
+
7
+ <script lang="ts" setup>
8
+ import { useLogo } from './use-logo';
9
+ import { logoPropTypes } from './logo';
10
+
11
+ const props = defineProps(logoPropTypes);
12
+
13
+ const { logoSrc, logoTitle } = useLogo(props);
14
+ </script>
@@ -1,41 +1,41 @@
1
- import { computed } from 'vue';
2
- import type { LogoPropTypes } from './logo';
3
- import { Cloudinary } from '@cloudinary/url-gen';
4
-
5
- const CLOUD_NAME = 'dfeykvudc';
6
-
7
- const NAME_MAP: Record<string, string> = {
8
- 'hr': 'Sprout HR',
9
- 'hr-mobile': 'Sprout HR Mobile',
10
- 'performance-plus': 'Sprout Performance+',
11
- 'recruit-plus': 'Sprout Recruit+',
12
- 'sail': 'Sprout SAIL',
13
- 'readycash': 'Sprout ReadyCash',
14
- 'readywage': 'Sprout ReadyWage',
15
- };
16
-
17
- export function useLogo(props: LogoPropTypes) {
18
- const cld = new Cloudinary({
19
- cloud: {
20
- cloudName: CLOUD_NAME,
21
- },
22
- });
23
-
24
- const logoSrc = computed(() => cld.image(`sprout-${props.name}-${props.theme}`).toURL());
25
-
26
- const logoTitle = computed(() => {
27
- if (props.name in NAME_MAP) {
28
- return NAME_MAP[props.name];
29
- }
30
-
31
- const firstChar = props.name.charAt(0).toUpperCase();
32
- const remainingChars = props.name.slice(1);
33
- const formattedName = `${firstChar}${remainingChars}`;
34
- return `Sprout ${formattedName}`;
35
- });
36
-
37
- return {
38
- logoSrc,
39
- logoTitle,
40
- };
41
- }
1
+ import { computed } from 'vue';
2
+ import type { LogoPropTypes } from './logo';
3
+ import { Cloudinary } from '@cloudinary/url-gen';
4
+
5
+ const CLOUD_NAME = 'dfeykvudc';
6
+
7
+ const NAME_MAP: Record<string, string> = {
8
+ 'hr': 'Sprout HR',
9
+ 'hr-mobile': 'Sprout HR Mobile',
10
+ 'performance-plus': 'Sprout Performance+',
11
+ 'recruit-plus': 'Sprout Recruit+',
12
+ 'sail': 'Sprout SAIL',
13
+ 'readycash': 'Sprout ReadyCash',
14
+ 'readywage': 'Sprout ReadyWage',
15
+ };
16
+
17
+ export function useLogo(props: LogoPropTypes) {
18
+ const cld = new Cloudinary({
19
+ cloud: {
20
+ cloudName: CLOUD_NAME,
21
+ },
22
+ });
23
+
24
+ const logoSrc = computed(() => cld.image(`sprout-${props.name}-${props.theme}`).toURL());
25
+
26
+ const logoTitle = computed(() => {
27
+ if (props.name in NAME_MAP) {
28
+ return NAME_MAP[props.name];
29
+ }
30
+
31
+ const firstChar = props.name.charAt(0).toUpperCase();
32
+ const remainingChars = props.name.slice(1);
33
+ const formattedName = `${firstChar}${remainingChars}`;
34
+ return `Sprout ${formattedName}`;
35
+ });
36
+
37
+ return {
38
+ logoSrc,
39
+ logoTitle,
40
+ };
41
+ }
@@ -1,61 +1,61 @@
1
- import type { PropType, ExtractPropTypes } from 'vue';
2
-
3
- export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
4
-
5
- export const LOZENGE_TONE = ['plain', 'pending', 'information', 'success', 'danger', 'neutral', 'caution'] as const;
6
-
7
- export const lozengePropTypes = {
8
- /**
9
- * @description Lozenge Label
10
- */
11
- label: {
12
- type: String,
13
- default: 'label',
14
- },
15
- /**
16
- * @description Lozenge tone
17
- */
18
- tone: {
19
- type: String as PropType<(typeof LOZENGE_TONE)[number]>,
20
- validator: (value: (typeof LOZENGE_TONE)[number]) => LOZENGE_TONE.includes(value),
21
- default: 'plain',
22
- },
23
- /**
24
- * @description Lozenge type (fill or outline)
25
- */
26
- fill: {
27
- type: Boolean,
28
- default: false,
29
- },
30
- /**
31
- * @description Lozenge removable
32
- */
33
- removable: {
34
- type: Boolean,
35
- default: false,
36
- },
37
- /**
38
- * @description avatar image url
39
- */
40
- url: {
41
- type: String,
42
- default: '',
43
- },
44
- /**
45
- * @description handler if the lozenge is visible
46
- */
47
- visible: {
48
- type: Boolean,
49
- default: true,
50
- },
51
- loading: {
52
- type: Boolean,
53
- default: false,
54
- },
55
- };
56
-
57
- export type LozengePropTypes = ExtractPropTypes<typeof lozengePropTypes>;
58
- export const removeEmitTypes = {
59
- onRemove: (evt: MouseEvent): evt is MouseEvent => evt instanceof MouseEvent,
60
- };
61
- export type RemoveEmitTypes = typeof removeEmitTypes;
1
+ import type { PropType, ExtractPropTypes } from 'vue';
2
+
3
+ export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
4
+
5
+ export const LOZENGE_TONE = ['plain', 'pending', 'information', 'success', 'danger', 'neutral', 'caution'] as const;
6
+
7
+ export const lozengePropTypes = {
8
+ /**
9
+ * @description Lozenge Label
10
+ */
11
+ label: {
12
+ type: String,
13
+ default: 'label',
14
+ },
15
+ /**
16
+ * @description Lozenge tone
17
+ */
18
+ tone: {
19
+ type: String as PropType<(typeof LOZENGE_TONE)[number]>,
20
+ validator: (value: (typeof LOZENGE_TONE)[number]) => LOZENGE_TONE.includes(value),
21
+ default: 'plain',
22
+ },
23
+ /**
24
+ * @description Lozenge type (fill or outline)
25
+ */
26
+ fill: {
27
+ type: Boolean,
28
+ default: false,
29
+ },
30
+ /**
31
+ * @description Lozenge removable
32
+ */
33
+ removable: {
34
+ type: Boolean,
35
+ default: false,
36
+ },
37
+ /**
38
+ * @description avatar image url
39
+ */
40
+ url: {
41
+ type: String,
42
+ default: '',
43
+ },
44
+ /**
45
+ * @description handler if the lozenge is visible
46
+ */
47
+ visible: {
48
+ type: Boolean,
49
+ default: true,
50
+ },
51
+ loading: {
52
+ type: Boolean,
53
+ default: false,
54
+ },
55
+ };
56
+
57
+ export type LozengePropTypes = ExtractPropTypes<typeof lozengePropTypes>;
58
+ export const removeEmitTypes = {
59
+ onRemove: (evt: MouseEvent): evt is MouseEvent => evt instanceof MouseEvent,
60
+ };
61
+ export type RemoveEmitTypes = typeof removeEmitTypes;