@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,81 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import e from "./password-input.module.js";
|
|
4
|
-
import { forwardRef as t, useId as n } from "react";
|
|
5
|
-
import { cn as r, useSignal as i, useSignals as a } from "@cascivo/core";
|
|
6
|
-
import { builtin as o, t as s } from "@cascivo/i18n";
|
|
7
|
-
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
|
-
//#region ../components/src/password-input/password-input.tsx
|
|
9
|
-
function u(e) {
|
|
10
|
-
if (!e) return {
|
|
11
|
-
score: 0,
|
|
12
|
-
label: "weak"
|
|
13
|
-
};
|
|
14
|
-
let t = 0;
|
|
15
|
-
return /[a-z]/.test(e) && t++, /[A-Z]/.test(e) && t++, /[0-9]/.test(e) && t++, /[^a-zA-Z0-9]/.test(e) && t++, e.length >= 12 && (t = Math.min(4, t + 1)), t = Math.min(4, t), {
|
|
16
|
-
score: t,
|
|
17
|
-
label: [
|
|
18
|
-
"weak",
|
|
19
|
-
"weak",
|
|
20
|
-
"fair",
|
|
21
|
-
"good",
|
|
22
|
-
"strong"
|
|
23
|
-
][t]
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
var d = t(function({ showStrengthMeter: t = !1, size: d = "md", labels: f, className: p, id: m, value: h, defaultValue: g, onChange: _, ...v }, y) {
|
|
27
|
-
a();
|
|
28
|
-
let b = i(!1), x = i(typeof h == "string" ? h : typeof g == "string" ? g : "");
|
|
29
|
-
typeof h == "string" && (x.value = h);
|
|
30
|
-
let S = n(), C = m ?? `cascade-password-${S}`, w = t ? u(x.value) : null, T = b.value ? f?.hide ?? s(o.passwordInput.hide) : f?.reveal ?? s(o.passwordInput.reveal), E = w ? f?.strengthLabel ? f.strengthLabel(w.label) : s(o.passwordInput.strengthLabel, { level: w.label }) : void 0;
|
|
31
|
-
return /* @__PURE__ */ l("div", {
|
|
32
|
-
className: r(e.wrapper, p),
|
|
33
|
-
"data-size": d,
|
|
34
|
-
"data-revealed": b.value ? "" : void 0,
|
|
35
|
-
children: [/* @__PURE__ */ l("div", {
|
|
36
|
-
className: e["input-row"],
|
|
37
|
-
children: [/* @__PURE__ */ c("input", {
|
|
38
|
-
ref: y,
|
|
39
|
-
...v,
|
|
40
|
-
id: C,
|
|
41
|
-
type: b.value ? "text" : "password",
|
|
42
|
-
className: e.input,
|
|
43
|
-
value: h,
|
|
44
|
-
defaultValue: g,
|
|
45
|
-
onChange: (e) => {
|
|
46
|
-
typeof h != "string" && (x.value = e.currentTarget.value), _?.(e);
|
|
47
|
-
}
|
|
48
|
-
}), /* @__PURE__ */ c("button", {
|
|
49
|
-
type: "button",
|
|
50
|
-
className: e["reveal-btn"],
|
|
51
|
-
"aria-label": T,
|
|
52
|
-
onClick: () => {
|
|
53
|
-
b.value = !b.value;
|
|
54
|
-
},
|
|
55
|
-
children: /* @__PURE__ */ c("span", {
|
|
56
|
-
className: e["reveal-icon"],
|
|
57
|
-
"aria-hidden": "true"
|
|
58
|
-
})
|
|
59
|
-
})]
|
|
60
|
-
}), t && w && /* @__PURE__ */ c("div", {
|
|
61
|
-
className: e["strength-meter"],
|
|
62
|
-
role: "meter",
|
|
63
|
-
"aria-label": E,
|
|
64
|
-
"aria-valuenow": w.score,
|
|
65
|
-
"aria-valuemin": 0,
|
|
66
|
-
"aria-valuemax": 4,
|
|
67
|
-
"data-strength": w.label,
|
|
68
|
-
children: [
|
|
69
|
-
0,
|
|
70
|
-
1,
|
|
71
|
-
2,
|
|
72
|
-
3
|
|
73
|
-
].map((t) => /* @__PURE__ */ c("div", {
|
|
74
|
-
className: e["strength-segment"],
|
|
75
|
-
"data-filled": t < w.score ? "" : void 0
|
|
76
|
-
}, t))
|
|
77
|
-
})]
|
|
78
|
-
});
|
|
79
|
-
});
|
|
80
|
-
//#endregion
|
|
81
|
-
export { d as PasswordInput };
|
|
1
|
+
"use client";import e from"./password-input.module.js";import{forwardRef as t,useId as n}from"react";import{cn as r,useSignal as i,useSignals as a}from"@cascivo/core";import{builtin as o,t as s}from"@cascivo/i18n";import{jsx as c,jsxs as l}from"react/jsx-runtime";function u(e){if(!e)return{score:0,label:`weak`};let t=0;return/[a-z]/.test(e)&&t++,/[A-Z]/.test(e)&&t++,/[0-9]/.test(e)&&t++,/[^a-zA-Z0-9]/.test(e)&&t++,e.length>=12&&(t=Math.min(4,t+1)),t=Math.min(4,t),{score:t,label:[`weak`,`weak`,`fair`,`good`,`strong`][t]}}var d=t(function({showStrengthMeter:t=!1,size:d=`md`,labels:f,className:p,id:m,value:h,defaultValue:g,onChange:_,...v},y){a();let b=i(!1),x=i(typeof h==`string`?h:typeof g==`string`?g:``);typeof h==`string`&&(x.value=h);let S=n(),C=m??`cascade-password-${S}`,w=t?u(x.value):null,T=b.value?f?.hide??s(o.passwordInput.hide):f?.reveal??s(o.passwordInput.reveal),E=w?f?.strengthLabel?f.strengthLabel(w.label):s(o.passwordInput.strengthLabel,{level:w.label}):void 0;return l(`div`,{className:r(e.wrapper,p),"data-size":d,"data-revealed":b.value?``:void 0,children:[l(`div`,{className:e[`input-row`],children:[c(`input`,{ref:y,...v,id:C,type:b.value?`text`:`password`,className:e.input,value:h,defaultValue:g,onChange:e=>{typeof h!=`string`&&(x.value=e.currentTarget.value),_?.(e)}}),c(`button`,{type:`button`,className:e[`reveal-btn`],"aria-label":T,onClick:()=>{b.value=!b.value},children:c(`span`,{className:e[`reveal-icon`],"aria-hidden":`true`})})]}),t&&w&&c(`div`,{className:e[`strength-meter`],role:`meter`,"aria-label":E,"aria-valuenow":w.score,"aria-valuemin":0,"aria-valuemax":4,"data-strength":w.label,children:[0,1,2,3].map(t=>c(`div`,{className:e[`strength-segment`],"data-filled":t<w.score?``:void 0},t))})]})});export{d as PasswordInput};
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
var e
|
|
2
|
-
wrapper: "_wrapper_19052_2",
|
|
3
|
-
"input-row": "_input-row_19052_30",
|
|
4
|
-
input: "_input_19052_30",
|
|
5
|
-
"reveal-btn": "_reveal-btn_19052_72",
|
|
6
|
-
"reveal-icon": "_reveal-icon_19052_98",
|
|
7
|
-
"strength-meter": "_strength-meter_19052_118",
|
|
8
|
-
"strength-segment": "_strength-segment_19052_139"
|
|
9
|
-
};
|
|
10
|
-
//#endregion
|
|
11
|
-
export { e as default };
|
|
1
|
+
var e={wrapper:`_wrapper_19052_2`,"input-row":`_input-row_19052_30`,input:`_input_19052_30`,"reveal-btn":`_reveal-btn_19052_72`,"reveal-icon":`_reveal-icon_19052_98`,"strength-meter":`_strength-meter_19052_118`,"strength-segment":`_strength-segment_19052_139`};export{e as default};
|
|
@@ -1,51 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { usePopover as e } from "./use-popover.js";
|
|
4
|
-
import t from "./popover.module.js";
|
|
5
|
-
import { createContext as n } from "react";
|
|
6
|
-
import { Slot as r, useSignals as i } from "@cascivo/core";
|
|
7
|
-
import { jsx as a } from "react/jsx-runtime";
|
|
8
|
-
//#region ../components/src/popover/popover.tsx
|
|
9
|
-
var o = n(null);
|
|
10
|
-
function s({ children: t, ...n }) {
|
|
11
|
-
let r = e(n);
|
|
12
|
-
return /* @__PURE__ */ a(o.Provider, {
|
|
13
|
-
value: r,
|
|
14
|
-
children: t
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
function c({ children: e, asChild: n = !1 }) {
|
|
18
|
-
i();
|
|
19
|
-
let s = n ? r : "button";
|
|
20
|
-
return /* @__PURE__ */ a(o.Consumer, { children: (r) => {
|
|
21
|
-
if (!r) throw Error("PopoverTrigger must be used inside <Popover>");
|
|
22
|
-
let { triggerRef: i, toggle: o, anchorName: c, isOpen: l } = r;
|
|
23
|
-
return /* @__PURE__ */ a(s, {
|
|
24
|
-
ref: i,
|
|
25
|
-
type: n ? void 0 : "button",
|
|
26
|
-
"aria-expanded": l.value,
|
|
27
|
-
"aria-haspopup": "dialog",
|
|
28
|
-
style: { anchorName: c },
|
|
29
|
-
onClick: o,
|
|
30
|
-
className: t.trigger,
|
|
31
|
-
children: e
|
|
32
|
-
});
|
|
33
|
-
} });
|
|
34
|
-
}
|
|
35
|
-
function l({ children: e, className: n }) {
|
|
36
|
-
return i(), /* @__PURE__ */ a(o.Consumer, { children: (r) => {
|
|
37
|
-
if (!r) throw Error("PopoverContent must be used inside <Popover>");
|
|
38
|
-
let { popoverRef: i, anchorName: o, isOpen: s } = r;
|
|
39
|
-
return /* @__PURE__ */ a("div", {
|
|
40
|
-
ref: i,
|
|
41
|
-
popover: "auto",
|
|
42
|
-
role: "dialog",
|
|
43
|
-
"data-state": s.value ? "open" : "closed",
|
|
44
|
-
style: { positionAnchor: o },
|
|
45
|
-
className: [t.content, n].filter(Boolean).join(" "),
|
|
46
|
-
children: e
|
|
47
|
-
});
|
|
48
|
-
} });
|
|
49
|
-
}
|
|
50
|
-
//#endregion
|
|
51
|
-
export { s as Popover, l as PopoverContent, c as PopoverTrigger };
|
|
1
|
+
"use client";import{usePopover as e}from"./use-popover.js";import t from"./popover.module.js";import{createContext as n}from"react";import{Slot as r,useSignals as i}from"@cascivo/core";import{jsx as a}from"react/jsx-runtime";var o=n(null);function s({children:t,...n}){let r=e(n);return a(o.Provider,{value:r,children:t})}function c({children:e,asChild:n=!1}){i();let s=n?r:`button`;return a(o.Consumer,{children:r=>{if(!r)throw Error(`PopoverTrigger must be used inside <Popover>`);let{triggerRef:i,toggle:o,anchorName:c,isOpen:l}=r;return a(s,{ref:i,type:n?void 0:`button`,"aria-expanded":l.value,"aria-haspopup":`dialog`,style:{anchorName:c},onClick:o,className:t.trigger,children:e})}})}function l({children:e,className:n}){return i(),a(o.Consumer,{children:r=>{if(!r)throw Error(`PopoverContent must be used inside <Popover>`);let{popoverRef:i,anchorName:o,isOpen:s}=r;return a(`div`,{ref:i,popover:`auto`,role:`dialog`,"data-state":s.value?`open`:`closed`,style:{positionAnchor:o},className:[t.content,n].filter(Boolean).join(` `),children:e})}})}export{s as Popover,l as PopoverContent,c as PopoverTrigger};
|
|
@@ -1,55 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useId as t, useSignal as n, useSignalEffect as r } from "@cascivo/core";
|
|
3
|
-
//#region ../components/src/popover/use-popover.ts
|
|
4
|
-
var i = typeof CSS < "u" && typeof CSS.supports == "function" && CSS.supports("anchor-name: --cascivo-a");
|
|
5
|
-
function a(a = {}) {
|
|
6
|
-
let o = `--${t("cascivo-popover")}`, s = e(null), c = e(null), l = n(a.open ?? !1);
|
|
7
|
-
a.open !== void 0 && (l.value = a.open);
|
|
8
|
-
let u = e(a.onOpenChange);
|
|
9
|
-
u.current = a.onOpenChange;
|
|
10
|
-
let d = e(a.placement);
|
|
11
|
-
d.current = a.placement;
|
|
12
|
-
let f = e(a.offset);
|
|
13
|
-
return f.current = a.offset, r(() => {
|
|
14
|
-
let e = l.value;
|
|
15
|
-
u.current?.(e);
|
|
16
|
-
let t = c.current;
|
|
17
|
-
if (t) {
|
|
18
|
-
if (e) try {
|
|
19
|
-
t.showPopover();
|
|
20
|
-
} catch {}
|
|
21
|
-
else try {
|
|
22
|
-
t.hidePopover();
|
|
23
|
-
} catch {}
|
|
24
|
-
if (!i && e) {
|
|
25
|
-
let e = s.current;
|
|
26
|
-
if (!e) return;
|
|
27
|
-
let n = e.getBoundingClientRect(), r = d.current ?? "bottom", i = f.current ?? 4;
|
|
28
|
-
r === "bottom" ? (t.style.top = `${n.bottom + i + window.scrollY}px`, t.style.left = `${n.left + window.scrollX}px`) : r === "top" ? (t.style.top = `${n.top - i + window.scrollY}px`, t.style.left = `${n.left + window.scrollX}px`, t.style.transform = "translateY(-100%)") : r === "left" ? (t.style.top = `${n.top + window.scrollY}px`, t.style.left = `${n.left - i + window.scrollX}px`, t.style.transform = "translateX(-100%)") : r === "right" && (t.style.top = `${n.top + window.scrollY}px`, t.style.left = `${n.right + i + window.scrollX}px`);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}), r(() => {
|
|
32
|
-
let e = c.current;
|
|
33
|
-
if (!e) return;
|
|
34
|
-
let t = (e) => {
|
|
35
|
-
e.newState === "closed" && (l.value = !1);
|
|
36
|
-
};
|
|
37
|
-
return e.addEventListener("toggle", t), () => e.removeEventListener("toggle", t);
|
|
38
|
-
}), {
|
|
39
|
-
triggerRef: s,
|
|
40
|
-
popoverRef: c,
|
|
41
|
-
isOpen: l,
|
|
42
|
-
anchorName: o,
|
|
43
|
-
open: () => {
|
|
44
|
-
l.value = !0;
|
|
45
|
-
},
|
|
46
|
-
close: () => {
|
|
47
|
-
l.value = !1;
|
|
48
|
-
},
|
|
49
|
-
toggle: () => {
|
|
50
|
-
l.value = !l.value;
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
//#endregion
|
|
55
|
-
export { a as usePopover };
|
|
1
|
+
import{useRef as e}from"react";import{useId as t,useSignal as n,useSignalEffect as r}from"@cascivo/core";var i=typeof CSS<`u`&&typeof CSS.supports==`function`&&CSS.supports(`anchor-name: --cascivo-a`);function a(a={}){let o=`--${t(`cascivo-popover`)}`,s=e(null),c=e(null),l=n(a.open??!1);a.open!==void 0&&(l.value=a.open);let u=e(a.onOpenChange);u.current=a.onOpenChange;let d=e(a.placement);d.current=a.placement;let f=e(a.offset);return f.current=a.offset,r(()=>{let e=l.value;u.current?.(e);let t=c.current;if(t){if(e)try{t.showPopover()}catch{}else try{t.hidePopover()}catch{}if(!i&&e){let e=s.current;if(!e)return;let n=e.getBoundingClientRect(),r=d.current??`bottom`,i=f.current??4;r===`bottom`?(t.style.top=`${n.bottom+i+window.scrollY}px`,t.style.left=`${n.left+window.scrollX}px`):r===`top`?(t.style.top=`${n.top-i+window.scrollY}px`,t.style.left=`${n.left+window.scrollX}px`,t.style.transform=`translateY(-100%)`):r===`left`?(t.style.top=`${n.top+window.scrollY}px`,t.style.left=`${n.left-i+window.scrollX}px`,t.style.transform=`translateX(-100%)`):r===`right`&&(t.style.top=`${n.top+window.scrollY}px`,t.style.left=`${n.right+i+window.scrollX}px`)}}}),r(()=>{let e=c.current;if(!e)return;let t=e=>{e.newState===`closed`&&(l.value=!1)};return e.addEventListener(`toggle`,t),()=>e.removeEventListener(`toggle`,t)}),{triggerRef:s,popoverRef:c,isOpen:l,anchorName:o,open:()=>{l.value=!0},close:()=>{l.value=!1},toggle:()=>{l.value=!l.value}}}export{a as usePopover};
|
|
@@ -1,16 +1 @@
|
|
|
1
|
-
import e from
|
|
2
|
-
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
-
//#region ../components/src/progress/progress.tsx
|
|
4
|
-
function n({ value: n, variant: r = "primary", size: i = "md", className: a, ariaLabel: o, ...s }) {
|
|
5
|
-
return /* @__PURE__ */ t("progress", {
|
|
6
|
-
"aria-label": s["aria-label"] ?? o,
|
|
7
|
-
className: [e.progress, a].filter(Boolean).join(" "),
|
|
8
|
-
"data-variant": r,
|
|
9
|
-
"data-size": i,
|
|
10
|
-
value: n,
|
|
11
|
-
max: n === void 0 ? void 0 : 100,
|
|
12
|
-
...s
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
//#endregion
|
|
16
|
-
export { n as Progress };
|
|
1
|
+
import e from"./progress.module.js";import{jsx as t}from"react/jsx-runtime";function n({value:n,variant:r=`primary`,size:i=`md`,className:a,ariaLabel:o,label:s,...c}){return t(`progress`,{"aria-label":c[`aria-label`]??o??s,className:[e.progress,a].filter(Boolean).join(` `),"data-variant":r,"data-size":i,value:n,max:n===void 0?void 0:100,...c})}export{n as Progress};
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
var e
|
|
2
|
-
progress: "_progress_1xlox_2",
|
|
3
|
-
"cascivo-progress-indeterminate": "_cascivo-progress-indeterminate_1xlox_1"
|
|
4
|
-
};
|
|
5
|
-
//#endregion
|
|
6
|
-
export { e as default };
|
|
1
|
+
var e={progress:`_progress_k7xjt_2`,"cascivo-progress-indeterminate":`_cascivo-progress-indeterminate_k7xjt_1`};export{e as default};
|
|
@@ -1,42 +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/progress-bar/progress-bar.tsx
|
|
5
|
-
function i({ value: i, max: a = 100, label: o, helperText: s, size: c = "md", status: l = "active", className: u }) {
|
|
6
|
-
let d = i === void 0, f = d ? 0 : Math.min(Math.max(i, 0), a), p = a > 0 ? f / a * 100 : 0, m = o ? `cascade-progress-${o.toLowerCase().replace(/\s+/g, "-")}` : void 0, h = l === "success" ? "✓" : l === "error" ? "✕" : null;
|
|
7
|
-
return /* @__PURE__ */ r("div", {
|
|
8
|
-
"data-status": l,
|
|
9
|
-
"data-size": c,
|
|
10
|
-
"data-state": d ? "indeterminate" : void 0,
|
|
11
|
-
className: t(e.progress, u),
|
|
12
|
-
children: [
|
|
13
|
-
o && /* @__PURE__ */ r("span", {
|
|
14
|
-
id: m,
|
|
15
|
-
className: e.label,
|
|
16
|
-
children: [o, h && /* @__PURE__ */ n("span", {
|
|
17
|
-
className: e.glyph,
|
|
18
|
-
"aria-hidden": "true",
|
|
19
|
-
children: h
|
|
20
|
-
})]
|
|
21
|
-
}),
|
|
22
|
-
/* @__PURE__ */ n("div", {
|
|
23
|
-
role: "progressbar",
|
|
24
|
-
"aria-valuemin": 0,
|
|
25
|
-
"aria-valuemax": a,
|
|
26
|
-
"aria-valuenow": d ? void 0 : f,
|
|
27
|
-
"aria-labelledby": m,
|
|
28
|
-
className: e.track,
|
|
29
|
-
children: /* @__PURE__ */ n("div", {
|
|
30
|
-
className: e.fill,
|
|
31
|
-
style: d ? void 0 : { "--cascivo-progress-value": `${p}%` }
|
|
32
|
-
})
|
|
33
|
-
}),
|
|
34
|
-
s && /* @__PURE__ */ n("span", {
|
|
35
|
-
className: e.helper,
|
|
36
|
-
children: s
|
|
37
|
-
})
|
|
38
|
-
]
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
//#endregion
|
|
42
|
-
export { i as ProgressBar };
|
|
1
|
+
import e from"./progress-bar.module.js";import{cn as t}from"@cascivo/core/pure";import{jsx as n,jsxs as r}from"react/jsx-runtime";function i({value:i,max:a=100,label:o,helperText:s,size:c=`md`,status:l=`active`,className:u}){let d=i===void 0,f=d?0:Math.min(Math.max(i,0),a),p=a>0?f/a*100:0,m=o?`cascade-progress-${o.toLowerCase().replace(/\s+/g,`-`)}`:void 0,h=l===`success`?`✓`:l===`error`?`✕`:null;return r(`div`,{"data-status":l,"data-size":c,"data-state":d?`indeterminate`:void 0,className:t(e.progress,u),children:[o&&r(`span`,{id:m,className:e.label,children:[o,h&&n(`span`,{className:e.glyph,"aria-hidden":`true`,children:h})]}),n(`div`,{role:`progressbar`,"aria-valuemin":0,"aria-valuemax":a,"aria-valuenow":d?void 0:f,"aria-labelledby":m,className:e.track,children:n(`div`,{className:e.fill,style:d?void 0:{"--cascivo-progress-value":`${p}%`}})}),s&&n(`span`,{className:e.helper,children:s})]})}export{i as ProgressBar};
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
var e
|
|
2
|
-
progress: "_progress_16ha1_2",
|
|
3
|
-
"cascade-progress-sweep": "_cascade-progress-sweep_16ha1_1",
|
|
4
|
-
fill: "_fill_16ha1_9",
|
|
5
|
-
glyph: "_glyph_16ha1_13",
|
|
6
|
-
track: "_track_16ha1_28",
|
|
7
|
-
label: "_label_16ha1_44",
|
|
8
|
-
helper: "_helper_16ha1_77"
|
|
9
|
-
};
|
|
10
|
-
//#endregion
|
|
11
|
-
export { e as default };
|
|
1
|
+
var e={progress:`_progress_18bzs_2`,fill:`_fill_18bzs_9`,glyph:`_glyph_18bzs_13`,track:`_track_18bzs_28`,label:`_label_18bzs_47`,helper:`_helper_18bzs_80`};export{e as default};
|
|
@@ -1,46 +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/progress-circle/progress-circle.tsx
|
|
5
|
-
var i = 20, a = 2 * Math.PI * i;
|
|
6
|
-
function o({ value: o, max: s = 100, size: c = "md", showValue: l = !1, label: u, className: d, ...f }) {
|
|
7
|
-
let p = Math.min(Math.max(o, 0), s), m = s > 0 ? p / s * 100 : 0, h = a * (1 - m / 100);
|
|
8
|
-
return /* @__PURE__ */ r("div", {
|
|
9
|
-
role: "progressbar",
|
|
10
|
-
"aria-valuemin": 0,
|
|
11
|
-
"aria-valuemax": s,
|
|
12
|
-
"aria-valuenow": p,
|
|
13
|
-
"aria-label": u,
|
|
14
|
-
"data-size": c,
|
|
15
|
-
className: t(e.progressCircle, d),
|
|
16
|
-
...f,
|
|
17
|
-
children: [/* @__PURE__ */ r("svg", {
|
|
18
|
-
viewBox: "0 0 48 48",
|
|
19
|
-
"aria-hidden": "true",
|
|
20
|
-
className: e.svg,
|
|
21
|
-
children: [/* @__PURE__ */ n("circle", {
|
|
22
|
-
className: e.track,
|
|
23
|
-
cx: "24",
|
|
24
|
-
cy: "24",
|
|
25
|
-
r: i,
|
|
26
|
-
fill: "none",
|
|
27
|
-
strokeWidth: "4"
|
|
28
|
-
}), /* @__PURE__ */ n("circle", {
|
|
29
|
-
className: e.fill,
|
|
30
|
-
cx: "24",
|
|
31
|
-
cy: "24",
|
|
32
|
-
r: i,
|
|
33
|
-
fill: "none",
|
|
34
|
-
strokeWidth: "4",
|
|
35
|
-
strokeLinecap: "round",
|
|
36
|
-
strokeDasharray: a,
|
|
37
|
-
strokeDashoffset: h
|
|
38
|
-
})]
|
|
39
|
-
}), l && /* @__PURE__ */ r("span", {
|
|
40
|
-
className: e.value,
|
|
41
|
-
children: [Math.round(m), "%"]
|
|
42
|
-
})]
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
//#endregion
|
|
46
|
-
export { o as ProgressCircle };
|
|
1
|
+
import e from"./progress-circle.module.js";import{cn as t}from"@cascivo/core/pure";import{jsx as n,jsxs as r}from"react/jsx-runtime";var i=20,a=2*Math.PI*i;function o({value:o,max:s=100,size:c=`md`,showValue:l=!1,label:u,ariaLabel:d,className:f,...p}){let m=Math.min(Math.max(o,0),s),h=s>0?m/s*100:0,g=a*(1-h/100);return r(`div`,{role:`progressbar`,"aria-valuemin":0,"aria-valuemax":s,"aria-valuenow":m,"aria-label":d??u,"data-size":c,className:t(e.progressCircle,f),...p,children:[r(`svg`,{viewBox:`0 0 48 48`,"aria-hidden":`true`,className:e.svg,children:[n(`circle`,{className:e.track,cx:`24`,cy:`24`,r:i,fill:`none`,strokeWidth:`4`}),n(`circle`,{className:e.fill,cx:`24`,cy:`24`,r:i,fill:`none`,strokeWidth:`4`,strokeLinecap:`round`,strokeDasharray:a,strokeDashoffset:g})]}),l&&r(`span`,{className:e.value,children:[Math.round(h),`%`]})]})}export{o as ProgressCircle};
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
var e
|
|
2
|
-
progressCircle: "_progressCircle_1eok5_2",
|
|
3
|
-
value: "_value_1eok5_22",
|
|
4
|
-
svg: "_svg_1eok5_27",
|
|
5
|
-
track: "_track_1eok5_33",
|
|
6
|
-
fill: "_fill_1eok5_37"
|
|
7
|
-
};
|
|
8
|
-
//#endregion
|
|
9
|
-
export { e as default };
|
|
1
|
+
var e={progressCircle:`_progressCircle_1eok5_2`,value:`_value_1eok5_22`,svg:`_svg_1eok5_27`,track:`_track_1eok5_33`,fill:`_fill_1eok5_37`};export{e as default};
|
|
@@ -1,34 +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/progress-indicator/progress-indicator.tsx
|
|
5
|
-
function i({ steps: i, currentIndex: a, vertical: o = !1, className: s }) {
|
|
6
|
-
return /* @__PURE__ */ n("ol", {
|
|
7
|
-
className: t(e.indicator, s),
|
|
8
|
-
"data-orientation": o ? "vertical" : "horizontal",
|
|
9
|
-
children: i.map((t, i) => {
|
|
10
|
-
let o = i < a ? "complete" : i === a ? "current" : "incomplete";
|
|
11
|
-
return /* @__PURE__ */ r("li", {
|
|
12
|
-
className: e.step,
|
|
13
|
-
"data-status": o,
|
|
14
|
-
"aria-current": o === "current" ? "step" : void 0,
|
|
15
|
-
children: [/* @__PURE__ */ n("span", {
|
|
16
|
-
className: e.marker,
|
|
17
|
-
"aria-hidden": "true",
|
|
18
|
-
children: o === "complete" ? "✓" : i + 1
|
|
19
|
-
}), /* @__PURE__ */ r("span", {
|
|
20
|
-
className: e.text,
|
|
21
|
-
children: [/* @__PURE__ */ n("span", {
|
|
22
|
-
className: e.label,
|
|
23
|
-
children: t.label
|
|
24
|
-
}), t.description && /* @__PURE__ */ n("span", {
|
|
25
|
-
className: e.description,
|
|
26
|
-
children: t.description
|
|
27
|
-
})]
|
|
28
|
-
})]
|
|
29
|
-
}, i);
|
|
30
|
-
})
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
//#endregion
|
|
34
|
-
export { i as ProgressIndicator };
|
|
1
|
+
import e from"./progress-indicator.module.js";import{cn as t}from"@cascivo/core/pure";import{jsx as n,jsxs as r}from"react/jsx-runtime";function i({steps:i,currentIndex:a,vertical:o=!1,className:s}){return n(`ol`,{className:t(e.indicator,s),"data-orientation":o?`vertical`:`horizontal`,children:i.map((t,i)=>{let o=i<a?`complete`:i===a?`current`:`incomplete`;return r(`li`,{className:e.step,"data-status":o,"aria-current":o===`current`?`step`:void 0,children:[n(`span`,{className:e.marker,"aria-hidden":`true`,children:o===`complete`?`✓`:i+1}),r(`span`,{className:e.text,children:[n(`span`,{className:e.label,children:t.label}),t.description&&n(`span`,{className:e.description,children:t.description})]})]},t.id??i)})})}export{i as ProgressIndicator};
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
var e
|
|
2
|
-
indicator: "_indicator_jj7mg_2",
|
|
3
|
-
step: "_step_jj7mg_13",
|
|
4
|
-
marker: "_marker_jj7mg_39",
|
|
5
|
-
text: "_text_jj7mg_71",
|
|
6
|
-
label: "_label_jj7mg_77",
|
|
7
|
-
description: "_description_jj7mg_89"
|
|
8
|
-
};
|
|
9
|
-
//#endregion
|
|
10
|
-
export { e as default };
|
|
1
|
+
var e={indicator:`_indicator_1njw1_2`,step:`_step_1njw1_13`,marker:`_marker_1njw1_39`,text:`_text_1njw1_71`,label:`_label_1njw1_77`,description:`_description_1njw1_89`};export{e as default};
|
package/dist/node/prose/prose.js
CHANGED
|
@@ -1,13 +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/prose/prose.tsx
|
|
5
|
-
function r({ className: r, children: i, ...a }) {
|
|
6
|
-
return /* @__PURE__ */ n("div", {
|
|
7
|
-
className: t(e.prose, r),
|
|
8
|
-
...a,
|
|
9
|
-
children: i
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
//#endregion
|
|
13
|
-
export { r as Prose };
|
|
1
|
+
import e from"./prose.module.js";import{cn as t}from"@cascivo/core/pure";import{jsx as n}from"react/jsx-runtime";function r({className:r,children:i,...a}){return n(`div`,{className:t(e.prose,r),...a,children:i})}export{r as Prose};
|
|
@@ -1,82 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { Spinner as e } from "../spinner/spinner.js";
|
|
4
|
-
import t from "./pull-to-refresh.module.js";
|
|
5
|
-
import { useRef as n } from "react";
|
|
6
|
-
import { cn as r, useSignal as i, useSignalEffect as a, useSignals as o } from "@cascivo/core";
|
|
7
|
-
import { builtin as s, t as c } from "@cascivo/i18n";
|
|
8
|
-
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
9
|
-
//#region ../components/src/pull-to-refresh/pull-to-refresh.tsx
|
|
10
|
-
var d = .5;
|
|
11
|
-
function f({ onRefresh: f, children: p, threshold: m = 64, disabled: h = !1, labels: g, className: _ }) {
|
|
12
|
-
o();
|
|
13
|
-
let v = n(null), y = i(0), b = i(!1), x = i(!1), S = n(f);
|
|
14
|
-
S.current = f;
|
|
15
|
-
let C = n(m);
|
|
16
|
-
C.current = m;
|
|
17
|
-
let w = n(h);
|
|
18
|
-
w.current = h, a(() => {
|
|
19
|
-
let e = v.current;
|
|
20
|
-
if (!e || typeof window > "u") return;
|
|
21
|
-
let t = 0, n = !1, r = (r) => {
|
|
22
|
-
w.current || b.value || e.scrollTop > 0 || (t = r.clientY, n = !0);
|
|
23
|
-
}, i = (r) => {
|
|
24
|
-
if (!n || b.value) return;
|
|
25
|
-
let i = r.clientY - t;
|
|
26
|
-
if (i <= 0 || e.scrollTop > 0) {
|
|
27
|
-
y.value = 0, x.value = !1;
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
r.preventDefault(), x.value = !0, y.value = Math.min(i * d, C.current * 1.5);
|
|
31
|
-
}, a = () => {
|
|
32
|
-
n && (n = !1, x.value = !1, !b.value && (y.value >= C.current ? (b.value = !0, y.value = C.current, Promise.resolve(S.current()).then(() => {
|
|
33
|
-
b.value = !1, y.value = 0;
|
|
34
|
-
}, () => {
|
|
35
|
-
b.value = !1, y.value = 0;
|
|
36
|
-
})) : y.value = 0));
|
|
37
|
-
};
|
|
38
|
-
return e.addEventListener("pointerdown", r), window.addEventListener("pointermove", i, { passive: !1 }), window.addEventListener("pointerup", a), window.addEventListener("pointercancel", a), () => {
|
|
39
|
-
e.removeEventListener("pointerdown", r), window.removeEventListener("pointermove", i), window.removeEventListener("pointerup", a), window.removeEventListener("pointercancel", a);
|
|
40
|
-
};
|
|
41
|
-
});
|
|
42
|
-
let T = b.value ? m : y.value, E = Math.min(T / m, 1), D = E >= 1, O = b.value ? g?.refreshing ?? c(s.pullToRefresh.refreshing) : D ? g?.release ?? c(s.pullToRefresh.release) : T > 0 ? g?.pull ?? c(s.pullToRefresh.pull) : "", k = { "--_pull": `${T}px` };
|
|
43
|
-
return /* @__PURE__ */ u("div", {
|
|
44
|
-
className: r(t.root, _),
|
|
45
|
-
style: k,
|
|
46
|
-
children: [
|
|
47
|
-
/* @__PURE__ */ l("div", {
|
|
48
|
-
className: t.indicator,
|
|
49
|
-
"data-dragging": x.value ? "" : void 0,
|
|
50
|
-
children: b.value ? /* @__PURE__ */ l(e, { size: "sm" }) : /* @__PURE__ */ l("svg", {
|
|
51
|
-
"aria-hidden": "true",
|
|
52
|
-
viewBox: "0 0 16 16",
|
|
53
|
-
className: t.arrow,
|
|
54
|
-
"data-ready": D ? "" : void 0,
|
|
55
|
-
style: { opacity: E },
|
|
56
|
-
children: /* @__PURE__ */ l("path", {
|
|
57
|
-
d: "M8 13V3M4 7l4-4 4 4",
|
|
58
|
-
fill: "none",
|
|
59
|
-
stroke: "currentColor",
|
|
60
|
-
strokeWidth: "1.5",
|
|
61
|
-
strokeLinecap: "round",
|
|
62
|
-
strokeLinejoin: "round"
|
|
63
|
-
})
|
|
64
|
-
})
|
|
65
|
-
}),
|
|
66
|
-
/* @__PURE__ */ l("span", {
|
|
67
|
-
role: "status",
|
|
68
|
-
"aria-live": "polite",
|
|
69
|
-
className: t.srOnly,
|
|
70
|
-
children: O
|
|
71
|
-
}),
|
|
72
|
-
/* @__PURE__ */ l("div", {
|
|
73
|
-
ref: v,
|
|
74
|
-
className: t.viewport,
|
|
75
|
-
"data-dragging": x.value ? "" : void 0,
|
|
76
|
-
children: p
|
|
77
|
-
})
|
|
78
|
-
]
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
//#endregion
|
|
82
|
-
export { f as PullToRefresh };
|
|
1
|
+
"use client";import{Spinner as e}from"../spinner/spinner.js";import t from"./pull-to-refresh.module.js";import{useRef as n}from"react";import{cn as r,useSignal 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";var d=.5;function f({onRefresh:f,children:p,threshold:m=64,disabled:h=!1,labels:g,className:_}){o();let v=n(null),y=i(0),b=i(!1),x=i(!1),S=n(f);S.current=f;let C=n(m);C.current=m;let w=n(h);w.current=h,a(()=>{let e=v.current;if(!e||typeof window>`u`)return;let t=0,n=!1,r=r=>{w.current||b.value||e.scrollTop>0||(t=r.clientY,n=!0)},i=r=>{if(!n||b.value)return;let i=r.clientY-t;if(i<=0||e.scrollTop>0){y.value=0,x.value=!1;return}r.preventDefault(),x.value=!0,y.value=Math.min(i*d,C.current*1.5)},a=()=>{n&&(n=!1,x.value=!1,!b.value&&(y.value>=C.current?(b.value=!0,y.value=C.current,Promise.resolve(S.current()).then(()=>{b.value=!1,y.value=0},()=>{b.value=!1,y.value=0})):y.value=0))};return e.addEventListener(`pointerdown`,r),window.addEventListener(`pointermove`,i,{passive:!1}),window.addEventListener(`pointerup`,a),window.addEventListener(`pointercancel`,a),()=>{e.removeEventListener(`pointerdown`,r),window.removeEventListener(`pointermove`,i),window.removeEventListener(`pointerup`,a),window.removeEventListener(`pointercancel`,a)}});let T=b.value?m:y.value,E=Math.min(T/m,1),D=E>=1,O=b.value?g?.refreshing??c(s.pullToRefresh.refreshing):D?g?.release??c(s.pullToRefresh.release):T>0?g?.pull??c(s.pullToRefresh.pull):``,k={"--_pull":`${T}px`};return u(`div`,{className:r(t.root,_),style:k,children:[l(`div`,{className:t.indicator,"data-dragging":x.value?``:void 0,children:b.value?l(e,{size:`sm`}):l(`svg`,{"aria-hidden":`true`,viewBox:`0 0 16 16`,className:t.arrow,"data-ready":D?``:void 0,style:{opacity:E},children:l(`path`,{d:`M8 13V3M4 7l4-4 4 4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})})}),l(`span`,{role:`status`,"aria-live":`polite`,className:t.srOnly,children:O}),l(`div`,{ref:v,className:t.viewport,"data-dragging":x.value?``:void 0,children:p})]})}export{f as PullToRefresh};
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
var e
|
|
2
|
-
root: "_root_1rhho_2",
|
|
3
|
-
indicator: "_indicator_1rhho_8",
|
|
4
|
-
arrow: "_arrow_1rhho_25",
|
|
5
|
-
viewport: "_viewport_1rhho_35",
|
|
6
|
-
srOnly: "_srOnly_1rhho_47"
|
|
7
|
-
};
|
|
8
|
-
//#endregion
|
|
9
|
-
export { e as default };
|
|
1
|
+
var e={root:`_root_1rhho_2`,indicator:`_indicator_1rhho_8`,arrow:`_arrow_1rhho_25`,viewport:`_viewport_1rhho_35`,srOnly:`_srOnly_1rhho_47`};export{e as default};
|