@locus-ui/components 0.0.11 → 0.0.13

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,7 +19,7 @@ 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
24
  if (prop.cssProperty && value !== void 0 && value !== null) {
25
25
  style = {
@@ -41,13 +41,14 @@ function getComponentProps(props, ...propDefs) {
41
41
  if (propValue !== null && propValue !== void 0) {
42
42
  if (!breakpoint) extractedProps[key] = propValue;
43
43
  if (!prop.values.includes(propValue)) {
44
+ const transformedValue = "transform" in prop && prop.transform ? prop.transform(propValue) : propValue;
44
45
  if (prop.className) {
45
46
  classNames.push(
46
47
  breakpoint ? `${prop.className}-${breakpoint}` : prop.className
47
48
  );
48
49
  style = {
49
50
  ...style,
50
- [`--custom-${key}${usedBreakpoint}`]: propValue
51
+ [`--custom-${key}${usedBreakpoint}`]: transformedValue
51
52
  };
52
53
  }
53
54
  if (prop.dataAttr) {
@@ -86,7 +87,7 @@ function getComponentProps(props, ...propDefs) {
86
87
  }
87
88
 
88
89
  // 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);
90
+ 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 React32 = _interopRequireWildcard(_react);
90
91
  var AccordionContext = React2.default.createContext(null);
91
92
  function useAccordionContext() {
92
93
  const context = React2.default.useContext(AccordionContext);
@@ -322,6 +323,60 @@ var AlignPropDef = {
322
323
  }
323
324
  };
324
325
 
326
+ // src/utils/parse-color.ts
327
+ function parseColor(value) {
328
+ const trimmed = value.trim();
329
+ const hexMatch = trimmed.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i);
330
+ if (hexMatch) {
331
+ let hex = hexMatch[1];
332
+ if (hex.length === 3) {
333
+ hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
334
+ }
335
+ const r = parseInt(hex.slice(0, 2), 16);
336
+ const g = parseInt(hex.slice(2, 4), 16);
337
+ const b = parseInt(hex.slice(4, 6), 16);
338
+ return `${r}, ${g}, ${b}`;
339
+ }
340
+ const rgbMatch = trimmed.match(
341
+ /^rgba?\(\s*(\d{1,3})\s*[,\s]\s*(\d{1,3})\s*[,\s]\s*(\d{1,3})\s*(?:[,/]\s*[\d.]+%?\s*)?\)$/
342
+ );
343
+ if (rgbMatch) {
344
+ return `${rgbMatch[1]}, ${rgbMatch[2]}, ${rgbMatch[3]}`;
345
+ }
346
+ return trimmed;
347
+ }
348
+
349
+ // src/props/color.prop.ts
350
+ var Colors = [
351
+ "primary",
352
+ "secondary",
353
+ "tertiary",
354
+ "accent",
355
+ "success",
356
+ "warning",
357
+ "danger",
358
+ "info"
359
+ ];
360
+ var ColorPropDef = {
361
+ /**
362
+ * Sets the color of the component.
363
+ *
364
+ * Uses predefined theme colors ("primary", "secondary", etc.) or accepts custom color values in hex, rgb, or raw rgb formats.
365
+ *
366
+ * @example color="primary" // primary color
367
+ * @example color="#7BEB34" // hex color
368
+ * @example color="rgb(125, 235, 52)" // rgb color
369
+ * @example color="125, 235, 52" // raw rgb values
370
+ */
371
+ color: {
372
+ type: "enum | string",
373
+ values: Colors,
374
+ dataAttr: "color",
375
+ className: "color",
376
+ transform: parseColor
377
+ }
378
+ };
379
+
325
380
  // src/props/margin.prop.ts
326
381
  var marginValues = [
327
382
  "auto",
@@ -1112,6 +1167,7 @@ var Button = (props) => {
1112
1167
  } = getComponentProps(
1113
1168
  props,
1114
1169
  ButtonRootPropsDefs,
1170
+ ColorPropDef,
1115
1171
  MarginPropDefs,
1116
1172
  PaddingPropDefs,
1117
1173
  RadiusPropDefs,
@@ -1616,17 +1672,70 @@ var Container = React11.forwardRef((props, ref) => {
1616
1672
  });
1617
1673
  Container.displayName = "Container";
1618
1674
 
1675
+ // src/components/panel/panel.tsx
1676
+
1677
+
1678
+
1679
+ // src/components/panel/panel.props.ts
1680
+ var PanelVariants = ["solid", "outlined", "muted"];
1681
+ var PanelPropsDefs = {
1682
+ /**
1683
+ * Sets the variant style of the panel ("solid", "outlined", or "muted").
1684
+ */
1685
+ variant: {
1686
+ type: "enum",
1687
+ values: PanelVariants,
1688
+ dataAttr: "variant"
1689
+ },
1690
+ /**
1691
+ * The blur amount applied to the panel.
1692
+ *
1693
+ * @example blur="4px" // Sets the backdrop blur to 4 pixels
1694
+ * @default "2px"
1695
+ */
1696
+ blur: {
1697
+ type: "string",
1698
+ default: "2px",
1699
+ cssProperty: "--panel-blur"
1700
+ }
1701
+ };
1702
+
1703
+ // src/components/panel/panel.tsx
1704
+
1705
+ var Panel = React12.forwardRef((props, ref) => {
1706
+ const { className, dataAttrs, children, ...rest } = getComponentProps(
1707
+ props,
1708
+ PanelPropsDefs,
1709
+ MarginPropDefs,
1710
+ PaddingPropDefs,
1711
+ SpacingPropDef,
1712
+ RadiusPropDefs,
1713
+ RoundnessPropDef
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,
@@ -2867,14 +3097,14 @@ Separator.displayName = "Separator";
2867
3097
  // src/components/theme/theme.tsx
2868
3098
 
2869
3099
 
2870
- var Theme = React29.forwardRef((props, ref) => {
2871
- const context = React29.useContext(ThemeContext);
3100
+ var Theme = React32.forwardRef((props, ref) => {
3101
+ const context = React32.useContext(ThemeContext);
2872
3102
  const isRoot = context === void 0;
2873
3103
  if (isRoot) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ThemeRoot, { ...props, ref });
2874
3104
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ThemeSub, { ...props, ref });
2875
3105
  });
2876
3106
  Theme.displayName = "Theme";
2877
- var ThemeRoot = React29.forwardRef((props, ref) => {
3107
+ var ThemeRoot = React32.forwardRef((props, ref) => {
2878
3108
  const {
2879
3109
  appearance: themeAppearance,
2880
3110
  radius: themeRadius,
@@ -2883,15 +3113,15 @@ var ThemeRoot = React29.forwardRef((props, ref) => {
2883
3113
  children,
2884
3114
  ...rest
2885
3115
  } = props;
2886
- const [appearance, setAppearance] = React29.useState(
3116
+ const [appearance, setAppearance] = React32.useState(
2887
3117
  _nullishCoalesce(themeAppearance, () => ( "light"))
2888
3118
  );
2889
- const [radius, setRadius] = React29.useState(_nullishCoalesce(themeRadius, () => ( "md")));
2890
- const [roundness2, setRoundness] = React29.useState(
3119
+ const [radius, setRadius] = React32.useState(_nullishCoalesce(themeRadius, () => ( "md")));
3120
+ const [roundness2, setRoundness] = React32.useState(
2891
3121
  _nullishCoalesce(themeRoundness, () => ( "3"))
2892
3122
  );
2893
- const [spacing, setSpacing] = React29.useState(_nullishCoalesce(themeSpacing, () => ( "md")));
2894
- const value = React29.useMemo(
3123
+ const [spacing, setSpacing] = React32.useState(_nullishCoalesce(themeSpacing, () => ( "md")));
3124
+ const value = React32.useMemo(
2895
3125
  () => ({
2896
3126
  appearance,
2897
3127
  radius,
@@ -2918,8 +3148,8 @@ var ThemeRoot = React29.forwardRef((props, ref) => {
2918
3148
  ) });
2919
3149
  });
2920
3150
  ThemeRoot.displayName = "ThemeRoot";
2921
- var ThemeSub = React29.forwardRef((props, ref) => {
2922
- const context = React29.useContext(ThemeContext);
3151
+ var ThemeSub = React32.forwardRef((props, ref) => {
3152
+ const context = React32.useContext(ThemeContext);
2923
3153
  const {
2924
3154
  appearance,
2925
3155
  radius,
@@ -2960,7 +3190,8 @@ ThemeSub.displayName = "ThemeSub";
2960
3190
 
2961
3191
  // src/components/theme/theme-control.tsx
2962
3192
 
2963
- function ThemeControl() {
3193
+
3194
+ function ThemeControl({ position = "bottom" }) {
2964
3195
  const {
2965
3196
  appearance,
2966
3197
  onAppearanceChange,
@@ -2971,84 +3202,103 @@ function ThemeControl() {
2971
3202
  spacing,
2972
3203
  onSpacingChange
2973
3204
  } = 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
- ]
3205
+ const [visible, setVisible] = _react.useState.call(void 0, false);
3206
+ _react.useEffect.call(void 0, () => {
3207
+ function handleKeyDown(event) {
3208
+ if (event.altKey && event.code === "KeyT") {
3209
+ event.preventDefault();
3210
+ setVisible(!visible);
3049
3211
  }
3050
- )
3051
- ] });
3212
+ }
3213
+ document.addEventListener("keydown", handleKeyDown);
3214
+ return () => document.removeEventListener("keydown", handleKeyDown);
3215
+ }, [visible]);
3216
+ 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,
3217
+ Box,
3218
+ {
3219
+ m: "4",
3220
+ p: "4",
3221
+ className: "flex flex-col gap-2 border-[rgba(var(--border-color), 0.6)]",
3222
+ children: [
3223
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
3224
+ Select.Root,
3225
+ {
3226
+ variant: "solid",
3227
+ value: appearance,
3228
+ onValueChange: (change) => _optionalChain([onAppearanceChange, 'optionalCall', _50 => _50(change)]),
3229
+ children: [
3230
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Label, { position: "inside", children: "Theme Settings" }),
3231
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Trigger, {}),
3232
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Select.Content, { children: [
3233
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "light", children: "Light" }),
3234
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "dark", children: "Dark" })
3235
+ ] })
3236
+ ]
3237
+ }
3238
+ ),
3239
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
3240
+ Select.Root,
3241
+ {
3242
+ variant: "solid",
3243
+ value: radius,
3244
+ onValueChange: (change) => _optionalChain([onRadiusChange, 'optionalCall', _51 => _51(change)]),
3245
+ children: [
3246
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Label, { position: "inside", children: "Radius" }),
3247
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Trigger, {}),
3248
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Select.Content, { children: [
3249
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "none", children: "None" }),
3250
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "xs", children: "XS" }),
3251
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "sm", children: "SM" }),
3252
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "md", children: "MD" }),
3253
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "lg", children: "LG" }),
3254
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "xl", children: "XL" }),
3255
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "full", children: "FULL" })
3256
+ ] })
3257
+ ]
3258
+ }
3259
+ ),
3260
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
3261
+ Select.Root,
3262
+ {
3263
+ variant: "solid",
3264
+ value: roundness2,
3265
+ onValueChange: (change) => _optionalChain([onRoundnessChange, 'optionalCall', _52 => _52(change)]),
3266
+ children: [
3267
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Label, { className: "min-w-40!", position: "inside", children: "Roundness" }),
3268
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Trigger, {}),
3269
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Select.Content, { children: [
3270
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "1", children: "1" }),
3271
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "2", children: "2" }),
3272
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "3", children: "3" }),
3273
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "4", children: "4" }),
3274
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "5", children: "5" }),
3275
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "6", children: "6" })
3276
+ ] })
3277
+ ]
3278
+ }
3279
+ ),
3280
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
3281
+ Select.Root,
3282
+ {
3283
+ variant: "solid",
3284
+ value: spacing,
3285
+ onValueChange: (change) => _optionalChain([onSpacingChange, 'optionalCall', _53 => _53(change)]),
3286
+ children: [
3287
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Label, { position: "inside", children: "Spacing" }),
3288
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Trigger, {}),
3289
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Select.Content, { children: [
3290
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "xs", children: "XS" }),
3291
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "sm", children: "SM" }),
3292
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "md", children: "MD" }),
3293
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "lg", children: "LG" }),
3294
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Select.Item, { value: "xl", children: "XL" })
3295
+ ] })
3296
+ ]
3297
+ }
3298
+ )
3299
+ ]
3300
+ }
3301
+ ) }) });
3052
3302
  }
3053
3303
 
3054
3304
 
@@ -3064,5 +3314,7 @@ function ThemeControl() {
3064
3314
 
3065
3315
 
3066
3316
 
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;
3317
+
3318
+
3319
+ 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.Text = Text; exports.Theme = Theme; exports.ThemeControl = ThemeControl; exports.useTheme = useTheme;
3068
3320
  //# sourceMappingURL=index.js.map