@nadicodeai/ui 12.1.102 → 12.1.104
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/dist/components/accordion.d.ts +38 -12
- package/dist/components/accordion.d.ts.map +1 -1
- package/dist/components/accordion.js +36 -15
- package/dist/components/account-menu.js +2 -2
- package/dist/components/action-menu.d.ts +20 -19
- package/dist/components/action-menu.d.ts.map +1 -1
- package/dist/components/action-menu.js +22 -15
- package/dist/components/action-status.d.ts +14 -10
- package/dist/components/action-status.d.ts.map +1 -1
- package/dist/components/action-status.js +14 -10
- package/dist/components/activity-calendar.d.ts +3 -1
- package/dist/components/activity-calendar.d.ts.map +1 -1
- package/dist/components/activity-calendar.js +16 -2
- package/dist/components/activity-feed.d.ts +2 -2
- package/dist/components/activity-feed.d.ts.map +1 -1
- package/dist/components/activity-feed.js +14 -5
- package/dist/components/agent-card.d.ts +11 -5
- package/dist/components/agent-card.d.ts.map +1 -1
- package/dist/components/agent-card.js +13 -7
- package/dist/components/agent-list-row.js +1 -1
- package/dist/components/agent-orb-appearance.d.ts +7 -1
- package/dist/components/agent-orb-appearance.d.ts.map +1 -1
- package/dist/components/agent-orb-appearance.js +26 -0
- package/dist/components/agent-profile.d.ts +8 -7
- package/dist/components/agent-profile.d.ts.map +1 -1
- package/dist/components/agent-profile.js +6 -6
- package/dist/components/alert-dialog.d.ts +25 -16
- package/dist/components/alert-dialog.d.ts.map +1 -1
- package/dist/components/alert-dialog.js +30 -18
- package/dist/components/alert.d.ts +1 -1
- package/dist/components/avatar.d.ts +83 -17
- package/dist/components/avatar.d.ts.map +1 -1
- package/dist/components/avatar.js +89 -23
- package/dist/components/badge.d.ts +59 -8
- package/dist/components/badge.d.ts.map +1 -1
- package/dist/components/badge.js +57 -14
- package/dist/components/breadcrumb.d.ts +18 -7
- package/dist/components/breadcrumb.d.ts.map +1 -1
- package/dist/components/breadcrumb.js +37 -13
- package/dist/components/button-group.d.ts +12 -15
- package/dist/components/button-group.d.ts.map +1 -1
- package/dist/components/button-group.js +13 -17
- package/dist/components/button.d.ts +126 -23
- package/dist/components/button.d.ts.map +1 -1
- package/dist/components/button.js +164 -39
- package/dist/components/calendar.d.ts +26 -15
- package/dist/components/calendar.d.ts.map +1 -1
- package/dist/components/calendar.js +60 -46
- package/dist/components/card-row.d.ts +13 -5
- package/dist/components/card-row.d.ts.map +1 -1
- package/dist/components/card-row.js +24 -10
- package/dist/components/card.d.ts +6 -12
- package/dist/components/card.d.ts.map +1 -1
- package/dist/components/card.js +11 -16
- package/dist/components/carousel.d.ts +3 -3
- package/dist/components/carousel.d.ts.map +1 -1
- package/dist/components/carousel.js +7 -7
- package/dist/components/catalog-drawer.d.ts +7 -7
- package/dist/components/catalog-drawer.d.ts.map +1 -1
- package/dist/components/catalog-drawer.js +6 -6
- package/dist/components/chart-area-stacked.d.ts +1 -1
- package/dist/components/chart-area-stacked.d.ts.map +1 -1
- package/dist/components/chart-area-stacked.js +4 -4
- package/dist/components/chart-axis.d.ts +14 -1
- package/dist/components/chart-axis.d.ts.map +1 -1
- package/dist/components/chart-axis.js +11 -1
- package/dist/components/chart-bar-horizontal.d.ts +2 -2
- package/dist/components/chart-bar-horizontal.d.ts.map +1 -1
- package/dist/components/chart-bar-horizontal.js +14 -5
- package/dist/components/chart-bar-multiple.d.ts +1 -1
- package/dist/components/chart-bar-multiple.d.ts.map +1 -1
- package/dist/components/chart-bar-multiple.js +3 -3
- package/dist/components/chart-bar-stacked.d.ts +1 -1
- package/dist/components/chart-bar-stacked.d.ts.map +1 -1
- package/dist/components/chart-bar-stacked.js +3 -3
- package/dist/components/chart-card.d.ts +17 -6
- package/dist/components/chart-card.d.ts.map +1 -1
- package/dist/components/chart-card.js +11 -4
- package/dist/components/chart-date-range-control.d.ts +18 -9
- package/dist/components/chart-date-range-control.d.ts.map +1 -1
- package/dist/components/chart-date-range-control.js +43 -47
- package/dist/components/chart-sparkline.d.ts +4 -3
- package/dist/components/chart-sparkline.d.ts.map +1 -1
- package/dist/components/chart-sparkline.js +6 -5
- package/dist/components/check-counts.d.ts +44 -0
- package/dist/components/check-counts.d.ts.map +1 -0
- package/dist/components/check-counts.js +51 -0
- package/dist/components/checkbox.d.ts +39 -11
- package/dist/components/checkbox.d.ts.map +1 -1
- package/dist/components/checkbox.js +38 -11
- package/dist/components/choicebox.d.ts +96 -0
- package/dist/components/choicebox.d.ts.map +1 -0
- package/dist/components/choicebox.js +113 -0
- package/dist/components/clearable-input.d.ts +57 -0
- package/dist/components/clearable-input.d.ts.map +1 -0
- package/dist/components/clearable-input.js +58 -0
- package/dist/components/code-block.d.ts +77 -17
- package/dist/components/code-block.d.ts.map +1 -1
- package/dist/components/code-block.js +85 -15
- package/dist/components/collapsible.d.ts +27 -10
- package/dist/components/collapsible.d.ts.map +1 -1
- package/dist/components/collapsible.js +24 -9
- package/dist/components/collection-filters.d.ts +3 -1
- package/dist/components/collection-filters.d.ts.map +1 -1
- package/dist/components/collection-filters.js +7 -9
- package/dist/components/collection-page.d.ts +31 -10
- package/dist/components/collection-page.d.ts.map +1 -1
- package/dist/components/collection-page.js +14 -13
- package/dist/components/collection-search.d.ts +32 -10
- package/dist/components/collection-search.d.ts.map +1 -1
- package/dist/components/collection-search.js +24 -13
- package/dist/components/collection-sort.d.ts.map +1 -1
- package/dist/components/collection-sort.js +2 -2
- package/dist/components/collection-toolbar.d.ts +5 -2
- package/dist/components/collection-toolbar.d.ts.map +1 -1
- package/dist/components/collection-toolbar.js +7 -4
- package/dist/components/combobox.d.ts +97 -22
- package/dist/components/combobox.d.ts.map +1 -1
- package/dist/components/combobox.js +80 -28
- package/dist/components/command.d.ts +34 -21
- package/dist/components/command.d.ts.map +1 -1
- package/dist/components/command.js +33 -25
- package/dist/components/confirm-dialog.d.ts +23 -6
- package/dist/components/confirm-dialog.d.ts.map +1 -1
- package/dist/components/confirm-dialog.js +32 -13
- package/dist/components/context-menu.d.ts +14 -10
- package/dist/components/context-menu.d.ts.map +1 -1
- package/dist/components/context-menu.js +17 -12
- package/dist/components/copy-button.d.ts +5 -2
- package/dist/components/copy-button.d.ts.map +1 -1
- package/dist/components/copy-button.js +16 -8
- package/dist/components/data-table.d.ts +120 -54
- package/dist/components/data-table.d.ts.map +1 -1
- package/dist/components/data-table.js +163 -92
- package/dist/components/desktop-shell.d.ts +4 -2
- package/dist/components/desktop-shell.d.ts.map +1 -1
- package/dist/components/desktop-shell.js +3 -3
- package/dist/components/dialog.d.ts +63 -24
- package/dist/components/dialog.d.ts.map +1 -1
- package/dist/components/dialog.js +52 -31
- package/dist/components/disclosure-row.d.ts +1 -2
- package/dist/components/disclosure-row.d.ts.map +1 -1
- package/dist/components/disclosure-row.js +1 -2
- package/dist/components/disclosure.d.ts +1 -1
- package/dist/components/disclosure.js +1 -1
- package/dist/components/drawer.d.ts +33 -12
- package/dist/components/drawer.d.ts.map +1 -1
- package/dist/components/drawer.js +47 -35
- package/dist/components/dropdown-menu.d.ts +59 -14
- package/dist/components/dropdown-menu.d.ts.map +1 -1
- package/dist/components/dropdown-menu.js +58 -26
- package/dist/components/empty-state.d.ts +35 -12
- package/dist/components/empty-state.d.ts.map +1 -1
- package/dist/components/empty-state.js +35 -17
- package/dist/components/entry-scene.d.ts +4 -4
- package/dist/components/entry-scene.d.ts.map +1 -1
- package/dist/components/entry-scene.js +2 -2
- package/dist/components/field.d.ts +44 -14
- package/dist/components/field.d.ts.map +1 -1
- package/dist/components/field.js +49 -20
- package/dist/components/file-diff.d.ts.map +1 -1
- package/dist/components/file-diff.js +3 -4
- package/dist/components/form-dialog.d.ts +7 -7
- package/dist/components/form-dialog.d.ts.map +1 -1
- package/dist/components/form-dialog.js +13 -11
- package/dist/components/form-drawer.d.ts +10 -7
- package/dist/components/form-drawer.d.ts.map +1 -1
- package/dist/components/form-drawer.js +11 -10
- package/dist/components/gauge.d.ts +64 -0
- package/dist/components/gauge.d.ts.map +1 -0
- package/dist/components/gauge.js +73 -0
- package/dist/components/hover-card.d.ts +72 -14
- package/dist/components/hover-card.d.ts.map +1 -1
- package/dist/components/hover-card.js +51 -17
- package/dist/components/identity-mark.d.ts +8 -1
- package/dist/components/identity-mark.d.ts.map +1 -1
- package/dist/components/identity-mark.js +31 -5
- package/dist/components/input-group.d.ts +44 -21
- package/dist/components/input-group.d.ts.map +1 -1
- package/dist/components/input-group.js +74 -27
- package/dist/components/input.d.ts +64 -12
- package/dist/components/input.d.ts.map +1 -1
- package/dist/components/input.js +51 -15
- package/dist/components/item.d.ts +37 -15
- package/dist/components/item.d.ts.map +1 -1
- package/dist/components/item.js +41 -22
- package/dist/components/kbd.d.ts +49 -13
- package/dist/components/kbd.d.ts.map +1 -1
- package/dist/components/kbd.js +115 -16
- package/dist/components/kpi-card.d.ts +12 -4
- package/dist/components/kpi-card.d.ts.map +1 -1
- package/dist/components/kpi-card.js +13 -4
- package/dist/components/label.d.ts +17 -10
- package/dist/components/label.d.ts.map +1 -1
- package/dist/components/label.js +18 -11
- package/dist/components/library-shelf.d.ts +6 -6
- package/dist/components/library-shelf.d.ts.map +1 -1
- package/dist/components/library-shelf.js +5 -5
- package/dist/components/load-more-button.d.ts +35 -0
- package/dist/components/load-more-button.d.ts.map +1 -0
- package/dist/components/load-more-button.js +26 -0
- package/dist/components/message-notice.d.ts +8 -13
- package/dist/components/message-notice.d.ts.map +1 -1
- package/dist/components/message-notice.js +25 -22
- package/dist/components/middle-truncate.d.ts +33 -0
- package/dist/components/middle-truncate.d.ts.map +1 -0
- package/dist/components/middle-truncate.js +72 -0
- package/dist/components/multi-select.d.ts +94 -0
- package/dist/components/multi-select.d.ts.map +1 -0
- package/dist/components/multi-select.js +132 -0
- package/dist/components/native-select.d.ts +37 -13
- package/dist/components/native-select.d.ts.map +1 -1
- package/dist/components/native-select.js +27 -11
- package/dist/components/notice-banner.d.ts +17 -10
- package/dist/components/notice-banner.d.ts.map +1 -1
- package/dist/components/notice-banner.js +12 -11
- package/dist/components/numbered-steps.d.ts +10 -4
- package/dist/components/numbered-steps.d.ts.map +1 -1
- package/dist/components/numbered-steps.js +9 -7
- package/dist/components/object-page.d.ts +40 -14
- package/dist/components/object-page.d.ts.map +1 -1
- package/dist/components/object-page.js +12 -10
- package/dist/components/object-workspace.d.ts +29 -10
- package/dist/components/object-workspace.d.ts.map +1 -1
- package/dist/components/object-workspace.js +18 -8
- package/dist/components/overview-page.d.ts +2 -2
- package/dist/components/overview-page.d.ts.map +1 -1
- package/dist/components/overview-page.js +8 -7
- package/dist/components/page-actions.d.ts +28 -8
- package/dist/components/page-actions.d.ts.map +1 -1
- package/dist/components/page-actions.js +22 -25
- package/dist/components/page-header.d.ts +11 -4
- package/dist/components/page-header.d.ts.map +1 -1
- package/dist/components/page-header.js +10 -5
- package/dist/components/pending-label.d.ts +6 -5
- package/dist/components/pending-label.d.ts.map +1 -1
- package/dist/components/pending-label.js +14 -6
- package/dist/components/picture-label.d.ts +2 -2
- package/dist/components/picture-label.d.ts.map +1 -1
- package/dist/components/picture-label.js +3 -3
- package/dist/components/portal-sidebar-frame.d.ts +9 -21
- package/dist/components/portal-sidebar-frame.d.ts.map +1 -1
- package/dist/components/portal-sidebar-frame.js +13 -27
- package/dist/components/progress-checklist.d.ts +46 -0
- package/dist/components/progress-checklist.d.ts.map +1 -0
- package/dist/components/progress-checklist.js +46 -0
- package/dist/components/progress.d.ts +48 -8
- package/dist/components/progress.d.ts.map +1 -1
- package/dist/components/progress.js +92 -16
- package/dist/components/prose.d.ts +19 -0
- package/dist/components/prose.d.ts.map +1 -0
- package/dist/components/prose.js +29 -0
- package/dist/components/radio-group.d.ts +51 -12
- package/dist/components/radio-group.d.ts.map +1 -1
- package/dist/components/radio-group.js +42 -12
- package/dist/components/reading-column.js +1 -1
- package/dist/components/record-identity.d.ts +6 -5
- package/dist/components/record-identity.d.ts.map +1 -1
- package/dist/components/record-identity.js +12 -3
- package/dist/components/record-list.d.ts +117 -27
- package/dist/components/record-list.d.ts.map +1 -1
- package/dist/components/record-list.js +185 -55
- package/dist/components/record-time.d.ts +20 -7
- package/dist/components/record-time.d.ts.map +1 -1
- package/dist/components/record-time.js +38 -19
- package/dist/components/resizable.d.ts +7 -5
- package/dist/components/resizable.d.ts.map +1 -1
- package/dist/components/resizable.js +6 -6
- package/dist/components/scope-switcher.d.ts +2 -0
- package/dist/components/scope-switcher.d.ts.map +1 -1
- package/dist/components/scope-switcher.js +2 -2
- package/dist/components/scroll-area.d.ts +47 -11
- package/dist/components/scroll-area.d.ts.map +1 -1
- package/dist/components/scroll-area.js +72 -14
- package/dist/components/segmented-control.d.ts +82 -0
- package/dist/components/segmented-control.d.ts.map +1 -0
- package/dist/components/segmented-control.js +90 -0
- package/dist/components/select.d.ts +55 -15
- package/dist/components/select.d.ts.map +1 -1
- package/dist/components/select.js +62 -19
- package/dist/components/separator.d.ts +12 -5
- package/dist/components/separator.d.ts.map +1 -1
- package/dist/components/separator.js +11 -6
- package/dist/components/settings-facts.d.ts +34 -14
- package/dist/components/settings-facts.d.ts.map +1 -1
- package/dist/components/settings-facts.js +21 -12
- package/dist/components/settings-page.d.ts +4 -4
- package/dist/components/settings-page.js +5 -5
- package/dist/components/settings-section.d.ts +160 -34
- package/dist/components/settings-section.d.ts.map +1 -1
- package/dist/components/settings-section.js +92 -39
- package/dist/components/sheet.d.ts +47 -16
- package/dist/components/sheet.d.ts.map +1 -1
- package/dist/components/sheet.js +40 -19
- package/dist/components/sidebar-sections.d.ts +16 -12
- package/dist/components/sidebar-sections.d.ts.map +1 -1
- package/dist/components/sidebar-sections.js +30 -15
- package/dist/components/sidebar.d.ts +117 -21
- package/dist/components/sidebar.d.ts.map +1 -1
- package/dist/components/sidebar.js +180 -55
- package/dist/components/skeleton.d.ts +54 -8
- package/dist/components/skeleton.d.ts.map +1 -1
- package/dist/components/skeleton.js +44 -9
- package/dist/components/slider.d.ts +53 -11
- package/dist/components/slider.d.ts.map +1 -1
- package/dist/components/slider.js +71 -17
- package/dist/components/snippet.d.ts +57 -0
- package/dist/components/snippet.d.ts.map +1 -0
- package/dist/components/snippet.js +60 -0
- package/dist/components/sonner.d.ts +13 -14
- package/dist/components/sonner.d.ts.map +1 -1
- package/dist/components/sonner.js +25 -22
- package/dist/components/status-badge.d.ts +37 -11
- package/dist/components/status-badge.d.ts.map +1 -1
- package/dist/components/status-badge.js +63 -15
- package/dist/components/status-dot.d.ts +42 -11
- package/dist/components/status-dot.d.ts.map +1 -1
- package/dist/components/status-dot.js +40 -11
- package/dist/components/switch.d.ts +43 -12
- package/dist/components/switch.d.ts.map +1 -1
- package/dist/components/switch.js +42 -12
- package/dist/components/table-card.d.ts +21 -12
- package/dist/components/table-card.d.ts.map +1 -1
- package/dist/components/table-card.js +17 -9
- package/dist/components/table-layouts.d.ts +40 -8
- package/dist/components/table-layouts.d.ts.map +1 -1
- package/dist/components/table-layouts.js +52 -8
- package/dist/components/table-value.d.ts +4 -3
- package/dist/components/table-value.d.ts.map +1 -1
- package/dist/components/table-value.js +6 -5
- package/dist/components/table.d.ts +62 -25
- package/dist/components/table.d.ts.map +1 -1
- package/dist/components/table.js +62 -26
- package/dist/components/tabs.d.ts +86 -17
- package/dist/components/tabs.d.ts.map +1 -1
- package/dist/components/tabs.js +93 -22
- package/dist/components/text-link.d.ts +4 -1
- package/dist/components/text-link.d.ts.map +1 -1
- package/dist/components/text-link.js +4 -1
- package/dist/components/text-with-copy-button.d.ts +30 -0
- package/dist/components/text-with-copy-button.d.ts.map +1 -0
- package/dist/components/text-with-copy-button.js +32 -0
- package/dist/components/textarea.d.ts +40 -10
- package/dist/components/textarea.d.ts.map +1 -1
- package/dist/components/textarea.js +50 -11
- package/dist/components/theme-mode-switcher.d.ts +18 -1
- package/dist/components/theme-mode-switcher.d.ts.map +1 -1
- package/dist/components/theme-mode-switcher.js +20 -2
- package/dist/components/toggle-group.d.ts +28 -8
- package/dist/components/toggle-group.d.ts.map +1 -1
- package/dist/components/toggle-group.js +12 -6
- package/dist/components/toggle.d.ts +6 -3
- package/dist/components/toggle.d.ts.map +1 -1
- package/dist/components/toggle.js +10 -7
- package/dist/components/tooltip.d.ts +43 -12
- package/dist/components/tooltip.d.ts.map +1 -1
- package/dist/components/tooltip.js +45 -16
- package/dist/components/trend-badge.js +1 -1
- package/dist/components/update-card.js +1 -1
- package/dist/eslint/index.js +82 -0
- package/dist/eslint/rules/badge-is-static-label.js +93 -0
- package/dist/eslint/rules/button-icon-slot.js +102 -0
- package/dist/eslint/rules/button-link-for-navigation.js +146 -0
- package/dist/eslint/rules/button-no-aria-label-with-text.js +75 -0
- package/dist/eslint/rules/button-type-roles-only-in-buttons.js +83 -0
- package/dist/eslint/rules/choice-control-has-a-name.js +98 -0
- package/dist/eslint/rules/choice-group-in-fieldset.js +86 -0
- package/dist/eslint/rules/command-shortcut-single-owner.js +118 -0
- package/dist/eslint/rules/confirm-dialog-words.js +63 -0
- package/dist/eslint/rules/data-table-one-unsized-column.js +96 -0
- package/dist/eslint/rules/destructive-action-placement.js +69 -0
- package/dist/eslint/rules/disabled-choice-says-why.js +71 -0
- package/dist/eslint/rules/ellipsis-opens-a-dialog.js +110 -0
- package/dist/eslint/rules/input-group-owners.js +155 -0
- package/dist/eslint/rules/kbd-children-no-modifier-text.js +128 -0
- package/dist/eslint/rules/literal-text.js +41 -0
- package/dist/eslint/rules/middle-truncate-placement.js +69 -0
- package/dist/eslint/rules/no-bare-button-label.js +55 -0
- package/dist/eslint/rules/no-control-in-read-only-surface.js +106 -0
- package/dist/eslint/rules/no-hand-built-busy.js +104 -0
- package/dist/eslint/rules/no-hand-built-theme-picker.js +144 -0
- package/dist/eslint/rules/no-hand-built-tile.js +41 -0
- package/dist/eslint/rules/no-hand-formatted-date.js +87 -0
- package/dist/eslint/rules/no-hand-stacked-avatars.js +67 -0
- package/dist/eslint/rules/no-nested-collapse.js +60 -0
- package/dist/eslint/rules/no-search-in-form.js +47 -0
- package/dist/eslint/rules/no-shadcn-appearance-override.js +2 -16
- package/dist/eslint/rules/no-shell-prompt-in-snippet.js +74 -0
- package/dist/eslint/rules/no-stock-error-words.js +56 -0
- package/dist/eslint/rules/no-tooltip-around-labelled-field.js +72 -0
- package/dist/eslint/rules/no-weight-class-on-strong-in-type-role.js +57 -0
- package/dist/eslint/rules/one-submenu-level.js +43 -0
- package/dist/eslint/rules/one-toast-per-flow.js +91 -0
- package/dist/eslint/rules/option-count.js +167 -0
- package/dist/eslint/rules/page-command-link-not-render.js +43 -0
- package/dist/eslint/rules/progress-needs-name.js +57 -0
- package/dist/eslint/rules/settings-limit-in-footer.js +94 -0
- package/dist/eslint/rules/skeleton-in-region.js +80 -0
- package/dist/eslint/rules/sortable-heading-uses-sort.js +79 -0
- package/dist/eslint/rules/table-cell-inset-owner.js +107 -0
- package/dist/eslint/rules/tabs-selection-is-controlled.js +47 -0
- package/dist/eslint/rules/tooltip-only-arrow.js +38 -0
- package/dist/eslint/rules/tooltip-trigger-accessible-name.js +114 -0
- package/dist/eslint/strict-design-system.js +21 -7
- package/dist/index.d.ts +13 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -13
- package/dist/internal/assistant-ui/attachment.d.ts.map +1 -1
- package/dist/internal/assistant-ui/attachment.js +2 -2
- package/dist/internal/assistant-ui/reasoning.d.ts +1 -1
- package/dist/internal/assistant-ui/reasoning.d.ts.map +1 -1
- package/dist/internal/assistant-ui/tool-fallback.js +1 -1
- package/dist/internal/assistant-ui/tool-group.d.ts +1 -1
- package/dist/internal/assistant-ui/tool-group.d.ts.map +1 -1
- package/dist/internal/assistant-ui/tooltip-icon-button.d.ts +2 -3
- package/dist/internal/assistant-ui/tooltip-icon-button.d.ts.map +1 -1
- package/dist/internal/assistant-ui/tooltip-icon-button.js +1 -1
- package/dist/internal/catalog-list.js +2 -2
- package/dist/internal/collection-note.d.ts +23 -0
- package/dist/internal/collection-note.d.ts.map +1 -0
- package/dist/internal/collection-note.js +17 -0
- package/dist/internal/collection-rail.d.ts +57 -0
- package/dist/internal/collection-rail.d.ts.map +1 -0
- package/dist/internal/collection-rail.js +33 -0
- package/dist/internal/company-logo.d.ts +18 -0
- package/dist/internal/company-logo.d.ts.map +1 -0
- package/dist/internal/company-logo.js +14 -0
- package/dist/internal/control-name.d.ts +12 -0
- package/dist/internal/control-name.d.ts.map +1 -0
- package/dist/internal/control-name.js +1 -0
- package/dist/internal/diff-line.d.ts +9 -0
- package/dist/internal/diff-line.d.ts.map +1 -0
- package/dist/internal/diff-line.js +8 -0
- package/dist/internal/empty.d.ts +8 -4
- package/dist/internal/empty.d.ts.map +1 -1
- package/dist/internal/empty.js +14 -8
- package/dist/internal/field-frame.d.ts +33 -0
- package/dist/internal/field-frame.d.ts.map +1 -0
- package/dist/internal/field-frame.js +20 -0
- package/dist/internal/final-focus.d.ts +8 -0
- package/dist/internal/final-focus.d.ts.map +1 -0
- package/dist/internal/final-focus.js +10 -0
- package/dist/internal/footer-strip.d.ts.map +1 -1
- package/dist/internal/footer-strip.js +3 -1
- package/dist/internal/form-submit.d.ts +9 -5
- package/dist/internal/form-submit.d.ts.map +1 -1
- package/dist/internal/form-submit.js +31 -2
- package/dist/internal/input-box.d.ts +26 -0
- package/dist/internal/input-box.d.ts.map +1 -0
- package/dist/internal/input-box.js +59 -0
- package/dist/internal/menu-surface.d.ts +10 -3
- package/dist/internal/menu-surface.d.ts.map +1 -1
- package/dist/internal/menu-surface.js +10 -3
- package/dist/internal/notice.d.ts +25 -0
- package/dist/internal/notice.d.ts.map +1 -0
- package/dist/internal/notice.js +33 -0
- package/dist/internal/overlay-stem.d.ts +5 -0
- package/dist/internal/overlay-stem.d.ts.map +1 -0
- package/dist/internal/overlay-stem.js +7 -0
- package/dist/internal/phone-sheet.d.ts +4 -0
- package/dist/internal/phone-sheet.d.ts.map +1 -0
- package/dist/internal/phone-sheet.js +2 -0
- package/dist/internal/present-content.d.ts +3 -0
- package/dist/internal/present-content.d.ts.map +1 -0
- package/dist/internal/present-content.js +1 -0
- package/dist/internal/record-menu-items.d.ts +4 -3
- package/dist/internal/record-menu-items.d.ts.map +1 -1
- package/dist/internal/record-menu-items.js +21 -6
- package/dist/internal/settings-save.d.ts +9 -2
- package/dist/internal/settings-save.d.ts.map +1 -1
- package/dist/internal/settings-save.js +19 -6
- package/dist/internal/table-compact-line.d.ts +38 -0
- package/dist/internal/table-compact-line.d.ts.map +1 -0
- package/dist/internal/table-compact-line.js +35 -0
- package/dist/internal/title-when-cut.d.ts +8 -0
- package/dist/internal/title-when-cut.d.ts.map +1 -0
- package/dist/internal/title-when-cut.js +22 -0
- package/dist/internal/unsaved-guard.d.ts +18 -0
- package/dist/internal/unsaved-guard.d.ts.map +1 -0
- package/dist/internal/unsaved-guard.js +31 -0
- package/dist/lib/merge-tokens.generated.js +2 -2
- package/dist/showcase/foundations.d.ts.map +1 -1
- package/dist/showcase/foundations.js +10 -2
- package/dist/showcase/specimens/actions.d.ts +2 -0
- package/dist/showcase/specimens/actions.d.ts.map +1 -1
- package/dist/showcase/specimens/actions.js +30 -5
- package/dist/showcase/specimens/charts.d.ts.map +1 -1
- package/dist/showcase/specimens/charts.js +22 -13
- package/dist/showcase/specimens/choices.d.ts +14 -3
- package/dist/showcase/specimens/choices.d.ts.map +1 -1
- package/dist/showcase/specimens/choices.js +93 -13
- package/dist/showcase/specimens/compositions.d.ts.map +1 -1
- package/dist/showcase/specimens/compositions.js +136 -23
- package/dist/showcase/specimens/data.d.ts +12 -7
- package/dist/showcase/specimens/data.d.ts.map +1 -1
- package/dist/showcase/specimens/data.js +139 -35
- package/dist/showcase/specimens/feedback.d.ts +2 -0
- package/dist/showcase/specimens/feedback.d.ts.map +1 -1
- package/dist/showcase/specimens/feedback.js +39 -15
- package/dist/showcase/specimens/index.d.ts +20 -12
- package/dist/showcase/specimens/index.d.ts.map +1 -1
- package/dist/showcase/specimens/inputs.d.ts +4 -2
- package/dist/showcase/specimens/inputs.d.ts.map +1 -1
- package/dist/showcase/specimens/inputs.js +62 -19
- package/dist/showcase/specimens/menus.d.ts +0 -1
- package/dist/showcase/specimens/menus.d.ts.map +1 -1
- package/dist/showcase/specimens/menus.js +47 -17
- package/dist/showcase/specimens/navigation.d.ts +6 -4
- package/dist/showcase/specimens/navigation.d.ts.map +1 -1
- package/dist/showcase/specimens/navigation.js +61 -32
- package/dist/showcase/specimens/other.d.ts +1 -3
- package/dist/showcase/specimens/other.d.ts.map +1 -1
- package/dist/showcase/specimens/other.js +17 -13
- package/dist/showcase/specimens/status.d.ts +4 -1
- package/dist/showcase/specimens/status.d.ts.map +1 -1
- package/dist/showcase/specimens/status.js +64 -11
- package/dist/showcase/usage.generated.d.ts +1 -1
- package/dist/showcase/usage.generated.d.ts.map +1 -1
- package/dist/showcase/usage.generated.js +632 -544
- package/dist/standalone/index.js +1 -1
- package/dist/styles/components.css +13 -13
- package/dist/styles/globals.css +25 -0
- package/package.json +2 -3
- package/dist/components/approval-row.d.ts +0 -34
- package/dist/components/approval-row.d.ts.map +0 -1
- package/dist/components/approval-row.js +0 -27
- package/dist/components/channel-view.d.ts +0 -112
- package/dist/components/channel-view.d.ts.map +0 -1
- package/dist/components/channel-view.js +0 -84
- package/dist/components/dashboard-shell.d.ts +0 -51
- package/dist/components/dashboard-shell.d.ts.map +0 -1
- package/dist/components/dashboard-shell.js +0 -89
- package/dist/components/direction.d.ts +0 -2
- package/dist/components/direction.d.ts.map +0 -1
- package/dist/components/direction.js +0 -1
- package/dist/components/expandable-block.d.ts +0 -20
- package/dist/components/expandable-block.d.ts.map +0 -1
- package/dist/components/expandable-block.js +0 -32
- package/dist/components/form.d.ts +0 -42
- package/dist/components/form.d.ts.map +0 -1
- package/dist/components/form.js +0 -91
- package/dist/components/label-system.d.ts +0 -17
- package/dist/components/label-system.d.ts.map +0 -1
- package/dist/components/label-system.js +0 -21
- package/dist/components/memory-item.d.ts +0 -21
- package/dist/components/memory-item.d.ts.map +0 -1
- package/dist/components/memory-item.js +0 -18
- package/dist/components/menubar.d.ts +0 -43
- package/dist/components/menubar.d.ts.map +0 -1
- package/dist/components/menubar.js +0 -69
- package/dist/components/navigation-menu.d.ts +0 -26
- package/dist/components/navigation-menu.d.ts.map +0 -1
- package/dist/components/navigation-menu.js +0 -45
- package/dist/components/pagination.d.ts +0 -33
- package/dist/components/pagination.d.ts.map +0 -1
- package/dist/components/pagination.js +0 -41
- package/dist/components/plugin-slot-boundary.d.ts +0 -42
- package/dist/components/plugin-slot-boundary.d.ts.map +0 -1
- package/dist/components/plugin-slot-boundary.js +0 -41
- package/dist/components/status-row.d.ts +0 -32
- package/dist/components/status-row.d.ts.map +0 -1
- package/dist/components/status-row.js +0 -35
|
@@ -1,21 +1,52 @@
|
|
|
1
1
|
import type { ComponentProps } from "react";
|
|
2
2
|
type StatusTone = "good" | "muted" | "warn" | "bad";
|
|
3
|
-
|
|
3
|
+
type StatusDotName = {
|
|
4
|
+
label: string;
|
|
5
|
+
showLabel?: boolean;
|
|
6
|
+
decorative?: never;
|
|
7
|
+
} | {
|
|
8
|
+
decorative: true;
|
|
9
|
+
label?: never;
|
|
10
|
+
showLabel?: never;
|
|
11
|
+
};
|
|
12
|
+
type StatusDotProps = Omit<ComponentProps<"span">, "children" | "role" | "title" | "aria-hidden" | "aria-label" | "aria-labelledby"> & {
|
|
4
13
|
tone: StatusTone;
|
|
5
|
-
}
|
|
14
|
+
} & StatusDotName;
|
|
6
15
|
/**
|
|
7
|
-
* A small still dot
|
|
16
|
+
* A small still dot for one state, named by its label or by the word beside it.
|
|
8
17
|
*
|
|
9
18
|
* @family Status
|
|
10
|
-
* @when
|
|
11
|
-
* machine in a list
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* @
|
|
19
|
+
* @when "Deployment lifecycle only. `state` accepts `QUEUED | BUILDING | READY | ERROR | CANCELED | DELETED`." (https://vercel.com/geist/status-dot)
|
|
20
|
+
* Ours: any one state in dense chrome (a channel, a machine in a list), set as `tone`. It always
|
|
21
|
+
* says which state it shows: `label` names it (*Ready*), and `decorative` stands for a word beside
|
|
22
|
+
* it that already does. The type asks for one of the two.
|
|
23
|
+
* "Don’t flash the color through every transitional state on a polling tick; only update when the readyState changes." (https://vercel.com/geist/status-dot)
|
|
24
|
+
* Ours: pick the tone from the state and keep it until the state changes.
|
|
25
|
+
* @instead "For non-deployment statuses (Workflow runs, Queue messages, Sandbox, Cron jobs), use a `Badge` with the canonical state vocabulary instead of repurposing the dot." (https://vercel.com/geist/status-dot)
|
|
26
|
+
* Ours: that `Badge` is `StatusBadge`; so is a status that stands alone, or one that needs a mark
|
|
27
|
+
* and a word.
|
|
28
|
+
* "For health summaries that need a number (uptime, hit rate), use `Gauge`; for in-flight work with a knowable total, use `Progress`." (https://vercel.com/geist/status-dot)
|
|
29
|
+
* Ours: something in motion is the waiting line or an Agent's orb; the dot has no info tone.
|
|
30
|
+
* @behaviour "The dot animates while `BUILDING` or `QUEUED` and goes static once the deployment reaches a terminal state." (https://vercel.com/geist/status-dot)
|
|
31
|
+
* "Don’t add a separate spinner alongside it." (https://vercel.com/geist/status-dot) Ours: still,
|
|
32
|
+
* even while a state is in progress: it never pulses. A 10 px dot; tones are `good`, `muted`,
|
|
33
|
+
* `warn`, `bad`, at full strength. Colour sits on the dot alone: with `showLabel` the word beside
|
|
34
|
+
* it is 14 px and neutral, never in the tone's colour. `label` alone draws the dot with the word as
|
|
35
|
+
* its name and tooltip; `showLabel` draws the word 8 px after it, for a dot with no other text
|
|
36
|
+
* around it.
|
|
37
|
+
* @words "Use `label` only when the dot stands alone without surrounding text; Geist sentence-cases the state for you (`Building`, `Ready`, `Error`)." (https://vercel.com/geist/status-dot)
|
|
38
|
+
* Ours: `label` is the required name unless the dot is `decorative`, and we write it in sentence
|
|
39
|
+
* case ourselves: *Ready*, *Error*, *Canceled*.
|
|
40
|
+
* "Don’t wrap the dot in extra prose like `Status: Ready`. The label already names the state." (https://vercel.com/geist/status-dot)
|
|
41
|
+
* @access "The component composes its own `aria-label` from `titlePrefix` plus the state message; don’t override it with a generic `aria-label="status"`." (https://vercel.com/geist/status-dot)
|
|
42
|
+
* Ours: there is no `titlePrefix` and no `aria-label` prop; `label` is the dot's name, an image
|
|
43
|
+
* role with that name.
|
|
44
|
+
* "When the dot sits inline with text that already names the state, mark the dot decorative with `aria-hidden` so screen readers don’t announce it twice." (https://vercel.com/geist/status-dot)
|
|
45
|
+
* Ours: `decorative` does it; the word beside the dot must name the state, and if that word is
|
|
46
|
+
* missing, the state is missing.
|
|
47
|
+
* "Color is not the only signal: every state ships with a distinct title and label so colorblind users get the same information." (https://vercel.com/geist/status-dot)
|
|
17
48
|
*/
|
|
18
|
-
declare function StatusDot({ className, tone, ...props }: StatusDotProps): import("react").JSX.Element;
|
|
49
|
+
declare function StatusDot({ className, tone, label, showLabel, decorative, ...props }: StatusDotProps): import("react").JSX.Element;
|
|
19
50
|
export { StatusDot };
|
|
20
51
|
export type { StatusTone };
|
|
21
52
|
//# sourceMappingURL=status-dot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status-dot.d.ts","sourceRoot":"","sources":["../../src/components/status-dot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAG5C,KAAK,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"status-dot.d.ts","sourceRoot":"","sources":["../../src/components/status-dot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAG5C,KAAK,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC;AAUpD,KAAK,aAAa,GACd;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAAC,UAAU,CAAC,EAAE,KAAK,CAAA;CAAE,GAC1D;IAAE,UAAU,EAAE,IAAI,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAC;IAAC,SAAS,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAE3D,KAAK,cAAc,GAAG,IAAI,CACxB,cAAc,CAAC,MAAM,CAAC,EACtB,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,aAAa,GAAG,YAAY,GAAG,iBAAiB,CACjF,GAAG;IACF,IAAI,EAAE,UAAU,CAAC;CAClB,GAAG,aAAa,CAAC;AAElB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,iBAAS,SAAS,CAAC,EACjB,SAAS,EACT,IAAI,EACJ,KAAK,EACL,SAAiB,EACjB,UAAU,EACV,GAAG,KAAK,EACT,EAAE,cAAc,+BAuChB;AACD,OAAO,EAAE,SAAS,EAAE,CAAC;AACrB,YAAY,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "../lib/utils.js";
|
|
3
3
|
const TONE_BG_CLASS = {
|
|
4
4
|
good: "bg-success",
|
|
@@ -6,19 +6,48 @@ const TONE_BG_CLASS = {
|
|
|
6
6
|
warn: "bg-warning",
|
|
7
7
|
bad: "bg-destructive",
|
|
8
8
|
};
|
|
9
|
+
const DOT_CLASS = "inline-block size-2.5 shrink-0 rounded-full";
|
|
9
10
|
/**
|
|
10
|
-
* A small still dot
|
|
11
|
+
* A small still dot for one state, named by its label or by the word beside it.
|
|
11
12
|
*
|
|
12
13
|
* @family Status
|
|
13
|
-
* @when
|
|
14
|
-
* machine in a list
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* @
|
|
14
|
+
* @when "Deployment lifecycle only. `state` accepts `QUEUED | BUILDING | READY | ERROR | CANCELED | DELETED`." (https://vercel.com/geist/status-dot)
|
|
15
|
+
* Ours: any one state in dense chrome (a channel, a machine in a list), set as `tone`. It always
|
|
16
|
+
* says which state it shows: `label` names it (*Ready*), and `decorative` stands for a word beside
|
|
17
|
+
* it that already does. The type asks for one of the two.
|
|
18
|
+
* "Don’t flash the color through every transitional state on a polling tick; only update when the readyState changes." (https://vercel.com/geist/status-dot)
|
|
19
|
+
* Ours: pick the tone from the state and keep it until the state changes.
|
|
20
|
+
* @instead "For non-deployment statuses (Workflow runs, Queue messages, Sandbox, Cron jobs), use a `Badge` with the canonical state vocabulary instead of repurposing the dot." (https://vercel.com/geist/status-dot)
|
|
21
|
+
* Ours: that `Badge` is `StatusBadge`; so is a status that stands alone, or one that needs a mark
|
|
22
|
+
* and a word.
|
|
23
|
+
* "For health summaries that need a number (uptime, hit rate), use `Gauge`; for in-flight work with a knowable total, use `Progress`." (https://vercel.com/geist/status-dot)
|
|
24
|
+
* Ours: something in motion is the waiting line or an Agent's orb; the dot has no info tone.
|
|
25
|
+
* @behaviour "The dot animates while `BUILDING` or `QUEUED` and goes static once the deployment reaches a terminal state." (https://vercel.com/geist/status-dot)
|
|
26
|
+
* "Don’t add a separate spinner alongside it." (https://vercel.com/geist/status-dot) Ours: still,
|
|
27
|
+
* even while a state is in progress: it never pulses. A 10 px dot; tones are `good`, `muted`,
|
|
28
|
+
* `warn`, `bad`, at full strength. Colour sits on the dot alone: with `showLabel` the word beside
|
|
29
|
+
* it is 14 px and neutral, never in the tone's colour. `label` alone draws the dot with the word as
|
|
30
|
+
* its name and tooltip; `showLabel` draws the word 8 px after it, for a dot with no other text
|
|
31
|
+
* around it.
|
|
32
|
+
* @words "Use `label` only when the dot stands alone without surrounding text; Geist sentence-cases the state for you (`Building`, `Ready`, `Error`)." (https://vercel.com/geist/status-dot)
|
|
33
|
+
* Ours: `label` is the required name unless the dot is `decorative`, and we write it in sentence
|
|
34
|
+
* case ourselves: *Ready*, *Error*, *Canceled*.
|
|
35
|
+
* "Don’t wrap the dot in extra prose like `Status: Ready`. The label already names the state." (https://vercel.com/geist/status-dot)
|
|
36
|
+
* @access "The component composes its own `aria-label` from `titlePrefix` plus the state message; don’t override it with a generic `aria-label="status"`." (https://vercel.com/geist/status-dot)
|
|
37
|
+
* Ours: there is no `titlePrefix` and no `aria-label` prop; `label` is the dot's name, an image
|
|
38
|
+
* role with that name.
|
|
39
|
+
* "When the dot sits inline with text that already names the state, mark the dot decorative with `aria-hidden` so screen readers don’t announce it twice." (https://vercel.com/geist/status-dot)
|
|
40
|
+
* Ours: `decorative` does it; the word beside the dot must name the state, and if that word is
|
|
41
|
+
* missing, the state is missing.
|
|
42
|
+
* "Color is not the only signal: every state ships with a distinct title and label so colorblind users get the same information." (https://vercel.com/geist/status-dot)
|
|
20
43
|
*/
|
|
21
|
-
function StatusDot({ className, tone, ...props }) {
|
|
22
|
-
|
|
44
|
+
function StatusDot({ className, tone, label, showLabel = false, decorative, ...props }) {
|
|
45
|
+
if (decorative) {
|
|
46
|
+
return (_jsx("span", { ...props, "aria-hidden": "true", className: cn(DOT_CLASS, TONE_BG_CLASS[tone], className), "data-slot": "status-dot", "data-tone": tone }));
|
|
47
|
+
}
|
|
48
|
+
if (showLabel) {
|
|
49
|
+
return (_jsxs("span", { ...props, className: cn("inline-flex items-center gap-2 text-sm leading-4 text-foreground", className), "data-slot": "status-dot", "data-tone": tone, children: [_jsx("span", { "aria-hidden": "true", className: cn(DOT_CLASS, TONE_BG_CLASS[tone]) }), label] }));
|
|
50
|
+
}
|
|
51
|
+
return (_jsx("span", { ...props, "aria-label": label, className: cn(DOT_CLASS, TONE_BG_CLASS[tone], className), "data-slot": "status-dot", "data-tone": tone, role: "img", title: label }));
|
|
23
52
|
}
|
|
24
53
|
export { StatusDot };
|
|
@@ -1,21 +1,52 @@
|
|
|
1
1
|
import { Switch as SwitchPrimitive } from "@base-ui/react/switch";
|
|
2
|
+
import { type ControlName } from "../internal/control-name.js";
|
|
2
3
|
/**
|
|
3
4
|
* A setting that is on or off.
|
|
4
5
|
*
|
|
5
6
|
* @family Choices
|
|
6
|
-
* @when
|
|
7
|
-
*
|
|
8
|
-
* `
|
|
9
|
-
* @
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
7
|
+
* @when "Use Toggle for a single boolean setting where ON takes effect immediately, like `Password
|
|
8
|
+
* Protection` or `Auto-Cancel Builds`." (https://vercel.com/geist/toggle) Ours: Geist's `Toggle` is
|
|
9
|
+
* our `Switch`, inside a settings section.
|
|
10
|
+
* @instead "Switch to `Checkbox` for a multi-select list, or to `Switch` for 2–3 mutually exclusive
|
|
11
|
+
* views." (https://vercel.com/geist/toggle) Ours: Geist's `Switch` is our `SegmentedControl`. A
|
|
12
|
+
* tool button that stays pressed is a `ToggleGroup`. Choosing between named values is a
|
|
13
|
+
* `RadioGroup`.
|
|
14
|
+
* @behaviour "`checked` is required and the component is controlled. Own the state and update it
|
|
15
|
+
* from `onChange`." (https://vercel.com/geist/toggle) "Persist on change and surface the result in
|
|
16
|
+
* a `useToasts().success(…)` toast (`Password protection enabled`); don’t leave the user wondering
|
|
17
|
+
* whether the flip stuck." (https://vercel.com/geist/toggle) "Pair with a form footer only when the
|
|
18
|
+
* setting needs an explicit `Save` step." (https://vercel.com/geist/toggle) "Disable Toggle only
|
|
19
|
+
* when the action is impossible (missing plan, locked policy); pair with helper text or a `Tooltip`
|
|
20
|
+
* that names the resolver." (https://vercel.com/geist/toggle) Ours: `checked` is optional, since a
|
|
21
|
+
* switch also runs uncontrolled with `defaultChecked`; the toast is raised with `showMessageToast`;
|
|
22
|
+
* the reason for a disabled switch is written in the card's footer, and it is left off. Always
|
|
23
|
+
* named: `aria-label` or `aria-labelledby`, or an `id` that a `FieldLabel`'s `htmlFor` points at,
|
|
24
|
+
* and a switch with none of them does not compile. A bare `Switch` is the 28 by 14 px track with an
|
|
25
|
+
* 11 px thumb; `md` is 36 by 20 px and `lg` 40 by 24 px. Colour: off is the input grey, on is
|
|
26
|
+
* ink, and a disabled switch turns grey, on or off, with a greyer thumb and no shadow. Space flips
|
|
27
|
+
* it. On a settings page it applies at once and the product's toast confirms it, in one of two
|
|
28
|
+
* places: in the card's header at the right of the title when the switch is the whole card, the
|
|
29
|
+
* footer holding only its line, or at the end of a row of a card of several settings, the label to
|
|
30
|
+
* its left. A failed change leaves the switch showing the true state.
|
|
31
|
+
* @words "The label is `children`, not a `label` prop. Title Case noun phrase, 1–4 words, naming
|
|
32
|
+
* what is true when ON: `Password Protection`, not `Enable Password Protection`."
|
|
33
|
+
* (https://vercel.com/geist/toggle) "Render an optional one-sentence description as a sibling under
|
|
34
|
+
* the label that explains ON only." (https://vercel.com/geist/toggle) "Don’t describe OFF; it’s the
|
|
35
|
+
* negation." (https://vercel.com/geist/toggle) "Keep `labelCasing="title"` (the default) so labels
|
|
36
|
+
* match other Title Case surfaces." (https://vercel.com/geist/toggle) "Use `labelCasing="normal"`
|
|
37
|
+
* only when sentence-case content sits inline next to the toggle."
|
|
38
|
+
* (https://vercel.com/geist/toggle) Ours: the label is 12 px at medium weight, in sentence case:
|
|
39
|
+
* *Approvals*, with the card's description in one sentence. The state word is a separate word
|
|
40
|
+
* beside the switch, not its name.
|
|
41
|
+
* @access "Provide an accessible name through `children`, `aria-label`, or `aria-labelledby`."
|
|
42
|
+
* (https://vercel.com/geist/toggle) "Geist warns in development if all three are missing."
|
|
43
|
+
* (https://vercel.com/geist/toggle) "Set `aria-label` only when the visible label sits elsewhere on
|
|
44
|
+
* the row; otherwise let `children` carry it so sighted and screen-reader copy stay aligned."
|
|
45
|
+
* (https://vercel.com/geist/toggle) Ours: `role="switch"` with `aria-checked`, the name the same in
|
|
46
|
+
* both states; a missing name does not compile.
|
|
16
47
|
*/
|
|
17
|
-
declare function Switch({ className, size, ...props }: SwitchPrimitive.Root.Props & {
|
|
18
|
-
size?: "sm" | "
|
|
48
|
+
declare function Switch({ className, size, ...props }: SwitchPrimitive.Root.Props & ControlName & {
|
|
49
|
+
size?: "sm" | "md" | "lg";
|
|
19
50
|
}): import("react").JSX.Element;
|
|
20
51
|
export { Switch };
|
|
21
52
|
//# sourceMappingURL=switch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../src/components/switch.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../src/components/switch.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGlE,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,IAAW,EACX,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,IAAI,CAAC,KAAK,GAC3B,WAAW,GAAG;IACZ,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CAC3B,+BAiBF;AAED,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -5,18 +5,48 @@ import { cn } from "../lib/utils.js";
|
|
|
5
5
|
* A setting that is on or off.
|
|
6
6
|
*
|
|
7
7
|
* @family Choices
|
|
8
|
-
* @when
|
|
9
|
-
*
|
|
10
|
-
* `
|
|
11
|
-
* @
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
8
|
+
* @when "Use Toggle for a single boolean setting where ON takes effect immediately, like `Password
|
|
9
|
+
* Protection` or `Auto-Cancel Builds`." (https://vercel.com/geist/toggle) Ours: Geist's `Toggle` is
|
|
10
|
+
* our `Switch`, inside a settings section.
|
|
11
|
+
* @instead "Switch to `Checkbox` for a multi-select list, or to `Switch` for 2–3 mutually exclusive
|
|
12
|
+
* views." (https://vercel.com/geist/toggle) Ours: Geist's `Switch` is our `SegmentedControl`. A
|
|
13
|
+
* tool button that stays pressed is a `ToggleGroup`. Choosing between named values is a
|
|
14
|
+
* `RadioGroup`.
|
|
15
|
+
* @behaviour "`checked` is required and the component is controlled. Own the state and update it
|
|
16
|
+
* from `onChange`." (https://vercel.com/geist/toggle) "Persist on change and surface the result in
|
|
17
|
+
* a `useToasts().success(…)` toast (`Password protection enabled`); don’t leave the user wondering
|
|
18
|
+
* whether the flip stuck." (https://vercel.com/geist/toggle) "Pair with a form footer only when the
|
|
19
|
+
* setting needs an explicit `Save` step." (https://vercel.com/geist/toggle) "Disable Toggle only
|
|
20
|
+
* when the action is impossible (missing plan, locked policy); pair with helper text or a `Tooltip`
|
|
21
|
+
* that names the resolver." (https://vercel.com/geist/toggle) Ours: `checked` is optional, since a
|
|
22
|
+
* switch also runs uncontrolled with `defaultChecked`; the toast is raised with `showMessageToast`;
|
|
23
|
+
* the reason for a disabled switch is written in the card's footer, and it is left off. Always
|
|
24
|
+
* named: `aria-label` or `aria-labelledby`, or an `id` that a `FieldLabel`'s `htmlFor` points at,
|
|
25
|
+
* and a switch with none of them does not compile. A bare `Switch` is the 28 by 14 px track with an
|
|
26
|
+
* 11 px thumb; `md` is 36 by 20 px and `lg` 40 by 24 px. Colour: off is the input grey, on is
|
|
27
|
+
* ink, and a disabled switch turns grey, on or off, with a greyer thumb and no shadow. Space flips
|
|
28
|
+
* it. On a settings page it applies at once and the product's toast confirms it, in one of two
|
|
29
|
+
* places: in the card's header at the right of the title when the switch is the whole card, the
|
|
30
|
+
* footer holding only its line, or at the end of a row of a card of several settings, the label to
|
|
31
|
+
* its left. A failed change leaves the switch showing the true state.
|
|
32
|
+
* @words "The label is `children`, not a `label` prop. Title Case noun phrase, 1–4 words, naming
|
|
33
|
+
* what is true when ON: `Password Protection`, not `Enable Password Protection`."
|
|
34
|
+
* (https://vercel.com/geist/toggle) "Render an optional one-sentence description as a sibling under
|
|
35
|
+
* the label that explains ON only." (https://vercel.com/geist/toggle) "Don’t describe OFF; it’s the
|
|
36
|
+
* negation." (https://vercel.com/geist/toggle) "Keep `labelCasing="title"` (the default) so labels
|
|
37
|
+
* match other Title Case surfaces." (https://vercel.com/geist/toggle) "Use `labelCasing="normal"`
|
|
38
|
+
* only when sentence-case content sits inline next to the toggle."
|
|
39
|
+
* (https://vercel.com/geist/toggle) Ours: the label is 12 px at medium weight, in sentence case:
|
|
40
|
+
* *Approvals*, with the card's description in one sentence. The state word is a separate word
|
|
41
|
+
* beside the switch, not its name.
|
|
42
|
+
* @access "Provide an accessible name through `children`, `aria-label`, or `aria-labelledby`."
|
|
43
|
+
* (https://vercel.com/geist/toggle) "Geist warns in development if all three are missing."
|
|
44
|
+
* (https://vercel.com/geist/toggle) "Set `aria-label` only when the visible label sits elsewhere on
|
|
45
|
+
* the row; otherwise let `children` carry it so sighted and screen-reader copy stay aligned."
|
|
46
|
+
* (https://vercel.com/geist/toggle) Ours: `role="switch"` with `aria-checked`, the name the same in
|
|
47
|
+
* both states; a missing name does not compile.
|
|
18
48
|
*/
|
|
19
|
-
function Switch({ className, size = "
|
|
20
|
-
return (_jsx(SwitchPrimitive.Root, { "data-slot": "switch", "data-size": size, className: cn("nc-transition-paint peer group/switch relative inline-flex shrink-0 items-
|
|
49
|
+
function Switch({ className, size = "sm", ...props }) {
|
|
50
|
+
return (_jsx(SwitchPrimitive.Root, { "data-slot": "switch", "data-size": size, className: cn("nc-transition-paint peer group/switch relative inline-flex shrink-0 items-start rounded-full border border-transparent p-0 after:absolute after:top-1/2 after:left-1/2 after:size-touch-target after:-translate-x-1/2 after:-translate-y-1/2 aria-invalid:border-destructive data-[size=sm]:h-3.5 data-[size=sm]:w-7 data-[size=md]:h-5 data-[size=md]:w-9 data-[size=lg]:h-6 data-[size=lg]:w-10 data-checked:bg-primary data-unchecked:bg-input data-disabled:cursor-not-allowed data-disabled:data-checked:bg-input/50 [@media(hover:hover)_and_(pointer:fine)]:after:hidden", className), ...props, children: _jsx(SwitchPrimitive.Thumb, { "data-slot": "switch-thumb", className: "pointer-events-none mt-px block rounded-full bg-background ring-0 nc-transition-transform not-data-disabled:nc-elevation-resting group-data-[size=sm]/switch:ml-px group-data-[size=sm]/switch:size-2.75 group-data-[size=md]/switch:size-4.25 group-data-[size=lg]/switch:ml-px group-data-[size=lg]/switch:size-5.25 group-data-[size=sm]/switch:data-checked:translate-x-3.5 group-data-[size=md]/switch:data-checked:translate-x-4.25 group-data-[size=lg]/switch:data-checked:translate-x-4 data-disabled:bg-muted data-unchecked:translate-x-0" }) }));
|
|
21
51
|
}
|
|
22
52
|
export { Switch };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { type CollectionNote } from "../internal/collection-note.js";
|
|
2
3
|
import { type CardSurface } from "./card.js";
|
|
3
4
|
/**
|
|
4
|
-
* The frame a collection's table sits in: a heading
|
|
5
|
-
* toolbar
|
|
5
|
+
* The frame a collection's table sits in: a heading with the collection's own
|
|
6
|
+
* toolbar at its trailing edge, the table, a labelled total, and the recessed footer strip.
|
|
6
7
|
*
|
|
7
8
|
* The Portal's DataTable and Nadia's record sections draw this one frame, so a
|
|
8
9
|
* registry card ends the same way in both products.
|
|
@@ -12,27 +13,35 @@ import { type CardSurface } from "./card.js";
|
|
|
12
13
|
* the recessed footer strip.
|
|
13
14
|
* @instead An entity collection that is the page's whole job is `CollectionPage`. A chart is
|
|
14
15
|
* `ChartCard`. One object's facts are `SettingsFactsSection`.
|
|
15
|
-
* @behaviour The heading
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* labelled total
|
|
16
|
+
* @behaviour The heading and a separator come first when given, the toolbar on the heading's row at
|
|
17
|
+
* its trailing edge, title left and controls right, as Vercel heads a card's list; on a card under
|
|
18
|
+
* 576 px the toolbar takes its own line under the title. The table's first and last columns stand
|
|
19
|
+
* in from the card's edges by the card's spacing, so the first column lines up with the title. The summary row is a
|
|
20
|
+
* labelled total under the table, padded like a table footer so its label lines up with the first
|
|
21
|
+
* column and set in ink, medium text; the footer strip holds the hint on the left and the count or
|
|
22
|
+
* paging on the right. A `note` about the whole list stands in a strip of its own under that one:
|
|
23
|
+
* one muted line with an optional *Learn more* at the left and one secondary action at the right,
|
|
24
|
+
* as Vercel ends a deployments list ("Deployment Retention is enabled", *View Recently Deleted*).
|
|
25
|
+
* @words “Pagination labels are `Previous` and `Next`. Page-count copy reads `Page 2 of 7` or `21–40 of 142` with an en-dash inside the range.” (https://vercel.com/geist/table)
|
|
26
|
+
* Ours: the title names the collection. The footer is a count or the paging; the summary is a labelled total. Never a help sentence in the footer.
|
|
20
27
|
* @access A `section` whose title is an `h2`; the summary is a `dl`.
|
|
21
28
|
*/
|
|
22
|
-
declare function TableCard({ title, description, actions, toolbar, summary, footer, footerHint, children, className, surface, ...props }: Omit<React.ComponentProps<"section">, "title"> & {
|
|
29
|
+
declare function TableCard({ title, description, actions, toolbar, summary, footer, footerHint, note, children, className, surface, ...props }: Omit<React.ComponentProps<"section">, "title"> & {
|
|
23
30
|
title?: React.ReactNode;
|
|
24
31
|
description?: React.ReactNode;
|
|
25
32
|
actions?: React.ReactNode;
|
|
26
|
-
/** The collection's search, filters and actions,
|
|
33
|
+
/** The collection's search, filters and actions, on the heading's row at its trailing edge. */
|
|
27
34
|
toolbar?: React.ReactNode;
|
|
28
35
|
/** A labelled total under the table. */
|
|
29
36
|
summary?: {
|
|
30
37
|
label: React.ReactNode;
|
|
31
38
|
value: React.ReactNode;
|
|
32
|
-
};
|
|
39
|
+
} | undefined;
|
|
33
40
|
footer?: React.ReactNode;
|
|
34
41
|
footerHint?: React.ReactNode;
|
|
35
|
-
|
|
42
|
+
/** The note about the whole list, in its own strip under the count and the paging: a line, Learn more, one secondary action. */
|
|
43
|
+
note?: CollectionNote | undefined;
|
|
44
|
+
surface?: CardSurface | undefined;
|
|
36
45
|
}): React.JSX.Element;
|
|
37
|
-
export { TableCard };
|
|
46
|
+
export { TableCard, type CollectionNote };
|
|
38
47
|
//# sourceMappingURL=table-card.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-card.d.ts","sourceRoot":"","sources":["../../src/components/table-card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"table-card.d.ts","sourceRoot":"","sources":["../../src/components/table-card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAuB,KAAK,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEtF,OAAO,EAA4D,KAAK,WAAW,EAAE,MAAM,QAAQ,CAAC;AAGpG;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,iBAAS,SAAS,CAAC,EACjB,KAAK,EACL,WAAW,EACX,OAAO,EACP,OAAO,EACP,OAAO,EACP,MAAM,EACN,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,OAAmB,EACnB,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,GAAG;IAClD,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,+FAA+F;IAC/F,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,wCAAwC;IACxC,OAAO,CAAC,EAAE;QAAE,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;QAAC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAA;KAAE,GAAG,SAAS,CAAC;IACzE,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,gIAAgI;IAChI,IAAI,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;IAClC,OAAO,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;CACnC,qBA0DA;AAED,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "../lib/utils.js";
|
|
3
|
+
import { CollectionNoteStrip } from "../internal/collection-note.js";
|
|
3
4
|
import { FooterStrip } from "../internal/footer-strip.js";
|
|
4
5
|
import { Card, CardAction, CardDescription, CardHeader, CardTitle } from "./card.js";
|
|
5
6
|
import { Separator } from "./separator.js";
|
|
6
7
|
/**
|
|
7
|
-
* The frame a collection's table sits in: a heading
|
|
8
|
-
* toolbar
|
|
8
|
+
* The frame a collection's table sits in: a heading with the collection's own
|
|
9
|
+
* toolbar at its trailing edge, the table, a labelled total, and the recessed footer strip.
|
|
9
10
|
*
|
|
10
11
|
* The Portal's DataTable and Nadia's record sections draw this one frame, so a
|
|
11
12
|
* registry card ends the same way in both products.
|
|
@@ -15,15 +16,22 @@ import { Separator } from "./separator.js";
|
|
|
15
16
|
* the recessed footer strip.
|
|
16
17
|
* @instead An entity collection that is the page's whole job is `CollectionPage`. A chart is
|
|
17
18
|
* `ChartCard`. One object's facts are `SettingsFactsSection`.
|
|
18
|
-
* @behaviour The heading
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* labelled total
|
|
19
|
+
* @behaviour The heading and a separator come first when given, the toolbar on the heading's row at
|
|
20
|
+
* its trailing edge, title left and controls right, as Vercel heads a card's list; on a card under
|
|
21
|
+
* 576 px the toolbar takes its own line under the title. The table's first and last columns stand
|
|
22
|
+
* in from the card's edges by the card's spacing, so the first column lines up with the title. The summary row is a
|
|
23
|
+
* labelled total under the table, padded like a table footer so its label lines up with the first
|
|
24
|
+
* column and set in ink, medium text; the footer strip holds the hint on the left and the count or
|
|
25
|
+
* paging on the right. A `note` about the whole list stands in a strip of its own under that one:
|
|
26
|
+
* one muted line with an optional *Learn more* at the left and one secondary action at the right,
|
|
27
|
+
* as Vercel ends a deployments list ("Deployment Retention is enabled", *View Recently Deleted*).
|
|
28
|
+
* @words “Pagination labels are `Previous` and `Next`. Page-count copy reads `Page 2 of 7` or `21–40 of 142` with an en-dash inside the range.” (https://vercel.com/geist/table)
|
|
29
|
+
* Ours: the title names the collection. The footer is a count or the paging; the summary is a labelled total. Never a help sentence in the footer.
|
|
23
30
|
* @access A `section` whose title is an `h2`; the summary is a `dl`.
|
|
24
31
|
*/
|
|
25
|
-
function TableCard({ title, description, actions, toolbar, summary, footer, footerHint, children, className, surface = "resting", ...props }) {
|
|
32
|
+
function TableCard({ title, description, actions, toolbar, summary, footer, footerHint, note, children, className, surface = "resting", ...props }) {
|
|
26
33
|
const heading = title || description || actions;
|
|
27
|
-
return (_jsxs(Card, { render: _jsx("section", { ...props, "data-slot": "table-card" }), surface: surface, className: cn("min-w-0 gap-0 py-0", className), children: [(heading || toolbar) && (_jsxs(_Fragment, { children: [
|
|
34
|
+
return (_jsxs(Card, { render: _jsx("section", { ...props, "data-slot": "table-card" }), surface: surface, className: cn("min-w-0 gap-0 py-0", className), children: [(heading || toolbar) && (_jsxs(_Fragment, { children: [_jsxs(CardHeader, { className: "py-(--card-spacing)", children: [title && (_jsx(CardTitle, { children: _jsx("h2", { children: title }) })), description && _jsx(CardDescription, { children: description }), actions || toolbar ? (_jsxs(CardAction, { className: cn("flex min-w-0 items-center gap-2", toolbar &&
|
|
35
|
+
"@max-xl/card-header:col-span-2 @max-xl/card-header:col-start-1 @max-xl/card-header:row-span-1 @max-xl/card-header:row-start-auto @max-xl/card-header:justify-self-stretch"), children: [actions, toolbar ? (_jsx("div", { "data-slot": "table-card-toolbar", className: "min-w-0 flex-1", children: toolbar })) : null] })) : null] }), _jsx(Separator, {})] })), _jsx("div", { "data-slot": "table-card-body", className: "min-w-0 [&_[data-slot=table-cell]:first-child]:pl-(--card-spacing) [&_[data-slot=table-cell]:last-child]:pr-(--card-spacing) [&_[data-slot=table-head]:first-child]:pl-(--card-spacing) [&_[data-slot=table-head]:last-child]:pr-(--card-spacing)", children: children }), summary && (_jsxs("dl", { "data-slot": "table-card-summary", className: "flex min-w-0 items-start justify-between gap-4 border-t border-border px-(--card-spacing) py-2.5 text-sm font-medium", children: [_jsx("dt", { children: summary.label }), _jsx("dd", { className: "text-right tabular-nums", children: summary.value })] })), _jsx(FooterStrip, { hint: footerHint, hintSlot: "table-card-hint", children: footer }), note ? _jsx(CollectionNoteStrip, { note: note }) : null] }));
|
|
28
36
|
}
|
|
29
37
|
export { TableCard };
|
|
@@ -1,28 +1,60 @@
|
|
|
1
1
|
export declare const tableCompactLayouts: {
|
|
2
|
+
/** Only by request: a row that must stay one line on any card wider than a phone's. */
|
|
3
|
+
readonly narrow: {
|
|
4
|
+
readonly width: 448;
|
|
5
|
+
readonly column: "hidden @md/table:table-cell";
|
|
6
|
+
readonly track: "hidden @md/table:table-column";
|
|
7
|
+
readonly row: "@max-md/table:[&>td]:border-b-0 @max-md/table:[&>td]:after:hidden @max-md/table:h-auto! @max-md/table:[&>td]:pb-1!";
|
|
8
|
+
readonly details: "@md/table:hidden";
|
|
9
|
+
readonly table: "@max-md/table:table-auto @max-md/table:[&_td]:whitespace-normal @max-md/table:[&_th:not(:first-child):not([data-identity])]:w-px @max-md/table:[&_tr:not([data-slot=table-detail-row])>td:not(:first-child)]:pl-0 @max-md/table:[&_tr:not([data-slot=table-detail-row])>td:not(:first-child):not(:last-child)]:pr-0";
|
|
10
|
+
};
|
|
2
11
|
readonly tight: {
|
|
12
|
+
readonly width: 576;
|
|
3
13
|
readonly column: "hidden @xl/table:table-cell";
|
|
4
|
-
readonly
|
|
14
|
+
readonly track: "hidden @xl/table:table-column";
|
|
15
|
+
readonly row: "@max-xl/table:[&>td]:border-b-0 @max-xl/table:[&>td]:after:hidden @max-xl/table:h-auto! @max-xl/table:[&>td]:pb-1!";
|
|
5
16
|
readonly details: "@xl/table:hidden";
|
|
6
|
-
readonly table: "@max-xl/table:table-auto @max-xl/table:[&_td]:whitespace-normal @max-xl/table:[&_th:not(:first-child)
|
|
17
|
+
readonly table: "@max-xl/table:table-auto @max-xl/table:[&_td]:whitespace-normal @max-xl/table:[&_th:not(:first-child):not([data-identity])]:w-px";
|
|
7
18
|
};
|
|
8
19
|
readonly standard: {
|
|
20
|
+
readonly width: 768;
|
|
9
21
|
readonly column: "hidden @3xl/table:table-cell";
|
|
10
|
-
readonly
|
|
22
|
+
readonly track: "hidden @3xl/table:table-column";
|
|
23
|
+
readonly row: "@max-3xl/table:[&>td]:border-b-0 @max-3xl/table:[&>td]:after:hidden @max-3xl/table:h-auto! @max-3xl/table:[&>td]:pb-1!";
|
|
11
24
|
readonly details: "@3xl/table:hidden";
|
|
12
|
-
readonly table: "@max-3xl/table:table-auto @max-3xl/table:[&_td]:whitespace-normal @max-3xl/table:[&_th:not(:first-child)
|
|
25
|
+
readonly table: "@max-3xl/table:table-auto @max-3xl/table:[&_td]:whitespace-normal @max-3xl/table:[&_th:not(:first-child):not([data-identity])]:w-px";
|
|
13
26
|
};
|
|
14
27
|
readonly wide: {
|
|
28
|
+
readonly width: 1024;
|
|
15
29
|
readonly column: "hidden @5xl/table:table-cell";
|
|
16
|
-
readonly
|
|
30
|
+
readonly track: "hidden @5xl/table:table-column";
|
|
31
|
+
readonly row: "@max-5xl/table:[&>td]:border-b-0 @max-5xl/table:[&>td]:after:hidden @max-5xl/table:h-auto! @max-5xl/table:[&>td]:pb-1!";
|
|
17
32
|
readonly details: "@5xl/table:hidden";
|
|
18
|
-
readonly table: "@max-5xl/table:table-auto @max-5xl/table:[&_td]:whitespace-normal @max-5xl/table:[&_th:not(:first-child)
|
|
33
|
+
readonly table: "@max-5xl/table:table-auto @max-5xl/table:[&_td]:whitespace-normal @max-5xl/table:[&_th:not(:first-child):not([data-identity])]:w-px";
|
|
34
|
+
};
|
|
35
|
+
readonly roomy: {
|
|
36
|
+
readonly width: 1088;
|
|
37
|
+
readonly column: "hidden @min-[68rem]/table:table-cell";
|
|
38
|
+
readonly track: "hidden @min-[68rem]/table:table-column";
|
|
39
|
+
readonly row: "@max-[68rem]/table:[&>td]:border-b-0 @max-[68rem]/table:[&>td]:after:hidden @max-[68rem]/table:h-auto! @max-[68rem]/table:[&>td]:pb-1!";
|
|
40
|
+
readonly details: "@min-[68rem]/table:hidden";
|
|
41
|
+
readonly table: "@max-[68rem]/table:table-auto @max-[68rem]/table:[&_td]:whitespace-normal @max-[68rem]/table:[&_th:not(:first-child):not([data-identity])]:w-px";
|
|
19
42
|
};
|
|
20
43
|
readonly spacious: {
|
|
44
|
+
readonly width: 1152;
|
|
21
45
|
readonly column: "hidden @6xl/table:table-cell";
|
|
22
|
-
readonly
|
|
46
|
+
readonly track: "hidden @6xl/table:table-column";
|
|
47
|
+
readonly row: "@max-6xl/table:[&>td]:border-b-0 @max-6xl/table:[&>td]:after:hidden @max-6xl/table:h-auto! @max-6xl/table:[&>td]:pb-1!";
|
|
23
48
|
readonly details: "@6xl/table:hidden";
|
|
24
|
-
readonly table: "@max-6xl/table:table-auto @max-6xl/table:[&_td]:whitespace-normal @max-6xl/table:[&_th:not(:first-child)
|
|
49
|
+
readonly table: "@max-6xl/table:table-auto @max-6xl/table:[&_td]:whitespace-normal @max-6xl/table:[&_th:not(:first-child):not([data-identity])]:w-px";
|
|
25
50
|
};
|
|
26
51
|
};
|
|
27
52
|
export type TableCompactLayout = keyof typeof tableCompactLayouts;
|
|
53
|
+
/**
|
|
54
|
+
* The compact layout for columns of these sizes: the narrowest card width at which every sized
|
|
55
|
+
* column, and a floor for each column without a size, still fit. A card narrower than that
|
|
56
|
+
* leaves its secondary columns out of the row: each joins the one muted line under the name, or is
|
|
57
|
+
* dropped.
|
|
58
|
+
*/
|
|
59
|
+
export declare function compactLayoutFor(sizes: readonly (number | undefined)[]): TableCompactLayout;
|
|
28
60
|
//# sourceMappingURL=table-layouts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-layouts.d.ts","sourceRoot":"","sources":["../../src/components/table-layouts.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"table-layouts.d.ts","sourceRoot":"","sources":["../../src/components/table-layouts.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB;IAC9B,uFAAuF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuD/E,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAAG,MAAM,OAAO,mBAAmB,CAAC;AAalE;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,GAAG,kBAAkB,CAG3F"}
|
|
@@ -1,26 +1,70 @@
|
|
|
1
1
|
export const tableCompactLayouts = {
|
|
2
|
+
/** Only by request: a row that must stay one line on any card wider than a phone's. */
|
|
3
|
+
narrow: {
|
|
4
|
+
width: 448,
|
|
5
|
+
column: "hidden @md/table:table-cell",
|
|
6
|
+
track: "hidden @md/table:table-column",
|
|
7
|
+
row: "@max-md/table:[&>td]:border-b-0 @max-md/table:[&>td]:after:hidden @max-md/table:h-auto! @max-md/table:[&>td]:pb-1!",
|
|
8
|
+
details: "@md/table:hidden",
|
|
9
|
+
table: "@max-md/table:table-auto @max-md/table:[&_td]:whitespace-normal @max-md/table:[&_th:not(:first-child):not([data-identity])]:w-px @max-md/table:[&_tr:not([data-slot=table-detail-row])>td:not(:first-child)]:pl-0 @max-md/table:[&_tr:not([data-slot=table-detail-row])>td:not(:first-child):not(:last-child)]:pr-0",
|
|
10
|
+
},
|
|
2
11
|
tight: {
|
|
12
|
+
width: 576,
|
|
3
13
|
column: "hidden @xl/table:table-cell",
|
|
4
|
-
|
|
14
|
+
track: "hidden @xl/table:table-column",
|
|
15
|
+
row: "@max-xl/table:[&>td]:border-b-0 @max-xl/table:[&>td]:after:hidden @max-xl/table:h-auto! @max-xl/table:[&>td]:pb-1!",
|
|
5
16
|
details: "@xl/table:hidden",
|
|
6
|
-
table: "@max-xl/table:table-auto @max-xl/table:[&_td]:whitespace-normal @max-xl/table:[&_th:not(:first-child)
|
|
17
|
+
table: "@max-xl/table:table-auto @max-xl/table:[&_td]:whitespace-normal @max-xl/table:[&_th:not(:first-child):not([data-identity])]:w-px",
|
|
7
18
|
},
|
|
8
19
|
standard: {
|
|
20
|
+
width: 768,
|
|
9
21
|
column: "hidden @3xl/table:table-cell",
|
|
10
|
-
|
|
22
|
+
track: "hidden @3xl/table:table-column",
|
|
23
|
+
row: "@max-3xl/table:[&>td]:border-b-0 @max-3xl/table:[&>td]:after:hidden @max-3xl/table:h-auto! @max-3xl/table:[&>td]:pb-1!",
|
|
11
24
|
details: "@3xl/table:hidden",
|
|
12
|
-
table: "@max-3xl/table:table-auto @max-3xl/table:[&_td]:whitespace-normal @max-3xl/table:[&_th:not(:first-child)
|
|
25
|
+
table: "@max-3xl/table:table-auto @max-3xl/table:[&_td]:whitespace-normal @max-3xl/table:[&_th:not(:first-child):not([data-identity])]:w-px",
|
|
13
26
|
},
|
|
14
27
|
wide: {
|
|
28
|
+
width: 1024,
|
|
15
29
|
column: "hidden @5xl/table:table-cell",
|
|
16
|
-
|
|
30
|
+
track: "hidden @5xl/table:table-column",
|
|
31
|
+
row: "@max-5xl/table:[&>td]:border-b-0 @max-5xl/table:[&>td]:after:hidden @max-5xl/table:h-auto! @max-5xl/table:[&>td]:pb-1!",
|
|
17
32
|
details: "@5xl/table:hidden",
|
|
18
|
-
table: "@max-5xl/table:table-auto @max-5xl/table:[&_td]:whitespace-normal @max-5xl/table:[&_th:not(:first-child)
|
|
33
|
+
table: "@max-5xl/table:table-auto @max-5xl/table:[&_td]:whitespace-normal @max-5xl/table:[&_th:not(:first-child):not([data-identity])]:w-px",
|
|
34
|
+
},
|
|
35
|
+
roomy: {
|
|
36
|
+
width: 1088,
|
|
37
|
+
column: "hidden @min-[68rem]/table:table-cell",
|
|
38
|
+
track: "hidden @min-[68rem]/table:table-column",
|
|
39
|
+
row: "@max-[68rem]/table:[&>td]:border-b-0 @max-[68rem]/table:[&>td]:after:hidden @max-[68rem]/table:h-auto! @max-[68rem]/table:[&>td]:pb-1!",
|
|
40
|
+
details: "@min-[68rem]/table:hidden",
|
|
41
|
+
table: "@max-[68rem]/table:table-auto @max-[68rem]/table:[&_td]:whitespace-normal @max-[68rem]/table:[&_th:not(:first-child):not([data-identity])]:w-px",
|
|
19
42
|
},
|
|
20
43
|
spacious: {
|
|
44
|
+
width: 1152,
|
|
21
45
|
column: "hidden @6xl/table:table-cell",
|
|
22
|
-
|
|
46
|
+
track: "hidden @6xl/table:table-column",
|
|
47
|
+
row: "@max-6xl/table:[&>td]:border-b-0 @max-6xl/table:[&>td]:after:hidden @max-6xl/table:h-auto! @max-6xl/table:[&>td]:pb-1!",
|
|
23
48
|
details: "@6xl/table:hidden",
|
|
24
|
-
table: "@max-6xl/table:table-auto @max-6xl/table:[&_td]:whitespace-normal @max-6xl/table:[&_th:not(:first-child)
|
|
49
|
+
table: "@max-6xl/table:table-auto @max-6xl/table:[&_td]:whitespace-normal @max-6xl/table:[&_th:not(:first-child):not([data-identity])]:w-px",
|
|
25
50
|
},
|
|
26
51
|
};
|
|
52
|
+
/** The least a column without a size needs, in pixels: below it the card lays out compact. */
|
|
53
|
+
const UNSIZED_COLUMN_FLOOR = 160;
|
|
54
|
+
const NARROWEST_FIRST = [
|
|
55
|
+
"tight",
|
|
56
|
+
"standard",
|
|
57
|
+
"wide",
|
|
58
|
+
"roomy",
|
|
59
|
+
"spacious",
|
|
60
|
+
];
|
|
61
|
+
/**
|
|
62
|
+
* The compact layout for columns of these sizes: the narrowest card width at which every sized
|
|
63
|
+
* column, and a floor for each column without a size, still fit. A card narrower than that
|
|
64
|
+
* leaves its secondary columns out of the row: each joins the one muted line under the name, or is
|
|
65
|
+
* dropped.
|
|
66
|
+
*/
|
|
67
|
+
export function compactLayoutFor(sizes) {
|
|
68
|
+
const needed = sizes.reduce((sum, size) => sum + (size ?? UNSIZED_COLUMN_FLOOR), 0);
|
|
69
|
+
return NARROWEST_FIRST.find((name) => tableCompactLayouts[name].width >= needed) ?? "spacious";
|
|
70
|
+
}
|
|
@@ -20,9 +20,10 @@ export type TableValueProps = {
|
|
|
20
20
|
* @family Data
|
|
21
21
|
* @when Every cell of a `DataTable` whose reading can be missing, zero, out of date, unreadable or still loading.
|
|
22
22
|
* @instead A whole table that failed to read is `EmptyState kind="failed"`; a figure on its own is a `KpiCard`.
|
|
23
|
-
* @behaviour
|
|
24
|
-
*
|
|
25
|
-
* @
|
|
23
|
+
* @behaviour “Render `—` in cells where a value is unknown or not applicable. Don’t substitute `N/A`, `null`, or an empty string.” (https://vercel.com/geist/table)
|
|
24
|
+
* Ours: five states that never collapse into a dash: unknown (a muted dash), zero (the figure "0"), stale (the reading, then the stale word), failed (the error mark and its words, in the error colour) and loading (a still 64 × 12 placeholder). A real value, `0` included, is shown as it is.
|
|
25
|
+
* @words Ours: `missingLabel` says what the absence means ("Not reported", never "N/A" or "None"); `staleLabel` is one word ("Stale"); `failedLabel` says the read failed ("Couldn't read").
|
|
26
|
+
* @access The dash is hidden and `missingLabel` is read in its place; the error mark is hidden beside its words; the placeholder is decorative, and its cell is `aria-busy` while it loads.
|
|
26
27
|
*/
|
|
27
28
|
export declare function TableValue(props: TableValueProps): string | number | import("react").JSX.Element;
|
|
28
29
|
export {};
|