@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,17 +1,15 @@
|
|
|
1
|
-
import SvgAttachFile from "../../vendor/@material-design-icons/svg/outlined/attach_file.js";
|
|
2
|
-
import SvgUploadFile from "../../vendor/@material-design-icons/svg/outlined/upload_file.js";
|
|
3
1
|
import { AttachmentTile } from "../attachment-tile/attachment-tile.js";
|
|
4
2
|
import { Button as Button$1 } from "../button/button.js";
|
|
5
3
|
import { Field } from "../field/field.js";
|
|
6
4
|
import { fieldStateAttributes } from "../field/field-state.js";
|
|
7
|
-
import { Icon } from "../icon/icon.js";
|
|
8
5
|
import file_field_module_default from "./file-field.module.js";
|
|
9
6
|
import { c } from "react/compiler-runtime";
|
|
10
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
7
|
import { clsx } from "clsx";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
9
|
import { Button, DropZone, FileTrigger, TagGroup, TagList } from "react-aria-components";
|
|
13
10
|
import { Fieldset } from "@base-ui/react/fieldset";
|
|
14
11
|
// src/components/file-field/file-input.tsx
|
|
12
|
+
/** The fieldset around the file input, which projects its state as `data-*` attributes. */
|
|
15
13
|
var FileInputRoot = (t0) => {
|
|
16
14
|
const $ = c(15);
|
|
17
15
|
let disabled;
|
|
@@ -62,6 +60,7 @@ var FileInputRoot = (t0) => {
|
|
|
62
60
|
} else t4 = $[14];
|
|
63
61
|
return t4;
|
|
64
62
|
};
|
|
63
|
+
/** The legend that names the fieldset. */
|
|
65
64
|
var FileInputLegend = (props) => {
|
|
66
65
|
const $ = c(3);
|
|
67
66
|
let t0;
|
|
@@ -81,6 +80,7 @@ var FileInputLegend = (props) => {
|
|
|
81
80
|
} else t1 = $[2];
|
|
82
81
|
return t1;
|
|
83
82
|
};
|
|
83
|
+
/** The area files are dropped on, holding the hint, the picker button and the staged files. */
|
|
84
84
|
var FileInputDropTarget = (t0) => {
|
|
85
85
|
const $ = c(14);
|
|
86
86
|
let className;
|
|
@@ -129,120 +129,132 @@ var FileInputDropTarget = (t0) => {
|
|
|
129
129
|
} else t4 = $[13];
|
|
130
130
|
return t4;
|
|
131
131
|
};
|
|
132
|
+
/** The prompt inside the drop target, with an optional `icon` above it. */
|
|
132
133
|
var FileInputHint = (t0) => {
|
|
133
|
-
const $ = c(
|
|
134
|
+
const $ = c(14);
|
|
134
135
|
let children;
|
|
135
136
|
let className;
|
|
137
|
+
let icon;
|
|
136
138
|
let props;
|
|
137
139
|
if ($[0] !== t0) {
|
|
138
|
-
({className, children, ...props} = t0);
|
|
140
|
+
({className, icon, children, ...props} = t0);
|
|
139
141
|
$[0] = t0;
|
|
140
142
|
$[1] = children;
|
|
141
143
|
$[2] = className;
|
|
142
|
-
$[3] =
|
|
144
|
+
$[3] = icon;
|
|
145
|
+
$[4] = props;
|
|
143
146
|
} else {
|
|
144
147
|
children = $[1];
|
|
145
148
|
className = $[2];
|
|
146
|
-
|
|
149
|
+
icon = $[3];
|
|
150
|
+
props = $[4];
|
|
147
151
|
}
|
|
148
152
|
let t1;
|
|
149
|
-
if ($[
|
|
153
|
+
if ($[5] !== className) {
|
|
150
154
|
t1 = clsx(file_field_module_default.hint, className);
|
|
151
|
-
$[
|
|
152
|
-
$[
|
|
153
|
-
} else t1 = $[
|
|
155
|
+
$[5] = className;
|
|
156
|
+
$[6] = t1;
|
|
157
|
+
} else t1 = $[6];
|
|
154
158
|
let t2;
|
|
155
|
-
if ($[
|
|
156
|
-
t2 = /* @__PURE__ */ jsx(
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
159
|
+
if ($[7] !== icon) {
|
|
160
|
+
t2 = icon === void 0 ? null : /* @__PURE__ */ jsx("span", {
|
|
161
|
+
"aria-hidden": "true",
|
|
162
|
+
className: file_field_module_default.hintIcon,
|
|
163
|
+
children: icon
|
|
160
164
|
});
|
|
161
|
-
$[
|
|
162
|
-
|
|
165
|
+
$[7] = icon;
|
|
166
|
+
$[8] = t2;
|
|
167
|
+
} else t2 = $[8];
|
|
163
168
|
let t3;
|
|
164
|
-
if ($[
|
|
169
|
+
if ($[9] !== children || $[10] !== props || $[11] !== t1 || $[12] !== t2) {
|
|
165
170
|
t3 = /* @__PURE__ */ jsxs("p", {
|
|
166
171
|
className: t1,
|
|
167
172
|
...props,
|
|
168
173
|
children: [t2, children]
|
|
169
174
|
});
|
|
170
|
-
$[
|
|
171
|
-
$[
|
|
172
|
-
$[
|
|
173
|
-
$[
|
|
174
|
-
|
|
175
|
+
$[9] = children;
|
|
176
|
+
$[10] = props;
|
|
177
|
+
$[11] = t1;
|
|
178
|
+
$[12] = t2;
|
|
179
|
+
$[13] = t3;
|
|
180
|
+
} else t3 = $[13];
|
|
175
181
|
return t3;
|
|
176
182
|
};
|
|
183
|
+
/** The button that opens the file dialog. */
|
|
177
184
|
var FileInputTrigger = (t0) => {
|
|
178
|
-
const $ = c(
|
|
185
|
+
const $ = c(22);
|
|
179
186
|
let buttonRef;
|
|
180
187
|
let describedBy;
|
|
181
188
|
let disabled;
|
|
189
|
+
let icon;
|
|
182
190
|
let invalid;
|
|
183
191
|
let label;
|
|
184
192
|
let props;
|
|
185
193
|
if ($[0] !== t0) {
|
|
186
|
-
({label, disabled, describedBy, buttonRef, invalid, ...props} = t0);
|
|
194
|
+
({label, disabled, describedBy, buttonRef, invalid, icon, ...props} = t0);
|
|
187
195
|
$[0] = t0;
|
|
188
196
|
$[1] = buttonRef;
|
|
189
197
|
$[2] = describedBy;
|
|
190
198
|
$[3] = disabled;
|
|
191
|
-
$[4] =
|
|
192
|
-
$[5] =
|
|
193
|
-
$[6] =
|
|
199
|
+
$[4] = icon;
|
|
200
|
+
$[5] = invalid;
|
|
201
|
+
$[6] = label;
|
|
202
|
+
$[7] = props;
|
|
194
203
|
} else {
|
|
195
204
|
buttonRef = $[1];
|
|
196
205
|
describedBy = $[2];
|
|
197
206
|
disabled = $[3];
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
207
|
+
icon = $[4];
|
|
208
|
+
invalid = $[5];
|
|
209
|
+
label = $[6];
|
|
210
|
+
props = $[7];
|
|
201
211
|
}
|
|
202
212
|
const t1 = invalid === true ? "invalid" : void 0;
|
|
203
213
|
let t2;
|
|
204
|
-
if ($[
|
|
214
|
+
if ($[8] !== t1) {
|
|
205
215
|
t2 = fieldStateAttributes({ validity: t1 });
|
|
206
|
-
$[
|
|
207
|
-
$[
|
|
208
|
-
} else t2 = $[
|
|
216
|
+
$[8] = t1;
|
|
217
|
+
$[9] = t2;
|
|
218
|
+
} else t2 = $[9];
|
|
209
219
|
let t3;
|
|
210
|
-
if ($[
|
|
220
|
+
if ($[10] !== disabled) {
|
|
211
221
|
t3 = /* @__PURE__ */ jsx(Button, { isDisabled: disabled });
|
|
212
|
-
$[
|
|
213
|
-
$[
|
|
214
|
-
} else t3 = $[
|
|
222
|
+
$[10] = disabled;
|
|
223
|
+
$[11] = t3;
|
|
224
|
+
} else t3 = $[11];
|
|
215
225
|
let t4;
|
|
216
|
-
if ($[
|
|
226
|
+
if ($[12] !== buttonRef || $[13] !== describedBy || $[14] !== icon || $[15] !== label || $[16] !== t2 || $[17] !== t3) {
|
|
217
227
|
t4 = /* @__PURE__ */ jsx(Button$1, {
|
|
218
228
|
variant: "secondary",
|
|
219
229
|
size: "sm",
|
|
220
|
-
icon
|
|
230
|
+
icon,
|
|
221
231
|
ref: buttonRef,
|
|
222
232
|
"aria-describedby": describedBy,
|
|
223
233
|
...t2,
|
|
224
234
|
render: t3,
|
|
225
235
|
children: label
|
|
226
236
|
});
|
|
227
|
-
$[
|
|
228
|
-
$[
|
|
229
|
-
$[
|
|
230
|
-
$[
|
|
231
|
-
$[
|
|
232
|
-
$[
|
|
233
|
-
|
|
237
|
+
$[12] = buttonRef;
|
|
238
|
+
$[13] = describedBy;
|
|
239
|
+
$[14] = icon;
|
|
240
|
+
$[15] = label;
|
|
241
|
+
$[16] = t2;
|
|
242
|
+
$[17] = t3;
|
|
243
|
+
$[18] = t4;
|
|
244
|
+
} else t4 = $[18];
|
|
234
245
|
let t5;
|
|
235
|
-
if ($[
|
|
246
|
+
if ($[19] !== props || $[20] !== t4) {
|
|
236
247
|
t5 = /* @__PURE__ */ jsx(FileTrigger, {
|
|
237
248
|
...props,
|
|
238
249
|
children: t4
|
|
239
250
|
});
|
|
240
|
-
$[
|
|
241
|
-
$[
|
|
242
|
-
$[
|
|
243
|
-
} else t5 = $[
|
|
251
|
+
$[19] = props;
|
|
252
|
+
$[20] = t4;
|
|
253
|
+
$[21] = t5;
|
|
254
|
+
} else t5 = $[21];
|
|
244
255
|
return t5;
|
|
245
256
|
};
|
|
257
|
+
/** The staged files, as a group of removable tiles. */
|
|
246
258
|
var FileInputList = (t0) => {
|
|
247
259
|
const $ = c(9);
|
|
248
260
|
const { label, onRemove, children, className } = t0;
|
|
@@ -276,29 +288,37 @@ var FileInputList = (t0) => {
|
|
|
276
288
|
} else t3 = $[8];
|
|
277
289
|
return t3;
|
|
278
290
|
};
|
|
291
|
+
/** One staged file as an `AttachmentTile`. */
|
|
279
292
|
var FileInputItem = (t0) => {
|
|
280
|
-
const $ = c(
|
|
281
|
-
|
|
293
|
+
const $ = c(8);
|
|
294
|
+
let props;
|
|
295
|
+
let t1;
|
|
296
|
+
let t2;
|
|
297
|
+
if ($[0] !== t0) {
|
|
298
|
+
({invalid: t1, disabled: t2, ...props} = t0);
|
|
299
|
+
$[0] = t0;
|
|
300
|
+
$[1] = props;
|
|
301
|
+
$[2] = t1;
|
|
302
|
+
$[3] = t2;
|
|
303
|
+
} else {
|
|
304
|
+
props = $[1];
|
|
305
|
+
t1 = $[2];
|
|
306
|
+
t2 = $[3];
|
|
307
|
+
}
|
|
282
308
|
const invalid = t1 === void 0 ? false : t1;
|
|
283
309
|
const disabled = t2 === void 0 ? false : t2;
|
|
284
310
|
let t3;
|
|
285
|
-
if ($[
|
|
311
|
+
if ($[4] !== disabled || $[5] !== invalid || $[6] !== props) {
|
|
286
312
|
t3 = /* @__PURE__ */ jsx(AttachmentTile, {
|
|
287
|
-
id,
|
|
288
|
-
file,
|
|
289
|
-
hint,
|
|
290
|
-
removeLabel,
|
|
291
313
|
invalid,
|
|
292
|
-
disabled
|
|
314
|
+
disabled,
|
|
315
|
+
...props
|
|
293
316
|
});
|
|
294
|
-
$[
|
|
295
|
-
$[
|
|
296
|
-
$[
|
|
297
|
-
$[
|
|
298
|
-
|
|
299
|
-
$[5] = removeLabel;
|
|
300
|
-
$[6] = t3;
|
|
301
|
-
} else t3 = $[6];
|
|
317
|
+
$[4] = disabled;
|
|
318
|
+
$[5] = invalid;
|
|
319
|
+
$[6] = props;
|
|
320
|
+
$[7] = t3;
|
|
321
|
+
} else t3 = $[7];
|
|
302
322
|
return t3;
|
|
303
323
|
};
|
|
304
324
|
/**
|
|
@@ -311,10 +331,10 @@ var FileInputItem = (t0) => {
|
|
|
311
331
|
* <FileInput.Root state={{ requiredness: "optional" }}>
|
|
312
332
|
* <FileInput.Legend optionalLabel="optional">Attachments</FileInput.Legend>
|
|
313
333
|
* <FileInput.DropTarget aria-label="Drop zone for attachments" onDrop={onDrop}>
|
|
314
|
-
* <FileInput.Hint>Drag files here</FileInput.Hint>
|
|
315
|
-
* <FileInput.Trigger label="Choose files" onSelect={onSelect} />
|
|
334
|
+
* <FileInput.Hint icon={<UploadFileIcon />}>Drag files here</FileInput.Hint>
|
|
335
|
+
* <FileInput.Trigger label="Choose files" icon={<AttachFileIcon />} onSelect={onSelect} />
|
|
316
336
|
* <FileInput.List label="Files for attachments" onRemove={onRemove}>
|
|
317
|
-
* <FileInput.Item id={id} file={file} hint="invoice.pdf (12 kB)" removeLabel="Remove" />
|
|
337
|
+
* <FileInput.Item id={id} file={file} hint="invoice.pdf (12 kB)" removeLabel="Remove" removeIcon={<CloseIcon />} />
|
|
318
338
|
* </FileInput.List>
|
|
319
339
|
* </FileInput.DropTarget>
|
|
320
340
|
* </FileInput.Root>
|
|
@@ -1,85 +1,113 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
2
|
+
import { type ComponentProps, type ReactElement, type ReactNode } from "react";
|
|
3
|
+
import { type BadgeProps } from "../badge/badge.tsx";
|
|
4
|
+
import { type SearchFieldProps } from "../search-field/search-field.tsx";
|
|
2
5
|
import type { FilterView } from "./use-filter-view.ts";
|
|
3
|
-
export type FilterBarRootProps<TFilters extends object> = Readonly<{
|
|
6
|
+
export type FilterBarRootProps<TFilters extends object> = useRender.ComponentProps<"search"> & Readonly<{
|
|
4
7
|
filters: FilterView<TFilters>;
|
|
5
8
|
children: ReactNode;
|
|
6
|
-
className?: string;
|
|
7
|
-
}>;
|
|
8
|
-
declare const Root: <TFilters extends object>({ filters, children, className, }: FilterBarRootProps<TFilters>) => ReactNode;
|
|
9
|
-
export type FilterBarSearchProps = Readonly<{
|
|
10
|
-
/** Names the field and fills its placeholder, such as "Search clients". */
|
|
11
|
-
label: string;
|
|
12
|
-
/** The clear button's name and tooltip, such as "Clear search". */
|
|
13
|
-
clearLabel: string;
|
|
14
|
-
/** The word an optional field's label trails, such as "optional", which every field takes. */
|
|
15
|
-
optionalLabel: string;
|
|
16
|
-
className?: string;
|
|
17
9
|
}>;
|
|
10
|
+
/** The `<search>` landmark holding a `useFilterView` for the parts inside it. */
|
|
11
|
+
declare const Root: <TFilters extends object>({ filters, render, className, ref, ...props }: FilterBarRootProps<TFilters>) => ReactNode;
|
|
12
|
+
export type FilterBarSearchProps = Omit<SearchFieldProps, "value" | "onValueChange">;
|
|
18
13
|
/**
|
|
19
|
-
* The live search input
|
|
20
|
-
* narrows as you type, debounced by
|
|
21
|
-
*
|
|
14
|
+
* The live search input, a `SearchField` bound to the view's search. Search is
|
|
15
|
+
* not part of the Apply/Cancel bargain: it narrows as you type, debounced by
|
|
16
|
+
* the view. Its label is hidden and fills the placeholder unless told otherwise.
|
|
22
17
|
*/
|
|
23
|
-
declare const Search: ({ label,
|
|
18
|
+
declare const Search: ({ label, labelHidden, placeholder, className, ...props }: FilterBarSearchProps) => ReactNode;
|
|
24
19
|
export type FilterBarDrawerProps = Readonly<{
|
|
25
|
-
/** The
|
|
20
|
+
/** The trigger and the drawer's content: `FilterBar.Trigger` and `FilterBar.Content`. */
|
|
26
21
|
children: ReactNode;
|
|
27
22
|
/**
|
|
28
23
|
* Where the drawer comes from: `"right"` for a side panel, `"down"` for a
|
|
29
24
|
* bottom sheet, for example from the app's own viewport query.
|
|
30
25
|
*/
|
|
31
26
|
swipeDirection: "right" | "down";
|
|
32
|
-
/** The trigger's label, such as "Filters". */
|
|
33
|
-
triggerLabel: string;
|
|
34
|
-
/** The drawer's title, such as "Filter clients". */
|
|
35
|
-
title: string;
|
|
36
|
-
/** The close button's name and tooltip, such as "Close". */
|
|
37
|
-
closeLabel: string;
|
|
38
|
-
/** The button that restores the initial filters, such as "Reset". */
|
|
39
|
-
resetLabel: string;
|
|
40
|
-
/** The button that commits the draft, such as "Apply". */
|
|
41
|
-
applyLabel: string;
|
|
42
|
-
className?: string;
|
|
43
27
|
}>;
|
|
44
28
|
/**
|
|
45
|
-
* The apply-gated half: a
|
|
46
|
-
*
|
|
47
|
-
* drawer discards the draft, and Reset puts it back to the initial filters
|
|
48
|
-
* without closing.
|
|
29
|
+
* The apply-gated half: a `Drawer.Root` whose draft `FilterBar.Apply` commits.
|
|
30
|
+
* Dismissing the drawer any other way discards the draft.
|
|
49
31
|
*/
|
|
50
|
-
declare const FilterDrawer: ({ children, swipeDirection,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
32
|
+
declare const FilterDrawer: ({ children, swipeDirection, }: FilterBarDrawerProps) => ReactNode;
|
|
33
|
+
/** What the action buttons of a filter bar take. */
|
|
34
|
+
export type FilterBarButtonProps = Omit<ComponentProps<"button">, "ref" | "children"> & Readonly<{
|
|
35
|
+
/** The glyph leading the label. */
|
|
36
|
+
icon?: ReactNode;
|
|
37
|
+
/** The button's label. */
|
|
38
|
+
children: ReactNode;
|
|
39
|
+
}>;
|
|
40
|
+
/** The button that opens the drawer, such as "Filters" with a `FilterBar.Badge`. */
|
|
41
|
+
declare const Trigger: ({ icon, children, ...props }: FilterBarButtonProps) => ReactNode;
|
|
42
|
+
export type FilterBarBadgeProps = Omit<BadgeProps, "children">;
|
|
43
|
+
/** How many filters are applied, for the trigger. Renders nothing while none are. */
|
|
44
|
+
declare const FilterBadge: ({ tone, variant, ...props }: FilterBarBadgeProps) => ReactNode;
|
|
45
|
+
export type FilterBarContentProps = Readonly<{
|
|
46
|
+
/** The drawer's header, its `FilterBar.Fields` and its `FilterBar.Footer`. */
|
|
47
|
+
children: ReactNode;
|
|
56
48
|
className?: string;
|
|
57
49
|
}>;
|
|
50
|
+
/** The drawer itself: its portal, backdrop, viewport and popup, around the content. */
|
|
51
|
+
declare const Content: ({ children, className, }: FilterBarContentProps) => ReactNode;
|
|
52
|
+
export type FilterBarFieldsProps = useRender.ComponentProps<"div">;
|
|
53
|
+
/** The filter controls, bound to the view's `draft`, in a column. */
|
|
54
|
+
declare const Fields: ({ render, className, ref, ...props }: FilterBarFieldsProps) => ReactElement;
|
|
55
|
+
export type FilterBarFooterProps = useRender.ComponentProps<"div">;
|
|
56
|
+
/** The drawer's actions, `FilterBar.Reset` and `FilterBar.Apply`, at its end. */
|
|
57
|
+
declare const Footer: ({ render, className, ref, ...props }: FilterBarFooterProps) => ReactElement;
|
|
58
|
+
/** Puts the draft back to the initial filters, without closing the drawer. */
|
|
59
|
+
declare const Reset: ({ icon, children, onClick, ...props }: FilterBarButtonProps) => ReactNode;
|
|
60
|
+
/** Commits the draft and closes the drawer. */
|
|
61
|
+
declare const Apply: ({ icon, children, onClick, ...props }: FilterBarButtonProps) => ReactNode;
|
|
62
|
+
export type FilterBarActiveProps = useRender.ComponentProps<"div">;
|
|
58
63
|
/**
|
|
59
|
-
* The applied-filter row: the chips for what is
|
|
60
|
-
*
|
|
61
|
-
*
|
|
64
|
+
* The applied-filter row, on a line of its own: the chips for what is
|
|
65
|
+
* narrowing the list, such as an `ActiveFilters`, and `FilterBar.ClearAll`.
|
|
66
|
+
* Renders nothing while nothing narrows the list.
|
|
62
67
|
*/
|
|
63
|
-
declare const Active: ({
|
|
68
|
+
declare const Active: ({ render, className, ref, ...props }: FilterBarActiveProps) => ReactElement | null;
|
|
69
|
+
/** Clears every committed filter and the search. */
|
|
70
|
+
declare const ClearAll: ({ icon, children, onClick, ...props }: FilterBarButtonProps) => ReactNode;
|
|
64
71
|
type FilterBarParts = Readonly<{
|
|
65
72
|
Root: typeof Root;
|
|
66
73
|
Search: typeof Search;
|
|
67
74
|
Drawer: typeof FilterDrawer;
|
|
75
|
+
Trigger: typeof Trigger;
|
|
76
|
+
Badge: typeof FilterBadge;
|
|
77
|
+
Content: typeof Content;
|
|
78
|
+
Fields: typeof Fields;
|
|
79
|
+
Footer: typeof Footer;
|
|
80
|
+
Reset: typeof Reset;
|
|
81
|
+
Apply: typeof Apply;
|
|
68
82
|
Active: typeof Active;
|
|
83
|
+
ClearAll: typeof ClearAll;
|
|
69
84
|
}>;
|
|
70
85
|
/**
|
|
71
|
-
* Composite filter surface. `Root` holds a `useFilterView` in context
|
|
72
|
-
*
|
|
73
|
-
*
|
|
86
|
+
* Composite filter surface. `Root` holds a `useFilterView` in context: `Search`
|
|
87
|
+
* and the `Drawer` share the leading row, and `Active`, the applied-filter row,
|
|
88
|
+
* takes a line of its own. The drawer's header is the `Drawer` component's own
|
|
89
|
+
* `Drawer.Header`, `Drawer.Title` and `Drawer.CloseButton`.
|
|
74
90
|
*
|
|
75
91
|
* @example
|
|
76
92
|
* <FilterBar.Root filters={filters}>
|
|
77
|
-
* <FilterBar.Search label="Search clients" clearLabel="Clear search" optionalLabel="optional" />
|
|
78
|
-
* <FilterBar.Drawer swipeDirection={narrow ? "down" : "right"}
|
|
79
|
-
* <
|
|
93
|
+
* <FilterBar.Search label="Search clients" clearLabel="Clear search" clearIcon={<CloseIcon />} icon={<SearchIcon />} optionalLabel="optional" />
|
|
94
|
+
* <FilterBar.Drawer swipeDirection={narrow ? "down" : "right"}>
|
|
95
|
+
* <FilterBar.Trigger icon={<FilterIcon />}>Filters<FilterBar.Badge /></FilterBar.Trigger>
|
|
96
|
+
* <FilterBar.Content>
|
|
97
|
+
* <Drawer.Header>
|
|
98
|
+
* <Drawer.Title>Filter clients</Drawer.Title>
|
|
99
|
+
* <Drawer.CloseButton closeLabel="Close" icon={<CloseIcon />} />
|
|
100
|
+
* </Drawer.Header>
|
|
101
|
+
* <FilterBar.Fields><ClientFilterFields filters={filters} /></FilterBar.Fields>
|
|
102
|
+
* <FilterBar.Footer>
|
|
103
|
+
* <FilterBar.Reset>Reset</FilterBar.Reset>
|
|
104
|
+
* <FilterBar.Apply>Apply</FilterBar.Apply>
|
|
105
|
+
* </FilterBar.Footer>
|
|
106
|
+
* </FilterBar.Content>
|
|
80
107
|
* </FilterBar.Drawer>
|
|
81
|
-
* <FilterBar.Active
|
|
82
|
-
* <ActiveFilters filters={filters} describe={describers} label="Active filters" removeLabel="Remove" />
|
|
108
|
+
* <FilterBar.Active>
|
|
109
|
+
* <ActiveFilters filters={filters} describe={describers} label="Active filters" removeLabel="Remove" removeIcon={<CloseIcon />} />
|
|
110
|
+
* <FilterBar.ClearAll>Clear filters</FilterBar.ClearAll>
|
|
83
111
|
* </FilterBar.Active>
|
|
84
112
|
* </FilterBar.Root>
|
|
85
113
|
*/
|