@cascivo/react 0.18.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -7
- package/dist/accordion/accordion.js +1 -114
- package/dist/accordion/accordion.module.js +1 -10
- package/dist/action-sheet/action-sheet.css +1 -1
- package/dist/action-sheet/action-sheet.js +1 -91
- package/dist/action-sheet/action-sheet.module.js +1 -12
- package/dist/alert/alert.js +1 -55
- package/dist/alert/alert.module.js +1 -11
- package/dist/alert-dialog/alert-dialog.css +1 -1
- package/dist/alert-dialog/alert-dialog.js +1 -66
- package/dist/alert-dialog/alert-dialog.module.js +1 -11
- package/dist/app-shell/app-shell.css +1 -1
- package/dist/app-shell/app-shell.js +1 -85
- package/dist/app-shell/app-shell.module.js +1 -12
- package/dist/aspect-ratio/aspect-ratio.js +1 -20
- package/dist/aspect-ratio/aspect-ratio.module.js +1 -6
- package/dist/avatar/avatar.js +1 -57
- package/dist/avatar/avatar.module.js +1 -8
- package/dist/avatar-group/avatar-group.js +1 -24
- package/dist/avatar-group/avatar-group.module.js +1 -6
- package/dist/badge/badge.js +1 -22
- package/dist/badge/badge.module.js +1 -3
- package/dist/blockquote/blockquote.js +1 -16
- package/dist/blockquote/blockquote.module.js +1 -6
- package/dist/bottom-sheet/bottom-sheet.js +1 -111
- package/dist/bottom-sheet/bottom-sheet.module.js +1 -14
- package/dist/brand/logo/logo.css +1 -0
- package/dist/brand/logo/logo.js +1 -0
- package/dist/brand/logo/logo.module.js +2 -0
- package/dist/breadcrumb/breadcrumb.js +1 -28
- package/dist/breadcrumb/breadcrumb.module.js +1 -3
- package/dist/button/button.css +1 -1
- package/dist/button/button.js +1 -35
- package/dist/button/button.module.js +1 -6
- package/dist/button-group/button-group.js +1 -39
- package/dist/button-group/button-group.module.js +1 -3
- package/dist/calendar/calendar-date.js +1 -0
- package/dist/calendar/calendar.css +1 -1
- package/dist/calendar/calendar.js +1 -199
- package/dist/calendar/calendar.module.js +1 -14
- package/dist/card/card.js +1 -53
- package/dist/card/card.module.js +1 -12
- package/dist/carousel/carousel.css +1 -1
- package/dist/carousel/carousel.js +1 -138
- package/dist/carousel/carousel.module.js +1 -13
- package/dist/chat-bubble/chat-bubble.js +1 -31
- package/dist/chat-bubble/chat-bubble.module.js +1 -11
- package/dist/checkbox/checkbox.js +1 -38
- package/dist/checkbox/checkbox.module.js +1 -8
- package/dist/checkbox-card/checkbox-card.css +1 -1
- package/dist/checkbox-card/checkbox-card.js +1 -50
- package/dist/checkbox-card/checkbox-card.module.js +1 -11
- package/dist/code/code.js +1 -14
- package/dist/code/code.module.js +1 -3
- package/dist/code-snippet/code-snippet.js +2 -121
- package/dist/code-snippet/code-snippet.module.js +1 -17
- package/dist/code-snippet/highlight.js +1 -67
- package/dist/collapsible/collapsible.js +1 -47
- package/dist/collapsible/collapsible.module.js +1 -7
- package/dist/color-picker/color-picker.css +1 -1
- package/dist/color-picker/color-picker.js +1 -268
- package/dist/color-picker/color-picker.module.js +1 -18
- package/dist/color-picker/color.js +1 -0
- package/dist/combobox/combobox.css +1 -1
- package/dist/combobox/combobox.js +1 -165
- package/dist/combobox/combobox.module.js +1 -19
- package/dist/combobox/list-nav.js +1 -0
- package/dist/combobox/option-list.js +1 -0
- package/dist/command-menu/command-menu.js +1 -421
- package/dist/command-menu/command-menu.module.js +1 -34
- package/dist/comparison/comparison.js +1 -69
- package/dist/comparison/comparison.module.js +1 -9
- package/dist/contained-list/contained-list.js +1 -41
- package/dist/contained-list/contained-list.module.js +1 -11
- package/dist/context-menu/context-menu.js +1 -93
- package/dist/context-menu/context-menu.module.js +1 -7
- package/dist/copy-button/copy-button.js +1 -60
- package/dist/copy-button/copy-button.module.js +1 -6
- package/dist/data-list/data-list.js +1 -25
- package/dist/data-list/data-list.module.js +1 -8
- package/dist/data-table/column-filter.js +1 -0
- package/dist/data-table/column-layout.js +1 -0
- package/dist/data-table/data-table.css +1 -1
- package/dist/data-table/data-table.js +1 -371
- package/dist/data-table/data-table.module.js +1 -33
- package/dist/data-table/grid-keys.js +1 -0
- package/dist/data-table/row-group.js +1 -0
- package/dist/data-table/row-search.js +1 -0
- package/dist/data-table/row-sort.js +1 -0
- package/dist/data-table/to-csv.js +3 -0
- package/dist/data-table/virtual-window.js +1 -0
- package/dist/date-picker/date-picker.css +1 -1
- package/dist/date-picker/date-picker.js +1 -219
- package/dist/date-picker/date-picker.module.js +1 -23
- package/dist/date-picker/parse-date.js +1 -0
- package/dist/date-range-picker/date-range-picker.js +1 -196
- package/dist/date-range-picker/date-range-picker.module.js +1 -18
- package/dist/dock/dock.css +1 -1
- package/dist/dock/dock.js +1 -34
- package/dist/dock/dock.module.js +1 -8
- package/dist/drawer/drawer.js +1 -96
- package/dist/drawer/drawer.module.js +1 -13
- package/dist/dropdown/dropdown.css +1 -1
- package/dist/dropdown/dropdown.js +1 -107
- package/dist/dropdown/dropdown.module.js +1 -9
- package/dist/editable/editable.js +1 -67
- package/dist/editable/editable.module.js +1 -11
- package/dist/empty-state/empty-state.js +1 -32
- package/dist/empty-state/empty-state.module.js +1 -9
- package/dist/fab/fab.css +1 -1
- package/dist/fab/fab.js +1 -93
- package/dist/fab/fab.module.js +1 -12
- package/dist/field/field.css +1 -1
- package/dist/field/field.js +1 -46
- package/dist/field/field.module.js +1 -7
- package/dist/file-uploader/file-uploader.css +1 -1
- package/dist/file-uploader/file-uploader.js +1 -122
- package/dist/file-uploader/file-uploader.module.js +1 -18
- package/dist/filter/filter.css +1 -1
- package/dist/filter/filter.js +1 -35
- package/dist/filter/filter.module.js +1 -6
- package/dist/form/form.js +1 -95
- package/dist/form/form.module.js +1 -3
- package/dist/header/header.js +1 -44
- package/dist/header/header.module.js +1 -11
- package/dist/header-panel/header-panel.js +1 -72
- package/dist/header-panel/header-panel.module.js +1 -9
- package/dist/heading/heading.css +1 -1
- package/dist/heading/heading.js +1 -22
- package/dist/heading/heading.module.js +1 -3
- package/dist/hover-card/hover-card.css +1 -1
- package/dist/hover-card/hover-card.js +1 -84
- package/dist/hover-card/hover-card.module.js +1 -6
- package/dist/icon-button/icon-button.js +1 -19
- package/dist/icon-button/icon-button.module.js +1 -3
- package/dist/image/image.css +1 -1
- package/dist/image/image.js +1 -64
- package/dist/image/image.module.js +1 -9
- package/dist/index.d.ts +2084 -120
- package/dist/indicator/indicator.js +1 -16
- package/dist/indicator/indicator.module.js +1 -6
- package/dist/infinite-scroll/infinite-scroll.js +1 -49
- package/dist/infinite-scroll/infinite-scroll.module.js +1 -7
- package/dist/inline-loading/inline-loading.js +1 -74
- package/dist/inline-loading/inline-loading.module.js +1 -9
- package/dist/input/input.css +1 -1
- package/dist/input/input.js +1 -55
- package/dist/input/input.module.js +1 -9
- package/dist/input-group/input-group.css +1 -1
- package/dist/input-group/input-group.js +1 -39
- package/dist/input-group/input-group.module.js +1 -9
- package/dist/item/item.js +1 -50
- package/dist/item/item.module.js +1 -10
- package/dist/join/join.js +1 -12
- package/dist/join/join.module.js +1 -3
- package/dist/kbd/kbd.js +1 -14
- package/dist/kbd/kbd.module.js +1 -3
- package/dist/label/label.js +1 -23
- package/dist/label/label.module.js +1 -7
- package/dist/large-title-header/large-title-header.js +1 -38
- package/dist/large-title-header/large-title-header.module.js +1 -12
- package/dist/layouts/src/auto-grid/auto-grid.js +1 -17
- package/dist/layouts/src/auto-grid/auto-grid.module.js +1 -4
- package/dist/layouts/src/center/center.js +1 -16
- package/dist/layouts/src/center/center.module.js +1 -3
- package/dist/layouts/src/columns/columns.js +1 -21
- package/dist/layouts/src/columns/columns.module.js +1 -6
- package/dist/layouts/src/flex/flex.js +1 -20
- package/dist/layouts/src/flex/flex.module.js +1 -3
- package/dist/layouts/src/grid/grid.css +1 -1
- package/dist/layouts/src/grid/grid.js +1 -55
- package/dist/layouts/src/grid/grid.module.js +1 -7
- package/dist/layouts/src/page-header/page-header.js +1 -31
- package/dist/layouts/src/page-header/page-header.module.js +1 -10
- package/dist/layouts/src/spacer/spacer.js +1 -17
- package/dist/layouts/src/spacer/spacer.module.js +1 -3
- package/dist/link/link.css +1 -1
- package/dist/link/link.js +1 -22
- package/dist/link/link.module.js +1 -3
- package/dist/list/list.js +1 -21
- package/dist/list/list.module.js +1 -6
- package/dist/log-viewer/log-viewer.css +1 -1
- package/dist/log-viewer/log-viewer.js +2 -184
- package/dist/log-viewer/log-viewer.module.js +1 -16
- package/dist/menu/menu.js +1 -126
- package/dist/menu/menu.module.js +1 -8
- package/dist/menu-button/menu-button.js +1 -92
- package/dist/menu-button/menu-button.module.js +1 -8
- package/dist/menubar/menubar.js +1 -103
- package/dist/menubar/menubar.module.js +1 -8
- package/dist/modal/modal.css +1 -1
- package/dist/modal/modal.js +1 -76
- package/dist/modal/modal.module.js +1 -12
- package/dist/multi-select/list-nav.js +1 -0
- package/dist/multi-select/multi-select.css +1 -1
- package/dist/multi-select/multi-select.js +1 -106
- package/dist/multi-select/multi-select.module.js +1 -15
- package/dist/multi-select/option-list.js +1 -0
- package/dist/native-select/native-select.css +1 -1
- package/dist/native-select/native-select.js +1 -37
- package/dist/native-select/native-select.module.js +1 -7
- package/dist/navigation-menu/navigation-menu.js +1 -99
- package/dist/navigation-menu/navigation-menu.module.js +1 -10
- package/dist/node/accordion/accordion.js +1 -114
- package/dist/node/accordion/accordion.module.js +1 -10
- package/dist/node/action-sheet/action-sheet.js +1 -91
- package/dist/node/action-sheet/action-sheet.module.js +1 -12
- package/dist/node/alert/alert.js +1 -55
- package/dist/node/alert/alert.module.js +1 -11
- package/dist/node/alert-dialog/alert-dialog.js +1 -66
- package/dist/node/alert-dialog/alert-dialog.module.js +1 -11
- package/dist/node/app-shell/app-shell.js +1 -85
- package/dist/node/app-shell/app-shell.module.js +1 -12
- package/dist/node/aspect-ratio/aspect-ratio.js +1 -20
- package/dist/node/aspect-ratio/aspect-ratio.module.js +1 -6
- package/dist/node/avatar/avatar.js +1 -57
- package/dist/node/avatar/avatar.module.js +1 -8
- package/dist/node/avatar-group/avatar-group.js +1 -24
- package/dist/node/avatar-group/avatar-group.module.js +1 -6
- package/dist/node/badge/badge.js +1 -22
- package/dist/node/badge/badge.module.js +1 -3
- package/dist/node/blockquote/blockquote.js +1 -16
- package/dist/node/blockquote/blockquote.module.js +1 -6
- package/dist/node/bottom-sheet/bottom-sheet.js +1 -111
- package/dist/node/bottom-sheet/bottom-sheet.module.js +1 -14
- package/dist/node/brand/logo/logo.js +1 -0
- package/dist/node/brand/logo/logo.module.js +1 -0
- package/dist/node/breadcrumb/breadcrumb.js +1 -28
- package/dist/node/breadcrumb/breadcrumb.module.js +1 -3
- package/dist/node/button/button.js +1 -35
- package/dist/node/button/button.module.js +1 -6
- package/dist/node/button-group/button-group.js +1 -39
- package/dist/node/button-group/button-group.module.js +1 -3
- package/dist/node/calendar/calendar-date.js +1 -0
- package/dist/node/calendar/calendar.js +1 -199
- package/dist/node/calendar/calendar.module.js +1 -14
- package/dist/node/card/card.js +1 -53
- package/dist/node/card/card.module.js +1 -12
- package/dist/node/carousel/carousel.js +1 -138
- package/dist/node/carousel/carousel.module.js +1 -13
- package/dist/node/chat-bubble/chat-bubble.js +1 -31
- package/dist/node/chat-bubble/chat-bubble.module.js +1 -11
- package/dist/node/checkbox/checkbox.js +1 -38
- package/dist/node/checkbox/checkbox.module.js +1 -8
- package/dist/node/checkbox-card/checkbox-card.js +1 -50
- package/dist/node/checkbox-card/checkbox-card.module.js +1 -11
- package/dist/node/code/code.js +1 -14
- package/dist/node/code/code.module.js +1 -3
- package/dist/node/code-snippet/code-snippet.js +2 -121
- package/dist/node/code-snippet/code-snippet.module.js +1 -17
- package/dist/node/code-snippet/highlight.js +1 -67
- package/dist/node/collapsible/collapsible.js +1 -47
- package/dist/node/collapsible/collapsible.module.js +1 -7
- package/dist/node/color-picker/color-picker.js +1 -268
- package/dist/node/color-picker/color-picker.module.js +1 -18
- package/dist/node/color-picker/color.js +1 -0
- package/dist/node/combobox/combobox.js +1 -165
- package/dist/node/combobox/combobox.module.js +1 -19
- package/dist/node/combobox/list-nav.js +1 -0
- package/dist/node/combobox/option-list.js +1 -0
- package/dist/node/command-menu/command-menu.js +1 -421
- package/dist/node/command-menu/command-menu.module.js +1 -34
- package/dist/node/comparison/comparison.js +1 -69
- package/dist/node/comparison/comparison.module.js +1 -9
- package/dist/node/contained-list/contained-list.js +1 -41
- package/dist/node/contained-list/contained-list.module.js +1 -11
- package/dist/node/context-menu/context-menu.js +1 -93
- package/dist/node/context-menu/context-menu.module.js +1 -7
- package/dist/node/copy-button/copy-button.js +1 -60
- package/dist/node/copy-button/copy-button.module.js +1 -6
- package/dist/node/data-list/data-list.js +1 -25
- package/dist/node/data-list/data-list.module.js +1 -8
- package/dist/node/data-table/column-filter.js +1 -0
- package/dist/node/data-table/column-layout.js +1 -0
- package/dist/node/data-table/data-table.js +1 -371
- package/dist/node/data-table/data-table.module.js +1 -33
- package/dist/node/data-table/grid-keys.js +1 -0
- package/dist/node/data-table/row-group.js +1 -0
- package/dist/node/data-table/row-search.js +1 -0
- package/dist/node/data-table/row-sort.js +1 -0
- package/dist/node/data-table/to-csv.js +3 -0
- package/dist/node/data-table/virtual-window.js +1 -0
- package/dist/node/date-picker/date-picker.js +1 -219
- package/dist/node/date-picker/date-picker.module.js +1 -23
- package/dist/node/date-picker/parse-date.js +1 -0
- package/dist/node/date-range-picker/date-range-picker.js +1 -196
- package/dist/node/date-range-picker/date-range-picker.module.js +1 -18
- package/dist/node/dock/dock.js +1 -34
- package/dist/node/dock/dock.module.js +1 -8
- package/dist/node/drawer/drawer.js +1 -96
- package/dist/node/drawer/drawer.module.js +1 -13
- package/dist/node/dropdown/dropdown.js +1 -107
- package/dist/node/dropdown/dropdown.module.js +1 -9
- package/dist/node/editable/editable.js +1 -67
- package/dist/node/editable/editable.module.js +1 -11
- package/dist/node/empty-state/empty-state.js +1 -32
- package/dist/node/empty-state/empty-state.module.js +1 -9
- package/dist/node/fab/fab.js +1 -93
- package/dist/node/fab/fab.module.js +1 -12
- package/dist/node/field/field.js +1 -46
- package/dist/node/field/field.module.js +1 -7
- package/dist/node/file-uploader/file-uploader.js +1 -122
- package/dist/node/file-uploader/file-uploader.module.js +1 -18
- package/dist/node/filter/filter.js +1 -35
- package/dist/node/filter/filter.module.js +1 -6
- package/dist/node/form/form.js +1 -95
- package/dist/node/form/form.module.js +1 -3
- package/dist/node/header/header.js +1 -44
- package/dist/node/header/header.module.js +1 -11
- package/dist/node/header-panel/header-panel.js +1 -72
- package/dist/node/header-panel/header-panel.module.js +1 -9
- package/dist/node/heading/heading.js +1 -22
- package/dist/node/heading/heading.module.js +1 -3
- package/dist/node/hover-card/hover-card.js +1 -84
- package/dist/node/hover-card/hover-card.module.js +1 -6
- package/dist/node/icon-button/icon-button.js +1 -19
- package/dist/node/icon-button/icon-button.module.js +1 -3
- package/dist/node/image/image.js +1 -64
- package/dist/node/image/image.module.js +1 -9
- package/dist/node/indicator/indicator.js +1 -16
- package/dist/node/indicator/indicator.module.js +1 -6
- package/dist/node/infinite-scroll/infinite-scroll.js +1 -49
- package/dist/node/infinite-scroll/infinite-scroll.module.js +1 -7
- package/dist/node/inline-loading/inline-loading.js +1 -74
- package/dist/node/inline-loading/inline-loading.module.js +1 -9
- package/dist/node/input/input.js +1 -55
- package/dist/node/input/input.module.js +1 -9
- package/dist/node/input-group/input-group.js +1 -39
- package/dist/node/input-group/input-group.module.js +1 -9
- package/dist/node/item/item.js +1 -50
- package/dist/node/item/item.module.js +1 -10
- package/dist/node/join/join.js +1 -12
- package/dist/node/join/join.module.js +1 -3
- package/dist/node/kbd/kbd.js +1 -14
- package/dist/node/kbd/kbd.module.js +1 -3
- package/dist/node/label/label.js +1 -23
- package/dist/node/label/label.module.js +1 -7
- package/dist/node/large-title-header/large-title-header.js +1 -38
- package/dist/node/large-title-header/large-title-header.module.js +1 -12
- package/dist/node/layouts/src/auto-grid/auto-grid.js +1 -17
- package/dist/node/layouts/src/auto-grid/auto-grid.module.js +1 -4
- package/dist/node/layouts/src/center/center.js +1 -16
- package/dist/node/layouts/src/center/center.module.js +1 -3
- package/dist/node/layouts/src/columns/columns.js +1 -21
- package/dist/node/layouts/src/columns/columns.module.js +1 -6
- package/dist/node/layouts/src/flex/flex.js +1 -20
- package/dist/node/layouts/src/flex/flex.module.js +1 -3
- package/dist/node/layouts/src/grid/grid.js +1 -55
- package/dist/node/layouts/src/grid/grid.module.js +1 -7
- package/dist/node/layouts/src/page-header/page-header.js +1 -31
- package/dist/node/layouts/src/page-header/page-header.module.js +1 -10
- package/dist/node/layouts/src/spacer/spacer.js +1 -17
- package/dist/node/layouts/src/spacer/spacer.module.js +1 -3
- package/dist/node/link/link.js +1 -22
- package/dist/node/link/link.module.js +1 -3
- package/dist/node/list/list.js +1 -21
- package/dist/node/list/list.module.js +1 -6
- package/dist/node/log-viewer/log-viewer.js +2 -184
- package/dist/node/log-viewer/log-viewer.module.js +1 -16
- package/dist/node/menu/menu.js +1 -126
- package/dist/node/menu/menu.module.js +1 -8
- package/dist/node/menu-button/menu-button.js +1 -92
- package/dist/node/menu-button/menu-button.module.js +1 -8
- package/dist/node/menubar/menubar.js +1 -103
- package/dist/node/menubar/menubar.module.js +1 -8
- package/dist/node/modal/modal.js +1 -76
- package/dist/node/modal/modal.module.js +1 -12
- package/dist/node/multi-select/list-nav.js +1 -0
- package/dist/node/multi-select/multi-select.js +1 -106
- package/dist/node/multi-select/multi-select.module.js +1 -15
- package/dist/node/multi-select/option-list.js +1 -0
- package/dist/node/native-select/native-select.js +1 -37
- package/dist/node/native-select/native-select.module.js +1 -7
- package/dist/node/navigation-menu/navigation-menu.js +1 -99
- package/dist/node/navigation-menu/navigation-menu.module.js +1 -10
- package/dist/node/notification/notification.js +1 -140
- package/dist/node/notification/notification.module.js +1 -11
- package/dist/node/number-input/number-input.js +1 -147
- package/dist/node/number-input/number-input.module.js +1 -12
- package/dist/node/otp-input/otp-input.js +1 -70
- package/dist/node/otp-input/otp-input.module.js +1 -6
- package/dist/node/overflow-menu/overflow-menu.js +1 -70
- package/dist/node/overflow-menu/overflow-menu.module.js +1 -7
- package/dist/node/pagination/pagination.js +1 -92
- package/dist/node/pagination/pagination.module.js +1 -11
- package/dist/node/password-input/password-input.js +1 -81
- package/dist/node/password-input/password-input.module.js +1 -11
- package/dist/node/popover/popover.js +1 -51
- package/dist/node/popover/popover.module.js +1 -6
- package/dist/node/popover/use-popover.js +1 -55
- package/dist/node/progress/progress.js +1 -16
- package/dist/node/progress/progress.module.js +1 -6
- package/dist/node/progress-bar/progress-bar.js +1 -42
- package/dist/node/progress-bar/progress-bar.module.js +1 -11
- package/dist/node/progress-circle/progress-circle.js +1 -46
- package/dist/node/progress-circle/progress-circle.module.js +1 -9
- package/dist/node/progress-indicator/progress-indicator.js +1 -34
- package/dist/node/progress-indicator/progress-indicator.module.js +1 -10
- package/dist/node/prose/prose.js +1 -13
- package/dist/node/prose/prose.module.js +1 -3
- package/dist/node/pull-to-refresh/pull-to-refresh.js +1 -82
- package/dist/node/pull-to-refresh/pull-to-refresh.module.js +1 -9
- package/dist/node/qr-code/encode.js +1 -583
- package/dist/node/qr-code/qr-code.js +1 -41
- package/dist/node/qr-code/qr-code.module.js +1 -6
- package/dist/node/radial-progress/radial-progress.js +1 -27
- package/dist/node/radial-progress/radial-progress.module.js +1 -6
- package/dist/node/radio/radio.js +1 -48
- package/dist/node/radio/radio.module.js +1 -9
- package/dist/node/radio-card/radio-card.js +1 -64
- package/dist/node/radio-card/radio-card.module.js +1 -11
- package/dist/node/rating-group/rating-group.js +1 -37
- package/dist/node/rating-group/rating-group.module.js +1 -6
- package/dist/node/react/src/index.js +1 -141
- package/dist/node/relative-time/relative-time.js +1 -66
- package/dist/node/relative-time/relative-time.module.js +1 -3
- package/dist/node/reorder-list/reorder-list.js +1 -143
- package/dist/node/reorder-list/reorder-list.module.js +1 -11
- package/dist/node/resizable/resizable.js +1 -80
- package/dist/node/resizable/resizable.module.js +1 -8
- package/dist/node/scroll-area/scroll-area.js +1 -38
- package/dist/node/scroll-area/scroll-area.module.js +1 -3
- package/dist/node/search/search.js +1 -92
- package/dist/node/search/search.module.js +1 -9
- package/dist/node/segmented-control/segmented-control.js +1 -43
- package/dist/node/segmented-control/segmented-control.module.js +1 -6
- package/dist/node/select/select.js +1 -72
- package/dist/node/select/select.module.js +1 -11
- package/dist/node/separator/separator.js +1 -19
- package/dist/node/separator/separator.module.js +1 -3
- package/dist/node/sheet/sheet.js +1 -49
- package/dist/node/sheet/sheet.module.js +1 -9
- package/dist/node/shell-header/shell-header.js +1 -169
- package/dist/node/shell-header/shell-header.module.js +1 -24
- package/dist/node/side-nav/side-nav.js +1 -334
- package/dist/node/side-nav/side-nav.module.js +1 -31
- package/dist/node/skeleton/skeleton.js +1 -23
- package/dist/node/skeleton/skeleton.module.js +1 -7
- package/dist/node/skip-nav/skip-nav.js +1 -28
- package/dist/node/skip-nav/skip-nav.module.js +1 -3
- package/dist/node/slider/slider.js +1 -29
- package/dist/node/slider/slider.module.js +1 -7
- package/dist/node/spinner/spinner.js +1 -18
- package/dist/node/spinner/spinner.module.js +1 -6
- package/dist/node/stack/stack.js +1 -17
- package/dist/node/stack/stack.module.js +1 -6
- package/dist/node/stat/stat.js +1 -41
- package/dist/node/stat/stat.module.js +1 -11
- package/dist/node/status/status.js +1 -25
- package/dist/node/status/status.module.js +1 -7
- package/dist/node/steps/steps.js +1 -35
- package/dist/node/steps/steps.module.js +1 -8
- package/dist/node/structured-list/structured-list.js +1 -102
- package/dist/node/structured-list/structured-list.module.js +1 -12
- package/dist/node/swap/swap.js +1 -36
- package/dist/node/swap/swap.module.js +1 -7
- package/dist/node/swipe-item/swipe-item.js +1 -62
- package/dist/node/swipe-item/swipe-item.module.js +1 -12
- package/dist/node/switcher/switcher.js +1 -32
- package/dist/node/switcher/switcher.module.js +1 -8
- package/dist/node/tabs/tabs.js +1 -98
- package/dist/node/tabs/tabs.module.js +1 -8
- package/dist/node/tag/tag.js +1 -33
- package/dist/node/tag/tag.module.js +1 -6
- package/dist/node/tags-input/tags-input.js +1 -64
- package/dist/node/tags-input/tags-input.module.js +1 -8
- package/dist/node/text/text.js +1 -16
- package/dist/node/text/text.module.js +1 -3
- package/dist/node/textarea/textarea.js +1 -57
- package/dist/node/textarea/textarea.module.js +1 -9
- package/dist/node/tile/tile.js +1 -39
- package/dist/node/tile/tile.module.js +1 -7
- package/dist/node/time-picker/time-picker.js +1 -63
- package/dist/node/time-picker/time-picker.module.js +1 -9
- package/dist/node/timeline/timeline.js +1 -55
- package/dist/node/timeline/timeline.module.js +1 -11
- package/dist/node/toast/toast.js +1 -85
- package/dist/node/toast/toast.module.js +1 -11
- package/dist/node/toc/toc.js +1 -43
- package/dist/node/toc/toc.module.js +1 -3
- package/dist/node/toc/use-toc-from-region.js +1 -18
- package/dist/node/toggle/toggle.js +1 -41
- package/dist/node/toggle/toggle.module.js +1 -8
- package/dist/node/toggle-group/toggle-group.js +1 -55
- package/dist/node/toggle-group/toggle-group.module.js +1 -6
- package/dist/node/toggletip/toggletip.js +1 -49
- package/dist/node/toggletip/toggletip.module.js +1 -7
- package/dist/node/tooltip/tooltip.js +1 -58
- package/dist/node/tooltip/tooltip.module.js +1 -6
- package/dist/node/tree-view/tree-view.js +1 -201
- package/dist/node/tree-view/tree-view.module.js +1 -13
- package/dist/node/user/user.js +1 -35
- package/dist/node/user/user.module.js +1 -9
- package/dist/node/virtual-list/virtual-list.js +1 -40
- package/dist/node/virtual-list/virtual-list.module.js +1 -7
- package/dist/node/visually-hidden/visually-hidden.js +1 -2
- package/dist/node/wheel-picker/wheel-picker.js +1 -84
- package/dist/node/wheel-picker/wheel-picker.module.js +1 -8
- package/dist/notification/notification.js +1 -140
- package/dist/notification/notification.module.js +1 -11
- package/dist/number-input/number-input.js +1 -147
- package/dist/number-input/number-input.module.js +1 -12
- package/dist/otp-input/otp-input.js +1 -70
- package/dist/otp-input/otp-input.module.js +1 -6
- package/dist/overflow-menu/overflow-menu.js +1 -70
- package/dist/overflow-menu/overflow-menu.module.js +1 -7
- package/dist/pagination/pagination.js +1 -92
- package/dist/pagination/pagination.module.js +1 -11
- package/dist/password-input/password-input.js +1 -81
- package/dist/password-input/password-input.module.js +1 -11
- package/dist/popover/popover.js +1 -51
- package/dist/popover/popover.module.js +1 -6
- package/dist/popover/use-popover.js +1 -55
- package/dist/progress/progress.css +1 -1
- package/dist/progress/progress.js +1 -16
- package/dist/progress/progress.module.js +1 -6
- package/dist/progress-bar/progress-bar.css +1 -1
- package/dist/progress-bar/progress-bar.js +1 -42
- package/dist/progress-bar/progress-bar.module.js +1 -11
- package/dist/progress-circle/progress-circle.js +1 -46
- package/dist/progress-circle/progress-circle.module.js +1 -9
- package/dist/progress-indicator/progress-indicator.css +1 -1
- package/dist/progress-indicator/progress-indicator.js +1 -34
- package/dist/progress-indicator/progress-indicator.module.js +1 -10
- package/dist/prose/prose.css +1 -1
- package/dist/prose/prose.js +1 -13
- package/dist/prose/prose.module.js +1 -3
- package/dist/pull-to-refresh/pull-to-refresh.js +1 -82
- package/dist/pull-to-refresh/pull-to-refresh.module.js +1 -9
- package/dist/qr-code/encode.js +1 -583
- package/dist/qr-code/qr-code.js +1 -41
- package/dist/qr-code/qr-code.module.js +1 -6
- package/dist/radial-progress/radial-progress.js +1 -27
- package/dist/radial-progress/radial-progress.module.js +1 -6
- package/dist/radio/radio.js +1 -48
- package/dist/radio/radio.module.js +1 -9
- package/dist/radio-card/radio-card.css +1 -1
- package/dist/radio-card/radio-card.js +1 -64
- package/dist/radio-card/radio-card.module.js +1 -11
- package/dist/rating-group/rating-group.js +1 -37
- package/dist/rating-group/rating-group.module.js +1 -6
- package/dist/react/src/index.js +1 -141
- package/dist/relative-time/relative-time.js +1 -66
- package/dist/relative-time/relative-time.module.js +1 -3
- package/dist/reorder-list/reorder-list.css +1 -1
- package/dist/reorder-list/reorder-list.js +1 -143
- package/dist/reorder-list/reorder-list.module.js +1 -11
- package/dist/resizable/resizable.js +1 -80
- package/dist/resizable/resizable.module.js +1 -8
- package/dist/scroll-area/scroll-area.css +1 -1
- package/dist/scroll-area/scroll-area.js +1 -38
- package/dist/scroll-area/scroll-area.module.js +1 -3
- package/dist/search/search.js +1 -92
- package/dist/search/search.module.js +1 -9
- package/dist/segmented-control/segmented-control.js +1 -43
- package/dist/segmented-control/segmented-control.module.js +1 -6
- package/dist/select/select.js +1 -72
- package/dist/select/select.module.js +1 -11
- package/dist/separator/separator.js +1 -19
- package/dist/separator/separator.module.js +1 -3
- package/dist/sheet/sheet.js +1 -49
- package/dist/sheet/sheet.module.js +1 -9
- package/dist/shell-header/shell-header.css +1 -1
- package/dist/shell-header/shell-header.js +1 -169
- package/dist/shell-header/shell-header.module.js +1 -24
- package/dist/side-nav/side-nav.css +1 -1
- package/dist/side-nav/side-nav.js +1 -334
- package/dist/side-nav/side-nav.module.js +1 -31
- package/dist/skeleton/skeleton.css +1 -1
- package/dist/skeleton/skeleton.js +1 -23
- package/dist/skeleton/skeleton.module.js +1 -7
- package/dist/skip-nav/skip-nav.js +1 -28
- package/dist/skip-nav/skip-nav.module.js +1 -3
- package/dist/slider/slider.js +1 -29
- package/dist/slider/slider.module.js +1 -7
- package/dist/spinner/spinner.css +1 -1
- package/dist/spinner/spinner.js +1 -18
- package/dist/spinner/spinner.module.js +1 -6
- package/dist/stack/stack.js +1 -17
- package/dist/stack/stack.module.js +1 -6
- package/dist/stat/stat.js +1 -41
- package/dist/stat/stat.module.js +1 -11
- package/dist/status/status.css +1 -1
- package/dist/status/status.js +1 -25
- package/dist/status/status.module.js +1 -7
- package/dist/steps/steps.css +1 -1
- package/dist/steps/steps.js +1 -35
- package/dist/steps/steps.module.js +1 -8
- package/dist/structured-list/structured-list.js +1 -102
- package/dist/structured-list/structured-list.module.js +1 -12
- package/dist/styles.css +395 -53
- package/dist/swap/swap.css +1 -1
- package/dist/swap/swap.js +1 -36
- package/dist/swap/swap.module.js +1 -7
- package/dist/swipe-item/swipe-item.js +1 -62
- package/dist/swipe-item/swipe-item.module.js +1 -12
- package/dist/switcher/switcher.js +1 -32
- package/dist/switcher/switcher.module.js +1 -8
- package/dist/tabs/tabs.js +1 -98
- package/dist/tabs/tabs.module.js +1 -8
- package/dist/tag/tag.js +1 -33
- package/dist/tag/tag.module.js +1 -6
- package/dist/tags-input/tags-input.js +1 -64
- package/dist/tags-input/tags-input.module.js +1 -8
- package/dist/text/text.css +1 -1
- package/dist/text/text.js +1 -16
- package/dist/text/text.module.js +1 -3
- package/dist/textarea/textarea.css +1 -1
- package/dist/textarea/textarea.js +1 -57
- package/dist/textarea/textarea.module.js +1 -9
- package/dist/tile/tile.css +1 -1
- package/dist/tile/tile.js +1 -39
- package/dist/tile/tile.module.js +1 -7
- package/dist/time-picker/time-picker.js +1 -63
- package/dist/time-picker/time-picker.module.js +1 -9
- package/dist/timeline/timeline.js +1 -55
- package/dist/timeline/timeline.module.js +1 -11
- package/dist/toast/toast.css +1 -1
- package/dist/toast/toast.js +1 -85
- package/dist/toast/toast.module.js +1 -11
- package/dist/toc/toc.css +1 -1
- package/dist/toc/toc.js +1 -43
- package/dist/toc/toc.module.js +1 -3
- package/dist/toc/use-toc-from-region.js +1 -18
- package/dist/toggle/toggle.js +1 -41
- package/dist/toggle/toggle.module.js +1 -8
- package/dist/toggle-group/toggle-group.js +1 -55
- package/dist/toggle-group/toggle-group.module.js +1 -6
- package/dist/toggletip/toggletip.js +1 -49
- package/dist/toggletip/toggletip.module.js +1 -7
- package/dist/tooltip/tooltip.css +1 -1
- package/dist/tooltip/tooltip.js +1 -58
- package/dist/tooltip/tooltip.module.js +1 -6
- package/dist/tree-view/tree-view.css +1 -1
- package/dist/tree-view/tree-view.js +1 -201
- package/dist/tree-view/tree-view.module.js +1 -13
- package/dist/user/user.js +1 -35
- package/dist/user/user.module.js +1 -9
- package/dist/virtual-list/virtual-list.js +1 -40
- package/dist/virtual-list/virtual-list.module.js +1 -7
- package/dist/visually-hidden/visually-hidden.js +1 -2
- package/dist/wheel-picker/wheel-picker.js +1 -84
- package/dist/wheel-picker/wheel-picker.module.js +1 -8
- package/package.json +4 -4
- package/readme.body.md +7 -5
|
@@ -1,147 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import e from "./number-input.module.js";
|
|
4
|
-
import { forwardRef as t } from "react";
|
|
5
|
-
import { cn as n, createMachine as r, useMachine as i, useSignal as a, useSignals as o } from "@cascivo/core";
|
|
6
|
-
import { builtin as s, t as c } from "@cascivo/i18n";
|
|
7
|
-
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
8
|
-
//#region ../components/src/number-input/number-input.tsx
|
|
9
|
-
var d = r({
|
|
10
|
-
initial: "idle",
|
|
11
|
-
states: {
|
|
12
|
-
idle: { on: { FOCUS: "focused" } },
|
|
13
|
-
focused: { on: { BLUR: "idle" } }
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
function f(e, t, n) {
|
|
17
|
-
let r = e;
|
|
18
|
-
return t !== void 0 && (r = Math.max(r, t)), n !== void 0 && (r = Math.min(r, n)), r;
|
|
19
|
-
}
|
|
20
|
-
function p(e) {
|
|
21
|
-
let t = String(e), n = t.indexOf(".");
|
|
22
|
-
return n === -1 ? 0 : t.length - n - 1;
|
|
23
|
-
}
|
|
24
|
-
function m(e, t) {
|
|
25
|
-
let n = 10 ** t;
|
|
26
|
-
return Math.round(e * n) / n;
|
|
27
|
-
}
|
|
28
|
-
function h(e) {
|
|
29
|
-
let t = e.trim();
|
|
30
|
-
if (t === "") return null;
|
|
31
|
-
let n = Number(t);
|
|
32
|
-
return Number.isFinite(n) ? n : null;
|
|
33
|
-
}
|
|
34
|
-
var g = t(function({ value: t, defaultValue: r, onValueChange: g, onChange: _, min: v, max: y, step: b = 1, precision: x, formatOptions: S, label: C, hint: w, error: T, size: E = "md", disabled: D, incrementLabel: O, decrementLabel: k, className: A, id: j, onFocus: M, onBlur: N, onKeyDown: P, ...F }, I) {
|
|
35
|
-
o();
|
|
36
|
-
let L = O ?? c(s.numberInput.increment), R = k ?? c(s.numberInput.decrement), [z, B] = i(d), V = t !== void 0, H = a(r ?? null), U = a(""), W = V ? t : H.value, G = j ?? (C ? `cascade-number-input-${C.toLowerCase().replace(/\s+/g, "-")}` : void 0), K = (e) => {
|
|
37
|
-
V || (H.value = e), U.value = e == null ? "" : String(e), e !== W && (g ?? _)?.(e);
|
|
38
|
-
}, q = () => {
|
|
39
|
-
let e = h(U.value);
|
|
40
|
-
e != null && (e = f(e, v, y), x !== void 0 && (e = m(e, x))), K(e);
|
|
41
|
-
}, J = (e) => {
|
|
42
|
-
let t = (z.value === "focused" ? h(U.value) : W) ?? 0, n = x ?? Math.max(p(b), p(t));
|
|
43
|
-
K(f(m(t + e * b, n), v, y));
|
|
44
|
-
}, Y = z.value === "focused" ? U.value : ((e) => e == null ? "" : S ? new Intl.NumberFormat(void 0, S).format(e) : String(e))(W), X = W != null && y !== void 0 && W >= y, Z = W != null && v !== void 0 && W <= v;
|
|
45
|
-
return /* @__PURE__ */ u("div", {
|
|
46
|
-
className: n(e.wrapper, A),
|
|
47
|
-
"data-state": T ? "error" : z.value,
|
|
48
|
-
"data-size": E,
|
|
49
|
-
children: [
|
|
50
|
-
C && /* @__PURE__ */ l("label", {
|
|
51
|
-
className: e.label,
|
|
52
|
-
htmlFor: G,
|
|
53
|
-
children: C
|
|
54
|
-
}),
|
|
55
|
-
/* @__PURE__ */ u("div", {
|
|
56
|
-
className: e.field,
|
|
57
|
-
children: [/* @__PURE__ */ l("input", {
|
|
58
|
-
id: G,
|
|
59
|
-
type: "text",
|
|
60
|
-
inputMode: "decimal",
|
|
61
|
-
autoComplete: "off",
|
|
62
|
-
role: "spinbutton",
|
|
63
|
-
className: e.input,
|
|
64
|
-
value: Y,
|
|
65
|
-
disabled: D,
|
|
66
|
-
"aria-valuenow": W ?? void 0,
|
|
67
|
-
"aria-valuemin": v,
|
|
68
|
-
"aria-valuemax": y,
|
|
69
|
-
"aria-invalid": T ? !0 : void 0,
|
|
70
|
-
"aria-describedby": T ? `${G}-error` : w ? `${G}-hint` : void 0,
|
|
71
|
-
onChange: (e) => {
|
|
72
|
-
U.value = e.target.value;
|
|
73
|
-
},
|
|
74
|
-
onFocus: (e) => {
|
|
75
|
-
U.value = W == null ? "" : String(W), B("FOCUS"), M?.(e);
|
|
76
|
-
},
|
|
77
|
-
onBlur: (e) => {
|
|
78
|
-
q(), B("BLUR"), N?.(e);
|
|
79
|
-
},
|
|
80
|
-
onKeyDown: (e) => {
|
|
81
|
-
e.key === "ArrowUp" ? (e.preventDefault(), J(1)) : e.key === "ArrowDown" ? (e.preventDefault(), J(-1)) : e.key === "Enter" && q(), P?.(e);
|
|
82
|
-
},
|
|
83
|
-
ref: I,
|
|
84
|
-
...F
|
|
85
|
-
}), /* @__PURE__ */ u("div", {
|
|
86
|
-
className: e.steppers,
|
|
87
|
-
children: [/* @__PURE__ */ l("button", {
|
|
88
|
-
type: "button",
|
|
89
|
-
className: e.stepper,
|
|
90
|
-
"aria-label": L,
|
|
91
|
-
tabIndex: -1,
|
|
92
|
-
disabled: D || X,
|
|
93
|
-
onMouseDown: (e) => e.preventDefault(),
|
|
94
|
-
onClick: () => J(1),
|
|
95
|
-
children: /* @__PURE__ */ l("svg", {
|
|
96
|
-
viewBox: "0 0 10 10",
|
|
97
|
-
"aria-hidden": "true",
|
|
98
|
-
focusable: "false",
|
|
99
|
-
children: /* @__PURE__ */ l("path", {
|
|
100
|
-
d: "M2 6.5 5 3.5 8 6.5",
|
|
101
|
-
fill: "none",
|
|
102
|
-
stroke: "currentColor",
|
|
103
|
-
strokeWidth: "1.5",
|
|
104
|
-
strokeLinecap: "round",
|
|
105
|
-
strokeLinejoin: "round"
|
|
106
|
-
})
|
|
107
|
-
})
|
|
108
|
-
}), /* @__PURE__ */ l("button", {
|
|
109
|
-
type: "button",
|
|
110
|
-
className: e.stepper,
|
|
111
|
-
"aria-label": R,
|
|
112
|
-
tabIndex: -1,
|
|
113
|
-
disabled: D || Z,
|
|
114
|
-
onMouseDown: (e) => e.preventDefault(),
|
|
115
|
-
onClick: () => J(-1),
|
|
116
|
-
children: /* @__PURE__ */ l("svg", {
|
|
117
|
-
viewBox: "0 0 10 10",
|
|
118
|
-
"aria-hidden": "true",
|
|
119
|
-
focusable: "false",
|
|
120
|
-
children: /* @__PURE__ */ l("path", {
|
|
121
|
-
d: "M2 3.5 5 6.5 8 3.5",
|
|
122
|
-
fill: "none",
|
|
123
|
-
stroke: "currentColor",
|
|
124
|
-
strokeWidth: "1.5",
|
|
125
|
-
strokeLinecap: "round",
|
|
126
|
-
strokeLinejoin: "round"
|
|
127
|
-
})
|
|
128
|
-
})
|
|
129
|
-
})]
|
|
130
|
-
})]
|
|
131
|
-
}),
|
|
132
|
-
T && /* @__PURE__ */ l("span", {
|
|
133
|
-
id: `${G}-error`,
|
|
134
|
-
className: e.error,
|
|
135
|
-
role: "alert",
|
|
136
|
-
children: T
|
|
137
|
-
}),
|
|
138
|
-
!T && w && /* @__PURE__ */ l("span", {
|
|
139
|
-
id: `${G}-hint`,
|
|
140
|
-
className: e.hint,
|
|
141
|
-
children: w
|
|
142
|
-
})
|
|
143
|
-
]
|
|
144
|
-
});
|
|
145
|
-
});
|
|
146
|
-
//#endregion
|
|
147
|
-
export { g as NumberInput };
|
|
1
|
+
"use client";import e from"./number-input.module.js";import{forwardRef as t}from"react";import{cn as n,createMachine as r,useMachine as i,useSignal as a,useSignals as o}from"@cascivo/core";import{builtin as s,t as c}from"@cascivo/i18n";import{jsx as l,jsxs as u}from"react/jsx-runtime";var d=r({initial:`idle`,states:{idle:{on:{FOCUS:`focused`}},focused:{on:{BLUR:`idle`}}}});function f(e,t,n){let r=e;return t!==void 0&&(r=Math.max(r,t)),n!==void 0&&(r=Math.min(r,n)),r}function p(e){let t=String(e),n=t.indexOf(`.`);return n===-1?0:t.length-n-1}function m(e,t){let n=10**t;return Math.round(e*n)/n}function h(e){let t=e.trim();if(t===``)return null;let n=Number(t);return Number.isFinite(n)?n:null}var g=t(function({value:t,defaultValue:r,onValueChange:g,min:_,max:v,step:y=1,precision:b,formatOptions:x,label:S,hint:C,error:w,size:T=`md`,disabled:E,incrementLabel:D,decrementLabel:O,className:k,id:A,onFocus:j,onBlur:M,onKeyDown:N,ariaLabel:P,...F},I){o();let L=D??c(s.numberInput.increment),R=O??c(s.numberInput.decrement),[z,B]=i(d),V=t!==void 0,H=a(r??null),U=a(``),W=V?t:H.value,G=A??(S?`cascade-number-input-${S.toLowerCase().replace(/\s+/g,`-`)}`:void 0),K=e=>{V||(H.value=e),U.value=e==null?``:String(e),e!==W&&g?.(e)},q=()=>{let e=h(U.value);e!=null&&(e=f(e,_,v),b!==void 0&&(e=m(e,b))),K(e)},J=e=>{let t=(z.value===`focused`?h(U.value):W)??0,n=b??Math.max(p(y),p(t));K(f(m(t+e*y,n),_,v))},Y=z.value===`focused`?U.value:(e=>e==null?``:x?new Intl.NumberFormat(void 0,x).format(e):String(e))(W),X=W!=null&&v!==void 0&&W>=v,Z=W!=null&&_!==void 0&&W<=_;return u(`div`,{className:n(e.wrapper,k),"data-state":w?`error`:z.value,"data-size":T,children:[S&&l(`label`,{className:e.label,htmlFor:G,children:S}),u(`div`,{className:e.field,children:[l(`input`,{id:G,type:`text`,inputMode:`decimal`,autoComplete:`off`,role:`spinbutton`,className:e.input,value:Y,disabled:E,"aria-valuenow":W??void 0,"aria-valuemin":_,"aria-valuemax":v,"aria-invalid":w?!0:void 0,"aria-describedby":w?`${G}-error`:C?`${G}-hint`:void 0,onChange:e=>{U.value=e.target.value},onFocus:e=>{U.value=W==null?``:String(W),B(`FOCUS`),j?.(e)},onBlur:e=>{q(),B(`BLUR`),M?.(e)},onKeyDown:e=>{e.key===`ArrowUp`?(e.preventDefault(),J(1)):e.key===`ArrowDown`?(e.preventDefault(),J(-1)):e.key===`Enter`&&q(),N?.(e)},ref:I,...F,"aria-label":F[`aria-label`]??P}),u(`div`,{className:e.steppers,children:[l(`button`,{type:`button`,className:e.stepper,"aria-label":L,tabIndex:-1,disabled:E||X,onMouseDown:e=>e.preventDefault(),onClick:()=>J(1),children:l(`svg`,{viewBox:`0 0 10 10`,"aria-hidden":`true`,focusable:`false`,children:l(`path`,{d:`M2 6.5 5 3.5 8 6.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})})}),l(`button`,{type:`button`,className:e.stepper,"aria-label":R,tabIndex:-1,disabled:E||Z,onMouseDown:e=>e.preventDefault(),onClick:()=>J(-1),children:l(`svg`,{viewBox:`0 0 10 10`,"aria-hidden":`true`,focusable:`false`,children:l(`path`,{d:`M2 3.5 5 6.5 8 3.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})})})]})]}),w&&l(`span`,{id:`${G}-error`,className:e.error,role:`alert`,children:w}),!w&&C&&l(`span`,{id:`${G}-hint`,className:e.hint,children:C})]})});export{g as NumberInput};
|
|
@@ -1,13 +1,2 @@
|
|
|
1
1
|
import './number-input.css';
|
|
2
|
-
var e
|
|
3
|
-
wrapper: "_wrapper_aavdw_2",
|
|
4
|
-
label: "_label_aavdw_31",
|
|
5
|
-
field: "_field_aavdw_39",
|
|
6
|
-
input: "_input_aavdw_43",
|
|
7
|
-
steppers: "_steppers_aavdw_88",
|
|
8
|
-
stepper: "_stepper_aavdw_88",
|
|
9
|
-
error: "_error_aavdw_135",
|
|
10
|
-
hint: "_hint_aavdw_142"
|
|
11
|
-
};
|
|
12
|
-
//#endregion
|
|
13
|
-
export { e as default };
|
|
2
|
+
var e={wrapper:`_wrapper_aavdw_2`,label:`_label_aavdw_31`,field:`_field_aavdw_39`,input:`_input_aavdw_43`,steppers:`_steppers_aavdw_88`,stepper:`_stepper_aavdw_88`,error:`_error_aavdw_135`,hint:`_hint_aavdw_142`};export{e as default};
|
|
@@ -1,70 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import e from "./otp-input.module.js";
|
|
4
|
-
import { useRef as t } from "react";
|
|
5
|
-
import { cn as n, useSignal as r, useSignals as i } from "@cascivo/core";
|
|
6
|
-
import { builtin as a, t as o } from "@cascivo/i18n";
|
|
7
|
-
import { jsx as s } from "react/jsx-runtime";
|
|
8
|
-
//#region ../components/src/otp-input/otp-input.tsx
|
|
9
|
-
function c({ length: c = 6, value: l, onValueChange: u, disabled: d = !1, type: f = "numeric", className: p, ...m }) {
|
|
10
|
-
i();
|
|
11
|
-
let h = r(Array.from({ length: c }, (e, t) => l[t] ?? "")), g = t([]), _ = Array.from({ length: c }, (e, t) => l[t] ?? "");
|
|
12
|
-
JSON.stringify(h.value) !== JSON.stringify(_) && (h.value = _);
|
|
13
|
-
function v(e) {
|
|
14
|
-
u(e.join("")), h.value = e;
|
|
15
|
-
}
|
|
16
|
-
function y(e) {
|
|
17
|
-
let t = Math.max(0, Math.min(c - 1, e));
|
|
18
|
-
g.current[t]?.focus();
|
|
19
|
-
}
|
|
20
|
-
function b(e, t) {
|
|
21
|
-
if (!(f === "numeric" ? /^\d$/ : /^[a-zA-Z0-9]$/).test(t)) return;
|
|
22
|
-
let n = [...h.value];
|
|
23
|
-
n[e] = t, v(n), e < c - 1 && y(e + 1);
|
|
24
|
-
}
|
|
25
|
-
function x(e, t) {
|
|
26
|
-
if (t.key === "Backspace") {
|
|
27
|
-
t.preventDefault();
|
|
28
|
-
let n = [...h.value];
|
|
29
|
-
n[e] ? (n[e] = "", v(n)) : e > 0 && (n[e - 1] = "", v(n), y(e - 1));
|
|
30
|
-
} else t.key === "ArrowLeft" ? (t.preventDefault(), y(e - 1)) : t.key === "ArrowRight" && (t.preventDefault(), y(e + 1));
|
|
31
|
-
}
|
|
32
|
-
function S(e, t) {
|
|
33
|
-
let n = t.clipboardData.getData("text").replace(/\s/g, "").slice(0, c - e);
|
|
34
|
-
if (!(f === "numeric" ? /^\d+$/ : /^[a-zA-Z0-9]+$/).test(n)) return;
|
|
35
|
-
t.preventDefault();
|
|
36
|
-
let r = [...h.value];
|
|
37
|
-
for (let t = 0; t < n.length; t++) e + t < c && (r[e + t] = n[t] ?? "");
|
|
38
|
-
v(r), y(Math.min(e + n.length, c - 1));
|
|
39
|
-
}
|
|
40
|
-
let C = o(a.otpInput.label);
|
|
41
|
-
return /* @__PURE__ */ s("div", {
|
|
42
|
-
className: n(e.wrapper, p),
|
|
43
|
-
role: "group",
|
|
44
|
-
"aria-label": C,
|
|
45
|
-
...m,
|
|
46
|
-
children: h.value.map((t, n) => /* @__PURE__ */ s("input", {
|
|
47
|
-
ref: (e) => {
|
|
48
|
-
g.current[n] = e;
|
|
49
|
-
},
|
|
50
|
-
type: f === "numeric" ? "tel" : "text",
|
|
51
|
-
inputMode: f === "numeric" ? "numeric" : "text",
|
|
52
|
-
className: e.slot,
|
|
53
|
-
value: t,
|
|
54
|
-
maxLength: 1,
|
|
55
|
-
"aria-label": o(a.otpInput.digit, { n: String(n + 1) }),
|
|
56
|
-
autoComplete: n === 0 ? "one-time-code" : "off",
|
|
57
|
-
disabled: d,
|
|
58
|
-
"data-filled": t ? "" : void 0,
|
|
59
|
-
onChange: (e) => {
|
|
60
|
-
let t = e.currentTarget.value.slice(-1);
|
|
61
|
-
t && b(n, t);
|
|
62
|
-
},
|
|
63
|
-
onKeyDown: (e) => x(n, e),
|
|
64
|
-
onPaste: (e) => S(n, e),
|
|
65
|
-
onFocus: (e) => e.currentTarget.select()
|
|
66
|
-
}, n))
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
//#endregion
|
|
70
|
-
export { c as OtpInput };
|
|
1
|
+
"use client";import e from"./otp-input.module.js";import{useRef as t}from"react";import{cn as n,useSignal as r,useSignals as i}from"@cascivo/core";import{builtin as a,t as o}from"@cascivo/i18n";import{jsx as s}from"react/jsx-runtime";function c({length:c=6,value:l,onValueChange:u,disabled:d=!1,type:f=`numeric`,className:p,...m}){i();let h=r(Array.from({length:c},(e,t)=>l[t]??``)),g=t([]),_=Array.from({length:c},(e,t)=>l[t]??``);JSON.stringify(h.value)!==JSON.stringify(_)&&(h.value=_);function v(e){u(e.join(``)),h.value=e}function y(e){let t=Math.max(0,Math.min(c-1,e));g.current[t]?.focus()}function b(e,t){if(!(f===`numeric`?/^\d$/:/^[a-zA-Z0-9]$/).test(t))return;let n=[...h.value];n[e]=t,v(n),e<c-1&&y(e+1)}function x(e,t){if(t.key===`Backspace`){t.preventDefault();let n=[...h.value];n[e]?(n[e]=``,v(n)):e>0&&(n[e-1]=``,v(n),y(e-1))}else t.key===`ArrowLeft`?(t.preventDefault(),y(e-1)):t.key===`ArrowRight`&&(t.preventDefault(),y(e+1))}function S(e,t){let n=t.clipboardData.getData(`text`).replace(/\s/g,``).slice(0,c-e);if(!(f===`numeric`?/^\d+$/:/^[a-zA-Z0-9]+$/).test(n))return;t.preventDefault();let r=[...h.value];for(let t=0;t<n.length;t++)e+t<c&&(r[e+t]=n[t]??``);v(r),y(Math.min(e+n.length,c-1))}let C=o(a.otpInput.label);return s(`div`,{className:n(e.wrapper,p),role:`group`,"aria-label":C,...m,children:h.value.map((t,n)=>s(`input`,{ref:e=>{g.current[n]=e},type:f===`numeric`?`tel`:`text`,inputMode:f===`numeric`?`numeric`:`text`,className:e.slot,value:t,maxLength:1,"aria-label":o(a.otpInput.digit,{n:String(n+1)}),autoComplete:n===0?`one-time-code`:`off`,disabled:d,"data-filled":t?``:void 0,onChange:e=>{let t=e.currentTarget.value.slice(-1);t&&b(n,t)},onKeyDown:e=>x(n,e),onPaste:e=>S(n,e),onFocus:e=>e.currentTarget.select()},n))})}export{c as OtpInput};
|
|
@@ -1,70 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { Dropdown as e } from "../dropdown/dropdown.js";
|
|
4
|
-
import t from "./overflow-menu.module.js";
|
|
5
|
-
import { cn as n, useSignals as r } from "@cascivo/core";
|
|
6
|
-
import { builtin as i, t as a } from "@cascivo/i18n";
|
|
7
|
-
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
8
|
-
//#region ../components/src/overflow-menu/overflow-menu.tsx
|
|
9
|
-
function l(e) {
|
|
10
|
-
let t = e.value ?? e.id;
|
|
11
|
-
if (t === void 0) throw Error(`OverflowMenu: item "${e.label}" has neither \`value\` nor \`id\`. One of them is required — it is what \`onSelect\` receives.`);
|
|
12
|
-
return t;
|
|
13
|
-
}
|
|
14
|
-
function u() {
|
|
15
|
-
return /* @__PURE__ */ c("svg", {
|
|
16
|
-
viewBox: "0 0 16 16",
|
|
17
|
-
width: "16",
|
|
18
|
-
height: "16",
|
|
19
|
-
fill: "currentColor",
|
|
20
|
-
"aria-hidden": "true",
|
|
21
|
-
children: [
|
|
22
|
-
/* @__PURE__ */ s("circle", {
|
|
23
|
-
cx: "8",
|
|
24
|
-
cy: "3",
|
|
25
|
-
r: "1.5"
|
|
26
|
-
}),
|
|
27
|
-
/* @__PURE__ */ s("circle", {
|
|
28
|
-
cx: "8",
|
|
29
|
-
cy: "8",
|
|
30
|
-
r: "1.5"
|
|
31
|
-
}),
|
|
32
|
-
/* @__PURE__ */ s("circle", {
|
|
33
|
-
cx: "8",
|
|
34
|
-
cy: "13",
|
|
35
|
-
r: "1.5"
|
|
36
|
-
})
|
|
37
|
-
]
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
function d({ items: d, onSelect: f, placement: p = "bottom-end", ariaLabel: m, size: h = "md", disabled: g = !1, className: _ }) {
|
|
41
|
-
r();
|
|
42
|
-
let v = m ?? a(i.overflowMenu.trigger), y = d.map((e) => {
|
|
43
|
-
let n = {
|
|
44
|
-
label: e.label,
|
|
45
|
-
value: l(e)
|
|
46
|
-
};
|
|
47
|
-
return e.disabled !== void 0 && (n.disabled = e.disabled), e.destructive ? n.icon = /* @__PURE__ */ c(o, { children: [e.icon, /* @__PURE__ */ s("span", {
|
|
48
|
-
className: t["destructive-flag"],
|
|
49
|
-
"aria-hidden": "true"
|
|
50
|
-
})] }) : e.icon !== void 0 && (n.icon = e.icon), n;
|
|
51
|
-
});
|
|
52
|
-
return /* @__PURE__ */ s("div", {
|
|
53
|
-
className: n(t.root, _),
|
|
54
|
-
children: /* @__PURE__ */ s(e, {
|
|
55
|
-
items: y,
|
|
56
|
-
onSelect: (e) => f?.(e),
|
|
57
|
-
placement: p,
|
|
58
|
-
trigger: /* @__PURE__ */ s("button", {
|
|
59
|
-
type: "button",
|
|
60
|
-
className: t.trigger,
|
|
61
|
-
"data-size": h,
|
|
62
|
-
disabled: g,
|
|
63
|
-
"aria-label": v,
|
|
64
|
-
children: /* @__PURE__ */ s(u, {})
|
|
65
|
-
})
|
|
66
|
-
})
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
//#endregion
|
|
70
|
-
export { d as OverflowMenu };
|
|
1
|
+
"use client";import{Dropdown as e}from"../dropdown/dropdown.js";import t from"./overflow-menu.module.js";import{cn as n,useSignals as r}from"@cascivo/core";import{builtin as i,t as a}from"@cascivo/i18n";import{Fragment as o,jsx as s,jsxs as c}from"react/jsx-runtime";function l(e){let t=e.value??e.id;if(t===void 0)throw Error(`OverflowMenu: item "${e.label}" has neither \`value\` nor \`id\`. One of them is required — it is what \`onSelect\` receives.`);return t}function u(){return c(`svg`,{viewBox:`0 0 16 16`,width:`16`,height:`16`,fill:`currentColor`,"aria-hidden":`true`,children:[s(`circle`,{cx:`8`,cy:`3`,r:`1.5`}),s(`circle`,{cx:`8`,cy:`8`,r:`1.5`}),s(`circle`,{cx:`8`,cy:`13`,r:`1.5`})]})}function d({items:d,onSelect:f,placement:p=`bottom-end`,ariaLabel:m,label:h,size:g=`md`,disabled:_=!1,tabIndex:v,className:y}){r();let b=m??h??a(i.overflowMenu.trigger),x=d.map(e=>{let n={label:e.label,value:l(e)};return e.disabled!==void 0&&(n.disabled=e.disabled),e.destructive?n.icon=c(o,{children:[e.icon,s(`span`,{className:t[`destructive-flag`],"aria-hidden":`true`})]}):e.icon!==void 0&&(n.icon=e.icon),n});return s(`div`,{className:n(t.root,y),children:s(e,{items:x,onSelect:e=>f?.(e),placement:p,trigger:s(`button`,{type:`button`,className:t.trigger,"data-size":g,disabled:_,tabIndex:v,"aria-label":b,children:s(u,{})})})})}export{d as OverflowMenu};
|
|
@@ -1,8 +1,2 @@
|
|
|
1
1
|
import './overflow-menu.css';
|
|
2
|
-
var e
|
|
3
|
-
root: "_root_14jtg_2",
|
|
4
|
-
trigger: "_trigger_14jtg_6",
|
|
5
|
-
"destructive-flag": "_destructive-flag_14jtg_49"
|
|
6
|
-
};
|
|
7
|
-
//#endregion
|
|
8
|
-
export { e as default };
|
|
2
|
+
var e={root:`_root_14jtg_2`,trigger:`_trigger_14jtg_6`,"destructive-flag":`_destructive-flag_14jtg_49`};export{e as default};
|
|
@@ -1,92 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import e from "./pagination.module.js";
|
|
4
|
-
import { cn as t, useSignals as n } from "@cascivo/core";
|
|
5
|
-
import { builtin as r, t as i } from "@cascivo/i18n";
|
|
6
|
-
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
-
//#region ../components/src/pagination/pagination.tsx
|
|
8
|
-
var s = [
|
|
9
|
-
10,
|
|
10
|
-
25,
|
|
11
|
-
50,
|
|
12
|
-
100
|
|
13
|
-
];
|
|
14
|
-
function c({ page: c, pageSize: l, totalItems: u, onPageChange: d, onPageSizeChange: f, pageSizeOptions: p = s, labels: m, className: h }) {
|
|
15
|
-
n();
|
|
16
|
-
let g = Math.max(1, Math.ceil(u / l)), _ = Math.min(Math.max(c, 1), g), v = u === 0 ? 0 : (_ - 1) * l + 1, y = Math.min(_ * l, u), b = m?.nav ?? i(r.pagination.nav), x = m?.itemsPerPage ?? i(r.pagination.itemsPerPage), S = m?.pageOf?.(_, g) ?? i(r.pagination.pageOf, {
|
|
17
|
-
page: _,
|
|
18
|
-
total: g
|
|
19
|
-
}), C = m?.range?.(v, y, u) ?? i(r.pagination.range, {
|
|
20
|
-
start: v,
|
|
21
|
-
end: y,
|
|
22
|
-
total: u
|
|
23
|
-
}), w = m?.previous ?? i(r.pagination.previous), T = m?.next ?? i(r.pagination.next);
|
|
24
|
-
return /* @__PURE__ */ o("nav", {
|
|
25
|
-
"aria-label": b,
|
|
26
|
-
className: t(e.pagination, h),
|
|
27
|
-
children: [
|
|
28
|
-
f && /* @__PURE__ */ o("label", {
|
|
29
|
-
className: e.group,
|
|
30
|
-
children: [/* @__PURE__ */ a("span", {
|
|
31
|
-
className: e.label,
|
|
32
|
-
children: x
|
|
33
|
-
}), /* @__PURE__ */ a("select", {
|
|
34
|
-
className: e.select,
|
|
35
|
-
value: l,
|
|
36
|
-
onChange: (e) => f(Number(e.target.value)),
|
|
37
|
-
children: p.map((e) => /* @__PURE__ */ a("option", {
|
|
38
|
-
value: e,
|
|
39
|
-
children: e
|
|
40
|
-
}, e))
|
|
41
|
-
})]
|
|
42
|
-
}),
|
|
43
|
-
/* @__PURE__ */ a("span", {
|
|
44
|
-
className: e.range,
|
|
45
|
-
children: C
|
|
46
|
-
}),
|
|
47
|
-
/* @__PURE__ */ o("div", {
|
|
48
|
-
className: e.group,
|
|
49
|
-
children: [/* @__PURE__ */ a("select", {
|
|
50
|
-
className: e.select,
|
|
51
|
-
"aria-label": S,
|
|
52
|
-
value: _,
|
|
53
|
-
onChange: (e) => d(Number(e.target.value)),
|
|
54
|
-
children: Array.from({ length: g }, (e, t) => /* @__PURE__ */ a("option", {
|
|
55
|
-
value: t + 1,
|
|
56
|
-
children: t + 1
|
|
57
|
-
}, t + 1))
|
|
58
|
-
}), /* @__PURE__ */ a("span", {
|
|
59
|
-
className: e.label,
|
|
60
|
-
"aria-hidden": "true",
|
|
61
|
-
children: S
|
|
62
|
-
})]
|
|
63
|
-
}),
|
|
64
|
-
/* @__PURE__ */ o("div", {
|
|
65
|
-
className: e.buttons,
|
|
66
|
-
children: [/* @__PURE__ */ a("button", {
|
|
67
|
-
type: "button",
|
|
68
|
-
className: e.button,
|
|
69
|
-
"aria-label": w,
|
|
70
|
-
disabled: _ <= 1,
|
|
71
|
-
onClick: () => d(_ - 1),
|
|
72
|
-
children: /* @__PURE__ */ a("span", {
|
|
73
|
-
"aria-hidden": "true",
|
|
74
|
-
children: "‹"
|
|
75
|
-
})
|
|
76
|
-
}), /* @__PURE__ */ a("button", {
|
|
77
|
-
type: "button",
|
|
78
|
-
className: e.button,
|
|
79
|
-
"aria-label": T,
|
|
80
|
-
disabled: _ >= g,
|
|
81
|
-
onClick: () => d(_ + 1),
|
|
82
|
-
children: /* @__PURE__ */ a("span", {
|
|
83
|
-
"aria-hidden": "true",
|
|
84
|
-
children: "›"
|
|
85
|
-
})
|
|
86
|
-
})]
|
|
87
|
-
})
|
|
88
|
-
]
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
//#endregion
|
|
92
|
-
export { c as Pagination };
|
|
1
|
+
"use client";import e from"./pagination.module.js";import{cn as t,useSignals as n}from"@cascivo/core";import{builtin as r,t as i}from"@cascivo/i18n";import{jsx as a,jsxs as o}from"react/jsx-runtime";var s=[10,25,50,100];function c({page:c,pageSize:l,totalItems:u,onPageChange:d,onPageSizeChange:f,pageSizeOptions:p=s,labels:m,className:h}){n();let g=Math.max(1,Math.ceil(u/l)),_=Math.min(Math.max(c,1),g),v=u===0?0:(_-1)*l+1,y=Math.min(_*l,u),b=m?.nav??i(r.pagination.nav),x=m?.itemsPerPage??i(r.pagination.itemsPerPage),S=m?.pageOf?.(_,g)??i(r.pagination.pageOf,{page:_,total:g}),C=m?.range?.(v,y,u)??i(r.pagination.range,{start:v,end:y,total:u}),w=m?.previous??i(r.pagination.previous),T=m?.next??i(r.pagination.next);return o(`nav`,{"aria-label":b,className:t(e.pagination,h),children:[f&&o(`label`,{className:e.group,children:[a(`span`,{className:e.label,children:x}),a(`select`,{className:e.select,value:l,onChange:e=>f(Number(e.target.value)),children:p.map(e=>a(`option`,{value:e,children:e},e))})]}),a(`span`,{className:e.range,children:C}),o(`div`,{className:e.group,children:[a(`select`,{className:e.select,"aria-label":S,value:_,onChange:e=>d(Number(e.target.value)),children:Array.from({length:g},(e,t)=>a(`option`,{value:t+1,children:t+1},t+1))}),a(`span`,{className:e.label,"aria-hidden":`true`,children:S})]}),o(`div`,{className:e.buttons,children:[a(`button`,{type:`button`,className:e.button,"aria-label":w,disabled:_<=1,onClick:()=>d(_-1),children:a(`span`,{"aria-hidden":`true`,children:`‹`})}),a(`button`,{type:`button`,className:e.button,"aria-label":T,disabled:_>=g,onClick:()=>d(_+1),children:a(`span`,{"aria-hidden":`true`,children:`›`})})]})]})}export{c as Pagination};
|
|
@@ -1,12 +1,2 @@
|
|
|
1
1
|
import './pagination.css';
|
|
2
|
-
var e
|
|
3
|
-
pagination: "_pagination_1rt7c_2",
|
|
4
|
-
group: "_group_1rt7c_13",
|
|
5
|
-
label: "_label_1rt7c_19",
|
|
6
|
-
range: "_range_1rt7c_25",
|
|
7
|
-
select: "_select_1rt7c_35",
|
|
8
|
-
buttons: "_buttons_1rt7c_70",
|
|
9
|
-
button: "_button_1rt7c_70"
|
|
10
|
-
};
|
|
11
|
-
//#endregion
|
|
12
|
-
export { e as default };
|
|
2
|
+
var e={pagination:`_pagination_1rt7c_2`,group:`_group_1rt7c_13`,label:`_label_1rt7c_19`,range:`_range_1rt7c_25`,select:`_select_1rt7c_35`,buttons:`_buttons_1rt7c_70`,button:`_button_1rt7c_70`};export{e as default};
|
|
@@ -1,81 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import e from "./password-input.module.js";
|
|
4
|
-
import { forwardRef as t, useId as n } from "react";
|
|
5
|
-
import { cn as r, useSignal as i, useSignals as a } from "@cascivo/core";
|
|
6
|
-
import { builtin as o, t as s } from "@cascivo/i18n";
|
|
7
|
-
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
|
-
//#region ../components/src/password-input/password-input.tsx
|
|
9
|
-
function u(e) {
|
|
10
|
-
if (!e) return {
|
|
11
|
-
score: 0,
|
|
12
|
-
label: "weak"
|
|
13
|
-
};
|
|
14
|
-
let t = 0;
|
|
15
|
-
return /[a-z]/.test(e) && t++, /[A-Z]/.test(e) && t++, /[0-9]/.test(e) && t++, /[^a-zA-Z0-9]/.test(e) && t++, e.length >= 12 && (t = Math.min(4, t + 1)), t = Math.min(4, t), {
|
|
16
|
-
score: t,
|
|
17
|
-
label: [
|
|
18
|
-
"weak",
|
|
19
|
-
"weak",
|
|
20
|
-
"fair",
|
|
21
|
-
"good",
|
|
22
|
-
"strong"
|
|
23
|
-
][t]
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
var d = t(function({ showStrengthMeter: t = !1, size: d = "md", labels: f, className: p, id: m, value: h, defaultValue: g, onChange: _, ...v }, y) {
|
|
27
|
-
a();
|
|
28
|
-
let b = i(!1), x = i(typeof h == "string" ? h : typeof g == "string" ? g : "");
|
|
29
|
-
typeof h == "string" && (x.value = h);
|
|
30
|
-
let S = n(), C = m ?? `cascade-password-${S}`, w = t ? u(x.value) : null, T = b.value ? f?.hide ?? s(o.passwordInput.hide) : f?.reveal ?? s(o.passwordInput.reveal), E = w ? f?.strengthLabel ? f.strengthLabel(w.label) : s(o.passwordInput.strengthLabel, { level: w.label }) : void 0;
|
|
31
|
-
return /* @__PURE__ */ l("div", {
|
|
32
|
-
className: r(e.wrapper, p),
|
|
33
|
-
"data-size": d,
|
|
34
|
-
"data-revealed": b.value ? "" : void 0,
|
|
35
|
-
children: [/* @__PURE__ */ l("div", {
|
|
36
|
-
className: e["input-row"],
|
|
37
|
-
children: [/* @__PURE__ */ c("input", {
|
|
38
|
-
ref: y,
|
|
39
|
-
...v,
|
|
40
|
-
id: C,
|
|
41
|
-
type: b.value ? "text" : "password",
|
|
42
|
-
className: e.input,
|
|
43
|
-
value: h,
|
|
44
|
-
defaultValue: g,
|
|
45
|
-
onChange: (e) => {
|
|
46
|
-
typeof h != "string" && (x.value = e.currentTarget.value), _?.(e);
|
|
47
|
-
}
|
|
48
|
-
}), /* @__PURE__ */ c("button", {
|
|
49
|
-
type: "button",
|
|
50
|
-
className: e["reveal-btn"],
|
|
51
|
-
"aria-label": T,
|
|
52
|
-
onClick: () => {
|
|
53
|
-
b.value = !b.value;
|
|
54
|
-
},
|
|
55
|
-
children: /* @__PURE__ */ c("span", {
|
|
56
|
-
className: e["reveal-icon"],
|
|
57
|
-
"aria-hidden": "true"
|
|
58
|
-
})
|
|
59
|
-
})]
|
|
60
|
-
}), t && w && /* @__PURE__ */ c("div", {
|
|
61
|
-
className: e["strength-meter"],
|
|
62
|
-
role: "meter",
|
|
63
|
-
"aria-label": E,
|
|
64
|
-
"aria-valuenow": w.score,
|
|
65
|
-
"aria-valuemin": 0,
|
|
66
|
-
"aria-valuemax": 4,
|
|
67
|
-
"data-strength": w.label,
|
|
68
|
-
children: [
|
|
69
|
-
0,
|
|
70
|
-
1,
|
|
71
|
-
2,
|
|
72
|
-
3
|
|
73
|
-
].map((t) => /* @__PURE__ */ c("div", {
|
|
74
|
-
className: e["strength-segment"],
|
|
75
|
-
"data-filled": t < w.score ? "" : void 0
|
|
76
|
-
}, t))
|
|
77
|
-
})]
|
|
78
|
-
});
|
|
79
|
-
});
|
|
80
|
-
//#endregion
|
|
81
|
-
export { d as PasswordInput };
|
|
1
|
+
"use client";import e from"./password-input.module.js";import{forwardRef as t,useId as n}from"react";import{cn as r,useSignal as i,useSignals as a}from"@cascivo/core";import{builtin as o,t as s}from"@cascivo/i18n";import{jsx as c,jsxs as l}from"react/jsx-runtime";function u(e){if(!e)return{score:0,label:`weak`};let t=0;return/[a-z]/.test(e)&&t++,/[A-Z]/.test(e)&&t++,/[0-9]/.test(e)&&t++,/[^a-zA-Z0-9]/.test(e)&&t++,e.length>=12&&(t=Math.min(4,t+1)),t=Math.min(4,t),{score:t,label:[`weak`,`weak`,`fair`,`good`,`strong`][t]}}var d=t(function({showStrengthMeter:t=!1,size:d=`md`,labels:f,className:p,id:m,value:h,defaultValue:g,onChange:_,...v},y){a();let b=i(!1),x=i(typeof h==`string`?h:typeof g==`string`?g:``);typeof h==`string`&&(x.value=h);let S=n(),C=m??`cascade-password-${S}`,w=t?u(x.value):null,T=b.value?f?.hide??s(o.passwordInput.hide):f?.reveal??s(o.passwordInput.reveal),E=w?f?.strengthLabel?f.strengthLabel(w.label):s(o.passwordInput.strengthLabel,{level:w.label}):void 0;return l(`div`,{className:r(e.wrapper,p),"data-size":d,"data-revealed":b.value?``:void 0,children:[l(`div`,{className:e[`input-row`],children:[c(`input`,{ref:y,...v,id:C,type:b.value?`text`:`password`,className:e.input,value:h,defaultValue:g,onChange:e=>{typeof h!=`string`&&(x.value=e.currentTarget.value),_?.(e)}}),c(`button`,{type:`button`,className:e[`reveal-btn`],"aria-label":T,onClick:()=>{b.value=!b.value},children:c(`span`,{className:e[`reveal-icon`],"aria-hidden":`true`})})]}),t&&w&&c(`div`,{className:e[`strength-meter`],role:`meter`,"aria-label":E,"aria-valuenow":w.score,"aria-valuemin":0,"aria-valuemax":4,"data-strength":w.label,children:[0,1,2,3].map(t=>c(`div`,{className:e[`strength-segment`],"data-filled":t<w.score?``:void 0},t))})]})});export{d as PasswordInput};
|
|
@@ -1,12 +1,2 @@
|
|
|
1
1
|
import './password-input.css';
|
|
2
|
-
var e
|
|
3
|
-
wrapper: "_wrapper_19052_2",
|
|
4
|
-
"input-row": "_input-row_19052_30",
|
|
5
|
-
input: "_input_19052_30",
|
|
6
|
-
"reveal-btn": "_reveal-btn_19052_72",
|
|
7
|
-
"reveal-icon": "_reveal-icon_19052_98",
|
|
8
|
-
"strength-meter": "_strength-meter_19052_118",
|
|
9
|
-
"strength-segment": "_strength-segment_19052_139"
|
|
10
|
-
};
|
|
11
|
-
//#endregion
|
|
12
|
-
export { e as default };
|
|
2
|
+
var e={wrapper:`_wrapper_19052_2`,"input-row":`_input-row_19052_30`,input:`_input_19052_30`,"reveal-btn":`_reveal-btn_19052_72`,"reveal-icon":`_reveal-icon_19052_98`,"strength-meter":`_strength-meter_19052_118`,"strength-segment":`_strength-segment_19052_139`};export{e as default};
|
package/dist/popover/popover.js
CHANGED
|
@@ -1,51 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { usePopover as e } from "./use-popover.js";
|
|
4
|
-
import t from "./popover.module.js";
|
|
5
|
-
import { createContext as n } from "react";
|
|
6
|
-
import { Slot as r, useSignals as i } from "@cascivo/core";
|
|
7
|
-
import { jsx as a } from "react/jsx-runtime";
|
|
8
|
-
//#region ../components/src/popover/popover.tsx
|
|
9
|
-
var o = n(null);
|
|
10
|
-
function s({ children: t, ...n }) {
|
|
11
|
-
let r = e(n);
|
|
12
|
-
return /* @__PURE__ */ a(o.Provider, {
|
|
13
|
-
value: r,
|
|
14
|
-
children: t
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
function c({ children: e, asChild: n = !1 }) {
|
|
18
|
-
i();
|
|
19
|
-
let s = n ? r : "button";
|
|
20
|
-
return /* @__PURE__ */ a(o.Consumer, { children: (r) => {
|
|
21
|
-
if (!r) throw Error("PopoverTrigger must be used inside <Popover>");
|
|
22
|
-
let { triggerRef: i, toggle: o, anchorName: c, isOpen: l } = r;
|
|
23
|
-
return /* @__PURE__ */ a(s, {
|
|
24
|
-
ref: i,
|
|
25
|
-
type: n ? void 0 : "button",
|
|
26
|
-
"aria-expanded": l.value,
|
|
27
|
-
"aria-haspopup": "dialog",
|
|
28
|
-
style: { anchorName: c },
|
|
29
|
-
onClick: o,
|
|
30
|
-
className: t.trigger,
|
|
31
|
-
children: e
|
|
32
|
-
});
|
|
33
|
-
} });
|
|
34
|
-
}
|
|
35
|
-
function l({ children: e, className: n }) {
|
|
36
|
-
return i(), /* @__PURE__ */ a(o.Consumer, { children: (r) => {
|
|
37
|
-
if (!r) throw Error("PopoverContent must be used inside <Popover>");
|
|
38
|
-
let { popoverRef: i, anchorName: o, isOpen: s } = r;
|
|
39
|
-
return /* @__PURE__ */ a("div", {
|
|
40
|
-
ref: i,
|
|
41
|
-
popover: "auto",
|
|
42
|
-
role: "dialog",
|
|
43
|
-
"data-state": s.value ? "open" : "closed",
|
|
44
|
-
style: { positionAnchor: o },
|
|
45
|
-
className: [t.content, n].filter(Boolean).join(" "),
|
|
46
|
-
children: e
|
|
47
|
-
});
|
|
48
|
-
} });
|
|
49
|
-
}
|
|
50
|
-
//#endregion
|
|
51
|
-
export { s as Popover, l as PopoverContent, c as PopoverTrigger };
|
|
1
|
+
"use client";import{usePopover as e}from"./use-popover.js";import t from"./popover.module.js";import{createContext as n}from"react";import{Slot as r,useSignals as i}from"@cascivo/core";import{jsx as a}from"react/jsx-runtime";var o=n(null);function s({children:t,...n}){let r=e(n);return a(o.Provider,{value:r,children:t})}function c({children:e,asChild:n=!1}){i();let s=n?r:`button`;return a(o.Consumer,{children:r=>{if(!r)throw Error(`PopoverTrigger must be used inside <Popover>`);let{triggerRef:i,toggle:o,anchorName:c,isOpen:l}=r;return a(s,{ref:i,type:n?void 0:`button`,"aria-expanded":l.value,"aria-haspopup":`dialog`,style:{anchorName:c},onClick:o,className:t.trigger,children:e})}})}function l({children:e,className:n}){return i(),a(o.Consumer,{children:r=>{if(!r)throw Error(`PopoverContent must be used inside <Popover>`);let{popoverRef:i,anchorName:o,isOpen:s}=r;return a(`div`,{ref:i,popover:`auto`,role:`dialog`,"data-state":s.value?`open`:`closed`,style:{positionAnchor:o},className:[t.content,n].filter(Boolean).join(` `),children:e})}})}export{s as Popover,l as PopoverContent,c as PopoverTrigger};
|