@bethinkpl/design-system 26.4.0 → 26.5.0

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 (77) hide show
  1. package/.yarnrc.yml +1 -0
  2. package/dist/design-system.umd.cjs +18 -18
  3. package/dist/design-system.umd.cjs.map +1 -1
  4. package/dist/lib/js/components/DatePickers/DatePicker/DatePicker.vue.d.ts +8 -7
  5. package/dist/lib/js/components/Drawer/DrawerTile/DrawerTile.vue.d.ts +14 -14
  6. package/dist/lib/js/components/Headers/OverlayHeader/OverlayHeader.vue.d.ts +10 -0
  7. package/dist/lib/js/components/Outline/OutlineItem/OutlineItem.vue.d.ts +1 -0
  8. package/dist/lib/js/components/RichList/BasicRichListItem/BasicRichListItem.vue.d.ts +122 -0
  9. package/dist/lib/js/components/SelectList/SelectListItemTile/SelectListItemTile.vue.d.ts +14 -14
  10. package/dist/lib/js/components/TextGroup/TextGroup.vue.d.ts +121 -0
  11. package/dist/lib/js/components/Tile/Tile.consts.d.ts +17 -0
  12. package/dist/lib/js/components/Tile/Tile.sb.shared.d.ts +1462 -0
  13. package/dist/lib/js/components/Tile/Tile.shared.d.ts +4 -4
  14. package/dist/lib/js/components/Tile/Tile.vue.d.ts +7 -7
  15. package/dist/lib/js/components/Tooltip/Tooltip.vue.d.ts +10 -0
  16. package/docs/assets/BasicRichListItem-Ctm7LWMn.js +1 -0
  17. package/docs/assets/{BasicRichListItem.stories-CYAxAAa4.js → BasicRichListItem.stories-DtiXHviM.js} +9 -5
  18. package/docs/assets/{Color-ERTF36HU-BKLy-2-d.js → Color-ERTF36HU-BZlibAx3.js} +1 -1
  19. package/docs/assets/DatePicker-DfNJw-NT.js +2 -0
  20. package/docs/assets/{DatePicker.stories-DOAIlaQC.js → DatePicker.stories-CIo6kOIM.js} +1 -1
  21. package/docs/assets/{DateRangePicker-DCZj8tMQ.js → DateRangePicker-L4cDgxmU.js} +1 -1
  22. package/docs/assets/{DateRangePicker.stories-BEQd6aEn.js → DateRangePicker.stories-BcGHtCgE.js} +1 -1
  23. package/docs/assets/{DocsRenderer-CFRXHY34-vJAQuqDP.js → DocsRenderer-CFRXHY34-Bw028q-m.js} +5 -5
  24. package/docs/assets/{DrawerTile-BqpTb_42.js → DrawerTile-DRd90aW_.js} +1 -1
  25. package/docs/assets/DrawerTile.stories-B8jCAcpg.js +10 -0
  26. package/docs/assets/OutlineItem-B0GAacWf.js +1 -0
  27. package/docs/assets/{OutlineItem.stories-CEsNJBgo.js → OutlineItem.stories-RvYTOp9N.js} +1 -1
  28. package/docs/assets/{OverlayHeader-Cuwk2J3B.js → OverlayHeader--26-GHPy.js} +1 -1
  29. package/docs/assets/{OverlayHeader.stories-WMRsiDpt.js → OverlayHeader.stories-BVxhjyuC.js} +1 -1
  30. package/docs/assets/{RichListItem.stories-CtgWAG3q.js → RichListItem.stories-WK5gz3vk.js} +1 -1
  31. package/docs/assets/SelectListItemTile-CziQ20sD.js +1 -0
  32. package/docs/assets/SelectListItemTile.stories-jXlPEopR.js +19 -0
  33. package/docs/assets/{SelectionTile-dsZMyVPh.js → SelectionTile-C0MW2ZUn.js} +1 -1
  34. package/docs/assets/{SelectionTile.stories-DsAapWdD.js → SelectionTile.stories-mIPf1nUR.js} +1 -1
  35. package/docs/assets/TextGroup-lwPvABi6.js +1 -0
  36. package/docs/assets/TextGroup.stories-CnojKPTw.js +56 -0
  37. package/docs/assets/{ThreeColumnLayout-CRPRmmvx.js → ThreeColumnLayout-BR3bkVIs.js} +1 -1
  38. package/docs/assets/{ThreeColumnLayout.stories-CeCLjYHh.js → ThreeColumnLayout.stories-V4L7zdf_.js} +1 -1
  39. package/docs/assets/Tile-DWASCVea.js +1 -0
  40. package/docs/assets/Tile.sb.shared-BZ0VDle3.js +20 -0
  41. package/docs/assets/Tile.stories-LYYOeyyn.js +12 -0
  42. package/docs/assets/Tooltip-Cni6OHo9.js +1 -0
  43. package/docs/assets/{Tooltip.stories-B94PUKgP.js → Tooltip.stories-C3h4ABpf.js} +1 -1
  44. package/docs/assets/{iframe-DuOsjH1S.js → iframe-Di5TkTnR.js} +10 -10
  45. package/docs/assets/{index-D4AlyEjM.js → index-Dyq6sUoy.js} +1 -1
  46. package/docs/assets/{index-TQ9qBbRg.js → index-SuPsQGgx.js} +1 -1
  47. package/docs/assets/{preview-BjkZFWp3.js → preview-BCrXVRij.js} +2 -2
  48. package/docs/assets/{preview-D76Q7lmj.js → preview-BRlPhK-p.js} +1 -1
  49. package/docs/iframe.html +1 -1
  50. package/docs/project.json +1 -1
  51. package/lib/js/components/DatePickers/DatePicker/DatePicker.vue +18 -1
  52. package/lib/js/components/Layouts/ThreeColumnLayout/ThreeColumnLayout.vue +1 -0
  53. package/lib/js/components/Outline/OutlineItem/OutlineItem.vue +2 -1
  54. package/lib/js/components/RichList/BasicRichListItem/BasicRichListItem.stories.ts +6 -0
  55. package/lib/js/components/RichList/BasicRichListItem/BasicRichListItem.vue +5 -0
  56. package/lib/js/components/SelectList/SelectListItemTile/SelectListItemTile.vue +1 -1
  57. package/lib/js/components/TextGroup/TextGroup.stories.ts +20 -0
  58. package/lib/js/components/TextGroup/TextGroup.vue +51 -8
  59. package/lib/js/components/Tile/Tile.consts.ts +19 -0
  60. package/lib/js/components/Tile/Tile.sb.shared.ts +38 -4
  61. package/lib/js/components/Tile/Tile.shared.ts +4 -4
  62. package/lib/js/components/Tile/Tile.stories.ts +2 -2
  63. package/lib/js/components/Tile/Tile.vue +72 -41
  64. package/lib/js/components/Tooltip/Tooltip.vue +15 -1
  65. package/package.json +1 -1
  66. package/docs/assets/BasicRichListItem-VxP1mYya.js +0 -1
  67. package/docs/assets/DatePicker-B1ILf2Dx.js +0 -2
  68. package/docs/assets/DrawerTile.stories-BXRxmk1J.js +0 -10
  69. package/docs/assets/OutlineItem-BSNc7fID.js +0 -1
  70. package/docs/assets/SelectListItemTile-CRDx7Wjx.js +0 -1
  71. package/docs/assets/SelectListItemTile.stories-CADs56nZ.js +0 -19
  72. package/docs/assets/TextGroup-C6PK25ok.js +0 -1
  73. package/docs/assets/TextGroup.stories-DnrIWKMT.js +0 -48
  74. package/docs/assets/Tile-C731KsjF.js +0 -1
  75. package/docs/assets/Tile.sb.shared-Dr6W7Z8_.js +0 -16
  76. package/docs/assets/Tile.stories-CZlgEnY4.js +0 -12
  77. package/docs/assets/Tooltip-4m2CjENZ.js +0 -1
package/docs/iframe.html CHANGED
@@ -510,7 +510,7 @@
510
510
  </script>
511
511
  <link rel="stylesheet" href="./preview.css">
512
512
 
513
- <script type="module" crossorigin src="./assets/iframe-DuOsjH1S.js"></script>
513
+ <script type="module" crossorigin src="./assets/iframe-Di5TkTnR.js"></script>
514
514
  </head>
515
515
 
516
516
  <body>
package/docs/project.json CHANGED
@@ -1 +1 @@
1
- {"generatedAt":1736879743634,"hasCustomBabel":false,"hasCustomWebpack":false,"hasStaticDirs":true,"hasStorybookEslint":true,"refCount":0,"testPackages":{"@types/jest":"29.5.13","@vue/vue3-jest":"29.2.2","jest":"29.7.0","jest-environment-jsdom":"29.7.0","ts-jest":"29.0.5"},"packageManager":{"type":"yarn","version":"1.22.22"},"preview":{"usesGlobals":false},"framework":{"name":"@storybook/vue3-vite","options":{}},"builder":"@storybook/builder-vite","renderer":"@storybook/vue3","portableStoriesFileCount":2,"storybookVersion":"8.3.4","storybookVersionSpecifier":"^8.3.4","language":"typescript","storybookPackages":{"@storybook/vue3":{"version":"8.3.4"},"@storybook/vue3-vite":{"version":"8.3.4"},"eslint-plugin-storybook":{"version":"0.8.0"},"storybook":{"version":"8.3.4"}},"addons":{"@storybook/addon-actions":{"version":"8.3.4"},"@storybook/addon-designs":{"version":"8.0.3"},"@storybook/addon-docs":{"version":"8.3.4"},"@storybook/addon-controls":{"version":"8.3.4"},"@storybook/addon-storysource":{"version":"8.3.4"},"@storybook/addon-viewport":{"version":"8.3.4"}}}
1
+ {"generatedAt":1738667213172,"hasCustomBabel":false,"hasCustomWebpack":false,"hasStaticDirs":true,"hasStorybookEslint":true,"refCount":0,"testPackages":{"@types/jest":"29.5.13","@vue/vue3-jest":"29.2.2","jest":"29.7.0","jest-environment-jsdom":"29.7.0","ts-jest":"29.0.5"},"packageManager":{"type":"yarn","version":"1.22.22"},"preview":{"usesGlobals":false},"framework":{"name":"@storybook/vue3-vite","options":{}},"builder":"@storybook/builder-vite","renderer":"@storybook/vue3","portableStoriesFileCount":2,"storybookVersion":"8.3.4","storybookVersionSpecifier":"^8.3.4","language":"typescript","storybookPackages":{"@storybook/vue3":{"version":"8.3.4"},"@storybook/vue3-vite":{"version":"8.3.4"},"eslint-plugin-storybook":{"version":"0.8.0"},"storybook":{"version":"8.3.4"}},"addons":{"@storybook/addon-actions":{"version":"8.3.4"},"@storybook/addon-designs":{"version":"8.0.3"},"@storybook/addon-docs":{"version":"8.3.4"},"@storybook/addon-controls":{"version":"8.3.4"},"@storybook/addon-storysource":{"version":"8.3.4"},"@storybook/addon-viewport":{"version":"8.3.4"}}}
@@ -25,6 +25,7 @@
25
25
  :interactive="isInteractive"
26
26
  :additional-text="additionalText"
27
27
  :color="color as TileColors"
28
+ :border-color="borderColor"
28
29
  :state="state as TileStates"
29
30
  :icon-right="tileIcon"
30
31
  :is-icon-right-hidden-on-mobile="isIconHiddenOnMobile"
@@ -139,7 +140,7 @@
139
140
  <script lang="ts">
140
141
  import { defineComponent, PropType, Ref, ref, toRaw, watch } from 'vue';
141
142
 
142
- import DsTile from '../../Tile';
143
+ import DsTile, { TILE_BORDER_COLORS } from '../../Tile';
143
144
  import { IconItem, ICONS } from '../../Icons/Icon';
144
145
  import DatePickerBox from '../DatePickerBox';
145
146
 
@@ -286,6 +287,22 @@ export default defineComponent({
286
287
  };
287
288
  },
288
289
  computed: {
290
+ borderColor() {
291
+ return {
292
+ [DATE_PICKER_COLORS.NEUTRAL]: this.isInteractive
293
+ ? TILE_BORDER_COLORS.PRIMARY
294
+ : TILE_BORDER_COLORS.NEUTRAL_WEAK,
295
+ [DATE_PICKER_COLORS.NEUTRAL_WEAK]: this.isInteractive
296
+ ? TILE_BORDER_COLORS.PRIMARY
297
+ : TILE_BORDER_COLORS.NEUTRAL_WEAK,
298
+ [DATE_PICKER_COLORS.DANGER]: this.isInteractive
299
+ ? TILE_BORDER_COLORS.DANGER
300
+ : TILE_BORDER_COLORS.DANGER_WEAK,
301
+ [DATE_PICKER_COLORS.WARNING]: this.isInteractive
302
+ ? TILE_BORDER_COLORS.WARNING
303
+ : TILE_BORDER_COLORS.WARNING_WEAK,
304
+ }[this.color];
305
+ },
289
306
  eyebrowText() {
290
307
  if (!this.date) {
291
308
  return '';
@@ -116,6 +116,7 @@ $right-column-large-l-max-width: $right-column-large-max-width;
116
116
  left: initial;
117
117
  position: initial;
118
118
  top: initial;
119
+ z-index: initial;
119
120
 
120
121
  &.-ds-desktopVisible {
121
122
  display: initial;
@@ -270,7 +270,8 @@ export default defineComponent({
270
270
  },
271
271
  label: {
272
272
  type: String,
273
- required: true,
273
+ // Label can be passed either as a prop or in a slot
274
+ default: '',
274
275
  },
275
276
  isLabelUppercase: {
276
277
  type: Boolean,
@@ -84,6 +84,9 @@ const expandStory = (story: StoryFn<typeof BasicRichListItem>, args = {}) => {
84
84
  supportingTextEllipsis: {
85
85
  control: 'boolean',
86
86
  },
87
+ isSupportingTextTooltipEnabled: {
88
+ control: 'boolean',
89
+ },
87
90
  metadata: {
88
91
  control: 'text',
89
92
  },
@@ -131,6 +134,7 @@ const expandStory = (story: StoryFn<typeof BasicRichListItem>, args = {}) => {
131
134
  textEllipsis: false,
132
135
  supportingText: 'null',
133
136
  supportingTextEllipsis: false,
137
+ isSupportingTextTooltipEnabled: false,
134
138
 
135
139
  metadata: 'Metadata Slot',
136
140
  actions: 'ACS',
@@ -191,6 +195,7 @@ const InteractiveStoryTemplate: StoryFn<typeof BasicRichListItem> = (args) => {
191
195
  :text-ellipsis="textEllipsis"
192
196
  :supporting-text="supportingText === 'null' ? null : supportingText"
193
197
  :supporting-text-ellipsis="supportingTextEllipsis"
198
+ :is-supporting-text-tooltip-enabled="isSupportingTextTooltipEnabled"
194
199
  :background-color="backgroundColor"
195
200
  :elevation="elevation"
196
201
  :has-draggable-handler="hasDraggableHandler"
@@ -251,6 +256,7 @@ const WithMediaStoryTemplate: StoryFn<typeof BasicRichListItem> = (args) => {
251
256
  :text-ellipsis="textEllipsis"
252
257
  :supporting-text="supportingText === 'null' ? null : supportingText"
253
258
  :supporting-text-ellipsis="supportingTextEllipsis"
259
+ :is-supporting-text-tooltip-enabled="isSupportingTextTooltipEnabled"
254
260
  :background-color="backgroundColor"
255
261
  :elevation="elevation"
256
262
  :has-draggable-handler="hasDraggableHandler"
@@ -44,6 +44,7 @@
44
44
  :supporting-text-ellipsis="supportingTextEllipsis"
45
45
  :size="textGroupSize"
46
46
  :state="textGroupState"
47
+ :is-supporting-text-tooltip-enabled="isSupportingTextTooltipEnabled"
47
48
  />
48
49
  </div>
49
50
  </template>
@@ -218,6 +219,10 @@ export default defineComponent({
218
219
  type: Boolean,
219
220
  default: false,
220
221
  },
222
+ isSupportingTextTooltipEnabled: {
223
+ type: Boolean,
224
+ default: false,
225
+ },
221
226
  backgroundColor: {
222
227
  type: String as PropType<RichListItemBackgroundColor>,
223
228
  default: RICH_LIST_ITEM_BACKGROUND_COLOR.NEUTRAL,
@@ -12,7 +12,7 @@
12
12
  :state="state"
13
13
  :eyebrow-ellipsis="eyebrowEllipsis"
14
14
  :text-ellipsis="textEllipsis"
15
- :has-border="hasBorder"
15
+ :border-color="borderColor"
16
16
  />
17
17
  </div>
18
18
  </template>
@@ -33,6 +33,10 @@ const StoryTemplate: StoryFn<typeof DsTextGroup> = (args) => ({
33
33
  :skeleton-loading-size="skeletonLoadingSize"
34
34
  :is-selected="isSelected"
35
35
  :state="state"
36
+ :is-supporting-text-tooltip-enabled="isSupportingTextTooltipEnabled"
37
+ :is-supporting-text-tooltip-enabled-on-mobile="isSupportingTextTooltipEnabledOnMobile"
38
+ :is-supporting-text-tooltip-auto-filled-with-content="isSupportingTextTooltipAutoFilledWithContent"
39
+ :supporting-text-tooltip-content="supportingTextTooltipContent"
36
40
  />
37
41
  <div style="margin-top: 100px; color: #888">
38
42
  <ds-divider />
@@ -57,6 +61,10 @@ Interactive.args = {
57
61
  skeletonLoadingSize: TEXT_GROUP_LOADING_SIZES.LARGE,
58
62
  isSelected: false,
59
63
  state: TEXT_GROUP_STATES.DEFAULT,
64
+ isSupportingTextTooltipEnabled: false,
65
+ isSupportingTextTooltipEnabledOnMobile: true,
66
+ isSupportingTextTooltipAutoFilledWithContent: true,
67
+ supportingTextTooltipContent: '',
60
68
  } as Args;
61
69
 
62
70
  Interactive.argTypes = {
@@ -103,6 +111,18 @@ Interactive.argTypes = {
103
111
  control: 'select',
104
112
  options: Object.values(TEXT_GROUP_STATES),
105
113
  },
114
+ isSupportingTextTooltipEnabled: {
115
+ control: 'boolean',
116
+ },
117
+ isSupportingTextTooltipEnabledOnMobile: {
118
+ control: 'boolean',
119
+ },
120
+ isSupportingTextTooltipAutoFilledWithContent: {
121
+ control: 'boolean',
122
+ },
123
+ supportingTextTooltipContent: {
124
+ control: 'text',
125
+ },
106
126
  } as ArgTypes;
107
127
 
108
128
  Interactive.parameters = {
@@ -43,18 +43,33 @@
43
43
  <span v-else-if="mainText === ''">&nbsp;</span>
44
44
  <span v-else>{{ mainText }}</span>
45
45
  </div>
46
- <div
47
- v-if="supportingText !== null"
48
- class="ds-textGroup__supporting"
49
- :class="{
50
- '-ds-ellipsis': supportingTextEllipsis,
51
- }"
52
- >
46
+ <div v-if="supportingText !== null" class="ds-textGroup__supportingWrapper">
53
47
  <div v-if="isLoading" class="ds-textGroup__skeletonWrapper">
54
48
  <ds-skeleton width="100%" height="100%" />
55
49
  </div>
56
50
  <span v-else-if="supportingText === ''">&nbsp;</span>
57
- <span v-else v-html="supportingText" />
51
+ <template v-else>
52
+ <ds-tooltip
53
+ class="ds-textGroup__supportingTooltip"
54
+ :text="
55
+ isSupportingTextTooltipAutoFilledWithContent
56
+ ? supportingText
57
+ : supportingTextTooltipContent
58
+ "
59
+ :is-disabled="!isSupportingTextTooltipEnabled"
60
+ :is-hidden-on-mobile="!isSupportingTextTooltipEnabledOnMobile"
61
+ inline
62
+ >
63
+ <div
64
+ class="ds-textGroup__supporting"
65
+ :class="{
66
+ '-ds-ellipsis': supportingTextEllipsis,
67
+ }"
68
+ >
69
+ <span v-html="supportingText" />
70
+ </div>
71
+ </ds-tooltip>
72
+ </template>
58
73
  </div>
59
74
  </div>
60
75
  </template>
@@ -172,6 +187,16 @@ $text-group-colors: (
172
187
  @include text-m-compact-bold;
173
188
  }
174
189
 
190
+ &__supportingWrapper {
191
+ display: flex;
192
+ }
193
+
194
+ &__supportingTooltip {
195
+ display: inline-flex;
196
+ max-width: 100%;
197
+ overflow: hidden;
198
+ }
199
+
175
200
  &__supporting {
176
201
  @include text-s-compact-regular;
177
202
  }
@@ -251,11 +276,13 @@ import {
251
276
  TextGroupSize,
252
277
  TextGroupState,
253
278
  } from './TextGroup.consts';
279
+ import DsTooltip from '../Tooltip';
254
280
 
255
281
  export default defineComponent({
256
282
  name: 'TextGroup',
257
283
  components: {
258
284
  DsSkeleton,
285
+ DsTooltip,
259
286
  },
260
287
  props: {
261
288
  size: {
@@ -310,6 +337,22 @@ export default defineComponent({
310
337
  type: String as PropType<TextGroupState>,
311
338
  default: TEXT_GROUP_STATES.DEFAULT,
312
339
  },
340
+ isSupportingTextTooltipEnabled: {
341
+ type: Boolean,
342
+ default: false,
343
+ },
344
+ isSupportingTextTooltipEnabledOnMobile: {
345
+ type: Boolean,
346
+ default: true,
347
+ },
348
+ isSupportingTextTooltipAutoFilledWithContent: {
349
+ type: Boolean,
350
+ default: true,
351
+ },
352
+ supportingTextTooltipContent: {
353
+ type: [String, null],
354
+ default: null,
355
+ },
313
356
  },
314
357
  data() {
315
358
  return {
@@ -20,3 +20,22 @@ export const TILE_STATES = {
20
20
  } as const;
21
21
 
22
22
  export type TileStates = Value<typeof TILE_STATES>;
23
+
24
+ export const TILE_BORDER_COLORS = {
25
+ NEUTRAL: 'neutral',
26
+ NEUTRAL_WEAK: 'neutralWeak',
27
+ PRIMARY: 'primary',
28
+ PRIMARY_WEAK: 'primaryWeak',
29
+ SUCCESS: 'success',
30
+ SUCCESS_WEAK: 'successWeak',
31
+ FAIL: 'fail',
32
+ FAIL_WEAK: 'failWeak',
33
+ DANGER: 'danger',
34
+ DANGER_WEAK: 'dangerWeak',
35
+ WARNING: 'warning',
36
+ WARNING_WEAK: 'warningWeak',
37
+ INFO: 'info',
38
+ INFO_WEAK: 'infoWeak',
39
+ } as const;
40
+
41
+ export type TileBorderColors = Value<typeof TILE_BORDER_COLORS>;
@@ -1,8 +1,10 @@
1
1
  import { ICONS } from '../Icons/Icon';
2
- import { TILE_COLORS, TILE_STATES } from './Tile.consts';
2
+ import { TILE_BORDER_COLORS, TILE_COLORS, TILE_STATES } from './Tile.consts';
3
3
  import { Args, ArgTypes } from '@storybook/vue3';
4
+ import DsBanner, { BANNER_COLORS } from '../Banner';
4
5
 
5
6
  export const template = (componentTag: string) => `
7
+ <div style="display: flex; row-gap: 16px; flex-direction: column">
6
8
  <${componentTag}
7
9
  :additional-text="additionalText"
8
10
  :color="color"
@@ -16,17 +18,45 @@ export const template = (componentTag: string) => `
16
18
  :state="state"
17
19
  :text-ellipsis="textEllipsis"
18
20
  :text="text"
19
- :has-border="hasBorder"
20
- />`;
21
+ :border-color="borderColor"
22
+ />
23
+ <ds-banner :color="BANNER_COLORS.WARNING" title="Taka kombinacja koloru komponentu z kolorem bordera jest niezgodna z design systemem!" v-if="borderColor && !allowedColorsToBorderColorsMap[color].includes(borderColor)" />
24
+ </div>
25
+ `;
21
26
 
22
27
  export const data = () => ({
23
28
  ICONS: Object.freeze(ICONS),
29
+ BANNER_COLORS: Object.freeze(BANNER_COLORS),
30
+ allowedColorsToBorderColorsMap: {
31
+ [TILE_COLORS.NEUTRAL]: [
32
+ TILE_BORDER_COLORS.NEUTRAL,
33
+ TILE_BORDER_COLORS.NEUTRAL_WEAK,
34
+ TILE_BORDER_COLORS.PRIMARY,
35
+ TILE_BORDER_COLORS.PRIMARY_WEAK,
36
+ ],
37
+ [TILE_COLORS.NEUTRAL_WEAK]: [
38
+ TILE_BORDER_COLORS.NEUTRAL,
39
+ TILE_BORDER_COLORS.NEUTRAL_WEAK,
40
+ TILE_BORDER_COLORS.PRIMARY,
41
+ TILE_BORDER_COLORS.PRIMARY_WEAK,
42
+ ],
43
+ [TILE_COLORS.PRIMARY]: [TILE_BORDER_COLORS.PRIMARY, TILE_BORDER_COLORS.PRIMARY_WEAK],
44
+ [TILE_COLORS.SUCCESS]: [TILE_BORDER_COLORS.SUCCESS, TILE_BORDER_COLORS.SUCCESS_WEAK],
45
+ [TILE_COLORS.FAIL]: [TILE_BORDER_COLORS.FAIL, TILE_BORDER_COLORS.FAIL_WEAK],
46
+ [TILE_COLORS.DANGER]: [TILE_BORDER_COLORS.DANGER, TILE_BORDER_COLORS.DANGER_WEAK],
47
+ [TILE_COLORS.WARNING]: [TILE_BORDER_COLORS.WARNING, TILE_BORDER_COLORS.WARNING_WEAK],
48
+ [TILE_COLORS.INFO]: [TILE_BORDER_COLORS.INFO, TILE_BORDER_COLORS.INFO_WEAK],
49
+ },
24
50
  });
25
51
 
52
+ export const components = {
53
+ DsBanner,
54
+ };
55
+
26
56
  export const args = {
27
57
  interactive: true,
28
58
  color: TILE_COLORS.NEUTRAL,
29
- hasBorder: false,
59
+ borderColor: null,
30
60
  iconLeft: null,
31
61
  iconRight: null,
32
62
  isIconRightHiddenOnMobile: false,
@@ -52,6 +82,10 @@ export const argTypes = {
52
82
  control: 'select',
53
83
  options: [...Object.values(TILE_COLORS)],
54
84
  },
85
+ borderColor: {
86
+ control: 'select',
87
+ options: [null, ...Object.values(TILE_BORDER_COLORS)],
88
+ },
55
89
  state: {
56
90
  control: 'select',
57
91
  options: [...Object.values(TILE_STATES)],
@@ -1,6 +1,6 @@
1
1
  import { PropType, toRaw } from 'vue';
2
2
  import { ICONS } from '../Icons/Icon';
3
- import { TILE_COLORS, TILE_STATES, TileColors, TileStates } from './Tile.consts';
3
+ import { TILE_COLORS, TILE_STATES, TileBorderColors, TileColors, TileStates } from './Tile.consts';
4
4
  import { Value } from '../../utils/type.utils';
5
5
 
6
6
  export const props = {
@@ -64,8 +64,8 @@ export const props = {
64
64
  type: Boolean,
65
65
  default: true,
66
66
  },
67
- hasBorder: {
68
- type: Boolean,
69
- default: false,
67
+ borderColor: {
68
+ type: String as PropType<TileBorderColors>,
69
+ default: null,
70
70
  },
71
71
  };
@@ -4,7 +4,7 @@ import Tile from './Tile.vue';
4
4
  import { TILE_STATES } from './Tile.consts';
5
5
 
6
6
  import type { Args, Meta, StoryObj } from '@storybook/vue3';
7
- import { args, argTypes, data, template } from './Tile.sb.shared';
7
+ import { args, argTypes, components, data, template } from './Tile.sb.shared';
8
8
  import type { ComponentProps } from 'vue-component-type-helpers';
9
9
  import { withActions } from '@storybook/addon-actions/decorator';
10
10
 
@@ -15,7 +15,7 @@ const meta: Meta<TileProps> = {
15
15
  component: Tile,
16
16
  decorators: [withActions],
17
17
  render: (args) => ({
18
- components: { Tile },
18
+ components: { ...components, Tile },
19
19
  setup() {
20
20
  return args;
21
21
  },
@@ -3,7 +3,10 @@
3
3
  :class="[
4
4
  tileColor,
5
5
  tileState,
6
- { '-ds-interactive': interactive, '-ds-hasBorder': hasBorder },
6
+ {
7
+ '-ds-interactive': interactive,
8
+ [`-ds-border-${borderColor}`]: borderColor !== null,
9
+ },
7
10
  ]"
8
11
  class="ds-tile"
9
12
  >
@@ -54,21 +57,76 @@
54
57
  @import '../../../styles/settings/spacings';
55
58
  @import '../../../styles/settings/typography/tokens';
56
59
 
60
+ $tile-border-colors: (
61
+ 'neutral': (
62
+ 'default': $color-neutral-border,
63
+ 'disabled': $color-neutral-border-disabled,
64
+ ),
65
+ 'neutralWeak': (
66
+ 'default': $color-neutral-border-weak,
67
+ 'disabled': $color-neutral-border-weak-disabled,
68
+ ),
69
+ 'primary': (
70
+ 'default': $color-primary-border,
71
+ 'disabled': $color-primary-border-disabled,
72
+ ),
73
+ 'primaryWeak': (
74
+ 'default': $color-primary-border-weak,
75
+ 'disabled': $color-primary-border-weak-disabled,
76
+ ),
77
+ 'success': (
78
+ 'default': $color-success-border,
79
+ 'disabled': $color-success-border-disabled,
80
+ ),
81
+ 'successWeak': (
82
+ 'default': $color-success-border-weak,
83
+ 'disabled': $color-success-border-weak-disabled,
84
+ ),
85
+ 'fail': (
86
+ 'default': $color-fail-border,
87
+ 'disabled': $color-fail-border-disabled,
88
+ ),
89
+ 'failWeak': (
90
+ 'default': $color-fail-border-weak,
91
+ 'disabled': $color-fail-border-weak-disabled,
92
+ ),
93
+ 'danger': (
94
+ 'default': $color-danger-border,
95
+ 'disabled': $color-danger-border-disabled,
96
+ ),
97
+ 'dangerWeak': (
98
+ 'default': $color-danger-border-weak,
99
+ 'disabled': $color-danger-border-weak-disabled,
100
+ ),
101
+ 'warning': (
102
+ 'default': $color-warning-border,
103
+ 'disabled': $color-warning-border-disabled,
104
+ ),
105
+ 'warningWeak': (
106
+ 'default': $color-warning-border-weak,
107
+ 'disabled': $color-warning-border-weak-disabled,
108
+ ),
109
+ 'info': (
110
+ 'default': $color-info-border,
111
+ 'disabled': $color-info-border-disabled,
112
+ ),
113
+ 'infoWeak': (
114
+ 'default': $color-info-border-weak,
115
+ 'disabled': $color-info-border-weak-disabled,
116
+ ),
117
+ );
118
+
57
119
  $tile-colors: (
58
120
  'neutral': (
59
121
  'default': (
60
122
  'background': $color-neutral-background,
61
123
  'background-hover': $color-neutral-background-hovered,
62
- 'border': $color-neutral-border,
63
- 'border-interactive': $color-primary-border,
64
124
  'eyebrow-text': $color-neutral-text-weak,
65
125
  'icon': $color-neutral-icon,
66
126
  'icon-interactive': $color-primary-icon,
67
127
  ),
68
128
  'disabled': (
69
129
  'background': $color-neutral-background-disabled,
70
- 'border': $color-neutral-border-disabled,
71
- 'border-interactive': $color-primary-border-disabled,
72
130
  'eyebrow-text': $color-neutral-text-weak-disabled,
73
131
  'icon': $color-neutral-icon-disabled,
74
132
  'icon-interactive': $color-primary-icon-disabled,
@@ -78,16 +136,12 @@ $tile-colors: (
78
136
  'default': (
79
137
  'background': $color-neutral-background-weak,
80
138
  'background-hover': $color-neutral-background-weak-hovered,
81
- 'border': $color-neutral-border,
82
- 'border-interactive': $color-primary-border,
83
139
  'eyebrow-text': $color-neutral-text-weak,
84
140
  'icon': $color-neutral-icon,
85
141
  'icon-interactive': $color-primary-icon,
86
142
  ),
87
143
  'disabled': (
88
144
  'background': $color-neutral-background-weak-disabled,
89
- 'border': $color-neutral-border-disabled,
90
- 'border-interactive': $color-primary-border-disabled,
91
145
  'eyebrow-text': $color-neutral-text-weak-disabled,
92
146
  'icon': $color-neutral-icon-disabled,
93
147
  'icon-interactive': $color-primary-icon-disabled,
@@ -97,16 +151,12 @@ $tile-colors: (
97
151
  'default': (
98
152
  'background': $color-primary-background,
99
153
  'background-hover': $color-primary-background-hovered,
100
- 'border': $color-primary-border,
101
- 'border-interactive': $color-primary-border,
102
154
  'eyebrow-text': $color-primary-text,
103
155
  'icon': $color-primary-icon,
104
156
  'icon-interactive': $color-primary-icon,
105
157
  ),
106
158
  'disabled': (
107
159
  'background': $color-primary-background-disabled,
108
- 'border': $color-primary-border-disabled,
109
- 'border-interactive': $color-primary-border-disabled,
110
160
  'eyebrow-text': $color-primary-text-disabled,
111
161
  'icon': $color-primary-icon-disabled,
112
162
  'icon-interactive': $color-primary-icon-disabled,
@@ -116,16 +166,12 @@ $tile-colors: (
116
166
  'default': (
117
167
  'background': $color-success-background,
118
168
  'background-hover': $color-success-background-hovered,
119
- 'border': $color-success-border,
120
- 'border-interactive': $color-success-border,
121
169
  'eyebrow-text': $color-success-text,
122
170
  'icon': $color-success-icon,
123
171
  'icon-interactive': $color-success-icon,
124
172
  ),
125
173
  'disabled': (
126
174
  'background': $color-success-background-disabled,
127
- 'border': $color-success-border-disabled,
128
- 'border-interactive': $color-success-border-disabled,
129
175
  'eyebrow-text': $color-success-text-disabled,
130
176
  'icon': $color-success-icon-disabled,
131
177
  'icon-interactive': $color-success-icon-disabled,
@@ -135,16 +181,12 @@ $tile-colors: (
135
181
  'default': (
136
182
  'background': $color-fail-background,
137
183
  'background-hover': $color-fail-background-hovered,
138
- 'border': $color-fail-border,
139
- 'border-interactive': $color-fail-border,
140
184
  'eyebrow-text': $color-fail-text,
141
185
  'icon': $color-fail-icon,
142
186
  'icon-interactive': $color-fail-icon,
143
187
  ),
144
188
  'disabled': (
145
189
  'background': $color-fail-background-disabled,
146
- 'border': $color-fail-border-disabled,
147
- 'border-interactive': $color-fail-border-disabled,
148
190
  'eyebrow-text': $color-fail-text-disabled,
149
191
  'icon': $color-fail-icon-disabled,
150
192
  'icon-interactive': $color-fail-icon-disabled,
@@ -154,16 +196,12 @@ $tile-colors: (
154
196
  'default': (
155
197
  'background': $color-danger-background,
156
198
  'background-hover': $color-danger-background-hovered,
157
- 'border': $color-danger-border,
158
- 'border-interactive': $color-danger-border,
159
199
  'eyebrow-text': $color-danger-text,
160
200
  'icon': $color-danger-icon,
161
201
  'icon-interactive': $color-danger-icon,
162
202
  ),
163
203
  'disabled': (
164
204
  'background': $color-danger-background-disabled,
165
- 'border': $color-danger-border-disabled,
166
- 'border-interactive': $color-danger-border-disabled,
167
205
  'eyebrow-text': $color-danger-text-disabled,
168
206
  'icon': $color-danger-icon-disabled,
169
207
  'icon-interactive': $color-danger-icon-disabled,
@@ -173,16 +211,12 @@ $tile-colors: (
173
211
  'default': (
174
212
  'background': $color-warning-background,
175
213
  'background-hover': $color-warning-background-hovered,
176
- 'border': $color-warning-border,
177
- 'border-interactive': $color-warning-border,
178
214
  'eyebrow-text': $color-warning-text,
179
215
  'icon': $color-warning-icon,
180
216
  'icon-interactive': $color-warning-icon,
181
217
  ),
182
218
  'disabled': (
183
219
  'background': $color-warning-background-disabled,
184
- 'border': $color-warning-border-disabled,
185
- 'border-interactive': $color-warning-border-disabled,
186
220
  'eyebrow-text': $color-warning-text-disabled,
187
221
  'icon': $color-warning-icon-disabled,
188
222
  'icon-interactive': $color-warning-icon-disabled,
@@ -192,16 +226,12 @@ $tile-colors: (
192
226
  'default': (
193
227
  'background': $color-info-background,
194
228
  'background-hover': $color-info-background-hovered,
195
- 'border': $color-info-border,
196
- 'border-interactive': $color-info-border,
197
229
  'eyebrow-text': $color-info-text,
198
230
  'icon': $color-info-icon,
199
231
  'icon-interactive': $color-info-icon,
200
232
  ),
201
233
  'disabled': (
202
234
  'background': $color-info-background-disabled,
203
- 'border': $color-info-border-disabled,
204
- 'border-interactive': $color-info-border-disabled,
205
235
  'eyebrow-text': $color-info-text-disabled,
206
236
  'icon': $color-info-icon-disabled,
207
237
  'icon-interactive': $color-info-icon-disabled,
@@ -212,10 +242,6 @@ $tile-colors: (
212
242
  @mixin setColors($root, $color-map) {
213
243
  background-color: map-get($color-map, 'background');
214
244
 
215
- &.-ds-hasBorder {
216
- outline: $border-xs solid map-get($color-map, 'border');
217
- }
218
-
219
245
  #{$root}__eyebrowText {
220
246
  color: map-get($color-map, 'eyebrow-text');
221
247
  }
@@ -226,10 +252,6 @@ $tile-colors: (
226
252
  }
227
253
 
228
254
  &.-ds-interactive {
229
- &.-ds-hasBorder {
230
- outline: $border-xs solid map-get($color-map, 'border-interactive');
231
- }
232
-
233
255
  #{$root}__iconRight {
234
256
  color: map-get($color-map, 'icon-interactive');
235
257
  }
@@ -255,6 +277,15 @@ $tile-colors: (
255
277
  }
256
278
  }
257
279
 
280
+ @each $border-color-name, $border-color-map in $tile-border-colors {
281
+ &.-ds-border-#{$border-color-name} {
282
+ outline: $border-xs solid map-get($border-color-map, 'default');
283
+ &.-ds-disabled {
284
+ outline: $border-xs solid map-get($border-color-map, 'disabled');
285
+ }
286
+ }
287
+ }
288
+
258
289
  align-items: center;
259
290
  border-radius: $radius-s;
260
291
  display: flex;