design-system-next 2.7.19 → 2.7.21

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.
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "design-system-next",
3
3
  "private": false,
4
- "version": "2.7.19",
4
+ "version": "2.7.21",
5
5
  "main": "./dist/design-system-next.js",
6
6
  "module": "./dist/design-system-next.js",
7
7
  "repository": {
@@ -41,6 +41,10 @@ export const calendarCellPropTypes = {
41
41
  type: String,
42
42
  default: '',
43
43
  },
44
+ icon: {
45
+ type: String,
46
+ default: '',
47
+ },
44
48
  };
45
49
 
46
50
  export type CalendarCellPropTypes = ExtractPropTypes<typeof calendarCellPropTypes>;
@@ -1,9 +1,10 @@
1
1
  <template>
2
2
  <div :class="getCalendarCellClassess.getMainClasses" @click="handleClick">
3
+ <slot name="prefix">
4
+ <Icon v-if="hasIconStatus" :icon="getCellIcon" />
5
+ </slot>
3
6
  <slot>
4
7
  <spr-status v-if="isError" :state="props.state" size="sm" />
5
- <Icon v-if="hasIconStatus" :icon="getCellIcon" />
6
-
7
8
  <div v-if="hasContent" class="spr-break-words">
8
9
  <div v-if="props.title" :class="getCalendarCellClassess.titleClasses">
9
10
  {{ props.title }}
@@ -53,11 +53,11 @@ export const useCalendarCell = (props: CalendarCellPropTypes, emit: SetupContext
53
53
  const isError = computed(() => props.status === 'error');
54
54
 
55
55
  const getShiftLabel = computed((): string => {
56
- return shiftLabels[props.type] || props.subDescription;
56
+ return props.subDescription || shiftLabels[props.type];
57
57
  });
58
58
 
59
59
  const getCellIcon = computed((): string => {
60
- return iconMap[props.type] || '';
60
+ return props.icon || iconMap[props.type];
61
61
  });
62
62
 
63
63
  const getCellClasses = computed((): string => {
@@ -7,10 +7,6 @@ export const textAreaPropTypes = {
7
7
  type: String,
8
8
  default: '',
9
9
  },
10
- modelValue: {
11
- type: String,
12
- default: '',
13
- },
14
10
  label: {
15
11
  type: String,
16
12
  default: '',
@@ -57,6 +53,10 @@ export const textAreaPropTypes = {
57
53
  type: String,
58
54
  default: '',
59
55
  },
56
+ hasCounter: {
57
+ type: Boolean,
58
+ default: false,
59
+ },
60
60
  };
61
61
 
62
62
  export const textAreaEmitTypes = {
@@ -7,18 +7,26 @@
7
7
  :class="textareaClasses.textAreaClasses"
8
8
  :rows="rows"
9
9
  :placeholder="placeholder"
10
- :value="modelValue"
11
10
  :minlength="props.minLength"
12
11
  :maxlength="props.maxLength"
13
12
  :readonly="readonly"
14
13
  :disabled="props.disabled"
15
14
  @input="onInput"
16
15
  ></textarea>
17
- <div v-if="props.displayHelper" :class="textareaClasses.helperClasses">
18
- <slot name="helperMessage">
19
- <Icon v-if="props.helperIcon" :icon="props.helperIcon" width="20px" height="20px" />
20
- <span>{{ props.helperText }}</span>
21
- </slot>
16
+
17
+ <div :class="textareaClasses.slotWrapperClasses">
18
+ <div v-if="props.displayHelper" :class="textareaClasses.helperClasses">
19
+ <slot name="helperMessage">
20
+ <Icon v-if="props.helperIcon" :icon="props.helperIcon" width="20px" height="20px" />
21
+ <span>{{ props.helperText }}</span>
22
+ </slot>
23
+ </div>
24
+
25
+ <div v-if="props.hasCounter && props.maxLength" :class="textareaClasses.helperClasses">
26
+ <slot name="counter">
27
+ <span>{{ `${$attrs.modelValue.length}/${props.maxLength}` }}</span>
28
+ </slot>
29
+ </div>
22
30
  </div>
23
31
  </div>
24
32
  </template>
@@ -39,7 +39,12 @@ export const useTextArea = (props: TextAreaPropTypes, emit: SetupContext<TextAre
39
39
  'spr-text-color-supporting': !error.value,
40
40
  });
41
41
 
42
- return { wrapperClasses, labelClasses, textAreaClasses, helperClasses };
42
+ const slotWrapperClasses = classNames('spr-flex spr-items-center', {
43
+ 'spr-justify-between': props.displayHelper && props.hasCounter,
44
+ 'spr-justify-end': !props.displayHelper && props.hasCounter,
45
+ });
46
+
47
+ return { wrapperClasses, labelClasses, textAreaClasses, helperClasses, slotWrapperClasses };
43
48
  });
44
49
 
45
50
  const onInput = (event: Event) => {
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
- }