@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,73 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type Key, type Selection } from "react-aria-components";
|
|
3
|
+
import { type IconName } from "../display/icon.js";
|
|
4
|
+
export type GridTileContent = {
|
|
5
|
+
/** The tile's name ("Front view"); also its text for typeahead and screen readers. */
|
|
6
|
+
title: string;
|
|
7
|
+
/** One line of context under the title ("1.9 MB"). */
|
|
8
|
+
meta?: React.ReactNode;
|
|
9
|
+
/** The 4:3 media area: an image or an icon. */
|
|
10
|
+
media?: React.ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* The tile's own buttons (remove, earlier, later), in reading order at the bottom end of the media area.
|
|
13
|
+
* Always shown, so they need no hover and work on touch (40px under a coarse pointer, hit at 44px
|
|
14
|
+
* like a compact Button: `TouchTarget`). Tab moves
|
|
15
|
+
* from the focused tile through its drag handle and actions, then out of the grid; the arrows still
|
|
16
|
+
* move between tiles, and Enter or Space on an action presses it without opening or selecting the tile.
|
|
17
|
+
*/
|
|
18
|
+
actions?: readonly GridTileAction[];
|
|
19
|
+
};
|
|
20
|
+
export type GridTileAction = {
|
|
21
|
+
/** Unique within the tile ("remove"). */
|
|
22
|
+
id: string;
|
|
23
|
+
/**
|
|
24
|
+
* The button's name for screen readers and voice control. Name the tile in it ("Remove photo: Front view"),
|
|
25
|
+
* so each tile's button reads differently in a list of buttons.
|
|
26
|
+
*/
|
|
27
|
+
label: string;
|
|
28
|
+
icon: IconName;
|
|
29
|
+
/** A remove action opens the app's confirm (AlertDialog); the tile does not open or toggle. */
|
|
30
|
+
onPress: () => void;
|
|
31
|
+
/** `danger` for a destructive action: the icon and its hover take the danger colours. */
|
|
32
|
+
tone?: "danger";
|
|
33
|
+
/** Earlier on the first tile, later on the last, or while a save runs. */
|
|
34
|
+
isDisabled?: boolean;
|
|
35
|
+
};
|
|
36
|
+
export type TileGridProps<T> = {
|
|
37
|
+
/** Names the grid ("Product photos"). */
|
|
38
|
+
"aria-label": string;
|
|
39
|
+
items: readonly T[];
|
|
40
|
+
/** The item's stable id; `item.id` by default. */
|
|
41
|
+
itemKey?: (item: T) => Key;
|
|
42
|
+
renderItem: (item: T) => GridTileContent;
|
|
43
|
+
selectionMode?: "none" | "single" | "multiple";
|
|
44
|
+
selectedKeys?: "all" | Iterable<Key>;
|
|
45
|
+
defaultSelectedKeys?: "all" | Iterable<Key>;
|
|
46
|
+
onSelectionChange?: (keys: Selection) => void;
|
|
47
|
+
/** Enter, or a press, opens the tile. */
|
|
48
|
+
onAction?: (key: Key) => void;
|
|
49
|
+
/**
|
|
50
|
+
* Reordering (photos): drag a tile, or focus its handle and use the keyboard. `onReorder` gets the moved
|
|
51
|
+
* keys and the tile they go before or after.
|
|
52
|
+
*/
|
|
53
|
+
dragAndDrop?: {
|
|
54
|
+
onReorder: (keys: Set<Key>, target: {
|
|
55
|
+
key: Key;
|
|
56
|
+
position: "before" | "after";
|
|
57
|
+
}) => void;
|
|
58
|
+
};
|
|
59
|
+
/** Shown when there are no items: an `EmptyState` or a sentence. */
|
|
60
|
+
emptyState?: React.ReactNode;
|
|
61
|
+
/**
|
|
62
|
+
* The grid element. Focusing it focuses the tile React Aria keeps as focused (the next one after a removed tile),
|
|
63
|
+
* so it is the `returnFocusRef` for a confirm whose action removes the tile it was opened from.
|
|
64
|
+
*/
|
|
65
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Selectable tiles in a responsive grid (photos, documents, cards), with arrow keys in
|
|
69
|
+
* both directions, Space to select and Enter to open. Tiles on `ds-surface-raised`, at least 150px
|
|
70
|
+
* wide, a 4:3 media area on `ds-surface-sunken`; a checkbox at the top start when selection is on and a
|
|
71
|
+
* 2px `ds-border-selected` ring on selected tiles.
|
|
72
|
+
*/
|
|
73
|
+
export declare function TileGrid<T extends object>({ "aria-label": label, items, itemKey, renderItem, selectionMode, selectedKeys, defaultSelectedKeys, onSelectionChange, onAction, dragAndDrop, emptyState, ref, }: TileGridProps<T>): React.JSX.Element;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Button as AriaButton, GridList as AriaGridList, GridListItem as AriaGridListItem, useDragAndDrop, } from "react-aria-components";
|
|
5
|
+
import { cn } from "../utils.js";
|
|
6
|
+
import { TouchTarget } from "../action/touch-target.js";
|
|
7
|
+
import { IconGlyph } from "../display/icon.js";
|
|
8
|
+
import { SelectionCheckbox } from "./selection-checkbox.js";
|
|
9
|
+
/**
|
|
10
|
+
* A tile action: 28px, 40px under a coarse pointer, where its invisible `TouchTarget` (the compact Button's)
|
|
11
|
+
* takes the hit area to 44px, 2px past each side. Side by side 4px apart (`gap-ds-050`), two neighbours' hit areas meet
|
|
12
|
+
* in the middle of the gap and do not overlap, so no ButtonGroup-style trade-off is needed and none takes a tap on the
|
|
13
|
+
* other's box. `relative` holds the target; the visible box is unchanged.
|
|
14
|
+
*/
|
|
15
|
+
const TILE_ACTION = "relative grid size-7 place-items-center rounded-ds-control-small bg-ds-surface-raised text-ds-text-subtle shadow-ds-raised outline-hidden cursor-pointer " +
|
|
16
|
+
"pointer-coarse:size-10 data-[hovered]:bg-ds-surface-hovered data-[pressed]:bg-ds-surface-hovered " +
|
|
17
|
+
"data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused " +
|
|
18
|
+
"data-[disabled]:cursor-not-allowed data-[disabled]:text-ds-text-disabled";
|
|
19
|
+
const TILE_ACTION_DANGER = "text-ds-icon-danger data-[hovered]:bg-ds-background-danger data-[pressed]:bg-ds-background-danger";
|
|
20
|
+
/**
|
|
21
|
+
* Selectable tiles in a responsive grid (photos, documents, cards), with arrow keys in
|
|
22
|
+
* both directions, Space to select and Enter to open. Tiles on `ds-surface-raised`, at least 150px
|
|
23
|
+
* wide, a 4:3 media area on `ds-surface-sunken`; a checkbox at the top start when selection is on and a
|
|
24
|
+
* 2px `ds-border-selected` ring on selected tiles.
|
|
25
|
+
*/
|
|
26
|
+
export function TileGrid({ "aria-label": label, items, itemKey = (item) => item.id, renderItem, selectionMode = "none", selectedKeys, defaultSelectedKeys, onSelectionChange, onAction, dragAndDrop, emptyState, ref, }) {
|
|
27
|
+
const onReorder = dragAndDrop?.onReorder;
|
|
28
|
+
const entries = items.map((item) => ({ key: itemKey(item), item }));
|
|
29
|
+
const { dragAndDropHooks } = useDragAndDrop({
|
|
30
|
+
getItems: (keys) => [...keys].map((key) => ({ "text/plain": String(key) })),
|
|
31
|
+
onReorder: (event) => onReorder?.(event.keys, { key: event.target.key, position: event.target.dropPosition === "before" ? "before" : "after" }),
|
|
32
|
+
});
|
|
33
|
+
return (_jsx(AriaGridList, { ref: ref, "aria-label": label, layout: "grid", items: entries, selectionMode: selectionMode, selectionBehavior: "toggle", selectedKeys: selectedKeys, defaultSelectedKeys: defaultSelectedKeys, onSelectionChange: onSelectionChange, onAction: onAction, dragAndDropHooks: onReorder ? dragAndDropHooks : undefined, renderEmptyState: emptyState != null && emptyState !== false ? () => _jsx("div", { className: "col-span-full py-ds-500 text-center text-body text-ds-text-subtle", children: emptyState }) : undefined, "data-slot": "grid-list", className: "grid grid-cols-[repeat(auto-fill,minmax(150px,1fr))] gap-ds-200 outline-hidden", children: ({ key, item }) => {
|
|
34
|
+
const tile = renderItem(item);
|
|
35
|
+
return (_jsx(AriaGridListItem, { id: key, textValue: tile.title, "data-slot": "grid-list-tile", className: cn("group/tile relative flex flex-col overflow-hidden rounded-ds-large bg-ds-surface-raised shadow-ds-raised outline-hidden", (onAction || selectionMode !== "none") && "cursor-pointer data-[hovered]:bg-ds-surface-hovered", "data-[selected]:ring-2 data-[selected]:ring-ds-border-selected",
|
|
36
|
+
// Focus is an inset ring (no outer ring); a selected tile also shows its checkbox, so the two never rely on color alone.
|
|
37
|
+
"data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused", "data-[dragging]:opacity-60 data-[drop-target]:ring-2 data-[drop-target]:ring-ds-border-focused"), children: ({ selectionMode: mode, allowsDragging }) => (_jsxs(_Fragment, { children: [_jsx("div", { "data-slot": "grid-list-media", className: "grid aspect-[4/3] place-items-center overflow-hidden bg-ds-surface-sunken text-ds-text-subtle [&>img]:size-full [&>img]:object-cover", children: tile.media }), mode !== "none" && (_jsx("span", { className: "absolute start-ds-100 top-ds-100 rounded-ds-small bg-ds-surface-raised p-ds-025", children: _jsx(SelectionCheckbox, {}) })), allowsDragging && (
|
|
38
|
+
// No TouchTarget: React Aria sets `pointer-events: none` on a GridList's drag button, so
|
|
39
|
+
// a mouse or a finger never lands on it but on the tile under it, which is what drags; the handle is
|
|
40
|
+
// the keyboard's and assistive tech's way in. The touch target of a drag is the whole tile (150px+).
|
|
41
|
+
_jsx(AriaButton, { slot: "drag", "data-slot": "grid-list-drag", className: "absolute end-ds-100 top-ds-100 grid size-7 place-items-center rounded-ds-control-small bg-ds-surface-raised text-ds-text-subtle outline-hidden data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused", children: _jsx(IconGlyph, { name: "grip-vertical", size: "small" }) })), tile.actions?.length ? (
|
|
42
|
+
// Over the media area (the same 4:3 box), after the checkbox and the handle so Tab reaches them last.
|
|
43
|
+
_jsx("span", { className: "pointer-events-none absolute inset-x-0 top-0 flex aspect-[4/3] items-end justify-end p-ds-100", children: _jsx("span", { "data-slot": "grid-list-actions", className: "pointer-events-auto flex gap-ds-050", children: tile.actions.map((action) => (_jsxs(AriaButton, { "aria-label": action.label, onPress: action.onPress, isDisabled: action.isDisabled, "data-slot": "grid-list-action", "data-action": action.id, className: cn(TILE_ACTION, action.tone === "danger" && TILE_ACTION_DANGER), children: [_jsx(IconGlyph, { name: action.icon, size: "small" }), _jsx(TouchTarget, {})] }, action.id))) }) })) : null, _jsxs("div", { className: "flex min-w-0 flex-col items-start gap-ds-025 p-ds-150", children: [_jsx("bdi", { "data-slot": "grid-list-title", className: "max-w-full truncate text-body-strong text-ds-text", children: tile.title }), tile.meta && _jsx("bdi", { "data-slot": "grid-list-meta", className: "max-w-full truncate text-body-small text-ds-text-subtle", children: tile.meta })] })] })) }));
|
|
44
|
+
} }));
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=grid-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid-list.js","sourceRoot":"","sources":["../../src/collection/grid-list.tsx"],"names":[],"mappings":"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","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport {\n Button as AriaButton,\n GridList as AriaGridList,\n GridListItem as AriaGridListItem,\n useDragAndDrop,\n type Key,\n type Selection,\n} from \"react-aria-components\";\n\nimport { cn } from \"../utils\";\nimport { TouchTarget } from \"../action/touch-target\";\nimport { IconGlyph, type IconName } from \"../display/icon\";\nimport { SelectionCheckbox } from \"./selection-checkbox\";\n\nexport type GridTileContent = {\n /** The tile's name (\"Front view\"); also its text for typeahead and screen readers. */\n title: string;\n /** One line of context under the title (\"1.9 MB\"). */\n meta?: React.ReactNode;\n /** The 4:3 media area: an image or an icon. */\n media?: React.ReactNode;\n /**\n * The tile's own buttons (remove, earlier, later), in reading order at the bottom end of the media area.\n * Always shown, so they need no hover and work on touch (40px under a coarse pointer, hit at 44px\n * like a compact Button: `TouchTarget`). Tab moves\n * from the focused tile through its drag handle and actions, then out of the grid; the arrows still\n * move between tiles, and Enter or Space on an action presses it without opening or selecting the tile.\n */\n actions?: readonly GridTileAction[];\n};\n\nexport type GridTileAction = {\n /** Unique within the tile (\"remove\"). */\n id: string;\n /**\n * The button's name for screen readers and voice control. Name the tile in it (\"Remove photo: Front view\"),\n * so each tile's button reads differently in a list of buttons.\n */\n label: string;\n icon: IconName;\n /** A remove action opens the app's confirm (AlertDialog); the tile does not open or toggle. */\n onPress: () => void;\n /** `danger` for a destructive action: the icon and its hover take the danger colours. */\n tone?: \"danger\";\n /** Earlier on the first tile, later on the last, or while a save runs. */\n isDisabled?: boolean;\n};\n\nexport type TileGridProps<T> = {\n /** Names the grid (\"Product photos\"). */\n \"aria-label\": string;\n items: readonly T[];\n /** The item's stable id; `item.id` by default. */\n itemKey?: (item: T) => Key;\n renderItem: (item: T) => GridTileContent;\n selectionMode?: \"none\" | \"single\" | \"multiple\";\n selectedKeys?: \"all\" | Iterable<Key>;\n defaultSelectedKeys?: \"all\" | Iterable<Key>;\n onSelectionChange?: (keys: Selection) => void;\n /** Enter, or a press, opens the tile. */\n onAction?: (key: Key) => void;\n /**\n * Reordering (photos): drag a tile, or focus its handle and use the keyboard. `onReorder` gets the moved\n * keys and the tile they go before or after.\n */\n dragAndDrop?: { onReorder: (keys: Set<Key>, target: { key: Key; position: \"before\" | \"after\" }) => void };\n /** Shown when there are no items: an `EmptyState` or a sentence. */\n emptyState?: React.ReactNode;\n /**\n * The grid element. Focusing it focuses the tile React Aria keeps as focused (the next one after a removed tile),\n * so it is the `returnFocusRef` for a confirm whose action removes the tile it was opened from.\n */\n ref?: React.Ref<HTMLDivElement>;\n};\n\n/**\n * A tile action: 28px, 40px under a coarse pointer, where its invisible `TouchTarget` (the compact Button's)\n * takes the hit area to 44px, 2px past each side. Side by side 4px apart (`gap-ds-050`), two neighbours' hit areas meet\n * in the middle of the gap and do not overlap, so no ButtonGroup-style trade-off is needed and none takes a tap on the\n * other's box. `relative` holds the target; the visible box is unchanged.\n */\nconst TILE_ACTION =\n \"relative grid size-7 place-items-center rounded-ds-control-small bg-ds-surface-raised text-ds-text-subtle shadow-ds-raised outline-hidden cursor-pointer \" +\n \"pointer-coarse:size-10 data-[hovered]:bg-ds-surface-hovered data-[pressed]:bg-ds-surface-hovered \" +\n \"data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused \" +\n \"data-[disabled]:cursor-not-allowed data-[disabled]:text-ds-text-disabled\";\nconst TILE_ACTION_DANGER = \"text-ds-icon-danger data-[hovered]:bg-ds-background-danger data-[pressed]:bg-ds-background-danger\";\n\n/**\n * Selectable tiles in a responsive grid (photos, documents, cards), with arrow keys in\n * both directions, Space to select and Enter to open. Tiles on `ds-surface-raised`, at least 150px\n * wide, a 4:3 media area on `ds-surface-sunken`; a checkbox at the top start when selection is on and a\n * 2px `ds-border-selected` ring on selected tiles.\n */\nexport function TileGrid<T extends object>({\n \"aria-label\": label,\n items,\n itemKey = (item) => (item as { id: Key }).id,\n renderItem,\n selectionMode = \"none\",\n selectedKeys,\n defaultSelectedKeys,\n onSelectionChange,\n onAction,\n dragAndDrop,\n emptyState,\n ref,\n}: TileGridProps<T>) {\n const onReorder = dragAndDrop?.onReorder;\n const entries = items.map((item) => ({ key: itemKey(item), item }));\n const { dragAndDropHooks } = useDragAndDrop({\n getItems: (keys) => [...keys].map((key) => ({ \"text/plain\": String(key) })),\n onReorder: (event) => onReorder?.(event.keys, { key: event.target.key, position: event.target.dropPosition === \"before\" ? \"before\" : \"after\" }),\n });\n return (\n <AriaGridList\n ref={ref}\n aria-label={label}\n layout=\"grid\"\n items={entries}\n selectionMode={selectionMode}\n selectionBehavior=\"toggle\"\n selectedKeys={selectedKeys}\n defaultSelectedKeys={defaultSelectedKeys}\n onSelectionChange={onSelectionChange}\n onAction={onAction}\n dragAndDropHooks={onReorder ? dragAndDropHooks : undefined}\n renderEmptyState={emptyState != null && emptyState !== false ? () => <div className=\"col-span-full py-ds-500 text-center text-body text-ds-text-subtle\">{emptyState}</div> : undefined}\n data-slot=\"grid-list\"\n className=\"grid grid-cols-[repeat(auto-fill,minmax(150px,1fr))] gap-ds-200 outline-hidden\"\n >\n {({ key, item }) => {\n const tile = renderItem(item);\n return (\n <AriaGridListItem\n id={key}\n textValue={tile.title}\n data-slot=\"grid-list-tile\"\n className={cn(\n \"group/tile relative flex flex-col overflow-hidden rounded-ds-large bg-ds-surface-raised shadow-ds-raised outline-hidden\",\n (onAction || selectionMode !== \"none\") && \"cursor-pointer data-[hovered]:bg-ds-surface-hovered\",\n \"data-[selected]:ring-2 data-[selected]:ring-ds-border-selected\",\n // Focus is an inset ring (no outer ring); a selected tile also shows its checkbox, so the two never rely on color alone.\n \"data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused\",\n \"data-[dragging]:opacity-60 data-[drop-target]:ring-2 data-[drop-target]:ring-ds-border-focused\",\n )}\n >\n {({ selectionMode: mode, allowsDragging }) => (\n <>\n <div data-slot=\"grid-list-media\" className=\"grid aspect-[4/3] place-items-center overflow-hidden bg-ds-surface-sunken text-ds-text-subtle [&>img]:size-full [&>img]:object-cover\">\n {tile.media}\n </div>\n {mode !== \"none\" && (\n <span className=\"absolute start-ds-100 top-ds-100 rounded-ds-small bg-ds-surface-raised p-ds-025\">\n <SelectionCheckbox />\n </span>\n )}\n {allowsDragging && (\n // No TouchTarget: React Aria sets `pointer-events: none` on a GridList's drag button, so\n // a mouse or a finger never lands on it but on the tile under it, which is what drags; the handle is\n // the keyboard's and assistive tech's way in. The touch target of a drag is the whole tile (150px+).\n <AriaButton\n slot=\"drag\"\n data-slot=\"grid-list-drag\"\n className=\"absolute end-ds-100 top-ds-100 grid size-7 place-items-center rounded-ds-control-small bg-ds-surface-raised text-ds-text-subtle outline-hidden data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused\"\n >\n <IconGlyph name=\"grip-vertical\" size=\"small\" />\n </AriaButton>\n )}\n {tile.actions?.length ? (\n // Over the media area (the same 4:3 box), after the checkbox and the handle so Tab reaches them last.\n <span className=\"pointer-events-none absolute inset-x-0 top-0 flex aspect-[4/3] items-end justify-end p-ds-100\">\n <span data-slot=\"grid-list-actions\" className=\"pointer-events-auto flex gap-ds-050\">\n {tile.actions.map((action) => (\n <AriaButton\n key={action.id}\n aria-label={action.label}\n onPress={action.onPress}\n isDisabled={action.isDisabled}\n data-slot=\"grid-list-action\"\n data-action={action.id}\n className={cn(TILE_ACTION, action.tone === \"danger\" && TILE_ACTION_DANGER)}\n >\n <IconGlyph name={action.icon} size=\"small\" />\n <TouchTarget />\n </AriaButton>\n ))}\n </span>\n </span>\n ) : null}\n <div className=\"flex min-w-0 flex-col items-start gap-ds-025 p-ds-150\">\n <bdi data-slot=\"grid-list-title\" className=\"max-w-full truncate text-body-strong text-ds-text\">{tile.title}</bdi>\n {tile.meta && <bdi data-slot=\"grid-list-meta\" className=\"max-w-full truncate text-body-small text-ds-text-subtle\">{tile.meta}</bdi>}\n </div>\n </>\n )}\n </AriaGridListItem>\n );\n }}\n </AriaGridList>\n );\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { Table } from "./table.js";
|
|
2
|
+
export type { TableColumn, TableProps } from "./table.js";
|
|
3
|
+
export { GridList } from "./grid-list-public.js";
|
|
4
|
+
export type { GridListGridProps, GridListProps, GridListStackProps } from "./grid-list-public.js";
|
|
5
|
+
export type { GridTileAction, GridTileContent } from "./grid-list.js";
|
|
6
|
+
export { GridListItem, GridListSection } from "./list.js";
|
|
7
|
+
export type { GridListItemProps, GridListSectionData } from "./list.js";
|
|
8
|
+
export { DataTable } from "./data-table.js";
|
|
9
|
+
export type { DataTableBulkAction, DataTableColumn, DataTableFilter, DataTableProps, DataTableQuery, DataTableResult } from "./data-table.js";
|
|
10
|
+
export type { DataTableView } from "./data-table-url.js";
|
|
11
|
+
export { useDataTableUrl } from "./data-table-url-hook.js";
|
|
12
|
+
export type { DataTableUrlFilter, UseDataTableUrlOptions } from "./data-table-url-hook.js";
|
|
13
|
+
export { Tree } from "./tree.js";
|
|
14
|
+
export type { TreeNode, TreeProps } from "./tree.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// @senvenli/react/collection: Table, DataTable, GridList (rows or tiles) and Tree, built on react-aria-components.
|
|
2
|
+
export { Table } from "./table.js";
|
|
3
|
+
export { GridList } from "./grid-list-public.js";
|
|
4
|
+
export { GridListItem, GridListSection } from "./list.js";
|
|
5
|
+
export { DataTable } from "./data-table.js";
|
|
6
|
+
export { useDataTableUrl } from "./data-table-url-hook.js";
|
|
7
|
+
export { Tree } from "./tree.js";
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/collection/index.ts"],"names":[],"mappings":"AAAA,mHAAmH;AACnH,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAG9C,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAEvD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC","sourcesContent":["// @senvenli/react/collection: Table, DataTable, GridList (rows or tiles) and Tree, built on react-aria-components.\nexport { Table } from \"./table\";\nexport type { TableColumn, TableProps } from \"./table\";\nexport { GridList } from \"./grid-list-public\";\nexport type { GridListGridProps, GridListProps, GridListStackProps } from \"./grid-list-public\";\nexport type { GridTileAction, GridTileContent } from \"./grid-list\";\nexport { GridListItem, GridListSection } from \"./list\";\nexport type { GridListItemProps, GridListSectionData } from \"./list\";\nexport { DataTable } from \"./data-table\";\nexport type { DataTableBulkAction, DataTableColumn, DataTableFilter, DataTableProps, DataTableQuery, DataTableResult } from \"./data-table\";\nexport type { DataTableView } from \"./data-table-url\";\nexport { useDataTableUrl } from \"./data-table-url-hook\";\nexport type { DataTableUrlFilter, UseDataTableUrlOptions } from \"./data-table-url-hook\";\nexport { Tree } from \"./tree\";\nexport type { TreeNode, TreeProps } from \"./tree\";\n"]}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type Key, type Selection } from "react-aria-components";
|
|
3
|
+
export type GridListItemProps = {
|
|
4
|
+
id: Key;
|
|
5
|
+
/** A visual at the start: an Avatar, an icon or a thumbnail. */
|
|
6
|
+
leading?: React.ReactNode;
|
|
7
|
+
/** The one primary line ("Ada Lovelace"); also the row's text for typeahead. */
|
|
8
|
+
title: string;
|
|
9
|
+
/** The context the reader scans for: item, time, place ("Order 1042 · 10:00 · Berlin"). */
|
|
10
|
+
description?: React.ReactNode;
|
|
11
|
+
/** At the end: a Badge for status, then a subtle icon-button menu. */
|
|
12
|
+
trailing?: React.ReactNode;
|
|
13
|
+
/** Makes the row a link to the record. */
|
|
14
|
+
href?: string;
|
|
15
|
+
};
|
|
16
|
+
/** One row: leading visual, two lines of text, trailing status and actions. */
|
|
17
|
+
export declare function GridListItem({ id, leading, title, description, trailing, href }: GridListItemProps): React.JSX.Element;
|
|
18
|
+
/** A titled group of rows ("Today"): a small header on `ds-surface-sunken`. */
|
|
19
|
+
export declare function GridListSection({ title, children }: {
|
|
20
|
+
title: string;
|
|
21
|
+
children: React.ReactNode;
|
|
22
|
+
}): React.JSX.Element;
|
|
23
|
+
export type GridListSectionData<T> = {
|
|
24
|
+
title: string;
|
|
25
|
+
items: readonly T[];
|
|
26
|
+
};
|
|
27
|
+
export type StackListProps<T = never> = {
|
|
28
|
+
/** Names the list ("Today's deliveries"). */
|
|
29
|
+
"aria-label": string;
|
|
30
|
+
/** GridListItem rows, or ListSections of them; or give `items` (or `sections`) and `renderItem`. */
|
|
31
|
+
children?: React.ReactNode;
|
|
32
|
+
items?: readonly T[];
|
|
33
|
+
/** Grouped rows under small headers ("Today", "Tomorrow"). */
|
|
34
|
+
sections?: readonly GridListSectionData<T>[];
|
|
35
|
+
/** One row's content for `items` / `sections`. */
|
|
36
|
+
renderItem?: (item: T) => GridListItemProps;
|
|
37
|
+
selectionMode?: "none" | "single" | "multiple";
|
|
38
|
+
/**
|
|
39
|
+
* How a press selects. `toggle` (default): each row has a checkbox and a press adds or
|
|
40
|
+
* removes it, for picking a set to act on. `replace`: no checkboxes; a press selects that row in place of
|
|
41
|
+
* the last, and with `single` the arrow keys move the selection, for a list that shows one open record
|
|
42
|
+
* beside it (an inbox's conversation). The selected row keeps its marker either way. With `onAction` as
|
|
43
|
+
* well, a press runs the action and selection needs the keyboard (React Aria's replace rule), so a
|
|
44
|
+
* replace list usually leaves `onAction` out.
|
|
45
|
+
*/
|
|
46
|
+
selectionBehavior?: "toggle" | "replace";
|
|
47
|
+
selectedKeys?: "all" | Iterable<Key>;
|
|
48
|
+
defaultSelectedKeys?: "all" | Iterable<Key>;
|
|
49
|
+
onSelectionChange?: (keys: Selection) => void;
|
|
50
|
+
/** Opens the row's record. */
|
|
51
|
+
onAction?: (key: Key) => void;
|
|
52
|
+
/** Shown when there are no rows: an `EmptyState` or a sentence. */
|
|
53
|
+
emptyState?: React.ReactNode;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Records as rows: a leading visual, one primary line and one line of context, trailing status and
|
|
57
|
+
* actions. On `ds-surface-raised` with a raised shadow, 56px minimum rows divided by `ds-border`,
|
|
58
|
+
* sections under small headers. The phone counterpart of Table (use it under 640px) and the default for
|
|
59
|
+
* short feeds.
|
|
60
|
+
*/
|
|
61
|
+
export declare function StackList<T = never>({ "aria-label": label, children, items, sections, renderItem, selectionMode, selectionBehavior, selectedKeys, defaultSelectedKeys, onSelectionChange, onAction, emptyState, }: StackListProps<T>): React.JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { GridList as AriaGridList, GridListHeader as AriaGridListHeader, GridListItem as AriaGridListItem, GridListSection as AriaGridListSection, } from "react-aria-components";
|
|
5
|
+
import { cn } from "../utils.js";
|
|
6
|
+
import { SelectionCheckbox } from "./selection-checkbox.js";
|
|
7
|
+
const ROW = "group/row relative flex min-h-14 items-center gap-ds-150 border-b border-ds-border px-ds-200 py-ds-100 text-body text-ds-text outline-hidden last:border-b-0 " +
|
|
8
|
+
"data-[hovered]:bg-ds-surface-hovered data-[selected]:bg-ds-background-selected " +
|
|
9
|
+
"data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused";
|
|
10
|
+
/** One row: leading visual, two lines of text, trailing status and actions. */
|
|
11
|
+
export function GridListItem({ id, leading, title, description, trailing, href }) {
|
|
12
|
+
return (_jsx(AriaGridListItem, { id: id, href: href, textValue: title, "data-slot": "list-item",
|
|
13
|
+
// React Aria reports hover only on rows that act (open, link or select): those take the pointer.
|
|
14
|
+
className: ({ isHovered }) => cn(ROW, isHovered && "cursor-pointer"), children: ({ selectionMode, selectionBehavior }) => (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": true, "data-slot": "list-item-marker", className: "absolute inset-y-0 start-0 hidden w-0.5 bg-ds-border-selected group-data-[selected]/row:block" }), selectionMode !== "none" && selectionBehavior === "toggle" && _jsx(SelectionCheckbox, {}), leading && _jsx("span", { "data-slot": "list-item-leading", className: "flex shrink-0 items-center", children: leading }), _jsxs("span", { className: "flex min-w-0 flex-1 flex-col items-start", children: [_jsx("bdi", { "data-slot": "list-item-title", className: "max-w-full truncate text-body text-ds-text", children: title }), description && _jsx("bdi", { "data-slot": "list-item-description", className: "max-w-full truncate text-body-small text-ds-text-subtle", children: description })] }), trailing && _jsx("span", { "data-slot": "list-item-trailing", className: "flex shrink-0 items-center gap-ds-100", children: trailing })] })) }));
|
|
15
|
+
}
|
|
16
|
+
/** A titled group of rows ("Today"): a small header on `ds-surface-sunken`. */
|
|
17
|
+
export function GridListSection({ title, children }) {
|
|
18
|
+
return (_jsxs(AriaGridListSection, { "data-slot": "list-section", "aria-label": title, children: [_jsx(AriaGridListHeader, { "data-slot": "list-section-header", className: "border-b border-ds-border bg-ds-surface-sunken px-ds-200 py-ds-075 text-body-small font-medium text-ds-text-subtle", children: title }), children] }));
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Records as rows: a leading visual, one primary line and one line of context, trailing status and
|
|
22
|
+
* actions. On `ds-surface-raised` with a raised shadow, 56px minimum rows divided by `ds-border`,
|
|
23
|
+
* sections under small headers. The phone counterpart of Table (use it under 640px) and the default for
|
|
24
|
+
* short feeds.
|
|
25
|
+
*/
|
|
26
|
+
export function StackList({ "aria-label": label, children, items, sections, renderItem, selectionMode = "none", selectionBehavior = "toggle", selectedKeys, defaultSelectedKeys, onSelectionChange, onAction, emptyState, }) {
|
|
27
|
+
const row = (item) => {
|
|
28
|
+
const props = renderItem(item);
|
|
29
|
+
return _jsx(GridListItem, { ...props }, props.id);
|
|
30
|
+
};
|
|
31
|
+
const content = renderItem && sections
|
|
32
|
+
? sections.map((section, index) => (_jsx(GridListSection, { title: section.title, children: section.items.map(row) }, `${index}-${section.title}`)))
|
|
33
|
+
: renderItem && items
|
|
34
|
+
? items.map(row)
|
|
35
|
+
: children;
|
|
36
|
+
return (_jsx(AriaGridList, { "aria-label": label, selectionMode: selectionMode, selectionBehavior: selectionBehavior, selectedKeys: selectedKeys, defaultSelectedKeys: defaultSelectedKeys, onSelectionChange: onSelectionChange, onAction: onAction, renderEmptyState: emptyState != null && emptyState !== false ? () => _jsx("div", { className: "px-ds-300 py-ds-500 text-center text-body text-ds-text-subtle", children: emptyState }) : undefined, "data-slot": "list", className: "flex flex-col overflow-hidden rounded-ds-large bg-ds-surface-raised shadow-ds-raised outline-hidden", children: content }));
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/collection/list.tsx"],"names":[],"mappings":"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","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport {\n GridList as AriaGridList,\n GridListHeader as AriaGridListHeader,\n GridListItem as AriaGridListItem,\n GridListSection as AriaGridListSection,\n type Key,\n type Selection,\n} from \"react-aria-components\";\n\nimport { cn } from \"../utils\";\nimport { SelectionCheckbox } from \"./selection-checkbox\";\n\nexport type GridListItemProps = {\n id: Key;\n /** A visual at the start: an Avatar, an icon or a thumbnail. */\n leading?: React.ReactNode;\n /** The one primary line (\"Ada Lovelace\"); also the row's text for typeahead. */\n title: string;\n /** The context the reader scans for: item, time, place (\"Order 1042 · 10:00 · Berlin\"). */\n description?: React.ReactNode;\n /** At the end: a Badge for status, then a subtle icon-button menu. */\n trailing?: React.ReactNode;\n /** Makes the row a link to the record. */\n href?: string;\n};\n\nconst ROW =\n \"group/row relative flex min-h-14 items-center gap-ds-150 border-b border-ds-border px-ds-200 py-ds-100 text-body text-ds-text outline-hidden last:border-b-0 \" +\n \"data-[hovered]:bg-ds-surface-hovered data-[selected]:bg-ds-background-selected \" +\n \"data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused\";\n\n/** One row: leading visual, two lines of text, trailing status and actions. */\nexport function GridListItem({ id, leading, title, description, trailing, href }: GridListItemProps) {\n return (\n <AriaGridListItem\n id={id}\n href={href}\n textValue={title}\n data-slot=\"list-item\"\n // React Aria reports hover only on rows that act (open, link or select): those take the pointer.\n className={({ isHovered }) => cn(ROW, isHovered && \"cursor-pointer\")}\n >\n {({ selectionMode, selectionBehavior }) => (\n <>\n <span\n aria-hidden\n data-slot=\"list-item-marker\"\n className=\"absolute inset-y-0 start-0 hidden w-0.5 bg-ds-border-selected group-data-[selected]/row:block\"\n />\n {/* A checkbox only where rows are picked as a set; a replace list shows its one row by the marker. */}\n {selectionMode !== \"none\" && selectionBehavior === \"toggle\" && <SelectionCheckbox />}\n {leading && <span data-slot=\"list-item-leading\" className=\"flex shrink-0 items-center\">{leading}</span>}\n <span className=\"flex min-w-0 flex-1 flex-col items-start\">\n <bdi data-slot=\"list-item-title\" className=\"max-w-full truncate text-body text-ds-text\">{title}</bdi>\n {description && <bdi data-slot=\"list-item-description\" className=\"max-w-full truncate text-body-small text-ds-text-subtle\">{description}</bdi>}\n </span>\n {trailing && <span data-slot=\"list-item-trailing\" className=\"flex shrink-0 items-center gap-ds-100\">{trailing}</span>}\n </>\n )}\n </AriaGridListItem>\n );\n}\n\n/** A titled group of rows (\"Today\"): a small header on `ds-surface-sunken`. */\nexport function GridListSection({ title, children }: { title: string; children: React.ReactNode }) {\n return (\n <AriaGridListSection data-slot=\"list-section\" aria-label={title}>\n <AriaGridListHeader\n data-slot=\"list-section-header\"\n className=\"border-b border-ds-border bg-ds-surface-sunken px-ds-200 py-ds-075 text-body-small font-medium text-ds-text-subtle\"\n >\n {title}\n </AriaGridListHeader>\n {children}\n </AriaGridListSection>\n );\n}\n\nexport type GridListSectionData<T> = { title: string; items: readonly T[] };\n\nexport type StackListProps<T = never> = {\n /** Names the list (\"Today's deliveries\"). */\n \"aria-label\": string;\n /** GridListItem rows, or ListSections of them; or give `items` (or `sections`) and `renderItem`. */\n children?: React.ReactNode;\n items?: readonly T[];\n /** Grouped rows under small headers (\"Today\", \"Tomorrow\"). */\n sections?: readonly GridListSectionData<T>[];\n /** One row's content for `items` / `sections`. */\n renderItem?: (item: T) => GridListItemProps;\n selectionMode?: \"none\" | \"single\" | \"multiple\";\n /**\n * How a press selects. `toggle` (default): each row has a checkbox and a press adds or\n * removes it, for picking a set to act on. `replace`: no checkboxes; a press selects that row in place of\n * the last, and with `single` the arrow keys move the selection, for a list that shows one open record\n * beside it (an inbox's conversation). The selected row keeps its marker either way. With `onAction` as\n * well, a press runs the action and selection needs the keyboard (React Aria's replace rule), so a\n * replace list usually leaves `onAction` out.\n */\n selectionBehavior?: \"toggle\" | \"replace\";\n selectedKeys?: \"all\" | Iterable<Key>;\n defaultSelectedKeys?: \"all\" | Iterable<Key>;\n onSelectionChange?: (keys: Selection) => void;\n /** Opens the row's record. */\n onAction?: (key: Key) => void;\n /** Shown when there are no rows: an `EmptyState` or a sentence. */\n emptyState?: React.ReactNode;\n};\n\n/**\n * Records as rows: a leading visual, one primary line and one line of context, trailing status and\n * actions. On `ds-surface-raised` with a raised shadow, 56px minimum rows divided by `ds-border`,\n * sections under small headers. The phone counterpart of Table (use it under 640px) and the default for\n * short feeds.\n */\nexport function StackList<T = never>({\n \"aria-label\": label,\n children,\n items,\n sections,\n renderItem,\n selectionMode = \"none\",\n selectionBehavior = \"toggle\",\n selectedKeys,\n defaultSelectedKeys,\n onSelectionChange,\n onAction,\n emptyState,\n}: StackListProps<T>) {\n const row = (item: T) => {\n const props = renderItem!(item);\n return <GridListItem key={props.id} {...props} />;\n };\n const content =\n renderItem && sections\n ? sections.map((section, index) => (\n <GridListSection key={`${index}-${section.title}`} title={section.title}>\n {section.items.map(row)}\n </GridListSection>\n ))\n : renderItem && items\n ? items.map(row)\n : children;\n return (\n <AriaGridList\n aria-label={label}\n selectionMode={selectionMode}\n selectionBehavior={selectionBehavior}\n selectedKeys={selectedKeys}\n defaultSelectedKeys={defaultSelectedKeys}\n onSelectionChange={onSelectionChange}\n onAction={onAction}\n renderEmptyState={emptyState != null && emptyState !== false ? () => <div className=\"px-ds-300 py-ds-500 text-center text-body text-ds-text-subtle\">{emptyState}</div> : undefined}\n data-slot=\"list\"\n className=\"flex flex-col overflow-hidden rounded-ds-large bg-ds-surface-raised shadow-ds-raised outline-hidden\"\n >\n {content}\n </AriaGridList>\n );\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The row and header checkbox of a selectable collection. React Aria wires it through `slot="selection"`:
|
|
3
|
+
* it selects its row (or every row, with an indeterminate state when some are), and names itself.
|
|
4
|
+
*/
|
|
5
|
+
export declare function SelectionCheckbox(): import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Checkbox as AriaCheckbox } from "react-aria-components";
|
|
4
|
+
import { IconGlyph } from "../display/icon.js";
|
|
5
|
+
import { CHECKBOX_BOX } from "../selection/styles.js";
|
|
6
|
+
/**
|
|
7
|
+
* The row and header checkbox of a selectable collection. React Aria wires it through `slot="selection"`:
|
|
8
|
+
* it selects its row (or every row, with an indeterminate state when some are), and names itself.
|
|
9
|
+
*/
|
|
10
|
+
export function SelectionCheckbox() {
|
|
11
|
+
return (_jsx(AriaCheckbox, { slot: "selection", "data-slot": "selection-checkbox", className: "group inline-flex cursor-pointer outline-hidden", children: ({ isIndeterminate, isSelected }) => (_jsx("span", { "aria-hidden": "true", className: CHECKBOX_BOX, children: isIndeterminate ? (_jsx(IconGlyph, { name: "minus", size: "small", strokeWidth: 3 })) : isSelected ? (_jsx(IconGlyph, { name: "check", size: "small", strokeWidth: 3 })) : null })) }));
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=selection-checkbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selection-checkbox.js","sourceRoot":"","sources":["../../src/collection/selection-checkbox.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD;;;GAGG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAO,CACL,KAAC,YAAY,IAAC,IAAI,EAAC,WAAW,eAAW,oBAAoB,EAAC,SAAS,EAAC,iDAAiD,YACtH,CAAC,EAAE,eAAe,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CACpC,8BAAkB,MAAM,EAAC,SAAS,EAAE,YAAY,YAC7C,eAAe,CAAC,CAAC,CAAC,CACjB,KAAC,SAAS,IAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAE,CAAC,GAAI,CACxD,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CACf,KAAC,SAAS,IAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAE,CAAC,GAAI,CACxD,CAAC,CAAC,CAAC,IAAI,GACH,CACR,GACY,CAChB,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport { Checkbox as AriaCheckbox } from \"react-aria-components\";\n\nimport { IconGlyph } from \"../display/icon\";\nimport { CHECKBOX_BOX } from \"../selection/styles\";\n\n/**\n * The row and header checkbox of a selectable collection. React Aria wires it through `slot=\"selection\"`:\n * it selects its row (or every row, with an indeterminate state when some are), and names itself.\n */\nexport function SelectionCheckbox() {\n return (\n <AriaCheckbox slot=\"selection\" data-slot=\"selection-checkbox\" className=\"group inline-flex cursor-pointer outline-hidden\">\n {({ isIndeterminate, isSelected }) => (\n <span aria-hidden=\"true\" className={CHECKBOX_BOX}>\n {isIndeterminate ? (\n <IconGlyph name=\"minus\" size=\"small\" strokeWidth={3} />\n ) : isSelected ? (\n <IconGlyph name=\"check\" size=\"small\" strokeWidth={3} />\n ) : null}\n </span>\n )}\n </AriaCheckbox>\n );\n}\n"]}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { Density } from "../density.js";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { type Key, type Selection, type SortDescriptor } from "react-aria-components";
|
|
4
|
+
export type TableColumn<T> = {
|
|
5
|
+
key: string;
|
|
6
|
+
/** The column's name, a noun ("Total"). */
|
|
7
|
+
header: string;
|
|
8
|
+
/** `end` for numbers and money: right-aligned (start in RTL) in tabular figures. */
|
|
9
|
+
align?: "start" | "end";
|
|
10
|
+
isSortable?: boolean;
|
|
11
|
+
/** A CSS width ("120px", "20%"). Set one to truncate long values in this column. */
|
|
12
|
+
width?: string;
|
|
13
|
+
/** The cell's content; the row's value under `key` by default. */
|
|
14
|
+
render?: (row: T) => React.ReactNode;
|
|
15
|
+
/** Long text: clamp to two lines with an ellipsis, the full text on hover and keyboard focus. */
|
|
16
|
+
wrap?: boolean;
|
|
17
|
+
/** The row header: the value that names the row (an order number); the first column by default. */
|
|
18
|
+
isRowHeader?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Hides the column, header and cells, on viewports narrower than this breakpoint (Tailwind's `sm` 640px,
|
|
21
|
+
* `md` 768px, `lg` 1024px, `xl` 1280px): for secondary columns that crowd a narrow screen. The column
|
|
22
|
+
* leaves the table there, so neither the arrow keys nor screen readers reach it. Ignored on the row
|
|
23
|
+
* header column, which names each row (a development warning says so). Sorting by the other columns is
|
|
24
|
+
* unaffected.
|
|
25
|
+
*/
|
|
26
|
+
hideBelow?: "sm" | "md" | "lg" | "xl";
|
|
27
|
+
};
|
|
28
|
+
export type TableProps<T> = {
|
|
29
|
+
/** Names the table ("Orders"). */
|
|
30
|
+
"aria-label": string;
|
|
31
|
+
columns: readonly TableColumn<T>[];
|
|
32
|
+
rows: readonly T[];
|
|
33
|
+
/**
|
|
34
|
+
* The row's stable id; `row.id` by default. Ids must be unique within the table. When the data has no
|
|
35
|
+
* single unique field, build one from the fields that are (`${row.date}:${row.channel}`), or add the row's
|
|
36
|
+
* index as a last resort. A repeated id still renders every row: the first keeps its id and the later ones
|
|
37
|
+
* are keyed `a#2`, `a#3`, … in row order, and selection and `onRowAction` receive those suffixed keys; a
|
|
38
|
+
* development warning names the repeated ids. A suffixed key follows the row's position, not
|
|
39
|
+
* the row: after a sort or filter, a selection made through it can move to another copy of the id.
|
|
40
|
+
*/
|
|
41
|
+
rowKey?: (row: T) => Key;
|
|
42
|
+
selectionMode?: "none" | "single" | "multiple";
|
|
43
|
+
selectedKeys?: "all" | Iterable<Key>;
|
|
44
|
+
defaultSelectedKeys?: "all" | Iterable<Key>;
|
|
45
|
+
onSelectionChange?: (keys: Selection) => void;
|
|
46
|
+
sortDescriptor?: SortDescriptor;
|
|
47
|
+
onSortChange?: (descriptor: SortDescriptor) => void;
|
|
48
|
+
/** `compact` (36px rows) for dense working screens; `default` (48px) for public and content pages. */
|
|
49
|
+
density?: Density;
|
|
50
|
+
/** Shown when there are no rows: an `EmptyState`, or one sentence on why it is empty and the action that fills it. */
|
|
51
|
+
emptyState?: React.ReactNode;
|
|
52
|
+
/** Opens the record: the whole row is the target. */
|
|
53
|
+
onRowAction?: (key: Key) => void;
|
|
54
|
+
/** A height for the scroll area: the header stays put and gets a shadow once rows scroll under it. */
|
|
55
|
+
maxHeight?: string;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* The rows' keys, unique. React Aria keys a collection by id: a repeated id dropped rows (the
|
|
59
|
+
* walk over the rows follows keys, and the last row with that id ends it early) and, on an update, could loop
|
|
60
|
+
* forever. So the first row with an id keeps it and each later one gets `id#2`, `id#3`, … in row order,
|
|
61
|
+
* skipping any suffix another row already uses as its real id. Ids are compared as strings, as React keys
|
|
62
|
+
* are. Unique ids come back as they are, in the same array order. `repeated` lists each repeated id once.
|
|
63
|
+
* A suffix follows the row's position, not the row: after a sort, filter or page change another copy of the
|
|
64
|
+
* id can hold `id#2`. Each id resumes its own suffix count, so many copies of one id stay linear.
|
|
65
|
+
*/
|
|
66
|
+
export declare function uniqueRowKeys(keys: readonly Key[]): {
|
|
67
|
+
keys: Key[];
|
|
68
|
+
repeated: Key[];
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Records the user scans, compares, sorts and acts on: orders, customers, invoices. On
|
|
72
|
+
* `ds-surface-raised` with a raised shadow; a sunken header row; 48px rows (36px compact) divided by
|
|
73
|
+
* `ds-border`; selection by checkbox with a 2px marker on the leading edge; the row opens the record.
|
|
74
|
+
* Status is a Badge, money right-aligned and formatted by the locale ("$1,248.00"). Under 640px use a List.
|
|
75
|
+
*
|
|
76
|
+
* Pressing a row opens the record while nothing is selected; once rows are ticked a press toggles
|
|
77
|
+
* selection, and a record link in the row-header cell always opens, so a link is never trapped behind selection.
|
|
78
|
+
*/
|
|
79
|
+
export declare function Table<T extends object>(props: TableProps<T>): React.JSX.Element;
|
|
80
|
+
/**
|
|
81
|
+
* @internal The Table itself, with one option the public Table does not offer: `virtual` renders only
|
|
82
|
+
* the rows in view (React Aria's Virtualizer). DataTable uses it for long client lists; the table becomes
|
|
83
|
+
* its own scroll area at `height` px, rows and header keep their DS heights and look.
|
|
84
|
+
*/
|
|
85
|
+
export declare function TableView<T extends object>({ "aria-label": label, columns: allColumns, rows, rowKey, selectionMode, selectedKeys, defaultSelectedKeys, onSelectionChange, sortDescriptor, onSortChange, density, emptyState, onRowAction, maxHeight, virtual, component, }: TableProps<T> & {
|
|
86
|
+
virtual?: {
|
|
87
|
+
height: number;
|
|
88
|
+
};
|
|
89
|
+
/** The component the warnings name: DataTable passes its own. */
|
|
90
|
+
component?: "Table" | "DataTable";
|
|
91
|
+
}): React.JSX.Element;
|