@devalok/shilp-sutra 0.36.0 → 0.37.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MIGRATION.md +346 -0
- package/README.md +26 -29
- package/dist/_chunks/badge-group.js +42 -42
- package/dist/_chunks/badge-group.js.map +1 -1
- package/dist/_chunks/chat.js +324 -327
- package/dist/_chunks/chat.js.map +1 -1
- package/dist/_chunks/date-picker.js +245 -245
- package/dist/_chunks/date-picker.js.map +1 -1
- package/dist/_chunks/document-preview.js +33 -33
- package/dist/_chunks/document-preview.js.map +1 -1
- package/dist/_chunks/file-preview.js +264 -264
- package/dist/_chunks/file-preview.js.map +1 -1
- package/dist/_chunks/image-preview.js +45 -45
- package/dist/_chunks/image-preview.js.map +1 -1
- package/dist/_chunks/mention-suggestion.js +85 -85
- package/dist/_chunks/mention-suggestion.js.map +1 -1
- package/dist/_chunks/motion-provider.js +13 -13
- package/dist/_chunks/motion-provider.js.map +1 -1
- package/dist/_chunks/popover.js +36 -36
- package/dist/_chunks/popover.js.map +1 -1
- package/dist/_chunks/primitives.js +489 -489
- package/dist/_chunks/primitives.js.map +1 -1
- package/dist/_chunks/rich-chat-input.js +1066 -1066
- package/dist/_chunks/rich-chat-input.js.map +1 -1
- package/dist/_chunks/shared.js +43 -43
- package/dist/_chunks/shared.js.map +1 -1
- package/dist/_chunks/text.js +432 -0
- package/dist/_chunks/text.js.map +1 -0
- package/dist/_chunks/tiptap.js +6053 -6187
- package/dist/_chunks/tiptap.js.map +1 -1
- package/dist/_chunks/tree-view.js +97 -97
- package/dist/_chunks/tree-view.js.map +1 -1
- package/dist/_chunks/use-calendar.js.map +1 -1
- package/dist/ai/ai-command-provider.d.ts.map +1 -1
- package/dist/ai/ai-command-provider.js.map +1 -1
- package/dist/ai/block-renderer.d.ts.map +1 -1
- package/dist/ai/block-renderer.js +43 -43
- package/dist/ai/block-renderer.js.map +1 -1
- package/dist/ai/blocks/block-table.d.ts.map +1 -1
- package/dist/ai/blocks/confirm.d.ts.map +1 -1
- package/dist/ai/blocks/divider.d.ts.map +1 -1
- package/dist/ai/blocks/error.d.ts.map +1 -1
- package/dist/ai/blocks/index.d.ts +5 -5
- package/dist/ai/blocks/index.d.ts.map +1 -1
- package/dist/ai/blocks/index.js +2 -2
- package/dist/ai/blocks/info.d.ts.map +1 -1
- package/dist/ai/blocks/loading.d.ts.map +1 -1
- package/dist/ai/blocks/stat-row.d.ts.map +1 -1
- package/dist/ai/blocks/success.d.ts.map +1 -1
- package/dist/ai/blocks/text.d.ts.map +1 -1
- package/dist/ai/command-bar.d.ts +0 -11
- package/dist/ai/command-bar.d.ts.map +1 -1
- package/dist/ai/command-bar.js +128 -128
- package/dist/ai/command-bar.js.map +1 -1
- package/dist/ai/conversation.d.ts +1 -1
- package/dist/ai/conversation.d.ts.map +1 -1
- package/dist/ai/conversation.js +76 -76
- package/dist/ai/conversation.js.map +1 -1
- package/dist/ai/devadoot-icon.d.ts +0 -12
- package/dist/ai/devadoot-icon.d.ts.map +1 -1
- package/dist/ai/index.d.ts +11 -11
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +44 -44
- package/dist/ai/index.js.map +1 -1
- package/dist/composed/activity-feed.d.ts.map +1 -1
- package/dist/composed/activity-feed.js +93 -93
- package/dist/composed/activity-feed.js.map +1 -1
- package/dist/composed/avatar-group.d.ts.map +1 -1
- package/dist/composed/avatar-group.js +50 -50
- package/dist/composed/avatar-group.js.map +1 -1
- package/dist/composed/bulk-action-bar.d.ts.map +1 -1
- package/dist/composed/bulk-action-bar.js +40 -40
- package/dist/composed/bulk-action-bar.js.map +1 -1
- package/dist/composed/command-palette.d.ts +0 -6
- package/dist/composed/command-palette.d.ts.map +1 -1
- package/dist/composed/command-palette.js +131 -131
- package/dist/composed/command-palette.js.map +1 -1
- package/dist/composed/confirm-dialog.d.ts.map +1 -1
- package/dist/composed/confirm-dialog.js.map +1 -1
- package/dist/composed/content-card.d.ts.map +1 -1
- package/dist/composed/content-card.js.map +1 -1
- package/dist/composed/date-picker/calendar-grid.d.ts.map +1 -1
- package/dist/composed/date-picker/date-picker.d.ts.map +1 -1
- package/dist/composed/date-picker/date-range-picker.d.ts.map +1 -1
- package/dist/composed/date-picker/date-time-picker.d.ts.map +1 -1
- package/dist/composed/date-picker/index.d.ts +11 -11
- package/dist/composed/date-picker/index.d.ts.map +1 -1
- package/dist/composed/date-picker/index.js +1 -1
- package/dist/composed/date-picker/month-picker.d.ts.map +1 -1
- package/dist/composed/date-picker/presets.d.ts.map +1 -1
- package/dist/composed/date-picker/time-picker.d.ts.map +1 -1
- package/dist/composed/date-picker/year-picker.d.ts.map +1 -1
- package/dist/composed/deadline-indicator.d.ts.map +1 -1
- package/dist/composed/deadline-indicator.js +25 -25
- package/dist/composed/deadline-indicator.js.map +1 -1
- package/dist/composed/emoji-picker.d.ts.map +1 -1
- package/dist/composed/emoji-picker.js +37 -37
- package/dist/composed/emoji-picker.js.map +1 -1
- package/dist/composed/empty-state.d.ts.map +1 -1
- package/dist/composed/empty-state.js +21 -21
- package/dist/composed/empty-state.js.map +1 -1
- package/dist/composed/error-boundary.d.ts +1 -1
- package/dist/composed/error-boundary.d.ts.map +1 -1
- package/dist/composed/error-boundary.js.map +1 -1
- package/dist/composed/extensions/emoji-node.d.ts.map +1 -1
- package/dist/composed/extensions/emoji-suggestion.d.ts.map +1 -1
- package/dist/composed/extensions/file-attachment.d.ts.map +1 -1
- package/dist/composed/extensions/mention-suggestion.d.ts +1 -1
- package/dist/composed/extensions/mention-suggestion.d.ts.map +1 -1
- package/dist/composed/extensions/slash-command.d.ts +1 -1
- package/dist/composed/extensions/slash-command.d.ts.map +1 -1
- package/dist/composed/file-preview/audio-preview.d.ts.map +1 -1
- package/dist/composed/file-preview/document-preview.d.ts.map +1 -1
- package/dist/composed/file-preview/embed-preview.d.ts.map +1 -1
- package/dist/composed/file-preview/image-preview.d.ts.map +1 -1
- package/dist/composed/file-preview/shared.d.ts.map +1 -1
- package/dist/composed/file-preview/video-preview.d.ts.map +1 -1
- package/dist/composed/file-preview.d.ts.map +1 -1
- package/dist/composed/filter-bar.d.ts +1 -1
- package/dist/composed/filter-bar.d.ts.map +1 -1
- package/dist/composed/filter-bar.js +54 -54
- package/dist/composed/filter-bar.js.map +1 -1
- package/dist/composed/form-section.d.ts.map +1 -1
- package/dist/composed/form-section.js +26 -26
- package/dist/composed/form-section.js.map +1 -1
- package/dist/composed/global-loading.d.ts.map +1 -1
- package/dist/composed/global-loading.js.map +1 -1
- package/dist/composed/index.d.ts +55 -55
- package/dist/composed/index.d.ts.map +1 -1
- package/dist/composed/index.js +17 -17
- package/dist/composed/inline-edit.d.ts.map +1 -1
- package/dist/composed/inline-edit.js.map +1 -1
- package/dist/composed/loading-skeleton.d.ts +1 -1
- package/dist/composed/loading-skeleton.d.ts.map +1 -1
- package/dist/composed/loading-skeleton.js.map +1 -1
- package/dist/composed/markdown-viewer.d.ts.map +1 -1
- package/dist/composed/markdown-viewer.js +3 -3
- package/dist/composed/markdown-viewer.js.map +1 -1
- package/dist/composed/master-detail.d.ts.map +1 -1
- package/dist/composed/master-detail.js +42 -42
- package/dist/composed/master-detail.js.map +1 -1
- package/dist/composed/member-picker.d.ts.map +1 -1
- package/dist/composed/member-picker.js.map +1 -1
- package/dist/composed/multi-select-popover.d.ts.map +1 -1
- package/dist/composed/multi-select-popover.js +55 -55
- package/dist/composed/multi-select-popover.js.map +1 -1
- package/dist/composed/page-header.d.ts.map +1 -1
- package/dist/composed/page-header.js.map +1 -1
- package/dist/composed/page-skeletons.d.ts.map +1 -1
- package/dist/composed/page-skeletons.js.map +1 -1
- package/dist/composed/priority-indicator.d.ts.map +1 -1
- package/dist/composed/priority-indicator.js +34 -34
- package/dist/composed/priority-indicator.js.map +1 -1
- package/dist/composed/responsive-overlay.d.ts.map +1 -1
- package/dist/composed/responsive-overlay.js.map +1 -1
- package/dist/composed/rich-chat-input/attachment-strip.d.ts.map +1 -1
- package/dist/composed/rich-chat-input/audio-player.d.ts.map +1 -1
- package/dist/composed/rich-chat-input/audio-waveform.d.ts.map +1 -1
- package/dist/composed/rich-chat-input/chat-toolbar.d.ts.map +1 -1
- package/dist/composed/rich-chat-input/recording-overlay.d.ts.map +1 -1
- package/dist/composed/rich-chat-input/reply-banner.d.ts.map +1 -1
- package/dist/composed/rich-chat-input/schedule-send.d.ts.map +1 -1
- package/dist/composed/rich-chat-input.d.ts +6 -6
- package/dist/composed/rich-chat-input.d.ts.map +1 -1
- package/dist/composed/rich-chat-input.js +1 -1
- package/dist/composed/rich-text-editor.d.ts.map +1 -1
- package/dist/composed/rich-text-editor.js +25 -25
- package/dist/composed/rich-text-editor.js.map +1 -1
- package/dist/composed/schedule-view.d.ts.map +1 -1
- package/dist/composed/schedule-view.js +53 -53
- package/dist/composed/schedule-view.js.map +1 -1
- package/dist/composed/simple-tooltip.d.ts.map +1 -1
- package/dist/composed/simple-tooltip.js.map +1 -1
- package/dist/composed/status-badge.d.ts +1 -1
- package/dist/composed/status-badge.d.ts.map +1 -1
- package/dist/composed/status-badge.js +30 -30
- package/dist/composed/status-badge.js.map +1 -1
- package/dist/hooks/index.d.ts +3 -3
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/use-color-mode.js.map +1 -1
- package/dist/hooks/use-toast.d.ts +1 -1
- package/dist/hooks/use-toast.d.ts.map +1 -1
- package/dist/motion/index.d.ts +2 -2
- package/dist/motion/index.d.ts.map +1 -1
- package/dist/motion/index.js.map +1 -1
- package/dist/motion/motion-provider.d.ts +1 -1
- package/dist/motion/motion-provider.d.ts.map +1 -1
- package/dist/motion/primitives-index.d.ts +1 -1
- package/dist/motion/primitives-index.d.ts.map +1 -1
- package/dist/motion/primitives-index.js +40 -40
- package/dist/motion/primitives-index.js.map +1 -1
- package/dist/motion/primitives.d.ts +1 -1
- package/dist/motion/primitives.d.ts.map +1 -1
- package/dist/shell/app-command-palette.d.ts +0 -8
- package/dist/shell/app-command-palette.d.ts.map +1 -1
- package/dist/shell/app-command-palette.js.map +1 -1
- package/dist/shell/bottom-navbar.d.ts +0 -6
- package/dist/shell/bottom-navbar.d.ts.map +1 -1
- package/dist/shell/bottom-navbar.js +62 -62
- package/dist/shell/bottom-navbar.js.map +1 -1
- package/dist/shell/index.d.ts +8 -8
- package/dist/shell/index.d.ts.map +1 -1
- package/dist/shell/index.js +5 -5
- package/dist/shell/link-context.d.ts +1 -1
- package/dist/shell/link-context.d.ts.map +1 -1
- package/dist/shell/notification-center.d.ts +0 -6
- package/dist/shell/notification-center.d.ts.map +1 -1
- package/dist/shell/notification-center.js +54 -54
- package/dist/shell/notification-center.js.map +1 -1
- package/dist/shell/notification-preferences.d.ts +0 -6
- package/dist/shell/notification-preferences.d.ts.map +1 -1
- package/dist/shell/notification-preferences.js +22 -22
- package/dist/shell/notification-preferences.js.map +1 -1
- package/dist/shell/sidebar.d.ts.map +1 -1
- package/dist/shell/sidebar.js.map +1 -1
- package/dist/shell/top-bar.d.ts +0 -6
- package/dist/shell/top-bar.d.ts.map +1 -1
- package/dist/shell/top-bar.js.map +1 -1
- package/dist/tailwind/index.cjs +15 -499
- package/dist/tailwind/preset.d.ts +21 -0
- package/dist/tailwind/preset.d.ts.map +1 -1
- package/dist/tailwind/preset.js +14 -489
- package/dist/tailwind/preset.js.map +1 -1
- package/dist/tokens/animations.css +17 -0
- package/dist/tokens/base.css +26 -0
- package/dist/tokens/index.css +22 -0
- package/dist/tokens/semantic.css +436 -464
- package/dist/tokens/shilp-sutra.css +41 -0
- package/dist/tokens/typography-semantic.css +48 -41
- package/dist/tokens/utilities.css +276 -0
- package/dist/tokens/variants.css +14 -0
- package/dist/ui/accordion.d.ts +2 -2
- package/dist/ui/accordion.d.ts.map +1 -1
- package/dist/ui/accordion.js +23 -23
- package/dist/ui/accordion.js.map +1 -1
- package/dist/ui/alert-dialog.d.ts +2 -2
- package/dist/ui/alert-dialog.d.ts.map +1 -1
- package/dist/ui/alert-dialog.js +37 -37
- package/dist/ui/alert-dialog.js.map +1 -1
- package/dist/ui/alert.d.ts.map +1 -1
- package/dist/ui/alert.js +36 -36
- package/dist/ui/alert.js.map +1 -1
- package/dist/ui/aspect-ratio.d.ts +1 -1
- package/dist/ui/aspect-ratio.d.ts.map +1 -1
- package/dist/ui/aspect-ratio.js.map +1 -1
- package/dist/ui/autocomplete.d.ts +1 -1
- package/dist/ui/autocomplete.d.ts.map +1 -1
- package/dist/ui/autocomplete.js +27 -27
- package/dist/ui/autocomplete.js.map +1 -1
- package/dist/ui/avatar.d.ts +2 -2
- package/dist/ui/avatar.d.ts.map +1 -1
- package/dist/ui/avatar.js +41 -41
- package/dist/ui/avatar.js.map +1 -1
- package/dist/ui/badge-group.d.ts.map +1 -1
- package/dist/ui/badge-indicator.d.ts.map +1 -1
- package/dist/ui/badge-indicator.js +10 -10
- package/dist/ui/badge-indicator.js.map +1 -1
- package/dist/ui/badge.d.ts +2 -2
- package/dist/ui/badge.d.ts.map +1 -1
- package/dist/ui/banner.d.ts.map +1 -1
- package/dist/ui/banner.js +28 -28
- package/dist/ui/banner.js.map +1 -1
- package/dist/ui/breadcrumb.d.ts +1 -1
- package/dist/ui/breadcrumb.d.ts.map +1 -1
- package/dist/ui/breadcrumb.js.map +1 -1
- package/dist/ui/button-group.d.ts.map +1 -1
- package/dist/ui/button-group.js.map +1 -1
- package/dist/ui/button-processing.d.ts.map +1 -1
- package/dist/ui/button-processing.js +15 -15
- package/dist/ui/button-processing.js.map +1 -1
- package/dist/ui/button.d.ts.map +1 -1
- package/dist/ui/button.js +84 -84
- package/dist/ui/button.js.map +1 -1
- package/dist/ui/card.d.ts +1 -1
- package/dist/ui/card.d.ts.map +1 -1
- package/dist/ui/card.js +28 -28
- package/dist/ui/card.js.map +1 -1
- package/dist/ui/charts/_internal/axes.d.ts +1 -1
- package/dist/ui/charts/_internal/axes.d.ts.map +1 -1
- package/dist/ui/charts/_internal/grid-lines.d.ts.map +1 -1
- package/dist/ui/charts/_internal/legend.d.ts.map +1 -1
- package/dist/ui/charts/_internal/tooltip.d.ts +1 -1
- package/dist/ui/charts/_internal/tooltip.d.ts.map +1 -1
- package/dist/ui/charts/area-chart.d.ts.map +1 -1
- package/dist/ui/charts/bar-chart.d.ts +1 -1
- package/dist/ui/charts/bar-chart.d.ts.map +1 -1
- package/dist/ui/charts/chart-container.d.ts.map +1 -1
- package/dist/ui/charts/gauge-chart.d.ts.map +1 -1
- package/dist/ui/charts/index.d.ts +5 -5
- package/dist/ui/charts/index.d.ts.map +1 -1
- package/dist/ui/charts/index.js +618 -618
- package/dist/ui/charts/index.js.map +1 -1
- package/dist/ui/charts/line-chart.d.ts.map +1 -1
- package/dist/ui/charts/pie-chart.d.ts.map +1 -1
- package/dist/ui/charts/radar-chart.d.ts.map +1 -1
- package/dist/ui/charts/sparkline.d.ts.map +1 -1
- package/dist/ui/chat/date-separator.d.ts.map +1 -1
- package/dist/ui/chat/index.d.ts +4 -4
- package/dist/ui/chat/index.d.ts.map +1 -1
- package/dist/ui/chat/index.js +1 -1
- package/dist/ui/chat/message-input.d.ts.map +1 -1
- package/dist/ui/chat/message-list.d.ts.map +1 -1
- package/dist/ui/chat/message.d.ts +1 -1
- package/dist/ui/chat/message.d.ts.map +1 -1
- package/dist/ui/chat/system-message.d.ts.map +1 -1
- package/dist/ui/chat/typing-indicator.d.ts.map +1 -1
- package/dist/ui/chat/unread-separator.d.ts.map +1 -1
- package/dist/ui/checkbox.d.ts.map +1 -1
- package/dist/ui/checkbox.js +18 -18
- package/dist/ui/checkbox.js.map +1 -1
- package/dist/ui/code.d.ts.map +1 -1
- package/dist/ui/code.js.map +1 -1
- package/dist/ui/collapsible.d.ts +2 -2
- package/dist/ui/collapsible.d.ts.map +1 -1
- package/dist/ui/collapsible.js +10 -10
- package/dist/ui/collapsible.js.map +1 -1
- package/dist/ui/color-input.d.ts.map +1 -1
- package/dist/ui/color-input.js +85 -85
- package/dist/ui/color-input.js.map +1 -1
- package/dist/ui/color-swatch.d.ts.map +1 -1
- package/dist/ui/color-swatch.js.map +1 -1
- package/dist/ui/combobox.d.ts.map +1 -1
- package/dist/ui/combobox.js +58 -58
- package/dist/ui/combobox.js.map +1 -1
- package/dist/ui/container.d.ts.map +1 -1
- package/dist/ui/container.js.map +1 -1
- package/dist/ui/context-menu.d.ts +2 -2
- package/dist/ui/context-menu.d.ts.map +1 -1
- package/dist/ui/context-menu.js +47 -47
- package/dist/ui/context-menu.js.map +1 -1
- package/dist/ui/data-table-body.d.ts +1 -1
- package/dist/ui/data-table-body.d.ts.map +1 -1
- package/dist/ui/data-table-body.js +43 -43
- package/dist/ui/data-table-body.js.map +1 -1
- package/dist/ui/data-table-bulk-actions.js.map +1 -1
- package/dist/ui/data-table-card.d.ts.map +1 -1
- package/dist/ui/data-table-card.js +7 -7
- package/dist/ui/data-table-card.js.map +1 -1
- package/dist/ui/data-table-context.d.ts +1 -1
- package/dist/ui/data-table-context.d.ts.map +1 -1
- package/dist/ui/data-table-context.js.map +1 -1
- package/dist/ui/data-table-header.js +38 -38
- package/dist/ui/data-table-header.js.map +1 -1
- package/dist/ui/data-table-pagination.js.map +1 -1
- package/dist/ui/data-table-toolbar.d.ts.map +1 -1
- package/dist/ui/data-table-toolbar.js.map +1 -1
- package/dist/ui/data-table.d.ts +2 -2
- package/dist/ui/data-table.d.ts.map +1 -1
- package/dist/ui/data-table.js +5 -5
- package/dist/ui/data-table.js.map +1 -1
- package/dist/ui/devalok-grain.js +8 -8
- package/dist/ui/devalok-grain.js.map +1 -1
- package/dist/ui/dialog.d.ts +2 -2
- package/dist/ui/dialog.d.ts.map +1 -1
- package/dist/ui/dialog.js +41 -41
- package/dist/ui/dialog.js.map +1 -1
- package/dist/ui/dropdown-menu.d.ts +2 -2
- package/dist/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/ui/dropdown-menu.js +46 -46
- package/dist/ui/dropdown-menu.js.map +1 -1
- package/dist/ui/file-upload.d.ts.map +1 -1
- package/dist/ui/file-upload.js +54 -54
- package/dist/ui/file-upload.js.map +1 -1
- package/dist/ui/form.d.ts.map +1 -1
- package/dist/ui/form.js +17 -17
- package/dist/ui/form.js.map +1 -1
- package/dist/ui/hover-card.d.ts +2 -2
- package/dist/ui/hover-card.d.ts.map +1 -1
- package/dist/ui/hover-card.js +19 -19
- package/dist/ui/hover-card.js.map +1 -1
- package/dist/ui/icon-button.d.ts.map +1 -1
- package/dist/ui/icon-button.js.map +1 -1
- package/dist/ui/icon-group.d.ts.map +1 -1
- package/dist/ui/icon-group.js +4 -4
- package/dist/ui/icon-group.js.map +1 -1
- package/dist/ui/icon.d.ts.map +1 -1
- package/dist/ui/icon.js +32 -32
- package/dist/ui/icon.js.map +1 -1
- package/dist/ui/index.d.ts +57 -57
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +27 -27
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/input-otp.d.ts +1 -1
- package/dist/ui/input-otp.d.ts.map +1 -1
- package/dist/ui/input-otp.js.map +1 -1
- package/dist/ui/input.d.ts.map +1 -1
- package/dist/ui/input.js +14 -14
- package/dist/ui/input.js.map +1 -1
- package/dist/ui/label.d.ts +1 -1
- package/dist/ui/label.d.ts.map +1 -1
- package/dist/ui/label.js.map +1 -1
- package/dist/ui/lib/bottom-sheet.d.ts.map +1 -1
- package/dist/ui/lib/index.d.ts +4 -4
- package/dist/ui/lib/index.d.ts.map +1 -1
- package/dist/ui/lib/slot.d.ts +1 -1
- package/dist/ui/lib/slot.d.ts.map +1 -1
- package/dist/ui/lib/utils.d.ts.map +1 -1
- package/dist/ui/lib/utils.js.map +1 -1
- package/dist/ui/link.d.ts.map +1 -1
- package/dist/ui/link.js.map +1 -1
- package/dist/ui/menubar.d.ts +2 -2
- package/dist/ui/menubar.d.ts.map +1 -1
- package/dist/ui/menubar.js +64 -64
- package/dist/ui/menubar.js.map +1 -1
- package/dist/ui/navigation-menu.d.ts +2 -2
- package/dist/ui/navigation-menu.d.ts.map +1 -1
- package/dist/ui/navigation-menu.js +72 -72
- package/dist/ui/navigation-menu.js.map +1 -1
- package/dist/ui/number-input.d.ts.map +1 -1
- package/dist/ui/number-input.js.map +1 -1
- package/dist/ui/pagination.d.ts +1 -1
- package/dist/ui/pagination.d.ts.map +1 -1
- package/dist/ui/pagination.js.map +1 -1
- package/dist/ui/popover.d.ts +2 -2
- package/dist/ui/popover.d.ts.map +1 -1
- package/dist/ui/progress-ring.d.ts +1 -1
- package/dist/ui/progress-ring.d.ts.map +1 -1
- package/dist/ui/progress-ring.js +33 -33
- package/dist/ui/progress-ring.js.map +1 -1
- package/dist/ui/progress.d.ts +2 -2
- package/dist/ui/progress.d.ts.map +1 -1
- package/dist/ui/progress.js +23 -23
- package/dist/ui/progress.js.map +1 -1
- package/dist/ui/radio.d.ts.map +1 -1
- package/dist/ui/radio.js +19 -19
- package/dist/ui/radio.js.map +1 -1
- package/dist/ui/search-input.d.ts.map +1 -1
- package/dist/ui/search-input.js +17 -17
- package/dist/ui/search-input.js.map +1 -1
- package/dist/ui/segmented-control.d.ts.map +1 -1
- package/dist/ui/segmented-control.js +19 -19
- package/dist/ui/segmented-control.js.map +1 -1
- package/dist/ui/select.d.ts +2 -2
- package/dist/ui/select.d.ts.map +1 -1
- package/dist/ui/select.js +68 -68
- package/dist/ui/select.js.map +1 -1
- package/dist/ui/separator.d.ts +1 -1
- package/dist/ui/separator.d.ts.map +1 -1
- package/dist/ui/separator.js.map +1 -1
- package/dist/ui/sheet.d.ts +2 -2
- package/dist/ui/sheet.d.ts.map +1 -1
- package/dist/ui/sheet.js +44 -44
- package/dist/ui/sheet.js.map +1 -1
- package/dist/ui/sidebar.d.ts +1 -1
- package/dist/ui/sidebar.d.ts.map +1 -1
- package/dist/ui/sidebar.js +156 -156
- package/dist/ui/sidebar.js.map +1 -1
- package/dist/ui/skeleton.d.ts +1 -1
- package/dist/ui/skeleton.d.ts.map +1 -1
- package/dist/ui/skeleton.js +2 -2
- package/dist/ui/skeleton.js.map +1 -1
- package/dist/ui/slider.d.ts +2 -2
- package/dist/ui/slider.d.ts.map +1 -1
- package/dist/ui/slider.js +5 -5
- package/dist/ui/slider.js.map +1 -1
- package/dist/ui/spinner.d.ts.map +1 -1
- package/dist/ui/spinner.js +21 -21
- package/dist/ui/spinner.js.map +1 -1
- package/dist/ui/split-button.d.ts +1 -1
- package/dist/ui/split-button.d.ts.map +1 -1
- package/dist/ui/split-button.js +28 -28
- package/dist/ui/split-button.js.map +1 -1
- package/dist/ui/stack.d.ts +1 -1
- package/dist/ui/stack.d.ts.map +1 -1
- package/dist/ui/stack.js.map +1 -1
- package/dist/ui/stat-card.d.ts.map +1 -1
- package/dist/ui/stat-card.js +73 -73
- package/dist/ui/stat-card.js.map +1 -1
- package/dist/ui/status-dot.d.ts.map +1 -1
- package/dist/ui/status-dot.js.map +1 -1
- package/dist/ui/stepper.d.ts +1 -1
- package/dist/ui/stepper.d.ts.map +1 -1
- package/dist/ui/stepper.js +48 -48
- package/dist/ui/stepper.js.map +1 -1
- package/dist/ui/switch.d.ts +1 -1
- package/dist/ui/switch.d.ts.map +1 -1
- package/dist/ui/switch.js +15 -15
- package/dist/ui/switch.js.map +1 -1
- package/dist/ui/table.d.ts +1 -1
- package/dist/ui/table.d.ts.map +1 -1
- package/dist/ui/table.js.map +1 -1
- package/dist/ui/tabs.d.ts +2 -2
- package/dist/ui/tabs.d.ts.map +1 -1
- package/dist/ui/tabs.js +52 -52
- package/dist/ui/tabs.js.map +1 -1
- package/dist/ui/text.d.ts +1 -1
- package/dist/ui/text.d.ts.map +1 -1
- package/dist/ui/text.js.map +1 -1
- package/dist/ui/textarea.d.ts.map +1 -1
- package/dist/ui/textarea.js +13 -13
- package/dist/ui/textarea.js.map +1 -1
- package/dist/ui/toast-registry.js.map +1 -1
- package/dist/ui/toast.d.ts +3 -3
- package/dist/ui/toast.d.ts.map +1 -1
- package/dist/ui/toast.js +164 -164
- package/dist/ui/toast.js.map +1 -1
- package/dist/ui/toaster.d.ts.map +1 -1
- package/dist/ui/toaster.js +6 -6
- package/dist/ui/toaster.js.map +1 -1
- package/dist/ui/toggle-group.d.ts +1 -1
- package/dist/ui/toggle-group.d.ts.map +1 -1
- package/dist/ui/toggle-group.js.map +1 -1
- package/dist/ui/toggle.d.ts +1 -1
- package/dist/ui/toggle.d.ts.map +1 -1
- package/dist/ui/toggle.js +14 -14
- package/dist/ui/toggle.js.map +1 -1
- package/dist/ui/tooltip.d.ts +2 -2
- package/dist/ui/tooltip.d.ts.map +1 -1
- package/dist/ui/tooltip.js +26 -26
- package/dist/ui/tooltip.js.map +1 -1
- package/dist/ui/tree-view/index.d.ts +2 -2
- package/dist/ui/tree-view/index.d.ts.map +1 -1
- package/dist/ui/tree-view/index.js +1 -1
- package/dist/ui/tree-view/tree-view.d.ts +1 -1
- package/dist/ui/tree-view/tree-view.d.ts.map +1 -1
- package/dist/ui/visually-hidden.d.ts.map +1 -1
- package/dist/ui/visually-hidden.js.map +1 -1
- package/docs/components/_header.md +96 -0
- package/docs/rollback.md +179 -0
- package/llms-full.txt +97 -1
- package/llms.txt +24 -2
- package/package.json +296 -277
- package/dist/_chunks/framer.js +0 -5604
- package/dist/_chunks/framer.js.map +0 -1
- package/dist/_chunks/rolldown-runtime.js +0 -21
- package/dist/_chunks/sonner.js +0 -616
- package/dist/_chunks/sonner.js.map +0 -1
- package/dist/_chunks/stat-row.js +0 -432
- package/dist/_chunks/stat-row.js.map +0 -1
|
@@ -1,145 +1,145 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { n as o } from "../_chunks/link-context.js";
|
|
2
|
+
import { springs as e } from "../ui/lib/motion.js";
|
|
3
|
+
import { cn as t } from "../ui/lib/utils.js";
|
|
4
|
+
import { Icon as n } from "../ui/icon.js";
|
|
5
|
+
import { n as r } from "../_chunks/link-context.js";
|
|
7
6
|
import "./link-context.js";
|
|
8
|
-
import * as
|
|
9
|
-
import { useCallback as
|
|
10
|
-
import { Fragment as
|
|
11
|
-
import { IconDots as
|
|
7
|
+
import * as i from "react";
|
|
8
|
+
import { useCallback as a, useEffect as o, useRef as s, useState as c } from "react";
|
|
9
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
10
|
+
import { IconDots as f, IconX as p } from "@tabler/icons-react";
|
|
11
|
+
import { AnimatePresence as m, motion as h, useReducedMotion as g } from "framer-motion";
|
|
12
12
|
//#region src/shell/bottom-navbar.tsx
|
|
13
13
|
function _({ count: e }) {
|
|
14
14
|
if (!e || e <= 0) return null;
|
|
15
|
-
let
|
|
16
|
-
return /* @__PURE__ */
|
|
15
|
+
let n = e > 99 ? "99+" : String(e), r = e >= 10;
|
|
16
|
+
return /* @__PURE__ */ u("span", {
|
|
17
17
|
"aria-label": `${e} notifications`,
|
|
18
|
-
className:
|
|
19
|
-
children:
|
|
18
|
+
className: t("absolute -right-1 -top-0.5 flex h-4 min-w-4 items-center justify-center rounded-full bg-error-9 text-[10px] font-semibold leading-none text-error-fg animate-in zoom-in-75", r ? "px-0.5" : ""),
|
|
19
|
+
children: n
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
|
-
function v({ item:
|
|
23
|
-
let
|
|
24
|
-
return /* @__PURE__ */
|
|
25
|
-
whileTap:
|
|
26
|
-
transition:
|
|
22
|
+
function v({ item: n, isActive: i, onClick: a }) {
|
|
23
|
+
let o = r(), s = g();
|
|
24
|
+
return /* @__PURE__ */ u(h.div, {
|
|
25
|
+
whileTap: s ? void 0 : { y: -2 },
|
|
26
|
+
transition: s ? { duration: 0 } : e.snappy,
|
|
27
27
|
className: "flex max-w-[70px] flex-1",
|
|
28
|
-
children: /* @__PURE__ */
|
|
29
|
-
href:
|
|
30
|
-
onClick:
|
|
31
|
-
"aria-label":
|
|
32
|
-
"aria-current":
|
|
33
|
-
className:
|
|
34
|
-
children: /* @__PURE__ */
|
|
28
|
+
children: /* @__PURE__ */ u(o, {
|
|
29
|
+
href: n.href,
|
|
30
|
+
onClick: a,
|
|
31
|
+
"aria-label": n.title,
|
|
32
|
+
"aria-current": i ? "page" : void 0,
|
|
33
|
+
className: t("flex h-16 w-full cursor-pointer flex-col items-center gap-ds-02 p-ds-02 pt-0 text-ds-sm transition-colors duration-fast-02 ease-productive-standard", i ? "font-semibold text-accent-11" : "text-surface-fg-subtle"),
|
|
34
|
+
children: /* @__PURE__ */ d("div", {
|
|
35
35
|
className: "relative flex w-full flex-col items-center gap-ds-02",
|
|
36
36
|
children: [
|
|
37
|
-
|
|
37
|
+
i && /* @__PURE__ */ u(h.div, {
|
|
38
38
|
layoutId: "bottom-nav-indicator",
|
|
39
39
|
className: "absolute top-0 h-[3px] w-full rounded-b-ds-sm bg-accent-9 p-0",
|
|
40
40
|
"aria-hidden": "true",
|
|
41
|
-
transition:
|
|
41
|
+
transition: s ? { duration: 0 } : e.snappy
|
|
42
42
|
}),
|
|
43
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ d("div", {
|
|
44
44
|
className: "relative p-ds-03",
|
|
45
|
-
children: [/* @__PURE__ */
|
|
45
|
+
children: [/* @__PURE__ */ u("span", {
|
|
46
46
|
className: "[&>svg]:h-ico-md [&>svg]:w-ico-md",
|
|
47
47
|
"aria-hidden": "true",
|
|
48
|
-
children:
|
|
49
|
-
}),
|
|
48
|
+
children: n.icon
|
|
49
|
+
}), n.badge != null && /* @__PURE__ */ u(_, { count: n.badge })]
|
|
50
50
|
}),
|
|
51
|
-
/* @__PURE__ */
|
|
51
|
+
/* @__PURE__ */ u("span", {
|
|
52
52
|
className: "text-center",
|
|
53
|
-
children:
|
|
53
|
+
children: n.title
|
|
54
54
|
})
|
|
55
55
|
]
|
|
56
56
|
})
|
|
57
57
|
})
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
|
-
var y =
|
|
61
|
-
let w =
|
|
62
|
-
|
|
60
|
+
var y = i.forwardRef(({ currentPath: i = "/", user: _, primaryItems: y = [], moreItems: b = [], className: x, ...S }, C) => {
|
|
61
|
+
let w = r(), T = g(), [E, D] = c(!1), O = s(null), k = a(() => D(!1), []);
|
|
62
|
+
o(() => {
|
|
63
63
|
E && O.current && O.current.querySelector("a, button")?.focus();
|
|
64
64
|
}, [E]);
|
|
65
|
-
let A = (e, t = !1) => t || e === "/" ?
|
|
66
|
-
return /* @__PURE__ */
|
|
65
|
+
let A = (e, t = !1) => t || e === "/" ? i === e : i.startsWith(e), j = b.some((e) => A(e.href, e.exact));
|
|
66
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(m, { children: E && /* @__PURE__ */ d("div", {
|
|
67
67
|
className: "fixed inset-0 z-overlay md:hidden",
|
|
68
68
|
onClick: () => D(!1),
|
|
69
|
-
children: [/* @__PURE__ */
|
|
69
|
+
children: [/* @__PURE__ */ u("div", { className: "absolute inset-0 bg-overlay" }), /* @__PURE__ */ d(h.div, {
|
|
70
70
|
ref: O,
|
|
71
71
|
role: "dialog",
|
|
72
72
|
"aria-label": "More navigation",
|
|
73
73
|
initial: { y: "100%" },
|
|
74
74
|
animate: { y: 0 },
|
|
75
75
|
exit: { y: "100%" },
|
|
76
|
-
transition: T ? { duration: 0 } :
|
|
76
|
+
transition: T ? { duration: 0 } : e.smooth,
|
|
77
77
|
className: "absolute bottom-[72px] left-0 right-0 rounded-t-ds-2xl border-t border-surface-border-strong bg-surface-overlay p-ds-05 pb-ds-03",
|
|
78
78
|
onClick: (e) => e.stopPropagation(),
|
|
79
79
|
onKeyDown: (e) => {
|
|
80
80
|
e.stopPropagation(), e.key === "Escape" && k();
|
|
81
81
|
},
|
|
82
|
-
children: [/* @__PURE__ */
|
|
82
|
+
children: [/* @__PURE__ */ d("div", {
|
|
83
83
|
className: "mb-ds-04 flex items-center justify-between",
|
|
84
|
-
children: [/* @__PURE__ */
|
|
84
|
+
children: [/* @__PURE__ */ u("span", {
|
|
85
85
|
className: "text-ds-md font-semibold text-surface-fg",
|
|
86
86
|
children: "More"
|
|
87
|
-
}), /* @__PURE__ */
|
|
87
|
+
}), /* @__PURE__ */ u("button", {
|
|
88
88
|
onClick: () => D(!1),
|
|
89
89
|
"aria-label": "Close more menu",
|
|
90
90
|
className: "flex h-ds-sm w-ds-sm items-center justify-center rounded-ds-full hover:bg-surface-raised-hover",
|
|
91
|
-
children: /* @__PURE__ */
|
|
92
|
-
icon:
|
|
91
|
+
children: /* @__PURE__ */ u(n, {
|
|
92
|
+
icon: p,
|
|
93
93
|
size: "sm",
|
|
94
94
|
className: "text-surface-fg-muted"
|
|
95
95
|
})
|
|
96
96
|
})]
|
|
97
|
-
}), /* @__PURE__ */
|
|
97
|
+
}), /* @__PURE__ */ u("div", {
|
|
98
98
|
className: "grid grid-cols-4 gap-ds-03",
|
|
99
|
-
children: b.map((e) => /* @__PURE__ */
|
|
99
|
+
children: b.map((e) => /* @__PURE__ */ d(w, {
|
|
100
100
|
href: e.href,
|
|
101
101
|
onClick: () => D(!1),
|
|
102
|
-
className:
|
|
103
|
-
children: [/* @__PURE__ */
|
|
102
|
+
className: t("flex flex-col items-center gap-ds-02b rounded-ds-xl p-ds-04 text-ds-sm transition-colors ease-productive-standard", A(e.href, e.exact) ? "bg-surface-raised-hover text-accent-11" : "text-surface-fg-subtle hover:bg-surface-raised-hover"),
|
|
103
|
+
children: [/* @__PURE__ */ u("span", {
|
|
104
104
|
className: "[&>svg]:h-ico-md [&>svg]:w-ico-md",
|
|
105
105
|
children: e.icon
|
|
106
|
-
}), /* @__PURE__ */
|
|
106
|
+
}), /* @__PURE__ */ u("span", {
|
|
107
107
|
className: "text-center",
|
|
108
108
|
children: e.title
|
|
109
109
|
})]
|
|
110
110
|
}, e.href))
|
|
111
111
|
})]
|
|
112
112
|
})]
|
|
113
|
-
}) }), /* @__PURE__ */
|
|
113
|
+
}) }), /* @__PURE__ */ d("nav", {
|
|
114
114
|
...S,
|
|
115
115
|
ref: C,
|
|
116
116
|
"aria-label": "Mobile navigation",
|
|
117
|
-
className:
|
|
118
|
-
children: [y.map((e) => /* @__PURE__ */
|
|
117
|
+
className: t("fixed bottom-0 left-0 right-0 z-sticky flex w-full flex-row items-start justify-between border-t border-surface-border-strong bg-surface-raised px-ds-05 pb-safe pt-0 md:hidden", x),
|
|
118
|
+
children: [y.map((e) => /* @__PURE__ */ u(v, {
|
|
119
119
|
item: e,
|
|
120
120
|
isActive: A(e.href, e.exact)
|
|
121
|
-
}, e.href)), b.length > 0 && /* @__PURE__ */
|
|
121
|
+
}, e.href)), b.length > 0 && /* @__PURE__ */ u(h.button, {
|
|
122
122
|
type: "button",
|
|
123
123
|
onClick: () => D(!E),
|
|
124
124
|
"aria-label": "More navigation options",
|
|
125
125
|
"aria-expanded": E,
|
|
126
126
|
whileTap: T ? void 0 : { y: -2 },
|
|
127
|
-
transition: T ? { duration: 0 } :
|
|
128
|
-
className:
|
|
129
|
-
children: /* @__PURE__ */
|
|
127
|
+
transition: T ? { duration: 0 } : e.snappy,
|
|
128
|
+
className: t("flex h-16 max-w-[70px] flex-1 cursor-pointer flex-col items-center gap-ds-02 p-ds-02 pt-0 text-ds-sm", E || j ? "font-semibold text-accent-11" : "text-surface-fg-subtle"),
|
|
129
|
+
children: /* @__PURE__ */ d("div", {
|
|
130
130
|
className: "relative flex w-full flex-col items-center gap-ds-02",
|
|
131
131
|
children: [
|
|
132
|
-
(E || j) && /* @__PURE__ */
|
|
132
|
+
(E || j) && /* @__PURE__ */ u(h.div, {
|
|
133
133
|
layoutId: "bottom-nav-indicator",
|
|
134
134
|
className: "absolute top-0 h-[3px] w-full rounded-b-ds-sm bg-accent-9 p-0",
|
|
135
135
|
"aria-hidden": "true",
|
|
136
|
-
transition: T ? { duration: 0 } :
|
|
136
|
+
transition: T ? { duration: 0 } : e.snappy
|
|
137
137
|
}),
|
|
138
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ u("div", {
|
|
139
139
|
className: "p-ds-03",
|
|
140
|
-
children: /* @__PURE__ */
|
|
140
|
+
children: /* @__PURE__ */ u(n, { icon: f })
|
|
141
141
|
}),
|
|
142
|
-
/* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ u("span", {
|
|
143
143
|
className: "text-center",
|
|
144
144
|
children: "More"
|
|
145
145
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bottom-navbar.js","names":[],"sources":["../../src/shell/bottom-navbar.tsx"],"sourcesContent":["'use client'\n\n/**\n * BottomNavbar -- Mobile bottom navigation bar.\n *\n * Props-driven: accepts currentPath, user, navItems instead of\n * reading from Remix hooks or Zustand stores.\n */\nimport * as React from 'react'\nimport { useLink } from './link-context'\nimport { useState, useEffect, useRef, useCallback } from 'react'\nimport { IconDots, IconX } from '@tabler/icons-react'\nimport { Icon } from '../ui/icon'\nimport { cn } from '../ui/lib/utils'\nimport { motion, AnimatePresence, useReducedMotion } from 'framer-motion'\nimport { springs } from '../ui/lib/motion'\n\n// -----------------------------------------------------------------------\n// Types\n// -----------------------------------------------------------------------\n\nexport interface BottomNavItem {\n title: string\n href: string\n icon: React.ReactNode\n /** When true, the route matches only when the path is exactly equal */\n exact?: boolean\n /** Notification badge count. 0 or undefined = hidden, 1–99 = shown, >99 = \"99+\" */\n badge?: number\n}\n\nexport interface BottomNavbarUser {\n name: string\n role?: string\n}\n\nexport interface BottomNavbarProps\n extends React.HTMLAttributes<HTMLElement> {\n /** Currently active pathname */\n currentPath?: string\n /** User information (used to determine admin status, presence) */\n user?: BottomNavbarUser | null\n /** Primary nav items shown directly in the bottom bar (max 4 recommended) */\n primaryItems?: BottomNavItem[]\n /** Additional items shown in the \"More\" overflow menu */\n moreItems?: BottomNavItem[]\n /** Additional className for the nav element */\n className?: string\n}\n\n// -----------------------------------------------------------------------\n// NavBadge (internal)\n// -----------------------------------------------------------------------\n\nfunction NavBadge({ count }: { count: number }) {\n if (!count || count <= 0) return null\n const display = count > 99 ? '99+' : String(count)\n const isMultiDigit = count >= 10\n return (\n <span\n aria-label={`${count} notifications`}\n className={cn(\n 'absolute -right-1 -top-0.5 flex h-4 min-w-4 items-center justify-center rounded-full bg-error-9 text-[10px] font-semibold leading-none text-error-fg animate-in zoom-in-75',\n isMultiDigit ? 'px-0.5' : '',\n )}\n >\n {display}\n </span>\n )\n}\n\n// -----------------------------------------------------------------------\n// BottomNavLink (internal)\n// -----------------------------------------------------------------------\n\nfunction BottomNavLink({\n item,\n isActive,\n onClick,\n}: {\n item: BottomNavItem\n isActive: boolean\n onClick?: () => void\n}) {\n const Link = useLink()\n const prefersReducedMotion = useReducedMotion()\n return (\n <motion.div whileTap={prefersReducedMotion ? undefined : { y: -2 }} transition={prefersReducedMotion ? { duration: 0 } : springs.snappy} className=\"flex max-w-[70px] flex-1\">\n <Link\n href={item.href}\n onClick={onClick}\n aria-label={item.title}\n aria-current={isActive ? 'page' : undefined}\n className={cn(\n 'flex h-16 w-full cursor-pointer flex-col items-center gap-ds-02 p-ds-02 pt-0 text-ds-sm transition-colors duration-fast-02 ease-productive-standard',\n isActive\n ? 'font-semibold text-accent-11'\n : 'text-surface-fg-subtle',\n )}\n >\n <div className=\"relative flex w-full flex-col items-center gap-ds-02\">\n {isActive && (\n <motion.div\n layoutId=\"bottom-nav-indicator\"\n className=\"absolute top-0 h-[3px] w-full rounded-b-ds-sm bg-accent-9 p-0\"\n aria-hidden=\"true\"\n transition={prefersReducedMotion ? { duration: 0 } : springs.snappy}\n />\n )}\n <div className=\"relative p-ds-03\">\n <span className=\"[&>svg]:h-ico-md [&>svg]:w-ico-md\" aria-hidden=\"true\">{item.icon}</span>\n {item.badge != null && <NavBadge count={item.badge} />}\n </div>\n <span className=\"text-center\">{item.title}</span>\n </div>\n </Link>\n </motion.div>\n )\n}\n\n// -----------------------------------------------------------------------\n// BottomNavbar\n// -----------------------------------------------------------------------\n\nconst BottomNavbar = React.forwardRef<HTMLElement, BottomNavbarProps>(\n (\n {\n currentPath = '/',\n user: _user,\n primaryItems = [],\n moreItems = [],\n className,\n ...props\n },\n ref,\n ) => {\n const Link = useLink()\n const prefersReducedMotion = useReducedMotion()\n const [showMore, setShowMore] = useState(false)\n const overlayRef = useRef<HTMLDivElement>(null)\n\n const closeMore = useCallback(() => setShowMore(false), [])\n\n // Focus first focusable item when overlay opens\n useEffect(() => {\n if (showMore && overlayRef.current) {\n const firstFocusable = overlayRef.current.querySelector<HTMLElement>('a, button')\n firstFocusable?.focus()\n }\n }, [showMore])\n\n const isActive = (path: string, exact = false) => {\n if (exact || path === '/') {\n return currentPath === path\n }\n return currentPath.startsWith(path)\n }\n\n // Check if any \"more\" item is active\n const isMoreActive = moreItems.some((item) =>\n isActive(item.href, item.exact),\n )\n\n return (\n <>\n {/* More Menu Overlay */}\n <AnimatePresence>\n {showMore && (\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events -- backdrop overlay, dismiss via mouse only; keyboard users close via Escape\n <div\n className=\"fixed inset-0 z-overlay md:hidden\"\n onClick={() => setShowMore(false)}\n >\n <div className=\"absolute inset-0 bg-overlay\" />\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions -- stopPropagation prevents closing when clicking inside menu */}\n <motion.div\n ref={overlayRef}\n role=\"dialog\"\n aria-label=\"More navigation\"\n initial={{ y: '100%' }}\n animate={{ y: 0 }}\n exit={{ y: '100%' }}\n transition={prefersReducedMotion ? { duration: 0 } : springs.smooth}\n className=\"absolute bottom-[72px] left-0 right-0 rounded-t-ds-2xl border-t border-surface-border-strong bg-surface-overlay p-ds-05 pb-ds-03\"\n onClick={(e) => e.stopPropagation()}\n onKeyDown={(e) => {\n e.stopPropagation()\n if (e.key === 'Escape') closeMore()\n }}\n >\n <div className=\"mb-ds-04 flex items-center justify-between\">\n <span className=\"text-ds-md font-semibold text-surface-fg\">\n More\n </span>\n <button\n onClick={() => setShowMore(false)}\n aria-label=\"Close more menu\"\n className=\"flex h-ds-sm w-ds-sm items-center justify-center rounded-ds-full hover:bg-surface-raised-hover\"\n >\n <Icon icon={IconX} size=\"sm\" className=\"text-surface-fg-muted\" />\n </button>\n </div>\n <div className=\"grid grid-cols-4 gap-ds-03\">\n {moreItems.map((item) => (\n <Link\n key={item.href}\n href={item.href}\n onClick={() => setShowMore(false)}\n className={cn(\n 'flex flex-col items-center gap-ds-02b rounded-ds-xl p-ds-04 text-ds-sm transition-colors ease-productive-standard',\n isActive(item.href, item.exact)\n ? 'bg-surface-raised-hover text-accent-11'\n : 'text-surface-fg-subtle hover:bg-surface-raised-hover',\n )}\n >\n <span className=\"[&>svg]:h-ico-md [&>svg]:w-ico-md\">{item.icon}</span>\n <span className=\"text-center\">\n {item.title}\n </span>\n </Link>\n ))}\n </div>\n </motion.div>\n </div>\n )}\n </AnimatePresence>\n\n {/* Bottom Navigation Bar */}\n <nav\n {...props}\n ref={ref}\n aria-label=\"Mobile navigation\"\n className={cn(\n 'fixed bottom-0 left-0 right-0 z-sticky flex w-full flex-row items-start justify-between border-t border-surface-border-strong bg-surface-raised px-ds-05 pb-safe pt-0 md:hidden',\n className,\n )}\n >\n {primaryItems.map((item) => (\n <BottomNavLink\n key={item.href}\n item={item}\n isActive={isActive(item.href, item.exact)}\n />\n ))}\n\n {/* More Button */}\n {moreItems.length > 0 && (\n <motion.button\n type=\"button\"\n onClick={() => setShowMore(!showMore)}\n aria-label=\"More navigation options\"\n aria-expanded={showMore}\n whileTap={prefersReducedMotion ? undefined : { y: -2 }}\n transition={prefersReducedMotion ? { duration: 0 } : springs.snappy}\n className={cn(\n 'flex h-16 max-w-[70px] flex-1 cursor-pointer flex-col items-center gap-ds-02 p-ds-02 pt-0 text-ds-sm',\n showMore || isMoreActive\n ? 'font-semibold text-accent-11'\n : 'text-surface-fg-subtle',\n )}\n >\n <div className=\"relative flex w-full flex-col items-center gap-ds-02\">\n {(showMore || isMoreActive) && (\n <motion.div\n layoutId=\"bottom-nav-indicator\"\n className=\"absolute top-0 h-[3px] w-full rounded-b-ds-sm bg-accent-9 p-0\"\n aria-hidden=\"true\"\n transition={prefersReducedMotion ? { duration: 0 } : springs.snappy}\n />\n )}\n <div className=\"p-ds-03\">\n <Icon icon={IconDots} />\n </div>\n <span className=\"text-center\">More</span>\n </div>\n </motion.button>\n )}\n </nav>\n </>\n )\n },\n)\nBottomNavbar.displayName = 'BottomNavbar'\n\nexport { BottomNavbar }\n"],"mappings":";;;;;;;;;;;;AAsDA,SAAS,EAAS,EAAE,YAA4B;AAC9C,KAAI,CAAC,KAAS,KAAS,EAAG,QAAO;CACjC,IAAM,IAAU,IAAQ,KAAK,QAAQ,OAAO,EAAM,EAC5C,IAAe,KAAS;AAC9B,QACE,kBAAC,QAAD;EACE,cAAY,GAAG,EAAM;EACrB,WAAW,EACT,8KACA,IAAe,WAAW,GAC3B;YAEA;EACI,CAAA;;AAQX,SAAS,EAAc,EACrB,SACA,aACA,cAKC;CACD,IAAM,IAAO,GAAS,EAChB,IAAuB,GAAkB;AAC/C,QACE,kBAAC,EAAO,KAAR;EAAY,UAAU,IAAuB,KAAA,IAAY,EAAE,GAAG,IAAI;EAAE,YAAY,IAAuB,EAAE,UAAU,GAAG,GAAG,EAAQ;EAAQ,WAAU;YACjJ,kBAAC,GAAD;GACE,MAAM,EAAK;GACF;GACT,cAAY,EAAK;GACjB,gBAAc,IAAW,SAAS,KAAA;GAClC,WAAW,EACT,uJACA,IACI,iCACA,yBACL;aAED,kBAAC,OAAD;IAAK,WAAU;cAAf;KACG,KACC,kBAAC,EAAO,KAAR;MACE,UAAS;MACT,WAAU;MACV,eAAY;MACZ,YAAY,IAAuB,EAAE,UAAU,GAAG,GAAG,EAAQ;MAC7D,CAAA;KAEJ,kBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,kBAAC,QAAD;OAAM,WAAU;OAAoC,eAAY;iBAAQ,EAAK;OAAY,CAAA,EACxF,EAAK,SAAS,QAAQ,kBAAC,GAAD,EAAU,OAAO,EAAK,OAAS,CAAA,CAClD;;KACN,kBAAC,QAAD;MAAM,WAAU;gBAAe,EAAK;MAAa,CAAA;KAC7C;;GACD,CAAA;EACI,CAAA;;AAQjB,IAAM,IAAe,EAA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":["../../src/shell/bottom-navbar.tsx"],"sourcesContent":["'use client'\n\n/**\n * BottomNavbar -- Mobile bottom navigation bar.\n *\n * Props-driven: accepts currentPath, user, navItems instead of\n * reading from Remix hooks or Zustand stores.\n */\nimport { IconDots, IconX } from '@tabler/icons-react'\nimport { AnimatePresence, motion, useReducedMotion } from 'framer-motion'\nimport * as React from 'react'\nimport { useCallback,useEffect, useRef, useState } from 'react'\n\nimport { Icon } from '../ui/icon'\nimport { springs } from '../ui/lib/motion'\nimport { cn } from '../ui/lib/utils'\nimport { useLink } from './link-context'\n\n// -----------------------------------------------------------------------\n// Types\n// -----------------------------------------------------------------------\n\nexport interface BottomNavItem {\n title: string\n href: string\n icon: React.ReactNode\n /** When true, the route matches only when the path is exactly equal */\n exact?: boolean\n /** Notification badge count. 0 or undefined = hidden, 1–99 = shown, >99 = \"99+\" */\n badge?: number\n}\n\nexport interface BottomNavbarUser {\n name: string\n role?: string\n}\n\nexport interface BottomNavbarProps\n extends React.HTMLAttributes<HTMLElement> {\n /** Currently active pathname */\n currentPath?: string\n /** User information (used to determine admin status, presence) */\n user?: BottomNavbarUser | null\n /** Primary nav items shown directly in the bottom bar (max 4 recommended) */\n primaryItems?: BottomNavItem[]\n /** Additional items shown in the \"More\" overflow menu */\n moreItems?: BottomNavItem[]\n /** Additional className for the nav element */\n className?: string\n}\n\n// -----------------------------------------------------------------------\n// NavBadge (internal)\n// -----------------------------------------------------------------------\n\nfunction NavBadge({ count }: { count: number }) {\n if (!count || count <= 0) return null\n const display = count > 99 ? '99+' : String(count)\n const isMultiDigit = count >= 10\n return (\n <span\n aria-label={`${count} notifications`}\n className={cn(\n 'absolute -right-1 -top-0.5 flex h-4 min-w-4 items-center justify-center rounded-full bg-error-9 text-[10px] font-semibold leading-none text-error-fg animate-in zoom-in-75',\n isMultiDigit ? 'px-0.5' : '',\n )}\n >\n {display}\n </span>\n )\n}\n\n// -----------------------------------------------------------------------\n// BottomNavLink (internal)\n// -----------------------------------------------------------------------\n\nfunction BottomNavLink({\n item,\n isActive,\n onClick,\n}: {\n item: BottomNavItem\n isActive: boolean\n onClick?: () => void\n}) {\n const Link = useLink()\n const prefersReducedMotion = useReducedMotion()\n return (\n <motion.div whileTap={prefersReducedMotion ? undefined : { y: -2 }} transition={prefersReducedMotion ? { duration: 0 } : springs.snappy} className=\"flex max-w-[70px] flex-1\">\n <Link\n href={item.href}\n onClick={onClick}\n aria-label={item.title}\n aria-current={isActive ? 'page' : undefined}\n className={cn(\n 'flex h-16 w-full cursor-pointer flex-col items-center gap-ds-02 p-ds-02 pt-0 text-ds-sm transition-colors duration-fast-02 ease-productive-standard',\n isActive\n ? 'font-semibold text-accent-11'\n : 'text-surface-fg-subtle',\n )}\n >\n <div className=\"relative flex w-full flex-col items-center gap-ds-02\">\n {isActive && (\n <motion.div\n layoutId=\"bottom-nav-indicator\"\n className=\"absolute top-0 h-[3px] w-full rounded-b-ds-sm bg-accent-9 p-0\"\n aria-hidden=\"true\"\n transition={prefersReducedMotion ? { duration: 0 } : springs.snappy}\n />\n )}\n <div className=\"relative p-ds-03\">\n <span className=\"[&>svg]:h-ico-md [&>svg]:w-ico-md\" aria-hidden=\"true\">{item.icon}</span>\n {item.badge != null && <NavBadge count={item.badge} />}\n </div>\n <span className=\"text-center\">{item.title}</span>\n </div>\n </Link>\n </motion.div>\n )\n}\n\n// -----------------------------------------------------------------------\n// BottomNavbar\n// -----------------------------------------------------------------------\n\nconst BottomNavbar = React.forwardRef<HTMLElement, BottomNavbarProps>(\n (\n {\n currentPath = '/',\n user: _user,\n primaryItems = [],\n moreItems = [],\n className,\n ...props\n },\n ref,\n ) => {\n const Link = useLink()\n const prefersReducedMotion = useReducedMotion()\n const [showMore, setShowMore] = useState(false)\n const overlayRef = useRef<HTMLDivElement>(null)\n\n const closeMore = useCallback(() => setShowMore(false), [])\n\n // Focus first focusable item when overlay opens\n useEffect(() => {\n if (showMore && overlayRef.current) {\n const firstFocusable = overlayRef.current.querySelector<HTMLElement>('a, button')\n firstFocusable?.focus()\n }\n }, [showMore])\n\n const isActive = (path: string, exact = false) => {\n if (exact || path === '/') {\n return currentPath === path\n }\n return currentPath.startsWith(path)\n }\n\n // Check if any \"more\" item is active\n const isMoreActive = moreItems.some((item) =>\n isActive(item.href, item.exact),\n )\n\n return (\n <>\n {/* More Menu Overlay */}\n <AnimatePresence>\n {showMore && (\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events -- backdrop overlay, dismiss via mouse only; keyboard users close via Escape\n <div\n className=\"fixed inset-0 z-overlay md:hidden\"\n onClick={() => setShowMore(false)}\n >\n <div className=\"absolute inset-0 bg-overlay\" />\n { }\n <motion.div\n ref={overlayRef}\n role=\"dialog\"\n aria-label=\"More navigation\"\n initial={{ y: '100%' }}\n animate={{ y: 0 }}\n exit={{ y: '100%' }}\n transition={prefersReducedMotion ? { duration: 0 } : springs.smooth}\n className=\"absolute bottom-[72px] left-0 right-0 rounded-t-ds-2xl border-t border-surface-border-strong bg-surface-overlay p-ds-05 pb-ds-03\"\n onClick={(e) => e.stopPropagation()}\n onKeyDown={(e) => {\n e.stopPropagation()\n if (e.key === 'Escape') closeMore()\n }}\n >\n <div className=\"mb-ds-04 flex items-center justify-between\">\n <span className=\"text-ds-md font-semibold text-surface-fg\">\n More\n </span>\n <button\n onClick={() => setShowMore(false)}\n aria-label=\"Close more menu\"\n className=\"flex h-ds-sm w-ds-sm items-center justify-center rounded-ds-full hover:bg-surface-raised-hover\"\n >\n <Icon icon={IconX} size=\"sm\" className=\"text-surface-fg-muted\" />\n </button>\n </div>\n <div className=\"grid grid-cols-4 gap-ds-03\">\n {moreItems.map((item) => (\n <Link\n key={item.href}\n href={item.href}\n onClick={() => setShowMore(false)}\n className={cn(\n 'flex flex-col items-center gap-ds-02b rounded-ds-xl p-ds-04 text-ds-sm transition-colors ease-productive-standard',\n isActive(item.href, item.exact)\n ? 'bg-surface-raised-hover text-accent-11'\n : 'text-surface-fg-subtle hover:bg-surface-raised-hover',\n )}\n >\n <span className=\"[&>svg]:h-ico-md [&>svg]:w-ico-md\">{item.icon}</span>\n <span className=\"text-center\">\n {item.title}\n </span>\n </Link>\n ))}\n </div>\n </motion.div>\n </div>\n )}\n </AnimatePresence>\n\n {/* Bottom Navigation Bar */}\n <nav\n {...props}\n ref={ref}\n aria-label=\"Mobile navigation\"\n className={cn(\n 'fixed bottom-0 left-0 right-0 z-sticky flex w-full flex-row items-start justify-between border-t border-surface-border-strong bg-surface-raised px-ds-05 pb-safe pt-0 md:hidden',\n className,\n )}\n >\n {primaryItems.map((item) => (\n <BottomNavLink\n key={item.href}\n item={item}\n isActive={isActive(item.href, item.exact)}\n />\n ))}\n\n {/* More Button */}\n {moreItems.length > 0 && (\n <motion.button\n type=\"button\"\n onClick={() => setShowMore(!showMore)}\n aria-label=\"More navigation options\"\n aria-expanded={showMore}\n whileTap={prefersReducedMotion ? undefined : { y: -2 }}\n transition={prefersReducedMotion ? { duration: 0 } : springs.snappy}\n className={cn(\n 'flex h-16 max-w-[70px] flex-1 cursor-pointer flex-col items-center gap-ds-02 p-ds-02 pt-0 text-ds-sm',\n showMore || isMoreActive\n ? 'font-semibold text-accent-11'\n : 'text-surface-fg-subtle',\n )}\n >\n <div className=\"relative flex w-full flex-col items-center gap-ds-02\">\n {(showMore || isMoreActive) && (\n <motion.div\n layoutId=\"bottom-nav-indicator\"\n className=\"absolute top-0 h-[3px] w-full rounded-b-ds-sm bg-accent-9 p-0\"\n aria-hidden=\"true\"\n transition={prefersReducedMotion ? { duration: 0 } : springs.snappy}\n />\n )}\n <div className=\"p-ds-03\">\n <Icon icon={IconDots} />\n </div>\n <span className=\"text-center\">More</span>\n </div>\n </motion.button>\n )}\n </nav>\n </>\n )\n },\n)\nBottomNavbar.displayName = 'BottomNavbar'\n\nexport { BottomNavbar }\n"],"mappings":";;;;;;;;;;;;AAuDA,SAAS,EAAS,EAAE,YAA4B;AAC9C,KAAI,CAAC,KAAS,KAAS,EAAG,QAAO;CACjC,I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,CAAA,EACtE,kBAAC,QAAD;MAAM,WAAU;gBACb,EAAK;MACD,CAAA,CACF;OAdA,EAAK,KAcL,CACP;IACE,CAAA,CACK;KACT;KAEY,CAAA,EAGpB,kBAAC,OAAD;EACE,GAAI;EACC;EACL,cAAW;EACX,WAAW,EACT,mLACA,EACD;YAPH,CASG,EAAa,KAAK,MACjB,kBAAC,GAAD;GAEQ;GACN,UAAU,EAAS,EAAK,MAAM,EAAK,MAAM;GACzC,EAHK,EAAK,KAGV,CACF,EAGD,EAAU,SAAS,KAClB,kBAAC,EAAO,QAAR;GACE,MAAK;GACL,eAAe,EAAY,CAAC,EAAS;GACrC,cAAW;GACX,iBAAe;GACf,UAAU,IAAuB,KAAA,IAAY,EAAE,GAAG,IAAI;GACtD,YAAY,IAAuB,EAAE,UAAU,GAAG,GAAG,EAAQ;GAC7D,WAAW,EACT,wGACA,KAAY,IACR,iCACA,yBACL;aAED,kBAAC,OAAD;IAAK,WAAU;cAAf;MACI,KAAY,MACZ,kBAAC,EAAO,KAAR;MACE,UAAS;MACT,WAAU;MACV,eAAY;MACZ,YAAY,IAAuB,EAAE,UAAU,GAAG,GAAG,EAAQ;MAC7D,CAAA;KAEJ,kBAAC,OAAD;MAAK,WAAU;gBACb,kBAAC,GAAD,EAAM,MAAM,GAAY,CAAA;MACpB,CAAA;KACN,kBAAC,QAAD;MAAM,WAAU;gBAAc;MAAW,CAAA;KACrC;;GACQ,CAAA,CAEd;IACL,EAAA,CAAA;EAGN;AACD,EAAa,cAAc"}
|
package/dist/shell/index.d.ts
CHANGED
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
* import { AppSidebar } from '@devalok/shilp-sutra/shell/sidebar'
|
|
10
10
|
* import { TopBar } from '@devalok/shilp-sutra/shell/top-bar'
|
|
11
11
|
*/
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
export {
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
19
|
-
export {
|
|
12
|
+
export { AppCommandPalette, type AppCommandPaletteProps, type AppCommandPaletteUser, type SearchResult, type SearchResultGroup, } from './app-command-palette';
|
|
13
|
+
export { BottomNavbar, type BottomNavbarProps, type BottomNavbarUser, type BottomNavItem, } from './bottom-navbar';
|
|
14
|
+
export { type CommandPageItem, type CommandRegistry, CommandRegistryProvider, type CommandRegistryProviderProps, useCommandRegistry, } from './command-registry';
|
|
15
|
+
export { LinkProvider, type LinkProviderProps, useLink } from './link-context';
|
|
16
|
+
export { type Notification, NotificationCenter, type NotificationCenterProps, } from './notification-center';
|
|
17
|
+
export { type NotificationPreference, NotificationPreferences, type NotificationPreferencesProps, type NotificationProject, } from './notification-preferences';
|
|
18
|
+
export { AppSidebar, type AppSidebarProps, type NavGroup, type NavItem, type SidebarUser, } from './sidebar';
|
|
19
|
+
export { TopBar, type TopBarProps, type TopBarUser, type UserMenuItem, } from './top-bar';
|
|
20
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shell/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shell/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EACL,iBAAiB,EACjB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,YAAY,EACjB,KAAK,iBAAiB,GACvB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACL,YAAY,EACZ,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,aAAa,GACnB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,uBAAuB,EACvB,KAAK,4BAA4B,EACjC,kBAAkB,GACnB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAC,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAC7E,OAAO,EACL,KAAK,YAAY,EACjB,kBAAkB,EAClB,KAAK,uBAAuB,GAC7B,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACL,KAAK,sBAAsB,EAC3B,uBAAuB,EACvB,KAAK,4BAA4B,EACjC,KAAK,mBAAmB,GACzB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EACL,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,QAAQ,EACb,KAAK,OAAO,EACZ,KAAK,WAAW,GACjB,MAAM,WAAW,CAAA;AAClB,OAAO,EACL,MAAM,EACN,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,YAAY,GAClB,MAAM,WAAW,CAAA"}
|
package/dist/shell/index.js
CHANGED
|
@@ -4,8 +4,8 @@ import { CommandRegistryProvider as n, useCommandRegistry as r } from "./command
|
|
|
4
4
|
import { AppCommandPalette as i } from "./app-command-palette.js";
|
|
5
5
|
import "./link-context.js";
|
|
6
6
|
import { BottomNavbar as a } from "./bottom-navbar.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
export { i as AppCommandPalette,
|
|
7
|
+
import { NotificationCenter as o } from "./notification-center.js";
|
|
8
|
+
import { NotificationPreferences as s } from "./notification-preferences.js";
|
|
9
|
+
import { AppSidebar as c } from "./sidebar.js";
|
|
10
|
+
import { TopBar as l } from "./top-bar.js";
|
|
11
|
+
export { i as AppCommandPalette, c as AppSidebar, a as BottomNavbar, n as CommandRegistryProvider, t as LinkProvider, o as NotificationCenter, s as NotificationPreferences, l as TopBar, r as useCommandRegistry, e as useLink };
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
* Re-export from canonical location in ui/lib so both ui/ and shell/ can use it
|
|
4
4
|
* without violating module boundary rules (ui/ must not import from shell/).
|
|
5
5
|
*/
|
|
6
|
-
export { LinkProvider, useLink } from '../ui/lib/link-context';
|
|
7
6
|
export type { LinkProviderProps } from '../ui/lib/link-context';
|
|
7
|
+
export { LinkProvider, useLink } from '../ui/lib/link-context';
|
|
8
8
|
//# sourceMappingURL=link-context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link-context.d.ts","sourceRoot":"","sources":["../../src/shell/link-context.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"link-context.d.ts","sourceRoot":"","sources":["../../src/shell/link-context.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,YAAY,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA"}
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
/**
|
|
3
|
-
* NotificationCenter -- Popover-based notification panel.
|
|
4
|
-
*
|
|
5
|
-
* Props-driven: accepts notifications array and callbacks instead of
|
|
6
|
-
* reading from Zustand stores or using Remix useNavigate.
|
|
7
|
-
*/
|
|
8
2
|
import * as React from 'react';
|
|
9
3
|
export interface NotificationAction {
|
|
10
4
|
/** Button label */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-center.d.ts","sourceRoot":"","sources":["../../src/shell/notification-center.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"notification-center.d.ts","sourceRoot":"","sources":["../../src/shell/notification-center.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AA8B9B,MAAM,WAAW,kBAAkB;IACjC,mBAAmB;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,oFAAoF;IACpF,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAA;IAC1C,8EAA8E;IAC9E,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CAC9B;AAED,MAAM,WAAW,YAAY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AAC,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,MAAM,GAAG,IAAI,CAAA;IACpE,wEAAwE;IACxE,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC/B,oEAAoE;IACpE,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC5B,+DAA+D;IAC/D,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC5B,gGAAgG;IAChG,SAAS,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,6DAA6D;IAC7D,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AA4KD,QAAA,MAAM,kBAAkB,mGAqPvB,CAAA;AAGD,OAAO,EAAE,kBAAkB,EAAE,CAAA"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { Sheet as ee, SheetContent as u, SheetTitle as d, SheetTrigger as te } from "../ui/sheet.js";
|
|
2
|
+
import { durations as e } from "../ui/lib/motion.js";
|
|
3
|
+
import { cn as t } from "../ui/lib/utils.js";
|
|
4
|
+
import { Spinner as n } from "../ui/spinner.js";
|
|
5
|
+
import { Icon as r } from "../ui/icon.js";
|
|
6
|
+
import { useIsMobile as i } from "../hooks/use-mobile.js";
|
|
7
|
+
import { i as a, r as o, t as s } from "../_chunks/popover.js";
|
|
8
|
+
import { Sheet as c, SheetContent as l, SheetTitle as u, SheetTrigger as d } from "../ui/sheet.js";
|
|
10
9
|
import { Tooltip as f, TooltipContent as p, TooltipTrigger as m } from "../ui/tooltip.js";
|
|
11
10
|
import { formatRelativeTime as h } from "../ui/lib/date-utils.js";
|
|
12
11
|
import * as g from "react";
|
|
13
12
|
import { useCallback as _, useRef as v } from "react";
|
|
14
13
|
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
15
|
-
import { IconBell as S, IconChecks as
|
|
14
|
+
import { IconBell as S, IconChecks as ee, IconInbox as C, IconX as w } from "@tabler/icons-react";
|
|
15
|
+
import { motion as T, useReducedMotion as te } from "framer-motion";
|
|
16
16
|
//#region src/shell/notification-center.tsx
|
|
17
17
|
function E(e, t) {
|
|
18
18
|
return e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate();
|
|
@@ -26,9 +26,9 @@ var O = {
|
|
|
26
26
|
IMPORTANT: "bg-warning-9",
|
|
27
27
|
CRITICAL: "bg-error-9"
|
|
28
28
|
};
|
|
29
|
-
function k({ notification: e, onRead:
|
|
30
|
-
let s =
|
|
31
|
-
e.isRead ||
|
|
29
|
+
function k({ notification: e, onRead: n, onNavigate: i, getRoute: a, onDismiss: o }) {
|
|
30
|
+
let s = a(e), c = () => {
|
|
31
|
+
e.isRead || n(e.id), s && i(s);
|
|
32
32
|
};
|
|
33
33
|
return /* @__PURE__ */ x("div", {
|
|
34
34
|
role: "button",
|
|
@@ -37,17 +37,17 @@ function k({ notification: e, onRead: t, onNavigate: n, getRoute: i, onDismiss:
|
|
|
37
37
|
onKeyDown: (e) => {
|
|
38
38
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), c());
|
|
39
39
|
},
|
|
40
|
-
className:
|
|
40
|
+
className: t("group relative flex w-full cursor-pointer items-start gap-ds-04 px-ds-05 py-ds-04 text-left transition-colors duration-fast-02 ease-productive-standard", "hover:bg-surface-raised", !e.isRead && "bg-accent-1"),
|
|
41
41
|
children: [
|
|
42
42
|
/* @__PURE__ */ b("div", {
|
|
43
43
|
className: "mt-ds-02b flex shrink-0",
|
|
44
|
-
children: /* @__PURE__ */ b("span", { className:
|
|
44
|
+
children: /* @__PURE__ */ b("span", { className: t("h-[8px] w-[8px] rounded-ds-full transition-opacity duration-fast-02 ease-productive-standard", O[e.tier] || O.INFO, e.isRead ? "opacity-20" : "opacity-100") })
|
|
45
45
|
}),
|
|
46
46
|
/* @__PURE__ */ x("div", {
|
|
47
47
|
className: "min-w-0 flex-1",
|
|
48
48
|
children: [
|
|
49
49
|
/* @__PURE__ */ b("p", {
|
|
50
|
-
className:
|
|
50
|
+
className: t("truncate text-ds-md text-surface-fg", !e.isRead && "font-semibold"),
|
|
51
51
|
children: e.title
|
|
52
52
|
}),
|
|
53
53
|
e.body && /* @__PURE__ */ b("p", {
|
|
@@ -69,15 +69,15 @@ function k({ notification: e, onRead: t, onNavigate: n, getRoute: i, onDismiss:
|
|
|
69
69
|
}),
|
|
70
70
|
e.actions && e.actions.length > 0 && /* @__PURE__ */ b("div", {
|
|
71
71
|
className: "mt-ds-03 flex items-center gap-ds-02",
|
|
72
|
-
children: e.actions.map((
|
|
72
|
+
children: e.actions.map((n) => /* @__PURE__ */ b("button", {
|
|
73
73
|
type: "button",
|
|
74
|
-
onClick: (
|
|
75
|
-
|
|
74
|
+
onClick: (t) => {
|
|
75
|
+
t.stopPropagation(), n.onClick(e.id);
|
|
76
76
|
},
|
|
77
77
|
onKeyDown: (e) => e.stopPropagation(),
|
|
78
|
-
className:
|
|
79
|
-
children:
|
|
80
|
-
},
|
|
78
|
+
className: t("rounded-ds-md px-ds-03 py-ds-01 text-ds-sm font-medium transition-colors duration-fast-02 ease-productive-standard", n.variant === "primary" ? "bg-accent-9 text-accent-fg hover:bg-accent-10" : n.variant === "danger" ? "text-error-11 hover:bg-error-3" : "text-surface-fg-muted hover:bg-surface-raised-hover"),
|
|
79
|
+
children: n.label
|
|
80
|
+
}, n.label))
|
|
81
81
|
})
|
|
82
82
|
]
|
|
83
83
|
}),
|
|
@@ -89,16 +89,16 @@ function k({ notification: e, onRead: t, onNavigate: n, getRoute: i, onDismiss:
|
|
|
89
89
|
},
|
|
90
90
|
onKeyDown: (e) => e.stopPropagation(),
|
|
91
91
|
className: "absolute right-ds-03 top-ds-03 hidden rounded-ds-sm p-ds-01 text-surface-fg-subtle transition-[color,background-color,opacity] duration-fast-01 ease-productive-standard hover:bg-surface-raised-hover hover:text-surface-fg-muted group-hover:flex group-focus-within:flex",
|
|
92
|
-
children: /* @__PURE__ */ b(
|
|
93
|
-
icon:
|
|
92
|
+
children: /* @__PURE__ */ b(r, {
|
|
93
|
+
icon: w,
|
|
94
94
|
size: "sm"
|
|
95
95
|
})
|
|
96
96
|
})
|
|
97
97
|
]
|
|
98
98
|
});
|
|
99
99
|
}
|
|
100
|
-
var A = g.forwardRef(({ notifications: h = [], unreadCount: g, open:
|
|
101
|
-
let W = v(null), G =
|
|
100
|
+
var A = g.forwardRef(({ notifications: h = [], unreadCount: g, open: w, onOpenChange: E, isLoading: O = !1, hasMore: A = !1, onFetchMore: j, onMarkRead: M, onMarkAllRead: N, onNavigate: P, getNotificationRoute: F, onDismiss: I, headerActions: L, emptyState: R, footerSlot: z, popoverClassName: B, className: V, ...H }, U) => {
|
|
101
|
+
let W = v(null), G = te(), K = i(), q = g ?? h.filter((e) => !e.isRead).length, J = F ?? (() => null), Y = _((e) => {
|
|
102
102
|
E?.(!1), P?.(e);
|
|
103
103
|
}, [P, E]), X = _((e) => {
|
|
104
104
|
M?.(e);
|
|
@@ -130,8 +130,8 @@ var A = g.forwardRef(({ notifications: h = [], unreadCount: g, open: T, onOpenCh
|
|
|
130
130
|
type: "button",
|
|
131
131
|
onClick: N,
|
|
132
132
|
className: "flex items-center gap-ds-02 text-ds-sm text-surface-fg-subtle transition-colors hover:text-accent-11",
|
|
133
|
-
children: [/* @__PURE__ */ b(
|
|
134
|
-
icon:
|
|
133
|
+
children: [/* @__PURE__ */ b(r, {
|
|
134
|
+
icon: ee,
|
|
135
135
|
size: "sm"
|
|
136
136
|
}), "Mark all read"]
|
|
137
137
|
}), L]
|
|
@@ -140,14 +140,14 @@ var A = g.forwardRef(({ notifications: h = [], unreadCount: g, open: T, onOpenCh
|
|
|
140
140
|
/* @__PURE__ */ x("div", {
|
|
141
141
|
ref: W,
|
|
142
142
|
onScroll: Z,
|
|
143
|
-
className:
|
|
143
|
+
className: t("overflow-y-auto", K ? "max-h-[60vh]" : "max-h-[420px]"),
|
|
144
144
|
children: [h.length === 0 ? R || /* @__PURE__ */ x("div", {
|
|
145
145
|
className: "flex flex-col items-center justify-center px-ds-05 py-ds-09",
|
|
146
146
|
children: [
|
|
147
147
|
/* @__PURE__ */ b("div", {
|
|
148
148
|
className: "flex h-ds-lg w-ds-lg items-center justify-center rounded-ds-full bg-surface-raised",
|
|
149
|
-
children: /* @__PURE__ */ b(
|
|
150
|
-
icon:
|
|
149
|
+
children: /* @__PURE__ */ b(r, {
|
|
150
|
+
icon: C,
|
|
151
151
|
size: "lg",
|
|
152
152
|
className: "text-surface-fg-subtle"
|
|
153
153
|
})
|
|
@@ -165,29 +165,29 @@ var A = g.forwardRef(({ notifications: h = [], unreadCount: g, open: T, onOpenCh
|
|
|
165
165
|
"Today",
|
|
166
166
|
"Yesterday",
|
|
167
167
|
"Earlier"
|
|
168
|
-
].map((
|
|
169
|
-
let
|
|
170
|
-
return !
|
|
168
|
+
].map((e) => {
|
|
169
|
+
let t = ne[e];
|
|
170
|
+
return !t || t.length === 0 ? null : /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("div", {
|
|
171
171
|
className: "sticky top-0 z-raised bg-surface-overlay px-ds-05 py-ds-02b",
|
|
172
172
|
children: /* @__PURE__ */ b("span", {
|
|
173
173
|
className: "text-ds-sm font-medium text-surface-fg-subtle",
|
|
174
|
-
children:
|
|
174
|
+
children: e
|
|
175
175
|
})
|
|
176
|
-
}),
|
|
176
|
+
}), t.map((e, t) => /* @__PURE__ */ b(T.div, {
|
|
177
177
|
initial: G ? void 0 : { opacity: 0 },
|
|
178
178
|
animate: { opacity: 1 },
|
|
179
|
-
transition: G ? { duration: 0 } : { delay:
|
|
179
|
+
transition: G ? { duration: 0 } : { delay: t * .03 },
|
|
180
180
|
children: /* @__PURE__ */ b(k, {
|
|
181
|
-
notification:
|
|
181
|
+
notification: e,
|
|
182
182
|
onRead: X,
|
|
183
183
|
onNavigate: Y,
|
|
184
184
|
getRoute: J,
|
|
185
185
|
onDismiss: I
|
|
186
186
|
})
|
|
187
|
-
},
|
|
187
|
+
}, e.id))] }, e);
|
|
188
188
|
}), O && /* @__PURE__ */ b("div", {
|
|
189
189
|
className: "flex items-center justify-center py-ds-05",
|
|
190
|
-
children: /* @__PURE__ */ b(
|
|
190
|
+
children: /* @__PURE__ */ b(n, {})
|
|
191
191
|
})]
|
|
192
192
|
}),
|
|
193
193
|
z && /* @__PURE__ */ b("div", {
|
|
@@ -198,11 +198,11 @@ var A = g.forwardRef(({ notifications: h = [], unreadCount: g, open: T, onOpenCh
|
|
|
198
198
|
...H,
|
|
199
199
|
ref: U,
|
|
200
200
|
"aria-label": q > 0 ? `Notifications, ${q} unread` : "Notifications",
|
|
201
|
-
className:
|
|
202
|
-
children: [/* @__PURE__ */ b(
|
|
201
|
+
className: t("relative flex h-ds-sm-plus w-ds-sm-plus items-center justify-center rounded-ds-full border border-surface-border-strong bg-surface-raised text-surface-fg-muted transition-colors ease-productive-standard hover:bg-surface-raised-hover", V),
|
|
202
|
+
children: [/* @__PURE__ */ b(r, {
|
|
203
203
|
icon: S,
|
|
204
204
|
size: "sm"
|
|
205
|
-
}), q > 0 && /* @__PURE__ */ b(
|
|
205
|
+
}), q > 0 && /* @__PURE__ */ b(T.span, {
|
|
206
206
|
initial: { rotate: 0 },
|
|
207
207
|
animate: G ? void 0 : { rotate: [
|
|
208
208
|
0,
|
|
@@ -213,19 +213,19 @@ var A = g.forwardRef(({ notifications: h = [], unreadCount: g, open: T, onOpenCh
|
|
|
213
213
|
0
|
|
214
214
|
] },
|
|
215
215
|
transition: G ? { duration: 0 } : {
|
|
216
|
-
duration:
|
|
216
|
+
duration: e.slow01,
|
|
217
217
|
ease: "easeInOut"
|
|
218
218
|
},
|
|
219
219
|
className: "absolute -right-ds-01 -top-ds-01 flex h-4 min-w-4 items-center justify-center rounded-ds-full bg-accent-9 px-ds-02 text-ds-xs font-semibold text-accent-fg",
|
|
220
220
|
children: q > 99 ? "99+" : q
|
|
221
221
|
})]
|
|
222
222
|
});
|
|
223
|
-
return K ? /* @__PURE__ */ x(
|
|
224
|
-
open:
|
|
223
|
+
return K ? /* @__PURE__ */ x(c, {
|
|
224
|
+
open: w,
|
|
225
225
|
onOpenChange: E,
|
|
226
226
|
children: [/* @__PURE__ */ x(f, { children: [/* @__PURE__ */ b(m, {
|
|
227
227
|
asChild: !0,
|
|
228
|
-
children: /* @__PURE__ */ b(
|
|
228
|
+
children: /* @__PURE__ */ b(d, {
|
|
229
229
|
asChild: !0,
|
|
230
230
|
children: $
|
|
231
231
|
})
|
|
@@ -233,21 +233,21 @@ var A = g.forwardRef(({ notifications: h = [], unreadCount: g, open: T, onOpenCh
|
|
|
233
233
|
side: "bottom",
|
|
234
234
|
align: "center",
|
|
235
235
|
children: "Notifications"
|
|
236
|
-
})] }), /* @__PURE__ */ x(
|
|
236
|
+
})] }), /* @__PURE__ */ x(l, {
|
|
237
237
|
side: "bottom",
|
|
238
|
-
className:
|
|
238
|
+
className: t("p-0", B),
|
|
239
239
|
responsive: !1,
|
|
240
|
-
children: [/* @__PURE__ */ b(
|
|
240
|
+
children: [/* @__PURE__ */ b(u, {
|
|
241
241
|
className: "px-ds-05 pt-ds-04 text-ds-md font-semibold text-surface-fg",
|
|
242
242
|
children: "Notifications"
|
|
243
243
|
}), Q]
|
|
244
244
|
})]
|
|
245
|
-
}) : /* @__PURE__ */ x(
|
|
246
|
-
open:
|
|
245
|
+
}) : /* @__PURE__ */ x(s, {
|
|
246
|
+
open: w,
|
|
247
247
|
onOpenChange: E,
|
|
248
248
|
children: [/* @__PURE__ */ x(f, { children: [/* @__PURE__ */ b(m, {
|
|
249
249
|
asChild: !0,
|
|
250
|
-
children: /* @__PURE__ */ b(
|
|
250
|
+
children: /* @__PURE__ */ b(a, {
|
|
251
251
|
asChild: !0,
|
|
252
252
|
children: $
|
|
253
253
|
})
|
|
@@ -255,8 +255,8 @@ var A = g.forwardRef(({ notifications: h = [], unreadCount: g, open: T, onOpenCh
|
|
|
255
255
|
side: "bottom",
|
|
256
256
|
align: "center",
|
|
257
257
|
children: "Notifications"
|
|
258
|
-
})] }), /* @__PURE__ */ b(
|
|
259
|
-
className:
|
|
258
|
+
})] }), /* @__PURE__ */ b(o, {
|
|
259
|
+
className: t("w-[380px] rounded-ds-xl border border-surface-border-strong bg-surface-overlay p-0 shadow-floating", B),
|
|
260
260
|
sideOffset: 8,
|
|
261
261
|
align: "end",
|
|
262
262
|
children: Q
|