@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,69 +1,71 @@
|
|
|
1
|
-
import { ComponentProps, CSSProperties, ReactNode } from
|
|
2
|
-
import { ResponsiveContainer, Tooltip, Legend } from
|
|
3
|
-
export type ChartConfig = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { type ComponentProps, type CSSProperties, type ReactNode } from "react";
|
|
2
|
+
import { ResponsiveContainer, Tooltip, Legend } from "recharts";
|
|
3
|
+
export type ChartConfig = { [k in string]: {
|
|
4
|
+
label?: ReactNode;
|
|
5
|
+
icon?: ReactNode;
|
|
6
|
+
/** A CSS color or `var(--token)`. Use a token for light/dark theming. */
|
|
7
|
+
color?: string;
|
|
8
|
+
} };
|
|
9
|
+
/** Default saturated step for numbered chart series (chart-N-450). */
|
|
10
|
+
export declare const CHART_SERIES_COLOR_TOKENS: readonly ["var(--color-chart-1-450)", "var(--color-chart-2-450)", "var(--color-chart-3-450)", "var(--color-chart-4-450)", "var(--color-chart-5-450)"];
|
|
11
|
+
/** 1-based series index; wraps via modulo when more series than tokens. */
|
|
12
|
+
export declare function chartSeriesColor(series: number): string;
|
|
11
13
|
declare function colorVarsFromConfig(config: ChartConfig): CSSProperties;
|
|
12
14
|
type ChartA11yProps = {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
"aria-label": string;
|
|
16
|
+
"aria-labelledby"?: never;
|
|
15
17
|
} | {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
"aria-labelledby": string;
|
|
19
|
+
"aria-label"?: never;
|
|
18
20
|
};
|
|
19
|
-
type ChartContainerProps = Omit<ComponentProps<
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
type ChartContainerProps = Omit<ComponentProps<"div">, "aria-label" | "aria-labelledby"> & ChartA11yProps & {
|
|
22
|
+
config: ChartConfig;
|
|
23
|
+
children: ComponentProps<typeof ResponsiveContainer>["children"];
|
|
22
24
|
};
|
|
23
25
|
declare function ChartContainer({ id, className, children, config, style, role, ...props }: ChartContainerProps): ReactNode;
|
|
24
26
|
declare const ChartTooltip: typeof Tooltip;
|
|
25
27
|
type TooltipPayloadItem = {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
type?: string;
|
|
29
|
+
name?: string | number;
|
|
30
|
+
dataKey?: string | number;
|
|
31
|
+
value?: string | number;
|
|
32
|
+
color?: string;
|
|
33
|
+
payload?: Record<string, unknown>;
|
|
34
|
+
fill?: string;
|
|
35
|
+
[key: string]: unknown;
|
|
34
36
|
};
|
|
35
|
-
type ChartTooltipContentProps = Omit<ComponentProps<typeof Tooltip>,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
37
|
+
type ChartTooltipContentProps = Omit<ComponentProps<typeof Tooltip>, "content" | "formatter" | "labelFormatter"> & {
|
|
38
|
+
className?: string;
|
|
39
|
+
labelClassName?: string;
|
|
40
|
+
hideLabel?: boolean;
|
|
41
|
+
hideIndicator?: boolean;
|
|
42
|
+
indicator?: "line" | "dot" | "dashed";
|
|
43
|
+
nameKey?: string;
|
|
44
|
+
labelKey?: string;
|
|
45
|
+
payload?: TooltipPayloadItem[];
|
|
46
|
+
label?: string | number;
|
|
47
|
+
color?: string;
|
|
48
|
+
formatter?: (value: string | number, name: string | number, item: TooltipPayloadItem, index: number, payload: Record<string, unknown> | undefined) => ReactNode;
|
|
49
|
+
labelFormatter?: (value: ReactNode, payload: TooltipPayloadItem[]) => ReactNode;
|
|
50
|
+
/** Pass an i18n-aware formatter from your app's locale; defaults to the environment locale. */
|
|
51
|
+
valueFormatter?: (value: string | number) => string;
|
|
50
52
|
};
|
|
51
|
-
declare function ChartTooltipContent({ active, payload, className, indicator, hideLabel, hideIndicator, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, valueFormatter
|
|
53
|
+
declare function ChartTooltipContent({ active, payload, className, indicator, hideLabel, hideIndicator, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, valueFormatter }: ChartTooltipContentProps): ReactNode;
|
|
52
54
|
declare const ChartLegend: typeof Legend;
|
|
53
55
|
type LegendPayloadItem = {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
type?: string;
|
|
57
|
+
value?: string;
|
|
58
|
+
dataKey?: string | number;
|
|
59
|
+
color?: string;
|
|
60
|
+
[key: string]: unknown;
|
|
59
61
|
};
|
|
60
62
|
type ChartLegendContentProps = {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
className?: string;
|
|
64
|
+
hideIcon?: boolean;
|
|
65
|
+
nameKey?: string;
|
|
66
|
+
payload?: LegendPayloadItem[];
|
|
67
|
+
verticalAlign?: "top" | "bottom" | "middle";
|
|
66
68
|
};
|
|
67
|
-
declare function ChartLegendContent({ className, hideIcon, payload, verticalAlign, nameKey
|
|
69
|
+
declare function ChartLegendContent({ className, hideIcon, payload, verticalAlign, nameKey }: ChartLegendContentProps): ReactNode;
|
|
68
70
|
declare function getPayloadConfigFromPayload(config: ChartConfig, payload: unknown, key: string): ChartConfig[string] | undefined;
|
|
69
|
-
export { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent, colorVarsFromConfig, getPayloadConfigFromPayload
|
|
71
|
+
export { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent, colorVarsFromConfig, getPayloadConfigFromPayload };
|
|
@@ -1,125 +1,205 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createContext
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext, useMemo } from "react";
|
|
3
|
+
import { ResponsiveContainer, Tooltip, Legend } from "recharts";
|
|
4
|
+
import { cn } from "../../../../lib/utils.js";
|
|
5
|
+
function swatchStylesFromGraphColor(color) {
|
|
6
|
+
if (!color) {
|
|
7
|
+
return undefined;
|
|
8
|
+
}
|
|
9
|
+
const c = color.trim();
|
|
10
|
+
return {
|
|
11
|
+
backgroundColor: c,
|
|
12
|
+
borderColor: c
|
|
13
|
+
};
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
/** Default saturated step for numbered chart series (chart-N-450). */ export const CHART_SERIES_COLOR_TOKENS = [
|
|
16
|
+
'var(--color-chart-1-450)',
|
|
17
|
+
'var(--color-chart-2-450)',
|
|
18
|
+
'var(--color-chart-3-450)',
|
|
19
|
+
'var(--color-chart-4-450)',
|
|
20
|
+
'var(--color-chart-5-450)'
|
|
21
|
+
];
|
|
22
|
+
/** 1-based series index; wraps via modulo when more series than tokens. */ export function chartSeriesColor(series) {
|
|
23
|
+
const count = CHART_SERIES_COLOR_TOKENS.length;
|
|
24
|
+
const zeroBased = ((series - 1) % count + count) % count;
|
|
25
|
+
return CHART_SERIES_COLOR_TOKENS[zeroBased];
|
|
19
26
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
27
|
+
const ChartContext = /*#__PURE__*/ createContext(null);
|
|
28
|
+
function useChart() {
|
|
29
|
+
const context = useContext(ChartContext);
|
|
30
|
+
if (!context) {
|
|
31
|
+
throw new Error('useChart must be used within a <ChartContainer>');
|
|
32
|
+
}
|
|
33
|
+
return context;
|
|
24
34
|
}
|
|
25
|
-
function
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
className: e("[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-chart-gridlines [&_.recharts-curve.recharts-tooltip-cursor]:stroke-chart-gridlines [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-chart-gridlines [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-chart-gridlines flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden", n),
|
|
34
|
-
style: {
|
|
35
|
-
...m,
|
|
36
|
-
...s
|
|
37
|
-
},
|
|
38
|
-
...u,
|
|
39
|
-
children: /* @__PURE__ */ a(c, { children: i })
|
|
40
|
-
})
|
|
41
|
-
});
|
|
35
|
+
function colorVarsFromConfig(config) {
|
|
36
|
+
const vars = {};
|
|
37
|
+
for (const [key, item] of Object.entries(config)){
|
|
38
|
+
if (item.color) {
|
|
39
|
+
vars[`--color-${key}`] = item.color;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return vars;
|
|
42
43
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
"w-1": s === "line",
|
|
68
|
-
"w-0 border border-dashed bg-transparent": s === "dashed",
|
|
69
|
-
"my-0.5": D && s === "dashed"
|
|
70
|
-
}),
|
|
71
|
-
style: p
|
|
72
|
-
}), /* @__PURE__ */ o("div", {
|
|
73
|
-
className: e("flex flex-1 justify-between gap-4 leading-none", D ? "items-end" : "items-center"),
|
|
74
|
-
children: [/* @__PURE__ */ o("div", {
|
|
75
|
-
className: "grid gap-1",
|
|
76
|
-
children: [D ? T : null, /* @__PURE__ */ a("span", {
|
|
77
|
-
className: "text-muted-foreground",
|
|
78
|
-
children: c?.label ?? t.name
|
|
79
|
-
})]
|
|
80
|
-
}), t.value !== void 0 && t.value !== null && /* @__PURE__ */ a("span", {
|
|
81
|
-
className: "text-foreground tabular-nums",
|
|
82
|
-
children: x(t.value)
|
|
83
|
-
})]
|
|
84
|
-
})] })
|
|
85
|
-
}, t.dataKey ?? n);
|
|
86
|
-
})
|
|
87
|
-
})] })
|
|
88
|
-
});
|
|
44
|
+
function ChartContainer({ id, className, children, config, style, role = 'img', ...props }) {
|
|
45
|
+
const contextValue = useMemo(()=>({
|
|
46
|
+
config
|
|
47
|
+
}), [
|
|
48
|
+
config
|
|
49
|
+
]);
|
|
50
|
+
const cssVars = colorVarsFromConfig(config);
|
|
51
|
+
return /*#__PURE__*/ _jsx(ChartContext.Provider, {
|
|
52
|
+
value: contextValue,
|
|
53
|
+
children: /*#__PURE__*/ _jsx("div", {
|
|
54
|
+
role: role,
|
|
55
|
+
"data-slot": "chart",
|
|
56
|
+
"data-chart-id": id,
|
|
57
|
+
className: cn("[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-chart-gridlines [&_.recharts-curve.recharts-tooltip-cursor]:stroke-chart-gridlines [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-chart-gridlines [&_.recharts-radial-bar-background-sector]:fill-medium-background [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-medium-background [&_.recharts-reference-line_[stroke='#ccc']]:stroke-chart-gridlines flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden", className),
|
|
58
|
+
style: {
|
|
59
|
+
...cssVars,
|
|
60
|
+
...style
|
|
61
|
+
},
|
|
62
|
+
...props,
|
|
63
|
+
children: /*#__PURE__*/ _jsx(ResponsiveContainer, {
|
|
64
|
+
children: children
|
|
65
|
+
})
|
|
66
|
+
})
|
|
67
|
+
});
|
|
89
68
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
69
|
+
const ChartTooltip = Tooltip;
|
|
70
|
+
const EMPTY_TOOLTIP_PAYLOAD = [];
|
|
71
|
+
const defaultValueFormatter = (value)=>typeof value === 'number' ? value.toLocaleString() : String(value);
|
|
72
|
+
function ChartTooltipContent({ active, payload = EMPTY_TOOLTIP_PAYLOAD, className, indicator = 'dot', hideLabel = false, hideIndicator = false, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, valueFormatter = defaultValueFormatter }) {
|
|
73
|
+
const { config } = useChart();
|
|
74
|
+
const tooltipLabel = (()=>{
|
|
75
|
+
if (hideLabel || !payload?.length) {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
const [item] = payload;
|
|
79
|
+
const key = `${labelKey ?? item?.dataKey ?? item?.name ?? 'value'}`;
|
|
80
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
81
|
+
const value = !labelKey && typeof label === 'string' ? config[label]?.label ?? label : itemConfig?.label;
|
|
82
|
+
if (labelFormatter) {
|
|
83
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
84
|
+
className: cn('font-medium', labelClassName),
|
|
85
|
+
children: labelFormatter(value, payload)
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
if (!value) {
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
92
|
+
className: cn('font-medium', labelClassName),
|
|
93
|
+
children: value
|
|
94
|
+
});
|
|
95
|
+
})();
|
|
96
|
+
const isHidden = !active || !payload.length;
|
|
97
|
+
const nestLabel = payload.length === 1 && indicator !== 'dot';
|
|
98
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
99
|
+
className: cn('bg-popover-background grid min-w-32 items-start gap-1 rounded-md p-2 text-sm shadow-md', isHidden && 'invisible', className),
|
|
100
|
+
children: isHidden ? null : /*#__PURE__*/ _jsxs(_Fragment, {
|
|
101
|
+
children: [
|
|
102
|
+
!nestLabel ? tooltipLabel : null,
|
|
103
|
+
/*#__PURE__*/ _jsx("div", {
|
|
104
|
+
className: "grid gap-1.5",
|
|
105
|
+
children: payload.filter((item)=>item.type !== 'none').map((item, index)=>{
|
|
106
|
+
const key = `${nameKey ?? item.name ?? item.dataKey ?? 'value'}`;
|
|
107
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
108
|
+
const payloadFill = isRecord(item.payload) && typeof item.payload.fill === 'string' ? item.payload.fill : undefined;
|
|
109
|
+
const indicatorColor = color ?? payloadFill ?? item.color;
|
|
110
|
+
const indicatorSwatchStyle = swatchStylesFromGraphColor(typeof indicatorColor === 'string' ? indicatorColor : undefined);
|
|
111
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
112
|
+
className: cn('[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5', indicator === 'dot' && 'items-center'),
|
|
113
|
+
children: formatter && item.value != null && item.name != null ? formatter(item.value, item.name, item, index, isRecord(item.payload) ? item.payload : undefined) : /*#__PURE__*/ _jsxs(_Fragment, {
|
|
114
|
+
children: [
|
|
115
|
+
itemConfig?.icon ? itemConfig.icon : !hideIndicator && /*#__PURE__*/ _jsx("div", {
|
|
116
|
+
className: cn('shrink-0 rounded-xs', {
|
|
117
|
+
'h-2 w-2': indicator === 'dot',
|
|
118
|
+
'w-1': indicator === 'line',
|
|
119
|
+
'w-0 border border-dashed bg-transparent': indicator === 'dashed',
|
|
120
|
+
'my-0.5': nestLabel && indicator === 'dashed'
|
|
121
|
+
}),
|
|
122
|
+
style: indicatorSwatchStyle
|
|
123
|
+
}),
|
|
124
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
125
|
+
className: cn('flex flex-1 justify-between gap-4 leading-none', nestLabel ? 'items-end' : 'items-center'),
|
|
126
|
+
children: [
|
|
127
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
128
|
+
className: "grid gap-1",
|
|
129
|
+
children: [
|
|
130
|
+
nestLabel ? tooltipLabel : null,
|
|
131
|
+
/*#__PURE__*/ _jsx("span", {
|
|
132
|
+
className: "text-muted-foreground",
|
|
133
|
+
children: itemConfig?.label ?? item.name
|
|
134
|
+
})
|
|
135
|
+
]
|
|
136
|
+
}),
|
|
137
|
+
item.value !== undefined && item.value !== null && /*#__PURE__*/ _jsx("span", {
|
|
138
|
+
className: "text-base-foreground tabular-nums",
|
|
139
|
+
children: valueFormatter(item.value)
|
|
140
|
+
})
|
|
141
|
+
]
|
|
142
|
+
})
|
|
143
|
+
]
|
|
144
|
+
})
|
|
145
|
+
}, item.dataKey ?? index);
|
|
146
|
+
})
|
|
147
|
+
})
|
|
148
|
+
]
|
|
149
|
+
})
|
|
150
|
+
});
|
|
106
151
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
152
|
+
const ChartLegend = Legend;
|
|
153
|
+
const EMPTY_LEGEND_PAYLOAD = [];
|
|
154
|
+
function ChartLegendContent({ className, hideIcon = false, payload = EMPTY_LEGEND_PAYLOAD, verticalAlign = 'bottom', nameKey }) {
|
|
155
|
+
const { config } = useChart();
|
|
156
|
+
if (!payload?.length) {
|
|
157
|
+
return null;
|
|
158
|
+
}
|
|
159
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
160
|
+
className: cn('flex items-center justify-center gap-4', verticalAlign === 'top' ? 'pb-3' : 'pt-3', className),
|
|
161
|
+
children: payload.filter((item)=>item.type !== 'none').map((item, index)=>{
|
|
162
|
+
const key = `${nameKey ?? item.dataKey ?? 'value'}`;
|
|
163
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
164
|
+
const legendSwatchStyle = swatchStylesFromGraphColor(typeof item.color === 'string' ? item.color : undefined);
|
|
165
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
166
|
+
className: cn('[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3'),
|
|
167
|
+
children: [
|
|
168
|
+
itemConfig?.icon && !hideIcon ? itemConfig.icon : /*#__PURE__*/ _jsx("div", {
|
|
169
|
+
className: "h-2 w-2 shrink-0 rounded-xs",
|
|
170
|
+
style: legendSwatchStyle
|
|
171
|
+
}),
|
|
172
|
+
itemConfig?.label ?? item.value
|
|
173
|
+
]
|
|
174
|
+
}, item.value ?? index);
|
|
175
|
+
})
|
|
176
|
+
});
|
|
116
177
|
}
|
|
117
|
-
function
|
|
118
|
-
|
|
178
|
+
function getPayloadConfigFromPayload(config, payload, key) {
|
|
179
|
+
if (!isRecord(payload)) {
|
|
180
|
+
return undefined;
|
|
181
|
+
}
|
|
182
|
+
const payloadRecord = payload;
|
|
183
|
+
const payloadPayload = isRecord(payloadRecord.payload) ? payloadRecord.payload : undefined;
|
|
184
|
+
let configLabelKey = key;
|
|
185
|
+
const directValue = getStringValue(payloadRecord, key);
|
|
186
|
+
if (directValue) {
|
|
187
|
+
configLabelKey = directValue;
|
|
188
|
+
} else {
|
|
189
|
+
const nestedValue = payloadPayload ? getStringValue(payloadPayload, key) : undefined;
|
|
190
|
+
if (nestedValue) {
|
|
191
|
+
configLabelKey = nestedValue;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
return config[configLabelKey] ?? config[key];
|
|
119
195
|
}
|
|
120
|
-
function
|
|
121
|
-
|
|
122
|
-
return typeof n == "string" ? n : void 0;
|
|
196
|
+
function isRecord(value) {
|
|
197
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
123
198
|
}
|
|
124
|
-
|
|
125
|
-
|
|
199
|
+
function getStringValue(value, key) {
|
|
200
|
+
const nestedValue = value[key];
|
|
201
|
+
return typeof nestedValue === 'string' ? nestedValue : undefined;
|
|
202
|
+
}
|
|
203
|
+
export { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent, colorVarsFromConfig, getPayloadConfigFromPayload };
|
|
204
|
+
|
|
205
|
+
//# sourceMappingURL=chart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/ui/core/chart/chart.tsx"],"sourcesContent":["import {\n type ComponentProps,\n type CSSProperties,\n type ReactNode,\n createContext,\n useContext,\n useMemo,\n} from 'react';\n\nimport { ResponsiveContainer, Tooltip, Legend } from 'recharts';\n\nimport { cn } from '../../../../lib/utils';\n\nfunction swatchStylesFromGraphColor(\n color: string | undefined\n): CSSProperties | undefined {\n if (!color) {\n return undefined;\n }\n const c = color.trim();\n return { backgroundColor: c, borderColor: c };\n}\n\nexport type ChartConfig = {\n [k in string]: {\n label?: ReactNode;\n icon?: ReactNode;\n /** A CSS color or `var(--token)`. Use a token for light/dark theming. */\n color?: string;\n };\n};\n\n/** Default saturated step for numbered chart series (chart-N-450). */\nexport const CHART_SERIES_COLOR_TOKENS = [\n 'var(--color-chart-1-450)',\n 'var(--color-chart-2-450)',\n 'var(--color-chart-3-450)',\n 'var(--color-chart-4-450)',\n 'var(--color-chart-5-450)',\n] as const;\n\n/** 1-based series index; wraps via modulo when more series than tokens. */\nexport function chartSeriesColor(series: number): string {\n const count = CHART_SERIES_COLOR_TOKENS.length;\n const zeroBased = (((series - 1) % count) + count) % count;\n return CHART_SERIES_COLOR_TOKENS[zeroBased] as string;\n}\n\ntype ChartContextProps = {\n config: ChartConfig;\n};\n\nconst ChartContext = createContext<ChartContextProps | null>(null);\n\nfunction useChart() {\n const context = useContext(ChartContext);\n\n if (!context) {\n throw new Error('useChart must be used within a <ChartContainer>');\n }\n\n return context;\n}\n\nfunction colorVarsFromConfig(config: ChartConfig): CSSProperties {\n const vars: CSSProperties & Record<string, string> = {};\n for (const [key, item] of Object.entries(config)) {\n if (item.color) {\n vars[`--color-${key}`] = item.color;\n }\n }\n return vars;\n}\n\ntype ChartA11yProps =\n | { 'aria-label': string; 'aria-labelledby'?: never }\n | { 'aria-labelledby': string; 'aria-label'?: never };\n\ntype ChartContainerProps = Omit<\n ComponentProps<'div'>,\n 'aria-label' | 'aria-labelledby'\n> &\n ChartA11yProps & {\n config: ChartConfig;\n children: ComponentProps<typeof ResponsiveContainer>['children'];\n };\n\nfunction ChartContainer({\n id,\n className,\n children,\n config,\n style,\n role = 'img',\n ...props\n}: ChartContainerProps): ReactNode {\n const contextValue = useMemo(() => ({ config }), [config]);\n const cssVars = colorVarsFromConfig(config);\n\n return (\n <ChartContext.Provider value={contextValue}>\n <div\n role={role}\n data-slot=\"chart\"\n data-chart-id={id}\n className={cn(\n \"[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-chart-gridlines [&_.recharts-curve.recharts-tooltip-cursor]:stroke-chart-gridlines [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-chart-gridlines [&_.recharts-radial-bar-background-sector]:fill-medium-background [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-medium-background [&_.recharts-reference-line_[stroke='#ccc']]:stroke-chart-gridlines flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden\",\n className\n )}\n style={{ ...cssVars, ...style }}\n {...props}\n >\n <ResponsiveContainer>{children}</ResponsiveContainer>\n </div>\n </ChartContext.Provider>\n );\n}\n\nconst ChartTooltip: typeof Tooltip = Tooltip;\n\ntype TooltipPayloadItem = {\n type?: string;\n name?: string | number;\n dataKey?: string | number;\n value?: string | number;\n color?: string;\n payload?: Record<string, unknown>;\n fill?: string;\n [key: string]: unknown;\n};\n\nconst EMPTY_TOOLTIP_PAYLOAD: TooltipPayloadItem[] = [];\n\ntype ChartTooltipContentProps = Omit<\n ComponentProps<typeof Tooltip>,\n 'content' | 'formatter' | 'labelFormatter'\n> & {\n className?: string;\n labelClassName?: string;\n hideLabel?: boolean;\n hideIndicator?: boolean;\n indicator?: 'line' | 'dot' | 'dashed';\n nameKey?: string;\n labelKey?: string;\n payload?: TooltipPayloadItem[];\n label?: string | number;\n color?: string;\n formatter?: (\n value: string | number,\n name: string | number,\n item: TooltipPayloadItem,\n index: number,\n payload: Record<string, unknown> | undefined\n ) => ReactNode;\n labelFormatter?: (\n value: ReactNode,\n payload: TooltipPayloadItem[]\n ) => ReactNode;\n /** Pass an i18n-aware formatter from your app's locale; defaults to the environment locale. */\n valueFormatter?: (value: string | number) => string;\n};\n\nconst defaultValueFormatter = (value: string | number): string =>\n typeof value === 'number' ? value.toLocaleString() : String(value);\n\nfunction ChartTooltipContent({\n active,\n payload = EMPTY_TOOLTIP_PAYLOAD,\n className,\n indicator = 'dot',\n hideLabel = false,\n hideIndicator = false,\n label,\n labelFormatter,\n labelClassName,\n formatter,\n color,\n nameKey,\n labelKey,\n valueFormatter = defaultValueFormatter,\n}: ChartTooltipContentProps): ReactNode {\n const { config } = useChart();\n\n const tooltipLabel = (() => {\n if (hideLabel || !payload?.length) {\n return null;\n }\n\n const [item] = payload;\n const key = `${labelKey ?? item?.dataKey ?? item?.name ?? 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const value =\n !labelKey && typeof label === 'string'\n ? (config[label]?.label ?? label)\n : itemConfig?.label;\n\n if (labelFormatter) {\n return (\n <div className={cn('font-medium', labelClassName)}>\n {labelFormatter(value, payload)}\n </div>\n );\n }\n\n if (!value) {\n return null;\n }\n\n return <div className={cn('font-medium', labelClassName)}>{value}</div>;\n })();\n\n const isHidden = !active || !payload.length;\n const nestLabel = payload.length === 1 && indicator !== 'dot';\n\n return (\n <div\n className={cn(\n 'bg-popover-background grid min-w-32 items-start gap-1 rounded-md p-2 text-sm shadow-md',\n isHidden && 'invisible',\n className\n )}\n >\n {isHidden ? null : (\n <>\n {!nestLabel ? tooltipLabel : null}\n <div className=\"grid gap-1.5\">\n {payload\n .filter((item: TooltipPayloadItem) => item.type !== 'none')\n .map((item: TooltipPayloadItem, index: number) => {\n const key = `${nameKey ?? item.name ?? item.dataKey ?? 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(\n config,\n item,\n key\n );\n const payloadFill =\n isRecord(item.payload) &&\n typeof item.payload.fill === 'string'\n ? item.payload.fill\n : undefined;\n const indicatorColor = color ?? payloadFill ?? item.color;\n const indicatorSwatchStyle = swatchStylesFromGraphColor(\n typeof indicatorColor === 'string'\n ? indicatorColor\n : undefined\n );\n\n return (\n <div\n key={item.dataKey ?? index}\n className={cn(\n '[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5',\n indicator === 'dot' && 'items-center'\n )}\n >\n {formatter && item.value != null && item.name != null ? (\n formatter(\n item.value,\n item.name,\n item,\n index,\n isRecord(item.payload) ? item.payload : undefined\n )\n ) : (\n <>\n {itemConfig?.icon\n ? itemConfig.icon\n : !hideIndicator && (\n <div\n className={cn('shrink-0 rounded-xs', {\n 'h-2 w-2': indicator === 'dot',\n 'w-1': indicator === 'line',\n 'w-0 border border-dashed bg-transparent':\n indicator === 'dashed',\n 'my-0.5': nestLabel && indicator === 'dashed',\n })}\n style={indicatorSwatchStyle}\n />\n )}\n <div\n className={cn(\n 'flex flex-1 justify-between gap-4 leading-none',\n nestLabel ? 'items-end' : 'items-center'\n )}\n >\n <div className=\"grid gap-1\">\n {nestLabel ? tooltipLabel : null}\n <span className=\"text-muted-foreground\">\n {itemConfig?.label ?? item.name}\n </span>\n </div>\n {item.value !== undefined && item.value !== null && (\n <span className=\"text-base-foreground tabular-nums\">\n {valueFormatter(item.value)}\n </span>\n )}\n </div>\n </>\n )}\n </div>\n );\n })}\n </div>\n </>\n )}\n </div>\n );\n}\n\nconst ChartLegend: typeof Legend = Legend;\n\ntype LegendPayloadItem = {\n type?: string;\n value?: string;\n dataKey?: string | number;\n color?: string;\n [key: string]: unknown;\n};\n\nconst EMPTY_LEGEND_PAYLOAD: LegendPayloadItem[] = [];\n\ntype ChartLegendContentProps = {\n className?: string;\n hideIcon?: boolean;\n nameKey?: string;\n payload?: LegendPayloadItem[];\n verticalAlign?: 'top' | 'bottom' | 'middle';\n};\n\nfunction ChartLegendContent({\n className,\n hideIcon = false,\n payload = EMPTY_LEGEND_PAYLOAD,\n verticalAlign = 'bottom',\n nameKey,\n}: ChartLegendContentProps): ReactNode {\n const { config } = useChart();\n\n if (!payload?.length) {\n return null;\n }\n\n return (\n <div\n className={cn(\n 'flex items-center justify-center gap-4',\n verticalAlign === 'top' ? 'pb-3' : 'pt-3',\n className\n )}\n >\n {payload\n .filter((item: LegendPayloadItem) => item.type !== 'none')\n .map((item: LegendPayloadItem, index) => {\n const key = `${nameKey ?? item.dataKey ?? 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const legendSwatchStyle = swatchStylesFromGraphColor(\n typeof item.color === 'string' ? item.color : undefined\n );\n\n return (\n <div\n key={item.value ?? index}\n className={cn(\n '[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3'\n )}\n >\n {itemConfig?.icon && !hideIcon ? (\n itemConfig.icon\n ) : (\n <div\n className=\"h-2 w-2 shrink-0 rounded-xs\"\n style={legendSwatchStyle}\n />\n )}\n {itemConfig?.label ?? item.value}\n </div>\n );\n })}\n </div>\n );\n}\n\nfunction getPayloadConfigFromPayload(\n config: ChartConfig,\n payload: unknown,\n key: string\n): ChartConfig[string] | undefined {\n if (!isRecord(payload)) {\n return undefined;\n }\n const payloadRecord = payload;\n\n const payloadPayload = isRecord(payloadRecord.payload)\n ? payloadRecord.payload\n : undefined;\n\n let configLabelKey: string = key;\n\n const directValue = getStringValue(payloadRecord, key);\n if (directValue) {\n configLabelKey = directValue;\n } else {\n const nestedValue = payloadPayload\n ? getStringValue(payloadPayload, key)\n : undefined;\n if (nestedValue) {\n configLabelKey = nestedValue;\n }\n }\n\n return config[configLabelKey] ?? config[key];\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction getStringValue(\n value: Record<string, unknown>,\n key: string\n): string | undefined {\n const nestedValue = value[key];\n return typeof nestedValue === 'string' ? nestedValue : undefined;\n}\n\nexport {\n ChartContainer,\n ChartTooltip,\n ChartTooltipContent,\n ChartLegend,\n ChartLegendContent,\n colorVarsFromConfig,\n getPayloadConfigFromPayload,\n};\n"],"names":["createContext","useContext","useMemo","ResponsiveContainer","Tooltip","Legend","cn","swatchStylesFromGraphColor","color","undefined","c","trim","backgroundColor","borderColor","CHART_SERIES_COLOR_TOKENS","chartSeriesColor","series","count","length","zeroBased","ChartContext","useChart","context","Error","colorVarsFromConfig","config","vars","key","item","Object","entries","ChartContainer","id","className","children","style","role","props","contextValue","cssVars","Provider","value","div","data-slot","data-chart-id","ChartTooltip","EMPTY_TOOLTIP_PAYLOAD","defaultValueFormatter","toLocaleString","String","ChartTooltipContent","active","payload","indicator","hideLabel","hideIndicator","label","labelFormatter","labelClassName","formatter","nameKey","labelKey","valueFormatter","tooltipLabel","dataKey","name","itemConfig","getPayloadConfigFromPayload","isHidden","nestLabel","filter","type","map","index","payloadFill","isRecord","fill","indicatorColor","indicatorSwatchStyle","icon","span","ChartLegend","EMPTY_LEGEND_PAYLOAD","ChartLegendContent","hideIcon","verticalAlign","legendSwatchStyle","payloadRecord","payloadPayload","configLabelKey","directValue","getStringValue","nestedValue","Array","isArray"],"mappings":";AAAA,SAIEA,aAAa,EACbC,UAAU,EACVC,OAAO,QACF,QAAQ;AAEf,SAASC,mBAAmB,EAAEC,OAAO,EAAEC,MAAM,QAAQ,WAAW;AAEhE,SAASC,EAAE,QAAQ,2BAAwB;AAE3C,SAASC,2BACPC,KAAyB;IAEzB,IAAI,CAACA,OAAO;QACV,OAAOC;IACT;IACA,MAAMC,IAAIF,MAAMG,IAAI;IACpB,OAAO;QAAEC,iBAAiBF;QAAGG,aAAaH;IAAE;AAC9C;AAWA,oEAAoE,GACpE,OAAO,MAAMI,4BAA4B;IACvC;IACA;IACA;IACA;IACA;CACD,CAAU;AAEX,yEAAyE,GACzE,OAAO,SAASC,iBAAiBC,MAAc;IAC7C,MAAMC,QAAQH,0BAA0BI,MAAM;IAC9C,MAAMC,YAAY,AAAC,CAA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9C;AAEA,SAASgD,SAASlC,KAAc;IAC9B,OAAO,OAAOA,UAAU,YAAYA,UAAU,QAAQ,CAACoD,MAAMC,OAAO,CAACrD;AACvE;AAEA,SAASkD,eACPlD,KAA8B,EAC9Bd,GAAW;IAEX,MAAMiE,cAAcnD,KAAK,CAACd,IAAI;IAC9B,OAAO,OAAOiE,gBAAgB,WAAWA,cAAcnF;AACzD;AAEA,SACEsB,cAAc,EACdc,YAAY,EACZK,mBAAmB,EACnB+B,WAAW,EACXE,kBAAkB,EAClB3D,mBAAmB,EACnB2C,2BAA2B,GAC3B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent, } from
|
|
2
|
-
export type { ChartConfig } from
|
|
1
|
+
export { ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent, CHART_SERIES_COLOR_TOKENS, chartSeriesColor } from "./chart";
|
|
2
|
+
export type { ChartConfig } from "./chart";
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export { ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent, CHART_SERIES_COLOR_TOKENS, chartSeriesColor } from "./chart.js";
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/ui/core/chart/index.ts"],"sourcesContent":["export {\n ChartContainer,\n ChartLegend,\n ChartLegendContent,\n ChartTooltip,\n ChartTooltipContent,\n CHART_SERIES_COLOR_TOKENS,\n chartSeriesColor,\n} from './chart';\nexport type { ChartConfig } from './chart';\n"],"names":["ChartContainer","ChartLegend","ChartLegendContent","ChartTooltip","ChartTooltipContent","CHART_SERIES_COLOR_TOKENS","chartSeriesColor"],"mappings":"AAAA,SACEA,cAAc,EACdC,WAAW,EACXC,kBAAkB,EAClBC,YAAY,EACZC,mBAAmB,EACnBC,yBAAyB,EACzBC,gBAAgB,QACX,aAAU"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { ForwardRefExoticComponent, RefAttributes, HTMLAttributes } from
|
|
2
|
-
import { CheckboxRootProps } from
|
|
3
|
-
import { VariantProps } from
|
|
4
|
-
import { ClassProp } from
|
|
5
|
-
type Orientation =
|
|
1
|
+
import { type ForwardRefExoticComponent, type RefAttributes, type HTMLAttributes } from "react";
|
|
2
|
+
import type { CheckboxRootProps } from "@base-ui/react/checkbox";
|
|
3
|
+
import { type VariantProps } from "class-variance-authority";
|
|
4
|
+
import type { ClassProp } from "class-variance-authority/types";
|
|
5
|
+
type Orientation = "horizontal" | "vertical";
|
|
6
6
|
declare const CheckboxGroup: ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
7
|
-
|
|
7
|
+
orientation?: Orientation;
|
|
8
8
|
} & RefAttributes<HTMLDivElement>>;
|
|
9
9
|
interface CheckboxItemVariantProps {
|
|
10
|
-
|
|
10
|
+
variant?: "default" | "card" | null;
|
|
11
11
|
}
|
|
12
12
|
declare const checkboxItemVariants: (props?: (CheckboxItemVariantProps & ClassProp) | undefined) => string;
|
|
13
13
|
declare const CheckboxItem: ForwardRefExoticComponent<HTMLAttributes<HTMLLabelElement> & VariantProps<typeof checkboxItemVariants> & RefAttributes<HTMLLabelElement>>;
|
|
14
|
-
declare const CheckboxItemControl: ForwardRefExoticComponent<Omit<CheckboxRootProps,
|
|
14
|
+
declare const CheckboxItemControl: ForwardRefExoticComponent<Omit<CheckboxRootProps, "ref"> & RefAttributes<HTMLElement>>;
|
|
15
15
|
declare const CheckboxItemLabel: ForwardRefExoticComponent<HTMLAttributes<HTMLSpanElement> & RefAttributes<HTMLSpanElement>>;
|
|
16
16
|
declare const CheckboxItemDescription: ForwardRefExoticComponent<HTMLAttributes<HTMLSpanElement> & RefAttributes<HTMLSpanElement>>;
|
|
17
|
-
export { CheckboxGroup, CheckboxItem, CheckboxItemControl, CheckboxItemDescription, CheckboxItemLabel
|
|
17
|
+
export { CheckboxGroup, CheckboxItem, CheckboxItemControl, CheckboxItemDescription, CheckboxItemLabel };
|