@igne-agency/react-web-ui 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base.css +3 -0
- package/dist/components/accordion/accordion.css +21 -21
- package/dist/components/accordion/accordion.d.ts +17 -4
- package/dist/components/accordion/accordion.js +83 -36
- package/dist/components/accordion/accordion.module.js +6 -6
- package/dist/components/attachment-tile/attachment-preview.d.ts +56 -13
- package/dist/components/attachment-tile/attachment-preview.js +388 -119
- package/dist/components/attachment-tile/attachment-tile.css +31 -25
- package/dist/components/attachment-tile/attachment-tile.d.ts +32 -10
- package/dist/components/attachment-tile/attachment-tile.js +160 -43
- package/dist/components/attachment-tile/attachment-tile.module.js +8 -8
- package/dist/components/attachment-tile/index.d.ts +1 -1
- package/dist/components/avatar/avatar.css +9 -9
- package/dist/components/avatar/avatar.d.ts +50 -5
- package/dist/components/avatar/avatar.js +178 -64
- package/dist/components/avatar/avatar.module.js +3 -3
- package/dist/components/avatar-group/avatar-group-context.d.ts +2 -4
- package/dist/components/avatar-group/avatar-group-context.js +2 -2
- package/dist/components/avatar-group/avatar-group.css +26 -20
- package/dist/components/avatar-group/avatar-group.d.ts +85 -27
- package/dist/components/avatar-group/avatar-group.js +400 -246
- package/dist/components/avatar-group/avatar-group.module.js +8 -8
- package/dist/components/breadcrumbs/breadcrumbs.css +12 -12
- package/dist/components/breadcrumbs/breadcrumbs.d.ts +69 -23
- package/dist/components/breadcrumbs/breadcrumbs.js +299 -248
- package/dist/components/breadcrumbs/breadcrumbs.module.js +8 -8
- package/dist/components/button/button.css +29 -31
- package/dist/components/button/button.d.ts +20 -16
- package/dist/components/button/button.js +140 -145
- package/dist/components/button/button.module.js +1 -1
- package/dist/components/button/index.js +1 -1
- package/dist/components/checkbox-field/checkbox-field.js +63 -49
- package/dist/components/checkbox-field/checkbox.css +105 -56
- package/dist/components/checkbox-field/checkbox.d.ts +3 -2
- package/dist/components/checkbox-field/checkbox.js +12 -9
- package/dist/components/checkbox-field/checkbox.module.js +4 -4
- package/dist/components/checkbox-group-field/checkbox-group-field.js +78 -72
- package/dist/components/checkbox-group-field/checkbox-group.css +14 -10
- package/dist/components/checkbox-group-field/checkbox-group.d.ts +2 -2
- package/dist/components/checkbox-group-field/checkbox-group.js +2 -2
- package/dist/components/checkbox-group-field/checkbox-group.module.js +2 -2
- package/dist/components/collapsible/collapsible.css +20 -20
- package/dist/components/collapsible/collapsible.d.ts +17 -4
- package/dist/components/collapsible/collapsible.js +83 -36
- package/dist/components/collapsible/collapsible.module.js +5 -5
- package/dist/components/combobox-field/combobox-field.js +206 -158
- package/dist/components/combobox-field/combobox.css +492 -277
- package/dist/components/combobox-field/combobox.d.ts +148 -39
- package/dist/components/combobox-field/combobox.js +506 -206
- package/dist/components/combobox-field/combobox.module.js +21 -21
- package/dist/components/combobox-field/value-state-view.css +5 -5
- package/dist/components/combobox-field/value-state-view.module.js +4 -4
- package/dist/components/composer/composer-attachments.d.ts +30 -11
- package/dist/components/composer/composer-attachments.js +45 -40
- package/dist/components/composer/composer-editor.css +40 -35
- package/dist/components/composer/composer-editor.d.ts +14 -4
- package/dist/components/composer/composer-editor.js +134 -44
- package/dist/components/composer/composer-editor.module.js +5 -5
- package/dist/components/composer/composer.css +22 -22
- package/dist/components/composer/composer.d.ts +13 -2
- package/dist/components/composer/composer.js +78 -63
- package/dist/components/composer/composer.module.js +5 -5
- package/dist/components/composer/index.d.ts +2 -2
- package/dist/components/composer/mention-text.css +5 -5
- package/dist/components/composer/mention-text.module.js +1 -1
- package/dist/components/confirm-dialog/confirm-dialog.css +29 -29
- package/dist/components/confirm-dialog/confirm-dialog.d.ts +57 -3
- package/dist/components/confirm-dialog/confirm-dialog.js +266 -108
- package/dist/components/confirm-dialog/confirm-dialog.module.js +5 -5
- package/dist/components/conversation/conversation.css +52 -52
- package/dist/components/conversation/conversation.d.ts +43 -18
- package/dist/components/conversation/conversation.js +120 -78
- package/dist/components/conversation/conversation.module.js +15 -15
- package/dist/components/date-field/date-field.d.ts +1 -1
- package/dist/components/date-field/date-field.js +202 -100
- package/dist/components/date-field/date-input.d.ts +73 -37
- package/dist/components/date-field/date-input.js +72 -45
- package/dist/components/date-field/index.d.ts +1 -1
- package/dist/components/date-range-field/date-range-field.d.ts +1 -1
- package/dist/components/date-range-field/date-range-field.js +219 -107
- package/dist/components/date-range-field/date-range-input.d.ts +84 -40
- package/dist/components/date-range-field/date-range-input.js +83 -48
- package/dist/components/dialog/dialog.css +32 -32
- package/dist/components/dialog/dialog.d.ts +8 -7
- package/dist/components/dialog/dialog.js +8 -26
- package/dist/components/dialog/dialog.module.js +6 -6
- package/dist/components/divider/divider.css +6 -6
- package/dist/components/divider/divider.d.ts +36 -2
- package/dist/components/divider/divider.js +195 -29
- package/dist/components/divider/divider.module.js +3 -3
- package/dist/components/drawer/drawer.css +55 -56
- package/dist/components/drawer/drawer.d.ts +8 -7
- package/dist/components/drawer/drawer.js +8 -26
- package/dist/components/drawer/drawer.module.js +6 -6
- package/dist/components/field/field.css +34 -24
- package/dist/components/field/field.d.ts +60 -37
- package/dist/components/field/field.js +242 -157
- package/dist/components/field/field.module.js +12 -10
- package/dist/components/field/input-parts.d.ts +11 -13
- package/dist/components/field/input-parts.js +23 -42
- package/dist/components/field-placeholder/field-placeholder.css +6 -6
- package/dist/components/field-placeholder/field-placeholder.module.js +4 -4
- package/dist/components/fieldset/field-group.d.ts +1 -1
- package/dist/components/fieldset/field-group.js +48 -42
- package/dist/components/fieldset/fieldset-root.d.ts +1 -1
- package/dist/components/fieldset/fieldset-root.js +19 -17
- package/dist/components/fieldset/fieldset.d.ts +2 -2
- package/dist/components/fieldset/fieldset.js +2 -2
- package/dist/components/file-field/file-field.css +126 -60
- package/dist/components/file-field/file-field.js +201 -109
- package/dist/components/file-field/file-field.module.js +4 -4
- package/dist/components/file-field/file-input.d.ts +66 -40
- package/dist/components/file-field/file-input.js +188 -132
- package/dist/components/filter-bar/filter-bar.css +8 -8
- package/dist/components/filter-bar/filter-bar.d.ts +12 -3
- package/dist/components/filter-bar/filter-bar.js +23 -25
- package/dist/components/filter-bar/filter-bar.module.js +5 -5
- package/dist/components/form/form.d.ts +19 -7
- package/dist/components/form/form.js +80 -29
- package/dist/components/icon/icon.css +2 -2
- package/dist/components/icon/icon.module.js +1 -1
- package/dist/components/link/link.css +6 -5
- package/dist/components/link/link.module.js +1 -1
- package/dist/components/menu/menu.css +52 -47
- package/dist/components/menu/menu.d.ts +32 -25
- package/dist/components/menu/menu.js +75 -124
- package/dist/components/menu/menu.module.js +8 -8
- package/dist/components/nav/nav-context.d.ts +1 -1
- package/dist/components/nav/nav-item-view.d.ts +10 -13
- package/dist/components/nav/nav-item-view.js +42 -54
- package/dist/components/nav/nav.css +150 -119
- package/dist/components/nav/nav.d.ts +61 -17
- package/dist/components/nav/nav.js +271 -176
- package/dist/components/nav/nav.module.js +17 -15
- package/dist/components/number-field/number-field.css +153 -64
- package/dist/components/number-field/number-field.d.ts +2 -2
- package/dist/components/number-field/number-field.js +112 -91
- package/dist/components/number-field/number-field.module.js +6 -6
- package/dist/components/number-field/number-input.d.ts +43 -23
- package/dist/components/number-field/number-input.js +179 -125
- package/dist/components/otp-field/otp-field.css +153 -60
- package/dist/components/otp-field/otp-field.d.ts +2 -2
- package/dist/components/otp-field/otp-field.js +62 -46
- package/dist/components/otp-field/otp-field.module.js +4 -4
- package/dist/components/otp-field/otp-input.d.ts +8 -6
- package/dist/components/otp-field/otp-input.js +92 -92
- package/dist/components/pagination/pagination.d.ts +46 -15
- package/dist/components/pagination/pagination.js +217 -224
- package/dist/components/password-field/password-field.css +23 -23
- package/dist/components/password-field/password-field.js +107 -85
- package/dist/components/password-field/password-field.module.js +8 -8
- package/dist/components/password-field/password-strength.d.ts +107 -3
- package/dist/components/password-field/password-strength.js +569 -92
- package/dist/components/photo-field/photo-field.js +137 -112
- package/dist/components/photo-field/photo-input.css +67 -44
- package/dist/components/photo-field/photo-input.d.ts +59 -15
- package/dist/components/photo-field/photo-input.js +173 -86
- package/dist/components/photo-field/photo-input.module.js +10 -8
- package/dist/components/popover/popover.css +41 -41
- package/dist/components/popover/popover.d.ts +66 -25
- package/dist/components/popover/popover.js +332 -217
- package/dist/components/popover/popover.module.js +15 -19
- package/dist/components/radio-group-field/radio-group-field.js +80 -71
- package/dist/components/radio-group-field/radio-group.css +112 -60
- package/dist/components/radio-group-field/radio-group.d.ts +19 -3
- package/dist/components/radio-group-field/radio-group.js +66 -23
- package/dist/components/radio-group-field/radio-group.module.js +4 -4
- package/dist/components/segmented-control-field/segmented-control-field.d.ts +1 -1
- package/dist/components/segmented-control-field/segmented-control-field.js +111 -96
- package/dist/components/segmented-control-field/segmented-control.css +132 -79
- package/dist/components/segmented-control-field/segmented-control.d.ts +39 -15
- package/dist/components/segmented-control-field/segmented-control.js +124 -41
- package/dist/components/segmented-control-field/segmented-control.module.js +4 -4
- package/dist/components/select-field/select.css +214 -101
- package/dist/components/select-field/select.d.ts +43 -11
- package/dist/components/select-field/select.js +194 -109
- package/dist/components/select-field/select.module.js +14 -14
- package/dist/components/skeleton/skeleton.css +4 -4
- package/dist/components/skeleton/skeleton.module.js +3 -3
- package/dist/components/stale/stale.css +15 -15
- package/dist/components/stale/stale.d.ts +27 -3
- package/dist/components/stale/stale.js +147 -66
- package/dist/components/stale/stale.module.js +6 -6
- package/dist/components/status-message/status-message.css +22 -22
- package/dist/components/status-message/status-message.module.js +6 -6
- package/dist/components/switch-field/switch-field.js +77 -57
- package/dist/components/switch-field/switch.css +112 -63
- package/dist/components/switch-field/switch.d.ts +20 -3
- package/dist/components/switch-field/switch.js +70 -27
- package/dist/components/switch-field/switch.module.js +4 -4
- package/dist/components/tabs/tabs.css +32 -32
- package/dist/components/tabs/tabs.d.ts +21 -7
- package/dist/components/tabs/tabs.js +73 -14
- package/dist/components/tabs/tabs.module.js +7 -7
- package/dist/components/tag/tag.css +84 -84
- package/dist/components/tag/tag.module.js +3 -3
- package/dist/components/tag-group/tag-group.css +94 -94
- package/dist/components/tag-group/tag-group.module.js +4 -4
- package/dist/components/text-field/text-field.css +159 -82
- package/dist/components/text-field/text-field.d.ts +1 -1
- package/dist/components/text-field/text-field.js +139 -110
- package/dist/components/text-field/text-field.module.js +9 -9
- package/dist/components/text-field/text-input.d.ts +81 -45
- package/dist/components/text-field/text-input.js +366 -217
- package/dist/components/textarea-field/textarea-field.css +7 -2
- package/dist/components/textarea-field/textarea-field.js +72 -56
- package/dist/components/textarea-field/textarea-field.module.js +2 -2
- package/dist/components/time-field/time-field.js +153 -60
- package/dist/components/time-field/time-input.d.ts +21 -10
- package/dist/components/time-field/time-input.js +22 -11
- package/dist/components/toast/toast-provider.css +34 -31
- package/dist/components/toast/toast-provider.d.ts +63 -14
- package/dist/components/toast/toast-provider.js +174 -111
- package/dist/components/toast/toast-provider.module.js +7 -7
- package/dist/components/toggle-group-field/toggle-group-field.d.ts +1 -1
- package/dist/components/toggle-group-field/toggle-group-field.js +95 -89
- package/dist/components/toggle-group-field/toggle-group.css +117 -67
- package/dist/components/toggle-group-field/toggle-group.d.ts +2 -2
- package/dist/components/toggle-group-field/toggle-group.js +2 -2
- package/dist/components/toggle-group-field/toggle-group.module.js +2 -2
- package/dist/components/tooltip/tooltip.css +4 -4
- package/dist/components/tooltip/tooltip.module.js +1 -1
- package/dist/data-table/data-table-content.js +6 -5
- package/dist/data-table/data-table-parts.d.ts +41 -13
- package/dist/data-table/data-table-parts.js +213 -172
- package/dist/data-table/data-table-selection.d.ts +105 -3
- package/dist/data-table/data-table-selection.js +654 -145
- package/dist/data-table/data-table.css +125 -128
- package/dist/data-table/data-table.d.ts +21 -26
- package/dist/data-table/data-table.js +20 -23
- package/dist/data-table/data-table.module.js +32 -34
- package/dist/data-table/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/lib/calendar/calendar-navigation.d.ts +39 -5
- package/dist/lib/calendar/calendar-navigation.js +185 -118
- package/dist/lib/calendar/calendar-parts.d.ts +143 -0
- package/dist/lib/calendar/calendar-parts.js +540 -0
- package/dist/lib/calendar/calendar-prefab.d.ts +52 -0
- package/dist/lib/calendar/calendar-prefab.js +311 -0
- package/dist/lib/calendar/calendar-year.d.ts +3 -1
- package/dist/lib/calendar/calendar-year.js +139 -131
- package/dist/lib/calendar/temporal.css +325 -232
- package/dist/lib/calendar/temporal.d.ts +67 -82
- package/dist/lib/calendar/temporal.js +258 -569
- package/dist/lib/calendar/temporal.module.js +38 -38
- package/dist/lib/forms/use-connected-field.d.ts +1 -1
- package/dist/lib/forms/use-connected-field.js +1 -1
- package/dist/lib/render-as.d.ts +13 -0
- package/dist/lib/render-as.js +46 -0
- package/dist/terrazzo/index.d.ts +4 -3
- package/dist/terrazzo/index.js +17 -6
- package/dist/tokens.css +28 -4
- package/package.json +2 -2
- package/tokens/dark.tokens.json +6 -0
- package/tokens/sys.tokens.json +7 -0
- package/dist/components/button/close-button.d.ts +0 -16
- package/dist/components/button/close-button.js +0 -30
|
@@ -5,13 +5,12 @@ import { Field } from "../field/field.js";
|
|
|
5
5
|
import { fieldStateAttributes } from "../field/field-state.js";
|
|
6
6
|
import { useFieldFocus, withFieldFocus } from "../field/use-field-focus.js";
|
|
7
7
|
import { Spinner } from "../spinner/spinner.js";
|
|
8
|
-
import { Tooltip } from "../tooltip/tooltip.js";
|
|
9
8
|
import { pagedProgress } from "./combobox-items.js";
|
|
10
9
|
import combobox_module_default from "./combobox.module.js";
|
|
11
10
|
import { c } from "react/compiler-runtime";
|
|
12
11
|
import { clsx } from "clsx";
|
|
13
12
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
-
import { useRef } from "react";
|
|
13
|
+
import { createContext, useContext, useRef } from "react";
|
|
15
14
|
import { Button, Tag, TagGroup, TagList } from "react-aria-components";
|
|
16
15
|
import { Combobox } from "@base-ui/react/combobox";
|
|
17
16
|
// src/components/combobox-field/combobox.tsx
|
|
@@ -43,6 +42,8 @@ var ComboboxRoot = (t0) => {
|
|
|
43
42
|
return t3;
|
|
44
43
|
};
|
|
45
44
|
var NO_STATE = {};
|
|
45
|
+
var ControlStateContext = createContext(NO_STATE);
|
|
46
|
+
var ControlBusyContext = createContext(void 0);
|
|
46
47
|
var CONTROL_SELECTOR = "[data-combobox-control]";
|
|
47
48
|
var TAG_SELECTOR = "[data-combobox-tag]";
|
|
48
49
|
var TRIGGER_SELECTOR = "[data-combobox-trigger]";
|
|
@@ -56,7 +57,13 @@ var focusTagAt = (control, edge) => {
|
|
|
56
57
|
var focusTrigger = (control) => {
|
|
57
58
|
control?.querySelector(TRIGGER_SELECTOR)?.focus();
|
|
58
59
|
};
|
|
59
|
-
/**
|
|
60
|
+
/**
|
|
61
|
+
* The chevron at the end of the trigger. Its children are the icon; without
|
|
62
|
+
* them it renders nothing.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* <Combobox.Icon><ExpandMoreIcon /></Combobox.Icon>
|
|
66
|
+
*/
|
|
60
67
|
var ComboboxIcon = (t0) => {
|
|
61
68
|
const $ = c(8);
|
|
62
69
|
let children;
|
|
@@ -87,140 +94,325 @@ var ComboboxIcon = (t0) => {
|
|
|
87
94
|
} else t1 = $[7];
|
|
88
95
|
return t1;
|
|
89
96
|
};
|
|
90
|
-
/**
|
|
97
|
+
/**
|
|
98
|
+
* The control's box, projecting `state` onto itself and holding the `Chips`
|
|
99
|
+
* and the `Trigger`. The positioner takes it as its `anchor`.
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* <Combobox.Control ref={anchorRef} state={state}>
|
|
103
|
+
* <Combobox.Trigger>…</Combobox.Trigger>
|
|
104
|
+
* </Combobox.Control>
|
|
105
|
+
*/
|
|
91
106
|
var ComboboxControl = (t0) => {
|
|
92
|
-
const $ = c(
|
|
107
|
+
const $ = c(26);
|
|
93
108
|
let children;
|
|
94
109
|
let className;
|
|
95
|
-
let icon;
|
|
96
110
|
let props;
|
|
97
111
|
let t1;
|
|
98
|
-
let tags;
|
|
99
112
|
if ($[0] !== t0) {
|
|
100
|
-
({className, children,
|
|
113
|
+
({className, children, state: t1, ...props} = t0);
|
|
101
114
|
$[0] = t0;
|
|
102
115
|
$[1] = children;
|
|
103
116
|
$[2] = className;
|
|
104
|
-
$[3] =
|
|
105
|
-
$[4] =
|
|
106
|
-
$[5] = t1;
|
|
107
|
-
$[6] = tags;
|
|
117
|
+
$[3] = props;
|
|
118
|
+
$[4] = t1;
|
|
108
119
|
} else {
|
|
109
120
|
children = $[1];
|
|
110
121
|
className = $[2];
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
t1 = $[5];
|
|
114
|
-
tags = $[6];
|
|
122
|
+
props = $[3];
|
|
123
|
+
t1 = $[4];
|
|
115
124
|
}
|
|
116
125
|
const state = t1 === void 0 ? NO_STATE : t1;
|
|
117
126
|
const focus = useFieldFocus(props);
|
|
118
127
|
let t2;
|
|
119
|
-
if ($[
|
|
128
|
+
if ($[5] !== focus || $[6] !== state) {
|
|
120
129
|
t2 = fieldStateAttributes(withFieldFocus(state, focus));
|
|
121
|
-
$[
|
|
122
|
-
$[
|
|
123
|
-
$[
|
|
124
|
-
} else t2 = $[
|
|
130
|
+
$[5] = focus;
|
|
131
|
+
$[6] = state;
|
|
132
|
+
$[7] = t2;
|
|
133
|
+
} else t2 = $[7];
|
|
125
134
|
let attributes;
|
|
126
135
|
let busy;
|
|
127
|
-
if ($[
|
|
136
|
+
if ($[8] !== t2) {
|
|
128
137
|
({"aria-busy": busy, ...attributes} = t2);
|
|
129
|
-
$[
|
|
130
|
-
$[
|
|
131
|
-
$[
|
|
138
|
+
$[8] = t2;
|
|
139
|
+
$[9] = attributes;
|
|
140
|
+
$[10] = busy;
|
|
132
141
|
} else {
|
|
133
|
-
attributes = $[
|
|
134
|
-
busy = $[
|
|
142
|
+
attributes = $[9];
|
|
143
|
+
busy = $[10];
|
|
135
144
|
}
|
|
136
145
|
const t3 = state.disabled === true || void 0;
|
|
137
146
|
let t4;
|
|
138
|
-
if ($[
|
|
147
|
+
if ($[11] !== className) {
|
|
139
148
|
t4 = clsx(combobox_module_default.control, className);
|
|
140
|
-
$[
|
|
141
|
-
$[
|
|
142
|
-
} else t4 = $[
|
|
149
|
+
$[11] = className;
|
|
150
|
+
$[12] = t4;
|
|
151
|
+
} else t4 = $[12];
|
|
143
152
|
let t5;
|
|
144
|
-
if ($[
|
|
145
|
-
t5 =
|
|
146
|
-
|
|
147
|
-
onKeyDownCapture: _temp,
|
|
148
|
-
children: tags
|
|
149
|
-
});
|
|
150
|
-
$[15] = tags;
|
|
151
|
-
$[16] = t5;
|
|
152
|
-
} else t5 = $[16];
|
|
153
|
-
const t6 = state.validity === "invalid" || void 0;
|
|
154
|
-
const t7 = tags === void 0 ? combobox_module_default.content : combobox_module_default.spokenValue;
|
|
155
|
-
let t8;
|
|
156
|
-
if ($[17] !== children || $[18] !== t7) {
|
|
157
|
-
t8 = /* @__PURE__ */ jsx("span", {
|
|
158
|
-
className: t7,
|
|
153
|
+
if ($[13] !== busy || $[14] !== children) {
|
|
154
|
+
t5 = /* @__PURE__ */ jsx(ControlBusyContext, {
|
|
155
|
+
value: busy,
|
|
159
156
|
children
|
|
160
157
|
});
|
|
161
|
-
$[
|
|
162
|
-
$[
|
|
163
|
-
$[
|
|
164
|
-
} else
|
|
165
|
-
let
|
|
166
|
-
if ($[
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
} else t9 = $[21];
|
|
171
|
-
let t10;
|
|
172
|
-
if ($[22] !== icon) {
|
|
173
|
-
t10 = /* @__PURE__ */ jsx(ComboboxIcon, { children: icon });
|
|
174
|
-
$[22] = icon;
|
|
175
|
-
$[23] = t10;
|
|
176
|
-
} else t10 = $[23];
|
|
177
|
-
let t11;
|
|
178
|
-
if ($[24] !== busy || $[25] !== t10 || $[26] !== t6 || $[27] !== t8 || $[28] !== t9) {
|
|
179
|
-
t11 = /* @__PURE__ */ jsxs(Combobox.Trigger, {
|
|
180
|
-
"data-combobox-trigger": "",
|
|
181
|
-
"aria-invalid": t6,
|
|
182
|
-
"aria-busy": busy,
|
|
183
|
-
className: combobox_module_default.trigger,
|
|
184
|
-
onKeyDown: _temp2,
|
|
185
|
-
children: [
|
|
186
|
-
t8,
|
|
187
|
-
t9,
|
|
188
|
-
t10
|
|
189
|
-
]
|
|
158
|
+
$[13] = busy;
|
|
159
|
+
$[14] = children;
|
|
160
|
+
$[15] = t5;
|
|
161
|
+
} else t5 = $[15];
|
|
162
|
+
let t6;
|
|
163
|
+
if ($[16] !== state || $[17] !== t5) {
|
|
164
|
+
t6 = /* @__PURE__ */ jsx(ControlStateContext, {
|
|
165
|
+
value: state,
|
|
166
|
+
children: t5
|
|
190
167
|
});
|
|
191
|
-
$[
|
|
192
|
-
$[
|
|
193
|
-
$[
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
let t12;
|
|
199
|
-
if ($[30] !== attributes || $[31] !== focus.props || $[32] !== props || $[33] !== t11 || $[34] !== t3 || $[35] !== t4 || $[36] !== t5) {
|
|
200
|
-
t12 = /* @__PURE__ */ jsxs(Combobox.InputGroup, {
|
|
168
|
+
$[16] = state;
|
|
169
|
+
$[17] = t5;
|
|
170
|
+
$[18] = t6;
|
|
171
|
+
} else t6 = $[18];
|
|
172
|
+
let t7;
|
|
173
|
+
if ($[19] !== attributes || $[20] !== focus.props || $[21] !== props || $[22] !== t3 || $[23] !== t4 || $[24] !== t6) {
|
|
174
|
+
t7 = /* @__PURE__ */ jsx(Combobox.InputGroup, {
|
|
201
175
|
"data-combobox-control": "",
|
|
202
176
|
"aria-disabled": t3,
|
|
203
177
|
className: t4,
|
|
204
178
|
...attributes,
|
|
205
179
|
...props,
|
|
206
180
|
...focus.props,
|
|
207
|
-
children:
|
|
181
|
+
children: t6
|
|
182
|
+
});
|
|
183
|
+
$[19] = attributes;
|
|
184
|
+
$[20] = focus.props;
|
|
185
|
+
$[21] = props;
|
|
186
|
+
$[22] = t3;
|
|
187
|
+
$[23] = t4;
|
|
188
|
+
$[24] = t6;
|
|
189
|
+
$[25] = t7;
|
|
190
|
+
} else t7 = $[25];
|
|
191
|
+
return t7;
|
|
192
|
+
};
|
|
193
|
+
/**
|
|
194
|
+
* The button that opens the popup, holding the value, `Pending` and `Icon`.
|
|
195
|
+
* The arrow keys move between it and the `Chips` beside it.
|
|
196
|
+
*
|
|
197
|
+
* @example
|
|
198
|
+
* <Combobox.Trigger>
|
|
199
|
+
* <Combobox.TriggerValue>{label}</Combobox.TriggerValue>
|
|
200
|
+
* <Combobox.Icon><ExpandMoreIcon /></Combobox.Icon>
|
|
201
|
+
* </Combobox.Trigger>
|
|
202
|
+
*/
|
|
203
|
+
var ComboboxTrigger = (t0) => {
|
|
204
|
+
const $ = c(14);
|
|
205
|
+
let className;
|
|
206
|
+
let onKeyDown;
|
|
207
|
+
let props;
|
|
208
|
+
if ($[0] !== t0) {
|
|
209
|
+
({className, onKeyDown, ...props} = t0);
|
|
210
|
+
$[0] = t0;
|
|
211
|
+
$[1] = className;
|
|
212
|
+
$[2] = onKeyDown;
|
|
213
|
+
$[3] = props;
|
|
214
|
+
} else {
|
|
215
|
+
className = $[1];
|
|
216
|
+
onKeyDown = $[2];
|
|
217
|
+
props = $[3];
|
|
218
|
+
}
|
|
219
|
+
const state = useContext(ControlStateContext);
|
|
220
|
+
const busy = useContext(ControlBusyContext);
|
|
221
|
+
const t1 = state.validity === "invalid" || void 0;
|
|
222
|
+
let t2;
|
|
223
|
+
if ($[4] !== className) {
|
|
224
|
+
t2 = clsx(combobox_module_default.trigger, className);
|
|
225
|
+
$[4] = className;
|
|
226
|
+
$[5] = t2;
|
|
227
|
+
} else t2 = $[5];
|
|
228
|
+
let t3;
|
|
229
|
+
if ($[6] !== onKeyDown) {
|
|
230
|
+
t3 = (event) => {
|
|
231
|
+
onKeyDown?.(event);
|
|
232
|
+
const control = event.currentTarget.parentElement;
|
|
233
|
+
if (event.key === "ArrowRight" && focusTagAt(control, "first")) event.preventDefault();
|
|
234
|
+
if (event.key === "ArrowLeft" && focusTagAt(control, "last")) event.preventDefault();
|
|
235
|
+
};
|
|
236
|
+
$[6] = onKeyDown;
|
|
237
|
+
$[7] = t3;
|
|
238
|
+
} else t3 = $[7];
|
|
239
|
+
let t4;
|
|
240
|
+
if ($[8] !== busy || $[9] !== props || $[10] !== t1 || $[11] !== t2 || $[12] !== t3) {
|
|
241
|
+
t4 = /* @__PURE__ */ jsx(Combobox.Trigger, {
|
|
242
|
+
"data-combobox-trigger": "",
|
|
243
|
+
"aria-invalid": t1,
|
|
244
|
+
"aria-busy": busy,
|
|
245
|
+
className: t2,
|
|
246
|
+
onKeyDown: t3,
|
|
247
|
+
...props
|
|
248
|
+
});
|
|
249
|
+
$[8] = busy;
|
|
250
|
+
$[9] = props;
|
|
251
|
+
$[10] = t1;
|
|
252
|
+
$[11] = t2;
|
|
253
|
+
$[12] = t3;
|
|
254
|
+
$[13] = t4;
|
|
255
|
+
} else t4 = $[13];
|
|
256
|
+
return t4;
|
|
257
|
+
};
|
|
258
|
+
/**
|
|
259
|
+
* The value the trigger shows, such as the chosen item or the placeholder.
|
|
260
|
+
*
|
|
261
|
+
* @example
|
|
262
|
+
* <Combobox.TriggerValue>{label ?? placeholder}</Combobox.TriggerValue>
|
|
263
|
+
*/
|
|
264
|
+
var ComboboxTriggerValue = (t0) => {
|
|
265
|
+
const $ = c(8);
|
|
266
|
+
let className;
|
|
267
|
+
let props;
|
|
268
|
+
if ($[0] !== t0) {
|
|
269
|
+
({className, ...props} = t0);
|
|
270
|
+
$[0] = t0;
|
|
271
|
+
$[1] = className;
|
|
272
|
+
$[2] = props;
|
|
273
|
+
} else {
|
|
274
|
+
className = $[1];
|
|
275
|
+
props = $[2];
|
|
276
|
+
}
|
|
277
|
+
let t1;
|
|
278
|
+
if ($[3] !== className) {
|
|
279
|
+
t1 = clsx(combobox_module_default.content, className);
|
|
280
|
+
$[3] = className;
|
|
281
|
+
$[4] = t1;
|
|
282
|
+
} else t1 = $[4];
|
|
283
|
+
let t2;
|
|
284
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
285
|
+
t2 = /* @__PURE__ */ jsx("span", {
|
|
286
|
+
className: t1,
|
|
287
|
+
...props
|
|
288
|
+
});
|
|
289
|
+
$[5] = props;
|
|
290
|
+
$[6] = t1;
|
|
291
|
+
$[7] = t2;
|
|
292
|
+
} else t2 = $[7];
|
|
293
|
+
return t2;
|
|
294
|
+
};
|
|
295
|
+
/**
|
|
296
|
+
* The value the trigger is read as while `Chips` show the selection, such as
|
|
297
|
+
* every chosen item joined. Only assistive tech reads it.
|
|
298
|
+
*
|
|
299
|
+
* @example
|
|
300
|
+
* <Combobox.SpokenValue>{names.join(", ")}</Combobox.SpokenValue>
|
|
301
|
+
*/
|
|
302
|
+
var ComboboxSpokenValue = (t0) => {
|
|
303
|
+
const $ = c(8);
|
|
304
|
+
let className;
|
|
305
|
+
let props;
|
|
306
|
+
if ($[0] !== t0) {
|
|
307
|
+
({className, ...props} = t0);
|
|
308
|
+
$[0] = t0;
|
|
309
|
+
$[1] = className;
|
|
310
|
+
$[2] = props;
|
|
311
|
+
} else {
|
|
312
|
+
className = $[1];
|
|
313
|
+
props = $[2];
|
|
314
|
+
}
|
|
315
|
+
let t1;
|
|
316
|
+
if ($[3] !== className) {
|
|
317
|
+
t1 = clsx(combobox_module_default.spokenValue, className);
|
|
318
|
+
$[3] = className;
|
|
319
|
+
$[4] = t1;
|
|
320
|
+
} else t1 = $[4];
|
|
321
|
+
let t2;
|
|
322
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
323
|
+
t2 = /* @__PURE__ */ jsx("span", {
|
|
324
|
+
className: t1,
|
|
325
|
+
...props
|
|
326
|
+
});
|
|
327
|
+
$[5] = props;
|
|
328
|
+
$[6] = t1;
|
|
329
|
+
$[7] = t2;
|
|
330
|
+
} else t2 = $[7];
|
|
331
|
+
return t2;
|
|
332
|
+
};
|
|
333
|
+
/**
|
|
334
|
+
* What the trigger shows while the control's `state` is pending, such as a
|
|
335
|
+
* spinner. Renders nothing otherwise.
|
|
336
|
+
*
|
|
337
|
+
* @example
|
|
338
|
+
* <Combobox.Pending><Spinner size={1} /></Combobox.Pending>
|
|
339
|
+
*/
|
|
340
|
+
var ComboboxPending = (props) => {
|
|
341
|
+
return useContext(ControlStateContext).pending === true ? /* @__PURE__ */ jsx(Field.Pending, { ...props }) : null;
|
|
342
|
+
};
|
|
343
|
+
/**
|
|
344
|
+
* The area beside the trigger that shows the selection of a multiple
|
|
345
|
+
* combobox: a `ChipList`, or a placeholder while nothing is chosen. The arrow
|
|
346
|
+
* keys move from its first and last chip back to the trigger.
|
|
347
|
+
*
|
|
348
|
+
* @example
|
|
349
|
+
* <Combobox.Chips>
|
|
350
|
+
* <Combobox.ChipList …>…</Combobox.ChipList>
|
|
351
|
+
* </Combobox.Chips>
|
|
352
|
+
*/
|
|
353
|
+
var ComboboxChips = (t0) => {
|
|
354
|
+
const $ = c(12);
|
|
355
|
+
let className;
|
|
356
|
+
let onKeyDownCapture;
|
|
357
|
+
let props;
|
|
358
|
+
if ($[0] !== t0) {
|
|
359
|
+
({className, onKeyDownCapture, ...props} = t0);
|
|
360
|
+
$[0] = t0;
|
|
361
|
+
$[1] = className;
|
|
362
|
+
$[2] = onKeyDownCapture;
|
|
363
|
+
$[3] = props;
|
|
364
|
+
} else {
|
|
365
|
+
className = $[1];
|
|
366
|
+
onKeyDownCapture = $[2];
|
|
367
|
+
props = $[3];
|
|
368
|
+
}
|
|
369
|
+
let t1;
|
|
370
|
+
if ($[4] !== className) {
|
|
371
|
+
t1 = clsx(combobox_module_default.content, className);
|
|
372
|
+
$[4] = className;
|
|
373
|
+
$[5] = t1;
|
|
374
|
+
} else t1 = $[5];
|
|
375
|
+
let t2;
|
|
376
|
+
if ($[6] !== onKeyDownCapture) {
|
|
377
|
+
t2 = (event) => {
|
|
378
|
+
onKeyDownCapture?.(event);
|
|
379
|
+
const edges = tagsOf(event.currentTarget);
|
|
380
|
+
if (event.key === "ArrowRight" && edges.at(-1) === event.target || event.key === "ArrowLeft" && edges.at(0) === event.target) {
|
|
381
|
+
event.preventDefault();
|
|
382
|
+
event.stopPropagation();
|
|
383
|
+
focusTrigger(event.currentTarget.parentElement);
|
|
384
|
+
}
|
|
385
|
+
};
|
|
386
|
+
$[6] = onKeyDownCapture;
|
|
387
|
+
$[7] = t2;
|
|
388
|
+
} else t2 = $[7];
|
|
389
|
+
let t3;
|
|
390
|
+
if ($[8] !== props || $[9] !== t1 || $[10] !== t2) {
|
|
391
|
+
t3 = /* @__PURE__ */ jsx("div", {
|
|
392
|
+
className: t1,
|
|
393
|
+
onKeyDownCapture: t2,
|
|
394
|
+
...props
|
|
208
395
|
});
|
|
209
|
-
$[
|
|
210
|
-
$[
|
|
211
|
-
$[
|
|
212
|
-
$[
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
$[36] = t5;
|
|
216
|
-
$[37] = t12;
|
|
217
|
-
} else t12 = $[37];
|
|
218
|
-
return t12;
|
|
396
|
+
$[8] = props;
|
|
397
|
+
$[9] = t1;
|
|
398
|
+
$[10] = t2;
|
|
399
|
+
$[11] = t3;
|
|
400
|
+
} else t3 = $[11];
|
|
401
|
+
return t3;
|
|
219
402
|
};
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
403
|
+
var ChipsLockedContext = createContext(false);
|
|
404
|
+
/**
|
|
405
|
+
* The chosen values of a multiple combobox as a grid of removable chips, over
|
|
406
|
+
* react-aria's `TagGroup`. Removing the last one returns focus to the trigger.
|
|
407
|
+
*
|
|
408
|
+
* @example
|
|
409
|
+
* <Combobox.ChipList label="Selected statuses" items={chosen} itemKey={status => status} onRemove={setChosen}>
|
|
410
|
+
* {status => <Combobox.Chip key={status} id={status} textValue={status}>{status}</Combobox.Chip>}
|
|
411
|
+
* </Combobox.ChipList>
|
|
412
|
+
*/
|
|
413
|
+
var ComboboxChipList = (t0) => {
|
|
414
|
+
const $ = c(25);
|
|
415
|
+
const { label, items, itemKey, children, onRemove, disabled: t1, readOnly: t2, className } = t0;
|
|
224
416
|
const disabled = t1 === void 0 ? false : t1;
|
|
225
417
|
const readOnly = t2 === void 0 ? false : t2;
|
|
226
418
|
const ref = useRef(null);
|
|
@@ -247,74 +439,140 @@ var ComboboxTags = (t0) => {
|
|
|
247
439
|
$[8] = t4;
|
|
248
440
|
} else t4 = $[8];
|
|
249
441
|
let t5;
|
|
250
|
-
if ($[9] !==
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
textValue: itemLabel(item_0),
|
|
256
|
-
"data-combobox-tag": "",
|
|
257
|
-
"data-tone": "neutral",
|
|
258
|
-
"data-variant": "subtle",
|
|
259
|
-
className: combobox_module_default.tag,
|
|
260
|
-
children: [children(item_0), /* @__PURE__ */ jsx(Tooltip, {
|
|
261
|
-
content: removeHint(item_0),
|
|
262
|
-
children: /* @__PURE__ */ jsx(Button, {
|
|
263
|
-
slot: "remove",
|
|
264
|
-
excludeFromTabOrder: true,
|
|
265
|
-
isDisabled: locked,
|
|
266
|
-
"aria-label": removeLabel,
|
|
267
|
-
className: combobox_module_default.tagRemove,
|
|
268
|
-
children: removeIcon
|
|
269
|
-
})
|
|
270
|
-
})]
|
|
271
|
-
}, itemKey(item_0));
|
|
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];
|
|
281
|
-
t5 = items.map(t6);
|
|
282
|
-
$[9] = children;
|
|
283
|
-
$[10] = itemKey;
|
|
284
|
-
$[11] = itemLabel;
|
|
285
|
-
$[12] = items;
|
|
286
|
-
$[13] = locked;
|
|
287
|
-
$[14] = removeHint;
|
|
288
|
-
$[15] = removeIcon;
|
|
289
|
-
$[16] = removeLabel;
|
|
290
|
-
$[17] = t5;
|
|
291
|
-
} else t5 = $[17];
|
|
442
|
+
if ($[9] !== className) {
|
|
443
|
+
t5 = clsx(combobox_module_default.tagList, className);
|
|
444
|
+
$[9] = className;
|
|
445
|
+
$[10] = t5;
|
|
446
|
+
} else t5 = $[10];
|
|
292
447
|
let t6;
|
|
293
|
-
if ($[
|
|
294
|
-
t6 =
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
$[27] = t6;
|
|
300
|
-
} else t6 = $[27];
|
|
448
|
+
if ($[11] !== children || $[12] !== items) {
|
|
449
|
+
t6 = items.map(children);
|
|
450
|
+
$[11] = children;
|
|
451
|
+
$[12] = items;
|
|
452
|
+
$[13] = t6;
|
|
453
|
+
} else t6 = $[13];
|
|
301
454
|
let t7;
|
|
302
|
-
if ($[
|
|
303
|
-
t7 = /* @__PURE__ */ jsx(
|
|
455
|
+
if ($[14] !== locked || $[15] !== t6) {
|
|
456
|
+
t7 = /* @__PURE__ */ jsx(ChipsLockedContext, {
|
|
457
|
+
value: locked,
|
|
458
|
+
children: t6
|
|
459
|
+
});
|
|
460
|
+
$[14] = locked;
|
|
461
|
+
$[15] = t6;
|
|
462
|
+
$[16] = t7;
|
|
463
|
+
} else t7 = $[16];
|
|
464
|
+
let t8;
|
|
465
|
+
if ($[17] !== t5 || $[18] !== t7) {
|
|
466
|
+
t8 = /* @__PURE__ */ jsx(TagList, {
|
|
467
|
+
className: t5,
|
|
468
|
+
children: t7
|
|
469
|
+
});
|
|
470
|
+
$[17] = t5;
|
|
471
|
+
$[18] = t7;
|
|
472
|
+
$[19] = t8;
|
|
473
|
+
} else t8 = $[19];
|
|
474
|
+
let t9;
|
|
475
|
+
if ($[20] !== label || $[21] !== t3 || $[22] !== t4 || $[23] !== t8) {
|
|
476
|
+
t9 = /* @__PURE__ */ jsx(TagGroup, {
|
|
304
477
|
ref,
|
|
305
478
|
"aria-label": label,
|
|
306
479
|
className: combobox_module_default.tags,
|
|
307
480
|
disabledKeys: t3,
|
|
308
481
|
onRemove: t4,
|
|
309
|
-
children:
|
|
482
|
+
children: t8
|
|
310
483
|
});
|
|
311
|
-
$[
|
|
312
|
-
$[
|
|
313
|
-
$[
|
|
314
|
-
$[
|
|
315
|
-
$[
|
|
316
|
-
} else
|
|
317
|
-
return
|
|
484
|
+
$[20] = label;
|
|
485
|
+
$[21] = t3;
|
|
486
|
+
$[22] = t4;
|
|
487
|
+
$[23] = t8;
|
|
488
|
+
$[24] = t9;
|
|
489
|
+
} else t9 = $[24];
|
|
490
|
+
return t9;
|
|
491
|
+
};
|
|
492
|
+
/**
|
|
493
|
+
* One chosen value as a chip, holding its content and a `ChipRemove`.
|
|
494
|
+
*
|
|
495
|
+
* @example
|
|
496
|
+
* <Combobox.Chip id={status} textValue={status}>{status}</Combobox.Chip>
|
|
497
|
+
*/
|
|
498
|
+
var ComboboxChip = (t0) => {
|
|
499
|
+
const $ = c(8);
|
|
500
|
+
let className;
|
|
501
|
+
let props;
|
|
502
|
+
if ($[0] !== t0) {
|
|
503
|
+
({className, ...props} = t0);
|
|
504
|
+
$[0] = t0;
|
|
505
|
+
$[1] = className;
|
|
506
|
+
$[2] = props;
|
|
507
|
+
} else {
|
|
508
|
+
className = $[1];
|
|
509
|
+
props = $[2];
|
|
510
|
+
}
|
|
511
|
+
let t1;
|
|
512
|
+
if ($[3] !== className) {
|
|
513
|
+
t1 = clsx(combobox_module_default.tag, className);
|
|
514
|
+
$[3] = className;
|
|
515
|
+
$[4] = t1;
|
|
516
|
+
} else t1 = $[4];
|
|
517
|
+
let t2;
|
|
518
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
519
|
+
t2 = /* @__PURE__ */ jsx(Tag, {
|
|
520
|
+
"data-combobox-tag": "",
|
|
521
|
+
"data-tone": "neutral",
|
|
522
|
+
"data-variant": "subtle",
|
|
523
|
+
className: t1,
|
|
524
|
+
...props
|
|
525
|
+
});
|
|
526
|
+
$[5] = props;
|
|
527
|
+
$[6] = t1;
|
|
528
|
+
$[7] = t2;
|
|
529
|
+
} else t2 = $[7];
|
|
530
|
+
return t2;
|
|
531
|
+
};
|
|
532
|
+
/**
|
|
533
|
+
* The pointer-only button that removes its chip; the keyboard removes with
|
|
534
|
+
* Delete. Its children are the icon, such as a cross.
|
|
535
|
+
*
|
|
536
|
+
* @example
|
|
537
|
+
* <Tooltip content="Remove Open">
|
|
538
|
+
* <Combobox.ChipRemove aria-label="Remove"><CloseIcon /></Combobox.ChipRemove>
|
|
539
|
+
* </Tooltip>
|
|
540
|
+
*/
|
|
541
|
+
var ComboboxChipRemove = (t0) => {
|
|
542
|
+
const $ = c(9);
|
|
543
|
+
let className;
|
|
544
|
+
let props;
|
|
545
|
+
if ($[0] !== t0) {
|
|
546
|
+
({className, ...props} = t0);
|
|
547
|
+
$[0] = t0;
|
|
548
|
+
$[1] = className;
|
|
549
|
+
$[2] = props;
|
|
550
|
+
} else {
|
|
551
|
+
className = $[1];
|
|
552
|
+
props = $[2];
|
|
553
|
+
}
|
|
554
|
+
const t1 = useContext(ChipsLockedContext);
|
|
555
|
+
let t2;
|
|
556
|
+
if ($[3] !== className) {
|
|
557
|
+
t2 = clsx(combobox_module_default.tagRemove, className);
|
|
558
|
+
$[3] = className;
|
|
559
|
+
$[4] = t2;
|
|
560
|
+
} else t2 = $[4];
|
|
561
|
+
let t3;
|
|
562
|
+
if ($[5] !== props || $[6] !== t1 || $[7] !== t2) {
|
|
563
|
+
t3 = /* @__PURE__ */ jsx(Button, {
|
|
564
|
+
slot: "remove",
|
|
565
|
+
excludeFromTabOrder: true,
|
|
566
|
+
isDisabled: t1,
|
|
567
|
+
className: t2,
|
|
568
|
+
...props
|
|
569
|
+
});
|
|
570
|
+
$[5] = props;
|
|
571
|
+
$[6] = t1;
|
|
572
|
+
$[7] = t2;
|
|
573
|
+
$[8] = t3;
|
|
574
|
+
} else t3 = $[8];
|
|
575
|
+
return t3;
|
|
318
576
|
};
|
|
319
577
|
/** Places the popup against the control, given as its `anchor`. */
|
|
320
578
|
var ComboboxPositioner = (t0) => {
|
|
@@ -516,44 +774,89 @@ var ComboboxOption = (t0) => {
|
|
|
516
774
|
} else t2 = $[7];
|
|
517
775
|
return t2;
|
|
518
776
|
};
|
|
519
|
-
|
|
777
|
+
var InCheckboxContext = createContext(false);
|
|
778
|
+
/**
|
|
779
|
+
* The mark beside a chosen option. Its children are the mark, such as a tick.
|
|
780
|
+
* Inside an `OptionCheckbox` it is the checkbox's tick, kept mounted.
|
|
781
|
+
*
|
|
782
|
+
* @example
|
|
783
|
+
* <Combobox.OptionIndicator><CheckIcon /></Combobox.OptionIndicator>
|
|
784
|
+
*/
|
|
520
785
|
var ComboboxOptionIndicator = (t0) => {
|
|
521
|
-
const $ = c(
|
|
786
|
+
const $ = c(3);
|
|
522
787
|
let className;
|
|
523
788
|
let props;
|
|
524
|
-
let t1;
|
|
525
789
|
if ($[0] !== t0) {
|
|
526
|
-
({className,
|
|
790
|
+
({className, ...props} = t0);
|
|
527
791
|
$[0] = t0;
|
|
528
792
|
$[1] = className;
|
|
529
793
|
$[2] = props;
|
|
530
|
-
$[3] = t1;
|
|
531
794
|
} else {
|
|
532
795
|
className = $[1];
|
|
533
796
|
props = $[2];
|
|
534
|
-
t1 = $[3];
|
|
535
797
|
}
|
|
536
|
-
|
|
798
|
+
return useContext(InCheckboxContext) ? /* @__PURE__ */ jsx(Combobox.ItemIndicator, {
|
|
799
|
+
keepMounted: true,
|
|
800
|
+
className: clsx(combobox_module_default.checkboxIndicator, className),
|
|
801
|
+
...props
|
|
802
|
+
}) : /* @__PURE__ */ jsx(Combobox.ItemIndicator, {
|
|
803
|
+
className: clsx(combobox_module_default.indicator, className),
|
|
804
|
+
...props
|
|
805
|
+
});
|
|
806
|
+
};
|
|
807
|
+
/**
|
|
808
|
+
* The box an option's `OptionIndicator` sits in, for a multi-value list.
|
|
809
|
+
*
|
|
810
|
+
* @example
|
|
811
|
+
* <Combobox.OptionCheckbox>
|
|
812
|
+
* <Combobox.OptionIndicator><CheckIcon /></Combobox.OptionIndicator>
|
|
813
|
+
* </Combobox.OptionCheckbox>
|
|
814
|
+
*/
|
|
815
|
+
var ComboboxOptionCheckbox = (t0) => {
|
|
816
|
+
const $ = c(12);
|
|
817
|
+
let children;
|
|
818
|
+
let className;
|
|
819
|
+
let props;
|
|
820
|
+
if ($[0] !== t0) {
|
|
821
|
+
({className, children, ...props} = t0);
|
|
822
|
+
$[0] = t0;
|
|
823
|
+
$[1] = children;
|
|
824
|
+
$[2] = className;
|
|
825
|
+
$[3] = props;
|
|
826
|
+
} else {
|
|
827
|
+
children = $[1];
|
|
828
|
+
className = $[2];
|
|
829
|
+
props = $[3];
|
|
830
|
+
}
|
|
831
|
+
let t1;
|
|
832
|
+
if ($[4] !== className) {
|
|
833
|
+
t1 = clsx(combobox_module_default.checkbox, className);
|
|
834
|
+
$[4] = className;
|
|
835
|
+
$[5] = t1;
|
|
836
|
+
} else t1 = $[5];
|
|
537
837
|
let t2;
|
|
538
|
-
if ($[
|
|
539
|
-
t2 =
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
children: /* @__PURE__ */ jsx(Combobox.ItemIndicator, {
|
|
543
|
-
keepMounted: true,
|
|
544
|
-
className: clsx(combobox_module_default.checkboxIndicator, className),
|
|
545
|
-
...props
|
|
546
|
-
})
|
|
547
|
-
}) : /* @__PURE__ */ jsx(Combobox.ItemIndicator, {
|
|
548
|
-
className: clsx(combobox_module_default.indicator, className),
|
|
549
|
-
...props
|
|
838
|
+
if ($[6] !== children) {
|
|
839
|
+
t2 = /* @__PURE__ */ jsx(InCheckboxContext, {
|
|
840
|
+
value: true,
|
|
841
|
+
children
|
|
550
842
|
});
|
|
551
|
-
$[
|
|
552
|
-
$[5] = multiple;
|
|
553
|
-
$[6] = props;
|
|
843
|
+
$[6] = children;
|
|
554
844
|
$[7] = t2;
|
|
555
845
|
} else t2 = $[7];
|
|
556
|
-
|
|
846
|
+
let t3;
|
|
847
|
+
if ($[8] !== props || $[9] !== t1 || $[10] !== t2) {
|
|
848
|
+
t3 = /* @__PURE__ */ jsx("span", {
|
|
849
|
+
"aria-hidden": "true",
|
|
850
|
+
className: t1,
|
|
851
|
+
...props,
|
|
852
|
+
children: t2
|
|
853
|
+
});
|
|
854
|
+
$[8] = props;
|
|
855
|
+
$[9] = t1;
|
|
856
|
+
$[10] = t2;
|
|
857
|
+
$[11] = t3;
|
|
858
|
+
} else t3 = $[11];
|
|
859
|
+
return t3;
|
|
557
860
|
};
|
|
558
861
|
/** An option's content, beside its indicator. */
|
|
559
862
|
var ComboboxOptionText = (t0) => {
|
|
@@ -865,10 +1168,7 @@ var ComboboxBody = (t0) => {
|
|
|
865
1168
|
if ($[23] !== checkIcon || $[24] !== children || $[25] !== itemKey || $[26] !== multiple) {
|
|
866
1169
|
t7 = (item) => /* @__PURE__ */ jsxs(ComboboxOption, {
|
|
867
1170
|
value: item,
|
|
868
|
-
children: [/* @__PURE__ */ jsx(ComboboxOptionIndicator, {
|
|
869
|
-
multiple,
|
|
870
|
-
children: checkIcon
|
|
871
|
-
}), /* @__PURE__ */ jsx(ComboboxOptionText, { children: children(item) })]
|
|
1171
|
+
children: [multiple ? /* @__PURE__ */ jsx(ComboboxOptionCheckbox, { children: /* @__PURE__ */ jsx(ComboboxOptionIndicator, { children: checkIcon }) }) : /* @__PURE__ */ jsx(ComboboxOptionIndicator, { children: checkIcon }), /* @__PURE__ */ jsx(ComboboxOptionText, { children: children(item) })]
|
|
872
1172
|
}, itemKey(item));
|
|
873
1173
|
$[23] = checkIcon;
|
|
874
1174
|
$[24] = children;
|
|
@@ -905,14 +1205,20 @@ var ComboboxBody = (t0) => {
|
|
|
905
1205
|
/**
|
|
906
1206
|
* The styled parts of a base-ui Combobox: a filterable select whose control
|
|
907
1207
|
* matches `Select`'s trigger and whose popup is the shared popup surface. Every
|
|
908
|
-
* unstyled base-ui part stays reachable.
|
|
909
|
-
*
|
|
1208
|
+
* unstyled base-ui part stays reachable. A multiple combobox shows its
|
|
1209
|
+
* selection as `Chips` beside the `Trigger`. `Body` holds what the popup
|
|
1210
|
+
* usually does. For the ordinary case, use `ComboboxField`. The positioner takes the
|
|
910
1211
|
* control as its `anchor`.
|
|
911
1212
|
*
|
|
912
1213
|
* @example
|
|
913
1214
|
* <Combobox.Root items={statuses}>
|
|
914
|
-
* <Combobox.Control ref={anchorRef}
|
|
915
|
-
* <Combobox.
|
|
1215
|
+
* <Combobox.Control ref={anchorRef}>
|
|
1216
|
+
* <Combobox.Trigger>
|
|
1217
|
+
* <Combobox.TriggerValue>
|
|
1218
|
+
* <Combobox.Value>{(status: string | null) => status}</Combobox.Value>
|
|
1219
|
+
* </Combobox.TriggerValue>
|
|
1220
|
+
* <Combobox.Icon><ExpandMoreIcon /></Combobox.Icon>
|
|
1221
|
+
* </Combobox.Trigger>
|
|
916
1222
|
* </Combobox.Control>
|
|
917
1223
|
* <Combobox.Portal>
|
|
918
1224
|
* <Combobox.Positioner anchor={anchorRef}>
|
|
@@ -935,33 +1241,27 @@ var Combobox$1 = {
|
|
|
935
1241
|
...Combobox,
|
|
936
1242
|
Root: ComboboxRoot,
|
|
937
1243
|
Control: ComboboxControl,
|
|
1244
|
+
Trigger: ComboboxTrigger,
|
|
1245
|
+
TriggerValue: ComboboxTriggerValue,
|
|
1246
|
+
SpokenValue: ComboboxSpokenValue,
|
|
938
1247
|
Icon: ComboboxIcon,
|
|
939
|
-
|
|
1248
|
+
Chips: ComboboxChips,
|
|
1249
|
+
ChipList: ComboboxChipList,
|
|
1250
|
+
Chip: ComboboxChip,
|
|
1251
|
+
ChipRemove: ComboboxChipRemove,
|
|
940
1252
|
Positioner: ComboboxPositioner,
|
|
941
1253
|
Popup: ComboboxPopup,
|
|
942
1254
|
Search: ComboboxSearch,
|
|
943
1255
|
List: ComboboxList,
|
|
944
1256
|
Option: ComboboxOption,
|
|
945
1257
|
OptionIndicator: ComboboxOptionIndicator,
|
|
1258
|
+
OptionCheckbox: ComboboxOptionCheckbox,
|
|
946
1259
|
OptionText: ComboboxOptionText,
|
|
947
1260
|
Empty: ComboboxEmpty,
|
|
948
1261
|
Status: ComboboxStatus,
|
|
949
1262
|
StatusArea: ComboboxStatusArea,
|
|
950
1263
|
LoadStatus: ComboboxLoadStatus,
|
|
951
1264
|
Body: ComboboxBody,
|
|
952
|
-
Pending:
|
|
1265
|
+
Pending: ComboboxPending
|
|
953
1266
|
};
|
|
954
|
-
function _temp(event) {
|
|
955
|
-
const edges = tagsOf(event.currentTarget);
|
|
956
|
-
if (event.key === "ArrowRight" && edges.at(-1) === event.target || event.key === "ArrowLeft" && edges.at(0) === event.target) {
|
|
957
|
-
event.preventDefault();
|
|
958
|
-
event.stopPropagation();
|
|
959
|
-
focusTrigger(event.currentTarget.parentElement);
|
|
960
|
-
}
|
|
961
|
-
}
|
|
962
|
-
function _temp2(event_0) {
|
|
963
|
-
const control = event_0.currentTarget.parentElement;
|
|
964
|
-
if (event_0.key === "ArrowRight" && focusTagAt(control, "first")) event_0.preventDefault();
|
|
965
|
-
if (event_0.key === "ArrowLeft" && focusTagAt(control, "last")) event_0.preventDefault();
|
|
966
|
-
}
|
|
967
1267
|
export { Combobox$1 as Combobox };
|