@cognite/aura 0.3.5 → 1.46104.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +264 -0
- package/DESIGN.md +638 -281
- package/LICENSE +21 -0
- package/README.md +21 -13
- package/dist/colors-deprecated.css +587 -0
- package/dist/colors.css +803 -830
- package/dist/components/index.d.ts +63 -57
- package/dist/components/index.js +62 -59
- package/dist/components/index.js.map +1 -0
- package/dist/components/ui/core/accordion/accordion.d.ts +19 -18
- package/dist/components/ui/core/accordion/accordion.js +99 -78
- package/dist/components/ui/core/accordion/accordion.js.map +1 -0
- package/dist/components/ui/core/action-toolbar/action-toolbar-motion.d.ts +8 -0
- package/dist/components/ui/core/action-toolbar/action-toolbar-motion.js +125 -0
- package/dist/components/ui/core/action-toolbar/action-toolbar-motion.js.map +1 -0
- package/dist/components/ui/core/action-toolbar/action-toolbar.d.ts +31 -31
- package/dist/components/ui/core/action-toolbar/action-toolbar.js +156 -106
- package/dist/components/ui/core/action-toolbar/action-toolbar.js.map +1 -0
- package/dist/components/ui/core/alert/alert.d.ts +25 -25
- package/dist/components/ui/core/alert/alert.js +181 -152
- package/dist/components/ui/core/alert/alert.js.map +1 -0
- package/dist/components/ui/core/avatar/avatar.d.ts +10 -9
- package/dist/components/ui/core/avatar/avatar.js +75 -65
- package/dist/components/ui/core/avatar/avatar.js.map +1 -0
- package/dist/components/ui/core/badge/badge.d.ts +13 -12
- package/dist/components/ui/core/badge/badge.js +88 -72
- package/dist/components/ui/core/badge/badge.js.map +1 -0
- package/dist/components/ui/core/banner/banner.d.ts +18 -18
- package/dist/components/ui/core/banner/banner.js +179 -142
- package/dist/components/ui/core/banner/banner.js.map +1 -0
- package/dist/components/ui/core/breadcrumb/breadcrumb.d.ts +12 -12
- package/dist/components/ui/core/breadcrumb/breadcrumb.js +139 -104
- package/dist/components/ui/core/breadcrumb/breadcrumb.js.map +1 -0
- package/dist/components/ui/core/button/button.d.ts +7 -7
- package/dist/components/ui/core/button/button.gallery.d.ts +2 -0
- package/dist/components/ui/core/button/button.gallery.js +76 -0
- package/dist/components/ui/core/button/button.gallery.js.map +1 -0
- package/dist/components/ui/core/button/button.js +57 -47
- package/dist/components/ui/core/button/button.js.map +1 -0
- package/dist/components/ui/core/button-group/button-group.d.ts +9 -9
- package/dist/components/ui/core/button-group/button-group.js +50 -40
- package/dist/components/ui/core/button-group/button-group.js.map +1 -0
- package/dist/components/ui/core/calendar/calendar-header.d.ts +7 -7
- package/dist/components/ui/core/calendar/calendar-header.js +102 -63
- package/dist/components/ui/core/calendar/calendar-header.js.map +1 -0
- package/dist/components/ui/core/calendar/calendar-utils.d.ts +30 -30
- package/dist/components/ui/core/calendar/calendar-utils.js +116 -39
- package/dist/components/ui/core/calendar/calendar-utils.js.map +1 -0
- package/dist/components/ui/core/calendar/calendar.d.ts +10 -10
- package/dist/components/ui/core/calendar/calendar.js +95 -66
- package/dist/components/ui/core/calendar/calendar.js.map +1 -0
- package/dist/components/ui/core/calendar/constants.js +3 -0
- package/dist/components/ui/core/calendar/constants.js.map +1 -0
- package/dist/components/ui/core/card/card.d.ts +20 -20
- package/dist/components/ui/core/card/card.js +133 -104
- package/dist/components/ui/core/card/card.js.map +1 -0
- package/dist/components/ui/core/chart/chart.d.ts +55 -53
- package/dist/components/ui/core/chart/chart.js +196 -116
- package/dist/components/ui/core/chart/chart.js.map +1 -0
- package/dist/components/ui/core/chart/index.d.ts +2 -2
- package/dist/components/ui/core/chart/index.js +3 -2
- package/dist/components/ui/core/chart/index.js.map +1 -0
- package/dist/components/ui/core/checkbox/checkbox.d.ts +9 -9
- package/dist/components/ui/core/checkbox/checkbox.js +88 -68
- package/dist/components/ui/core/checkbox/checkbox.js.map +1 -0
- package/dist/components/ui/core/checkbox/checkbox.metadata.d.ts +1 -1
- package/dist/components/ui/core/checkbox/checkbox.metadata.js +6 -7
- package/dist/components/ui/core/checkbox/checkbox.metadata.js.map +1 -0
- package/dist/components/ui/core/code-block/code-block.d.ts +19 -19
- package/dist/components/ui/core/code-block/code-block.js +259 -175
- package/dist/components/ui/core/code-block/code-block.js.map +1 -0
- package/dist/components/ui/core/collapsible/collapsible.d.ts +5 -5
- package/dist/components/ui/core/collapsible/collapsible.js +36 -30
- package/dist/components/ui/core/collapsible/collapsible.js.map +1 -0
- package/dist/components/ui/core/combobox/combobox.d.ts +13 -13
- package/dist/components/ui/core/combobox/combobox.js +89 -40
- package/dist/components/ui/core/combobox/combobox.js.map +1 -0
- package/dist/components/ui/core/command/command.d.ts +20 -18
- package/dist/components/ui/core/command/command.js +137 -85
- package/dist/components/ui/core/command/command.js.map +1 -0
- package/dist/components/ui/core/conversation/conversation.d.ts +14 -0
- package/dist/components/ui/core/conversation/conversation.js +51 -0
- package/dist/components/ui/core/conversation/conversation.js.map +1 -0
- package/dist/components/ui/core/count/count.d.ts +8 -6
- package/dist/components/ui/core/count/count.js +51 -21
- package/dist/components/ui/core/count/count.js.map +1 -0
- package/dist/components/ui/core/data-grid/data-grid-cell.d.ts +7 -7
- package/dist/components/ui/core/data-grid/data-grid-cell.js +22 -22
- package/dist/components/ui/core/data-grid/data-grid-cell.js.map +1 -0
- package/dist/components/ui/core/data-grid/data-grid-filter-clauses.d.ts +14 -0
- package/dist/components/ui/core/data-grid/data-grid-filter-clauses.js +36 -0
- package/dist/components/ui/core/data-grid/data-grid-filter-clauses.js.map +1 -0
- package/dist/components/ui/core/data-grid/data-grid-filter-panel.d.ts +41 -0
- package/dist/components/ui/core/data-grid/data-grid-filter-panel.js +273 -0
- package/dist/components/ui/core/data-grid/data-grid-filter-panel.js.map +1 -0
- package/dist/components/ui/core/data-grid/data-grid-footer.d.ts +6 -0
- package/dist/components/ui/core/data-grid/data-grid-footer.js +34 -0
- package/dist/components/ui/core/data-grid/data-grid-footer.js.map +1 -0
- package/dist/components/ui/core/data-grid/data-grid-header-row.d.ts +10 -10
- package/dist/components/ui/core/data-grid/data-grid-header-row.js +69 -55
- package/dist/components/ui/core/data-grid/data-grid-header-row.js.map +1 -0
- package/dist/components/ui/core/data-grid/data-grid-header.d.ts +11 -0
- package/dist/components/ui/core/data-grid/data-grid-header.js +67 -0
- package/dist/components/ui/core/data-grid/data-grid-header.js.map +1 -0
- package/dist/components/ui/core/data-grid/data-grid-row.d.ts +15 -15
- package/dist/components/ui/core/data-grid/data-grid-row.js +104 -76
- package/dist/components/ui/core/data-grid/data-grid-row.js.map +1 -0
- package/dist/components/ui/core/data-grid/data-grid.d.ts +85 -35
- package/dist/components/ui/core/data-grid/data-grid.fixtures.d.ts +7 -7
- package/dist/components/ui/core/data-grid/data-grid.fixtures.js +139 -0
- package/dist/components/ui/core/data-grid/data-grid.fixtures.js.map +1 -0
- package/dist/components/ui/core/data-grid/data-grid.js +402 -132
- package/dist/components/ui/core/data-grid/data-grid.js.map +1 -0
- package/dist/components/ui/core/data-grid/data-grid.utils.d.ts +3 -3
- package/dist/components/ui/core/data-grid/data-grid.utils.js +44 -33
- package/dist/components/ui/core/data-grid/data-grid.utils.js.map +1 -0
- package/dist/components/ui/core/data-grid/index.d.ts +4 -1
- package/dist/components/ui/core/data-grid/index.js +5 -2
- package/dist/components/ui/core/data-grid/index.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-picker/date-picker.d.ts +11 -13
- package/dist/components/ui/core/date-time-pickers/date-picker/date-picker.js +85 -61
- package/dist/components/ui/core/date-time-pickers/date-picker/date-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-picker/index.d.ts +3 -3
- package/dist/components/ui/core/date-time-pickers/date-picker/index.js +3 -0
- package/dist/components/ui/core/date-time-pickers/date-picker/index.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-picker/types.d.ts +14 -14
- package/dist/components/ui/core/date-time-pickers/date-picker/types.js +3 -0
- package/dist/components/ui/core/date-time-pickers/date-picker/types.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-picker/use-date-picker.d.ts +2 -2
- package/dist/components/ui/core/date-time-pickers/date-picker/use-date-picker.js +51 -36
- package/dist/components/ui/core/date-time-pickers/date-picker/use-date-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.d.ts +11 -13
- package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.js +89 -64
- package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-range-picker/index.d.ts +3 -3
- package/dist/components/ui/core/date-time-pickers/date-range-picker/index.js +3 -0
- package/dist/components/ui/core/date-time-pickers/date-range-picker/index.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-range-picker/types.d.ts +20 -20
- package/dist/components/ui/core/date-time-pickers/date-range-picker/types.js +3 -0
- package/dist/components/ui/core/date-time-pickers/date-range-picker/types.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-range-picker/use-date-range-picker.d.ts +4 -4
- package/dist/components/ui/core/date-time-pickers/date-range-picker/use-date-range-picker.js +95 -60
- package/dist/components/ui/core/date-time-pickers/date-range-picker/use-date-range-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/date-time-picker.d.ts +15 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/date-time-picker.js +120 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/date-time-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/index.d.ts +3 -1
- package/dist/components/ui/core/date-time-pickers/date-time-picker/index.js +3 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/index.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/types.d.ts +25 -32
- package/dist/components/ui/core/date-time-pickers/date-time-picker/types.js +3 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/types.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/use-date-time-picker.d.ts +2 -2
- package/dist/components/ui/core/date-time-pickers/date-time-picker/use-date-time-picker.js +78 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/use-date-time-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.d.ts +13 -15
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.js +165 -119
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/index.d.ts +3 -3
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/index.js +3 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/index.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/types.d.ts +37 -37
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/types.js +3 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/types.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/use-date-time-range-picker.d.ts +3 -3
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/use-date-time-range-picker.js +163 -104
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/use-date-time-range-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/index.d.ts +17 -12
- package/dist/components/ui/core/date-time-pickers/index.js +10 -6
- package/dist/components/ui/core/date-time-pickers/index.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.d.ts +5 -5
- package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.js +52 -42
- package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/constants.d.ts +6 -1
- package/dist/components/ui/core/date-time-pickers/shared/constants.js +23 -0
- package/dist/components/ui/core/date-time-pickers/shared/constants.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.d.ts +16 -15
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.js +87 -64
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/range-input-display.d.ts +10 -9
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/range-input-display.js +89 -38
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/range-input-display.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.d.ts +5 -5
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.js +34 -23
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-date-state.d.ts +23 -23
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-date-state.js +95 -52
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-date-state.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-step-manager.d.ts +5 -5
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-step-manager.js +22 -18
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-step-manager.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-single-date-state.d.ts +19 -19
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-single-date-state.js +41 -24
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-single-date-state.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.d.ts +13 -13
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.js +33 -24
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/scroll-cell-classes.d.ts +5 -5
- package/dist/components/ui/core/date-time-pickers/shared/scroll-cell-classes.js +9 -4
- package/dist/components/ui/core/date-time-pickers/shared/scroll-cell-classes.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.d.ts +13 -9
- package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.js +22 -17
- package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/index.d.ts +2 -2
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/index.js +3 -0
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/index.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.d.ts +13 -13
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.js +49 -40
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-scroll/time-picker-scroll.d.ts +7 -7
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-scroll/time-picker-scroll.js +41 -34
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-scroll/time-picker-scroll.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/index.d.ts +3 -3
- package/dist/components/ui/core/date-time-pickers/time-picker/index.js +3 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/index.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/time-picker.d.ts +12 -14
- package/dist/components/ui/core/date-time-pickers/time-picker/time-picker.js +99 -79
- package/dist/components/ui/core/date-time-pickers/time-picker/time-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/types.d.ts +20 -20
- package/dist/components/ui/core/date-time-pickers/time-picker/types.js +3 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/types.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/use-time-picker.d.ts +2 -2
- package/dist/components/ui/core/date-time-pickers/time-picker/use-time-picker.js +63 -41
- package/dist/components/ui/core/date-time-pickers/time-picker/use-time-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/index.d.ts +3 -1
- package/dist/components/ui/core/date-time-pickers/time-range-picker/index.js +3 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/index.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/time-range-picker.d.ts +14 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/time-range-picker.js +115 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/time-range-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/types.d.ts +30 -36
- package/dist/components/ui/core/date-time-pickers/time-range-picker/types.js +3 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/types.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/use-time-range-picker.d.ts +2 -2
- package/dist/components/ui/core/date-time-pickers/time-range-picker/use-time-range-picker.js +145 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/use-time-range-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/utils/date-input.d.ts +56 -0
- package/dist/components/ui/core/date-time-pickers/utils/date-input.js +67 -0
- package/dist/components/ui/core/date-time-pickers/utils/date-input.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/utils/date-range-utils.d.ts +18 -18
- package/dist/components/ui/core/date-time-pickers/utils/date-range-utils.js +42 -0
- package/dist/components/ui/core/date-time-pickers/utils/date-range-utils.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/utils/format-utils.d.ts +31 -29
- package/dist/components/ui/core/date-time-pickers/utils/format-utils.js +56 -0
- package/dist/components/ui/core/date-time-pickers/utils/format-utils.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/utils/segment-utils.d.ts +21 -21
- package/dist/components/ui/core/date-time-pickers/utils/segment-utils.js +170 -0
- package/dist/components/ui/core/date-time-pickers/utils/segment-utils.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/utils/time-utils.d.ts +28 -28
- package/dist/components/ui/core/date-time-pickers/utils/time-utils.js +88 -7
- package/dist/components/ui/core/date-time-pickers/utils/time-utils.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/utils/time-validation.d.ts +17 -17
- package/dist/components/ui/core/date-time-pickers/utils/time-validation.js +43 -0
- package/dist/components/ui/core/date-time-pickers/utils/time-validation.js.map +1 -0
- package/dist/components/ui/core/dialog/dialog.d.ts +12 -9
- package/dist/components/ui/core/dialog/dialog.js +90 -82
- package/dist/components/ui/core/dialog/dialog.js.map +1 -0
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.d.ts +22 -19
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.js +204 -149
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.js.map +1 -0
- package/dist/components/ui/core/empty-state/empty-state.context.d.ts +4 -4
- package/dist/components/ui/core/empty-state/empty-state.context.js +8 -5
- package/dist/components/ui/core/empty-state/empty-state.context.js.map +1 -0
- package/dist/components/ui/core/empty-state/empty-state.d.ts +14 -14
- package/dist/components/ui/core/empty-state/empty-state.js +96 -82
- package/dist/components/ui/core/empty-state/empty-state.js.map +1 -0
- package/dist/components/ui/core/helper-text/helper-text.d.ts +7 -7
- package/dist/components/ui/core/helper-text/helper-text.js +55 -36
- package/dist/components/ui/core/helper-text/helper-text.js.map +1 -0
- package/dist/components/ui/core/hover-card/hover-card.d.ts +7 -6
- package/dist/components/ui/core/hover-card/hover-card.js +56 -52
- package/dist/components/ui/core/hover-card/hover-card.js.map +1 -0
- package/dist/components/ui/core/inline-citation/inline-citation.d.ts +26 -25
- package/dist/components/ui/core/inline-citation/inline-citation.js +121 -97
- package/dist/components/ui/core/inline-citation/inline-citation.js.map +1 -0
- package/dist/components/ui/core/input/input.d.ts +2 -2
- package/dist/components/ui/core/input/input.js +15 -13
- package/dist/components/ui/core/input/input.js.map +1 -0
- package/dist/components/ui/core/input-group/input-group.d.ts +25 -14
- package/dist/components/ui/core/input-group/input-group.js +149 -76
- package/dist/components/ui/core/input-group/input-group.js.map +1 -0
- package/dist/components/ui/core/item/item.d.ts +20 -0
- package/dist/components/ui/core/item/item.js +93 -0
- package/dist/components/ui/core/item/item.js.map +1 -0
- package/dist/components/ui/core/kbd/kbd.d.ts +3 -3
- package/dist/components/ui/core/kbd/kbd.js +24 -20
- package/dist/components/ui/core/kbd/kbd.js.map +1 -0
- package/dist/components/ui/core/label/label.d.ts +3 -3
- package/dist/components/ui/core/label/label.js +33 -26
- package/dist/components/ui/core/label/label.js.map +1 -0
- package/dist/components/ui/core/loader/loader.d.ts +6 -6
- package/dist/components/ui/core/loader/loader.js +97 -80
- package/dist/components/ui/core/loader/loader.js.map +1 -0
- package/dist/components/ui/core/message/message-response-default-streamdown-controls.d.ts +9 -9
- package/dist/components/ui/core/message/message-response-default-streamdown-controls.js +19 -12
- package/dist/components/ui/core/message/message-response-default-streamdown-controls.js.map +1 -0
- package/dist/components/ui/core/message/message-response-math-plugin.d.ts +3 -0
- package/dist/components/ui/core/message/message-response-math-plugin.js +6 -0
- package/dist/components/ui/core/message/message-response-math-plugin.js.map +1 -0
- package/dist/components/ui/core/message/message.d.ts +27 -23
- package/dist/components/ui/core/message/message.js +453 -316
- package/dist/components/ui/core/message/message.js.map +1 -0
- package/dist/components/ui/core/overflow-list/overflow-list.d.ts +21 -0
- package/dist/components/ui/core/overflow-list/overflow-list.js +197 -0
- package/dist/components/ui/core/overflow-list/overflow-list.js.map +1 -0
- package/dist/components/ui/core/overflow-list/overflow-list.utils.d.ts +37 -35
- package/dist/components/ui/core/overflow-list/overflow-list.utils.js +206 -0
- package/dist/components/ui/core/overflow-list/overflow-list.utils.js.map +1 -0
- package/dist/components/ui/core/pagination/pagination-size-context.d.ts +2 -2
- package/dist/components/ui/core/pagination/pagination-size-context.js +6 -5
- package/dist/components/ui/core/pagination/pagination-size-context.js.map +1 -0
- package/dist/components/ui/core/pagination/pagination-teleport.d.ts +9 -9
- package/dist/components/ui/core/pagination/pagination-teleport.js +127 -84
- package/dist/components/ui/core/pagination/pagination-teleport.js.map +1 -0
- package/dist/components/ui/core/pagination/pagination-teleport.utils.js +6 -6
- package/dist/components/ui/core/pagination/pagination-teleport.utils.js.map +1 -0
- package/dist/components/ui/core/pagination/pagination.d.ts +39 -39
- package/dist/components/ui/core/pagination/pagination.js +294 -234
- package/dist/components/ui/core/pagination/pagination.js.map +1 -0
- package/dist/components/ui/core/popover/popover.d.ts +12 -11
- package/dist/components/ui/core/popover/popover.js +104 -89
- package/dist/components/ui/core/popover/popover.js.map +1 -0
- package/dist/components/ui/core/progress/progress.d.ts +9 -8
- package/dist/components/ui/core/progress/progress.js +50 -35
- package/dist/components/ui/core/progress/progress.js.map +1 -0
- package/dist/components/ui/core/prompt-input/prompt-input.d.ts +27 -27
- package/dist/components/ui/core/prompt-input/prompt-input.js +342 -271
- package/dist/components/ui/core/prompt-input/prompt-input.js.map +1 -0
- package/dist/components/ui/core/radio-group/radio-group.d.ts +12 -12
- package/dist/components/ui/core/radio-group/radio-group.js +88 -58
- package/dist/components/ui/core/radio-group/radio-group.js.map +1 -0
- package/dist/components/ui/core/reasoning/reasoning.d.ts +7 -7
- package/dist/components/ui/core/reasoning/reasoning.js +68 -56
- package/dist/components/ui/core/reasoning/reasoning.js.map +1 -0
- package/dist/components/ui/core/scroll-area/scroll-area.d.ts +4 -4
- package/dist/components/ui/core/scroll-area/scroll-area.js +50 -40
- package/dist/components/ui/core/scroll-area/scroll-area.js.map +1 -0
- package/dist/components/ui/core/search/search.d.ts +8 -8
- package/dist/components/ui/core/search/search.js +122 -76
- package/dist/components/ui/core/search/search.js.map +1 -0
- package/dist/components/ui/core/segmented-control/segmented-control.d.ts +10 -10
- package/dist/components/ui/core/segmented-control/segmented-control.js +203 -149
- package/dist/components/ui/core/segmented-control/segmented-control.js.map +1 -0
- package/dist/components/ui/core/select/select.d.ts +27 -26
- package/dist/components/ui/core/select/select.js +213 -168
- package/dist/components/ui/core/select/select.js.map +1 -0
- package/dist/components/ui/core/separator/separator.d.ts +2 -2
- package/dist/components/ui/core/separator/separator.js +13 -13
- package/dist/components/ui/core/separator/separator.js.map +1 -0
- package/dist/components/ui/core/shimmer/shimmer.d.ts +8 -8
- package/dist/components/ui/core/shimmer/shimmer.js +64 -40
- package/dist/components/ui/core/shimmer/shimmer.js.map +1 -0
- package/dist/components/ui/core/skeleton/skeleton.d.ts +2 -2
- package/dist/components/ui/core/skeleton/skeleton.js +13 -13
- package/dist/components/ui/core/skeleton/skeleton.js.map +1 -0
- package/dist/components/ui/core/slider/slider.d.ts +7 -7
- package/dist/components/ui/core/slider/slider.js +51 -39
- package/dist/components/ui/core/slider/slider.js.map +1 -0
- package/dist/components/ui/core/sonner-toast/sonner-toast.d.ts +2 -2
- package/dist/components/ui/core/sonner-toast/sonner-toast.js +67 -54
- package/dist/components/ui/core/sonner-toast/sonner-toast.js.map +1 -0
- package/dist/components/ui/core/sources/sources.d.ts +12 -12
- package/dist/components/ui/core/sources/sources.js +87 -58
- package/dist/components/ui/core/sources/sources.js.map +1 -0
- package/dist/components/ui/core/switch/switch.d.ts +9 -9
- package/dist/components/ui/core/switch/switch.js +83 -61
- package/dist/components/ui/core/switch/switch.js.map +1 -0
- package/dist/components/ui/core/switch/switch.metadata.d.ts +1 -1
- package/dist/components/ui/core/switch/switch.metadata.js +8 -0
- package/dist/components/ui/core/switch/switch.metadata.js.map +1 -0
- package/dist/components/ui/core/tabs/tabs.d.ts +20 -18
- package/dist/components/ui/core/tabs/tabs.js +176 -147
- package/dist/components/ui/core/tabs/tabs.js.map +1 -0
- package/dist/components/ui/core/tabs/tabs.utils.d.ts +1 -1
- package/dist/components/ui/core/tabs/tabs.utils.js +10 -6
- package/dist/components/ui/core/tabs/tabs.utils.js.map +1 -0
- package/dist/components/ui/core/textarea/textarea.d.ts +2 -2
- package/dist/components/ui/core/textarea/textarea.js +13 -13
- package/dist/components/ui/core/textarea/textarea.js.map +1 -0
- package/dist/components/ui/core/toggle/toggle.d.ts +9 -9
- package/dist/components/ui/core/toggle/toggle.js +60 -54
- package/dist/components/ui/core/toggle/toggle.js.map +1 -0
- package/dist/components/ui/core/tool/tool.d.ts +18 -18
- package/dist/components/ui/core/tool/tool.js +167 -126
- package/dist/components/ui/core/tool/tool.js.map +1 -0
- package/dist/components/ui/core/toolbar/toolbar.d.ts +37 -0
- package/dist/components/ui/core/toolbar/toolbar.js +171 -0
- package/dist/components/ui/core/toolbar/toolbar.js.map +1 -0
- package/dist/components/ui/core/tooltip/tooltip.d.ts +8 -7
- package/dist/components/ui/core/tooltip/tooltip.js +53 -46
- package/dist/components/ui/core/tooltip/tooltip.js.map +1 -0
- package/dist/components/ui/core/topbar/topbar.d.ts +26 -26
- package/dist/components/ui/core/topbar/topbar.js +160 -105
- package/dist/components/ui/core/topbar/topbar.js.map +1 -0
- package/dist/components/ui/core/tree/tree.d.ts +20 -0
- package/dist/components/ui/core/tree/tree.js +100 -0
- package/dist/components/ui/core/tree/tree.js.map +1 -0
- package/dist/eslint/index.d.ts +5 -5
- package/dist/eslint/index.js +9 -5
- package/dist/eslint/index.js.map +1 -0
- package/dist/eslint/no-overriding-styles.d.ts +1 -1
- package/dist/eslint/no-overriding-styles.js +341 -201
- package/dist/eslint/no-overriding-styles.js.map +1 -0
- package/dist/icons/index.d.ts +1 -1
- package/dist/icons/index.js +2 -0
- package/dist/icons/index.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/ai/types.d.ts +43 -43
- package/dist/lib/ai/types.js +3 -0
- package/dist/lib/ai/types.js.map +1 -0
- package/dist/lib/decorative-variant-classes.d.ts +53 -0
- package/dist/lib/decorative-variant-classes.js +58 -0
- package/dist/lib/decorative-variant-classes.js.map +1 -0
- package/dist/lib/highlight-code.d.ts +11 -8
- package/dist/lib/highlight-code.js +58 -40
- package/dist/lib/highlight-code.js.map +1 -0
- package/dist/lib/portal-container-context.d.ts +1 -1
- package/dist/lib/portal-container-context.js +8 -8
- package/dist/lib/portal-container-context.js.map +1 -0
- package/dist/lib/shared-theme-from-url.d.ts +13 -0
- package/dist/lib/shared-theme-from-url.js +61 -0
- package/dist/lib/shared-theme-from-url.js.map +1 -0
- package/dist/lib/style-scope.d.ts +2 -2
- package/dist/lib/style-scope.js +6 -6
- package/dist/lib/style-scope.js.map +1 -0
- package/dist/lib/theme-share-url.d.ts +31 -0
- package/dist/lib/theme-share-url.js +116 -0
- package/dist/lib/theme-share-url.js.map +1 -0
- package/dist/lib/types.d.ts +39 -39
- package/dist/lib/types.js +3 -0
- package/dist/lib/types.js.map +1 -0
- package/dist/lib/use-controllable-state.d.ts +4 -7
- package/dist/lib/use-controllable-state.js +34 -21
- package/dist/lib/use-controllable-state.js.map +1 -0
- package/dist/lib/utils.d.ts +63 -34
- package/dist/lib/utils.js +134 -32
- package/dist/lib/utils.js.map +1 -0
- package/dist/styles.css +2 -1
- package/dist/styles.source.css +24 -12
- package/dist/utils/assign-ref.d.ts +3 -0
- package/dist/utils/assign-ref.js +13 -0
- package/dist/utils/assign-ref.js.map +1 -0
- package/package.json +46 -11
- package/src/components/ui/core/button/button.md +93 -0
package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { FC } from
|
|
2
|
-
import { AmPm } from
|
|
1
|
+
import type { FC } from "react";
|
|
2
|
+
import type { AmPm } from "../../utils/format-utils";
|
|
3
3
|
type TimePickerPanelBaseProps = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
hour: number;
|
|
5
|
+
minute: number;
|
|
6
|
+
onHourChange: (hour: number) => void;
|
|
7
|
+
onMinuteChange: (minute: number) => void;
|
|
8
|
+
className?: string;
|
|
9
9
|
};
|
|
10
10
|
export type TimePickerPanelProps = TimePickerPanelBaseProps & ({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
timeFormat: "12h";
|
|
12
|
+
amPm: AmPm;
|
|
13
|
+
onAmPmChange: (amPm: AmPm) => void;
|
|
14
14
|
} | {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
timeFormat?: "24h";
|
|
16
|
+
amPm?: undefined;
|
|
17
|
+
onAmPmChange?: undefined;
|
|
18
18
|
});
|
|
19
19
|
export declare const TimePickerPanel: FC<TimePickerPanelProps>;
|
|
20
20
|
export {};
|
package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.js
CHANGED
|
@@ -1,41 +1,50 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../../../../../lib/utils.js";
|
|
3
|
+
import { AmPmScroll } from "../am-pm-scroll/am-pm-scroll.js";
|
|
4
|
+
import { TimePickerScroll } from "../time-picker-scroll/time-picker-scroll.js";
|
|
5
|
+
export const TimePickerPanel = (props)=>{
|
|
6
|
+
const { hour, minute, onHourChange, onMinuteChange, className } = props;
|
|
7
|
+
const timeFormat = props.timeFormat ?? '24h';
|
|
8
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
9
|
+
"data-slot": "time-picker-panel",
|
|
10
|
+
className: cn('flex items-stretch', className),
|
|
11
|
+
children: [
|
|
12
|
+
/*#__PURE__*/ _jsx("div", {
|
|
13
|
+
className: "px-3",
|
|
14
|
+
children: /*#__PURE__*/ _jsx(TimePickerScroll, {
|
|
15
|
+
value: hour,
|
|
16
|
+
onChange: onHourChange,
|
|
17
|
+
type: "hour",
|
|
18
|
+
timeFormat: timeFormat
|
|
19
|
+
})
|
|
20
|
+
}),
|
|
21
|
+
/*#__PURE__*/ _jsx("div", {
|
|
22
|
+
className: "w-px bg-border shrink-0 self-stretch"
|
|
23
|
+
}),
|
|
24
|
+
/*#__PURE__*/ _jsx("div", {
|
|
25
|
+
className: "px-3",
|
|
26
|
+
children: /*#__PURE__*/ _jsx(TimePickerScroll, {
|
|
27
|
+
value: minute,
|
|
28
|
+
onChange: onMinuteChange,
|
|
29
|
+
type: "minute"
|
|
30
|
+
})
|
|
31
|
+
}),
|
|
32
|
+
props.timeFormat === '12h' && /*#__PURE__*/ _jsxs(_Fragment, {
|
|
33
|
+
children: [
|
|
34
|
+
/*#__PURE__*/ _jsx("div", {
|
|
35
|
+
className: "w-px bg-border shrink-0 self-stretch"
|
|
36
|
+
}),
|
|
37
|
+
/*#__PURE__*/ _jsx("div", {
|
|
38
|
+
className: "px-3",
|
|
39
|
+
children: /*#__PURE__*/ _jsx(AmPmScroll, {
|
|
40
|
+
value: props.amPm,
|
|
41
|
+
onChange: props.onAmPmChange
|
|
42
|
+
})
|
|
43
|
+
})
|
|
44
|
+
]
|
|
45
|
+
})
|
|
46
|
+
]
|
|
47
|
+
});
|
|
39
48
|
};
|
|
40
|
-
|
|
41
|
-
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=time-picker-panel.js.map
|
package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../src/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.tsx"],"sourcesContent":["import type { FC } from 'react';\n\nimport { cn } from '../../../../../../lib/utils';\nimport type { AmPm } from '../../utils/format-utils';\nimport { AmPmScroll } from '../am-pm-scroll/am-pm-scroll';\nimport { TimePickerScroll } from '../time-picker-scroll/time-picker-scroll';\n\ntype TimePickerPanelBaseProps = {\n hour: number;\n minute: number;\n onHourChange: (hour: number) => void;\n onMinuteChange: (minute: number) => void;\n className?: string;\n};\n\nexport type TimePickerPanelProps = TimePickerPanelBaseProps &\n (\n | {\n timeFormat: '12h';\n amPm: AmPm;\n onAmPmChange: (amPm: AmPm) => void;\n }\n | { timeFormat?: '24h'; amPm?: undefined; onAmPmChange?: undefined }\n );\n\nexport const TimePickerPanel: FC<TimePickerPanelProps> = (props) => {\n const { hour, minute, onHourChange, onMinuteChange, className } = props;\n const timeFormat = props.timeFormat ?? '24h';\n\n return (\n <div\n data-slot=\"time-picker-panel\"\n className={cn('flex items-stretch', className)}\n >\n <div className=\"px-3\">\n <TimePickerScroll\n value={hour}\n onChange={onHourChange}\n type=\"hour\"\n timeFormat={timeFormat}\n />\n </div>\n <div className=\"w-px bg-border shrink-0 self-stretch\" />\n <div className=\"px-3\">\n <TimePickerScroll\n value={minute}\n onChange={onMinuteChange}\n type=\"minute\"\n />\n </div>\n {props.timeFormat === '12h' && (\n <>\n <div className=\"w-px bg-border shrink-0 self-stretch\" />\n <div className=\"px-3\">\n <AmPmScroll value={props.amPm} onChange={props.onAmPmChange} />\n </div>\n </>\n )}\n </div>\n );\n};\n"],"names":["cn","AmPmScroll","TimePickerScroll","TimePickerPanel","props","hour","minute","onHourChange","onMinuteChange","className","timeFormat","div","data-slot","value","onChange","type","amPm","onAmPmChange"],"mappings":";AAEA,SAASA,EAAE,QAAQ,iCAA8B;AAEjD,SAASC,UAAU,QAAQ,kCAA+B;AAC1D,SAASC,gBAAgB,QAAQ,8CAA2C;AAoB5E,OAAO,MAAMC,kBAA4C,CAACC;IACxD,MAAM,EAAEC,IAAI,EAAEC,MAAM,EAAEC,YAAY,EAAEC,cAAc,EAAEC,SAAS,EAAE,GAAGL;IAClE,MAAMM,aAAaN,MAAMM,UAAU,IAAI;IAEvC,qBACE,MAACC;QACCC,aAAU;QACVH,WAAWT,GAAG,sBAAsBS;;0BAEpC,KAACE;gBAAIF,WAAU;0BACb,cAAA,KAACP;oBACCW,OAAOR;oBACPS,UAAUP;oBACVQ,MAAK;oBACLL,YAAYA;;;0BAGhB,KAACC;gBAAIF,WAAU;;0BACf,KAACE;gBAAIF,WAAU;0BACb,cAAA,KAACP;oBACCW,OAAOP;oBACPQ,UAAUN;oBACVO,MAAK;;;YAGRX,MAAMM,UAAU,KAAK,uBACpB;;kCACE,KAACC;wBAAIF,WAAU;;kCACf,KAACE;wBAAIF,WAAU;kCACb,cAAA,KAACR;4BAAWY,OAAOT,MAAMY,IAAI;4BAAEF,UAAUV,MAAMa,YAAY;;;;;;;AAMvE,EAAE"}
|
package/dist/components/ui/core/date-time-pickers/shared/time-picker-scroll/time-picker-scroll.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { FC } from
|
|
2
|
-
import { TimeFormat } from
|
|
1
|
+
import type { FC } from "react";
|
|
2
|
+
import type { TimeFormat } from "../../utils/format-utils";
|
|
3
3
|
export type TimePickerScrollProps = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
value: number | null;
|
|
5
|
+
onChange: (value: number) => void;
|
|
6
|
+
type: "hour" | "minute";
|
|
7
|
+
timeFormat?: TimeFormat;
|
|
8
|
+
className?: string;
|
|
9
9
|
};
|
|
10
10
|
export declare const TimePickerScroll: FC<TimePickerScrollProps>;
|
package/dist/components/ui/core/date-time-pickers/shared/time-picker-scroll/time-picker-scroll.js
CHANGED
|
@@ -1,35 +1,42 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef } from "react";
|
|
3
|
+
import { cn } from "../../../../../../lib/utils.js";
|
|
4
|
+
import { generateHours, generateMinutes } from "../../utils/time-utils.js";
|
|
5
|
+
import { HOURS_IN_12H, MIDNIGHT_HOUR } from "../constants.js";
|
|
6
|
+
import { SCROLL_CONTAINER_CLASSES, SCROLL_ITEM_BASE_CLASSES, SCROLL_ITEM_SELECTED_CLASSES, SCROLL_ITEM_UNSELECTED_CLASSES } from "../scroll-cell-classes.js";
|
|
7
|
+
export const TimePickerScroll = ({ value, onChange, type, timeFormat = '24h', className })=>{
|
|
8
|
+
const scrollContainerRef = useRef(null);
|
|
9
|
+
const selectedItemRef = useRef(null);
|
|
10
|
+
const values = type === 'hour' ? generateHours(timeFormat) : generateMinutes();
|
|
11
|
+
const displayValue = value === null ? null : type === 'hour' && timeFormat === '12h' ? value === MIDNIGHT_HOUR ? HOURS_IN_12H : value > HOURS_IN_12H ? value - HOURS_IN_12H : value : value;
|
|
12
|
+
useEffect(()=>{
|
|
13
|
+
if (value !== null && selectedItemRef.current && scrollContainerRef.current) {
|
|
14
|
+
const container = scrollContainerRef.current;
|
|
15
|
+
const item = selectedItemRef.current;
|
|
16
|
+
container.scrollTo({
|
|
17
|
+
top: item.offsetTop - container.offsetHeight / 2 + item.offsetHeight / 2,
|
|
18
|
+
behavior: 'smooth'
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}, [
|
|
22
|
+
value
|
|
23
|
+
]);
|
|
24
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
25
|
+
"data-slot": "time-picker-scroll",
|
|
26
|
+
ref: scrollContainerRef,
|
|
27
|
+
className: cn(SCROLL_CONTAINER_CLASSES, className),
|
|
28
|
+
children: values.map((timeValue)=>{
|
|
29
|
+
const isSelected = displayValue !== null && timeValue === displayValue;
|
|
30
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
31
|
+
ref: isSelected ? selectedItemRef : undefined,
|
|
32
|
+
className: cn(SCROLL_ITEM_BASE_CLASSES, isSelected ? SCROLL_ITEM_SELECTED_CLASSES : SCROLL_ITEM_UNSELECTED_CLASSES),
|
|
33
|
+
onClick: ()=>onChange(timeValue),
|
|
34
|
+
role: "option",
|
|
35
|
+
"aria-selected": isSelected,
|
|
36
|
+
children: timeValue.toString().padStart(2, '0')
|
|
37
|
+
}, timeValue);
|
|
38
|
+
})
|
|
39
|
+
});
|
|
33
40
|
};
|
|
34
|
-
|
|
35
|
-
|
|
41
|
+
|
|
42
|
+
//# sourceMappingURL=time-picker-scroll.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../src/components/ui/core/date-time-pickers/shared/time-picker-scroll/time-picker-scroll.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useEffect, useRef } from 'react';\n\nimport { cn } from '../../../../../../lib/utils';\nimport type { TimeFormat } from '../../utils/format-utils';\nimport { generateHours, generateMinutes } from '../../utils/time-utils';\nimport { HOURS_IN_12H, MIDNIGHT_HOUR } from '../constants';\nimport {\n SCROLL_CONTAINER_CLASSES,\n SCROLL_ITEM_BASE_CLASSES,\n SCROLL_ITEM_SELECTED_CLASSES,\n SCROLL_ITEM_UNSELECTED_CLASSES,\n} from '../scroll-cell-classes';\n\nexport type TimePickerScrollProps = {\n value: number | null;\n onChange: (value: number) => void;\n type: 'hour' | 'minute';\n timeFormat?: TimeFormat;\n className?: string;\n};\n\nexport const TimePickerScroll: FC<TimePickerScrollProps> = ({\n value,\n onChange,\n type,\n timeFormat = '24h',\n className,\n}) => {\n const scrollContainerRef = useRef<HTMLDivElement>(null);\n const selectedItemRef = useRef<HTMLDivElement>(null);\n\n const values =\n type === 'hour' ? generateHours(timeFormat) : generateMinutes();\n\n const displayValue =\n value === null\n ? null\n : type === 'hour' && timeFormat === '12h'\n ? value === MIDNIGHT_HOUR\n ? HOURS_IN_12H\n : value > HOURS_IN_12H\n ? value - HOURS_IN_12H\n : value\n : value;\n\n useEffect(() => {\n if (\n value !== null &&\n selectedItemRef.current &&\n scrollContainerRef.current\n ) {\n const container = scrollContainerRef.current;\n const item = selectedItemRef.current;\n container.scrollTo({\n top:\n item.offsetTop - container.offsetHeight / 2 + item.offsetHeight / 2,\n behavior: 'smooth',\n });\n }\n }, [value]);\n\n return (\n <div\n data-slot=\"time-picker-scroll\"\n ref={scrollContainerRef}\n className={cn(SCROLL_CONTAINER_CLASSES, className)}\n >\n {values.map((timeValue) => {\n const isSelected = displayValue !== null && timeValue === displayValue;\n return (\n <div\n key={timeValue}\n ref={isSelected ? selectedItemRef : undefined}\n className={cn(\n SCROLL_ITEM_BASE_CLASSES,\n isSelected\n ? SCROLL_ITEM_SELECTED_CLASSES\n : SCROLL_ITEM_UNSELECTED_CLASSES\n )}\n onClick={() => onChange(timeValue)}\n role=\"option\"\n aria-selected={isSelected}\n >\n {timeValue.toString().padStart(2, '0')}\n </div>\n );\n })}\n </div>\n );\n};\n"],"names":["useEffect","useRef","cn","generateHours","generateMinutes","HOURS_IN_12H","MIDNIGHT_HOUR","SCROLL_CONTAINER_CLASSES","SCROLL_ITEM_BASE_CLASSES","SCROLL_ITEM_SELECTED_CLASSES","SCROLL_ITEM_UNSELECTED_CLASSES","TimePickerScroll","value","onChange","type","timeFormat","className","scrollContainerRef","selectedItemRef","values","displayValue","current","container","item","scrollTo","top","offsetTop","offsetHeight","behavior","div","data-slot","ref","map","timeValue","isSelected","undefined","onClick","role","aria-selected","toString","padStart"],"mappings":";AACA,SAASA,SAAS,EAAEC,MAAM,QAAQ,QAAQ;AAE1C,SAASC,EAAE,QAAQ,iCAA8B;AAEjD,SAASC,aAAa,EAAEC,eAAe,QAAQ,4BAAyB;AACxE,SAASC,YAAY,EAAEC,aAAa,QAAQ,kBAAe;AAC3D,SACEC,wBAAwB,EACxBC,wBAAwB,EACxBC,4BAA4B,EAC5BC,8BAA8B,QACzB,4BAAyB;AAUhC,OAAO,MAAMC,mBAA8C,CAAC,EAC1DC,KAAK,EACLC,QAAQ,EACRC,IAAI,EACJC,aAAa,KAAK,EAClBC,SAAS,EACV;IACC,MAAMC,qBAAqBhB,OAAuB;IAClD,MAAMiB,kBAAkBjB,OAAuB;IAE/C,MAAMkB,SACJL,SAAS,SAASX,cAAcY,cAAcX;IAEhD,MAAMgB,eACJR,UAAU,OACN,OACAE,SAAS,UAAUC,eAAe,QAChCH,UAAUN,gBACRD,eACAO,QAAQP,eACNO,QAAQP,eACRO,QACJA;IAERZ,UAAU;QACR,IACEY,UAAU,QACVM,gBAAgBG,OAAO,IACvBJ,mBAAmBI,OAAO,EAC1B;YACA,MAAMC,YAAYL,mBAAmBI,OAAO;YAC5C,MAAME,OAAOL,gBAAgBG,OAAO;YACpCC,UAAUE,QAAQ,CAAC;gBACjBC,KACEF,KAAKG,SAAS,GAAGJ,UAAUK,YAAY,GAAG,IAAIJ,KAAKI,YAAY,GAAG;gBACpEC,UAAU;YACZ;QACF;IACF,GAAG;QAAChB;KAAM;IAEV,qBACE,KAACiB;QACCC,aAAU;QACVC,KAAKd;QACLD,WAAWd,GAAGK,0BAA0BS;kBAEvCG,OAAOa,GAAG,CAAC,CAACC;YACX,MAAMC,aAAad,iBAAiB,QAAQa,cAAcb;YAC1D,qBACE,KAACS;gBAECE,KAAKG,aAAahB,kBAAkBiB;gBACpCnB,WAAWd,GACTM,0BACA0B,aACIzB,+BACAC;gBAEN0B,SAAS,IAAMvB,SAASoB;gBACxBI,MAAK;gBACLC,iBAAeJ;0BAEdD,UAAUM,QAAQ,GAAGC,QAAQ,CAAC,GAAG;eAZ7BP;QAeX;;AAGN,EAAE"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { TimePicker } from
|
|
2
|
-
export type { TimePickerProps, ShortcutItem } from
|
|
3
|
-
export type { UseTimePickerProps, UseTimePickerReturn } from
|
|
1
|
+
export { TimePicker } from "./time-picker";
|
|
2
|
+
export type { TimePickerProps, ShortcutItem } from "./time-picker";
|
|
3
|
+
export type { UseTimePickerProps, UseTimePickerReturn } from "./types";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/components/ui/core/date-time-pickers/time-picker/index.ts"],"sourcesContent":["export { TimePicker } from './time-picker';\nexport type { TimePickerProps, ShortcutItem } from './time-picker';\nexport type { UseTimePickerProps, UseTimePickerReturn } from './types';\n"],"names":["TimePicker"],"mappings":"AAAA,SAASA,UAAU,QAAQ,mBAAgB"}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Dayjs } from
|
|
3
|
-
import { ShortcutItem } from
|
|
4
|
-
import {
|
|
1
|
+
import type { JSX } from "react";
|
|
2
|
+
import type { Dayjs } from "dayjs";
|
|
3
|
+
import type { ShortcutItem } from "../shared/shortcuts-panel/shortcuts-panel";
|
|
4
|
+
import { type DateInput, type DateValueProps } from "../utils/date-input";
|
|
5
|
+
import type { TimeFormat } from "../utils/format-utils";
|
|
5
6
|
export type { ShortcutItem };
|
|
6
|
-
export interface TimePickerProps {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
shortcuts?: ShortcutItem[];
|
|
13
|
-
defaultDate?: Dayjs;
|
|
14
|
-
className?: string;
|
|
7
|
+
export interface TimePickerProps<T extends DateInput = Dayjs> extends DateValueProps<T> {
|
|
8
|
+
timeFormat?: TimeFormat;
|
|
9
|
+
format?: string;
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
shortcuts?: ShortcutItem[];
|
|
12
|
+
className?: string;
|
|
15
13
|
}
|
|
16
|
-
export declare
|
|
14
|
+
export declare function TimePicker<T extends DateInput = Dayjs>({ value, onChange, timeFormat, format, placeholder, shortcuts, defaultDate, valueType, className }: TimePickerProps<T>): JSX.Element;
|
|
@@ -1,79 +1,99 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../../../../lib/utils.js";
|
|
3
|
+
import { Button } from "../../button/button.js";
|
|
4
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../../popover/popover.js";
|
|
5
|
+
import { DateTimeInput } from "../shared/date-time-input/date-time-input.js";
|
|
6
|
+
import { ShortcutsPanel } from "../shared/shortcuts-panel/shortcuts-panel.js";
|
|
7
|
+
import { TimePickerPanel } from "../shared/time-picker-panel/time-picker-panel.js";
|
|
8
|
+
import { normalizeIn, normalizeOut, normalizeShortcutValue, resolveValueType } from "../utils/date-input.js";
|
|
9
|
+
import { useTimePicker } from "./use-time-picker.js";
|
|
10
|
+
export function TimePicker({ value, onChange, timeFormat = '24h', format, placeholder, shortcuts, defaultDate, valueType, className }) {
|
|
11
|
+
const displayFormat = format ?? (timeFormat === '12h' ? 'h:mm A' : 'HH:mm');
|
|
12
|
+
const resolvedType = resolveValueType(value, defaultDate, valueType);
|
|
13
|
+
const djValue = normalizeIn(value);
|
|
14
|
+
const djDefault = defaultDate != null ? normalizeIn(defaultDate) ?? undefined : undefined;
|
|
15
|
+
const handleChange = (time)=>{
|
|
16
|
+
onChange(normalizeOut(time, resolvedType));
|
|
17
|
+
};
|
|
18
|
+
const djShortcuts = shortcuts?.map((shortcut)=>({
|
|
19
|
+
...shortcut,
|
|
20
|
+
getValue: ()=>normalizeShortcutValue(shortcut.getValue())
|
|
21
|
+
}));
|
|
22
|
+
const { isOpen, hour, minute, amPm, displayValue, handleOpenChange, handleApply, handleHourChange, handleMinuteChange, handleAmPmChange, handleApplyShortcut, inputRef, popoverRef } = useTimePicker({
|
|
23
|
+
value: djValue,
|
|
24
|
+
onChange: handleChange,
|
|
25
|
+
timeFormat,
|
|
26
|
+
defaultDate: djDefault
|
|
27
|
+
});
|
|
28
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
29
|
+
"data-slot": "time-picker",
|
|
30
|
+
className: cn('relative w-full', className),
|
|
31
|
+
children: /*#__PURE__*/ _jsxs(Popover, {
|
|
32
|
+
open: isOpen,
|
|
33
|
+
onOpenChange: handleOpenChange,
|
|
34
|
+
children: [
|
|
35
|
+
/*#__PURE__*/ _jsx(PopoverTrigger, {
|
|
36
|
+
render: /*#__PURE__*/ _jsx("div", {
|
|
37
|
+
ref: inputRef,
|
|
38
|
+
className: "w-full"
|
|
39
|
+
}),
|
|
40
|
+
children: /*#__PURE__*/ _jsx(DateTimeInput, {
|
|
41
|
+
value: displayValue,
|
|
42
|
+
format: displayFormat,
|
|
43
|
+
placeholder: placeholder,
|
|
44
|
+
isOpen: isOpen,
|
|
45
|
+
variant: "time",
|
|
46
|
+
ariaLabel: "Time picker"
|
|
47
|
+
})
|
|
48
|
+
}),
|
|
49
|
+
/*#__PURE__*/ _jsx(PopoverContent, {
|
|
50
|
+
ref: popoverRef,
|
|
51
|
+
className: "rounded-xl w-auto p-0",
|
|
52
|
+
side: "bottom",
|
|
53
|
+
align: "start",
|
|
54
|
+
children: /*#__PURE__*/ _jsxs("div", {
|
|
55
|
+
"data-slot": "time-picker-content",
|
|
56
|
+
className: "flex flex-col",
|
|
57
|
+
children: [
|
|
58
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
59
|
+
className: "flex flex-row",
|
|
60
|
+
children: [
|
|
61
|
+
djShortcuts && djShortcuts.length > 0 && /*#__PURE__*/ _jsx(ShortcutsPanel, {
|
|
62
|
+
shortcuts: djShortcuts,
|
|
63
|
+
onShortcutClick: handleApplyShortcut
|
|
64
|
+
}),
|
|
65
|
+
timeFormat === '12h' ? /*#__PURE__*/ _jsx(TimePickerPanel, {
|
|
66
|
+
hour: hour,
|
|
67
|
+
minute: minute,
|
|
68
|
+
amPm: amPm,
|
|
69
|
+
timeFormat: "12h",
|
|
70
|
+
onHourChange: handleHourChange,
|
|
71
|
+
onMinuteChange: handleMinuteChange,
|
|
72
|
+
onAmPmChange: handleAmPmChange
|
|
73
|
+
}) : /*#__PURE__*/ _jsx(TimePickerPanel, {
|
|
74
|
+
hour: hour,
|
|
75
|
+
minute: minute,
|
|
76
|
+
timeFormat: "24h",
|
|
77
|
+
onHourChange: handleHourChange,
|
|
78
|
+
onMinuteChange: handleMinuteChange
|
|
79
|
+
})
|
|
80
|
+
]
|
|
81
|
+
}),
|
|
82
|
+
/*#__PURE__*/ _jsx("div", {
|
|
83
|
+
className: "flex p-2 border-t border-default",
|
|
84
|
+
children: /*#__PURE__*/ _jsx(Button, {
|
|
85
|
+
variant: "secondary",
|
|
86
|
+
className: "w-full",
|
|
87
|
+
onClick: handleApply,
|
|
88
|
+
children: "Apply"
|
|
89
|
+
})
|
|
90
|
+
})
|
|
91
|
+
]
|
|
92
|
+
})
|
|
93
|
+
})
|
|
94
|
+
]
|
|
95
|
+
})
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
//# sourceMappingURL=time-picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/components/ui/core/date-time-pickers/time-picker/time-picker.tsx"],"sourcesContent":["import type { JSX } from 'react';\n\nimport type { Dayjs } from 'dayjs';\n\nimport { cn } from '../../../../../lib/utils';\nimport { Button } from '../../button/button';\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 DateValueProps,\n normalizeIn,\n normalizeOut,\n normalizeShortcutValue,\n resolveValueType,\n} from '../utils/date-input';\nimport type { TimeFormat } from '../utils/format-utils';\n\nimport { useTimePicker } from './use-time-picker';\n\nexport type { ShortcutItem };\n\nexport interface TimePickerProps<\n T extends DateInput = Dayjs,\n> extends DateValueProps<T> {\n timeFormat?: TimeFormat;\n format?: string;\n placeholder?: string;\n shortcuts?: ShortcutItem[];\n className?: string;\n}\n\nexport function TimePicker<T extends DateInput = Dayjs>({\n value,\n onChange,\n timeFormat = '24h',\n format,\n placeholder,\n shortcuts,\n defaultDate,\n valueType,\n className,\n}: TimePickerProps<T>): JSX.Element {\n const displayFormat = format ?? (timeFormat === '12h' ? 'h:mm A' : 'HH:mm');\n const resolvedType = resolveValueType(value, defaultDate, valueType);\n const djValue = normalizeIn(value);\n const djDefault =\n defaultDate != null ? (normalizeIn(defaultDate) ?? undefined) : undefined;\n\n const handleChange = (time: Dayjs | null) => {\n onChange(normalizeOut<T>(time, resolvedType));\n };\n\n const djShortcuts = shortcuts?.map((shortcut) => ({\n ...shortcut,\n getValue: () => normalizeShortcutValue(shortcut.getValue()),\n }));\n\n const {\n isOpen,\n hour,\n minute,\n amPm,\n displayValue,\n handleOpenChange,\n handleApply,\n handleHourChange,\n handleMinuteChange,\n handleAmPmChange,\n handleApplyShortcut,\n inputRef,\n popoverRef,\n } = useTimePicker({\n value: djValue,\n onChange: handleChange,\n timeFormat,\n defaultDate: djDefault,\n });\n\n return (\n <div data-slot=\"time-picker\" className={cn('relative w-full', className)}>\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=\"time\"\n ariaLabel=\"Time picker\"\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 data-slot=\"time-picker-content\" className=\"flex flex-col\">\n <div className=\"flex flex-row\">\n {djShortcuts && djShortcuts.length > 0 && (\n <ShortcutsPanel\n shortcuts={djShortcuts}\n onShortcutClick={handleApplyShortcut}\n />\n )}\n {timeFormat === '12h' ? (\n <TimePickerPanel\n hour={hour}\n minute={minute}\n amPm={amPm}\n timeFormat=\"12h\"\n onHourChange={handleHourChange}\n onMinuteChange={handleMinuteChange}\n onAmPmChange={handleAmPmChange}\n />\n ) : (\n <TimePickerPanel\n hour={hour}\n minute={minute}\n timeFormat=\"24h\"\n onHourChange={handleHourChange}\n onMinuteChange={handleMinuteChange}\n />\n )}\n </div>\n <div className=\"flex p-2 border-t border-default\">\n <Button\n variant=\"secondary\"\n className=\"w-full\"\n onClick={handleApply}\n >\n Apply\n </Button>\n </div>\n </div>\n </PopoverContent>\n </Popover>\n </div>\n );\n}\n"],"names":["cn","Button","Popover","PopoverContent","PopoverTrigger","DateTimeInput","ShortcutsPanel","TimePickerPanel","normalizeIn","normalizeOut","normalizeShortcutValue","resolveValueType","useTimePicker","TimePicker","value","onChange","timeFormat","format","placeholder","shortcuts","defaultDate","valueType","className","displayFormat","resolvedType","djValue","djDefault","undefined","handleChange","time","djShortcuts","map","shortcut","getValue","isOpen","hour","minute","amPm","displayValue","handleOpenChange","handleApply","handleHourChange","handleMinuteChange","handleAmPmChange","handleApplyShortcut","inputRef","popoverRef","div","data-slot","open","onOpenChange","render","ref","variant","ariaLabel","side","align","length","onShortcutClick","onHourChange","onMinuteChange","onAmPmChange","onClick"],"mappings":";AAIA,SAASA,EAAE,QAAQ,8BAA2B;AAC9C,SAASC,MAAM,QAAQ,yBAAsB;AAC7C,SAASC,OAAO,EAAEC,cAAc,EAAEC,cAAc,QAAQ,2BAAwB;AAChF,SAASC,aAAa,QAAQ,+CAA4C;AAC1E,SAASC,cAAc,QAAQ,+CAA4C;AAE3E,SAASC,eAAe,QAAQ,mDAAgD;AAChF,SAGEC,WAAW,EACXC,YAAY,EACZC,sBAAsB,EACtBC,gBAAgB,QACX,yBAAsB;AAG7B,SAASC,aAAa,QAAQ,uBAAoB;AAclD,OAAO,SAASC,WAAwC,EACtDC,KAAK,EACLC,QAAQ,EACRC,aAAa,KAAK,EAClBC,MAAM,EACNC,WAAW,EACXC,SAAS,EACTC,WAAW,EACXC,SAAS,EACTC,SAAS,EACU;IACnB,MAAMC,gBAAgBN,UAAWD,CAAAA,eAAe,QAAQ,WAAW,OAAM;IACzE,MAAMQ,eAAeb,iBAAiBG,OAAOM,aAAaC;IAC1D,MAAMI,UAAUjB,YAAYM;IAC5B,MAAMY,YACJN,eAAe,OAAQZ,YAAYY,gBAAgBO,YAAaA;IAElE,MAAMC,eAAe,CAACC;QACpBd,SAASN,aAAgBoB,MAAML;IACjC;IAEA,MAAMM,cAAcX,WAAWY,IAAI,CAACC,WAAc,CAAA;YAChD,GAAGA,QAAQ;YACXC,UAAU,IAAMvB,uBAAuBsB,SAASC,QAAQ;QAC1D,CAAA;IAEA,MAAM,EACJC,MAAM,EACNC,IAAI,EACJC,MAAM,EACNC,IAAI,EACJC,YAAY,EACZC,gBAAgB,EAChBC,WAAW,EACXC,gBAAgB,EAChBC,kBAAkB,EAClBC,gBAAgB,EAChBC,mBAAmB,EACnBC,QAAQ,EACRC,UAAU,EACX,GAAGlC,cAAc;QAChBE,OAAOW;QACPV,UAAUa;QACVZ;QACAI,aAAaM;IACf;IAEA,qBACE,KAACqB;QAAIC,aAAU;QAAc1B,WAAWtB,GAAG,mBAAmBsB;kBAC5D,cAAA,MAACpB;YAAQ+C,MAAMf;YAAQgB,cAAcX;;8BACnC,KAACnC;oBAAe+C,sBAAQ,KAACJ;wBAAIK,KAAKP;wBAAUvB,WAAU;;8BACpD,cAAA,KAACjB;wBACCS,OAAOwB;wBACPrB,QAAQM;wBACRL,aAAaA;wBACbgB,QAAQA;wBACRmB,SAAQ;wBACRC,WAAU;;;8BAGd,KAACnD;oBACCiD,KAAKN;oBACLxB,WAAU;oBACViC,MAAK;oBACLC,OAAM;8BAEN,cAAA,MAACT;wBAAIC,aAAU;wBAAsB1B,WAAU;;0CAC7C,MAACyB;gCAAIzB,WAAU;;oCACZQ,eAAeA,YAAY2B,MAAM,GAAG,mBACnC,KAACnD;wCACCa,WAAWW;wCACX4B,iBAAiBd;;oCAGpB5B,eAAe,sBACd,KAACT;wCACC4B,MAAMA;wCACNC,QAAQA;wCACRC,MAAMA;wCACNrB,YAAW;wCACX2C,cAAclB;wCACdmB,gBAAgBlB;wCAChBmB,cAAclB;uDAGhB,KAACpC;wCACC4B,MAAMA;wCACNC,QAAQA;wCACRpB,YAAW;wCACX2C,cAAclB;wCACdmB,gBAAgBlB;;;;0CAItB,KAACK;gCAAIzB,WAAU;0CACb,cAAA,KAACrB;oCACCoD,SAAQ;oCACR/B,WAAU;oCACVwC,SAAStB;8CACV;;;;;;;;;AASf"}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { Dayjs } from
|
|
2
|
-
import { ShortcutValueDayjs } from
|
|
3
|
-
import { AmPm, TimeFormat } from
|
|
1
|
+
import type { Dayjs } from "dayjs";
|
|
2
|
+
import type { ShortcutValueDayjs } from "../shared/shortcuts-panel/shortcuts-panel";
|
|
3
|
+
import type { AmPm, TimeFormat } from "../utils/format-utils";
|
|
4
4
|
export interface UseTimePickerProps {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
value: Dayjs | null;
|
|
6
|
+
onChange: (time: Dayjs | null) => void;
|
|
7
|
+
timeFormat?: TimeFormat;
|
|
8
|
+
defaultDate?: Dayjs;
|
|
9
9
|
}
|
|
10
10
|
export interface UseTimePickerReturn {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
11
|
+
isOpen: boolean;
|
|
12
|
+
hour: number;
|
|
13
|
+
minute: number;
|
|
14
|
+
amPm: AmPm;
|
|
15
|
+
displayValue: Dayjs | null;
|
|
16
|
+
handleOpenChange: (open: boolean) => void;
|
|
17
|
+
handleApply: () => void;
|
|
18
|
+
handleHourChange: (hour: number) => void;
|
|
19
|
+
handleMinuteChange: (minute: number) => void;
|
|
20
|
+
handleAmPmChange: (amPm: AmPm) => void;
|
|
21
|
+
handleApplyShortcut: (shortcutValue: ShortcutValueDayjs) => void;
|
|
22
|
+
inputRef: React.RefObject<HTMLDivElement>;
|
|
23
|
+
popoverRef: React.RefObject<HTMLDivElement>;
|
|
24
24
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/components/ui/core/date-time-pickers/time-picker/types.ts"],"sourcesContent":["import type { Dayjs } from 'dayjs';\n\nimport type { ShortcutValueDayjs } from '../shared/shortcuts-panel/shortcuts-panel';\nimport type { AmPm, TimeFormat } from '../utils/format-utils';\n\nexport interface UseTimePickerProps {\n value: Dayjs | null;\n onChange: (time: Dayjs | null) => void;\n timeFormat?: TimeFormat;\n defaultDate?: Dayjs;\n}\n\nexport interface UseTimePickerReturn {\n isOpen: boolean;\n hour: number;\n minute: number;\n amPm: AmPm;\n displayValue: Dayjs | null;\n handleOpenChange: (open: boolean) => void;\n handleApply: () => void;\n handleHourChange: (hour: number) => void;\n handleMinuteChange: (minute: number) => void;\n handleAmPmChange: (amPm: AmPm) => void;\n handleApplyShortcut: (shortcutValue: ShortcutValueDayjs) => void;\n inputRef: React.RefObject<HTMLDivElement>;\n popoverRef: React.RefObject<HTMLDivElement>;\n}\n"],"names":[],"mappings":"AAYA,WAcC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { UseTimePickerProps, UseTimePickerReturn } from
|
|
1
|
+
import type { UseTimePickerProps, UseTimePickerReturn } from "./types";
|
|
2
2
|
export type { UseTimePickerProps, UseTimePickerReturn };
|
|
3
|
-
export declare const useTimePicker: ({ value, onChange, timeFormat, defaultDate
|
|
3
|
+
export declare const useTimePicker: ({ value, onChange, timeFormat, defaultDate }: UseTimePickerProps) => UseTimePickerReturn;
|