@senvenli/react 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/README.md +32 -2
- package/dist/action/button-group.d.ts +26 -0
- package/dist/action/button-group.js +12 -0
- package/dist/action/button-group.js.map +1 -0
- package/dist/action/button.d.ts +42 -0
- package/dist/action/button.js +58 -0
- package/dist/action/button.js.map +1 -0
- package/dist/action/close-button.d.ts +12 -0
- package/dist/action/close-button.js +13 -0
- package/dist/action/close-button.js.map +1 -0
- package/dist/action/copy-button.d.ts +21 -0
- package/dist/action/copy-button.js +38 -0
- package/dist/action/copy-button.js.map +1 -0
- package/dist/action/fab.d.ts +29 -0
- package/dist/action/fab.js +57 -0
- package/dist/action/fab.js.map +1 -0
- package/dist/action/files.d.ts +70 -0
- package/dist/action/files.js +156 -0
- package/dist/action/files.js.map +1 -0
- package/dist/action/index.d.ts +23 -0
- package/dist/action/index.js +16 -0
- package/dist/action/index.js.map +1 -0
- package/dist/action/language-names.d.ts +19 -0
- package/dist/action/language-names.js +79 -0
- package/dist/action/language-names.js.map +1 -0
- package/dist/action/language-switcher.d.ts +57 -0
- package/dist/action/language-switcher.js +53 -0
- package/dist/action/language-switcher.js.map +1 -0
- package/dist/action/link-button.d.ts +57 -0
- package/dist/action/link-button.js +48 -0
- package/dist/action/link-button.js.map +1 -0
- package/dist/action/link.d.ts +24 -0
- package/dist/action/link.js +18 -0
- package/dist/action/link.js.map +1 -0
- package/dist/action/pressable.d.ts +40 -0
- package/dist/action/pressable.js +65 -0
- package/dist/action/pressable.js.map +1 -0
- package/dist/action/styles.d.ts +60 -0
- package/dist/action/styles.js +109 -0
- package/dist/action/styles.js.map +1 -0
- package/dist/action/theme-script.d.ts +12 -0
- package/dist/action/theme-script.js +23 -0
- package/dist/action/theme-script.js.map +1 -0
- package/dist/action/theme-switcher.d.ts +43 -0
- package/dist/action/theme-switcher.js +260 -0
- package/dist/action/theme-switcher.js.map +1 -0
- package/dist/action/theme-toggle.d.ts +43 -0
- package/dist/action/theme-toggle.js +259 -0
- package/dist/action/theme-toggle.js.map +1 -0
- package/dist/action/toggle.d.ts +44 -0
- package/dist/action/toggle.js +28 -0
- package/dist/action/toggle.js.map +1 -0
- package/dist/action/touch-target.d.ts +9 -0
- package/dist/action/touch-target.js +14 -0
- package/dist/action/touch-target.js.map +1 -0
- package/dist/charts/axis-width.d.ts +186 -0
- package/dist/charts/axis-width.js +1262 -0
- package/dist/charts/axis-width.js.map +1 -0
- package/dist/charts/bar-public.d.ts +16 -0
- package/dist/charts/bar-public.js +16 -0
- package/dist/charts/bar-public.js.map +1 -0
- package/dist/charts/chart-parts.d.ts +136 -0
- package/dist/charts/chart-parts.js +160 -0
- package/dist/charts/chart-parts.js.map +1 -0
- package/dist/charts/core-charts.d.ts +157 -0
- package/dist/charts/core-charts.js +505 -0
- package/dist/charts/core-charts.js.map +1 -0
- package/dist/charts/index.d.ts +12 -0
- package/dist/charts/index.js +8 -0
- package/dist/charts/index.js.map +1 -0
- package/dist/charts/list-charts.d.ts +124 -0
- package/dist/charts/list-charts.js +308 -0
- package/dist/charts/list-charts.js.map +1 -0
- package/dist/charts/more-charts.d.ts +138 -0
- package/dist/charts/more-charts.js +284 -0
- package/dist/charts/more-charts.js.map +1 -0
- package/dist/charts/report-charts.d.ts +138 -0
- package/dist/charts/report-charts.js +370 -0
- package/dist/charts/report-charts.js.map +1 -0
- package/dist/charts/value-tick.d.ts +178 -0
- package/dist/charts/value-tick.js +240 -0
- package/dist/charts/value-tick.js.map +1 -0
- package/dist/collection/data-table-url-hook.d.ts +34 -0
- package/dist/collection/data-table-url-hook.js +70 -0
- package/dist/collection/data-table-url-hook.js.map +1 -0
- package/dist/collection/data-table-url.d.ts +30 -0
- package/dist/collection/data-table-url.js +48 -0
- package/dist/collection/data-table-url.js.map +1 -0
- package/dist/collection/data-table.d.ts +112 -0
- package/dist/collection/data-table.js +188 -0
- package/dist/collection/data-table.js.map +1 -0
- package/dist/collection/grid-list-public.d.ts +18 -0
- package/dist/collection/grid-list-public.js +19 -0
- package/dist/collection/grid-list-public.js.map +1 -0
- package/dist/collection/grid-list.d.ts +73 -0
- package/dist/collection/grid-list.js +46 -0
- package/dist/collection/grid-list.js.map +1 -0
- package/dist/collection/index.d.ts +14 -0
- package/dist/collection/index.js +8 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/list.d.ts +61 -0
- package/dist/collection/list.js +38 -0
- package/dist/collection/list.js.map +1 -0
- package/dist/collection/selection-checkbox.d.ts +5 -0
- package/dist/collection/selection-checkbox.js +13 -0
- package/dist/collection/selection-checkbox.js.map +1 -0
- package/dist/collection/table.d.ts +91 -0
- package/dist/collection/table.js +183 -0
- package/dist/collection/table.js.map +1 -0
- package/dist/collection/tree.d.ts +31 -0
- package/dist/collection/tree.js +22 -0
- package/dist/collection/tree.js.map +1 -0
- package/dist/color/color.d.ts +87 -0
- package/dist/color/color.js +200 -0
- package/dist/color/color.js.map +1 -0
- package/dist/color/contrast.d.ts +34 -0
- package/dist/color/contrast.js +44 -0
- package/dist/color/contrast.js.map +1 -0
- package/dist/color/index.d.ts +4 -0
- package/dist/color/index.js +5 -0
- package/dist/color/index.js.map +1 -0
- package/dist/date/calendar.d.ts +71 -0
- package/dist/date/calendar.js +291 -0
- package/dist/date/calendar.js.map +1 -0
- package/dist/date/fields.d.ts +174 -0
- package/dist/date/fields.js +250 -0
- package/dist/date/fields.js.map +1 -0
- package/dist/date/index.d.ts +7 -0
- package/dist/date/index.js +6 -0
- package/dist/date/index.js.map +1 -0
- package/dist/date/month-grid.d.ts +31 -0
- package/dist/date/month-grid.js +115 -0
- package/dist/date/month-grid.js.map +1 -0
- package/dist/date/pickers.d.ts +118 -0
- package/dist/date/pickers.js +176 -0
- package/dist/date/pickers.js.map +1 -0
- package/dist/date/public.d.ts +25 -0
- package/dist/date/public.js +24 -0
- package/dist/date/public.js.map +1 -0
- package/dist/date/segments.d.ts +153 -0
- package/dist/date/segments.js +433 -0
- package/dist/date/segments.js.map +1 -0
- package/dist/defaults.d.ts +74 -0
- package/dist/defaults.js +100 -0
- package/dist/defaults.js.map +1 -0
- package/dist/density.d.ts +2 -0
- package/dist/density.js +2 -0
- package/dist/density.js.map +1 -0
- package/dist/display/avatar.d.ts +29 -0
- package/dist/display/avatar.js +71 -0
- package/dist/display/avatar.js.map +1 -0
- package/dist/display/badge.d.ts +65 -0
- package/dist/display/badge.js +99 -0
- package/dist/display/badge.js.map +1 -0
- package/dist/display/card.d.ts +72 -0
- package/dist/display/card.js +91 -0
- package/dist/display/card.js.map +1 -0
- package/dist/display/carousel.d.ts +47 -0
- package/dist/display/carousel.js +214 -0
- package/dist/display/carousel.js.map +1 -0
- package/dist/display/description-list.d.ts +25 -0
- package/dist/display/description-list.js +36 -0
- package/dist/display/description-list.js.map +1 -0
- package/dist/display/icon-aliases.d.ts +1 -0
- package/dist/display/icon-aliases.js +259 -0
- package/dist/display/icon-aliases.js.map +1 -0
- package/dist/display/icon-names.d.ts +4 -0
- package/dist/display/icon-names.js +2 -0
- package/dist/display/icon-names.js.map +1 -0
- package/dist/display/icon.d.ts +51 -0
- package/dist/display/icon.js +96 -0
- package/dist/display/icon.js.map +1 -0
- package/dist/display/image-crop.d.ts +106 -0
- package/dist/display/image-crop.js +117 -0
- package/dist/display/image-crop.js.map +1 -0
- package/dist/display/image-cropper.d.ts +68 -0
- package/dist/display/image-cropper.js +284 -0
- package/dist/display/image-cropper.js.map +1 -0
- package/dist/display/image-viewer.d.ts +54 -0
- package/dist/display/image-viewer.js +84 -0
- package/dist/display/image-viewer.js.map +1 -0
- package/dist/display/image.d.ts +26 -0
- package/dist/display/image.js +17 -0
- package/dist/display/image.js.map +1 -0
- package/dist/display/index.d.ts +29 -0
- package/dist/display/index.js +16 -0
- package/dist/display/index.js.map +1 -0
- package/dist/display/iso-chip.d.ts +19 -0
- package/dist/display/iso-chip.js +21 -0
- package/dist/display/iso-chip.js.map +1 -0
- package/dist/display/kbd.d.ts +11 -0
- package/dist/display/kbd.js +33 -0
- package/dist/display/kbd.js.map +1 -0
- package/dist/display/lozenge.d.ts +30 -0
- package/dist/display/lozenge.js +55 -0
- package/dist/display/lozenge.js.map +1 -0
- package/dist/display/scroll-area.d.ts +29 -0
- package/dist/display/scroll-area.js +95 -0
- package/dist/display/scroll-area.js.map +1 -0
- package/dist/display/separator.d.ts +13 -0
- package/dist/display/separator.js +24 -0
- package/dist/display/separator.js.map +1 -0
- package/dist/display/stat.d.ts +35 -0
- package/dist/display/stat.js +41 -0
- package/dist/display/stat.js.map +1 -0
- package/dist/display/timeline.d.ts +44 -0
- package/dist/display/timeline.js +111 -0
- package/dist/display/timeline.js.map +1 -0
- package/dist/display/typography.d.ts +37 -0
- package/dist/display/typography.js +53 -0
- package/dist/display/typography.js.map +1 -0
- package/dist/display/visually-hidden.d.ts +14 -0
- package/dist/display/visually-hidden.js +10 -0
- package/dist/display/visually-hidden.js.map +1 -0
- package/dist/feedback/banner.d.ts +46 -0
- package/dist/feedback/banner.js +157 -0
- package/dist/feedback/banner.js.map +1 -0
- package/dist/feedback/cooldown.d.ts +17 -0
- package/dist/feedback/cooldown.js +59 -0
- package/dist/feedback/cooldown.js.map +1 -0
- package/dist/feedback/empty-state.d.ts +35 -0
- package/dist/feedback/empty-state.js +39 -0
- package/dist/feedback/empty-state.js.map +1 -0
- package/dist/feedback/index.d.ts +12 -0
- package/dist/feedback/index.js +11 -0
- package/dist/feedback/index.js.map +1 -0
- package/dist/feedback/meter.d.ts +33 -0
- package/dist/feedback/meter.js +42 -0
- package/dist/feedback/meter.js.map +1 -0
- package/dist/feedback/motion.d.ts +9 -0
- package/dist/feedback/motion.js +57 -0
- package/dist/feedback/motion.js.map +1 -0
- package/dist/feedback/progress.d.ts +39 -0
- package/dist/feedback/progress.js +68 -0
- package/dist/feedback/progress.js.map +1 -0
- package/dist/feedback/skeleton.d.ts +48 -0
- package/dist/feedback/skeleton.js +61 -0
- package/dist/feedback/skeleton.js.map +1 -0
- package/dist/feedback/spinner.d.ts +19 -0
- package/dist/feedback/spinner.js +29 -0
- package/dist/feedback/spinner.js.map +1 -0
- package/dist/feedback/status-dot.d.ts +23 -0
- package/dist/feedback/status-dot.js +37 -0
- package/dist/feedback/status-dot.js.map +1 -0
- package/dist/form/countries.d.ts +34 -0
- package/dist/form/countries.js +273 -0
- package/dist/form/countries.js.map +1 -0
- package/dist/form/data-attributes.d.ts +11 -0
- package/dist/form/data-attributes.js +22 -0
- package/dist/form/data-attributes.js.map +1 -0
- package/dist/form/field-parts.d.ts +113 -0
- package/dist/form/field-parts.js +178 -0
- package/dist/form/field-parts.js.map +1 -0
- package/dist/form/field.d.ts +36 -0
- package/dist/form/field.js +65 -0
- package/dist/form/field.js.map +1 -0
- package/dist/form/files.d.ts +70 -0
- package/dist/form/files.js +156 -0
- package/dist/form/files.js.map +1 -0
- package/dist/form/form.d.ts +40 -0
- package/dist/form/form.js +74 -0
- package/dist/form/form.js.map +1 -0
- package/dist/form/image-crop.d.ts +106 -0
- package/dist/form/image-crop.js +117 -0
- package/dist/form/image-crop.js.map +1 -0
- package/dist/form/image-cropper.d.ts +68 -0
- package/dist/form/image-cropper.js +284 -0
- package/dist/form/image-cropper.js.map +1 -0
- package/dist/form/index.d.ts +24 -0
- package/dist/form/index.js +15 -0
- package/dist/form/index.js.map +1 -0
- package/dist/form/input-group.d.ts +63 -0
- package/dist/form/input-group.js +63 -0
- package/dist/form/input-group.js.map +1 -0
- package/dist/form/input-otp.d.ts +35 -0
- package/dist/form/input-otp.js +83 -0
- package/dist/form/input-otp.js.map +1 -0
- package/dist/form/input.d.ts +36 -0
- package/dist/form/input.js +41 -0
- package/dist/form/input.js.map +1 -0
- package/dist/form/number-field.d.ts +84 -0
- package/dist/form/number-field.js +81 -0
- package/dist/form/number-field.js.map +1 -0
- package/dist/form/otp-field.d.ts +37 -0
- package/dist/form/otp-field.js +116 -0
- package/dist/form/otp-field.js.map +1 -0
- package/dist/form/password-field.d.ts +61 -0
- package/dist/form/password-field.js +61 -0
- package/dist/form/password-field.js.map +1 -0
- package/dist/form/phone-field.d.ts +104 -0
- package/dist/form/phone-field.js +275 -0
- package/dist/form/phone-field.js.map +1 -0
- package/dist/form/phone-paste.d.ts +24 -0
- package/dist/form/phone-paste.js +40 -0
- package/dist/form/phone-paste.js.map +1 -0
- package/dist/form/phone.d.ts +159 -0
- package/dist/form/phone.js +309 -0
- package/dist/form/phone.js.map +1 -0
- package/dist/form/search-field.d.ts +29 -0
- package/dist/form/search-field.js +23 -0
- package/dist/form/search-field.js.map +1 -0
- package/dist/form/styles.d.ts +31 -0
- package/dist/form/styles.js +43 -0
- package/dist/form/styles.js.map +1 -0
- package/dist/form/text-area.d.ts +70 -0
- package/dist/form/text-area.js +93 -0
- package/dist/form/text-area.js.map +1 -0
- package/dist/form/text-field.d.ts +131 -0
- package/dist/form/text-field.js +59 -0
- package/dist/form/text-field.js.map +1 -0
- package/dist/form/validation.d.ts +145 -0
- package/dist/form/validation.js +136 -0
- package/dist/form/validation.js.map +1 -0
- package/dist/i18n.d.ts +438 -0
- package/dist/i18n.js +948 -0
- package/dist/i18n.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/intl-locale.d.ts +30 -0
- package/dist/intl-locale.js +83 -0
- package/dist/intl-locale.js.map +1 -0
- package/dist/layers.d.ts +32 -0
- package/dist/layers.js +33 -0
- package/dist/layers.js.map +1 -0
- package/dist/layout/auth-form-layout.d.ts +71 -0
- package/dist/layout/auth-form-layout.js +61 -0
- package/dist/layout/auth-form-layout.js.map +1 -0
- package/dist/layout/auth-layout.d.ts +59 -0
- package/dist/layout/auth-layout.js +26 -0
- package/dist/layout/auth-layout.js.map +1 -0
- package/dist/layout/box.d.ts +26 -0
- package/dist/layout/box.js +16 -0
- package/dist/layout/box.js.map +1 -0
- package/dist/layout/grid.d.ts +27 -0
- package/dist/layout/grid.js +26 -0
- package/dist/layout/grid.js.map +1 -0
- package/dist/layout/index.d.ts +16 -0
- package/dist/layout/index.js +12 -0
- package/dist/layout/index.js.map +1 -0
- package/dist/layout/pressable.d.ts +40 -0
- package/dist/layout/pressable.js +65 -0
- package/dist/layout/pressable.js.map +1 -0
- package/dist/layout/reset-sent-card.d.ts +39 -0
- package/dist/layout/reset-sent-card.js +22 -0
- package/dist/layout/reset-sent-card.js.map +1 -0
- package/dist/layout/scroll-area.d.ts +29 -0
- package/dist/layout/scroll-area.js +95 -0
- package/dist/layout/scroll-area.js.map +1 -0
- package/dist/layout/section.d.ts +41 -0
- package/dist/layout/section.js +22 -0
- package/dist/layout/section.js.map +1 -0
- package/dist/layout/split.d.ts +50 -0
- package/dist/layout/split.js +35 -0
- package/dist/layout/split.js.map +1 -0
- package/dist/layout/stack.d.ts +44 -0
- package/dist/layout/stack.js +36 -0
- package/dist/layout/stack.js.map +1 -0
- package/dist/layout/tokens.d.ts +33 -0
- package/dist/layout/tokens.js +85 -0
- package/dist/layout/tokens.js.map +1 -0
- package/dist/layout/toolbar.d.ts +37 -0
- package/dist/layout/toolbar.js +334 -0
- package/dist/layout/toolbar.js.map +1 -0
- package/dist/navigate-context.d.ts +12 -0
- package/dist/navigate-context.js +13 -0
- package/dist/navigate-context.js.map +1 -0
- package/dist/navigation/accordion.d.ts +40 -0
- package/dist/navigation/accordion.js +33 -0
- package/dist/navigation/accordion.js.map +1 -0
- package/dist/navigation/bottom-nav.d.ts +29 -0
- package/dist/navigation/bottom-nav.js +48 -0
- package/dist/navigation/bottom-nav.js.map +1 -0
- package/dist/navigation/brand-link-context.d.ts +8 -0
- package/dist/navigation/brand-link-context.js +9 -0
- package/dist/navigation/brand-link-context.js.map +1 -0
- package/dist/navigation/breadcrumbs.d.ts +36 -0
- package/dist/navigation/breadcrumbs.js +51 -0
- package/dist/navigation/breadcrumbs.js.map +1 -0
- package/dist/navigation/dock.d.ts +27 -0
- package/dist/navigation/dock.js +47 -0
- package/dist/navigation/dock.js.map +1 -0
- package/dist/navigation/footer.d.ts +43 -0
- package/dist/navigation/footer.js +43 -0
- package/dist/navigation/footer.js.map +1 -0
- package/dist/navigation/index.d.ts +22 -0
- package/dist/navigation/index.js +17 -0
- package/dist/navigation/index.js.map +1 -0
- package/dist/navigation/language-names.d.ts +19 -0
- package/dist/navigation/language-names.js +79 -0
- package/dist/navigation/language-names.js.map +1 -0
- package/dist/navigation/language-switcher.d.ts +55 -0
- package/dist/navigation/language-switcher.js +53 -0
- package/dist/navigation/language-switcher.js.map +1 -0
- package/dist/navigation/nav-panel.d.ts +18 -0
- package/dist/navigation/nav-panel.js +51 -0
- package/dist/navigation/nav-panel.js.map +1 -0
- package/dist/navigation/navbar.d.ts +73 -0
- package/dist/navigation/navbar.js +64 -0
- package/dist/navigation/navbar.js.map +1 -0
- package/dist/navigation/page-header.d.ts +37 -0
- package/dist/navigation/page-header.js +50 -0
- package/dist/navigation/page-header.js.map +1 -0
- package/dist/navigation/pagination.d.ts +25 -0
- package/dist/navigation/pagination.js +51 -0
- package/dist/navigation/pagination.js.map +1 -0
- package/dist/navigation/panel-header.d.ts +37 -0
- package/dist/navigation/panel-header.js +50 -0
- package/dist/navigation/panel-header.js.map +1 -0
- package/dist/navigation/sidebar-script.d.ts +12 -0
- package/dist/navigation/sidebar-script.js +20 -0
- package/dist/navigation/sidebar-script.js.map +1 -0
- package/dist/navigation/sidebar.d.ts +149 -0
- package/dist/navigation/sidebar.js +332 -0
- package/dist/navigation/sidebar.js.map +1 -0
- package/dist/navigation/skip-link.d.ts +12 -0
- package/dist/navigation/skip-link.js +30 -0
- package/dist/navigation/skip-link.js.map +1 -0
- package/dist/navigation/stepper.d.ts +50 -0
- package/dist/navigation/stepper.js +96 -0
- package/dist/navigation/stepper.js.map +1 -0
- package/dist/navigation/tabs.d.ts +84 -0
- package/dist/navigation/tabs.js +118 -0
- package/dist/navigation/tabs.js.map +1 -0
- package/dist/navigation/toolbar.d.ts +37 -0
- package/dist/navigation/toolbar.js +334 -0
- package/dist/navigation/toolbar.js.map +1 -0
- package/dist/overlay/alert-dialog.d.ts +63 -0
- package/dist/overlay/alert-dialog.js +76 -0
- package/dist/overlay/alert-dialog.js.map +1 -0
- package/dist/overlay/command-palette.d.ts +53 -0
- package/dist/overlay/command-palette.js +130 -0
- package/dist/overlay/command-palette.js.map +1 -0
- package/dist/overlay/command.d.ts +53 -0
- package/dist/overlay/command.js +129 -0
- package/dist/overlay/command.js.map +1 -0
- package/dist/overlay/context-menu.d.ts +29 -0
- package/dist/overlay/context-menu.js +58 -0
- package/dist/overlay/context-menu.js.map +1 -0
- package/dist/overlay/dialog.d.ts +162 -0
- package/dist/overlay/dialog.js +174 -0
- package/dist/overlay/dialog.js.map +1 -0
- package/dist/overlay/drawer.d.ts +41 -0
- package/dist/overlay/drawer.js +114 -0
- package/dist/overlay/drawer.js.map +1 -0
- package/dist/overlay/floating.d.ts +142 -0
- package/dist/overlay/floating.js +226 -0
- package/dist/overlay/floating.js.map +1 -0
- package/dist/overlay/hover-card.d.ts +19 -0
- package/dist/overlay/hover-card.js +31 -0
- package/dist/overlay/hover-card.js.map +1 -0
- package/dist/overlay/index.d.ts +18 -0
- package/dist/overlay/index.js +12 -0
- package/dist/overlay/index.js.map +1 -0
- package/dist/overlay/overlay-base.d.ts +105 -0
- package/dist/overlay/overlay-base.js +250 -0
- package/dist/overlay/overlay-base.js.map +1 -0
- package/dist/overlay/overlay.d.ts +299 -0
- package/dist/overlay/overlay.js +558 -0
- package/dist/overlay/overlay.js.map +1 -0
- package/dist/overlay/toast.d.ts +58 -0
- package/dist/overlay/toast.js +145 -0
- package/dist/overlay/toast.js.map +1 -0
- package/dist/provider.d.ts +26 -0
- package/dist/provider.js +30 -0
- package/dist/provider.js.map +1 -0
- package/dist/selection/autocomplete.d.ts +54 -0
- package/dist/selection/autocomplete.js +122 -0
- package/dist/selection/autocomplete.js.map +1 -0
- package/dist/selection/checkbox.d.ts +56 -0
- package/dist/selection/checkbox.js +49 -0
- package/dist/selection/checkbox.js.map +1 -0
- package/dist/selection/choice-size.d.ts +26 -0
- package/dist/selection/choice-size.js +50 -0
- package/dist/selection/choice-size.js.map +1 -0
- package/dist/selection/choice-text.d.ts +21 -0
- package/dist/selection/choice-text.js +33 -0
- package/dist/selection/choice-text.js.map +1 -0
- package/dist/selection/combobox.d.ts +173 -0
- package/dist/selection/combobox.js +410 -0
- package/dist/selection/combobox.js.map +1 -0
- package/dist/selection/index.d.ts +20 -0
- package/dist/selection/index.js +13 -0
- package/dist/selection/index.js.map +1 -0
- package/dist/selection/list-box.d.ts +30 -0
- package/dist/selection/list-box.js +16 -0
- package/dist/selection/list-box.js.map +1 -0
- package/dist/selection/listbox.d.ts +44 -0
- package/dist/selection/listbox.js +49 -0
- package/dist/selection/listbox.js.map +1 -0
- package/dist/selection/match.d.ts +20 -0
- package/dist/selection/match.js +57 -0
- package/dist/selection/match.js.map +1 -0
- package/dist/selection/multi-select.d.ts +72 -0
- package/dist/selection/multi-select.js +138 -0
- package/dist/selection/multi-select.js.map +1 -0
- package/dist/selection/radio-card.d.ts +31 -0
- package/dist/selection/radio-card.js +29 -0
- package/dist/selection/radio-card.js.map +1 -0
- package/dist/selection/radio.d.ts +72 -0
- package/dist/selection/radio.js +64 -0
- package/dist/selection/radio.js.map +1 -0
- package/dist/selection/select-public.d.ts +19 -0
- package/dist/selection/select-public.js +24 -0
- package/dist/selection/select-public.js.map +1 -0
- package/dist/selection/select.d.ts +72 -0
- package/dist/selection/select.js +69 -0
- package/dist/selection/select.js.map +1 -0
- package/dist/selection/slider.d.ts +16 -0
- package/dist/selection/slider.js +44 -0
- package/dist/selection/slider.js.map +1 -0
- package/dist/selection/styles.d.ts +26 -0
- package/dist/selection/styles.js +78 -0
- package/dist/selection/styles.js.map +1 -0
- package/dist/selection/switch.d.ts +24 -0
- package/dist/selection/switch.js +27 -0
- package/dist/selection/switch.js.map +1 -0
- package/dist/selection/tag-group.d.ts +38 -0
- package/dist/selection/tag-group.js +45 -0
- package/dist/selection/tag-group.js.map +1 -0
- package/dist/tone.d.ts +6 -0
- package/dist/tone.js +2 -0
- package/dist/tone.js.map +1 -0
- package/dist/utils.d.ts +9 -0
- package/dist/utils.js +42 -0
- package/dist/utils.js.map +1 -0
- package/manifest/component.full.schema.json +391 -0
- package/manifest/component.schema.json +279 -0
- package/manifests/accordion.json +299 -0
- package/manifests/alert-dialog.json +261 -0
- package/manifests/area-chart.json +338 -0
- package/manifests/autocomplete.json +299 -0
- package/manifests/avatar.json +253 -0
- package/manifests/badge.json +288 -0
- package/manifests/banner.json +185 -0
- package/manifests/bar-chart.json +454 -0
- package/manifests/bar-list.json +262 -0
- package/manifests/bottom-nav.json +139 -0
- package/manifests/box.json +3450 -0
- package/manifests/breadcrumbs.json +199 -0
- package/manifests/button-group.json +2294 -0
- package/manifests/button.json +1211 -0
- package/manifests/calendar-heatmap.json +218 -0
- package/manifests/calendar.json +299 -0
- package/manifests/card.json +308 -0
- package/manifests/carousel.json +263 -0
- package/manifests/chart-parts.json +309 -0
- package/manifests/checkbox.json +998 -0
- package/manifests/close-button.json +1000 -0
- package/manifests/color-field.json +276 -0
- package/manifests/color-picker.json +161 -0
- package/manifests/color-swatch-picker.json +220 -0
- package/manifests/color-swatch.json +140 -0
- package/manifests/combobox.json +581 -0
- package/manifests/command.json +275 -0
- package/manifests/composed-chart.json +287 -0
- package/manifests/context-menu.json +148 -0
- package/manifests/copy-button.json +192 -0
- package/manifests/data-table.json +334 -0
- package/manifests/date-field.json +302 -0
- package/manifests/date-picker.json +472 -0
- package/manifests/description-list.json +201 -0
- package/manifests/dialog.json +322 -0
- package/manifests/donut-chart.json +264 -0
- package/manifests/drawer.json +211 -0
- package/manifests/empty-state.json +185 -0
- package/manifests/fab.json +172 -0
- package/manifests/field.json +209 -0
- package/manifests/file-upload.json +791 -0
- package/manifests/form.json +829 -0
- package/manifests/funnel-chart.json +223 -0
- package/manifests/gauge-chart.json +252 -0
- package/manifests/grid-list.json +335 -0
- package/manifests/grid.json +3482 -0
- package/manifests/heading.json +183 -0
- package/manifests/heatmap.json +265 -0
- package/manifests/hover-card.json +172 -0
- package/manifests/icon.json +201 -0
- package/manifests/image-cropper.json +295 -0
- package/manifests/image-viewer.json +198 -0
- package/manifests/image.json +193 -0
- package/manifests/index.json +2035 -0
- package/manifests/input-group.json +3571 -0
- package/manifests/input.json +1557 -0
- package/manifests/kbd.json +98 -0
- package/manifests/language-switcher.json +274 -0
- package/manifests/line-chart.json +342 -0
- package/manifests/link.json +867 -0
- package/manifests/list-box.json +213 -0
- package/manifests/menu.json +453 -0
- package/manifests/meter.json +145 -0
- package/manifests/navbar.json +281 -0
- package/manifests/otp-field.json +1029 -0
- package/manifests/page-header.json +164 -0
- package/manifests/pagination.json +181 -0
- package/manifests/popover.json +205 -0
- package/manifests/pressable.json +367 -0
- package/manifests/progress.json +282 -0
- package/manifests/radar-chart.json +229 -0
- package/manifests/radial-chart.json +195 -0
- package/manifests/radio.json +975 -0
- package/manifests/scatter-chart.json +277 -0
- package/manifests/scroll-area.json +127 -0
- package/manifests/section.json +169 -0
- package/manifests/select.json +474 -0
- package/manifests/separator.json +119 -0
- package/manifests/sidebar.json +584 -0
- package/manifests/skeleton.json +235 -0
- package/manifests/skip-link.json +89 -0
- package/manifests/slider.json +706 -0
- package/manifests/sparkline.json +208 -0
- package/manifests/spinner.json +105 -0
- package/manifests/split.json +6618 -0
- package/manifests/stack.json +3541 -0
- package/manifests/stat.json +192 -0
- package/manifests/stepper.json +279 -0
- package/manifests/switch.json +205 -0
- package/manifests/table.json +375 -0
- package/manifests/tabs.json +438 -0
- package/manifests/tag-group.json +264 -0
- package/manifests/text-area.json +1136 -0
- package/manifests/text.json +244 -0
- package/manifests/theme-switcher.json +152 -0
- package/manifests/time-field.json +284 -0
- package/manifests/timeline.json +196 -0
- package/manifests/toast.json +87 -0
- package/manifests/toggle-button.json +1489 -0
- package/manifests/toolbar.json +145 -0
- package/manifests/tooltip.json +181 -0
- package/manifests/tracker.json +192 -0
- package/manifests/tree.json +245 -0
- package/manifests/visually-hidden.json +114 -0
- package/package.json +117 -3
- package/styles/base.css +56 -0
- package/styles/theme.css +154 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type BreadcrumbItem } from "./breadcrumbs.js";
|
|
3
|
+
/**
|
|
4
|
+
* Owns the bar's two regions. It sits above both the bar and the page, because the shell renders them as
|
|
5
|
+
* siblings: the bar outside the scrolling box (so content never runs under it) and the page inside it.
|
|
6
|
+
*/
|
|
7
|
+
export declare function PanelHeaderProvider({ children }: {
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}): React.JSX.Element;
|
|
10
|
+
export type PanelHeaderBarProps = {
|
|
11
|
+
/** The menu button's name ("Open menu"); it opens the Sidebar, which is a panel under 1024px. */
|
|
12
|
+
menuLabel: string;
|
|
13
|
+
onMenuPress: () => void;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* The panel's top bar (admin apps): the menu button under 1024px, then the page's title and its
|
|
17
|
+
* actions, which the page passes through `PanelHeader`. The shell renders it outside the box that scrolls.
|
|
18
|
+
* Below 640px the actions take their own row, so a search field and a primary button never squeeze the title.
|
|
19
|
+
*/
|
|
20
|
+
export declare function PanelHeaderBar({ menuLabel, onMenuPress }: PanelHeaderBarProps): React.JSX.Element;
|
|
21
|
+
export type PanelHeaderProps = {
|
|
22
|
+
/** The page's name; the page's one h1. */
|
|
23
|
+
title: React.ReactNode;
|
|
24
|
+
/** One line under the title. */
|
|
25
|
+
description?: React.ReactNode;
|
|
26
|
+
/** Where the page sits, above the title (a detail page under its list). */
|
|
27
|
+
breadcrumbs?: readonly BreadcrumbItem[];
|
|
28
|
+
/** The page's actions: filters, a search field, one primary button. */
|
|
29
|
+
actions?: React.ReactNode;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* A panel page's header: the page says what it is and what it can do, and the
|
|
33
|
+
* shell's `PanelHeaderBar` shows it, outside the scrolling content. Outside a `PanelHeaderProvider` (a page
|
|
34
|
+
* rendered on its own, a test), it renders in place, so such a page keeps its title. A provider must always
|
|
35
|
+
* render a bar.
|
|
36
|
+
*/
|
|
37
|
+
export declare function PanelHeader({ title, description, breadcrumbs, actions }: PanelHeaderProps): React.JSX.Element | null;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { createPortal } from "react-dom";
|
|
5
|
+
import { Button } from "../action/button.js";
|
|
6
|
+
import { Heading, Text } from "../display/typography.js";
|
|
7
|
+
import { Breadcrumbs } from "./breadcrumbs.js";
|
|
8
|
+
const PanelHeaderContext = React.createContext(null);
|
|
9
|
+
/**
|
|
10
|
+
* Owns the bar's two regions. It sits above both the bar and the page, because the shell renders them as
|
|
11
|
+
* siblings: the bar outside the scrolling box (so content never runs under it) and the page inside it.
|
|
12
|
+
*/
|
|
13
|
+
export function PanelHeaderProvider({ children }) {
|
|
14
|
+
const [titleNode, setTitleNode] = React.useState(null);
|
|
15
|
+
const [actionsNode, setActionsNode] = React.useState(null);
|
|
16
|
+
const value = React.useMemo(() => ({ titleNode, actionsNode, setTitleNode, setActionsNode }), [titleNode, actionsNode]);
|
|
17
|
+
return _jsx(PanelHeaderContext.Provider, { value: value, children: children });
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The panel's top bar (admin apps): the menu button under 1024px, then the page's title and its
|
|
21
|
+
* actions, which the page passes through `PanelHeader`. The shell renders it outside the box that scrolls.
|
|
22
|
+
* Below 640px the actions take their own row, so a search field and a primary button never squeeze the title.
|
|
23
|
+
*/
|
|
24
|
+
export function PanelHeaderBar({ menuLabel, onMenuPress }) {
|
|
25
|
+
const slots = React.useContext(PanelHeaderContext);
|
|
26
|
+
return (_jsxs("header", { "data-slot": "panel-header-bar", className: "flex shrink-0 flex-col gap-ds-100 border-b border-ds-border bg-ds-surface px-ds-200 py-ds-100 sm:min-h-16 sm:flex-row sm:items-center sm:justify-between sm:gap-ds-150 sm:px-ds-400", children: [_jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-ds-150", children: [_jsx("span", { "data-slot": "panel-header-menu", className: "flex lg:hidden", children: _jsx(Button, { variant: "subtle", iconOnly: true, iconBefore: "menu", "aria-label": menuLabel, onPress: onMenuPress }) }), _jsx("div", { ref: slots?.setTitleNode, "data-slot": "panel-header-title", className: "min-w-0 flex-1" })] }), _jsx("div", { ref: slots?.setActionsNode, "data-slot": "panel-header-actions", className: "flex shrink-0 flex-wrap items-center gap-ds-100 empty:hidden sm:flex-nowrap sm:justify-end" })] }));
|
|
27
|
+
}
|
|
28
|
+
function TitleBlock({ title, description, breadcrumbs }) {
|
|
29
|
+
return (_jsxs("div", { "data-slot": "panel-header-text", className: "flex min-w-0 flex-col gap-ds-025", children: [breadcrumbs && breadcrumbs.length > 0 && _jsx(Breadcrumbs, { items: breadcrumbs }), _jsx(Heading, { level: 1, size: "heading-medium", children: title }), description != null && (_jsx(Text, { size: "body-small", tone: "subtle", elementType: "p", children: description }))] }));
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A panel page's header: the page says what it is and what it can do, and the
|
|
33
|
+
* shell's `PanelHeaderBar` shows it, outside the scrolling content. Outside a `PanelHeaderProvider` (a page
|
|
34
|
+
* rendered on its own, a test), it renders in place, so such a page keeps its title. A provider must always
|
|
35
|
+
* render a bar.
|
|
36
|
+
*/
|
|
37
|
+
export function PanelHeader({ title, description, breadcrumbs, actions }) {
|
|
38
|
+
const slots = React.useContext(PanelHeaderContext);
|
|
39
|
+
const text = _jsx(TitleBlock, { title: title, description: description, breadcrumbs: breadcrumbs });
|
|
40
|
+
if (slots?.titleNode) {
|
|
41
|
+
return (_jsxs(_Fragment, { children: [createPortal(text, slots.titleNode), actions != null && slots.actionsNode && createPortal(actions, slots.actionsNode)] }));
|
|
42
|
+
}
|
|
43
|
+
// Under a provider the header belongs in the bar: on the first commit the bar's regions are not set yet and
|
|
44
|
+
// they arrive in the same layout pass, so nothing paints without it. A provider must always render a
|
|
45
|
+
// PanelHeaderBar; without one the header shows nowhere, as with the old slots.
|
|
46
|
+
if (slots)
|
|
47
|
+
return null;
|
|
48
|
+
return (_jsxs("div", { "data-slot": "panel-header-inline", className: "mb-ds-300 flex flex-col gap-ds-150 sm:flex-row sm:items-center sm:justify-between", children: [text, actions != null && _jsx("div", { "data-slot": "panel-header-inline-actions", className: "flex shrink-0 flex-wrap items-center gap-ds-100", children: actions })] }));
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=panel-header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panel-header.js","sourceRoot":"","sources":["../../src/navigation/panel-header.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAuB,MAAM,eAAe,CAAC;AASjE,MAAM,kBAAkB,GAAG,KAAK,CAAC,aAAa,CAAe,IAAI,CAAC,CAAC;AAEnE;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAAE,QAAQ,EAAiC;IAC7E,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAqB,IAAI,CAAC,CAAC;IAC3E,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAqB,IAAI,CAAC,CAAC;IAC/E,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,cAAc,EAAE,CAAC,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC;IACxH,OAAO,KAAC,kBAAkB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YAAG,QAAQ,GAA+B,CAAC;AAC7F,CAAC;AAQD;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,EAAE,SAAS,EAAE,WAAW,EAAuB;IAC5E,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC;IACnD,OAAO,CACL,+BACY,kBAAkB,EAC5B,SAAS,EAAC,qLAAqL,aAE/L,eAAK,SAAS,EAAC,6CAA6C,aAC1D,4BAAgB,mBAAmB,EAAC,SAAS,EAAC,gBAAgB,YAC5D,KAAC,MAAM,IAAC,OAAO,EAAC,QAAQ,EAAC,QAAQ,QAAC,UAAU,EAAC,MAAM,gBAAa,SAAS,EAAE,OAAO,EAAE,WAAW,GAAI,GAC9F,EACP,cAAK,GAAG,EAAE,KAAK,EAAE,YAAY,eAAY,oBAAoB,EAAC,SAAS,EAAC,gBAAgB,GAAG,IACvF,EAEN,cACE,GAAG,EAAE,KAAK,EAAE,cAAc,eAChB,sBAAsB,EAChC,SAAS,EAAC,4FAA4F,GACtG,IACK,CACV,CAAC;AACJ,CAAC;AAaD,SAAS,UAAU,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAqC;IACxF,OAAO,CACL,4BAAe,mBAAmB,EAAC,SAAS,EAAC,kCAAkC,aAC5E,WAAW,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,IAAI,KAAC,WAAW,IAAC,KAAK,EAAE,WAAW,GAAI,EAC7E,KAAC,OAAO,IAAC,KAAK,EAAE,CAAC,EAAE,IAAI,EAAC,gBAAgB,YAAE,KAAK,GAAW,EACzD,WAAW,IAAI,IAAI,IAAI,CACtB,KAAC,IAAI,IAAC,IAAI,EAAC,YAAY,EAAC,IAAI,EAAC,QAAQ,EAAC,WAAW,EAAC,GAAG,YAAE,WAAW,GAAQ,CAC3E,IACG,CACP,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,EAAoB;IACxF,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC;IACnD,MAAM,IAAI,GAAG,KAAC,UAAU,IAAC,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,GAAI,CAAC;IAC9F,IAAI,KAAK,EAAE,SAAS,EAAE,CAAC;QACrB,OAAO,CACL,8BACG,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,EACnC,OAAO,IAAI,IAAI,IAAI,KAAK,CAAC,WAAW,IAAI,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,WAAW,CAAC,IAChF,CACJ,CAAC;IACJ,CAAC;IACD,4GAA4G;IAC5G,qGAAqG;IACrG,+EAA+E;IAC/E,IAAI,KAAK;QAAE,OAAO,IAAI,CAAC;IACvB,OAAO,CACL,4BAAe,qBAAqB,EAAC,SAAS,EAAC,mFAAmF,aAC/H,IAAI,EACJ,OAAO,IAAI,IAAI,IAAI,2BAAe,6BAA6B,EAAC,SAAS,EAAC,iDAAiD,YAAE,OAAO,GAAO,IACxI,CACP,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { createPortal } from \"react-dom\";\n\nimport { Button } from \"../action/button\";\nimport { Heading, Text } from \"../display/typography\";\nimport { Breadcrumbs, type BreadcrumbItem } from \"./breadcrumbs\";\n\ntype Slots = {\n titleNode: HTMLElement | null;\n actionsNode: HTMLElement | null;\n setTitleNode: (node: HTMLElement | null) => void;\n setActionsNode: (node: HTMLElement | null) => void;\n};\n\nconst PanelHeaderContext = React.createContext<Slots | null>(null);\n\n/**\n * Owns the bar's two regions. It sits above both the bar and the page, because the shell renders them as\n * siblings: the bar outside the scrolling box (so content never runs under it) and the page inside it.\n */\nexport function PanelHeaderProvider({ children }: { children: React.ReactNode }) {\n const [titleNode, setTitleNode] = React.useState<HTMLElement | null>(null);\n const [actionsNode, setActionsNode] = React.useState<HTMLElement | null>(null);\n const value = React.useMemo(() => ({ titleNode, actionsNode, setTitleNode, setActionsNode }), [titleNode, actionsNode]);\n return <PanelHeaderContext.Provider value={value}>{children}</PanelHeaderContext.Provider>;\n}\n\nexport type PanelHeaderBarProps = {\n /** The menu button's name (\"Open menu\"); it opens the Sidebar, which is a panel under 1024px. */\n menuLabel: string;\n onMenuPress: () => void;\n};\n\n/**\n * The panel's top bar (admin apps): the menu button under 1024px, then the page's title and its\n * actions, which the page passes through `PanelHeader`. The shell renders it outside the box that scrolls.\n * Below 640px the actions take their own row, so a search field and a primary button never squeeze the title.\n */\nexport function PanelHeaderBar({ menuLabel, onMenuPress }: PanelHeaderBarProps) {\n const slots = React.useContext(PanelHeaderContext);\n return (\n <header\n data-slot=\"panel-header-bar\"\n className=\"flex shrink-0 flex-col gap-ds-100 border-b border-ds-border bg-ds-surface px-ds-200 py-ds-100 sm:min-h-16 sm:flex-row sm:items-center sm:justify-between sm:gap-ds-150 sm:px-ds-400\"\n >\n <div className=\"flex min-w-0 flex-1 items-center gap-ds-150\">\n <span data-slot=\"panel-header-menu\" className=\"flex lg:hidden\">\n <Button variant=\"subtle\" iconOnly iconBefore=\"menu\" aria-label={menuLabel} onPress={onMenuPress} />\n </span>\n <div ref={slots?.setTitleNode} data-slot=\"panel-header-title\" className=\"min-w-0 flex-1\" />\n </div>\n {/* Hidden while empty, so a page without actions pays no gap for them. */}\n <div\n ref={slots?.setActionsNode}\n data-slot=\"panel-header-actions\"\n className=\"flex shrink-0 flex-wrap items-center gap-ds-100 empty:hidden sm:flex-nowrap sm:justify-end\"\n />\n </header>\n );\n}\n\nexport type PanelHeaderProps = {\n /** The page's name; the page's one h1. */\n title: React.ReactNode;\n /** One line under the title. */\n description?: React.ReactNode;\n /** Where the page sits, above the title (a detail page under its list). */\n breadcrumbs?: readonly BreadcrumbItem[];\n /** The page's actions: filters, a search field, one primary button. */\n actions?: React.ReactNode;\n};\n\nfunction TitleBlock({ title, description, breadcrumbs }: Omit<PanelHeaderProps, \"actions\">) {\n return (\n <div data-slot=\"panel-header-text\" className=\"flex min-w-0 flex-col gap-ds-025\">\n {breadcrumbs && breadcrumbs.length > 0 && <Breadcrumbs items={breadcrumbs} />}\n <Heading level={1} size=\"heading-medium\">{title}</Heading>\n {description != null && (\n <Text size=\"body-small\" tone=\"subtle\" elementType=\"p\">{description}</Text>\n )}\n </div>\n );\n}\n\n/**\n * A panel page's header: the page says what it is and what it can do, and the\n * shell's `PanelHeaderBar` shows it, outside the scrolling content. Outside a `PanelHeaderProvider` (a page\n * rendered on its own, a test), it renders in place, so such a page keeps its title. A provider must always\n * render a bar.\n */\nexport function PanelHeader({ title, description, breadcrumbs, actions }: PanelHeaderProps) {\n const slots = React.useContext(PanelHeaderContext);\n const text = <TitleBlock title={title} description={description} breadcrumbs={breadcrumbs} />;\n if (slots?.titleNode) {\n return (\n <>\n {createPortal(text, slots.titleNode)}\n {actions != null && slots.actionsNode && createPortal(actions, slots.actionsNode)}\n </>\n );\n }\n // Under a provider the header belongs in the bar: on the first commit the bar's regions are not set yet and\n // they arrive in the same layout pass, so nothing paints without it. A provider must always render a\n // PanelHeaderBar; without one the header shows nowhere, as with the old slots.\n if (slots) return null;\n return (\n <div data-slot=\"panel-header-inline\" className=\"mb-ds-300 flex flex-col gap-ds-150 sm:flex-row sm:items-center sm:justify-between\">\n {text}\n {actions != null && <div data-slot=\"panel-header-inline-actions\" className=\"flex shrink-0 flex-wrap items-center gap-ds-100\">{actions}</div>}\n </div>\n );\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/** The attribute the head script and the sidebar keep on <html> when the choice is remembered. */
|
|
3
|
+
export declare const ROOT_ATTRIBUTE = "data-ds-sidebar";
|
|
4
|
+
/**
|
|
5
|
+
* The inline script for <head> that sets the remembered collapsed state on <html> before the first paint,
|
|
6
|
+
* so a sidebar persisted with `storageKey` never jumps on load. Pass the page's CSP nonce. Server-safe: it
|
|
7
|
+
* lives outside the client Sidebar module, so a Server Component layout can render it.
|
|
8
|
+
*/
|
|
9
|
+
export declare function sidebarScript(storageKey: string, { defaultCollapsed, nonce }?: {
|
|
10
|
+
defaultCollapsed?: boolean;
|
|
11
|
+
nonce?: string;
|
|
12
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// No client directive: the head script is rendered by Server Components (a Next App Router layout), like
|
|
3
|
+
// themeScript. The Sidebar (a client component) imports the attribute from here.
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
/** The attribute the head script and the sidebar keep on <html> when the choice is remembered. */
|
|
6
|
+
export const ROOT_ATTRIBUTE = "data-ds-sidebar";
|
|
7
|
+
/**
|
|
8
|
+
* The inline script for <head> that sets the remembered collapsed state on <html> before the first paint,
|
|
9
|
+
* so a sidebar persisted with `storageKey` never jumps on load. Pass the page's CSP nonce. Server-safe: it
|
|
10
|
+
* lives outside the client Sidebar module, so a Server Component layout can render it.
|
|
11
|
+
*/
|
|
12
|
+
export function sidebarScript(storageKey, { defaultCollapsed = false, nonce } = {}) {
|
|
13
|
+
const key = JSON.stringify(storageKey).replace(/</g, "\\u003c");
|
|
14
|
+
const fallback = defaultCollapsed ? "collapsed" : "expanded";
|
|
15
|
+
const source = "(function(){var v;try{v=window.localStorage.getItem(" + key + ")}catch(e){}" +
|
|
16
|
+
'if(v!=="collapsed"&&v!=="expanded"){v="' + fallback + '"}' +
|
|
17
|
+
'try{document.documentElement.setAttribute("' + ROOT_ATTRIBUTE + '",v)}catch(e){}})();';
|
|
18
|
+
return _jsx("script", { nonce: nonce, "data-slot": "sidebar-script", dangerouslySetInnerHTML: { __html: source } });
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=sidebar-script.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar-script.js","sourceRoot":"","sources":["../../src/navigation/sidebar-script.tsx"],"names":[],"mappings":";AAAA,yGAAyG;AACzG,iFAAiF;AACjF,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,kGAAkG;AAClG,MAAM,CAAC,MAAM,cAAc,GAAG,iBAAiB,CAAC;AAEhD;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,UAAkB,EAAE,EAAE,gBAAgB,GAAG,KAAK,EAAE,KAAK,KAAqD,EAAE;IACxI,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAChE,MAAM,QAAQ,GAAG,gBAAgB,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC;IAC7D,MAAM,MAAM,GACV,sDAAsD,GAAG,GAAG,GAAG,cAAc;QAC7E,yCAAyC,GAAG,QAAQ,GAAG,IAAI;QAC3D,6CAA6C,GAAG,cAAc,GAAG,sBAAsB,CAAC;IAC1F,OAAO,iBAAQ,KAAK,EAAE,KAAK,eAAY,gBAAgB,EAAC,uBAAuB,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,GAAI,CAAC;AAC1G,CAAC","sourcesContent":["// No client directive: the head script is rendered by Server Components (a Next App Router layout), like\n// themeScript. The Sidebar (a client component) imports the attribute from here.\nimport * as React from \"react\";\n\n/** The attribute the head script and the sidebar keep on <html> when the choice is remembered. */\nexport const ROOT_ATTRIBUTE = \"data-ds-sidebar\";\n\n/**\n * The inline script for <head> that sets the remembered collapsed state on <html> before the first paint,\n * so a sidebar persisted with `storageKey` never jumps on load. Pass the page's CSP nonce. Server-safe: it\n * lives outside the client Sidebar module, so a Server Component layout can render it.\n */\nexport function sidebarScript(storageKey: string, { defaultCollapsed = false, nonce }: { defaultCollapsed?: boolean; nonce?: string } = {}) {\n const key = JSON.stringify(storageKey).replace(/</g, \"\\\\u003c\");\n const fallback = defaultCollapsed ? \"collapsed\" : \"expanded\";\n const source =\n \"(function(){var v;try{v=window.localStorage.getItem(\" + key + \")}catch(e){}\" +\n 'if(v!==\"collapsed\"&&v!==\"expanded\"){v=\"' + fallback + '\"}' +\n 'try{document.documentElement.setAttribute(\"' + ROOT_ATTRIBUTE + '\",v)}catch(e){}})();';\n return <script nonce={nonce} data-slot=\"sidebar-script\" dangerouslySetInnerHTML={{ __html: source }} />;\n}\n"]}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type WithMotion } from "../defaults.js";
|
|
3
|
+
import { type BadgeCountTone } from "../display/badge.js";
|
|
4
|
+
import { type IconName } from "../display/icon.js";
|
|
5
|
+
export type SidebarItemData = {
|
|
6
|
+
id: string;
|
|
7
|
+
/** A noun for the section ("Orders"). */
|
|
8
|
+
label: string;
|
|
9
|
+
/** Lucide name; top-level items carry one (it is all a collapsed sidebar shows). */
|
|
10
|
+
icon?: IconName;
|
|
11
|
+
/** The page; an item with `children` is a group and has none. */
|
|
12
|
+
href?: string;
|
|
13
|
+
/** A count ("4 new"): a Badge after the label, on the icon when collapsed. */
|
|
14
|
+
badge?: {
|
|
15
|
+
value: number;
|
|
16
|
+
tone?: BadgeCountTone;
|
|
17
|
+
};
|
|
18
|
+
/** Nested items, shown indented on a rail under the group. */
|
|
19
|
+
children?: readonly SidebarItemData[];
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* A labelled block of items: an overline ("Filo") over its own list, not collapsible. The group is
|
|
23
|
+
* named by its label (role="group" + aria-labelledby), also when the sidebar is collapsed: the label is then
|
|
24
|
+
* visually hidden and a thin separator marks where the section starts.
|
|
25
|
+
*/
|
|
26
|
+
export type SidebarSectionData = {
|
|
27
|
+
/** Stable key for the section; also on the DOM as `data-section`. Unique among the sections. */
|
|
28
|
+
id: string;
|
|
29
|
+
/** The heading over the items, already translated by the app; it is the group's accessible name. */
|
|
30
|
+
label: string;
|
|
31
|
+
/**
|
|
32
|
+
* The section's items: links or groups with `children`, exactly as in `items`. Icons are Lucide names. Item
|
|
33
|
+
* ids are unique across `items` and every section: `currentKey` marks each item with that id, so a
|
|
34
|
+
* repeated id gives two `aria-current="page"` items (a development warning names it).
|
|
35
|
+
*/
|
|
36
|
+
items: readonly SidebarItemData[];
|
|
37
|
+
};
|
|
38
|
+
export type SidebarProps = {
|
|
39
|
+
/** The product name, after `logo` (or the logo and name together). It links to `brandHref`. Or a `SidebarHeader` child. */
|
|
40
|
+
brand?: React.ReactNode;
|
|
41
|
+
/**
|
|
42
|
+
* The app's mark (an Icon or an image) before `brand`. Collapsed, the rail shows it alone, centred; the
|
|
43
|
+
* name stays the link's accessible name. Without it, collapsed shows the start of `brand`.
|
|
44
|
+
*/
|
|
45
|
+
logo?: React.ReactNode;
|
|
46
|
+
brandHref?: string;
|
|
47
|
+
/**
|
|
48
|
+
* The top-level items (links, or groups with `children`); five to eight is the comfortable range. With
|
|
49
|
+
* `sections`, these are the unlabelled items above the labelled sections (a dashboard) and may be empty. Ids
|
|
50
|
+
* are unique across `items` and `sections` (a repeated id marks two items as the current page).
|
|
51
|
+
* Leave it out to compose the navigation as children instead.
|
|
52
|
+
*/
|
|
53
|
+
items?: readonly SidebarItemData[];
|
|
54
|
+
/**
|
|
55
|
+
* With no `items`: the navigation composed from `SidebarItem`, `SidebarSubmenu` and `SidebarSection`
|
|
56
|
+
* (loose items first, then the sections), plus an optional `SidebarHeader` (instead of `brand`) and
|
|
57
|
+
* `SidebarFooter` (instead of `footer`).
|
|
58
|
+
*/
|
|
59
|
+
children?: React.ReactNode;
|
|
60
|
+
/**
|
|
61
|
+
* Labelled sections under `items`, in order. Each is a named group with an overline; collapsed,
|
|
62
|
+
* the overline is visually hidden (the group keeps its name) and a separator stands in for it. Not
|
|
63
|
+
* collapsible. Left out (or empty), the Sidebar renders exactly as before.
|
|
64
|
+
*/
|
|
65
|
+
sections?: readonly SidebarSectionData[];
|
|
66
|
+
/** The id of the page's item: marked `aria-current="page"`; its group stays open. */
|
|
67
|
+
currentKey?: string;
|
|
68
|
+
/** The account at the bottom: name and role after `avatar` (or Avatar, name and role together). Or a `SidebarFooter` child. */
|
|
69
|
+
footer?: React.ReactNode;
|
|
70
|
+
/**
|
|
71
|
+
* The account's Avatar before `footer`. Collapsed, the rail shows it alone, centred, and `footer` is hidden.
|
|
72
|
+
* Without it, collapsed shows the start of `footer`.
|
|
73
|
+
*/
|
|
74
|
+
avatar?: React.ReactNode;
|
|
75
|
+
/**
|
|
76
|
+
* Keeps the account (`footer`) and the collapse toggle in view at the bottom: the brand stays at
|
|
77
|
+
* the top and only the navigation (`items`, then `sections`) scrolls between them, expanded and
|
|
78
|
+
* collapsed. In the phone panel the account stays at the bottom the same way. The DOM order, and so the Tab
|
|
79
|
+
* order, is the same as without it. Off by default: the whole sidebar scrolls as one, as before.
|
|
80
|
+
*/
|
|
81
|
+
isFooterPinned?: boolean;
|
|
82
|
+
/** Icons only (56px), labels in tooltips. Controlled; or `defaultCollapsed` + `onCollapsedChange`. */
|
|
83
|
+
isCollapsed?: boolean;
|
|
84
|
+
defaultCollapsed?: boolean;
|
|
85
|
+
onCollapsedChange?: (isCollapsed: boolean) => void;
|
|
86
|
+
/**
|
|
87
|
+
* Remembers the collapsed choice in localStorage under this key. Render `sidebarScript(storageKey,
|
|
88
|
+
* { defaultCollapsed })` in <head> as well, with the same `defaultCollapsed`, so the first frame already
|
|
89
|
+
* has the remembered width (no layout jump). Uncontrolled only: with `isCollapsed` the app owns the state.
|
|
90
|
+
*/
|
|
91
|
+
storageKey?: string;
|
|
92
|
+
/** Under 1024px the sidebar is a menu panel from the start edge; the app's menu button opens it. */
|
|
93
|
+
isMobileOpen?: boolean;
|
|
94
|
+
onMobileOpenChange?: (isOpen: boolean) => void;
|
|
95
|
+
/** Names the navigation landmark; "Main menu" by default. */
|
|
96
|
+
"aria-label"?: string;
|
|
97
|
+
};
|
|
98
|
+
export type SidebarHeaderProps = {
|
|
99
|
+
/** The product name (or the logo and name together); it links to the Sidebar's `brandHref`. */
|
|
100
|
+
children?: React.ReactNode;
|
|
101
|
+
/** The app's mark before the name; collapsed, the rail shows it alone. As the Sidebar's `logo`. */
|
|
102
|
+
logo?: React.ReactNode;
|
|
103
|
+
};
|
|
104
|
+
/** The brand at the top, as a child instead of the `brand` prop. */
|
|
105
|
+
export declare function SidebarHeader({ children }: SidebarHeaderProps): React.JSX.Element;
|
|
106
|
+
export type SidebarFooterProps = {
|
|
107
|
+
/** The account's name and role (or Avatar, name and role together). */
|
|
108
|
+
children?: React.ReactNode;
|
|
109
|
+
/** The account's Avatar before the rest; collapsed, the rail shows it alone. As the Sidebar's `avatar`. */
|
|
110
|
+
avatar?: React.ReactNode;
|
|
111
|
+
};
|
|
112
|
+
/** The account at the bottom, as a child instead of the `footer` prop; it shares a row with the collapse toggle. */
|
|
113
|
+
export declare function SidebarFooter({ children }: SidebarFooterProps): React.JSX.Element;
|
|
114
|
+
export type SidebarItemProps = {
|
|
115
|
+
/** Unique in the sidebar; `currentKey` matches it. */
|
|
116
|
+
id: string;
|
|
117
|
+
/** A noun for the page ("Orders"); also the tooltip when the sidebar is collapsed. */
|
|
118
|
+
label: string;
|
|
119
|
+
/** Lucide name; top-level items carry one (it is all a collapsed sidebar shows). */
|
|
120
|
+
icon?: IconName;
|
|
121
|
+
href?: string;
|
|
122
|
+
/** A count ("4 new"): a Badge after the label, on the icon when collapsed. */
|
|
123
|
+
badge?: {
|
|
124
|
+
value: number;
|
|
125
|
+
tone?: BadgeCountTone;
|
|
126
|
+
};
|
|
127
|
+
/** Marks this item as the page in view, instead of the Sidebar's `currentKey`. */
|
|
128
|
+
isCurrent?: boolean;
|
|
129
|
+
};
|
|
130
|
+
/** One link in the navigation: at the top, in a `SidebarSection`, or nested in a `SidebarSubmenu`. */
|
|
131
|
+
export declare function SidebarItem(props: SidebarItemProps): React.JSX.Element;
|
|
132
|
+
export type SidebarSubmenuProps = Omit<SidebarItemProps, "href" | "isCurrent"> & {
|
|
133
|
+
/** The nested `SidebarItem`s, shown indented when it is open. */
|
|
134
|
+
children: React.ReactNode;
|
|
135
|
+
};
|
|
136
|
+
/** An item that opens to nested items. It starts open, and stays open, while it holds the page in view. */
|
|
137
|
+
export declare function SidebarSubmenu({ children, ...item }: SidebarSubmenuProps): React.JSX.Element;
|
|
138
|
+
export type SidebarSectionProps = {
|
|
139
|
+
/** Also on the DOM as `data-section`. */
|
|
140
|
+
id?: string;
|
|
141
|
+
/** The overline over the items, already translated; it names the group, also when collapsed. */
|
|
142
|
+
label: string;
|
|
143
|
+
/** `SidebarItem`s and `SidebarSubmenu`s. */
|
|
144
|
+
children: React.ReactNode;
|
|
145
|
+
};
|
|
146
|
+
/** A labelled block of items with an overline; collapsed, a thin separator stands in for the overline. */
|
|
147
|
+
export declare function SidebarSection({ id, label, children }: SidebarSectionProps): React.JSX.Element;
|
|
148
|
+
/** Sidebar with its own `motion` (auto, reduce or none); see SidebarBody for the component itself. */
|
|
149
|
+
export declare function Sidebar({ motion, ...props }: SidebarProps & WithMotion): React.JSX.Element;
|