@liner-fe/prism 4.0.1 → 4.0.3

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
@@ -16,7 +16,7 @@ export { Box, BoxProps, Container, ContainerProps, Flex, FlexProps, Grid, GridPr
16
16
  declare const objectToArray: <T extends Record<string, unknown>>(obj: T) => [keyof T, T[keyof T]][];
17
17
  declare const arrayToStyleObject: <T extends SystemKeys>(colorKeys: T[], style: {
18
18
  readonly [key: string]: string;
19
- }, prefix?: string) => Partial<Record<"surface-neutral-lowest" | "surface-neutral-lowest-hover" | "surface-neutral-low" | "surface-neutral-low-hover" | "surface-neutral-mid" | "surface-neutral-mid-hover" | "surface-neutral-high" | "surface-neutral-high-hover" | "surface-neutral-highest" | "surface-neutral-static-lowest" | "surface-neutral-static-lowest-hover" | "surface-neutral-variation-lowest" | "control-fill-neutral-lowest" | "control-fill-neutral-lowest-hover" | "control-fill-neutral-low" | "control-fill-neutral-low-hover" | "control-fill-neutral-mid" | "control-fill-neutral-mid-hover" | "control-fill-neutral-high" | "control-fill-neutral-high-hover" | "control-fill-neutral-highest" | "label-neutral-base" | "label-neutral-secondary" | "label-neutral-tertiary" | "label-neutral-quaternary" | "label-neutral-static" | "border-neutral-alpha-strong" | "border-neutral-alpha-normal" | "border-neutral-alpha-subtle" | "border-neutral-alpha-hint" | "border-neutral-strong" | "border-neutral-normal" | "border-neutral-subtle" | "surface-inverse-lowest" | "surface-inverse-lowest-hover" | "surface-inverse-low" | "surface-inverse-low-hover" | "surface-inverse-mid" | "surface-inverse-mid-hover" | "surface-inverse-high" | "surface-inverse-high-hover" | "surface-inverse-static-high" | "surface-inverse-static-high-hover" | "surface-inverse-highest" | "label-on-inverse-base" | "label-on-inverse-secondary" | "label-on-inverse-tertiary" | "label-on-inverse-quaternary" | "label-on-inverse-static-base" | "label-on-inverse-static-secondary" | "border-on-inverse-alpha-strong" | "border-on-inverse-alpha-normal" | "border-on-inverse-alpha-subtle" | "border-on-inverse-alpha-hint" | "border-on-inverse-strong" | "border-on-inverse-normal" | "border-on-inverse-subtle" | "control-fill-brand" | "control-fill-brand-hover" | "control-fill-brand-strong" | "control-fill-brand-faint" | "control-fill-brand-faint-hover" | "label-brand-base" | "label-brand-secondary" | "border-brand-normal" | "border-brand-strong" | "label-on-brand" | "brandinverse-fill-static-low" | "brandinverse-fill-static-low-hover" | "accent-label-base" | "accent-label-yellow" | "accent-label-mint" | "accent-label-cyan" | "accent-label-purple" | "accent-label-pink" | "accent-control-fill-base" | "positive-strong" | "negative-strong" | "negative-strong-hover" | "caution" | "highlight" | "control-fill-selected" | "control-fill-drag" | "positive-faint" | "negative-faint" | "positive-base" | "negative-base" | "link" | "overlay-dim" | "background-default" | "background-subtle" | "control-fill-neutral-opaque-lowest" | "control-fill-neutral-opaque-lowest-hover" | "control-fill-neutral-opaque-low" | "control-fill-neutral-opaque-low-hover" | "control-fill-neutral-opaque-static-lowest" | "control-fill-neutral-lowest-pressed" | "control-fill-neutral-low-pressed" | "control-fill-neutral-mid-pressed" | "control-fill-neutral-high-pressed" | "control-fill-brand-pressed" | "control-fill-brand-faint-pressed" | "surface-neutral-lowest-pressed" | "surface-neutral-low-pressed" | "surface-neutral-mid-pressed" | "surface-neutral-static-lowest-pressed" | "surface-inverse-lowest-pressed" | "surface-inverse-low-pressed" | "surface-inverse-mid-pressed" | "surface-inverse-high-pressed" | "negative-strong-pressed" | "focus", string>>;
19
+ }, prefix?: string) => Partial<Record<"surface-neutral-lowest" | "surface-neutral-lowest-hover" | "surface-neutral-low" | "surface-neutral-low-hover" | "surface-neutral-mid" | "surface-neutral-mid-hover" | "surface-neutral-high" | "surface-neutral-high-hover" | "surface-neutral-highest" | "surface-neutral-static-lowest" | "surface-neutral-static-lowest-hover" | "surface-neutral-variation-lowest" | "control-fill-neutral-lowest" | "control-fill-neutral-lowest-hover" | "control-fill-neutral-low" | "control-fill-neutral-low-hover" | "control-fill-neutral-mid" | "control-fill-neutral-mid-hover" | "control-fill-neutral-high" | "control-fill-neutral-high-hover" | "control-fill-neutral-highest" | "label-neutral-base" | "label-neutral-secondary" | "label-neutral-tertiary" | "label-neutral-quaternary" | "label-neutral-static" | "label-neutral-static-secondary" | "border-neutral-alpha-strong" | "border-neutral-alpha-normal" | "border-neutral-alpha-subtle" | "border-neutral-alpha-hint" | "border-neutral-strong" | "border-neutral-normal" | "border-neutral-subtle" | "surface-inverse-lowest" | "surface-inverse-lowest-hover" | "surface-inverse-low" | "surface-inverse-low-hover" | "surface-inverse-mid" | "surface-inverse-mid-hover" | "surface-inverse-high" | "surface-inverse-high-hover" | "surface-inverse-static-high" | "surface-inverse-static-high-hover" | "surface-inverse-highest" | "label-on-inverse-base" | "label-on-inverse-secondary" | "label-on-inverse-tertiary" | "label-on-inverse-quaternary" | "label-on-inverse-static-base" | "label-on-inverse-static-secondary" | "border-on-inverse-alpha-strong" | "border-on-inverse-alpha-normal" | "border-on-inverse-alpha-subtle" | "border-on-inverse-alpha-hint" | "border-on-inverse-strong" | "border-on-inverse-normal" | "border-on-inverse-subtle" | "control-fill-brand" | "control-fill-brand-hover" | "control-fill-brand-strong" | "control-fill-brand-faint" | "control-fill-brand-faint-hover" | "label-brand-base" | "label-brand-secondary" | "border-brand-normal" | "border-brand-strong" | "label-on-brand" | "brandinverse-fill-static-low" | "brandinverse-fill-static-low-hover" | "accent-label-base" | "accent-label-yellow" | "accent-label-mint" | "accent-label-cyan" | "accent-label-purple" | "accent-label-pink" | "accent-control-fill-base" | "positive-strong" | "negative-strong" | "negative-strong-hover" | "caution" | "caution-strong" | "caution-base" | "caution-faint" | "highlight" | "control-fill-selected" | "control-fill-drag" | "positive-faint" | "negative-faint" | "positive-base" | "negative-base" | "link" | "overlay-dim" | "background-default" | "background-subtle" | "control-fill-neutral-opaque-lowest" | "control-fill-neutral-opaque-lowest-hover" | "control-fill-neutral-opaque-low" | "control-fill-neutral-opaque-low-hover" | "control-fill-neutral-opaque-static-lowest" | "control-fill-neutral-lowest-pressed" | "control-fill-neutral-low-pressed" | "control-fill-neutral-mid-pressed" | "control-fill-neutral-high-pressed" | "control-fill-brand-pressed" | "control-fill-brand-faint-pressed" | "surface-neutral-lowest-pressed" | "surface-neutral-low-pressed" | "surface-neutral-mid-pressed" | "surface-neutral-static-lowest-pressed" | "surface-inverse-lowest-pressed" | "surface-inverse-low-pressed" | "surface-inverse-mid-pressed" | "surface-inverse-high-pressed" | "negative-strong-pressed" | "focus", string>>;
20
20
  declare const isEmptyObject: (obj: object) => boolean;
21
21
 
22
22
  declare const DEFAULT_LEVEL_OPTIONS: readonly ["primary", "secondary", "tertiary", "quaternary", "quinary", "negative", "static", "inverse-static"];
package/lib/index.js CHANGED
@@ -190,6 +190,16 @@ var buttonFillLevelIconTypeMap = {
190
190
  static: "label-neutral-static",
191
191
  "inverse-static": "label-on-inverse-static-base"
192
192
  };
193
+ var buttonDisabledIconTypeMap = {
194
+ primary: "label-neutral-tertiary",
195
+ secondary: "label-neutral-tertiary",
196
+ tertiary: "label-neutral-tertiary",
197
+ quaternary: "label-neutral-tertiary",
198
+ quinary: "label-neutral-quaternary",
199
+ negative: "label-neutral-tertiary",
200
+ static: "label-neutral-tertiary",
201
+ "inverse-static": "label-on-inverse-tertiary"
202
+ };
193
203
  var defaultButtonVariants = cva2({
194
204
  base: style_module_default.button,
195
205
  variants: {
@@ -250,13 +260,14 @@ var DefaultButton = forwardRef(
250
260
  disabled,
251
261
  ...rest
252
262
  }, ref) => {
263
+ const isLoadingWithDisabled = isLoading && disabled;
264
+ const isLoadingOrDisabled = isLoading || disabled;
265
+ const isDisabledStyle = !!disabled && !isLoading;
253
266
  const iconProps = {
254
267
  size: buttonIconSizeMap[size],
255
- type: buttonFillLevelIconTypeMap[level],
268
+ type: isDisabledStyle ? buttonDisabledIconTypeMap[level] : buttonFillLevelIconTypeMap[level],
256
269
  fillType: fillTypeMap[level]
257
270
  };
258
- const isLoadingWithDisabled = isLoading && disabled;
259
- const isLoadingOrDisabled = isLoading || disabled;
260
271
  const renderContent = /* @__PURE__ */ __name((children2) => /* @__PURE__ */ jsxs2("span", { className: clsx(defaultButtonChildrenVariants({ size })), children: [
261
272
  !!leftIcon && /* @__PURE__ */ jsx2(
262
273
  leftIcon.icon,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liner-fe/prism",
3
- "version": "4.0.1",
3
+ "version": "4.0.3",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "dependencies": {
@@ -21,9 +21,9 @@
21
21
  "react-dom": "^19.1.0",
22
22
  "sonner": "2.0.7",
23
23
  "vaul": "1.1.2",
24
- "@liner-fe/design-token": "^4.0.0",
25
- "@liner-fe/design-token-primitive": "^1.0.0",
26
- "@liner-fe/icon": "^2.0.27"
24
+ "@liner-fe/design-token": "^4.1.1",
25
+ "@liner-fe/design-token-primitive": "^1.1.1",
26
+ "@liner-fe/icon": "^2.0.28"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@chromatic-com/storybook": "^1.5.0",