@lobehub/ui 6.10.0 → 6.10.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/es/Accordion/style.d.mts +1 -1
- package/es/Button/Button.mjs +22 -2
- package/es/Button/Button.mjs.map +1 -1
- package/es/Button/style.d.mts +22 -4
- package/es/Button/style.mjs +24 -4
- package/es/Button/style.mjs.map +1 -1
- package/es/Text/style.d.mts +1 -1
- package/es/style.css +14 -2
- package/package.json +1 -1
package/es/Accordion/style.d.mts
CHANGED
package/es/Button/Button.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import Icon from "../Icon/Icon.mjs";
|
|
|
7
7
|
import { buttonClasses } from "./stable.mjs";
|
|
8
8
|
import { styles } from "./style.mjs";
|
|
9
9
|
import clsx$1 from "clsx";
|
|
10
|
-
import { isValidElement } from "react";
|
|
10
|
+
import { isValidElement, useLayoutEffect, useRef, useState } from "react";
|
|
11
11
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
12
12
|
import * as stylex from "@stylexjs/stylex";
|
|
13
13
|
// src/Button/Button.tsx
|
|
@@ -53,6 +53,21 @@ const motionTransition = {
|
|
|
53
53
|
};
|
|
54
54
|
const ButtonImpl = ({ block, children, className, classNames, danger = false, disabled, outdent, ghost = false, href, htmlType = "button", icon, iconPosition = "start", loading, onClick, ref, shape = "default", size = "middle", stableData, styles: userStyles, target, type = "default", xstyle, ...rest }) => {
|
|
55
55
|
const Motion = useMotionComponent();
|
|
56
|
+
const spinnerRef = useRef(null);
|
|
57
|
+
const spinnerVisualRef = useRef(null);
|
|
58
|
+
const [spinnerPresent, setSpinnerPresent] = useState(!!loading);
|
|
59
|
+
if (loading && !spinnerPresent) setSpinnerPresent(true);
|
|
60
|
+
useLayoutEffect(() => {
|
|
61
|
+
if (loading || !spinnerPresent) return;
|
|
62
|
+
const exits = [...spinnerRef.current?.getAnimations?.() ?? [], ...spinnerVisualRef.current?.getAnimations?.() ?? []].filter((animation) => "transitionProperty" in animation);
|
|
63
|
+
let canceled = false;
|
|
64
|
+
Promise.allSettled(exits.map((animation) => animation.finished)).then(() => {
|
|
65
|
+
if (!canceled) setSpinnerPresent(false);
|
|
66
|
+
});
|
|
67
|
+
return () => {
|
|
68
|
+
canceled = true;
|
|
69
|
+
};
|
|
70
|
+
}, [loading, spinnerPresent]);
|
|
56
71
|
const isInteractionDisabled = disabled || loading;
|
|
57
72
|
const sizeCls = resolveSizeCls(size);
|
|
58
73
|
const variantCls = resolveVariantCls({
|
|
@@ -86,13 +101,18 @@ const ButtonImpl = ({ block, children, className, classNames, danger = false, di
|
|
|
86
101
|
});
|
|
87
102
|
const spinnerNode = /* @__PURE__ */ jsx("span", {
|
|
88
103
|
"aria-hidden": !loading,
|
|
104
|
+
ref: spinnerRef,
|
|
89
105
|
...styleProps([
|
|
90
106
|
styles.iconBox,
|
|
91
107
|
styles.spinnerSlot,
|
|
92
108
|
iconPosition === "end" && styles.spinnerSlotEnd,
|
|
93
109
|
loading && styles.spinnerSlotShow
|
|
94
110
|
], clsx$1(buttonClasses("spinner"), classNames?.icon), userStyles?.icon),
|
|
95
|
-
children: /* @__PURE__ */ jsx("span", {
|
|
111
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
112
|
+
ref: spinnerVisualRef,
|
|
113
|
+
...stylex.props(styles.spinnerVisual, loading && styles.spinnerVisualShow),
|
|
114
|
+
children: (loading || spinnerPresent) && /* @__PURE__ */ jsx("span", { ...stylex.props(styles.spinner) })
|
|
115
|
+
})
|
|
96
116
|
});
|
|
97
117
|
const iconNode = icon && !loading ? /* @__PURE__ */ jsx("span", {
|
|
98
118
|
...styleProps(styles.iconBox, clsx$1(buttonClasses("icon"), classNames?.icon), userStyles?.icon),
|
package/es/Button/Button.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.mjs","names":["clsx"],"sources":["../../src/Button/Button.tsx"],"sourcesContent":["'use client';\n\nimport * as stylex from '@stylexjs/stylex';\nimport clsx from 'clsx';\nimport {\n isValidElement,\n type MouseEvent,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from 'react';\n\nimport Icon, { type IconProps } from '@/Icon';\nimport { useMotionComponent } from '@/MotionProvider';\nimport { focusRing } from '@/styles/stylex/focusRing';\nimport { styleProps } from '@/styles/stylex/props';\nimport { toDataAttributes } from '@/utils/bem';\n\nimport { buttonClasses } from './stable';\nimport { styles } from './style';\nimport type { ButtonOutdent, ButtonProps, ButtonType } from './type';\n\nconst resolveIconNode = (node: ReactNode | IconProps['icon'] | undefined | null) => {\n if (node === undefined || node === null) return null;\n if (isValidElement(node) || typeof node === 'string' || typeof node === 'number') {\n return node;\n }\n return <Icon icon={node as any} size={'small'} />;\n};\n\nconst resolveSizeCls = (size: ButtonProps['size']) => {\n if (size === 'small') return styles.sizeSmall;\n if (size === 'large') return styles.sizeLarge;\n return styles.sizeMiddle;\n};\n\nconst resolveIconOnlySizeCls = (size: ButtonProps['size']) => {\n if (size === 'small') return styles.iconOnlySmall;\n if (size === 'large') return styles.iconOnlyLarge;\n return styles.iconOnlyMiddle;\n};\n\nconst resolveVariantCls = ({\n danger,\n ghost,\n type,\n}: {\n danger: boolean;\n ghost: boolean;\n type: NonNullable<ButtonProps['type']>;\n}) => {\n // `text` and `link` already drop the surface, so `ghost` there would only cost them\n // their own traits (link's zero inline padding).\n if (ghost && type !== 'text' && type !== 'link') {\n if (danger) return styles.ghostDanger;\n if (type === 'primary') return styles.ghostPrimary;\n return styles.ghostDefault;\n }\n\n switch (type) {\n case 'primary': {\n return danger ? styles.dangerSolid : styles.variantPrimary;\n }\n case 'dashed': {\n return danger ? [styles.variantDashed, styles.dangerOutlined] : styles.variantDashed;\n }\n case 'fill': {\n return danger ? styles.dangerFill : styles.variantFill;\n }\n case 'text': {\n return danger ? [styles.variantText, styles.dangerText] : styles.variantText;\n }\n case 'link': {\n return danger ? [styles.variantLink, styles.dangerInline] : styles.variantLink;\n }\n default: {\n return danger ? [styles.variantDefault, styles.dangerOutlined] : styles.variantDefault;\n }\n }\n};\n\nconst tapAnim = { scale: 0.98 };\nconst motionTransition = {\n damping: 26,\n mass: 0.6,\n stiffness: 600,\n type: 'spring' as const,\n};\n\ntype ButtonImplProps = Omit<ButtonProps, 'outdent' | 'type'> & {\n outdent?: ButtonOutdent;\n stableData?: Record<`data-${string}`, string>;\n type?: ButtonType;\n xstyle?: Parameters<typeof styleProps>[0];\n};\n\nconst ButtonImpl = ({\n block,\n children,\n className,\n classNames,\n danger = false,\n disabled,\n outdent,\n ghost = false,\n href,\n htmlType = 'button',\n icon,\n iconPosition = 'start',\n loading,\n onClick,\n ref,\n shape = 'default',\n size = 'middle',\n stableData,\n styles: userStyles,\n target,\n type = 'default',\n xstyle,\n ...rest\n}: ButtonImplProps) => {\n const Motion = useMotionComponent();\n const isInteractionDisabled = disabled || loading;\n const sizeCls = resolveSizeCls(size);\n const variantCls = resolveVariantCls({ danger, ghost, type });\n const shapeCls =\n shape === 'circle' ? styles.shapeCircle : shape === 'round' ? styles.shapeRound : undefined;\n\n const hasChildren =\n children !== undefined && children !== null && children !== false && children !== '';\n const renderIcon = loading || icon;\n const iconOnly = !hasChildren && !!renderIcon;\n const iconOnlySizeCls = iconOnly ? resolveIconOnlySizeCls(size) : undefined;\n\n const outdentCls =\n type === 'text' && outdent\n ? outdent === 'end'\n ? styles.outdentEnd\n : styles.outdentStart\n : undefined;\n\n const composedClassName = styleProps(\n [\n styles.base,\n focusRing.info,\n sizeCls,\n variantCls,\n shapeCls,\n block && styles.block,\n iconPosition === 'end' && styles.iconEnd,\n iconOnlySizeCls,\n outdentCls,\n xstyle,\n ],\n clsx(buttonClasses(), className),\n ).className;\n\n const dataAttributes =\n stableData ?? toDataAttributes({ block, danger, ghost, loading, shape, size, type });\n\n const spinnerNode = (\n <span\n aria-hidden={!loading}\n {...styleProps(\n [\n styles.iconBox,\n styles.spinnerSlot,\n iconPosition === 'end' && styles.spinnerSlotEnd,\n loading && styles.spinnerSlotShow,\n ],\n clsx(buttonClasses('spinner'), classNames?.icon),\n userStyles?.icon,\n )}\n >\n <span {...stylex.props(styles.spinner)} />\n </span>\n );\n\n const iconNode =\n icon && !loading ? (\n <span\n {...styleProps(\n styles.iconBox,\n clsx(buttonClasses('icon'), classNames?.icon),\n userStyles?.icon,\n )}\n >\n {resolveIconNode(icon)}\n </span>\n ) : null;\n\n const inner = (\n <>\n {spinnerNode}\n {iconNode}\n {children}\n </>\n );\n\n const motionGestures = isInteractionDisabled\n ? {}\n : { transition: motionTransition, whileTap: tapAnim };\n\n if (href !== undefined) {\n const handleAnchorClick = (e: MouseEvent<HTMLAnchorElement>) => {\n if (isInteractionDisabled) {\n e.preventDefault();\n return;\n }\n onClick?.(e as unknown as MouseEvent<HTMLButtonElement>);\n };\n\n return (\n <Motion.a\n aria-busy={loading || undefined}\n aria-disabled={isInteractionDisabled || undefined}\n href={disabled ? undefined : href}\n target={target}\n {...dataAttributes}\n {...(rest as any)}\n className={composedClassName}\n ref={ref as Ref<HTMLAnchorElement>}\n onClick={handleAnchorClick}\n {...motionGestures}\n >\n {inner}\n </Motion.a>\n );\n }\n\n const handleButtonClick = (e: MouseEvent<HTMLButtonElement>) => {\n if (isInteractionDisabled) {\n e.preventDefault();\n return;\n }\n onClick?.(e);\n };\n\n return (\n <Motion.button\n type={htmlType}\n {...dataAttributes}\n {...(rest as any)}\n aria-busy={loading || undefined}\n aria-disabled={isInteractionDisabled || undefined}\n className={composedClassName}\n disabled={disabled}\n ref={ref as Ref<HTMLButtonElement>}\n onClick={handleButtonClick}\n {...motionGestures}\n >\n {inner}\n </Motion.button>\n );\n};\n\nButtonImpl.displayName = 'BaseButton';\n\nexport { ButtonImpl };\n\nconst Button = ButtonImpl as <T extends ButtonType = 'default'>(\n props: ButtonProps<T>,\n) => ReactElement;\n\nexport default Button;\n"],"mappings":";;;;;;;;;;;;;AAaA,MAAM,mBAAmB,SAA2D;CAClF,IAAI,SAAS,KAAA,KAAa,SAAS,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,EAAA,UAAA;EACT;EACA;EACA;CACD,EAAA,CAAA;CACJ,MAAM,iBAAiB,wBAAwB,CAAC,IAAI;EAClD,YAAY;EACZ,UAAU;CACZ;CACA,IAAI,SAAS,KAAA,GAAW;EACtB,MAAM,qBAAqB,MAAqC;GAC9D,IAAI,uBAAuB;IACzB,EAAE,eAAe;IACjB;GACF;GACA,UAAU,CAA6C;EACzD;EACA,OAAO,oBAAC,OAAO,GAAR;GAAU,aAAW,WAAW,KAAA;GAAW,iBAAe,yBAAyB,KAAA;GAAW,MAAM,WAAW,KAAA,IAAY;GAAc;GAAQ,GAAI;GAAgB,GAAI;GAAa,WAAW;GAAwB;GAA+B,SAAS;GAAmB,GAAI;GAC1R,UAAA;EACO,CAAA;CACd;CACA,MAAM,qBAAqB,MAAqC;EAC9D,IAAI,uBAAuB;GACzB,EAAE,eAAe;GACjB;EACF;EACA,UAAU,CAAC;CACb;CACA,OAAO,oBAAC,OAAO,QAAR;EAAe,MAAM;EAAU,GAAI;EAAgB,GAAI;EAAa,aAAW,WAAW,KAAA;EAAW,iBAAe,yBAAyB,KAAA;EAAW,WAAW;EAA6B;EAAe;EAA+B,SAAS;EAAmB,GAAI;EAChR,UAAA;CACY,CAAA;AACnB;AACA,WAAW,cAAc;AAEzB,MAAM,SAAS"}
|
|
1
|
+
{"version":3,"file":"Button.mjs","names":["clsx"],"sources":["../../src/Button/Button.tsx"],"sourcesContent":["'use client';\n\nimport * as stylex from '@stylexjs/stylex';\nimport clsx from 'clsx';\nimport {\n isValidElement,\n type MouseEvent,\n type ReactElement,\n type ReactNode,\n type Ref,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\n\nimport Icon, { type IconProps } from '@/Icon';\nimport { useMotionComponent } from '@/MotionProvider';\nimport { focusRing } from '@/styles/stylex/focusRing';\nimport { styleProps } from '@/styles/stylex/props';\nimport { toDataAttributes } from '@/utils/bem';\n\nimport { buttonClasses } from './stable';\nimport { styles } from './style';\nimport type { ButtonOutdent, ButtonProps, ButtonType } from './type';\n\nconst resolveIconNode = (node: ReactNode | IconProps['icon'] | undefined | null) => {\n if (node === undefined || node === null) return null;\n if (isValidElement(node) || typeof node === 'string' || typeof node === 'number') {\n return node;\n }\n return <Icon icon={node as any} size={'small'} />;\n};\n\nconst resolveSizeCls = (size: ButtonProps['size']) => {\n if (size === 'small') return styles.sizeSmall;\n if (size === 'large') return styles.sizeLarge;\n return styles.sizeMiddle;\n};\n\nconst resolveIconOnlySizeCls = (size: ButtonProps['size']) => {\n if (size === 'small') return styles.iconOnlySmall;\n if (size === 'large') return styles.iconOnlyLarge;\n return styles.iconOnlyMiddle;\n};\n\nconst resolveVariantCls = ({\n danger,\n ghost,\n type,\n}: {\n danger: boolean;\n ghost: boolean;\n type: NonNullable<ButtonProps['type']>;\n}) => {\n // `text` and `link` already drop the surface, so `ghost` there would only cost them\n // their own traits (link's zero inline padding).\n if (ghost && type !== 'text' && type !== 'link') {\n if (danger) return styles.ghostDanger;\n if (type === 'primary') return styles.ghostPrimary;\n return styles.ghostDefault;\n }\n\n switch (type) {\n case 'primary': {\n return danger ? styles.dangerSolid : styles.variantPrimary;\n }\n case 'dashed': {\n return danger ? [styles.variantDashed, styles.dangerOutlined] : styles.variantDashed;\n }\n case 'fill': {\n return danger ? styles.dangerFill : styles.variantFill;\n }\n case 'text': {\n return danger ? [styles.variantText, styles.dangerText] : styles.variantText;\n }\n case 'link': {\n return danger ? [styles.variantLink, styles.dangerInline] : styles.variantLink;\n }\n default: {\n return danger ? [styles.variantDefault, styles.dangerOutlined] : styles.variantDefault;\n }\n }\n};\n\nconst tapAnim = { scale: 0.98 };\nconst motionTransition = {\n damping: 26,\n mass: 0.6,\n stiffness: 600,\n type: 'spring' as const,\n};\n\ntype ButtonImplProps = Omit<ButtonProps, 'outdent' | 'type'> & {\n outdent?: ButtonOutdent;\n stableData?: Record<`data-${string}`, string>;\n type?: ButtonType;\n xstyle?: Parameters<typeof styleProps>[0];\n};\n\nconst ButtonImpl = ({\n block,\n children,\n className,\n classNames,\n danger = false,\n disabled,\n outdent,\n ghost = false,\n href,\n htmlType = 'button',\n icon,\n iconPosition = 'start',\n loading,\n onClick,\n ref,\n shape = 'default',\n size = 'middle',\n stableData,\n styles: userStyles,\n target,\n type = 'default',\n xstyle,\n ...rest\n}: ButtonImplProps) => {\n const Motion = useMotionComponent();\n const spinnerRef = useRef<HTMLSpanElement>(null);\n const spinnerVisualRef = useRef<HTMLSpanElement>(null);\n const [spinnerPresent, setSpinnerPresent] = useState(!!loading);\n\n if (loading && !spinnerPresent) setSpinnerPresent(true);\n\n useLayoutEffect(() => {\n if (loading || !spinnerPresent) return;\n\n // Wait for both exit layers, never the child's infinite rotation.\n const exits = [\n ...(spinnerRef.current?.getAnimations?.() ?? []),\n ...(spinnerVisualRef.current?.getAnimations?.() ?? []),\n ].filter((animation) => 'transitionProperty' in animation);\n let canceled = false;\n Promise.allSettled(exits.map((animation) => animation.finished)).then(() => {\n if (!canceled) setSpinnerPresent(false);\n });\n return () => {\n canceled = true;\n };\n }, [loading, spinnerPresent]);\n\n const isInteractionDisabled = disabled || loading;\n const sizeCls = resolveSizeCls(size);\n const variantCls = resolveVariantCls({ danger, ghost, type });\n const shapeCls =\n shape === 'circle' ? styles.shapeCircle : shape === 'round' ? styles.shapeRound : undefined;\n\n const hasChildren =\n children !== undefined && children !== null && children !== false && children !== '';\n const renderIcon = loading || icon;\n const iconOnly = !hasChildren && !!renderIcon;\n const iconOnlySizeCls = iconOnly ? resolveIconOnlySizeCls(size) : undefined;\n\n const outdentCls =\n type === 'text' && outdent\n ? outdent === 'end'\n ? styles.outdentEnd\n : styles.outdentStart\n : undefined;\n\n const composedClassName = styleProps(\n [\n styles.base,\n focusRing.info,\n sizeCls,\n variantCls,\n shapeCls,\n block && styles.block,\n iconPosition === 'end' && styles.iconEnd,\n iconOnlySizeCls,\n outdentCls,\n xstyle,\n ],\n clsx(buttonClasses(), className),\n ).className;\n\n const dataAttributes =\n stableData ?? toDataAttributes({ block, danger, ghost, loading, shape, size, type });\n\n const spinnerNode = (\n <span\n aria-hidden={!loading}\n ref={spinnerRef}\n {...styleProps(\n [\n styles.iconBox,\n styles.spinnerSlot,\n iconPosition === 'end' && styles.spinnerSlotEnd,\n loading && styles.spinnerSlotShow,\n ],\n clsx(buttonClasses('spinner'), classNames?.icon),\n userStyles?.icon,\n )}\n >\n <span\n ref={spinnerVisualRef}\n {...stylex.props(styles.spinnerVisual, loading && styles.spinnerVisualShow)}\n >\n {(loading || spinnerPresent) && <span {...stylex.props(styles.spinner)} />}\n </span>\n </span>\n );\n\n const iconNode =\n icon && !loading ? (\n <span\n {...styleProps(\n styles.iconBox,\n clsx(buttonClasses('icon'), classNames?.icon),\n userStyles?.icon,\n )}\n >\n {resolveIconNode(icon)}\n </span>\n ) : null;\n\n const inner = (\n <>\n {spinnerNode}\n {iconNode}\n {children}\n </>\n );\n\n const motionGestures = isInteractionDisabled\n ? {}\n : { transition: motionTransition, whileTap: tapAnim };\n\n if (href !== undefined) {\n const handleAnchorClick = (e: MouseEvent<HTMLAnchorElement>) => {\n if (isInteractionDisabled) {\n e.preventDefault();\n return;\n }\n onClick?.(e as unknown as MouseEvent<HTMLButtonElement>);\n };\n\n return (\n <Motion.a\n aria-busy={loading || undefined}\n aria-disabled={isInteractionDisabled || undefined}\n href={disabled ? undefined : href}\n target={target}\n {...dataAttributes}\n {...(rest as any)}\n className={composedClassName}\n ref={ref as Ref<HTMLAnchorElement>}\n onClick={handleAnchorClick}\n {...motionGestures}\n >\n {inner}\n </Motion.a>\n );\n }\n\n const handleButtonClick = (e: MouseEvent<HTMLButtonElement>) => {\n if (isInteractionDisabled) {\n e.preventDefault();\n return;\n }\n onClick?.(e);\n };\n\n return (\n <Motion.button\n type={htmlType}\n {...dataAttributes}\n {...(rest as any)}\n aria-busy={loading || undefined}\n aria-disabled={isInteractionDisabled || undefined}\n className={composedClassName}\n disabled={disabled}\n ref={ref as Ref<HTMLButtonElement>}\n onClick={handleButtonClick}\n {...motionGestures}\n >\n {inner}\n </Motion.button>\n );\n};\n\nButtonImpl.displayName = 'BaseButton';\n\nexport { ButtonImpl };\n\nconst Button = ButtonImpl as <T extends ButtonType = 'default'>(\n props: ButtonProps<T>,\n) => ReactElement;\n\nexport default Button;\n"],"mappings":";;;;;;;;;;;;;AAaA,MAAM,mBAAmB,SAA2D;CAClF,IAAI,SAAS,KAAA,KAAa,SAAS,MAAM,OAAO;CAChD,IAAI,eAAe,IAAI,KAAK,OAAO,SAAS,YAAY,OAAO,SAAS,UACtE,OAAO;CAET,OAAO,oBAAC,MAAD;EAAM,MAAM;EAAa,MAAM;CAAU,CAAA;AAClD;AACA,MAAM,kBAAkB,SAA8B;CACpD,IAAI,SAAS,SAAS,OAAO,OAAO;CACpC,IAAI,SAAS,SAAS,OAAO,OAAO;CACpC,OAAO,OAAO;AAChB;AACA,MAAM,0BAA0B,SAA8B;CAC5D,IAAI,SAAS,SAAS,OAAO,OAAO;CACpC,IAAI,SAAS,SAAS,OAAO,OAAO;CACpC,OAAO,OAAO;AAChB;AACA,MAAM,qBAAqB,EACzB,QACA,OACA,WAKI;CAGJ,IAAI,SAAS,SAAS,UAAU,SAAS,QAAQ;EAC/C,IAAI,QAAQ,OAAO,OAAO;EAC1B,IAAI,SAAS,WAAW,OAAO,OAAO;EACtC,OAAO,OAAO;CAChB;CACA,QAAQ,MAAR;EACE,KAAK,WAED,OAAO,SAAS,OAAO,cAAc,OAAO;EAEhD,KAAK,UAED,OAAO,SAAS,CAAC,OAAO,eAAe,OAAO,cAAc,IAAI,OAAO;EAE3E,KAAK,QAED,OAAO,SAAS,OAAO,aAAa,OAAO;EAE/C,KAAK,QAED,OAAO,SAAS,CAAC,OAAO,aAAa,OAAO,UAAU,IAAI,OAAO;EAErE,KAAK,QAED,OAAO,SAAS,CAAC,OAAO,aAAa,OAAO,YAAY,IAAI,OAAO;EAEvE,SAEI,OAAO,SAAS,CAAC,OAAO,gBAAgB,OAAO,cAAc,IAAI,OAAO;CAE9E;AACF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O,GAAR;GAAU,aAAW,WAAW,KAAA;GAAW,iBAAe,yBAAyB,KAAA;GAAW,MAAM,WAAW,KAAA,IAAY;GAAc;GAAQ,GAAI;GAAgB,GAAI;GAAa,WAAW;GAAwB;GAA+B,SAAS;GAAmB,GAAI;GAC1R,UAAA;EACO,CAAA;CACd;CACA,MAAM,qBAAqB,MAAqC;EAC9D,IAAI,uBAAuB;GACzB,EAAE,eAAe;GACjB;EACF;EACA,UAAU,CAAC;CACb;CACA,OAAO,oBAAC,OAAO,QAAR;EAAe,MAAM;EAAU,GAAI;EAAgB,GAAI;EAAa,aAAW,WAAW,KAAA;EAAW,iBAAe,yBAAyB,KAAA;EAAW,WAAW;EAA6B;EAAe;EAA+B,SAAS;EAAmB,GAAI;EAChR,UAAA;CACY,CAAA;AACnB;AACA,WAAW,cAAc;AAEzB,MAAM,SAAS"}
|
package/es/Button/style.d.mts
CHANGED
|
@@ -85,10 +85,12 @@ export declare const styles: Readonly<{
|
|
|
85
85
|
readonly justifyContent: stylex.StyleXClassNameFor<"justifyContent", "center">;
|
|
86
86
|
}>;
|
|
87
87
|
readonly spinnerSlot: Readonly<{
|
|
88
|
-
readonly overflow: stylex.StyleXClassNameFor<"overflow", "
|
|
89
|
-
readonly transition: stylex.StyleXClassNameFor<"transition", "width
|
|
88
|
+
readonly overflow: stylex.StyleXClassNameFor<"overflow", "visible">;
|
|
89
|
+
readonly transition: stylex.StyleXClassNameFor<"transition", "width 300ms cubic-bezier(0.22, 1, 0.36, 1), margin 300ms cubic-bezier(0.22, 1, 0.36, 1)">;
|
|
90
|
+
readonly flexShrink: stylex.StyleXClassNameFor<"flexShrink", 0>;
|
|
90
91
|
readonly marginInlineEnd: stylex.StyleXClassNameFor<"marginInlineEnd", -6>;
|
|
91
|
-
readonly
|
|
92
|
+
readonly position: stylex.StyleXClassNameFor<"position", "relative">;
|
|
93
|
+
readonly height: stylex.StyleXClassNameFor<"height", 12>;
|
|
92
94
|
readonly width: stylex.StyleXClassNameFor<"width", 0>;
|
|
93
95
|
}>;
|
|
94
96
|
readonly spinnerSlotEnd: Readonly<{
|
|
@@ -98,9 +100,23 @@ export declare const styles: Readonly<{
|
|
|
98
100
|
readonly spinnerSlotShow: Readonly<{
|
|
99
101
|
readonly marginInlineEnd: stylex.StyleXClassNameFor<"marginInlineEnd", 0>;
|
|
100
102
|
readonly marginInlineStart: stylex.StyleXClassNameFor<"marginInlineStart", 0>;
|
|
101
|
-
readonly opacity: stylex.StyleXClassNameFor<"opacity", 1>;
|
|
102
103
|
readonly width: stylex.StyleXClassNameFor<"width", 12>;
|
|
103
104
|
}>;
|
|
105
|
+
readonly spinnerVisual: Readonly<{
|
|
106
|
+
readonly transition: stylex.StyleXClassNameFor<"transition", "transform 180ms cubic-bezier(0.22, 1, 0.36, 1), opacity 180ms ease-out">;
|
|
107
|
+
readonly insetBlockStart: stylex.StyleXClassNameFor<"insetBlockStart", 0>;
|
|
108
|
+
readonly insetInlineStart: stylex.StyleXClassNameFor<"insetInlineStart", 0>;
|
|
109
|
+
readonly opacity: stylex.StyleXClassNameFor<"opacity", 0>;
|
|
110
|
+
readonly position: stylex.StyleXClassNameFor<"position", "absolute">;
|
|
111
|
+
readonly transform: stylex.StyleXClassNameFor<"transform", "scale(0.5)">;
|
|
112
|
+
readonly transformOrigin: stylex.StyleXClassNameFor<"transformOrigin", "center">;
|
|
113
|
+
readonly height: stylex.StyleXClassNameFor<"height", 12>;
|
|
114
|
+
readonly width: stylex.StyleXClassNameFor<"width", 12>;
|
|
115
|
+
}>;
|
|
116
|
+
readonly spinnerVisualShow: Readonly<{
|
|
117
|
+
readonly opacity: stylex.StyleXClassNameFor<"opacity", 1>;
|
|
118
|
+
readonly transform: stylex.StyleXClassNameFor<"transform", "scale(1)">;
|
|
119
|
+
}>;
|
|
104
120
|
readonly variantDefault: Readonly<{
|
|
105
121
|
readonly borderColor: stylex.StyleXClassNameFor<"borderColor", string>;
|
|
106
122
|
readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", string>;
|
|
@@ -183,7 +199,9 @@ export declare const styles: Readonly<{
|
|
|
183
199
|
readonly animationName: stylex.StyleXClassNameFor<"animationName", string>;
|
|
184
200
|
readonly animationTimingFunction: stylex.StyleXClassNameFor<"animationTimingFunction", "linear">;
|
|
185
201
|
readonly borderBlockStartColor: stylex.StyleXClassNameFor<"borderBlockStartColor", "transparent">;
|
|
202
|
+
readonly boxSizing: stylex.StyleXClassNameFor<"boxSizing", "border-box">;
|
|
186
203
|
readonly display: stylex.StyleXClassNameFor<"display", "inline-block">;
|
|
204
|
+
readonly flexShrink: stylex.StyleXClassNameFor<"flexShrink", 0>;
|
|
187
205
|
readonly height: stylex.StyleXClassNameFor<"height", 12>;
|
|
188
206
|
readonly width: stylex.StyleXClassNameFor<"width", 12>;
|
|
189
207
|
}>;
|
package/es/Button/style.mjs
CHANGED
|
@@ -115,10 +115,12 @@ const styles = {
|
|
|
115
115
|
$$css: true
|
|
116
116
|
},
|
|
117
117
|
spinnerSlot: {
|
|
118
|
-
kVQacm: "
|
|
119
|
-
kmkexE: "
|
|
118
|
+
kVQacm: "lb1rea2x4",
|
|
119
|
+
kmkexE: "lbp7890b",
|
|
120
|
+
kmuXW: "lb2lah0s",
|
|
120
121
|
k71WvV: "lb1ws5yxj",
|
|
121
|
-
|
|
122
|
+
kVAEAm: "lb1n2onr6",
|
|
123
|
+
kZKoxP: "lb1kpxq89",
|
|
122
124
|
kzqmXN: "lbnalus7",
|
|
123
125
|
$$css: true
|
|
124
126
|
},
|
|
@@ -130,10 +132,26 @@ const styles = {
|
|
|
130
132
|
spinnerSlotShow: {
|
|
131
133
|
k71WvV: "lb14z9mp",
|
|
132
134
|
keTefX: "lb1lziwak",
|
|
133
|
-
kSiTet: "lb1hc1fzr",
|
|
134
135
|
kzqmXN: "lbsmyaan",
|
|
135
136
|
$$css: true
|
|
136
137
|
},
|
|
138
|
+
spinnerVisual: {
|
|
139
|
+
kmkexE: "lb1ja9v0h",
|
|
140
|
+
k87sOh: "lb13vifvy",
|
|
141
|
+
kLqNvP: "lb1o0tod",
|
|
142
|
+
kSiTet: "lbg01cxk",
|
|
143
|
+
kVAEAm: "lb10l6tqk",
|
|
144
|
+
k3aq6I: "lb1a33avv",
|
|
145
|
+
k3nNDw: "lb1g0ag68",
|
|
146
|
+
kZKoxP: "lb1kpxq89",
|
|
147
|
+
kzqmXN: "lbsmyaan",
|
|
148
|
+
$$css: true
|
|
149
|
+
},
|
|
150
|
+
spinnerVisualShow: {
|
|
151
|
+
kSiTet: "lb1hc1fzr",
|
|
152
|
+
k3aq6I: "lb3oybdh",
|
|
153
|
+
$$css: true
|
|
154
|
+
},
|
|
137
155
|
variantDefault: {
|
|
138
156
|
kVAM5u: "lbqnr5ac lbv4eugq",
|
|
139
157
|
kWkggS: "lb6yijhg",
|
|
@@ -230,7 +248,9 @@ const styles = {
|
|
|
230
248
|
kKVMdj: "lb1v0ides",
|
|
231
249
|
kyAemX: "lb1esw782",
|
|
232
250
|
kLZC3w: "lb1v8p93f",
|
|
251
|
+
kB7OPa: "lb9f619",
|
|
233
252
|
k1xSpc: "lb1rg5ohu",
|
|
253
|
+
kmuXW: "lb2lah0s",
|
|
234
254
|
kZKoxP: "lb1kpxq89",
|
|
235
255
|
kzqmXN: "lbsmyaan",
|
|
236
256
|
$$css: true
|
package/es/Button/style.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.mjs","names":[],"sources":["../../src/Button/style.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\n\nimport { cssVar } from '@/styles/stylex/cssVar.stylex';\n\nexport const buttonPaddingInline = {\n large: 16,\n middle: 14,\n small: 8,\n} as const;\n\nconst disabled = ':is(:disabled, [aria-disabled=\"true\"])';\nconst hover = ':hover:not(:disabled, [aria-disabled=\"true\"])';\nconst active = ':active:not(:disabled, [aria-disabled=\"true\"])';\nconst hoverIdle = ':hover:not(:active, :disabled, [aria-disabled=\"true\"])';\nconst hoverIdleClosed = ':hover:not(:active, :disabled, [aria-disabled=\"true\"], [data-popup-open])';\nconst popupOpen = ':is([data-popup-open])';\n\nconst spin = stylex.keyframes({\n to: { transform: 'rotate(360deg)' },\n});\n\nconst ease = 'cubic-bezier(0.32, 0.72, 0, 1)';\n\nconst errorHover = `color-mix(in srgb, ${cssVar.colorError} 88%, white)`;\nconst errorActive = `color-mix(in srgb, ${cssVar.colorError} 88%, black)`;\nconst borderHover = `color-mix(in srgb, ${cssVar.colorText} 8%, ${cssVar.colorBorder})`;\nconst neutralWash = `linear-gradient(${cssVar.colorFillTertiary}, ${cssVar.colorFillTertiary})`;\nconst neutralWashActive = `linear-gradient(${cssVar.colorFillSecondary}, ${cssVar.colorFillSecondary})`;\nconst error10 = `color-mix(in srgb, ${cssVar.colorError} 10%, transparent)`;\nconst error12 = `color-mix(in srgb, ${cssVar.colorError} 12%, transparent)`;\nconst error16 = `color-mix(in srgb, ${cssVar.colorError} 16%, transparent)`;\nconst error18 = `color-mix(in srgb, ${cssVar.colorError} 18%, transparent)`;\nconst error22 = `color-mix(in srgb, ${cssVar.colorError} 22%, transparent)`;\nconst error40 = `color-mix(in srgb, ${cssVar.colorError} 40%, transparent)`;\nconst error65 = `color-mix(in srgb, ${cssVar.colorError} 65%, transparent)`;\nconst errorOnContainer8 = `color-mix(in srgb, ${cssVar.colorError} 8%, ${cssVar.colorBgContainer})`;\nconst errorOnContainer14 = `color-mix(in srgb, ${cssVar.colorError} 14%, ${cssVar.colorBgContainer})`;\nconst slotEase = 'cubic-bezier(0.22, 1, 0.36, 1)';\n\nexport const styles = stylex.create({\n base: {\n borderColor: cssVar.colorBorder,\n borderStyle: 'solid',\n borderWidth: 1,\n gap: 6,\n textDecoration: 'none',\n transition: `color 160ms ${ease}, background-color 160ms ${ease}, background-image 160ms ${ease}, border-color 160ms ${ease}, box-shadow 160ms ${ease}`,\n alignItems: 'center',\n boxSizing: 'border-box',\n cursor: { default: 'pointer', [disabled]: 'not-allowed' },\n display: 'inline-flex',\n fontWeight: 500,\n justifyContent: 'center',\n lineHeight: 1,\n opacity: { default: null, [disabled]: 0.5 },\n pointerEvents: { default: null, [disabled]: 'none' },\n position: 'relative',\n whiteSpace: 'nowrap',\n },\n\n sizeSmall: {\n '--button-padding-inline': `${buttonPaddingInline.small}px`,\n 'borderRadius': cssVar.borderRadiusSM,\n 'paddingInline': 'var(--button-padding-inline)',\n 'fontSize': 12,\n 'height': 24,\n },\n\n sizeMiddle: {\n '--button-padding-inline': `${buttonPaddingInline.middle}px`,\n 'borderRadius': cssVar.borderRadiusSM,\n 'paddingInline': 'var(--button-padding-inline)',\n 'fontSize': 13,\n 'height': 32,\n },\n\n sizeLarge: {\n '--button-padding-inline': `${buttonPaddingInline.large}px`,\n 'borderRadius': cssVar.borderRadius,\n 'paddingInline': 'var(--button-padding-inline)',\n 'fontSize': 14,\n 'height': 40,\n },\n\n outdentStart: {\n marginInlineStart: 'calc(var(--button-padding-inline) * -1)',\n },\n\n outdentEnd: {\n marginInlineEnd: 'calc(var(--button-padding-inline) * -1)',\n },\n\n shapeCircle: {\n borderRadius: '50%',\n paddingInline: 0,\n },\n\n shapeRound: {\n borderRadius: 999,\n },\n\n block: {\n width: '100%',\n },\n\n iconEnd: {\n flexDirection: 'row-reverse',\n },\n\n iconOnlySmall: {\n '--button-padding-inline': '0px',\n 'paddingInline': 0,\n 'width': 24,\n },\n\n iconOnlyMiddle: {\n '--button-padding-inline': '0px',\n 'paddingInline': 0,\n 'width': 32,\n },\n\n iconOnlyLarge: {\n '--button-padding-inline': '0px',\n 'paddingInline': 0,\n 'width': 40,\n },\n\n iconBox: {\n alignItems: 'center',\n display: 'inline-flex',\n justifyContent: 'center',\n },\n\n spinnerSlot: {\n overflow: 'hidden',\n transition: `width 380ms ${slotEase}, margin 380ms ${slotEase}, opacity 260ms ${slotEase}`,\n marginInlineEnd: -6,\n opacity: 0,\n width: 0,\n },\n\n spinnerSlotEnd: {\n marginInlineEnd: 0,\n marginInlineStart: -6,\n },\n\n spinnerSlotShow: {\n marginInlineEnd: 0,\n marginInlineStart: 0,\n opacity: 1,\n width: 12,\n },\n\n variantDefault: {\n borderColor: { default: cssVar.colorBorder, [hover]: borderHover },\n backgroundColor: cssVar.colorBgContainer,\n backgroundImage: {\n [active]: neutralWashActive,\n default: null,\n [hoverIdle]: neutralWash,\n },\n color: cssVar.colorText,\n },\n\n variantPrimary: {\n borderColor: {\n [active]: cssVar.colorPrimaryActive,\n default: cssVar.colorPrimary,\n [hoverIdleClosed]: cssVar.colorPrimaryHover,\n [popupOpen]: cssVar.colorPrimaryActive,\n },\n backgroundColor: {\n [active]: cssVar.colorPrimaryActive,\n default: cssVar.colorPrimary,\n [hoverIdleClosed]: cssVar.colorPrimaryHover,\n [popupOpen]: cssVar.colorPrimaryActive,\n },\n color: cssVar.colorBgLayout,\n },\n\n variantDashed: {\n borderColor: { default: cssVar.colorBorder, [hover]: borderHover },\n borderStyle: 'dashed',\n backgroundColor: cssVar.colorBgContainer,\n backgroundImage: {\n [active]: neutralWashActive,\n default: null,\n [hoverIdle]: neutralWash,\n },\n color: cssVar.colorText,\n },\n\n variantFill: {\n borderColor: 'transparent',\n backgroundColor: {\n [active]: cssVar.colorFill,\n default: cssVar.colorFillTertiary,\n [hoverIdle]: cssVar.colorFillSecondary,\n },\n color: cssVar.colorText,\n },\n\n variantText: {\n borderColor: 'transparent',\n backgroundColor: { default: 'transparent', [hover]: cssVar.colorFillSecondary },\n color: cssVar.colorText,\n },\n\n variantLink: {\n borderColor: 'transparent',\n paddingInline: 0,\n backgroundColor: 'transparent',\n color: { default: cssVar.colorPrimary, [hover]: cssVar.colorPrimaryHover },\n },\n\n dangerOutlined: {\n borderColor: { default: error40, [hover]: error65 },\n backgroundColor: {\n [active]: errorOnContainer14,\n default: cssVar.colorBgContainer,\n [hoverIdle]: errorOnContainer8,\n },\n backgroundImage: null,\n color: cssVar.colorError,\n },\n\n dangerSolid: {\n borderColor: {\n [active]: errorActive,\n default: cssVar.colorError,\n [hoverIdleClosed]: errorHover,\n [popupOpen]: errorActive,\n },\n backgroundColor: {\n [active]: errorActive,\n default: cssVar.colorError,\n [hoverIdleClosed]: errorHover,\n [popupOpen]: errorActive,\n },\n color: cssVar.colorBgLayout,\n },\n\n dangerFill: {\n borderColor: 'transparent',\n backgroundColor: {\n [active]: error22,\n default: error12,\n [hoverIdle]: error18,\n },\n color: cssVar.colorError,\n },\n\n dangerText: {\n backgroundColor: {\n [active]: error16,\n default: 'transparent',\n [hoverIdle]: error10,\n },\n color: cssVar.colorError,\n },\n\n dangerInline: {\n color: { default: cssVar.colorError, [hover]: errorHover },\n },\n\n ghostDefault: {\n borderColor: 'transparent',\n backgroundColor: {\n [active]: cssVar.colorFill,\n default: 'transparent',\n [hoverIdle]: cssVar.colorFillSecondary,\n },\n color: cssVar.colorText,\n },\n\n ghostPrimary: {\n borderColor: 'transparent',\n backgroundColor: {\n [active]: cssVar.colorFill,\n default: 'transparent',\n [hoverIdle]: cssVar.colorFillSecondary,\n },\n color: {\n [active]: cssVar.colorPrimaryActive,\n default: cssVar.colorPrimary,\n [hoverIdle]: cssVar.colorPrimaryHover,\n },\n },\n\n ghostDanger: {\n borderColor: 'transparent',\n backgroundColor: {\n [active]: error16,\n default: 'transparent',\n [hoverIdle]: error10,\n },\n color: cssVar.colorError,\n },\n\n spinner: {\n borderColor: 'currentcolor',\n borderRadius: '50%',\n borderStyle: 'solid',\n borderWidth: 1.5,\n animationDuration: '0.6s',\n animationIterationCount: 'infinite',\n animationName: spin,\n animationTimingFunction: 'linear',\n borderBlockStartColor: 'transparent',\n display: 'inline-block',\n height: 12,\n width: 12,\n },\n});\n\nconst hasHover = ':has(> :where(button, a):hover:not(:disabled, [aria-disabled=\"true\"]))';\nconst hasActive = ':has(> :where(button, a):active:not(:disabled, [aria-disabled=\"true\"]))';\nconst hasHoverOnly = `${hasHover}:not(${hasActive})`;\nconst first = ':first-of-type';\nconst last = ':last-of-type';\n\nexport const splitStyles = stylex.create({\n root: {\n display: 'inline-flex',\n flexDirection: 'row',\n },\n interactionDisabled: {\n opacity: 0.5,\n },\n solidPrimary: {\n '--lobe-split-button-fill': {\n default: null,\n [hasActive]: cssVar.colorPrimaryActive,\n [hasHoverOnly]: cssVar.colorPrimaryHover,\n },\n },\n solidDanger: {\n '--lobe-split-button-fill': {\n default: null,\n [hasActive]: errorActive,\n [hasHoverOnly]: errorHover,\n },\n },\n item: {\n borderEndEndRadius: { default: null, [first]: 0 },\n borderEndStartRadius: { default: null, [last]: 0 },\n borderStartEndRadius: { default: null, [first]: 0 },\n borderStartStartRadius: { default: null, [last]: 0 },\n marginInlineStart: { default: null, [last]: -1 },\n },\n itemInteractionDisabled: {\n opacity: { default: null, [disabled]: 1 },\n },\n itemSolid: {\n // solid halves share one color, so the outline-merging overlap only adds a dark seam once each half is translucent (disabled)\n 'marginInlineStart': { default: null, [last]: 0 },\n '::before': {\n insetBlock: { default: null, [last]: 0 },\n backgroundColor: { default: null, [last]: 'currentcolor' },\n content: { default: null, [last]: \"''\" },\n insetInlineStart: { default: null, [last]: 0 },\n opacity: { default: null, [last]: 0.2 },\n pointerEvents: { default: null, [last]: 'none' },\n position: { default: null, [last]: 'absolute' },\n width: { default: null, [last]: 1 },\n },\n },\n itemFillDanger: {\n borderColor: {\n default: `var(--lobe-split-button-fill, ${cssVar.colorError})`,\n [popupOpen]: errorActive,\n },\n backgroundColor: {\n default: `var(--lobe-split-button-fill, ${cssVar.colorError})`,\n [popupOpen]: errorActive,\n },\n },\n itemFillGhost: {\n borderColor: 'var(--lobe-split-button-fill, transparent)',\n backgroundColor: 'var(--lobe-split-button-fill, transparent)',\n },\n itemFillPrimary: {\n borderColor: {\n default: `var(--lobe-split-button-fill, ${cssVar.colorPrimary})`,\n [popupOpen]: cssVar.colorPrimaryActive,\n },\n backgroundColor: {\n default: `var(--lobe-split-button-fill, ${cssVar.colorPrimary})`,\n [popupOpen]: cssVar.colorPrimaryActive,\n },\n },\n});\n\nexport const buttonStyles = Object.fromEntries(\n Object.entries(styles).map(([key, value]) => [key, stylex.props(value).className ?? '']),\n) as Record<keyof typeof styles, string>;\n"],"mappings":";;;AAGA,MAAa,sBAAsB;CACjC,OAAO;CACP,QAAQ;CACR,OAAO;AACT;AASmB,GAAsB,OAAO;AAC5B,GAAsB,OAAO;AAC7B,GAAsB,OAAO,YAAiB,OAAO;AACrD,GAAmB,OAAO,oBAAsB,OAAO;AACjD,GAAmB,OAAO,qBAAuB,OAAO;AAClE,GAAsB,OAAO;AAC7B,GAAsB,OAAO;AAC7B,GAAsB,OAAO;AAC7B,GAAsB,OAAO;AAC7B,GAAsB,OAAO;AAC7B,GAAsB,OAAO;AAC7B,GAAsB,OAAO;AACnB,GAAsB,OAAO,aAAkB,OAAO;AACrD,GAAsB,OAAO,aAAmB,OAAO;AAElF,MAAa,SAAS;CACpB,MAAM;EACJ,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,WAAW;EACT,2BAA2B;EAC3B,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,YAAY;EACV,2BAA2B;EAC3B,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,WAAW;EACT,2BAA2B;EAC3B,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,cAAc;EACZ,QAAQ;EACR,OAAO;CACT;CACA,YAAY;EACV,QAAQ;EACR,OAAO;CACT;CACA,aAAa;EACX,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,YAAY;EACV,QAAQ;EACR,OAAO;CACT;CACA,OAAO;EACL,QAAQ;EACR,OAAO;CACT;CACA,SAAS;EACP,QAAQ;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,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,cAAc;EACZ,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,aAAa;EACX,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,SAAS;EACP,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;AACF;AAMA,MAAa,cAAc;CACzB,MAAM;EACJ,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,qBAAqB;EACnB,QAAQ;EACR,OAAO;CACT;CACA,cAAc;EACZ,4BAA4B;EAC5B,OAAO;CACT;CACA,aAAa;EACX,4BAA4B;EAC5B,OAAO;CACT;CACA,MAAM;EACJ,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,yBAAyB;EACvB,QAAQ;EACR,OAAO;CACT;CACA,WAAW;EACT,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,gBAAgB;EACd,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,eAAe;EACb,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,iBAAiB;EACf,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;AACF;AACA,MAAa,eAAe,OAAO,YAAY,OAAO,QAAQ,MAAM,CAAC,CAAC,KAAK,CAAC,KAAK,WAAW,CAAC,KAAK,OAAO,MAAM,KAAK,CAAC,CAAC,aAAa,EAAE,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"style.mjs","names":[],"sources":["../../src/Button/style.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\n\nimport { cssVar } from '@/styles/stylex/cssVar.stylex';\n\nexport const buttonPaddingInline = {\n large: 16,\n middle: 14,\n small: 8,\n} as const;\n\nconst disabled = ':is(:disabled, [aria-disabled=\"true\"])';\nconst hover = ':hover:not(:disabled, [aria-disabled=\"true\"])';\nconst active = ':active:not(:disabled, [aria-disabled=\"true\"])';\nconst hoverIdle = ':hover:not(:active, :disabled, [aria-disabled=\"true\"])';\nconst hoverIdleClosed = ':hover:not(:active, :disabled, [aria-disabled=\"true\"], [data-popup-open])';\nconst popupOpen = ':is([data-popup-open])';\n\nconst spin = stylex.keyframes({\n to: { transform: 'rotate(360deg)' },\n});\n\nconst ease = 'cubic-bezier(0.32, 0.72, 0, 1)';\n\nconst errorHover = `color-mix(in srgb, ${cssVar.colorError} 88%, white)`;\nconst errorActive = `color-mix(in srgb, ${cssVar.colorError} 88%, black)`;\nconst borderHover = `color-mix(in srgb, ${cssVar.colorText} 8%, ${cssVar.colorBorder})`;\nconst neutralWash = `linear-gradient(${cssVar.colorFillTertiary}, ${cssVar.colorFillTertiary})`;\nconst neutralWashActive = `linear-gradient(${cssVar.colorFillSecondary}, ${cssVar.colorFillSecondary})`;\nconst error10 = `color-mix(in srgb, ${cssVar.colorError} 10%, transparent)`;\nconst error12 = `color-mix(in srgb, ${cssVar.colorError} 12%, transparent)`;\nconst error16 = `color-mix(in srgb, ${cssVar.colorError} 16%, transparent)`;\nconst error18 = `color-mix(in srgb, ${cssVar.colorError} 18%, transparent)`;\nconst error22 = `color-mix(in srgb, ${cssVar.colorError} 22%, transparent)`;\nconst error40 = `color-mix(in srgb, ${cssVar.colorError} 40%, transparent)`;\nconst error65 = `color-mix(in srgb, ${cssVar.colorError} 65%, transparent)`;\nconst errorOnContainer8 = `color-mix(in srgb, ${cssVar.colorError} 8%, ${cssVar.colorBgContainer})`;\nconst errorOnContainer14 = `color-mix(in srgb, ${cssVar.colorError} 14%, ${cssVar.colorBgContainer})`;\nconst slotEase = 'cubic-bezier(0.22, 1, 0.36, 1)';\n\nexport const styles = stylex.create({\n base: {\n borderColor: cssVar.colorBorder,\n borderStyle: 'solid',\n borderWidth: 1,\n gap: 6,\n textDecoration: 'none',\n transition: `color 160ms ${ease}, background-color 160ms ${ease}, background-image 160ms ${ease}, border-color 160ms ${ease}, box-shadow 160ms ${ease}`,\n alignItems: 'center',\n boxSizing: 'border-box',\n cursor: { default: 'pointer', [disabled]: 'not-allowed' },\n display: 'inline-flex',\n fontWeight: 500,\n justifyContent: 'center',\n lineHeight: 1,\n opacity: { default: null, [disabled]: 0.5 },\n pointerEvents: { default: null, [disabled]: 'none' },\n position: 'relative',\n whiteSpace: 'nowrap',\n },\n\n sizeSmall: {\n '--button-padding-inline': `${buttonPaddingInline.small}px`,\n 'borderRadius': cssVar.borderRadiusSM,\n 'paddingInline': 'var(--button-padding-inline)',\n 'fontSize': 12,\n 'height': 24,\n },\n\n sizeMiddle: {\n '--button-padding-inline': `${buttonPaddingInline.middle}px`,\n 'borderRadius': cssVar.borderRadiusSM,\n 'paddingInline': 'var(--button-padding-inline)',\n 'fontSize': 13,\n 'height': 32,\n },\n\n sizeLarge: {\n '--button-padding-inline': `${buttonPaddingInline.large}px`,\n 'borderRadius': cssVar.borderRadius,\n 'paddingInline': 'var(--button-padding-inline)',\n 'fontSize': 14,\n 'height': 40,\n },\n\n outdentStart: {\n marginInlineStart: 'calc(var(--button-padding-inline) * -1)',\n },\n\n outdentEnd: {\n marginInlineEnd: 'calc(var(--button-padding-inline) * -1)',\n },\n\n shapeCircle: {\n borderRadius: '50%',\n paddingInline: 0,\n },\n\n shapeRound: {\n borderRadius: 999,\n },\n\n block: {\n width: '100%',\n },\n\n iconEnd: {\n flexDirection: 'row-reverse',\n },\n\n iconOnlySmall: {\n '--button-padding-inline': '0px',\n 'paddingInline': 0,\n 'width': 24,\n },\n\n iconOnlyMiddle: {\n '--button-padding-inline': '0px',\n 'paddingInline': 0,\n 'width': 32,\n },\n\n iconOnlyLarge: {\n '--button-padding-inline': '0px',\n 'paddingInline': 0,\n 'width': 40,\n },\n\n iconBox: {\n alignItems: 'center',\n display: 'inline-flex',\n justifyContent: 'center',\n },\n\n spinnerSlot: {\n overflow: 'visible',\n transition: `width 300ms ${slotEase}, margin 300ms ${slotEase}`,\n flexShrink: 0,\n marginInlineEnd: -6,\n position: 'relative',\n height: 12,\n width: 0,\n },\n\n spinnerSlotEnd: {\n marginInlineEnd: 0,\n marginInlineStart: -6,\n },\n\n spinnerSlotShow: {\n marginInlineEnd: 0,\n marginInlineStart: 0,\n width: 12,\n },\n\n spinnerVisual: {\n transition: `transform 180ms ${slotEase}, opacity 180ms ease-out`,\n insetBlockStart: 0,\n insetInlineStart: 0,\n opacity: 0,\n position: 'absolute',\n transform: 'scale(0.5)',\n transformOrigin: 'center',\n height: 12,\n width: 12,\n },\n\n spinnerVisualShow: {\n opacity: 1,\n transform: 'scale(1)',\n },\n\n variantDefault: {\n borderColor: { default: cssVar.colorBorder, [hover]: borderHover },\n backgroundColor: cssVar.colorBgContainer,\n backgroundImage: {\n [active]: neutralWashActive,\n default: null,\n [hoverIdle]: neutralWash,\n },\n color: cssVar.colorText,\n },\n\n variantPrimary: {\n borderColor: {\n [active]: cssVar.colorPrimaryActive,\n default: cssVar.colorPrimary,\n [hoverIdleClosed]: cssVar.colorPrimaryHover,\n [popupOpen]: cssVar.colorPrimaryActive,\n },\n backgroundColor: {\n [active]: cssVar.colorPrimaryActive,\n default: cssVar.colorPrimary,\n [hoverIdleClosed]: cssVar.colorPrimaryHover,\n [popupOpen]: cssVar.colorPrimaryActive,\n },\n color: cssVar.colorBgLayout,\n },\n\n variantDashed: {\n borderColor: { default: cssVar.colorBorder, [hover]: borderHover },\n borderStyle: 'dashed',\n backgroundColor: cssVar.colorBgContainer,\n backgroundImage: {\n [active]: neutralWashActive,\n default: null,\n [hoverIdle]: neutralWash,\n },\n color: cssVar.colorText,\n },\n\n variantFill: {\n borderColor: 'transparent',\n backgroundColor: {\n [active]: cssVar.colorFill,\n default: cssVar.colorFillTertiary,\n [hoverIdle]: cssVar.colorFillSecondary,\n },\n color: cssVar.colorText,\n },\n\n variantText: {\n borderColor: 'transparent',\n backgroundColor: { default: 'transparent', [hover]: cssVar.colorFillSecondary },\n color: cssVar.colorText,\n },\n\n variantLink: {\n borderColor: 'transparent',\n paddingInline: 0,\n backgroundColor: 'transparent',\n color: { default: cssVar.colorPrimary, [hover]: cssVar.colorPrimaryHover },\n },\n\n dangerOutlined: {\n borderColor: { default: error40, [hover]: error65 },\n backgroundColor: {\n [active]: errorOnContainer14,\n default: cssVar.colorBgContainer,\n [hoverIdle]: errorOnContainer8,\n },\n backgroundImage: null,\n color: cssVar.colorError,\n },\n\n dangerSolid: {\n borderColor: {\n [active]: errorActive,\n default: cssVar.colorError,\n [hoverIdleClosed]: errorHover,\n [popupOpen]: errorActive,\n },\n backgroundColor: {\n [active]: errorActive,\n default: cssVar.colorError,\n [hoverIdleClosed]: errorHover,\n [popupOpen]: errorActive,\n },\n color: cssVar.colorBgLayout,\n },\n\n dangerFill: {\n borderColor: 'transparent',\n backgroundColor: {\n [active]: error22,\n default: error12,\n [hoverIdle]: error18,\n },\n color: cssVar.colorError,\n },\n\n dangerText: {\n backgroundColor: {\n [active]: error16,\n default: 'transparent',\n [hoverIdle]: error10,\n },\n color: cssVar.colorError,\n },\n\n dangerInline: {\n color: { default: cssVar.colorError, [hover]: errorHover },\n },\n\n ghostDefault: {\n borderColor: 'transparent',\n backgroundColor: {\n [active]: cssVar.colorFill,\n default: 'transparent',\n [hoverIdle]: cssVar.colorFillSecondary,\n },\n color: cssVar.colorText,\n },\n\n ghostPrimary: {\n borderColor: 'transparent',\n backgroundColor: {\n [active]: cssVar.colorFill,\n default: 'transparent',\n [hoverIdle]: cssVar.colorFillSecondary,\n },\n color: {\n [active]: cssVar.colorPrimaryActive,\n default: cssVar.colorPrimary,\n [hoverIdle]: cssVar.colorPrimaryHover,\n },\n },\n\n ghostDanger: {\n borderColor: 'transparent',\n backgroundColor: {\n [active]: error16,\n default: 'transparent',\n [hoverIdle]: error10,\n },\n color: cssVar.colorError,\n },\n\n spinner: {\n borderColor: 'currentcolor',\n borderRadius: '50%',\n borderStyle: 'solid',\n borderWidth: 1.5,\n animationDuration: '0.6s',\n animationIterationCount: 'infinite',\n animationName: spin,\n animationTimingFunction: 'linear',\n borderBlockStartColor: 'transparent',\n boxSizing: 'border-box',\n display: 'inline-block',\n flexShrink: 0,\n height: 12,\n width: 12,\n },\n});\n\nconst hasHover = ':has(> :where(button, a):hover:not(:disabled, [aria-disabled=\"true\"]))';\nconst hasActive = ':has(> :where(button, a):active:not(:disabled, [aria-disabled=\"true\"]))';\nconst hasHoverOnly = `${hasHover}:not(${hasActive})`;\nconst first = ':first-of-type';\nconst last = ':last-of-type';\n\nexport const splitStyles = stylex.create({\n root: {\n display: 'inline-flex',\n flexDirection: 'row',\n },\n interactionDisabled: {\n opacity: 0.5,\n },\n solidPrimary: {\n '--lobe-split-button-fill': {\n default: null,\n [hasActive]: cssVar.colorPrimaryActive,\n [hasHoverOnly]: cssVar.colorPrimaryHover,\n },\n },\n solidDanger: {\n '--lobe-split-button-fill': {\n default: null,\n [hasActive]: errorActive,\n [hasHoverOnly]: errorHover,\n },\n },\n item: {\n borderEndEndRadius: { default: null, [first]: 0 },\n borderEndStartRadius: { default: null, [last]: 0 },\n borderStartEndRadius: { default: null, [first]: 0 },\n borderStartStartRadius: { default: null, [last]: 0 },\n marginInlineStart: { default: null, [last]: -1 },\n },\n itemInteractionDisabled: {\n opacity: { default: null, [disabled]: 1 },\n },\n itemSolid: {\n // solid halves share one color, so the outline-merging overlap only adds a dark seam once each half is translucent (disabled)\n 'marginInlineStart': { default: null, [last]: 0 },\n '::before': {\n insetBlock: { default: null, [last]: 0 },\n backgroundColor: { default: null, [last]: 'currentcolor' },\n content: { default: null, [last]: \"''\" },\n insetInlineStart: { default: null, [last]: 0 },\n opacity: { default: null, [last]: 0.2 },\n pointerEvents: { default: null, [last]: 'none' },\n position: { default: null, [last]: 'absolute' },\n width: { default: null, [last]: 1 },\n },\n },\n itemFillDanger: {\n borderColor: {\n default: `var(--lobe-split-button-fill, ${cssVar.colorError})`,\n [popupOpen]: errorActive,\n },\n backgroundColor: {\n default: `var(--lobe-split-button-fill, ${cssVar.colorError})`,\n [popupOpen]: errorActive,\n },\n },\n itemFillGhost: {\n borderColor: 'var(--lobe-split-button-fill, transparent)',\n backgroundColor: 'var(--lobe-split-button-fill, transparent)',\n },\n itemFillPrimary: {\n borderColor: {\n default: `var(--lobe-split-button-fill, ${cssVar.colorPrimary})`,\n [popupOpen]: cssVar.colorPrimaryActive,\n },\n backgroundColor: {\n default: `var(--lobe-split-button-fill, ${cssVar.colorPrimary})`,\n [popupOpen]: cssVar.colorPrimaryActive,\n },\n },\n});\n\nexport const buttonStyles = Object.fromEntries(\n Object.entries(styles).map(([key, value]) => [key, stylex.props(value).className ?? '']),\n) as Record<keyof typeof styles, string>;\n"],"mappings":";;;AAGA,MAAa,sBAAsB;CACjC,OAAO;CACP,QAAQ;CACR,OAAO;AACT;AASmB,GAAsB,OAAO;AAC5B,GAAsB,OAAO;AAC7B,GAAsB,OAAO,YAAiB,OAAO;AACrD,GAAmB,OAAO,oBAAsB,OAAO;AACjD,GAAmB,OAAO,qBAAuB,OAAO;AAClE,GAAsB,OAAO;AAC7B,GAAsB,OAAO;AAC7B,GAAsB,OAAO;AAC7B,GAAsB,OAAO;AAC7B,GAAsB,OAAO;AAC7B,GAAsB,OAAO;AAC7B,GAAsB,OAAO;AACnB,GAAsB,OAAO,aAAkB,OAAO;AACrD,GAAsB,OAAO,aAAmB,OAAO;AAElF,MAAa,SAAS;CACpB,MAAM;EACJ,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;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;CACA,aAAa;EACX,4BAA4B;EAC5B,OAAO;CACT;CACA,MAAM;EACJ,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,yBAAyB;EACvB,QAAQ;EACR,OAAO;CACT;CACA,WAAW;EACT,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,gBAAgB;EACd,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,eAAe;EACb,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,iBAAiB;EACf,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;AACF;AACA,MAAa,eAAe,OAAO,YAAY,OAAO,QAAQ,MAAM,CAAC,CAAC,KAAK,CAAC,KAAK,WAAW,CAAC,KAAK,OAAO,MAAM,KAAK,CAAC,CAAC,aAAa,EAAE,CAAC,CAAC"}
|
package/es/Text/style.d.mts
CHANGED
|
@@ -14,12 +14,12 @@ export declare const textStyles: {
|
|
|
14
14
|
disabled: string;
|
|
15
15
|
danger: string;
|
|
16
16
|
success: string;
|
|
17
|
-
info: string;
|
|
18
17
|
warning: string;
|
|
19
18
|
delete: string;
|
|
20
19
|
ellipsis: string;
|
|
21
20
|
italic: string;
|
|
22
21
|
underline: string;
|
|
22
|
+
info: string;
|
|
23
23
|
ellipsisMulti: string;
|
|
24
24
|
secondary: string;
|
|
25
25
|
};
|
package/es/style.css
CHANGED
|
@@ -5999,6 +5999,10 @@
|
|
|
5999
5999
|
transition: transform .16s var(--lobe-motion-ease-out);
|
|
6000
6000
|
}
|
|
6001
6001
|
|
|
6002
|
+
.lb1ja9v0h {
|
|
6003
|
+
transition: transform .18s cubic-bezier(.22, 1, .36, 1), opacity .18s ease-out;
|
|
6004
|
+
}
|
|
6005
|
+
|
|
6002
6006
|
.lblhg8ld {
|
|
6003
6007
|
transition: transform .24s var(--lobe-motion-ease-out);
|
|
6004
6008
|
}
|
|
@@ -6027,8 +6031,8 @@
|
|
|
6027
6031
|
transition: width .2s, background .2s;
|
|
6028
6032
|
}
|
|
6029
6033
|
|
|
6030
|
-
.
|
|
6031
|
-
transition: width .
|
|
6034
|
+
.lbp7890b {
|
|
6035
|
+
transition: width .3s cubic-bezier(.22, 1, .36, 1), margin .3s cubic-bezier(.22, 1, .36, 1);
|
|
6032
6036
|
}
|
|
6033
6037
|
|
|
6034
6038
|
.lb15cnf4b {
|
|
@@ -8875,6 +8879,10 @@
|
|
|
8875
8879
|
transform: rotateX(60deg);
|
|
8876
8880
|
}
|
|
8877
8881
|
|
|
8882
|
+
.lb1a33avv {
|
|
8883
|
+
transform: scale(.5);
|
|
8884
|
+
}
|
|
8885
|
+
|
|
8878
8886
|
.lb10078c2 {
|
|
8879
8887
|
transform: scale(.66);
|
|
8880
8888
|
}
|
|
@@ -8883,6 +8891,10 @@
|
|
|
8883
8891
|
transform: scale(.75);
|
|
8884
8892
|
}
|
|
8885
8893
|
|
|
8894
|
+
.lb3oybdh {
|
|
8895
|
+
transform: scale(1);
|
|
8896
|
+
}
|
|
8897
|
+
|
|
8886
8898
|
.lb1ufz0iv {
|
|
8887
8899
|
transform: scaleX(0);
|
|
8888
8900
|
}
|