@igne-agency/react-web-ui 0.3.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -1
- package/dist/base.css +3 -0
- 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.js +1 -1
- 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 +20 -3
- package/dist/terrazzo/index.js +110 -7
- package/dist/tokens.css +94 -71
- package/package.json +4 -3
- 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,21 +1,21 @@
|
|
|
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 SvgExpandMore from "../../vendor/@material-design-icons/svg/outlined/expand_more.js";
|
|
4
1
|
import { usePopupEdgePadding } from "../../lib/popup-edge-padding.js";
|
|
5
|
-
import {
|
|
2
|
+
import { useInfiniteScroll } from "../../lib/use-infinite-scroll.js";
|
|
3
|
+
import { Button as Button$1 } from "../button/button.js";
|
|
6
4
|
import { Field } from "../field/field.js";
|
|
7
5
|
import { fieldStateAttributes } from "../field/field-state.js";
|
|
8
6
|
import { useFieldFocus, withFieldFocus } from "../field/use-field-focus.js";
|
|
9
|
-
import {
|
|
7
|
+
import { Spinner } from "../spinner/spinner.js";
|
|
10
8
|
import { Tooltip } from "../tooltip/tooltip.js";
|
|
9
|
+
import { pagedProgress } from "./combobox-items.js";
|
|
11
10
|
import combobox_module_default from "./combobox.module.js";
|
|
12
11
|
import { c } from "react/compiler-runtime";
|
|
13
|
-
import { useRef } from "react";
|
|
14
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
12
|
import { clsx } from "clsx";
|
|
13
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
+
import { useRef } from "react";
|
|
16
15
|
import { Button, Tag, TagGroup, TagList } from "react-aria-components";
|
|
17
16
|
import { Combobox } from "@base-ui/react/combobox";
|
|
18
17
|
// src/components/combobox-field/combobox.tsx
|
|
18
|
+
/** The combobox's state, holding its items and its value. */
|
|
19
19
|
var ComboboxRoot = (t0) => {
|
|
20
20
|
const $ = c(6);
|
|
21
21
|
let props;
|
|
@@ -56,96 +56,126 @@ var focusTagAt = (control, edge) => {
|
|
|
56
56
|
var focusTrigger = (control) => {
|
|
57
57
|
control?.querySelector(TRIGGER_SELECTOR)?.focus();
|
|
58
58
|
};
|
|
59
|
+
/** The chevron at the end of the control. Its children are the icon; without them it renders nothing. */
|
|
60
|
+
var ComboboxIcon = (t0) => {
|
|
61
|
+
const $ = c(8);
|
|
62
|
+
let children;
|
|
63
|
+
let className;
|
|
64
|
+
let props;
|
|
65
|
+
if ($[0] !== t0) {
|
|
66
|
+
({className, children, ...props} = t0);
|
|
67
|
+
$[0] = t0;
|
|
68
|
+
$[1] = children;
|
|
69
|
+
$[2] = className;
|
|
70
|
+
$[3] = props;
|
|
71
|
+
} else {
|
|
72
|
+
children = $[1];
|
|
73
|
+
className = $[2];
|
|
74
|
+
props = $[3];
|
|
75
|
+
}
|
|
76
|
+
let t1;
|
|
77
|
+
if ($[4] !== children || $[5] !== className || $[6] !== props) {
|
|
78
|
+
t1 = children === void 0 || children === null || children === false ? null : /* @__PURE__ */ jsx(Combobox.Icon, {
|
|
79
|
+
className: clsx(combobox_module_default.icon, className),
|
|
80
|
+
...props,
|
|
81
|
+
children
|
|
82
|
+
});
|
|
83
|
+
$[4] = children;
|
|
84
|
+
$[5] = className;
|
|
85
|
+
$[6] = props;
|
|
86
|
+
$[7] = t1;
|
|
87
|
+
} else t1 = $[7];
|
|
88
|
+
return t1;
|
|
89
|
+
};
|
|
90
|
+
/** The control that opens the popup: the value or the tags, the pending mark and `icon`. */
|
|
59
91
|
var ComboboxControl = (t0) => {
|
|
60
|
-
const $ = c(
|
|
92
|
+
const $ = c(38);
|
|
61
93
|
let children;
|
|
62
94
|
let className;
|
|
95
|
+
let icon;
|
|
63
96
|
let props;
|
|
64
97
|
let t1;
|
|
65
98
|
let tags;
|
|
66
99
|
if ($[0] !== t0) {
|
|
67
|
-
({className, children, tags, state: t1, ...props} = t0);
|
|
100
|
+
({className, children, tags, icon, state: t1, ...props} = t0);
|
|
68
101
|
$[0] = t0;
|
|
69
102
|
$[1] = children;
|
|
70
103
|
$[2] = className;
|
|
71
|
-
$[3] =
|
|
72
|
-
$[4] =
|
|
73
|
-
$[5] =
|
|
104
|
+
$[3] = icon;
|
|
105
|
+
$[4] = props;
|
|
106
|
+
$[5] = t1;
|
|
107
|
+
$[6] = tags;
|
|
74
108
|
} else {
|
|
75
109
|
children = $[1];
|
|
76
110
|
className = $[2];
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
111
|
+
icon = $[3];
|
|
112
|
+
props = $[4];
|
|
113
|
+
t1 = $[5];
|
|
114
|
+
tags = $[6];
|
|
80
115
|
}
|
|
81
116
|
const state = t1 === void 0 ? NO_STATE : t1;
|
|
82
117
|
const focus = useFieldFocus(props);
|
|
83
118
|
let t2;
|
|
84
|
-
if ($[
|
|
119
|
+
if ($[7] !== focus || $[8] !== state) {
|
|
85
120
|
t2 = fieldStateAttributes(withFieldFocus(state, focus));
|
|
86
|
-
$[
|
|
87
|
-
$[
|
|
88
|
-
$[
|
|
89
|
-
} else t2 = $[
|
|
121
|
+
$[7] = focus;
|
|
122
|
+
$[8] = state;
|
|
123
|
+
$[9] = t2;
|
|
124
|
+
} else t2 = $[9];
|
|
90
125
|
let attributes;
|
|
91
126
|
let busy;
|
|
92
|
-
if ($[
|
|
127
|
+
if ($[10] !== t2) {
|
|
93
128
|
({"aria-busy": busy, ...attributes} = t2);
|
|
94
|
-
$[
|
|
95
|
-
$[
|
|
96
|
-
$[
|
|
129
|
+
$[10] = t2;
|
|
130
|
+
$[11] = attributes;
|
|
131
|
+
$[12] = busy;
|
|
97
132
|
} else {
|
|
98
|
-
attributes = $[
|
|
99
|
-
busy = $[
|
|
133
|
+
attributes = $[11];
|
|
134
|
+
busy = $[12];
|
|
100
135
|
}
|
|
101
136
|
const t3 = state.disabled === true || void 0;
|
|
102
137
|
let t4;
|
|
103
|
-
if ($[
|
|
138
|
+
if ($[13] !== className) {
|
|
104
139
|
t4 = clsx(combobox_module_default.control, className);
|
|
105
|
-
$[
|
|
106
|
-
$[
|
|
107
|
-
} else t4 = $[
|
|
140
|
+
$[13] = className;
|
|
141
|
+
$[14] = t4;
|
|
142
|
+
} else t4 = $[14];
|
|
108
143
|
let t5;
|
|
109
|
-
if ($[
|
|
144
|
+
if ($[15] !== tags) {
|
|
110
145
|
t5 = tags !== void 0 && /* @__PURE__ */ jsx("div", {
|
|
111
146
|
className: combobox_module_default.content,
|
|
112
147
|
onKeyDownCapture: _temp,
|
|
113
148
|
children: tags
|
|
114
149
|
});
|
|
115
|
-
$[
|
|
116
|
-
$[
|
|
117
|
-
} else t5 = $[
|
|
150
|
+
$[15] = tags;
|
|
151
|
+
$[16] = t5;
|
|
152
|
+
} else t5 = $[16];
|
|
118
153
|
const t6 = state.validity === "invalid" || void 0;
|
|
119
154
|
const t7 = tags === void 0 ? combobox_module_default.content : combobox_module_default.spokenValue;
|
|
120
155
|
let t8;
|
|
121
|
-
if ($[
|
|
156
|
+
if ($[17] !== children || $[18] !== t7) {
|
|
122
157
|
t8 = /* @__PURE__ */ jsx("span", {
|
|
123
158
|
className: t7,
|
|
124
159
|
children
|
|
125
160
|
});
|
|
126
|
-
$[
|
|
127
|
-
$[
|
|
128
|
-
$[
|
|
129
|
-
} else t8 = $[
|
|
161
|
+
$[17] = children;
|
|
162
|
+
$[18] = t7;
|
|
163
|
+
$[19] = t8;
|
|
164
|
+
} else t8 = $[19];
|
|
130
165
|
let t9;
|
|
131
|
-
if ($[
|
|
166
|
+
if ($[20] !== state.pending) {
|
|
132
167
|
t9 = state.pending === true && /* @__PURE__ */ jsx(Field.Pending, {});
|
|
133
|
-
$[
|
|
134
|
-
$[
|
|
135
|
-
} else t9 = $[
|
|
168
|
+
$[20] = state.pending;
|
|
169
|
+
$[21] = t9;
|
|
170
|
+
} else t9 = $[21];
|
|
136
171
|
let t10;
|
|
137
|
-
if ($[
|
|
138
|
-
t10 = /* @__PURE__ */ jsx(
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
label: ""
|
|
143
|
-
})
|
|
144
|
-
});
|
|
145
|
-
$[21] = t10;
|
|
146
|
-
} else t10 = $[21];
|
|
172
|
+
if ($[22] !== icon) {
|
|
173
|
+
t10 = /* @__PURE__ */ jsx(ComboboxIcon, { children: icon });
|
|
174
|
+
$[22] = icon;
|
|
175
|
+
$[23] = t10;
|
|
176
|
+
} else t10 = $[23];
|
|
147
177
|
let t11;
|
|
148
|
-
if ($[
|
|
178
|
+
if ($[24] !== busy || $[25] !== t10 || $[26] !== t6 || $[27] !== t8 || $[28] !== t9) {
|
|
149
179
|
t11 = /* @__PURE__ */ jsxs(Combobox.Trigger, {
|
|
150
180
|
"data-combobox-trigger": "",
|
|
151
181
|
"aria-invalid": t6,
|
|
@@ -158,14 +188,15 @@ var ComboboxControl = (t0) => {
|
|
|
158
188
|
t10
|
|
159
189
|
]
|
|
160
190
|
});
|
|
161
|
-
$[
|
|
162
|
-
$[
|
|
163
|
-
$[
|
|
164
|
-
$[
|
|
165
|
-
$[
|
|
166
|
-
|
|
191
|
+
$[24] = busy;
|
|
192
|
+
$[25] = t10;
|
|
193
|
+
$[26] = t6;
|
|
194
|
+
$[27] = t8;
|
|
195
|
+
$[28] = t9;
|
|
196
|
+
$[29] = t11;
|
|
197
|
+
} else t11 = $[29];
|
|
167
198
|
let t12;
|
|
168
|
-
if ($[
|
|
199
|
+
if ($[30] !== attributes || $[31] !== focus.props || $[32] !== props || $[33] !== t11 || $[34] !== t3 || $[35] !== t4 || $[36] !== t5) {
|
|
169
200
|
t12 = /* @__PURE__ */ jsxs(Combobox.InputGroup, {
|
|
170
201
|
"data-combobox-control": "",
|
|
171
202
|
"aria-disabled": t3,
|
|
@@ -175,20 +206,21 @@ var ComboboxControl = (t0) => {
|
|
|
175
206
|
...focus.props,
|
|
176
207
|
children: [t5, t11]
|
|
177
208
|
});
|
|
178
|
-
$[
|
|
179
|
-
$[
|
|
180
|
-
$[
|
|
181
|
-
$[
|
|
182
|
-
$[
|
|
183
|
-
$[
|
|
184
|
-
$[
|
|
185
|
-
$[
|
|
186
|
-
} else t12 = $[
|
|
209
|
+
$[30] = attributes;
|
|
210
|
+
$[31] = focus.props;
|
|
211
|
+
$[32] = props;
|
|
212
|
+
$[33] = t11;
|
|
213
|
+
$[34] = t3;
|
|
214
|
+
$[35] = t4;
|
|
215
|
+
$[36] = t5;
|
|
216
|
+
$[37] = t12;
|
|
217
|
+
} else t12 = $[37];
|
|
187
218
|
return t12;
|
|
188
219
|
};
|
|
220
|
+
/** The chosen values of a multiple combobox as removable tags, for `Control`'s `tags`. */
|
|
189
221
|
var ComboboxTags = (t0) => {
|
|
190
|
-
const $ = c(
|
|
191
|
-
const { label, items, itemKey, itemLabel, removeLabel, removeHint, children, onRemove, disabled: t1, readOnly: t2 } = t0;
|
|
222
|
+
const $ = c(33);
|
|
223
|
+
const { label, items, itemKey, itemLabel, removeLabel, removeHint, removeIcon, children, onRemove, disabled: t1, readOnly: t2 } = t0;
|
|
192
224
|
const disabled = t1 === void 0 ? false : t1;
|
|
193
225
|
const readOnly = t2 === void 0 ? false : t2;
|
|
194
226
|
const ref = useRef(null);
|
|
@@ -215,9 +247,9 @@ var ComboboxTags = (t0) => {
|
|
|
215
247
|
$[8] = t4;
|
|
216
248
|
} else t4 = $[8];
|
|
217
249
|
let t5;
|
|
218
|
-
if ($[9] !== children || $[10] !== itemKey || $[11] !== itemLabel || $[12] !== items || $[13] !== locked || $[14] !== removeHint || $[15] !== removeLabel) {
|
|
250
|
+
if ($[9] !== children || $[10] !== itemKey || $[11] !== itemLabel || $[12] !== items || $[13] !== locked || $[14] !== removeHint || $[15] !== removeIcon || $[16] !== removeLabel) {
|
|
219
251
|
let t6;
|
|
220
|
-
if ($[
|
|
252
|
+
if ($[18] !== children || $[19] !== itemKey || $[20] !== itemLabel || $[21] !== locked || $[22] !== removeHint || $[23] !== removeIcon || $[24] !== removeLabel) {
|
|
221
253
|
t6 = (item_0) => /* @__PURE__ */ jsxs(Tag, {
|
|
222
254
|
id: itemKey(item_0),
|
|
223
255
|
textValue: itemLabel(item_0),
|
|
@@ -233,22 +265,19 @@ var ComboboxTags = (t0) => {
|
|
|
233
265
|
isDisabled: locked,
|
|
234
266
|
"aria-label": removeLabel,
|
|
235
267
|
className: combobox_module_default.tagRemove,
|
|
236
|
-
children:
|
|
237
|
-
svg: SvgClose,
|
|
238
|
-
label: "",
|
|
239
|
-
size: .875
|
|
240
|
-
})
|
|
268
|
+
children: removeIcon
|
|
241
269
|
})
|
|
242
270
|
})]
|
|
243
271
|
}, itemKey(item_0));
|
|
244
|
-
$[
|
|
245
|
-
$[
|
|
246
|
-
$[
|
|
247
|
-
$[
|
|
248
|
-
$[
|
|
249
|
-
$[
|
|
250
|
-
$[
|
|
251
|
-
|
|
272
|
+
$[18] = children;
|
|
273
|
+
$[19] = itemKey;
|
|
274
|
+
$[20] = itemLabel;
|
|
275
|
+
$[21] = locked;
|
|
276
|
+
$[22] = removeHint;
|
|
277
|
+
$[23] = removeIcon;
|
|
278
|
+
$[24] = removeLabel;
|
|
279
|
+
$[25] = t6;
|
|
280
|
+
} else t6 = $[25];
|
|
252
281
|
t5 = items.map(t6);
|
|
253
282
|
$[9] = children;
|
|
254
283
|
$[10] = itemKey;
|
|
@@ -256,20 +285,21 @@ var ComboboxTags = (t0) => {
|
|
|
256
285
|
$[12] = items;
|
|
257
286
|
$[13] = locked;
|
|
258
287
|
$[14] = removeHint;
|
|
259
|
-
$[15] =
|
|
260
|
-
$[16] =
|
|
261
|
-
|
|
288
|
+
$[15] = removeIcon;
|
|
289
|
+
$[16] = removeLabel;
|
|
290
|
+
$[17] = t5;
|
|
291
|
+
} else t5 = $[17];
|
|
262
292
|
let t6;
|
|
263
|
-
if ($[
|
|
293
|
+
if ($[26] !== t5) {
|
|
264
294
|
t6 = /* @__PURE__ */ jsx(TagList, {
|
|
265
295
|
className: combobox_module_default.tagList,
|
|
266
296
|
children: t5
|
|
267
297
|
});
|
|
268
|
-
$[
|
|
269
|
-
$[
|
|
270
|
-
} else t6 = $[
|
|
298
|
+
$[26] = t5;
|
|
299
|
+
$[27] = t6;
|
|
300
|
+
} else t6 = $[27];
|
|
271
301
|
let t7;
|
|
272
|
-
if ($[
|
|
302
|
+
if ($[28] !== label || $[29] !== t3 || $[30] !== t4 || $[31] !== t6) {
|
|
273
303
|
t7 = /* @__PURE__ */ jsx(TagGroup, {
|
|
274
304
|
ref,
|
|
275
305
|
"aria-label": label,
|
|
@@ -278,14 +308,15 @@ var ComboboxTags = (t0) => {
|
|
|
278
308
|
onRemove: t4,
|
|
279
309
|
children: t6
|
|
280
310
|
});
|
|
281
|
-
$[
|
|
282
|
-
$[
|
|
283
|
-
$[
|
|
284
|
-
$[
|
|
285
|
-
$[
|
|
286
|
-
} else t7 = $[
|
|
311
|
+
$[28] = label;
|
|
312
|
+
$[29] = t3;
|
|
313
|
+
$[30] = t4;
|
|
314
|
+
$[31] = t6;
|
|
315
|
+
$[32] = t7;
|
|
316
|
+
} else t7 = $[32];
|
|
287
317
|
return t7;
|
|
288
318
|
};
|
|
319
|
+
/** Places the popup against the control, given as its `anchor`. */
|
|
289
320
|
var ComboboxPositioner = (t0) => {
|
|
290
321
|
const $ = c(11);
|
|
291
322
|
let className;
|
|
@@ -326,6 +357,7 @@ var ComboboxPositioner = (t0) => {
|
|
|
326
357
|
} else t4 = $[10];
|
|
327
358
|
return t4;
|
|
328
359
|
};
|
|
360
|
+
/** The shared popup surface. */
|
|
329
361
|
var ComboboxPopup = (t0) => {
|
|
330
362
|
const $ = c(8);
|
|
331
363
|
let className;
|
|
@@ -394,7 +426,66 @@ var ComboboxSearch = (t0) => {
|
|
|
394
426
|
} else t2 = $[7];
|
|
395
427
|
return t2;
|
|
396
428
|
};
|
|
429
|
+
/** The scrolling list of options, which loads a paged `query`'s next page as it nears its end. */
|
|
397
430
|
var ComboboxList = (t0) => {
|
|
431
|
+
const $ = c(14);
|
|
432
|
+
let className;
|
|
433
|
+
let props;
|
|
434
|
+
let query;
|
|
435
|
+
if ($[0] !== t0) {
|
|
436
|
+
({className, query, ...props} = t0);
|
|
437
|
+
$[0] = t0;
|
|
438
|
+
$[1] = className;
|
|
439
|
+
$[2] = props;
|
|
440
|
+
$[3] = query;
|
|
441
|
+
} else {
|
|
442
|
+
className = $[1];
|
|
443
|
+
props = $[2];
|
|
444
|
+
query = $[3];
|
|
445
|
+
}
|
|
446
|
+
const ref = useRef(null);
|
|
447
|
+
const t1 = query !== void 0 && query.hasNextPage && !query.isFetchingNextPage;
|
|
448
|
+
let t2;
|
|
449
|
+
if ($[4] !== query) {
|
|
450
|
+
t2 = () => {
|
|
451
|
+
query?.fetchNextPage();
|
|
452
|
+
};
|
|
453
|
+
$[4] = query;
|
|
454
|
+
$[5] = t2;
|
|
455
|
+
} else t2 = $[5];
|
|
456
|
+
let t3;
|
|
457
|
+
if ($[6] !== t1 || $[7] !== t2) {
|
|
458
|
+
t3 = {
|
|
459
|
+
ref,
|
|
460
|
+
enabled: t1,
|
|
461
|
+
onLoadMore: t2
|
|
462
|
+
};
|
|
463
|
+
$[6] = t1;
|
|
464
|
+
$[7] = t2;
|
|
465
|
+
$[8] = t3;
|
|
466
|
+
} else t3 = $[8];
|
|
467
|
+
useInfiniteScroll(t3);
|
|
468
|
+
let t4;
|
|
469
|
+
if ($[9] !== className) {
|
|
470
|
+
t4 = clsx(combobox_module_default.list, className);
|
|
471
|
+
$[9] = className;
|
|
472
|
+
$[10] = t4;
|
|
473
|
+
} else t4 = $[10];
|
|
474
|
+
let t5;
|
|
475
|
+
if ($[11] !== props || $[12] !== t4) {
|
|
476
|
+
t5 = /* @__PURE__ */ jsx(Combobox.List, {
|
|
477
|
+
ref,
|
|
478
|
+
className: t4,
|
|
479
|
+
...props
|
|
480
|
+
});
|
|
481
|
+
$[11] = props;
|
|
482
|
+
$[12] = t4;
|
|
483
|
+
$[13] = t5;
|
|
484
|
+
} else t5 = $[13];
|
|
485
|
+
return t5;
|
|
486
|
+
};
|
|
487
|
+
/** One option's row, holding its `OptionIndicator` and `OptionText`. */
|
|
488
|
+
var ComboboxOption = (t0) => {
|
|
398
489
|
const $ = c(8);
|
|
399
490
|
let className;
|
|
400
491
|
let props;
|
|
@@ -409,13 +500,13 @@ var ComboboxList = (t0) => {
|
|
|
409
500
|
}
|
|
410
501
|
let t1;
|
|
411
502
|
if ($[3] !== className) {
|
|
412
|
-
t1 = clsx(combobox_module_default.
|
|
503
|
+
t1 = clsx(combobox_module_default.option, className);
|
|
413
504
|
$[3] = className;
|
|
414
505
|
$[4] = t1;
|
|
415
506
|
} else t1 = $[4];
|
|
416
507
|
let t2;
|
|
417
508
|
if ($[5] !== props || $[6] !== t1) {
|
|
418
|
-
t2 = /* @__PURE__ */ jsx(Combobox.
|
|
509
|
+
t2 = /* @__PURE__ */ jsx(Combobox.Item, {
|
|
419
510
|
className: t1,
|
|
420
511
|
...props
|
|
421
512
|
});
|
|
@@ -425,76 +516,78 @@ var ComboboxList = (t0) => {
|
|
|
425
516
|
} else t2 = $[7];
|
|
426
517
|
return t2;
|
|
427
518
|
};
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
519
|
+
/** The mark beside a chosen option. Its children are the mark, such as a tick. */
|
|
520
|
+
var ComboboxOptionIndicator = (t0) => {
|
|
521
|
+
const $ = c(8);
|
|
431
522
|
let className;
|
|
432
523
|
let props;
|
|
433
524
|
let t1;
|
|
434
525
|
if ($[0] !== t0) {
|
|
435
|
-
({className,
|
|
526
|
+
({className, multiple: t1, ...props} = t0);
|
|
436
527
|
$[0] = t0;
|
|
437
|
-
$[1] =
|
|
438
|
-
$[2] =
|
|
439
|
-
$[3] =
|
|
440
|
-
$[4] = t1;
|
|
528
|
+
$[1] = className;
|
|
529
|
+
$[2] = props;
|
|
530
|
+
$[3] = t1;
|
|
441
531
|
} else {
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
t1 = $[4];
|
|
532
|
+
className = $[1];
|
|
533
|
+
props = $[2];
|
|
534
|
+
t1 = $[3];
|
|
446
535
|
}
|
|
447
536
|
const multiple = t1 === void 0 ? false : t1;
|
|
448
537
|
let t2;
|
|
449
|
-
if ($[5] !==
|
|
450
|
-
t2 =
|
|
451
|
-
$[5] = className;
|
|
452
|
-
$[6] = t2;
|
|
453
|
-
} else t2 = $[6];
|
|
454
|
-
let t3;
|
|
455
|
-
if ($[7] !== multiple) {
|
|
456
|
-
t3 = multiple ? /* @__PURE__ */ jsx("span", {
|
|
538
|
+
if ($[4] !== className || $[5] !== multiple || $[6] !== props) {
|
|
539
|
+
t2 = multiple ? /* @__PURE__ */ jsx("span", {
|
|
457
540
|
className: combobox_module_default.checkbox,
|
|
458
541
|
"aria-hidden": "true",
|
|
459
542
|
children: /* @__PURE__ */ jsx(Combobox.ItemIndicator, {
|
|
460
543
|
keepMounted: true,
|
|
461
|
-
className: combobox_module_default.checkboxIndicator,
|
|
462
|
-
|
|
544
|
+
className: clsx(combobox_module_default.checkboxIndicator, className),
|
|
545
|
+
...props
|
|
463
546
|
})
|
|
464
547
|
}) : /* @__PURE__ */ jsx(Combobox.ItemIndicator, {
|
|
465
|
-
className: combobox_module_default.indicator,
|
|
466
|
-
|
|
467
|
-
svg: SvgCheck,
|
|
468
|
-
label: ""
|
|
469
|
-
})
|
|
470
|
-
});
|
|
471
|
-
$[7] = multiple;
|
|
472
|
-
$[8] = t3;
|
|
473
|
-
} else t3 = $[8];
|
|
474
|
-
let t4;
|
|
475
|
-
if ($[9] !== children) {
|
|
476
|
-
t4 = /* @__PURE__ */ jsx("span", {
|
|
477
|
-
className: combobox_module_default.optionText,
|
|
478
|
-
children
|
|
548
|
+
className: clsx(combobox_module_default.indicator, className),
|
|
549
|
+
...props
|
|
479
550
|
});
|
|
480
|
-
$[
|
|
481
|
-
$[
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
551
|
+
$[4] = className;
|
|
552
|
+
$[5] = multiple;
|
|
553
|
+
$[6] = props;
|
|
554
|
+
$[7] = t2;
|
|
555
|
+
} else t2 = $[7];
|
|
556
|
+
return t2;
|
|
557
|
+
};
|
|
558
|
+
/** An option's content, beside its indicator. */
|
|
559
|
+
var ComboboxOptionText = (t0) => {
|
|
560
|
+
const $ = c(8);
|
|
561
|
+
let className;
|
|
562
|
+
let props;
|
|
563
|
+
if ($[0] !== t0) {
|
|
564
|
+
({className, ...props} = t0);
|
|
565
|
+
$[0] = t0;
|
|
566
|
+
$[1] = className;
|
|
567
|
+
$[2] = props;
|
|
568
|
+
} else {
|
|
569
|
+
className = $[1];
|
|
570
|
+
props = $[2];
|
|
571
|
+
}
|
|
572
|
+
let t1;
|
|
573
|
+
if ($[3] !== className) {
|
|
574
|
+
t1 = clsx(combobox_module_default.optionText, className);
|
|
575
|
+
$[3] = className;
|
|
576
|
+
$[4] = t1;
|
|
577
|
+
} else t1 = $[4];
|
|
578
|
+
let t2;
|
|
579
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
580
|
+
t2 = /* @__PURE__ */ jsx("span", {
|
|
581
|
+
className: t1,
|
|
582
|
+
...props
|
|
489
583
|
});
|
|
490
|
-
$[
|
|
491
|
-
$[
|
|
492
|
-
$[
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
} else t5 = $[15];
|
|
496
|
-
return t5;
|
|
584
|
+
$[5] = props;
|
|
585
|
+
$[6] = t1;
|
|
586
|
+
$[7] = t2;
|
|
587
|
+
} else t2 = $[7];
|
|
588
|
+
return t2;
|
|
497
589
|
};
|
|
590
|
+
/** What the popup says when no option is listed. */
|
|
498
591
|
var ComboboxEmpty = (t0) => {
|
|
499
592
|
const $ = c(8);
|
|
500
593
|
let className;
|
|
@@ -526,6 +619,7 @@ var ComboboxEmpty = (t0) => {
|
|
|
526
619
|
} else t2 = $[7];
|
|
527
620
|
return t2;
|
|
528
621
|
};
|
|
622
|
+
/** The popup's polite status line. */
|
|
529
623
|
var ComboboxStatus = (t0) => {
|
|
530
624
|
const $ = c(8);
|
|
531
625
|
let className;
|
|
@@ -557,6 +651,7 @@ var ComboboxStatus = (t0) => {
|
|
|
557
651
|
} else t2 = $[7];
|
|
558
652
|
return t2;
|
|
559
653
|
};
|
|
654
|
+
/** The row that holds the status and a retry button. */
|
|
560
655
|
var ComboboxStatusArea = (t0) => {
|
|
561
656
|
const $ = c(8);
|
|
562
657
|
let className;
|
|
@@ -588,15 +683,235 @@ var ComboboxStatusArea = (t0) => {
|
|
|
588
683
|
} else t2 = $[7];
|
|
589
684
|
return t2;
|
|
590
685
|
};
|
|
686
|
+
var loadMessage = (labels, load, query) => {
|
|
687
|
+
if (load.status === "pending") return labels.loadingLabel;
|
|
688
|
+
if (load.status === "error") return load.retry === void 0 ? labels.loadBrokenLabel : labels.loadFailedLabel;
|
|
689
|
+
const paged = pagedProgress(query);
|
|
690
|
+
if (paged === void 0) return;
|
|
691
|
+
if (paged.isFetchingNextPage) return labels.loadingMoreLabel;
|
|
692
|
+
return paged.totalCount === void 0 ? void 0 : labels.resultsLabel(paged.totalCount);
|
|
693
|
+
};
|
|
694
|
+
var runRetry = (retry) => {
|
|
695
|
+
retry();
|
|
696
|
+
};
|
|
697
|
+
/** The load status of the items, with a retry button where trying again can help. */
|
|
698
|
+
var ComboboxLoadStatus = (t0) => {
|
|
699
|
+
const $ = c(25);
|
|
700
|
+
let T0;
|
|
701
|
+
let T1;
|
|
702
|
+
let labels;
|
|
703
|
+
let onRetry;
|
|
704
|
+
let retry;
|
|
705
|
+
let t1;
|
|
706
|
+
let t2;
|
|
707
|
+
let t3;
|
|
708
|
+
if ($[0] !== t0) {
|
|
709
|
+
const { load, query, onRetry: t4, className, ...t5 } = t0;
|
|
710
|
+
labels = t5;
|
|
711
|
+
onRetry = t4 === void 0 ? runRetry : t4;
|
|
712
|
+
retry = load.status === "error" ? load.retry : void 0;
|
|
713
|
+
T1 = ComboboxStatusArea;
|
|
714
|
+
t3 = className;
|
|
715
|
+
T0 = ComboboxStatus;
|
|
716
|
+
if ($[9] !== load.status || $[10] !== query?.isFetchingNextPage) {
|
|
717
|
+
t1 = (load.status === "pending" || query?.isFetchingNextPage === true) && /* @__PURE__ */ jsx(Spinner, { size: 1 });
|
|
718
|
+
$[9] = load.status;
|
|
719
|
+
$[10] = query?.isFetchingNextPage;
|
|
720
|
+
$[11] = t1;
|
|
721
|
+
} else t1 = $[11];
|
|
722
|
+
t2 = loadMessage(labels, load, query);
|
|
723
|
+
$[0] = t0;
|
|
724
|
+
$[1] = T0;
|
|
725
|
+
$[2] = T1;
|
|
726
|
+
$[3] = labels;
|
|
727
|
+
$[4] = onRetry;
|
|
728
|
+
$[5] = retry;
|
|
729
|
+
$[6] = t1;
|
|
730
|
+
$[7] = t2;
|
|
731
|
+
$[8] = t3;
|
|
732
|
+
} else {
|
|
733
|
+
T0 = $[1];
|
|
734
|
+
T1 = $[2];
|
|
735
|
+
labels = $[3];
|
|
736
|
+
onRetry = $[4];
|
|
737
|
+
retry = $[5];
|
|
738
|
+
t1 = $[6];
|
|
739
|
+
t2 = $[7];
|
|
740
|
+
t3 = $[8];
|
|
741
|
+
}
|
|
742
|
+
let t4;
|
|
743
|
+
if ($[12] !== T0 || $[13] !== t1 || $[14] !== t2) {
|
|
744
|
+
t4 = /* @__PURE__ */ jsxs(T0, { children: [t1, t2] });
|
|
745
|
+
$[12] = T0;
|
|
746
|
+
$[13] = t1;
|
|
747
|
+
$[14] = t2;
|
|
748
|
+
$[15] = t4;
|
|
749
|
+
} else t4 = $[15];
|
|
750
|
+
let t5;
|
|
751
|
+
if ($[16] !== labels || $[17] !== onRetry || $[18] !== retry) {
|
|
752
|
+
t5 = retry !== void 0 && /* @__PURE__ */ jsx(Button$1, {
|
|
753
|
+
variant: "tertiary",
|
|
754
|
+
size: "sm",
|
|
755
|
+
onClick: () => {
|
|
756
|
+
onRetry(retry);
|
|
757
|
+
},
|
|
758
|
+
children: labels.retryLabel
|
|
759
|
+
});
|
|
760
|
+
$[16] = labels;
|
|
761
|
+
$[17] = onRetry;
|
|
762
|
+
$[18] = retry;
|
|
763
|
+
$[19] = t5;
|
|
764
|
+
} else t5 = $[19];
|
|
765
|
+
let t6;
|
|
766
|
+
if ($[20] !== T1 || $[21] !== t3 || $[22] !== t4 || $[23] !== t5) {
|
|
767
|
+
t6 = /* @__PURE__ */ jsxs(T1, {
|
|
768
|
+
className: t3,
|
|
769
|
+
children: [t4, t5]
|
|
770
|
+
});
|
|
771
|
+
$[20] = T1;
|
|
772
|
+
$[21] = t3;
|
|
773
|
+
$[22] = t4;
|
|
774
|
+
$[23] = t5;
|
|
775
|
+
$[24] = t6;
|
|
776
|
+
} else t6 = $[24];
|
|
777
|
+
return t6;
|
|
778
|
+
};
|
|
779
|
+
/**
|
|
780
|
+
* What a combobox's popup holds: the search box, the load status with a retry
|
|
781
|
+
* where one can help, the empty state and the list, which loads the next page
|
|
782
|
+
* of a paged query as it nears its end.
|
|
783
|
+
*/
|
|
784
|
+
var ComboboxBody = (t0) => {
|
|
785
|
+
const $ = c(36);
|
|
786
|
+
let checkIcon;
|
|
787
|
+
let children;
|
|
788
|
+
let itemKey;
|
|
789
|
+
let labels;
|
|
790
|
+
let load;
|
|
791
|
+
let noOptions;
|
|
792
|
+
let query;
|
|
793
|
+
let t1;
|
|
794
|
+
if ($[0] !== t0) {
|
|
795
|
+
({load, query, noOptions, multiple: t1, itemKey, checkIcon, children, ...labels} = t0);
|
|
796
|
+
$[0] = t0;
|
|
797
|
+
$[1] = checkIcon;
|
|
798
|
+
$[2] = children;
|
|
799
|
+
$[3] = itemKey;
|
|
800
|
+
$[4] = labels;
|
|
801
|
+
$[5] = load;
|
|
802
|
+
$[6] = noOptions;
|
|
803
|
+
$[7] = query;
|
|
804
|
+
$[8] = t1;
|
|
805
|
+
} else {
|
|
806
|
+
checkIcon = $[1];
|
|
807
|
+
children = $[2];
|
|
808
|
+
itemKey = $[3];
|
|
809
|
+
labels = $[4];
|
|
810
|
+
load = $[5];
|
|
811
|
+
noOptions = $[6];
|
|
812
|
+
query = $[7];
|
|
813
|
+
t1 = $[8];
|
|
814
|
+
}
|
|
815
|
+
const multiple = t1 === void 0 ? false : t1;
|
|
816
|
+
const searchRef = useRef(null);
|
|
817
|
+
let t2;
|
|
818
|
+
if ($[9] !== labels.searchLabel) {
|
|
819
|
+
t2 = /* @__PURE__ */ jsx(ComboboxSearch, {
|
|
820
|
+
ref: searchRef,
|
|
821
|
+
"aria-label": labels.searchLabel
|
|
822
|
+
});
|
|
823
|
+
$[9] = labels.searchLabel;
|
|
824
|
+
$[10] = t2;
|
|
825
|
+
} else t2 = $[10];
|
|
826
|
+
let t3;
|
|
827
|
+
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
828
|
+
t3 = (retry) => {
|
|
829
|
+
retry();
|
|
830
|
+
searchRef.current?.focus();
|
|
831
|
+
};
|
|
832
|
+
$[11] = t3;
|
|
833
|
+
} else t3 = $[11];
|
|
834
|
+
let t4;
|
|
835
|
+
if ($[12] !== labels.loadBrokenLabel || $[13] !== labels.loadFailedLabel || $[14] !== labels.loadingLabel || $[15] !== labels.loadingMoreLabel || $[16] !== labels.resultsLabel || $[17] !== labels.retryLabel || $[18] !== load || $[19] !== query) {
|
|
836
|
+
t4 = /* @__PURE__ */ jsx(ComboboxLoadStatus, {
|
|
837
|
+
load,
|
|
838
|
+
query,
|
|
839
|
+
loadingLabel: labels.loadingLabel,
|
|
840
|
+
loadFailedLabel: labels.loadFailedLabel,
|
|
841
|
+
loadBrokenLabel: labels.loadBrokenLabel,
|
|
842
|
+
retryLabel: labels.retryLabel,
|
|
843
|
+
loadingMoreLabel: labels.loadingMoreLabel,
|
|
844
|
+
resultsLabel: labels.resultsLabel,
|
|
845
|
+
onRetry: t3
|
|
846
|
+
});
|
|
847
|
+
$[12] = labels.loadBrokenLabel;
|
|
848
|
+
$[13] = labels.loadFailedLabel;
|
|
849
|
+
$[14] = labels.loadingLabel;
|
|
850
|
+
$[15] = labels.loadingMoreLabel;
|
|
851
|
+
$[16] = labels.resultsLabel;
|
|
852
|
+
$[17] = labels.retryLabel;
|
|
853
|
+
$[18] = load;
|
|
854
|
+
$[19] = query;
|
|
855
|
+
$[20] = t4;
|
|
856
|
+
} else t4 = $[20];
|
|
857
|
+
const t5 = load.status === "success" ? noOptions ? labels.noOptionsLabel : labels.noResultsLabel : null;
|
|
858
|
+
let t6;
|
|
859
|
+
if ($[21] !== t5) {
|
|
860
|
+
t6 = /* @__PURE__ */ jsx(ComboboxEmpty, { children: t5 });
|
|
861
|
+
$[21] = t5;
|
|
862
|
+
$[22] = t6;
|
|
863
|
+
} else t6 = $[22];
|
|
864
|
+
let t7;
|
|
865
|
+
if ($[23] !== checkIcon || $[24] !== children || $[25] !== itemKey || $[26] !== multiple) {
|
|
866
|
+
t7 = (item) => /* @__PURE__ */ jsxs(ComboboxOption, {
|
|
867
|
+
value: item,
|
|
868
|
+
children: [/* @__PURE__ */ jsx(ComboboxOptionIndicator, {
|
|
869
|
+
multiple,
|
|
870
|
+
children: checkIcon
|
|
871
|
+
}), /* @__PURE__ */ jsx(ComboboxOptionText, { children: children(item) })]
|
|
872
|
+
}, itemKey(item));
|
|
873
|
+
$[23] = checkIcon;
|
|
874
|
+
$[24] = children;
|
|
875
|
+
$[25] = itemKey;
|
|
876
|
+
$[26] = multiple;
|
|
877
|
+
$[27] = t7;
|
|
878
|
+
} else t7 = $[27];
|
|
879
|
+
let t8;
|
|
880
|
+
if ($[28] !== query || $[29] !== t7) {
|
|
881
|
+
t8 = /* @__PURE__ */ jsx(ComboboxList, {
|
|
882
|
+
query,
|
|
883
|
+
children: t7
|
|
884
|
+
});
|
|
885
|
+
$[28] = query;
|
|
886
|
+
$[29] = t7;
|
|
887
|
+
$[30] = t8;
|
|
888
|
+
} else t8 = $[30];
|
|
889
|
+
let t9;
|
|
890
|
+
if ($[31] !== t2 || $[32] !== t4 || $[33] !== t6 || $[34] !== t8) {
|
|
891
|
+
t9 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
892
|
+
t2,
|
|
893
|
+
t4,
|
|
894
|
+
t6,
|
|
895
|
+
t8
|
|
896
|
+
] });
|
|
897
|
+
$[31] = t2;
|
|
898
|
+
$[32] = t4;
|
|
899
|
+
$[33] = t6;
|
|
900
|
+
$[34] = t8;
|
|
901
|
+
$[35] = t9;
|
|
902
|
+
} else t9 = $[35];
|
|
903
|
+
return t9;
|
|
904
|
+
};
|
|
591
905
|
/**
|
|
592
906
|
* The styled parts of a base-ui Combobox: a filterable select whose control
|
|
593
907
|
* matches `Select`'s trigger and whose popup is the shared popup surface. Every
|
|
594
|
-
* unstyled base-ui part stays reachable.
|
|
595
|
-
* `ComboboxField`. The positioner takes the
|
|
908
|
+
* unstyled base-ui part stays reachable. `Body` holds what the popup usually
|
|
909
|
+
* does. For the ordinary case, use `ComboboxField`. The positioner takes the
|
|
910
|
+
* control as its `anchor`.
|
|
596
911
|
*
|
|
597
912
|
* @example
|
|
598
913
|
* <Combobox.Root items={statuses}>
|
|
599
|
-
* <Combobox.Control ref={anchorRef}>
|
|
914
|
+
* <Combobox.Control ref={anchorRef} icon={<ExpandMoreIcon />}>
|
|
600
915
|
* <Combobox.Value>{(status: string | null) => status}</Combobox.Value>
|
|
601
916
|
* </Combobox.Control>
|
|
602
917
|
* <Combobox.Portal>
|
|
@@ -604,7 +919,12 @@ var ComboboxStatusArea = (t0) => {
|
|
|
604
919
|
* <Combobox.Popup>
|
|
605
920
|
* <Combobox.Search aria-label="Search" />
|
|
606
921
|
* <Combobox.List>
|
|
607
|
-
* {(status: string) =>
|
|
922
|
+
* {(status: string) => (
|
|
923
|
+
* <Combobox.Option key={status} value={status}>
|
|
924
|
+
* <Combobox.OptionIndicator><CheckIcon /></Combobox.OptionIndicator>
|
|
925
|
+
* <Combobox.OptionText>{status}</Combobox.OptionText>
|
|
926
|
+
* </Combobox.Option>
|
|
927
|
+
* )}
|
|
608
928
|
* </Combobox.List>
|
|
609
929
|
* </Combobox.Popup>
|
|
610
930
|
* </Combobox.Positioner>
|
|
@@ -615,15 +935,20 @@ var Combobox$1 = {
|
|
|
615
935
|
...Combobox,
|
|
616
936
|
Root: ComboboxRoot,
|
|
617
937
|
Control: ComboboxControl,
|
|
938
|
+
Icon: ComboboxIcon,
|
|
618
939
|
Tags: ComboboxTags,
|
|
619
940
|
Positioner: ComboboxPositioner,
|
|
620
941
|
Popup: ComboboxPopup,
|
|
621
942
|
Search: ComboboxSearch,
|
|
622
943
|
List: ComboboxList,
|
|
623
944
|
Option: ComboboxOption,
|
|
945
|
+
OptionIndicator: ComboboxOptionIndicator,
|
|
946
|
+
OptionText: ComboboxOptionText,
|
|
624
947
|
Empty: ComboboxEmpty,
|
|
625
948
|
Status: ComboboxStatus,
|
|
626
949
|
StatusArea: ComboboxStatusArea,
|
|
950
|
+
LoadStatus: ComboboxLoadStatus,
|
|
951
|
+
Body: ComboboxBody,
|
|
627
952
|
Pending: Field.Pending
|
|
628
953
|
};
|
|
629
954
|
function _temp(event) {
|