@devalok/shilp-sutra 0.53.0 → 0.55.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/AGENTS.md +7 -1
- package/BREAKING.json +29 -0
- package/MIGRATION.md +83 -0
- package/dist/_chunks/badge-group.js +1 -1
- package/dist/_chunks/popover.js +38 -37
- package/dist/_chunks/popover.js.map +1 -1
- package/dist/_chunks/primitives/react-accordion.js +270 -0
- package/dist/_chunks/primitives/react-accordion.js.map +1 -0
- package/dist/_chunks/primitives/react-alert-dialog.js +857 -0
- package/dist/_chunks/primitives/react-alert-dialog.js.map +1 -0
- package/dist/_chunks/primitives/react-aspect-ratio.js +32 -0
- package/dist/_chunks/primitives/react-aspect-ratio.js.map +1 -0
- package/dist/_chunks/primitives/react-avatar.js +69 -0
- package/dist/_chunks/primitives/react-avatar.js.map +1 -0
- package/dist/_chunks/primitives/react-checkbox.js +151 -0
- package/dist/_chunks/primitives/react-checkbox.js.map +1 -0
- package/dist/_chunks/primitives/react-context-menu.js +905 -0
- package/dist/_chunks/primitives/react-context-menu.js.map +1 -0
- package/dist/_chunks/primitives/react-dropdown-menu.js +220 -0
- package/dist/_chunks/primitives/react-dropdown-menu.js.map +1 -0
- package/dist/_chunks/primitives/react-hover-card.js +153 -0
- package/dist/_chunks/primitives/react-hover-card.js.map +1 -0
- package/dist/_chunks/primitives/react-label.js +16 -0
- package/dist/_chunks/primitives/react-label.js.map +1 -0
- package/dist/_chunks/primitives/react-menubar.js +304 -0
- package/dist/_chunks/primitives/react-menubar.js.map +1 -0
- package/dist/_chunks/primitives/react-navigation-menu.js +560 -0
- package/dist/_chunks/primitives/react-navigation-menu.js.map +1 -0
- package/dist/_chunks/primitives/react-popover.js +186 -0
- package/dist/_chunks/primitives/react-popover.js.map +1 -0
- package/dist/_chunks/primitives/react-progress.js +70 -0
- package/dist/_chunks/primitives/react-progress.js.map +1 -0
- package/dist/_chunks/primitives/react-radio-group.js +170 -0
- package/dist/_chunks/primitives/react-radio-group.js.map +1 -0
- package/dist/_chunks/primitives/react-select.js +671 -0
- package/dist/_chunks/primitives/react-select.js.map +1 -0
- package/dist/_chunks/primitives/react-separator.js +24 -0
- package/dist/_chunks/primitives/react-separator.js.map +1 -0
- package/dist/_chunks/primitives/react-slider.js +349 -0
- package/dist/_chunks/primitives/react-slider.js.map +1 -0
- package/dist/_chunks/primitives/react-switch.js +92 -0
- package/dist/_chunks/primitives/react-switch.js.map +1 -0
- package/dist/_chunks/primitives/react-tabs.js +114 -0
- package/dist/_chunks/primitives/react-tabs.js.map +1 -0
- package/dist/_chunks/primitives/react-toggle-group.js +122 -0
- package/dist/_chunks/primitives/react-toggle-group.js.map +1 -0
- package/dist/_chunks/primitives/react-toggle.js +28 -0
- package/dist/_chunks/primitives/react-toggle.js.map +1 -0
- package/dist/_chunks/primitives/react-tooltip.js +341 -0
- package/dist/_chunks/primitives/react-tooltip.js.map +1 -0
- package/dist/_chunks/primitives-internal.js +2071 -0
- package/dist/_chunks/primitives-internal.js.map +1 -0
- package/dist/_chunks/shared.js +32 -32
- package/dist/_chunks/tiptap.js +1 -1
- package/dist/ai/ai-command-provider.d.ts +2 -3
- package/dist/ai/block-renderer.d.ts +1 -2
- package/dist/ai/blocks/block-shell.d.ts +0 -1
- package/dist/ai/blocks/block-table.d.ts +1 -2
- package/dist/ai/blocks/confirm.d.ts +1 -2
- package/dist/ai/blocks/divider.d.ts +1 -2
- package/dist/ai/blocks/error.d.ts +1 -2
- package/dist/ai/blocks/index.d.ts +7 -8
- package/dist/ai/blocks/info.d.ts +1 -2
- package/dist/ai/blocks/loading.d.ts +1 -2
- package/dist/ai/blocks/stat-row.d.ts +1 -2
- package/dist/ai/blocks/success.d.ts +1 -2
- package/dist/ai/blocks/text.d.ts +1 -2
- package/dist/ai/command-bar.d.ts +1 -2
- package/dist/ai/conversation.d.ts +2 -3
- package/dist/ai/devadoot-icon.d.ts +0 -1
- package/dist/ai/index.d.ts +16 -17
- package/dist/ai/types.js +1 -0
- package/dist/composed/activity-feed.d.ts +1 -2
- package/dist/composed/avatar-group.d.ts +11 -10
- package/dist/composed/avatar-group.d.ts.map +1 -1
- package/dist/composed/avatar-group.js +108 -140
- package/dist/composed/avatar-group.js.map +1 -1
- package/dist/composed/bulk-action-bar.d.ts +20 -13
- package/dist/composed/bulk-action-bar.d.ts.map +1 -1
- package/dist/composed/bulk-action-bar.js +81 -110
- package/dist/composed/bulk-action-bar.js.map +1 -1
- package/dist/composed/command-palette.d.ts +1 -2
- package/dist/composed/confirm-dialog.d.ts +0 -1
- package/dist/composed/date-picker/calendar-grid.d.ts +0 -1
- package/dist/composed/date-picker/date-picker.d.ts +0 -1
- package/dist/composed/date-picker/date-range-picker.d.ts +1 -2
- package/dist/composed/date-picker/date-time-picker.d.ts +0 -1
- package/dist/composed/date-picker/index.d.ts +17 -18
- package/dist/composed/date-picker/month-picker.d.ts +0 -1
- package/dist/composed/date-picker/presets.d.ts +0 -1
- package/dist/composed/date-picker/time-picker.d.ts +0 -1
- package/dist/composed/date-picker/use-calendar.d.ts +0 -1
- package/dist/composed/date-picker/year-picker.d.ts +0 -1
- package/dist/composed/deadline-indicator.d.ts +0 -1
- package/dist/composed/diff.d.ts +0 -1
- package/dist/composed/emoji-picker.d.ts +0 -1
- package/dist/composed/empty-state.d.ts +1 -2
- package/dist/composed/error-boundary.d.ts +15 -4
- package/dist/composed/error-boundary.d.ts.map +1 -1
- package/dist/composed/error-boundary.js +43 -26
- package/dist/composed/error-boundary.js.map +1 -1
- package/dist/composed/extensions/emoji-data.d.ts +0 -1
- package/dist/composed/extensions/emoji-node.d.ts +0 -1
- package/dist/composed/extensions/emoji-suggestion.d.ts +1 -2
- package/dist/composed/extensions/file-attachment.d.ts +0 -1
- package/dist/composed/extensions/mention-suggestion.d.ts +1 -2
- package/dist/composed/extensions/slash-command.d.ts +0 -1
- package/dist/composed/file-preview/audio-preview.d.ts +0 -1
- package/dist/composed/file-preview/document-preview.d.ts +0 -1
- package/dist/composed/file-preview/embed-preview.d.ts +0 -1
- package/dist/composed/file-preview/image-preview.d.ts +0 -1
- package/dist/composed/file-preview/shared.d.ts +0 -1
- package/dist/composed/file-preview/video-preview.d.ts +0 -1
- package/dist/composed/file-preview.d.ts +0 -1
- package/dist/composed/filter-bar.d.ts +0 -1
- package/dist/composed/form-section.d.ts +0 -1
- package/dist/composed/global-loading.d.ts +0 -1
- package/dist/composed/index.d.ts +49 -50
- package/dist/composed/inline-edit.d.ts +0 -1
- package/dist/composed/loading-skeleton.d.ts +2 -0
- package/dist/composed/loading-skeleton.d.ts.map +1 -1
- package/dist/composed/loading-skeleton.js +79 -56
- package/dist/composed/loading-skeleton.js.map +1 -1
- package/dist/composed/markdown-viewer.d.ts +0 -1
- package/dist/composed/master-detail.d.ts +21 -9
- package/dist/composed/master-detail.d.ts.map +1 -1
- package/dist/composed/master-detail.js +91 -77
- package/dist/composed/master-detail.js.map +1 -1
- package/dist/composed/member-picker.d.ts +0 -1
- package/dist/composed/multi-select-popover.d.ts +0 -1
- package/dist/composed/page-skeletons.d.ts +6 -0
- package/dist/composed/page-skeletons.d.ts.map +1 -1
- package/dist/composed/page-skeletons.js +93 -71
- package/dist/composed/page-skeletons.js.map +1 -1
- package/dist/composed/priority-indicator.d.ts +0 -1
- package/dist/composed/responsive-modal.d.ts +1 -2
- package/dist/composed/responsive-modal.js +47 -47
- package/dist/composed/rich-chat-input/attachment-strip.d.ts +0 -1
- package/dist/composed/rich-chat-input/audio-player.d.ts +0 -1
- package/dist/composed/rich-chat-input/audio-waveform.d.ts +0 -1
- package/dist/composed/rich-chat-input/chat-toolbar.d.ts +0 -1
- package/dist/composed/rich-chat-input/recording-overlay.d.ts +0 -1
- package/dist/composed/rich-chat-input/reply-banner.d.ts +0 -1
- package/dist/composed/rich-chat-input/schedule-send.d.ts +0 -1
- package/dist/composed/rich-chat-input/use-voice-recorder.d.ts +0 -1
- package/dist/composed/rich-chat-input.d.ts +9 -10
- package/dist/composed/rich-chat-input.js +1 -1
- package/dist/composed/rich-text-editor.d.ts +1 -2
- package/dist/composed/schedule-view.d.ts +0 -1
- package/dist/composed/simple-tooltip.d.ts +0 -1
- package/dist/composed/status-badge.d.ts +1 -2
- package/dist/hooks/index.d.ts +6 -7
- package/dist/hooks/use-color-mode.d.ts +0 -1
- package/dist/hooks/use-mobile.d.ts +0 -1
- package/dist/hooks/use-touch-device.d.ts +0 -1
- package/dist/hooks/use-viewport-height.d.ts +0 -1
- package/dist/motion/check-motion-provider.d.ts +0 -1
- package/dist/motion/index.d.ts +2 -3
- package/dist/motion/motion-provider.d.ts +1 -2
- package/dist/motion/primitives-index.d.ts +1 -2
- package/dist/motion/primitives.d.ts +1 -2
- package/dist/primitives/_internal/react-arrow.d.ts +1 -1
- package/dist/primitives/_internal/react-collection.d.ts +2 -2
- package/dist/primitives/_internal/react-dismissable-layer.d.ts +1 -1
- package/dist/primitives/_internal/react-focus-scope.d.ts +1 -1
- package/dist/primitives/_internal/react-popper.d.ts +4 -4
- package/dist/primitives/_internal/react-portal.d.ts +1 -1
- package/dist/primitives/_internal/react-use-rect.d.ts +1 -1
- package/dist/primitives/react-accordion.d.ts +3 -3
- package/dist/primitives/react-alert-dialog.d.ts +2 -2
- package/dist/primitives/react-aspect-ratio.d.ts +1 -1
- package/dist/primitives/react-avatar.d.ts +2 -2
- package/dist/primitives/react-checkbox.d.ts +3 -3
- package/dist/primitives/react-collapsible.d.ts +2 -2
- package/dist/primitives/react-context-menu.d.ts +3 -3
- package/dist/primitives/react-dialog.d.ts +5 -5
- package/dist/primitives/react-dropdown-menu.d.ts +3 -3
- package/dist/primitives/react-hover-card.d.ts +5 -5
- package/dist/primitives/react-label.d.ts +1 -1
- package/dist/primitives/react-menu.d.ts +7 -7
- package/dist/primitives/react-menubar.d.ts +5 -5
- package/dist/primitives/react-navigation-menu.d.ts +5 -5
- package/dist/primitives/react-popover.d.ts +6 -6
- package/dist/primitives/react-progress.d.ts +2 -2
- package/dist/primitives/react-radio-group.d.ts +3 -3
- package/dist/primitives/react-roving-focus.d.ts +2 -2
- package/dist/primitives/react-select.d.ts +6 -6
- package/dist/primitives/react-separator.d.ts +1 -1
- package/dist/primitives/react-slider.d.ts +2 -2
- package/dist/primitives/react-switch.d.ts +2 -2
- package/dist/primitives/react-tabs.d.ts +3 -3
- package/dist/primitives/react-toast.d.ts +3 -3
- package/dist/primitives/react-toggle-group.d.ts +4 -4
- package/dist/primitives/react-toggle.d.ts +1 -1
- package/dist/primitives/react-tooltip.d.ts +5 -5
- package/dist/primitives/react-visually-hidden.d.ts +1 -1
- package/dist/shell/app-command-palette.d.ts +2 -3
- package/dist/shell/bottom-navbar.d.ts +1 -2
- package/dist/shell/command-registry.d.ts +1 -2
- package/dist/shell/index.d.ts +12 -11
- package/dist/shell/index.d.ts.map +1 -1
- package/dist/shell/index.js +2 -3
- package/dist/shell/link-context.d.ts +2 -3
- package/dist/shell/notification-center.d.ts +0 -1
- package/dist/shell/notification-preferences.d.ts +0 -1
- package/dist/shell/notification-preferences.d.ts.map +1 -1
- package/dist/shell/notification-preferences.js +2 -0
- package/dist/shell/notification-preferences.js.map +1 -1
- package/dist/shell/top-bar.d.ts +1 -2
- package/dist/test-utils/conformance.d.ts +0 -1
- package/dist/ui/accordion.d.ts +1 -2
- package/dist/ui/accordion.js +1 -1
- package/dist/ui/alert-dialog.d.ts +1 -2
- package/dist/ui/alert-dialog.js +52 -52
- package/dist/ui/alert.d.ts +0 -1
- package/dist/ui/aspect-ratio.d.ts +1 -2
- package/dist/ui/aspect-ratio.js +4 -4
- package/dist/ui/autocomplete.d.ts +1 -2
- package/dist/ui/autocomplete.js +1 -1
- package/dist/ui/avatar.d.ts +1 -2
- package/dist/ui/avatar.js +33 -33
- package/dist/ui/badge-group.d.ts +1 -2
- package/dist/ui/badge-indicator.d.ts +0 -1
- package/dist/ui/badge.d.ts +3 -4
- package/dist/ui/banner.d.ts +0 -1
- package/dist/ui/breadcrumb.js +1 -1
- package/dist/ui/button-group.d.ts +1 -2
- package/dist/ui/button-processing.d.ts +0 -1
- package/dist/ui/button.d.ts +1 -2
- package/dist/ui/button.js +1 -1
- package/dist/ui/card.d.ts +0 -1
- package/dist/ui/charts/_internal/animation.d.ts +0 -1
- package/dist/ui/charts/_internal/axes.d.ts +0 -1
- package/dist/ui/charts/_internal/colors.d.ts +1 -2
- package/dist/ui/charts/_internal/grid-lines.d.ts +0 -1
- package/dist/ui/charts/_internal/legend.d.ts +0 -1
- package/dist/ui/charts/_internal/scales.d.ts +0 -1
- package/dist/ui/charts/_internal/tooltip.d.ts +0 -1
- package/dist/ui/charts/_internal/types.d.ts +0 -1
- package/dist/ui/charts/area-chart.d.ts +1 -2
- package/dist/ui/charts/bar-chart.d.ts +1 -2
- package/dist/ui/charts/chart-container.d.ts +1 -2
- package/dist/ui/charts/gauge-chart.d.ts +0 -1
- package/dist/ui/charts/index.d.ts +9 -10
- package/dist/ui/charts/line-chart.d.ts +1 -2
- package/dist/ui/charts/pie-chart.d.ts +0 -1
- package/dist/ui/charts/radar-chart.d.ts +0 -1
- package/dist/ui/charts/sparkline.d.ts +0 -1
- package/dist/ui/chat/date-separator.d.ts +0 -1
- package/dist/ui/chat/index.d.ts +7 -8
- package/dist/ui/chat/message-input.d.ts +0 -1
- package/dist/ui/chat/message-list.d.ts +0 -1
- package/dist/ui/chat/message.d.ts +1 -2
- package/dist/ui/chat/system-message.d.ts +1 -2
- package/dist/ui/chat/typing-indicator.d.ts +0 -1
- package/dist/ui/chat/unread-separator.d.ts +0 -1
- package/dist/ui/checkbox.d.ts +2 -3
- package/dist/ui/checkbox.js +13 -13
- package/dist/ui/collapsible.d.ts +1 -2
- package/dist/ui/collapsible.js +1 -1
- package/dist/ui/color-input.d.ts +0 -1
- package/dist/ui/color-swatch.d.ts +0 -1
- package/dist/ui/combobox.d.ts +3 -4
- package/dist/ui/combobox.d.ts.map +1 -1
- package/dist/ui/combobox.js +146 -141
- package/dist/ui/combobox.js.map +1 -1
- package/dist/ui/context-menu.d.ts +1 -2
- package/dist/ui/context-menu.js +58 -58
- package/dist/ui/data-table-body.d.ts +0 -1
- package/dist/ui/data-table-bulk-actions.d.ts +0 -1
- package/dist/ui/data-table-card.d.ts +0 -1
- package/dist/ui/data-table-context.d.ts +0 -1
- package/dist/ui/data-table-header.d.ts +0 -1
- package/dist/ui/data-table-pagination.d.ts +0 -1
- package/dist/ui/data-table-toolbar.d.ts +0 -1
- package/dist/ui/data-table.d.ts +3 -4
- package/dist/ui/devalok-grain.d.ts +0 -1
- package/dist/ui/dialog.d.ts +1 -2
- package/dist/ui/dialog.js +43 -43
- package/dist/ui/dot.d.ts +0 -1
- package/dist/ui/dropdown-menu.d.ts +1 -2
- package/dist/ui/dropdown-menu.js +69 -69
- package/dist/ui/file-upload.d.ts +0 -1
- package/dist/ui/file-upload.d.ts.map +1 -1
- package/dist/ui/file-upload.js +124 -138
- package/dist/ui/file-upload.js.map +1 -1
- package/dist/ui/form.d.ts +7 -1
- package/dist/ui/form.d.ts.map +1 -1
- package/dist/ui/form.js +4 -2
- package/dist/ui/form.js.map +1 -1
- package/dist/ui/hover-card.d.ts +1 -2
- package/dist/ui/hover-card.js +16 -16
- package/dist/ui/icon-button.d.ts +4 -4
- package/dist/ui/icon-button.d.ts.map +1 -1
- package/dist/ui/icon-button.js +1 -1
- package/dist/ui/icon-button.js.map +1 -1
- package/dist/ui/icon-context.d.ts +0 -1
- package/dist/ui/icon-group.d.ts +1 -2
- package/dist/ui/icon.d.ts +1 -2
- package/dist/ui/index.d.ts +78 -79
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/input-otp.d.ts +0 -1
- package/dist/ui/input.d.ts +1 -2
- package/dist/ui/label.d.ts +1 -2
- package/dist/ui/label.d.ts.map +1 -1
- package/dist/ui/label.js +13 -12
- package/dist/ui/label.js.map +1 -1
- package/dist/ui/lib/bottom-sheet.d.ts +0 -1
- package/dist/ui/lib/check-tokens.d.ts +0 -1
- package/dist/ui/lib/field-state.d.ts +0 -1
- package/dist/ui/lib/icon-input.d.ts +0 -1
- package/dist/ui/lib/index.d.ts +6 -7
- package/dist/ui/lib/keybinding.d.ts +0 -1
- package/dist/ui/lib/link-context.d.ts +0 -1
- package/dist/ui/lib/mention.d.ts +0 -1
- package/dist/ui/lib/normalize-icon.d.ts +2 -2
- package/dist/ui/lib/slot.d.ts +2 -3
- package/dist/ui/lib/use-controllable-open.d.ts +0 -1
- package/dist/ui/link.d.ts +0 -1
- package/dist/ui/link.js +1 -1
- package/dist/ui/menubar.d.ts +1 -2
- package/dist/ui/menubar.js +64 -64
- package/dist/ui/navigation-menu.d.ts +1 -2
- package/dist/ui/navigation-menu.js +67 -67
- package/dist/ui/number-input.d.ts +1 -2
- package/dist/ui/oauth-button/index.d.ts +1 -2
- package/dist/ui/oauth-button/oauth-button.d.ts +2 -3
- package/dist/ui/pagination.d.ts +0 -1
- package/dist/ui/pagination.js +1 -1
- package/dist/ui/popover.d.ts +1 -2
- package/dist/ui/progress-ring.d.ts +0 -1
- package/dist/ui/progress.d.ts +1 -2
- package/dist/ui/progress.js +30 -30
- package/dist/ui/radio.d.ts +2 -3
- package/dist/ui/radio.js +18 -18
- package/dist/ui/search-input.d.ts +0 -1
- package/dist/ui/segmented-control.d.ts +1 -2
- package/dist/ui/select.d.ts +1 -2
- package/dist/ui/select.js +55 -55
- package/dist/ui/separator.d.ts +1 -2
- package/dist/ui/separator.js +5 -5
- package/dist/ui/sheet.d.ts +1 -2
- package/dist/ui/sheet.js +45 -45
- package/dist/ui/sidebar.d.ts +4 -5
- package/dist/ui/sidebar.js +1 -1
- package/dist/ui/slider.d.ts +1 -2
- package/dist/ui/slider.js +14 -14
- package/dist/ui/spinner.d.ts +0 -1
- package/dist/ui/spinner.d.ts.map +1 -1
- package/dist/ui/spinner.js +50 -44
- package/dist/ui/spinner.js.map +1 -1
- package/dist/ui/split-button.d.ts +14 -4
- package/dist/ui/split-button.d.ts.map +1 -1
- package/dist/ui/split-button.js.map +1 -1
- package/dist/ui/stat-card.d.ts +3 -4
- package/dist/ui/stat-flash.d.ts +1 -2
- package/dist/ui/stepper.d.ts +1 -2
- package/dist/ui/surface.js +1 -1
- package/dist/ui/switch.d.ts +2 -3
- package/dist/ui/switch.d.ts.map +1 -1
- package/dist/ui/switch.js +31 -31
- package/dist/ui/switch.js.map +1 -1
- package/dist/ui/table-row-link.d.ts +0 -1
- package/dist/ui/table.js +1 -1
- package/dist/ui/table.js.map +1 -1
- package/dist/ui/tabs.d.ts +1 -2
- package/dist/ui/tabs.js +35 -35
- package/dist/ui/textarea.d.ts +1 -2
- package/dist/ui/toast-registry.d.ts +0 -1
- package/dist/ui/toast-types.js +1 -0
- package/dist/ui/toast.d.ts +2 -3
- package/dist/ui/toaster.d.ts +0 -1
- package/dist/ui/toggle-group.d.ts +2 -3
- package/dist/ui/toggle-group.js +14 -14
- package/dist/ui/toggle.d.ts +1 -2
- package/dist/ui/toggle.js +12 -12
- package/dist/ui/tooltip.d.ts +1 -2
- package/dist/ui/tooltip.js +21 -21
- package/dist/ui/tree-view/index.d.ts +3 -4
- package/dist/ui/tree-view/tree-item.d.ts +1 -2
- package/dist/ui/tree-view/tree-view.d.ts +1 -2
- package/dist/ui/tree-view/use-tree.d.ts +1 -2
- package/dist/ui/truncated-text.d.ts +0 -1
- package/docs/components/composed/bulk-action-bar.md +9 -3
- package/docs/components/composed/error-boundary.md +18 -2
- package/docs/components/composed/master-detail.md +12 -2
- package/docs/components/composed/page-skeletons.md +2 -2
- package/docs/components/composed/rich-chat-input.md +18 -6
- package/docs/components/composed/simple-tooltip.md +1 -1
- package/docs/components/shell/app-command-palette.md +2 -1
- package/docs/components/shell/bottom-navbar.md +4 -4
- package/docs/components/shell/command-registry.md +2 -2
- package/docs/components/shell/link-context.md +2 -2
- package/docs/components/shell/top-bar.md +1 -1
- package/docs/components/ui/search-input.md +2 -2
- package/docs/components/ui/slider.md +2 -2
- package/docs/components/ui/split-button.md +3 -3
- package/docs/recipes/install-astro.md +2 -0
- package/docs/recipes/install-next-app-router.md +2 -0
- package/docs/recipes/install-remix.md +2 -0
- package/docs/recipes/install-tanstack-start.md +2 -0
- package/docs/recipes/install-vite.md +2 -0
- package/docs/recipes/troubleshoot.md +80 -0
- package/llms.txt +2 -2
- package/make-kit/Guidelines.md +1 -1
- package/make-kit/components/overview.md +2 -2
- package/make-kit/foundations/surfaces.md +1 -1
- package/mcp-manifest.json +411 -147
- package/package.json +30 -10
- package/skill/SKILL.md +1 -1
- package/skill/chat-skill/README.md +18 -0
- package/skill/chat-skill/SKILL.md +78 -0
- package/skill/chat-skill/chatgpt-instructions.md +26 -0
- package/skill/chat-skill/gemini-instructions.md +25 -0
- package/skill/references/components.md +2 -2
- package/skill/references/setup-astro.md +2 -0
- package/skill/references/setup-next-app-router.md +2 -0
- package/skill/references/setup-remix.md +2 -0
- package/skill/references/setup-tanstack-start.md +2 -0
- package/skill/references/setup-vite.md +2 -0
- package/skill/references/troubleshoot.md +80 -0
- package/dist/_chunks/primitives.js +0 -7596
- package/dist/_chunks/primitives.js.map +0 -1
- package/dist/shell/sidebar.d.ts +0 -113
- package/dist/shell/sidebar.d.ts.map +0 -1
- package/dist/shell/sidebar.js +0 -293
- package/dist/shell/sidebar.js.map +0 -1
- package/docs/components/shell/sidebar.md +0 -103
package/AGENTS.md
CHANGED
|
@@ -43,7 +43,7 @@ Read these local files. Your training data is outdated and will hallucinate APIs
|
|
|
43
43
|
### MCP tools
|
|
44
44
|
|
|
45
45
|
<!-- BEGIN:mcp-tools --><!-- generated by scripts/generate-tool-list.mjs — do not edit by hand -->
|
|
46
|
-
|
|
46
|
+
_17 tools (source: `packages/mcp-server/src/index.mjs`):_
|
|
47
47
|
|
|
48
48
|
**Reference:**
|
|
49
49
|
- `find_component` — Search shilp-sutra components by keyword (authoritative component index).
|
|
@@ -63,8 +63,14 @@ _13 tools (source: `packages/mcp-server/src/index.mjs`):_
|
|
|
63
63
|
**Quality:**
|
|
64
64
|
- `check_slop` — Pre-emit DESIGN-QUALITY gate (complements validate_snippet, which checks correctness).
|
|
65
65
|
|
|
66
|
+
**Presets:**
|
|
67
|
+
- `get_preset` — Full detail for one preset: the shadcn registry-item (dependencies, files, docs), plus the exact install steps — the components.json `registries` snippet to…
|
|
68
|
+
- `list_presets` — Discover the shilp-sutra Preset Library — pre-assembled real-world screens (sidebars, dashboards, auth) built FROM shilp-sutra components.
|
|
69
|
+
- `preview_preset` — READ-ONLY TSX source of a preset (+ its GitHub source URL), so you can show it, learn the composition, or adapt it inline WITHOUT installing.
|
|
70
|
+
|
|
66
71
|
**Write:**
|
|
67
72
|
- `report_issue` — File a bug report, feature request, suggestion, or docs-gap on the shilp-sutra repo when you hit a wall using the design system.
|
|
73
|
+
- `submit_entry` — Submit an entry to Build with Shilp Sutra, the online buildathon by Devalok.
|
|
68
74
|
<!-- END:mcp-tools -->
|
|
69
75
|
|
|
70
76
|
### Setting up in a new project (do this in order)
|
package/BREAKING.json
CHANGED
|
@@ -321,6 +321,35 @@
|
|
|
321
321
|
"ScheduleView: the ScheduleEvent `color` value \"primary\" was renamed \"accent\" (matches the DS colour vocabulary). Migrate { color: 'primary' } → { color: 'accent' }. It was the default, so untyped events are unaffected. Also added focus-visible rings on slot/event buttons.",
|
|
322
322
|
"New `Dot` primitive (@devalok/shilp-sutra/ui/dot) — the shared indicator dot. StatusBadge composes Badge + Dot; StatusDot and Badge's `dot` prop now render Dot internally. No API change to StatusBadge/StatusDot/Badge props (Badge's dot pulse animation shifted from a bespoke ripple to Dot's ping). StatusDot's `inactive` shade is now neutral-8 (was neutral-6)."
|
|
323
323
|
]
|
|
324
|
+
},
|
|
325
|
+
"0.54.0": {
|
|
326
|
+
"summary": "AppSidebar removed — the config-driven shell sidebar is retired in favour of composable Sidebar primitives (@devalok/shilp-sutra/ui/sidebar) + the copy-and-own sidebar-app preset.",
|
|
327
|
+
"migrationDoc": "MIGRATION.md#v0540--appsidebar-removed",
|
|
328
|
+
"removed": [
|
|
329
|
+
{
|
|
330
|
+
"symbol": "AppSidebar",
|
|
331
|
+
"where": "@devalok/shilp-sutra/shell/sidebar and the /shell barrel",
|
|
332
|
+
"replacement": "Compose the Sidebar primitives from @devalok/shilp-sutra/ui/sidebar, or install the sidebar-app preset (npx shadcn@latest add @devalok/sidebar-app; gallery at https://shilp-sutra.devalok.in/presets). The preset reproduces AppSidebar's shape as ownable source."
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
"symbol": "AppSidebarProps",
|
|
336
|
+
"where": "@devalok/shilp-sutra/shell/sidebar and the /shell barrel"
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
"symbol": "NavGroup, NavItem, NavSubItem, SidebarUser, SidebarPromo, SidebarFooterConfig",
|
|
340
|
+
"where": "@devalok/shilp-sutra/shell/sidebar (AppSidebar config types)"
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
"symbol": "./shell/sidebar",
|
|
344
|
+
"where": "package.json exports (subpath removed)",
|
|
345
|
+
"replacement": "@devalok/shilp-sutra/ui/sidebar for the primitives"
|
|
346
|
+
}
|
|
347
|
+
],
|
|
348
|
+
"notes": [
|
|
349
|
+
"The Sidebar PRIMITIVES (@devalok/shilp-sutra/ui/sidebar — Sidebar, SidebarProvider, SidebarMenu, SidebarMenuSub*, SidebarMenuBadge, SidebarGroupAction, etc.) are unchanged. Only the config-driven AppSidebar wrapper on top of them is removed.",
|
|
350
|
+
"Fastest migration: `npx shadcn@latest add @devalok/sidebar-app`, then replace <AppSidebar navGroups={…} user={…} currentPath={…} /> with the pasted <SidebarApp/>, wiring your router Link + active path. Composing @devalok/shilp-sutra/ui/sidebar directly is equally valid and needs no registry.",
|
|
351
|
+
"Deprecation cycle: no PUBLISHED version carried an @deprecated AppSidebar — 0.53.0 shipped it undeprecated, 0.54.0 removes it. The deprecation marker existed only within the unreleased 0.54.0 line. This is a deliberate call for a 0.x beta with a single coordinated consumer (breaking changes ship in 0.x minors); a post-1.0 removal would get a real deprecate→remove window."
|
|
352
|
+
]
|
|
324
353
|
}
|
|
325
354
|
}
|
|
326
355
|
}
|
package/MIGRATION.md
CHANGED
|
@@ -4,6 +4,89 @@ This page indexes all breaking changes across `@devalok/shilp-sutra` versions. F
|
|
|
4
4
|
|
|
5
5
|
> **Upgrading from < 0.36?** Start here, then read each intermediate version section. Breaking changes stack — skipping versions means stacking migrations.
|
|
6
6
|
|
|
7
|
+
## v0.55.0 — additive; one optional step if you use the editors
|
|
8
|
+
|
|
9
|
+
Nothing breaks. No existing import, prop value, or install stops working.
|
|
10
|
+
|
|
11
|
+
### If you type-check declarations, upgrade for the fix
|
|
12
|
+
|
|
13
|
+
0.54.0's published `.d.ts` were unusable with `skipLibCheck: false` — a barrel import produced 79 errors, and `moduleResolution: "node16" | "nodenext"` failed regardless. Both are fixed; no action beyond upgrading.
|
|
14
|
+
|
|
15
|
+
### If you import `RichTextEditor` or `RichChatInput`, add two devDependencies
|
|
16
|
+
|
|
17
|
+
These components expose TipTap's `Editor` type. TipTap's runtime is bundled — you are not installing it to run anything — but your type-checker needs to resolve the package to read the type:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pnpm add -D @tiptap/pm @tiptap/react
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
`@tiptap/pm` is required alongside `@tiptap/react` because TipTap's own declarations import from it. Both are **optional peers**: skip them and the components still run, you just lose the editor type.
|
|
24
|
+
|
|
25
|
+
Previously these resolved to `error TS2307: Cannot find module '@tiptap/react'` with nothing telling you what to install, so this replaces a silent failure with a documented one-liner.
|
|
26
|
+
|
|
27
|
+
### Three dependencies removed — nothing to do
|
|
28
|
+
|
|
29
|
+
`diff`, `frimousse` and `@emoji-mart/data` are no longer declared. They were always bundled into `dist`, so they were installed for no reason. Diff, EmojiPicker and the editors are unaffected.
|
|
30
|
+
|
|
31
|
+
### Bundle size improves on its own
|
|
32
|
+
|
|
33
|
+
Vendored Radix primitives now ship as one chunk per primitive instead of a single 231 KB block. A single-component import drops from ~209 KB to ~90 KB of our code; a twelve-component app from ~252 KB to ~213 KB. No API change — rebuild and the improvement applies.
|
|
34
|
+
|
|
35
|
+
## v0.54.0 — AppSidebar removed
|
|
36
|
+
|
|
37
|
+
**Breaking.** The config-driven `AppSidebar` shell component is removed. It was a
|
|
38
|
+
convenience wrapper over the `Sidebar` primitives; those **primitives are
|
|
39
|
+
unchanged** (`@devalok/shilp-sutra/ui/sidebar`). Only the wrapper — and its config
|
|
40
|
+
types and subpath export — are gone.
|
|
41
|
+
|
|
42
|
+
**Removed**
|
|
43
|
+
|
|
44
|
+
| Symbol | Was at |
|
|
45
|
+
| --- | --- |
|
|
46
|
+
| `AppSidebar`, `AppSidebarProps` | `@devalok/shilp-sutra/shell/sidebar` + the `/shell` barrel |
|
|
47
|
+
| `NavGroup`, `NavItem`, `NavSubItem`, `SidebarUser`, `SidebarPromo`, `SidebarFooterConfig` | `@devalok/shilp-sutra/shell/sidebar` (AppSidebar config types) |
|
|
48
|
+
| `@devalok/shilp-sutra/shell/sidebar` (subpath export) | — |
|
|
49
|
+
|
|
50
|
+
**Migrate — option A (fastest): install the `sidebar-app` preset.** It reproduces
|
|
51
|
+
AppSidebar's shape (logo, grouped nav, collapsible sub-items, badges, group `+`
|
|
52
|
+
action, user footer) as source you own and edit.
|
|
53
|
+
|
|
54
|
+
Register the registry once in `components.json`:
|
|
55
|
+
|
|
56
|
+
```json
|
|
57
|
+
{ "registries": { "@devalok": "https://shilp-sutra.devalok.in/r/{name}.json" } }
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Then:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
npx shadcn@latest add @devalok/sidebar-app
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Replace the wrapper with the pasted component, wiring your router:
|
|
67
|
+
|
|
68
|
+
```tsx
|
|
69
|
+
// Before
|
|
70
|
+
import { AppSidebar } from '@devalok/shilp-sutra/shell/sidebar'
|
|
71
|
+
<AppSidebar navGroups={groups} user={user} currentPath={pathname} />
|
|
72
|
+
|
|
73
|
+
// After — you own SidebarApp; edit the markup directly
|
|
74
|
+
import { SidebarApp } from '@/components/devalok/sidebar-app/sidebar-app'
|
|
75
|
+
<SidebarApp />
|
|
76
|
+
// In SidebarApp: swap <a> for next/link and CURRENT_PATH for usePathname().
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Other shapes: `@devalok/sidebar-projects`, `@devalok/sidebar-client`,
|
|
80
|
+
`@devalok/sidebar-minimal`. Gallery: <https://shilp-sutra.devalok.in/presets>.
|
|
81
|
+
|
|
82
|
+
**Migrate — option B: compose the primitives directly** from
|
|
83
|
+
`@devalok/shilp-sutra/ui/sidebar` (`Sidebar`, `SidebarProvider`, `SidebarMenu`,
|
|
84
|
+
`SidebarMenuButton`, `SidebarMenuSub*`, `SidebarMenuBadge`, `SidebarGroupAction`,
|
|
85
|
+
…). The preset in option A is itself a worked example of this.
|
|
86
|
+
|
|
87
|
+
> Requires `@devalok/shilp-sutra` installed and its CSS imported
|
|
88
|
+
> (`@import "@devalok/shilp-sutra/css";`). framer-motion ^12 is a required peer.
|
|
89
|
+
|
|
7
90
|
## v0.53.0 — additive (no migration required)
|
|
8
91
|
|
|
9
92
|
Nothing breaks at the TypeScript level; this release is additive.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { Slot as e } from "./primitives.js";
|
|
2
|
+
import { Slot as e } from "./primitives-internal.js";
|
|
3
3
|
import { durations as t, springs as n } from "../ui/lib/motion.js";
|
|
4
4
|
import { cva as r } from "./vendor-utils.js";
|
|
5
5
|
import { cn as i } from "../ui/lib/utils.js";
|
package/dist/_chunks/popover.js
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { useIsMobile as
|
|
2
|
+
import { springs as e, tweens as t } from "../ui/lib/motion.js";
|
|
3
|
+
import { cn as n } from "../ui/lib/utils.js";
|
|
4
|
+
import { Content as r, Overlay as i, Portal as a, Root as o } from "./primitives/react-alert-dialog.js";
|
|
5
|
+
import { useIsMobile as s } from "../hooks/use-mobile.js";
|
|
6
|
+
import { Anchor2 as c, Content2 as l, Portal as u, Root2 as d, Trigger as f } from "./primitives/react-popover.js";
|
|
6
7
|
import { useControllableOpen as p } from "./use-controllable-open.js";
|
|
7
8
|
import * as m from "react";
|
|
8
9
|
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
9
10
|
import { AnimatePresence as _, motion as v, useReducedMotion as y } from "framer-motion";
|
|
10
11
|
//#region src/ui/lib/bottom-sheet.tsx
|
|
11
|
-
function b({ open:
|
|
12
|
+
function b({ open: s, onOpenChange: c, children: l, className: u, dragHandle: d = !0, swipeable: f = !0, title: p }) {
|
|
12
13
|
let b = y(), x = m.useRef(null), S = m.useCallback((e, t) => {
|
|
13
|
-
let
|
|
14
|
-
(t.offset.y >
|
|
15
|
-
}, [
|
|
14
|
+
let n = x.current?.getBoundingClientRect().height ?? 300;
|
|
15
|
+
(t.offset.y > n * .3 || t.velocity.y > 500) && c(!1);
|
|
16
|
+
}, [c]);
|
|
16
17
|
return /* @__PURE__ */ h(o, {
|
|
17
|
-
open:
|
|
18
|
-
onOpenChange:
|
|
19
|
-
children: /* @__PURE__ */ h(_, { children:
|
|
18
|
+
open: s,
|
|
19
|
+
onOpenChange: c,
|
|
20
|
+
children: /* @__PURE__ */ h(_, { children: s && /* @__PURE__ */ g(a, {
|
|
20
21
|
forceMount: !0,
|
|
21
|
-
children: [/* @__PURE__ */ h(
|
|
22
|
+
children: [/* @__PURE__ */ h(i, {
|
|
22
23
|
forceMount: !0,
|
|
23
24
|
asChild: !0,
|
|
24
25
|
children: /* @__PURE__ */ h(v.div, {
|
|
@@ -26,29 +27,29 @@ function b({ open: e, onOpenChange: n, children: i, className: s, dragHandle: c
|
|
|
26
27
|
initial: { opacity: 0 },
|
|
27
28
|
animate: { opacity: 1 },
|
|
28
29
|
exit: { opacity: 0 },
|
|
29
|
-
transition:
|
|
30
|
+
transition: t.fade
|
|
30
31
|
})
|
|
31
|
-
}), /* @__PURE__ */ h(
|
|
32
|
+
}), /* @__PURE__ */ h(r, {
|
|
32
33
|
forceMount: !0,
|
|
33
34
|
asChild: !0,
|
|
34
35
|
"aria-label": p,
|
|
35
36
|
children: /* @__PURE__ */ g(v.div, {
|
|
36
37
|
ref: x,
|
|
37
|
-
className:
|
|
38
|
+
className: n("fixed inset-x-0 bottom-0 z-modal max-h-[85vh] overflow-y-auto rounded-t-overlay-lg border-t border-surface-border-strong bg-surface-overlay shadow-overlay outline-hidden", u),
|
|
38
39
|
initial: { y: "100%" },
|
|
39
40
|
animate: { y: 0 },
|
|
40
41
|
exit: { y: "100%" },
|
|
41
|
-
transition: b ? { duration: 0 } :
|
|
42
|
+
transition: b ? { duration: 0 } : e.smooth,
|
|
42
43
|
drag: f && !b ? "y" : !1,
|
|
43
44
|
dragConstraints: { top: 0 },
|
|
44
45
|
dragElastic: .2,
|
|
45
46
|
onDragEnd: S,
|
|
46
|
-
children: [
|
|
47
|
+
children: [d && /* @__PURE__ */ h("div", {
|
|
47
48
|
className: "flex justify-center pt-ds-03 pb-ds-02",
|
|
48
49
|
children: /* @__PURE__ */ h("div", { className: "h-1 w-8 rounded-pill bg-surface-border" })
|
|
49
50
|
}), /* @__PURE__ */ h("div", {
|
|
50
51
|
className: "px-ds-05 pb-ds-06",
|
|
51
|
-
children:
|
|
52
|
+
children: l
|
|
52
53
|
})]
|
|
53
54
|
})
|
|
54
55
|
})]
|
|
@@ -65,13 +66,13 @@ var x = m.createContext({
|
|
|
65
66
|
open: e,
|
|
66
67
|
defaultOpen: t,
|
|
67
68
|
onOpenChange: n
|
|
68
|
-
}),
|
|
69
|
+
}), s = m.useMemo(() => ({
|
|
69
70
|
open: i,
|
|
70
71
|
onClose: o
|
|
71
72
|
}), [i, o]);
|
|
72
73
|
return /* @__PURE__ */ h(x.Provider, {
|
|
73
|
-
value:
|
|
74
|
-
children: /* @__PURE__ */ h(
|
|
74
|
+
value: s,
|
|
75
|
+
children: /* @__PURE__ */ h(d, {
|
|
75
76
|
open: i,
|
|
76
77
|
onOpenChange: a,
|
|
77
78
|
...r
|
|
@@ -79,25 +80,25 @@ var x = m.createContext({
|
|
|
79
80
|
});
|
|
80
81
|
};
|
|
81
82
|
S.displayName = "Popover";
|
|
82
|
-
var C =
|
|
83
|
-
let
|
|
84
|
-
return
|
|
83
|
+
var C = f, w = c, T = m.forwardRef(({ className: r, align: i = "center", sideOffset: a = 4, children: o, ...c }, d) => {
|
|
84
|
+
let f = s(), { open: p, onClose: g } = m.useContext(x);
|
|
85
|
+
return f ? /* @__PURE__ */ h(b, {
|
|
85
86
|
open: p,
|
|
86
87
|
onOpenChange: (e) => {
|
|
87
88
|
e || g();
|
|
88
89
|
},
|
|
89
90
|
title: "Options",
|
|
90
|
-
className:
|
|
91
|
-
children:
|
|
92
|
-
}) : /* @__PURE__ */ h(_, { children: p && /* @__PURE__ */ h(
|
|
91
|
+
className: r,
|
|
92
|
+
children: o
|
|
93
|
+
}) : /* @__PURE__ */ h(_, { children: p && /* @__PURE__ */ h(u, {
|
|
93
94
|
forceMount: !0,
|
|
94
|
-
children: /* @__PURE__ */ h(
|
|
95
|
-
ref:
|
|
96
|
-
align:
|
|
97
|
-
sideOffset:
|
|
95
|
+
children: /* @__PURE__ */ h(l, {
|
|
96
|
+
ref: d,
|
|
97
|
+
align: i,
|
|
98
|
+
sideOffset: a,
|
|
98
99
|
forceMount: !0,
|
|
99
100
|
asChild: !0,
|
|
100
|
-
...
|
|
101
|
+
...c,
|
|
101
102
|
children: /* @__PURE__ */ h(v.div, {
|
|
102
103
|
initial: {
|
|
103
104
|
opacity: 0,
|
|
@@ -112,15 +113,15 @@ var C = c, w = e, T = m.forwardRef(({ className: e, align: t = "center", sideOff
|
|
|
112
113
|
scale: .95
|
|
113
114
|
},
|
|
114
115
|
transition: {
|
|
115
|
-
...
|
|
116
|
-
opacity:
|
|
116
|
+
...e.snappy,
|
|
117
|
+
opacity: t.fade
|
|
117
118
|
},
|
|
118
|
-
className:
|
|
119
|
-
children:
|
|
119
|
+
className: n("z-popover w-72 rounded-overlay bg-surface-overlay p-ds-05 text-surface-fg shadow-floating outline-hidden", r),
|
|
120
|
+
children: o
|
|
120
121
|
})
|
|
121
122
|
})
|
|
122
123
|
}) });
|
|
123
124
|
});
|
|
124
|
-
T.displayName =
|
|
125
|
+
T.displayName = l.displayName;
|
|
125
126
|
//#endregion
|
|
126
127
|
export { S as Popover, w as PopoverAnchor, T as PopoverContent, C as PopoverTrigger };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.js","names":[],"sources":["../../src/ui/lib/bottom-sheet.tsx","../../src/ui/popover.tsx"],"sourcesContent":["'use client'\n\nimport * as DialogPrimitive from '@primitives/react-dialog'\nimport { AnimatePresence, motion, useReducedMotion } from 'framer-motion'\nimport * as React from 'react'\n\nimport { springs, tweens } from './motion'\nimport { cn } from './utils'\n\nexport interface BottomSheetProps {\n open: boolean\n onOpenChange: (open: boolean) => void\n children: React.ReactNode\n className?: string\n /** Show drag handle bar at top. @default true */\n dragHandle?: boolean\n /** Allow swipe-to-dismiss. @default true */\n swipeable?: boolean\n /** Title for accessibility (sets aria-label on the dialog). */\n title?: string\n}\n\nexport function BottomSheet({\n open,\n onOpenChange,\n children,\n className,\n dragHandle = true,\n swipeable = true,\n title,\n}: BottomSheetProps) {\n const isReduced = useReducedMotion()\n const sheetRef = React.useRef<HTMLDivElement>(null)\n\n const handleDragEnd = React.useCallback(\n (_: unknown, info: { offset: { y: number }; velocity: { y: number } }) => {\n const sheetHeight = sheetRef.current?.getBoundingClientRect().height ?? 300\n if (info.offset.y > sheetHeight * 0.3 || info.velocity.y > 500) {\n onOpenChange(false)\n }\n },\n [onOpenChange],\n )\n\n return (\n <DialogPrimitive.Root open={open} onOpenChange={onOpenChange}>\n <AnimatePresence>\n {open && (\n <DialogPrimitive.Portal forceMount>\n <DialogPrimitive.Overlay forceMount asChild>\n <motion.div\n className=\"fixed inset-0 z-modal bg-overlay\"\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={tweens.fade}\n />\n </DialogPrimitive.Overlay>\n\n <DialogPrimitive.Content\n forceMount\n asChild\n aria-label={title}\n >\n <motion.div\n ref={sheetRef}\n className={cn(\n 'fixed inset-x-0 bottom-0 z-modal max-h-[85vh] overflow-y-auto rounded-t-overlay-lg border-t border-surface-border-strong bg-surface-overlay shadow-overlay outline-hidden',\n className,\n )}\n initial={{ y: '100%' }}\n animate={{ y: 0 }}\n exit={{ y: '100%' }}\n transition={isReduced ? { duration: 0 } : springs.smooth}\n drag={swipeable && !isReduced ? 'y' : false}\n dragConstraints={{ top: 0 }}\n dragElastic={0.2}\n onDragEnd={handleDragEnd}\n >\n {dragHandle && (\n <div className=\"flex justify-center pt-ds-03 pb-ds-02\">\n <div className=\"h-1 w-8 rounded-pill bg-surface-border\" />\n </div>\n )}\n <div className=\"px-ds-05 pb-ds-06\">\n {children}\n </div>\n </motion.div>\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n )}\n </AnimatePresence>\n </DialogPrimitive.Root>\n )\n}\n","'use client'\n\nimport * as PopoverPrimitive from '@primitives/react-popover'\nimport { AnimatePresence,motion } from 'framer-motion'\nimport * as React from 'react'\n\nimport { useIsMobile } from '../hooks/use-mobile'\nimport { BottomSheet } from './lib/bottom-sheet'\nimport { springs, tweens } from './lib/motion'\nimport { useControllableOpen } from './lib/use-controllable-open'\nimport { cn } from './lib/utils'\n\n// ── Internal context to thread `open` state to animated children ──\n\nconst PopoverOpenContext = React.createContext<{ open: boolean; onClose: () => void }>({ open: false, onClose: () => {} })\n\nconst Popover: React.FC<React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Root>> = ({\n open: controlledOpen,\n defaultOpen = false,\n onOpenChange,\n ...props\n}) => {\n const { open, setOpen, close } = useControllableOpen({ open: controlledOpen, defaultOpen, onOpenChange })\n\n const contextValue = React.useMemo(\n () => ({ open, onClose: close }),\n [open, close],\n )\n\n return (\n <PopoverOpenContext.Provider value={contextValue}>\n <PopoverPrimitive.Root open={open} onOpenChange={setOpen} {...props} />\n </PopoverOpenContext.Provider>\n )\n}\nPopover.displayName = 'Popover'\n\nconst PopoverTrigger = PopoverPrimitive.Trigger\n\nconst PopoverAnchor = PopoverPrimitive.Anchor\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(({ className, align = 'center', sideOffset = 4, children, ...props }, ref) => {\n const isMobileRaw = useIsMobile()\n const { open, onClose } = React.useContext(PopoverOpenContext)\n\n if (isMobileRaw) {\n return (\n <BottomSheet\n open={open}\n onOpenChange={(v) => { if (!v) onClose() }}\n title=\"Options\"\n className={className}\n >\n {children}\n </BottomSheet>\n )\n }\n\n return (\n <AnimatePresence>\n {open && (\n <PopoverPrimitive.Portal forceMount>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n forceMount\n asChild\n {...props}\n >\n <motion.div\n initial={{ opacity: 0, scale: 0.95 }}\n animate={{ opacity: 1, scale: 1 }}\n exit={{ opacity: 0, scale: 0.95 }}\n transition={{ ...springs.snappy, opacity: tweens.fade }}\n className={cn(\n 'z-popover w-72 rounded-overlay bg-surface-overlay p-ds-05 text-surface-fg shadow-floating outline-hidden',\n className,\n )}\n >\n {children}\n </motion.div>\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n )}\n </AnimatePresence>\n )\n})\nPopoverContent.displayName = PopoverPrimitive.Content.displayName\n\nexport type PopoverContentProps = React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n\nexport { Popover, PopoverAnchor,PopoverContent, PopoverTrigger }\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"popover.js","names":[],"sources":["../../src/ui/lib/bottom-sheet.tsx","../../src/ui/popover.tsx"],"sourcesContent":["'use client'\n\nimport * as DialogPrimitive from '@primitives/react-dialog'\nimport { AnimatePresence, motion, useReducedMotion } from 'framer-motion'\nimport * as React from 'react'\n\nimport { springs, tweens } from './motion'\nimport { cn } from './utils'\n\nexport interface BottomSheetProps {\n open: boolean\n onOpenChange: (open: boolean) => void\n children: React.ReactNode\n className?: string\n /** Show drag handle bar at top. @default true */\n dragHandle?: boolean\n /** Allow swipe-to-dismiss. @default true */\n swipeable?: boolean\n /** Title for accessibility (sets aria-label on the dialog). */\n title?: string\n}\n\nexport function BottomSheet({\n open,\n onOpenChange,\n children,\n className,\n dragHandle = true,\n swipeable = true,\n title,\n}: BottomSheetProps) {\n const isReduced = useReducedMotion()\n const sheetRef = React.useRef<HTMLDivElement>(null)\n\n const handleDragEnd = React.useCallback(\n (_: unknown, info: { offset: { y: number }; velocity: { y: number } }) => {\n const sheetHeight = sheetRef.current?.getBoundingClientRect().height ?? 300\n if (info.offset.y > sheetHeight * 0.3 || info.velocity.y > 500) {\n onOpenChange(false)\n }\n },\n [onOpenChange],\n )\n\n return (\n <DialogPrimitive.Root open={open} onOpenChange={onOpenChange}>\n <AnimatePresence>\n {open && (\n <DialogPrimitive.Portal forceMount>\n <DialogPrimitive.Overlay forceMount asChild>\n <motion.div\n className=\"fixed inset-0 z-modal bg-overlay\"\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={tweens.fade}\n />\n </DialogPrimitive.Overlay>\n\n <DialogPrimitive.Content\n forceMount\n asChild\n aria-label={title}\n >\n <motion.div\n ref={sheetRef}\n className={cn(\n 'fixed inset-x-0 bottom-0 z-modal max-h-[85vh] overflow-y-auto rounded-t-overlay-lg border-t border-surface-border-strong bg-surface-overlay shadow-overlay outline-hidden',\n className,\n )}\n initial={{ y: '100%' }}\n animate={{ y: 0 }}\n exit={{ y: '100%' }}\n transition={isReduced ? { duration: 0 } : springs.smooth}\n drag={swipeable && !isReduced ? 'y' : false}\n dragConstraints={{ top: 0 }}\n dragElastic={0.2}\n onDragEnd={handleDragEnd}\n >\n {dragHandle && (\n <div className=\"flex justify-center pt-ds-03 pb-ds-02\">\n <div className=\"h-1 w-8 rounded-pill bg-surface-border\" />\n </div>\n )}\n <div className=\"px-ds-05 pb-ds-06\">\n {children}\n </div>\n </motion.div>\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n )}\n </AnimatePresence>\n </DialogPrimitive.Root>\n )\n}\n","'use client'\n\nimport * as PopoverPrimitive from '@primitives/react-popover'\nimport { AnimatePresence,motion } from 'framer-motion'\nimport * as React from 'react'\n\nimport { useIsMobile } from '../hooks/use-mobile'\nimport { BottomSheet } from './lib/bottom-sheet'\nimport { springs, tweens } from './lib/motion'\nimport { useControllableOpen } from './lib/use-controllable-open'\nimport { cn } from './lib/utils'\n\n// ── Internal context to thread `open` state to animated children ──\n\nconst PopoverOpenContext = React.createContext<{ open: boolean; onClose: () => void }>({ open: false, onClose: () => {} })\n\nconst Popover: React.FC<React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Root>> = ({\n open: controlledOpen,\n defaultOpen = false,\n onOpenChange,\n ...props\n}) => {\n const { open, setOpen, close } = useControllableOpen({ open: controlledOpen, defaultOpen, onOpenChange })\n\n const contextValue = React.useMemo(\n () => ({ open, onClose: close }),\n [open, close],\n )\n\n return (\n <PopoverOpenContext.Provider value={contextValue}>\n <PopoverPrimitive.Root open={open} onOpenChange={setOpen} {...props} />\n </PopoverOpenContext.Provider>\n )\n}\nPopover.displayName = 'Popover'\n\nconst PopoverTrigger = PopoverPrimitive.Trigger\n\nconst PopoverAnchor = PopoverPrimitive.Anchor\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(({ className, align = 'center', sideOffset = 4, children, ...props }, ref) => {\n const isMobileRaw = useIsMobile()\n const { open, onClose } = React.useContext(PopoverOpenContext)\n\n if (isMobileRaw) {\n return (\n <BottomSheet\n open={open}\n onOpenChange={(v) => { if (!v) onClose() }}\n title=\"Options\"\n className={className}\n >\n {children}\n </BottomSheet>\n )\n }\n\n return (\n <AnimatePresence>\n {open && (\n <PopoverPrimitive.Portal forceMount>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n forceMount\n asChild\n {...props}\n >\n <motion.div\n initial={{ opacity: 0, scale: 0.95 }}\n animate={{ opacity: 1, scale: 1 }}\n exit={{ opacity: 0, scale: 0.95 }}\n transition={{ ...springs.snappy, opacity: tweens.fade }}\n className={cn(\n 'z-popover w-72 rounded-overlay bg-surface-overlay p-ds-05 text-surface-fg shadow-floating outline-hidden',\n className,\n )}\n >\n {children}\n </motion.div>\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n )}\n </AnimatePresence>\n )\n})\nPopoverContent.displayName = PopoverPrimitive.Content.displayName\n\nexport type PopoverContentProps = React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n\nexport { Popover, PopoverAnchor,PopoverContent, PopoverTrigger }\n"],"mappings":";;;;;;;;;;AAsBA,SAAgB,EAAY,EAC1B,SACA,iBACA,aACA,cACA,gBAAa,IACb,eAAY,IACZ,YACmB;CACnB,IAAM,IAAY,EAAiB,GAC7B,IAAW,EAAM,OAAuB,IAAI,GAE5C,IAAgB,EAAM,aACzB,GAAY,MAA6D;EACxE,IAAM,IAAc,EAAS,SAAS,sBAAsB,CAAC,CAAC,UAAU;EACxE,CAAI,EAAK,OAAO,IAAI,IAAc,MAAO,EAAK,SAAS,IAAI,QACzD,EAAa,EAAK;CAEtB,GACA,CAAC,CAAY,CACf;CAEA,OACE,kBAAC,GAAD;EAA4B;EAAoB;YAC9C,kBAAC,GAAD,EAAA,UACG,KACC,kBAAC,GAAD;GAAwB,YAAA;aAAxB,CACE,kBAAC,GAAD;IAAyB,YAAA;IAAW,SAAA;cAClC,kBAAC,EAAO,KAAR;KACE,WAAU;KACV,SAAS,EAAE,SAAS,EAAE;KACtB,SAAS,EAAE,SAAS,EAAE;KACtB,MAAM,EAAE,SAAS,EAAE;KACnB,YAAY,EAAO;IACpB,CAAA;GACsB,CAAA,GAEzB,kBAAC,GAAD;IACE,YAAA;IACA,SAAA;IACA,cAAY;cAEZ,kBAAC,EAAO,KAAR;KACE,KAAK;KACL,WAAW,EACT,6KACA,CACF;KACA,SAAS,EAAE,GAAG,OAAO;KACrB,SAAS,EAAE,GAAG,EAAE;KAChB,MAAM,EAAE,GAAG,OAAO;KAClB,YAAY,IAAY,EAAE,UAAU,EAAE,IAAI,EAAQ;KAClD,MAAM,KAAa,CAAC,IAAY,MAAM;KACtC,iBAAiB,EAAE,KAAK,EAAE;KAC1B,aAAa;KACb,WAAW;eAbb,CAeG,KACC,kBAAC,OAAD;MAAK,WAAU;gBACb,kBAAC,OAAD,EAAK,WAAU,yCAA0C,CAAA;KACtD,CAAA,GAEP,kBAAC,OAAD;MAAK,WAAU;MACZ;KACE,CAAA,CACK;;GACW,CAAA,CACH;KAEX,CAAA;CACG,CAAA;AAE1B;;;AChFA,IAAM,IAAqB,EAAM,cAAsD;CAAE,MAAM;CAAO,eAAe,CAAC;AAAE,CAAC,GAEnH,KAAmF,EACvF,MAAM,GACN,iBAAc,IACd,iBACA,GAAG,QACC;CACJ,IAAM,EAAE,SAAM,YAAS,aAAU,EAAoB;EAAE,MAAM;EAAgB;EAAa;CAAa,CAAC,GAElG,IAAe,EAAM,eAClB;EAAE;EAAM,SAAS;CAAM,IAC9B,CAAC,GAAM,CAAK,CACd;CAEA,OACE,kBAAC,EAAmB,UAApB;EAA6B,OAAO;YAClC,kBAAC,GAAD;GAA6B;GAAM,cAAc;GAAS,GAAI;EAAQ,CAAA;CAC3C,CAAA;AAEjC;AACA,EAAQ,cAAc;AAEtB,IAAM,IAAiB,GAEjB,IAAgB,GAEhB,IAAiB,EAAM,YAG1B,EAAE,cAAW,WAAQ,UAAU,gBAAa,GAAG,aAAU,GAAG,KAAS,MAAQ;CAC9E,IAAM,IAAc,EAAY,GAC1B,EAAE,SAAM,eAAY,EAAM,WAAW,CAAkB;CAe7D,OAbI,IAEA,kBAAC,GAAD;EACQ;EACN,eAAe,MAAM;GAAE,AAAK,KAAG,EAAQ;EAAE;EACzC,OAAM;EACK;EAEV;CACU,CAAA,IAKf,kBAAC,GAAD,EAAA,UACG,KACC,kBAAC,GAAD;EAAyB,YAAA;YACvB,kBAAC,GAAD;GACO;GACE;GACK;GACZ,YAAA;GACA,SAAA;GACA,GAAI;aAEJ,kBAAC,EAAO,KAAR;IACE,SAAS;KAAE,SAAS;KAAG,OAAO;IAAK;IACnC,SAAS;KAAE,SAAS;KAAG,OAAO;IAAE;IAChC,MAAM;KAAE,SAAS;KAAG,OAAO;IAAK;IAChC,YAAY;KAAE,GAAG,EAAQ;KAAQ,SAAS,EAAO;IAAK;IACtD,WAAW,EACT,4GACA,CACF;IAEC;GACS,CAAA;EACY,CAAA;CACH,CAAA,EAEZ,CAAA;AAErB,CAAC;AACD,EAAe,cAAA,EAAuC"}
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Presence as e, Primitive as t, composeEventHandlers as n, createCollection as r, createContextScope as i, useComposedRefs as a, useControllableState as o, useDirection as s, useId as c, useLayoutEffect as l } from "../primitives-internal.js";
|
|
3
|
+
import * as u from "react";
|
|
4
|
+
import d from "react";
|
|
5
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
6
|
+
//#region src/primitives/react-collapsible.js
|
|
7
|
+
var p = "Collapsible", [m, h] = i(p), [g, _] = m(p), v = u.forwardRef((e, n) => {
|
|
8
|
+
let { __scopeCollapsible: r, open: i, defaultOpen: a, disabled: s, onOpenChange: l, ...d } = e, [m, h] = o({
|
|
9
|
+
prop: i,
|
|
10
|
+
defaultProp: a ?? !1,
|
|
11
|
+
onChange: l,
|
|
12
|
+
caller: p
|
|
13
|
+
});
|
|
14
|
+
return /* @__PURE__ */ f(g, {
|
|
15
|
+
scope: r,
|
|
16
|
+
disabled: s,
|
|
17
|
+
contentId: c(),
|
|
18
|
+
open: m,
|
|
19
|
+
onOpenToggle: u.useCallback(() => h((e) => !e), [h]),
|
|
20
|
+
children: /* @__PURE__ */ f(t.div, {
|
|
21
|
+
"data-state": w(m),
|
|
22
|
+
"data-disabled": s ? "" : void 0,
|
|
23
|
+
...d,
|
|
24
|
+
ref: n
|
|
25
|
+
})
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
v.displayName = p;
|
|
29
|
+
var y = "CollapsibleTrigger", b = u.forwardRef((e, r) => {
|
|
30
|
+
let { __scopeCollapsible: i, ...a } = e, o = _(y, i);
|
|
31
|
+
return /* @__PURE__ */ f(t.button, {
|
|
32
|
+
type: "button",
|
|
33
|
+
"aria-controls": o.contentId,
|
|
34
|
+
"aria-expanded": o.open || !1,
|
|
35
|
+
"data-state": w(o.open),
|
|
36
|
+
"data-disabled": o.disabled ? "" : void 0,
|
|
37
|
+
disabled: o.disabled,
|
|
38
|
+
...a,
|
|
39
|
+
ref: r,
|
|
40
|
+
onClick: n(e.onClick, o.onOpenToggle)
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
b.displayName = y;
|
|
44
|
+
var x = "CollapsibleContent", S = u.forwardRef((t, n) => {
|
|
45
|
+
let { forceMount: r, ...i } = t, a = _(x, t.__scopeCollapsible);
|
|
46
|
+
return /* @__PURE__ */ f(e, {
|
|
47
|
+
present: r || a.open,
|
|
48
|
+
children: ({ present: e }) => /* @__PURE__ */ f(C, {
|
|
49
|
+
...i,
|
|
50
|
+
ref: n,
|
|
51
|
+
present: e
|
|
52
|
+
})
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
S.displayName = x;
|
|
56
|
+
var C = u.forwardRef((e, n) => {
|
|
57
|
+
let { __scopeCollapsible: r, present: i, children: o, ...s } = e, c = _(x, r), [d, p] = u.useState(i), m = u.useRef(null), h = a(n, m), g = u.useRef(0), v = g.current, y = u.useRef(0), b = y.current, S = c.open || d, C = u.useRef(S), T = u.useRef(void 0);
|
|
58
|
+
return u.useEffect(() => {
|
|
59
|
+
let e = requestAnimationFrame(() => C.current = !1);
|
|
60
|
+
return () => cancelAnimationFrame(e);
|
|
61
|
+
}, []), l(() => {
|
|
62
|
+
let e = m.current;
|
|
63
|
+
if (e) {
|
|
64
|
+
T.current = T.current || {
|
|
65
|
+
transitionDuration: e.style.transitionDuration,
|
|
66
|
+
animationName: e.style.animationName
|
|
67
|
+
}, e.style.transitionDuration = "0s", e.style.animationName = "none";
|
|
68
|
+
let t = e.getBoundingClientRect();
|
|
69
|
+
g.current = t.height, y.current = t.width, C.current || (e.style.transitionDuration = T.current.transitionDuration, e.style.animationName = T.current.animationName), p(i);
|
|
70
|
+
}
|
|
71
|
+
}, [c.open, i]), /* @__PURE__ */ f(t.div, {
|
|
72
|
+
"data-state": w(c.open),
|
|
73
|
+
"data-disabled": c.disabled ? "" : void 0,
|
|
74
|
+
id: c.contentId,
|
|
75
|
+
hidden: !S,
|
|
76
|
+
...s,
|
|
77
|
+
ref: h,
|
|
78
|
+
style: {
|
|
79
|
+
"--radix-collapsible-content-height": v ? `${v}px` : void 0,
|
|
80
|
+
"--radix-collapsible-content-width": b ? `${b}px` : void 0,
|
|
81
|
+
...e.style
|
|
82
|
+
},
|
|
83
|
+
children: S && o
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
function w(e) {
|
|
87
|
+
return e ? "open" : "closed";
|
|
88
|
+
}
|
|
89
|
+
var T = v, E = b, D = S, O = "Accordion", k = [
|
|
90
|
+
"Home",
|
|
91
|
+
"End",
|
|
92
|
+
"ArrowDown",
|
|
93
|
+
"ArrowUp",
|
|
94
|
+
"ArrowLeft",
|
|
95
|
+
"ArrowRight"
|
|
96
|
+
], [A, j, ee] = r(O), [M, te] = i(O, [ee, h]), N = h(), P = d.forwardRef((e, t) => {
|
|
97
|
+
let { type: n, ...r } = e, i = r, a = r;
|
|
98
|
+
return /* @__PURE__ */ f(A.Provider, {
|
|
99
|
+
scope: e.__scopeAccordion,
|
|
100
|
+
children: n === "multiple" ? /* @__PURE__ */ f(B, {
|
|
101
|
+
...a,
|
|
102
|
+
ref: t
|
|
103
|
+
}) : /* @__PURE__ */ f(z, {
|
|
104
|
+
...i,
|
|
105
|
+
ref: t
|
|
106
|
+
})
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
P.displayName = O;
|
|
110
|
+
var [F, I] = M(O), [L, R] = M(O, { collapsible: !1 }), z = d.forwardRef((e, t) => {
|
|
111
|
+
let { value: n, defaultValue: r, onValueChange: i = () => {}, collapsible: a = !1, ...s } = e, [c, l] = o({
|
|
112
|
+
prop: n,
|
|
113
|
+
defaultProp: r ?? "",
|
|
114
|
+
onChange: i,
|
|
115
|
+
caller: O
|
|
116
|
+
});
|
|
117
|
+
return /* @__PURE__ */ f(F, {
|
|
118
|
+
scope: e.__scopeAccordion,
|
|
119
|
+
value: d.useMemo(() => c ? [c] : [], [c]),
|
|
120
|
+
onItemOpen: l,
|
|
121
|
+
onItemClose: d.useCallback(() => a && l(""), [a, l]),
|
|
122
|
+
children: /* @__PURE__ */ f(L, {
|
|
123
|
+
scope: e.__scopeAccordion,
|
|
124
|
+
collapsible: a,
|
|
125
|
+
children: /* @__PURE__ */ f(U, {
|
|
126
|
+
...s,
|
|
127
|
+
ref: t
|
|
128
|
+
})
|
|
129
|
+
})
|
|
130
|
+
});
|
|
131
|
+
}), B = d.forwardRef((e, t) => {
|
|
132
|
+
let { value: n, defaultValue: r, onValueChange: i = () => {}, ...a } = e, [s, c] = o({
|
|
133
|
+
prop: n,
|
|
134
|
+
defaultProp: r ?? [],
|
|
135
|
+
onChange: i,
|
|
136
|
+
caller: O
|
|
137
|
+
}), l = d.useCallback((e) => c((t = []) => [...t, e]), [c]), u = d.useCallback((e) => c((t = []) => t.filter((t) => t !== e)), [c]);
|
|
138
|
+
return /* @__PURE__ */ f(F, {
|
|
139
|
+
scope: e.__scopeAccordion,
|
|
140
|
+
value: s,
|
|
141
|
+
onItemOpen: l,
|
|
142
|
+
onItemClose: u,
|
|
143
|
+
children: /* @__PURE__ */ f(L, {
|
|
144
|
+
scope: e.__scopeAccordion,
|
|
145
|
+
collapsible: !0,
|
|
146
|
+
children: /* @__PURE__ */ f(U, {
|
|
147
|
+
...a,
|
|
148
|
+
ref: t
|
|
149
|
+
})
|
|
150
|
+
})
|
|
151
|
+
});
|
|
152
|
+
}), [V, H] = M(O), U = d.forwardRef((e, r) => {
|
|
153
|
+
let { __scopeAccordion: i, disabled: o, dir: c, orientation: l = "vertical", ...u } = e, p = a(d.useRef(null), r), m = j(i), h = s(c) === "ltr", g = n(e.onKeyDown, (e) => {
|
|
154
|
+
if (!k.includes(e.key)) return;
|
|
155
|
+
let t = e.target, n = m().filter((e) => !e.ref.current?.disabled), r = n.findIndex((e) => e.ref.current === t), i = n.length;
|
|
156
|
+
if (r === -1) return;
|
|
157
|
+
e.preventDefault();
|
|
158
|
+
let a = r, o = i - 1, s = () => {
|
|
159
|
+
a = r + 1, a > o && (a = 0);
|
|
160
|
+
}, c = () => {
|
|
161
|
+
a = r - 1, a < 0 && (a = o);
|
|
162
|
+
};
|
|
163
|
+
switch (e.key) {
|
|
164
|
+
case "Home":
|
|
165
|
+
a = 0;
|
|
166
|
+
break;
|
|
167
|
+
case "End":
|
|
168
|
+
a = o;
|
|
169
|
+
break;
|
|
170
|
+
case "ArrowRight":
|
|
171
|
+
l === "horizontal" && (h ? s() : c());
|
|
172
|
+
break;
|
|
173
|
+
case "ArrowDown":
|
|
174
|
+
l === "vertical" && s();
|
|
175
|
+
break;
|
|
176
|
+
case "ArrowLeft":
|
|
177
|
+
l === "horizontal" && (h ? c() : s());
|
|
178
|
+
break;
|
|
179
|
+
case "ArrowUp":
|
|
180
|
+
l === "vertical" && c();
|
|
181
|
+
break;
|
|
182
|
+
}
|
|
183
|
+
n[a % i].ref.current?.focus();
|
|
184
|
+
});
|
|
185
|
+
return /* @__PURE__ */ f(V, {
|
|
186
|
+
scope: i,
|
|
187
|
+
disabled: o,
|
|
188
|
+
direction: c,
|
|
189
|
+
orientation: l,
|
|
190
|
+
children: /* @__PURE__ */ f(A.Slot, {
|
|
191
|
+
scope: i,
|
|
192
|
+
children: /* @__PURE__ */ f(t.div, {
|
|
193
|
+
...u,
|
|
194
|
+
"data-orientation": l,
|
|
195
|
+
ref: p,
|
|
196
|
+
onKeyDown: o ? void 0 : g
|
|
197
|
+
})
|
|
198
|
+
})
|
|
199
|
+
});
|
|
200
|
+
}), W = "AccordionItem", [ne, G] = M(W), K = d.forwardRef((e, t) => {
|
|
201
|
+
let { __scopeAccordion: n, value: r, ...i } = e, a = H(W, n), o = I(W, n), s = N(n), l = c(), u = r && o.value.includes(r) || !1, d = a.disabled || e.disabled;
|
|
202
|
+
return /* @__PURE__ */ f(ne, {
|
|
203
|
+
scope: n,
|
|
204
|
+
open: u,
|
|
205
|
+
disabled: d,
|
|
206
|
+
triggerId: l,
|
|
207
|
+
children: /* @__PURE__ */ f(T, {
|
|
208
|
+
"data-orientation": a.orientation,
|
|
209
|
+
"data-state": $(u),
|
|
210
|
+
...s,
|
|
211
|
+
...i,
|
|
212
|
+
ref: t,
|
|
213
|
+
disabled: d,
|
|
214
|
+
open: u,
|
|
215
|
+
onOpenChange: (e) => {
|
|
216
|
+
e ? o.onItemOpen(r) : o.onItemClose(r);
|
|
217
|
+
}
|
|
218
|
+
})
|
|
219
|
+
});
|
|
220
|
+
});
|
|
221
|
+
K.displayName = W;
|
|
222
|
+
var q = "AccordionHeader", J = d.forwardRef((e, n) => {
|
|
223
|
+
let { __scopeAccordion: r, ...i } = e, a = H(O, r), o = G(q, r);
|
|
224
|
+
return /* @__PURE__ */ f(t.h3, {
|
|
225
|
+
"data-orientation": a.orientation,
|
|
226
|
+
"data-state": $(o.open),
|
|
227
|
+
"data-disabled": o.disabled ? "" : void 0,
|
|
228
|
+
...i,
|
|
229
|
+
ref: n
|
|
230
|
+
});
|
|
231
|
+
});
|
|
232
|
+
J.displayName = q;
|
|
233
|
+
var Y = "AccordionTrigger", X = d.forwardRef((e, t) => {
|
|
234
|
+
let { __scopeAccordion: n, ...r } = e, i = H(O, n), a = G(Y, n), o = R(Y, n), s = N(n);
|
|
235
|
+
return /* @__PURE__ */ f(A.ItemSlot, {
|
|
236
|
+
scope: n,
|
|
237
|
+
children: /* @__PURE__ */ f(E, {
|
|
238
|
+
"aria-disabled": a.open && !o.collapsible || void 0,
|
|
239
|
+
"data-orientation": i.orientation,
|
|
240
|
+
id: a.triggerId,
|
|
241
|
+
...s,
|
|
242
|
+
...r,
|
|
243
|
+
ref: t
|
|
244
|
+
})
|
|
245
|
+
});
|
|
246
|
+
});
|
|
247
|
+
X.displayName = Y;
|
|
248
|
+
var Z = "AccordionContent", Q = d.forwardRef((e, t) => {
|
|
249
|
+
let { __scopeAccordion: n, ...r } = e, i = H(O, n), a = G(Z, n), o = N(n);
|
|
250
|
+
return /* @__PURE__ */ f(D, {
|
|
251
|
+
role: "region",
|
|
252
|
+
"aria-labelledby": a.triggerId,
|
|
253
|
+
"data-orientation": i.orientation,
|
|
254
|
+
...o,
|
|
255
|
+
...r,
|
|
256
|
+
ref: t,
|
|
257
|
+
style: {
|
|
258
|
+
"--radix-accordion-content-height": "var(--radix-collapsible-content-height)",
|
|
259
|
+
"--radix-accordion-content-width": "var(--radix-collapsible-content-width)",
|
|
260
|
+
...e.style
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
});
|
|
264
|
+
Q.displayName = Z;
|
|
265
|
+
function $(e) {
|
|
266
|
+
return e ? "open" : "closed";
|
|
267
|
+
}
|
|
268
|
+
var re = P, ie = K, ae = J, oe = X, se = Q;
|
|
269
|
+
//#endregion
|
|
270
|
+
export { D as Content, se as Content2, ae as Header, ie as Item, T as Root, re as Root2, E as Trigger, oe as Trigger2 };
|