atelier-ui-react 1.0.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 (72) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +101 -0
  3. package/dist/index.cjs +909 -0
  4. package/dist/index.css +962 -0
  5. package/dist/index.mjs +876 -0
  6. package/package.json +52 -0
  7. package/src/Button/Button.css +169 -0
  8. package/src/Button/Button.tsx +57 -0
  9. package/src/Button/Button.types.ts +19 -0
  10. package/src/Button/index.ts +2 -0
  11. package/src/Card/Card.css +73 -0
  12. package/src/Card/Card.tsx +79 -0
  13. package/src/Card/Card.types.ts +25 -0
  14. package/src/Card/index.ts +2 -0
  15. package/src/Checkbox/Checkbox.css +101 -0
  16. package/src/Checkbox/Checkbox.tsx +85 -0
  17. package/src/Checkbox/Checkbox.types.ts +9 -0
  18. package/src/Checkbox/index.ts +2 -0
  19. package/src/Divider/Divider.css +47 -0
  20. package/src/Divider/Divider.tsx +53 -0
  21. package/src/Divider/Divider.types.ts +12 -0
  22. package/src/Divider/index.ts +2 -0
  23. package/src/Heading/Heading.css +30 -0
  24. package/src/Heading/Heading.tsx +50 -0
  25. package/src/Heading/Heading.types.ts +16 -0
  26. package/src/Heading/index.ts +2 -0
  27. package/src/Icon/Icon.css +26 -0
  28. package/src/Icon/Icon.tsx +79 -0
  29. package/src/Icon/Icon.types.ts +13 -0
  30. package/src/Icon/index.ts +2 -0
  31. package/src/Input/Input.css +145 -0
  32. package/src/Input/Input.tsx +86 -0
  33. package/src/Input/Input.types.ts +15 -0
  34. package/src/Input/index.ts +2 -0
  35. package/src/Link/Link.css +50 -0
  36. package/src/Link/Link.tsx +64 -0
  37. package/src/Link/Link.types.ts +13 -0
  38. package/src/Link/index.ts +2 -0
  39. package/src/Select/Select.css +115 -0
  40. package/src/Select/Select.tsx +109 -0
  41. package/src/Select/Select.types.ts +19 -0
  42. package/src/Select/index.ts +2 -0
  43. package/src/Text/Text.css +49 -0
  44. package/src/Text/Text.tsx +46 -0
  45. package/src/Text/Text.types.ts +19 -0
  46. package/src/Text/index.ts +2 -0
  47. package/src/index.ts +34 -0
  48. package/src/layout/Container/Container.css +16 -0
  49. package/src/layout/Container/Container.tsx +51 -0
  50. package/src/layout/Container/Container.types.ts +12 -0
  51. package/src/layout/Container/index.ts +2 -0
  52. package/src/layout/Flex/Flex.css +34 -0
  53. package/src/layout/Flex/Flex.tsx +56 -0
  54. package/src/layout/Flex/Flex.types.ts +18 -0
  55. package/src/layout/Flex/index.ts +2 -0
  56. package/src/layout/Grid/Grid.css +18 -0
  57. package/src/layout/Grid/Grid.tsx +61 -0
  58. package/src/layout/Grid/Grid.types.ts +17 -0
  59. package/src/layout/Grid/index.ts +2 -0
  60. package/src/layout/Stack/Stack.css +50 -0
  61. package/src/layout/Stack/Stack.tsx +70 -0
  62. package/src/layout/Stack/Stack.types.ts +17 -0
  63. package/src/layout/Stack/index.ts +2 -0
  64. package/src/styles/globals.css +28 -0
  65. package/src/styles/reset.css +44 -0
  66. package/src/theme/ThemeProvider.tsx +83 -0
  67. package/src/theme/dark.css +62 -0
  68. package/src/theme/index.ts +2 -0
  69. package/src/theme/light.css +62 -0
  70. package/src/theme/theme.types.ts +19 -0
  71. package/src/theme/tokens.css +61 -0
  72. package/src/utils/index.ts +44 -0
package/dist/index.cjs ADDED
@@ -0,0 +1,909 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
+ Button: () => Button,
34
+ Card: () => Card2,
35
+ Checkbox: () => Checkbox,
36
+ Container: () => Container,
37
+ Divider: () => Divider,
38
+ Flex: () => Flex,
39
+ Grid: () => Grid,
40
+ Heading: () => Heading,
41
+ Icon: () => Icon,
42
+ Input: () => Input,
43
+ Link: () => Link,
44
+ Select: () => Select,
45
+ Stack: () => Stack,
46
+ Text: () => Text,
47
+ ThemeProvider: () => ThemeProvider,
48
+ cx: () => cx,
49
+ getSpaceValue: () => getSpaceValue,
50
+ useTheme: () => useTheme
51
+ });
52
+ module.exports = __toCommonJS(index_exports);
53
+
54
+ // src/Text/Text.tsx
55
+ var import_react = __toESM(require("react"));
56
+
57
+ // src/utils/index.ts
58
+ function cx(...classes) {
59
+ const result = [];
60
+ for (const item of classes) {
61
+ if (!item) continue;
62
+ if (typeof item === "string" || typeof item === "number") {
63
+ result.push(String(item));
64
+ } else if (Array.isArray(item)) {
65
+ const inner = cx(...item);
66
+ if (inner) result.push(inner);
67
+ } else if (typeof item === "object") {
68
+ for (const [key, value] of Object.entries(item)) {
69
+ if (value) result.push(key);
70
+ }
71
+ }
72
+ }
73
+ return result.join(" ");
74
+ }
75
+ function getSpaceValue(val) {
76
+ if (val === void 0) return void 0;
77
+ if (typeof val === "number") return `${val}px`;
78
+ const tokenList = ["2xs", "xs", "sm", "md", "lg", "xl", "2xl", "3xl"];
79
+ if (tokenList.includes(val)) {
80
+ return `var(--ui-space-${val})`;
81
+ }
82
+ return val;
83
+ }
84
+
85
+ // src/Text/Text.tsx
86
+ var Text = (0, import_react.forwardRef)(function Text2({
87
+ as: Component = "p",
88
+ size = "md",
89
+ weight = "normal",
90
+ color = "default",
91
+ muted = false,
92
+ align,
93
+ truncate = false,
94
+ mono = false,
95
+ className,
96
+ children,
97
+ ...rest
98
+ }, ref) {
99
+ const resolvedColor = muted ? "muted" : color;
100
+ const classes = cx(
101
+ "ui-text",
102
+ `ui-text--size-${size}`,
103
+ `ui-text--weight-${weight}`,
104
+ `ui-text--color-${resolvedColor}`,
105
+ align && `ui-text--align-${align}`,
106
+ truncate && "ui-text--truncate",
107
+ mono && "ui-text--mono",
108
+ className
109
+ );
110
+ return import_react.default.createElement(
111
+ Component,
112
+ {
113
+ ref,
114
+ className: classes,
115
+ ...rest
116
+ },
117
+ children
118
+ );
119
+ });
120
+ Text.displayName = "Text";
121
+
122
+ // src/Heading/Heading.tsx
123
+ var import_react2 = __toESM(require("react"));
124
+ var defaultLevelSizeMap = {
125
+ 1: "3xl",
126
+ 2: "2xl",
127
+ 3: "xl",
128
+ 4: "lg",
129
+ 5: "md",
130
+ 6: "sm"
131
+ };
132
+ var Heading = (0, import_react2.forwardRef)(function Heading2({
133
+ level = 2,
134
+ as,
135
+ size,
136
+ weight = "semibold",
137
+ align,
138
+ className,
139
+ children,
140
+ ...rest
141
+ }, ref) {
142
+ const Component = as || `h${level}`;
143
+ const resolvedSize = size || defaultLevelSizeMap[level] || "xl";
144
+ const classes = cx(
145
+ "ui-heading",
146
+ `ui-heading--size-${resolvedSize}`,
147
+ `ui-heading--weight-${weight}`,
148
+ align && `ui-heading--align-${align}`,
149
+ className
150
+ );
151
+ return import_react2.default.createElement(
152
+ Component,
153
+ {
154
+ ref,
155
+ className: classes,
156
+ ...rest
157
+ },
158
+ children
159
+ );
160
+ });
161
+ Heading.displayName = "Heading";
162
+
163
+ // src/Icon/Icon.tsx
164
+ var import_react3 = require("react");
165
+ var import_jsx_runtime = require("react/jsx-runtime");
166
+ var sizeMap = {
167
+ xs: 14,
168
+ sm: 16,
169
+ md: 20,
170
+ lg: 24,
171
+ xl: 32
172
+ };
173
+ var Icon = (0, import_react3.forwardRef)(function Icon2({
174
+ icon: Component,
175
+ size = "md",
176
+ color = "inherit",
177
+ spin = false,
178
+ className,
179
+ style,
180
+ children,
181
+ ...rest
182
+ }, ref) {
183
+ const pixelSize = typeof size === "number" ? size : sizeMap[size] || 20;
184
+ let resolvedColor = color;
185
+ const tokenColors = {
186
+ default: "var(--ui-color-foreground)",
187
+ muted: "var(--ui-color-foreground-muted)",
188
+ subtle: "var(--ui-color-foreground-subtle)",
189
+ primary: "var(--ui-color-primary)",
190
+ success: "var(--ui-color-success)",
191
+ warning: "var(--ui-color-warning)",
192
+ danger: "var(--ui-color-danger)",
193
+ inherit: "currentColor"
194
+ };
195
+ if (tokenColors[color]) {
196
+ resolvedColor = tokenColors[color];
197
+ }
198
+ const classes = cx(
199
+ "ui-icon",
200
+ spin && "ui-icon--spin",
201
+ className
202
+ );
203
+ const combinedStyle = {
204
+ width: `${pixelSize}px`,
205
+ height: `${pixelSize}px`,
206
+ color: resolvedColor,
207
+ ...style
208
+ };
209
+ if (Component) {
210
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: classes, style: combinedStyle, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
211
+ Component,
212
+ {
213
+ ref,
214
+ width: pixelSize,
215
+ height: pixelSize,
216
+ "aria-hidden": "true",
217
+ ...rest
218
+ }
219
+ ) });
220
+ }
221
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: classes, style: combinedStyle, "aria-hidden": "true", children });
222
+ });
223
+ Icon.displayName = "Icon";
224
+
225
+ // src/Divider/Divider.tsx
226
+ var import_react4 = require("react");
227
+ var import_jsx_runtime2 = require("react/jsx-runtime");
228
+ var Divider = (0, import_react4.forwardRef)(function Divider2({
229
+ orientation = "horizontal",
230
+ spacing = "md",
231
+ label,
232
+ align = "center",
233
+ className,
234
+ style,
235
+ children,
236
+ ...rest
237
+ }, ref) {
238
+ const content = label || children;
239
+ const spacingVal = getSpaceValue(spacing);
240
+ const classes = cx(
241
+ "ui-divider",
242
+ `ui-divider--${orientation}`,
243
+ content && `ui-divider--align-${align}`,
244
+ className
245
+ );
246
+ const combinedStyle = {
247
+ marginTop: orientation === "horizontal" ? spacingVal : void 0,
248
+ marginBottom: orientation === "horizontal" ? spacingVal : void 0,
249
+ marginLeft: orientation === "vertical" ? spacingVal : void 0,
250
+ marginRight: orientation === "vertical" ? spacingVal : void 0,
251
+ ...style
252
+ };
253
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
254
+ "div",
255
+ {
256
+ ref,
257
+ role: "separator",
258
+ "aria-orientation": orientation,
259
+ className: classes,
260
+ style: combinedStyle,
261
+ ...rest,
262
+ children: [
263
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "ui-divider__line" }),
264
+ content && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "ui-divider__content", children: content }),
265
+ content && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "ui-divider__line" })
266
+ ]
267
+ }
268
+ );
269
+ });
270
+ Divider.displayName = "Divider";
271
+
272
+ // src/Button/Button.tsx
273
+ var import_react5 = __toESM(require("react"));
274
+ var import_jsx_runtime3 = require("react/jsx-runtime");
275
+ var Button = (0, import_react5.forwardRef)(function Button2({
276
+ variant = "primary",
277
+ size = "md",
278
+ loading = false,
279
+ disabled = false,
280
+ iconLeft,
281
+ iconRight,
282
+ fullWidth = false,
283
+ as: Component = "button",
284
+ type = "button",
285
+ className,
286
+ children,
287
+ ...rest
288
+ }, ref) {
289
+ const isActuallyDisabled = disabled || loading;
290
+ const classes = cx(
291
+ "ui-btn",
292
+ `ui-btn--variant-${variant}`,
293
+ `ui-btn--size-${size}`,
294
+ fullWidth && "ui-btn--full-width",
295
+ isActuallyDisabled && "ui-btn--disabled",
296
+ loading && "ui-btn--loading",
297
+ className
298
+ );
299
+ const buttonProps = Component === "button" ? { type, disabled: isActuallyDisabled } : { "aria-disabled": isActuallyDisabled };
300
+ return import_react5.default.createElement(
301
+ Component,
302
+ {
303
+ ref,
304
+ className: classes,
305
+ ...buttonProps,
306
+ ...rest
307
+ },
308
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
309
+ loading ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "ui-btn__spinner", "aria-hidden": "true" }) : iconLeft && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "ui-btn__icon-left", children: iconLeft }),
310
+ children && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "ui-btn__label", children }),
311
+ !loading && iconRight && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "ui-btn__icon-right", children: iconRight })
312
+ ] })
313
+ );
314
+ });
315
+ Button.displayName = "Button";
316
+
317
+ // src/Link/Link.tsx
318
+ var import_react6 = require("react");
319
+ var import_jsx_runtime4 = require("react/jsx-runtime");
320
+ var Link = (0, import_react6.forwardRef)(function Link2({
321
+ variant = "default",
322
+ size = "md",
323
+ external = false,
324
+ iconLeft,
325
+ iconRight,
326
+ className,
327
+ target,
328
+ rel,
329
+ children,
330
+ ...rest
331
+ }, ref) {
332
+ const classes = cx(
333
+ "ui-link",
334
+ `ui-link--variant-${variant}`,
335
+ `ui-link--size-${size}`,
336
+ className
337
+ );
338
+ const resolvedTarget = external ? "_blank" : target;
339
+ const resolvedRel = external ? rel ? `${rel} noopener noreferrer` : "noopener noreferrer" : rel;
340
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
341
+ "a",
342
+ {
343
+ ref,
344
+ className: classes,
345
+ target: resolvedTarget,
346
+ rel: resolvedRel,
347
+ ...rest,
348
+ children: [
349
+ iconLeft && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "ui-link__icon-left", children: iconLeft }),
350
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children }),
351
+ iconRight && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "ui-link__icon-right", children: iconRight }),
352
+ external && !iconRight && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
353
+ "svg",
354
+ {
355
+ width: "12",
356
+ height: "12",
357
+ viewBox: "0 0 24 24",
358
+ fill: "none",
359
+ stroke: "currentColor",
360
+ strokeWidth: "2",
361
+ strokeLinecap: "round",
362
+ strokeLinejoin: "round",
363
+ className: "ui-link__external-icon",
364
+ "aria-hidden": "true",
365
+ children: [
366
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }),
367
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("polyline", { points: "15 3 21 3 21 9" }),
368
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("line", { x1: "10", y1: "14", x2: "21", y2: "3" })
369
+ ]
370
+ }
371
+ )
372
+ ]
373
+ }
374
+ );
375
+ });
376
+ Link.displayName = "Link";
377
+
378
+ // src/Input/Input.tsx
379
+ var import_react7 = require("react");
380
+ var import_jsx_runtime5 = require("react/jsx-runtime");
381
+ var Input = (0, import_react7.forwardRef)(function Input2({
382
+ size = "md",
383
+ variant = "default",
384
+ label,
385
+ helperText,
386
+ error,
387
+ leftIcon,
388
+ rightIcon,
389
+ fullWidth = false,
390
+ disabled = false,
391
+ id: explicitId,
392
+ className,
393
+ ...rest
394
+ }, ref) {
395
+ const generatedId = (0, import_react7.useId)();
396
+ const id = explicitId || generatedId;
397
+ const helperId = `${id}-helper`;
398
+ const hasError = Boolean(error);
399
+ const errorMessage = typeof error === "string" ? error : void 0;
400
+ const isReadOnly = rest.readOnly !== void 0 ? rest.readOnly : rest.value !== void 0 && !rest.onChange ? true : void 0;
401
+ const wrapperClasses = cx(
402
+ "ui-input-wrapper",
403
+ fullWidth && "ui-input-wrapper--full-width"
404
+ );
405
+ const inputClasses = cx(
406
+ "ui-input",
407
+ `ui-input--size-${size}`,
408
+ `ui-input--variant-${variant}`,
409
+ leftIcon && "ui-input--has-left-icon",
410
+ rightIcon && "ui-input--has-right-icon",
411
+ hasError && "ui-input--error",
412
+ className
413
+ );
414
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: wrapperClasses, children: [
415
+ label && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
416
+ "label",
417
+ {
418
+ htmlFor: id,
419
+ className: cx("ui-input-label", disabled && "ui-input-label--disabled"),
420
+ children: label
421
+ }
422
+ ),
423
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "ui-input-container", children: [
424
+ leftIcon && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "ui-input__icon ui-input__icon--left", children: leftIcon }),
425
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
426
+ "input",
427
+ {
428
+ ref,
429
+ id,
430
+ disabled,
431
+ readOnly: isReadOnly,
432
+ "aria-invalid": hasError,
433
+ "aria-describedby": helperText || errorMessage ? helperId : void 0,
434
+ className: inputClasses,
435
+ ...rest
436
+ }
437
+ ),
438
+ rightIcon && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "ui-input__icon ui-input__icon--right", children: rightIcon })
439
+ ] }),
440
+ (errorMessage || helperText) && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
441
+ "span",
442
+ {
443
+ id: helperId,
444
+ className: cx("ui-input-helper", hasError && "ui-input-helper--error"),
445
+ children: errorMessage || helperText
446
+ }
447
+ )
448
+ ] });
449
+ });
450
+ Input.displayName = "Input";
451
+
452
+ // src/Checkbox/Checkbox.tsx
453
+ var import_react8 = require("react");
454
+ var import_jsx_runtime6 = require("react/jsx-runtime");
455
+ var Checkbox = (0, import_react8.forwardRef)(function Checkbox2({
456
+ size = "md",
457
+ label,
458
+ description,
459
+ indeterminate = false,
460
+ checked,
461
+ defaultChecked,
462
+ disabled = false,
463
+ error,
464
+ className,
465
+ onChange,
466
+ readOnly,
467
+ ...rest
468
+ }, forwardedRef) {
469
+ const innerRef = (0, import_react8.useRef)(null);
470
+ const inputRef = forwardedRef || innerRef;
471
+ (0, import_react8.useEffect)(() => {
472
+ if (inputRef.current) {
473
+ inputRef.current.indeterminate = Boolean(indeterminate);
474
+ }
475
+ }, [indeterminate, inputRef]);
476
+ const isChecked = checked !== void 0 ? checked : void 0;
477
+ const isReadOnly = readOnly !== void 0 ? readOnly : checked !== void 0 && !onChange ? true : void 0;
478
+ const wrapperClasses = cx(
479
+ "ui-checkbox-wrapper",
480
+ disabled && "ui-checkbox-wrapper--disabled",
481
+ className
482
+ );
483
+ const boxClasses = cx(
484
+ "ui-checkbox-box",
485
+ `ui-checkbox-box--${size}`,
486
+ (isChecked || defaultChecked) && "ui-checkbox-box--checked",
487
+ indeterminate && "ui-checkbox-box--indeterminate",
488
+ error && "ui-checkbox-box--error"
489
+ );
490
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { className: wrapperClasses, children: [
491
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
492
+ "input",
493
+ {
494
+ ref: inputRef,
495
+ type: "checkbox",
496
+ checked,
497
+ defaultChecked,
498
+ disabled,
499
+ readOnly: isReadOnly,
500
+ onChange,
501
+ className: "ui-checkbox-input",
502
+ ...rest
503
+ }
504
+ ),
505
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: boxClasses, "aria-hidden": "true", children: indeterminate ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("svg", { className: "ui-checkbox-icon", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("svg", { className: "ui-checkbox-icon", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("polyline", { points: "20 6 9 17 4 12" }) }) }),
506
+ (label || description) && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "ui-checkbox-content", children: [
507
+ label && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "ui-checkbox-label", children: label }),
508
+ description && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "ui-checkbox-desc", children: description })
509
+ ] })
510
+ ] });
511
+ });
512
+ Checkbox.displayName = "Checkbox";
513
+
514
+ // src/Select/Select.tsx
515
+ var import_react9 = require("react");
516
+ var import_jsx_runtime7 = require("react/jsx-runtime");
517
+ var Select = (0, import_react9.forwardRef)(function Select2({
518
+ options,
519
+ placeholder,
520
+ size = "md",
521
+ label,
522
+ helperText,
523
+ error,
524
+ fullWidth = false,
525
+ disabled = false,
526
+ id: explicitId,
527
+ className,
528
+ children,
529
+ value,
530
+ defaultValue,
531
+ ...rest
532
+ }, ref) {
533
+ const generatedId = (0, import_react9.useId)();
534
+ const id = explicitId || generatedId;
535
+ const helperId = `${id}-helper`;
536
+ const hasError = Boolean(error);
537
+ const errorMessage = typeof error === "string" ? error : void 0;
538
+ const wrapperClasses = cx(
539
+ "ui-select-wrapper",
540
+ fullWidth && "ui-select-wrapper--full-width"
541
+ );
542
+ const selectClasses = cx(
543
+ "ui-select",
544
+ `ui-select--size-${size}`,
545
+ hasError && "ui-select--error",
546
+ className
547
+ );
548
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: wrapperClasses, children: [
549
+ label && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
550
+ "label",
551
+ {
552
+ htmlFor: id,
553
+ className: cx("ui-select-label", disabled && "ui-select-label--disabled"),
554
+ children: label
555
+ }
556
+ ),
557
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "ui-select-container", children: [
558
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
559
+ "select",
560
+ {
561
+ ref,
562
+ id,
563
+ disabled,
564
+ value,
565
+ defaultValue,
566
+ "aria-invalid": hasError,
567
+ "aria-describedby": helperText || errorMessage ? helperId : void 0,
568
+ className: selectClasses,
569
+ ...rest,
570
+ children: [
571
+ placeholder && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: "", disabled: true, children: placeholder }),
572
+ options ? options.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: opt.value, disabled: opt.disabled, children: opt.label }, opt.value)) : children
573
+ ]
574
+ }
575
+ ),
576
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "ui-select-icon", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
577
+ "svg",
578
+ {
579
+ width: "16",
580
+ height: "16",
581
+ viewBox: "0 0 24 24",
582
+ fill: "none",
583
+ stroke: "currentColor",
584
+ strokeWidth: "2",
585
+ strokeLinecap: "round",
586
+ strokeLinejoin: "round",
587
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("polyline", { points: "6 9 12 15 18 9" })
588
+ }
589
+ ) })
590
+ ] }),
591
+ (errorMessage || helperText) && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
592
+ "span",
593
+ {
594
+ id: helperId,
595
+ className: cx("ui-select-helper", hasError && "ui-select-helper--error"),
596
+ children: errorMessage || helperText
597
+ }
598
+ )
599
+ ] });
600
+ });
601
+ Select.displayName = "Select";
602
+
603
+ // src/Card/Card.tsx
604
+ var import_react10 = __toESM(require("react"));
605
+ var import_jsx_runtime8 = require("react/jsx-runtime");
606
+ var CardBase = (0, import_react10.forwardRef)(function Card({
607
+ as: Component = "div",
608
+ variant = "outlined",
609
+ padding = "lg",
610
+ interactive = false,
611
+ className,
612
+ children,
613
+ ...rest
614
+ }, ref) {
615
+ const classes = cx(
616
+ "ui-card",
617
+ `ui-card--variant-${variant}`,
618
+ `ui-card--padding-${padding}`,
619
+ interactive && "ui-card--interactive",
620
+ className
621
+ );
622
+ return import_react10.default.createElement(
623
+ Component,
624
+ {
625
+ ref,
626
+ className: classes,
627
+ ...rest
628
+ },
629
+ children
630
+ );
631
+ });
632
+ var CardHeader = (0, import_react10.forwardRef)(function CardHeader2({ className, children, ...rest }, ref) {
633
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { ref, className: cx("ui-card__header", className), ...rest, children });
634
+ });
635
+ CardHeader.displayName = "Card.Header";
636
+ var CardBody = (0, import_react10.forwardRef)(function CardBody2({ className, children, ...rest }, ref) {
637
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { ref, className: cx("ui-card__body", className), ...rest, children });
638
+ });
639
+ CardBody.displayName = "Card.Body";
640
+ var CardFooter = (0, import_react10.forwardRef)(function CardFooter2({ className, children, ...rest }, ref) {
641
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { ref, className: cx("ui-card__footer", className), ...rest, children });
642
+ });
643
+ CardFooter.displayName = "Card.Footer";
644
+ var Card2 = Object.assign(CardBase, {
645
+ Header: CardHeader,
646
+ Body: CardBody,
647
+ Footer: CardFooter
648
+ });
649
+ Card2.displayName = "Card";
650
+
651
+ // src/layout/Stack/Stack.tsx
652
+ var import_react11 = __toESM(require("react"));
653
+ var import_jsx_runtime9 = require("react/jsx-runtime");
654
+ var Stack = (0, import_react11.forwardRef)(function Stack2({
655
+ as: Component = "div",
656
+ direction = "vertical",
657
+ gap = "md",
658
+ align,
659
+ justify,
660
+ wrap = false,
661
+ divider,
662
+ className,
663
+ style,
664
+ children,
665
+ ...rest
666
+ }, ref) {
667
+ const resolvedGap = gap === "none" ? "0px" : getSpaceValue(gap);
668
+ const classes = cx(
669
+ "ui-stack",
670
+ `ui-stack--${direction}`,
671
+ align && `ui-stack--align-${align}`,
672
+ justify && `ui-stack--justify-${justify}`,
673
+ wrap && "ui-stack--wrap",
674
+ className
675
+ );
676
+ const combinedStyle = {
677
+ gap: resolvedGap,
678
+ ...style
679
+ };
680
+ let renderedChildren = children;
681
+ if (divider) {
682
+ const validChildren = import_react11.Children.toArray(children).filter(Boolean);
683
+ renderedChildren = validChildren.map((child, index) => {
684
+ const isLast = index === validChildren.length - 1;
685
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react11.default.Fragment, { children: [
686
+ child,
687
+ !isLast && (import_react11.default.isValidElement(divider) ? divider : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "ui-stack-divider", role: "separator" }))
688
+ ] }, index);
689
+ });
690
+ }
691
+ return import_react11.default.createElement(
692
+ Component,
693
+ {
694
+ ref,
695
+ className: classes,
696
+ style: combinedStyle,
697
+ ...rest
698
+ },
699
+ renderedChildren
700
+ );
701
+ });
702
+ Stack.displayName = "Stack";
703
+
704
+ // src/layout/Flex/Flex.tsx
705
+ var import_react12 = __toESM(require("react"));
706
+ var Flex = (0, import_react12.forwardRef)(function Flex2({
707
+ as: Component = "div",
708
+ direction = "row",
709
+ align,
710
+ justify,
711
+ gap,
712
+ wrap,
713
+ inline = false,
714
+ className,
715
+ style,
716
+ children,
717
+ ...rest
718
+ }, ref) {
719
+ const resolvedGap = getSpaceValue(gap);
720
+ const wrapClass = typeof wrap === "boolean" ? wrap ? "ui-flex--wrap" : "ui-flex--wrap-nowrap" : wrap ? `ui-flex--wrap-${wrap}` : void 0;
721
+ const classes = cx(
722
+ "ui-flex",
723
+ inline && "ui-flex--inline",
724
+ direction && `ui-flex--direction-${direction}`,
725
+ align && `ui-flex--align-${align}`,
726
+ justify && `ui-flex--justify-${justify}`,
727
+ wrapClass,
728
+ className
729
+ );
730
+ const combinedStyle = {
731
+ gap: resolvedGap,
732
+ ...style
733
+ };
734
+ return import_react12.default.createElement(
735
+ Component,
736
+ {
737
+ ref,
738
+ className: classes,
739
+ style: combinedStyle,
740
+ ...rest
741
+ },
742
+ children
743
+ );
744
+ });
745
+ Flex.displayName = "Flex";
746
+
747
+ // src/layout/Grid/Grid.tsx
748
+ var import_react13 = __toESM(require("react"));
749
+ var Grid = (0, import_react13.forwardRef)(function Grid2({
750
+ as: Component = "div",
751
+ columns,
752
+ minChildWidth,
753
+ gap = "md",
754
+ rowGap,
755
+ columnGap,
756
+ align,
757
+ justify,
758
+ className,
759
+ style,
760
+ children,
761
+ ...rest
762
+ }, ref) {
763
+ let gridTemplateColumns;
764
+ if (minChildWidth) {
765
+ const minWidth = typeof minChildWidth === "number" ? `${minChildWidth}px` : minChildWidth;
766
+ gridTemplateColumns = `repeat(auto-fit, minmax(${minWidth}, 1fr))`;
767
+ } else if (typeof columns === "number") {
768
+ gridTemplateColumns = `repeat(${columns}, minmax(0, 1fr))`;
769
+ } else if (typeof columns === "string") {
770
+ gridTemplateColumns = columns;
771
+ }
772
+ const classes = cx(
773
+ "ui-grid",
774
+ align && `ui-grid--align-${align}`,
775
+ justify && `ui-grid--justify-${justify}`,
776
+ className
777
+ );
778
+ const combinedStyle = {
779
+ gridTemplateColumns,
780
+ gap: getSpaceValue(gap),
781
+ rowGap: getSpaceValue(rowGap),
782
+ columnGap: getSpaceValue(columnGap),
783
+ ...style
784
+ };
785
+ return import_react13.default.createElement(
786
+ Component,
787
+ {
788
+ ref,
789
+ className: classes,
790
+ style: combinedStyle,
791
+ ...rest
792
+ },
793
+ children
794
+ );
795
+ });
796
+ Grid.displayName = "Grid";
797
+
798
+ // src/layout/Container/Container.tsx
799
+ var import_react14 = __toESM(require("react"));
800
+ var Container = (0, import_react14.forwardRef)(function Container2({
801
+ as: Component = "div",
802
+ size = "lg",
803
+ centered = true,
804
+ padding = "md",
805
+ className,
806
+ style,
807
+ children,
808
+ ...rest
809
+ }, ref) {
810
+ const classes = cx(
811
+ "ui-container",
812
+ `ui-container--size-${size}`,
813
+ centered && "ui-container--centered",
814
+ className
815
+ );
816
+ let paddingValue;
817
+ if (typeof padding === "boolean") {
818
+ paddingValue = padding ? "var(--ui-space-md)" : "0";
819
+ } else if (padding) {
820
+ paddingValue = getSpaceValue(padding);
821
+ }
822
+ const combinedStyle = {
823
+ paddingLeft: paddingValue,
824
+ paddingRight: paddingValue,
825
+ ...style
826
+ };
827
+ return import_react14.default.createElement(
828
+ Component,
829
+ {
830
+ ref,
831
+ className: classes,
832
+ style: combinedStyle,
833
+ ...rest
834
+ },
835
+ children
836
+ );
837
+ });
838
+ Container.displayName = "Container";
839
+
840
+ // src/theme/ThemeProvider.tsx
841
+ var import_react15 = require("react");
842
+ var import_jsx_runtime10 = require("react/jsx-runtime");
843
+ var ThemeContext = (0, import_react15.createContext)(void 0);
844
+ function ThemeProvider({
845
+ children,
846
+ defaultTheme = "light",
847
+ storageKey = "atelier-ui-theme",
848
+ attribute = "data-theme",
849
+ enableSystem = true
850
+ }) {
851
+ const [theme, setThemeState] = (0, import_react15.useState)(() => {
852
+ if (typeof window === "undefined") return defaultTheme;
853
+ try {
854
+ const stored = localStorage.getItem(storageKey);
855
+ if (stored === "light" || stored === "dark" || stored === "system") {
856
+ return stored;
857
+ }
858
+ } catch {
859
+ }
860
+ return defaultTheme;
861
+ });
862
+ const [resolvedTheme, setResolvedTheme] = (0, import_react15.useState)("light");
863
+ (0, import_react15.useEffect)(() => {
864
+ const root = document.documentElement;
865
+ const getSystemTheme = () => {
866
+ return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
867
+ };
868
+ const active = theme === "system" && enableSystem ? getSystemTheme() : theme === "dark" ? "dark" : "light";
869
+ setResolvedTheme(active);
870
+ root.setAttribute(attribute, active);
871
+ if (theme === "system" && enableSystem) {
872
+ const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
873
+ const listener = (e) => {
874
+ const nextTheme = e.matches ? "dark" : "light";
875
+ setResolvedTheme(nextTheme);
876
+ root.setAttribute(attribute, nextTheme);
877
+ };
878
+ mediaQuery.addEventListener("change", listener);
879
+ return () => mediaQuery.removeEventListener("change", listener);
880
+ }
881
+ }, [theme, attribute, enableSystem]);
882
+ const setTheme = (newTheme) => {
883
+ try {
884
+ localStorage.setItem(storageKey, newTheme);
885
+ } catch {
886
+ }
887
+ setThemeState(newTheme);
888
+ };
889
+ const toggleTheme = () => {
890
+ setTheme(resolvedTheme === "light" ? "dark" : "light");
891
+ };
892
+ const value = (0, import_react15.useMemo)(
893
+ () => ({
894
+ theme,
895
+ resolvedTheme,
896
+ setTheme,
897
+ toggleTheme
898
+ }),
899
+ [theme, resolvedTheme]
900
+ );
901
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ThemeContext.Provider, { value, children });
902
+ }
903
+ function useTheme() {
904
+ const context = (0, import_react15.useContext)(ThemeContext);
905
+ if (!context) {
906
+ throw new Error("useTheme must be used within an Atelier UI ThemeProvider");
907
+ }
908
+ return context;
909
+ }