@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
package/dist/code/code.js
CHANGED
|
@@ -1,14 +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/code/code.tsx
|
|
5
|
-
function r({ size: r = "md", className: i, children: a, ...o }) {
|
|
6
|
-
return /* @__PURE__ */ n("code", {
|
|
7
|
-
"data-size": r,
|
|
8
|
-
className: t(e.code, i),
|
|
9
|
-
...o,
|
|
10
|
-
children: a
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
//#endregion
|
|
14
|
-
export { r as Code };
|
|
1
|
+
import e from"./code.module.js";import{cn as t}from"@cascivo/core/pure";import{jsx as n}from"react/jsx-runtime";function r({size:r=`md`,className:i,children:a,...o}){return n(`code`,{"data-size":r,className:t(e.code,i),...o,children:a})}export{r as Code};
|
package/dist/code/code.module.js
CHANGED
|
@@ -1,121 +1,2 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { tokenize as e } from "./highlight.js";
|
|
4
|
-
import t from "./code-snippet.module.js";
|
|
5
|
-
import { cn as n, useClipboard as r, useSignals as i } from "@cascivo/core";
|
|
6
|
-
import { builtin as a, t as o } from "@cascivo/i18n";
|
|
7
|
-
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
8
|
-
//#region ../components/src/code-snippet/code-snippet.tsx
|
|
9
|
-
function l() {
|
|
10
|
-
return globalThis.process?.env?.NODE_ENV !== "production";
|
|
11
|
-
}
|
|
12
|
-
function u({ code: n, language: r }) {
|
|
13
|
-
return /* @__PURE__ */ s("code", {
|
|
14
|
-
className: t.code,
|
|
15
|
-
children: e(n, r).map((e, t) => e.type === "text" ? /* @__PURE__ */ s("span", { children: e.value }, t) : /* @__PURE__ */ s("span", {
|
|
16
|
-
"data-tok": e.type,
|
|
17
|
-
children: e.value
|
|
18
|
-
}, t))
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
function d({ code: e, children: d, variant: f = "single", language: p, terminal: m = !1, title: h, showLineNumbers: g, showCopyButton: _, labels: v, className: y }) {
|
|
22
|
-
i();
|
|
23
|
-
let b = e ?? d ?? "";
|
|
24
|
-
l() && e === void 0 && d === void 0 && console.error("CodeSnippet: pass the code either as the `code` prop or as a plain-string child. Rendering nothing.");
|
|
25
|
-
let { copied: x, copy: S } = r(), C = v?.copy ?? o(a.codeSnippet.copy), w = v?.copied ?? o(a.codeSnippet.copied), T = _ ?? f !== "inline" ? /* @__PURE__ */ s("button", {
|
|
26
|
-
type: "button",
|
|
27
|
-
"aria-label": x.value ? w : C,
|
|
28
|
-
"data-state": x.value ? "copied" : "idle",
|
|
29
|
-
className: t.copy,
|
|
30
|
-
onClick: () => void S(b),
|
|
31
|
-
children: x.value ? /* @__PURE__ */ s("svg", {
|
|
32
|
-
"aria-hidden": "true",
|
|
33
|
-
viewBox: "0 0 16 16",
|
|
34
|
-
className: t.icon,
|
|
35
|
-
children: /* @__PURE__ */ s("path", {
|
|
36
|
-
d: "M13.5 4.5 6 12 2.5 8.5",
|
|
37
|
-
fill: "none",
|
|
38
|
-
stroke: "currentColor",
|
|
39
|
-
strokeWidth: "1.5",
|
|
40
|
-
strokeLinecap: "round",
|
|
41
|
-
strokeLinejoin: "round"
|
|
42
|
-
})
|
|
43
|
-
}) : /* @__PURE__ */ c("svg", {
|
|
44
|
-
"aria-hidden": "true",
|
|
45
|
-
viewBox: "0 0 16 16",
|
|
46
|
-
className: t.icon,
|
|
47
|
-
children: [/* @__PURE__ */ s("rect", {
|
|
48
|
-
x: "5.5",
|
|
49
|
-
y: "5.5",
|
|
50
|
-
width: "8",
|
|
51
|
-
height: "8",
|
|
52
|
-
rx: "1.5",
|
|
53
|
-
fill: "none",
|
|
54
|
-
stroke: "currentColor",
|
|
55
|
-
strokeWidth: "1.5"
|
|
56
|
-
}), /* @__PURE__ */ s("path", {
|
|
57
|
-
d: "M3.5 10.5h-1a1 1 0 0 1-1-1v-7a1 1 0 0 1 1-1h7a1 1 0 0 1 1 1v1",
|
|
58
|
-
fill: "none",
|
|
59
|
-
stroke: "currentColor",
|
|
60
|
-
strokeWidth: "1.5"
|
|
61
|
-
})]
|
|
62
|
-
})
|
|
63
|
-
}) : null;
|
|
64
|
-
if (f === "inline") return /* @__PURE__ */ c("span", {
|
|
65
|
-
className: n(t.root, y),
|
|
66
|
-
"data-variant": "inline",
|
|
67
|
-
children: [/* @__PURE__ */ s("code", {
|
|
68
|
-
className: t.inlineCode,
|
|
69
|
-
children: b
|
|
70
|
-
}), T]
|
|
71
|
-
});
|
|
72
|
-
let E = b.split("\n"), D = f === "multi" && g && !p;
|
|
73
|
-
return /* @__PURE__ */ c("div", {
|
|
74
|
-
className: n(t.root, y),
|
|
75
|
-
"data-variant": f,
|
|
76
|
-
"data-terminal": m ? "" : void 0,
|
|
77
|
-
children: [
|
|
78
|
-
m && /* @__PURE__ */ c("div", {
|
|
79
|
-
className: t.bar,
|
|
80
|
-
"aria-hidden": "true",
|
|
81
|
-
children: [/* @__PURE__ */ c("span", {
|
|
82
|
-
className: t.dots,
|
|
83
|
-
children: [
|
|
84
|
-
/* @__PURE__ */ s("span", { className: t.dot }),
|
|
85
|
-
/* @__PURE__ */ s("span", { className: t.dot }),
|
|
86
|
-
/* @__PURE__ */ s("span", { className: t.dot })
|
|
87
|
-
]
|
|
88
|
-
}), h && /* @__PURE__ */ s("span", {
|
|
89
|
-
className: t.title,
|
|
90
|
-
children: h
|
|
91
|
-
})]
|
|
92
|
-
}),
|
|
93
|
-
/* @__PURE__ */ s("pre", {
|
|
94
|
-
className: t.pre,
|
|
95
|
-
children: D ? /* @__PURE__ */ s("code", {
|
|
96
|
-
className: t.code,
|
|
97
|
-
children: E.map((e, n) => /* @__PURE__ */ c("span", {
|
|
98
|
-
className: t.line,
|
|
99
|
-
children: [/* @__PURE__ */ s("span", {
|
|
100
|
-
"aria-hidden": "true",
|
|
101
|
-
className: t.lineNumber,
|
|
102
|
-
children: n + 1
|
|
103
|
-
}), /* @__PURE__ */ s("span", {
|
|
104
|
-
className: t.lineText,
|
|
105
|
-
children: e
|
|
106
|
-
})]
|
|
107
|
-
}, n))
|
|
108
|
-
}) : p ? /* @__PURE__ */ s(u, {
|
|
109
|
-
code: b,
|
|
110
|
-
language: p
|
|
111
|
-
}) : /* @__PURE__ */ s("code", {
|
|
112
|
-
className: t.code,
|
|
113
|
-
children: b
|
|
114
|
-
})
|
|
115
|
-
}),
|
|
116
|
-
T
|
|
117
|
-
]
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
//#endregion
|
|
121
|
-
export { d as CodeSnippet };
|
|
1
|
+
"use client";import{tokenize as e}from"./highlight.js";import t from"./code-snippet.module.js";import{cn as n,useClipboard as r,useSignals as i}from"@cascivo/core";import{builtin as a,t as o}from"@cascivo/i18n";import{jsx as s,jsxs as c}from"react/jsx-runtime";function l(){return globalThis.process?.env?.NODE_ENV!==`production`}function u({code:n,language:r}){return s(`code`,{className:t.code,children:e(n,r).map((e,t)=>e.type===`text`?s(`span`,{children:e.value},t):s(`span`,{"data-tok":e.type,children:e.value},t))})}function d({code:e,children:d,variant:f=`single`,language:p,terminal:m=!1,title:h,showLineNumbers:g,showCopyButton:_,labels:v,className:y}){i();let b=e??d??``;l()&&e===void 0&&d===void 0&&console.error("CodeSnippet: pass the code either as the `code` prop or as a plain-string child. Rendering nothing.");let{copied:x,copy:S}=r(),C=v?.copy??o(a.codeSnippet.copy),w=v?.copied??o(a.codeSnippet.copied),T=_??f!==`inline`?s(`button`,{type:`button`,"aria-label":x.value?w:C,"data-state":x.value?`copied`:`idle`,className:t.copy,onClick:()=>void S(b),children:x.value?s(`svg`,{"aria-hidden":`true`,viewBox:`0 0 16 16`,className:t.icon,children:s(`path`,{d:`M13.5 4.5 6 12 2.5 8.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})}):c(`svg`,{"aria-hidden":`true`,viewBox:`0 0 16 16`,className:t.icon,children:[s(`rect`,{x:`5.5`,y:`5.5`,width:`8`,height:`8`,rx:`1.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`}),s(`path`,{d:`M3.5 10.5h-1a1 1 0 0 1-1-1v-7a1 1 0 0 1 1-1h7a1 1 0 0 1 1 1v1`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`})]})}):null;if(f===`inline`)return c(`span`,{className:n(t.root,y),"data-variant":`inline`,children:[s(`code`,{className:t.inlineCode,children:b}),T]});let E=b.split(`
|
|
2
|
+
`),D=f===`multi`&&g&&!p;return c(`div`,{className:n(t.root,y),"data-variant":f,"data-terminal":m?``:void 0,children:[m&&c(`div`,{className:t.bar,"aria-hidden":`true`,children:[c(`span`,{className:t.dots,children:[s(`span`,{className:t.dot}),s(`span`,{className:t.dot}),s(`span`,{className:t.dot})]}),h&&s(`span`,{className:t.title,children:h})]}),s(`pre`,{className:t.pre,children:D?s(`code`,{className:t.code,children:E.map((e,n)=>c(`span`,{className:t.line,children:[s(`span`,{"aria-hidden":`true`,className:t.lineNumber,children:n+1}),s(`span`,{className:t.lineText,children:e})]},n))}):p?s(u,{code:b,language:p}):s(`code`,{className:t.code,children:b})}),T]})}export{d as CodeSnippet};
|
|
@@ -1,18 +1,2 @@
|
|
|
1
1
|
import './code-snippet.css';
|
|
2
|
-
var e
|
|
3
|
-
root: "_root_4lyzf_2",
|
|
4
|
-
inlineCode: "_inlineCode_4lyzf_12",
|
|
5
|
-
pre: "_pre_4lyzf_23",
|
|
6
|
-
code: "_code_4lyzf_44",
|
|
7
|
-
line: "_line_4lyzf_49",
|
|
8
|
-
lineNumber: "_lineNumber_4lyzf_54",
|
|
9
|
-
lineText: "_lineText_4lyzf_62",
|
|
10
|
-
copy: "_copy_4lyzf_66",
|
|
11
|
-
icon: "_icon_4lyzf_106",
|
|
12
|
-
bar: "_bar_4lyzf_153",
|
|
13
|
-
dots: "_dots_4lyzf_163",
|
|
14
|
-
dot: "_dot_4lyzf_163",
|
|
15
|
-
title: "_title_4lyzf_187"
|
|
16
|
-
};
|
|
17
|
-
//#endregion
|
|
18
|
-
export { e as default };
|
|
2
|
+
var e={root:`_root_4lyzf_2`,inlineCode:`_inlineCode_4lyzf_12`,pre:`_pre_4lyzf_23`,code:`_code_4lyzf_44`,line:`_line_4lyzf_49`,lineNumber:`_lineNumber_4lyzf_54`,lineText:`_lineText_4lyzf_62`,copy:`_copy_4lyzf_66`,icon:`_icon_4lyzf_106`,bar:`_bar_4lyzf_153`,dots:`_dots_4lyzf_163`,dot:`_dot_4lyzf_163`,title:`_title_4lyzf_187`};export{e as default};
|
|
@@ -1,67 +1 @@
|
|
|
1
|
-
|
|
2
|
-
function e(e) {
|
|
3
|
-
return e.map(([e, t]) => ({
|
|
4
|
-
type: e,
|
|
5
|
-
re: RegExp(`^(?:${t})`)
|
|
6
|
-
}));
|
|
7
|
-
}
|
|
8
|
-
var t = "\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*'", n = "`(?:[^`\\\\]|\\\\.)*`", r = "const|let|var|function|return|if|else|for|while|do|switch|case|break|continue|new|class|extends|super|import|export|from|default|async|await|yield|typeof|instanceof|in|of|void|delete|this|null|true|false|undefined", i = `${r}|interface|type|as|readonly|enum|implements|public|private|protected|abstract|namespace|declare|satisfies|keyof|infer|is|string|number|boolean|unknown|never|any`, a = {
|
|
9
|
-
bash: e([
|
|
10
|
-
["comment", "#[^\\n]*"],
|
|
11
|
-
["string", t],
|
|
12
|
-
["prompt", "\\$(?= )"],
|
|
13
|
-
["keyword", "\\b(?:npx|npm|pnpm|yarn|bun|deno|node|git|cd|ls|cat|echo|export|sudo|mkdir|rm|cp|mv|curl|wget|chmod|source)\\b"],
|
|
14
|
-
["variable", "--?[A-Za-z][\\w-]*"],
|
|
15
|
-
["number", "\\b\\d+(?:\\.\\d+)?\\b"]
|
|
16
|
-
]),
|
|
17
|
-
css: e([
|
|
18
|
-
["comment", "/\\*[\\s\\S]*?\\*/"],
|
|
19
|
-
["string", t],
|
|
20
|
-
["keyword", "@[\\w-]+"],
|
|
21
|
-
["variable", "--[\\w-]+"],
|
|
22
|
-
["fn", "[\\w-]+(?=\\()"],
|
|
23
|
-
["number", "#[0-9a-fA-F]{3,8}\\b|-?\\d*\\.?\\d+(?:[a-z%]+)?"],
|
|
24
|
-
["punct", "[{}();:,]"]
|
|
25
|
-
]),
|
|
26
|
-
js: e([
|
|
27
|
-
["comment", "//[^\\n]*|/\\*[\\s\\S]*?\\*/"],
|
|
28
|
-
["string", `${t}|${n}`],
|
|
29
|
-
["keyword", `\\b(?:${r})\\b`],
|
|
30
|
-
["fn", "[A-Za-z_$][\\w$]*(?=\\()"],
|
|
31
|
-
["number", "-?\\d*\\.?\\d+"],
|
|
32
|
-
["punct", "[{}()\\[\\];:,.]|=>"]
|
|
33
|
-
]),
|
|
34
|
-
ts: e([
|
|
35
|
-
["comment", "//[^\\n]*|/\\*[\\s\\S]*?\\*/"],
|
|
36
|
-
["string", `${t}|${n}`],
|
|
37
|
-
["keyword", `\\b(?:${i})\\b`],
|
|
38
|
-
["fn", "[A-Za-z_$][\\w$]*(?=\\()"],
|
|
39
|
-
["number", "-?\\d*\\.?\\d+"],
|
|
40
|
-
["punct", "[{}()\\[\\];:,.]|=>"]
|
|
41
|
-
])
|
|
42
|
-
};
|
|
43
|
-
function o(e, t) {
|
|
44
|
-
let n = a[t], r = [], i = e, o = "", s = () => {
|
|
45
|
-
o &&= (r.push({
|
|
46
|
-
type: "text",
|
|
47
|
-
value: o
|
|
48
|
-
}), "");
|
|
49
|
-
};
|
|
50
|
-
for (; i.length > 0;) {
|
|
51
|
-
let e = !1;
|
|
52
|
-
for (let { type: t, re: a } of n) {
|
|
53
|
-
let n = a.exec(i);
|
|
54
|
-
if (n && n[0].length > 0) {
|
|
55
|
-
s(), r.push({
|
|
56
|
-
type: t,
|
|
57
|
-
value: n[0]
|
|
58
|
-
}), i = i.slice(n[0].length), e = !0;
|
|
59
|
-
break;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
e || (o += i[0], i = i.slice(1));
|
|
63
|
-
}
|
|
64
|
-
return s(), r;
|
|
65
|
-
}
|
|
66
|
-
//#endregion
|
|
67
|
-
export { o as tokenize };
|
|
1
|
+
function e(e){return e.map(([e,t])=>({type:e,re:RegExp(`^(?:${t})`)}))}var t=`"(?:[^"\\\\]|\\\\.)*"|'(?:[^'\\\\]|\\\\.)*'`,n="`(?:[^`\\\\]|\\\\.)*`",r=`const|let|var|function|return|if|else|for|while|do|switch|case|break|continue|new|class|extends|super|import|export|from|default|async|await|yield|typeof|instanceof|in|of|void|delete|this|null|true|false|undefined`,i=`${r}|interface|type|as|readonly|enum|implements|public|private|protected|abstract|namespace|declare|satisfies|keyof|infer|is|string|number|boolean|unknown|never|any`,a={bash:e([[`comment`,`#[^\\n]*`],[`string`,t],[`prompt`,`\\$(?= )`],[`keyword`,`\\b(?:npx|npm|pnpm|yarn|bun|deno|node|git|cd|ls|cat|echo|export|sudo|mkdir|rm|cp|mv|curl|wget|chmod|source)\\b`],[`variable`,`--?[A-Za-z][\\w-]*`],[`number`,`\\b\\d+(?:\\.\\d+)?\\b`]]),css:e([[`comment`,`/\\*[\\s\\S]*?\\*/`],[`string`,t],[`keyword`,`@[\\w-]+`],[`variable`,`--[\\w-]+`],[`fn`,`[\\w-]+(?=\\()`],[`number`,`#[0-9a-fA-F]{3,8}\\b|-?\\d*\\.?\\d+(?:[a-z%]+)?`],[`punct`,`[{}();:,]`]]),js:e([[`comment`,`//[^\\n]*|/\\*[\\s\\S]*?\\*/`],[`string`,`${t}|${n}`],[`keyword`,`\\b(?:${r})\\b`],[`fn`,`[A-Za-z_$][\\w$]*(?=\\()`],[`number`,`-?\\d*\\.?\\d+`],[`punct`,`[{}()\\[\\];:,.]|=>`]]),ts:e([[`comment`,`//[^\\n]*|/\\*[\\s\\S]*?\\*/`],[`string`,`${t}|${n}`],[`keyword`,`\\b(?:${i})\\b`],[`fn`,`[A-Za-z_$][\\w$]*(?=\\()`],[`number`,`-?\\d*\\.?\\d+`],[`punct`,`[{}()\\[\\];:,.]|=>`]])};function o(e,t){let n=a[t],r=[],i=e,o=``,s=()=>{o&&=(r.push({type:`text`,value:o}),``)};for(;i.length>0;){let e=!1;for(let{type:t,re:a}of n){let n=a.exec(i);if(n&&n[0].length>0){s(),r.push({type:t,value:n[0]}),i=i.slice(n[0].length),e=!0;break}}e||(o+=i[0],i=i.slice(1))}return s(),r}export{o as tokenize};
|
|
@@ -1,47 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import e from "./collapsible.module.js";
|
|
4
|
-
import { useId as t, useRef as n } from "react";
|
|
5
|
-
import { cn as r, useControllableSignal as i, useSignalEffect as a, useSignals as o } from "@cascivo/core";
|
|
6
|
-
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
|
-
//#region ../components/src/collapsible/collapsible.tsx
|
|
8
|
-
function l({ open: l, defaultOpen: u = !1, onOpenChange: d, trigger: f, disabled: p = !1, className: m, children: h }) {
|
|
9
|
-
o();
|
|
10
|
-
let [g, _] = i({
|
|
11
|
-
...l === void 0 ? {} : { value: l },
|
|
12
|
-
defaultValue: u,
|
|
13
|
-
...d ? { onChange: d } : {}
|
|
14
|
-
}), v = t(), y = `${v}-content`, b = `${v}-trigger`, x = n(null), S = g.value;
|
|
15
|
-
return a(() => {
|
|
16
|
-
let e = x.current;
|
|
17
|
-
e && e.open !== g.value && (e.open = g.value);
|
|
18
|
-
}), /* @__PURE__ */ c("details", {
|
|
19
|
-
ref: x,
|
|
20
|
-
open: S,
|
|
21
|
-
"data-state": S ? "open" : "closed",
|
|
22
|
-
className: r(e.root, m),
|
|
23
|
-
onToggle: (e) => {
|
|
24
|
-
let t = e.currentTarget;
|
|
25
|
-
t.open !== g.value && _(t.open), t.open !== g.value && (t.open = g.value);
|
|
26
|
-
},
|
|
27
|
-
children: [/* @__PURE__ */ s("summary", {
|
|
28
|
-
id: b,
|
|
29
|
-
"aria-controls": y,
|
|
30
|
-
...p ? { "aria-disabled": !0 } : {},
|
|
31
|
-
"data-state": S ? "open" : "closed",
|
|
32
|
-
className: e.trigger,
|
|
33
|
-
onClick: (e) => {
|
|
34
|
-
p && e.preventDefault();
|
|
35
|
-
},
|
|
36
|
-
children: f
|
|
37
|
-
}), /* @__PURE__ */ s("div", {
|
|
38
|
-
id: y,
|
|
39
|
-
role: "region",
|
|
40
|
-
"aria-labelledby": b,
|
|
41
|
-
className: e.content,
|
|
42
|
-
children: h
|
|
43
|
-
})]
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
//#endregion
|
|
47
|
-
export { l as Collapsible };
|
|
1
|
+
"use client";import e from"./collapsible.module.js";import{useId as t,useRef as n}from"react";import{cn as r,useControllableSignal as i,useSignalEffect as a,useSignals as o}from"@cascivo/core";import{jsx as s,jsxs as c}from"react/jsx-runtime";function l({open:l,defaultOpen:u=!1,onOpenChange:d,trigger:f,disabled:p=!1,className:m,children:h}){o();let[g,_]=i({...l===void 0?{}:{value:l},defaultValue:u,...d?{onChange:d}:{}}),v=t(),y=`${v}-content`,b=`${v}-trigger`,x=n(null),S=g.value;return a(()=>{let e=x.current;e&&e.open!==g.value&&(e.open=g.value)}),c(`details`,{ref:x,open:S,"data-state":S?`open`:`closed`,className:r(e.root,m),onToggle:e=>{let t=e.currentTarget;t.open!==g.value&&_(t.open),t.open!==g.value&&(t.open=g.value)},children:[s(`summary`,{id:b,"aria-controls":y,...p?{"aria-disabled":!0}:{},"data-state":S?`open`:`closed`,className:e.trigger,onClick:e=>{p&&e.preventDefault()},children:f}),s(`div`,{id:y,role:`region`,"aria-labelledby":b,className:e.content,children:h})]})}export{l as Collapsible};
|
|
@@ -1,8 +1,2 @@
|
|
|
1
1
|
import './collapsible.css';
|
|
2
|
-
var e
|
|
3
|
-
root: "_root_13r7c_2",
|
|
4
|
-
trigger: "_trigger_13r7c_6",
|
|
5
|
-
content: "_content_13r7c_69"
|
|
6
|
-
};
|
|
7
|
-
//#endregion
|
|
8
|
-
export { e as default };
|
|
2
|
+
var e={root:`_root_13r7c_2`,trigger:`_trigger_13r7c_6`,content:`_content_13r7c_69`};export{e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer cascivo.component{.
|
|
1
|
+
@layer cascivo.component{._wrapper_1tef2_2{gap:var(--cascivo-space-3);inline-size:fit-content;font-family:var(--cascivo-font-sans);flex-direction:column;display:flex}._wrapper_1tef2_2[data-disabled]{opacity:.5;pointer-events:none}._wrapper_1tef2_2[data-size=sm]{--cascivo-color-picker-area-size:9rem}._wrapper_1tef2_2[data-size=md]{--cascivo-color-picker-area-size:12rem}._wrapper_1tef2_2[data-size=lg]{--cascivo-color-picker-area-size:16rem}._label_1tef2_27{font-size:var(--cascivo-text-sm);font-weight:var(--cascivo-font-medium);color:var(--cascivo-color-text);line-height:var(--cascivo-leading-snug)}._srOnly_1tef2_34{clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;block-size:1px;inline-size:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}._area_1tef2_46{inline-size:var(--cascivo-color-picker-area-size,12rem);block-size:var(--cascivo-color-picker-area-size,12rem);border-radius:var(--cascivo-radius-md);cursor:crosshair;touch-action:none;background-image:linear-gradient(#0000,#000),linear-gradient(90deg,#fff,#0000);background-color:var(--cascivo-color-border);position:relative}._area_1tef2_46:has(._axis_1tef2_57:focus-visible){box-shadow:var(--cascivo-focus-ring);outline:none}._axis_1tef2_57{opacity:0;cursor:crosshair;appearance:none;block-size:100%;inline-size:100%;margin:0;position:absolute;inset:0}._thumb_1tef2_77{border-radius:var(--cascivo-radius-full);border:2px solid var(--cascivo-color-surface);block-size:.875rem;inline-size:.875rem;box-shadow:var(--cascivo-shadow-sm);pointer-events:none;position:absolute;transform:translate(-50%,-50%)}._sliders_1tef2_88{gap:var(--cascivo-space-2);flex-direction:column;display:flex}._slider_1tef2_88{appearance:none;border-radius:var(--cascivo-radius-full);cursor:pointer;block-size:.75rem;inline-size:100%}._slider_1tef2_88:focus-visible{box-shadow:var(--cascivo-focus-ring);outline:none}._slider_1tef2_88::-webkit-slider-thumb{appearance:none;border-radius:var(--cascivo-radius-full);background-color:var(--cascivo-color-surface);border:2px solid var(--cascivo-color-border-strong);block-size:1rem;inline-size:1rem;box-shadow:var(--cascivo-shadow-sm)}._slider_1tef2_88::-moz-range-thumb{border-radius:var(--cascivo-radius-full);background-color:var(--cascivo-color-surface);border:2px solid var(--cascivo-color-border-strong);block-size:1rem;inline-size:1rem;box-shadow:var(--cascivo-shadow-sm)}._hue_1tef2_126{background-image:linear-gradient(90deg,red 0%,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}._alpha_1tef2_139{background-color:#fff;background-image:linear-gradient(to right, transparent, var(--cascivo-color-picker-alpha-to,#000)), conic-gradient(#0000 .25turn, #ccc 0 .5turn, #0000 0 .75turn, #ccc 0);background-size:100% 100%,.5rem .5rem}._presets_1tef2_149{gap:var(--cascivo-space-2);flex-wrap:wrap;display:flex}._preset_1tef2_149{border-radius:var(--cascivo-radius-sm);border:1px solid var(--cascivo-color-border);cursor:pointer;block-size:1.5rem;inline-size:1.5rem;padding:0}._preset_1tef2_149:focus-visible{box-shadow:var(--cascivo-focus-ring);outline:none}._preset_1tef2_149[aria-pressed=true]{outline:2px solid var(--cascivo-color-accent);outline-offset:2px}._row_1tef2_174{align-items:center;gap:var(--cascivo-space-2);display:flex}._preview_1tef2_180{border-radius:var(--cascivo-radius-sm);border:1px solid var(--cascivo-color-border);flex-shrink:0;block-size:1.75rem;inline-size:1.75rem}._hex_1tef2_188{min-inline-size:0;font-family:var(--cascivo-font-mono);font-size:var(--cascivo-text-sm);padding-block:var(--cascivo-space-1);padding-inline:var(--cascivo-space-2);color:var(--cascivo-color-text);background-color:var(--cascivo-color-surface);border:1px solid var(--cascivo-color-border);border-radius:var(--cascivo-radius-control);flex:1}._hex_1tef2_188:focus-visible{box-shadow:var(--cascivo-focus-ring);outline:none}._eyedropper_1tef2_206{block-size:1.75rem;inline-size:1.75rem;color:var(--cascivo-color-text);background-color:var(--cascivo-color-surface);border:1px solid var(--cascivo-color-border);border-radius:var(--cascivo-radius-control);cursor:pointer;flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}._eyedropper_1tef2_206:hover{background-color:var(--cascivo-color-bg-subtle)}._eyedropper_1tef2_206:focus-visible{box-shadow:var(--cascivo-focus-ring);outline:none}@media (pointer:coarse){._preset_1tef2_149,._eyedropper_1tef2_206,._preview_1tef2_180{min-inline-size:var(--cascivo-target-min-coarse,2.75rem);min-block-size:var(--cascivo-target-min-coarse,2.75rem)}._slider_1tef2_88{block-size:1.5rem}._hex_1tef2_188{min-block-size:var(--cascivo-target-min-coarse,2.75rem)}}}@media (prefers-reduced-motion:reduce){._thumb_1tef2_77,._preset_1tef2_149,._eyedropper_1tef2_206{transition-duration:1ms}}@media (forced-colors:active){._preset_1tef2_149:focus-visible,._eyedropper_1tef2_206:focus-visible{outline-offset:2px;outline:2px solid highlight}._area_1tef2_46:has(._axis_1tef2_57:focus-visible){outline-offset:2px;outline:2px solid highlight}}
|
|
@@ -1,268 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import e from "./color-picker.module.js";
|
|
4
|
-
import { useId as t, useRef as n } from "react";
|
|
5
|
-
import { cn as r, useControllableSignal as i, useSignal as a, useSignalEffect as o, useSignals as s } from "@cascivo/core";
|
|
6
|
-
import { builtin as c, t as l } from "@cascivo/i18n";
|
|
7
|
-
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
8
|
-
//#region ../components/src/color-picker/color-picker.tsx
|
|
9
|
-
function p(e, t, n) {
|
|
10
|
-
return Math.min(n, Math.max(t, e));
|
|
11
|
-
}
|
|
12
|
-
function m(e) {
|
|
13
|
-
let t = e.trim().replace(/^#/, "");
|
|
14
|
-
t.length === 3 && (t = t[0] + t[0] + t[1] + t[1] + t[2] + t[2]), t.length === 4 && (t = t[0] + t[0] + t[1] + t[1] + t[2] + t[2] + t[3] + t[3]);
|
|
15
|
-
let n = parseInt(t.slice(0, 2), 16), r = parseInt(t.slice(2, 4), 16), i = parseInt(t.slice(4, 6), 16), a = t.length >= 8 ? parseInt(t.slice(6, 8), 16) / 255 : 1;
|
|
16
|
-
return Number.isNaN(n) || Number.isNaN(r) || Number.isNaN(i) ? {
|
|
17
|
-
r: 0,
|
|
18
|
-
g: 0,
|
|
19
|
-
b: 0,
|
|
20
|
-
a: 1
|
|
21
|
-
} : {
|
|
22
|
-
r: n,
|
|
23
|
-
g: r,
|
|
24
|
-
b: i,
|
|
25
|
-
a
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
function h({ r: e, g: t, b: n, a: r }, i) {
|
|
29
|
-
let a = (e) => p(Math.round(e), 0, 255).toString(16).padStart(2, "0"), o = `#${a(e)}${a(t)}${a(n)}`;
|
|
30
|
-
return !i || r >= 1 ? o : o + a(r * 255);
|
|
31
|
-
}
|
|
32
|
-
function g({ r: e, g: t, b: n, a: r }) {
|
|
33
|
-
let i = e / 255, a = t / 255, o = n / 255, s = Math.max(i, a, o), c = Math.min(i, a, o), l = s - c, u = 0;
|
|
34
|
-
l !== 0 && (u = s === i ? (a - o) / l % 6 : s === a ? (o - i) / l + 2 : (i - a) / l + 4, u *= 60, u < 0 && (u += 360));
|
|
35
|
-
let d = (s + c) / 2, f = l === 0 ? 0 : l / (1 - Math.abs(2 * d - 1));
|
|
36
|
-
return {
|
|
37
|
-
h: u,
|
|
38
|
-
s: f * 100,
|
|
39
|
-
l: d * 100,
|
|
40
|
-
a: r
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
function _({ h: e, s: t, l: n, a: r }) {
|
|
44
|
-
let i = t / 100, a = n / 100, o = (1 - Math.abs(2 * a - 1)) * i, s = o * (1 - Math.abs(e / 60 % 2 - 1)), c = a - o / 2, l = 0, u = 0, d = 0;
|
|
45
|
-
return e < 60 ? [l, u, d] = [
|
|
46
|
-
o,
|
|
47
|
-
s,
|
|
48
|
-
0
|
|
49
|
-
] : e < 120 ? [l, u, d] = [
|
|
50
|
-
s,
|
|
51
|
-
o,
|
|
52
|
-
0
|
|
53
|
-
] : e < 180 ? [l, u, d] = [
|
|
54
|
-
0,
|
|
55
|
-
o,
|
|
56
|
-
s
|
|
57
|
-
] : e < 240 ? [l, u, d] = [
|
|
58
|
-
0,
|
|
59
|
-
s,
|
|
60
|
-
o
|
|
61
|
-
] : e < 300 ? [l, u, d] = [
|
|
62
|
-
s,
|
|
63
|
-
0,
|
|
64
|
-
o
|
|
65
|
-
] : [l, u, d] = [
|
|
66
|
-
o,
|
|
67
|
-
0,
|
|
68
|
-
s
|
|
69
|
-
], {
|
|
70
|
-
r: (l + c) * 255,
|
|
71
|
-
g: (u + c) * 255,
|
|
72
|
-
b: (d + c) * 255,
|
|
73
|
-
a: r
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
function v({ value: v, defaultValue: y, onValueChange: b, presets: x, alpha: S = !0, label: C, disabled: w, size: T = "md", className: E, labels: D }) {
|
|
77
|
-
s();
|
|
78
|
-
let O = t(), [k, A] = i({
|
|
79
|
-
value: v,
|
|
80
|
-
defaultValue: y ?? "#3b82f6",
|
|
81
|
-
onChange: b
|
|
82
|
-
}), j = n(null), M = a(!1), N = g(m(k.value)), P = (e) => {
|
|
83
|
-
A(h(_(e), S));
|
|
84
|
-
}, F = (e, t) => {
|
|
85
|
-
let n = j.current;
|
|
86
|
-
if (!n) return;
|
|
87
|
-
let r = n.getBoundingClientRect(), i = p((e - r.left) / r.width, 0, 1), a = p((t - r.top) / r.height, 0, 1);
|
|
88
|
-
P({
|
|
89
|
-
h: N.h,
|
|
90
|
-
s: i * 100,
|
|
91
|
-
l: (1 - a) * 100,
|
|
92
|
-
a: N.a
|
|
93
|
-
});
|
|
94
|
-
};
|
|
95
|
-
o(() => {
|
|
96
|
-
if (!M.value) return;
|
|
97
|
-
let e = (e) => F(e.clientX, e.clientY), t = () => {
|
|
98
|
-
M.value = !1;
|
|
99
|
-
};
|
|
100
|
-
return window.addEventListener("pointermove", e), window.addEventListener("pointerup", t), () => {
|
|
101
|
-
window.removeEventListener("pointermove", e), window.removeEventListener("pointerup", t);
|
|
102
|
-
};
|
|
103
|
-
});
|
|
104
|
-
let I = (e) => {
|
|
105
|
-
let t = e.shiftKey ? 10 : 2, { s: n, l: r } = N;
|
|
106
|
-
if (e.key === "ArrowLeft") n -= t;
|
|
107
|
-
else if (e.key === "ArrowRight") n += t;
|
|
108
|
-
else if (e.key === "ArrowUp") r += t;
|
|
109
|
-
else if (e.key === "ArrowDown") r -= t;
|
|
110
|
-
else return;
|
|
111
|
-
e.preventDefault(), P({
|
|
112
|
-
h: N.h,
|
|
113
|
-
s: p(n, 0, 100),
|
|
114
|
-
l: p(r, 0, 100),
|
|
115
|
-
a: N.a
|
|
116
|
-
});
|
|
117
|
-
}, L = (e, t) => {
|
|
118
|
-
!x || x.length === 0 || A(x[(t + e + x.length) % x.length]);
|
|
119
|
-
}, R = typeof window < "u" ? window.EyeDropper : void 0, z = () => {
|
|
120
|
-
R && new R().open().then((e) => A(e.sRGBHex));
|
|
121
|
-
}, B = {
|
|
122
|
-
hue: D?.hue ?? l(c.colorPicker.hue),
|
|
123
|
-
alpha: D?.alpha ?? l(c.colorPicker.alpha),
|
|
124
|
-
colorArea: D?.colorArea ?? l(c.colorPicker.colorArea),
|
|
125
|
-
eyedropper: D?.eyedropper ?? l(c.colorPicker.eyedropper)
|
|
126
|
-
}, V = h(m(k.value), !1), H = `hsl(${N.h} 100% 50%)`;
|
|
127
|
-
return /* @__PURE__ */ f("div", {
|
|
128
|
-
className: r(e.picker, E),
|
|
129
|
-
"data-size": T,
|
|
130
|
-
"data-disabled": w || void 0,
|
|
131
|
-
children: [
|
|
132
|
-
C && /* @__PURE__ */ d("span", {
|
|
133
|
-
className: e.label,
|
|
134
|
-
id: `${O}-label`,
|
|
135
|
-
children: C
|
|
136
|
-
}),
|
|
137
|
-
/* @__PURE__ */ d("div", {
|
|
138
|
-
ref: j,
|
|
139
|
-
className: e.area,
|
|
140
|
-
role: "slider",
|
|
141
|
-
"aria-label": B.colorArea,
|
|
142
|
-
"aria-valuetext": V,
|
|
143
|
-
"aria-disabled": w || void 0,
|
|
144
|
-
tabIndex: w ? -1 : 0,
|
|
145
|
-
style: { background: H },
|
|
146
|
-
onPointerDown: (e) => {
|
|
147
|
-
w || (e.preventDefault(), M.value = !0, F(e.clientX, e.clientY));
|
|
148
|
-
},
|
|
149
|
-
onKeyDown: I,
|
|
150
|
-
children: /* @__PURE__ */ d("span", {
|
|
151
|
-
className: e.thumb,
|
|
152
|
-
style: {
|
|
153
|
-
insetInlineStart: `${N.s}%`,
|
|
154
|
-
insetBlockStart: `${100 - N.l}%`,
|
|
155
|
-
backgroundColor: V
|
|
156
|
-
}
|
|
157
|
-
})
|
|
158
|
-
}),
|
|
159
|
-
/* @__PURE__ */ f("div", {
|
|
160
|
-
className: e.sliders,
|
|
161
|
-
children: [
|
|
162
|
-
/* @__PURE__ */ d("label", {
|
|
163
|
-
className: e.srOnly,
|
|
164
|
-
htmlFor: `${O}-hue`,
|
|
165
|
-
children: B.hue
|
|
166
|
-
}),
|
|
167
|
-
/* @__PURE__ */ d("input", {
|
|
168
|
-
id: `${O}-hue`,
|
|
169
|
-
className: e.hue,
|
|
170
|
-
type: "range",
|
|
171
|
-
min: 0,
|
|
172
|
-
max: 360,
|
|
173
|
-
step: 1,
|
|
174
|
-
value: Math.round(N.h),
|
|
175
|
-
disabled: w,
|
|
176
|
-
"aria-label": B.hue,
|
|
177
|
-
onChange: (e) => P({
|
|
178
|
-
h: Number(e.target.value),
|
|
179
|
-
s: N.s,
|
|
180
|
-
l: N.l,
|
|
181
|
-
a: N.a
|
|
182
|
-
})
|
|
183
|
-
}),
|
|
184
|
-
S && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("label", {
|
|
185
|
-
className: e.srOnly,
|
|
186
|
-
htmlFor: `${O}-alpha`,
|
|
187
|
-
children: B.alpha
|
|
188
|
-
}), /* @__PURE__ */ d("input", {
|
|
189
|
-
id: `${O}-alpha`,
|
|
190
|
-
className: e.alpha,
|
|
191
|
-
type: "range",
|
|
192
|
-
min: 0,
|
|
193
|
-
max: 1,
|
|
194
|
-
step: .01,
|
|
195
|
-
value: N.a,
|
|
196
|
-
disabled: w,
|
|
197
|
-
"aria-label": B.alpha,
|
|
198
|
-
style: { "--cascivo-color-picker-solid": V },
|
|
199
|
-
onChange: (e) => P({
|
|
200
|
-
h: N.h,
|
|
201
|
-
s: N.s,
|
|
202
|
-
l: N.l,
|
|
203
|
-
a: Number(e.target.value)
|
|
204
|
-
})
|
|
205
|
-
})] })
|
|
206
|
-
]
|
|
207
|
-
}),
|
|
208
|
-
x && x.length > 0 && /* @__PURE__ */ d("div", {
|
|
209
|
-
className: e.presets,
|
|
210
|
-
role: "group",
|
|
211
|
-
"aria-label": B.colorArea,
|
|
212
|
-
children: x.map((t, n) => /* @__PURE__ */ d("button", {
|
|
213
|
-
type: "button",
|
|
214
|
-
className: e.preset,
|
|
215
|
-
style: { backgroundColor: t },
|
|
216
|
-
"aria-label": t,
|
|
217
|
-
"aria-pressed": t.toLowerCase() === k.value.toLowerCase(),
|
|
218
|
-
disabled: w,
|
|
219
|
-
onClick: () => A(t),
|
|
220
|
-
onKeyDown: (e) => {
|
|
221
|
-
e.key === "ArrowRight" ? (e.preventDefault(), L(1, n)) : e.key === "ArrowLeft" && (e.preventDefault(), L(-1, n));
|
|
222
|
-
}
|
|
223
|
-
}, t))
|
|
224
|
-
}),
|
|
225
|
-
/* @__PURE__ */ f("div", {
|
|
226
|
-
className: e.row,
|
|
227
|
-
children: [
|
|
228
|
-
/* @__PURE__ */ d("span", {
|
|
229
|
-
className: e.preview,
|
|
230
|
-
style: { backgroundColor: k.value },
|
|
231
|
-
"aria-hidden": "true"
|
|
232
|
-
}),
|
|
233
|
-
/* @__PURE__ */ d("input", {
|
|
234
|
-
className: e.text,
|
|
235
|
-
type: "text",
|
|
236
|
-
value: k.value,
|
|
237
|
-
disabled: w,
|
|
238
|
-
"aria-label": C ?? B.colorArea,
|
|
239
|
-
onChange: (e) => A(e.target.value)
|
|
240
|
-
}),
|
|
241
|
-
R && /* @__PURE__ */ d("button", {
|
|
242
|
-
type: "button",
|
|
243
|
-
className: e.eyedropper,
|
|
244
|
-
"aria-label": B.eyedropper,
|
|
245
|
-
disabled: w,
|
|
246
|
-
onClick: z,
|
|
247
|
-
children: /* @__PURE__ */ d("svg", {
|
|
248
|
-
width: "16",
|
|
249
|
-
height: "16",
|
|
250
|
-
viewBox: "0 0 24 24",
|
|
251
|
-
fill: "none",
|
|
252
|
-
"aria-hidden": "true",
|
|
253
|
-
children: /* @__PURE__ */ d("path", {
|
|
254
|
-
d: "m2 22 1-1h3l9-9M3 21v-3l9-9m1.5 1.5-2-2M19 2l3 3-9 9-3-3z",
|
|
255
|
-
stroke: "currentColor",
|
|
256
|
-
strokeWidth: "2",
|
|
257
|
-
strokeLinecap: "round",
|
|
258
|
-
strokeLinejoin: "round"
|
|
259
|
-
})
|
|
260
|
-
})
|
|
261
|
-
})
|
|
262
|
-
]
|
|
263
|
-
})
|
|
264
|
-
]
|
|
265
|
-
});
|
|
266
|
-
}
|
|
267
|
-
//#endregion
|
|
268
|
-
export { v as ColorPicker };
|
|
1
|
+
"use client";import{clamp as e,formatColor as t,hsvToRgb as n,parseColor as r,sameColor as i,toHex as a}from"./color.js";import o from"./color-picker.module.js";import{useId as ee,useRef as s}from"react";import{cn as c,useControllableSignal as l,useRovingFocus as u,useSignal as d,useSignalEffect as f,useSignals as p}from"@cascivo/core";import{builtin as m,t as h}from"@cascivo/i18n";import{jsx as g,jsxs as _}from"react/jsx-runtime";var v=`#3b82f6`;function y({id:y,value:b,defaultValue:x,onValueChange:te,presets:ne,alpha:S=!0,format:C=`hex`,label:w,ariaLabel:T,disabled:E=!1,name:D,size:O=`md`,className:k,labels:A,"aria-labelledby":j,"aria-describedby":M,"aria-invalid":N}){p();let P=ee(),F=y??`${P}-hex`,I=s(null),L=d(!1),[R,z]=l({value:b,defaultValue:x??v,onChange:te}),B=d(r(R.peek())??{h:217,s:76,v:96,a:1}),V=s(R.peek()),H=R.value;if(H!==V.current&&!i(H,V.current)){let e=r(H);e&&(B.value=e),V.current=H}let U=B.value,W=t(U,C,S),G=a(n({...U,a:1}),!1),K=a(n({h:U.h,s:100,v:100,a:1}),!1),q={hue:A?.hue??h(m.colorPicker.hue),alpha:A?.alpha??h(m.colorPicker.alpha),colorArea:A?.colorArea??h(m.colorPicker.colorArea),saturation:A?.saturation??h(m.colorPicker.saturation),brightness:A?.brightness??h(m.colorPicker.brightness),eyedropper:A?.eyedropper??h(m.colorPicker.eyedropper),presets:A?.presets??h(m.colorPicker.presets),hex:A?.hex??h(m.colorPicker.hex)};function J(e){B.value=e;let n=t(e,C,S);V.current=n,z(n)}function Y(t,n){let r=I.current;if(!r)return;let i=r.getBoundingClientRect();if(i.width===0||i.height===0)return;let a=e((t-i.left)/i.width,0,1),o=e((n-i.top)/i.height,0,1);J({...B.peek(),s:a*100,v:(1-o)*100})}f(()=>{if(!L.value)return;let e=e=>Y(e.clientX,e.clientY),t=()=>{L.value=!1};return window.addEventListener(`pointermove`,e),window.addEventListener(`pointerup`,t),()=>{window.removeEventListener(`pointermove`,e),window.removeEventListener(`pointerup`,t)}});let X=d(!1);f(()=>{X.value=typeof window<`u`&&typeof window.EyeDropper==`function`});async function re(){let e=window.EyeDropper;if(e)try{let t=r((await new e().open()).sRGBHex);t&&J({...t,a:B.peek().a})}catch{}}let Z=d(null),ie=Z.value??(C===`hex`?W:a(n(U),S));function Q(){let e=Z.peek();if(Z.value=null,e===null)return;let t=r(e);t&&J(S?t:{...t,a:1})}let $=ne??[],ae=u({orientation:`horizontal`,loop:!0});return _(`div`,{className:c(o.wrapper,k),"data-size":O,"data-disabled":E||void 0,children:[w&&g(`label`,{className:o.label,htmlFor:F,children:w}),_(`div`,{ref:I,role:`group`,"aria-label":q.colorArea,className:o.area,style:{background:K},onPointerDown:e=>{E||(e.preventDefault(),L.value=!0,Y(e.clientX,e.clientY))},children:[g(`input`,{type:`range`,className:o.axis,"aria-label":q.saturation,min:0,max:100,step:1,value:Math.round(U.s),disabled:E,"aria-valuetext":`${Math.round(U.s)}%`,onChange:e=>J({...B.peek(),s:Number(e.currentTarget.value)})}),g(`input`,{type:`range`,className:o.axis,"aria-label":q.brightness,min:0,max:100,step:1,value:Math.round(U.v),disabled:E,"aria-valuetext":`${Math.round(U.v)}%`,onChange:e=>J({...B.peek(),v:Number(e.currentTarget.value)})}),g(`span`,{className:o.thumb,style:{insetInlineStart:`${U.s}%`,insetBlockStart:`${100-U.v}%`,backgroundColor:G},"aria-hidden":`true`})]}),_(`div`,{className:o.sliders,children:[g(`input`,{type:`range`,className:c(o.slider,o.hue),"aria-label":q.hue,min:0,max:360,step:1,value:Math.round(U.h),disabled:E,onChange:e=>J({...B.peek(),h:Number(e.currentTarget.value)})}),S&&g(`input`,{type:`range`,className:c(o.slider,o.alpha),"aria-label":q.alpha,min:0,max:100,step:1,value:Math.round(U.a*100),disabled:E,"aria-valuetext":`${Math.round(U.a*100)}%`,style:{"--cascivo-color-picker-alpha-to":G},onChange:e=>J({...B.peek(),a:Number(e.currentTarget.value)/100})})]}),_(`div`,{className:o.row,children:[g(`span`,{className:o.preview,style:{backgroundColor:W},"aria-hidden":`true`}),g(`input`,{id:F,type:`text`,className:o.hex,value:ie,disabled:E,autoComplete:`off`,"aria-label":j?void 0:T??q.hex,"aria-labelledby":j,"aria-describedby":M,"aria-invalid":N,onChange:e=>{Z.value=e.currentTarget.value},onBlur:Q,onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),Q()):e.key===`Escape`&&(Z.value=null)}}),X.value&&g(`button`,{type:`button`,className:o.eyedropper,"aria-label":q.eyedropper,disabled:E,onClick:()=>void re(),children:g(`span`,{className:o.eyedropperGlyph,"aria-hidden":`true`})})]}),$.length>0&&g(`div`,{role:`group`,"aria-label":q.presets,className:o.presets,children:$.map((e,t)=>{let n=ae.getItemProps(t),a=i(e,W);return g(`button`,{ref:n.ref,type:`button`,className:o.preset,style:{backgroundColor:e},"aria-label":e,"aria-pressed":a,disabled:E,tabIndex:n.tabIndex,onKeyDown:n.onKeyDown,onFocus:n.onFocus,onClick:()=>{let t=r(e);t&&J(S?t:{...t,a:1})}},e)})}),D!==void 0&&g(`input`,{type:`hidden`,name:D,value:W}),g(`span`,{className:o.srOnly,role:`status`,"aria-live":`polite`,children:h(m.colorPicker.value,{color:W})})]})}export{y as ColorPicker};
|
|
@@ -1,19 +1,2 @@
|
|
|
1
1
|
import './color-picker.css';
|
|
2
|
-
var e
|
|
3
|
-
picker: "_picker_1ehlq_2",
|
|
4
|
-
label: "_label_1ehlq_27",
|
|
5
|
-
srOnly: "_srOnly_1ehlq_34",
|
|
6
|
-
area: "_area_1ehlq_46",
|
|
7
|
-
thumb: "_thumb_1ehlq_63",
|
|
8
|
-
sliders: "_sliders_1ehlq_74",
|
|
9
|
-
hue: "_hue_1ehlq_80",
|
|
10
|
-
alpha: "_alpha_1ehlq_81",
|
|
11
|
-
presets: "_presets_1ehlq_136",
|
|
12
|
-
preset: "_preset_1ehlq_136",
|
|
13
|
-
row: "_row_1ehlq_161",
|
|
14
|
-
preview: "_preview_1ehlq_167",
|
|
15
|
-
text: "_text_1ehlq_175",
|
|
16
|
-
eyedropper: "_eyedropper_1ehlq_193"
|
|
17
|
-
};
|
|
18
|
-
//#endregion
|
|
19
|
-
export { e as default };
|
|
2
|
+
var e={wrapper:`_wrapper_1tef2_2`,label:`_label_1tef2_27`,srOnly:`_srOnly_1tef2_34`,area:`_area_1tef2_46`,axis:`_axis_1tef2_57`,thumb:`_thumb_1tef2_77`,sliders:`_sliders_1tef2_88`,slider:`_slider_1tef2_88`,hue:`_hue_1tef2_126`,alpha:`_alpha_1tef2_139`,presets:`_presets_1tef2_149`,preset:`_preset_1tef2_149`,row:`_row_1tef2_174`,preview:`_preview_1tef2_180`,hex:`_hex_1tef2_188`,eyedropper:`_eyedropper_1tef2_206`};export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,t,n){return Math.min(n,Math.max(t,e))}function t(e){let t=e.trim().replace(/^#/,``);if(!/^(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(t))return null;let n=(e=>e.length<=4?e.split(``).map(e=>e+e).join(``):e)(t);return{r:parseInt(n.slice(0,2),16),g:parseInt(n.slice(2,4),16),b:parseInt(n.slice(4,6),16),a:n.length>=8?parseInt(n.slice(6,8),16)/255:1}}function n({r:t,g:n,b:r,a:i},a){let o=t=>e(Math.round(t),0,255).toString(16).padStart(2,`0`),s=`#${o(t)}${o(n)}${o(r)}`;return a?s+o(i*255):s}function r({r:t,g:n,b:r,a:i},o){let s=t=>e(Math.round(t),0,255),c=`${s(t)} ${s(n)} ${s(r)}`;return o?`rgb(${c} / ${a(i,2)})`:`rgb(${c})`}function i(e,t){let{h:n,s:r,l:i}=c(e),o=`${Math.round(n)} ${Math.round(r)}% ${Math.round(i)}%`;return t?`hsl(${o} / ${a(e.a,2)})`:`hsl(${o})`}function a(e,t){let n=10**t;return Math.round(e*n)/n}function o({r:e,g:t,b:n,a:r}){let i=e/255,a=t/255,o=n/255,s=Math.max(i,a,o),c=s-Math.min(i,a,o),l=0;return c!==0&&(l=s===i?(a-o)/c%6:s===a?(o-i)/c+2:(i-a)/c+4,l*=60,l<0&&(l+=360)),{h:l,s:s===0?0:c/s*100,v:s*100,a:r}}function s({h:t,s:n,v:r,a:i}){let a=e(n,0,100)/100,o=e(r,0,100)/100,s=(t%360+360)%360,c=o*a,l=c*(1-Math.abs(s/60%2-1)),u=o-c,d=0,f=0,p=0;return s<60?[d,f,p]=[c,l,0]:s<120?[d,f,p]=[l,c,0]:s<180?[d,f,p]=[0,c,l]:s<240?[d,f,p]=[0,l,c]:s<300?[d,f,p]=[l,0,c]:[d,f,p]=[c,0,l],{r:(d+u)*255,g:(f+u)*255,b:(p+u)*255,a:i}}function c({h:t,s:n,v:r,a:i}){let a=e(n,0,100)/100,o=e(r,0,100)/100,s=o*(1-a/2);return{h:t,s:(s===0||s===1?0:(o-s)/Math.min(s,1-s))*100,l:s*100,a:i}}function l(e,t,a){return t===`rgb`?r(s(e),a):t===`hsl`?i(e,a):n(s(e),a)}function u(e){let n=e.trim(),r=/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)(?:\s*[/,]\s*([\d.%]+))?\s*\)$/i.exec(n);if(r)return o({r:Number(r[1]),g:Number(r[2]),b:Number(r[3]),a:d(r[4])});let i=/^hsla?\(\s*([\d.]+)(?:deg)?[\s,]+([\d.]+)%[\s,]+([\d.]+)%(?:\s*[/,]\s*([\d.%]+))?\s*\)$/i.exec(n);if(i)return f(Number(i[1]),Number(i[2]),Number(i[3]),d(i[4]));let a=t(n);return a?o(a):null}function d(t){if(t===void 0)return 1;let n=t.endsWith(`%`)?Number(t.slice(0,-1))/100:Number(t);return Number.isNaN(n)?1:e(n,0,1)}function f(t,n,r,i){let a=e(n,0,100)/100,o=e(r,0,100)/100,s=o+a*Math.min(o,1-o);return{h:t,s:s===0?0:2*(1-o/s)*100,v:s*100,a:i}}function p(e,t){let n=u(e),r=u(t);if(!n||!r)return!1;let i=s(n),a=s(r);return Math.round(i.r)===Math.round(a.r)&&Math.round(i.g)===Math.round(a.g)&&Math.round(i.b)===Math.round(a.b)&&Math.round(i.a*255)===Math.round(a.a*255)}export{e as clamp,l as formatColor,s as hsvToRgb,u as parseColor,p as sameColor,n as toHex};
|