@akira-io/ui 1.3.1 → 2.1.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.
Files changed (78) hide show
  1. package/README.md +2 -2
  2. package/dist/blocks.d.ts +100 -10
  3. package/dist/blocks.js +547 -270
  4. package/dist/blocks.js.map +1 -1
  5. package/dist/{chunk-3Z2VGVPI.js → chunk-53V4J7MC.js} +17 -7
  6. package/dist/chunk-53V4J7MC.js.map +1 -0
  7. package/dist/chunk-BH3B26DK.js +394 -0
  8. package/dist/chunk-BH3B26DK.js.map +1 -0
  9. package/dist/chunk-BP2YDMMI.js +29 -0
  10. package/dist/chunk-BP2YDMMI.js.map +1 -0
  11. package/dist/chunk-BR3JI3KN.js +458 -0
  12. package/dist/chunk-BR3JI3KN.js.map +1 -0
  13. package/dist/{chunk-YBXRJSR3.js → chunk-CAUTXZ4U.js} +15 -7
  14. package/dist/chunk-CAUTXZ4U.js.map +1 -0
  15. package/dist/{chunk-I6VVCFZ2.js → chunk-DPLCEU34.js} +342 -238
  16. package/dist/chunk-DPLCEU34.js.map +1 -0
  17. package/dist/chunk-IQMRJXEO.js +5 -4
  18. package/dist/chunk-IQMRJXEO.js.map +1 -1
  19. package/dist/chunk-L2H5GIF7.js +5 -4
  20. package/dist/chunk-L2H5GIF7.js.map +1 -1
  21. package/dist/{chunk-2V6HUWST.js → chunk-NKPFIA32.js} +19 -6
  22. package/dist/chunk-NKPFIA32.js.map +1 -0
  23. package/dist/{chunk-QNF4LJVT.js → chunk-OS7YY5R4.js} +8 -6
  24. package/dist/chunk-OS7YY5R4.js.map +1 -0
  25. package/dist/{chunk-IDNOI4OK.js → chunk-PCYYU332.js} +15 -8
  26. package/dist/chunk-PCYYU332.js.map +1 -0
  27. package/dist/{chunk-KHOA4TEI.js → chunk-PPWJK5T3.js} +60 -25
  28. package/dist/chunk-PPWJK5T3.js.map +1 -0
  29. package/dist/{chunk-N2KIFFI7.js → chunk-QZRSQVCN.js} +30 -34
  30. package/dist/chunk-QZRSQVCN.js.map +1 -0
  31. package/dist/{chunk-SZUXATOF.js → chunk-XLAOE5MV.js} +170 -76
  32. package/dist/chunk-XLAOE5MV.js.map +1 -0
  33. package/dist/{chunk-B3L6PRLX.js → chunk-ZQXZ4UGE.js} +208 -100
  34. package/dist/chunk-ZQXZ4UGE.js.map +1 -0
  35. package/dist/code.d.ts +2 -2
  36. package/dist/code.js +96 -52
  37. package/dist/code.js.map +1 -1
  38. package/dist/{context-OwSoVEri.d.ts → context-2wTOwxCk.d.ts} +13 -5
  39. package/dist/editor.d.ts +1 -1
  40. package/dist/editor.js +135 -52
  41. package/dist/editor.js.map +1 -1
  42. package/dist/{field-DWm5NXeV.d.ts → field-C1TdmC2t.d.ts} +1 -1
  43. package/dist/index.d.ts +15 -12
  44. package/dist/index.js +1105 -633
  45. package/dist/index.js.map +1 -1
  46. package/dist/inertia.d.ts +11 -3
  47. package/dist/inertia.js +66 -12
  48. package/dist/inertia.js.map +1 -1
  49. package/dist/{input-Dxnsxi-f.d.ts → input-B4uEClxB.d.ts} +1 -1
  50. package/dist/{json-viewer-BARA2RCW.d.ts → json-viewer-Bssv9mTD.d.ts} +1 -1
  51. package/dist/locales/fr.d.ts +44 -0
  52. package/dist/locales/fr.js +248 -0
  53. package/dist/locales/fr.js.map +1 -0
  54. package/dist/locales/pt.d.ts +10 -9
  55. package/dist/locales/pt.js +40 -3
  56. package/dist/locales/pt.js.map +1 -1
  57. package/dist/shells.d.ts +46 -5
  58. package/dist/shells.js +211 -71
  59. package/dist/shells.js.map +1 -1
  60. package/dist/{sidebar-Bp6Q46j-.d.ts → sidebar-BLL2tgTt.d.ts} +2 -2
  61. package/dist/types-1LUmNJf_.d.ts +41 -0
  62. package/dist/{types-cmBL8zOc.d.ts → types-CMZRvMV5.d.ts} +1 -1
  63. package/dist/{types-B-eGPoFD.d.ts → types-CfAUvz--.d.ts} +1 -1
  64. package/package.json +8 -2
  65. package/theme.css +11 -0
  66. package/dist/chunk-2V6HUWST.js.map +0 -1
  67. package/dist/chunk-3Z2VGVPI.js.map +0 -1
  68. package/dist/chunk-B3L6PRLX.js.map +0 -1
  69. package/dist/chunk-I6VVCFZ2.js.map +0 -1
  70. package/dist/chunk-IDNOI4OK.js.map +0 -1
  71. package/dist/chunk-KHOA4TEI.js.map +0 -1
  72. package/dist/chunk-N2KIFFI7.js.map +0 -1
  73. package/dist/chunk-NGMG2UWX.js +0 -172
  74. package/dist/chunk-NGMG2UWX.js.map +0 -1
  75. package/dist/chunk-QNF4LJVT.js.map +0 -1
  76. package/dist/chunk-SZUXATOF.js.map +0 -1
  77. package/dist/chunk-YBXRJSR3.js.map +0 -1
  78. package/dist/types-u1qfmJQi.d.ts +0 -28
@@ -1,7 +1,11 @@
1
- import { cn, fieldSurface, fieldFocus } from './chunk-KHOA4TEI.js';
2
- import { jsx } from 'react/jsx-runtime';
3
- import * as SeparatorPrimitive from '@radix-ui/react-separator';
1
+ import {
2
+ cn,
3
+ fieldFocus,
4
+ fieldSurface
5
+ } from "./chunk-PPWJK5T3.js";
4
6
 
7
+ // src/components/ui/input.tsx
8
+ import { jsx } from "react/jsx-runtime";
5
9
  function Input({
6
10
  className,
7
11
  type,
@@ -21,6 +25,10 @@ function Input({
21
25
  }
22
26
  );
23
27
  }
28
+
29
+ // src/components/ui/separator.tsx
30
+ import * as SeparatorPrimitive from "@radix-ui/react-separator";
31
+ import { jsx as jsx2 } from "react/jsx-runtime";
24
32
  function Separator({
25
33
  className,
26
34
  orientation = "horizontal",
@@ -28,7 +36,7 @@ function Separator({
28
36
  slotName = "separator-root",
29
37
  ...props
30
38
  }) {
31
- return /* @__PURE__ */ jsx(
39
+ return /* @__PURE__ */ jsx2(
32
40
  SeparatorPrimitive.Root,
33
41
  {
34
42
  decorative,
@@ -43,6 +51,8 @@ function Separator({
43
51
  );
44
52
  }
45
53
 
46
- export { Input, Separator };
47
- //# sourceMappingURL=chunk-3Z2VGVPI.js.map
48
- //# sourceMappingURL=chunk-3Z2VGVPI.js.map
54
+ export {
55
+ Input,
56
+ Separator
57
+ };
58
+ //# sourceMappingURL=chunk-53V4J7MC.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/ui/input.tsx","../src/components/ui/separator.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { fieldFocus, fieldSurface } from '@/lib/language';\nimport { cn } from '@/lib/utils';\nimport type { SlotNameProps } from '@/types';\n\nfunction Input({\n className,\n type,\n slotName = 'input',\n ...props\n}: React.ComponentProps<'input'> & SlotNameProps) {\n return (\n <input\n type={type}\n className={cn(\n `h-11 min-w-0 px-4 font-medium flex w-full transition-all placeholder:text-muted-foreground focus:bg-muted disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 ${fieldSurface} ${fieldFocus}`,\n className,\n )}\n {...props}\n data-slot={slotName}\n />\n );\n}\n\nexport { Input };\n","import * as SeparatorPrimitive from '@radix-ui/react-separator';\nimport * as React from 'react';\n\nimport { cn } from '@/lib/utils';\nimport type { SlotNameProps } from '@/types';\n\nfunction Separator({\n className,\n orientation = 'horizontal',\n decorative = true,\n slotName = 'separator-root',\n ...props\n}: React.ComponentProps<typeof SeparatorPrimitive.Root> & SlotNameProps) {\n return (\n <SeparatorPrimitive.Root\n decorative={decorative}\n orientation={orientation}\n className={cn(\n 'shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px',\n className,\n )}\n {...props}\n data-slot={slotName}\n />\n );\n}\n\nexport { Separator };\n"],"mappings":";;;;;;;AAaQ;AAPR,SAAS,MAAM;AAAA,EACX;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,GAAG;AACP,GAAkD;AAC9C,SACI;AAAA,IAAC;AAAA;AAAA,MACG;AAAA,MACA,WAAW;AAAA,QACP,+NAA+N,YAAY,IAAI,UAAU;AAAA,QACzP;AAAA,MACJ;AAAA,MACC,GAAG;AAAA,MACJ,aAAW;AAAA;AAAA,EACf;AAER;;;ACvBA,YAAY,wBAAwB;AAc5B,gBAAAA,YAAA;AARR,SAAS,UAAU;AAAA,EACf;AAAA,EACA,cAAc;AAAA,EACd,aAAa;AAAA,EACb,WAAW;AAAA,EACX,GAAG;AACP,GAAyE;AACrE,SACI,gBAAAA;AAAA,IAAoB;AAAA,IAAnB;AAAA,MACG;AAAA,MACA;AAAA,MACA,WAAW;AAAA,QACP;AAAA,QACA;AAAA,MACJ;AAAA,MACC,GAAG;AAAA,MACJ,aAAW;AAAA;AAAA,EACf;AAER;","names":["jsx"]}
@@ -0,0 +1,394 @@
1
+ import {
2
+ useUiLabels
3
+ } from "./chunk-OS7YY5R4.js";
4
+ import {
5
+ Label
6
+ } from "./chunk-BP2YDMMI.js";
7
+ import {
8
+ Input
9
+ } from "./chunk-53V4J7MC.js";
10
+ import {
11
+ Button,
12
+ cn,
13
+ elevatedSurface,
14
+ focusRing
15
+ } from "./chunk-PPWJK5T3.js";
16
+
17
+ // src/components/ui/alert.tsx
18
+ import { cva } from "class-variance-authority";
19
+ import { jsx } from "react/jsx-runtime";
20
+ var alertVariants = cva(
21
+ `${elevatedSurface} relative w-full px-5 py-4 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current`,
22
+ {
23
+ variants: {
24
+ variant: {
25
+ default: "bg-card text-card-foreground",
26
+ destructive: "border-destructive/30 bg-destructive/10 text-destructive [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/80",
27
+ warning: "ring-warning/20 bg-warning/10 text-warning *:data-[slot=alert-description]:text-warning/80",
28
+ info: "ring-info/20 bg-info/10 text-info *:data-[slot=alert-description]:text-info/80"
29
+ }
30
+ },
31
+ defaultVariants: {
32
+ variant: "default"
33
+ }
34
+ }
35
+ );
36
+ var alertDefaultLabels = {
37
+ warningLabel: "Warning",
38
+ infoLabel: "Information"
39
+ };
40
+ var SEVERITY_LABELS = {
41
+ warning: "warningLabel",
42
+ info: "infoLabel"
43
+ };
44
+ function Alert({
45
+ className,
46
+ variant,
47
+ labels,
48
+ slotName = "alert",
49
+ ...props
50
+ }) {
51
+ const resolved = useUiLabels("alert", alertDefaultLabels, labels);
52
+ const severity = variant ? SEVERITY_LABELS[variant] : void 0;
53
+ return /* @__PURE__ */ jsx(
54
+ "div",
55
+ {
56
+ role: "alert",
57
+ "aria-label": severity ? resolved[severity] : void 0,
58
+ className: cn(alertVariants({ variant }), className),
59
+ ...props,
60
+ "data-slot": slotName
61
+ }
62
+ );
63
+ }
64
+ function AlertTitle({
65
+ className,
66
+ slotName = "alert-title",
67
+ ...props
68
+ }) {
69
+ return /* @__PURE__ */ jsx(
70
+ "div",
71
+ {
72
+ className: cn(
73
+ "min-h-4 font-medium tracking-tight col-start-2 line-clamp-1",
74
+ className
75
+ ),
76
+ ...props,
77
+ "data-slot": slotName
78
+ }
79
+ );
80
+ }
81
+ function AlertDescription({
82
+ className,
83
+ slotName = "alert-description",
84
+ ...props
85
+ }) {
86
+ return /* @__PURE__ */ jsx(
87
+ "div",
88
+ {
89
+ className: cn(
90
+ "gap-1 text-sm [&_p]:leading-relaxed col-start-2 grid justify-items-start text-muted-foreground",
91
+ className
92
+ ),
93
+ ...props,
94
+ "data-slot": slotName
95
+ }
96
+ );
97
+ }
98
+
99
+ // src/components/ui/checkbox.tsx
100
+ import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
101
+ import { CheckIcon } from "lucide-react";
102
+ import { jsx as jsx2 } from "react/jsx-runtime";
103
+ function Checkbox({
104
+ className,
105
+ slotName = "checkbox",
106
+ ...props
107
+ }) {
108
+ return /* @__PURE__ */ jsx2(
109
+ CheckboxPrimitive.Root,
110
+ {
111
+ className: cn(
112
+ `peer size-5 shadow-xs shrink-0 rounded-md border border-border transition-all disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground ${focusRing}`,
113
+ className
114
+ ),
115
+ ...props,
116
+ "data-slot": slotName,
117
+ children: /* @__PURE__ */ jsx2(
118
+ CheckboxPrimitive.Indicator,
119
+ {
120
+ "data-slot": "checkbox-indicator",
121
+ className: "flex items-center justify-center text-current transition-none",
122
+ children: /* @__PURE__ */ jsx2(CheckIcon, { className: "size-3.5" })
123
+ }
124
+ )
125
+ }
126
+ );
127
+ }
128
+
129
+ // src/components/ui/field-context.ts
130
+ import * as React from "react";
131
+ var FieldContext = React.createContext(null);
132
+ function useOptionalField() {
133
+ return React.useContext(FieldContext);
134
+ }
135
+ function useField() {
136
+ const field = useOptionalField();
137
+ if (!field) {
138
+ throw new Error("Field parts must be rendered inside a Field.");
139
+ }
140
+ return field;
141
+ }
142
+
143
+ // src/components/ui/field-error.tsx
144
+ import { jsx as jsx3 } from "react/jsx-runtime";
145
+ function FieldError({
146
+ message,
147
+ className,
148
+ slotName = "field-error",
149
+ ...props
150
+ }) {
151
+ const field = useOptionalField();
152
+ if (!message) {
153
+ return null;
154
+ }
155
+ return /* @__PURE__ */ jsx3(
156
+ "p",
157
+ {
158
+ id: field?.errorId,
159
+ className: cn(
160
+ "ml-1 text-xs font-medium text-destructive group-data-[orientation=horizontal]/field:col-span-2 group-data-[orientation=horizontal]/field:row-start-3",
161
+ className
162
+ ),
163
+ ...props,
164
+ "data-slot": slotName,
165
+ children: message
166
+ }
167
+ );
168
+ }
169
+
170
+ // src/components/ui/field.tsx
171
+ import { Slot } from "@radix-ui/react-slot";
172
+ import * as React2 from "react";
173
+ import { Fragment, jsx as jsx4, jsxs } from "react/jsx-runtime";
174
+ function Field({
175
+ className,
176
+ children,
177
+ id,
178
+ orientation = "vertical",
179
+ error,
180
+ invalid,
181
+ required = false,
182
+ slotName = "field",
183
+ ...props
184
+ }) {
185
+ const generatedId = React2.useId();
186
+ const fieldId = id ?? generatedId;
187
+ const [hasDescription, setHasDescription] = React2.useState(false);
188
+ const isInvalid = invalid ?? Boolean(error);
189
+ const field = React2.useMemo(
190
+ () => ({
191
+ controlId: fieldId,
192
+ descriptionId: `${fieldId}-description`,
193
+ errorId: `${fieldId}-error`,
194
+ orientation,
195
+ invalid: isInvalid,
196
+ required,
197
+ hasDescription,
198
+ setHasDescription
199
+ }),
200
+ [fieldId, orientation, isInvalid, required, hasDescription]
201
+ );
202
+ return /* @__PURE__ */ jsx4(FieldContext.Provider, { value: field, children: /* @__PURE__ */ jsxs(
203
+ "div",
204
+ {
205
+ "data-orientation": orientation,
206
+ "data-invalid": isInvalid ? "true" : void 0,
207
+ className: cn(
208
+ "group/field",
209
+ orientation === "horizontal" ? "gap-x-4 gap-y-1 grid grid-cols-[1fr_auto] items-center" : "gap-2 flex flex-col",
210
+ className
211
+ ),
212
+ ...props,
213
+ "data-slot": slotName,
214
+ children: [
215
+ children,
216
+ /* @__PURE__ */ jsx4(FieldError, { message: error })
217
+ ]
218
+ }
219
+ ) });
220
+ }
221
+ function FieldGroup({
222
+ className,
223
+ slotName = "field-group",
224
+ ...props
225
+ }) {
226
+ return /* @__PURE__ */ jsx4(
227
+ "div",
228
+ {
229
+ className: cn("gap-6 flex w-full flex-col", className),
230
+ ...props,
231
+ "data-slot": slotName
232
+ }
233
+ );
234
+ }
235
+ function FieldLabel({
236
+ className,
237
+ children,
238
+ requiredLabel = "Required",
239
+ slotName = "field-label",
240
+ ...props
241
+ }) {
242
+ const { controlId, invalid, required } = useField();
243
+ return /* @__PURE__ */ jsxs(
244
+ Label,
245
+ {
246
+ htmlFor: controlId,
247
+ className: cn(
248
+ "gap-1 flex items-center group-data-[orientation=horizontal]/field:col-start-1 group-data-[orientation=horizontal]/field:row-start-1",
249
+ invalid && "text-destructive",
250
+ className
251
+ ),
252
+ ...props,
253
+ slotName,
254
+ children: [
255
+ children,
256
+ required ? /* @__PURE__ */ jsxs(Fragment, { children: [
257
+ /* @__PURE__ */ jsx4(
258
+ "span",
259
+ {
260
+ "data-slot": "field-required",
261
+ "aria-hidden": "true",
262
+ className: "text-destructive",
263
+ children: "*"
264
+ }
265
+ ),
266
+ /* @__PURE__ */ jsx4("span", { className: "sr-only", children: requiredLabel })
267
+ ] }) : null
268
+ ]
269
+ }
270
+ );
271
+ }
272
+ function FieldDescription({
273
+ className,
274
+ slotName = "field-description",
275
+ ...props
276
+ }) {
277
+ const { descriptionId, setHasDescription } = useField();
278
+ React2.useEffect(() => {
279
+ setHasDescription(true);
280
+ return () => setHasDescription(false);
281
+ }, [setHasDescription]);
282
+ return /* @__PURE__ */ jsx4(
283
+ "p",
284
+ {
285
+ id: descriptionId,
286
+ className: cn(
287
+ "ml-1 text-xs font-medium text-muted-foreground group-data-[orientation=horizontal]/field:col-start-1 group-data-[orientation=horizontal]/field:row-start-2",
288
+ className
289
+ ),
290
+ ...props,
291
+ "data-slot": slotName
292
+ }
293
+ );
294
+ }
295
+ function FieldControl({
296
+ className,
297
+ ...props
298
+ }) {
299
+ const {
300
+ controlId,
301
+ descriptionId,
302
+ errorId,
303
+ invalid,
304
+ required,
305
+ hasDescription
306
+ } = useField();
307
+ const requiredProps = required ? { required: true } : {};
308
+ const describedBy = [
309
+ hasDescription ? descriptionId : null,
310
+ invalid ? errorId : null
311
+ ].filter(Boolean).join(" ");
312
+ return /* @__PURE__ */ jsx4(
313
+ Slot,
314
+ {
315
+ "data-field-control": "true",
316
+ id: controlId,
317
+ "aria-describedby": describedBy || void 0,
318
+ "aria-invalid": invalid ? true : void 0,
319
+ ...requiredProps,
320
+ className: cn(
321
+ "group-data-[orientation=horizontal]/field:col-start-2 group-data-[orientation=horizontal]/field:row-span-2 group-data-[orientation=horizontal]/field:row-start-1 group-data-[orientation=horizontal]/field:justify-self-end",
322
+ className
323
+ ),
324
+ ...props
325
+ }
326
+ );
327
+ }
328
+
329
+ // src/components/ui/password-input.tsx
330
+ import { Eye, EyeOff } from "lucide-react";
331
+ import * as React3 from "react";
332
+ import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
333
+ var passwordInputDefaultLabels = {
334
+ showLabel: "Show password",
335
+ hideLabel: "Hide password"
336
+ };
337
+ function PasswordInput({
338
+ className,
339
+ revealable = true,
340
+ showLabel,
341
+ hideLabel,
342
+ slotName = "password-input",
343
+ ...props
344
+ }) {
345
+ const labels = useUiLabels("passwordInput", passwordInputDefaultLabels, {
346
+ showLabel,
347
+ hideLabel
348
+ });
349
+ const [visible, setVisible] = React3.useState(false);
350
+ return /* @__PURE__ */ jsxs2("div", { className: "relative w-full", "data-slot": slotName, children: [
351
+ /* @__PURE__ */ jsx5(
352
+ Input,
353
+ {
354
+ type: visible ? "text" : "password",
355
+ className: cn(revealable && "pr-12", className),
356
+ ...props
357
+ }
358
+ ),
359
+ revealable ? /* @__PURE__ */ jsx5(
360
+ Button,
361
+ {
362
+ type: "button",
363
+ variant: "ghost",
364
+ size: "icon-sm",
365
+ slotName: "password-input-toggle",
366
+ "aria-label": visible ? labels.hideLabel : labels.showLabel,
367
+ "aria-pressed": visible,
368
+ disabled: props.disabled,
369
+ onMouseDown: (event) => event.preventDefault(),
370
+ onClick: () => setVisible((current) => !current),
371
+ className: "right-1 absolute top-1/2 -translate-y-1/2",
372
+ children: visible ? /* @__PURE__ */ jsx5(EyeOff, { "aria-hidden": "true" }) : /* @__PURE__ */ jsx5(Eye, { "aria-hidden": "true" })
373
+ }
374
+ ) : null
375
+ ] });
376
+ }
377
+
378
+ export {
379
+ alertDefaultLabels,
380
+ Alert,
381
+ AlertTitle,
382
+ AlertDescription,
383
+ Checkbox,
384
+ useField,
385
+ FieldError,
386
+ Field,
387
+ FieldGroup,
388
+ FieldLabel,
389
+ FieldDescription,
390
+ FieldControl,
391
+ passwordInputDefaultLabels,
392
+ PasswordInput
393
+ };
394
+ //# sourceMappingURL=chunk-BH3B26DK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/ui/alert.tsx","../src/components/ui/checkbox.tsx","../src/components/ui/field-context.ts","../src/components/ui/field-error.tsx","../src/components/ui/field.tsx","../src/components/ui/password-input.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport * as React from 'react';\n\nimport { elevatedSurface } from '@/lib/language';\nimport { cn } from '@/lib/utils';\nimport { useUiLabels } from '@/locales/context';\nimport type { SlotNameProps } from '@/types';\n\nconst alertVariants = cva(\n `${elevatedSurface} relative w-full px-5 py-4 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current`,\n {\n variants: {\n variant: {\n default: 'bg-card text-card-foreground',\n destructive:\n 'border-destructive/30 bg-destructive/10 text-destructive [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/80',\n warning:\n 'ring-warning/20 bg-warning/10 text-warning *:data-[slot=alert-description]:text-warning/80',\n info: 'ring-info/20 bg-info/10 text-info *:data-[slot=alert-description]:text-info/80',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n },\n);\n\nexport interface AlertLabels {\n warningLabel: string;\n infoLabel: string;\n}\n\nexport const alertDefaultLabels: AlertLabels = {\n warningLabel: 'Warning',\n infoLabel: 'Information',\n};\n\ntype AlertVariant = VariantProps<typeof alertVariants>['variant'];\n\nconst SEVERITY_LABELS: Partial<\n Record<NonNullable<AlertVariant>, keyof AlertLabels>\n> = {\n warning: 'warningLabel',\n info: 'infoLabel',\n};\n\nfunction Alert({\n className,\n variant,\n labels,\n slotName = 'alert',\n ...props\n}: React.ComponentProps<'div'> &\n VariantProps<typeof alertVariants> &\n SlotNameProps & { labels?: Partial<AlertLabels> }) {\n const resolved = useUiLabels('alert', alertDefaultLabels, labels);\n const severity = variant ? SEVERITY_LABELS[variant] : undefined;\n\n return (\n <div\n role=\"alert\"\n aria-label={severity ? resolved[severity] : undefined}\n className={cn(alertVariants({ variant }), className)}\n {...props}\n data-slot={slotName}\n />\n );\n}\n\nfunction AlertTitle({\n className,\n slotName = 'alert-title',\n ...props\n}: React.ComponentProps<'div'> & SlotNameProps) {\n return (\n <div\n className={cn(\n 'min-h-4 font-medium tracking-tight col-start-2 line-clamp-1',\n className,\n )}\n {...props}\n data-slot={slotName}\n />\n );\n}\n\nfunction AlertDescription({\n className,\n slotName = 'alert-description',\n ...props\n}: React.ComponentProps<'div'> & SlotNameProps) {\n return (\n <div\n className={cn(\n 'gap-1 text-sm [&_p]:leading-relaxed col-start-2 grid justify-items-start text-muted-foreground',\n className,\n )}\n {...props}\n data-slot={slotName}\n />\n );\n}\n\nexport { Alert, AlertDescription, AlertTitle };\n","import * as CheckboxPrimitive from '@radix-ui/react-checkbox';\nimport { CheckIcon } from 'lucide-react';\nimport * as React from 'react';\n\nimport { focusRing } from '@/lib/language';\nimport { cn } from '@/lib/utils';\nimport type { SlotNameProps } from '@/types';\n\nfunction Checkbox({\n className,\n slotName = 'checkbox',\n ...props\n}: React.ComponentProps<typeof CheckboxPrimitive.Root> & SlotNameProps) {\n return (\n <CheckboxPrimitive.Root\n className={cn(\n `peer size-5 shadow-xs shrink-0 rounded-md border border-border transition-all disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground ${focusRing}`,\n className,\n )}\n {...props}\n data-slot={slotName}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"flex items-center justify-center text-current transition-none\"\n >\n <CheckIcon className=\"size-3.5\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n}\n\nexport { Checkbox };\n","import * as React from 'react';\n\nexport type FieldOrientation = 'vertical' | 'horizontal';\n\nexport interface FieldContextValue {\n controlId: string;\n descriptionId: string;\n errorId: string;\n orientation: FieldOrientation;\n invalid: boolean;\n required: boolean;\n hasDescription: boolean;\n setHasDescription: (present: boolean) => void;\n}\n\nexport const FieldContext = React.createContext<FieldContextValue | null>(null);\n\nexport function useOptionalField(): FieldContextValue | null {\n return React.useContext(FieldContext);\n}\n\nexport function useField(): FieldContextValue {\n const field = useOptionalField();\n\n if (!field) {\n throw new Error('Field parts must be rendered inside a Field.');\n }\n\n return field;\n}\n","import * as React from 'react';\n\nimport { useOptionalField } from '@/components/ui/field-context';\nimport { cn } from '@/lib/utils';\nimport type { SlotNameProps } from '@/types';\n\ninterface FieldErrorProps extends React.ComponentProps<'p'> {\n message?: string;\n}\n\nexport function FieldError({\n message,\n className,\n slotName = 'field-error',\n ...props\n}: FieldErrorProps & SlotNameProps) {\n const field = useOptionalField();\n\n if (!message) {\n return null;\n }\n\n return (\n <p\n id={field?.errorId}\n className={cn(\n 'ml-1 text-xs font-medium text-destructive group-data-[orientation=horizontal]/field:col-span-2 group-data-[orientation=horizontal]/field:row-start-3',\n className,\n )}\n {...props}\n data-slot={slotName}\n >\n {message}\n </p>\n );\n}\n","import { Slot } from '@radix-ui/react-slot';\nimport * as React from 'react';\n\nimport {\n FieldContext,\n useField,\n type FieldContextValue,\n type FieldOrientation,\n} from '@/components/ui/field-context';\nimport { FieldError } from '@/components/ui/field-error';\nimport { Label } from '@/components/ui/label';\nimport { cn } from '@/lib/utils';\nimport type { SlotNameProps } from '@/types';\n\nexport interface FieldLabels {\n requiredLabel: string;\n}\n\ninterface FieldProps extends React.ComponentProps<'div'> {\n orientation?: FieldOrientation;\n error?: string;\n invalid?: boolean;\n required?: boolean;\n}\n\nexport function Field({\n className,\n children,\n id,\n orientation = 'vertical',\n error,\n invalid,\n required = false,\n slotName = 'field',\n ...props\n}: FieldProps & SlotNameProps) {\n const generatedId = React.useId();\n const fieldId = id ?? generatedId;\n const [hasDescription, setHasDescription] = React.useState(false);\n const isInvalid = invalid ?? Boolean(error);\n\n const field = React.useMemo<FieldContextValue>(\n () => ({\n controlId: fieldId,\n descriptionId: `${fieldId}-description`,\n errorId: `${fieldId}-error`,\n orientation,\n invalid: isInvalid,\n required,\n hasDescription,\n setHasDescription,\n }),\n [fieldId, orientation, isInvalid, required, hasDescription],\n );\n\n return (\n <FieldContext.Provider value={field}>\n <div\n data-orientation={orientation}\n data-invalid={isInvalid ? 'true' : undefined}\n className={cn(\n 'group/field',\n orientation === 'horizontal'\n ? 'gap-x-4 gap-y-1 grid grid-cols-[1fr_auto] items-center'\n : 'gap-2 flex flex-col',\n className,\n )}\n {...props}\n data-slot={slotName}\n >\n {children}\n <FieldError message={error} />\n </div>\n </FieldContext.Provider>\n );\n}\n\nexport function FieldGroup({\n className,\n slotName = 'field-group',\n ...props\n}: React.ComponentProps<'div'> & SlotNameProps) {\n return (\n <div\n className={cn('gap-6 flex w-full flex-col', className)}\n {...props}\n data-slot={slotName}\n />\n );\n}\n\ninterface FieldLabelProps extends React.ComponentProps<typeof Label> {\n requiredLabel?: FieldLabels['requiredLabel'];\n}\n\nexport function FieldLabel({\n className,\n children,\n requiredLabel = 'Required',\n slotName = 'field-label',\n ...props\n}: FieldLabelProps & SlotNameProps) {\n const { controlId, invalid, required } = useField();\n\n return (\n <Label\n htmlFor={controlId}\n className={cn(\n 'gap-1 flex items-center group-data-[orientation=horizontal]/field:col-start-1 group-data-[orientation=horizontal]/field:row-start-1',\n invalid && 'text-destructive',\n className,\n )}\n {...props}\n slotName={slotName}\n >\n {children}\n {required ? (\n <>\n <span\n data-slot=\"field-required\"\n aria-hidden=\"true\"\n className=\"text-destructive\"\n >\n *\n </span>\n <span className=\"sr-only\">{requiredLabel}</span>\n </>\n ) : null}\n </Label>\n );\n}\n\nexport function FieldDescription({\n className,\n slotName = 'field-description',\n ...props\n}: React.ComponentProps<'p'> & SlotNameProps) {\n const { descriptionId, setHasDescription } = useField();\n\n React.useEffect(() => {\n setHasDescription(true);\n\n return () => setHasDescription(false);\n }, [setHasDescription]);\n\n return (\n <p\n id={descriptionId}\n className={cn(\n 'ml-1 text-xs font-medium text-muted-foreground group-data-[orientation=horizontal]/field:col-start-1 group-data-[orientation=horizontal]/field:row-start-2',\n className,\n )}\n {...props}\n data-slot={slotName}\n />\n );\n}\n\nexport function FieldControl({\n className,\n ...props\n}: React.ComponentProps<typeof Slot>) {\n const {\n controlId,\n descriptionId,\n errorId,\n invalid,\n required,\n hasDescription,\n } = useField();\n\n const requiredProps: React.InputHTMLAttributes<HTMLElement> = required\n ? { required: true }\n : {};\n\n const describedBy = [\n hasDescription ? descriptionId : null,\n invalid ? errorId : null,\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <Slot\n data-field-control=\"true\"\n id={controlId}\n aria-describedby={describedBy || undefined}\n aria-invalid={invalid ? true : undefined}\n {...requiredProps}\n className={cn(\n 'group-data-[orientation=horizontal]/field:col-start-2 group-data-[orientation=horizontal]/field:row-span-2 group-data-[orientation=horizontal]/field:row-start-1 group-data-[orientation=horizontal]/field:justify-self-end',\n className,\n )}\n {...props}\n />\n );\n}\n","import { Eye, EyeOff } from 'lucide-react';\nimport * as React from 'react';\n\nimport { Button } from '@/components/ui/button';\nimport { Input } from '@/components/ui/input';\nimport { cn } from '@/lib/utils';\nimport { useUiLabels } from '@/locales/context';\nimport type { SlotNameProps } from '@/types';\n\nexport interface PasswordInputLabels {\n showLabel: string;\n hideLabel: string;\n}\n\nexport const passwordInputDefaultLabels: PasswordInputLabels = {\n showLabel: 'Show password',\n hideLabel: 'Hide password',\n};\n\ninterface PasswordInputProps extends Omit<\n React.ComponentProps<typeof Input>,\n 'type'\n> {\n revealable?: boolean;\n showLabel?: PasswordInputLabels['showLabel'];\n hideLabel?: PasswordInputLabels['hideLabel'];\n}\n\nexport function PasswordInput({\n className,\n revealable = true,\n showLabel,\n hideLabel,\n slotName = 'password-input',\n ...props\n}: PasswordInputProps & SlotNameProps) {\n const labels = useUiLabels('passwordInput', passwordInputDefaultLabels, {\n showLabel,\n hideLabel,\n });\n const [visible, setVisible] = React.useState(false);\n\n return (\n <div className=\"relative w-full\" data-slot={slotName}>\n <Input\n type={visible ? 'text' : 'password'}\n className={cn(revealable && 'pr-12', className)}\n {...props}\n />\n {revealable ? (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n slotName=\"password-input-toggle\"\n aria-label={visible ? labels.hideLabel : labels.showLabel}\n aria-pressed={visible}\n disabled={props.disabled}\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => setVisible((current) => !current)}\n className=\"right-1 absolute top-1/2 -translate-y-1/2\"\n >\n {visible ? (\n <EyeOff aria-hidden=\"true\" />\n ) : (\n <Eye aria-hidden=\"true\" />\n )}\n </Button>\n ) : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,SAAS,WAA8B;AA2D/B;AAnDR,IAAM,gBAAgB;AAAA,EAClB,GAAG,eAAe;AAAA,EAClB;AAAA,IACI,UAAU;AAAA,MACN,SAAS;AAAA,QACL,SAAS;AAAA,QACT,aACI;AAAA,QACJ,SACI;AAAA,QACJ,MAAM;AAAA,MACV;AAAA,IACJ;AAAA,IACA,iBAAiB;AAAA,MACb,SAAS;AAAA,IACb;AAAA,EACJ;AACJ;AAOO,IAAM,qBAAkC;AAAA,EAC3C,cAAc;AAAA,EACd,WAAW;AACf;AAIA,IAAM,kBAEF;AAAA,EACA,SAAS;AAAA,EACT,MAAM;AACV;AAEA,SAAS,MAAM;AAAA,EACX;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,GAAG;AACP,GAEuD;AACnD,QAAM,WAAW,YAAY,SAAS,oBAAoB,MAAM;AAChE,QAAM,WAAW,UAAU,gBAAgB,OAAO,IAAI;AAEtD,SACI;AAAA,IAAC;AAAA;AAAA,MACG,MAAK;AAAA,MACL,cAAY,WAAW,SAAS,QAAQ,IAAI;AAAA,MAC5C,WAAW,GAAG,cAAc,EAAE,QAAQ,CAAC,GAAG,SAAS;AAAA,MAClD,GAAG;AAAA,MACJ,aAAW;AAAA;AAAA,EACf;AAER;AAEA,SAAS,WAAW;AAAA,EAChB;AAAA,EACA,WAAW;AAAA,EACX,GAAG;AACP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AC,UAAU,MAAM,eAAe;AAAA,QAC7C,SAAS,MAAM,WAAW,CAAC,YAAY,CAAC,OAAO;AAAA,QAC/C,WAAU;AAAA,QAET,oBACG,gBAAAA,KAAC,UAAO,eAAY,QAAO,IAE3B,gBAAAA,KAAC,OAAI,eAAY,QAAO;AAAA;AAAA,IAEhC,IACA;AAAA,KACR;AAER;","names":["jsx","jsx","React","jsx","React","jsx","jsxs"]}
@@ -0,0 +1,29 @@
1
+ import {
2
+ cn
3
+ } from "./chunk-PPWJK5T3.js";
4
+
5
+ // src/components/ui/label.tsx
6
+ import * as LabelPrimitive from "@radix-ui/react-label";
7
+ import { jsx } from "react/jsx-runtime";
8
+ function Label({
9
+ className,
10
+ slotName = "label",
11
+ ...props
12
+ }) {
13
+ return /* @__PURE__ */ jsx(
14
+ LabelPrimitive.Root,
15
+ {
16
+ className: cn(
17
+ "text-sm font-medium text-foreground select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
18
+ className
19
+ ),
20
+ ...props,
21
+ "data-slot": slotName
22
+ }
23
+ );
24
+ }
25
+
26
+ export {
27
+ Label
28
+ };
29
+ //# sourceMappingURL=chunk-BP2YDMMI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/ui/label.tsx"],"sourcesContent":["import * as LabelPrimitive from '@radix-ui/react-label';\nimport * as React from 'react';\n\nimport { cn } from '@/lib/utils';\nimport type { SlotNameProps } from '@/types';\n\nfunction Label({\n className,\n slotName = 'label',\n ...props\n}: React.ComponentProps<typeof LabelPrimitive.Root> & SlotNameProps) {\n return (\n <LabelPrimitive.Root\n className={cn(\n 'text-sm font-medium text-foreground select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50',\n className,\n )}\n {...props}\n data-slot={slotName}\n />\n );\n}\n\nexport { Label };\n"],"mappings":";;;;;AAAA,YAAY,oBAAoB;AAYxB;AANR,SAAS,MAAM;AAAA,EACX;AAAA,EACA,WAAW;AAAA,EACX,GAAG;AACP,GAAqE;AACjE,SACI;AAAA,IAAgB;AAAA,IAAf;AAAA,MACG,WAAW;AAAA,QACP;AAAA,QACA;AAAA,MACJ;AAAA,MACC,GAAG;AAAA,MACJ,aAAW;AAAA;AAAA,EACf;AAER;","names":[]}