design-system-next 2.7.23 → 2.7.28

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.
@@ -6,8 +6,8 @@ import type { AvatarPropTypes } from './avatar';
6
6
 
7
7
  interface AvatarClasses {
8
8
  baseClasses: string;
9
- imageClasses: string;
10
- nameInitialsClasses: string;
9
+ imageContainerClasses: string;
10
+ initialsContainerClasses: string;
11
11
  notificationClasses: string;
12
12
  onlineNotificationClasses: string;
13
13
  }
@@ -22,20 +22,32 @@ export const useAvatar = (props: AvatarPropTypes) => {
22
22
  'spr-background-color spr-border-color-success-base spr-border spr-border-solid': color.value === 'tertiary',
23
23
  });
24
24
 
25
- const imageClasses = classNames(
25
+ const imageContainerClasses = classNames(
26
+ 'avatar__slot spr-border-color-weak spr-border spr-border-solid',
26
27
  'spr-rounded-full spr-object-cover spr-flex spr-items-center spr-justify-center spr-overflow-hidden',
27
28
  {
28
29
  'spr-h-20 spr-min-w-20 spr-text-[36px]': size.value === '2xl',
29
30
  'spr-h-14 spr-min-w-14 spr-font-size-600': size.value === 'xl',
30
31
  'spr-h-10 spr-min-w-10 spr-font-size-400': size.value === 'lg',
31
- 'spr-h-9 spr-min-w-9 spr-font-size-300': size.value === 'md',
32
- 'spr-h-6 spr-min-w-6 spr-font-size-200': size.value === 'sm',
33
- 'spr-h-5 spr-min-w-5 spr-text-[10px]': size.value === 'xs',
34
- 'spr-h-4 spr-min-w-4 spr-text-[10px]': size.value === '2xs',
32
+ 'spr-h-9 spr-min-w-9 spr-font-size-300': size.value === 'md',
33
+ 'spr-h-6 spr-min-w-6 spr-font-size-200': size.value === 'sm',
34
+ 'spr-h-5 spr-min-w-5 spr-text-[10px]': size.value === 'xs',
35
+ 'spr-h-4 spr-min-w-4 spr-text-[10px]': size.value === '2xs',
36
+ },
37
+
38
+ // Image Size
39
+ {
40
+ '[&>img]:spr-h-20 [&>img]:spr-w-20 [&>img]:spr-min-h-20 [&>img]:spr-min-w-20': size.value === '2xl',
41
+ '[&>img]:spr-h-14 [&>img]:spr-w-14 [&>img]:spr-min-h-14 [&>img]:spr-min-w-14': size.value === 'xl',
42
+ '[&>img]:spr-h-10 [&>img]:spr-w-10 [&>img]:spr-min-h-10 [&>img]:spr-min-w-10': size.value === 'lg',
43
+ '[&>img]:spr-h-9 [&>img]:spr-w-9 [&>img]:spr-min-h-9 [&>img]:spr-min-w-9': size.value === 'md',
44
+ '[&>img]:spr-h-6 [&>img]:spr-w-6 [&>img]:spr-min-h-6 [&>img]:spr-min-w-6': size.value === 'sm',
45
+ '[&>img]:spr-h-5 [&>img]:spr-w-5 [&>img]:spr-min-h-5 [&>img]:spr-min-w-5': size.value === 'xs',
46
+ '[&>img]:spr-h-4 [&>img]:spr-w-4 [&>img]:spr-min-h-4 [&>img]:spr-min-w-4': size.value === '2xs',
35
47
  },
36
48
  );
37
49
 
38
- const nameInitialsClasses = classNames(
50
+ const initialsContainerClasses = classNames(
39
51
  'spr-rounded-full spr-border-color-weak spr-border spr-border-solid spr-items-center spr-flex spr-justify-center spr-heading-xs spr-text-color-strong',
40
52
  {
41
53
  'spr-h-20 spr-min-w-20': size.value === '2xl',
@@ -67,8 +79,8 @@ export const useAvatar = (props: AvatarPropTypes) => {
67
79
 
68
80
  return {
69
81
  baseClasses,
70
- imageClasses,
71
- nameInitialsClasses,
82
+ imageContainerClasses,
83
+ initialsContainerClasses,
72
84
  notificationClasses,
73
85
  onlineNotificationClasses,
74
86
  };
@@ -68,11 +68,16 @@
68
68
 
69
69
  <script lang="ts" setup>
70
70
  import { Menu } from 'floating-vue';
71
+
71
72
  import 'floating-vue/dist/style.css';
72
- import { dropdownPropTypes, dropdownEmitTypes } from './dropdown';
73
- import { useDropdown } from './use-dropdown';
73
+
74
74
  import SprList from '../list/list.vue';
75
75
  import SprLadderizedList from '../list/ladderized-list/ladderized-list.vue';
76
+
77
+ import { dropdownPropTypes, dropdownEmitTypes } from './dropdown';
78
+
79
+ import { useDropdown } from './use-dropdown';
80
+
76
81
  const props = defineProps(dropdownPropTypes);
77
82
  const emit = defineEmits(dropdownEmitTypes);
78
83
 
@@ -20,7 +20,9 @@ export const useDropdown = (props: DropdownPropTypes, emit: SetupContext<Dropdow
20
20
  const dropdownPopperState = ref<boolean>(false);
21
21
  const isDropdownPopperDisabled = computed(() => disabled.value);
22
22
 
23
- const isLadderizedSearch = computed(() => (ladderized.value && searchString.value !== '' && dropdownValue.value.length === 0))
23
+ const isLadderizedSearch = computed(
24
+ () => ladderized.value && searchString.value !== '' && dropdownValue.value.length === 0,
25
+ );
24
26
 
25
27
  const initializeMenuList = () => {
26
28
  dropdownMenuList.value = [...menuList.value];
@@ -131,6 +133,7 @@ export const useDropdown = (props: DropdownPropTypes, emit: SetupContext<Dropdow
131
133
  // generate dropdown value if ladderized with search string
132
134
  dropdownValue.value = [selectedItems[0].subvalue ?? '', selectedItems[0].value];
133
135
  }
136
+
134
137
  setTimeout(() => {
135
138
  dropdownPopperState.value = false;
136
139
  }, 10);
@@ -175,6 +178,6 @@ export const useDropdown = (props: DropdownPropTypes, emit: SetupContext<Dropdow
175
178
  handleSelectedLadderizedItem,
176
179
  dropdownValue,
177
180
  removeCurrentLevelInBackLabel,
178
- isLadderizedSearch
181
+ isLadderizedSearch,
179
182
  };
180
183
  };
@@ -30,7 +30,7 @@ export const filterPropTypes = {
30
30
  },
31
31
  id: {
32
32
  type: String,
33
- default: '',
33
+ default: 'spr-filter',
34
34
  },
35
35
  filterMenu: {
36
36
  type: Array as PropType<FilterPropsInterface['filterMenu']>,
@@ -24,7 +24,7 @@
24
24
  >
25
25
  <slot>
26
26
  <spr-input
27
- id="search"
27
+ :id="props.id"
28
28
  v-model="searchValue"
29
29
  type="text"
30
30
  :placeholder="placeholder"
@@ -105,10 +105,10 @@
105
105
 
106
106
  <div class="spr-p-size-spacing-2xs">
107
107
  <spr-input
108
- id="search"
108
+ :id="`${props.id}-search`"
109
109
  v-model="filterMenuSearchvalue"
110
110
  type="text"
111
- placeholder="Select Employees"
111
+ placeholder="Search"
112
112
  >
113
113
  <template #icon>
114
114
  <Icon icon="ph:magnifying-glass" />
@@ -32,7 +32,7 @@ export const INPUT_TYPES = [
32
32
  export const inputPropTypes = {
33
33
  id: {
34
34
  type: String,
35
- default: '',
35
+ default: 'spr-input',
36
36
  },
37
37
  modelValue: {
38
38
  type: String,
@@ -9,8 +9,9 @@
9
9
  <slot name="prefix" />
10
10
  </div>
11
11
  <input
12
- ref="inputTextRef"
13
12
  v-bind="$attrs"
13
+ :id="props.id"
14
+ ref="inputTextRef"
14
15
  :class="[inputClasses.inputTextClasses, { 'number-input': props.type === 'number' }]"
15
16
  :placeholder="props.placeholder"
16
17
  :type="props.type"
@@ -117,13 +117,17 @@ export const useList = (props: ListPropTypes, emit: SetupContext<ListEmitTypes>[
117
117
  const index = selectedItems.value.findIndex((selectedItem: MenuListType) => selectedItem.value === item.value);
118
118
 
119
119
  if (index === -1) {
120
- selectedItems.value.push(item);
120
+ selectedItems.value = [...selectedItems.value, item];
121
121
  } else {
122
- selectedItems.value.splice(index, 1);
122
+ const updatedItems = [...selectedItems.value];
123
+
124
+ updatedItems.splice(index, 1);
125
+
126
+ selectedItems.value = updatedItems;
123
127
  }
124
- emit('update:modelValue', selectedItems.value);
125
128
  }
126
129
  };
130
+
127
131
  // #endregion - Helper Methods
128
132
 
129
133
  watch(menuList, () => {
@@ -7,10 +7,10 @@ import type { TabsPropTypes, TabsEmitTypes } from './tabs';
7
7
  export const useTabs = (props: TabsPropTypes, emit: SetupContext<TabsEmitTypes>['emit']) => {
8
8
  const tabsClasses = computed(() => {
9
9
  return classNames({
10
- 'spr-relative spr-px-size-spacing-xs spr-py-size-spacing-3xs spr-body-sm spr-text-color-strong spr-group': true,
10
+ 'spr-relative spr-px-size-spacing-xs spr-body-sm spr-text-color-strong spr-group': true,
11
11
  'spr-transition-left spr-duration-150 spr-ease-in-out': true,
12
- capitalize: !props.underlined,
13
- 'spr-uppercase spr-border-x-0 spr-border-t-0': props.underlined,
12
+ 'capitalize spr-py-size-spacing-3xs': !props.underlined,
13
+ 'spr-uppercase spr-border-x-0 spr-border-t-0 spr-py-size-spacing-xs': props.underlined,
14
14
  });
15
15
  });
16
16
 
package/src/vite-env.d.ts DELETED
@@ -1,6 +0,0 @@
1
- interface ImportMeta { readonly glob: ImportMetaGlob }
2
-
3
- interface ImportMetaGlob {
4
- (pattern: string, options?: { eager?: boolean }): Record<string, () => Promise<unknown>>
5
- (pattern: string, options?: { eager: true }): Record<string, unknown>
6
- }