@brycks/core-front 0.5.0 → 0.7.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/dist/components/data/List/List.cjs +1 -1
- package/dist/components/data/List/List.cjs.map +1 -1
- package/dist/components/data/List/List.js +68 -148
- package/dist/components/data/List/List.js.map +1 -1
- package/dist/components/data/Table/Table.cjs +1 -1
- package/dist/components/data/Table/Table.cjs.map +1 -1
- package/dist/components/data/Table/Table.js +142 -224
- package/dist/components/data/Table/Table.js.map +1 -1
- package/dist/components/data/TreeView/TreeView.cjs +1 -1
- package/dist/components/data/TreeView/TreeView.cjs.map +1 -1
- package/dist/components/data/TreeView/TreeView.js +141 -182
- package/dist/components/data/TreeView/TreeView.js.map +1 -1
- package/dist/components/feedback/Drawer/Drawer.cjs +1 -22
- package/dist/components/feedback/Drawer/Drawer.cjs.map +1 -1
- package/dist/components/feedback/Drawer/Drawer.js +84 -184
- package/dist/components/feedback/Drawer/Drawer.js.map +1 -1
- package/dist/components/feedback/Modal/Modal.cjs +1 -1
- package/dist/components/feedback/Modal/Modal.cjs.map +1 -1
- package/dist/components/feedback/Modal/Modal.js +65 -150
- package/dist/components/feedback/Modal/Modal.js.map +1 -1
- package/dist/components/feedback/Toast/Toast.cjs +1 -10
- package/dist/components/feedback/Toast/Toast.cjs.map +1 -1
- package/dist/components/feedback/Toast/Toast.js +94 -187
- package/dist/components/feedback/Toast/Toast.js.map +1 -1
- package/dist/components/form/Checkbox/Checkbox.cjs +1 -1
- package/dist/components/form/Checkbox/Checkbox.js +11 -11
- package/dist/components/form/Combobox/Combobox.cjs +1 -6
- package/dist/components/form/Combobox/Combobox.cjs.map +1 -1
- package/dist/components/form/Combobox/Combobox.js +187 -283
- package/dist/components/form/Combobox/Combobox.js.map +1 -1
- package/dist/components/form/Input/Input.cjs +1 -1
- package/dist/components/form/Input/Input.cjs.map +1 -1
- package/dist/components/form/Input/Input.js +38 -133
- package/dist/components/form/Input/Input.js.map +1 -1
- package/dist/components/form/Select/Select.cjs +1 -1
- package/dist/components/form/Select/Select.cjs.map +1 -1
- package/dist/components/form/Select/Select.js +36 -82
- package/dist/components/form/Select/Select.js.map +1 -1
- package/dist/components/form/TagInput/TagInput.cjs +1 -1
- package/dist/components/form/TagInput/TagInput.js +8 -8
- package/dist/components/form/Textarea/Textarea.cjs +1 -1
- package/dist/components/form/Textarea/Textarea.cjs.map +1 -1
- package/dist/components/form/Textarea/Textarea.js +66 -95
- package/dist/components/form/Textarea/Textarea.js.map +1 -1
- package/dist/components/navigation/ContextMenu/ContextMenu.cjs +1 -1
- package/dist/components/navigation/ContextMenu/ContextMenu.js +9 -9
- package/dist/components/navigation/Menu/Menu.cjs +1 -1
- package/dist/components/navigation/Menu/Menu.cjs.map +1 -1
- package/dist/components/navigation/Menu/Menu.js +70 -135
- package/dist/components/navigation/Menu/Menu.js.map +1 -1
- package/dist/components/navigation/Pagination/Pagination.cjs +1 -1
- package/dist/components/navigation/Pagination/Pagination.cjs.map +1 -1
- package/dist/components/navigation/Pagination/Pagination.js +87 -157
- package/dist/components/navigation/Pagination/Pagination.js.map +1 -1
- package/dist/components/primitives/Button/Button.cjs +1 -1
- package/dist/components/primitives/Button/Button.cjs.map +1 -1
- package/dist/components/primitives/Button/Button.js +47 -43
- package/dist/components/primitives/Button/Button.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as y, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import C, { forwardRef as p } from "react";
|
|
3
3
|
import { sizeConfig as g } from "./Button.styles.js";
|
|
4
|
-
import { cx as
|
|
5
|
-
const
|
|
6
|
-
return /* @__PURE__ */
|
|
4
|
+
import { cx as D } from "../../../utils/styles.js";
|
|
5
|
+
const j = C.memo(function({ size: n }) {
|
|
6
|
+
return /* @__PURE__ */ y(
|
|
7
7
|
"svg",
|
|
8
8
|
{
|
|
9
9
|
width: n,
|
|
@@ -44,66 +44,70 @@ const D = N.memo(function({ size: n }) {
|
|
|
44
44
|
}
|
|
45
45
|
);
|
|
46
46
|
}), $ = ({
|
|
47
|
-
as:
|
|
47
|
+
as: r,
|
|
48
48
|
variant: n = "solid",
|
|
49
|
-
intent:
|
|
49
|
+
intent: f = "primary",
|
|
50
50
|
size: c = "md",
|
|
51
|
-
fullWidth:
|
|
51
|
+
fullWidth: h,
|
|
52
52
|
isLoading: e,
|
|
53
53
|
isDisabled: k,
|
|
54
|
-
leftIcon:
|
|
55
|
-
rightIcon:
|
|
56
|
-
isIconOnly:
|
|
54
|
+
leftIcon: l,
|
|
55
|
+
rightIcon: u,
|
|
56
|
+
isIconOnly: o,
|
|
57
57
|
className: x,
|
|
58
58
|
style: B,
|
|
59
|
-
children:
|
|
59
|
+
children: d,
|
|
60
60
|
testId: S,
|
|
61
|
-
...
|
|
61
|
+
...i
|
|
62
62
|
}, w) => {
|
|
63
|
-
const
|
|
63
|
+
const b = r || "button", a = k || e, s = g[c];
|
|
64
|
+
typeof process < "u" && process.env.NODE_ENV !== "production" && o && !i["aria-label"] && !i["aria-labelledby"] && console.warn(
|
|
65
|
+
"Brycks: an icon-only Button/IconButton has no accessible name. Pass `aria-label` or `aria-labelledby`."
|
|
66
|
+
);
|
|
67
|
+
const N = {
|
|
64
68
|
display: "inline-flex",
|
|
65
69
|
alignItems: "center",
|
|
66
70
|
justifyContent: "center",
|
|
67
71
|
...B
|
|
68
|
-
},
|
|
72
|
+
}, v = D(
|
|
69
73
|
"brycks-button",
|
|
70
74
|
`brycks-button--${n}`,
|
|
71
|
-
`brycks-button--${
|
|
75
|
+
`brycks-button--${f}`,
|
|
72
76
|
`brycks-button--${c}`,
|
|
73
|
-
|
|
74
|
-
|
|
77
|
+
h && "brycks-button--full-width",
|
|
78
|
+
o && "brycks-button--icon-only",
|
|
75
79
|
e && "brycks-button--loading",
|
|
76
|
-
|
|
80
|
+
a && "brycks-button--disabled",
|
|
77
81
|
x
|
|
78
|
-
),
|
|
79
|
-
type:
|
|
80
|
-
disabled:
|
|
82
|
+
), z = b === "button" || r === void 0 ? {
|
|
83
|
+
type: i.type ?? "button",
|
|
84
|
+
disabled: a
|
|
81
85
|
} : {
|
|
82
|
-
"aria-disabled":
|
|
86
|
+
"aria-disabled": a || void 0,
|
|
83
87
|
role: "button",
|
|
84
|
-
tabIndex:
|
|
88
|
+
tabIndex: a ? -1 : 0
|
|
85
89
|
};
|
|
86
|
-
return /* @__PURE__ */
|
|
87
|
-
|
|
90
|
+
return /* @__PURE__ */ y(
|
|
91
|
+
b,
|
|
88
92
|
{
|
|
89
93
|
ref: w,
|
|
90
|
-
className:
|
|
91
|
-
style:
|
|
94
|
+
className: v,
|
|
95
|
+
style: N,
|
|
92
96
|
"data-testid": S,
|
|
93
|
-
...
|
|
94
|
-
...
|
|
97
|
+
...z,
|
|
98
|
+
...i,
|
|
95
99
|
children: [
|
|
96
100
|
e && /* @__PURE__ */ t(
|
|
97
101
|
"span",
|
|
98
102
|
{
|
|
99
103
|
style: {
|
|
100
104
|
display: "inline-flex",
|
|
101
|
-
position:
|
|
105
|
+
position: o ? "absolute" : "relative"
|
|
102
106
|
},
|
|
103
|
-
children: /* @__PURE__ */ t(
|
|
107
|
+
children: /* @__PURE__ */ t(j, { size: s.iconSize })
|
|
104
108
|
}
|
|
105
109
|
),
|
|
106
|
-
!e &&
|
|
110
|
+
!e && l && /* @__PURE__ */ t(
|
|
107
111
|
"span",
|
|
108
112
|
{
|
|
109
113
|
style: {
|
|
@@ -111,19 +115,19 @@ const D = N.memo(function({ size: n }) {
|
|
|
111
115
|
width: s.iconSize,
|
|
112
116
|
height: s.iconSize
|
|
113
117
|
},
|
|
114
|
-
children:
|
|
118
|
+
children: l
|
|
115
119
|
}
|
|
116
120
|
),
|
|
117
|
-
!
|
|
121
|
+
!o && /* @__PURE__ */ t(
|
|
118
122
|
"span",
|
|
119
123
|
{
|
|
120
124
|
style: {
|
|
121
|
-
opacity: e && !
|
|
125
|
+
opacity: e && !o ? 0.5 : 1
|
|
122
126
|
},
|
|
123
|
-
children:
|
|
127
|
+
children: d
|
|
124
128
|
}
|
|
125
129
|
),
|
|
126
|
-
!e &&
|
|
130
|
+
!e && u && /* @__PURE__ */ t(
|
|
127
131
|
"span",
|
|
128
132
|
{
|
|
129
133
|
style: {
|
|
@@ -131,19 +135,19 @@ const D = N.memo(function({ size: n }) {
|
|
|
131
135
|
width: s.iconSize,
|
|
132
136
|
height: s.iconSize
|
|
133
137
|
},
|
|
134
|
-
children:
|
|
138
|
+
children: u
|
|
135
139
|
}
|
|
136
140
|
),
|
|
137
|
-
|
|
141
|
+
o && !e && d
|
|
138
142
|
]
|
|
139
143
|
}
|
|
140
144
|
);
|
|
141
145
|
}, m = p($);
|
|
142
146
|
m.displayName = "Button";
|
|
143
|
-
const
|
|
144
|
-
|
|
147
|
+
const E = (r, n) => /* @__PURE__ */ t(m, { ref: n, isIconOnly: !0, ...r }), I = p(E);
|
|
148
|
+
I.displayName = "IconButton";
|
|
145
149
|
export {
|
|
146
150
|
m as Button,
|
|
147
|
-
|
|
151
|
+
I as IconButton
|
|
148
152
|
};
|
|
149
153
|
//# sourceMappingURL=Button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["../../../../src/components/primitives/Button/Button.tsx"],"sourcesContent":["/**\r\n * Button Component\r\n *\r\n * A versatile, polymorphic button component with multiple variants,\r\n * sizes, and states. Designed with Apple-inspired aesthetics -\r\n * smooth transitions, tactile feedback, and refined visual details.\r\n *\r\n * All color styles are handled via CSS classes for easy customization.\r\n * Layout styles (display, alignment) use inline styles for flexibility.\r\n */\r\n\r\nimport React, {\r\n forwardRef,\r\n type ElementType,\r\n type ComponentPropsWithRef,\r\n type CSSProperties,\r\n} from 'react'\r\nimport type { ButtonProps } from './Button.types'\r\nimport { sizeConfig } from './Button.styles'\r\nimport { cx } from '../../../utils/styles'\r\n\r\ninterface ButtonComponent {\r\n <E extends ElementType = 'button'>(\r\n props: ButtonProps<E> & { ref?: ComponentPropsWithRef<E>['ref'] }\r\n ): React.JSX.Element | null\r\n displayName?: string\r\n}\r\n\r\n/** Loading spinner component - uses global CSS keyframes */\r\nconst LoadingSpinner = React.memo(function LoadingSpinner({ size }: { size: number }) {\r\n return (\r\n <svg\r\n width={size}\r\n height={size}\r\n viewBox=\"0 0 24 24\"\r\n fill=\"none\"\r\n className=\"brycks-animate-spin\"\r\n aria-hidden=\"true\"\r\n >\r\n <circle\r\n cx=\"12\"\r\n cy=\"12\"\r\n r=\"10\"\r\n stroke=\"currentColor\"\r\n strokeWidth=\"2\"\r\n strokeLinecap=\"round\"\r\n strokeDasharray=\"31.4 31.4\"\r\n opacity=\"0.25\"\r\n />\r\n <circle\r\n cx=\"12\"\r\n cy=\"12\"\r\n r=\"10\"\r\n stroke=\"currentColor\"\r\n strokeWidth=\"2\"\r\n strokeLinecap=\"round\"\r\n strokeDasharray=\"31.4 31.4\"\r\n strokeDashoffset=\"62.8\"\r\n style={{ transform: 'rotate(-90deg)', transformOrigin: 'center' }}\r\n />\r\n </svg>\r\n )\r\n})\r\n\r\nconst ButtonInner = <E extends ElementType = 'button'>(\r\n {\r\n as,\r\n variant = 'solid',\r\n intent = 'primary',\r\n size = 'md',\r\n fullWidth,\r\n isLoading,\r\n isDisabled,\r\n leftIcon,\r\n rightIcon,\r\n isIconOnly,\r\n className,\r\n style,\r\n children,\r\n testId,\r\n ...props\r\n }: ButtonProps<E>,\r\n ref: React.ForwardedRef<Element>\r\n) => {\r\n const Component = (as || 'button') as ElementType\r\n\r\n const disabled = isDisabled || isLoading\r\n\r\n const sizeValues = sizeConfig[size]\r\n\r\n // Layout-only inline styles (colors handled by CSS classes)\r\n const layoutStyle: CSSProperties = {\r\n display: 'inline-flex',\r\n alignItems: 'center',\r\n justifyContent: 'center',\r\n ...style,\r\n }\r\n\r\n // Build class name - CSS handles all colors and states\r\n const buttonClassName = cx(\r\n 'brycks-button',\r\n `brycks-button--${variant}`,\r\n `brycks-button--${intent}`,\r\n `brycks-button--${size}`,\r\n fullWidth && 'brycks-button--full-width',\r\n isIconOnly && 'brycks-button--icon-only',\r\n isLoading && 'brycks-button--loading',\r\n disabled && 'brycks-button--disabled',\r\n className\r\n )\r\n\r\n const isButton = Component === 'button' || as === undefined\r\n const buttonProps = isButton\r\n ? {\r\n type: (props as { type?: string }).type ?? 'button',\r\n disabled,\r\n }\r\n : {\r\n 'aria-disabled': disabled || undefined,\r\n role: 'button',\r\n tabIndex: disabled ? -1 : 0,\r\n }\r\n\r\n return (\r\n <Component\r\n ref={ref}\r\n className={buttonClassName}\r\n style={layoutStyle}\r\n data-testid={testId}\r\n {...buttonProps}\r\n {...props}\r\n >\r\n {isLoading && (\r\n <span\r\n style={{\r\n display: 'inline-flex',\r\n position: isIconOnly ? 'absolute' : 'relative',\r\n }}\r\n >\r\n <LoadingSpinner size={sizeValues.iconSize} />\r\n </span>\r\n )}\r\n\r\n {!isLoading && leftIcon && (\r\n <span\r\n style={{\r\n display: 'inline-flex',\r\n width: sizeValues.iconSize,\r\n height: sizeValues.iconSize,\r\n }}\r\n >\r\n {leftIcon}\r\n </span>\r\n )}\r\n\r\n {!isIconOnly && (\r\n <span\r\n style={{\r\n opacity: isLoading && !isIconOnly ? 0.5 : 1,\r\n }}\r\n >\r\n {children}\r\n </span>\r\n )}\r\n\r\n {!isLoading && rightIcon && (\r\n <span\r\n style={{\r\n display: 'inline-flex',\r\n width: sizeValues.iconSize,\r\n height: sizeValues.iconSize,\r\n }}\r\n >\r\n {rightIcon}\r\n </span>\r\n )}\r\n\r\n {isIconOnly && !isLoading && children}\r\n </Component>\r\n )\r\n}\r\n\r\nexport const Button = forwardRef(ButtonInner) as ButtonComponent\r\n\r\nButton.displayName = 'Button'\r\n\r\n/** Icon button shorthand */\r\nconst IconButtonInner = <E extends ElementType = 'button'>(\r\n props: Omit<ButtonProps<E>, 'isIconOnly'>,\r\n ref: React.ForwardedRef<Element>\r\n) => {\r\n return <Button ref={ref as React.ForwardedRef<HTMLButtonElement>} isIconOnly {...(props as ButtonProps<'button'>)} />\r\n}\r\n\r\nexport const IconButton = forwardRef(IconButtonInner) as ButtonComponent\r\n\r\nIconButton.displayName = 'IconButton'\r\n"],"names":["LoadingSpinner","React","size","jsxs","jsx","ButtonInner","as","variant","intent","fullWidth","isLoading","isDisabled","leftIcon","rightIcon","isIconOnly","className","style","children","testId","props","ref","Component","disabled","sizeValues","sizeConfig","layoutStyle","buttonClassName","cx","buttonProps","Button","forwardRef","IconButtonInner","IconButton"],"mappings":";;;;AA6BA,MAAMA,IAAiBC,EAAM,KAAK,SAAwB,EAAE,MAAAC,KAA0B;AACpF,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,OAAOD;AAAA,MACP,QAAQA;AAAA,MACR,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,WAAU;AAAA,MACV,eAAY;AAAA,MAEZ,UAAA;AAAA,QAAA,gBAAAE;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,IAAG;AAAA,YACH,IAAG;AAAA,YACH,GAAE;AAAA,YACF,QAAO;AAAA,YACP,aAAY;AAAA,YACZ,eAAc;AAAA,YACd,iBAAgB;AAAA,YAChB,SAAQ;AAAA,UAAA;AAAA,QAAA;AAAA,QAEV,gBAAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,IAAG;AAAA,YACH,IAAG;AAAA,YACH,GAAE;AAAA,YACF,QAAO;AAAA,YACP,aAAY;AAAA,YACZ,eAAc;AAAA,YACd,iBAAgB;AAAA,YAChB,kBAAiB;AAAA,YACjB,OAAO,EAAE,WAAW,kBAAkB,iBAAiB,SAAA;AAAA,UAAS;AAAA,QAAA;AAAA,MAClE;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC,GAEKC,IAAc,CAClB;AAAA,EACE,IAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,QAAAC,IAAS;AAAA,EACT,MAAAN,IAAO;AAAA,EACP,WAAAO;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,GAAGC;AACL,GACAC,MACG;AACH,QAAMC,IAAaf,KAAM,UAEnBgB,IAAWX,KAAcD,GAEzBa,IAAaC,EAAWtB,CAAI,
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../../../../src/components/primitives/Button/Button.tsx"],"sourcesContent":["/**\r\n * Button Component\r\n *\r\n * A versatile, polymorphic button component with multiple variants,\r\n * sizes, and states. Designed with Apple-inspired aesthetics -\r\n * smooth transitions, tactile feedback, and refined visual details.\r\n *\r\n * All color styles are handled via CSS classes for easy customization.\r\n * Layout styles (display, alignment) use inline styles for flexibility.\r\n */\r\n\r\nimport React, {\r\n forwardRef,\r\n type ElementType,\r\n type ComponentPropsWithRef,\r\n type CSSProperties,\r\n} from 'react'\r\nimport type { ButtonProps } from './Button.types'\r\nimport { sizeConfig } from './Button.styles'\r\nimport { cx } from '../../../utils/styles'\r\n\r\ninterface ButtonComponent {\r\n <E extends ElementType = 'button'>(\r\n props: ButtonProps<E> & { ref?: ComponentPropsWithRef<E>['ref'] }\r\n ): React.JSX.Element | null\r\n displayName?: string\r\n}\r\n\r\n/** Loading spinner component - uses global CSS keyframes */\r\nconst LoadingSpinner = React.memo(function LoadingSpinner({ size }: { size: number }) {\r\n return (\r\n <svg\r\n width={size}\r\n height={size}\r\n viewBox=\"0 0 24 24\"\r\n fill=\"none\"\r\n className=\"brycks-animate-spin\"\r\n aria-hidden=\"true\"\r\n >\r\n <circle\r\n cx=\"12\"\r\n cy=\"12\"\r\n r=\"10\"\r\n stroke=\"currentColor\"\r\n strokeWidth=\"2\"\r\n strokeLinecap=\"round\"\r\n strokeDasharray=\"31.4 31.4\"\r\n opacity=\"0.25\"\r\n />\r\n <circle\r\n cx=\"12\"\r\n cy=\"12\"\r\n r=\"10\"\r\n stroke=\"currentColor\"\r\n strokeWidth=\"2\"\r\n strokeLinecap=\"round\"\r\n strokeDasharray=\"31.4 31.4\"\r\n strokeDashoffset=\"62.8\"\r\n style={{ transform: 'rotate(-90deg)', transformOrigin: 'center' }}\r\n />\r\n </svg>\r\n )\r\n})\r\n\r\nconst ButtonInner = <E extends ElementType = 'button'>(\r\n {\r\n as,\r\n variant = 'solid',\r\n intent = 'primary',\r\n size = 'md',\r\n fullWidth,\r\n isLoading,\r\n isDisabled,\r\n leftIcon,\r\n rightIcon,\r\n isIconOnly,\r\n className,\r\n style,\r\n children,\r\n testId,\r\n ...props\r\n }: ButtonProps<E>,\r\n ref: React.ForwardedRef<Element>\r\n) => {\r\n const Component = (as || 'button') as ElementType\r\n\r\n const disabled = isDisabled || isLoading\r\n\r\n const sizeValues = sizeConfig[size]\r\n\r\n // Dev-only a11y guard: an icon-only button has no text, so it needs an\r\n // accessible name. Reliable across the polymorphic `as` API where a type\r\n // constraint isn't (the check is stripped from production builds).\r\n if (\r\n typeof process !== 'undefined' &&\r\n process.env.NODE_ENV !== 'production' &&\r\n isIconOnly &&\r\n !(props as Record<string, unknown>)['aria-label'] &&\r\n !(props as Record<string, unknown>)['aria-labelledby']\r\n ) {\r\n console.warn(\r\n 'Brycks: an icon-only Button/IconButton has no accessible name. Pass `aria-label` or `aria-labelledby`.'\r\n )\r\n }\r\n\r\n // Layout-only inline styles (colors handled by CSS classes)\r\n const layoutStyle: CSSProperties = {\r\n display: 'inline-flex',\r\n alignItems: 'center',\r\n justifyContent: 'center',\r\n ...style,\r\n }\r\n\r\n // Build class name - CSS handles all colors and states\r\n const buttonClassName = cx(\r\n 'brycks-button',\r\n `brycks-button--${variant}`,\r\n `brycks-button--${intent}`,\r\n `brycks-button--${size}`,\r\n fullWidth && 'brycks-button--full-width',\r\n isIconOnly && 'brycks-button--icon-only',\r\n isLoading && 'brycks-button--loading',\r\n disabled && 'brycks-button--disabled',\r\n className\r\n )\r\n\r\n const isButton = Component === 'button' || as === undefined\r\n const buttonProps = isButton\r\n ? {\r\n type: (props as { type?: string }).type ?? 'button',\r\n disabled,\r\n }\r\n : {\r\n 'aria-disabled': disabled || undefined,\r\n role: 'button',\r\n tabIndex: disabled ? -1 : 0,\r\n }\r\n\r\n return (\r\n <Component\r\n ref={ref}\r\n className={buttonClassName}\r\n style={layoutStyle}\r\n data-testid={testId}\r\n {...buttonProps}\r\n {...props}\r\n >\r\n {isLoading && (\r\n <span\r\n style={{\r\n display: 'inline-flex',\r\n position: isIconOnly ? 'absolute' : 'relative',\r\n }}\r\n >\r\n <LoadingSpinner size={sizeValues.iconSize} />\r\n </span>\r\n )}\r\n\r\n {!isLoading && leftIcon && (\r\n <span\r\n style={{\r\n display: 'inline-flex',\r\n width: sizeValues.iconSize,\r\n height: sizeValues.iconSize,\r\n }}\r\n >\r\n {leftIcon}\r\n </span>\r\n )}\r\n\r\n {!isIconOnly && (\r\n <span\r\n style={{\r\n opacity: isLoading && !isIconOnly ? 0.5 : 1,\r\n }}\r\n >\r\n {children}\r\n </span>\r\n )}\r\n\r\n {!isLoading && rightIcon && (\r\n <span\r\n style={{\r\n display: 'inline-flex',\r\n width: sizeValues.iconSize,\r\n height: sizeValues.iconSize,\r\n }}\r\n >\r\n {rightIcon}\r\n </span>\r\n )}\r\n\r\n {isIconOnly && !isLoading && children}\r\n </Component>\r\n )\r\n}\r\n\r\nexport const Button = forwardRef(ButtonInner) as ButtonComponent\r\n\r\nButton.displayName = 'Button'\r\n\r\n/** Icon button shorthand */\r\nconst IconButtonInner = <E extends ElementType = 'button'>(\r\n props: Omit<ButtonProps<E>, 'isIconOnly'>,\r\n ref: React.ForwardedRef<Element>\r\n) => {\r\n return <Button ref={ref as React.ForwardedRef<HTMLButtonElement>} isIconOnly {...(props as ButtonProps<'button'>)} />\r\n}\r\n\r\nexport const IconButton = forwardRef(IconButtonInner) as ButtonComponent\r\n\r\nIconButton.displayName = 'IconButton'\r\n"],"names":["LoadingSpinner","React","size","jsxs","jsx","ButtonInner","as","variant","intent","fullWidth","isLoading","isDisabled","leftIcon","rightIcon","isIconOnly","className","style","children","testId","props","ref","Component","disabled","sizeValues","sizeConfig","layoutStyle","buttonClassName","cx","buttonProps","Button","forwardRef","IconButtonInner","IconButton"],"mappings":";;;;AA6BA,MAAMA,IAAiBC,EAAM,KAAK,SAAwB,EAAE,MAAAC,KAA0B;AACpF,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,OAAOD;AAAA,MACP,QAAQA;AAAA,MACR,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,WAAU;AAAA,MACV,eAAY;AAAA,MAEZ,UAAA;AAAA,QAAA,gBAAAE;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,IAAG;AAAA,YACH,IAAG;AAAA,YACH,GAAE;AAAA,YACF,QAAO;AAAA,YACP,aAAY;AAAA,YACZ,eAAc;AAAA,YACd,iBAAgB;AAAA,YAChB,SAAQ;AAAA,UAAA;AAAA,QAAA;AAAA,QAEV,gBAAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,IAAG;AAAA,YACH,IAAG;AAAA,YACH,GAAE;AAAA,YACF,QAAO;AAAA,YACP,aAAY;AAAA,YACZ,eAAc;AAAA,YACd,iBAAgB;AAAA,YAChB,kBAAiB;AAAA,YACjB,OAAO,EAAE,WAAW,kBAAkB,iBAAiB,SAAA;AAAA,UAAS;AAAA,QAAA;AAAA,MAClE;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC,GAEKC,IAAc,CAClB;AAAA,EACE,IAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,QAAAC,IAAS;AAAA,EACT,MAAAN,IAAO;AAAA,EACP,WAAAO;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA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