@ciridae/ui 0.16.1 → 1.0.1
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/README.md +17 -12
- package/dist/chat/chat-api-error.d.ts +14 -0
- package/dist/chat/chat-api-error.js +11 -0
- package/dist/chat/chat-client.d.ts +37 -0
- package/dist/chat/chat-client.js +66 -0
- package/dist/chat/chat-hooks.d.ts +4 -0
- package/dist/chat/chat-hooks.js +4 -0
- package/dist/chat/chat-query-keys.d.ts +10 -0
- package/dist/chat/chat-query-keys.js +8 -0
- package/dist/chat/contract.d.ts +488 -0
- package/dist/chat/contract.js +223 -0
- package/dist/chat/conversation-items-query-options.d.ts +382 -0
- package/dist/chat/conversation-items-query-options.js +15 -0
- package/dist/chat/describe-tool-call.d.ts +5 -0
- package/dist/chat/describe-tool-call.js +33 -0
- package/dist/chat/fetch-new-conversation-items.d.ts +10 -0
- package/dist/chat/fetch-new-conversation-items.js +38 -0
- package/dist/chat/message-group-position.d.ts +17 -0
- package/dist/chat/message-group-position.js +25 -0
- package/dist/chat/message-text.d.ts +23 -0
- package/dist/chat/message-text.js +118 -0
- package/dist/chat/mock-chat-client.d.ts +97 -0
- package/dist/chat/mock-chat-client.js +566 -0
- package/dist/chat/use-chat-conversation.d.ts +43 -0
- package/dist/chat/use-chat-conversation.js +156 -0
- package/dist/chat/use-conversation-list.d.ts +32 -0
- package/dist/chat/use-conversation-list.js +19 -0
- package/dist/ciridae.css +60 -479
- package/dist/components/activity-feed.d.ts +80 -0
- package/dist/components/activity-feed.js +373 -0
- package/dist/components/agent-work.d.ts +76 -0
- package/dist/components/agent-work.js +224 -0
- package/dist/components/app-navigation.d.ts +66 -0
- package/dist/components/app-navigation.js +102 -0
- package/dist/components/badge.d.ts +14 -0
- package/dist/components/badge.js +107 -0
- package/dist/components/brand-icons.d.ts +17 -0
- package/dist/components/brand-icons.js +21 -0
- package/dist/components/breakpoint.d.ts +7 -0
- package/dist/components/breakpoint.js +16 -0
- package/dist/components/bulk-action-bar.d.ts +15 -0
- package/dist/components/bulk-action-bar.js +45 -0
- package/dist/components/button.d.ts +52 -0
- package/dist/components/button.js +272 -0
- package/dist/components/calendar.d.ts +14 -0
- package/dist/components/calendar.js +158 -0
- package/dist/components/centered-page.d.ts +21 -0
- package/dist/components/centered-page.js +55 -0
- package/dist/components/chart.d.ts +22 -0
- package/dist/components/chart.js +116 -0
- package/dist/components/chat-page.d.ts +34 -0
- package/dist/components/chat-page.js +171 -0
- package/dist/components/chat-sheet-controller.d.ts +50 -0
- package/dist/components/chat-sheet-controller.js +133 -0
- package/dist/components/chat-sheet.d.ts +80 -0
- package/dist/components/chat-sheet.js +544 -0
- package/dist/components/chat.d.ts +135 -0
- package/dist/components/chat.js +545 -0
- package/dist/components/checkbox-item.d.ts +11 -0
- package/dist/components/checkbox-item.js +45 -0
- package/dist/components/checkbox-list.d.ts +51 -0
- package/dist/components/checkbox-list.js +167 -0
- package/dist/components/chip.d.ts +17 -0
- package/dist/components/chip.js +43 -0
- package/dist/components/collapsible.d.ts +8 -0
- package/dist/components/collapsible.js +41 -0
- package/dist/components/color-theme.d.ts +40 -0
- package/dist/components/color-theme.js +109 -0
- package/dist/components/column-settings.d.ts +22 -0
- package/dist/components/column-settings.js +112 -0
- package/dist/components/command-match.d.ts +7 -0
- package/dist/components/command-match.js +50 -0
- package/dist/components/command-menu.d.ts +43 -0
- package/dist/components/command-menu.js +339 -0
- package/dist/components/command-palette.d.ts +36 -0
- package/dist/components/command-palette.js +77 -0
- package/dist/components/controllable-state.d.ts +5 -0
- package/dist/components/controllable-state.js +15 -0
- package/dist/components/copyable-id.d.ts +37 -0
- package/dist/components/copyable-id.js +136 -0
- package/dist/components/data-display.d.ts +47 -0
- package/dist/components/data-display.js +221 -0
- package/dist/components/data-grid.d.ts +170 -0
- package/dist/components/data-grid.js +829 -0
- package/dist/components/date-range-picker.d.ts +44 -0
- package/dist/components/date-range-picker.js +153 -0
- package/dist/components/date-time.d.ts +11 -0
- package/dist/components/date-time.js +44 -0
- package/dist/components/dialog-height-context.d.ts +2 -0
- package/dist/components/dialog-height-context.js +3 -0
- package/dist/components/document-viewer.d.ts +62 -0
- package/dist/components/document-viewer.js +419 -0
- package/dist/components/drawer.d.ts +44 -0
- package/dist/components/drawer.js +236 -0
- package/dist/components/dropzone.d.ts +47 -0
- package/dist/components/dropzone.js +370 -0
- package/dist/components/editable-field.d.ts +99 -0
- package/dist/components/editable-field.js +422 -0
- package/dist/components/email-input.d.ts +12 -0
- package/dist/components/email-input.js +83 -0
- package/dist/components/environment-frame.d.ts +13 -0
- package/dist/components/environment-frame.js +42 -0
- package/dist/components/expandable-text.d.ts +9 -0
- package/dist/components/expandable-text.js +48 -0
- package/dist/components/feedback-screenshot.d.ts +19 -0
- package/dist/components/feedback-screenshot.js +162 -0
- package/dist/components/feedback-sheet.d.ts +80 -0
- package/dist/components/feedback-sheet.js +475 -0
- package/dist/components/field-context.d.ts +23 -0
- package/dist/components/field-context.js +15 -0
- package/dist/components/filter-bar.d.ts +77 -0
- package/dist/components/filter-bar.js +350 -0
- package/dist/components/form-controls.d.ts +53 -0
- package/dist/components/form-controls.js +123 -0
- package/dist/components/form-layout.d.ts +32 -0
- package/dist/components/form-layout.js +72 -0
- package/dist/components/hotkeys.d.ts +27 -0
- package/dist/components/hotkeys.js +70 -0
- package/dist/components/icon.d.ts +58 -0
- package/dist/components/icon.js +42 -0
- package/dist/components/input.d.ts +36 -0
- package/dist/components/input.js +249 -0
- package/dist/components/keyboard-shortcuts.d.ts +10 -0
- package/dist/components/keyboard-shortcuts.js +91 -0
- package/dist/components/keycap.d.ts +12 -0
- package/dist/components/keycap.js +45 -0
- package/dist/components/layout.d.ts +174 -0
- package/dist/components/layout.js +282 -0
- package/dist/components/lightbox.d.ts +14 -0
- package/dist/components/lightbox.js +117 -0
- package/dist/components/link.d.ts +13 -0
- package/dist/components/link.js +37 -0
- package/dist/components/locale.d.ts +463 -0
- package/dist/components/locale.js +501 -0
- package/dist/components/log-list.d.ts +20 -0
- package/dist/components/log-list.js +92 -0
- package/dist/components/mention-input.d.ts +50 -0
- package/dist/components/mention-input.js +503 -0
- package/dist/components/menu.d.ts +76 -0
- package/dist/components/menu.js +112 -0
- package/dist/components/meter.d.ts +14 -0
- package/dist/components/meter.js +44 -0
- package/dist/components/navigation.d.ts +21 -0
- package/dist/components/navigation.js +75 -0
- package/dist/components/notification-tray.d.ts +47 -0
- package/dist/components/notification-tray.js +218 -0
- package/dist/components/overlays.d.ts +107 -0
- package/dist/components/overlays.js +240 -0
- package/dist/components/page-frame.d.ts +65 -0
- package/dist/components/page-frame.js +94 -0
- package/dist/components/panel.d.ts +24 -0
- package/dist/components/panel.js +107 -0
- package/dist/components/profile-header.d.ts +15 -0
- package/dist/components/profile-header.js +40 -0
- package/dist/components/progress.d.ts +5 -0
- package/dist/components/progress.js +18 -0
- package/dist/components/project-avatar.d.ts +12 -0
- package/dist/components/project-avatar.js +22 -0
- package/dist/components/radio-card.d.ts +22 -0
- package/dist/components/radio-card.js +66 -0
- package/dist/components/recent-items.d.ts +28 -0
- package/dist/components/recent-items.js +63 -0
- package/dist/components/record.d.ts +95 -0
- package/dist/components/record.js +282 -0
- package/dist/components/scroll-area.d.ts +16 -0
- package/dist/components/scroll-area.js +50 -0
- package/dist/components/secret-dialog.d.ts +10 -0
- package/dist/components/secret-dialog.js +12 -0
- package/dist/components/segmented-bar.d.ts +23 -0
- package/dist/components/segmented-bar.js +75 -0
- package/dist/components/select.d.ts +84 -0
- package/dist/components/select.js +374 -0
- package/dist/components/settings.d.ts +34 -0
- package/dist/components/settings.js +56 -0
- package/dist/components/shell-skeleton.d.ts +7 -0
- package/dist/components/shell-skeleton.js +15 -0
- package/dist/components/shell.d.ts +62 -0
- package/dist/components/shell.js +415 -0
- package/dist/components/side-panel.d.ts +36 -0
- package/dist/components/side-panel.js +184 -0
- package/dist/components/sidebar.d.ts +35 -0
- package/dist/components/sidebar.js +207 -0
- package/dist/components/site-banner.d.ts +25 -0
- package/dist/components/site-banner.js +30 -0
- package/dist/components/skeleton.d.ts +15 -0
- package/dist/components/skeleton.js +61 -0
- package/dist/components/skeletons.d.ts +28 -0
- package/dist/components/skeletons.js +60 -0
- package/dist/components/stages.d.ts +97 -0
- package/dist/components/stages.js +365 -0
- package/dist/components/stat-card.d.ts +34 -0
- package/dist/components/stat-card.js +117 -0
- package/dist/components/status-banner.d.ts +17 -0
- package/dist/components/status-banner.js +132 -0
- package/dist/components/status.d.ts +32 -0
- package/dist/components/status.js +93 -0
- package/dist/components/steps.d.ts +17 -0
- package/dist/components/steps.js +51 -0
- package/dist/components/switch.d.ts +6 -0
- package/dist/components/switch.js +39 -0
- package/dist/components/tabs.d.ts +48 -0
- package/dist/components/tabs.js +247 -0
- package/dist/components/theme-customizer.d.ts +53 -0
- package/dist/components/theme-customizer.js +116 -0
- package/dist/components/toast.d.ts +23 -0
- package/dist/components/toast.js +140 -0
- package/dist/components/user-chip.d.ts +66 -0
- package/dist/components/user-chip.js +174 -0
- package/dist/components/wizard.d.ts +33 -0
- package/dist/components/wizard.js +91 -0
- package/dist/feedback/client.d.ts +37 -0
- package/dist/feedback/client.js +125 -0
- package/dist/feedback/comment-types.d.ts +17 -0
- package/dist/feedback/contract.d.ts +252 -0
- package/dist/feedback/contract.js +32 -0
- package/dist/feedback/feedback-cache.d.ts +6 -0
- package/dist/feedback/feedback-cache.js +58 -0
- package/dist/feedback/feedback-center-model.d.ts +8 -0
- package/dist/feedback/feedback-center-model.js +37 -0
- package/dist/feedback/feedback-composer-types.d.ts +11 -0
- package/dist/feedback/feedback-controller.d.ts +56 -0
- package/dist/feedback/feedback-controller.js +181 -0
- package/dist/feedback/feedback-tracking-types.d.ts +14 -0
- package/dist/feedback/generated/index.d.ts +1 -0
- package/dist/feedback/generated/index.js +2 -0
- package/dist/feedback/generated/types.gen.d.ts +737 -0
- package/dist/feedback/generated/types.gen.js +2 -0
- package/dist/feedback/generated/zod.gen.d.ts +738 -0
- package/dist/feedback/generated/zod.gen.js +293 -0
- package/dist/feedback/get-response-error-id.d.ts +1 -0
- package/dist/feedback/get-response-error-id.js +7 -0
- package/dist/feedback/operator-client.d.ts +21 -0
- package/dist/feedback/operator-client.js +96 -0
- package/dist/feedback/operator-contract.d.ts +111 -0
- package/dist/feedback/operator-contract.js +22 -0
- package/dist/feedback/operator-controller.d.ts +80 -0
- package/dist/feedback/operator-controller.js +43 -0
- package/dist/feedback/require-config.d.ts +2 -0
- package/dist/feedback/require-config.js +7 -0
- package/dist/feedback/submit-feedback-with-attachments.d.ts +10 -0
- package/dist/feedback/submit-feedback-with-attachments.js +10 -0
- package/dist/format/compact-number.d.ts +2 -0
- package/dist/format/compact-number.js +8 -0
- package/dist/format/money.d.ts +13 -0
- package/dist/format/money.js +21 -0
- package/dist/format/usd.d.ts +2 -0
- package/dist/format/usd.js +16 -0
- package/dist/preset.d.ts +18 -0
- package/dist/preset.js +470 -0
- package/dist/styled-system/css/conditions.mjs +1 -1
- package/dist/styled-system/css/css.mjs +3 -3
- package/dist/styled-system/patterns/box.d.ts +1 -1
- package/dist/styled-system/patterns/container.d.ts +1 -1
- package/dist/styled-system/patterns/link-overlay.d.ts +1 -1
- package/dist/styled-system/patterns/visually-hidden.d.ts +1 -1
- package/dist/styled-system/styles.css +7834 -458
- package/dist/styled-system/tokens/index.mjs +1465 -677
- package/dist/styled-system/tokens/tokens.d.ts +32 -26
- package/dist/styled-system/types/conditions.d.ts +11 -1
- package/dist/styled-system/types/prop-type.d.ts +12 -23
- package/dist/styled-system/types/style-props.d.ts +25 -24
- package/dist/styles.css +60 -479
- package/dist/theme/breakpoints.d.ts +15 -0
- package/dist/theme/breakpoints.js +12 -0
- package/dist/theme/color.d.ts +2 -0
- package/dist/theme/color.js +27 -0
- package/dist/theme/derive.d.ts +5 -0
- package/dist/theme/derive.js +43 -0
- package/dist/theme/index.d.ts +4 -0
- package/dist/theme/index.js +9 -0
- package/dist/theme/options.d.ts +32 -0
- package/dist/theme/options.js +9 -0
- package/dist/theme/palettes.d.ts +60 -0
- package/dist/theme/palettes.js +185 -0
- package/dist/theme/tokens.d.ts +29 -0
- package/dist/theme/tokens.js +188 -0
- package/package.json +475 -68
- package/dist/assets/ciridae/brand-background-dark.webp +0 -0
- package/dist/assets/ciridae/brand-background-light.webp +0 -0
- package/dist/assets/ciridae/ciridae-black.svg +0 -17
- package/dist/assets/ciridae/ciridae-brand-assets.d.ts +0 -25
- package/dist/assets/ciridae/ciridae-brand-assets.js +0 -25
- package/dist/assets/ciridae/ciridae-icon-black.png +0 -0
- package/dist/assets/ciridae/ciridae-icon-white.png +0 -0
- package/dist/assets/ciridae/ciridae-ui-wordmark-black.png +0 -0
- package/dist/assets/ciridae/ciridae-ui-wordmark-white.png +0 -0
- package/dist/assets/ciridae/ciridae-white.svg +0 -17
- package/dist/assets/ciridae/ciridae-wordmark-black.png +0 -0
- package/dist/assets/ciridae/ciridae-wordmark-white.png +0 -0
- package/dist/assets/ciridae/favicon.ico +0 -0
- package/dist/assets/ciridae/logo-white.png +0 -0
- package/dist/assets/ciridae/sign-in-screenshot.png +0 -0
- package/dist/components/blocks/admin-users-table.d.ts +0 -22
- package/dist/components/blocks/admin-users-table.js +0 -115
- package/dist/components/blocks/comment-composer.d.ts +0 -18
- package/dist/components/blocks/comment-composer.js +0 -137
- package/dist/components/blocks/comment-item.d.ts +0 -8
- package/dist/components/blocks/comment-item.js +0 -45
- package/dist/components/blocks/comment-thread.d.ts +0 -19
- package/dist/components/blocks/comment-thread.js +0 -37
- package/dist/components/blocks/comment-types.d.ts +0 -18
- package/dist/components/blocks/comment-types.js +0 -11
- package/dist/components/blocks/copy-field.d.ts +0 -18
- package/dist/components/blocks/copy-field.js +0 -61
- package/dist/components/blocks/feedback-center-comments.d.ts +0 -16
- package/dist/components/blocks/feedback-center-comments.js +0 -61
- package/dist/components/blocks/feedback-center-footer.d.ts +0 -12
- package/dist/components/blocks/feedback-center-footer.js +0 -10
- package/dist/components/blocks/feedback-center-sheet-parts.d.ts +0 -40
- package/dist/components/blocks/feedback-center-sheet-parts.js +0 -39
- package/dist/components/blocks/feedback-center-sheet.d.ts +0 -28
- package/dist/components/blocks/feedback-center-sheet.js +0 -105
- package/dist/components/blocks/feedback-composer-parts.d.ts +0 -16
- package/dist/components/blocks/feedback-composer-parts.js +0 -43
- package/dist/components/blocks/feedback-composer-types.d.ts +0 -12
- package/dist/components/blocks/feedback-composer.d.ts +0 -23
- package/dist/components/blocks/feedback-composer.js +0 -82
- package/dist/components/blocks/feedback-date-format.d.ts +0 -5
- package/dist/components/blocks/feedback-date-format.js +0 -11
- package/dist/components/blocks/feedback-detail-sheet.d.ts +0 -15
- package/dist/components/blocks/feedback-detail-sheet.js +0 -59
- package/dist/components/blocks/feedback-emergency-fields.d.ts +0 -17
- package/dist/components/blocks/feedback-emergency-fields.js +0 -32
- package/dist/components/blocks/feedback-metrics.d.ts +0 -6
- package/dist/components/blocks/feedback-metrics.js +0 -15
- package/dist/components/blocks/feedback-sheet.d.ts +0 -8
- package/dist/components/blocks/feedback-sheet.js +0 -29
- package/dist/components/blocks/feedback-status-badge.d.ts +0 -6
- package/dist/components/blocks/feedback-status-badge.js +0 -15
- package/dist/components/blocks/feedback-table-row.d.ts +0 -6
- package/dist/components/blocks/feedback-table-row.js +0 -27
- package/dist/components/blocks/feedback-table-sort.d.ts +0 -11
- package/dist/components/blocks/feedback-table-sort.js +0 -82
- package/dist/components/blocks/feedback-table.d.ts +0 -16
- package/dist/components/blocks/feedback-table.js +0 -45
- package/dist/components/blocks/feedback-tracking-types.d.ts +0 -102
- package/dist/components/blocks/feedback-tracking-types.js +0 -54
- package/dist/components/blocks/feedback-triage-timeline.d.ts +0 -11
- package/dist/components/blocks/feedback-triage-timeline.js +0 -17
- package/dist/components/blocks/feedback-type-badge.d.ts +0 -11
- package/dist/components/blocks/feedback-type-badge.js +0 -18
- package/dist/components/blocks/feedback-unread-badge.d.ts +0 -6
- package/dist/components/blocks/feedback-unread-badge.js +0 -9
- package/dist/components/blocks/feedback-user-detail.d.ts +0 -11
- package/dist/components/blocks/feedback-user-detail.js +0 -63
- package/dist/components/blocks/feedback-user-list.d.ts +0 -11
- package/dist/components/blocks/feedback-user-list.js +0 -41
- package/dist/components/blocks/generated-connect-link.d.ts +0 -22
- package/dist/components/blocks/generated-connect-link.js +0 -68
- package/dist/components/blocks/invite-user-sheet.d.ts +0 -20
- package/dist/components/blocks/invite-user-sheet.js +0 -72
- package/dist/components/blocks/kanban-board-parts.d.ts +0 -26
- package/dist/components/blocks/kanban-board-parts.js +0 -83
- package/dist/components/blocks/kanban-board-utils.d.ts +0 -58
- package/dist/components/blocks/kanban-board-utils.js +0 -140
- package/dist/components/blocks/kanban-board.d.ts +0 -16
- package/dist/components/blocks/kanban-board.js +0 -35
- package/dist/components/blocks/kanban-card.d.ts +0 -10
- package/dist/components/blocks/kanban-card.js +0 -34
- package/dist/components/blocks/kanban-column.d.ts +0 -17
- package/dist/components/blocks/kanban-column.js +0 -34
- package/dist/components/blocks/kanban-detail-sheet.d.ts +0 -17
- package/dist/components/blocks/kanban-detail-sheet.js +0 -34
- package/dist/components/blocks/kanban-types.d.ts +0 -24
- package/dist/components/blocks/mcp-access-grouped-tool-picker.d.ts +0 -19
- package/dist/components/blocks/mcp-access-grouped-tool-picker.js +0 -116
- package/dist/components/blocks/mcp-access-tool-picker-internals.d.ts +0 -35
- package/dist/components/blocks/mcp-access-tool-picker-internals.js +0 -24
- package/dist/components/blocks/mcp-access-tool-picker.d.ts +0 -22
- package/dist/components/blocks/mcp-access-tool-picker.js +0 -33
- package/dist/components/blocks/mcp-access-types.d.ts +0 -42
- package/dist/components/blocks/mcp-access-types.js +0 -7
- package/dist/components/blocks/mcp-client-setup.d.ts +0 -29
- package/dist/components/blocks/mcp-client-setup.js +0 -58
- package/dist/components/blocks/mcp-connect-clients.d.ts +0 -43
- package/dist/components/blocks/mcp-connect-clients.js +0 -66
- package/dist/components/blocks/mcp-plan-choice.d.ts +0 -17
- package/dist/components/blocks/mcp-plan-choice.js +0 -28
- package/dist/components/blocks/submit-feedback-composer.d.ts +0 -5
- package/dist/components/blocks/submit-feedback-composer.js +0 -40
- package/dist/components/blocks/timestamp-format.d.ts +0 -14
- package/dist/components/blocks/timestamp-format.js +0 -72
- package/dist/components/blocks/use-feedback-composer-state.d.ts +0 -27
- package/dist/components/blocks/use-feedback-composer-state.js +0 -60
- package/dist/components/blocks/use-reveal-thread-end.d.ts +0 -11
- package/dist/components/blocks/use-reveal-thread-end.js +0 -25
- package/dist/components/pages/admin-users-page.d.ts +0 -11
- package/dist/components/pages/admin-users-page.js +0 -30
- package/dist/components/pages/feedback-stakeholder-page-parts.d.ts +0 -18
- package/dist/components/pages/feedback-stakeholder-page-parts.js +0 -36
- package/dist/components/pages/feedback-stakeholder-page.d.ts +0 -9
- package/dist/components/pages/feedback-stakeholder-page.js +0 -66
- package/dist/components/pages/kanban-page.d.ts +0 -13
- package/dist/components/pages/kanban-page.js +0 -68
- package/dist/components/ui/accordion.d.ts +0 -7
- package/dist/components/ui/accordion.js +0 -17
- package/dist/components/ui/alert-dialog.d.ts +0 -22
- package/dist/components/ui/alert-dialog.js +0 -51
- package/dist/components/ui/alert.d.ts +0 -9
- package/dist/components/ui/alert.js +0 -24
- package/dist/components/ui/app-shell-page.d.ts +0 -22
- package/dist/components/ui/app-shell-page.js +0 -21
- package/dist/components/ui/app-shell.d.ts +0 -45
- package/dist/components/ui/app-shell.js +0 -44
- package/dist/components/ui/aspect-ratio.d.ts +0 -3
- package/dist/components/ui/aspect-ratio.js +0 -7
- package/dist/components/ui/avatar.d.ts +0 -11
- package/dist/components/ui/avatar.js +0 -22
- package/dist/components/ui/badge-variants.d.ts +0 -100
- package/dist/components/ui/badge-variants.js +0 -140
- package/dist/components/ui/badge.d.ts +0 -6
- package/dist/components/ui/badge.js +0 -9
- package/dist/components/ui/breadcrumb.d.ts +0 -11
- package/dist/components/ui/breadcrumb.js +0 -27
- package/dist/components/ui/button-group-variants.d.ts +0 -6
- package/dist/components/ui/button-group-variants.js +0 -13
- package/dist/components/ui/button-group.d.ts +0 -8
- package/dist/components/ui/button-group.js +0 -16
- package/dist/components/ui/button-variants.d.ts +0 -133
- package/dist/components/ui/button-variants.js +0 -170
- package/dist/components/ui/button.d.ts +0 -8
- package/dist/components/ui/button.js +0 -59
- package/dist/components/ui/calendar.d.ts +0 -10
- package/dist/components/ui/calendar.js +0 -99
- package/dist/components/ui/card.d.ts +0 -14
- package/dist/components/ui/card.js +0 -28
- package/dist/components/ui/carousel.d.ts +0 -19
- package/dist/components/ui/carousel.js +0 -104
- package/dist/components/ui/chart-context.d.ts +0 -33
- package/dist/components/ui/chart-context.js +0 -36
- package/dist/components/ui/chart-panel.d.ts +0 -11
- package/dist/components/ui/chart-panel.js +0 -6
- package/dist/components/ui/chart-tooltip.d.ts +0 -13
- package/dist/components/ui/chart-tooltip.js +0 -84
- package/dist/components/ui/chart.d.ts +0 -23
- package/dist/components/ui/chart.js +0 -52
- package/dist/components/ui/checkbox.d.ts +0 -4
- package/dist/components/ui/checkbox.js +0 -9
- package/dist/components/ui/ciridae-ui-provider.d.ts +0 -8
- package/dist/components/ui/ciridae-ui-provider.js +0 -14
- package/dist/components/ui/collapsible.d.ts +0 -5
- package/dist/components/ui/collapsible.js +0 -12
- package/dist/components/ui/color-theme-context.d.ts +0 -28
- package/dist/components/ui/color-theme-context.js +0 -3
- package/dist/components/ui/color-theme.d.ts +0 -5
- package/dist/components/ui/color-theme.js +0 -147
- package/dist/components/ui/combobox-anchor.d.ts +0 -3
- package/dist/components/ui/combobox-anchor.js +0 -5
- package/dist/components/ui/combobox.d.ts +0 -24
- package/dist/components/ui/combobox.js +0 -54
- package/dist/components/ui/command.d.ts +0 -19
- package/dist/components/ui/command.js +0 -38
- package/dist/components/ui/context-menu.d.ts +0 -30
- package/dist/components/ui/context-menu.js +0 -63
- package/dist/components/ui/data-table-column-settings.d.ts +0 -23
- package/dist/components/ui/data-table-column-settings.js +0 -170
- package/dist/components/ui/data-table-context.d.ts +0 -8
- package/dist/components/ui/data-table-context.js +0 -53
- package/dist/components/ui/data-table-controls.d.ts +0 -9
- package/dist/components/ui/data-table-controls.js +0 -30
- package/dist/components/ui/data-table-facet-filter.d.ts +0 -39
- package/dist/components/ui/data-table-facet-filter.js +0 -65
- package/dist/components/ui/data-table-grid.d.ts +0 -10
- package/dist/components/ui/data-table-grid.js +0 -34
- package/dist/components/ui/data-table-pagination.d.ts +0 -17
- package/dist/components/ui/data-table-pagination.js +0 -89
- package/dist/components/ui/data-table-search-input.d.ts +0 -14
- package/dist/components/ui/data-table-search-input.js +0 -15
- package/dist/components/ui/data-table-state.d.ts +0 -19
- package/dist/components/ui/data-table-state.js +0 -8
- package/dist/components/ui/data-table-tanstack.d.ts +0 -99
- package/dist/components/ui/data-table-tanstack.js +0 -128
- package/dist/components/ui/data-table.d.ts +0 -19
- package/dist/components/ui/data-table.js +0 -35
- package/dist/components/ui/dialog.d.ts +0 -23
- package/dist/components/ui/dialog.js +0 -48
- package/dist/components/ui/direction-context.d.ts +0 -3
- package/dist/components/ui/direction-context.js +0 -3
- package/dist/components/ui/direction.d.ts +0 -6
- package/dist/components/ui/direction.js +0 -7
- package/dist/components/ui/drawer.d.ts +0 -18
- package/dist/components/ui/drawer.js +0 -47
- package/dist/components/ui/dropdown-menu.d.ts +0 -30
- package/dist/components/ui/dropdown-menu.js +0 -63
- package/dist/components/ui/empty.d.ts +0 -11
- package/dist/components/ui/empty.js +0 -33
- package/dist/components/ui/expandable-data-table.d.ts +0 -24
- package/dist/components/ui/expandable-data-table.js +0 -62
- package/dist/components/ui/field.d.ts +0 -26
- package/dist/components/ui/field.js +0 -74
- package/dist/components/ui/file-upload-field-parts.d.ts +0 -21
- package/dist/components/ui/file-upload-field-parts.js +0 -55
- package/dist/components/ui/file-upload-field.d.ts +0 -16
- package/dist/components/ui/file-upload-field.js +0 -85
- package/dist/components/ui/form-context.d.ts +0 -23
- package/dist/components/ui/form-context.js +0 -35
- package/dist/components/ui/form-sheet.d.ts +0 -22
- package/dist/components/ui/form-sheet.js +0 -74
- package/dist/components/ui/form.d.ts +0 -12
- package/dist/components/ui/form.js +0 -38
- package/dist/components/ui/hover-card.d.ts +0 -10
- package/dist/components/ui/hover-card.js +0 -22
- package/dist/components/ui/input-group.d.ts +0 -16
- package/dist/components/ui/input-group.js +0 -62
- package/dist/components/ui/input-otp.d.ts +0 -11
- package/dist/components/ui/input-otp.js +0 -21
- package/dist/components/ui/input.d.ts +0 -3
- package/dist/components/ui/input.js +0 -6
- package/dist/components/ui/item.d.ts +0 -24
- package/dist/components/ui/item.js +0 -73
- package/dist/components/ui/kbd.d.ts +0 -3
- package/dist/components/ui/kbd.js +0 -9
- package/dist/components/ui/label.d.ts +0 -4
- package/dist/components/ui/label.js +0 -7
- package/dist/components/ui/loading-state.d.ts +0 -27
- package/dist/components/ui/loading-state.js +0 -44
- package/dist/components/ui/menubar.d.ts +0 -30
- package/dist/components/ui/menubar.js +0 -63
- package/dist/components/ui/metrics-strip.d.ts +0 -7
- package/dist/components/ui/metrics-strip.js +0 -18
- package/dist/components/ui/native-select.d.ts +0 -7
- package/dist/components/ui/native-select.js +0 -13
- package/dist/components/ui/navigation-menu-variants.d.ts +0 -2
- package/dist/components/ui/navigation-menu-variants.js +0 -3
- package/dist/components/ui/navigation-menu.d.ts +0 -13
- package/dist/components/ui/navigation-menu.js +0 -30
- package/dist/components/ui/page-header.d.ts +0 -33
- package/dist/components/ui/page-header.js +0 -54
- package/dist/components/ui/pagination.d.ts +0 -13
- package/dist/components/ui/pagination.js +0 -29
- package/dist/components/ui/popover.d.ts +0 -14
- package/dist/components/ui/popover.js +0 -34
- package/dist/components/ui/progress.d.ts +0 -4
- package/dist/components/ui/progress.js +0 -8
- package/dist/components/ui/property-list.d.ts +0 -6
- package/dist/components/ui/property-list.js +0 -15
- package/dist/components/ui/radio-group.d.ts +0 -5
- package/dist/components/ui/radio-group.js +0 -11
- package/dist/components/ui/registry-docs-api.d.ts +0 -11
- package/dist/components/ui/registry-docs-api.js +0 -9
- package/dist/components/ui/registry-docs-code.d.ts +0 -19
- package/dist/components/ui/registry-docs-code.js +0 -78
- package/dist/components/ui/registry-docs-showcase.d.ts +0 -11
- package/dist/components/ui/registry-docs-showcase.js +0 -27
- package/dist/components/ui/registry-docs.d.ts +0 -27
- package/dist/components/ui/registry-docs.js +0 -32
- package/dist/components/ui/resizable.d.ts +0 -14
- package/dist/components/ui/resizable.js +0 -15
- package/dist/components/ui/scroll-area.d.ts +0 -7
- package/dist/components/ui/scroll-area.js +0 -10
- package/dist/components/ui/select.d.ts +0 -15
- package/dist/components/ui/select.js +0 -38
- package/dist/components/ui/separator.d.ts +0 -4
- package/dist/components/ui/separator.js +0 -7
- package/dist/components/ui/sheet.d.ts +0 -21
- package/dist/components/ui/sheet.js +0 -62
- package/dist/components/ui/sidebar/context.d.ts +0 -27
- package/dist/components/ui/sidebar/context.js +0 -23
- package/dist/components/ui/sidebar/group.d.ts +0 -10
- package/dist/components/ui/sidebar/group.js +0 -18
- package/dist/components/ui/sidebar/layout.d.ts +0 -17
- package/dist/components/ui/sidebar/layout.js +0 -78
- package/dist/components/ui/sidebar/menu.d.ts +0 -30
- package/dist/components/ui/sidebar/menu.js +0 -64
- package/dist/components/ui/sidebar/provider.d.ts +0 -7
- package/dist/components/ui/sidebar/provider.js +0 -53
- package/dist/components/ui/sidebar/rail.d.ts +0 -3
- package/dist/components/ui/sidebar/rail.js +0 -12
- package/dist/components/ui/sidebar/trigger.d.ts +0 -4
- package/dist/components/ui/sidebar/trigger.js +0 -16
- package/dist/components/ui/sidebar-account-menu-theme.d.ts +0 -7
- package/dist/components/ui/sidebar-account-menu-theme.js +0 -32
- package/dist/components/ui/sidebar-account-menu.d.ts +0 -16
- package/dist/components/ui/sidebar-account-menu.js +0 -51
- package/dist/components/ui/sidebar.d.ts +0 -7
- package/dist/components/ui/sidebar.js +0 -7
- package/dist/components/ui/skeleton.d.ts +0 -2
- package/dist/components/ui/skeleton.js +0 -15
- package/dist/components/ui/slider.d.ts +0 -4
- package/dist/components/ui/slider.js +0 -9
- package/dist/components/ui/sonner.d.ts +0 -3
- package/dist/components/ui/sonner.js +0 -33
- package/dist/components/ui/spinner.d.ts +0 -2
- package/dist/components/ui/spinner.js +0 -16
- package/dist/components/ui/switch.d.ts +0 -6
- package/dist/components/ui/switch.js +0 -7
- package/dist/components/ui/table.d.ts +0 -21
- package/dist/components/ui/table.js +0 -34
- package/dist/components/ui/tabs-variants.d.ts +0 -6
- package/dist/components/ui/tabs-variants.js +0 -13
- package/dist/components/ui/tabs.d.ts +0 -8
- package/dist/components/ui/tabs.js +0 -17
- package/dist/components/ui/textarea.d.ts +0 -3
- package/dist/components/ui/textarea.js +0 -6
- package/dist/components/ui/toggle-group.d.ts +0 -9
- package/dist/components/ui/toggle-group.js +0 -24
- package/dist/components/ui/toggle-variants.d.ts +0 -7
- package/dist/components/ui/toggle-variants.js +0 -19
- package/dist/components/ui/toggle.d.ts +0 -5
- package/dist/components/ui/toggle.js +0 -9
- package/dist/components/ui/tooltip.d.ts +0 -14
- package/dist/components/ui/tooltip.js +0 -25
- package/dist/components/ui/use-color-theme.d.ts +0 -2
- package/dist/components/ui/use-color-theme.js +0 -10
- package/dist/components/ui/workflow-timeline.d.ts +0 -20
- package/dist/components/ui/workflow-timeline.js +0 -92
- package/dist/components/walkthrough/presentation/WalkthroughCoach.d.ts +0 -14
- package/dist/components/walkthrough/presentation/WalkthroughCoach.js +0 -32
- package/dist/components/walkthrough/presentation/WalkthroughHighlight.d.ts +0 -5
- package/dist/components/walkthrough/presentation/WalkthroughHighlight.js +0 -9
- package/dist/components/walkthrough/presentation/WalkthroughOverlay.d.ts +0 -1
- package/dist/components/walkthrough/presentation/WalkthroughOverlay.js +0 -70
- package/dist/components/walkthrough/presentation/positionWalkthroughCoach.d.ts +0 -11
- package/dist/components/walkthrough/presentation/positionWalkthroughCoach.js +0 -24
- package/dist/components/walkthrough/presentation/useWalkthroughCoachPosition.d.ts +0 -4
- package/dist/components/walkthrough/presentation/useWalkthroughCoachPosition.js +0 -17
- package/dist/components/walkthrough/runtime/WalkthroughContextDefinition.d.ts +0 -20
- package/dist/components/walkthrough/runtime/WalkthroughContextDefinition.js +0 -2
- package/dist/components/walkthrough/runtime/WalkthroughProvider.d.ts +0 -12
- package/dist/components/walkthrough/runtime/WalkthroughProvider.js +0 -190
- package/dist/components/walkthrough/runtime/useWalkthrough.d.ts +0 -1
- package/dist/components/walkthrough/runtime/useWalkthrough.js +0 -8
- package/dist/components/walkthrough/runtime/walkthroughEvents.d.ts +0 -3
- package/dist/components/walkthrough/runtime/walkthroughEvents.js +0 -55
- package/dist/components/walkthrough/runtime/walkthroughLocation.d.ts +0 -2
- package/dist/components/walkthrough/runtime/walkthroughLocation.js +0 -27
- package/dist/components/walkthrough/runtime/walkthroughStorage.d.ts +0 -3
- package/dist/components/walkthrough/runtime/walkthroughStorage.js +0 -54
- package/dist/components/walkthrough/runtime/walkthroughTypes.d.ts +0 -32
- package/dist/components/walkthrough/targeting/listenForOutsideWalkthroughInteraction.d.ts +0 -2
- package/dist/components/walkthrough/targeting/listenForOutsideWalkthroughInteraction.js +0 -19
- package/dist/components/walkthrough/targeting/useWalkthroughTargetRect.d.ts +0 -15
- package/dist/components/walkthrough/targeting/useWalkthroughTargetRect.js +0 -54
- package/dist/components/walkthrough/targeting/walkthroughTarget.d.ts +0 -6
- package/dist/components/walkthrough/targeting/walkthroughTarget.js +0 -24
- package/dist/components/walkthrough.d.ts +0 -4
- package/dist/components/walkthrough.js +0 -2
- package/dist/entries/accordion.d.ts +0 -1
- package/dist/entries/accordion.js +0 -1
- package/dist/entries/admin-users-page.d.ts +0 -1
- package/dist/entries/admin-users-page.js +0 -1
- package/dist/entries/admin-users-table.d.ts +0 -1
- package/dist/entries/admin-users-table.js +0 -1
- package/dist/entries/alert-dialog.d.ts +0 -1
- package/dist/entries/alert-dialog.js +0 -1
- package/dist/entries/alert.d.ts +0 -1
- package/dist/entries/alert.js +0 -1
- package/dist/entries/app-shell-page.d.ts +0 -1
- package/dist/entries/app-shell-page.js +0 -1
- package/dist/entries/app-shell.d.ts +0 -1
- package/dist/entries/app-shell.js +0 -1
- package/dist/entries/aspect-ratio.d.ts +0 -1
- package/dist/entries/aspect-ratio.js +0 -1
- package/dist/entries/avatar.d.ts +0 -1
- package/dist/entries/avatar.js +0 -1
- package/dist/entries/badge-variants.d.ts +0 -1
- package/dist/entries/badge-variants.js +0 -1
- package/dist/entries/badge.d.ts +0 -1
- package/dist/entries/badge.js +0 -1
- package/dist/entries/breadcrumb.d.ts +0 -1
- package/dist/entries/breadcrumb.js +0 -1
- package/dist/entries/button-group-variants.d.ts +0 -1
- package/dist/entries/button-group-variants.js +0 -1
- package/dist/entries/button-group.d.ts +0 -1
- package/dist/entries/button-group.js +0 -1
- package/dist/entries/button-variants.d.ts +0 -1
- package/dist/entries/button-variants.js +0 -1
- package/dist/entries/button.d.ts +0 -1
- package/dist/entries/button.js +0 -1
- package/dist/entries/calendar.d.ts +0 -1
- package/dist/entries/calendar.js +0 -1
- package/dist/entries/card.d.ts +0 -1
- package/dist/entries/card.js +0 -1
- package/dist/entries/carousel.d.ts +0 -1
- package/dist/entries/carousel.js +0 -1
- package/dist/entries/chart-context.d.ts +0 -1
- package/dist/entries/chart-context.js +0 -1
- package/dist/entries/chart-panel.d.ts +0 -1
- package/dist/entries/chart-panel.js +0 -1
- package/dist/entries/chart-tooltip.d.ts +0 -1
- package/dist/entries/chart-tooltip.js +0 -1
- package/dist/entries/chart.d.ts +0 -1
- package/dist/entries/chart.js +0 -1
- package/dist/entries/checkbox.d.ts +0 -1
- package/dist/entries/checkbox.js +0 -1
- package/dist/entries/ciridae-brand-assets.d.ts +0 -1
- package/dist/entries/ciridae-brand-assets.js +0 -1
- package/dist/entries/ciridae-ui-provider.d.ts +0 -1
- package/dist/entries/ciridae-ui-provider.js +0 -1
- package/dist/entries/collapsible.d.ts +0 -1
- package/dist/entries/collapsible.js +0 -1
- package/dist/entries/color-theme-context.d.ts +0 -1
- package/dist/entries/color-theme-context.js +0 -1
- package/dist/entries/color-theme.d.ts +0 -1
- package/dist/entries/color-theme.js +0 -1
- package/dist/entries/combobox-anchor.d.ts +0 -1
- package/dist/entries/combobox-anchor.js +0 -1
- package/dist/entries/combobox.d.ts +0 -1
- package/dist/entries/combobox.js +0 -1
- package/dist/entries/command.d.ts +0 -1
- package/dist/entries/command.js +0 -1
- package/dist/entries/comment-composer.d.ts +0 -1
- package/dist/entries/comment-composer.js +0 -1
- package/dist/entries/comment-item.d.ts +0 -1
- package/dist/entries/comment-item.js +0 -1
- package/dist/entries/comment-thread.d.ts +0 -1
- package/dist/entries/comment-thread.js +0 -1
- package/dist/entries/comment-types.d.ts +0 -1
- package/dist/entries/comment-types.js +0 -1
- package/dist/entries/context-menu.d.ts +0 -1
- package/dist/entries/context-menu.js +0 -1
- package/dist/entries/copy-field.d.ts +0 -1
- package/dist/entries/copy-field.js +0 -1
- package/dist/entries/data-table-column-settings.d.ts +0 -1
- package/dist/entries/data-table-column-settings.js +0 -1
- package/dist/entries/data-table-context.d.ts +0 -1
- package/dist/entries/data-table-context.js +0 -1
- package/dist/entries/data-table-controls.d.ts +0 -1
- package/dist/entries/data-table-controls.js +0 -1
- package/dist/entries/data-table-facet-filter.d.ts +0 -1
- package/dist/entries/data-table-facet-filter.js +0 -1
- package/dist/entries/data-table-grid.d.ts +0 -1
- package/dist/entries/data-table-grid.js +0 -1
- package/dist/entries/data-table-pagination.d.ts +0 -1
- package/dist/entries/data-table-pagination.js +0 -1
- package/dist/entries/data-table-search-input.d.ts +0 -1
- package/dist/entries/data-table-search-input.js +0 -1
- package/dist/entries/data-table-state.d.ts +0 -1
- package/dist/entries/data-table-state.js +0 -1
- package/dist/entries/data-table-tanstack.d.ts +0 -1
- package/dist/entries/data-table-tanstack.js +0 -1
- package/dist/entries/data-table.d.ts +0 -1
- package/dist/entries/data-table.js +0 -1
- package/dist/entries/dialog.d.ts +0 -1
- package/dist/entries/dialog.js +0 -1
- package/dist/entries/direction-context.d.ts +0 -1
- package/dist/entries/direction-context.js +0 -1
- package/dist/entries/direction.d.ts +0 -1
- package/dist/entries/direction.js +0 -1
- package/dist/entries/drawer.d.ts +0 -1
- package/dist/entries/drawer.js +0 -1
- package/dist/entries/dropdown-menu.d.ts +0 -1
- package/dist/entries/dropdown-menu.js +0 -1
- package/dist/entries/empty.d.ts +0 -1
- package/dist/entries/empty.js +0 -1
- package/dist/entries/expandable-data-table.d.ts +0 -1
- package/dist/entries/expandable-data-table.js +0 -1
- package/dist/entries/feedback-center-comments.d.ts +0 -1
- package/dist/entries/feedback-center-comments.js +0 -1
- package/dist/entries/feedback-center-footer.d.ts +0 -1
- package/dist/entries/feedback-center-footer.js +0 -1
- package/dist/entries/feedback-center-sheet-parts.d.ts +0 -1
- package/dist/entries/feedback-center-sheet-parts.js +0 -1
- package/dist/entries/feedback-center-sheet.d.ts +0 -1
- package/dist/entries/feedback-center-sheet.js +0 -1
- package/dist/entries/feedback-composer-parts.d.ts +0 -1
- package/dist/entries/feedback-composer-parts.js +0 -1
- package/dist/entries/feedback-composer-types.d.ts +0 -1
- package/dist/entries/feedback-composer-types.js +0 -1
- package/dist/entries/feedback-composer.d.ts +0 -1
- package/dist/entries/feedback-composer.js +0 -1
- package/dist/entries/feedback-date-format.d.ts +0 -1
- package/dist/entries/feedback-date-format.js +0 -1
- package/dist/entries/feedback-detail-sheet.d.ts +0 -1
- package/dist/entries/feedback-detail-sheet.js +0 -1
- package/dist/entries/feedback-emergency-fields.d.ts +0 -1
- package/dist/entries/feedback-emergency-fields.js +0 -1
- package/dist/entries/feedback-metrics.d.ts +0 -1
- package/dist/entries/feedback-metrics.js +0 -1
- package/dist/entries/feedback-sheet.d.ts +0 -1
- package/dist/entries/feedback-sheet.js +0 -1
- package/dist/entries/feedback-stakeholder-page-parts.d.ts +0 -1
- package/dist/entries/feedback-stakeholder-page-parts.js +0 -1
- package/dist/entries/feedback-stakeholder-page.d.ts +0 -1
- package/dist/entries/feedback-stakeholder-page.js +0 -1
- package/dist/entries/feedback-status-badge.d.ts +0 -1
- package/dist/entries/feedback-status-badge.js +0 -1
- package/dist/entries/feedback-table-row.d.ts +0 -1
- package/dist/entries/feedback-table-row.js +0 -1
- package/dist/entries/feedback-table-sort.d.ts +0 -1
- package/dist/entries/feedback-table-sort.js +0 -1
- package/dist/entries/feedback-table.d.ts +0 -1
- package/dist/entries/feedback-table.js +0 -1
- package/dist/entries/feedback-tracking-types.d.ts +0 -1
- package/dist/entries/feedback-tracking-types.js +0 -1
- package/dist/entries/feedback-triage-timeline.d.ts +0 -1
- package/dist/entries/feedback-triage-timeline.js +0 -1
- package/dist/entries/feedback-type-badge.d.ts +0 -1
- package/dist/entries/feedback-type-badge.js +0 -1
- package/dist/entries/feedback-unread-badge.d.ts +0 -1
- package/dist/entries/feedback-unread-badge.js +0 -1
- package/dist/entries/feedback-user-detail.d.ts +0 -1
- package/dist/entries/feedback-user-detail.js +0 -1
- package/dist/entries/feedback-user-list.d.ts +0 -1
- package/dist/entries/feedback-user-list.js +0 -1
- package/dist/entries/field.d.ts +0 -1
- package/dist/entries/field.js +0 -1
- package/dist/entries/file-upload-field-parts.d.ts +0 -1
- package/dist/entries/file-upload-field-parts.js +0 -1
- package/dist/entries/file-upload-field.d.ts +0 -1
- package/dist/entries/file-upload-field.js +0 -1
- package/dist/entries/form-context.d.ts +0 -1
- package/dist/entries/form-context.js +0 -1
- package/dist/entries/form-sheet.d.ts +0 -1
- package/dist/entries/form-sheet.js +0 -1
- package/dist/entries/form.d.ts +0 -1
- package/dist/entries/form.js +0 -1
- package/dist/entries/generated-connect-link.d.ts +0 -1
- package/dist/entries/generated-connect-link.js +0 -1
- package/dist/entries/hover-card.d.ts +0 -1
- package/dist/entries/hover-card.js +0 -1
- package/dist/entries/input-group.d.ts +0 -1
- package/dist/entries/input-group.js +0 -1
- package/dist/entries/input-otp.d.ts +0 -1
- package/dist/entries/input-otp.js +0 -1
- package/dist/entries/input.d.ts +0 -1
- package/dist/entries/input.js +0 -1
- package/dist/entries/invite-user-sheet.d.ts +0 -1
- package/dist/entries/invite-user-sheet.js +0 -1
- package/dist/entries/item.d.ts +0 -1
- package/dist/entries/item.js +0 -1
- package/dist/entries/kanban-board-parts.d.ts +0 -1
- package/dist/entries/kanban-board-parts.js +0 -1
- package/dist/entries/kanban-board-utils.d.ts +0 -1
- package/dist/entries/kanban-board-utils.js +0 -1
- package/dist/entries/kanban-board.d.ts +0 -1
- package/dist/entries/kanban-board.js +0 -1
- package/dist/entries/kanban-card.d.ts +0 -1
- package/dist/entries/kanban-card.js +0 -1
- package/dist/entries/kanban-column.d.ts +0 -1
- package/dist/entries/kanban-column.js +0 -1
- package/dist/entries/kanban-detail-sheet.d.ts +0 -1
- package/dist/entries/kanban-detail-sheet.js +0 -1
- package/dist/entries/kanban-page.d.ts +0 -1
- package/dist/entries/kanban-page.js +0 -1
- package/dist/entries/kanban-types.d.ts +0 -1
- package/dist/entries/kanban-types.js +0 -1
- package/dist/entries/kbd.d.ts +0 -1
- package/dist/entries/kbd.js +0 -1
- package/dist/entries/label.d.ts +0 -1
- package/dist/entries/label.js +0 -1
- package/dist/entries/loading-state.d.ts +0 -1
- package/dist/entries/loading-state.js +0 -1
- package/dist/entries/mcp-access-grouped-tool-picker.d.ts +0 -1
- package/dist/entries/mcp-access-grouped-tool-picker.js +0 -1
- package/dist/entries/mcp-access-tool-picker.d.ts +0 -1
- package/dist/entries/mcp-access-tool-picker.js +0 -1
- package/dist/entries/mcp-access-types.d.ts +0 -1
- package/dist/entries/mcp-access-types.js +0 -1
- package/dist/entries/mcp-client-setup.d.ts +0 -1
- package/dist/entries/mcp-client-setup.js +0 -1
- package/dist/entries/mcp-connect-clients.d.ts +0 -1
- package/dist/entries/mcp-connect-clients.js +0 -1
- package/dist/entries/mcp-plan-choice.d.ts +0 -1
- package/dist/entries/mcp-plan-choice.js +0 -1
- package/dist/entries/menubar.d.ts +0 -1
- package/dist/entries/menubar.js +0 -1
- package/dist/entries/metrics-strip.d.ts +0 -1
- package/dist/entries/metrics-strip.js +0 -1
- package/dist/entries/native-select.d.ts +0 -1
- package/dist/entries/native-select.js +0 -1
- package/dist/entries/navigation-menu-variants.d.ts +0 -1
- package/dist/entries/navigation-menu-variants.js +0 -1
- package/dist/entries/navigation-menu.d.ts +0 -1
- package/dist/entries/navigation-menu.js +0 -1
- package/dist/entries/page-header.d.ts +0 -1
- package/dist/entries/page-header.js +0 -1
- package/dist/entries/pagination.d.ts +0 -1
- package/dist/entries/pagination.js +0 -1
- package/dist/entries/palette.d.ts +0 -2
- package/dist/entries/palette.js +0 -2
- package/dist/entries/popover.d.ts +0 -1
- package/dist/entries/popover.js +0 -1
- package/dist/entries/progress.d.ts +0 -1
- package/dist/entries/progress.js +0 -1
- package/dist/entries/property-list.d.ts +0 -1
- package/dist/entries/property-list.js +0 -1
- package/dist/entries/radio-group.d.ts +0 -1
- package/dist/entries/radio-group.js +0 -1
- package/dist/entries/registry-docs-api.d.ts +0 -1
- package/dist/entries/registry-docs-api.js +0 -1
- package/dist/entries/registry-docs-code.d.ts +0 -1
- package/dist/entries/registry-docs-code.js +0 -1
- package/dist/entries/registry-docs-showcase.d.ts +0 -1
- package/dist/entries/registry-docs-showcase.js +0 -1
- package/dist/entries/registry-docs.d.ts +0 -1
- package/dist/entries/registry-docs.js +0 -1
- package/dist/entries/resizable.d.ts +0 -1
- package/dist/entries/resizable.js +0 -1
- package/dist/entries/scroll-area.d.ts +0 -1
- package/dist/entries/scroll-area.js +0 -1
- package/dist/entries/select.d.ts +0 -1
- package/dist/entries/select.js +0 -1
- package/dist/entries/separator.d.ts +0 -1
- package/dist/entries/separator.js +0 -1
- package/dist/entries/sheet.d.ts +0 -1
- package/dist/entries/sheet.js +0 -1
- package/dist/entries/sidebar/context.d.ts +0 -1
- package/dist/entries/sidebar/context.js +0 -1
- package/dist/entries/sidebar/group.d.ts +0 -1
- package/dist/entries/sidebar/group.js +0 -1
- package/dist/entries/sidebar/layout.d.ts +0 -1
- package/dist/entries/sidebar/layout.js +0 -1
- package/dist/entries/sidebar/menu.d.ts +0 -1
- package/dist/entries/sidebar/menu.js +0 -1
- package/dist/entries/sidebar/provider.d.ts +0 -1
- package/dist/entries/sidebar/provider.js +0 -1
- package/dist/entries/sidebar/rail.d.ts +0 -1
- package/dist/entries/sidebar/rail.js +0 -1
- package/dist/entries/sidebar/trigger.d.ts +0 -1
- package/dist/entries/sidebar/trigger.js +0 -1
- package/dist/entries/sidebar-account-menu-theme.d.ts +0 -1
- package/dist/entries/sidebar-account-menu-theme.js +0 -1
- package/dist/entries/sidebar-account-menu.d.ts +0 -1
- package/dist/entries/sidebar-account-menu.js +0 -1
- package/dist/entries/sidebar.d.ts +0 -1
- package/dist/entries/sidebar.js +0 -1
- package/dist/entries/skeleton.d.ts +0 -1
- package/dist/entries/skeleton.js +0 -1
- package/dist/entries/slider.d.ts +0 -1
- package/dist/entries/slider.js +0 -1
- package/dist/entries/sonner.d.ts +0 -1
- package/dist/entries/sonner.js +0 -1
- package/dist/entries/spinner.d.ts +0 -1
- package/dist/entries/spinner.js +0 -1
- package/dist/entries/submit-feedback-composer.d.ts +0 -1
- package/dist/entries/submit-feedback-composer.js +0 -1
- package/dist/entries/switch.d.ts +0 -1
- package/dist/entries/switch.js +0 -1
- package/dist/entries/table.d.ts +0 -1
- package/dist/entries/table.js +0 -1
- package/dist/entries/tabs-variants.d.ts +0 -1
- package/dist/entries/tabs-variants.js +0 -1
- package/dist/entries/tabs.d.ts +0 -1
- package/dist/entries/tabs.js +0 -1
- package/dist/entries/textarea.d.ts +0 -1
- package/dist/entries/textarea.js +0 -1
- package/dist/entries/timestamp-format.d.ts +0 -1
- package/dist/entries/timestamp-format.js +0 -1
- package/dist/entries/toggle-group.d.ts +0 -1
- package/dist/entries/toggle-group.js +0 -1
- package/dist/entries/toggle-variants.d.ts +0 -1
- package/dist/entries/toggle-variants.js +0 -1
- package/dist/entries/toggle.d.ts +0 -1
- package/dist/entries/toggle.js +0 -1
- package/dist/entries/tooltip.d.ts +0 -1
- package/dist/entries/tooltip.js +0 -1
- package/dist/entries/use-color-theme.d.ts +0 -1
- package/dist/entries/use-color-theme.js +0 -1
- package/dist/entries/use-feedback-composer-state.d.ts +0 -1
- package/dist/entries/use-feedback-composer-state.js +0 -1
- package/dist/entries/use-mobile.d.ts +0 -1
- package/dist/entries/use-mobile.js +0 -1
- package/dist/entries/utils.d.ts +0 -1
- package/dist/entries/utils.js +0 -1
- package/dist/entries/walkthrough.d.ts +0 -1
- package/dist/entries/walkthrough.js +0 -1
- package/dist/entries/workflow-timeline.d.ts +0 -1
- package/dist/entries/workflow-timeline.js +0 -1
- package/dist/hooks/use-mobile.d.ts +0 -1
- package/dist/hooks/use-mobile.js +0 -17
- package/dist/lib/browser-storage.d.ts +0 -12
- package/dist/lib/browser-storage.js +0 -42
- package/dist/lib/palette-presets.d.ts +0 -17
- package/dist/lib/palette-presets.js +0 -42
- package/dist/lib/palette-tokens.d.ts +0 -39
- package/dist/lib/palette-tokens.js +0 -133
- package/dist/lib/palette.d.ts +0 -83
- package/dist/lib/palette.js +0 -151
- package/dist/lib/utils.d.ts +0 -5
- package/dist/lib/utils.js +0 -8
- package/dist/style-imports.d.ts +0 -3
- /package/dist/{components/blocks/feedback-composer-types.js → feedback/comment-types.js} +0 -0
- /package/dist/{components/blocks/kanban-types.js → feedback/feedback-composer-types.js} +0 -0
- /package/dist/{components/walkthrough/runtime/walkthroughTypes.js → feedback/feedback-tracking-types.js} +0 -0
|
@@ -0,0 +1,829 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* The kit's one list: TanStack Table for sorting, column visibility and order, drawn as a CSS grid
|
|
4
|
+
* of ARIA table rows so every row shares the columns (subgrid) and a row can carry a group heading,
|
|
5
|
+
* a detail line or a wash over pinned cells. State comes in controlled/uncontrolled pairs, so a page
|
|
6
|
+
* can keep its sort, selection and columns in the URL. `Table` is the same list with the plain,
|
|
7
|
+
* frameless look.
|
|
8
|
+
*/
|
|
9
|
+
import { CaretDownIcon, CaretUpIcon, EyeSlashIcon, FunnelSimpleIcon, SortAscendingIcon, SortDescendingIcon, } from "@phosphor-icons/react";
|
|
10
|
+
import { columnOrderingFeature, columnVisibilityFeature, createColumnHelper, createSortedRowModel, functionalUpdate, rowSortingFeature, tableFeatures, useTable, } from "@tanstack/react-table";
|
|
11
|
+
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
12
|
+
import { cloneElement, useLayoutEffect, useRef, useState, } from "react";
|
|
13
|
+
import { css, cx } from "#primitives/css";
|
|
14
|
+
import { useBreakpoint } from "./breakpoint.js";
|
|
15
|
+
import { useControllableState } from "./controllable-state.js";
|
|
16
|
+
import { replaceFilter, FilterValueEditor } from "./filter-bar.js";
|
|
17
|
+
import { Checkbox } from "./form-controls.js";
|
|
18
|
+
import { useHotkeys } from "./hotkeys.js";
|
|
19
|
+
import { icon } from "./icon.js";
|
|
20
|
+
import { useCiridaeLocale } from "./locale.js";
|
|
21
|
+
import { Menu } from "./menu.js";
|
|
22
|
+
import { Popover } from "./overlays.js";
|
|
23
|
+
import { Skeleton } from "./skeleton.js";
|
|
24
|
+
/** TanStack uses this type-only slot to type `meta`. */
|
|
25
|
+
const columnMeta = {};
|
|
26
|
+
const tableFeatureSet = tableFeatures({
|
|
27
|
+
rowSortingFeature,
|
|
28
|
+
columnVisibilityFeature,
|
|
29
|
+
columnOrderingFeature,
|
|
30
|
+
sortedRowModel: createSortedRowModel(),
|
|
31
|
+
columnMeta,
|
|
32
|
+
});
|
|
33
|
+
/**
|
|
34
|
+
* Column helper bound to the list's features: `accessor` columns sort by their value, `display`
|
|
35
|
+
* columns render without one. See `TableColumnMeta` for the per-column options.
|
|
36
|
+
*/
|
|
37
|
+
export function createTableColumns() {
|
|
38
|
+
return createColumnHelper();
|
|
39
|
+
}
|
|
40
|
+
/** Each column's id, plain-text name and whether it is locked, in definition order. */
|
|
41
|
+
export function columnInfoOf(columns) {
|
|
42
|
+
return columns.map((column) => {
|
|
43
|
+
const id = column.id ?? ("accessorKey" in column ? String(column.accessorKey) : "");
|
|
44
|
+
const label = column.meta?.label ?? (typeof column.header === "string" ? column.header : id);
|
|
45
|
+
return { id, label, locked: column.meta?.locked ?? false };
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
/** The element that scrolls `element` vertically: its nearest scrolling ancestor, or the page. */
|
|
49
|
+
function scrollingAncestor(element) {
|
|
50
|
+
for (let parent = element.parentElement; parent; parent = parent.parentElement) {
|
|
51
|
+
if (/auto|scroll|overlay/.test(getComputedStyle(parent).overflowY))
|
|
52
|
+
return parent;
|
|
53
|
+
}
|
|
54
|
+
return document.scrollingElement instanceof HTMLElement
|
|
55
|
+
? document.scrollingElement
|
|
56
|
+
: document.documentElement;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The list: sortable heads (or a head menu), row selection with a select-all box, hidden and
|
|
60
|
+
* reordered columns, columns that drop by `priority` as the list narrows, row links and presses,
|
|
61
|
+
* hover-revealed row actions, groups, loading, empty and no-results states. `role="table"`; Enter
|
|
62
|
+
* on a pressable row opens it.
|
|
63
|
+
*/
|
|
64
|
+
export function DataGrid({ data, columns, getRowId, variant = "framed", density = "default", sorting: sortingProp, defaultSorting = emptySorting, onSortingChange, manualSorting = false, enableRowSelection, rowSelection: rowSelectionProp, defaultRowSelection = emptySelection, onRowSelectionChange, stickySelectColumn = false, columnVisibility: columnVisibilityProp, defaultColumnVisibility = emptyVisibility, onColumnVisibilityChange, columnOrder: columnOrderProp, defaultColumnOrder = emptyOrder, onColumnOrderChange, headerMenu = false, filters, onFiltersChange, getRowHref, renderRowLink, onRowClick, activeRowId, keyboardNavigation = false, virtualize = false, rowActions, renderRowDetail, groupBy, renderGroupRow, loading = false, empty, noResults, filtered, hideHeader = false, fill = false, narrowScreenLayout = "columns", footer, labels: ownLabels, className, frameClassName, style, ...props }) {
|
|
65
|
+
const { labels: localeLabels } = useCiridaeLocale();
|
|
66
|
+
const labels = { ...localeLabels.table, ...ownLabels };
|
|
67
|
+
const [sorting, setSorting] = useControllableState(sortingProp, defaultSorting, onSortingChange);
|
|
68
|
+
const [rowSelection, setRowSelection] = useControllableState(rowSelectionProp, defaultRowSelection, onRowSelectionChange);
|
|
69
|
+
const [columnVisibility, setColumnVisibility] = useControllableState(columnVisibilityProp, defaultColumnVisibility, onColumnVisibilityChange);
|
|
70
|
+
const [columnOrder, setColumnOrder] = useControllableState(columnOrderProp, defaultColumnOrder, onColumnOrderChange);
|
|
71
|
+
const table = useTable({
|
|
72
|
+
features: tableFeatureSet,
|
|
73
|
+
data,
|
|
74
|
+
columns,
|
|
75
|
+
getRowId: (row) => getRowId(row),
|
|
76
|
+
defaultColumn: { sortFn: compareSortValues },
|
|
77
|
+
state: { sorting, columnVisibility, columnOrder },
|
|
78
|
+
onSortingChange: (updater) => setSorting(functionalUpdate(updater, sorting)),
|
|
79
|
+
onColumnVisibilityChange: (updater) => setColumnVisibility(functionalUpdate(updater, columnVisibility)),
|
|
80
|
+
onColumnOrderChange: (updater) => setColumnOrder(functionalUpdate(updater, columnOrder)),
|
|
81
|
+
manualSorting,
|
|
82
|
+
sortDescFirst: false,
|
|
83
|
+
enableSortingRemoval: false,
|
|
84
|
+
});
|
|
85
|
+
const phone = useBreakpoint("phone");
|
|
86
|
+
const stacked = narrowScreenLayout === "stacked" && phone;
|
|
87
|
+
const visibleColumns = table
|
|
88
|
+
.getVisibleLeafColumns()
|
|
89
|
+
.filter((column) => !(phone && column.columnDef.meta?.hideOnNarrow));
|
|
90
|
+
// Priority dropping: measured, so it follows the list's own width (beside a panel, in a side
|
|
91
|
+
// column), not the screen's. Each dropped column remembers the width the list needed with it,
|
|
92
|
+
// and comes back once the list is that wide again.
|
|
93
|
+
const frameRef = useRef(null);
|
|
94
|
+
const gridRef = useRef(null);
|
|
95
|
+
const selectHeadRef = useRef(null);
|
|
96
|
+
const [frameWidth, setFrameWidth] = useState(0);
|
|
97
|
+
const [dropped, setDropped] = useState(new Map());
|
|
98
|
+
// Ids that can drop, lowest priority first, as one string so the effect can depend on it.
|
|
99
|
+
const droppableKey = stacked
|
|
100
|
+
? ""
|
|
101
|
+
: visibleColumns
|
|
102
|
+
.filter((column) => column.columnDef.meta?.priority !== undefined)
|
|
103
|
+
.sort((left, right) => (left.columnDef.meta?.priority ?? 0) - (right.columnDef.meta?.priority ?? 0))
|
|
104
|
+
.map((column) => column.id)
|
|
105
|
+
.join(" ");
|
|
106
|
+
const shownColumns = visibleColumns.filter((column) => stacked || !dropped.has(column.id));
|
|
107
|
+
const shownKey = shownColumns.map((column) => column.id).join(" ");
|
|
108
|
+
useLayoutEffect(() => {
|
|
109
|
+
const frame = frameRef.current;
|
|
110
|
+
if (!frame)
|
|
111
|
+
return;
|
|
112
|
+
const observer = new ResizeObserver(([entry]) => setFrameWidth(entry.contentRect.width));
|
|
113
|
+
observer.observe(frame);
|
|
114
|
+
return () => observer.disconnect();
|
|
115
|
+
}, []);
|
|
116
|
+
useLayoutEffect(() => {
|
|
117
|
+
const frame = frameRef.current;
|
|
118
|
+
const grid = gridRef.current;
|
|
119
|
+
if (!frame || !grid || frameWidth === 0)
|
|
120
|
+
return;
|
|
121
|
+
grid.style.setProperty("--data-grid-sticky-offset", `${selectHeadRef.current?.offsetWidth ?? 0}px`);
|
|
122
|
+
const droppable = droppableKey ? droppableKey.split(" ") : [];
|
|
123
|
+
if (droppable.length === 0)
|
|
124
|
+
return;
|
|
125
|
+
const available = frame.clientWidth;
|
|
126
|
+
const needed = grid.offsetWidth;
|
|
127
|
+
if (needed > available + 1) {
|
|
128
|
+
const next = droppable.find((id) => !dropped.has(id));
|
|
129
|
+
if (next)
|
|
130
|
+
setDropped(new Map(dropped).set(next, needed));
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
const restorable = [...droppable].reverse().find((id) => dropped.has(id));
|
|
134
|
+
const neededWith = restorable === undefined ? undefined : dropped.get(restorable);
|
|
135
|
+
if (restorable !== undefined && neededWith !== undefined && neededWith <= available) {
|
|
136
|
+
const next = new Map(dropped);
|
|
137
|
+
next.delete(restorable);
|
|
138
|
+
setDropped(next);
|
|
139
|
+
}
|
|
140
|
+
// Re-measured when the width, the columns on show or the rows change; it settles once
|
|
141
|
+
// nothing more drops or comes back.
|
|
142
|
+
}, [frameWidth, droppableKey, shownKey, dropped, data, loading]);
|
|
143
|
+
const foldedInto = new Map();
|
|
144
|
+
for (const column of visibleColumns) {
|
|
145
|
+
const target = column.columnDef.meta?.foldInto;
|
|
146
|
+
if (!target || stacked || !dropped.has(column.id))
|
|
147
|
+
continue;
|
|
148
|
+
foldedInto.set(target, [...(foldedInto.get(target) ?? []), column]);
|
|
149
|
+
}
|
|
150
|
+
const selectable = enableRowSelection !== undefined && enableRowSelection !== false;
|
|
151
|
+
const canSelect = (row) => typeof enableRowSelection === "function" ? enableRowSelection(row) : selectable;
|
|
152
|
+
const rows = table.getRowModel().rows;
|
|
153
|
+
const selectableIds = rows.filter((row) => canSelect(row.original)).map((row) => row.id);
|
|
154
|
+
const setSelected = (ids, selected) => {
|
|
155
|
+
const next = Object.fromEntries(Object.entries(rowSelection).filter(([id]) => selected || !ids.includes(id)));
|
|
156
|
+
if (selected)
|
|
157
|
+
for (const id of ids)
|
|
158
|
+
next[id] = true;
|
|
159
|
+
setRowSelection(next);
|
|
160
|
+
};
|
|
161
|
+
const selectionOf = (ids) => {
|
|
162
|
+
const count = ids.filter((id) => rowSelection[id]).length;
|
|
163
|
+
return count === 0 ? "none" : count === ids.length ? "all" : "some";
|
|
164
|
+
};
|
|
165
|
+
const allSelected = selectionOf(selectableIds);
|
|
166
|
+
const rowLinkColumnId = shownColumns.find((column) => column.columnDef.meta?.rowLink)?.id ?? shownColumns[0]?.id;
|
|
167
|
+
const stickyColumnId = shownColumns[0]?.columnDef.meta?.sticky === "start" ? shownColumns[0].id : undefined;
|
|
168
|
+
const template = [
|
|
169
|
+
...(selectable ? ["max-content"] : []),
|
|
170
|
+
...shownColumns.map((column) => trackOf(column.columnDef.meta)),
|
|
171
|
+
...(rowActions ? ["max-content"] : []),
|
|
172
|
+
].join(" ");
|
|
173
|
+
const columnCount = shownColumns.length + (selectable ? 1 : 0) + (rowActions ? 1 : 0);
|
|
174
|
+
const pressable = Boolean(getRowHref || onRowClick);
|
|
175
|
+
const [filterColumnId, setFilterColumnId] = useState(null);
|
|
176
|
+
const headRefs = useRef(new Map());
|
|
177
|
+
const filterColumn = shownColumns.find((column) => column.id === filterColumnId);
|
|
178
|
+
const filterField = filterColumn?.columnDef.meta?.filter;
|
|
179
|
+
const pressRow = (event, row, href) => {
|
|
180
|
+
// A portalled menu or dialog in a cell still bubbles its clicks here through React, though
|
|
181
|
+
// its DOM sits outside the row; only a click on the row itself counts, and not on its controls.
|
|
182
|
+
const target = event.target;
|
|
183
|
+
if (!(target instanceof Element) || !event.currentTarget.contains(target))
|
|
184
|
+
return;
|
|
185
|
+
if (event.defaultPrevented || getSelection()?.type === "Range")
|
|
186
|
+
return;
|
|
187
|
+
if (target.closest(interactiveSelector))
|
|
188
|
+
return;
|
|
189
|
+
if (onRowClick && !hasModifier(event)) {
|
|
190
|
+
onRowClick(row, event);
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
if (!href)
|
|
194
|
+
return;
|
|
195
|
+
const anchor = event.currentTarget.querySelector("a[data-row-link]");
|
|
196
|
+
if (anchor instanceof HTMLAnchorElement) {
|
|
197
|
+
anchor.dispatchEvent(new globalThis.MouseEvent("click", {
|
|
198
|
+
bubbles: true,
|
|
199
|
+
cancelable: true,
|
|
200
|
+
view: window,
|
|
201
|
+
button: event.button,
|
|
202
|
+
altKey: event.altKey,
|
|
203
|
+
ctrlKey: event.ctrlKey,
|
|
204
|
+
metaKey: event.metaKey,
|
|
205
|
+
shiftKey: event.shiftKey,
|
|
206
|
+
}));
|
|
207
|
+
}
|
|
208
|
+
else
|
|
209
|
+
window.location.assign(href);
|
|
210
|
+
};
|
|
211
|
+
// A plain click on the row's link presses the row when it has `onRowClick`; a modified one
|
|
212
|
+
// still opens the link, such as in a new tab.
|
|
213
|
+
const pressRowLink = (event, row) => {
|
|
214
|
+
if (!onRowClick || hasModifier(event))
|
|
215
|
+
return;
|
|
216
|
+
if (!(event.target instanceof Element) || !event.target.closest("a[data-row-link]"))
|
|
217
|
+
return;
|
|
218
|
+
event.preventDefault();
|
|
219
|
+
onRowClick(row, event);
|
|
220
|
+
};
|
|
221
|
+
const openOnKey = (event, row) => {
|
|
222
|
+
if (event.target !== event.currentTarget)
|
|
223
|
+
return;
|
|
224
|
+
if (event.key !== "Enter" && event.key !== " ")
|
|
225
|
+
return;
|
|
226
|
+
event.preventDefault();
|
|
227
|
+
if (onRowClick)
|
|
228
|
+
onRowClick(row, event);
|
|
229
|
+
else
|
|
230
|
+
event.currentTarget.querySelector("a[data-row-link]")?.click();
|
|
231
|
+
};
|
|
232
|
+
// The body as drawn, group lines and rows in order, so the list keys and the virtualizer agree.
|
|
233
|
+
const groups = [];
|
|
234
|
+
if (groupBy) {
|
|
235
|
+
for (const tableRow of rows) {
|
|
236
|
+
const key = groupBy(tableRow.original);
|
|
237
|
+
const group = groups.find((existing) => existing.key === key);
|
|
238
|
+
if (group)
|
|
239
|
+
group.rows.push(tableRow);
|
|
240
|
+
else
|
|
241
|
+
groups.push({ key, rows: [tableRow] });
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
const bodyItems = groupBy
|
|
245
|
+
? groups.flatMap((group) => [
|
|
246
|
+
{ kind: "group", key: `group:${group.key}`, group },
|
|
247
|
+
...group.rows.map((row) => ({ kind: "row", key: row.id, row })),
|
|
248
|
+
])
|
|
249
|
+
: rows.map((row) => ({ kind: "row", key: row.id, row }));
|
|
250
|
+
const rowIds = bodyItems.flatMap((item) => (item.kind === "row" ? [item.row.id] : []));
|
|
251
|
+
// Long lists draw only the rows near the view, between two spacers, in whichever element
|
|
252
|
+
// scrolls them: the frame for a `fill` list, else the nearest scrolling ancestor.
|
|
253
|
+
const [scroller, setScroller] = useState(null);
|
|
254
|
+
const [scrollMargin, setScrollMargin] = useState(0);
|
|
255
|
+
useLayoutEffect(() => {
|
|
256
|
+
const frameElement = frameRef.current;
|
|
257
|
+
if (!virtualize || !frameElement)
|
|
258
|
+
return;
|
|
259
|
+
const element = fill ? frameElement : scrollingAncestor(frameElement);
|
|
260
|
+
setScroller(element);
|
|
261
|
+
const head = gridRef.current?.querySelector("[role=row]:has([role=columnheader])");
|
|
262
|
+
const gridTop = gridRef.current?.getBoundingClientRect().top ?? 0;
|
|
263
|
+
setScrollMargin(gridTop - element.getBoundingClientRect().top + element.scrollTop + (head?.offsetHeight ?? 0));
|
|
264
|
+
}, [virtualize, fill, frameWidth, hideHeader, bodyItems.length]);
|
|
265
|
+
const virtualizer = useVirtualizer({
|
|
266
|
+
count: bodyItems.length,
|
|
267
|
+
getScrollElement: () => scroller,
|
|
268
|
+
estimateSize: () => (density === "compact" ? 37 : 53),
|
|
269
|
+
getItemKey: (index) => bodyItems[index]?.key ?? index,
|
|
270
|
+
overscan: 10,
|
|
271
|
+
scrollMargin,
|
|
272
|
+
enabled: virtualize && scroller !== null,
|
|
273
|
+
});
|
|
274
|
+
const virtualItems = virtualize ? virtualizer.getVirtualItems() : [];
|
|
275
|
+
// The list keys move through rows in that order; a row scrolled out of a virtualized list is
|
|
276
|
+
// scrolled back in, and focused once it is drawn.
|
|
277
|
+
const cursorRowId = useRef(null);
|
|
278
|
+
const anchorRowId = useRef(null);
|
|
279
|
+
const pendingFocusId = useRef(null);
|
|
280
|
+
const rowElement = (id) => gridRef.current?.querySelector(`[role=row][data-row-id="${CSS.escape(id)}"]`);
|
|
281
|
+
useLayoutEffect(() => {
|
|
282
|
+
const id = pendingFocusId.current;
|
|
283
|
+
const element = id === null ? null : rowElement(id);
|
|
284
|
+
if (!element)
|
|
285
|
+
return;
|
|
286
|
+
pendingFocusId.current = null;
|
|
287
|
+
element.focus();
|
|
288
|
+
});
|
|
289
|
+
const focusRow = (id) => {
|
|
290
|
+
cursorRowId.current = id;
|
|
291
|
+
const element = rowElement(id);
|
|
292
|
+
if (element)
|
|
293
|
+
return element.focus();
|
|
294
|
+
pendingFocusId.current = id;
|
|
295
|
+
virtualizer.scrollToIndex(bodyItems.findIndex((item) => item.key === id), { align: "auto" });
|
|
296
|
+
};
|
|
297
|
+
const cursorId = () => {
|
|
298
|
+
// A row still on its way into view is where the cursor already is.
|
|
299
|
+
if (pendingFocusId.current !== null)
|
|
300
|
+
return pendingFocusId.current;
|
|
301
|
+
const focused = document.activeElement?.closest("[role=row][data-row-id]");
|
|
302
|
+
if (focused && gridRef.current?.contains(focused))
|
|
303
|
+
return focused.dataset.rowId ?? null;
|
|
304
|
+
if (cursorRowId.current !== null && rowIds.includes(cursorRowId.current))
|
|
305
|
+
return cursorRowId.current;
|
|
306
|
+
return activeRowId ?? null;
|
|
307
|
+
};
|
|
308
|
+
const moveCursor = (step) => {
|
|
309
|
+
const current = cursorId();
|
|
310
|
+
const index = current === null || !rowIds.includes(current)
|
|
311
|
+
? step === 1
|
|
312
|
+
? 0
|
|
313
|
+
: rowIds.length - 1
|
|
314
|
+
: rowIds.indexOf(current) + step;
|
|
315
|
+
const next = rowIds[Math.min(rowIds.length - 1, Math.max(0, index))];
|
|
316
|
+
if (next !== undefined)
|
|
317
|
+
focusRow(next);
|
|
318
|
+
};
|
|
319
|
+
const toggleCursorRow = () => {
|
|
320
|
+
const id = cursorId();
|
|
321
|
+
const row = rows.find((candidate) => candidate.id === id);
|
|
322
|
+
if (id === null || !row || !canSelect(row.original))
|
|
323
|
+
return;
|
|
324
|
+
anchorRowId.current = id;
|
|
325
|
+
setSelected([id], !rowSelection[id]);
|
|
326
|
+
};
|
|
327
|
+
const selectToCursor = () => {
|
|
328
|
+
const end = rowIds.indexOf(cursorId() ?? "");
|
|
329
|
+
if (end === -1)
|
|
330
|
+
return;
|
|
331
|
+
const start = anchorRowId.current === null ? end : rowIds.indexOf(anchorRowId.current);
|
|
332
|
+
const range = rowIds.slice(Math.min(start, end), Math.max(start, end) + 1);
|
|
333
|
+
setSelected(range.filter((id) => selectableIds.includes(id)), true);
|
|
334
|
+
anchorRowId.current = rowIds[end] ?? null;
|
|
335
|
+
};
|
|
336
|
+
useHotkeys([
|
|
337
|
+
{
|
|
338
|
+
hotkey: "J",
|
|
339
|
+
callback: () => moveCursor(1),
|
|
340
|
+
options: {
|
|
341
|
+
meta: { group: localeLabels.keyboard.list, name: localeLabels.keyboard.nextRow },
|
|
342
|
+
},
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
hotkey: "K",
|
|
346
|
+
callback: () => moveCursor(-1),
|
|
347
|
+
options: {
|
|
348
|
+
meta: { group: localeLabels.keyboard.list, name: localeLabels.keyboard.previousRow },
|
|
349
|
+
},
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
hotkey: "X",
|
|
353
|
+
callback: toggleCursorRow,
|
|
354
|
+
options: {
|
|
355
|
+
enabled: selectable,
|
|
356
|
+
meta: { group: localeLabels.keyboard.list, name: localeLabels.keyboard.selectRow },
|
|
357
|
+
},
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
hotkey: "Shift+X",
|
|
361
|
+
callback: selectToCursor,
|
|
362
|
+
options: {
|
|
363
|
+
enabled: selectable,
|
|
364
|
+
meta: { group: localeLabels.keyboard.list, name: localeLabels.keyboard.selectRange },
|
|
365
|
+
},
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
hotkey: "Escape",
|
|
369
|
+
callback: () => setRowSelection({}),
|
|
370
|
+
options: {
|
|
371
|
+
enabled: Object.values(rowSelection).some(Boolean),
|
|
372
|
+
// Escape in a field is the field's, such as clearing a search.
|
|
373
|
+
ignoreInputs: true,
|
|
374
|
+
// The shell's Escape closes its phone menu, which covers the list.
|
|
375
|
+
conflictBehavior: "allow",
|
|
376
|
+
meta: { group: localeLabels.keyboard.list, name: localeLabels.keyboard.clearSelection },
|
|
377
|
+
},
|
|
378
|
+
},
|
|
379
|
+
], { enabled: keyboardNavigation });
|
|
380
|
+
const cellClass = (column) => cx(cell, column.columnDef.meta?.truncate && truncateCell, column.id === stickyColumnId && pinnedCell);
|
|
381
|
+
const renderCellContent = (tableRow, column) => {
|
|
382
|
+
const cells = tableRow.getAllCells();
|
|
383
|
+
const content = cellContentOf(cells, column.id);
|
|
384
|
+
const folded = foldedInto.get(column.id);
|
|
385
|
+
if (!folded)
|
|
386
|
+
return content;
|
|
387
|
+
return (_jsxs("span", { className: foldedStack, children: [_jsx("span", { className: foldedPrimary, children: content }), _jsx("span", { className: foldedLine, children: folded.map((foldedColumn) => (_jsx("span", { children: cellContentOf(cells, foldedColumn.id) }, foldedColumn.id))) })] }));
|
|
388
|
+
};
|
|
389
|
+
const renderRow = (tableRow, measured) => {
|
|
390
|
+
const original = tableRow.original;
|
|
391
|
+
const href = getRowHref?.(original);
|
|
392
|
+
const selected = Boolean(rowSelection[tableRow.id]);
|
|
393
|
+
const active = activeRowId === tableRow.id;
|
|
394
|
+
const actions = rowActions?.(original);
|
|
395
|
+
const detail = renderRowDetail?.(original);
|
|
396
|
+
const firstValue = shownColumns[0] && tableRow.getValue(shownColumns[0].id);
|
|
397
|
+
const rowName = typeof firstValue === "string" || typeof firstValue === "number"
|
|
398
|
+
? String(firstValue)
|
|
399
|
+
: tableRow.id;
|
|
400
|
+
return (_jsxs("div", { ref: measured?.ref, "data-index": measured?.index, role: "row", className: bodyRow, "data-row-id": tableRow.id, "data-pressable": pressable || undefined, "data-selected": selected || undefined, "data-active": active || undefined, "aria-current": active || undefined, tabIndex: onRowClick && !href ? 0 : keyboardNavigation ? -1 : undefined, onClick: pressable ? (event) => pressRow(event, original, href) : undefined, onClickCapture: href && onRowClick ? (event) => pressRowLink(event, original) : undefined, onKeyDown: onRowClick || (keyboardNavigation && href)
|
|
401
|
+
? (event) => openOnKey(event, original)
|
|
402
|
+
: undefined, onFocus: keyboardNavigation
|
|
403
|
+
? (event) => {
|
|
404
|
+
if (event.target === event.currentTarget)
|
|
405
|
+
cursorRowId.current = tableRow.id;
|
|
406
|
+
}
|
|
407
|
+
: undefined, children: [selectable && (_jsx("div", { role: "cell", className: cx(cell, selectCell, stickySelectColumn && pinnedCell), children: canSelect(original) && (_jsx(Checkbox, { "aria-label": labels.selectRow(rowName), checked: selected, onCheckedChange: (checked) => setSelected([tableRow.id], checked) })) })), shownColumns.map((column) => (_jsx("div", { role: "cell", className: cellClass(column), "data-align": column.columnDef.meta?.align, children: href && column.id === rowLinkColumnId ? (renderRowLink ? (cloneElement(renderRowLink(href), {
|
|
408
|
+
...rowLinkMarker,
|
|
409
|
+
children: renderCellContent(tableRow, column),
|
|
410
|
+
})) : (_jsx("a", { href: href, ...rowLinkMarker, children: renderCellContent(tableRow, column) }))) : (renderCellContent(tableRow, column)) }, column.id))), rowActions && (_jsx("div", { role: "cell", className: cx(cell, actionsCell), "data-row-actions": "", children: actions })), detail !== undefined && detail !== null && detail !== false && (_jsx("div", { role: "cell", "aria-colspan": columnCount, className: detailCell, children: detail }))] }, tableRow.id));
|
|
411
|
+
};
|
|
412
|
+
const drawGroupRow = (group, measured) => {
|
|
413
|
+
const groupRowIds = group.rows
|
|
414
|
+
.filter((tableRow) => canSelect(tableRow.original))
|
|
415
|
+
.map((tableRow) => tableRow.id);
|
|
416
|
+
const details = {
|
|
417
|
+
key: group.key,
|
|
418
|
+
rows: group.rows.map((tableRow) => tableRow.original),
|
|
419
|
+
rowIds: groupRowIds,
|
|
420
|
+
selected: selectionOf(groupRowIds),
|
|
421
|
+
toggleSelected: (value) => setSelected(groupRowIds, value),
|
|
422
|
+
};
|
|
423
|
+
const heading = renderGroupRow ? renderGroupRow(details) : group.key;
|
|
424
|
+
return (_jsxs("div", { ref: measured?.ref, "data-index": measured?.index, role: "row", className: groupRow, children: [selectable && (_jsx("div", { role: "cell", className: cx(cell, selectCell, stickySelectColumn && pinnedCell), children: groupRowIds.length > 0 && (_jsx(Checkbox, { "aria-label": labels.selectRow(group.key), checked: details.selected === "all", indeterminate: details.selected === "some", onCheckedChange: (checked) => details.toggleSelected(checked) })) })), _jsx("div", { role: "cell", "aria-colspan": columnCount - (selectable ? 1 : 0), className: groupCell, style: { gridColumn: selectable ? "2 / -1" : "1 / -1" }, children: heading })] }, `group:${group.key}`));
|
|
425
|
+
};
|
|
426
|
+
const drawBodyItem = (item, measured) => item.kind === "group" ? drawGroupRow(item.group, measured) : renderRow(item.row, measured);
|
|
427
|
+
const drawBody = () => {
|
|
428
|
+
if (!virtualize)
|
|
429
|
+
return bodyItems.map((item) => drawBodyItem(item));
|
|
430
|
+
const first = virtualItems[0];
|
|
431
|
+
const last = virtualItems[virtualItems.length - 1];
|
|
432
|
+
const before = first ? first.start - scrollMargin : 0;
|
|
433
|
+
const after = last ? virtualizer.getTotalSize() - (last.end - scrollMargin) : 0;
|
|
434
|
+
return (_jsxs(_Fragment, { children: [before > 0 && _jsx("div", { "aria-hidden": "true", className: spacerRow, style: { height: before } }), virtualItems.map((virtualItem) => {
|
|
435
|
+
const item = bodyItems[virtualItem.index];
|
|
436
|
+
return (item &&
|
|
437
|
+
drawBodyItem(item, { index: virtualItem.index, ref: virtualizer.measureElement }));
|
|
438
|
+
}), after > 0 && _jsx("div", { "aria-hidden": "true", className: spacerRow, style: { height: after } })] }));
|
|
439
|
+
};
|
|
440
|
+
const headerCell = (column) => {
|
|
441
|
+
const meta = column.columnDef.meta;
|
|
442
|
+
const sorted = column.getIsSorted();
|
|
443
|
+
const name = meta?.label ??
|
|
444
|
+
(typeof column.columnDef.header === "string" ? column.columnDef.header : column.id);
|
|
445
|
+
const content = _jsx(table.FlexRender, { header: headerOf(table.getFlatHeaders(), column.id) });
|
|
446
|
+
const menuItems = [];
|
|
447
|
+
if (headerMenu && meta?.headerMenu !== false) {
|
|
448
|
+
if (column.getCanSort()) {
|
|
449
|
+
const [ascending, descending] = meta?.sortLabels ?? [
|
|
450
|
+
labels.sortAscending,
|
|
451
|
+
labels.sortDescending,
|
|
452
|
+
];
|
|
453
|
+
menuItems.push({
|
|
454
|
+
label: ascending,
|
|
455
|
+
icon: _jsx(SortAscendingIcon, { className: icon({ size: "small" }) }),
|
|
456
|
+
checked: sorted === "asc",
|
|
457
|
+
onSelect: () => setSorting([{ id: column.id, desc: false }]),
|
|
458
|
+
}, {
|
|
459
|
+
label: descending,
|
|
460
|
+
icon: _jsx(SortDescendingIcon, { className: icon({ size: "small" }) }),
|
|
461
|
+
checked: sorted === "desc",
|
|
462
|
+
onSelect: () => setSorting([{ id: column.id, desc: true }]),
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
if (meta?.filter && onFiltersChange) {
|
|
466
|
+
if (menuItems.length > 0)
|
|
467
|
+
menuItems.push({ separator: true });
|
|
468
|
+
menuItems.push({
|
|
469
|
+
label: labels.filterBy(name),
|
|
470
|
+
icon: _jsx(FunnelSimpleIcon, { className: icon({ size: "small" }) }),
|
|
471
|
+
onSelect: () => setFilterColumnId(column.id),
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
if (!meta?.locked && column.getCanHide()) {
|
|
475
|
+
if (menuItems.length > 0)
|
|
476
|
+
menuItems.push({ separator: true });
|
|
477
|
+
menuItems.push({
|
|
478
|
+
label: labels.hideColumn,
|
|
479
|
+
icon: _jsx(EyeSlashIcon, { className: icon({ size: "small" }) }),
|
|
480
|
+
onSelect: () => setColumnVisibility({ ...columnVisibility, [column.id]: false }),
|
|
481
|
+
});
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
const caret = sorted === "desc" ? (_jsx(CaretDownIcon, { className: icon({ size: "small" }) })) : (_jsx(CaretUpIcon, { className: icon({ size: "small" }) }));
|
|
485
|
+
return (_jsx("div", { role: "columnheader", className: cx(headCell, column.id === stickyColumnId && pinnedCell), "data-align": meta?.align, "data-truncate": meta?.truncate || undefined, "aria-sort": sorted === "asc" ? "ascending" : sorted === "desc" ? "descending" : undefined, ref: (element) => {
|
|
486
|
+
if (element)
|
|
487
|
+
headRefs.current.set(column.id, element);
|
|
488
|
+
else
|
|
489
|
+
headRefs.current.delete(column.id);
|
|
490
|
+
}, children: menuItems.length > 0 ? (_jsx(Menu, { align: meta?.align === "end" ? "end" : "start", trigger: _jsxs("button", { type: "button", className: headButton, "data-sorted": sorted || undefined, children: [content, caret] }), items: menuItems })) : column.getCanSort() ? (_jsxs("button", { type: "button", className: headButton, "data-sorted": sorted || undefined, "data-toggle": "", onClick: column.getToggleSortingHandler(), children: [content, caret] })) : (content) }, column.id));
|
|
491
|
+
};
|
|
492
|
+
const showEmpty = !loading && rows.length === 0;
|
|
493
|
+
const isFiltered = filtered ?? (filters !== undefined && filters.length > 0);
|
|
494
|
+
const emptyContent = isFiltered && noResults !== undefined ? noResults : (empty ?? labels.nothingToShow);
|
|
495
|
+
return (_jsxs("div", { ref: frameRef, className: cx(frame, frameClassName), "data-ciridae-ui": "", "data-variant": variant, "data-density": density, "data-fill": fill || undefined, "data-stacked": narrowScreenLayout === "stacked" || undefined, children: [_jsxs("div", { ...props, ref: gridRef, role: "table", "aria-busy": loading || undefined, className: cx(grid, className), style: { ...style, gridTemplateColumns: template }, children: [!hideHeader && (_jsxs("div", { role: "row", className: headRow, children: [selectable && (_jsx("div", { ref: selectHeadRef, role: "columnheader", className: cx(headCell, selectCell, stickySelectColumn && pinnedCell), children: _jsx(Checkbox, { "aria-label": labels.selectAll, checked: allSelected === "all" && selectableIds.length > 0, indeterminate: allSelected === "some", disabled: loading || selectableIds.length === 0, onCheckedChange: (checked) => setSelected(selectableIds, checked) }) })), shownColumns.map(headerCell), rowActions && (_jsx("div", { role: "columnheader", className: headCell, children: _jsx("span", { className: visuallyHidden, children: labels.actions }) }))] })), loading ? (skeletonRows.map((rowIndex) => (_jsxs("div", { role: "row", className: bodyRow, "data-skeleton": "", children: [selectable && _jsx("div", { role: "cell", className: cx(cell, selectCell) }), shownColumns.map((column, columnIndex) => (_jsx("div", { role: "cell", className: cellClass(column), "data-align": column.columnDef.meta?.align, children: column.columnDef.meta?.skeleton ?? (_jsx(Skeleton, { shape: "text", style: {
|
|
496
|
+
width: skeletonWidths[(rowIndex + columnIndex) % skeletonWidths.length],
|
|
497
|
+
} })) }, column.id))), rowActions && _jsx("div", { role: "cell", className: cell })] }, rowIndex)))) : showEmpty ? (_jsx("div", { role: "row", className: emptyRow, children: _jsx("div", { role: "cell", "aria-colspan": columnCount, className: emptyCell, children: emptyContent }) })) : (drawBody())] }), footer, filterColumn && filterField && onFiltersChange && (_jsx(Popover, { open: true, onOpenChange: (open) => {
|
|
498
|
+
if (!open)
|
|
499
|
+
setFilterColumnId(null);
|
|
500
|
+
}, anchor: headRefs.current.get(filterColumn.id) ?? null, density: "compact", children: _jsx("div", { className: columnFilter, children: _jsx(FilterValueEditor, { field: filterField, value: filters?.find((filter) => filter.field === filterField.key), onChange: (filter) => onFiltersChange(replaceFilter(filters ?? [], filter)) }) }) }))] }));
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* `DataGrid` with the plain look: flush with its section, heads in caps, rows that light on hover
|
|
504
|
+
* when they lead somewhere.
|
|
505
|
+
*/
|
|
506
|
+
export function Table({ variant = "plain", initialSorting, emptyMessage, ...props }) {
|
|
507
|
+
return (_jsx(DataGrid, { variant: variant, defaultSorting: initialSorting, empty: emptyMessage, ...props }));
|
|
508
|
+
}
|
|
509
|
+
const emptySorting = [];
|
|
510
|
+
const emptySelection = {};
|
|
511
|
+
const emptyVisibility = {};
|
|
512
|
+
const emptyOrder = [];
|
|
513
|
+
const skeletonRows = [0, 1, 2, 3, 4];
|
|
514
|
+
const skeletonWidths = ["70%", "45%", "85%", "55%"];
|
|
515
|
+
/** What takes a click of its own inside a row, so pressing it leaves the row alone. */
|
|
516
|
+
const interactiveSelector = "a:not([data-row-link]), button, input, label, select, textarea, [role=button], [role=checkbox], [role=combobox], [role=menuitem], [contenteditable=true]";
|
|
517
|
+
/** Marks the row's own anchor among any links its cells hold. */
|
|
518
|
+
const rowLinkMarker = { "data-row-link": "" };
|
|
519
|
+
function hasModifier(event) {
|
|
520
|
+
return event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || event.button !== 0;
|
|
521
|
+
}
|
|
522
|
+
/** The narrowest a truncating column shrinks to when it names no `minWidth`. */
|
|
523
|
+
const truncatedColumnMinimum = 96;
|
|
524
|
+
/*
|
|
525
|
+
* A column's track. Cells set `min-width: 0` so their text can truncate, which would let a plain
|
|
526
|
+
* `auto` track shrink to nothing and draw columns over each other; a column that does not truncate
|
|
527
|
+
* keeps its content's least width, so a list too wide for its frame scrolls instead.
|
|
528
|
+
*/
|
|
529
|
+
function trackOf(meta) {
|
|
530
|
+
if (typeof meta?.width === "number")
|
|
531
|
+
return `${meta.width}px`;
|
|
532
|
+
if (typeof meta?.width === "string")
|
|
533
|
+
return meta.width;
|
|
534
|
+
if (meta?.truncate || meta?.minWidth !== undefined) {
|
|
535
|
+
return `minmax(${meta.minWidth ?? truncatedColumnMinimum}px, 1fr)`;
|
|
536
|
+
}
|
|
537
|
+
return "minmax(min-content, auto)";
|
|
538
|
+
}
|
|
539
|
+
function headerOf(headers, columnId) {
|
|
540
|
+
const header = headers.find((candidate) => candidate.column.id === columnId);
|
|
541
|
+
if (!header)
|
|
542
|
+
throw new Error(`Header for column ${columnId} not found`);
|
|
543
|
+
return header;
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* Calls the column's cell renderer. TanStack's `FlexRender` mounts a renderer function as a
|
|
547
|
+
* component, so an inline `cell` recreated on each render would remount its cell and drop state
|
|
548
|
+
* such as an open row menu or dialog.
|
|
549
|
+
*/
|
|
550
|
+
function cellContentOf(cells, columnId) {
|
|
551
|
+
const tableCell = cells.find((candidate) => candidate.column.id === columnId);
|
|
552
|
+
if (!tableCell)
|
|
553
|
+
return null;
|
|
554
|
+
const render = tableCell.column.columnDef.cell;
|
|
555
|
+
// TanStack types a cell template's result as `any`; a cell renders React content.
|
|
556
|
+
const content = typeof render === "function" ? render(tableCell.getContext()) : render;
|
|
557
|
+
return content;
|
|
558
|
+
}
|
|
559
|
+
/** Numbers compare numerically; everything else, including dates as ISO strings, in natural order. */
|
|
560
|
+
function compareSortValues(left, right, columnId) {
|
|
561
|
+
const a = left.getValue(columnId) ?? "";
|
|
562
|
+
const b = right.getValue(columnId) ?? "";
|
|
563
|
+
return typeof a === "number" && typeof b === "number"
|
|
564
|
+
? a - b
|
|
565
|
+
: String(a).localeCompare(String(b), undefined, { numeric: true });
|
|
566
|
+
}
|
|
567
|
+
// The frame owns the sideways scroll; a `fill` list also owns the vertical one and pins its head.
|
|
568
|
+
// The surface a pinned cell rebuilds: the list's own surfaces are translucent, so a pinned cell
|
|
569
|
+
// redraws them on the solid canvas, or the columns scrolling under it would show through.
|
|
570
|
+
const frame = css({
|
|
571
|
+
"--row-gap-inline": "token(spacing.layout.pageGap)",
|
|
572
|
+
"--row-pad-inline": "token(spacing.panel.comfortable)",
|
|
573
|
+
"--row-pad-block": "token(spacing.panel.default)",
|
|
574
|
+
"--pinned-background": "token(colors.bg.canvas)",
|
|
575
|
+
"--pinned-layers": "inset 0 0 0 999px token(colors.bg.hover), inset 0 0 0 999px token(colors.bg.panel)",
|
|
576
|
+
position: "relative",
|
|
577
|
+
display: "flex",
|
|
578
|
+
flexDirection: "column",
|
|
579
|
+
width: "100%",
|
|
580
|
+
minWidth: "0",
|
|
581
|
+
overflowX: "auto",
|
|
582
|
+
overflowY: "hidden",
|
|
583
|
+
"&[data-variant=framed]": {
|
|
584
|
+
border: "1px solid token(colors.border.panel)",
|
|
585
|
+
borderRadius: "action",
|
|
586
|
+
background: "bg.hover",
|
|
587
|
+
_light: {
|
|
588
|
+
background: "bg.card",
|
|
589
|
+
"--pinned-background": "token(colors.bg.card)",
|
|
590
|
+
"--pinned-layers": "none",
|
|
591
|
+
},
|
|
592
|
+
},
|
|
593
|
+
"&[data-variant=framed][data-density=compact]": {
|
|
594
|
+
"--row-pad-block": "token(spacing.control.compactBlock)",
|
|
595
|
+
},
|
|
596
|
+
"&[data-variant=plain]": {
|
|
597
|
+
"--row-gap-inline": "0px",
|
|
598
|
+
"--row-pad-inline": "0px",
|
|
599
|
+
"--row-pad-block": "token(spacing.table.rowBlock)",
|
|
600
|
+
"--pinned-layers": "inset 0 0 0 999px token(colors.bg.panel)",
|
|
601
|
+
},
|
|
602
|
+
"&[data-variant=plain][data-density=compact]": {
|
|
603
|
+
"--row-pad-block": "token(spacing.table.compactRowBlock)",
|
|
604
|
+
},
|
|
605
|
+
"&[data-fill]": { flex: "1", minHeight: "0", overflowY: "auto" },
|
|
606
|
+
_phone: { "--row-pad-inline": "token(spacing.panel.default)" },
|
|
607
|
+
});
|
|
608
|
+
const grid = css({
|
|
609
|
+
display: "grid",
|
|
610
|
+
alignContent: "start",
|
|
611
|
+
columnGap: "var(--row-gap-inline)",
|
|
612
|
+
// As wide as the frame, or as its columns' least widths when those outgrow it, so it scrolls.
|
|
613
|
+
width: "100%",
|
|
614
|
+
minWidth: "min-content",
|
|
615
|
+
color: "fg.primary",
|
|
616
|
+
fontSize: "body",
|
|
617
|
+
letterSpacing: "compact",
|
|
618
|
+
"[data-variant=plain] > &": { lineHeight: "compact" },
|
|
619
|
+
// On a phone a stacked list lays each row out as one block: the first cell takes the whole
|
|
620
|
+
// first line and the others wrap under it, an end-aligned one pushed to the far edge.
|
|
621
|
+
_phone: {
|
|
622
|
+
"[data-stacked] > &": {
|
|
623
|
+
display: "block",
|
|
624
|
+
minWidth: "0",
|
|
625
|
+
"& > [role=row]": {
|
|
626
|
+
display: "flex",
|
|
627
|
+
flexWrap: "wrap",
|
|
628
|
+
alignItems: "center",
|
|
629
|
+
columnGap: "layout.controlGap",
|
|
630
|
+
rowGap: "layout.tightGap",
|
|
631
|
+
},
|
|
632
|
+
"& > [role=row]:first-child:has([role=columnheader])": { srOnly: true },
|
|
633
|
+
"& [role=cell]": { display: "block", padding: "0", minWidth: "0" },
|
|
634
|
+
"& [role=cell]:first-child": { flexBasis: "100%" },
|
|
635
|
+
"& [role=cell][data-truncate]": { whiteSpace: "normal", overflowWrap: "anywhere" },
|
|
636
|
+
"& [role=cell][data-align=end]": { marginInlineStart: "auto" },
|
|
637
|
+
},
|
|
638
|
+
},
|
|
639
|
+
});
|
|
640
|
+
const rowBase = {
|
|
641
|
+
display: "grid",
|
|
642
|
+
gridTemplateColumns: "subgrid",
|
|
643
|
+
gridColumn: "1 / -1",
|
|
644
|
+
alignItems: "center",
|
|
645
|
+
paddingInline: "var(--row-pad-inline)",
|
|
646
|
+
borderBottom: "1px solid token(colors.border.panel)",
|
|
647
|
+
"[data-variant=plain] &": { borderBottomColor: "border.subtle" },
|
|
648
|
+
};
|
|
649
|
+
const headRow = css(rowBase, {
|
|
650
|
+
color: "fg.primary",
|
|
651
|
+
fontSize: "code",
|
|
652
|
+
fontWeight: "medium",
|
|
653
|
+
lineHeight: "tight",
|
|
654
|
+
"[data-variant=plain] &": {
|
|
655
|
+
color: "fg.muted",
|
|
656
|
+
fontSize: "caption",
|
|
657
|
+
letterSpacing: "label",
|
|
658
|
+
textTransform: "uppercase",
|
|
659
|
+
},
|
|
660
|
+
"[data-fill] &": {
|
|
661
|
+
position: "sticky",
|
|
662
|
+
top: "0",
|
|
663
|
+
zIndex: "3",
|
|
664
|
+
background: "var(--pinned-background)",
|
|
665
|
+
boxShadow: "var(--pinned-layers)",
|
|
666
|
+
},
|
|
667
|
+
});
|
|
668
|
+
// Stands in for the rows a virtualized list leaves undrawn, so the scroll height holds.
|
|
669
|
+
const spacerRow = css({ gridColumn: "1 / -1" });
|
|
670
|
+
const bodyRow = css(rowBase, {
|
|
671
|
+
position: "relative",
|
|
672
|
+
outline: "none",
|
|
673
|
+
"&:last-child": { borderBottom: "0" },
|
|
674
|
+
"[data-variant=framed][data-density=default] &": {
|
|
675
|
+
minHeight: "calc(token(sizes.control.compact) + var(--row-pad-block) * 2 + 1px)",
|
|
676
|
+
},
|
|
677
|
+
// The row's wash is one layer over every cell, the pinned ones included, so they tint together.
|
|
678
|
+
_after: {
|
|
679
|
+
content: '""',
|
|
680
|
+
position: "absolute",
|
|
681
|
+
inset: "0",
|
|
682
|
+
zIndex: "2",
|
|
683
|
+
background: "var(--row-wash, transparent)",
|
|
684
|
+
pointerEvents: "none",
|
|
685
|
+
transitionProperty: "background",
|
|
686
|
+
transitionDuration: "fast",
|
|
687
|
+
},
|
|
688
|
+
"&[data-pressable]": { cursor: "pointer" },
|
|
689
|
+
"&[data-pressable]:hover": { "--row-wash": "token(colors.bg.rowHover)" },
|
|
690
|
+
"&:is([data-selected], [data-active])": { "--row-wash": "token(colors.bg.selected)" },
|
|
691
|
+
"&:is([data-selected], [data-active]):hover": { "--row-wash": "token(colors.bg.selectedHover)" },
|
|
692
|
+
_focusVisible: { focusRing: "inset", "--row-wash": "token(colors.bg.rowHover)" },
|
|
693
|
+
// Its anchor stands for the row and sits in a cell that may clip, so the row draws the ring.
|
|
694
|
+
"&:has(a[data-row-link]:focus-visible)": {
|
|
695
|
+
focusRing: "inset",
|
|
696
|
+
"--row-wash": "token(colors.bg.rowHover)",
|
|
697
|
+
},
|
|
698
|
+
"& a[data-row-link]:focus-visible": { outline: "none" },
|
|
699
|
+
"& a[data-row-link]:hover": { textDecoration: "none" },
|
|
700
|
+
// Row actions show while the row is pointed at, focused, ticked or open, and always on touch.
|
|
701
|
+
"& [data-row-actions] > *": {
|
|
702
|
+
opacity: "0",
|
|
703
|
+
transitionProperty: "opacity",
|
|
704
|
+
transitionDuration: "fast",
|
|
705
|
+
},
|
|
706
|
+
"&:is(:hover, :focus-within, [data-selected], [data-active]) [data-row-actions] > *, & [data-row-actions]:has([data-popup-open]) > *": { opacity: "1" },
|
|
707
|
+
"@media (hover: none)": { "& [data-row-actions] > *": { opacity: "1" } },
|
|
708
|
+
});
|
|
709
|
+
const groupRow = css(rowBase, {
|
|
710
|
+
minHeight: "40px",
|
|
711
|
+
background: "bg.field",
|
|
712
|
+
"&:last-child": { borderBottom: "0" },
|
|
713
|
+
});
|
|
714
|
+
const emptyRow = css({ gridColumn: "1 / -1" });
|
|
715
|
+
const cellBase = {
|
|
716
|
+
minWidth: "0",
|
|
717
|
+
paddingBlock: "var(--row-pad-block)",
|
|
718
|
+
"[data-variant=plain] &": { paddingInline: "table.cell" },
|
|
719
|
+
"&[data-align=end]": { textAlign: "end", justifyContent: "flex-end" },
|
|
720
|
+
"&[data-align=end] > [data-shape]": { marginInlineStart: "auto" },
|
|
721
|
+
};
|
|
722
|
+
const cell = css(cellBase, {
|
|
723
|
+
fontWeight: "medium",
|
|
724
|
+
"[data-variant=plain] &": { fontWeight: "normal" },
|
|
725
|
+
"& a": { color: "inherit", textDecoration: "none" },
|
|
726
|
+
"& a:hover": { textDecoration: "underline" },
|
|
727
|
+
});
|
|
728
|
+
const headCell = css(cellBase, {
|
|
729
|
+
display: "flex",
|
|
730
|
+
alignItems: "center",
|
|
731
|
+
whiteSpace: "nowrap",
|
|
732
|
+
// A truncating column can be narrower than its heading, which then cuts rather than running
|
|
733
|
+
// into the next column's.
|
|
734
|
+
"&[data-truncate]": { display: "block", overflow: "hidden", textOverflow: "ellipsis" },
|
|
735
|
+
});
|
|
736
|
+
const truncateCell = css({
|
|
737
|
+
overflow: "hidden",
|
|
738
|
+
textOverflow: "ellipsis",
|
|
739
|
+
whiteSpace: "nowrap",
|
|
740
|
+
});
|
|
741
|
+
const selectCell = css({
|
|
742
|
+
display: "flex",
|
|
743
|
+
alignItems: "center",
|
|
744
|
+
alignSelf: "stretch",
|
|
745
|
+
});
|
|
746
|
+
// Only the pinned column stays put while the rest scroll under it. It reaches over the row's
|
|
747
|
+
// padding and the gap after it, so nothing scrolling under it shows round its edges, and redraws
|
|
748
|
+
// the list's surface on the solid canvas.
|
|
749
|
+
const pinnedCell = css({
|
|
750
|
+
position: "sticky",
|
|
751
|
+
zIndex: "1",
|
|
752
|
+
insetInlineStart: "0",
|
|
753
|
+
alignSelf: "stretch",
|
|
754
|
+
display: "flex",
|
|
755
|
+
alignItems: "center",
|
|
756
|
+
marginInlineStart: "calc(var(--row-pad-inline) * -1)",
|
|
757
|
+
marginInlineEnd: "calc(var(--row-gap-inline) * -1)",
|
|
758
|
+
paddingInlineStart: "var(--row-pad-inline)",
|
|
759
|
+
paddingInlineEnd: "var(--row-gap-inline)",
|
|
760
|
+
background: "var(--pinned-background)",
|
|
761
|
+
boxShadow: "var(--pinned-layers)",
|
|
762
|
+
"[role=row] > & + &": {
|
|
763
|
+
insetInlineStart: "var(--data-grid-sticky-offset)",
|
|
764
|
+
marginInlineStart: "0",
|
|
765
|
+
paddingInlineStart: "0",
|
|
766
|
+
},
|
|
767
|
+
"[role=columnheader]&": { zIndex: "4" },
|
|
768
|
+
});
|
|
769
|
+
const actionsCell = css({
|
|
770
|
+
display: "flex",
|
|
771
|
+
alignItems: "center",
|
|
772
|
+
justifyContent: "flex-end",
|
|
773
|
+
gap: "layout.tightGap",
|
|
774
|
+
});
|
|
775
|
+
const groupCell = css({
|
|
776
|
+
minWidth: "0",
|
|
777
|
+
paddingBlock: "panel.compact",
|
|
778
|
+
fontSize: "body",
|
|
779
|
+
fontWeight: "medium",
|
|
780
|
+
});
|
|
781
|
+
const detailCell = css({
|
|
782
|
+
gridColumn: "1 / -1",
|
|
783
|
+
minWidth: "0",
|
|
784
|
+
marginTop: "calc(var(--row-pad-block) * -1)",
|
|
785
|
+
paddingBottom: "var(--row-pad-block)",
|
|
786
|
+
});
|
|
787
|
+
const emptyCell = css({
|
|
788
|
+
padding: "panel.roomy",
|
|
789
|
+
textAlign: "center",
|
|
790
|
+
color: "fg.muted",
|
|
791
|
+
});
|
|
792
|
+
const foldedStack = css({ display: "grid", gap: "layout.tightGap", minWidth: "0" });
|
|
793
|
+
const foldedPrimary = css({ minWidth: "0", overflow: "hidden", textOverflow: "ellipsis" });
|
|
794
|
+
const foldedLine = css({
|
|
795
|
+
display: "flex",
|
|
796
|
+
alignItems: "center",
|
|
797
|
+
flexWrap: "wrap",
|
|
798
|
+
columnGap: "layout.controlGap",
|
|
799
|
+
rowGap: "layout.tightGap",
|
|
800
|
+
minWidth: "0",
|
|
801
|
+
color: "fg.muted",
|
|
802
|
+
fontSize: "code",
|
|
803
|
+
"& > *": { minWidth: "0" },
|
|
804
|
+
});
|
|
805
|
+
const headButton = css({
|
|
806
|
+
display: "inline-flex",
|
|
807
|
+
alignItems: "center",
|
|
808
|
+
gap: "control.iconGap",
|
|
809
|
+
maxWidth: "100%",
|
|
810
|
+
padding: "none",
|
|
811
|
+
border: "0",
|
|
812
|
+
background: "transparent",
|
|
813
|
+
color: "inherit",
|
|
814
|
+
font: "inherit",
|
|
815
|
+
letterSpacing: "inherit",
|
|
816
|
+
textTransform: "inherit",
|
|
817
|
+
cursor: "pointer",
|
|
818
|
+
borderRadius: "control",
|
|
819
|
+
_focusVisible: { focusRing: "outer" },
|
|
820
|
+
"& svg": { flexShrink: "0", color: "fg.muted" },
|
|
821
|
+
"&[data-sorted] svg": { color: "fg.primary" },
|
|
822
|
+
// A plain list's sort toggle shows its caret only while pointed at or sorted.
|
|
823
|
+
// A sort toggle shows its caret only while pointed at or sorted; a head menu's always shows.
|
|
824
|
+
"&[data-toggle] svg": { opacity: "0", transition: "opacity .15s" },
|
|
825
|
+
"&[data-toggle]:is(:hover, :focus-visible, [data-sorted]) svg": { opacity: "1" },
|
|
826
|
+
"[data-align=end] > &": { marginInlineStart: "auto" },
|
|
827
|
+
});
|
|
828
|
+
const columnFilter = css({ display: "flex", flexDirection: "column", width: "260px" });
|
|
829
|
+
const visuallyHidden = css({ srOnly: true });
|