@carbonbits/sixr 1.3.0 → 1.5.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 (62) hide show
  1. package/README.md +204 -66
  2. package/dist/button.cjs +223 -0
  3. package/dist/button.cjs.map +1 -0
  4. package/dist/button.d.cts +34 -0
  5. package/dist/button.d.ts +34 -0
  6. package/dist/button.js +4 -0
  7. package/dist/button.js.map +1 -0
  8. package/dist/chunk-HDTW4FRT.js +111 -0
  9. package/dist/chunk-HDTW4FRT.js.map +1 -0
  10. package/dist/chunk-NZHHNVXZ.js +118 -0
  11. package/dist/chunk-NZHHNVXZ.js.map +1 -0
  12. package/dist/email-input.cjs +433 -0
  13. package/dist/email-input.cjs.map +1 -0
  14. package/dist/email-input.d.cts +12 -0
  15. package/dist/email-input.d.ts +12 -0
  16. package/dist/email-input.js +416 -0
  17. package/dist/email-input.js.map +1 -0
  18. package/dist/field.cjs +206 -0
  19. package/dist/field.cjs.map +1 -0
  20. package/dist/field.d.cts +80 -0
  21. package/dist/field.d.ts +80 -0
  22. package/dist/field.js +186 -0
  23. package/dist/field.js.map +1 -0
  24. package/dist/form.cjs +283 -42
  25. package/dist/form.cjs.map +1 -1
  26. package/dist/form.d.cts +79 -10
  27. package/dist/form.d.ts +79 -10
  28. package/dist/form.js +285 -45
  29. package/dist/form.js.map +1 -1
  30. package/dist/index-CdYkd6zz.d.cts +22 -0
  31. package/dist/index-CdYkd6zz.d.ts +22 -0
  32. package/dist/index.cjs +217 -1
  33. package/dist/index.cjs.map +1 -1
  34. package/dist/index.d.cts +146 -46
  35. package/dist/index.d.ts +146 -46
  36. package/dist/index.js +2 -0
  37. package/dist/password-input.cjs +449 -0
  38. package/dist/password-input.cjs.map +1 -0
  39. package/dist/password-input.d.cts +19 -0
  40. package/dist/password-input.d.ts +19 -0
  41. package/dist/password-input.js +434 -0
  42. package/dist/password-input.js.map +1 -0
  43. package/dist/phone-input.cjs +429 -0
  44. package/dist/phone-input.cjs.map +1 -0
  45. package/dist/phone-input.d.cts +12 -0
  46. package/dist/phone-input.d.ts +12 -0
  47. package/dist/phone-input.js +412 -0
  48. package/dist/phone-input.js.map +1 -0
  49. package/dist/styles.css +1 -1
  50. package/dist/text-input.cjs +359 -147
  51. package/dist/text-input.cjs.map +1 -1
  52. package/dist/text-input.d.cts +9 -58
  53. package/dist/text-input.d.ts +9 -58
  54. package/dist/text-input.js +365 -150
  55. package/dist/text-input.js.map +1 -1
  56. package/dist/typography.cjs +120 -0
  57. package/dist/typography.cjs.map +1 -0
  58. package/dist/typography.d.cts +46 -0
  59. package/dist/typography.d.ts +46 -0
  60. package/dist/typography.js +3 -0
  61. package/dist/typography.js.map +1 -0
  62. package/package.json +69 -1
@@ -0,0 +1,429 @@
1
+ "use client";
2
+ "use strict";
3
+ "use client";
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
+
22
+ // src/components/phone-input/index.tsx
23
+ var phone_input_exports = {};
24
+ __export(phone_input_exports, {
25
+ PhoneInput: () => PhoneInput
26
+ });
27
+ module.exports = __toCommonJS(phone_input_exports);
28
+
29
+ // src/components/field/index.tsx
30
+ var import_react_label = require("@radix-ui/react-label");
31
+ var import_react_slot = require("@radix-ui/react-slot");
32
+ var import_react = require("react");
33
+ var import_react_hook_form = require("react-hook-form");
34
+ var import_jsx_runtime = require("react/jsx-runtime");
35
+ var FieldContext = (0, import_react.createContext)(null);
36
+ function useFieldContext() {
37
+ const context = (0, import_react.useContext)(FieldContext);
38
+ if (!context) {
39
+ throw new Error("Field primitives must be rendered inside FieldRoot");
40
+ }
41
+ return context;
42
+ }
43
+ function useFieldIds(id) {
44
+ const generated = (0, import_react.useId)();
45
+ const base = id ?? generated;
46
+ return {
47
+ id: base,
48
+ descriptionId: `${base}-description`,
49
+ messageId: `${base}-message`
50
+ };
51
+ }
52
+ function FieldShell({
53
+ value,
54
+ asChild = false,
55
+ children,
56
+ ...rest
57
+ }) {
58
+ const [hasDescription, setHasDescription] = (0, import_react.useState)(false);
59
+ const Component = asChild ? import_react_slot.Slot : "div";
60
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
61
+ FieldContext.Provider,
62
+ {
63
+ value: { ...value, hasDescription, setHasDescription },
64
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
65
+ Component,
66
+ {
67
+ ...rest,
68
+ "data-invalid": value.invalid ? "" : void 0,
69
+ "data-disabled": value.disabled ? "" : void 0,
70
+ children
71
+ }
72
+ )
73
+ }
74
+ );
75
+ }
76
+ function ConnectedFieldRoot({
77
+ name,
78
+ error,
79
+ required = false,
80
+ disabled = false,
81
+ id,
82
+ ...rest
83
+ }) {
84
+ const ids = useFieldIds(id);
85
+ const { field, fieldState } = (0, import_react_hook_form.useController)({ name, disabled });
86
+ const shownError = error ?? fieldState.error?.message;
87
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
88
+ FieldShell,
89
+ {
90
+ ...rest,
91
+ value: {
92
+ ...ids,
93
+ name,
94
+ error: shownError,
95
+ invalid: Boolean(shownError),
96
+ required,
97
+ disabled: Boolean(field.disabled ?? disabled),
98
+ bindings: {
99
+ name: field.name,
100
+ value: field.value ?? "",
101
+ onChange: field.onChange,
102
+ onBlur: field.onBlur,
103
+ ref: field.ref
104
+ }
105
+ }
106
+ }
107
+ );
108
+ }
109
+ function StandaloneFieldRoot({
110
+ name,
111
+ error,
112
+ required = false,
113
+ disabled = false,
114
+ id,
115
+ ...rest
116
+ }) {
117
+ const ids = useFieldIds(id);
118
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
119
+ FieldShell,
120
+ {
121
+ ...rest,
122
+ value: {
123
+ ...ids,
124
+ name,
125
+ error,
126
+ invalid: Boolean(error),
127
+ required,
128
+ disabled,
129
+ bindings: { name }
130
+ }
131
+ }
132
+ );
133
+ }
134
+ function FieldRoot(props) {
135
+ const form = (0, import_react_hook_form.useFormContext)();
136
+ return form ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ConnectedFieldRoot, { ...props }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StandaloneFieldRoot, { ...props });
137
+ }
138
+ function FieldLabel(props) {
139
+ const { id } = useFieldContext();
140
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_label.Label, { ...props, htmlFor: id });
141
+ }
142
+ function describedBy({
143
+ error,
144
+ messageId,
145
+ hasDescription,
146
+ descriptionId
147
+ }) {
148
+ if (error) {
149
+ return messageId;
150
+ }
151
+ return hasDescription ? descriptionId : void 0;
152
+ }
153
+ function FieldControl(props) {
154
+ const context = useFieldContext();
155
+ const { id, invalid, required, disabled, bindings } = context;
156
+ const controlProps = {
157
+ ...bindings,
158
+ id,
159
+ "aria-invalid": invalid || void 0,
160
+ "aria-required": required || void 0,
161
+ "aria-describedby": describedBy(context),
162
+ disabled: disabled || void 0
163
+ };
164
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_slot.Slot, { ...props, ...controlProps });
165
+ }
166
+ function FieldDescription({
167
+ asChild = false,
168
+ ...props
169
+ }) {
170
+ const { descriptionId, error, setHasDescription } = useFieldContext();
171
+ (0, import_react.useEffect)(() => {
172
+ setHasDescription(true);
173
+ return () => setHasDescription(false);
174
+ }, [setHasDescription]);
175
+ if (error) {
176
+ return null;
177
+ }
178
+ const Component = asChild ? import_react_slot.Slot : "p";
179
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { ...props, id: descriptionId });
180
+ }
181
+ function FieldMessage({
182
+ asChild = false,
183
+ children,
184
+ ...props
185
+ }) {
186
+ const { messageId, error } = useFieldContext();
187
+ const content = error ?? children;
188
+ if (!content) {
189
+ return null;
190
+ }
191
+ const Component = asChild ? import_react_slot.Slot : "p";
192
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { ...props, id: messageId, role: "alert", children: content });
193
+ }
194
+
195
+ // src/components/typography/index.tsx
196
+ var import_react_slot2 = require("@radix-ui/react-slot");
197
+ var import_jsx_runtime2 = require("react/jsx-runtime");
198
+ var DEFAULT_ELEMENT = {
199
+ display: "h1",
200
+ heading: "h2",
201
+ subheading: "h3",
202
+ body: "p",
203
+ label: "span",
204
+ hint: "p",
205
+ code: "code"
206
+ };
207
+ var DEFAULT_WEIGHT = {
208
+ display: "semibold",
209
+ heading: "semibold",
210
+ subheading: "medium",
211
+ body: "regular",
212
+ label: "semibold",
213
+ hint: "regular",
214
+ code: "regular"
215
+ };
216
+ var VARIANT_CLASSES = {
217
+ display: "text-display leading-tight tracking-tight",
218
+ heading: "text-heading leading-tight tracking-tight",
219
+ subheading: "text-subheading leading-snug",
220
+ body: "text-field leading-normal",
221
+ label: "text-label leading-normal",
222
+ hint: "text-hint leading-normal",
223
+ code: "font-code text-field leading-normal"
224
+ };
225
+ var TONE_CLASSES = {
226
+ default: "text-fg",
227
+ muted: "text-fg-muted",
228
+ subtle: "text-fg-subtle",
229
+ accent: "text-accent",
230
+ "on-accent": "text-on-accent",
231
+ success: "text-success",
232
+ warning: "text-warning",
233
+ info: "text-info",
234
+ danger: "text-danger"
235
+ };
236
+ var WEIGHT_CLASSES = {
237
+ regular: "font-normal",
238
+ medium: "font-medium",
239
+ semibold: "font-semibold",
240
+ bold: "font-bold"
241
+ };
242
+ var ALIGN_CLASSES = {
243
+ start: "text-start",
244
+ center: "text-center",
245
+ end: "text-end"
246
+ };
247
+ var ICON_CLASSES = "inline-flex shrink-0 items-center [&>svg]:h-[1em] [&>svg]:w-[1em]";
248
+ function typographyClassName({
249
+ variant,
250
+ tone,
251
+ weight,
252
+ align,
253
+ truncate,
254
+ hasIcon,
255
+ className
256
+ }) {
257
+ return [
258
+ VARIANT_CLASSES[variant],
259
+ TONE_CLASSES[tone],
260
+ WEIGHT_CLASSES[weight],
261
+ align ? ALIGN_CLASSES[align] : "",
262
+ hasIcon ? "inline-flex items-center gap-1.5" : "",
263
+ // With an icon the root is a flex container, and text-overflow only
264
+ // clips block text, so the text span carries the truncation instead.
265
+ truncate && !hasIcon ? "truncate" : "",
266
+ className ?? ""
267
+ ].filter(Boolean).join(" ");
268
+ }
269
+ function Typography({
270
+ variant = "body",
271
+ tone = "default",
272
+ weight,
273
+ align,
274
+ truncate = false,
275
+ icon,
276
+ iconPosition = "leading",
277
+ as,
278
+ asChild = false,
279
+ className,
280
+ children,
281
+ ...rest
282
+ }) {
283
+ const hasIcon = icon !== void 0 && icon !== null;
284
+ const Component = asChild ? import_react_slot2.Slot : as ?? DEFAULT_ELEMENT[variant];
285
+ const iconNode = hasIcon ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { "aria-hidden": "true", className: ICON_CLASSES, children: icon }) : null;
286
+ const content = hasIcon ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
287
+ iconPosition === "leading" ? iconNode : null,
288
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: truncate ? "min-w-0 truncate" : void 0, children }),
289
+ iconPosition === "trailing" ? iconNode : null
290
+ ] }) : children;
291
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
292
+ Component,
293
+ {
294
+ ...rest,
295
+ className: typographyClassName({
296
+ variant,
297
+ tone,
298
+ weight: weight ?? DEFAULT_WEIGHT[variant],
299
+ align,
300
+ truncate,
301
+ hasIcon,
302
+ className
303
+ }),
304
+ children: content
305
+ }
306
+ );
307
+ }
308
+
309
+ // src/components/input/index.tsx
310
+ var import_jsx_runtime3 = require("react/jsx-runtime");
311
+ var CONTROL_CLASSES = "h-10 w-full rounded-field border bg-surface px-3 font-[inherit] text-field text-fg outline-none placeholder:text-fg-subtle disabled:cursor-not-allowed disabled:opacity-45";
312
+ var VALID_CLASSES = "border-line focus:border-accent focus:ring-3 focus:ring-accent-soft";
313
+ var INVALID_CLASSES = "border-danger focus:border-danger focus:ring-3 focus:ring-danger-soft";
314
+ function InputLabel({
315
+ label,
316
+ optional,
317
+ action
318
+ }) {
319
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
320
+ Typography,
321
+ {
322
+ variant: "label",
323
+ tone: "muted",
324
+ className: "mb-1.5 flex items-center",
325
+ asChild: true,
326
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(FieldLabel, { children: [
327
+ label,
328
+ optional ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
329
+ Typography,
330
+ {
331
+ as: "span",
332
+ variant: "hint",
333
+ tone: "subtle",
334
+ weight: "semibold",
335
+ className: "ml-auto",
336
+ children: "Optional"
337
+ }
338
+ ) : null,
339
+ action ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "ml-auto", children: action }) : null
340
+ ] })
341
+ }
342
+ );
343
+ }
344
+ function InputControl({
345
+ hasTrailing,
346
+ className,
347
+ ...rest
348
+ }) {
349
+ const { invalid } = useFieldContext();
350
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(FieldControl, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
351
+ "input",
352
+ {
353
+ ...rest,
354
+ className: [
355
+ CONTROL_CLASSES,
356
+ invalid ? INVALID_CLASSES : VALID_CLASSES,
357
+ hasTrailing ? "pr-16" : "",
358
+ className ?? ""
359
+ ].filter(Boolean).join(" ")
360
+ }
361
+ ) });
362
+ }
363
+ function InputMessages({ hint }) {
364
+ const { error } = useFieldContext();
365
+ if (error) {
366
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Typography, { as: "p", variant: "hint", tone: "danger", asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(FieldMessage, { className: "mt-1.5" }) });
367
+ }
368
+ if (hint) {
369
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Typography, { as: "p", variant: "hint", tone: "subtle", asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(FieldDescription, { className: "mt-1.5", children: hint }) });
370
+ }
371
+ return null;
372
+ }
373
+ function InputField({
374
+ name,
375
+ label,
376
+ hint,
377
+ error,
378
+ optional = false,
379
+ action,
380
+ trailing,
381
+ id,
382
+ disabled,
383
+ required,
384
+ type,
385
+ ...rest
386
+ }) {
387
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
388
+ FieldRoot,
389
+ {
390
+ name,
391
+ id,
392
+ error,
393
+ disabled,
394
+ required,
395
+ className: "flex flex-col",
396
+ children: [
397
+ label ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(InputLabel, { label, optional, action }) : null,
398
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: trailing ? "relative" : void 0, children: [
399
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(InputControl, { ...rest, type, hasTrailing: Boolean(trailing) }),
400
+ trailing ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "absolute top-1/2 right-[9px] flex -translate-y-1/2 items-center font-semibold text-fg-subtle text-hint", children: trailing }) : null
401
+ ] }),
402
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(InputMessages, { hint })
403
+ ]
404
+ }
405
+ );
406
+ }
407
+
408
+ // src/components/phone-input/index.tsx
409
+ var import_jsx_runtime4 = require("react/jsx-runtime");
410
+ function PhoneInput({
411
+ autoComplete = "tel",
412
+ inputMode = "tel",
413
+ ...rest
414
+ }) {
415
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
416
+ InputField,
417
+ {
418
+ ...rest,
419
+ type: "tel",
420
+ autoComplete,
421
+ inputMode
422
+ }
423
+ );
424
+ }
425
+ // Annotate the CommonJS export names for ESM import in node:
426
+ 0 && (module.exports = {
427
+ PhoneInput
428
+ });
429
+ //# sourceMappingURL=phone-input.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/phone-input/index.tsx","../src/components/field/index.tsx","../src/components/typography/index.tsx","../src/components/input/index.tsx"],"sourcesContent":["\"use client\";\n\nimport { InputField, type InputFieldProps } from \"@/components/input\";\n\n/**\n * A phone number. Fixes `type=\"tel\"` and the numeric keypad. Validate it with\n * `phoneSchema` from `@carbonbits/sixr/validation` in the enclosing `Form`'s\n * schema.\n */\nexport type PhoneInputProps = InputFieldProps;\n\nexport function PhoneInput({\n autoComplete = \"tel\",\n inputMode = \"tel\",\n ...rest\n}: PhoneInputProps) {\n return (\n <InputField\n {...rest}\n type=\"tel\"\n autoComplete={autoComplete}\n inputMode={inputMode}\n />\n );\n}\n","\"use client\";\n\nimport { Label } from \"@radix-ui/react-label\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport {\n type ComponentPropsWithoutRef,\n createContext,\n type ReactNode,\n useContext,\n useEffect,\n useId,\n useState,\n} from \"react\";\nimport {\n type FieldValues,\n type UseFormReturn,\n useController,\n useFormContext,\n} from \"react-hook-form\";\n\n/**\n * The structure behind every form field, with no styling of its own: an id\n * shared by label and control, the error and description ids the control is\n * described by, the field's validity, and — inside a `Form` — the\n * react-hook-form bindings (`value`, `onChange`, `onBlur`, `ref`) that keep\n * the control registered.\n *\n * Styled components compose these primitives with their own classes\n * (`TextInput` and friends do), and a screen that needs a control the\n * library does not ship — a select, a code entry, a toggle — composes them\n * the same way. Everything here is a plain element or a Radix `Slot`, so the\n * styling decisions stay with whoever renders the field.\n *\n * Outside a `Form` the primitives still wire label, control and messages\n * together; the control just isn't registered anywhere and the error comes\n * from the `error` prop alone.\n */\n\nexport type FieldBindings = {\n name: string;\n value?: unknown;\n onChange?: (event: unknown) => void;\n onBlur?: () => void;\n ref?: (instance: HTMLElement | null) => void;\n};\n\nexport type FieldContextValue = {\n id: string;\n name: string;\n descriptionId: string;\n messageId: string;\n error: string | undefined;\n invalid: boolean;\n required: boolean;\n disabled: boolean;\n hasDescription: boolean;\n setHasDescription: (present: boolean) => void;\n bindings: FieldBindings;\n};\n\nconst FieldContext = createContext<FieldContextValue | null>(null);\n\n// biome-ignore lint/style/useComponentExportOnlyModules: the hook is the primitives' public API for custom compositions and belongs on the same subpath.\nexport function useFieldContext(): FieldContextValue {\n const context = useContext(FieldContext);\n\n if (!context) {\n throw new Error(\"Field primitives must be rendered inside FieldRoot\");\n }\n\n return context;\n}\n\nexport type FieldRootProps = ComponentPropsWithoutRef<\"div\"> & {\n /** The form field this wires up — the key in the `Form`'s values. */\n name: string;\n /** A caller-supplied error. Outranks whatever the form's schema reports. */\n error?: string;\n required?: boolean;\n disabled?: boolean;\n /** Render the child element as the root instead of a `div`. */\n asChild?: boolean;\n children: ReactNode;\n};\n\ntype FieldShellProps = Omit<\n FieldRootProps,\n \"name\" | \"error\" | \"required\" | \"disabled\"\n> & {\n value: Omit<FieldContextValue, \"hasDescription\" | \"setHasDescription\">;\n};\n\nfunction useFieldIds(id: string | undefined) {\n const generated = useId();\n const base = id ?? generated;\n\n return {\n id: base,\n descriptionId: `${base}-description`,\n messageId: `${base}-message`,\n };\n}\n\nfunction FieldShell({\n value,\n asChild = false,\n children,\n ...rest\n}: FieldShellProps) {\n const [hasDescription, setHasDescription] = useState(false);\n const Component = asChild ? Slot : \"div\";\n\n return (\n <FieldContext.Provider\n value={{ ...value, hasDescription, setHasDescription }}\n >\n <Component\n {...rest}\n data-invalid={value.invalid ? \"\" : undefined}\n data-disabled={value.disabled ? \"\" : undefined}\n >\n {children}\n </Component>\n </FieldContext.Provider>\n );\n}\n\nfunction ConnectedFieldRoot({\n name,\n error,\n required = false,\n disabled = false,\n id,\n ...rest\n}: FieldRootProps) {\n const ids = useFieldIds(id);\n const { field, fieldState } = useController({ name, disabled });\n const shownError = error ?? fieldState.error?.message;\n\n return (\n <FieldShell\n {...rest}\n value={{\n ...ids,\n name,\n error: shownError,\n invalid: Boolean(shownError),\n required,\n disabled: Boolean(field.disabled ?? disabled),\n bindings: {\n name: field.name,\n value: field.value ?? \"\",\n onChange: field.onChange,\n onBlur: field.onBlur,\n ref: field.ref,\n },\n }}\n />\n );\n}\n\nfunction StandaloneFieldRoot({\n name,\n error,\n required = false,\n disabled = false,\n id,\n ...rest\n}: FieldRootProps) {\n const ids = useFieldIds(id);\n\n return (\n <FieldShell\n {...rest}\n value={{\n ...ids,\n name,\n error,\n invalid: Boolean(error),\n required,\n disabled,\n bindings: { name },\n }}\n />\n );\n}\n\nexport function FieldRoot(props: FieldRootProps) {\n const form = useFormContext() as UseFormReturn<FieldValues> | null;\n\n return form ? (\n <ConnectedFieldRoot {...props} />\n ) : (\n <StandaloneFieldRoot {...props} />\n );\n}\n\nexport type FieldLabelProps = ComponentPropsWithoutRef<typeof Label>;\n\nexport function FieldLabel(props: FieldLabelProps) {\n const { id } = useFieldContext();\n\n return <Label {...props} htmlFor={id} />;\n}\n\nexport type FieldControlProps = ComponentPropsWithoutRef<typeof Slot>;\n\nfunction describedBy({\n error,\n messageId,\n hasDescription,\n descriptionId,\n}: Pick<\n FieldContextValue,\n \"error\" | \"messageId\" | \"hasDescription\" | \"descriptionId\"\n>): string | undefined {\n if (error) {\n return messageId;\n }\n\n return hasDescription ? descriptionId : undefined;\n}\n\n/**\n * Wires the field's id, name, validity and bindings onto whatever element it\n * wraps — an `<input>`, a `<select>`, a `<textarea>`, a custom control.\n * Handlers on the child still run; the bindings run after them.\n */\nexport function FieldControl(props: FieldControlProps) {\n const context = useFieldContext();\n const { id, invalid, required, disabled, bindings } = context;\n\n // `disabled` is not on Slot's HTMLAttributes type, but it is what the\n // wrapped control needs, so the bindings are spread untyped on purpose.\n const controlProps: Record<string, unknown> = {\n ...bindings,\n id,\n \"aria-invalid\": invalid || undefined,\n \"aria-required\": required || undefined,\n \"aria-describedby\": describedBy(context),\n disabled: disabled || undefined,\n };\n\n return <Slot {...props} {...controlProps} />;\n}\n\nexport type FieldDescriptionProps = ComponentPropsWithoutRef<\"p\"> & {\n asChild?: boolean;\n};\n\n/** Guidance under the control. Hidden while the field has an error. */\nexport function FieldDescription({\n asChild = false,\n ...props\n}: FieldDescriptionProps) {\n const { descriptionId, error, setHasDescription } = useFieldContext();\n\n useEffect(() => {\n setHasDescription(true);\n\n return () => setHasDescription(false);\n }, [setHasDescription]);\n\n if (error) {\n return null;\n }\n\n const Component = asChild ? Slot : \"p\";\n\n return <Component {...props} id={descriptionId} />;\n}\n\nexport type FieldMessageProps = ComponentPropsWithoutRef<\"p\"> & {\n asChild?: boolean;\n};\n\n/**\n * The field's error, announced as an alert. Renders the error the field\n * currently holds; `children` is a fallback for a message the caller wants to\n * show in its place. Nothing renders while the field is valid.\n */\nexport function FieldMessage({\n asChild = false,\n children,\n ...props\n}: FieldMessageProps) {\n const { messageId, error } = useFieldContext();\n const content = error ?? children;\n\n if (!content) {\n return null;\n }\n\n const Component = asChild ? Slot : \"p\";\n\n return (\n <Component {...props} id={messageId} role=\"alert\">\n {content}\n </Component>\n );\n}\n","import { Slot } from \"@radix-ui/react-slot\";\nimport type { ElementType, HTMLAttributes, ReactNode, Ref } from \"react\";\n\n/**\n * The library's type scale. Everything that renders text — field labels, hints,\n * form errors, headings — goes through here, so a size or colour lives in one\n * place and the tokens in `src/styles/index.css` stay the single source of\n * truth for what \"hint\" or \"muted\" means.\n *\n * Server-safe: no state, no handlers, no directive. It composes Radix `Slot`\n * for `asChild`, which is how a consumer puts these styles on their own\n * element (a `next/link`, a Radix `Label`) without an extra wrapper.\n */\n\nexport type TypographyVariant =\n | \"display\"\n | \"heading\"\n | \"subheading\"\n | \"body\"\n | \"label\"\n | \"hint\"\n | \"code\";\n\nexport type TypographyTone =\n | \"default\"\n | \"muted\"\n | \"subtle\"\n | \"accent\"\n | \"on-accent\"\n | \"success\"\n | \"warning\"\n | \"info\"\n | \"danger\";\n\nexport type TypographyWeight = \"regular\" | \"medium\" | \"semibold\" | \"bold\";\n\nexport type TypographyElement =\n | \"p\"\n | \"span\"\n | \"div\"\n | \"h1\"\n | \"h2\"\n | \"h3\"\n | \"h4\"\n | \"h5\"\n | \"h6\"\n | \"label\"\n | \"code\"\n | \"strong\"\n | \"em\"\n | \"small\";\n\nexport type TypographyProps = Omit<HTMLAttributes<HTMLElement>, \"color\"> & {\n /** Size and default element. `body` unless told otherwise. */\n variant?: TypographyVariant;\n /** Colour role, from the design tokens. */\n tone?: TypographyTone;\n /** Overrides the variant's default weight. */\n weight?: TypographyWeight;\n align?: \"start\" | \"center\" | \"end\";\n /** Clip to one line with an ellipsis. */\n truncate?: boolean;\n /**\n * An icon rendered beside the text, hidden from assistive tech. Sized to the\n * text with `1em`, so the same SVG fits every variant.\n */\n icon?: ReactNode;\n iconPosition?: \"leading\" | \"trailing\";\n /** The element to render. Defaults per variant (`h2` for a heading, and so on). */\n as?: TypographyElement;\n /**\n * Radix-style composition: render the child element itself, with these\n * styles merged onto it, instead of a wrapper. Takes precedence over `as`.\n */\n asChild?: boolean;\n ref?: Ref<HTMLElement>;\n children?: ReactNode;\n};\n\nconst DEFAULT_ELEMENT: Record<TypographyVariant, TypographyElement> = {\n display: \"h1\",\n heading: \"h2\",\n subheading: \"h3\",\n body: \"p\",\n label: \"span\",\n hint: \"p\",\n code: \"code\",\n};\n\nconst DEFAULT_WEIGHT: Record<TypographyVariant, TypographyWeight> = {\n display: \"semibold\",\n heading: \"semibold\",\n subheading: \"medium\",\n body: \"regular\",\n label: \"semibold\",\n hint: \"regular\",\n code: \"regular\",\n};\n\nconst VARIANT_CLASSES: Record<TypographyVariant, string> = {\n display: \"text-display leading-tight tracking-tight\",\n heading: \"text-heading leading-tight tracking-tight\",\n subheading: \"text-subheading leading-snug\",\n body: \"text-field leading-normal\",\n label: \"text-label leading-normal\",\n hint: \"text-hint leading-normal\",\n code: \"font-code text-field leading-normal\",\n};\n\nconst TONE_CLASSES: Record<TypographyTone, string> = {\n default: \"text-fg\",\n muted: \"text-fg-muted\",\n subtle: \"text-fg-subtle\",\n accent: \"text-accent\",\n \"on-accent\": \"text-on-accent\",\n success: \"text-success\",\n warning: \"text-warning\",\n info: \"text-info\",\n danger: \"text-danger\",\n};\n\nconst WEIGHT_CLASSES: Record<TypographyWeight, string> = {\n regular: \"font-normal\",\n medium: \"font-medium\",\n semibold: \"font-semibold\",\n bold: \"font-bold\",\n};\n\nconst ALIGN_CLASSES = {\n start: \"text-start\",\n center: \"text-center\",\n end: \"text-end\",\n} as const;\n\nconst ICON_CLASSES =\n \"inline-flex shrink-0 items-center [&>svg]:h-[1em] [&>svg]:w-[1em]\";\n\nfunction typographyClassName({\n variant,\n tone,\n weight,\n align,\n truncate,\n hasIcon,\n className,\n}: {\n variant: TypographyVariant;\n tone: TypographyTone;\n weight: TypographyWeight;\n align: \"start\" | \"center\" | \"end\" | undefined;\n truncate: boolean;\n hasIcon: boolean;\n className: string | undefined;\n}): string {\n return [\n VARIANT_CLASSES[variant],\n TONE_CLASSES[tone],\n WEIGHT_CLASSES[weight],\n align ? ALIGN_CLASSES[align] : \"\",\n hasIcon ? \"inline-flex items-center gap-1.5\" : \"\",\n // With an icon the root is a flex container, and text-overflow only\n // clips block text, so the text span carries the truncation instead.\n truncate && !hasIcon ? \"truncate\" : \"\",\n className ?? \"\",\n ]\n .filter(Boolean)\n .join(\" \");\n}\n\nexport function Typography({\n variant = \"body\",\n tone = \"default\",\n weight,\n align,\n truncate = false,\n icon,\n iconPosition = \"leading\",\n as,\n asChild = false,\n className,\n children,\n ...rest\n}: TypographyProps) {\n const hasIcon = icon !== undefined && icon !== null;\n // Widened to `ElementType`: the union of intrinsic tags would otherwise\n // demand a `ref` typed to one specific element.\n const Component: ElementType = asChild\n ? Slot\n : (as ?? DEFAULT_ELEMENT[variant]);\n\n const iconNode = hasIcon ? (\n <span aria-hidden=\"true\" className={ICON_CLASSES}>\n {icon}\n </span>\n ) : null;\n\n const content = hasIcon ? (\n <>\n {iconPosition === \"leading\" ? iconNode : null}\n <span className={truncate ? \"min-w-0 truncate\" : undefined}>\n {children}\n </span>\n {iconPosition === \"trailing\" ? iconNode : null}\n </>\n ) : (\n children\n );\n\n return (\n <Component\n {...rest}\n className={typographyClassName({\n variant,\n tone,\n weight: weight ?? DEFAULT_WEIGHT[variant],\n align,\n truncate,\n hasIcon,\n className,\n })}\n >\n {content}\n </Component>\n );\n}\n","\"use client\";\n\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport {\n FieldControl,\n FieldDescription,\n FieldLabel,\n FieldMessage,\n FieldRoot,\n useFieldContext,\n} from \"@/components/field\";\nimport { Typography } from \"@/components/typography\";\n\n/**\n * The design's single-line input, composed from the headless `Field`\n * primitives: label with the optional marker and action slot, the control\n * with its trailing slot, and the hint or error beneath. `TextInput`,\n * `EmailInput`, `PasswordInput` and `PhoneInput` each fix the `type` and the\n * keyboard/autofill hints and hand everything else here.\n *\n * Internal: no subpath of its own. Consumers reach it through the\n * specialised inputs, or build their own composition from `Field`.\n */\n\nexport type InputType = \"text\" | \"email\" | \"password\" | \"tel\";\n\nexport type InputFieldProps = Omit<\n ComponentPropsWithoutRef<\"input\">,\n \"name\" | \"type\"\n> & {\n /** The form field this input edits — the key in the `Form`'s values. */\n name: string;\n label?: string;\n /** Guidance under the field. Replaced by the error message while invalid. */\n hint?: ReactNode;\n /**\n * Error supplied by the caller — a server-side or cross-field failure. Takes\n * precedence over what the form's schema reports for this field.\n */\n error?: string;\n /** Renders the design's muted \"Optional\" marker at the end of the label. */\n optional?: boolean;\n /** Trailing label slot, for affordances like the design's \"Forgot?\" link. */\n action?: ReactNode;\n /** Trailing in-field slot, for affordances like the design's password peek. */\n trailing?: ReactNode;\n};\n\ntype InputFieldComponentProps = InputFieldProps & { type: InputType };\n\nconst CONTROL_CLASSES =\n \"h-10 w-full rounded-field border bg-surface px-3 font-[inherit] text-field text-fg outline-none placeholder:text-fg-subtle disabled:cursor-not-allowed disabled:opacity-45\";\nconst VALID_CLASSES =\n \"border-line focus:border-accent focus:ring-3 focus:ring-accent-soft\";\nconst INVALID_CLASSES =\n \"border-danger focus:border-danger focus:ring-3 focus:ring-danger-soft\";\n\nfunction InputLabel({\n label,\n optional,\n action,\n}: {\n label: string;\n optional: boolean;\n action: ReactNode;\n}) {\n return (\n <Typography\n variant=\"label\"\n tone=\"muted\"\n className=\"mb-1.5 flex items-center\"\n asChild\n >\n <FieldLabel>\n {label}\n {optional ? (\n <Typography\n as=\"span\"\n variant=\"hint\"\n tone=\"subtle\"\n weight=\"semibold\"\n className=\"ml-auto\"\n >\n Optional\n </Typography>\n ) : null}\n {action ? <span className=\"ml-auto\">{action}</span> : null}\n </FieldLabel>\n </Typography>\n );\n}\n\nfunction InputControl({\n hasTrailing,\n className,\n ...rest\n}: Omit<ComponentPropsWithoutRef<\"input\">, \"name\"> & {\n hasTrailing: boolean;\n}) {\n const { invalid } = useFieldContext();\n\n return (\n <FieldControl>\n <input\n {...rest}\n className={[\n CONTROL_CLASSES,\n invalid ? INVALID_CLASSES : VALID_CLASSES,\n hasTrailing ? \"pr-16\" : \"\",\n className ?? \"\",\n ]\n .filter(Boolean)\n .join(\" \")}\n />\n </FieldControl>\n );\n}\n\nfunction InputMessages({ hint }: { hint: ReactNode }) {\n const { error } = useFieldContext();\n\n if (error) {\n return (\n <Typography as=\"p\" variant=\"hint\" tone=\"danger\" asChild>\n <FieldMessage className=\"mt-1.5\" />\n </Typography>\n );\n }\n\n if (hint) {\n return (\n <Typography as=\"p\" variant=\"hint\" tone=\"subtle\" asChild>\n <FieldDescription className=\"mt-1.5\">{hint}</FieldDescription>\n </Typography>\n );\n }\n\n return null;\n}\n\nexport function InputField({\n name,\n label,\n hint,\n error,\n optional = false,\n action,\n trailing,\n id,\n disabled,\n required,\n type,\n ...rest\n}: InputFieldComponentProps) {\n return (\n <FieldRoot\n name={name}\n id={id}\n error={error}\n disabled={disabled}\n required={required}\n className=\"flex flex-col\"\n >\n {label ? (\n <InputLabel label={label} optional={optional} action={action} />\n ) : null}\n\n <div className={trailing ? \"relative\" : undefined}>\n <InputControl {...rest} type={type} hasTrailing={Boolean(trailing)} />\n {trailing ? (\n <span className=\"absolute top-1/2 right-[9px] flex -translate-y-1/2 items-center font-semibold text-fg-subtle text-hint\">\n {trailing}\n </span>\n ) : null}\n </div>\n\n <InputMessages hint={hint} />\n </FieldRoot>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEA,yBAAsB;AACtB,wBAAqB;AACrB,mBAQO;AACP,6BAKO;AAkGD;AAxDN,IAAM,mBAAe,4BAAwC,IAAI;AAG1D,SAAS,kBAAqC;AACnD,QAAM,cAAU,yBAAW,YAAY;AAEvC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,oDAAoD;AAAA,EACtE;AAEA,SAAO;AACT;AAqBA,SAAS,YAAY,IAAwB;AAC3C,QAAM,gBAAY,oBAAM;AACxB,QAAM,OAAO,MAAM;AAEnB,SAAO;AAAA,IACL,IAAI;AAAA,IACJ,eAAe,GAAG,IAAI;AAAA,IACtB,WAAW,GAAG,IAAI;AAAA,EACpB;AACF;AAEA,SAAS,WAAW;AAAA,EAClB;AAAA,EACA,UAAU;AAAA,EACV;AAAA,EACA,GAAG;AACL,GAAoB;AAClB,QAAM,CAAC,gBAAgB,iBAAiB,QAAI,uBAAS,KAAK;AAC1D,QAAM,YAAY,UAAU,yBAAO;AAEnC,SACE;AAAA,IAAC,aAAa;AAAA,IAAb;AAAA,MACC,OAAO,EAAE,GAAG,OAAO,gBAAgB,kBAAkB;AAAA,MAErD;AAAA,QAAC;AAAA;AAAA,UACE,GAAG;AAAA,UACJ,gBAAc,MAAM,UAAU,KAAK;AAAA,UACnC,iBAAe,M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AA,UACnE,WACC,6CAAC,UAAK,WAAU,0GACb,oBACH,IACE;AAAA,WACN;AAAA,QAEA,6CAAC,iBAAc,MAAY;AAAA;AAAA;AAAA,EAC7B;AAEJ;;;AHlKI,IAAAC,sBAAA;AANG,SAAS,WAAW;AAAA,EACzB,eAAe;AAAA,EACf,YAAY;AAAA,EACZ,GAAG;AACL,GAAoB;AAClB,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,MAAK;AAAA,MACL;AAAA,MACA;AAAA;AAAA,EACF;AAEJ;","names":["import_react_slot","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime"]}
@@ -0,0 +1,12 @@
1
+ import * as react from 'react';
2
+ import { I as InputFieldProps } from './index-CdYkd6zz.cjs';
3
+
4
+ /**
5
+ * A phone number. Fixes `type="tel"` and the numeric keypad. Validate it with
6
+ * `phoneSchema` from `@carbonbits/sixr/validation` in the enclosing `Form`'s
7
+ * schema.
8
+ */
9
+ type PhoneInputProps = InputFieldProps;
10
+ declare function PhoneInput({ autoComplete, inputMode, ...rest }: PhoneInputProps): react.JSX.Element;
11
+
12
+ export { PhoneInput, type PhoneInputProps };
@@ -0,0 +1,12 @@
1
+ import * as react from 'react';
2
+ import { I as InputFieldProps } from './index-CdYkd6zz.js';
3
+
4
+ /**
5
+ * A phone number. Fixes `type="tel"` and the numeric keypad. Validate it with
6
+ * `phoneSchema` from `@carbonbits/sixr/validation` in the enclosing `Form`'s
7
+ * schema.
8
+ */
9
+ type PhoneInputProps = InputFieldProps;
10
+ declare function PhoneInput({ autoComplete, inputMode, ...rest }: PhoneInputProps): react.JSX.Element;
11
+
12
+ export { PhoneInput, type PhoneInputProps };