@cognite/aura 0.3.4 → 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 +48 -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 +23 -0
- 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 +70 -0
- 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 +105 -0
- 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 +404 -0
- 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 +51 -0
- 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 -0
- package/dist/components/ui/core/data-grid/index.js +5 -0
- 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 +17 -11
- package/dist/components/ui/core/segmented-control/segmented-control.js +204 -108
- 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 +50 -11
- package/src/components/ui/core/button/button.md +93 -0
|
@@ -1,150 +1,179 @@
|
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
}), d = c("pointer-events-none absolute top-(--active-tab-top) left-(--active-tab-left) z-0 h-(--active-tab-height) w-(--active-tab-width) bg-active-muted-background motion-safe:transition-[top,left,width,height] motion-safe:duration-200 motion-safe:ease-out data-[activation-direction=none]:transition-none", {
|
|
52
|
-
variants: { size: {
|
|
53
|
-
small: "rounded-md",
|
|
54
|
-
default: "rounded-lg"
|
|
55
|
-
} },
|
|
56
|
-
defaultVariants: { size: "small" }
|
|
57
|
-
}), f = c("group relative z-10 inline-flex min-w-0 max-w-full items-center justify-start outline-none transition-[color,box-shadow] duration-200 ease-out shrink-0 font-medium tracking-normal text-sm cursor-pointer focus-visible:border-ring focus-visible:ring-ring-shadow focus-visible:ring data-[disabled]:pointer-events-none data-[disabled]:cursor-default [&_[data-slot=tabs-label]]:min-w-0 [&_[data-slot=tabs-label]]:truncate", {
|
|
58
|
-
variants: {
|
|
59
|
-
size: {
|
|
60
|
-
small: "h-7 px-2 gap-1.5 leading-4.5 rounded-md",
|
|
61
|
-
default: "h-9 px-3 gap-2 leading-4.5 rounded-lg"
|
|
62
|
-
},
|
|
63
|
-
fullWidth: {
|
|
64
|
-
true: "min-w-px justify-center [&_[data-slot=tabs-label]]:flex-none [&_[data-slot=tabs-label]]:text-center",
|
|
65
|
-
false: ""
|
|
66
|
-
},
|
|
67
|
-
stateTone: { default: "text-muted-foreground hover:text-foreground data-active:text-foreground data-active:hover:text-foreground data-[disabled]:text-disabled-foreground" }
|
|
68
|
-
},
|
|
69
|
-
defaultVariants: {
|
|
70
|
-
size: "small",
|
|
71
|
-
fullWidth: !1,
|
|
72
|
-
stateTone: "default"
|
|
73
|
-
}
|
|
74
|
-
}), p = i(({ className: t, ...n }, r) => /* @__PURE__ */ o(l.Root, {
|
|
75
|
-
ref: r,
|
|
76
|
-
"data-slot": "tabs",
|
|
77
|
-
className: e(t),
|
|
78
|
-
...n
|
|
79
|
-
}));
|
|
80
|
-
p.displayName = "Tabs";
|
|
81
|
-
var m = r(void 0), h = i(({ className: t, size: n = "small", ...r }, i) => /* @__PURE__ */ o(l.Indicator, {
|
|
82
|
-
ref: i,
|
|
83
|
-
"data-slot": "tabs-indicator",
|
|
84
|
-
className: e(d({ size: n }), t),
|
|
85
|
-
...r
|
|
86
|
-
}));
|
|
87
|
-
h.displayName = "TabsIndicator";
|
|
88
|
-
var g = i(({ className: t, orientation: n = "horizontal", size: r = "small", fullWidth: i = !1, children: a, ...c }, d) => {
|
|
89
|
-
let f = r ?? "small";
|
|
90
|
-
return /* @__PURE__ */ o(l.List, {
|
|
91
|
-
ref: d,
|
|
92
|
-
"data-slot": "tabs-list",
|
|
93
|
-
"data-size": f,
|
|
94
|
-
"data-orientation": n,
|
|
95
|
-
"data-full-width": i ? "true" : "false",
|
|
96
|
-
className: e("[&[data-orientation=horizontal][data-full-width=true]_[data-slot=tabs-trigger]]:flex-1", "[&[data-orientation=horizontal][data-full-width=true]_[data-slot=tabs-trigger]]:justify-center", "[&[data-orientation=horizontal][data-full-width=true]_[data-slot=tabs-label]]:flex-none", "[&[data-orientation=horizontal][data-full-width=true]_[data-slot=tabs-label]]:text-center", "[&[data-orientation=vertical][data-full-width=true]_[data-slot=tabs-trigger]]:w-full", u({
|
|
97
|
-
orientation: n,
|
|
98
|
-
size: f,
|
|
99
|
-
fullWidth: i
|
|
100
|
-
}), t),
|
|
101
|
-
...c,
|
|
102
|
-
children: /* @__PURE__ */ s(m.Provider, {
|
|
103
|
-
value: f,
|
|
104
|
-
children: [/* @__PURE__ */ o(h, { size: f }), a]
|
|
105
|
-
})
|
|
106
|
-
});
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, forwardRef, useContext } from "react";
|
|
3
|
+
import { Tabs as TabsPrimitive } from "@base-ui/react/tabs";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { cn, focusRing } from "../../../../lib/utils.js";
|
|
6
|
+
import { Badge } from "../badge/badge.js";
|
|
7
|
+
import { resolveTabLabelTitle } from "./tabs.utils.js";
|
|
8
|
+
const tabsListVariants = cva('relative isolate flex', {
|
|
9
|
+
variants: {
|
|
10
|
+
orientation: {
|
|
11
|
+
horizontal: 'flex-row',
|
|
12
|
+
vertical: 'flex-col'
|
|
13
|
+
},
|
|
14
|
+
size: {
|
|
15
|
+
small: '',
|
|
16
|
+
default: ''
|
|
17
|
+
},
|
|
18
|
+
fullWidth: {
|
|
19
|
+
true: 'w-full',
|
|
20
|
+
false: 'w-fit'
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
compoundVariants: [
|
|
24
|
+
{
|
|
25
|
+
orientation: 'horizontal',
|
|
26
|
+
fullWidth: false,
|
|
27
|
+
className: 'items-center gap-4'
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
orientation: 'horizontal',
|
|
31
|
+
fullWidth: true,
|
|
32
|
+
className: 'w-full min-w-0 max-w-full items-center justify-between gap-0 px-3'
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
orientation: 'vertical',
|
|
36
|
+
fullWidth: false,
|
|
37
|
+
className: 'items-start gap-4'
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
orientation: 'vertical',
|
|
41
|
+
fullWidth: true,
|
|
42
|
+
className: 'h-full min-h-0 w-full min-w-0 max-w-full items-start justify-between gap-0 px-3'
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
defaultVariants: {
|
|
46
|
+
orientation: 'horizontal',
|
|
47
|
+
size: 'small',
|
|
48
|
+
fullWidth: false
|
|
49
|
+
}
|
|
107
50
|
});
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
children: [d, c == null ? null : /* @__PURE__ */ o(t, {
|
|
123
|
-
variant: "mountain",
|
|
124
|
-
className: e("h-4 min-w-4 rounded-sm px-0.5 text-xs leading-3.5 tracking-tighter gap-0", u && "bg-disabled-background text-disabled-foreground border-transparent"),
|
|
125
|
-
children: c
|
|
126
|
-
})]
|
|
127
|
-
});
|
|
51
|
+
const tabsTriggerVariants = cva(cn(`group relative z-10 inline-flex min-w-0 max-w-full items-center justify-start bg-transparent transition-[color,box-shadow] duration-200 ease-out shrink-0 font-medium tracking-normal text-sm cursor-pointer ${focusRing}`, "[&>svg]:pointer-events-none [&>svg]:shrink-0 [&>svg:not([class*='size-'])]:size-4 [&>svg:not([class*='text-'])]:text-muted-foreground hover:[&>svg:not([class*='text-'])]:text-muted-foreground-hover data-active:[&>svg:not([class*='text-'])]:text-primary-background data-active:hover:[&>svg:not([class*='text-'])]:text-primary-background data-[disabled]:[&>svg:not([class*='text-'])]:text-base-foreground-disabled [&_[data-slot=badge]]:text-decorative-7-foreground [&_[data-slot=badge]_svg]:text-decorative-7-foreground", 'data-[disabled]:pointer-events-none data-[disabled]:cursor-default [&_[data-slot=tabs-label]]:min-w-0 [&_[data-slot=tabs-label]]:truncate'), {
|
|
52
|
+
variants: {
|
|
53
|
+
size: {
|
|
54
|
+
small: 'h-7 gap-1.5 leading-4.5',
|
|
55
|
+
default: 'h-9 gap-2 leading-4.5'
|
|
56
|
+
},
|
|
57
|
+
stateTone: {
|
|
58
|
+
default: cn('text-muted-foreground hover:text-muted-foreground-hover hover:bg-transparent', 'data-active:text-primary-background data-active:hover:text-primary-background data-active:hover:bg-transparent', 'data-[disabled]:text-base-foreground-disabled')
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
defaultVariants: {
|
|
62
|
+
size: 'small',
|
|
63
|
+
stateTone: 'default'
|
|
64
|
+
}
|
|
128
65
|
});
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
title: c,
|
|
137
|
-
...a,
|
|
138
|
-
children: r
|
|
139
|
-
});
|
|
66
|
+
const Tabs = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>{
|
|
67
|
+
return /*#__PURE__*/ _jsx(TabsPrimitive.Root, {
|
|
68
|
+
ref: ref,
|
|
69
|
+
"data-slot": "tabs",
|
|
70
|
+
className: cn(className),
|
|
71
|
+
...props
|
|
72
|
+
});
|
|
140
73
|
});
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
74
|
+
Tabs.displayName = 'Tabs';
|
|
75
|
+
const TabsSizeContext = /*#__PURE__*/ createContext(undefined);
|
|
76
|
+
const tabsIndicatorMotionClasses = 'pointer-events-none absolute z-[2] bg-primary-background motion-safe:transition-[top,left,width,height] motion-safe:duration-200 motion-safe:ease-out data-[activation-direction=none]:transition-none';
|
|
77
|
+
/** Bottom underline under the active tab. */ const tabsIndicatorHorizontalClasses = 'h-px w-(--active-tab-width) top-[calc(var(--active-tab-top)+var(--active-tab-height)-1px)] left-(--active-tab-left)';
|
|
78
|
+
/** Left tick beside the label — text-height only, never a full-width bar. */ const tabsIndicatorVerticalClasses = 'w-px max-w-px h-4.5 left-(--active-tab-left) top-[calc(var(--active-tab-top)+(var(--active-tab-height)-1.125rem)/2)]';
|
|
79
|
+
const TabsIndicator = /*#__PURE__*/ forwardRef(({ className, orientation = 'horizontal', ...props }, ref)=>{
|
|
80
|
+
return /*#__PURE__*/ _jsx(TabsPrimitive.Indicator, {
|
|
81
|
+
ref: ref,
|
|
82
|
+
"data-slot": "tabs-indicator",
|
|
83
|
+
className: cn(tabsIndicatorMotionClasses, orientation === 'vertical' ? tabsIndicatorVerticalClasses : tabsIndicatorHorizontalClasses, className),
|
|
84
|
+
...props
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
TabsIndicator.displayName = 'TabsIndicator';
|
|
88
|
+
const TabsListSeparator = ({ orientation })=>{
|
|
89
|
+
if (orientation === 'vertical') {
|
|
90
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
91
|
+
"aria-hidden": true,
|
|
92
|
+
"data-slot": "tabs-list-separator",
|
|
93
|
+
className: "pointer-events-none absolute top-0 right-0 z-[1] h-full max-h-full w-px bg-default"
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
97
|
+
"aria-hidden": true,
|
|
98
|
+
"data-slot": "tabs-list-separator",
|
|
99
|
+
className: "pointer-events-none absolute bottom-0 left-0 z-[1] h-px w-full max-w-full bg-default"
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
const TabsList = /*#__PURE__*/ forwardRef(({ className, orientation = 'horizontal', size = 'small', fullWidth = false, showSeparator = false, children, ...props }, ref)=>{
|
|
103
|
+
const resolvedSize = size ?? 'small';
|
|
104
|
+
const resolvedOrientation = orientation ?? 'horizontal';
|
|
105
|
+
return /*#__PURE__*/ _jsxs(TabsPrimitive.List, {
|
|
106
|
+
ref: ref,
|
|
107
|
+
"data-slot": "tabs-list",
|
|
108
|
+
"data-size": resolvedSize,
|
|
109
|
+
"data-orientation": resolvedOrientation,
|
|
110
|
+
"data-full-width": fullWidth ? 'true' : 'false',
|
|
111
|
+
"data-separator": showSeparator ? 'true' : 'false',
|
|
112
|
+
className: cn(showSeparator && 'overflow-x-clip', tabsListVariants({
|
|
113
|
+
orientation: resolvedOrientation,
|
|
114
|
+
size: resolvedSize,
|
|
115
|
+
fullWidth
|
|
116
|
+
}), className),
|
|
117
|
+
...props,
|
|
118
|
+
children: [
|
|
119
|
+
showSeparator ? /*#__PURE__*/ _jsx(TabsListSeparator, {
|
|
120
|
+
orientation: resolvedOrientation
|
|
121
|
+
}) : null,
|
|
122
|
+
/*#__PURE__*/ _jsx(TabsIndicator, {
|
|
123
|
+
orientation: resolvedOrientation
|
|
124
|
+
}),
|
|
125
|
+
/*#__PURE__*/ _jsx(TabsSizeContext.Provider, {
|
|
126
|
+
value: resolvedSize,
|
|
127
|
+
children: children
|
|
128
|
+
})
|
|
129
|
+
]
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
TabsList.displayName = 'TabsList';
|
|
133
|
+
const TabsTrigger = /*#__PURE__*/ forwardRef(({ className, size, badge, disabled = false, children, ...props }, ref)=>{
|
|
134
|
+
const inheritedSize = useContext(TabsSizeContext);
|
|
135
|
+
const resolvedSize = size ?? inheritedSize ?? 'small';
|
|
136
|
+
return /*#__PURE__*/ _jsxs(TabsPrimitive.Tab, {
|
|
137
|
+
ref: ref,
|
|
138
|
+
"data-slot": "tabs-trigger",
|
|
139
|
+
"data-size": resolvedSize,
|
|
140
|
+
disabled: disabled,
|
|
141
|
+
className: cn(tabsTriggerVariants({
|
|
142
|
+
size: resolvedSize
|
|
143
|
+
}), className),
|
|
144
|
+
...props,
|
|
145
|
+
children: [
|
|
146
|
+
children,
|
|
147
|
+
badge == null ? null : /*#__PURE__*/ _jsx(Badge, {
|
|
148
|
+
variant: "decorative-1",
|
|
149
|
+
className: cn('h-4 min-w-4 rounded-sm px-0.5 text-xs leading-3.5 tracking-tighter gap-0', disabled && 'bg-base-background-disabled text-base-foreground-disabled border-transparent'),
|
|
150
|
+
children: badge
|
|
151
|
+
})
|
|
152
|
+
]
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
TabsTrigger.displayName = 'TabsTrigger';
|
|
156
|
+
const TabsLabel = /*#__PURE__*/ forwardRef(({ className, children, title, ...props }, ref)=>{
|
|
157
|
+
const resolvedTitle = resolveTabLabelTitle(title, children);
|
|
158
|
+
return /*#__PURE__*/ _jsx("span", {
|
|
159
|
+
ref: ref,
|
|
160
|
+
"data-slot": "tabs-label",
|
|
161
|
+
className: cn('block min-w-0 truncate text-left', className),
|
|
162
|
+
title: resolvedTitle,
|
|
163
|
+
...props,
|
|
164
|
+
children: children
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
TabsLabel.displayName = 'TabsLabel';
|
|
168
|
+
const TabsPanel = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>{
|
|
169
|
+
return /*#__PURE__*/ _jsx(TabsPrimitive.Panel, {
|
|
170
|
+
ref: ref,
|
|
171
|
+
"data-slot": "tabs-panel",
|
|
172
|
+
className: cn('outline-none', className),
|
|
173
|
+
...props
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
TabsPanel.displayName = 'TabsPanel';
|
|
177
|
+
export { Tabs, TabsLabel, TabsList, TabsPanel, TabsTrigger, tabsListVariants, tabsTriggerVariants };
|
|
178
|
+
|
|
179
|
+
//# sourceMappingURL=tabs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/ui/core/tabs/tabs.tsx"],"sourcesContent":["import {\n type ForwardRefExoticComponent,\n type RefAttributes,\n type ComponentProps,\n type ComponentRef,\n type ReactNode,\n createContext,\n forwardRef,\n useContext,\n} from 'react';\n\nimport type { TabsRootProps } from '@base-ui/react/tabs';\nimport { Tabs as TabsPrimitive } from '@base-ui/react/tabs';\nimport { type VariantProps, cva } from 'class-variance-authority';\nimport type { ClassProp } from 'class-variance-authority/types';\n\nimport { cn, focusRing } from '../../../../lib/utils';\nimport { Badge } from '../badge/badge';\n\nimport { resolveTabLabelTitle } from './tabs.utils';\n\ninterface TabsListVariantProps {\n orientation?: 'horizontal' | 'vertical' | null;\n size?: 'small' | 'default' | null;\n fullWidth?: boolean | null;\n}\n\nconst tabsListVariants: (\n props?: (TabsListVariantProps & ClassProp) | undefined\n) => string = cva('relative isolate flex', {\n variants: {\n orientation: {\n horizontal: 'flex-row',\n vertical: 'flex-col',\n },\n size: {\n small: '',\n default: '',\n },\n fullWidth: {\n true: 'w-full',\n false: 'w-fit',\n },\n },\n compoundVariants: [\n {\n orientation: 'horizontal',\n fullWidth: false,\n className: 'items-center gap-4',\n },\n {\n orientation: 'horizontal',\n fullWidth: true,\n className:\n 'w-full min-w-0 max-w-full items-center justify-between gap-0 px-3',\n },\n {\n orientation: 'vertical',\n fullWidth: false,\n className: 'items-start gap-4',\n },\n {\n orientation: 'vertical',\n fullWidth: true,\n className:\n 'h-full min-h-0 w-full min-w-0 max-w-full items-start justify-between gap-0 px-3',\n },\n ],\n defaultVariants: {\n orientation: 'horizontal',\n size: 'small',\n fullWidth: false,\n },\n});\n\ninterface TabsTriggerVariantProps {\n size?: 'small' | 'default' | null;\n stateTone?: 'default' | null;\n}\n\nconst tabsTriggerVariants: (\n props?: (TabsTriggerVariantProps & ClassProp) | undefined\n) => string = cva(\n cn(\n `group relative z-10 inline-flex min-w-0 max-w-full items-center justify-start bg-transparent transition-[color,box-shadow] duration-200 ease-out shrink-0 font-medium tracking-normal text-sm cursor-pointer ${focusRing}`,\n \"[&>svg]:pointer-events-none [&>svg]:shrink-0 [&>svg:not([class*='size-'])]:size-4 [&>svg:not([class*='text-'])]:text-muted-foreground hover:[&>svg:not([class*='text-'])]:text-muted-foreground-hover data-active:[&>svg:not([class*='text-'])]:text-primary-background data-active:hover:[&>svg:not([class*='text-'])]:text-primary-background data-[disabled]:[&>svg:not([class*='text-'])]:text-base-foreground-disabled [&_[data-slot=badge]]:text-decorative-7-foreground [&_[data-slot=badge]_svg]:text-decorative-7-foreground\",\n 'data-[disabled]:pointer-events-none data-[disabled]:cursor-default [&_[data-slot=tabs-label]]:min-w-0 [&_[data-slot=tabs-label]]:truncate'\n ),\n {\n variants: {\n size: {\n small: 'h-7 gap-1.5 leading-4.5',\n default: 'h-9 gap-2 leading-4.5',\n },\n stateTone: {\n default: cn(\n 'text-muted-foreground hover:text-muted-foreground-hover hover:bg-transparent',\n 'data-active:text-primary-background data-active:hover:text-primary-background data-active:hover:bg-transparent',\n 'data-[disabled]:text-base-foreground-disabled'\n ),\n },\n },\n defaultVariants: {\n size: 'small',\n stateTone: 'default',\n },\n }\n);\n\ntype TabsProps = TabsPrimitive.Root.Props;\n\nconst Tabs: ForwardRefExoticComponent<\n Omit<TabsRootProps, 'ref'> & RefAttributes<HTMLDivElement>\n> = forwardRef<ComponentRef<typeof TabsPrimitive.Root>, TabsProps>(\n ({ className, ...props }, ref) => {\n return (\n <TabsPrimitive.Root\n ref={ref}\n data-slot=\"tabs\"\n className={cn(className)}\n {...props}\n />\n );\n }\n);\nTabs.displayName = 'Tabs';\n\ntype TabsListProps = TabsPrimitive.List.Props &\n VariantProps<typeof tabsListVariants> & {\n showSeparator?: boolean;\n };\n\ntype TabsSize = NonNullable<VariantProps<typeof tabsListVariants>['size']>;\n\ntype TabsOrientation = NonNullable<\n VariantProps<typeof tabsListVariants>['orientation']\n>;\n\nconst TabsSizeContext = createContext<TabsSize | undefined>(undefined);\n\ntype TabsIndicatorProps = TabsPrimitive.Indicator.Props & {\n orientation?: TabsOrientation;\n};\n\nconst tabsIndicatorMotionClasses =\n 'pointer-events-none absolute z-[2] bg-primary-background motion-safe:transition-[top,left,width,height] motion-safe:duration-200 motion-safe:ease-out data-[activation-direction=none]:transition-none';\n\n/** Bottom underline under the active tab. */\nconst tabsIndicatorHorizontalClasses =\n 'h-px w-(--active-tab-width) top-[calc(var(--active-tab-top)+var(--active-tab-height)-1px)] left-(--active-tab-left)';\n\n/** Left tick beside the label — text-height only, never a full-width bar. */\nconst tabsIndicatorVerticalClasses =\n 'w-px max-w-px h-4.5 left-(--active-tab-left) top-[calc(var(--active-tab-top)+(var(--active-tab-height)-1.125rem)/2)]';\n\nconst TabsIndicator = forwardRef<\n ComponentRef<typeof TabsPrimitive.Indicator>,\n TabsIndicatorProps\n>(({ className, orientation = 'horizontal', ...props }, ref) => {\n return (\n <TabsPrimitive.Indicator\n ref={ref}\n data-slot=\"tabs-indicator\"\n className={cn(\n tabsIndicatorMotionClasses,\n orientation === 'vertical'\n ? tabsIndicatorVerticalClasses\n : tabsIndicatorHorizontalClasses,\n className\n )}\n {...props}\n />\n );\n});\nTabsIndicator.displayName = 'TabsIndicator';\n\nconst TabsListSeparator = ({\n orientation,\n}: {\n orientation: TabsOrientation;\n}): ReactNode => {\n if (orientation === 'vertical') {\n return (\n <div\n aria-hidden\n data-slot=\"tabs-list-separator\"\n className=\"pointer-events-none absolute top-0 right-0 z-[1] h-full max-h-full w-px bg-default\"\n />\n );\n }\n\n return (\n <div\n aria-hidden\n data-slot=\"tabs-list-separator\"\n className=\"pointer-events-none absolute bottom-0 left-0 z-[1] h-px w-full max-w-full bg-default\"\n />\n );\n};\n\nconst TabsList: ForwardRefExoticComponent<\n Omit<TabsListProps, 'ref'> & RefAttributes<HTMLDivElement>\n> = forwardRef<ComponentRef<typeof TabsPrimitive.List>, TabsListProps>(\n (\n {\n className,\n orientation = 'horizontal',\n size = 'small',\n fullWidth = false,\n showSeparator = false,\n children,\n ...props\n },\n ref\n ) => {\n const resolvedSize = size ?? 'small';\n const resolvedOrientation = orientation ?? 'horizontal';\n\n return (\n <TabsPrimitive.List\n ref={ref}\n data-slot=\"tabs-list\"\n data-size={resolvedSize}\n data-orientation={resolvedOrientation}\n data-full-width={fullWidth ? 'true' : 'false'}\n data-separator={showSeparator ? 'true' : 'false'}\n className={cn(\n showSeparator && 'overflow-x-clip',\n tabsListVariants({\n orientation: resolvedOrientation,\n size: resolvedSize,\n fullWidth,\n }),\n className\n )}\n {...props}\n >\n {showSeparator ? (\n <TabsListSeparator orientation={resolvedOrientation} />\n ) : null}\n <TabsIndicator orientation={resolvedOrientation} />\n <TabsSizeContext.Provider value={resolvedSize}>\n {children}\n </TabsSizeContext.Provider>\n </TabsPrimitive.List>\n );\n }\n);\nTabsList.displayName = 'TabsList';\n\ntype TabsTriggerProps = TabsPrimitive.Tab.Props &\n VariantProps<typeof tabsTriggerVariants> & {\n badge?: ReactNode;\n };\n\ntype TabsLabelProps = ComponentProps<'span'>;\n\nconst TabsTrigger: ForwardRefExoticComponent<\n Omit<TabsTriggerProps, 'ref'> & RefAttributes<HTMLElement>\n> = forwardRef<ComponentRef<typeof TabsPrimitive.Tab>, TabsTriggerProps>(\n ({ className, size, badge, disabled = false, children, ...props }, ref) => {\n const inheritedSize = useContext(TabsSizeContext);\n const resolvedSize = size ?? inheritedSize ?? 'small';\n\n return (\n <TabsPrimitive.Tab\n ref={ref}\n data-slot=\"tabs-trigger\"\n data-size={resolvedSize}\n disabled={disabled}\n className={cn(tabsTriggerVariants({ size: resolvedSize }), className)}\n {...props}\n >\n {children}\n {badge == null ? null : (\n <Badge\n variant=\"decorative-1\"\n className={cn(\n 'h-4 min-w-4 rounded-sm px-0.5 text-xs leading-3.5 tracking-tighter gap-0',\n disabled &&\n 'bg-base-background-disabled text-base-foreground-disabled border-transparent'\n )}\n >\n {badge}\n </Badge>\n )}\n </TabsPrimitive.Tab>\n );\n }\n);\nTabsTrigger.displayName = 'TabsTrigger';\n\nconst TabsLabel: ForwardRefExoticComponent<\n ComponentProps<'span'> & RefAttributes<HTMLSpanElement>\n> = forwardRef<ComponentRef<'span'>, TabsLabelProps>(\n ({ className, children, title, ...props }, ref) => {\n const resolvedTitle = resolveTabLabelTitle(title, children);\n\n return (\n <span\n ref={ref}\n data-slot=\"tabs-label\"\n className={cn('block min-w-0 truncate text-left', className)}\n title={resolvedTitle}\n {...props}\n >\n {children}\n </span>\n );\n }\n);\nTabsLabel.displayName = 'TabsLabel';\n\ntype TabsPanelProps = TabsPrimitive.Panel.Props;\n\nconst TabsPanel: ForwardRefExoticComponent<\n Omit<TabsPanelProps, 'ref'> & RefAttributes<HTMLDivElement>\n> = forwardRef<ComponentRef<typeof TabsPrimitive.Panel>, TabsPanelProps>(\n ({ className, ...props }, ref) => {\n return (\n <TabsPrimitive.Panel\n ref={ref}\n data-slot=\"tabs-panel\"\n className={cn('outline-none', className)}\n {...props}\n />\n );\n }\n);\nTabsPanel.displayName = 'TabsPanel';\n\nexport {\n Tabs,\n TabsLabel,\n TabsList,\n TabsPanel,\n TabsTrigger,\n tabsListVariants,\n tabsTriggerVariants,\n};\n"],"names":["createContext","forwardRef","useContext","Tabs","TabsPrimitive","cva","cn","focusRing","Badge","resolveTabLabelTitle","tabsListVariants","variants","orientation","horizontal","vertical","size","small","default","fullWidth","true","false","compoundVariants","className","defaultVariants","tabsTriggerVariants","stateTone","props","ref","Root","data-slot","displayName","TabsSizeContext","undefined","tabsIndicatorMotionClasses","tabsIndicatorHorizontalClasses","tabsIndicatorVerticalClasses","TabsIndicator","Indicator","TabsListSeparator","div","aria-hidden","TabsList","showSeparator","children","resolvedSize","resolvedOrientation","List","data-size","data-orientation","data-full-width","data-separator","Provider","value","TabsTrigger","badge","disabled","inheritedSize","Tab","variant","TabsLabel","title","resolvedTitle","span","TabsPanel","Panel"],"mappings":"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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ReactNode } from
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
2
|
export declare function resolveTabLabelTitle(title: string | undefined, children: ReactNode): string | undefined;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
export function resolveTabLabelTitle(title, children) {
|
|
2
|
+
if (title != null) {
|
|
3
|
+
return title;
|
|
4
|
+
}
|
|
5
|
+
if (typeof children === 'string' || typeof children === 'number') {
|
|
6
|
+
return String(children);
|
|
7
|
+
}
|
|
8
|
+
return undefined;
|
|
5
9
|
}
|
|
6
|
-
|
|
7
|
-
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=tabs.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/ui/core/tabs/tabs.utils.ts"],"sourcesContent":["import type { ReactNode } from 'react';\n\nexport function resolveTabLabelTitle(\n title: string | undefined,\n children: ReactNode\n): string | undefined {\n if (title != null) {\n return title;\n }\n\n if (typeof children === 'string' || typeof children === 'number') {\n return String(children);\n }\n\n return undefined;\n}\n"],"names":["resolveTabLabelTitle","title","children","String","undefined"],"mappings":"AAEA,OAAO,SAASA,qBACdC,KAAyB,EACzBC,QAAmB;IAEnB,IAAID,SAAS,MAAM;QACjB,OAAOA;IACT;IAEA,IAAI,OAAOC,aAAa,YAAY,OAAOA,aAAa,UAAU;QAChE,OAAOC,OAAOD;IAChB;IAEA,OAAOE;AACT"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ForwardRefExoticComponent, RefAttributes, ComponentProps } from
|
|
2
|
-
declare const Textarea: ForwardRefExoticComponent<ComponentProps<
|
|
1
|
+
import { type ForwardRefExoticComponent, type RefAttributes, type ComponentProps } from "react";
|
|
2
|
+
declare const Textarea: ForwardRefExoticComponent<ComponentProps<"textarea"> & RefAttributes<HTMLTextAreaElement>>;
|
|
3
3
|
export { Textarea };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { forwardRef
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { cn, disabledState, filledState, focusState, formElementBase, hoverState, invalidState, readOnlyState } from "../../../../lib/utils.js";
|
|
4
|
+
const Textarea = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ _jsx("textarea", {
|
|
5
|
+
ref: ref,
|
|
6
|
+
"data-slot": "textarea",
|
|
7
|
+
className: cn('flex field-sizing-content h-auto min-h-20 w-full transition-[color,background-color,border-color,box-shadow] resize-none', formElementBase, hoverState, filledState, focusState, invalidState, disabledState, readOnlyState, className),
|
|
8
|
+
...props
|
|
9
|
+
}));
|
|
10
|
+
Textarea.displayName = 'Textarea';
|
|
11
|
+
export { Textarea };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=textarea.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/ui/core/textarea/textarea.tsx"],"sourcesContent":["import {\n type ForwardRefExoticComponent,\n type RefAttributes,\n type ComponentProps,\n type ComponentRef,\n forwardRef,\n} from 'react';\n\nimport {\n cn,\n disabledState,\n filledState,\n focusState,\n formElementBase,\n hoverState,\n invalidState,\n readOnlyState,\n} from '../../../../lib/utils';\n\nconst Textarea: ForwardRefExoticComponent<\n ComponentProps<'textarea'> & RefAttributes<HTMLTextAreaElement>\n> = forwardRef<ComponentRef<'textarea'>, ComponentProps<'textarea'>>(\n ({ className, ...props }, ref) => (\n <textarea\n ref={ref}\n data-slot=\"textarea\"\n className={cn(\n 'flex field-sizing-content h-auto min-h-20 w-full transition-[color,background-color,border-color,box-shadow] resize-none',\n formElementBase,\n hoverState,\n filledState,\n focusState,\n invalidState,\n disabledState,\n readOnlyState,\n className\n )}\n {...props}\n />\n )\n);\nTextarea.displayName = 'Textarea';\n\nexport { Textarea };\n"],"names":["forwardRef","cn","disabledState","filledState","focusState","formElementBase","hoverState","invalidState","readOnlyState","Textarea","className","props","ref","textarea","data-slot","displayName"],"mappings":";AAAA,SAKEA,UAAU,QACL,QAAQ;AAEf,SACEC,EAAE,EACFC,aAAa,EACbC,WAAW,EACXC,UAAU,EACVC,eAAe,EACfC,UAAU,EACVC,YAAY,EACZC,aAAa,QACR,2BAAwB;AAE/B,MAAMC,yBAEFT,WACF,CAAC,EAAEU,SAAS,EAAE,GAAGC,OAAO,EAAEC,oBACxB,KAACC;QACCD,KAAKA;QACLE,aAAU;QACVJ,WAAWT,GACT,4HACAI,iBACAC,YACAH,aACAC,YACAG,cACAL,eACAM,eACAE;QAED,GAAGC,KAAK;;AAIfF,SAASM,WAAW,GAAG;AAEvB,SAASN,QAAQ,GAAG"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { ComponentRef, ForwardRefExoticComponent, ReactNode, RefAttributes } from
|
|
2
|
-
import { Toggle as TogglePrimitive } from
|
|
3
|
-
import { ClassProp } from
|
|
1
|
+
import { type ComponentRef, type ForwardRefExoticComponent, type ReactNode, type RefAttributes } from "react";
|
|
2
|
+
import { Toggle as TogglePrimitive } from "@base-ui/react/toggle";
|
|
3
|
+
import type { ClassProp } from "class-variance-authority/types";
|
|
4
4
|
type ToggleVariantProps = {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
variant?: "default" | "outline";
|
|
6
|
+
size?: "default" | "sm" | "lg";
|
|
7
7
|
};
|
|
8
8
|
declare const toggleVariants: (props?: (ToggleVariantProps & ClassProp) | undefined) => string;
|
|
9
9
|
type ToggleProps = TogglePrimitive.Props & ToggleVariantProps & {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
icon?: ReactNode;
|
|
11
|
+
label?: ReactNode;
|
|
12
|
+
count?: number | string;
|
|
13
13
|
};
|
|
14
|
-
declare const Toggle: ForwardRefExoticComponent<Omit<ToggleProps,
|
|
14
|
+
declare const Toggle: ForwardRefExoticComponent<Omit<ToggleProps, "ref"> & RefAttributes<ComponentRef<typeof TogglePrimitive>>>;
|
|
15
15
|
export { Toggle, toggleVariants };
|
|
@@ -1,55 +1,61 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { forwardRef
|
|
3
|
-
import {
|
|
4
|
-
import { cva
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
}), c = (t, n) => {
|
|
24
|
-
if (t == null || t === "") return null;
|
|
25
|
-
let i = String(t);
|
|
26
|
-
return /* @__PURE__ */ r("span", {
|
|
27
|
-
"data-slot": "toggle-count",
|
|
28
|
-
className: e("inline-flex h-4 min-w-4 items-center justify-center rounded-sm px-0.5 text-xs font-medium leading-3.5 tracking-tightest", n ? "bg-disabled-background text-disabled-foreground" : "bg-decorative-background-mountain text-decorative-foreground-mountain"),
|
|
29
|
-
children: i
|
|
30
|
-
});
|
|
31
|
-
}, l = t(({ className: t, variant: a, size: l, icon: u, label: d, count: f, children: p, disabled: m, ...h }, g) => {
|
|
32
|
-
let _ = u !== void 0 || d !== void 0 || f !== void 0;
|
|
33
|
-
return /* @__PURE__ */ r(o, {
|
|
34
|
-
ref: g,
|
|
35
|
-
"data-slot": "toggle",
|
|
36
|
-
disabled: m,
|
|
37
|
-
className: e(s({
|
|
38
|
-
variant: a,
|
|
39
|
-
size: l,
|
|
40
|
-
className: t
|
|
41
|
-
})),
|
|
42
|
-
...h,
|
|
43
|
-
children: p ?? (_ && /* @__PURE__ */ i(n, { children: [
|
|
44
|
-
u,
|
|
45
|
-
d && /* @__PURE__ */ r("span", {
|
|
46
|
-
"data-slot": "toggle-label",
|
|
47
|
-
children: d
|
|
48
|
-
}),
|
|
49
|
-
c(f, m)
|
|
50
|
-
] }))
|
|
51
|
-
});
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { Toggle as TogglePrimitive } from "@base-ui/react/toggle";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { cn } from "../../../../lib/utils.js";
|
|
6
|
+
const toggleVariants = cva("group inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium text-medium-foreground hover:bg-base-background-hover disabled:pointer-events-none disabled:text-base-foreground-disabled disabled:[&_svg:not([class*='text-'])]:text-base-foreground-disabled aria-pressed:border aria-pressed:border-emphasized aria-pressed:bg-secondary-background aria-pressed:text-secondary-foreground aria-pressed:[&_svg:not([class*='text-'])]:text-secondary-foreground disabled:aria-pressed:border disabled:aria-pressed:border-default disabled:aria-pressed:bg-base-background-disabled disabled:aria-pressed:text-base-foreground-disabled disabled:aria-pressed:[&_svg:not([class*='text-'])]:text-base-foreground-disabled [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring-muted focus-visible:ring outline-none transition-[color,box-shadow] aria-invalid:ring-destructive-background/20 dark:aria-invalid:ring-destructive-background/40 aria-invalid:border-destructive-background whitespace-nowrap", {
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
default: 'bg-transparent',
|
|
10
|
+
outline: 'border border-emphasized bg-transparent shadow-xs hover:bg-base-background-hover hover:text-base-foreground'
|
|
11
|
+
},
|
|
12
|
+
size: {
|
|
13
|
+
default: 'h-9 px-2 min-w-9',
|
|
14
|
+
sm: 'h-7 px-1.5 min-w-7',
|
|
15
|
+
lg: 'h-8 px-2.5 min-w-8'
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
variant: 'default',
|
|
20
|
+
size: 'default'
|
|
21
|
+
}
|
|
52
22
|
});
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
23
|
+
const renderCountBadge = (count, disabled)=>{
|
|
24
|
+
if (count === undefined || count === null || count === '') {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
const countValue = String(count);
|
|
28
|
+
return /*#__PURE__*/ _jsx("span", {
|
|
29
|
+
"data-slot": "toggle-count",
|
|
30
|
+
className: cn('inline-flex h-4 min-w-4 items-center justify-center rounded-sm px-0.5 text-xs font-medium leading-3.5 tracking-tightest', disabled ? 'bg-base-background-disabled text-base-foreground-disabled' : 'bg-medium-background text-medium-foreground'),
|
|
31
|
+
children: countValue
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
const Toggle = /*#__PURE__*/ forwardRef(({ className, variant, size, icon, label, count, children, disabled, ...props }, ref)=>{
|
|
35
|
+
const hasComposedContent = icon !== undefined || label !== undefined || count !== undefined;
|
|
36
|
+
return /*#__PURE__*/ _jsx(TogglePrimitive, {
|
|
37
|
+
ref: ref,
|
|
38
|
+
"data-slot": "toggle",
|
|
39
|
+
disabled: disabled,
|
|
40
|
+
className: cn(toggleVariants({
|
|
41
|
+
variant,
|
|
42
|
+
size,
|
|
43
|
+
className
|
|
44
|
+
})),
|
|
45
|
+
...props,
|
|
46
|
+
children: children ?? (hasComposedContent && /*#__PURE__*/ _jsxs(_Fragment, {
|
|
47
|
+
children: [
|
|
48
|
+
icon,
|
|
49
|
+
label && /*#__PURE__*/ _jsx("span", {
|
|
50
|
+
"data-slot": "toggle-label",
|
|
51
|
+
children: label
|
|
52
|
+
}),
|
|
53
|
+
renderCountBadge(count, disabled)
|
|
54
|
+
]
|
|
55
|
+
}))
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
Toggle.displayName = 'Toggle';
|
|
59
|
+
export { Toggle, toggleVariants };
|
|
60
|
+
|
|
61
|
+
//# sourceMappingURL=toggle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/ui/core/toggle/toggle.tsx"],"sourcesContent":["import {\n type ComponentRef,\n type ForwardRefExoticComponent,\n type ReactNode,\n type RefAttributes,\n forwardRef,\n} from 'react';\n\nimport { Toggle as TogglePrimitive } from '@base-ui/react/toggle';\nimport { cva } from 'class-variance-authority';\nimport type { ClassProp } from 'class-variance-authority/types';\n\nimport { cn } from '../../../../lib/utils';\n\ntype ToggleVariantProps = {\n variant?: 'default' | 'outline';\n size?: 'default' | 'sm' | 'lg';\n};\n\nconst toggleVariants: (\n props?: (ToggleVariantProps & ClassProp) | undefined\n) => string = cva(\n \"group inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium text-medium-foreground hover:bg-base-background-hover disabled:pointer-events-none disabled:text-base-foreground-disabled disabled:[&_svg:not([class*='text-'])]:text-base-foreground-disabled aria-pressed:border aria-pressed:border-emphasized aria-pressed:bg-secondary-background aria-pressed:text-secondary-foreground aria-pressed:[&_svg:not([class*='text-'])]:text-secondary-foreground disabled:aria-pressed:border disabled:aria-pressed:border-default disabled:aria-pressed:bg-base-background-disabled disabled:aria-pressed:text-base-foreground-disabled disabled:aria-pressed:[&_svg:not([class*='text-'])]:text-base-foreground-disabled [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring-muted focus-visible:ring outline-none transition-[color,box-shadow] aria-invalid:ring-destructive-background/20 dark:aria-invalid:ring-destructive-background/40 aria-invalid:border-destructive-background whitespace-nowrap\",\n {\n variants: {\n variant: {\n default: 'bg-transparent',\n outline:\n 'border border-emphasized bg-transparent shadow-xs hover:bg-base-background-hover hover:text-base-foreground',\n },\n size: {\n default: 'h-9 px-2 min-w-9',\n sm: 'h-7 px-1.5 min-w-7',\n lg: 'h-8 px-2.5 min-w-8',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n }\n);\n\ntype ToggleProps = TogglePrimitive.Props &\n ToggleVariantProps & {\n icon?: ReactNode;\n label?: ReactNode;\n count?: number | string;\n };\n\nconst renderCountBadge = (\n count: ToggleProps['count'],\n disabled: boolean | undefined\n): ReactNode => {\n if (count === undefined || count === null || count === '') {\n return null;\n }\n\n const countValue = String(count);\n\n return (\n <span\n data-slot=\"toggle-count\"\n className={cn(\n 'inline-flex h-4 min-w-4 items-center justify-center rounded-sm px-0.5 text-xs font-medium leading-3.5 tracking-tightest',\n disabled\n ? 'bg-base-background-disabled text-base-foreground-disabled'\n : 'bg-medium-background text-medium-foreground'\n )}\n >\n {countValue}\n </span>\n );\n};\n\nconst Toggle: ForwardRefExoticComponent<\n Omit<ToggleProps, 'ref'> & RefAttributes<ComponentRef<typeof TogglePrimitive>>\n> = forwardRef<ComponentRef<typeof TogglePrimitive>, ToggleProps>(\n (\n {\n className,\n variant,\n size,\n icon,\n label,\n count,\n children,\n disabled,\n ...props\n },\n ref\n ) => {\n const hasComposedContent =\n icon !== undefined || label !== undefined || count !== undefined;\n\n return (\n <TogglePrimitive\n ref={ref}\n data-slot=\"toggle\"\n disabled={disabled}\n className={cn(toggleVariants({ variant, size, className }))}\n {...props}\n >\n {children ??\n (hasComposedContent && (\n <>\n {icon}\n {label && <span data-slot=\"toggle-label\">{label}</span>}\n {renderCountBadge(count, disabled)}\n </>\n ))}\n </TogglePrimitive>\n );\n }\n);\n\nToggle.displayName = 'Toggle';\n\nexport { Toggle, toggleVariants };\n"],"names":["forwardRef","Toggle","TogglePrimitive","cva","cn","toggleVariants","variants","variant","default","outline","size","sm","lg","defaultVariants","renderCountBadge","count","disabled","undefined","countValue","String","span","data-slot","className","icon","label","children","props","ref","hasComposedContent","displayName"],"mappings":";AAAA,SAKEA,UAAU,QACL,QAAQ;AAEf,SAASC,UAAUC,eAAe,QAAQ,wBAAwB;AAClE,SAASC,GAAG,QAAQ,2BAA2B;AAG/C,SAASC,EAAE,QAAQ,2BAAwB;AAO3C,MAAMC,iBAEQF,IACZ,qjCACA;IACEG,UAAU;QACRC,SAAS;YACPC,SAAS;YACTC,SACE;QACJ;QACAC,MAAM;YACJF,SAAS;YACTG,IAAI;YACJC,IAAI;QACN;IACF;IACAC,iBAAiB;QACfN,SAAS;QACTG,MAAM;IACR;AACF;AAUF,MAAMI,mBAAmB,CACvBC,OACAC;IAEA,IAAID,UAAUE,aAAaF,UAAU,QAAQA,UAAU,IAAI;QACzD,OAAO;IACT;IAEA,MAAMG,aAAaC,OAAOJ;IAE1B,qBACE,KAACK;QACCC,aAAU;QACVC,WAAWlB,GACT,2HACAY,WACI,8DACA;kBAGLE;;AAGP;AAEA,MAAMjB,uBAEFD,WACF,CACE,EACEsB,SAAS,EACTf,OAAO,EACPG,IAAI,EACJa,IAAI,EACJC,KAAK,EACLT,KAAK,EACLU,QAAQ,EACRT,QAAQ,EACR,GAAGU,OACJ,EACDC;IAEA,MAAMC,qBACJL,SAASN,aAAaO,UAAUP,aAAaF,UAAUE;IAEzD,qBACE,KAACf;QACCyB,KAAKA;QACLN,aAAU;QACVL,UAAUA;QACVM,WAAWlB,GAAGC,eAAe;YAAEE;YAASG;YAAMY;QAAU;QACvD,GAAGI,KAAK;kBAERD,YACEG,CAAAA,oCACC;;gBACGL;gBACAC,uBAAS,KAACJ;oBAAKC,aAAU;8BAAgBG;;gBACzCV,iBAAiBC,OAAOC;;UAE7B;;AAGR;AAGFf,OAAO4B,WAAW,GAAG;AAErB,SAAS5B,MAAM,EAAEI,cAAc,GAAG"}
|