@nattstack/ui 0.1.0 → 0.1.2

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.
Files changed (163) hide show
  1. package/README.md +3 -0
  2. package/dist/components/button/button-spinner.js +4 -4
  3. package/dist/components/button/button-spinner.stylex.js +1 -1
  4. package/dist/components/button/button.d.ts +2 -13
  5. package/dist/components/button/button.js +10 -32
  6. package/dist/components/button/button.stylex.js +78 -77
  7. package/dist/components/button-link/button-link.d.ts +1 -1
  8. package/dist/components/button-link/button-link.js +8 -12
  9. package/dist/components/checkbox/checkbox-icon.js +3 -3
  10. package/dist/components/checkbox/checkbox.d.ts +1 -2
  11. package/dist/components/checkbox/checkbox.js +8 -7
  12. package/dist/components/checkbox/checkbox.stylex.js +1 -1
  13. package/dist/components/cn.js +9 -7
  14. package/dist/components/column/column.d.ts +1 -2
  15. package/dist/components/column/column.js +4 -5
  16. package/dist/components/combobox/combobox-content.js +8 -7
  17. package/dist/components/combobox/combobox-empty.d.ts +1 -2
  18. package/dist/components/combobox/combobox-empty.js +6 -5
  19. package/dist/components/combobox/combobox-group-label.js +5 -4
  20. package/dist/components/combobox/combobox-group.js +5 -4
  21. package/dist/components/combobox/combobox-input.d.ts +1 -2
  22. package/dist/components/combobox/combobox-input.js +13 -12
  23. package/dist/components/combobox/combobox-input.stylex.js +37 -27
  24. package/dist/components/combobox/combobox-item.js +9 -8
  25. package/dist/components/combobox/combobox-list.js +5 -4
  26. package/dist/components/combobox/combobox-search.d.ts +1 -2
  27. package/dist/components/combobox/combobox-search.js +10 -9
  28. package/dist/components/combobox/combobox-separator.js +5 -4
  29. package/dist/components/combobox/combobox-trigger.js +8 -7
  30. package/dist/components/combobox/combobox-value.d.ts +1 -2
  31. package/dist/components/combobox/combobox-value.js +6 -5
  32. package/dist/components/combobox/combobox.js +1 -1
  33. package/dist/components/dialog-responsive/dialog-responsive-backdrop.js +5 -4
  34. package/dist/components/dialog-responsive/dialog-responsive-bar.js +5 -4
  35. package/dist/components/dialog-responsive/dialog-responsive-popup.d.ts +1 -2
  36. package/dist/components/dialog-responsive/dialog-responsive-popup.js +6 -5
  37. package/dist/components/dialog-responsive/dialog-responsive-portal.js +5 -4
  38. package/dist/components/dialog-responsive/dialog-responsive-trigger.js +1 -1
  39. package/dist/components/dialog-responsive/dialog-responsive-viewport.js +5 -4
  40. package/dist/components/dialog-responsive/dialog-responsive.js +3 -2
  41. package/dist/components/icon-button/icon-button.d.ts +1 -2
  42. package/dist/components/icon-button/icon-button.js +9 -20
  43. package/dist/components/icon-button/icon-button.stylex.js +17 -6
  44. package/dist/components/index.d.ts +4 -41
  45. package/dist/components/index.js +3 -40
  46. package/dist/components/input/input.d.ts +1 -2
  47. package/dist/components/input/input.js +7 -6
  48. package/dist/components/input/input.stylex.js +49 -36
  49. package/dist/components/label/label.d.ts +1 -2
  50. package/dist/components/label/label.js +4 -5
  51. package/dist/components/menu/menu-checkbox-item.js +9 -8
  52. package/dist/components/menu/menu-content.d.ts +1 -2
  53. package/dist/components/menu/menu-content.js +11 -10
  54. package/dist/components/menu/menu-group-label.js +5 -4
  55. package/dist/components/menu/menu-group.js +5 -4
  56. package/dist/components/menu/menu-item.d.ts +1 -2
  57. package/dist/components/menu/menu-item.js +6 -5
  58. package/dist/components/menu/menu-link-item.js +5 -4
  59. package/dist/components/menu/menu-radio-group.js +5 -4
  60. package/dist/components/menu/menu-radio-item.js +9 -8
  61. package/dist/components/menu/menu-separator.js +5 -4
  62. package/dist/components/menu/menu-submenu-trigger.d.ts +1 -2
  63. package/dist/components/menu/menu-submenu-trigger.js +8 -7
  64. package/dist/components/menu/menu-submenu.js +1 -1
  65. package/dist/components/menu/menu-trigger.js +1 -1
  66. package/dist/components/menu/menu.js +1 -1
  67. package/dist/components/otp-field/otp-field-input.d.ts +1 -2
  68. package/dist/components/otp-field/otp-field-input.js +6 -5
  69. package/dist/components/otp-field/otp-field.d.ts +1 -2
  70. package/dist/components/otp-field/otp-field.js +6 -5
  71. package/dist/components/otp-field/otp-field.stylex.js +1 -1
  72. package/dist/components/picker/picker-trigger.stylex.js +37 -27
  73. package/dist/components/row/row.d.ts +1 -2
  74. package/dist/components/row/row.js +4 -5
  75. package/dist/components/select/select-content.d.ts +1 -2
  76. package/dist/components/select/select-content.js +11 -10
  77. package/dist/components/select/select-group-label.js +5 -4
  78. package/dist/components/select/select-group.d.ts +1 -2
  79. package/dist/components/select/select-group.js +6 -5
  80. package/dist/components/select/select-item.d.ts +1 -2
  81. package/dist/components/select/select-item.js +10 -9
  82. package/dist/components/select/select-separator.d.ts +1 -2
  83. package/dist/components/select/select-separator.js +6 -5
  84. package/dist/components/select/select-trigger.d.ts +1 -2
  85. package/dist/components/select/select-trigger.js +9 -8
  86. package/dist/components/select/select-value.d.ts +1 -2
  87. package/dist/components/select/select-value.js +6 -5
  88. package/dist/components/select/select.js +1 -1
  89. package/dist/components/spacer/spacer.d.ts +1 -2
  90. package/dist/components/spacer/spacer.js +4 -5
  91. package/dist/components/stylex.css +4 -4
  92. package/dist/components/switch/switch.d.ts +1 -2
  93. package/dist/components/switch/switch.js +8 -7
  94. package/dist/components/switch/switch.stylex.js +17 -13
  95. package/dist/components/tabs/tabs-panel.d.ts +1 -2
  96. package/dist/components/tabs/tabs-panel.js +4 -5
  97. package/dist/components/tabs/tabs.d.ts +1 -2
  98. package/dist/components/tabs/tabs.js +4 -5
  99. package/dist/components/tabs-pill/tabs-pill-indicator.js +5 -4
  100. package/dist/components/tabs-pill/tabs-pill-list.d.ts +1 -2
  101. package/dist/components/tabs-pill/tabs-pill-list.js +6 -5
  102. package/dist/components/tabs-pill/tabs-pill-tab.d.ts +1 -2
  103. package/dist/components/tabs-pill/tabs-pill-tab.js +8 -7
  104. package/dist/components/tabs-segmented/tabs-segmented-indicator.js +5 -4
  105. package/dist/components/tabs-segmented/tabs-segmented-list.d.ts +1 -2
  106. package/dist/components/tabs-segmented/tabs-segmented-list.js +6 -5
  107. package/dist/components/tabs-segmented/tabs-segmented-tab.d.ts +1 -2
  108. package/dist/components/tabs-segmented/tabs-segmented-tab.js +6 -5
  109. package/dist/components/tabs-underline/tabs-underline-indicator.js +5 -4
  110. package/dist/components/tabs-underline/tabs-underline-list.d.ts +1 -2
  111. package/dist/components/tabs-underline/tabs-underline-list.js +6 -5
  112. package/dist/components/tabs-underline/tabs-underline-tab.d.ts +1 -2
  113. package/dist/components/tabs-underline/tabs-underline-tab.js +6 -5
  114. package/dist/components/textarea/textarea.d.ts +1 -2
  115. package/dist/components/textarea/textarea.js +7 -6
  116. package/dist/components/toggle-group/toggle-group-item.d.ts +1 -2
  117. package/dist/components/toggle-group/toggle-group-item.js +6 -5
  118. package/dist/components/toggle-group/toggle-group.d.ts +1 -2
  119. package/dist/components/toggle-group/toggle-group.js +6 -5
  120. package/dist/components/tooltip/tooltip-popup.d.ts +1 -2
  121. package/dist/components/tooltip/tooltip-popup.js +8 -7
  122. package/dist/components/tooltip/tooltip-provider.js +1 -1
  123. package/dist/components/tooltip/tooltip-trigger.js +1 -1
  124. package/dist/components/tooltip/tooltip.js +3 -2
  125. package/package.json +2 -1
  126. package/dist/components/button/button.stylex.d.ts +0 -121
  127. package/dist/components/checkbox/checkbox.stylex.d.ts +0 -40
  128. package/dist/components/cn.d.ts +0 -6
  129. package/dist/components/column/column.stylex.d.ts +0 -10
  130. package/dist/components/combobox/combobox-empty.stylex.d.ts +0 -13
  131. package/dist/components/combobox/combobox-input.stylex.d.ts +0 -93
  132. package/dist/components/combobox/combobox-search.stylex.d.ts +0 -45
  133. package/dist/components/combobox/combobox-value.stylex.d.ts +0 -14
  134. package/dist/components/dialog-responsive/dialog-responsive-popup.stylex.d.ts +0 -32
  135. package/dist/components/icon-button/icon-button.stylex.d.ts +0 -21
  136. package/dist/components/input/input.stylex.d.ts +0 -66
  137. package/dist/components/label/label.stylex.d.ts +0 -12
  138. package/dist/components/menu/menu-content.stylex.d.ts +0 -11
  139. package/dist/components/menu/menu-item.stylex.d.ts +0 -11
  140. package/dist/components/menu/menu-submenu-trigger.stylex.d.ts +0 -19
  141. package/dist/components/otp-field/otp-field-input.stylex.d.ts +0 -25
  142. package/dist/components/otp-field/otp-field.stylex.d.ts +0 -16
  143. package/dist/components/picker/picker-group.stylex.d.ts +0 -18
  144. package/dist/components/picker/picker-item.stylex.d.ts +0 -39
  145. package/dist/components/picker/picker-popup.stylex.d.ts +0 -36
  146. package/dist/components/picker/picker-separator.stylex.d.ts +0 -13
  147. package/dist/components/picker/picker-trigger.stylex.d.ts +0 -60
  148. package/dist/components/row/row.stylex.d.ts +0 -10
  149. package/dist/components/select/select-value.stylex.d.ts +0 -14
  150. package/dist/components/spacer/spacer.stylex.d.ts +0 -9
  151. package/dist/components/switch/switch.stylex.d.ts +0 -41
  152. package/dist/components/tabs/tabs-panel.stylex.d.ts +0 -14
  153. package/dist/components/tabs/tabs.stylex.d.ts +0 -10
  154. package/dist/components/tabs-pill/tabs-pill-list.stylex.d.ts +0 -13
  155. package/dist/components/tabs-pill/tabs-pill-tab.stylex.d.ts +0 -44
  156. package/dist/components/tabs-segmented/tabs-segmented-list.stylex.d.ts +0 -17
  157. package/dist/components/tabs-segmented/tabs-segmented-tab.stylex.d.ts +0 -28
  158. package/dist/components/tabs-underline/tabs-underline-list.stylex.d.ts +0 -14
  159. package/dist/components/tabs-underline/tabs-underline-tab.stylex.d.ts +0 -27
  160. package/dist/components/textarea/textarea.stylex.d.ts +0 -13
  161. package/dist/components/toggle-group/toggle-group-item.stylex.d.ts +0 -33
  162. package/dist/components/toggle-group/toggle-group.stylex.d.ts +0 -11
  163. package/dist/components/tooltip/tooltip-popup.stylex.d.ts +0 -30
package/README.md CHANGED
@@ -20,6 +20,9 @@ bun add @nattstack/ui
20
20
  @import "tailwindcss";
21
21
  @import "@nattstack/ui/tailwind-colors";
22
22
  @import "@nattstack/ui/tailwind-tokenless-10";
23
+
24
+ /* Required: the compiled component styles */
25
+ @import "@nattstack/ui/components";
23
26
  ```
24
27
 
25
28
  ```tsx
@@ -1,4 +1,4 @@
1
- import { sx } from "../cn.js";
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: sx(buttonSpinnerStyles.base),
23
- "data-slot": "button-spinner",
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: sx(buttonSpinnerStyles.bar, barStyle) }, index))
25
+ children: BAR_STYLES.map((barStyle, index) => /* @__PURE__ */ jsx("div", { className: cn(buttonSpinnerStyles.bar, barStyle) }, index))
26
26
  });
27
27
  }
28
28
  //#endregion
@@ -86,7 +86,7 @@ const buttonSpinnerStyles = {
86
86
  kKVMdj: "x1m7ugx0",
87
87
  kyAemX: "xbv57ra",
88
88
  kZKoxP: "x188dgw3",
89
- kVAEAm: "x10l6tqk",
89
+ kVAEAm: "x1n2onr6",
90
90
  km0Bbg: "xngwomw",
91
91
  kzqmXN: "x1fjlwjz",
92
92
  $$css: true
@@ -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?: number | number[] | string | string[];
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, buttonStyles, getButtonClassName };
17
+ export { Button, ButtonProps, ButtonSize, ButtonVariant };
@@ -1,45 +1,23 @@
1
- import { cn, sx } from "../cn.js";
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, iconStart = "", iconEnd = "", fullWidth = false, loading = false, rounded = false, label = "", variant = "primary", size = 40, ...rest } = props;
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: getButtonClassName({
10
- className,
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
- hideWhenLoading(iconStart, loading),
25
- label !== "" && /* @__PURE__ */ jsx("span", {
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, buttonStyles, getButtonClassName };
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
- 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: {
29
+ rounded_base_32: {
69
30
  kaIpWk: "xur7f20",
70
- k8WAf4: "xt970qd",
71
31
  kg3NbH: "xaope02",
72
32
  $$css: true
73
33
  },
74
- roundedBase36: {
34
+ rounded_base_36: {
75
35
  kaIpWk: "xhpnuu7",
76
- k8WAf4: "xt970qd",
77
36
  kg3NbH: "xqin4a2",
78
37
  $$css: true
79
38
  },
80
- roundedBase40: {
39
+ rounded_base_40: {
81
40
  kaIpWk: "x1q4ynmn",
82
- k8WAf4: "xt970qd",
83
41
  kg3NbH: "x1hr3lfm",
84
42
  $$css: true
85
43
  },
86
- roundedBase44: {
44
+ rounded_base_44: {
87
45
  kaIpWk: "x1ctf4ec",
88
- k8WAf4: "xt970qd",
89
46
  kg3NbH: "x12j899k",
90
47
  $$css: true
91
48
  },
92
- roundedBase48: {
49
+ rounded_base_48: {
93
50
  kaIpWk: "x4pepcl",
94
- k8WAf4: "xt970qd",
95
51
  kg3NbH: "x17qtykl",
96
52
  $$css: true
97
53
  },
98
- roundedFull32: {
54
+ rounded_full_32: {
99
55
  kaIpWk: "xgqmno8",
100
- k8WAf4: "xt970qd",
101
56
  kg3NbH: "xaope02",
102
57
  $$css: true
103
58
  },
104
- roundedFull36: {
59
+ rounded_full_36: {
105
60
  kaIpWk: "xugzpu4",
106
- k8WAf4: "xt970qd",
107
61
  kg3NbH: "xelufkg",
108
62
  $$css: true
109
63
  },
110
- roundedFull40: {
64
+ rounded_full_40: {
111
65
  kaIpWk: "x1m3ak92",
112
- k8WAf4: "xt970qd",
113
66
  kg3NbH: "x17qtykl",
114
67
  $$css: true
115
68
  },
116
- roundedFull44: {
69
+ rounded_full_44: {
117
70
  kaIpWk: "x13pz1uv",
118
- k8WAf4: "xt970qd",
119
71
  kg3NbH: "x16l46lf",
120
72
  $$css: true
121
73
  },
122
- roundedFull48: {
74
+ rounded_full_48: {
123
75
  kaIpWk: "x1khhgft",
124
- k8WAf4: "xt970qd",
125
76
  kg3NbH: "x1pbfunf",
126
77
  $$css: true
127
78
  },
128
- secondary: {
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
- widthBase: {
115
+ width_base: {
135
116
  kzqmXN: "xeq5yr9",
136
117
  $$css: true
137
118
  },
138
- widthFull: {
119
+ width_full: {
139
120
  kzqmXN: "x1brm51p",
140
121
  $$css: true
141
122
  }
142
123
  };
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
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 { buttonRoundedBaseStyles, buttonRoundedFullStyles, buttonStyles };
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?: number | number[] | string | string[];
10
+ label?: string;
11
11
  rounded?: boolean;
12
12
  size?: ButtonSize;
13
13
  variant?: ButtonVariant;
@@ -1,21 +1,17 @@
1
- import { getButtonClassName } from "../button/button.js";
2
- import { jsx, jsxs } from "react/jsx-runtime";
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 = "", iconStart = "", iconEnd = "", fullWidth = false, rounded = false, label = "", size = 40, variant = "primary", ...rest } = props;
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: getButtonClassName({
8
- className,
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 !== "" && /* @__PURE__ */ jsx("span", { children: label }),
14
+ label,
19
15
  iconEnd
20
16
  ]
21
17
  });
@@ -1,11 +1,11 @@
1
- import { sx } from "../cn.js";
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-slot": "checkbox-icon",
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: sx(checkboxStyles.iconPath),
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, checkboxStyles };
7
+ export { Checkbox$1 as Checkbox, CheckboxProps };
@@ -1,20 +1,21 @@
1
- import { cn, sx } from "../cn.js";
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: customClassName = "", ...rest } = props;
8
+ const { children = void 0, className = "", ...rest } = props;
9
+ const combinedClassName = cn(checkboxStyles.base, className);
9
10
  return /* @__PURE__ */ jsx(Checkbox.Root, {
10
- className: cn(sx(checkboxStyles.base), customClassName),
11
- "data-slot": "checkbox",
11
+ className: combinedClassName,
12
+ "data-component": "checkbox",
12
13
  ...rest,
13
14
  children: /* @__PURE__ */ jsx(Checkbox.Indicator, {
14
- className: sx(checkboxStyles.indicator),
15
- children: children ?? /* @__PURE__ */ jsx(CheckboxIcon, { className: sx(checkboxStyles.icon) })
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, checkboxStyles };
21
+ export { Checkbox$1 as Checkbox };
@@ -27,7 +27,7 @@ const checkboxStyles = {
27
27
  kzqmXN: "x1fjlwjz",
28
28
  $$css: true
29
29
  },
30
- iconPath: {
30
+ icon_path: {
31
31
  kjVXCG: "xqvyd8v",
32
32
  kfJifR: "xqjr0vm",
33
33
  $$css: true
@@ -1,18 +1,20 @@
1
1
  import * as stylex from "@stylexjs/stylex";
2
2
  //#region src/components/cn.ts
3
3
  /**
4
- * Join class names, dropping empty values.
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 - Class strings and optional empty values to ignore.
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
- return values.filter((value) => typeof value === "string" && value !== "").join(" ");
13
- }
14
- function sx(...styles) {
15
- return stylex.props(...styles).className ?? "";
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, sx };
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, columnStyles };
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 { className: stylexClassName } = stylex.props(columnStyles.base);
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: cn(stylexClassName, className),
20
- "data-slot": "column",
18
+ className: combinedClassName,
19
+ "data-component": "column",
21
20
  style: combinedStyle,
22
21
  ...rest
23
22
  });
24
23
  }
25
24
  //#endregion
26
- export { Column, columnStyles };
25
+ export { Column };
@@ -1,31 +1,32 @@
1
- import { cn, sx } from "../cn.js";
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: customClassName = "", 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;
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-slot": "combobox-portal",
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: sx(pickerPopupStyles.positioner),
17
+ className: cn(pickerPopupStyles.positioner),
17
18
  collisionAvoidance,
18
19
  collisionBoundary,
19
20
  collisionPadding,
20
- "data-slot": "combobox-positioner",
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: cn(sx(pickerPopupStyles.base), customClassName),
28
- "data-slot": "combobox-content",
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, comboboxEmptyStyles };
9
+ export { ComboboxEmpty, ComboboxEmptyProps };
@@ -1,15 +1,16 @@
1
- import { cn, sx } from "../cn.js";
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: customClassName = "", ...rest } = props;
7
+ const { className = "", ...rest } = props;
8
+ const combinedClassName = cn(comboboxEmptyStyles.base, className);
8
9
  return /* @__PURE__ */ jsx(Combobox.Empty, {
9
- className: cn(sx(comboboxEmptyStyles.base), customClassName),
10
- "data-slot": "combobox-empty",
10
+ className: combinedClassName,
11
+ "data-component": "combobox-empty",
11
12
  ...rest
12
13
  });
13
14
  }
14
15
  //#endregion
15
- export { ComboboxEmpty, comboboxEmptyStyles };
16
+ export { ComboboxEmpty };
@@ -1,13 +1,14 @@
1
- import { cn, sx } from "../cn.js";
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: customClassName = "", ...rest } = props;
7
+ const { className = "", ...rest } = props;
8
+ const combinedClassName = cn(pickerGroupStyles.label, className);
8
9
  return /* @__PURE__ */ jsx(Combobox.GroupLabel, {
9
- className: cn(sx(pickerGroupStyles.label), customClassName),
10
- "data-slot": "combobox-group-label",
10
+ className: combinedClassName,
11
+ "data-component": "combobox-group-label",
11
12
  ...rest
12
13
  });
13
14
  }
@@ -1,13 +1,14 @@
1
- import { cn, sx } from "../cn.js";
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: customClassName = "", ...rest } = props;
7
+ const { className = "", ...rest } = props;
8
+ const combinedClassName = cn(pickerGroupStyles.base, className);
8
9
  return /* @__PURE__ */ jsx(Combobox.Group, {
9
- className: cn(sx(pickerGroupStyles.base), customClassName),
10
- "data-slot": "combobox-group",
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, comboboxInputStyles };
12
+ export { ComboboxInput, ComboboxInputProps, ComboboxInputSize };