@nattstack/ui 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/button/button-spinner.js +4 -4
- package/dist/components/button/button-spinner.stylex.js +1 -1
- package/dist/components/button/button.d.ts +2 -13
- package/dist/components/button/button.js +10 -32
- package/dist/components/button/button.stylex.js +78 -77
- package/dist/components/button-link/button-link.d.ts +1 -1
- package/dist/components/button-link/button-link.js +8 -12
- package/dist/components/checkbox/checkbox-icon.js +3 -3
- package/dist/components/checkbox/checkbox.d.ts +1 -2
- package/dist/components/checkbox/checkbox.js +8 -7
- package/dist/components/checkbox/checkbox.stylex.js +1 -1
- package/dist/components/cn.js +9 -7
- package/dist/components/column/column.d.ts +1 -2
- package/dist/components/column/column.js +4 -5
- package/dist/components/combobox/combobox-content.js +8 -7
- package/dist/components/combobox/combobox-empty.d.ts +1 -2
- package/dist/components/combobox/combobox-empty.js +6 -5
- package/dist/components/combobox/combobox-group-label.js +5 -4
- package/dist/components/combobox/combobox-group.js +5 -4
- package/dist/components/combobox/combobox-input.d.ts +1 -2
- package/dist/components/combobox/combobox-input.js +13 -12
- package/dist/components/combobox/combobox-input.stylex.js +37 -27
- package/dist/components/combobox/combobox-item.js +9 -8
- package/dist/components/combobox/combobox-list.js +5 -4
- package/dist/components/combobox/combobox-search.d.ts +1 -2
- package/dist/components/combobox/combobox-search.js +10 -9
- package/dist/components/combobox/combobox-separator.js +5 -4
- package/dist/components/combobox/combobox-trigger.js +8 -7
- package/dist/components/combobox/combobox-value.d.ts +1 -2
- package/dist/components/combobox/combobox-value.js +6 -5
- package/dist/components/combobox/combobox.js +1 -1
- package/dist/components/dialog-responsive/dialog-responsive-backdrop.js +5 -4
- package/dist/components/dialog-responsive/dialog-responsive-bar.js +5 -4
- package/dist/components/dialog-responsive/dialog-responsive-popup.d.ts +1 -2
- package/dist/components/dialog-responsive/dialog-responsive-popup.js +6 -5
- package/dist/components/dialog-responsive/dialog-responsive-portal.js +5 -4
- package/dist/components/dialog-responsive/dialog-responsive-trigger.js +1 -1
- package/dist/components/dialog-responsive/dialog-responsive-viewport.js +5 -4
- package/dist/components/dialog-responsive/dialog-responsive.js +3 -2
- package/dist/components/icon-button/icon-button.d.ts +1 -2
- package/dist/components/icon-button/icon-button.js +9 -20
- package/dist/components/icon-button/icon-button.stylex.js +17 -6
- package/dist/components/index.d.ts +4 -41
- package/dist/components/index.js +2 -39
- package/dist/components/input/input.d.ts +1 -2
- package/dist/components/input/input.js +7 -6
- package/dist/components/input/input.stylex.js +49 -36
- package/dist/components/label/label.d.ts +1 -2
- package/dist/components/label/label.js +4 -5
- package/dist/components/menu/menu-checkbox-item.js +9 -8
- package/dist/components/menu/menu-content.d.ts +1 -2
- package/dist/components/menu/menu-content.js +11 -10
- package/dist/components/menu/menu-group-label.js +5 -4
- package/dist/components/menu/menu-group.js +5 -4
- package/dist/components/menu/menu-item.d.ts +1 -2
- package/dist/components/menu/menu-item.js +6 -5
- package/dist/components/menu/menu-link-item.js +5 -4
- package/dist/components/menu/menu-radio-group.js +5 -4
- package/dist/components/menu/menu-radio-item.js +9 -8
- package/dist/components/menu/menu-separator.js +5 -4
- package/dist/components/menu/menu-submenu-trigger.d.ts +1 -2
- package/dist/components/menu/menu-submenu-trigger.js +8 -7
- package/dist/components/menu/menu-submenu.js +1 -1
- package/dist/components/menu/menu-trigger.js +1 -1
- package/dist/components/menu/menu.js +1 -1
- package/dist/components/otp-field/otp-field-input.d.ts +1 -2
- package/dist/components/otp-field/otp-field-input.js +6 -5
- package/dist/components/otp-field/otp-field.d.ts +1 -2
- package/dist/components/otp-field/otp-field.js +6 -5
- package/dist/components/otp-field/otp-field.stylex.js +1 -1
- package/dist/components/picker/picker-trigger.stylex.js +37 -27
- package/dist/components/row/row.d.ts +1 -2
- package/dist/components/row/row.js +4 -5
- package/dist/components/select/select-content.d.ts +1 -2
- package/dist/components/select/select-content.js +11 -10
- package/dist/components/select/select-group-label.js +5 -4
- package/dist/components/select/select-group.d.ts +1 -2
- package/dist/components/select/select-group.js +6 -5
- package/dist/components/select/select-item.d.ts +1 -2
- package/dist/components/select/select-item.js +10 -9
- package/dist/components/select/select-separator.d.ts +1 -2
- package/dist/components/select/select-separator.js +6 -5
- package/dist/components/select/select-trigger.d.ts +1 -2
- package/dist/components/select/select-trigger.js +9 -8
- package/dist/components/select/select-value.d.ts +1 -2
- package/dist/components/select/select-value.js +6 -5
- package/dist/components/select/select.js +1 -1
- package/dist/components/spacer/spacer.d.ts +1 -2
- package/dist/components/spacer/spacer.js +4 -5
- package/dist/components/stylex.css +4 -4
- package/dist/components/switch/switch.d.ts +1 -2
- package/dist/components/switch/switch.js +8 -7
- package/dist/components/switch/switch.stylex.js +17 -13
- package/dist/components/tabs/tabs-panel.d.ts +1 -2
- package/dist/components/tabs/tabs-panel.js +4 -5
- package/dist/components/tabs/tabs.d.ts +1 -2
- package/dist/components/tabs/tabs.js +4 -5
- package/dist/components/tabs-pill/tabs-pill-indicator.js +5 -4
- package/dist/components/tabs-pill/tabs-pill-list.d.ts +1 -2
- package/dist/components/tabs-pill/tabs-pill-list.js +6 -5
- package/dist/components/tabs-pill/tabs-pill-tab.d.ts +1 -2
- package/dist/components/tabs-pill/tabs-pill-tab.js +8 -7
- package/dist/components/tabs-segmented/tabs-segmented-indicator.js +5 -4
- package/dist/components/tabs-segmented/tabs-segmented-list.d.ts +1 -2
- package/dist/components/tabs-segmented/tabs-segmented-list.js +6 -5
- package/dist/components/tabs-segmented/tabs-segmented-tab.d.ts +1 -2
- package/dist/components/tabs-segmented/tabs-segmented-tab.js +6 -5
- package/dist/components/tabs-underline/tabs-underline-indicator.js +5 -4
- package/dist/components/tabs-underline/tabs-underline-list.d.ts +1 -2
- package/dist/components/tabs-underline/tabs-underline-list.js +6 -5
- package/dist/components/tabs-underline/tabs-underline-tab.d.ts +1 -2
- package/dist/components/tabs-underline/tabs-underline-tab.js +6 -5
- package/dist/components/textarea/textarea.d.ts +1 -2
- package/dist/components/textarea/textarea.js +7 -6
- package/dist/components/toggle-group/toggle-group-item.d.ts +1 -2
- package/dist/components/toggle-group/toggle-group-item.js +6 -5
- package/dist/components/toggle-group/toggle-group.d.ts +1 -2
- package/dist/components/toggle-group/toggle-group.js +6 -5
- package/dist/components/tooltip/tooltip-popup.d.ts +1 -2
- package/dist/components/tooltip/tooltip-popup.js +8 -7
- package/dist/components/tooltip/tooltip-provider.js +1 -1
- package/dist/components/tooltip/tooltip-trigger.js +1 -1
- package/dist/components/tooltip/tooltip.js +3 -2
- package/package.json +3 -2
- package/dist/components/button/button.stylex.d.ts +0 -121
- package/dist/components/checkbox/checkbox.stylex.d.ts +0 -40
- package/dist/components/cn.d.ts +0 -6
- package/dist/components/column/column.stylex.d.ts +0 -10
- package/dist/components/combobox/combobox-empty.stylex.d.ts +0 -13
- package/dist/components/combobox/combobox-input.stylex.d.ts +0 -93
- package/dist/components/combobox/combobox-search.stylex.d.ts +0 -45
- package/dist/components/combobox/combobox-value.stylex.d.ts +0 -14
- package/dist/components/dialog-responsive/dialog-responsive-popup.stylex.d.ts +0 -32
- package/dist/components/icon-button/icon-button.stylex.d.ts +0 -21
- package/dist/components/input/input.stylex.d.ts +0 -66
- package/dist/components/label/label.stylex.d.ts +0 -12
- package/dist/components/menu/menu-content.stylex.d.ts +0 -11
- package/dist/components/menu/menu-item.stylex.d.ts +0 -11
- package/dist/components/menu/menu-submenu-trigger.stylex.d.ts +0 -19
- package/dist/components/otp-field/otp-field-input.stylex.d.ts +0 -25
- package/dist/components/otp-field/otp-field.stylex.d.ts +0 -16
- package/dist/components/picker/picker-group.stylex.d.ts +0 -18
- package/dist/components/picker/picker-item.stylex.d.ts +0 -39
- package/dist/components/picker/picker-popup.stylex.d.ts +0 -36
- package/dist/components/picker/picker-separator.stylex.d.ts +0 -13
- package/dist/components/picker/picker-trigger.stylex.d.ts +0 -60
- package/dist/components/row/row.stylex.d.ts +0 -10
- package/dist/components/select/select-value.stylex.d.ts +0 -14
- package/dist/components/spacer/spacer.stylex.d.ts +0 -9
- package/dist/components/switch/switch.stylex.d.ts +0 -41
- package/dist/components/tabs/tabs-panel.stylex.d.ts +0 -14
- package/dist/components/tabs/tabs.stylex.d.ts +0 -10
- package/dist/components/tabs-pill/tabs-pill-list.stylex.d.ts +0 -13
- package/dist/components/tabs-pill/tabs-pill-tab.stylex.d.ts +0 -44
- package/dist/components/tabs-segmented/tabs-segmented-list.stylex.d.ts +0 -17
- package/dist/components/tabs-segmented/tabs-segmented-tab.stylex.d.ts +0 -28
- package/dist/components/tabs-underline/tabs-underline-list.stylex.d.ts +0 -14
- package/dist/components/tabs-underline/tabs-underline-tab.stylex.d.ts +0 -27
- package/dist/components/textarea/textarea.stylex.d.ts +0 -13
- package/dist/components/toggle-group/toggle-group-item.stylex.d.ts +0 -33
- package/dist/components/toggle-group/toggle-group.stylex.d.ts +0 -11
- package/dist/components/tooltip/tooltip-popup.stylex.d.ts +0 -30
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { cn } from "../cn.js";
|
|
2
2
|
import { buttonSpinnerStyles } from "./button-spinner.stylex.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/button/button-spinner.tsx
|
|
@@ -19,10 +19,10 @@ const BAR_STYLES = [
|
|
|
19
19
|
];
|
|
20
20
|
function ButtonSpinner() {
|
|
21
21
|
return /* @__PURE__ */ jsx("div", {
|
|
22
|
-
className:
|
|
23
|
-
"data-
|
|
22
|
+
className: cn(buttonSpinnerStyles.base),
|
|
23
|
+
"data-component": "button-spinner",
|
|
24
24
|
style: { "--size": `${SIZE}px` },
|
|
25
|
-
children: BAR_STYLES.map((barStyle, index) => /* @__PURE__ */ jsx("div", { className:
|
|
25
|
+
children: BAR_STYLES.map((barStyle, index) => /* @__PURE__ */ jsx("div", { className: cn(buttonSpinnerStyles.bar, barStyle) }, index))
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
//#endregion
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { sx } from "../cn.js";
|
|
2
|
-
import { buttonStyles } from "./button.stylex.js";
|
|
3
1
|
import { ComponentProps, JSX, ReactNode } from "react";
|
|
4
2
|
//#region src/components/button/button.d.ts
|
|
5
3
|
interface ButtonProps extends Omit<ComponentProps<"button">, "children"> {
|
|
6
4
|
fullWidth?: boolean;
|
|
7
5
|
iconEnd?: ReactNode;
|
|
8
6
|
iconStart?: ReactNode;
|
|
9
|
-
label?:
|
|
7
|
+
label?: string;
|
|
10
8
|
loading?: boolean;
|
|
11
9
|
rounded?: boolean;
|
|
12
10
|
size?: ButtonSize;
|
|
@@ -15,14 +13,5 @@ interface ButtonProps extends Omit<ComponentProps<"button">, "children"> {
|
|
|
15
13
|
type ButtonSize = 32 | 36 | 40 | 44 | 48;
|
|
16
14
|
type ButtonVariant = "ghost" | "primary" | "secondary";
|
|
17
15
|
declare function Button(props: ButtonProps): JSX.Element;
|
|
18
|
-
declare function getButtonClassName(options: {
|
|
19
|
-
className?: string;
|
|
20
|
-
disabled?: boolean;
|
|
21
|
-
fullWidth?: boolean;
|
|
22
|
-
loading?: boolean;
|
|
23
|
-
rounded?: boolean;
|
|
24
|
-
size?: ButtonSize;
|
|
25
|
-
variant?: ButtonVariant;
|
|
26
|
-
}, ...overrides: Parameters<typeof sx>): string;
|
|
27
16
|
//#endregion
|
|
28
|
-
export { Button, ButtonProps, ButtonSize, ButtonVariant
|
|
17
|
+
export { Button, ButtonProps, ButtonSize, ButtonVariant };
|
|
@@ -1,45 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { buttonStyles, buttonStylesBy } from "./button.stylex.js";
|
|
2
|
+
import { cn } from "../cn.js";
|
|
2
3
|
import { ButtonSpinner } from "./button-spinner.js";
|
|
3
|
-
import { buttonRoundedBaseStyles, buttonRoundedFullStyles, buttonStyles } from "./button.stylex.js";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/button/button.tsx
|
|
6
6
|
function Button(props) {
|
|
7
|
-
const { className = "", disabled = false,
|
|
7
|
+
const { className = "", disabled = false, fullWidth = false, iconEnd = "", iconStart = "", label = "", loading = false, rounded = false, size = 40, variant = "primary", ...rest } = props;
|
|
8
|
+
const combinedClassName = cn(buttonStyles.base, buttonStylesBy.rounded[rounded ? "full" : "base"][size], buttonStylesBy.size[size], buttonStylesBy.variant[variant], buttonStylesBy.width[fullWidth ? "full" : "base"], (disabled || loading) && buttonStyles.disabled, className);
|
|
8
9
|
return /* @__PURE__ */ jsxs("button", {
|
|
9
|
-
className:
|
|
10
|
-
|
|
11
|
-
disabled,
|
|
12
|
-
fullWidth,
|
|
13
|
-
loading,
|
|
14
|
-
rounded,
|
|
15
|
-
size,
|
|
16
|
-
variant
|
|
17
|
-
}),
|
|
18
|
-
"data-slot": "button",
|
|
10
|
+
className: combinedClassName,
|
|
11
|
+
"data-component": "button",
|
|
19
12
|
disabled: disabled || loading,
|
|
20
|
-
type: "button",
|
|
21
13
|
...rest,
|
|
22
14
|
children: [
|
|
15
|
+
!loading && iconStart,
|
|
23
16
|
loading && /* @__PURE__ */ jsx(ButtonSpinner, {}),
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
className: sx(loading && buttonStyles.loadingContent),
|
|
27
|
-
children: label
|
|
28
|
-
}),
|
|
29
|
-
hideWhenLoading(iconEnd, loading)
|
|
17
|
+
label,
|
|
18
|
+
iconEnd
|
|
30
19
|
]
|
|
31
20
|
});
|
|
32
21
|
}
|
|
33
|
-
function getButtonClassName(options, ...overrides) {
|
|
34
|
-
const { className = "", disabled = false, fullWidth = false, loading = false, rounded = false, size = 40, variant = "primary" } = options;
|
|
35
|
-
return cn(sx(buttonStyles.base, buttonStyles[size], (rounded ? buttonRoundedFullStyles : buttonRoundedBaseStyles)[size], buttonStyles[variant], fullWidth ? buttonStyles.widthFull : buttonStyles.widthBase, disabled && buttonStyles.disabled, loading && buttonStyles.loading, ...overrides), className);
|
|
36
|
-
}
|
|
37
|
-
function hideWhenLoading(node, loading) {
|
|
38
|
-
if (!loading || node === "") return node;
|
|
39
|
-
return /* @__PURE__ */ jsx("span", {
|
|
40
|
-
className: sx(buttonStyles.loadingContent),
|
|
41
|
-
children: node
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
22
|
//#endregion
|
|
45
|
-
export { Button
|
|
23
|
+
export { Button };
|
|
@@ -1,30 +1,11 @@
|
|
|
1
1
|
//#region src/components/button/button.stylex.ts
|
|
2
2
|
const buttonStyles = {
|
|
3
|
-
"32": {
|
|
4
|
-
kZKoxP: "x10w6t97",
|
|
5
|
-
$$css: true
|
|
6
|
-
},
|
|
7
|
-
"36": {
|
|
8
|
-
kZKoxP: "xc9qbxq",
|
|
9
|
-
$$css: true
|
|
10
|
-
},
|
|
11
|
-
"40": {
|
|
12
|
-
kZKoxP: "x1vqgdyp",
|
|
13
|
-
$$css: true
|
|
14
|
-
},
|
|
15
|
-
"44": {
|
|
16
|
-
kZKoxP: "xn3w4p2",
|
|
17
|
-
$$css: true
|
|
18
|
-
},
|
|
19
|
-
"48": {
|
|
20
|
-
kZKoxP: "xsdox4t",
|
|
21
|
-
$$css: true
|
|
22
|
-
},
|
|
23
3
|
base: {
|
|
24
4
|
kGNEyG: "x6s0dn4",
|
|
25
5
|
k1C7PZ: "xfex06f",
|
|
26
6
|
kkrTdU: "x1ypdohk",
|
|
27
7
|
k1xSpc: "x3nfvp2",
|
|
8
|
+
kmuXW: "x2lah0s",
|
|
28
9
|
kGuDYH: "xif65rj",
|
|
29
10
|
k63SB2: "x10p5zqr",
|
|
30
11
|
kjj79g: "xl56j7k",
|
|
@@ -45,114 +26,134 @@ const buttonStyles = {
|
|
|
45
26
|
kSiTet: "xbyyjgo",
|
|
46
27
|
$$css: true
|
|
47
28
|
},
|
|
48
|
-
|
|
49
|
-
kWkggS: "x1pflddp xjbqb8w",
|
|
50
|
-
kMwMTN: "x197k1c5",
|
|
51
|
-
$$css: true
|
|
52
|
-
},
|
|
53
|
-
loading: {
|
|
54
|
-
kkrTdU: "x1h6gzvc",
|
|
55
|
-
kSiTet: "xbyyjgo",
|
|
56
|
-
$$css: true
|
|
57
|
-
},
|
|
58
|
-
loadingContent: {
|
|
59
|
-
kMwMTN: "x19co3pv",
|
|
60
|
-
kKMj4B: "x19pm5ym",
|
|
61
|
-
$$css: true
|
|
62
|
-
},
|
|
63
|
-
primary: {
|
|
64
|
-
kWkggS: "xalcron x1escjlh",
|
|
65
|
-
kMwMTN: "xf4b43d",
|
|
66
|
-
$$css: true
|
|
67
|
-
},
|
|
68
|
-
roundedBase32: {
|
|
29
|
+
rounded_base_32: {
|
|
69
30
|
kaIpWk: "xur7f20",
|
|
70
|
-
k8WAf4: "xt970qd",
|
|
71
31
|
kg3NbH: "xaope02",
|
|
72
32
|
$$css: true
|
|
73
33
|
},
|
|
74
|
-
|
|
34
|
+
rounded_base_36: {
|
|
75
35
|
kaIpWk: "xhpnuu7",
|
|
76
|
-
k8WAf4: "xt970qd",
|
|
77
36
|
kg3NbH: "xqin4a2",
|
|
78
37
|
$$css: true
|
|
79
38
|
},
|
|
80
|
-
|
|
39
|
+
rounded_base_40: {
|
|
81
40
|
kaIpWk: "x1q4ynmn",
|
|
82
|
-
k8WAf4: "xt970qd",
|
|
83
41
|
kg3NbH: "x1hr3lfm",
|
|
84
42
|
$$css: true
|
|
85
43
|
},
|
|
86
|
-
|
|
44
|
+
rounded_base_44: {
|
|
87
45
|
kaIpWk: "x1ctf4ec",
|
|
88
|
-
k8WAf4: "xt970qd",
|
|
89
46
|
kg3NbH: "x12j899k",
|
|
90
47
|
$$css: true
|
|
91
48
|
},
|
|
92
|
-
|
|
49
|
+
rounded_base_48: {
|
|
93
50
|
kaIpWk: "x4pepcl",
|
|
94
|
-
k8WAf4: "xt970qd",
|
|
95
51
|
kg3NbH: "x17qtykl",
|
|
96
52
|
$$css: true
|
|
97
53
|
},
|
|
98
|
-
|
|
54
|
+
rounded_full_32: {
|
|
99
55
|
kaIpWk: "xgqmno8",
|
|
100
|
-
k8WAf4: "xt970qd",
|
|
101
56
|
kg3NbH: "xaope02",
|
|
102
57
|
$$css: true
|
|
103
58
|
},
|
|
104
|
-
|
|
59
|
+
rounded_full_36: {
|
|
105
60
|
kaIpWk: "xugzpu4",
|
|
106
|
-
k8WAf4: "xt970qd",
|
|
107
61
|
kg3NbH: "xelufkg",
|
|
108
62
|
$$css: true
|
|
109
63
|
},
|
|
110
|
-
|
|
64
|
+
rounded_full_40: {
|
|
111
65
|
kaIpWk: "x1m3ak92",
|
|
112
|
-
k8WAf4: "xt970qd",
|
|
113
66
|
kg3NbH: "x17qtykl",
|
|
114
67
|
$$css: true
|
|
115
68
|
},
|
|
116
|
-
|
|
69
|
+
rounded_full_44: {
|
|
117
70
|
kaIpWk: "x13pz1uv",
|
|
118
|
-
k8WAf4: "xt970qd",
|
|
119
71
|
kg3NbH: "x16l46lf",
|
|
120
72
|
$$css: true
|
|
121
73
|
},
|
|
122
|
-
|
|
74
|
+
rounded_full_48: {
|
|
123
75
|
kaIpWk: "x1khhgft",
|
|
124
|
-
k8WAf4: "xt970qd",
|
|
125
76
|
kg3NbH: "x1pbfunf",
|
|
126
77
|
$$css: true
|
|
127
78
|
},
|
|
128
|
-
|
|
79
|
+
size_32: {
|
|
80
|
+
kZKoxP: "x10w6t97",
|
|
81
|
+
$$css: true
|
|
82
|
+
},
|
|
83
|
+
size_36: {
|
|
84
|
+
kZKoxP: "xc9qbxq",
|
|
85
|
+
$$css: true
|
|
86
|
+
},
|
|
87
|
+
size_40: {
|
|
88
|
+
kZKoxP: "x1vqgdyp",
|
|
89
|
+
$$css: true
|
|
90
|
+
},
|
|
91
|
+
size_44: {
|
|
92
|
+
kZKoxP: "xn3w4p2",
|
|
93
|
+
$$css: true
|
|
94
|
+
},
|
|
95
|
+
size_48: {
|
|
96
|
+
kZKoxP: "xsdox4t",
|
|
97
|
+
$$css: true
|
|
98
|
+
},
|
|
99
|
+
variant_ghost: {
|
|
100
|
+
kWkggS: "x1pflddp xjbqb8w",
|
|
101
|
+
kMwMTN: "x197k1c5",
|
|
102
|
+
$$css: true
|
|
103
|
+
},
|
|
104
|
+
variant_primary: {
|
|
105
|
+
kWkggS: "xalcron x1escjlh",
|
|
106
|
+
kMwMTN: "xf4b43d",
|
|
107
|
+
$$css: true
|
|
108
|
+
},
|
|
109
|
+
variant_secondary: {
|
|
129
110
|
kWkggS: "x1pflddp x1h73wb5",
|
|
130
111
|
kGVxlE: "x7auhu6 x1er153n",
|
|
131
112
|
kMwMTN: "x197k1c5",
|
|
132
113
|
$$css: true
|
|
133
114
|
},
|
|
134
|
-
|
|
115
|
+
width_base: {
|
|
135
116
|
kzqmXN: "xeq5yr9",
|
|
136
117
|
$$css: true
|
|
137
118
|
},
|
|
138
|
-
|
|
119
|
+
width_full: {
|
|
139
120
|
kzqmXN: "x1brm51p",
|
|
140
121
|
$$css: true
|
|
141
122
|
}
|
|
142
123
|
};
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
124
|
+
const buttonStylesBy = {
|
|
125
|
+
rounded: {
|
|
126
|
+
base: {
|
|
127
|
+
32: buttonStyles.rounded_base_32,
|
|
128
|
+
36: buttonStyles.rounded_base_36,
|
|
129
|
+
40: buttonStyles.rounded_base_40,
|
|
130
|
+
44: buttonStyles.rounded_base_44,
|
|
131
|
+
48: buttonStyles.rounded_base_48
|
|
132
|
+
},
|
|
133
|
+
full: {
|
|
134
|
+
32: buttonStyles.rounded_full_32,
|
|
135
|
+
36: buttonStyles.rounded_full_36,
|
|
136
|
+
40: buttonStyles.rounded_full_40,
|
|
137
|
+
44: buttonStyles.rounded_full_44,
|
|
138
|
+
48: buttonStyles.rounded_full_48
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
size: {
|
|
142
|
+
32: buttonStyles.size_32,
|
|
143
|
+
36: buttonStyles.size_36,
|
|
144
|
+
40: buttonStyles.size_40,
|
|
145
|
+
44: buttonStyles.size_44,
|
|
146
|
+
48: buttonStyles.size_48
|
|
147
|
+
},
|
|
148
|
+
variant: {
|
|
149
|
+
ghost: buttonStyles.variant_ghost,
|
|
150
|
+
primary: buttonStyles.variant_primary,
|
|
151
|
+
secondary: buttonStyles.variant_secondary
|
|
152
|
+
},
|
|
153
|
+
width: {
|
|
154
|
+
base: buttonStyles.width_base,
|
|
155
|
+
full: buttonStyles.width_full
|
|
156
|
+
}
|
|
156
157
|
};
|
|
157
158
|
//#endregion
|
|
158
|
-
export {
|
|
159
|
+
export { buttonStyles, buttonStylesBy };
|
|
@@ -7,7 +7,7 @@ interface ButtonLinkInternalProps<ComponentType extends ElementType = "a"> {
|
|
|
7
7
|
fullWidth?: boolean;
|
|
8
8
|
iconEnd?: ReactNode;
|
|
9
9
|
iconStart?: ReactNode;
|
|
10
|
-
label?:
|
|
10
|
+
label?: string;
|
|
11
11
|
rounded?: boolean;
|
|
12
12
|
size?: ButtonSize;
|
|
13
13
|
variant?: ButtonVariant;
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { buttonStyles, buttonStylesBy } from "../button/button.stylex.js";
|
|
2
|
+
import { cn } from "../cn.js";
|
|
3
|
+
import { jsxs } from "react/jsx-runtime";
|
|
3
4
|
//#region src/components/button-link/button-link.tsx
|
|
4
5
|
function ButtonLink(props) {
|
|
5
|
-
const { as: Component = "a", className = "",
|
|
6
|
+
const { as: Component = "a", className = "", fullWidth = false, iconEnd = "", iconStart = "", label = "", rounded = false, size = 40, variant = "primary", ...rest } = props;
|
|
7
|
+
const combinedClassName = cn(buttonStyles.base, buttonStylesBy.rounded[rounded ? "full" : "base"][size], buttonStylesBy.size[size], buttonStylesBy.variant[variant], buttonStylesBy.width[fullWidth ? "full" : "base"], className);
|
|
6
8
|
return /* @__PURE__ */ jsxs(Component, {
|
|
7
|
-
className:
|
|
8
|
-
|
|
9
|
-
fullWidth,
|
|
10
|
-
rounded,
|
|
11
|
-
size,
|
|
12
|
-
variant
|
|
13
|
-
}),
|
|
14
|
-
"data-slot": "button-link",
|
|
9
|
+
className: combinedClassName,
|
|
10
|
+
"data-component": "button-link",
|
|
15
11
|
...rest,
|
|
16
12
|
children: [
|
|
17
13
|
iconStart,
|
|
18
|
-
label
|
|
14
|
+
label,
|
|
19
15
|
iconEnd
|
|
20
16
|
]
|
|
21
17
|
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { cn } from "../cn.js";
|
|
2
2
|
import { checkboxStyles } from "./checkbox.stylex.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/checkbox/checkbox-icon.tsx
|
|
5
5
|
function CheckboxIcon(props) {
|
|
6
6
|
const { ...rest } = props;
|
|
7
7
|
return /* @__PURE__ */ jsx("svg", {
|
|
8
|
-
"data-
|
|
8
|
+
"data-component": "checkbox-icon",
|
|
9
9
|
fill: "none",
|
|
10
10
|
height: "24",
|
|
11
11
|
viewBox: "0 0 24 24",
|
|
@@ -13,7 +13,7 @@ function CheckboxIcon(props) {
|
|
|
13
13
|
xmlns: "http://www.w3.org/2000/svg",
|
|
14
14
|
...rest,
|
|
15
15
|
children: /* @__PURE__ */ jsx("path", {
|
|
16
|
-
className:
|
|
16
|
+
className: cn(checkboxStyles.icon_path),
|
|
17
17
|
d: "M5 13.875L9.2 18L19 7",
|
|
18
18
|
strokeLinecap: "round",
|
|
19
19
|
strokeLinejoin: "round"
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { checkboxStyles } from "./checkbox.stylex.js";
|
|
2
1
|
import { Checkbox } from "@base-ui/react";
|
|
3
2
|
import { ComponentProps, JSX } from "react";
|
|
4
3
|
//#region src/components/checkbox/checkbox.d.ts
|
|
5
4
|
interface CheckboxProps extends ComponentProps<typeof Checkbox.Root> {}
|
|
6
5
|
declare function Checkbox$1(props: CheckboxProps): JSX.Element;
|
|
7
6
|
//#endregion
|
|
8
|
-
export { Checkbox$1 as Checkbox, CheckboxProps
|
|
7
|
+
export { Checkbox$1 as Checkbox, CheckboxProps };
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { cn
|
|
1
|
+
import { cn } from "../cn.js";
|
|
2
2
|
import { checkboxStyles } from "./checkbox.stylex.js";
|
|
3
3
|
import { CheckboxIcon } from "./checkbox-icon.js";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import { Checkbox } from "@base-ui/react";
|
|
6
6
|
//#region src/components/checkbox/checkbox.tsx
|
|
7
7
|
function Checkbox$1(props) {
|
|
8
|
-
const { children = void 0, className
|
|
8
|
+
const { children = void 0, className = "", ...rest } = props;
|
|
9
|
+
const combinedClassName = cn(checkboxStyles.base, className);
|
|
9
10
|
return /* @__PURE__ */ jsx(Checkbox.Root, {
|
|
10
|
-
className:
|
|
11
|
-
"data-
|
|
11
|
+
className: combinedClassName,
|
|
12
|
+
"data-component": "checkbox",
|
|
12
13
|
...rest,
|
|
13
14
|
children: /* @__PURE__ */ jsx(Checkbox.Indicator, {
|
|
14
|
-
className:
|
|
15
|
-
children: children ?? /* @__PURE__ */ jsx(CheckboxIcon, { className:
|
|
15
|
+
className: cn(checkboxStyles.indicator),
|
|
16
|
+
children: children ?? /* @__PURE__ */ jsx(CheckboxIcon, { className: cn(checkboxStyles.icon) })
|
|
16
17
|
})
|
|
17
18
|
});
|
|
18
19
|
}
|
|
19
20
|
//#endregion
|
|
20
|
-
export { Checkbox$1 as Checkbox
|
|
21
|
+
export { Checkbox$1 as Checkbox };
|
package/dist/components/cn.js
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import * as stylex from "@stylexjs/stylex";
|
|
2
2
|
//#region src/components/cn.ts
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Compile StyleX styles and join class names, dropping empty values.
|
|
5
5
|
*
|
|
6
6
|
* `cn` is short for class names.
|
|
7
7
|
*
|
|
8
|
-
* @param {unknown[]} values -
|
|
8
|
+
* @param {unknown[]} values - StyleX styles, class strings, and optional empty values to ignore.
|
|
9
9
|
* @returns {string} A single space-separated class string.
|
|
10
10
|
*/
|
|
11
11
|
function cn(...values) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
const stylexStyles = [];
|
|
13
|
+
const classNames = [];
|
|
14
|
+
for (const value of values) if (typeof value === "string") {
|
|
15
|
+
if (value !== "") classNames.push(value);
|
|
16
|
+
} else if (typeof value !== "function") stylexStyles.push(value);
|
|
17
|
+
return [stylexStyles.length === 0 ? "" : stylex.props(...stylexStyles).className ?? "", ...classNames].filter((value) => value !== "").join(" ");
|
|
16
18
|
}
|
|
17
19
|
//#endregion
|
|
18
|
-
export { cn
|
|
20
|
+
export { cn };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { columnStyles } from "./column.stylex.js";
|
|
2
1
|
import { CSSProperties, ComponentProps, ElementType, JSX } from "react";
|
|
3
2
|
//#region src/components/column/column.d.ts
|
|
4
3
|
type ColumnProps<ComponentType extends ElementType = "div"> = ColumnInternalProps & ComponentProps<ComponentType>;
|
|
@@ -13,4 +12,4 @@ interface ColumnInternalProps {
|
|
|
13
12
|
}
|
|
14
13
|
declare function Column(props: ColumnProps): JSX.Element;
|
|
15
14
|
//#endregion
|
|
16
|
-
export { Column, ColumnProps
|
|
15
|
+
export { Column, ColumnProps };
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { cn } from "../cn.js";
|
|
2
2
|
import { columnStyles } from "./column.stylex.js";
|
|
3
|
-
import * as stylex from "@stylexjs/stylex";
|
|
4
3
|
import { createElement } from "react";
|
|
5
4
|
//#region src/components/column/column.tsx
|
|
6
5
|
function Column(props) {
|
|
7
6
|
const { alignItems = void 0, as = "div", className = "", flexWrap = void 0, gap = void 0, gapX = void 0, gapY = void 0, justifyContent = void 0, style: customStyle, ...rest } = props;
|
|
8
|
-
const
|
|
7
|
+
const combinedClassName = cn(columnStyles.base, className);
|
|
9
8
|
const combinedStyle = {
|
|
10
9
|
...customStyle,
|
|
11
10
|
...gap === void 0 ? {} : { gap },
|
|
@@ -16,11 +15,11 @@ function Column(props) {
|
|
|
16
15
|
...justifyContent === void 0 ? {} : { justifyContent }
|
|
17
16
|
};
|
|
18
17
|
return createElement(as, {
|
|
19
|
-
className:
|
|
20
|
-
"data-
|
|
18
|
+
className: combinedClassName,
|
|
19
|
+
"data-component": "column",
|
|
21
20
|
style: combinedStyle,
|
|
22
21
|
...rest
|
|
23
22
|
});
|
|
24
23
|
}
|
|
25
24
|
//#endregion
|
|
26
|
-
export { Column
|
|
25
|
+
export { Column };
|
|
@@ -1,31 +1,32 @@
|
|
|
1
|
-
import { cn
|
|
1
|
+
import { cn } from "../cn.js";
|
|
2
2
|
import { pickerPopupStyles } from "../picker/picker-popup.stylex.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { Combobox } from "@base-ui/react";
|
|
5
5
|
//#region src/components/combobox/combobox-content.tsx
|
|
6
6
|
function ComboboxContent(props) {
|
|
7
|
-
const { align = "start", alignOffset = void 0, anchor = void 0, arrowPadding = void 0, children, className
|
|
7
|
+
const { align = "start", alignOffset = void 0, anchor = void 0, arrowPadding = void 0, children, className = "", collisionAvoidance = void 0, collisionBoundary = void 0, collisionPadding = void 0, container = void 0, disableAnchorTracking = void 0, positionMethod = void 0, side = "bottom", sideOffset = 6, sticky = void 0, ...rest } = props;
|
|
8
|
+
const combinedClassName = cn(pickerPopupStyles.base, className);
|
|
8
9
|
return /* @__PURE__ */ jsx(Combobox.Portal, {
|
|
9
10
|
container,
|
|
10
|
-
"data-
|
|
11
|
+
"data-component": "combobox-portal",
|
|
11
12
|
children: /* @__PURE__ */ jsx(Combobox.Positioner, {
|
|
12
13
|
align,
|
|
13
14
|
alignOffset,
|
|
14
15
|
anchor,
|
|
15
16
|
arrowPadding,
|
|
16
|
-
className:
|
|
17
|
+
className: cn(pickerPopupStyles.positioner),
|
|
17
18
|
collisionAvoidance,
|
|
18
19
|
collisionBoundary,
|
|
19
20
|
collisionPadding,
|
|
20
|
-
"data-
|
|
21
|
+
"data-component": "combobox-positioner",
|
|
21
22
|
disableAnchorTracking,
|
|
22
23
|
positionMethod,
|
|
23
24
|
side,
|
|
24
25
|
sideOffset,
|
|
25
26
|
sticky,
|
|
26
27
|
children: /* @__PURE__ */ jsx(Combobox.Popup, {
|
|
27
|
-
className:
|
|
28
|
-
"data-
|
|
28
|
+
className: combinedClassName,
|
|
29
|
+
"data-component": "combobox-content",
|
|
29
30
|
...rest,
|
|
30
31
|
children
|
|
31
32
|
})
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { comboboxEmptyStyles } from "./combobox-empty.stylex.js";
|
|
2
1
|
import { Combobox } from "@base-ui/react";
|
|
3
2
|
import { JSX } from "react";
|
|
4
3
|
//#region src/components/combobox/combobox-empty.d.ts
|
|
@@ -7,4 +6,4 @@ interface ComboboxEmptyProps extends Omit<Combobox.Empty.Props, "className"> {
|
|
|
7
6
|
}
|
|
8
7
|
declare function ComboboxEmpty(props: ComboboxEmptyProps): JSX.Element;
|
|
9
8
|
//#endregion
|
|
10
|
-
export { ComboboxEmpty, ComboboxEmptyProps
|
|
9
|
+
export { ComboboxEmpty, ComboboxEmptyProps };
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { cn
|
|
1
|
+
import { cn } from "../cn.js";
|
|
2
2
|
import { comboboxEmptyStyles } from "./combobox-empty.stylex.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { Combobox } from "@base-ui/react";
|
|
5
5
|
//#region src/components/combobox/combobox-empty.tsx
|
|
6
6
|
function ComboboxEmpty(props) {
|
|
7
|
-
const { className
|
|
7
|
+
const { className = "", ...rest } = props;
|
|
8
|
+
const combinedClassName = cn(comboboxEmptyStyles.base, className);
|
|
8
9
|
return /* @__PURE__ */ jsx(Combobox.Empty, {
|
|
9
|
-
className:
|
|
10
|
-
"data-
|
|
10
|
+
className: combinedClassName,
|
|
11
|
+
"data-component": "combobox-empty",
|
|
11
12
|
...rest
|
|
12
13
|
});
|
|
13
14
|
}
|
|
14
15
|
//#endregion
|
|
15
|
-
export { ComboboxEmpty
|
|
16
|
+
export { ComboboxEmpty };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { cn
|
|
1
|
+
import { cn } from "../cn.js";
|
|
2
2
|
import { pickerGroupStyles } from "../picker/picker-group.stylex.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { Combobox } from "@base-ui/react";
|
|
5
5
|
//#region src/components/combobox/combobox-group-label.tsx
|
|
6
6
|
function ComboboxGroupLabel(props) {
|
|
7
|
-
const { className
|
|
7
|
+
const { className = "", ...rest } = props;
|
|
8
|
+
const combinedClassName = cn(pickerGroupStyles.label, className);
|
|
8
9
|
return /* @__PURE__ */ jsx(Combobox.GroupLabel, {
|
|
9
|
-
className:
|
|
10
|
-
"data-
|
|
10
|
+
className: combinedClassName,
|
|
11
|
+
"data-component": "combobox-group-label",
|
|
11
12
|
...rest
|
|
12
13
|
});
|
|
13
14
|
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { cn
|
|
1
|
+
import { cn } from "../cn.js";
|
|
2
2
|
import { pickerGroupStyles } from "../picker/picker-group.stylex.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { Combobox } from "@base-ui/react";
|
|
5
5
|
//#region src/components/combobox/combobox-group.tsx
|
|
6
6
|
function ComboboxGroup(props) {
|
|
7
|
-
const { className
|
|
7
|
+
const { className = "", ...rest } = props;
|
|
8
|
+
const combinedClassName = cn(pickerGroupStyles.base, className);
|
|
8
9
|
return /* @__PURE__ */ jsx(Combobox.Group, {
|
|
9
|
-
className:
|
|
10
|
-
"data-
|
|
10
|
+
className: combinedClassName,
|
|
11
|
+
"data-component": "combobox-group",
|
|
11
12
|
...rest
|
|
12
13
|
});
|
|
13
14
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { comboboxInputStyles } from "./combobox-input.stylex.js";
|
|
2
1
|
import { Combobox } from "@base-ui/react";
|
|
3
2
|
import { JSX } from "react";
|
|
4
3
|
//#region src/components/combobox/combobox-input.d.ts
|
|
@@ -10,4 +9,4 @@ interface ComboboxInputProps extends Omit<Combobox.Input.Props, "className" | "s
|
|
|
10
9
|
type ComboboxInputSize = 32 | 36 | 40 | 44 | 48;
|
|
11
10
|
declare function ComboboxInput(props: ComboboxInputProps): JSX.Element;
|
|
12
11
|
//#endregion
|
|
13
|
-
export { ComboboxInput, ComboboxInputProps, ComboboxInputSize
|
|
12
|
+
export { ComboboxInput, ComboboxInputProps, ComboboxInputSize };
|