@liner-fe/prism 2.7.16 → 2.8.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/lib/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import * as react from 'react';
3
3
  import react__default, { ButtonHTMLAttributes, RefAttributes, HTMLAttributes, ReactNode, ComponentPropsWithoutRef, InputHTMLAttributes, ComponentProps, LiHTMLAttributes, MouseEventHandler } from 'react';
4
4
  import * as cva from 'cva';
5
5
  import { VariantProps } from 'cva';
6
- import { IconProps } from '@liner-fe/icon';
6
+ import { IconProps, IconComponentType } from '@liner-fe/icon';
7
7
  import * as react_jsx_runtime from 'react/jsx-runtime';
8
8
  import { ToastProps } from '@radix-ui/react-toast';
9
9
  import * as _artsy_fresnel_dist_Media from '@artsy/fresnel/dist/Media';
@@ -51,8 +51,12 @@ interface DefaultButtonProps<T extends FillType> extends CommonButtonProps, Vari
51
51
  size?: ButtonSizeType;
52
52
  align?: 'center' | 'spaceBetween';
53
53
  width?: 'full' | 'fit-content';
54
- leftIcon?: ButtonIconProps;
55
- rightIcon?: ButtonIconProps;
54
+ leftIcon?: {
55
+ icon: IconComponentType;
56
+ };
57
+ rightIcon?: {
58
+ icon: IconComponentType;
59
+ };
56
60
  isLoading?: boolean;
57
61
  }
58
62
  type ButtonProps = DefaultButtonProps<FillType>;
package/lib/index.js CHANGED
@@ -115,7 +115,6 @@ var style_module_default = {
115
115
  // src/components/Button/index.tsx
116
116
  var import_cva2 = require("cva");
117
117
  var import_clsx = __toESM(require("clsx"));
118
- var import_icon = require("@liner-fe/icon");
119
118
 
120
119
  // src/components/Loading/style.module.scss
121
120
  var style_module_default2 = {
@@ -336,12 +335,12 @@ var DefaultButton = (0, import_react.forwardRef)(
336
335
  fillType: buttonFillLevelIconFillTypeMap[`${fill}`][level]
337
336
  };
338
337
  const renderContent = /* @__PURE__ */ __name((children2) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: (0, import_clsx.default)(defaultButtonChildrenVariants({ size: size4 })), children: [
339
- !!leftIcon && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icon.Icon, { ...iconProps, ...leftIcon }),
338
+ !!leftIcon && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(leftIcon.icon, { ...iconProps }),
340
339
  isLoading ? !!leftIcon || !!rightIcon ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
341
340
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Loading, { size: buttonLoadingSizeMap[size4], level: buttonLoadingLevelMap[level] }),
342
341
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: style_module_default.content, children: children2 })
343
342
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Loading, { size: buttonLoadingSizeMap[size4], level: buttonLoadingLevelMap[level] }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: style_module_default.content, children: children2 }),
344
- !!rightIcon && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icon.Icon, { ...iconProps, ...rightIcon })
343
+ !!rightIcon && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(rightIcon.icon, { ...iconProps })
345
344
  ] }), "renderContent");
346
345
  if (asChild) {
347
346
  const parent = import_react.Children.only(children);
@@ -1894,7 +1893,7 @@ var Paragraph = (0, import_react4.forwardRef)(
1894
1893
  );
1895
1894
 
1896
1895
  // src/components/Toast/index.tsx
1897
- var import_icon2 = require("@liner-fe/icon");
1896
+ var import_icon = require("@liner-fe/icon");
1898
1897
  var import_recoil2 = require("recoil");
1899
1898
  var import_lottie_web = __toESM(require("lottie-web"));
1900
1899
 
@@ -2421,7 +2420,7 @@ var SingleToast = /* @__PURE__ */ __name((props) => {
2421
2420
  }, [isLoading]);
2422
2421
  const renderIcon = /* @__PURE__ */ __name(() => {
2423
2422
  if (!icon) return null;
2424
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("i", { className: style_module_default3.Icon, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_icon2.Icon, { ...icon, size: "m" }) });
2423
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("i", { className: style_module_default3.Icon, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_icon.Icon, { ...icon, size: "m" }) });
2425
2424
  }, "renderIcon");
2426
2425
  return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Root2, { className: style_module_default3.ToastRoot, open: isOpen, ...props, children: [
2427
2426
  isLoading && !toastSuccess.current ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { ref: lottieRef, style: { width: "24px", height: "24px" } }) : renderIcon(),
@@ -2697,10 +2696,10 @@ var style_module_default5 = {
2697
2696
  // src/components/Popover/index.tsx
2698
2697
  var import_cva4 = require("cva");
2699
2698
  var import_clsx8 = require("clsx");
2700
- var import_icon4 = require("@liner-fe/icon");
2699
+ var import_icon3 = require("@liner-fe/icon");
2701
2700
 
2702
2701
  // src/components/TextButton/index.tsx
2703
- var import_icon3 = require("@liner-fe/icon");
2702
+ var import_icon2 = require("@liner-fe/icon");
2704
2703
  var import_cva3 = require("cva");
2705
2704
 
2706
2705
  // src/components/TextButton/style.module.scss
@@ -2780,9 +2779,9 @@ var TextButton = (0, import_react12.forwardRef)(
2780
2779
  ...icon
2781
2780
  }), "getIconProps");
2782
2781
  const renderContent = /* @__PURE__ */ __name((children2) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: style_module_default6["text-children"], children: [
2783
- leftIcon && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_icon3.Icon, { ...getIconProps(leftIcon) }),
2782
+ leftIcon && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_icon2.Icon, { ...getIconProps(leftIcon) }),
2784
2783
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { children: children2 }),
2785
- rightIcon && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_icon3.Icon, { ...getIconProps(rightIcon) })
2784
+ rightIcon && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_icon2.Icon, { ...getIconProps(rightIcon) })
2786
2785
  ] }), "renderContent");
2787
2786
  if (asChild) {
2788
2787
  const parent = import_react12.Children.only(children);
@@ -2891,7 +2890,7 @@ var PopoverContent = React17.forwardRef(
2891
2890
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: style_module_default5.contentContainer, children: [
2892
2891
  (tag || icon || onClose) && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: style_module_default5.heading, children: [
2893
2892
  tag && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: popoverTagVariants(), children: tag }),
2894
- icon && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_icon4.Icon, { name: icon.name, size: "xs", thick: icon.thick, fill: icon.fill }),
2893
+ icon && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_icon3.Icon, { name: icon.name, size: "xs", thick: icon.thick, fill: icon.fill }),
2895
2894
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: popoverTitleVariants(), children: title }),
2896
2895
  onClose && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2897
2896
  import_radix_ui.Popover.PopoverClose,
@@ -2901,7 +2900,7 @@ var PopoverContent = React17.forwardRef(
2901
2900
  onClose();
2902
2901
  },
2903
2902
  children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2904
- import_icon4.Icon,
2903
+ import_icon3.Icon,
2905
2904
  {
2906
2905
  name: "close-fill",
2907
2906
  size: "s",
@@ -2989,7 +2988,7 @@ var Tooltip = Object.assign(TooltipRoot, {
2989
2988
  // src/components/IconButton/index.tsx
2990
2989
  var import_cva6 = require("cva");
2991
2990
  var import_react14 = require("react");
2992
- var import_icon5 = require("@liner-fe/icon");
2991
+ var import_icon4 = require("@liner-fe/icon");
2993
2992
  var import_clsx10 = __toESM(require("clsx"));
2994
2993
 
2995
2994
  // src/components/IconButton/style.module.scss
@@ -3107,7 +3106,7 @@ var IconButton = (0, import_react14.forwardRef)(
3107
3106
  "aria-label": icon.name,
3108
3107
  role: "button",
3109
3108
  children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Loading, { size: iconButtonLoadingSizeMap[size4], level: iconButtonLoadingLevelMap[level] }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
3110
- import_icon5.Icon,
3109
+ import_icon4.Icon,
3111
3110
  {
3112
3111
  size: iconButtonSizeIconSizeMap[size4],
3113
3112
  type: iconButtonLevelIconTypeMap[fill ? "fill" : "ghost"][level],
@@ -3133,7 +3132,6 @@ var style_module_default9 = {
3133
3132
 
3134
3133
  // src/components/CheckBox/index.tsx
3135
3134
  var import_react16 = require("react");
3136
- var import_icon6 = require("@liner-fe/icon");
3137
3135
  var import_clsx12 = __toESM(require("clsx"));
3138
3136
 
3139
3137
  // src/components/Label/index.tsx
@@ -3217,6 +3215,7 @@ var Label = (0, import_react15.forwardRef)(
3217
3215
  Label.displayName = "Label";
3218
3216
 
3219
3217
  // src/components/CheckBox/index.tsx
3218
+ var import_icon5 = require("@liner-fe/icon");
3220
3219
  var import_jsx_runtime24 = require("react/jsx-runtime");
3221
3220
  var Checkbox = (0, import_react16.forwardRef)(
3222
3221
  ({ className, label, description, ...props }, ref) => {
@@ -3227,7 +3226,7 @@ var Checkbox = (0, import_react16.forwardRef)(
3227
3226
  ] }),
3228
3227
  children
3229
3228
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_jsx_runtime24.Fragment, { children }), "CheckboxWrapper");
3230
- 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_icon6.Icon, { name: "check-mark", thick: true, size: "xs", type: "inverse-label-primary" }) }) }) });
3229
+ 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_icon5.IconCheckMark, { thick: true, size: "xs", type: "inverse-label-primary" }) }) }) });
3231
3230
  }
3232
3231
  );
3233
3232
 
@@ -3303,7 +3302,7 @@ var style_module_default12 = {
3303
3302
  // src/components/Textfield/index.tsx
3304
3303
  var import_cva8 = require("cva");
3305
3304
  var import_clsx14 = __toESM(require("clsx"));
3306
- var import_icon7 = require("@liner-fe/icon");
3305
+ var import_icon6 = require("@liner-fe/icon");
3307
3306
  var import_react_dom2 = require("react-dom");
3308
3307
  var import_jsx_runtime26 = require("react/jsx-runtime");
3309
3308
  var defaultTextfieldVariants = (0, import_cva8.cva)({
@@ -3456,7 +3455,7 @@ var Textfield = (0, import_react18.forwardRef)((props, ref) => {
3456
3455
  displayFooter && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: style_module_default12.footer, children: [
3457
3456
  /* @__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: [
3458
3457
  /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3459
- import_icon7.Icon,
3458
+ import_icon6.Icon,
3460
3459
  {
3461
3460
  name: "exclamationmark-fill",
3462
3461
  fill: true,
@@ -3518,7 +3517,7 @@ var style_module_default13 = {
3518
3517
  };
3519
3518
 
3520
3519
  // src/components/Select/index.tsx
3521
- var import_icon8 = require("@liner-fe/icon");
3520
+ var import_icon7 = require("@liner-fe/icon");
3522
3521
  var import_react19 = require("react");
3523
3522
  var import_clsx15 = __toESM(require("clsx"));
3524
3523
  var import_jsx_runtime27 = require("react/jsx-runtime");
@@ -3626,7 +3625,7 @@ var SelectRoot = (0, import_react19.forwardRef)(
3626
3625
  children: [
3627
3626
  /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_radix_ui7.Select.Trigger, { className: style_module_default13.trigger, ref, id, children: [
3628
3627
  /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_radix_ui7.Select.Value, { className: style_module_default13.placeholder, placeholder }),
3629
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_radix_ui7.Select.Icon, { className: style_module_default13.openIcon, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_icon8.Icon, { name: "drop-down", fill: true, thick: true, size: "xs" }) })
3628
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_radix_ui7.Select.Icon, { className: style_module_default13.openIcon, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_icon7.Icon, { name: "drop-down", fill: true, thick: true, size: "xs" }) })
3630
3629
  ] }),
3631
3630
  /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(SelectContent, { ...contentProps })
3632
3631
  ]
@@ -3647,8 +3646,8 @@ var SelectItem = /* @__PURE__ */ __name(({ value, text, disabled, icon, onClick
3647
3646
  },
3648
3647
  children: [
3649
3648
  /* @__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 }) }),
3650
- icon && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_radix_ui7.Select.Icon, { className: style_module_default13.icon, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_icon8.Icon, { size: "xs", ...icon }) }),
3651
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_radix_ui7.Select.ItemIndicator, { className: style_module_default13.itemIndicator, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_icon8.Icon, { thick: true, size: "xs", name: "check-mark", type: "brand-label-primary" }) })
3649
+ icon && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_radix_ui7.Select.Icon, { className: style_module_default13.icon, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_icon7.Icon, { size: "xs", ...icon }) }),
3650
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_radix_ui7.Select.ItemIndicator, { className: style_module_default13.itemIndicator, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_icon7.Icon, { thick: true, size: "xs", name: "check-mark", type: "brand-label-primary" }) })
3652
3651
  ]
3653
3652
  }
3654
3653
  ), "SelectItem");
@@ -3664,7 +3663,7 @@ var style_module_default14 = {
3664
3663
  };
3665
3664
 
3666
3665
  // src/components/List/index.tsx
3667
- var import_icon9 = require("@liner-fe/icon");
3666
+ var import_icon8 = require("@liner-fe/icon");
3668
3667
  var import_react21 = require("react");
3669
3668
 
3670
3669
  // src/hooks/collection.tsx
@@ -3713,7 +3712,7 @@ var Item = /* @__PURE__ */ __name(({ value, text, disabled, icon, onClick }) =>
3713
3712
  },
3714
3713
  children: [
3715
3714
  /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Paragraph, { size: 3, type: "normal", weight: "medium", children: text }),
3716
- (icon || isSelected) && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_icon9.Icon, { className: style_module_default14.icon, size: "xs", ...iconProps })
3715
+ (icon || isSelected) && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_icon8.Icon, { className: style_module_default14.icon, size: "xs", ...iconProps })
3717
3716
  ]
3718
3717
  }
3719
3718
  );
@@ -3765,7 +3764,7 @@ var useSnackbar = /* @__PURE__ */ __name(() => {
3765
3764
  }, "useSnackbar");
3766
3765
 
3767
3766
  // src/components/Snackbar/SnackbarIcon/index.tsx
3768
- var import_icon10 = require("@liner-fe/icon");
3767
+ var import_icon9 = require("@liner-fe/icon");
3769
3768
 
3770
3769
  // src/components/Snackbar/SnackbarIcon/style.module.scss
3771
3770
  var style_module_default16 = {
@@ -3777,11 +3776,11 @@ var import_jsx_runtime30 = require("react/jsx-runtime");
3777
3776
  var SnackbarIcon = /* @__PURE__ */ __name((props) => {
3778
3777
  const { icon } = props;
3779
3778
  if (!icon) return null;
3780
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_icon10.Icon, { ...icon, size: "m", className: style_module_default16.container });
3779
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_icon9.Icon, { ...icon, size: "m", className: style_module_default16.container });
3781
3780
  }, "SnackbarIcon");
3782
3781
 
3783
3782
  // src/components/Snackbar/index.tsx
3784
- var import_icon11 = require("@liner-fe/icon");
3783
+ var import_icon10 = require("@liner-fe/icon");
3785
3784
 
3786
3785
  // src/components/Snackbar/SnackbarTitle/index.tsx
3787
3786
  var import_jsx_runtime31 = require("react/jsx-runtime");
@@ -3913,7 +3912,7 @@ var SingleSnackbar = /* @__PURE__ */ __name((props) => {
3913
3912
  /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SnackbarDescription, { description })
3914
3913
  ] }),
3915
3914
  /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
3916
- import_icon11.IconArrowForward,
3915
+ import_icon10.IconArrowForward,
3917
3916
  {
3918
3917
  fill: true,
3919
3918
  thick: true,
@@ -8306,7 +8305,7 @@ var style_module_default21 = {
8306
8305
 
8307
8306
  // src/components/coach-mark/main/index.tsx
8308
8307
  var import_react28 = require("react");
8309
- var import_icon12 = require("@liner-fe/icon");
8308
+ var import_icon11 = require("@liner-fe/icon");
8310
8309
  var import_cva12 = require("cva");
8311
8310
  var import_clsx22 = __toESM(require("clsx"));
8312
8311
 
@@ -8481,7 +8480,7 @@ var CoachMarkContent = (0, import_react28.forwardRef)(
8481
8480
  }
8482
8481
  ),
8483
8482
  icon && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
8484
- import_icon12.Icon,
8483
+ import_icon11.Icon,
8485
8484
  {
8486
8485
  name: icon.name,
8487
8486
  size: "xs",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liner-fe/prism",
3
- "version": "2.7.16",
3
+ "version": "2.8.0",
4
4
  "scripts": {
5
5
  "dev": "next dev",
6
6
  "start": "next start",