@cascivo/react 1.0.0 → 1.1.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 +772 -25
- 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.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 +395 -53
- 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 +3 -3
- package/readme.body.md +3 -2
|
@@ -1,110 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import e from "./dropdown.module.js";
|
|
4
|
-
import { cloneElement as t, useRef as n } from "react";
|
|
5
|
-
import { composeRefs as r, createMachine as i, focusElement as a, useEffectPropSignal as o, useMachine as s, useSignal as c, useSignalEffect as l, useSignals as u } from "@cascivo/core";
|
|
6
|
-
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
7
|
-
//#region ../components/src/dropdown/dropdown.tsx
|
|
8
|
-
var p = i({
|
|
9
|
-
initial: "closed",
|
|
10
|
-
states: {
|
|
11
|
-
closed: { on: { OPEN: "open" } },
|
|
12
|
-
open: { on: { CLOSE: "closed" } }
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
function m(e) {
|
|
16
|
-
return !("kind" in e);
|
|
17
|
-
}
|
|
18
|
-
function h({ trigger: i, items: h, onSelect: g, placement: _ = "bottom-start", open: v, onOpenChange: y }) {
|
|
19
|
-
u();
|
|
20
|
-
let [b, x] = s(p), S = n(null), C = n(null), w = n(null), T = n([]), E = c(-1), D = v !== void 0, O = D ? v : b.value === "open", k = o(O), A = h.map((e, t) => ({
|
|
21
|
-
item: e,
|
|
22
|
-
index: t
|
|
23
|
-
})).filter(({ item: e }) => m(e) && !e.disabled).map(({ index: e }) => e), j = (e) => {
|
|
24
|
-
D || x(e ? "OPEN" : "CLOSE"), y?.(e);
|
|
25
|
-
};
|
|
26
|
-
l(() => {
|
|
27
|
-
let e = E.value;
|
|
28
|
-
k.value && e >= 0 && T.current[e]?.focus();
|
|
29
|
-
}), l(() => {
|
|
30
|
-
k.value ? E.value = A[0] ?? -1 : E.value = -1;
|
|
31
|
-
}), l(() => {
|
|
32
|
-
k.value ? w.current?.showPopover() : w.current?.hidePopover();
|
|
33
|
-
}), l(() => {
|
|
34
|
-
let e = w.current;
|
|
35
|
-
if (!e) return;
|
|
36
|
-
let t = (e) => {
|
|
37
|
-
e.newState === "closed" && j(!1);
|
|
38
|
-
};
|
|
39
|
-
return e.addEventListener("toggle", t), () => e.removeEventListener("toggle", t);
|
|
40
|
-
});
|
|
41
|
-
let M = (e) => {
|
|
42
|
-
let t = h[e];
|
|
43
|
-
!t || !m(t) || t.disabled || (g?.(t.value), j(!1), a(C.current));
|
|
44
|
-
}, N = (e) => {
|
|
45
|
-
A.length !== 0 && (E.value = A[(A.indexOf(E.value) + e + A.length) % A.length] ?? -1);
|
|
46
|
-
}, P = (e) => {
|
|
47
|
-
switch (e.key) {
|
|
48
|
-
case "ArrowDown":
|
|
49
|
-
e.preventDefault(), N(1);
|
|
50
|
-
break;
|
|
51
|
-
case "ArrowUp":
|
|
52
|
-
e.preventDefault(), N(-1);
|
|
53
|
-
break;
|
|
54
|
-
case "Home":
|
|
55
|
-
e.preventDefault(), E.value = A[0] ?? -1;
|
|
56
|
-
break;
|
|
57
|
-
case "End":
|
|
58
|
-
e.preventDefault(), E.value = A[A.length - 1] ?? -1;
|
|
59
|
-
break;
|
|
60
|
-
case "Escape":
|
|
61
|
-
e.preventDefault(), j(!1), a(C.current);
|
|
62
|
-
break;
|
|
63
|
-
case "Enter":
|
|
64
|
-
case " ":
|
|
65
|
-
e.preventDefault(), M(E.value);
|
|
66
|
-
break;
|
|
67
|
-
}
|
|
68
|
-
}, F = i, I = t(F, {
|
|
69
|
-
ref: r(C, F.props.ref),
|
|
70
|
-
onClick: (e) => {
|
|
71
|
-
F.props.onClick?.(e), j(!O);
|
|
72
|
-
},
|
|
73
|
-
"aria-haspopup": "menu",
|
|
74
|
-
"aria-expanded": O
|
|
75
|
-
});
|
|
76
|
-
return /* @__PURE__ */ f("div", {
|
|
77
|
-
ref: S,
|
|
78
|
-
className: e.root,
|
|
79
|
-
children: [I, /* @__PURE__ */ d("div", {
|
|
80
|
-
ref: w,
|
|
81
|
-
popover: "auto",
|
|
82
|
-
role: "menu",
|
|
83
|
-
"data-placement": _,
|
|
84
|
-
"data-state": O ? "open" : "closed",
|
|
85
|
-
className: e.menu,
|
|
86
|
-
onKeyDown: P,
|
|
87
|
-
children: h.map((t, n) => m(t) ? /* @__PURE__ */ f("button", {
|
|
88
|
-
type: "button",
|
|
89
|
-
role: "menuitem",
|
|
90
|
-
ref: (e) => {
|
|
91
|
-
T.current[n] = e;
|
|
92
|
-
},
|
|
93
|
-
tabIndex: E.value === n ? 0 : -1,
|
|
94
|
-
disabled: t.disabled,
|
|
95
|
-
className: e.item,
|
|
96
|
-
onClick: () => M(n),
|
|
97
|
-
children: [t.icon && /* @__PURE__ */ d("span", {
|
|
98
|
-
className: e.icon,
|
|
99
|
-
"aria-hidden": "true",
|
|
100
|
-
children: t.icon
|
|
101
|
-
}), t.label]
|
|
102
|
-
}, t.value) : /* @__PURE__ */ d("div", {
|
|
103
|
-
role: "separator",
|
|
104
|
-
className: e.separator
|
|
105
|
-
}, `sep-${n}`))
|
|
106
|
-
})]
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
//#endregion
|
|
110
|
-
export { h as Dropdown };
|
|
1
|
+
"use client";import e from"./dropdown.module.js";import{cloneElement as t,useRef as n}from"react";import{composeRefs as r,createMachine as i,focusElement as a,useEffectPropSignal as o,useMachine as s,useSignal as c,useSignalEffect as l,useSignals as u}from"@cascivo/core";import{jsx as d,jsxs as f}from"react/jsx-runtime";var p=i({initial:`closed`,states:{closed:{on:{OPEN:`open`}},open:{on:{CLOSE:`closed`}}}});function m(e){return!(`kind`in e)}function h({trigger:i,items:h,onSelect:g,placement:_=`bottom-start`,open:v,onOpenChange:y}){u();let[b,x]=s(p),S=n(null),C=n(null),w=n(null),T=n([]),E=c(-1),D=v!==void 0,O=D?v:b.value===`open`,k=o(O),A=h.map((e,t)=>({item:e,index:t})).filter(({item:e})=>m(e)&&!e.disabled).map(({index:e})=>e),j=e=>{D||x(e?`OPEN`:`CLOSE`),y?.(e)};l(()=>{let e=E.value;k.value&&e>=0&&T.current[e]?.focus()}),l(()=>{k.value?E.value=A[0]??-1:E.value=-1}),l(()=>{k.value?w.current?.showPopover():w.current?.hidePopover()}),l(()=>{let e=w.current;if(!e)return;let t=e=>{e.newState===`closed`&&j(!1)};return e.addEventListener(`toggle`,t),()=>e.removeEventListener(`toggle`,t)});let M=e=>{let t=h[e];!t||!m(t)||t.disabled||(g?.(t.value),j(!1),a(C.current))},N=e=>{A.length!==0&&(E.value=A[(A.indexOf(E.value)+e+A.length)%A.length]??-1)},P=e=>{switch(e.key){case`ArrowDown`:e.preventDefault(),N(1);break;case`ArrowUp`:e.preventDefault(),N(-1);break;case`Home`:e.preventDefault(),E.value=A[0]??-1;break;case`End`:e.preventDefault(),E.value=A[A.length-1]??-1;break;case`Escape`:e.preventDefault(),j(!1),a(C.current);break;case`Enter`:case` `:e.preventDefault(),M(E.value);break}},F=i,I=t(F,{ref:r(C,F.props.ref),onClick:e=>{F.props.onClick?.(e),j(!O)},"aria-haspopup":`menu`,"aria-expanded":O});return f(`div`,{ref:S,className:e.root,children:[I,d(`div`,{ref:w,popover:`auto`,role:`menu`,"data-placement":_,"data-state":O?`open`:`closed`,className:e.menu,onKeyDown:P,children:h.map((t,n)=>m(t)?f(`button`,{type:`button`,role:`menuitem`,ref:e=>{T.current[n]=e},tabIndex:E.value===n?0:-1,disabled:t.disabled,className:e.item,onClick:()=>M(n),children:[t.icon&&d(`span`,{className:e.icon,"aria-hidden":`true`,children:t.icon}),t.label]},t.value):d(`div`,{role:`separator`,className:e.separator},`sep-${n}`))})]})}export{h as Dropdown};
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
var e
|
|
2
|
-
root: "_root_3wuq6_2",
|
|
3
|
-
menu: "_menu_3wuq6_7",
|
|
4
|
-
item: "_item_3wuq6_83",
|
|
5
|
-
icon: "_icon_3wuq6_111",
|
|
6
|
-
separator: "_separator_3wuq6_117"
|
|
7
|
-
};
|
|
8
|
-
//#endregion
|
|
9
|
-
export { e as default };
|
|
1
|
+
var e={root:`_root_431yi_2`,menu:`_menu_431yi_7`,item:`_item_431yi_88`,icon:`_icon_431yi_116`,separator:`_separator_431yi_122`};export{e as default};
|
|
@@ -1,76 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import e from "./editable.module.js";
|
|
4
|
-
import { useRef as t } from "react";
|
|
5
|
-
import { cn as n, useSignal as r, useSignalEffect as i, useSignals as a } from "@cascivo/core";
|
|
6
|
-
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
|
-
//#region ../components/src/editable/editable.tsx
|
|
8
|
-
function c({ value: c, onValueChange: l, placeholder: u, disabled: d = !1, submitOnBlur: f = !0, onCancel: p, className: m, id: h, "aria-labelledby": g, "aria-describedby": _, "aria-invalid": v, ...y }) {
|
|
9
|
-
a();
|
|
10
|
-
let b = r(!1), x = r(c), S = t(null), C = t(p);
|
|
11
|
-
C.current = p;
|
|
12
|
-
let w = t(l);
|
|
13
|
-
w.current = l;
|
|
14
|
-
let T = {
|
|
15
|
-
id: h,
|
|
16
|
-
"aria-labelledby": g,
|
|
17
|
-
"aria-describedby": _,
|
|
18
|
-
"aria-invalid": v
|
|
19
|
-
};
|
|
20
|
-
b.value || (x.value = c), i(() => {
|
|
21
|
-
if (b.value) {
|
|
22
|
-
let e = S.current;
|
|
23
|
-
e && (e.focus(), e.select());
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
function E() {
|
|
27
|
-
w.current(x.value), b.value = !1;
|
|
28
|
-
}
|
|
29
|
-
function D() {
|
|
30
|
-
x.value = c, b.value = !1, C.current?.();
|
|
31
|
-
}
|
|
32
|
-
return b.value ? /* @__PURE__ */ o("div", {
|
|
33
|
-
className: n(e.wrapper, e.editing, m),
|
|
34
|
-
...y,
|
|
35
|
-
children: /* @__PURE__ */ o("input", {
|
|
36
|
-
ref: S,
|
|
37
|
-
className: e.input,
|
|
38
|
-
...T,
|
|
39
|
-
value: x.value,
|
|
40
|
-
onChange: (e) => {
|
|
41
|
-
x.value = e.currentTarget.value;
|
|
42
|
-
},
|
|
43
|
-
onKeyDown: (e) => {
|
|
44
|
-
e.key === "Enter" ? (e.preventDefault(), E()) : e.key === "Escape" && (e.preventDefault(), D());
|
|
45
|
-
},
|
|
46
|
-
onBlur: () => {
|
|
47
|
-
f ? E() : D();
|
|
48
|
-
}
|
|
49
|
-
})
|
|
50
|
-
}) : /* @__PURE__ */ o("div", {
|
|
51
|
-
className: n(e.wrapper, m),
|
|
52
|
-
"data-disabled": d ? "" : void 0,
|
|
53
|
-
...y,
|
|
54
|
-
children: /* @__PURE__ */ s("button", {
|
|
55
|
-
type: "button",
|
|
56
|
-
className: e.preview,
|
|
57
|
-
...T,
|
|
58
|
-
disabled: d,
|
|
59
|
-
onClick: () => {
|
|
60
|
-
d || (b.value = !0);
|
|
61
|
-
},
|
|
62
|
-
children: [/* @__PURE__ */ o("span", {
|
|
63
|
-
className: e["preview-text"],
|
|
64
|
-
children: c || /* @__PURE__ */ o("span", {
|
|
65
|
-
className: e.placeholder,
|
|
66
|
-
children: u
|
|
67
|
-
})
|
|
68
|
-
}), /* @__PURE__ */ o("span", {
|
|
69
|
-
className: e["edit-icon"],
|
|
70
|
-
"aria-hidden": "true"
|
|
71
|
-
})]
|
|
72
|
-
})
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
//#endregion
|
|
76
|
-
export { c as Editable };
|
|
1
|
+
"use client";import e from"./editable.module.js";import{useRef as t}from"react";import{cn as n,useSignal as r,useSignals as i}from"@cascivo/core";import{jsx as a,jsxs as o}from"react/jsx-runtime";function s(e){e&&(e.focus(),e.select())}function c({value:c,onValueChange:l,placeholder:u,disabled:d=!1,submitOnBlur:f=!0,onCancel:p,className:m,id:h,"aria-label":g,"aria-labelledby":_,"aria-describedby":v,"aria-invalid":y,tabIndex:b,...x}){i();let S=r(!1),C=r(c),w=t(p);w.current=p;let T=t(l);T.current=l;let E={id:h,"aria-label":g,"aria-labelledby":_,"aria-describedby":v,"aria-invalid":y,tabIndex:b};S.value||(C.value=c);function D(){T.current(C.value),S.value=!1}function O(){C.value=c,S.value=!1,w.current?.()}return S.value?a(`div`,{className:n(e.wrapper,e.editing,m),...x,children:a(`input`,{ref:s,className:e.input,...E,value:C.value,onChange:e=>{C.value=e.currentTarget.value},onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),D()):e.key===`Escape`&&(e.preventDefault(),O())},onBlur:()=>{f?D():O()}})}):a(`div`,{className:n(e.wrapper,m),"data-disabled":d?``:void 0,...x,children:o(`button`,{type:`button`,className:e.preview,...E,disabled:d,onClick:()=>{d||(S.value=!0)},children:[a(`span`,{className:e[`preview-text`],children:c||a(`span`,{className:e.placeholder,children:u})}),a(`span`,{className:e[`edit-icon`],"aria-hidden":`true`})]})})}export{c as Editable};
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
var e
|
|
2
|
-
wrapper: "_wrapper_17cwn_2",
|
|
3
|
-
preview: "_preview_17cwn_8",
|
|
4
|
-
"preview-text": "_preview-text_17cwn_42",
|
|
5
|
-
placeholder: "_placeholder_17cwn_46",
|
|
6
|
-
"edit-icon": "_edit-icon_17cwn_50",
|
|
7
|
-
editing: "_editing_17cwn_69",
|
|
8
|
-
input: "_input_17cwn_70"
|
|
9
|
-
};
|
|
10
|
-
//#endregion
|
|
11
|
-
export { e as default };
|
|
1
|
+
var e={wrapper:`_wrapper_17cwn_2`,preview:`_preview_17cwn_8`,"preview-text":`_preview-text_17cwn_42`,placeholder:`_placeholder_17cwn_46`,"edit-icon":`_edit-icon_17cwn_50`,editing:`_editing_17cwn_69`,input:`_input_17cwn_70`};export{e as default};
|
|
@@ -1,32 +1 @@
|
|
|
1
|
-
import e from
|
|
2
|
-
import { cn as t } from "@cascivo/core/pure";
|
|
3
|
-
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
-
//#region ../components/src/empty-state/empty-state.tsx
|
|
5
|
-
function i({ icon: i, title: a, description: o, action: s, size: c = "md", className: l, ...u }) {
|
|
6
|
-
return /* @__PURE__ */ r("div", {
|
|
7
|
-
"data-size": c,
|
|
8
|
-
className: t(e["empty-state"], l),
|
|
9
|
-
...u,
|
|
10
|
-
children: [
|
|
11
|
-
i && /* @__PURE__ */ n("span", {
|
|
12
|
-
className: e.icon,
|
|
13
|
-
"aria-hidden": "true",
|
|
14
|
-
children: i
|
|
15
|
-
}),
|
|
16
|
-
/* @__PURE__ */ n("h3", {
|
|
17
|
-
className: e.title,
|
|
18
|
-
children: a
|
|
19
|
-
}),
|
|
20
|
-
o && /* @__PURE__ */ n("p", {
|
|
21
|
-
className: e.description,
|
|
22
|
-
children: o
|
|
23
|
-
}),
|
|
24
|
-
s && /* @__PURE__ */ n("div", {
|
|
25
|
-
className: e.action,
|
|
26
|
-
children: s
|
|
27
|
-
})
|
|
28
|
-
]
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
//#endregion
|
|
32
|
-
export { i as EmptyState };
|
|
1
|
+
import e from"./empty-state.module.js";import{cn as t}from"@cascivo/core/pure";import{jsx as n,jsxs as r}from"react/jsx-runtime";function i({icon:i,title:a,description:o,action:s,size:c=`md`,className:l,...u}){return r(`div`,{"data-size":c,className:t(e[`empty-state`],l),...u,children:[i&&n(`span`,{className:e.icon,"aria-hidden":`true`,children:i}),n(`h3`,{className:e.title,children:a}),o&&n(`p`,{className:e.description,children:o}),s&&n(`div`,{className:e.action,children:s})]})}export{i as EmptyState};
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
var e
|
|
2
|
-
"empty-state": "_empty-state_1wem6_2",
|
|
3
|
-
icon: "_icon_1wem6_18",
|
|
4
|
-
title: "_title_1wem6_39",
|
|
5
|
-
description: "_description_1wem6_50",
|
|
6
|
-
action: "_action_1wem6_62"
|
|
7
|
-
};
|
|
8
|
-
//#endregion
|
|
9
|
-
export { e as default };
|
|
1
|
+
var e={"empty-state":`_empty-state_1wem6_2`,icon:`_icon_1wem6_18`,title:`_title_1wem6_39`,description:`_description_1wem6_50`,action:`_action_1wem6_62`};export{e as default};
|
package/dist/node/fab/fab.js
CHANGED
|
@@ -1,93 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import e from "./fab.module.js";
|
|
4
|
-
import { useId as t, useRef as n } from "react";
|
|
5
|
-
import { DismissableLayer as r, Presence as i, cn as a, focusElement as o, useControllableSignal as s, useRovingFocus as c, useSignalEffect as l, useSignals as u } from "@cascivo/core";
|
|
6
|
-
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
7
|
-
//#region ../components/src/fab/fab.tsx
|
|
8
|
-
function p({ children: p, ariaLabel: m, label: h, onClick: g, actions: _, position: v = "bottom-end", open: y, defaultOpen: b, onOpenChange: x, className: S }) {
|
|
9
|
-
u();
|
|
10
|
-
let C = _ != null && _.length > 0, [w, T] = s({
|
|
11
|
-
value: y,
|
|
12
|
-
defaultValue: b ?? !1,
|
|
13
|
-
onChange: x
|
|
14
|
-
}), E = c({
|
|
15
|
-
orientation: "vertical",
|
|
16
|
-
loop: !0
|
|
17
|
-
}), D = n(null), O = n(null), k = t(), A = n(!1);
|
|
18
|
-
l(() => {
|
|
19
|
-
let e = C && w.value;
|
|
20
|
-
e && !A.current ? O.current?.querySelector("[role=\"menuitem\"]:not([aria-disabled=\"true\"])")?.focus() : !e && A.current && o(D.current), A.current = e;
|
|
21
|
-
});
|
|
22
|
-
let j = (e) => {
|
|
23
|
-
e.disabled || (e.onSelect(), T(!1));
|
|
24
|
-
}, M = /* @__PURE__ */ d("button", {
|
|
25
|
-
ref: D,
|
|
26
|
-
type: "button",
|
|
27
|
-
"aria-label": h ?? m,
|
|
28
|
-
className: e.fab,
|
|
29
|
-
...C ? {
|
|
30
|
-
"aria-haspopup": "menu",
|
|
31
|
-
"aria-expanded": w.value,
|
|
32
|
-
"aria-controls": k,
|
|
33
|
-
"data-state": w.value ? "open" : "closed",
|
|
34
|
-
onClick: () => T(!w.value)
|
|
35
|
-
} : { onClick: g },
|
|
36
|
-
children: /* @__PURE__ */ d("span", {
|
|
37
|
-
className: e.icon,
|
|
38
|
-
"aria-hidden": "true",
|
|
39
|
-
children: p
|
|
40
|
-
})
|
|
41
|
-
});
|
|
42
|
-
return C ? /* @__PURE__ */ d(r, {
|
|
43
|
-
onDismiss: () => T(!1),
|
|
44
|
-
escapeDismisses: w.value,
|
|
45
|
-
disableOutsidePointer: !w.value,
|
|
46
|
-
children: /* @__PURE__ */ f("div", {
|
|
47
|
-
className: a(e.root, S),
|
|
48
|
-
"data-position": v,
|
|
49
|
-
children: [/* @__PURE__ */ d(i, {
|
|
50
|
-
present: w,
|
|
51
|
-
children: /* @__PURE__ */ d("menu", {
|
|
52
|
-
ref: O,
|
|
53
|
-
id: k,
|
|
54
|
-
role: "menu",
|
|
55
|
-
"aria-label": h ?? m,
|
|
56
|
-
className: e.dial,
|
|
57
|
-
children: _.map((t, n) => {
|
|
58
|
-
let r = E.getItemProps(n);
|
|
59
|
-
return /* @__PURE__ */ d("li", {
|
|
60
|
-
role: "presentation",
|
|
61
|
-
className: e.dialItem,
|
|
62
|
-
children: /* @__PURE__ */ f("button", {
|
|
63
|
-
ref: r.ref,
|
|
64
|
-
type: "button",
|
|
65
|
-
role: "menuitem",
|
|
66
|
-
tabIndex: r.tabIndex,
|
|
67
|
-
"aria-disabled": t.disabled || void 0,
|
|
68
|
-
className: e.action,
|
|
69
|
-
onKeyDown: r.onKeyDown,
|
|
70
|
-
onFocus: r.onFocus,
|
|
71
|
-
onClick: () => j(t),
|
|
72
|
-
children: [/* @__PURE__ */ d("span", {
|
|
73
|
-
className: e.actionLabel,
|
|
74
|
-
children: t.label
|
|
75
|
-
}), /* @__PURE__ */ d("span", {
|
|
76
|
-
className: e.actionIcon,
|
|
77
|
-
"aria-hidden": "true",
|
|
78
|
-
children: t.icon
|
|
79
|
-
})]
|
|
80
|
-
})
|
|
81
|
-
}, t.id ?? n);
|
|
82
|
-
})
|
|
83
|
-
})
|
|
84
|
-
}), M]
|
|
85
|
-
})
|
|
86
|
-
}) : /* @__PURE__ */ d("div", {
|
|
87
|
-
className: a(e.root, S),
|
|
88
|
-
"data-position": v,
|
|
89
|
-
children: M
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
//#endregion
|
|
93
|
-
export { p as Fab };
|
|
1
|
+
"use client";import e from"./fab.module.js";import{useId as t,useRef as n}from"react";import{DismissableLayer as r,Presence as i,cn as a,focusElement as o,useControllableSignal as s,useRovingFocus as c,useSignalEffect as l,useSignals as u}from"@cascivo/core";import{jsx as d,jsxs as f}from"react/jsx-runtime";function p({children:p,ariaLabel:m,label:h,onClick:g,actions:_,position:v=`bottom-end`,open:y,defaultOpen:b,onOpenChange:x,className:S}){u();let C=_!=null&&_.length>0,[w,T]=s({value:y,defaultValue:b??!1,onChange:x}),E=c({orientation:`vertical`,loop:!0}),D=n(null),O=n(null),k=t(),A=n(!1);l(()=>{let e=C&&w.value;e&&!A.current?O.current?.querySelector(`[role="menuitem"]:not([aria-disabled="true"])`)?.focus():!e&&A.current&&o(D.current),A.current=e});let j=e=>{e.disabled||(e.onSelect(),T(!1))},M=d(`button`,{ref:D,type:`button`,"aria-label":h??m,className:e.fab,...C?{"aria-haspopup":`menu`,"aria-expanded":w.value,"aria-controls":k,"data-state":w.value?`open`:`closed`,onClick:()=>T(!w.value)}:{onClick:g},children:d(`span`,{className:e.icon,"aria-hidden":`true`,children:p})});return C?d(r,{onDismiss:()=>T(!1),escapeDismisses:w.value,disableOutsidePointer:!w.value,children:f(`div`,{className:a(e.root,S),"data-position":v,children:[d(i,{present:w,children:d(`menu`,{ref:O,id:k,role:`menu`,"aria-label":h??m,className:e.dial,children:_.map((t,n)=>{let r=E.getItemProps(n);return d(`li`,{role:`presentation`,className:e.dialItem,children:f(`button`,{ref:r.ref,type:`button`,role:`menuitem`,tabIndex:r.tabIndex,"aria-disabled":t.disabled||void 0,className:e.action,onKeyDown:r.onKeyDown,onFocus:r.onFocus,onClick:()=>j(t),children:[d(`span`,{className:e.actionLabel,children:t.label}),d(`span`,{className:e.actionIcon,"aria-hidden":`true`,children:t.icon})]})},t.id??n)})})}),M]})}):d(`div`,{className:a(e.root,S),"data-position":v,children:M})}export{p as Fab};
|
|
@@ -1,12 +1 @@
|
|
|
1
|
-
var e
|
|
2
|
-
root: "_root_142gl_2",
|
|
3
|
-
fab: "_fab_142gl_21",
|
|
4
|
-
icon: "_icon_142gl_48",
|
|
5
|
-
dial: "_dial_142gl_60",
|
|
6
|
-
dialItem: "_dialItem_142gl_91",
|
|
7
|
-
action: "_action_142gl_95",
|
|
8
|
-
actionLabel: "_actionLabel_142gl_129",
|
|
9
|
-
actionIcon: "_actionIcon_142gl_134"
|
|
10
|
-
};
|
|
11
|
-
//#endregion
|
|
12
|
-
export { e as default };
|
|
1
|
+
var e={root:`_root_1padz_2`,fab:`_fab_1padz_21`,icon:`_icon_1padz_48`,dial:`_dial_1padz_60`,dialItem:`_dialItem_1padz_91`,action:`_action_1padz_95`,actionLabel:`_actionLabel_1padz_129`,actionIcon:`_actionIcon_1padz_134`};export{e as default};
|
package/dist/node/field/field.js
CHANGED
|
@@ -1,53 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import t from "./field.module.js";
|
|
3
|
-
import { cn as n, useId as r } from "@cascivo/core/pure";
|
|
4
|
-
import { Children as i, cloneElement as a, isValidElement as o } from "react";
|
|
5
|
-
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
6
|
-
//#region ../components/src/field/field.tsx
|
|
7
|
-
var l = /* @__PURE__ */ new Set();
|
|
8
|
-
function u() {
|
|
9
|
-
return globalThis.process?.env?.NODE_ENV !== "production";
|
|
10
|
-
}
|
|
11
|
-
function d(e, t) {
|
|
12
|
-
if (!u() || e == null || t.props.label == null) return;
|
|
13
|
-
let n = String(e);
|
|
14
|
-
l.has(n) || (l.add(n), console.warn(`cascivo Field: both the Field and its child control define a \`label\` (${n}). Omit the child's \`label\` inside a Field — it renders a second <label> for the same control. The Field owns the label.`));
|
|
15
|
-
}
|
|
16
|
-
var f = /* @__PURE__ */ new Set();
|
|
17
|
-
function p(e, t) {
|
|
18
|
-
if (!u() || e == null || t.props.hint == null) return;
|
|
19
|
-
let n = String(e);
|
|
20
|
-
f.has(n) || (f.add(n), console.warn(`cascivo Field: both the Field and its child control define supporting text (${n}). Omit the child's \`hint\` inside a Field — the Field owns it, and only the Field's is wired into aria-describedby.`));
|
|
21
|
-
}
|
|
22
|
-
function m({ label: l, description: u, hint: f, error: m, required: h = !1, disabled: g = !1, id: _, children: v, className: y }) {
|
|
23
|
-
let b = u ?? f, x = r("cascade-field"), S = _ ?? x, C = `${S}-description`, w = `${S}-error`, T = `${S}-label`, E = [b ? C : null, m ? w : null].filter(Boolean).join(" ") || void 0, D = { id: S };
|
|
24
|
-
l != null && (D["aria-labelledby"] = T), E && (D["aria-describedby"] = E), m && (D["aria-invalid"] = !0), (g || v.props.disabled) && (D.disabled = !0), o(v) && (d(l, v), p(b, v));
|
|
25
|
-
let O = o(v) ? a(i.only(v), D) : v;
|
|
26
|
-
return /* @__PURE__ */ c("div", {
|
|
27
|
-
className: n(t.field, y),
|
|
28
|
-
"data-disabled": g ? "" : void 0,
|
|
29
|
-
children: [
|
|
30
|
-
l && /* @__PURE__ */ s(e, {
|
|
31
|
-
id: T,
|
|
32
|
-
htmlFor: S,
|
|
33
|
-
required: h,
|
|
34
|
-
disabled: g,
|
|
35
|
-
children: l
|
|
36
|
-
}),
|
|
37
|
-
O,
|
|
38
|
-
b && /* @__PURE__ */ s("p", {
|
|
39
|
-
id: C,
|
|
40
|
-
className: t.description,
|
|
41
|
-
children: b
|
|
42
|
-
}),
|
|
43
|
-
m && /* @__PURE__ */ s("p", {
|
|
44
|
-
id: w,
|
|
45
|
-
role: "alert",
|
|
46
|
-
className: t.error,
|
|
47
|
-
children: m
|
|
48
|
-
})
|
|
49
|
-
]
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
//#endregion
|
|
53
|
-
export { m as Field };
|
|
1
|
+
import{Label as e}from"../label/label.js";import t from"./field.module.js";import{cn as n,useId as r}from"@cascivo/core/pure";import{Children as i,cloneElement as a,isValidElement as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";var l=new Set;function u(){return globalThis.process?.env?.NODE_ENV!==`production`}function d(e,t){if(!u()||e==null||t.props.label==null)return;let n=String(e);l.has(n)||(l.add(n),console.warn(`cascivo Field: both the Field and its child control define a \`label\` (${n}). Omit the child's \`label\` inside a Field — it renders a second <label> for the same control. The Field owns the label.`))}var f=new Set;function p(e,t){if(!u()||e==null||t.props.hint==null)return;let n=String(e);f.has(n)||(f.add(n),console.warn(`cascivo Field: both the Field and its child control define supporting text (${n}). Omit the child's \`hint\` inside a Field — the Field owns it, and only the Field's is wired into aria-describedby.`))}function m({label:l,description:u,hint:f,error:m,required:h=!1,disabled:g=!1,id:_,children:v,className:y}){let b=u??f,x=r(`cascade-field`),S=_??x,C=`${S}-description`,w=`${S}-error`,T=`${S}-label`,E=[b?C:null,m?w:null].filter(Boolean).join(` `)||void 0,D={id:S};l!=null&&(D[`aria-labelledby`]=T),E&&(D[`aria-describedby`]=E),m&&(D[`aria-invalid`]=!0),(g||v.props.disabled)&&(D.disabled=!0),o(v)&&(d(l,v),p(b,v));let O=o(v)?a(i.only(v),D):v;return c(`div`,{className:n(t.field,y),"data-disabled":g?``:void 0,children:[l&&s(e,{id:T,htmlFor:S,required:h,disabled:g,children:l}),O,b&&s(`p`,{id:C,className:t.description,children:b}),m&&s(`p`,{id:w,role:`alert`,className:t.error,children:m})]})}export{m as Field};
|
|
@@ -1,123 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { Spinner as e } from "../spinner/spinner.js";
|
|
4
|
-
import t from "./file-uploader.module.js";
|
|
5
|
-
import { useRef as n } from "react";
|
|
6
|
-
import { cn as r, useSignal as i, useSignals as a } from "@cascivo/core";
|
|
7
|
-
import { builtin as o, t as s } from "@cascivo/i18n";
|
|
8
|
-
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
9
|
-
//#region ../components/src/file-uploader/file-uploader.tsx
|
|
10
|
-
function u(e, t) {
|
|
11
|
-
let n = t.split(",").map((e) => e.trim()).filter(Boolean);
|
|
12
|
-
return n.length === 0 ? !0 : n.some((t) => t.startsWith(".") ? e.name.toLowerCase().endsWith(t.toLowerCase()) : t.endsWith("/*") ? e.type.startsWith(t.slice(0, -1)) : e.type === t);
|
|
13
|
-
}
|
|
14
|
-
function d(e) {
|
|
15
|
-
return e >= 1024 * 1024 ? `${(e / (1024 * 1024)).toFixed(1)} MB` : e >= 1024 ? `${(e / 1024).toFixed(1)} KB` : `${e} B`;
|
|
16
|
-
}
|
|
17
|
-
function f({ files: f = [], onFilesAdded: p, onRemove: m, multiple: h = !1, accept: g, maxSize: _, onRejected: v, label: y, ariaLabel: b, hint: x, labels: S, disabled: C = !1, className: w }) {
|
|
18
|
-
a();
|
|
19
|
-
let T = n(null), E = i(!1), D = y ?? S?.label ?? s(o.fileUploader.label), O = S?.drop ?? s(o.fileUploader.drop), k = S?.uploading ?? s(o.fileUploader.uploading), A = S?.complete ?? s(o.fileUploader.complete), j = S?.error ?? s(o.fileUploader.error), M = (e) => S?.remove ? S.remove.replace("{name}", e) : s(o.fileUploader.remove, { name: e }), N = `cascade-uploader-${D.toLowerCase().replace(/\s+/g, "-")}`, P = `${N}-label`, F = `${N}-hint`, I = (e) => {
|
|
20
|
-
if (!e || e.length === 0) return;
|
|
21
|
-
let t = h ? Array.from(e) : Array.from(e).slice(0, 1), n = [], r = [], i = [];
|
|
22
|
-
for (let e of t) g && !u(e, g) ? r.push(e) : _ !== void 0 && e.size > _ ? i.push(e) : n.push(e);
|
|
23
|
-
r.length > 0 && v?.(r, "type"), i.length > 0 && v?.(i, "size"), n.length > 0 && p?.(n);
|
|
24
|
-
};
|
|
25
|
-
return /* @__PURE__ */ l("div", {
|
|
26
|
-
className: r(t.uploader, w),
|
|
27
|
-
children: [
|
|
28
|
-
/* @__PURE__ */ c("span", {
|
|
29
|
-
id: P,
|
|
30
|
-
className: t.label,
|
|
31
|
-
children: D
|
|
32
|
-
}),
|
|
33
|
-
/* @__PURE__ */ c("input", {
|
|
34
|
-
ref: T,
|
|
35
|
-
type: "file",
|
|
36
|
-
className: t.input,
|
|
37
|
-
tabIndex: -1,
|
|
38
|
-
"aria-hidden": "true",
|
|
39
|
-
multiple: h,
|
|
40
|
-
accept: g,
|
|
41
|
-
disabled: C,
|
|
42
|
-
onChange: (e) => {
|
|
43
|
-
I(e.target.files), e.target.value = "";
|
|
44
|
-
}
|
|
45
|
-
}),
|
|
46
|
-
/* @__PURE__ */ c("button", {
|
|
47
|
-
type: "button",
|
|
48
|
-
className: t.zone,
|
|
49
|
-
"data-state": E.value ? "dragover" : "idle",
|
|
50
|
-
disabled: C,
|
|
51
|
-
"aria-label": b,
|
|
52
|
-
"aria-describedby": x ? `${P} ${F}` : P,
|
|
53
|
-
onClick: () => T.current?.click(),
|
|
54
|
-
onDragEnter: (e) => {
|
|
55
|
-
e.preventDefault(), C || (E.value = !0);
|
|
56
|
-
},
|
|
57
|
-
onDragOver: (e) => e.preventDefault(),
|
|
58
|
-
onDragLeave: () => {
|
|
59
|
-
E.value = !1;
|
|
60
|
-
},
|
|
61
|
-
onDrop: (e) => {
|
|
62
|
-
e.preventDefault(), E.value = !1, !C && I(e.dataTransfer.files);
|
|
63
|
-
},
|
|
64
|
-
children: O
|
|
65
|
-
}),
|
|
66
|
-
x && /* @__PURE__ */ c("span", {
|
|
67
|
-
id: F,
|
|
68
|
-
className: t.hint,
|
|
69
|
-
children: x
|
|
70
|
-
}),
|
|
71
|
-
f.length > 0 && /* @__PURE__ */ c("ul", {
|
|
72
|
-
className: t.list,
|
|
73
|
-
"aria-live": "polite",
|
|
74
|
-
children: f.map((n) => /* @__PURE__ */ l("li", {
|
|
75
|
-
className: t.file,
|
|
76
|
-
"data-state": n.status,
|
|
77
|
-
children: [
|
|
78
|
-
/* @__PURE__ */ l("span", {
|
|
79
|
-
className: t.status,
|
|
80
|
-
children: [
|
|
81
|
-
n.status === "uploading" && /* @__PURE__ */ c(e, {
|
|
82
|
-
size: "sm",
|
|
83
|
-
label: k
|
|
84
|
-
}),
|
|
85
|
-
n.status === "complete" && /* @__PURE__ */ c("span", {
|
|
86
|
-
className: t["glyph-complete"],
|
|
87
|
-
"aria-label": A,
|
|
88
|
-
children: "✓"
|
|
89
|
-
}),
|
|
90
|
-
n.status === "error" && /* @__PURE__ */ c("span", {
|
|
91
|
-
className: t["glyph-error"],
|
|
92
|
-
"aria-label": j,
|
|
93
|
-
children: "✕"
|
|
94
|
-
})
|
|
95
|
-
]
|
|
96
|
-
}),
|
|
97
|
-
/* @__PURE__ */ c("span", {
|
|
98
|
-
className: t.name,
|
|
99
|
-
children: n.name
|
|
100
|
-
}),
|
|
101
|
-
n.size !== void 0 && /* @__PURE__ */ c("span", {
|
|
102
|
-
className: t.size,
|
|
103
|
-
children: d(n.size)
|
|
104
|
-
}),
|
|
105
|
-
/* @__PURE__ */ c("button", {
|
|
106
|
-
type: "button",
|
|
107
|
-
className: t.remove,
|
|
108
|
-
"aria-label": M(n.name),
|
|
109
|
-
onClick: () => m?.(n.id),
|
|
110
|
-
children: "✕"
|
|
111
|
-
}),
|
|
112
|
-
n.status === "error" && n.errorMessage && /* @__PURE__ */ c("span", {
|
|
113
|
-
className: t["error-message"],
|
|
114
|
-
children: n.errorMessage
|
|
115
|
-
})
|
|
116
|
-
]
|
|
117
|
-
}, n.id))
|
|
118
|
-
})
|
|
119
|
-
]
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
//#endregion
|
|
123
|
-
export { f as FileUploader };
|
|
1
|
+
"use client";import{Spinner as e}from"../spinner/spinner.js";import t from"./file-uploader.module.js";import{useRef as n}from"react";import{cn as r,useId as i,useSignal as a,useSignals as o}from"@cascivo/core";import{builtin as s,currentLocale as c,t as l}from"@cascivo/i18n";import{jsx as u,jsxs as d}from"react/jsx-runtime";function f(e,t){let n=t.split(`,`).map(e=>e.trim()).filter(Boolean);return n.length===0?!0:n.some(t=>t.startsWith(`.`)?e.name.toLowerCase().endsWith(t.toLowerCase()):t.endsWith(`/*`)?e.type.startsWith(t.slice(0,-1)):e.type===t)}function p(e,t){let[n,r]=e>=1024*1024?[e/(1024*1024),`megabyte`]:e>=1024?[e/1024,`kilobyte`]:[e,`byte`];try{return new Intl.NumberFormat(t,{style:`unit`,unit:r,unitDisplay:`short`,maximumFractionDigits:r===`byte`?0:1}).format(n)}catch{return new Intl.NumberFormat(t,{maximumFractionDigits:r===`byte`?0:1}).format(n)}}function m(e,t,n,r){return e.some(e=>e.status===`error`)?r:e.some(e=>e.status===`uploading`)?t:n}function h({files:h=[],onFilesAdded:g,onRemove:_,multiple:v=!1,accept:y,maxSize:b,onRejected:x,label:S,ariaLabel:C,hint:w,labels:T,disabled:E=!1,className:D}){o();let O=c(),k=n(null),A=a(!1),j=S??T?.label??l(s.fileUploader.label),M=T?.drop??l(s.fileUploader.drop),N=T?.uploading??l(s.fileUploader.uploading),P=T?.complete??l(s.fileUploader.complete),F=T?.error??l(s.fileUploader.error),I=e=>T?.remove?T.remove.replaceAll(`{name}`,e):l(s.fileUploader.remove,{name:e}),L=i(`cascivo-uploader`),R=`${L}-label`,z=`${L}-hint`,B=`${L}-status`,V=e=>{if(!e||e.length===0)return;let t=v?Array.from(e):Array.from(e).slice(0,1),n=[],r=[],i=[];for(let e of t)y&&!f(e,y)?r.push(e):b!==void 0&&e.size>b?i.push(e):n.push(e);r.length>0&&x?.(r,`type`),i.length>0&&x?.(i,`size`),n.length>0&&g?.(n)};return d(`div`,{className:r(t.uploader,D),children:[u(`span`,{id:R,className:t.label,children:j}),u(`input`,{ref:k,type:`file`,className:t.input,tabIndex:-1,"aria-labelledby":R,multiple:v,accept:y,disabled:E,onChange:e=>{V(e.target.files),e.target.value=``}}),u(`button`,{type:`button`,className:t.zone,"data-state":A.value?`dragover`:`idle`,disabled:E,"aria-labelledby":C?void 0:R,"aria-label":C,"aria-describedby":w?z:void 0,onClick:()=>k.current?.click(),onDragEnter:e=>{e.preventDefault(),E||(A.value=!0)},onDragOver:e=>{e.preventDefault(),E||(e.dataTransfer.dropEffect=`copy`)},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||(A.value=!1)},onDrop:e=>{e.preventDefault(),A.value=!1,!E&&V(e.dataTransfer.files)},children:u(`span`,{className:t.zoneText,children:M})}),w&&u(`span`,{id:z,className:t.hint,children:w}),u(`span`,{id:B,className:t.srOnly,role:`status`,"aria-live":`polite`,children:h.length>0?l(s.fileUploader.status,{count:h.length,state:m(h,N,P,F)}):``}),h.length>0&&u(`ul`,{className:t.list,children:h.map(n=>d(`li`,{className:t.file,"data-state":n.status,children:[d(`span`,{className:t.status,children:[n.status===`uploading`&&u(e,{size:`sm`,label:N}),n.status===`complete`&&u(`span`,{className:t[`glyph-complete`],role:`img`,"aria-label":P,children:`✓`}),n.status===`error`&&u(`span`,{className:t[`glyph-error`],role:`img`,"aria-label":F,children:`✕`})]}),u(`span`,{className:t.name,children:n.name}),n.size!==void 0&&u(`span`,{className:t.size,children:p(n.size,O)}),u(`button`,{type:`button`,className:t.remove,"aria-label":I(n.name),disabled:E,onClick:()=>_?.(n.id),children:`✕`}),n.status===`error`&&n.errorMessage&&u(`span`,{className:t[`error-message`],role:`alert`,children:n.errorMessage})]},n.id))})]})}export{h as FileUploader};
|
|
@@ -1,18 +1 @@
|
|
|
1
|
-
var e
|
|
2
|
-
uploader: "_uploader_c3mm3_2",
|
|
3
|
-
label: "_label_c3mm3_13",
|
|
4
|
-
input: "_input_c3mm3_19",
|
|
5
|
-
zone: "_zone_c3mm3_28",
|
|
6
|
-
hint: "_hint_c3mm3_61",
|
|
7
|
-
list: "_list_c3mm3_66",
|
|
8
|
-
file: "_file_c3mm3_75",
|
|
9
|
-
status: "_status_c3mm3_92",
|
|
10
|
-
"glyph-complete": "_glyph-complete_c3mm3_98",
|
|
11
|
-
"glyph-error": "_glyph-error_c3mm3_102",
|
|
12
|
-
name: "_name_c3mm3_106",
|
|
13
|
-
size: "_size_c3mm3_113",
|
|
14
|
-
remove: "_remove_c3mm3_119",
|
|
15
|
-
"error-message": "_error-message_c3mm3_139"
|
|
16
|
-
};
|
|
17
|
-
//#endregion
|
|
18
|
-
export { e as default };
|
|
1
|
+
var e={uploader:`_uploader_d2bk6_2`,label:`_label_d2bk6_13`,input:`_input_d2bk6_19`,zone:`_zone_d2bk6_28`,hint:`_hint_d2bk6_61`,list:`_list_d2bk6_66`,file:`_file_d2bk6_75`,status:`_status_d2bk6_92`,"glyph-complete":`_glyph-complete_d2bk6_98`,"glyph-error":`_glyph-error_d2bk6_102`,name:`_name_d2bk6_106`,size:`_size_d2bk6_113`,remove:`_remove_d2bk6_119`,"error-message":`_error-message_d2bk6_139`,zoneText:`_zoneText_d2bk6_148`,srOnly:`_srOnly_d2bk6_152`};export{e as default};
|
|
@@ -1,35 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import e from "./filter.module.js";
|
|
4
|
-
import { useControllableSignal as t, useSignals as n } from "@cascivo/core";
|
|
5
|
-
import { jsx as r } from "react/jsx-runtime";
|
|
6
|
-
//#region ../components/src/filter/filter.tsx
|
|
7
|
-
function i({ options: i, value: a, defaultValue: o = [], onValueChange: s, multi: c = !1, multiple: l, variant: u = "pill", className: d, ariaLabel: f, label: p, ...m }) {
|
|
8
|
-
n();
|
|
9
|
-
let h = l ?? c, [g, _] = t({
|
|
10
|
-
value: a,
|
|
11
|
-
defaultValue: o,
|
|
12
|
-
onChange: s
|
|
13
|
-
});
|
|
14
|
-
function v(e) {
|
|
15
|
-
let t = g.value, n;
|
|
16
|
-
n = h ? t.includes(e) ? t.filter((t) => t !== e) : [...t, e] : t.includes(e) ? [] : [e], _(n);
|
|
17
|
-
}
|
|
18
|
-
return /* @__PURE__ */ r("div", {
|
|
19
|
-
role: "group",
|
|
20
|
-
className: [e.filter, d].filter(Boolean).join(" "),
|
|
21
|
-
"data-variant": u,
|
|
22
|
-
"aria-label": m["aria-label"] ?? f ?? p,
|
|
23
|
-
...m,
|
|
24
|
-
children: i.map((t) => /* @__PURE__ */ r("button", {
|
|
25
|
-
type: "button",
|
|
26
|
-
className: e.item,
|
|
27
|
-
"data-selected": g.value.includes(t.value) || void 0,
|
|
28
|
-
onClick: () => v(t.value),
|
|
29
|
-
"aria-pressed": g.value.includes(t.value),
|
|
30
|
-
children: t.label
|
|
31
|
-
}, t.value))
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
//#endregion
|
|
35
|
-
export { i as Filter };
|
|
1
|
+
"use client";import e from"./filter.module.js";import{useControllableSignal as t,useSignals as n}from"@cascivo/core";import{jsx as r}from"react/jsx-runtime";function i({options:i,value:a,defaultValue:o=[],onValueChange:s,multi:c=!1,multiple:l,variant:u=`pill`,className:d,ariaLabel:f,label:p,...m}){n();let h=l??c,[g,_]=t({value:a,defaultValue:o,onChange:s});function v(e){let t=g.value,n;n=h?t.includes(e)?t.filter(t=>t!==e):[...t,e]:t.includes(e)?[]:[e],_(n)}return r(`div`,{role:`group`,className:[e.filter,d].filter(Boolean).join(` `),"data-variant":u,"aria-label":m[`aria-label`]??f??p,...m,children:i.map(t=>r(`button`,{type:`button`,className:e.item,"data-selected":g.value.includes(t.value)||void 0,onClick:()=>v(t.value),"aria-pressed":g.value.includes(t.value),children:t.label},t.value))})}export{i as Filter};
|