@igne-agency/react-web-ui 0.5.0 → 0.6.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/dist/components/accordion/accordion.css +21 -21
- package/dist/components/accordion/accordion.d.ts +17 -4
- package/dist/components/accordion/accordion.js +83 -36
- package/dist/components/accordion/accordion.module.js +6 -6
- package/dist/components/attachment-tile/attachment-preview.d.ts +56 -13
- package/dist/components/attachment-tile/attachment-preview.js +388 -119
- package/dist/components/attachment-tile/attachment-tile.css +31 -25
- package/dist/components/attachment-tile/attachment-tile.d.ts +32 -10
- package/dist/components/attachment-tile/attachment-tile.js +160 -43
- package/dist/components/attachment-tile/attachment-tile.module.js +8 -8
- package/dist/components/attachment-tile/index.d.ts +1 -1
- package/dist/components/avatar/avatar.css +9 -9
- package/dist/components/avatar/avatar.d.ts +50 -5
- package/dist/components/avatar/avatar.js +178 -64
- package/dist/components/avatar/avatar.module.js +3 -3
- package/dist/components/avatar-group/avatar-group-context.d.ts +2 -4
- package/dist/components/avatar-group/avatar-group-context.js +2 -2
- package/dist/components/avatar-group/avatar-group.css +26 -20
- package/dist/components/avatar-group/avatar-group.d.ts +85 -27
- package/dist/components/avatar-group/avatar-group.js +400 -246
- package/dist/components/avatar-group/avatar-group.module.js +8 -8
- package/dist/components/breadcrumbs/breadcrumbs.css +12 -12
- package/dist/components/breadcrumbs/breadcrumbs.d.ts +69 -23
- package/dist/components/breadcrumbs/breadcrumbs.js +299 -248
- package/dist/components/breadcrumbs/breadcrumbs.module.js +8 -8
- package/dist/components/button/button.css +29 -31
- package/dist/components/button/button.d.ts +20 -16
- package/dist/components/button/button.js +140 -145
- package/dist/components/button/button.module.js +1 -1
- package/dist/components/button/index.js +1 -1
- package/dist/components/checkbox-field/checkbox-field.js +63 -49
- package/dist/components/checkbox-field/checkbox.css +105 -56
- package/dist/components/checkbox-field/checkbox.d.ts +3 -2
- package/dist/components/checkbox-field/checkbox.js +12 -9
- package/dist/components/checkbox-field/checkbox.module.js +4 -4
- package/dist/components/checkbox-group-field/checkbox-group-field.js +78 -72
- package/dist/components/checkbox-group-field/checkbox-group.css +14 -10
- package/dist/components/checkbox-group-field/checkbox-group.d.ts +2 -2
- package/dist/components/checkbox-group-field/checkbox-group.js +2 -2
- package/dist/components/checkbox-group-field/checkbox-group.module.js +2 -2
- package/dist/components/collapsible/collapsible.css +20 -20
- package/dist/components/collapsible/collapsible.d.ts +17 -4
- package/dist/components/collapsible/collapsible.js +83 -36
- package/dist/components/collapsible/collapsible.module.js +5 -5
- package/dist/components/combobox-field/combobox-field.js +206 -158
- package/dist/components/combobox-field/combobox.css +492 -277
- package/dist/components/combobox-field/combobox.d.ts +148 -39
- package/dist/components/combobox-field/combobox.js +506 -206
- package/dist/components/combobox-field/combobox.module.js +21 -21
- package/dist/components/combobox-field/value-state-view.css +5 -5
- package/dist/components/combobox-field/value-state-view.module.js +4 -4
- package/dist/components/composer/composer-attachments.d.ts +30 -11
- package/dist/components/composer/composer-attachments.js +45 -40
- package/dist/components/composer/composer-editor.css +40 -35
- package/dist/components/composer/composer-editor.d.ts +14 -4
- package/dist/components/composer/composer-editor.js +134 -44
- package/dist/components/composer/composer-editor.module.js +5 -5
- package/dist/components/composer/composer.css +22 -22
- package/dist/components/composer/composer.d.ts +13 -2
- package/dist/components/composer/composer.js +78 -63
- package/dist/components/composer/composer.module.js +5 -5
- package/dist/components/composer/index.d.ts +2 -2
- package/dist/components/composer/mention-text.css +5 -5
- package/dist/components/composer/mention-text.module.js +1 -1
- package/dist/components/confirm-dialog/confirm-dialog.css +29 -29
- package/dist/components/confirm-dialog/confirm-dialog.d.ts +57 -3
- package/dist/components/confirm-dialog/confirm-dialog.js +266 -108
- package/dist/components/confirm-dialog/confirm-dialog.module.js +5 -5
- package/dist/components/conversation/conversation.css +52 -52
- package/dist/components/conversation/conversation.d.ts +43 -18
- package/dist/components/conversation/conversation.js +120 -78
- package/dist/components/conversation/conversation.module.js +15 -15
- package/dist/components/date-field/date-field.d.ts +1 -1
- package/dist/components/date-field/date-field.js +202 -100
- package/dist/components/date-field/date-input.d.ts +73 -37
- package/dist/components/date-field/date-input.js +72 -45
- package/dist/components/date-field/index.d.ts +1 -1
- package/dist/components/date-range-field/date-range-field.d.ts +1 -1
- package/dist/components/date-range-field/date-range-field.js +219 -107
- package/dist/components/date-range-field/date-range-input.d.ts +84 -40
- package/dist/components/date-range-field/date-range-input.js +83 -48
- package/dist/components/dialog/dialog.css +32 -32
- package/dist/components/dialog/dialog.d.ts +8 -7
- package/dist/components/dialog/dialog.js +8 -26
- package/dist/components/dialog/dialog.module.js +6 -6
- package/dist/components/divider/divider.css +6 -6
- package/dist/components/divider/divider.d.ts +36 -2
- package/dist/components/divider/divider.js +195 -29
- package/dist/components/divider/divider.module.js +3 -3
- package/dist/components/drawer/drawer.css +55 -56
- package/dist/components/drawer/drawer.d.ts +8 -7
- package/dist/components/drawer/drawer.js +8 -26
- package/dist/components/drawer/drawer.module.js +6 -6
- package/dist/components/field/field.css +34 -24
- package/dist/components/field/field.d.ts +60 -37
- package/dist/components/field/field.js +242 -157
- package/dist/components/field/field.module.js +12 -10
- package/dist/components/field/input-parts.d.ts +11 -13
- package/dist/components/field/input-parts.js +23 -42
- package/dist/components/field-placeholder/field-placeholder.css +6 -6
- package/dist/components/field-placeholder/field-placeholder.module.js +4 -4
- package/dist/components/fieldset/field-group.d.ts +1 -1
- package/dist/components/fieldset/field-group.js +48 -42
- package/dist/components/fieldset/fieldset-root.d.ts +1 -1
- package/dist/components/fieldset/fieldset-root.js +19 -17
- package/dist/components/fieldset/fieldset.d.ts +2 -2
- package/dist/components/fieldset/fieldset.js +2 -2
- package/dist/components/file-field/file-field.css +126 -60
- package/dist/components/file-field/file-field.js +201 -109
- package/dist/components/file-field/file-field.module.js +4 -4
- package/dist/components/file-field/file-input.d.ts +66 -40
- package/dist/components/file-field/file-input.js +188 -132
- package/dist/components/filter-bar/filter-bar.css +8 -8
- package/dist/components/filter-bar/filter-bar.d.ts +12 -3
- package/dist/components/filter-bar/filter-bar.js +23 -25
- package/dist/components/filter-bar/filter-bar.module.js +5 -5
- package/dist/components/form/form.d.ts +19 -7
- package/dist/components/form/form.js +80 -29
- package/dist/components/icon/icon.css +2 -2
- package/dist/components/icon/icon.module.js +1 -1
- package/dist/components/link/link.css +6 -5
- package/dist/components/link/link.module.js +1 -1
- package/dist/components/menu/menu.css +52 -47
- package/dist/components/menu/menu.d.ts +32 -25
- package/dist/components/menu/menu.js +75 -124
- package/dist/components/menu/menu.module.js +8 -8
- package/dist/components/nav/nav-context.d.ts +1 -1
- package/dist/components/nav/nav-item-view.d.ts +10 -13
- package/dist/components/nav/nav-item-view.js +42 -54
- package/dist/components/nav/nav.css +150 -119
- package/dist/components/nav/nav.d.ts +61 -17
- package/dist/components/nav/nav.js +271 -176
- package/dist/components/nav/nav.module.js +17 -15
- package/dist/components/number-field/number-field.css +153 -64
- package/dist/components/number-field/number-field.d.ts +2 -2
- package/dist/components/number-field/number-field.js +112 -91
- package/dist/components/number-field/number-field.module.js +6 -6
- package/dist/components/number-field/number-input.d.ts +43 -23
- package/dist/components/number-field/number-input.js +179 -125
- package/dist/components/otp-field/otp-field.css +153 -60
- package/dist/components/otp-field/otp-field.d.ts +2 -2
- package/dist/components/otp-field/otp-field.js +62 -46
- package/dist/components/otp-field/otp-field.module.js +4 -4
- package/dist/components/otp-field/otp-input.d.ts +8 -6
- package/dist/components/otp-field/otp-input.js +92 -92
- package/dist/components/pagination/pagination.d.ts +46 -15
- package/dist/components/pagination/pagination.js +217 -224
- package/dist/components/password-field/password-field.css +23 -23
- package/dist/components/password-field/password-field.js +107 -85
- package/dist/components/password-field/password-field.module.js +8 -8
- package/dist/components/password-field/password-strength.d.ts +107 -3
- package/dist/components/password-field/password-strength.js +569 -92
- package/dist/components/photo-field/photo-field.js +137 -112
- package/dist/components/photo-field/photo-input.css +67 -44
- package/dist/components/photo-field/photo-input.d.ts +59 -15
- package/dist/components/photo-field/photo-input.js +173 -86
- package/dist/components/photo-field/photo-input.module.js +10 -8
- package/dist/components/popover/popover.css +41 -41
- package/dist/components/popover/popover.d.ts +66 -25
- package/dist/components/popover/popover.js +332 -217
- package/dist/components/popover/popover.module.js +15 -19
- package/dist/components/radio-group-field/radio-group-field.js +80 -71
- package/dist/components/radio-group-field/radio-group.css +112 -60
- package/dist/components/radio-group-field/radio-group.d.ts +19 -3
- package/dist/components/radio-group-field/radio-group.js +66 -23
- package/dist/components/radio-group-field/radio-group.module.js +4 -4
- package/dist/components/segmented-control-field/segmented-control-field.d.ts +1 -1
- package/dist/components/segmented-control-field/segmented-control-field.js +111 -96
- package/dist/components/segmented-control-field/segmented-control.css +132 -79
- package/dist/components/segmented-control-field/segmented-control.d.ts +39 -15
- package/dist/components/segmented-control-field/segmented-control.js +124 -41
- package/dist/components/segmented-control-field/segmented-control.module.js +4 -4
- package/dist/components/select-field/select.css +214 -101
- package/dist/components/select-field/select.d.ts +43 -11
- package/dist/components/select-field/select.js +194 -109
- package/dist/components/select-field/select.module.js +14 -14
- package/dist/components/skeleton/skeleton.css +4 -4
- package/dist/components/skeleton/skeleton.module.js +3 -3
- package/dist/components/stale/stale.css +15 -15
- package/dist/components/stale/stale.d.ts +27 -3
- package/dist/components/stale/stale.js +147 -66
- package/dist/components/stale/stale.module.js +6 -6
- package/dist/components/status-message/status-message.css +22 -22
- package/dist/components/status-message/status-message.module.js +6 -6
- package/dist/components/switch-field/switch-field.js +77 -57
- package/dist/components/switch-field/switch.css +112 -63
- package/dist/components/switch-field/switch.d.ts +20 -3
- package/dist/components/switch-field/switch.js +70 -27
- package/dist/components/switch-field/switch.module.js +4 -4
- package/dist/components/tabs/tabs.css +32 -32
- package/dist/components/tabs/tabs.d.ts +21 -7
- package/dist/components/tabs/tabs.js +73 -14
- package/dist/components/tabs/tabs.module.js +7 -7
- package/dist/components/tag/tag.css +84 -84
- package/dist/components/tag/tag.module.js +3 -3
- package/dist/components/tag-group/tag-group.css +94 -94
- package/dist/components/tag-group/tag-group.module.js +4 -4
- package/dist/components/text-field/text-field.css +159 -82
- package/dist/components/text-field/text-field.d.ts +1 -1
- package/dist/components/text-field/text-field.js +139 -110
- package/dist/components/text-field/text-field.module.js +9 -9
- package/dist/components/text-field/text-input.d.ts +81 -45
- package/dist/components/text-field/text-input.js +366 -217
- package/dist/components/textarea-field/textarea-field.css +7 -2
- package/dist/components/textarea-field/textarea-field.js +72 -56
- package/dist/components/textarea-field/textarea-field.module.js +2 -2
- package/dist/components/time-field/time-field.js +153 -60
- package/dist/components/time-field/time-input.d.ts +21 -10
- package/dist/components/time-field/time-input.js +22 -11
- package/dist/components/toast/toast-provider.css +34 -31
- package/dist/components/toast/toast-provider.d.ts +63 -14
- package/dist/components/toast/toast-provider.js +174 -111
- package/dist/components/toast/toast-provider.module.js +7 -7
- package/dist/components/toggle-group-field/toggle-group-field.d.ts +1 -1
- package/dist/components/toggle-group-field/toggle-group-field.js +95 -89
- package/dist/components/toggle-group-field/toggle-group.css +117 -67
- package/dist/components/toggle-group-field/toggle-group.d.ts +2 -2
- package/dist/components/toggle-group-field/toggle-group.js +2 -2
- package/dist/components/toggle-group-field/toggle-group.module.js +2 -2
- package/dist/components/tooltip/tooltip.css +4 -4
- package/dist/components/tooltip/tooltip.module.js +1 -1
- package/dist/data-table/data-table-content.js +6 -5
- package/dist/data-table/data-table-parts.d.ts +41 -13
- package/dist/data-table/data-table-parts.js +213 -172
- package/dist/data-table/data-table-selection.d.ts +105 -3
- package/dist/data-table/data-table-selection.js +654 -145
- package/dist/data-table/data-table.css +125 -128
- package/dist/data-table/data-table.d.ts +21 -26
- package/dist/data-table/data-table.js +20 -23
- package/dist/data-table/data-table.module.js +32 -34
- package/dist/data-table/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/lib/calendar/calendar-navigation.d.ts +39 -5
- package/dist/lib/calendar/calendar-navigation.js +185 -118
- package/dist/lib/calendar/calendar-parts.d.ts +143 -0
- package/dist/lib/calendar/calendar-parts.js +540 -0
- package/dist/lib/calendar/calendar-prefab.d.ts +52 -0
- package/dist/lib/calendar/calendar-prefab.js +311 -0
- package/dist/lib/calendar/calendar-year.d.ts +3 -1
- package/dist/lib/calendar/calendar-year.js +139 -131
- package/dist/lib/calendar/temporal.css +325 -232
- package/dist/lib/calendar/temporal.d.ts +67 -82
- package/dist/lib/calendar/temporal.js +258 -569
- package/dist/lib/calendar/temporal.module.js +38 -38
- package/dist/lib/forms/use-connected-field.d.ts +1 -1
- package/dist/lib/forms/use-connected-field.js +1 -1
- package/dist/lib/render-as.d.ts +13 -0
- package/dist/lib/render-as.js +46 -0
- package/dist/tokens.css +6 -3
- package/package.json +1 -1
- package/tokens/dark.tokens.json +6 -0
- package/tokens/sys.tokens.json +7 -0
- package/dist/components/button/close-button.d.ts +0 -16
- package/dist/components/button/close-button.js +0 -30
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { type InputProps as BaseInputProps } from "@base-ui/react/input";
|
|
2
|
-
import {
|
|
2
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
3
|
+
import { type ComponentProps, type ComponentPropsWithRef, type ReactElement, type ReactNode } from "react";
|
|
3
4
|
import { Field, type FieldProps, type FieldState } from "../field/index.ts";
|
|
4
5
|
import { InputError, type InputErrorProps, InputLabel, type InputLabelProps, InputPending, type InputPendingProps } from "../field/input-parts.tsx";
|
|
5
|
-
export type TextInputRootProps = Omit<FieldProps, "label" | "description"> & Readonly<{
|
|
6
|
+
export type TextInputRootProps = Omit<FieldProps, "label" | "description" | "optionalLabel"> & Readonly<{
|
|
6
7
|
value: string;
|
|
7
8
|
onValueChange: (value: string) => void;
|
|
8
9
|
disabled?: boolean;
|
|
@@ -19,9 +20,9 @@ export type TextInputRootProps = Omit<FieldProps, "label" | "description"> & Rea
|
|
|
19
20
|
* state onto every part.
|
|
20
21
|
*
|
|
21
22
|
* @example
|
|
22
|
-
* <TextInput.Root value={value} onValueChange={setValue}
|
|
23
|
+
* <TextInput.Root value={value} onValueChange={setValue}>…</TextInput.Root>
|
|
23
24
|
*/
|
|
24
|
-
declare const TextInputRoot: ({ value, onValueChange, disabled, readOnly, requiredness,
|
|
25
|
+
declare const TextInputRoot: ({ value, onValueChange, disabled, readOnly, requiredness, errors, dirty, touched, pending, maxLength, state, className, children, }: TextInputRootProps) => ReactNode;
|
|
25
26
|
export type TextInputLabelProps = InputLabelProps;
|
|
26
27
|
/**
|
|
27
28
|
* The bordered box holding the control and its inlays.
|
|
@@ -59,61 +60,90 @@ export type TextInputInputProps = Omit<BaseInputProps, "value" | "defaultValue"
|
|
|
59
60
|
* <TextInput.Input type="email" />
|
|
60
61
|
*/
|
|
61
62
|
declare const TextInputInput: ({ type, className, ...props }: TextInputInputProps) => ReactNode;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
63
|
+
/** The props of a button part: the button's own, but the click, which the part owns. */
|
|
64
|
+
type InlayButtonProps = Omit<ComponentPropsWithRef<"button">, "onClick" | "type" | "children">;
|
|
65
|
+
export type TextInputClearProps = InlayButtonProps & Readonly<{
|
|
66
|
+
/** The button to render, such as `<IconButton label="Clear"><CloseIcon /></IconButton>`. */
|
|
67
|
+
render: useRender.RenderProp;
|
|
68
|
+
}>;
|
|
69
|
+
/**
|
|
70
|
+
* The button that empties the control, shown once it holds a value. It renders
|
|
71
|
+
* whichever button it is given.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* <TextInput.Clear render={<IconButton label="Clear" variant="tertiary" size="sm"><CloseIcon /></IconButton>} />
|
|
75
|
+
*/
|
|
76
|
+
declare const TextInputClear: ({ render, className, ...props }: TextInputClearProps) => ReactNode;
|
|
77
|
+
export type TextInputActionProps = Omit<ComponentPropsWithRef<"button">, "children"> & Readonly<{
|
|
78
|
+
/** The button to render, such as `<Button variant="tertiary" size="sm">Search</Button>`. */
|
|
79
|
+
render: useRender.RenderProp;
|
|
68
80
|
}>;
|
|
69
81
|
/**
|
|
70
|
-
*
|
|
82
|
+
* Any button inside the group, in the place an inlay that acts takes, such as
|
|
83
|
+
* a search field's trailing "Search" button. It renders whichever button it is
|
|
84
|
+
* given, disabled while the field is.
|
|
71
85
|
*
|
|
72
86
|
* @example
|
|
73
|
-
* <TextInput.
|
|
87
|
+
* <TextInput.Action render={<Button variant="tertiary" size="sm" type="submit">Search</Button>} />
|
|
74
88
|
*/
|
|
75
|
-
declare const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
89
|
+
declare const TextInputAction: ({ render, className, ...props }: TextInputActionProps) => ReactElement;
|
|
90
|
+
/** Where a copy stands: not tried, landed, or refused and selected instead. */
|
|
91
|
+
export type TextInputCopyOutcome = "idle" | "copied" | "failed";
|
|
92
|
+
/** The state a `Copy` part renders from, also set as `data-outcome`. */
|
|
93
|
+
export type TextInputCopyState = Readonly<{
|
|
94
|
+
outcome: TextInputCopyOutcome;
|
|
95
|
+
}>;
|
|
96
|
+
export type TextInputCopyProps = InlayButtonProps & Readonly<{
|
|
97
|
+
/** Announced once the value is on the clipboard, such as "Copied". */
|
|
80
98
|
copiedLabel: string;
|
|
81
|
-
/**
|
|
99
|
+
/** Announced once copying failed and the text is selected instead. */
|
|
82
100
|
failedLabel: string;
|
|
83
|
-
/** The
|
|
84
|
-
|
|
85
|
-
/** The icon once copying failed. Left out, the button keeps its own. */
|
|
86
|
-
failedIcon?: ReactNode;
|
|
87
|
-
className?: string;
|
|
88
|
-
/** The icon the button shows. */
|
|
89
|
-
children: ReactNode;
|
|
101
|
+
/** The button to render, or a function of the copy's state that returns one. */
|
|
102
|
+
render: useRender.RenderProp<TextInputCopyState>;
|
|
90
103
|
}>;
|
|
91
104
|
/**
|
|
92
|
-
* The
|
|
93
|
-
*
|
|
105
|
+
* The button that copies the value to the clipboard, shown once it holds one,
|
|
106
|
+
* and announces whether the copy landed. It renders whichever button it is
|
|
107
|
+
* given, and a render function can follow the outcome.
|
|
94
108
|
*
|
|
95
109
|
* @example
|
|
96
|
-
* <TextInput.Copy
|
|
110
|
+
* <TextInput.Copy
|
|
111
|
+
* copiedLabel="Copied"
|
|
112
|
+
* failedLabel="Copy failed, text selected"
|
|
113
|
+
* render={(props, { outcome }) => (
|
|
114
|
+
* <IconButton {...props} label="Copy" variant="tertiary" size="sm">
|
|
115
|
+
* {outcome === "copied" ? <CheckIcon /> : <CopyIcon />}
|
|
116
|
+
* </IconButton>
|
|
117
|
+
* )}
|
|
118
|
+
* />
|
|
97
119
|
*/
|
|
98
|
-
declare const TextInputCopy: ({
|
|
99
|
-
|
|
120
|
+
declare const TextInputCopy: ({ copiedLabel, failedLabel, render, className, ...props }: TextInputCopyProps) => ReactNode;
|
|
121
|
+
/** The state a `Reveal` part renders from, also set as `data-revealed`. */
|
|
122
|
+
export type TextInputRevealState = Readonly<{
|
|
123
|
+
revealed: boolean;
|
|
124
|
+
}>;
|
|
125
|
+
export type TextInputRevealProps = InlayButtonProps & Readonly<{
|
|
100
126
|
/** Whether the concealed value shows as text. */
|
|
101
127
|
revealed: boolean;
|
|
102
128
|
onRevealedChange: (revealed: boolean) => void;
|
|
103
|
-
/**
|
|
104
|
-
|
|
105
|
-
className?: string;
|
|
106
|
-
/** The icon the button shows. */
|
|
107
|
-
children: ReactNode;
|
|
129
|
+
/** The button to render, or a function of `revealed` that returns one. */
|
|
130
|
+
render: useRender.RenderProp<TextInputRevealState>;
|
|
108
131
|
}>;
|
|
109
132
|
/**
|
|
110
|
-
* The
|
|
111
|
-
*
|
|
133
|
+
* The toggle that shows a concealed value, such as a password, as text. The
|
|
134
|
+
* caller switches the `Input`'s `type` with `revealed`, and names the button for
|
|
135
|
+
* what a press will do.
|
|
112
136
|
*
|
|
113
137
|
* @example
|
|
114
|
-
* <TextInput.Reveal
|
|
138
|
+
* <TextInput.Reveal
|
|
139
|
+
* revealed={revealed}
|
|
140
|
+
* onRevealedChange={setRevealed}
|
|
141
|
+
* render={
|
|
142
|
+
* <Button variant="tertiary" size="sm">{revealed ? "Hide" : "Show"}</Button>
|
|
143
|
+
* }
|
|
144
|
+
* />
|
|
115
145
|
*/
|
|
116
|
-
declare const TextInputReveal: ({ revealed, onRevealedChange,
|
|
146
|
+
declare const TextInputReveal: ({ revealed, onRevealedChange, render, className, ...props }: TextInputRevealProps) => ReactNode;
|
|
117
147
|
/**
|
|
118
148
|
* The value's length against `Root`'s `maxLength`, toned as it nears the limit.
|
|
119
149
|
* Renders nothing without a `maxLength`.
|
|
@@ -133,6 +163,7 @@ export type TextInputParts = Readonly<{
|
|
|
133
163
|
Inlay: typeof TextInputInlay;
|
|
134
164
|
Affix: typeof TextInputAffix;
|
|
135
165
|
Input: typeof TextInputInput;
|
|
166
|
+
Action: typeof TextInputAction;
|
|
136
167
|
Clear: typeof TextInputClear;
|
|
137
168
|
Copy: typeof TextInputCopy;
|
|
138
169
|
Reveal: typeof TextInputReveal;
|
|
@@ -144,19 +175,24 @@ export type TextInputParts = Readonly<{
|
|
|
144
175
|
/**
|
|
145
176
|
* The parts of a text input: the field frame, a group carrying the border and
|
|
146
177
|
* its inlays, and the bare control inside it. A `Bar` is a strip of inlays along
|
|
147
|
-
* the bottom edge of the group, for a control the inlays cannot sit beside
|
|
178
|
+
* the bottom edge of the group, for a control the inlays cannot sit beside, and
|
|
179
|
+
* an `Action` is any button placed in the group. For
|
|
148
180
|
* the ordinary case, use the `TextField` shorthand, which is assembled from
|
|
149
181
|
* exactly these parts. An `Affix` is decoration, so its meaning belongs in the
|
|
150
182
|
* label or description too. `Error` renders the errors `Root` was given.
|
|
151
183
|
*
|
|
152
184
|
* @example
|
|
153
|
-
* <TextInput.Root value={value} onValueChange={setValue} errors={errors}
|
|
154
|
-
* <TextInput.Label>Email
|
|
185
|
+
* <TextInput.Root value={value} onValueChange={setValue} errors={errors} requiredness="optional">
|
|
186
|
+
* <TextInput.Label>Email <Field.Requiredness optionalLabel="optional" /></TextInput.Label>
|
|
155
187
|
* <TextInput.Group>
|
|
156
188
|
* <TextInput.Input type="email" />
|
|
157
|
-
* <TextInput.Clear
|
|
158
|
-
*
|
|
159
|
-
*
|
|
189
|
+
* <TextInput.Clear
|
|
190
|
+
* render={
|
|
191
|
+
* <IconButton label="Clear" variant="tertiary" size="sm">
|
|
192
|
+
* <CloseIcon />
|
|
193
|
+
* </IconButton>
|
|
194
|
+
* }
|
|
195
|
+
* />
|
|
160
196
|
* </TextInput.Group>
|
|
161
197
|
* <TextInput.Error />
|
|
162
198
|
* </TextInput.Root>
|