@bethinkpl/design-system 26.12.1 → 26.14.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.
- package/dist/design-system.umd.cjs +16 -16
- package/dist/design-system.umd.cjs.map +1 -1
- package/dist/lib/js/components/Avatar/Avatar.vue.d.ts +2 -0
- package/dist/lib/js/components/Chip/Chip.vue.d.ts +6 -5
- package/dist/lib/js/components/Drawer/DrawerHeader/DrawerHeader.vue.d.ts +3 -2
- package/dist/lib/js/components/Dropdown/Dropdown.vue.d.ts +1 -1
- package/dist/lib/js/components/Headers/OverlayHeader/OverlayHeader.vue.d.ts +2 -2
- package/dist/lib/js/components/Pagination/Pagination.vue.d.ts +1 -1
- package/dist/lib/js/components/RichList/BasicRichListItem/BasicRichListItem.vue.d.ts +13 -4
- package/dist/lib/js/components/TextGroup/TextGroup.vue.d.ts +1 -1
- package/dist/lib/js/components/Toggles/CounterToggle/CounterToggle.vue.d.ts +1 -1
- package/dist/lib/js/components/Tooltip/Tooltip.vue.d.ts +1 -1
- package/docs/assets/Avatar-DUThlKLV.js +1 -0
- package/docs/assets/Avatar.stories-Dwgdl1h5.js +38 -0
- package/docs/assets/BasicRichListItem-CEiYZukO.js +1 -0
- package/docs/assets/{BasicRichListItem.stories-W11x1b5C.js → BasicRichListItem.stories-ePDSld8d.js} +8 -4
- package/docs/assets/Chip-DmzVP4Nc.js +1 -0
- package/docs/assets/{Chip.stories-CmRxhdd5.js → Chip.stories-BHVdQEET.js} +1 -1
- package/docs/assets/{Color-ERTF36HU-D5EeXymG.js → Color-ERTF36HU-CUHUHSmH.js} +1 -1
- package/docs/assets/{DateBox.stories-CvwVbLiI.js → DateBox.stories-BP1Z4i2_.js} +1 -1
- package/docs/assets/{DatePicker-CYB-OeHU.js → DatePicker-Bc1APlab.js} +1 -1
- package/docs/assets/{DatePicker.stories-BCcRMVnc.js → DatePicker.stories-AUPbbqFP.js} +1 -1
- package/docs/assets/{DateRangePicker-BY0ptzDm.js → DateRangePicker-CNuyzpfG.js} +1 -1
- package/docs/assets/{DateRangePicker.stories-CMoP8mIZ.js → DateRangePicker.stories-BQFhc4cw.js} +1 -1
- package/docs/assets/{DocsRenderer-CFRXHY34-CTj1geou.js → DocsRenderer-CFRXHY34-BTRR5RRG.js} +5 -5
- package/docs/assets/{DrawerHeader-6iOWRU4r.js → DrawerHeader-CivXan1m.js} +1 -1
- package/docs/assets/{DrawerHeader.stories-BM2zQhqx.js → DrawerHeader.stories-B-6VXMB_.js} +1 -1
- package/docs/assets/{GroupRichListItem-B5zdEDgJ.js → GroupRichListItem-8v8vJXgH.js} +1 -1
- package/docs/assets/{GroupRichListItem.stories-CGh-ncpD.js → GroupRichListItem.stories-KjZ2JDho.js} +1 -1
- package/docs/assets/{OutlineItem.stories-DRj6zFWQ.js → OutlineItem.stories-wBYF6_YS.js} +1 -1
- package/docs/assets/{RichListItem.stories-BjOiMMyE.js → RichListItem.stories-C7rIgxO4.js} +1 -1
- package/docs/assets/{SelectionTile-7OHQEA9w.js → SelectionTile-D9A_Tf3q.js} +1 -1
- package/docs/assets/{SelectionTile.stories-B5SdFlYE.js → SelectionTile.stories-aEkis98r.js} +1 -1
- package/docs/assets/{iframe-C7WPYr8K.js → iframe-BmaPoam5.js} +6 -6
- package/docs/assets/{index-DUBuPvUa.js → index-g_7p32Ii.js} +1 -1
- package/docs/assets/{index-B4SBaA-m.js → index-z7xpE_Pa.js} +1 -1
- package/docs/assets/{preview-DQC24eOC.js → preview-DqmV_9DV.js} +1 -1
- package/docs/assets/{preview-H9MyyyLW.js → preview-Ds_xi8UF.js} +2 -2
- package/docs/iframe.html +1 -1
- package/docs/project.json +1 -1
- package/lib/js/components/Avatar/Avatar.spec.ts +16 -0
- package/lib/js/components/Avatar/Avatar.stories.ts +4 -0
- package/lib/js/components/Avatar/Avatar.vue +23 -5
- package/lib/js/components/Chip/Chip.vue +15 -16
- package/lib/js/components/RichList/BasicRichListItem/BasicRichListItem.stories.ts +7 -4
- package/lib/js/components/RichList/BasicRichListItem/BasicRichListItem.vue +14 -10
- package/lib/js/components/RichList/RichListItem/RichListItem.vue +11 -7
- package/package.json +1 -1
- package/docs/assets/Avatar-U_7Z6nZ2.js +0 -1
- package/docs/assets/Avatar.stories-CVysqINz.js +0 -37
- package/docs/assets/BasicRichListItem-CjGmKgW-.js +0 -1
- package/docs/assets/Chip-CkWK9-eU.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DocsRenderer-CFRXHY34-
|
|
2
|
-
import{_ as s}from"./iframe-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DocsRenderer-CFRXHY34-BTRR5RRG.js","./iframe-BmaPoam5.js","./_commonjsHelpers-Chg3vePA.js","./index-vG0co4wr.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as s}from"./iframe-BmaPoam5.js";import"../sb-preview/runtime.js";const{global:_}=__STORYBOOK_MODULE_GLOBAL__;var o,i=Object.entries((o=_.TAGS_OPTIONS)!=null?o:{}).reduce((e,r)=>{let[t,a]=r;return a.excludeFromDocsStories&&(e[t]=!0),e},{}),d={docs:{renderer:async()=>{let{DocsRenderer:e}=await s(()=>import("./DocsRenderer-CFRXHY34-BTRR5RRG.js").then(r=>r.am),__vite__mapDeps([0,1,2,3]),import.meta.url);return new e},stories:{filter:e=>{var r;return(e.tags||[]).filter(t=>i[t]).length===0&&!((r=e.parameters.docs)!=null&&r.disable)}}}};export{d as parameters};
|
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-
|
|
513
|
+
<script type="module" crossorigin src="./assets/iframe-BmaPoam5.js"></script>
|
|
514
514
|
</head>
|
|
515
515
|
|
|
516
516
|
<body>
|
package/docs/project.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"generatedAt":
|
|
1
|
+
{"generatedAt":1746705153196,"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"}}}
|
|
@@ -214,4 +214,20 @@ describe('Avatar', () => {
|
|
|
214
214
|
expect(accessStatusElement.exists()).toBe(true);
|
|
215
215
|
expect(accessStatusElement.find('img').attributes('src')).toBe(teamMemberImageUrl);
|
|
216
216
|
});
|
|
217
|
+
|
|
218
|
+
it('should pass activityStatusTooltip to the tooltip component', () => {
|
|
219
|
+
const tooltipText = 'Active now';
|
|
220
|
+
const wrapper = mount(Avatar, {
|
|
221
|
+
props: {
|
|
222
|
+
size: AVATAR_SIZES.MEDIUM,
|
|
223
|
+
username: 'Dariusz Chrapek',
|
|
224
|
+
activityStatus: AVATAR_ACTIVITY_STATUSES.ACTIVE,
|
|
225
|
+
activityStatusTooltip: tooltipText,
|
|
226
|
+
},
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
const tooltip = wrapper.findComponent({ name: 'Tooltip' });
|
|
230
|
+
expect(tooltip.exists()).toBe(true);
|
|
231
|
+
expect(tooltip.props('text')).toBe(tooltipText);
|
|
232
|
+
});
|
|
217
233
|
});
|
|
@@ -41,6 +41,9 @@ const meta: Meta<typeof Avatar> = {
|
|
|
41
41
|
},
|
|
42
42
|
options: [undefined, ...Object.values(AVATAR_ACTIVITY_STATUSES)],
|
|
43
43
|
},
|
|
44
|
+
activityStatusTooltip: {
|
|
45
|
+
control: 'text',
|
|
46
|
+
},
|
|
44
47
|
},
|
|
45
48
|
};
|
|
46
49
|
export default meta;
|
|
@@ -54,6 +57,7 @@ export const Interactive: Story = {
|
|
|
54
57
|
avatarUrl:
|
|
55
58
|
'https://wiecejnizlek.pl/wp-content/uploads/2021/08/Dariusz_Chrapek-uai-2996x2996-1-scaled.jpeg',
|
|
56
59
|
teamMemberImageUrl: 'https://lek.wiecejnizlek.pl/images/lek/logo-badge.svg',
|
|
60
|
+
activityStatusTooltip: 'Active now',
|
|
57
61
|
},
|
|
58
62
|
};
|
|
59
63
|
|
|
@@ -20,11 +20,21 @@
|
|
|
20
20
|
<span v-else class="ds-avatar__initials">{{ initials }}</span>
|
|
21
21
|
</div>
|
|
22
22
|
<div v-if="activityStatus" class="ds-avatar__activityStatus">
|
|
23
|
-
<ds-
|
|
24
|
-
:
|
|
25
|
-
|
|
26
|
-
:
|
|
27
|
-
|
|
23
|
+
<ds-tooltip
|
|
24
|
+
:key="activityStatusTooltip"
|
|
25
|
+
class="ds-avatar__activityStatusTooltip"
|
|
26
|
+
:text="activityStatusTooltip"
|
|
27
|
+
:is-disabled="!activityStatusTooltip"
|
|
28
|
+
is-pointer-visible
|
|
29
|
+
:placement="TOOLTIP_PLACEMENTS.BOTTOM"
|
|
30
|
+
:is-hidden-on-mobile="false"
|
|
31
|
+
>
|
|
32
|
+
<ds-badge
|
|
33
|
+
:color="activityStatusColor"
|
|
34
|
+
:elevation="BADGE_ELEVATIONS.X_SMALL"
|
|
35
|
+
:size="activityStatusSize"
|
|
36
|
+
/>
|
|
37
|
+
</ds-tooltip>
|
|
28
38
|
</div>
|
|
29
39
|
<div v-if="accessStatus" class="ds-avatar__accessStatus">
|
|
30
40
|
<ds-badge
|
|
@@ -169,6 +179,11 @@
|
|
|
169
179
|
top: -3px;
|
|
170
180
|
}
|
|
171
181
|
}
|
|
182
|
+
|
|
183
|
+
&__activityStatusTooltip {
|
|
184
|
+
align-items: center;
|
|
185
|
+
display: flex;
|
|
186
|
+
}
|
|
172
187
|
}
|
|
173
188
|
</style>
|
|
174
189
|
|
|
@@ -184,6 +199,7 @@ import {
|
|
|
184
199
|
import DsBadge, { BADGE_ELEVATIONS, BADGE_SIZES, BADGE_COLORS } from '../Badge';
|
|
185
200
|
import { computed } from 'vue';
|
|
186
201
|
import { ICONS } from '../Icons/Icon';
|
|
202
|
+
import DsTooltip, { TOOLTIP_PLACEMENTS } from '../Tooltip';
|
|
187
203
|
|
|
188
204
|
const {
|
|
189
205
|
size = AVATAR_SIZES.X_SMALL,
|
|
@@ -192,6 +208,7 @@ const {
|
|
|
192
208
|
activityStatus,
|
|
193
209
|
accessStatus,
|
|
194
210
|
teamMemberImageUrl,
|
|
211
|
+
activityStatusTooltip,
|
|
195
212
|
} = defineProps<{
|
|
196
213
|
username: string;
|
|
197
214
|
avatarUrl?: string;
|
|
@@ -199,6 +216,7 @@ const {
|
|
|
199
216
|
activityStatus?: AvatarActivityStatus;
|
|
200
217
|
accessStatus?: AvatarAccessStatus;
|
|
201
218
|
teamMemberImageUrl?: string;
|
|
219
|
+
activityStatusTooltip?: string;
|
|
202
220
|
}>();
|
|
203
221
|
|
|
204
222
|
const { initials, initialBackgroundColor } = useInitials();
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
'-ds-disabled': state === CHIP_STATES.DISABLED,
|
|
8
8
|
'-ds-uppercase': isLabelUppercase,
|
|
9
9
|
'-ds-rounded': radius === CHIP_RADIUSES.ROUNDED,
|
|
10
|
+
'-ds-removable': size !== CHIP_SIZES.X_SMALL && isRemovable,
|
|
10
11
|
}"
|
|
11
12
|
:title="label"
|
|
12
13
|
:style="{ backgroundColor: colorHex }"
|
|
@@ -19,7 +20,7 @@
|
|
|
19
20
|
/>
|
|
20
21
|
</slot>
|
|
21
22
|
</span>
|
|
22
|
-
<span class="ds-chip__label">{{ label }}</span>
|
|
23
|
+
<span v-if="label" class="ds-chip__label">{{ label }}</span>
|
|
23
24
|
<icon-button
|
|
24
25
|
v-if="size !== CHIP_SIZES.X_SMALL && isRemovable"
|
|
25
26
|
class="ds-chip__remove"
|
|
@@ -180,7 +181,12 @@ $chip-colors: (
|
|
|
180
181
|
align-items: center;
|
|
181
182
|
border-radius: $radius-xl;
|
|
182
183
|
display: inline-flex;
|
|
183
|
-
|
|
184
|
+
gap: $space-4xs;
|
|
185
|
+
padding: $space-4xs $space-2xs;
|
|
186
|
+
|
|
187
|
+
&.-ds-removable {
|
|
188
|
+
padding: $space-5xs $space-5xs $space-5xs $space-2xs;
|
|
189
|
+
}
|
|
184
190
|
|
|
185
191
|
&.-ds-disabled {
|
|
186
192
|
pointer-events: none;
|
|
@@ -199,7 +205,6 @@ $chip-colors: (
|
|
|
199
205
|
&__label {
|
|
200
206
|
@include label-s-default-bold;
|
|
201
207
|
|
|
202
|
-
margin: $space-5xs $space-3xs $space-5xs 0;
|
|
203
208
|
overflow: hidden;
|
|
204
209
|
text-overflow: ellipsis;
|
|
205
210
|
white-space: nowrap;
|
|
@@ -207,21 +212,15 @@ $chip-colors: (
|
|
|
207
212
|
|
|
208
213
|
&__leftIcon {
|
|
209
214
|
display: flex;
|
|
210
|
-
margin-right: $space-4xs;
|
|
211
215
|
}
|
|
212
216
|
|
|
213
217
|
&.-ds-x-small {
|
|
218
|
+
gap: $space-5xs;
|
|
214
219
|
min-height: $chip-min-height;
|
|
215
|
-
padding
|
|
216
|
-
|
|
217
|
-
#{$self}__leftIcon {
|
|
218
|
-
margin-right: $space-5xs;
|
|
219
|
-
}
|
|
220
|
+
padding: $space-5xs $space-3xs;
|
|
220
221
|
|
|
221
222
|
#{$self}__label {
|
|
222
223
|
@include label-xs-default-bold;
|
|
223
|
-
|
|
224
|
-
margin: 0 $space-4xs 0 0;
|
|
225
224
|
}
|
|
226
225
|
|
|
227
226
|
&.-ds-uppercase {
|
|
@@ -238,16 +237,16 @@ $chip-colors: (
|
|
|
238
237
|
</style>
|
|
239
238
|
|
|
240
239
|
<script lang="ts">
|
|
241
|
-
import {
|
|
240
|
+
import { defineComponent, toRaw } from 'vue';
|
|
241
|
+
import { Value } from '../../utils/type.utils';
|
|
242
|
+
import { BUTTON_ELEVATIONS } from '../Buttons/Button';
|
|
242
243
|
import IconButton, {
|
|
243
244
|
ICON_BUTTON_COLORS,
|
|
244
245
|
ICON_BUTTON_SIZES,
|
|
245
246
|
ICON_BUTTON_STATES,
|
|
246
247
|
} from '../Buttons/IconButton';
|
|
247
248
|
import Icon, { ICON_SIZES, ICONS } from '../Icons/Icon';
|
|
248
|
-
import {
|
|
249
|
-
import { Value } from '../../utils/type.utils';
|
|
250
|
-
import { defineComponent, toRaw } from 'vue';
|
|
249
|
+
import { CHIP_COLORS, CHIP_RADIUSES, CHIP_SIZES, CHIP_STATES } from './Chip.consts';
|
|
251
250
|
|
|
252
251
|
const CHIP_ICON_BUTTONS_COLOR_MAP = {
|
|
253
252
|
[CHIP_COLORS.INVERTED]: ICON_BUTTON_COLORS.PRIMARY,
|
|
@@ -267,7 +266,7 @@ export default defineComponent({
|
|
|
267
266
|
props: {
|
|
268
267
|
label: {
|
|
269
268
|
type: String,
|
|
270
|
-
|
|
269
|
+
default: null,
|
|
271
270
|
},
|
|
272
271
|
isLabelUppercase: {
|
|
273
272
|
type: Boolean,
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import BasicRichListItem from './BasicRichListItem.vue';
|
|
2
2
|
|
|
3
|
+
import { withActions } from '@storybook/addon-actions/decorator';
|
|
4
|
+
import { useArgs } from '@storybook/preview-api';
|
|
3
5
|
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/vue3';
|
|
6
|
+
import { DsImage } from '../../../index';
|
|
7
|
+
import { ICON_COLORS, ICONS } from '../../Icons/Icon';
|
|
4
8
|
import {
|
|
5
9
|
RICH_LIST_ITEM_BACKGROUND_COLOR,
|
|
6
10
|
RICH_LIST_ITEM_BORDER_COLOR,
|
|
@@ -10,10 +14,6 @@ import {
|
|
|
10
14
|
RICH_LIST_ITEM_STATE,
|
|
11
15
|
RICH_LIST_ITEM_TYPE,
|
|
12
16
|
} from '../RichListItem';
|
|
13
|
-
import { ICON_COLORS, ICONS } from '../../Icons/Icon';
|
|
14
|
-
import { DsImage } from '../../../index';
|
|
15
|
-
import { useArgs } from '@storybook/preview-api';
|
|
16
|
-
import { withActions } from '@storybook/addon-actions/decorator';
|
|
17
17
|
|
|
18
18
|
export default {
|
|
19
19
|
title: 'Components/RichList/BasicRichListItem',
|
|
@@ -121,6 +121,7 @@ const expandStory = (story: StoryFn<typeof BasicRichListItem>, args = {}) => {
|
|
|
121
121
|
hasActionsSlotDivider: true,
|
|
122
122
|
isSelectable: true,
|
|
123
123
|
isSelected: true,
|
|
124
|
+
isTextGroupSelected: false,
|
|
124
125
|
borderColor: null,
|
|
125
126
|
borderColorHex: '',
|
|
126
127
|
state: RICH_LIST_ITEM_STATE.DEFAULT,
|
|
@@ -202,6 +203,7 @@ const InteractiveStoryTemplate: StoryFn<typeof BasicRichListItem> = (args) => {
|
|
|
202
203
|
:has-actions-slot-divider="hasActionsSlotDivider"
|
|
203
204
|
:is-selectable="isSelectable"
|
|
204
205
|
:is-selected="isSelected"
|
|
206
|
+
:is-text-group-selected="isTextGroupSelected"
|
|
205
207
|
@update:is-selected="updateIsSelected"
|
|
206
208
|
>
|
|
207
209
|
<template v-if="metadata" #metadata>
|
|
@@ -263,6 +265,7 @@ const WithMediaStoryTemplate: StoryFn<typeof BasicRichListItem> = (args) => {
|
|
|
263
265
|
:has-actions-slot-divider="hasActionsSlotDivider"
|
|
264
266
|
:is-selectable="isSelectable"
|
|
265
267
|
:is-selected="isSelected"
|
|
268
|
+
:is-text-group-selected="isTextGroupSelected"
|
|
266
269
|
@update:is-selected="updateIsSelected"
|
|
267
270
|
>
|
|
268
271
|
<template #media>
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
:eyebrow-text="eyebrow"
|
|
37
37
|
:eyebrow-text-ellipsis="eyebrowEllipsis"
|
|
38
38
|
:is-eyebrow-text-uppercase="isEyebrowUppercase"
|
|
39
|
-
:is-selected="
|
|
39
|
+
:is-selected="isTextGroupSelected"
|
|
40
40
|
:is-interactive="false"
|
|
41
41
|
:main-text="text"
|
|
42
42
|
:main-text-ellipsis="textEllipsis"
|
|
@@ -89,6 +89,15 @@
|
|
|
89
89
|
</style>
|
|
90
90
|
|
|
91
91
|
<script lang="ts">
|
|
92
|
+
import { defineComponent, PropType, toRaw } from 'vue';
|
|
93
|
+
import { ICON_COLORS, IconColor, IconItem, ICONS } from '../../Icons/Icon';
|
|
94
|
+
import {
|
|
95
|
+
TEXT_GROUP_SIZES,
|
|
96
|
+
TEXT_GROUP_STATES,
|
|
97
|
+
TextGroupSize,
|
|
98
|
+
TextGroupState,
|
|
99
|
+
} from '../../TextGroup';
|
|
100
|
+
import DsTextGroup from '../../TextGroup/TextGroup.vue';
|
|
92
101
|
import RichListItem, {
|
|
93
102
|
RICH_LIST_ITEM_BACKGROUND_COLOR,
|
|
94
103
|
RICH_LIST_ITEM_BORDER_COLOR,
|
|
@@ -105,15 +114,6 @@ import RichListItem, {
|
|
|
105
114
|
RichListItemState,
|
|
106
115
|
RichListItemType,
|
|
107
116
|
} from '../RichListItem';
|
|
108
|
-
import DsTextGroup from '../../TextGroup/TextGroup.vue';
|
|
109
|
-
import { defineComponent, PropType, toRaw } from 'vue';
|
|
110
|
-
import { ICON_COLORS, IconColor, IconItem, ICONS } from '../../Icons/Icon';
|
|
111
|
-
import {
|
|
112
|
-
TEXT_GROUP_SIZES,
|
|
113
|
-
TEXT_GROUP_STATES,
|
|
114
|
-
TextGroupSize,
|
|
115
|
-
TextGroupState,
|
|
116
|
-
} from '../../TextGroup';
|
|
117
117
|
|
|
118
118
|
export default defineComponent({
|
|
119
119
|
name: 'BasicRichListItem',
|
|
@@ -253,6 +253,10 @@ export default defineComponent({
|
|
|
253
253
|
type: Boolean,
|
|
254
254
|
default: false,
|
|
255
255
|
},
|
|
256
|
+
isTextGroupSelected: {
|
|
257
|
+
type: Boolean,
|
|
258
|
+
default: false,
|
|
259
|
+
},
|
|
256
260
|
},
|
|
257
261
|
emits: {
|
|
258
262
|
'update:is-selected': (value: boolean) => true,
|
|
@@ -136,11 +136,11 @@ $rich-list-item-media-horizontal-height: 80px;
|
|
|
136
136
|
#{$root}__dragAndDrop,
|
|
137
137
|
#{$root}__iconWrapper {
|
|
138
138
|
align-items: center;
|
|
139
|
-
padding: $space-3xs $space-
|
|
139
|
+
padding: $space-3xs $space-5xs $space-3xs $space-s;
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
#{$root}__content {
|
|
143
|
-
padding: 0 $space-4xs 0 $space-
|
|
143
|
+
padding: 0 $space-4xs 0 $space-s;
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
#{$root}__metadata {
|
|
@@ -173,6 +173,10 @@ $rich-list-item-media-horizontal-height: 80px;
|
|
|
173
173
|
padding: $space-3xs 0 $space-3xs $space-xs;
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
+
#{$root}__content {
|
|
177
|
+
padding: 0 $space-4xs 0 $space-xs;
|
|
178
|
+
}
|
|
179
|
+
|
|
176
180
|
#{$root}__checkbox {
|
|
177
181
|
gap: $space-xs;
|
|
178
182
|
padding: 0 $space-xs 0 $space-4xs;
|
|
@@ -242,6 +246,10 @@ $rich-list-item-media-horizontal-height: 80px;
|
|
|
242
246
|
padding: $space-2xs $space-4xs 0 $space-2xs;
|
|
243
247
|
}
|
|
244
248
|
|
|
249
|
+
#{$root}__content {
|
|
250
|
+
padding: 0 $space-4xs 0 $space-2xs;
|
|
251
|
+
}
|
|
252
|
+
|
|
245
253
|
#{$root}__checkbox {
|
|
246
254
|
gap: $space-s;
|
|
247
255
|
padding: $space-5xs $space-2xs 0 $space-2xs;
|
|
@@ -446,6 +454,7 @@ $rich-list-item-media-horizontal-height: 80px;
|
|
|
446
454
|
|
|
447
455
|
&:hover {
|
|
448
456
|
cursor: grab;
|
|
457
|
+
|
|
449
458
|
#{$root}__dragAndDropIcon {
|
|
450
459
|
color: $color-neutral-icon-weak-hovered;
|
|
451
460
|
}
|
|
@@ -457,11 +466,6 @@ $rich-list-item-media-horizontal-height: 80px;
|
|
|
457
466
|
}
|
|
458
467
|
|
|
459
468
|
&.-ds-small {
|
|
460
|
-
#{$root}__content {
|
|
461
|
-
align-items: center;
|
|
462
|
-
padding: 0 $space-4xs 0 $space-2xs;
|
|
463
|
-
}
|
|
464
|
-
|
|
465
469
|
#{$root}__actionSlot {
|
|
466
470
|
gap: $space-2xs;
|
|
467
471
|
}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as G,q as i,c as u,a as b,j as k,u as e,s as p,k as I,g as v,n as h,o}from"./vue.esm-bundler-DmkhfO_9.js";import{c as M,B as C,b as l,a as s}from"./Badge-DSmH78WU.js";import{I as d}from"./Icon-BPz80dqH.js";import{_ as O}from"./_plugin-vue_export-helper-DlAUqK2U.js";const a={XX_SMALL:"xx-small",X_SMALL:"x-small",SMALL:"small",MEDIUM:"medium",LARGE:"large",X_LARGE:"x-large"},_={ACTIVE:"active",INACTIVE:"inactive"},c={ACTIVE:"active",INACTIVE:"inactive",AWAITING:"awaiting",BLOCKED:"blocked",TEAM_MEMBER:"team-member"},q=["src","alt"],w={key:1,class:"ds-avatar__initials"},K={key:0,class:"ds-avatar__activityStatus"},F={key:1,class:"ds-avatar__accessStatus"},f=G({__name:"Avatar",props:{username:{},avatarUrl:{},size:{default:()=>a.X_SMALL},activityStatus:{},accessStatus:{},teamMemberImageUrl:{}},setup(r){const{initials:g,initialBackgroundColor:y}=V(),{accessStatusColor:T,accessStatusIcon:U,accessStatusSize:z,accessStatusImage:R}=B(),{activityStatusColor:X,activityStatusSize:N}=D();function V(){const t=["#1abc9c","#2ecc71","#3498db","#9b59b6","#34495e","#16a085","#27ae60","#2980b9","#8e44ad","#2c3e50","#f1c40f","#e67e22","#e74c3c","#f39c12","#d35400","#c0392b"];function n(A){const[m,E]=A.split(/\s+/);return m&&E?`${m[0]}${E[0]}`.toUpperCase():m.substring(0,2).toUpperCase()}const S=i(()=>{if(r.avatarUrl)return;const A=(r.username.charCodeAt(0)-65)%16;return t[A]});return{initials:i(()=>n(r.username)),initialBackgroundColor:S}}function B(){const t=i(()=>{switch(r.accessStatus){case c.ACTIVE:return l.SUCCESS;case c.INACTIVE:case c.AWAITING:return l.NEUTRAL;case c.BLOCKED:return l.DANGER;default:return}}),n=i(()=>{switch(r.accessStatus){case c.ACTIVE:return d.FA_UNLOCK_KEYHOLE;case c.BLOCKED:case c.INACTIVE:return d.FA_LOCK_KEYHOLE;case c.AWAITING:return d.FA_HOURGLASS_START;default:return}}),S=i(()=>{switch(r.size){case a.XX_SMALL:return s.SMALL;case a.X_SMALL:return s.SMALL;case a.SMALL:return s.SMALL;case a.MEDIUM:return s.MEDIUM;case a.LARGE:return s.MEDIUM;case a.X_LARGE:default:return s.X_LARGE}}),L=i(()=>{if(r.accessStatus===c.TEAM_MEMBER)return r.teamMemberImageUrl});return{accessStatusColor:t,accessStatusIcon:n,accessStatusSize:S,accessStatusImage:L}}function D(){const t=i(()=>{switch(r.activityStatus){case _.ACTIVE:return l.SUCCESS;default:case _.INACTIVE:return l.NEUTRAL}}),n=i(()=>{switch(r.size){case a.XX_SMALL:return s.X_SMALL;case a.X_SMALL:return s.SMALL;case a.SMALL:return s.SMALL;case a.MEDIUM:return s.MEDIUM;case a.LARGE:return s.MEDIUM;case a.X_LARGE:default:return s.MEDIUM}});return{activityStatusColor:t,activityStatusSize:n}}return(t,n)=>(o(),u("div",{class:h(["ds-avatar",{"-ds-xx-small":t.size===e(a).XX_SMALL,"-ds-x-small":t.size===e(a).X_SMALL,"-ds-small":t.size===e(a).SMALL,"-ds-medium":t.size===e(a).MEDIUM,"-ds-large":t.size===e(a).LARGE,"-ds-x-large":t.size===e(a).X_LARGE}])},[b("div",{class:"ds-avatar__content",style:p({backgroundColor:e(y)})},[t.avatarUrl?(o(),u("img",{key:0,src:t.avatarUrl,alt:t.username,class:"ds-avatar__image"},null,8,q)):(o(),u("span",w,k(e(g)),1))],4),t.activityStatus?(o(),u("div",K,[I(e(C),{color:e(X),elevation:e(M).X_SMALL,size:e(N)},null,8,["color","elevation","size"])])):v("",!0),t.accessStatus?(o(),u("div",F,[I(e(C),{color:e(T),elevation:e(M).SMALL,icon:e(U),size:e(z),"image-url":e(R)},null,8,["color","elevation","icon","size","image-url"])])):v("",!0)],2))}}),x=O(f,[["__scopeId","data-v-e662d6a3"]]);f.__docgenInfo={exportName:"default",displayName:"Avatar",description:"",tags:{},props:[{name:"username",required:!0,type:{name:"string"}},{name:"avatarUrl",required:!1,type:{name:"string"}},{name:"size",required:!1,type:{name:"AvatarSize"}},{name:"activityStatus",required:!1,type:{name:"AvatarActivityStatus"}},{name:"accessStatus",required:!1,type:{name:"AvatarAccessStatus"}},{name:"teamMemberImageUrl",required:!1,type:{name:"string"}}],sourceFiles:["/home/runner/work/design-system/design-system/lib/js/components/Avatar/Avatar.vue"]};export{x as A,a,c as b,_ as c};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import{A as o,a as r,b as k,c as m}from"./Avatar-U_7Z6nZ2.js";import"./vue.esm-bundler-DmkhfO_9.js";import"./Badge-DSmH78WU.js";import"./Icon-BPz80dqH.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const v={title:"Components/Avatar",component:o,render:s=>({components:{Avatar:o},setup(){return{args:s}},template:'<Avatar v-bind="args" />'}),argTypes:{size:{control:"select",options:Object.values(r)},accessStatus:{control:{type:"select",labels:{undefined:"None (undefined)"}},options:[void 0,...Object.values(k)]},activityStatus:{control:{type:"select",labels:{undefined:"None (undefined)"}},options:[void 0,...Object.values(m)]}}},e={args:{size:r.X_SMALL,username:"Dariusz Chrapek",avatarUrl:"https://wiecejnizlek.pl/wp-content/uploads/2021/08/Dariusz_Chrapek-uai-2996x2996-1-scaled.jpeg",teamMemberImageUrl:"https://lek.wiecejnizlek.pl/images/lek/logo-badge.svg"}};e.parameters={design:{type:"figma",url:"https://www.figma.com/design/izQdYyiBR1GQgFkaOIfIJI/LMS---DS-Components?node-id=12364-12175&t=UpUoIm9oCAaH4dEp-4"}};const a={render:s=>({components:{Avatar:o},setup(){return{args:s,names:["Arkadiusz Kowalski","Bartosz Nowak","Cezary Kowalczyk","Dariusz Chrapek","Edward Nowak","Feliks Kowalski","Grzegorz Nowak","Henryk Kowalczyk","Ireneusz Nowak","Jacek Kowalski","Kamil Nowak","Leszek Kowalczyk","Marek Nowak","Norbert Kowalski","Oskar Nowak","Piotr Kowalczyk"]}},template:'<div style="display: flex; gap: 12px; flex-wrap: wrap;"><div v-for="name in names"><Avatar v-bind="args" :username="name" /></div></div>'}),argTypes:{size:{control:"select",options:Object.values(r)},username:{control:!1},avatarUrl:{control:!1}},args:{size:r.X_SMALL,teamMemberImageUrl:"https://lek.wiecejnizlek.pl/images/lek/logo-badge.svg"}};var t,l,i;e.parameters={...e.parameters,docs:{...(t=e.parameters)==null?void 0:t.docs,source:{originalSource:`{
|
|
2
|
-
args: {
|
|
3
|
-
size: AVATAR_SIZES.X_SMALL,
|
|
4
|
-
username: 'Dariusz Chrapek',
|
|
5
|
-
avatarUrl: 'https://wiecejnizlek.pl/wp-content/uploads/2021/08/Dariusz_Chrapek-uai-2996x2996-1-scaled.jpeg',
|
|
6
|
-
teamMemberImageUrl: 'https://lek.wiecejnizlek.pl/images/lek/logo-badge.svg'
|
|
7
|
-
}
|
|
8
|
-
}`,...(i=(l=e.parameters)==null?void 0:l.docs)==null?void 0:i.source}}};var n,p,c;a.parameters={...a.parameters,docs:{...(n=a.parameters)==null?void 0:n.docs,source:{originalSource:`{
|
|
9
|
-
render: (args: AvatarProps) => ({
|
|
10
|
-
components: {
|
|
11
|
-
Avatar
|
|
12
|
-
},
|
|
13
|
-
setup() {
|
|
14
|
-
return {
|
|
15
|
-
args,
|
|
16
|
-
names: ['Arkadiusz Kowalski', 'Bartosz Nowak', 'Cezary Kowalczyk', 'Dariusz Chrapek', 'Edward Nowak', 'Feliks Kowalski', 'Grzegorz Nowak', 'Henryk Kowalczyk', 'Ireneusz Nowak', 'Jacek Kowalski', 'Kamil Nowak', 'Leszek Kowalczyk', 'Marek Nowak', 'Norbert Kowalski', 'Oskar Nowak', 'Piotr Kowalczyk']
|
|
17
|
-
};
|
|
18
|
-
},
|
|
19
|
-
template: \`<div style="display: flex; gap: 12px; flex-wrap: wrap;"><div v-for="name in names"><Avatar v-bind="args" :username="name" /></div></div>\`
|
|
20
|
-
}),
|
|
21
|
-
argTypes: {
|
|
22
|
-
size: {
|
|
23
|
-
control: 'select',
|
|
24
|
-
options: Object.values(AVATAR_SIZES)
|
|
25
|
-
},
|
|
26
|
-
username: {
|
|
27
|
-
control: false
|
|
28
|
-
},
|
|
29
|
-
avatarUrl: {
|
|
30
|
-
control: false
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
args: {
|
|
34
|
-
size: AVATAR_SIZES.X_SMALL,
|
|
35
|
-
teamMemberImageUrl: 'https://lek.wiecejnizlek.pl/images/lek/logo-badge.svg'
|
|
36
|
-
}
|
|
37
|
-
}`,...(c=(p=a.parameters)==null?void 0:p.docs)==null?void 0:c.source}}};const A=["Interactive","Colors"];export{a as Colors,e as Interactive,A as __namedExportsOrder,v as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as y,R as r,c as l,b as u,a as t,d as v,e as d,f as b}from"./GroupRichListItem-B5zdEDgJ.js";import{D as T,T as p,c as n}from"./TextGroup-D5le3QVY.js";import{d as S,t as g,b as E,h as L,e as s,n as R,r as f,o as C,f as i,a as h,k as O}from"./vue.esm-bundler-DmkhfO_9.js";import{I as _,c as D}from"./Icon-BPz80dqH.js";import{_ as M}from"./_plugin-vue_export-helper-DlAUqK2U.js";const m=S({name:"BasicRichListItem",components:{DsTextGroup:T,RichListItem:y},props:{type:{type:String,default:r.DEFAULT,validator(e){return Object.values(r).includes(e)}},state:{type:String,default:l.DEFAULT,validator(e){return Object.values(l).includes(e)}},layout:{type:String,default:u.HORIZONTAL,validator(e){return Object.values(u).includes(e)}},size:{type:String,default:t.MEDIUM,validator(e){return Object.values(t).includes(e)}},isInteractive:{type:Boolean,default:!0},isDimmed:{type:Boolean,default:!1},isDraggable:{type:Boolean,default:!0},icon:{type:Object,default:null,validator(e){return Object.values(_).includes(g(e))}},iconColor:{type:String,default:null,validator(e){return Object.values(D).includes(e)}},iconColorHex:{type:String,default:null},borderColor:{type:String,default:null,validator(e){return Object.values(v).includes(e)}},borderColorHex:{type:String,default:null},text:{type:String,required:!0},textEllipsis:{type:Boolean,default:!1},eyebrow:{type:String,default:null},eyebrowEllipsis:{type:Boolean,default:!1},isEyebrowUppercase:{type:Boolean,default:!1},supportingText:{type:String,default:null},supportingTextEllipsis:{type:Boolean,default:!1},isSupportingTextTooltipEnabled:{type:Boolean,default:!1},backgroundColor:{type:String,default:d.NEUTRAL,validator(e){return Object.values(d).includes(e)}},elevation:{type:String,default:null,validator(e){return Object.values(b).includes(e)}},hasDraggableHandler:{type:Boolean,default:!0},hasActionsSlotDivider:{type:Boolean,default:!0},isSelectable:{type:Boolean,default:!0},isSelected:{type:Boolean,default:!1}},emits:{"update:is-selected":e=>!0},data(){return{hovered:!1,RICH_LIST_ITEM_SIZE:Object.freeze(t),RICH_LIST_ITEM_STATE:Object.freeze(l)}},computed:{textGroupSize(){return{[t.SMALL]:p.SMALL,[t.MEDIUM]:p.MEDIUM}[this.size]},textGroupState(){return this.state===l.LOADING?n.LOADING:this.hovered&&this.isInteractive?n.HOVERED:n.DEFAULT}}}),V={class:"ds-basicRichListItem__content"};function A(e,a,H,B,U,w){const c=f("ds-text-group"),I=f("rich-list-item");return C(),E(I,{size:e.size,type:e.type,layout:e.layout,"is-interactive":e.isInteractive,"is-draggable":e.isDraggable,icon:e.icon,"icon-color":e.iconColor,"icon-color-hex":e.iconColorHex,"is-dimmed":e.isDimmed,"border-color":e.borderColor,"border-color-hex":e.borderColorHex,state:e.state,"background-color":e.backgroundColor,elevation:e.elevation,"has-draggable-handler":e.hasDraggableHandler,"has-actions-slot-divider":e.hasActionsSlotDivider,"is-selectable":e.isSelectable,"is-selected":e.isSelected,class:R(["ds-basicRichListItem",{"-ds-loading":e.state===e.RICH_LIST_ITEM_STATE.LOADING,"-ds-small":e.size===e.RICH_LIST_ITEM_SIZE.SMALL}]),onMouseover:a[0]||(a[0]=o=>e.hovered=!0),onMouseleave:a[1]||(a[1]=o=>e.hovered=!1),"onUpdate:isSelected":a[2]||(a[2]=o=>e.$emit("update:is-selected",o))},L({content:s(()=>[h("div",V,[O(c,{"eyebrow-text":e.eyebrow,"eyebrow-text-ellipsis":e.eyebrowEllipsis,"is-eyebrow-text-uppercase":e.isEyebrowUppercase,"is-selected":e.isSelected,"is-interactive":!1,"main-text":e.text,"main-text-ellipsis":e.textEllipsis,"supporting-text":e.supportingText,"supporting-text-ellipsis":e.supportingTextEllipsis,size:e.textGroupSize,state:e.textGroupState,"is-supporting-text-tooltip-enabled":e.isSupportingTextTooltipEnabled},null,8,["eyebrow-text","eyebrow-text-ellipsis","is-eyebrow-text-uppercase","is-selected","main-text","main-text-ellipsis","supporting-text","supporting-text-ellipsis","size","state","is-supporting-text-tooltip-enabled"])])]),_:2},[e.$slots.media?{name:"media",fn:s(()=>[i(e.$slots,"media",{},void 0,!0)]),key:"0"}:void 0,e.$slots.metadata?{name:"metadata",fn:s(()=>[i(e.$slots,"metadata",{},void 0,!0)]),key:"1"}:void 0,e.$slots.actions?{name:"actions",fn:s(()=>[i(e.$slots,"actions",{},void 0,!0)]),key:"2"}:void 0]),1032,["size","type","layout","is-interactive","is-draggable","icon","icon-color","icon-color-hex","is-dimmed","border-color","border-color-hex","state","background-color","elevation","has-draggable-handler","has-actions-slot-divider","is-selectable","is-selected","class"])}const G=M(m,[["render",A],["__scopeId","data-v-d64ae189"]]);m.__docgenInfo={displayName:"BasicRichListItem",exportName:"default",description:"",tags:{},props:[{name:"type",type:{name:"RichListItemType"},defaultValue:{func:!1,value:"RICH_LIST_ITEM_TYPE.DEFAULT"}},{name:"state",type:{name:"RichListItemState"},defaultValue:{func:!1,value:"RICH_LIST_ITEM_STATE.DEFAULT"}},{name:"layout",type:{name:"RichListItemLayout"},defaultValue:{func:!1,value:"RICH_LIST_ITEM_LAYOUT.HORIZONTAL"}},{name:"size",type:{name:"RichListItemSize"},defaultValue:{func:!1,value:"RICH_LIST_ITEM_SIZE.MEDIUM"}},{name:"isInteractive",type:{name:"boolean"},defaultValue:{func:!1,value:"true"}},{name:"isDimmed",type:{name:"boolean"},defaultValue:{func:!1,value:"false"}},{name:"isDraggable",type:{name:"boolean"},defaultValue:{func:!1,value:"true"}},{name:"icon",type:{name:"IconItem"},defaultValue:{func:!1,value:"null"}},{name:"iconColor",type:{name:"IconColor"},defaultValue:{func:!1,value:"null"}},{name:"iconColorHex",type:{name:"string"},defaultValue:{func:!1,value:"null"}},{name:"borderColor",type:{name:"RichListItemBorderColor"},defaultValue:{func:!1,value:"null"}},{name:"borderColorHex",type:{name:"string"},defaultValue:{func:!1,value:"null"}},{name:"text",type:{name:"string"},required:!0},{name:"textEllipsis",type:{name:"boolean"},defaultValue:{func:!1,value:"false"}},{name:"eyebrow",type:{name:"string"},defaultValue:{func:!1,value:"null"}},{name:"eyebrowEllipsis",type:{name:"boolean"},defaultValue:{func:!1,value:"false"}},{name:"isEyebrowUppercase",type:{name:"boolean"},defaultValue:{func:!1,value:"false"}},{name:"supportingText",type:{name:"string"},defaultValue:{func:!1,value:"null"}},{name:"supportingTextEllipsis",type:{name:"boolean"},defaultValue:{func:!1,value:"false"}},{name:"isSupportingTextTooltipEnabled",type:{name:"boolean"},defaultValue:{func:!1,value:"false"}},{name:"backgroundColor",type:{name:"RichListItemBackgroundColor"},defaultValue:{func:!1,value:"RICH_LIST_ITEM_BACKGROUND_COLOR.NEUTRAL"}},{name:"elevation",type:{name:"RichListItemElevation"},defaultValue:{func:!1,value:"null"}},{name:"hasDraggableHandler",type:{name:"boolean"},defaultValue:{func:!1,value:"true"}},{name:"hasActionsSlotDivider",type:{name:"boolean"},defaultValue:{func:!1,value:"true"}},{name:"isSelectable",type:{name:"boolean"},defaultValue:{func:!1,value:"true"}},{name:"isSelected",type:{name:"boolean"},defaultValue:{func:!1,value:"false"}}],events:[{name:"update:is-selected"}],slots:[{name:"media"},{name:"metadata"},{name:"actions"}],sourceFiles:["/home/runner/work/design-system/design-system/lib/js/components/RichList/BasicRichListItem/BasicRichListItem.vue"]};export{G as B};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as p}from"./IconButton-gTykCZIi.js";import{i as a,e as m,h as A,I as C}from"./Button-yeAor0pZ.js";import{a as E,I as i,b as N}from"./Icon-BPz80dqH.js";import{d as O,t as T,c as u,f as L,g as S,a as _,j as R,b,n as U,s as v,r as c,o,k as y}from"./vue.esm-bundler-DmkhfO_9.js";import{_ as P}from"./_plugin-vue_export-helper-DlAUqK2U.js";const t={X_SMALL:"x-small",SMALL:"small"},s={PRIMARY:"primary",PRIMARY_STRONG:"primaryStrong",NEUTRAL:"neutral",FAIL:"fail",DANGER:"danger",SUCCESS:"success",INVERTED:"inverted",WARNING:"warning",INFO:"info"},l={DEFAULT:"default",DISABLED:"disabled"},n={CAPSULE:"capsule",ROUNDED:"rounded"},D={[s.INVERTED]:a.PRIMARY,[s.NEUTRAL]:a.NEUTRAL,[s.PRIMARY]:a.PRIMARY,[s.PRIMARY_STRONG]:a.PRIMARY,[s.FAIL]:a.FAIL,[s.DANGER]:a.DANGER,[s.WARNING]:a.WARNING,[s.SUCCESS]:a.SUCCESS,[s.INFO]:a.INFO},I=O({name:"Chip",components:{Icon:E,IconButton:p},props:{label:{type:String,required:!0},isLabelUppercase:{type:Boolean,default:!1},leftIcon:{type:Object,default:null,validator(e){return Object.values(i).includes(T(e))}},radius:{type:String,default:n.CAPSULE,validator(e){return Object.values(n).includes(e)}},size:{type:String,default:t.SMALL,validator(e){return Object.values(t).includes(e)}},color:{type:String,default:s.NEUTRAL,validator(e){return Object.values(s).includes(e)}},colorHex:{type:String,default:null},state:{type:String,default:l.DEFAULT,validator(e){return Object.values(l).includes(e)}},isRemovable:{type:Boolean,default:!1}},emits:["remove"],data(){return{ICONS:Object.freeze(i),BUTTON_ELEVATIONS:Object.freeze(m),ICON_BUTTON_STATES:Object.freeze(A),ICON_BUTTON_SIZES:Object.freeze(C),ICON_SIZES:Object.freeze(N),CHIP_SIZES:Object.freeze(t),CHIP_STATES:Object.freeze(l),CHIP_RADIUSES:Object.freeze(n)}},computed:{colorClassName(){return this.colorHex?"-ds-color-invertedHex":`-ds-color-${this.color}`},customStyle(){const e={};return this.colorHex&&(e.backgroundColor=this.colorHex),e},iconButtonColor(){return this.colorHex?a.NEUTRAL:D[this.color]||a.PRIMARY}}}),H=["title"],B={key:0,class:"ds-chip__leftIcon"},g={class:"ds-chip__label"};function M(e,r,h,z,j,V){const d=c("icon"),f=c("icon-button");return o(),u("div",{class:U(["ds-chip",{"-ds-x-small":e.size===e.CHIP_SIZES.X_SMALL,[e.colorClassName]:!0,"-ds-disabled":e.state===e.CHIP_STATES.DISABLED,"-ds-uppercase":e.isLabelUppercase,"-ds-rounded":e.radius===e.CHIP_RADIUSES.ROUNDED}]),title:e.label,style:v({backgroundColor:e.colorHex})},[e.$slots.accessory||e.leftIcon?(o(),u("span",B,[L(e.$slots,"accessory",{},()=>[y(d,{icon:e.leftIcon,size:e.size===e.CHIP_SIZES.X_SMALL?e.ICON_SIZES.XXX_SMALL:e.ICON_SIZES.XX_SMALL},null,8,["icon","size"])],!0)])):S("",!0),_("span",g,R(e.label),1),e.size!==e.CHIP_SIZES.X_SMALL&&e.isRemovable?(o(),b(f,{key:1,class:"ds-chip__remove",touchable:!1,state:e.state===e.CHIP_STATES.DISABLED?e.ICON_BUTTON_STATES.DISABLED:e.ICON_BUTTON_STATES.DEFAULT,color:e.iconButtonColor,size:e.ICON_BUTTON_SIZES.XX_SMALL,icon:e.ICONS.FA_XMARK,elevation:e.BUTTON_ELEVATIONS.X_SMALL,onClick:r[0]||(r[0]=X=>e.$emit("remove"))},null,8,["state","color","size","icon","elevation"])):S("",!0)],14,H)}const Y=P(I,[["render",M],["__scopeId","data-v-02de62e8"]]);I.__docgenInfo={displayName:"Chip",exportName:"default",description:"",tags:{},props:[{name:"label",type:{name:"string"},required:!0},{name:"isLabelUppercase",type:{name:"boolean"},defaultValue:{func:!1,value:"false"}},{name:"leftIcon",type:{name:"object"},defaultValue:{func:!1,value:"null"}},{name:"radius",type:{name:"string"},defaultValue:{func:!1,value:"CHIP_RADIUSES.CAPSULE"}},{name:"size",type:{name:"string"},defaultValue:{func:!1,value:"CHIP_SIZES.SMALL"}},{name:"color",type:{name:"string"},defaultValue:{func:!1,value:"CHIP_COLORS.NEUTRAL"}},{name:"colorHex",type:{name:"string"},defaultValue:{func:!1,value:"null"}},{name:"state",type:{name:"string"},defaultValue:{func:!1,value:"CHIP_STATES.DEFAULT"}},{name:"isRemovable",type:{name:"boolean"},defaultValue:{func:!1,value:"false"}}],events:[{name:"remove"}],slots:[{name:"accessory"}],sourceFiles:["/home/runner/work/design-system/design-system/lib/js/components/Chip/Chip.vue"]};export{Y as C,n as a,t as b,s as c,l as d};
|