@cognite/aura 0.3.5 → 1.46105.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/CHANGELOG.md +264 -0
- package/DESIGN.md +638 -281
- package/LICENSE +21 -0
- package/README.md +21 -13
- package/dist/colors-deprecated.css +587 -0
- package/dist/colors.css +803 -830
- package/dist/components/index.d.ts +63 -57
- package/dist/components/index.js +62 -59
- package/dist/components/index.js.map +1 -0
- package/dist/components/ui/core/accordion/accordion.d.ts +19 -18
- package/dist/components/ui/core/accordion/accordion.js +99 -78
- package/dist/components/ui/core/accordion/accordion.js.map +1 -0
- package/dist/components/ui/core/action-toolbar/action-toolbar-motion.d.ts +8 -0
- package/dist/components/ui/core/action-toolbar/action-toolbar-motion.js +125 -0
- package/dist/components/ui/core/action-toolbar/action-toolbar-motion.js.map +1 -0
- package/dist/components/ui/core/action-toolbar/action-toolbar.d.ts +31 -31
- package/dist/components/ui/core/action-toolbar/action-toolbar.js +156 -106
- package/dist/components/ui/core/action-toolbar/action-toolbar.js.map +1 -0
- package/dist/components/ui/core/alert/alert.d.ts +25 -25
- package/dist/components/ui/core/alert/alert.js +181 -152
- package/dist/components/ui/core/alert/alert.js.map +1 -0
- package/dist/components/ui/core/avatar/avatar.d.ts +10 -9
- package/dist/components/ui/core/avatar/avatar.js +75 -65
- package/dist/components/ui/core/avatar/avatar.js.map +1 -0
- package/dist/components/ui/core/badge/badge.d.ts +13 -12
- package/dist/components/ui/core/badge/badge.js +88 -72
- package/dist/components/ui/core/badge/badge.js.map +1 -0
- package/dist/components/ui/core/banner/banner.d.ts +18 -18
- package/dist/components/ui/core/banner/banner.js +179 -142
- package/dist/components/ui/core/banner/banner.js.map +1 -0
- package/dist/components/ui/core/breadcrumb/breadcrumb.d.ts +12 -12
- package/dist/components/ui/core/breadcrumb/breadcrumb.js +139 -104
- package/dist/components/ui/core/breadcrumb/breadcrumb.js.map +1 -0
- package/dist/components/ui/core/button/button.d.ts +7 -7
- package/dist/components/ui/core/button/button.gallery.d.ts +2 -0
- package/dist/components/ui/core/button/button.gallery.js +76 -0
- package/dist/components/ui/core/button/button.gallery.js.map +1 -0
- package/dist/components/ui/core/button/button.js +57 -47
- package/dist/components/ui/core/button/button.js.map +1 -0
- package/dist/components/ui/core/button-group/button-group.d.ts +9 -9
- package/dist/components/ui/core/button-group/button-group.js +50 -40
- package/dist/components/ui/core/button-group/button-group.js.map +1 -0
- package/dist/components/ui/core/calendar/calendar-header.d.ts +7 -7
- package/dist/components/ui/core/calendar/calendar-header.js +102 -63
- package/dist/components/ui/core/calendar/calendar-header.js.map +1 -0
- package/dist/components/ui/core/calendar/calendar-utils.d.ts +30 -30
- package/dist/components/ui/core/calendar/calendar-utils.js +116 -39
- package/dist/components/ui/core/calendar/calendar-utils.js.map +1 -0
- package/dist/components/ui/core/calendar/calendar.d.ts +10 -10
- package/dist/components/ui/core/calendar/calendar.js +95 -66
- package/dist/components/ui/core/calendar/calendar.js.map +1 -0
- package/dist/components/ui/core/calendar/constants.js +3 -0
- package/dist/components/ui/core/calendar/constants.js.map +1 -0
- package/dist/components/ui/core/card/card.d.ts +20 -20
- package/dist/components/ui/core/card/card.js +133 -104
- package/dist/components/ui/core/card/card.js.map +1 -0
- package/dist/components/ui/core/chart/chart.d.ts +55 -53
- package/dist/components/ui/core/chart/chart.js +196 -116
- package/dist/components/ui/core/chart/chart.js.map +1 -0
- package/dist/components/ui/core/chart/index.d.ts +2 -2
- package/dist/components/ui/core/chart/index.js +3 -2
- package/dist/components/ui/core/chart/index.js.map +1 -0
- package/dist/components/ui/core/checkbox/checkbox.d.ts +9 -9
- package/dist/components/ui/core/checkbox/checkbox.js +88 -68
- package/dist/components/ui/core/checkbox/checkbox.js.map +1 -0
- package/dist/components/ui/core/checkbox/checkbox.metadata.d.ts +1 -1
- package/dist/components/ui/core/checkbox/checkbox.metadata.js +6 -7
- package/dist/components/ui/core/checkbox/checkbox.metadata.js.map +1 -0
- package/dist/components/ui/core/code-block/code-block.d.ts +19 -19
- package/dist/components/ui/core/code-block/code-block.js +259 -175
- package/dist/components/ui/core/code-block/code-block.js.map +1 -0
- package/dist/components/ui/core/collapsible/collapsible.d.ts +5 -5
- package/dist/components/ui/core/collapsible/collapsible.js +36 -30
- package/dist/components/ui/core/collapsible/collapsible.js.map +1 -0
- package/dist/components/ui/core/combobox/combobox.d.ts +13 -13
- package/dist/components/ui/core/combobox/combobox.js +89 -40
- package/dist/components/ui/core/combobox/combobox.js.map +1 -0
- package/dist/components/ui/core/command/command.d.ts +20 -18
- package/dist/components/ui/core/command/command.js +137 -85
- package/dist/components/ui/core/command/command.js.map +1 -0
- package/dist/components/ui/core/conversation/conversation.d.ts +14 -0
- package/dist/components/ui/core/conversation/conversation.js +51 -0
- package/dist/components/ui/core/conversation/conversation.js.map +1 -0
- package/dist/components/ui/core/count/count.d.ts +8 -6
- package/dist/components/ui/core/count/count.js +51 -21
- package/dist/components/ui/core/count/count.js.map +1 -0
- package/dist/components/ui/core/data-grid/data-grid-cell.d.ts +7 -7
- package/dist/components/ui/core/data-grid/data-grid-cell.js +22 -22
- package/dist/components/ui/core/data-grid/data-grid-cell.js.map +1 -0
- package/dist/components/ui/core/data-grid/data-grid-filter-clauses.d.ts +14 -0
- package/dist/components/ui/core/data-grid/data-grid-filter-clauses.js +36 -0
- package/dist/components/ui/core/data-grid/data-grid-filter-clauses.js.map +1 -0
- package/dist/components/ui/core/data-grid/data-grid-filter-panel.d.ts +41 -0
- package/dist/components/ui/core/data-grid/data-grid-filter-panel.js +273 -0
- package/dist/components/ui/core/data-grid/data-grid-filter-panel.js.map +1 -0
- package/dist/components/ui/core/data-grid/data-grid-footer.d.ts +6 -0
- package/dist/components/ui/core/data-grid/data-grid-footer.js +34 -0
- package/dist/components/ui/core/data-grid/data-grid-footer.js.map +1 -0
- package/dist/components/ui/core/data-grid/data-grid-header-row.d.ts +10 -10
- package/dist/components/ui/core/data-grid/data-grid-header-row.js +69 -55
- package/dist/components/ui/core/data-grid/data-grid-header-row.js.map +1 -0
- package/dist/components/ui/core/data-grid/data-grid-header.d.ts +11 -0
- package/dist/components/ui/core/data-grid/data-grid-header.js +67 -0
- package/dist/components/ui/core/data-grid/data-grid-header.js.map +1 -0
- package/dist/components/ui/core/data-grid/data-grid-row.d.ts +15 -15
- package/dist/components/ui/core/data-grid/data-grid-row.js +104 -76
- package/dist/components/ui/core/data-grid/data-grid-row.js.map +1 -0
- package/dist/components/ui/core/data-grid/data-grid.d.ts +85 -35
- package/dist/components/ui/core/data-grid/data-grid.fixtures.d.ts +7 -7
- package/dist/components/ui/core/data-grid/data-grid.fixtures.js +139 -0
- package/dist/components/ui/core/data-grid/data-grid.fixtures.js.map +1 -0
- package/dist/components/ui/core/data-grid/data-grid.js +402 -132
- package/dist/components/ui/core/data-grid/data-grid.js.map +1 -0
- package/dist/components/ui/core/data-grid/data-grid.utils.d.ts +3 -3
- package/dist/components/ui/core/data-grid/data-grid.utils.js +44 -33
- package/dist/components/ui/core/data-grid/data-grid.utils.js.map +1 -0
- package/dist/components/ui/core/data-grid/index.d.ts +4 -1
- package/dist/components/ui/core/data-grid/index.js +5 -2
- package/dist/components/ui/core/data-grid/index.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-picker/date-picker.d.ts +11 -13
- package/dist/components/ui/core/date-time-pickers/date-picker/date-picker.js +85 -61
- package/dist/components/ui/core/date-time-pickers/date-picker/date-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-picker/index.d.ts +3 -3
- package/dist/components/ui/core/date-time-pickers/date-picker/index.js +3 -0
- package/dist/components/ui/core/date-time-pickers/date-picker/index.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-picker/types.d.ts +14 -14
- package/dist/components/ui/core/date-time-pickers/date-picker/types.js +3 -0
- package/dist/components/ui/core/date-time-pickers/date-picker/types.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-picker/use-date-picker.d.ts +2 -2
- package/dist/components/ui/core/date-time-pickers/date-picker/use-date-picker.js +51 -36
- package/dist/components/ui/core/date-time-pickers/date-picker/use-date-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.d.ts +11 -13
- package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.js +89 -64
- package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-range-picker/index.d.ts +3 -3
- package/dist/components/ui/core/date-time-pickers/date-range-picker/index.js +3 -0
- package/dist/components/ui/core/date-time-pickers/date-range-picker/index.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-range-picker/types.d.ts +20 -20
- package/dist/components/ui/core/date-time-pickers/date-range-picker/types.js +3 -0
- package/dist/components/ui/core/date-time-pickers/date-range-picker/types.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-range-picker/use-date-range-picker.d.ts +4 -4
- package/dist/components/ui/core/date-time-pickers/date-range-picker/use-date-range-picker.js +95 -60
- package/dist/components/ui/core/date-time-pickers/date-range-picker/use-date-range-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/date-time-picker.d.ts +15 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/date-time-picker.js +120 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/date-time-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/index.d.ts +3 -1
- package/dist/components/ui/core/date-time-pickers/date-time-picker/index.js +3 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/index.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/types.d.ts +25 -32
- package/dist/components/ui/core/date-time-pickers/date-time-picker/types.js +3 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/types.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/use-date-time-picker.d.ts +2 -2
- package/dist/components/ui/core/date-time-pickers/date-time-picker/use-date-time-picker.js +78 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/use-date-time-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.d.ts +13 -15
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.js +165 -119
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/index.d.ts +3 -3
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/index.js +3 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/index.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/types.d.ts +37 -37
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/types.js +3 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/types.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/use-date-time-range-picker.d.ts +3 -3
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/use-date-time-range-picker.js +163 -104
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/use-date-time-range-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/index.d.ts +17 -12
- package/dist/components/ui/core/date-time-pickers/index.js +10 -6
- package/dist/components/ui/core/date-time-pickers/index.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.d.ts +5 -5
- package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.js +52 -42
- package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/constants.d.ts +6 -1
- package/dist/components/ui/core/date-time-pickers/shared/constants.js +23 -0
- package/dist/components/ui/core/date-time-pickers/shared/constants.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.d.ts +16 -15
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.js +87 -64
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/range-input-display.d.ts +10 -9
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/range-input-display.js +89 -38
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/range-input-display.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.d.ts +5 -5
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.js +34 -23
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-date-state.d.ts +23 -23
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-date-state.js +95 -52
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-date-state.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-step-manager.d.ts +5 -5
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-step-manager.js +22 -18
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-step-manager.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-single-date-state.d.ts +19 -19
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-single-date-state.js +41 -24
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-single-date-state.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.d.ts +13 -13
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.js +33 -24
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/scroll-cell-classes.d.ts +5 -5
- package/dist/components/ui/core/date-time-pickers/shared/scroll-cell-classes.js +9 -4
- package/dist/components/ui/core/date-time-pickers/shared/scroll-cell-classes.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.d.ts +13 -9
- package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.js +22 -17
- package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/index.d.ts +2 -2
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/index.js +3 -0
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/index.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.d.ts +13 -13
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.js +49 -40
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-scroll/time-picker-scroll.d.ts +7 -7
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-scroll/time-picker-scroll.js +41 -34
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-scroll/time-picker-scroll.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/index.d.ts +3 -3
- package/dist/components/ui/core/date-time-pickers/time-picker/index.js +3 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/index.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/time-picker.d.ts +12 -14
- package/dist/components/ui/core/date-time-pickers/time-picker/time-picker.js +99 -79
- package/dist/components/ui/core/date-time-pickers/time-picker/time-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/types.d.ts +20 -20
- package/dist/components/ui/core/date-time-pickers/time-picker/types.js +3 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/types.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/use-time-picker.d.ts +2 -2
- package/dist/components/ui/core/date-time-pickers/time-picker/use-time-picker.js +63 -41
- package/dist/components/ui/core/date-time-pickers/time-picker/use-time-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/index.d.ts +3 -1
- package/dist/components/ui/core/date-time-pickers/time-range-picker/index.js +3 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/index.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/time-range-picker.d.ts +14 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/time-range-picker.js +115 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/time-range-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/types.d.ts +30 -36
- package/dist/components/ui/core/date-time-pickers/time-range-picker/types.js +3 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/types.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/use-time-range-picker.d.ts +2 -2
- package/dist/components/ui/core/date-time-pickers/time-range-picker/use-time-range-picker.js +145 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/use-time-range-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/utils/date-input.d.ts +56 -0
- package/dist/components/ui/core/date-time-pickers/utils/date-input.js +67 -0
- package/dist/components/ui/core/date-time-pickers/utils/date-input.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/utils/date-range-utils.d.ts +18 -18
- package/dist/components/ui/core/date-time-pickers/utils/date-range-utils.js +42 -0
- package/dist/components/ui/core/date-time-pickers/utils/date-range-utils.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/utils/format-utils.d.ts +31 -29
- package/dist/components/ui/core/date-time-pickers/utils/format-utils.js +56 -0
- package/dist/components/ui/core/date-time-pickers/utils/format-utils.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/utils/segment-utils.d.ts +21 -21
- package/dist/components/ui/core/date-time-pickers/utils/segment-utils.js +170 -0
- package/dist/components/ui/core/date-time-pickers/utils/segment-utils.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/utils/time-utils.d.ts +28 -28
- package/dist/components/ui/core/date-time-pickers/utils/time-utils.js +88 -7
- package/dist/components/ui/core/date-time-pickers/utils/time-utils.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/utils/time-validation.d.ts +17 -17
- package/dist/components/ui/core/date-time-pickers/utils/time-validation.js +43 -0
- package/dist/components/ui/core/date-time-pickers/utils/time-validation.js.map +1 -0
- package/dist/components/ui/core/dialog/dialog.d.ts +12 -9
- package/dist/components/ui/core/dialog/dialog.js +90 -82
- package/dist/components/ui/core/dialog/dialog.js.map +1 -0
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.d.ts +22 -19
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.js +204 -149
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.js.map +1 -0
- package/dist/components/ui/core/empty-state/empty-state.context.d.ts +4 -4
- package/dist/components/ui/core/empty-state/empty-state.context.js +8 -5
- package/dist/components/ui/core/empty-state/empty-state.context.js.map +1 -0
- package/dist/components/ui/core/empty-state/empty-state.d.ts +14 -14
- package/dist/components/ui/core/empty-state/empty-state.js +96 -82
- package/dist/components/ui/core/empty-state/empty-state.js.map +1 -0
- package/dist/components/ui/core/helper-text/helper-text.d.ts +7 -7
- package/dist/components/ui/core/helper-text/helper-text.js +55 -36
- package/dist/components/ui/core/helper-text/helper-text.js.map +1 -0
- package/dist/components/ui/core/hover-card/hover-card.d.ts +7 -6
- package/dist/components/ui/core/hover-card/hover-card.js +56 -52
- package/dist/components/ui/core/hover-card/hover-card.js.map +1 -0
- package/dist/components/ui/core/inline-citation/inline-citation.d.ts +26 -25
- package/dist/components/ui/core/inline-citation/inline-citation.js +121 -97
- package/dist/components/ui/core/inline-citation/inline-citation.js.map +1 -0
- package/dist/components/ui/core/input/input.d.ts +2 -2
- package/dist/components/ui/core/input/input.js +15 -13
- package/dist/components/ui/core/input/input.js.map +1 -0
- package/dist/components/ui/core/input-group/input-group.d.ts +25 -14
- package/dist/components/ui/core/input-group/input-group.js +149 -76
- package/dist/components/ui/core/input-group/input-group.js.map +1 -0
- package/dist/components/ui/core/item/item.d.ts +20 -0
- package/dist/components/ui/core/item/item.js +93 -0
- package/dist/components/ui/core/item/item.js.map +1 -0
- package/dist/components/ui/core/kbd/kbd.d.ts +3 -3
- package/dist/components/ui/core/kbd/kbd.js +24 -20
- package/dist/components/ui/core/kbd/kbd.js.map +1 -0
- package/dist/components/ui/core/label/label.d.ts +3 -3
- package/dist/components/ui/core/label/label.js +33 -26
- package/dist/components/ui/core/label/label.js.map +1 -0
- package/dist/components/ui/core/loader/loader.d.ts +6 -6
- package/dist/components/ui/core/loader/loader.js +97 -80
- package/dist/components/ui/core/loader/loader.js.map +1 -0
- package/dist/components/ui/core/message/message-response-default-streamdown-controls.d.ts +9 -9
- package/dist/components/ui/core/message/message-response-default-streamdown-controls.js +19 -12
- package/dist/components/ui/core/message/message-response-default-streamdown-controls.js.map +1 -0
- package/dist/components/ui/core/message/message-response-math-plugin.d.ts +3 -0
- package/dist/components/ui/core/message/message-response-math-plugin.js +6 -0
- package/dist/components/ui/core/message/message-response-math-plugin.js.map +1 -0
- package/dist/components/ui/core/message/message.d.ts +27 -23
- package/dist/components/ui/core/message/message.js +453 -316
- package/dist/components/ui/core/message/message.js.map +1 -0
- package/dist/components/ui/core/overflow-list/overflow-list.d.ts +21 -0
- package/dist/components/ui/core/overflow-list/overflow-list.js +197 -0
- package/dist/components/ui/core/overflow-list/overflow-list.js.map +1 -0
- package/dist/components/ui/core/overflow-list/overflow-list.utils.d.ts +37 -35
- package/dist/components/ui/core/overflow-list/overflow-list.utils.js +206 -0
- package/dist/components/ui/core/overflow-list/overflow-list.utils.js.map +1 -0
- package/dist/components/ui/core/pagination/pagination-size-context.d.ts +2 -2
- package/dist/components/ui/core/pagination/pagination-size-context.js +6 -5
- package/dist/components/ui/core/pagination/pagination-size-context.js.map +1 -0
- package/dist/components/ui/core/pagination/pagination-teleport.d.ts +9 -9
- package/dist/components/ui/core/pagination/pagination-teleport.js +127 -84
- package/dist/components/ui/core/pagination/pagination-teleport.js.map +1 -0
- package/dist/components/ui/core/pagination/pagination-teleport.utils.js +6 -6
- package/dist/components/ui/core/pagination/pagination-teleport.utils.js.map +1 -0
- package/dist/components/ui/core/pagination/pagination.d.ts +39 -39
- package/dist/components/ui/core/pagination/pagination.js +294 -234
- package/dist/components/ui/core/pagination/pagination.js.map +1 -0
- package/dist/components/ui/core/popover/popover.d.ts +12 -11
- package/dist/components/ui/core/popover/popover.js +104 -89
- package/dist/components/ui/core/popover/popover.js.map +1 -0
- package/dist/components/ui/core/progress/progress.d.ts +9 -8
- package/dist/components/ui/core/progress/progress.js +50 -35
- package/dist/components/ui/core/progress/progress.js.map +1 -0
- package/dist/components/ui/core/prompt-input/prompt-input.d.ts +27 -27
- package/dist/components/ui/core/prompt-input/prompt-input.js +342 -271
- package/dist/components/ui/core/prompt-input/prompt-input.js.map +1 -0
- package/dist/components/ui/core/radio-group/radio-group.d.ts +12 -12
- package/dist/components/ui/core/radio-group/radio-group.js +88 -58
- package/dist/components/ui/core/radio-group/radio-group.js.map +1 -0
- package/dist/components/ui/core/reasoning/reasoning.d.ts +7 -7
- package/dist/components/ui/core/reasoning/reasoning.js +68 -56
- package/dist/components/ui/core/reasoning/reasoning.js.map +1 -0
- package/dist/components/ui/core/scroll-area/scroll-area.d.ts +4 -4
- package/dist/components/ui/core/scroll-area/scroll-area.js +50 -40
- package/dist/components/ui/core/scroll-area/scroll-area.js.map +1 -0
- package/dist/components/ui/core/search/search.d.ts +8 -8
- package/dist/components/ui/core/search/search.js +122 -76
- package/dist/components/ui/core/search/search.js.map +1 -0
- package/dist/components/ui/core/segmented-control/segmented-control.d.ts +10 -10
- package/dist/components/ui/core/segmented-control/segmented-control.js +203 -149
- package/dist/components/ui/core/segmented-control/segmented-control.js.map +1 -0
- package/dist/components/ui/core/select/select.d.ts +27 -26
- package/dist/components/ui/core/select/select.js +213 -168
- package/dist/components/ui/core/select/select.js.map +1 -0
- package/dist/components/ui/core/separator/separator.d.ts +2 -2
- package/dist/components/ui/core/separator/separator.js +13 -13
- package/dist/components/ui/core/separator/separator.js.map +1 -0
- package/dist/components/ui/core/shimmer/shimmer.d.ts +8 -8
- package/dist/components/ui/core/shimmer/shimmer.js +64 -40
- package/dist/components/ui/core/shimmer/shimmer.js.map +1 -0
- package/dist/components/ui/core/skeleton/skeleton.d.ts +2 -2
- package/dist/components/ui/core/skeleton/skeleton.js +13 -13
- package/dist/components/ui/core/skeleton/skeleton.js.map +1 -0
- package/dist/components/ui/core/slider/slider.d.ts +7 -7
- package/dist/components/ui/core/slider/slider.js +51 -39
- package/dist/components/ui/core/slider/slider.js.map +1 -0
- package/dist/components/ui/core/sonner-toast/sonner-toast.d.ts +2 -2
- package/dist/components/ui/core/sonner-toast/sonner-toast.js +67 -54
- package/dist/components/ui/core/sonner-toast/sonner-toast.js.map +1 -0
- package/dist/components/ui/core/sources/sources.d.ts +12 -12
- package/dist/components/ui/core/sources/sources.js +87 -58
- package/dist/components/ui/core/sources/sources.js.map +1 -0
- package/dist/components/ui/core/switch/switch.d.ts +9 -9
- package/dist/components/ui/core/switch/switch.js +83 -61
- package/dist/components/ui/core/switch/switch.js.map +1 -0
- package/dist/components/ui/core/switch/switch.metadata.d.ts +1 -1
- package/dist/components/ui/core/switch/switch.metadata.js +8 -0
- package/dist/components/ui/core/switch/switch.metadata.js.map +1 -0
- package/dist/components/ui/core/tabs/tabs.d.ts +20 -18
- package/dist/components/ui/core/tabs/tabs.js +176 -147
- package/dist/components/ui/core/tabs/tabs.js.map +1 -0
- package/dist/components/ui/core/tabs/tabs.utils.d.ts +1 -1
- package/dist/components/ui/core/tabs/tabs.utils.js +10 -6
- package/dist/components/ui/core/tabs/tabs.utils.js.map +1 -0
- package/dist/components/ui/core/textarea/textarea.d.ts +2 -2
- package/dist/components/ui/core/textarea/textarea.js +13 -13
- package/dist/components/ui/core/textarea/textarea.js.map +1 -0
- package/dist/components/ui/core/toggle/toggle.d.ts +9 -9
- package/dist/components/ui/core/toggle/toggle.js +60 -54
- package/dist/components/ui/core/toggle/toggle.js.map +1 -0
- package/dist/components/ui/core/tool/tool.d.ts +18 -18
- package/dist/components/ui/core/tool/tool.js +167 -126
- package/dist/components/ui/core/tool/tool.js.map +1 -0
- package/dist/components/ui/core/toolbar/toolbar.d.ts +37 -0
- package/dist/components/ui/core/toolbar/toolbar.js +171 -0
- package/dist/components/ui/core/toolbar/toolbar.js.map +1 -0
- package/dist/components/ui/core/tooltip/tooltip.d.ts +8 -7
- package/dist/components/ui/core/tooltip/tooltip.js +53 -46
- package/dist/components/ui/core/tooltip/tooltip.js.map +1 -0
- package/dist/components/ui/core/topbar/topbar.d.ts +26 -26
- package/dist/components/ui/core/topbar/topbar.js +160 -105
- package/dist/components/ui/core/topbar/topbar.js.map +1 -0
- package/dist/components/ui/core/tree/tree.d.ts +20 -0
- package/dist/components/ui/core/tree/tree.js +100 -0
- package/dist/components/ui/core/tree/tree.js.map +1 -0
- package/dist/eslint/index.d.ts +5 -5
- package/dist/eslint/index.js +9 -5
- package/dist/eslint/index.js.map +1 -0
- package/dist/eslint/no-overriding-styles.d.ts +1 -1
- package/dist/eslint/no-overriding-styles.js +341 -201
- package/dist/eslint/no-overriding-styles.js.map +1 -0
- package/dist/icons/index.d.ts +1 -1
- package/dist/icons/index.js +2 -0
- package/dist/icons/index.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/ai/types.d.ts +43 -43
- package/dist/lib/ai/types.js +3 -0
- package/dist/lib/ai/types.js.map +1 -0
- package/dist/lib/decorative-variant-classes.d.ts +53 -0
- package/dist/lib/decorative-variant-classes.js +58 -0
- package/dist/lib/decorative-variant-classes.js.map +1 -0
- package/dist/lib/highlight-code.d.ts +11 -8
- package/dist/lib/highlight-code.js +58 -40
- package/dist/lib/highlight-code.js.map +1 -0
- package/dist/lib/portal-container-context.d.ts +1 -1
- package/dist/lib/portal-container-context.js +8 -8
- package/dist/lib/portal-container-context.js.map +1 -0
- package/dist/lib/shared-theme-from-url.d.ts +13 -0
- package/dist/lib/shared-theme-from-url.js +61 -0
- package/dist/lib/shared-theme-from-url.js.map +1 -0
- package/dist/lib/style-scope.d.ts +2 -2
- package/dist/lib/style-scope.js +6 -6
- package/dist/lib/style-scope.js.map +1 -0
- package/dist/lib/theme-share-url.d.ts +31 -0
- package/dist/lib/theme-share-url.js +116 -0
- package/dist/lib/theme-share-url.js.map +1 -0
- package/dist/lib/types.d.ts +39 -39
- package/dist/lib/types.js +3 -0
- package/dist/lib/types.js.map +1 -0
- package/dist/lib/use-controllable-state.d.ts +4 -7
- package/dist/lib/use-controllable-state.js +34 -21
- package/dist/lib/use-controllable-state.js.map +1 -0
- package/dist/lib/utils.d.ts +63 -34
- package/dist/lib/utils.js +134 -32
- package/dist/lib/utils.js.map +1 -0
- package/dist/styles.css +2 -1
- package/dist/styles.source.css +24 -12
- package/dist/utils/assign-ref.d.ts +3 -0
- package/dist/utils/assign-ref.js +13 -0
- package/dist/utils/assign-ref.js.map +1 -0
- package/package.json +46 -11
- package/src/components/ui/core/button/button.md +93 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { ForwardRefExoticComponent, RefAttributes, ComponentProps } from
|
|
2
|
-
import { Button } from
|
|
3
|
-
type ComboboxProps = Omit<ComponentProps<typeof Button>,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { type ForwardRefExoticComponent, type RefAttributes, type ComponentProps } from "react";
|
|
2
|
+
import { Button } from "../button/button";
|
|
3
|
+
type ComboboxProps = Omit<ComponentProps<typeof Button>, "value" | "onChange" | "variant" | "size" | "render" | "nativeButton"> & {
|
|
4
|
+
options: Array<{
|
|
5
|
+
value: string;
|
|
6
|
+
label: string;
|
|
7
|
+
}>;
|
|
8
|
+
value?: string;
|
|
9
|
+
onValueChange?: (value: string) => void;
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
searchPlaceholder?: string;
|
|
12
|
+
emptyText?: string;
|
|
13
13
|
};
|
|
14
|
-
declare const Combobox: ForwardRefExoticComponent<Omit<ComboboxProps,
|
|
14
|
+
declare const Combobox: ForwardRefExoticComponent<Omit<ComboboxProps, "ref"> & RefAttributes<HTMLElement>>;
|
|
15
15
|
export { Combobox };
|
|
@@ -1,41 +1,90 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useId, useState } from "react";
|
|
3
|
+
import { IconCaretUpDown, IconCheck } from "@tabler/icons-react";
|
|
4
|
+
import { cn, formFieldOpenState, formFieldTriggerClasses } from "../../../../lib/utils.js";
|
|
5
|
+
import { Button } from "../button/button.js";
|
|
6
|
+
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "../command/command.js";
|
|
7
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../popover/popover.js";
|
|
8
|
+
const Combobox = /*#__PURE__*/ forwardRef(({ options, value, onValueChange, placeholder = 'Select option...', searchPlaceholder = 'Search...', emptyText = 'No option found.', className, type = 'button', ...props }, ref)=>{
|
|
9
|
+
const [open, setOpen] = useState(false);
|
|
10
|
+
const listboxId = useId();
|
|
11
|
+
const [internalValue, setInternalValue] = useState(value ?? '');
|
|
12
|
+
const isControlled = value !== undefined;
|
|
13
|
+
const selectedValue = isControlled ? value : internalValue;
|
|
14
|
+
const selectedLabel = selectedValue ? options.find((option)=>option.value === selectedValue)?.label : undefined;
|
|
15
|
+
const handleValueChange = (newValue)=>{
|
|
16
|
+
const finalValue = newValue === selectedValue ? '' : newValue;
|
|
17
|
+
if (!isControlled) {
|
|
18
|
+
setInternalValue(finalValue);
|
|
19
|
+
}
|
|
20
|
+
onValueChange?.(finalValue);
|
|
21
|
+
setOpen(false);
|
|
22
|
+
};
|
|
23
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
24
|
+
"data-slot": "combobox",
|
|
25
|
+
children: /*#__PURE__*/ _jsxs(Popover, {
|
|
26
|
+
open: open,
|
|
27
|
+
onOpenChange: setOpen,
|
|
28
|
+
children: [
|
|
29
|
+
/*#__PURE__*/ _jsx(PopoverTrigger, {
|
|
30
|
+
render: /*#__PURE__*/ _jsxs(Button, {
|
|
31
|
+
ref: ref,
|
|
32
|
+
type: type,
|
|
33
|
+
nativeButton: true,
|
|
34
|
+
variant: null,
|
|
35
|
+
size: null,
|
|
36
|
+
"data-slot": "combobox-trigger",
|
|
37
|
+
role: "combobox",
|
|
38
|
+
"aria-expanded": open,
|
|
39
|
+
"aria-controls": listboxId,
|
|
40
|
+
className: cn(formFieldTriggerClasses, open && formFieldOpenState, className),
|
|
41
|
+
...props,
|
|
42
|
+
children: [
|
|
43
|
+
/*#__PURE__*/ _jsx("span", {
|
|
44
|
+
className: cn('flex-1 truncate text-left', selectedLabel ? 'text-base-foreground disabled:text-base-foreground-disabled' : 'text-muted-foreground disabled:text-base-foreground-disabled'),
|
|
45
|
+
children: selectedLabel ?? placeholder
|
|
46
|
+
}),
|
|
47
|
+
/*#__PURE__*/ _jsx(IconCaretUpDown, {
|
|
48
|
+
className: "size-4 opacity-50"
|
|
49
|
+
})
|
|
50
|
+
]
|
|
51
|
+
})
|
|
52
|
+
}),
|
|
53
|
+
/*#__PURE__*/ _jsx(PopoverContent, {
|
|
54
|
+
id: listboxId,
|
|
55
|
+
className: cn('w-50 p-0', className),
|
|
56
|
+
children: /*#__PURE__*/ _jsxs(Command, {
|
|
57
|
+
children: [
|
|
58
|
+
/*#__PURE__*/ _jsx(CommandInput, {
|
|
59
|
+
placeholder: searchPlaceholder
|
|
60
|
+
}),
|
|
61
|
+
/*#__PURE__*/ _jsxs(CommandList, {
|
|
62
|
+
children: [
|
|
63
|
+
/*#__PURE__*/ _jsx(CommandEmpty, {
|
|
64
|
+
children: emptyText
|
|
65
|
+
}),
|
|
66
|
+
/*#__PURE__*/ _jsx(CommandGroup, {
|
|
67
|
+
children: options.map((option)=>/*#__PURE__*/ _jsxs(CommandItem, {
|
|
68
|
+
value: option.value,
|
|
69
|
+
onSelect: handleValueChange,
|
|
70
|
+
children: [
|
|
71
|
+
/*#__PURE__*/ _jsx(IconCheck, {
|
|
72
|
+
className: cn('mr-2 size-4', selectedValue === option.value ? 'opacity-100' : 'opacity-0')
|
|
73
|
+
}),
|
|
74
|
+
option.label
|
|
75
|
+
]
|
|
76
|
+
}, option.value))
|
|
77
|
+
})
|
|
78
|
+
]
|
|
79
|
+
})
|
|
80
|
+
]
|
|
81
|
+
})
|
|
82
|
+
})
|
|
83
|
+
]
|
|
84
|
+
})
|
|
85
|
+
});
|
|
38
86
|
});
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
87
|
+
Combobox.displayName = 'Combobox';
|
|
88
|
+
export { Combobox };
|
|
89
|
+
|
|
90
|
+
//# sourceMappingURL=combobox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/ui/core/combobox/combobox.tsx"],"sourcesContent":["import {\n type ForwardRefExoticComponent,\n type RefAttributes,\n type ComponentProps,\n type ComponentRef,\n forwardRef,\n useId,\n useState,\n} from 'react';\n\nimport { IconCaretUpDown, IconCheck } from '@tabler/icons-react';\n\nimport {\n cn,\n formFieldOpenState,\n formFieldTriggerClasses,\n} from '../../../../lib/utils';\nimport { Button } from '../button/button';\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n} from '../command/command';\nimport { Popover, PopoverContent, PopoverTrigger } from '../popover/popover';\n\ntype ComboboxProps = Omit<\n ComponentProps<typeof Button>,\n 'value' | 'onChange' | 'variant' | 'size' | 'render' | 'nativeButton'\n> & {\n options: Array<{ value: string; label: string }>;\n value?: string;\n onValueChange?: (value: string) => void;\n placeholder?: string;\n searchPlaceholder?: string;\n emptyText?: string;\n};\n\nconst Combobox: ForwardRefExoticComponent<\n Omit<ComboboxProps, 'ref'> & RefAttributes<HTMLElement>\n> = forwardRef<ComponentRef<typeof Button>, ComboboxProps>(\n (\n {\n options,\n value,\n onValueChange,\n placeholder = 'Select option...',\n searchPlaceholder = 'Search...',\n emptyText = 'No option found.',\n className,\n type = 'button',\n ...props\n },\n ref\n ) => {\n const [open, setOpen] = useState(false);\n const listboxId = useId();\n const [internalValue, setInternalValue] = useState(value ?? '');\n const isControlled = value !== undefined;\n const selectedValue = isControlled ? value : internalValue;\n const selectedLabel = selectedValue\n ? options.find((option) => option.value === selectedValue)?.label\n : undefined;\n\n const handleValueChange = (newValue: string) => {\n const finalValue = newValue === selectedValue ? '' : newValue;\n if (!isControlled) {\n setInternalValue(finalValue);\n }\n onValueChange?.(finalValue);\n setOpen(false);\n };\n\n return (\n <div data-slot=\"combobox\">\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger\n render={\n <Button\n ref={ref}\n type={type}\n nativeButton\n variant={null}\n size={null}\n data-slot=\"combobox-trigger\"\n role=\"combobox\"\n aria-expanded={open}\n aria-controls={listboxId}\n className={cn(\n formFieldTriggerClasses,\n open && formFieldOpenState,\n className\n )}\n {...props}\n >\n <span\n className={cn(\n 'flex-1 truncate text-left',\n selectedLabel\n ? 'text-base-foreground disabled:text-base-foreground-disabled'\n : 'text-muted-foreground disabled:text-base-foreground-disabled'\n )}\n >\n {selectedLabel ?? placeholder}\n </span>\n <IconCaretUpDown className=\"size-4 opacity-50\" />\n </Button>\n }\n />\n <PopoverContent id={listboxId} className={cn('w-50 p-0', className)}>\n <Command>\n <CommandInput placeholder={searchPlaceholder} />\n <CommandList>\n <CommandEmpty>{emptyText}</CommandEmpty>\n <CommandGroup>\n {options.map((option) => (\n <CommandItem\n key={option.value}\n value={option.value}\n onSelect={handleValueChange}\n >\n <IconCheck\n className={cn(\n 'mr-2 size-4',\n selectedValue === option.value\n ? 'opacity-100'\n : 'opacity-0'\n )}\n />\n {option.label}\n </CommandItem>\n ))}\n </CommandGroup>\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n </div>\n );\n }\n);\n\nCombobox.displayName = 'Combobox';\n\nexport { Combobox };\n"],"names":["forwardRef","useId","useState","IconCaretUpDown","IconCheck","cn","formFieldOpenState","formFieldTriggerClasses","Button","Command","CommandEmpty","CommandGroup","CommandInput","CommandItem","CommandList","Popover","PopoverContent","PopoverTrigger","Combobox","options","value","onValueChange","placeholder","searchPlaceholder","emptyText","className","type","props","ref","open","setOpen","listboxId","internalValue","setInternalValue","isControlled","undefined","selectedValue","selectedLabel","find","option","label","handleValueChange","newValue","finalValue","div","data-slot","onOpenChange","render","nativeButton","variant","size","role","aria-expanded","aria-controls","span","id","map","onSelect","displayName"],"mappings":";AAAA,SAKEA,UAAU,EACVC,KAAK,EACLC,QAAQ,QACH,QAAQ;AAEf,SAASC,eAAe,EAAEC,SAAS,QAAQ,sBAAsB;AAEjE,SACEC,EAAE,EACFC,kBAAkB,EAClBC,uBAAuB,QAClB,2BAAwB;AAC/B,SAASC,MAAM,QAAQ,sBAAmB;AAC1C,SACEC,OAAO,EACPC,YAAY,EACZC,YAAY,EACZC,YAAY,EACZC,WAAW,EACXC,WAAW,QACN,wBAAqB;AAC5B,SAASC,OAAO,EAAEC,cAAc,EAAEC,cAAc,QAAQ,wBAAqB;AAc7E,MAAMC,yBAEFlB,WACF,CACE,EACEmB,OAAO,EACPC,KAAK,EACLC,aAAa,EACbC,cAAc,kBAAkB,EAChCC,oBAAoB,WAAW,EAC/BC,YAAY,kBAAkB,EAC9BC,SAAS,EACTC,OAAO,QAAQ,EACf,GAAGC,OACJ,EACDC;IAEA,MAAM,CAACC,MAAMC,QAAQ,GAAG5B,SAAS;IACjC,MAAM6B,YAAY9B;IAClB,MAAM,CAAC+B,eAAeC,iBAAiB,GAAG/B,SAASkB,SAAS;IAC5D,MAAMc,eAAed,UAAUe;IAC/B,MAAMC,gBAAgBF,eAAed,QAAQY;IAC7C,MAAMK,gBAAgBD,gBAClBjB,QAAQmB,IAAI,CAAC,CAACC,SAAWA,OAAOnB,KAAK,KAAKgB,gBAAgBI,QAC1DL;IAEJ,MAAMM,oBAAoB,CAACC;QACzB,MAAMC,aAAaD,aAAaN,gBAAgB,KAAKM;QACrD,IAAI,CAACR,cAAc;YACjBD,iBAAiBU;QACnB;QACAtB,gBAAgBsB;QAChBb,QAAQ;IACV;IAEA,qBACE,KAACc;QAAIC,aAAU;kBACb,cAAA,MAAC9B;YAAQc,MAAMA;YAAMiB,cAAchB;;8BACjC,KAACb;oBACC8B,sBACE,MAACvC;wBACCoB,KAAKA;wBACLF,MAAMA;wBACNsB,YAAY;wBACZC,SAAS;wBACTC,MAAM;wBACNL,aAAU;wBACVM,MAAK;wBACLC,iBAAevB;wBACfwB,iBAAetB;wBACfN,WAAWpB,GACTE,yBACAsB,QAAQvB,oBACRmB;wBAED,GAAGE,KAAK;;0CAET,KAAC2B;gCACC7B,WAAWpB,GACT,6BACAgC,gBACI,gEACA;0CAGLA,iBAAiBf;;0CAEpB,KAACnB;gCAAgBsB,WAAU;;;;;8BAIjC,KAACT;oBAAeuC,IAAIxB;oBAAWN,WAAWpB,GAAG,YAAYoB;8BACvD,cAAA,MAAChB;;0CACC,KAACG;gCAAaU,aAAaC;;0CAC3B,MAACT;;kDACC,KAACJ;kDAAcc;;kDACf,KAACb;kDACEQ,QAAQqC,GAAG,CAAC,CAACjB,uBACZ,MAAC1B;gDAECO,OAAOmB,OAAOnB,KAAK;gDACnBqC,UAAUhB;;kEAEV,KAACrC;wDACCqB,WAAWpB,GACT,eACA+B,kBAAkBG,OAAOnB,KAAK,GAC1B,gBACA;;oDAGPmB,OAAOC,KAAK;;+CAZRD,OAAOnB,KAAK;;;;;;;;;;AAsBrC;AAGFF,SAASwC,WAAW,GAAG;AAEvB,SAASxC,QAAQ,GAAG"}
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import { ForwardRefExoticComponent, RefAttributes, ComponentProps, ReactNode } from
|
|
2
|
-
import { Command as CommandPrimitive } from
|
|
3
|
-
import { Dialog } from
|
|
4
|
-
declare const Command: ForwardRefExoticComponent<Omit<ComponentProps<typeof CommandPrimitive>,
|
|
5
|
-
declare function CommandDialog({ title, description, children, className, showCloseButton, ...props }: Omit<ComponentProps<typeof Dialog>,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { type ForwardRefExoticComponent, type RefAttributes, type ComponentProps, type ReactNode } from "react";
|
|
2
|
+
import { Command as CommandPrimitive } from "cmdk";
|
|
3
|
+
import { Dialog } from "../dialog/dialog";
|
|
4
|
+
declare const Command: ForwardRefExoticComponent<Omit<ComponentProps<typeof CommandPrimitive>, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare function CommandDialog({ title, description, children, className, showCloseButton, ...props }: Omit<ComponentProps<typeof Dialog>, "children"> & {
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
title?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
showCloseButton?: boolean;
|
|
11
11
|
}): ReactNode;
|
|
12
|
-
declare const CommandInput: ForwardRefExoticComponent<Omit<ComponentProps<typeof CommandPrimitive.Input>,
|
|
13
|
-
declare const CommandList: ForwardRefExoticComponent<Omit<ComponentProps<typeof CommandPrimitive.List>,
|
|
14
|
-
declare const CommandEmpty: ForwardRefExoticComponent<Omit<ComponentProps<typeof CommandPrimitive.Empty>,
|
|
15
|
-
declare const CommandGroup: ForwardRefExoticComponent<Omit<ComponentProps<typeof CommandPrimitive.Group>,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
declare const
|
|
19
|
-
|
|
12
|
+
declare const CommandInput: ForwardRefExoticComponent<Omit<ComponentProps<typeof CommandPrimitive.Input>, "ref"> & RefAttributes<HTMLInputElement>>;
|
|
13
|
+
declare const CommandList: ForwardRefExoticComponent<Omit<ComponentProps<typeof CommandPrimitive.List>, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
14
|
+
declare const CommandEmpty: ForwardRefExoticComponent<Omit<ComponentProps<typeof CommandPrimitive.Empty>, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
15
|
+
declare const CommandGroup: ForwardRefExoticComponent<Omit<ComponentProps<typeof CommandPrimitive.Group>, "ref"> & {
|
|
16
|
+
inset?: boolean;
|
|
17
|
+
} & RefAttributes<HTMLDivElement>>;
|
|
18
|
+
declare const CommandSeparator: ForwardRefExoticComponent<Omit<ComponentProps<typeof CommandPrimitive.Separator>, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
19
|
+
declare const CommandItem: ForwardRefExoticComponent<Omit<ComponentProps<typeof CommandPrimitive.Item>, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
20
|
+
declare const CommandShortcut: ForwardRefExoticComponent<ComponentProps<"span"> & RefAttributes<HTMLSpanElement>>;
|
|
21
|
+
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator };
|
|
@@ -1,86 +1,138 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useRef } from "react";
|
|
3
|
+
import { IconSearch } from "@tabler/icons-react";
|
|
4
|
+
import { Command as CommandPrimitive } from "cmdk";
|
|
5
|
+
import { cn, menuContainerPadding, menuItemPadding, menuSectionLabelCmdkHeadingClasses, menuSectionLabelCmdkHeadingInsetClasses, menuSectionSeparatorClasses } from "../../../../lib/utils.js";
|
|
6
|
+
import { assignRef } from "../../../../utils/assign-ref.js";
|
|
7
|
+
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "../dialog/dialog.js";
|
|
8
|
+
import { InputGroup, InputGroupAddon, inputGroupInputControlClasses } from "../input-group/input-group.js";
|
|
9
|
+
const Command = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>{
|
|
10
|
+
return /*#__PURE__*/ _jsx(CommandPrimitive, {
|
|
11
|
+
ref: ref,
|
|
12
|
+
"data-slot": "command",
|
|
13
|
+
className: cn('rounded-xl bg-popover-background text-popover-foreground flex h-full w-full flex-col overflow-hidden', menuSectionLabelCmdkHeadingClasses, menuSectionLabelCmdkHeadingInsetClasses, className),
|
|
14
|
+
...props
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
Command.displayName = 'Command';
|
|
18
|
+
function CommandDialog({ title = 'Command Palette', description = 'Search for a command to run...', children, className, showCloseButton = true, ...props }) {
|
|
19
|
+
return /*#__PURE__*/ _jsxs(Dialog, {
|
|
20
|
+
...props,
|
|
21
|
+
children: [
|
|
22
|
+
/*#__PURE__*/ _jsxs(DialogHeader, {
|
|
23
|
+
className: "sr-only rounded-lg",
|
|
24
|
+
children: [
|
|
25
|
+
/*#__PURE__*/ _jsx(DialogTitle, {
|
|
26
|
+
children: title
|
|
27
|
+
}),
|
|
28
|
+
/*#__PURE__*/ _jsx(DialogDescription, {
|
|
29
|
+
children: description
|
|
30
|
+
})
|
|
31
|
+
]
|
|
32
|
+
}),
|
|
33
|
+
/*#__PURE__*/ _jsx(DialogContent, {
|
|
34
|
+
"data-slot": "command-dialog",
|
|
35
|
+
className: cn('overflow-hidden p-0 **:data-[slot=command-input-wrapper]:pr-12', className),
|
|
36
|
+
closeButtonClassName: "top-[calc(0.5rem+1.125rem)] right-2 -translate-y-1/2",
|
|
37
|
+
closeButtonSize: "icon",
|
|
38
|
+
showCloseButton: showCloseButton,
|
|
39
|
+
children: /*#__PURE__*/ _jsx(Command, {
|
|
40
|
+
className: cn('[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5', menuSectionLabelCmdkHeadingInsetClasses),
|
|
41
|
+
children: children
|
|
42
|
+
})
|
|
43
|
+
})
|
|
44
|
+
]
|
|
45
|
+
});
|
|
31
46
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
})
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
47
|
+
const CommandInput = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>{
|
|
48
|
+
const inputRef = useRef(null);
|
|
49
|
+
const setInputRef = (node)=>{
|
|
50
|
+
inputRef.current = node;
|
|
51
|
+
assignRef(ref, node);
|
|
52
|
+
};
|
|
53
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
54
|
+
"data-slot": "command-input-wrapper",
|
|
55
|
+
className: "border-b border-default p-2",
|
|
56
|
+
onClick: ()=>{
|
|
57
|
+
inputRef.current?.focus();
|
|
58
|
+
},
|
|
59
|
+
children: /*#__PURE__*/ _jsxs(InputGroup, {
|
|
60
|
+
className: cn('w-full', '**:[[cmdk-input-wrapper]]:flex **:[[cmdk-input-wrapper]]:h-full **:[[cmdk-input-wrapper]]:min-w-0 **:[[cmdk-input-wrapper]]:flex-1 **:[[cmdk-input-wrapper]]:items-center'),
|
|
61
|
+
children: [
|
|
62
|
+
/*#__PURE__*/ _jsx(InputGroupAddon, {
|
|
63
|
+
align: "inline-start",
|
|
64
|
+
className: "[&_svg]:text-muted-foreground group-hover/input-group:[&_svg]:text-muted-foreground group-has-[[data-slot=input-group-control]:enabled:focus-visible:not(:read-only)]/input-group:[&_svg]:text-muted-foreground group-has-[[data-slot=input-group-control]:enabled:not(:placeholder-shown):not(:read-only)]/input-group:[&_svg]:text-muted-foreground",
|
|
65
|
+
children: /*#__PURE__*/ _jsx(IconSearch, {
|
|
66
|
+
className: "size-4",
|
|
67
|
+
"aria-hidden": true
|
|
68
|
+
})
|
|
69
|
+
}),
|
|
70
|
+
/*#__PURE__*/ _jsx(CommandPrimitive.Input, {
|
|
71
|
+
ref: setInputRef,
|
|
72
|
+
"data-slot": "input-group-control",
|
|
73
|
+
className: cn(inputGroupInputControlClasses, 'text-popover-foreground w-full text-sm leading-5 tracking-tight outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:text-base-foreground-disabled disabled:placeholder:text-base-foreground-disabled [&:not(:placeholder-shown):not(:read-only)]:text-base-foreground [&:not(:placeholder-shown):not(:read-only)]:hover:text-base-foreground', className),
|
|
74
|
+
...props
|
|
75
|
+
})
|
|
76
|
+
]
|
|
77
|
+
})
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
CommandInput.displayName = 'CommandInput';
|
|
81
|
+
const CommandList = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>{
|
|
82
|
+
return /*#__PURE__*/ _jsx(CommandPrimitive.List, {
|
|
83
|
+
ref: ref,
|
|
84
|
+
"data-slot": "command-list",
|
|
85
|
+
className: cn(menuContainerPadding, 'max-h-75 scroll-py-1 overflow-x-hidden overflow-y-auto', className),
|
|
86
|
+
...props
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
CommandList.displayName = 'CommandList';
|
|
90
|
+
const CommandEmpty = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>{
|
|
91
|
+
return /*#__PURE__*/ _jsx(CommandPrimitive.Empty, {
|
|
92
|
+
ref: ref,
|
|
93
|
+
"data-slot": "command-empty",
|
|
94
|
+
className: cn('py-6 text-center text-sm text-muted-foreground', className),
|
|
95
|
+
...props
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
CommandEmpty.displayName = 'CommandEmpty';
|
|
99
|
+
const CommandGroup = /*#__PURE__*/ forwardRef(({ className, inset, ...props }, ref)=>{
|
|
100
|
+
return /*#__PURE__*/ _jsx(CommandPrimitive.Group, {
|
|
101
|
+
ref: ref,
|
|
102
|
+
"data-slot": "command-group",
|
|
103
|
+
"data-inset": inset ? true : undefined,
|
|
104
|
+
className: cn('text-popover-foreground overflow-hidden font-normal', className),
|
|
105
|
+
...props
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
CommandGroup.displayName = 'CommandGroup';
|
|
109
|
+
const CommandSeparator = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>{
|
|
110
|
+
return /*#__PURE__*/ _jsx(CommandPrimitive.Separator, {
|
|
111
|
+
ref: ref,
|
|
112
|
+
"data-slot": "command-separator",
|
|
113
|
+
className: cn(menuSectionSeparatorClasses, className),
|
|
114
|
+
...props
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
CommandSeparator.displayName = 'CommandSeparator';
|
|
118
|
+
const CommandItem = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>{
|
|
119
|
+
return /*#__PURE__*/ _jsx(CommandPrimitive.Item, {
|
|
120
|
+
ref: ref,
|
|
121
|
+
"data-slot": "command-item",
|
|
122
|
+
className: cn("text-popover-foreground data-[selected=true]:bg-popover-background-hover data-[selected=true]:text-popover-foreground [&>svg]:pointer-events-none [&>svg]:shrink-0 [&>svg]:text-popover-foreground [&>svg:not([class*='size-'])]:size-4 data-[disabled=true]:pointer-events-none data-[disabled=true]:text-base-foreground-disabled data-[disabled=true]:opacity-100 data-[disabled=true]:[&>svg]:text-base-foreground-disabled relative flex min-h-9 cursor-default items-center gap-2 rounded-lg text-sm outline-hidden select-none", menuItemPadding, className),
|
|
123
|
+
...props
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
CommandItem.displayName = 'CommandItem';
|
|
127
|
+
const CommandShortcut = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>{
|
|
128
|
+
return /*#__PURE__*/ _jsx("span", {
|
|
129
|
+
ref: ref,
|
|
130
|
+
"data-slot": "command-shortcut",
|
|
131
|
+
className: cn('text-muted-foreground ml-auto text-xs tracking-widest', className),
|
|
132
|
+
...props
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
CommandShortcut.displayName = 'CommandShortcut';
|
|
136
|
+
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator };
|
|
137
|
+
|
|
138
|
+
//# sourceMappingURL=command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/ui/core/command/command.tsx"],"sourcesContent":["import {\n type ForwardRefExoticComponent,\n type RefAttributes,\n type ComponentProps,\n type ComponentRef,\n type ReactNode,\n forwardRef,\n useRef,\n} from 'react';\n\nimport { IconSearch } from '@tabler/icons-react';\nimport { Command as CommandPrimitive } from 'cmdk';\n\nimport {\n cn,\n menuContainerPadding,\n menuItemPadding,\n menuSectionLabelCmdkHeadingClasses,\n menuSectionLabelCmdkHeadingInsetClasses,\n menuSectionSeparatorClasses,\n} from '../../../../lib/utils';\nimport { assignRef } from '../../../../utils/assign-ref';\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n} from '../dialog/dialog';\nimport {\n InputGroup,\n InputGroupAddon,\n inputGroupInputControlClasses,\n} from '../input-group/input-group';\n\nconst Command: ForwardRefExoticComponent<\n Omit<ComponentProps<typeof CommandPrimitive>, 'ref'> &\n RefAttributes<HTMLDivElement>\n> = forwardRef<\n ComponentRef<typeof CommandPrimitive>,\n ComponentProps<typeof CommandPrimitive>\n>(({ className, ...props }, ref) => {\n return (\n <CommandPrimitive\n ref={ref}\n data-slot=\"command\"\n className={cn(\n 'rounded-xl bg-popover-background text-popover-foreground flex h-full w-full flex-col overflow-hidden',\n menuSectionLabelCmdkHeadingClasses,\n menuSectionLabelCmdkHeadingInsetClasses,\n className\n )}\n {...props}\n />\n );\n});\nCommand.displayName = 'Command';\n\nfunction CommandDialog({\n title = 'Command Palette',\n description = 'Search for a command to run...',\n children,\n className,\n showCloseButton = true,\n ...props\n}: Omit<ComponentProps<typeof Dialog>, 'children'> & {\n children?: ReactNode;\n title?: string;\n description?: string;\n className?: string;\n showCloseButton?: boolean;\n}): ReactNode {\n return (\n <Dialog {...props}>\n <DialogHeader className=\"sr-only rounded-lg\">\n <DialogTitle>{title}</DialogTitle>\n <DialogDescription>{description}</DialogDescription>\n </DialogHeader>\n <DialogContent\n data-slot=\"command-dialog\"\n className={cn(\n 'overflow-hidden p-0 **:data-[slot=command-input-wrapper]:pr-12',\n className\n )}\n closeButtonClassName=\"top-[calc(0.5rem+1.125rem)] right-2 -translate-y-1/2\"\n closeButtonSize=\"icon\"\n showCloseButton={showCloseButton}\n >\n <Command\n className={cn(\n '[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5',\n menuSectionLabelCmdkHeadingInsetClasses\n )}\n >\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n}\n\nconst CommandInput: ForwardRefExoticComponent<\n Omit<ComponentProps<typeof CommandPrimitive.Input>, 'ref'> &\n RefAttributes<HTMLInputElement>\n> = forwardRef<\n ComponentRef<typeof CommandPrimitive.Input>,\n ComponentProps<typeof CommandPrimitive.Input>\n>(({ className, ...props }, ref) => {\n const inputRef = useRef<HTMLInputElement | null>(null);\n\n const setInputRef = (node: HTMLInputElement | null) => {\n inputRef.current = node;\n assignRef(ref, node);\n };\n\n return (\n <div\n data-slot=\"command-input-wrapper\"\n className=\"border-b border-default p-2\"\n onClick={() => {\n inputRef.current?.focus();\n }}\n >\n <InputGroup\n className={cn(\n 'w-full',\n '**:[[cmdk-input-wrapper]]:flex **:[[cmdk-input-wrapper]]:h-full **:[[cmdk-input-wrapper]]:min-w-0 **:[[cmdk-input-wrapper]]:flex-1 **:[[cmdk-input-wrapper]]:items-center'\n )}\n >\n <InputGroupAddon\n align=\"inline-start\"\n className=\"[&_svg]:text-muted-foreground group-hover/input-group:[&_svg]:text-muted-foreground group-has-[[data-slot=input-group-control]:enabled:focus-visible:not(:read-only)]/input-group:[&_svg]:text-muted-foreground group-has-[[data-slot=input-group-control]:enabled:not(:placeholder-shown):not(:read-only)]/input-group:[&_svg]:text-muted-foreground\"\n >\n <IconSearch className=\"size-4\" aria-hidden />\n </InputGroupAddon>\n <CommandPrimitive.Input\n ref={setInputRef}\n data-slot=\"input-group-control\"\n className={cn(\n inputGroupInputControlClasses,\n 'text-popover-foreground w-full text-sm leading-5 tracking-tight outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:text-base-foreground-disabled disabled:placeholder:text-base-foreground-disabled [&:not(:placeholder-shown):not(:read-only)]:text-base-foreground [&:not(:placeholder-shown):not(:read-only)]:hover:text-base-foreground',\n className\n )}\n {...props}\n />\n </InputGroup>\n </div>\n );\n});\nCommandInput.displayName = 'CommandInput';\n\nconst CommandList: ForwardRefExoticComponent<\n Omit<ComponentProps<typeof CommandPrimitive.List>, 'ref'> &\n RefAttributes<HTMLDivElement>\n> = forwardRef<\n ComponentRef<typeof CommandPrimitive.List>,\n ComponentProps<typeof CommandPrimitive.List>\n>(({ className, ...props }, ref) => {\n return (\n <CommandPrimitive.List\n ref={ref}\n data-slot=\"command-list\"\n className={cn(\n menuContainerPadding,\n 'max-h-75 scroll-py-1 overflow-x-hidden overflow-y-auto',\n className\n )}\n {...props}\n />\n );\n});\nCommandList.displayName = 'CommandList';\n\nconst CommandEmpty: ForwardRefExoticComponent<\n Omit<ComponentProps<typeof CommandPrimitive.Empty>, 'ref'> &\n RefAttributes<HTMLDivElement>\n> = forwardRef<\n ComponentRef<typeof CommandPrimitive.Empty>,\n ComponentProps<typeof CommandPrimitive.Empty>\n>(({ className, ...props }, ref) => {\n return (\n <CommandPrimitive.Empty\n ref={ref}\n data-slot=\"command-empty\"\n className={cn(\n 'py-6 text-center text-sm text-muted-foreground',\n className\n )}\n {...props}\n />\n );\n});\nCommandEmpty.displayName = 'CommandEmpty';\n\nconst CommandGroup: ForwardRefExoticComponent<\n Omit<ComponentProps<typeof CommandPrimitive.Group>, 'ref'> & {\n inset?: boolean;\n } & RefAttributes<HTMLDivElement>\n> = forwardRef<\n ComponentRef<typeof CommandPrimitive.Group>,\n ComponentProps<typeof CommandPrimitive.Group> & { inset?: boolean }\n>(({ className, inset, ...props }, ref) => {\n return (\n <CommandPrimitive.Group\n ref={ref}\n data-slot=\"command-group\"\n data-inset={inset ? true : undefined}\n className={cn(\n 'text-popover-foreground overflow-hidden font-normal',\n className\n )}\n {...props}\n />\n );\n});\nCommandGroup.displayName = 'CommandGroup';\n\nconst CommandSeparator: ForwardRefExoticComponent<\n Omit<ComponentProps<typeof CommandPrimitive.Separator>, 'ref'> &\n RefAttributes<HTMLDivElement>\n> = forwardRef<\n ComponentRef<typeof CommandPrimitive.Separator>,\n ComponentProps<typeof CommandPrimitive.Separator>\n>(({ className, ...props }, ref) => {\n return (\n <CommandPrimitive.Separator\n ref={ref}\n data-slot=\"command-separator\"\n className={cn(menuSectionSeparatorClasses, className)}\n {...props}\n />\n );\n});\nCommandSeparator.displayName = 'CommandSeparator';\n\nconst CommandItem: ForwardRefExoticComponent<\n Omit<ComponentProps<typeof CommandPrimitive.Item>, 'ref'> &\n RefAttributes<HTMLDivElement>\n> = forwardRef<\n ComponentRef<typeof CommandPrimitive.Item>,\n ComponentProps<typeof CommandPrimitive.Item>\n>(({ className, ...props }, ref) => {\n return (\n <CommandPrimitive.Item\n ref={ref}\n data-slot=\"command-item\"\n className={cn(\n \"text-popover-foreground data-[selected=true]:bg-popover-background-hover data-[selected=true]:text-popover-foreground [&>svg]:pointer-events-none [&>svg]:shrink-0 [&>svg]:text-popover-foreground [&>svg:not([class*='size-'])]:size-4 data-[disabled=true]:pointer-events-none data-[disabled=true]:text-base-foreground-disabled data-[disabled=true]:opacity-100 data-[disabled=true]:[&>svg]:text-base-foreground-disabled relative flex min-h-9 cursor-default items-center gap-2 rounded-lg text-sm outline-hidden select-none\",\n menuItemPadding,\n className\n )}\n {...props}\n />\n );\n});\nCommandItem.displayName = 'CommandItem';\n\nconst CommandShortcut: ForwardRefExoticComponent<\n ComponentProps<'span'> & RefAttributes<HTMLSpanElement>\n> = forwardRef<ComponentRef<'span'>, ComponentProps<'span'>>(\n ({ className, ...props }, ref) => {\n return (\n <span\n ref={ref}\n data-slot=\"command-shortcut\"\n className={cn(\n 'text-muted-foreground ml-auto text-xs tracking-widest',\n className\n )}\n {...props}\n />\n );\n }\n);\nCommandShortcut.displayName = 'CommandShortcut';\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n};\n"],"names":["forwardRef","useRef","IconSearch","Command","CommandPrimitive","cn","menuContainerPadding","menuItemPadding","menuSectionLabelCmdkHeadingClasses","menuSectionLabelCmdkHeadingInsetClasses","menuSectionSeparatorClasses","assignRef","Dialog","DialogContent","DialogDescription","DialogHeader","DialogTitle","InputGroup","InputGroupAddon","inputGroupInputControlClasses","className","props","ref","data-slot","displayName","CommandDialog","title","description","children","showCloseButton","closeButtonClassName","closeButtonSize","CommandInput","inputRef","setInputRef","node","current","div","onClick","focus","align","aria-hidden","Input","CommandList","List","CommandEmpty","Empty","CommandGroup","inset","Group","data-inset","undefined","CommandSeparator","Separator","CommandItem","Item","CommandShortcut","span"],"mappings":";AAAA,SAMEA,UAAU,EACVC,MAAM,QACD,QAAQ;AAEf,SAASC,UAAU,QAAQ,sBAAsB;AACjD,SAASC,WAAWC,gBAAgB,QAAQ,OAAO;AAEnD,SACEC,EAAE,EACFC,oBAAoB,EACpBC,eAAe,EACfC,kCAAkC,EAClCC,uCAAuC,EACvCC,2BAA2B,QACtB,2BAAwB;AAC/B,SAASC,SAAS,QAAQ,kCAA+B;AACzD,SACEC,MAAM,EACNC,aAAa,EACbC,iBAAiB,EACjBC,YAAY,EACZC,WAAW,QACN,sBAAmB;AAC1B,SACEC,UAAU,EACVC,eAAe,EACfC,6BAA6B,QACxB,gCAA6B;AAEpC,MAAMhB,wBAGFH,WAGF,CAAC,EAAEoB,SAAS,EAAE,GAAGC,OAAO,EAAEC;IAC1B,qBACE,KAAClB;QACCkB,KAAKA;QACLC,aAAU;QACVH,WAAWf,GACT,wGACAG,oCACAC,yCACAW;QAED,GAAGC,KAAK;;AAGf;AACAlB,QAAQqB,WAAW,GAAG;AAEtB,SAASC,cAAc,EACrBC,QAAQ,iBAAiB,EACzBC,cAAc,gCAAgC,EAC9CC,QAAQ,EACRR,SAAS,EACTS,kBAAkB,IAAI,EACtB,GAAGR,OAOJ;IACC,qBACE,MAACT;QAAQ,GAAGS,KAAK;;0BACf,MAACN;gBAAaK,WAAU;;kCACtB,KAACJ;kCAAaU;;kCACd,KAACZ;kCAAmBa;;;;0BAEtB,KAACd;gBACCU,aAAU;gBACVH,WAAWf,GACT,kEACAe;gBAEFU,sBAAqB;gBACrBC,iBAAgB;gBAChBF,iBAAiBA;0BAEjB,cAAA,KAAC1B;oBACCiB,WAAWf,GACT,qGACAI;8BAGDmB;;;;;AAKX;AAEA,MAAMI,6BAGFhC,WAGF,CAAC,EAAEoB,SAAS,EAAE,GAAGC,OAAO,EAAEC;IAC1B,MAAMW,WAAWhC,OAAgC;IAEjD,MAAMiC,cAAc,CAACC;QACnBF,SAASG,OAAO,GAAGD;QACnBxB,UAAUW,KAAKa;IACjB;IAEA,qBACE,KAACE;QACCd,aAAU;QACVH,WAAU;QACVkB,SAAS;YACPL,SAASG,OAAO,EAAEG;QACpB;kBAEA,cAAA,MAACtB;YACCG,WAAWf,GACT,UACA;;8BAGF,KAACa;oBACCsB,OAAM;oBACNpB,WAAU;8BAEV,cAAA,KAAClB;wBAAWkB,WAAU;wBAASqB,aAAW;;;8BAE5C,KAACrC,iBAAiBsC,KAAK;oBACrBpB,KAAKY;oBACLX,aAAU;oBACVH,WAAWf,GACTc,+BACA,kXACAC;oBAED,GAAGC,KAAK;;;;;AAKnB;AACAW,aAAaR,WAAW,GAAG;AAE3B,MAAMmB,4BAGF3C,WAGF,CAAC,EAAEoB,SAAS,EAAE,GAAGC,OAAO,EAAEC;IAC1B,qBACE,KAAClB,iBAAiBwC,IAAI;QACpBtB,KAAKA;QACLC,aAAU;QACVH,WAAWf,GACTC,sBACA,0DACAc;QAED,GAAGC,KAAK;;AAGf;AACAsB,YAAYnB,WAAW,GAAG;AAE1B,MAAMqB,6BAGF7C,WAGF,CAAC,EAAEoB,SAAS,EAAE,GAAGC,OAAO,EAAEC;IAC1B,qBACE,KAAClB,iBAAiB0C,KAAK;QACrBxB,KAAKA;QACLC,aAAU;QACVH,WAAWf,GACT,kDACAe;QAED,GAAGC,KAAK;;AAGf;AACAwB,aAAarB,WAAW,GAAG;AAE3B,MAAMuB,6BAIF/C,WAGF,CAAC,EAAEoB,SAAS,EAAE4B,KAAK,EAAE,GAAG3B,OAAO,EAAEC;IACjC,qBACE,KAAClB,iBAAiB6C,KAAK;QACrB3B,KAAKA;QACLC,aAAU;QACV2B,cAAYF,QAAQ,OAAOG;QAC3B/B,WAAWf,GACT,uDACAe;QAED,GAAGC,KAAK;;AAGf;AACA0B,aAAavB,WAAW,GAAG;AAE3B,MAAM4B,iCAGFpD,WAGF,CAAC,EAAEoB,SAAS,EAAE,GAAGC,OAAO,EAAEC;IAC1B,qBACE,KAAClB,iBAAiBiD,SAAS;QACzB/B,KAAKA;QACLC,aAAU;QACVH,WAAWf,GAAGK,6BAA6BU;QAC1C,GAAGC,KAAK;;AAGf;AACA+B,iBAAiB5B,WAAW,GAAG;AAE/B,MAAM8B,4BAGFtD,WAGF,CAAC,EAAEoB,SAAS,EAAE,GAAGC,OAAO,EAAEC;IAC1B,qBACE,KAAClB,iBAAiBmD,IAAI;QACpBjC,KAAKA;QACLC,aAAU;QACVH,WAAWf,GACT,ygBACAE,iBACAa;QAED,GAAGC,KAAK;;AAGf;AACAiC,YAAY9B,WAAW,GAAG;AAE1B,MAAMgC,gCAEFxD,WACF,CAAC,EAAEoB,SAAS,EAAE,GAAGC,OAAO,EAAEC;IACxB,qBACE,KAACmC;QACCnC,KAAKA;QACLC,aAAU;QACVH,WAAWf,GACT,yDACAe;QAED,GAAGC,KAAK;;AAGf;AAEFmC,gBAAgBhC,WAAW,GAAG;AAE9B,SACErB,OAAO,EACPsB,aAAa,EACbO,YAAY,EACZW,WAAW,EACXE,YAAY,EACZE,YAAY,EACZO,WAAW,EACXE,eAAe,EACfJ,gBAAgB,GAChB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
+
import { StickToBottom, useStickToBottomContext } from "use-stick-to-bottom";
|
|
3
|
+
import { Button } from "../button/button";
|
|
4
|
+
type ConversationProps = ComponentProps<typeof StickToBottom>;
|
|
5
|
+
declare const Conversation: ({ className, ...props }: ConversationProps) => ReactNode;
|
|
6
|
+
type ConversationContentProps = Omit<ComponentProps<typeof StickToBottom.Content>, "scrollClassName">;
|
|
7
|
+
declare const ConversationContent: ({ className, ...props }: ConversationContentProps) => ReactNode;
|
|
8
|
+
type ConversationScrollButtonProps = ComponentProps<typeof Button>;
|
|
9
|
+
declare const ConversationScrollButton: ({ className, "aria-label": ariaLabel, onClick, ...props }: ConversationScrollButtonProps) => ReactNode;
|
|
10
|
+
type ConversationTurnProps = ComponentProps<"div"> & {
|
|
11
|
+
reserveViewport?: boolean;
|
|
12
|
+
};
|
|
13
|
+
declare const ConversationTurn: ({ reserveViewport, className, ...props }: ConversationTurnProps) => ReactNode;
|
|
14
|
+
export { Conversation, ConversationContent, ConversationScrollButton, ConversationTurn, useStickToBottomContext };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { IconArrowDown } from "@tabler/icons-react";
|
|
3
|
+
import { StickToBottom, useStickToBottomContext } from "use-stick-to-bottom";
|
|
4
|
+
import { cn } from "../../../../lib/utils.js";
|
|
5
|
+
import { Button } from "../button/button.js";
|
|
6
|
+
const Conversation = ({ className, ...props })=>/*#__PURE__*/ _jsx(StickToBottom, {
|
|
7
|
+
"data-slot": "conversation",
|
|
8
|
+
className: cn('relative flex min-h-0 flex-1 flex-col overflow-y-hidden', className),
|
|
9
|
+
initial: "smooth",
|
|
10
|
+
resize: "smooth",
|
|
11
|
+
role: "log",
|
|
12
|
+
...props
|
|
13
|
+
});
|
|
14
|
+
const ConversationContent = ({ className, ...props })=>/*#__PURE__*/ _jsx(StickToBottom.Content, {
|
|
15
|
+
"data-slot": "conversation-content",
|
|
16
|
+
scrollClassName: cn('min-h-0 flex-1 overflow-y-auto [container-type:size]', '[scrollbar-color:theme(colors.border)_transparent]'),
|
|
17
|
+
className: cn('flex min-h-full flex-col', className),
|
|
18
|
+
...props
|
|
19
|
+
});
|
|
20
|
+
const ConversationScrollButton = ({ className, 'aria-label': ariaLabel = 'Scroll to bottom', onClick, ...props })=>{
|
|
21
|
+
const { isAtBottom, scrollToBottom } = useStickToBottomContext();
|
|
22
|
+
if (isAtBottom) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
const handleClick = (event)=>{
|
|
26
|
+
void scrollToBottom();
|
|
27
|
+
onClick?.(event);
|
|
28
|
+
};
|
|
29
|
+
return /*#__PURE__*/ _jsx(Button, {
|
|
30
|
+
"data-slot": "conversation-scroll-button",
|
|
31
|
+
type: "button",
|
|
32
|
+
variant: "outline",
|
|
33
|
+
size: "icon",
|
|
34
|
+
"aria-label": ariaLabel,
|
|
35
|
+
className: cn('rounded-full shadow-lg', className),
|
|
36
|
+
onClick: handleClick,
|
|
37
|
+
...props,
|
|
38
|
+
children: /*#__PURE__*/ _jsx(IconArrowDown, {
|
|
39
|
+
className: "size-5",
|
|
40
|
+
stroke: 2
|
|
41
|
+
})
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
const ConversationTurn = ({ reserveViewport = false, className, ...props })=>/*#__PURE__*/ _jsx("div", {
|
|
45
|
+
"data-slot": "conversation-turn",
|
|
46
|
+
className: cn('flex w-full flex-col gap-6', reserveViewport && 'min-h-[100cqh]', className),
|
|
47
|
+
...props
|
|
48
|
+
});
|
|
49
|
+
export { Conversation, ConversationContent, ConversationScrollButton, ConversationTurn, useStickToBottomContext };
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=conversation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/ui/core/conversation/conversation.tsx"],"sourcesContent":["import type { ComponentProps, ReactNode } from 'react';\n\nimport { IconArrowDown } from '@tabler/icons-react';\nimport { StickToBottom, useStickToBottomContext } from 'use-stick-to-bottom';\n\nimport { cn } from '../../../../lib/utils';\nimport { Button } from '../button/button';\n\ntype ConversationProps = ComponentProps<typeof StickToBottom>;\n\nconst Conversation = ({\n className,\n ...props\n}: ConversationProps): ReactNode => (\n <StickToBottom\n data-slot=\"conversation\"\n className={cn(\n 'relative flex min-h-0 flex-1 flex-col overflow-y-hidden',\n className\n )}\n initial=\"smooth\"\n resize=\"smooth\"\n role=\"log\"\n {...props}\n />\n);\n\ntype ConversationContentProps = Omit<\n ComponentProps<typeof StickToBottom.Content>,\n 'scrollClassName'\n>;\n\nconst ConversationContent = ({\n className,\n ...props\n}: ConversationContentProps): ReactNode => (\n <StickToBottom.Content\n data-slot=\"conversation-content\"\n scrollClassName={cn(\n 'min-h-0 flex-1 overflow-y-auto [container-type:size]',\n '[scrollbar-color:theme(colors.border)_transparent]'\n )}\n className={cn('flex min-h-full flex-col', className)}\n {...props}\n />\n);\n\ntype ConversationScrollButtonProps = ComponentProps<typeof Button>;\n\nconst ConversationScrollButton = ({\n className,\n 'aria-label': ariaLabel = 'Scroll to bottom',\n onClick,\n ...props\n}: ConversationScrollButtonProps): ReactNode => {\n const { isAtBottom, scrollToBottom } = useStickToBottomContext();\n\n if (isAtBottom) {\n return null;\n }\n\n const handleClick: ConversationScrollButtonProps['onClick'] = (event) => {\n void scrollToBottom();\n onClick?.(event);\n };\n\n return (\n <Button\n data-slot=\"conversation-scroll-button\"\n type=\"button\"\n variant=\"outline\"\n size=\"icon\"\n aria-label={ariaLabel}\n className={cn('rounded-full shadow-lg', className)}\n onClick={handleClick}\n {...props}\n >\n <IconArrowDown className=\"size-5\" stroke={2} />\n </Button>\n );\n};\n\ntype ConversationTurnProps = ComponentProps<'div'> & {\n reserveViewport?: boolean;\n};\n\nconst ConversationTurn = ({\n reserveViewport = false,\n className,\n ...props\n}: ConversationTurnProps): ReactNode => (\n <div\n data-slot=\"conversation-turn\"\n className={cn(\n 'flex w-full flex-col gap-6',\n reserveViewport && 'min-h-[100cqh]',\n className\n )}\n {...props}\n />\n);\n\nexport {\n Conversation,\n ConversationContent,\n ConversationScrollButton,\n ConversationTurn,\n useStickToBottomContext,\n};\n"],"names":["IconArrowDown","StickToBottom","useStickToBottomContext","cn","Button","Conversation","className","props","data-slot","initial","resize","role","ConversationContent","Content","scrollClassName","ConversationScrollButton","ariaLabel","onClick","isAtBottom","scrollToBottom","handleClick","event","type","variant","size","aria-label","stroke","ConversationTurn","reserveViewport","div"],"mappings":";AAEA,SAASA,aAAa,QAAQ,sBAAsB;AACpD,SAASC,aAAa,EAAEC,uBAAuB,QAAQ,sBAAsB;AAE7E,SAASC,EAAE,QAAQ,2BAAwB;AAC3C,SAASC,MAAM,QAAQ,sBAAmB;AAI1C,MAAMC,eAAe,CAAC,EACpBC,SAAS,EACT,GAAGC,OACe,iBAClB,KAACN;QACCO,aAAU;QACVF,WAAWH,GACT,2DACAG;QAEFG,SAAQ;QACRC,QAAO;QACPC,MAAK;QACJ,GAAGJ,KAAK;;AASb,MAAMK,sBAAsB,CAAC,EAC3BN,SAAS,EACT,GAAGC,OACsB,iBACzB,KAACN,cAAcY,OAAO;QACpBL,aAAU;QACVM,iBAAiBX,GACf,wDACA;QAEFG,WAAWH,GAAG,4BAA4BG;QACzC,GAAGC,KAAK;;AAMb,MAAMQ,2BAA2B,CAAC,EAChCT,SAAS,EACT,cAAcU,YAAY,kBAAkB,EAC5CC,OAAO,EACP,GAAGV,OAC2B;IAC9B,MAAM,EAAEW,UAAU,EAAEC,cAAc,EAAE,GAAGjB;IAEvC,IAAIgB,YAAY;QACd,OAAO;IACT;IAEA,MAAME,cAAwD,CAACC;QAC7D,KAAKF;QACLF,UAAUI;IACZ;IAEA,qBACE,KAACjB;QACCI,aAAU;QACVc,MAAK;QACLC,SAAQ;QACRC,MAAK;QACLC,cAAYT;QACZV,WAAWH,GAAG,0BAA0BG;QACxCW,SAASG;QACR,GAAGb,KAAK;kBAET,cAAA,KAACP;YAAcM,WAAU;YAASoB,QAAQ;;;AAGhD;AAMA,MAAMC,mBAAmB,CAAC,EACxBC,kBAAkB,KAAK,EACvBtB,SAAS,EACT,GAAGC,OACmB,iBACtB,KAACsB;QACCrB,aAAU;QACVF,WAAWH,GACT,8BACAyB,mBAAmB,kBACnBtB;QAED,GAAGC,KAAK;;AAIb,SACEF,YAAY,EACZO,mBAAmB,EACnBG,wBAAwB,EACxBY,gBAAgB,EAChBzB,uBAAuB,GACvB"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { ForwardRefExoticComponent, RefAttributes, ComponentProps } from
|
|
2
|
-
import { VariantProps } from
|
|
3
|
-
import { ClassProp } from
|
|
1
|
+
import { type ForwardRefExoticComponent, type RefAttributes, type ComponentProps } from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
import type { ClassProp } from "class-variance-authority/types";
|
|
4
4
|
interface CountVariantProps {
|
|
5
|
-
|
|
5
|
+
variant?: "default" | "success" | "warning" | "critical" | null;
|
|
6
6
|
}
|
|
7
7
|
declare const countVariants: (props?: (CountVariantProps & ClassProp) | undefined) => string;
|
|
8
|
-
declare const Count: ForwardRefExoticComponent<ComponentProps<
|
|
9
|
-
|
|
8
|
+
declare const Count: ForwardRefExoticComponent<ComponentProps<"output"> & VariantProps<typeof countVariants> & RefAttributes<HTMLOutputElement>>;
|
|
9
|
+
declare const CountValue: ForwardRefExoticComponent<ComponentProps<"span"> & RefAttributes<HTMLSpanElement>>;
|
|
10
|
+
declare const CountUnit: ForwardRefExoticComponent<ComponentProps<"span"> & RefAttributes<HTMLSpanElement>>;
|
|
11
|
+
export { Count, CountUnit, CountValue, countVariants };
|