@nadicodeai/ui 12.1.101 → 12.1.103
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.d.ts +18 -18
- package/dist/components/account-menu.d.ts.map +1 -1
- package/dist/components/account-menu.js +17 -13
- 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/menu-choice-row.d.ts +6 -8
- package/dist/components/menu-choice-row.d.ts.map +1 -1
- package/dist/components/menu-choice-row.js +8 -8
- 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 +20 -3
- package/dist/components/theme-mode-switcher.d.ts.map +1 -1
- package/dist/components/theme-mode-switcher.js +23 -6
- 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 +9 -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 -18
- 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 +637 -549
- 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,24 +1,30 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { mergeProps } from "@base-ui/react/merge-props";
|
|
5
5
|
import { useRender } from "@base-ui/react/use-render";
|
|
6
6
|
import { cva } from "class-variance-authority";
|
|
7
7
|
import { isMobileNow, useIsMobile } from "../hooks/use-mobile.js";
|
|
8
8
|
import { cn } from "../lib/utils.js";
|
|
9
|
+
import { BrandWordmark } from "./brand.js";
|
|
9
10
|
import { Button } from "./button.js";
|
|
10
11
|
import { Input } from "./input.js";
|
|
11
12
|
import { Separator } from "./separator.js";
|
|
12
13
|
import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle } from "./sheet.js";
|
|
13
|
-
import { Skeleton } from "./skeleton.js";
|
|
14
14
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./tooltip.js";
|
|
15
|
-
import { PanelLeftIcon } from "lucide-react";
|
|
15
|
+
import { ChevronRightIcon, PanelLeftIcon, SearchIcon } from "lucide-react";
|
|
16
16
|
const SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
17
17
|
const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
18
|
-
const SIDEBAR_WIDTH =
|
|
18
|
+
const SIDEBAR_WIDTH = 256;
|
|
19
|
+
const SIDEBAR_WIDTH_MIN = 224;
|
|
20
|
+
const SIDEBAR_WIDTH_MAX = 384;
|
|
21
|
+
const SIDEBAR_WIDTH_ICON = 48;
|
|
19
22
|
const SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
20
|
-
const SIDEBAR_WIDTH_ICON = "3rem";
|
|
21
23
|
const SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
24
|
+
const SIDEBAR_RESIZE_STEP = 16;
|
|
25
|
+
function clampWidth(value) {
|
|
26
|
+
return Math.round(Math.min(SIDEBAR_WIDTH_MAX, Math.max(SIDEBAR_WIDTH_MIN, value)));
|
|
27
|
+
}
|
|
22
28
|
const SidebarContext = React.createContext(null);
|
|
23
29
|
function useSidebar() {
|
|
24
30
|
const context = React.useContext(SidebarContext);
|
|
@@ -27,11 +33,9 @@ function useSidebar() {
|
|
|
27
33
|
}
|
|
28
34
|
return context;
|
|
29
35
|
}
|
|
30
|
-
function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange: setOpenProp, passive = false, mobileSheet = true, className, style, children, ...props }) {
|
|
36
|
+
function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange: setOpenProp, onWidthChange, passive = false, mobileSheet = true, className, style, children, ...props }) {
|
|
31
37
|
const isMobile = useIsMobile() && mobileSheet;
|
|
32
38
|
const [openMobile, setOpenMobile] = React.useState(false);
|
|
33
|
-
// This is the internal state of the sidebar.
|
|
34
|
-
// We use openProp and setOpenProp for control from outside the component.
|
|
35
39
|
const [_open, _setOpen] = React.useState(defaultOpen);
|
|
36
40
|
const open = openProp ?? _open;
|
|
37
41
|
const setOpen = React.useCallback((value) => {
|
|
@@ -45,14 +49,22 @@ function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange: set
|
|
|
45
49
|
}
|
|
46
50
|
if (passive)
|
|
47
51
|
return;
|
|
48
|
-
// This sets the cookie to keep the sidebar state.
|
|
49
52
|
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
50
53
|
}, [setOpenProp, open, passive]);
|
|
51
|
-
|
|
54
|
+
const [width, setWidthState] = React.useState(SIDEBAR_WIDTH);
|
|
55
|
+
const setWidth = React.useCallback((value) => {
|
|
56
|
+
const next = clampWidth(value);
|
|
57
|
+
setWidthState(next);
|
|
58
|
+
onWidthChange?.(next);
|
|
59
|
+
}, [onWidthChange]);
|
|
60
|
+
const restore = React.useCallback((kept) => {
|
|
61
|
+
_setOpen(kept.open);
|
|
62
|
+
setWidthState(clampWidth(kept.width));
|
|
63
|
+
}, []);
|
|
64
|
+
const resetWidth = React.useCallback(() => setWidth(SIDEBAR_WIDTH), [setWidth]);
|
|
52
65
|
const toggleSidebar = React.useCallback(() => {
|
|
53
66
|
return mobileSheet && isMobileNow() ? setOpenMobile((open) => !open) : setOpen((open) => !open);
|
|
54
67
|
}, [mobileSheet, setOpen, setOpenMobile]);
|
|
55
|
-
// Adds a keyboard shortcut to toggle the sidebar.
|
|
56
68
|
React.useEffect(() => {
|
|
57
69
|
if (passive)
|
|
58
70
|
return;
|
|
@@ -65,8 +77,6 @@ function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange: set
|
|
|
65
77
|
window.addEventListener("keydown", handleKeyDown);
|
|
66
78
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
67
79
|
}, [toggleSidebar, passive]);
|
|
68
|
-
// We add a state so that we can do data-state="expanded" or "collapsed".
|
|
69
|
-
// This makes it easier to style the sidebar with Tailwind classes.
|
|
70
80
|
const state = open ? "expanded" : "collapsed";
|
|
71
81
|
const contextValue = React.useMemo(() => ({
|
|
72
82
|
state,
|
|
@@ -76,62 +86,133 @@ function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange: set
|
|
|
76
86
|
openMobile,
|
|
77
87
|
setOpenMobile,
|
|
78
88
|
toggleSidebar,
|
|
79
|
-
|
|
89
|
+
width,
|
|
90
|
+
setWidth,
|
|
91
|
+
resetWidth,
|
|
92
|
+
restore,
|
|
93
|
+
}), [
|
|
94
|
+
state,
|
|
95
|
+
open,
|
|
96
|
+
setOpen,
|
|
97
|
+
isMobile,
|
|
98
|
+
openMobile,
|
|
99
|
+
setOpenMobile,
|
|
100
|
+
toggleSidebar,
|
|
101
|
+
width,
|
|
102
|
+
setWidth,
|
|
103
|
+
resetWidth,
|
|
104
|
+
restore,
|
|
105
|
+
]);
|
|
80
106
|
return (_jsx(SidebarContext.Provider, { value: contextValue, children: _jsx(TooltipProvider, { delay: 0, children: _jsx("div", { "data-slot": "sidebar-wrapper",
|
|
81
107
|
// SAFETY: CSSProperties lists only standard properties; React sets each `--` custom property key here through style.setProperty.
|
|
82
108
|
style: {
|
|
83
|
-
"--sidebar-width":
|
|
84
|
-
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON
|
|
109
|
+
"--sidebar-width": `${width}px`,
|
|
110
|
+
"--sidebar-width-icon": `${SIDEBAR_WIDTH_ICON}px`,
|
|
85
111
|
...style,
|
|
86
|
-
}, className: cn("group/sidebar-wrapper flex min-h-svh w-full
|
|
112
|
+
}, className: cn("group/sidebar-wrapper flex min-h-svh w-full", className), ...props, children: children }) }) }));
|
|
87
113
|
}
|
|
88
114
|
/**
|
|
89
115
|
* A product's navigation column: where a person can go, with the account at its foot.
|
|
90
116
|
*
|
|
91
117
|
* @family Navigation
|
|
92
|
-
* @when The Portal
|
|
93
|
-
* @instead
|
|
94
|
-
* @behaviour
|
|
95
|
-
* @words Each row is a place's noun: "Agents", "Tasks", "Customers"
|
|
96
|
-
* @access The column is a landmark; each row is a link or a button with its name, and the current one carries aria-current="page". The badge's number is read with its row.
|
|
118
|
+
* @when The one left column of the Portal and Nadia: a header, Find, groups of places, an object's sections when the column swaps, a band for the update or the way out, and the account. 256 px wide; the Portal's can be dragged between 224 and 384 px or collapsed to icons.
|
|
119
|
+
* @instead Never a second column or a tab row for an object's sections: `SidebarSections` swaps this column. A page's own views are Tabs. A row that opens an area ends in `SidebarMenuChevron`.
|
|
120
|
+
* @behaviour Fills the cell its host gives it and stays in the page flow. `collapsible="icon"` (the default) collapses to 48 px icons with a tooltip name and becomes a sheet under 768 px; with `resize` a handle on its trailing edge drags it, steps it with the arrow keys, resets it on a double-click and collapses it on Enter. `collapsible="none"` is always open and never a sheet. A group is told apart by its label and its padding, never by a rule.
|
|
121
|
+
* @words Each row is a place's noun: "Agents", "Tasks", "Customers"; a count is a bare number. A sheet's title, description and Close label (`mobileTitle`, `mobileDescription`, `mobileCloseLabel`) are required; `resize`, when given, names the handle and comes from the catalogue.
|
|
122
|
+
* @access The column is a landmark; each row is a link or a button with its name, and the current one carries aria-current="page". The handle is a focusable separator with its value in px. The badge's number is read with its row.
|
|
97
123
|
*/
|
|
98
|
-
function Sidebar({
|
|
124
|
+
function Sidebar({ collapsible, resize, mobileTitle, mobileDescription, mobileCloseLabel, mobileFinalFocus, className, children, dir, ...props }) {
|
|
99
125
|
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
100
126
|
if (collapsible === "none") {
|
|
101
127
|
return (_jsx("div", { "data-slot": "sidebar", className: cn("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground", className), ...props, children: children }));
|
|
102
128
|
}
|
|
103
129
|
if (isMobile) {
|
|
104
|
-
return (_jsx(Sheet, { open: openMobile, onOpenChange: setOpenMobile,
|
|
130
|
+
return (_jsx(Sheet, { closesOnScrimPress: true, modal: true, open: openMobile, onOpenChange: setOpenMobile, children: _jsxs(SheetContent, { closeLabel: mobileCloseLabel, finalFocus: mobileFinalFocus, dir: dir, "data-sidebar": "sidebar", "data-slot": "sidebar", "data-mobile": "true", className: "w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground",
|
|
105
131
|
// SAFETY: CSSProperties lists only standard properties; React sets each `--` custom property key here through style.setProperty.
|
|
106
132
|
style: {
|
|
107
133
|
"--sidebar-width": SIDEBAR_WIDTH_MOBILE,
|
|
108
|
-
}, side:
|
|
134
|
+
}, side: "left", children: [_jsxs(SheetHeader, { className: "sr-only", children: [_jsx(SheetTitle, { children: mobileTitle }), _jsx(SheetDescription, { children: mobileDescription })] }), _jsx("div", { className: "flex h-full w-full flex-col", children: children })] }) }));
|
|
109
135
|
}
|
|
110
|
-
return (_jsxs("div", {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
136
|
+
return (_jsxs("div", { "data-slot": "sidebar", "data-state": state, "data-collapsible": state === "collapsed" ? "icon" : "", className: cn("group relative hidden min-h-0 w-(--sidebar-width) shrink-0 flex-col bg-sidebar text-sidebar-foreground data-[collapsible=icon]:w-(--sidebar-width-icon) md:flex", !resize && "border-e", className), ...props, children: [_jsx("div", { "data-sidebar": "sidebar", "data-slot": "sidebar-inner", className: "flex size-full min-h-0 flex-col", children: children }), resize ? _jsx(SidebarResizeHandle, { ...resize }) : null] }));
|
|
137
|
+
}
|
|
138
|
+
function readingDirection(element) {
|
|
139
|
+
return getComputedStyle(element).direction === "rtl" ? -1 : 1;
|
|
140
|
+
}
|
|
141
|
+
function SidebarResizeHandle(name) {
|
|
142
|
+
const { open, setOpen, width, setWidth, resetWidth } = useSidebar();
|
|
143
|
+
const [drag, setDrag] = React.useState(null);
|
|
144
|
+
const shown = open ? width : SIDEBAR_WIDTH_ICON;
|
|
145
|
+
const resizeTo = React.useCallback((requested) => {
|
|
146
|
+
const expanded = requested >= (SIDEBAR_WIDTH_MIN + SIDEBAR_WIDTH_ICON) / 2;
|
|
147
|
+
if (expanded !== open)
|
|
148
|
+
setOpen(expanded);
|
|
149
|
+
if (expanded)
|
|
150
|
+
setWidth(requested);
|
|
151
|
+
}, [open, setOpen, setWidth]);
|
|
152
|
+
React.useEffect(() => {
|
|
153
|
+
if (drag === null)
|
|
154
|
+
return;
|
|
155
|
+
const move = (event) => resizeTo(drag.width + drag.direction * (event.clientX - drag.x));
|
|
156
|
+
const end = () => setDrag(null);
|
|
157
|
+
window.addEventListener("pointermove", move);
|
|
158
|
+
window.addEventListener("pointerup", end);
|
|
159
|
+
window.addEventListener("pointercancel", end);
|
|
160
|
+
return () => {
|
|
161
|
+
window.removeEventListener("pointermove", move);
|
|
162
|
+
window.removeEventListener("pointerup", end);
|
|
163
|
+
window.removeEventListener("pointercancel", end);
|
|
164
|
+
};
|
|
165
|
+
}, [drag, resizeTo]);
|
|
166
|
+
const onKeyDown = (event) => {
|
|
167
|
+
if (event.key === "Enter") {
|
|
168
|
+
event.preventDefault();
|
|
169
|
+
setOpen(!open);
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
if (!open)
|
|
173
|
+
return;
|
|
174
|
+
const direction = readingDirection(event.currentTarget);
|
|
175
|
+
if (event.key === "ArrowLeft" || event.key === "ArrowRight") {
|
|
176
|
+
event.preventDefault();
|
|
177
|
+
const step = event.key === "ArrowLeft" ? -SIDEBAR_RESIZE_STEP : SIDEBAR_RESIZE_STEP;
|
|
178
|
+
setWidth(width + step * direction);
|
|
179
|
+
}
|
|
180
|
+
else if (event.key === "Home") {
|
|
181
|
+
event.preventDefault();
|
|
182
|
+
setWidth(SIDEBAR_WIDTH_MIN);
|
|
183
|
+
}
|
|
184
|
+
else if (event.key === "End") {
|
|
185
|
+
event.preventDefault();
|
|
186
|
+
setWidth(SIDEBAR_WIDTH_MAX);
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
return (_jsx("div", { ...name, role: "separator", "aria-orientation": "vertical", "aria-valuemin": SIDEBAR_WIDTH_ICON, "aria-valuemax": SIDEBAR_WIDTH_MAX, "aria-valuenow": shown, "data-slot": "sidebar-resize-handle", "data-dragging": drag === null ? undefined : "", tabIndex: 0, className: "absolute inset-y-0 -end-1 z-20 w-2 cursor-col-resize touch-none outline-none after:absolute after:inset-y-0 after:start-1/2 after:w-px after:-translate-x-1/2 after:bg-border hover:after:bg-ring focus-visible:nc-focus-outline focus-visible:outline-ring focus-visible:after:bg-ring data-dragging:after:bg-ring", onDoubleClick: () => {
|
|
190
|
+
if (!open)
|
|
191
|
+
setOpen(true);
|
|
192
|
+
resetWidth();
|
|
193
|
+
}, onKeyDown: onKeyDown, onPointerDown: (event) => {
|
|
194
|
+
if (event.button !== 0)
|
|
195
|
+
return;
|
|
196
|
+
event.preventDefault();
|
|
197
|
+
setDrag({
|
|
198
|
+
x: event.clientX,
|
|
199
|
+
width: shown,
|
|
200
|
+
direction: readingDirection(event.currentTarget),
|
|
201
|
+
});
|
|
202
|
+
} }));
|
|
117
203
|
}
|
|
118
|
-
function SidebarTrigger({ className, onClick,
|
|
204
|
+
function SidebarTrigger({ className, onClick, ...props }) {
|
|
119
205
|
const { toggleSidebar } = useSidebar();
|
|
120
|
-
|
|
121
|
-
return (_jsxs(Button, { "data-sidebar": "trigger", "data-slot": "sidebar-trigger", variant: "ghost", size: "icon-sm", className: cn(className), "aria-label": ariaLabel, onClick: (event) => {
|
|
206
|
+
return (_jsx(Button, { "data-sidebar": "trigger", "data-slot": "sidebar-trigger", variant: "ghost", size: "icon-sm", className: cn(className), onClick: (event) => {
|
|
122
207
|
onClick?.(event);
|
|
123
208
|
toggleSidebar();
|
|
124
|
-
}, ...props, children:
|
|
125
|
-
}
|
|
126
|
-
function SidebarRail({ className, "aria-label": ariaLabel = "Toggle Sidebar", title, ...props }) {
|
|
127
|
-
const { toggleSidebar } = useSidebar();
|
|
128
|
-
return (_jsx("button", { "data-sidebar": "rail", "data-slot": "sidebar-rail", "aria-label": ariaLabel, title: title ?? ariaLabel, tabIndex: -1, onClick: toggleSidebar, className: cn("absolute inset-y-0 z-20 hidden w-11 group-data-[side=left]:-right-11 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-0.5 hover:after:bg-sidebar-border sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2 [@media(hover:hover)_and_(pointer:fine)]:w-4 [@media(hover:hover)_and_(pointer:fine)]:group-data-[side=left]:-right-4", "in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize", "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize", "group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar", "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2", "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2", className), ...props }));
|
|
209
|
+
}, ...props, children: _jsx(PanelLeftIcon, {}) }));
|
|
129
210
|
}
|
|
130
211
|
function SidebarInset({ className, focusTarget = false, render, ...props }) {
|
|
131
212
|
return useRender({
|
|
132
213
|
defaultTagName: "div",
|
|
133
214
|
props: mergeProps({
|
|
134
|
-
className: cn("relative flex w-full flex-1 flex-col bg-background
|
|
215
|
+
className: cn("relative flex w-full flex-1 flex-col bg-background", focusTarget && "focus-visible:-outline-offset-[var(--outline-offset-focus)]", className),
|
|
135
216
|
}, props),
|
|
136
217
|
render,
|
|
137
218
|
state: {
|
|
@@ -155,7 +236,7 @@ function SidebarContent({ className, ...props }) {
|
|
|
155
236
|
return (_jsx("div", { "data-slot": "sidebar-content", "data-sidebar": "content", className: cn("no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden", className), ...props }));
|
|
156
237
|
}
|
|
157
238
|
function SidebarGroup({ className, ...props }) {
|
|
158
|
-
return (_jsx("div", { "data-slot": "sidebar-group", "data-sidebar": "group", className: cn("relative flex w-full min-w-0 flex-col p-2", className), ...props }));
|
|
239
|
+
return (_jsx("div", { "data-slot": "sidebar-group", "data-sidebar": "group", className: cn("relative flex w-full min-w-0 flex-col p-2 group-data-[collapsible=icon]:px-1.5", className), ...props }));
|
|
159
240
|
}
|
|
160
241
|
function SidebarGroupLabel({ className, render, ...props }) {
|
|
161
242
|
return useRender({
|
|
@@ -192,7 +273,7 @@ function SidebarMenu({ className, ...props }) {
|
|
|
192
273
|
function SidebarMenuItem({ className, ...props }) {
|
|
193
274
|
return (_jsx("li", { "data-slot": "sidebar-menu-item", "data-sidebar": "menu-item", className: cn("group/menu-item relative", className), ...props }));
|
|
194
275
|
}
|
|
195
|
-
const sidebarMenuButtonVariants = cva("nc-transition-paint peer/menu-button group/menu-button flex min-h-touch-target min-w-touch-target w-full items-center gap-2 overflow-hidden rounded-sm border border-transparent p-2 text-left text-sm group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-control-height! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-primary data-active:font-medium data-active:text-sidebar-primary-foreground data-active:hover:bg-sidebar-primary-hover data-active:hover:text-sidebar-primary-foreground [@media(hover:hover)_and_(pointer:fine)]:min-h-0 [@media(hover:hover)_and_(pointer:fine)]:min-w-0 [&_svg]:size-5 group-data-[collapsible=icon]:[&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate", {
|
|
276
|
+
const sidebarMenuButtonVariants = cva("nc-transition-paint peer/menu-button group/menu-button flex min-h-touch-target min-w-touch-target w-full items-center gap-2 overflow-hidden rounded-sm border border-transparent p-2 text-left text-sm group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-control-height! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-primary data-active:font-medium data-active:text-sidebar-primary-foreground data-active:hover:bg-sidebar-primary-hover data-active:hover:text-sidebar-primary-foreground [@media(hover:hover)_and_(pointer:fine)]:min-h-0 [@media(hover:hover)_and_(pointer:fine)]:min-w-0 [&_svg:not([data-slot=brand-wordmark])]:size-5 group-data-[collapsible=icon]:[&_svg:not([data-slot=brand-wordmark])]:size-4 [&_svg:not([data-slot=brand-wordmark])]:shrink-0 [&>span:last-child]:truncate", {
|
|
196
277
|
variants: {
|
|
197
278
|
variant: {
|
|
198
279
|
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
@@ -253,17 +334,6 @@ function SidebarMenuBadge({ className, tone = "default", ...props }) {
|
|
|
253
334
|
return (_jsx("div", { "data-slot": "sidebar-menu-badge", "data-sidebar": "menu-badge", "data-tone": tone, className: cn("pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-sm px-1 text-xs font-medium text-sidebar-foreground tabular-nums select-none group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 peer-data-active/menu-button:text-sidebar-primary-foreground", tone === "attention" &&
|
|
254
335
|
"h-4.5 min-w-4.5 rounded-full bg-destructive font-semibold text-destructive-foreground peer-hover/menu-button:text-destructive-foreground peer-data-active/menu-button:text-destructive-foreground", className), ...props }));
|
|
255
336
|
}
|
|
256
|
-
function SidebarMenuSkeleton({ className, showIcon = false, ...props }) {
|
|
257
|
-
// Random width between 50 to 90%.
|
|
258
|
-
const [width] = React.useState(() => {
|
|
259
|
-
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
260
|
-
});
|
|
261
|
-
return (_jsxs("div", { "data-slot": "sidebar-menu-skeleton", "data-sidebar": "menu-skeleton", className: cn("flex h-8 items-center gap-2 rounded-sm px-2", className), ...props, children: [showIcon && _jsx(Skeleton, { className: "size-4 rounded-sm", "data-sidebar": "menu-skeleton-icon" }), _jsx(Skeleton, { className: "h-4 max-w-(--skeleton-width) flex-1", "data-sidebar": "menu-skeleton-text",
|
|
262
|
-
// SAFETY: CSSProperties lists only standard properties; React sets each `--` custom property key here through style.setProperty.
|
|
263
|
-
style: {
|
|
264
|
-
"--skeleton-width": width,
|
|
265
|
-
} })] }));
|
|
266
|
-
}
|
|
267
337
|
function SidebarMenuSub({ className, ...props }) {
|
|
268
338
|
return (_jsx("ul", { "data-slot": "sidebar-menu-sub", "data-sidebar": "menu-sub", className: cn("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5 group-data-[collapsible=icon]:hidden", className), ...props }));
|
|
269
339
|
}
|
|
@@ -285,4 +355,59 @@ function SidebarMenuSubButton({ render, size = "md", isActive = false, className
|
|
|
285
355
|
},
|
|
286
356
|
});
|
|
287
357
|
}
|
|
288
|
-
|
|
358
|
+
/**
|
|
359
|
+
* Vercel's ›: the mark at the end of a row that swaps the column to that area's sub-menu: the Portal's Settings and Company, Nadia's company.
|
|
360
|
+
*
|
|
361
|
+
* @family Navigation
|
|
362
|
+
* @when The last child of a `SidebarMenuButton` whose press replaces the places with the area's sections (`SidebarSections`), never of a row that only goes to a page or to a destination whose views are tabs (the Portal's Analytics and Library).
|
|
363
|
+
* @instead A count is `SidebarMenuBadge`; an external link says so in its name.
|
|
364
|
+
* @behaviour A 16 px muted chevron pushed to the row's end, mirrored in right-to-left. A `Sidebar` with `collapsible="icon"` hides it when collapsed; a column that is narrowed by its host (`collapsible="none"`) leaves it out when narrow: `{narrow ? null : <SidebarMenuChevron />}`.
|
|
365
|
+
* @words None.
|
|
366
|
+
* @access Decorative: the row's name and its link say where it goes.
|
|
367
|
+
*/
|
|
368
|
+
function SidebarMenuChevron({ className, ...props }) {
|
|
369
|
+
return (_jsx(ChevronRightIcon, { "aria-hidden": "true", "data-slot": "sidebar-menu-chevron", className: cn("ms-auto size-4! shrink-0 text-muted-foreground group-data-[collapsible=icon]:hidden rtl:rotate-180", className), ...props }));
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* The company's wordmark over the product's name: what the header of a product's column says.
|
|
373
|
+
*
|
|
374
|
+
* @family Navigation
|
|
375
|
+
* @when The `header` of a `SidebarFrame` in the Portal and its sample. Nadia's header is her company row instead.
|
|
376
|
+
* @instead A switcher between companies or teams is a menu in the header, not this mark.
|
|
377
|
+
* @behaviour A 112 px wordmark above one muted line, truncated. Inside a link, the link is the row.
|
|
378
|
+
* @words The line names the product the column belongs to: "Portal", "Business".
|
|
379
|
+
* @access The wordmark is decorative beside the name; the link or button around it carries the accessible name.
|
|
380
|
+
*/
|
|
381
|
+
function SidebarBrand({ subtitle, className }) {
|
|
382
|
+
return (_jsxs("span", { "data-slot": "sidebar-brand", className: cn("grid min-w-0 gap-0", className), children: [_jsx(BrandWordmark, { alt: "", className: "h-5 w-28 max-w-full" }), _jsx("span", { className: "truncate text-xs text-muted-foreground", children: subtitle })] }));
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* The row that opens the product's Find: a field-shaped button under the header, with its key hint.
|
|
386
|
+
*
|
|
387
|
+
* @family Navigation
|
|
388
|
+
* @when The one Find of a sidebar, directly under its header; it opens the product's command dialog or search popover.
|
|
389
|
+
* @instead Never a real text field in the column; filtering a list is the page's own search.
|
|
390
|
+
* @behaviour An outlined row of the column's width: a search icon, the label muted, and the key hint at the end. Collapsed, only the icon stays, with the label as its tooltip; the hint shows only above 768 px.
|
|
391
|
+
* @words One word naming what it finds ("Find"); the hint is the product's own key chord (⌘K in the Portal), never a sentence.
|
|
392
|
+
* @access A button named by `label`, so the name survives the collapsed icon; the hint is read after it.
|
|
393
|
+
*/
|
|
394
|
+
function SidebarFind({ label, shortcut, ...props }) {
|
|
395
|
+
const { isMobile, state } = useSidebar();
|
|
396
|
+
const collapsed = state === "collapsed" && !isMobile;
|
|
397
|
+
return (_jsx(SidebarMenu, { children: _jsx(SidebarMenuItem, { children: _jsxs(SidebarMenuButton, { "aria-label": label, tooltip: label, type: "button", variant: "outline", ...props, children: [_jsx(SearchIcon, { "aria-hidden": "true", className: "text-muted-foreground" }), collapsed ? null : (_jsxs(_Fragment, { children: [_jsx("span", { className: "min-w-0 flex-1 truncate text-left text-muted-foreground", children: label }), _jsx("span", { className: "ms-auto shrink-0 max-md:hidden", children: shortcut })] }))] }) }) }));
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* The regions of a product's `Sidebar`, in order: header, Find, groups, band, account.
|
|
401
|
+
*
|
|
402
|
+
* @family Navigation
|
|
403
|
+
* @when The content of every product's `Sidebar`: the Portal's brand and Nadia's company row go in `header`, their Find in `find`, their places in the children.
|
|
404
|
+
* @instead A product lays no region of its own: no grid of rows, no hand-drawn rule between regions.
|
|
405
|
+
* @behaviour A 56 px header with the collapse control under a 1 px rule, Find under it, the groups scrolling in the middle, then the band and the account pinned at the foot above 1 px rules. `header`, `find` and `account` are required; an absent band leaves no rule. Collapsed, the header shows only the collapse control.
|
|
406
|
+
* @words None of its own; every word arrives in the regions.
|
|
407
|
+
* @access The regions are plain containers; the landmark is the `Sidebar` around them and the nav inside each group.
|
|
408
|
+
*/
|
|
409
|
+
function SidebarFrame({ header, toggle, find, children, band, account, actions, }) {
|
|
410
|
+
const { isMobile, state } = useSidebar();
|
|
411
|
+
return (_jsxs("div", { "data-slot": "sidebar-frame", className: "flex min-h-0 flex-1 flex-col", children: [_jsxs(SidebarHeader, { className: "box-content h-14 shrink-0 flex-row items-center justify-between gap-1 border-b px-3 py-0 group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:px-0", "data-slot": "sidebar-header", children: [state === "expanded" || isMobile ? _jsx("div", { className: "min-w-0 flex-1", children: header }) : null, toggle] }), _jsx("div", { className: "shrink-0 p-2 group-data-[collapsible=icon]:px-1.5", "data-slot": "sidebar-find", children: find }), _jsx(SidebarContent, { children: children }), band ? (_jsx(SidebarGroup, { className: "shrink-0 border-t", "data-slot": "sidebar-band", children: _jsx(SidebarGroupContent, { children: band }) })) : null, _jsx(SidebarFooter, { className: "shrink-0 border-t group-data-[collapsible=icon]:px-1.5", children: _jsxs("div", { className: "flex w-full items-center gap-1 group-data-[collapsible=icon]:flex-col group-data-[collapsible=icon]:gap-2", children: [_jsx("div", { className: "min-w-0 flex-1 group-data-[collapsible=icon]:w-full group-data-[collapsible=icon]:flex-none", children: account }), actions ? (_jsx("div", { className: "flex shrink-0 items-center justify-center", children: actions })) : null] }) })] }));
|
|
412
|
+
}
|
|
413
|
+
export { SIDEBAR_WIDTH, SIDEBAR_WIDTH_ICON, SIDEBAR_WIDTH_MAX, SIDEBAR_WIDTH_MIN, Sidebar, SidebarBrand, SidebarContent, SidebarFind, SidebarFooter, SidebarFrame, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuChevron, SidebarMenuItem, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarSeparator, SidebarTrigger, useSidebar, };
|
|
@@ -1,15 +1,61 @@
|
|
|
1
|
+
import type { PresentContent } from "../internal/present-content.js";
|
|
2
|
+
declare const shapeClasses: {
|
|
3
|
+
readonly rectangle: "rounded-sm";
|
|
4
|
+
readonly circle: "rounded-full";
|
|
5
|
+
readonly squared: "rounded-none";
|
|
6
|
+
};
|
|
7
|
+
type SkeletonShape = keyof typeof shapeClasses;
|
|
8
|
+
type SkeletonSizing = {
|
|
9
|
+
children: PresentContent;
|
|
10
|
+
width?: undefined;
|
|
11
|
+
height?: undefined;
|
|
12
|
+
boxHeight?: undefined;
|
|
13
|
+
} | {
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
className: string;
|
|
16
|
+
width?: undefined;
|
|
17
|
+
height?: undefined;
|
|
18
|
+
boxHeight?: undefined;
|
|
19
|
+
} | {
|
|
20
|
+
children?: React.ReactNode;
|
|
21
|
+
width?: number | string | undefined;
|
|
22
|
+
height: number;
|
|
23
|
+
boxHeight?: number | undefined;
|
|
24
|
+
};
|
|
25
|
+
type SkeletonProps = Omit<React.ComponentProps<"div">, "children"> & SkeletonSizing & {
|
|
26
|
+
/** The final element's shape: `circle` for an avatar, `squared` for an image tile. */
|
|
27
|
+
shape?: SkeletonShape | undefined;
|
|
28
|
+
/** Unsized, with children: whether the placeholder covers them; `false` reveals them in the same box. Otherwise: whether the bar is drawn; the box stays. */
|
|
29
|
+
show?: boolean | undefined;
|
|
30
|
+
};
|
|
1
31
|
/**
|
|
2
32
|
* A still placeholder in the shape of content whose layout is known.
|
|
3
33
|
*
|
|
4
34
|
* @family Feedback
|
|
5
|
-
* @when
|
|
6
|
-
*
|
|
7
|
-
* @
|
|
8
|
-
*
|
|
9
|
-
* @
|
|
35
|
+
* @when "Show a Skeleton when async data fills a known layout: table rows, card grids, profile blocks, sidebars." (https://vercel.com/geist/skeleton)
|
|
36
|
+
* Ours: a group of placeholders sits in the `SkeletonRegion` that later holds the data.
|
|
37
|
+
* @instead "For a single in-flight action, use `Spinner`; for an indeterminate inline wait, use `LoadingDots`; for known progress, use `Progress`." "Don’t use Skeleton as permanent decoration or as a placeholder for empty states." "When there’s no data to load, render an `EmptyState`." (https://vercel.com/geist/skeleton)
|
|
38
|
+
* Ours: there is no spinner and no loading dots: a wait on something the person pressed is `PendingLabel` and `WaitingLine`. An unknown layout shows nothing until the data arrives.
|
|
39
|
+
* @behaviour "Set `width` and `height` to match the final content so the layout doesn’t shift when data resolves." "A 200×20 block becoming an 80×16 string reads as a glitch." "Pick `pill`, `rounded`, or `squared` to mirror the eventual element’s shape (avatars `pill`, buttons and chips `rounded`, image tiles `squared`)." "When the skeleton wraps children, keep dimensions stable so the reveal swap doesn’t reflow surrounding content." "If you do not pass a fixed size, it will be calculated automatically." "The skeleton will hide when children are not null, but the size is retained." (https://vercel.com/geist/skeleton)
|
|
40
|
+
* Ours: `pill` is `circle` and `rounded` is `rectangle`. A skeleton with neither a size nor a child does not compile: `height` with `width`, or `className` for a size a token sets (`h-4 w-full`; the type cannot check that it holds one), or `boxHeight` with `height` for a text line, where the bar sits at the top of the box and the rest is space below it. Given a size, pass the content as children, `null` until it arrives: the bar shows, then the content replaces it in the same box. Without a size, wrap the real control and `show` covers it, `show={false}` reveals it, rather than drawing a twin of it. Still: it never pulses or shimmers. It resolves to data, an absence or a failure.
|
|
41
|
+
* @words Ours: none. No "Loading" text beside it.
|
|
42
|
+
* @access "Skeletons are decorative; avoid placing focusable controls inside them while loading." "Disable the shimmer with the `no animation` variant on low-power surfaces and respect `prefers-reduced-motion`." (https://vercel.com/geist/skeleton)
|
|
43
|
+
* Ours: hidden from assistive technology and never focusable; an unsized wrapper covers its children inert and is `aria-busy` while it covers them. There is no shimmer to disable, so the placeholder is the same under `prefers-reduced-motion`. A group of bare placeholders needs a `SkeletonRegion`.
|
|
10
44
|
*/
|
|
11
|
-
declare function Skeleton({ className, shape, ...props }:
|
|
12
|
-
|
|
45
|
+
declare function Skeleton({ boxHeight, children, className, height, shape, show, style, width, ...props }: SkeletonProps): import("react").JSX.Element;
|
|
46
|
+
/**
|
|
47
|
+
* The container that shows placeholders and then the data, announced as busy while it loads.
|
|
48
|
+
*
|
|
49
|
+
* @family Feedback
|
|
50
|
+
* @when Ours: around the placeholders of a page or a card and the data that replaces them. In a component that renders both, it announces the data when it arrives. In a route's `loading` view it only marks the wait, since that view is unmounted when the page streams in; the page's own region announces the arrival.
|
|
51
|
+
* @instead Ours: a single `Skeleton` that wraps its content marks itself busy and needs no region.
|
|
52
|
+
* @behaviour Ours: `busy` is required: true while placeholders show, false in the same render that puts the data in. The same element goes from busy to not busy, so the change is announced once.
|
|
53
|
+
* @words Ours: none.
|
|
54
|
+
* @access "Wrap the loading region in `aria-busy="true"` and announce completion with `aria-live="polite"` on the destination container, not the skeleton itself." (https://vercel.com/geist/skeleton)
|
|
55
|
+
* Ours: `aria-busy` and a polite live region while loading, so the data that arrives is announced from the container that holds it; once loaded it is no live region, so a later change in the data, such as a row's status, is not read out wherever the reader is.
|
|
56
|
+
*/
|
|
57
|
+
declare function SkeletonRegion({ busy, ...props }: React.ComponentProps<"div"> & {
|
|
58
|
+
busy: boolean;
|
|
13
59
|
}): import("react").JSX.Element;
|
|
14
|
-
export { Skeleton };
|
|
60
|
+
export { Skeleton, SkeletonRegion };
|
|
15
61
|
//# sourceMappingURL=skeleton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../src/components/skeleton.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../src/components/skeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAGjE,QAAA,MAAM,YAAY;;;;CAIR,CAAC;AAEX,KAAK,aAAa,GAAG,MAAM,OAAO,YAAY,CAAC;AAE/C,KAAK,cAAc,GACf;IACE,QAAQ,EAAE,cAAc,CAAC;IACzB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,GACD;IACE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,GACD;IACE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC,CAAC;AAEN,KAAK,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,GAChE,cAAc,GAAG;IACf,sFAAsF;IACtF,KAAK,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAClC,6JAA6J;IAC7J,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC5B,CAAC;AAMJ;;;;;;;;;;;;;GAaG;AACH,iBAAS,QAAQ,CAAC,EAChB,SAAS,EACT,QAAQ,EACR,SAAS,EACT,MAAM,EACN,KAAmB,EACnB,IAAW,EACX,KAAK,EACL,KAAK,EACL,GAAG,KAAK,EACT,EAAE,aAAa,+BAiEf;AAED;;;;;;;;;;GAUG;AACH,iBAAS,cAAc,CAAC,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,+BAS1F;AAED,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -1,16 +1,51 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "../lib/utils.js";
|
|
3
|
+
const shapeClasses = {
|
|
4
|
+
rectangle: "rounded-sm",
|
|
5
|
+
circle: "rounded-full",
|
|
6
|
+
squared: "rounded-none",
|
|
7
|
+
};
|
|
8
|
+
function hasNoContent(children) {
|
|
9
|
+
return children === undefined || children === null || children === true || children === false;
|
|
10
|
+
}
|
|
3
11
|
/**
|
|
4
12
|
* A still placeholder in the shape of content whose layout is known.
|
|
5
13
|
*
|
|
6
14
|
* @family Feedback
|
|
7
|
-
* @when
|
|
8
|
-
*
|
|
9
|
-
* @
|
|
10
|
-
*
|
|
11
|
-
* @
|
|
15
|
+
* @when "Show a Skeleton when async data fills a known layout: table rows, card grids, profile blocks, sidebars." (https://vercel.com/geist/skeleton)
|
|
16
|
+
* Ours: a group of placeholders sits in the `SkeletonRegion` that later holds the data.
|
|
17
|
+
* @instead "For a single in-flight action, use `Spinner`; for an indeterminate inline wait, use `LoadingDots`; for known progress, use `Progress`." "Don’t use Skeleton as permanent decoration or as a placeholder for empty states." "When there’s no data to load, render an `EmptyState`." (https://vercel.com/geist/skeleton)
|
|
18
|
+
* Ours: there is no spinner and no loading dots: a wait on something the person pressed is `PendingLabel` and `WaitingLine`. An unknown layout shows nothing until the data arrives.
|
|
19
|
+
* @behaviour "Set `width` and `height` to match the final content so the layout doesn’t shift when data resolves." "A 200×20 block becoming an 80×16 string reads as a glitch." "Pick `pill`, `rounded`, or `squared` to mirror the eventual element’s shape (avatars `pill`, buttons and chips `rounded`, image tiles `squared`)." "When the skeleton wraps children, keep dimensions stable so the reveal swap doesn’t reflow surrounding content." "If you do not pass a fixed size, it will be calculated automatically." "The skeleton will hide when children are not null, but the size is retained." (https://vercel.com/geist/skeleton)
|
|
20
|
+
* Ours: `pill` is `circle` and `rounded` is `rectangle`. A skeleton with neither a size nor a child does not compile: `height` with `width`, or `className` for a size a token sets (`h-4 w-full`; the type cannot check that it holds one), or `boxHeight` with `height` for a text line, where the bar sits at the top of the box and the rest is space below it. Given a size, pass the content as children, `null` until it arrives: the bar shows, then the content replaces it in the same box. Without a size, wrap the real control and `show` covers it, `show={false}` reveals it, rather than drawing a twin of it. Still: it never pulses or shimmers. It resolves to data, an absence or a failure.
|
|
21
|
+
* @words Ours: none. No "Loading" text beside it.
|
|
22
|
+
* @access "Skeletons are decorative; avoid placing focusable controls inside them while loading." "Disable the shimmer with the `no animation` variant on low-power surfaces and respect `prefers-reduced-motion`." (https://vercel.com/geist/skeleton)
|
|
23
|
+
* Ours: hidden from assistive technology and never focusable; an unsized wrapper covers its children inert and is `aria-busy` while it covers them. There is no shimmer to disable, so the placeholder is the same under `prefers-reduced-motion`. A group of bare placeholders needs a `SkeletonRegion`.
|
|
24
|
+
*/
|
|
25
|
+
function Skeleton({ boxHeight, children, className, height, shape = "rectangle", show = true, style, width, ...props }) {
|
|
26
|
+
if (hasNoContent(children)) {
|
|
27
|
+
if (boxHeight !== undefined) {
|
|
28
|
+
return (_jsx("div", { "aria-hidden": "true", "data-slot": "skeleton", className: cn("flex items-start", className), style: { width, height: boxHeight, ...style }, ...props, children: show ? (_jsx("div", { className: cn("w-full bg-border", shapeClasses[shape]), style: { height } })) : null }));
|
|
29
|
+
}
|
|
30
|
+
return (_jsx("div", { "aria-hidden": "true", "data-slot": "skeleton", className: cn(show && "bg-border", shapeClasses[shape], className), style: { width, height, ...style }, ...props }));
|
|
31
|
+
}
|
|
32
|
+
if (height !== undefined) {
|
|
33
|
+
return (_jsx("div", { "data-slot": "skeleton", className: className, style: { width, height: boxHeight ?? height, ...style }, ...props, children: children }));
|
|
34
|
+
}
|
|
35
|
+
return (_jsx("div", { "aria-busy": show || undefined, "data-slot": "skeleton", className: cn("relative inline-flex max-w-full", className), style: style, ...props, children: show ? (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": "true", className: "invisible contents", inert: true, children: children }), _jsx("span", { "aria-hidden": "true", className: cn("absolute inset-0 bg-border", shapeClasses[shape]) })] })) : (children) }));
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The container that shows placeholders and then the data, announced as busy while it loads.
|
|
39
|
+
*
|
|
40
|
+
* @family Feedback
|
|
41
|
+
* @when Ours: around the placeholders of a page or a card and the data that replaces them. In a component that renders both, it announces the data when it arrives. In a route's `loading` view it only marks the wait, since that view is unmounted when the page streams in; the page's own region announces the arrival.
|
|
42
|
+
* @instead Ours: a single `Skeleton` that wraps its content marks itself busy and needs no region.
|
|
43
|
+
* @behaviour Ours: `busy` is required: true while placeholders show, false in the same render that puts the data in. The same element goes from busy to not busy, so the change is announced once.
|
|
44
|
+
* @words Ours: none.
|
|
45
|
+
* @access "Wrap the loading region in `aria-busy="true"` and announce completion with `aria-live="polite"` on the destination container, not the skeleton itself." (https://vercel.com/geist/skeleton)
|
|
46
|
+
* Ours: `aria-busy` and a polite live region while loading, so the data that arrives is announced from the container that holds it; once loaded it is no live region, so a later change in the data, such as a row's status, is not read out wherever the reader is.
|
|
12
47
|
*/
|
|
13
|
-
function
|
|
14
|
-
return (_jsx("div", { "aria-
|
|
48
|
+
function SkeletonRegion({ busy, ...props }) {
|
|
49
|
+
return (_jsx("div", { "aria-busy": busy, "aria-live": busy ? "polite" : undefined, "data-slot": "skeleton-region", ...props }));
|
|
15
50
|
}
|
|
16
|
-
export { Skeleton };
|
|
51
|
+
export { Skeleton, SkeletonRegion };
|
|
@@ -1,18 +1,60 @@
|
|
|
1
|
+
import * as React from "react";
|
|
1
2
|
import { Slider as SliderPrimitive } from "@base-ui/react/slider";
|
|
3
|
+
export type SliderValues = readonly [number] | readonly [number, number];
|
|
4
|
+
export type SliderProps<Values extends SliderValues = readonly [number]> = Omit<SliderPrimitive.Root.Props<readonly number[]>, "aria-label" | "aria-labelledby" | "children" | "defaultValue" | "max" | "min" | "onValueChange" | "onValueCommitted" | "orientation" | "render" | "step" | "thumbAlignment" | "value"> & {
|
|
5
|
+
/** The real lower limit of the quantity, not a stand-in such as 0. */
|
|
6
|
+
min: number;
|
|
7
|
+
/** The real upper limit of the quantity. */
|
|
8
|
+
max: number;
|
|
9
|
+
/** A round increment, so a drag never lands on a value nobody would type. */
|
|
10
|
+
step: number;
|
|
11
|
+
/** Names the quantity; written above the track, with the live value beside it. */
|
|
12
|
+
label: string;
|
|
13
|
+
/** One number per thumb: a single value for one thumb, two for a range. */
|
|
14
|
+
value?: Values;
|
|
15
|
+
defaultValue?: Values;
|
|
16
|
+
onValueChange?: (value: Values) => void;
|
|
17
|
+
/** Fires once when a drag, a key press or a typed value settles, not on every step. */
|
|
18
|
+
onValueCommitted?: (value: Values) => void;
|
|
19
|
+
/** Writes the first value of a range in a box before the track; a single thumb has none. */
|
|
20
|
+
showStartInput?: Values extends readonly [number] ? never : boolean;
|
|
21
|
+
/** Writes the last value in a box after the track. */
|
|
22
|
+
showEndInput?: boolean;
|
|
23
|
+
};
|
|
2
24
|
/**
|
|
3
|
-
* A bounded number chosen by a thumb's position on a track.
|
|
25
|
+
* A bounded number chosen by a thumb's position on a track, with its name and its live value.
|
|
4
26
|
*
|
|
5
27
|
* @family Inputs
|
|
6
|
-
* @when
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* @
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* @
|
|
13
|
-
* (
|
|
14
|
-
*
|
|
28
|
+
* @when "Use a slider for ranged numeric input where shape and proximity matter more than
|
|
29
|
+
* precision: bandwidth caps, opacity, audio volume, color channels."
|
|
30
|
+
* (https://vercel.com/geist/slider) Ours: a limit, a share.
|
|
31
|
+
* @instead "For exact values like a port number or memory limit, pair the slider with a numeric
|
|
32
|
+
* `Input`; keyboard users default to typing." (https://vercel.com/geist/slider) Ours:
|
|
33
|
+
* `showEndInput`, and `showStartInput` on a range, add that box. A few named levels are radios.
|
|
34
|
+
* @behaviour "Snap to a sensible step (`1`, `5`, `10%`) so dragging never produces values like
|
|
35
|
+
* `47.83291`." (https://vercel.com/geist/slider) "Clamp `min` and `max` to real product limits."
|
|
36
|
+
* (https://vercel.com/geist/slider) "Always render the live value next to the track in tabular
|
|
37
|
+
* nums, and label what the number represents (`Sample Rate · 44 kHz`)."
|
|
38
|
+
* (https://vercel.com/geist/slider) "The track alone is not self-describing."
|
|
39
|
+
* (https://vercel.com/geist/slider) "Threshold colors (warning, error tints past a limit) should
|
|
40
|
+
* match the same numeric breakpoint surfaced elsewhere in the UI; don’t invent a slider-only
|
|
41
|
+
* threshold." (https://vercel.com/geist/slider) Ours: `label`, `min`, `max` and `step` are
|
|
42
|
+
* required. The label sits above the track at 13 px in the secondary grey, with the live value
|
|
43
|
+
* beside it. The track is 8 px high and grey, the filled part is blue, and the thumb is a 6 by 14
|
|
44
|
+
* px white bar; a disabled slider turns the filled part grey and leaves the rest. Colour: blue is
|
|
45
|
+
* the one hue, the filled part and nothing else. The thumb grows by a fifth while it is dragged
|
|
46
|
+
* (only the dragged one) or has keyboard focus, and hovering changes nothing. A range has two
|
|
47
|
+
* thumbs and cannot cross. A typed value is snapped to the step and kept inside the bounds when the
|
|
48
|
+
* box loses focus or Enter is pressed. `onValueCommitted` fires once when the change settles.
|
|
49
|
+
* @words Ours: the label names the quantity: *Monthly limit*. The unit comes from `format`, so the
|
|
50
|
+
* value reads *€400*, not 400. The help under the slider states the bounds and the step.
|
|
51
|
+
* @access "Give the slider an accessible name through a sibling `<label htmlFor>` or `aria-label`,
|
|
52
|
+
* and let the native arrow-key, Page Up/Down, Home/End behavior do the keyboard work."
|
|
53
|
+
* (https://vercel.com/geist/slider) "Don’t intercept those keys." (https://vercel.com/geist/slider)
|
|
54
|
+
* Ours: each thumb is `role="slider"` named by the label, with `aria-valuetext` carrying the unit
|
|
55
|
+
* from `format`. A single thumb and its box are named by the label; the two thumbs and the two
|
|
56
|
+
* boxes of a range by the label and their position, *Price 1* and *Price 2*.
|
|
15
57
|
*/
|
|
16
|
-
declare function Slider({
|
|
58
|
+
declare function Slider<Values extends SliderValues = readonly [number]>({ label, value, defaultValue, onValueChange, onValueCommitted, showStartInput, showEndInput, className, min, max, step, disabled, ...props }: SliderProps<Values>): React.JSX.Element;
|
|
17
59
|
export { Slider };
|
|
18
60
|
//# sourceMappingURL=slider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slider.d.ts","sourceRoot":"","sources":["../../src/components/slider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"slider.d.ts","sourceRoot":"","sources":["../../src/components/slider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAKlE,MAAM,MAAM,YAAY,GAAG,SAAS,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEzE,MAAM,MAAM,WAAW,CAAC,MAAM,SAAS,YAAY,GAAG,SAAS,CAAC,MAAM,CAAC,IAAI,IAAI,CAC7E,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,MAAM,EAAE,CAAC,EAC3C,YAAY,GACZ,iBAAiB,GACjB,UAAU,GACV,cAAc,GACd,KAAK,GACL,KAAK,GACL,eAAe,GACf,kBAAkB,GAClB,aAAa,GACb,QAAQ,GACR,MAAM,GACN,gBAAgB,GAChB,OAAO,CACV,GAAG;IACF,sEAAsE;IACtE,GAAG,EAAE,MAAM,CAAC;IACZ,4CAA4C;IAC5C,GAAG,EAAE,MAAM,CAAC;IACZ,6EAA6E;IAC7E,IAAI,EAAE,MAAM,CAAC;IACb,kFAAkF;IAClF,KAAK,EAAE,MAAM,CAAC;IACd,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,uFAAuF;IACvF,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,4FAA4F;IAC5F,cAAc,CAAC,EAAE,MAAM,SAAS,SAAS,CAAC,MAAM,CAAC,GAAG,KAAK,GAAG,OAAO,CAAC;IACpE,sDAAsD;IACtD,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAwDF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,iBAAS,MAAM,CAAC,MAAM,SAAS,YAAY,GAAG,SAAS,CAAC,MAAM,CAAC,EAAE,EAC/D,KAAK,EACL,KAAK,EACL,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,SAAS,EACT,GAAG,EACH,GAAG,EACH,IAAI,EACJ,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,WAAW,CAAC,MAAM,CAAC,qBAkFrB;AAED,OAAO,EAAE,MAAM,EAAE,CAAC"}
|