@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
|
@@ -12,11 +12,9 @@ export type FormRootProps = Omit<ComponentPropsWithRef<"form">, "onSubmit" | "ch
|
|
|
12
12
|
children: ReactNode;
|
|
13
13
|
}>;
|
|
14
14
|
/**
|
|
15
|
-
* The `<form>`: submits through the form instance,
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* reports unsaved changes to the page's leave guards. Its parts read the
|
|
19
|
-
* form from it.
|
|
15
|
+
* The `<form>`: it submits through the form instance, disables its fields while
|
|
16
|
+
* busy, focuses the first invalid control after a failed submit, and reports
|
|
17
|
+
* unsaved changes to the page's leave guards while `leaveGuard` holds.
|
|
20
18
|
*
|
|
21
19
|
* @example
|
|
22
20
|
* <Form.Root form={form}>…</Form.Root>
|
|
@@ -40,7 +38,7 @@ export type FormSubmitProps = Omit<Extract<ButtonProps, Readonly<{
|
|
|
40
38
|
busyLabel: string;
|
|
41
39
|
}>;
|
|
42
40
|
/**
|
|
43
|
-
* The form's submit button. A wait that lasts 150 ms shows a spinner
|
|
41
|
+
* The form's submit button. A wait that lasts 150 ms shows a spinner, is
|
|
44
42
|
* announced as `busyLabel`, and stays shown at least 200 ms.
|
|
45
43
|
*
|
|
46
44
|
* @example
|
|
@@ -12,17 +12,15 @@ import { focusFirstInvalid } from "./first-invalid.js";
|
|
|
12
12
|
import { FormDisabledProvider, FormStatusProvider, useFormDisabled, useFormStatus } from "./form-context.js";
|
|
13
13
|
import form_module_default from "./form.module.js";
|
|
14
14
|
import { c } from "react/compiler-runtime";
|
|
15
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
15
16
|
import { useEffect, useRef, useState } from "react";
|
|
16
|
-
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
17
17
|
import { useStore } from "@tanstack/react-form";
|
|
18
18
|
import { createPortal } from "react-dom";
|
|
19
19
|
// src/components/form/form.tsx
|
|
20
20
|
/**
|
|
21
|
-
* The `<form>`: submits through the form instance,
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* reports unsaved changes to the page's leave guards. Its parts read the
|
|
25
|
-
* form from it.
|
|
21
|
+
* The `<form>`: it submits through the form instance, disables its fields while
|
|
22
|
+
* busy, focuses the first invalid control after a failed submit, and reports
|
|
23
|
+
* unsaved changes to the page's leave guards while `leaveGuard` holds.
|
|
26
24
|
*
|
|
27
25
|
* @example
|
|
28
26
|
* <Form.Root form={form}>…</Form.Root>
|
|
@@ -205,7 +203,7 @@ var FormErrors = (t0) => {
|
|
|
205
203
|
return t2;
|
|
206
204
|
};
|
|
207
205
|
/**
|
|
208
|
-
* The form's submit button. A wait that lasts 150 ms shows a spinner
|
|
206
|
+
* The form's submit button. A wait that lasts 150 ms shows a spinner, is
|
|
209
207
|
* announced as `busyLabel`, and stays shown at least 200 ms.
|
|
210
208
|
*
|
|
211
209
|
* @example
|
|
@@ -279,7 +277,7 @@ var FormSubmit = (t0) => {
|
|
|
279
277
|
} else t7 = $[20];
|
|
280
278
|
let t8;
|
|
281
279
|
if ($[21] !== t6 || $[22] !== t7) {
|
|
282
|
-
t8 = /* @__PURE__ */ jsxs(Fragment
|
|
280
|
+
t8 = /* @__PURE__ */ jsxs(Fragment, { children: [t6, t7] });
|
|
283
281
|
$[21] = t6;
|
|
284
282
|
$[22] = t7;
|
|
285
283
|
$[23] = t8;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import type { FunctionComponent, ReactNode, SVGProps } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* The component type produced by SVGR's `?react` imports
|
|
4
|
-
* (e.g. `import Close from "@material-design-icons/svg/outlined/close.svg?react"`).
|
|
5
|
-
*/
|
|
2
|
+
/** An SVG as a React component, such as an SVGR `?react` import from the app's icon set. */
|
|
6
3
|
export type SvgComponent = FunctionComponent<SVGProps<SVGSVGElement>>;
|
|
7
4
|
export type IconProps = Readonly<{
|
|
8
|
-
/** The SVG component to render
|
|
5
|
+
/** The app's SVG component to render. */
|
|
9
6
|
svg: SvgComponent;
|
|
10
7
|
/**
|
|
11
8
|
* Size relative to the current font size (in `em`). Defaults to `1`
|
|
@@ -20,12 +17,10 @@ export type IconProps = Readonly<{
|
|
|
20
17
|
className?: string;
|
|
21
18
|
}>;
|
|
22
19
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* expose `role="img"` with an accessible name.
|
|
20
|
+
* Sizes, colours and labels the app's SVG, from any icon set. `label=""` hides
|
|
21
|
+
* it from assistive tech; a label names it as an image.
|
|
26
22
|
*
|
|
27
23
|
* @example
|
|
28
|
-
*
|
|
29
|
-
* <Icon svg={Close} label="Close" />
|
|
24
|
+
* <Icon svg={CloseIcon} label="Close" />
|
|
30
25
|
*/
|
|
31
26
|
export declare const Icon: ({ svg: Svg, size, label, className, }: IconProps) => ReactNode;
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import icon_module_default from "./icon.module.js";
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
3
|
import { clsx } from "clsx";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
// src/components/icon/icon.tsx
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* expose `role="img"` with an accessible name.
|
|
7
|
+
* Sizes, colours and labels the app's SVG, from any icon set. `label=""` hides
|
|
8
|
+
* it from assistive tech; a label names it as an image.
|
|
10
9
|
*
|
|
11
10
|
* @example
|
|
12
|
-
*
|
|
13
|
-
* <Icon svg={Close} label="Close" />
|
|
11
|
+
* <Icon svg={CloseIcon} label="Close" />
|
|
14
12
|
*/
|
|
15
13
|
var Icon = (t0) => {
|
|
16
14
|
const $ = c(12);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import link_module_default from "./link.module.js";
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
3
|
import { clsx } from "clsx";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
// src/components/link/link.tsx
|
|
6
6
|
/**
|
|
7
7
|
* The one text link: brand-coloured and underlined. It spreads every prop onto
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ComponentPropsWithRef, ReactNode } from "react";
|
|
2
2
|
import type { ButtonSize, ButtonTone, ButtonVariant } from "../button/button.tsx";
|
|
3
|
-
import { type SvgComponent } from "../icon/icon.tsx";
|
|
4
3
|
export type LinkButtonProps = ComponentPropsWithRef<"a"> & Readonly<{
|
|
5
4
|
/** Visual tier. @default "secondary" */
|
|
6
5
|
variant?: ButtonVariant;
|
|
@@ -9,7 +8,7 @@ export type LinkButtonProps = ComponentPropsWithRef<"a"> & Readonly<{
|
|
|
9
8
|
/** Colour role. @default "brand" */
|
|
10
9
|
tone?: ButtonTone;
|
|
11
10
|
/** Optional leading icon rendered before the label. */
|
|
12
|
-
icon?:
|
|
11
|
+
icon?: ReactNode;
|
|
13
12
|
children: ReactNode;
|
|
14
13
|
}>;
|
|
15
14
|
/**
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { buttonAttributes } from "../button/button-attributes.js";
|
|
2
|
-
import { Icon } from "../icon/icon.js";
|
|
3
2
|
import { c } from "react/compiler-runtime";
|
|
4
|
-
import {
|
|
3
|
+
import { jsxs } from "react/jsx-runtime";
|
|
5
4
|
// src/components/link-button/link-button.tsx
|
|
6
5
|
/**
|
|
7
6
|
* A link that looks and sizes exactly like a `Button`. It spreads every other
|
|
@@ -12,7 +11,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
12
11
|
* <RouterLinkButton to="/" variant="primary">Go to home page</RouterLinkButton>
|
|
13
12
|
*/
|
|
14
13
|
var LinkButton = (t0) => {
|
|
15
|
-
const $ = c(
|
|
14
|
+
const $ = c(18);
|
|
16
15
|
let anchorProps;
|
|
17
16
|
let children;
|
|
18
17
|
let className;
|
|
@@ -54,27 +53,18 @@ var LinkButton = (t0) => {
|
|
|
54
53
|
$[12] = t1;
|
|
55
54
|
} else t1 = $[12];
|
|
56
55
|
let t2;
|
|
57
|
-
if ($[13] !== icon) {
|
|
58
|
-
t2 =
|
|
59
|
-
svg: icon,
|
|
60
|
-
label: ""
|
|
61
|
-
}) : null;
|
|
62
|
-
$[13] = icon;
|
|
63
|
-
$[14] = t2;
|
|
64
|
-
} else t2 = $[14];
|
|
65
|
-
let t3;
|
|
66
|
-
if ($[15] !== anchorProps || $[16] !== children || $[17] !== t1 || $[18] !== t2) {
|
|
67
|
-
t3 = /* @__PURE__ */ jsxs("a", {
|
|
56
|
+
if ($[13] !== anchorProps || $[14] !== children || $[15] !== icon || $[16] !== t1) {
|
|
57
|
+
t2 = /* @__PURE__ */ jsxs("a", {
|
|
68
58
|
...t1,
|
|
69
59
|
...anchorProps,
|
|
70
|
-
children: [
|
|
60
|
+
children: [icon, children]
|
|
71
61
|
});
|
|
72
|
-
$[
|
|
73
|
-
$[
|
|
74
|
-
$[
|
|
75
|
-
$[
|
|
76
|
-
$[
|
|
77
|
-
} else
|
|
78
|
-
return
|
|
62
|
+
$[13] = anchorProps;
|
|
63
|
+
$[14] = children;
|
|
64
|
+
$[15] = icon;
|
|
65
|
+
$[16] = t1;
|
|
66
|
+
$[17] = t2;
|
|
67
|
+
} else t2 = $[17];
|
|
68
|
+
return t2;
|
|
79
69
|
};
|
|
80
70
|
export { LinkButton };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
export type LoadingMessageProps = Readonly<{
|
|
3
|
-
/** What the wait says and is announced as, such as "Loading your
|
|
3
|
+
/** What the wait says and is announced as, such as "Loading your invoices". */
|
|
4
4
|
title: string;
|
|
5
5
|
/** A line under the title, such as what the wait is for. */
|
|
6
6
|
description?: string;
|
|
@@ -17,6 +17,6 @@ export type LoadingMessageProps = Readonly<{
|
|
|
17
17
|
* announced once.
|
|
18
18
|
*
|
|
19
19
|
* @example
|
|
20
|
-
* <LoadingMessage title="Loading your
|
|
20
|
+
* <LoadingMessage title="Loading your invoices" illustration={<Logo />} />
|
|
21
21
|
*/
|
|
22
22
|
export declare const LoadingMessage: ({ title, description, illustration, busyAfter, className, }: LoadingMessageProps) => ReactNode;
|
|
@@ -11,7 +11,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
11
11
|
* announced once.
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
|
-
* <LoadingMessage title="Loading your
|
|
14
|
+
* <LoadingMessage title="Loading your invoices" illustration={<Logo />} />
|
|
15
15
|
*/
|
|
16
16
|
var LoadingMessage = (t0) => {
|
|
17
17
|
const $ = c(10);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useRequiredContext } from "../../lib/use-required-context.js";
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
|
-
import { createContext } from "react";
|
|
4
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { createContext } from "react";
|
|
5
5
|
import { I18nProvider } from "react-aria-components";
|
|
6
6
|
// src/components/locale-provider/locale-provider.tsx
|
|
7
7
|
var LocaleContext = createContext(void 0);
|
|
@@ -1,16 +1,29 @@
|
|
|
1
1
|
import { Menu as BaseMenu } from "@base-ui/react/menu";
|
|
2
2
|
import type { ComponentProps, ReactNode } from "react";
|
|
3
|
-
|
|
3
|
+
export type MenuRootProps<Payload = unknown> = Omit<BaseMenu.Root.Props<Payload>, "open" | "defaultOpen" | "onOpenChange" | "modal" | "children"> & Readonly<{
|
|
4
|
+
/** Whether the menu is open. Leave it out for a menu that keeps its own state. */
|
|
5
|
+
open?: boolean;
|
|
6
|
+
/** Whether the menu starts open, when it keeps its own state. @default false */
|
|
7
|
+
defaultOpen?: boolean;
|
|
8
|
+
/** Called with the new open state when the menu opens or closes. */
|
|
9
|
+
onOpenChange?: BaseMenu.Root.Props<Payload>["onOpenChange"];
|
|
10
|
+
/** Whether the page behind the menu is inert while it is open. @default true */
|
|
11
|
+
modal?: BaseMenu.Root.Props<Payload>["modal"];
|
|
12
|
+
/** The trigger and the menu's content. */
|
|
13
|
+
children?: BaseMenu.Root.Props<Payload>["children"];
|
|
14
|
+
}>;
|
|
15
|
+
/** Holds the menu's open state for its parts. It renders no element of its own. */
|
|
16
|
+
declare const Root: <Payload>(props: MenuRootProps<Payload>) => ReactNode;
|
|
4
17
|
type TriggerBaseProps = Omit<ComponentProps<typeof BaseMenu.Trigger>, "children" | "render">;
|
|
5
18
|
type IconTriggerProps = TriggerBaseProps & Readonly<{
|
|
6
|
-
icon:
|
|
19
|
+
icon: ReactNode;
|
|
7
20
|
/** Accessible name, surfaced as the tooltip hint and the `aria-label`. */
|
|
8
21
|
label: string;
|
|
9
22
|
children?: never;
|
|
10
23
|
}>;
|
|
11
24
|
type TextTriggerProps = TriggerBaseProps & Readonly<{
|
|
12
25
|
/** Optional leading icon rendered before the label. */
|
|
13
|
-
icon?:
|
|
26
|
+
icon?: ReactNode;
|
|
14
27
|
children: ReactNode;
|
|
15
28
|
label?: never;
|
|
16
29
|
}>;
|
|
@@ -21,13 +34,23 @@ export type MenuTriggerProps = IconTriggerProps | TextTriggerProps;
|
|
|
21
34
|
*/
|
|
22
35
|
declare const Trigger: (props: MenuTriggerProps) => ReactNode;
|
|
23
36
|
export type MenuPositionerProps = Omit<ComponentProps<typeof BaseMenu.Positioner>, "ref">;
|
|
37
|
+
/** Places the popup against its trigger, clear of the viewport's edges. */
|
|
24
38
|
declare const Positioner: ({ className, ...props }: MenuPositionerProps) => ReactNode;
|
|
39
|
+
/** The menu's surface, holding its items. */
|
|
25
40
|
declare const Popup: ({ className, ...props }: ComponentProps<typeof BaseMenu.Popup>) => ReactNode;
|
|
41
|
+
export type MenuContentProps = ComponentProps<typeof BaseMenu.Popup> & Readonly<Pick<MenuPositionerProps, "side" | "sideOffset" | "align" | "alignOffset"> & {
|
|
42
|
+
/** The element the menu is portalled into. @default document.body */
|
|
43
|
+
container?: BaseMenu.Portal.Props["container"];
|
|
44
|
+
}>;
|
|
45
|
+
/** `Portal`, `Positioner` and `Popup` in one: the menu's surface, placed against its trigger. */
|
|
46
|
+
declare const Content: ({ container, side, sideOffset, align, alignOffset, ...props }: MenuContentProps) => ReactNode;
|
|
47
|
+
/** The arrow pointing from the popup at its trigger. */
|
|
26
48
|
declare const Arrow: ({ className, ...props }: ComponentProps<typeof BaseMenu.Arrow>) => ReactNode;
|
|
27
49
|
export type MenuItemProps = ComponentProps<typeof BaseMenu.Item> & Readonly<{
|
|
28
50
|
/** Optional leading icon, rendered decoratively before the label. */
|
|
29
|
-
icon?:
|
|
51
|
+
icon?: ReactNode;
|
|
30
52
|
}>;
|
|
53
|
+
/** An action, with an optional leading icon. */
|
|
31
54
|
declare const Item: ({ icon, className, children, ...props }: MenuItemProps) => ReactNode;
|
|
32
55
|
export type MenuLinkItemProps = ComponentProps<typeof BaseMenu.LinkItem>;
|
|
33
56
|
/**
|
|
@@ -35,14 +58,17 @@ export type MenuLinkItemProps = ComponentProps<typeof BaseMenu.LinkItem>;
|
|
|
35
58
|
* forwards its ref, so a router's `createLink` can wrap it.
|
|
36
59
|
*/
|
|
37
60
|
declare const LinkItem: ({ className, ...props }: MenuLinkItemProps) => ReactNode;
|
|
61
|
+
/** A line between groups of items. */
|
|
38
62
|
declare const Separator: ({ className, ...props }: ComponentProps<typeof BaseMenu.Separator>) => ReactNode;
|
|
63
|
+
/** The heading that names a `Group`. */
|
|
39
64
|
declare const GroupLabel: ({ className, ...props }: ComponentProps<typeof BaseMenu.GroupLabel>) => ReactNode;
|
|
40
65
|
type MenuParts = Readonly<{
|
|
41
|
-
Root: typeof
|
|
66
|
+
Root: typeof Root;
|
|
42
67
|
Trigger: typeof Trigger;
|
|
43
68
|
Portal: typeof BaseMenu.Portal;
|
|
44
69
|
Positioner: typeof Positioner;
|
|
45
70
|
Popup: typeof Popup;
|
|
71
|
+
Content: typeof Content;
|
|
46
72
|
Arrow: typeof Arrow;
|
|
47
73
|
Item: typeof Item;
|
|
48
74
|
LinkItem: typeof LinkItem;
|
|
@@ -52,26 +78,18 @@ type MenuParts = Readonly<{
|
|
|
52
78
|
createHandle: typeof BaseMenu.createHandle;
|
|
53
79
|
}>;
|
|
54
80
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
* `--popup-edge-padding` from the viewport's edges.
|
|
81
|
+
* A dropdown menu over base-ui's `Menu`. `Content` bundles the portal,
|
|
82
|
+
* positioner and popup; the unbundled parts stay. Icons are the app's own.
|
|
58
83
|
*
|
|
59
84
|
* @example
|
|
60
|
-
* import RowActionsIcon from "@material-design-icons/svg/outlined/more_vert.svg?react";
|
|
61
|
-
* import DownloadIcon from "@material-design-icons/svg/outlined/download.svg?react";
|
|
62
|
-
*
|
|
63
85
|
* <Menu.Root>
|
|
64
|
-
* <Menu.Trigger icon={
|
|
65
|
-
* <Menu.
|
|
66
|
-
* <Menu.
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
* </Menu.Item>
|
|
72
|
-
* </Menu.Popup>
|
|
73
|
-
* </Menu.Positioner>
|
|
74
|
-
* </Menu.Portal>
|
|
86
|
+
* <Menu.Trigger icon={<MoreIcon />} label="Row actions" />
|
|
87
|
+
* <Menu.Content sideOffset={8}>
|
|
88
|
+
* <Menu.Arrow />
|
|
89
|
+
* <Menu.Item icon={<DownloadIcon />} onClick={download}>
|
|
90
|
+
* Download
|
|
91
|
+
* </Menu.Item>
|
|
92
|
+
* </Menu.Content>
|
|
75
93
|
* </Menu.Root>
|
|
76
94
|
*/
|
|
77
95
|
export declare const Menu: MenuParts;
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
import { usePopupEdgePadding } from "../../lib/popup-edge-padding.js";
|
|
2
2
|
import { Button } from "../button/button.js";
|
|
3
|
-
import { Icon } from "../icon/icon.js";
|
|
4
3
|
import menu_module_default from "./menu.module.js";
|
|
5
4
|
import { c } from "react/compiler-runtime";
|
|
6
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
5
|
import { clsx } from "clsx";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
7
|
import { Menu } from "@base-ui/react/menu";
|
|
9
8
|
// src/components/menu/menu.tsx
|
|
9
|
+
/** Holds the menu's open state for its parts. It renders no element of its own. */
|
|
10
|
+
var Root = (props) => {
|
|
11
|
+
const $ = c(2);
|
|
12
|
+
let t0;
|
|
13
|
+
if ($[0] !== props) {
|
|
14
|
+
t0 = /* @__PURE__ */ jsx(Menu.Root, { ...props });
|
|
15
|
+
$[0] = props;
|
|
16
|
+
$[1] = t0;
|
|
17
|
+
} else t0 = $[1];
|
|
18
|
+
return t0;
|
|
19
|
+
};
|
|
10
20
|
/**
|
|
11
21
|
* The button that opens a menu: `icon` + `label` for the icon form, `children`
|
|
12
22
|
* for a labelled one. Always a {@link Button}.
|
|
@@ -85,6 +95,7 @@ var Trigger = (props) => {
|
|
|
85
95
|
} else t1 = $[19];
|
|
86
96
|
return t1;
|
|
87
97
|
};
|
|
98
|
+
/** Places the popup against its trigger, clear of the viewport's edges. */
|
|
88
99
|
var Positioner = (t0) => {
|
|
89
100
|
const $ = c(9);
|
|
90
101
|
let className;
|
|
@@ -119,6 +130,7 @@ var Positioner = (t0) => {
|
|
|
119
130
|
} else t3 = $[8];
|
|
120
131
|
return t3;
|
|
121
132
|
};
|
|
133
|
+
/** The menu's surface, holding its items. */
|
|
122
134
|
var Popup = (t0) => {
|
|
123
135
|
const $ = c(8);
|
|
124
136
|
let className;
|
|
@@ -150,6 +162,67 @@ var Popup = (t0) => {
|
|
|
150
162
|
} else t2 = $[7];
|
|
151
163
|
return t2;
|
|
152
164
|
};
|
|
165
|
+
/** `Portal`, `Positioner` and `Popup` in one: the menu's surface, placed against its trigger. */
|
|
166
|
+
var Content = (t0) => {
|
|
167
|
+
const $ = c(18);
|
|
168
|
+
let align;
|
|
169
|
+
let alignOffset;
|
|
170
|
+
let container;
|
|
171
|
+
let props;
|
|
172
|
+
let side;
|
|
173
|
+
let sideOffset;
|
|
174
|
+
if ($[0] !== t0) {
|
|
175
|
+
({container, side, sideOffset, align, alignOffset, ...props} = t0);
|
|
176
|
+
$[0] = t0;
|
|
177
|
+
$[1] = align;
|
|
178
|
+
$[2] = alignOffset;
|
|
179
|
+
$[3] = container;
|
|
180
|
+
$[4] = props;
|
|
181
|
+
$[5] = side;
|
|
182
|
+
$[6] = sideOffset;
|
|
183
|
+
} else {
|
|
184
|
+
align = $[1];
|
|
185
|
+
alignOffset = $[2];
|
|
186
|
+
container = $[3];
|
|
187
|
+
props = $[4];
|
|
188
|
+
side = $[5];
|
|
189
|
+
sideOffset = $[6];
|
|
190
|
+
}
|
|
191
|
+
let t1;
|
|
192
|
+
if ($[7] !== props) {
|
|
193
|
+
t1 = /* @__PURE__ */ jsx(Popup, { ...props });
|
|
194
|
+
$[7] = props;
|
|
195
|
+
$[8] = t1;
|
|
196
|
+
} else t1 = $[8];
|
|
197
|
+
let t2;
|
|
198
|
+
if ($[9] !== align || $[10] !== alignOffset || $[11] !== side || $[12] !== sideOffset || $[13] !== t1) {
|
|
199
|
+
t2 = /* @__PURE__ */ jsx(Positioner, {
|
|
200
|
+
side,
|
|
201
|
+
sideOffset,
|
|
202
|
+
align,
|
|
203
|
+
alignOffset,
|
|
204
|
+
children: t1
|
|
205
|
+
});
|
|
206
|
+
$[9] = align;
|
|
207
|
+
$[10] = alignOffset;
|
|
208
|
+
$[11] = side;
|
|
209
|
+
$[12] = sideOffset;
|
|
210
|
+
$[13] = t1;
|
|
211
|
+
$[14] = t2;
|
|
212
|
+
} else t2 = $[14];
|
|
213
|
+
let t3;
|
|
214
|
+
if ($[15] !== container || $[16] !== t2) {
|
|
215
|
+
t3 = /* @__PURE__ */ jsx(Menu.Portal, {
|
|
216
|
+
container,
|
|
217
|
+
children: t2
|
|
218
|
+
});
|
|
219
|
+
$[15] = container;
|
|
220
|
+
$[16] = t2;
|
|
221
|
+
$[17] = t3;
|
|
222
|
+
} else t3 = $[17];
|
|
223
|
+
return t3;
|
|
224
|
+
};
|
|
225
|
+
/** The arrow pointing from the popup at its trigger. */
|
|
153
226
|
var Arrow = (t0) => {
|
|
154
227
|
const $ = c(9);
|
|
155
228
|
let className;
|
|
@@ -196,8 +269,9 @@ var Arrow = (t0) => {
|
|
|
196
269
|
} else t3 = $[8];
|
|
197
270
|
return t3;
|
|
198
271
|
};
|
|
272
|
+
/** An action, with an optional leading icon. */
|
|
199
273
|
var Item = (t0) => {
|
|
200
|
-
const $ = c(
|
|
274
|
+
const $ = c(12);
|
|
201
275
|
let children;
|
|
202
276
|
let className;
|
|
203
277
|
let icon;
|
|
@@ -222,28 +296,19 @@ var Item = (t0) => {
|
|
|
222
296
|
$[6] = t1;
|
|
223
297
|
} else t1 = $[6];
|
|
224
298
|
let t2;
|
|
225
|
-
if ($[7] !== icon) {
|
|
226
|
-
t2 =
|
|
227
|
-
svg: icon,
|
|
228
|
-
label: ""
|
|
229
|
-
});
|
|
230
|
-
$[7] = icon;
|
|
231
|
-
$[8] = t2;
|
|
232
|
-
} else t2 = $[8];
|
|
233
|
-
let t3;
|
|
234
|
-
if ($[9] !== children || $[10] !== props || $[11] !== t1 || $[12] !== t2) {
|
|
235
|
-
t3 = /* @__PURE__ */ jsxs(Menu.Item, {
|
|
299
|
+
if ($[7] !== children || $[8] !== icon || $[9] !== props || $[10] !== t1) {
|
|
300
|
+
t2 = /* @__PURE__ */ jsxs(Menu.Item, {
|
|
236
301
|
className: t1,
|
|
237
302
|
...props,
|
|
238
|
-
children: [
|
|
303
|
+
children: [icon, children]
|
|
239
304
|
});
|
|
240
|
-
$[
|
|
241
|
-
$[
|
|
242
|
-
$[
|
|
243
|
-
$[
|
|
244
|
-
$[
|
|
245
|
-
} else
|
|
246
|
-
return
|
|
305
|
+
$[7] = children;
|
|
306
|
+
$[8] = icon;
|
|
307
|
+
$[9] = props;
|
|
308
|
+
$[10] = t1;
|
|
309
|
+
$[11] = t2;
|
|
310
|
+
} else t2 = $[11];
|
|
311
|
+
return t2;
|
|
247
312
|
};
|
|
248
313
|
/**
|
|
249
314
|
* An item that leads to a page. It spreads every other prop onto the `<a>` and
|
|
@@ -280,6 +345,7 @@ var LinkItem = (t0) => {
|
|
|
280
345
|
} else t2 = $[7];
|
|
281
346
|
return t2;
|
|
282
347
|
};
|
|
348
|
+
/** A line between groups of items. */
|
|
283
349
|
var Separator = (t0) => {
|
|
284
350
|
const $ = c(8);
|
|
285
351
|
let className;
|
|
@@ -311,6 +377,7 @@ var Separator = (t0) => {
|
|
|
311
377
|
} else t2 = $[7];
|
|
312
378
|
return t2;
|
|
313
379
|
};
|
|
380
|
+
/** The heading that names a `Group`. */
|
|
314
381
|
var GroupLabel = (t0) => {
|
|
315
382
|
const $ = c(8);
|
|
316
383
|
let className;
|
|
@@ -343,34 +410,27 @@ var GroupLabel = (t0) => {
|
|
|
343
410
|
return t2;
|
|
344
411
|
};
|
|
345
412
|
/**
|
|
346
|
-
*
|
|
347
|
-
*
|
|
348
|
-
* `--popup-edge-padding` from the viewport's edges.
|
|
413
|
+
* A dropdown menu over base-ui's `Menu`. `Content` bundles the portal,
|
|
414
|
+
* positioner and popup; the unbundled parts stay. Icons are the app's own.
|
|
349
415
|
*
|
|
350
416
|
* @example
|
|
351
|
-
* import RowActionsIcon from "@material-design-icons/svg/outlined/more_vert.svg?react";
|
|
352
|
-
* import DownloadIcon from "@material-design-icons/svg/outlined/download.svg?react";
|
|
353
|
-
*
|
|
354
417
|
* <Menu.Root>
|
|
355
|
-
* <Menu.Trigger icon={
|
|
356
|
-
* <Menu.
|
|
357
|
-
* <Menu.
|
|
358
|
-
*
|
|
359
|
-
*
|
|
360
|
-
*
|
|
361
|
-
*
|
|
362
|
-
* </Menu.Item>
|
|
363
|
-
* </Menu.Popup>
|
|
364
|
-
* </Menu.Positioner>
|
|
365
|
-
* </Menu.Portal>
|
|
418
|
+
* <Menu.Trigger icon={<MoreIcon />} label="Row actions" />
|
|
419
|
+
* <Menu.Content sideOffset={8}>
|
|
420
|
+
* <Menu.Arrow />
|
|
421
|
+
* <Menu.Item icon={<DownloadIcon />} onClick={download}>
|
|
422
|
+
* Download
|
|
423
|
+
* </Menu.Item>
|
|
424
|
+
* </Menu.Content>
|
|
366
425
|
* </Menu.Root>
|
|
367
426
|
*/
|
|
368
427
|
var Menu$1 = {
|
|
369
|
-
Root
|
|
428
|
+
Root,
|
|
370
429
|
Trigger,
|
|
371
430
|
Portal: Menu.Portal,
|
|
372
431
|
Positioner,
|
|
373
432
|
Popup,
|
|
433
|
+
Content,
|
|
374
434
|
Arrow,
|
|
375
435
|
Item,
|
|
376
436
|
LinkItem,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useRender } from "@base-ui/react/use-render";
|
|
2
2
|
import { type ComponentPropsWithRef, type ReactElement, type ReactNode } from "react";
|
|
3
|
-
import { type SvgComponent } from "../icon/icon.tsx";
|
|
4
3
|
import { type NavLayout } from "./nav-context.ts";
|
|
5
4
|
/** What every nav entry takes besides its element's own props. */
|
|
6
5
|
export type NavEntryProps = Readonly<{
|
|
@@ -18,7 +17,7 @@ type EntryShellProps = NavEntryProps & Readonly<{
|
|
|
18
17
|
* Hangs an entry's element off the nav's one tooltip, which names it while it
|
|
19
18
|
* is unlabelled. Outside a `Nav.Root` the element stands alone.
|
|
20
19
|
*/
|
|
21
|
-
export declare const EntryShell: ({
|
|
20
|
+
export declare const EntryShell: ({ labelled, label, element, }: EntryShellProps) => ReactNode;
|
|
22
21
|
/** The attributes an entry's element carries for its layout and label. */
|
|
23
22
|
export declare const entryAttributes: ({ layout, labelled, label, }: NavEntryProps) => Readonly<{
|
|
24
23
|
"data-layout": NavLayout;
|
|
@@ -33,14 +32,15 @@ export type NavItemRootProps = useRender.ComponentProps<"button"> & NavEntryProp
|
|
|
33
32
|
*/
|
|
34
33
|
declare const Root: ({ layout, labelled, label, className, ...props }: NavItemRootProps) => ReactNode;
|
|
35
34
|
export type NavItemIconProps = Readonly<{
|
|
36
|
-
svg: SvgComponent;
|
|
37
35
|
className?: string;
|
|
36
|
+
/** The app's icon, drawn at `1em` in `currentColor`; the slot sizes it. */
|
|
37
|
+
children: ReactNode;
|
|
38
38
|
}>;
|
|
39
39
|
/**
|
|
40
|
-
* The entry's
|
|
41
|
-
* so it takes
|
|
40
|
+
* The entry's icon slot. A stacked entry's icon carries the destination on its
|
|
41
|
+
* own, so it takes 1.5em over the row's text-matched 1em.
|
|
42
42
|
*/
|
|
43
|
-
declare const NavItemIcon: ({
|
|
43
|
+
declare const NavItemIcon: ({ className, children, }: NavItemIconProps) => ReactNode;
|
|
44
44
|
/** The entry's text. Fades out where the entry is named by its tooltip instead. */
|
|
45
45
|
declare const Label: ({ className, ...props }: ComponentPropsWithRef<"span">) => ReactNode;
|
|
46
46
|
type NavItemViewParts = Readonly<{
|
|
@@ -55,7 +55,7 @@ type NavItemViewParts = Readonly<{
|
|
|
55
55
|
*
|
|
56
56
|
* @example
|
|
57
57
|
* <NavItemView.Root render={<Drawer.Trigger />} label="More" layout="stack">
|
|
58
|
-
* <NavItemView.Icon
|
|
58
|
+
* <NavItemView.Icon><MoreIcon /></NavItemView.Icon>
|
|
59
59
|
* <NavItemView.Label>More</NavItemView.Label>
|
|
60
60
|
* </NavItemView.Root>
|
|
61
61
|
*/
|