@vlrc-fe/components 3.0.4 → 3.0.6

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 (213) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/ConfirmModal.cjs +30 -32
  3. package/dist/ConfirmModal.d.ts +3 -7
  4. package/dist/ConfirmModal.d.ts.map +1 -1
  5. package/dist/ConfirmModal.js +31 -32
  6. package/dist/Modal.cjs +3 -4
  7. package/dist/Modal.d.ts +1 -3
  8. package/dist/Modal.d.ts.map +1 -1
  9. package/dist/Modal.js +3 -4
  10. package/dist/MultiSelect/MultiSelect.cjs +0 -1
  11. package/dist/MultiSelect/MultiSelect.d.ts.map +1 -1
  12. package/dist/MultiSelect/MultiSelect.js +0 -1
  13. package/dist/MultiSelect/useMultiSelect.cjs +1 -0
  14. package/dist/MultiSelect/useMultiSelect.d.ts.map +1 -1
  15. package/dist/MultiSelect/useMultiSelect.js +1 -0
  16. package/dist/MultiSelect/utils.cjs +2 -2
  17. package/dist/MultiSelect/utils.js +2 -2
  18. package/dist/Typography/Link.cjs +3 -5
  19. package/dist/Typography/Link.d.ts +1 -1
  20. package/dist/Typography/Link.d.ts.map +1 -1
  21. package/dist/Typography/Link.js +3 -5
  22. package/dist/Typography/Paragraph.cjs +3 -5
  23. package/dist/Typography/Paragraph.d.ts +1 -1
  24. package/dist/Typography/Paragraph.d.ts.map +1 -1
  25. package/dist/Typography/Paragraph.js +3 -5
  26. package/dist/Typography/Text.cjs +3 -4
  27. package/dist/Typography/Text.d.ts +1 -1
  28. package/dist/Typography/Text.d.ts.map +1 -1
  29. package/dist/Typography/Text.js +4 -5
  30. package/dist/Typography/Title.cjs +4 -4
  31. package/dist/Typography/Title.d.ts +1 -1
  32. package/dist/Typography/Title.d.ts.map +1 -1
  33. package/dist/Typography/Title.js +5 -5
  34. package/dist/Typography/Typography.d.ts +8 -4
  35. package/dist/Typography/Typography.d.ts.map +1 -1
  36. package/dist/Typography/index.d.ts +0 -3
  37. package/dist/Typography/index.d.ts.map +1 -1
  38. package/dist/Typography/index.js +1 -4
  39. package/dist/Typography/types.d.ts +4 -0
  40. package/dist/Typography/types.d.ts.map +1 -1
  41. package/dist/assets/stylex.css +32 -8
  42. package/dist/astryx.cjs +1 -10
  43. package/dist/astryx.d.ts +0 -1
  44. package/dist/astryx.d.ts.map +1 -1
  45. package/dist/astryx.js +0 -2
  46. package/dist/index.cjs +2 -12
  47. package/dist/index.d.ts +2 -3
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/index.js +3 -6
  50. package/dist/layout/Box.cjs +44 -67
  51. package/dist/layout/Box.d.ts +3 -5
  52. package/dist/layout/Box.d.ts.map +1 -1
  53. package/dist/layout/Box.js +44 -67
  54. package/dist/layout/Center.cjs +13 -24
  55. package/dist/layout/Center.d.ts +2 -2
  56. package/dist/layout/Center.d.ts.map +1 -1
  57. package/dist/layout/Center.js +13 -24
  58. package/dist/layout/Container.cjs +21 -10
  59. package/dist/layout/Container.d.ts +3 -5
  60. package/dist/layout/Container.d.ts.map +1 -1
  61. package/dist/layout/Container.js +21 -10
  62. package/dist/layout/Stack.cjs +55 -93
  63. package/dist/layout/Stack.d.ts +5 -5
  64. package/dist/layout/Stack.d.ts.map +1 -1
  65. package/dist/layout/Stack.js +55 -93
  66. package/dist/layout/index.d.ts +1 -1
  67. package/dist/layout/index.js +2 -2
  68. package/dist/lazyLoad.cjs +1 -1
  69. package/dist/lazyLoad.d.ts.map +1 -1
  70. package/dist/lazyLoad.js +1 -1
  71. package/dist/theme/index.cjs +1 -1
  72. package/dist/theme/index.js +1 -1
  73. package/dist/theme/zIndex.cjs +0 -2
  74. package/dist/theme/zIndex.d.ts +4 -4
  75. package/dist/theme/zIndex.d.ts.map +1 -1
  76. package/dist/theme.css +32 -8
  77. package/dist/ui/aspect-ratio.cjs +0 -1
  78. package/dist/ui/aspect-ratio.d.ts.map +1 -1
  79. package/dist/ui/aspect-ratio.js +0 -1
  80. package/dist/ui/avatar.cjs +0 -1
  81. package/dist/ui/avatar.d.ts.map +1 -1
  82. package/dist/ui/avatar.js +0 -1
  83. package/dist/ui/calendar.cjs +0 -1
  84. package/dist/ui/calendar.d.ts.map +1 -1
  85. package/dist/ui/calendar.js +0 -1
  86. package/dist/ui/carousel.cjs +0 -1
  87. package/dist/ui/carousel.d.ts.map +1 -1
  88. package/dist/ui/carousel.js +0 -1
  89. package/dist/ui/checkbox.cjs +4 -8
  90. package/dist/ui/checkbox.d.ts +1 -1
  91. package/dist/ui/checkbox.d.ts.map +1 -1
  92. package/dist/ui/checkbox.js +5 -9
  93. package/dist/ui/circular-progress.cjs +25 -20
  94. package/dist/ui/circular-progress.d.ts +3 -3
  95. package/dist/ui/circular-progress.d.ts.map +1 -1
  96. package/dist/ui/circular-progress.js +25 -20
  97. package/dist/ui/code-block.cjs +180 -176
  98. package/dist/ui/code-block.d.ts +17 -9
  99. package/dist/ui/code-block.d.ts.map +1 -1
  100. package/dist/ui/code-block.js +181 -177
  101. package/dist/ui/collapsible.cjs +0 -1
  102. package/dist/ui/collapsible.d.ts.map +1 -1
  103. package/dist/ui/collapsible.js +0 -1
  104. package/dist/ui/compare-slider.cjs +2 -3
  105. package/dist/ui/compare-slider.d.ts +3 -2
  106. package/dist/ui/compare-slider.d.ts.map +1 -1
  107. package/dist/ui/compare-slider.js +3 -4
  108. package/dist/ui/context-menu.cjs +0 -1
  109. package/dist/ui/context-menu.d.ts.map +1 -1
  110. package/dist/ui/context-menu.js +0 -1
  111. package/dist/ui/copy-button.cjs +2 -3
  112. package/dist/ui/copy-button.d.ts +1 -1
  113. package/dist/ui/copy-button.d.ts.map +1 -1
  114. package/dist/ui/copy-button.js +3 -4
  115. package/dist/ui/dialog.cjs +2 -0
  116. package/dist/ui/dialog.d.ts.map +1 -1
  117. package/dist/ui/dialog.js +2 -0
  118. package/dist/ui/drawer.cjs +2 -0
  119. package/dist/ui/drawer.d.ts.map +1 -1
  120. package/dist/ui/drawer.js +2 -0
  121. package/dist/ui/editable.cjs +1 -0
  122. package/dist/ui/editable.d.ts.map +1 -1
  123. package/dist/ui/editable.js +1 -0
  124. package/dist/ui/empty.cjs +37 -52
  125. package/dist/ui/empty.d.ts +5 -5
  126. package/dist/ui/empty.d.ts.map +1 -1
  127. package/dist/ui/empty.js +38 -53
  128. package/dist/ui/file-upload.cjs +0 -1
  129. package/dist/ui/file-upload.d.ts.map +1 -1
  130. package/dist/ui/file-upload.js +0 -1
  131. package/dist/ui/flex.cjs +3 -4
  132. package/dist/ui/flex.d.ts +3 -2
  133. package/dist/ui/flex.d.ts.map +1 -1
  134. package/dist/ui/flex.js +3 -4
  135. package/dist/ui/form.cjs +0 -1
  136. package/dist/ui/form.d.ts.map +1 -1
  137. package/dist/ui/form.js +0 -1
  138. package/dist/ui/gauge.cjs +2 -4
  139. package/dist/ui/gauge.d.ts +3 -2
  140. package/dist/ui/gauge.d.ts.map +1 -1
  141. package/dist/ui/gauge.js +2 -4
  142. package/dist/ui/grid.cjs +7 -7
  143. package/dist/ui/grid.d.ts +7 -3
  144. package/dist/ui/grid.d.ts.map +1 -1
  145. package/dist/ui/grid.js +7 -8
  146. package/dist/ui/hover-card.cjs +0 -1
  147. package/dist/ui/hover-card.d.ts.map +1 -1
  148. package/dist/ui/hover-card.js +0 -1
  149. package/dist/ui/input-group.cjs +17 -23
  150. package/dist/ui/input-group.d.ts +2 -2
  151. package/dist/ui/input-group.d.ts.map +1 -1
  152. package/dist/ui/input-group.js +17 -23
  153. package/dist/ui/marker.cjs +78 -75
  154. package/dist/ui/marker.d.ts +7 -4
  155. package/dist/ui/marker.d.ts.map +1 -1
  156. package/dist/ui/marker.js +79 -76
  157. package/dist/ui/masonry.cjs +2 -4
  158. package/dist/ui/masonry.d.ts +1 -1
  159. package/dist/ui/masonry.d.ts.map +1 -1
  160. package/dist/ui/masonry.js +3 -5
  161. package/dist/ui/menubar.cjs +0 -1
  162. package/dist/ui/menubar.d.ts.map +1 -1
  163. package/dist/ui/menubar.js +0 -1
  164. package/dist/ui/progress.cjs +6 -5
  165. package/dist/ui/progress.d.ts +3 -3
  166. package/dist/ui/progress.d.ts.map +1 -1
  167. package/dist/ui/progress.js +6 -5
  168. package/dist/ui/questionnaire.cjs +138 -135
  169. package/dist/ui/questionnaire.d.ts +21 -11
  170. package/dist/ui/questionnaire.d.ts.map +1 -1
  171. package/dist/ui/questionnaire.js +139 -136
  172. package/dist/ui/rating.cjs +2 -3
  173. package/dist/ui/rating.d.ts +3 -2
  174. package/dist/ui/rating.d.ts.map +1 -1
  175. package/dist/ui/rating.js +3 -4
  176. package/dist/ui/resizable.cjs +0 -1
  177. package/dist/ui/resizable.d.ts.map +1 -1
  178. package/dist/ui/resizable.js +0 -1
  179. package/dist/ui/row-col.cjs +4 -6
  180. package/dist/ui/row-col.d.ts +6 -4
  181. package/dist/ui/row-col.d.ts.map +1 -1
  182. package/dist/ui/row-col.js +5 -7
  183. package/dist/ui/scroll-area.cjs +40 -53
  184. package/dist/ui/scroll-area.d.ts +1 -1
  185. package/dist/ui/scroll-area.d.ts.map +1 -1
  186. package/dist/ui/scroll-area.js +40 -53
  187. package/dist/ui/segmented.cjs +2 -3
  188. package/dist/ui/segmented.d.ts +3 -2
  189. package/dist/ui/segmented.d.ts.map +1 -1
  190. package/dist/ui/segmented.js +3 -4
  191. package/dist/ui/sheet.cjs +2 -0
  192. package/dist/ui/sheet.d.ts.map +1 -1
  193. package/dist/ui/sheet.js +2 -0
  194. package/dist/ui/sidebar.cjs +0 -1
  195. package/dist/ui/sidebar.d.ts.map +1 -1
  196. package/dist/ui/sidebar.js +0 -1
  197. package/dist/ui/signature-pad.cjs +148 -147
  198. package/dist/ui/signature-pad.d.ts +17 -9
  199. package/dist/ui/signature-pad.d.ts.map +1 -1
  200. package/dist/ui/signature-pad.js +149 -148
  201. package/dist/ui/stat.cjs +57 -71
  202. package/dist/ui/stat.d.ts +8 -8
  203. package/dist/ui/stat.d.ts.map +1 -1
  204. package/dist/ui/stat.js +57 -71
  205. package/dist/ui/switch.cjs +4 -8
  206. package/dist/ui/switch.d.ts +1 -1
  207. package/dist/ui/switch.d.ts.map +1 -1
  208. package/dist/ui/switch.js +5 -9
  209. package/dist/utils.cjs +1 -6
  210. package/dist/utils.d.ts +2 -12
  211. package/dist/utils.d.ts.map +1 -1
  212. package/dist/utils.js +1 -4
  213. package/package.json +1 -1
package/dist/ui/stat.cjs CHANGED
@@ -5,15 +5,16 @@ let _stylexjs_stylex = require("@stylexjs/stylex");
5
5
  _stylexjs_stylex = require_runtime.__toESM(_stylexjs_stylex, 1);
6
6
  let lucide_react = require("lucide-react");
7
7
  let react_jsx_runtime = require("react/jsx-runtime");
8
- let react = require("react");
9
8
  let react_compiler_runtime = require("react/compiler-runtime");
10
9
  // src/ui/stat.tsx
11
10
  var styles = {
12
11
  root: {
13
- kmVPX3: "xjixspg",
14
- kaIpWk: "x1ez7q3a",
15
12
  kWkggS: "x1rexohn",
16
- kMwMTN: "xk0jn7w",
13
+ kaIpWk: "x1ez7q3a",
14
+ kmVPX3: "xomzojh",
15
+ kVAEAm: "x1n2onr6",
16
+ k1ekBW: "x16mfhj0",
17
+ kIyJzY: "x13dflua",
17
18
  $$css: true
18
19
  },
19
20
  bordered: {
@@ -27,39 +28,42 @@ var styles = {
27
28
  $$css: true
28
29
  },
29
30
  value: {
30
- kGuDYH: "xcg35fi",
31
- kLWn49: "x16n75kc",
32
- k63SB2: "x1xlr1w8",
33
- kb6lSQ: "x1w69ole",
34
- kMwMTN: "x84br7x",
31
+ kLWn49: "x1159mfc",
32
+ kb6lSQ: "x72az59",
35
33
  $$css: true
36
34
  },
37
35
  trend: {
38
- kGuDYH: "xkpwil5",
39
- kLWn49: "x8r4c90",
40
- k63SB2: "xk50ysn",
36
+ kGuDYH: "xboafo0",
37
+ k63SB2: "x1s688f",
38
+ kLWn49: "xo5v014",
39
+ kg3NbH: "x18a9hih",
40
+ k8WAf4: "x1dus959",
41
+ kaIpWk: "xqfady0",
41
42
  $$css: true
42
43
  },
43
44
  trendPositive: {
44
45
  kMwMTN: "x1spsc8",
46
+ kWkggS: "xnzxb0n",
45
47
  $$css: true
46
48
  },
47
49
  trendNegative: {
48
50
  kMwMTN: "xuuroe4",
51
+ kWkggS: "x1m8r3s8",
49
52
  $$css: true
50
53
  },
51
54
  trendNeutral: {
52
55
  kMwMTN: "xw3nh4a",
56
+ kWkggS: "x1qpy3fh",
53
57
  $$css: true
54
58
  },
55
59
  indicatorWrapper: {
60
+ kmuXW: "x2lah0s",
56
61
  kMwMTN: "xw3nh4a",
57
62
  $$css: true
58
63
  }
59
64
  };
60
- var Stat = (0, react.forwardRef)(({ bordered = true, sx, className, children, ...props }, ref) => {
65
+ function Stat({ bordered = true, sx, className, children, ...props }) {
61
66
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_flex.Flex, {
62
- ref,
63
67
  vertical: true,
64
68
  gap: "xs",
65
69
  "data-slot": "stat",
@@ -72,10 +76,9 @@ var Stat = (0, react.forwardRef)(({ bordered = true, sx, className, children, ..
72
76
  ...props,
73
77
  children
74
78
  });
75
- });
76
- Stat.displayName = "Stat";
77
- var StatHeader = (0, react.forwardRef)((t0, ref) => {
78
- const $ = (0, react_compiler_runtime.c)(13);
79
+ }
80
+ function StatHeader(t0) {
81
+ const $ = (0, react_compiler_runtime.c)(12);
79
82
  let children;
80
83
  let className;
81
84
  let props;
@@ -100,9 +103,8 @@ var StatHeader = (0, react.forwardRef)((t0, ref) => {
100
103
  $[6] = t1;
101
104
  } else t1 = $[6];
102
105
  let t2;
103
- if ($[7] !== children || $[8] !== className || $[9] !== props || $[10] !== ref || $[11] !== t1) {
106
+ if ($[7] !== children || $[8] !== className || $[9] !== props || $[10] !== t1) {
104
107
  t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_flex.Flex, {
105
- ref,
106
108
  align: "center",
107
109
  justify: "space-between",
108
110
  gap: "sm",
@@ -115,15 +117,13 @@ var StatHeader = (0, react.forwardRef)((t0, ref) => {
115
117
  $[7] = children;
116
118
  $[8] = className;
117
119
  $[9] = props;
118
- $[10] = ref;
119
- $[11] = t1;
120
- $[12] = t2;
121
- } else t2 = $[12];
120
+ $[10] = t1;
121
+ $[11] = t2;
122
+ } else t2 = $[11];
122
123
  return t2;
123
- });
124
- StatHeader.displayName = "StatHeader";
125
- var StatLabel = (0, react.forwardRef)((t0, ref) => {
126
- const $ = (0, react_compiler_runtime.c)(11);
124
+ }
125
+ function StatLabel(t0) {
126
+ const $ = (0, react_compiler_runtime.c)(10);
127
127
  let children;
128
128
  let className;
129
129
  let props;
@@ -142,9 +142,8 @@ var StatLabel = (0, react.forwardRef)((t0, ref) => {
142
142
  sx = $[4];
143
143
  }
144
144
  let t1;
145
- if ($[5] !== children || $[6] !== className || $[7] !== props || $[8] !== ref || $[9] !== sx) {
145
+ if ($[5] !== children || $[6] !== className || $[7] !== props || $[8] !== sx) {
146
146
  t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text.Text, {
147
- ref,
148
147
  as: "span",
149
148
  type: "secondary",
150
149
  size: "sm",
@@ -158,15 +157,13 @@ var StatLabel = (0, react.forwardRef)((t0, ref) => {
158
157
  $[5] = children;
159
158
  $[6] = className;
160
159
  $[7] = props;
161
- $[8] = ref;
162
- $[9] = sx;
163
- $[10] = t1;
164
- } else t1 = $[10];
160
+ $[8] = sx;
161
+ $[9] = t1;
162
+ } else t1 = $[9];
165
163
  return t1;
166
- });
167
- StatLabel.displayName = "StatLabel";
168
- var StatValue = (0, react.forwardRef)((t0, ref) => {
169
- const $ = (0, react_compiler_runtime.c)(13);
164
+ }
165
+ function StatValue(t0) {
166
+ const $ = (0, react_compiler_runtime.c)(12);
170
167
  let children;
171
168
  let className;
172
169
  let props;
@@ -191,9 +188,8 @@ var StatValue = (0, react.forwardRef)((t0, ref) => {
191
188
  $[6] = t1;
192
189
  } else t1 = $[6];
193
190
  let t2;
194
- if ($[7] !== children || $[8] !== className || $[9] !== props || $[10] !== ref || $[11] !== t1) {
191
+ if ($[7] !== children || $[8] !== className || $[9] !== props || $[10] !== t1) {
195
192
  t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text.Text, {
196
- ref,
197
193
  weight: "bold",
198
194
  size: "xxl",
199
195
  "data-slot": "stat-value",
@@ -205,18 +201,15 @@ var StatValue = (0, react.forwardRef)((t0, ref) => {
205
201
  $[7] = children;
206
202
  $[8] = className;
207
203
  $[9] = props;
208
- $[10] = ref;
209
- $[11] = t1;
210
- $[12] = t2;
211
- } else t2 = $[12];
204
+ $[10] = t1;
205
+ $[11] = t2;
206
+ } else t2 = $[11];
212
207
  return t2;
213
- });
214
- StatValue.displayName = "StatValue";
215
- var StatTrend = (0, react.forwardRef)(({ direction = "neutral", inverted = false, sx, className, children, ...props }, ref) => {
208
+ }
209
+ function StatTrend({ direction = "neutral", inverted = false, sx, className, children, ...props }) {
216
210
  const trendStyle = direction === "neutral" ? styles.trendNeutral : !inverted && direction === "up" || inverted && direction === "down" ? styles.trendPositive : styles.trendNegative;
217
211
  const IconComponent = direction === "up" ? lucide_react.TrendingUp : direction === "down" ? lucide_react.TrendingDown : lucide_react.Minus;
218
212
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_flex.Flex, {
219
- ref,
220
213
  inline: true,
221
214
  align: "center",
222
215
  gap: "xxs",
@@ -231,13 +224,12 @@ var StatTrend = (0, react.forwardRef)(({ direction = "neutral", inverted = false
231
224
  ...props,
232
225
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconComponent, {
233
226
  "data-slot": "stat-trend-icon",
234
- className: "xcdlrvm x1l36t39 x2lah0s"
227
+ className: "x1xvt488 xf08kfj x2lah0s"
235
228
  }), children]
236
229
  });
237
- });
238
- StatTrend.displayName = "StatTrend";
239
- var StatDescription = (0, react.forwardRef)((t0, ref) => {
240
- const $ = (0, react_compiler_runtime.c)(11);
230
+ }
231
+ function StatDescription(t0) {
232
+ const $ = (0, react_compiler_runtime.c)(10);
241
233
  let children;
242
234
  let className;
243
235
  let props;
@@ -256,9 +248,8 @@ var StatDescription = (0, react.forwardRef)((t0, ref) => {
256
248
  sx = $[4];
257
249
  }
258
250
  let t1;
259
- if ($[5] !== children || $[6] !== className || $[7] !== props || $[8] !== ref || $[9] !== sx) {
251
+ if ($[5] !== children || $[6] !== className || $[7] !== props || $[8] !== sx) {
260
252
  t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text.Text, {
261
- ref,
262
253
  as: "p",
263
254
  type: "secondary",
264
255
  size: "xs",
@@ -271,15 +262,13 @@ var StatDescription = (0, react.forwardRef)((t0, ref) => {
271
262
  $[5] = children;
272
263
  $[6] = className;
273
264
  $[7] = props;
274
- $[8] = ref;
275
- $[9] = sx;
276
- $[10] = t1;
277
- } else t1 = $[10];
265
+ $[8] = sx;
266
+ $[9] = t1;
267
+ } else t1 = $[9];
278
268
  return t1;
279
- });
280
- StatDescription.displayName = "StatDescription";
281
- var StatIndicator = (0, react.forwardRef)((t0, ref) => {
282
- const $ = (0, react_compiler_runtime.c)(13);
269
+ }
270
+ function StatIndicator(t0) {
271
+ const $ = (0, react_compiler_runtime.c)(12);
283
272
  let children;
284
273
  let className;
285
274
  let props;
@@ -304,9 +293,8 @@ var StatIndicator = (0, react.forwardRef)((t0, ref) => {
304
293
  $[6] = t1;
305
294
  } else t1 = $[6];
306
295
  let t2;
307
- if ($[7] !== children || $[8] !== className || $[9] !== props || $[10] !== ref || $[11] !== t1) {
296
+ if ($[7] !== children || $[8] !== className || $[9] !== props || $[10] !== t1) {
308
297
  t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_flex.Flex, {
309
- ref,
310
298
  align: "center",
311
299
  justify: "center",
312
300
  "data-slot": "stat-indicator",
@@ -318,13 +306,11 @@ var StatIndicator = (0, react.forwardRef)((t0, ref) => {
318
306
  $[7] = children;
319
307
  $[8] = className;
320
308
  $[9] = props;
321
- $[10] = ref;
322
- $[11] = t1;
323
- $[12] = t2;
324
- } else t2 = $[12];
309
+ $[10] = t1;
310
+ $[11] = t2;
311
+ } else t2 = $[11];
325
312
  return t2;
326
- });
327
- StatIndicator.displayName = "StatIndicator";
313
+ }
328
314
  exports.Stat = Stat;
329
315
  exports.StatDescription = StatDescription;
330
316
  exports.StatHeader = StatHeader;
package/dist/ui/stat.d.ts CHANGED
@@ -1,22 +1,22 @@
1
- import { type HTMLAttributes } from 'react';
1
+ import type { HTMLAttributes } from 'react';
2
2
  import * as stylex from '@stylexjs/stylex';
3
3
  export interface StatProps extends HTMLAttributes<HTMLDivElement> {
4
4
  bordered?: boolean;
5
5
  sx?: stylex.StyleXStyles;
6
6
  }
7
- export declare const Stat: import("react").ForwardRefExoticComponent<StatProps & import("react").RefAttributes<HTMLDivElement>>;
7
+ export declare function Stat({ bordered, sx, className, children, ...props }: StatProps): import("react").JSX.Element;
8
8
  export interface StatHeaderProps extends HTMLAttributes<HTMLDivElement> {
9
9
  sx?: stylex.StyleXStyles;
10
10
  }
11
- export declare const StatHeader: import("react").ForwardRefExoticComponent<StatHeaderProps & import("react").RefAttributes<HTMLDivElement>>;
11
+ export declare function StatHeader({ sx, className, children, ...props }: StatHeaderProps): import("react").JSX.Element;
12
12
  export interface StatLabelProps extends HTMLAttributes<HTMLSpanElement> {
13
13
  sx?: stylex.StyleXStyles;
14
14
  }
15
- export declare const StatLabel: import("react").ForwardRefExoticComponent<StatLabelProps & import("react").RefAttributes<HTMLSpanElement>>;
15
+ export declare function StatLabel({ sx, className, children, ...props }: StatLabelProps): import("react").JSX.Element;
16
16
  export interface StatValueProps extends HTMLAttributes<HTMLDivElement> {
17
17
  sx?: stylex.StyleXStyles;
18
18
  }
19
- export declare const StatValue: import("react").ForwardRefExoticComponent<StatValueProps & import("react").RefAttributes<HTMLDivElement>>;
19
+ export declare function StatValue({ sx, className, children, ...props }: StatValueProps): import("react").JSX.Element;
20
20
  export type StatTrendDirection = 'up' | 'down' | 'neutral';
21
21
  export interface StatTrendProps extends HTMLAttributes<HTMLSpanElement> {
22
22
  direction?: StatTrendDirection;
@@ -24,13 +24,13 @@ export interface StatTrendProps extends HTMLAttributes<HTMLSpanElement> {
24
24
  inverted?: boolean;
25
25
  sx?: stylex.StyleXStyles;
26
26
  }
27
- export declare const StatTrend: import("react").ForwardRefExoticComponent<StatTrendProps & import("react").RefAttributes<HTMLSpanElement>>;
27
+ export declare function StatTrend({ direction, inverted, sx, className, children, ...props }: StatTrendProps): import("react").JSX.Element;
28
28
  export interface StatDescriptionProps extends HTMLAttributes<HTMLParagraphElement> {
29
29
  sx?: stylex.StyleXStyles;
30
30
  }
31
- export declare const StatDescription: import("react").ForwardRefExoticComponent<StatDescriptionProps & import("react").RefAttributes<HTMLParagraphElement>>;
31
+ export declare function StatDescription({ sx, className, children, ...props }: StatDescriptionProps): import("react").JSX.Element;
32
32
  export interface StatIndicatorProps extends HTMLAttributes<HTMLDivElement> {
33
33
  sx?: stylex.StyleXStyles;
34
34
  }
35
- export declare const StatIndicator: import("react").ForwardRefExoticComponent<StatIndicatorProps & import("react").RefAttributes<HTMLDivElement>>;
35
+ export declare function StatIndicator({ sx, className, children, ...props }: StatIndicatorProps): import("react").JSX.Element;
36
36
  //# sourceMappingURL=stat.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"stat.d.ts","sourceRoot":"","sources":["../../src/ui/stat.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAoD3C,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,cAAc,CAAC;IAC/D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC;CAC1B;AAED,eAAO,MAAM,IAAI,sGAgBhB,CAAC;AAGF,MAAM,WAAW,eAAgB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACrE,EAAE,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC;CAC1B;AAED,eAAO,MAAM,UAAU,4GAiBtB,CAAC;AAGF,MAAM,WAAW,cAAe,SAAQ,cAAc,CAAC,eAAe,CAAC;IACrE,EAAE,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC;CAC1B;AAED,eAAO,MAAM,SAAS,4GAkBrB,CAAC;AAGF,MAAM,WAAW,cAAe,SAAQ,cAAc,CAAC,cAAc,CAAC;IACpE,EAAE,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC;CAC1B;AAED,eAAO,MAAM,SAAS,2GAgBrB,CAAC;AAGF,MAAM,MAAM,kBAAkB,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,CAAC;AAE3D,MAAM,WAAW,cAAe,SAAQ,cAAc,CAAC,eAAe,CAAC;IACrE,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B,yGAAyG;IACzG,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC;CAC1B;AAED,eAAO,MAAM,SAAS,4GA+BrB,CAAC;AAGF,MAAM,WAAW,oBAAqB,SAAQ,cAAc,CAAC,oBAAoB,CAAC;IAChF,EAAE,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC;CAC1B;AAED,eAAO,MAAM,eAAe,uHAiB3B,CAAC;AAGF,MAAM,WAAW,kBAAmB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACxE,EAAE,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC;CAC1B;AAED,eAAO,MAAM,aAAa,+GAgBzB,CAAC"}
1
+ {"version":3,"file":"stat.d.ts","sourceRoot":"","sources":["../../src/ui/stat.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AA0D3C,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,cAAc,CAAC;IAC/D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC;CAC1B;AAED,wBAAgB,IAAI,CAAC,EAAE,QAAe,EAAE,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,+BAarF;AAED,MAAM,WAAW,eAAgB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACrE,EAAE,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC;CAC1B;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,+BAchF;AAED,MAAM,WAAW,cAAe,SAAQ,cAAc,CAAC,eAAe,CAAC;IACrE,EAAE,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC;CAC1B;AAED,wBAAgB,SAAS,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,+BAe9E;AAED,MAAM,WAAW,cAAe,SAAQ,cAAc,CAAC,cAAc,CAAC;IACpE,EAAE,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC;CAC1B;AAED,wBAAgB,SAAS,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,+BAa9E;AAED,MAAM,MAAM,kBAAkB,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,CAAC;AAE3D,MAAM,WAAW,cAAe,SAAQ,cAAc,CAAC,eAAe,CAAC;IACrE,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B,yGAAyG;IACzG,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC;CAC1B;AAED,wBAAgB,SAAS,CAAC,EACxB,SAAqB,EACrB,QAAgB,EAChB,EAAE,EACF,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,+BA4BhB;AAED,MAAM,WAAW,oBAAqB,SAAQ,cAAc,CAAC,oBAAoB,CAAC;IAChF,EAAE,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC;CAC1B;AAED,wBAAgB,eAAe,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,oBAAoB,+BAc1F;AAED,MAAM,WAAW,kBAAmB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACxE,EAAE,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC;CAC1B;AAED,wBAAgB,aAAa,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,kBAAkB,+BAatF"}
package/dist/ui/stat.js CHANGED
@@ -3,15 +3,16 @@ import { Flex } from "./flex.js";
3
3
  import "@stylexjs/stylex";
4
4
  import { Minus, TrendingDown, TrendingUp } from "lucide-react";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
- import { forwardRef } from "react";
7
6
  import { c } from "react/compiler-runtime";
8
7
  // src/ui/stat.tsx
9
8
  var styles = {
10
9
  root: {
11
- kmVPX3: "xjixspg",
12
- kaIpWk: "x1ez7q3a",
13
10
  kWkggS: "x1rexohn",
14
- kMwMTN: "xk0jn7w",
11
+ kaIpWk: "x1ez7q3a",
12
+ kmVPX3: "xomzojh",
13
+ kVAEAm: "x1n2onr6",
14
+ k1ekBW: "x16mfhj0",
15
+ kIyJzY: "x13dflua",
15
16
  $$css: true
16
17
  },
17
18
  bordered: {
@@ -25,39 +26,42 @@ var styles = {
25
26
  $$css: true
26
27
  },
27
28
  value: {
28
- kGuDYH: "xcg35fi",
29
- kLWn49: "x16n75kc",
30
- k63SB2: "x1xlr1w8",
31
- kb6lSQ: "x1w69ole",
32
- kMwMTN: "x84br7x",
29
+ kLWn49: "x1159mfc",
30
+ kb6lSQ: "x72az59",
33
31
  $$css: true
34
32
  },
35
33
  trend: {
36
- kGuDYH: "xkpwil5",
37
- kLWn49: "x8r4c90",
38
- k63SB2: "xk50ysn",
34
+ kGuDYH: "xboafo0",
35
+ k63SB2: "x1s688f",
36
+ kLWn49: "xo5v014",
37
+ kg3NbH: "x18a9hih",
38
+ k8WAf4: "x1dus959",
39
+ kaIpWk: "xqfady0",
39
40
  $$css: true
40
41
  },
41
42
  trendPositive: {
42
43
  kMwMTN: "x1spsc8",
44
+ kWkggS: "xnzxb0n",
43
45
  $$css: true
44
46
  },
45
47
  trendNegative: {
46
48
  kMwMTN: "xuuroe4",
49
+ kWkggS: "x1m8r3s8",
47
50
  $$css: true
48
51
  },
49
52
  trendNeutral: {
50
53
  kMwMTN: "xw3nh4a",
54
+ kWkggS: "x1qpy3fh",
51
55
  $$css: true
52
56
  },
53
57
  indicatorWrapper: {
58
+ kmuXW: "x2lah0s",
54
59
  kMwMTN: "xw3nh4a",
55
60
  $$css: true
56
61
  }
57
62
  };
58
- var Stat = forwardRef(({ bordered = true, sx, className, children, ...props }, ref) => {
63
+ function Stat({ bordered = true, sx, className, children, ...props }) {
59
64
  return /* @__PURE__ */ jsx(Flex, {
60
- ref,
61
65
  vertical: true,
62
66
  gap: "xs",
63
67
  "data-slot": "stat",
@@ -70,10 +74,9 @@ var Stat = forwardRef(({ bordered = true, sx, className, children, ...props }, r
70
74
  ...props,
71
75
  children
72
76
  });
73
- });
74
- Stat.displayName = "Stat";
75
- var StatHeader = forwardRef((t0, ref) => {
76
- const $ = c(13);
77
+ }
78
+ function StatHeader(t0) {
79
+ const $ = c(12);
77
80
  let children;
78
81
  let className;
79
82
  let props;
@@ -98,9 +101,8 @@ var StatHeader = forwardRef((t0, ref) => {
98
101
  $[6] = t1;
99
102
  } else t1 = $[6];
100
103
  let t2;
101
- if ($[7] !== children || $[8] !== className || $[9] !== props || $[10] !== ref || $[11] !== t1) {
104
+ if ($[7] !== children || $[8] !== className || $[9] !== props || $[10] !== t1) {
102
105
  t2 = /* @__PURE__ */ jsx(Flex, {
103
- ref,
104
106
  align: "center",
105
107
  justify: "space-between",
106
108
  gap: "sm",
@@ -113,15 +115,13 @@ var StatHeader = forwardRef((t0, ref) => {
113
115
  $[7] = children;
114
116
  $[8] = className;
115
117
  $[9] = props;
116
- $[10] = ref;
117
- $[11] = t1;
118
- $[12] = t2;
119
- } else t2 = $[12];
118
+ $[10] = t1;
119
+ $[11] = t2;
120
+ } else t2 = $[11];
120
121
  return t2;
121
- });
122
- StatHeader.displayName = "StatHeader";
123
- var StatLabel = forwardRef((t0, ref) => {
124
- const $ = c(11);
122
+ }
123
+ function StatLabel(t0) {
124
+ const $ = c(10);
125
125
  let children;
126
126
  let className;
127
127
  let props;
@@ -140,9 +140,8 @@ var StatLabel = forwardRef((t0, ref) => {
140
140
  sx = $[4];
141
141
  }
142
142
  let t1;
143
- if ($[5] !== children || $[6] !== className || $[7] !== props || $[8] !== ref || $[9] !== sx) {
143
+ if ($[5] !== children || $[6] !== className || $[7] !== props || $[8] !== sx) {
144
144
  t1 = /* @__PURE__ */ jsx(Text, {
145
- ref,
146
145
  as: "span",
147
146
  type: "secondary",
148
147
  size: "sm",
@@ -156,15 +155,13 @@ var StatLabel = forwardRef((t0, ref) => {
156
155
  $[5] = children;
157
156
  $[6] = className;
158
157
  $[7] = props;
159
- $[8] = ref;
160
- $[9] = sx;
161
- $[10] = t1;
162
- } else t1 = $[10];
158
+ $[8] = sx;
159
+ $[9] = t1;
160
+ } else t1 = $[9];
163
161
  return t1;
164
- });
165
- StatLabel.displayName = "StatLabel";
166
- var StatValue = forwardRef((t0, ref) => {
167
- const $ = c(13);
162
+ }
163
+ function StatValue(t0) {
164
+ const $ = c(12);
168
165
  let children;
169
166
  let className;
170
167
  let props;
@@ -189,9 +186,8 @@ var StatValue = forwardRef((t0, ref) => {
189
186
  $[6] = t1;
190
187
  } else t1 = $[6];
191
188
  let t2;
192
- if ($[7] !== children || $[8] !== className || $[9] !== props || $[10] !== ref || $[11] !== t1) {
189
+ if ($[7] !== children || $[8] !== className || $[9] !== props || $[10] !== t1) {
193
190
  t2 = /* @__PURE__ */ jsx(Text, {
194
- ref,
195
191
  weight: "bold",
196
192
  size: "xxl",
197
193
  "data-slot": "stat-value",
@@ -203,18 +199,15 @@ var StatValue = forwardRef((t0, ref) => {
203
199
  $[7] = children;
204
200
  $[8] = className;
205
201
  $[9] = props;
206
- $[10] = ref;
207
- $[11] = t1;
208
- $[12] = t2;
209
- } else t2 = $[12];
202
+ $[10] = t1;
203
+ $[11] = t2;
204
+ } else t2 = $[11];
210
205
  return t2;
211
- });
212
- StatValue.displayName = "StatValue";
213
- var StatTrend = forwardRef(({ direction = "neutral", inverted = false, sx, className, children, ...props }, ref) => {
206
+ }
207
+ function StatTrend({ direction = "neutral", inverted = false, sx, className, children, ...props }) {
214
208
  const trendStyle = direction === "neutral" ? styles.trendNeutral : !inverted && direction === "up" || inverted && direction === "down" ? styles.trendPositive : styles.trendNegative;
215
209
  const IconComponent = direction === "up" ? TrendingUp : direction === "down" ? TrendingDown : Minus;
216
210
  return /* @__PURE__ */ jsxs(Flex, {
217
- ref,
218
211
  inline: true,
219
212
  align: "center",
220
213
  gap: "xxs",
@@ -229,13 +222,12 @@ var StatTrend = forwardRef(({ direction = "neutral", inverted = false, sx, class
229
222
  ...props,
230
223
  children: [/* @__PURE__ */ jsx(IconComponent, {
231
224
  "data-slot": "stat-trend-icon",
232
- className: "xcdlrvm x1l36t39 x2lah0s"
225
+ className: "x1xvt488 xf08kfj x2lah0s"
233
226
  }), children]
234
227
  });
235
- });
236
- StatTrend.displayName = "StatTrend";
237
- var StatDescription = forwardRef((t0, ref) => {
238
- const $ = c(11);
228
+ }
229
+ function StatDescription(t0) {
230
+ const $ = c(10);
239
231
  let children;
240
232
  let className;
241
233
  let props;
@@ -254,9 +246,8 @@ var StatDescription = forwardRef((t0, ref) => {
254
246
  sx = $[4];
255
247
  }
256
248
  let t1;
257
- if ($[5] !== children || $[6] !== className || $[7] !== props || $[8] !== ref || $[9] !== sx) {
249
+ if ($[5] !== children || $[6] !== className || $[7] !== props || $[8] !== sx) {
258
250
  t1 = /* @__PURE__ */ jsx(Text, {
259
- ref,
260
251
  as: "p",
261
252
  type: "secondary",
262
253
  size: "xs",
@@ -269,15 +260,13 @@ var StatDescription = forwardRef((t0, ref) => {
269
260
  $[5] = children;
270
261
  $[6] = className;
271
262
  $[7] = props;
272
- $[8] = ref;
273
- $[9] = sx;
274
- $[10] = t1;
275
- } else t1 = $[10];
263
+ $[8] = sx;
264
+ $[9] = t1;
265
+ } else t1 = $[9];
276
266
  return t1;
277
- });
278
- StatDescription.displayName = "StatDescription";
279
- var StatIndicator = forwardRef((t0, ref) => {
280
- const $ = c(13);
267
+ }
268
+ function StatIndicator(t0) {
269
+ const $ = c(12);
281
270
  let children;
282
271
  let className;
283
272
  let props;
@@ -302,9 +291,8 @@ var StatIndicator = forwardRef((t0, ref) => {
302
291
  $[6] = t1;
303
292
  } else t1 = $[6];
304
293
  let t2;
305
- if ($[7] !== children || $[8] !== className || $[9] !== props || $[10] !== ref || $[11] !== t1) {
294
+ if ($[7] !== children || $[8] !== className || $[9] !== props || $[10] !== t1) {
306
295
  t2 = /* @__PURE__ */ jsx(Flex, {
307
- ref,
308
296
  align: "center",
309
297
  justify: "center",
310
298
  "data-slot": "stat-indicator",
@@ -316,11 +304,9 @@ var StatIndicator = forwardRef((t0, ref) => {
316
304
  $[7] = children;
317
305
  $[8] = className;
318
306
  $[9] = props;
319
- $[10] = ref;
320
- $[11] = t1;
321
- $[12] = t2;
322
- } else t2 = $[12];
307
+ $[10] = t1;
308
+ $[11] = t2;
309
+ } else t2 = $[11];
323
310
  return t2;
324
- });
325
- StatIndicator.displayName = "StatIndicator";
311
+ }
326
312
  export { Stat, StatDescription, StatHeader, StatIndicator, StatLabel, StatTrend, StatValue };
@@ -169,15 +169,11 @@ var thumbCheckedStyles = {
169
169
  xl: styles.thumbCheckedXl,
170
170
  xxl: styles.thumbCheckedXxl
171
171
  };
172
- function Switch({ className, size = "md", checked: controlledChecked, defaultChecked = false, onCheckedChange, disabled, sx, ...props }) {
173
- const isControlled = controlledChecked !== void 0;
174
- const [uncontrolledChecked, setUncontrolledChecked] = (0, react.useState)(defaultChecked);
175
- const isChecked = isControlled ? Boolean(controlledChecked) : uncontrolledChecked;
176
- (0, react.useEffect)(() => {
177
- if (!isControlled && defaultChecked !== void 0) setUncontrolledChecked(defaultChecked);
178
- }, [defaultChecked, isControlled]);
172
+ function Switch({ className, size = "md", checked, defaultChecked = false, onCheckedChange, disabled, sx, ...props }) {
173
+ const [internalChecked, setInternalChecked] = (0, react.useState)(defaultChecked);
174
+ const isChecked = checked !== void 0 ? Boolean(checked) : internalChecked;
179
175
  const handleCheckedChange = (nextChecked) => {
180
- if (!isControlled) setUncontrolledChecked(nextChecked);
176
+ if (checked === void 0) setInternalChecked(nextChecked);
181
177
  onCheckedChange?.(nextChecked);
182
178
  };
183
179
  const rootSize = rootSizeStyles[size] ?? styles.rootMd;
@@ -7,6 +7,6 @@ export interface SwitchProps extends ComponentProps<typeof SwitchPrimitiveRoot>
7
7
  size?: ComponentSize;
8
8
  sx?: stylex.StyleXStyles;
9
9
  }
10
- declare function Switch({ className, size, checked: controlledChecked, defaultChecked, onCheckedChange, disabled, sx, ...props }: SwitchProps): import("react").JSX.Element;
10
+ declare function Switch({ className, size, checked, defaultChecked, onCheckedChange, disabled, sx, ...props }: SwitchProps): import("react").JSX.Element;
11
11
  export { Switch };
12
12
  //# sourceMappingURL=switch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../src/ui/switch.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,EAAE,IAAI,IAAI,mBAAmB,EAAiC,MAAM,wBAAwB,CAAC;AACpG,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAE3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AA6JpD,MAAM,WAAW,WAAY,SAAQ,cAAc,CAAC,OAAO,mBAAmB,CAAC;IAC7E,yDAAyD;IACzD,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,EAAE,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC;CAC1B;AAED,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,IAAW,EACX,OAAO,EAAE,iBAAiB,EAC1B,cAAsB,EACtB,eAAe,EACf,QAAQ,EACR,EAAE,EACF,GAAG,KAAK,EACT,EAAE,WAAW,+BAuCb;AAED,OAAO,EAAE,MAAM,EAAE,CAAC"}
1
+ {"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../src/ui/switch.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,IAAI,IAAI,mBAAmB,EAAiC,MAAM,wBAAwB,CAAC;AACpG,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAE3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AA6JpD,MAAM,WAAW,WAAY,SAAQ,cAAc,CAAC,OAAO,mBAAmB,CAAC;IAC7E,yDAAyD;IACzD,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,EAAE,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC;CAC1B;AAED,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,IAAW,EACX,OAAO,EACP,cAAsB,EACtB,eAAe,EACf,QAAQ,EACR,EAAE,EACF,GAAG,KAAK,EACT,EAAE,WAAW,+BAgCb;AAED,OAAO,EAAE,MAAM,EAAE,CAAC"}
package/dist/ui/switch.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Root as Switch$1, SwitchThumb } from "../node_modules/.pnpm/@radix-ui_react-switch@1.3.7_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@_f8723a7bd506c0f648804ec2dc0f18e3/node_modules/@radix-ui/react-switch/dist/index.js";
2
2
  import * as stylex from "@stylexjs/stylex";
3
3
  import { jsx } from "react/jsx-runtime";
4
- import { useEffect, useState } from "react";
4
+ import { useState } from "react";
5
5
  // src/ui/switch.tsx
6
6
  var styles = {
7
7
  root: {
@@ -167,15 +167,11 @@ var thumbCheckedStyles = {
167
167
  xl: styles.thumbCheckedXl,
168
168
  xxl: styles.thumbCheckedXxl
169
169
  };
170
- function Switch({ className, size = "md", checked: controlledChecked, defaultChecked = false, onCheckedChange, disabled, sx, ...props }) {
171
- const isControlled = controlledChecked !== void 0;
172
- const [uncontrolledChecked, setUncontrolledChecked] = useState(defaultChecked);
173
- const isChecked = isControlled ? Boolean(controlledChecked) : uncontrolledChecked;
174
- useEffect(() => {
175
- if (!isControlled && defaultChecked !== void 0) setUncontrolledChecked(defaultChecked);
176
- }, [defaultChecked, isControlled]);
170
+ function Switch({ className, size = "md", checked, defaultChecked = false, onCheckedChange, disabled, sx, ...props }) {
171
+ const [internalChecked, setInternalChecked] = useState(defaultChecked);
172
+ const isChecked = checked !== void 0 ? Boolean(checked) : internalChecked;
177
173
  const handleCheckedChange = (nextChecked) => {
178
- if (!isControlled) setUncontrolledChecked(nextChecked);
174
+ if (checked === void 0) setInternalChecked(nextChecked);
179
175
  onCheckedChange?.(nextChecked);
180
176
  };
181
177
  const rootSize = rootSizeStyles[size] ?? styles.rootMd;
package/dist/utils.cjs CHANGED
@@ -1,9 +1,4 @@
1
- const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
2
- let _stylexjs_stylex = require("@stylexjs/stylex");
3
- _stylexjs_stylex = require_runtime.__toESM(_stylexjs_stylex, 1);
4
1
  let clsx = require("clsx");
5
2
  // src/utils.ts
6
- function cn(...inputs) {
7
- return (0, clsx.clsx)(inputs);
8
- }
3
+ var cn = (...inputs) => (0, clsx.clsx)(inputs);
9
4
  exports.cn = cn;