@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
@@ -1,65 +1,16 @@
1
1
  import * as react from 'react';
2
- import { InputHTMLAttributes, ReactNode } from 'react';
2
+ import { I as InputFieldProps } from './index-CdYkd6zz.cjs';
3
3
 
4
4
  /**
5
- * Structural shape of a zod schema — every zod schema satisfies it, and any
6
- * version of zod does. Declaring it this way rather than importing `ZodType`
7
- * keeps zod out of this module's public types, so consumers who only want an
8
- * input do not have to install zod to typecheck it.
5
+ * Plain free text: names, job titles, one-time codes. Anything with a format
6
+ * of its own — an email address, a phone number, a password — has its own
7
+ * component (`EmailInput`, `PhoneInput`, `PasswordInput`), which fixes the
8
+ * keyboard, autocomplete and input type that format needs.
9
9
  */
10
- type TextInputSchema = {
11
- safeParse: (value: unknown) => {
12
- success: true;
13
- } | {
14
- success: false;
15
- error: {
16
- issues: readonly {
17
- message: string;
18
- }[];
19
- };
20
- };
21
- };
22
- /** Outcome of a single validation pass, handed to `onValidationChange`. */
23
- type TextInputValidation = {
24
- valid: boolean;
25
- /** First issue reported by the schema, or `undefined` when valid. */
26
- error?: string;
27
- };
28
- type TextInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "defaultValue" | "type"> & {
29
- label?: string;
30
- /** Guidance under the field. Replaced by the error message while invalid. */
31
- hint?: ReactNode;
32
- /**
33
- * Error supplied by the caller — a server-side or cross-field failure. Takes
34
- * precedence over the schema, so a form can hold a field invalid regardless
35
- * of what `schema` makes of the value on its own.
36
- */
37
- error?: string;
38
- /** Renders the design's muted "Optional" marker at the end of the label. */
39
- optional?: boolean;
40
- /** Trailing label slot, for affordances like the design's "Forgot?" link. */
41
- action?: ReactNode;
42
- /** Trailing in-field slot, for affordances like the design's password peek. */
43
- trailing?: ReactNode;
44
- /** Renders the value in the design's monospace face. */
10
+ type TextInputProps = InputFieldProps & {
11
+ /** Renders the value in the design's monospace face, as the code entry does. */
45
12
  mono?: boolean;
46
- type?: "text" | "email" | "password" | "tel" | "url" | "search";
47
- value?: string;
48
- defaultValue?: string;
49
- onChange?: (value: string) => void;
50
- /**
51
- * Any zod schema that accepts a string. Only `safeParse` is used, so a
52
- * refined, transformed or preprocessed schema works as well as a plain one.
53
- */
54
- schema?: TextInputSchema;
55
- /**
56
- * When the schema runs. `blur` — the default — avoids scolding someone
57
- * mid-keystroke; once a field has gone invalid it revalidates on every
58
- * keystroke so the message clears as soon as it is fixed.
59
- */
60
- validateOn?: "blur" | "change" | "never";
61
- onValidationChange?: (state: TextInputValidation) => void;
62
13
  };
63
- declare function TextInput({ label, hint, error, optional, action, trailing, mono, type, value, defaultValue, onChange, schema, validateOn, onValidationChange, id, className, onBlur, ...rest }: TextInputProps): react.JSX.Element;
14
+ declare function TextInput({ mono, className, ...rest }: TextInputProps): react.JSX.Element;
64
15
 
65
- export { TextInput, type TextInputProps, type TextInputSchema, type TextInputValidation };
16
+ export { TextInput, type TextInputProps };
@@ -1,65 +1,16 @@
1
1
  import * as react from 'react';
2
- import { InputHTMLAttributes, ReactNode } from 'react';
2
+ import { I as InputFieldProps } from './index-CdYkd6zz.js';
3
3
 
4
4
  /**
5
- * Structural shape of a zod schema — every zod schema satisfies it, and any
6
- * version of zod does. Declaring it this way rather than importing `ZodType`
7
- * keeps zod out of this module's public types, so consumers who only want an
8
- * input do not have to install zod to typecheck it.
5
+ * Plain free text: names, job titles, one-time codes. Anything with a format
6
+ * of its own — an email address, a phone number, a password — has its own
7
+ * component (`EmailInput`, `PhoneInput`, `PasswordInput`), which fixes the
8
+ * keyboard, autocomplete and input type that format needs.
9
9
  */
10
- type TextInputSchema = {
11
- safeParse: (value: unknown) => {
12
- success: true;
13
- } | {
14
- success: false;
15
- error: {
16
- issues: readonly {
17
- message: string;
18
- }[];
19
- };
20
- };
21
- };
22
- /** Outcome of a single validation pass, handed to `onValidationChange`. */
23
- type TextInputValidation = {
24
- valid: boolean;
25
- /** First issue reported by the schema, or `undefined` when valid. */
26
- error?: string;
27
- };
28
- type TextInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "defaultValue" | "type"> & {
29
- label?: string;
30
- /** Guidance under the field. Replaced by the error message while invalid. */
31
- hint?: ReactNode;
32
- /**
33
- * Error supplied by the caller — a server-side or cross-field failure. Takes
34
- * precedence over the schema, so a form can hold a field invalid regardless
35
- * of what `schema` makes of the value on its own.
36
- */
37
- error?: string;
38
- /** Renders the design's muted "Optional" marker at the end of the label. */
39
- optional?: boolean;
40
- /** Trailing label slot, for affordances like the design's "Forgot?" link. */
41
- action?: ReactNode;
42
- /** Trailing in-field slot, for affordances like the design's password peek. */
43
- trailing?: ReactNode;
44
- /** Renders the value in the design's monospace face. */
10
+ type TextInputProps = InputFieldProps & {
11
+ /** Renders the value in the design's monospace face, as the code entry does. */
45
12
  mono?: boolean;
46
- type?: "text" | "email" | "password" | "tel" | "url" | "search";
47
- value?: string;
48
- defaultValue?: string;
49
- onChange?: (value: string) => void;
50
- /**
51
- * Any zod schema that accepts a string. Only `safeParse` is used, so a
52
- * refined, transformed or preprocessed schema works as well as a plain one.
53
- */
54
- schema?: TextInputSchema;
55
- /**
56
- * When the schema runs. `blur` — the default — avoids scolding someone
57
- * mid-keystroke; once a field has gone invalid it revalidates on every
58
- * keystroke so the message clears as soon as it is fixed.
59
- */
60
- validateOn?: "blur" | "change" | "never";
61
- onValidationChange?: (state: TextInputValidation) => void;
62
13
  };
63
- declare function TextInput({ label, hint, error, optional, action, trailing, mono, type, value, defaultValue, onChange, schema, validateOn, onValidationChange, id, className, onBlur, ...rest }: TextInputProps): react.JSX.Element;
14
+ declare function TextInput({ mono, className, ...rest }: TextInputProps): react.JSX.Element;
64
15
 
65
- export { TextInput, type TextInputProps, type TextInputSchema, type TextInputValidation };
16
+ export { TextInput, type TextInputProps };