@liner-fe/prism 2.7.16 → 2.8.1

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';
@@ -43,7 +43,7 @@ type FillLevelType = 'primary' | 'secondary' | 'tertiary' | 'quaternary' | 'quin
43
43
  type FillFalseLevelType = 'primary' | 'secondary';
44
44
  type ButtonSizeType = 'cta' | 'l' | 'm' | 's';
45
45
  type DefaultLevelType<T> = T extends true ? FillLevelType : FillFalseLevelType;
46
- type ButtonIconProps = Exclude<IconProps, 'size' | 'thick'>;
46
+ type ButtonIconProps$1 = Pick<IconProps, 'type' | 'size' | 'thick'>;
47
47
  interface DefaultButtonProps<T extends FillType> extends CommonButtonProps, VariantProps<typeof defaultButtonVariants> {
48
48
  asChild?: boolean;
49
49
  level?: DefaultLevelType<T>;
@@ -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
+ } & ButtonIconProps$1;
57
+ rightIcon?: {
58
+ icon: IconComponentType;
59
+ } & ButtonIconProps$1;
56
60
  isLoading?: boolean;
57
61
  }
58
62
  type ButtonProps = DefaultButtonProps<FillType>;
@@ -477,6 +481,7 @@ interface LabelProps extends ComponentPropsWithoutRef<typeof Label$1.Root>, Vari
477
481
  }
478
482
  declare const Label: react.ForwardRefExoticComponent<LabelProps & react.RefAttributes<HTMLLabelElement>>;
479
483
 
484
+ type ButtonIconProps = Exclude<IconProps, 'size' | 'thick'>;
480
485
  declare const textButtonVariants: (props?: ({
481
486
  level?: "primary" | "secondary" | "tertiary" | "inverse-static" | "inverse" | undefined;
482
487
  size?: "m" | "s" | undefined;
@@ -627,4 +632,4 @@ interface TagProps extends Omit<IPropsNormalBold, 'type' | 'size' | 'weight'> {
627
632
  }
628
633
  declare const Tag: react.ForwardRefExoticComponent<TagProps & react.RefAttributes<HTMLParagraphElement>>;
629
634
 
630
- export { type BaseCoachMarkContentProps, type BreakPointsKey, Button, type ButtonIconProps, type ButtonProps, type ButtonSizeType, Caption, Checkbox, CoachMark, type CoachMarkContentProps, type CommonButtonProps, CompactCoachMark, DefaultButton, type DefaultButtonProps, Display, type FillFalseLevelType, type FillLevelType, type FillType, Heading, type ICaptionProps, type IDisplayProps, type IHeadingProps, type IPropsAccent, type IPropsAnswer, type IPropsNormal, type IPropsNormalBold, type IPropsPost, type ITitleProps, IconButton, type IconButtonLevelType, type IconButtonProps, type IconSizeType, type ItemProps, Label, List, Loading, Logo, Media, MediaContextProvider, Paragraph, type ParagraphProps, Popover, type PopoverContentProps, PrimitiveCoachMark, type PrimitiveCoachMarkContentProps, type PrimitiveCoachMarkRootProps, Radio, Select, type SelectItemProps, type SelectProps, SingleSnackbar, Snackbar, Tag, TextButton, type TextButtonProps, Textfield, type TextfieldButtonProps, type TextfieldLabelType, type TextfieldProps, Title, Toaster, Tooltip, Typography, arrayToStyleObject, isEmptyObject, objectToArray, rootMediaStyle, snackbarAtom, useSnackbar, useToast };
635
+ export { type BaseCoachMarkContentProps, type BreakPointsKey, Button, type ButtonIconProps$1 as ButtonIconProps, type ButtonProps, type ButtonSizeType, Caption, Checkbox, CoachMark, type CoachMarkContentProps, type CommonButtonProps, CompactCoachMark, DefaultButton, type DefaultButtonProps, Display, type FillFalseLevelType, type FillLevelType, type FillType, Heading, type ICaptionProps, type IDisplayProps, type IHeadingProps, type IPropsAccent, type IPropsAnswer, type IPropsNormal, type IPropsNormalBold, type IPropsPost, type ITitleProps, IconButton, type IconButtonLevelType, type IconButtonProps, type IconSizeType, type ItemProps, Label, List, Loading, Logo, Media, MediaContextProvider, Paragraph, type ParagraphProps, Popover, type PopoverContentProps, PrimitiveCoachMark, type PrimitiveCoachMarkContentProps, type PrimitiveCoachMarkRootProps, Radio, Select, type SelectItemProps, type SelectProps, SingleSnackbar, Snackbar, Tag, TextButton, type TextButtonProps, Textfield, type TextfieldButtonProps, type TextfieldLabelType, type TextfieldProps, Title, Toaster, Tooltip, Typography, arrayToStyleObject, isEmptyObject, objectToArray, rootMediaStyle, snackbarAtom, useSnackbar, useToast };
package/lib/index.js CHANGED
@@ -336,12 +336,12 @@ var DefaultButton = (0, import_react.forwardRef)(
336
336
  fillType: buttonFillLevelIconFillTypeMap[`${fill}`][level]
337
337
  };
338
338
  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 }),
339
+ !!leftIcon && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(leftIcon.icon, { ...iconProps, ...leftIcon }),
340
340
  isLoading ? !!leftIcon || !!rightIcon ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
341
341
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Loading, { size: buttonLoadingSizeMap[size4], level: buttonLoadingLevelMap[level] }),
342
342
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: style_module_default.content, children: children2 })
343
343
  ] }) : /* @__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 })
344
+ !!rightIcon && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(rightIcon.icon, { ...iconProps, ...leftIcon })
345
345
  ] }), "renderContent");
346
346
  if (asChild) {
347
347
  const parent = import_react.Children.only(children);
@@ -3133,7 +3133,6 @@ var style_module_default9 = {
3133
3133
 
3134
3134
  // src/components/CheckBox/index.tsx
3135
3135
  var import_react16 = require("react");
3136
- var import_icon6 = require("@liner-fe/icon");
3137
3136
  var import_clsx12 = __toESM(require("clsx"));
3138
3137
 
3139
3138
  // src/components/Label/index.tsx
@@ -3217,6 +3216,7 @@ var Label = (0, import_react15.forwardRef)(
3217
3216
  Label.displayName = "Label";
3218
3217
 
3219
3218
  // src/components/CheckBox/index.tsx
3219
+ var import_icon6 = require("@liner-fe/icon");
3220
3220
  var import_jsx_runtime24 = require("react/jsx-runtime");
3221
3221
  var Checkbox = (0, import_react16.forwardRef)(
3222
3222
  ({ className, label, description, ...props }, ref) => {
@@ -3227,7 +3227,7 @@ var Checkbox = (0, import_react16.forwardRef)(
3227
3227
  ] }),
3228
3228
  children
3229
3229
  ] }) : /* @__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" }) }) }) });
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.IconCheckMark, { thick: true, size: "xs", type: "inverse-label-primary" }) }) }) });
3231
3231
  }
3232
3232
  );
3233
3233
 
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.1",
4
4
  "scripts": {
5
5
  "dev": "next dev",
6
6
  "start": "next start",