@igne-agency/react-web-ui 0.3.0 → 0.4.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 +32 -1
- package/dist/components/accordion/accordion.css +24 -19
- package/dist/components/accordion/accordion.d.ts +19 -3
- package/dist/components/accordion/accordion.js +86 -32
- package/dist/components/accordion/accordion.module.js +8 -8
- package/dist/components/active-filters/active-filter-describers.d.ts +1 -1
- package/dist/components/active-filters/active-filter-describers.js +1 -1
- package/dist/components/active-filters/active-filters.d.ts +35 -2
- package/dist/components/active-filters/active-filters.js +57 -52
- package/dist/components/active-filters/index.js +2 -2
- package/dist/components/attachment-tile/attachment-preview.d.ts +11 -9
- package/dist/components/attachment-tile/attachment-preview.js +102 -68
- package/dist/components/attachment-tile/attachment-tile.css +22 -13
- package/dist/components/attachment-tile/attachment-tile.d.ts +51 -6
- package/dist/components/attachment-tile/attachment-tile.js +209 -85
- package/dist/components/attachment-tile/attachment-tile.module.js +10 -10
- package/dist/components/attachment-tile/index.d.ts +1 -1
- package/dist/components/attachment-tile/index.js +2 -2
- package/dist/components/avatar/avatar.d.ts +5 -5
- package/dist/components/avatar/avatar.js +64 -37
- package/dist/components/avatar-group/avatar-group.js +2 -2
- package/dist/components/badge/badge.js +1 -1
- package/dist/components/breadcrumbs/breadcrumbs.d.ts +22 -7
- package/dist/components/breadcrumbs/breadcrumbs.js +189 -170
- package/dist/components/button/button.d.ts +2 -3
- package/dist/components/button/button.js +58 -77
- package/dist/components/button/close-button.d.ts +4 -2
- package/dist/components/button/close-button.js +9 -9
- package/dist/components/checkbox-field/checkbox-field.d.ts +17 -3
- package/dist/components/checkbox-field/checkbox-field.js +108 -131
- package/dist/components/checkbox-field/checkbox.css +26 -34
- package/dist/components/checkbox-field/checkbox.d.ts +51 -8
- package/dist/components/checkbox-field/checkbox.js +221 -57
- package/dist/components/checkbox-field/checkbox.module.js +6 -8
- package/dist/components/checkbox-field/index.d.ts +0 -1
- package/dist/components/checkbox-field/index.js +1 -2
- package/dist/components/checkbox-field/tsf-checkbox-field.d.ts +2 -2
- package/dist/components/checkbox-group-field/checkbox-group-field.d.ts +4 -1
- package/dist/components/checkbox-group-field/checkbox-group-field.js +54 -50
- package/dist/components/checkbox-group-field/checkbox-group.d.ts +7 -2
- package/dist/components/checkbox-group-field/checkbox-group.js +8 -3
- package/dist/components/collapsible/collapsible.css +23 -18
- package/dist/components/collapsible/collapsible.d.ts +18 -3
- package/dist/components/collapsible/collapsible.js +85 -32
- package/dist/components/collapsible/collapsible.module.js +7 -7
- package/dist/components/combobox-field/combobox-field.d.ts +9 -1
- package/dist/components/combobox-field/combobox-field.js +195 -175
- package/dist/components/combobox-field/combobox-items.d.ts +2 -2
- package/dist/components/combobox-field/combobox-items.js +4 -4
- package/dist/components/combobox-field/combobox.css +99 -96
- package/dist/components/combobox-field/combobox.d.ts +94 -15
- package/dist/components/combobox-field/combobox.js +484 -159
- package/dist/components/combobox-field/combobox.module.js +21 -21
- package/dist/components/combobox-field/index.d.ts +0 -1
- package/dist/components/combobox-field/selection.d.ts +4 -1
- package/dist/components/combobox-field/value-state-view.css +7 -3
- package/dist/components/combobox-field/value-state-view.d.ts +4 -2
- package/dist/components/combobox-field/value-state-view.js +15 -15
- package/dist/components/combobox-field/value-state-view.module.js +6 -4
- package/dist/components/composer/composer-attachments.d.ts +11 -3
- package/dist/components/composer/composer-attachments.js +61 -47
- package/dist/components/composer/composer-editor.d.ts +2 -1
- package/dist/components/composer/composer-editor.js +79 -71
- package/dist/components/composer/composer-mentions.js +2 -2
- package/dist/components/composer/composer.d.ts +42 -21
- package/dist/components/composer/composer.js +201 -58
- package/dist/components/composer/mention-text.js +3 -3
- package/dist/components/confirm-dialog/confirm-dialog.d.ts +8 -7
- package/dist/components/confirm-dialog/confirm-dialog.js +10 -9
- package/dist/components/conversation/conversation.context.d.ts +0 -5
- package/dist/components/conversation/conversation.d.ts +63 -29
- package/dist/components/conversation/conversation.js +193 -82
- package/dist/components/conversation/index.d.ts +1 -1
- package/dist/components/date-field/date-field.d.ts +10 -4
- package/dist/components/date-field/date-field.js +57 -43
- package/dist/components/date-field/date-input.d.ts +20 -3
- package/dist/components/date-field/date-input.js +28 -13
- package/dist/components/date-field/index.d.ts +1 -1
- package/dist/components/date-field/tsf-date-field.d.ts +1 -1
- package/dist/components/date-field/tsf-date-field.js +1 -1
- package/dist/components/date-range-field/date-range-field.d.ts +8 -4
- package/dist/components/date-range-field/date-range-field.js +57 -45
- package/dist/components/date-range-field/date-range-input.d.ts +20 -3
- package/dist/components/date-range-field/date-range-input.js +27 -12
- package/dist/components/date-range-field/tsf-date-range-field.d.ts +1 -1
- package/dist/components/date-range-field/tsf-date-range-field.js +1 -1
- package/dist/components/detail-list/detail-list.d.ts +28 -27
- package/dist/components/detail-list/detail-list.js +177 -121
- package/dist/components/dialog/dialog.d.ts +47 -27
- package/dist/components/dialog/dialog.js +101 -38
- package/dist/components/divider/divider.js +1 -1
- package/dist/components/drawer/drawer.d.ts +48 -30
- package/dist/components/drawer/drawer.js +113 -41
- package/dist/components/email-field/email-field.d.ts +5 -3
- package/dist/components/email-field/email-field.js +1 -3
- package/dist/components/email-field/tsf-email-field.d.ts +3 -2
- package/dist/components/empty-message/empty-message.d.ts +3 -3
- package/dist/components/empty-message/empty-message.js +3 -3
- package/dist/components/error-boundary/error-boundary.d.ts +5 -2
- package/dist/components/error-boundary/error-boundary.js +2 -3
- package/dist/components/error-message/error-message.d.ts +1 -1
- package/dist/components/error-message/error-message.js +1 -1
- package/dist/components/error-text/error-text.js +3 -3
- package/dist/components/field/field.d.ts +5 -5
- package/dist/components/field/field.js +9 -9
- package/dist/components/field/index.js +2 -2
- package/dist/components/field/input-parts.js +1 -1
- package/dist/components/field-placeholder/field-placeholder.d.ts +4 -1
- package/dist/components/field-placeholder/field-placeholder.js +41 -26
- package/dist/components/fieldset/field-group.js +1 -1
- package/dist/components/fieldset/fieldset-root.js +1 -1
- package/dist/components/fieldset/fieldset.css +4 -3
- package/dist/components/fieldset/fieldset.js +1 -1
- package/dist/components/fieldset/fieldset.module.js +2 -2
- package/dist/components/file-field/file-field.css +19 -15
- package/dist/components/file-field/file-field.d.ts +10 -1
- package/dist/components/file-field/file-field.js +130 -109
- package/dist/components/file-field/file-field.module.js +6 -4
- package/dist/components/file-field/file-input.d.ts +32 -9
- package/dist/components/file-field/file-input.js +94 -74
- package/dist/components/filter-bar/filter-bar.d.ts +79 -51
- package/dist/components/filter-bar/filter-bar.js +552 -216
- package/dist/components/form/form.d.ts +4 -6
- package/dist/components/form/form.js +6 -8
- package/dist/components/icon/icon.d.ts +5 -10
- package/dist/components/icon/icon.js +4 -6
- package/dist/components/link/link.js +1 -1
- package/dist/components/link-button/link-button.d.ts +1 -2
- package/dist/components/link-button/link-button.js +12 -22
- package/dist/components/loading-message/loading-message.d.ts +2 -2
- package/dist/components/loading-message/loading-message.js +1 -1
- package/dist/components/locale-provider/locale-provider.js +1 -1
- package/dist/components/menu/menu.d.ts +40 -22
- package/dist/components/menu/menu.js +100 -40
- package/dist/components/nav/nav-context.d.ts +0 -1
- package/dist/components/nav/nav-context.js +1 -2
- package/dist/components/nav/nav-item-view.d.ts +7 -7
- package/dist/components/nav/nav-item-view.js +27 -51
- package/dist/components/nav/nav.css +72 -60
- package/dist/components/nav/nav.d.ts +15 -8
- package/dist/components/nav/nav.js +105 -52
- package/dist/components/nav/nav.module.js +14 -14
- package/dist/components/number-field/number-field.d.ts +7 -1
- package/dist/components/number-field/number-field.js +98 -82
- package/dist/components/number-field/number-input.d.ts +53 -4
- package/dist/components/number-field/number-input.js +68 -21
- package/dist/components/number-field/tsf-number-field.d.ts +1 -1
- package/dist/components/number-field/tsf-number-field.js +1 -1
- package/dist/components/otp-field/otp-input.d.ts +25 -0
- package/dist/components/otp-field/otp-input.js +26 -1
- package/dist/components/pagination/pagination.d.ts +82 -23
- package/dist/components/pagination/pagination.js +656 -229
- package/dist/components/password-field/password-field.d.ts +7 -1
- package/dist/components/password-field/password-field.js +117 -126
- package/dist/components/password-field/password-strength.js +1 -1
- package/dist/components/password-field/tsf-password-field.d.ts +1 -1
- package/dist/components/password-field/tsf-password-field.js +1 -1
- package/dist/components/photo-field/photo-field.d.ts +17 -3
- package/dist/components/photo-field/photo-field.js +168 -89
- package/dist/components/photo-field/photo-input-context.d.ts +25 -0
- package/dist/components/photo-field/photo-input-context.js +14 -0
- package/dist/components/photo-field/photo-input.d.ts +58 -23
- package/dist/components/photo-field/photo-input.js +459 -261
- package/dist/components/popover/popover.d.ts +55 -23
- package/dist/components/popover/popover.js +205 -61
- package/dist/components/radio-group-field/radio-group.js +1 -1
- package/dist/components/search-field/search-field.d.ts +7 -5
- package/dist/components/search-field/search-field.js +4 -6
- package/dist/components/search-field/tsf-search-field.d.ts +1 -1
- package/dist/components/search-field/tsf-search-field.js +1 -1
- package/dist/components/segmented-control-field/segmented-control.js +1 -1
- package/dist/components/select-field/select-field.d.ts +7 -1
- package/dist/components/select-field/select-field.js +151 -139
- package/dist/components/select-field/select.d.ts +28 -6
- package/dist/components/select-field/select.js +234 -149
- package/dist/components/skeleton/skeleton.js +1 -1
- package/dist/components/spinner/spinner.css +47 -1
- package/dist/components/spinner/spinner.js +28 -11
- package/dist/components/spinner/spinner.module.js +18 -3
- package/dist/components/stale/stale.d.ts +17 -21
- package/dist/components/stale/stale.js +307 -129
- package/dist/components/status-message/status-message.css +22 -21
- package/dist/components/status-message/status-message.d.ts +10 -5
- package/dist/components/status-message/status-message.js +20 -24
- package/dist/components/status-message/status-message.module.js +6 -6
- package/dist/components/status-message/status-preset.d.ts +4 -5
- package/dist/components/status-message/status-preset.js +3 -3
- package/dist/components/switch-field/switch.js +1 -1
- package/dist/components/tabs/tabs.d.ts +51 -28
- package/dist/components/tabs/tabs.js +219 -144
- package/dist/components/tag/tag.css +23 -21
- package/dist/components/tag/tag.d.ts +17 -15
- package/dist/components/tag/tag.js +140 -65
- package/dist/components/tag/tag.module.js +3 -3
- package/dist/components/tag-group/tag-group.css +30 -27
- package/dist/components/tag-group/tag-group.d.ts +10 -4
- package/dist/components/tag-group/tag-group.js +47 -35
- package/dist/components/tag-group/tag-group.module.js +4 -4
- package/dist/components/text-field/text-field.d.ts +14 -3
- package/dist/components/text-field/text-field.js +154 -133
- package/dist/components/text-field/text-input.d.ts +89 -3
- package/dist/components/text-field/text-input.js +184 -70
- package/dist/components/textarea-field/textarea.js +1 -1
- package/dist/components/time-field/time-input.d.ts +6 -0
- package/dist/components/time-field/time-input.js +6 -0
- package/dist/components/time-zone-provider/time-zone-provider.js +1 -1
- package/dist/components/toast/index.js +2 -2
- package/dist/components/toast/toast-provider.css +38 -34
- package/dist/components/toast/toast-provider.d.ts +65 -3
- package/dist/components/toast/toast-provider.js +313 -148
- package/dist/components/toast/toast-provider.module.js +11 -17
- package/dist/components/toast/toast.d.ts +5 -1
- package/dist/components/toast/toast.js +2 -1
- package/dist/components/toggle-group-field/toggle-group.js +1 -1
- package/dist/components/tooltip/tooltip.d.ts +6 -6
- package/dist/components/tooltip/tooltip.js +7 -7
- package/dist/data-table/data-table-content.d.ts +18 -10
- package/dist/data-table/data-table-content.js +145 -290
- package/dist/data-table/data-table-context.d.ts +4 -2
- package/dist/data-table/data-table-context.js +1 -1
- package/dist/data-table/data-table-parts.d.ts +99 -0
- package/dist/data-table/data-table-parts.js +1182 -0
- package/dist/data-table/data-table-selection.d.ts +7 -3
- package/dist/data-table/data-table-selection.js +62 -37
- package/dist/data-table/data-table.css +100 -95
- package/dist/data-table/data-table.d.ts +49 -25
- package/dist/data-table/data-table.js +95 -83
- package/dist/data-table/data-table.module.js +34 -34
- package/dist/data-table/index.d.ts +2 -1
- package/dist/data-table/index.js +2 -1
- package/dist/data-view/use-data-view.d.ts +2 -2
- package/dist/data-view/use-data-view.js +2 -2
- package/dist/index.js +7 -8
- package/dist/lib/calendar/calendar-navigation.d.ts +9 -2
- package/dist/lib/calendar/calendar-navigation.js +72 -73
- package/dist/lib/calendar/calendar-year.d.ts +4 -3
- package/dist/lib/calendar/calendar-year.js +137 -156
- package/dist/lib/calendar/temporal.d.ts +18 -12
- package/dist/lib/calendar/temporal.js +191 -147
- package/dist/lib/table-storage.d.ts +2 -2
- package/dist/lib/table-storage.js +2 -2
- package/dist/lib/unsaved-changes/leave-guard.js +1 -1
- package/dist/terrazzo/index.d.ts +16 -0
- package/dist/terrazzo/index.js +94 -2
- package/dist/tokens.css +71 -69
- package/package.json +3 -2
- package/tokens/ref.tokens.json +0 -30
- package/tokens/sys.tokens.json +0 -7
- package/dist/assets/spinner.js +0 -28
- package/dist/components/checkbox-field/checkbox-glyph.d.ts +0 -12
- package/dist/components/checkbox-field/checkbox-glyph.js +0 -38
- package/dist/components/combobox-field/combobox-popup-body.d.ts +0 -34
- package/dist/components/combobox-field/combobox-popup-body.js +0 -142
- package/dist/components/conversation/conversation.context.js +0 -4
- package/dist/vendor/@material-design-icons/svg/outlined/add.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/arrow_downward.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/arrow_forward.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/arrow_upward.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/attach_file.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/block.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/calendar_today.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/check.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/check_circle.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/chevron_left.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/chevron_right.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/close.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/content_copy.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/date_range.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/description.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/download.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/error.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/error_outline.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/expand_less.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/expand_more.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/filter_alt.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/filter_alt_off.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/first_page.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/info.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/keyboard_arrow_down.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/last_page.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/mail.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/more_horiz.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/photo_camera.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/remove.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/restart_alt.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/restore.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/search.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/unfold_more.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/upload_file.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/visibility.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/visibility_off.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/warning_amber.js +0 -12
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import SvgCheck from "../../vendor/@material-design-icons/svg/outlined/check.js";
|
|
2
|
-
import SvgClose from "../../vendor/@material-design-icons/svg/outlined/close.js";
|
|
3
|
-
import SvgContentCopy from "../../vendor/@material-design-icons/svg/outlined/content_copy.js";
|
|
4
|
-
import SvgErrorOutline from "../../vendor/@material-design-icons/svg/outlined/error_outline.js";
|
|
5
1
|
import { lengthTone } from "../../lib/text-length.js";
|
|
6
2
|
import { Button } from "../button/button.js";
|
|
7
3
|
import { Field } from "../field/field.js";
|
|
@@ -13,12 +9,19 @@ import { focusControlOnRim } from "../field/rim-focus.js";
|
|
|
13
9
|
import { TextInputContext, useTextInputContext } from "./text-input-context.js";
|
|
14
10
|
import text_field_module_default from "./text-field.module.js";
|
|
15
11
|
import { c } from "react/compiler-runtime";
|
|
16
|
-
import { useRef, useState } from "react";
|
|
17
|
-
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
18
12
|
import { clsx } from "clsx";
|
|
13
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
+
import { useRef, useState } from "react";
|
|
19
15
|
import { Input } from "@base-ui/react/input";
|
|
20
16
|
// src/components/text-field/text-input.tsx
|
|
21
17
|
var COPIED_FEEDBACK_MS = 2e3;
|
|
18
|
+
/**
|
|
19
|
+
* The field frame around a text input, holding its value and projecting its
|
|
20
|
+
* state onto every part.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* <TextInput.Root value={value} onValueChange={setValue} optionalLabel="optional">…</TextInput.Root>
|
|
24
|
+
*/
|
|
22
25
|
var TextInputRoot = (t0) => {
|
|
23
26
|
const $ = c(41);
|
|
24
27
|
const { value, onValueChange, disabled, readOnly, requiredness, optionalLabel, errors, dirty, touched, pending: t1, maxLength, state, className, children } = t0;
|
|
@@ -157,6 +160,12 @@ var TextInputRoot = (t0) => {
|
|
|
157
160
|
} else t15 = $[40];
|
|
158
161
|
return t15;
|
|
159
162
|
};
|
|
163
|
+
/**
|
|
164
|
+
* The bordered box holding the control and its inlays.
|
|
165
|
+
*
|
|
166
|
+
* @example
|
|
167
|
+
* <TextInput.Group><TextInput.Input /></TextInput.Group>
|
|
168
|
+
*/
|
|
160
169
|
var TextInputGroup = (t0) => {
|
|
161
170
|
const $ = c(15);
|
|
162
171
|
let children;
|
|
@@ -207,6 +216,12 @@ var TextInputGroup = (t0) => {
|
|
|
207
216
|
} else t3 = $[14];
|
|
208
217
|
return t3;
|
|
209
218
|
};
|
|
219
|
+
/**
|
|
220
|
+
* A strip of inlays along the bottom edge of the group.
|
|
221
|
+
*
|
|
222
|
+
* @example
|
|
223
|
+
* <TextInput.Bar><TextInput.Counter /></TextInput.Bar>
|
|
224
|
+
*/
|
|
210
225
|
var TextInputBar = (t0) => {
|
|
211
226
|
const $ = c(8);
|
|
212
227
|
let className;
|
|
@@ -238,6 +253,12 @@ var TextInputBar = (t0) => {
|
|
|
238
253
|
} else t2 = $[7];
|
|
239
254
|
return t2;
|
|
240
255
|
};
|
|
256
|
+
/**
|
|
257
|
+
* A slot beside the control inside the group, such as an icon.
|
|
258
|
+
*
|
|
259
|
+
* @example
|
|
260
|
+
* <TextInput.Inlay aria-hidden="true"><SearchIcon /></TextInput.Inlay>
|
|
261
|
+
*/
|
|
241
262
|
var TextInputInlay = (t0) => {
|
|
242
263
|
const $ = c(8);
|
|
243
264
|
let className;
|
|
@@ -269,6 +290,12 @@ var TextInputInlay = (t0) => {
|
|
|
269
290
|
} else t2 = $[7];
|
|
270
291
|
return t2;
|
|
271
292
|
};
|
|
293
|
+
/**
|
|
294
|
+
* Static text beside the control, such as a unit. Decoration only.
|
|
295
|
+
*
|
|
296
|
+
* @example
|
|
297
|
+
* <TextInput.Affix>kg</TextInput.Affix>
|
|
298
|
+
*/
|
|
272
299
|
var TextInputAffix = (t0) => {
|
|
273
300
|
const $ = c(8);
|
|
274
301
|
let className;
|
|
@@ -301,6 +328,12 @@ var TextInputAffix = (t0) => {
|
|
|
301
328
|
} else t2 = $[7];
|
|
302
329
|
return t2;
|
|
303
330
|
};
|
|
331
|
+
/**
|
|
332
|
+
* The bare control, bound to `Root`'s value.
|
|
333
|
+
*
|
|
334
|
+
* @example
|
|
335
|
+
* <TextInput.Input type="email" />
|
|
336
|
+
*/
|
|
304
337
|
var TextInputInput = (t0) => {
|
|
305
338
|
const $ = c(18);
|
|
306
339
|
let className;
|
|
@@ -362,9 +395,15 @@ var TextInputInput = (t0) => {
|
|
|
362
395
|
} else t7 = $[17];
|
|
363
396
|
return t7;
|
|
364
397
|
};
|
|
398
|
+
/**
|
|
399
|
+
* The icon-only button that empties the control, shown once it holds a value.
|
|
400
|
+
*
|
|
401
|
+
* @example
|
|
402
|
+
* <TextInput.Clear label="Clear"><CloseIcon /></TextInput.Clear>
|
|
403
|
+
*/
|
|
365
404
|
var TextInputClear = (t0) => {
|
|
366
|
-
const $ = c(
|
|
367
|
-
const { label, className } = t0;
|
|
405
|
+
const $ = c(10);
|
|
406
|
+
const { label, className, children } = t0;
|
|
368
407
|
const { value, setValue, state, focusControl } = useTextInputContext();
|
|
369
408
|
if (value === "" || state.disabled === true || state.readonly === true) return null;
|
|
370
409
|
let t1;
|
|
@@ -384,28 +423,24 @@ var TextInputClear = (t0) => {
|
|
|
384
423
|
$[4] = t2;
|
|
385
424
|
} else t2 = $[4];
|
|
386
425
|
let t3;
|
|
387
|
-
if ($[5] !==
|
|
426
|
+
if ($[5] !== children || $[6] !== label || $[7] !== t1 || $[8] !== t2) {
|
|
388
427
|
t3 = /* @__PURE__ */ jsx(Button, {
|
|
389
428
|
iconOnly: true,
|
|
390
|
-
icon:
|
|
429
|
+
icon: children,
|
|
391
430
|
label,
|
|
392
431
|
variant: "tertiary",
|
|
393
432
|
size: "sm",
|
|
394
433
|
className: t1,
|
|
395
434
|
onClick: t2
|
|
396
435
|
});
|
|
397
|
-
$[5] =
|
|
398
|
-
$[6] =
|
|
399
|
-
$[7] =
|
|
400
|
-
$[8] =
|
|
401
|
-
|
|
436
|
+
$[5] = children;
|
|
437
|
+
$[6] = label;
|
|
438
|
+
$[7] = t1;
|
|
439
|
+
$[8] = t2;
|
|
440
|
+
$[9] = t3;
|
|
441
|
+
} else t3 = $[9];
|
|
402
442
|
return t3;
|
|
403
443
|
};
|
|
404
|
-
var COPY_ICON = {
|
|
405
|
-
idle: SvgContentCopy,
|
|
406
|
-
copied: SvgCheck,
|
|
407
|
-
failed: SvgErrorOutline
|
|
408
|
-
};
|
|
409
444
|
/**
|
|
410
445
|
* Writes text to the clipboard, rejecting where there is no clipboard as well
|
|
411
446
|
* as where the browser refuses.
|
|
@@ -414,9 +449,16 @@ var COPY_ICON = {
|
|
|
414
449
|
* void writeClipboard("NL91ABNA0417164300").catch(selectByHand);
|
|
415
450
|
*/
|
|
416
451
|
var writeClipboard = async (text) => navigator.clipboard.writeText(text);
|
|
452
|
+
/**
|
|
453
|
+
* The icon-only button that copies the value to the clipboard, shown once it
|
|
454
|
+
* holds one, and announces whether the copy landed.
|
|
455
|
+
*
|
|
456
|
+
* @example
|
|
457
|
+
* <TextInput.Copy label="Copy" copiedLabel="Copied" failedLabel="Copy failed, text selected"><CopyIcon /></TextInput.Copy>
|
|
458
|
+
*/
|
|
417
459
|
var TextInputCopy = (t0) => {
|
|
418
|
-
const $ = c(
|
|
419
|
-
const { label, copiedLabel, failedLabel, className } = t0;
|
|
460
|
+
const $ = c(25);
|
|
461
|
+
const { label, copiedLabel, failedLabel, copiedIcon, failedIcon, className, children } = t0;
|
|
420
462
|
const { value, state, selectControl } = useTextInputContext();
|
|
421
463
|
const [outcome, setOutcome] = useState("idle");
|
|
422
464
|
if (value === "" || state.disabled === true) return null;
|
|
@@ -442,66 +484,135 @@ var TextInputCopy = (t0) => {
|
|
|
442
484
|
$[4] = t2;
|
|
443
485
|
} else t2 = $[4];
|
|
444
486
|
const labels = t2;
|
|
445
|
-
const t3 =
|
|
446
|
-
const t4 =
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
487
|
+
const t3 = copiedIcon ?? children;
|
|
488
|
+
const t4 = failedIcon ?? children;
|
|
489
|
+
let t5;
|
|
490
|
+
if ($[5] !== children || $[6] !== t3 || $[7] !== t4) {
|
|
491
|
+
t5 = {
|
|
492
|
+
idle: children,
|
|
493
|
+
copied: t3,
|
|
494
|
+
failed: t4
|
|
495
|
+
};
|
|
496
|
+
$[5] = children;
|
|
497
|
+
$[6] = t3;
|
|
498
|
+
$[7] = t4;
|
|
499
|
+
$[8] = t5;
|
|
500
|
+
} else t5 = $[8];
|
|
501
|
+
const t6 = t5[outcome];
|
|
502
|
+
const t7 = labels[outcome];
|
|
503
|
+
const t8 = outcome === "failed" ? "danger" : "brand";
|
|
504
|
+
let t9;
|
|
505
|
+
if ($[9] !== className) {
|
|
506
|
+
t9 = clsx(text_field_module_default.action, className);
|
|
507
|
+
$[9] = className;
|
|
508
|
+
$[10] = t9;
|
|
509
|
+
} else t9 = $[10];
|
|
510
|
+
let t10;
|
|
511
|
+
if ($[11] !== selectControl || $[12] !== value) {
|
|
512
|
+
t10 = () => {
|
|
457
513
|
writeClipboard(value).then(() => settle("copied"), () => {
|
|
458
514
|
selectControl();
|
|
459
515
|
settle("failed");
|
|
460
516
|
});
|
|
461
517
|
};
|
|
462
|
-
$[
|
|
463
|
-
$[
|
|
464
|
-
$[
|
|
465
|
-
} else
|
|
466
|
-
let
|
|
467
|
-
if ($[
|
|
468
|
-
|
|
518
|
+
$[11] = selectControl;
|
|
519
|
+
$[12] = value;
|
|
520
|
+
$[13] = t10;
|
|
521
|
+
} else t10 = $[13];
|
|
522
|
+
let t11;
|
|
523
|
+
if ($[14] !== t10 || $[15] !== t6 || $[16] !== t7 || $[17] !== t8 || $[18] !== t9) {
|
|
524
|
+
t11 = /* @__PURE__ */ jsx(Button, {
|
|
469
525
|
iconOnly: true,
|
|
470
|
-
icon:
|
|
471
|
-
label:
|
|
472
|
-
tone:
|
|
526
|
+
icon: t6,
|
|
527
|
+
label: t7,
|
|
528
|
+
tone: t8,
|
|
473
529
|
variant: "tertiary",
|
|
474
530
|
size: "sm",
|
|
475
|
-
className:
|
|
476
|
-
onClick:
|
|
531
|
+
className: t9,
|
|
532
|
+
onClick: t10
|
|
477
533
|
});
|
|
478
|
-
$[
|
|
479
|
-
$[
|
|
480
|
-
$[
|
|
481
|
-
$[
|
|
482
|
-
$[
|
|
483
|
-
$[
|
|
484
|
-
} else
|
|
485
|
-
const
|
|
486
|
-
let
|
|
487
|
-
if ($[
|
|
488
|
-
|
|
534
|
+
$[14] = t10;
|
|
535
|
+
$[15] = t6;
|
|
536
|
+
$[16] = t7;
|
|
537
|
+
$[17] = t8;
|
|
538
|
+
$[18] = t9;
|
|
539
|
+
$[19] = t11;
|
|
540
|
+
} else t11 = $[19];
|
|
541
|
+
const t12 = outcome === "idle" ? "" : labels[outcome];
|
|
542
|
+
let t13;
|
|
543
|
+
if ($[20] !== t12) {
|
|
544
|
+
t13 = /* @__PURE__ */ jsx("span", {
|
|
489
545
|
role: "status",
|
|
490
546
|
className: text_field_module_default.copyStatus,
|
|
491
|
-
children:
|
|
547
|
+
children: t12
|
|
492
548
|
});
|
|
493
|
-
$[
|
|
494
|
-
$[
|
|
495
|
-
} else
|
|
496
|
-
let
|
|
497
|
-
if ($[
|
|
498
|
-
|
|
499
|
-
$[
|
|
500
|
-
$[
|
|
501
|
-
$[
|
|
502
|
-
} else
|
|
503
|
-
return
|
|
549
|
+
$[20] = t12;
|
|
550
|
+
$[21] = t13;
|
|
551
|
+
} else t13 = $[21];
|
|
552
|
+
let t14;
|
|
553
|
+
if ($[22] !== t11 || $[23] !== t13) {
|
|
554
|
+
t14 = /* @__PURE__ */ jsxs(Fragment, { children: [t11, t13] });
|
|
555
|
+
$[22] = t11;
|
|
556
|
+
$[23] = t13;
|
|
557
|
+
$[24] = t14;
|
|
558
|
+
} else t14 = $[24];
|
|
559
|
+
return t14;
|
|
504
560
|
};
|
|
561
|
+
/**
|
|
562
|
+
* The icon-only toggle that shows a concealed value, such as a password, as
|
|
563
|
+
* text. The caller switches the `Input`'s `type` with `revealed`.
|
|
564
|
+
*
|
|
565
|
+
* @example
|
|
566
|
+
* <TextInput.Reveal revealed={revealed} onRevealedChange={setRevealed} label="Show password"><VisibilityIcon /></TextInput.Reveal>
|
|
567
|
+
*/
|
|
568
|
+
var TextInputReveal = (t0) => {
|
|
569
|
+
const $ = c(12);
|
|
570
|
+
const { revealed, onRevealedChange, label, className, children } = t0;
|
|
571
|
+
const { state } = useTextInputContext();
|
|
572
|
+
const t1 = state.disabled;
|
|
573
|
+
let t2;
|
|
574
|
+
if ($[0] !== className) {
|
|
575
|
+
t2 = clsx(text_field_module_default.action, className);
|
|
576
|
+
$[0] = className;
|
|
577
|
+
$[1] = t2;
|
|
578
|
+
} else t2 = $[1];
|
|
579
|
+
let t3;
|
|
580
|
+
if ($[2] !== onRevealedChange || $[3] !== revealed) {
|
|
581
|
+
t3 = () => onRevealedChange(!revealed);
|
|
582
|
+
$[2] = onRevealedChange;
|
|
583
|
+
$[3] = revealed;
|
|
584
|
+
$[4] = t3;
|
|
585
|
+
} else t3 = $[4];
|
|
586
|
+
let t4;
|
|
587
|
+
if ($[5] !== children || $[6] !== label || $[7] !== revealed || $[8] !== state.disabled || $[9] !== t2 || $[10] !== t3) {
|
|
588
|
+
t4 = /* @__PURE__ */ jsx(Button, {
|
|
589
|
+
iconOnly: true,
|
|
590
|
+
icon: children,
|
|
591
|
+
label,
|
|
592
|
+
variant: "tertiary",
|
|
593
|
+
size: "sm",
|
|
594
|
+
"aria-pressed": revealed,
|
|
595
|
+
disabled: t1,
|
|
596
|
+
className: t2,
|
|
597
|
+
onClick: t3
|
|
598
|
+
});
|
|
599
|
+
$[5] = children;
|
|
600
|
+
$[6] = label;
|
|
601
|
+
$[7] = revealed;
|
|
602
|
+
$[8] = state.disabled;
|
|
603
|
+
$[9] = t2;
|
|
604
|
+
$[10] = t3;
|
|
605
|
+
$[11] = t4;
|
|
606
|
+
} else t4 = $[11];
|
|
607
|
+
return t4;
|
|
608
|
+
};
|
|
609
|
+
/**
|
|
610
|
+
* The value's length against `Root`'s `maxLength`, toned as it nears the limit.
|
|
611
|
+
* Renders nothing without a `maxLength`.
|
|
612
|
+
*
|
|
613
|
+
* @example
|
|
614
|
+
* <TextInput.Counter />
|
|
615
|
+
*/
|
|
505
616
|
var TextInputCounter = (t0) => {
|
|
506
617
|
const $ = c(14);
|
|
507
618
|
let className;
|
|
@@ -565,7 +676,9 @@ var TextInputCounter = (t0) => {
|
|
|
565
676
|
* <TextInput.Label>Email</TextInput.Label>
|
|
566
677
|
* <TextInput.Group>
|
|
567
678
|
* <TextInput.Input type="email" />
|
|
568
|
-
* <TextInput.Clear label="Clear"
|
|
679
|
+
* <TextInput.Clear label="Clear">
|
|
680
|
+
* <CloseIcon />
|
|
681
|
+
* </TextInput.Clear>
|
|
569
682
|
* </TextInput.Group>
|
|
570
683
|
* <TextInput.Error />
|
|
571
684
|
* </TextInput.Root>
|
|
@@ -580,6 +693,7 @@ var TextInput = {
|
|
|
580
693
|
Input: TextInputInput,
|
|
581
694
|
Clear: TextInputClear,
|
|
582
695
|
Copy: TextInputCopy,
|
|
696
|
+
Reveal: TextInputReveal,
|
|
583
697
|
Counter: TextInputCounter,
|
|
584
698
|
Pending: InputPending,
|
|
585
699
|
Description: Field.Description,
|
|
@@ -4,8 +4,8 @@ import text_field_module_default from "../text-field/text-field.module.js";
|
|
|
4
4
|
import { useAutosize } from "./use-autosize.js";
|
|
5
5
|
import textarea_field_module_default from "./textarea-field.module.js";
|
|
6
6
|
import { c } from "react/compiler-runtime";
|
|
7
|
-
import { jsx } from "react/jsx-runtime";
|
|
8
7
|
import { clsx } from "clsx";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
9
|
// src/components/textarea-field/textarea.tsx
|
|
10
10
|
var MIN_ROWS = 2;
|
|
11
11
|
/**
|
|
@@ -4,6 +4,12 @@ import { type TimeFieldProps as AriaTimeFieldProps } from "react-aria-components
|
|
|
4
4
|
import { TemporalFrame, TemporalGroup, TemporalInput, TemporalSegment, type TemporalStateProps } from "../../lib/calendar/temporal.tsx";
|
|
5
5
|
import { Field } from "../field/index.ts";
|
|
6
6
|
export type TimeInputRootProps = AriaTimeFieldProps<Time> & TemporalStateProps;
|
|
7
|
+
/**
|
|
8
|
+
* A react-aria `TimeField` holding the value.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* <TimeInput.Root aria-labelledby={labelId}>…</TimeInput.Root>
|
|
12
|
+
*/
|
|
7
13
|
declare const TimeInputRoot: ({ state, ...props }: TimeInputRootProps) => ReactNode;
|
|
8
14
|
/** The parts of a time input. */
|
|
9
15
|
export type TimeInputParts = Readonly<{
|
|
@@ -5,6 +5,12 @@ import { c } from "react/compiler-runtime";
|
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
import { TimeField } from "react-aria-components";
|
|
7
7
|
// src/components/time-field/time-input.tsx
|
|
8
|
+
/**
|
|
9
|
+
* A react-aria `TimeField` holding the value.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* <TimeInput.Root aria-labelledby={labelId}>…</TimeInput.Root>
|
|
13
|
+
*/
|
|
8
14
|
var TimeInputRoot = (t0) => {
|
|
9
15
|
const $ = c(10);
|
|
10
16
|
let props;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useRequiredContext } from "../../lib/use-required-context.js";
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
|
-
import { createContext } from "react";
|
|
4
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { createContext } from "react";
|
|
5
5
|
// src/components/time-zone-provider/time-zone-provider.tsx
|
|
6
6
|
var TimeZoneContext = createContext(void 0);
|
|
7
7
|
/**
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { toast, toastManager } from "./toast.js";
|
|
2
|
-
import { ToastProvider } from "./toast-provider.js";
|
|
3
|
-
export { ToastProvider, toast, toastManager };
|
|
2
|
+
import { Toast, ToastProvider } from "./toast-provider.js";
|
|
3
|
+
export { Toast, ToastProvider, toast, toastManager };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
@layer kit.reset, kit.base, kit.components;
|
|
2
2
|
@layer kit.components {
|
|
3
|
-
.
|
|
3
|
+
._viewport_x67qw_3 {
|
|
4
4
|
position: fixed;
|
|
5
5
|
inset-block: auto var(--toast-viewport-inset, var(--sys-unit-16));
|
|
6
6
|
inset-inline: auto var(--toast-viewport-inset, var(--sys-unit-16));
|
|
@@ -9,16 +9,20 @@
|
|
|
9
9
|
gap: var(--sys-unit-8);
|
|
10
10
|
inline-size: var(--toast-width, min(24rem, 100vw - 2rem));
|
|
11
11
|
}
|
|
12
|
-
.
|
|
12
|
+
._viewport_x67qw_3 {
|
|
13
13
|
outline: 0 solid var(--sys-color-focus-ring);
|
|
14
14
|
outline-offset: var(--sys-focus-ring-offset);
|
|
15
15
|
}
|
|
16
|
-
.
|
|
16
|
+
._viewport_x67qw_3:focus-visible {
|
|
17
17
|
outline-width: var(--sys-focus-ring-width);
|
|
18
18
|
}
|
|
19
|
-
.
|
|
19
|
+
._toast_x67qw_19 {
|
|
20
20
|
--_toast-fg: var(--sys-color-text);
|
|
21
21
|
--_toast-bg: var(--sys-color-surface-overlay-high);
|
|
22
|
+
display: grid;
|
|
23
|
+
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
24
|
+
align-items: center;
|
|
25
|
+
row-gap: var(--sys-unit-6);
|
|
22
26
|
box-sizing: border-box;
|
|
23
27
|
border-radius: var(--toast-radius, var(--sys-radius-md));
|
|
24
28
|
background: var(--toast-bg, var(--_toast-bg));
|
|
@@ -28,72 +32,72 @@
|
|
|
28
32
|
font: var(--sys-font-body-medium);
|
|
29
33
|
}
|
|
30
34
|
@media not (prefers-reduced-motion) {
|
|
31
|
-
.
|
|
35
|
+
._toast_x67qw_19 {
|
|
32
36
|
transition: opacity var(--sys-motion-short) var(--sys-motion-standard), scale var(--sys-motion-short) var(--sys-motion-emphasized);
|
|
33
37
|
}
|
|
34
38
|
}
|
|
35
|
-
.
|
|
39
|
+
._toast_x67qw_19[data-starting-style], ._toast_x67qw_19[data-ending-style] {
|
|
36
40
|
opacity: 0;
|
|
37
41
|
scale: 0.8;
|
|
38
42
|
}
|
|
39
|
-
.
|
|
43
|
+
._toast_x67qw_19[data-tone=success] {
|
|
40
44
|
--_toast-fg: var(--sys-color-success-fg);
|
|
41
45
|
--_toast-bg: var(--sys-color-success-bg);
|
|
42
46
|
}
|
|
43
|
-
.
|
|
47
|
+
._toast_x67qw_19[data-tone=error] {
|
|
44
48
|
--_toast-fg: var(--sys-color-error-fg);
|
|
45
49
|
--_toast-bg: var(--sys-color-error-bg);
|
|
46
50
|
}
|
|
47
|
-
.
|
|
51
|
+
._toast_x67qw_19[data-tone=warning] {
|
|
48
52
|
--_toast-fg: var(--sys-color-warning-fg);
|
|
49
53
|
--_toast-bg: var(--sys-color-warning-bg);
|
|
50
54
|
}
|
|
51
|
-
.
|
|
55
|
+
._toast_x67qw_19[data-tone=info] {
|
|
52
56
|
--_toast-fg: var(--sys-color-info-fg);
|
|
53
57
|
--_toast-bg: var(--sys-color-info-bg);
|
|
54
58
|
}
|
|
55
|
-
.
|
|
56
|
-
display: flex;
|
|
57
|
-
flex-
|
|
58
|
-
|
|
59
|
+
._icon_x67qw_59 {
|
|
60
|
+
display: inline-flex;
|
|
61
|
+
flex-shrink: 0;
|
|
62
|
+
grid-area: 1/1;
|
|
63
|
+
margin-inline-end: var(--sys-unit-4);
|
|
64
|
+
font-size: var(--toast-icon-size, 1.2em);
|
|
59
65
|
}
|
|
60
|
-
.
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
66
|
+
._icon_x67qw_59 > svg {
|
|
67
|
+
inline-size: 1em;
|
|
68
|
+
block-size: 1em;
|
|
69
|
+
fill: currentcolor;
|
|
64
70
|
}
|
|
65
|
-
.
|
|
66
|
-
|
|
67
|
-
flex: 1;
|
|
68
|
-
align-items: center;
|
|
69
|
-
gap: var(--sys-unit-4);
|
|
71
|
+
._title_x67qw_71 {
|
|
72
|
+
grid-area: 1/2;
|
|
70
73
|
min-inline-size: 0;
|
|
71
|
-
}
|
|
72
|
-
._title_r09x9_72 {
|
|
73
74
|
font: var(--sys-font-label-medium);
|
|
74
75
|
}
|
|
75
|
-
.
|
|
76
|
+
._close_x67qw_76 {
|
|
77
|
+
--btn-fg: var(--toast-fg, var(--_toast-fg));
|
|
78
|
+
grid-area: 1/3;
|
|
79
|
+
margin-inline-start: var(--sys-unit-6);
|
|
80
|
+
}
|
|
81
|
+
._description_x67qw_81 {
|
|
82
|
+
grid-column: 1/-1;
|
|
76
83
|
font: var(--sys-font-body-medium);
|
|
77
84
|
text-wrap: pretty;
|
|
78
85
|
}
|
|
79
|
-
.
|
|
86
|
+
._actions_x67qw_86 {
|
|
80
87
|
display: flex;
|
|
88
|
+
grid-column: 1/-1;
|
|
81
89
|
gap: var(--sys-unit-4);
|
|
82
90
|
margin-block-start: var(--sys-unit-2);
|
|
83
91
|
}
|
|
84
|
-
.
|
|
85
|
-
--btn-fg: var(--toast-fg, var(--_toast-fg));
|
|
86
|
-
flex-shrink: 0;
|
|
87
|
-
}
|
|
88
|
-
._action_r09x9_79[data-variant=primary] {
|
|
92
|
+
._actions_x67qw_86 > [data-variant=primary] {
|
|
89
93
|
--btn-bg: var(--toast-fg, var(--_toast-fg));
|
|
90
94
|
--btn-fg: var(--toast-bg, var(--_toast-bg));
|
|
91
95
|
}
|
|
92
|
-
.
|
|
96
|
+
._actions_x67qw_86 > [data-variant=secondary] {
|
|
93
97
|
--btn-bg: var(--sys-color-surface-overlay-high);
|
|
94
98
|
--btn-fg: var(--toast-fg, var(--_toast-fg));
|
|
95
99
|
}
|
|
96
|
-
.
|
|
100
|
+
._actions_x67qw_86 > [data-variant=tertiary] {
|
|
97
101
|
--btn-fg: var(--toast-fg, var(--_toast-fg));
|
|
98
102
|
}
|
|
99
103
|
}
|
|
@@ -1,9 +1,70 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { Toast as BaseToast, type ToastRootToastObject } from "@base-ui/react/toast";
|
|
2
|
+
import { type ComponentPropsWithRef, type ReactNode } from "react";
|
|
3
|
+
import { type ToastData } from "./toast.ts";
|
|
4
|
+
/** One toast in the viewport, as `ToastProvider` hands it to `renderToast`. */
|
|
5
|
+
export type ToastObject = ToastRootToastObject<ToastData>;
|
|
6
|
+
export type ToastRootProps = Omit<BaseToast.Root.Props, "toast" | "className"> & Readonly<{
|
|
7
|
+
/** The toast this frame shows, as `renderToast` received it. */
|
|
8
|
+
toast: ToastObject;
|
|
9
|
+
className?: string;
|
|
10
|
+
}>;
|
|
11
|
+
/** A toast's frame, in its tone: a dialog that holds the other parts. */
|
|
12
|
+
declare const Root: ({ toast, className, ...props }: ToastRootProps) => ReactNode;
|
|
13
|
+
export type ToastIconProps = ComponentPropsWithRef<"span">;
|
|
14
|
+
/** The caller's glyph before the title, sized and coloured by the toast. Renders nothing without children. */
|
|
15
|
+
declare const Icon: ({ className, children, ...props }: ToastIconProps) => ReactNode;
|
|
16
|
+
export type ToastTitleProps = Omit<BaseToast.Title.Props, "className"> & Readonly<{
|
|
17
|
+
className?: string;
|
|
18
|
+
}>;
|
|
19
|
+
/** The toast's heading, which names its dialog. */
|
|
20
|
+
declare const Title: ({ className, ...props }: ToastTitleProps) => ReactNode;
|
|
21
|
+
export type ToastDescriptionProps = Omit<BaseToast.Description.Props, "className"> & Readonly<{
|
|
22
|
+
className?: string;
|
|
23
|
+
}>;
|
|
24
|
+
/** The text under the title, which describes its dialog. */
|
|
25
|
+
declare const Description: ({ className, ...props }: ToastDescriptionProps) => ReactNode;
|
|
26
|
+
export type ToastActionsProps = ComponentPropsWithRef<"div">;
|
|
27
|
+
/** The row of buttons under the text, re-coloured for the toast's tone. */
|
|
28
|
+
declare const Actions: ({ className, ...props }: ToastActionsProps) => ReactNode;
|
|
29
|
+
export type ToastCloseProps = Readonly<{
|
|
30
|
+
/** Accessible name, such as "Close", surfaced as the tooltip hint and the `aria-label`. */
|
|
31
|
+
label: string;
|
|
32
|
+
/** The close glyph. */
|
|
33
|
+
children: ReactNode;
|
|
34
|
+
className?: string;
|
|
35
|
+
}>;
|
|
36
|
+
/** The icon-only button that closes the toast, named for every input. */
|
|
37
|
+
declare const Close: ({ label, children, className, }: ToastCloseProps) => ReactNode;
|
|
38
|
+
/** The parts of a toast, for `ToastProvider`'s `renderToast`. */
|
|
39
|
+
export type ToastParts = Readonly<{
|
|
40
|
+
Root: typeof Root;
|
|
41
|
+
Icon: typeof Icon;
|
|
42
|
+
Title: typeof Title;
|
|
43
|
+
Description: typeof Description;
|
|
44
|
+
Actions: typeof Actions;
|
|
45
|
+
Close: typeof Close;
|
|
46
|
+
}>;
|
|
47
|
+
/**
|
|
48
|
+
* The parts of one toast: the `Root` frame in its tone, the `Icon`, `Title`,
|
|
49
|
+
* `Description` and `Actions`, and the `Close` button.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* <Toast.Root toast={toast}>
|
|
53
|
+
* <Toast.Title>{toast.data?.body}</Toast.Title>
|
|
54
|
+
* <Toast.Close label="Close"><CloseIcon /></Toast.Close>
|
|
55
|
+
* </Toast.Root>
|
|
56
|
+
*/
|
|
57
|
+
export declare const Toast: ToastParts;
|
|
2
58
|
export type ToastProviderProps = Readonly<{
|
|
3
59
|
/** Accessible name of each toast's close button, also its tooltip. */
|
|
4
60
|
closeLabel: string;
|
|
61
|
+
/** The close button's glyph. */
|
|
62
|
+
closeIcon: ReactNode;
|
|
5
63
|
/** Accessible name of the region the toasts appear in, reached with F6. */
|
|
6
64
|
viewportLabel: string;
|
|
65
|
+
/** Draws each toast from the `Toast` parts, in place of the default. */
|
|
66
|
+
renderToast?: (toast: ToastObject) => ReactNode;
|
|
67
|
+
/** The app, which the viewport renders beside. */
|
|
7
68
|
children: ReactNode;
|
|
8
69
|
}>;
|
|
9
70
|
/**
|
|
@@ -11,8 +72,9 @@ export type ToastProviderProps = Readonly<{
|
|
|
11
72
|
* {@link toastManager} to base-ui and renders the viewport alongside the app.
|
|
12
73
|
*
|
|
13
74
|
* @example
|
|
14
|
-
* <ToastProvider closeLabel="Close" viewportLabel="Notifications">
|
|
75
|
+
* <ToastProvider closeLabel="Close" closeIcon={<CloseIcon />} viewportLabel="Notifications">
|
|
15
76
|
* <App />
|
|
16
77
|
* </ToastProvider>
|
|
17
78
|
*/
|
|
18
|
-
export declare const ToastProvider: ({ closeLabel, viewportLabel, children, }: ToastProviderProps) => ReactNode;
|
|
79
|
+
export declare const ToastProvider: ({ closeLabel, closeIcon, viewportLabel, renderToast, children, }: ToastProviderProps) => ReactNode;
|
|
80
|
+
export {};
|