@senvenli/react 0.0.0-stage → 0.1.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,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Set by the Navbar's brand link. A logo component inside one is that link's content: it should
|
|
4
|
+
* render no link of its own and name the link through its image's `alt` ("Acme home") rather than being
|
|
5
|
+
* decorative under an aria-label; screen readers announce the same name either way. An app's own logo reads it
|
|
6
|
+
* with `React.useContext(BrandLinkContext)`.
|
|
7
|
+
*/
|
|
8
|
+
export declare const BrandLinkContext: React.Context<boolean>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Set by the Navbar's brand link. A logo component inside one is that link's content: it should
|
|
4
|
+
* render no link of its own and name the link through its image's `alt` ("Acme home") rather than being
|
|
5
|
+
* decorative under an aria-label; screen readers announce the same name either way. An app's own logo reads it
|
|
6
|
+
* with `React.useContext(BrandLinkContext)`.
|
|
7
|
+
*/
|
|
8
|
+
export const BrandLinkContext = React.createContext(false);
|
|
9
|
+
//# sourceMappingURL=brand-link-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brand-link-context.js","sourceRoot":"","sources":["../../src/navigation/brand-link-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\n\n/**\n * Set by the Navbar's brand link. A logo component inside one is that link's content: it should\n * render no link of its own and name the link through its image's `alt` (\"Acme home\") rather than being\n * decorative under an aria-label; screen readers announce the same name either way. An app's own logo reads it\n * with `React.useContext(BrandLinkContext)`.\n */\nexport const BrandLinkContext = React.createContext(false);\n"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type IconName } from "../display/icon.js";
|
|
3
|
+
export type BreadcrumbItem = {
|
|
4
|
+
label: string;
|
|
5
|
+
/** Every level but the last; the last item is the current page and is not a link. */
|
|
6
|
+
href?: string;
|
|
7
|
+
/** A Lucide icon before the label (a folder, a home). */
|
|
8
|
+
icon?: IconName;
|
|
9
|
+
};
|
|
10
|
+
export type BreadcrumbsProps = {
|
|
11
|
+
/**
|
|
12
|
+
* From the section root ("Projects"), never "Home", to the current page. Leave it out to compose `Breadcrumb`s
|
|
13
|
+
* as children instead.
|
|
14
|
+
*/
|
|
15
|
+
items?: readonly BreadcrumbItem[];
|
|
16
|
+
/** With no `items`: `Breadcrumb`s from the root to the current page (the last one). */
|
|
17
|
+
children?: React.ReactNode;
|
|
18
|
+
/** Names the navigation landmark; "Location" by default. */
|
|
19
|
+
"aria-label"?: string;
|
|
20
|
+
};
|
|
21
|
+
export type BreadcrumbProps = {
|
|
22
|
+
/** A page; leave it out on the last one, the current page. */
|
|
23
|
+
href?: string;
|
|
24
|
+
icon?: IconName;
|
|
25
|
+
/** The level's name. It may hold more than text; then give `textValue` for the folded "…" menu. */
|
|
26
|
+
children: React.ReactNode;
|
|
27
|
+
/** The words for the "…" menu when this level folds; the label itself when it is plain text. */
|
|
28
|
+
textValue?: string;
|
|
29
|
+
};
|
|
30
|
+
/** One level of a Breadcrumbs composed from parts; the last one is the current page. */
|
|
31
|
+
export declare function Breadcrumb({ children }: BreadcrumbProps): React.JSX.Element;
|
|
32
|
+
/**
|
|
33
|
+
* The path from a section root to the current page, for detail pages two or more levels deep. With more
|
|
34
|
+
* than four levels the middle ones fold into a "…" menu: the root, the parent and the page stay.
|
|
35
|
+
*/
|
|
36
|
+
export declare function Breadcrumbs({ items: itemsProp, children, "aria-label": label }: BreadcrumbsProps): React.JSX.Element;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Breadcrumb as AriaBreadcrumb, Breadcrumbs as AriaBreadcrumbs, Link as AriaLink, useLocale } from "react-aria-components";
|
|
5
|
+
import { Button } from "../action/button.js";
|
|
6
|
+
import { IconGlyph } from "../display/icon.js";
|
|
7
|
+
import { locationLabel, showHiddenLevelsLabel } from "../i18n.js";
|
|
8
|
+
import { Menu } from "../overlay/floating.js";
|
|
9
|
+
/** One level of a Breadcrumbs composed from parts; the last one is the current page. */
|
|
10
|
+
export function Breadcrumb({ children }) {
|
|
11
|
+
return _jsx(_Fragment, { children: children });
|
|
12
|
+
}
|
|
13
|
+
function levelsOf(items, children) {
|
|
14
|
+
if (items)
|
|
15
|
+
return items.map((item) => ({ label: item.label, text: item.label, href: item.href, icon: item.icon }));
|
|
16
|
+
return React.Children.toArray(children)
|
|
17
|
+
.filter((child) => React.isValidElement(child) && child.type === Breadcrumb)
|
|
18
|
+
.map(({ props }) => ({
|
|
19
|
+
label: props.children,
|
|
20
|
+
text: props.textValue ?? (typeof props.children === "string" ? props.children : ""),
|
|
21
|
+
href: props.href,
|
|
22
|
+
icon: props.icon,
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
function Label({ level }) {
|
|
26
|
+
if (!level.icon)
|
|
27
|
+
return _jsx(_Fragment, { children: level.label });
|
|
28
|
+
return (_jsxs("span", { className: "inline-flex items-center gap-ds-050", children: [_jsx(IconGlyph, { name: level.icon, size: "small", "data-slot": "breadcrumb-icon", className: "text-ds-icon-subtle" }), level.label] }));
|
|
29
|
+
}
|
|
30
|
+
const LINK = "rounded-ds-small text-body text-ds-text-subtle no-underline outline-hidden data-[hovered]:text-ds-text data-[hovered]:underline " +
|
|
31
|
+
"data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused";
|
|
32
|
+
function Separator() {
|
|
33
|
+
return _jsx(IconGlyph, { name: "chevron-right", "data-slot": "breadcrumbs-separator", className: "size-3.5 text-ds-icon-subtle" });
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The path from a section root to the current page, for detail pages two or more levels deep. With more
|
|
37
|
+
* than four levels the middle ones fold into a "…" menu: the root, the parent and the page stay.
|
|
38
|
+
*/
|
|
39
|
+
export function Breadcrumbs({ items: itemsProp, children, "aria-label": label }) {
|
|
40
|
+
const { locale } = useLocale();
|
|
41
|
+
const items = levelsOf(itemsProp, children);
|
|
42
|
+
const folds = items.length > 4;
|
|
43
|
+
// A folded level without a page to go to would be an inert menu item: leave it out.
|
|
44
|
+
const hidden = folds ? items.slice(1, -2).filter((level) => level.href) : [];
|
|
45
|
+
const shown = folds ? [items[0], null, ...items.slice(-2)] : [...items];
|
|
46
|
+
return (_jsx("nav", { "aria-label": label ?? locationLabel(locale), "data-slot": "breadcrumbs", children: _jsx(AriaBreadcrumbs, { className: "flex flex-wrap items-center gap-ds-050", children: shown.map((item, index) => {
|
|
47
|
+
const last = index === shown.length - 1;
|
|
48
|
+
return (_jsxs(AriaBreadcrumb, { "data-slot": "breadcrumb", className: "flex items-center gap-ds-050", children: [item === null && hidden.length === 0 ? (_jsx("span", { "aria-hidden": true, "data-slot": "breadcrumbs-fold", className: "text-body text-ds-text-subtle", children: "\u2026" })) : item === null ? (_jsx(Menu, { "aria-label": showHiddenLevelsLabel(locale), placement: "bottom start", items: hidden.map((level, i) => ({ id: `level-${i}`, label: level.text, href: level.href })), trigger: _jsx(Button, { variant: "subtle", size: "small", iconOnly: true, iconBefore: "ellipsis", "aria-label": showHiddenLevelsLabel(locale), "data-slot": "breadcrumbs-fold" }) })) : last ? (_jsx("span", { "aria-current": "page", "data-slot": "breadcrumb-current", className: "text-body font-[500] text-ds-text", children: _jsx(Label, { level: item }) })) : (_jsx(AriaLink, { href: item.href, "data-slot": "breadcrumb-link", className: LINK, children: _jsx(Label, { level: item }) })), !last && _jsx(Separator, {})] }, item ? `${index}-${item.text}` : "fold"));
|
|
49
|
+
}) }) }));
|
|
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AAQ,QAAC,UAAU,EAAC,UAAU,gBAAa,qBAAqB,CAAC,MAAM,CAAC,eAAY,kBAAkB,GAAG,GAEjJ,CACH,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CACT,+BAAmB,MAAM,eAAW,oBAAoB,EAAC,SAAS,EAAC,mCAAmC,YACpG,KAAC,KAAK,IAAC,KAAK,EAAE,IAAI,GAAI,GACjB,CACR,CAAC,CAAC,CAAC,CACF,KAAC,QAAQ,IAAC,IAAI,EAAE,IAAI,CAAC,IAAI,eAAY,iBAAiB,EAAC,SAAS,EAAE,IAAI,YACpE,KAAC,KAAK,IAAC,KAAK,EAAE,IAAI,GAAI,GACb,CACZ,EACA,CAAC,IAAI,IAAI,KAAC,SAAS,KAAG,KArBJ,IAAI,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,MAAM,CAsB3C,CAClB,CAAC;YACJ,CAAC,CAAC,GACc,GACd,CACP,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Breadcrumb as AriaBreadcrumb, Breadcrumbs as AriaBreadcrumbs, Link as AriaLink, useLocale } from \"react-aria-components\";\n\nimport { Button } from \"../action/button\";\nimport { IconGlyph, type IconName } from \"../display/icon\";\nimport { locationLabel, showHiddenLevelsLabel } from \"../i18n\";\nimport { Menu } from \"../overlay/floating\";\n\nexport type BreadcrumbItem = {\n label: string;\n /** Every level but the last; the last item is the current page and is not a link. */\n href?: string;\n /** A Lucide icon before the label (a folder, a home). */\n icon?: IconName;\n};\n\nexport type BreadcrumbsProps = {\n /**\n * From the section root (\"Projects\"), never \"Home\", to the current page. Leave it out to compose `Breadcrumb`s\n * as children instead.\n */\n items?: readonly BreadcrumbItem[];\n /** With no `items`: `Breadcrumb`s from the root to the current page (the last one). */\n children?: React.ReactNode;\n /** Names the navigation landmark; \"Location\" by default. */\n \"aria-label\"?: string;\n};\n\nexport type BreadcrumbProps = {\n /** A page; leave it out on the last one, the current page. */\n href?: string;\n icon?: IconName;\n /** The level's name. It may hold more than text; then give `textValue` for the folded \"…\" menu. */\n children: React.ReactNode;\n /** The words for the \"…\" menu when this level folds; the label itself when it is plain text. */\n textValue?: string;\n};\n\n/** One level of a Breadcrumbs composed from parts; the last one is the current page. */\nexport function Breadcrumb({ children }: BreadcrumbProps) {\n return <>{children}</>;\n}\n\ntype Level = { label: React.ReactNode; text: string; href?: string; icon?: IconName };\n\nfunction levelsOf(items: readonly BreadcrumbItem[] | undefined, children: React.ReactNode): Level[] {\n if (items) return items.map((item) => ({ label: item.label, text: item.label, href: item.href, icon: item.icon }));\n return React.Children.toArray(children)\n .filter((child): child is React.ReactElement<BreadcrumbProps> => React.isValidElement(child) && child.type === Breadcrumb)\n .map(({ props }) => ({\n label: props.children,\n text: props.textValue ?? (typeof props.children === \"string\" ? props.children : \"\"),\n href: props.href,\n icon: props.icon,\n }));\n}\n\nfunction Label({ level }: { level: Level }) {\n if (!level.icon) return <>{level.label}</>;\n return (\n <span className=\"inline-flex items-center gap-ds-050\">\n <IconGlyph name={level.icon} size=\"small\" data-slot=\"breadcrumb-icon\" className=\"text-ds-icon-subtle\" />\n {level.label}\n </span>\n );\n}\n\nconst LINK =\n \"rounded-ds-small text-body text-ds-text-subtle no-underline outline-hidden data-[hovered]:text-ds-text data-[hovered]:underline \" +\n \"data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused\";\n\nfunction Separator() {\n return <IconGlyph name=\"chevron-right\" data-slot=\"breadcrumbs-separator\" className=\"size-3.5 text-ds-icon-subtle\" />;\n}\n\n/**\n * The path from a section root to the current page, for detail pages two or more levels deep. With more\n * than four levels the middle ones fold into a \"…\" menu: the root, the parent and the page stay.\n */\nexport function Breadcrumbs({ items: itemsProp, children, \"aria-label\": label }: BreadcrumbsProps) {\n const { locale } = useLocale();\n const items = levelsOf(itemsProp, children);\n const folds = items.length > 4;\n // A folded level without a page to go to would be an inert menu item: leave it out.\n const hidden = folds ? items.slice(1, -2).filter((level) => level.href) : [];\n const shown = folds ? [items[0]!, null, ...items.slice(-2)] : [...items];\n return (\n <nav aria-label={label ?? locationLabel(locale)} data-slot=\"breadcrumbs\">\n <AriaBreadcrumbs className=\"flex flex-wrap items-center gap-ds-050\">\n {shown.map((item, index) => {\n const last = index === shown.length - 1;\n return (\n <AriaBreadcrumb key={item ? `${index}-${item.text}` : \"fold\"} data-slot=\"breadcrumb\" className=\"flex items-center gap-ds-050\">\n {item === null && hidden.length === 0 ? (\n <span aria-hidden data-slot=\"breadcrumbs-fold\" className=\"text-body text-ds-text-subtle\">…</span>\n ) : item === null ? (\n <Menu\n aria-label={showHiddenLevelsLabel(locale)}\n placement=\"bottom start\"\n items={hidden.map((level, i) => ({ id: `level-${i}`, label: level.text, href: level.href }))}\n trigger={\n <Button variant=\"subtle\" size=\"small\" iconOnly iconBefore=\"ellipsis\" aria-label={showHiddenLevelsLabel(locale)} data-slot=\"breadcrumbs-fold\" />\n }\n />\n ) : last ? (\n <span aria-current=\"page\" data-slot=\"breadcrumb-current\" className=\"text-body font-[500] text-ds-text\">\n <Label level={item} />\n </span>\n ) : (\n <AriaLink href={item.href} data-slot=\"breadcrumb-link\" className={LINK}>\n <Label level={item} />\n </AriaLink>\n )}\n {!last && <Separator />}\n </AriaBreadcrumb>\n );\n })}\n </AriaBreadcrumbs>\n </nav>\n );\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type BadgeTone } from "../display/badge.js";
|
|
3
|
+
import { type IconName } from "../display/icon.js";
|
|
4
|
+
export type DockItem = {
|
|
5
|
+
key: string;
|
|
6
|
+
/** Always shown under the icon ("Orders"); the last item is "More" when the app has more. */
|
|
7
|
+
label: string;
|
|
8
|
+
icon: IconName;
|
|
9
|
+
href: string;
|
|
10
|
+
badge?: {
|
|
11
|
+
value: number;
|
|
12
|
+
tone?: BadgeTone;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export type DockProps = {
|
|
16
|
+
/** Four or five top destinations. */
|
|
17
|
+
items: readonly DockItem[];
|
|
18
|
+
currentKey?: string;
|
|
19
|
+
/** Names the navigation landmark; "Main menu" by default. */
|
|
20
|
+
"aria-label"?: string;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* The bottom tab bar on phones: four or five destinations, icon over label, padded for the home
|
|
24
|
+
* indicator. Hidden from 768px up and while the on-screen keyboard is open; leave it out of
|
|
25
|
+
* full-screen flows (checkout).
|
|
26
|
+
*/
|
|
27
|
+
export declare function Dock({ items, currentKey, "aria-label": label }: DockProps): React.JSX.Element;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Link as AriaLink, useLocale } from "react-aria-components";
|
|
5
|
+
import { cn } from "../utils.js";
|
|
6
|
+
import { Badge } from "../display/badge.js";
|
|
7
|
+
import { IconGlyph } from "../display/icon.js";
|
|
8
|
+
import { mainNavigationLabel } from "../i18n.js";
|
|
9
|
+
import { LAYER } from "../layers.js";
|
|
10
|
+
/** True while the on-screen keyboard covers part of the layout viewport (a field has focus). */
|
|
11
|
+
function useKeyboardOpen() {
|
|
12
|
+
const [open, setOpen] = React.useState(false);
|
|
13
|
+
React.useEffect(() => {
|
|
14
|
+
const viewport = window.visualViewport;
|
|
15
|
+
if (!viewport)
|
|
16
|
+
return;
|
|
17
|
+
const update = () => {
|
|
18
|
+
const editing = document.activeElement instanceof HTMLElement && document.activeElement.matches("input, textarea, select, [contenteditable]:not([contenteditable='false'])");
|
|
19
|
+
// The keyboard takes a quarter of the height or more; a URL bar collapsing takes far less.
|
|
20
|
+
setOpen(editing && viewport.height < window.innerHeight * 0.75);
|
|
21
|
+
};
|
|
22
|
+
viewport.addEventListener("resize", update);
|
|
23
|
+
window.addEventListener("focusin", update);
|
|
24
|
+
window.addEventListener("focusout", update);
|
|
25
|
+
return () => {
|
|
26
|
+
viewport.removeEventListener("resize", update);
|
|
27
|
+
window.removeEventListener("focusin", update);
|
|
28
|
+
window.removeEventListener("focusout", update);
|
|
29
|
+
};
|
|
30
|
+
}, []);
|
|
31
|
+
return open;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The bottom tab bar on phones: four or five destinations, icon over label, padded for the home
|
|
35
|
+
* indicator. Hidden from 768px up and while the on-screen keyboard is open; leave it out of
|
|
36
|
+
* full-screen flows (checkout).
|
|
37
|
+
*/
|
|
38
|
+
export function Dock({ items, currentKey, "aria-label": label }) {
|
|
39
|
+
const { locale } = useLocale();
|
|
40
|
+
const keyboard = useKeyboardOpen();
|
|
41
|
+
return (_jsx("nav", { "aria-label": label ?? mainNavigationLabel(locale), "data-slot": "dock", hidden: keyboard || undefined, className: cn("fixed inset-x-0 bottom-0 border-t border-ds-border bg-ds-surface-overlay shadow-ds-overflow md:hidden",
|
|
42
|
+
// Safe-area insets are physical edges, so they pair with physical padding.
|
|
43
|
+
"[padding-left:max(var(--ds-space-100),env(safe-area-inset-left,0px))] [padding-right:max(var(--ds-space-100),env(safe-area-inset-right,0px))] pt-ds-075 pb-[max(var(--ds-space-150),env(safe-area-inset-bottom,0px))]", LAYER.stickyBar), children: _jsx("ul", { className: "mx-auto grid max-w-[24.375rem] auto-cols-fr grid-flow-col", children: items.map((item) => (_jsx("li", { className: "flex", children: _jsxs(AriaLink, { href: item.href, "data-slot": "dock-item", "aria-current": item.key === currentKey ? "page" : undefined, className: cn("group/dock flex min-h-11 flex-1 flex-col items-center justify-center gap-0.5 rounded-ds-medium py-ds-050 text-[11px] leading-[14px] font-[500] text-ds-text-subtle outline-hidden", "data-[pressed]:bg-ds-background-neutral-pressed data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused aria-[current=page]:text-ds-text"), children: [_jsxs("span", { className: "relative", children: [_jsx(IconGlyph, { name: item.icon, "data-slot": "dock-item-icon", className: "size-[22px] group-aria-[current=page]/dock:text-ds-icon-brand" }), item.badge && item.badge.value > 0 && (
|
|
44
|
+
// Drawn on the icon; read after the label ("Mesajlar, 2").
|
|
45
|
+
_jsx("span", { "data-slot": "dock-item-badge", "aria-hidden": true, className: "absolute -top-1 -end-2.5", children: _jsx(Badge, { value: item.badge.value, tone: item.badge.tone, isOnIcon: true }) }))] }), _jsx("span", { "data-slot": "dock-item-label", className: "max-w-full truncate px-ds-025", children: item.label }), item.badge && item.badge.value > 0 && _jsx("span", { className: "sr-only", children: `, ${item.badge.value}` })] }) }, item.key))) }) }));
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=dock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dock.js","sourceRoot":"","sources":["../../src/navigation/dock.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEpE,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAkB,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAiB,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAmBlC,gGAAgG;AAChG,SAAS,eAAe;IACtB,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9C,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,QAAQ,GAAG,MAAM,CAAC,cAAc,CAAC;QACvC,IAAI,CAAC,QAAQ;YAAE,OAAO;QACtB,MAAM,MAAM,GAAG,GAAG,EAAE;YAClB,MAAM,OA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nB,aAAmB,SAAS,EAAC,MAAM,YACjC,MAAC,QAAQ,IACP,IAAI,EAAE,IAAI,CAAC,IAAI,eACL,WAAW,kBACP,IAAI,CAAC,GAAG,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAC1D,SAAS,EAAE,EAAE,CACX,mLAAmL,EACnL,sKAAsK,CACvK,aAED,gBAAM,SAAS,EAAC,UAAU,aACxB,KAAC,SAAS,IAAC,IAAI,EAAE,IAAI,CAAC,IAAI,eAAY,gBAAgB,EAAC,SAAS,EAAC,+DAA+D,GAAG,EAClI,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,IAAI;gCACrC,2DAA2D;gCAC3D,4BAAgB,iBAAiB,uBAAa,SAAS,EAAC,0BAA0B,YAChF,KAAC,KAAK,IAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,QAAQ,SAAG,GAC7D,CACR,IACI,EACP,4BAAgB,iBAAiB,EAAC,SAAS,EAAC,+BAA+B,YAAE,IAAI,CAAC,KAAK,GAAQ,EAC9F,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,IAAI,eAAM,SAAS,EAAC,SAAS,YAAE,KAAK,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,GAAQ,IACxF,IArBJ,IAAI,CAAC,GAAG,CAsBZ,CACN,CAAC,GACC,GACD,CACP,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Link as AriaLink, useLocale } from \"react-aria-components\";\n\nimport { cn } from \"../utils\";\nimport { Badge, type BadgeTone } from \"../display/badge\";\nimport { IconGlyph, type IconName } from \"../display/icon\";\nimport { mainNavigationLabel } from \"../i18n\";\nimport { LAYER } from \"../layers\";\n\nexport type DockItem = {\n key: string;\n /** Always shown under the icon (\"Orders\"); the last item is \"More\" when the app has more. */\n label: string;\n icon: IconName;\n href: string;\n badge?: { value: number; tone?: BadgeTone };\n};\n\nexport type DockProps = {\n /** Four or five top destinations. */\n items: readonly DockItem[];\n currentKey?: string;\n /** Names the navigation landmark; \"Main menu\" by default. */\n \"aria-label\"?: string;\n};\n\n/** True while the on-screen keyboard covers part of the layout viewport (a field has focus). */\nfunction useKeyboardOpen() {\n const [open, setOpen] = React.useState(false);\n React.useEffect(() => {\n const viewport = window.visualViewport;\n if (!viewport) return;\n const update = () => {\n const editing = document.activeElement instanceof HTMLElement && document.activeElement.matches(\"input, textarea, select, [contenteditable]:not([contenteditable='false'])\");\n // The keyboard takes a quarter of the height or more; a URL bar collapsing takes far less.\n setOpen(editing && viewport.height < window.innerHeight * 0.75);\n };\n viewport.addEventListener(\"resize\", update);\n window.addEventListener(\"focusin\", update);\n window.addEventListener(\"focusout\", update);\n return () => {\n viewport.removeEventListener(\"resize\", update);\n window.removeEventListener(\"focusin\", update);\n window.removeEventListener(\"focusout\", update);\n };\n }, []);\n return open;\n}\n\n/**\n * The bottom tab bar on phones: four or five destinations, icon over label, padded for the home\n * indicator. Hidden from 768px up and while the on-screen keyboard is open; leave it out of\n * full-screen flows (checkout).\n */\nexport function Dock({ items, currentKey, \"aria-label\": label }: DockProps) {\n const { locale } = useLocale();\n const keyboard = useKeyboardOpen();\n return (\n <nav\n aria-label={label ?? mainNavigationLabel(locale)}\n data-slot=\"dock\"\n hidden={keyboard || undefined}\n className={cn(\n \"fixed inset-x-0 bottom-0 border-t border-ds-border bg-ds-surface-overlay shadow-ds-overflow md:hidden\",\n // Safe-area insets are physical edges, so they pair with physical padding.\n \"[padding-left:max(var(--ds-space-100),env(safe-area-inset-left,0px))] [padding-right:max(var(--ds-space-100),env(safe-area-inset-right,0px))] pt-ds-075 pb-[max(var(--ds-space-150),env(safe-area-inset-bottom,0px))]\",\n LAYER.stickyBar,\n )}\n >\n <ul className=\"mx-auto grid max-w-[24.375rem] auto-cols-fr grid-flow-col\">\n {items.map((item) => (\n <li key={item.key} className=\"flex\">\n <AriaLink\n href={item.href}\n data-slot=\"dock-item\"\n aria-current={item.key === currentKey ? \"page\" : undefined}\n className={cn(\n \"group/dock flex min-h-11 flex-1 flex-col items-center justify-center gap-0.5 rounded-ds-medium py-ds-050 text-[11px] leading-[14px] font-[500] text-ds-text-subtle outline-hidden\",\n \"data-[pressed]:bg-ds-background-neutral-pressed data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused aria-[current=page]:text-ds-text\",\n )}\n >\n <span className=\"relative\">\n <IconGlyph name={item.icon} data-slot=\"dock-item-icon\" className=\"size-[22px] group-aria-[current=page]/dock:text-ds-icon-brand\" />\n {item.badge && item.badge.value > 0 && (\n // Drawn on the icon; read after the label (\"Mesajlar, 2\").\n <span data-slot=\"dock-item-badge\" aria-hidden className=\"absolute -top-1 -end-2.5\">\n <Badge value={item.badge.value} tone={item.badge.tone} isOnIcon />\n </span>\n )}\n </span>\n <span data-slot=\"dock-item-label\" className=\"max-w-full truncate px-ds-025\">{item.label}</span>\n {item.badge && item.badge.value > 0 && <span className=\"sr-only\">{`, ${item.badge.value}`}</span>}\n </AriaLink>\n </li>\n ))}\n </ul>\n </nav>\n );\n}\n"]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type FooterLink = {
|
|
3
|
+
/** Names the destination ("Privacy policy"), never "Click here". */
|
|
4
|
+
label: string;
|
|
5
|
+
href: string;
|
|
6
|
+
/** Another site: opens in a new tab with the 12px `arrow-up-right`. */
|
|
7
|
+
isExternal?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export type FooterColumn = {
|
|
10
|
+
/** The column's title ("Product"); it also names the column's navigation. */
|
|
11
|
+
title: string;
|
|
12
|
+
/** At most six. */
|
|
13
|
+
links: readonly FooterLink[];
|
|
14
|
+
};
|
|
15
|
+
export type FooterProps = {
|
|
16
|
+
/** The logo and wordmark (the site's logo and name). It links to `brandHref`. */
|
|
17
|
+
brand: React.ReactNode;
|
|
18
|
+
/** Where the brand goes: the home page. */
|
|
19
|
+
brandHref?: string;
|
|
20
|
+
/** The brand link's name when the brand alone does not say where it goes ("Acme home"). */
|
|
21
|
+
brandLabel?: string;
|
|
22
|
+
/** One line about the product, under the brand. */
|
|
23
|
+
about?: React.ReactNode;
|
|
24
|
+
/** A contact link under the about line (a subtle `Link` to the support address). */
|
|
25
|
+
contact?: React.ReactNode;
|
|
26
|
+
/** Two to four columns of links. */
|
|
27
|
+
columns: readonly FooterColumn[];
|
|
28
|
+
/** The copyright line ("© 2026 Acme"); a platform credit can go here too. */
|
|
29
|
+
legal: React.ReactNode;
|
|
30
|
+
/** The language switch at the end of the legal row (a subtle compact Button or Menu). */
|
|
31
|
+
languageSwitch?: React.ReactNode;
|
|
32
|
+
/** The column titles' heading level: 2 by default, a level below the page's h1. */
|
|
33
|
+
headingLevel?: 2 | 3 | 4;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Closes every public page: the brand block, two to four
|
|
37
|
+
* columns of subtle links, and the legal row with the copyright and the language switch. It holds no
|
|
38
|
+
* primary action; the page's one primary action lives in the Navbar and the CTA band. Narrower than
|
|
39
|
+
* 48rem (a phone) everything stacks in one column; it measures its own width, not the viewport's.
|
|
40
|
+
* Render it at the page root, outside `main`, `section` and `article`: only there is it the page's
|
|
41
|
+
* `contentinfo` landmark.
|
|
42
|
+
*/
|
|
43
|
+
export declare function Footer({ brand, brandHref, brandLabel, about, contact, columns, legal, languageSwitch, headingLevel }: FooterProps): React.JSX.Element;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Link as AriaLink } from "react-aria-components";
|
|
5
|
+
import { cn } from "../utils.js";
|
|
6
|
+
import { BrandLinkContext } from "./brand-link-context.js";
|
|
7
|
+
import { Link } from "../action/link.js";
|
|
8
|
+
const MAX_COLUMNS = 4;
|
|
9
|
+
const MAX_LINKS = 6;
|
|
10
|
+
/** From 48rem: the brand block, then one track per column (static classes: no inline style to strip). */
|
|
11
|
+
const GRID = {
|
|
12
|
+
0: "",
|
|
13
|
+
1: "@min-[48rem]:grid-cols-[minmax(0,1.5fr)_minmax(0,1fr)]",
|
|
14
|
+
2: "@min-[48rem]:grid-cols-[minmax(0,1.5fr)_repeat(2,minmax(0,1fr))]",
|
|
15
|
+
3: "@min-[48rem]:grid-cols-[minmax(0,1.5fr)_repeat(3,minmax(0,1fr))]",
|
|
16
|
+
4: "@min-[48rem]:grid-cols-[minmax(0,1.5fr)_repeat(4,minmax(0,1fr))]",
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Closes every public page: the brand block, two to four
|
|
20
|
+
* columns of subtle links, and the legal row with the copyright and the language switch. It holds no
|
|
21
|
+
* primary action; the page's one primary action lives in the Navbar and the CTA band. Narrower than
|
|
22
|
+
* 48rem (a phone) everything stacks in one column; it measures its own width, not the viewport's.
|
|
23
|
+
* Render it at the page root, outside `main`, `section` and `article`: only there is it the page's
|
|
24
|
+
* `contentinfo` landmark.
|
|
25
|
+
*/
|
|
26
|
+
export function Footer({ brand, brandHref = "/", brandLabel, about, contact, columns, legal, languageSwitch, headingLevel = 2 }) {
|
|
27
|
+
const Title = `h${headingLevel}`;
|
|
28
|
+
const id = React.useId();
|
|
29
|
+
const tooMany = columns.length > MAX_COLUMNS || columns.some((column) => column.links.length > MAX_LINKS);
|
|
30
|
+
// Once, not on every render, nor twice under StrictMode's re-run of effects.
|
|
31
|
+
const warned = React.useRef(false);
|
|
32
|
+
React.useEffect(() => {
|
|
33
|
+
if (!tooMany || warned.current)
|
|
34
|
+
return;
|
|
35
|
+
warned.current = true;
|
|
36
|
+
console.warn(`Footer: at most ${MAX_COLUMNS} columns of at most ${MAX_LINKS} links each.`);
|
|
37
|
+
}, [tooMany]);
|
|
38
|
+
return (_jsx("footer", { "data-slot": "footer", className: "@container border-t border-ds-border bg-ds-surface-sunken text-ds-text", children: _jsxs("div", { className: "mx-auto flex max-w-[1200px] flex-col gap-ds-500 px-ds-200 pt-ds-500 pb-ds-200 @min-[48rem]:px-ds-300 @min-[48rem]:pt-ds-600 @min-[48rem]:pb-ds-300", children: [_jsxs("div", { "data-slot": "footer-top", className: cn("grid grid-cols-1 gap-ds-400 @min-[48rem]:gap-ds-300", GRID[Math.min(columns.length, MAX_COLUMNS)]), children: [_jsxs("div", { "data-slot": "footer-brand", className: "flex flex-col items-start gap-ds-100", children: [_jsx(AriaLink, { href: brandHref, "aria-label": brandLabel, "data-slot": "footer-brand-link", className: "flex min-w-0 items-center gap-ds-100 rounded-ds-medium text-body-strong text-ds-text outline-hidden data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused", children: _jsx(BrandLinkContext.Provider, { value: true, children: brand }) }), about && _jsx("p", { className: "m-0 max-w-[36ch] text-body text-ds-text-subtle", children: about }), contact && _jsx("div", { "data-slot": "footer-contact", className: "text-body", children: contact })] }), columns.map((column, index) => {
|
|
39
|
+
const titleId = `${id}-column-${index}`;
|
|
40
|
+
return (_jsxs("nav", { "aria-labelledby": titleId, "data-slot": "footer-column", className: "flex flex-col gap-ds-150", children: [_jsx(Title, { id: titleId, className: "m-0 heading-xxsmall text-ds-text", children: column.title }), _jsx("ul", { className: "m-0 flex list-none flex-col gap-ds-100 p-0", children: column.links.map((link, linkIndex) => (_jsx("li", { className: "text-body", children: _jsx(Link, { href: link.href, variant: "subtle", isExternal: link.isExternal, children: link.label }) }, `${linkIndex}-${link.href}`))) })] }, `${index}-${column.title}`));
|
|
41
|
+
})] }), _jsxs("div", { "data-slot": "footer-legal", className: "flex flex-wrap items-center justify-between gap-x-ds-300 gap-y-ds-100 border-t border-ds-border pt-ds-200", children: [_jsx("div", { className: "text-body-small text-ds-text-subtlest", children: legal }), languageSwitch && _jsx("div", { "data-slot": "footer-language", className: "ms-auto", children: languageSwitch })] })] }) }));
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=footer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"footer.js","sourceRoot":"","sources":["../../src/navigation/footer.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAsCtC,MAAM,WAAW,GAAG,CAAC,CAAC;AACtB,MAAM,SAAS,GAAG,CAAC,CAAC;AAEpB,yGAAyG;AACzG,MAAM,IAAI,GAA2B;IACnC,CAAC,EAAE,EAAE;IACL,CAAC,EAAE,wDAAwD;IAC3D,CAAC,EAAE,kEAAkE;IACrE,CAAC,EAAE,kEAAkE;IACrE,CAAC,EAAE,kEAAkE;CACtE,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,UAAU,MAAM,CAAC,EAAE,KAAK,EAAE,SAAS,GAAG,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,YAAY,GAAG,CAAC,EAAe;IAC1I,MAAM,KAAK,GAAG,IAAI,YAAY,EAAW,CAAC;IAC1C,MAAM,EAAE,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC;IACzB,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,GAAG,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC1G,6EAA6E;IAC7E,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,C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MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,CACrC,aAAsC,SAAS,EAAC,WAAW,YACzD,KAAC,IAAI,IAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,EAAC,QAAQ,EAAC,UAAU,EAAE,IAAI,CAAC,UAAU,YAChE,IAAI,CAAC,KAAK,GACN,IAHA,GAAG,SAAS,IAAI,IAAI,CAAC,IAAI,EAAE,CAI/B,CACN,CAAC,GACC,KAZG,GAAG,KAAK,IAAI,MAAM,CAAC,KAAK,EAAE,CAa9B,CACP,CAAC;wBACJ,CAAC,CAAC,IACE,EACN,4BACY,cAAc,EACxB,SAAS,EAAC,2GAA2G,aAErH,cAAK,SAAS,EAAC,uCAAuC,YAAE,KAAK,GAAO,EACnE,cAAc,IAAI,2BAAe,iBAAiB,EAAC,SAAS,EAAC,SAAS,YAAE,cAAc,GAAO,IAC1F,IACF,GACC,CACV,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Link as AriaLink } from \"react-aria-components\";\n\nimport { cn } from \"../utils\";\nimport { BrandLinkContext } from \"./brand-link-context\";\nimport { Link } from \"../action/link\";\n\nexport type FooterLink = {\n /** Names the destination (\"Privacy policy\"), never \"Click here\". */\n label: string;\n href: string;\n /** Another site: opens in a new tab with the 12px `arrow-up-right`. */\n isExternal?: boolean;\n};\n\nexport type FooterColumn = {\n /** The column's title (\"Product\"); it also names the column's navigation. */\n title: string;\n /** At most six. */\n links: readonly FooterLink[];\n};\n\nexport type FooterProps = {\n /** The logo and wordmark (the site's logo and name). It links to `brandHref`. */\n brand: React.ReactNode;\n /** Where the brand goes: the home page. */\n brandHref?: string;\n /** The brand link's name when the brand alone does not say where it goes (\"Acme home\"). */\n brandLabel?: string;\n /** One line about the product, under the brand. */\n about?: React.ReactNode;\n /** A contact link under the about line (a subtle `Link` to the support address). */\n contact?: React.ReactNode;\n /** Two to four columns of links. */\n columns: readonly FooterColumn[];\n /** The copyright line (\"© 2026 Acme\"); a platform credit can go here too. */\n legal: React.ReactNode;\n /** The language switch at the end of the legal row (a subtle compact Button or Menu). */\n languageSwitch?: React.ReactNode;\n /** The column titles' heading level: 2 by default, a level below the page's h1. */\n headingLevel?: 2 | 3 | 4;\n};\n\nconst MAX_COLUMNS = 4;\nconst MAX_LINKS = 6;\n\n/** From 48rem: the brand block, then one track per column (static classes: no inline style to strip). */\nconst GRID: Record<number, string> = {\n 0: \"\",\n 1: \"@min-[48rem]:grid-cols-[minmax(0,1.5fr)_minmax(0,1fr)]\",\n 2: \"@min-[48rem]:grid-cols-[minmax(0,1.5fr)_repeat(2,minmax(0,1fr))]\",\n 3: \"@min-[48rem]:grid-cols-[minmax(0,1.5fr)_repeat(3,minmax(0,1fr))]\",\n 4: \"@min-[48rem]:grid-cols-[minmax(0,1.5fr)_repeat(4,minmax(0,1fr))]\",\n};\n\n/**\n * Closes every public page: the brand block, two to four\n * columns of subtle links, and the legal row with the copyright and the language switch. It holds no\n * primary action; the page's one primary action lives in the Navbar and the CTA band. Narrower than\n * 48rem (a phone) everything stacks in one column; it measures its own width, not the viewport's.\n * Render it at the page root, outside `main`, `section` and `article`: only there is it the page's\n * `contentinfo` landmark.\n */\nexport function Footer({ brand, brandHref = \"/\", brandLabel, about, contact, columns, legal, languageSwitch, headingLevel = 2 }: FooterProps) {\n const Title = `h${headingLevel}` as const;\n const id = React.useId();\n const tooMany = columns.length > MAX_COLUMNS || columns.some((column) => column.links.length > MAX_LINKS);\n // Once, not on every render, nor twice under StrictMode's re-run of effects.\n const warned = React.useRef(false);\n React.useEffect(() => {\n if (!tooMany || warned.current) return;\n warned.current = true;\n console.warn(`Footer: at most ${MAX_COLUMNS} columns of at most ${MAX_LINKS} links each.`);\n }, [tooMany]);\n return (\n <footer data-slot=\"footer\" className=\"@container border-t border-ds-border bg-ds-surface-sunken text-ds-text\">\n <div className=\"mx-auto flex max-w-[1200px] flex-col gap-ds-500 px-ds-200 pt-ds-500 pb-ds-200 @min-[48rem]:px-ds-300 @min-[48rem]:pt-ds-600 @min-[48rem]:pb-ds-300\">\n <div\n data-slot=\"footer-top\"\n className={cn(\"grid grid-cols-1 gap-ds-400 @min-[48rem]:gap-ds-300\", GRID[Math.min(columns.length, MAX_COLUMNS)])}\n >\n <div data-slot=\"footer-brand\" className=\"flex flex-col items-start gap-ds-100\">\n <AriaLink\n href={brandHref}\n aria-label={brandLabel}\n data-slot=\"footer-brand-link\"\n className=\"flex min-w-0 items-center gap-ds-100 rounded-ds-medium text-body-strong text-ds-text outline-hidden data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused\"\n >\n <BrandLinkContext.Provider value>{brand}</BrandLinkContext.Provider>\n </AriaLink>\n {about && <p className=\"m-0 max-w-[36ch] text-body text-ds-text-subtle\">{about}</p>}\n {contact && <div data-slot=\"footer-contact\" className=\"text-body\">{contact}</div>}\n </div>\n {columns.map((column, index) => {\n const titleId = `${id}-column-${index}`;\n return (\n <nav key={`${index}-${column.title}`} aria-labelledby={titleId} data-slot=\"footer-column\" className=\"flex flex-col gap-ds-150\">\n <Title id={titleId} className=\"m-0 heading-xxsmall text-ds-text\">\n {column.title}\n </Title>\n <ul className=\"m-0 flex list-none flex-col gap-ds-100 p-0\">\n {column.links.map((link, linkIndex) => (\n <li key={`${linkIndex}-${link.href}`} className=\"text-body\">\n <Link href={link.href} variant=\"subtle\" isExternal={link.isExternal}>\n {link.label}\n </Link>\n </li>\n ))}\n </ul>\n </nav>\n );\n })}\n </div>\n <div\n data-slot=\"footer-legal\"\n className=\"flex flex-wrap items-center justify-between gap-x-ds-300 gap-y-ds-100 border-t border-ds-border pt-ds-200\"\n >\n <div className=\"text-body-small text-ds-text-subtlest\">{legal}</div>\n {languageSwitch && <div data-slot=\"footer-language\" className=\"ms-auto\">{languageSwitch}</div>}\n </div>\n </div>\n </footer>\n );\n}\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export { Navbar, NavbarActions, NavbarBrand, NavbarItem } from "./navbar.js";
|
|
2
|
+
export type { NavbarActionsProps, NavbarBrandProps, NavbarItemProps, NavbarLink, NavbarProps } from "./navbar.js";
|
|
3
|
+
export { Sidebar, SidebarFooter, SidebarHeader, SidebarItem, SidebarSection, SidebarSubmenu } from "./sidebar.js";
|
|
4
|
+
export { sidebarScript } from "./sidebar-script.js";
|
|
5
|
+
export type { SidebarFooterProps, SidebarHeaderProps, SidebarItemData, SidebarItemProps, SidebarProps, SidebarSectionData, SidebarSectionProps, SidebarSubmenuProps } from "./sidebar.js";
|
|
6
|
+
export { BottomNav } from "./bottom-nav.js";
|
|
7
|
+
export type { BottomNavItem, BottomNavProps } from "./bottom-nav.js";
|
|
8
|
+
export { SegmentedControl, Tab, TabList, TabPanel, Tabs } from "./tabs.js";
|
|
9
|
+
export type { SegmentedControlItem, SegmentedControlProps, TabItem, TabListProps, TabPanelProps, TabProps, TabsProps, TabsVariant } from "./tabs.js";
|
|
10
|
+
export { Breadcrumb, Breadcrumbs } from "./breadcrumbs.js";
|
|
11
|
+
export type { BreadcrumbItem, BreadcrumbProps, BreadcrumbsProps } from "./breadcrumbs.js";
|
|
12
|
+
export { Pagination } from "./pagination.js";
|
|
13
|
+
export type { PaginationProps } from "./pagination.js";
|
|
14
|
+
export { Accordion, Disclosure } from "./accordion.js";
|
|
15
|
+
export type { AccordionItem, AccordionProps, DisclosureProps } from "./accordion.js";
|
|
16
|
+
export { Stepper } from "./stepper.js";
|
|
17
|
+
export type { StepperProps, StepperStep, StepStatus } from "./stepper.js";
|
|
18
|
+
export { SkipLink } from "./skip-link.js";
|
|
19
|
+
export type { SkipLinkProps } from "./skip-link.js";
|
|
20
|
+
export { PageHeader, PageHeaderBar, PageHeaderProvider } from "./page-header.js";
|
|
21
|
+
export type { PageHeaderBarProps, PageHeaderProps } from "./page-header.js";
|
|
22
|
+
export { BrandLinkContext } from "./brand-link-context.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// @senvenli/react/navigation: Navbar, Sidebar, BottomNav, Tabs and SegmentedControl, Breadcrumbs, Pagination,
|
|
2
|
+
// Accordion and Disclosure, Stepper, SkipLink and PageHeader.
|
|
3
|
+
export { Navbar, NavbarActions, NavbarBrand, NavbarItem } from "./navbar.js";
|
|
4
|
+
export { Sidebar, SidebarFooter, SidebarHeader, SidebarItem, SidebarSection, SidebarSubmenu } from "./sidebar.js";
|
|
5
|
+
// The head script module has no client directive, so a Server Component layout can render it.
|
|
6
|
+
export { sidebarScript } from "./sidebar-script.js";
|
|
7
|
+
export { BottomNav } from "./bottom-nav.js";
|
|
8
|
+
export { SegmentedControl, Tab, TabList, TabPanel, Tabs } from "./tabs.js";
|
|
9
|
+
export { Breadcrumb, Breadcrumbs } from "./breadcrumbs.js";
|
|
10
|
+
export { Pagination } from "./pagination.js";
|
|
11
|
+
export { Accordion, Disclosure } from "./accordion.js";
|
|
12
|
+
export { Stepper } from "./stepper.js";
|
|
13
|
+
export { SkipLink } from "./skip-link.js";
|
|
14
|
+
// The panel page header: the bar the shell renders, and what a page passes to it.
|
|
15
|
+
export { PageHeader, PageHeaderBar, PageHeaderProvider } from "./page-header.js";
|
|
16
|
+
export { BrandLinkContext } from "./brand-link-context.js";
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/navigation/index.ts"],"names":[],"mappings":"AAAA,8GAA8G;AAC9G,8DAA8D;AAC9D,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE1E,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC/G,8FAA8F;AAC9F,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,gBAAgB,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAExE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAExD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,kFAAkF;AAClF,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAG9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["// @senvenli/react/navigation: Navbar, Sidebar, BottomNav, Tabs and SegmentedControl, Breadcrumbs, Pagination,\n// Accordion and Disclosure, Stepper, SkipLink and PageHeader.\nexport { Navbar, NavbarActions, NavbarBrand, NavbarItem } from \"./navbar\";\nexport type { NavbarActionsProps, NavbarBrandProps, NavbarItemProps, NavbarLink, NavbarProps } from \"./navbar\";\nexport { Sidebar, SidebarFooter, SidebarHeader, SidebarItem, SidebarSection, SidebarSubmenu } from \"./sidebar\";\n// The head script module has no client directive, so a Server Component layout can render it.\nexport { sidebarScript } from \"./sidebar-script\";\nexport type { SidebarFooterProps, SidebarHeaderProps, SidebarItemData, SidebarItemProps, SidebarProps, SidebarSectionData, SidebarSectionProps, SidebarSubmenuProps } from \"./sidebar\";\nexport { BottomNav } from \"./bottom-nav\";\nexport type { BottomNavItem, BottomNavProps } from \"./bottom-nav\";\nexport { SegmentedControl, Tab, TabList, TabPanel, Tabs } from \"./tabs\";\nexport type { SegmentedControlItem, SegmentedControlProps, TabItem, TabListProps, TabPanelProps, TabProps, TabsProps, TabsVariant } from \"./tabs\";\nexport { Breadcrumb, Breadcrumbs } from \"./breadcrumbs\";\nexport type { BreadcrumbItem, BreadcrumbProps, BreadcrumbsProps } from \"./breadcrumbs\";\nexport { Pagination } from \"./pagination\";\nexport type { PaginationProps } from \"./pagination\";\nexport { Accordion, Disclosure } from \"./accordion\";\nexport type { AccordionItem, AccordionProps, DisclosureProps } from \"./accordion\";\nexport { Stepper } from \"./stepper\";\nexport type { StepperProps, StepperStep, StepStatus } from \"./stepper\";\nexport { SkipLink } from \"./skip-link\";\nexport type { SkipLinkProps } from \"./skip-link\";\n// The panel page header: the bar the shell renders, and what a page passes to it.\nexport { PageHeader, PageHeaderBar, PageHeaderProvider } from \"./page-header\";\nexport type { PageHeaderBarProps, PageHeaderProps } from \"./page-header\";\n\nexport { BrandLinkContext } from \"./brand-link-context\";\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Names for languages the runtime names wrongly or not at all, as the reader of `uiLocale` should see them:
|
|
3
|
+
* Montenegrin, which Intl calls Serbian (`registerLanguageNames("en", { me: "Montenegrin" })`), or every
|
|
4
|
+
* language in a UI language whose display names browsers do not ship (Albanian, Macedonian). `uiLocale` is a
|
|
5
|
+
* language ("sq") or a full tag ("pt-BR"); the full tag wins.
|
|
6
|
+
*/
|
|
7
|
+
export declare function registerLanguageNames(uiLocale: string, names: Readonly<Record<string, string>>): void;
|
|
8
|
+
/** Uppercase the first code point only, in the UI language ("İngilizce" in Turkish), leaving the rest as given. */
|
|
9
|
+
export declare function capitalizeLanguageName(name: string, uiLocale: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* A language's name in the UI language: the app's registered name, else Intl's (through `registerLocaleAliases`),
|
|
12
|
+
* else the language's own name (its endonym), never the host's language, else the tag itself.
|
|
13
|
+
*/
|
|
14
|
+
export declare function languageName(locale: string, uiLocale: string): string;
|
|
15
|
+
/** The locales with their names in the UI language, sorted by that name the way the UI language sorts. */
|
|
16
|
+
export declare function languageOptions<Locale extends string>(locales: readonly Locale[], uiLocale: string): Array<{
|
|
17
|
+
locale: Locale;
|
|
18
|
+
label: string;
|
|
19
|
+
}>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// No "use client": plain functions, usable on the server so both render the same names.
|
|
2
|
+
import { hasIntlData, intlLocale } from "../intl-locale.js";
|
|
3
|
+
/** App-registered names, by UI language then by language tag. */
|
|
4
|
+
const registered = new Map();
|
|
5
|
+
/**
|
|
6
|
+
* Names for languages the runtime names wrongly or not at all, as the reader of `uiLocale` should see them:
|
|
7
|
+
* Montenegrin, which Intl calls Serbian (`registerLanguageNames("en", { me: "Montenegrin" })`), or every
|
|
8
|
+
* language in a UI language whose display names browsers do not ship (Albanian, Macedonian). `uiLocale` is a
|
|
9
|
+
* language ("sq") or a full tag ("pt-BR"); the full tag wins.
|
|
10
|
+
*/
|
|
11
|
+
export function registerLanguageNames(uiLocale, names) {
|
|
12
|
+
const key = uiLocale.toLowerCase();
|
|
13
|
+
const table = registered.get(key) ?? new Map();
|
|
14
|
+
for (const [tag, name] of Object.entries(names))
|
|
15
|
+
table.set(tag.toLowerCase(), name);
|
|
16
|
+
registered.set(key, table);
|
|
17
|
+
}
|
|
18
|
+
function registeredName(locale, uiLocale) {
|
|
19
|
+
const tag = locale.toLowerCase();
|
|
20
|
+
const ui = uiLocale.toLowerCase();
|
|
21
|
+
return registered.get(ui)?.get(tag) ?? registered.get(ui.split(/[-_]/)[0] ?? ui)?.get(tag);
|
|
22
|
+
}
|
|
23
|
+
/** Uppercase the first code point only, in the UI language ("İngilizce" in Turkish), leaving the rest as given. */
|
|
24
|
+
export function capitalizeLanguageName(name, uiLocale) {
|
|
25
|
+
const first = [...name][0];
|
|
26
|
+
if (!first)
|
|
27
|
+
return name;
|
|
28
|
+
try {
|
|
29
|
+
return first.toLocaleUpperCase(intlLocale(uiLocale)) + name.slice(first.length);
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
return first.toUpperCase() + name.slice(first.length);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function displayName(locale, uiLocale) {
|
|
36
|
+
try {
|
|
37
|
+
// "standard" names a region in brackets ("Portuguese (Brazil)"), not "Brazilian Portuguese".
|
|
38
|
+
return new Intl.DisplayNames([uiLocale], { type: "language", fallback: "none", languageDisplay: "standard" }).of(locale) ?? undefined;
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* A language's name in the UI language: the app's registered name, else Intl's (through `registerLocaleAliases`),
|
|
46
|
+
* else the language's own name (its endonym), never the host's language, else the tag itself.
|
|
47
|
+
*/
|
|
48
|
+
export function languageName(locale, uiLocale) {
|
|
49
|
+
const own = registeredName(locale, uiLocale);
|
|
50
|
+
if (own)
|
|
51
|
+
return own;
|
|
52
|
+
const ui = intlLocale(uiLocale);
|
|
53
|
+
const target = intlLocale(locale);
|
|
54
|
+
// A runtime with no data for the UI language would name languages in the host's language; the endonym is never that.
|
|
55
|
+
const name = hasIntlData(ui) ? displayName(target, ui) : undefined;
|
|
56
|
+
if (name)
|
|
57
|
+
return capitalizeLanguageName(name, uiLocale);
|
|
58
|
+
// The same rule for the endonym: a language with no data of its own would be named in the host's language.
|
|
59
|
+
const endonym = registeredName(locale, locale) ?? (hasIntlData(target) ? displayName(target, target) : undefined);
|
|
60
|
+
if (endonym)
|
|
61
|
+
return capitalizeLanguageName(endonym, locale);
|
|
62
|
+
// No name anywhere: the tag as given, not dressed up as a word.
|
|
63
|
+
return locale;
|
|
64
|
+
}
|
|
65
|
+
/** The locales with their names in the UI language, sorted by that name the way the UI language sorts. */
|
|
66
|
+
export function languageOptions(locales, uiLocale) {
|
|
67
|
+
let collator;
|
|
68
|
+
try {
|
|
69
|
+
collator = new Intl.Collator(intlLocale(uiLocale).replace(/_/g, "-"), { sensitivity: "base" });
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
// A tag Intl cannot read ("x-app") still gets a list, in the runtime's default order.
|
|
73
|
+
collator = new Intl.Collator(undefined, { sensitivity: "base" });
|
|
74
|
+
}
|
|
75
|
+
return locales
|
|
76
|
+
.map((locale) => ({ locale, label: languageName(locale, uiLocale) }))
|
|
77
|
+
.sort((a, b) => collator.compare(a.label, b.label) || (a.locale < b.locale ? -1 : a.locale > b.locale ? 1 : 0));
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=language-names.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"language-names.js","sourceRoot":"","sources":["../../src/navigation/language-names.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEzD,iEAAiE;AACjE,MAAM,UAAU,GAAG,IAAI,GAAG,EAA+B,CAAC;AAE1D;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAAC,QAAgB,EAAE,KAAuC;IAC7F,MAAM,GAAG,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;IACnC,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,IAAI,GAAG,EAAkB,CAAC;IAC/D,KAAK,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,IAAI,CAAC,CAAC;IACpF,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;AAC7B,CAAC;AAED,SAAS,cAAc,CAAC,MAAc,EAAE,QAAgB;IACtD,MAAM,GAAG,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;IACjC,MAAM,EAAE,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;IAClC,OAAO,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,IAAI,UAAU,CAAC,GAAG,CAAC,EAAE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,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACpH,CAAC","sourcesContent":["// No \"use client\": plain functions, usable on the server so both render the same names.\nimport { hasIntlData, intlLocale } from \"../intl-locale\";\n\n/** App-registered names, by UI language then by language tag. */\nconst registered = new Map<string, Map<string, string>>();\n\n/**\n * Names for languages the runtime names wrongly or not at all, as the reader of `uiLocale` should see them:\n * Montenegrin, which Intl calls Serbian (`registerLanguageNames(\"en\", { me: \"Montenegrin\" })`), or every\n * language in a UI language whose display names browsers do not ship (Albanian, Macedonian). `uiLocale` is a\n * language (\"sq\") or a full tag (\"pt-BR\"); the full tag wins.\n */\nexport function registerLanguageNames(uiLocale: string, names: Readonly<Record<string, string>>): void {\n const key = uiLocale.toLowerCase();\n const table = registered.get(key) ?? new Map<string, string>();\n for (const [tag, name] of Object.entries(names)) table.set(tag.toLowerCase(), name);\n registered.set(key, table);\n}\n\nfunction registeredName(locale: string, uiLocale: string): string | undefined {\n const tag = locale.toLowerCase();\n const ui = uiLocale.toLowerCase();\n return registered.get(ui)?.get(tag) ?? registered.get(ui.split(/[-_]/)[0] ?? ui)?.get(tag);\n}\n\n/** Uppercase the first code point only, in the UI language (\"İngilizce\" in Turkish), leaving the rest as given. */\nexport function capitalizeLanguageName(name: string, uiLocale: string): string {\n const first = [...name][0];\n if (!first) return name;\n try {\n return first.toLocaleUpperCase(intlLocale(uiLocale)) + name.slice(first.length);\n } catch {\n return first.toUpperCase() + name.slice(first.length);\n }\n}\n\nfunction displayName(locale: string, uiLocale: string): string | undefined {\n try {\n // \"standard\" names a region in brackets (\"Portuguese (Brazil)\"), not \"Brazilian Portuguese\".\n return new Intl.DisplayNames([uiLocale], { type: \"language\", fallback: \"none\", languageDisplay: \"standard\" }).of(locale) ?? undefined;\n } catch {\n return undefined;\n }\n}\n\n/**\n * A language's name in the UI language: the app's registered name, else Intl's (through `registerLocaleAliases`),\n * else the language's own name (its endonym), never the host's language, else the tag itself.\n */\nexport function languageName(locale: string, uiLocale: string): string {\n const own = registeredName(locale, uiLocale);\n if (own) return own;\n const ui = intlLocale(uiLocale);\n const target = intlLocale(locale);\n // A runtime with no data for the UI language would name languages in the host's language; the endonym is never that.\n const name = hasIntlData(ui) ? displayName(target, ui) : undefined;\n if (name) return capitalizeLanguageName(name, uiLocale);\n // The same rule for the endonym: a language with no data of its own would be named in the host's language.\n const endonym = registeredName(locale, locale) ?? (hasIntlData(target) ? displayName(target, target) : undefined);\n if (endonym) return capitalizeLanguageName(endonym, locale);\n // No name anywhere: the tag as given, not dressed up as a word.\n return locale;\n}\n\n/** The locales with their names in the UI language, sorted by that name the way the UI language sorts. */\nexport function languageOptions<Locale extends string>(locales: readonly Locale[], uiLocale: string): Array<{ locale: Locale; label: string }> {\n let collator: Intl.Collator;\n try {\n collator = new Intl.Collator(intlLocale(uiLocale).replace(/_/g, \"-\"), { sensitivity: \"base\" });\n } catch {\n // A tag Intl cannot read (\"x-app\") still gets a list, in the runtime's default order.\n collator = new Intl.Collator(undefined, { sensitivity: \"base\" });\n }\n return locales\n .map((locale) => ({ locale, label: languageName(locale, uiLocale) }))\n .sort((a, b) => collator.compare(a.label, b.label) || (a.locale < b.locale ? -1 : a.locale > b.locale ? 1 : 0));\n}\n"]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* One language as the switcher shows it: the app's mark (a flag, a code chip), if any, and the name in the UI
|
|
4
|
+
* language. With the name hidden (a square trigger) the mark stands alone; the name stays for screen readers.
|
|
5
|
+
* The mark is decorative next to the name, so it is hidden from assistive technology, and the name always tells
|
|
6
|
+
* the options apart.
|
|
7
|
+
*/
|
|
8
|
+
export declare function LanguageLabel({ locale, uiLocale, hideName, mark, }: {
|
|
9
|
+
locale: string;
|
|
10
|
+
uiLocale: string;
|
|
11
|
+
hideName?: boolean;
|
|
12
|
+
mark?: React.ReactNode;
|
|
13
|
+
}): React.JSX.Element;
|
|
14
|
+
export interface LanguageSwitcherProps<Locale extends string> {
|
|
15
|
+
/** Locales to offer, already narrowed to what this product enables. */
|
|
16
|
+
locales: readonly Locale[];
|
|
17
|
+
current: Locale;
|
|
18
|
+
onSelect: (locale: Locale) => void;
|
|
19
|
+
/** The trigger's accessible name and tooltip; "Language" (the DS string) by default. */
|
|
20
|
+
label?: string;
|
|
21
|
+
/** Hold the disabled trigger while the product's locale list resolves. */
|
|
22
|
+
isLoading?: boolean;
|
|
23
|
+
/** `button` (default): a trigger in a bar. `sidebar`: a full-width row whose list opens upward, for a panel sidebar. */
|
|
24
|
+
variant?: "button" | "sidebar";
|
|
25
|
+
/** A collapsed rail: the mark alone (or the name, without one), kept for screen readers either way. */
|
|
26
|
+
isCollapsed?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* A mark before each language's name: a flag, an `IsoChip`, an icon. None by default: a language is not a
|
|
29
|
+
* country, and the name alone tells the options apart.
|
|
30
|
+
*/
|
|
31
|
+
renderMark?: (locale: Locale) => React.ReactNode;
|
|
32
|
+
/** Control height: `medium` (default) matches the DS controls, `small` is the compact step. */
|
|
33
|
+
size?: "small" | "medium";
|
|
34
|
+
/**
|
|
35
|
+
* Ids of elements that describe the trigger ("Changes the language of the whole panel"). It lands on the
|
|
36
|
+
* trigger button, the focusable control, also while it is disabled for `isLoading`; left out, nothing is
|
|
37
|
+
* added. While the trigger's tooltip is open it takes the place of the tooltip's id, which only
|
|
38
|
+
* repeats `label`.
|
|
39
|
+
*/
|
|
40
|
+
"aria-describedby"?: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The language choice every surface offers, on the DS.
|
|
44
|
+
*
|
|
45
|
+
* Presentation only: the app resolves the product's locale list and handles
|
|
46
|
+
* `onSelect` (routing, persistence). Names come from `Intl.DisplayNames` in
|
|
47
|
+
* the active UI locale (`current`), ordered by that visible name.
|
|
48
|
+
* Choosing a value is a Select, not a Menu, so the list is a listbox whose
|
|
49
|
+
* current option is selected for assistive technology and carries a check.
|
|
50
|
+
*
|
|
51
|
+
* The trigger stays disabled until the component has mounted *and* the
|
|
52
|
+
* caller reports the list resolved, so a product restricted to one language
|
|
53
|
+
* never flashes the full list on a cold cache.
|
|
54
|
+
*/
|
|
55
|
+
export declare function LanguageSwitcher<Locale extends string>({ locales, current, onSelect, label: labelProp, isLoading: loading, variant, isCollapsed: collapsed, size, renderMark, "aria-describedby": describedBy, }: LanguageSwitcherProps<Locale>): React.JSX.Element;
|