@bethinkpl/design-system 34.2.2 → 35.0.1

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 (25) hide show
  1. package/dist/design-system.css +1 -1
  2. package/dist/design-system.js +4883 -4954
  3. package/dist/design-system.js.map +1 -1
  4. package/dist/lib/js/components/Pagination/Pagination.vue.d.ts +73 -435
  5. package/dist/lib/js/components/SelectList/SelectListItem/SelectListItem.vue.d.ts +36 -449
  6. package/dist/lib/js/components/SelectList/SelectListItemContainer/SelectListItemContainer.vue.d.ts +11 -0
  7. package/dist/lib/js/components/SelectList/SelectListItemToggle/SelectListItemToggle.vue.d.ts +80 -441
  8. package/dist/lib/js/components/TextGroup/TextGroup.consts.d.ts +1 -0
  9. package/dist/lib/js/components/Toast/Toast.vue.d.ts +2 -8
  10. package/dist/lib/js/index.d.ts +2 -2
  11. package/lib/js/components/Buttons/IconButton/IconButton.vue +2 -1
  12. package/lib/js/components/Divider/Divider.vue +1 -0
  13. package/lib/js/components/SelectList/SelectListItem/SelectListItem.stories.ts +26 -16
  14. package/lib/js/components/SelectList/SelectListItem/SelectListItem.vue +29 -73
  15. package/lib/js/components/SelectList/SelectListItemContainer/SelectListItemContainer.stories.ts +35 -0
  16. package/lib/js/components/SelectList/SelectListItemContainer/SelectListItemContainer.vue +19 -0
  17. package/lib/js/components/SelectList/SelectListItemToggle/SelectListItemToggle.vue +3 -3
  18. package/lib/js/components/TextGroup/TextGroup.consts.ts +1 -0
  19. package/lib/js/components/TextGroup/TextGroup.vue +21 -0
  20. package/lib/js/components/Toast/Toast.vue +1 -1
  21. package/lib/js/index.ts +2 -2
  22. package/lib/js/utils/device.ts +4 -3
  23. package/package.json +4 -3
  24. package/lib/js/components/SelectList/SelectListItemTile/SelectListItemTile.stories.ts +0 -60
  25. package/lib/js/components/SelectList/SelectListItemTile/SelectListItemTile.vue +0 -41
@@ -1,5 +1,8 @@
1
1
  import SelectListItem from './SelectListItem.vue';
2
2
  import { ICONS } from '../../Icons/Icon';
3
+ import SlotPlaceholder, {
4
+ SLOT_PLACEHOLDER_SIZES,
5
+ } from '../../../../../.storybook/SlotPlaceholder/SlotPlaceholder.vue';
3
6
 
4
7
  import { Args, ArgTypes, Meta, StoryFn } from '@storybook/vue3';
5
8
  import {
@@ -14,27 +17,30 @@ export default {
14
17
  } as Meta<typeof SelectListItem>;
15
18
 
16
19
  const StoryTemplate: StoryFn<typeof SelectListItem> = (args) => ({
17
- components: { SelectListItem },
20
+ components: { SelectListItem, SlotPlaceholder },
18
21
  setup() {
19
- return args;
22
+ return {
23
+ args,
24
+ ICONS,
25
+ SLOT_PLACEHOLDER_SIZES,
26
+ };
20
27
  },
21
28
  template: `
22
29
  <select-list-item
23
- :icon-left="ICONS[iconLeft]"
24
- :label="label"
25
- :eyebrow-text="eyebrowText"
26
- :is-eyebrow-text-uppercase="isEyebrowTextUppercase"
27
- :is-selected="isSelected"
28
- :selection-mode="selectionMode"
29
- :size="size"
30
- :state="state"
31
- />
30
+ :icon-left="ICONS[args.iconLeft]"
31
+ :label="args.label"
32
+ :eyebrow-text="args.eyebrowText"
33
+ :is-eyebrow-text-uppercase="args.isEyebrowTextUppercase"
34
+ :is-selected="args.isSelected"
35
+ :selection-mode="args.selectionMode"
36
+ :size="args.size"
37
+ :state="args.state"
38
+ >
39
+ <template v-if="args.accessorySlot" #accessory>
40
+ <slot-placeholder :size="SLOT_PLACEHOLDER_SIZES.SMALL" :label="args.accessorySlot" />
41
+ </template>
42
+ </select-list-item>
32
43
  `,
33
- data() {
34
- return {
35
- ICONS: Object.freeze(ICONS),
36
- };
37
- },
38
44
  });
39
45
 
40
46
  export const Interactive = StoryTemplate.bind({});
@@ -48,6 +54,7 @@ const args = {
48
54
  state: SELECT_LIST_ITEM_STATES.DEFAULT,
49
55
  isSelected: false,
50
56
  selectionMode: SELECT_LIST_ITEM_SELECTION_MODE.SELECT_ONLY,
57
+ accessorySlot: 'accessory',
51
58
  } as Args;
52
59
 
53
60
  const argTypes = {
@@ -67,6 +74,9 @@ const argTypes = {
67
74
  control: 'select',
68
75
  options: Object.values(SELECT_LIST_ITEM_STATES),
69
76
  },
77
+ accessorySlot: {
78
+ control: 'text',
79
+ },
70
80
  } as ArgTypes;
71
81
 
72
82
  Interactive.argTypes = argTypes;
@@ -10,6 +10,8 @@
10
10
  }"
11
11
  :title="label"
12
12
  >
13
+ <slot name="accessory" />
14
+
13
15
  <ds-icon
14
16
  v-if="iconLeft || isLoading"
15
17
  class="ds-selectListItem__iconLeft"
@@ -54,6 +56,7 @@
54
56
  color: $color-neutral-text-heavy;
55
57
  cursor: pointer;
56
58
  display: flex;
59
+ gap: $space-3xs;
57
60
  min-height: $minHeight;
58
61
  padding: $space-xs;
59
62
 
@@ -100,7 +103,6 @@
100
103
 
101
104
  &__iconLeft {
102
105
  color: $color-neutral-icon;
103
- margin-right: $space-3xs;
104
106
  }
105
107
 
106
108
  &__iconRight {
@@ -160,7 +162,8 @@
160
162
  }
161
163
  </style>
162
164
 
163
- <script lang="ts">
165
+ <script setup lang="ts">
166
+ import { computed } from 'vue';
164
167
  import {
165
168
  SELECT_LIST_ITEM_SELECTION_MODE,
166
169
  SELECT_LIST_ITEM_SIZES,
@@ -169,75 +172,28 @@ import {
169
172
  SelectListItemSize,
170
173
  SelectListItemState,
171
174
  } from './SelectListItem.consts';
172
- import DsIcon, { ICON_SIZES, ICONS } from '../../Icons/Icon';
173
- import { defineComponent, toRaw } from 'vue';
174
-
175
- export default defineComponent({
176
- name: 'SelectListItem',
177
- components: {
178
- DsIcon,
179
- },
180
- props: {
181
- iconLeft: {
182
- type: Object,
183
- default: null,
184
- validator(icon) {
185
- return Object.values(ICONS).includes(toRaw(icon));
186
- },
187
- },
188
- isSelected: {
189
- type: Boolean,
190
- default: false,
191
- },
192
- label: {
193
- type: String,
194
- required: true,
195
- },
196
- eyebrowText: {
197
- type: String,
198
- default: '',
199
- },
200
- isEyebrowTextUppercase: {
201
- type: Boolean,
202
- default: false,
203
- },
204
- selectionMode: {
205
- type: String,
206
- default: SELECT_LIST_ITEM_SELECTION_MODE.SELECT_ONLY,
207
- validator(selectionMode: SelectListItemSelectionMode) {
208
- return Object.values(SELECT_LIST_ITEM_SELECTION_MODE).includes(selectionMode);
209
- },
210
- },
211
- size: {
212
- type: String,
213
- default: SELECT_LIST_ITEM_SIZES.SMALL,
214
- validator(size: SelectListItemSize) {
215
- return Object.values(SELECT_LIST_ITEM_SIZES).includes(size);
216
- },
217
- },
218
- state: {
219
- type: String,
220
- default: SELECT_LIST_ITEM_STATES.DEFAULT,
221
- validator(state: SelectListItemState) {
222
- return Object.values(SELECT_LIST_ITEM_STATES).includes(state);
223
- },
224
- },
225
- },
226
- data() {
227
- return {
228
- ICON_SIZES: Object.freeze(ICON_SIZES),
229
- ICONS: Object.freeze(ICONS),
230
- SELECT_LIST_ITEM_SELECTION_MODE: Object.freeze(SELECT_LIST_ITEM_SELECTION_MODE),
231
- SELECT_LIST_ITEM_STATES: Object.freeze(SELECT_LIST_ITEM_STATES),
232
- };
233
- },
234
- computed: {
235
- isLoading(): boolean {
236
- return this.state === SELECT_LIST_ITEM_STATES.LOADING;
237
- },
238
- isDisabled(): boolean {
239
- return this.state === SELECT_LIST_ITEM_STATES.DISABLED;
240
- },
241
- },
242
- });
175
+ import DsIcon, { ICON_SIZES, ICONS, IconItem } from '../../Icons/Icon';
176
+
177
+ const {
178
+ iconLeft = null,
179
+ isSelected = false,
180
+ label,
181
+ eyebrowText = '',
182
+ isEyebrowTextUppercase = false,
183
+ selectionMode = SELECT_LIST_ITEM_SELECTION_MODE.SELECT_ONLY,
184
+ size = SELECT_LIST_ITEM_SIZES.SMALL,
185
+ state = SELECT_LIST_ITEM_STATES.DEFAULT,
186
+ } = defineProps<{
187
+ iconLeft?: IconItem | null;
188
+ isSelected?: boolean;
189
+ label: string;
190
+ eyebrowText?: string;
191
+ isEyebrowTextUppercase?: boolean;
192
+ selectionMode?: SelectListItemSelectionMode;
193
+ size?: SelectListItemSize;
194
+ state?: SelectListItemState;
195
+ }>();
196
+
197
+ const isLoading = computed(() => state === SELECT_LIST_ITEM_STATES.LOADING);
198
+ const isDisabled = computed(() => state === SELECT_LIST_ITEM_STATES.DISABLED);
243
199
  </script>
@@ -0,0 +1,35 @@
1
+ import SelectListItemContainer from './SelectListItemContainer.vue';
2
+ import Tile from '../../Tile';
3
+ import { TILE_STATES } from '../../Tile';
4
+
5
+ import { Meta, StoryFn } from '@storybook/vue3';
6
+
7
+ export default {
8
+ title: 'Components/SelectList/SelectListItemContainer',
9
+ component: SelectListItemContainer,
10
+ } as Meta<typeof SelectListItemContainer>;
11
+
12
+ const StoryTemplate: StoryFn<typeof SelectListItemContainer> = () => ({
13
+ components: { SelectListItemContainer, DsTile: Tile },
14
+ template: `
15
+ <select-list-item-container>
16
+ <ds-tile
17
+ text="this is a text text"
18
+ eyebrow-text="this is an eyebrowText text"
19
+ additional-text="this is some additionalText"
20
+ :interactive="false"
21
+ :state="TILE_STATES.DEFAULT"
22
+ />
23
+ </select-list-item-container>
24
+ `,
25
+ data: () => ({ TILE_STATES }),
26
+ });
27
+
28
+ export const Default = StoryTemplate.bind({});
29
+
30
+ Default.parameters = {
31
+ design: {
32
+ type: 'figma',
33
+ url: 'https://www.figma.com/design/izQdYyiBR1GQgFkaOIfIJI/LMS---DS-Components?node-id=5367-94238&m=dev',
34
+ },
35
+ };
@@ -0,0 +1,19 @@
1
+ <template>
2
+ <div class="ds-selectListItemContainer">
3
+ <slot />
4
+ </div>
5
+ </template>
6
+
7
+ <style scoped lang="scss">
8
+ @import '../../../../styles/settings/spacings';
9
+
10
+ .ds-selectListItemContainer {
11
+ padding: $space-2xs $space-xs;
12
+ }
13
+ </style>
14
+
15
+ <script setup lang="ts">
16
+ defineOptions({
17
+ name: 'SelectListItemContainer',
18
+ });
19
+ </script>
@@ -19,7 +19,7 @@ import {
19
19
  } from '../SelectListItem/SelectListItem.consts';
20
20
  import { IconItem, ICONS } from '../../Icons/Icon';
21
21
  import SelectListItem from '../SelectListItem/SelectListItem.vue';
22
- import { defineComponent, toRaw } from 'vue';
22
+ import { defineComponent, PropType, toRaw } from 'vue';
23
23
 
24
24
  export default defineComponent({
25
25
  name: 'SelectListItemToggle',
@@ -54,14 +54,14 @@ export default defineComponent({
54
54
  required: true,
55
55
  },
56
56
  size: {
57
- type: String,
57
+ type: String as PropType<SelectListItemSize>,
58
58
  default: SELECT_LIST_ITEM_SIZES.SMALL,
59
59
  validator(size: SelectListItemSize) {
60
60
  return Object.values(SELECT_LIST_ITEM_SIZES).includes(size);
61
61
  },
62
62
  },
63
63
  state: {
64
- type: String,
64
+ type: String as PropType<SelectListItemState>,
65
65
  default: SELECT_LIST_ITEM_STATES.DEFAULT,
66
66
  validator(state: SelectListItemState) {
67
67
  return Object.values(SELECT_LIST_ITEM_STATES).includes(state);
@@ -10,6 +10,7 @@ export const TEXT_GROUP_LOADING_SIZES = {
10
10
  };
11
11
 
12
12
  export const TEXT_GROUP_SIZES = {
13
+ X_SMALL: 'x-small',
13
14
  SMALL: 'small',
14
15
  MEDIUM: 'medium',
15
16
  };
@@ -2,6 +2,7 @@
2
2
  <div
3
3
  class="ds-textGroup"
4
4
  :class="{
5
+ '-ds-x-small': size === TEXT_GROUP_SIZES.X_SMALL,
5
6
  '-ds-small': size === TEXT_GROUP_SIZES.SMALL,
6
7
 
7
8
  '-ds-hovered': state === TEXT_GROUP_STATES.HOVERED,
@@ -281,6 +282,26 @@ $text-group-colors: (
281
282
  }
282
283
  }
283
284
 
285
+ &.-ds-x-small {
286
+ #{$self}__eyebrow {
287
+ @include info-xs-default-bold;
288
+
289
+ margin-bottom: 0;
290
+
291
+ &.-ds-uppercase {
292
+ @include info-xs-extensive-bold-uppercase;
293
+ }
294
+ }
295
+
296
+ #{$self}__main {
297
+ @include info-s-default-bold;
298
+ }
299
+
300
+ #{$self}__supporting {
301
+ @include info-s-default-regular;
302
+ }
303
+ }
304
+
284
305
  &.-ds-interactive:hover,
285
306
  &.-ds-hovered {
286
307
  cursor: pointer;
@@ -140,7 +140,7 @@ export default defineComponent({
140
140
  default: TOAST_POSITIONS.CENTER,
141
141
  },
142
142
  boundariesSelector: {
143
- type: [String, HTMLElement],
143
+ type: [String, Object] as PropType<string | HTMLElement>,
144
144
  default: null,
145
145
  },
146
146
  color: {
package/lib/js/index.ts CHANGED
@@ -127,8 +127,8 @@ export { default as SelectListItemDivider } from './components/SelectList/Select
127
127
  export { default as DsSelectListItemDivider } from './components/SelectList/SelectListItemDivider/SelectListItemDivider.vue';
128
128
  export { default as SelectListItemToggle } from './components/SelectList/SelectListItemToggle/SelectListItemToggle.vue';
129
129
  export { default as DsSelectListItemToggle } from './components/SelectList/SelectListItemToggle/SelectListItemToggle.vue';
130
- export { default as SelectListItemTile } from './components/SelectList/SelectListItemTile/SelectListItemTile.vue';
131
- export { default as DsSelectListItemTile } from './components/SelectList/SelectListItemTile/SelectListItemTile.vue';
130
+ export { default as SelectListItemContainer } from './components/SelectList/SelectListItemContainer/SelectListItemContainer.vue';
131
+ export { default as DsSelectListItemContainer } from './components/SelectList/SelectListItemContainer/SelectListItemContainer.vue';
132
132
  export { default as SelectListSectionTitle } from './components/SelectList/SelectListSectionTitle/SelectListSectionTitle.vue';
133
133
  export { default as DsSelectListSectionTitle } from './components/SelectList/SelectListSectionTitle/SelectListSectionTitle.vue';
134
134
  export * from './components/SelectList/SelectListItem/SelectListItem.consts';
@@ -1,7 +1,8 @@
1
1
  export const isTouchDevice = (): boolean => {
2
2
  return (
3
- 'ontouchstart' in window ||
4
- navigator.maxTouchPoints > 0 ||
5
- (navigator as any).msMaxTouchPoints > 0
3
+ typeof window !== 'undefined' &&
4
+ ('ontouchstart' in window ||
5
+ navigator.maxTouchPoints > 0 ||
6
+ (navigator as any).msMaxTouchPoints > 0)
6
7
  );
7
8
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bethinkpl/design-system",
3
- "version": "34.2.2",
3
+ "version": "35.0.1",
4
4
  "description": "Bethink universe design-system",
5
5
  "repository": {
6
6
  "type": "git",
@@ -18,8 +18,9 @@
18
18
  ],
19
19
  "license": "UNLICENSED",
20
20
  "engines": {
21
- "yarn": "^1.22.1",
22
- "node": "^16.13.0 || ^18.17.0 || ^20.9.0"
21
+ "yarn": ">=1.22.1",
22
+ "npm": ">=6.0.0",
23
+ "node": "^16.13.0 || ^18.17.0 || ^20.9.0 || ^22.0.0 || ^24.0.0"
23
24
  },
24
25
  "scripts": {
25
26
  "build": "vite build",
@@ -1,60 +0,0 @@
1
- import SelectListItemTile from './SelectListItemTile.vue';
2
- import { TILE_STATES } from '../../Tile';
3
-
4
- import { Args, Meta, StoryFn } from '@storybook/vue3';
5
- import { args, argTypes, data, template } from '../../Tile/Tile.sb.shared';
6
- import { withActions } from '@storybook/addon-actions/decorator';
7
-
8
- export default {
9
- title: 'Components/SelectList/SelectListItemTile',
10
- component: SelectListItemTile,
11
- decorators: [withActions],
12
- } as Meta<typeof SelectListItemTile>;
13
-
14
- const StoryTemplate: StoryFn<typeof SelectListItemTile> = (args) => ({
15
- components: { SelectListItemTile },
16
- setup() {
17
- return args;
18
- },
19
- template: template('select-list-item-tile'),
20
- data,
21
- });
22
-
23
- export const Interactive = StoryTemplate.bind({});
24
-
25
- Interactive.argTypes = argTypes;
26
- Interactive.args = args;
27
-
28
- Interactive.parameters = {
29
- actions: {
30
- handles: ['click'],
31
- },
32
- design: {
33
- type: 'figma',
34
- url: 'https://www.figma.com/file/izQdYyiBR1GQgFkaOIfIJI/LMS---DS-Components?type=design&node-id=5367-94239&t=GqiOb5BFRTyJrsv8-4',
35
- },
36
- };
37
-
38
- const StoryStaticTemplate: StoryFn<typeof SelectListItemTile> = (args) => ({
39
- components: { SelectListItemTile },
40
- setup() {
41
- return args;
42
- },
43
- template: template('select-list-item-tile'),
44
- data,
45
- });
46
-
47
- export const Static = StoryStaticTemplate.bind({});
48
-
49
- Static.argTypes = argTypes;
50
-
51
- Static.args = {
52
- ...args,
53
- interactive: false,
54
- iconLeft: null,
55
- iconRight: null,
56
- text: 'this is a text text',
57
- eyebrowText: 'this is an eyebrowText text',
58
- additionalText: 'this is some additionalText',
59
- state: TILE_STATES.DEFAULT,
60
- } as Args;
@@ -1,41 +0,0 @@
1
- <template>
2
- <div class="ds-selectListItemTile">
3
- <ds-tile
4
- :interactive="interactive"
5
- :icon-left="iconLeft"
6
- :icon-right="iconRight"
7
- :text="text"
8
- :eyebrow-text="eyebrowText"
9
- :additional-text="additionalText"
10
- :color="color"
11
- :is-eyebrow-text-uppercase="isEyebrowTextUppercase"
12
- :state="state"
13
- :eyebrow-ellipsis="eyebrowEllipsis"
14
- :text-ellipsis="textEllipsis"
15
- :border-color="borderColor"
16
- />
17
- </div>
18
- </template>
19
-
20
- <style scoped lang="scss">
21
- @import '../../../../styles/settings/spacings';
22
-
23
- .ds-selectListItemTile {
24
- padding: $space-xs;
25
- }
26
- </style>
27
-
28
- <script lang="ts">
29
- import Tile from '../../Tile';
30
- import { props } from '../../Tile/Tile.shared';
31
-
32
- import { defineComponent } from 'vue';
33
-
34
- export default defineComponent({
35
- name: 'SelectListItemTile',
36
- components: {
37
- DsTile: Tile,
38
- },
39
- props,
40
- });
41
- </script>