@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
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Radio as RadioPrimitive } from "@base-ui/react/radio";
|
|
4
|
+
import { RadioGroup as RadioGroupPrimitive } from "@base-ui/react/radio-group";
|
|
5
|
+
import { cva } from "class-variance-authority";
|
|
6
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "./tooltip.js";
|
|
7
|
+
import { cn } from "../lib/utils.js";
|
|
8
|
+
const segmentedControlVariants = cva("max-w-full auto-cols-[minmax(max-content,1fr)] grid-flow-col bg-background p-1 ring-1 ring-border", {
|
|
9
|
+
variants: {
|
|
10
|
+
fullWidth: {
|
|
11
|
+
true: "grid w-full",
|
|
12
|
+
false: "inline-grid",
|
|
13
|
+
},
|
|
14
|
+
size: {
|
|
15
|
+
sm: "rounded-sm",
|
|
16
|
+
default: "rounded-sm",
|
|
17
|
+
lg: "rounded-md",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
const segmentedItemVariants = cva("relative flex cursor-pointer items-center justify-center gap-1.5 after:absolute after:top-1/2 after:left-1/2 after:size-touch-target after:-translate-x-1/2 after:-translate-y-1/2 text-muted-foreground nc-transition-paint select-none not-data-disabled:hover:text-foreground data-checked:bg-selection data-checked:text-selection-foreground data-checked:nc-elevation-resting data-disabled:cursor-not-allowed data-disabled:text-muted-foreground/50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [@media(hover:hover)_and_(pointer:fine)]:after:hidden", {
|
|
22
|
+
variants: {
|
|
23
|
+
size: {
|
|
24
|
+
sm: "h-nadicode-control-height-xs rounded-xs-plus text-button [&_svg:not([class*='size-'])]:size-4",
|
|
25
|
+
default: "h-7 rounded-xs-plus text-button [&_svg:not([class*='size-'])]:size-4",
|
|
26
|
+
lg: "h-nadicode-control-height-sm rounded-sm text-button-lg [&_svg:not([class*='size-'])]:size-5",
|
|
27
|
+
},
|
|
28
|
+
iconOnly: {
|
|
29
|
+
true: "px-0",
|
|
30
|
+
false: "min-w-0 px-3",
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
compoundVariants: [
|
|
34
|
+
{ size: ["sm", "default"], iconOnly: true, className: "min-w-8" },
|
|
35
|
+
{ size: "lg", iconOnly: true, className: "min-w-11" },
|
|
36
|
+
{ size: "lg", iconOnly: false, className: "px-4" },
|
|
37
|
+
],
|
|
38
|
+
});
|
|
39
|
+
/**
|
|
40
|
+
* Two or three options that show different views of one surface, the chosen one filled.
|
|
41
|
+
*
|
|
42
|
+
* @family Choices
|
|
43
|
+
* @when "Use Switch as a segmented selector for 2–3 mutually exclusive options that show different
|
|
44
|
+
* views of the same surface, like `Source` vs `Output`." (https://vercel.com/geist/switch) Ours:
|
|
45
|
+
* Geist's `Switch` is our `SegmentedControl`.
|
|
46
|
+
* @instead "For a boolean on/off setting, use `Toggle`." (https://vercel.com/geist/switch) "Switch
|
|
47
|
+
* implements radio semantics, so two options stay mutually exclusive rather than reading as a
|
|
48
|
+
* checkbox." (https://vercel.com/geist/switch) "Past 3 options or when labels grow beyond a couple
|
|
49
|
+
* of words, switch to `Tabs` or a `Select`." (https://vercel.com/geist/switch) Ours: Geist's
|
|
50
|
+
* `Toggle` is our `Switch`. The theme is `ThemeModeSwitcher`, never a second picker. Four to six
|
|
51
|
+
* that must be compared are a `RadioGroup`. Pressed buttons that can be several or none are a
|
|
52
|
+
* `ToggleGroup`. Panels of one object are `Tabs`.
|
|
53
|
+
* @behaviour "Pass a `name` so the underlying radios are grouped; without it, more than one option
|
|
54
|
+
* can appear selected at once." (https://vercel.com/geist/switch) "Set `defaultChecked` (or
|
|
55
|
+
* controlled `checked`) on exactly one `Switch.Control` so the group has a defined initial state."
|
|
56
|
+
* (https://vercel.com/geist/switch) "Pad each `Switch.Control` so the widest label fits without the
|
|
57
|
+
* active pill resizing on selection." (https://vercel.com/geist/switch) "Test with the longest copy
|
|
58
|
+
* in the set." (https://vercel.com/geist/switch) Ours: the group's name (`aria-label` or
|
|
59
|
+
* `aria-labelledby`), a label on every option and a starting choice (`defaultValue` or `value`) are
|
|
60
|
+
* required; without them it does not compile. The options are one radio group, so they stay
|
|
61
|
+
* exclusive without a form `name`. The
|
|
62
|
+
* options share the width of the widest, so the fill never resizes as the choice moves; where the
|
|
63
|
+
* row is narrower than that, each option keeps its own word's width rather than cutting it. The track
|
|
64
|
+
* is white with a hairline and a 4 px inset, so it is 32, 36 or 40 px high around options of 24, 28
|
|
65
|
+
* or 32 px. Colour: neutral throughout, the chosen option filled grey with ink words and the others
|
|
66
|
+
* grey words that turn ink on hover; nothing takes a hue. Icons are 16 px, 20 px at `lg`. A
|
|
67
|
+
* disabled option keeps the chosen fill, lightens only its words and has no hover change. The
|
|
68
|
+
* options are radios in one group: arrows move and choose, and pressing the chosen one changes
|
|
69
|
+
* nothing. It applies at once; it is not a field that waits for a Save. `fullWidth` when it heads a
|
|
70
|
+
* form or a dialog, as the two-factor form's method switch does.
|
|
71
|
+
* @words "Title Case each `Switch.Control` label." (https://vercel.com/geist/switch) "Keep labels
|
|
72
|
+
* to one or two words and parallel: `Source` / `Output`, not `Source` / `Show output`."
|
|
73
|
+
* (https://vercel.com/geist/switch) Ours: sentence case: *Source*, *Output*.
|
|
74
|
+
* @access "Always provide a `label` on every `Switch.Control`, even when an `icon` carries the
|
|
75
|
+
* meaning, so screen readers announce the option." (https://vercel.com/geist/switch) "The component
|
|
76
|
+
* renders it as `geist-sr-only` for icon-only controls." (https://vercel.com/geist/switch) "Pair an
|
|
77
|
+
* icon-only Switch with a `Tooltip` on each control so sighted users get the same label assistive
|
|
78
|
+
* tech receives." (https://vercel.com/geist/switch) Ours: `role="radiogroup"` named by `aria-label`
|
|
79
|
+
* or `aria-labelledby`; each option a radio named by its label, shown as a tooltip on an icon-only
|
|
80
|
+
* option.
|
|
81
|
+
*/
|
|
82
|
+
function SegmentedControl({ options, size = "default", fullWidth = false, className, ...props }) {
|
|
83
|
+
const items = options;
|
|
84
|
+
return (_jsx(RadioGroupPrimitive, { "data-slot": "segmented-control", className: cn(segmentedControlVariants({ fullWidth, size }), className), ...props, children: items.map((option) => {
|
|
85
|
+
const iconOnly = option.iconOnly === true;
|
|
86
|
+
const item = (_jsxs(RadioPrimitive.Root, { className: cn(segmentedItemVariants({ size, iconOnly })), "data-slot": "segmented-control-item", disabled: option.disabled, value: option.value, children: [option.icon ? _jsx("span", { "aria-hidden": "true", children: option.icon }) : null, _jsx("span", { className: cn("min-w-0 truncate", iconOnly && "sr-only"), children: option.label })] }, option.value));
|
|
87
|
+
return iconOnly ? (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { render: item }), _jsx(TooltipContent, { children: option.label })] }, option.value)) : (item);
|
|
88
|
+
}) }));
|
|
89
|
+
}
|
|
90
|
+
export { SegmentedControl };
|
|
@@ -1,32 +1,72 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Select as SelectPrimitive } from "@base-ui/react/select";
|
|
3
|
+
import { type FieldName } from "../internal/field-frame.js";
|
|
4
|
+
import { type FieldSize } from "../internal/input-box.js";
|
|
3
5
|
/**
|
|
4
6
|
* A short fixed list in our style, opened from a trigger that shows the choice.
|
|
5
7
|
*
|
|
6
8
|
* @family Choices
|
|
7
|
-
* @when
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* @
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* @
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
9
|
+
* @when "Display a dropdown list of items." (https://vercel.com/geist/select) "Pick `<Select>` for
|
|
10
|
+
* short, fixed lists (under ~10 items) where typing adds nothing; switch to `Combobox` once
|
|
11
|
+
* filtering helps." (https://vercel.com/geist/select) Ours: four or more
|
|
12
|
+
* options, each short enough to need no sentence: how often a task runs.
|
|
13
|
+
* @instead "Use `MultiSelect` when more than one value can be chosen at once; use `Switch` for a
|
|
14
|
+
* 2–3 option segmented choice." (https://vercel.com/geist/select) Ours: two or three options are
|
|
15
|
+
* radios or a segmented control. Inside a native form a long list is `NativeSelect`.
|
|
16
|
+
* @behaviour The trigger is `Input`'s box: its sizes, its ring, hover, focus halo and disabled, the
|
|
17
|
+
* label above it and the message under it. Colour sits in one place: an error turns the ring red
|
|
18
|
+
* and fills the halo, and colours the message; the fill, the value, the chevron and the label stay
|
|
19
|
+
* neutral. It shows the chosen value, after an optional `prefix` mark, with the chevron at the end
|
|
20
|
+
* in the muted grey (a `suffix` mark takes the chevron's place), and fills its container; it keeps
|
|
21
|
+
* the hover edge while its list is open. The list opens under it, 8 px away, never covering the
|
|
22
|
+
* trigger (`alignItemWithTrigger` is off), in a 6 px inset, with a 14 px check at the chosen row's
|
|
23
|
+
* end, rows 36 px tall and no gap between them; a row that cannot be chosen turns its text muted,
|
|
24
|
+
* never dimmed. Arrows, typing, Enter, Escape. A placeholder reads in the muted grey and is never
|
|
25
|
+
* an option. `label` and `error` go on `SelectTrigger`, and a string `label` requires `id`; a
|
|
26
|
+
* trigger with no name does not compile. "Group options past ~10 items with native `<optgroup>`;
|
|
27
|
+
* Geist `<Select>` has no `.Group` static." (https://vercel.com/geist/select) Ours: group the
|
|
28
|
+
* options with `SelectGroup`. "Validate on blur and pass a string to `error`; messages name the
|
|
29
|
+
* field and end in a period (`Select a framework.`)." (https://vercel.com/geist/select) "Don’t wrap
|
|
30
|
+
* a labelled `<Select>` in a `Tooltip`; put the hint on a sibling icon button so the label stays
|
|
31
|
+
* announced." (https://vercel.com/geist/select) Other form rules are `Field`'s.
|
|
32
|
+
* @words "Options are Title Case when short and match canonical branding (`Next.js`, not `NextJS`);
|
|
33
|
+
* keep the same register across the list." (https://vercel.com/geist/select) "Label is a short
|
|
34
|
+
* Title Case noun (`Framework`, `Region`); accept the prop directly on `<Select>`."
|
|
35
|
+
* (https://vercel.com/geist/select) "Placeholder is action-oriented (`Select a framework`), never
|
|
36
|
+
* `Choose one…`, `Pick`, or the label restated." (https://vercel.com/geist/select) Ours: options
|
|
37
|
+
* are parallel phrases in sentence case (*Every hour*, *Every weekday*), the label is a short noun
|
|
38
|
+
* in sentence case, and the trigger never says *Select…* or *Choose one*.
|
|
39
|
+
* @access A visible label tied to the trigger by `id`, or `aria-label` or `aria-labelledby`.
|
|
40
|
+
* Listbox and option roles from Base UI; focus returns to the trigger on close. The prefix and
|
|
41
|
+
* suffix are decorative and not part of the trigger's name.
|
|
18
42
|
*/
|
|
19
43
|
declare const Select: typeof SelectPrimitive.Root;
|
|
20
44
|
declare function SelectGroup({ className, ...props }: SelectPrimitive.Group.Props): React.JSX.Element;
|
|
21
45
|
declare function SelectValue({ className, ...props }: SelectPrimitive.Value.Props): React.JSX.Element;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
46
|
+
/**
|
|
47
|
+
* The box of a field-shaped trigger that opens a floating list, so a trigger that is not a
|
|
48
|
+
* `SelectTrigger`, such as `MultiSelectTrigger`, wears the same box.
|
|
49
|
+
*/
|
|
50
|
+
declare const selectTriggerVariants: (props?: ({
|
|
51
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
52
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
53
|
+
type SelectTriggerProps = Omit<SelectPrimitive.Trigger.Props, "prefix"> & {
|
|
54
|
+
size?: FieldSize;
|
|
55
|
+
/** A mark before the value, such as an icon. */
|
|
56
|
+
prefix?: React.ReactNode;
|
|
57
|
+
/** A mark at the end, in place of the chevron. */
|
|
58
|
+
suffix?: React.ReactNode;
|
|
59
|
+
/** One muted sentence under the box that says what to enter, read with the box. */
|
|
60
|
+
description?: string;
|
|
61
|
+
/** The message under the box, in the product's words; it also marks the box invalid. */
|
|
62
|
+
error?: string;
|
|
63
|
+
} & FieldName;
|
|
64
|
+
declare function SelectTrigger({ className, size, prefix, suffix, label, description, error, children, ...props }: SelectTriggerProps): React.JSX.Element;
|
|
25
65
|
declare function SelectContent({ className, children, side, sideOffset, align, alignOffset, alignItemWithTrigger, ...props }: SelectPrimitive.Popup.Props & Pick<SelectPrimitive.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset" | "alignItemWithTrigger">): React.JSX.Element;
|
|
26
66
|
declare function SelectLabel({ className, ...props }: SelectPrimitive.GroupLabel.Props): React.JSX.Element;
|
|
27
67
|
declare function SelectItem({ className, children, ...props }: SelectPrimitive.Item.Props): React.JSX.Element;
|
|
28
68
|
declare function SelectSeparator({ className, ...props }: SelectPrimitive.Separator.Props): React.JSX.Element;
|
|
29
69
|
declare function SelectScrollUpButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollUpArrow>): React.JSX.Element;
|
|
30
70
|
declare function SelectScrollDownButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollDownArrow>): React.JSX.Element;
|
|
31
|
-
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
|
|
71
|
+
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, selectTriggerVariants, SelectValue, };
|
|
32
72
|
//# sourceMappingURL=select.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/components/select.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/components/select.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAKlE,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAKL,KAAK,SAAS,EACf,MAAM,sBAAsB,CAAC;AAG9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,QAAA,MAAM,MAAM,6BAAuB,CAAC;AAEpC,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,CAAC,KAAK,CAAC,KAAK,qBAQxE;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,CAAC,KAAK,CAAC,KAAK,qBAQxE;AAED;;;GAGG;AACH,QAAA,MAAM,qBAAqB;;8EAgB1B,CAAC;AAEF,KAAK,kBAAkB,GAAG,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG;IACxE,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,gDAAgD;IAChD,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,kDAAkD;IAClD,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,mFAAmF;IACnF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wFAAwF;IACxF,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,SAAS,CAAC;AAEd,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,IAAgB,EAChB,MAAM,EACN,MAAM,EACN,KAAK,EACL,WAAW,EACX,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,kBAAkB,qBAyCpB;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,QAAQ,EACR,IAAe,EACf,UAAc,EACd,KAAgB,EAChB,WAAe,EACf,oBAA4B,EAC5B,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,KAAK,CAAC,KAAK,GAC5B,IAAI,CACF,eAAe,CAAC,UAAU,CAAC,KAAK,EAChC,OAAO,GAAG,aAAa,GAAG,MAAM,GAAG,YAAY,GAAG,sBAAsB,CACzE,qBA6BF;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,CAAC,UAAU,CAAC,KAAK,qBAQ7E;AAED,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,CAAC,IAAI,CAAC,KAAK,qBAsBhF;AAED,iBAAS,eAAe,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,CAAC,SAAS,CAAC,KAAK,qBAQhF;AAED,iBAAS,oBAAoB,CAAC,EAC5B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,aAAa,CAAC,qBAa5D;AAED,iBAAS,sBAAsB,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,eAAe,CAAC,qBAa9D;AAED,OAAO,EACL,MAAM,EACN,aAAa,EACb,WAAW,EACX,UAAU,EACV,WAAW,EACX,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,qBAAqB,EACrB,WAAW,GACZ,CAAC"}
|
|
@@ -1,43 +1,86 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Select as SelectPrimitive } from "@base-ui/react/select";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
4
5
|
import { cn } from "../lib/utils.js";
|
|
5
6
|
import { anchoredOverlayMotion } from "../lib/motion.js";
|
|
7
|
+
import { FieldFrame } from "../internal/field-frame.js";
|
|
8
|
+
import { fieldDisabled, fieldOpen, fieldRing, fieldStates, } from "../internal/input-box.js";
|
|
6
9
|
import { ChevronDownIcon, CheckIcon, ChevronUpIcon } from "lucide-react";
|
|
7
10
|
/**
|
|
8
11
|
* A short fixed list in our style, opened from a trigger that shows the choice.
|
|
9
12
|
*
|
|
10
13
|
* @family Choices
|
|
11
|
-
* @when
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* @
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* @
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
14
|
+
* @when "Display a dropdown list of items." (https://vercel.com/geist/select) "Pick `<Select>` for
|
|
15
|
+
* short, fixed lists (under ~10 items) where typing adds nothing; switch to `Combobox` once
|
|
16
|
+
* filtering helps." (https://vercel.com/geist/select) Ours: four or more
|
|
17
|
+
* options, each short enough to need no sentence: how often a task runs.
|
|
18
|
+
* @instead "Use `MultiSelect` when more than one value can be chosen at once; use `Switch` for a
|
|
19
|
+
* 2–3 option segmented choice." (https://vercel.com/geist/select) Ours: two or three options are
|
|
20
|
+
* radios or a segmented control. Inside a native form a long list is `NativeSelect`.
|
|
21
|
+
* @behaviour The trigger is `Input`'s box: its sizes, its ring, hover, focus halo and disabled, the
|
|
22
|
+
* label above it and the message under it. Colour sits in one place: an error turns the ring red
|
|
23
|
+
* and fills the halo, and colours the message; the fill, the value, the chevron and the label stay
|
|
24
|
+
* neutral. It shows the chosen value, after an optional `prefix` mark, with the chevron at the end
|
|
25
|
+
* in the muted grey (a `suffix` mark takes the chevron's place), and fills its container; it keeps
|
|
26
|
+
* the hover edge while its list is open. The list opens under it, 8 px away, never covering the
|
|
27
|
+
* trigger (`alignItemWithTrigger` is off), in a 6 px inset, with a 14 px check at the chosen row's
|
|
28
|
+
* end, rows 36 px tall and no gap between them; a row that cannot be chosen turns its text muted,
|
|
29
|
+
* never dimmed. Arrows, typing, Enter, Escape. A placeholder reads in the muted grey and is never
|
|
30
|
+
* an option. `label` and `error` go on `SelectTrigger`, and a string `label` requires `id`; a
|
|
31
|
+
* trigger with no name does not compile. "Group options past ~10 items with native `<optgroup>`;
|
|
32
|
+
* Geist `<Select>` has no `.Group` static." (https://vercel.com/geist/select) Ours: group the
|
|
33
|
+
* options with `SelectGroup`. "Validate on blur and pass a string to `error`; messages name the
|
|
34
|
+
* field and end in a period (`Select a framework.`)." (https://vercel.com/geist/select) "Don’t wrap
|
|
35
|
+
* a labelled `<Select>` in a `Tooltip`; put the hint on a sibling icon button so the label stays
|
|
36
|
+
* announced." (https://vercel.com/geist/select) Other form rules are `Field`'s.
|
|
37
|
+
* @words "Options are Title Case when short and match canonical branding (`Next.js`, not `NextJS`);
|
|
38
|
+
* keep the same register across the list." (https://vercel.com/geist/select) "Label is a short
|
|
39
|
+
* Title Case noun (`Framework`, `Region`); accept the prop directly on `<Select>`."
|
|
40
|
+
* (https://vercel.com/geist/select) "Placeholder is action-oriented (`Select a framework`), never
|
|
41
|
+
* `Choose one…`, `Pick`, or the label restated." (https://vercel.com/geist/select) Ours: options
|
|
42
|
+
* are parallel phrases in sentence case (*Every hour*, *Every weekday*), the label is a short noun
|
|
43
|
+
* in sentence case, and the trigger never says *Select…* or *Choose one*.
|
|
44
|
+
* @access A visible label tied to the trigger by `id`, or `aria-label` or `aria-labelledby`.
|
|
45
|
+
* Listbox and option roles from Base UI; focus returns to the trigger on close. The prefix and
|
|
46
|
+
* suffix are decorative and not part of the trigger's name.
|
|
22
47
|
*/
|
|
23
48
|
const Select = SelectPrimitive.Root;
|
|
24
49
|
function SelectGroup({ className, ...props }) {
|
|
25
|
-
return (_jsx(SelectPrimitive.Group, { "data-slot": "select-group", className: cn("scroll-my-1
|
|
50
|
+
return (_jsx(SelectPrimitive.Group, { "data-slot": "select-group", className: cn("scroll-my-1", className), ...props }));
|
|
26
51
|
}
|
|
27
52
|
function SelectValue({ className, ...props }) {
|
|
28
53
|
return (_jsx(SelectPrimitive.Value, { "data-slot": "select-value", className: cn("flex flex-1 text-left", className), ...props }));
|
|
29
54
|
}
|
|
30
|
-
|
|
31
|
-
|
|
55
|
+
/**
|
|
56
|
+
* The box of a field-shaped trigger that opens a floating list, so a trigger that is not a
|
|
57
|
+
* `SelectTrigger`, such as `MultiSelectTrigger`, wears the same box.
|
|
58
|
+
*/
|
|
59
|
+
const selectTriggerVariants = cva([
|
|
60
|
+
"flex min-h-touch-target w-full items-center justify-between gap-1.5 bg-(--nc-field,var(--background)) py-0 pr-3 pl-control-padding-inline text-sm whitespace-nowrap select-none data-placeholder:text-placeholder [@media(hover:hover)_and_(pointer:fine)]:min-h-0 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
61
|
+
fieldRing,
|
|
62
|
+
fieldDisabled,
|
|
63
|
+
], {
|
|
64
|
+
variants: {
|
|
65
|
+
size: {
|
|
66
|
+
sm: "h-nadicode-control-height-sm rounded-sm",
|
|
67
|
+
default: "h-control-height rounded-sm",
|
|
68
|
+
lg: "h-nadicode-control-height-lg rounded-md text-base",
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
defaultVariants: { size: "default" },
|
|
72
|
+
});
|
|
73
|
+
function SelectTrigger({ className, size = "default", prefix, suffix, label, description, error, children, ...props }) {
|
|
74
|
+
return (_jsx(FieldFrame, { label: label, description: description, error: error, size: size, control: props, children: (aria) => (_jsxs(SelectPrimitive.Trigger, { "data-slot": "select-trigger", "data-size": size, "data-field-frame": "", className: cn(selectTriggerVariants({ size }), fieldStates, fieldOpen, className), ...props, ...aria, children: [prefix ? (_jsx("span", { "data-slot": "select-prefix", "aria-hidden": "true", className: "mr-1.5 flex shrink-0 items-center text-muted-foreground", children: prefix })) : null, children, suffix ? (_jsx("span", { "data-slot": "select-suffix", "aria-hidden": "true", className: "flex shrink-0 items-center text-muted-foreground", children: suffix })) : (_jsx(SelectPrimitive.Icon, { render: _jsx(ChevronDownIcon, { className: "pointer-events-none size-3.5 text-muted-foreground" }) }))] })) }));
|
|
32
75
|
}
|
|
33
|
-
function SelectContent({ className, children, side = "bottom", sideOffset =
|
|
34
|
-
return (_jsx(SelectPrimitive.Portal, { children: _jsx(SelectPrimitive.Positioner, { side: side, sideOffset: sideOffset, align: align, alignOffset: alignOffset, alignItemWithTrigger: alignItemWithTrigger, className: "isolate z-50", children: _jsxs(SelectPrimitive.Popup, { "data-slot": "select-content", "data-align-trigger": alignItemWithTrigger, className: cn("pointer-events-auto", "relative isolate z-50 max-h-(--available-height) w-auto max-w-(--available-width) min-w-(--anchor-width) overflow-x-hidden overflow-y-auto rounded-lg border-0 nc-glass text-popover-foreground nc-elevation-floating data-[align-trigger=true]:transition-none", anchoredOverlayMotion, className), ...props, children: [_jsx(SelectScrollUpButton, {}), _jsx(SelectPrimitive.List, { children: children }), _jsx(SelectScrollDownButton, {})] }) }) }));
|
|
76
|
+
function SelectContent({ className, children, side = "bottom", sideOffset = 8, align = "center", alignOffset = 0, alignItemWithTrigger = false, ...props }) {
|
|
77
|
+
return (_jsx(SelectPrimitive.Portal, { children: _jsx(SelectPrimitive.Positioner, { side: side, sideOffset: sideOffset, align: align, alignOffset: alignOffset, alignItemWithTrigger: alignItemWithTrigger, className: "isolate z-50", children: _jsxs(SelectPrimitive.Popup, { "data-slot": "select-content", "data-align-trigger": alignItemWithTrigger, className: cn("pointer-events-auto", "relative isolate z-50 max-h-(--available-height) w-auto max-w-(--available-width) min-w-(--anchor-width) overflow-x-hidden overflow-y-auto rounded-lg border-0 nc-glass text-popover-foreground nc-elevation-floating data-[align-trigger=true]:transition-none", anchoredOverlayMotion, className), ...props, children: [_jsx(SelectScrollUpButton, {}), _jsx(SelectPrimitive.List, { className: "p-1.5", children: children }), _jsx(SelectScrollDownButton, {})] }) }) }));
|
|
35
78
|
}
|
|
36
79
|
function SelectLabel({ className, ...props }) {
|
|
37
|
-
return (_jsx(SelectPrimitive.GroupLabel, { "data-slot": "select-label", className: cn("px-
|
|
80
|
+
return (_jsx(SelectPrimitive.GroupLabel, { "data-slot": "select-label", className: cn("px-2 py-1.5 text-xs text-muted-foreground", className), ...props }));
|
|
38
81
|
}
|
|
39
82
|
function SelectItem({ className, children, ...props }) {
|
|
40
|
-
return (_jsxs(SelectPrimitive.Item, { "data-slot": "select-item", className: cn("relative flex min-h-touch-target w-full cursor-default items-center gap-1.5 rounded-sm py-
|
|
83
|
+
return (_jsxs(SelectPrimitive.Item, { "data-slot": "select-item", className: cn("relative flex min-h-touch-target w-full cursor-default items-center gap-1.5 rounded-sm py-2 pr-8 pl-2 text-sm whitespace-nowrap outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:text-muted-foreground [@media(hover:hover)_and_(pointer:fine)]:min-h-0 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className), ...props, children: [_jsx(SelectPrimitive.ItemText, { className: "flex flex-1 shrink-0 gap-2 whitespace-nowrap", children: children }), _jsx(SelectPrimitive.ItemIndicator, { render: _jsx("span", { className: "pointer-events-none absolute right-2 flex size-3.5 items-center justify-center" }), children: _jsx(CheckIcon, { className: "pointer-events-none size-3.5" }) })] }));
|
|
41
84
|
}
|
|
42
85
|
function SelectSeparator({ className, ...props }) {
|
|
43
86
|
return (_jsx(SelectPrimitive.Separator, { "data-slot": "select-separator", className: cn("pointer-events-none -mx-1 my-1 h-px bg-border", className), ...props }));
|
|
@@ -48,4 +91,4 @@ function SelectScrollUpButton({ className, ...props }) {
|
|
|
48
91
|
function SelectScrollDownButton({ className, ...props }) {
|
|
49
92
|
return (_jsx(SelectPrimitive.ScrollDownArrow, { "data-slot": "select-scroll-down-button", className: cn("bottom-0 z-10 flex w-full cursor-default items-center justify-center nc-glass py-1 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: _jsx(ChevronDownIcon, {}) }));
|
|
50
93
|
}
|
|
51
|
-
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
|
|
94
|
+
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, selectTriggerVariants, SelectValue, };
|
|
@@ -3,13 +3,20 @@ import { Separator as SeparatorPrimitive } from "@base-ui/react/separator";
|
|
|
3
3
|
* A 1 px line between groups.
|
|
4
4
|
*
|
|
5
5
|
* @family Other
|
|
6
|
-
* @when
|
|
7
|
-
*
|
|
6
|
+
* @when Ours: separating groups inside one surface: menu sections, a card's header from its toolbar,
|
|
7
|
+
* inline items in a row. Horizontal between stacked groups, vertical between items in a row.
|
|
8
|
+
* @instead Ours: a card's footer draws its own seam; a list in a card is a `divided` `ItemGroup`. Never a
|
|
8
9
|
* border around a region.
|
|
9
|
-
* @behaviour
|
|
10
|
+
* @behaviour “Use `inset` when a divider meets a 1px frame painted over the content. The separator reserves 1px at each end and uses solid `gray-400`. A physical parent border already reserves its edge space and does not need this inset.” (https://vercel.com/geist/separator)
|
|
11
|
+
* Ours: horizontal or vertical, exactly 1 px, in the `border` colour (not `gray-400`) and never any
|
|
12
|
+
* other: a separator has no hue, no state and no padding. A vertical one takes its height from the
|
|
13
|
+
* flex row that holds it, so give the row a height and `items-center`.
|
|
10
14
|
* @words None.
|
|
11
|
-
* @access
|
|
15
|
+
* @access Ours: hidden from assistive technology, since it only paints a line; pass `aria-hidden={false}`
|
|
16
|
+
* when the line divides content a reader should hear as divided.
|
|
12
17
|
*/
|
|
13
|
-
declare function Separator({ className, orientation, ...props }: SeparatorPrimitive.Props
|
|
18
|
+
declare function Separator({ className, inset, orientation, ...props }: SeparatorPrimitive.Props & {
|
|
19
|
+
inset?: boolean;
|
|
20
|
+
}): import("react").JSX.Element;
|
|
14
21
|
export { Separator };
|
|
15
22
|
//# sourceMappingURL=separator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"separator.d.ts","sourceRoot":"","sources":["../../src/components/separator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAI3E
|
|
1
|
+
{"version":3,"file":"separator.d.ts","sourceRoot":"","sources":["../../src/components/separator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAI3E;;;;;;;;;;;;;;;GAeG;AACH,iBAAS,SAAS,CAAC,EACjB,SAAS,EACT,KAAa,EACb,WAA0B,EAC1B,GAAG,KAAK,EACT,EAAE,kBAAkB,CAAC,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,+BAchD;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -5,14 +5,19 @@ import { cn } from "../lib/utils.js";
|
|
|
5
5
|
* A 1 px line between groups.
|
|
6
6
|
*
|
|
7
7
|
* @family Other
|
|
8
|
-
* @when
|
|
9
|
-
*
|
|
8
|
+
* @when Ours: separating groups inside one surface: menu sections, a card's header from its toolbar,
|
|
9
|
+
* inline items in a row. Horizontal between stacked groups, vertical between items in a row.
|
|
10
|
+
* @instead Ours: a card's footer draws its own seam; a list in a card is a `divided` `ItemGroup`. Never a
|
|
10
11
|
* border around a region.
|
|
11
|
-
* @behaviour
|
|
12
|
+
* @behaviour “Use `inset` when a divider meets a 1px frame painted over the content. The separator reserves 1px at each end and uses solid `gray-400`. A physical parent border already reserves its edge space and does not need this inset.” (https://vercel.com/geist/separator)
|
|
13
|
+
* Ours: horizontal or vertical, exactly 1 px, in the `border` colour (not `gray-400`) and never any
|
|
14
|
+
* other: a separator has no hue, no state and no padding. A vertical one takes its height from the
|
|
15
|
+
* flex row that holds it, so give the row a height and `items-center`.
|
|
12
16
|
* @words None.
|
|
13
|
-
* @access
|
|
17
|
+
* @access Ours: hidden from assistive technology, since it only paints a line; pass `aria-hidden={false}`
|
|
18
|
+
* when the line divides content a reader should hear as divided.
|
|
14
19
|
*/
|
|
15
|
-
function Separator({ className, orientation = "horizontal", ...props }) {
|
|
16
|
-
return (_jsx(SeparatorPrimitive, { "data-slot": "separator", orientation: orientation, className: cn("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch", className), ...props }));
|
|
20
|
+
function Separator({ className, inset = false, orientation = "horizontal", ...props }) {
|
|
21
|
+
return (_jsx(SeparatorPrimitive, { "data-slot": "separator", orientation: orientation, "aria-hidden": true, className: cn("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch", inset && "data-horizontal:mx-px data-horizontal:w-auto data-vertical:my-px", className), ...props }));
|
|
17
22
|
}
|
|
18
23
|
export { Separator };
|
|
@@ -10,10 +10,8 @@ export type SettingsFact = {
|
|
|
10
10
|
label: string;
|
|
11
11
|
value: ReactNode;
|
|
12
12
|
};
|
|
13
|
-
|
|
13
|
+
type SettingsFactsBase = Omit<ComponentPropsWithoutRef<"section">, "children" | "className"> & {
|
|
14
14
|
action?: ReactNode;
|
|
15
|
-
presentation?: "card" | "summary";
|
|
16
|
-
description?: string;
|
|
17
15
|
facts: readonly SettingsFact[];
|
|
18
16
|
footer?: ReactNode;
|
|
19
17
|
missingValueLabel: string;
|
|
@@ -23,29 +21,51 @@ export type SettingsFactsSectionProps = Omit<ComponentPropsWithoutRef<"section">
|
|
|
23
21
|
*/
|
|
24
22
|
headingId: string;
|
|
25
23
|
title: string;
|
|
24
|
+
};
|
|
25
|
+
export type SettingsFactsSectionProps = SettingsFactsBase & ({
|
|
26
|
+
presentation?: "card";
|
|
27
|
+
/** One line saying what these facts are. */
|
|
28
|
+
description: string;
|
|
29
|
+
/** The footer's left line, one muted sentence: a Learn more link, what the facts are for. */
|
|
30
|
+
footerHint: NonNullable<ReactNode>;
|
|
26
31
|
surface?: CardSurface;
|
|
27
32
|
/**
|
|
28
33
|
* The card's density. The default matches the settings sections it sits
|
|
29
34
|
* among; `sm` is for a compact card in a side column.
|
|
30
35
|
*/
|
|
31
36
|
size?: ComponentPropsWithoutRef<typeof Card>["size"];
|
|
32
|
-
}
|
|
37
|
+
} | {
|
|
38
|
+
presentation: "summary";
|
|
39
|
+
description?: string;
|
|
40
|
+
footerHint?: never;
|
|
41
|
+
surface?: never;
|
|
42
|
+
size?: never;
|
|
43
|
+
});
|
|
33
44
|
/**
|
|
34
|
-
* Read-only facts about one object, framed as a card with a title
|
|
45
|
+
* Read-only facts about one object, framed as a card with a title, a line, one action and a footer.
|
|
35
46
|
*
|
|
36
47
|
* @family Data
|
|
37
48
|
* @when Read-only facts about one object: who it is, where it belongs, its identifiers.
|
|
38
49
|
* `SettingsFactsSection` frames them as a card with a title and one action; `ObjectFacts` is the
|
|
39
50
|
* list alone.
|
|
40
|
-
* @instead Facts a person changes are a `SettingsSection` with its own Save.
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
51
|
+
* @instead Facts a person changes are a `SettingsSection` with its own Save. One server-given value,
|
|
52
|
+
* an ID, is a `SettingsSection` with the value in a read-only mono `InputGroup` and its copy button, no Save. Facts
|
|
53
|
+
* compared across records are a table. A relation is its identity or a `Tag`, never its own card.
|
|
54
|
+
* @behaviour "Use `<Description>` for definition-list metadata: a short Title Case key paired with a single value (`Last Deployed`, `Region`, `Plan`)." (https://vercel.com/geist/description)
|
|
55
|
+
* Ours: required: the description and the footer's left line (`footerHint`), as on a
|
|
56
|
+
* `SettingsSection`; `footer` holds actions, never a Save. Label above value, two equal
|
|
57
|
+
* columns, one column on a phone. Every label stays when its value is missing, as *—*. A long value
|
|
58
|
+
* spans both columns. No fact gets a box of its own. In a side column, `presentation="summary"`
|
|
59
|
+
* drops the card, the description and the footer line.
|
|
60
|
+
* @words "Title slot is Title Case noun (`Last Deployed`, `Build Duration`); content is sentence case unless the value is a literal identifier, ID, or timestamp that should be preserved verbatim." (https://vercel.com/geist/description)
|
|
61
|
+
* Ours: labels are nouns in sentence case, no colon: *VAT number*. Identifiers in
|
|
62
|
+
* mono with a copy button, dates in the person's locale. The footer line says what the facts are
|
|
63
|
+
* for or links to the docs.
|
|
64
|
+
* @access "Geist renders `<dl>`/`<dt>`/`<dd>` so screen readers announce each key/value pair as a definition." (https://vercel.com/geist/description)
|
|
65
|
+
* "Don’t put interactive controls in the title slot." (https://vercel.com/geist/description)
|
|
66
|
+
* Ours: a `dl` of `dt` and `dd`, each value named by its label. The section is labelled by its heading, which also takes focus
|
|
48
67
|
* when an editor closes. A dash carries screen-reader text.
|
|
49
68
|
*/
|
|
50
|
-
export declare function SettingsFactsSection({ action, presentation, description, facts, footer, missingValueLabel, headingId, title, surface, size, ...props }: SettingsFactsSectionProps): import("react").JSX.Element;
|
|
69
|
+
export declare function SettingsFactsSection({ action, presentation, description, facts, footer, footerHint, missingValueLabel, headingId, title, surface, size, ...props }: SettingsFactsSectionProps): import("react").JSX.Element;
|
|
70
|
+
export {};
|
|
51
71
|
//# sourceMappingURL=settings-facts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings-facts.d.ts","sourceRoot":"","sources":["../../src/components/settings-facts.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,wBAAwB,EAAE,KAAK,SAAS,EAAS,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"settings-facts.d.ts","sourceRoot":"","sources":["../../src/components/settings-facts.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,wBAAwB,EAAE,KAAK,SAAS,EAAS,MAAM,OAAO,CAAC;AAM7E,OAAO,EACL,IAAI,EAMJ,KAAK,WAAW,EACjB,MAAM,QAAQ,CAAC;AAEhB,MAAM,MAAM,YAAY,GAAG;IACzB;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,CAAC;CAClB,CAAC;AAEF,KAAK,iBAAiB,GAAG,IAAI,CAAC,wBAAwB,CAAC,SAAS,CAAC,EAAE,UAAU,GAAG,WAAW,CAAC,GAAG;IAC7F,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,KAAK,EAAE,SAAS,YAAY,EAAE,CAAC;IAC/B,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,iBAAiB,GACvD,CACI;IACE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,4CAA4C;IAC5C,WAAW,EAAE,MAAM,CAAC;IACpB,6FAA6F;IAC7F,UAAU,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACnC,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB;;;OAGG;IACH,IAAI,CAAC,EAAE,wBAAwB,CAAC,OAAO,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC;CACtD,GACD;IACE,YAAY,EAAE,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,KAAK,CAAC;IACnB,OAAO,CAAC,EAAE,KAAK,CAAC;IAChB,IAAI,CAAC,EAAE,KAAK,CAAC;CACd,CACJ,CAAC;AAEJ;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,MAAM,EACN,YAAqB,EACrB,WAAW,EACX,KAAK,EACL,MAAM,EACN,UAAU,EACV,iBAAiB,EACjB,SAAS,EACT,KAAK,EACL,OAAmB,EACnB,IAAgB,EAChB,GAAG,KAAK,EACT,EAAE,yBAAyB,+BAiE3B"}
|
|
@@ -1,26 +1,35 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useId } from "react";
|
|
3
|
+
import { FooterStrip } from "../internal/footer-strip.js";
|
|
3
4
|
import { ObjectFacts } from "./object-workspace.js";
|
|
4
5
|
import { TableValue } from "./table-value.js";
|
|
5
|
-
import { Card, CardAction, CardContent, CardDescription,
|
|
6
|
+
import { Card, CardAction, CardContent, CardDescription, CardHeader, CardTitle, } from "./card.js";
|
|
6
7
|
/**
|
|
7
|
-
* Read-only facts about one object, framed as a card with a title
|
|
8
|
+
* Read-only facts about one object, framed as a card with a title, a line, one action and a footer.
|
|
8
9
|
*
|
|
9
10
|
* @family Data
|
|
10
11
|
* @when Read-only facts about one object: who it is, where it belongs, its identifiers.
|
|
11
12
|
* `SettingsFactsSection` frames them as a card with a title and one action; `ObjectFacts` is the
|
|
12
13
|
* list alone.
|
|
13
|
-
* @instead Facts a person changes are a `SettingsSection` with its own Save.
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
14
|
+
* @instead Facts a person changes are a `SettingsSection` with its own Save. One server-given value,
|
|
15
|
+
* an ID, is a `SettingsSection` with the value in a read-only mono `InputGroup` and its copy button, no Save. Facts
|
|
16
|
+
* compared across records are a table. A relation is its identity or a `Tag`, never its own card.
|
|
17
|
+
* @behaviour "Use `<Description>` for definition-list metadata: a short Title Case key paired with a single value (`Last Deployed`, `Region`, `Plan`)." (https://vercel.com/geist/description)
|
|
18
|
+
* Ours: required: the description and the footer's left line (`footerHint`), as on a
|
|
19
|
+
* `SettingsSection`; `footer` holds actions, never a Save. Label above value, two equal
|
|
20
|
+
* columns, one column on a phone. Every label stays when its value is missing, as *—*. A long value
|
|
21
|
+
* spans both columns. No fact gets a box of its own. In a side column, `presentation="summary"`
|
|
22
|
+
* drops the card, the description and the footer line.
|
|
23
|
+
* @words "Title slot is Title Case noun (`Last Deployed`, `Build Duration`); content is sentence case unless the value is a literal identifier, ID, or timestamp that should be preserved verbatim." (https://vercel.com/geist/description)
|
|
24
|
+
* Ours: labels are nouns in sentence case, no colon: *VAT number*. Identifiers in
|
|
25
|
+
* mono with a copy button, dates in the person's locale. The footer line says what the facts are
|
|
26
|
+
* for or links to the docs.
|
|
27
|
+
* @access "Geist renders `<dl>`/`<dt>`/`<dd>` so screen readers announce each key/value pair as a definition." (https://vercel.com/geist/description)
|
|
28
|
+
* "Don’t put interactive controls in the title slot." (https://vercel.com/geist/description)
|
|
29
|
+
* Ours: a `dl` of `dt` and `dd`, each value named by its label. The section is labelled by its heading, which also takes focus
|
|
21
30
|
* when an editor closes. A dash carries screen-reader text.
|
|
22
31
|
*/
|
|
23
|
-
export function SettingsFactsSection({ action, presentation = "card", description, facts, footer, missingValueLabel, headingId, title, surface = "resting", size = "default", ...props }) {
|
|
32
|
+
export function SettingsFactsSection({ action, presentation = "card", description, facts, footer, footerHint, missingValueLabel, headingId, title, surface = "resting", size = "default", ...props }) {
|
|
24
33
|
const termId = useId();
|
|
25
34
|
if (presentation === "summary") {
|
|
26
35
|
return (_jsxs("section", { ...props, "aria-labelledby": headingId, className: "grid min-w-0 gap-3", children: [_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [_jsx("h2", { id: headingId, tabIndex: -1, className: "text-sm font-medium", children: title }), action] }), description ? _jsx("p", { className: "text-sm text-muted-foreground", children: description }) : null, _jsx("dl", { className: "flex flex-wrap items-start gap-x-6 gap-y-3", children: facts.map((fact, index) => (_jsxs("div", { className: "grid gap-1", children: [_jsx("dt", { className: "text-xs text-muted-foreground", id: `${termId}-${index}`, children: fact.label }), _jsx("dd", { "aria-labelledby": `${termId}-${index}`, className: "text-sm", children: fact.value ?? _jsx(TableValue, { missingLabel: missingValueLabel, value: null }) })] }, fact.label))) }), footer] }));
|
|
@@ -29,5 +38,5 @@ export function SettingsFactsSection({ action, presentation = "card", descriptio
|
|
|
29
38
|
label: fact.label,
|
|
30
39
|
block: fact.block,
|
|
31
40
|
value: fact.value == null || fact.value === "" ? (_jsx(TableValue, { missingLabel: missingValueLabel, value: null })) : (fact.value),
|
|
32
|
-
})) }) }),
|
|
41
|
+
})) }) }), _jsx(FooterStrip, { hint: footerHint, hintSlot: "settings-facts-hint", children: footer })] }));
|
|
33
42
|
}
|
|
@@ -7,13 +7,13 @@ export type SettingsPageProps = {
|
|
|
7
7
|
children: ReactNode;
|
|
8
8
|
};
|
|
9
9
|
/**
|
|
10
|
-
* A page of settings:
|
|
10
|
+
* A page of settings: section cards across the page's width under its title, each saving its own values.
|
|
11
11
|
*
|
|
12
12
|
* @family Compositions
|
|
13
13
|
* @when A place whose job is changing how something behaves: an account's profile, a company's identity, Nadia's notifications.
|
|
14
|
-
* @instead One object's page with a settings card among its sections is an ObjectPage.
|
|
15
|
-
* @behaviour
|
|
16
|
-
* @words `title` names the place as the navigation does ("Profile"); the sections' titles and lines carry the rest.
|
|
14
|
+
* @instead One object's page with a settings card among its sections is an ObjectPage; "Place it once per app, in the footer or settings, not duplicated across pages." (https://vercel.com/geist/theme-switcher) Ours: Theme and Language, which apply on change, stay in the account menu.
|
|
15
|
+
* @behaviour One setting per card (the card's shapes are SettingsSection's: one field, a row of short parts of one value, rows of switches or of selects, a header switch), the cards stacked 24 apart across the page's content width under the page's title row, as Vercel's settings cards fill their column, with no heading between them; a field inside keeps its own bound. A page that mixes cards with other content, such as a table or a list of rules, is not a SettingsPage: its sections take a plain h2 above each card. The page draws no header and no save of its own: each SettingsSection saves from its footer. The danger zone closes the page, in rising severity: transfer, then pause, then delete; only delete is `tone="error"`, and only delete and pause take a button in a hue.
|
|
16
|
+
* @words `title` names the place as the navigation does ("Profile"); the sections' titles and lines carry the rest. A card's title is never the page's h1.
|
|
17
17
|
* @access `title` becomes a visually hidden h1 for a product whose chrome shows the place without a heading; leave it out where the chrome already draws the h1.
|
|
18
18
|
*/
|
|
19
19
|
export declare function SettingsPage({ title, headingProps, children }: SettingsPageProps): ReactElement;
|
|
@@ -2,15 +2,15 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { cn } from "../lib/utils.js";
|
|
3
3
|
import { ReadingColumn } from "./reading-column.js";
|
|
4
4
|
/**
|
|
5
|
-
* A page of settings:
|
|
5
|
+
* A page of settings: section cards across the page's width under its title, each saving its own values.
|
|
6
6
|
*
|
|
7
7
|
* @family Compositions
|
|
8
8
|
* @when A place whose job is changing how something behaves: an account's profile, a company's identity, Nadia's notifications.
|
|
9
|
-
* @instead One object's page with a settings card among its sections is an ObjectPage.
|
|
10
|
-
* @behaviour
|
|
11
|
-
* @words `title` names the place as the navigation does ("Profile"); the sections' titles and lines carry the rest.
|
|
9
|
+
* @instead One object's page with a settings card among its sections is an ObjectPage; "Place it once per app, in the footer or settings, not duplicated across pages." (https://vercel.com/geist/theme-switcher) Ours: Theme and Language, which apply on change, stay in the account menu.
|
|
10
|
+
* @behaviour One setting per card (the card's shapes are SettingsSection's: one field, a row of short parts of one value, rows of switches or of selects, a header switch), the cards stacked 24 apart across the page's content width under the page's title row, as Vercel's settings cards fill their column, with no heading between them; a field inside keeps its own bound. A page that mixes cards with other content, such as a table or a list of rules, is not a SettingsPage: its sections take a plain h2 above each card. The page draws no header and no save of its own: each SettingsSection saves from its footer. The danger zone closes the page, in rising severity: transfer, then pause, then delete; only delete is `tone="error"`, and only delete and pause take a button in a hue.
|
|
11
|
+
* @words `title` names the place as the navigation does ("Profile"); the sections' titles and lines carry the rest. A card's title is never the page's h1.
|
|
12
12
|
* @access `title` becomes a visually hidden h1 for a product whose chrome shows the place without a heading; leave it out where the chrome already draws the h1.
|
|
13
13
|
*/
|
|
14
14
|
export function SettingsPage({ title, headingProps, children }) {
|
|
15
|
-
return (_jsxs(ReadingColumn, {
|
|
15
|
+
return (_jsxs(ReadingColumn, { width: "full", children: [title ? (_jsx("h1", { ...headingProps, className: cn("sr-only", headingProps?.className), children: title })) : null, children] }));
|
|
16
16
|
}
|