@cascivo/react 0.18.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 +9 -7
- 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 -38
- 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 -268
- 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 -165
- 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 -371
- 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 -219
- 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 -107
- package/dist/dropdown/dropdown.module.js +1 -9
- package/dist/editable/editable.js +1 -67
- 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 -46
- 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 -122
- 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 +2084 -120
- 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 -55
- 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 -38
- 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 -268
- 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 -165
- 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 -371
- 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 -219
- 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 -107
- package/dist/node/dropdown/dropdown.module.js +1 -9
- package/dist/node/editable/editable.js +1 -67
- 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 -46
- package/dist/node/field/field.module.js +1 -7
- package/dist/node/file-uploader/file-uploader.js +1 -122
- 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 -55
- 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 -147
- 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 -48
- 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 -92
- 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 -72
- 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 -29
- 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 -64
- 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 -57
- 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 -63
- 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 -41
- 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 -147
- 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 -48
- 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 -92
- 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 -72
- 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 -29
- 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 -64
- 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 -57
- 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 -63
- 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 -41
- 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 +7 -5
|
@@ -1,122 +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, hint: b, labels: x, disabled: S = !1, className: C }) {
|
|
18
|
-
a();
|
|
19
|
-
let w = n(null), T = i(!1), E = y ?? x?.label ?? s(o.fileUploader.label), D = x?.drop ?? s(o.fileUploader.drop), O = x?.uploading ?? s(o.fileUploader.uploading), k = x?.complete ?? s(o.fileUploader.complete), A = x?.error ?? s(o.fileUploader.error), j = (e) => x?.remove ? x.remove.replace("{name}", e) : s(o.fileUploader.remove, { name: e }), M = `cascade-uploader-${E.toLowerCase().replace(/\s+/g, "-")}`, N = `${M}-label`, P = `${M}-hint`, F = (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, C),
|
|
27
|
-
children: [
|
|
28
|
-
/* @__PURE__ */ c("span", {
|
|
29
|
-
id: N,
|
|
30
|
-
className: t.label,
|
|
31
|
-
children: E
|
|
32
|
-
}),
|
|
33
|
-
/* @__PURE__ */ c("input", {
|
|
34
|
-
ref: w,
|
|
35
|
-
type: "file",
|
|
36
|
-
className: t.input,
|
|
37
|
-
tabIndex: -1,
|
|
38
|
-
"aria-hidden": "true",
|
|
39
|
-
multiple: h,
|
|
40
|
-
accept: g,
|
|
41
|
-
disabled: S,
|
|
42
|
-
onChange: (e) => {
|
|
43
|
-
F(e.target.files), e.target.value = "";
|
|
44
|
-
}
|
|
45
|
-
}),
|
|
46
|
-
/* @__PURE__ */ c("button", {
|
|
47
|
-
type: "button",
|
|
48
|
-
className: t.zone,
|
|
49
|
-
"data-state": T.value ? "dragover" : "idle",
|
|
50
|
-
disabled: S,
|
|
51
|
-
"aria-describedby": b ? `${N} ${P}` : N,
|
|
52
|
-
onClick: () => w.current?.click(),
|
|
53
|
-
onDragEnter: (e) => {
|
|
54
|
-
e.preventDefault(), S || (T.value = !0);
|
|
55
|
-
},
|
|
56
|
-
onDragOver: (e) => e.preventDefault(),
|
|
57
|
-
onDragLeave: () => {
|
|
58
|
-
T.value = !1;
|
|
59
|
-
},
|
|
60
|
-
onDrop: (e) => {
|
|
61
|
-
e.preventDefault(), T.value = !1, !S && F(e.dataTransfer.files);
|
|
62
|
-
},
|
|
63
|
-
children: D
|
|
64
|
-
}),
|
|
65
|
-
b && /* @__PURE__ */ c("span", {
|
|
66
|
-
id: P,
|
|
67
|
-
className: t.hint,
|
|
68
|
-
children: b
|
|
69
|
-
}),
|
|
70
|
-
f.length > 0 && /* @__PURE__ */ c("ul", {
|
|
71
|
-
className: t.list,
|
|
72
|
-
"aria-live": "polite",
|
|
73
|
-
children: f.map((n) => /* @__PURE__ */ l("li", {
|
|
74
|
-
className: t.file,
|
|
75
|
-
"data-state": n.status,
|
|
76
|
-
children: [
|
|
77
|
-
/* @__PURE__ */ l("span", {
|
|
78
|
-
className: t.status,
|
|
79
|
-
children: [
|
|
80
|
-
n.status === "uploading" && /* @__PURE__ */ c(e, {
|
|
81
|
-
size: "sm",
|
|
82
|
-
label: O
|
|
83
|
-
}),
|
|
84
|
-
n.status === "complete" && /* @__PURE__ */ c("span", {
|
|
85
|
-
className: t["glyph-complete"],
|
|
86
|
-
"aria-label": k,
|
|
87
|
-
children: "✓"
|
|
88
|
-
}),
|
|
89
|
-
n.status === "error" && /* @__PURE__ */ c("span", {
|
|
90
|
-
className: t["glyph-error"],
|
|
91
|
-
"aria-label": A,
|
|
92
|
-
children: "✕"
|
|
93
|
-
})
|
|
94
|
-
]
|
|
95
|
-
}),
|
|
96
|
-
/* @__PURE__ */ c("span", {
|
|
97
|
-
className: t.name,
|
|
98
|
-
children: n.name
|
|
99
|
-
}),
|
|
100
|
-
n.size !== void 0 && /* @__PURE__ */ c("span", {
|
|
101
|
-
className: t.size,
|
|
102
|
-
children: d(n.size)
|
|
103
|
-
}),
|
|
104
|
-
/* @__PURE__ */ c("button", {
|
|
105
|
-
type: "button",
|
|
106
|
-
className: t.remove,
|
|
107
|
-
"aria-label": j(n.name),
|
|
108
|
-
onClick: () => m?.(n.id),
|
|
109
|
-
children: "✕"
|
|
110
|
-
}),
|
|
111
|
-
n.status === "error" && n.errorMessage && /* @__PURE__ */ c("span", {
|
|
112
|
-
className: t["error-message"],
|
|
113
|
-
children: n.errorMessage
|
|
114
|
-
})
|
|
115
|
-
]
|
|
116
|
-
}, n.id))
|
|
117
|
-
})
|
|
118
|
-
]
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
//#endregion
|
|
122
|
-
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, onChange: c, multi: l = !1, variant: u = "pill", className: d, ariaLabel: f, ...p }) {
|
|
8
|
-
n();
|
|
9
|
-
let [m, h] = t({
|
|
10
|
-
value: a,
|
|
11
|
-
defaultValue: o,
|
|
12
|
-
onChange: s ?? c
|
|
13
|
-
});
|
|
14
|
-
function g(e) {
|
|
15
|
-
let t = m.value, n;
|
|
16
|
-
n = l ? t.includes(e) ? t.filter((t) => t !== e) : [...t, e] : t.includes(e) ? [] : [e], h(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": p["aria-label"] ?? f,
|
|
23
|
-
...p,
|
|
24
|
-
children: i.map((t) => /* @__PURE__ */ r("button", {
|
|
25
|
-
type: "button",
|
|
26
|
-
className: e.item,
|
|
27
|
-
"data-selected": m.value.includes(t.value) || void 0,
|
|
28
|
-
onClick: () => g(t.value),
|
|
29
|
-
"aria-pressed": m.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};
|
package/dist/node/form/form.js
CHANGED
|
@@ -1,95 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import e from "./form.module.js";
|
|
4
|
-
import { batch as t, cn as n, signal as r, useSignal as i, useSignals as a } from "@cascivo/core";
|
|
5
|
-
import { jsx as o } from "react/jsx-runtime";
|
|
6
|
-
//#region ../components/src/form/form.tsx
|
|
7
|
-
function s(e) {
|
|
8
|
-
let t = e[0];
|
|
9
|
-
return t === void 0 ? "" : String(typeof t == "string" || typeof t == "number" ? t : t.key);
|
|
10
|
-
}
|
|
11
|
-
async function c(e, t) {
|
|
12
|
-
let n = await e["~standard"].validate(t);
|
|
13
|
-
if (!("issues" in n) || n.issues === void 0) return {};
|
|
14
|
-
let r = {};
|
|
15
|
-
for (let e of n.issues) {
|
|
16
|
-
let t = e.path && e.path.length > 0 ? s(e.path) : "";
|
|
17
|
-
t && !(t in r) && (r[t] = e.message);
|
|
18
|
-
}
|
|
19
|
-
return r;
|
|
20
|
-
}
|
|
21
|
-
function l(e) {
|
|
22
|
-
let n = r({ ...e.initialValues }), i = r({}), a = r({}), o = r(!1), s = async (t) => {
|
|
23
|
-
let n = {};
|
|
24
|
-
return e.schema && (n = await c(e.schema, t)), Object.keys(n).length === 0 && e.validate && (n = await e.validate(t)), n;
|
|
25
|
-
}, l = 0, u = (t, r) => {
|
|
26
|
-
if (n.value = {
|
|
27
|
-
...n.value,
|
|
28
|
-
[t]: r
|
|
29
|
-
}, !e.validateOnChange) return;
|
|
30
|
-
let a = ++l;
|
|
31
|
-
s(n.value).then((e) => {
|
|
32
|
-
if (a !== l) return;
|
|
33
|
-
let n = { ...i.value }, r = e[t];
|
|
34
|
-
r === void 0 ? delete n[t] : n[t] = r, i.value = n;
|
|
35
|
-
});
|
|
36
|
-
};
|
|
37
|
-
return {
|
|
38
|
-
values: n,
|
|
39
|
-
errors: i,
|
|
40
|
-
touched: a,
|
|
41
|
-
submitting: o,
|
|
42
|
-
setValue: u,
|
|
43
|
-
field(e) {
|
|
44
|
-
return {
|
|
45
|
-
get value() {
|
|
46
|
-
return n.value[e];
|
|
47
|
-
},
|
|
48
|
-
onChange: (t) => u(e, t),
|
|
49
|
-
onBlur: () => {
|
|
50
|
-
a.value = {
|
|
51
|
-
...a.value,
|
|
52
|
-
[e]: !0
|
|
53
|
-
};
|
|
54
|
-
},
|
|
55
|
-
get error() {
|
|
56
|
-
return i.value[e];
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
},
|
|
60
|
-
async submit(r) {
|
|
61
|
-
o.value = !0;
|
|
62
|
-
try {
|
|
63
|
-
let o = await s(n.value), c = Object.fromEntries(Object.keys(e.initialValues).map((e) => [e, !0]));
|
|
64
|
-
t(() => {
|
|
65
|
-
i.value = o, a.value = c;
|
|
66
|
-
}), Object.keys(o).length === 0 && await r(n.value);
|
|
67
|
-
} finally {
|
|
68
|
-
o.value = !1;
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
reset() {
|
|
72
|
-
t(() => {
|
|
73
|
-
n.value = { ...e.initialValues }, i.value = {}, a.value = {};
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
function u(e) {
|
|
79
|
-
a();
|
|
80
|
-
let t = i(null);
|
|
81
|
-
return t.peek() === null && (t.value = l(e)), t.peek();
|
|
82
|
-
}
|
|
83
|
-
function d({ form: t, onValid: r, children: i, className: a, ...s }) {
|
|
84
|
-
return /* @__PURE__ */ o("form", {
|
|
85
|
-
noValidate: !0,
|
|
86
|
-
className: n(e.form, a),
|
|
87
|
-
onSubmit: (e) => {
|
|
88
|
-
e.preventDefault(), t.submit(r);
|
|
89
|
-
},
|
|
90
|
-
...s,
|
|
91
|
-
children: i
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
//#endregion
|
|
95
|
-
export { d as Form, l as createForm, u as useForm };
|
|
1
|
+
"use client";import e from"./form.module.js";import{batch as t,cn as n,signal as r,useSignal as i,useSignals as a}from"@cascivo/core";import{jsx as o}from"react/jsx-runtime";function s(e){let t=e[0];return t===void 0?``:String(typeof t==`string`||typeof t==`number`?t:t.key)}async function c(e,t){let n=await e[`~standard`].validate(t);if(!(`issues`in n)||n.issues===void 0)return{};let r={};for(let e of n.issues){let t=e.path&&e.path.length>0?s(e.path):``;t&&!(t in r)&&(r[t]=e.message)}return r}function l(e){let n=r({...e.initialValues}),i=r({}),a=r({}),o=r(!1),s=async t=>{let n={};return e.schema&&(n=await c(e.schema,t)),Object.keys(n).length===0&&e.validate&&(n=await e.validate(t)),n},l=0,u=(t,r)=>{if(n.value={...n.value,[t]:r},!e.validateOnChange)return;let a=++l;s(n.value).then(e=>{if(a!==l)return;let n={...i.value},r=e[t];r===void 0?delete n[t]:n[t]=r,i.value=n})};return{values:n,errors:i,touched:a,submitting:o,setValue:u,field(e){return{get value(){return n.value[e]},onChange:t=>u(e,t),onBlur:()=>{a.value={...a.value,[e]:!0}},get error(){return i.value[e]}}},async submit(r){o.value=!0;try{let o=await s(n.value),c=Object.fromEntries(Object.keys(e.initialValues).map(e=>[e,!0]));t(()=>{i.value=o,a.value=c}),Object.keys(o).length===0&&await r(n.value)}finally{o.value=!1}},reset(){t(()=>{n.value={...e.initialValues},i.value={},a.value={}})}}}function u(e){a();let t=i(null);return t.peek()===null&&(t.value=l(e)),t.peek()}function d({form:t,onValid:r,children:i,className:a,...s}){return o(`form`,{noValidate:!0,className:n(e.form,a),onSubmit:e=>{e.preventDefault(),t.submit(r)},...s,children:i})}export{d as Form,l as createForm,u as useForm};
|
|
@@ -1,44 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import e from "./header.module.js";
|
|
4
|
-
import { cn as t, getLinkComponent as n, useSignals as r } from "@cascivo/core";
|
|
5
|
-
import { builtin as i, t as a } from "@cascivo/i18n";
|
|
6
|
-
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
|
-
//#region ../components/src/header/header.tsx
|
|
8
|
-
function c({ brand: c, links: l, actions: u, sticky: d = !1, labels: f, className: p, ...m }) {
|
|
9
|
-
r();
|
|
10
|
-
let h = n(), g = f?.nav ?? a(i.header.nav);
|
|
11
|
-
return /* @__PURE__ */ s("header", {
|
|
12
|
-
role: "banner",
|
|
13
|
-
"data-sticky": d || void 0,
|
|
14
|
-
className: t(e.header, p),
|
|
15
|
-
...m,
|
|
16
|
-
children: [
|
|
17
|
-
c && /* @__PURE__ */ o("div", {
|
|
18
|
-
className: e.brand,
|
|
19
|
-
children: c
|
|
20
|
-
}),
|
|
21
|
-
l && l.length > 0 && /* @__PURE__ */ o("nav", {
|
|
22
|
-
"aria-label": g,
|
|
23
|
-
className: e.nav,
|
|
24
|
-
children: /* @__PURE__ */ o("ul", {
|
|
25
|
-
className: e.list,
|
|
26
|
-
children: l.map((t, n) => /* @__PURE__ */ o("li", { children: /* @__PURE__ */ o(h, {
|
|
27
|
-
href: t.href,
|
|
28
|
-
"aria-current": t.active ? "page" : void 0,
|
|
29
|
-
"data-state": t.active ? "active" : void 0,
|
|
30
|
-
className: e.link,
|
|
31
|
-
children: t.label
|
|
32
|
-
}) }, t.id ?? `${n}-${t.href}`))
|
|
33
|
-
})
|
|
34
|
-
}),
|
|
35
|
-
/* @__PURE__ */ o("div", { className: e.spacer }),
|
|
36
|
-
u && /* @__PURE__ */ o("div", {
|
|
37
|
-
className: e.actions,
|
|
38
|
-
children: u
|
|
39
|
-
})
|
|
40
|
-
]
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
//#endregion
|
|
44
|
-
export { c as Header };
|
|
1
|
+
"use client";import e from"./header.module.js";import{cn as t,getLinkComponent as n,useSignals as r}from"@cascivo/core";import{builtin as i,t as a}from"@cascivo/i18n";import{jsx as o,jsxs as s}from"react/jsx-runtime";function c({brand:c,links:l,actions:u,sticky:d=!1,labels:f,className:p,...m}){r();let h=n(),g=f?.nav??a(i.header.nav);return s(`header`,{role:`banner`,"data-sticky":d||void 0,className:t(e.header,p),...m,children:[c&&o(`div`,{className:e.brand,children:c}),l&&l.length>0&&o(`nav`,{"aria-label":g,className:e.nav,children:o(`ul`,{className:e.list,children:l.map((t,n)=>o(`li`,{children:o(h,{href:t.href,"aria-current":t.active?`page`:void 0,"data-state":t.active?`active`:void 0,className:e.link,children:t.label})},t.id??`${n}-${t.href}`))})}),o(`div`,{className:e.spacer}),u&&o(`div`,{className:e.actions,children:u})]})}export{c as Header};
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
var e
|
|
2
|
-
header: "_header_1n9di_2",
|
|
3
|
-
brand: "_brand_1n9di_20",
|
|
4
|
-
nav: "_nav_1n9di_35",
|
|
5
|
-
list: "_list_1n9di_39",
|
|
6
|
-
link: "_link_1n9di_48",
|
|
7
|
-
spacer: "_spacer_1n9di_80",
|
|
8
|
-
actions: "_actions_1n9di_84"
|
|
9
|
-
};
|
|
10
|
-
//#endregion
|
|
11
|
-
export { e as default };
|
|
1
|
+
var e={header:`_header_1n9di_2`,brand:`_brand_1n9di_20`,nav:`_nav_1n9di_35`,list:`_list_1n9di_39`,link:`_link_1n9di_48`,spacer:`_spacer_1n9di_80`,actions:`_actions_1n9di_84`};export{e as default};
|
|
@@ -1,72 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import e from "./header-panel.module.js";
|
|
4
|
-
import { useRef as t } from "react";
|
|
5
|
-
import { cn as n, focusElement as r, useEffectPropSignal as i, useSignalEffect as a, useSignals as o } from "@cascivo/core";
|
|
6
|
-
import { builtin as s, t as c } from "@cascivo/i18n";
|
|
7
|
-
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
8
|
-
//#region ../components/src/header-panel/header-panel.tsx
|
|
9
|
-
function d({ open: d, onClose: f, label: p, children: m, labels: h, className: g }) {
|
|
10
|
-
o();
|
|
11
|
-
let _ = t(null), v = t(null), y = i(d), b = t(f);
|
|
12
|
-
return b.current = f, a(() => {
|
|
13
|
-
let e = _.current;
|
|
14
|
-
if (e) if (y.value) {
|
|
15
|
-
v.current = document.activeElement;
|
|
16
|
-
try {
|
|
17
|
-
e.showPopover();
|
|
18
|
-
} catch {}
|
|
19
|
-
e.focus();
|
|
20
|
-
} else {
|
|
21
|
-
try {
|
|
22
|
-
e.hidePopover();
|
|
23
|
-
} catch {}
|
|
24
|
-
r(v.current), v.current = null;
|
|
25
|
-
}
|
|
26
|
-
}), a(() => {
|
|
27
|
-
let e = _.current;
|
|
28
|
-
if (!e) return;
|
|
29
|
-
let t = (e) => {
|
|
30
|
-
let t = "newState" in e ? e.newState === "closed" : !0;
|
|
31
|
-
y.peek() && t && b.current();
|
|
32
|
-
};
|
|
33
|
-
return e.addEventListener("toggle", t), () => e.removeEventListener("toggle", t);
|
|
34
|
-
}), /* @__PURE__ */ u("div", {
|
|
35
|
-
ref: _,
|
|
36
|
-
popover: "auto",
|
|
37
|
-
role: "region",
|
|
38
|
-
"aria-label": p,
|
|
39
|
-
tabIndex: -1,
|
|
40
|
-
"data-state": d ? "open" : "closed",
|
|
41
|
-
className: n(e.panel, g),
|
|
42
|
-
children: [/* @__PURE__ */ u("div", {
|
|
43
|
-
className: e.header,
|
|
44
|
-
children: [/* @__PURE__ */ l("span", {
|
|
45
|
-
className: e.title,
|
|
46
|
-
children: p
|
|
47
|
-
}), /* @__PURE__ */ l("button", {
|
|
48
|
-
type: "button",
|
|
49
|
-
"aria-label": h?.close ?? c(s.headerPanel.close),
|
|
50
|
-
className: e.close,
|
|
51
|
-
onClick: () => b.current(),
|
|
52
|
-
children: /* @__PURE__ */ l("svg", {
|
|
53
|
-
viewBox: "0 0 16 16",
|
|
54
|
-
width: "14",
|
|
55
|
-
height: "14",
|
|
56
|
-
"aria-hidden": "true",
|
|
57
|
-
children: /* @__PURE__ */ l("path", {
|
|
58
|
-
d: "M4 4l8 8M12 4l-8 8",
|
|
59
|
-
stroke: "currentColor",
|
|
60
|
-
strokeWidth: "1.5",
|
|
61
|
-
strokeLinecap: "round"
|
|
62
|
-
})
|
|
63
|
-
})
|
|
64
|
-
})]
|
|
65
|
-
}), /* @__PURE__ */ l("div", {
|
|
66
|
-
className: e.body,
|
|
67
|
-
children: m
|
|
68
|
-
})]
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
//#endregion
|
|
72
|
-
export { d as HeaderPanel };
|
|
1
|
+
"use client";import e from"./header-panel.module.js";import{useRef as t}from"react";import{cn as n,focusElement as r,useEffectPropSignal as i,useSignalEffect as a,useSignals as o}from"@cascivo/core";import{builtin as s,t as c}from"@cascivo/i18n";import{jsx as l,jsxs as u}from"react/jsx-runtime";function d({open:d,onClose:f,label:p,children:m,labels:h,className:g}){o();let _=t(null),v=t(null),y=i(d),b=t(f);return b.current=f,a(()=>{let e=_.current;if(e)if(y.value){v.current=document.activeElement;try{e.showPopover()}catch{}e.focus()}else{try{e.hidePopover()}catch{}r(v.current),v.current=null}}),a(()=>{let e=_.current;if(!e)return;let t=e=>{let t=`newState`in e?e.newState===`closed`:!0;y.peek()&&t&&b.current()};return e.addEventListener(`toggle`,t),()=>e.removeEventListener(`toggle`,t)}),u(`div`,{ref:_,popover:`auto`,role:`region`,"aria-label":p,tabIndex:-1,"data-state":d?`open`:`closed`,className:n(e.panel,g),children:[u(`div`,{className:e.header,children:[l(`span`,{className:e.title,children:p}),l(`button`,{type:`button`,"aria-label":h?.close??c(s.headerPanel.close),className:e.close,onClick:()=>b.current(),children:l(`svg`,{viewBox:`0 0 16 16`,width:`14`,height:`14`,"aria-hidden":`true`,children:l(`path`,{d:`M4 4l8 8M12 4l-8 8`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`})})})]}),l(`div`,{className:e.body,children:m})]})}export{d as HeaderPanel};
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
var e
|
|
2
|
-
panel: "_panel_gsmp3_2",
|
|
3
|
-
header: "_header_gsmp3_41",
|
|
4
|
-
title: "_title_gsmp3_50",
|
|
5
|
-
close: "_close_gsmp3_57",
|
|
6
|
-
body: "_body_gsmp3_80"
|
|
7
|
-
};
|
|
8
|
-
//#endregion
|
|
9
|
-
export { e as default };
|
|
1
|
+
var e={panel:`_panel_gsmp3_2`,header:`_header_gsmp3_41`,title:`_title_gsmp3_50`,close:`_close_gsmp3_57`,body:`_body_gsmp3_80`};export{e as default};
|
|
@@ -1,22 +1 @@
|
|
|
1
|
-
import e from
|
|
2
|
-
import { cn as t } from "@cascivo/core/pure";
|
|
3
|
-
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
-
//#region ../components/src/heading/heading.tsx
|
|
5
|
-
var r = {
|
|
6
|
-
1: "2xl",
|
|
7
|
-
2: "xl",
|
|
8
|
-
3: "lg",
|
|
9
|
-
4: "md",
|
|
10
|
-
5: "sm",
|
|
11
|
-
6: "sm"
|
|
12
|
-
};
|
|
13
|
-
function i({ level: i = 2, size: a, className: o, children: s, ...c }) {
|
|
14
|
-
return /* @__PURE__ */ n(`h${i}`, {
|
|
15
|
-
"data-size": a ?? r[i],
|
|
16
|
-
className: t(e.heading, o),
|
|
17
|
-
...c,
|
|
18
|
-
children: s
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
//#endregion
|
|
22
|
-
export { i as Heading };
|
|
1
|
+
import e from"./heading.module.js";import{cn as t}from"@cascivo/core/pure";import{jsx as n}from"react/jsx-runtime";var r={1:`2xl`,2:`xl`,3:`lg`,4:`md`,5:`sm`,6:`sm`};function i({level:i=2,size:a,className:o,children:s,...c}){return n(`h${i}`,{"data-size":a??r[i],className:t(e.heading,o),...c,children:s})}export{i as Heading};
|
|
@@ -1,84 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { usePopover as e } from "../popover/use-popover.js";
|
|
4
|
-
import t from "./hover-card.module.js";
|
|
5
|
-
import { createContext as n, useRef as r } from "react";
|
|
6
|
-
import { useSignalEffect as i, useSignals as a } from "@cascivo/core";
|
|
7
|
-
import { jsx as o } from "react/jsx-runtime";
|
|
8
|
-
//#region ../components/src/hover-card/hover-card.tsx
|
|
9
|
-
var s = n(null);
|
|
10
|
-
function c({ children: t, openDelay: n = 300, closeDelay: a = 100 }) {
|
|
11
|
-
let c = e(), l = r(void 0), u = r(void 0), d = r(n);
|
|
12
|
-
d.current = n;
|
|
13
|
-
let f = r(a);
|
|
14
|
-
f.current = a;
|
|
15
|
-
let p = {
|
|
16
|
-
...c,
|
|
17
|
-
open: () => {
|
|
18
|
-
clearTimeout(u.current), l.current = setTimeout(() => {
|
|
19
|
-
c.isOpen.value = !0;
|
|
20
|
-
}, d.current);
|
|
21
|
-
},
|
|
22
|
-
close: () => {
|
|
23
|
-
clearTimeout(l.current), u.current = setTimeout(() => {
|
|
24
|
-
c.isOpen.value = !1;
|
|
25
|
-
}, f.current);
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
return i(() => () => {
|
|
29
|
-
clearTimeout(l.current), clearTimeout(u.current);
|
|
30
|
-
}), /* @__PURE__ */ o(s.Provider, {
|
|
31
|
-
value: p,
|
|
32
|
-
children: t
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
function l({ ctx: e, children: n }) {
|
|
36
|
-
a();
|
|
37
|
-
let { triggerRef: r, anchorName: i, open: s, close: c } = e;
|
|
38
|
-
return /* @__PURE__ */ o("span", {
|
|
39
|
-
ref: r,
|
|
40
|
-
style: { anchorName: i },
|
|
41
|
-
onMouseEnter: s,
|
|
42
|
-
onMouseLeave: c,
|
|
43
|
-
onFocus: s,
|
|
44
|
-
onBlur: c,
|
|
45
|
-
className: t.trigger,
|
|
46
|
-
children: n
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
function u({ children: e }) {
|
|
50
|
-
return /* @__PURE__ */ o(s.Consumer, { children: (t) => {
|
|
51
|
-
if (!t) throw Error("HoverCardTrigger must be inside <HoverCard>");
|
|
52
|
-
return /* @__PURE__ */ o(l, {
|
|
53
|
-
ctx: t,
|
|
54
|
-
children: e
|
|
55
|
-
});
|
|
56
|
-
} });
|
|
57
|
-
}
|
|
58
|
-
function d({ ctx: e, children: n, className: r }) {
|
|
59
|
-
a();
|
|
60
|
-
let { popoverRef: i, anchorName: s, isOpen: c, open: l, close: u } = e;
|
|
61
|
-
return /* @__PURE__ */ o("div", {
|
|
62
|
-
ref: i,
|
|
63
|
-
popover: "auto",
|
|
64
|
-
role: "complementary",
|
|
65
|
-
"data-state": c.value ? "open" : "closed",
|
|
66
|
-
style: { positionAnchor: s },
|
|
67
|
-
onMouseEnter: l,
|
|
68
|
-
onMouseLeave: u,
|
|
69
|
-
className: [t.content, r].filter(Boolean).join(" "),
|
|
70
|
-
children: n
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
function f({ children: e, className: t }) {
|
|
74
|
-
return /* @__PURE__ */ o(s.Consumer, { children: (n) => {
|
|
75
|
-
if (!n) throw Error("HoverCardContent must be inside <HoverCard>");
|
|
76
|
-
return /* @__PURE__ */ o(d, {
|
|
77
|
-
ctx: n,
|
|
78
|
-
...t !== void 0 && { className: t },
|
|
79
|
-
children: e
|
|
80
|
-
});
|
|
81
|
-
} });
|
|
82
|
-
}
|
|
83
|
-
//#endregion
|
|
84
|
-
export { c as HoverCard, f as HoverCardContent, u as HoverCardTrigger };
|
|
1
|
+
"use client";import{usePopover as e}from"../popover/use-popover.js";import t from"./hover-card.module.js";import{createContext as n,useRef as r}from"react";import{useSignalEffect as i,useSignals as a}from"@cascivo/core";import{jsx as o}from"react/jsx-runtime";var s=n(null);function c({children:t,openDelay:n=300,closeDelay:a=100}){let c=e(),l=r(void 0),u=r(void 0),d=r(n);d.current=n;let f=r(a);f.current=a;let p={...c,open:()=>{clearTimeout(u.current),l.current=setTimeout(()=>{c.isOpen.value=!0},d.current)},close:()=>{clearTimeout(l.current),u.current=setTimeout(()=>{c.isOpen.value=!1},f.current)}};return i(()=>()=>{clearTimeout(l.current),clearTimeout(u.current)}),o(s.Provider,{value:p,children:t})}function l({ctx:e,children:n}){a();let{triggerRef:r,anchorName:i,open:s,close:c}=e;return o(`span`,{ref:r,style:{anchorName:i},onMouseEnter:s,onMouseLeave:c,onFocus:s,onBlur:c,className:t.trigger,children:n})}function u({children:e}){return o(s.Consumer,{children:t=>{if(!t)throw Error(`HoverCardTrigger must be inside <HoverCard>`);return o(l,{ctx:t,children:e})}})}function d({ctx:e,children:n,className:r}){a();let{popoverRef:i,anchorName:s,isOpen:c,open:l,close:u}=e;return o(`div`,{ref:i,popover:`auto`,role:`complementary`,"data-state":c.value?`open`:`closed`,style:{positionAnchor:s},onMouseEnter:l,onMouseLeave:u,className:[t.content,r].filter(Boolean).join(` `),children:n})}function f({children:e,className:t}){return o(s.Consumer,{children:n=>{if(!n)throw Error(`HoverCardContent must be inside <HoverCard>`);return o(d,{ctx:n,...t!==void 0&&{className:t},children:e})}})}export{c as HoverCard,f as HoverCardContent,u as HoverCardTrigger};
|
|
@@ -1,19 +1 @@
|
|
|
1
|
-
import e from
|
|
2
|
-
import { Slot as t, cn as n } from "@cascivo/core/pure";
|
|
3
|
-
import { forwardRef as r } from "react";
|
|
4
|
-
import { jsx as i } from "react/jsx-runtime";
|
|
5
|
-
//#region ../components/src/icon-button/icon-button.tsx
|
|
6
|
-
var a = r(function({ label: r, ariaLabel: a, icon: o, size: s = "md", variant: c = "ghost", asChild: l = !1, className: u, children: d, ...f }, p) {
|
|
7
|
-
return /* @__PURE__ */ i(l ? t : "button", {
|
|
8
|
-
type: l ? void 0 : "button",
|
|
9
|
-
"aria-label": r ?? a,
|
|
10
|
-
"data-size": s,
|
|
11
|
-
"data-variant": c,
|
|
12
|
-
className: n(e.iconButton, u),
|
|
13
|
-
ref: p,
|
|
14
|
-
...f,
|
|
15
|
-
children: d ?? o
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
//#endregion
|
|
19
|
-
export { a as IconButton };
|
|
1
|
+
import e from"./icon-button.module.js";import{Slot as t,cn as n}from"@cascivo/core/pure";import{forwardRef as r}from"react";import{jsx as i}from"react/jsx-runtime";var a=r(function({label:r,ariaLabel:a,icon:o,size:s=`md`,variant:c=`ghost`,asChild:l=!1,className:u,children:d,...f},p){return i(l?t:`button`,{type:l?void 0:`button`,"aria-label":r??a,"data-size":s,"data-variant":c,className:n(e.iconButton,u),ref:p,...f,children:d??o})});export{a as IconButton};
|