@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,433 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { DateFieldStateContext, DateInput, DateSegment, FormContext, FormValidationContext, InputContext, TimeFieldStateContext, useLocale, } from "react-aria-components";
|
|
5
|
+
import { CalendarDate, GregorianCalendar, toCalendar } from "@internationalized/date";
|
|
6
|
+
import { cn } from "../utils.js";
|
|
7
|
+
import { FormSubmittedContext } from "../form/validation.js";
|
|
8
|
+
import { dateIncompleteLabel, monthHasDaysLabel } from "../i18n.js";
|
|
9
|
+
/**
|
|
10
|
+
* One segment: the active one fills with the brand colour; an empty one shows its placeholder ("GG",
|
|
11
|
+
* "AA", "YYYY") in the subtlest text, upper-cased because Intl gives "gg.aa.yyyy".
|
|
12
|
+
*/
|
|
13
|
+
const SEGMENT = "rounded-ds-small px-px tabular-nums outline-hidden caret-transparent select-none " +
|
|
14
|
+
"data-[placeholder]:uppercase data-[placeholder]:text-ds-text-subtlest " +
|
|
15
|
+
"data-[focused]:bg-ds-background-brand-bold data-[focused]:text-ds-text-on-brand data-[focused]:data-[placeholder]:text-ds-text-on-brand " +
|
|
16
|
+
"data-[disabled]:text-ds-text-disabled";
|
|
17
|
+
// whitespace-pre: a literal that is only a space ("10:30 AM") would otherwise collapse inside the flex row.
|
|
18
|
+
const LITERAL = "whitespace-pre px-0 text-ds-text-subtle data-[disabled]:text-ds-text-disabled";
|
|
19
|
+
/**
|
|
20
|
+
* The separator between a date and its time ("14.10.2026 10:00", "10/14/2026, 10:00 AM"; see {@link isDateTimeBreak})
|
|
21
|
+
*. The segments never wrap (the field's `whitespace-nowrap`), except after this one's space: pre-wrap
|
|
22
|
+
* keeps the space and makes it the one place the line may break, so a field too narrow for both (a range with hours
|
|
23
|
+
* in a phone column) puts the time under the date instead of cutting it off, and its min-content is the wider of the
|
|
24
|
+
* two, not both. A field wide enough for both is laid out exactly as before.
|
|
25
|
+
*/
|
|
26
|
+
const LITERAL_BREAK = "whitespace-pre-wrap px-0 text-ds-text-subtle data-[disabled]:text-ds-text-disabled";
|
|
27
|
+
/**
|
|
28
|
+
* The segments kept out of sight for `fixed`: its own, and with a hidden year its era too (a Japanese "H", a ROC
|
|
29
|
+
* "Minguo"), which names a year that is not shown.
|
|
30
|
+
*/
|
|
31
|
+
export function hiddenSegments(fixed) {
|
|
32
|
+
const hidden = new Set(Object.keys(fixed ?? {}));
|
|
33
|
+
if (hidden.has("year"))
|
|
34
|
+
hidden.add("era");
|
|
35
|
+
return hidden;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The Gregorian year `gregorianYear` as the field's calendar counts it: Gregorian 2000 is 2543 in the
|
|
39
|
+
* Buddhist calendar, Heisei 12 in the Japanese and Minguo 89 in the ROC one, each a leap year with the same months, so
|
|
40
|
+
* 29 February exists. Set as 2000 in those calendars it was 1457 CE, Reiwa 2000 (4018 CE) and 3911 CE, none of them
|
|
41
|
+
* leap, and a valid 29.02 was refused.
|
|
42
|
+
*/
|
|
43
|
+
export function heldYear(calendar, gregorianYear) {
|
|
44
|
+
const date = toCalendar(new CalendarDate(gregorianYear, 1, 1), calendar);
|
|
45
|
+
return { era: date.era, year: date.year };
|
|
46
|
+
}
|
|
47
|
+
function useFieldState() {
|
|
48
|
+
const date = React.useContext(DateFieldStateContext);
|
|
49
|
+
const time = React.useContext(TimeFieldStateContext);
|
|
50
|
+
return date ?? time;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Which of React Aria's segments show when some are hidden. A hidden segment takes one separator with it:
|
|
54
|
+
* the one before it when no shown part follows it (the year of a month–day: "dd. mm. yyyy." → "dd. mm."; with its
|
|
55
|
+
* era after it, "mm/dd/yyyy Minguo" → "mm/dd"), otherwise the one after it (the day of a month: "dd.mm.yyyy г." →
|
|
56
|
+
* "mm.yyyy г."). Leading and closing literals ("." in me, " г." in bg) stay, so every locale keeps its own full-date
|
|
57
|
+
* style.
|
|
58
|
+
*/
|
|
59
|
+
export function visibleIndexes(segments, hidden) {
|
|
60
|
+
const visible = new Set(segments.map((_, index) => index));
|
|
61
|
+
const parts = segments.map((segment, index) => ({ segment, index })).filter(({ segment }) => segment.type !== "literal");
|
|
62
|
+
const lastShown = parts.filter(({ segment }) => !hidden.has(segment.type)).at(-1)?.index ?? -1;
|
|
63
|
+
for (const { segment, index } of parts) {
|
|
64
|
+
if (!hidden.has(segment.type))
|
|
65
|
+
continue;
|
|
66
|
+
visible.delete(index);
|
|
67
|
+
const step = index > lastShown ? -1 : 1;
|
|
68
|
+
for (let i = index + step; i >= 0 && i < segments.length && segments[i].type === "literal"; i += step) {
|
|
69
|
+
visible.delete(i);
|
|
70
|
+
}
|
|
71
|
+
// A hidden year also takes its own word with it (" г." in bg and mk); a closing "." of the date stays.
|
|
72
|
+
if (segment.type === "year") {
|
|
73
|
+
for (let i = index + 1; i < segments.length && segments[i].type === "literal"; i++) {
|
|
74
|
+
if (/\p{L}/u.test(segments[i].text))
|
|
75
|
+
visible.delete(i);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return visible;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Keeps a hidden segment filled. React Aria commits a value only when every segment is set, so the
|
|
83
|
+
* year of a month–day must be set for it: the user never sees or types it. The month stays empty
|
|
84
|
+
* until the user types one, so a day picked first never turns into January.
|
|
85
|
+
*/
|
|
86
|
+
function Fixed({ segment, value }) {
|
|
87
|
+
const state = useFieldState();
|
|
88
|
+
React.useLayoutEffect(() => {
|
|
89
|
+
if (state && segment.isPlaceholder && !state.isDisabled)
|
|
90
|
+
state.setSegment(segment.type, value);
|
|
91
|
+
});
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Keeps the hidden year of a month–day at the Gregorian year given, as the field's calendar counts it (see
|
|
96
|
+
* {@link heldYear}). In a calendar with eras the era is set first, in its own commit: React Aria would otherwise give the
|
|
97
|
+
* year the era of today (Reiwa), and two segments set in one handler would both start from the same old value.
|
|
98
|
+
*/
|
|
99
|
+
function FixedYear({ segment, gregorianYear }) {
|
|
100
|
+
const state = useFieldState();
|
|
101
|
+
React.useLayoutEffect(() => {
|
|
102
|
+
if (!state || !segment.isPlaceholder || state.isDisabled)
|
|
103
|
+
return;
|
|
104
|
+
const calendar = state.calendar ?? new GregorianCalendar();
|
|
105
|
+
const held = heldYear(calendar, gregorianYear);
|
|
106
|
+
const eras = calendar.getEras();
|
|
107
|
+
const eraSegment = state.segments.find((s) => s.type === "era");
|
|
108
|
+
if (eras.length > 1 && eraSegment && (eraSegment.isPlaceholder || eras[eraSegment.value] !== held.era)) {
|
|
109
|
+
state.setSegment("era", held.era);
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
state.setSegment("year", held.year);
|
|
113
|
+
});
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
/** Arrow keys step the minutes by `step` (15 or 30); typed minutes are left as typed. */
|
|
117
|
+
function SteppedMinute({ segment, step, children }) {
|
|
118
|
+
const state = useFieldState();
|
|
119
|
+
return (_jsx("span", { className: "contents", onKeyDownCapture: (event) => {
|
|
120
|
+
if (!state || (event.key !== "ArrowUp" && event.key !== "ArrowDown"))
|
|
121
|
+
return;
|
|
122
|
+
const current = segment.isPlaceholder ? null : (segment.value ?? 0);
|
|
123
|
+
const up = event.key === "ArrowUp";
|
|
124
|
+
const next = current === null ? 0 : up ? (Math.floor(current / step) + 1) * step : (Math.ceil(current / step) - 1) * step;
|
|
125
|
+
event.preventDefault();
|
|
126
|
+
event.stopPropagation();
|
|
127
|
+
state.setSegment("minute", ((next % 60) + 60) % 60);
|
|
128
|
+
}, children: children }));
|
|
129
|
+
}
|
|
130
|
+
/** The typed segments of a date or time field, in the locale's order and with its separators. */
|
|
131
|
+
export function Segments({ fixed, minuteStep, slot, className, onReport, id, formValue }) {
|
|
132
|
+
const hidden = React.useMemo(() => hiddenSegments(fixed), [fixed]);
|
|
133
|
+
const { direction } = useLocale();
|
|
134
|
+
// An LTR locale's segments are laid out left to right on an RTL page too: React Aria isolates only the
|
|
135
|
+
// hour to minute, so the AM/PM beside them ("10:30 AM", "10:30 π.μ.") went to the other side ("AM 10:30"). The
|
|
136
|
+
// segments keep the page's side of the box (the right, under an RTL parent), where they were. An RTL locale's
|
|
137
|
+
// follow the page, as before.
|
|
138
|
+
const ltr = direction === "ltr";
|
|
139
|
+
return (
|
|
140
|
+
// Inline flow, not flex: React Aria wraps times in bidi isolates (U+2066…U+2069) so "10:30" reads left to
|
|
141
|
+
// right on an RTL page too; flex items would ignore them and lay the segments out as "30:10".
|
|
142
|
+
_jsx(DateInput, { slot: slot, "data-slot": "date-input", dir: ltr ? "ltr" : undefined, className: cn("min-w-0 flex-1 overflow-hidden whitespace-nowrap text-body", ltr && "[:dir(rtl)>&]:text-end", className), children: (segment) => _jsx(Segment, { segment: segment, fixed: fixed, hidden: hidden, minuteStep: minuteStep, onReport: onReport, id: id, formValue: formValue, slot: slot }) }));
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* The first segment the user types in, in DOM order (the locale's): not a separator, not a hidden one (the year of a
|
|
146
|
+
* month–day, the day of a month). The field's `id` goes on it, so focusing that id reaches the field.
|
|
147
|
+
*/
|
|
148
|
+
export function firstTypedIndex(segments, hidden) {
|
|
149
|
+
return segments.findIndex((segment) => segment.isEditable && segment.type !== "literal" && !hidden.has(segment.type));
|
|
150
|
+
}
|
|
151
|
+
const DATE_SIDE = new Set(["era", "year", "month", "day"]);
|
|
152
|
+
const TIME_SIDE = new Set(["hour", "minute", "second", "dayPeriod", "timeZoneName"]);
|
|
153
|
+
/** A space the line may break at: any white space but the no-break ones (U+00A0, U+2007, U+202F). */
|
|
154
|
+
const BREAKING_SPACE = /[^\S\u00a0\u2007\u202f]/;
|
|
155
|
+
/**
|
|
156
|
+
* Whether the segment at `index` is the separator between the date and the time of a date-time: a
|
|
157
|
+
* literal with a space to break at (", ", " ", "، "; not the bidi isolate React Aria puts before a time as a literal of
|
|
158
|
+
* its own), a date part on one side and a time part on the other, in the locale's order (time first works too). Only
|
|
159
|
+
* there may the segments wrap (see `LITERAL_BREAK`); a date alone, a time alone, and the AM/PM beside its hour never do.
|
|
160
|
+
*/
|
|
161
|
+
export function isDateTimeBreak(segments, index) {
|
|
162
|
+
const segment = segments[index];
|
|
163
|
+
if (segment?.type !== "literal" || !BREAKING_SPACE.test(segment.text))
|
|
164
|
+
return false;
|
|
165
|
+
const side = (step) => {
|
|
166
|
+
for (let at = index + step; at >= 0 && at < segments.length; at += step) {
|
|
167
|
+
const type = segments[at].type;
|
|
168
|
+
if (type === "literal")
|
|
169
|
+
continue;
|
|
170
|
+
return DATE_SIDE.has(type) ? "date" : TIME_SIDE.has(type) ? "time" : null;
|
|
171
|
+
}
|
|
172
|
+
return null;
|
|
173
|
+
};
|
|
174
|
+
const before = side(-1);
|
|
175
|
+
const after = side(1);
|
|
176
|
+
return before !== null && after !== null && before !== after;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* The date–time separator with only its last space left to break at: the
|
|
180
|
+
* earlier ones become no-break spaces, so a time that goes under its date starts the line with its hour, not with the
|
|
181
|
+
* rest of the separator (". u " in bs, " г., " in bg and mk, " klo " in fi left "u 10:00" or "г., 10:00" below).
|
|
182
|
+
*/
|
|
183
|
+
export function breakAtLastSpace(text) {
|
|
184
|
+
const breaking = new RegExp(BREAKING_SPACE.source, "g");
|
|
185
|
+
const last = Math.max(...Array.from(text.matchAll(breaking), (match) => match.index));
|
|
186
|
+
return text.replace(breaking, (space, at) => (at === last ? space : "\u00a0"));
|
|
187
|
+
}
|
|
188
|
+
/** The ARIA attributes that hold id references; React Aria names a segment with its own id in `aria-labelledby`. */
|
|
189
|
+
const ID_REFERENCES = [
|
|
190
|
+
"aria-labelledby",
|
|
191
|
+
"aria-describedby",
|
|
192
|
+
"aria-controls",
|
|
193
|
+
"aria-owns",
|
|
194
|
+
"aria-details",
|
|
195
|
+
"aria-errormessage",
|
|
196
|
+
"aria-flowto",
|
|
197
|
+
"aria-activedescendant",
|
|
198
|
+
];
|
|
199
|
+
/**
|
|
200
|
+
* A segment's props with the app's `id` in place of React Aria's own, and every reference to the old id swapped
|
|
201
|
+
* too: the segment is named by `aria-labelledby="<its own id> <field label id>"` ("day, Start date"), and a
|
|
202
|
+
* reference to an id no element has would drop the segment's name.
|
|
203
|
+
*
|
|
204
|
+
* React Aria's `useLabels` puts that self-reference first whenever a segment has both `aria-label` (its own name)
|
|
205
|
+
* and `aria-labelledby`. Until its ids settle (on the server, and in the first client render) the self-reference is
|
|
206
|
+
* a second id of React Aria's that is not the element's, so the first token is swapped as well: the server HTML
|
|
207
|
+
* then names the segment fully, and hydration sees the same attribute.
|
|
208
|
+
*/
|
|
209
|
+
export function withId(props, id) {
|
|
210
|
+
const own = props.id;
|
|
211
|
+
const next = { ...props, id };
|
|
212
|
+
for (const key of ID_REFERENCES) {
|
|
213
|
+
const value = next[key];
|
|
214
|
+
if (typeof value !== "string" || !value.trim())
|
|
215
|
+
continue;
|
|
216
|
+
const refs = value.trim().split(/\s+/).map((ref) => (own && ref === own ? id : ref));
|
|
217
|
+
if (key === "aria-labelledby" && props["aria-label"])
|
|
218
|
+
refs[0] = id;
|
|
219
|
+
next[key] = [...new Set(refs)].join(" ");
|
|
220
|
+
}
|
|
221
|
+
return next;
|
|
222
|
+
}
|
|
223
|
+
function Segment({ segment, fixed, hidden, minuteStep, onReport, id, formValue, slot }) {
|
|
224
|
+
const state = useFieldState();
|
|
225
|
+
const index = state ? state.segments.indexOf(segment) : -1;
|
|
226
|
+
// Only with an `id`, so a field without one renders exactly as before.
|
|
227
|
+
const targetId = id !== undefined && state && index >= 0 && index === firstTypedIndex(state.segments, hidden) ? id : undefined;
|
|
228
|
+
// The watcher needs the field's state, which only exists inside DateInput: it rides along with the first segment.
|
|
229
|
+
const watcher = index === 0 ? (_jsxs(_Fragment, { children: [_jsx(OverflowWatcher, { fixed: fixed, onReport: onReport }), formValue !== undefined && _jsx(FormValue, { value: formValue }), slot !== "end" && _jsx(ResetWatcher, {})] })) : null;
|
|
230
|
+
if (hidden.has(segment.type)) {
|
|
231
|
+
// The era of a hidden year is set with the year (FixedYear).
|
|
232
|
+
const keep = segment.type === "year" ? _jsx(FixedYear, { segment: segment, gregorianYear: fixed.year })
|
|
233
|
+
: segment.type === "day" ? _jsx(Fixed, { segment: segment, value: fixed.day })
|
|
234
|
+
: null;
|
|
235
|
+
return _jsxs(_Fragment, { children: [watcher, keep] });
|
|
236
|
+
}
|
|
237
|
+
if (hidden.size && state && index >= 0 && !visibleIndexes(state.segments, hidden).has(index))
|
|
238
|
+
return watcher;
|
|
239
|
+
const dateTimeBreak = segment.type === "literal" && state !== null && isDateTimeBreak(state.segments, index);
|
|
240
|
+
const element = (_jsx(DateSegment
|
|
241
|
+
// The id is set on the element itself: React Aria's prop merge would swap it for its own on the server.
|
|
242
|
+
, { ...(targetId !== undefined ? { render: (props) => _jsx("span", { ...withId(props, targetId) }) } : null), segment: segment, "data-slot": "date-segment", className: segment.type !== "literal" ? SEGMENT : dateTimeBreak ? LITERAL_BREAK : LITERAL, children: dateTimeBreak ? breakAtLastSpace(segment.text) : undefined }));
|
|
243
|
+
const shown = segment.type === "minute" && minuteStep && minuteStep > 1 ? (_jsx(SteppedMinute, { segment: segment, step: minuteStep, children: element })) : (element);
|
|
244
|
+
return watcher ? _jsxs(_Fragment, { children: [watcher, shown] }) : shown;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Keeps the field's form input (React Aria's hidden `<input name>`, which a native form submit and `FormData` read) at
|
|
248
|
+
* the value the field reports. React Aria writes the date it holds into that input, and while a date is
|
|
249
|
+
* typed in part, impossible or emptied around a hidden part the field holds its last complete date underneath (so the
|
|
250
|
+
* typed parts stay on screen) and reports null: a hideYear 10.02 edited to 30.02 held 2000-02-03, a date the user never
|
|
251
|
+
* saw, and a native submit sent it. The input now says "" whenever the field reports null, and the reported date
|
|
252
|
+
* otherwise, which is React Aria's own string for it, so a complete date's DOM is unchanged.
|
|
253
|
+
*
|
|
254
|
+
* React Aria re-renders that input whenever its field state changes, and this component (among the segments, under the
|
|
255
|
+
* same state) with it, so the value is set again in the same commit, after React has written its own; on the first
|
|
256
|
+
* commit the input's ref is attached after these layout effects run, so the passive effect sets it then. The input's
|
|
257
|
+
* name, its native validity (the field's message under validationBehavior "native") and the server errors a Form keys
|
|
258
|
+
* by name stay React Aria's.
|
|
259
|
+
*/
|
|
260
|
+
function FormValue({ value }) {
|
|
261
|
+
// The field's input props, with the ref React Aria puts on its hidden input (a date field's, or the one a picker's
|
|
262
|
+
// field makes for itself).
|
|
263
|
+
const input = React.useContext(InputContext);
|
|
264
|
+
const sync = () => {
|
|
265
|
+
const ref = input?.ref;
|
|
266
|
+
const element = ref && typeof ref === "object" ? ref.current : null;
|
|
267
|
+
if (element && element.value !== value)
|
|
268
|
+
element.value = value;
|
|
269
|
+
};
|
|
270
|
+
React.useLayoutEffect(sync);
|
|
271
|
+
React.useEffect(sync);
|
|
272
|
+
return null;
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* A DS Form's reset clears what the field shows under `validationBehavior="native"`, as it does under `aria`. There React Aria shows a field's message from the last submit or
|
|
276
|
+
* commit, and clears it on a form reset only when the reset comes from a user event (a reset button, a press that
|
|
277
|
+
* calls `form.reset()`): a programmatic `form.reset()` outside one (after an `await`, in a timer) is passed over, so
|
|
278
|
+
* that React's automatic reset after a form action keeps the server's errors. The value went back to the default,
|
|
279
|
+
* but "Incomplete date: enter the month, or clear the field." (or "February has 29 days.", or the browser's required message)
|
|
280
|
+
* stayed on screen, the field still drawn invalid, until the next interaction.
|
|
281
|
+
*
|
|
282
|
+
* The DS Form tells every field of each reset (`resetCount`, for any reset), so here the field clears what it shows,
|
|
283
|
+
* as React Aria does for a user's reset: its next submit or commit shows it again if it still applies. A message
|
|
284
|
+
* that is a server error the form holds (`validationErrors`) is left to React Aria, as React Aria leaves it. Outside a
|
|
285
|
+
* DS Form, and under `aria` (where the DS shows the messages itself, on its own timing), nothing here runs.
|
|
286
|
+
*/
|
|
287
|
+
function ResetWatcher() {
|
|
288
|
+
const state = useFieldState();
|
|
289
|
+
const { resetCount } = React.useContext(FormSubmittedContext);
|
|
290
|
+
const form = React.useContext(FormContext);
|
|
291
|
+
const serverErrors = React.useContext(FormValidationContext);
|
|
292
|
+
const seen = React.useRef(resetCount);
|
|
293
|
+
React.useLayoutEffect(() => {
|
|
294
|
+
if (seen.current === resetCount)
|
|
295
|
+
return;
|
|
296
|
+
seen.current = resetCount;
|
|
297
|
+
const shown = state?.displayValidation;
|
|
298
|
+
if (form?.validationBehavior !== "native" || !shown?.isInvalid || !state?.resetValidation)
|
|
299
|
+
return;
|
|
300
|
+
const server = new Set(Object.values(serverErrors ?? {}).flat());
|
|
301
|
+
if (shown.validationErrors.some((message) => server.has(message)))
|
|
302
|
+
return;
|
|
303
|
+
state.resetValidation();
|
|
304
|
+
});
|
|
305
|
+
return null;
|
|
306
|
+
}
|
|
307
|
+
/** Calendars whose months are the Gregorian ones, so the DS's month names fit them (and a month–day is typed in them). */
|
|
308
|
+
export const GREGORIAN_MONTHS = new Set(["gregory", "buddhist", "roc", "japanese"]);
|
|
309
|
+
/**
|
|
310
|
+
* A day past the month's end (31.11) stays on screen as typed and the value stays empty, so the field can
|
|
311
|
+
* say why ("November has 30 days."). React Aria would clamp it to 30.11 when focus leaves the field
|
|
312
|
+
* (`confirmPlaceholder`) and report that date as if the user had typed it; for an impossible date that
|
|
313
|
+
* step is skipped. So it is for a part typed out of its range: a month left at "00" would become
|
|
314
|
+
* January, a day "00" the 1st and a 12-hour "0" one o'clock; it stays as typed, with what is missing. Every other use
|
|
315
|
+
* of it (filling an untouched AM/PM) still runs.
|
|
316
|
+
*/
|
|
317
|
+
export function OverflowWatcher({ fixed, onReport }) {
|
|
318
|
+
const state = useFieldState();
|
|
319
|
+
const { locale } = useLocale();
|
|
320
|
+
const calendar = state?.calendar ?? new GregorianCalendar();
|
|
321
|
+
// A hidden year not set yet (the commit before FixedYear sets it) counts as the one it is about to be.
|
|
322
|
+
const held = fixed?.year !== undefined ? heldYear(calendar, fixed.year) : undefined;
|
|
323
|
+
// Each part as the field holds it: a hidden one too, so a hidden year is the year on the field (2543 in
|
|
324
|
+
// the Buddhist calendar, or an app's own), never the Gregorian number counted in another calendar.
|
|
325
|
+
const read = (type) => {
|
|
326
|
+
const segment = state?.segments.find((s) => s.type === type);
|
|
327
|
+
if (segment && isFilled(segment))
|
|
328
|
+
return segment.value;
|
|
329
|
+
if (type === "year")
|
|
330
|
+
return held?.year;
|
|
331
|
+
if (type === "day")
|
|
332
|
+
return fixed?.day;
|
|
333
|
+
return undefined;
|
|
334
|
+
};
|
|
335
|
+
const day = read("day");
|
|
336
|
+
const month = read("month");
|
|
337
|
+
const year = read("year");
|
|
338
|
+
let message = null;
|
|
339
|
+
// Judged on what is on screen, not on the committed value: editing a saved 31.10 to month 11 shows 31.11
|
|
340
|
+
// while the state still holds 31.10, and that must not be clamped to 30.11 on blur either.
|
|
341
|
+
if (day !== undefined && month !== undefined && year !== undefined) {
|
|
342
|
+
// Counted in the field's own calendar (its segments are typed in it), with the era it holds, if any.
|
|
343
|
+
const eraSegment = state?.segments.find((s) => s.type === "era");
|
|
344
|
+
const era = eraSegment && isFilled(eraSegment) ? calendar.getEras()[eraSegment.value] : held?.era;
|
|
345
|
+
const first = era !== undefined ? new CalendarDate(calendar, era, year, month, 1) : new CalendarDate(calendar, year, month, 1);
|
|
346
|
+
const days = calendar.getDaysInMonth(first);
|
|
347
|
+
if (day > days) {
|
|
348
|
+
// Named with the DS's own words, never Intl's: see monthHasDaysLabel. Only a Gregorian month has one
|
|
349
|
+
// (the Buddhist, ROC and Japanese calendars count the same months); in any other calendar it is "this month".
|
|
350
|
+
message = monthHasDaysLabel(locale, days, GREGORIAN_MONTHS.has(calendar.identifier) ? month : undefined);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
const overflowing = message !== null;
|
|
354
|
+
// A date or time typed in part: React Aria keeps the last complete value until every segment is cleared
|
|
355
|
+
// (and a hidden year never is), so "mm/1" would still hold the old month and "10:––" the old minutes. Judged on the
|
|
356
|
+
// visible parts only.
|
|
357
|
+
const shape = dateShape(state?.segments ?? [], fixed);
|
|
358
|
+
if (message === null && shape.shape === "incomplete")
|
|
359
|
+
message = incompleteMessage(shape.missing, locale, shape.kind);
|
|
360
|
+
const whole = incompleteMessage(shape.parts, locale, shape.kind);
|
|
361
|
+
const outOfRange = (state?.segments ?? []).some((segment) => segment.isEditable && !segment.isPlaceholder && segment.type !== "literal" && !isFilled(segment));
|
|
362
|
+
const asTyped = overflowing || outOfRange;
|
|
363
|
+
React.useLayoutEffect(() => {
|
|
364
|
+
if (!state || !asTyped)
|
|
365
|
+
return;
|
|
366
|
+
const confirm = state.confirmPlaceholder;
|
|
367
|
+
state.confirmPlaceholder = () => { };
|
|
368
|
+
return () => {
|
|
369
|
+
state.confirmPlaceholder = confirm;
|
|
370
|
+
};
|
|
371
|
+
});
|
|
372
|
+
// Told in this commit's layout phase, before the field's own effects run, and only when it changes: the field then
|
|
373
|
+
// judges the value it reports on these parts, never on the ones of the render before.
|
|
374
|
+
const report = React.useRef(onReport);
|
|
375
|
+
report.current = onReport;
|
|
376
|
+
React.useLayoutEffect(() => {
|
|
377
|
+
report.current?.({ message, overflowing, shape: shape.shape, whole });
|
|
378
|
+
}, [message, overflowing, shape.shape, whole]);
|
|
379
|
+
return null;
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* Whether a part holds a value React Aria can use. A first digit can leave a part out of its range while
|
|
383
|
+
* the user is still typing it: a first "0" shows "00" in a month or a day, "0" in a year and "0" in the hour of a
|
|
384
|
+
* 12-hour clock (which runs 1–12), none of them a value and none with its placeholder (React Aria keeps the old date
|
|
385
|
+
* until they are one). Such a part is as good as missing.
|
|
386
|
+
*/
|
|
387
|
+
export function isFilled(segment) {
|
|
388
|
+
if (segment.isPlaceholder || segment.value == null)
|
|
389
|
+
return false;
|
|
390
|
+
if (segment.minValue !== undefined && segment.value < segment.minValue)
|
|
391
|
+
return false;
|
|
392
|
+
if (segment.maxValue !== undefined && segment.value > segment.maxValue)
|
|
393
|
+
return false;
|
|
394
|
+
return true;
|
|
395
|
+
}
|
|
396
|
+
const DATE_PARTS = new Set(["day", "month", "year"]);
|
|
397
|
+
const TIME_PARTS = new Set(["hour", "minute", "second"]);
|
|
398
|
+
/**
|
|
399
|
+
* The shape of a field's visible parts: day, month and year, less the hidden ones (a month–day's year, a
|
|
400
|
+
* month's day), and hour, minute and second. `parts` is every visible part and `missing` the empty ones, both in the
|
|
401
|
+
* field's (the locale's) order, as the message names them.
|
|
402
|
+
*
|
|
403
|
+
* A part typed out of its range ("00" for a month) is missing too (see {@link isFilled}).
|
|
404
|
+
*
|
|
405
|
+
* The AM/PM of a 12-hour clock goes with its hour: React Aria fills it when the hour is typed, so it counts as missing
|
|
406
|
+
* only when the hour is typed and it is not ("10:30 ––"), and an AM/PM left over in a field emptied of everything else
|
|
407
|
+
* is an empty field (React Aria would keep the old time until it is cleared too).
|
|
408
|
+
*/
|
|
409
|
+
export function dateShape(segments, fixed) {
|
|
410
|
+
const visible = segments.filter((segment) => segment.isEditable && fixed?.[segment.type] === undefined && (DATE_PARTS.has(segment.type) || TIME_PARTS.has(segment.type) || segment.type === "dayPeriod"));
|
|
411
|
+
const core = visible.filter((segment) => segment.type !== "dayPeriod");
|
|
412
|
+
const hasDate = core.some((segment) => DATE_PARTS.has(segment.type));
|
|
413
|
+
const hasTime = core.some((segment) => TIME_PARTS.has(segment.type));
|
|
414
|
+
const kind = hasDate && hasTime ? "dateTime" : hasTime ? "time" : "date";
|
|
415
|
+
const parts = core.map((segment) => segment.type);
|
|
416
|
+
const hourTyped = core.some((segment) => segment.type === "hour" && !segment.isPlaceholder);
|
|
417
|
+
const missing = visible
|
|
418
|
+
.filter((segment) => !isFilled(segment) && (segment.type !== "dayPeriod" || hourTyped))
|
|
419
|
+
.map((segment) => segment.type);
|
|
420
|
+
if (core.length === 0 || missing.length === 0)
|
|
421
|
+
return { shape: "complete", missing: [], parts, kind };
|
|
422
|
+
const emptyCore = core.every((segment) => segment.isPlaceholder);
|
|
423
|
+
return { shape: emptyCore ? "empty" : "incomplete", missing, parts, kind };
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* "Incomplete date: enter the day and month, or clear the field.": the missing parts in the field's order, each in the form the
|
|
427
|
+
* sentence takes (DS strings, not Intl's nominative names), in the locale's sentence for a date, a date and time or a
|
|
428
|
+
* time. A locale without DS words reads the English sentence with the English names.
|
|
429
|
+
*/
|
|
430
|
+
export function incompleteMessage(missing, locale, kind = "date") {
|
|
431
|
+
return dateIncompleteLabel(locale, missing, kind);
|
|
432
|
+
}
|
|
433
|
+
//# sourceMappingURL=segments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segments.js","sourceRoot":"","sources":["../../src/date/segments.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,qBAAqB,EACrB,SAAS,EACT,WAAW,EACX,WAAW,EACX,qBAAqB,EACrB,YAAY,EACZ,qBAAqB,EACrB,SAAS,GACV,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,UAAU,EAAiB,MAAM,yBAAyB,CAAC;AAErG,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAqB,MAAM,SAAS,CAAC;AAEpF;;;GAGG;AACH,MAAM,OA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";\n\nimport * as React from \"react\";\nimport {\n DateFieldStateContext,\n DateInput,\n DateSegment,\n FormContext,\n FormValidationContext,\n InputContext,\n TimeFieldStateContext,\n useLocale,\n} from \"react-aria-components\";\nimport { CalendarDate, GregorianCalendar, toCalendar, type Calendar } from \"@internationalized/date\";\n\nimport { cn } from \"../utils\";\nimport { FormSubmittedContext } from \"../form/validation\";\nimport { dateIncompleteLabel, monthHasDaysLabel, type DatePartName } from \"../i18n\";\n\n/**\n * One segment: the active one fills with the brand colour; an empty one shows its placeholder (\"GG\",\n * \"AA\", \"YYYY\") in the subtlest text, upper-cased because Intl gives \"gg.aa.yyyy\".\n */\nconst SEGMENT =\n \"rounded-ds-small px-px tabular-nums outline-hidden caret-transparent select-none \" +\n \"data-[placeholder]:uppercase data-[placeholder]:text-ds-text-subtlest \" +\n \"data-[focused]:bg-ds-background-brand-bold data-[focused]:text-ds-text-on-brand data-[focused]:data-[placeholder]:text-ds-text-on-brand \" +\n \"data-[disabled]:text-ds-text-disabled\";\n// whitespace-pre: a literal that is only a space (\"10:30 AM\") would otherwise collapse inside the flex row.\nconst LITERAL = \"whitespace-pre px-0 text-ds-text-subtle data-[disabled]:text-ds-text-disabled\";\n/**\n * The separator between a date and its time (\"14.10.2026 10:00\", \"10/14/2026, 10:00 AM\"; see {@link isDateTimeBreak})\n *. The segments never wrap (the field's `whitespace-nowrap`), except after this one's space: pre-wrap\n * keeps the space and makes it the one place the line may break, so a field too narrow for both (a range with hours\n * in a phone column) puts the time under the date instead of cutting it off, and its min-content is the wider of the\n * two, not both. A field wide enough for both is laid out exactly as before.\n */\nconst LITERAL_BREAK = \"whitespace-pre-wrap px-0 text-ds-text-subtle data-[disabled]:text-ds-text-disabled\";\n\n// Typed from React Aria's own context, so no direct dependency on react-stately is needed.\ntype DateFieldState = NonNullable<React.ContextType<typeof DateFieldStateContext>>;\ntype SegmentState = DateFieldState[\"segments\"][number];\ntype DateSegmentType = SegmentState[\"type\"];\n\n/**\n * A segment the field keeps out of sight with a fixed value: the year of a month–day, the day of a month. The year is a\n * Gregorian one (2000): the field holds it as the same year in its own calendar, era and all (see {@link heldYear}).\n */\nexport type FixedSegments = Partial<Record<\"year\" | \"day\", number>>;\n\n/**\n * The segments kept out of sight for `fixed`: its own, and with a hidden year its era too (a Japanese \"H\", a ROC\n * \"Minguo\"), which names a year that is not shown.\n */\nexport function hiddenSegments(fixed?: FixedSegments): Set<string> {\n const hidden = new Set(Object.keys(fixed ?? {}));\n if (hidden.has(\"year\")) hidden.add(\"era\");\n return hidden;\n}\n\n/**\n * The Gregorian year `gregorianYear` as the field's calendar counts it: Gregorian 2000 is 2543 in the\n * Buddhist calendar, Heisei 12 in the Japanese and Minguo 89 in the ROC one, each a leap year with the same months, so\n * 29 February exists. Set as 2000 in those calendars it was 1457 CE, Reiwa 2000 (4018 CE) and 3911 CE, none of them\n * leap, and a valid 29.02 was refused.\n */\nexport function heldYear(calendar: Calendar, gregorianYear: number): { era: string; year: number } {\n const date = toCalendar(new CalendarDate(gregorianYear, 1, 1), calendar);\n return { era: date.era, year: date.year };\n}\n\ntype AnyFieldState = {\n segments: SegmentState[];\n setSegment: ((type: \"era\", value: string) => void) & ((type: DateSegmentType, value: number) => void);\n confirmPlaceholder: () => void;\n value: unknown;\n isDisabled?: boolean;\n /** The calendar the segments are typed in (a date field's; React Aria takes it from the locale). */\n calendar?: Calendar;\n /** What the field shows of its validation, and the form reset's way to clear it (React Aria's form validation state). */\n displayValidation?: { isInvalid: boolean; validationErrors: string[] };\n resetValidation?: () => void;\n};\n\nfunction useFieldState(): AnyFieldState | null {\n const date = React.useContext(DateFieldStateContext) as AnyFieldState | null;\n const time = React.useContext(TimeFieldStateContext) as AnyFieldState | null;\n return date ?? time;\n}\n\n/**\n * Which of React Aria's segments show when some are hidden. A hidden segment takes one separator with it:\n * the one before it when no shown part follows it (the year of a month–day: \"dd. mm. yyyy.\" → \"dd. mm.\"; with its\n * era after it, \"mm/dd/yyyy Minguo\" → \"mm/dd\"), otherwise the one after it (the day of a month: \"dd.mm.yyyy г.\" →\n * \"mm.yyyy г.\"). Leading and closing literals (\".\" in me, \" г.\" in bg) stay, so every locale keeps its own full-date\n * style.\n */\nexport function visibleIndexes(segments: readonly SegmentState[], hidden: ReadonlySet<string>): Set<number> {\n const visible = new Set(segments.map((_, index) => index));\n const parts = segments.map((segment, index) => ({ segment, index })).filter(({ segment }) => segment.type !== \"literal\");\n const lastShown = parts.filter(({ segment }) => !hidden.has(segment.type)).at(-1)?.index ?? -1;\n for (const { segment, index } of parts) {\n if (!hidden.has(segment.type)) continue;\n visible.delete(index);\n const step = index > lastShown ? -1 : 1;\n for (let i = index + step; i >= 0 && i < segments.length && segments[i]!.type === \"literal\"; i += step) {\n visible.delete(i);\n }\n // A hidden year also takes its own word with it (\" г.\" in bg and mk); a closing \".\" of the date stays.\n if (segment.type === \"year\") {\n for (let i = index + 1; i < segments.length && segments[i]!.type === \"literal\"; i++) {\n if (/\\p{L}/u.test(segments[i]!.text)) visible.delete(i);\n }\n }\n }\n return visible;\n}\n\n/**\n * Keeps a hidden segment filled. React Aria commits a value only when every segment is set, so the\n * year of a month–day must be set for it: the user never sees or types it. The month stays empty\n * until the user types one, so a day picked first never turns into January.\n */\nfunction Fixed({ segment, value }: { segment: SegmentState; value: number }) {\n const state = useFieldState();\n React.useLayoutEffect(() => {\n if (state && segment.isPlaceholder && !state.isDisabled) state.setSegment(segment.type, value);\n });\n return null;\n}\n\n/**\n * Keeps the hidden year of a month–day at the Gregorian year given, as the field's calendar counts it (see\n * {@link heldYear}). In a calendar with eras the era is set first, in its own commit: React Aria would otherwise give the\n * year the era of today (Reiwa), and two segments set in one handler would both start from the same old value.\n */\nfunction FixedYear({ segment, gregorianYear }: { segment: SegmentState; gregorianYear: number }) {\n const state = useFieldState();\n React.useLayoutEffect(() => {\n if (!state || !segment.isPlaceholder || state.isDisabled) return;\n const calendar = state.calendar ?? new GregorianCalendar();\n const held = heldYear(calendar, gregorianYear);\n const eras = calendar.getEras();\n const eraSegment = state.segments.find((s) => s.type === \"era\");\n if (eras.length > 1 && eraSegment && (eraSegment.isPlaceholder || eras[eraSegment.value!] !== held.era)) {\n state.setSegment(\"era\", held.era);\n return;\n }\n state.setSegment(\"year\", held.year);\n });\n return null;\n}\n\n/** Arrow keys step the minutes by `step` (15 or 30); typed minutes are left as typed. */\nfunction SteppedMinute({ segment, step, children }: { segment: SegmentState; step: number; children: React.ReactNode }) {\n const state = useFieldState();\n return (\n <span\n className=\"contents\"\n onKeyDownCapture={(event) => {\n if (!state || (event.key !== \"ArrowUp\" && event.key !== \"ArrowDown\")) return;\n const current = segment.isPlaceholder ? null : (segment.value ?? 0);\n const up = event.key === \"ArrowUp\";\n const next =\n current === null ? 0 : up ? (Math.floor(current / step) + 1) * step : (Math.ceil(current / step) - 1) * step;\n event.preventDefault();\n event.stopPropagation();\n state.setSegment(\"minute\", ((next % 60) + 60) % 60);\n }}\n >\n {children}\n </span>\n );\n}\n\nexport type SegmentsProps = {\n /** Kept out of sight with a fixed value (month–day: `{ year: 2000 }`; month: `{ day: 1 }`). */\n fixed?: FixedSegments;\n minuteStep?: number;\n slot?: \"start\" | \"end\";\n className?: string;\n /**\n * Told, in the commit that changes it, what the typed parts amount to: what is wrong with them (a day\n * past the month's end, or a value typed in part, \"Incomplete date: enter the month, or clear the field.\"), whether they are\n * all empty, partly filled or all filled, and the message naming every part (said when a whole half of a range is\n * left empty while the other half stands). Told from a layout effect, so it reaches the field before the field's\n * own effects in that commit read it: the value the field reports always matches the parts on screen.\n */\n onReport?: (report: SegmentsReport) => void;\n /**\n * The field's `id`, put on its first segment that takes typing, so `getElementById(id).focus()`\n * lands in the field. Left out, the segments are as before.\n */\n id?: string;\n /**\n * What the field's form input holds: the value the field reports, as an ISO string, or \"\" while it\n * reports none (a date typed in part, impossible, or emptied around a hidden part). See {@link FormValue}.\n */\n formValue?: string;\n};\n\n/** The typed segments of a date or time field, in the locale's order and with its separators. */\nexport function Segments({ fixed, minuteStep, slot, className, onReport, id, formValue }: SegmentsProps) {\n const hidden = React.useMemo(() => hiddenSegments(fixed), [fixed]);\n const { direction } = useLocale();\n // An LTR locale's segments are laid out left to right on an RTL page too: React Aria isolates only the\n // hour to minute, so the AM/PM beside them (\"10:30 AM\", \"10:30 π.μ.\") went to the other side (\"AM 10:30\"). The\n // segments keep the page's side of the box (the right, under an RTL parent), where they were. An RTL locale's\n // follow the page, as before.\n const ltr = direction === \"ltr\";\n\n return (\n // Inline flow, not flex: React Aria wraps times in bidi isolates (U+2066…U+2069) so \"10:30\" reads left to\n // right on an RTL page too; flex items would ignore them and lay the segments out as \"30:10\".\n <DateInput\n slot={slot}\n data-slot=\"date-input\"\n dir={ltr ? \"ltr\" : undefined}\n className={cn(\"min-w-0 flex-1 overflow-hidden whitespace-nowrap text-body\", ltr && \"[:dir(rtl)>&]:text-end\", className)}\n >\n {(segment) => <Segment segment={segment} fixed={fixed} hidden={hidden} minuteStep={minuteStep} onReport={onReport} id={id} formValue={formValue} slot={slot} />}\n </DateInput>\n );\n}\n\n/**\n * The first segment the user types in, in DOM order (the locale's): not a separator, not a hidden one (the year of a\n * month–day, the day of a month). The field's `id` goes on it, so focusing that id reaches the field.\n */\nexport function firstTypedIndex(segments: readonly SegmentState[], hidden: ReadonlySet<string>): number {\n return segments.findIndex((segment) => segment.isEditable && segment.type !== \"literal\" && !hidden.has(segment.type));\n}\n\nconst DATE_SIDE = new Set<string>([\"era\", \"year\", \"month\", \"day\"]);\nconst TIME_SIDE = new Set<string>([\"hour\", \"minute\", \"second\", \"dayPeriod\", \"timeZoneName\"]);\n\n/** A space the line may break at: any white space but the no-break ones (U+00A0, U+2007, U+202F). */\nconst BREAKING_SPACE = /[^\\S\\u00a0\\u2007\\u202f]/;\n\n/**\n * Whether the segment at `index` is the separator between the date and the time of a date-time: a\n * literal with a space to break at (\", \", \" \", \"، \"; not the bidi isolate React Aria puts before a time as a literal of\n * its own), a date part on one side and a time part on the other, in the locale's order (time first works too). Only\n * there may the segments wrap (see `LITERAL_BREAK`); a date alone, a time alone, and the AM/PM beside its hour never do.\n */\nexport function isDateTimeBreak(segments: readonly Pick<SegmentState, \"type\" | \"text\">[], index: number): boolean {\n const segment = segments[index];\n if (segment?.type !== \"literal\" || !BREAKING_SPACE.test(segment.text)) return false;\n const side = (step: 1 | -1) => {\n for (let at = index + step; at >= 0 && at < segments.length; at += step) {\n const type = segments[at]!.type;\n if (type === \"literal\") continue;\n return DATE_SIDE.has(type) ? \"date\" : TIME_SIDE.has(type) ? \"time\" : null;\n }\n return null;\n };\n const before = side(-1);\n const after = side(1);\n return before !== null && after !== null && before !== after;\n}\n\n/**\n * The date–time separator with only its last space left to break at: the\n * earlier ones become no-break spaces, so a time that goes under its date starts the line with its hour, not with the\n * rest of the separator (\". u \" in bs, \" г., \" in bg and mk, \" klo \" in fi left \"u 10:00\" or \"г., 10:00\" below).\n */\nexport function breakAtLastSpace(text: string): string {\n const breaking = new RegExp(BREAKING_SPACE.source, \"g\");\n const last = Math.max(...Array.from(text.matchAll(breaking), (match) => match.index));\n return text.replace(breaking, (space, at: number) => (at === last ? space : \"\\u00a0\"));\n}\n\n/** The ARIA attributes that hold id references; React Aria names a segment with its own id in `aria-labelledby`. */\nconst ID_REFERENCES = [\n \"aria-labelledby\",\n \"aria-describedby\",\n \"aria-controls\",\n \"aria-owns\",\n \"aria-details\",\n \"aria-errormessage\",\n \"aria-flowto\",\n \"aria-activedescendant\",\n] as const;\n\n/**\n * A segment's props with the app's `id` in place of React Aria's own, and every reference to the old id swapped\n * too: the segment is named by `aria-labelledby=\"<its own id> <field label id>\"` (\"day, Start date\"), and a\n * reference to an id no element has would drop the segment's name.\n *\n * React Aria's `useLabels` puts that self-reference first whenever a segment has both `aria-label` (its own name)\n * and `aria-labelledby`. Until its ids settle (on the server, and in the first client render) the self-reference is\n * a second id of React Aria's that is not the element's, so the first token is swapped as well: the server HTML\n * then names the segment fully, and hydration sees the same attribute.\n */\nexport function withId<P extends { id?: string; \"aria-label\"?: string; \"aria-labelledby\"?: string }>(props: P, id: string): P {\n const own = props.id;\n const next: Record<string, unknown> = { ...props, id };\n for (const key of ID_REFERENCES) {\n const value = next[key];\n if (typeof value !== \"string\" || !value.trim()) continue;\n const refs = value.trim().split(/\\s+/).map((ref) => (own && ref === own ? id : ref));\n if (key === \"aria-labelledby\" && props[\"aria-label\"]) refs[0] = id;\n next[key] = [...new Set(refs)].join(\" \");\n }\n return next as P;\n}\n\nfunction Segment({ segment, fixed, hidden, minuteStep, onReport, id, formValue, slot }: {\n segment: SegmentState; fixed?: FixedSegments; hidden: ReadonlySet<string>; minuteStep?: number; onReport?: (report: SegmentsReport) => void; id?: string; formValue?: string;\n slot?: \"start\" | \"end\";\n}) {\n const state = useFieldState();\n const index = state ? state.segments.indexOf(segment) : -1;\n // Only with an `id`, so a field without one renders exactly as before.\n const targetId = id !== undefined && state && index >= 0 && index === firstTypedIndex(state.segments, hidden) ? id : undefined;\n // The watcher needs the field's state, which only exists inside DateInput: it rides along with the first segment.\n const watcher = index === 0 ? (\n <>\n <OverflowWatcher fixed={fixed} onReport={onReport} />\n {formValue !== undefined && <FormValue value={formValue} />}\n {/* A range's two halves share one validation state: its start half clears it. */}\n {slot !== \"end\" && <ResetWatcher />}\n </>\n ) : null;\n if (hidden.has(segment.type)) {\n // The era of a hidden year is set with the year (FixedYear).\n const keep =\n segment.type === \"year\" ? <FixedYear segment={segment} gregorianYear={fixed!.year!} />\n : segment.type === \"day\" ? <Fixed segment={segment} value={fixed!.day!} />\n : null;\n return <>{watcher}{keep}</>;\n }\n if (hidden.size && state && index >= 0 && !visibleIndexes(state.segments, hidden).has(index)) return watcher;\n const dateTimeBreak = segment.type === \"literal\" && state !== null && isDateTimeBreak(state.segments, index);\n const element = (\n <DateSegment\n // The id is set on the element itself: React Aria's prop merge would swap it for its own on the server.\n {...(targetId !== undefined ? { render: (props: React.ComponentProps<\"span\">) => <span {...withId(props, targetId)} /> } : null)}\n segment={segment}\n data-slot=\"date-segment\"\n className={segment.type !== \"literal\" ? SEGMENT : dateTimeBreak ? LITERAL_BREAK : LITERAL}\n >\n {dateTimeBreak ? breakAtLastSpace(segment.text) : undefined}\n </DateSegment>\n );\n const shown = segment.type === \"minute\" && minuteStep && minuteStep > 1 ? (\n <SteppedMinute segment={segment} step={minuteStep}>{element}</SteppedMinute>\n ) : (\n element\n );\n return watcher ? <>{watcher}{shown}</> : shown;\n}\n\n/**\n * Keeps the field's form input (React Aria's hidden `<input name>`, which a native form submit and `FormData` read) at\n * the value the field reports. React Aria writes the date it holds into that input, and while a date is\n * typed in part, impossible or emptied around a hidden part the field holds its last complete date underneath (so the\n * typed parts stay on screen) and reports null: a hideYear 10.02 edited to 30.02 held 2000-02-03, a date the user never\n * saw, and a native submit sent it. The input now says \"\" whenever the field reports null, and the reported date\n * otherwise, which is React Aria's own string for it, so a complete date's DOM is unchanged.\n *\n * React Aria re-renders that input whenever its field state changes, and this component (among the segments, under the\n * same state) with it, so the value is set again in the same commit, after React has written its own; on the first\n * commit the input's ref is attached after these layout effects run, so the passive effect sets it then. The input's\n * name, its native validity (the field's message under validationBehavior \"native\") and the server errors a Form keys\n * by name stay React Aria's.\n */\nfunction FormValue({ value }: { value: string }) {\n // The field's input props, with the ref React Aria puts on its hidden input (a date field's, or the one a picker's\n // field makes for itself).\n const input = React.useContext(InputContext) as { ref?: React.Ref<HTMLInputElement> } | null;\n const sync = () => {\n const ref = input?.ref;\n const element = ref && typeof ref === \"object\" ? ref.current : null;\n if (element && element.value !== value) element.value = value;\n };\n React.useLayoutEffect(sync);\n React.useEffect(sync);\n return null;\n}\n\n/**\n * A DS Form's reset clears what the field shows under `validationBehavior=\"native\"`, as it does under `aria`. There React Aria shows a field's message from the last submit or\n * commit, and clears it on a form reset only when the reset comes from a user event (a reset button, a press that\n * calls `form.reset()`): a programmatic `form.reset()` outside one (after an `await`, in a timer) is passed over, so\n * that React's automatic reset after a form action keeps the server's errors. The value went back to the default,\n * but \"Incomplete date: enter the month, or clear the field.\" (or \"February has 29 days.\", or the browser's required message)\n * stayed on screen, the field still drawn invalid, until the next interaction.\n *\n * The DS Form tells every field of each reset (`resetCount`, for any reset), so here the field clears what it shows,\n * as React Aria does for a user's reset: its next submit or commit shows it again if it still applies. A message\n * that is a server error the form holds (`validationErrors`) is left to React Aria, as React Aria leaves it. Outside a\n * DS Form, and under `aria` (where the DS shows the messages itself, on its own timing), nothing here runs.\n */\nfunction ResetWatcher() {\n const state = useFieldState();\n const { resetCount } = React.useContext(FormSubmittedContext);\n const form = React.useContext(FormContext) as { validationBehavior?: \"aria\" | \"native\" } | null;\n const serverErrors = React.useContext(FormValidationContext);\n const seen = React.useRef(resetCount);\n React.useLayoutEffect(() => {\n if (seen.current === resetCount) return;\n seen.current = resetCount;\n const shown = state?.displayValidation;\n if (form?.validationBehavior !== \"native\" || !shown?.isInvalid || !state?.resetValidation) return;\n const server = new Set(Object.values(serverErrors ?? {}).flat());\n if (shown.validationErrors.some((message) => server.has(message))) return;\n state.resetValidation();\n });\n return null;\n}\n\n/** Calendars whose months are the Gregorian ones, so the DS's month names fit them (and a month–day is typed in them). */\nexport const GREGORIAN_MONTHS: ReadonlySet<string> = new Set([\"gregory\", \"buddhist\", \"roc\", \"japanese\"]);\n\n/**\n * A day past the month's end (31.11) stays on screen as typed and the value stays empty, so the field can\n * say why (\"November has 30 days.\"). React Aria would clamp it to 30.11 when focus leaves the field\n * (`confirmPlaceholder`) and report that date as if the user had typed it; for an impossible date that\n * step is skipped. So it is for a part typed out of its range: a month left at \"00\" would become\n * January, a day \"00\" the 1st and a 12-hour \"0\" one o'clock; it stays as typed, with what is missing. Every other use\n * of it (filling an untouched AM/PM) still runs.\n */\nexport function OverflowWatcher({ fixed, onReport }: { fixed?: FixedSegments; onReport?: (report: SegmentsReport) => void }) {\n const state = useFieldState();\n const { locale } = useLocale();\n const calendar = state?.calendar ?? new GregorianCalendar();\n // A hidden year not set yet (the commit before FixedYear sets it) counts as the one it is about to be.\n const held = fixed?.year !== undefined ? heldYear(calendar, fixed.year) : undefined;\n // Each part as the field holds it: a hidden one too, so a hidden year is the year on the field (2543 in\n // the Buddhist calendar, or an app's own), never the Gregorian number counted in another calendar.\n const read = (type: DateSegmentType) => {\n const segment = state?.segments.find((s) => s.type === type);\n if (segment && isFilled(segment)) return segment.value!;\n if (type === \"year\") return held?.year;\n if (type === \"day\") return fixed?.day;\n return undefined;\n };\n const day = read(\"day\");\n const month = read(\"month\");\n const year = read(\"year\");\n let message: string | null = null;\n // Judged on what is on screen, not on the committed value: editing a saved 31.10 to month 11 shows 31.11\n // while the state still holds 31.10, and that must not be clamped to 30.11 on blur either.\n if (day !== undefined && month !== undefined && year !== undefined) {\n // Counted in the field's own calendar (its segments are typed in it), with the era it holds, if any.\n const eraSegment = state?.segments.find((s) => s.type === \"era\");\n const era = eraSegment && isFilled(eraSegment) ? calendar.getEras()[eraSegment.value!] : held?.era;\n const first = era !== undefined ? new CalendarDate(calendar, era, year, month, 1) : new CalendarDate(calendar, year, month, 1);\n const days = calendar.getDaysInMonth(first);\n if (day > days) {\n // Named with the DS's own words, never Intl's: see monthHasDaysLabel. Only a Gregorian month has one\n // (the Buddhist, ROC and Japanese calendars count the same months); in any other calendar it is \"this month\".\n message = monthHasDaysLabel(locale, days, GREGORIAN_MONTHS.has(calendar.identifier) ? month : undefined);\n }\n }\n const overflowing = message !== null;\n // A date or time typed in part: React Aria keeps the last complete value until every segment is cleared\n // (and a hidden year never is), so \"mm/1\" would still hold the old month and \"10:––\" the old minutes. Judged on the\n // visible parts only.\n const shape = dateShape(state?.segments ?? [], fixed);\n if (message === null && shape.shape === \"incomplete\") message = incompleteMessage(shape.missing, locale, shape.kind);\n const whole = incompleteMessage(shape.parts, locale, shape.kind);\n const outOfRange = (state?.segments ?? []).some((segment) => segment.isEditable && !segment.isPlaceholder && segment.type !== \"literal\" && !isFilled(segment));\n const asTyped = overflowing || outOfRange;\n React.useLayoutEffect(() => {\n if (!state || !asTyped) return;\n const confirm = state.confirmPlaceholder;\n state.confirmPlaceholder = () => {};\n return () => {\n state.confirmPlaceholder = confirm;\n };\n });\n // Told in this commit's layout phase, before the field's own effects run, and only when it changes: the field then\n // judges the value it reports on these parts, never on the ones of the render before.\n const report = React.useRef(onReport);\n report.current = onReport;\n React.useLayoutEffect(() => {\n report.current?.({ message, overflowing, shape: shape.shape, whole });\n }, [message, overflowing, shape.shape, whole]);\n return null;\n}\n\n/** What a field's typed parts amount to, told to the field. */\nexport type SegmentsReport = {\n /** A day past the month's end, or what a value typed in part is missing; null when nothing is wrong. */\n message: string | null;\n /** The parts are all filled but name no date (31.11): React Aria keeps its old value, so the field holds none. */\n overflowing: boolean;\n shape: DateShape;\n /** The message naming every visible part. */\n whole: string;\n};\n\n/**\n * Whether a part holds a value React Aria can use. A first digit can leave a part out of its range while\n * the user is still typing it: a first \"0\" shows \"00\" in a month or a day, \"0\" in a year and \"0\" in the hour of a\n * 12-hour clock (which runs 1–12), none of them a value and none with its placeholder (React Aria keeps the old date\n * until they are one). Such a part is as good as missing.\n */\nexport function isFilled(segment: SegmentState) {\n if (segment.isPlaceholder || segment.value == null) return false;\n if (segment.minValue !== undefined && segment.value < segment.minValue) return false;\n if (segment.maxValue !== undefined && segment.value > segment.maxValue) return false;\n return true;\n}\n\n/** Whether a date's or time's visible parts are all empty, partly filled or all filled. */\nexport type DateShape = \"empty\" | \"incomplete\" | \"complete\";\n\n/** What a field types: a date, a date and a time (a range with hours), or a time (TimeField). */\nexport type FieldKind = \"date\" | \"dateTime\" | \"time\";\n\nconst DATE_PARTS = new Set<string>([\"day\", \"month\", \"year\"]);\nconst TIME_PARTS = new Set<string>([\"hour\", \"minute\", \"second\"]);\n\n/**\n * The shape of a field's visible parts: day, month and year, less the hidden ones (a month–day's year, a\n * month's day), and hour, minute and second. `parts` is every visible part and `missing` the empty ones, both in the\n * field's (the locale's) order, as the message names them.\n *\n * A part typed out of its range (\"00\" for a month) is missing too (see {@link isFilled}).\n *\n * The AM/PM of a 12-hour clock goes with its hour: React Aria fills it when the hour is typed, so it counts as missing\n * only when the hour is typed and it is not (\"10:30 ––\"), and an AM/PM left over in a field emptied of everything else\n * is an empty field (React Aria would keep the old time until it is cleared too).\n */\nexport function dateShape(\n segments: readonly SegmentState[],\n fixed?: FixedSegments,\n): { shape: DateShape; missing: DatePartName[]; parts: DatePartName[]; kind: FieldKind } {\n const visible = segments.filter(\n (segment) => segment.isEditable && fixed?.[segment.type as \"year\" | \"day\"] === undefined && (DATE_PARTS.has(segment.type) || TIME_PARTS.has(segment.type) || segment.type === \"dayPeriod\"),\n );\n const core = visible.filter((segment) => segment.type !== \"dayPeriod\");\n const hasDate = core.some((segment) => DATE_PARTS.has(segment.type));\n const hasTime = core.some((segment) => TIME_PARTS.has(segment.type));\n const kind: FieldKind = hasDate && hasTime ? \"dateTime\" : hasTime ? \"time\" : \"date\";\n const parts = core.map((segment) => segment.type as DatePartName);\n const hourTyped = core.some((segment) => segment.type === \"hour\" && !segment.isPlaceholder);\n const missing = visible\n .filter((segment) => !isFilled(segment) && (segment.type !== \"dayPeriod\" || hourTyped))\n .map((segment) => segment.type as DatePartName);\n if (core.length === 0 || missing.length === 0) return { shape: \"complete\", missing: [], parts, kind };\n const emptyCore = core.every((segment) => segment.isPlaceholder);\n return { shape: emptyCore ? \"empty\" : \"incomplete\", missing, parts, kind };\n}\n\n/**\n * \"Incomplete date: enter the day and month, or clear the field.\": the missing parts in the field's order, each in the form the\n * sentence takes (DS strings, not Intl's nominative names), in the locale's sentence for a date, a date and time or a\n * time. A locale without DS words reads the English sentence with the English names.\n */\nexport function incompleteMessage(missing: readonly DatePartName[], locale: string, kind: FieldKind = \"date\") {\n return dateIncompleteLabel(locale, missing, kind);\n}\n"]}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/** The one size scale of the library. */
|
|
3
|
+
export type ComponentSize = "small" | "medium" | "large";
|
|
4
|
+
/**
|
|
5
|
+
* How round a component's corners are: `none` square, `small` to `large` the theme's radius steps, `full` a pill
|
|
6
|
+
* (Radix Themes' scale; HeroUI and Mantine have the same idea with shorter names).
|
|
7
|
+
*/
|
|
8
|
+
export type ComponentRadius = "none" | "small" | "medium" | "large" | "full";
|
|
9
|
+
/**
|
|
10
|
+
* How much components move: `auto` (default) follows the device's "reduce motion" setting; `reduce` keeps only
|
|
11
|
+
* fades and state changes, no movement; `none` turns every transition and animation off. Nothing can turn motion
|
|
12
|
+
* back on for someone whose device asks for less: `auto` never overrides it.
|
|
13
|
+
*/
|
|
14
|
+
export type ComponentMotion = "auto" | "reduce" | "none";
|
|
15
|
+
export type ComponentDefaults = {
|
|
16
|
+
/** The size every component that has one starts from; a component's own `size` wins. */
|
|
17
|
+
size?: ComponentSize;
|
|
18
|
+
/** The corner radius of controls and surfaces; a component's own `radius` wins. */
|
|
19
|
+
radius?: ComponentRadius;
|
|
20
|
+
/** Motion for every component; a component's own `motion` wins (it can still never undo the device's setting). */
|
|
21
|
+
motion?: ComponentMotion;
|
|
22
|
+
};
|
|
23
|
+
/** The defaults in effect here: the provider's, overridden by the nearest component that set its own. */
|
|
24
|
+
export declare function useComponentDefaults(): ComponentDefaults;
|
|
25
|
+
/** Sets defaults for a subtree, over the ones above it (only the keys it is given). */
|
|
26
|
+
export declare function ComponentDefaultsProvider({ value, children }: {
|
|
27
|
+
value: ComponentDefaults;
|
|
28
|
+
children: React.ReactNode;
|
|
29
|
+
}): React.JSX.Element;
|
|
30
|
+
/**
|
|
31
|
+
* The class for a radius, or nothing when neither the component nor a default sets one (the component keeps its own
|
|
32
|
+
* designed radius). Put it after the component's own classes: `cn` lets the later rounded class win.
|
|
33
|
+
*/
|
|
34
|
+
export declare function radiusClass(radius: ComponentRadius | undefined): string | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* A field frame's radius: the frame's class plus `--ds-field-radius`, which the parts inside the frame (addons,
|
|
37
|
+
* steppers, the country button, inline actions) derive their corners from, so they stay inside the frame's curve.
|
|
38
|
+
*/
|
|
39
|
+
export declare function fieldRadiusClass(radius: ComponentRadius | undefined): string | undefined;
|
|
40
|
+
/** The component's radius: its own prop, else the default in effect. */
|
|
41
|
+
export declare function useRadius(own: ComponentRadius | undefined): ComponentRadius | undefined;
|
|
42
|
+
/** A field's size (small, medium or large): its own, else the default in effect. */
|
|
43
|
+
export declare function useFieldSize(own: "small" | "medium" | "large" | undefined): "small" | "medium" | "large";
|
|
44
|
+
/** Props that take a corner radius for the whole component (its frame and parts). */
|
|
45
|
+
export type WithRadius = {
|
|
46
|
+
/** Corner radius: `none`, `small`, `medium` (the design), `large` or `full`. The provider's default otherwise. */
|
|
47
|
+
radius?: ComponentRadius;
|
|
48
|
+
};
|
|
49
|
+
/** Splits `radius` off a component's props, so it reaches the frame through context and never the DOM. */
|
|
50
|
+
export declare function splitRadius<P extends WithRadius>(props: P): [ComponentRadius | undefined, Omit<P, "radius">];
|
|
51
|
+
/** The motion setting in effect here: the nearest component's, else the provider's, else `auto`. */
|
|
52
|
+
export declare function useMotionSetting(): ComponentMotion;
|
|
53
|
+
/** True when this part should not move: the device asks for less, or the setting in effect is `reduce` or `none`. */
|
|
54
|
+
export declare function useReducedMotion(): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* The attribute that lets the CSS follow the setting in effect, for a part rendered elsewhere in the DOM (an
|
|
57
|
+
* overlay in a portal): spread it on that part's root. Empty under `auto`.
|
|
58
|
+
*/
|
|
59
|
+
export declare function useMotionAttribute(): {
|
|
60
|
+
"data-ds-motion"?: ComponentMotion;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Sets the motion for a subtree: its CSS (through `data-ds-motion` on a layout-neutral wrapper) and its scripted
|
|
64
|
+
* animations (through context). Components with a `motion` prop use it; apps can wrap any region.
|
|
65
|
+
*/
|
|
66
|
+
export declare function MotionScope({ motion, children }: {
|
|
67
|
+
motion: ComponentMotion | undefined;
|
|
68
|
+
children: React.ReactNode;
|
|
69
|
+
}): React.JSX.Element;
|
|
70
|
+
/** Props of a component with its own motion setting. */
|
|
71
|
+
export type WithMotion = {
|
|
72
|
+
/** `auto` (follow the device), `reduce` or `none`, for this component; the provider's setting otherwise. */
|
|
73
|
+
motion?: ComponentMotion;
|
|
74
|
+
};
|