@cascivo/react 1.0.0 → 1.2.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/README.md +5 -4
- package/dist/accordion/accordion.js +1 -114
- package/dist/accordion/accordion.module.js +1 -10
- package/dist/action-sheet/action-sheet.css +1 -1
- package/dist/action-sheet/action-sheet.js +1 -91
- package/dist/action-sheet/action-sheet.module.js +1 -12
- package/dist/alert/alert.js +1 -55
- package/dist/alert/alert.module.js +1 -11
- package/dist/alert-dialog/alert-dialog.css +1 -1
- package/dist/alert-dialog/alert-dialog.js +1 -66
- package/dist/alert-dialog/alert-dialog.module.js +1 -11
- package/dist/app-shell/app-shell.css +1 -1
- package/dist/app-shell/app-shell.js +1 -85
- package/dist/app-shell/app-shell.module.js +1 -12
- package/dist/aspect-ratio/aspect-ratio.js +1 -20
- package/dist/aspect-ratio/aspect-ratio.module.js +1 -6
- package/dist/avatar/avatar.js +1 -57
- package/dist/avatar/avatar.module.js +1 -8
- package/dist/avatar-group/avatar-group.js +1 -24
- package/dist/avatar-group/avatar-group.module.js +1 -6
- package/dist/badge/badge.js +1 -22
- package/dist/badge/badge.module.js +1 -3
- package/dist/blockquote/blockquote.js +1 -16
- package/dist/blockquote/blockquote.module.js +1 -6
- package/dist/bottom-sheet/bottom-sheet.js +1 -111
- package/dist/bottom-sheet/bottom-sheet.module.js +1 -14
- package/dist/brand/logo/logo.css +1 -0
- package/dist/brand/logo/logo.js +1 -0
- package/dist/brand/logo/logo.module.js +2 -0
- package/dist/breadcrumb/breadcrumb.js +1 -28
- package/dist/breadcrumb/breadcrumb.module.js +1 -3
- package/dist/button/button.css +1 -1
- package/dist/button/button.js +1 -35
- package/dist/button/button.module.js +1 -6
- package/dist/button-group/button-group.js +1 -39
- package/dist/button-group/button-group.module.js +1 -3
- package/dist/calendar/calendar-date.js +1 -0
- package/dist/calendar/calendar.css +1 -1
- package/dist/calendar/calendar.js +1 -199
- package/dist/calendar/calendar.module.js +1 -14
- package/dist/card/card.js +1 -53
- package/dist/card/card.module.js +1 -12
- package/dist/carousel/carousel.css +1 -1
- package/dist/carousel/carousel.js +1 -138
- package/dist/carousel/carousel.module.js +1 -13
- package/dist/chat-bubble/chat-bubble.js +1 -31
- package/dist/chat-bubble/chat-bubble.module.js +1 -11
- package/dist/checkbox/checkbox.js +1 -39
- package/dist/checkbox/checkbox.module.js +1 -8
- package/dist/checkbox-card/checkbox-card.css +1 -1
- package/dist/checkbox-card/checkbox-card.js +1 -50
- package/dist/checkbox-card/checkbox-card.module.js +1 -11
- package/dist/code/code.js +1 -14
- package/dist/code/code.module.js +1 -3
- package/dist/code-snippet/code-snippet.js +2 -121
- package/dist/code-snippet/code-snippet.module.js +1 -17
- package/dist/code-snippet/highlight.js +1 -67
- package/dist/collapsible/collapsible.js +1 -47
- package/dist/collapsible/collapsible.module.js +1 -7
- package/dist/color-picker/color-picker.css +1 -1
- package/dist/color-picker/color-picker.js +1 -272
- package/dist/color-picker/color-picker.module.js +1 -18
- package/dist/color-picker/color.js +1 -0
- package/dist/combobox/combobox.css +1 -1
- package/dist/combobox/combobox.js +1 -170
- package/dist/combobox/combobox.module.js +1 -19
- package/dist/combobox/list-nav.js +1 -0
- package/dist/combobox/option-list.js +1 -0
- package/dist/command-menu/command-menu.js +1 -421
- package/dist/command-menu/command-menu.module.js +1 -34
- package/dist/comparison/comparison.js +1 -69
- package/dist/comparison/comparison.module.js +1 -9
- package/dist/contained-list/contained-list.js +1 -41
- package/dist/contained-list/contained-list.module.js +1 -11
- package/dist/context-menu/context-menu.js +1 -93
- package/dist/context-menu/context-menu.module.js +1 -7
- package/dist/copy-button/copy-button.js +1 -60
- package/dist/copy-button/copy-button.module.js +1 -6
- package/dist/data-list/data-list.js +1 -25
- package/dist/data-list/data-list.module.js +1 -8
- package/dist/data-table/column-filter.js +1 -0
- package/dist/data-table/column-layout.js +1 -0
- package/dist/data-table/data-table.css +1 -1
- package/dist/data-table/data-table.js +1 -398
- package/dist/data-table/data-table.module.js +1 -33
- package/dist/data-table/grid-keys.js +1 -0
- package/dist/data-table/row-group.js +1 -0
- package/dist/data-table/row-search.js +1 -0
- package/dist/data-table/row-sort.js +1 -0
- package/dist/data-table/to-csv.js +3 -0
- package/dist/data-table/virtual-window.js +1 -0
- package/dist/date-picker/date-picker.css +1 -1
- package/dist/date-picker/date-picker.js +1 -224
- package/dist/date-picker/date-picker.module.js +1 -23
- package/dist/date-picker/parse-date.js +1 -0
- package/dist/date-range-picker/date-range-picker.js +1 -196
- package/dist/date-range-picker/date-range-picker.module.js +1 -18
- package/dist/dock/dock.css +1 -1
- package/dist/dock/dock.js +1 -34
- package/dist/dock/dock.module.js +1 -8
- package/dist/drawer/drawer.js +1 -96
- package/dist/drawer/drawer.module.js +1 -13
- package/dist/dropdown/dropdown.css +1 -1
- package/dist/dropdown/dropdown.js +1 -110
- package/dist/dropdown/dropdown.module.js +1 -9
- package/dist/editable/editable.js +1 -76
- package/dist/editable/editable.module.js +1 -11
- package/dist/empty-state/empty-state.js +1 -32
- package/dist/empty-state/empty-state.module.js +1 -9
- package/dist/fab/fab.css +1 -1
- package/dist/fab/fab.js +1 -93
- package/dist/fab/fab.module.js +1 -12
- package/dist/field/field.css +1 -1
- package/dist/field/field.js +1 -53
- package/dist/field/field.module.js +1 -7
- package/dist/file-uploader/file-uploader.css +1 -1
- package/dist/file-uploader/file-uploader.js +1 -123
- package/dist/file-uploader/file-uploader.module.js +1 -18
- package/dist/filter/filter.css +1 -1
- package/dist/filter/filter.js +1 -35
- package/dist/filter/filter.module.js +1 -6
- package/dist/form/form.js +1 -95
- package/dist/form/form.module.js +1 -3
- package/dist/header/header.js +1 -44
- package/dist/header/header.module.js +1 -11
- package/dist/header-panel/header-panel.js +1 -72
- package/dist/header-panel/header-panel.module.js +1 -9
- package/dist/heading/heading.css +1 -1
- package/dist/heading/heading.js +1 -22
- package/dist/heading/heading.module.js +1 -3
- package/dist/hover-card/hover-card.css +1 -1
- package/dist/hover-card/hover-card.js +1 -84
- package/dist/hover-card/hover-card.module.js +1 -6
- package/dist/icon-button/icon-button.js +1 -19
- package/dist/icon-button/icon-button.module.js +1 -3
- package/dist/image/image.css +1 -1
- package/dist/image/image.js +1 -64
- package/dist/image/image.module.js +1 -9
- package/dist/index.d.ts +1521 -38
- package/dist/indicator/indicator.js +1 -16
- package/dist/indicator/indicator.module.js +1 -6
- package/dist/infinite-scroll/infinite-scroll.js +1 -49
- package/dist/infinite-scroll/infinite-scroll.module.js +1 -7
- package/dist/inline-loading/inline-loading.js +1 -74
- package/dist/inline-loading/inline-loading.module.js +1 -9
- package/dist/input/input.css +1 -1
- package/dist/input/input.js +1 -56
- package/dist/input/input.module.js +1 -9
- package/dist/input-group/input-group.css +1 -1
- package/dist/input-group/input-group.js +1 -39
- package/dist/input-group/input-group.module.js +1 -9
- package/dist/item/item.js +1 -50
- package/dist/item/item.module.js +1 -10
- package/dist/join/join.js +1 -12
- package/dist/join/join.module.js +1 -3
- package/dist/kbd/kbd.js +1 -14
- package/dist/kbd/kbd.module.js +1 -3
- package/dist/label/label.js +1 -23
- package/dist/label/label.module.js +1 -7
- package/dist/large-title-header/large-title-header.js +1 -38
- package/dist/large-title-header/large-title-header.module.js +1 -12
- package/dist/layouts/src/auto-grid/auto-grid.js +1 -17
- package/dist/layouts/src/auto-grid/auto-grid.module.js +1 -4
- package/dist/layouts/src/center/center.js +1 -16
- package/dist/layouts/src/center/center.module.js +1 -3
- package/dist/layouts/src/columns/columns.js +1 -21
- package/dist/layouts/src/columns/columns.module.js +1 -6
- package/dist/layouts/src/flex/flex.css +1 -1
- package/dist/layouts/src/flex/flex.js +1 -20
- package/dist/layouts/src/flex/flex.module.js +1 -3
- package/dist/layouts/src/grid/grid.css +1 -1
- package/dist/layouts/src/grid/grid.js +1 -55
- package/dist/layouts/src/grid/grid.module.js +1 -7
- package/dist/layouts/src/page-header/page-header.js +1 -31
- package/dist/layouts/src/page-header/page-header.module.js +1 -10
- package/dist/layouts/src/spacer/spacer.js +1 -17
- package/dist/layouts/src/spacer/spacer.module.js +1 -3
- package/dist/link/link.css +1 -1
- package/dist/link/link.js +1 -22
- package/dist/link/link.module.js +1 -3
- package/dist/list/list.js +1 -21
- package/dist/list/list.module.js +1 -6
- package/dist/log-viewer/log-viewer.css +1 -1
- package/dist/log-viewer/log-viewer.js +2 -184
- package/dist/log-viewer/log-viewer.module.js +1 -16
- package/dist/menu/menu.js +1 -126
- package/dist/menu/menu.module.js +1 -8
- package/dist/menu-button/menu-button.js +1 -92
- package/dist/menu-button/menu-button.module.js +1 -8
- package/dist/menubar/menubar.js +1 -103
- package/dist/menubar/menubar.module.js +1 -8
- package/dist/modal/modal.css +1 -1
- package/dist/modal/modal.js +1 -76
- package/dist/modal/modal.module.js +1 -12
- package/dist/multi-select/list-nav.js +1 -0
- package/dist/multi-select/multi-select.css +1 -1
- package/dist/multi-select/multi-select.js +1 -106
- package/dist/multi-select/multi-select.module.js +1 -15
- package/dist/multi-select/option-list.js +1 -0
- package/dist/native-select/native-select.css +1 -1
- package/dist/native-select/native-select.js +1 -37
- package/dist/native-select/native-select.module.js +1 -7
- package/dist/navigation-menu/navigation-menu.js +1 -99
- package/dist/navigation-menu/navigation-menu.module.js +1 -10
- package/dist/node/accordion/accordion.js +1 -114
- package/dist/node/accordion/accordion.module.js +1 -10
- package/dist/node/action-sheet/action-sheet.js +1 -91
- package/dist/node/action-sheet/action-sheet.module.js +1 -12
- package/dist/node/alert/alert.js +1 -55
- package/dist/node/alert/alert.module.js +1 -11
- package/dist/node/alert-dialog/alert-dialog.js +1 -66
- package/dist/node/alert-dialog/alert-dialog.module.js +1 -11
- package/dist/node/app-shell/app-shell.js +1 -85
- package/dist/node/app-shell/app-shell.module.js +1 -12
- package/dist/node/aspect-ratio/aspect-ratio.js +1 -20
- package/dist/node/aspect-ratio/aspect-ratio.module.js +1 -6
- package/dist/node/avatar/avatar.js +1 -57
- package/dist/node/avatar/avatar.module.js +1 -8
- package/dist/node/avatar-group/avatar-group.js +1 -24
- package/dist/node/avatar-group/avatar-group.module.js +1 -6
- package/dist/node/badge/badge.js +1 -22
- package/dist/node/badge/badge.module.js +1 -3
- package/dist/node/blockquote/blockquote.js +1 -16
- package/dist/node/blockquote/blockquote.module.js +1 -6
- package/dist/node/bottom-sheet/bottom-sheet.js +1 -111
- package/dist/node/bottom-sheet/bottom-sheet.module.js +1 -14
- package/dist/node/brand/logo/logo.js +1 -0
- package/dist/node/brand/logo/logo.module.js +1 -0
- package/dist/node/breadcrumb/breadcrumb.js +1 -28
- package/dist/node/breadcrumb/breadcrumb.module.js +1 -3
- package/dist/node/button/button.js +1 -35
- package/dist/node/button/button.module.js +1 -6
- package/dist/node/button-group/button-group.js +1 -39
- package/dist/node/button-group/button-group.module.js +1 -3
- package/dist/node/calendar/calendar-date.js +1 -0
- package/dist/node/calendar/calendar.js +1 -199
- package/dist/node/calendar/calendar.module.js +1 -14
- package/dist/node/card/card.js +1 -53
- package/dist/node/card/card.module.js +1 -12
- package/dist/node/carousel/carousel.js +1 -138
- package/dist/node/carousel/carousel.module.js +1 -13
- package/dist/node/chat-bubble/chat-bubble.js +1 -31
- package/dist/node/chat-bubble/chat-bubble.module.js +1 -11
- package/dist/node/checkbox/checkbox.js +1 -39
- package/dist/node/checkbox/checkbox.module.js +1 -8
- package/dist/node/checkbox-card/checkbox-card.js +1 -50
- package/dist/node/checkbox-card/checkbox-card.module.js +1 -11
- package/dist/node/code/code.js +1 -14
- package/dist/node/code/code.module.js +1 -3
- package/dist/node/code-snippet/code-snippet.js +2 -121
- package/dist/node/code-snippet/code-snippet.module.js +1 -17
- package/dist/node/code-snippet/highlight.js +1 -67
- package/dist/node/collapsible/collapsible.js +1 -47
- package/dist/node/collapsible/collapsible.module.js +1 -7
- package/dist/node/color-picker/color-picker.js +1 -272
- package/dist/node/color-picker/color-picker.module.js +1 -18
- package/dist/node/color-picker/color.js +1 -0
- package/dist/node/combobox/combobox.js +1 -170
- package/dist/node/combobox/combobox.module.js +1 -19
- package/dist/node/combobox/list-nav.js +1 -0
- package/dist/node/combobox/option-list.js +1 -0
- package/dist/node/command-menu/command-menu.js +1 -421
- package/dist/node/command-menu/command-menu.module.js +1 -34
- package/dist/node/comparison/comparison.js +1 -69
- package/dist/node/comparison/comparison.module.js +1 -9
- package/dist/node/contained-list/contained-list.js +1 -41
- package/dist/node/contained-list/contained-list.module.js +1 -11
- package/dist/node/context-menu/context-menu.js +1 -93
- package/dist/node/context-menu/context-menu.module.js +1 -7
- package/dist/node/copy-button/copy-button.js +1 -60
- package/dist/node/copy-button/copy-button.module.js +1 -6
- package/dist/node/data-list/data-list.js +1 -25
- package/dist/node/data-list/data-list.module.js +1 -8
- package/dist/node/data-table/column-filter.js +1 -0
- package/dist/node/data-table/column-layout.js +1 -0
- package/dist/node/data-table/data-table.js +1 -398
- package/dist/node/data-table/data-table.module.js +1 -33
- package/dist/node/data-table/grid-keys.js +1 -0
- package/dist/node/data-table/row-group.js +1 -0
- package/dist/node/data-table/row-search.js +1 -0
- package/dist/node/data-table/row-sort.js +1 -0
- package/dist/node/data-table/to-csv.js +3 -0
- package/dist/node/data-table/virtual-window.js +1 -0
- package/dist/node/date-picker/date-picker.js +1 -224
- package/dist/node/date-picker/date-picker.module.js +1 -23
- package/dist/node/date-picker/parse-date.js +1 -0
- package/dist/node/date-range-picker/date-range-picker.js +1 -196
- package/dist/node/date-range-picker/date-range-picker.module.js +1 -18
- package/dist/node/dock/dock.js +1 -34
- package/dist/node/dock/dock.module.js +1 -8
- package/dist/node/drawer/drawer.js +1 -96
- package/dist/node/drawer/drawer.module.js +1 -13
- package/dist/node/dropdown/dropdown.js +1 -110
- package/dist/node/dropdown/dropdown.module.js +1 -9
- package/dist/node/editable/editable.js +1 -76
- package/dist/node/editable/editable.module.js +1 -11
- package/dist/node/empty-state/empty-state.js +1 -32
- package/dist/node/empty-state/empty-state.module.js +1 -9
- package/dist/node/fab/fab.js +1 -93
- package/dist/node/fab/fab.module.js +1 -12
- package/dist/node/field/field.js +1 -53
- package/dist/node/field/field.module.js +1 -7
- package/dist/node/file-uploader/file-uploader.js +1 -123
- package/dist/node/file-uploader/file-uploader.module.js +1 -18
- package/dist/node/filter/filter.js +1 -35
- package/dist/node/filter/filter.module.js +1 -6
- package/dist/node/form/form.js +1 -95
- package/dist/node/form/form.module.js +1 -3
- package/dist/node/header/header.js +1 -44
- package/dist/node/header/header.module.js +1 -11
- package/dist/node/header-panel/header-panel.js +1 -72
- package/dist/node/header-panel/header-panel.module.js +1 -9
- package/dist/node/heading/heading.js +1 -22
- package/dist/node/heading/heading.module.js +1 -3
- package/dist/node/hover-card/hover-card.js +1 -84
- package/dist/node/hover-card/hover-card.module.js +1 -6
- package/dist/node/icon-button/icon-button.js +1 -19
- package/dist/node/icon-button/icon-button.module.js +1 -3
- package/dist/node/image/image.js +1 -64
- package/dist/node/image/image.module.js +1 -9
- package/dist/node/indicator/indicator.js +1 -16
- package/dist/node/indicator/indicator.module.js +1 -6
- package/dist/node/infinite-scroll/infinite-scroll.js +1 -49
- package/dist/node/infinite-scroll/infinite-scroll.module.js +1 -7
- package/dist/node/inline-loading/inline-loading.js +1 -74
- package/dist/node/inline-loading/inline-loading.module.js +1 -9
- package/dist/node/input/input.js +1 -56
- package/dist/node/input/input.module.js +1 -9
- package/dist/node/input-group/input-group.js +1 -39
- package/dist/node/input-group/input-group.module.js +1 -9
- package/dist/node/item/item.js +1 -50
- package/dist/node/item/item.module.js +1 -10
- package/dist/node/join/join.js +1 -12
- package/dist/node/join/join.module.js +1 -3
- package/dist/node/kbd/kbd.js +1 -14
- package/dist/node/kbd/kbd.module.js +1 -3
- package/dist/node/label/label.js +1 -23
- package/dist/node/label/label.module.js +1 -7
- package/dist/node/large-title-header/large-title-header.js +1 -38
- package/dist/node/large-title-header/large-title-header.module.js +1 -12
- package/dist/node/layouts/src/auto-grid/auto-grid.js +1 -17
- package/dist/node/layouts/src/auto-grid/auto-grid.module.js +1 -4
- package/dist/node/layouts/src/center/center.js +1 -16
- package/dist/node/layouts/src/center/center.module.js +1 -3
- package/dist/node/layouts/src/columns/columns.js +1 -21
- package/dist/node/layouts/src/columns/columns.module.js +1 -6
- package/dist/node/layouts/src/flex/flex.js +1 -20
- package/dist/node/layouts/src/flex/flex.module.js +1 -3
- package/dist/node/layouts/src/grid/grid.js +1 -55
- package/dist/node/layouts/src/grid/grid.module.js +1 -7
- package/dist/node/layouts/src/page-header/page-header.js +1 -31
- package/dist/node/layouts/src/page-header/page-header.module.js +1 -10
- package/dist/node/layouts/src/spacer/spacer.js +1 -17
- package/dist/node/layouts/src/spacer/spacer.module.js +1 -3
- package/dist/node/link/link.js +1 -22
- package/dist/node/link/link.module.js +1 -3
- package/dist/node/list/list.js +1 -21
- package/dist/node/list/list.module.js +1 -6
- package/dist/node/log-viewer/log-viewer.js +2 -184
- package/dist/node/log-viewer/log-viewer.module.js +1 -16
- package/dist/node/menu/menu.js +1 -126
- package/dist/node/menu/menu.module.js +1 -8
- package/dist/node/menu-button/menu-button.js +1 -92
- package/dist/node/menu-button/menu-button.module.js +1 -8
- package/dist/node/menubar/menubar.js +1 -103
- package/dist/node/menubar/menubar.module.js +1 -8
- package/dist/node/modal/modal.js +1 -76
- package/dist/node/modal/modal.module.js +1 -12
- package/dist/node/multi-select/list-nav.js +1 -0
- package/dist/node/multi-select/multi-select.js +1 -106
- package/dist/node/multi-select/multi-select.module.js +1 -15
- package/dist/node/multi-select/option-list.js +1 -0
- package/dist/node/native-select/native-select.js +1 -37
- package/dist/node/native-select/native-select.module.js +1 -7
- package/dist/node/navigation-menu/navigation-menu.js +1 -99
- package/dist/node/navigation-menu/navigation-menu.module.js +1 -10
- package/dist/node/notification/notification.js +1 -140
- package/dist/node/notification/notification.module.js +1 -11
- package/dist/node/number-input/number-input.js +1 -148
- package/dist/node/number-input/number-input.module.js +1 -12
- package/dist/node/otp-input/otp-input.js +1 -70
- package/dist/node/otp-input/otp-input.module.js +1 -6
- package/dist/node/overflow-menu/overflow-menu.js +1 -70
- package/dist/node/overflow-menu/overflow-menu.module.js +1 -7
- package/dist/node/pagination/pagination.js +1 -92
- package/dist/node/pagination/pagination.module.js +1 -11
- package/dist/node/password-input/password-input.js +1 -81
- package/dist/node/password-input/password-input.module.js +1 -11
- package/dist/node/popover/popover.js +1 -51
- package/dist/node/popover/popover.module.js +1 -6
- package/dist/node/popover/use-popover.js +1 -55
- package/dist/node/progress/progress.js +1 -16
- package/dist/node/progress/progress.module.js +1 -6
- package/dist/node/progress-bar/progress-bar.js +1 -42
- package/dist/node/progress-bar/progress-bar.module.js +1 -11
- package/dist/node/progress-circle/progress-circle.js +1 -46
- package/dist/node/progress-circle/progress-circle.module.js +1 -9
- package/dist/node/progress-indicator/progress-indicator.js +1 -34
- package/dist/node/progress-indicator/progress-indicator.module.js +1 -10
- package/dist/node/prose/prose.js +1 -13
- package/dist/node/prose/prose.module.js +1 -3
- package/dist/node/pull-to-refresh/pull-to-refresh.js +1 -82
- package/dist/node/pull-to-refresh/pull-to-refresh.module.js +1 -9
- package/dist/node/qr-code/encode.js +1 -583
- package/dist/node/qr-code/qr-code.js +1 -41
- package/dist/node/qr-code/qr-code.module.js +1 -6
- package/dist/node/radial-progress/radial-progress.js +1 -27
- package/dist/node/radial-progress/radial-progress.module.js +1 -6
- package/dist/node/radio/radio.js +1 -49
- package/dist/node/radio/radio.module.js +1 -9
- package/dist/node/radio-card/radio-card.js +1 -64
- package/dist/node/radio-card/radio-card.module.js +1 -11
- package/dist/node/rating-group/rating-group.js +1 -37
- package/dist/node/rating-group/rating-group.module.js +1 -6
- package/dist/node/react/src/index.js +1 -141
- package/dist/node/relative-time/relative-time.js +1 -66
- package/dist/node/relative-time/relative-time.module.js +1 -3
- package/dist/node/reorder-list/reorder-list.js +1 -143
- package/dist/node/reorder-list/reorder-list.module.js +1 -11
- package/dist/node/resizable/resizable.js +1 -80
- package/dist/node/resizable/resizable.module.js +1 -8
- package/dist/node/scroll-area/scroll-area.js +1 -38
- package/dist/node/scroll-area/scroll-area.module.js +1 -3
- package/dist/node/search/search.js +1 -96
- package/dist/node/search/search.module.js +1 -9
- package/dist/node/segmented-control/segmented-control.js +1 -43
- package/dist/node/segmented-control/segmented-control.module.js +1 -6
- package/dist/node/select/select.js +1 -73
- package/dist/node/select/select.module.js +1 -11
- package/dist/node/separator/separator.js +1 -19
- package/dist/node/separator/separator.module.js +1 -3
- package/dist/node/sheet/sheet.js +1 -49
- package/dist/node/sheet/sheet.module.js +1 -9
- package/dist/node/shell-header/shell-header.js +1 -169
- package/dist/node/shell-header/shell-header.module.js +1 -24
- package/dist/node/side-nav/side-nav.js +1 -334
- package/dist/node/side-nav/side-nav.module.js +1 -31
- package/dist/node/skeleton/skeleton.js +1 -23
- package/dist/node/skeleton/skeleton.module.js +1 -7
- package/dist/node/skip-nav/skip-nav.js +1 -28
- package/dist/node/skip-nav/skip-nav.module.js +1 -3
- package/dist/node/slider/slider.js +1 -30
- package/dist/node/slider/slider.module.js +1 -7
- package/dist/node/spinner/spinner.js +1 -18
- package/dist/node/spinner/spinner.module.js +1 -6
- package/dist/node/stack/stack.js +1 -17
- package/dist/node/stack/stack.module.js +1 -6
- package/dist/node/stat/stat.js +1 -41
- package/dist/node/stat/stat.module.js +1 -11
- package/dist/node/status/status.js +1 -25
- package/dist/node/status/status.module.js +1 -7
- package/dist/node/steps/steps.js +1 -35
- package/dist/node/steps/steps.module.js +1 -8
- package/dist/node/structured-list/structured-list.js +1 -102
- package/dist/node/structured-list/structured-list.module.js +1 -12
- package/dist/node/swap/swap.js +1 -36
- package/dist/node/swap/swap.module.js +1 -7
- package/dist/node/swipe-item/swipe-item.js +1 -62
- package/dist/node/swipe-item/swipe-item.module.js +1 -12
- package/dist/node/switcher/switcher.js +1 -32
- package/dist/node/switcher/switcher.module.js +1 -8
- package/dist/node/tabs/tabs.js +1 -98
- package/dist/node/tabs/tabs.module.js +1 -8
- package/dist/node/tag/tag.js +1 -33
- package/dist/node/tag/tag.module.js +1 -6
- package/dist/node/tags-input/tags-input.js +1 -68
- package/dist/node/tags-input/tags-input.module.js +1 -8
- package/dist/node/text/text.js +1 -16
- package/dist/node/text/text.module.js +1 -3
- package/dist/node/textarea/textarea.js +1 -58
- package/dist/node/textarea/textarea.module.js +1 -9
- package/dist/node/tile/tile.js +1 -39
- package/dist/node/tile/tile.module.js +1 -7
- package/dist/node/time-picker/time-picker.js +1 -64
- package/dist/node/time-picker/time-picker.module.js +1 -9
- package/dist/node/timeline/timeline.js +1 -55
- package/dist/node/timeline/timeline.module.js +1 -11
- package/dist/node/toast/toast.js +1 -85
- package/dist/node/toast/toast.module.js +1 -11
- package/dist/node/toc/toc.js +1 -43
- package/dist/node/toc/toc.module.js +1 -3
- package/dist/node/toc/use-toc-from-region.js +1 -18
- package/dist/node/toggle/toggle.js +1 -42
- package/dist/node/toggle/toggle.module.js +1 -8
- package/dist/node/toggle-group/toggle-group.js +1 -55
- package/dist/node/toggle-group/toggle-group.module.js +1 -6
- package/dist/node/toggletip/toggletip.js +1 -49
- package/dist/node/toggletip/toggletip.module.js +1 -7
- package/dist/node/tooltip/tooltip.js +1 -58
- package/dist/node/tooltip/tooltip.module.js +1 -6
- package/dist/node/tree-view/tree-view.js +1 -201
- package/dist/node/tree-view/tree-view.module.js +1 -13
- package/dist/node/user/user.js +1 -35
- package/dist/node/user/user.module.js +1 -9
- package/dist/node/virtual-list/virtual-list.js +1 -40
- package/dist/node/virtual-list/virtual-list.module.js +1 -7
- package/dist/node/visually-hidden/visually-hidden.js +1 -2
- package/dist/node/wheel-picker/wheel-picker.js +1 -84
- package/dist/node/wheel-picker/wheel-picker.module.js +1 -8
- package/dist/notification/notification.js +1 -140
- package/dist/notification/notification.module.js +1 -11
- package/dist/number-input/number-input.js +1 -148
- package/dist/number-input/number-input.module.js +1 -12
- package/dist/otp-input/otp-input.js +1 -70
- package/dist/otp-input/otp-input.module.js +1 -6
- package/dist/overflow-menu/overflow-menu.js +1 -70
- package/dist/overflow-menu/overflow-menu.module.js +1 -7
- package/dist/pagination/pagination.js +1 -92
- package/dist/pagination/pagination.module.js +1 -11
- package/dist/password-input/password-input.js +1 -81
- package/dist/password-input/password-input.module.js +1 -11
- package/dist/popover/popover.js +1 -51
- package/dist/popover/popover.module.js +1 -6
- package/dist/popover/use-popover.js +1 -55
- package/dist/progress/progress.css +1 -1
- package/dist/progress/progress.js +1 -16
- package/dist/progress/progress.module.js +1 -6
- package/dist/progress-bar/progress-bar.css +1 -1
- package/dist/progress-bar/progress-bar.js +1 -42
- package/dist/progress-bar/progress-bar.module.js +1 -11
- package/dist/progress-circle/progress-circle.js +1 -46
- package/dist/progress-circle/progress-circle.module.js +1 -9
- package/dist/progress-indicator/progress-indicator.css +1 -1
- package/dist/progress-indicator/progress-indicator.js +1 -34
- package/dist/progress-indicator/progress-indicator.module.js +1 -10
- package/dist/prose/prose.css +1 -1
- package/dist/prose/prose.js +1 -13
- package/dist/prose/prose.module.js +1 -3
- package/dist/pull-to-refresh/pull-to-refresh.js +1 -82
- package/dist/pull-to-refresh/pull-to-refresh.module.js +1 -9
- package/dist/qr-code/encode.js +1 -583
- package/dist/qr-code/qr-code.js +1 -41
- package/dist/qr-code/qr-code.module.js +1 -6
- package/dist/radial-progress/radial-progress.js +1 -27
- package/dist/radial-progress/radial-progress.module.js +1 -6
- package/dist/radio/radio.js +1 -49
- package/dist/radio/radio.module.js +1 -9
- package/dist/radio-card/radio-card.css +1 -1
- package/dist/radio-card/radio-card.js +1 -64
- package/dist/radio-card/radio-card.module.js +1 -11
- package/dist/rating-group/rating-group.js +1 -37
- package/dist/rating-group/rating-group.module.js +1 -6
- package/dist/react/src/index.js +1 -141
- package/dist/relative-time/relative-time.js +1 -66
- package/dist/relative-time/relative-time.module.js +1 -3
- package/dist/reorder-list/reorder-list.css +1 -1
- package/dist/reorder-list/reorder-list.js +1 -143
- package/dist/reorder-list/reorder-list.module.js +1 -11
- package/dist/resizable/resizable.js +1 -80
- package/dist/resizable/resizable.module.js +1 -8
- package/dist/scroll-area/scroll-area.css +1 -1
- package/dist/scroll-area/scroll-area.js +1 -38
- package/dist/scroll-area/scroll-area.module.js +1 -3
- package/dist/search/search.js +1 -96
- package/dist/search/search.module.js +1 -9
- package/dist/segmented-control/segmented-control.js +1 -43
- package/dist/segmented-control/segmented-control.module.js +1 -6
- package/dist/select/select.js +1 -73
- package/dist/select/select.module.js +1 -11
- package/dist/separator/separator.js +1 -19
- package/dist/separator/separator.module.js +1 -3
- package/dist/sheet/sheet.js +1 -49
- package/dist/sheet/sheet.module.js +1 -9
- package/dist/shell-header/shell-header.css +1 -1
- package/dist/shell-header/shell-header.js +1 -169
- package/dist/shell-header/shell-header.module.js +1 -24
- package/dist/side-nav/side-nav.css +1 -1
- package/dist/side-nav/side-nav.js +1 -334
- package/dist/side-nav/side-nav.module.js +1 -31
- package/dist/skeleton/skeleton.css +1 -1
- package/dist/skeleton/skeleton.js +1 -23
- package/dist/skeleton/skeleton.module.js +1 -7
- package/dist/skip-nav/skip-nav.js +1 -28
- package/dist/skip-nav/skip-nav.module.js +1 -3
- package/dist/slider/slider.js +1 -30
- package/dist/slider/slider.module.js +1 -7
- package/dist/spinner/spinner.css +1 -1
- package/dist/spinner/spinner.js +1 -18
- package/dist/spinner/spinner.module.js +1 -6
- package/dist/stack/stack.js +1 -17
- package/dist/stack/stack.module.js +1 -6
- package/dist/stat/stat.js +1 -41
- package/dist/stat/stat.module.js +1 -11
- package/dist/status/status.css +1 -1
- package/dist/status/status.js +1 -25
- package/dist/status/status.module.js +1 -7
- package/dist/steps/steps.css +1 -1
- package/dist/steps/steps.js +1 -35
- package/dist/steps/steps.module.js +1 -8
- package/dist/structured-list/structured-list.js +1 -102
- package/dist/structured-list/structured-list.module.js +1 -12
- package/dist/styles.css +401 -55
- package/dist/swap/swap.css +1 -1
- package/dist/swap/swap.js +1 -36
- package/dist/swap/swap.module.js +1 -7
- package/dist/swipe-item/swipe-item.js +1 -62
- package/dist/swipe-item/swipe-item.module.js +1 -12
- package/dist/switcher/switcher.js +1 -32
- package/dist/switcher/switcher.module.js +1 -8
- package/dist/tabs/tabs.js +1 -98
- package/dist/tabs/tabs.module.js +1 -8
- package/dist/tag/tag.js +1 -33
- package/dist/tag/tag.module.js +1 -6
- package/dist/tags-input/tags-input.js +1 -68
- package/dist/tags-input/tags-input.module.js +1 -8
- package/dist/text/text.css +1 -1
- package/dist/text/text.js +1 -16
- package/dist/text/text.module.js +1 -3
- package/dist/textarea/textarea.css +1 -1
- package/dist/textarea/textarea.js +1 -58
- package/dist/textarea/textarea.module.js +1 -9
- package/dist/tile/tile.css +1 -1
- package/dist/tile/tile.js +1 -39
- package/dist/tile/tile.module.js +1 -7
- package/dist/time-picker/time-picker.js +1 -64
- package/dist/time-picker/time-picker.module.js +1 -9
- package/dist/timeline/timeline.js +1 -55
- package/dist/timeline/timeline.module.js +1 -11
- package/dist/toast/toast.css +1 -1
- package/dist/toast/toast.js +1 -85
- package/dist/toast/toast.module.js +1 -11
- package/dist/toc/toc.css +1 -1
- package/dist/toc/toc.js +1 -43
- package/dist/toc/toc.module.js +1 -3
- package/dist/toc/use-toc-from-region.js +1 -18
- package/dist/toggle/toggle.js +1 -42
- package/dist/toggle/toggle.module.js +1 -8
- package/dist/toggle-group/toggle-group.js +1 -55
- package/dist/toggle-group/toggle-group.module.js +1 -6
- package/dist/toggletip/toggletip.js +1 -49
- package/dist/toggletip/toggletip.module.js +1 -7
- package/dist/tooltip/tooltip.css +1 -1
- package/dist/tooltip/tooltip.js +1 -58
- package/dist/tooltip/tooltip.module.js +1 -6
- package/dist/tree-view/tree-view.css +1 -1
- package/dist/tree-view/tree-view.js +1 -201
- package/dist/tree-view/tree-view.module.js +1 -13
- package/dist/user/user.js +1 -35
- package/dist/user/user.module.js +1 -9
- package/dist/virtual-list/virtual-list.js +1 -40
- package/dist/virtual-list/virtual-list.module.js +1 -7
- package/dist/visually-hidden/visually-hidden.js +1 -2
- package/dist/wheel-picker/wheel-picker.js +1 -84
- package/dist/wheel-picker/wheel-picker.module.js +1 -8
- package/package.json +4 -4
- package/readme.body.md +3 -2
|
@@ -1,224 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import e from "./date-picker.module.js";
|
|
4
|
-
import { useId as t, useRef as n } from "react";
|
|
5
|
-
import { batch as r, cn as i, createMachine as a, useControllableSignal as o, useMachine as s, useSignal as c, useSignalEffect as ee, useSignals as te } from "@cascivo/core";
|
|
6
|
-
import { builtin as l, currentLocale as u, t as d } from "@cascivo/i18n";
|
|
7
|
-
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
8
|
-
//#region ../components/src/date-picker/date-picker.tsx
|
|
9
|
-
var m = a({
|
|
10
|
-
initial: "closed",
|
|
11
|
-
states: {
|
|
12
|
-
closed: { on: { OPEN: "open" } },
|
|
13
|
-
open: { on: { CLOSE: "closed" } }
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
function ne(e) {
|
|
17
|
-
try {
|
|
18
|
-
let t = new Intl.Locale(e).weekInfo;
|
|
19
|
-
if (t) return t.firstDay % 7;
|
|
20
|
-
} catch {}
|
|
21
|
-
return 1;
|
|
22
|
-
}
|
|
23
|
-
function re(e, t, n) {
|
|
24
|
-
let r = new Date(Date.UTC(e, t, 1)), i = new Date(Date.UTC(e, t + 1, 0)), a = (r.getUTCDay() - n + 7) % 7, o = [];
|
|
25
|
-
for (let e = 0; e < a; e++) o.push(null);
|
|
26
|
-
for (let n = 1; n <= i.getUTCDate(); n++) o.push(new Date(Date.UTC(e, t, n)));
|
|
27
|
-
for (; o.length % 7 != 0;) o.push(null);
|
|
28
|
-
let s = [];
|
|
29
|
-
for (let e = 0; e < o.length; e += 7) s.push(o.slice(e, e + 7));
|
|
30
|
-
return s;
|
|
31
|
-
}
|
|
32
|
-
function h(e, t) {
|
|
33
|
-
return new Intl.DateTimeFormat(t).format(e);
|
|
34
|
-
}
|
|
35
|
-
function g(e) {
|
|
36
|
-
return e.toISOString().slice(0, 10);
|
|
37
|
-
}
|
|
38
|
-
function _(e) {
|
|
39
|
-
let [t, n, r] = e.split("-").map(Number);
|
|
40
|
-
return new Date(Date.UTC(t, n - 1, r));
|
|
41
|
-
}
|
|
42
|
-
function ie(...e) {
|
|
43
|
-
return e.filter(Boolean).join(" ") || void 0;
|
|
44
|
-
}
|
|
45
|
-
function v({ value: a, defaultValue: v, onValueChange: y, min: b, max: x, clearable: ae = !1, label: S, ariaLabel: oe, hint: C, error: w, size: T = "md", disabled: E = !1, labels: D, className: O, id: k, "aria-labelledby": A, "aria-describedby": se, "aria-invalid": ce }) {
|
|
46
|
-
te();
|
|
47
|
-
let [j, M] = s(m), N = t(), P = k ?? `cascade-date-picker-${N}`, F = `${N}-grid`, I = u(), L = D?.placeholder ?? d(l.datePicker.placeholder), R = D?.previousMonth ?? d(l.datePicker.previousMonth), z = D?.nextMonth ?? d(l.datePicker.nextMonth), B = D?.clear ?? d(l.datePicker.clear), V = /* @__PURE__ */ new Date(), H = g(V), [U] = o({
|
|
48
|
-
value: a,
|
|
49
|
-
defaultValue: v
|
|
50
|
-
}), W = c(U.value ? _(U.value).getUTCFullYear() : V.getUTCFullYear()), G = c(U.value ? _(U.value).getUTCMonth() : V.getUTCMonth()), K = c(U.value), q = n(null);
|
|
51
|
-
ee(() => {
|
|
52
|
-
if (j.value !== "open") return;
|
|
53
|
-
let e = (e) => {
|
|
54
|
-
q.current && !q.current.contains(e.target) && M("CLOSE");
|
|
55
|
-
};
|
|
56
|
-
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
57
|
-
});
|
|
58
|
-
let le = () => {
|
|
59
|
-
E || M("OPEN");
|
|
60
|
-
}, J = () => M("CLOSE"), Y = y, X = (e) => {
|
|
61
|
-
b && e < b || x && e > x || (a === void 0 && (U.value = e), Y?.(e), J());
|
|
62
|
-
}, ue = (e) => {
|
|
63
|
-
e.stopPropagation(), a === void 0 && (U.value = void 0), Y?.(void 0);
|
|
64
|
-
}, de = () => {
|
|
65
|
-
G.value === 0 ? r(() => {
|
|
66
|
-
W.value--, G.value = 11;
|
|
67
|
-
}) : G.value--;
|
|
68
|
-
}, fe = () => {
|
|
69
|
-
G.value === 11 ? r(() => {
|
|
70
|
-
W.value++, G.value = 0;
|
|
71
|
-
}) : G.value++;
|
|
72
|
-
}, Z = ne(I), pe = re(W.value, G.value, Z), me = new Intl.DateTimeFormat(I, { weekday: "short" }), he = Array.from({ length: 7 }, (e, t) => {
|
|
73
|
-
let n = new Date(Date.UTC(2024, 0, 7 + Z + t));
|
|
74
|
-
return me.format(n);
|
|
75
|
-
}), Q = new Intl.DateTimeFormat(I, {
|
|
76
|
-
month: "long",
|
|
77
|
-
year: "numeric"
|
|
78
|
-
}).format(new Date(Date.UTC(W.value, G.value, 1))), ge = (e) => {
|
|
79
|
-
let t = K.value;
|
|
80
|
-
if (!t) return;
|
|
81
|
-
let n = _(t), i;
|
|
82
|
-
if (e.key === "ArrowRight") i = new Date(Date.UTC(n.getUTCFullYear(), n.getUTCMonth(), n.getUTCDate() + 1));
|
|
83
|
-
else if (e.key === "ArrowLeft") i = new Date(Date.UTC(n.getUTCFullYear(), n.getUTCMonth(), n.getUTCDate() - 1));
|
|
84
|
-
else if (e.key === "ArrowDown") i = new Date(Date.UTC(n.getUTCFullYear(), n.getUTCMonth(), n.getUTCDate() + 7));
|
|
85
|
-
else if (e.key === "ArrowUp") i = new Date(Date.UTC(n.getUTCFullYear(), n.getUTCMonth(), n.getUTCDate() - 7));
|
|
86
|
-
else if (e.key === "Enter" || e.key === " ") {
|
|
87
|
-
e.preventDefault(), X(t);
|
|
88
|
-
return;
|
|
89
|
-
} else if (e.key === "Escape") {
|
|
90
|
-
J();
|
|
91
|
-
return;
|
|
92
|
-
} else return;
|
|
93
|
-
if (e.preventDefault(), i) {
|
|
94
|
-
let e = g(i);
|
|
95
|
-
if (b && e < b || x && e > x) return;
|
|
96
|
-
K.value = e, r(() => {
|
|
97
|
-
W.value = i.getUTCFullYear(), G.value = i.getUTCMonth();
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
}, $ = U.value ? h(_(U.value), I) : "";
|
|
101
|
-
return /* @__PURE__ */ p("div", {
|
|
102
|
-
ref: q,
|
|
103
|
-
className: i(e.wrapper, O),
|
|
104
|
-
"data-state": w ? "error" : j.value,
|
|
105
|
-
"data-size": T,
|
|
106
|
-
children: [
|
|
107
|
-
S && /* @__PURE__ */ f("label", {
|
|
108
|
-
className: e.label,
|
|
109
|
-
htmlFor: P,
|
|
110
|
-
children: S
|
|
111
|
-
}),
|
|
112
|
-
/* @__PURE__ */ p("div", {
|
|
113
|
-
className: e.field,
|
|
114
|
-
children: [/* @__PURE__ */ p("button", {
|
|
115
|
-
id: P,
|
|
116
|
-
type: "button",
|
|
117
|
-
role: "combobox",
|
|
118
|
-
"aria-expanded": j.value === "open",
|
|
119
|
-
"aria-controls": F,
|
|
120
|
-
"aria-haspopup": "dialog",
|
|
121
|
-
"aria-labelledby": A,
|
|
122
|
-
"aria-label": oe,
|
|
123
|
-
"aria-invalid": w ? !0 : ce,
|
|
124
|
-
"aria-describedby": ie(w ? `${N}-error` : C ? `${N}-hint` : void 0, se),
|
|
125
|
-
className: e.trigger,
|
|
126
|
-
disabled: E,
|
|
127
|
-
onClick: j.value === "open" ? J : le,
|
|
128
|
-
children: [/* @__PURE__ */ f("span", {
|
|
129
|
-
className: i(e.value, $ ? void 0 : e.placeholder),
|
|
130
|
-
children: $ || L
|
|
131
|
-
}), /* @__PURE__ */ f("span", {
|
|
132
|
-
className: e.icon,
|
|
133
|
-
"aria-hidden": "true",
|
|
134
|
-
children: "📅"
|
|
135
|
-
})]
|
|
136
|
-
}), ae && U.value !== void 0 && /* @__PURE__ */ f("button", {
|
|
137
|
-
type: "button",
|
|
138
|
-
className: e.clear,
|
|
139
|
-
"aria-label": B,
|
|
140
|
-
onClick: ue,
|
|
141
|
-
children: "✕"
|
|
142
|
-
})]
|
|
143
|
-
}),
|
|
144
|
-
/* @__PURE__ */ p("div", {
|
|
145
|
-
id: F,
|
|
146
|
-
role: "dialog",
|
|
147
|
-
"aria-label": Q,
|
|
148
|
-
className: e.calendar,
|
|
149
|
-
"data-state": j.value,
|
|
150
|
-
onKeyDown: ge,
|
|
151
|
-
children: [/* @__PURE__ */ p("div", {
|
|
152
|
-
className: e.header,
|
|
153
|
-
children: [
|
|
154
|
-
/* @__PURE__ */ f("button", {
|
|
155
|
-
type: "button",
|
|
156
|
-
className: e.navButton,
|
|
157
|
-
"aria-label": R,
|
|
158
|
-
onClick: de,
|
|
159
|
-
children: "‹"
|
|
160
|
-
}),
|
|
161
|
-
/* @__PURE__ */ f("span", {
|
|
162
|
-
className: e.monthLabel,
|
|
163
|
-
"aria-live": "polite",
|
|
164
|
-
children: Q
|
|
165
|
-
}),
|
|
166
|
-
/* @__PURE__ */ f("button", {
|
|
167
|
-
type: "button",
|
|
168
|
-
className: e.navButton,
|
|
169
|
-
"aria-label": z,
|
|
170
|
-
onClick: fe,
|
|
171
|
-
children: "›"
|
|
172
|
-
})
|
|
173
|
-
]
|
|
174
|
-
}), /* @__PURE__ */ p("table", {
|
|
175
|
-
role: "grid",
|
|
176
|
-
className: e.grid,
|
|
177
|
-
children: [/* @__PURE__ */ f("thead", { children: /* @__PURE__ */ f("tr", { children: he.map((t) => /* @__PURE__ */ f("th", {
|
|
178
|
-
className: e.weekday,
|
|
179
|
-
abbr: t,
|
|
180
|
-
scope: "col",
|
|
181
|
-
children: t
|
|
182
|
-
}, t)) }) }), /* @__PURE__ */ f("tbody", { children: pe.map((t, n) => /* @__PURE__ */ f("tr", { children: t.map((t, n) => {
|
|
183
|
-
if (!t) return /* @__PURE__ */ f("td", { className: e.empty }, n);
|
|
184
|
-
let r = g(t), i = r === U.value, a = r === H, o = r === K.value, s = b !== void 0 && r < b || x !== void 0 && r > x;
|
|
185
|
-
return /* @__PURE__ */ f("td", {
|
|
186
|
-
className: e.cell,
|
|
187
|
-
children: /* @__PURE__ */ f("button", {
|
|
188
|
-
type: "button",
|
|
189
|
-
className: e.day,
|
|
190
|
-
tabIndex: o ? 0 : -1,
|
|
191
|
-
"aria-pressed": i,
|
|
192
|
-
"aria-label": h(t, I),
|
|
193
|
-
"aria-current": a ? "date" : void 0,
|
|
194
|
-
"aria-disabled": s || void 0,
|
|
195
|
-
"data-selected": i || void 0,
|
|
196
|
-
"data-today": a || void 0,
|
|
197
|
-
onClick: () => {
|
|
198
|
-
s || X(r);
|
|
199
|
-
},
|
|
200
|
-
onFocus: () => {
|
|
201
|
-
K.value = r;
|
|
202
|
-
},
|
|
203
|
-
children: t.getUTCDate()
|
|
204
|
-
})
|
|
205
|
-
}, n);
|
|
206
|
-
}) }, n)) })]
|
|
207
|
-
})]
|
|
208
|
-
}),
|
|
209
|
-
w && /* @__PURE__ */ f("span", {
|
|
210
|
-
id: `${N}-error`,
|
|
211
|
-
className: e.error,
|
|
212
|
-
role: "alert",
|
|
213
|
-
children: w
|
|
214
|
-
}),
|
|
215
|
-
!w && C && /* @__PURE__ */ f("span", {
|
|
216
|
-
id: `${N}-hint`,
|
|
217
|
-
className: e.hint,
|
|
218
|
-
children: C
|
|
219
|
-
})
|
|
220
|
-
]
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
//#endregion
|
|
224
|
-
export { v as DatePicker };
|
|
1
|
+
"use client";import{Calendar as e}from"../calendar/calendar.js";import{formatDate as t,formatHint as ee,fromISO as n,parseTypedDate as r,toISO as te}from"./parse-date.js";import i from"./date-picker.module.js";import{useId as ne,useRef as a}from"react";import{DismissableLayer as o,cn as s,focusElement as c,useControllableSignal as l,useSignal as re,useSignalEffect as u,useSignals as d}from"@cascivo/core";import{builtin as f,currentLocale as p,t as m}from"@cascivo/i18n";import{jsx as h,jsxs as g}from"react/jsx-runtime";function mergeDescribedBy(...e){return e.filter(Boolean).join(` `)||void 0}function DatePicker({value:ie,defaultValue:ae,onValueChange:oe,min:_,max:v,disabledDate:y,clearable:b=!1,label:x,ariaLabel:S,hint:C,error:w,size:T=`md`,disabled:E=!1,typeable:D=!0,format:se,showToday:ce=!1,name:O,required:le,open:k,onOpenChange:ue,labels:A,className:de,id:fe,"aria-labelledby":pe,"aria-describedby":j,"aria-invalid":M}){d();let N=ne(),P=fe??`cascade-date-picker-${N}`,F=`${N}-dialog`,I=p(),L=A?.placeholder??m(f.datePicker.placeholder),R=A?.clear??m(f.datePicker.clear),z=A?.open??m(f.datePicker.open),B=a(null),V=a(null),H=a(null),[U,me]=l({value:ie,defaultValue:ae,onChange:oe}),[W,G]=l({value:k,defaultValue:!1,onChange:ue}),K=W.value,q=U.value?n(U.value):null,J=_?n(_):null,Y=v?n(v):null,X=q?t(q,I,se):``,Z=re(null),he=Z.value??X;function openPopup(){E||G(!0)}function closePopup(e=!0){G(!1),e&&c(D?B.current:V.current)}let Q=a(!1);u(()=>{if(W.value){Q.current=!0;let e=setTimeout(()=>{c(H.current?.querySelector(`[tabindex="0"]`)??null)},0);return()=>clearTimeout(e)}Q.current=!1});function commit(e){Z.value=null,me(e?te(e):void 0)}function commitDraft(){let e=Z.peek();if(e===null)return;if(e.trim()===``){commit(null);return}let t=r(e,I,q?.getUTCFullYear());t&&!outside(t)?commit(t):Z.value=null}function outside(e){return J&&e.getTime()<J.getTime()||Y&&e.getTime()>Y.getTime()?!0:y?.(e)??!1}function handleFieldKeyDown(e){if(!E){if(e.altKey&&e.key===`ArrowDown`){e.preventDefault(),openPopup();return}switch(e.key){case`ArrowDown`:e.preventDefault(),openPopup();break;case`Enter`:D&&(e.preventDefault(),commitDraft());break;case`Escape`:K?(e.preventDefault(),e.stopPropagation(),closePopup()):Z.peek()!==null&&(Z.value=null);break;case`Backspace`:case`Delete`:!D&&b&&U.peek()!==void 0&&(e.preventDefault(),commit(null));break}}}let ge=mergeDescribedBy(w?`${N}-error`:C?`${N}-hint`:void 0,j),$={id:P,role:`combobox`,"aria-expanded":K,"aria-controls":F,"aria-haspopup":`dialog`,"aria-labelledby":pe,"aria-label":S,"aria-invalid":w?!0:M,"aria-describedby":ge,"aria-required":le||void 0,disabled:E,onKeyDown:handleFieldKeyDown};return h(o,{onDismiss:()=>K&&closePopup(!1),children:g(`div`,{className:s(i.wrapper,de),"data-state":w?`error`:K?`open`:`closed`,"data-size":T,children:[x&&h(`label`,{className:i.label,htmlFor:P,children:x}),g(`div`,{className:i.field,children:[D?h(`input`,{...$,ref:B,type:`text`,className:i.trigger,autoComplete:`off`,inputMode:`numeric`,placeholder:L||ee(I),value:he,onChange:e=>{Z.value=e.currentTarget.value},onBlur:commitDraft}):h(`button`,{...$,ref:V,type:`button`,className:i.trigger,children:h(`span`,{className:s(i.value,X?void 0:i.placeholder),children:X||L})}),b&&U.value!==void 0&&!E&&h(`button`,{type:`button`,className:i.clear,"aria-label":R,onClick:()=>{commit(null),c(D?B.current:V.current)},children:h(`span`,{className:i.clearGlyph,"aria-hidden":`true`})}),h(`button`,{ref:D?V:void 0,type:`button`,className:i.openButton,"aria-label":z,"aria-expanded":K,"aria-controls":F,disabled:E,onClick:()=>K?closePopup():openPopup(),children:h(`span`,{className:i.calendarGlyph,"aria-hidden":`true`})})]}),O!==void 0&&h(`input`,{type:`hidden`,name:O,value:U.value??``}),h(`div`,{ref:H,id:F,role:`dialog`,"aria-label":x??S??L,className:i.popup,"data-state":K?`open`:`closed`,onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),closePopup())},children:h(e,{value:q,onValueChange:e=>{commit(e),closePopup()},...J?{min:J}:{},...Y?{max:Y}:{},...y?{disabled:y}:{},labels:{...A?.previousMonth?{previousMonth:A.previousMonth}:{},...A?.nextMonth?{nextMonth:A.nextMonth}:{},...A?.today?{today:A.today}:{}},showToday:ce,size:T,locale:I})}),w&&h(`span`,{id:`${N}-error`,className:i.error,role:`alert`,children:w}),!w&&C&&h(`span`,{id:`${N}-hint`,className:i.hint,children:C})]})})}export{DatePicker};
|
|
@@ -1,24 +1,2 @@
|
|
|
1
1
|
import './date-picker.css';
|
|
2
|
-
var e
|
|
3
|
-
wrapper: "_wrapper_g43fz_2",
|
|
4
|
-
label: "_label_g43fz_31",
|
|
5
|
-
field: "_field_g43fz_38",
|
|
6
|
-
trigger: "_trigger_g43fz_44",
|
|
7
|
-
value: "_value_g43fz_82",
|
|
8
|
-
placeholder: "_placeholder_g43fz_88",
|
|
9
|
-
icon: "_icon_g43fz_91",
|
|
10
|
-
clear: "_clear_g43fz_96",
|
|
11
|
-
calendar: "_calendar_g43fz_121",
|
|
12
|
-
header: "_header_g43fz_153",
|
|
13
|
-
monthLabel: "_monthLabel_g43fz_160",
|
|
14
|
-
navButton: "_navButton_g43fz_166",
|
|
15
|
-
grid: "_grid_g43fz_188",
|
|
16
|
-
weekday: "_weekday_g43fz_193",
|
|
17
|
-
cell: "_cell_g43fz_202",
|
|
18
|
-
empty: "_empty_g43fz_206",
|
|
19
|
-
day: "_day_g43fz_210",
|
|
20
|
-
error: "_error_g43fz_245",
|
|
21
|
-
hint: "_hint_g43fz_249"
|
|
22
|
-
};
|
|
23
|
-
//#endregion
|
|
24
|
-
export { e as default };
|
|
2
|
+
var e={wrapper:`_wrapper_7wyss_3`,label:`_label_7wyss_42`,field:`_field_7wyss_49`,trigger:`_trigger_7wyss_55`,value:`_value_7wyss_93`,placeholder:`_placeholder_7wyss_99`,clear:`_clear_7wyss_103`,popup:`_popup_7wyss_128`,error:`_error_7wyss_160`,hint:`_hint_7wyss_164`,openButton:`_openButton_7wyss_169`,calendarGlyph:`_calendarGlyph_7wyss_194`,clearGlyph:`_clearGlyph_7wyss_195`};export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function toISO(e){return`${String(e.getUTCFullYear()).padStart(4,`0`)}-${String(e.getUTCMonth()+1).padStart(2,`0`)}-${String(e.getUTCDate()).padStart(2,`0`)}`}function fromISO(e){let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e.trim());return t?makeDate(Number(t[1]),Number(t[2]),Number(t[3])):null}function makeDate(e,t,n){if(t<1||t>12||n<1||n>31)return null;let r=new Date(Date.UTC(e,t-1,n));return r.getUTCMonth()!==t-1||r.getUTCDate()!==n?null:r}function isDayFirst(e){try{return new Intl.DateTimeFormat(e).formatToParts(new Date(Date.UTC(2026,0,2))).filter(e=>e.type===`day`||e.type===`month`).map(e=>e.type)[0]===`day`}catch{return!1}}function parseTypedDate(e,t,n){let r=e.trim();if(r===``)return null;let i=fromISO(r);if(i)return i;let a=r.split(/[/.\-\s]+/).filter(Boolean);if(a.length<2||a.length>3||!a.every(e=>/^\d{1,4}$/.test(e)))return null;let o=a.map(Number),s=isDayFirst(t),c,l,u;return o.length===2?([c,l]=s?[o[0],o[1]]:[o[1],o[0]],u=n??new Date().getFullYear()):([c,l]=s?[o[0],o[1]]:[o[1],o[0]],u=o[2],a[2].length<=2&&(u=2e3+u)),makeDate(u,l,c)}function formatDate(e,t,n){return new Intl.DateTimeFormat(t,n??{timeZone:`UTC`}).format(e)}function formatHint(e){try{return new Intl.DateTimeFormat(e,{timeZone:`UTC`}).formatToParts(new Date(Date.UTC(2026,10,22))).map(e=>e.type===`day`?`DD`:e.type===`month`?`MM`:e.type===`year`?`YYYY`:e.value).join(``)}catch{return`YYYY-MM-DD`}}export{formatDate,formatHint,fromISO,parseTypedDate,toISO};
|
|
@@ -1,196 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { Calendar as e } from "../calendar/calendar.js";
|
|
4
|
-
import t from "./date-range-picker.module.js";
|
|
5
|
-
import { useRef as n } from "react";
|
|
6
|
-
import { batch as r, cn as i, useControllableSignal as a, useSignal as o, useSignalEffect as s, useSignals as ee } from "@cascivo/core";
|
|
7
|
-
import { builtin as c, currentLocale as l, t as u } from "@cascivo/i18n";
|
|
8
|
-
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
9
|
-
//#region ../components/src/date-range-picker/date-range-picker.tsx
|
|
10
|
-
function p(e) {
|
|
11
|
-
return Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate());
|
|
12
|
-
}
|
|
13
|
-
function m(e, t) {
|
|
14
|
-
return !e || !t ? !1 : p(e) === p(t);
|
|
15
|
-
}
|
|
16
|
-
function h(e, t, n) {
|
|
17
|
-
let r = new Date(Date.UTC(e, t + n, 1));
|
|
18
|
-
return {
|
|
19
|
-
year: r.getUTCFullYear(),
|
|
20
|
-
month: r.getUTCMonth()
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
function g({ value: g, defaultValue: _, onValueChange: v, min: y, max: b, disabled: x, presets: S, locale: C, placeholder: w, size: T = "md", labels: E, className: D }) {
|
|
24
|
-
ee();
|
|
25
|
-
let O = C ?? l(), te = w ?? u(c.dateRangePicker.placeholder), ne = E?.apply ?? u(c.dateRangePicker.apply), re = E?.clear ?? u(c.dateRangePicker.clear), k = E?.previousMonth ?? u(c.calendar.previousMonth), A = E?.nextMonth ?? u(c.calendar.nextMonth), [j, M] = a({
|
|
26
|
-
value: g === void 0 ? void 0 : g,
|
|
27
|
-
defaultValue: _ ?? null,
|
|
28
|
-
onChange: (e) => {
|
|
29
|
-
e && v?.(e);
|
|
30
|
-
}
|
|
31
|
-
}), N = o(!1), P = o(null), F = o(null), I = j.value?.start ?? _?.start ?? /* @__PURE__ */ new Date(), L = o(I.getUTCFullYear()), R = o(I.getUTCMonth()), z = n(null);
|
|
32
|
-
s(() => {
|
|
33
|
-
if (!N.value) return;
|
|
34
|
-
let e = (e) => {
|
|
35
|
-
z.current && !z.current.contains(e.target) && (N.value = !1);
|
|
36
|
-
};
|
|
37
|
-
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
38
|
-
});
|
|
39
|
-
let B = () => {
|
|
40
|
-
N.value = !0;
|
|
41
|
-
}, V = () => {
|
|
42
|
-
N.value = !1;
|
|
43
|
-
}, H = (e) => {
|
|
44
|
-
let t = h(L.value, R.value, e);
|
|
45
|
-
r(() => {
|
|
46
|
-
L.value = t.year, R.value = t.month;
|
|
47
|
-
});
|
|
48
|
-
}, U = (e) => {
|
|
49
|
-
let t = P.value;
|
|
50
|
-
if (t === null) {
|
|
51
|
-
P.value = e;
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
if (m(t, e)) {
|
|
55
|
-
r(() => {
|
|
56
|
-
P.value = null, F.value = null;
|
|
57
|
-
}), M(null);
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
let n = p(t) <= p(e) ? {
|
|
61
|
-
start: t,
|
|
62
|
-
end: e
|
|
63
|
-
} : {
|
|
64
|
-
start: e,
|
|
65
|
-
end: t
|
|
66
|
-
};
|
|
67
|
-
r(() => {
|
|
68
|
-
P.value = null, F.value = null;
|
|
69
|
-
}), M(n);
|
|
70
|
-
}, W = (e) => {
|
|
71
|
-
r(() => {
|
|
72
|
-
P.value = null, F.value = null, L.value = e.range.start.getUTCFullYear(), R.value = e.range.start.getUTCMonth();
|
|
73
|
-
}), M(e.range);
|
|
74
|
-
}, G = () => {
|
|
75
|
-
r(() => {
|
|
76
|
-
P.value = null, F.value = null;
|
|
77
|
-
}), M(null);
|
|
78
|
-
}, K = P.value ?? j.value?.start ?? null, q = P.value ? F.value ?? null : j.value?.end ?? null, J = K && q ? Math.min(p(K), p(q)) : null, Y = K && q ? Math.max(p(K), p(q)) : null, ie = (e) => {
|
|
79
|
-
if (J === null || Y === null) return !1;
|
|
80
|
-
let t = p(e);
|
|
81
|
-
return t > J && t < Y;
|
|
82
|
-
}, ae = (e) => m(e, K) || J !== null && p(e) === J, oe = (e) => m(e, q) || Y !== null && p(e) === Y, X = new Intl.DateTimeFormat(O, {
|
|
83
|
-
year: "numeric",
|
|
84
|
-
month: "short",
|
|
85
|
-
day: "numeric"
|
|
86
|
-
}), Z = j.value ? `${X.format(j.value.start)} → ${X.format(j.value.end)}` : "", Q = h(L.value, R.value, 1), $ = {
|
|
87
|
-
locale: O,
|
|
88
|
-
size: T,
|
|
89
|
-
...y === void 0 ? {} : { min: y },
|
|
90
|
-
...b === void 0 ? {} : { max: b },
|
|
91
|
-
...x === void 0 ? {} : { disabled: x },
|
|
92
|
-
hideNav: !0,
|
|
93
|
-
isInRange: ie,
|
|
94
|
-
isRangeStart: ae,
|
|
95
|
-
isRangeEnd: oe,
|
|
96
|
-
onValueChange: U,
|
|
97
|
-
onDayHover: (e) => {
|
|
98
|
-
F.value = e;
|
|
99
|
-
},
|
|
100
|
-
labels: {
|
|
101
|
-
previousMonth: k,
|
|
102
|
-
nextMonth: A
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
return /* @__PURE__ */ f("div", {
|
|
106
|
-
ref: z,
|
|
107
|
-
className: i(t.wrapper, D),
|
|
108
|
-
"data-size": T,
|
|
109
|
-
onKeyDown: (e) => {
|
|
110
|
-
e.key === "Escape" && N.value && (e.stopPropagation(), V());
|
|
111
|
-
},
|
|
112
|
-
children: [/* @__PURE__ */ f("button", {
|
|
113
|
-
type: "button",
|
|
114
|
-
role: "combobox",
|
|
115
|
-
"aria-expanded": N.value,
|
|
116
|
-
"aria-haspopup": "dialog",
|
|
117
|
-
"aria-label": E?.label ?? u(c.dateRangePicker.label),
|
|
118
|
-
className: t.trigger,
|
|
119
|
-
onClick: N.value ? V : B,
|
|
120
|
-
children: [/* @__PURE__ */ d("span", {
|
|
121
|
-
className: i(t.value, Z ? void 0 : t.placeholder),
|
|
122
|
-
children: Z || te
|
|
123
|
-
}), /* @__PURE__ */ d("span", {
|
|
124
|
-
className: t.icon,
|
|
125
|
-
"aria-hidden": "true",
|
|
126
|
-
children: "📅"
|
|
127
|
-
})]
|
|
128
|
-
}), /* @__PURE__ */ f("div", {
|
|
129
|
-
role: "dialog",
|
|
130
|
-
className: t.panel,
|
|
131
|
-
"data-state": N.value ? "open" : "closed",
|
|
132
|
-
children: [
|
|
133
|
-
S && S.length > 0 && /* @__PURE__ */ d("div", {
|
|
134
|
-
className: t.presets,
|
|
135
|
-
children: S.map((e) => /* @__PURE__ */ d("button", {
|
|
136
|
-
type: "button",
|
|
137
|
-
className: t.preset,
|
|
138
|
-
onClick: () => W(e),
|
|
139
|
-
children: e.label
|
|
140
|
-
}, e.id ?? e.label))
|
|
141
|
-
}),
|
|
142
|
-
/* @__PURE__ */ f("div", {
|
|
143
|
-
className: t.calendars,
|
|
144
|
-
children: [
|
|
145
|
-
/* @__PURE__ */ d("div", {
|
|
146
|
-
className: t.calNav,
|
|
147
|
-
children: /* @__PURE__ */ d("button", {
|
|
148
|
-
type: "button",
|
|
149
|
-
className: t.navButton,
|
|
150
|
-
"aria-label": k,
|
|
151
|
-
onClick: () => H(-1),
|
|
152
|
-
children: "‹"
|
|
153
|
-
})
|
|
154
|
-
}),
|
|
155
|
-
/* @__PURE__ */ d(e, {
|
|
156
|
-
month: R.value,
|
|
157
|
-
year: L.value,
|
|
158
|
-
...$
|
|
159
|
-
}),
|
|
160
|
-
/* @__PURE__ */ d(e, {
|
|
161
|
-
month: Q.month,
|
|
162
|
-
year: Q.year,
|
|
163
|
-
...$
|
|
164
|
-
}),
|
|
165
|
-
/* @__PURE__ */ d("div", {
|
|
166
|
-
className: t.calNav,
|
|
167
|
-
children: /* @__PURE__ */ d("button", {
|
|
168
|
-
type: "button",
|
|
169
|
-
className: t.navButton,
|
|
170
|
-
"aria-label": A,
|
|
171
|
-
onClick: () => H(1),
|
|
172
|
-
children: "›"
|
|
173
|
-
})
|
|
174
|
-
})
|
|
175
|
-
]
|
|
176
|
-
}),
|
|
177
|
-
/* @__PURE__ */ f("div", {
|
|
178
|
-
className: t.footer,
|
|
179
|
-
children: [/* @__PURE__ */ d("button", {
|
|
180
|
-
type: "button",
|
|
181
|
-
className: t.clearBtn,
|
|
182
|
-
onClick: G,
|
|
183
|
-
children: re
|
|
184
|
-
}), /* @__PURE__ */ d("button", {
|
|
185
|
-
type: "button",
|
|
186
|
-
className: t.applyBtn,
|
|
187
|
-
onClick: V,
|
|
188
|
-
children: ne
|
|
189
|
-
})]
|
|
190
|
-
})
|
|
191
|
-
]
|
|
192
|
-
})]
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
//#endregion
|
|
196
|
-
export { g as DateRangePicker };
|
|
1
|
+
"use client";import{Calendar as e}from"../calendar/calendar.js";import t from"./date-range-picker.module.js";import{useRef as n}from"react";import{batch as r,cn as i,useControllableSignal as a,useSignal as o,useSignalEffect as s,useSignals as c}from"@cascivo/core";import{builtin as l,currentLocale as u,t as d}from"@cascivo/i18n";import{jsx as f,jsxs as p}from"react/jsx-runtime";function dayMs(e){return Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate())}function sameDay(e,t){return!e||!t?!1:dayMs(e)===dayMs(t)}function addMonths(e,t,n){let r=new Date(Date.UTC(e,t+n,1));return{year:r.getUTCFullYear(),month:r.getUTCMonth()}}function DateRangePicker({value:m,defaultValue:h,onValueChange:g,min:_,max:v,disabled:y,presets:b,locale:x,placeholder:S,size:C=`md`,labels:w,className:T}){c();let E=x??u(),D=S??d(l.dateRangePicker.placeholder),O=w?.apply??d(l.dateRangePicker.apply),k=w?.clear??d(l.dateRangePicker.clear),A=w?.previousMonth??d(l.calendar.previousMonth),j=w?.nextMonth??d(l.calendar.nextMonth),[M,N]=a({value:m===void 0?void 0:m,defaultValue:h??null,onChange:e=>{e&&g?.(e)}}),P=o(!1),F=o(null),I=o(null),L=M.value?.start??h?.start??new Date,R=o(L.getUTCFullYear()),z=o(L.getUTCMonth()),B=n(null);s(()=>{if(!P.value)return;let handler=e=>{B.current&&!B.current.contains(e.target)&&(P.value=!1)};return document.addEventListener(`mousedown`,handler),()=>document.removeEventListener(`mousedown`,handler)});let openPanel=()=>{P.value=!0},closePanel=()=>{P.value=!1},advance=e=>{let t=addMonths(R.value,z.value,e);r(()=>{R.value=t.year,z.value=t.month})},handleDayClick=e=>{let t=F.value;if(t===null){F.value=e;return}if(sameDay(t,e)){r(()=>{F.value=null,I.value=null}),N(null);return}let n=dayMs(t)<=dayMs(e)?{start:t,end:e}:{start:e,end:t};r(()=>{F.value=null,I.value=null}),N(n)},applyPreset=e=>{r(()=>{F.value=null,I.value=null,R.value=e.range.start.getUTCFullYear(),z.value=e.range.start.getUTCMonth()}),N(e.range)},clear=()=>{r(()=>{F.value=null,I.value=null}),N(null)},V=F.value??M.value?.start??null,H=F.value?I.value??null:M.value?.end??null,U=V&&H?Math.min(dayMs(V),dayMs(H)):null,W=V&&H?Math.max(dayMs(V),dayMs(H)):null,isInRange=e=>{if(U===null||W===null)return!1;let t=dayMs(e);return t>U&&t<W},isRangeStart=e=>sameDay(e,V)||U!==null&&dayMs(e)===U,isRangeEnd=e=>sameDay(e,H)||W!==null&&dayMs(e)===W,G=new Intl.DateTimeFormat(E,{year:`numeric`,month:`short`,day:`numeric`}),K=M.value?`${G.format(M.value.start)} → ${G.format(M.value.end)}`:``,q=addMonths(R.value,z.value,1),J={locale:E,size:C,..._===void 0?{}:{min:_},...v===void 0?{}:{max:v},...y===void 0?{}:{disabled:y},hideNav:!0,isInRange,isRangeStart,isRangeEnd,onValueChange:handleDayClick,onDayHover:e=>{I.value=e},labels:{previousMonth:A,nextMonth:j}};return p(`div`,{ref:B,className:i(t.wrapper,T),"data-size":C,onKeyDown:e=>{e.key===`Escape`&&P.value&&(e.stopPropagation(),closePanel())},children:[p(`button`,{type:`button`,role:`combobox`,"aria-expanded":P.value,"aria-haspopup":`dialog`,"aria-label":w?.label??d(l.dateRangePicker.label),className:t.trigger,onClick:P.value?closePanel:openPanel,children:[f(`span`,{className:i(t.value,K?void 0:t.placeholder),children:K||D}),f(`span`,{className:t.icon,"aria-hidden":`true`,children:`📅`})]}),p(`div`,{role:`dialog`,className:t.panel,"data-state":P.value?`open`:`closed`,children:[b&&b.length>0&&f(`div`,{className:t.presets,children:b.map(e=>f(`button`,{type:`button`,className:t.preset,onClick:()=>applyPreset(e),children:e.label},e.id??e.label))}),p(`div`,{className:t.calendars,children:[f(`div`,{className:t.calNav,children:f(`button`,{type:`button`,className:t.navButton,"aria-label":A,onClick:()=>advance(-1),children:`‹`})}),f(e,{month:z.value,year:R.value,...J}),f(e,{month:q.month,year:q.year,...J}),f(`div`,{className:t.calNav,children:f(`button`,{type:`button`,className:t.navButton,"aria-label":j,onClick:()=>advance(1),children:`›`})})]}),p(`div`,{className:t.footer,children:[f(`button`,{type:`button`,className:t.clearBtn,onClick:clear,children:k}),f(`button`,{type:`button`,className:t.applyBtn,onClick:closePanel,children:O})]})]})]})}export{DateRangePicker};
|
|
@@ -1,19 +1,2 @@
|
|
|
1
1
|
import './date-range-picker.css';
|
|
2
|
-
var e
|
|
3
|
-
wrapper: "_wrapper_k1szr_2",
|
|
4
|
-
trigger: "_trigger_k1szr_25",
|
|
5
|
-
value: "_value_k1szr_55",
|
|
6
|
-
placeholder: "_placeholder_k1szr_61",
|
|
7
|
-
icon: "_icon_k1szr_64",
|
|
8
|
-
panel: "_panel_k1szr_69",
|
|
9
|
-
calendars: "_calendars_k1szr_104",
|
|
10
|
-
calNav: "_calNav_k1szr_110",
|
|
11
|
-
navButton: "_navButton_k1szr_116",
|
|
12
|
-
presets: "_presets_k1szr_139",
|
|
13
|
-
preset: "_preset_k1szr_139",
|
|
14
|
-
footer: "_footer_k1szr_166",
|
|
15
|
-
clearBtn: "_clearBtn_k1szr_175",
|
|
16
|
-
applyBtn: "_applyBtn_k1szr_176"
|
|
17
|
-
};
|
|
18
|
-
//#endregion
|
|
19
|
-
export { e as default };
|
|
2
|
+
var e={wrapper:`_wrapper_k1szr_2`,trigger:`_trigger_k1szr_25`,value:`_value_k1szr_55`,placeholder:`_placeholder_k1szr_61`,icon:`_icon_k1szr_64`,panel:`_panel_k1szr_69`,calendars:`_calendars_k1szr_104`,calNav:`_calNav_k1szr_110`,navButton:`_navButton_k1szr_116`,presets:`_presets_k1szr_139`,preset:`_preset_k1szr_139`,footer:`_footer_k1szr_166`,clearBtn:`_clearBtn_k1szr_175`,applyBtn:`_applyBtn_k1szr_176`};export{e as default};
|
package/dist/dock/dock.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer cascivo.component{.
|
|
1
|
+
@layer cascivo.component{._dock_ggq7w_2{background-color:var(--cascivo-color-surface);border-block-start:1px solid var(--cascivo-border-subtle);z-index:var(--cascivo-z-dock,40);align-items:stretch;padding-block-end:env(safe-area-inset-bottom,0);display:flex;position:fixed;inset-block-end:0;inset-inline:0}@media (width>=64rem){._dock_ggq7w_2{display:none}}._item_ggq7w_23{min-block-size:var(--cascivo-target-min-coarse,2.75rem);cursor:pointer;color:var(--cascivo-color-text-muted);transition:color var(--cascivo-duration-100) var(--cascivo-ease-out);background:0 0;border:none;flex-direction:column;flex:1;justify-content:center;align-items:center;gap:.25rem;padding-block:.5rem;padding-inline:.25rem;text-decoration:none;display:flex}._item_ggq7w_23[data-active]{color:var(--cascivo-color-accent-text)}._item_ggq7w_23:focus-visible{outline:var(--cascivo-ring-width) solid var(--cascivo-ring-color);outline-offset:-2px}._icon_ggq7w_50{align-items:center;font-size:1.25rem;line-height:1;display:flex}._label_ggq7w_57{font-size:.6875rem;line-height:1}._item_ggq7w_23[data-active] ._label_ggq7w_57{font-weight:600}}
|
package/dist/dock/dock.js
CHANGED
|
@@ -1,34 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import e from "./dock.module.js";
|
|
4
|
-
import { getLinkComponent as t, useSignals as n } from "@cascivo/core";
|
|
5
|
-
import { builtin as r, t as i } from "@cascivo/i18n";
|
|
6
|
-
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
-
//#region ../components/src/dock/dock.tsx
|
|
8
|
-
function s({ items: s, activeIndex: c, className: l, ariaLabel: u, label: d }) {
|
|
9
|
-
return n(), /* @__PURE__ */ a("nav", {
|
|
10
|
-
"aria-label": u ?? d ?? i(r.dock.nav),
|
|
11
|
-
className: [e.dock, l].filter(Boolean).join(" "),
|
|
12
|
-
children: s.map((n, r) => {
|
|
13
|
-
let i = r === c;
|
|
14
|
-
return /* @__PURE__ */ o(n.href ? t() : "button", {
|
|
15
|
-
className: e.item,
|
|
16
|
-
"data-active": i || void 0,
|
|
17
|
-
"aria-current": i ? "page" : void 0,
|
|
18
|
-
...n.href ? { href: n.href } : {},
|
|
19
|
-
type: n.href ? void 0 : "button",
|
|
20
|
-
onClick: n.onClick,
|
|
21
|
-
children: [/* @__PURE__ */ a("span", {
|
|
22
|
-
className: e.icon,
|
|
23
|
-
"aria-hidden": "true",
|
|
24
|
-
children: n.icon
|
|
25
|
-
}), /* @__PURE__ */ a("span", {
|
|
26
|
-
className: e.label,
|
|
27
|
-
children: n.label
|
|
28
|
-
})]
|
|
29
|
-
}, n.id ?? `${r}-${n.label}`);
|
|
30
|
-
})
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
//#endregion
|
|
34
|
-
export { s as Dock };
|
|
1
|
+
"use client";import e from"./dock.module.js";import{getLinkComponent as t,useSignals as n}from"@cascivo/core";import{builtin as r,t as i}from"@cascivo/i18n";import{jsx as a,jsxs as o}from"react/jsx-runtime";function Dock({items:s,activeIndex:c,className:l,ariaLabel:u,label:d}){return n(),a(`nav`,{"aria-label":u??d??i(r.dock.nav),className:[e.dock,l].filter(Boolean).join(` `),children:s.map((n,r)=>{let i=r===c;return o(n.href?t():`button`,{className:e.item,"data-active":i||void 0,"aria-current":i?`page`:void 0,...n.href?{href:n.href}:{},type:n.href?void 0:`button`,onClick:n.onClick,children:[a(`span`,{className:e.icon,"aria-hidden":`true`,children:n.icon}),a(`span`,{className:e.label,children:n.label})]},n.id??`${r}-${n.label}`)})})}export{Dock};
|
package/dist/dock/dock.module.js
CHANGED
|
@@ -1,9 +1,2 @@
|
|
|
1
1
|
import './dock.css';
|
|
2
|
-
var e
|
|
3
|
-
dock: "_dock_cqgv4_2",
|
|
4
|
-
item: "_item_cqgv4_20",
|
|
5
|
-
icon: "_icon_cqgv4_47",
|
|
6
|
-
label: "_label_cqgv4_54"
|
|
7
|
-
};
|
|
8
|
-
//#endregion
|
|
9
|
-
export { e as default };
|
|
2
|
+
var e={dock:`_dock_ggq7w_2`,item:`_item_ggq7w_23`,icon:`_icon_ggq7w_50`,label:`_label_ggq7w_57`};export{e as default};
|
package/dist/drawer/drawer.js
CHANGED
|
@@ -1,96 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import e from "./drawer.module.js";
|
|
4
|
-
import { useId as t } from "react";
|
|
5
|
-
import { DismissableLayer as n, FocusScope as r, Portal as i, Presence as a, cn as o, useControllableSignal as s, useDraggable as c, useScrollLock as l, useSignals as u } from "@cascivo/core";
|
|
6
|
-
import { builtin as d, t as f } from "@cascivo/i18n";
|
|
7
|
-
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
8
|
-
//#region ../components/src/drawer/drawer.tsx
|
|
9
|
-
var h = 80;
|
|
10
|
-
function g({ open: g, defaultOpen: _, onOpenChange: v, side: y = "end", size: b, title: x, description: S, children: C, labels: w, className: T, swipeToDismiss: E = !1 }) {
|
|
11
|
-
u();
|
|
12
|
-
let [D, O] = s({
|
|
13
|
-
value: g,
|
|
14
|
-
defaultValue: _ ?? !1,
|
|
15
|
-
onChange: v
|
|
16
|
-
});
|
|
17
|
-
l(D);
|
|
18
|
-
let k = y === "top" || y === "bottom" ? "y" : "x", { handleRef: A, offset: j, isDragging: M, reset: N } = c({
|
|
19
|
-
isDisabled: !E,
|
|
20
|
-
axis: k,
|
|
21
|
-
onDragEnd: (e) => {
|
|
22
|
-
let t = k === "y" ? e.y : e.x, n = y === "end" && t > h || y === "start" && t < -80 || y === "bottom" && t > h || y === "top" && t < -80;
|
|
23
|
-
N(), n && O(!1);
|
|
24
|
-
}
|
|
25
|
-
}), P = t(), F = t(), I = w?.close ?? f(d.drawer.close), L = {
|
|
26
|
-
...b ? { "--_drawer-size": b } : {},
|
|
27
|
-
...E ? {
|
|
28
|
-
"--_drawer-drag-x": `${j.value.x}px`,
|
|
29
|
-
"--_drawer-drag-y": `${j.value.y}px`
|
|
30
|
-
} : {}
|
|
31
|
-
};
|
|
32
|
-
return /* @__PURE__ */ p(i, { children: /* @__PURE__ */ p(a, {
|
|
33
|
-
present: D,
|
|
34
|
-
children: /* @__PURE__ */ p("div", {
|
|
35
|
-
className: e.overlay,
|
|
36
|
-
"data-side": y,
|
|
37
|
-
children: /* @__PURE__ */ p(n, {
|
|
38
|
-
onDismiss: () => O(!1),
|
|
39
|
-
children: /* @__PURE__ */ p(r, {
|
|
40
|
-
trapped: !0,
|
|
41
|
-
restoreFocus: !0,
|
|
42
|
-
autoFocus: !0,
|
|
43
|
-
children: /* @__PURE__ */ m("div", {
|
|
44
|
-
role: "dialog",
|
|
45
|
-
"aria-modal": "true",
|
|
46
|
-
"aria-labelledby": x ? P : void 0,
|
|
47
|
-
"aria-describedby": S ? F : void 0,
|
|
48
|
-
"data-side": y,
|
|
49
|
-
"data-dragging": E && M.value ? "" : void 0,
|
|
50
|
-
className: o(e.panel, T),
|
|
51
|
-
style: L,
|
|
52
|
-
children: [(x || S) && /* @__PURE__ */ m("div", {
|
|
53
|
-
className: e.header,
|
|
54
|
-
ref: E ? A : void 0,
|
|
55
|
-
children: [/* @__PURE__ */ m("div", {
|
|
56
|
-
className: e.heading,
|
|
57
|
-
children: [x && /* @__PURE__ */ p("h2", {
|
|
58
|
-
id: P,
|
|
59
|
-
className: e.title,
|
|
60
|
-
children: x
|
|
61
|
-
}), S && /* @__PURE__ */ p("p", {
|
|
62
|
-
id: F,
|
|
63
|
-
className: e.description,
|
|
64
|
-
children: S
|
|
65
|
-
})]
|
|
66
|
-
}), /* @__PURE__ */ p("button", {
|
|
67
|
-
type: "button",
|
|
68
|
-
"aria-label": I,
|
|
69
|
-
onClick: () => O(!1),
|
|
70
|
-
className: e.close,
|
|
71
|
-
children: /* @__PURE__ */ p("svg", {
|
|
72
|
-
"aria-hidden": "true",
|
|
73
|
-
viewBox: "0 0 16 16",
|
|
74
|
-
className: e.closeIcon,
|
|
75
|
-
children: /* @__PURE__ */ p("path", {
|
|
76
|
-
d: "M4 4l8 8M12 4l-8 8",
|
|
77
|
-
fill: "none",
|
|
78
|
-
stroke: "currentColor",
|
|
79
|
-
strokeWidth: "1.5",
|
|
80
|
-
strokeLinecap: "round"
|
|
81
|
-
})
|
|
82
|
-
})
|
|
83
|
-
})]
|
|
84
|
-
}), /* @__PURE__ */ p("div", {
|
|
85
|
-
className: e.body,
|
|
86
|
-
"data-cascivo-drawer-body": "",
|
|
87
|
-
children: C
|
|
88
|
-
})]
|
|
89
|
-
})
|
|
90
|
-
})
|
|
91
|
-
})
|
|
92
|
-
})
|
|
93
|
-
}) });
|
|
94
|
-
}
|
|
95
|
-
//#endregion
|
|
96
|
-
export { g as Drawer };
|
|
1
|
+
"use client";import e from"./drawer.module.js";import{useId as t}from"react";import{DismissableLayer as n,FocusScope as r,Portal as i,Presence as a,cn as o,useControllableSignal as s,useDraggable as c,useScrollLock as l,useSignals as u}from"@cascivo/core";import{builtin as d,t as f}from"@cascivo/i18n";import{jsx as p,jsxs as m}from"react/jsx-runtime";var h=80;function Drawer({open:g,defaultOpen:_,onOpenChange:v,side:y=`end`,size:b,title:x,description:S,children:C,labels:w,className:T,swipeToDismiss:E=!1}){u();let[D,O]=s({value:g,defaultValue:_??!1,onChange:v});l(D);let k=y===`top`||y===`bottom`?`y`:`x`,{handleRef:A,offset:j,isDragging:M,reset:N}=c({isDisabled:!E,axis:k,onDragEnd:e=>{let t=k===`y`?e.y:e.x,n=y===`end`&&t>h||y===`start`&&t<-80||y===`bottom`&&t>h||y===`top`&&t<-80;N(),n&&O(!1)}}),P=t(),F=t(),I=w?.close??f(d.drawer.close),L={...b?{"--_drawer-size":b}:{},...E?{"--_drawer-drag-x":`${j.value.x}px`,"--_drawer-drag-y":`${j.value.y}px`}:{}};return p(i,{children:p(a,{present:D,children:p(`div`,{className:e.overlay,"data-side":y,children:p(n,{onDismiss:()=>O(!1),children:p(r,{trapped:!0,restoreFocus:!0,autoFocus:!0,children:m(`div`,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":x?P:void 0,"aria-describedby":S?F:void 0,"data-side":y,"data-dragging":E&&M.value?``:void 0,className:o(e.panel,T),style:L,children:[(x||S)&&m(`div`,{className:e.header,ref:E?A:void 0,children:[m(`div`,{className:e.heading,children:[x&&p(`h2`,{id:P,className:e.title,children:x}),S&&p(`p`,{id:F,className:e.description,children:S})]}),p(`button`,{type:`button`,"aria-label":I,onClick:()=>O(!1),className:e.close,children:p(`svg`,{"aria-hidden":`true`,viewBox:`0 0 16 16`,className:e.closeIcon,children:p(`path`,{d:`M4 4l8 8M12 4l-8 8`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`})})})]}),p(`div`,{className:e.body,"data-cascivo-drawer-body":``,children:C})]})})})})})})}export{Drawer};
|
|
@@ -1,14 +1,2 @@
|
|
|
1
1
|
import './drawer.css';
|
|
2
|
-
var e
|
|
3
|
-
overlay: "_overlay_1q94b_2",
|
|
4
|
-
panel: "_panel_1q94b_39",
|
|
5
|
-
header: "_header_1q94b_124",
|
|
6
|
-
heading: "_heading_1q94b_134",
|
|
7
|
-
title: "_title_1q94b_140",
|
|
8
|
-
description: "_description_1q94b_147",
|
|
9
|
-
close: "_close_1q94b_153",
|
|
10
|
-
closeIcon: "_closeIcon_1q94b_181",
|
|
11
|
-
body: "_body_1q94b_186"
|
|
12
|
-
};
|
|
13
|
-
//#endregion
|
|
14
|
-
export { e as default };
|
|
2
|
+
var e={overlay:`_overlay_1q94b_2`,panel:`_panel_1q94b_39`,header:`_header_1q94b_124`,heading:`_heading_1q94b_134`,title:`_title_1q94b_140`,description:`_description_1q94b_147`,close:`_close_1q94b_153`,closeIcon:`_closeIcon_1q94b_181`,body:`_body_1q94b_186`};export{e as default};
|