design-system-next 2.11.15 → 2.11.17

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 (89) hide show
  1. package/dist/design-system-next.es.js +6255 -6111
  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/App.vue +1 -49
  10. package/src/assets/scripts/border-radius.ts +15 -15
  11. package/src/assets/scripts/colors.ts +134 -134
  12. package/src/assets/scripts/max-width.ts +11 -11
  13. package/src/assets/scripts/spacing.ts +23 -23
  14. package/src/assets/scripts/utilities.ts +15 -15
  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/date-picker/date-range-picker/date-range-picker.vue +1 -0
  31. package/src/components/dropdown/__tests__/dropdown-fixes.spec.ts +106 -106
  32. package/src/components/dropdown/__tests__/dropdown-value-types.spec.ts +213 -213
  33. package/src/components/dropdown/fix-multi-number.ts +92 -92
  34. package/src/components/dropdown/use-dropdown.ts +488 -488
  35. package/src/components/empty-state/empty-state.ts +50 -50
  36. package/src/components/file-upload/file-upload.ts +87 -87
  37. package/src/components/floating-action/floating-action.ts +12 -12
  38. package/src/components/input/input-contact-number/input-contact-number.ts +83 -83
  39. package/src/components/input/input-email/input-email.vue +17 -17
  40. package/src/components/input/input-password/use-input-password.ts +19 -19
  41. package/src/components/input/input-search/input-search.vue +13 -13
  42. package/src/components/input/input-url/input-url.vue +20 -20
  43. package/src/components/input/input-username/input-username.vue +17 -17
  44. package/src/components/input/input.vue +72 -72
  45. package/src/components/list/ladderized-list/ladderized-list.ts +39 -39
  46. package/src/components/list/list.vue +30 -20
  47. package/src/components/list/use-list.ts +1 -0
  48. package/src/components/logo/logo.ts +43 -43
  49. package/src/components/logo/logo.vue +14 -14
  50. package/src/components/logo/use-logo.ts +41 -41
  51. package/src/components/lozenge/lozenge.ts +61 -61
  52. package/src/components/modal/modal.ts +45 -45
  53. package/src/components/progress-bar/progress-bar.ts +39 -39
  54. package/src/components/radio/radio.ts +42 -42
  55. package/src/components/select/select.ts +144 -144
  56. package/src/components/sidenav/sidenav.ts +173 -173
  57. package/src/components/sidepanel/sidepanel.ts +100 -100
  58. package/src/components/sidepanel/sidepanel.vue +55 -55
  59. package/src/components/sidepanel/stacking-sidepanel/stacking-sidepanel.ts +16 -16
  60. package/src/components/sidepanel/stacking-sidepanel/stacking-sidepanel.vue +39 -39
  61. package/src/components/slider/slider.ts +38 -38
  62. package/src/components/snackbar/snack/snack.ts +71 -71
  63. package/src/components/snackbar/use-snackbar.ts +34 -34
  64. package/src/components/status/status.ts +19 -19
  65. package/src/components/status/status.vue +13 -13
  66. package/src/components/stepper/step/step.ts +47 -47
  67. package/src/components/stepper/stepper.ts +47 -47
  68. package/src/components/stepper/stepper.vue +34 -34
  69. package/src/components/switch/switch.ts +42 -42
  70. package/src/components/table/table-actions/table-actions.ts +42 -42
  71. package/src/components/table/table-actions/table-actions.vue +40 -40
  72. package/src/components/table/table-chips-title/table-chips-title.ts +27 -27
  73. package/src/components/table/table-chips-title/table-chips-title.vue +32 -32
  74. package/src/components/table/table-chips-title/use-table-chips-title.ts +22 -22
  75. package/src/components/table/table-lozenge-title/table-lozenge-title.ts +23 -23
  76. package/src/components/table/table-lozenge-title/table-lozenge-title.vue +26 -26
  77. package/src/components/table/table-lozenge-title/use-table-lozenge-title.ts +21 -21
  78. package/src/components/table/table-pagination/table-pagination.ts +63 -63
  79. package/src/components/table/table-pagination/table-pagination.vue +72 -72
  80. package/src/components/table/table.ts +173 -173
  81. package/src/components/tabs/tabs.ts +43 -43
  82. package/src/components/textarea/textarea.ts +72 -72
  83. package/src/components/textarea/textarea.vue +45 -45
  84. package/src/components/time-picker/time-picker.ts +69 -69
  85. package/src/components/tooltip/tooltip.ts +46 -46
  86. package/src/components/tooltip/use-tooltip.ts +13 -13
  87. package/src/examples/dropdown-number-multi-select.vue +76 -76
  88. package/src/stores/useSnackbarStore.ts +44 -44
  89. package/src/vite-env.d.ts +6 -0
@@ -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;
@@ -25,16 +25,21 @@
25
25
  @click="handleSelectedItem(item)"
26
26
  >
27
27
  <spr-checkbox v-if="props.multiSelect" :checked="isItemSelected(item)" />
28
- <div class="spr-flex spr-flex-auto spr-flex-col spr-justify-start">
29
- <span class="spr-text-left spr-text-xs">
30
- {{ item.text }}
31
- </span>
32
- <span v-if="item.subtext" class="spr-body-xs-regular spr-text-color-base spr-text-left">
33
- {{ item.subtext }}
34
- </span>
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>
32
+ <div class="spr-flex spr-flex-auto spr-flex-col spr-justify-start">
33
+ <span class="spr-text-left spr-text-xs">
34
+ {{ item.text }}
35
+ </span>
36
+ <span v-if="item.subtext" class="spr-body-xs-regular spr-text-color-base spr-text-left">
37
+ {{ item.subtext }}
38
+ </span>
39
+ </div>
35
40
  </div>
36
41
  <Icon
37
- v-if="isItemSelected(item) && !props.multiSelect"
42
+ v-if="isItemSelected(item) && !props.multiSelect && !props.noCheck"
38
43
  class="spr-text-color-brand-base spr-w-[1.39em]"
39
44
  icon="ph:check"
40
45
  />
@@ -64,24 +69,29 @@
64
69
  @click="handleSelectedItem(item)"
65
70
  >
66
71
  <spr-checkbox v-if="props.multiSelect" :disabled="item.disabled" :checked="isItemSelected(item)" />
67
- <div
68
- :class="[
69
- 'spr-flex spr-flex-auto spr-flex-col spr-justify-start',
70
- { 'spr-text-color-disabled': item.disabled },
71
- ]"
72
- >
73
- <span class="spr-text-left spr-text-xs">{{ item.text }}</span>
74
- <span
75
- v-if="item.subtext"
72
+ <div :class="[item.textColor, 'spr-flex spr-flex-row spr-items-center spr-gap-size-spacing-3xs']">
73
+ <span v-if="item.icon" :class="[item.iconColor, 'spr-mt-[2px]']"
74
+ ><icon :icon="item.icon" width="20px" height="20px"
75
+ /></span>
76
+ <div
76
77
  :class="[
77
- 'spr-body-xs-regular spr-text-color-base spr-text-left',
78
+ 'spr-flex spr-flex-auto spr-flex-col spr-justify-start',
78
79
  { 'spr-text-color-disabled': item.disabled },
79
80
  ]"
80
- >{{ item.subtext }}</span
81
81
  >
82
+ <span class="spr-text-left spr-text-xs">{{ item.text }}</span>
83
+ <span
84
+ v-if="item.subtext"
85
+ :class="[
86
+ 'spr-body-xs-regular spr-text-color-base spr-text-left',
87
+ { 'spr-text-color-disabled': item.disabled },
88
+ ]"
89
+ >{{ item.subtext }}</span
90
+ >
91
+ </div>
82
92
  </div>
83
93
  <Icon
84
- v-if="isItemSelected(item) && !props.multiSelect"
94
+ v-if="isItemSelected(item) && !props.multiSelect && !props.noCheck"
85
95
  class="spr-text-color-brand-base spr-w-[1.39em]"
86
96
  icon="ph:check"
87
97
  />
@@ -345,6 +345,7 @@ export const useList = (props: ListPropTypes, emit: SetupContext<ListEmitTypes>[
345
345
  'spr-background-color-single-active': isItemSelected(item) && !item.disabled && !noCheck.value,
346
346
  'hover:spr-cursor-not-allowed spr-flex spr-cursor-pointer spr-items-center spr-gap-1.5 spr-rounded-lg spr-p-2':
347
347
  item.disabled,
348
+ 'spr-justify-between': !props.multiSelect,
348
349
  });
349
350
 
350
351
  const handleSearch = () => {
@@ -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;