@adgytec/adgytec-web-ui-components 2.1.6 → 2.1.8
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/assets/core.css +1 -1
- package/dist/chunks/ActionDialog.map +1 -1
- package/dist/chunks/AppBarAction.map +1 -1
- package/dist/chunks/AppBarAvatar +38 -30
- package/dist/chunks/AppBarAvatar.map +1 -1
- package/dist/chunks/AppBarHeadline +18 -12
- package/dist/chunks/AppBarHeadline.map +1 -1
- package/dist/chunks/BaseCalendar.map +1 -1
- package/dist/chunks/BottomSheet +23 -16
- package/dist/chunks/BottomSheet.map +1 -1
- package/dist/chunks/BottomSheetModal.map +1 -1
- package/dist/chunks/ButtonGroup +28 -20
- package/dist/chunks/ButtonGroup.map +1 -1
- package/dist/chunks/CalendarCell.map +1 -1
- package/dist/chunks/CalendarGrid +40 -22
- package/dist/chunks/CalendarGrid.map +1 -1
- package/dist/chunks/CalendarMenuItem +18 -9
- package/dist/chunks/CalendarMenuItem.map +1 -1
- package/dist/chunks/CenteredSlider.map +1 -1
- package/dist/chunks/ComboBox.map +1 -1
- package/dist/chunks/ComboBoxPopover.map +1 -1
- package/dist/chunks/ComboBoxTrigger +66 -44
- package/dist/chunks/ComboBoxTrigger.map +1 -1
- package/dist/chunks/ConnectedButtonGroup.map +1 -1
- package/dist/chunks/Dialog +21 -12
- package/dist/chunks/Dialog.map +1 -1
- package/dist/chunks/Disclosure +17 -8
- package/dist/chunks/Disclosure.map +1 -1
- package/dist/chunks/DisclosureGroup +28 -15
- package/dist/chunks/DisclosureGroup.map +1 -1
- package/dist/chunks/DisclosureHeader +53 -35
- package/dist/chunks/DisclosureHeader.map +1 -1
- package/dist/chunks/DisclosurePanel +22 -12
- package/dist/chunks/DisclosurePanel.map +1 -1
- package/dist/chunks/Divider +18 -9
- package/dist/chunks/Divider.map +1 -1
- package/dist/chunks/FieldError +18 -9
- package/dist/chunks/FieldError.map +1 -1
- package/dist/chunks/Icon +20 -15
- package/dist/chunks/Icon.map +1 -1
- package/dist/chunks/Input +72 -64
- package/dist/chunks/Input.map +1 -1
- package/dist/chunks/Input2 +82 -72
- package/dist/chunks/Input2.map +1 -1
- package/dist/chunks/Loader +17 -10
- package/dist/chunks/Loader.map +1 -1
- package/dist/chunks/MenuPopover +17 -8
- package/dist/chunks/MenuPopover.map +1 -1
- package/dist/chunks/Modal +17 -8
- package/dist/chunks/Modal.map +1 -1
- package/dist/chunks/ModalOverlay +17 -8
- package/dist/chunks/ModalOverlay.map +1 -1
- package/dist/chunks/Navigation +46 -36
- package/dist/chunks/Navigation.map +1 -1
- package/dist/chunks/NavigationScrollContainer +37 -27
- package/dist/chunks/NavigationScrollContainer.map +1 -1
- package/dist/chunks/NavigationSection +16 -7
- package/dist/chunks/NavigationSection.map +1 -1
- package/dist/chunks/NavigationSectionLabel +18 -9
- package/dist/chunks/NavigationSectionLabel.map +1 -1
- package/dist/chunks/NavigationState.map +1 -1
- package/dist/chunks/Popover +17 -8
- package/dist/chunks/Popover.map +1 -1
- package/dist/chunks/Radio +59 -52
- package/dist/chunks/Radio.map +1 -1
- package/dist/chunks/RichTooltip +17 -8
- package/dist/chunks/RichTooltip.map +1 -1
- package/dist/chunks/RichTooltipActions +16 -7
- package/dist/chunks/RichTooltipActions.map +1 -1
- package/dist/chunks/RichTooltipInfo +16 -7
- package/dist/chunks/RichTooltipInfo.map +1 -1
- package/dist/chunks/SearchField.map +1 -1
- package/dist/chunks/SelectPopover +17 -8
- package/dist/chunks/SelectPopover.map +1 -1
- package/dist/chunks/SelectTrigger +34 -24
- package/dist/chunks/SelectTrigger.map +1 -1
- package/dist/chunks/SideSheet +64 -52
- package/dist/chunks/SideSheet.map +1 -1
- package/dist/chunks/SideSheetModal.map +1 -1
- package/dist/chunks/Slider.map +1 -1
- package/dist/chunks/SliderOutput +21 -16
- package/dist/chunks/SliderOutput.map +1 -1
- package/dist/chunks/SliderStops.map +1 -1
- package/dist/chunks/Snackbar.map +1 -1
- package/dist/chunks/SplitButtonTrigger +48 -38
- package/dist/chunks/SplitButtonTrigger.map +1 -1
- package/dist/chunks/SubmenuPopover.map +1 -1
- package/dist/chunks/Switch.map +1 -1
- package/dist/chunks/Tab +41 -29
- package/dist/chunks/Tab.map +1 -1
- package/dist/chunks/TabList +16 -8
- package/dist/chunks/TabList.map +1 -1
- package/dist/chunks/TabPanel +16 -8
- package/dist/chunks/TabPanel.map +1 -1
- package/dist/chunks/TabPanels +17 -9
- package/dist/chunks/TabPanels.map +1 -1
- package/dist/chunks/Tabs +17 -8
- package/dist/chunks/Tabs.map +1 -1
- package/dist/chunks/Tag.map +1 -1
- package/dist/chunks/ThemeSelector +73 -72
- package/dist/chunks/ThemeSelector.map +1 -1
- package/dist/chunks/Toolbar +20 -12
- package/dist/chunks/Toolbar.map +1 -1
- package/dist/chunks/Tooltip.map +1 -1
- package/dist/chunks/compiler-runtime +24 -0
- package/dist/chunks/compiler-runtime.map +1 -0
- package/dist/chunks/core +75 -68
- package/dist/chunks/core.map +1 -1
- package/dist/chunks/core3.map +1 -1
- package/dist/chunks/core8.map +1 -1
- package/dist/chunks/core9.map +1 -1
- package/dist/chunks/navContext.map +1 -1
- package/dist/chunks/useGlobalListeners.map +1 -1
- package/dist/chunks/useHover +1 -1
- package/dist/chunks/useHover.map +1 -1
- package/dist/chunks/usePress +1 -1
- package/dist/chunks/usePress.map +1 -1
- package/dist/chunks/useSplash +42 -27
- package/dist/chunks/useSplash.map +1 -1
- package/dist/components/AppBar/core/index.js.map +1 -1
- package/dist/components/Button/Button/index.js +61 -48
- package/dist/components/Button/Button/index.js.map +1 -1
- package/dist/components/Button/ButtonGroups/ButtonGroupContext/index.js.map +1 -1
- package/dist/components/Button/IconButton/index.js.map +1 -1
- package/dist/components/Button/LinkButton/index.js +61 -48
- package/dist/components/Button/LinkButton/index.js.map +1 -1
- package/dist/components/Button/LinkIconButton/index.js.map +1 -1
- package/dist/components/Button/SplitButton/SplitButtonContext/index.js.map +1 -1
- package/dist/components/Button/SplitButton/SplitButtonPrimary/index.js.map +1 -1
- package/dist/components/Button/ToggleButton/index.js +69 -54
- package/dist/components/Button/ToggleButton/index.js.map +1 -1
- package/dist/components/Button/ToggleIconButton/index.js.map +1 -1
- package/dist/components/Calendar/Calendar/index.js +22 -12
- package/dist/components/Calendar/Calendar/index.js.map +1 -1
- package/dist/components/Calendar/CalendarMonthMenu/index.js +38 -33
- package/dist/components/Calendar/CalendarMonthMenu/index.js.map +1 -1
- package/dist/components/Calendar/CalendarYearMenu/index.js +31 -26
- package/dist/components/Calendar/CalendarYearMenu/index.js.map +1 -1
- package/dist/components/Calendar/RangeCalendar/index.js +25 -15
- package/dist/components/Calendar/RangeCalendar/index.js.map +1 -1
- package/dist/components/Dialog/core/index.js.map +1 -1
- package/dist/components/Disclosure/context/index.js +11 -12
- package/dist/components/Disclosure/context/index.js.map +1 -1
- package/dist/components/Image/index.js.map +1 -1
- package/dist/components/Input/CharacterCount/index.js +18 -10
- package/dist/components/Input/CharacterCount/index.js.map +1 -1
- package/dist/components/Input/DateField/index.js.map +1 -1
- package/dist/components/Input/DatePicker/DatePicker/index.js.map +1 -1
- package/dist/components/Input/DatePicker/DateRangePicker/index.js.map +1 -1
- package/dist/components/Input/Description/index.js +21 -10
- package/dist/components/Input/Description/index.js.map +1 -1
- package/dist/components/Input/Label/index.js +18 -10
- package/dist/components/Input/Label/index.js.map +1 -1
- package/dist/components/Input/Select/Select/index.js.map +1 -1
- package/dist/components/Input/Select/SelectItem/index.js.map +1 -1
- package/dist/components/Input/Select/SelectList/index.js.map +1 -1
- package/dist/components/Input/Select/SelectListSection/index.js +17 -9
- package/dist/components/Input/Select/SelectListSection/index.js.map +1 -1
- package/dist/components/Input/Select/SelectListSectionHeader/index.js +18 -10
- package/dist/components/Input/Select/SelectListSectionHeader/index.js.map +1 -1
- package/dist/components/Input/Slider/RangeSlider/index.js.map +1 -1
- package/dist/components/Input/TextArea/index.js.map +1 -1
- package/dist/components/Input/TimeField/index.js.map +1 -1
- package/dist/components/Input/hooks/index.js +16 -10
- package/dist/components/Input/hooks/index.js.map +1 -1
- package/dist/components/Menu/Menu/index.js +19 -14
- package/dist/components/Menu/Menu/index.js.map +1 -1
- package/dist/components/Menu/MenuItem/index.js +48 -38
- package/dist/components/Menu/MenuItem/index.js.map +1 -1
- package/dist/components/Menu/MenuSection/index.js +18 -10
- package/dist/components/Menu/MenuSection/index.js.map +1 -1
- package/dist/components/Menu/MenuSectionHeader/index.js +18 -10
- package/dist/components/Menu/MenuSectionHeader/index.js.map +1 -1
- package/dist/components/Menu/MenuShortcut/index.js +16 -8
- package/dist/components/Menu/MenuShortcut/index.js.map +1 -1
- package/dist/components/Menu/MenuTrailingText/index.js +16 -8
- package/dist/components/Menu/MenuTrailingText/index.js.map +1 -1
- package/dist/components/Menu/MenuTrigger/index.js +21 -11
- package/dist/components/Menu/MenuTrigger/index.js.map +1 -1
- package/dist/components/Menu/context/index.js.map +1 -1
- package/dist/components/Navigation/NavigationItem/NavigationButton/index.js +30 -21
- package/dist/components/Navigation/NavigationItem/NavigationButton/index.js.map +1 -1
- package/dist/components/Navigation/NavigationItem/NavigationItemIconRenderer/index.js +30 -8
- package/dist/components/Navigation/NavigationItem/NavigationItemIconRenderer/index.js.map +1 -1
- package/dist/components/Navigation/NavigationItem/NavigationLink/index.js +29 -20
- package/dist/components/Navigation/NavigationItem/NavigationLink/index.js.map +1 -1
- package/dist/components/Navigation/SubNavigation/SubNavigation/index.js +69 -56
- package/dist/components/Navigation/SubNavigation/SubNavigation/index.js.map +1 -1
- package/dist/components/Navigation/SubNavigation/SubNavigationTrigger/index.js +48 -29
- package/dist/components/Navigation/SubNavigation/SubNavigationTrigger/index.js.map +1 -1
- package/dist/components/Tooltip/RichTooltip/RichTooltipInfo/RichTooltipSubhead/index.js +17 -9
- package/dist/components/Tooltip/RichTooltip/RichTooltipInfo/RichTooltipSubhead/index.js.map +1 -1
- package/dist/components/Tooltip/RichTooltip/RichTooltipInfo/RichTooltipText/index.js +17 -9
- package/dist/components/Tooltip/RichTooltip/RichTooltipInfo/RichTooltipText/index.js.map +1 -1
- package/dist/components/Tooltip/TooltipTrigger/index.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/src/components/Navigation/NavigationItem/core/navigationItem.d.ts +1 -1
- package/package.json +4 -4
|
@@ -1,56 +1,69 @@
|
|
|
1
|
-
import { t as e } from "../../../chunks/
|
|
2
|
-
import { t } from "../../../chunks/
|
|
3
|
-
import { t as n } from "../../../chunks/
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
import { t as e } from "../../../chunks/compiler-runtime";
|
|
2
|
+
import { t } from "../../../chunks/tapTarget";
|
|
3
|
+
import { t as n } from "../../../chunks/Icon";
|
|
4
|
+
import { t as r } from "../../../chunks/Loader";
|
|
5
|
+
import { n as i, t as a } from "../../../chunks/useSplash";
|
|
6
|
+
import { a as o, c as s, d as c, f as l, i as u, l as d, n as f, o as p, p as m, t as h, u as g } from "../../../chunks/core";
|
|
7
|
+
import { clsx as _ } from "clsx";
|
|
8
|
+
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
9
|
+
import { Button as b } from "react-aria-components";
|
|
9
10
|
//#region src/components/Button/Button/Button.tsx
|
|
10
|
-
var
|
|
11
|
-
let
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
var x = e(), S = (e) => {
|
|
12
|
+
let S = (0, x.c)(41), C, w, T, E, D, O, k, A, j, M;
|
|
13
|
+
S[0] === e ? (C = S[1], w = S[2], T = S[3], E = S[4], D = S[5], O = S[6], k = S[7], A = S[8], j = S[9], M = S[10]) : ({size: j, shape: A, color: T, tooltip: M, icon: E, children: C, onPress: O, iconPlacement: D, className: w, ...k} = e, S[0] = e, S[1] = C, S[2] = w, S[3] = T, S[4] = E, S[5] = D, S[6] = O, S[7] = k, S[8] = A, S[9] = j, S[10] = M);
|
|
14
|
+
let N;
|
|
15
|
+
S[11] !== T || S[12] !== D || S[13] !== A || S[14] !== j ? (N = {
|
|
16
|
+
size: j,
|
|
17
|
+
shape: A,
|
|
18
|
+
color: T,
|
|
15
19
|
iconPlacement: D
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
}, S[11] = T, S[12] = D, S[13] = A, S[14] = j, S[15] = N) : N = S[15];
|
|
21
|
+
let { buttonColor: P, buttonShape: F, buttonSize: I, buttonIconPlacement: L } = f(N), { splashInfo: R, handlePress: z } = a(O), B = typeof C == "function", V;
|
|
22
|
+
S[16] !== P || S[17] !== F || S[18] !== I ? (V = m({
|
|
23
|
+
shape: F,
|
|
24
|
+
size: I,
|
|
25
|
+
color: P
|
|
26
|
+
}), S[16] = P, S[17] = F, S[18] = I, S[19] = V) : V = S[19];
|
|
27
|
+
let H = V, U;
|
|
28
|
+
S[20] !== P || S[21] !== I || S[22] !== w ? (U = (e) => _(l, t, s(I), g(P), typeof w == "function" ? w(e) : w), S[20] = P, S[21] = I, S[22] = w, S[23] = U) : U = S[23];
|
|
29
|
+
let W;
|
|
30
|
+
S[24] !== H || S[25] !== L || S[26] !== I || S[27] !== C || S[28] !== E || S[29] !== B || S[30] !== R ? (W = (e) => {
|
|
31
|
+
let { isPending: t, isDisabled: a, isFocusVisible: s, isFocused: l, isPressed: f, isHovered: m } = e, h = {
|
|
32
|
+
...H,
|
|
33
|
+
"data-hovered": m || void 0,
|
|
34
|
+
"data-disabled": a || void 0,
|
|
35
|
+
"data-focused": l || void 0,
|
|
36
|
+
"data-focus-visible": s || void 0,
|
|
37
|
+
"data-pressed": f || void 0,
|
|
38
|
+
"data-visual-button": !0
|
|
39
|
+
}, g = u[I], b = t ? /* @__PURE__ */ v(r, { size: g }) : E && /* @__PURE__ */ v(n, {
|
|
40
|
+
icon: E,
|
|
41
|
+
size: g
|
|
42
|
+
});
|
|
43
|
+
return /* @__PURE__ */ y("span", {
|
|
44
|
+
className: _(c, d, p, o[I]),
|
|
45
|
+
...h,
|
|
46
|
+
children: [
|
|
47
|
+
R && /* @__PURE__ */ v(i, { ...R }),
|
|
48
|
+
L === "start" && b,
|
|
49
|
+
B ? C(e) : C,
|
|
50
|
+
L === "end" && b
|
|
51
|
+
]
|
|
52
|
+
});
|
|
53
|
+
}, S[24] = H, S[25] = L, S[26] = I, S[27] = C, S[28] = E, S[29] = B, S[30] = R, S[31] = W) : W = S[31];
|
|
54
|
+
let G;
|
|
55
|
+
S[32] !== H || S[33] !== z || S[34] !== k || S[35] !== U || S[36] !== W ? (G = /* @__PURE__ */ v(b, {
|
|
56
|
+
onPress: z,
|
|
57
|
+
className: U,
|
|
24
58
|
...k,
|
|
25
|
-
...
|
|
59
|
+
...H,
|
|
26
60
|
"data-button": !0,
|
|
27
|
-
children:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"data-disabled": o || void 0,
|
|
32
|
-
"data-focused": d || void 0,
|
|
33
|
-
"data-focus-visible": c || void 0,
|
|
34
|
-
"data-pressed": p || void 0,
|
|
35
|
-
"data-visual-button": !0
|
|
36
|
-
}, y = l[M], b = i ? /* @__PURE__ */ _(n, { size: y }) : w && /* @__PURE__ */ _(t, {
|
|
37
|
-
icon: w,
|
|
38
|
-
size: y
|
|
39
|
-
});
|
|
40
|
-
return /* @__PURE__ */ v("span", {
|
|
41
|
-
className: g(s, u, f, a[M]),
|
|
42
|
-
...h,
|
|
43
|
-
children: [
|
|
44
|
-
P && /* @__PURE__ */ _(r, { ...P }),
|
|
45
|
-
N === "start" && b,
|
|
46
|
-
I ? T(e) : T,
|
|
47
|
-
N === "end" && b
|
|
48
|
-
]
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
}), C);
|
|
61
|
+
children: W
|
|
62
|
+
}), S[32] = H, S[33] = z, S[34] = k, S[35] = U, S[36] = W, S[37] = G) : G = S[37];
|
|
63
|
+
let K;
|
|
64
|
+
return S[38] !== G || S[39] !== M ? (K = h(G, M), S[38] = G, S[39] = M, S[40] = K) : K = S[40], K;
|
|
52
65
|
};
|
|
53
66
|
//#endregion
|
|
54
|
-
export {
|
|
67
|
+
export { S as Button };
|
|
55
68
|
|
|
56
69
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/Button/Button/Button.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { Button as AriaButton } from \"react-aria-components\";\nimport { Icon } from \"@/components/Icon\";\nimport { Loader } from \"@/components/Loader\";\nimport { Splash } from \"@/components/Splash/Splash\";\nimport { useSplash } from \"@/components/Splash/useSplash\";\nimport { TapTarget } from \"@/utils/tapTarget\";\nimport {\n ButtonCore,\n ButtonIconSizeMapping,\n ButtonLabelTextMapping,\n ButtonReset,\n ButtonSizeBase,\n buttonColorBase,\n buttonColorConfig,\n buttonSizeConfig,\n newButtonBaseDataAttrs,\n useButtonConfig,\n withTooltip,\n} from \"../core\";\nimport type { ButtonProps } from \"./types\";\n\nexport const Button: React.FC<ButtonProps> = ({\n size,\n shape,\n color,\n tooltip,\n icon,\n children,\n onPress,\n iconPlacement,\n className,\n ...props\n}) => {\n const { buttonColor, buttonShape, buttonSize, buttonIconPlacement } =\n useButtonConfig({\n size,\n shape,\n color,\n iconPlacement,\n });\n\n const { splashInfo, handlePress } = useSplash(onPress);\n const isChildFunc = typeof children === \"function\";\n\n const baseButtonDataAttrs = newButtonBaseDataAttrs({\n shape: buttonShape,\n size: buttonSize,\n color: buttonColor,\n });\n\n return withTooltip(\n <AriaButton\n onPress={handlePress}\n className={(renderProps) =>\n clsx(\n ButtonReset,\n TapTarget,\n buttonSizeConfig(buttonSize),\n buttonColorConfig(buttonColor),\n typeof className === \"function\"\n ? className(renderProps)\n : className\n )\n }\n {...props}\n {...baseButtonDataAttrs}\n data-button\n >\n {(renderProps) => {\n const {\n isPending,\n isDisabled,\n isFocusVisible,\n isFocused,\n isPressed,\n isHovered,\n } = renderProps;\n\n const dataAttrs = {\n ...baseButtonDataAttrs,\n \"data-hovered\": isHovered || undefined,\n \"data-disabled\": isDisabled || undefined,\n \"data-focused\": isFocused || undefined,\n \"data-focus-visible\": isFocusVisible || undefined,\n \"data-pressed\": isPressed || undefined,\n \"data-visual-button\": true,\n };\n\n const iconSize = ButtonIconSizeMapping[buttonSize];\n const iconComp = isPending ? (\n <Loader size={iconSize} />\n ) : (\n icon && <Icon icon={icon} size={iconSize} />\n );\n return (\n <span\n className={clsx(\n ButtonCore,\n buttonColorBase,\n ButtonSizeBase,\n ButtonLabelTextMapping[buttonSize]\n )}\n {...dataAttrs}\n >\n {splashInfo && <Splash {...splashInfo} />}\n\n {buttonIconPlacement === \"start\" && iconComp}\n\n {isChildFunc ? children(renderProps) : children}\n\n {buttonIconPlacement === \"end\" && iconComp}\n </span>\n );\n }}\n </AriaButton>,\n tooltip\n );\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["renderProps","iconSize","icon","handlePress"],"sources":["../../../../src/components/Button/Button/Button.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { Button as AriaButton } from \"react-aria-components\";\nimport { Icon } from \"@/components/Icon\";\nimport { Loader } from \"@/components/Loader\";\nimport { Splash } from \"@/components/Splash/Splash\";\nimport { useSplash } from \"@/components/Splash/useSplash\";\nimport { TapTarget } from \"@/utils/tapTarget\";\nimport {\n ButtonCore,\n ButtonIconSizeMapping,\n ButtonLabelTextMapping,\n ButtonReset,\n ButtonSizeBase,\n buttonColorBase,\n buttonColorConfig,\n buttonSizeConfig,\n newButtonBaseDataAttrs,\n useButtonConfig,\n withTooltip,\n} from \"../core\";\nimport type { ButtonProps } from \"./types\";\n\nexport const Button: React.FC<ButtonProps> = ({\n size,\n shape,\n color,\n tooltip,\n icon,\n children,\n onPress,\n iconPlacement,\n className,\n ...props\n}) => {\n const { buttonColor, buttonShape, buttonSize, buttonIconPlacement } =\n useButtonConfig({\n size,\n shape,\n color,\n iconPlacement,\n });\n\n const { splashInfo, handlePress } = useSplash(onPress);\n const isChildFunc = typeof children === \"function\";\n\n const baseButtonDataAttrs = newButtonBaseDataAttrs({\n shape: buttonShape,\n size: buttonSize,\n color: buttonColor,\n });\n\n return withTooltip(\n <AriaButton\n onPress={handlePress}\n className={(renderProps) =>\n clsx(\n ButtonReset,\n TapTarget,\n buttonSizeConfig(buttonSize),\n buttonColorConfig(buttonColor),\n typeof className === \"function\"\n ? className(renderProps)\n : className\n )\n }\n {...props}\n {...baseButtonDataAttrs}\n data-button\n >\n {(renderProps) => {\n const {\n isPending,\n isDisabled,\n isFocusVisible,\n isFocused,\n isPressed,\n isHovered,\n } = renderProps;\n\n const dataAttrs = {\n ...baseButtonDataAttrs,\n \"data-hovered\": isHovered || undefined,\n \"data-disabled\": isDisabled || undefined,\n \"data-focused\": isFocused || undefined,\n \"data-focus-visible\": isFocusVisible || undefined,\n \"data-pressed\": isPressed || undefined,\n \"data-visual-button\": true,\n };\n\n const iconSize = ButtonIconSizeMapping[buttonSize];\n const iconComp = isPending ? (\n <Loader size={iconSize} />\n ) : (\n icon && <Icon icon={icon} size={iconSize} />\n );\n return (\n <span\n className={clsx(\n ButtonCore,\n buttonColorBase,\n ButtonSizeBase,\n ButtonLabelTextMapping[buttonSize]\n )}\n {...dataAttrs}\n >\n {splashInfo && <Splash {...splashInfo} />}\n\n {buttonIconPlacement === \"start\" && iconComp}\n\n {isChildFunc ? children(renderProps) : children}\n\n {buttonIconPlacement === \"end\" && iconComp}\n </span>\n );\n }}\n </AriaButton>,\n tooltip\n );\n};\n"],"mappings":";;;;;;;;;;aAsBa,KAAgC,MAAA;CAAA,IAAA,KAAA,GAAA,EAAA,EAAA,CAAA,EAAA,GAAA,GAAA,GAAA,GAAA,GAAA,GAAA,GAAA,GAAA,GAAA,GAAA;CAAA,AAAA,EAAA,OAAA,KAW5C,IAAA,EAAA,IAAA,IAAA,EAAA,IAAA,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EAAA,MAAA,KAAA,IAAA,EAAA;CAAA,IAAA;CAEhB,OAFgB,EAAA,QAAA,KAAA,EAAA,QAAA,KAhEV,IAAA,EACH,GAgEA,CACJ,GAAC,EAAA,MAAA,GAAA,EAAA,MAAA,GAAA,EAAA,MAAA,KAAA,IAAA,EAAA,KAlEM;AAkEN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/Button/ButtonGroups/ButtonGroupContext/context.ts","../../../../../src/components/Button/ButtonGroups/ButtonGroupContext/useButtonGroupContext.ts","../../../../../src/components/Button/ButtonGroups/ButtonGroupContext/useConnectedButtonGroupContext.ts"],"sourcesContent":["import { createContext } from \"react\";\nimport type {\n ButtonIconPlacement,\n ButtonShape,\n ButtonSize,\n ConnectedButtonGroupColor,\n CoreButtonColor,\n} from \"../../core\";\n\nexport type ButtonGroupContextValue = {\n size?: ButtonSize;\n shape?: ButtonShape;\n color?: CoreButtonColor;\n iconPlacement?: ButtonIconPlacement;\n};\n\nexport const ButtonGroupContext = createContext<ButtonGroupContextValue>({});\n\nexport type ConnectedButtonGroupContextValue = {\n size: ButtonSize;\n shape: ButtonShape;\n color: ConnectedButtonGroupColor;\n iconPlacement?: ButtonIconPlacement;\n};\n\nexport const ConnectedButtonGroupContext =\n createContext<ConnectedButtonGroupContextValue>({\n size: \"small\",\n shape: \"round\",\n color: \"filled\",\n });\n","import { useContext } from \"react\";\nimport { ButtonGroupContext } from \"./context\";\n\nexport function useButtonGroupContext() {\n return useContext(ButtonGroupContext);\n}\n","import { useContext } from \"react\";\nimport { ConnectedButtonGroupContext } from \"./context\";\n\nexport function useConnectedButtonGroupContext() {\n return useContext(ConnectedButtonGroupContext);\n}\n"],"mappings":";;AAgBA,IAAa,IAAqB,EAAuC,CAAC,CAAC,GAS9D,IACT,EAAgD;CAC5C,MAAM;CACN,OAAO;CACP,OAAO;AACX,CAAC;;;AC3BL,
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/Button/ButtonGroups/ButtonGroupContext/context.ts","../../../../../src/components/Button/ButtonGroups/ButtonGroupContext/useButtonGroupContext.ts","../../../../../src/components/Button/ButtonGroups/ButtonGroupContext/useConnectedButtonGroupContext.ts"],"sourcesContent":["import { createContext } from \"react\";\nimport type {\n ButtonIconPlacement,\n ButtonShape,\n ButtonSize,\n ConnectedButtonGroupColor,\n CoreButtonColor,\n} from \"../../core\";\n\nexport type ButtonGroupContextValue = {\n size?: ButtonSize;\n shape?: ButtonShape;\n color?: CoreButtonColor;\n iconPlacement?: ButtonIconPlacement;\n};\n\nexport const ButtonGroupContext = createContext<ButtonGroupContextValue>({});\n\nexport type ConnectedButtonGroupContextValue = {\n size: ButtonSize;\n shape: ButtonShape;\n color: ConnectedButtonGroupColor;\n iconPlacement?: ButtonIconPlacement;\n};\n\nexport const ConnectedButtonGroupContext =\n createContext<ConnectedButtonGroupContextValue>({\n size: \"small\",\n shape: \"round\",\n color: \"filled\",\n });\n","import { useContext } from \"react\";\nimport { ButtonGroupContext } from \"./context\";\n\nexport function useButtonGroupContext() {\n return useContext(ButtonGroupContext);\n}\n","import { useContext } from \"react\";\nimport { ConnectedButtonGroupContext } from \"./context\";\n\nexport function useConnectedButtonGroupContext() {\n return useContext(ConnectedButtonGroupContext);\n}\n"],"mappings":";;AAgBA,IAAa,IAAqB,EAAuC,CAAC,CAAC,GAS9D,IACT,EAAgD;CAC5C,MAAM;CACN,OAAO;CACP,OAAO;AACX,CAAC;;;AC3BL,SAAO,IAAA;CAAA,OACI,EAAW,CAAkB;AAAC;;;ACDzC,SAAO,IAAA;CAAA,OACI,EAAW,CAA2B;AAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/Button/IconButton/IconButton.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { Button as AriaButton } from \"react-aria-components\";\nimport { Icon } from \"@/components/Icon\";\nimport { Loader } from \"@/components/Loader\";\nimport { Splash } from \"@/components/Splash/Splash\";\nimport { useSplash } from \"@/components/Splash/useSplash\";\nimport { TapTarget } from \"@/utils/tapTarget\";\nimport {\n ButtonCore,\n ButtonReset,\n ButtonSizeBase,\n buttonColorBase,\n buttonColorConfig,\n buttonSizeConfig,\n IconButtonIconSizeMapping,\n newButtonBaseDataAttrs,\n useButtonConfig,\n withTooltip,\n} from \"../core\";\nimport type { IconButtonProps } from \"./types\";\n\nexport const IconButton: React.FC<IconButtonProps> = ({\n size,\n shape,\n color,\n width = \"default\",\n tooltip,\n icon,\n onPress,\n className,\n ...props\n}) => {\n const { buttonColor, buttonShape, buttonSize } = useButtonConfig({\n size,\n shape,\n color,\n });\n\n const { splashInfo, handlePress } = useSplash(onPress);\n\n const baseButtonDataAttrs = newButtonBaseDataAttrs({\n shape: buttonShape,\n size: buttonSize,\n color: buttonColor,\n });\n\n const iconButtonDataAttrs = {\n ...baseButtonDataAttrs,\n \"data-width\": width,\n \"data-icon-button\": true,\n };\n\n return withTooltip(\n <AriaButton\n onPress={handlePress}\n className={(renderProps) =>\n clsx(\n ButtonReset,\n TapTarget,\n buttonSizeConfig(buttonSize),\n buttonColorConfig(buttonColor),\n typeof className === \"function\"\n ? className(renderProps)\n : className\n )\n }\n {...props}\n {...iconButtonDataAttrs}\n data-button\n >\n {({\n isPending,\n isDisabled,\n isFocusVisible,\n isFocused,\n isPressed,\n isHovered,\n }) => {\n const dataAttrs = {\n ...iconButtonDataAttrs,\n \"data-hovered\": isHovered || undefined,\n \"data-disabled\": isDisabled || undefined,\n \"data-focused\": isFocused || undefined,\n \"data-focus-visible\": isFocusVisible || undefined,\n \"data-pressed\": isPressed || undefined,\n \"data-visual-button\": true,\n };\n\n const iconSize = IconButtonIconSizeMapping[buttonSize];\n return (\n <span\n className={clsx(\n ButtonCore,\n buttonColorBase,\n ButtonSizeBase\n )}\n {...dataAttrs}\n >\n {splashInfo && <Splash {...splashInfo} />}\n {isPending ? (\n <Loader size={iconSize} />\n ) : (\n icon && <Icon icon={icon} size={iconSize} />\n )}\n </span>\n );\n }}\n </AriaButton>,\n tooltip\n );\n};\n"],"mappings":";;;;;;;;;AAqBA,IAAa,KAAyC,EAClD,SACA,UACA,UACA,WAAQ,WACR,YACA,SACA,YACA,cACA,GAAG,QACD;CACF,IAAM,EAAE,gBAAa,gBAAa,kBAAe,EAAgB;EAC7D;EACA;EACA;CACJ,CAAC,GAEK,EAAE,eAAY,mBAAgB,EAAU,CAAO,GAQ/C,IAAsB;EACxB,GAPwB,EAAuB;GAC/C,OAAO;GACP,MAAM;GACN,OAAO;EACX,CAGO;EACH,cAAc;EACd,oBAAoB;CACxB;CAEA,OAAO,EACH,kBAAC,GAAD;EACI,SAAS;EACT,YAAY,MACR,EACI,GACA,GACA,EAAiB,CAAU,GAC3B,EAAkB,CAAW,GAC7B,OAAO,KAAc,aACf,EAAU,CAAW,IACrB,CACV;EAEJ,GAAI;EACJ,GAAI;EACJ,eAAA;aAEE,EACE,cACA,eACA,mBACA,cACA,cACA,mBACE;GACF,IAAM,IAAY;IACd,GAAG;IACH,gBAAgB,KAAa,KAAA;IAC7B,iBAAiB,KAAc,KAAA;IAC/B,gBAAgB,KAAa,KAAA;IAC7B,sBAAsB,KAAkB,KAAA;IACxC,gBAAgB,KAAa,KAAA;IAC7B,sBAAsB;GAC1B,GAEM,IAAW,EAA0B;GAC3C,OACI,kBAAC,QAAD;IACI,WAAW,EACP,GACA,GACA,CACJ;IACA,GAAI;cANR,CAQK,KAAc,kBAAC,GAAD,EAAQ,GAAI,
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/Button/IconButton/IconButton.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { Button as AriaButton } from \"react-aria-components\";\nimport { Icon } from \"@/components/Icon\";\nimport { Loader } from \"@/components/Loader\";\nimport { Splash } from \"@/components/Splash/Splash\";\nimport { useSplash } from \"@/components/Splash/useSplash\";\nimport { TapTarget } from \"@/utils/tapTarget\";\nimport {\n ButtonCore,\n ButtonReset,\n ButtonSizeBase,\n buttonColorBase,\n buttonColorConfig,\n buttonSizeConfig,\n IconButtonIconSizeMapping,\n newButtonBaseDataAttrs,\n useButtonConfig,\n withTooltip,\n} from \"../core\";\nimport type { IconButtonProps } from \"./types\";\n\nexport const IconButton: React.FC<IconButtonProps> = ({\n size,\n shape,\n color,\n width = \"default\",\n tooltip,\n icon,\n onPress,\n className,\n ...props\n}) => {\n const { buttonColor, buttonShape, buttonSize } = useButtonConfig({\n size,\n shape,\n color,\n });\n\n const { splashInfo, handlePress } = useSplash(onPress);\n\n const baseButtonDataAttrs = newButtonBaseDataAttrs({\n shape: buttonShape,\n size: buttonSize,\n color: buttonColor,\n });\n\n const iconButtonDataAttrs = {\n ...baseButtonDataAttrs,\n \"data-width\": width,\n \"data-icon-button\": true,\n };\n\n return withTooltip(\n <AriaButton\n onPress={handlePress}\n className={(renderProps) =>\n clsx(\n ButtonReset,\n TapTarget,\n buttonSizeConfig(buttonSize),\n buttonColorConfig(buttonColor),\n typeof className === \"function\"\n ? className(renderProps)\n : className\n )\n }\n {...props}\n {...iconButtonDataAttrs}\n data-button\n >\n {({\n isPending,\n isDisabled,\n isFocusVisible,\n isFocused,\n isPressed,\n isHovered,\n }) => {\n const dataAttrs = {\n ...iconButtonDataAttrs,\n \"data-hovered\": isHovered || undefined,\n \"data-disabled\": isDisabled || undefined,\n \"data-focused\": isFocused || undefined,\n \"data-focus-visible\": isFocusVisible || undefined,\n \"data-pressed\": isPressed || undefined,\n \"data-visual-button\": true,\n };\n\n const iconSize = IconButtonIconSizeMapping[buttonSize];\n return (\n <span\n className={clsx(\n ButtonCore,\n buttonColorBase,\n ButtonSizeBase\n )}\n {...dataAttrs}\n >\n {splashInfo && <Splash {...splashInfo} />}\n {isPending ? (\n <Loader size={iconSize} />\n ) : (\n icon && <Icon icon={icon} size={iconSize} />\n )}\n </span>\n );\n }}\n </AriaButton>,\n tooltip\n );\n};\n"],"mappings":";;;;;;;;;AAqBA,IAAa,KAAyC,EAClD,SACA,UACA,UACA,WAAQ,WACR,YACA,SACA,YACA,cACA,GAAG,QACD;CACF,IAAM,EAAE,gBAAa,gBAAa,kBAAe,EAAgB;EAC7D;EACA;EACA;CACJ,CAAC,GAEK,EAAE,eAAY,mBAAgB,EAAU,CAAO,GAQ/C,IAAsB;EACxB,GAPwB,EAAuB;GAC/C,OAAO;GACP,MAAM;GACN,OAAO;EACX,CAGO;EACH,cAAc;EACd,oBAAoB;CACxB;CAEA,OAAO,EACH,kBAAC,GAAD;EACI,SAAS;EACT,YAAY,MACR,EACI,GACA,GACA,EAAiB,CAAU,GAC3B,EAAkB,CAAW,GAC7B,OAAO,KAAc,aACf,EAAU,CAAW,IACrB,CACV;EAEJ,GAAI;EACJ,GAAI;EACJ,eAAA;aAEE,EACE,cACA,eACA,mBACA,cACA,cACA,mBACE;GACF,IAAM,IAAY;IACd,GAAG;IACH,gBAAgB,KAAa,KAAA;IAC7B,iBAAiB,KAAc,KAAA;IAC/B,gBAAgB,KAAa,KAAA;IAC7B,sBAAsB,KAAkB,KAAA;IACxC,gBAAgB,KAAa,KAAA;IAC7B,sBAAsB;GAC1B,GAEM,IAAW,EAA0B;GAC3C,OACI,kBAAC,QAAD;IACI,WAAW,EACP,GACA,GACA,CACJ;IACA,GAAI;cANR,CAQK,KAAc,kBAAC,GAAD,EAAQ,GAAI,EAAW,CAAA,GACrC,IACG,kBAAC,GAAD,EAAQ,MAAM,EAAS,CAAA,IAEvB,KAAQ,kBAAC,GAAD;KAAY;KAAM,MAAM;IAAS,CAAA,CAE3C;;EAEd;CACQ,CAAA,GACZ,CACJ;AACJ"}
|
|
@@ -1,56 +1,69 @@
|
|
|
1
|
-
import { t as e } from "../../../chunks/
|
|
2
|
-
import { t } from "../../../chunks/
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { t as e } from "../../../chunks/compiler-runtime";
|
|
2
|
+
import { t } from "../../../chunks/tapTarget";
|
|
3
|
+
import { t as n } from "../../../chunks/Icon";
|
|
4
|
+
import { n as r, t as i } from "../../../chunks/useSplash";
|
|
5
|
+
import { a, c as o, d as s, f as c, i as l, l as u, n as d, o as f, p, t as m, u as h } from "../../../chunks/core";
|
|
6
|
+
import { clsx as g } from "clsx";
|
|
7
|
+
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
8
|
+
import { Link as y } from "react-aria-components";
|
|
8
9
|
//#region src/components/Button/LinkButton/LinkButton.tsx
|
|
9
|
-
var
|
|
10
|
-
let
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
10
|
+
var b = e(), x = (e) => {
|
|
11
|
+
let x = (0, b.c)(41), S, C, w, T, E, D, O, k, A, j;
|
|
12
|
+
x[0] === e ? (S = x[1], C = x[2], w = x[3], T = x[4], E = x[5], D = x[6], O = x[7], k = x[8], A = x[9], j = x[10]) : ({size: A, shape: k, color: w, tooltip: j, icon: T, children: S, onPress: D, className: C, iconPlacement: E, ...O} = e, x[0] = e, x[1] = S, x[2] = C, x[3] = w, x[4] = T, x[5] = E, x[6] = D, x[7] = O, x[8] = k, x[9] = A, x[10] = j);
|
|
13
|
+
let M;
|
|
14
|
+
x[11] !== w || x[12] !== E || x[13] !== k || x[14] !== A ? (M = {
|
|
15
|
+
size: A,
|
|
16
|
+
shape: k,
|
|
17
|
+
color: w,
|
|
18
|
+
iconPlacement: E
|
|
19
|
+
}, x[11] = w, x[12] = E, x[13] = k, x[14] = A, x[15] = M) : M = x[15];
|
|
20
|
+
let { buttonColor: N, buttonShape: P, buttonSize: F, buttonIconPlacement: I } = d(M), { splashInfo: L, handlePress: R } = i(D), z = typeof S == "function", B;
|
|
21
|
+
x[16] !== N || x[17] !== P || x[18] !== F ? (B = p({
|
|
22
|
+
shape: P,
|
|
23
|
+
size: F,
|
|
24
|
+
color: N
|
|
25
|
+
}), x[16] = N, x[17] = P, x[18] = F, x[19] = B) : B = x[19];
|
|
26
|
+
let V = B, H;
|
|
27
|
+
x[20] !== N || x[21] !== F || x[22] !== C ? (H = (e) => g(c, t, o(F), h(N), typeof C == "function" ? C(e) : C), x[20] = N, x[21] = F, x[22] = C, x[23] = H) : H = x[23];
|
|
28
|
+
let U;
|
|
29
|
+
x[24] !== V || x[25] !== I || x[26] !== F || x[27] !== S || x[28] !== T || x[29] !== z || x[30] !== L ? (U = (e) => {
|
|
30
|
+
let { isDisabled: t, isFocusVisible: i, isFocused: o, isPressed: c, isHovered: d } = e, p = {
|
|
31
|
+
...V,
|
|
32
|
+
"data-hovered": d || void 0,
|
|
33
|
+
"data-disabled": t || void 0,
|
|
34
|
+
"data-focused": o || void 0,
|
|
35
|
+
"data-focus-visible": i || void 0,
|
|
36
|
+
"data-pressed": c || void 0,
|
|
37
|
+
"data-visual-button": !0
|
|
38
|
+
}, m = l[F], h = T && /* @__PURE__ */ _(n, {
|
|
39
|
+
icon: T,
|
|
40
|
+
size: m
|
|
41
|
+
});
|
|
42
|
+
return /* @__PURE__ */ v("span", {
|
|
43
|
+
className: g(s, u, f, a[F]),
|
|
44
|
+
...p,
|
|
45
|
+
children: [
|
|
46
|
+
L && /* @__PURE__ */ _(r, { ...L }),
|
|
47
|
+
I === "start" && h,
|
|
48
|
+
z ? S(e) : S,
|
|
49
|
+
I === "end" && h
|
|
50
|
+
]
|
|
51
|
+
});
|
|
52
|
+
}, x[24] = V, x[25] = I, x[26] = F, x[27] = S, x[28] = T, x[29] = z, x[30] = L, x[31] = U) : U = x[31];
|
|
53
|
+
let W;
|
|
54
|
+
x[32] !== V || x[33] !== R || x[34] !== O || x[35] !== H || x[36] !== U ? (W = /* @__PURE__ */ _(y, {
|
|
55
|
+
onPress: R,
|
|
56
|
+
className: H,
|
|
23
57
|
...O,
|
|
24
|
-
...
|
|
58
|
+
...V,
|
|
25
59
|
"data-button": !0,
|
|
26
60
|
"data-link-button": !0,
|
|
27
|
-
children:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"data-disabled": r || void 0,
|
|
32
|
-
"data-focused": s || void 0,
|
|
33
|
-
"data-focus-visible": a || void 0,
|
|
34
|
-
"data-pressed": u || void 0,
|
|
35
|
-
"data-visual-button": !0
|
|
36
|
-
}, m = c[j], v = C && /* @__PURE__ */ g(t, {
|
|
37
|
-
icon: C,
|
|
38
|
-
size: m
|
|
39
|
-
});
|
|
40
|
-
return /* @__PURE__ */ _("span", {
|
|
41
|
-
className: h(o, l, d, i[j]),
|
|
42
|
-
...p,
|
|
43
|
-
children: [
|
|
44
|
-
N && /* @__PURE__ */ g(n, { ...N }),
|
|
45
|
-
M === "start" && v,
|
|
46
|
-
F ? w(e) : w,
|
|
47
|
-
M === "end" && v
|
|
48
|
-
]
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
}), S);
|
|
61
|
+
children: U
|
|
62
|
+
}), x[32] = V, x[33] = R, x[34] = O, x[35] = H, x[36] = U, x[37] = W) : W = x[37];
|
|
63
|
+
let G;
|
|
64
|
+
return x[38] !== W || x[39] !== j ? (G = m(W, j), x[38] = W, x[39] = j, x[40] = G) : G = x[40], G;
|
|
52
65
|
};
|
|
53
66
|
//#endregion
|
|
54
|
-
export {
|
|
67
|
+
export { x as LinkButton };
|
|
55
68
|
|
|
56
69
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/Button/LinkButton/LinkButton.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { Link } from \"react-aria-components\";\nimport { Icon } from \"@/components/Icon\";\nimport { Splash } from \"@/components/Splash/Splash\";\nimport { useSplash } from \"@/components/Splash/useSplash\";\nimport { TapTarget } from \"@/utils/tapTarget\";\nimport {\n ButtonCore,\n ButtonIconSizeMapping,\n ButtonLabelTextMapping,\n ButtonReset,\n ButtonSizeBase,\n buttonColorBase,\n buttonColorConfig,\n buttonSizeConfig,\n newButtonBaseDataAttrs,\n useButtonConfig,\n withTooltip,\n} from \"../core\";\nimport type { LinkButtonProps } from \"./types\";\n\nexport const LinkButton: React.FC<LinkButtonProps> = ({\n size,\n shape,\n color,\n tooltip,\n icon,\n children,\n onPress,\n className,\n iconPlacement,\n ...props\n}) => {\n const { buttonColor, buttonShape, buttonSize, buttonIconPlacement } =\n useButtonConfig({\n size,\n shape,\n color,\n iconPlacement,\n });\n\n const { splashInfo, handlePress } = useSplash(onPress);\n const isChildFunc = typeof children === \"function\";\n\n const baseButtonDataAttrs = newButtonBaseDataAttrs({\n shape: buttonShape,\n size: buttonSize,\n color: buttonColor,\n });\n\n return withTooltip(\n <Link\n onPress={handlePress}\n className={(renderProps) =>\n clsx(\n ButtonReset,\n TapTarget,\n buttonSizeConfig(buttonSize),\n buttonColorConfig(buttonColor),\n typeof className === \"function\"\n ? className(renderProps)\n : className\n )\n }\n {...props}\n {...baseButtonDataAttrs}\n data-button\n data-link-button\n >\n {(renderProps) => {\n const {\n isDisabled,\n isFocusVisible,\n isFocused,\n isPressed,\n isHovered,\n } = renderProps;\n\n const dataAttrs = {\n ...baseButtonDataAttrs,\n \"data-hovered\": isHovered || undefined,\n \"data-disabled\": isDisabled || undefined,\n \"data-focused\": isFocused || undefined,\n \"data-focus-visible\": isFocusVisible || undefined,\n \"data-pressed\": isPressed || undefined,\n \"data-visual-button\": true,\n };\n\n const iconSize = ButtonIconSizeMapping[buttonSize];\n const iconComp = icon && <Icon icon={icon} size={iconSize} />;\n\n return (\n <span\n className={clsx(\n ButtonCore,\n buttonColorBase,\n ButtonSizeBase,\n ButtonLabelTextMapping[buttonSize]\n )}\n {...dataAttrs}\n >\n {splashInfo && <Splash {...splashInfo} />}\n\n {buttonIconPlacement === \"start\" && iconComp}\n\n {isChildFunc ? children(renderProps) : children}\n\n {buttonIconPlacement === \"end\" && iconComp}\n </span>\n );\n }}\n </Link>,\n tooltip\n );\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["renderProps","icon","iconSize","handlePress"],"sources":["../../../../src/components/Button/LinkButton/LinkButton.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { Link } from \"react-aria-components\";\nimport { Icon } from \"@/components/Icon\";\nimport { Splash } from \"@/components/Splash/Splash\";\nimport { useSplash } from \"@/components/Splash/useSplash\";\nimport { TapTarget } from \"@/utils/tapTarget\";\nimport {\n ButtonCore,\n ButtonIconSizeMapping,\n ButtonLabelTextMapping,\n ButtonReset,\n ButtonSizeBase,\n buttonColorBase,\n buttonColorConfig,\n buttonSizeConfig,\n newButtonBaseDataAttrs,\n useButtonConfig,\n withTooltip,\n} from \"../core\";\nimport type { LinkButtonProps } from \"./types\";\n\nexport const LinkButton: React.FC<LinkButtonProps> = ({\n size,\n shape,\n color,\n tooltip,\n icon,\n children,\n onPress,\n className,\n iconPlacement,\n ...props\n}) => {\n const { buttonColor, buttonShape, buttonSize, buttonIconPlacement } =\n useButtonConfig({\n size,\n shape,\n color,\n iconPlacement,\n });\n\n const { splashInfo, handlePress } = useSplash(onPress);\n const isChildFunc = typeof children === \"function\";\n\n const baseButtonDataAttrs = newButtonBaseDataAttrs({\n shape: buttonShape,\n size: buttonSize,\n color: buttonColor,\n });\n\n return withTooltip(\n <Link\n onPress={handlePress}\n className={(renderProps) =>\n clsx(\n ButtonReset,\n TapTarget,\n buttonSizeConfig(buttonSize),\n buttonColorConfig(buttonColor),\n typeof className === \"function\"\n ? className(renderProps)\n : className\n )\n }\n {...props}\n {...baseButtonDataAttrs}\n data-button\n data-link-button\n >\n {(renderProps) => {\n const {\n isDisabled,\n isFocusVisible,\n isFocused,\n isPressed,\n isHovered,\n } = renderProps;\n\n const dataAttrs = {\n ...baseButtonDataAttrs,\n \"data-hovered\": isHovered || undefined,\n \"data-disabled\": isDisabled || undefined,\n \"data-focused\": isFocused || undefined,\n \"data-focus-visible\": isFocusVisible || undefined,\n \"data-pressed\": isPressed || undefined,\n \"data-visual-button\": true,\n };\n\n const iconSize = ButtonIconSizeMapping[buttonSize];\n const iconComp = icon && <Icon icon={icon} size={iconSize} />;\n\n return (\n <span\n className={clsx(\n ButtonCore,\n buttonColorBase,\n ButtonSizeBase,\n ButtonLabelTextMapping[buttonSize]\n )}\n {...dataAttrs}\n >\n {splashInfo && <Splash {...splashInfo} />}\n\n {buttonIconPlacement === \"start\" && iconComp}\n\n {isChildFunc ? children(renderProps) : children}\n\n {buttonIconPlacement === \"end\" && iconComp}\n </span>\n );\n }}\n </Link>,\n tooltip\n );\n};\n"],"mappings":";;;;;;;;;aAqBa,KAAwC,MAAA;CAAA,IAAA,KAAA,GAAA,EAAA,EAAA,CAAA,EAAA,GAAA,GAAA,GAAA,GAAA,GAAA,GAAA,GAAA,GAAA,GAAA,GAAA;CAAA,AAAA,EAAA,OAAA,KAWpD,IAAA,EAAA,IAAA,IAAA,EAAA,IAAA,IAAA,EAAA,IAAA,IAAA,EAAA,IAAA,IAAA,EAAA,IAAA,IAAA,EAAA,IAAA,IAAA,EAAA,IAAA,IAAA,EAAA,IAAA,IAAA,EAAA,IAAA,IAAA,EAAA,QAXqD,+GAAA,KAAA,GAWrD,EAAA,KAAA,GAAA,EAAA,KAAA,GAAA,EAAA,KAAA,GAAA,EAAA,KAAA,GAAA,EAAA,KAAA,GAAA,EAAA,KAAA,GAAA,EAAA,KAAA,GAAA,EAAA,KAAA,GAAA,EAAA,KAAA,GAAA,EAAA,KAAA,GAAA,EAAA,MAAA;CAAA,IAAA;CAAA,AAAA,EAAA,QAAA,KAAA,EAAA,QAAA,KAAA,EAAA,QAAA,KAAA,EAAA,QAAA,KAEuB,IAAA;EAAA;EAAA;EAAA;EAAA;CAKhB,GAAC,EAAA,MAAA,GAAA,EAAA,MAAA,GAAA,EAAA,MAAA,GAAA,EAAA,MAAA,GAAA,EAAA,MAAA,KAAA,IAAA,EAAA;CANL,IAAA,EAAA,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IAEpC,MAAwB,WAAxB;IAEA,IAAc,EAASF,CAAsB,IAA7C;IAEA,MAAwB,SAAxB;GACE;;CAAA,GAEd,EAAA,MAAA,GAAA,EAAA,MAAA,GAAA,EAAA,MAAA,GAAA,EAAA,MAAA,GAAA,EAAA,MAAA,GAAA,EAAA,MAAA,GAAA,EAAA,MAAA,GAAA,EAAA,MAAA,KAAA,IAAA,EAAA;CAAA,IAAA;CAAA,AAAA,EAAA,QAAA,KAAA,EAAA,QAAA,KAAA,EAAA,QAAA,KAAA,EAAA,QAAA,KAAA,EAAA,QAAA,KA3DL,IAAA,kBAAC,GAAD;EACaG,SAAA;EACE,WAAA;EASN,GAED;EAAK,GACL;EACJ,eAAA;EACA,oBAAA;YAEC;CAlBA,CAAA,GA4DE,EAAA,MAAA,GAAA,EAAA,MAAA,GAAA,EAAA,MAAA,GAAA,EAAA,MAAA,GAAA,EAAA,MAAA,GAAA,EAAA,MAAA,KAAA,IAAA,EAAA;CAAA,IAAA;CAEV,OAFU,EAAA,QAAA,KAAA,EAAA,QAAA,KA7DJ,IAAA,EACH,GA6DA,CACJ,GAAC,EAAA,MAAA,GAAA,EAAA,MAAA,GAAA,EAAA,MAAA,KAAA,IAAA,EAAA,KA/DM;AA+DN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/Button/LinkIconButton/LinkIconButton.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { Link } from \"react-aria-components\";\nimport { Icon } from \"@/components/Icon\";\nimport { Splash } from \"@/components/Splash/Splash\";\nimport { useSplash } from \"@/components/Splash/useSplash\";\nimport { TapTarget } from \"@/utils/tapTarget\";\nimport {\n ButtonCore,\n ButtonReset,\n ButtonSizeBase,\n buttonColorBase,\n buttonColorConfig,\n buttonSizeConfig,\n IconButtonIconSizeMapping,\n newButtonBaseDataAttrs,\n useButtonConfig,\n withTooltip,\n} from \"../core\";\nimport type { LinkIconButtonProps } from \"./types\";\n\nexport const LinkIconButton: React.FC<LinkIconButtonProps> = ({\n size,\n shape,\n color,\n width = \"default\",\n tooltip,\n icon,\n onPress,\n className,\n ...props\n}) => {\n const { buttonColor, buttonShape, buttonSize } = useButtonConfig({\n size,\n shape,\n color,\n });\n\n const { splashInfo, handlePress } = useSplash(onPress);\n\n const baseButtonDataAttrs = newButtonBaseDataAttrs({\n shape: buttonShape,\n size: buttonSize,\n color: buttonColor,\n });\n\n const iconButtonDataAttrs = {\n ...baseButtonDataAttrs,\n \"data-width\": width,\n \"data-icon-button\": true,\n };\n\n return withTooltip(\n <Link\n onPress={handlePress}\n className={(renderProps) =>\n clsx(\n ButtonReset,\n TapTarget,\n buttonSizeConfig(buttonSize),\n buttonColorConfig(buttonColor),\n typeof className === \"function\"\n ? className(renderProps)\n : className\n )\n }\n {...props}\n {...iconButtonDataAttrs}\n data-button\n data-link-button\n >\n {({\n isDisabled,\n isFocusVisible,\n isFocused,\n isPressed,\n isHovered,\n }) => {\n const dataAttrs = {\n ...iconButtonDataAttrs,\n \"data-hovered\": isHovered || undefined,\n \"data-disabled\": isDisabled || undefined,\n \"data-focused\": isFocused || undefined,\n \"data-focus-visible\": isFocusVisible || undefined,\n \"data-pressed\": isPressed || undefined,\n \"data-visual-button\": true,\n };\n\n const iconSize = IconButtonIconSizeMapping[buttonSize];\n return (\n <span\n className={clsx(\n ButtonCore,\n buttonColorBase,\n ButtonSizeBase\n )}\n {...dataAttrs}\n >\n {splashInfo && <Splash {...splashInfo} />}\n {icon && <Icon icon={icon} size={iconSize} />}\n </span>\n );\n }}\n </Link>,\n tooltip\n );\n};\n"],"mappings":";;;;;;;;AAoBA,IAAa,KAAiD,EAC1D,SACA,UACA,UACA,WAAQ,WACR,YACA,SACA,YACA,cACA,GAAG,QACD;CACF,IAAM,EAAE,gBAAa,gBAAa,kBAAe,EAAgB;EAC7D;EACA;EACA;CACJ,CAAC,GAEK,EAAE,eAAY,mBAAgB,EAAU,CAAO,GAQ/C,IAAsB;EACxB,GAPwB,EAAuB;GAC/C,OAAO;GACP,MAAM;GACN,OAAO;EACX,CAGO;EACH,cAAc;EACd,oBAAoB;CACxB;CAEA,OAAO,EACH,kBAAC,GAAD;EACI,SAAS;EACT,YAAY,MACR,EACI,GACA,GACA,EAAiB,CAAU,GAC3B,EAAkB,CAAW,GAC7B,OAAO,KAAc,aACf,EAAU,CAAW,IACrB,CACV;EAEJ,GAAI;EACJ,GAAI;EACJ,eAAA;EACA,oBAAA;aAEE,EACE,eACA,mBACA,cACA,cACA,mBACE;GACF,IAAM,IAAY;IACd,GAAG;IACH,gBAAgB,KAAa,KAAA;IAC7B,iBAAiB,KAAc,KAAA;IAC/B,gBAAgB,KAAa,KAAA;IAC7B,sBAAsB,KAAkB,KAAA;IACxC,gBAAgB,KAAa,KAAA;IAC7B,sBAAsB;GAC1B,GAEM,IAAW,EAA0B;GAC3C,OACI,kBAAC,QAAD;IACI,WAAW,EACP,GACA,GACA,CACJ;IACA,GAAI;cANR,CAQK,KAAc,kBAAC,GAAD,EAAQ,GAAI,
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/Button/LinkIconButton/LinkIconButton.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { Link } from \"react-aria-components\";\nimport { Icon } from \"@/components/Icon\";\nimport { Splash } from \"@/components/Splash/Splash\";\nimport { useSplash } from \"@/components/Splash/useSplash\";\nimport { TapTarget } from \"@/utils/tapTarget\";\nimport {\n ButtonCore,\n ButtonReset,\n ButtonSizeBase,\n buttonColorBase,\n buttonColorConfig,\n buttonSizeConfig,\n IconButtonIconSizeMapping,\n newButtonBaseDataAttrs,\n useButtonConfig,\n withTooltip,\n} from \"../core\";\nimport type { LinkIconButtonProps } from \"./types\";\n\nexport const LinkIconButton: React.FC<LinkIconButtonProps> = ({\n size,\n shape,\n color,\n width = \"default\",\n tooltip,\n icon,\n onPress,\n className,\n ...props\n}) => {\n const { buttonColor, buttonShape, buttonSize } = useButtonConfig({\n size,\n shape,\n color,\n });\n\n const { splashInfo, handlePress } = useSplash(onPress);\n\n const baseButtonDataAttrs = newButtonBaseDataAttrs({\n shape: buttonShape,\n size: buttonSize,\n color: buttonColor,\n });\n\n const iconButtonDataAttrs = {\n ...baseButtonDataAttrs,\n \"data-width\": width,\n \"data-icon-button\": true,\n };\n\n return withTooltip(\n <Link\n onPress={handlePress}\n className={(renderProps) =>\n clsx(\n ButtonReset,\n TapTarget,\n buttonSizeConfig(buttonSize),\n buttonColorConfig(buttonColor),\n typeof className === \"function\"\n ? className(renderProps)\n : className\n )\n }\n {...props}\n {...iconButtonDataAttrs}\n data-button\n data-link-button\n >\n {({\n isDisabled,\n isFocusVisible,\n isFocused,\n isPressed,\n isHovered,\n }) => {\n const dataAttrs = {\n ...iconButtonDataAttrs,\n \"data-hovered\": isHovered || undefined,\n \"data-disabled\": isDisabled || undefined,\n \"data-focused\": isFocused || undefined,\n \"data-focus-visible\": isFocusVisible || undefined,\n \"data-pressed\": isPressed || undefined,\n \"data-visual-button\": true,\n };\n\n const iconSize = IconButtonIconSizeMapping[buttonSize];\n return (\n <span\n className={clsx(\n ButtonCore,\n buttonColorBase,\n ButtonSizeBase\n )}\n {...dataAttrs}\n >\n {splashInfo && <Splash {...splashInfo} />}\n {icon && <Icon icon={icon} size={iconSize} />}\n </span>\n );\n }}\n </Link>,\n tooltip\n );\n};\n"],"mappings":";;;;;;;;AAoBA,IAAa,KAAiD,EAC1D,SACA,UACA,UACA,WAAQ,WACR,YACA,SACA,YACA,cACA,GAAG,QACD;CACF,IAAM,EAAE,gBAAa,gBAAa,kBAAe,EAAgB;EAC7D;EACA;EACA;CACJ,CAAC,GAEK,EAAE,eAAY,mBAAgB,EAAU,CAAO,GAQ/C,IAAsB;EACxB,GAPwB,EAAuB;GAC/C,OAAO;GACP,MAAM;GACN,OAAO;EACX,CAGO;EACH,cAAc;EACd,oBAAoB;CACxB;CAEA,OAAO,EACH,kBAAC,GAAD;EACI,SAAS;EACT,YAAY,MACR,EACI,GACA,GACA,EAAiB,CAAU,GAC3B,EAAkB,CAAW,GAC7B,OAAO,KAAc,aACf,EAAU,CAAW,IACrB,CACV;EAEJ,GAAI;EACJ,GAAI;EACJ,eAAA;EACA,oBAAA;aAEE,EACE,eACA,mBACA,cACA,cACA,mBACE;GACF,IAAM,IAAY;IACd,GAAG;IACH,gBAAgB,KAAa,KAAA;IAC7B,iBAAiB,KAAc,KAAA;IAC/B,gBAAgB,KAAa,KAAA;IAC7B,sBAAsB,KAAkB,KAAA;IACxC,gBAAgB,KAAa,KAAA;IAC7B,sBAAsB;GAC1B,GAEM,IAAW,EAA0B;GAC3C,OACI,kBAAC,QAAD;IACI,WAAW,EACP,GACA,GACA,CACJ;IACA,GAAI;cANR,CAQK,KAAc,kBAAC,GAAD,EAAQ,GAAI,EAAW,CAAA,GACrC,KAAQ,kBAAC,GAAD;KAAY;KAAM,MAAM;IAAS,CAAA,CACxC;;EAEd;CACE,CAAA,GACN,CACJ;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/Button/SplitButton/SplitButtonContext/context.ts","../../../../../src/components/Button/SplitButton/SplitButtonContext/useSplitButtonContext.ts"],"sourcesContent":["import { createContext } from \"react\";\nimport type { ButtonSize, SplitButtonColor } from \"../../core\";\n\nexport type SplitButtonState = {\n isPending?: boolean;\n isDisabled?: boolean;\n\n size: ButtonSize;\n color: SplitButtonColor;\n};\n\nexport const SplitButtonContext = createContext<SplitButtonState>({\n size: \"small\",\n color: \"filled\",\n});\n","import { useContext } from \"react\";\nimport { SplitButtonContext } from \"./context\";\n\nexport function useSplitButtonContext() {\n return useContext(SplitButtonContext);\n}\n"],"mappings":";;AAWA,IAAa,IAAqB,EAAgC;CAC9D,MAAM;CACN,OAAO;AACX,CAAC;;;ACXD,
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/Button/SplitButton/SplitButtonContext/context.ts","../../../../../src/components/Button/SplitButton/SplitButtonContext/useSplitButtonContext.ts"],"sourcesContent":["import { createContext } from \"react\";\nimport type { ButtonSize, SplitButtonColor } from \"../../core\";\n\nexport type SplitButtonState = {\n isPending?: boolean;\n isDisabled?: boolean;\n\n size: ButtonSize;\n color: SplitButtonColor;\n};\n\nexport const SplitButtonContext = createContext<SplitButtonState>({\n size: \"small\",\n color: \"filled\",\n});\n","import { useContext } from \"react\";\nimport { SplitButtonContext } from \"./context\";\n\nexport function useSplitButtonContext() {\n return useContext(SplitButtonContext);\n}\n"],"mappings":";;AAWA,IAAa,IAAqB,EAAgC;CAC9D,MAAM;CACN,OAAO;AACX,CAAC;;;ACXD,SAAO,IAAA;CAAA,OACI,EAAW,CAAkB;AAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/Button/SplitButton/SplitButtonPrimary/SplitButtonPrimary.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { Button as AriaButton } from \"react-aria-components\";\nimport { Icon } from \"@/components/Icon\";\nimport { Loader } from \"@/components/Loader\";\nimport { Splash } from \"@/components/Splash/Splash\";\nimport { useSplash } from \"@/components/Splash/useSplash\";\nimport { TapTarget } from \"@/utils/tapTarget\";\nimport {\n ButtonCore,\n ButtonIconSizeMapping,\n ButtonLabelTextMapping,\n ButtonReset,\n buttonColorBase,\n buttonColorConfig,\n withTooltip,\n} from \"../../core\";\nimport { SplitButtonPrimaryBase, SplitButtonVariantBase } from \"../core\";\nimport { useSplitButtonContext } from \"../SplitButtonContext\";\nimport type { SplitButtonPrimaryProps } from \"./types\";\n\nexport const SplitButtonPrimary: React.FC<SplitButtonPrimaryProps> = ({\n tooltip,\n icon,\n children,\n onPress,\n isDisabled,\n isPending,\n className,\n iconPlacement = \"start\",\n ...props\n}) => {\n const splitButtonState = useSplitButtonContext();\n\n const { splashInfo, handlePress } = useSplash(onPress);\n const isChildFunc = typeof children === \"function\";\n\n const pending = isPending || splitButtonState.isPending;\n const disabled = isDisabled || splitButtonState.isDisabled;\n\n return withTooltip(\n <AriaButton\n onPress={handlePress}\n isDisabled={disabled}\n isPending={pending}\n {...props}\n className={(renderProps) =>\n clsx(\n ButtonReset,\n TapTarget,\n SplitButtonPrimaryBase,\n buttonColorConfig(splitButtonState.color),\n typeof className === \"function\"\n ? className(renderProps)\n : className\n )\n }\n data-button\n data-split-button-primary\n >\n {(renderProps) => {\n const {\n isDisabled,\n isFocusVisible,\n isFocused,\n isPressed,\n isHovered,\n } = renderProps;\n\n const dataAttrs = {\n \"data-hovered\": isHovered || undefined,\n \"data-disabled\": isDisabled || undefined,\n \"data-focused\": isFocused || undefined,\n \"data-focus-visible\": isFocusVisible || undefined,\n \"data-pressed\": isPressed || undefined,\n \"data-visual-button\": true,\n };\n\n const iconSize = ButtonIconSizeMapping[splitButtonState.size];\n const iconComp = renderProps.isPending ? (\n <Loader size={iconSize} />\n ) : (\n icon && <Icon icon={icon} size={iconSize} />\n );\n\n return (\n <span\n className={clsx(\n ButtonCore,\n buttonColorBase,\n SplitButtonVariantBase,\n ButtonLabelTextMapping[splitButtonState.size]\n )}\n {...dataAttrs}\n >\n {splashInfo && <Splash {...splashInfo} />}\n\n {iconPlacement === \"start\" && iconComp}\n\n {isChildFunc ? children(renderProps) : children}\n\n {iconPlacement === \"end\" && iconComp}\n </span>\n );\n }}\n </AriaButton>,\n tooltip\n );\n};\n"],"mappings":";;;;;;;;;;;AAoBA,IAAa,KAAyD,EAClE,YACA,SACA,aACA,YACA,eACA,cACA,cACA,mBAAgB,SAChB,GAAG,QACD;CACF,IAAM,IAAmB,EAAsB,GAEzC,EAAE,eAAY,mBAAgB,EAAU,CAAO,GAC/C,IAAc,OAAO,KAAa,YAElC,IAAU,KAAa,EAAiB;CAG9C,OAAO,EACH,kBAAC,GAAD;EACI,SAAS;EACT,YALS,KAAc,EAAiB;EAMxC,WAAW;EACX,GAAI;EACJ,YAAY,MACR,EACI,GACA,GACA,GACA,EAAkB,EAAiB,KAAK,GACxC,OAAO,KAAc,aACf,EAAU,CAAW,IACrB,CACV;EAEJ,eAAA;EACA,6BAAA;
|
|
1
|
+
{"version":3,"file":"index.js","names":["renderProps","isDisabled"],"sources":["../../../../../src/components/Button/SplitButton/SplitButtonPrimary/SplitButtonPrimary.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { Button as AriaButton } from \"react-aria-components\";\nimport { Icon } from \"@/components/Icon\";\nimport { Loader } from \"@/components/Loader\";\nimport { Splash } from \"@/components/Splash/Splash\";\nimport { useSplash } from \"@/components/Splash/useSplash\";\nimport { TapTarget } from \"@/utils/tapTarget\";\nimport {\n ButtonCore,\n ButtonIconSizeMapping,\n ButtonLabelTextMapping,\n ButtonReset,\n buttonColorBase,\n buttonColorConfig,\n withTooltip,\n} from \"../../core\";\nimport { SplitButtonPrimaryBase, SplitButtonVariantBase } from \"../core\";\nimport { useSplitButtonContext } from \"../SplitButtonContext\";\nimport type { SplitButtonPrimaryProps } from \"./types\";\n\nexport const SplitButtonPrimary: React.FC<SplitButtonPrimaryProps> = ({\n tooltip,\n icon,\n children,\n onPress,\n isDisabled,\n isPending,\n className,\n iconPlacement = \"start\",\n ...props\n}) => {\n const splitButtonState = useSplitButtonContext();\n\n const { splashInfo, handlePress } = useSplash(onPress);\n const isChildFunc = typeof children === \"function\";\n\n const pending = isPending || splitButtonState.isPending;\n const disabled = isDisabled || splitButtonState.isDisabled;\n\n return withTooltip(\n <AriaButton\n onPress={handlePress}\n isDisabled={disabled}\n isPending={pending}\n {...props}\n className={(renderProps) =>\n clsx(\n ButtonReset,\n TapTarget,\n SplitButtonPrimaryBase,\n buttonColorConfig(splitButtonState.color),\n typeof className === \"function\"\n ? className(renderProps)\n : className\n )\n }\n data-button\n data-split-button-primary\n >\n {(renderProps) => {\n const {\n isDisabled,\n isFocusVisible,\n isFocused,\n isPressed,\n isHovered,\n } = renderProps;\n\n const dataAttrs = {\n \"data-hovered\": isHovered || undefined,\n \"data-disabled\": isDisabled || undefined,\n \"data-focused\": isFocused || undefined,\n \"data-focus-visible\": isFocusVisible || undefined,\n \"data-pressed\": isPressed || undefined,\n \"data-visual-button\": true,\n };\n\n const iconSize = ButtonIconSizeMapping[splitButtonState.size];\n const iconComp = renderProps.isPending ? (\n <Loader size={iconSize} />\n ) : (\n icon && <Icon icon={icon} size={iconSize} />\n );\n\n return (\n <span\n className={clsx(\n ButtonCore,\n buttonColorBase,\n SplitButtonVariantBase,\n ButtonLabelTextMapping[splitButtonState.size]\n )}\n {...dataAttrs}\n >\n {splashInfo && <Splash {...splashInfo} />}\n\n {iconPlacement === \"start\" && iconComp}\n\n {isChildFunc ? children(renderProps) : children}\n\n {iconPlacement === \"end\" && iconComp}\n </span>\n );\n }}\n </AriaButton>,\n tooltip\n );\n};\n"],"mappings":";;;;;;;;;;;AAoBA,IAAa,KAAyD,EAClE,YACA,SACA,aACA,YACA,eACA,cACA,cACA,mBAAgB,SAChB,GAAG,QACD;CACF,IAAM,IAAmB,EAAsB,GAEzC,EAAE,eAAY,mBAAgB,EAAU,CAAO,GAC/C,IAAc,OAAO,KAAa,YAElC,IAAU,KAAa,EAAiB;CAG9C,OAAO,EACH,kBAAC,GAAD;EACI,SAAS;EACT,YALS,KAAc,EAAiB;EAMxC,WAAW;EACX,GAAI;EACJ,YAAY,MACR,EACI,GACA,GACA,GACA,EAAkB,EAAiB,KAAK,GACxC,OAAO,KAAc,aACf,EAAU,CAAW,IACrB,CACV;EAEJ,eAAA;EACA,6BAAA;aAEEA,MAAgB;GACd,IAAM,EACF,YAAAC,GACA,mBACA,cACA,cACA,iBACAD,GAEE,IAAY;IACd,gBAAgB,KAAa,KAAA;IAC7B,iBAAiBC,KAAc,KAAA;IAC/B,gBAAgB,KAAa,KAAA;IAC7B,sBAAsB,KAAkB,KAAA;IACxC,gBAAgB,KAAa,KAAA;IAC7B,sBAAsB;GAC1B,GAEM,IAAW,EAAsB,EAAiB,OAClD,IAAWD,EAAY,YACzB,kBAAC,GAAD,EAAQ,MAAM,EAAS,CAAA,IAEvB,KAAQ,kBAAC,GAAD;IAAY;IAAM,MAAM;GAAS,CAAA;GAG7C,OACI,kBAAC,QAAD;IACI,WAAW,EACP,GACA,GACA,GACA,EAAuB,EAAiB,KAC5C;IACA,GAAI;cAPR;KASK,KAAc,kBAAC,GAAD,EAAQ,GAAI,EAAW,CAAA;KAErC,MAAkB,WAAW;KAE7B,IAAc,EAASA,CAAW,IAAI;KAEtC,MAAkB,SAAS;IAC1B;;EAEd;CACQ,CAAA,GACZ,CACJ;AACJ"}
|
|
@@ -1,61 +1,76 @@
|
|
|
1
|
-
import { t as e } from "../../../chunks/
|
|
2
|
-
import { t } from "../../../chunks/
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { t as e } from "../../../chunks/compiler-runtime";
|
|
2
|
+
import { t } from "../../../chunks/tapTarget";
|
|
3
|
+
import { t as n } from "../../../chunks/Icon";
|
|
4
|
+
import { n as r, t as i } from "../../../chunks/useSplash";
|
|
5
|
+
import { a, c as o, d as s, f as c, i as l, l as u, n as d, o as f, p, t as m, u as h } from "../../../chunks/core";
|
|
6
|
+
import { clsx as g } from "clsx";
|
|
7
|
+
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
8
|
+
import { ToggleButton as y } from "react-aria-components";
|
|
8
9
|
//#region src/components/Button/ToggleButton/ToggleButton.tsx
|
|
9
|
-
var
|
|
10
|
-
let
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
10
|
+
var b = e(), x = (e) => {
|
|
11
|
+
let x = (0, b.c)(45), S, C, w, T, E, D, O, k, A, j, M;
|
|
12
|
+
x[0] === e ? (S = x[1], C = x[2], w = x[3], T = x[4], E = x[5], D = x[6], O = x[7], k = x[8], A = x[9], j = x[10], M = x[11]) : ({size: j, shape: A, color: w, tooltip: M, selectedIcon: k, icon: T, children: S, onPress: D, className: C, iconPlacement: E, ...O} = e, x[0] = e, x[1] = S, x[2] = C, x[3] = w, x[4] = T, x[5] = E, x[6] = D, x[7] = O, x[8] = k, x[9] = A, x[10] = j, x[11] = M);
|
|
13
|
+
let N;
|
|
14
|
+
x[12] !== w || x[13] !== E || x[14] !== A || x[15] !== j ? (N = {
|
|
15
|
+
size: j,
|
|
16
|
+
shape: A,
|
|
17
|
+
color: w,
|
|
18
|
+
iconPlacement: E
|
|
19
|
+
}, x[12] = w, x[13] = E, x[14] = A, x[15] = j, x[16] = N) : N = x[16];
|
|
20
|
+
let { buttonColor: P, buttonShape: F, buttonSize: I, buttonIconPlacement: L } = d(N), { splashInfo: R, handlePress: z } = i(D), B = typeof S == "function", V;
|
|
21
|
+
x[17] !== P || x[18] !== F || x[19] !== I ? (V = p({
|
|
22
|
+
shape: F,
|
|
23
|
+
size: I,
|
|
24
|
+
color: P
|
|
25
|
+
}), x[17] = P, x[18] = F, x[19] = I, x[20] = V) : V = x[20];
|
|
26
|
+
let H = V, U;
|
|
27
|
+
x[21] === H ? U = x[22] : (U = {
|
|
28
|
+
...H,
|
|
21
29
|
"data-toggle-button": !0
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
30
|
+
}, x[21] = H, x[22] = U);
|
|
31
|
+
let W = U, G;
|
|
32
|
+
x[23] !== P || x[24] !== I || x[25] !== C ? (G = (e) => g(c, t, o(I), h(P), typeof C == "function" ? C(e) : C), x[23] = P, x[24] = I, x[25] = C, x[26] = G) : G = x[26];
|
|
33
|
+
let K;
|
|
34
|
+
x[27] !== L || x[28] !== I || x[29] !== S || x[30] !== T || x[31] !== B || x[32] !== k || x[33] !== R || x[34] !== W ? (K = (e) => {
|
|
35
|
+
let { isSelected: t, isDisabled: i, isFocusVisible: o, isFocused: c, isPressed: d, isHovered: p } = e, m = {
|
|
36
|
+
...W,
|
|
37
|
+
"data-hovered": p || void 0,
|
|
38
|
+
"data-disabled": i || void 0,
|
|
39
|
+
"data-focused": c || void 0,
|
|
40
|
+
"data-focus-visible": o || void 0,
|
|
41
|
+
"data-pressed": d || void 0,
|
|
42
|
+
"data-selected": t || void 0,
|
|
43
|
+
"data-visual-button": !0
|
|
44
|
+
}, h = T;
|
|
45
|
+
t && k && (h = k);
|
|
46
|
+
let y = l[I], b = h && /* @__PURE__ */ _(n, {
|
|
47
|
+
icon: h,
|
|
48
|
+
size: y
|
|
49
|
+
});
|
|
50
|
+
return /* @__PURE__ */ v("span", {
|
|
51
|
+
className: g(s, u, f, a[I]),
|
|
52
|
+
...m,
|
|
53
|
+
children: [
|
|
54
|
+
R && /* @__PURE__ */ _(r, { ...R }),
|
|
55
|
+
L === "start" && b,
|
|
56
|
+
B ? S(e) : S,
|
|
57
|
+
L === "end" && b
|
|
58
|
+
]
|
|
59
|
+
});
|
|
60
|
+
}, x[27] = L, x[28] = I, x[29] = S, x[30] = T, x[31] = B, x[32] = k, x[33] = R, x[34] = W, x[35] = K) : K = x[35];
|
|
61
|
+
let q;
|
|
62
|
+
x[36] !== z || x[37] !== O || x[38] !== G || x[39] !== K || x[40] !== W ? (q = /* @__PURE__ */ _(y, {
|
|
63
|
+
onPress: z,
|
|
64
|
+
className: G,
|
|
65
|
+
...O,
|
|
66
|
+
...W,
|
|
28
67
|
"data-button": !0,
|
|
29
|
-
children:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"data-disabled": a || void 0,
|
|
34
|
-
"data-focused": u || void 0,
|
|
35
|
-
"data-focus-visible": s || void 0,
|
|
36
|
-
"data-pressed": f || void 0,
|
|
37
|
-
"data-selected": r || void 0,
|
|
38
|
-
"data-visual-button": !0
|
|
39
|
-
}, v = w;
|
|
40
|
-
r && C && (v = C);
|
|
41
|
-
let y = c[M], b = v && /* @__PURE__ */ g(t, {
|
|
42
|
-
icon: v,
|
|
43
|
-
size: y
|
|
44
|
-
});
|
|
45
|
-
return /* @__PURE__ */ _("span", {
|
|
46
|
-
className: h(o, l, d, i[M]),
|
|
47
|
-
...m,
|
|
48
|
-
children: [
|
|
49
|
-
P && /* @__PURE__ */ g(n, { ...P }),
|
|
50
|
-
N === "start" && b,
|
|
51
|
-
I ? T(e) : T,
|
|
52
|
-
N === "end" && b
|
|
53
|
-
]
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
}), S);
|
|
68
|
+
children: K
|
|
69
|
+
}), x[36] = z, x[37] = O, x[38] = G, x[39] = K, x[40] = W, x[41] = q) : q = x[41];
|
|
70
|
+
let J;
|
|
71
|
+
return x[42] !== q || x[43] !== M ? (J = m(q, M), x[42] = q, x[43] = M, x[44] = J) : J = x[44], J;
|
|
57
72
|
};
|
|
58
73
|
//#endregion
|
|
59
|
-
export {
|
|
74
|
+
export { x as ToggleButton };
|
|
60
75
|
|
|
61
76
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/Button/ToggleButton/ToggleButton.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { ToggleButton as AriaToggleButton } from \"react-aria-components\";\nimport { Icon } from \"@/components/Icon\";\nimport { Splash } from \"@/components/Splash/Splash\";\nimport { useSplash } from \"@/components/Splash/useSplash\";\nimport { TapTarget } from \"@/utils/tapTarget\";\nimport {\n ButtonCore,\n ButtonIconSizeMapping,\n ButtonLabelTextMapping,\n ButtonReset,\n ButtonSizeBase,\n buttonColorBase,\n buttonColorConfig,\n buttonSizeConfig,\n newButtonBaseDataAttrs,\n useButtonConfig,\n withTooltip,\n} from \"../core\";\nimport type { ToggleButtonProps } from \"./types\";\n\nexport const ToggleButton: React.FC<ToggleButtonProps> = ({\n size,\n shape,\n color,\n tooltip,\n selectedIcon,\n icon,\n children,\n onPress,\n className,\n iconPlacement,\n ...props\n}) => {\n const { buttonColor, buttonShape, buttonSize, buttonIconPlacement } =\n useButtonConfig({\n size,\n shape,\n color,\n iconPlacement,\n });\n\n const { splashInfo, handlePress } = useSplash(onPress);\n const isChildFunc = typeof children === \"function\";\n\n const baseButtonDataAttrs = newButtonBaseDataAttrs({\n shape: buttonShape,\n size: buttonSize,\n color: buttonColor,\n });\n\n const toggleButtonDataAttrs = {\n ...baseButtonDataAttrs,\n \"data-toggle-button\": true,\n };\n\n return withTooltip(\n <AriaToggleButton\n onPress={handlePress}\n className={(renderProps) =>\n clsx(\n ButtonReset,\n TapTarget,\n buttonSizeConfig(buttonSize),\n buttonColorConfig(buttonColor),\n typeof className === \"function\"\n ? className(renderProps)\n : className\n )\n }\n {...props}\n {...toggleButtonDataAttrs}\n data-button\n >\n {(renderProps) => {\n const {\n isSelected,\n isDisabled,\n isFocusVisible,\n isFocused,\n isPressed,\n isHovered,\n } = renderProps;\n\n const dataAttrs = {\n ...toggleButtonDataAttrs,\n \"data-hovered\": isHovered || undefined,\n \"data-disabled\": isDisabled || undefined,\n \"data-focused\": isFocused || undefined,\n \"data-focus-visible\": isFocusVisible || undefined,\n \"data-pressed\": isPressed || undefined,\n \"data-selected\": isSelected || undefined,\n \"data-visual-button\": true,\n };\n\n let iconToRender = icon;\n if (isSelected && selectedIcon) iconToRender = selectedIcon;\n\n const iconSize = ButtonIconSizeMapping[buttonSize];\n\n const iconComp = iconToRender && (\n <Icon icon={iconToRender} size={iconSize} />\n );\n\n return (\n <span\n className={clsx(\n ButtonCore,\n buttonColorBase,\n ButtonSizeBase,\n ButtonLabelTextMapping[buttonSize]\n )}\n {...dataAttrs}\n >\n {splashInfo && <Splash {...splashInfo} />}\n\n {buttonIconPlacement === \"start\" && iconComp}\n\n {isChildFunc ? children(renderProps) : children}\n\n {buttonIconPlacement === \"end\" && iconComp}\n </span>\n );\n }}\n </AriaToggleButton>,\n tooltip\n );\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["renderProps","iconToRender","iconSize","handlePress"],"sources":["../../../../src/components/Button/ToggleButton/ToggleButton.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { ToggleButton as AriaToggleButton } from \"react-aria-components\";\nimport { Icon } from \"@/components/Icon\";\nimport { Splash } from \"@/components/Splash/Splash\";\nimport { useSplash } from \"@/components/Splash/useSplash\";\nimport { TapTarget } from \"@/utils/tapTarget\";\nimport {\n ButtonCore,\n ButtonIconSizeMapping,\n ButtonLabelTextMapping,\n ButtonReset,\n ButtonSizeBase,\n buttonColorBase,\n buttonColorConfig,\n buttonSizeConfig,\n newButtonBaseDataAttrs,\n useButtonConfig,\n withTooltip,\n} from \"../core\";\nimport type { ToggleButtonProps } from \"./types\";\n\nexport const ToggleButton: React.FC<ToggleButtonProps> = ({\n size,\n shape,\n color,\n tooltip,\n selectedIcon,\n icon,\n children,\n onPress,\n className,\n iconPlacement,\n ...props\n}) => {\n const { buttonColor, buttonShape, buttonSize, buttonIconPlacement } =\n useButtonConfig({\n size,\n shape,\n color,\n iconPlacement,\n });\n\n const { splashInfo, handlePress } = useSplash(onPress);\n const isChildFunc = typeof children === \"function\";\n\n const baseButtonDataAttrs = newButtonBaseDataAttrs({\n shape: buttonShape,\n size: buttonSize,\n color: buttonColor,\n });\n\n const toggleButtonDataAttrs = {\n ...baseButtonDataAttrs,\n \"data-toggle-button\": true,\n };\n\n return withTooltip(\n <AriaToggleButton\n onPress={handlePress}\n className={(renderProps) =>\n clsx(\n ButtonReset,\n TapTarget,\n buttonSizeConfig(buttonSize),\n buttonColorConfig(buttonColor),\n typeof className === \"function\"\n ? className(renderProps)\n : className\n )\n }\n {...props}\n {...toggleButtonDataAttrs}\n data-button\n >\n {(renderProps) => {\n const {\n isSelected,\n isDisabled,\n isFocusVisible,\n isFocused,\n isPressed,\n isHovered,\n } = renderProps;\n\n const dataAttrs = {\n ...toggleButtonDataAttrs,\n \"data-hovered\": isHovered || undefined,\n \"data-disabled\": isDisabled || undefined,\n \"data-focused\": isFocused || undefined,\n \"data-focus-visible\": isFocusVisible || undefined,\n \"data-pressed\": isPressed || undefined,\n \"data-selected\": isSelected || undefined,\n \"data-visual-button\": true,\n };\n\n let iconToRender = icon;\n if (isSelected && selectedIcon) iconToRender = selectedIcon;\n\n const iconSize = ButtonIconSizeMapping[buttonSize];\n\n const iconComp = iconToRender && (\n <Icon icon={iconToRender} size={iconSize} />\n );\n\n return (\n <span\n className={clsx(\n ButtonCore,\n buttonColorBase,\n ButtonSizeBase,\n ButtonLabelTextMapping[buttonSize]\n )}\n {...dataAttrs}\n >\n {splashInfo && <Splash {...splashInfo} />}\n\n {buttonIconPlacement === \"start\" && iconComp}\n\n {isChildFunc ? children(renderProps) : children}\n\n {buttonIconPlacement === \"end\" && iconComp}\n </span>\n );\n }}\n </AriaToggleButton>,\n tooltip\n );\n};\n"],"mappings":";;;;;;;;;aAqBa,KAA4C,MAAA;CAAA,IAAA,KAAA,GAAA,EAAA,EAAA,CAAA,EAAA,GAAA,GAAA,GAAA,GAAA,GAAA,GAAA,GAAA,GAAA,GAAA,GAAA,GAAA;CAAA,AAAA,EAAA,OAAA,KAYxD,IAAA,EAAA,IAAA,IAAA,EAAA,IAAA,IAAA,EAAA,IAAA,IAAA,EAAA,IAAA,IAAA,EAAA,IAAA,IAAA,EAAA,IAAA,IAAA,EAAA,IAAA,IAAA,EAAA,IAAA,IAAA,EAAA,IAAA,IAAA,EAAA,KAAA,IAAA,EAAA,QAZyD,gIAAA,KAAA,GAYzD,EAAA,KAAA,GAAA,EAAA,KAAA,GAAA,EAAA,KAAA,GAAA,EAAA,KAAA,GAAA,EAAA,KAAA,GAAA,EAAA,KAAA,GAAA,EAAA,KAAA,GAAA,EAAA,KAAA,GAAA,EAAA,KAAA,GAAA,EAAA,KAAA,GAAA,EAAA,MAAA,GAAA,EAAA,MAAA;CAAA,IAAA;CAAA,AAAA,EAAA,QAAA,KAAA,EAAA,QAAA,KAAA,EAAA,QAAA,KAAA,EAAA,QAAA,KAEuB,IAAA;EAAA;EAAA;EAAA;EAAA;CAKhB,GAAC,EAAA,MAAA,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/ToggleIconButton.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { ToggleButton as AriaToggleButton } from \"react-aria-components\";\nimport { Icon } from \"@/components/Icon\";\nimport { Splash } from \"@/components/Splash/Splash\";\nimport { useSplash } from \"@/components/Splash/useSplash\";\nimport { TapTarget } from \"@/utils/tapTarget\";\nimport {\n ButtonCore,\n ButtonReset,\n ButtonSizeBase,\n buttonColorBase,\n buttonColorConfig,\n buttonSizeConfig,\n IconButtonIconSizeMapping,\n newButtonBaseDataAttrs,\n useButtonConfig,\n withTooltip,\n} from \"../core\";\nimport type { ToggleIconButtonProps } from \"./types\";\n\nexport const ToggleIconButton: React.FC<ToggleIconButtonProps> = ({\n size,\n shape,\n color,\n width = \"default\",\n tooltip,\n selectedIcon,\n icon,\n onPress,\n className,\n ...props\n}) => {\n const { buttonColor, buttonShape, buttonSize } = useButtonConfig({\n size,\n shape,\n color,\n });\n\n const { splashInfo, handlePress } = useSplash(onPress);\n\n const baseButtonDataAttrs = newButtonBaseDataAttrs({\n shape: buttonShape,\n size: buttonSize,\n color: buttonColor,\n });\n\n const iconButtonDataAttrs = {\n ...baseButtonDataAttrs,\n \"data-width\": width,\n \"data-icon-button\": true,\n \"data-toggle-button\": true,\n };\n\n return withTooltip(\n <AriaToggleButton\n onPress={handlePress}\n className={(renderProps) =>\n clsx(\n ButtonReset,\n TapTarget,\n buttonSizeConfig(buttonSize),\n buttonColorConfig(buttonColor),\n typeof className === \"function\"\n ? className(renderProps)\n : className\n )\n }\n {...props}\n {...iconButtonDataAttrs}\n data-button\n >\n {({\n isSelected,\n isDisabled,\n isFocusVisible,\n isFocused,\n isPressed,\n isHovered,\n }) => {\n const dataAttrs = {\n ...iconButtonDataAttrs,\n \"data-hovered\": isHovered || undefined,\n \"data-disabled\": isDisabled || undefined,\n \"data-focused\": isFocused || undefined,\n \"data-focus-visible\": isFocusVisible || undefined,\n \"data-pressed\": isPressed || undefined,\n \"data-selected\": isSelected || undefined,\n \"data-visual-button\": true,\n };\n\n let iconToRender = icon;\n if (isSelected && selectedIcon) iconToRender = selectedIcon;\n\n const iconSize = IconButtonIconSizeMapping[buttonSize];\n return (\n <span\n className={clsx(\n ButtonCore,\n buttonColorBase,\n ButtonSizeBase\n )}\n {...dataAttrs}\n >\n {splashInfo && <Splash {...splashInfo} />}\n\n {iconToRender && (\n <Icon icon={iconToRender} size={iconSize} />\n )}\n </span>\n );\n }}\n </AriaToggleButton>,\n tooltip\n );\n};\n"],"mappings":";;;;;;;;AAoBA,IAAa,KAAqD,EAC9D,SACA,UACA,UACA,WAAQ,WACR,YACA,iBACA,SACA,YACA,cACA,GAAG,QACD;CACF,IAAM,EAAE,gBAAa,gBAAa,kBAAe,EAAgB;EAC7D;EACA;EACA;CACJ,CAAC,GAEK,EAAE,eAAY,mBAAgB,EAAU,CAAO,GAQ/C,IAAsB;EACxB,GAPwB,EAAuB;GAC/C,OAAO;GACP,MAAM;GACN,OAAO;EACX,CAGO;EACH,cAAc;EACd,oBAAoB;EACpB,sBAAsB;CAC1B;CAEA,OAAO,EACH,kBAAC,GAAD;EACI,SAAS;EACT,YAAY,MACR,EACI,GACA,GACA,EAAiB,CAAU,GAC3B,EAAkB,CAAW,GAC7B,OAAO,KAAc,aACf,EAAU,CAAW,IACrB,CACV;EAEJ,GAAI;EACJ,GAAI;EACJ,eAAA;aAEE,EACE,eACA,eACA,mBACA,cACA,cACA,mBACE;GACF,IAAM,IAAY;IACd,GAAG;IACH,gBAAgB,KAAa,KAAA;IAC7B,iBAAiB,KAAc,KAAA;IAC/B,gBAAgB,KAAa,KAAA;IAC7B,sBAAsB,KAAkB,KAAA;IACxC,gBAAgB,KAAa,KAAA;IAC7B,iBAAiB,KAAc,KAAA;IAC/B,sBAAsB;GAC1B,GAEI,IAAe;GACnB,AAAI,KAAc,MAAc,IAAe;GAE/C,IAAM,IAAW,EAA0B;GAC3C,OACI,kBAAC,QAAD;IACI,WAAW,EACP,GACA,GACA,CACJ;IACA,GAAI;cANR,CAQK,KAAc,kBAAC,GAAD,EAAQ,GAAI,
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/Button/ToggleIconButton/ToggleIconButton.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { ToggleButton as AriaToggleButton } from \"react-aria-components\";\nimport { Icon } from \"@/components/Icon\";\nimport { Splash } from \"@/components/Splash/Splash\";\nimport { useSplash } from \"@/components/Splash/useSplash\";\nimport { TapTarget } from \"@/utils/tapTarget\";\nimport {\n ButtonCore,\n ButtonReset,\n ButtonSizeBase,\n buttonColorBase,\n buttonColorConfig,\n buttonSizeConfig,\n IconButtonIconSizeMapping,\n newButtonBaseDataAttrs,\n useButtonConfig,\n withTooltip,\n} from \"../core\";\nimport type { ToggleIconButtonProps } from \"./types\";\n\nexport const ToggleIconButton: React.FC<ToggleIconButtonProps> = ({\n size,\n shape,\n color,\n width = \"default\",\n tooltip,\n selectedIcon,\n icon,\n onPress,\n className,\n ...props\n}) => {\n const { buttonColor, buttonShape, buttonSize } = useButtonConfig({\n size,\n shape,\n color,\n });\n\n const { splashInfo, handlePress } = useSplash(onPress);\n\n const baseButtonDataAttrs = newButtonBaseDataAttrs({\n shape: buttonShape,\n size: buttonSize,\n color: buttonColor,\n });\n\n const iconButtonDataAttrs = {\n ...baseButtonDataAttrs,\n \"data-width\": width,\n \"data-icon-button\": true,\n \"data-toggle-button\": true,\n };\n\n return withTooltip(\n <AriaToggleButton\n onPress={handlePress}\n className={(renderProps) =>\n clsx(\n ButtonReset,\n TapTarget,\n buttonSizeConfig(buttonSize),\n buttonColorConfig(buttonColor),\n typeof className === \"function\"\n ? className(renderProps)\n : className\n )\n }\n {...props}\n {...iconButtonDataAttrs}\n data-button\n >\n {({\n isSelected,\n isDisabled,\n isFocusVisible,\n isFocused,\n isPressed,\n isHovered,\n }) => {\n const dataAttrs = {\n ...iconButtonDataAttrs,\n \"data-hovered\": isHovered || undefined,\n \"data-disabled\": isDisabled || undefined,\n \"data-focused\": isFocused || undefined,\n \"data-focus-visible\": isFocusVisible || undefined,\n \"data-pressed\": isPressed || undefined,\n \"data-selected\": isSelected || undefined,\n \"data-visual-button\": true,\n };\n\n let iconToRender = icon;\n if (isSelected && selectedIcon) iconToRender = selectedIcon;\n\n const iconSize = IconButtonIconSizeMapping[buttonSize];\n return (\n <span\n className={clsx(\n ButtonCore,\n buttonColorBase,\n ButtonSizeBase\n )}\n {...dataAttrs}\n >\n {splashInfo && <Splash {...splashInfo} />}\n\n {iconToRender && (\n <Icon icon={iconToRender} size={iconSize} />\n )}\n </span>\n );\n }}\n </AriaToggleButton>,\n tooltip\n );\n};\n"],"mappings":";;;;;;;;AAoBA,IAAa,KAAqD,EAC9D,SACA,UACA,UACA,WAAQ,WACR,YACA,iBACA,SACA,YACA,cACA,GAAG,QACD;CACF,IAAM,EAAE,gBAAa,gBAAa,kBAAe,EAAgB;EAC7D;EACA;EACA;CACJ,CAAC,GAEK,EAAE,eAAY,mBAAgB,EAAU,CAAO,GAQ/C,IAAsB;EACxB,GAPwB,EAAuB;GAC/C,OAAO;GACP,MAAM;GACN,OAAO;EACX,CAGO;EACH,cAAc;EACd,oBAAoB;EACpB,sBAAsB;CAC1B;CAEA,OAAO,EACH,kBAAC,GAAD;EACI,SAAS;EACT,YAAY,MACR,EACI,GACA,GACA,EAAiB,CAAU,GAC3B,EAAkB,CAAW,GAC7B,OAAO,KAAc,aACf,EAAU,CAAW,IACrB,CACV;EAEJ,GAAI;EACJ,GAAI;EACJ,eAAA;aAEE,EACE,eACA,eACA,mBACA,cACA,cACA,mBACE;GACF,IAAM,IAAY;IACd,GAAG;IACH,gBAAgB,KAAa,KAAA;IAC7B,iBAAiB,KAAc,KAAA;IAC/B,gBAAgB,KAAa,KAAA;IAC7B,sBAAsB,KAAkB,KAAA;IACxC,gBAAgB,KAAa,KAAA;IAC7B,iBAAiB,KAAc,KAAA;IAC/B,sBAAsB;GAC1B,GAEI,IAAe;GACnB,AAAI,KAAc,MAAc,IAAe;GAE/C,IAAM,IAAW,EAA0B;GAC3C,OACI,kBAAC,QAAD;IACI,WAAW,EACP,GACA,GACA,CACJ;IACA,GAAI;cANR,CAQK,KAAc,kBAAC,GAAD,EAAQ,GAAI,EAAW,CAAA,GAErC,KACG,kBAAC,GAAD;KAAM,MAAM;KAAc,MAAM;IAAS,CAAA,CAE3C;;EAEd;CACc,CAAA,GAClB,CACJ;AACJ"}
|