@igne-agency/react-web-ui 0.5.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/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/tokens.css +6 -3
- package/package.json +1 -1
- 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
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { usePopupEdgePadding } from "../../lib/popup-edge-padding.js";
|
|
2
|
-
import { Button } from "../button/button.js";
|
|
3
2
|
import menu_module_default from "./menu.module.js";
|
|
4
3
|
import { c } from "react/compiler-runtime";
|
|
5
4
|
import { clsx } from "clsx";
|
|
6
|
-
import { jsx
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
6
|
import { Menu } from "@base-ui/react/menu";
|
|
8
7
|
// src/components/menu/menu.tsx
|
|
9
8
|
/** Holds the menu's open state for its parts. It renders no element of its own. */
|
|
@@ -18,82 +17,20 @@ var Root = (props) => {
|
|
|
18
17
|
return t0;
|
|
19
18
|
};
|
|
20
19
|
/**
|
|
21
|
-
* The button that opens a menu
|
|
22
|
-
*
|
|
20
|
+
* The button that opens a menu. It renders whichever button it is given.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* <Menu.Trigger render={<IconButton label="Row actions" variant="tertiary"><MoreIcon /></IconButton>} />
|
|
23
24
|
*/
|
|
24
25
|
var Trigger = (props) => {
|
|
25
|
-
const $ = c(
|
|
26
|
-
if (props.label !== void 0) {
|
|
27
|
-
let icon;
|
|
28
|
-
let label;
|
|
29
|
-
let triggerProps;
|
|
30
|
-
if ($[0] !== props) {
|
|
31
|
-
({icon, label, ...triggerProps} = props);
|
|
32
|
-
$[0] = props;
|
|
33
|
-
$[1] = icon;
|
|
34
|
-
$[2] = label;
|
|
35
|
-
$[3] = triggerProps;
|
|
36
|
-
} else {
|
|
37
|
-
icon = $[1];
|
|
38
|
-
label = $[2];
|
|
39
|
-
triggerProps = $[3];
|
|
40
|
-
}
|
|
41
|
-
let t0;
|
|
42
|
-
if ($[4] !== triggerProps) {
|
|
43
|
-
t0 = /* @__PURE__ */ jsx(Menu.Trigger, { ...triggerProps });
|
|
44
|
-
$[4] = triggerProps;
|
|
45
|
-
$[5] = t0;
|
|
46
|
-
} else t0 = $[5];
|
|
47
|
-
let t1;
|
|
48
|
-
if ($[6] !== icon || $[7] !== label || $[8] !== t0) {
|
|
49
|
-
t1 = /* @__PURE__ */ jsx(Button, {
|
|
50
|
-
variant: "tertiary",
|
|
51
|
-
iconOnly: true,
|
|
52
|
-
icon,
|
|
53
|
-
label,
|
|
54
|
-
render: t0
|
|
55
|
-
});
|
|
56
|
-
$[6] = icon;
|
|
57
|
-
$[7] = label;
|
|
58
|
-
$[8] = t0;
|
|
59
|
-
$[9] = t1;
|
|
60
|
-
} else t1 = $[9];
|
|
61
|
-
return t1;
|
|
62
|
-
}
|
|
63
|
-
let children;
|
|
64
|
-
let icon_0;
|
|
65
|
-
let triggerProps_0;
|
|
66
|
-
if ($[10] !== props) {
|
|
67
|
-
({icon: icon_0, children, ...triggerProps_0} = props);
|
|
68
|
-
$[10] = props;
|
|
69
|
-
$[11] = children;
|
|
70
|
-
$[12] = icon_0;
|
|
71
|
-
$[13] = triggerProps_0;
|
|
72
|
-
} else {
|
|
73
|
-
children = $[11];
|
|
74
|
-
icon_0 = $[12];
|
|
75
|
-
triggerProps_0 = $[13];
|
|
76
|
-
}
|
|
26
|
+
const $ = c(2);
|
|
77
27
|
let t0;
|
|
78
|
-
if ($[
|
|
79
|
-
t0 = /* @__PURE__ */ jsx(Menu.Trigger, { ...
|
|
80
|
-
$[
|
|
81
|
-
$[
|
|
82
|
-
} else t0 = $[
|
|
83
|
-
|
|
84
|
-
if ($[16] !== children || $[17] !== icon_0 || $[18] !== t0) {
|
|
85
|
-
t1 = /* @__PURE__ */ jsx(Button, {
|
|
86
|
-
variant: "secondary",
|
|
87
|
-
icon: icon_0,
|
|
88
|
-
render: t0,
|
|
89
|
-
children
|
|
90
|
-
});
|
|
91
|
-
$[16] = children;
|
|
92
|
-
$[17] = icon_0;
|
|
93
|
-
$[18] = t0;
|
|
94
|
-
$[19] = t1;
|
|
95
|
-
} else t1 = $[19];
|
|
96
|
-
return t1;
|
|
28
|
+
if ($[0] !== props) {
|
|
29
|
+
t0 = /* @__PURE__ */ jsx(Menu.Trigger, { ...props });
|
|
30
|
+
$[0] = props;
|
|
31
|
+
$[1] = t0;
|
|
32
|
+
} else t0 = $[1];
|
|
33
|
+
return t0;
|
|
97
34
|
};
|
|
98
35
|
/** Places the popup against its trigger, clear of the viewport's edges. */
|
|
99
36
|
var Positioner = (t0) => {
|
|
@@ -222,29 +159,38 @@ var Content = (t0) => {
|
|
|
222
159
|
} else t3 = $[17];
|
|
223
160
|
return t3;
|
|
224
161
|
};
|
|
225
|
-
/**
|
|
162
|
+
/**
|
|
163
|
+
* The arrow pointing from the popup at its trigger: the kit's own shape, or the
|
|
164
|
+
* children given in its place.
|
|
165
|
+
*
|
|
166
|
+
* @example
|
|
167
|
+
* <Menu.Arrow />
|
|
168
|
+
*/
|
|
226
169
|
var Arrow = (t0) => {
|
|
227
|
-
const $ = c(
|
|
170
|
+
const $ = c(12);
|
|
171
|
+
let children;
|
|
228
172
|
let className;
|
|
229
173
|
let props;
|
|
230
174
|
if ($[0] !== t0) {
|
|
231
|
-
({className, ...props} = t0);
|
|
175
|
+
({className, children, ...props} = t0);
|
|
232
176
|
$[0] = t0;
|
|
233
|
-
$[1] =
|
|
234
|
-
$[2] =
|
|
177
|
+
$[1] = children;
|
|
178
|
+
$[2] = className;
|
|
179
|
+
$[3] = props;
|
|
235
180
|
} else {
|
|
236
|
-
|
|
237
|
-
|
|
181
|
+
children = $[1];
|
|
182
|
+
className = $[2];
|
|
183
|
+
props = $[3];
|
|
238
184
|
}
|
|
239
185
|
let t1;
|
|
240
|
-
if ($[
|
|
186
|
+
if ($[4] !== className) {
|
|
241
187
|
t1 = clsx(menu_module_default.arrow, className);
|
|
242
|
-
$[
|
|
243
|
-
$[
|
|
244
|
-
} else t1 = $[
|
|
188
|
+
$[4] = className;
|
|
189
|
+
$[5] = t1;
|
|
190
|
+
} else t1 = $[5];
|
|
245
191
|
let t2;
|
|
246
|
-
if ($[
|
|
247
|
-
t2 = /* @__PURE__ */ jsx("svg", {
|
|
192
|
+
if ($[6] !== children) {
|
|
193
|
+
t2 = children ?? /* @__PURE__ */ jsx("svg", {
|
|
248
194
|
width: "16",
|
|
249
195
|
height: "8",
|
|
250
196
|
viewBox: "0 0 16 8",
|
|
@@ -254,60 +200,58 @@ var Arrow = (t0) => {
|
|
|
254
200
|
d: "M0 9 V8 L8 0 L16 8 V9 Z"
|
|
255
201
|
})
|
|
256
202
|
});
|
|
257
|
-
$[
|
|
258
|
-
|
|
203
|
+
$[6] = children;
|
|
204
|
+
$[7] = t2;
|
|
205
|
+
} else t2 = $[7];
|
|
259
206
|
let t3;
|
|
260
|
-
if ($[
|
|
207
|
+
if ($[8] !== props || $[9] !== t1 || $[10] !== t2) {
|
|
261
208
|
t3 = /* @__PURE__ */ jsx(Menu.Arrow, {
|
|
262
209
|
className: t1,
|
|
263
210
|
...props,
|
|
264
211
|
children: t2
|
|
265
212
|
});
|
|
266
|
-
$[
|
|
267
|
-
$[
|
|
268
|
-
$[
|
|
269
|
-
|
|
213
|
+
$[8] = props;
|
|
214
|
+
$[9] = t1;
|
|
215
|
+
$[10] = t2;
|
|
216
|
+
$[11] = t3;
|
|
217
|
+
} else t3 = $[11];
|
|
270
218
|
return t3;
|
|
271
219
|
};
|
|
272
|
-
/**
|
|
220
|
+
/**
|
|
221
|
+
* An action. A leading icon goes in its children, before the label.
|
|
222
|
+
*
|
|
223
|
+
* @example
|
|
224
|
+
* <Menu.Item onClick={download}><DownloadIcon />Download</Menu.Item>
|
|
225
|
+
*/
|
|
273
226
|
var Item = (t0) => {
|
|
274
|
-
const $ = c(
|
|
275
|
-
let children;
|
|
227
|
+
const $ = c(8);
|
|
276
228
|
let className;
|
|
277
|
-
let icon;
|
|
278
229
|
let props;
|
|
279
230
|
if ($[0] !== t0) {
|
|
280
|
-
({
|
|
231
|
+
({className, ...props} = t0);
|
|
281
232
|
$[0] = t0;
|
|
282
|
-
$[1] =
|
|
283
|
-
$[2] =
|
|
284
|
-
$[3] = icon;
|
|
285
|
-
$[4] = props;
|
|
233
|
+
$[1] = className;
|
|
234
|
+
$[2] = props;
|
|
286
235
|
} else {
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
icon = $[3];
|
|
290
|
-
props = $[4];
|
|
236
|
+
className = $[1];
|
|
237
|
+
props = $[2];
|
|
291
238
|
}
|
|
292
239
|
let t1;
|
|
293
|
-
if ($[
|
|
240
|
+
if ($[3] !== className) {
|
|
294
241
|
t1 = clsx(menu_module_default.item, className);
|
|
295
|
-
$[
|
|
296
|
-
$[
|
|
297
|
-
} else t1 = $[
|
|
242
|
+
$[3] = className;
|
|
243
|
+
$[4] = t1;
|
|
244
|
+
} else t1 = $[4];
|
|
298
245
|
let t2;
|
|
299
|
-
if ($[
|
|
300
|
-
t2 = /* @__PURE__ */
|
|
246
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
247
|
+
t2 = /* @__PURE__ */ jsx(Menu.Item, {
|
|
301
248
|
className: t1,
|
|
302
|
-
...props
|
|
303
|
-
children: [icon, children]
|
|
249
|
+
...props
|
|
304
250
|
});
|
|
305
|
-
$[
|
|
306
|
-
$[
|
|
307
|
-
$[
|
|
308
|
-
|
|
309
|
-
$[11] = t2;
|
|
310
|
-
} else t2 = $[11];
|
|
251
|
+
$[5] = props;
|
|
252
|
+
$[6] = t1;
|
|
253
|
+
$[7] = t2;
|
|
254
|
+
} else t2 = $[7];
|
|
311
255
|
return t2;
|
|
312
256
|
};
|
|
313
257
|
/**
|
|
@@ -415,10 +359,17 @@ var GroupLabel = (t0) => {
|
|
|
415
359
|
*
|
|
416
360
|
* @example
|
|
417
361
|
* <Menu.Root>
|
|
418
|
-
* <Menu.Trigger
|
|
362
|
+
* <Menu.Trigger
|
|
363
|
+
* render={
|
|
364
|
+
* <IconButton label="Row actions" variant="tertiary">
|
|
365
|
+
* <MoreIcon />
|
|
366
|
+
* </IconButton>
|
|
367
|
+
* }
|
|
368
|
+
* />
|
|
419
369
|
* <Menu.Content sideOffset={8}>
|
|
420
370
|
* <Menu.Arrow />
|
|
421
|
-
* <Menu.Item
|
|
371
|
+
* <Menu.Item onClick={download}>
|
|
372
|
+
* <DownloadIcon />
|
|
422
373
|
* Download
|
|
423
374
|
* </Menu.Item>
|
|
424
375
|
* </Menu.Content>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import './menu.css';// src/components/menu/menu.module.scss
|
|
2
|
-
var positioner = "
|
|
3
|
-
var popup = "
|
|
4
|
-
var arrow = "
|
|
5
|
-
var arrowFill = "
|
|
6
|
-
var item = "
|
|
7
|
-
var linkItem = "
|
|
8
|
-
var separator = "
|
|
9
|
-
var groupLabel = "
|
|
2
|
+
var positioner = "_positioner_75w81_3";
|
|
3
|
+
var popup = "_popup_75w81_18";
|
|
4
|
+
var arrow = "_arrow_75w81_41";
|
|
5
|
+
var arrowFill = "_arrowFill_75w81_59";
|
|
6
|
+
var item = "_item_75w81_62";
|
|
7
|
+
var linkItem = "_linkItem_75w81_114";
|
|
8
|
+
var separator = "_separator_75w81_117";
|
|
9
|
+
var groupLabel = "_groupLabel_75w81_122";
|
|
10
10
|
var menu_module_default = {
|
|
11
11
|
positioner,
|
|
12
12
|
popup,
|
|
@@ -10,7 +10,7 @@ export type NavOrientation = "horizontal" | "vertical";
|
|
|
10
10
|
export type NavLayout = "row" | "stack";
|
|
11
11
|
export type NavContextValue = Readonly<{
|
|
12
12
|
orientation: NavOrientation;
|
|
13
|
-
/** The one
|
|
13
|
+
/** The one hint every entry with a `label` names itself through. */
|
|
14
14
|
hint: BaseTooltip.Handle<string>;
|
|
15
15
|
}>;
|
|
16
16
|
export declare const NavContext: Context<NavContextValue | null>;
|
|
@@ -5,23 +5,20 @@ import { type NavLayout } from "./nav-context.ts";
|
|
|
5
5
|
export type NavEntryProps = Readonly<{
|
|
6
6
|
/** @default "row" */
|
|
7
7
|
layout?: NavLayout;
|
|
8
|
-
/**
|
|
9
|
-
|
|
10
|
-
/** The entry's name, for where no visible `Label` carries it. */
|
|
11
|
-
label: string;
|
|
8
|
+
/** The entry's name where no visible `Label` carries it: announced, and shown by the nav's `Hint`. */
|
|
9
|
+
label?: string;
|
|
12
10
|
}>;
|
|
13
|
-
type EntryShellProps = NavEntryProps & Readonly<{
|
|
11
|
+
type EntryShellProps = Pick<NavEntryProps, "label"> & Readonly<{
|
|
14
12
|
element: ReactElement;
|
|
15
13
|
}>;
|
|
16
14
|
/**
|
|
17
|
-
* Hangs an entry's element off the nav's one
|
|
18
|
-
*
|
|
15
|
+
* Hangs an entry's element off the nav's one hint, which shows its `label`.
|
|
16
|
+
* Outside a `Nav.Root` the element stands alone.
|
|
19
17
|
*/
|
|
20
|
-
export declare const EntryShell: ({
|
|
18
|
+
export declare const EntryShell: ({ label, element, }: EntryShellProps) => ReactNode;
|
|
21
19
|
/** The attributes an entry's element carries for its layout and label. */
|
|
22
|
-
export declare const entryAttributes: ({ layout,
|
|
20
|
+
export declare const entryAttributes: ({ layout, label, }: NavEntryProps) => Readonly<{
|
|
23
21
|
"data-layout": NavLayout;
|
|
24
|
-
"data-labelled": "false" | undefined;
|
|
25
22
|
"aria-label": string | undefined;
|
|
26
23
|
}>;
|
|
27
24
|
export type NavItemRootProps = useRender.ComponentProps<"button"> & NavEntryProps;
|
|
@@ -30,7 +27,7 @@ export type NavItemRootProps = useRender.ComponentProps<"button"> & NavEntryProp
|
|
|
30
27
|
* `Drawer.Trigger`, a router link, or the default `<button>`. Mark the current
|
|
31
28
|
* destination with `data-active="true"` or `aria-current="page"`.
|
|
32
29
|
*/
|
|
33
|
-
declare const Root: ({ layout,
|
|
30
|
+
declare const Root: ({ layout, label, className, ...props }: NavItemRootProps) => ReactNode;
|
|
34
31
|
export type NavItemIconProps = Readonly<{
|
|
35
32
|
className?: string;
|
|
36
33
|
/** The app's icon, drawn at `1em` in `currentColor`; the slot sizes it. */
|
|
@@ -41,7 +38,7 @@ export type NavItemIconProps = Readonly<{
|
|
|
41
38
|
* own, so it takes 1.5em over the row's text-matched 1em.
|
|
42
39
|
*/
|
|
43
40
|
declare const NavItemIcon: ({ className, children, }: NavItemIconProps) => ReactNode;
|
|
44
|
-
/** The entry's text.
|
|
41
|
+
/** The entry's text. Leave it out where the entry is named by its `label` and the nav's `Hint` instead. */
|
|
45
42
|
declare const Label: ({ className, ...props }: ComponentPropsWithRef<"span">) => ReactNode;
|
|
46
43
|
type NavItemViewParts = Readonly<{
|
|
47
44
|
Root: typeof Root;
|
|
@@ -54,7 +51,7 @@ type NavItemViewParts = Readonly<{
|
|
|
54
51
|
* is not a link, such as the trigger of an overflow sheet.
|
|
55
52
|
*
|
|
56
53
|
* @example
|
|
57
|
-
* <NavItemView.Root render={<Drawer.Trigger />}
|
|
54
|
+
* <NavItemView.Root render={<Drawer.Trigger />} layout="stack">
|
|
58
55
|
* <NavItemView.Icon><MoreIcon /></NavItemView.Icon>
|
|
59
56
|
* <NavItemView.Label>More</NavItemView.Label>
|
|
60
57
|
* </NavItemView.Root>
|
|
@@ -8,35 +8,32 @@ import { use } from "react";
|
|
|
8
8
|
import { Tooltip } from "@base-ui/react/tooltip";
|
|
9
9
|
// src/components/nav/nav-item-view.tsx
|
|
10
10
|
/**
|
|
11
|
-
* Hangs an entry's element off the nav's one
|
|
12
|
-
*
|
|
11
|
+
* Hangs an entry's element off the nav's one hint, which shows its `label`.
|
|
12
|
+
* Outside a `Nav.Root` the element stands alone.
|
|
13
13
|
*/
|
|
14
14
|
var EntryShell = (t0) => {
|
|
15
|
-
const $ = c(
|
|
16
|
-
const {
|
|
17
|
-
const labelled = t1 === void 0 ? true : t1;
|
|
15
|
+
const $ = c(4);
|
|
16
|
+
const { label, element } = t0;
|
|
18
17
|
const nav = use(NavContext);
|
|
19
|
-
let
|
|
20
|
-
if ($[0] !== element || $[1] !== label || $[2] !==
|
|
21
|
-
|
|
18
|
+
let t1;
|
|
19
|
+
if ($[0] !== element || $[1] !== label || $[2] !== nav) {
|
|
20
|
+
t1 = nav === null ? element : /* @__PURE__ */ jsx(Tooltip.Trigger, {
|
|
22
21
|
handle: nav.hint,
|
|
23
22
|
payload: label,
|
|
24
|
-
disabled:
|
|
23
|
+
disabled: label === void 0,
|
|
25
24
|
render: element
|
|
26
25
|
});
|
|
27
26
|
$[0] = element;
|
|
28
27
|
$[1] = label;
|
|
29
|
-
$[2] =
|
|
30
|
-
$[3] =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return t2;
|
|
28
|
+
$[2] = nav;
|
|
29
|
+
$[3] = t1;
|
|
30
|
+
} else t1 = $[3];
|
|
31
|
+
return t1;
|
|
34
32
|
};
|
|
35
33
|
/** The attributes an entry's element carries for its layout and label. */
|
|
36
|
-
var entryAttributes = ({ layout = "row",
|
|
34
|
+
var entryAttributes = ({ layout = "row", label }) => ({
|
|
37
35
|
"data-layout": layout,
|
|
38
|
-
"
|
|
39
|
-
"aria-label": labelled ? void 0 : label
|
|
36
|
+
"aria-label": label
|
|
40
37
|
});
|
|
41
38
|
var NavItemElement = (t0) => {
|
|
42
39
|
const $ = c(8);
|
|
@@ -75,71 +72,62 @@ var NavItemElement = (t0) => {
|
|
|
75
72
|
* destination with `data-active="true"` or `aria-current="page"`.
|
|
76
73
|
*/
|
|
77
74
|
var Root = (t0) => {
|
|
78
|
-
const $ = c(
|
|
75
|
+
const $ = c(17);
|
|
79
76
|
let className;
|
|
80
77
|
let label;
|
|
81
|
-
let labelled;
|
|
82
78
|
let layout;
|
|
83
79
|
let props;
|
|
84
80
|
if ($[0] !== t0) {
|
|
85
|
-
({layout,
|
|
81
|
+
({layout, label, className, ...props} = t0);
|
|
86
82
|
$[0] = t0;
|
|
87
83
|
$[1] = className;
|
|
88
84
|
$[2] = label;
|
|
89
|
-
$[3] =
|
|
90
|
-
$[4] =
|
|
91
|
-
$[5] = props;
|
|
85
|
+
$[3] = layout;
|
|
86
|
+
$[4] = props;
|
|
92
87
|
} else {
|
|
93
88
|
className = $[1];
|
|
94
89
|
label = $[2];
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
props = $[5];
|
|
90
|
+
layout = $[3];
|
|
91
|
+
props = $[4];
|
|
98
92
|
}
|
|
99
93
|
let t1;
|
|
100
|
-
if ($[
|
|
94
|
+
if ($[5] !== label || $[6] !== layout) {
|
|
101
95
|
t1 = entryAttributes({
|
|
102
96
|
layout,
|
|
103
|
-
labelled,
|
|
104
97
|
label
|
|
105
98
|
});
|
|
106
|
-
$[
|
|
107
|
-
$[
|
|
108
|
-
$[
|
|
109
|
-
|
|
110
|
-
} else t1 = $[9];
|
|
99
|
+
$[5] = label;
|
|
100
|
+
$[6] = layout;
|
|
101
|
+
$[7] = t1;
|
|
102
|
+
} else t1 = $[7];
|
|
111
103
|
let t2;
|
|
112
|
-
if ($[
|
|
104
|
+
if ($[8] !== className) {
|
|
113
105
|
t2 = clsx(nav_module_default.item, className);
|
|
114
|
-
$[
|
|
115
|
-
$[
|
|
116
|
-
} else t2 = $[
|
|
106
|
+
$[8] = className;
|
|
107
|
+
$[9] = t2;
|
|
108
|
+
} else t2 = $[9];
|
|
117
109
|
let t3;
|
|
118
|
-
if ($[
|
|
110
|
+
if ($[10] !== props || $[11] !== t1 || $[12] !== t2) {
|
|
119
111
|
t3 = /* @__PURE__ */ jsx(NavItemElement, {
|
|
120
112
|
...t1,
|
|
121
113
|
className: t2,
|
|
122
114
|
...props
|
|
123
115
|
});
|
|
124
|
-
$[
|
|
125
|
-
$[
|
|
126
|
-
$[
|
|
127
|
-
$[
|
|
128
|
-
} else t3 = $[
|
|
116
|
+
$[10] = props;
|
|
117
|
+
$[11] = t1;
|
|
118
|
+
$[12] = t2;
|
|
119
|
+
$[13] = t3;
|
|
120
|
+
} else t3 = $[13];
|
|
129
121
|
let t4;
|
|
130
|
-
if ($[
|
|
122
|
+
if ($[14] !== label || $[15] !== t3) {
|
|
131
123
|
t4 = /* @__PURE__ */ jsx(EntryShell, {
|
|
132
|
-
layout,
|
|
133
|
-
labelled,
|
|
134
124
|
label,
|
|
135
125
|
element: t3
|
|
136
126
|
});
|
|
137
|
-
$[
|
|
138
|
-
$[
|
|
139
|
-
$[
|
|
140
|
-
|
|
141
|
-
$[20] = t4;
|
|
142
|
-
} else t4 = $[20];
|
|
127
|
+
$[14] = label;
|
|
128
|
+
$[15] = t3;
|
|
129
|
+
$[16] = t4;
|
|
130
|
+
} else t4 = $[16];
|
|
143
131
|
return t4;
|
|
144
132
|
};
|
|
145
133
|
/**
|
|
@@ -168,7 +156,7 @@ var NavItemIcon = (t0) => {
|
|
|
168
156
|
} else t2 = $[4];
|
|
169
157
|
return t2;
|
|
170
158
|
};
|
|
171
|
-
/** The entry's text.
|
|
159
|
+
/** The entry's text. Leave it out where the entry is named by its `label` and the nav's `Hint` instead. */
|
|
172
160
|
var Label = (t0) => {
|
|
173
161
|
const $ = c(8);
|
|
174
162
|
let className;
|
|
@@ -206,7 +194,7 @@ var Label = (t0) => {
|
|
|
206
194
|
* is not a link, such as the trigger of an overflow sheet.
|
|
207
195
|
*
|
|
208
196
|
* @example
|
|
209
|
-
* <NavItemView.Root render={<Drawer.Trigger />}
|
|
197
|
+
* <NavItemView.Root render={<Drawer.Trigger />} layout="stack">
|
|
210
198
|
* <NavItemView.Icon><MoreIcon /></NavItemView.Icon>
|
|
211
199
|
* <NavItemView.Label>More</NavItemView.Label>
|
|
212
200
|
* </NavItemView.Root>
|