@nattstack/ui 0.0.107 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/baseline/index.css +5 -1
- package/dist/components/button/button-spinner.js +18 -3
- package/dist/components/button/button-spinner.stylex.js +96 -0
- package/dist/components/button/button.d.ts +20 -17
- package/dist/components/button/button.js +28 -38
- package/dist/components/button/button.stylex.d.ts +121 -0
- package/dist/components/button/button.stylex.js +158 -0
- package/dist/components/button-link/button-link.d.ts +5 -6
- package/dist/components/button-link/button-link.js +5 -5
- package/dist/components/checkbox/checkbox-icon.js +4 -3
- package/dist/components/checkbox/checkbox.d.ts +2 -2
- package/dist/components/checkbox/checkbox.js +6 -8
- package/dist/components/checkbox/checkbox.stylex.d.ts +40 -0
- package/dist/components/checkbox/checkbox.stylex.js +43 -0
- package/dist/components/cn.d.ts +6 -0
- package/dist/components/cn.js +18 -0
- package/dist/components/column/column.d.ts +2 -2
- package/dist/components/column/column.js +8 -9
- package/dist/components/column/column.stylex.d.ts +10 -0
- package/dist/components/column/column.stylex.js +8 -0
- package/dist/components/combobox/combobox-content.d.ts +1 -2
- package/dist/components/combobox/combobox-content.js +5 -7
- package/dist/components/combobox/combobox-empty.d.ts +2 -2
- package/dist/components/combobox/combobox-empty.js +4 -6
- package/dist/components/combobox/combobox-empty.stylex.d.ts +13 -0
- package/dist/components/combobox/combobox-empty.stylex.js +11 -0
- package/dist/components/combobox/combobox-group-label.d.ts +1 -2
- package/dist/components/combobox/combobox-group-label.js +4 -6
- package/dist/components/combobox/combobox-group.d.ts +1 -2
- package/dist/components/combobox/combobox-group.js +4 -6
- package/dist/components/combobox/combobox-input.d.ts +6 -10
- package/dist/components/combobox/combobox-input.js +10 -25
- package/dist/components/combobox/combobox-input.stylex.d.ts +93 -0
- package/dist/components/combobox/combobox-input.stylex.js +100 -0
- package/dist/components/combobox/combobox-item.d.ts +2 -4
- package/dist/components/combobox/combobox-item.js +7 -10
- package/dist/components/combobox/combobox-list.d.ts +1 -2
- package/dist/components/combobox/combobox-list.js +4 -6
- package/dist/components/combobox/combobox-search.d.ts +3 -4
- package/dist/components/combobox/combobox-search.js +7 -10
- package/dist/components/combobox/combobox-search.stylex.d.ts +45 -0
- package/dist/components/combobox/combobox-search.stylex.js +45 -0
- package/dist/components/combobox/combobox-separator.d.ts +1 -2
- package/dist/components/combobox/combobox-separator.js +4 -6
- package/dist/components/combobox/combobox-trigger.d.ts +4 -8
- package/dist/components/combobox/combobox-trigger.js +6 -21
- package/dist/components/combobox/combobox-value.d.ts +2 -2
- package/dist/components/combobox/combobox-value.js +4 -6
- package/dist/components/combobox/combobox-value.stylex.d.ts +14 -0
- package/dist/components/combobox/combobox-value.stylex.js +12 -0
- package/dist/components/dialog-responsive/dialog-responsive-backdrop.js +4 -6
- package/dist/components/dialog-responsive/dialog-responsive-backdrop.stylex.js +14 -0
- package/dist/components/dialog-responsive/dialog-responsive-bar.js +4 -6
- package/dist/components/dialog-responsive/dialog-responsive-bar.stylex.js +13 -0
- package/dist/components/dialog-responsive/dialog-responsive-popup.d.ts +2 -2
- package/dist/components/dialog-responsive/dialog-responsive-popup.js +4 -6
- package/dist/components/dialog-responsive/dialog-responsive-popup.stylex.d.ts +32 -0
- package/dist/components/dialog-responsive/dialog-responsive-popup.stylex.js +30 -0
- package/dist/components/dialog-responsive/dialog-responsive-portal.js +4 -6
- package/dist/components/dialog-responsive/dialog-responsive-portal.stylex.js +9 -0
- package/dist/components/dialog-responsive/dialog-responsive-viewport.js +4 -6
- package/dist/components/dialog-responsive/dialog-responsive-viewport.stylex.js +13 -0
- package/dist/components/dialog-responsive/dialog-responsive.d.ts +1 -4
- package/dist/components/dialog-responsive/dialog-responsive.js +1 -4
- package/dist/components/icon-button/icon-button.d.ts +3 -5
- package/dist/components/icon-button/icon-button.js +17 -22
- package/dist/components/icon-button/icon-button.stylex.d.ts +21 -0
- package/dist/components/icon-button/icon-button.stylex.js +25 -0
- package/dist/components/index.d.ts +90 -53
- package/dist/components/index.js +91 -53
- package/dist/components/input/input.d.ts +8 -16
- package/dist/components/input/input.js +9 -37
- package/dist/components/input/input.stylex.d.ts +66 -0
- package/dist/components/input/input.stylex.js +71 -0
- package/dist/components/label/label.d.ts +2 -2
- package/dist/components/label/label.js +7 -7
- package/dist/components/label/label.stylex.d.ts +12 -0
- package/dist/components/label/label.stylex.js +10 -0
- package/dist/components/menu/menu-checkbox-item.d.ts +2 -6
- package/dist/components/menu/menu-checkbox-item.js +7 -12
- package/dist/components/menu/menu-content.d.ts +2 -2
- package/dist/components/menu/menu-content.js +8 -10
- package/dist/components/menu/menu-content.stylex.d.ts +11 -0
- package/dist/components/menu/menu-content.stylex.js +9 -0
- package/dist/components/menu/menu-group-label.d.ts +1 -2
- package/dist/components/menu/menu-group-label.js +4 -6
- package/dist/components/menu/menu-group.d.ts +1 -2
- package/dist/components/menu/menu-group.js +4 -6
- package/dist/components/menu/menu-item.d.ts +3 -4
- package/dist/components/menu/menu-item.js +6 -9
- package/dist/components/menu/menu-item.stylex.d.ts +11 -0
- package/dist/components/menu/menu-item.stylex.js +9 -0
- package/dist/components/menu/menu-link-item.d.ts +1 -2
- package/dist/components/menu/menu-link-item.js +5 -7
- package/dist/components/menu/menu-radio-group.d.ts +2 -4
- package/dist/components/menu/menu-radio-group.js +5 -8
- package/dist/components/menu/menu-radio-item.d.ts +2 -4
- package/dist/components/menu/menu-radio-item.js +7 -10
- package/dist/components/menu/menu-separator.d.ts +1 -2
- package/dist/components/menu/menu-separator.js +4 -6
- package/dist/components/menu/menu-submenu-trigger.d.ts +3 -4
- package/dist/components/menu/menu-submenu-trigger.js +8 -15
- package/dist/components/menu/menu-submenu-trigger.stylex.d.ts +19 -0
- package/dist/components/menu/menu-submenu-trigger.stylex.js +20 -0
- package/dist/components/otp-field/otp-field-input.d.ts +2 -2
- package/dist/components/otp-field/otp-field-input.js +5 -6
- package/dist/components/otp-field/otp-field-input.stylex.d.ts +25 -0
- package/dist/components/otp-field/otp-field-input.stylex.js +23 -0
- package/dist/components/otp-field/otp-field.d.ts +4 -7
- package/dist/components/otp-field/otp-field.js +7 -18
- package/dist/components/otp-field/otp-field.stylex.d.ts +16 -0
- package/dist/components/otp-field/otp-field.stylex.js +17 -0
- package/dist/components/picker/picker-group.stylex.d.ts +18 -0
- package/dist/components/picker/picker-group.stylex.js +19 -0
- package/dist/components/picker/picker-item.stylex.d.ts +39 -0
- package/dist/components/picker/picker-item.stylex.js +41 -0
- package/dist/components/picker/picker-list.stylex.js +13 -0
- package/dist/components/picker/picker-popup.stylex.d.ts +36 -0
- package/dist/components/picker/picker-popup.stylex.js +37 -0
- package/dist/components/picker/picker-separator.stylex.d.ts +13 -0
- package/dist/components/picker/picker-separator.stylex.js +11 -0
- package/dist/components/picker/picker-trigger.stylex.d.ts +60 -0
- package/dist/components/picker/picker-trigger.stylex.js +67 -0
- package/dist/components/row/row.d.ts +2 -2
- package/dist/components/row/row.js +8 -9
- package/dist/components/row/row.stylex.d.ts +10 -0
- package/dist/components/row/row.stylex.js +8 -0
- package/dist/components/select/select-content.d.ts +2 -2
- package/dist/components/select/select-content.js +7 -9
- package/dist/components/select/select-group-label.d.ts +1 -2
- package/dist/components/select/select-group-label.js +4 -6
- package/dist/components/select/select-group.d.ts +2 -2
- package/dist/components/select/select-group.js +4 -6
- package/dist/components/select/select-item.d.ts +3 -4
- package/dist/components/select/select-item.js +7 -10
- package/dist/components/select/select-separator.d.ts +2 -2
- package/dist/components/select/select-separator.js +4 -6
- package/dist/components/select/select-trigger.d.ts +5 -8
- package/dist/components/select/select-trigger.js +6 -21
- package/dist/components/select/select-value.d.ts +2 -2
- package/dist/components/select/select-value.js +4 -6
- package/dist/components/select/select-value.stylex.d.ts +14 -0
- package/dist/components/select/select-value.stylex.js +12 -0
- package/dist/components/spacer/spacer.d.ts +2 -2
- package/dist/components/spacer/spacer.js +7 -7
- package/dist/components/spacer/spacer.stylex.d.ts +9 -0
- package/dist/components/spacer/spacer.stylex.js +7 -0
- package/dist/components/stylex.css +1420 -0
- package/dist/components/switch/switch.d.ts +4 -12
- package/dist/components/switch/switch.js +6 -22
- package/dist/components/switch/switch.stylex.d.ts +41 -0
- package/dist/components/switch/switch.stylex.js +44 -0
- package/dist/components/tabs/tabs-panel.d.ts +2 -2
- package/dist/components/tabs/tabs-panel.js +7 -7
- package/dist/components/tabs/tabs-panel.stylex.d.ts +14 -0
- package/dist/components/tabs/tabs-panel.stylex.js +12 -0
- package/dist/components/tabs/tabs.d.ts +2 -2
- package/dist/components/tabs/tabs.js +7 -7
- package/dist/components/tabs/tabs.stylex.d.ts +10 -0
- package/dist/components/tabs/tabs.stylex.js +8 -0
- package/dist/components/tabs-pill/tabs-pill-indicator.js +4 -6
- package/dist/components/tabs-pill/tabs-pill-indicator.stylex.js +16 -0
- package/dist/components/tabs-pill/tabs-pill-list.d.ts +2 -2
- package/dist/components/tabs-pill/tabs-pill-list.js +4 -6
- package/dist/components/tabs-pill/tabs-pill-list.stylex.d.ts +13 -0
- package/dist/components/tabs-pill/tabs-pill-list.stylex.js +11 -0
- package/dist/components/tabs-pill/tabs-pill-tab.d.ts +3 -5
- package/dist/components/tabs-pill/tabs-pill-tab.js +8 -10
- package/dist/components/tabs-pill/tabs-pill-tab.stylex.d.ts +44 -0
- package/dist/components/tabs-pill/tabs-pill-tab.stylex.js +46 -0
- package/dist/components/tabs-segmented/tabs-segmented-indicator.js +4 -6
- package/dist/components/tabs-segmented/tabs-segmented-indicator.stylex.js +16 -0
- package/dist/components/tabs-segmented/tabs-segmented-list.d.ts +2 -2
- package/dist/components/tabs-segmented/tabs-segmented-list.js +4 -6
- package/dist/components/tabs-segmented/tabs-segmented-list.stylex.d.ts +17 -0
- package/dist/components/tabs-segmented/tabs-segmented-list.stylex.js +15 -0
- package/dist/components/tabs-segmented/tabs-segmented-tab.d.ts +3 -5
- package/dist/components/tabs-segmented/tabs-segmented-tab.js +6 -8
- package/dist/components/tabs-segmented/tabs-segmented-tab.stylex.d.ts +28 -0
- package/dist/components/tabs-segmented/tabs-segmented-tab.stylex.js +26 -0
- package/dist/components/tabs-underline/tabs-underline-indicator.js +4 -6
- package/dist/components/tabs-underline/tabs-underline-indicator.stylex.js +14 -0
- package/dist/components/tabs-underline/tabs-underline-list.d.ts +2 -2
- package/dist/components/tabs-underline/tabs-underline-list.js +4 -6
- package/dist/components/tabs-underline/tabs-underline-list.stylex.d.ts +14 -0
- package/dist/components/tabs-underline/tabs-underline-list.stylex.js +12 -0
- package/dist/components/tabs-underline/tabs-underline-tab.d.ts +3 -5
- package/dist/components/tabs-underline/tabs-underline-tab.js +6 -8
- package/dist/components/tabs-underline/tabs-underline-tab.stylex.d.ts +27 -0
- package/dist/components/tabs-underline/tabs-underline-tab.stylex.js +25 -0
- package/dist/components/textarea/textarea.d.ts +7 -12
- package/dist/components/textarea/textarea.js +10 -24
- package/dist/components/textarea/textarea.stylex.d.ts +13 -0
- package/dist/components/textarea/textarea.stylex.js +11 -0
- package/dist/components/toggle-group/toggle-group-item.d.ts +3 -6
- package/dist/components/toggle-group/toggle-group-item.js +6 -9
- package/dist/components/toggle-group/toggle-group-item.stylex.d.ts +33 -0
- package/dist/components/toggle-group/toggle-group-item.stylex.js +34 -0
- package/dist/components/toggle-group/toggle-group.d.ts +3 -7
- package/dist/components/toggle-group/toggle-group.js +6 -10
- package/dist/components/toggle-group/toggle-group.stylex.d.ts +11 -0
- package/dist/components/toggle-group/toggle-group.stylex.js +9 -0
- package/dist/components/tooltip/tooltip-popup.d.ts +2 -2
- package/dist/components/tooltip/tooltip-popup.js +6 -7
- package/dist/components/tooltip/tooltip-popup.stylex.d.ts +30 -0
- package/dist/components/tooltip/tooltip-popup.stylex.js +32 -0
- package/dist/components/tooltip/tooltip.d.ts +1 -4
- package/dist/components/tooltip/tooltip.js +2 -4
- package/dist/tailwind-colors/root.css +10 -0
- package/package.json +4 -3
- package/dist/components/button/button-spinner.css +0 -97
- package/dist/components/button/button-spinner.module.js +0 -8
- package/dist/components/button/button.css +0 -157
- package/dist/components/button/button.module.js +0 -21
- package/dist/components/checkbox/checkbox.css +0 -55
- package/dist/components/checkbox/checkbox.module.js +0 -9
- package/dist/components/column/column.css +0 -6
- package/dist/components/column/column.module.js +0 -5
- package/dist/components/combobox/combobox-empty.css +0 -9
- package/dist/components/combobox/combobox-empty.module.js +0 -5
- package/dist/components/combobox/combobox-input.css +0 -121
- package/dist/components/combobox/combobox-input.module.js +0 -16
- package/dist/components/combobox/combobox-search.css +0 -44
- package/dist/components/combobox/combobox-search.module.js +0 -9
- package/dist/components/combobox/combobox-value.css +0 -14
- package/dist/components/combobox/combobox-value.module.js +0 -5
- package/dist/components/dialog-responsive/dialog-responsive-backdrop.css +0 -28
- package/dist/components/dialog-responsive/dialog-responsive-backdrop.module.js +0 -5
- package/dist/components/dialog-responsive/dialog-responsive-bar.css +0 -16
- package/dist/components/dialog-responsive/dialog-responsive-bar.module.js +0 -5
- package/dist/components/dialog-responsive/dialog-responsive-popup.css +0 -56
- package/dist/components/dialog-responsive/dialog-responsive-popup.module.js +0 -5
- package/dist/components/dialog-responsive/dialog-responsive-portal.css +0 -7
- package/dist/components/dialog-responsive/dialog-responsive-portal.module.js +0 -5
- package/dist/components/dialog-responsive/dialog-responsive-viewport.css +0 -18
- package/dist/components/dialog-responsive/dialog-responsive-viewport.module.js +0 -5
- package/dist/components/icon-button/icon-button.css +0 -21
- package/dist/components/icon-button/icon-button.module.js +0 -11
- package/dist/components/input/input.css +0 -83
- package/dist/components/input/input.module.js +0 -14
- package/dist/components/label/label.css +0 -8
- package/dist/components/label/label.module.js +0 -5
- package/dist/components/menu/menu-content.css +0 -7
- package/dist/components/menu/menu-content.module.js +0 -5
- package/dist/components/menu/menu-item.css +0 -7
- package/dist/components/menu/menu-item.module.js +0 -5
- package/dist/components/menu/menu-submenu-trigger.css +0 -16
- package/dist/components/menu/menu-submenu-trigger.module.js +0 -8
- package/dist/components/otp-field/otp-field-input.css +0 -32
- package/dist/components/otp-field/otp-field-input.module.js +0 -5
- package/dist/components/otp-field/otp-field.css +0 -13
- package/dist/components/otp-field/otp-field.module.js +0 -8
- package/dist/components/picker/picker-group.css +0 -14
- package/dist/components/picker/picker-group.module.js +0 -8
- package/dist/components/picker/picker-item.css +0 -43
- package/dist/components/picker/picker-item.module.js +0 -9
- package/dist/components/picker/picker-list.css +0 -15
- package/dist/components/picker/picker-list.module.js +0 -5
- package/dist/components/picker/picker-popup.css +0 -56
- package/dist/components/picker/picker-popup.module.js +0 -8
- package/dist/components/picker/picker-separator.css +0 -8
- package/dist/components/picker/picker-separator.module.js +0 -5
- package/dist/components/picker/picker-trigger.css +0 -85
- package/dist/components/picker/picker-trigger.module.js +0 -14
- package/dist/components/row/row.css +0 -6
- package/dist/components/row/row.module.js +0 -5
- package/dist/components/select/select-value.css +0 -14
- package/dist/components/select/select-value.module.js +0 -5
- package/dist/components/spacer/spacer.css +0 -5
- package/dist/components/spacer/spacer.module.js +0 -5
- package/dist/components/switch/switch.css +0 -55
- package/dist/components/switch/switch.module.js +0 -10
- package/dist/components/tabs/tabs-panel.css +0 -14
- package/dist/components/tabs/tabs-panel.module.js +0 -5
- package/dist/components/tabs/tabs.css +0 -6
- package/dist/components/tabs/tabs.module.js +0 -5
- package/dist/components/tabs-pill/tabs-pill-indicator.css +0 -14
- package/dist/components/tabs-pill/tabs-pill-indicator.module.js +0 -5
- package/dist/components/tabs-pill/tabs-pill-list.css +0 -9
- package/dist/components/tabs-pill/tabs-pill-list.module.js +0 -5
- package/dist/components/tabs-pill/tabs-pill-tab.css +0 -66
- package/dist/components/tabs-pill/tabs-pill-tab.module.js +0 -9
- package/dist/components/tabs-segmented/tabs-segmented-indicator.css +0 -14
- package/dist/components/tabs-segmented/tabs-segmented-indicator.module.js +0 -5
- package/dist/components/tabs-segmented/tabs-segmented-list.css +0 -13
- package/dist/components/tabs-segmented/tabs-segmented-list.module.js +0 -5
- package/dist/components/tabs-segmented/tabs-segmented-tab.css +0 -37
- package/dist/components/tabs-segmented/tabs-segmented-tab.module.js +0 -5
- package/dist/components/tabs-underline/tabs-underline-indicator.css +0 -12
- package/dist/components/tabs-underline/tabs-underline-indicator.module.js +0 -5
- package/dist/components/tabs-underline/tabs-underline-list.css +0 -10
- package/dist/components/tabs-underline/tabs-underline-list.module.js +0 -5
- package/dist/components/tabs-underline/tabs-underline-tab.css +0 -36
- package/dist/components/tabs-underline/tabs-underline-tab.module.js +0 -5
- package/dist/components/textarea/textarea.css +0 -9
- package/dist/components/textarea/textarea.module.js +0 -5
- package/dist/components/toggle-group/toggle-group-item.css +0 -47
- package/dist/components/toggle-group/toggle-group-item.module.js +0 -5
- package/dist/components/toggle-group/toggle-group.css +0 -7
- package/dist/components/toggle-group/toggle-group.module.js +0 -5
- package/dist/components/tooltip/tooltip-popup.css +0 -32
- package/dist/components/tooltip/tooltip-popup.module.js +0 -8
package/README.md
CHANGED
package/dist/baseline/index.css
CHANGED
|
@@ -29,13 +29,17 @@
|
|
|
29
29
|
html {
|
|
30
30
|
-moz-text-size-adjust: none;
|
|
31
31
|
-webkit-text-size-adjust: none;
|
|
32
|
-
color-scheme: light
|
|
32
|
+
color-scheme: light;
|
|
33
33
|
scrollbar-color: var(--color-gray-6) transparent;
|
|
34
34
|
scrollbar-width: thin;
|
|
35
35
|
text-size-adjust: none;
|
|
36
36
|
touch-action: manipulation;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
html.dark {
|
|
40
|
+
color-scheme: dark;
|
|
41
|
+
}
|
|
42
|
+
|
|
39
43
|
/*
|
|
40
44
|
Base typography and theme tokens
|
|
41
45
|
- Improve font rendering
|
|
@@ -1,13 +1,28 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { sx } from "../cn.js";
|
|
2
|
+
import { buttonSpinnerStyles } from "./button-spinner.stylex.js";
|
|
2
3
|
import { jsx } from "react/jsx-runtime";
|
|
3
4
|
//#region src/components/button/button-spinner.tsx
|
|
4
5
|
const SIZE = 18;
|
|
6
|
+
const BAR_STYLES = [
|
|
7
|
+
buttonSpinnerStyles[1],
|
|
8
|
+
buttonSpinnerStyles[2],
|
|
9
|
+
buttonSpinnerStyles[3],
|
|
10
|
+
buttonSpinnerStyles[4],
|
|
11
|
+
buttonSpinnerStyles[5],
|
|
12
|
+
buttonSpinnerStyles[6],
|
|
13
|
+
buttonSpinnerStyles[7],
|
|
14
|
+
buttonSpinnerStyles[8],
|
|
15
|
+
buttonSpinnerStyles[9],
|
|
16
|
+
buttonSpinnerStyles[10],
|
|
17
|
+
buttonSpinnerStyles[11],
|
|
18
|
+
buttonSpinnerStyles[12]
|
|
19
|
+
];
|
|
5
20
|
function ButtonSpinner() {
|
|
6
21
|
return /* @__PURE__ */ jsx("div", {
|
|
7
|
-
className:
|
|
22
|
+
className: sx(buttonSpinnerStyles.base),
|
|
8
23
|
"data-slot": "button-spinner",
|
|
9
24
|
style: { "--size": `${SIZE}px` },
|
|
10
|
-
children:
|
|
25
|
+
children: BAR_STYLES.map((barStyle, index) => /* @__PURE__ */ jsx("div", { className: sx(buttonSpinnerStyles.bar, barStyle) }, index))
|
|
11
26
|
});
|
|
12
27
|
}
|
|
13
28
|
//#endregion
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
//#region src/components/button/button-spinner.stylex.ts
|
|
2
|
+
const buttonSpinnerStyles = {
|
|
3
|
+
"1": {
|
|
4
|
+
kSiTet: "x1hc1fzr",
|
|
5
|
+
k4XH5M: "x1gcftaf",
|
|
6
|
+
$$css: true
|
|
7
|
+
},
|
|
8
|
+
"2": {
|
|
9
|
+
kSiTet: "x1skojfp",
|
|
10
|
+
k4XH5M: "xqd20pc",
|
|
11
|
+
$$css: true
|
|
12
|
+
},
|
|
13
|
+
"3": {
|
|
14
|
+
kSiTet: "xiiclqw",
|
|
15
|
+
k4XH5M: "xhmk0vv",
|
|
16
|
+
$$css: true
|
|
17
|
+
},
|
|
18
|
+
"4": {
|
|
19
|
+
kSiTet: "x11t8jnp",
|
|
20
|
+
k4XH5M: "xq77vm1",
|
|
21
|
+
$$css: true
|
|
22
|
+
},
|
|
23
|
+
"5": {
|
|
24
|
+
kSiTet: "x1ks1olk",
|
|
25
|
+
k4XH5M: "x1yqfaqn",
|
|
26
|
+
$$css: true
|
|
27
|
+
},
|
|
28
|
+
"6": {
|
|
29
|
+
kSiTet: "x8qkkdt",
|
|
30
|
+
k4XH5M: "x1rtxy7",
|
|
31
|
+
$$css: true
|
|
32
|
+
},
|
|
33
|
+
"7": {
|
|
34
|
+
kSiTet: "xwq05k6",
|
|
35
|
+
k4XH5M: "x1qul50q",
|
|
36
|
+
$$css: true
|
|
37
|
+
},
|
|
38
|
+
"8": {
|
|
39
|
+
kSiTet: "x1sfcrbg",
|
|
40
|
+
k4XH5M: "x5f4xin",
|
|
41
|
+
$$css: true
|
|
42
|
+
},
|
|
43
|
+
"9": {
|
|
44
|
+
kSiTet: "xti2d7y",
|
|
45
|
+
k4XH5M: "x13zb3im",
|
|
46
|
+
$$css: true
|
|
47
|
+
},
|
|
48
|
+
"10": {
|
|
49
|
+
kSiTet: "x1b0snh4",
|
|
50
|
+
k4XH5M: "x7lonkb",
|
|
51
|
+
$$css: true
|
|
52
|
+
},
|
|
53
|
+
"11": {
|
|
54
|
+
kSiTet: "xvpkmg4",
|
|
55
|
+
k4XH5M: "xyp7w1s",
|
|
56
|
+
$$css: true
|
|
57
|
+
},
|
|
58
|
+
"12": {
|
|
59
|
+
kSiTet: "x1xyvc85",
|
|
60
|
+
k4XH5M: "xggx6ht",
|
|
61
|
+
$$css: true
|
|
62
|
+
},
|
|
63
|
+
bar: {
|
|
64
|
+
ks3ayO: "x1hfhjwi",
|
|
65
|
+
kUfP38: "x1f3l70z",
|
|
66
|
+
k5JduY: "x1s928wv",
|
|
67
|
+
k4zj60: "x1wsn0xg",
|
|
68
|
+
kwXMNM: "x1j6awrg",
|
|
69
|
+
kLxBhq: "xnbfe2x",
|
|
70
|
+
kkgrvl: "xdnmdmm",
|
|
71
|
+
kZKoxP: "x13gmgbj",
|
|
72
|
+
kfzvcC: "x47corl",
|
|
73
|
+
kVAEAm: "x10l6tqk",
|
|
74
|
+
kCIrl2: "x3m8u43",
|
|
75
|
+
k87sOh: "xwa60dl",
|
|
76
|
+
k3nNDw: "x1kol6zn",
|
|
77
|
+
kIyJzY: "xx6bhzk",
|
|
78
|
+
k1ekBW: "xfagghw",
|
|
79
|
+
kIY38u: "x3sa99s",
|
|
80
|
+
kzqmXN: "xtnyu7h",
|
|
81
|
+
$$css: true
|
|
82
|
+
},
|
|
83
|
+
base: {
|
|
84
|
+
k44tkh: "x1q3qbx4",
|
|
85
|
+
ko0y90: "xa4qsjk",
|
|
86
|
+
kKVMdj: "x1m7ugx0",
|
|
87
|
+
kyAemX: "xbv57ra",
|
|
88
|
+
kZKoxP: "x188dgw3",
|
|
89
|
+
kVAEAm: "x10l6tqk",
|
|
90
|
+
km0Bbg: "xngwomw",
|
|
91
|
+
kzqmXN: "x1fjlwjz",
|
|
92
|
+
$$css: true
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
//#endregion
|
|
96
|
+
export { buttonSpinnerStyles };
|
|
@@ -1,25 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { sx } from "../cn.js";
|
|
2
|
+
import { buttonStyles } from "./button.stylex.js";
|
|
2
3
|
import { ComponentProps, JSX, ReactNode } from "react";
|
|
3
4
|
//#region src/components/button/button.d.ts
|
|
4
|
-
interface ButtonProps extends Omit<ComponentProps<"button">, "children"
|
|
5
|
+
interface ButtonProps extends Omit<ComponentProps<"button">, "children"> {
|
|
6
|
+
fullWidth?: boolean;
|
|
5
7
|
iconEnd?: ReactNode;
|
|
6
8
|
iconStart?: ReactNode;
|
|
7
|
-
isDisabled?: ComponentProps<"button">["disabled"];
|
|
8
|
-
isFullWidth?: VariantProps<typeof button>["isFullWidth"];
|
|
9
|
-
isLoading?: ComponentProps<"button">["disabled"];
|
|
10
|
-
isRounded?: VariantProps<typeof button>["isRounded"];
|
|
11
9
|
label?: number | number[] | string | string[];
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
rounded?: boolean;
|
|
12
|
+
size?: ButtonSize;
|
|
13
|
+
variant?: ButtonVariant;
|
|
14
14
|
}
|
|
15
|
+
type ButtonSize = 32 | 36 | 40 | 44 | 48;
|
|
16
|
+
type ButtonVariant = "ghost" | "primary" | "secondary";
|
|
15
17
|
declare function Button(props: ButtonProps): JSX.Element;
|
|
16
|
-
declare
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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;
|
|
24
27
|
//#endregion
|
|
25
|
-
export { Button, ButtonProps,
|
|
28
|
+
export { Button, ButtonProps, ButtonSize, ButtonVariant, buttonStyles, getButtonClassName };
|
|
@@ -1,55 +1,45 @@
|
|
|
1
|
+
import { cn, sx } from "../cn.js";
|
|
1
2
|
import { ButtonSpinner } from "./button-spinner.js";
|
|
2
|
-
import
|
|
3
|
-
import { cva } from "class-variance-authority";
|
|
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 = "",
|
|
7
|
+
const { className = "", disabled = false, iconStart = "", iconEnd = "", fullWidth = false, loading = false, rounded = false, label = "", variant = "primary", size = 40, ...rest } = props;
|
|
8
8
|
return /* @__PURE__ */ jsxs("button", {
|
|
9
|
-
className:
|
|
9
|
+
className: getButtonClassName({
|
|
10
10
|
className,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
disabled,
|
|
12
|
+
fullWidth,
|
|
13
|
+
loading,
|
|
14
|
+
rounded,
|
|
15
15
|
size,
|
|
16
16
|
variant
|
|
17
17
|
}),
|
|
18
18
|
"data-slot": "button",
|
|
19
|
-
disabled:
|
|
19
|
+
disabled: disabled || loading,
|
|
20
20
|
type: "button",
|
|
21
21
|
...rest,
|
|
22
22
|
children: [
|
|
23
|
-
|
|
24
|
-
iconStart,
|
|
25
|
-
label !== "" && /* @__PURE__ */ jsx("span", {
|
|
26
|
-
|
|
23
|
+
loading && /* @__PURE__ */ jsx(ButtonSpinner, {}),
|
|
24
|
+
hideWhenLoading(iconStart, loading),
|
|
25
|
+
label !== "" && /* @__PURE__ */ jsx("span", {
|
|
26
|
+
className: sx(loading && buttonStyles.loadingContent),
|
|
27
|
+
children: label
|
|
28
|
+
}),
|
|
29
|
+
hideWhenLoading(iconEnd, loading)
|
|
27
30
|
]
|
|
28
31
|
});
|
|
29
32
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
size: {
|
|
42
|
-
32: button_module_default.size_32,
|
|
43
|
-
36: button_module_default.size_36,
|
|
44
|
-
40: button_module_default.size_40,
|
|
45
|
-
44: button_module_default.size_44,
|
|
46
|
-
48: button_module_default.size_48
|
|
47
|
-
},
|
|
48
|
-
variant: {
|
|
49
|
-
ghost: button_module_default.variant_ghost,
|
|
50
|
-
primary: button_module_default.variant_primary,
|
|
51
|
-
secondary: button_module_default.variant_secondary
|
|
52
|
-
}
|
|
53
|
-
} });
|
|
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
|
+
}
|
|
54
44
|
//#endregion
|
|
55
|
-
export { Button,
|
|
45
|
+
export { Button, buttonStyles, getButtonClassName };
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import * as stylex from "@stylexjs/stylex";
|
|
2
|
+
//#region src/components/button/button.stylex.d.ts
|
|
3
|
+
declare const buttonStyles: Readonly<{
|
|
4
|
+
readonly 32: Readonly<{
|
|
5
|
+
readonly height: stylex.StyleXClassNameFor<"height", 32>;
|
|
6
|
+
}>;
|
|
7
|
+
readonly 36: Readonly<{
|
|
8
|
+
readonly height: stylex.StyleXClassNameFor<"height", 36>;
|
|
9
|
+
}>;
|
|
10
|
+
readonly 40: Readonly<{
|
|
11
|
+
readonly height: stylex.StyleXClassNameFor<"height", 40>;
|
|
12
|
+
}>;
|
|
13
|
+
readonly 44: Readonly<{
|
|
14
|
+
readonly height: stylex.StyleXClassNameFor<"height", 44>;
|
|
15
|
+
}>;
|
|
16
|
+
readonly 48: Readonly<{
|
|
17
|
+
readonly height: stylex.StyleXClassNameFor<"height", 48>;
|
|
18
|
+
}>;
|
|
19
|
+
readonly base: Readonly<{
|
|
20
|
+
readonly alignItems: stylex.StyleXClassNameFor<"alignItems", "center">;
|
|
21
|
+
readonly columnGap: stylex.StyleXClassNameFor<"columnGap", 8>;
|
|
22
|
+
readonly cursor: stylex.StyleXClassNameFor<"cursor", "pointer">;
|
|
23
|
+
readonly display: stylex.StyleXClassNameFor<"display", "inline-flex">;
|
|
24
|
+
readonly fontSize: stylex.StyleXClassNameFor<"fontSize", 14>;
|
|
25
|
+
readonly fontWeight: stylex.StyleXClassNameFor<"fontWeight", 450>;
|
|
26
|
+
readonly justifyContent: stylex.StyleXClassNameFor<"justifyContent", "center">;
|
|
27
|
+
readonly outlineColor: stylex.StyleXClassNameFor<"outlineColor", "var(--color-outline)" | "transparent">;
|
|
28
|
+
readonly outlineOffset: stylex.StyleXClassNameFor<"outlineOffset", 2>;
|
|
29
|
+
readonly outlineStyle: stylex.StyleXClassNameFor<"outlineStyle", "solid">;
|
|
30
|
+
readonly outlineWidth: stylex.StyleXClassNameFor<"outlineWidth", 2>;
|
|
31
|
+
readonly overflow: stylex.StyleXClassNameFor<"overflow", "hidden">;
|
|
32
|
+
readonly position: stylex.StyleXClassNameFor<"position", "relative">;
|
|
33
|
+
readonly transitionDuration: stylex.StyleXClassNameFor<"transitionDuration", "150ms">;
|
|
34
|
+
readonly transitionProperty: stylex.StyleXClassNameFor<"transitionProperty", "background-color, box-shadow, translate">;
|
|
35
|
+
readonly translate: stylex.StyleXClassNameFor<"translate", "0 1px" | "0 0">;
|
|
36
|
+
readonly userSelect: stylex.StyleXClassNameFor<"userSelect", "none">;
|
|
37
|
+
}>;
|
|
38
|
+
readonly disabled: Readonly<{
|
|
39
|
+
readonly cursor: stylex.StyleXClassNameFor<"cursor", "not-allowed">;
|
|
40
|
+
readonly opacity: stylex.StyleXClassNameFor<"opacity", 0.5>;
|
|
41
|
+
}>;
|
|
42
|
+
readonly ghost: Readonly<{
|
|
43
|
+
readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", "transparent" | "var(--color-gray-4)">;
|
|
44
|
+
readonly color: stylex.StyleXClassNameFor<"color", "var(--color-gray-12)">;
|
|
45
|
+
}>;
|
|
46
|
+
readonly loading: Readonly<{
|
|
47
|
+
readonly cursor: stylex.StyleXClassNameFor<"cursor", "not-allowed">;
|
|
48
|
+
readonly opacity: stylex.StyleXClassNameFor<"opacity", 0.5>;
|
|
49
|
+
}>;
|
|
50
|
+
readonly loadingContent: Readonly<{
|
|
51
|
+
readonly color: stylex.StyleXClassNameFor<"color", "transparent">;
|
|
52
|
+
readonly textShadow: stylex.StyleXClassNameFor<"textShadow", "none">;
|
|
53
|
+
}>;
|
|
54
|
+
readonly primary: Readonly<{
|
|
55
|
+
readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", "var(--color-gray-12)" | "color-mix(in oklab, var(--color-gray-12) 100%, var(--color-gray-1) 25%)">;
|
|
56
|
+
readonly color: stylex.StyleXClassNameFor<"color", "var(--color-gray-1)">;
|
|
57
|
+
}>;
|
|
58
|
+
readonly roundedBase32: Readonly<{
|
|
59
|
+
readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", 8>;
|
|
60
|
+
readonly paddingBlock: stylex.StyleXClassNameFor<"paddingBlock", 0>;
|
|
61
|
+
readonly paddingInline: stylex.StyleXClassNameFor<"paddingInline", 12>;
|
|
62
|
+
}>;
|
|
63
|
+
readonly roundedBase36: Readonly<{
|
|
64
|
+
readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", 9>;
|
|
65
|
+
readonly paddingBlock: stylex.StyleXClassNameFor<"paddingBlock", 0>;
|
|
66
|
+
readonly paddingInline: stylex.StyleXClassNameFor<"paddingInline", 14>;
|
|
67
|
+
}>;
|
|
68
|
+
readonly roundedBase40: Readonly<{
|
|
69
|
+
readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", 10>;
|
|
70
|
+
readonly paddingBlock: stylex.StyleXClassNameFor<"paddingBlock", 0>;
|
|
71
|
+
readonly paddingInline: stylex.StyleXClassNameFor<"paddingInline", 16>;
|
|
72
|
+
}>;
|
|
73
|
+
readonly roundedBase44: Readonly<{
|
|
74
|
+
readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", 11>;
|
|
75
|
+
readonly paddingBlock: stylex.StyleXClassNameFor<"paddingBlock", 0>;
|
|
76
|
+
readonly paddingInline: stylex.StyleXClassNameFor<"paddingInline", 18>;
|
|
77
|
+
}>;
|
|
78
|
+
readonly roundedBase48: Readonly<{
|
|
79
|
+
readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", 12>;
|
|
80
|
+
readonly paddingBlock: stylex.StyleXClassNameFor<"paddingBlock", 0>;
|
|
81
|
+
readonly paddingInline: stylex.StyleXClassNameFor<"paddingInline", 20>;
|
|
82
|
+
}>;
|
|
83
|
+
readonly roundedFull32: Readonly<{
|
|
84
|
+
readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", 16>;
|
|
85
|
+
readonly paddingBlock: stylex.StyleXClassNameFor<"paddingBlock", 0>;
|
|
86
|
+
readonly paddingInline: stylex.StyleXClassNameFor<"paddingInline", 12>;
|
|
87
|
+
}>;
|
|
88
|
+
readonly roundedFull36: Readonly<{
|
|
89
|
+
readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", 18>;
|
|
90
|
+
readonly paddingBlock: stylex.StyleXClassNameFor<"paddingBlock", 0>;
|
|
91
|
+
readonly paddingInline: stylex.StyleXClassNameFor<"paddingInline", 17>;
|
|
92
|
+
}>;
|
|
93
|
+
readonly roundedFull40: Readonly<{
|
|
94
|
+
readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", 20>;
|
|
95
|
+
readonly paddingBlock: stylex.StyleXClassNameFor<"paddingBlock", 0>;
|
|
96
|
+
readonly paddingInline: stylex.StyleXClassNameFor<"paddingInline", 20>;
|
|
97
|
+
}>;
|
|
98
|
+
readonly roundedFull44: Readonly<{
|
|
99
|
+
readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", 22>;
|
|
100
|
+
readonly paddingBlock: stylex.StyleXClassNameFor<"paddingBlock", 0>;
|
|
101
|
+
readonly paddingInline: stylex.StyleXClassNameFor<"paddingInline", 23>;
|
|
102
|
+
}>;
|
|
103
|
+
readonly roundedFull48: Readonly<{
|
|
104
|
+
readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", 24>;
|
|
105
|
+
readonly paddingBlock: stylex.StyleXClassNameFor<"paddingBlock", 0>;
|
|
106
|
+
readonly paddingInline: stylex.StyleXClassNameFor<"paddingInline", 28>;
|
|
107
|
+
}>;
|
|
108
|
+
readonly secondary: Readonly<{
|
|
109
|
+
readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", "var(--color-gray-4)" | "var(--color-bg-shell-inner)">;
|
|
110
|
+
readonly boxShadow: stylex.StyleXClassNameFor<"boxShadow", "none" | "inset 0 0 0 1px var(--color-border)">;
|
|
111
|
+
readonly color: stylex.StyleXClassNameFor<"color", "var(--color-gray-12)">;
|
|
112
|
+
}>;
|
|
113
|
+
readonly widthBase: Readonly<{
|
|
114
|
+
readonly width: stylex.StyleXClassNameFor<"width", "fit-content">;
|
|
115
|
+
}>;
|
|
116
|
+
readonly widthFull: Readonly<{
|
|
117
|
+
readonly width: stylex.StyleXClassNameFor<"width", "stretch">;
|
|
118
|
+
}>;
|
|
119
|
+
}>;
|
|
120
|
+
//#endregion
|
|
121
|
+
export { buttonStyles };
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
//#region src/components/button/button.stylex.ts
|
|
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
|
+
base: {
|
|
24
|
+
kGNEyG: "x6s0dn4",
|
|
25
|
+
k1C7PZ: "xfex06f",
|
|
26
|
+
kkrTdU: "x1ypdohk",
|
|
27
|
+
k1xSpc: "x3nfvp2",
|
|
28
|
+
kGuDYH: "xif65rj",
|
|
29
|
+
k63SB2: "x10p5zqr",
|
|
30
|
+
kjj79g: "xl56j7k",
|
|
31
|
+
kjBf7l: "xfcj4rt x1uczgqu",
|
|
32
|
+
kInvED: "x1hl8ikr",
|
|
33
|
+
k3XXqK: "xaatb59",
|
|
34
|
+
kMeerF: "x1de99jn",
|
|
35
|
+
kVQacm: "xb3r6kr",
|
|
36
|
+
kVAEAm: "x1n2onr6",
|
|
37
|
+
kIyJzY: "xx6bhzk",
|
|
38
|
+
k1ekBW: "x101bfz1",
|
|
39
|
+
kIY38u: "x1avgydi x1qeszuu",
|
|
40
|
+
kfSwDN: "x87ps6o",
|
|
41
|
+
$$css: true
|
|
42
|
+
},
|
|
43
|
+
disabled: {
|
|
44
|
+
kkrTdU: "x1h6gzvc",
|
|
45
|
+
kSiTet: "xbyyjgo",
|
|
46
|
+
$$css: true
|
|
47
|
+
},
|
|
48
|
+
ghost: {
|
|
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: {
|
|
69
|
+
kaIpWk: "xur7f20",
|
|
70
|
+
k8WAf4: "xt970qd",
|
|
71
|
+
kg3NbH: "xaope02",
|
|
72
|
+
$$css: true
|
|
73
|
+
},
|
|
74
|
+
roundedBase36: {
|
|
75
|
+
kaIpWk: "xhpnuu7",
|
|
76
|
+
k8WAf4: "xt970qd",
|
|
77
|
+
kg3NbH: "xqin4a2",
|
|
78
|
+
$$css: true
|
|
79
|
+
},
|
|
80
|
+
roundedBase40: {
|
|
81
|
+
kaIpWk: "x1q4ynmn",
|
|
82
|
+
k8WAf4: "xt970qd",
|
|
83
|
+
kg3NbH: "x1hr3lfm",
|
|
84
|
+
$$css: true
|
|
85
|
+
},
|
|
86
|
+
roundedBase44: {
|
|
87
|
+
kaIpWk: "x1ctf4ec",
|
|
88
|
+
k8WAf4: "xt970qd",
|
|
89
|
+
kg3NbH: "x12j899k",
|
|
90
|
+
$$css: true
|
|
91
|
+
},
|
|
92
|
+
roundedBase48: {
|
|
93
|
+
kaIpWk: "x4pepcl",
|
|
94
|
+
k8WAf4: "xt970qd",
|
|
95
|
+
kg3NbH: "x17qtykl",
|
|
96
|
+
$$css: true
|
|
97
|
+
},
|
|
98
|
+
roundedFull32: {
|
|
99
|
+
kaIpWk: "xgqmno8",
|
|
100
|
+
k8WAf4: "xt970qd",
|
|
101
|
+
kg3NbH: "xaope02",
|
|
102
|
+
$$css: true
|
|
103
|
+
},
|
|
104
|
+
roundedFull36: {
|
|
105
|
+
kaIpWk: "xugzpu4",
|
|
106
|
+
k8WAf4: "xt970qd",
|
|
107
|
+
kg3NbH: "xelufkg",
|
|
108
|
+
$$css: true
|
|
109
|
+
},
|
|
110
|
+
roundedFull40: {
|
|
111
|
+
kaIpWk: "x1m3ak92",
|
|
112
|
+
k8WAf4: "xt970qd",
|
|
113
|
+
kg3NbH: "x17qtykl",
|
|
114
|
+
$$css: true
|
|
115
|
+
},
|
|
116
|
+
roundedFull44: {
|
|
117
|
+
kaIpWk: "x13pz1uv",
|
|
118
|
+
k8WAf4: "xt970qd",
|
|
119
|
+
kg3NbH: "x16l46lf",
|
|
120
|
+
$$css: true
|
|
121
|
+
},
|
|
122
|
+
roundedFull48: {
|
|
123
|
+
kaIpWk: "x1khhgft",
|
|
124
|
+
k8WAf4: "xt970qd",
|
|
125
|
+
kg3NbH: "x1pbfunf",
|
|
126
|
+
$$css: true
|
|
127
|
+
},
|
|
128
|
+
secondary: {
|
|
129
|
+
kWkggS: "x1pflddp x1h73wb5",
|
|
130
|
+
kGVxlE: "x7auhu6 x1er153n",
|
|
131
|
+
kMwMTN: "x197k1c5",
|
|
132
|
+
$$css: true
|
|
133
|
+
},
|
|
134
|
+
widthBase: {
|
|
135
|
+
kzqmXN: "xeq5yr9",
|
|
136
|
+
$$css: true
|
|
137
|
+
},
|
|
138
|
+
widthFull: {
|
|
139
|
+
kzqmXN: "x1brm51p",
|
|
140
|
+
$$css: true
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
const buttonRoundedBaseStyles = {
|
|
144
|
+
32: buttonStyles.roundedBase32,
|
|
145
|
+
36: buttonStyles.roundedBase36,
|
|
146
|
+
40: buttonStyles.roundedBase40,
|
|
147
|
+
44: buttonStyles.roundedBase44,
|
|
148
|
+
48: buttonStyles.roundedBase48
|
|
149
|
+
};
|
|
150
|
+
const buttonRoundedFullStyles = {
|
|
151
|
+
32: buttonStyles.roundedFull32,
|
|
152
|
+
36: buttonStyles.roundedFull36,
|
|
153
|
+
40: buttonStyles.roundedFull40,
|
|
154
|
+
44: buttonStyles.roundedFull44,
|
|
155
|
+
48: buttonStyles.roundedFull48
|
|
156
|
+
};
|
|
157
|
+
//#endregion
|
|
158
|
+
export { buttonRoundedBaseStyles, buttonRoundedFullStyles, buttonStyles };
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { VariantProps } from "class-variance-authority";
|
|
1
|
+
import { ButtonSize, ButtonVariant } from "../button/button.js";
|
|
3
2
|
import { ComponentProps, ElementType, JSX, ReactNode } from "react";
|
|
4
3
|
//#region src/components/button-link/button-link.d.ts
|
|
5
4
|
type ButtonLinkProps<ComponentType extends ElementType = "a"> = ButtonLinkInternalProps<ComponentType> & Omit<ComponentProps<ComponentType>, "children" | keyof ButtonLinkInternalProps>;
|
|
6
5
|
interface ButtonLinkInternalProps<ComponentType extends ElementType = "a"> {
|
|
7
6
|
as?: ComponentType;
|
|
7
|
+
fullWidth?: boolean;
|
|
8
8
|
iconEnd?: ReactNode;
|
|
9
9
|
iconStart?: ReactNode;
|
|
10
|
-
isFullWidth?: VariantProps<typeof button>["isFullWidth"];
|
|
11
|
-
isRounded?: VariantProps<typeof button>["isRounded"];
|
|
12
10
|
label?: number | number[] | string | string[];
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
rounded?: boolean;
|
|
12
|
+
size?: ButtonSize;
|
|
13
|
+
variant?: ButtonVariant;
|
|
15
14
|
}
|
|
16
15
|
declare function ButtonLink<ComponentType extends ElementType = "a">(props: ButtonLinkProps<ComponentType>): JSX.Element;
|
|
17
16
|
//#endregion
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getButtonClassName } from "../button/button.js";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
//#region src/components/button-link/button-link.tsx
|
|
4
4
|
function ButtonLink(props) {
|
|
5
|
-
const { as: Component = "a", className = "", iconStart = "", iconEnd = "",
|
|
5
|
+
const { as: Component = "a", className = "", iconStart = "", iconEnd = "", fullWidth = false, rounded = false, label = "", size = 40, variant = "primary", ...rest } = props;
|
|
6
6
|
return /* @__PURE__ */ jsxs(Component, {
|
|
7
|
-
className:
|
|
7
|
+
className: getButtonClassName({
|
|
8
8
|
className,
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
fullWidth,
|
|
10
|
+
rounded,
|
|
11
11
|
size,
|
|
12
12
|
variant
|
|
13
13
|
}),
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { sx } from "../cn.js";
|
|
2
|
+
import { checkboxStyles } from "./checkbox.stylex.js";
|
|
1
3
|
import { jsx } from "react/jsx-runtime";
|
|
2
4
|
//#region src/components/checkbox/checkbox-icon.tsx
|
|
3
5
|
function CheckboxIcon(props) {
|
|
@@ -11,11 +13,10 @@ function CheckboxIcon(props) {
|
|
|
11
13
|
xmlns: "http://www.w3.org/2000/svg",
|
|
12
14
|
...rest,
|
|
13
15
|
children: /* @__PURE__ */ jsx("path", {
|
|
16
|
+
className: sx(checkboxStyles.iconPath),
|
|
14
17
|
d: "M5 13.875L9.2 18L19 7",
|
|
15
|
-
stroke: "black",
|
|
16
18
|
strokeLinecap: "round",
|
|
17
|
-
strokeLinejoin: "round"
|
|
18
|
-
strokeWidth: "1.5"
|
|
19
|
+
strokeLinejoin: "round"
|
|
19
20
|
})
|
|
20
21
|
});
|
|
21
22
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { checkboxStyles } from "./checkbox.stylex.js";
|
|
1
2
|
import { Checkbox } from "@base-ui/react";
|
|
2
3
|
import { ComponentProps, JSX } from "react";
|
|
3
4
|
//#region src/components/checkbox/checkbox.d.ts
|
|
4
5
|
interface CheckboxProps extends ComponentProps<typeof Checkbox.Root> {}
|
|
5
6
|
declare function Checkbox$1(props: CheckboxProps): JSX.Element;
|
|
6
|
-
declare const checkboxVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
7
7
|
//#endregion
|
|
8
|
-
export { Checkbox$1 as Checkbox, CheckboxProps,
|
|
8
|
+
export { Checkbox$1 as Checkbox, CheckboxProps, checkboxStyles };
|
|
@@ -1,22 +1,20 @@
|
|
|
1
|
+
import { cn, sx } from "../cn.js";
|
|
2
|
+
import { checkboxStyles } from "./checkbox.stylex.js";
|
|
1
3
|
import { CheckboxIcon } from "./checkbox-icon.js";
|
|
2
|
-
import checkbox_module_default from "./checkbox.module.js";
|
|
3
|
-
import { cva } from "class-variance-authority";
|
|
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
8
|
const { children = void 0, className: customClassName = "", ...rest } = props;
|
|
9
|
-
const combinedClassName = checkboxVariants({ className: customClassName });
|
|
10
9
|
return /* @__PURE__ */ jsx(Checkbox.Root, {
|
|
11
|
-
className:
|
|
10
|
+
className: cn(sx(checkboxStyles.base), customClassName),
|
|
12
11
|
"data-slot": "checkbox",
|
|
13
12
|
...rest,
|
|
14
13
|
children: /* @__PURE__ */ jsx(Checkbox.Indicator, {
|
|
15
|
-
className:
|
|
16
|
-
children: children ?? /* @__PURE__ */ jsx(CheckboxIcon, { className:
|
|
14
|
+
className: sx(checkboxStyles.indicator),
|
|
15
|
+
children: children ?? /* @__PURE__ */ jsx(CheckboxIcon, { className: sx(checkboxStyles.icon) })
|
|
17
16
|
})
|
|
18
17
|
});
|
|
19
18
|
}
|
|
20
|
-
const checkboxVariants = cva(checkbox_module_default.base);
|
|
21
19
|
//#endregion
|
|
22
|
-
export { Checkbox$1 as Checkbox,
|
|
20
|
+
export { Checkbox$1 as Checkbox, checkboxStyles };
|