@chellaa/react 0.2.0
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/LICENSE +21 -0
- package/README.md +180 -0
- package/dist/index.cjs +523 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.css +674 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.cts +203 -0
- package/dist/index.d.ts +203 -0
- package/dist/index.mjs +495 -0
- package/dist/index.mjs.map +1 -0
- package/dist/index.node.mjs +494 -0
- package/dist/styles.css +1 -0
- package/dist/styles.css.d.cts +2 -0
- package/dist/styles.css.d.ts +2 -0
- package/package.json +111 -0
- package/styles.css +1 -0
- package/styles.css.d.ts +2 -0
|
@@ -0,0 +1,494 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
// src/theme/ThemeProvider.tsx
|
|
5
|
+
var ThemeContext = React.createContext(
|
|
6
|
+
void 0
|
|
7
|
+
);
|
|
8
|
+
var COLOR_SCHEME_QUERY = "(prefers-color-scheme: dark)";
|
|
9
|
+
function ThemeProvider({
|
|
10
|
+
children,
|
|
11
|
+
defaultTheme = "system",
|
|
12
|
+
storageKey = "chellaa-theme",
|
|
13
|
+
enableSystem = true,
|
|
14
|
+
tokens,
|
|
15
|
+
attribute = "data-theme"
|
|
16
|
+
}) {
|
|
17
|
+
const parentContext = React.useContext(ThemeContext);
|
|
18
|
+
const [theme, setThemeState] = React.useState(() => {
|
|
19
|
+
if (typeof window === "undefined") return defaultTheme;
|
|
20
|
+
try {
|
|
21
|
+
return localStorage.getItem(storageKey) || defaultTheme;
|
|
22
|
+
} catch {
|
|
23
|
+
return defaultTheme;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
const [systemTheme, setSystemTheme] = React.useState(() => {
|
|
27
|
+
if (typeof window === "undefined" || !enableSystem || typeof window.matchMedia !== "function") {
|
|
28
|
+
return void 0;
|
|
29
|
+
}
|
|
30
|
+
return window.matchMedia(COLOR_SCHEME_QUERY).matches ? "dark" : "light";
|
|
31
|
+
});
|
|
32
|
+
const resolvedTheme = React.useMemo(() => {
|
|
33
|
+
if (theme === "system") {
|
|
34
|
+
return systemTheme ?? "light";
|
|
35
|
+
}
|
|
36
|
+
return theme === "dark" ? "dark" : "light";
|
|
37
|
+
}, [theme, systemTheme]);
|
|
38
|
+
React.useEffect(() => {
|
|
39
|
+
if (!enableSystem || typeof window === "undefined" || typeof window.matchMedia !== "function") {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const mediaQuery = window.matchMedia(COLOR_SCHEME_QUERY);
|
|
43
|
+
const handleChange = (e) => {
|
|
44
|
+
setSystemTheme(e.matches ? "dark" : "light");
|
|
45
|
+
};
|
|
46
|
+
if (typeof mediaQuery.addEventListener === "function") {
|
|
47
|
+
mediaQuery.addEventListener("change", handleChange);
|
|
48
|
+
return () => mediaQuery.removeEventListener("change", handleChange);
|
|
49
|
+
} else if (typeof mediaQuery.addListener === "function") {
|
|
50
|
+
mediaQuery.addListener(handleChange);
|
|
51
|
+
return () => mediaQuery.removeListener(handleChange);
|
|
52
|
+
}
|
|
53
|
+
}, [enableSystem]);
|
|
54
|
+
React.useEffect(() => {
|
|
55
|
+
if (typeof document === "undefined") return;
|
|
56
|
+
if (!parentContext) {
|
|
57
|
+
const root = document.documentElement;
|
|
58
|
+
root.setAttribute(attribute, resolvedTheme);
|
|
59
|
+
if (tokens) {
|
|
60
|
+
for (const [key, value2] of Object.entries(tokens)) {
|
|
61
|
+
root.style.setProperty(key, value2);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}, [resolvedTheme, parentContext, attribute, tokens]);
|
|
66
|
+
const setTheme = React.useCallback(
|
|
67
|
+
(newTheme) => {
|
|
68
|
+
setThemeState(newTheme);
|
|
69
|
+
try {
|
|
70
|
+
localStorage.setItem(storageKey, newTheme);
|
|
71
|
+
} catch {
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
[storageKey]
|
|
75
|
+
);
|
|
76
|
+
const value = React.useMemo(
|
|
77
|
+
() => ({
|
|
78
|
+
theme,
|
|
79
|
+
setTheme,
|
|
80
|
+
resolvedTheme,
|
|
81
|
+
systemTheme
|
|
82
|
+
}),
|
|
83
|
+
[theme, setTheme, resolvedTheme, systemTheme]
|
|
84
|
+
);
|
|
85
|
+
if (parentContext) {
|
|
86
|
+
const styleObj = tokens ? tokens : void 0;
|
|
87
|
+
return /* @__PURE__ */ jsx(ThemeContext.Provider, { value, children: /* @__PURE__ */ jsx(
|
|
88
|
+
"div",
|
|
89
|
+
{
|
|
90
|
+
...{ [attribute]: resolvedTheme },
|
|
91
|
+
style: styleObj,
|
|
92
|
+
className: "cl-theme-scope",
|
|
93
|
+
children
|
|
94
|
+
}
|
|
95
|
+
) });
|
|
96
|
+
}
|
|
97
|
+
return /* @__PURE__ */ jsx(ThemeContext.Provider, { value, children });
|
|
98
|
+
}
|
|
99
|
+
function useTheme() {
|
|
100
|
+
const context = React.useContext(ThemeContext);
|
|
101
|
+
if (!context) {
|
|
102
|
+
throw new Error(
|
|
103
|
+
"useTheme must be used within a <ThemeProvider>. Wrap your application root in <ThemeProvider>."
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
return context;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// src/theme/createTheme.ts
|
|
110
|
+
function createTheme(config) {
|
|
111
|
+
const { name, tokens } = config;
|
|
112
|
+
const declarations = Object.entries(tokens).map(([property, value]) => ` ${property}: ${value};`).join("\n");
|
|
113
|
+
const cssText = `[data-theme="${name}"] {
|
|
114
|
+
${declarations}
|
|
115
|
+
}`;
|
|
116
|
+
return {
|
|
117
|
+
name,
|
|
118
|
+
tokens,
|
|
119
|
+
cssText
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
function ThemeScript({
|
|
123
|
+
storageKey = "chellaa-theme",
|
|
124
|
+
defaultTheme = "system",
|
|
125
|
+
attribute = "data-theme",
|
|
126
|
+
nonce
|
|
127
|
+
}) {
|
|
128
|
+
const scriptContent = `(function() {
|
|
129
|
+
try {
|
|
130
|
+
var key = '${storageKey}';
|
|
131
|
+
var def = '${defaultTheme}';
|
|
132
|
+
var attr = '${attribute}';
|
|
133
|
+
var stored = localStorage.getItem(key);
|
|
134
|
+
var theme = stored || def;
|
|
135
|
+
var resolved = theme;
|
|
136
|
+
if (theme === 'system') {
|
|
137
|
+
resolved = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
138
|
+
}
|
|
139
|
+
document.documentElement.setAttribute(attr, resolved);
|
|
140
|
+
} catch (e) {}
|
|
141
|
+
})();`;
|
|
142
|
+
return /* @__PURE__ */ jsx(
|
|
143
|
+
"script",
|
|
144
|
+
{
|
|
145
|
+
nonce,
|
|
146
|
+
dangerouslySetInnerHTML: { __html: scriptContent },
|
|
147
|
+
suppressHydrationWarning: true
|
|
148
|
+
}
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// src/utils/classNames.ts
|
|
153
|
+
function classNames(...inputs) {
|
|
154
|
+
const classes = [];
|
|
155
|
+
for (const input of inputs) {
|
|
156
|
+
if (!input && input !== 0) continue;
|
|
157
|
+
if (typeof input === "string" || typeof input === "number") {
|
|
158
|
+
const trimmed = String(input).trim();
|
|
159
|
+
if (trimmed) classes.push(trimmed);
|
|
160
|
+
} else if (Array.isArray(input)) {
|
|
161
|
+
const nested = classNames(...input);
|
|
162
|
+
if (nested) classes.push(nested);
|
|
163
|
+
} else if (typeof input === "object") {
|
|
164
|
+
for (const [key, value] of Object.entries(input)) {
|
|
165
|
+
if (value && key.trim()) {
|
|
166
|
+
classes.push(key.trim());
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
return classes.join(" ");
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// src/utils/composeEventHandlers.ts
|
|
175
|
+
function composeEventHandlers(originalHandler, ourHandler, {
|
|
176
|
+
checkForDefaultPrevented = true
|
|
177
|
+
} = {}) {
|
|
178
|
+
return function handleEvent(event) {
|
|
179
|
+
originalHandler?.(event);
|
|
180
|
+
if (!checkForDefaultPrevented || !event.defaultPrevented) {
|
|
181
|
+
ourHandler?.(event);
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
function setRef(ref, value) {
|
|
186
|
+
if (typeof ref === "function") {
|
|
187
|
+
ref(value);
|
|
188
|
+
} else if (ref !== null && ref !== void 0) {
|
|
189
|
+
ref.current = value;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// src/primitives/Slot.tsx
|
|
194
|
+
var Slot = React.forwardRef(
|
|
195
|
+
function Slot2(props, forwardedRef) {
|
|
196
|
+
const { children, ...slotProps } = props;
|
|
197
|
+
if (React.isValidElement(children)) {
|
|
198
|
+
return React.cloneElement(
|
|
199
|
+
children,
|
|
200
|
+
mergeProps(
|
|
201
|
+
slotProps,
|
|
202
|
+
children.props,
|
|
203
|
+
forwardedRef,
|
|
204
|
+
getElementRef(children)
|
|
205
|
+
)
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
if (React.Children.count(children) > 1) {
|
|
209
|
+
React.Children.only(null);
|
|
210
|
+
}
|
|
211
|
+
return null;
|
|
212
|
+
}
|
|
213
|
+
);
|
|
214
|
+
Slot.displayName = "Slot";
|
|
215
|
+
function getElementRef(element) {
|
|
216
|
+
const elementRef = element?.ref;
|
|
217
|
+
if (elementRef !== void 0) {
|
|
218
|
+
return elementRef;
|
|
219
|
+
}
|
|
220
|
+
return element.props?.ref;
|
|
221
|
+
}
|
|
222
|
+
function mergeProps(slotProps, childProps, slotRef, childRef) {
|
|
223
|
+
const overrideProps = { ...childProps };
|
|
224
|
+
for (const propName in slotProps) {
|
|
225
|
+
const slotPropValue = slotProps[propName];
|
|
226
|
+
const childPropValue = childProps[propName];
|
|
227
|
+
const isEventHandler = /^on[A-Z]/.test(propName);
|
|
228
|
+
if (isEventHandler) {
|
|
229
|
+
if (typeof slotPropValue === "function" && typeof childPropValue === "function") {
|
|
230
|
+
overrideProps[propName] = composeEventHandlers(
|
|
231
|
+
childPropValue,
|
|
232
|
+
slotPropValue
|
|
233
|
+
);
|
|
234
|
+
} else if (typeof slotPropValue === "function") {
|
|
235
|
+
overrideProps[propName] = slotPropValue;
|
|
236
|
+
}
|
|
237
|
+
} else if (propName === "className") {
|
|
238
|
+
overrideProps[propName] = classNames(
|
|
239
|
+
slotPropValue,
|
|
240
|
+
childPropValue
|
|
241
|
+
);
|
|
242
|
+
} else if (propName === "style") {
|
|
243
|
+
overrideProps[propName] = {
|
|
244
|
+
...slotPropValue,
|
|
245
|
+
...childPropValue
|
|
246
|
+
};
|
|
247
|
+
} else {
|
|
248
|
+
overrideProps[propName] = slotPropValue !== void 0 ? slotPropValue : childPropValue;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
overrideProps.ref = (node) => {
|
|
252
|
+
setRef(childRef, node);
|
|
253
|
+
setRef(slotRef, node);
|
|
254
|
+
};
|
|
255
|
+
return overrideProps;
|
|
256
|
+
}
|
|
257
|
+
var ButtonGroupContext = React.createContext(void 0);
|
|
258
|
+
function useButtonGroupContext() {
|
|
259
|
+
return React.useContext(ButtonGroupContext);
|
|
260
|
+
}
|
|
261
|
+
function ButtonSpinner() {
|
|
262
|
+
return /* @__PURE__ */ jsxs(
|
|
263
|
+
"svg",
|
|
264
|
+
{
|
|
265
|
+
className: "cl-button__spinner",
|
|
266
|
+
viewBox: "0 0 24 24",
|
|
267
|
+
fill: "none",
|
|
268
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
269
|
+
"aria-hidden": "true",
|
|
270
|
+
children: [
|
|
271
|
+
/* @__PURE__ */ jsx(
|
|
272
|
+
"circle",
|
|
273
|
+
{
|
|
274
|
+
cx: "12",
|
|
275
|
+
cy: "12",
|
|
276
|
+
r: "9",
|
|
277
|
+
stroke: "currentColor",
|
|
278
|
+
strokeWidth: "2.5",
|
|
279
|
+
strokeOpacity: "0.25"
|
|
280
|
+
}
|
|
281
|
+
),
|
|
282
|
+
/* @__PURE__ */ jsx(
|
|
283
|
+
"path",
|
|
284
|
+
{
|
|
285
|
+
d: "M12 3a9 9 0 0 1 9 9",
|
|
286
|
+
stroke: "currentColor",
|
|
287
|
+
strokeWidth: "2.5",
|
|
288
|
+
strokeLinecap: "round"
|
|
289
|
+
}
|
|
290
|
+
)
|
|
291
|
+
]
|
|
292
|
+
}
|
|
293
|
+
);
|
|
294
|
+
}
|
|
295
|
+
var Button = React.forwardRef(
|
|
296
|
+
function Button2(props, forwardedRef) {
|
|
297
|
+
const {
|
|
298
|
+
asChild = false,
|
|
299
|
+
variant: variantProp,
|
|
300
|
+
size: sizeProp,
|
|
301
|
+
colorScheme: colorSchemeProp,
|
|
302
|
+
isLoading = false,
|
|
303
|
+
loadingText,
|
|
304
|
+
loadingPosition = "start",
|
|
305
|
+
isDisabled: isDisabledProp,
|
|
306
|
+
isFullWidth = false,
|
|
307
|
+
startIcon,
|
|
308
|
+
endIcon,
|
|
309
|
+
className,
|
|
310
|
+
children,
|
|
311
|
+
disabled: disabledProp,
|
|
312
|
+
type = "button",
|
|
313
|
+
onClick,
|
|
314
|
+
onKeyDown,
|
|
315
|
+
...restProps
|
|
316
|
+
} = props;
|
|
317
|
+
const buttonGroup = useButtonGroupContext();
|
|
318
|
+
const variant = variantProp ?? buttonGroup?.variant ?? "solid";
|
|
319
|
+
const size = sizeProp ?? buttonGroup?.size ?? "md";
|
|
320
|
+
const colorScheme = colorSchemeProp ?? buttonGroup?.colorScheme ?? "primary";
|
|
321
|
+
const isDisabled = isDisabledProp ?? disabledProp ?? buttonGroup?.isDisabled ?? false;
|
|
322
|
+
const isEffectivelyDisabled = isDisabled || isLoading;
|
|
323
|
+
const handleClick = (event) => {
|
|
324
|
+
if (isEffectivelyDisabled) {
|
|
325
|
+
event.preventDefault();
|
|
326
|
+
event.stopPropagation();
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
onClick?.(event);
|
|
330
|
+
};
|
|
331
|
+
const handleKeyDown = (event) => {
|
|
332
|
+
if (isEffectivelyDisabled) {
|
|
333
|
+
if (event.key === " " || event.key === "Enter") {
|
|
334
|
+
event.preventDefault();
|
|
335
|
+
event.stopPropagation();
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
onKeyDown?.(event);
|
|
340
|
+
};
|
|
341
|
+
const buttonClassName = classNames(
|
|
342
|
+
"cl-button",
|
|
343
|
+
`cl-button--${variant}`,
|
|
344
|
+
`cl-button--${size}`,
|
|
345
|
+
`cl-button--${colorScheme}`,
|
|
346
|
+
isLoading && "cl-button--loading",
|
|
347
|
+
isDisabled && "cl-button--disabled",
|
|
348
|
+
isFullWidth && "cl-button--full-width",
|
|
349
|
+
className
|
|
350
|
+
);
|
|
351
|
+
const spinner = /* @__PURE__ */ jsx(ButtonSpinner, {});
|
|
352
|
+
if (asChild) {
|
|
353
|
+
return /* @__PURE__ */ jsx(
|
|
354
|
+
Slot,
|
|
355
|
+
{
|
|
356
|
+
ref: forwardedRef,
|
|
357
|
+
className: buttonClassName,
|
|
358
|
+
"aria-disabled": isEffectivelyDisabled ? true : void 0,
|
|
359
|
+
"aria-busy": isLoading ? true : void 0,
|
|
360
|
+
onClick: handleClick,
|
|
361
|
+
onKeyDown: handleKeyDown,
|
|
362
|
+
...restProps,
|
|
363
|
+
children
|
|
364
|
+
}
|
|
365
|
+
);
|
|
366
|
+
}
|
|
367
|
+
const isCenterLoading = isLoading && loadingPosition === "center";
|
|
368
|
+
return /* @__PURE__ */ jsx(
|
|
369
|
+
"button",
|
|
370
|
+
{
|
|
371
|
+
ref: forwardedRef,
|
|
372
|
+
type,
|
|
373
|
+
disabled: isEffectivelyDisabled ? true : void 0,
|
|
374
|
+
"aria-disabled": isEffectivelyDisabled ? true : void 0,
|
|
375
|
+
"aria-busy": isLoading ? true : void 0,
|
|
376
|
+
className: buttonClassName,
|
|
377
|
+
onClick: handleClick,
|
|
378
|
+
onKeyDown: handleKeyDown,
|
|
379
|
+
...restProps,
|
|
380
|
+
children: isCenterLoading ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
381
|
+
/* @__PURE__ */ jsx("span", { className: "cl-button__spinner-wrapper--center", children: spinner }),
|
|
382
|
+
/* @__PURE__ */ jsxs("span", { className: "cl-button__content--hidden", children: [
|
|
383
|
+
startIcon && /* @__PURE__ */ jsx(
|
|
384
|
+
"span",
|
|
385
|
+
{
|
|
386
|
+
className: "cl-button__icon cl-button__icon--start",
|
|
387
|
+
"aria-hidden": "true",
|
|
388
|
+
children: startIcon
|
|
389
|
+
}
|
|
390
|
+
),
|
|
391
|
+
children !== void 0 && /* @__PURE__ */ jsx("span", { className: "cl-button__label", children }),
|
|
392
|
+
endIcon && /* @__PURE__ */ jsx(
|
|
393
|
+
"span",
|
|
394
|
+
{
|
|
395
|
+
className: "cl-button__icon cl-button__icon--end",
|
|
396
|
+
"aria-hidden": "true",
|
|
397
|
+
children: endIcon
|
|
398
|
+
}
|
|
399
|
+
)
|
|
400
|
+
] })
|
|
401
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
402
|
+
isLoading && loadingPosition === "start" && spinner,
|
|
403
|
+
!isLoading && startIcon && /* @__PURE__ */ jsx(
|
|
404
|
+
"span",
|
|
405
|
+
{
|
|
406
|
+
className: "cl-button__icon cl-button__icon--start",
|
|
407
|
+
"aria-hidden": "true",
|
|
408
|
+
children: startIcon
|
|
409
|
+
}
|
|
410
|
+
),
|
|
411
|
+
isLoading && loadingText ? /* @__PURE__ */ jsx("span", { className: "cl-button__label", children: loadingText }) : children !== void 0 ? /* @__PURE__ */ jsx("span", { className: "cl-button__label", children }) : null,
|
|
412
|
+
isLoading && loadingPosition === "end" && spinner,
|
|
413
|
+
!isLoading && endIcon && /* @__PURE__ */ jsx(
|
|
414
|
+
"span",
|
|
415
|
+
{
|
|
416
|
+
className: "cl-button__icon cl-button__icon--end",
|
|
417
|
+
"aria-hidden": "true",
|
|
418
|
+
children: endIcon
|
|
419
|
+
}
|
|
420
|
+
)
|
|
421
|
+
] })
|
|
422
|
+
}
|
|
423
|
+
);
|
|
424
|
+
}
|
|
425
|
+
);
|
|
426
|
+
Button.displayName = "Button";
|
|
427
|
+
var ButtonGroup = React.forwardRef(
|
|
428
|
+
function ButtonGroup2(props, forwardedRef) {
|
|
429
|
+
const {
|
|
430
|
+
asChild = false,
|
|
431
|
+
size,
|
|
432
|
+
variant,
|
|
433
|
+
colorScheme,
|
|
434
|
+
isDisabled,
|
|
435
|
+
isAttached = false,
|
|
436
|
+
orientation = "horizontal",
|
|
437
|
+
spacing,
|
|
438
|
+
className,
|
|
439
|
+
style,
|
|
440
|
+
children,
|
|
441
|
+
role: roleProp,
|
|
442
|
+
...restProps
|
|
443
|
+
} = props;
|
|
444
|
+
const role = roleProp !== void 0 ? roleProp : asChild ? void 0 : "group";
|
|
445
|
+
const contextValue = React.useMemo(
|
|
446
|
+
() => ({
|
|
447
|
+
size,
|
|
448
|
+
variant,
|
|
449
|
+
colorScheme,
|
|
450
|
+
isDisabled
|
|
451
|
+
}),
|
|
452
|
+
[size, variant, colorScheme, isDisabled]
|
|
453
|
+
);
|
|
454
|
+
const groupClassName = classNames(
|
|
455
|
+
"cl-button-group",
|
|
456
|
+
`cl-button-group--${orientation}`,
|
|
457
|
+
isAttached && "cl-button-group--attached",
|
|
458
|
+
className
|
|
459
|
+
);
|
|
460
|
+
const groupStyle = {
|
|
461
|
+
...style,
|
|
462
|
+
...spacing !== void 0 && !isAttached ? { gap: typeof spacing === "number" ? `${spacing}px` : spacing } : {}
|
|
463
|
+
};
|
|
464
|
+
if (asChild) {
|
|
465
|
+
return /* @__PURE__ */ jsx(ButtonGroupContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(
|
|
466
|
+
Slot,
|
|
467
|
+
{
|
|
468
|
+
ref: forwardedRef,
|
|
469
|
+
role,
|
|
470
|
+
className: groupClassName,
|
|
471
|
+
style: groupStyle,
|
|
472
|
+
...restProps,
|
|
473
|
+
children
|
|
474
|
+
}
|
|
475
|
+
) });
|
|
476
|
+
}
|
|
477
|
+
return /* @__PURE__ */ jsx(ButtonGroupContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(
|
|
478
|
+
"div",
|
|
479
|
+
{
|
|
480
|
+
ref: forwardedRef,
|
|
481
|
+
role,
|
|
482
|
+
className: groupClassName,
|
|
483
|
+
style: groupStyle,
|
|
484
|
+
...restProps,
|
|
485
|
+
children
|
|
486
|
+
}
|
|
487
|
+
) });
|
|
488
|
+
}
|
|
489
|
+
);
|
|
490
|
+
ButtonGroup.displayName = "ButtonGroup";
|
|
491
|
+
|
|
492
|
+
export { Button, ButtonGroup, ButtonGroupContext, ThemeProvider, ThemeScript, createTheme, useButtonGroupContext, useTheme };
|
|
493
|
+
//# sourceMappingURL=index.mjs.map
|
|
494
|
+
//# sourceMappingURL=index.mjs.map
|
package/dist/styles.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer cl-tokens{:root{--cl-palette-slate-50:#f8fafc;--cl-palette-slate-100:#f1f5f9;--cl-palette-slate-200:#e2e8f0;--cl-palette-slate-300:#cbd5e1;--cl-palette-slate-400:#94a3b8;--cl-palette-slate-500:#64748b;--cl-palette-slate-600:#475569;--cl-palette-slate-700:#334155;--cl-palette-slate-800:#1e293b;--cl-palette-slate-900:#0f172a;--cl-palette-slate-950:#090d16;--cl-palette-indigo-50:#eef2ff;--cl-palette-indigo-100:#e0e7ff;--cl-palette-indigo-200:#c7d2fe;--cl-palette-indigo-300:#a5b4fc;--cl-palette-indigo-400:#818cf8;--cl-palette-indigo-500:#6366f1;--cl-palette-indigo-600:#4f46e5;--cl-palette-indigo-700:#4338ca;--cl-palette-indigo-800:#3730a3;--cl-palette-indigo-900:#312e81;--cl-palette-indigo-950:#1e1b4b;--cl-palette-violet-50:#f5f3ff;--cl-palette-violet-100:#ede9fe;--cl-palette-violet-200:#ddd6fe;--cl-palette-violet-300:#c4b5fd;--cl-palette-violet-400:#a78bfa;--cl-palette-violet-500:#8b5cf6;--cl-palette-violet-600:#7c3aed;--cl-palette-violet-700:#6d28d9;--cl-palette-violet-800:#5b21b6;--cl-palette-violet-900:#4c1d95;--cl-palette-violet-950:#2e1065;--cl-palette-emerald-50:#ecfdf5;--cl-palette-emerald-100:#d1fae5;--cl-palette-emerald-200:#a7f3d0;--cl-palette-emerald-300:#6ee7b7;--cl-palette-emerald-400:#34d399;--cl-palette-emerald-500:#10b981;--cl-palette-emerald-600:#059669;--cl-palette-emerald-700:#047857;--cl-palette-emerald-800:#065f46;--cl-palette-emerald-900:#064e3b;--cl-palette-emerald-950:#022c22;--cl-palette-amber-50:#fffbeb;--cl-palette-amber-100:#fef3c7;--cl-palette-amber-200:#fde68a;--cl-palette-amber-300:#fcd34d;--cl-palette-amber-400:#fbbf24;--cl-palette-amber-500:#f59e0b;--cl-palette-amber-600:#d97706;--cl-palette-amber-700:#b45309;--cl-palette-amber-800:#92400e;--cl-palette-amber-900:#78350f;--cl-palette-amber-950:#451a03;--cl-palette-rose-50:#fff1f2;--cl-palette-rose-100:#ffe4e6;--cl-palette-rose-200:#fecdd3;--cl-palette-rose-300:#fda4af;--cl-palette-rose-400:#fb7185;--cl-palette-rose-500:#f43f5e;--cl-palette-rose-600:#e11d48;--cl-palette-rose-700:#be123c;--cl-palette-rose-800:#9f1239;--cl-palette-rose-900:#881337;--cl-palette-rose-950:#4c0519;--cl-palette-sky-50:#f0f9ff;--cl-palette-sky-100:#e0f2fe;--cl-palette-sky-200:#bae6fd;--cl-palette-sky-300:#7dd3fc;--cl-palette-sky-400:#38bdf8;--cl-palette-sky-500:#0ea5e9;--cl-palette-sky-600:#0284c7;--cl-palette-sky-700:#0369a1;--cl-palette-sky-800:#075985;--cl-palette-sky-900:#0c4a6e;--cl-palette-sky-950:#082f49;--cl-palette-white:#fff;--cl-palette-black:#000;--cl-space-0:0rem;--cl-space-1:.25rem;--cl-space-2:.5rem;--cl-space-3:.75rem;--cl-space-4:1rem;--cl-space-5:1.25rem;--cl-space-6:1.5rem;--cl-space-8:2rem;--cl-space-10:2.5rem;--cl-space-12:3rem;--cl-space-16:4rem;--cl-font-sans:system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;--cl-font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--cl-font-xs:.75rem;--cl-line-height-xs:1rem;--cl-letter-spacing-xs:.01em;--cl-font-sm:.875rem;--cl-line-height-sm:1.25rem;--cl-letter-spacing-sm:0;--cl-font-base:1rem;--cl-line-height-base:1.5rem;--cl-letter-spacing-base:0;--cl-font-lg:1.125rem;--cl-line-height-lg:1.75rem;--cl-letter-spacing-lg:-.01em;--cl-font-xl:1.25rem;--cl-line-height-xl:1.75rem;--cl-letter-spacing-xl:-.015em;--cl-font-2xl:1.5rem;--cl-line-height-2xl:2rem;--cl-letter-spacing-2xl:-.02em;--cl-font-3xl:1.875rem;--cl-line-height-3xl:2.25rem;--cl-letter-spacing-3xl:-.025em;--cl-font-4xl:2.25rem;--cl-line-height-4xl:2.5rem;--cl-letter-spacing-4xl:-.03em;--cl-font-5xl:3rem;--cl-line-height-5xl:1.15;--cl-letter-spacing-5xl:-.035em;--cl-font-weight-regular:400;--cl-font-weight-medium:500;--cl-font-weight-semibold:600;--cl-font-weight-bold:700;--cl-rad-none:0px;--cl-rad-xs:2px;--cl-rad-sm:4px;--cl-rad-md:6px;--cl-rad-lg:8px;--cl-rad-xl:12px;--cl-rad-2xl:16px;--cl-rad-full:9999px;--cl-shadow-sm:0 1px 2px 0 #0000000d;--cl-shadow-md:0 4px 6px -1px #00000012, 0 2px 4px -2px #0000000d;--cl-shadow-lg:0 10px 15px -3px #00000014, 0 4px 6px -4px #0000000a;--cl-shadow-xl:0 20px 25px -5px #0000001a, 0 8px 10px -6px #0000000a;--cl-z-deep:-1;--cl-z-base:0;--cl-z-raised:10;--cl-z-dropdown:1000;--cl-z-sticky:1100;--cl-z-backdrop:1200;--cl-z-modal:1300;--cl-z-popover:1400;--cl-z-toast:1500;--cl-z-tooltip:1600;--cl-duration-fast:.15s;--cl-duration-normal:.25s;--cl-duration-slow:.35s;--cl-ease-default:cubic-bezier(.4, 0, .2, 1);--cl-ease-out:cubic-bezier(0, 0, .2, 1);--cl-ease-in:cubic-bezier(.4, 0, 1, 1);--cl-ease-spring:cubic-bezier(.34, 1.56, .64, 1);--cl-transition-colors:color var(--cl-duration-fast) var(--cl-ease-default), background-color var(--cl-duration-fast) var(--cl-ease-default), border-color var(--cl-duration-fast) var(--cl-ease-default);--cl-transition-transform:transform var(--cl-duration-fast) var(--cl-ease-default);--cl-transition-opacity:opacity var(--cl-duration-fast) var(--cl-ease-default)}@media (prefers-reduced-motion:reduce){:root{--cl-duration-fast:0s!important;--cl-duration-normal:0s!important;--cl-duration-slow:0s!important;--cl-transition-colors:none!important;--cl-transition-transform:none!important;--cl-transition-opacity:none!important}}}@layer cl-theme{:root,[data-theme=light]{--cl-color-bg-canvas:var(--cl-palette-white);--cl-color-bg-surface:var(--cl-palette-slate-50);--cl-color-bg-elev:var(--cl-palette-white);--cl-color-bg-muted:var(--cl-palette-slate-100);--cl-color-fg-primary:var(--cl-palette-slate-900);--cl-color-fg-secondary:var(--cl-palette-slate-700);--cl-color-fg-muted:var(--cl-palette-slate-500);--cl-color-fg-inverse:var(--cl-palette-white);--cl-color-border-subtle:var(--cl-palette-slate-200);--cl-color-border-default:var(--cl-palette-slate-300);--cl-color-border-strong:var(--cl-palette-slate-400);--cl-color-primary-base:var(--cl-palette-indigo-600);--cl-color-primary-hover:var(--cl-palette-indigo-700);--cl-color-primary-active:var(--cl-palette-indigo-800);--cl-color-primary-fg:var(--cl-palette-white);--cl-color-primary-subtle:var(--cl-palette-indigo-50);--cl-color-secondary-base:var(--cl-palette-violet-600);--cl-color-secondary-hover:var(--cl-palette-violet-700);--cl-color-secondary-active:var(--cl-palette-violet-800);--cl-color-secondary-fg:var(--cl-palette-white);--cl-color-secondary-subtle:var(--cl-palette-violet-50);--cl-color-neutral-base:var(--cl-palette-slate-700);--cl-color-neutral-hover:var(--cl-palette-slate-800);--cl-color-neutral-active:var(--cl-palette-slate-900);--cl-color-neutral-fg:var(--cl-palette-white);--cl-color-neutral-subtle:var(--cl-palette-slate-100);--cl-color-success-base:var(--cl-palette-emerald-600);--cl-color-success-hover:var(--cl-palette-emerald-700);--cl-color-success-active:var(--cl-palette-emerald-800);--cl-color-success-fg:var(--cl-palette-white);--cl-color-success-subtle:var(--cl-palette-emerald-50);--cl-color-warning-base:var(--cl-palette-amber-600);--cl-color-warning-hover:var(--cl-palette-amber-700);--cl-color-warning-active:var(--cl-palette-amber-800);--cl-color-warning-fg:var(--cl-palette-white);--cl-color-warning-subtle:var(--cl-palette-amber-50);--cl-color-danger-base:var(--cl-palette-rose-600);--cl-color-danger-hover:var(--cl-palette-rose-700);--cl-color-danger-active:var(--cl-palette-rose-800);--cl-color-danger-fg:var(--cl-palette-white);--cl-color-danger-subtle:var(--cl-palette-rose-50);--cl-color-info-base:var(--cl-palette-sky-600);--cl-color-info-hover:var(--cl-palette-sky-700);--cl-color-info-active:var(--cl-palette-sky-800);--cl-color-info-fg:var(--cl-palette-white);--cl-color-info-subtle:var(--cl-palette-sky-50);--cl-color-focus-ring:#6366f173;--cl-color-backdrop:#0f172a80;--cl-button-primary-bg:var(--cl-color-primary-base);--cl-button-primary-fg:var(--cl-color-primary-fg);--cl-button-primary-hover-bg:var(--cl-color-primary-hover);--cl-button-primary-active-bg:var(--cl-color-primary-active);--cl-button-neutral-bg:var(--cl-color-neutral-base);--cl-button-neutral-fg:var(--cl-color-neutral-fg);--cl-button-neutral-hover-bg:var(--cl-color-neutral-hover);--cl-button-neutral-active-bg:var(--cl-color-neutral-active);--cl-button-danger-bg:var(--cl-color-danger-base);--cl-button-danger-fg:var(--cl-color-danger-fg);--cl-button-danger-hover-bg:var(--cl-color-danger-hover);--cl-button-danger-active-bg:var(--cl-color-danger-active);--cl-input-bg:var(--cl-color-bg-canvas);--cl-input-fg:var(--cl-color-fg-primary);--cl-input-border:var(--cl-color-border-default);--cl-input-focus-border:var(--cl-color-primary-base);--cl-input-invalid-border:var(--cl-color-danger-base);--cl-input-placeholder:var(--cl-color-fg-muted);--cl-card-bg:var(--cl-color-bg-canvas);--cl-card-border:var(--cl-color-border-subtle);--cl-card-elevated-bg:var(--cl-color-bg-elev);--cl-dialog-bg:var(--cl-color-bg-elev);--cl-dialog-border:var(--cl-color-border-subtle);--cl-dialog-backdrop:var(--cl-color-backdrop);--cl-badge-default-bg:var(--cl-color-primary-subtle);--cl-badge-default-fg:var(--cl-color-primary-base);--cl-table-border:var(--cl-color-border-subtle);--cl-table-header-bg:var(--cl-color-bg-surface);--cl-table-row-hover-bg:var(--cl-color-bg-muted)}[data-theme=dark]{--cl-color-bg-canvas:var(--cl-palette-slate-950);--cl-color-bg-surface:#131b2e;--cl-color-bg-elev:var(--cl-palette-slate-800);--cl-color-bg-muted:var(--cl-palette-slate-800);--cl-color-fg-primary:var(--cl-palette-slate-50);--cl-color-fg-secondary:var(--cl-palette-slate-300);--cl-color-fg-muted:var(--cl-palette-slate-400);--cl-color-fg-inverse:var(--cl-palette-slate-900);--cl-color-border-subtle:var(--cl-palette-slate-800);--cl-color-border-default:var(--cl-palette-slate-700);--cl-color-border-strong:var(--cl-palette-slate-600);--cl-color-primary-base:var(--cl-palette-indigo-500);--cl-color-primary-hover:var(--cl-palette-indigo-400);--cl-color-primary-active:var(--cl-palette-indigo-600);--cl-color-primary-fg:var(--cl-palette-white);--cl-color-primary-subtle:#6366f126;--cl-color-secondary-base:var(--cl-palette-violet-500);--cl-color-secondary-hover:var(--cl-palette-violet-400);--cl-color-secondary-active:var(--cl-palette-violet-600);--cl-color-secondary-fg:var(--cl-palette-white);--cl-color-secondary-subtle:#8b5cf626;--cl-color-neutral-base:var(--cl-palette-slate-600);--cl-color-neutral-hover:var(--cl-palette-slate-500);--cl-color-neutral-active:var(--cl-palette-slate-400);--cl-color-neutral-fg:var(--cl-palette-white);--cl-color-neutral-subtle:#ffffff14;--cl-color-success-base:var(--cl-palette-emerald-500);--cl-color-success-hover:var(--cl-palette-emerald-400);--cl-color-success-active:var(--cl-palette-emerald-600);--cl-color-success-fg:var(--cl-palette-white);--cl-color-success-subtle:#10b98126;--cl-color-warning-base:var(--cl-palette-amber-500);--cl-color-warning-hover:var(--cl-palette-amber-400);--cl-color-warning-active:var(--cl-palette-amber-600);--cl-color-warning-fg:var(--cl-palette-white);--cl-color-warning-subtle:#f59e0b26;--cl-color-danger-base:var(--cl-palette-rose-500);--cl-color-danger-hover:var(--cl-palette-rose-400);--cl-color-danger-active:var(--cl-palette-rose-600);--cl-color-danger-fg:var(--cl-palette-white);--cl-color-danger-subtle:#f43f5e26;--cl-color-info-base:var(--cl-palette-sky-500);--cl-color-info-hover:var(--cl-palette-sky-400);--cl-color-info-active:var(--cl-palette-sky-600);--cl-color-info-fg:var(--cl-palette-white);--cl-color-info-subtle:#0ea5e926;--cl-color-focus-ring:#818cf88c;--cl-color-backdrop:#000000b3;--cl-shadow-sm:0 1px 2px 0 #0000004d;--cl-shadow-md:0 4px 6px -1px #0006, 0 2px 4px -2px #0000004d;--cl-shadow-lg:0 10px 15px -3px #00000080, 0 4px 6px -4px #0006;--cl-shadow-xl:0 20px 25px -5px #0009, 0 8px 10px -6px #0006;--cl-input-bg:var(--cl-palette-slate-900);--cl-card-bg:var(--cl-palette-slate-900);--cl-card-elevated-bg:var(--cl-palette-slate-800);--cl-dialog-bg:var(--cl-palette-slate-900);--cl-dialog-border:var(--cl-palette-slate-800)}}@layer cl-reset{[class^=cl-],[class*=\ cl-],[class^=cl-] *,[class*=\ cl-] *,[class^=cl-] :before,[class*=\ cl-] :before,[class^=cl-] :after,[class*=\ cl-] :after{box-sizing:border-box;border:0 solid}[class^=cl-],[class*=\ cl-]{font-family:var(--cl-font-sans);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}}@layer cl-components{.cl-button{box-sizing:border-box;user-select:none;vertical-align:middle;white-space:nowrap;font-family:var(--cl-font-sans);font-weight:var(--cl-font-weight-medium);cursor:pointer;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;transition:background-color var(--cl-duration-fast) var(--cl-ease-default), border-color var(--cl-duration-fast) var(--cl-ease-default), color var(--cl-duration-fast) var(--cl-ease-default), box-shadow var(--cl-duration-fast) var(--cl-ease-default), transform var(--cl-duration-fast) var(--cl-ease-default), opacity var(--cl-duration-fast) var(--cl-ease-default);border:1px solid #0000;outline:none;justify-content:center;align-items:center;margin:0;text-decoration:none;display:inline-flex;position:relative}.cl-button:focus-visible{outline:2px solid var(--cl-color-focus-ring);outline-offset:2px}.cl-button--full-width{width:100%;display:flex}.cl-button--disabled,.cl-button:disabled{opacity:.6;cursor:not-allowed;pointer-events:none;box-shadow:none;transform:none!important}.cl-button--loading{cursor:wait;pointer-events:none}.cl-button--xs{height:1.75rem;padding:0 var(--cl-space-2);font-size:var(--cl-font-xs);line-height:var(--cl-line-height-xs);gap:var(--cl-space-1);border-radius:var(--cl-rad-sm)}.cl-button--xs .cl-button__icon,.cl-button--xs .cl-button__spinner{width:14px;height:14px}.cl-button--sm{height:2rem;padding:0 var(--cl-space-3);font-size:var(--cl-font-sm);line-height:var(--cl-line-height-sm);border-radius:var(--cl-rad-md);gap:6px}.cl-button--sm .cl-button__icon,.cl-button--sm .cl-button__spinner{width:16px;height:16px}.cl-button--md{height:2.5rem;padding:0 var(--cl-space-4);font-size:var(--cl-font-sm);line-height:var(--cl-line-height-sm);gap:var(--cl-space-2);border-radius:var(--cl-rad-md)}.cl-button--md .cl-button__icon,.cl-button--md .cl-button__spinner{width:18px;height:18px}.cl-button--lg{height:3rem;padding:0 var(--cl-space-5);font-size:var(--cl-font-base);line-height:var(--cl-line-height-base);border-radius:var(--cl-rad-lg);gap:10px}.cl-button--lg .cl-button__icon,.cl-button--lg .cl-button__spinner{width:20px;height:20px}.cl-button--xl{height:3.5rem;padding:0 var(--cl-space-6);font-size:var(--cl-font-lg);line-height:var(--cl-line-height-lg);gap:var(--cl-space-3);border-radius:var(--cl-rad-lg)}.cl-button--xl .cl-button__icon,.cl-button--xl .cl-button__spinner{width:24px;height:24px}.cl-button--primary{--cl-button-bg:var(--cl-color-primary-base);--cl-button-fg:var(--cl-color-primary-fg);--cl-button-hover-bg:var(--cl-color-primary-hover);--cl-button-active-bg:var(--cl-color-primary-active);--cl-button-subtle-bg:var(--cl-color-primary-subtle)}.cl-button--secondary{--cl-button-bg:var(--cl-color-secondary-base);--cl-button-fg:var(--cl-color-secondary-fg);--cl-button-hover-bg:var(--cl-color-secondary-hover);--cl-button-active-bg:var(--cl-color-secondary-active);--cl-button-subtle-bg:var(--cl-color-secondary-subtle)}.cl-button--neutral{--cl-button-bg:var(--cl-color-neutral-base);--cl-button-fg:var(--cl-color-neutral-fg);--cl-button-hover-bg:var(--cl-color-neutral-hover);--cl-button-active-bg:var(--cl-color-neutral-active);--cl-button-subtle-bg:var(--cl-color-neutral-subtle)}.cl-button--success{--cl-button-bg:var(--cl-color-success-base);--cl-button-fg:var(--cl-color-success-fg);--cl-button-hover-bg:var(--cl-color-success-hover);--cl-button-active-bg:var(--cl-color-success-active);--cl-button-subtle-bg:var(--cl-color-success-subtle)}.cl-button--warning{--cl-button-bg:var(--cl-color-warning-base);--cl-button-fg:var(--cl-color-warning-fg);--cl-button-hover-bg:var(--cl-color-warning-hover);--cl-button-active-bg:var(--cl-color-warning-active);--cl-button-subtle-bg:var(--cl-color-warning-subtle)}.cl-button--danger{--cl-button-bg:var(--cl-color-danger-base);--cl-button-fg:var(--cl-color-danger-fg);--cl-button-hover-bg:var(--cl-color-danger-hover);--cl-button-active-bg:var(--cl-color-danger-active);--cl-button-subtle-bg:var(--cl-color-danger-subtle)}.cl-button--info{--cl-button-bg:var(--cl-color-info-base);--cl-button-fg:var(--cl-color-info-fg);--cl-button-hover-bg:var(--cl-color-info-hover);--cl-button-active-bg:var(--cl-color-info-active);--cl-button-subtle-bg:var(--cl-color-info-subtle)}.cl-button--solid{background-color:var(--cl-button-bg);color:var(--cl-button-fg);border-color:#0000}.cl-button--solid:hover:not(:disabled):not(.cl-button--disabled){background-color:var(--cl-button-hover-bg)}.cl-button--solid:active:not(:disabled):not(.cl-button--disabled){background-color:var(--cl-button-active-bg);transform:scale(.98)}.cl-button--outline{color:var(--cl-button-bg);border-color:var(--cl-button-bg);background-color:#0000}.cl-button--outline:hover:not(:disabled):not(.cl-button--disabled){background-color:var(--cl-button-subtle-bg)}.cl-button--outline:active:not(:disabled):not(.cl-button--disabled){background-color:var(--cl-button-subtle-bg);transform:scale(.98)}.cl-button--ghost{color:var(--cl-button-bg);background-color:#0000;border-color:#0000}.cl-button--ghost:hover:not(:disabled):not(.cl-button--disabled){background-color:var(--cl-button-subtle-bg)}.cl-button--ghost:active:not(:disabled):not(.cl-button--disabled){background-color:var(--cl-button-subtle-bg);transform:scale(.98)}.cl-button--subtle{background-color:var(--cl-button-subtle-bg);color:var(--cl-button-bg);border-color:#0000}.cl-button--subtle:hover:not(:disabled):not(.cl-button--disabled){background-color:var(--cl-button-subtle-bg);filter:brightness(.94)}.cl-button--subtle:active:not(:disabled):not(.cl-button--disabled){transform:scale(.98)}.cl-button--link{color:var(--cl-button-bg);height:auto;min-height:unset;box-shadow:none;background-color:#0000;border-color:#0000;border-radius:0;padding:0}.cl-button--link:hover:not(:disabled):not(.cl-button--disabled){text-decoration:underline}.cl-button--link:active:not(:disabled):not(.cl-button--disabled){transform:none}.cl-button__icon{flex-shrink:0;justify-content:center;align-items:center;line-height:1;display:inline-flex}.cl-button__spinner{flex-shrink:0;line-height:1;animation:.75s linear infinite cl-button-spin;display:inline-block}.cl-button__spinner-wrapper--center{justify-content:center;align-items:center;display:flex;position:absolute;inset:0}.cl-button__content--hidden{opacity:0;visibility:hidden}.cl-button__label{line-height:inherit;justify-content:center;align-items:center;display:inline-flex}@keyframes cl-button-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.cl-button,.cl-button__spinner{transition-duration:.01ms!important;animation-duration:.01ms!important}}.cl-button-group{box-sizing:border-box;display:inline-flex;position:relative}.cl-button-group--horizontal{flex-direction:row;align-items:center}.cl-button-group--vertical{flex-direction:column;align-items:stretch}.cl-button-group:not(.cl-button-group--attached){gap:var(--cl-space-2)}.cl-button-group--attached.cl-button-group--horizontal>.cl-button:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}.cl-button-group--attached.cl-button-group--horizontal>.cl-button:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.cl-button-group--attached.cl-button-group--vertical>.cl-button:not(:first-child){border-top-left-radius:0;border-top-right-radius:0;margin-top:-1px}.cl-button-group--attached.cl-button-group--vertical>.cl-button:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0}.cl-button-group--attached>.cl-button:hover,.cl-button-group--attached>.cl-button:focus-visible,.cl-button-group--attached>.cl-button:active{z-index:1}}
|
package/package.json
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@chellaa/react",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Production-grade, accessible, high-performance React component library and design system engine built with zero-runtime CSS custom properties.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"react",
|
|
7
|
+
"react-components",
|
|
8
|
+
"component-library",
|
|
9
|
+
"design-system",
|
|
10
|
+
"accessibility",
|
|
11
|
+
"wcag",
|
|
12
|
+
"wai-aria",
|
|
13
|
+
"zero-runtime",
|
|
14
|
+
"css-variables",
|
|
15
|
+
"typescript"
|
|
16
|
+
],
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/chellaa/chellaa-react.git",
|
|
21
|
+
"directory": "packages/react"
|
|
22
|
+
},
|
|
23
|
+
"homepage": "https://chellaa.dev",
|
|
24
|
+
"bugs": {
|
|
25
|
+
"url": "https://github.com/chellaa/chellaa-react/issues"
|
|
26
|
+
},
|
|
27
|
+
"author": "Chellaa React Contributors",
|
|
28
|
+
"type": "module",
|
|
29
|
+
"main": "./dist/index.cjs",
|
|
30
|
+
"module": "./dist/index.mjs",
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"exports": {
|
|
33
|
+
".": {
|
|
34
|
+
"types": {
|
|
35
|
+
"import": "./dist/index.d.ts",
|
|
36
|
+
"require": "./dist/index.d.cts"
|
|
37
|
+
},
|
|
38
|
+
"browser": {
|
|
39
|
+
"import": "./dist/index.mjs",
|
|
40
|
+
"require": "./dist/index.cjs"
|
|
41
|
+
},
|
|
42
|
+
"node": {
|
|
43
|
+
"import": "./dist/index.node.mjs",
|
|
44
|
+
"require": "./dist/index.cjs"
|
|
45
|
+
},
|
|
46
|
+
"import": "./dist/index.mjs",
|
|
47
|
+
"require": "./dist/index.cjs",
|
|
48
|
+
"default": "./dist/index.mjs"
|
|
49
|
+
},
|
|
50
|
+
"./styles.css": {
|
|
51
|
+
"import": {
|
|
52
|
+
"types": "./dist/styles.css.d.ts",
|
|
53
|
+
"default": "./dist/styles.css"
|
|
54
|
+
},
|
|
55
|
+
"require": {
|
|
56
|
+
"types": "./dist/styles.css.d.cts",
|
|
57
|
+
"default": "./dist/styles.css"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"./package.json": "./package.json"
|
|
61
|
+
},
|
|
62
|
+
"files": [
|
|
63
|
+
"dist",
|
|
64
|
+
"styles.css",
|
|
65
|
+
"styles.css.d.ts",
|
|
66
|
+
"README.md",
|
|
67
|
+
"LICENSE"
|
|
68
|
+
],
|
|
69
|
+
"sideEffects": [
|
|
70
|
+
"*.css",
|
|
71
|
+
"**/*.css"
|
|
72
|
+
],
|
|
73
|
+
"peerDependencies": {
|
|
74
|
+
"react": ">=18.2.0",
|
|
75
|
+
"react-dom": ">=18.2.0"
|
|
76
|
+
},
|
|
77
|
+
"scripts": {
|
|
78
|
+
"build": "tsup && node scripts/build-css.mjs",
|
|
79
|
+
"dev": "tsup --watch",
|
|
80
|
+
"clean": "node -e \"fs.rmSync('dist', { recursive: true, force: true })\"",
|
|
81
|
+
"typecheck": "tsc --noEmit",
|
|
82
|
+
"test": "vitest run",
|
|
83
|
+
"test:watch": "vitest",
|
|
84
|
+
"size": "size-limit"
|
|
85
|
+
},
|
|
86
|
+
"devDependencies": {
|
|
87
|
+
"@arethetypeswrong/cli": "^0.15.4",
|
|
88
|
+
"@size-limit/preset-small-lib": "^11.1.4",
|
|
89
|
+
"@testing-library/jest-dom": "^7.0.1",
|
|
90
|
+
"@testing-library/react": "^16.0.1",
|
|
91
|
+
"@testing-library/user-event": "^14.5.2",
|
|
92
|
+
"@types/react": "^18.3.12",
|
|
93
|
+
"@types/react-dom": "^18.3.1",
|
|
94
|
+
"jsdom": "^25.0.1",
|
|
95
|
+
"lightningcss": "^1.26.0",
|
|
96
|
+
"publint": "^0.2.11",
|
|
97
|
+
"react": "^18.3.1",
|
|
98
|
+
"react-dom": "^18.3.1",
|
|
99
|
+
"size-limit": "^11.1.4",
|
|
100
|
+
"tsup": "^8.3.0",
|
|
101
|
+
"typescript": "^5.6.2",
|
|
102
|
+
"vitest": "^2.1.2",
|
|
103
|
+
"vitest-axe": "^0.1.0"
|
|
104
|
+
},
|
|
105
|
+
"engines": {
|
|
106
|
+
"node": ">=18.0.0"
|
|
107
|
+
},
|
|
108
|
+
"publishConfig": {
|
|
109
|
+
"access": "public"
|
|
110
|
+
}
|
|
111
|
+
}
|
package/styles.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "./dist/styles.css";
|
package/styles.css.d.ts
ADDED