@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
|
@@ -7,6 +7,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
7
7
|
activityStatus?: AvatarActivityStatus;
|
|
8
8
|
accessStatus?: AvatarAccessStatus;
|
|
9
9
|
teamMemberImageUrl?: string;
|
|
10
|
+
activityStatusTooltip?: string;
|
|
10
11
|
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
11
12
|
username: string;
|
|
12
13
|
avatarUrl?: string;
|
|
@@ -14,6 +15,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
14
15
|
activityStatus?: AvatarActivityStatus;
|
|
15
16
|
accessStatus?: AvatarAccessStatus;
|
|
16
17
|
teamMemberImageUrl?: string;
|
|
18
|
+
activityStatusTooltip?: string;
|
|
17
19
|
}>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
18
20
|
export default _default;
|
|
19
21
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { CHIP_RADIUSES, CHIP_STATES } from './Chip.consts';
|
|
2
|
-
import { ICON_BUTTON_COLORS, ICON_BUTTON_STATES } from '../Buttons/IconButton';
|
|
3
|
-
import { BUTTON_ELEVATIONS } from '../Buttons/Button';
|
|
4
1
|
import { Value } from '../../utils/type.utils';
|
|
2
|
+
import { BUTTON_ELEVATIONS } from '../Buttons/Button';
|
|
3
|
+
import { ICON_BUTTON_COLORS, ICON_BUTTON_STATES } from '../Buttons/IconButton';
|
|
4
|
+
import { CHIP_RADIUSES, CHIP_STATES } from './Chip.consts';
|
|
5
5
|
|
|
6
6
|
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
7
7
|
label: {
|
|
8
8
|
type: StringConstructor;
|
|
9
|
-
|
|
9
|
+
default: null;
|
|
10
10
|
};
|
|
11
11
|
isLabelUppercase: {
|
|
12
12
|
type: BooleanConstructor;
|
|
@@ -314,7 +314,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
314
314
|
}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "remove"[], "remove", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
315
315
|
label: {
|
|
316
316
|
type: StringConstructor;
|
|
317
|
-
|
|
317
|
+
default: null;
|
|
318
318
|
};
|
|
319
319
|
isLabelUppercase: {
|
|
320
320
|
type: BooleanConstructor;
|
|
@@ -357,6 +357,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
357
357
|
onRemove?: ((...args: any[]) => any) | undefined;
|
|
358
358
|
}>, {
|
|
359
359
|
size: string;
|
|
360
|
+
label: string;
|
|
360
361
|
color: string;
|
|
361
362
|
radius: string;
|
|
362
363
|
state: string;
|
|
@@ -1807,7 +1807,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
1807
1807
|
Chip: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
1808
1808
|
label: {
|
|
1809
1809
|
type: StringConstructor;
|
|
1810
|
-
|
|
1810
|
+
default: null;
|
|
1811
1811
|
};
|
|
1812
1812
|
isLabelUppercase: {
|
|
1813
1813
|
type: BooleanConstructor;
|
|
@@ -2115,7 +2115,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
2115
2115
|
}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "remove"[], "remove", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
2116
2116
|
label: {
|
|
2117
2117
|
type: StringConstructor;
|
|
2118
|
-
|
|
2118
|
+
default: null;
|
|
2119
2119
|
};
|
|
2120
2120
|
isLabelUppercase: {
|
|
2121
2121
|
type: BooleanConstructor;
|
|
@@ -2158,6 +2158,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
2158
2158
|
onRemove?: ((...args: any[]) => any) | undefined;
|
|
2159
2159
|
}>, {
|
|
2160
2160
|
size: string;
|
|
2161
|
+
label: string;
|
|
2161
2162
|
color: string;
|
|
2162
2163
|
radius: string;
|
|
2163
2164
|
state: string;
|
|
@@ -84,12 +84,12 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
84
84
|
onHide?: ((...args: any[]) => any) | undefined;
|
|
85
85
|
"onDocument-click"?: ((...args: any[]) => any) | undefined;
|
|
86
86
|
}>, {
|
|
87
|
+
placement: string;
|
|
87
88
|
radius: string;
|
|
88
89
|
boundariesSelector: string;
|
|
89
90
|
forceShow: boolean;
|
|
90
91
|
sameWidth: boolean;
|
|
91
92
|
triggerAction: string;
|
|
92
|
-
placement: string;
|
|
93
93
|
maxHeight: string;
|
|
94
94
|
}, {}, {
|
|
95
95
|
VuePopper: any;
|
|
@@ -1376,12 +1376,12 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
1376
1376
|
onHide?: ((...args: any[]) => any) | undefined;
|
|
1377
1377
|
"onDocument-click"?: ((...args: any[]) => any) | undefined;
|
|
1378
1378
|
}>, {
|
|
1379
|
+
placement: string;
|
|
1379
1380
|
radius: string;
|
|
1380
1381
|
boundariesSelector: string;
|
|
1381
1382
|
forceShow: boolean;
|
|
1382
1383
|
sameWidth: boolean;
|
|
1383
1384
|
triggerAction: string;
|
|
1384
|
-
placement: string;
|
|
1385
1385
|
maxHeight: string;
|
|
1386
1386
|
}, {}, {
|
|
1387
1387
|
VuePopper: any;
|
|
@@ -1507,10 +1507,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
1507
1507
|
};
|
|
1508
1508
|
}>> & Readonly<{}>, {
|
|
1509
1509
|
text: string;
|
|
1510
|
-
inline: boolean;
|
|
1511
1510
|
placement: import('../../Tooltip').TooltipPlacement;
|
|
1512
1511
|
isDisabled: boolean;
|
|
1513
1512
|
isPointerVisible: boolean;
|
|
1513
|
+
inline: boolean;
|
|
1514
1514
|
isHiddenOnMobile: boolean;
|
|
1515
1515
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
1516
1516
|
}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
@@ -1296,12 +1296,12 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
1296
1296
|
onHide?: ((...args: any[]) => any) | undefined;
|
|
1297
1297
|
"onDocument-click"?: ((...args: any[]) => any) | undefined;
|
|
1298
1298
|
}>, {
|
|
1299
|
+
placement: string;
|
|
1299
1300
|
radius: string;
|
|
1300
1301
|
boundariesSelector: string;
|
|
1301
1302
|
forceShow: boolean;
|
|
1302
1303
|
sameWidth: boolean;
|
|
1303
1304
|
triggerAction: string;
|
|
1304
|
-
placement: string;
|
|
1305
1305
|
maxHeight: string;
|
|
1306
1306
|
}, {}, {
|
|
1307
1307
|
VuePopper: any;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { RichListItemBackgroundColor, RichListItemBorderColor, RichListItemElevation, RichListItemLayout, RichListItemSize, RichListItemState, RichListItemType } from '../RichListItem';
|
|
2
1
|
import { PropType } from 'vue';
|
|
3
2
|
import { IconColor, IconItem } from '../../Icons/Icon';
|
|
4
3
|
import { TextGroupSize, TextGroupState } from '../../TextGroup';
|
|
4
|
+
import { RichListItemBackgroundColor, RichListItemBorderColor, RichListItemElevation, RichListItemLayout, RichListItemSize, RichListItemState, RichListItemType } from '../RichListItem';
|
|
5
5
|
|
|
6
6
|
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
7
7
|
type: {
|
|
@@ -117,6 +117,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
117
117
|
type: BooleanConstructor;
|
|
118
118
|
default: boolean;
|
|
119
119
|
};
|
|
120
|
+
isTextGroupSelected: {
|
|
121
|
+
type: BooleanConstructor;
|
|
122
|
+
default: boolean;
|
|
123
|
+
};
|
|
120
124
|
}>, {}, {
|
|
121
125
|
hovered: boolean;
|
|
122
126
|
RICH_LIST_ITEM_SIZE: Readonly<{
|
|
@@ -247,6 +251,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
247
251
|
type: BooleanConstructor;
|
|
248
252
|
default: boolean;
|
|
249
253
|
};
|
|
254
|
+
isTextGroupSelected: {
|
|
255
|
+
type: BooleanConstructor;
|
|
256
|
+
default: boolean;
|
|
257
|
+
};
|
|
250
258
|
}>> & Readonly<{
|
|
251
259
|
"onUpdate:is-selected"?: ((value: boolean) => any) | undefined;
|
|
252
260
|
}>, {
|
|
@@ -264,6 +272,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
264
272
|
eyebrow: string;
|
|
265
273
|
supportingText: string;
|
|
266
274
|
isSelected: boolean;
|
|
275
|
+
supportingTextEllipsis: boolean;
|
|
276
|
+
isSupportingTextTooltipEnabled: boolean;
|
|
267
277
|
isDimmed: boolean;
|
|
268
278
|
isDraggable: boolean;
|
|
269
279
|
iconColor: string;
|
|
@@ -272,9 +282,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
272
282
|
hasDraggableHandler: boolean;
|
|
273
283
|
hasActionsSlotDivider: boolean;
|
|
274
284
|
isSelectable: boolean;
|
|
275
|
-
supportingTextEllipsis: boolean;
|
|
276
|
-
isSupportingTextTooltipEnabled: boolean;
|
|
277
285
|
isEyebrowUppercase: boolean;
|
|
286
|
+
isTextGroupSelected: boolean;
|
|
278
287
|
}, {}, {
|
|
279
288
|
DsTextGroup: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
280
289
|
size: {
|
|
@@ -569,10 +578,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
569
578
|
};
|
|
570
579
|
}>> & Readonly<{}>, {
|
|
571
580
|
text: string;
|
|
572
|
-
inline: boolean;
|
|
573
581
|
placement: import('../../Tooltip').TooltipPlacement;
|
|
574
582
|
isDisabled: boolean;
|
|
575
583
|
isPointerVisible: boolean;
|
|
584
|
+
inline: boolean;
|
|
576
585
|
isHiddenOnMobile: boolean;
|
|
577
586
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
578
587
|
}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
@@ -294,10 +294,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
294
294
|
};
|
|
295
295
|
}>> & Readonly<{}>, {
|
|
296
296
|
text: string;
|
|
297
|
-
inline: boolean;
|
|
298
297
|
placement: import('../Tooltip').TooltipPlacement;
|
|
299
298
|
isDisabled: boolean;
|
|
300
299
|
isPointerVisible: boolean;
|
|
300
|
+
inline: boolean;
|
|
301
301
|
isHiddenOnMobile: boolean;
|
|
302
302
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
303
303
|
}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
@@ -60,8 +60,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
60
60
|
};
|
|
61
61
|
}>> & Readonly<{}>, {
|
|
62
62
|
color: string;
|
|
63
|
-
isSelected: boolean;
|
|
64
63
|
isDisabled: boolean;
|
|
64
|
+
isSelected: boolean;
|
|
65
65
|
counter: string | number;
|
|
66
66
|
}, {}, {
|
|
67
67
|
Icon: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
@@ -80,10 +80,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
80
80
|
};
|
|
81
81
|
}>> & Readonly<{}>, {
|
|
82
82
|
text: string;
|
|
83
|
-
inline: boolean;
|
|
84
83
|
placement: TooltipPlacement;
|
|
85
84
|
isDisabled: boolean;
|
|
86
85
|
isPointerVisible: boolean;
|
|
86
|
+
inline: boolean;
|
|
87
87
|
isHiddenOnMobile: boolean;
|
|
88
88
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
89
89
|
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as V,q as c,c as u,a as D,j as G,u as t,s as k,b as O,g as v,k as I,n as h,o,e as q}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{a as w,T as K}from"./Tooltip-DB8acOEc.js";import{_ as F}from"./_plugin-vue_export-helper-DlAUqK2U.js";const e={XX_SMALL:"xx-small",X_SMALL:"x-small",SMALL:"small",MEDIUM:"medium",LARGE:"large",X_LARGE:"x-large"},T={ACTIVE:"active",INACTIVE:"inactive"},r={ACTIVE:"active",INACTIVE:"inactive",AWAITING:"awaiting",BLOCKED:"blocked",TEAM_MEMBER:"team-member"},H=["src","alt"],W={key:1,class:"ds-avatar__initials"},Y={key:0,class:"ds-avatar__activityStatus"},j={key:1,class:"ds-avatar__accessStatus"},f=V({__name:"Avatar",props:{username:{},avatarUrl:{},size:{default:()=>e.X_SMALL},activityStatus:{},accessStatus:{},teamMemberImageUrl:{},activityStatusTooltip:{}},setup(i){const{initials:y,initialBackgroundColor:_}=R(),{accessStatusColor:g,accessStatusIcon:U,accessStatusSize:p,accessStatusImage:z}=X(),{activityStatusColor:b,activityStatusSize:N}=B();function R(){const a=["#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=c(()=>{if(i.avatarUrl)return;const A=(i.username.charCodeAt(0)-65)%16;return a[A]});return{initials:c(()=>n(i.username)),initialBackgroundColor:S}}function X(){const a=c(()=>{switch(i.accessStatus){case r.ACTIVE:return l.SUCCESS;case r.INACTIVE:case r.AWAITING:return l.NEUTRAL;case r.BLOCKED:return l.DANGER;default:return}}),n=c(()=>{switch(i.accessStatus){case r.ACTIVE:return d.FA_UNLOCK_KEYHOLE;case r.BLOCKED:case r.INACTIVE:return d.FA_LOCK_KEYHOLE;case r.AWAITING:return d.FA_HOURGLASS_START;default:return}}),S=c(()=>{switch(i.size){case e.XX_SMALL:return s.SMALL;case e.X_SMALL:return s.SMALL;case e.SMALL:return s.SMALL;case e.MEDIUM:return s.MEDIUM;case e.LARGE:return s.MEDIUM;case e.X_LARGE:default:return s.X_LARGE}}),L=c(()=>{if(i.accessStatus===r.TEAM_MEMBER)return i.teamMemberImageUrl});return{accessStatusColor:a,accessStatusIcon:n,accessStatusSize:S,accessStatusImage:L}}function B(){const a=c(()=>{switch(i.activityStatus){case T.ACTIVE:return l.SUCCESS;default:case T.INACTIVE:return l.NEUTRAL}}),n=c(()=>{switch(i.size){case e.XX_SMALL:return s.X_SMALL;case e.X_SMALL:return s.SMALL;case e.SMALL:return s.SMALL;case e.MEDIUM:return s.MEDIUM;case e.LARGE:return s.MEDIUM;case e.X_LARGE:default:return s.MEDIUM}});return{activityStatusColor:a,activityStatusSize:n}}return(a,n)=>(o(),u("div",{class:h(["ds-avatar",{"-ds-xx-small":a.size===t(e).XX_SMALL,"-ds-x-small":a.size===t(e).X_SMALL,"-ds-small":a.size===t(e).SMALL,"-ds-medium":a.size===t(e).MEDIUM,"-ds-large":a.size===t(e).LARGE,"-ds-x-large":a.size===t(e).X_LARGE}])},[D("div",{class:"ds-avatar__content",style:k({backgroundColor:t(_)})},[a.avatarUrl?(o(),u("img",{key:0,src:a.avatarUrl,alt:a.username,class:"ds-avatar__image"},null,8,H)):(o(),u("span",W,G(t(y)),1))],4),a.activityStatus?(o(),u("div",Y,[(o(),O(t(K),{key:a.activityStatusTooltip,class:"ds-avatar__activityStatusTooltip",text:a.activityStatusTooltip,"is-disabled":!a.activityStatusTooltip,"is-pointer-visible":"",placement:t(w).BOTTOM,"is-hidden-on-mobile":!1},{default:q(()=>[I(t(C),{color:t(b),elevation:t(M).X_SMALL,size:t(N)},null,8,["color","elevation","size"])]),_:1},8,["text","is-disabled","placement"]))])):v("",!0),a.accessStatus?(o(),u("div",j,[I(t(C),{color:t(g),elevation:t(M).SMALL,icon:t(U),size:t(p),"image-url":t(z)},null,8,["color","elevation","icon","size","image-url"])])):v("",!0)],2))}}),Q=F(f,[["__scopeId","data-v-18be9f69"]]);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"}},{name:"activityStatusTooltip",required:!1,type:{name:"string"}}],sourceFiles:["/home/runner/work/design-system/design-system/lib/js/components/Avatar/Avatar.vue"]};export{Q as A,e as a,r as b,T as c};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import{A as o,a as r,b as k,c as m}from"./Avatar-DUThlKLV.js";import"./vue.esm-bundler-DmkhfO_9.js";import"./Badge-DSmH78WU.js";import"./Icon-BPz80dqH.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./Tooltip-DB8acOEc.js";import"./device-9fgosCm4.js";const S={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)]},activityStatusTooltip:{control:"text"}}},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",activityStatusTooltip:"Active now"}};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,i,l;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
|
+
activityStatusTooltip: 'Active now'
|
|
8
|
+
}
|
|
9
|
+
}`,...(l=(i=e.parameters)==null?void 0:i.docs)==null?void 0:l.source}}};var n,p,c;a.parameters={...a.parameters,docs:{...(n=a.parameters)==null?void 0:n.docs,source:{originalSource:`{
|
|
10
|
+
render: (args: AvatarProps) => ({
|
|
11
|
+
components: {
|
|
12
|
+
Avatar
|
|
13
|
+
},
|
|
14
|
+
setup() {
|
|
15
|
+
return {
|
|
16
|
+
args,
|
|
17
|
+
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']
|
|
18
|
+
};
|
|
19
|
+
},
|
|
20
|
+
template: \`<div style="display: flex; gap: 12px; flex-wrap: wrap;"><div v-for="name in names"><Avatar v-bind="args" :username="name" /></div></div>\`
|
|
21
|
+
}),
|
|
22
|
+
argTypes: {
|
|
23
|
+
size: {
|
|
24
|
+
control: 'select',
|
|
25
|
+
options: Object.values(AVATAR_SIZES)
|
|
26
|
+
},
|
|
27
|
+
username: {
|
|
28
|
+
control: false
|
|
29
|
+
},
|
|
30
|
+
avatarUrl: {
|
|
31
|
+
control: false
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
args: {
|
|
35
|
+
size: AVATAR_SIZES.X_SMALL,
|
|
36
|
+
teamMemberImageUrl: 'https://lek.wiecejnizlek.pl/images/lek/logo-badge.svg'
|
|
37
|
+
}
|
|
38
|
+
}`,...(c=(p=a.parameters)==null?void 0:p.docs)==null?void 0:c.source}}};const y=["Interactive","Colors"];export{a as Colors,e as Interactive,y as __namedExportsOrder,S as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as y,t as v,b,h as T,e as l,n as S,r as u,o as g,f as n,a as E,k as L}from"./vue.esm-bundler-DmkhfO_9.js";import{I as R,c as C}from"./Icon-BPz80dqH.js";import{D as h,T as r,c as i}from"./TextGroup-D5le3QVY.js";import{i as O,R as d,c as s,b as p,a as t,d as _,e as f,f as D}from"./GroupRichListItem-8v8vJXgH.js";import{_ as V}from"./_plugin-vue_export-helper-DlAUqK2U.js";const m=y({name:"BasicRichListItem",components:{DsTextGroup:h,RichListItem:O},props:{type:{type:String,default:d.DEFAULT,validator(e){return Object.values(d).includes(e)}},state:{type:String,default:s.DEFAULT,validator(e){return Object.values(s).includes(e)}},layout:{type:String,default:p.HORIZONTAL,validator(e){return Object.values(p).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(R).includes(v(e))}},iconColor:{type:String,default:null,validator(e){return Object.values(C).includes(e)}},iconColorHex:{type:String,default:null},borderColor:{type:String,default:null,validator(e){return Object.values(_).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:f.NEUTRAL,validator(e){return Object.values(f).includes(e)}},elevation:{type:String,default:null,validator(e){return Object.values(D).includes(e)}},hasDraggableHandler:{type:Boolean,default:!0},hasActionsSlotDivider:{type:Boolean,default:!0},isSelectable:{type:Boolean,default:!0},isSelected:{type:Boolean,default:!1},isTextGroupSelected:{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(s)}},computed:{textGroupSize(){return{[t.SMALL]:r.SMALL,[t.MEDIUM]:r.MEDIUM}[this.size]},textGroupState(){return this.state===s.LOADING?i.LOADING:this.hovered&&this.isInteractive?i.HOVERED:i.DEFAULT}}}),M={class:"ds-basicRichListItem__content"};function A(e,a,H,B,U,w){const c=u("ds-text-group"),I=u("rich-list-item");return g(),b(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:S(["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))},T({content:l(()=>[E("div",M,[L(c,{"eyebrow-text":e.eyebrow,"eyebrow-text-ellipsis":e.eyebrowEllipsis,"is-eyebrow-text-uppercase":e.isEyebrowUppercase,"is-selected":e.isTextGroupSelected,"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:l(()=>[n(e.$slots,"media",{},void 0,!0)]),key:"0"}:void 0,e.$slots.metadata?{name:"metadata",fn:l(()=>[n(e.$slots,"metadata",{},void 0,!0)]),key:"1"}:void 0,e.$slots.actions?{name:"actions",fn:l(()=>[n(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 k=V(m,[["render",A],["__scopeId","data-v-c8b54c95"]]);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"}},{name:"isTextGroupSelected",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{k as B};
|
package/docs/assets/{BasicRichListItem.stories-W11x1b5C.js → BasicRichListItem.stories-ePDSld8d.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{B as l}from"./BasicRichListItem-
|
|
1
|
+
import{B as l}from"./BasicRichListItem-CEiYZukO.js";import{w as h}from"./decorator-CSnIf-k5.js";import"./Avatar-DUThlKLV.js";import"./Badge-DSmH78WU.js";import"./BadgeScore-GfZixoUY.js";import"./Banner-DDGfdClH.js";import"./Button-yeAor0pZ.js";import"./ToggleButton-eR3n1vbs.js";import"./Card-BzXb8FVb.js";import"./CardExpandable-t59MJJJ1.js";import"./DatePicker-Bc1APlab.js";import"./DateRangePicker-CNuyzpfG.js";import"./Divider-CeZli6az.js";import"./FeatureIcon-Zls5aPDA.js";import{c as T,I as a}from"./Icon-BPz80dqH.js";import"./IconButton-gTykCZIi.js";import"./string-CFc0pFCE.js";import"./Modal-D7RDnkRT.js";import"./ModalDialog-D-FrIv9r.js";import"./NumberInCircle-CYZFaZ00.js";import"./TabItem-Cceq5FQB.js";import"./Tile-DvjxsEPO.js";import"./Toast-DKAzASvr.js";import"./AccessStatus-BKJi9u47.js";import"./BlockadeStatus-D6w6lZhK.js";import"./SurveyToggle-BECsKZHH.js";import"./SurveyQuestionScale-I7rmD2z-.js";import"./SurveyQuestionOpenEnded-DUybHAVt.js";import"./SectionHeader-CwB5neO2.js";import"./PageHeader-C5oCP3S2.js";import"./SectionTitle-BQZh7aFs.js";import"./Drawer-BAhS1Aex.js";import"./DrawerContent-BC_l9IKr.js";import"./DrawerDivider-DuTuIbLz.js";import"./DrawerHeader-CivXan1m.js";import"./DrawerListItem-BCPF0NKt.js";import"./DrawerListItemGroup-BTfrsZ_p.js";import"./DrawerTile-CTrRTsz5.js";import"./DrawerSection-B6PrbMVD.js";import"./OutlineItem-DqMRN7G1.js";import"./OutlineDivider-DItdz99b.js";import"./OutlineSectionHeader-CtypBCqR.js";import"./Chip-DmzVP4Nc.js";import"./CounterToggle-UTpNPOSH.js";import"./SelectList-T6eJOYPv.js";import"./SelectListItem-DPuR0fG2.js";import"./SelectListItemDivider-CTuILyj9.js";import"./SelectListItemToggle-Bd5zU5Vc.js";import"./SelectListItemTile-CWD-7N0p.js";import"./SelectListSectionTitle-BOCjrVHo.js";import"./SelectionTile-D9A_Tf3q.js";import"./LoadingBar-C1yAImWt.js";import"./PopOver-DlmHqZVO.js";import"./Dropdown-B75bqkCY.js";import"./ProgressBar-DcRQqf-M.js";import"./ProgressDonutChart-O1ep3At7.js";import"./IconText-7zvo_ew8.js";import"./Pagination-xRPA6q3h.js";import"./OverlayHeader-D3BWUMCs.js";import"./Well-Chn1RK_x.js";import"./ThreeColumnLayout-CFf8NRwP.js";import{R as p,a as c,b as n,c as d,d as C,e as m,f as E}from"./GroupRichListItem-8v8vJXgH.js";import"./Switch-C8il24TP.js";import"./TextGroup-D5le3QVY.js";import"./Tooltip-DB8acOEc.js";import{I as O}from"./Image-B9jnhF_n.js";import"./Skeleton-DMxKKJ0Z.js";import"./vue.esm-bundler-DmkhfO_9.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./v4-BZawosSj.js";import"./iframe-BmaPoam5.js";import"../sb-preview/runtime.js";import"./device-9fgosCm4.js";import"./user-_JB5aHqq.js";import"./SelectionControl-Xe-aYMrS.js";import"./vue-popper-DQfdblyw.js";import"./_commonjsHelpers-Chg3vePA.js";import"./Checkbox-K_NwPnQU.js";const{useArgs:y}=__STORYBOOK_MODULE_PREVIEW_API__,Xe={title:"Components/RichList/BasicRichListItem",component:l,decorators:[e=>({components:{story:e},template:"<div style='display: flex;padding: 16px;'><story /></div>"}),h]},v=(e,i={})=>(e.argTypes={type:{options:Object.values(p),control:"select"},size:{options:Object.values(c),control:"select"},layout:{options:Object.values(n),control:{type:"select"}},state:{options:Object.values(d),control:"select"},iconColor:{options:[null,...Object.values(T)],control:"select"},borderColor:{options:[null,...Object.values(C)],control:"select"},icon:{options:[null,...Object.keys(a)],control:"select"},iconColorHex:{control:"text"},borderColorHex:{control:"text"},eyebrow:{control:"text"},eyebrowEllipsis:{control:"boolean"},isEyebrowUppercase:{control:"boolean"},text:{control:"text"},textEllipsis:{control:"boolean"},supportingText:{control:"text"},supportingTextEllipsis:{control:"boolean"},isSupportingTextTooltipEnabled:{control:"boolean"},metadata:{control:"text"},actions:{control:"text"},draggableIconClassName:{control:"text"},backgroundColor:{options:[null,...Object.values(m)],control:"select"},elevation:{options:[null,...Object.values(E)],control:"select"}},e.args={size:c.MEDIUM,type:p.DEFAULT,layout:n.HORIZONTAL,backgroundColor:m.NEUTRAL,elevation:null,isDimmed:!1,isDraggable:!0,hasDraggableHandler:!0,icon:null,iconColor:null,iconColorHex:"",hasActionsSlotDivider:!0,isSelectable:!0,isSelected:!0,isTextGroupSelected:!1,borderColor:null,borderColorHex:"",state:d.DEFAULT,isInteractive:!0,draggableIconClassName:"draggableIconClassName-1",eyebrow:"Eyebrow Uppercase",eyebrowEllipsis:!1,isEyebrowUppercase:!1,text:"Długa nazwa gdy się nie mieści Praesentium dicta sit. Molestiae unde voluptatem eaque labore.",textEllipsis:!1,supportingText:"null",supportingTextEllipsis:!1,isSupportingTextTooltipEnabled:!1,metadata:"Metadata Slot",actions:"ACS",...i},e.parameters={actions:{handles:["icon-click","click","update:is-selected"]},layout:"fullscreen",design:{type:"figma",url:"https://www.figma.com/file/izQdYyiBR1GQgFkaOIfIJI/LMS---DS-Components?type=design&node-id=8673-2345&mode=design&t=QeEz8TmzxDbrGYK3-4"}},e),w=e=>{const[i,r]=y();return{components:{BasicRichListItem:l},setup(){return e},data(){return{ICONS:Object.freeze(a)}},methods:{updateIsSelected(s){r({isSelected:s})}},template:`
|
|
2
2
|
<basic-rich-list-item
|
|
3
3
|
:size="size"
|
|
4
4
|
:type="type"
|
|
@@ -26,6 +26,7 @@ import{B as l}from"./BasicRichListItem-CjGmKgW-.js";import{R as p,a as n,b as c,
|
|
|
26
26
|
:has-actions-slot-divider="hasActionsSlotDivider"
|
|
27
27
|
:is-selectable="isSelectable"
|
|
28
28
|
:is-selected="isSelected"
|
|
29
|
+
:is-text-group-selected="isTextGroupSelected"
|
|
29
30
|
@update:is-selected="updateIsSelected"
|
|
30
31
|
>
|
|
31
32
|
<template v-if="metadata" #metadata>
|
|
@@ -34,7 +35,7 @@ import{B as l}from"./BasicRichListItem-CjGmKgW-.js";import{R as p,a as n,b as c,
|
|
|
34
35
|
<template v-if="actions" #actions>
|
|
35
36
|
<div v-html="actions" />
|
|
36
37
|
</template>
|
|
37
|
-
</basic-rich-list-item>`}},t=w.bind({});v(t);const _=e=>{const[i,r]=y();return{components:{BasicRichListItem:l,DsImage:
|
|
38
|
+
</basic-rich-list-item>`}},t=w.bind({});v(t);const _=e=>{const[i,r]=y();return{components:{BasicRichListItem:l,DsImage:O},setup(){return e},data(){return{ICONS:Object.freeze(a)}},methods:{updateIsSelected(s){r({isSelected:s})}},template:`
|
|
38
39
|
<basic-rich-list-item
|
|
39
40
|
:size="size"
|
|
40
41
|
:type="type"
|
|
@@ -62,6 +63,7 @@ import{B as l}from"./BasicRichListItem-CjGmKgW-.js";import{R as p,a as n,b as c,
|
|
|
62
63
|
:has-actions-slot-divider="hasActionsSlotDivider"
|
|
63
64
|
:is-selectable="isSelectable"
|
|
64
65
|
:is-selected="isSelected"
|
|
66
|
+
:is-text-group-selected="isTextGroupSelected"
|
|
65
67
|
@update:is-selected="updateIsSelected"
|
|
66
68
|
>
|
|
67
69
|
<template #media>
|
|
@@ -122,6 +124,7 @@ import{B as l}from"./BasicRichListItem-CjGmKgW-.js";import{R as p,a as n,b as c,
|
|
|
122
124
|
:has-actions-slot-divider="hasActionsSlotDivider"
|
|
123
125
|
:is-selectable="isSelectable"
|
|
124
126
|
:is-selected="isSelected"
|
|
127
|
+
:is-text-group-selected="isTextGroupSelected"
|
|
125
128
|
@update:is-selected="updateIsSelected"
|
|
126
129
|
>
|
|
127
130
|
<template v-if="metadata" #metadata>
|
|
@@ -132,7 +135,7 @@ import{B as l}from"./BasicRichListItem-CjGmKgW-.js";import{R as p,a as n,b as c,
|
|
|
132
135
|
</template>
|
|
133
136
|
</basic-rich-list-item>\`
|
|
134
137
|
};
|
|
135
|
-
}`,...(g=(b=t.parameters)==null?void 0:b.docs)==null?void 0:g.source}}};var x,I
|
|
138
|
+
}`,...(g=(b=t.parameters)==null?void 0:b.docs)==null?void 0:g.source}}};var x,S,I;o.parameters={...o.parameters,docs:{...(x=o.parameters)==null?void 0:x.docs,source:{originalSource:`args => {
|
|
136
139
|
const [_, updateArgs] = useArgs();
|
|
137
140
|
return {
|
|
138
141
|
components: {
|
|
@@ -182,6 +185,7 @@ import{B as l}from"./BasicRichListItem-CjGmKgW-.js";import{R as p,a as n,b as c,
|
|
|
182
185
|
:has-actions-slot-divider="hasActionsSlotDivider"
|
|
183
186
|
:is-selectable="isSelectable"
|
|
184
187
|
:is-selected="isSelected"
|
|
188
|
+
:is-text-group-selected="isTextGroupSelected"
|
|
185
189
|
@update:is-selected="updateIsSelected"
|
|
186
190
|
>
|
|
187
191
|
<template #media>
|
|
@@ -195,4 +199,4 @@ import{B as l}from"./BasicRichListItem-CjGmKgW-.js";import{R as p,a as n,b as c,
|
|
|
195
199
|
</template>
|
|
196
200
|
</basic-rich-list-item>\`
|
|
197
201
|
};
|
|
198
|
-
}`,...(
|
|
202
|
+
}`,...(I=(S=o.parameters)==null?void 0:S.docs)==null?void 0:I.source}}};const $e=["Interactive","WithMedia"];export{t as Interactive,o as WithMedia,$e as __namedExportsOrder,Xe as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as m,t as p,c as o,f as A,g as t,j as C,b as E,n as N,s as O,r as S,o as l,k as T}from"./vue.esm-bundler-DmkhfO_9.js";import{i as a,e as L,h as _,I as R}from"./Button-yeAor0pZ.js";import{I as b}from"./IconButton-gTykCZIi.js";import{a as v,I,b as U}from"./Icon-BPz80dqH.js";import{_ as y}from"./_plugin-vue_export-helper-DlAUqK2U.js";const n={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"},r={DEFAULT:"default",DISABLED:"disabled"},i={CAPSULE:"capsule",ROUNDED:"rounded"},P={[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},c=m({name:"Chip",components:{Icon:v,IconButton:b},props:{label:{type:String,default:null},isLabelUppercase:{type:Boolean,default:!1},leftIcon:{type:Object,default:null,validator(e){return Object.values(I).includes(p(e))}},radius:{type:String,default:i.CAPSULE,validator(e){return Object.values(i).includes(e)}},size:{type:String,default:n.SMALL,validator(e){return Object.values(n).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:r.DEFAULT,validator(e){return Object.values(r).includes(e)}},isRemovable:{type:Boolean,default:!1}},emits:["remove"],data(){return{ICONS:Object.freeze(I),BUTTON_ELEVATIONS:Object.freeze(L),ICON_BUTTON_STATES:Object.freeze(_),ICON_BUTTON_SIZES:Object.freeze(R),ICON_SIZES:Object.freeze(U),CHIP_SIZES:Object.freeze(n),CHIP_STATES:Object.freeze(r),CHIP_RADIUSES:Object.freeze(i)}},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:P[this.color]||a.PRIMARY}}}),H=["title"],D={key:0,class:"ds-chip__leftIcon"},B={key:1,class:"ds-chip__label"};function g(e,u,M,h,z,j){const d=S("icon"),f=S("icon-button");return l(),o("div",{class:N(["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,"-ds-removable":e.size!==e.CHIP_SIZES.X_SMALL&&e.isRemovable}]),title:e.label,style:O({backgroundColor:e.colorHex})},[e.$slots.accessory||e.leftIcon?(l(),o("span",D,[A(e.$slots,"accessory",{},()=>[T(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)])):t("",!0),e.label?(l(),o("span",B,C(e.label),1)):t("",!0),e.size!==e.CHIP_SIZES.X_SMALL&&e.isRemovable?(l(),E(f,{key:2,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:u[0]||(u[0]=V=>e.$emit("remove"))},null,8,["state","color","size","icon","elevation"])):t("",!0)],14,H)}const G=y(c,[["render",g],["__scopeId","data-v-e695770e"]]);c.__docgenInfo={displayName:"Chip",exportName:"default",description:"",tags:{},props:[{name:"label",type:{name:"string"},defaultValue:{func:!1,value:"null"}},{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{G as C,i as a,n as b,s as c,r as d};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{C as o,a as b,b as a,c as g,d as h}from"./Chip-
|
|
1
|
+
import{C as o,a as b,b as a,c as g,d as h}from"./Chip-DmzVP4Nc.js";import{I as r}from"./Icon-BPz80dqH.js";import{o as C,c as v,a as c}from"./vue.esm-bundler-DmkhfO_9.js";import"./Button-yeAor0pZ.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./IconButton-gTykCZIi.js";import"./device-9fgosCm4.js";const O={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 23 23"};function x(s,l){return C(),v("svg",O,l[0]||(l[0]=[c("path",{"fill-rule":"evenodd",d:"M13.47 3.952 3.951 13.47a3.702 3.702 0 0 0 5.235 5.234l9.517-9.517a3.701 3.701 0 1 0-5.235-5.235zM2.207 20.449a6.17 6.17 0 0 0 8.724 0l9.518-9.518a6.17 6.17 0 1 0-8.724-8.724l-9.518 9.518a6.17 6.17 0 0 0 0 8.724","clip-rule":"evenodd"},null,-1),c("path",{d:"M2.207 20.45a6.17 6.17 0 0 0 8.724 0l5.405-5.406L7.612 6.32l-5.405 5.405a6.17 6.17 0 0 0 0 8.724z"},null,-1)]))}const I={render:x},j={title:"Components/Chip",component:o},y=s=>({components:{Chip:o,LogoBadge:I},setup(){return s},template:'<chip :label="label" :is-label-uppercase="isLabelUppercase" :left-icon="ICONS[leftIcon]" :is-removable="isRemovable" :size="size" :color="color" :color-hex="colorHex" :state="state" :radius="radius" />',data(){return{ICONS:Object.freeze(r)}}}),z=s=>({components:{Chip:o,LogoBadge:I},setup(){return s},template:'<chip :label="label" :is-label-uppercase="isLabelUppercase" :left-icon="ICONS[leftIcon]" :is-removable="isRemovable" :size="size" :color="color" :color-hex="colorHex" :state="state" :radius="radius"><template #accessory><logo-badge :style="svgStyle" /></template></chip>',data(){return{ICONS:Object.freeze(r)}},computed:{svgStyle(){return this.size===a.SMALL?{width:"12px",height:"12px"}:{width:"8px",height:"8px"}}}}),e=y.bind({}),t=z.bind({}),S={label:"Chip z labelem",isLabelUppercase:!1,leftIcon:null,radius:b.CAPSULE,size:a.SMALL,color:g.NEUTRAL,colorHex:"",isRemovable:!1,state:h.DEFAULT},f={leftIcon:{control:"select",options:[null,...Object.keys(r)]},size:{control:"select",options:Object.values(a)},color:{control:"select",options:Object.values(g)},state:{control:"select",options:Object.values(h)},radius:{control:"select",options:Object.values(b)}};e.argTypes=f;e.args=S;e.parameters={design:{type:"figma",url:"https://www.figma.com/file/izQdYyiBR1GQgFkaOIfIJI/LMS---DS---Components?node-id=3690%3A69072"}};t.argTypes=f;t.args=S;t.parameters={design:{type:"figma",url:"https://www.figma.com/file/izQdYyiBR1GQgFkaOIfIJI/LMS---DS---Components?node-id=3690%3A69072"}};var i,p,n;e.parameters={...e.parameters,docs:{...(i=e.parameters)==null?void 0:i.docs,source:{originalSource:`args => ({
|
|
2
2
|
components: {
|
|
3
3
|
Chip,
|
|
4
4
|
LogoBadge
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{af as Me,ag as ie,ah as Ce,ae as h,ai as b,aj as $,a2 as ue,a0 as $e,x as Ie,ak as Oe,al as Ne}from"./DocsRenderer-CFRXHY34-CTj1geou.js";import{a as fe}from"./_commonjsHelpers-Chg3vePA.js";import"./iframe-C7WPYr8K.js";import"../sb-preview/runtime.js";import"./index-vG0co4wr.js";var Se={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};const F=Se,he={};for(const e of Object.keys(F))he[F[e]]=e;const u={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};var de=u;for(const e of Object.keys(u)){if(!("channels"in u[e]))throw new Error("missing channels property: "+e);if(!("labels"in u[e]))throw new Error("missing channel labels property: "+e);if(u[e].labels.length!==u[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:n}=u[e];delete u[e].channels,delete u[e].labels,Object.defineProperty(u[e],"channels",{value:t}),Object.defineProperty(u[e],"labels",{value:n})}u.rgb.hsl=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,a=Math.min(t,n,r),o=Math.max(t,n,r),s=o-a;let l,c;o===a?l=0:t===o?l=(n-r)/s:n===o?l=2+(r-t)/s:r===o&&(l=4+(t-n)/s),l=Math.min(l*60,360),l<0&&(l+=360);const i=(a+o)/2;return o===a?c=0:i<=.5?c=s/(o+a):c=s/(2-o-a),[l,c*100,i*100]};u.rgb.hsv=function(e){let t,n,r,a,o;const s=e[0]/255,l=e[1]/255,c=e[2]/255,i=Math.max(s,l,c),d=i-Math.min(s,l,c),f=function(g){return(i-g)/6/d+1/2};return d===0?(a=0,o=0):(o=d/i,t=f(s),n=f(l),r=f(c),s===i?a=r-n:l===i?a=1/3+t-r:c===i&&(a=2/3+n-t),a<0?a+=1:a>1&&(a-=1)),[a*360,o*100,i*100]};u.rgb.hwb=function(e){const t=e[0],n=e[1];let r=e[2];const a=u.rgb.hsl(e)[0],o=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[a,o*100,r*100]};u.rgb.cmyk=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,a=Math.min(1-t,1-n,1-r),o=(1-t-a)/(1-a)||0,s=(1-n-a)/(1-a)||0,l=(1-r-a)/(1-a)||0;return[o*100,s*100,l*100,a*100]};function Re(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}u.rgb.keyword=function(e){const t=he[e];if(t)return t;let n=1/0,r;for(const a of Object.keys(F)){const o=F[a],s=Re(e,o);s<n&&(n=s,r=a)}return r};u.keyword.rgb=function(e){return F[e]};u.rgb.xyz=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;const a=t*.4124+n*.3576+r*.1805,o=t*.2126+n*.7152+r*.0722,s=t*.0193+n*.1192+r*.9505;return[a*100,o*100,s*100]};u.rgb.lab=function(e){const t=u.rgb.xyz(e);let n=t[0],r=t[1],a=t[2];n/=95.047,r/=100,a/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,a=a>.008856?a**(1/3):7.787*a+16/116;const o=116*r-16,s=500*(n-r),l=200*(r-a);return[o,s,l]};u.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;let a,o,s;if(n===0)return s=r*255,[s,s,s];r<.5?a=r*(1+n):a=r+n-r*n;const l=2*r-a,c=[0,0,0];for(let i=0;i<3;i++)o=t+1/3*-(i-1),o<0&&o++,o>1&&o--,6*o<1?s=l+(a-l)*6*o:2*o<1?s=a:3*o<2?s=l+(a-l)*(2/3-o)*6:s=l,c[i]=s*255;return c};u.hsl.hsv=function(e){const t=e[0];let n=e[1]/100,r=e[2]/100,a=n;const o=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,a*=o<=1?o:2-o;const s=(r+n)/2,l=r===0?2*a/(o+a):2*n/(r+n);return[t,l*100,s*100]};u.hsv.rgb=function(e){const t=e[0]/60,n=e[1]/100;let r=e[2]/100;const a=Math.floor(t)%6,o=t-Math.floor(t),s=255*r*(1-n),l=255*r*(1-n*o),c=255*r*(1-n*(1-o));switch(r*=255,a){case 0:return[r,c,s];case 1:return[l,r,s];case 2:return[s,r,c];case 3:return[s,l,r];case 4:return[c,s,r];case 5:return[r,s,l]}};u.hsv.hsl=function(e){const t=e[0],n=e[1]/100,r=e[2]/100,a=Math.max(r,.01);let o,s;s=(2-n)*r;const l=(2-n)*a;return o=n*a,o/=l<=1?l:2-l,o=o||0,s/=2,[t,o*100,s*100]};u.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100,r=e[2]/100;const a=n+r;let o;a>1&&(n/=a,r/=a);const s=Math.floor(6*t),l=1-r;o=6*t-s,s&1&&(o=1-o);const c=n+o*(l-n);let i,d,f;switch(s){default:case 6:case 0:i=l,d=c,f=n;break;case 1:i=c,d=l,f=n;break;case 2:i=n,d=l,f=c;break;case 3:i=n,d=c,f=l;break;case 4:i=c,d=n,f=l;break;case 5:i=l,d=n,f=c;break}return[i*255,d*255,f*255]};u.cmyk.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,a=e[3]/100,o=1-Math.min(1,t*(1-a)+a),s=1-Math.min(1,n*(1-a)+a),l=1-Math.min(1,r*(1-a)+a);return[o*255,s*255,l*255]};u.xyz.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100;let a,o,s;return a=t*3.2406+n*-1.5372+r*-.4986,o=t*-.9689+n*1.8758+r*.0415,s=t*.0557+n*-.204+r*1.057,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),s=Math.min(Math.max(0,s),1),[a*255,o*255,s*255]};u.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;const a=116*n-16,o=500*(t-n),s=200*(n-r);return[a,o,s]};u.lab.xyz=function(e){const t=e[0],n=e[1],r=e[2];let a,o,s;o=(t+16)/116,a=n/500+o,s=o-r/200;const l=o**3,c=a**3,i=s**3;return o=l>.008856?l:(o-16/116)/7.787,a=c>.008856?c:(a-16/116)/7.787,s=i>.008856?i:(s-16/116)/7.787,a*=95.047,o*=100,s*=108.883,[a,o,s]};u.lab.lch=function(e){const t=e[0],n=e[1],r=e[2];let a;a=Math.atan2(r,n)*360/2/Math.PI,a<0&&(a+=360);const s=Math.sqrt(n*n+r*r);return[t,s,a]};u.lch.lab=function(e){const t=e[0],n=e[1],a=e[2]/360*2*Math.PI,o=n*Math.cos(a),s=n*Math.sin(a);return[t,o,s]};u.rgb.ansi16=function(e,t=null){const[n,r,a]=e;let o=t===null?u.rgb.hsv(e)[2]:t;if(o=Math.round(o/50),o===0)return 30;let s=30+(Math.round(a/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return o===2&&(s+=60),s};u.hsv.ansi16=function(e){return u.rgb.ansi16(u.hsv.rgb(e),e[2])};u.rgb.ansi256=function(e){const t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)};u.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const n=(~~(e>50)+1)*.5,r=(t&1)*n*255,a=(t>>1&1)*n*255,o=(t>>2&1)*n*255;return[r,a,o]};u.ansi256.rgb=function(e){if(e>=232){const o=(e-232)*10+8;return[o,o,o]}e-=16;let t;const n=Math.floor(e/36)/5*255,r=Math.floor((t=e%36)/6)/5*255,a=t%6/5*255;return[n,r,a]};u.rgb.hex=function(e){const n=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".substring(n.length)+n};u.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];t[0].length===3&&(n=n.split("").map(l=>l+l).join(""));const r=parseInt(n,16),a=r>>16&255,o=r>>8&255,s=r&255;return[a,o,s]};u.rgb.hcg=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,a=Math.max(Math.max(t,n),r),o=Math.min(Math.min(t,n),r),s=a-o;let l,c;return s<1?l=o/(1-s):l=0,s<=0?c=0:a===t?c=(n-r)/s%6:a===n?c=2+(r-t)/s:c=4+(t-n)/s,c/=6,c%=1,[c*360,s*100,l*100]};u.hsl.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n);let a=0;return r<1&&(a=(n-.5*r)/(1-r)),[e[0],r*100,a*100]};u.hsv.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=t*n;let a=0;return r<1&&(a=(n-r)/(1-r)),[e[0],r*100,a*100]};u.hcg.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;if(n===0)return[r*255,r*255,r*255];const a=[0,0,0],o=t%1*6,s=o%1,l=1-s;let c=0;switch(Math.floor(o)){case 0:a[0]=1,a[1]=s,a[2]=0;break;case 1:a[0]=l,a[1]=1,a[2]=0;break;case 2:a[0]=0,a[1]=1,a[2]=s;break;case 3:a[0]=0,a[1]=l,a[2]=1;break;case 4:a[0]=s,a[1]=0,a[2]=1;break;default:a[0]=1,a[1]=0,a[2]=l}return c=(1-n)*r,[(n*a[0]+c)*255,(n*a[1]+c)*255,(n*a[2]+c)*255]};u.hcg.hsv=function(e){const t=e[1]/100,n=e[2]/100,r=t+n*(1-t);let a=0;return r>0&&(a=t/r),[e[0],a*100,r*100]};u.hcg.hsl=function(e){const t=e[1]/100,r=e[2]/100*(1-t)+.5*t;let a=0;return r>0&&r<.5?a=t/(2*r):r>=.5&&r<1&&(a=t/(2*(1-r))),[e[0],a*100,r*100]};u.hcg.hwb=function(e){const t=e[1]/100,n=e[2]/100,r=t+n*(1-t);return[e[0],(r-t)*100,(1-r)*100]};u.hwb.hcg=function(e){const t=e[1]/100,r=1-e[2]/100,a=r-t;let o=0;return a<1&&(o=(r-a)/(1-a)),[e[0],a*100,o*100]};u.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};u.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};u.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};u.gray.hsl=function(e){return[0,0,e[0]]};u.gray.hsv=u.gray.hsl;u.gray.hwb=function(e){return[0,100,e[0]]};u.gray.cmyk=function(e){return[0,0,0,e[0]]};u.gray.lab=function(e){return[e[0],0,0]};u.gray.hex=function(e){const t=Math.round(e[0]/100*255)&255,r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r};u.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};const X=de;function je(){const e={},t=Object.keys(X);for(let n=t.length,r=0;r<n;r++)e[t[r]]={distance:-1,parent:null};return e}function ze(e){const t=je(),n=[e];for(t[e].distance=0;n.length;){const r=n.pop(),a=Object.keys(X[r]);for(let o=a.length,s=0;s<o;s++){const l=a[s],c=t[l];c.distance===-1&&(c.distance=t[r].distance+1,c.parent=r,n.unshift(l))}}return t}function He(e,t){return function(n){return t(e(n))}}function Fe(e,t){const n=[t[e].parent,e];let r=X[t[e].parent][e],a=t[e].parent;for(;t[a].parent;)n.unshift(t[a].parent),r=He(X[t[a].parent][a],r),a=t[a].parent;return r.conversion=n,r}var Te=function(e){const t=ze(e),n={},r=Object.keys(t);for(let a=r.length,o=0;o<a;o++){const s=r[o];t[s].parent!==null&&(n[s]=Fe(s,t))}return n};const K=de,Pe=Te,N={},Le=Object.keys(K);function qe(e){const t=function(...n){const r=n[0];return r==null?r:(r.length>1&&(n=r),e(n))};return"conversion"in e&&(t.conversion=e.conversion),t}function Be(e){const t=function(...n){const r=n[0];if(r==null)return r;r.length>1&&(n=r);const a=e(n);if(typeof a=="object")for(let o=a.length,s=0;s<o;s++)a[s]=Math.round(a[s]);return a};return"conversion"in e&&(t.conversion=e.conversion),t}Le.forEach(e=>{N[e]={},Object.defineProperty(N[e],"channels",{value:K[e].channels}),Object.defineProperty(N[e],"labels",{value:K[e].labels});const t=Pe(e);Object.keys(t).forEach(r=>{const a=t[r];N[e][r]=Be(a),N[e][r].raw=qe(a)})});var Xe=N;const _=fe(Xe);var De=Me,We=function(){return De.Date.now()},Ke=We,Ve=/\s/;function Ae(e){for(var t=e.length;t--&&Ve.test(e.charAt(t)););return t}var Ge=Ae,Ue=Ge,Ye=/^\s+/;function Je(e){return e&&e.slice(0,Ue(e)+1).replace(Ye,"")}var Qe=Je,Ze=Qe,te=ie,et=Ce,ne=NaN,tt=/^[-+]0x[0-9a-f]+$/i,nt=/^0b[01]+$/i,rt=/^0o[0-7]+$/i,at=parseInt;function ot(e){if(typeof e=="number")return e;if(et(e))return ne;if(te(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=te(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Ze(e);var n=nt.test(e);return n||rt.test(e)?at(e.slice(2),n?2:8):tt.test(e)?ne:+e}var st=ot,lt=ie,W=Ke,re=st,ct="Expected a function",it=Math.max,ut=Math.min;function ft(e,t,n){var r,a,o,s,l,c,i=0,d=!1,f=!1,g=!0;if(typeof e!="function")throw new TypeError(ct);t=re(t)||0,lt(n)&&(d=!!n.leading,f="maxWait"in n,o=f?it(re(n.maxWait)||0,t):o,g="trailing"in n?!!n.trailing:g);function x(v){var C=r,z=a;return r=a=void 0,i=v,s=e.apply(z,C),s}function j(v){return i=v,l=setTimeout(m,t),d?x(v):s}function M(v){var C=v-c,z=v-i,ee=t-C;return f?ut(ee,o-z):ee}function p(v){var C=v-c,z=v-i;return c===void 0||C>=t||C<0||f&&z>=o}function m(){var v=W();if(p(v))return w(v);l=setTimeout(m,M(v))}function w(v){return l=void 0,g&&r?x(v):(r=a=void 0,s)}function E(){l!==void 0&&clearTimeout(l),i=0,r=c=a=l=void 0}function k(){return l===void 0?s:w(W())}function I(){var v=W(),C=p(v);if(r=arguments,a=this,c=v,C){if(l===void 0)return j(c);if(f)return clearTimeout(l),l=setTimeout(m,t),x(c)}return l===void 0&&(l=setTimeout(m,t)),s}return I.cancel=E,I.flush=k,I}var ht=ft;const dt=fe(ht);function O(){return(O=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function J(e,t){if(e==null)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)t.indexOf(n=o[r])>=0||(a[n]=e[n]);return a}function V(e){var t=b.useRef(e),n=b.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var R=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e<t?t:e},H=function(e){return"touches"in e},A=function(e){return e&&e.ownerDocument.defaultView||self},ae=function(e,t,n){var r=e.getBoundingClientRect(),a=H(t)?function(o,s){for(var l=0;l<o.length;l++)if(o[l].identifier===s)return o[l];return o[0]}(t.touches,n):t;return{left:R((a.pageX-(r.left+A(e).pageXOffset))/r.width),top:R((a.pageY-(r.top+A(e).pageYOffset))/r.height)}},oe=function(e){!H(e)&&e.preventDefault()},Q=h.memo(function(e){var t=e.onMove,n=e.onKey,r=J(e,["onMove","onKey"]),a=b.useRef(null),o=V(t),s=V(n),l=b.useRef(null),c=b.useRef(!1),i=b.useMemo(function(){var x=function(p){oe(p),(H(p)?p.touches.length>0:p.buttons>0)&&a.current?o(ae(a.current,p,l.current)):M(!1)},j=function(){return M(!1)};function M(p){var m=c.current,w=A(a.current),E=p?w.addEventListener:w.removeEventListener;E(m?"touchmove":"mousemove",x),E(m?"touchend":"mouseup",j)}return[function(p){var m=p.nativeEvent,w=a.current;if(w&&(oe(m),!function(k,I){return I&&!H(k)}(m,c.current)&&w)){if(H(m)){c.current=!0;var E=m.changedTouches||[];E.length&&(l.current=E[0].identifier)}w.focus(),o(ae(w,m,l.current)),M(!0)}},function(p){var m=p.which||p.keyCode;m<37||m>40||(p.preventDefault(),s({left:m===39?.05:m===37?-.05:0,top:m===40?.05:m===38?-.05:0}))},M]},[s,o]),d=i[0],f=i[1],g=i[2];return b.useEffect(function(){return g},[g]),h.createElement("div",O({},r,{onTouchStart:d,onMouseDown:d,className:"react-colorful__interactive",ref:a,onKeyDown:f,tabIndex:0,role:"slider"}))}),T=function(e){return e.filter(Boolean).join(" ")},Z=function(e){var t=e.color,n=e.left,r=e.top,a=r===void 0?.5:r,o=T(["react-colorful__pointer",e.className]);return h.createElement("div",{className:o,style:{top:100*a+"%",left:100*n+"%"}},h.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},y=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},gt={grad:.9,turn:360,rad:360/(2*Math.PI)},bt=function(e){return me(G(e))},G=function(e){return e[0]==="#"&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?y(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?y(parseInt(e.substring(6,8),16)/255,2):1}},mt=function(e,t){return t===void 0&&(t="deg"),Number(e)*(gt[t]||1)},vt=function(e){var t=/hsla?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?pt({h:mt(t[1],t[2]),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)}):{h:0,s:0,v:0,a:1}},pt=function(e){var t=e.s,n=e.l;return{h:e.h,s:(t*=(n<50?n:100-n)/100)>0?2*t/(n+t)*100:0,v:n+t,a:e.a}},yt=function(e){return wt(be(e))},ge=function(e){var t=e.s,n=e.v,r=e.a,a=(200-t)*n/100;return{h:y(e.h),s:y(a>0&&a<200?t*n/100/(a<=100?a:200-a)*100:0),l:y(a/2),a:y(r,2)}},U=function(e){var t=ge(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},B=function(e){var t=ge(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},be=function(e){var t=e.h,n=e.s,r=e.v,a=e.a;t=t/360*6,n/=100,r/=100;var o=Math.floor(t),s=r*(1-n),l=r*(1-(t-o)*n),c=r*(1-(1-t+o)*n),i=o%6;return{r:y(255*[r,l,s,s,c,r][i]),g:y(255*[c,r,r,l,s,s][i]),b:y(255*[s,s,c,r,r,l][i]),a:y(a,2)}},xt=function(e){var t=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?me({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):{h:0,s:0,v:0,a:1}},P=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},wt=function(e){var t=e.r,n=e.g,r=e.b,a=e.a,o=a<1?P(y(255*a)):"";return"#"+P(t)+P(n)+P(r)+o},me=function(e){var t=e.r,n=e.g,r=e.b,a=e.a,o=Math.max(t,n,r),s=o-Math.min(t,n,r),l=s?o===t?(n-r)/s:o===n?2+(r-t)/s:4+(t-n)/s:0;return{h:y(60*(l<0?l+6:l)),s:y(o?s/o*100:0),v:y(o/255*100),a}},ve=h.memo(function(e){var t=e.hue,n=e.onChange,r=T(["react-colorful__hue",e.className]);return h.createElement("div",{className:r},h.createElement(Q,{onMove:function(a){n({h:360*a.left})},onKey:function(a){n({h:R(t+360*a.left,0,360)})},"aria-label":"Hue","aria-valuenow":y(t),"aria-valuemax":"360","aria-valuemin":"0"},h.createElement(Z,{className:"react-colorful__hue-pointer",left:t/360,color:U({h:t,s:100,v:100,a:1})})))}),pe=h.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:U({h:t.h,s:100,v:100,a:1})};return h.createElement("div",{className:"react-colorful__saturation",style:r},h.createElement(Q,{onMove:function(a){n({s:100*a.left,v:100-100*a.top})},onKey:function(a){n({s:R(t.s+100*a.left,0,100),v:R(t.v-100*a.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+y(t.s)+"%, Brightness "+y(t.v)+"%"},h.createElement(Z,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:U(t)})))}),ye=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},xe=function(e,t){return e.replace(/\s/g,"")===t.replace(/\s/g,"")},kt=function(e,t){return e.toLowerCase()===t.toLowerCase()||ye(G(e),G(t))};function we(e,t,n){var r=V(n),a=b.useState(function(){return e.toHsva(t)}),o=a[0],s=a[1],l=b.useRef({color:t,hsva:o});b.useEffect(function(){if(!e.equal(t,l.current.color)){var i=e.toHsva(t);l.current={hsva:i,color:t},s(i)}},[t,e]),b.useEffect(function(){var i;ye(o,l.current.hsva)||e.equal(i=e.fromHsva(o),l.current.color)||(l.current={hsva:o,color:i},r(i))},[o,e,r]);var c=b.useCallback(function(i){s(function(d){return Object.assign({},d,i)})},[]);return[o,c]}var _t=typeof window!="undefined"?b.useLayoutEffect:b.useEffect,Et=function(){return typeof __webpack_nonce__!="undefined"?__webpack_nonce__:void 0},se=new Map,ke=function(e){_t(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!se.has(t)){var n=t.createElement("style");n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,se.set(t,n);var r=Et();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},Mt=function(e){var t=e.className,n=e.colorModel,r=e.color,a=r===void 0?n.defaultColor:r,o=e.onChange,s=J(e,["className","colorModel","color","onChange"]),l=b.useRef(null);ke(l);var c=we(n,a,o),i=c[0],d=c[1],f=T(["react-colorful",t]);return h.createElement("div",O({},s,{ref:l,className:f}),h.createElement(pe,{hsva:i,onChange:d}),h.createElement(ve,{hue:i.h,onChange:d,className:"react-colorful__last-control"}))},Ct={defaultColor:"000",toHsva:bt,fromHsva:function(e){return yt({h:e.h,s:e.s,v:e.v,a:1})},equal:kt},$t=function(e){return h.createElement(Mt,O({},e,{colorModel:Ct}))},It=function(e){var t=e.className,n=e.hsva,r=e.onChange,a={backgroundImage:"linear-gradient(90deg, "+B(Object.assign({},n,{a:0}))+", "+B(Object.assign({},n,{a:1}))+")"},o=T(["react-colorful__alpha",t]),s=y(100*n.a);return h.createElement("div",{className:o},h.createElement("div",{className:"react-colorful__alpha-gradient",style:a}),h.createElement(Q,{onMove:function(l){r({a:l.left})},onKey:function(l){r({a:R(n.a+l.left)})},"aria-label":"Alpha","aria-valuetext":s+"%","aria-valuenow":s,"aria-valuemin":"0","aria-valuemax":"100"},h.createElement(Z,{className:"react-colorful__alpha-pointer",left:n.a,color:B(n)})))},_e=function(e){var t=e.className,n=e.colorModel,r=e.color,a=r===void 0?n.defaultColor:r,o=e.onChange,s=J(e,["className","colorModel","color","onChange"]),l=b.useRef(null);ke(l);var c=we(n,a,o),i=c[0],d=c[1],f=T(["react-colorful",t]);return h.createElement("div",O({},s,{ref:l,className:f}),h.createElement(pe,{hsva:i,onChange:d}),h.createElement(ve,{hue:i.h,onChange:d}),h.createElement(It,{hsva:i,onChange:d,className:"react-colorful__last-control"}))},Ot={defaultColor:"hsla(0, 0%, 0%, 1)",toHsva:vt,fromHsva:B,equal:xe},Nt=function(e){return h.createElement(_e,O({},e,{colorModel:Ot}))},St={defaultColor:"rgba(0, 0, 0, 1)",toHsva:xt,fromHsva:function(e){var t=be(e);return"rgba("+t.r+", "+t.g+", "+t.b+", "+t.a+")"},equal:xe},Rt=function(e){return h.createElement(_e,O({},e,{colorModel:St}))},jt=$.div({position:"relative",maxWidth:250,'&[aria-readonly="true"]':{opacity:.5}}),zt=$(ue)({position:"absolute",zIndex:1,top:4,left:4,"[aria-readonly=true] &":{cursor:"not-allowed"}}),Ht=$.div({width:200,margin:5,".react-colorful__saturation":{borderRadius:"4px 4px 0 0"},".react-colorful__hue":{boxShadow:"inset 0 0 0 1px rgb(0 0 0 / 5%)"},".react-colorful__last-control":{borderRadius:"0 0 4px 4px"}}),Ft=$($e)(({theme:e})=>({fontFamily:e.typography.fonts.base})),Tt=$.div({display:"grid",gridTemplateColumns:"repeat(9, 16px)",gap:6,padding:3,marginTop:5,width:200}),Pt=$.div(({theme:e,active:t})=>({width:16,height:16,boxShadow:t?`${e.appBorderColor} 0 0 0 1px inset, ${e.textMutedColor}50 0 0 0 4px`:`${e.appBorderColor} 0 0 0 1px inset`,borderRadius:e.appBorderRadius})),Lt=`url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')`,le=({value:e,style:t,...n})=>{let r=`linear-gradient(${e}, ${e}), ${Lt}, linear-gradient(#fff, #fff)`;return h.createElement(Pt,{...n,style:{...t,backgroundImage:r}})},qt=$(Ie.Input)(({theme:e,readOnly:t})=>({width:"100%",paddingLeft:30,paddingRight:30,boxSizing:"border-box",fontFamily:e.typography.fonts.base})),Bt=$(Oe)(({theme:e})=>({position:"absolute",zIndex:1,top:6,right:7,width:20,height:20,padding:4,boxSizing:"border-box",cursor:"pointer",color:e.input.color})),Ee=(e=>(e.RGB="rgb",e.HSL="hsl",e.HEX="hex",e))(Ee||{}),L=Object.values(Ee),Xt=/\(([0-9]+),\s*([0-9]+)%?,\s*([0-9]+)%?,?\s*([0-9.]+)?\)/,Dt=/^\s*rgba?\(([0-9]+),\s*([0-9]+),\s*([0-9]+),?\s*([0-9.]+)?\)\s*$/i,Wt=/^\s*hsla?\(([0-9]+),\s*([0-9]+)%,\s*([0-9]+)%,?\s*([0-9.]+)?\)\s*$/i,Y=/^\s*#?([0-9a-f]{3}|[0-9a-f]{6})\s*$/i,Kt=/^\s*#?([0-9a-f]{3})\s*$/i,Vt={hex:$t,rgb:Rt,hsl:Nt},q={hex:"transparent",rgb:"rgba(0, 0, 0, 0)",hsl:"hsla(0, 0%, 0%, 0)"},ce=e=>{let t=e==null?void 0:e.match(Xt);if(!t)return[0,0,0,1];let[,n,r,a,o=1]=t;return[n,r,a,o].map(Number)},S=e=>{if(!e)return;let t=!0;if(Dt.test(e)){let[s,l,c,i]=ce(e),[d,f,g]=_.rgb.hsl([s,l,c])||[0,0,0];return{valid:t,value:e,keyword:_.rgb.keyword([s,l,c]),colorSpace:"rgb",rgb:e,hsl:`hsla(${d}, ${f}%, ${g}%, ${i})`,hex:`#${_.rgb.hex([s,l,c]).toLowerCase()}`}}if(Wt.test(e)){let[s,l,c,i]=ce(e),[d,f,g]=_.hsl.rgb([s,l,c])||[0,0,0];return{valid:t,value:e,keyword:_.hsl.keyword([s,l,c]),colorSpace:"hsl",rgb:`rgba(${d}, ${f}, ${g}, ${i})`,hsl:e,hex:`#${_.hsl.hex([s,l,c]).toLowerCase()}`}}let n=e.replace("#",""),r=_.keyword.rgb(n)||_.hex.rgb(n),a=_.rgb.hsl(r),o=e;if(/[^#a-f0-9]/i.test(e)?o=n:Y.test(e)&&(o=`#${n}`),o.startsWith("#"))t=Y.test(o);else try{_.keyword.hex(o)}catch{t=!1}return{valid:t,value:o,keyword:_.rgb.keyword(r),colorSpace:"hex",rgb:`rgba(${r[0]}, ${r[1]}, ${r[2]}, 1)`,hsl:`hsla(${a[0]}, ${a[1]}%, ${a[2]}%, 1)`,hex:o}},At=(e,t,n)=>{if(!e||!(t!=null&&t.valid))return q[n];if(n!=="hex")return(t==null?void 0:t[n])||q[n];if(!t.hex.startsWith("#"))try{return`#${_.keyword.hex(t.hex)}`}catch{return q.hex}let r=t.hex.match(Kt);if(!r)return Y.test(t.hex)?t.hex:q.hex;let[a,o,s]=r[1].split("");return`#${a}${a}${o}${o}${s}${s}`},Gt=(e,t)=>{let[n,r]=b.useState(e||""),[a,o]=b.useState(()=>S(n)),[s,l]=b.useState((a==null?void 0:a.colorSpace)||"hex");b.useEffect(()=>{let f=e||"",g=S(f);r(f),o(g),l((g==null?void 0:g.colorSpace)||"hex")},[e]);let c=b.useMemo(()=>At(n,a,s).toLowerCase(),[n,a,s]),i=b.useCallback(f=>{let g=S(f),x=(g==null?void 0:g.value)||f||"";r(x),x===""&&(o(void 0),t(void 0)),g&&(o(g),l(g.colorSpace),t(g.value))},[t]),d=b.useCallback(()=>{let f=L.indexOf(s)+1;f>=L.length&&(f=0),l(L[f]);let g=(a==null?void 0:a[L[f]])||"";r(g),t(g)},[a,s,t]);return{value:n,realValue:c,updateValue:i,color:a,colorSpace:s,cycleColorSpace:d}},D=e=>e.replace(/\s*/,"").toLowerCase(),Ut=(e,t,n)=>{let[r,a]=b.useState(t!=null&&t.valid?[t]:[]);b.useEffect(()=>{t===void 0&&a([])},[t]);let o=b.useMemo(()=>(e||[]).map(l=>typeof l=="string"?S(l):l.title?{...S(l.color),keyword:l.title}:S(l.color)).concat(r).filter(Boolean).slice(-27),[e,r]),s=b.useCallback(l=>{l!=null&&l.valid&&(o.some(c=>D(c[n])===D(l[n]))||a(c=>c.concat(l)))},[n,o]);return{presets:o,addPreset:s}},Yt=({name:e,value:t,onChange:n,onFocus:r,onBlur:a,presetColors:o,startOpen:s=!1,argType:l})=>{var E;let c=b.useCallback(dt(n,200),[n]),{value:i,realValue:d,updateValue:f,color:g,colorSpace:x,cycleColorSpace:j}=Gt(t,c),{presets:M,addPreset:p}=Ut(o,g,x),m=Vt[x],w=!!((E=l==null?void 0:l.table)!=null&&E.readonly);return h.createElement(jt,{"aria-readonly":w},h.createElement(zt,{startOpen:s,trigger:w?[null]:void 0,closeOnOutsideClick:!0,onVisibleChange:()=>p(g),tooltip:h.createElement(Ht,null,h.createElement(m,{color:d==="transparent"?"#000000":d,onChange:f,onFocus:r,onBlur:a}),M.length>0&&h.createElement(Tt,null,M.map((k,I)=>h.createElement(ue,{key:`${k.value}-${I}`,hasChrome:!1,tooltip:h.createElement(Ft,{note:k.keyword||k.value})},h.createElement(le,{value:k[x],active:g&&D(k[x])===D(g[x]),onClick:()=>f(k.value)})))))},h.createElement(le,{value:d,style:{margin:4}})),h.createElement(qt,{id:Ne(e),value:i,onChange:k=>f(k.target.value),onFocus:k=>k.target.select(),readOnly:w,placeholder:"Choose color..."}),i?h.createElement(Bt,{onClick:j}):null)},nn=Yt;export{Yt as ColorControl,nn as default};
|
|
1
|
+
import{af as Me,ag as ie,ah as Ce,ae as h,ai as b,aj as $,a2 as ue,a0 as $e,x as Ie,ak as Oe,al as Ne}from"./DocsRenderer-CFRXHY34-BTRR5RRG.js";import{a as fe}from"./_commonjsHelpers-Chg3vePA.js";import"./iframe-BmaPoam5.js";import"../sb-preview/runtime.js";import"./index-vG0co4wr.js";var Se={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};const F=Se,he={};for(const e of Object.keys(F))he[F[e]]=e;const u={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};var de=u;for(const e of Object.keys(u)){if(!("channels"in u[e]))throw new Error("missing channels property: "+e);if(!("labels"in u[e]))throw new Error("missing channel labels property: "+e);if(u[e].labels.length!==u[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:n}=u[e];delete u[e].channels,delete u[e].labels,Object.defineProperty(u[e],"channels",{value:t}),Object.defineProperty(u[e],"labels",{value:n})}u.rgb.hsl=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,a=Math.min(t,n,r),o=Math.max(t,n,r),s=o-a;let l,c;o===a?l=0:t===o?l=(n-r)/s:n===o?l=2+(r-t)/s:r===o&&(l=4+(t-n)/s),l=Math.min(l*60,360),l<0&&(l+=360);const i=(a+o)/2;return o===a?c=0:i<=.5?c=s/(o+a):c=s/(2-o-a),[l,c*100,i*100]};u.rgb.hsv=function(e){let t,n,r,a,o;const s=e[0]/255,l=e[1]/255,c=e[2]/255,i=Math.max(s,l,c),d=i-Math.min(s,l,c),f=function(g){return(i-g)/6/d+1/2};return d===0?(a=0,o=0):(o=d/i,t=f(s),n=f(l),r=f(c),s===i?a=r-n:l===i?a=1/3+t-r:c===i&&(a=2/3+n-t),a<0?a+=1:a>1&&(a-=1)),[a*360,o*100,i*100]};u.rgb.hwb=function(e){const t=e[0],n=e[1];let r=e[2];const a=u.rgb.hsl(e)[0],o=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[a,o*100,r*100]};u.rgb.cmyk=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,a=Math.min(1-t,1-n,1-r),o=(1-t-a)/(1-a)||0,s=(1-n-a)/(1-a)||0,l=(1-r-a)/(1-a)||0;return[o*100,s*100,l*100,a*100]};function Re(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}u.rgb.keyword=function(e){const t=he[e];if(t)return t;let n=1/0,r;for(const a of Object.keys(F)){const o=F[a],s=Re(e,o);s<n&&(n=s,r=a)}return r};u.keyword.rgb=function(e){return F[e]};u.rgb.xyz=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;const a=t*.4124+n*.3576+r*.1805,o=t*.2126+n*.7152+r*.0722,s=t*.0193+n*.1192+r*.9505;return[a*100,o*100,s*100]};u.rgb.lab=function(e){const t=u.rgb.xyz(e);let n=t[0],r=t[1],a=t[2];n/=95.047,r/=100,a/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,a=a>.008856?a**(1/3):7.787*a+16/116;const o=116*r-16,s=500*(n-r),l=200*(r-a);return[o,s,l]};u.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;let a,o,s;if(n===0)return s=r*255,[s,s,s];r<.5?a=r*(1+n):a=r+n-r*n;const l=2*r-a,c=[0,0,0];for(let i=0;i<3;i++)o=t+1/3*-(i-1),o<0&&o++,o>1&&o--,6*o<1?s=l+(a-l)*6*o:2*o<1?s=a:3*o<2?s=l+(a-l)*(2/3-o)*6:s=l,c[i]=s*255;return c};u.hsl.hsv=function(e){const t=e[0];let n=e[1]/100,r=e[2]/100,a=n;const o=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,a*=o<=1?o:2-o;const s=(r+n)/2,l=r===0?2*a/(o+a):2*n/(r+n);return[t,l*100,s*100]};u.hsv.rgb=function(e){const t=e[0]/60,n=e[1]/100;let r=e[2]/100;const a=Math.floor(t)%6,o=t-Math.floor(t),s=255*r*(1-n),l=255*r*(1-n*o),c=255*r*(1-n*(1-o));switch(r*=255,a){case 0:return[r,c,s];case 1:return[l,r,s];case 2:return[s,r,c];case 3:return[s,l,r];case 4:return[c,s,r];case 5:return[r,s,l]}};u.hsv.hsl=function(e){const t=e[0],n=e[1]/100,r=e[2]/100,a=Math.max(r,.01);let o,s;s=(2-n)*r;const l=(2-n)*a;return o=n*a,o/=l<=1?l:2-l,o=o||0,s/=2,[t,o*100,s*100]};u.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100,r=e[2]/100;const a=n+r;let o;a>1&&(n/=a,r/=a);const s=Math.floor(6*t),l=1-r;o=6*t-s,s&1&&(o=1-o);const c=n+o*(l-n);let i,d,f;switch(s){default:case 6:case 0:i=l,d=c,f=n;break;case 1:i=c,d=l,f=n;break;case 2:i=n,d=l,f=c;break;case 3:i=n,d=c,f=l;break;case 4:i=c,d=n,f=l;break;case 5:i=l,d=n,f=c;break}return[i*255,d*255,f*255]};u.cmyk.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,a=e[3]/100,o=1-Math.min(1,t*(1-a)+a),s=1-Math.min(1,n*(1-a)+a),l=1-Math.min(1,r*(1-a)+a);return[o*255,s*255,l*255]};u.xyz.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100;let a,o,s;return a=t*3.2406+n*-1.5372+r*-.4986,o=t*-.9689+n*1.8758+r*.0415,s=t*.0557+n*-.204+r*1.057,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),s=Math.min(Math.max(0,s),1),[a*255,o*255,s*255]};u.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;const a=116*n-16,o=500*(t-n),s=200*(n-r);return[a,o,s]};u.lab.xyz=function(e){const t=e[0],n=e[1],r=e[2];let a,o,s;o=(t+16)/116,a=n/500+o,s=o-r/200;const l=o**3,c=a**3,i=s**3;return o=l>.008856?l:(o-16/116)/7.787,a=c>.008856?c:(a-16/116)/7.787,s=i>.008856?i:(s-16/116)/7.787,a*=95.047,o*=100,s*=108.883,[a,o,s]};u.lab.lch=function(e){const t=e[0],n=e[1],r=e[2];let a;a=Math.atan2(r,n)*360/2/Math.PI,a<0&&(a+=360);const s=Math.sqrt(n*n+r*r);return[t,s,a]};u.lch.lab=function(e){const t=e[0],n=e[1],a=e[2]/360*2*Math.PI,o=n*Math.cos(a),s=n*Math.sin(a);return[t,o,s]};u.rgb.ansi16=function(e,t=null){const[n,r,a]=e;let o=t===null?u.rgb.hsv(e)[2]:t;if(o=Math.round(o/50),o===0)return 30;let s=30+(Math.round(a/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return o===2&&(s+=60),s};u.hsv.ansi16=function(e){return u.rgb.ansi16(u.hsv.rgb(e),e[2])};u.rgb.ansi256=function(e){const t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)};u.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const n=(~~(e>50)+1)*.5,r=(t&1)*n*255,a=(t>>1&1)*n*255,o=(t>>2&1)*n*255;return[r,a,o]};u.ansi256.rgb=function(e){if(e>=232){const o=(e-232)*10+8;return[o,o,o]}e-=16;let t;const n=Math.floor(e/36)/5*255,r=Math.floor((t=e%36)/6)/5*255,a=t%6/5*255;return[n,r,a]};u.rgb.hex=function(e){const n=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".substring(n.length)+n};u.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];t[0].length===3&&(n=n.split("").map(l=>l+l).join(""));const r=parseInt(n,16),a=r>>16&255,o=r>>8&255,s=r&255;return[a,o,s]};u.rgb.hcg=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,a=Math.max(Math.max(t,n),r),o=Math.min(Math.min(t,n),r),s=a-o;let l,c;return s<1?l=o/(1-s):l=0,s<=0?c=0:a===t?c=(n-r)/s%6:a===n?c=2+(r-t)/s:c=4+(t-n)/s,c/=6,c%=1,[c*360,s*100,l*100]};u.hsl.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n);let a=0;return r<1&&(a=(n-.5*r)/(1-r)),[e[0],r*100,a*100]};u.hsv.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=t*n;let a=0;return r<1&&(a=(n-r)/(1-r)),[e[0],r*100,a*100]};u.hcg.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;if(n===0)return[r*255,r*255,r*255];const a=[0,0,0],o=t%1*6,s=o%1,l=1-s;let c=0;switch(Math.floor(o)){case 0:a[0]=1,a[1]=s,a[2]=0;break;case 1:a[0]=l,a[1]=1,a[2]=0;break;case 2:a[0]=0,a[1]=1,a[2]=s;break;case 3:a[0]=0,a[1]=l,a[2]=1;break;case 4:a[0]=s,a[1]=0,a[2]=1;break;default:a[0]=1,a[1]=0,a[2]=l}return c=(1-n)*r,[(n*a[0]+c)*255,(n*a[1]+c)*255,(n*a[2]+c)*255]};u.hcg.hsv=function(e){const t=e[1]/100,n=e[2]/100,r=t+n*(1-t);let a=0;return r>0&&(a=t/r),[e[0],a*100,r*100]};u.hcg.hsl=function(e){const t=e[1]/100,r=e[2]/100*(1-t)+.5*t;let a=0;return r>0&&r<.5?a=t/(2*r):r>=.5&&r<1&&(a=t/(2*(1-r))),[e[0],a*100,r*100]};u.hcg.hwb=function(e){const t=e[1]/100,n=e[2]/100,r=t+n*(1-t);return[e[0],(r-t)*100,(1-r)*100]};u.hwb.hcg=function(e){const t=e[1]/100,r=1-e[2]/100,a=r-t;let o=0;return a<1&&(o=(r-a)/(1-a)),[e[0],a*100,o*100]};u.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};u.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};u.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};u.gray.hsl=function(e){return[0,0,e[0]]};u.gray.hsv=u.gray.hsl;u.gray.hwb=function(e){return[0,100,e[0]]};u.gray.cmyk=function(e){return[0,0,0,e[0]]};u.gray.lab=function(e){return[e[0],0,0]};u.gray.hex=function(e){const t=Math.round(e[0]/100*255)&255,r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r};u.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};const X=de;function je(){const e={},t=Object.keys(X);for(let n=t.length,r=0;r<n;r++)e[t[r]]={distance:-1,parent:null};return e}function ze(e){const t=je(),n=[e];for(t[e].distance=0;n.length;){const r=n.pop(),a=Object.keys(X[r]);for(let o=a.length,s=0;s<o;s++){const l=a[s],c=t[l];c.distance===-1&&(c.distance=t[r].distance+1,c.parent=r,n.unshift(l))}}return t}function He(e,t){return function(n){return t(e(n))}}function Fe(e,t){const n=[t[e].parent,e];let r=X[t[e].parent][e],a=t[e].parent;for(;t[a].parent;)n.unshift(t[a].parent),r=He(X[t[a].parent][a],r),a=t[a].parent;return r.conversion=n,r}var Te=function(e){const t=ze(e),n={},r=Object.keys(t);for(let a=r.length,o=0;o<a;o++){const s=r[o];t[s].parent!==null&&(n[s]=Fe(s,t))}return n};const K=de,Pe=Te,N={},Le=Object.keys(K);function qe(e){const t=function(...n){const r=n[0];return r==null?r:(r.length>1&&(n=r),e(n))};return"conversion"in e&&(t.conversion=e.conversion),t}function Be(e){const t=function(...n){const r=n[0];if(r==null)return r;r.length>1&&(n=r);const a=e(n);if(typeof a=="object")for(let o=a.length,s=0;s<o;s++)a[s]=Math.round(a[s]);return a};return"conversion"in e&&(t.conversion=e.conversion),t}Le.forEach(e=>{N[e]={},Object.defineProperty(N[e],"channels",{value:K[e].channels}),Object.defineProperty(N[e],"labels",{value:K[e].labels});const t=Pe(e);Object.keys(t).forEach(r=>{const a=t[r];N[e][r]=Be(a),N[e][r].raw=qe(a)})});var Xe=N;const _=fe(Xe);var De=Me,We=function(){return De.Date.now()},Ke=We,Ve=/\s/;function Ae(e){for(var t=e.length;t--&&Ve.test(e.charAt(t)););return t}var Ge=Ae,Ue=Ge,Ye=/^\s+/;function Je(e){return e&&e.slice(0,Ue(e)+1).replace(Ye,"")}var Qe=Je,Ze=Qe,te=ie,et=Ce,ne=NaN,tt=/^[-+]0x[0-9a-f]+$/i,nt=/^0b[01]+$/i,rt=/^0o[0-7]+$/i,at=parseInt;function ot(e){if(typeof e=="number")return e;if(et(e))return ne;if(te(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=te(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Ze(e);var n=nt.test(e);return n||rt.test(e)?at(e.slice(2),n?2:8):tt.test(e)?ne:+e}var st=ot,lt=ie,W=Ke,re=st,ct="Expected a function",it=Math.max,ut=Math.min;function ft(e,t,n){var r,a,o,s,l,c,i=0,d=!1,f=!1,g=!0;if(typeof e!="function")throw new TypeError(ct);t=re(t)||0,lt(n)&&(d=!!n.leading,f="maxWait"in n,o=f?it(re(n.maxWait)||0,t):o,g="trailing"in n?!!n.trailing:g);function x(v){var C=r,z=a;return r=a=void 0,i=v,s=e.apply(z,C),s}function j(v){return i=v,l=setTimeout(m,t),d?x(v):s}function M(v){var C=v-c,z=v-i,ee=t-C;return f?ut(ee,o-z):ee}function p(v){var C=v-c,z=v-i;return c===void 0||C>=t||C<0||f&&z>=o}function m(){var v=W();if(p(v))return w(v);l=setTimeout(m,M(v))}function w(v){return l=void 0,g&&r?x(v):(r=a=void 0,s)}function E(){l!==void 0&&clearTimeout(l),i=0,r=c=a=l=void 0}function k(){return l===void 0?s:w(W())}function I(){var v=W(),C=p(v);if(r=arguments,a=this,c=v,C){if(l===void 0)return j(c);if(f)return clearTimeout(l),l=setTimeout(m,t),x(c)}return l===void 0&&(l=setTimeout(m,t)),s}return I.cancel=E,I.flush=k,I}var ht=ft;const dt=fe(ht);function O(){return(O=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function J(e,t){if(e==null)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)t.indexOf(n=o[r])>=0||(a[n]=e[n]);return a}function V(e){var t=b.useRef(e),n=b.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var R=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e<t?t:e},H=function(e){return"touches"in e},A=function(e){return e&&e.ownerDocument.defaultView||self},ae=function(e,t,n){var r=e.getBoundingClientRect(),a=H(t)?function(o,s){for(var l=0;l<o.length;l++)if(o[l].identifier===s)return o[l];return o[0]}(t.touches,n):t;return{left:R((a.pageX-(r.left+A(e).pageXOffset))/r.width),top:R((a.pageY-(r.top+A(e).pageYOffset))/r.height)}},oe=function(e){!H(e)&&e.preventDefault()},Q=h.memo(function(e){var t=e.onMove,n=e.onKey,r=J(e,["onMove","onKey"]),a=b.useRef(null),o=V(t),s=V(n),l=b.useRef(null),c=b.useRef(!1),i=b.useMemo(function(){var x=function(p){oe(p),(H(p)?p.touches.length>0:p.buttons>0)&&a.current?o(ae(a.current,p,l.current)):M(!1)},j=function(){return M(!1)};function M(p){var m=c.current,w=A(a.current),E=p?w.addEventListener:w.removeEventListener;E(m?"touchmove":"mousemove",x),E(m?"touchend":"mouseup",j)}return[function(p){var m=p.nativeEvent,w=a.current;if(w&&(oe(m),!function(k,I){return I&&!H(k)}(m,c.current)&&w)){if(H(m)){c.current=!0;var E=m.changedTouches||[];E.length&&(l.current=E[0].identifier)}w.focus(),o(ae(w,m,l.current)),M(!0)}},function(p){var m=p.which||p.keyCode;m<37||m>40||(p.preventDefault(),s({left:m===39?.05:m===37?-.05:0,top:m===40?.05:m===38?-.05:0}))},M]},[s,o]),d=i[0],f=i[1],g=i[2];return b.useEffect(function(){return g},[g]),h.createElement("div",O({},r,{onTouchStart:d,onMouseDown:d,className:"react-colorful__interactive",ref:a,onKeyDown:f,tabIndex:0,role:"slider"}))}),T=function(e){return e.filter(Boolean).join(" ")},Z=function(e){var t=e.color,n=e.left,r=e.top,a=r===void 0?.5:r,o=T(["react-colorful__pointer",e.className]);return h.createElement("div",{className:o,style:{top:100*a+"%",left:100*n+"%"}},h.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},y=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},gt={grad:.9,turn:360,rad:360/(2*Math.PI)},bt=function(e){return me(G(e))},G=function(e){return e[0]==="#"&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?y(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?y(parseInt(e.substring(6,8),16)/255,2):1}},mt=function(e,t){return t===void 0&&(t="deg"),Number(e)*(gt[t]||1)},vt=function(e){var t=/hsla?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?pt({h:mt(t[1],t[2]),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)}):{h:0,s:0,v:0,a:1}},pt=function(e){var t=e.s,n=e.l;return{h:e.h,s:(t*=(n<50?n:100-n)/100)>0?2*t/(n+t)*100:0,v:n+t,a:e.a}},yt=function(e){return wt(be(e))},ge=function(e){var t=e.s,n=e.v,r=e.a,a=(200-t)*n/100;return{h:y(e.h),s:y(a>0&&a<200?t*n/100/(a<=100?a:200-a)*100:0),l:y(a/2),a:y(r,2)}},U=function(e){var t=ge(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},B=function(e){var t=ge(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},be=function(e){var t=e.h,n=e.s,r=e.v,a=e.a;t=t/360*6,n/=100,r/=100;var o=Math.floor(t),s=r*(1-n),l=r*(1-(t-o)*n),c=r*(1-(1-t+o)*n),i=o%6;return{r:y(255*[r,l,s,s,c,r][i]),g:y(255*[c,r,r,l,s,s][i]),b:y(255*[s,s,c,r,r,l][i]),a:y(a,2)}},xt=function(e){var t=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?me({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):{h:0,s:0,v:0,a:1}},P=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},wt=function(e){var t=e.r,n=e.g,r=e.b,a=e.a,o=a<1?P(y(255*a)):"";return"#"+P(t)+P(n)+P(r)+o},me=function(e){var t=e.r,n=e.g,r=e.b,a=e.a,o=Math.max(t,n,r),s=o-Math.min(t,n,r),l=s?o===t?(n-r)/s:o===n?2+(r-t)/s:4+(t-n)/s:0;return{h:y(60*(l<0?l+6:l)),s:y(o?s/o*100:0),v:y(o/255*100),a}},ve=h.memo(function(e){var t=e.hue,n=e.onChange,r=T(["react-colorful__hue",e.className]);return h.createElement("div",{className:r},h.createElement(Q,{onMove:function(a){n({h:360*a.left})},onKey:function(a){n({h:R(t+360*a.left,0,360)})},"aria-label":"Hue","aria-valuenow":y(t),"aria-valuemax":"360","aria-valuemin":"0"},h.createElement(Z,{className:"react-colorful__hue-pointer",left:t/360,color:U({h:t,s:100,v:100,a:1})})))}),pe=h.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:U({h:t.h,s:100,v:100,a:1})};return h.createElement("div",{className:"react-colorful__saturation",style:r},h.createElement(Q,{onMove:function(a){n({s:100*a.left,v:100-100*a.top})},onKey:function(a){n({s:R(t.s+100*a.left,0,100),v:R(t.v-100*a.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+y(t.s)+"%, Brightness "+y(t.v)+"%"},h.createElement(Z,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:U(t)})))}),ye=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},xe=function(e,t){return e.replace(/\s/g,"")===t.replace(/\s/g,"")},kt=function(e,t){return e.toLowerCase()===t.toLowerCase()||ye(G(e),G(t))};function we(e,t,n){var r=V(n),a=b.useState(function(){return e.toHsva(t)}),o=a[0],s=a[1],l=b.useRef({color:t,hsva:o});b.useEffect(function(){if(!e.equal(t,l.current.color)){var i=e.toHsva(t);l.current={hsva:i,color:t},s(i)}},[t,e]),b.useEffect(function(){var i;ye(o,l.current.hsva)||e.equal(i=e.fromHsva(o),l.current.color)||(l.current={hsva:o,color:i},r(i))},[o,e,r]);var c=b.useCallback(function(i){s(function(d){return Object.assign({},d,i)})},[]);return[o,c]}var _t=typeof window!="undefined"?b.useLayoutEffect:b.useEffect,Et=function(){return typeof __webpack_nonce__!="undefined"?__webpack_nonce__:void 0},se=new Map,ke=function(e){_t(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!se.has(t)){var n=t.createElement("style");n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,se.set(t,n);var r=Et();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},Mt=function(e){var t=e.className,n=e.colorModel,r=e.color,a=r===void 0?n.defaultColor:r,o=e.onChange,s=J(e,["className","colorModel","color","onChange"]),l=b.useRef(null);ke(l);var c=we(n,a,o),i=c[0],d=c[1],f=T(["react-colorful",t]);return h.createElement("div",O({},s,{ref:l,className:f}),h.createElement(pe,{hsva:i,onChange:d}),h.createElement(ve,{hue:i.h,onChange:d,className:"react-colorful__last-control"}))},Ct={defaultColor:"000",toHsva:bt,fromHsva:function(e){return yt({h:e.h,s:e.s,v:e.v,a:1})},equal:kt},$t=function(e){return h.createElement(Mt,O({},e,{colorModel:Ct}))},It=function(e){var t=e.className,n=e.hsva,r=e.onChange,a={backgroundImage:"linear-gradient(90deg, "+B(Object.assign({},n,{a:0}))+", "+B(Object.assign({},n,{a:1}))+")"},o=T(["react-colorful__alpha",t]),s=y(100*n.a);return h.createElement("div",{className:o},h.createElement("div",{className:"react-colorful__alpha-gradient",style:a}),h.createElement(Q,{onMove:function(l){r({a:l.left})},onKey:function(l){r({a:R(n.a+l.left)})},"aria-label":"Alpha","aria-valuetext":s+"%","aria-valuenow":s,"aria-valuemin":"0","aria-valuemax":"100"},h.createElement(Z,{className:"react-colorful__alpha-pointer",left:n.a,color:B(n)})))},_e=function(e){var t=e.className,n=e.colorModel,r=e.color,a=r===void 0?n.defaultColor:r,o=e.onChange,s=J(e,["className","colorModel","color","onChange"]),l=b.useRef(null);ke(l);var c=we(n,a,o),i=c[0],d=c[1],f=T(["react-colorful",t]);return h.createElement("div",O({},s,{ref:l,className:f}),h.createElement(pe,{hsva:i,onChange:d}),h.createElement(ve,{hue:i.h,onChange:d}),h.createElement(It,{hsva:i,onChange:d,className:"react-colorful__last-control"}))},Ot={defaultColor:"hsla(0, 0%, 0%, 1)",toHsva:vt,fromHsva:B,equal:xe},Nt=function(e){return h.createElement(_e,O({},e,{colorModel:Ot}))},St={defaultColor:"rgba(0, 0, 0, 1)",toHsva:xt,fromHsva:function(e){var t=be(e);return"rgba("+t.r+", "+t.g+", "+t.b+", "+t.a+")"},equal:xe},Rt=function(e){return h.createElement(_e,O({},e,{colorModel:St}))},jt=$.div({position:"relative",maxWidth:250,'&[aria-readonly="true"]':{opacity:.5}}),zt=$(ue)({position:"absolute",zIndex:1,top:4,left:4,"[aria-readonly=true] &":{cursor:"not-allowed"}}),Ht=$.div({width:200,margin:5,".react-colorful__saturation":{borderRadius:"4px 4px 0 0"},".react-colorful__hue":{boxShadow:"inset 0 0 0 1px rgb(0 0 0 / 5%)"},".react-colorful__last-control":{borderRadius:"0 0 4px 4px"}}),Ft=$($e)(({theme:e})=>({fontFamily:e.typography.fonts.base})),Tt=$.div({display:"grid",gridTemplateColumns:"repeat(9, 16px)",gap:6,padding:3,marginTop:5,width:200}),Pt=$.div(({theme:e,active:t})=>({width:16,height:16,boxShadow:t?`${e.appBorderColor} 0 0 0 1px inset, ${e.textMutedColor}50 0 0 0 4px`:`${e.appBorderColor} 0 0 0 1px inset`,borderRadius:e.appBorderRadius})),Lt=`url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')`,le=({value:e,style:t,...n})=>{let r=`linear-gradient(${e}, ${e}), ${Lt}, linear-gradient(#fff, #fff)`;return h.createElement(Pt,{...n,style:{...t,backgroundImage:r}})},qt=$(Ie.Input)(({theme:e,readOnly:t})=>({width:"100%",paddingLeft:30,paddingRight:30,boxSizing:"border-box",fontFamily:e.typography.fonts.base})),Bt=$(Oe)(({theme:e})=>({position:"absolute",zIndex:1,top:6,right:7,width:20,height:20,padding:4,boxSizing:"border-box",cursor:"pointer",color:e.input.color})),Ee=(e=>(e.RGB="rgb",e.HSL="hsl",e.HEX="hex",e))(Ee||{}),L=Object.values(Ee),Xt=/\(([0-9]+),\s*([0-9]+)%?,\s*([0-9]+)%?,?\s*([0-9.]+)?\)/,Dt=/^\s*rgba?\(([0-9]+),\s*([0-9]+),\s*([0-9]+),?\s*([0-9.]+)?\)\s*$/i,Wt=/^\s*hsla?\(([0-9]+),\s*([0-9]+)%,\s*([0-9]+)%,?\s*([0-9.]+)?\)\s*$/i,Y=/^\s*#?([0-9a-f]{3}|[0-9a-f]{6})\s*$/i,Kt=/^\s*#?([0-9a-f]{3})\s*$/i,Vt={hex:$t,rgb:Rt,hsl:Nt},q={hex:"transparent",rgb:"rgba(0, 0, 0, 0)",hsl:"hsla(0, 0%, 0%, 0)"},ce=e=>{let t=e==null?void 0:e.match(Xt);if(!t)return[0,0,0,1];let[,n,r,a,o=1]=t;return[n,r,a,o].map(Number)},S=e=>{if(!e)return;let t=!0;if(Dt.test(e)){let[s,l,c,i]=ce(e),[d,f,g]=_.rgb.hsl([s,l,c])||[0,0,0];return{valid:t,value:e,keyword:_.rgb.keyword([s,l,c]),colorSpace:"rgb",rgb:e,hsl:`hsla(${d}, ${f}%, ${g}%, ${i})`,hex:`#${_.rgb.hex([s,l,c]).toLowerCase()}`}}if(Wt.test(e)){let[s,l,c,i]=ce(e),[d,f,g]=_.hsl.rgb([s,l,c])||[0,0,0];return{valid:t,value:e,keyword:_.hsl.keyword([s,l,c]),colorSpace:"hsl",rgb:`rgba(${d}, ${f}, ${g}, ${i})`,hsl:e,hex:`#${_.hsl.hex([s,l,c]).toLowerCase()}`}}let n=e.replace("#",""),r=_.keyword.rgb(n)||_.hex.rgb(n),a=_.rgb.hsl(r),o=e;if(/[^#a-f0-9]/i.test(e)?o=n:Y.test(e)&&(o=`#${n}`),o.startsWith("#"))t=Y.test(o);else try{_.keyword.hex(o)}catch{t=!1}return{valid:t,value:o,keyword:_.rgb.keyword(r),colorSpace:"hex",rgb:`rgba(${r[0]}, ${r[1]}, ${r[2]}, 1)`,hsl:`hsla(${a[0]}, ${a[1]}%, ${a[2]}%, 1)`,hex:o}},At=(e,t,n)=>{if(!e||!(t!=null&&t.valid))return q[n];if(n!=="hex")return(t==null?void 0:t[n])||q[n];if(!t.hex.startsWith("#"))try{return`#${_.keyword.hex(t.hex)}`}catch{return q.hex}let r=t.hex.match(Kt);if(!r)return Y.test(t.hex)?t.hex:q.hex;let[a,o,s]=r[1].split("");return`#${a}${a}${o}${o}${s}${s}`},Gt=(e,t)=>{let[n,r]=b.useState(e||""),[a,o]=b.useState(()=>S(n)),[s,l]=b.useState((a==null?void 0:a.colorSpace)||"hex");b.useEffect(()=>{let f=e||"",g=S(f);r(f),o(g),l((g==null?void 0:g.colorSpace)||"hex")},[e]);let c=b.useMemo(()=>At(n,a,s).toLowerCase(),[n,a,s]),i=b.useCallback(f=>{let g=S(f),x=(g==null?void 0:g.value)||f||"";r(x),x===""&&(o(void 0),t(void 0)),g&&(o(g),l(g.colorSpace),t(g.value))},[t]),d=b.useCallback(()=>{let f=L.indexOf(s)+1;f>=L.length&&(f=0),l(L[f]);let g=(a==null?void 0:a[L[f]])||"";r(g),t(g)},[a,s,t]);return{value:n,realValue:c,updateValue:i,color:a,colorSpace:s,cycleColorSpace:d}},D=e=>e.replace(/\s*/,"").toLowerCase(),Ut=(e,t,n)=>{let[r,a]=b.useState(t!=null&&t.valid?[t]:[]);b.useEffect(()=>{t===void 0&&a([])},[t]);let o=b.useMemo(()=>(e||[]).map(l=>typeof l=="string"?S(l):l.title?{...S(l.color),keyword:l.title}:S(l.color)).concat(r).filter(Boolean).slice(-27),[e,r]),s=b.useCallback(l=>{l!=null&&l.valid&&(o.some(c=>D(c[n])===D(l[n]))||a(c=>c.concat(l)))},[n,o]);return{presets:o,addPreset:s}},Yt=({name:e,value:t,onChange:n,onFocus:r,onBlur:a,presetColors:o,startOpen:s=!1,argType:l})=>{var E;let c=b.useCallback(dt(n,200),[n]),{value:i,realValue:d,updateValue:f,color:g,colorSpace:x,cycleColorSpace:j}=Gt(t,c),{presets:M,addPreset:p}=Ut(o,g,x),m=Vt[x],w=!!((E=l==null?void 0:l.table)!=null&&E.readonly);return h.createElement(jt,{"aria-readonly":w},h.createElement(zt,{startOpen:s,trigger:w?[null]:void 0,closeOnOutsideClick:!0,onVisibleChange:()=>p(g),tooltip:h.createElement(Ht,null,h.createElement(m,{color:d==="transparent"?"#000000":d,onChange:f,onFocus:r,onBlur:a}),M.length>0&&h.createElement(Tt,null,M.map((k,I)=>h.createElement(ue,{key:`${k.value}-${I}`,hasChrome:!1,tooltip:h.createElement(Ft,{note:k.keyword||k.value})},h.createElement(le,{value:k[x],active:g&&D(k[x])===D(g[x]),onClick:()=>f(k.value)})))))},h.createElement(le,{value:d,style:{margin:4}})),h.createElement(qt,{id:Ne(e),value:i,onChange:k=>f(k.target.value),onFocus:k=>k.target.select(),readOnly:w,placeholder:"Choose color..."}),i?h.createElement(Bt,{onClick:j}):null)},nn=Yt;export{Yt as ColorControl,nn as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{I as n}from"./Icon-BPz80dqH.js";import{D as a,a as c,b as r}from"./DatePicker-
|
|
1
|
+
import{I as n}from"./Icon-BPz80dqH.js";import{D as a,a as c,b as r}from"./DatePicker-Bc1APlab.js";import"./vue.esm-bundler-DmkhfO_9.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./Tile-DvjxsEPO.js";import"./iframe-BmaPoam5.js";import"../sb-preview/runtime.js";const{useArgs:i}=__STORYBOOK_MODULE_PREVIEW_API__,E={title:"Components/DatePickers/DateBox",component:a,render:t=>(i(),{components:{DateBox:a},setup(){return t},data(){return{ICONS:Object.freeze(n)}},computed:{formattedStartDate(){return this.startDate?new Date(this.startDate):null},formattedEndDate(){return this.endDate?new Date(this.endDate):null}},template:`
|
|
2
2
|
<div style="display: flex">
|
|
3
3
|
<date-box
|
|
4
4
|
:is-interactive="isInteractive"
|