@locus-ui/components 0.0.12 → 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -19,13 +19,20 @@ function getComponentProps(props, ...propDefs) {
19
19
  const prop = allProps[key];
20
20
  const value = _optionalChain([props, 'optionalAccess', _2 => _2[key]]);
21
21
  delete restProps[key];
22
- if (prop.type === "boolean" || prop.type === "string" || prop.type === "value | array" || prop.type === "reactNode" || prop.type === "function") {
22
+ if (prop.type === "boolean" || prop.type === "string" || prop.type === "number" || prop.type === "value | array" || prop.type === "reactNode" || prop.type === "function") {
23
23
  extractedProps[key] = value;
24
- if (prop.cssProperty && value !== void 0 && value !== null) {
25
- style = {
26
- ...style,
27
- [prop.cssProperty]: prop.type === "boolean" ? value ? "1" : "0" : value
28
- };
24
+ if (prop.cssProperty) {
25
+ if (value !== void 0 && value !== null) {
26
+ style = {
27
+ ...style,
28
+ [prop.cssProperty]: prop.type === "boolean" ? value ? "1" : "0" : value
29
+ };
30
+ } else if (prop.default !== void 0) {
31
+ style = {
32
+ ...style,
33
+ [prop.cssProperty]: prop.type === "boolean" ? prop.default ? "1" : "0" : prop.default
34
+ };
35
+ }
29
36
  }
30
37
  if (prop.dataAttr) {
31
38
  if (value) dataAttrs[`data-${prop.dataAttr}`] = value;
@@ -41,13 +48,14 @@ function getComponentProps(props, ...propDefs) {
41
48
  if (propValue !== null && propValue !== void 0) {
42
49
  if (!breakpoint) extractedProps[key] = propValue;
43
50
  if (!prop.values.includes(propValue)) {
51
+ const transformedValue = "transform" in prop && prop.transform ? prop.transform(propValue) : propValue;
44
52
  if (prop.className) {
45
53
  classNames.push(
46
54
  breakpoint ? `${prop.className}-${breakpoint}` : prop.className
47
55
  );
48
56
  style = {
49
57
  ...style,
50
- [`--custom-${key}${usedBreakpoint}`]: propValue
58
+ [`--custom-${key}${usedBreakpoint}`]: transformedValue
51
59
  };
52
60
  }
53
61
  if (prop.dataAttr) {
@@ -86,7 +94,7 @@ function getComponentProps(props, ...propDefs) {
86
94
  }
87
95
 
88
96
  // src/components/accordion/accordion-context.ts
89
- var _react = require('react'); var React2 = _interopRequireWildcard(_react); var React4 = _interopRequireWildcard(_react); var React5 = _interopRequireWildcard(_react); var React11 = _interopRequireWildcard(_react); var React13 = _interopRequireWildcard(_react); var React12 = _interopRequireWildcard(_react); var React16 = _interopRequireWildcard(_react); var React14 = _interopRequireWildcard(_react); var React15 = _interopRequireWildcard(_react); var React18 = _interopRequireWildcard(_react); var React17 = _interopRequireWildcard(_react); var React22 = _interopRequireWildcard(_react); var React19 = _interopRequireWildcard(_react); var React20 = _interopRequireWildcard(_react); var React21 = _interopRequireWildcard(_react); var React23 = _interopRequireWildcard(_react); var React24 = _interopRequireWildcard(_react); var React25 = _interopRequireWildcard(_react); var React27 = _interopRequireWildcard(_react); var React26 = _interopRequireWildcard(_react); var React28 = _interopRequireWildcard(_react); var React29 = _interopRequireWildcard(_react);
97
+ var _react = require('react'); var React2 = _interopRequireWildcard(_react); var React4 = _interopRequireWildcard(_react); var React5 = _interopRequireWildcard(_react); var React11 = _interopRequireWildcard(_react); var React12 = _interopRequireWildcard(_react); var React14 = _interopRequireWildcard(_react); var React13 = _interopRequireWildcard(_react); var React17 = _interopRequireWildcard(_react); var React15 = _interopRequireWildcard(_react); var React16 = _interopRequireWildcard(_react); var React19 = _interopRequireWildcard(_react); var React18 = _interopRequireWildcard(_react); var React25 = _interopRequireWildcard(_react); var React22 = _interopRequireWildcard(_react); var React23 = _interopRequireWildcard(_react); var React24 = _interopRequireWildcard(_react); var React26 = _interopRequireWildcard(_react); var React27 = _interopRequireWildcard(_react); var React28 = _interopRequireWildcard(_react); var React30 = _interopRequireWildcard(_react); var React29 = _interopRequireWildcard(_react); var React31 = _interopRequireWildcard(_react); var React36 = _interopRequireWildcard(_react);
90
98
  var AccordionContext = React2.default.createContext(null);
91
99
  function useAccordionContext() {
92
100
  const context = React2.default.useContext(AccordionContext);
@@ -322,6 +330,60 @@ var AlignPropDef = {
322
330
  }
323
331
  };
324
332
 
333
+ // src/utils/parse-color.ts
334
+ function parseColor(value) {
335
+ const trimmed = value.trim();
336
+ const hexMatch = trimmed.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i);
337
+ if (hexMatch) {
338
+ let hex = hexMatch[1];
339
+ if (hex.length === 3) {
340
+ hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
341
+ }
342
+ const r = parseInt(hex.slice(0, 2), 16);
343
+ const g = parseInt(hex.slice(2, 4), 16);
344
+ const b = parseInt(hex.slice(4, 6), 16);
345
+ return `${r}, ${g}, ${b}`;
346
+ }
347
+ const rgbMatch = trimmed.match(
348
+ /^rgba?\(\s*(\d{1,3})\s*[,\s]\s*(\d{1,3})\s*[,\s]\s*(\d{1,3})\s*(?:[,/]\s*[\d.]+%?\s*)?\)$/
349
+ );
350
+ if (rgbMatch) {
351
+ return `${rgbMatch[1]}, ${rgbMatch[2]}, ${rgbMatch[3]}`;
352
+ }
353
+ return trimmed;
354
+ }
355
+
356
+ // src/props/color.prop.ts
357
+ var Colors = [
358
+ "primary",
359
+ "secondary",
360
+ "tertiary",
361
+ "accent",
362
+ "success",
363
+ "warning",
364
+ "danger",
365
+ "info"
366
+ ];
367
+ var ColorPropDef = {
368
+ /**
369
+ * Sets the color of the component.
370
+ *
371
+ * Uses predefined theme colors ("primary", "secondary", etc.) or accepts custom color values in hex, rgb, or raw rgb formats.
372
+ *
373
+ * @example color="primary" // primary color
374
+ * @example color="#7BEB34" // hex color
375
+ * @example color="rgb(125, 235, 52)" // rgb color
376
+ * @example color="125, 235, 52" // raw rgb values
377
+ */
378
+ color: {
379
+ type: "enum | string",
380
+ values: Colors,
381
+ dataAttr: "color",
382
+ className: "color",
383
+ transform: parseColor
384
+ }
385
+ };
386
+
325
387
  // src/props/margin.prop.ts
326
388
  var marginValues = [
327
389
  "auto",
@@ -1112,6 +1174,7 @@ var Button = (props) => {
1112
1174
  } = getComponentProps(
1113
1175
  props,
1114
1176
  ButtonRootPropsDefs,
1177
+ ColorPropDef,
1115
1178
  MarginPropDefs,
1116
1179
  PaddingPropDefs,
1117
1180
  RadiusPropDefs,
@@ -1414,18 +1477,10 @@ var Text = React2.default.forwardRef(
1414
1477
  props,
1415
1478
  TextPropsDefs,
1416
1479
  MarginPropDefs,
1417
- PaddingPropDefs
1418
- );
1419
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1420
- "p",
1421
- {
1422
- ref,
1423
- ...dataAttrs,
1424
- className: _clsx2.default.call(void 0, "lcs-text", className),
1425
- ...rest,
1426
- children
1427
- }
1480
+ PaddingPropDefs,
1481
+ ColorPropDef
1428
1482
  );
1483
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { ref, ...dataAttrs, className: _clsx2.default.call(void 0, "text", className), ...rest, children });
1429
1484
  }
1430
1485
  );
1431
1486
 
@@ -1616,17 +1671,71 @@ var Container = React11.forwardRef((props, ref) => {
1616
1671
  });
1617
1672
  Container.displayName = "Container";
1618
1673
 
1674
+ // src/components/panel/panel.tsx
1675
+
1676
+
1677
+
1678
+ // src/components/panel/panel.props.ts
1679
+ var PanelVariants = ["solid", "outlined", "muted"];
1680
+ var PanelPropsDefs = {
1681
+ /**
1682
+ * Sets the variant style of the panel ("solid", "outlined", or "muted").
1683
+ */
1684
+ variant: {
1685
+ type: "enum",
1686
+ values: PanelVariants,
1687
+ dataAttr: "variant"
1688
+ },
1689
+ /**
1690
+ * The blur amount applied to the panel.
1691
+ *
1692
+ * @example blur="4px" // Sets the backdrop blur to 4 pixels
1693
+ * @default "2px"
1694
+ */
1695
+ blur: {
1696
+ type: "string",
1697
+ default: "2px",
1698
+ cssProperty: "--panel-blur"
1699
+ }
1700
+ };
1701
+
1702
+ // src/components/panel/panel.tsx
1703
+
1704
+ var Panel = React12.forwardRef((props, ref) => {
1705
+ const { className, dataAttrs, children, ...rest } = getComponentProps(
1706
+ props,
1707
+ PanelPropsDefs,
1708
+ MarginPropDefs,
1709
+ PaddingPropDefs,
1710
+ SpacingPropDef,
1711
+ RadiusPropDefs,
1712
+ RoundnessPropDef,
1713
+ ColorPropDef
1714
+ );
1715
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1716
+ "div",
1717
+ {
1718
+ ref,
1719
+ className: _clsx2.default.call(void 0, "panel", className),
1720
+ ...dataAttrs,
1721
+ ...rest,
1722
+ children
1723
+ }
1724
+ );
1725
+ });
1726
+ Panel.displayName = "Panel";
1727
+
1619
1728
  // src/components/portal/backdrop/portal-backdrop.tsx
1620
1729
 
1621
1730
 
1622
1731
 
1623
1732
  // src/components/portal/portal-context.tsx
1624
1733
 
1625
- var PortalContext = React12.createContext(
1734
+ var PortalContext = React13.createContext(
1626
1735
  void 0
1627
1736
  );
1628
1737
  function usePortalContext() {
1629
- const context = React12.useContext(PortalContext);
1738
+ const context = React13.useContext(PortalContext);
1630
1739
  if (!context) {
1631
1740
  throw new Error("`usePortalContext` must be used within a `Portal.Root`");
1632
1741
  }
@@ -1674,7 +1783,7 @@ var PortalBackdropPropsDefs = {
1674
1783
 
1675
1784
  // src/components/portal/backdrop/portal-backdrop.tsx
1676
1785
 
1677
- var PortalBackdrop = React13.forwardRef(
1786
+ var PortalBackdrop = React14.forwardRef(
1678
1787
  (props, ref) => {
1679
1788
  const context = usePortalContext();
1680
1789
  const { className, dataAttrs, ...rest } = getComponentProps(
@@ -1702,11 +1811,11 @@ var _reactdom = require('react-dom'); var _reactdom2 = _interopRequireDefault(_r
1702
1811
 
1703
1812
  // src/components/theme/theme-context.tsx
1704
1813
 
1705
- var ThemeContext = React14.createContext(
1814
+ var ThemeContext = React15.createContext(
1706
1815
  void 0
1707
1816
  );
1708
1817
  function useTheme() {
1709
- const context = React14.useContext(ThemeContext);
1818
+ const context = React15.useContext(ThemeContext);
1710
1819
  if (!context) {
1711
1820
  throw new Error("`useTheme` must be used within a `Theme`");
1712
1821
  }
@@ -1724,9 +1833,9 @@ function useAnchorPosition({
1724
1833
  alignOffset = 0,
1725
1834
  enabled = true
1726
1835
  }) {
1727
- const [position, setPosition] = React15.useState(null);
1728
- const [, _forceUpdate] = React15.useReducer((x) => x + 1, 0);
1729
- const updatePosition = React15.useCallback(() => {
1836
+ const [position, setPosition] = React16.useState(null);
1837
+ const [, _forceUpdate] = React16.useReducer((x) => x + 1, 0);
1838
+ const updatePosition = React16.useCallback(() => {
1730
1839
  const anchor = anchorRef.current;
1731
1840
  const content = contentRef.current;
1732
1841
  if (!anchor || !content || !enabled) {
@@ -1787,7 +1896,7 @@ function useAnchorPosition({
1787
1896
  );
1788
1897
  setPosition({ top, left });
1789
1898
  }, [anchorRef, contentRef, side, align, sideOffset, alignOffset, enabled]);
1790
- React15.useEffect(() => {
1899
+ React16.useEffect(() => {
1791
1900
  if (!enabled) {
1792
1901
  setPosition(null);
1793
1902
  return;
@@ -1869,11 +1978,11 @@ var PortalContentPropsDefs = {
1869
1978
 
1870
1979
  // src/components/portal/content/portal-content.tsx
1871
1980
 
1872
- var PortalContent = React16.forwardRef(
1981
+ var PortalContent = React17.forwardRef(
1873
1982
  (props, ref) => {
1874
1983
  const portalContext = usePortalContext();
1875
- const themeContext = React16.useContext(ThemeContext);
1876
- const contentRef = React16.useRef(null);
1984
+ const themeContext = React17.useContext(ThemeContext);
1985
+ const contentRef = React17.useRef(null);
1877
1986
  const {
1878
1987
  side = "bottom",
1879
1988
  align = "center",
@@ -1895,7 +2004,7 @@ var PortalContent = React16.forwardRef(
1895
2004
  alignOffset: parseInt(alignOffset, 10) || 0,
1896
2005
  enabled: anchored && portalContext.open
1897
2006
  });
1898
- const setRefs = React16.useCallback(
2007
+ const setRefs = React17.useCallback(
1899
2008
  (node) => {
1900
2009
  contentRef.current = node;
1901
2010
  if (typeof ref === "function") {
@@ -1906,7 +2015,7 @@ var PortalContent = React16.forwardRef(
1906
2015
  },
1907
2016
  [ref]
1908
2017
  );
1909
- React16.useEffect(() => {
2018
+ React17.useEffect(() => {
1910
2019
  if (!portalContext.open) return;
1911
2020
  function onKeyDown(e) {
1912
2021
  if (e.key === "Escape") {
@@ -1918,7 +2027,7 @@ var PortalContent = React16.forwardRef(
1918
2027
  document.removeEventListener("keydown", onKeyDown);
1919
2028
  };
1920
2029
  }, [portalContext.open, portalContext.onOpenChange]);
1921
- React16.useEffect(() => {
2030
+ React17.useEffect(() => {
1922
2031
  if (!portalContext.open || !anchored) return;
1923
2032
  function onClickOutside(e) {
1924
2033
  const target = e.target;
@@ -1990,11 +2099,11 @@ PortalContent.displayName = "Portal.Content";
1990
2099
  // src/components/portal/trigger/portal-trigger.tsx
1991
2100
 
1992
2101
 
1993
- var PortalTrigger = React17.forwardRef(
2102
+ var PortalTrigger = React18.forwardRef(
1994
2103
  ({ children, asChild, onClick, ...props }, ref) => {
1995
2104
  const context = usePortalContext();
1996
- const internalRef = React17.useRef(null);
1997
- React17.useEffect(() => {
2105
+ const internalRef = React18.useRef(null);
2106
+ React18.useEffect(() => {
1998
2107
  if (internalRef.current) {
1999
2108
  context.triggerRef.current = internalRef.current;
2000
2109
  }
@@ -2003,7 +2112,7 @@ var PortalTrigger = React17.forwardRef(
2003
2112
  _optionalChain([context, 'access', _33 => _33.onOpenChange, 'optionalCall', _34 => _34(!context.open)]);
2004
2113
  _optionalChain([onClick, 'optionalCall', _35 => _35(event)]);
2005
2114
  };
2006
- const setRefs = React17.useCallback(
2115
+ const setRefs = React18.useCallback(
2007
2116
  (node) => {
2008
2117
  internalRef.current = node;
2009
2118
  if (typeof ref === "function") {
@@ -2015,8 +2124,8 @@ var PortalTrigger = React17.forwardRef(
2015
2124
  },
2016
2125
  [ref, context.triggerRef]
2017
2126
  );
2018
- if (asChild && React17.isValidElement(children)) {
2019
- return React17.cloneElement(children, {
2127
+ if (asChild && React18.isValidElement(children)) {
2128
+ return React18.cloneElement(children, {
2020
2129
  ref: setRefs,
2021
2130
  onClick: handleClick,
2022
2131
  ...props
@@ -2080,8 +2189,8 @@ var PortalRoot = (props) => {
2080
2189
  defaultValue: defaultOpen,
2081
2190
  onChange: onOpenChange
2082
2191
  });
2083
- const triggerRef = React18.useRef(null);
2084
- const value = React18.useMemo(
2192
+ const triggerRef = React19.useRef(null);
2193
+ const value = React19.useMemo(
2085
2194
  () => ({
2086
2195
  open,
2087
2196
  onOpenChange: setOpen,
@@ -2109,17 +2218,138 @@ var Portal = {
2109
2218
  Backdrop: PortalBackdrop
2110
2219
  };
2111
2220
 
2221
+ // src/components/progress-bar/fill/progress-bar-fill.tsx
2222
+
2223
+
2224
+
2225
+ // src/components/progress-bar/progress-bar-context.ts
2226
+
2227
+ var ProgressBarContext = React2.default.createContext(null);
2228
+
2229
+ // src/components/progress-bar/fill/progress-bar-fill.props.ts
2230
+ var ProgressBarFillPropsDefs = {
2231
+ /**
2232
+ * The value of the progress bar (filled state).
2233
+ * Should be a number between 0 and 1 representing the percentage of completion.
2234
+ */
2235
+ value: {
2236
+ type: "number"
2237
+ }
2238
+ };
2239
+
2240
+ // src/components/progress-bar/fill/progress-bar-fill.tsx
2241
+
2242
+ var ProgressBarFill = (props) => {
2243
+ const context = _react.useContext.call(void 0, ProgressBarContext);
2244
+ const { value, color, style, className, dataAttrs, ...rest } = getComponentProps(props, ProgressBarFillPropsDefs);
2245
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2246
+ "div",
2247
+ {
2248
+ "data-color": _nullishCoalesce(color, () => ( _optionalChain([context, 'optionalAccess', _36 => _36.color]))),
2249
+ "data-variant": _optionalChain([context, 'optionalAccess', _37 => _37.variant]),
2250
+ style: { ...style, width: `${(_nullishCoalesce(value, () => ( 0))) / ((_nullishCoalesce(_optionalChain([context, 'optionalAccess', _38 => _38.totalValue]), () => ( 0))) > 1 ? context.totalValue : 1) * 100}%` },
2251
+ className: _clsx2.default.call(void 0, "progress-bar-fill", className),
2252
+ ...dataAttrs,
2253
+ ...rest
2254
+ }
2255
+ );
2256
+ };
2257
+ ProgressBarFill.displayName = "ProgressBar.Fill";
2258
+
2259
+ // src/components/progress-bar/root/progress-bar-root.tsx
2260
+
2261
+
2262
+
2263
+ // src/components/progress-bar/root/progress-bar-root.props.ts
2264
+ var ProgressBarVariants = ["solid", "outlined", "muted"];
2265
+ var ProgressBarRootPropsDefs = {
2266
+ /**
2267
+ * Sets the variant style of the progress bar ("solid", "outlined", or "muted").
2268
+ */
2269
+ variant: {
2270
+ type: "enum",
2271
+ values: ProgressBarVariants,
2272
+ dataAttr: "variant"
2273
+ },
2274
+ /**
2275
+ * The value of the progress bar (filled state).
2276
+ * Should be a number between 0 and 1 representing the percentage of completion.
2277
+ */
2278
+ value: {
2279
+ type: "number"
2280
+ }
2281
+ };
2282
+
2283
+ // src/components/progress-bar/root/progress-bar-root.tsx
2284
+
2285
+ var ALLOWED_CHILDREN5 = [ProgressBarFill.displayName];
2286
+ var ProgressBarRoot = (props) => {
2287
+ const { value, size, color, variant, className, dataAttrs, ...rest } = getComponentProps(
2288
+ props,
2289
+ ProgressBarRootPropsDefs,
2290
+ MarginPropDefs,
2291
+ SizePropDef
2292
+ );
2293
+ const validChildren = filterChildren(props.children, ALLOWED_CHILDREN5, {
2294
+ parentDisplayName: ProgressBarRoot.displayName
2295
+ });
2296
+ const { fills, totalValue } = _react.useMemo.call(void 0, () => {
2297
+ const fills2 = validChildren.filter(
2298
+ (child) => _react.isValidElement.call(void 0, child) && child.type.displayName === ProgressBarFill.displayName
2299
+ );
2300
+ if (fills2.length > 0) {
2301
+ const totalValue2 = fills2.reduce(
2302
+ (sum, child) => sum + (_react.isValidElement.call(void 0, child) ? _nullishCoalesce(child.props.value, () => ( 0)) : 0),
2303
+ 0
2304
+ );
2305
+ return {
2306
+ fills: fills2,
2307
+ totalValue: totalValue2
2308
+ };
2309
+ }
2310
+ return {
2311
+ fills: [/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProgressBarFill, { color, value })],
2312
+ totalValue: _nullishCoalesce(value, () => ( 0))
2313
+ };
2314
+ }, [validChildren, color, value]);
2315
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProgressBarContext.Provider, { value: { color, variant, totalValue }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2316
+ "div",
2317
+ {
2318
+ "data-size": size,
2319
+ "data-color": color,
2320
+ "data-variant": variant,
2321
+ className: _clsx2.default.call(void 0, "progress-bar-root", className),
2322
+ ...dataAttrs,
2323
+ ...rest,
2324
+ children: fills.map((fill, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, React2.default.Fragment, { children: fill }, index))
2325
+ }
2326
+ ) });
2327
+ };
2328
+ ProgressBarRoot.displayName = "ProgressBar.Root";
2329
+
2330
+ // src/components/progress-bar/progress-bar.tsx
2331
+ var ProgressBar = Object.assign(ProgressBarRoot, {
2332
+ /**
2333
+ * The root component for the Progress Bar.
2334
+ */
2335
+ Root: ProgressBarRoot,
2336
+ /**
2337
+ * The fill component for the Progress Bar, representing the filled portion.
2338
+ */
2339
+ Fill: ProgressBarFill
2340
+ });
2341
+
2112
2342
  // src/components/select/content/select-content.tsx
2113
2343
 
2114
2344
 
2115
2345
 
2116
2346
  // src/components/select/select-context.tsx
2117
2347
 
2118
- var SelectContext = React19.createContext(
2348
+ var SelectContext = React22.createContext(
2119
2349
  null
2120
2350
  );
2121
2351
  function useSelectContext() {
2122
- const context = React19.useContext(SelectContext);
2352
+ const context = React22.useContext(SelectContext);
2123
2353
  if (!context) {
2124
2354
  throw new Error("Select components must be used within a Select.Root");
2125
2355
  }
@@ -2129,7 +2359,7 @@ function useSelectContext() {
2129
2359
  // src/components/select/utils/user-composed-refs.ts
2130
2360
 
2131
2361
  function useComposedRefs(...refs) {
2132
- return React20.useCallback(
2362
+ return React23.useCallback(
2133
2363
  (node) => {
2134
2364
  refs.forEach((ref) => {
2135
2365
  if (typeof ref === "function") {
@@ -2147,7 +2377,7 @@ function useComposedRefs(...refs) {
2147
2377
 
2148
2378
 
2149
2379
 
2150
- var SelectViewport = React21.forwardRef(
2380
+ var SelectViewport = React24.forwardRef(
2151
2381
  (props, ref) => {
2152
2382
  const { className, children, ...rest } = props;
2153
2383
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { ref, className: _clsx2.default.call(void 0, "select-viewport", className), ...rest, children });
@@ -2157,7 +2387,7 @@ SelectViewport.displayName = "Select.Viewport";
2157
2387
 
2158
2388
  // src/components/select/content/select-content.tsx
2159
2389
 
2160
- var SelectContent = React22.forwardRef(
2390
+ var SelectContent = React25.forwardRef(
2161
2391
  (props, forwardedRef) => {
2162
2392
  const {
2163
2393
  className,
@@ -2170,10 +2400,10 @@ var SelectContent = React22.forwardRef(
2170
2400
  } = props;
2171
2401
  const context = useSelectContext();
2172
2402
  const composedRef = useComposedRefs(forwardedRef, context.contentRef);
2173
- React22.useEffect(() => {
2403
+ React25.useEffect(() => {
2174
2404
  context.itemValues.current = [];
2175
2405
  }, [context.open]);
2176
- React22.useEffect(() => {
2406
+ React25.useEffect(() => {
2177
2407
  if (!context.open) return;
2178
2408
  const handleClickOutside = (event) => {
2179
2409
  const target = event.target;
@@ -2184,7 +2414,7 @@ var SelectContent = React22.forwardRef(
2184
2414
  document.addEventListener("mousedown", handleClickOutside);
2185
2415
  return () => document.removeEventListener("mousedown", handleClickOutside);
2186
2416
  }, [context.open]);
2187
- React22.useEffect(() => {
2417
+ React25.useEffect(() => {
2188
2418
  if (!context.open) return;
2189
2419
  const handleKeyDown = (event) => {
2190
2420
  const items = context.itemValues.current;
@@ -2230,17 +2460,17 @@ var SelectContent = React22.forwardRef(
2230
2460
  case "Escape":
2231
2461
  event.preventDefault();
2232
2462
  context.onOpenChange(false);
2233
- _optionalChain([context, 'access', _36 => _36.triggerRef, 'access', _37 => _37.current, 'optionalAccess', _38 => _38.focus, 'call', _39 => _39()]);
2463
+ _optionalChain([context, 'access', _39 => _39.triggerRef, 'access', _40 => _40.current, 'optionalAccess', _41 => _41.focus, 'call', _42 => _42()]);
2234
2464
  break;
2235
2465
  }
2236
2466
  };
2237
2467
  document.addEventListener("keydown", handleKeyDown);
2238
2468
  return () => document.removeEventListener("keydown", handleKeyDown);
2239
2469
  }, [context.open, context.highlightedIndex]);
2240
- const [contentWidth, setContentWidth] = React22.useState();
2470
+ const [contentWidth, setContentWidth] = React25.useState();
2241
2471
  const labelInside = context.labelPosition === "inside";
2242
2472
  const anchorRef = labelInside ? context.rootRef : context.triggerRef;
2243
- React22.useLayoutEffect(() => {
2473
+ React25.useLayoutEffect(() => {
2244
2474
  if (context.open && anchorRef.current) {
2245
2475
  setContentWidth(anchorRef.current.getBoundingClientRect().width);
2246
2476
  }
@@ -2288,7 +2518,7 @@ var SelectGroupsPropDefs = {
2288
2518
 
2289
2519
  // src/components/select/group/select-group.tsx
2290
2520
 
2291
- var SelectGroup = React23.forwardRef(
2521
+ var SelectGroup = React26.forwardRef(
2292
2522
  (props, ref) => {
2293
2523
  const { className, children, dataAttrs, ...rest } = getComponentProps(
2294
2524
  props,
@@ -2352,7 +2582,7 @@ var SelectItemPropDefs = {
2352
2582
 
2353
2583
  // src/components/select/item/select-item.tsx
2354
2584
 
2355
- var SelectItem = React24.forwardRef(
2585
+ var SelectItem = React27.forwardRef(
2356
2586
  (props, ref) => {
2357
2587
  const context = useSelectContext();
2358
2588
  const { value, disabled, children, className, ...rest } = getComponentProps(
@@ -2360,12 +2590,12 @@ var SelectItem = React24.forwardRef(
2360
2590
  SelectItemPropDefs
2361
2591
  );
2362
2592
  const selected = context.value === value;
2363
- React24.useEffect(() => {
2593
+ React27.useEffect(() => {
2364
2594
  if (selected && children) {
2365
2595
  context.setDisplayValue(children);
2366
2596
  }
2367
2597
  }, [selected]);
2368
- React24.useEffect(() => {
2598
+ React27.useEffect(() => {
2369
2599
  if (!value) return;
2370
2600
  if (!disabled) {
2371
2601
  const values = context.itemValues.current;
@@ -2386,7 +2616,7 @@ var SelectItem = React24.forwardRef(
2386
2616
  context.setDisplayValue(children);
2387
2617
  }
2388
2618
  context.onOpenChange(false);
2389
- _optionalChain([context, 'access', _40 => _40.triggerRef, 'access', _41 => _41.current, 'optionalAccess', _42 => _42.focus, 'call', _43 => _43()]);
2619
+ _optionalChain([context, 'access', _43 => _43.triggerRef, 'access', _44 => _44.current, 'optionalAccess', _45 => _45.focus, 'call', _46 => _46()]);
2390
2620
  }
2391
2621
  };
2392
2622
  const handleMouseEnter = () => {
@@ -2442,15 +2672,15 @@ var SelectLabelPropDefs = {
2442
2672
 
2443
2673
  // src/components/select/label/select-label.tsx
2444
2674
 
2445
- var SelectLabel = React25.forwardRef(
2675
+ var SelectLabel = React28.forwardRef(
2446
2676
  (props, ref) => {
2447
2677
  const context = useSelectContext();
2448
2678
  const { className, children, position, dataAttrs } = getComponentProps(
2449
2679
  props,
2450
2680
  SelectLabelPropDefs
2451
2681
  );
2452
- React25.useLayoutEffect(() => {
2453
- _optionalChain([context, 'access', _44 => _44.setLabelPosition, 'optionalCall', _45 => _45(_nullishCoalesce(position, () => ( "top")))]);
2682
+ React28.useLayoutEffect(() => {
2683
+ _optionalChain([context, 'access', _47 => _47.setLabelPosition, 'optionalCall', _48 => _48(_nullishCoalesce(position, () => ( "top")))]);
2454
2684
  }, [position, context.setLabelPosition]);
2455
2685
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2456
2686
  "label",
@@ -2484,7 +2714,7 @@ SelectLabel.displayName = "Select.Label";
2484
2714
 
2485
2715
 
2486
2716
 
2487
- var SelectValue = React26.forwardRef(
2717
+ var SelectValue = React29.forwardRef(
2488
2718
  (props, ref) => {
2489
2719
  const { className, placeholder: placeholderProp, ...rest } = props;
2490
2720
  const context = useSelectContext();
@@ -2536,7 +2766,7 @@ var SelectTriggerPropsDefs = {};
2536
2766
 
2537
2767
  // src/components/select/trigger/select-trigger.tsx
2538
2768
 
2539
- var SelectTrigger = React27.forwardRef(
2769
+ var SelectTrigger = React30.forwardRef(
2540
2770
  (props, forwardedRef) => {
2541
2771
  const {
2542
2772
  className,
@@ -2641,7 +2871,7 @@ var SelectRootPropsDefs = {
2641
2871
 
2642
2872
  // src/components/select/root/select-root.tsx
2643
2873
 
2644
- var ALLOWED_CHILDREN5 = [
2874
+ var ALLOWED_CHILDREN6 = [
2645
2875
  SelectLabel.displayName,
2646
2876
  SelectTrigger.displayName,
2647
2877
  SelectContent.displayName
@@ -2722,9 +2952,9 @@ var SelectRoot = (props) => {
2722
2952
  ]
2723
2953
  );
2724
2954
  _react.useLayoutEffect.call(void 0, () => {
2725
- _optionalChain([setTriggerVariant, 'optionalCall', _46 => _46(_nullishCoalesce(variant, () => ( "outlined")))]);
2955
+ _optionalChain([setTriggerVariant, 'optionalCall', _49 => _49(_nullishCoalesce(variant, () => ( "outlined")))]);
2726
2956
  }, [variant, setTriggerVariant]);
2727
- const validChildren = filterChildren(children, ALLOWED_CHILDREN5, {
2957
+ const validChildren = filterChildren(children, ALLOWED_CHILDREN6, {
2728
2958
  parentDisplayName: SelectRoot.displayName
2729
2959
  });
2730
2960
  const labelInside = labelPosition === "inside";
@@ -2788,7 +3018,7 @@ SelectRoot.displayName = "Select.Root";
2788
3018
 
2789
3019
 
2790
3020
 
2791
- var SelectSeparator = React28.forwardRef(
3021
+ var SelectSeparator = React31.forwardRef(
2792
3022
  (props, ref) => {
2793
3023
  const { className, ...rest } = props;
2794
3024
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -2864,17 +3094,364 @@ var Separator = (props) => {
2864
3094
  };
2865
3095
  Separator.displayName = "Separator";
2866
3096
 
3097
+ // src/components/switch/indicator/switch-indicator.tsx
3098
+
3099
+
3100
+
3101
+ // src/components/switch/switch-context.ts
3102
+
3103
+ var SwitchContext = React2.default.createContext(
3104
+ null
3105
+ );
3106
+ function useSwitchContext() {
3107
+ const context = React2.default.useContext(SwitchContext);
3108
+ if (!context) {
3109
+ throw new Error("Switch components must be used within a Switch.Root");
3110
+ }
3111
+ return context;
3112
+ }
3113
+
3114
+ // src/components/switch/root/switch-root.props.ts
3115
+ var SwitchVariants = ["solid", "outlined", "muted"];
3116
+ var SwitchRootPropsDefs = {
3117
+ /**
3118
+ * Sets the variant style of the switch ("solid" or "outlined").
3119
+ */
3120
+ variant: {
3121
+ type: "enum",
3122
+ values: SwitchVariants,
3123
+ dataAttr: "variant"
3124
+ },
3125
+ /**
3126
+ * Sets the checked state of the switch.
3127
+ *
3128
+ * When using an uncontrolled switch, use `defaultChecked` instead.
3129
+ * @default undefined
3130
+ */
3131
+ checked: {
3132
+ type: "boolean",
3133
+ dataAttr: "checked"
3134
+ },
3135
+ /**
3136
+ * The value of the switch (checked state).
3137
+ */
3138
+ value: {
3139
+ type: "boolean"
3140
+ },
3141
+ /**
3142
+ * Sets the default checked state of the switch.
3143
+ * @default undefined
3144
+ */
3145
+ defaultChecked: {
3146
+ type: "boolean"
3147
+ },
3148
+ /**
3149
+ * Disables the switch component.
3150
+ * @default undefined
3151
+ */
3152
+ disabled: {
3153
+ type: "boolean",
3154
+ dataAttr: "disabled"
3155
+ },
3156
+ /**
3157
+ * Makes the switch read-only.
3158
+ * @default undefined
3159
+ */
3160
+ readonly: {
3161
+ type: "boolean",
3162
+ dataAttr: "readonly"
3163
+ },
3164
+ /**
3165
+ * Marks the switch as required.
3166
+ * @default undefined
3167
+ */
3168
+ required: {
3169
+ type: "boolean",
3170
+ dataAttr: "required"
3171
+ },
3172
+ /**
3173
+ * Sets the name attribute of the switch input for form control.
3174
+ * @default undefined
3175
+ */
3176
+ name: {
3177
+ type: "string"
3178
+ },
3179
+ /**
3180
+ * Callback fired when the checked state changes.
3181
+ *
3182
+ * @param value - The new checked state.
3183
+ */
3184
+ onCheckedChange: {
3185
+ type: "function"
3186
+ }
3187
+ };
3188
+
3189
+ // src/components/switch/indicator/switch-indicator.props.ts
3190
+ var SwitchIndicatorPropDefs = {
3191
+ /**
3192
+ * Sets the variant style of the switch ("solid" or "outlined").
3193
+ */
3194
+ variant: {
3195
+ type: "enum",
3196
+ values: SwitchVariants,
3197
+ dataAttr: "variant"
3198
+ }
3199
+ };
3200
+
3201
+ // src/components/switch/indicator/switch-indicator.tsx
3202
+
3203
+ var SwitchIndicator = React2.default.forwardRef((props, ref) => {
3204
+ const {
3205
+ value,
3206
+ setValue,
3207
+ hovered,
3208
+ color,
3209
+ disabled,
3210
+ readonly,
3211
+ focused,
3212
+ variant: contextVariant
3213
+ } = useSwitchContext();
3214
+ const { size, variant, className, style, dataAttrs } = getComponentProps(
3215
+ props,
3216
+ SwitchIndicatorPropDefs,
3217
+ SizePropDef
3218
+ );
3219
+ const indicatorVariant = variant || contextVariant;
3220
+ const handleKeyDown = (event) => {
3221
+ if (disabled || readonly) return;
3222
+ if (event.key === " " || event.key === "Enter") {
3223
+ event.preventDefault();
3224
+ setValue(!value);
3225
+ }
3226
+ };
3227
+ const indicatorProps = {
3228
+ ...value && { "data-checked": true },
3229
+ ...disabled && { "data-disabled": true },
3230
+ ...readonly && { "data-readonly": true },
3231
+ ...(variant || contextVariant) && { "data-variant": indicatorVariant }
3232
+ };
3233
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3234
+ "div",
3235
+ {
3236
+ ref,
3237
+ style,
3238
+ role: "switch",
3239
+ "data-size": size,
3240
+ "data-color": color,
3241
+ "data-hovered": hovered,
3242
+ "aria-disabled": disabled,
3243
+ "data-focused": focused,
3244
+ "aria-readonly": readonly,
3245
+ onKeyDown: handleKeyDown,
3246
+ tabIndex: disabled || readonly ? -1 : 0,
3247
+ className: _clsx2.default.call(void 0, "switch-indicator", className),
3248
+ ...indicatorProps,
3249
+ ...dataAttrs
3250
+ }
3251
+ );
3252
+ });
3253
+ SwitchIndicator.displayName = "Switch.Indicator";
3254
+
3255
+ // src/components/switch/label/switch-label.tsx
3256
+
3257
+
3258
+
3259
+ // src/components/switch/label/switch-label.props.ts
3260
+ var labelPositions3 = ["top", "left", "right", "bottom"];
3261
+ var SwitchLabelPropDefs = {
3262
+ /**
3263
+ * Sets the position of the label relative to the switch.
3264
+ *
3265
+ * @example position="left" // positions the label to the left of the switch
3266
+ * @example position="top" // positions the label above the switch
3267
+ */
3268
+ position: {
3269
+ type: "enum",
3270
+ values: labelPositions3,
3271
+ dataAttr: "position"
3272
+ }
3273
+ };
3274
+
3275
+ // src/components/switch/label/switch-label.tsx
3276
+
3277
+ var SwitchLabel = React2.default.forwardRef(
3278
+ (props, ref) => {
3279
+ const context = useSwitchContext();
3280
+ const { className, children, position } = getComponentProps(
3281
+ props,
3282
+ SwitchLabelPropDefs
3283
+ );
3284
+ React2.default.useLayoutEffect(() => {
3285
+ _optionalChain([context, 'access', _50 => _50.setLabelPosition, 'optionalCall', _51 => _51(_nullishCoalesce(position, () => ( "right")))]);
3286
+ }, [position, context.setLabelPosition]);
3287
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3288
+ "label",
3289
+ {
3290
+ ref,
3291
+ htmlFor: context.labelId,
3292
+ className: _clsx2.default.call(void 0, "switch-label", className),
3293
+ ...position && { [`data-position`]: position },
3294
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Text, { children })
3295
+ }
3296
+ );
3297
+ }
3298
+ );
3299
+ SwitchLabel.displayName = "Switch.Label";
3300
+
3301
+ // src/components/switch/root/switch-root.tsx
3302
+
3303
+
3304
+
3305
+
3306
+
3307
+
3308
+
3309
+
3310
+ var ALLOWED_CHILDREN7 = [
3311
+ SwitchLabel.displayName,
3312
+ SwitchIndicator.displayName
3313
+ ];
3314
+ var SwitchRoot = (props) => {
3315
+ const {
3316
+ name,
3317
+ size,
3318
+ color,
3319
+ variant,
3320
+ checked,
3321
+ dataAttrs,
3322
+ onCheckedChange,
3323
+ value: valueProp,
3324
+ disabled = false,
3325
+ required = false,
3326
+ readonly = false,
3327
+ defaultChecked = false
3328
+ } = getComponentProps(
3329
+ props,
3330
+ SwitchRootPropsDefs,
3331
+ AlignPropDef,
3332
+ MarginPropDefs,
3333
+ SizePropDef,
3334
+ ColorPropDef
3335
+ );
3336
+ const [value, setValue] = useControllableState({
3337
+ value: valueProp || checked,
3338
+ defaultValue: defaultChecked,
3339
+ onChange: onCheckedChange
3340
+ });
3341
+ const labelId = _react.useId.call(void 0, );
3342
+ const [labelPosition, setLabelPosition] = _react.useState.call(void 0, "right");
3343
+ const [hovered, setHovered] = _react.useState.call(void 0, false);
3344
+ const [focused, setFocused] = _react.useState.call(void 0, false);
3345
+ const validChildren = filterChildren(props.children, ALLOWED_CHILDREN7, {
3346
+ parentDisplayName: SwitchRoot.displayName
3347
+ });
3348
+ const { restDataAttrs } = _react.useMemo.call(void 0, () => {
3349
+ const { ["data-color"]: _, ...restDataAttrs2 } = dataAttrs || {};
3350
+ return { restDataAttrs: restDataAttrs2 };
3351
+ }, [dataAttrs]);
3352
+ const { indicator, otherChildren } = _react.useMemo.call(void 0, () => {
3353
+ const indicatorIndex = validChildren.findIndex(
3354
+ (child) => _react.isValidElement.call(void 0, child) && child.type.displayName === SwitchIndicator.displayName
3355
+ );
3356
+ if (indicatorIndex > -1) {
3357
+ return {
3358
+ indicator: validChildren[indicatorIndex],
3359
+ otherChildren: validChildren.filter((_, i) => i !== indicatorIndex)
3360
+ };
3361
+ }
3362
+ return {
3363
+ indicator: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SwitchIndicator, { size }),
3364
+ otherChildren: validChildren
3365
+ };
3366
+ }, [validChildren, size]);
3367
+ const contextValue = _react.useMemo.call(void 0,
3368
+ () => ({
3369
+ name,
3370
+ value,
3371
+ color,
3372
+ setValue,
3373
+ onCheckedChange,
3374
+ labelId,
3375
+ labelPosition,
3376
+ setLabelPosition,
3377
+ variant,
3378
+ hovered,
3379
+ setHovered,
3380
+ focused,
3381
+ setFocused,
3382
+ disabled,
3383
+ readonly,
3384
+ required
3385
+ }),
3386
+ [
3387
+ name,
3388
+ value,
3389
+ color,
3390
+ onCheckedChange,
3391
+ setValue,
3392
+ labelId,
3393
+ labelPosition,
3394
+ hovered,
3395
+ focused,
3396
+ disabled,
3397
+ readonly,
3398
+ required
3399
+ ]
3400
+ );
3401
+ const handleClick = () => {
3402
+ if (disabled || readonly) return;
3403
+ setValue(!value);
3404
+ };
3405
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SwitchContext.Provider, { value: contextValue, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
3406
+ "div",
3407
+ {
3408
+ className: _clsx2.default.call(void 0, "switch-root", props.className),
3409
+ onClick: () => handleClick(),
3410
+ onFocus: () => setFocused(true),
3411
+ onBlur: () => setFocused(false),
3412
+ onMouseEnter: () => setHovered(true),
3413
+ onMouseLeave: () => setHovered(false),
3414
+ ...restDataAttrs,
3415
+ children: [
3416
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3417
+ "div",
3418
+ {
3419
+ className: "switch-container",
3420
+ "data-size": size,
3421
+ "data-color": color,
3422
+ "data-checked": value,
3423
+ "data-hovered": hovered,
3424
+ "data-focused": focused,
3425
+ "data-variant": variant,
3426
+ children: indicator
3427
+ }
3428
+ ),
3429
+ otherChildren,
3430
+ name && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "input", { type: "hidden", name, value: String(value) })
3431
+ ]
3432
+ }
3433
+ ) });
3434
+ };
3435
+ SwitchRoot.displayName = "Switch";
3436
+
3437
+ // src/components/switch/switch.tsx
3438
+ var Switch = Object.assign(SwitchRoot, {
3439
+ Root: SwitchRoot,
3440
+ Label: SwitchLabel,
3441
+ Indicator: SwitchIndicator
3442
+ });
3443
+
2867
3444
  // src/components/theme/theme.tsx
2868
3445
 
2869
3446
 
2870
- var Theme = React29.forwardRef((props, ref) => {
2871
- const context = React29.useContext(ThemeContext);
3447
+ var Theme = React36.forwardRef((props, ref) => {
3448
+ const context = React36.useContext(ThemeContext);
2872
3449
  const isRoot = context === void 0;
2873
3450
  if (isRoot) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ThemeRoot, { ...props, ref });
2874
3451
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ThemeSub, { ...props, ref });
2875
3452
  });
2876
3453
  Theme.displayName = "Theme";
2877
- var ThemeRoot = React29.forwardRef((props, ref) => {
3454
+ var ThemeRoot = React36.forwardRef((props, ref) => {
2878
3455
  const {
2879
3456
  appearance: themeAppearance,
2880
3457
  radius: themeRadius,
@@ -2883,15 +3460,15 @@ var ThemeRoot = React29.forwardRef((props, ref) => {
2883
3460
  children,
2884
3461
  ...rest
2885
3462
  } = props;
2886
- const [appearance, setAppearance] = React29.useState(
3463
+ const [appearance, setAppearance] = React36.useState(
2887
3464
  _nullishCoalesce(themeAppearance, () => ( "light"))
2888
3465
  );
2889
- const [radius, setRadius] = React29.useState(_nullishCoalesce(themeRadius, () => ( "md")));
2890
- const [roundness2, setRoundness] = React29.useState(
3466
+ const [radius, setRadius] = React36.useState(_nullishCoalesce(themeRadius, () => ( "md")));
3467
+ const [roundness2, setRoundness] = React36.useState(
2891
3468
  _nullishCoalesce(themeRoundness, () => ( "3"))
2892
3469
  );
2893
- const [spacing, setSpacing] = React29.useState(_nullishCoalesce(themeSpacing, () => ( "md")));
2894
- const value = React29.useMemo(
3470
+ const [spacing, setSpacing] = React36.useState(_nullishCoalesce(themeSpacing, () => ( "md")));
3471
+ const value = React36.useMemo(
2895
3472
  () => ({
2896
3473
  appearance,
2897
3474
  radius,
@@ -2918,8 +3495,8 @@ var ThemeRoot = React29.forwardRef((props, ref) => {
2918
3495
  ) });
2919
3496
  });
2920
3497
  ThemeRoot.displayName = "ThemeRoot";
2921
- var ThemeSub = React29.forwardRef((props, ref) => {
2922
- const context = React29.useContext(ThemeContext);
3498
+ var ThemeSub = React36.forwardRef((props, ref) => {
3499
+ const context = React36.useContext(ThemeContext);
2923
3500
  const {
2924
3501
  appearance,
2925
3502
  radius,
@@ -2960,7 +3537,8 @@ ThemeSub.displayName = "ThemeSub";
2960
3537
 
2961
3538
  // src/components/theme/theme-control.tsx
2962
3539
 
2963
- function ThemeControl() {
3540
+
3541
+ function ThemeControl({ position = "bottom" }) {
2964
3542
  const {
2965
3543
  appearance,
2966
3544
  onAppearanceChange,
@@ -2971,84 +3549,103 @@ function ThemeControl() {
2971
3549
  spacing,
2972
3550
  onSpacingChange
2973
3551
  } = useTheme();
2974
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-2", children: [
2975
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
2976
- Select.Root,
2977
- {
2978
- variant: "solid",
2979
- value: appearance,
2980
- onValueChange: (change) => _optionalChain([onAppearanceChange, 'optionalCall', _47 => _47(change)]),
2981
- children: [
2982
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Label, { position: "inside", children: "Theme Settings" }),
2983
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Trigger, {}),
2984
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Select.Content, { children: [
2985
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "light", children: "Light" }),
2986
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "dark", children: "Dark" })
2987
- ] })
2988
- ]
2989
- }
2990
- ),
2991
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
2992
- Select.Root,
2993
- {
2994
- variant: "solid",
2995
- value: radius,
2996
- onValueChange: (change) => _optionalChain([onRadiusChange, 'optionalCall', _48 => _48(change)]),
2997
- children: [
2998
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Label, { position: "inside", children: "Radius" }),
2999
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Trigger, {}),
3000
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Select.Content, { children: [
3001
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "none", children: "None" }),
3002
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "xs", children: "XS" }),
3003
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "sm", children: "SM" }),
3004
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "md", children: "MD" }),
3005
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "lg", children: "LG" }),
3006
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "xl", children: "XL" }),
3007
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "full", children: "FULL" })
3008
- ] })
3009
- ]
3010
- }
3011
- ),
3012
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
3013
- Select.Root,
3014
- {
3015
- variant: "solid",
3016
- value: roundness2,
3017
- onValueChange: (change) => _optionalChain([onRoundnessChange, 'optionalCall', _49 => _49(change)]),
3018
- children: [
3019
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Label, { className: "min-w-40!", position: "inside", children: "Roundness" }),
3020
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Trigger, {}),
3021
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Select.Content, { children: [
3022
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "1", children: "1" }),
3023
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "2", children: "2" }),
3024
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "3", children: "3" }),
3025
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "4", children: "4" }),
3026
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "5", children: "5" }),
3027
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "6", children: "6" })
3028
- ] })
3029
- ]
3030
- }
3031
- ),
3032
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
3033
- Select.Root,
3034
- {
3035
- variant: "solid",
3036
- value: spacing,
3037
- onValueChange: (change) => _optionalChain([onSpacingChange, 'optionalCall', _50 => _50(change)]),
3038
- children: [
3039
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Label, { position: "inside", children: "Spacing" }),
3040
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Trigger, {}),
3041
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Select.Content, { children: [
3042
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "xs", children: "XS" }),
3043
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "sm", children: "SM" }),
3044
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "md", children: "MD" }),
3045
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "lg", children: "LG" }),
3046
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "xl", children: "XL" })
3047
- ] })
3048
- ]
3552
+ const [visible, setVisible] = _react.useState.call(void 0, false);
3553
+ _react.useEffect.call(void 0, () => {
3554
+ function handleKeyDown(event) {
3555
+ if (event.altKey && event.code === "KeyT") {
3556
+ event.preventDefault();
3557
+ setVisible(!visible);
3049
3558
  }
3050
- )
3051
- ] });
3559
+ }
3560
+ document.addEventListener("keydown", handleKeyDown);
3561
+ return () => document.removeEventListener("keydown", handleKeyDown);
3562
+ }, [visible]);
3563
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Portal.Root, { open: visible, onOpenChange: setVisible, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Portal.Content, { position, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
3564
+ Box,
3565
+ {
3566
+ m: "4",
3567
+ p: "4",
3568
+ className: "flex flex-col gap-2 border-[rgba(var(--border-color), 0.6)]",
3569
+ children: [
3570
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
3571
+ Select.Root,
3572
+ {
3573
+ variant: "solid",
3574
+ value: appearance,
3575
+ onValueChange: (change) => _optionalChain([onAppearanceChange, 'optionalCall', _52 => _52(change)]),
3576
+ children: [
3577
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Label, { position: "inside", children: "Theme Settings" }),
3578
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Trigger, {}),
3579
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Select.Content, { children: [
3580
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "light", children: "Light" }),
3581
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "dark", children: "Dark" })
3582
+ ] })
3583
+ ]
3584
+ }
3585
+ ),
3586
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
3587
+ Select.Root,
3588
+ {
3589
+ variant: "solid",
3590
+ value: radius,
3591
+ onValueChange: (change) => _optionalChain([onRadiusChange, 'optionalCall', _53 => _53(change)]),
3592
+ children: [
3593
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Label, { position: "inside", children: "Radius" }),
3594
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Trigger, {}),
3595
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Select.Content, { children: [
3596
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "none", children: "None" }),
3597
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "xs", children: "XS" }),
3598
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "sm", children: "SM" }),
3599
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "md", children: "MD" }),
3600
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "lg", children: "LG" }),
3601
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "xl", children: "XL" }),
3602
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "full", children: "FULL" })
3603
+ ] })
3604
+ ]
3605
+ }
3606
+ ),
3607
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
3608
+ Select.Root,
3609
+ {
3610
+ variant: "solid",
3611
+ value: roundness2,
3612
+ onValueChange: (change) => _optionalChain([onRoundnessChange, 'optionalCall', _54 => _54(change)]),
3613
+ children: [
3614
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Label, { className: "min-w-40!", position: "inside", children: "Roundness" }),
3615
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Trigger, {}),
3616
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Select.Content, { children: [
3617
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "1", children: "1" }),
3618
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "2", children: "2" }),
3619
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "3", children: "3" }),
3620
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "4", children: "4" }),
3621
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "5", children: "5" }),
3622
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "6", children: "6" })
3623
+ ] })
3624
+ ]
3625
+ }
3626
+ ),
3627
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
3628
+ Select.Root,
3629
+ {
3630
+ variant: "solid",
3631
+ value: spacing,
3632
+ onValueChange: (change) => _optionalChain([onSpacingChange, 'optionalCall', _55 => _55(change)]),
3633
+ children: [
3634
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Label, { position: "inside", children: "Spacing" }),
3635
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Trigger, {}),
3636
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Select.Content, { children: [
3637
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "xs", children: "XS" }),
3638
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "sm", children: "SM" }),
3639
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "md", children: "MD" }),
3640
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "lg", children: "LG" }),
3641
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "xl", children: "XL" })
3642
+ ] })
3643
+ ]
3644
+ }
3645
+ )
3646
+ ]
3647
+ }
3648
+ ) }) });
3052
3649
  }
3053
3650
 
3054
3651
 
@@ -3064,5 +3661,8 @@ function ThemeControl() {
3064
3661
 
3065
3662
 
3066
3663
 
3067
- exports.Accordion = Accordion; exports.Badge = Badge; exports.Box = Box; exports.Button = Button; exports.Checkbox = Checkbox; exports.Container = Container; exports.Portal = Portal; exports.Select = Select; exports.Separator = Separator; exports.Text = Text; exports.Theme = Theme; exports.ThemeControl = ThemeControl; exports.useTheme = useTheme;
3664
+
3665
+
3666
+
3667
+ exports.Accordion = Accordion; exports.Badge = Badge; exports.Box = Box; exports.Button = Button; exports.Checkbox = Checkbox; exports.Container = Container; exports.Panel = Panel; exports.Portal = Portal; exports.ProgressBar = ProgressBar; exports.Select = Select; exports.Separator = Separator; exports.Switch = Switch; exports.Text = Text; exports.Theme = Theme; exports.ThemeControl = ThemeControl; exports.useTheme = useTheme;
3068
3668
  //# sourceMappingURL=index.js.map