@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,421 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { Spinner as e } from "../spinner/spinner.js";
|
|
4
|
-
import { Kbd as t } from "../kbd/kbd.js";
|
|
5
|
-
import n from "./command-menu.module.js";
|
|
6
|
-
import { useId as r, useRef as i } from "react";
|
|
7
|
-
import { batch as a, cn as o, focusElement as s, useEffectPropSignal as c, useSignal as l, useSignalEffect as u, useSignals as d } from "@cascivo/core";
|
|
8
|
-
import { builtin as f, t as p } from "@cascivo/i18n";
|
|
9
|
-
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
10
|
-
//#region ../components/src/command-menu/command-menu.tsx
|
|
11
|
-
function g(e, t) {
|
|
12
|
-
if (e.length === 0) return {
|
|
13
|
-
score: 1,
|
|
14
|
-
indices: []
|
|
15
|
-
};
|
|
16
|
-
let n = e.toLowerCase(), r = t.toLowerCase(), i = 0, a = 0, o = -2, s = [];
|
|
17
|
-
for (let e = 0; e < r.length && a < n.length; e++) {
|
|
18
|
-
if (r[e] !== n[a]) continue;
|
|
19
|
-
i += 1, e === o + 1 && (i += 4);
|
|
20
|
-
let t = e === 0 ? " " : r[e - 1];
|
|
21
|
-
(t === " " || t === "-" || t === "_" || t === "/") && (i += 8), o = e, s.push(e), a++;
|
|
22
|
-
}
|
|
23
|
-
return a === n.length ? {
|
|
24
|
-
score: i,
|
|
25
|
-
indices: s
|
|
26
|
-
} : null;
|
|
27
|
-
}
|
|
28
|
-
function _(e, t) {
|
|
29
|
-
return g(e, t)?.score ?? 0;
|
|
30
|
-
}
|
|
31
|
-
function v(e, t) {
|
|
32
|
-
let n = _(e, t.label);
|
|
33
|
-
for (let r of t.keywords ?? []) {
|
|
34
|
-
let t = _(e, r);
|
|
35
|
-
t > n && (n = t);
|
|
36
|
-
}
|
|
37
|
-
return n;
|
|
38
|
-
}
|
|
39
|
-
function ee(e, t) {
|
|
40
|
-
if (t.length === 0) return e;
|
|
41
|
-
let r = new Set(t), i = [], a = "", o = r.has(0), s = (e) => {
|
|
42
|
-
a !== "" && (i.push(o ? /* @__PURE__ */ m("mark", {
|
|
43
|
-
className: n.match,
|
|
44
|
-
children: a
|
|
45
|
-
}, e) : a), a = "");
|
|
46
|
-
};
|
|
47
|
-
for (let t = 0; t < e.length; t++) {
|
|
48
|
-
let n = r.has(t);
|
|
49
|
-
n !== o && (s(t), o = n), a += e[t];
|
|
50
|
-
}
|
|
51
|
-
return s(e.length), i;
|
|
52
|
-
}
|
|
53
|
-
function te(e, t) {
|
|
54
|
-
for (let n of t) {
|
|
55
|
-
let t = n.prefix;
|
|
56
|
-
if (t) {
|
|
57
|
-
if (e.startsWith(`${t} `) || e.startsWith(`${t}:`)) return {
|
|
58
|
-
scope: n,
|
|
59
|
-
rest: e.slice(t.length + 1).replace(/^\s+/, "")
|
|
60
|
-
};
|
|
61
|
-
if (!/\w/.test(t) && e.startsWith(t)) return {
|
|
62
|
-
scope: n,
|
|
63
|
-
rest: e.slice(t.length).replace(/^\s+/, "")
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return null;
|
|
68
|
-
}
|
|
69
|
-
function y({ open: _, onOpenChange: y, groups: ne, placeholder: b, emptyLabel: x, hotkey: re = !0, label: S, ariaLabel: ie, loading: C = !1, onQueryChange: w, scopes: T = [], className: ae }) {
|
|
70
|
-
d();
|
|
71
|
-
let E = ie ?? S ?? p(f.commandMenu.label), D = x ?? p(f.commandMenu.empty), O = r(), k = `${O}-listbox`, A = i(null), j = i(null), M = i([]), N = i(y);
|
|
72
|
-
N.current = y;
|
|
73
|
-
let P = i(w);
|
|
74
|
-
P.current = w;
|
|
75
|
-
let F = c(_), oe = c(re), I = l(""), L = l(0), R = l([]), z = l(null), se = R.value.at(-1)?.groups ?? ne, B = b ?? R.value.at(-1)?.placeholder ?? p(f.commandMenu.placeholder), V = T.find((e) => e.id === z.value) ?? null, H = se.filter((e) => !z.value || !e.scope || e.scope === z.value).map((e) => ({
|
|
76
|
-
heading: e.heading,
|
|
77
|
-
items: e.items.map((e) => ({
|
|
78
|
-
item: e,
|
|
79
|
-
score: v(I.value, e)
|
|
80
|
-
})).filter(({ score: e }) => e > 0).sort((e, t) => t.score - e.score).map(({ item: e }) => ({
|
|
81
|
-
item: e,
|
|
82
|
-
indices: g(I.value, e.label)?.indices ?? []
|
|
83
|
-
}))
|
|
84
|
-
})).filter((e) => e.items.length > 0), U = H.flatMap((e) => e.items.map((e) => e.item)), W = U.flatMap((e, t) => e.disabled ? [] : [t]), G = W.includes(L.value) ? L.value : W[0] ?? -1, K = (e) => `${O}-option-${e}`;
|
|
85
|
-
u(() => {
|
|
86
|
-
let e = A.current;
|
|
87
|
-
e && (F.value ? e.open || (a(() => {
|
|
88
|
-
I.value = "", L.value = 0, R.value = [], z.value = null;
|
|
89
|
-
}), typeof e.showModal == "function" && e.showModal(), s(j.current)) : e.open && (R.value = [], e.close()));
|
|
90
|
-
}), u(() => {
|
|
91
|
-
let e = A.current;
|
|
92
|
-
if (!e) return;
|
|
93
|
-
let t = () => N.current(!1);
|
|
94
|
-
return e.addEventListener("close", t), () => e.removeEventListener("close", t);
|
|
95
|
-
}), u(() => {
|
|
96
|
-
if (!oe.value) return;
|
|
97
|
-
let e = (e) => {
|
|
98
|
-
(e.metaKey || e.ctrlKey) && e.key.toLowerCase() === "k" && (e.preventDefault(), N.current(!F.value));
|
|
99
|
-
};
|
|
100
|
-
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
101
|
-
});
|
|
102
|
-
let q = (e) => {
|
|
103
|
-
L.value = e;
|
|
104
|
-
let t = M.current[e];
|
|
105
|
-
t && typeof t.scrollIntoView == "function" && t.scrollIntoView({ block: "nearest" });
|
|
106
|
-
}, J = (e) => {
|
|
107
|
-
if (W.length === 0) return;
|
|
108
|
-
let t = W[(W.indexOf(G) + e + W.length) % W.length];
|
|
109
|
-
t !== void 0 && q(t);
|
|
110
|
-
}, Y = (e) => {
|
|
111
|
-
e.onSelect(), y(!1);
|
|
112
|
-
}, X = (e, t) => {
|
|
113
|
-
if (!(!e || e.disabled)) {
|
|
114
|
-
if (e.page) {
|
|
115
|
-
if (t === "secondary") return;
|
|
116
|
-
a(() => {
|
|
117
|
-
R.value = [...R.value, e.page], I.value = "", L.value = 0;
|
|
118
|
-
});
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
if (e.actions && e.actions.length > 0) {
|
|
122
|
-
let n = t === "secondary" ? e.actions[1] : e.actions[0];
|
|
123
|
-
n && Y(n);
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
t !== "secondary" && (e.onSelect?.(), y(!1));
|
|
127
|
-
}
|
|
128
|
-
}, ce = (e) => {
|
|
129
|
-
if (T.length === 0) return;
|
|
130
|
-
let t = [null, ...T.map((e) => e.id)], n = t[(t.indexOf(z.value) + e + t.length) % t.length];
|
|
131
|
-
a(() => {
|
|
132
|
-
z.value = n ?? null, L.value = 0;
|
|
133
|
-
});
|
|
134
|
-
}, Z = () => {
|
|
135
|
-
a(() => {
|
|
136
|
-
z.value = null, L.value = 0;
|
|
137
|
-
}), s(j.current);
|
|
138
|
-
}, Q = () => {
|
|
139
|
-
a(() => {
|
|
140
|
-
R.value = R.value.slice(0, -1), I.value = "", L.value = 0;
|
|
141
|
-
});
|
|
142
|
-
}, le = (e) => {
|
|
143
|
-
switch (e.key) {
|
|
144
|
-
case "ArrowDown":
|
|
145
|
-
e.preventDefault(), J(1);
|
|
146
|
-
break;
|
|
147
|
-
case "ArrowUp":
|
|
148
|
-
e.preventDefault(), J(-1);
|
|
149
|
-
break;
|
|
150
|
-
case "Tab":
|
|
151
|
-
T.length > 0 && (e.preventDefault(), ce(e.shiftKey ? -1 : 1));
|
|
152
|
-
break;
|
|
153
|
-
case "Home":
|
|
154
|
-
e.preventDefault(), W[0] !== void 0 && q(W[0]);
|
|
155
|
-
break;
|
|
156
|
-
case "End": {
|
|
157
|
-
e.preventDefault();
|
|
158
|
-
let t = W[W.length - 1];
|
|
159
|
-
t !== void 0 && q(t);
|
|
160
|
-
break;
|
|
161
|
-
}
|
|
162
|
-
case "Enter":
|
|
163
|
-
e.preventDefault(), G >= 0 && X(U[G], e.metaKey || e.ctrlKey ? "secondary" : "primary");
|
|
164
|
-
break;
|
|
165
|
-
case "Backspace":
|
|
166
|
-
I.value === "" && (R.value.length > 0 ? (e.preventDefault(), Q()) : z.value && (e.preventDefault(), Z()));
|
|
167
|
-
break;
|
|
168
|
-
}
|
|
169
|
-
}, ue = (e) => {
|
|
170
|
-
e.key === "Escape" && (e.preventDefault(), R.value.length > 0 ? Q() : A.current?.close());
|
|
171
|
-
}, de = (e) => {
|
|
172
|
-
e.target === A.current && A.current?.close();
|
|
173
|
-
}, $ = -1;
|
|
174
|
-
return /* @__PURE__ */ m("dialog", {
|
|
175
|
-
ref: A,
|
|
176
|
-
"aria-label": E,
|
|
177
|
-
className: o(n.dialog, ae),
|
|
178
|
-
onClick: de,
|
|
179
|
-
onKeyDown: ue,
|
|
180
|
-
children: /* @__PURE__ */ h("div", {
|
|
181
|
-
className: n.panel,
|
|
182
|
-
children: [
|
|
183
|
-
/* @__PURE__ */ h("div", {
|
|
184
|
-
className: n.search,
|
|
185
|
-
children: [
|
|
186
|
-
/* @__PURE__ */ h("svg", {
|
|
187
|
-
className: n.searchIcon,
|
|
188
|
-
"aria-hidden": "true",
|
|
189
|
-
viewBox: "0 0 16 16",
|
|
190
|
-
width: "16",
|
|
191
|
-
height: "16",
|
|
192
|
-
fill: "none",
|
|
193
|
-
stroke: "currentColor",
|
|
194
|
-
strokeWidth: "1.5",
|
|
195
|
-
strokeLinecap: "round",
|
|
196
|
-
children: [/* @__PURE__ */ m("circle", {
|
|
197
|
-
cx: "7",
|
|
198
|
-
cy: "7",
|
|
199
|
-
r: "4.5"
|
|
200
|
-
}), /* @__PURE__ */ m("line", {
|
|
201
|
-
x1: "10.5",
|
|
202
|
-
y1: "10.5",
|
|
203
|
-
x2: "14",
|
|
204
|
-
y2: "14"
|
|
205
|
-
})]
|
|
206
|
-
}),
|
|
207
|
-
V && /* @__PURE__ */ h("span", {
|
|
208
|
-
className: n.scopeChip,
|
|
209
|
-
children: [V.label, /* @__PURE__ */ m("button", {
|
|
210
|
-
type: "button",
|
|
211
|
-
className: n.scopeClear,
|
|
212
|
-
"aria-label": p(f.commandMenu.clearScope),
|
|
213
|
-
onClick: Z,
|
|
214
|
-
children: /* @__PURE__ */ m("svg", {
|
|
215
|
-
viewBox: "0 0 16 16",
|
|
216
|
-
width: "12",
|
|
217
|
-
height: "12",
|
|
218
|
-
"aria-hidden": "true",
|
|
219
|
-
children: /* @__PURE__ */ m("path", {
|
|
220
|
-
d: "M4 4l8 8M12 4l-8 8",
|
|
221
|
-
fill: "none",
|
|
222
|
-
stroke: "currentColor",
|
|
223
|
-
strokeWidth: "1.5",
|
|
224
|
-
strokeLinecap: "round"
|
|
225
|
-
})
|
|
226
|
-
})
|
|
227
|
-
})]
|
|
228
|
-
}),
|
|
229
|
-
/* @__PURE__ */ m("input", {
|
|
230
|
-
ref: j,
|
|
231
|
-
type: "text",
|
|
232
|
-
role: "combobox",
|
|
233
|
-
"aria-expanded": "true",
|
|
234
|
-
"aria-controls": k,
|
|
235
|
-
"aria-activedescendant": G >= 0 ? K(G) : void 0,
|
|
236
|
-
"aria-autocomplete": "list",
|
|
237
|
-
"aria-label": E,
|
|
238
|
-
autoComplete: "off",
|
|
239
|
-
spellCheck: !1,
|
|
240
|
-
className: n.input,
|
|
241
|
-
placeholder: B,
|
|
242
|
-
value: I.value,
|
|
243
|
-
onChange: (e) => {
|
|
244
|
-
let t = e.target.value;
|
|
245
|
-
if (!z.value && T.length > 0) {
|
|
246
|
-
let e = te(t, T);
|
|
247
|
-
e && (z.value = e.scope.id, t = e.rest);
|
|
248
|
-
}
|
|
249
|
-
I.value = t, L.value = 0, P.current?.(t);
|
|
250
|
-
},
|
|
251
|
-
onKeyDown: le
|
|
252
|
-
})
|
|
253
|
-
]
|
|
254
|
-
}),
|
|
255
|
-
T.length > 0 && /* @__PURE__ */ h("div", {
|
|
256
|
-
className: n.scopes,
|
|
257
|
-
children: [/* @__PURE__ */ m("span", {
|
|
258
|
-
className: n.scopesLabel,
|
|
259
|
-
children: p(f.commandMenu.scopeLabel)
|
|
260
|
-
}), T.map((e) => /* @__PURE__ */ h("button", {
|
|
261
|
-
type: "button",
|
|
262
|
-
className: n.scopePill,
|
|
263
|
-
"data-active": e.id === z.value || void 0,
|
|
264
|
-
onClick: () => {
|
|
265
|
-
a(() => {
|
|
266
|
-
z.value = z.value === e.id ? null : e.id, L.value = 0;
|
|
267
|
-
}), s(j.current);
|
|
268
|
-
},
|
|
269
|
-
children: [e.prefix && /* @__PURE__ */ m("span", {
|
|
270
|
-
className: n.scopePrefix,
|
|
271
|
-
children: e.prefix
|
|
272
|
-
}), e.label]
|
|
273
|
-
}, e.id))]
|
|
274
|
-
}),
|
|
275
|
-
/* @__PURE__ */ h("div", {
|
|
276
|
-
className: n.list,
|
|
277
|
-
children: [/* @__PURE__ */ m("div", {
|
|
278
|
-
role: "listbox",
|
|
279
|
-
id: k,
|
|
280
|
-
"aria-label": S,
|
|
281
|
-
tabIndex: 0,
|
|
282
|
-
children: H.map((e, r) => /* @__PURE__ */ h("div", {
|
|
283
|
-
role: "group",
|
|
284
|
-
"aria-label": e.heading,
|
|
285
|
-
className: n.group,
|
|
286
|
-
children: [e.heading && /* @__PURE__ */ h("div", {
|
|
287
|
-
className: n.heading,
|
|
288
|
-
"aria-hidden": "true",
|
|
289
|
-
children: [/* @__PURE__ */ m("span", { children: e.heading }), I.value !== "" && /* @__PURE__ */ m("span", {
|
|
290
|
-
className: n.count,
|
|
291
|
-
children: p(f.commandMenu.matches, { count: e.items.length })
|
|
292
|
-
})]
|
|
293
|
-
}), e.items.map((e) => {
|
|
294
|
-
let { item: r, indices: i } = e;
|
|
295
|
-
$++;
|
|
296
|
-
let a = $;
|
|
297
|
-
return /* @__PURE__ */ h("div", {
|
|
298
|
-
ref: (e) => {
|
|
299
|
-
M.current[a] = e;
|
|
300
|
-
},
|
|
301
|
-
id: K(a),
|
|
302
|
-
role: "option",
|
|
303
|
-
"aria-selected": a === G,
|
|
304
|
-
"aria-disabled": r.disabled || void 0,
|
|
305
|
-
"data-state": a === G ? "active" : void 0,
|
|
306
|
-
"data-disabled": r.disabled || void 0,
|
|
307
|
-
className: n.option,
|
|
308
|
-
onMouseEnter: () => {
|
|
309
|
-
r.disabled || (L.value = a);
|
|
310
|
-
},
|
|
311
|
-
onClick: () => X(r, "primary"),
|
|
312
|
-
children: [
|
|
313
|
-
r.icon && /* @__PURE__ */ m("span", {
|
|
314
|
-
className: n.icon,
|
|
315
|
-
"aria-hidden": "true",
|
|
316
|
-
children: r.icon
|
|
317
|
-
}),
|
|
318
|
-
/* @__PURE__ */ h("span", {
|
|
319
|
-
className: n.text,
|
|
320
|
-
children: [/* @__PURE__ */ m("span", {
|
|
321
|
-
className: n.label,
|
|
322
|
-
children: ee(r.label, i)
|
|
323
|
-
}), r.description && /* @__PURE__ */ m("span", {
|
|
324
|
-
className: n.description,
|
|
325
|
-
children: r.description
|
|
326
|
-
})]
|
|
327
|
-
}),
|
|
328
|
-
r.status && /* @__PURE__ */ h("span", {
|
|
329
|
-
className: n.status,
|
|
330
|
-
"data-tone": r.status.tone ?? "neutral",
|
|
331
|
-
children: [/* @__PURE__ */ m("span", {
|
|
332
|
-
className: n.statusDot,
|
|
333
|
-
"aria-hidden": "true"
|
|
334
|
-
}), r.status.label]
|
|
335
|
-
}),
|
|
336
|
-
r.actions && r.actions.length > 0 && /* @__PURE__ */ m("span", {
|
|
337
|
-
className: n.actions,
|
|
338
|
-
children: r.actions.map((e) => /* @__PURE__ */ h("span", {
|
|
339
|
-
className: n.action,
|
|
340
|
-
onClick: (t) => {
|
|
341
|
-
t.stopPropagation(), Y(e);
|
|
342
|
-
},
|
|
343
|
-
children: [e.label, e.shortcut && /* @__PURE__ */ m("span", {
|
|
344
|
-
className: n.actionKeys,
|
|
345
|
-
"aria-hidden": "true",
|
|
346
|
-
children: e.shortcut.map((e, n) => /* @__PURE__ */ m(t, {
|
|
347
|
-
size: "sm",
|
|
348
|
-
children: e
|
|
349
|
-
}, n))
|
|
350
|
-
})]
|
|
351
|
-
}, e.id))
|
|
352
|
-
}),
|
|
353
|
-
r.shortcut && /* @__PURE__ */ m("span", {
|
|
354
|
-
className: n.shortcut,
|
|
355
|
-
"aria-hidden": "true",
|
|
356
|
-
children: r.shortcut.map((e, n) => /* @__PURE__ */ m(t, {
|
|
357
|
-
size: "sm",
|
|
358
|
-
children: e
|
|
359
|
-
}, n))
|
|
360
|
-
})
|
|
361
|
-
]
|
|
362
|
-
}, r.id);
|
|
363
|
-
})]
|
|
364
|
-
}, e.heading ?? `group-${r}`))
|
|
365
|
-
}), U.length === 0 && (C ? /* @__PURE__ */ h("div", {
|
|
366
|
-
role: "status",
|
|
367
|
-
className: n.empty,
|
|
368
|
-
children: [/* @__PURE__ */ m(e, { size: "sm" }), p(f.commandMenu.loading)]
|
|
369
|
-
}) : /* @__PURE__ */ m("div", {
|
|
370
|
-
role: "status",
|
|
371
|
-
className: n.empty,
|
|
372
|
-
children: D
|
|
373
|
-
}))]
|
|
374
|
-
}),
|
|
375
|
-
/* @__PURE__ */ h("div", {
|
|
376
|
-
className: n.footer,
|
|
377
|
-
"aria-hidden": "true",
|
|
378
|
-
children: [
|
|
379
|
-
/* @__PURE__ */ h("span", {
|
|
380
|
-
className: n.hint,
|
|
381
|
-
children: [
|
|
382
|
-
/* @__PURE__ */ m(t, {
|
|
383
|
-
size: "sm",
|
|
384
|
-
children: "↑"
|
|
385
|
-
}),
|
|
386
|
-
/* @__PURE__ */ m(t, {
|
|
387
|
-
size: "sm",
|
|
388
|
-
children: "↓"
|
|
389
|
-
}),
|
|
390
|
-
" navigate"
|
|
391
|
-
]
|
|
392
|
-
}),
|
|
393
|
-
/* @__PURE__ */ h("span", {
|
|
394
|
-
className: n.hint,
|
|
395
|
-
children: [/* @__PURE__ */ m(t, {
|
|
396
|
-
size: "sm",
|
|
397
|
-
children: "↵"
|
|
398
|
-
}), " open"]
|
|
399
|
-
}),
|
|
400
|
-
T.length > 0 && /* @__PURE__ */ h("span", {
|
|
401
|
-
className: n.hint,
|
|
402
|
-
children: [/* @__PURE__ */ m(t, {
|
|
403
|
-
size: "sm",
|
|
404
|
-
children: "Tab"
|
|
405
|
-
}), " scope"]
|
|
406
|
-
}),
|
|
407
|
-
/* @__PURE__ */ h("span", {
|
|
408
|
-
className: n.hint,
|
|
409
|
-
children: [/* @__PURE__ */ m(t, {
|
|
410
|
-
size: "sm",
|
|
411
|
-
children: "esc"
|
|
412
|
-
}), " close"]
|
|
413
|
-
})
|
|
414
|
-
]
|
|
415
|
-
})
|
|
416
|
-
]
|
|
417
|
-
})
|
|
418
|
-
});
|
|
419
|
-
}
|
|
420
|
-
//#endregion
|
|
421
|
-
export { y as CommandMenu, g as fuzzyMatch, _ as fuzzyScore };
|
|
1
|
+
"use client";import{Spinner as e}from"../spinner/spinner.js";import{Kbd as t}from"../kbd/kbd.js";import n from"./command-menu.module.js";import{useId as r,useRef as i}from"react";import{batch as a,cn as o,focusElement as s,useEffectPropSignal as c,useSignal as l,useSignalEffect as u,useSignals as d}from"@cascivo/core";import{builtin as f,t as p}from"@cascivo/i18n";import{jsx as m,jsxs as h}from"react/jsx-runtime";function fuzzyMatch(e,t){if(e.length===0)return{score:1,indices:[]};let n=e.toLowerCase(),r=t.toLowerCase(),i=0,a=0,o=-2,s=[];for(let e=0;e<r.length&&a<n.length;e++){if(r[e]!==n[a])continue;i+=1,e===o+1&&(i+=4);let t=e===0?` `:r[e-1];(t===` `||t===`-`||t===`_`||t===`/`)&&(i+=8),o=e,s.push(e),a++}return a===n.length?{score:i,indices:s}:null}function fuzzyScore(e,t){return fuzzyMatch(e,t)?.score??0}function itemScore(e,t){let n=fuzzyScore(e,t.label);for(let r of t.keywords??[]){let t=fuzzyScore(e,r);t>n&&(n=t)}return n}function highlightLabel(e,t){if(t.length===0)return e;let r=new Set(t),i=[],a=``,o=r.has(0),flush=e=>{a!==``&&(i.push(o?m(`mark`,{className:n.match,children:a},e):a),a=``)};for(let t=0;t<e.length;t++){let n=r.has(t);n!==o&&(flush(t),o=n),a+=e[t]}return flush(e.length),i}function matchScopePrefix(e,t){for(let n of t){let t=n.prefix;if(t){if(e.startsWith(`${t} `)||e.startsWith(`${t}:`))return{scope:n,rest:e.slice(t.length+1).replace(/^\s+/,``)};if(!/\w/.test(t)&&e.startsWith(t))return{scope:n,rest:e.slice(t.length).replace(/^\s+/,``)}}}return null}function CommandMenu({open:g,onOpenChange:_,groups:v,placeholder:y,emptyLabel:b,hotkey:x=!0,label:S,ariaLabel:C,loading:w=!1,onQueryChange:T,scopes:E=[],className:D}){d();let O=C??S??p(f.commandMenu.label),k=b??p(f.commandMenu.empty),A=r(),j=`${A}-listbox`,M=i(null),N=i(null),P=i([]),F=i(_);F.current=_;let I=i(T);I.current=T;let L=c(g),R=c(x),z=l(``),B=l(0),V=l([]),H=l(null),U=V.value.at(-1)?.groups??v,W=y??V.value.at(-1)?.placeholder??p(f.commandMenu.placeholder),G=E.find(e=>e.id===H.value)??null,K=U.filter(e=>!H.value||!e.scope||e.scope===H.value).map(e=>({heading:e.heading,items:e.items.map(e=>({item:e,score:itemScore(z.value,e)})).filter(({score:e})=>e>0).sort((e,t)=>t.score-e.score).map(({item:e})=>({item:e,indices:fuzzyMatch(z.value,e.label)?.indices??[]}))})).filter(e=>e.items.length>0),q=K.flatMap(e=>e.items.map(e=>e.item)),J=q.flatMap((e,t)=>e.disabled?[]:[t]),Y=J.includes(B.value)?B.value:J[0]??-1,optionId=e=>`${A}-option-${e}`;u(()=>{let e=M.current;e&&(L.value?e.open||(a(()=>{z.value=``,B.value=0,V.value=[],H.value=null}),typeof e.showModal==`function`&&e.showModal(),s(N.current)):e.open&&(V.value=[],e.close()))}),u(()=>{let e=M.current;if(!e)return;let handler=()=>F.current(!1);return e.addEventListener(`close`,handler),()=>e.removeEventListener(`close`,handler)}),u(()=>{if(!R.value)return;let handler=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),F.current(!L.value))};return window.addEventListener(`keydown`,handler),()=>window.removeEventListener(`keydown`,handler)});let setActive=e=>{B.value=e;let t=P.current[e];t&&typeof t.scrollIntoView==`function`&&t.scrollIntoView({block:`nearest`})},moveActive=e=>{if(J.length===0)return;let t=J[(J.indexOf(Y)+e+J.length)%J.length];t!==void 0&&setActive(t)},runAction=e=>{e.onSelect(),_(!1)},activateItem=(e,t)=>{if(!(!e||e.disabled)){if(e.page){if(t===`secondary`)return;a(()=>{V.value=[...V.value,e.page],z.value=``,B.value=0});return}if(e.actions&&e.actions.length>0){let n=t===`secondary`?e.actions[1]:e.actions[0];n&&runAction(n);return}t!==`secondary`&&(e.onSelect?.(),_(!1))}},cycleScope=e=>{if(E.length===0)return;let t=[null,...E.map(e=>e.id)],n=t[(t.indexOf(H.value)+e+t.length)%t.length];a(()=>{H.value=n??null,B.value=0})},clearScope=()=>{a(()=>{H.value=null,B.value=0}),s(N.current)},popPage=()=>{a(()=>{V.value=V.value.slice(0,-1),z.value=``,B.value=0})},handleInputKeyDown=e=>{switch(e.key){case`ArrowDown`:e.preventDefault(),moveActive(1);break;case`ArrowUp`:e.preventDefault(),moveActive(-1);break;case`Tab`:E.length>0&&(e.preventDefault(),cycleScope(e.shiftKey?-1:1));break;case`Home`:e.preventDefault(),J[0]!==void 0&&setActive(J[0]);break;case`End`:{e.preventDefault();let t=J[J.length-1];t!==void 0&&setActive(t);break}case`Enter`:e.preventDefault(),Y>=0&&activateItem(q[Y],e.metaKey||e.ctrlKey?`secondary`:`primary`);break;case`Backspace`:z.value===``&&(V.value.length>0?(e.preventDefault(),popPage()):H.value&&(e.preventDefault(),clearScope()));break}},handleDialogKeyDown=e=>{e.key===`Escape`&&(e.preventDefault(),V.value.length>0?popPage():M.current?.close())},handleBackdropClick=e=>{e.target===M.current&&M.current?.close()},X=-1;return m(`dialog`,{ref:M,"aria-label":O,className:o(n.dialog,D),onClick:handleBackdropClick,onKeyDown:handleDialogKeyDown,children:h(`div`,{className:n.panel,children:[h(`div`,{className:n.search,children:[h(`svg`,{className:n.searchIcon,"aria-hidden":`true`,viewBox:`0 0 16 16`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,children:[m(`circle`,{cx:`7`,cy:`7`,r:`4.5`}),m(`line`,{x1:`10.5`,y1:`10.5`,x2:`14`,y2:`14`})]}),G&&h(`span`,{className:n.scopeChip,children:[G.label,m(`button`,{type:`button`,className:n.scopeClear,"aria-label":p(f.commandMenu.clearScope),onClick:clearScope,children:m(`svg`,{viewBox:`0 0 16 16`,width:`12`,height:`12`,"aria-hidden":`true`,children:m(`path`,{d:`M4 4l8 8M12 4l-8 8`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`})})})]}),m(`input`,{ref:N,type:`text`,role:`combobox`,"aria-expanded":`true`,"aria-controls":j,"aria-activedescendant":Y>=0?optionId(Y):void 0,"aria-autocomplete":`list`,"aria-label":O,autoComplete:`off`,spellCheck:!1,className:n.input,placeholder:W,value:z.value,onChange:e=>{let t=e.target.value;if(!H.value&&E.length>0){let e=matchScopePrefix(t,E);e&&(H.value=e.scope.id,t=e.rest)}z.value=t,B.value=0,I.current?.(t)},onKeyDown:handleInputKeyDown})]}),E.length>0&&h(`div`,{className:n.scopes,children:[m(`span`,{className:n.scopesLabel,children:p(f.commandMenu.scopeLabel)}),E.map(e=>h(`button`,{type:`button`,className:n.scopePill,"data-active":e.id===H.value||void 0,onClick:()=>{a(()=>{H.value=H.value===e.id?null:e.id,B.value=0}),s(N.current)},children:[e.prefix&&m(`span`,{className:n.scopePrefix,children:e.prefix}),e.label]},e.id))]}),h(`div`,{className:n.list,children:[m(`div`,{role:`listbox`,id:j,"aria-label":S,tabIndex:0,children:K.map((e,r)=>h(`div`,{role:`group`,"aria-label":e.heading,className:n.group,children:[e.heading&&h(`div`,{className:n.heading,"aria-hidden":`true`,children:[m(`span`,{children:e.heading}),z.value!==``&&m(`span`,{className:n.count,children:p(f.commandMenu.matches,{count:e.items.length})})]}),e.items.map(e=>{let{item:r,indices:i}=e;X++;let a=X;return h(`div`,{ref:e=>{P.current[a]=e},id:optionId(a),role:`option`,"aria-selected":a===Y,"aria-disabled":r.disabled||void 0,"data-state":a===Y?`active`:void 0,"data-disabled":r.disabled||void 0,className:n.option,onMouseEnter:()=>{r.disabled||(B.value=a)},onClick:()=>activateItem(r,`primary`),children:[r.icon&&m(`span`,{className:n.icon,"aria-hidden":`true`,children:r.icon}),h(`span`,{className:n.text,children:[m(`span`,{className:n.label,children:highlightLabel(r.label,i)}),r.description&&m(`span`,{className:n.description,children:r.description})]}),r.status&&h(`span`,{className:n.status,"data-tone":r.status.tone??`neutral`,children:[m(`span`,{className:n.statusDot,"aria-hidden":`true`}),r.status.label]}),r.actions&&r.actions.length>0&&m(`span`,{className:n.actions,children:r.actions.map(e=>h(`span`,{className:n.action,onClick:t=>{t.stopPropagation(),runAction(e)},children:[e.label,e.shortcut&&m(`span`,{className:n.actionKeys,"aria-hidden":`true`,children:e.shortcut.map((e,n)=>m(t,{size:`sm`,children:e},n))})]},e.id))}),r.shortcut&&m(`span`,{className:n.shortcut,"aria-hidden":`true`,children:r.shortcut.map((e,n)=>m(t,{size:`sm`,children:e},n))})]},r.id)})]},e.heading??`group-${r}`))}),q.length===0&&(w?h(`div`,{role:`status`,className:n.empty,children:[m(e,{size:`sm`}),p(f.commandMenu.loading)]}):m(`div`,{role:`status`,className:n.empty,children:k}))]}),h(`div`,{className:n.footer,"aria-hidden":`true`,children:[h(`span`,{className:n.hint,children:[m(t,{size:`sm`,children:`↑`}),m(t,{size:`sm`,children:`↓`}),` navigate`]}),h(`span`,{className:n.hint,children:[m(t,{size:`sm`,children:`↵`}),` open`]}),E.length>0&&h(`span`,{className:n.hint,children:[m(t,{size:`sm`,children:`Tab`}),` scope`]}),h(`span`,{className:n.hint,children:[m(t,{size:`sm`,children:`esc`}),` close`]})]})]})})}export{CommandMenu,fuzzyMatch,fuzzyScore};
|
|
@@ -1,34 +1 @@
|
|
|
1
|
-
var e
|
|
2
|
-
dialog: "_dialog_1dfrg_2",
|
|
3
|
-
panel: "_panel_1dfrg_62",
|
|
4
|
-
search: "_search_1dfrg_72",
|
|
5
|
-
searchIcon: "_searchIcon_1dfrg_80",
|
|
6
|
-
scopeChip: "_scopeChip_1dfrg_85",
|
|
7
|
-
scopeClear: "_scopeClear_1dfrg_101",
|
|
8
|
-
input: "_input_1dfrg_123",
|
|
9
|
-
scopes: "_scopes_1dfrg_142",
|
|
10
|
-
scopesLabel: "_scopesLabel_1dfrg_153",
|
|
11
|
-
scopePill: "_scopePill_1dfrg_163",
|
|
12
|
-
scopePrefix: "_scopePrefix_1dfrg_193",
|
|
13
|
-
list: "_list_1dfrg_199",
|
|
14
|
-
group: "_group_1dfrg_205",
|
|
15
|
-
heading: "_heading_1dfrg_209",
|
|
16
|
-
count: "_count_1dfrg_222",
|
|
17
|
-
option: "_option_1dfrg_228",
|
|
18
|
-
icon: "_icon_1dfrg_253",
|
|
19
|
-
text: "_text_1dfrg_260",
|
|
20
|
-
label: "_label_1dfrg_268",
|
|
21
|
-
match: "_match_1dfrg_274",
|
|
22
|
-
description: "_description_1dfrg_280",
|
|
23
|
-
status: "_status_1dfrg_289",
|
|
24
|
-
statusDot: "_statusDot_1dfrg_316",
|
|
25
|
-
actions: "_actions_1dfrg_325",
|
|
26
|
-
action: "_action_1dfrg_325",
|
|
27
|
-
actionKeys: "_actionKeys_1dfrg_369",
|
|
28
|
-
shortcut: "_shortcut_1dfrg_374",
|
|
29
|
-
empty: "_empty_1dfrg_392",
|
|
30
|
-
footer: "_footer_1dfrg_400",
|
|
31
|
-
hint: "_hint_1dfrg_411"
|
|
32
|
-
};
|
|
33
|
-
//#endregion
|
|
34
|
-
export { e as default };
|
|
1
|
+
var e={dialog:`_dialog_1dfrg_2`,panel:`_panel_1dfrg_62`,search:`_search_1dfrg_72`,searchIcon:`_searchIcon_1dfrg_80`,scopeChip:`_scopeChip_1dfrg_85`,scopeClear:`_scopeClear_1dfrg_101`,input:`_input_1dfrg_123`,scopes:`_scopes_1dfrg_142`,scopesLabel:`_scopesLabel_1dfrg_153`,scopePill:`_scopePill_1dfrg_163`,scopePrefix:`_scopePrefix_1dfrg_193`,list:`_list_1dfrg_199`,group:`_group_1dfrg_205`,heading:`_heading_1dfrg_209`,count:`_count_1dfrg_222`,option:`_option_1dfrg_228`,icon:`_icon_1dfrg_253`,text:`_text_1dfrg_260`,label:`_label_1dfrg_268`,match:`_match_1dfrg_274`,description:`_description_1dfrg_280`,status:`_status_1dfrg_289`,statusDot:`_statusDot_1dfrg_316`,actions:`_actions_1dfrg_325`,action:`_action_1dfrg_325`,actionKeys:`_actionKeys_1dfrg_369`,shortcut:`_shortcut_1dfrg_374`,empty:`_empty_1dfrg_392`,footer:`_footer_1dfrg_400`,hint:`_hint_1dfrg_411`};export{e as default};
|
|
@@ -1,69 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import e from "./comparison.module.js";
|
|
4
|
-
import { useRef as t } from "react";
|
|
5
|
-
import { cn as n, useControllableSignal as r, useSignal as i, useSignals as a } from "@cascivo/core";
|
|
6
|
-
import { builtin as o, t as s } from "@cascivo/i18n";
|
|
7
|
-
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
|
-
//#region ../components/src/comparison/comparison.tsx
|
|
9
|
-
var u = (e) => Math.min(100, Math.max(0, e));
|
|
10
|
-
function d({ after: d, before: f, position: p, defaultPosition: m = 50, onPositionChange: h, orientation: g = "horizontal", keyboardStep: _ = 5, label: v, ariaLabel: y, className: b, ...x }) {
|
|
11
|
-
a();
|
|
12
|
-
let S = t(null), C = i(!1), [w, T] = r({
|
|
13
|
-
value: p,
|
|
14
|
-
defaultValue: m,
|
|
15
|
-
onChange: h
|
|
16
|
-
}), E = Math.round(u(w.value)), D = (e) => {
|
|
17
|
-
let t = S.current;
|
|
18
|
-
if (!t) return;
|
|
19
|
-
let n = t.getBoundingClientRect();
|
|
20
|
-
T(u(g === "vertical" ? (e.clientY - n.top) / n.height * 100 : (e.clientX - n.left) / n.width * 100));
|
|
21
|
-
}, O = (e) => {
|
|
22
|
-
let t = g === "vertical" ? "ArrowUp" : "ArrowLeft", n = g === "vertical" ? "ArrowDown" : "ArrowRight", r = null;
|
|
23
|
-
e.key === t || e.key === "ArrowLeft" || e.key === "ArrowUp" ? r = E - _ : e.key === n || e.key === "ArrowRight" || e.key === "ArrowDown" ? r = E + _ : e.key === "Home" ? r = 0 : e.key === "End" ? r = 100 : e.key === "PageUp" ? r = E + _ * 2 : e.key === "PageDown" && (r = E - _ * 2), r !== null && (e.preventDefault(), T(u(r)));
|
|
24
|
-
};
|
|
25
|
-
return /* @__PURE__ */ l("div", {
|
|
26
|
-
ref: S,
|
|
27
|
-
"data-orientation": g,
|
|
28
|
-
"data-dragging": C.value || void 0,
|
|
29
|
-
className: n(e.comparison, b),
|
|
30
|
-
style: { "--position": `${E}%` },
|
|
31
|
-
onPointerDown: (e) => {
|
|
32
|
-
C.value = !0, e.currentTarget.setPointerCapture?.(e.pointerId), D(e);
|
|
33
|
-
},
|
|
34
|
-
onPointerMove: (e) => {
|
|
35
|
-
C.value && D(e);
|
|
36
|
-
},
|
|
37
|
-
onPointerUp: (e) => {
|
|
38
|
-
C.value = !1, e.currentTarget.releasePointerCapture?.(e.pointerId);
|
|
39
|
-
},
|
|
40
|
-
...x,
|
|
41
|
-
children: [
|
|
42
|
-
/* @__PURE__ */ c("div", {
|
|
43
|
-
className: e.item,
|
|
44
|
-
children: d
|
|
45
|
-
}),
|
|
46
|
-
/* @__PURE__ */ c("div", {
|
|
47
|
-
className: e.before,
|
|
48
|
-
"aria-hidden": "true",
|
|
49
|
-
children: f
|
|
50
|
-
}),
|
|
51
|
-
/* @__PURE__ */ c("div", {
|
|
52
|
-
className: e.divider,
|
|
53
|
-
children: /* @__PURE__ */ c("div", {
|
|
54
|
-
role: "slider",
|
|
55
|
-
tabIndex: 0,
|
|
56
|
-
"aria-label": y ?? v ?? s(o.comparison.label),
|
|
57
|
-
"aria-orientation": g,
|
|
58
|
-
"aria-valuemin": 0,
|
|
59
|
-
"aria-valuemax": 100,
|
|
60
|
-
"aria-valuenow": E,
|
|
61
|
-
className: e.handle,
|
|
62
|
-
onKeyDown: O
|
|
63
|
-
})
|
|
64
|
-
})
|
|
65
|
-
]
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
//#endregion
|
|
69
|
-
export { d as Comparison };
|
|
1
|
+
"use client";import e from"./comparison.module.js";import{useRef as t}from"react";import{cn as n,useControllableSignal as r,useSignal as i,useSignals as a}from"@cascivo/core";import{builtin as o,t as s}from"@cascivo/i18n";import{jsx as c,jsxs as l}from"react/jsx-runtime";var clamp=e=>Math.min(100,Math.max(0,e));function Comparison({after:u,before:d,position:f,defaultPosition:p=50,onPositionChange:m,orientation:h=`horizontal`,keyboardStep:g=5,label:_,ariaLabel:v,className:y,...b}){a();let x=t(null),S=i(!1),[C,w]=r({value:f,defaultValue:p,onChange:m}),T=Math.round(clamp(C.value)),updateFromPointer=e=>{let t=x.current;if(!t)return;let n=t.getBoundingClientRect();w(clamp(h===`vertical`?(e.clientY-n.top)/n.height*100:(e.clientX-n.left)/n.width*100))},onKeyDown=e=>{let t=h===`vertical`?`ArrowUp`:`ArrowLeft`,n=h===`vertical`?`ArrowDown`:`ArrowRight`,r=null;e.key===t||e.key===`ArrowLeft`||e.key===`ArrowUp`?r=T-g:e.key===n||e.key===`ArrowRight`||e.key===`ArrowDown`?r=T+g:e.key===`Home`?r=0:e.key===`End`?r=100:e.key===`PageUp`?r=T+g*2:e.key===`PageDown`&&(r=T-g*2),r!==null&&(e.preventDefault(),w(clamp(r)))};return l(`div`,{ref:x,"data-orientation":h,"data-dragging":S.value||void 0,className:n(e.comparison,y),style:{"--position":`${T}%`},onPointerDown:e=>{S.value=!0,e.currentTarget.setPointerCapture?.(e.pointerId),updateFromPointer(e)},onPointerMove:e=>{S.value&&updateFromPointer(e)},onPointerUp:e=>{S.value=!1,e.currentTarget.releasePointerCapture?.(e.pointerId)},...b,children:[c(`div`,{className:e.item,children:u}),c(`div`,{className:e.before,"aria-hidden":`true`,children:d}),c(`div`,{className:e.divider,children:c(`div`,{role:`slider`,tabIndex:0,"aria-label":v??_??s(o.comparison.label),"aria-orientation":h,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":T,className:e.handle,onKeyDown})})]})}export{Comparison};
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
var e
|
|
2
|
-
comparison: "_comparison_zo41p_2",
|
|
3
|
-
item: "_item_zo41p_11",
|
|
4
|
-
before: "_before_zo41p_12",
|
|
5
|
-
divider: "_divider_zo41p_36",
|
|
6
|
-
handle: "_handle_zo41p_56"
|
|
7
|
-
};
|
|
8
|
-
//#endregion
|
|
9
|
-
export { e as default };
|
|
1
|
+
var e={comparison:`_comparison_zo41p_2`,item:`_item_zo41p_11`,before:`_before_zo41p_12`,divider:`_divider_zo41p_36`,handle:`_handle_zo41p_56`};export{e as default};
|
|
@@ -1,41 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import e from "./contained-list.module.js";
|
|
4
|
-
import { Slot as t, cn as n } from "@cascivo/core";
|
|
5
|
-
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
6
|
-
//#region ../components/src/contained-list/contained-list.tsx
|
|
7
|
-
function a({ label: t, kind: a = "on-page", action: o, className: s, children: c, ...l }) {
|
|
8
|
-
return /* @__PURE__ */ i("div", {
|
|
9
|
-
"data-kind": a,
|
|
10
|
-
className: n(e.root, s),
|
|
11
|
-
...l,
|
|
12
|
-
children: [/* @__PURE__ */ i("div", {
|
|
13
|
-
className: e.header,
|
|
14
|
-
children: [/* @__PURE__ */ r("h3", {
|
|
15
|
-
className: e.label,
|
|
16
|
-
children: t
|
|
17
|
-
}), o ? /* @__PURE__ */ r("div", {
|
|
18
|
-
className: e.action,
|
|
19
|
-
children: o
|
|
20
|
-
}) : null]
|
|
21
|
-
}), /* @__PURE__ */ r("ul", {
|
|
22
|
-
className: e.list,
|
|
23
|
-
children: c
|
|
24
|
-
})]
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
function o({ asChild: i = !1, onClick: a, className: o, children: s, ...c }) {
|
|
28
|
-
let l = i || typeof a == "function", u = i ? t : "div";
|
|
29
|
-
return /* @__PURE__ */ r("li", {
|
|
30
|
-
className: e.item,
|
|
31
|
-
"data-interactive": l ? "" : void 0,
|
|
32
|
-
children: /* @__PURE__ */ r(u, {
|
|
33
|
-
className: n(e.itemContent, o),
|
|
34
|
-
onClick: a,
|
|
35
|
-
...c,
|
|
36
|
-
children: s
|
|
37
|
-
})
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
//#endregion
|
|
41
|
-
export { a as ContainedList, o as ContainedListItem };
|
|
1
|
+
"use client";import e from"./contained-list.module.js";import{Slot as t,cn as n}from"@cascivo/core";import{jsx as r,jsxs as i}from"react/jsx-runtime";function ContainedList({label:t,kind:a=`on-page`,action:o,className:s,children:c,...l}){return i(`div`,{"data-kind":a,className:n(e.root,s),...l,children:[i(`div`,{className:e.header,children:[r(`h3`,{className:e.label,children:t}),o?r(`div`,{className:e.action,children:o}):null]}),r(`ul`,{className:e.list,children:c})]})}function ContainedListItem({asChild:i=!1,onClick:a,className:o,children:s,...c}){let l=i||typeof a==`function`,u=i?t:`div`;return r(`li`,{className:e.item,"data-interactive":l?``:void 0,children:r(u,{className:n(e.itemContent,o),onClick:a,...c,children:s})})}export{ContainedList,ContainedListItem};
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
var e
|
|
2
|
-
root: "_root_u2rtc_2",
|
|
3
|
-
header: "_header_u2rtc_11",
|
|
4
|
-
label: "_label_u2rtc_25",
|
|
5
|
-
action: "_action_u2rtc_33",
|
|
6
|
-
list: "_list_u2rtc_39",
|
|
7
|
-
item: "_item_u2rtc_45",
|
|
8
|
-
itemContent: "_itemContent_u2rtc_57"
|
|
9
|
-
};
|
|
10
|
-
//#endregion
|
|
11
|
-
export { e as default };
|
|
1
|
+
var e={root:`_root_u2rtc_2`,header:`_header_u2rtc_11`,label:`_label_u2rtc_25`,action:`_action_u2rtc_33`,list:`_list_u2rtc_39`,item:`_item_u2rtc_45`,itemContent:`_itemContent_u2rtc_57`};export{e as default};
|