xyne-components 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/dist/Badge/index.cjs +9 -0
  2. package/dist/Badge/index.cjs.map +1 -0
  3. package/dist/Badge/index.d.cts +24 -0
  4. package/dist/Badge/index.d.ts +24 -0
  5. package/dist/Badge/index.js +9 -0
  6. package/dist/Badge/index.js.map +1 -0
  7. package/dist/Directory/index.cjs +9 -0
  8. package/dist/Directory/index.cjs.map +1 -0
  9. package/dist/Directory/index.d.cts +34 -0
  10. package/dist/Directory/index.d.ts +34 -0
  11. package/dist/Directory/index.js +9 -0
  12. package/dist/Directory/index.js.map +1 -0
  13. package/dist/Label/index.cjs +9 -0
  14. package/dist/Label/index.cjs.map +1 -0
  15. package/dist/Label/index.d.cts +28 -0
  16. package/dist/Label/index.d.ts +28 -0
  17. package/dist/Label/index.js +9 -0
  18. package/dist/Label/index.js.map +1 -0
  19. package/dist/ListItem/index.cjs +9 -0
  20. package/dist/ListItem/index.cjs.map +1 -0
  21. package/dist/ListItem/index.d.cts +34 -0
  22. package/dist/ListItem/index.d.ts +34 -0
  23. package/dist/ListItem/index.js +9 -0
  24. package/dist/ListItem/index.js.map +1 -0
  25. package/dist/chunk-2452BBK4.js +219 -0
  26. package/dist/chunk-2452BBK4.js.map +1 -0
  27. package/dist/chunk-2JYR6C3L.cjs +219 -0
  28. package/dist/chunk-2JYR6C3L.cjs.map +1 -0
  29. package/dist/chunk-54N4ZTTL.js +173 -0
  30. package/dist/chunk-54N4ZTTL.js.map +1 -0
  31. package/dist/chunk-73U3B3WX.cjs +23 -0
  32. package/dist/chunk-73U3B3WX.cjs.map +1 -0
  33. package/dist/chunk-CNEANQ6B.js +23 -0
  34. package/dist/chunk-CNEANQ6B.js.map +1 -0
  35. package/dist/chunk-EJ4BXCSG.js +55 -0
  36. package/dist/chunk-EJ4BXCSG.js.map +1 -0
  37. package/dist/chunk-HAG5EYQ5.cjs +87 -0
  38. package/dist/chunk-HAG5EYQ5.cjs.map +1 -0
  39. package/dist/chunk-JKYZDOSJ.cjs +55 -0
  40. package/dist/chunk-JKYZDOSJ.cjs.map +1 -0
  41. package/dist/chunk-RVNFEWBE.js +87 -0
  42. package/dist/chunk-RVNFEWBE.js.map +1 -0
  43. package/dist/chunk-RXHOBQUJ.cjs +65 -0
  44. package/dist/chunk-RXHOBQUJ.cjs.map +1 -0
  45. package/dist/chunk-SEFQF2DQ.js +91 -0
  46. package/dist/chunk-SEFQF2DQ.js.map +1 -0
  47. package/dist/chunk-SRXGVBJ5.cjs +133 -0
  48. package/dist/chunk-SRXGVBJ5.cjs.map +1 -0
  49. package/dist/chunk-WUV742E6.cjs +173 -0
  50. package/dist/chunk-WUV742E6.cjs.map +1 -0
  51. package/dist/chunk-XF7A3MNW.cjs +91 -0
  52. package/dist/chunk-XF7A3MNW.cjs.map +1 -0
  53. package/dist/chunk-ZJ3XTUYJ.js +65 -0
  54. package/dist/chunk-ZJ3XTUYJ.js.map +1 -0
  55. package/dist/chunk-ZS6WGFYT.js +133 -0
  56. package/dist/chunk-ZS6WGFYT.js.map +1 -0
  57. package/dist/colorScheme.types-CqDRrNL0.d.cts +54 -0
  58. package/dist/colorScheme.types-CqDRrNL0.d.ts +54 -0
  59. package/dist/hooks/index.cjs +11 -0
  60. package/dist/hooks/index.cjs.map +1 -0
  61. package/dist/hooks/index.d.cts +20 -0
  62. package/dist/hooks/index.d.ts +20 -0
  63. package/dist/hooks/index.js +11 -0
  64. package/dist/hooks/index.js.map +1 -0
  65. package/dist/index.cjs +26 -560
  66. package/dist/index.cjs.map +1 -1
  67. package/dist/index.d.cts +10 -176
  68. package/dist/index.d.ts +10 -176
  69. package/dist/index.js +29 -517
  70. package/dist/index.js.map +1 -1
  71. package/dist/polymorphic-BpYm1AeE.d.cts +115 -0
  72. package/dist/polymorphic-BpYm1AeE.d.ts +115 -0
  73. package/dist/styles/index.css +23 -8
  74. package/dist/theme/index.cjs +16 -0
  75. package/dist/theme/index.cjs.map +1 -0
  76. package/dist/theme/index.d.cts +56 -0
  77. package/dist/theme/index.d.ts +56 -0
  78. package/dist/theme/index.js +16 -0
  79. package/dist/theme/index.js.map +1 -0
  80. package/dist/utils/index.cjs +8 -0
  81. package/dist/utils/index.cjs.map +1 -0
  82. package/dist/utils/index.d.cts +7 -0
  83. package/dist/utils/index.d.ts +7 -0
  84. package/dist/utils/index.js +8 -0
  85. package/dist/utils/index.js.map +1 -0
  86. package/package.json +39 -3
@@ -0,0 +1,173 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
+
3
+ // src/theme/defaultTheme.ts
4
+ var DEFAULT_THEME = {
5
+ colors: {
6
+ orange: {
7
+ "50": "#fff7ed",
8
+ "100": "#ffedd4",
9
+ "200": "#ffd6a8",
10
+ "300": "#ffb86a",
11
+ "400": "#ff8904",
12
+ "500": "#fe6d36",
13
+ "600": "#ea580c",
14
+ "700": "#c2410c"
15
+ },
16
+ gray: {
17
+ "25": "#f6f8fa",
18
+ "50": "#f9fafb",
19
+ "100": "#f2f4f7",
20
+ "200": "#e4e7ec",
21
+ "300": "#d0d5dd",
22
+ "400": "#98a2b3",
23
+ "500": "#667085",
24
+ "600": "#475467",
25
+ "700": "#344054",
26
+ "800": "#1d2939",
27
+ "900": "#101828"
28
+ },
29
+ red: {
30
+ "50": "#fef3f2",
31
+ "500": "#f04438",
32
+ "600": "#d92d20",
33
+ "700": "#b42318"
34
+ },
35
+ green: {
36
+ "50": "#ecfdf3",
37
+ "500": "#12b76a",
38
+ "600": "#039855",
39
+ "700": "#027a48"
40
+ },
41
+ yellow: {
42
+ "50": "#fffaeb",
43
+ "500": "#f79009",
44
+ "600": "#dc6803",
45
+ "700": "#b54708"
46
+ },
47
+ blue: {
48
+ "50": "#eff8ff",
49
+ "500": "#2e90fa",
50
+ "600": "#1570ef",
51
+ "700": "#175cd3"
52
+ },
53
+ purple: {
54
+ "50": "#f9f5ff",
55
+ "500": "#9e77ed",
56
+ "600": "#7f56d9",
57
+ "700": "#6941c6"
58
+ },
59
+ teal: {
60
+ "50": "#f0fdf9",
61
+ "500": "#15b79e",
62
+ "600": "#0e9384",
63
+ "700": "#107569"
64
+ }
65
+ },
66
+ text: {
67
+ primary: "#101828",
68
+ secondary: "#475467",
69
+ tertiary: "#667085",
70
+ disabled: "#c9d0db",
71
+ brand: "#e8601a",
72
+ inverse: "#f1f5f9",
73
+ error: "#d92d20",
74
+ success: "#039855",
75
+ warning: "#b54708"
76
+ },
77
+ bg: {
78
+ white: "#ffffff",
79
+ subtle: "#f9fafb",
80
+ surfaceHover: "#f1f5f9",
81
+ brand: "#fff4ee",
82
+ error: "#fef3f2",
83
+ success: "#ecfdf3",
84
+ warning: "#fffaeb",
85
+ neutral: "#f9fafb",
86
+ purple: "#f9f5ff",
87
+ blue: "#eff8ff",
88
+ teal: "#f0fdf9"
89
+ },
90
+ border: {
91
+ default: "#d6dce6",
92
+ subtle: "#f1f5f9",
93
+ strong: "#98a2b3",
94
+ brand: "#fe6d36",
95
+ error: "#fda29b"
96
+ },
97
+ shadow: {
98
+ xs: "0 1px 2px 0 rgba(16, 24, 40, 0.05)",
99
+ sm: "0 1px 3px 0 rgba(16, 24, 40, 0.1), 0 1px 2px -1px rgba(16, 24, 40, 0.1)",
100
+ md: "0 4px 6px -1px rgba(16, 24, 40, 0.1), 0 2px 4px -2px rgba(16, 24, 40, 0.1)",
101
+ pressed: "inset 0 0 4px 0 rgba(0, 0, 0, 0.15)"
102
+ },
103
+ radius: {
104
+ xs: "2px",
105
+ sm: "4px",
106
+ md: "8px",
107
+ lg: "12px",
108
+ xl: "16px",
109
+ full: "9999px"
110
+ },
111
+ spacing: {
112
+ "0": "0px",
113
+ "1": "2px",
114
+ "2": "4px",
115
+ "3": "6px",
116
+ "4": "8px",
117
+ "5": "10px",
118
+ "6": "12px",
119
+ "7": "14px",
120
+ "8": "16px",
121
+ "9": "18px",
122
+ "10": "20px",
123
+ "12": "24px",
124
+ "16": "32px"
125
+ },
126
+ fontFamily: "Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
127
+ fontWeight: {
128
+ regular: "400",
129
+ medium: "500",
130
+ semibold: "600",
131
+ bold: "700"
132
+ },
133
+ fontSize: {
134
+ "2xs": "10px",
135
+ xs: "11px",
136
+ sm: "12px",
137
+ md: "14px",
138
+ lg: "16px",
139
+ xl: "18px"
140
+ },
141
+ lineHeight: {
142
+ "2xs": "14px",
143
+ xs: "16px",
144
+ sm: "18px",
145
+ md: "20px",
146
+ lg: "24px",
147
+ xl: "28px"
148
+ },
149
+ other: {},
150
+ components: {}
151
+ };
152
+
153
+ // src/theme/ThemeContext.ts
154
+ var _react = require('react');
155
+ var ThemeContext = _react.createContext.call(void 0, DEFAULT_THEME);
156
+
157
+ // src/theme/ColorSchemeContext.ts
158
+
159
+ var ColorSchemeContext = _react.createContext.call(void 0, {
160
+ colorScheme: "light",
161
+ resolvedColorScheme: "light",
162
+ setColorScheme: () => {
163
+ },
164
+ toggleColorScheme: () => {
165
+ }
166
+ });
167
+
168
+
169
+
170
+
171
+
172
+ exports.DEFAULT_THEME = DEFAULT_THEME; exports.ThemeContext = ThemeContext; exports.ColorSchemeContext = ColorSchemeContext;
173
+ //# sourceMappingURL=chunk-WUV742E6.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/Users/harshpreet.singh/Desktop/Juspay/xyne-spaces/components/dist/chunk-WUV742E6.cjs","../src/theme/defaultTheme.ts","../src/theme/ThemeContext.ts","../src/theme/ColorSchemeContext.ts"],"names":["createContext"],"mappings":"AAAA,qFAAY;AACZ;AACA;ACIO,IAAM,cAAA,EAA2B;AAAA,EACtC,MAAA,EAAQ;AAAA,IACN,MAAA,EAAQ;AAAA,MACN,IAAA,EAAM,SAAA;AAAA,MACN,KAAA,EAAO,SAAA;AAAA,MACP,KAAA,EAAO,SAAA;AAAA,MACP,KAAA,EAAO,SAAA;AAAA,MACP,KAAA,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AA8B;AAIvB,IAAM,aAAA,EAAe,kCAAA,aAAsC,CAAA;AFuJlE;AACA;AG5JA;AAIO,IAAM,mBAAA,EAAqBA,kCAAAA;AAAuC,EACvE,WAAA,EAAa,OAAA;AAAA,EACb,mBAAA,EAAqB,OAAA;AAAA,EACrB,cAAA,EAAgB,CAAA,EAAA,GAAM;AAAA,EAAC,CAAA;AAAA,EACvB,iBAAA,EAAmB,CAAA,EAAA,GAAM;AAAA,EAAC;AAC5B,CAAC,CAAA;AH6JD;AACA;AACE;AACA;AACA;AACF,4HAAC","file":"/Users/harshpreet.singh/Desktop/Juspay/xyne-spaces/components/dist/chunk-WUV742E6.cjs","sourcesContent":[null,"import type { XyneTheme } from './types'\n\n/**\n * Default theme — values match tokens.css (light mode).\n * Used as the base for createTheme() deep-merge.\n */\nexport const DEFAULT_THEME: XyneTheme = {\n colors: {\n orange: {\n '50': '#fff7ed',\n '100': '#ffedd4',\n '200': '#ffd6a8',\n '300': '#ffb86a',\n '400': '#ff8904',\n '500': '#fe6d36',\n '600': '#ea580c',\n '700': '#c2410c',\n },\n gray: {\n '25': '#f6f8fa',\n '50': '#f9fafb',\n '100': '#f2f4f7',\n '200': '#e4e7ec',\n '300': '#d0d5dd',\n '400': '#98a2b3',\n '500': '#667085',\n '600': '#475467',\n '700': '#344054',\n '800': '#1d2939',\n '900': '#101828',\n },\n red: {\n '50': '#fef3f2',\n '500': '#f04438',\n '600': '#d92d20',\n '700': '#b42318',\n },\n green: {\n '50': '#ecfdf3',\n '500': '#12b76a',\n '600': '#039855',\n '700': '#027a48',\n },\n yellow: {\n '50': '#fffaeb',\n '500': '#f79009',\n '600': '#dc6803',\n '700': '#b54708',\n },\n blue: {\n '50': '#eff8ff',\n '500': '#2e90fa',\n '600': '#1570ef',\n '700': '#175cd3',\n },\n purple: {\n '50': '#f9f5ff',\n '500': '#9e77ed',\n '600': '#7f56d9',\n '700': '#6941c6',\n },\n teal: {\n '50': '#f0fdf9',\n '500': '#15b79e',\n '600': '#0e9384',\n '700': '#107569',\n },\n },\n\n text: {\n primary: '#101828',\n secondary: '#475467',\n tertiary: '#667085',\n disabled: '#c9d0db',\n brand: '#e8601a',\n inverse: '#f1f5f9',\n error: '#d92d20',\n success: '#039855',\n warning: '#b54708',\n },\n\n bg: {\n white: '#ffffff',\n subtle: '#f9fafb',\n surfaceHover: '#f1f5f9',\n brand: '#fff4ee',\n error: '#fef3f2',\n success: '#ecfdf3',\n warning: '#fffaeb',\n neutral: '#f9fafb',\n purple: '#f9f5ff',\n blue: '#eff8ff',\n teal: '#f0fdf9',\n },\n\n border: {\n default: '#d6dce6',\n subtle: '#f1f5f9',\n strong: '#98a2b3',\n brand: '#fe6d36',\n error: '#fda29b',\n },\n\n shadow: {\n xs: '0 1px 2px 0 rgba(16, 24, 40, 0.05)',\n sm: '0 1px 3px 0 rgba(16, 24, 40, 0.1), 0 1px 2px -1px rgba(16, 24, 40, 0.1)',\n md: '0 4px 6px -1px rgba(16, 24, 40, 0.1), 0 2px 4px -2px rgba(16, 24, 40, 0.1)',\n pressed: 'inset 0 0 4px 0 rgba(0, 0, 0, 0.15)',\n },\n\n radius: {\n xs: '2px',\n sm: '4px',\n md: '8px',\n lg: '12px',\n xl: '16px',\n full: '9999px',\n },\n\n spacing: {\n '0': '0px',\n '1': '2px',\n '2': '4px',\n '3': '6px',\n '4': '8px',\n '5': '10px',\n '6': '12px',\n '7': '14px',\n '8': '16px',\n '9': '18px',\n '10': '20px',\n '12': '24px',\n '16': '32px',\n },\n\n fontFamily: \"Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\",\n\n fontWeight: {\n regular: '400',\n medium: '500',\n semibold: '600',\n bold: '700',\n },\n\n fontSize: {\n '2xs': '10px',\n xs: '11px',\n sm: '12px',\n md: '14px',\n lg: '16px',\n xl: '18px',\n },\n\n lineHeight: {\n '2xs': '14px',\n xs: '16px',\n sm: '18px',\n md: '20px',\n lg: '24px',\n xl: '28px',\n },\n\n other: {},\n components: {},\n}\n","import { createContext } from 'react'\nimport type { XyneTheme } from './types'\nimport { DEFAULT_THEME } from './defaultTheme'\n\nexport const ThemeContext = createContext<XyneTheme>(DEFAULT_THEME)\n","import { createContext } from 'react'\nimport type { ColorSchemeContextValue } from './colorScheme.types'\n\n/** Default (no-op) context — consumers outside a provider get static 'light'. */\nexport const ColorSchemeContext = createContext<ColorSchemeContextValue>({\n colorScheme: 'light',\n resolvedColorScheme: 'light',\n setColorScheme: () => {},\n toggleColorScheme: () => {},\n})\n"]}
@@ -0,0 +1,91 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
2
+
3
+
4
+ var _chunkSRXGVBJ5cjs = require('./chunk-SRXGVBJ5.cjs');
5
+
6
+ // src/Directory/Directory.tsx
7
+ var _react = require('react'); var _react2 = _interopRequireDefault(_react);
8
+ var _jsxruntime = require('react/jsx-runtime');
9
+ var Directory = _react2.default.forwardRef(function DirectoryInner({
10
+ label,
11
+ variant = "closed",
12
+ leading,
13
+ trailing,
14
+ onHeaderClick,
15
+ children,
16
+ slots,
17
+ slotProps,
18
+ sx,
19
+ className,
20
+ style,
21
+ component,
22
+ ...rest
23
+ }, ref) {
24
+ const Root = _nullishCoalesce(_nullishCoalesce(_optionalChain([slots, 'optionalAccess', _ => _.root]), () => ( component)), () => ( "div"));
25
+ const Header = _nullishCoalesce(_optionalChain([slots, 'optionalAccess', _2 => _2.header]), () => ( "button"));
26
+ const Leading = _nullishCoalesce(_optionalChain([slots, 'optionalAccess', _3 => _3.leading]), () => ( "span"));
27
+ const Trailing = _nullishCoalesce(_optionalChain([slots, 'optionalAccess', _4 => _4.trailing]), () => ( "span"));
28
+ const Content = _nullishCoalesce(_optionalChain([slots, 'optionalAccess', _5 => _5.content]), () => ( "div"));
29
+ const sxStyles = _chunkSRXGVBJ5cjs.resolveSx.call(void 0, sx);
30
+ const headerProps = Header === "button" ? { type: "button", ..._optionalChain([slotProps, 'optionalAccess', _6 => _6.header]) } : _optionalChain([slotProps, 'optionalAccess', _7 => _7.header]);
31
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
32
+ Root,
33
+ {
34
+ ref,
35
+ ..._optionalChain([slotProps, 'optionalAccess', _8 => _8.root]),
36
+ ...rest,
37
+ className: `xc-directory${className ? ` ${className}` : ""}`,
38
+ "data-variant": variant,
39
+ style: { ..._optionalChain([slotProps, 'optionalAccess', _9 => _9.root, 'optionalAccess', _10 => _10.style]), ...sxStyles, ...style },
40
+ children: [
41
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
42
+ Header,
43
+ {
44
+ ...headerProps,
45
+ className: "xc-directory__header",
46
+ "aria-expanded": variant === "opened",
47
+ onClick: (e) => {
48
+ _optionalChain([slotProps, 'optionalAccess', _11 => _11.header, 'optionalAccess', _12 => _12.onClick, 'optionalCall', _13 => _13(e)]);
49
+ _optionalChain([onHeaderClick, 'optionalCall', _14 => _14(e)]);
50
+ },
51
+ children: [
52
+ leading != null && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
53
+ Leading,
54
+ {
55
+ ..._optionalChain([slotProps, 'optionalAccess', _15 => _15.leading]),
56
+ className: "xc-directory__leading",
57
+ "aria-hidden": "true",
58
+ children: leading
59
+ }
60
+ ),
61
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "xc-directory__text", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "xc-directory__label", children: label }) }),
62
+ trailing != null && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
63
+ Trailing,
64
+ {
65
+ ..._optionalChain([slotProps, 'optionalAccess', _16 => _16.trailing]),
66
+ className: "xc-directory__trailing",
67
+ "aria-hidden": "true",
68
+ children: trailing
69
+ }
70
+ )
71
+ ]
72
+ }
73
+ ),
74
+ variant === "opened" && children != null && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
75
+ Content,
76
+ {
77
+ ..._optionalChain([slotProps, 'optionalAccess', _17 => _17.content]),
78
+ className: "xc-directory__content",
79
+ children
80
+ }
81
+ )
82
+ ]
83
+ }
84
+ );
85
+ });
86
+ Directory.displayName = "Directory";
87
+
88
+
89
+
90
+ exports.Directory = Directory;
91
+ //# sourceMappingURL=chunk-XF7A3MNW.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/Users/harshpreet.singh/Desktop/Juspay/xyne-spaces/components/dist/chunk-XF7A3MNW.cjs","../src/Directory/Directory.tsx"],"names":[],"mappings":"AAAA,6xBAAY;AACZ;AACE;AACF,wDAA6B;AAC7B;AACA;ACLA,4EAAkB;AAiFZ,+CAAA;AAxCC,IAAM,UAAA,EAAgC,eAAA,CAAM,UAAA,CAAW,SAAS,cAAA,CACrE;AAAA,EACE,KAAA;AAAA,EACA,QAAA,EAAU,QAAA;AAAA,EACV,OAAA;AAAA,EACA,QAAA;AAAA,EACA,aAAA;AAAA,EACA,QAAA;AAAA,EACA,KAAA;AAAA,EACA,SAAA;AAAA,EACA,EAAA;AAAA,EACA,SAAA;AAAA,EACA,KAAA;AAAA,EACA,SAAA;AAAA,EACA,GAAG;AACL,CAAA,EACA,GAAA,EACA;AACA,EAAA,MAAM,KAAA,oDAAQ,KAAA,2BAAO,MAAA,UAAQ,WAAA,UAAa,OAAA;AAC1C,EAAA,MAAM,OAAA,mCAAU,KAAA,6BAAO,QAAA,UAAU,UAAA;AACjC,EAAA,MAAM,QAAA,mCAAW,KAAA,6B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7A3MNW.cjs","sourcesContent":[null,"import React from 'react'\nimport type { PolymorphicComponentPropsWithRef, SxProp } from '../utils'\nimport { resolveSx } from '../utils'\n\nexport type DirectoryVariant = 'opened' | 'closed'\n\nexport type DirectorySlots = {\n root?: React.ElementType\n header?: React.ElementType\n leading?: React.ElementType\n trailing?: React.ElementType\n content?: React.ElementType\n}\n\nexport type DirectorySlotProps = {\n root?: React.HTMLAttributes<HTMLElement>\n header?: React.ButtonHTMLAttributes<HTMLButtonElement>\n leading?: React.HTMLAttributes<HTMLSpanElement>\n trailing?: React.HTMLAttributes<HTMLSpanElement>\n content?: React.HTMLAttributes<HTMLDivElement>\n}\n\ntype DirectoryOwnProps = {\n label?: string\n variant?: DirectoryVariant\n leading?: React.ReactNode\n trailing?: React.ReactNode\n onHeaderClick?: React.MouseEventHandler<HTMLButtonElement>\n children?: React.ReactNode\n slots?: DirectorySlots\n slotProps?: DirectorySlotProps\n sx?: SxProp\n}\n\nexport type DirectoryProps<C extends React.ElementType = 'div'> =\n PolymorphicComponentPropsWithRef<C, DirectoryOwnProps>\n\ntype DirectoryComponent = <C extends React.ElementType = 'div'>(\n props: DirectoryProps<C>,\n) => React.ReactElement | null\n\nexport const Directory: DirectoryComponent = React.forwardRef(function DirectoryInner(\n {\n label,\n variant = 'closed',\n leading,\n trailing,\n onHeaderClick,\n children,\n slots,\n slotProps,\n sx,\n className,\n style,\n component,\n ...rest\n }: DirectoryProps<React.ElementType>,\n ref: React.Ref<Element>,\n) {\n const Root = (slots?.root ?? component ?? 'div') as React.ElementType\n const Header = (slots?.header ?? 'button') as React.ElementType\n const Leading = (slots?.leading ?? 'span') as React.ElementType\n const Trailing = (slots?.trailing ?? 'span') as React.ElementType\n const Content = (slots?.content ?? 'div') as React.ElementType\n\n const sxStyles = resolveSx(sx)\n\n const headerProps =\n Header === 'button'\n ? { type: 'button' as const, ...slotProps?.header }\n : slotProps?.header\n\n return (\n <Root\n ref={ref}\n {...slotProps?.root}\n {...rest}\n className={`xc-directory${className ? ` ${className}` : ''}`}\n data-variant={variant}\n style={{ ...slotProps?.root?.style, ...sxStyles, ...style }}\n >\n <Header\n {...headerProps}\n className=\"xc-directory__header\"\n aria-expanded={variant === 'opened'}\n onClick={(e: React.MouseEvent<HTMLButtonElement>) => {\n slotProps?.header?.onClick?.(e)\n onHeaderClick?.(e)\n }}\n >\n {leading != null && (\n <Leading\n {...slotProps?.leading}\n className=\"xc-directory__leading\"\n aria-hidden=\"true\"\n >\n {leading}\n </Leading>\n )}\n\n <span className=\"xc-directory__text\">\n <span className=\"xc-directory__label\">{label}</span>\n </span>\n\n {trailing != null && (\n <Trailing\n {...slotProps?.trailing}\n className=\"xc-directory__trailing\"\n aria-hidden=\"true\"\n >\n {trailing}\n </Trailing>\n )}\n </Header>\n\n {variant === 'opened' && children != null && (\n <Content\n {...slotProps?.content}\n className=\"xc-directory__content\"\n >\n {children}\n </Content>\n )}\n </Root>\n )\n}) as unknown as DirectoryComponent\n\n;(Directory as { displayName?: string }).displayName = 'Directory'\n"]}
@@ -0,0 +1,65 @@
1
+ "use client";
2
+ import {
3
+ resolveSx
4
+ } from "./chunk-ZS6WGFYT.js";
5
+
6
+ // src/Label/Label.tsx
7
+ import React from "react";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+ var Label = React.forwardRef(function LabelInner({
10
+ children,
11
+ variant = "closed",
12
+ leading,
13
+ trailing,
14
+ slots,
15
+ slotProps,
16
+ sx,
17
+ className,
18
+ style,
19
+ component,
20
+ ...rest
21
+ }, ref) {
22
+ const Root = slots?.root ?? component ?? "button";
23
+ const Leading = slots?.leading ?? "span";
24
+ const Trailing = slots?.trailing ?? "span";
25
+ const sxStyles = resolveSx(sx);
26
+ const rootProps = Root === "button" ? { type: "button", ...slotProps?.root } : slotProps?.root;
27
+ return /* @__PURE__ */ jsxs(
28
+ Root,
29
+ {
30
+ ref,
31
+ ...rootProps,
32
+ ...rest,
33
+ className: `xc-label${className ? ` ${className}` : ""}`,
34
+ "data-variant": variant,
35
+ style: { ...slotProps?.root?.style, ...sxStyles, ...style },
36
+ children: [
37
+ leading != null && /* @__PURE__ */ jsx(
38
+ Leading,
39
+ {
40
+ ...slotProps?.leading,
41
+ className: "xc-label__leading",
42
+ "aria-hidden": "true",
43
+ children: leading
44
+ }
45
+ ),
46
+ /* @__PURE__ */ jsx("span", { className: "xc-label__text", children: /* @__PURE__ */ jsx("span", { className: "xc-label__content", children }) }),
47
+ trailing != null && /* @__PURE__ */ jsx(
48
+ Trailing,
49
+ {
50
+ ...slotProps?.trailing,
51
+ className: "xc-label__trailing",
52
+ "aria-hidden": "true",
53
+ children: trailing
54
+ }
55
+ )
56
+ ]
57
+ }
58
+ );
59
+ });
60
+ Label.displayName = "Label";
61
+
62
+ export {
63
+ Label
64
+ };
65
+ //# sourceMappingURL=chunk-ZJ3XTUYJ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/Label/Label.tsx"],"sourcesContent":["import React from 'react'\nimport type { PolymorphicComponentPropsWithRef, SxProp } from '../utils'\nimport { resolveSx } from '../utils'\n\nexport type LabelVariant = 'opened' | 'closed'\n\nexport type LabelSlots = {\n root?: React.ElementType\n leading?: React.ElementType\n trailing?: React.ElementType\n}\n\nexport type LabelSlotProps = {\n root?: React.HTMLAttributes<HTMLElement>\n leading?: React.HTMLAttributes<HTMLSpanElement>\n trailing?: React.HTMLAttributes<HTMLSpanElement>\n}\n\ntype LabelOwnProps = {\n children?: React.ReactNode\n variant?: LabelVariant\n leading?: React.ReactNode\n trailing?: React.ReactNode\n slots?: LabelSlots\n slotProps?: LabelSlotProps\n sx?: SxProp\n}\n\nexport type LabelProps<C extends React.ElementType = 'button'> =\n PolymorphicComponentPropsWithRef<C, LabelOwnProps>\n\ntype LabelComponent = <C extends React.ElementType = 'button'>(\n props: LabelProps<C>,\n) => React.ReactElement | null\n\nexport const Label: LabelComponent = React.forwardRef(function LabelInner(\n {\n children,\n variant = 'closed',\n leading,\n trailing,\n slots,\n slotProps,\n sx,\n className,\n style,\n component,\n ...rest\n }: LabelProps<React.ElementType>,\n ref: React.Ref<Element>,\n) {\n const Root = (slots?.root ?? component ?? 'button') as React.ElementType\n const Leading = (slots?.leading ?? 'span') as React.ElementType\n const Trailing = (slots?.trailing ?? 'span') as React.ElementType\n\n const sxStyles = resolveSx(sx)\n\n const rootProps =\n Root === 'button' ? { type: 'button' as const, ...slotProps?.root } : slotProps?.root\n\n return (\n <Root\n ref={ref}\n {...rootProps}\n {...rest}\n className={`xc-label${className ? ` ${className}` : ''}`}\n data-variant={variant}\n style={{ ...slotProps?.root?.style, ...sxStyles, ...style }}\n >\n {leading != null && (\n <Leading\n {...slotProps?.leading}\n className=\"xc-label__leading\"\n aria-hidden=\"true\"\n >\n {leading}\n </Leading>\n )}\n\n <span className=\"xc-label__text\">\n <span className=\"xc-label__content\">{children}</span>\n </span>\n\n {trailing != null && (\n <Trailing\n {...slotProps?.trailing}\n className=\"xc-label__trailing\"\n aria-hidden=\"true\"\n >\n {trailing}\n </Trailing>\n )}\n </Root>\n )\n}) as unknown as LabelComponent\n\n;(Label as { displayName?: string }).displayName = 'Label'\n"],"mappings":";;;;;;AAAA,OAAO,WAAW;AA6Dd,SASI,KATJ;AA1BG,IAAM,QAAwB,MAAM,WAAW,SAAS,WAC7D;AAAA,EACE;AAAA,EACA,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GACA,KACA;AACA,QAAM,OAAQ,OAAO,QAAQ,aAAa;AAC1C,QAAM,UAAW,OAAO,WAAW;AACnC,QAAM,WAAY,OAAO,YAAY;AAErC,QAAM,WAAW,UAAU,EAAE;AAE7B,QAAM,YACJ,SAAS,WAAW,EAAE,MAAM,UAAmB,GAAG,WAAW,KAAK,IAAI,WAAW;AAEnF,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACC,GAAG;AAAA,MACH,GAAG;AAAA,MACJ,WAAW,WAAW,YAAY,IAAI,SAAS,KAAK,EAAE;AAAA,MACtD,gBAAc;AAAA,MACd,OAAO,EAAE,GAAG,WAAW,MAAM,OAAO,GAAG,UAAU,GAAG,MAAM;AAAA,MAEzD;AAAA,mBAAW,QACV;AAAA,UAAC;AAAA;AAAA,YACE,GAAG,WAAW;AAAA,YACf,WAAU;AAAA,YACV,eAAY;AAAA,YAEX;AAAA;AAAA,QACH;AAAA,QAGF,oBAAC,UAAK,WAAU,kBACd,8BAAC,UAAK,WAAU,qBAAqB,UAAS,GAChD;AAAA,QAEC,YAAY,QACX;AAAA,UAAC;AAAA;AAAA,YACE,GAAG,WAAW;AAAA,YACf,WAAU;AAAA,YACV,eAAY;AAAA,YAEX;AAAA;AAAA,QACH;AAAA;AAAA;AAAA,EAEJ;AAEJ,CAAC;AAEC,MAAmC,cAAc;","names":[]}
@@ -0,0 +1,133 @@
1
+ "use client";
2
+
3
+ // src/utils/sx.ts
4
+ var SPACE_SCALE = {
5
+ 0: "0px",
6
+ 1: "2px",
7
+ 2: "4px",
8
+ 3: "6px",
9
+ 4: "8px",
10
+ 5: "10px",
11
+ 6: "12px",
12
+ 7: "14px",
13
+ 8: "16px",
14
+ 9: "18px",
15
+ 10: "20px",
16
+ 11: "22px",
17
+ 12: "24px",
18
+ 13: "26px",
19
+ 14: "28px",
20
+ 15: "30px",
21
+ 16: "32px"
22
+ };
23
+ function resolveSpacing(val) {
24
+ if (val == null) return void 0;
25
+ if (typeof val === "number") {
26
+ return SPACE_SCALE[val] !== void 0 ? SPACE_SCALE[val] : `${val * 4}px`;
27
+ }
28
+ return val;
29
+ }
30
+ function resolveSx(sx) {
31
+ if (!sx) return {};
32
+ const css = {};
33
+ const sp = resolveSpacing;
34
+ if (sx.m != null) css.margin = sp(sx.m);
35
+ if (sx.mt != null) css.marginTop = sp(sx.mt);
36
+ if (sx.mr != null) css.marginRight = sp(sx.mr);
37
+ if (sx.mb != null) css.marginBottom = sp(sx.mb);
38
+ if (sx.ml != null) css.marginLeft = sp(sx.ml);
39
+ if (sx.mx != null) {
40
+ css.marginLeft = sp(sx.mx);
41
+ css.marginRight = sp(sx.mx);
42
+ }
43
+ if (sx.my != null) {
44
+ css.marginTop = sp(sx.my);
45
+ css.marginBottom = sp(sx.my);
46
+ }
47
+ if (sx.p != null) css.padding = sp(sx.p);
48
+ if (sx.pt != null) css.paddingTop = sp(sx.pt);
49
+ if (sx.pr != null) css.paddingRight = sp(sx.pr);
50
+ if (sx.pb != null) css.paddingBottom = sp(sx.pb);
51
+ if (sx.pl != null) css.paddingLeft = sp(sx.pl);
52
+ if (sx.px != null) {
53
+ css.paddingLeft = sp(sx.px);
54
+ css.paddingRight = sp(sx.px);
55
+ }
56
+ if (sx.py != null) {
57
+ css.paddingTop = sp(sx.py);
58
+ css.paddingBottom = sp(sx.py);
59
+ }
60
+ if (sx.gap != null) css.gap = sp(sx.gap);
61
+ if (sx.rowGap != null) css.rowGap = sp(sx.rowGap);
62
+ if (sx.columnGap != null) css.columnGap = sp(sx.columnGap);
63
+ if (sx.width != null) css.width = sp(sx.width);
64
+ if (sx.height != null) css.height = sp(sx.height);
65
+ if (sx.minWidth != null) css.minWidth = sp(sx.minWidth);
66
+ if (sx.maxWidth != null) css.maxWidth = sp(sx.maxWidth);
67
+ if (sx.minHeight != null) css.minHeight = sp(sx.minHeight);
68
+ if (sx.maxHeight != null) css.maxHeight = sp(sx.maxHeight);
69
+ if (sx.top != null) css.top = sp(sx.top);
70
+ if (sx.right != null) css.right = sp(sx.right);
71
+ if (sx.bottom != null) css.bottom = sp(sx.bottom);
72
+ if (sx.left != null) css.left = sp(sx.left);
73
+ if (sx.fontSize != null) css.fontSize = sp(sx.fontSize);
74
+ if (sx.letterSpacing != null) css.letterSpacing = sp(sx.letterSpacing);
75
+ if (sx.borderRadius != null) css.borderRadius = sp(sx.borderRadius);
76
+ if (sx.borderWidth != null) css.borderWidth = sp(sx.borderWidth);
77
+ const passthrough = [
78
+ "display",
79
+ "flexDirection",
80
+ "flexWrap",
81
+ "flex",
82
+ "flexShrink",
83
+ "flexGrow",
84
+ "alignItems",
85
+ "alignSelf",
86
+ "justifyContent",
87
+ "justifySelf",
88
+ "position",
89
+ "zIndex",
90
+ "overflow",
91
+ "overflowX",
92
+ "overflowY",
93
+ "color",
94
+ "backgroundColor",
95
+ "background",
96
+ "opacity",
97
+ "visibility",
98
+ "fontWeight",
99
+ "lineHeight",
100
+ "fontFamily",
101
+ "textAlign",
102
+ "textDecoration",
103
+ "textTransform",
104
+ "whiteSpace",
105
+ "aspectRatio",
106
+ "border",
107
+ "borderTop",
108
+ "borderRight",
109
+ "borderBottom",
110
+ "borderLeft",
111
+ "borderColor",
112
+ "boxShadow",
113
+ "outline",
114
+ "cursor",
115
+ "pointerEvents",
116
+ "userSelect",
117
+ "transition",
118
+ "transform"
119
+ ];
120
+ for (const key of passthrough) {
121
+ const val = sx[key];
122
+ if (val != null) {
123
+ ;
124
+ css[key] = val;
125
+ }
126
+ }
127
+ return css;
128
+ }
129
+
130
+ export {
131
+ resolveSx
132
+ };
133
+ //# sourceMappingURL=chunk-ZS6WGFYT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utils/sx.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\n\nconst SPACE_SCALE: Record<number, string> = {\n 0: '0px',\n 1: '2px',\n 2: '4px',\n 3: '6px',\n 4: '8px',\n 5: '10px',\n 6: '12px',\n 7: '14px',\n 8: '16px',\n 9: '18px',\n 10: '20px',\n 11: '22px',\n 12: '24px',\n 13: '26px',\n 14: '28px',\n 15: '30px',\n 16: '32px',\n}\n\ntype SxValue = string | number | null | undefined\n\nexport type SxProp = {\n m?: SxValue\n mt?: SxValue\n mr?: SxValue\n mb?: SxValue\n ml?: SxValue\n mx?: SxValue\n my?: SxValue\n p?: SxValue\n pt?: SxValue\n pr?: SxValue\n pb?: SxValue\n pl?: SxValue\n px?: SxValue\n py?: SxValue\n gap?: SxValue\n rowGap?: SxValue\n columnGap?: SxValue\n width?: SxValue\n height?: SxValue\n minWidth?: SxValue\n maxWidth?: SxValue\n minHeight?: SxValue\n maxHeight?: SxValue\n display?: CSSProperties['display']\n flexDirection?: CSSProperties['flexDirection']\n flexWrap?: CSSProperties['flexWrap']\n flex?: CSSProperties['flex']\n flexShrink?: CSSProperties['flexShrink']\n flexGrow?: CSSProperties['flexGrow']\n alignItems?: CSSProperties['alignItems']\n alignSelf?: CSSProperties['alignSelf']\n justifyContent?: CSSProperties['justifyContent']\n justifySelf?: CSSProperties['justifySelf']\n position?: CSSProperties['position']\n top?: SxValue\n right?: SxValue\n bottom?: SxValue\n left?: SxValue\n zIndex?: CSSProperties['zIndex']\n overflow?: CSSProperties['overflow']\n overflowX?: CSSProperties['overflowX']\n overflowY?: CSSProperties['overflowY']\n color?: string\n backgroundColor?: string\n background?: string\n opacity?: number\n visibility?: CSSProperties['visibility']\n fontSize?: SxValue\n /** CSS font-weight — pass a number (400, 500, 700) or string ('bold'). NOT scaled. */\n fontWeight?: CSSProperties['fontWeight']\n /** CSS line-height — pass a number (1.5), px string ('20px'), or unitless ('1'). NOT scaled. */\n lineHeight?: CSSProperties['lineHeight']\n fontFamily?: string\n textAlign?: CSSProperties['textAlign']\n textDecoration?: CSSProperties['textDecoration']\n textTransform?: CSSProperties['textTransform']\n whiteSpace?: CSSProperties['whiteSpace']\n letterSpacing?: SxValue\n aspectRatio?: CSSProperties['aspectRatio']\n border?: string\n borderTop?: string\n borderRight?: string\n borderBottom?: string\n borderLeft?: string\n borderColor?: string\n borderRadius?: SxValue\n borderWidth?: SxValue\n boxShadow?: string\n outline?: string\n cursor?: CSSProperties['cursor']\n pointerEvents?: CSSProperties['pointerEvents']\n userSelect?: CSSProperties['userSelect']\n transition?: string\n transform?: string\n}\n\nfunction resolveSpacing(val: SxValue): string | undefined {\n if (val == null) return undefined\n if (typeof val === 'number') {\n return SPACE_SCALE[val] !== undefined ? SPACE_SCALE[val] : `${val * 4}px`\n }\n return val\n}\n\nexport function resolveSx(sx?: SxProp): CSSProperties {\n if (!sx) return {}\n\n const css: CSSProperties = {}\n\n const sp = resolveSpacing\n\n if (sx.m != null) css.margin = sp(sx.m)\n if (sx.mt != null) css.marginTop = sp(sx.mt)\n if (sx.mr != null) css.marginRight = sp(sx.mr)\n if (sx.mb != null) css.marginBottom = sp(sx.mb)\n if (sx.ml != null) css.marginLeft = sp(sx.ml)\n if (sx.mx != null) { css.marginLeft = sp(sx.mx); css.marginRight = sp(sx.mx) }\n if (sx.my != null) { css.marginTop = sp(sx.my); css.marginBottom = sp(sx.my) }\n\n if (sx.p != null) css.padding = sp(sx.p)\n if (sx.pt != null) css.paddingTop = sp(sx.pt)\n if (sx.pr != null) css.paddingRight = sp(sx.pr)\n if (sx.pb != null) css.paddingBottom = sp(sx.pb)\n if (sx.pl != null) css.paddingLeft = sp(sx.pl)\n if (sx.px != null) { css.paddingLeft = sp(sx.px); css.paddingRight = sp(sx.px) }\n if (sx.py != null) { css.paddingTop = sp(sx.py); css.paddingBottom = sp(sx.py) }\n\n if (sx.gap != null) css.gap = sp(sx.gap)\n if (sx.rowGap != null) css.rowGap = sp(sx.rowGap)\n if (sx.columnGap != null) css.columnGap = sp(sx.columnGap)\n if (sx.width != null) css.width = sp(sx.width)\n if (sx.height != null) css.height = sp(sx.height)\n if (sx.minWidth != null) css.minWidth = sp(sx.minWidth)\n if (sx.maxWidth != null) css.maxWidth = sp(sx.maxWidth)\n if (sx.minHeight != null) css.minHeight = sp(sx.minHeight)\n if (sx.maxHeight != null) css.maxHeight = sp(sx.maxHeight)\n\n if (sx.top != null) css.top = sp(sx.top)\n if (sx.right != null) css.right = sp(sx.right)\n if (sx.bottom != null) css.bottom = sp(sx.bottom)\n if (sx.left != null) css.left = sp(sx.left)\n\n if (sx.fontSize != null) css.fontSize = sp(sx.fontSize)\n if (sx.letterSpacing != null) css.letterSpacing = sp(sx.letterSpacing)\n if (sx.borderRadius != null) css.borderRadius = sp(sx.borderRadius)\n if (sx.borderWidth != null) css.borderWidth = sp(sx.borderWidth)\n\n const passthrough: Array<keyof SxProp> = [\n 'display', 'flexDirection', 'flexWrap', 'flex', 'flexShrink', 'flexGrow',\n 'alignItems', 'alignSelf', 'justifyContent', 'justifySelf',\n 'position', 'zIndex', 'overflow', 'overflowX', 'overflowY',\n 'color', 'backgroundColor', 'background', 'opacity', 'visibility',\n 'fontWeight', 'lineHeight', 'fontFamily', 'textAlign', 'textDecoration',\n 'textTransform', 'whiteSpace',\n 'aspectRatio',\n 'border', 'borderTop', 'borderRight', 'borderBottom', 'borderLeft',\n 'borderColor', 'boxShadow', 'outline',\n 'cursor', 'pointerEvents', 'userSelect', 'transition', 'transform',\n ]\n\n for (const key of passthrough) {\n const val = sx[key]\n if (val != null) {\n ;(css as Record<string, unknown>)[key] = val\n }\n }\n\n return css\n}\n"],"mappings":";;;AAEA,IAAM,cAAsC;AAAA,EAC1C,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAiFA,SAAS,eAAe,KAAkC;AACxD,MAAI,OAAO,KAAM,QAAO;AACxB,MAAI,OAAO,QAAQ,UAAU;AAC3B,WAAO,YAAY,GAAG,MAAM,SAAY,YAAY,GAAG,IAAI,GAAG,MAAM,CAAC;AAAA,EACvE;AACA,SAAO;AACT;AAEO,SAAS,UAAU,IAA4B;AACpD,MAAI,CAAC,GAAI,QAAO,CAAC;AAEjB,QAAM,MAAqB,CAAC;AAE5B,QAAM,KAAK;AAEX,MAAI,GAAG,KAAK,KAAM,KAAI,SAAS,GAAG,GAAG,CAAC;AACtC,MAAI,GAAG,MAAM,KAAM,KAA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;AAAA,IAAe;AAAA,IAAa;AAAA,IAC5B;AAAA,IAAU;AAAA,IAAiB;AAAA,IAAc;AAAA,IAAc;AAAA,EACzD;AAEA,aAAW,OAAO,aAAa;AAC7B,UAAM,MAAM,GAAG,GAAG;AAClB,QAAI,OAAO,MAAM;AACf;AAAC,MAAC,IAAgC,GAAG,IAAI;AAAA,IAC3C;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
@@ -0,0 +1,54 @@
1
+ import { CSSProperties } from 'react';
2
+
3
+ /** Per-component theme configuration */
4
+ interface XyneComponentTheme {
5
+ defaultProps?: Record<string, unknown>;
6
+ classNames?: Record<string, string>;
7
+ styles?: Record<string, CSSProperties>;
8
+ }
9
+ /** Full resolved theme object */
10
+ interface XyneTheme {
11
+ /** Color scales — e.g. { orange: { '500': '#fe6d36' }, gray: { '900': '#101828' } } */
12
+ colors: Record<string, Record<string, string>>;
13
+ /** Semantic text colors — maps to --xc-color-text-{key} */
14
+ text: Record<string, string>;
15
+ /** Background colors — maps to --xc-color-bg-{key} */
16
+ bg: Record<string, string>;
17
+ /** Border colors — maps to --xc-color-border-{key} */
18
+ border: Record<string, string>;
19
+ /** Box shadows — maps to --xc-shadow-{key} */
20
+ shadow: Record<string, string>;
21
+ /** Border radius scale — maps to --xc-radius-{key} */
22
+ radius: Record<string, string>;
23
+ /** Spacing scale — maps to --xc-space-{key} */
24
+ spacing: Record<string, string>;
25
+ /** Default font family — maps to --xc-font-family */
26
+ fontFamily: string;
27
+ /** Font weight scale — maps to --xc-font-weight-{key} */
28
+ fontWeight: Record<string, string>;
29
+ /** Font size scale — maps to --xc-font-size-{key} */
30
+ fontSize: Record<string, string>;
31
+ /** Line height scale — maps to --xc-line-height-{key} */
32
+ lineHeight: Record<string, string>;
33
+ /** Arbitrary user-defined values, accessible via useTheme() */
34
+ other: Record<string, unknown>;
35
+ /** Per-component default props, classNames, and styles */
36
+ components: Record<string, XyneComponentTheme>;
37
+ }
38
+ /** Partial theme override — passed to createTheme() and ThemeProvider */
39
+ type XyneThemeOverride = Partial<XyneTheme>;
40
+
41
+ type ColorScheme = 'light' | 'dark' | 'auto';
42
+ type ResolvedColorScheme = 'light' | 'dark';
43
+ interface ColorSchemeContextValue {
44
+ /** Current color scheme preference ('light' | 'dark' | 'auto') */
45
+ colorScheme: ColorScheme;
46
+ /** Resolved value — always 'light' or 'dark' (resolves 'auto' via OS preference) */
47
+ resolvedColorScheme: ResolvedColorScheme;
48
+ /** Set the color scheme preference */
49
+ setColorScheme: (scheme: ColorScheme) => void;
50
+ /** Toggle between light and dark (based on resolved value) */
51
+ toggleColorScheme: () => void;
52
+ }
53
+
54
+ export type { ColorScheme as C, ResolvedColorScheme as R, XyneComponentTheme as X, ColorSchemeContextValue as a, XyneTheme as b, XyneThemeOverride as c };
@@ -0,0 +1,54 @@
1
+ import { CSSProperties } from 'react';
2
+
3
+ /** Per-component theme configuration */
4
+ interface XyneComponentTheme {
5
+ defaultProps?: Record<string, unknown>;
6
+ classNames?: Record<string, string>;
7
+ styles?: Record<string, CSSProperties>;
8
+ }
9
+ /** Full resolved theme object */
10
+ interface XyneTheme {
11
+ /** Color scales — e.g. { orange: { '500': '#fe6d36' }, gray: { '900': '#101828' } } */
12
+ colors: Record<string, Record<string, string>>;
13
+ /** Semantic text colors — maps to --xc-color-text-{key} */
14
+ text: Record<string, string>;
15
+ /** Background colors — maps to --xc-color-bg-{key} */
16
+ bg: Record<string, string>;
17
+ /** Border colors — maps to --xc-color-border-{key} */
18
+ border: Record<string, string>;
19
+ /** Box shadows — maps to --xc-shadow-{key} */
20
+ shadow: Record<string, string>;
21
+ /** Border radius scale — maps to --xc-radius-{key} */
22
+ radius: Record<string, string>;
23
+ /** Spacing scale — maps to --xc-space-{key} */
24
+ spacing: Record<string, string>;
25
+ /** Default font family — maps to --xc-font-family */
26
+ fontFamily: string;
27
+ /** Font weight scale — maps to --xc-font-weight-{key} */
28
+ fontWeight: Record<string, string>;
29
+ /** Font size scale — maps to --xc-font-size-{key} */
30
+ fontSize: Record<string, string>;
31
+ /** Line height scale — maps to --xc-line-height-{key} */
32
+ lineHeight: Record<string, string>;
33
+ /** Arbitrary user-defined values, accessible via useTheme() */
34
+ other: Record<string, unknown>;
35
+ /** Per-component default props, classNames, and styles */
36
+ components: Record<string, XyneComponentTheme>;
37
+ }
38
+ /** Partial theme override — passed to createTheme() and ThemeProvider */
39
+ type XyneThemeOverride = Partial<XyneTheme>;
40
+
41
+ type ColorScheme = 'light' | 'dark' | 'auto';
42
+ type ResolvedColorScheme = 'light' | 'dark';
43
+ interface ColorSchemeContextValue {
44
+ /** Current color scheme preference ('light' | 'dark' | 'auto') */
45
+ colorScheme: ColorScheme;
46
+ /** Resolved value — always 'light' or 'dark' (resolves 'auto' via OS preference) */
47
+ resolvedColorScheme: ResolvedColorScheme;
48
+ /** Set the color scheme preference */
49
+ setColorScheme: (scheme: ColorScheme) => void;
50
+ /** Toggle between light and dark (based on resolved value) */
51
+ toggleColorScheme: () => void;
52
+ }
53
+
54
+ export type { ColorScheme as C, ResolvedColorScheme as R, XyneComponentTheme as X, ColorSchemeContextValue as a, XyneTheme as b, XyneThemeOverride as c };
@@ -0,0 +1,11 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
+
3
+
4
+
5
+ var _chunk73U3B3WXcjs = require('../chunk-73U3B3WX.cjs');
6
+ require('../chunk-WUV742E6.cjs');
7
+
8
+
9
+
10
+ exports.useColorScheme = _chunk73U3B3WXcjs.useColorScheme; exports.useTheme = _chunk73U3B3WXcjs.useTheme;
11
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/Users/harshpreet.singh/Desktop/Juspay/xyne-spaces/components/dist/hooks/index.cjs"],"names":[],"mappings":"AAAA,qFAAY;AACZ;AACE;AACA;AACF,yDAA8B;AAC9B,iCAA8B;AAC9B;AACE;AACA;AACF,yGAAC","file":"/Users/harshpreet.singh/Desktop/Juspay/xyne-spaces/components/dist/hooks/index.cjs"}