design-system-next 2.12.1 → 2.12.3
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.
- package/dist/design-system-next.es.js +5986 -6186
- package/dist/design-system-next.es.js.gz +0 -0
- package/dist/design-system-next.umd.js +12 -12
- package/dist/design-system-next.umd.js.gz +0 -0
- package/dist/main.css +1 -1
- package/dist/main.css.gz +0 -0
- package/dist/package.json.d.ts +1 -1
- package/package.json +1 -1
- package/src/App.vue +49 -1
- package/src/assets/scripts/border-radius.ts +15 -15
- package/src/assets/scripts/colors.ts +134 -134
- package/src/assets/scripts/max-width.ts +11 -11
- package/src/assets/scripts/spacing.ts +23 -23
- package/src/assets/scripts/utilities.ts +15 -15
- package/src/components/accordion/accordion.ts +43 -43
- package/src/components/accordion/use-accordion.ts +43 -43
- package/src/components/avatar/avatar.ts +64 -64
- package/src/components/badge/badge.ts +43 -43
- package/src/components/banner/banner.ts +20 -20
- package/src/components/button/button.ts +72 -72
- package/src/components/button/button.vue +15 -15
- package/src/components/card/card.ts +52 -52
- package/src/components/checkbox/checkbox.ts +45 -45
- package/src/components/chips/chips.ts +101 -95
- package/src/components/chips/use-chips.ts +11 -3
- package/src/components/collapsible/collapsible.ts +21 -21
- package/src/components/collapsible/collapsible.vue +27 -27
- package/src/components/date-picker/__tests__/date-picker.test.ts +112 -112
- package/src/components/date-picker/date-picker.ts +157 -157
- package/src/components/dropdown/__tests__/dropdown-fixes.spec.ts +106 -106
- package/src/components/dropdown/__tests__/dropdown-value-types.spec.ts +213 -213
- package/src/components/dropdown/fix-multi-number.ts +92 -92
- package/src/components/dropdown/use-dropdown.ts +488 -488
- package/src/components/empty-state/empty-state.ts +50 -50
- package/src/components/file-upload/file-upload.ts +87 -87
- package/src/components/floating-action/floating-action.ts +12 -12
- package/src/components/input/input-contact-number/input-contact-number.ts +83 -83
- package/src/components/input/input-email/input-email.vue +17 -17
- package/src/components/input/input-password/use-input-password.ts +19 -19
- package/src/components/input/input-search/input-search.vue +13 -13
- package/src/components/input/input-url/input-url.vue +20 -20
- package/src/components/input/input-username/input-username.vue +17 -17
- package/src/components/input/input.vue +72 -72
- package/src/components/list/ladderized-list/ladderized-list.ts +39 -39
- package/src/components/logo/logo.ts +43 -43
- package/src/components/logo/logo.vue +14 -14
- package/src/components/logo/use-logo.ts +41 -41
- package/src/components/modal/modal.ts +45 -45
- package/src/components/progress-bar/progress-bar.ts +39 -39
- package/src/components/radio/radio.ts +42 -42
- package/src/components/select/select.ts +144 -144
- package/src/components/sidepanel/sidepanel.vue +55 -55
- package/src/components/sidepanel/stacking-sidepanel/stacking-sidepanel.ts +16 -16
- package/src/components/sidepanel/stacking-sidepanel/stacking-sidepanel.vue +39 -39
- package/src/components/slider/slider.ts +38 -38
- package/src/components/snackbar/snack/snack.ts +71 -71
- package/src/components/snackbar/use-snackbar.ts +34 -34
- package/src/components/status/status.ts +19 -19
- package/src/components/status/status.vue +13 -13
- package/src/components/stepper/step/step.ts +47 -47
- package/src/components/stepper/stepper.ts +47 -47
- package/src/components/stepper/stepper.vue +34 -34
- package/src/components/switch/switch.ts +42 -42
- package/src/components/table/table-actions/table-actions.ts +42 -42
- package/src/components/table/table-actions/table-actions.vue +40 -40
- package/src/components/table/table-chips-title/table-chips-title.ts +27 -27
- package/src/components/table/table-chips-title/table-chips-title.vue +32 -32
- package/src/components/table/table-chips-title/use-table-chips-title.ts +22 -22
- package/src/components/table/table-lozenge-title/table-lozenge-title.ts +23 -23
- package/src/components/table/table-lozenge-title/table-lozenge-title.vue +26 -26
- package/src/components/table/table-lozenge-title/use-table-lozenge-title.ts +21 -21
- package/src/components/table/table-pagination/table-pagination.ts +63 -63
- package/src/components/table/table-pagination/table-pagination.vue +72 -72
- package/src/components/table/table.ts +174 -173
- package/src/components/table/table.vue +1 -1
- package/src/components/table/use-table.ts +13 -8
- package/src/components/tabs/tabs.ts +43 -43
- package/src/components/textarea/textarea.ts +72 -72
- package/src/components/textarea/textarea.vue +45 -45
- package/src/components/time-picker/time-picker.ts +69 -69
- package/src/components/tooltip/use-tooltip.ts +13 -13
- package/src/examples/dropdown-number-multi-select.vue +76 -76
- package/src/stores/useSnackbarStore.ts +44 -44
- 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;
|
|
@@ -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,45 +1,45 @@
|
|
|
1
|
-
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
-
|
|
3
|
-
export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
|
|
4
|
-
|
|
5
|
-
const MODAL_SIZE = ['sm', 'md', 'lg', 'xl'] as const;
|
|
6
|
-
|
|
7
|
-
export const modalPropTypes = {
|
|
8
|
-
modelValue: {
|
|
9
|
-
type: Boolean,
|
|
10
|
-
default: false,
|
|
11
|
-
},
|
|
12
|
-
title: {
|
|
13
|
-
type: String,
|
|
14
|
-
default: '',
|
|
15
|
-
},
|
|
16
|
-
closeButtonX: {
|
|
17
|
-
type: Boolean,
|
|
18
|
-
default: true,
|
|
19
|
-
},
|
|
20
|
-
contentPadding: {
|
|
21
|
-
type: Boolean,
|
|
22
|
-
default: true,
|
|
23
|
-
},
|
|
24
|
-
hasFooter: {
|
|
25
|
-
type: Boolean,
|
|
26
|
-
default: true,
|
|
27
|
-
},
|
|
28
|
-
size: {
|
|
29
|
-
type: String as PropType<(typeof MODAL_SIZE)[number]>,
|
|
30
|
-
validator: (value: (typeof MODAL_SIZE)[number]) => MODAL_SIZE.includes(value),
|
|
31
|
-
default: 'md',
|
|
32
|
-
},
|
|
33
|
-
staticBackdrop: {
|
|
34
|
-
type: Boolean,
|
|
35
|
-
default: false,
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export type ModalPropTypes = ExtractPropTypes<typeof modalPropTypes>;
|
|
40
|
-
|
|
41
|
-
export const modalEmitTypes = {
|
|
42
|
-
'update:modelValue': (value: boolean) => value,
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export type ModalEmitTypes = typeof modalEmitTypes;
|
|
1
|
+
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
|
|
4
|
+
|
|
5
|
+
const MODAL_SIZE = ['sm', 'md', 'lg', 'xl'] as const;
|
|
6
|
+
|
|
7
|
+
export const modalPropTypes = {
|
|
8
|
+
modelValue: {
|
|
9
|
+
type: Boolean,
|
|
10
|
+
default: false,
|
|
11
|
+
},
|
|
12
|
+
title: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: '',
|
|
15
|
+
},
|
|
16
|
+
closeButtonX: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: true,
|
|
19
|
+
},
|
|
20
|
+
contentPadding: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: true,
|
|
23
|
+
},
|
|
24
|
+
hasFooter: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: true,
|
|
27
|
+
},
|
|
28
|
+
size: {
|
|
29
|
+
type: String as PropType<(typeof MODAL_SIZE)[number]>,
|
|
30
|
+
validator: (value: (typeof MODAL_SIZE)[number]) => MODAL_SIZE.includes(value),
|
|
31
|
+
default: 'md',
|
|
32
|
+
},
|
|
33
|
+
staticBackdrop: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: false,
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export type ModalPropTypes = ExtractPropTypes<typeof modalPropTypes>;
|
|
40
|
+
|
|
41
|
+
export const modalEmitTypes = {
|
|
42
|
+
'update:modelValue': (value: boolean) => value,
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export type ModalEmitTypes = typeof modalEmitTypes;
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
-
|
|
3
|
-
const PROGRESS_BAR_SIZES = ['xs', 'sm', 'lg'] as const;
|
|
4
|
-
|
|
5
|
-
export const progressBarPropTypes = {
|
|
6
|
-
size: {
|
|
7
|
-
type: String as PropType<(typeof PROGRESS_BAR_SIZES)[number]>,
|
|
8
|
-
validator: (value: (typeof PROGRESS_BAR_SIZES)[number]) => PROGRESS_BAR_SIZES.includes(value),
|
|
9
|
-
default: 'lg',
|
|
10
|
-
},
|
|
11
|
-
label: {
|
|
12
|
-
type: Boolean,
|
|
13
|
-
default: true,
|
|
14
|
-
},
|
|
15
|
-
value: {
|
|
16
|
-
type: Number,
|
|
17
|
-
default: 0,
|
|
18
|
-
validator(value: number, props: { max: number }) {
|
|
19
|
-
if (value < 0 || value > props.max) {
|
|
20
|
-
console.error(`Invalid prop: "value" (${value}) must be between 0 and ${props.max}.`);
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
return true;
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
max: {
|
|
27
|
-
type: Number,
|
|
28
|
-
default: 100,
|
|
29
|
-
validator(value: number) {
|
|
30
|
-
if (value <= 0 || value > 100) {
|
|
31
|
-
console.error('Invalid prop: "max" must be between 1 and 100.');
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
return true;
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export type ProgressBarPropTypes = ExtractPropTypes<typeof progressBarPropTypes>;
|
|
1
|
+
import { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
const PROGRESS_BAR_SIZES = ['xs', 'sm', 'lg'] as const;
|
|
4
|
+
|
|
5
|
+
export const progressBarPropTypes = {
|
|
6
|
+
size: {
|
|
7
|
+
type: String as PropType<(typeof PROGRESS_BAR_SIZES)[number]>,
|
|
8
|
+
validator: (value: (typeof PROGRESS_BAR_SIZES)[number]) => PROGRESS_BAR_SIZES.includes(value),
|
|
9
|
+
default: 'lg',
|
|
10
|
+
},
|
|
11
|
+
label: {
|
|
12
|
+
type: Boolean,
|
|
13
|
+
default: true,
|
|
14
|
+
},
|
|
15
|
+
value: {
|
|
16
|
+
type: Number,
|
|
17
|
+
default: 0,
|
|
18
|
+
validator(value: number, props: { max: number }) {
|
|
19
|
+
if (value < 0 || value > props.max) {
|
|
20
|
+
console.error(`Invalid prop: "value" (${value}) must be between 0 and ${props.max}.`);
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
return true;
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
max: {
|
|
27
|
+
type: Number,
|
|
28
|
+
default: 100,
|
|
29
|
+
validator(value: number) {
|
|
30
|
+
if (value <= 0 || value > 100) {
|
|
31
|
+
console.error('Invalid prop: "max" must be between 1 and 100.');
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
return true;
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export type ProgressBarPropTypes = ExtractPropTypes<typeof progressBarPropTypes>;
|