@cognite/aura 0.3.5 → 1.0.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 +274 -0
- package/DESIGN.md +664 -281
- package/LICENSE +21 -0
- package/README.md +21 -13
- package/dist/colors-deprecated.css +618 -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 +132 -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.gallery.d.ts +2 -0
- package/dist/components/ui/core/alert/alert.gallery.js +54 -0
- package/dist/components/ui/core/alert/alert.gallery.js.map +1 -0
- 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.gallery.d.ts +2 -0
- package/dist/components/ui/core/avatar/avatar.gallery.js +67 -0
- package/dist/components/ui/core/avatar/avatar.gallery.js.map +1 -0
- 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.gallery.d.ts +2 -0
- package/dist/components/ui/core/badge/badge.gallery.js +64 -0
- package/dist/components/ui/core/badge/badge.gallery.js.map +1 -0
- 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.gallery.d.ts +2 -0
- package/dist/components/ui/core/banner/banner.gallery.js +56 -0
- package/dist/components/ui/core/banner/banner.gallery.js.map +1 -0
- 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.gallery.d.ts +2 -0
- package/dist/components/ui/core/breadcrumb/breadcrumb.gallery.js +31 -0
- package/dist/components/ui/core/breadcrumb/breadcrumb.gallery.js.map +1 -0
- 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.gallery.d.ts +2 -0
- package/dist/components/ui/core/button-group/button-group.gallery.js +62 -0
- package/dist/components/ui/core/button-group/button-group.gallery.js.map +1 -0
- 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.gallery.d.ts +2 -0
- package/dist/components/ui/core/checkbox/checkbox.gallery.js +36 -0
- package/dist/components/ui/core/checkbox/checkbox.gallery.js.map +1 -0
- 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 +260 -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.gallery.d.ts +2 -0
- package/dist/components/ui/core/collapsible/collapsible.gallery.js +39 -0
- package/dist/components/ui/core/collapsible/collapsible.gallery.js.map +1 -0
- 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.gallery.d.ts +2 -0
- package/dist/components/ui/core/count/count.gallery.js +55 -0
- package/dist/components/ui/core/count/count.gallery.js.map +1 -0
- 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 +5 -7
- package/dist/components/ui/core/data-grid/data-grid-cell.js +18 -22
- package/dist/components/ui/core/data-grid/data-grid-cell.js.map +1 -0
- package/dist/components/ui/core/data-grid/data-grid-column-filter.d.ts +4 -0
- package/dist/components/ui/core/data-grid/data-grid-column-filter.js +13 -0
- package/dist/components/ui/core/data-grid/data-grid-column-filter.js.map +1 -0
- package/dist/components/ui/core/data-grid/data-grid-column-resizer.d.ts +8 -0
- package/dist/components/ui/core/data-grid/data-grid-column-resizer.js +25 -0
- package/dist/components/ui/core/data-grid/data-grid-column-resizer.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 +43 -0
- package/dist/components/ui/core/data-grid/data-grid-filter-panel.js +287 -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 +85 -55
- package/dist/components/ui/core/data-grid/data-grid-header-row.js.map +1 -0
- package/dist/components/ui/core/data-grid/data-grid-header.d.ts +11 -0
- package/dist/components/ui/core/data-grid/data-grid-header.js +67 -0
- package/dist/components/ui/core/data-grid/data-grid-header.js.map +1 -0
- package/dist/components/ui/core/data-grid/data-grid-row.d.ts +13 -15
- package/dist/components/ui/core/data-grid/data-grid-row.js +117 -76
- package/dist/components/ui/core/data-grid/data-grid-row.js.map +1 -0
- package/dist/components/ui/core/data-grid/data-grid-selection-state.d.ts +15 -0
- package/dist/components/ui/core/data-grid/data-grid-selection-state.js +32 -0
- package/dist/components/ui/core/data-grid/data-grid-selection-state.js.map +1 -0
- package/dist/components/ui/core/data-grid/data-grid-selection-toolbar.d.ts +11 -0
- package/dist/components/ui/core/data-grid/data-grid-selection-toolbar.js +129 -0
- package/dist/components/ui/core/data-grid/data-grid-selection-toolbar.js.map +1 -0
- package/dist/components/ui/core/data-grid/data-grid-selection.types.d.ts +24 -0
- package/dist/components/ui/core/data-grid/data-grid-selection.types.js +3 -0
- package/dist/components/ui/core/data-grid/data-grid-selection.types.js.map +1 -0
- package/dist/components/ui/core/data-grid/data-grid.d.ts +125 -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 +540 -132
- package/dist/components/ui/core/data-grid/data-grid.js.map +1 -0
- package/dist/components/ui/core/data-grid/data-grid.utils.d.ts +3 -4
- package/dist/components/ui/core/data-grid/data-grid.utils.js +46 -33
- package/dist/components/ui/core/data-grid/data-grid.utils.js.map +1 -0
- package/dist/components/ui/core/data-grid/index.d.ts +6 -1
- package/dist/components/ui/core/data-grid/index.js +6 -2
- package/dist/components/ui/core/data-grid/index.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-picker/date-picker.d.ts +11 -13
- package/dist/components/ui/core/date-time-pickers/date-picker/date-picker.js +85 -61
- package/dist/components/ui/core/date-time-pickers/date-picker/date-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-picker/index.d.ts +3 -3
- package/dist/components/ui/core/date-time-pickers/date-picker/index.js +3 -0
- package/dist/components/ui/core/date-time-pickers/date-picker/index.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-picker/types.d.ts +14 -14
- package/dist/components/ui/core/date-time-pickers/date-picker/types.js +3 -0
- package/dist/components/ui/core/date-time-pickers/date-picker/types.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-picker/use-date-picker.d.ts +2 -2
- package/dist/components/ui/core/date-time-pickers/date-picker/use-date-picker.js +51 -36
- package/dist/components/ui/core/date-time-pickers/date-picker/use-date-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.d.ts +11 -13
- package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.js +89 -64
- package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-range-picker/index.d.ts +3 -3
- package/dist/components/ui/core/date-time-pickers/date-range-picker/index.js +3 -0
- package/dist/components/ui/core/date-time-pickers/date-range-picker/index.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-range-picker/types.d.ts +20 -20
- package/dist/components/ui/core/date-time-pickers/date-range-picker/types.js +3 -0
- package/dist/components/ui/core/date-time-pickers/date-range-picker/types.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-range-picker/use-date-range-picker.d.ts +4 -4
- package/dist/components/ui/core/date-time-pickers/date-range-picker/use-date-range-picker.js +95 -60
- package/dist/components/ui/core/date-time-pickers/date-range-picker/use-date-range-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/date-time-picker.d.ts +15 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/date-time-picker.js +120 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/date-time-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/index.d.ts +3 -1
- package/dist/components/ui/core/date-time-pickers/date-time-picker/index.js +3 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/index.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/types.d.ts +25 -32
- package/dist/components/ui/core/date-time-pickers/date-time-picker/types.js +3 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/types.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/use-date-time-picker.d.ts +2 -2
- package/dist/components/ui/core/date-time-pickers/date-time-picker/use-date-time-picker.js +78 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/use-date-time-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.d.ts +13 -15
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.js +165 -119
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/index.d.ts +3 -3
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/index.js +3 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/index.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/types.d.ts +37 -37
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/types.js +3 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/types.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/use-date-time-range-picker.d.ts +3 -3
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/use-date-time-range-picker.js +163 -104
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/use-date-time-range-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/index.d.ts +17 -12
- package/dist/components/ui/core/date-time-pickers/index.js +10 -6
- package/dist/components/ui/core/date-time-pickers/index.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.d.ts +5 -5
- package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.js +52 -42
- package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/constants.d.ts +6 -1
- package/dist/components/ui/core/date-time-pickers/shared/constants.js +23 -0
- package/dist/components/ui/core/date-time-pickers/shared/constants.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.d.ts +16 -15
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.js +87 -64
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/range-input-display.d.ts +10 -9
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/range-input-display.js +89 -38
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/range-input-display.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.d.ts +5 -5
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.js +34 -23
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-date-state.d.ts +23 -23
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-date-state.js +95 -52
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-date-state.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-step-manager.d.ts +5 -5
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-step-manager.js +22 -18
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-step-manager.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-single-date-state.d.ts +19 -19
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-single-date-state.js +41 -24
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-single-date-state.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.d.ts +13 -13
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.js +33 -24
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/scroll-cell-classes.d.ts +5 -5
- package/dist/components/ui/core/date-time-pickers/shared/scroll-cell-classes.js +9 -4
- package/dist/components/ui/core/date-time-pickers/shared/scroll-cell-classes.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.d.ts +13 -9
- package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.js +22 -17
- package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/index.d.ts +2 -2
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/index.js +3 -0
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/index.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.d.ts +13 -13
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.js +49 -40
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-scroll/time-picker-scroll.d.ts +7 -7
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-scroll/time-picker-scroll.js +41 -34
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-scroll/time-picker-scroll.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/index.d.ts +3 -3
- package/dist/components/ui/core/date-time-pickers/time-picker/index.js +3 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/index.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/time-picker.d.ts +12 -14
- package/dist/components/ui/core/date-time-pickers/time-picker/time-picker.js +99 -79
- package/dist/components/ui/core/date-time-pickers/time-picker/time-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/types.d.ts +20 -20
- package/dist/components/ui/core/date-time-pickers/time-picker/types.js +3 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/types.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/use-time-picker.d.ts +2 -2
- package/dist/components/ui/core/date-time-pickers/time-picker/use-time-picker.js +63 -41
- package/dist/components/ui/core/date-time-pickers/time-picker/use-time-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/index.d.ts +3 -1
- package/dist/components/ui/core/date-time-pickers/time-range-picker/index.js +3 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/index.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/time-range-picker.d.ts +14 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/time-range-picker.js +115 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/time-range-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/types.d.ts +30 -36
- package/dist/components/ui/core/date-time-pickers/time-range-picker/types.js +3 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/types.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/use-time-range-picker.d.ts +2 -2
- package/dist/components/ui/core/date-time-pickers/time-range-picker/use-time-range-picker.js +145 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/use-time-range-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/utils/date-input.d.ts +56 -0
- package/dist/components/ui/core/date-time-pickers/utils/date-input.js +67 -0
- package/dist/components/ui/core/date-time-pickers/utils/date-input.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/utils/date-range-utils.d.ts +18 -18
- package/dist/components/ui/core/date-time-pickers/utils/date-range-utils.js +42 -0
- package/dist/components/ui/core/date-time-pickers/utils/date-range-utils.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/utils/format-utils.d.ts +31 -29
- package/dist/components/ui/core/date-time-pickers/utils/format-utils.js +56 -0
- package/dist/components/ui/core/date-time-pickers/utils/format-utils.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/utils/segment-utils.d.ts +21 -21
- package/dist/components/ui/core/date-time-pickers/utils/segment-utils.js +170 -0
- package/dist/components/ui/core/date-time-pickers/utils/segment-utils.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/utils/time-utils.d.ts +28 -28
- package/dist/components/ui/core/date-time-pickers/utils/time-utils.js +88 -7
- package/dist/components/ui/core/date-time-pickers/utils/time-utils.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/utils/time-validation.d.ts +17 -17
- package/dist/components/ui/core/date-time-pickers/utils/time-validation.js +43 -0
- package/dist/components/ui/core/date-time-pickers/utils/time-validation.js.map +1 -0
- package/dist/components/ui/core/dialog/dialog.d.ts +12 -9
- package/dist/components/ui/core/dialog/dialog.js +90 -82
- package/dist/components/ui/core/dialog/dialog.js.map +1 -0
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.d.ts +22 -19
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.js +204 -149
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.js.map +1 -0
- package/dist/components/ui/core/empty-state/empty-state.context.d.ts +4 -4
- package/dist/components/ui/core/empty-state/empty-state.context.js +8 -5
- package/dist/components/ui/core/empty-state/empty-state.context.js.map +1 -0
- package/dist/components/ui/core/empty-state/empty-state.d.ts +14 -14
- package/dist/components/ui/core/empty-state/empty-state.js +96 -82
- package/dist/components/ui/core/empty-state/empty-state.js.map +1 -0
- package/dist/components/ui/core/helper-text/helper-text.d.ts +7 -7
- package/dist/components/ui/core/helper-text/helper-text.js +55 -36
- package/dist/components/ui/core/helper-text/helper-text.js.map +1 -0
- package/dist/components/ui/core/hover-card/hover-card.d.ts +7 -6
- package/dist/components/ui/core/hover-card/hover-card.js +56 -52
- package/dist/components/ui/core/hover-card/hover-card.js.map +1 -0
- package/dist/components/ui/core/inline-citation/inline-citation.d.ts +26 -25
- package/dist/components/ui/core/inline-citation/inline-citation.js +121 -97
- package/dist/components/ui/core/inline-citation/inline-citation.js.map +1 -0
- package/dist/components/ui/core/input/input.d.ts +2 -2
- package/dist/components/ui/core/input/input.gallery.d.ts +2 -0
- package/dist/components/ui/core/input/input.gallery.js +89 -0
- package/dist/components/ui/core/input/input.gallery.js.map +1 -0
- 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.gallery.d.ts +2 -0
- package/dist/components/ui/core/label/label.gallery.js +57 -0
- package/dist/components/ui/core/label/label.gallery.js.map +1 -0
- 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 +8 -9
- package/dist/components/ui/core/message/message-response-default-streamdown-controls.js +18 -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 +458 -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.gallery.d.ts +2 -0
- package/dist/components/ui/core/radio-group/radio-group.gallery.js +44 -0
- package/dist/components/ui/core/radio-group/radio-group.gallery.js.map +1 -0
- package/dist/components/ui/core/radio-group/radio-group.js +88 -58
- package/dist/components/ui/core/radio-group/radio-group.js.map +1 -0
- package/dist/components/ui/core/reasoning/reasoning.d.ts +7 -7
- package/dist/components/ui/core/reasoning/reasoning.js +68 -56
- package/dist/components/ui/core/reasoning/reasoning.js.map +1 -0
- package/dist/components/ui/core/scroll-area/scroll-area.d.ts +4 -4
- package/dist/components/ui/core/scroll-area/scroll-area.js +50 -40
- package/dist/components/ui/core/scroll-area/scroll-area.js.map +1 -0
- package/dist/components/ui/core/search/search.d.ts +8 -8
- package/dist/components/ui/core/search/search.js +122 -76
- package/dist/components/ui/core/search/search.js.map +1 -0
- package/dist/components/ui/core/segmented-control/segmented-control.d.ts +10 -10
- package/dist/components/ui/core/segmented-control/segmented-control.js +203 -149
- package/dist/components/ui/core/segmented-control/segmented-control.js.map +1 -0
- package/dist/components/ui/core/select/select.d.ts +33 -26
- package/dist/components/ui/core/select/select.js +262 -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.gallery.d.ts +2 -0
- package/dist/components/ui/core/separator/separator.gallery.js +63 -0
- package/dist/components/ui/core/separator/separator.gallery.js.map +1 -0
- 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.gallery.d.ts +2 -0
- package/dist/components/ui/core/skeleton/skeleton.gallery.js +22 -0
- package/dist/components/ui/core/skeleton/skeleton.gallery.js.map +1 -0
- 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.gallery.d.ts +2 -0
- package/dist/components/ui/core/slider/slider.gallery.js +62 -0
- package/dist/components/ui/core/slider/slider.gallery.js.map +1 -0
- 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/status-text/status-text.d.ts +4 -0
- package/dist/components/ui/core/status-text/status-text.js +14 -0
- package/dist/components/ui/core/status-text/status-text.js.map +1 -0
- package/dist/components/ui/core/switch/switch.d.ts +9 -9
- package/dist/components/ui/core/switch/switch.gallery.d.ts +2 -0
- package/dist/components/ui/core/switch/switch.gallery.js +67 -0
- package/dist/components/ui/core/switch/switch.gallery.js.map +1 -0
- 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.gallery.d.ts +2 -0
- package/dist/components/ui/core/textarea/textarea.gallery.js +51 -0
- package/dist/components/ui/core/textarea/textarea.gallery.js.map +1 -0
- 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.gallery.d.ts +2 -0
- package/dist/components/ui/core/toggle/toggle.gallery.js +32 -0
- package/dist/components/ui/core/toggle/toggle.gallery.js.map +1 -0
- 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.gallery.d.ts +2 -0
- package/dist/components/ui/core/tooltip/tooltip.gallery.js +52 -0
- package/dist/components/ui/core/tooltip/tooltip.gallery.js.map +1 -0
- 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 +46 -16
- 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 +49 -14
- package/src/components/ui/core/alert/alert.md +46 -0
- package/src/components/ui/core/avatar/avatar.md +30 -0
- package/src/components/ui/core/badge/badge.md +32 -0
- package/src/components/ui/core/banner/banner.md +51 -0
- package/src/components/ui/core/breadcrumb/breadcrumb.md +45 -0
- package/src/components/ui/core/button/button.md +93 -0
- package/src/components/ui/core/button-group/button-group.md +38 -0
- package/src/components/ui/core/checkbox/checkbox.md +37 -0
- package/src/components/ui/core/collapsible/collapsible.md +42 -0
- package/src/components/ui/core/count/count.md +33 -0
- package/src/components/ui/core/input/input.md +48 -0
- package/src/components/ui/core/label/label.md +35 -0
- package/src/components/ui/core/radio-group/radio-group.md +38 -0
- package/src/components/ui/core/separator/separator.md +32 -0
- package/src/components/ui/core/skeleton/skeleton.md +33 -0
- package/src/components/ui/core/slider/slider.md +41 -0
- package/src/components/ui/core/switch/switch.md +26 -0
- package/src/components/ui/core/textarea/textarea.md +42 -0
- package/src/components/ui/core/toggle/toggle.md +39 -0
- package/src/components/ui/core/tooltip/tooltip.md +41 -0
package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.js
CHANGED
|
@@ -1,119 +1,165 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
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
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { cn } from "../../../../../lib/utils.js";
|
|
4
|
+
import { Button } from "../../button/button.js";
|
|
5
|
+
import { Calendar } from "../../calendar/calendar.js";
|
|
6
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../../popover/popover.js";
|
|
7
|
+
import { DateTimeInput } from "../shared/date-time-input/date-time-input.js";
|
|
8
|
+
import { ShortcutsPanel } from "../shared/shortcuts-panel/shortcuts-panel.js";
|
|
9
|
+
import { TimePickerPanel } from "../shared/time-picker-panel/time-picker-panel.js";
|
|
10
|
+
import { normalizeIn, normalizeOutRange, normalizeShortcutValue, resolveValueType } from "../utils/date-input.js";
|
|
11
|
+
import { convert12HourTo24Hour } from "../utils/time-utils.js";
|
|
12
|
+
import { useDateTimeRangePicker } from "./use-date-time-range-picker.js";
|
|
13
|
+
export function DateTimeRangePicker({ value, onChange, format, placeholder, displayWeekNumber = false, shortcuts, timeFormat = '24h', defaultDate, valueType, className }) {
|
|
14
|
+
const resolvedType = resolveValueType(value[0] ?? value[1], defaultDate, valueType);
|
|
15
|
+
const djValue = [
|
|
16
|
+
normalizeIn(value[0]),
|
|
17
|
+
normalizeIn(value[1])
|
|
18
|
+
];
|
|
19
|
+
const djDefault = defaultDate != null ? normalizeIn(defaultDate) ?? undefined : undefined;
|
|
20
|
+
const handleChange = (range)=>{
|
|
21
|
+
onChange(normalizeOutRange(range, resolvedType));
|
|
22
|
+
};
|
|
23
|
+
const djShortcuts = shortcuts?.map((shortcut)=>({
|
|
24
|
+
...shortcut,
|
|
25
|
+
getValue: ()=>normalizeShortcutValue(shortcut.getValue())
|
|
26
|
+
}));
|
|
27
|
+
const { isOpen, step, displayedMonth, tempStart, tempEnd, hoverDate, tempStartHour, tempStartMinute, tempEndHour, tempEndMinute, startAmPm, endAmPm, handleOpenChange, handleSetStep, handleDateClick, handleMonthChange, handleDateHover, handleStartHourChange, handleStartMinuteChange, handleEndHourChange, handleEndMinuteChange, handleStartAmPmChange, handleEndAmPmChange, handleNext, handleApply, handleBack, handleApplyShortcut, popoverRef, inputRef } = useDateTimeRangePicker({
|
|
28
|
+
value: djValue,
|
|
29
|
+
onChange: handleChange,
|
|
30
|
+
timeFormat,
|
|
31
|
+
defaultDate: djDefault
|
|
32
|
+
});
|
|
33
|
+
const displayFormat = format ?? (timeFormat === '12h' ? 'DD/MM/YYYY h:mm A' : 'DD/MM/YYYY HH:mm');
|
|
34
|
+
const canProceed = step === 'start' ? tempStart !== null : tempEnd !== null;
|
|
35
|
+
const buttonLabel = step === 'start' ? 'Next' : 'Apply';
|
|
36
|
+
const buttonAction = step === 'start' ? handleNext : handleApply;
|
|
37
|
+
const currentHour = step === 'start' ? tempStartHour : tempEndHour;
|
|
38
|
+
const currentMinute = step === 'start' ? tempStartMinute : tempEndMinute;
|
|
39
|
+
const currentAmPm = step === 'start' ? startAmPm : endAmPm;
|
|
40
|
+
const onHourChange = step === 'start' ? handleStartHourChange : handleEndHourChange;
|
|
41
|
+
const onMinuteChange = step === 'start' ? handleStartMinuteChange : handleEndMinuteChange;
|
|
42
|
+
const onAmPmChange = step === 'start' ? handleStartAmPmChange : handleEndAmPmChange;
|
|
43
|
+
const displayValue = useMemo(()=>{
|
|
44
|
+
const startWithTime = tempStart ? tempStart.hour(timeFormat === '12h' ? convert12HourTo24Hour(tempStartHour, startAmPm) : tempStartHour).minute(tempStartMinute) : null;
|
|
45
|
+
const endWithTime = tempEnd ? tempEnd.hour(timeFormat === '12h' ? convert12HourTo24Hour(tempEndHour, endAmPm) : tempEndHour).minute(tempEndMinute) : null;
|
|
46
|
+
return [
|
|
47
|
+
startWithTime,
|
|
48
|
+
endWithTime
|
|
49
|
+
];
|
|
50
|
+
}, [
|
|
51
|
+
tempStart,
|
|
52
|
+
tempEnd,
|
|
53
|
+
tempStartHour,
|
|
54
|
+
tempStartMinute,
|
|
55
|
+
tempEndHour,
|
|
56
|
+
tempEndMinute,
|
|
57
|
+
startAmPm,
|
|
58
|
+
endAmPm,
|
|
59
|
+
timeFormat
|
|
60
|
+
]);
|
|
61
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
62
|
+
"data-slot": "date-time-range-picker",
|
|
63
|
+
className: cn('relative w-full', className),
|
|
64
|
+
children: /*#__PURE__*/ _jsxs(Popover, {
|
|
65
|
+
open: isOpen,
|
|
66
|
+
onOpenChange: handleOpenChange,
|
|
67
|
+
children: [
|
|
68
|
+
/*#__PURE__*/ _jsx(PopoverTrigger, {
|
|
69
|
+
render: /*#__PURE__*/ _jsx("div", {
|
|
70
|
+
ref: inputRef,
|
|
71
|
+
className: "w-full"
|
|
72
|
+
}),
|
|
73
|
+
children: /*#__PURE__*/ _jsx(DateTimeInput, {
|
|
74
|
+
value: displayValue,
|
|
75
|
+
format: displayFormat,
|
|
76
|
+
placeholder: placeholder,
|
|
77
|
+
isOpen: isOpen,
|
|
78
|
+
variant: "datetime",
|
|
79
|
+
activeRangePart: isOpen ? step : undefined,
|
|
80
|
+
onRangePartClick: isOpen ? handleSetStep : undefined
|
|
81
|
+
})
|
|
82
|
+
}),
|
|
83
|
+
/*#__PURE__*/ _jsx(PopoverContent, {
|
|
84
|
+
ref: popoverRef,
|
|
85
|
+
className: "rounded-xl w-auto p-0",
|
|
86
|
+
side: "bottom",
|
|
87
|
+
align: "start",
|
|
88
|
+
children: /*#__PURE__*/ _jsxs("div", {
|
|
89
|
+
"data-slot": "date-time-range-picker-content",
|
|
90
|
+
className: "flex flex-col",
|
|
91
|
+
children: [
|
|
92
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
93
|
+
className: "flex flex-row",
|
|
94
|
+
children: [
|
|
95
|
+
djShortcuts && djShortcuts.length > 0 && /*#__PURE__*/ _jsx(ShortcutsPanel, {
|
|
96
|
+
shortcuts: djShortcuts,
|
|
97
|
+
onShortcutClick: handleApplyShortcut
|
|
98
|
+
}),
|
|
99
|
+
/*#__PURE__*/ _jsx("div", {
|
|
100
|
+
className: "p-3 border-r border-default",
|
|
101
|
+
children: /*#__PURE__*/ _jsx(Calendar, {
|
|
102
|
+
displayedMonth: displayedMonth,
|
|
103
|
+
selectedRange: [
|
|
104
|
+
tempStart,
|
|
105
|
+
tempEnd
|
|
106
|
+
],
|
|
107
|
+
hoverDate: step === 'end' ? hoverDate : null,
|
|
108
|
+
displayWeekNumber: displayWeekNumber,
|
|
109
|
+
onDateClick: handleDateClick,
|
|
110
|
+
onMonthChange: handleMonthChange,
|
|
111
|
+
onDateHover: handleDateHover
|
|
112
|
+
})
|
|
113
|
+
}),
|
|
114
|
+
timeFormat === '12h' ? /*#__PURE__*/ _jsx(TimePickerPanel, {
|
|
115
|
+
hour: currentHour,
|
|
116
|
+
minute: currentMinute,
|
|
117
|
+
amPm: currentAmPm,
|
|
118
|
+
timeFormat: "12h",
|
|
119
|
+
onHourChange: onHourChange,
|
|
120
|
+
onMinuteChange: onMinuteChange,
|
|
121
|
+
onAmPmChange: onAmPmChange
|
|
122
|
+
}) : /*#__PURE__*/ _jsx(TimePickerPanel, {
|
|
123
|
+
hour: currentHour,
|
|
124
|
+
minute: currentMinute,
|
|
125
|
+
timeFormat: "24h",
|
|
126
|
+
onHourChange: onHourChange,
|
|
127
|
+
onMinuteChange: onMinuteChange
|
|
128
|
+
})
|
|
129
|
+
]
|
|
130
|
+
}),
|
|
131
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
132
|
+
className: "flex p-2 justify-between items-center self-stretch border-t border-default",
|
|
133
|
+
children: [
|
|
134
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
135
|
+
variant: "ghost",
|
|
136
|
+
onClick: ()=>handleOpenChange(false),
|
|
137
|
+
children: "Cancel"
|
|
138
|
+
}),
|
|
139
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
140
|
+
className: "flex gap-2",
|
|
141
|
+
children: [
|
|
142
|
+
step === 'end' && /*#__PURE__*/ _jsx(Button, {
|
|
143
|
+
variant: "ghost",
|
|
144
|
+
onClick: handleBack,
|
|
145
|
+
children: "Back"
|
|
146
|
+
}),
|
|
147
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
148
|
+
variant: "secondary",
|
|
149
|
+
onClick: buttonAction,
|
|
150
|
+
disabled: !canProceed,
|
|
151
|
+
children: buttonLabel
|
|
152
|
+
})
|
|
153
|
+
]
|
|
154
|
+
})
|
|
155
|
+
]
|
|
156
|
+
})
|
|
157
|
+
]
|
|
158
|
+
})
|
|
159
|
+
})
|
|
160
|
+
]
|
|
161
|
+
})
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
//# sourceMappingURL=date-time-range-picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.tsx"],"sourcesContent":["import type { JSX } from 'react';\nimport { useMemo } from 'react';\n\nimport type { Dayjs } from 'dayjs';\n\nimport { cn } from '../../../../../lib/utils';\nimport { Button } from '../../button/button';\nimport { Calendar } from '../../calendar/calendar';\nimport { Popover, PopoverContent, PopoverTrigger } from '../../popover/popover';\nimport { DateTimeInput } from '../shared/date-time-input/date-time-input';\nimport { ShortcutsPanel } from '../shared/shortcuts-panel/shortcuts-panel';\nimport type { ShortcutItem } from '../shared/shortcuts-panel/shortcuts-panel';\nimport { TimePickerPanel } from '../shared/time-picker-panel/time-picker-panel';\nimport {\n type DateInput,\n type DateRangeValueProps,\n normalizeIn,\n normalizeOutRange,\n normalizeShortcutValue,\n resolveValueType,\n} from '../utils/date-input';\nimport type { TimeFormat } from '../utils/format-utils';\nimport { convert12HourTo24Hour } from '../utils/time-utils';\n\nimport { useDateTimeRangePicker } from './use-date-time-range-picker';\n\nexport type { ShortcutItem };\n\nexport interface DateTimeRangePickerProps<\n T extends DateInput = Dayjs,\n> extends DateRangeValueProps<T> {\n format?: string;\n placeholder?: string;\n displayWeekNumber?: boolean;\n shortcuts?: ShortcutItem[];\n timeFormat?: TimeFormat;\n className?: string;\n}\n\nexport function DateTimeRangePicker<T extends DateInput = Dayjs>({\n value,\n onChange,\n format,\n placeholder,\n displayWeekNumber = false,\n shortcuts,\n timeFormat = '24h',\n defaultDate,\n valueType,\n className,\n}: DateTimeRangePickerProps<T>): JSX.Element {\n const resolvedType = resolveValueType(\n value[0] ?? value[1],\n defaultDate,\n valueType\n );\n const djValue: [Dayjs | null, Dayjs | null] = [\n normalizeIn(value[0]),\n normalizeIn(value[1]),\n ];\n const djDefault =\n defaultDate != null ? (normalizeIn(defaultDate) ?? undefined) : undefined;\n\n const handleChange = (range: [Dayjs | null, Dayjs | null]) => {\n onChange(normalizeOutRange<T>(range, resolvedType));\n };\n\n const djShortcuts = shortcuts?.map((shortcut) => ({\n ...shortcut,\n getValue: () => normalizeShortcutValue(shortcut.getValue()),\n }));\n\n const {\n isOpen,\n step,\n displayedMonth,\n tempStart,\n tempEnd,\n hoverDate,\n tempStartHour,\n tempStartMinute,\n tempEndHour,\n tempEndMinute,\n startAmPm,\n endAmPm,\n handleOpenChange,\n handleSetStep,\n handleDateClick,\n handleMonthChange,\n handleDateHover,\n handleStartHourChange,\n handleStartMinuteChange,\n handleEndHourChange,\n handleEndMinuteChange,\n handleStartAmPmChange,\n handleEndAmPmChange,\n handleNext,\n handleApply,\n handleBack,\n handleApplyShortcut,\n popoverRef,\n inputRef,\n } = useDateTimeRangePicker({\n value: djValue,\n onChange: handleChange,\n timeFormat,\n defaultDate: djDefault,\n });\n\n const displayFormat =\n format ?? (timeFormat === '12h' ? 'DD/MM/YYYY h:mm A' : 'DD/MM/YYYY HH:mm');\n\n const canProceed = step === 'start' ? tempStart !== null : tempEnd !== null;\n const buttonLabel = step === 'start' ? 'Next' : 'Apply';\n const buttonAction = step === 'start' ? handleNext : handleApply;\n const currentHour = step === 'start' ? tempStartHour : tempEndHour;\n const currentMinute = step === 'start' ? tempStartMinute : tempEndMinute;\n const currentAmPm = step === 'start' ? startAmPm : endAmPm;\n const onHourChange =\n step === 'start' ? handleStartHourChange : handleEndHourChange;\n const onMinuteChange =\n step === 'start' ? handleStartMinuteChange : handleEndMinuteChange;\n const onAmPmChange =\n step === 'start' ? handleStartAmPmChange : handleEndAmPmChange;\n\n const displayValue: [Dayjs | null, Dayjs | null] = useMemo(() => {\n const startWithTime = tempStart\n ? tempStart\n .hour(\n timeFormat === '12h'\n ? convert12HourTo24Hour(tempStartHour, startAmPm)\n : tempStartHour\n )\n .minute(tempStartMinute)\n : null;\n const endWithTime = tempEnd\n ? tempEnd\n .hour(\n timeFormat === '12h'\n ? convert12HourTo24Hour(tempEndHour, endAmPm)\n : tempEndHour\n )\n .minute(tempEndMinute)\n : null;\n return [startWithTime, endWithTime];\n }, [\n tempStart,\n tempEnd,\n tempStartHour,\n tempStartMinute,\n tempEndHour,\n tempEndMinute,\n startAmPm,\n endAmPm,\n timeFormat,\n ]);\n\n return (\n <div\n data-slot=\"date-time-range-picker\"\n className={cn('relative w-full', className)}\n >\n <Popover open={isOpen} onOpenChange={handleOpenChange}>\n <PopoverTrigger render={<div ref={inputRef} className=\"w-full\" />}>\n <DateTimeInput\n value={displayValue}\n format={displayFormat}\n placeholder={placeholder}\n isOpen={isOpen}\n variant=\"datetime\"\n activeRangePart={isOpen ? step : undefined}\n onRangePartClick={isOpen ? handleSetStep : undefined}\n />\n </PopoverTrigger>\n <PopoverContent\n ref={popoverRef}\n className=\"rounded-xl w-auto p-0\"\n side=\"bottom\"\n align=\"start\"\n >\n <div\n data-slot=\"date-time-range-picker-content\"\n className=\"flex flex-col\"\n >\n <div className=\"flex flex-row\">\n {djShortcuts && djShortcuts.length > 0 && (\n <ShortcutsPanel\n shortcuts={djShortcuts}\n onShortcutClick={handleApplyShortcut}\n />\n )}\n\n {/* Calendar */}\n <div className=\"p-3 border-r border-default\">\n <Calendar\n displayedMonth={displayedMonth}\n selectedRange={[tempStart, tempEnd]}\n hoverDate={step === 'end' ? hoverDate : null}\n displayWeekNumber={displayWeekNumber}\n onDateClick={handleDateClick}\n onMonthChange={handleMonthChange}\n onDateHover={handleDateHover}\n />\n </div>\n\n {timeFormat === '12h' ? (\n <TimePickerPanel\n hour={currentHour}\n minute={currentMinute}\n amPm={currentAmPm}\n timeFormat=\"12h\"\n onHourChange={onHourChange}\n onMinuteChange={onMinuteChange}\n onAmPmChange={onAmPmChange}\n />\n ) : (\n <TimePickerPanel\n hour={currentHour}\n minute={currentMinute}\n timeFormat=\"24h\"\n onHourChange={onHourChange}\n onMinuteChange={onMinuteChange}\n />\n )}\n </div>\n\n {/* Action bar */}\n <div className=\"flex p-2 justify-between items-center self-stretch border-t border-default\">\n <Button variant=\"ghost\" onClick={() => handleOpenChange(false)}>\n Cancel\n </Button>\n <div className=\"flex gap-2\">\n {step === 'end' && (\n <Button variant=\"ghost\" onClick={handleBack}>\n Back\n </Button>\n )}\n <Button\n variant=\"secondary\"\n onClick={buttonAction}\n disabled={!canProceed}\n >\n {buttonLabel}\n </Button>\n </div>\n </div>\n </div>\n </PopoverContent>\n </Popover>\n </div>\n );\n}\n"],"names":["useMemo","cn","Button","Calendar","Popover","PopoverContent","PopoverTrigger","DateTimeInput","ShortcutsPanel","TimePickerPanel","normalizeIn","normalizeOutRange","normalizeShortcutValue","resolveValueType","convert12HourTo24Hour","useDateTimeRangePicker","DateTimeRangePicker","value","onChange","format","placeholder","displayWeekNumber","shortcuts","timeFormat","defaultDate","valueType","className","resolvedType","djValue","djDefault","undefined","handleChange","range","djShortcuts","map","shortcut","getValue","isOpen","step","displayedMonth","tempStart","tempEnd","hoverDate","tempStartHour","tempStartMinute","tempEndHour","tempEndMinute","startAmPm","endAmPm","handleOpenChange","handleSetStep","handleDateClick","handleMonthChange","handleDateHover","handleStartHourChange","handleStartMinuteChange","handleEndHourChange","handleEndMinuteChange","handleStartAmPmChange","handleEndAmPmChange","handleNext","handleApply","handleBack","handleApplyShortcut","popoverRef","inputRef","displayFormat","canProceed","buttonLabel","buttonAction","currentHour","currentMinute","currentAmPm","onHourChange","onMinuteChange","onAmPmChange","displayValue","startWithTime","hour","minute","endWithTime","div","data-slot","open","onOpenChange","render","ref","variant","activeRangePart","onRangePartClick","side","align","length","onShortcutClick","selectedRange","onDateClick","onMonthChange","onDateHover","amPm","onClick","disabled"],"mappings":"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"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { DateTimeRangePicker } from
|
|
2
|
-
export type { DateTimeRangePickerProps } from
|
|
3
|
-
export type { ShortcutItem } from
|
|
1
|
+
export { DateTimeRangePicker } from "./date-time-range-picker";
|
|
2
|
+
export type { DateTimeRangePickerProps } from "./date-time-range-picker";
|
|
3
|
+
export type { ShortcutItem } from "./date-time-range-picker";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/components/ui/core/date-time-pickers/date-time-range-picker/index.ts"],"sourcesContent":["export { DateTimeRangePicker } from './date-time-range-picker';\nexport type { DateTimeRangePickerProps } from './date-time-range-picker';\nexport type { ShortcutItem } from './date-time-range-picker';\n"],"names":["DateTimeRangePicker"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,8BAA2B"}
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { Dayjs } from
|
|
2
|
-
import { RangeSelectionStep } from
|
|
3
|
-
import { ShortcutValueDayjs } from
|
|
4
|
-
import { AmPm, TimeFormat } from
|
|
1
|
+
import type { Dayjs } from "dayjs";
|
|
2
|
+
import type { RangeSelectionStep } from "../shared/hooks/use-range-step-manager";
|
|
3
|
+
import type { ShortcutValueDayjs } from "../shared/shortcuts-panel/shortcuts-panel";
|
|
4
|
+
import type { AmPm, TimeFormat } from "../utils/format-utils";
|
|
5
5
|
export type { RangeSelectionStep };
|
|
6
6
|
export interface UseDateTimeRangePickerProps {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
value: [Dayjs | null, Dayjs | null];
|
|
8
|
+
onChange: (range: [Dayjs | null, Dayjs | null]) => void;
|
|
9
|
+
timeFormat?: TimeFormat;
|
|
10
|
+
defaultDate?: Dayjs;
|
|
11
11
|
}
|
|
12
12
|
export interface UseDateTimeRangePickerReturn {
|
|
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
|
-
|
|
13
|
+
isOpen: boolean;
|
|
14
|
+
step: RangeSelectionStep;
|
|
15
|
+
displayedMonth: Dayjs;
|
|
16
|
+
tempStart: Dayjs | null;
|
|
17
|
+
tempEnd: Dayjs | null;
|
|
18
|
+
hoverDate: Dayjs | null;
|
|
19
|
+
tempStartHour: number;
|
|
20
|
+
tempStartMinute: number;
|
|
21
|
+
tempEndHour: number;
|
|
22
|
+
tempEndMinute: number;
|
|
23
|
+
startAmPm: AmPm;
|
|
24
|
+
endAmPm: AmPm;
|
|
25
|
+
handleOpenChange: (open: boolean) => void;
|
|
26
|
+
handleSetStep: (step: RangeSelectionStep) => void;
|
|
27
|
+
handleDateClick: (date: Dayjs) => void;
|
|
28
|
+
handleMonthChange: (month: Dayjs) => void;
|
|
29
|
+
handleDateHover: (date: Dayjs | null) => void;
|
|
30
|
+
handleStartHourChange: (hour: number) => void;
|
|
31
|
+
handleStartMinuteChange: (minute: number) => void;
|
|
32
|
+
handleEndHourChange: (hour: number) => void;
|
|
33
|
+
handleEndMinuteChange: (minute: number) => void;
|
|
34
|
+
handleStartAmPmChange: (value: AmPm) => void;
|
|
35
|
+
handleEndAmPmChange: (value: AmPm) => void;
|
|
36
|
+
handleNext: () => void;
|
|
37
|
+
handleApply: () => void;
|
|
38
|
+
handleBack: () => void;
|
|
39
|
+
handleApplyShortcut: (range: ShortcutValueDayjs) => void;
|
|
40
|
+
popoverRef: React.RefObject<HTMLDivElement>;
|
|
41
|
+
inputRef: React.RefObject<HTMLDivElement>;
|
|
42
42
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/components/ui/core/date-time-pickers/date-time-range-picker/types.ts"],"sourcesContent":["import type { Dayjs } from 'dayjs';\n\nimport type { RangeSelectionStep } from '../shared/hooks/use-range-step-manager';\nimport type { ShortcutValueDayjs } from '../shared/shortcuts-panel/shortcuts-panel';\nimport type { AmPm, TimeFormat } from '../utils/format-utils';\n\nexport type { RangeSelectionStep };\n\nexport interface UseDateTimeRangePickerProps {\n value: [Dayjs | null, Dayjs | null];\n onChange: (range: [Dayjs | null, Dayjs | null]) => void;\n timeFormat?: TimeFormat;\n defaultDate?: Dayjs;\n}\n\nexport interface UseDateTimeRangePickerReturn {\n isOpen: boolean;\n step: RangeSelectionStep;\n displayedMonth: Dayjs;\n tempStart: Dayjs | null;\n tempEnd: Dayjs | null;\n hoverDate: Dayjs | null;\n tempStartHour: number;\n tempStartMinute: number;\n tempEndHour: number;\n tempEndMinute: number;\n startAmPm: AmPm;\n endAmPm: AmPm;\n handleOpenChange: (open: boolean) => void;\n handleSetStep: (step: RangeSelectionStep) => void;\n handleDateClick: (date: Dayjs) => void;\n handleMonthChange: (month: Dayjs) => void;\n handleDateHover: (date: Dayjs | null) => void;\n handleStartHourChange: (hour: number) => void;\n handleStartMinuteChange: (minute: number) => void;\n handleEndHourChange: (hour: number) => void;\n handleEndMinuteChange: (minute: number) => void;\n handleStartAmPmChange: (value: AmPm) => void;\n handleEndAmPmChange: (value: AmPm) => void;\n handleNext: () => void;\n handleApply: () => void;\n handleBack: () => void;\n handleApplyShortcut: (range: ShortcutValueDayjs) => void;\n popoverRef: React.RefObject<HTMLDivElement>;\n inputRef: React.RefObject<HTMLDivElement>;\n}\n"],"names":[],"mappings":"AAeA,WA8BC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { RangeSelectionStep, UseDateTimeRangePickerProps, UseDateTimeRangePickerReturn } from
|
|
2
|
-
export type { RangeSelectionStep, UseDateTimeRangePickerProps, UseDateTimeRangePickerReturn
|
|
3
|
-
export declare const useDateTimeRangePicker: ({ value, onChange, timeFormat, defaultDate
|
|
1
|
+
import type { RangeSelectionStep, UseDateTimeRangePickerProps, UseDateTimeRangePickerReturn } from "./types";
|
|
2
|
+
export type { RangeSelectionStep, UseDateTimeRangePickerProps, UseDateTimeRangePickerReturn };
|
|
3
|
+
export declare const useDateTimeRangePicker: ({ value, onChange, timeFormat, defaultDate }: UseDateTimeRangePickerProps) => UseDateTimeRangePickerReturn;
|