@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 SvgFilterAlt from "../../vendor/@material-design-icons/svg/outlined/filter_alt.js";
|
|
3
|
-
import SvgFilterAltOff from "../../vendor/@material-design-icons/svg/outlined/filter_alt_off.js";
|
|
4
|
-
import SvgRestore from "../../vendor/@material-design-icons/svg/outlined/restore.js";
|
|
5
1
|
import { useRequiredContext } from "../../lib/use-required-context.js";
|
|
6
2
|
import { Badge } from "../badge/badge.js";
|
|
7
3
|
import { Button } from "../button/button.js";
|
|
@@ -9,92 +5,150 @@ import { Drawer } from "../drawer/drawer.js";
|
|
|
9
5
|
import { SearchField } from "../search-field/search-field.js";
|
|
10
6
|
import filter_bar_module_default from "./filter-bar.module.js";
|
|
11
7
|
import { c } from "react/compiler-runtime";
|
|
12
|
-
import {
|
|
13
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
14
9
|
import { clsx } from "clsx";
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
import { createContext, useRef, useState } from "react";
|
|
15
12
|
// src/components/filter-bar/filter-bar.tsx
|
|
16
13
|
var FilterBarContext = createContext(null);
|
|
17
14
|
var useFilterBar = () => {
|
|
18
15
|
return useRequiredContext(FilterBarContext, "FilterBar.* must be rendered inside <FilterBar.Root>.");
|
|
19
16
|
};
|
|
17
|
+
var FilterDrawerContext = createContext(null);
|
|
18
|
+
var useApply = () => {
|
|
19
|
+
return useRequiredContext(FilterDrawerContext, "FilterBar.Apply must be rendered inside <FilterBar.Drawer>.");
|
|
20
|
+
};
|
|
21
|
+
/** The `<search>` landmark holding a `useFilterView` for the parts inside it. */
|
|
20
22
|
var Root = (t0) => {
|
|
21
|
-
const $ = c(
|
|
22
|
-
|
|
23
|
+
const $ = c(18);
|
|
24
|
+
let className;
|
|
25
|
+
let filters;
|
|
26
|
+
let props;
|
|
27
|
+
let ref;
|
|
28
|
+
let render;
|
|
29
|
+
if ($[0] !== t0) {
|
|
30
|
+
({filters, render, className, ref, ...props} = t0);
|
|
31
|
+
$[0] = t0;
|
|
32
|
+
$[1] = className;
|
|
33
|
+
$[2] = filters;
|
|
34
|
+
$[3] = props;
|
|
35
|
+
$[4] = ref;
|
|
36
|
+
$[5] = render;
|
|
37
|
+
} else {
|
|
38
|
+
className = $[1];
|
|
39
|
+
filters = $[2];
|
|
40
|
+
props = $[3];
|
|
41
|
+
ref = $[4];
|
|
42
|
+
render = $[5];
|
|
43
|
+
}
|
|
23
44
|
let t1;
|
|
24
|
-
if ($[
|
|
45
|
+
if ($[6] !== className) {
|
|
25
46
|
t1 = clsx(filter_bar_module_default.bar, className);
|
|
26
|
-
$[
|
|
27
|
-
$[
|
|
28
|
-
} else t1 = $[
|
|
47
|
+
$[6] = className;
|
|
48
|
+
$[7] = t1;
|
|
49
|
+
} else t1 = $[7];
|
|
29
50
|
let t2;
|
|
30
|
-
if ($[
|
|
31
|
-
t2 =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
$[
|
|
36
|
-
$[
|
|
37
|
-
$[
|
|
38
|
-
} else t2 = $[
|
|
51
|
+
if ($[8] !== props || $[9] !== t1) {
|
|
52
|
+
t2 = {
|
|
53
|
+
...props,
|
|
54
|
+
className: t1
|
|
55
|
+
};
|
|
56
|
+
$[8] = props;
|
|
57
|
+
$[9] = t1;
|
|
58
|
+
$[10] = t2;
|
|
59
|
+
} else t2 = $[10];
|
|
39
60
|
let t3;
|
|
40
|
-
if ($[
|
|
41
|
-
t3 =
|
|
61
|
+
if ($[11] !== ref || $[12] !== render || $[13] !== t2) {
|
|
62
|
+
t3 = {
|
|
63
|
+
defaultTagName: "search",
|
|
64
|
+
render,
|
|
65
|
+
ref,
|
|
66
|
+
props: t2
|
|
67
|
+
};
|
|
68
|
+
$[11] = ref;
|
|
69
|
+
$[12] = render;
|
|
70
|
+
$[13] = t2;
|
|
71
|
+
$[14] = t3;
|
|
72
|
+
} else t3 = $[14];
|
|
73
|
+
const element = useRender(t3);
|
|
74
|
+
let t4;
|
|
75
|
+
if ($[15] !== element || $[16] !== filters) {
|
|
76
|
+
t4 = /* @__PURE__ */ jsx(FilterBarContext, {
|
|
42
77
|
value: filters,
|
|
43
|
-
children:
|
|
78
|
+
children: element
|
|
44
79
|
});
|
|
45
|
-
$[
|
|
46
|
-
$[
|
|
47
|
-
$[
|
|
48
|
-
} else
|
|
49
|
-
return
|
|
80
|
+
$[15] = element;
|
|
81
|
+
$[16] = filters;
|
|
82
|
+
$[17] = t4;
|
|
83
|
+
} else t4 = $[17];
|
|
84
|
+
return t4;
|
|
50
85
|
};
|
|
51
86
|
/**
|
|
52
|
-
* The live search input
|
|
53
|
-
* narrows as you type, debounced by
|
|
54
|
-
*
|
|
87
|
+
* The live search input, a `SearchField` bound to the view's search. Search is
|
|
88
|
+
* not part of the Apply/Cancel bargain: it narrows as you type, debounced by
|
|
89
|
+
* the view. Its label is hidden and fills the placeholder unless told otherwise.
|
|
55
90
|
*/
|
|
56
91
|
var Search = (t0) => {
|
|
57
|
-
const $ = c(
|
|
58
|
-
|
|
59
|
-
|
|
92
|
+
const $ = c(16);
|
|
93
|
+
let className;
|
|
94
|
+
let label;
|
|
95
|
+
let props;
|
|
60
96
|
let t1;
|
|
61
|
-
if ($[0] !== className) {
|
|
62
|
-
t1 = clsx(filter_bar_module_default.search, className);
|
|
63
|
-
$[0] = className;
|
|
64
|
-
$[1] = t1;
|
|
65
|
-
} else t1 = $[1];
|
|
66
97
|
let t2;
|
|
67
|
-
if ($[
|
|
68
|
-
|
|
98
|
+
if ($[0] !== t0) {
|
|
99
|
+
({label, labelHidden: t1, placeholder: t2, className, ...props} = t0);
|
|
100
|
+
$[0] = t0;
|
|
101
|
+
$[1] = className;
|
|
102
|
+
$[2] = label;
|
|
103
|
+
$[3] = props;
|
|
104
|
+
$[4] = t1;
|
|
105
|
+
$[5] = t2;
|
|
106
|
+
} else {
|
|
107
|
+
className = $[1];
|
|
108
|
+
label = $[2];
|
|
109
|
+
props = $[3];
|
|
110
|
+
t1 = $[4];
|
|
111
|
+
t2 = $[5];
|
|
112
|
+
}
|
|
113
|
+
const labelHidden = t1 === void 0 ? true : t1;
|
|
114
|
+
const placeholder = t2 === void 0 ? label : t2;
|
|
115
|
+
const { search, setSearch } = useFilterBar();
|
|
116
|
+
let t3;
|
|
117
|
+
if ($[6] !== className) {
|
|
118
|
+
t3 = clsx(filter_bar_module_default.search, className);
|
|
119
|
+
$[6] = className;
|
|
120
|
+
$[7] = t3;
|
|
121
|
+
} else t3 = $[7];
|
|
122
|
+
let t4;
|
|
123
|
+
if ($[8] !== label || $[9] !== labelHidden || $[10] !== placeholder || $[11] !== props || $[12] !== search || $[13] !== setSearch || $[14] !== t3) {
|
|
124
|
+
t4 = /* @__PURE__ */ jsx(SearchField, {
|
|
125
|
+
...props,
|
|
69
126
|
label,
|
|
70
|
-
labelHidden
|
|
71
|
-
|
|
72
|
-
clearLabel,
|
|
73
|
-
placeholder: label,
|
|
127
|
+
labelHidden,
|
|
128
|
+
placeholder,
|
|
74
129
|
value: search,
|
|
75
130
|
onValueChange: setSearch,
|
|
76
|
-
className:
|
|
131
|
+
className: t3
|
|
77
132
|
});
|
|
78
|
-
$[
|
|
79
|
-
$[
|
|
80
|
-
$[
|
|
81
|
-
$[
|
|
82
|
-
$[
|
|
83
|
-
$[
|
|
84
|
-
$[
|
|
85
|
-
|
|
86
|
-
|
|
133
|
+
$[8] = label;
|
|
134
|
+
$[9] = labelHidden;
|
|
135
|
+
$[10] = placeholder;
|
|
136
|
+
$[11] = props;
|
|
137
|
+
$[12] = search;
|
|
138
|
+
$[13] = setSearch;
|
|
139
|
+
$[14] = t3;
|
|
140
|
+
$[15] = t4;
|
|
141
|
+
} else t4 = $[15];
|
|
142
|
+
return t4;
|
|
87
143
|
};
|
|
88
144
|
/**
|
|
89
|
-
* The apply-gated half: a
|
|
90
|
-
*
|
|
91
|
-
* drawer discards the draft, and Reset puts it back to the initial filters
|
|
92
|
-
* without closing.
|
|
145
|
+
* The apply-gated half: a `Drawer.Root` whose draft `FilterBar.Apply` commits.
|
|
146
|
+
* Dismissing the drawer any other way discards the draft.
|
|
93
147
|
*/
|
|
94
148
|
var FilterDrawer = (t0) => {
|
|
95
|
-
const $ = c(
|
|
96
|
-
const { children, swipeDirection
|
|
97
|
-
const {
|
|
149
|
+
const $ = c(12);
|
|
150
|
+
const { children, swipeDirection } = t0;
|
|
151
|
+
const { apply, cancel } = useFilterBar();
|
|
98
152
|
const [open, setOpen] = useState(false);
|
|
99
153
|
const appliedRef = useRef(false);
|
|
100
154
|
let t1;
|
|
@@ -122,183 +176,457 @@ var FilterDrawer = (t0) => {
|
|
|
122
176
|
} else t2 = $[3];
|
|
123
177
|
const handleOpenChange = t2;
|
|
124
178
|
let t3;
|
|
125
|
-
if ($[4] !==
|
|
126
|
-
t3 =
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
179
|
+
if ($[4] !== children || $[5] !== handleOpenChange || $[6] !== open || $[7] !== swipeDirection) {
|
|
180
|
+
t3 = /* @__PURE__ */ jsx(Drawer.Root, {
|
|
181
|
+
open,
|
|
182
|
+
onOpenChange: handleOpenChange,
|
|
183
|
+
swipeDirection,
|
|
184
|
+
children
|
|
130
185
|
});
|
|
131
|
-
$[4] =
|
|
132
|
-
$[5] =
|
|
133
|
-
|
|
186
|
+
$[4] = children;
|
|
187
|
+
$[5] = handleOpenChange;
|
|
188
|
+
$[6] = open;
|
|
189
|
+
$[7] = swipeDirection;
|
|
190
|
+
$[8] = t3;
|
|
191
|
+
} else t3 = $[8];
|
|
134
192
|
let t4;
|
|
135
|
-
if ($[
|
|
136
|
-
t4 = /* @__PURE__ */ jsx(
|
|
193
|
+
if ($[9] !== handleApply || $[10] !== t3) {
|
|
194
|
+
t4 = /* @__PURE__ */ jsx(FilterDrawerContext, {
|
|
195
|
+
value: handleApply,
|
|
196
|
+
children: t3
|
|
197
|
+
});
|
|
198
|
+
$[9] = handleApply;
|
|
199
|
+
$[10] = t3;
|
|
200
|
+
$[11] = t4;
|
|
201
|
+
} else t4 = $[11];
|
|
202
|
+
return t4;
|
|
203
|
+
};
|
|
204
|
+
/** The button that opens the drawer, such as "Filters" with a `FilterBar.Badge`. */
|
|
205
|
+
var Trigger = (t0) => {
|
|
206
|
+
const $ = c(8);
|
|
207
|
+
let children;
|
|
208
|
+
let icon;
|
|
209
|
+
let props;
|
|
210
|
+
if ($[0] !== t0) {
|
|
211
|
+
({icon, children, ...props} = t0);
|
|
212
|
+
$[0] = t0;
|
|
213
|
+
$[1] = children;
|
|
214
|
+
$[2] = icon;
|
|
215
|
+
$[3] = props;
|
|
216
|
+
} else {
|
|
217
|
+
children = $[1];
|
|
218
|
+
icon = $[2];
|
|
219
|
+
props = $[3];
|
|
220
|
+
}
|
|
221
|
+
let t1;
|
|
222
|
+
if ($[4] !== children || $[5] !== icon || $[6] !== props) {
|
|
223
|
+
t1 = /* @__PURE__ */ jsx(Drawer.Trigger, { render: /* @__PURE__ */ jsx(Button, {
|
|
137
224
|
variant: "secondary",
|
|
138
|
-
icon
|
|
139
|
-
|
|
140
|
-
}) });
|
|
141
|
-
$[6] = t3;
|
|
142
|
-
$[7] = triggerLabel;
|
|
143
|
-
$[8] = t4;
|
|
144
|
-
} else t4 = $[8];
|
|
145
|
-
let t5;
|
|
146
|
-
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
147
|
-
t5 = /* @__PURE__ */ jsx(Drawer.Backdrop, {});
|
|
148
|
-
$[9] = t5;
|
|
149
|
-
} else t5 = $[9];
|
|
150
|
-
let t6;
|
|
151
|
-
if ($[10] !== title) {
|
|
152
|
-
t6 = /* @__PURE__ */ jsx(Drawer.Title, { children: title });
|
|
153
|
-
$[10] = title;
|
|
154
|
-
$[11] = t6;
|
|
155
|
-
} else t6 = $[11];
|
|
156
|
-
let t7;
|
|
157
|
-
if ($[12] !== closeLabel) {
|
|
158
|
-
t7 = /* @__PURE__ */ jsx(Drawer.CloseButton, { closeLabel });
|
|
159
|
-
$[12] = closeLabel;
|
|
160
|
-
$[13] = t7;
|
|
161
|
-
} else t7 = $[13];
|
|
162
|
-
let t8;
|
|
163
|
-
if ($[14] !== t6 || $[15] !== t7) {
|
|
164
|
-
t8 = /* @__PURE__ */ jsxs(Drawer.Header, { children: [t6, t7] });
|
|
165
|
-
$[14] = t6;
|
|
166
|
-
$[15] = t7;
|
|
167
|
-
$[16] = t8;
|
|
168
|
-
} else t8 = $[16];
|
|
169
|
-
let t9;
|
|
170
|
-
if ($[17] !== className) {
|
|
171
|
-
t9 = clsx(filter_bar_module_default.fields, className);
|
|
172
|
-
$[17] = className;
|
|
173
|
-
$[18] = t9;
|
|
174
|
-
} else t9 = $[18];
|
|
175
|
-
let t10;
|
|
176
|
-
if ($[19] !== children || $[20] !== t9) {
|
|
177
|
-
t10 = /* @__PURE__ */ jsx("div", {
|
|
178
|
-
className: t9,
|
|
225
|
+
icon,
|
|
226
|
+
...props,
|
|
179
227
|
children
|
|
228
|
+
}) });
|
|
229
|
+
$[4] = children;
|
|
230
|
+
$[5] = icon;
|
|
231
|
+
$[6] = props;
|
|
232
|
+
$[7] = t1;
|
|
233
|
+
} else t1 = $[7];
|
|
234
|
+
return t1;
|
|
235
|
+
};
|
|
236
|
+
/** How many filters are applied, for the trigger. Renders nothing while none are. */
|
|
237
|
+
var FilterBadge = (t0) => {
|
|
238
|
+
const $ = c(9);
|
|
239
|
+
let props;
|
|
240
|
+
let t1;
|
|
241
|
+
let t2;
|
|
242
|
+
if ($[0] !== t0) {
|
|
243
|
+
({tone: t1, variant: t2, ...props} = t0);
|
|
244
|
+
$[0] = t0;
|
|
245
|
+
$[1] = props;
|
|
246
|
+
$[2] = t1;
|
|
247
|
+
$[3] = t2;
|
|
248
|
+
} else {
|
|
249
|
+
props = $[1];
|
|
250
|
+
t1 = $[2];
|
|
251
|
+
t2 = $[3];
|
|
252
|
+
}
|
|
253
|
+
const tone = t1 === void 0 ? "neutral" : t1;
|
|
254
|
+
const variant = t2 === void 0 ? "solid" : t2;
|
|
255
|
+
const { activeCount } = useFilterBar();
|
|
256
|
+
if (activeCount === 0) return null;
|
|
257
|
+
let t3;
|
|
258
|
+
if ($[4] !== activeCount || $[5] !== props || $[6] !== tone || $[7] !== variant) {
|
|
259
|
+
t3 = /* @__PURE__ */ jsx(Badge, {
|
|
260
|
+
tone,
|
|
261
|
+
variant,
|
|
262
|
+
...props,
|
|
263
|
+
children: activeCount
|
|
180
264
|
});
|
|
181
|
-
$[
|
|
182
|
-
$[
|
|
183
|
-
$[
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
265
|
+
$[4] = activeCount;
|
|
266
|
+
$[5] = props;
|
|
267
|
+
$[6] = tone;
|
|
268
|
+
$[7] = variant;
|
|
269
|
+
$[8] = t3;
|
|
270
|
+
} else t3 = $[8];
|
|
271
|
+
return t3;
|
|
272
|
+
};
|
|
273
|
+
/** The drawer itself: its portal, backdrop, viewport and popup, around the content. */
|
|
274
|
+
var Content = (t0) => {
|
|
275
|
+
const $ = c(6);
|
|
276
|
+
const { children, className } = t0;
|
|
277
|
+
let t1;
|
|
278
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
279
|
+
t1 = /* @__PURE__ */ jsx(Drawer.Backdrop, {});
|
|
280
|
+
$[0] = t1;
|
|
281
|
+
} else t1 = $[0];
|
|
282
|
+
let t2;
|
|
283
|
+
if ($[1] !== children) {
|
|
284
|
+
t2 = /* @__PURE__ */ jsx(Drawer.Content, { children });
|
|
285
|
+
$[1] = children;
|
|
286
|
+
$[2] = t2;
|
|
287
|
+
} else t2 = $[2];
|
|
288
|
+
let t3;
|
|
289
|
+
if ($[3] !== className || $[4] !== t2) {
|
|
290
|
+
t3 = /* @__PURE__ */ jsxs(Drawer.Portal, { children: [t1, /* @__PURE__ */ jsx(Drawer.Viewport, { children: /* @__PURE__ */ jsx(Drawer.Popup, {
|
|
291
|
+
className,
|
|
292
|
+
children: t2
|
|
293
|
+
}) })] });
|
|
294
|
+
$[3] = className;
|
|
295
|
+
$[4] = t2;
|
|
296
|
+
$[5] = t3;
|
|
297
|
+
} else t3 = $[5];
|
|
298
|
+
return t3;
|
|
299
|
+
};
|
|
300
|
+
/** The filter controls, bound to the view's `draft`, in a column. */
|
|
301
|
+
var Fields = (t0) => {
|
|
302
|
+
const $ = c(14);
|
|
303
|
+
let className;
|
|
304
|
+
let props;
|
|
305
|
+
let ref;
|
|
306
|
+
let render;
|
|
307
|
+
if ($[0] !== t0) {
|
|
308
|
+
({render, className, ref, ...props} = t0);
|
|
309
|
+
$[0] = t0;
|
|
310
|
+
$[1] = className;
|
|
311
|
+
$[2] = props;
|
|
312
|
+
$[3] = ref;
|
|
313
|
+
$[4] = render;
|
|
314
|
+
} else {
|
|
315
|
+
className = $[1];
|
|
316
|
+
props = $[2];
|
|
317
|
+
ref = $[3];
|
|
318
|
+
render = $[4];
|
|
319
|
+
}
|
|
320
|
+
let t1;
|
|
321
|
+
if ($[5] !== className) {
|
|
322
|
+
t1 = clsx(filter_bar_module_default.fields, className);
|
|
323
|
+
$[5] = className;
|
|
324
|
+
$[6] = t1;
|
|
325
|
+
} else t1 = $[6];
|
|
326
|
+
let t2;
|
|
327
|
+
if ($[7] !== props || $[8] !== t1) {
|
|
328
|
+
t2 = {
|
|
329
|
+
...props,
|
|
330
|
+
className: t1
|
|
331
|
+
};
|
|
332
|
+
$[7] = props;
|
|
333
|
+
$[8] = t1;
|
|
334
|
+
$[9] = t2;
|
|
335
|
+
} else t2 = $[9];
|
|
336
|
+
let t3;
|
|
337
|
+
if ($[10] !== ref || $[11] !== render || $[12] !== t2) {
|
|
338
|
+
t3 = {
|
|
339
|
+
defaultTagName: "div",
|
|
340
|
+
render,
|
|
341
|
+
ref,
|
|
342
|
+
props: t2
|
|
343
|
+
};
|
|
344
|
+
$[10] = ref;
|
|
345
|
+
$[11] = render;
|
|
346
|
+
$[12] = t2;
|
|
347
|
+
$[13] = t3;
|
|
348
|
+
} else t3 = $[13];
|
|
349
|
+
return useRender(t3);
|
|
350
|
+
};
|
|
351
|
+
/** The drawer's actions, `FilterBar.Reset` and `FilterBar.Apply`, at its end. */
|
|
352
|
+
var Footer = (t0) => {
|
|
353
|
+
const $ = c(14);
|
|
354
|
+
let className;
|
|
355
|
+
let props;
|
|
356
|
+
let ref;
|
|
357
|
+
let render;
|
|
358
|
+
if ($[0] !== t0) {
|
|
359
|
+
({render, className, ref, ...props} = t0);
|
|
360
|
+
$[0] = t0;
|
|
361
|
+
$[1] = className;
|
|
362
|
+
$[2] = props;
|
|
363
|
+
$[3] = ref;
|
|
364
|
+
$[4] = render;
|
|
365
|
+
} else {
|
|
366
|
+
className = $[1];
|
|
367
|
+
props = $[2];
|
|
368
|
+
ref = $[3];
|
|
369
|
+
render = $[4];
|
|
370
|
+
}
|
|
371
|
+
let t1;
|
|
372
|
+
if ($[5] !== className) {
|
|
373
|
+
t1 = clsx(filter_bar_module_default.footer, className);
|
|
374
|
+
$[5] = className;
|
|
375
|
+
$[6] = t1;
|
|
376
|
+
} else t1 = $[6];
|
|
377
|
+
let t2;
|
|
378
|
+
if ($[7] !== props || $[8] !== t1) {
|
|
379
|
+
t2 = {
|
|
380
|
+
...props,
|
|
381
|
+
className: t1
|
|
382
|
+
};
|
|
383
|
+
$[7] = props;
|
|
384
|
+
$[8] = t1;
|
|
385
|
+
$[9] = t2;
|
|
386
|
+
} else t2 = $[9];
|
|
387
|
+
let t3;
|
|
388
|
+
if ($[10] !== ref || $[11] !== render || $[12] !== t2) {
|
|
389
|
+
t3 = {
|
|
390
|
+
defaultTagName: "div",
|
|
391
|
+
render,
|
|
392
|
+
ref,
|
|
393
|
+
props: t2
|
|
394
|
+
};
|
|
395
|
+
$[10] = ref;
|
|
396
|
+
$[11] = render;
|
|
397
|
+
$[12] = t2;
|
|
398
|
+
$[13] = t3;
|
|
399
|
+
} else t3 = $[13];
|
|
400
|
+
return useRender(t3);
|
|
401
|
+
};
|
|
402
|
+
/** Puts the draft back to the initial filters, without closing the drawer. */
|
|
403
|
+
var Reset = (t0) => {
|
|
404
|
+
const $ = c(13);
|
|
405
|
+
let children;
|
|
406
|
+
let icon;
|
|
407
|
+
let onClick;
|
|
408
|
+
let props;
|
|
409
|
+
if ($[0] !== t0) {
|
|
410
|
+
({icon, children, onClick, ...props} = t0);
|
|
411
|
+
$[0] = t0;
|
|
412
|
+
$[1] = children;
|
|
413
|
+
$[2] = icon;
|
|
414
|
+
$[3] = onClick;
|
|
415
|
+
$[4] = props;
|
|
416
|
+
} else {
|
|
417
|
+
children = $[1];
|
|
418
|
+
icon = $[2];
|
|
419
|
+
onClick = $[3];
|
|
420
|
+
props = $[4];
|
|
421
|
+
}
|
|
422
|
+
const { reset } = useFilterBar();
|
|
423
|
+
let t1;
|
|
424
|
+
if ($[5] !== onClick || $[6] !== reset) {
|
|
425
|
+
t1 = (event) => {
|
|
426
|
+
onClick?.(event);
|
|
427
|
+
reset();
|
|
428
|
+
};
|
|
429
|
+
$[5] = onClick;
|
|
430
|
+
$[6] = reset;
|
|
431
|
+
$[7] = t1;
|
|
432
|
+
} else t1 = $[7];
|
|
433
|
+
let t2;
|
|
434
|
+
if ($[8] !== children || $[9] !== icon || $[10] !== props || $[11] !== t1) {
|
|
435
|
+
t2 = /* @__PURE__ */ jsx(Button, {
|
|
188
436
|
variant: "tertiary",
|
|
189
|
-
icon
|
|
190
|
-
|
|
191
|
-
|
|
437
|
+
icon,
|
|
438
|
+
...props,
|
|
439
|
+
onClick: t1,
|
|
440
|
+
children
|
|
192
441
|
});
|
|
193
|
-
$[
|
|
194
|
-
$[
|
|
195
|
-
$[
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
442
|
+
$[8] = children;
|
|
443
|
+
$[9] = icon;
|
|
444
|
+
$[10] = props;
|
|
445
|
+
$[11] = t1;
|
|
446
|
+
$[12] = t2;
|
|
447
|
+
} else t2 = $[12];
|
|
448
|
+
return t2;
|
|
449
|
+
};
|
|
450
|
+
/** Commits the draft and closes the drawer. */
|
|
451
|
+
var Apply = (t0) => {
|
|
452
|
+
const $ = c(13);
|
|
453
|
+
let children;
|
|
454
|
+
let icon;
|
|
455
|
+
let onClick;
|
|
456
|
+
let props;
|
|
457
|
+
if ($[0] !== t0) {
|
|
458
|
+
({icon, children, onClick, ...props} = t0);
|
|
459
|
+
$[0] = t0;
|
|
460
|
+
$[1] = children;
|
|
461
|
+
$[2] = icon;
|
|
462
|
+
$[3] = onClick;
|
|
463
|
+
$[4] = props;
|
|
464
|
+
} else {
|
|
465
|
+
children = $[1];
|
|
466
|
+
icon = $[2];
|
|
467
|
+
onClick = $[3];
|
|
468
|
+
props = $[4];
|
|
469
|
+
}
|
|
470
|
+
const apply = useApply();
|
|
471
|
+
let t1;
|
|
472
|
+
if ($[5] !== apply || $[6] !== onClick) {
|
|
473
|
+
t1 = (event) => {
|
|
474
|
+
onClick?.(event);
|
|
475
|
+
apply();
|
|
476
|
+
};
|
|
477
|
+
$[5] = apply;
|
|
478
|
+
$[6] = onClick;
|
|
479
|
+
$[7] = t1;
|
|
480
|
+
} else t1 = $[7];
|
|
481
|
+
let t2;
|
|
482
|
+
if ($[8] !== children || $[9] !== icon || $[10] !== props || $[11] !== t1) {
|
|
483
|
+
t2 = /* @__PURE__ */ jsx(Button, {
|
|
200
484
|
variant: "primary",
|
|
201
|
-
icon
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
$[25] = applyLabel;
|
|
206
|
-
$[26] = handleApply;
|
|
207
|
-
$[27] = t12;
|
|
208
|
-
} else t12 = $[27];
|
|
209
|
-
let t13;
|
|
210
|
-
if ($[28] !== t11 || $[29] !== t12) {
|
|
211
|
-
t13 = /* @__PURE__ */ jsxs("div", {
|
|
212
|
-
className: filter_bar_module_default.footer,
|
|
213
|
-
children: [t11, t12]
|
|
214
|
-
});
|
|
215
|
-
$[28] = t11;
|
|
216
|
-
$[29] = t12;
|
|
217
|
-
$[30] = t13;
|
|
218
|
-
} else t13 = $[30];
|
|
219
|
-
let t14;
|
|
220
|
-
if ($[31] !== t10 || $[32] !== t13 || $[33] !== t8) {
|
|
221
|
-
t14 = /* @__PURE__ */ jsxs(Drawer.Portal, { children: [t5, /* @__PURE__ */ jsx(Drawer.Viewport, { children: /* @__PURE__ */ jsx(Drawer.Popup, { children: /* @__PURE__ */ jsxs(Drawer.Content, { children: [
|
|
222
|
-
t8,
|
|
223
|
-
t10,
|
|
224
|
-
t13
|
|
225
|
-
] }) }) })] });
|
|
226
|
-
$[31] = t10;
|
|
227
|
-
$[32] = t13;
|
|
228
|
-
$[33] = t8;
|
|
229
|
-
$[34] = t14;
|
|
230
|
-
} else t14 = $[34];
|
|
231
|
-
let t15;
|
|
232
|
-
if ($[35] !== handleOpenChange || $[36] !== open || $[37] !== swipeDirection || $[38] !== t14 || $[39] !== t4) {
|
|
233
|
-
t15 = /* @__PURE__ */ jsxs(Drawer.Root, {
|
|
234
|
-
open,
|
|
235
|
-
onOpenChange: handleOpenChange,
|
|
236
|
-
swipeDirection,
|
|
237
|
-
children: [t4, t14]
|
|
485
|
+
icon,
|
|
486
|
+
...props,
|
|
487
|
+
onClick: t1,
|
|
488
|
+
children
|
|
238
489
|
});
|
|
239
|
-
$[
|
|
240
|
-
$[
|
|
241
|
-
$[
|
|
242
|
-
$[
|
|
243
|
-
$[
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
return t15;
|
|
490
|
+
$[8] = children;
|
|
491
|
+
$[9] = icon;
|
|
492
|
+
$[10] = props;
|
|
493
|
+
$[11] = t1;
|
|
494
|
+
$[12] = t2;
|
|
495
|
+
} else t2 = $[12];
|
|
496
|
+
return t2;
|
|
247
497
|
};
|
|
248
498
|
/**
|
|
249
|
-
* The applied-filter row: the chips for what is
|
|
250
|
-
*
|
|
251
|
-
*
|
|
499
|
+
* The applied-filter row, on a line of its own: the chips for what is
|
|
500
|
+
* narrowing the list, such as an `ActiveFilters`, and `FilterBar.ClearAll`.
|
|
501
|
+
* Renders nothing while nothing narrows the list.
|
|
252
502
|
*/
|
|
253
503
|
var Active = (t0) => {
|
|
254
|
-
const $ = c(
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
504
|
+
const $ = c(15);
|
|
505
|
+
let className;
|
|
506
|
+
let props;
|
|
507
|
+
let ref;
|
|
508
|
+
let render;
|
|
509
|
+
if ($[0] !== t0) {
|
|
510
|
+
({render, className, ref, ...props} = t0);
|
|
511
|
+
$[0] = t0;
|
|
512
|
+
$[1] = className;
|
|
513
|
+
$[2] = props;
|
|
514
|
+
$[3] = ref;
|
|
515
|
+
$[4] = render;
|
|
516
|
+
} else {
|
|
517
|
+
className = $[1];
|
|
518
|
+
props = $[2];
|
|
519
|
+
ref = $[3];
|
|
520
|
+
render = $[4];
|
|
521
|
+
}
|
|
522
|
+
const { isNarrowed } = useFilterBar();
|
|
258
523
|
let t1;
|
|
259
|
-
if ($[
|
|
524
|
+
if ($[5] !== className) {
|
|
260
525
|
t1 = clsx(filter_bar_module_default.active, className);
|
|
261
|
-
$[
|
|
262
|
-
$[
|
|
263
|
-
} else t1 = $[
|
|
526
|
+
$[5] = className;
|
|
527
|
+
$[6] = t1;
|
|
528
|
+
} else t1 = $[6];
|
|
529
|
+
let t2;
|
|
530
|
+
if ($[7] !== props || $[8] !== t1) {
|
|
531
|
+
t2 = {
|
|
532
|
+
...props,
|
|
533
|
+
className: t1
|
|
534
|
+
};
|
|
535
|
+
$[7] = props;
|
|
536
|
+
$[8] = t1;
|
|
537
|
+
$[9] = t2;
|
|
538
|
+
} else t2 = $[9];
|
|
539
|
+
let t3;
|
|
540
|
+
if ($[10] !== isNarrowed || $[11] !== ref || $[12] !== render || $[13] !== t2) {
|
|
541
|
+
t3 = {
|
|
542
|
+
defaultTagName: "div",
|
|
543
|
+
render,
|
|
544
|
+
ref,
|
|
545
|
+
enabled: isNarrowed,
|
|
546
|
+
props: t2
|
|
547
|
+
};
|
|
548
|
+
$[10] = isNarrowed;
|
|
549
|
+
$[11] = ref;
|
|
550
|
+
$[12] = render;
|
|
551
|
+
$[13] = t2;
|
|
552
|
+
$[14] = t3;
|
|
553
|
+
} else t3 = $[14];
|
|
554
|
+
return useRender(t3);
|
|
555
|
+
};
|
|
556
|
+
/** Clears every committed filter and the search. */
|
|
557
|
+
var ClearAll = (t0) => {
|
|
558
|
+
const $ = c(13);
|
|
559
|
+
let children;
|
|
560
|
+
let icon;
|
|
561
|
+
let onClick;
|
|
562
|
+
let props;
|
|
563
|
+
if ($[0] !== t0) {
|
|
564
|
+
({icon, children, onClick, ...props} = t0);
|
|
565
|
+
$[0] = t0;
|
|
566
|
+
$[1] = children;
|
|
567
|
+
$[2] = icon;
|
|
568
|
+
$[3] = onClick;
|
|
569
|
+
$[4] = props;
|
|
570
|
+
} else {
|
|
571
|
+
children = $[1];
|
|
572
|
+
icon = $[2];
|
|
573
|
+
onClick = $[3];
|
|
574
|
+
props = $[4];
|
|
575
|
+
}
|
|
576
|
+
const { clearAll } = useFilterBar();
|
|
577
|
+
let t1;
|
|
578
|
+
if ($[5] !== clearAll || $[6] !== onClick) {
|
|
579
|
+
t1 = (event) => {
|
|
580
|
+
onClick?.(event);
|
|
581
|
+
clearAll();
|
|
582
|
+
};
|
|
583
|
+
$[5] = clearAll;
|
|
584
|
+
$[6] = onClick;
|
|
585
|
+
$[7] = t1;
|
|
586
|
+
} else t1 = $[7];
|
|
264
587
|
let t2;
|
|
265
|
-
if ($[
|
|
588
|
+
if ($[8] !== children || $[9] !== icon || $[10] !== props || $[11] !== t1) {
|
|
266
589
|
t2 = /* @__PURE__ */ jsx(Button, {
|
|
267
590
|
variant: "tertiary",
|
|
268
|
-
icon
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
$[2] = clearAll;
|
|
273
|
-
$[3] = clearAllLabel;
|
|
274
|
-
$[4] = t2;
|
|
275
|
-
} else t2 = $[4];
|
|
276
|
-
let t3;
|
|
277
|
-
if ($[5] !== children || $[6] !== t1 || $[7] !== t2) {
|
|
278
|
-
t3 = /* @__PURE__ */ jsxs("div", {
|
|
279
|
-
className: t1,
|
|
280
|
-
children: [children, t2]
|
|
591
|
+
icon,
|
|
592
|
+
...props,
|
|
593
|
+
onClick: t1,
|
|
594
|
+
children
|
|
281
595
|
});
|
|
282
|
-
$[
|
|
283
|
-
$[
|
|
284
|
-
$[
|
|
285
|
-
$[
|
|
286
|
-
|
|
287
|
-
|
|
596
|
+
$[8] = children;
|
|
597
|
+
$[9] = icon;
|
|
598
|
+
$[10] = props;
|
|
599
|
+
$[11] = t1;
|
|
600
|
+
$[12] = t2;
|
|
601
|
+
} else t2 = $[12];
|
|
602
|
+
return t2;
|
|
288
603
|
};
|
|
289
604
|
/**
|
|
290
|
-
* Composite filter surface. `Root` holds a `useFilterView` in context
|
|
291
|
-
*
|
|
292
|
-
*
|
|
605
|
+
* Composite filter surface. `Root` holds a `useFilterView` in context: `Search`
|
|
606
|
+
* and the `Drawer` share the leading row, and `Active`, the applied-filter row,
|
|
607
|
+
* takes a line of its own. The drawer's header is the `Drawer` component's own
|
|
608
|
+
* `Drawer.Header`, `Drawer.Title` and `Drawer.CloseButton`.
|
|
293
609
|
*
|
|
294
610
|
* @example
|
|
295
611
|
* <FilterBar.Root filters={filters}>
|
|
296
|
-
* <FilterBar.Search label="Search clients" clearLabel="Clear search" optionalLabel="optional" />
|
|
297
|
-
* <FilterBar.Drawer swipeDirection={narrow ? "down" : "right"}
|
|
298
|
-
* <
|
|
612
|
+
* <FilterBar.Search label="Search clients" clearLabel="Clear search" clearIcon={<CloseIcon />} icon={<SearchIcon />} optionalLabel="optional" />
|
|
613
|
+
* <FilterBar.Drawer swipeDirection={narrow ? "down" : "right"}>
|
|
614
|
+
* <FilterBar.Trigger icon={<FilterIcon />}>Filters<FilterBar.Badge /></FilterBar.Trigger>
|
|
615
|
+
* <FilterBar.Content>
|
|
616
|
+
* <Drawer.Header>
|
|
617
|
+
* <Drawer.Title>Filter clients</Drawer.Title>
|
|
618
|
+
* <Drawer.CloseButton closeLabel="Close" icon={<CloseIcon />} />
|
|
619
|
+
* </Drawer.Header>
|
|
620
|
+
* <FilterBar.Fields><ClientFilterFields filters={filters} /></FilterBar.Fields>
|
|
621
|
+
* <FilterBar.Footer>
|
|
622
|
+
* <FilterBar.Reset>Reset</FilterBar.Reset>
|
|
623
|
+
* <FilterBar.Apply>Apply</FilterBar.Apply>
|
|
624
|
+
* </FilterBar.Footer>
|
|
625
|
+
* </FilterBar.Content>
|
|
299
626
|
* </FilterBar.Drawer>
|
|
300
|
-
* <FilterBar.Active
|
|
301
|
-
* <ActiveFilters filters={filters} describe={describers} label="Active filters" removeLabel="Remove" />
|
|
627
|
+
* <FilterBar.Active>
|
|
628
|
+
* <ActiveFilters filters={filters} describe={describers} label="Active filters" removeLabel="Remove" removeIcon={<CloseIcon />} />
|
|
629
|
+
* <FilterBar.ClearAll>Clear filters</FilterBar.ClearAll>
|
|
302
630
|
* </FilterBar.Active>
|
|
303
631
|
* </FilterBar.Root>
|
|
304
632
|
*/
|
|
@@ -306,6 +634,14 @@ var FilterBar = {
|
|
|
306
634
|
Root,
|
|
307
635
|
Search,
|
|
308
636
|
Drawer: FilterDrawer,
|
|
309
|
-
|
|
637
|
+
Trigger,
|
|
638
|
+
Badge: FilterBadge,
|
|
639
|
+
Content,
|
|
640
|
+
Fields,
|
|
641
|
+
Footer,
|
|
642
|
+
Reset,
|
|
643
|
+
Apply,
|
|
644
|
+
Active,
|
|
645
|
+
ClearAll
|
|
310
646
|
};
|
|
311
647
|
export { FilterBar };
|