@cascivo/react 0.14.0 → 0.16.1
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 +8 -3
- package/dist/accordion/accordion.css +1 -1
- package/dist/accordion/accordion.js +81 -65
- package/dist/accordion/accordion.module.js +6 -9
- package/dist/action-sheet/action-sheet.js +11 -11
- package/dist/action-sheet/action-sheet.module.js +0 -2
- package/dist/alert/alert.module.js +0 -2
- package/dist/alert-dialog/alert-dialog.css +1 -1
- package/dist/alert-dialog/alert-dialog.js +6 -6
- package/dist/alert-dialog/alert-dialog.module.js +7 -9
- package/dist/app-shell/app-shell.js +10 -10
- package/dist/app-shell/app-shell.module.js +0 -2
- package/dist/aspect-ratio/aspect-ratio.js +1 -3
- package/dist/aspect-ratio/aspect-ratio.module.js +0 -2
- package/dist/avatar/avatar.module.js +0 -2
- package/dist/avatar-group/avatar-group.js +1 -3
- package/dist/avatar-group/avatar-group.module.js +0 -2
- package/dist/badge/badge.js +2 -4
- package/dist/badge/badge.module.js +0 -2
- package/dist/blockquote/blockquote.js +1 -3
- package/dist/blockquote/blockquote.module.js +0 -2
- package/dist/bottom-sheet/bottom-sheet.js +12 -12
- package/dist/bottom-sheet/bottom-sheet.module.js +0 -2
- package/dist/breadcrumb/breadcrumb.module.js +0 -2
- package/dist/button/button.js +1 -3
- package/dist/button/button.module.js +0 -2
- package/dist/button-group/button-group.js +6 -6
- package/dist/button-group/button-group.module.js +0 -2
- package/dist/calendar/calendar.module.js +0 -2
- package/dist/card/card.js +1 -3
- package/dist/card/card.module.js +0 -2
- package/dist/carousel/carousel.js +9 -9
- package/dist/carousel/carousel.module.js +0 -2
- package/dist/chat-bubble/chat-bubble.js +0 -2
- package/dist/chat-bubble/chat-bubble.module.js +0 -2
- package/dist/checkbox/checkbox.js +10 -10
- package/dist/checkbox/checkbox.module.js +0 -2
- package/dist/checkbox-card/checkbox-card.js +5 -5
- package/dist/checkbox-card/checkbox-card.module.js +0 -2
- package/dist/code/code.js +1 -3
- package/dist/code/code.module.js +0 -2
- package/dist/code-snippet/code-snippet.module.js +0 -2
- package/dist/code-snippet/highlight.js +0 -2
- package/dist/collapsible/collapsible.css +1 -1
- package/dist/collapsible/collapsible.js +36 -31
- package/dist/collapsible/collapsible.module.js +3 -6
- package/dist/color-picker/color-picker.js +7 -7
- package/dist/color-picker/color-picker.module.js +0 -2
- package/dist/combobox/combobox.css +1 -1
- package/dist/combobox/combobox.js +11 -11
- package/dist/combobox/combobox.module.js +15 -17
- package/dist/command-menu/command-menu.js +113 -113
- package/dist/command-menu/command-menu.module.js +0 -2
- package/dist/comparison/comparison.js +5 -5
- package/dist/comparison/comparison.module.js +0 -2
- package/dist/contained-list/contained-list.module.js +0 -2
- package/dist/context-menu/context-menu.js +42 -38
- package/dist/context-menu/context-menu.module.js +0 -2
- package/dist/copy-button/copy-button.js +7 -7
- package/dist/copy-button/copy-button.module.js +0 -2
- package/dist/data-list/data-list.js +1 -3
- package/dist/data-list/data-list.module.js +0 -2
- package/dist/data-table/data-table.css +1 -1
- package/dist/data-table/data-table.js +164 -164
- package/dist/data-table/data-table.module.js +29 -31
- package/dist/date-picker/date-picker.css +1 -1
- package/dist/date-picker/date-picker.js +24 -24
- package/dist/date-picker/date-picker.module.js +19 -21
- package/dist/date-range-picker/date-range-picker.js +30 -30
- package/dist/date-range-picker/date-range-picker.module.js +0 -2
- package/dist/dock/dock.module.js +0 -2
- package/dist/drawer/drawer.js +11 -11
- package/dist/drawer/drawer.module.js +0 -2
- package/dist/dropdown/dropdown.js +14 -14
- package/dist/dropdown/dropdown.module.js +0 -2
- package/dist/editable/editable.css +1 -1
- package/dist/editable/editable.js +8 -8
- package/dist/editable/editable.module.js +7 -9
- package/dist/empty-state/empty-state.js +1 -3
- package/dist/empty-state/empty-state.module.js +0 -2
- package/dist/fab/fab.js +12 -12
- package/dist/fab/fab.module.js +0 -2
- package/dist/field/field.js +1 -3
- package/dist/field/field.module.js +0 -2
- package/dist/file-uploader/file-uploader.css +1 -1
- package/dist/file-uploader/file-uploader.js +5 -5
- package/dist/file-uploader/file-uploader.module.js +14 -16
- package/dist/filter/filter.module.js +0 -2
- package/dist/form/form.module.js +0 -2
- package/dist/header/header.module.js +0 -2
- package/dist/header-panel/header-panel.js +8 -8
- package/dist/header-panel/header-panel.module.js +0 -2
- package/dist/heading/heading.js +1 -3
- package/dist/heading/heading.module.js +0 -2
- package/dist/hover-card/hover-card.js +18 -18
- package/dist/hover-card/hover-card.module.js +0 -2
- package/dist/icon-button/icon-button.js +1 -3
- package/dist/icon-button/icon-button.module.js +0 -2
- package/dist/image/image.module.js +0 -2
- package/dist/index.d.ts +353 -163
- package/dist/index.js +0 -1
- package/dist/indicator/indicator.js +0 -2
- package/dist/indicator/indicator.module.js +0 -2
- package/dist/infinite-scroll/infinite-scroll.css +1 -0
- package/dist/infinite-scroll/infinite-scroll.js +49 -0
- package/dist/infinite-scroll/infinite-scroll.module.js +8 -0
- package/dist/inline-loading/inline-loading.js +1 -3
- package/dist/inline-loading/inline-loading.module.js +0 -2
- package/dist/input/input.js +11 -11
- package/dist/input/input.module.js +0 -2
- package/dist/input-group/input-group.js +1 -3
- package/dist/input-group/input-group.module.js +0 -2
- package/dist/item/item.js +1 -3
- package/dist/item/item.module.js +0 -2
- package/dist/join/join.js +0 -2
- package/dist/join/join.module.js +0 -2
- package/dist/kbd/kbd.js +1 -3
- package/dist/kbd/kbd.module.js +0 -2
- package/dist/label/label.js +1 -3
- package/dist/label/label.module.js +0 -2
- package/dist/large-title-header/large-title-header.css +1 -0
- package/dist/large-title-header/large-title-header.js +38 -0
- package/dist/large-title-header/large-title-header.module.js +13 -0
- package/dist/layouts/src/auto-grid/auto-grid.js +1 -3
- package/dist/layouts/src/auto-grid/auto-grid.module.js +0 -2
- package/dist/layouts/src/center/center.js +1 -3
- package/dist/layouts/src/center/center.module.js +0 -2
- package/dist/layouts/src/columns/columns.js +1 -3
- package/dist/layouts/src/columns/columns.module.js +0 -2
- package/dist/layouts/src/flex/flex.js +1 -3
- package/dist/layouts/src/flex/flex.module.js +0 -2
- package/dist/layouts/src/grid/grid.js +1 -3
- package/dist/layouts/src/grid/grid.module.js +0 -2
- package/dist/layouts/src/page-header/page-header.css +1 -1
- package/dist/layouts/src/page-header/page-header.js +1 -3
- package/dist/layouts/src/page-header/page-header.module.js +6 -8
- package/dist/layouts/src/spacer/spacer.js +1 -3
- package/dist/layouts/src/spacer/spacer.module.js +0 -2
- package/dist/link/link.css +1 -1
- package/dist/link/link.js +1 -3
- package/dist/link/link.module.js +1 -3
- package/dist/list/list.js +1 -3
- package/dist/list/list.module.js +0 -2
- package/dist/log-viewer/log-viewer.js +15 -15
- package/dist/log-viewer/log-viewer.module.js +0 -2
- package/dist/menu/menu.js +52 -47
- package/dist/menu/menu.module.js +0 -2
- package/dist/menu-button/menu-button.js +8 -8
- package/dist/menu-button/menu-button.module.js +0 -2
- package/dist/menubar/menubar.js +24 -24
- package/dist/menubar/menubar.module.js +0 -2
- package/dist/modal/modal.js +9 -9
- package/dist/modal/modal.module.js +0 -2
- package/dist/multi-select/multi-select.css +1 -1
- package/dist/multi-select/multi-select.js +8 -8
- package/dist/multi-select/multi-select.module.js +11 -13
- package/dist/native-select/native-select.js +1 -3
- package/dist/native-select/native-select.module.js +0 -2
- package/dist/navigation-menu/navigation-menu.js +26 -26
- package/dist/navigation-menu/navigation-menu.module.js +0 -2
- package/dist/node/accordion/accordion.js +81 -65
- package/dist/node/accordion/accordion.module.js +6 -9
- package/dist/node/action-sheet/action-sheet.js +11 -11
- package/dist/node/action-sheet/action-sheet.module.js +0 -2
- package/dist/node/alert/alert.module.js +0 -2
- package/dist/node/alert-dialog/alert-dialog.js +6 -6
- package/dist/node/alert-dialog/alert-dialog.module.js +7 -9
- package/dist/node/app-shell/app-shell.js +10 -10
- package/dist/node/app-shell/app-shell.module.js +0 -2
- package/dist/node/aspect-ratio/aspect-ratio.js +1 -3
- package/dist/node/aspect-ratio/aspect-ratio.module.js +0 -2
- package/dist/node/avatar/avatar.module.js +0 -2
- package/dist/node/avatar-group/avatar-group.js +1 -3
- package/dist/node/avatar-group/avatar-group.module.js +0 -2
- package/dist/node/badge/badge.js +2 -4
- package/dist/node/badge/badge.module.js +0 -2
- package/dist/node/blockquote/blockquote.js +1 -3
- package/dist/node/blockquote/blockquote.module.js +0 -2
- package/dist/node/bottom-sheet/bottom-sheet.js +12 -12
- package/dist/node/bottom-sheet/bottom-sheet.module.js +0 -2
- package/dist/node/breadcrumb/breadcrumb.module.js +0 -2
- package/dist/node/button/button.js +1 -3
- package/dist/node/button/button.module.js +0 -2
- package/dist/node/button-group/button-group.js +6 -6
- package/dist/node/button-group/button-group.module.js +0 -2
- package/dist/node/calendar/calendar.module.js +0 -2
- package/dist/node/card/card.js +1 -3
- package/dist/node/card/card.module.js +0 -2
- package/dist/node/carousel/carousel.js +9 -9
- package/dist/node/carousel/carousel.module.js +0 -2
- package/dist/node/chat-bubble/chat-bubble.js +0 -2
- package/dist/node/chat-bubble/chat-bubble.module.js +0 -2
- package/dist/node/checkbox/checkbox.js +10 -10
- package/dist/node/checkbox/checkbox.module.js +0 -2
- package/dist/node/checkbox-card/checkbox-card.js +5 -5
- package/dist/node/checkbox-card/checkbox-card.module.js +0 -2
- package/dist/node/code/code.js +1 -3
- package/dist/node/code/code.module.js +0 -2
- package/dist/node/code-snippet/code-snippet.module.js +0 -2
- package/dist/node/code-snippet/highlight.js +0 -2
- package/dist/node/collapsible/collapsible.js +36 -31
- package/dist/node/collapsible/collapsible.module.js +3 -6
- package/dist/node/color-picker/color-picker.js +7 -7
- package/dist/node/color-picker/color-picker.module.js +0 -2
- package/dist/node/combobox/combobox.js +11 -11
- package/dist/node/combobox/combobox.module.js +15 -17
- package/dist/node/command-menu/command-menu.js +113 -113
- package/dist/node/command-menu/command-menu.module.js +0 -2
- package/dist/node/comparison/comparison.js +5 -5
- package/dist/node/comparison/comparison.module.js +0 -2
- package/dist/node/contained-list/contained-list.module.js +0 -2
- package/dist/node/context-menu/context-menu.js +42 -38
- package/dist/node/context-menu/context-menu.module.js +0 -2
- package/dist/node/copy-button/copy-button.js +7 -7
- package/dist/node/copy-button/copy-button.module.js +0 -2
- package/dist/node/data-list/data-list.js +1 -3
- package/dist/node/data-list/data-list.module.js +0 -2
- package/dist/node/data-table/data-table.js +164 -164
- package/dist/node/data-table/data-table.module.js +29 -31
- package/dist/node/date-picker/date-picker.js +24 -24
- package/dist/node/date-picker/date-picker.module.js +19 -21
- package/dist/node/date-range-picker/date-range-picker.js +30 -30
- package/dist/node/date-range-picker/date-range-picker.module.js +0 -2
- package/dist/node/dock/dock.module.js +0 -2
- package/dist/node/drawer/drawer.js +11 -11
- package/dist/node/drawer/drawer.module.js +0 -2
- package/dist/node/dropdown/dropdown.js +14 -14
- package/dist/node/dropdown/dropdown.module.js +0 -2
- package/dist/node/editable/editable.js +8 -8
- package/dist/node/editable/editable.module.js +7 -9
- package/dist/node/empty-state/empty-state.js +1 -3
- package/dist/node/empty-state/empty-state.module.js +0 -2
- package/dist/node/fab/fab.js +12 -12
- package/dist/node/fab/fab.module.js +0 -2
- package/dist/node/field/field.js +1 -3
- package/dist/node/field/field.module.js +0 -2
- package/dist/node/file-uploader/file-uploader.js +5 -5
- package/dist/node/file-uploader/file-uploader.module.js +14 -16
- package/dist/node/filter/filter.module.js +0 -2
- package/dist/node/form/form.module.js +0 -2
- package/dist/node/header/header.module.js +0 -2
- package/dist/node/header-panel/header-panel.js +8 -8
- package/dist/node/header-panel/header-panel.module.js +0 -2
- package/dist/node/heading/heading.js +1 -3
- package/dist/node/heading/heading.module.js +0 -2
- package/dist/node/hover-card/hover-card.js +18 -18
- package/dist/node/hover-card/hover-card.module.js +0 -2
- package/dist/node/icon-button/icon-button.js +1 -3
- package/dist/node/icon-button/icon-button.module.js +0 -2
- package/dist/node/image/image.module.js +0 -2
- package/dist/node/index.js +0 -1
- package/dist/node/indicator/indicator.js +0 -2
- package/dist/node/indicator/indicator.module.js +0 -2
- package/dist/node/infinite-scroll/infinite-scroll.js +49 -0
- package/dist/node/infinite-scroll/infinite-scroll.module.js +7 -0
- package/dist/node/inline-loading/inline-loading.js +1 -3
- package/dist/node/inline-loading/inline-loading.module.js +0 -2
- package/dist/node/input/input.js +11 -11
- package/dist/node/input/input.module.js +0 -2
- package/dist/node/input-group/input-group.js +1 -3
- package/dist/node/input-group/input-group.module.js +0 -2
- package/dist/node/item/item.js +1 -3
- package/dist/node/item/item.module.js +0 -2
- package/dist/node/join/join.js +0 -2
- package/dist/node/join/join.module.js +0 -2
- package/dist/node/kbd/kbd.js +1 -3
- package/dist/node/kbd/kbd.module.js +0 -2
- package/dist/node/label/label.js +1 -3
- package/dist/node/label/label.module.js +0 -2
- package/dist/node/large-title-header/large-title-header.js +38 -0
- package/dist/node/large-title-header/large-title-header.module.js +12 -0
- package/dist/node/layouts/src/auto-grid/auto-grid.js +1 -3
- package/dist/node/layouts/src/auto-grid/auto-grid.module.js +0 -2
- package/dist/node/layouts/src/center/center.js +1 -3
- package/dist/node/layouts/src/center/center.module.js +0 -2
- package/dist/node/layouts/src/columns/columns.js +1 -3
- package/dist/node/layouts/src/columns/columns.module.js +0 -2
- package/dist/node/layouts/src/flex/flex.js +1 -3
- package/dist/node/layouts/src/flex/flex.module.js +0 -2
- package/dist/node/layouts/src/grid/grid.js +1 -3
- package/dist/node/layouts/src/grid/grid.module.js +0 -2
- package/dist/node/layouts/src/page-header/page-header.js +1 -3
- package/dist/node/layouts/src/page-header/page-header.module.js +6 -8
- package/dist/node/layouts/src/spacer/spacer.js +1 -3
- package/dist/node/layouts/src/spacer/spacer.module.js +0 -2
- package/dist/node/link/link.js +1 -3
- package/dist/node/link/link.module.js +1 -3
- package/dist/node/list/list.js +1 -3
- package/dist/node/list/list.module.js +0 -2
- package/dist/node/log-viewer/log-viewer.js +15 -15
- package/dist/node/log-viewer/log-viewer.module.js +0 -2
- package/dist/node/menu/menu.js +52 -47
- package/dist/node/menu/menu.module.js +0 -2
- package/dist/node/menu-button/menu-button.js +8 -8
- package/dist/node/menu-button/menu-button.module.js +0 -2
- package/dist/node/menubar/menubar.js +24 -24
- package/dist/node/menubar/menubar.module.js +0 -2
- package/dist/node/modal/modal.js +9 -9
- package/dist/node/modal/modal.module.js +0 -2
- package/dist/node/multi-select/multi-select.js +8 -8
- package/dist/node/multi-select/multi-select.module.js +11 -13
- package/dist/node/native-select/native-select.js +1 -3
- package/dist/node/native-select/native-select.module.js +0 -2
- package/dist/node/navigation-menu/navigation-menu.js +26 -26
- package/dist/node/navigation-menu/navigation-menu.module.js +0 -2
- package/dist/node/notification/notification.js +6 -6
- package/dist/node/notification/notification.module.js +0 -2
- package/dist/node/number-input/number-input.js +7 -7
- package/dist/node/number-input/number-input.module.js +0 -2
- package/dist/node/otp-input/otp-input.js +5 -5
- package/dist/node/otp-input/otp-input.module.js +0 -2
- package/dist/node/overflow-menu/overflow-menu.module.js +0 -2
- package/dist/node/pagination/pagination.module.js +0 -2
- package/dist/node/password-input/password-input.js +8 -8
- package/dist/node/password-input/password-input.module.js +0 -2
- package/dist/node/popover/popover.js +12 -12
- package/dist/node/popover/popover.module.js +0 -2
- package/dist/node/popover/use-popover.js +8 -10
- package/dist/node/progress/progress.js +0 -2
- package/dist/node/progress/progress.module.js +0 -2
- package/dist/node/progress-bar/progress-bar.js +1 -3
- package/dist/node/progress-bar/progress-bar.module.js +0 -2
- package/dist/node/progress-circle/progress-circle.js +1 -3
- package/dist/node/progress-circle/progress-circle.module.js +0 -2
- package/dist/node/progress-indicator/progress-indicator.js +1 -3
- package/dist/node/progress-indicator/progress-indicator.module.js +0 -2
- package/dist/node/prose/prose.js +1 -3
- package/dist/node/prose/prose.module.js +0 -2
- package/dist/node/pull-to-refresh/pull-to-refresh.js +8 -8
- package/dist/node/pull-to-refresh/pull-to-refresh.module.js +0 -2
- package/dist/node/qr-code/encode.js +0 -2
- package/dist/node/qr-code/qr-code.module.js +0 -2
- package/dist/node/radial-progress/radial-progress.js +9 -10
- package/dist/node/radial-progress/radial-progress.module.js +0 -2
- package/dist/node/radio/radio.js +1 -3
- package/dist/node/radio/radio.module.js +0 -2
- package/dist/node/radio-card/radio-card.js +8 -8
- package/dist/node/radio-card/radio-card.module.js +0 -2
- package/dist/node/rating-group/rating-group.module.js +0 -2
- package/dist/node/react/src/index.js +27 -25
- package/dist/node/relative-time/relative-time.module.js +0 -2
- package/dist/node/reorder-list/reorder-list.js +143 -0
- package/dist/node/reorder-list/reorder-list.module.js +11 -0
- package/dist/node/resizable/resizable.js +7 -7
- package/dist/node/resizable/resizable.module.js +0 -2
- package/dist/node/scroll-area/scroll-area.js +6 -6
- package/dist/node/scroll-area/scroll-area.module.js +0 -2
- package/dist/node/search/search.js +9 -9
- package/dist/node/search/search.module.js +0 -2
- package/dist/node/segmented-control/segmented-control.module.js +0 -2
- package/dist/node/select/select.js +11 -11
- package/dist/node/select/select.module.js +0 -2
- package/dist/node/separator/separator.js +1 -3
- package/dist/node/separator/separator.module.js +0 -2
- package/dist/node/sheet/sheet.js +4 -4
- package/dist/node/sheet/sheet.module.js +0 -2
- package/dist/node/shell-header/shell-header.module.js +0 -2
- package/dist/node/side-nav/side-nav.js +37 -37
- package/dist/node/side-nav/side-nav.module.js +0 -2
- package/dist/node/skeleton/skeleton.js +1 -3
- package/dist/node/skeleton/skeleton.module.js +0 -2
- package/dist/node/skip-nav/skip-nav.js +7 -6
- package/dist/node/skip-nav/skip-nav.module.js +0 -2
- package/dist/node/slider/slider.js +1 -3
- package/dist/node/slider/slider.module.js +0 -2
- package/dist/node/spinner/spinner.module.js +0 -2
- package/dist/node/stack/stack.js +0 -2
- package/dist/node/stack/stack.module.js +0 -2
- package/dist/node/stat/stat.js +22 -23
- package/dist/node/stat/stat.module.js +7 -9
- package/dist/node/status/status.js +1 -3
- package/dist/node/status/status.module.js +0 -2
- package/dist/node/steps/steps.module.js +0 -2
- package/dist/node/structured-list/structured-list.js +10 -10
- package/dist/node/structured-list/structured-list.module.js +0 -2
- package/dist/node/swap/swap.js +10 -11
- package/dist/node/swap/swap.module.js +0 -2
- package/dist/node/swipe-item/swipe-item.module.js +0 -2
- package/dist/node/switcher/switcher.module.js +0 -2
- package/dist/node/tabs/tabs.js +51 -51
- package/dist/node/tabs/tabs.module.js +0 -2
- package/dist/node/tag/tag.module.js +2 -4
- package/dist/node/tags-input/tags-input.js +6 -6
- package/dist/node/tags-input/tags-input.module.js +4 -6
- package/dist/node/text/text.js +1 -3
- package/dist/node/text/text.module.js +0 -2
- package/dist/node/textarea/textarea.js +11 -11
- package/dist/node/textarea/textarea.module.js +0 -2
- package/dist/node/tile/tile.module.js +0 -2
- package/dist/node/time-picker/time-picker.js +9 -9
- package/dist/node/time-picker/time-picker.module.js +5 -7
- package/dist/node/timeline/timeline.js +32 -31
- package/dist/node/timeline/timeline.module.js +7 -9
- package/dist/node/toast/toast.js +15 -15
- package/dist/node/toast/toast.module.js +0 -2
- package/dist/node/toc/toc.js +7 -7
- package/dist/node/toc/toc.module.js +0 -2
- package/dist/node/toggle/toggle.js +7 -7
- package/dist/node/toggle/toggle.module.js +0 -2
- package/dist/node/toggle-group/toggle-group.js +25 -25
- package/dist/node/toggle-group/toggle-group.module.js +0 -2
- package/dist/node/toggletip/toggletip.js +7 -7
- package/dist/node/toggletip/toggletip.module.js +0 -2
- package/dist/node/tooltip/tooltip.js +9 -9
- package/dist/node/tooltip/tooltip.module.js +0 -2
- package/dist/node/tree-view/tree-view.js +47 -47
- package/dist/node/tree-view/tree-view.module.js +0 -2
- package/dist/node/user/user.js +1 -3
- package/dist/node/user/user.module.js +0 -2
- package/dist/node/virtual-list/virtual-list.js +40 -0
- package/dist/node/virtual-list/virtual-list.module.js +7 -0
- package/dist/node/visually-hidden/visually-hidden.js +1 -3
- package/dist/node/wheel-picker/wheel-picker.js +84 -0
- package/dist/node/wheel-picker/wheel-picker.module.js +8 -0
- package/dist/notification/notification.js +6 -6
- package/dist/notification/notification.module.js +0 -2
- package/dist/number-input/number-input.js +7 -7
- package/dist/number-input/number-input.module.js +0 -2
- package/dist/otp-input/otp-input.js +5 -5
- package/dist/otp-input/otp-input.module.js +0 -2
- package/dist/overflow-menu/overflow-menu.module.js +0 -2
- package/dist/pagination/pagination.module.js +0 -2
- package/dist/password-input/password-input.js +8 -8
- package/dist/password-input/password-input.module.js +0 -2
- package/dist/popover/popover.js +12 -12
- package/dist/popover/popover.module.js +0 -2
- package/dist/popover/use-popover.js +8 -10
- package/dist/progress/progress.js +0 -2
- package/dist/progress/progress.module.js +0 -2
- package/dist/progress-bar/progress-bar.js +1 -3
- package/dist/progress-bar/progress-bar.module.js +0 -2
- package/dist/progress-circle/progress-circle.js +1 -3
- package/dist/progress-circle/progress-circle.module.js +0 -2
- package/dist/progress-indicator/progress-indicator.js +1 -3
- package/dist/progress-indicator/progress-indicator.module.js +0 -2
- package/dist/prose/prose.js +1 -3
- package/dist/prose/prose.module.js +0 -2
- package/dist/pull-to-refresh/pull-to-refresh.js +8 -8
- package/dist/pull-to-refresh/pull-to-refresh.module.js +0 -2
- package/dist/qr-code/encode.js +0 -2
- package/dist/qr-code/qr-code.module.js +0 -2
- package/dist/radial-progress/radial-progress.js +9 -10
- package/dist/radial-progress/radial-progress.module.js +0 -2
- package/dist/radio/radio.js +1 -3
- package/dist/radio/radio.module.js +0 -2
- package/dist/radio-card/radio-card.js +8 -8
- package/dist/radio-card/radio-card.module.js +0 -2
- package/dist/rating-group/rating-group.module.js +0 -2
- package/dist/react/src/index.js +27 -25
- package/dist/relative-time/relative-time.module.js +0 -2
- package/dist/reorder-list/reorder-list.css +1 -0
- package/dist/reorder-list/reorder-list.js +143 -0
- package/dist/reorder-list/reorder-list.module.js +12 -0
- package/dist/resizable/resizable.js +7 -7
- package/dist/resizable/resizable.module.js +0 -2
- package/dist/scroll-area/scroll-area.js +6 -6
- package/dist/scroll-area/scroll-area.module.js +0 -2
- package/dist/search/search.js +9 -9
- package/dist/search/search.module.js +0 -2
- package/dist/segmented-control/segmented-control.module.js +0 -2
- package/dist/select/select.js +11 -11
- package/dist/select/select.module.js +0 -2
- package/dist/separator/separator.js +1 -3
- package/dist/separator/separator.module.js +0 -2
- package/dist/sheet/sheet.js +4 -4
- package/dist/sheet/sheet.module.js +0 -2
- package/dist/shell-header/shell-header.module.js +0 -2
- package/dist/side-nav/side-nav.js +37 -37
- package/dist/side-nav/side-nav.module.js +0 -2
- package/dist/skeleton/skeleton.js +1 -3
- package/dist/skeleton/skeleton.module.js +0 -2
- package/dist/skip-nav/skip-nav.js +7 -6
- package/dist/skip-nav/skip-nav.module.js +0 -2
- package/dist/slider/slider.js +1 -3
- package/dist/slider/slider.module.js +0 -2
- package/dist/spinner/spinner.module.js +0 -2
- package/dist/stack/stack.js +0 -2
- package/dist/stack/stack.module.js +0 -2
- package/dist/stat/stat.css +1 -1
- package/dist/stat/stat.js +22 -23
- package/dist/stat/stat.module.js +7 -9
- package/dist/status/status.js +1 -3
- package/dist/status/status.module.js +0 -2
- package/dist/steps/steps.module.js +0 -2
- package/dist/structured-list/structured-list.js +10 -10
- package/dist/structured-list/structured-list.module.js +0 -2
- package/dist/styles.css +55 -18
- package/dist/swap/swap.js +10 -11
- package/dist/swap/swap.module.js +0 -2
- package/dist/swipe-item/swipe-item.module.js +0 -2
- package/dist/switcher/switcher.module.js +0 -2
- package/dist/tabs/tabs.js +51 -51
- package/dist/tabs/tabs.module.js +0 -2
- package/dist/tag/tag.css +1 -1
- package/dist/tag/tag.module.js +2 -4
- package/dist/tags-input/tags-input.css +1 -1
- package/dist/tags-input/tags-input.js +6 -6
- package/dist/tags-input/tags-input.module.js +4 -6
- package/dist/text/text.js +1 -3
- package/dist/text/text.module.js +0 -2
- package/dist/textarea/textarea.js +11 -11
- package/dist/textarea/textarea.module.js +0 -2
- package/dist/tile/tile.module.js +0 -2
- package/dist/time-picker/time-picker.css +1 -1
- package/dist/time-picker/time-picker.js +9 -9
- package/dist/time-picker/time-picker.module.js +5 -7
- package/dist/timeline/timeline.css +1 -1
- package/dist/timeline/timeline.js +32 -31
- package/dist/timeline/timeline.module.js +7 -9
- package/dist/toast/toast.js +15 -15
- package/dist/toast/toast.module.js +0 -2
- package/dist/toc/toc.js +7 -7
- package/dist/toc/toc.module.js +0 -2
- package/dist/toggle/toggle.js +7 -7
- package/dist/toggle/toggle.module.js +0 -2
- package/dist/toggle-group/toggle-group.js +25 -25
- package/dist/toggle-group/toggle-group.module.js +0 -2
- package/dist/toggletip/toggletip.js +7 -7
- package/dist/toggletip/toggletip.module.js +0 -2
- package/dist/tooltip/tooltip.js +9 -9
- package/dist/tooltip/tooltip.module.js +0 -2
- package/dist/tree-view/tree-view.js +47 -47
- package/dist/tree-view/tree-view.module.js +0 -2
- package/dist/user/user.js +1 -3
- package/dist/user/user.module.js +0 -2
- package/dist/virtual-list/virtual-list.css +1 -0
- package/dist/virtual-list/virtual-list.js +40 -0
- package/dist/virtual-list/virtual-list.module.js +8 -0
- package/dist/visually-hidden/visually-hidden.js +1 -3
- package/dist/wheel-picker/wheel-picker.css +1 -0
- package/dist/wheel-picker/wheel-picker.js +84 -0
- package/dist/wheel-picker/wheel-picker.module.js +9 -0
- package/package.json +4 -4
- package/readme.body.md +8 -3
- package/dist/node/react/src/theme.js +0 -78
- package/dist/node/storage/src/drivers.js +0 -36
- package/dist/node/storage/src/persisted-signal.js +0 -43
- package/dist/react/src/theme.js +0 -78
- package/dist/storage/src/drivers.js +0 -36
- package/dist/storage/src/persisted-signal.js +0 -43
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import e from "./wheel-picker.module.js";
|
|
4
|
+
import { useRef as t } from "react";
|
|
5
|
+
import { cn as n, useEffectPropSignal as r, useId as i, useSignalEffect as a } from "@cascivo/core";
|
|
6
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
|
+
//#region ../components/src/wheel-picker/wheel-picker.tsx
|
|
8
|
+
var c = 120;
|
|
9
|
+
function l({ options: l, value: u, onValueChange: d, visibleCount: f = 5, itemHeight: p = 36, ariaLabel: m, className: h }) {
|
|
10
|
+
let g = t(null), _ = i(), v = Math.max(0, l.findIndex((e) => e.value === u)), y = t(l);
|
|
11
|
+
y.current = l;
|
|
12
|
+
let b = t(d);
|
|
13
|
+
b.current = d;
|
|
14
|
+
let x = t(p);
|
|
15
|
+
x.current = p;
|
|
16
|
+
let S = t(u);
|
|
17
|
+
S.current = u;
|
|
18
|
+
let C = (e, t) => {
|
|
19
|
+
let n = g.current;
|
|
20
|
+
n && n.scrollTo({
|
|
21
|
+
top: e * x.current,
|
|
22
|
+
behavior: t ? "smooth" : "instant"
|
|
23
|
+
});
|
|
24
|
+
}, w = r(u);
|
|
25
|
+
a(() => {
|
|
26
|
+
let e = w.value, t = y.current.findIndex((t) => t.value === e);
|
|
27
|
+
t >= 0 && C(t, !1);
|
|
28
|
+
}), a(() => {
|
|
29
|
+
let e = g.current;
|
|
30
|
+
if (!e) return;
|
|
31
|
+
let t, n = () => {
|
|
32
|
+
clearTimeout(t), t = setTimeout(() => {
|
|
33
|
+
let t = Math.round(e.scrollTop / x.current), n = y.current[t];
|
|
34
|
+
n && n.value !== S.current && b.current(n.value);
|
|
35
|
+
}, c);
|
|
36
|
+
};
|
|
37
|
+
return e.addEventListener("scroll", n, { passive: !0 }), () => {
|
|
38
|
+
clearTimeout(t), e.removeEventListener("scroll", n);
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
let T = (e) => {
|
|
42
|
+
let t = Math.max(0, Math.min(l.length - 1, e)), n = l[t];
|
|
43
|
+
!n || n.value === u || (d(n.value), C(t, !0));
|
|
44
|
+
}, E = (e) => {
|
|
45
|
+
let t = {
|
|
46
|
+
ArrowDown: v + 1,
|
|
47
|
+
ArrowUp: v - 1,
|
|
48
|
+
Home: 0,
|
|
49
|
+
End: l.length - 1,
|
|
50
|
+
PageDown: v + f,
|
|
51
|
+
PageUp: v - f
|
|
52
|
+
}[e.key];
|
|
53
|
+
t !== void 0 && (e.preventDefault(), T(t));
|
|
54
|
+
}, D = (f - 1) / 2 * p, O = {
|
|
55
|
+
"--_item-height": `${p}px`,
|
|
56
|
+
"--_pad": `${D}px`,
|
|
57
|
+
"--_column-height": `${f * p}px`
|
|
58
|
+
};
|
|
59
|
+
return /* @__PURE__ */ s("div", {
|
|
60
|
+
className: n(e.root, h),
|
|
61
|
+
style: O,
|
|
62
|
+
children: [/* @__PURE__ */ o("div", {
|
|
63
|
+
ref: g,
|
|
64
|
+
role: "listbox",
|
|
65
|
+
tabIndex: 0,
|
|
66
|
+
"aria-label": m,
|
|
67
|
+
"aria-activedescendant": `${_}-${v}`,
|
|
68
|
+
className: e.column,
|
|
69
|
+
onKeyDown: E,
|
|
70
|
+
children: l.map((t, n) => /* @__PURE__ */ o("div", {
|
|
71
|
+
id: `${_}-${n}`,
|
|
72
|
+
role: "option",
|
|
73
|
+
"aria-selected": n === v,
|
|
74
|
+
className: e.option,
|
|
75
|
+
children: t.label
|
|
76
|
+
}, t.value))
|
|
77
|
+
}), /* @__PURE__ */ o("div", {
|
|
78
|
+
"aria-hidden": "true",
|
|
79
|
+
className: e.band
|
|
80
|
+
})]
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
//#endregion
|
|
84
|
+
export { l as WheelPicker };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cascivo/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Prebuilt cascivo design system components — use without copying source. @cascivo/themes installs with it; pair with @cascivo/charts (data-viz) and @cascivo/icons. Docs offline: npx @cascivo/docs",
|
|
6
6
|
"keywords": [
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"provenance": true
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@cascivo/core": "^0.
|
|
49
|
-
"@cascivo/i18n": "^0.
|
|
50
|
-
"@cascivo/themes": "^0.4.
|
|
48
|
+
"@cascivo/core": "^0.16.1",
|
|
49
|
+
"@cascivo/i18n": "^0.16.1",
|
|
50
|
+
"@cascivo/themes": "^0.4.11"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@testing-library/jest-dom": "^6.9.1",
|
package/readme.body.md
CHANGED
|
@@ -231,7 +231,7 @@ routing break after adding one of these, check that the import resolves to
|
|
|
231
231
|
|
|
232
232
|
## Component index
|
|
233
233
|
|
|
234
|
-
|
|
234
|
+
197 components, exported from `@cascivo/react`. Full props, examples, and live demos at [cascivo.com/docs](https://cascivo.com/docs).
|
|
235
235
|
|
|
236
236
|
### Inputs
|
|
237
237
|
|
|
@@ -264,6 +264,7 @@ routing break after adding one of these, check that the import resolves to
|
|
|
264
264
|
- **Radio** — Single choice from a set, grouped with RadioGroup
|
|
265
265
|
- **RadioCard** — Selectable card backed by a native radio input. Use RadioCardGroup for single-select groups.
|
|
266
266
|
- **RatingGroup** — Star rating input with accessible radio group pattern
|
|
267
|
+
- **ReorderList** — List whose rows can be reordered by pointer drag or entirely by keyboard
|
|
267
268
|
- **Search** — Search input with debounced search callback and clear button
|
|
268
269
|
- **SegmentedControl** — Mutually exclusive toggle group
|
|
269
270
|
- **Select** — Native select menu styled to match the design system
|
|
@@ -275,6 +276,7 @@ routing break after adding one of these, check that the import resolves to
|
|
|
275
276
|
- **TimePicker** — Native time input wrapper with label, hint, error, and size variants
|
|
276
277
|
- **Toggle** — On/off switch built as an accessible button
|
|
277
278
|
- **ToggleGroup** — A set of toggle buttons for single or multiple selection
|
|
279
|
+
- **WheelPicker** — iOS-style drum picker — a column of options that scrolls and snaps to a selection
|
|
278
280
|
|
|
279
281
|
### Display
|
|
280
282
|
|
|
@@ -335,6 +337,7 @@ routing break after adding one of these, check that the import resolves to
|
|
|
335
337
|
- **TreeView** — Hierarchical, expandable tree of nodes with keyboard navigation and selection
|
|
336
338
|
- **User** — Identity composite: an avatar with a name, description, and optional action slot
|
|
337
339
|
- **UsersTablePage** — Full users management page with table, search, and invite action.
|
|
340
|
+
- **VirtualList** — Renders only the rows inside the viewport, so list length costs no extra DOM
|
|
338
341
|
- **VisuallyHidden** — Hides content visually while keeping it available to screen readers
|
|
339
342
|
|
|
340
343
|
### Overlay
|
|
@@ -363,6 +366,7 @@ routing break after adding one of these, check that the import resolves to
|
|
|
363
366
|
- **Dock** — Fixed bottom navigation bar for mobile app shells with up to 5 items
|
|
364
367
|
- **Header** — App top bar with brand, primary navigation links, and an actions slot
|
|
365
368
|
- **HeaderPanel** — Non-modal panel anchored below the shell header at the inline-end edge — hosts notifications, app switcher, user settings
|
|
369
|
+
- **LargeTitleHeader** — Scrolling region whose large title collapses into a compact sticky bar as it scrolls
|
|
366
370
|
- **Link** — Styled anchor for navigation, standalone or inline within prose
|
|
367
371
|
- **Menubar** — Horizontal application menu bar with keyboard-navigable dropdown menus
|
|
368
372
|
- **MenuButton** — A button that opens an anchored action menu of one-shot commands
|
|
@@ -379,8 +383,8 @@ routing break after adding one of these, check that the import resolves to
|
|
|
379
383
|
|
|
380
384
|
### Layout
|
|
381
385
|
|
|
386
|
+
- **AppFrame** — Full-page application shell with persisted collapsible sidebar. Includes a signal-driven top progress bar with determinate progress, error state, and dismissible error strip.
|
|
382
387
|
- **AppShell** — Sticky-header + full-height side-nav + single-scroll-container layout with an animated, accessible nav toggle.
|
|
383
|
-
- **AppShell** — Full-page application shell with persisted collapsible sidebar. Includes a signal-driven top progress bar with determinate progress, error state, and dismissible error strip.
|
|
384
388
|
- **AspectRatio** — Constrains content to a fixed width-to-height ratio
|
|
385
389
|
- **AuthLayout** — Centered card layout for authentication pages (login, register, forgot password).
|
|
386
390
|
- **AutoGrid** — Media-query-free responsive grid — columns auto-fill based on available space.
|
|
@@ -409,6 +413,7 @@ routing break after adding one of these, check that the import resolves to
|
|
|
409
413
|
|
|
410
414
|
### Feedback
|
|
411
415
|
|
|
416
|
+
- **InfiniteScroll** — Loads the next page when the end of a list scrolls into view
|
|
412
417
|
- **InlineLoading** — Compact inline status indicator that pairs a label with a loading, success, or error state
|
|
413
418
|
- **Notification** — Inline, actionable notification banner that surfaces a titled message with an optional recovery action
|
|
414
419
|
- **Progress** — Horizontal bar showing the completion progress of a tracked operation
|
|
@@ -425,7 +430,7 @@ routing break after adding one of these, check that the import resolves to
|
|
|
425
430
|
- **Boxplot** — Box-and-whisker plot with five-number summary and outlier dots per series.
|
|
426
431
|
- **BubbleChart** — Bubble chart mapping x, y, and size dimensions; radius is area-proportional via sqrt scale.
|
|
427
432
|
- **Bullet** — Bullet chart with background range bands, measure bar, and target tick.
|
|
428
|
-
- **
|
|
433
|
+
- **CalendarHeatmap** — Calendar heatmap — a week-column grid of day cells colored by value (GitHub-style).
|
|
429
434
|
- **Candlestick** — OHLC financial chart — each period a high–low wick and an open↔close body, coloured up/down.
|
|
430
435
|
- **ComboChart** — Combination bar + line chart on shared or dual y-axes.
|
|
431
436
|
- **Funnel** — Vertical conversion funnel — each stage is a trapezoid narrowing toward the next, with optional conversion labels.
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { persistedSignal as e } from "../../storage/src/persisted-signal.js";
|
|
4
|
-
import { useSignalEffect as t, useSignals as n } from "@cascivo/core";
|
|
5
|
-
import { useRef as r } from "react";
|
|
6
|
-
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
-
//#region src/theme.tsx
|
|
8
|
-
var s = "cascivo-theme", c = "data-theme";
|
|
9
|
-
function l() {
|
|
10
|
-
return globalThis.process?.env?.NODE_ENV !== "production";
|
|
11
|
-
}
|
|
12
|
-
var u = /* @__PURE__ */ new Set();
|
|
13
|
-
function d(e, t) {
|
|
14
|
-
l() && (e === null || typeof document > "u" || typeof requestAnimationFrame != "function" || u.has(t) || requestAnimationFrame(() => {
|
|
15
|
-
u.has(t) || getComputedStyle(e).getPropertyValue("--cascivo-color-accent").trim() === "" && (u.add(t), console.warn(`cascivo ThemeProvider: data-theme=${JSON.stringify(t)} was set, but no cascivo theme CSS defines it — every --cascivo-color-* token is unresolved, so components render grayscale. Import '@cascivo/themes/all.css' once in your entry (or '@cascivo/react/styles.css', which bundles the light and dark themes). Using a custom theme? Ensure its stylesheet is loaded and defines [data-theme=${JSON.stringify(t)}]. Docs: https://cascivo.com/docs/theming.md — offline: npx -y @cascivo/docs guide theming`));
|
|
16
|
-
}));
|
|
17
|
-
}
|
|
18
|
-
var f = null, p = {
|
|
19
|
-
storageKey: s,
|
|
20
|
-
defaultTheme: "light",
|
|
21
|
-
explicit: !1
|
|
22
|
-
};
|
|
23
|
-
function m(e) {
|
|
24
|
-
return typeof window > "u" || typeof window.matchMedia != "function" ? e : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : window.matchMedia("(prefers-color-scheme: light)").matches ? "light" : e;
|
|
25
|
-
}
|
|
26
|
-
function h() {
|
|
27
|
-
return p.explicit ? p.defaultTheme : m(p.defaultTheme);
|
|
28
|
-
}
|
|
29
|
-
function g() {
|
|
30
|
-
return f ??= e(p.storageKey, h()), f;
|
|
31
|
-
}
|
|
32
|
-
var _ = !1, v = !1;
|
|
33
|
-
function y(e) {
|
|
34
|
-
!l() || v || typeof requestAnimationFrame == "function" && requestAnimationFrame(() => {
|
|
35
|
-
_ || v || (v = !0, console.warn(`cascivo setTheme(${JSON.stringify(e)}): no <ThemeProvider> is mounted, so the theme signal updated but the ${c} attribute was never written — nothing on the page will restyle. Wrap your app in <ThemeProvider> (it is SSR-safe and persists the choice), or call applyTheme() to write the attribute directly if you are theming outside React. Docs: https://cascivo.com/docs/theming.md — offline: npx -y @cascivo/docs guide theming`));
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
function b(e) {
|
|
39
|
-
g().value = e, y(e);
|
|
40
|
-
}
|
|
41
|
-
function x(e, t) {
|
|
42
|
-
g().value = e;
|
|
43
|
-
let n = t ?? (typeof document < "u" ? document.documentElement : null);
|
|
44
|
-
n !== null && (n.setAttribute(c, e), d(n, e));
|
|
45
|
-
}
|
|
46
|
-
function S() {
|
|
47
|
-
return n(), [g().value, b];
|
|
48
|
-
}
|
|
49
|
-
function C() {
|
|
50
|
-
return g();
|
|
51
|
-
}
|
|
52
|
-
function w(e) {
|
|
53
|
-
return JSON.stringify(e).replace(/</g, "\\u003c");
|
|
54
|
-
}
|
|
55
|
-
function T({ defaultTheme: e, value: n, storageKey: l = s, attribute: u = c, target: m, onChange: h, nonce: v, children: y }) {
|
|
56
|
-
let b = r(!1);
|
|
57
|
-
b.current || (b.current = !0, (f === null || p.storageKey !== l) && (p = {
|
|
58
|
-
storageKey: l,
|
|
59
|
-
defaultTheme: e ?? "light",
|
|
60
|
-
explicit: e !== void 0
|
|
61
|
-
}, f = null));
|
|
62
|
-
let x = g();
|
|
63
|
-
n !== void 0 && (x.value = n);
|
|
64
|
-
let S = r(h);
|
|
65
|
-
return S.current = h, t(() => {
|
|
66
|
-
let e = x.value, t = m ? m.current : typeof document < "u" ? document.documentElement : null;
|
|
67
|
-
_ = !0, t?.setAttribute(u, e), d(t, e), S.current?.(e);
|
|
68
|
-
}), n !== void 0 && !m ? /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a("script", {
|
|
69
|
-
nonce: v,
|
|
70
|
-
dangerouslySetInnerHTML: { __html: `document.documentElement.setAttribute(${w(u)},${w(n)})` }
|
|
71
|
-
}), y] }) : /* @__PURE__ */ a(i, { children: y });
|
|
72
|
-
}
|
|
73
|
-
function E(e = {}) {
|
|
74
|
-
let t = JSON.stringify(e.storageKey ?? s), n = JSON.stringify(e.attribute ?? c), r = JSON.stringify(e.defaultTheme ?? "light"), i = e.defaultTheme === void 0 ? "if(typeof matchMedia==='function'){if(matchMedia('(prefers-color-scheme: dark)').matches)v='dark';else if(matchMedia('(prefers-color-scheme: light)').matches)v='light';}" : "";
|
|
75
|
-
return `(function(){try{var v=${r};` + i + `var raw=localStorage.getItem(${t});if(raw){v=raw;try{var e=JSON.parse(raw);if(e&&typeof e==='object'&&'value'in e)v=e.value;}catch(_){}}document.documentElement.setAttribute(${n},v);}catch(_){}})();`;
|
|
76
|
-
}
|
|
77
|
-
//#endregion
|
|
78
|
-
export { T as ThemeProvider, x as applyTheme, b as setTheme, E as themePreloadScript, C as themeSignal, S as useTheme };
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
//#region ../storage/src/drivers.ts
|
|
4
|
-
function e() {
|
|
5
|
-
let e = /* @__PURE__ */ new Map();
|
|
6
|
-
return {
|
|
7
|
-
get: (t) => e.get(t) ?? null,
|
|
8
|
-
set: (t, n) => {
|
|
9
|
-
e.set(t, n);
|
|
10
|
-
},
|
|
11
|
-
remove: (t) => {
|
|
12
|
-
e.delete(t);
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
function t() {
|
|
17
|
-
return typeof window > "u" ? e() : {
|
|
18
|
-
get: (e) => window.localStorage.getItem(e),
|
|
19
|
-
set: (e, t) => {
|
|
20
|
-
try {
|
|
21
|
-
window.localStorage.setItem(e, t);
|
|
22
|
-
} catch {}
|
|
23
|
-
},
|
|
24
|
-
remove: (e) => {
|
|
25
|
-
window.localStorage.removeItem(e);
|
|
26
|
-
},
|
|
27
|
-
subscribe(e, t) {
|
|
28
|
-
let n = (n) => {
|
|
29
|
-
n.storageArea === window.localStorage && n.key === e && t(n.newValue);
|
|
30
|
-
};
|
|
31
|
-
return window.addEventListener("storage", n), () => window.removeEventListener("storage", n);
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
//#endregion
|
|
36
|
-
export { t as localStorageDriver };
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { localStorageDriver as e } from "./drivers.js";
|
|
4
|
-
import { effect as t, signal as n } from "@cascivo/core";
|
|
5
|
-
//#region ../storage/src/persisted-signal.ts
|
|
6
|
-
function r(r, i, a = {}) {
|
|
7
|
-
let o = a.driver ?? e(), s = a.version ?? 1, c = n(i), l = n(!1), u = !1;
|
|
8
|
-
function d(e) {
|
|
9
|
-
if (e !== null) try {
|
|
10
|
-
let t = JSON.parse(e);
|
|
11
|
-
if (typeof t != "object" || !t || typeof t.v != "number") return;
|
|
12
|
-
if (t.v !== s) {
|
|
13
|
-
if (!a.migrate) return;
|
|
14
|
-
let e = a.migrate(t.value, t.v);
|
|
15
|
-
return o.set(r, JSON.stringify({
|
|
16
|
-
v: s,
|
|
17
|
-
value: e
|
|
18
|
-
})), e;
|
|
19
|
-
}
|
|
20
|
-
return t.value;
|
|
21
|
-
} catch {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
function f(e) {
|
|
26
|
-
let t = d(e);
|
|
27
|
-
t !== void 0 && (u = !0, c.value = t, u = !1);
|
|
28
|
-
}
|
|
29
|
-
let p = o.get(r);
|
|
30
|
-
p instanceof Promise ? p.then((e) => {
|
|
31
|
-
f(e), l.value = !0;
|
|
32
|
-
}) : (f(p), l.value = !0), t(() => {
|
|
33
|
-
let e = c.value;
|
|
34
|
-
!l.value || u || o.set(r, JSON.stringify({
|
|
35
|
-
v: s,
|
|
36
|
-
value: e
|
|
37
|
-
}));
|
|
38
|
-
}), o.subscribe?.(r, f);
|
|
39
|
-
let m = c;
|
|
40
|
-
return m.ready = l, m;
|
|
41
|
-
}
|
|
42
|
-
//#endregion
|
|
43
|
-
export { r as persistedSignal };
|
package/dist/react/src/theme.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { persistedSignal as e } from "../../storage/src/persisted-signal.js";
|
|
4
|
-
import { useSignalEffect as t, useSignals as n } from "@cascivo/core";
|
|
5
|
-
import { useRef as r } from "react";
|
|
6
|
-
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
-
//#region src/theme.tsx
|
|
8
|
-
var s = "cascivo-theme", c = "data-theme";
|
|
9
|
-
function l() {
|
|
10
|
-
return globalThis.process?.env?.NODE_ENV !== "production";
|
|
11
|
-
}
|
|
12
|
-
var u = /* @__PURE__ */ new Set();
|
|
13
|
-
function d(e, t) {
|
|
14
|
-
l() && (e === null || typeof document > "u" || typeof requestAnimationFrame != "function" || u.has(t) || requestAnimationFrame(() => {
|
|
15
|
-
u.has(t) || getComputedStyle(e).getPropertyValue("--cascivo-color-accent").trim() === "" && (u.add(t), console.warn(`cascivo ThemeProvider: data-theme=${JSON.stringify(t)} was set, but no cascivo theme CSS defines it — every --cascivo-color-* token is unresolved, so components render grayscale. Import '@cascivo/themes/all.css' once in your entry (or '@cascivo/react/styles.css', which bundles the light and dark themes). Using a custom theme? Ensure its stylesheet is loaded and defines [data-theme=${JSON.stringify(t)}]. Docs: https://cascivo.com/docs/theming.md — offline: npx -y @cascivo/docs guide theming`));
|
|
16
|
-
}));
|
|
17
|
-
}
|
|
18
|
-
var f = null, p = {
|
|
19
|
-
storageKey: s,
|
|
20
|
-
defaultTheme: "light",
|
|
21
|
-
explicit: !1
|
|
22
|
-
};
|
|
23
|
-
function m(e) {
|
|
24
|
-
return typeof window > "u" || typeof window.matchMedia != "function" ? e : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : window.matchMedia("(prefers-color-scheme: light)").matches ? "light" : e;
|
|
25
|
-
}
|
|
26
|
-
function h() {
|
|
27
|
-
return p.explicit ? p.defaultTheme : m(p.defaultTheme);
|
|
28
|
-
}
|
|
29
|
-
function g() {
|
|
30
|
-
return f ??= e(p.storageKey, h()), f;
|
|
31
|
-
}
|
|
32
|
-
var _ = !1, v = !1;
|
|
33
|
-
function y(e) {
|
|
34
|
-
!l() || v || typeof requestAnimationFrame == "function" && requestAnimationFrame(() => {
|
|
35
|
-
_ || v || (v = !0, console.warn(`cascivo setTheme(${JSON.stringify(e)}): no <ThemeProvider> is mounted, so the theme signal updated but the ${c} attribute was never written — nothing on the page will restyle. Wrap your app in <ThemeProvider> (it is SSR-safe and persists the choice), or call applyTheme() to write the attribute directly if you are theming outside React. Docs: https://cascivo.com/docs/theming.md — offline: npx -y @cascivo/docs guide theming`));
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
function b(e) {
|
|
39
|
-
g().value = e, y(e);
|
|
40
|
-
}
|
|
41
|
-
function x(e, t) {
|
|
42
|
-
g().value = e;
|
|
43
|
-
let n = t ?? (typeof document < "u" ? document.documentElement : null);
|
|
44
|
-
n !== null && (n.setAttribute(c, e), d(n, e));
|
|
45
|
-
}
|
|
46
|
-
function S() {
|
|
47
|
-
return n(), [g().value, b];
|
|
48
|
-
}
|
|
49
|
-
function C() {
|
|
50
|
-
return g();
|
|
51
|
-
}
|
|
52
|
-
function w(e) {
|
|
53
|
-
return JSON.stringify(e).replace(/</g, "\\u003c");
|
|
54
|
-
}
|
|
55
|
-
function T({ defaultTheme: e, value: n, storageKey: l = s, attribute: u = c, target: m, onChange: h, nonce: v, children: y }) {
|
|
56
|
-
let b = r(!1);
|
|
57
|
-
b.current || (b.current = !0, (f === null || p.storageKey !== l) && (p = {
|
|
58
|
-
storageKey: l,
|
|
59
|
-
defaultTheme: e ?? "light",
|
|
60
|
-
explicit: e !== void 0
|
|
61
|
-
}, f = null));
|
|
62
|
-
let x = g();
|
|
63
|
-
n !== void 0 && (x.value = n);
|
|
64
|
-
let S = r(h);
|
|
65
|
-
return S.current = h, t(() => {
|
|
66
|
-
let e = x.value, t = m ? m.current : typeof document < "u" ? document.documentElement : null;
|
|
67
|
-
_ = !0, t?.setAttribute(u, e), d(t, e), S.current?.(e);
|
|
68
|
-
}), n !== void 0 && !m ? /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a("script", {
|
|
69
|
-
nonce: v,
|
|
70
|
-
dangerouslySetInnerHTML: { __html: `document.documentElement.setAttribute(${w(u)},${w(n)})` }
|
|
71
|
-
}), y] }) : /* @__PURE__ */ a(i, { children: y });
|
|
72
|
-
}
|
|
73
|
-
function E(e = {}) {
|
|
74
|
-
let t = JSON.stringify(e.storageKey ?? s), n = JSON.stringify(e.attribute ?? c), r = JSON.stringify(e.defaultTheme ?? "light"), i = e.defaultTheme === void 0 ? "if(typeof matchMedia==='function'){if(matchMedia('(prefers-color-scheme: dark)').matches)v='dark';else if(matchMedia('(prefers-color-scheme: light)').matches)v='light';}" : "";
|
|
75
|
-
return `(function(){try{var v=${r};` + i + `var raw=localStorage.getItem(${t});if(raw){v=raw;try{var e=JSON.parse(raw);if(e&&typeof e==='object'&&'value'in e)v=e.value;}catch(_){}}document.documentElement.setAttribute(${n},v);}catch(_){}})();`;
|
|
76
|
-
}
|
|
77
|
-
//#endregion
|
|
78
|
-
export { T as ThemeProvider, x as applyTheme, b as setTheme, E as themePreloadScript, C as themeSignal, S as useTheme };
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
//#region ../storage/src/drivers.ts
|
|
4
|
-
function e() {
|
|
5
|
-
let e = /* @__PURE__ */ new Map();
|
|
6
|
-
return {
|
|
7
|
-
get: (t) => e.get(t) ?? null,
|
|
8
|
-
set: (t, n) => {
|
|
9
|
-
e.set(t, n);
|
|
10
|
-
},
|
|
11
|
-
remove: (t) => {
|
|
12
|
-
e.delete(t);
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
function t() {
|
|
17
|
-
return typeof window > "u" ? e() : {
|
|
18
|
-
get: (e) => window.localStorage.getItem(e),
|
|
19
|
-
set: (e, t) => {
|
|
20
|
-
try {
|
|
21
|
-
window.localStorage.setItem(e, t);
|
|
22
|
-
} catch {}
|
|
23
|
-
},
|
|
24
|
-
remove: (e) => {
|
|
25
|
-
window.localStorage.removeItem(e);
|
|
26
|
-
},
|
|
27
|
-
subscribe(e, t) {
|
|
28
|
-
let n = (n) => {
|
|
29
|
-
n.storageArea === window.localStorage && n.key === e && t(n.newValue);
|
|
30
|
-
};
|
|
31
|
-
return window.addEventListener("storage", n), () => window.removeEventListener("storage", n);
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
//#endregion
|
|
36
|
-
export { t as localStorageDriver };
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { localStorageDriver as e } from "./drivers.js";
|
|
4
|
-
import { effect as t, signal as n } from "@cascivo/core";
|
|
5
|
-
//#region ../storage/src/persisted-signal.ts
|
|
6
|
-
function r(r, i, a = {}) {
|
|
7
|
-
let o = a.driver ?? e(), s = a.version ?? 1, c = n(i), l = n(!1), u = !1;
|
|
8
|
-
function d(e) {
|
|
9
|
-
if (e !== null) try {
|
|
10
|
-
let t = JSON.parse(e);
|
|
11
|
-
if (typeof t != "object" || !t || typeof t.v != "number") return;
|
|
12
|
-
if (t.v !== s) {
|
|
13
|
-
if (!a.migrate) return;
|
|
14
|
-
let e = a.migrate(t.value, t.v);
|
|
15
|
-
return o.set(r, JSON.stringify({
|
|
16
|
-
v: s,
|
|
17
|
-
value: e
|
|
18
|
-
})), e;
|
|
19
|
-
}
|
|
20
|
-
return t.value;
|
|
21
|
-
} catch {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
function f(e) {
|
|
26
|
-
let t = d(e);
|
|
27
|
-
t !== void 0 && (u = !0, c.value = t, u = !1);
|
|
28
|
-
}
|
|
29
|
-
let p = o.get(r);
|
|
30
|
-
p instanceof Promise ? p.then((e) => {
|
|
31
|
-
f(e), l.value = !0;
|
|
32
|
-
}) : (f(p), l.value = !0), t(() => {
|
|
33
|
-
let e = c.value;
|
|
34
|
-
!l.value || u || o.set(r, JSON.stringify({
|
|
35
|
-
v: s,
|
|
36
|
-
value: e
|
|
37
|
-
}));
|
|
38
|
-
}), o.subscribe?.(r, f);
|
|
39
|
-
let m = c;
|
|
40
|
-
return m.ready = l, m;
|
|
41
|
-
}
|
|
42
|
-
//#endregion
|
|
43
|
-
export { r as persistedSignal };
|