@cognite/aura 0.3.5 → 1.46104.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,87 +1,101 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
var
|
|
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
|
-
|
|
38
|
-
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useMemo } from "react";
|
|
3
|
+
import { IconAlertOctagon, IconLock, IconMessageDots, IconPlus, IconQuestionMark, IconSearchOff, IconZoomQuestion } from "@tabler/icons-react";
|
|
4
|
+
import { cn } from "../../../../lib/utils.js";
|
|
5
|
+
import { EmptyStateContext, useEmptyState } from "./empty-state.context.js";
|
|
6
|
+
const typeGradientClass = {
|
|
7
|
+
'error-generic': '[background-image:var(--gradient-fall)]',
|
|
8
|
+
'new-object': '[background-image:var(--gradient-spring)]',
|
|
9
|
+
'no-access': '[background-image:var(--gradient-fall)]',
|
|
10
|
+
'no-results': '[background-image:var(--gradient-spring)]',
|
|
11
|
+
'not-found': '[background-image:var(--gradient-spring)]',
|
|
12
|
+
'new-chat': '[background-image:var(--gradient-summer)]',
|
|
13
|
+
unknown: '[background-image:var(--gradient-spring)]'
|
|
14
|
+
};
|
|
15
|
+
const typeIcons = {
|
|
16
|
+
'error-generic': /*#__PURE__*/ _jsx(IconAlertOctagon, {}),
|
|
17
|
+
'new-object': /*#__PURE__*/ _jsx(IconPlus, {}),
|
|
18
|
+
'no-access': /*#__PURE__*/ _jsx(IconLock, {}),
|
|
19
|
+
'no-results': /*#__PURE__*/ _jsx(IconSearchOff, {}),
|
|
20
|
+
'not-found': /*#__PURE__*/ _jsx(IconZoomQuestion, {}),
|
|
21
|
+
'new-chat': /*#__PURE__*/ _jsx(IconMessageDots, {}),
|
|
22
|
+
unknown: /*#__PURE__*/ _jsx(IconQuestionMark, {})
|
|
23
|
+
};
|
|
24
|
+
const EmptyState = /*#__PURE__*/ forwardRef(({ className, variant = 'compact', type, children, ...props }, ref)=>{
|
|
25
|
+
const isFullPage = variant === 'full';
|
|
26
|
+
const contextValue = useMemo(()=>({
|
|
27
|
+
variant,
|
|
28
|
+
type
|
|
29
|
+
}), [
|
|
30
|
+
variant,
|
|
31
|
+
type
|
|
32
|
+
]);
|
|
33
|
+
return /*#__PURE__*/ _jsx(EmptyStateContext.Provider, {
|
|
34
|
+
value: contextValue,
|
|
35
|
+
children: /*#__PURE__*/ _jsx("div", {
|
|
36
|
+
ref: ref,
|
|
37
|
+
"data-slot": "empty-state",
|
|
38
|
+
"data-variant": variant,
|
|
39
|
+
className: cn('flex min-w-0 flex-col items-center text-center text-foreground', isFullPage ? 'gap-8 p-10' : 'gap-2', !isFullPage && 'w-full max-w-100', className),
|
|
40
|
+
...props,
|
|
41
|
+
children: children
|
|
42
|
+
})
|
|
43
|
+
});
|
|
39
44
|
});
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
45
|
+
EmptyState.displayName = 'EmptyState';
|
|
46
|
+
const EmptyStateIcon = /*#__PURE__*/ forwardRef(({ className, children, ...props }, ref)=>{
|
|
47
|
+
const { variant, type } = useEmptyState();
|
|
48
|
+
const isFullPage = variant === 'full';
|
|
49
|
+
const resolvedChildren = children ?? (type ? typeIcons[type] : null);
|
|
50
|
+
if (isFullPage) {
|
|
51
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
52
|
+
ref: ref,
|
|
53
|
+
"data-slot": "empty-state-icon",
|
|
54
|
+
className: cn('flex size-20 shrink-0 items-center justify-center rounded-2xl p-5 text-foreground [&_svg]:size-10 [&_svg]:stroke-[1.75]', type && typeGradientClass[type], className),
|
|
55
|
+
...props,
|
|
56
|
+
children: resolvedChildren
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
60
|
+
ref: ref,
|
|
61
|
+
"data-slot": "empty-state-icon",
|
|
62
|
+
className: cn('flex size-6 shrink-0 items-center justify-center text-muted-foreground [&_svg]:size-6 [&_svg]:stroke-[1.75]', className),
|
|
63
|
+
...props,
|
|
64
|
+
children: resolvedChildren
|
|
65
|
+
});
|
|
56
66
|
});
|
|
57
|
-
|
|
58
|
-
function
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
67
|
+
EmptyStateIcon.displayName = 'EmptyStateIcon';
|
|
68
|
+
function EmptyStateTitle({ className, as: Component = 'h2', ...props }) {
|
|
69
|
+
const { variant } = useEmptyState();
|
|
70
|
+
const isFullPage = variant === 'full';
|
|
71
|
+
const Tag = Component;
|
|
72
|
+
return /*#__PURE__*/ _jsx(Tag, {
|
|
73
|
+
"data-slot": "empty-state-title",
|
|
74
|
+
className: cn('max-w-100 break-words font-medium text-foreground', isFullPage ? 'text-xl leading-6 tracking-tightest' : 'text-base leading-5 tracking-tighter', className),
|
|
75
|
+
...props
|
|
76
|
+
});
|
|
65
77
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
78
|
+
const EmptyStateDescription = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>{
|
|
79
|
+
const { variant } = useEmptyState();
|
|
80
|
+
const isFullPage = variant === 'full';
|
|
81
|
+
return /*#__PURE__*/ _jsx("p", {
|
|
82
|
+
ref: ref,
|
|
83
|
+
"data-slot": "empty-state-description",
|
|
84
|
+
className: cn('max-w-100 break-words text-muted-foreground', isFullPage ? 'text-lg leading-6 tracking-tightest' : 'text-sm leading-4.5 tracking-tight', className),
|
|
85
|
+
...props
|
|
86
|
+
});
|
|
74
87
|
});
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
88
|
+
EmptyStateDescription.displayName = 'EmptyStateDescription';
|
|
89
|
+
const EmptyStateActions = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>{
|
|
90
|
+
const { variant } = useEmptyState();
|
|
91
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
92
|
+
ref: ref,
|
|
93
|
+
"data-slot": "empty-state-actions",
|
|
94
|
+
className: cn('flex flex-col items-center', variant === 'compact' ? 'gap-2' : 'gap-4', className),
|
|
95
|
+
...props
|
|
96
|
+
});
|
|
84
97
|
});
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
98
|
+
EmptyStateActions.displayName = 'EmptyStateActions';
|
|
99
|
+
export { EmptyState, EmptyStateIcon, EmptyStateTitle, EmptyStateDescription, EmptyStateActions };
|
|
100
|
+
|
|
101
|
+
//# sourceMappingURL=empty-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/ui/core/empty-state/empty-state.tsx"],"sourcesContent":["import {\n type ForwardRefExoticComponent,\n type RefAttributes,\n type ComponentProps,\n type ComponentRef,\n type ReactNode,\n forwardRef,\n useMemo,\n} from 'react';\n\nimport {\n IconAlertOctagon,\n IconLock,\n IconMessageDots,\n IconPlus,\n IconQuestionMark,\n IconSearchOff,\n IconZoomQuestion,\n} from '@tabler/icons-react';\n\nimport { cn } from '../../../../lib/utils';\n\nimport { EmptyStateContext, useEmptyState } from './empty-state.context';\nimport type { EmptyStateType } from './empty-state.context';\n\nconst typeGradientClass: Record<EmptyStateType, string> = {\n 'error-generic': '[background-image:var(--gradient-fall)]',\n 'new-object': '[background-image:var(--gradient-spring)]',\n 'no-access': '[background-image:var(--gradient-fall)]',\n 'no-results': '[background-image:var(--gradient-spring)]',\n 'not-found': '[background-image:var(--gradient-spring)]',\n 'new-chat': '[background-image:var(--gradient-summer)]',\n unknown: '[background-image:var(--gradient-spring)]',\n};\n\nconst typeIcons: Record<EmptyStateType, ReactNode> = {\n 'error-generic': <IconAlertOctagon />,\n 'new-object': <IconPlus />,\n 'no-access': <IconLock />,\n 'no-results': <IconSearchOff />,\n 'not-found': <IconZoomQuestion />,\n 'new-chat': <IconMessageDots />,\n unknown: <IconQuestionMark />,\n};\n\ntype EmptyStateProps = ComponentProps<'div'> &\n (\n | { variant?: 'compact'; type?: EmptyStateType }\n | { variant: 'full'; type: EmptyStateType }\n );\n\nconst EmptyState: ForwardRefExoticComponent<\n Omit<ComponentProps<'div'>, 'ref'> &\n (\n | { variant?: 'compact'; type?: EmptyStateType }\n | { variant: 'full'; type: EmptyStateType }\n ) &\n RefAttributes<HTMLDivElement>\n> = forwardRef<ComponentRef<'div'>, EmptyStateProps>(\n ({ className, variant = 'compact', type, children, ...props }, ref) => {\n const isFullPage = variant === 'full';\n const contextValue = useMemo(() => ({ variant, type }), [variant, type]);\n\n return (\n <EmptyStateContext.Provider value={contextValue}>\n <div\n ref={ref}\n data-slot=\"empty-state\"\n data-variant={variant}\n className={cn(\n 'flex min-w-0 flex-col items-center text-center text-foreground',\n isFullPage ? 'gap-8 p-10' : 'gap-2',\n !isFullPage && 'w-full max-w-100',\n className\n )}\n {...props}\n >\n {children}\n </div>\n </EmptyStateContext.Provider>\n );\n }\n);\nEmptyState.displayName = 'EmptyState';\n\nconst EmptyStateIcon: ForwardRefExoticComponent<\n ComponentProps<'div'> & RefAttributes<HTMLDivElement>\n> = forwardRef<ComponentRef<'div'>, ComponentProps<'div'>>(\n ({ className, children, ...props }, ref) => {\n const { variant, type } = useEmptyState();\n const isFullPage = variant === 'full';\n const resolvedChildren = children ?? (type ? typeIcons[type] : null);\n\n if (isFullPage) {\n return (\n <div\n ref={ref}\n data-slot=\"empty-state-icon\"\n className={cn(\n 'flex size-20 shrink-0 items-center justify-center rounded-2xl p-5 text-foreground [&_svg]:size-10 [&_svg]:stroke-[1.75]',\n type && typeGradientClass[type],\n className\n )}\n {...props}\n >\n {resolvedChildren}\n </div>\n );\n }\n\n return (\n <div\n ref={ref}\n data-slot=\"empty-state-icon\"\n className={cn(\n 'flex size-6 shrink-0 items-center justify-center text-muted-foreground [&_svg]:size-6 [&_svg]:stroke-[1.75]',\n className\n )}\n {...props}\n >\n {resolvedChildren}\n </div>\n );\n }\n);\nEmptyStateIcon.displayName = 'EmptyStateIcon';\n\ntype TitleAs = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p';\n\ntype EmptyStateTitleProps = ComponentProps<'h2'> & { as?: TitleAs };\n\nfunction EmptyStateTitle({\n className,\n as: Component = 'h2',\n ...props\n}: EmptyStateTitleProps): ReactNode {\n const { variant } = useEmptyState();\n const isFullPage = variant === 'full';\n\n const Tag = Component as 'h2';\n\n return (\n <Tag\n data-slot=\"empty-state-title\"\n className={cn(\n 'max-w-100 break-words font-medium text-foreground',\n isFullPage\n ? 'text-xl leading-6 tracking-tightest'\n : 'text-base leading-5 tracking-tighter',\n className\n )}\n {...props}\n />\n );\n}\n\nconst EmptyStateDescription: ForwardRefExoticComponent<\n ComponentProps<'p'> & RefAttributes<HTMLParagraphElement>\n> = forwardRef<ComponentRef<'p'>, ComponentProps<'p'>>(\n ({ className, ...props }, ref) => {\n const { variant } = useEmptyState();\n const isFullPage = variant === 'full';\n\n return (\n <p\n ref={ref}\n data-slot=\"empty-state-description\"\n className={cn(\n 'max-w-100 break-words text-muted-foreground',\n isFullPage\n ? 'text-lg leading-6 tracking-tightest'\n : 'text-sm leading-4.5 tracking-tight',\n className\n )}\n {...props}\n />\n );\n }\n);\nEmptyStateDescription.displayName = 'EmptyStateDescription';\n\nconst EmptyStateActions: ForwardRefExoticComponent<\n ComponentProps<'div'> & RefAttributes<HTMLDivElement>\n> = forwardRef<ComponentRef<'div'>, ComponentProps<'div'>>(\n ({ className, ...props }, ref) => {\n const { variant } = useEmptyState();\n\n return (\n <div\n ref={ref}\n data-slot=\"empty-state-actions\"\n className={cn(\n 'flex flex-col items-center',\n variant === 'compact' ? 'gap-2' : 'gap-4',\n className\n )}\n {...props}\n />\n );\n }\n);\nEmptyStateActions.displayName = 'EmptyStateActions';\n\nexport {\n EmptyState,\n EmptyStateIcon,\n EmptyStateTitle,\n EmptyStateDescription,\n EmptyStateActions,\n};\n"],"names":["forwardRef","useMemo","IconAlertOctagon","IconLock","IconMessageDots","IconPlus","IconQuestionMark","IconSearchOff","IconZoomQuestion","cn","EmptyStateContext","useEmptyState","typeGradientClass","unknown","typeIcons","EmptyState","className","variant","type","children","props","ref","isFullPage","contextValue","Provider","value","div","data-slot","data-variant","displayName","EmptyStateIcon","resolvedChildren","EmptyStateTitle","as","Component","Tag","EmptyStateDescription","p","EmptyStateActions"],"mappings":";AAAA,SAMEA,UAAU,EACVC,OAAO,QACF,QAAQ;AAEf,SACEC,gBAAgB,EAChBC,QAAQ,EACRC,eAAe,EACfC,QAAQ,EACRC,gBAAgB,EAChBC,aAAa,EACbC,gBAAgB,QACX,sBAAsB;AAE7B,SAASC,EAAE,QAAQ,2BAAwB;AAE3C,SAASC,iBAAiB,EAAEC,aAAa,QAAQ,2BAAwB;AAGzE,MAAMC,oBAAoD;IACxD,iBAAiB;IACjB,cAAc;IACd,aAAa;IACb,cAAc;IACd,aAAa;IACb,YAAY;IACZC,SAAS;AACX;AAEA,MAAMC,YAA+C;IACnD,+BAAiB,KAACZ;IAClB,4BAAc,KAACG;IACf,2BAAa,KAACF;IACd,4BAAc,KAACI;IACf,2BAAa,KAACC;IACd,0BAAY,KAACJ;IACbS,uBAAS,KAACP;AACZ;AAQA,MAAMS,2BAOFf,WACF,CAAC,EAAEgB,SAAS,EAAEC,UAAU,SAAS,EAAEC,IAAI,EAAEC,QAAQ,EAAE,GAAGC,OAAO,EAAEC;IAC7D,MAAMC,aAAaL,YAAY;IAC/B,MAAMM,eAAetB,QAAQ,IAAO,CAAA;YAAEgB;YAASC;QAAK,CAAA,GAAI;QAACD;QAASC;KAAK;IAEvE,qBACE,KAACR,kBAAkBc,QAAQ;QAACC,OAAOF;kBACjC,cAAA,KAACG;YACCL,KAAKA;YACLM,aAAU;YACVC,gBAAcX;YACdD,WAAWP,GACT,kEACAa,aAAa,eAAe,SAC5B,CAACA,cAAc,oBACfN;YAED,GAAGI,KAAK;sBAERD;;;AAIT;AAEFJ,WAAWc,WAAW,GAAG;AAEzB,MAAMC,+BAEF9B,WACF,CAAC,EAAEgB,SAAS,EAAEG,QAAQ,EAAE,GAAGC,OAAO,EAAEC;IAClC,MAAM,EAAEJ,OAAO,EAAEC,IAAI,EAAE,GAAGP;IAC1B,MAAMW,aAAaL,YAAY;IAC/B,MAAMc,mBAAmBZ,YAAaD,CAAAA,OAAOJ,SAAS,CAACI,KAAK,GAAG,IAAG;IAElE,IAAII,YAAY;QACd,qBACE,KAACI;YACCL,KAAKA;YACLM,aAAU;YACVX,WAAWP,GACT,2HACAS,QAAQN,iBAAiB,CAACM,KAAK,EAC/BF;YAED,GAAGI,KAAK;sBAERW;;IAGP;IAEA,qBACE,KAACL;QACCL,KAAKA;QACLM,aAAU;QACVX,WAAWP,GACT,+GACAO;QAED,GAAGI,KAAK;kBAERW;;AAGP;AAEFD,eAAeD,WAAW,GAAG;AAM7B,SAASG,gBAAgB,EACvBhB,SAAS,EACTiB,IAAIC,YAAY,IAAI,EACpB,GAAGd,OACkB;IACrB,MAAM,EAAEH,OAAO,EAAE,GAAGN;IACpB,MAAMW,aAAaL,YAAY;IAE/B,MAAMkB,MAAMD;IAEZ,qBACE,KAACC;QACCR,aAAU;QACVX,WAAWP,GACT,qDACAa,aACI,wCACA,wCACJN;QAED,GAAGI,KAAK;;AAGf;AAEA,MAAMgB,sCAEFpC,WACF,CAAC,EAAEgB,SAAS,EAAE,GAAGI,OAAO,EAAEC;IACxB,MAAM,EAAEJ,OAAO,EAAE,GAAGN;IACpB,MAAMW,aAAaL,YAAY;IAE/B,qBACE,KAACoB;QACChB,KAAKA;QACLM,aAAU;QACVX,WAAWP,GACT,+CACAa,aACI,wCACA,sCACJN;QAED,GAAGI,KAAK;;AAGf;AAEFgB,sBAAsBP,WAAW,GAAG;AAEpC,MAAMS,kCAEFtC,WACF,CAAC,EAAEgB,SAAS,EAAE,GAAGI,OAAO,EAAEC;IACxB,MAAM,EAAEJ,OAAO,EAAE,GAAGN;IAEpB,qBACE,KAACe;QACCL,KAAKA;QACLM,aAAU;QACVX,WAAWP,GACT,8BACAQ,YAAY,YAAY,UAAU,SAClCD;QAED,GAAGI,KAAK;;AAGf;AAEFkB,kBAAkBT,WAAW,GAAG;AAEhC,SACEd,UAAU,EACVe,cAAc,EACdE,eAAe,EACfI,qBAAqB,EACrBE,iBAAiB,GACjB"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { ForwardRefExoticComponent, RefAttributes, HTMLAttributes, ReactNode } from
|
|
2
|
-
import { VariantProps } from
|
|
3
|
-
import { ClassProp } from
|
|
1
|
+
import { type ForwardRefExoticComponent, type RefAttributes, type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
import type { ClassProp } from "class-variance-authority/types";
|
|
4
4
|
interface HelperTextVariantProps {
|
|
5
|
-
|
|
5
|
+
size?: "xs" | "sm" | null;
|
|
6
6
|
}
|
|
7
7
|
declare const helperTextVariants: (props?: (HelperTextVariantProps & ClassProp) | undefined) => string;
|
|
8
8
|
interface HelperTextProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof helperTextVariants> {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
isError?: boolean;
|
|
10
|
+
isSuccess?: boolean;
|
|
11
|
+
icon?: ReactNode;
|
|
12
12
|
}
|
|
13
13
|
declare const HelperText: ForwardRefExoticComponent<HelperTextProps & RefAttributes<HTMLDivElement>>;
|
|
14
14
|
export { HelperText };
|
|
@@ -1,37 +1,56 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { forwardRef
|
|
3
|
-
import { IconExclamationCircle
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
sm: "[&_svg]:size-4"
|
|
17
|
-
} },
|
|
18
|
-
defaultVariants: { size: "sm" }
|
|
19
|
-
}), l = t(({ className: t, size: o = "sm", isError: l = !1, isSuccess: u = !1, icon: d, children: f, ...p }, m) => {
|
|
20
|
-
let h = d ?? (l ? /* @__PURE__ */ i(r, {}) : null), g = n(h), _ = l ? "text-destructive-foreground" : u ? "text-success-foreground" : "text-muted-foreground";
|
|
21
|
-
return /* @__PURE__ */ a("div", {
|
|
22
|
-
ref: m,
|
|
23
|
-
"data-slot": "helper-text",
|
|
24
|
-
className: e(s({ size: o }), t),
|
|
25
|
-
...p,
|
|
26
|
-
children: [g ? /* @__PURE__ */ i("span", {
|
|
27
|
-
className: e(c({ size: o }), o === "sm" && "mt-0.25", _),
|
|
28
|
-
children: h
|
|
29
|
-
}) : null, /* @__PURE__ */ i("span", {
|
|
30
|
-
className: _,
|
|
31
|
-
children: f
|
|
32
|
-
})]
|
|
33
|
-
});
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, isValidElement } from "react";
|
|
3
|
+
import { IconExclamationCircle } from "@tabler/icons-react";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { cn } from "../../../../lib/utils.js";
|
|
6
|
+
const helperTextVariants = cva('flex flex-row justify-start items-start pt-2 font-normal', {
|
|
7
|
+
variants: {
|
|
8
|
+
size: {
|
|
9
|
+
xs: 'gap-1 text-xs leading-3.5 tracking-tightest',
|
|
10
|
+
sm: 'gap-1 text-sm leading-4.5 tracking-tight'
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
defaultVariants: {
|
|
14
|
+
size: 'sm'
|
|
15
|
+
}
|
|
34
16
|
});
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
17
|
+
const helperTextIconVariants = cva('shrink-0', {
|
|
18
|
+
variants: {
|
|
19
|
+
size: {
|
|
20
|
+
xs: '[&_svg]:size-3.5',
|
|
21
|
+
sm: '[&_svg]:size-4'
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
defaultVariants: {
|
|
25
|
+
size: 'sm'
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const HelperText = /*#__PURE__*/ forwardRef(({ className, size = 'sm', isError = false, isSuccess = false, icon, children, ...props }, ref)=>{
|
|
29
|
+
const displayIcon = icon ?? (isError ? /*#__PURE__*/ _jsx(IconExclamationCircle, {}) : null);
|
|
30
|
+
const hasIconElement = /*#__PURE__*/ isValidElement(displayIcon);
|
|
31
|
+
const textColor = isError ? 'text-critical-foreground-strong' : isSuccess ? 'text-success-foreground-strong' : 'text-muted-foreground';
|
|
32
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
33
|
+
ref: ref,
|
|
34
|
+
"data-slot": "helper-text",
|
|
35
|
+
className: cn(helperTextVariants({
|
|
36
|
+
size
|
|
37
|
+
}), className),
|
|
38
|
+
...props,
|
|
39
|
+
children: [
|
|
40
|
+
hasIconElement ? /*#__PURE__*/ _jsx("span", {
|
|
41
|
+
className: cn(helperTextIconVariants({
|
|
42
|
+
size
|
|
43
|
+
}), size === 'sm' && 'mt-0.25', textColor),
|
|
44
|
+
children: displayIcon
|
|
45
|
+
}) : null,
|
|
46
|
+
/*#__PURE__*/ _jsx("span", {
|
|
47
|
+
className: textColor,
|
|
48
|
+
children: children
|
|
49
|
+
})
|
|
50
|
+
]
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
HelperText.displayName = 'HelperText';
|
|
54
|
+
export { HelperText };
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=helper-text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/ui/core/helper-text/helper-text.tsx"],"sourcesContent":["import {\n type ForwardRefExoticComponent,\n type RefAttributes,\n type ComponentRef,\n type HTMLAttributes,\n type ReactNode,\n forwardRef,\n isValidElement,\n} from 'react';\n\nimport { IconExclamationCircle } from '@tabler/icons-react';\nimport { type VariantProps, cva } from 'class-variance-authority';\nimport type { ClassProp } from 'class-variance-authority/types';\n\nimport { cn } from '../../../../lib/utils';\n\ninterface HelperTextVariantProps {\n size?: 'xs' | 'sm' | null;\n}\n\nconst helperTextVariants: (\n props?: (HelperTextVariantProps & ClassProp) | undefined\n) => string = cva('flex flex-row justify-start items-start pt-2 font-normal', {\n variants: {\n size: {\n xs: 'gap-1 text-xs leading-3.5 tracking-tightest',\n sm: 'gap-1 text-sm leading-4.5 tracking-tight',\n },\n },\n defaultVariants: {\n size: 'sm',\n },\n});\n\nconst helperTextIconVariants = cva('shrink-0', {\n variants: {\n size: {\n xs: '[&_svg]:size-3.5',\n sm: '[&_svg]:size-4',\n },\n },\n defaultVariants: {\n size: 'sm',\n },\n});\n\ninterface HelperTextProps\n extends\n HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof helperTextVariants> {\n isError?: boolean;\n isSuccess?: boolean;\n icon?: ReactNode;\n}\n\nconst HelperText: ForwardRefExoticComponent<\n HelperTextProps & RefAttributes<HTMLDivElement>\n> = forwardRef<ComponentRef<'div'>, HelperTextProps>(\n (\n {\n className,\n size = 'sm',\n isError = false,\n isSuccess = false,\n icon,\n children,\n ...props\n },\n ref\n ) => {\n const displayIcon = icon ?? (isError ? <IconExclamationCircle /> : null);\n const hasIconElement = isValidElement(displayIcon);\n\n const textColor = isError\n ? 'text-critical-foreground-strong'\n : isSuccess\n ? 'text-success-foreground-strong'\n : 'text-muted-foreground';\n\n return (\n <div\n ref={ref}\n data-slot=\"helper-text\"\n className={cn(helperTextVariants({ size }), className)}\n {...props}\n >\n {hasIconElement ? (\n <span\n className={cn(\n helperTextIconVariants({ size }),\n size === 'sm' && 'mt-0.25',\n textColor\n )}\n >\n {displayIcon}\n </span>\n ) : null}\n <span className={textColor}>{children}</span>\n </div>\n );\n }\n);\nHelperText.displayName = 'HelperText';\n\nexport { HelperText };\n"],"names":["forwardRef","isValidElement","IconExclamationCircle","cva","cn","helperTextVariants","variants","size","xs","sm","defaultVariants","helperTextIconVariants","HelperText","className","isError","isSuccess","icon","children","props","ref","displayIcon","hasIconElement","textColor","div","data-slot","span","displayName"],"mappings":";AAAA,SAMEA,UAAU,EACVC,cAAc,QACT,QAAQ;AAEf,SAASC,qBAAqB,QAAQ,sBAAsB;AAC5D,SAA4BC,GAAG,QAAQ,2BAA2B;AAGlE,SAASC,EAAE,QAAQ,2BAAwB;AAM3C,MAAMC,qBAEQF,IAAI,4DAA4D;IAC5EG,UAAU;QACRC,MAAM;YACJC,IAAI;YACJC,IAAI;QACN;IACF;IACAC,iBAAiB;QACfH,MAAM;IACR;AACF;AAEA,MAAMI,yBAAyBR,IAAI,YAAY;IAC7CG,UAAU;QACRC,MAAM;YACJC,IAAI;YACJC,IAAI;QACN;IACF;IACAC,iBAAiB;QACfH,MAAM;IACR;AACF;AAWA,MAAMK,2BAEFZ,WACF,CACE,EACEa,SAAS,EACTN,OAAO,IAAI,EACXO,UAAU,KAAK,EACfC,YAAY,KAAK,EACjBC,IAAI,EACJC,QAAQ,EACR,GAAGC,OACJ,EACDC;IAEA,MAAMC,cAAcJ,QAASF,CAAAA,wBAAU,KAACZ,6BAA2B,IAAG;IACtE,MAAMmB,+BAAiBpB,eAAemB;IAEtC,MAAME,YAAYR,UACd,oCACAC,YACE,mCACA;IAEN,qBACE,MAACQ;QACCJ,KAAKA;QACLK,aAAU;QACVX,WAAWT,GAAGC,mBAAmB;YAAEE;QAAK,IAAIM;QAC3C,GAAGK,KAAK;;YAERG,+BACC,KAACI;gBACCZ,WAAWT,GACTO,uBAAuB;oBAAEJ;gBAAK,IAC9BA,SAAS,QAAQ,WACjBe;0BAGDF;iBAED;0BACJ,KAACK;gBAAKZ,WAAWS;0BAAYL;;;;AAGnC;AAEFL,WAAWc,WAAW,GAAG;AAEzB,SAASd,UAAU,GAAG"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { ForwardRefExoticComponent, RefAttributes, ReactNode } from
|
|
2
|
-
import { PreviewCardPopupProps, PreviewCardPositionerProps
|
|
1
|
+
import { type ForwardRefExoticComponent, type RefAttributes, type ReactNode } from "react";
|
|
2
|
+
import type { PreviewCardPopupProps, PreviewCardPositionerProps } from "@base-ui/react/preview-card";
|
|
3
|
+
import { PreviewCard as PreviewCardPrimitive } from "@base-ui/react/preview-card";
|
|
3
4
|
type HoverCardDelay = {
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
openDelay?: number;
|
|
6
|
+
closeDelay?: number;
|
|
6
7
|
};
|
|
7
8
|
declare function HoverCard({ openDelay, closeDelay, ...props }: PreviewCardPrimitive.Root.Props & HoverCardDelay): ReactNode;
|
|
8
|
-
declare const HoverCardTrigger: ForwardRefExoticComponent<Omit<PreviewCardPrimitive.Trigger.Props<unknown>,
|
|
9
|
-
declare const HoverCardContent: ForwardRefExoticComponent<Omit<PreviewCardPopupProps & Pick<PreviewCardPositionerProps,
|
|
9
|
+
declare const HoverCardTrigger: ForwardRefExoticComponent<Omit<PreviewCardPrimitive.Trigger.Props<unknown>, "ref"> & RefAttributes<HTMLAnchorElement>>;
|
|
10
|
+
declare const HoverCardContent: ForwardRefExoticComponent<Omit<PreviewCardPopupProps & Pick<PreviewCardPositionerProps, "align" | "alignOffset" | "side" | "sideOffset">, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
10
11
|
export { HoverCard, HoverCardTrigger, HoverCardContent };
|
|
@@ -1,55 +1,59 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, forwardRef, useContext, useMemo } from "react";
|
|
3
|
+
import { PreviewCard as PreviewCardPrimitive } from "@base-ui/react/preview-card";
|
|
4
|
+
import { usePortalContainer } from "../../../../lib/portal-container-context.js";
|
|
5
|
+
import { cn } from "../../../../lib/utils.js";
|
|
6
|
+
const HoverCardDelayContext = /*#__PURE__*/ createContext(null);
|
|
7
|
+
function HoverCard({ openDelay, closeDelay, ...props }) {
|
|
8
|
+
const delayValue = useMemo(()=>({
|
|
9
|
+
openDelay,
|
|
10
|
+
closeDelay
|
|
11
|
+
}), [
|
|
12
|
+
openDelay,
|
|
13
|
+
closeDelay
|
|
14
|
+
]);
|
|
15
|
+
return /*#__PURE__*/ _jsx(HoverCardDelayContext.Provider, {
|
|
16
|
+
value: delayValue,
|
|
17
|
+
children: /*#__PURE__*/ _jsx(PreviewCardPrimitive.Root, {
|
|
18
|
+
"data-slot": "hover-card",
|
|
19
|
+
...props
|
|
20
|
+
})
|
|
21
|
+
});
|
|
20
22
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
const HoverCardTrigger = /*#__PURE__*/ forwardRef(({ children, ...props }, ref)=>{
|
|
24
|
+
const delayContext = useContext(HoverCardDelayContext);
|
|
25
|
+
const { delay, closeDelay, ...triggerProps } = props;
|
|
26
|
+
return /*#__PURE__*/ _jsx(PreviewCardPrimitive.Trigger, {
|
|
27
|
+
ref: ref,
|
|
28
|
+
"data-slot": "hover-card-trigger",
|
|
29
|
+
delay: delay ?? delayContext?.openDelay,
|
|
30
|
+
closeDelay: closeDelay ?? delayContext?.closeDelay,
|
|
31
|
+
...triggerProps,
|
|
32
|
+
children: children
|
|
33
|
+
});
|
|
31
34
|
});
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
35
|
+
HoverCardTrigger.displayName = 'HoverCardTrigger';
|
|
36
|
+
const HoverCardContent = /*#__PURE__*/ forwardRef(({ className, side = 'bottom', sideOffset = 4, align = 'center', alignOffset = 4, ...props }, ref)=>{
|
|
37
|
+
const container = usePortalContainer();
|
|
38
|
+
return /*#__PURE__*/ _jsx(PreviewCardPrimitive.Portal, {
|
|
39
|
+
"data-slot": "hover-card-portal",
|
|
40
|
+
container: container,
|
|
41
|
+
children: /*#__PURE__*/ _jsx(PreviewCardPrimitive.Positioner, {
|
|
42
|
+
align: align,
|
|
43
|
+
alignOffset: alignOffset,
|
|
44
|
+
side: side,
|
|
45
|
+
sideOffset: sideOffset,
|
|
46
|
+
className: "isolate z-50",
|
|
47
|
+
children: /*#__PURE__*/ _jsx(PreviewCardPrimitive.Popup, {
|
|
48
|
+
ref: ref,
|
|
49
|
+
"data-slot": "hover-card-content",
|
|
50
|
+
className: cn('bg-popover-background text-popover-foreground border border-default data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-[var(--transform-origin)] rounded-md p-4 shadow-md outline-none', className),
|
|
51
|
+
...props
|
|
52
|
+
})
|
|
53
|
+
})
|
|
54
|
+
});
|
|
52
55
|
});
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
HoverCardContent.displayName = 'HoverCardContent';
|
|
57
|
+
export { HoverCard, HoverCardTrigger, HoverCardContent };
|
|
58
|
+
|
|
59
|
+
//# sourceMappingURL=hover-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/ui/core/hover-card/hover-card.tsx"],"sourcesContent":["import {\n type ForwardRefExoticComponent,\n type RefAttributes,\n type ComponentRef,\n type ReactNode,\n createContext,\n forwardRef,\n useContext,\n useMemo,\n} from 'react';\n\nimport type {\n PreviewCardPopupProps,\n PreviewCardPositionerProps,\n} from '@base-ui/react/preview-card';\nimport { PreviewCard as PreviewCardPrimitive } from '@base-ui/react/preview-card';\n\nimport { usePortalContainer } from '../../../../lib/portal-container-context';\nimport { cn } from '../../../../lib/utils';\n\ntype HoverCardDelay = {\n openDelay?: number;\n closeDelay?: number;\n};\n\nconst HoverCardDelayContext = createContext<HoverCardDelay | null>(null);\n\nfunction HoverCard({\n openDelay,\n closeDelay,\n ...props\n}: PreviewCardPrimitive.Root.Props & HoverCardDelay): ReactNode {\n const delayValue = useMemo(\n () => ({ openDelay, closeDelay }),\n [openDelay, closeDelay]\n );\n return (\n <HoverCardDelayContext.Provider value={delayValue}>\n <PreviewCardPrimitive.Root data-slot=\"hover-card\" {...props} />\n </HoverCardDelayContext.Provider>\n );\n}\n\nconst HoverCardTrigger: ForwardRefExoticComponent<\n Omit<PreviewCardPrimitive.Trigger.Props<unknown>, 'ref'> &\n RefAttributes<HTMLAnchorElement>\n> = forwardRef<HTMLAnchorElement, PreviewCardPrimitive.Trigger.Props>(\n ({ children, ...props }, ref) => {\n const delayContext = useContext(HoverCardDelayContext);\n const { delay, closeDelay, ...triggerProps } = props;\n return (\n <PreviewCardPrimitive.Trigger\n ref={ref}\n data-slot=\"hover-card-trigger\"\n delay={delay ?? delayContext?.openDelay}\n closeDelay={closeDelay ?? delayContext?.closeDelay}\n {...triggerProps}\n >\n {children}\n </PreviewCardPrimitive.Trigger>\n );\n }\n);\nHoverCardTrigger.displayName = 'HoverCardTrigger';\n\nconst HoverCardContent: ForwardRefExoticComponent<\n Omit<\n PreviewCardPopupProps &\n Pick<\n PreviewCardPositionerProps,\n 'align' | 'alignOffset' | 'side' | 'sideOffset'\n >,\n 'ref'\n > &\n RefAttributes<HTMLDivElement>\n> = forwardRef<\n ComponentRef<typeof PreviewCardPrimitive.Popup>,\n PreviewCardPrimitive.Popup.Props &\n Pick<\n PreviewCardPrimitive.Positioner.Props,\n 'align' | 'alignOffset' | 'side' | 'sideOffset'\n >\n>(\n (\n {\n className,\n side = 'bottom',\n sideOffset = 4,\n align = 'center',\n alignOffset = 4,\n ...props\n },\n ref\n ) => {\n const container = usePortalContainer();\n return (\n <PreviewCardPrimitive.Portal\n data-slot=\"hover-card-portal\"\n container={container}\n >\n <PreviewCardPrimitive.Positioner\n align={align}\n alignOffset={alignOffset}\n side={side}\n sideOffset={sideOffset}\n className=\"isolate z-50\"\n >\n <PreviewCardPrimitive.Popup\n ref={ref}\n data-slot=\"hover-card-content\"\n className={cn(\n 'bg-popover-background text-popover-foreground border border-default data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-[var(--transform-origin)] rounded-md p-4 shadow-md outline-none',\n className\n )}\n {...props}\n />\n </PreviewCardPrimitive.Positioner>\n </PreviewCardPrimitive.Portal>\n );\n }\n);\nHoverCardContent.displayName = 'HoverCardContent';\n\nexport { HoverCard, HoverCardTrigger, HoverCardContent };\n"],"names":["createContext","forwardRef","useContext","useMemo","PreviewCard","PreviewCardPrimitive","usePortalContainer","cn","HoverCardDelayContext","HoverCard","openDelay","closeDelay","props","delayValue","Provider","value","Root","data-slot","HoverCardTrigger","children","ref","delayContext","delay","triggerProps","Trigger","displayName","HoverCardContent","className","side","sideOffset","align","alignOffset","container","Portal","Positioner","Popup"],"mappings":";AAAA,SAKEA,aAAa,EACbC,UAAU,EACVC,UAAU,EACVC,OAAO,QACF,QAAQ;AAMf,SAASC,eAAeC,oBAAoB,QAAQ,8BAA8B;AAElF,SAASC,kBAAkB,QAAQ,8CAA2C;AAC9E,SAASC,EAAE,QAAQ,2BAAwB;AAO3C,MAAMC,sCAAwBR,cAAqC;AAEnE,SAASS,UAAU,EACjBC,SAAS,EACTC,UAAU,EACV,GAAGC,OAC8C;IACjD,MAAMC,aAAaV,QACjB,IAAO,CAAA;YAAEO;YAAWC;QAAW,CAAA,GAC/B;QAACD;QAAWC;KAAW;IAEzB,qBACE,KAACH,sBAAsBM,QAAQ;QAACC,OAAOF;kBACrC,cAAA,KAACR,qBAAqBW,IAAI;YAACC,aAAU;YAAc,GAAGL,KAAK;;;AAGjE;AAEA,MAAMM,iCAGFjB,WACF,CAAC,EAAEkB,QAAQ,EAAE,GAAGP,OAAO,EAAEQ;IACvB,MAAMC,eAAenB,WAAWM;IAChC,MAAM,EAAEc,KAAK,EAAEX,UAAU,EAAE,GAAGY,cAAc,GAAGX;IAC/C,qBACE,KAACP,qBAAqBmB,OAAO;QAC3BJ,KAAKA;QACLH,aAAU;QACVK,OAAOA,SAASD,cAAcX;QAC9BC,YAAYA,cAAcU,cAAcV;QACvC,GAAGY,YAAY;kBAEfJ;;AAGP;AAEFD,iBAAiBO,WAAW,GAAG;AAE/B,MAAMC,iCAUFzB,WAQF,CACE,EACE0B,SAAS,EACTC,OAAO,QAAQ,EACfC,aAAa,CAAC,EACdC,QAAQ,QAAQ,EAChBC,cAAc,CAAC,EACf,GAAGnB,OACJ,EACDQ;IAEA,MAAMY,YAAY1B;IAClB,qBACE,KAACD,qBAAqB4B,MAAM;QAC1BhB,aAAU;QACVe,WAAWA;kBAEX,cAAA,KAAC3B,qBAAqB6B,UAAU;YAC9BJ,OAAOA;YACPC,aAAaA;YACbH,MAAMA;YACNC,YAAYA;YACZF,WAAU;sBAEV,cAAA,KAACtB,qBAAqB8B,KAAK;gBACzBf,KAAKA;gBACLH,aAAU;gBACVU,WAAWpB,GACT,ybACAoB;gBAED,GAAGf,KAAK;;;;AAKnB;AAEFc,iBAAiBD,WAAW,GAAG;AAE/B,SAAShB,SAAS,EAAES,gBAAgB,EAAEQ,gBAAgB,GAAG"}
|
|
@@ -1,33 +1,34 @@
|
|
|
1
|
-
import { ForwardRefExoticComponent, RefAttributes, ComponentProps, ComponentType, ReactNode } from
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
declare const
|
|
6
|
-
declare const
|
|
1
|
+
import { type ForwardRefExoticComponent, type RefAttributes, type ComponentProps, type ComponentType, type ReactNode } from "react";
|
|
2
|
+
import type { DecorativeVariant } from "../../../../lib/decorative-variant-classes";
|
|
3
|
+
import { Badge } from "../badge/badge";
|
|
4
|
+
import { HoverCard } from "../hover-card/hover-card";
|
|
5
|
+
declare const InlineCitation: ForwardRefExoticComponent<ComponentProps<"span"> & RefAttributes<HTMLSpanElement>>;
|
|
6
|
+
declare const InlineCitationGroup: ForwardRefExoticComponent<ComponentProps<"div"> & RefAttributes<HTMLDivElement>>;
|
|
7
|
+
declare const InlineCitationText: ForwardRefExoticComponent<ComponentProps<"span"> & RefAttributes<HTMLSpanElement>>;
|
|
7
8
|
type InlineCitationCardProps = ComponentProps<typeof HoverCard>;
|
|
8
9
|
declare const InlineCitationCard: (props: InlineCitationCardProps) => ReactNode;
|
|
9
10
|
type InlineCitationCardTriggerProps = ComponentProps<typeof Badge> & {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
sources: string[];
|
|
12
|
+
icon?: ComponentType<{
|
|
13
|
+
className?: string;
|
|
14
|
+
}>;
|
|
14
15
|
};
|
|
15
16
|
declare const InlineCitationCardTrigger: ({ sources, icon: Icon, className, ...props }: InlineCitationCardTriggerProps) => ReactNode;
|
|
16
|
-
type InlineCitationCardBodyProps = ComponentProps<
|
|
17
|
+
type InlineCitationCardBodyProps = ComponentProps<"div">;
|
|
17
18
|
declare const InlineCitationCardBody: ({ className, ...props }: InlineCitationCardBodyProps) => ReactNode;
|
|
18
|
-
type InlineCitationSourceProps = ComponentProps<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
type InlineCitationSourceProps = ComponentProps<"div"> & {
|
|
20
|
+
title?: string;
|
|
21
|
+
url?: string;
|
|
22
|
+
description?: string;
|
|
22
23
|
};
|
|
23
|
-
declare const InlineCitationSource: ForwardRefExoticComponent<Omit<InlineCitationSourceProps,
|
|
24
|
-
declare const InlineCitationQuote: ForwardRefExoticComponent<ComponentProps<
|
|
25
|
-
export type InlineCitationLinkProps = Omit<ComponentProps<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
declare const InlineCitationSource: ForwardRefExoticComponent<Omit<InlineCitationSourceProps, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
25
|
+
declare const InlineCitationQuote: ForwardRefExoticComponent<ComponentProps<"blockquote"> & RefAttributes<HTMLQuoteElement>>;
|
|
26
|
+
export type InlineCitationLinkProps = Omit<ComponentProps<"a">, "target"> & {
|
|
27
|
+
target?: "_blank" | "_self";
|
|
28
|
+
icon?: ComponentType<{
|
|
29
|
+
className?: string;
|
|
30
|
+
}>;
|
|
31
|
+
variant?: DecorativeVariant;
|
|
31
32
|
};
|
|
32
|
-
declare const InlineCitationLink: ForwardRefExoticComponent<Omit<InlineCitationLinkProps,
|
|
33
|
-
export { InlineCitation, InlineCitationCard, InlineCitationCardBody, InlineCitationCardTrigger, InlineCitationGroup, InlineCitationLink, InlineCitationQuote, InlineCitationSource, InlineCitationText
|
|
33
|
+
declare const InlineCitationLink: ForwardRefExoticComponent<Omit<InlineCitationLinkProps, "ref"> & RefAttributes<HTMLAnchorElement>>;
|
|
34
|
+
export { InlineCitation, InlineCitationCard, InlineCitationCardBody, InlineCitationCardTrigger, InlineCitationGroup, InlineCitationLink, InlineCitationQuote, InlineCitationSource, InlineCitationText };
|