@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.
- package/README.md +204 -66
- package/dist/button.cjs +223 -0
- package/dist/button.cjs.map +1 -0
- package/dist/button.d.cts +34 -0
- package/dist/button.d.ts +34 -0
- package/dist/button.js +4 -0
- package/dist/button.js.map +1 -0
- package/dist/chunk-HDTW4FRT.js +111 -0
- package/dist/chunk-HDTW4FRT.js.map +1 -0
- package/dist/chunk-NZHHNVXZ.js +118 -0
- package/dist/chunk-NZHHNVXZ.js.map +1 -0
- package/dist/email-input.cjs +433 -0
- package/dist/email-input.cjs.map +1 -0
- package/dist/email-input.d.cts +12 -0
- package/dist/email-input.d.ts +12 -0
- package/dist/email-input.js +416 -0
- package/dist/email-input.js.map +1 -0
- package/dist/field.cjs +206 -0
- package/dist/field.cjs.map +1 -0
- package/dist/field.d.cts +80 -0
- package/dist/field.d.ts +80 -0
- package/dist/field.js +186 -0
- package/dist/field.js.map +1 -0
- package/dist/form.cjs +283 -42
- package/dist/form.cjs.map +1 -1
- package/dist/form.d.cts +79 -10
- package/dist/form.d.ts +79 -10
- package/dist/form.js +285 -45
- package/dist/form.js.map +1 -1
- package/dist/index-CdYkd6zz.d.cts +22 -0
- package/dist/index-CdYkd6zz.d.ts +22 -0
- package/dist/index.cjs +217 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +146 -46
- package/dist/index.d.ts +146 -46
- package/dist/index.js +2 -0
- package/dist/password-input.cjs +449 -0
- package/dist/password-input.cjs.map +1 -0
- package/dist/password-input.d.cts +19 -0
- package/dist/password-input.d.ts +19 -0
- package/dist/password-input.js +434 -0
- package/dist/password-input.js.map +1 -0
- package/dist/phone-input.cjs +429 -0
- package/dist/phone-input.cjs.map +1 -0
- package/dist/phone-input.d.cts +12 -0
- package/dist/phone-input.d.ts +12 -0
- package/dist/phone-input.js +412 -0
- package/dist/phone-input.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/text-input.cjs +359 -147
- package/dist/text-input.cjs.map +1 -1
- package/dist/text-input.d.cts +9 -58
- package/dist/text-input.d.ts +9 -58
- package/dist/text-input.js +365 -150
- package/dist/text-input.js.map +1 -1
- package/dist/typography.cjs +120 -0
- package/dist/typography.cjs.map +1 -0
- package/dist/typography.d.cts +46 -0
- package/dist/typography.d.ts +46 -0
- package/dist/typography.js +3 -0
- package/dist/typography.js.map +1 -0
- package/package.json +69 -1
package/dist/text-input.d.cts
CHANGED
|
@@ -1,65 +1,16 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { I as InputFieldProps } from './index-CdYkd6zz.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
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
|
|
11
|
-
|
|
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({
|
|
14
|
+
declare function TextInput({ mono, className, ...rest }: TextInputProps): react.JSX.Element;
|
|
64
15
|
|
|
65
|
-
export { TextInput, type TextInputProps
|
|
16
|
+
export { TextInput, type TextInputProps };
|
package/dist/text-input.d.ts
CHANGED
|
@@ -1,65 +1,16 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { I as InputFieldProps } from './index-CdYkd6zz.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
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
|
|
11
|
-
|
|
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({
|
|
14
|
+
declare function TextInput({ mono, className, ...rest }: TextInputProps): react.JSX.Element;
|
|
64
15
|
|
|
65
|
-
export { TextInput, type TextInputProps
|
|
16
|
+
export { TextInput, type TextInputProps };
|