@liner-fe/prism 2.8.5 → 2.8.7
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/lib/index.d.ts +18 -6
- package/lib/index.js +32 -46
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -70,7 +70,9 @@ interface IToastBase extends ToastProps, RefAttributes<HTMLLIElement> {
|
|
|
70
70
|
isLoading?: boolean;
|
|
71
71
|
}
|
|
72
72
|
interface IToastIcon {
|
|
73
|
-
icon:
|
|
73
|
+
icon: {
|
|
74
|
+
icon: IconComponentType;
|
|
75
|
+
} & Pick<IconProps, 'fill' | 'thick' | 'type' | 'fillType'>;
|
|
74
76
|
button?: never;
|
|
75
77
|
}
|
|
76
78
|
interface IToastButton {
|
|
@@ -219,7 +221,9 @@ interface PopoverTriggerProps {
|
|
|
219
221
|
interface PopoverContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
220
222
|
level?: 'primary' | 'secondary';
|
|
221
223
|
tag?: string;
|
|
222
|
-
icon?:
|
|
224
|
+
icon?: {
|
|
225
|
+
icon: IconComponentType;
|
|
226
|
+
} & Pick<IconProps, 'name' | 'thick' | 'fill'>;
|
|
223
227
|
title?: string;
|
|
224
228
|
description?: string;
|
|
225
229
|
position?: 'top' | 'right' | 'bottom' | 'left';
|
|
@@ -391,7 +395,9 @@ interface SelectItemProps {
|
|
|
391
395
|
value: string;
|
|
392
396
|
text?: string;
|
|
393
397
|
disabled?: boolean;
|
|
394
|
-
icon?:
|
|
398
|
+
icon?: {
|
|
399
|
+
icon: IconComponentType;
|
|
400
|
+
} & Pick<IconProps, 'fill' | 'thick' | 'type' | 'fillType' | 'size'>;
|
|
395
401
|
onClick?: () => void;
|
|
396
402
|
}
|
|
397
403
|
declare const Select: react.ForwardRefExoticComponent<SelectProps & react.RefAttributes<never>> & {
|
|
@@ -407,7 +413,9 @@ interface ItemProps {
|
|
|
407
413
|
value: string;
|
|
408
414
|
text: string;
|
|
409
415
|
disabled?: boolean;
|
|
410
|
-
icon?:
|
|
416
|
+
icon?: {
|
|
417
|
+
icon: IconComponentType;
|
|
418
|
+
} & Pick<IconProps, 'fill' | 'thick' | 'type' | 'fillType' | 'size'>;
|
|
411
419
|
onClick?: () => void;
|
|
412
420
|
}
|
|
413
421
|
declare const List: (({ children, className, ...props }: ListRootProps) => react_jsx_runtime.JSX.Element) & {
|
|
@@ -425,7 +433,9 @@ interface ButtonType {
|
|
|
425
433
|
}
|
|
426
434
|
interface ISnackbarBasic {
|
|
427
435
|
kind?: 'basic';
|
|
428
|
-
icon?:
|
|
436
|
+
icon?: {
|
|
437
|
+
icon: IconComponentType;
|
|
438
|
+
} & Pick<IconProps, 'fill' | 'thick' | 'type' | 'fillType'>;
|
|
429
439
|
button?: {
|
|
430
440
|
text?: ButtonType;
|
|
431
441
|
basic?: ButtonType;
|
|
@@ -595,7 +605,9 @@ interface BaseCoachMarkContentProps extends Omit<PrimitiveCoachMarkContentProps,
|
|
|
595
605
|
onClose?: () => void;
|
|
596
606
|
}
|
|
597
607
|
type BaseCoachMarkContent = {
|
|
598
|
-
icon?:
|
|
608
|
+
icon?: {
|
|
609
|
+
icon: IconComponentType;
|
|
610
|
+
} & Pick<IconProps, 'fill' | 'thick' | 'type' | 'fillType'>;
|
|
599
611
|
description?: string;
|
|
600
612
|
step?: Step;
|
|
601
613
|
primaryButton?: RestrictedButtonProps;
|
package/lib/index.js
CHANGED
|
@@ -1893,7 +1893,6 @@ var Paragraph = (0, import_react4.forwardRef)(
|
|
|
1893
1893
|
);
|
|
1894
1894
|
|
|
1895
1895
|
// src/components/Toast/index.tsx
|
|
1896
|
-
var import_icon = require("@liner-fe/icon");
|
|
1897
1896
|
var import_recoil2 = require("recoil");
|
|
1898
1897
|
var import_lottie_web = __toESM(require("lottie-web"));
|
|
1899
1898
|
|
|
@@ -2420,7 +2419,8 @@ var SingleToast = /* @__PURE__ */ __name((props) => {
|
|
|
2420
2419
|
}, [isLoading]);
|
|
2421
2420
|
const renderIcon = /* @__PURE__ */ __name(() => {
|
|
2422
2421
|
if (!icon) return null;
|
|
2423
|
-
|
|
2422
|
+
const { icon: IconCmp, ...rest } = icon;
|
|
2423
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("i", { className: style_module_default3.Icon, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconCmp, { ...rest, size: "m" }) });
|
|
2424
2424
|
}, "renderIcon");
|
|
2425
2425
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Root2, { className: style_module_default3.ToastRoot, open: isOpen, ...props, children: [
|
|
2426
2426
|
isLoading && !toastSuccess.current ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { ref: lottieRef, style: { width: "24px", height: "24px" } }) : renderIcon(),
|
|
@@ -2696,7 +2696,7 @@ var style_module_default5 = {
|
|
|
2696
2696
|
// src/components/Popover/index.tsx
|
|
2697
2697
|
var import_cva4 = require("cva");
|
|
2698
2698
|
var import_clsx8 = require("clsx");
|
|
2699
|
-
var
|
|
2699
|
+
var import_icon = require("@liner-fe/icon");
|
|
2700
2700
|
|
|
2701
2701
|
// src/components/TextButton/index.tsx
|
|
2702
2702
|
var import_cva3 = require("cva");
|
|
@@ -2889,7 +2889,7 @@ var PopoverContent = React17.forwardRef(
|
|
|
2889
2889
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: style_module_default5.contentContainer, children: [
|
|
2890
2890
|
(tag || icon || onClose) && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: style_module_default5.heading, children: [
|
|
2891
2891
|
tag && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: popoverTagVariants(), children: tag }),
|
|
2892
|
-
icon && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2892
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(icon.icon, { size: "xs", thick: icon.thick, fill: icon.fill }),
|
|
2893
2893
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: popoverTitleVariants(), children: title }),
|
|
2894
2894
|
onClose && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2895
2895
|
import_radix_ui.Popover.PopoverClose,
|
|
@@ -2898,16 +2898,7 @@ var PopoverContent = React17.forwardRef(
|
|
|
2898
2898
|
onClick: () => {
|
|
2899
2899
|
onClose();
|
|
2900
2900
|
},
|
|
2901
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2902
|
-
import_icon2.Icon,
|
|
2903
|
-
{
|
|
2904
|
-
name: "close-fill",
|
|
2905
|
-
size: "s",
|
|
2906
|
-
fill: true,
|
|
2907
|
-
thick: true,
|
|
2908
|
-
type: "neutral-label-static-primary"
|
|
2909
|
-
}
|
|
2910
|
-
)
|
|
2901
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_icon.IconCloseFill, { size: "s", fill: true, thick: true, type: "neutral-label-static-primary" })
|
|
2911
2902
|
}
|
|
2912
2903
|
)
|
|
2913
2904
|
] }),
|
|
@@ -3212,7 +3203,7 @@ var Label = (0, import_react15.forwardRef)(
|
|
|
3212
3203
|
Label.displayName = "Label";
|
|
3213
3204
|
|
|
3214
3205
|
// src/components/CheckBox/index.tsx
|
|
3215
|
-
var
|
|
3206
|
+
var import_icon2 = require("@liner-fe/icon");
|
|
3216
3207
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
3217
3208
|
var Checkbox = (0, import_react16.forwardRef)(
|
|
3218
3209
|
({ className, label, description, ...props }, ref) => {
|
|
@@ -3223,7 +3214,7 @@ var Checkbox = (0, import_react16.forwardRef)(
|
|
|
3223
3214
|
] }),
|
|
3224
3215
|
children
|
|
3225
3216
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_jsx_runtime24.Fragment, { children }), "CheckboxWrapper");
|
|
3226
|
-
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(CheckboxWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_radix_ui5.Checkbox.Root, { className: (0, import_clsx12.default)(style_module_default9.checkbox, className), ref, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_radix_ui5.Checkbox.Indicator, { className: style_module_default9["checkbox-indicator"], children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3217
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(CheckboxWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_radix_ui5.Checkbox.Root, { className: (0, import_clsx12.default)(style_module_default9.checkbox, className), ref, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_radix_ui5.Checkbox.Indicator, { className: style_module_default9["checkbox-indicator"], children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_icon2.IconCheckMark, { thick: true, size: "xs", type: "inverse-label-primary" }) }) }) });
|
|
3227
3218
|
}
|
|
3228
3219
|
);
|
|
3229
3220
|
|
|
@@ -3299,7 +3290,7 @@ var style_module_default12 = {
|
|
|
3299
3290
|
// src/components/Textfield/index.tsx
|
|
3300
3291
|
var import_cva8 = require("cva");
|
|
3301
3292
|
var import_clsx14 = __toESM(require("clsx"));
|
|
3302
|
-
var
|
|
3293
|
+
var import_icon3 = require("@liner-fe/icon");
|
|
3303
3294
|
var import_react_dom2 = require("react-dom");
|
|
3304
3295
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
3305
3296
|
var defaultTextfieldVariants = (0, import_cva8.cva)({
|
|
@@ -3416,7 +3407,7 @@ var Textfield = (0, import_react18.forwardRef)((props, ref) => {
|
|
|
3416
3407
|
level: "secondary",
|
|
3417
3408
|
fill: false,
|
|
3418
3409
|
icon: {
|
|
3419
|
-
icon:
|
|
3410
|
+
icon: import_icon3.IconCloseFill,
|
|
3420
3411
|
size: "s",
|
|
3421
3412
|
thick: true
|
|
3422
3413
|
},
|
|
@@ -3434,7 +3425,7 @@ var Textfield = (0, import_react18.forwardRef)((props, ref) => {
|
|
|
3434
3425
|
level: "secondary",
|
|
3435
3426
|
fill: false,
|
|
3436
3427
|
icon: {
|
|
3437
|
-
icon: deidentifiy ?
|
|
3428
|
+
icon: deidentifiy ? import_icon3.IconVisibilityOff : import_icon3.IconVisibility,
|
|
3438
3429
|
size: "s",
|
|
3439
3430
|
fill: true
|
|
3440
3431
|
},
|
|
@@ -3451,16 +3442,7 @@ var Textfield = (0, import_react18.forwardRef)((props, ref) => {
|
|
|
3451
3442
|
),
|
|
3452
3443
|
displayFooter && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: style_module_default12.footer, children: [
|
|
3453
3444
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: style_module_default12["error-wrapper"], children: error && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
3454
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3455
|
-
import_icon4.Icon,
|
|
3456
|
-
{
|
|
3457
|
-
name: "exclamationmark-fill",
|
|
3458
|
-
fill: true,
|
|
3459
|
-
thick: true,
|
|
3460
|
-
size: "xs",
|
|
3461
|
-
type: "function-label-negative"
|
|
3462
|
-
}
|
|
3463
|
-
),
|
|
3445
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_icon3.IconExclamationmarkFill, { fill: true, thick: true, size: "xs", type: "function-label-negative" }),
|
|
3464
3446
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3465
3447
|
Caption,
|
|
3466
3448
|
{
|
|
@@ -3514,7 +3496,7 @@ var style_module_default13 = {
|
|
|
3514
3496
|
};
|
|
3515
3497
|
|
|
3516
3498
|
// src/components/Select/index.tsx
|
|
3517
|
-
var
|
|
3499
|
+
var import_icon4 = require("@liner-fe/icon");
|
|
3518
3500
|
var import_react19 = require("react");
|
|
3519
3501
|
var import_clsx15 = __toESM(require("clsx"));
|
|
3520
3502
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
@@ -3622,7 +3604,7 @@ var SelectRoot = (0, import_react19.forwardRef)(
|
|
|
3622
3604
|
children: [
|
|
3623
3605
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_radix_ui7.Select.Trigger, { className: style_module_default13.trigger, ref, id, children: [
|
|
3624
3606
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_radix_ui7.Select.Value, { className: style_module_default13.placeholder, placeholder }),
|
|
3625
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_radix_ui7.Select.Icon, { className: style_module_default13.openIcon, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3607
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_radix_ui7.Select.Icon, { className: style_module_default13.openIcon, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_icon4.IconDropDown, { fill: true, thick: true, size: "xs" }) })
|
|
3626
3608
|
] }),
|
|
3627
3609
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(SelectContent, { ...contentProps })
|
|
3628
3610
|
]
|
|
@@ -3643,8 +3625,8 @@ var SelectItem = /* @__PURE__ */ __name(({ value, text, disabled, icon, onClick
|
|
|
3643
3625
|
},
|
|
3644
3626
|
children: [
|
|
3645
3627
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_radix_ui7.Select.ItemText, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Paragraph, { size: 3, type: "normal", weight: "medium", children: text ?? value }) }),
|
|
3646
|
-
icon && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_radix_ui7.Select.Icon, { className: style_module_default13.icon, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3647
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_radix_ui7.Select.ItemIndicator, { className: style_module_default13.itemIndicator, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3628
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_radix_ui7.Select.Icon, { className: style_module_default13.icon, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(icon.icon, { size: "xs", ...icon }) }),
|
|
3629
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_radix_ui7.Select.ItemIndicator, { className: style_module_default13.itemIndicator, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_icon4.IconCheckMark, { thick: true, size: "xs", type: "brand-label-primary" }) })
|
|
3648
3630
|
]
|
|
3649
3631
|
}
|
|
3650
3632
|
), "SelectItem");
|
|
@@ -3660,7 +3642,7 @@ var style_module_default14 = {
|
|
|
3660
3642
|
};
|
|
3661
3643
|
|
|
3662
3644
|
// src/components/List/index.tsx
|
|
3663
|
-
var
|
|
3645
|
+
var import_icon5 = require("@liner-fe/icon");
|
|
3664
3646
|
var import_react21 = require("react");
|
|
3665
3647
|
|
|
3666
3648
|
// src/hooks/collection.tsx
|
|
@@ -3689,7 +3671,15 @@ var Item = /* @__PURE__ */ __name(({ value, text, disabled, icon, onClick }) =>
|
|
|
3689
3671
|
const [isFocused, setIsFocused] = (0, import_react21.useState)(false);
|
|
3690
3672
|
const { value: contextValue, onChangeValue } = useCollectionContext();
|
|
3691
3673
|
const isSelected = contextValue === value;
|
|
3692
|
-
const
|
|
3674
|
+
const renderIcon = /* @__PURE__ */ __name(() => {
|
|
3675
|
+
if (isSelected) {
|
|
3676
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_icon5.IconCheckMark, { type: "brand-label-primary", thick: true });
|
|
3677
|
+
}
|
|
3678
|
+
if (icon) {
|
|
3679
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(icon.icon, { className: style_module_default14.icon, size: "xs", ...icon });
|
|
3680
|
+
}
|
|
3681
|
+
return null;
|
|
3682
|
+
}, "renderIcon");
|
|
3693
3683
|
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
3694
3684
|
"li",
|
|
3695
3685
|
{
|
|
@@ -3709,7 +3699,7 @@ var Item = /* @__PURE__ */ __name(({ value, text, disabled, icon, onClick }) =>
|
|
|
3709
3699
|
},
|
|
3710
3700
|
children: [
|
|
3711
3701
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Paragraph, { size: 3, type: "normal", weight: "medium", children: text }),
|
|
3712
|
-
(
|
|
3702
|
+
renderIcon()
|
|
3713
3703
|
]
|
|
3714
3704
|
}
|
|
3715
3705
|
);
|
|
@@ -3760,9 +3750,6 @@ var useSnackbar = /* @__PURE__ */ __name(() => {
|
|
|
3760
3750
|
};
|
|
3761
3751
|
}, "useSnackbar");
|
|
3762
3752
|
|
|
3763
|
-
// src/components/Snackbar/SnackbarIcon/index.tsx
|
|
3764
|
-
var import_icon7 = require("@liner-fe/icon");
|
|
3765
|
-
|
|
3766
3753
|
// src/components/Snackbar/SnackbarIcon/style.module.scss
|
|
3767
3754
|
var style_module_default16 = {
|
|
3768
3755
|
"container": "_container_1witc_1"
|
|
@@ -3773,11 +3760,11 @@ var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
|
3773
3760
|
var SnackbarIcon = /* @__PURE__ */ __name((props) => {
|
|
3774
3761
|
const { icon } = props;
|
|
3775
3762
|
if (!icon) return null;
|
|
3776
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3763
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(icon.icon, { ...icon, size: "m", className: style_module_default16.container });
|
|
3777
3764
|
}, "SnackbarIcon");
|
|
3778
3765
|
|
|
3779
3766
|
// src/components/Snackbar/index.tsx
|
|
3780
|
-
var
|
|
3767
|
+
var import_icon6 = require("@liner-fe/icon");
|
|
3781
3768
|
|
|
3782
3769
|
// src/components/Snackbar/SnackbarTitle/index.tsx
|
|
3783
3770
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
@@ -3909,7 +3896,7 @@ var SingleSnackbar = /* @__PURE__ */ __name((props) => {
|
|
|
3909
3896
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SnackbarDescription, { description })
|
|
3910
3897
|
] }),
|
|
3911
3898
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3912
|
-
|
|
3899
|
+
import_icon6.IconArrowForward,
|
|
3913
3900
|
{
|
|
3914
3901
|
fill: true,
|
|
3915
3902
|
thick: true,
|
|
@@ -8302,7 +8289,7 @@ var style_module_default21 = {
|
|
|
8302
8289
|
|
|
8303
8290
|
// src/components/coach-mark/main/index.tsx
|
|
8304
8291
|
var import_react28 = require("react");
|
|
8305
|
-
var
|
|
8292
|
+
var import_icon7 = require("@liner-fe/icon");
|
|
8306
8293
|
var import_cva12 = require("cva");
|
|
8307
8294
|
var import_clsx22 = __toESM(require("clsx"));
|
|
8308
8295
|
|
|
@@ -8456,7 +8443,7 @@ var CoachMarkContent = (0, import_react28.forwardRef)(
|
|
|
8456
8443
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Close, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
8457
8444
|
IconButton,
|
|
8458
8445
|
{
|
|
8459
|
-
icon: { icon:
|
|
8446
|
+
icon: { icon: import_icon7.IconClose },
|
|
8460
8447
|
size: "xs",
|
|
8461
8448
|
level: level === "inverse" ? "inverse" : "inverse-static",
|
|
8462
8449
|
fill: false,
|
|
@@ -8477,9 +8464,8 @@ var CoachMarkContent = (0, import_react28.forwardRef)(
|
|
|
8477
8464
|
}
|
|
8478
8465
|
),
|
|
8479
8466
|
icon && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
8480
|
-
|
|
8467
|
+
icon.icon,
|
|
8481
8468
|
{
|
|
8482
|
-
name: icon.name,
|
|
8483
8469
|
size: "xs",
|
|
8484
8470
|
thick: icon.thick,
|
|
8485
8471
|
fill: icon.fill,
|