@cascivo/react 1.0.0 → 1.2.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 +5 -4
- 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 -39
- 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 -272
- 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 -170
- 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 -398
- 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 -224
- 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 -110
- package/dist/dropdown/dropdown.module.js +1 -9
- package/dist/editable/editable.js +1 -76
- 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 -53
- 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 -123
- 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 +1521 -38
- 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 -56
- 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.css +1 -1
- 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 -39
- 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 -272
- 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 -170
- 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 -398
- 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 -224
- 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 -110
- package/dist/node/dropdown/dropdown.module.js +1 -9
- package/dist/node/editable/editable.js +1 -76
- 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 -53
- package/dist/node/field/field.module.js +1 -7
- package/dist/node/file-uploader/file-uploader.js +1 -123
- 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 -56
- 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 -148
- 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 -49
- 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 -96
- 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 -73
- 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 -30
- 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 -68
- 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 -58
- 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 -64
- 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 -42
- 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 -148
- 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 -49
- 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 -96
- 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 -73
- 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 -30
- 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 +401 -55
- 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 -68
- 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 -58
- 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 -64
- 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 -42
- 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 +3 -2
|
@@ -1,169 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { usePopover as e } from "../popover/use-popover.js";
|
|
4
|
-
import t from "./shell-header.module.js";
|
|
5
|
-
import { cn as n, getLinkComponent as r, useSignal as i, useSignalEffect as a, useSignals as o } from "@cascivo/core";
|
|
6
|
-
import { builtin as s, t as c } from "@cascivo/i18n";
|
|
7
|
-
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
8
|
-
//#region ../components/src/shell-header/shell-header.tsx
|
|
9
|
-
function d(e) {
|
|
10
|
-
return typeof e == "object" && !!e && "name" in e;
|
|
11
|
-
}
|
|
12
|
-
function f(e) {
|
|
13
|
-
return "items" in e;
|
|
14
|
-
}
|
|
15
|
-
function p({ item: n }) {
|
|
16
|
-
o();
|
|
17
|
-
let s = r(), { triggerRef: c, popoverRef: d, isOpen: f, anchorName: p, toggle: m, close: h } = e(), g = n.items.some((e) => e.active), _ = i(!1);
|
|
18
|
-
a(() => {
|
|
19
|
-
if (!_.value || !f.value) return;
|
|
20
|
-
_.value = !1;
|
|
21
|
-
let e = d.current;
|
|
22
|
-
e && e.querySelector("[role=\"menuitem\"]")?.focus();
|
|
23
|
-
});
|
|
24
|
-
function v(e) {
|
|
25
|
-
e.key === "ArrowDown" ? (e.preventDefault(), f.value ? d.current?.querySelector("[role=\"menuitem\"]")?.focus() : (_.value = !0, m())) : e.key === "Escape" && (e.preventDefault(), h());
|
|
26
|
-
}
|
|
27
|
-
function y(e) {
|
|
28
|
-
let t = Array.from(d.current?.querySelectorAll("[role=\"menuitem\"]") ?? []), n = t.indexOf(document.activeElement);
|
|
29
|
-
e.key === "ArrowDown" ? (e.preventDefault(), t[(n + 1) % t.length]?.focus()) : e.key === "ArrowUp" ? (e.preventDefault(), t[(n - 1 + t.length) % t.length]?.focus()) : e.key === "Escape" && (h(), c.current?.focus());
|
|
30
|
-
}
|
|
31
|
-
return /* @__PURE__ */ u("li", {
|
|
32
|
-
className: t.navMenuWrapper,
|
|
33
|
-
children: [/* @__PURE__ */ u("button", {
|
|
34
|
-
ref: c,
|
|
35
|
-
type: "button",
|
|
36
|
-
"aria-haspopup": "menu",
|
|
37
|
-
"aria-expanded": f.value,
|
|
38
|
-
"data-state": g ? "active" : void 0,
|
|
39
|
-
style: { anchorName: p },
|
|
40
|
-
className: t.navMenuTrigger,
|
|
41
|
-
onClick: m,
|
|
42
|
-
onKeyDown: v,
|
|
43
|
-
children: [n.label, /* @__PURE__ */ l("svg", {
|
|
44
|
-
viewBox: "0 0 16 16",
|
|
45
|
-
width: "12",
|
|
46
|
-
height: "12",
|
|
47
|
-
"aria-hidden": "true",
|
|
48
|
-
className: t.chevron,
|
|
49
|
-
children: /* @__PURE__ */ l("path", {
|
|
50
|
-
d: "M4 6l4 4 4-4",
|
|
51
|
-
fill: "none",
|
|
52
|
-
stroke: "currentColor",
|
|
53
|
-
strokeWidth: "1.5",
|
|
54
|
-
strokeLinecap: "round",
|
|
55
|
-
strokeLinejoin: "round"
|
|
56
|
-
})
|
|
57
|
-
})]
|
|
58
|
-
}), /* @__PURE__ */ l("div", {
|
|
59
|
-
ref: d,
|
|
60
|
-
popover: "auto",
|
|
61
|
-
role: "menu",
|
|
62
|
-
"aria-label": n.label,
|
|
63
|
-
"data-state": f.value ? "open" : "closed",
|
|
64
|
-
style: { positionAnchor: p },
|
|
65
|
-
className: t.navMenuPanel,
|
|
66
|
-
onKeyDown: y,
|
|
67
|
-
children: n.items.map((e, n) => /* @__PURE__ */ l(s, {
|
|
68
|
-
href: e.href,
|
|
69
|
-
role: "menuitem",
|
|
70
|
-
"aria-current": e.active ? "page" : void 0,
|
|
71
|
-
"data-state": e.active ? "active" : void 0,
|
|
72
|
-
className: t.navMenuItem,
|
|
73
|
-
onClick: h,
|
|
74
|
-
children: e.label
|
|
75
|
-
}, e.id ?? `${n}-${e.href}`))
|
|
76
|
-
})]
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
function m({ brand: e, nav: i, center: a, actions: m, end: h, onMenuClick: g, menuExpanded: _, skipToContentHref: v = "#cascade-main", labels: y, className: b }) {
|
|
80
|
-
o();
|
|
81
|
-
let x = r(), S = y?.nav ?? c(s.shellHeader.nav), C = _ ? y?.closeMenu ?? c(s.shellHeader.closeMenu) : y?.openMenu ?? c(s.shellHeader.openMenu);
|
|
82
|
-
return /* @__PURE__ */ u("header", {
|
|
83
|
-
role: "banner",
|
|
84
|
-
className: n(t.header, b),
|
|
85
|
-
children: [
|
|
86
|
-
v !== !1 && /* @__PURE__ */ l("a", {
|
|
87
|
-
href: v,
|
|
88
|
-
className: t.skipLink,
|
|
89
|
-
children: y?.skipToContent ?? c(s.shellHeader.skipToContent)
|
|
90
|
-
}),
|
|
91
|
-
g && /* @__PURE__ */ l("button", {
|
|
92
|
-
type: "button",
|
|
93
|
-
"aria-label": C,
|
|
94
|
-
"aria-expanded": _ ?? !1,
|
|
95
|
-
className: t.menuButton,
|
|
96
|
-
onClick: g,
|
|
97
|
-
children: /* @__PURE__ */ l("svg", {
|
|
98
|
-
viewBox: "0 0 16 16",
|
|
99
|
-
width: "16",
|
|
100
|
-
height: "16",
|
|
101
|
-
"aria-hidden": "true",
|
|
102
|
-
children: /* @__PURE__ */ l("path", {
|
|
103
|
-
d: "M2 4h12M2 8h12M2 12h12",
|
|
104
|
-
stroke: "currentColor",
|
|
105
|
-
strokeWidth: "1.5",
|
|
106
|
-
strokeLinecap: "round"
|
|
107
|
-
})
|
|
108
|
-
})
|
|
109
|
-
}),
|
|
110
|
-
e != null && (d(e) ? /* @__PURE__ */ u(x, {
|
|
111
|
-
href: e.href ?? "/",
|
|
112
|
-
"aria-label": [e.prefix, e.name].filter(Boolean).join(" "),
|
|
113
|
-
className: t.brand,
|
|
114
|
-
children: [e.prefix && /* @__PURE__ */ l("span", {
|
|
115
|
-
className: t.brandPrefix,
|
|
116
|
-
children: e.prefix
|
|
117
|
-
}), /* @__PURE__ */ l("span", {
|
|
118
|
-
className: t.brandName,
|
|
119
|
-
children: e.name
|
|
120
|
-
})]
|
|
121
|
-
}) : /* @__PURE__ */ l("div", {
|
|
122
|
-
className: t.brand,
|
|
123
|
-
children: e
|
|
124
|
-
})),
|
|
125
|
-
i && i.length > 0 && /* @__PURE__ */ l("nav", {
|
|
126
|
-
"aria-label": S,
|
|
127
|
-
className: t.nav,
|
|
128
|
-
children: /* @__PURE__ */ l("ul", {
|
|
129
|
-
className: t.navList,
|
|
130
|
-
children: i.map((e, n) => f(e) ? /* @__PURE__ */ l(p, { item: e }, e.id ?? `${n}-${e.label}`) : /* @__PURE__ */ l("li", { children: /* @__PURE__ */ l(x, {
|
|
131
|
-
href: e.href,
|
|
132
|
-
"aria-current": e.active ? "page" : void 0,
|
|
133
|
-
"data-state": e.active ? "active" : void 0,
|
|
134
|
-
className: t.navLink,
|
|
135
|
-
...e.onClick ? { onClick: e.onClick } : {},
|
|
136
|
-
children: e.label
|
|
137
|
-
}) }, e.id ?? `${n}-${e.href}`))
|
|
138
|
-
})
|
|
139
|
-
}),
|
|
140
|
-
a ? /* @__PURE__ */ l("div", {
|
|
141
|
-
className: t.center,
|
|
142
|
-
children: a
|
|
143
|
-
}) : /* @__PURE__ */ l("div", { className: t.spacer }),
|
|
144
|
-
m && m.length > 0 && /* @__PURE__ */ l("div", {
|
|
145
|
-
className: t.actions,
|
|
146
|
-
children: m.map((e) => /* @__PURE__ */ l("button", {
|
|
147
|
-
type: "button",
|
|
148
|
-
"aria-label": e.label,
|
|
149
|
-
"aria-pressed": e.active ?? !1,
|
|
150
|
-
title: e.label,
|
|
151
|
-
"data-state": e.active ? "active" : void 0,
|
|
152
|
-
className: t.action,
|
|
153
|
-
onClick: e.onClick,
|
|
154
|
-
children: /* @__PURE__ */ l("span", {
|
|
155
|
-
className: t.actionIcon,
|
|
156
|
-
"aria-hidden": "true",
|
|
157
|
-
children: e.icon
|
|
158
|
-
})
|
|
159
|
-
}, e.id))
|
|
160
|
-
}),
|
|
161
|
-
h && /* @__PURE__ */ l("div", {
|
|
162
|
-
className: t.end,
|
|
163
|
-
children: h
|
|
164
|
-
})
|
|
165
|
-
]
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
//#endregion
|
|
169
|
-
export { m as ShellHeader };
|
|
1
|
+
"use client";import{usePopover as e}from"../popover/use-popover.js";import t from"./shell-header.module.js";import{cn as n,getLinkComponent as r,useSignal as i,useSignalEffect as a,useSignals as o}from"@cascivo/core";import{builtin as s,t as c}from"@cascivo/i18n";import{jsx as l,jsxs as u}from"react/jsx-runtime";function isBrandObject(e){return typeof e==`object`&&!!e&&`name`in e}function isNavMenu(e){return`items`in e}function NavMenu({item:n}){o();let s=r(),{triggerRef:c,popoverRef:d,isOpen:f,anchorName:p,toggle:m,close:h}=e(),g=n.items.some(e=>e.active),_=i(!1);a(()=>{if(!_.value||!f.value)return;_.value=!1;let e=d.current;e&&e.querySelector(`[role="menuitem"]`)?.focus()});function handleTriggerKeyDown(e){e.key===`ArrowDown`?(e.preventDefault(),f.value?d.current?.querySelector(`[role="menuitem"]`)?.focus():(_.value=!0,m())):e.key===`Escape`&&(e.preventDefault(),h())}function handlePanelKeyDown(e){let t=Array.from(d.current?.querySelectorAll(`[role="menuitem"]`)??[]),n=t.indexOf(document.activeElement);e.key===`ArrowDown`?(e.preventDefault(),t[(n+1)%t.length]?.focus()):e.key===`ArrowUp`?(e.preventDefault(),t[(n-1+t.length)%t.length]?.focus()):e.key===`Escape`&&(h(),c.current?.focus())}return u(`li`,{className:t.navMenuWrapper,children:[u(`button`,{ref:c,type:`button`,"aria-haspopup":`menu`,"aria-expanded":f.value,"data-state":g?`active`:void 0,style:{anchorName:p},className:t.navMenuTrigger,onClick:m,onKeyDown:handleTriggerKeyDown,children:[n.label,l(`svg`,{viewBox:`0 0 16 16`,width:`12`,height:`12`,"aria-hidden":`true`,className:t.chevron,children:l(`path`,{d:`M4 6l4 4 4-4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})})]}),l(`div`,{ref:d,popover:`auto`,role:`menu`,"aria-label":n.label,"data-state":f.value?`open`:`closed`,style:{positionAnchor:p},className:t.navMenuPanel,onKeyDown:handlePanelKeyDown,children:n.items.map((e,n)=>l(s,{href:e.href,role:`menuitem`,"aria-current":e.active?`page`:void 0,"data-state":e.active?`active`:void 0,className:t.navMenuItem,onClick:h,children:e.label},e.id??`${n}-${e.href}`))})]})}function ShellHeader({brand:e,nav:i,center:a,actions:d,end:f,onMenuClick:p,menuExpanded:m,skipToContentHref:h=`#cascade-main`,labels:g,className:_}){o();let v=r(),y=g?.nav??c(s.shellHeader.nav),b=m?g?.closeMenu??c(s.shellHeader.closeMenu):g?.openMenu??c(s.shellHeader.openMenu);return u(`header`,{role:`banner`,className:n(t.header,_),children:[h!==!1&&l(`a`,{href:h,className:t.skipLink,children:g?.skipToContent??c(s.shellHeader.skipToContent)}),p&&l(`button`,{type:`button`,"aria-label":b,"aria-expanded":m??!1,className:t.menuButton,onClick:p,children:l(`svg`,{viewBox:`0 0 16 16`,width:`16`,height:`16`,"aria-hidden":`true`,children:l(`path`,{d:`M2 4h12M2 8h12M2 12h12`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`})})}),e!=null&&(isBrandObject(e)?u(v,{href:e.href??`/`,"aria-label":[e.prefix,e.name].filter(Boolean).join(` `),className:t.brand,children:[e.prefix&&l(`span`,{className:t.brandPrefix,children:e.prefix}),l(`span`,{className:t.brandName,children:e.name})]}):l(`div`,{className:t.brand,children:e})),i&&i.length>0&&l(`nav`,{"aria-label":y,className:t.nav,children:l(`ul`,{className:t.navList,children:i.map((e,n)=>isNavMenu(e)?l(NavMenu,{item:e},e.id??`${n}-${e.label}`):l(`li`,{children:l(v,{href:e.href,"aria-current":e.active?`page`:void 0,"data-state":e.active?`active`:void 0,className:t.navLink,...e.onClick?{onClick:e.onClick}:{},children:e.label})},e.id??`${n}-${e.href}`))})}),a?l(`div`,{className:t.center,children:a}):l(`div`,{className:t.spacer}),d&&d.length>0&&l(`div`,{className:t.actions,children:d.map(e=>l(`button`,{type:`button`,"aria-label":e.label,"aria-pressed":e.active??!1,title:e.label,"data-state":e.active?`active`:void 0,className:t.action,onClick:e.onClick,children:l(`span`,{className:t.actionIcon,"aria-hidden":`true`,children:e.icon})},e.id))}),f&&l(`div`,{className:t.end,children:f})]})}export{ShellHeader};
|
|
@@ -1,24 +1 @@
|
|
|
1
|
-
var e
|
|
2
|
-
header: "_header_6njjo_2",
|
|
3
|
-
skipLink: "_skipLink_6njjo_14",
|
|
4
|
-
menuButton: "_menuButton_6njjo_36",
|
|
5
|
-
brand: "_brand_6njjo_59",
|
|
6
|
-
brandPrefix: "_brandPrefix_6njjo_69",
|
|
7
|
-
brandName: "_brandName_6njjo_73",
|
|
8
|
-
nav: "_nav_6njjo_77",
|
|
9
|
-
navList: "_navList_6njjo_81",
|
|
10
|
-
navLink: "_navLink_6njjo_90",
|
|
11
|
-
navMenuWrapper: "_navMenuWrapper_6njjo_119",
|
|
12
|
-
navMenuTrigger: "_navMenuTrigger_6njjo_124",
|
|
13
|
-
chevron: "_chevron_6njjo_156",
|
|
14
|
-
navMenuPanel: "_navMenuPanel_6njjo_164",
|
|
15
|
-
navMenuItem: "_navMenuItem_6njjo_197",
|
|
16
|
-
spacer: "_spacer_6njjo_219",
|
|
17
|
-
center: "_center_6njjo_226",
|
|
18
|
-
actions: "_actions_6njjo_235",
|
|
19
|
-
action: "_action_6njjo_235",
|
|
20
|
-
actionIcon: "_actionIcon_6njjo_269",
|
|
21
|
-
end: "_end_6njjo_277"
|
|
22
|
-
};
|
|
23
|
-
//#endregion
|
|
24
|
-
export { e as default };
|
|
1
|
+
var e={header:`_header_awr9h_2`,skipLink:`_skipLink_awr9h_14`,menuButton:`_menuButton_awr9h_36`,brand:`_brand_awr9h_59`,brandPrefix:`_brandPrefix_awr9h_69`,brandName:`_brandName_awr9h_73`,nav:`_nav_awr9h_77`,navList:`_navList_awr9h_81`,navLink:`_navLink_awr9h_90`,navMenuWrapper:`_navMenuWrapper_awr9h_119`,navMenuTrigger:`_navMenuTrigger_awr9h_124`,chevron:`_chevron_awr9h_156`,navMenuPanel:`_navMenuPanel_awr9h_164`,navMenuItem:`_navMenuItem_awr9h_197`,spacer:`_spacer_awr9h_219`,center:`_center_awr9h_226`,actions:`_actions_awr9h_235`,action:`_action_awr9h_235`,actionIcon:`_actionIcon_awr9h_269`,end:`_end_awr9h_277`};export{e as default};
|
|
@@ -1,334 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { Tooltip as e } from "../tooltip/tooltip.js";
|
|
4
|
-
import { usePopover as t } from "../popover/use-popover.js";
|
|
5
|
-
import n from "./side-nav.module.js";
|
|
6
|
-
import { Fragment as r, useId as i } from "react";
|
|
7
|
-
import { cn as a, focusElement as o, getLinkComponent as s, useControllableSignal as c, useSignal as l, useSignals as u } from "@cascivo/core";
|
|
8
|
-
import { builtin as d, t as f } from "@cascivo/i18n";
|
|
9
|
-
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
10
|
-
//#region ../components/src/side-nav/side-nav.tsx
|
|
11
|
-
function g(e) {
|
|
12
|
-
return !("type" in e);
|
|
13
|
-
}
|
|
14
|
-
function _() {
|
|
15
|
-
return /* @__PURE__ */ m("svg", {
|
|
16
|
-
viewBox: "0 0 16 16",
|
|
17
|
-
width: "14",
|
|
18
|
-
height: "14",
|
|
19
|
-
"aria-hidden": "true",
|
|
20
|
-
className: n.checkMark,
|
|
21
|
-
children: /* @__PURE__ */ m("path", {
|
|
22
|
-
d: "M3.5 8.5l3 3 6-7",
|
|
23
|
-
fill: "none",
|
|
24
|
-
stroke: "currentColor",
|
|
25
|
-
strokeWidth: "1.5",
|
|
26
|
-
strokeLinecap: "round",
|
|
27
|
-
strokeLinejoin: "round"
|
|
28
|
-
})
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
function v(e, { inMenu: t, onActivate: r, extraClass: i }) {
|
|
32
|
-
let o = t ? "menuitem" : void 0, c = a(n.link, n.sublink, i), l = /* @__PURE__ */ h(p, { children: [
|
|
33
|
-
e.icon ? /* @__PURE__ */ m("span", {
|
|
34
|
-
className: n.icon,
|
|
35
|
-
"aria-hidden": "true",
|
|
36
|
-
children: e.icon
|
|
37
|
-
}) : null,
|
|
38
|
-
/* @__PURE__ */ m("span", {
|
|
39
|
-
className: n.label,
|
|
40
|
-
children: e.label
|
|
41
|
-
}),
|
|
42
|
-
e.selected ? /* @__PURE__ */ m(_, {}) : null
|
|
43
|
-
] });
|
|
44
|
-
return e.onSelect && !e.href ? /* @__PURE__ */ m("button", {
|
|
45
|
-
type: "button",
|
|
46
|
-
role: o,
|
|
47
|
-
"aria-current": e.active ? "page" : void 0,
|
|
48
|
-
"data-state": e.active ? "active" : void 0,
|
|
49
|
-
"data-selected": e.selected || void 0,
|
|
50
|
-
disabled: e.disabled,
|
|
51
|
-
className: c,
|
|
52
|
-
onClick: () => {
|
|
53
|
-
e.onSelect?.(), r?.();
|
|
54
|
-
},
|
|
55
|
-
children: l
|
|
56
|
-
}) : /* @__PURE__ */ m(s(), {
|
|
57
|
-
href: e.disabled ? void 0 : e.href,
|
|
58
|
-
role: o,
|
|
59
|
-
"aria-current": e.active ? "page" : void 0,
|
|
60
|
-
"aria-disabled": e.disabled || void 0,
|
|
61
|
-
tabIndex: e.disabled ? -1 : void 0,
|
|
62
|
-
"data-state": e.active ? "active" : void 0,
|
|
63
|
-
"data-selected": e.selected || void 0,
|
|
64
|
-
className: c,
|
|
65
|
-
onClick: (t) => {
|
|
66
|
-
if (e.disabled) {
|
|
67
|
-
t.preventDefault();
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
e.onSelect?.(), r?.();
|
|
71
|
-
},
|
|
72
|
-
children: l
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
function y(e) {
|
|
76
|
-
if (typeof Intl < "u" && "Segmenter" in Intl) {
|
|
77
|
-
let t = new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
78
|
-
for (let n of t.segment(e)) return n.segment;
|
|
79
|
-
}
|
|
80
|
-
return [...e][0] ?? "";
|
|
81
|
-
}
|
|
82
|
-
function b({ item: e }) {
|
|
83
|
-
let { triggerRef: i, popoverRef: a, isOpen: s, anchorName: c, open: l, close: u, toggle: d } = t(), f = "[role=\"menuitem\"]:not([disabled]):not([aria-disabled=\"true\"])";
|
|
84
|
-
return /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("button", {
|
|
85
|
-
ref: i,
|
|
86
|
-
type: "button",
|
|
87
|
-
"aria-haspopup": "menu",
|
|
88
|
-
"aria-expanded": s.value,
|
|
89
|
-
"aria-label": e.label,
|
|
90
|
-
"data-state": s.value ? "open" : "closed",
|
|
91
|
-
style: { anchorName: c },
|
|
92
|
-
className: n.groupTrigger,
|
|
93
|
-
onClick: () => d(),
|
|
94
|
-
onKeyDown: (e) => {
|
|
95
|
-
if (e.key === "ArrowDown") {
|
|
96
|
-
e.preventDefault(), s.value || l();
|
|
97
|
-
let t = a.current;
|
|
98
|
-
t && setTimeout(() => {
|
|
99
|
-
t.querySelector(f)?.focus();
|
|
100
|
-
}, 0);
|
|
101
|
-
} else e.key === "Escape" && u();
|
|
102
|
-
},
|
|
103
|
-
children: e.icon ? /* @__PURE__ */ m("span", {
|
|
104
|
-
className: n.icon,
|
|
105
|
-
"aria-hidden": "true",
|
|
106
|
-
children: e.icon
|
|
107
|
-
}) : /* @__PURE__ */ m("span", {
|
|
108
|
-
className: n.fallbackIcon,
|
|
109
|
-
"data-fallback-icon": !0,
|
|
110
|
-
"aria-hidden": "true",
|
|
111
|
-
children: y(e.label)
|
|
112
|
-
})
|
|
113
|
-
}), /* @__PURE__ */ h("div", {
|
|
114
|
-
ref: a,
|
|
115
|
-
popover: "auto",
|
|
116
|
-
role: "menu",
|
|
117
|
-
"aria-label": e.label,
|
|
118
|
-
style: { positionAnchor: c },
|
|
119
|
-
className: n.railFlyout,
|
|
120
|
-
onKeyDown: (e) => {
|
|
121
|
-
let t = a.current;
|
|
122
|
-
if (!t) return;
|
|
123
|
-
let n = Array.from(t.querySelectorAll(f)), r = n.indexOf(e.target);
|
|
124
|
-
e.key === "ArrowDown" ? (e.preventDefault(), n[(r + 1) % n.length]?.focus()) : e.key === "ArrowUp" ? (e.preventDefault(), n[(r - 1 + n.length) % n.length]?.focus()) : e.key === "Escape" && (e.preventDefault(), u(), o(i.current));
|
|
125
|
-
},
|
|
126
|
-
children: [/* @__PURE__ */ m("div", {
|
|
127
|
-
className: n.railFlyoutCaption,
|
|
128
|
-
"aria-hidden": "true",
|
|
129
|
-
children: e.label
|
|
130
|
-
}), e.items.map((e, t) => g(e) ? /* @__PURE__ */ m(r, { children: v(e, {
|
|
131
|
-
inMenu: !0,
|
|
132
|
-
onActivate: u,
|
|
133
|
-
extraClass: n.flyoutItem
|
|
134
|
-
}) }, t) : e.type === "separator" ? /* @__PURE__ */ m("div", {
|
|
135
|
-
role: "separator",
|
|
136
|
-
className: n.flyoutSeparator
|
|
137
|
-
}, t) : /* @__PURE__ */ m("div", {
|
|
138
|
-
className: n.railFlyoutCaption,
|
|
139
|
-
"aria-hidden": "true",
|
|
140
|
-
children: e.label
|
|
141
|
-
}, t))]
|
|
142
|
-
})] });
|
|
143
|
-
}
|
|
144
|
-
function x({ items: t, groups: r, collapsed: o, defaultCollapsed: _ = !1, onCollapsedChange: x, ariaLabel: S, label: C, collapseLabel: w, expandLabel: T, expandOnHover: E = !1, showCollapseToggle: D = !0, header: O, footer: k, className: A }) {
|
|
145
|
-
u();
|
|
146
|
-
let j = S ?? C ?? f(d.sideNav.nav), M = w ?? f(d.sideNav.collapse), N = T ?? f(d.sideNav.expand), P = i(), [F] = c({
|
|
147
|
-
value: o,
|
|
148
|
-
defaultValue: _
|
|
149
|
-
}), I = r ?? (t ? [{ items: t }] : [{ items: [] }]), L = l(I.flatMap((e) => e.items).filter((e) => e.items?.some((e) => g(e) && e.active)).map((e) => e.label)), R = (e) => {
|
|
150
|
-
let t = L.value;
|
|
151
|
-
L.value = t.includes(e) ? t.filter((t) => t !== e) : [...t, e];
|
|
152
|
-
}, z = () => {
|
|
153
|
-
let e = !F.value;
|
|
154
|
-
o === void 0 && (F.value = e), x?.(e);
|
|
155
|
-
}, B = F.value;
|
|
156
|
-
return /* @__PURE__ */ h("nav", {
|
|
157
|
-
"aria-label": j,
|
|
158
|
-
"data-state": B ? "collapsed" : "expanded",
|
|
159
|
-
"data-expand-on-hover": B && E ? "" : void 0,
|
|
160
|
-
className: a(n.sideNav, A),
|
|
161
|
-
children: [
|
|
162
|
-
O && /* @__PURE__ */ m("div", {
|
|
163
|
-
className: n.header,
|
|
164
|
-
children: O
|
|
165
|
-
}),
|
|
166
|
-
/* @__PURE__ */ m("ul", {
|
|
167
|
-
className: n.list,
|
|
168
|
-
children: I.map((t, r) => /* @__PURE__ */ h("li", {
|
|
169
|
-
className: n.group,
|
|
170
|
-
children: [t.label && /* @__PURE__ */ m("h3", {
|
|
171
|
-
className: n.groupLabel,
|
|
172
|
-
children: t.label
|
|
173
|
-
}), /* @__PURE__ */ m("ul", {
|
|
174
|
-
className: n.groupItems,
|
|
175
|
-
children: t.items.map((t, i) => {
|
|
176
|
-
let a = `${r}-${i}`;
|
|
177
|
-
if (t.items) {
|
|
178
|
-
if (B && !E) return /* @__PURE__ */ m("li", { children: /* @__PURE__ */ m(b, { item: t }) }, t.id ?? a);
|
|
179
|
-
let e = L.value.includes(t.label), r = `${P}-group-${a}`;
|
|
180
|
-
return /* @__PURE__ */ h("li", { children: [/* @__PURE__ */ h("button", {
|
|
181
|
-
type: "button",
|
|
182
|
-
"aria-expanded": e,
|
|
183
|
-
"aria-controls": r,
|
|
184
|
-
"aria-label": B ? t.label : void 0,
|
|
185
|
-
"data-state": e ? "open" : "closed",
|
|
186
|
-
className: n.groupTrigger,
|
|
187
|
-
onClick: () => R(t.label),
|
|
188
|
-
children: [
|
|
189
|
-
t.icon ? /* @__PURE__ */ m("span", {
|
|
190
|
-
className: n.icon,
|
|
191
|
-
"aria-hidden": "true",
|
|
192
|
-
children: t.icon
|
|
193
|
-
}) : B ? /* @__PURE__ */ m("span", {
|
|
194
|
-
className: n.fallbackIcon,
|
|
195
|
-
"data-fallback-icon": !0,
|
|
196
|
-
"aria-hidden": "true",
|
|
197
|
-
children: y(t.label)
|
|
198
|
-
}) : null,
|
|
199
|
-
/* @__PURE__ */ m("span", {
|
|
200
|
-
className: n.label,
|
|
201
|
-
"data-rail-hidden": B || void 0,
|
|
202
|
-
children: t.label
|
|
203
|
-
}),
|
|
204
|
-
/* @__PURE__ */ m("svg", {
|
|
205
|
-
viewBox: "0 0 16 16",
|
|
206
|
-
width: "12",
|
|
207
|
-
height: "12",
|
|
208
|
-
"aria-hidden": "true",
|
|
209
|
-
className: n.groupIndicator,
|
|
210
|
-
children: /* @__PURE__ */ m("path", {
|
|
211
|
-
d: "M4 6l4 4 4-4",
|
|
212
|
-
fill: "none",
|
|
213
|
-
stroke: "currentColor",
|
|
214
|
-
strokeWidth: "1.5",
|
|
215
|
-
strokeLinecap: "round",
|
|
216
|
-
strokeLinejoin: "round"
|
|
217
|
-
})
|
|
218
|
-
})
|
|
219
|
-
]
|
|
220
|
-
}), /* @__PURE__ */ m("div", {
|
|
221
|
-
id: r,
|
|
222
|
-
"data-state": e ? "open" : "closed",
|
|
223
|
-
className: n.sublist,
|
|
224
|
-
children: /* @__PURE__ */ m("ul", {
|
|
225
|
-
className: n.sublistInner,
|
|
226
|
-
children: t.items.map((e, t) => g(e) ? /* @__PURE__ */ m("li", { children: v(e, { inMenu: !1 }) }, t) : e.type === "separator" ? /* @__PURE__ */ m("li", {
|
|
227
|
-
role: "separator",
|
|
228
|
-
className: n.subSeparator
|
|
229
|
-
}, t) : /* @__PURE__ */ m("li", {
|
|
230
|
-
className: n.subGroupLabel,
|
|
231
|
-
children: e.label
|
|
232
|
-
}, t))
|
|
233
|
-
})
|
|
234
|
-
})] }, t.id ?? a);
|
|
235
|
-
}
|
|
236
|
-
let o = /* @__PURE__ */ h(p, { children: [
|
|
237
|
-
t.icon ? /* @__PURE__ */ m("span", {
|
|
238
|
-
className: n.icon,
|
|
239
|
-
"aria-hidden": "true",
|
|
240
|
-
children: t.icon
|
|
241
|
-
}) : B ? /* @__PURE__ */ m("span", {
|
|
242
|
-
className: n.fallbackIcon,
|
|
243
|
-
"data-fallback-icon": !0,
|
|
244
|
-
"aria-hidden": "true",
|
|
245
|
-
children: y(t.label)
|
|
246
|
-
}) : null,
|
|
247
|
-
/* @__PURE__ */ m("span", {
|
|
248
|
-
className: n.label,
|
|
249
|
-
"data-rail-hidden": B || void 0,
|
|
250
|
-
children: t.label
|
|
251
|
-
}),
|
|
252
|
-
t.trailing == null ? null : /* @__PURE__ */ m("span", {
|
|
253
|
-
className: n.trailing,
|
|
254
|
-
"data-rail-hidden": B || void 0,
|
|
255
|
-
children: t.trailing
|
|
256
|
-
})
|
|
257
|
-
] }), c = t.tone && t.tone !== "default" ? t.tone : void 0, l = {
|
|
258
|
-
href: t.disabled ? void 0 : t.href,
|
|
259
|
-
"aria-current": t.active ? "page" : void 0,
|
|
260
|
-
"aria-label": B ? t.label : void 0,
|
|
261
|
-
"aria-disabled": t.disabled || void 0,
|
|
262
|
-
tabIndex: t.disabled ? -1 : void 0,
|
|
263
|
-
"data-state": t.active ? "active" : void 0,
|
|
264
|
-
"data-tone": c,
|
|
265
|
-
className: n.link,
|
|
266
|
-
onClick: (e) => {
|
|
267
|
-
if (t.disabled) {
|
|
268
|
-
e.preventDefault();
|
|
269
|
-
return;
|
|
270
|
-
}
|
|
271
|
-
t.onClick?.(e);
|
|
272
|
-
}
|
|
273
|
-
};
|
|
274
|
-
if (t.render) return /* @__PURE__ */ m("li", {
|
|
275
|
-
className: n.customItem,
|
|
276
|
-
children: t.render({
|
|
277
|
-
collapsed: B,
|
|
278
|
-
children: o,
|
|
279
|
-
linkProps: l
|
|
280
|
-
})
|
|
281
|
-
}, t.id ?? a);
|
|
282
|
-
let u = s(), d = t.onClick && !t.href ? /* @__PURE__ */ m("button", {
|
|
283
|
-
type: "button",
|
|
284
|
-
"aria-current": t.active ? "page" : void 0,
|
|
285
|
-
"aria-label": B ? t.label : void 0,
|
|
286
|
-
"data-state": t.active ? "active" : void 0,
|
|
287
|
-
"data-tone": c,
|
|
288
|
-
className: n.link,
|
|
289
|
-
disabled: t.disabled,
|
|
290
|
-
onClick: (e) => t.onClick?.(e),
|
|
291
|
-
children: o
|
|
292
|
-
}) : /* @__PURE__ */ m(u, {
|
|
293
|
-
...l,
|
|
294
|
-
children: o
|
|
295
|
-
});
|
|
296
|
-
return /* @__PURE__ */ m("li", { children: B && !E ? /* @__PURE__ */ m(e, {
|
|
297
|
-
content: t.label,
|
|
298
|
-
placement: "right",
|
|
299
|
-
children: d
|
|
300
|
-
}) : d }, t.id ?? a);
|
|
301
|
-
})
|
|
302
|
-
})]
|
|
303
|
-
}, t.id ?? r))
|
|
304
|
-
}),
|
|
305
|
-
k && /* @__PURE__ */ m("div", {
|
|
306
|
-
className: n.footer,
|
|
307
|
-
children: k
|
|
308
|
-
}),
|
|
309
|
-
D && /* @__PURE__ */ m("button", {
|
|
310
|
-
type: "button",
|
|
311
|
-
"aria-label": B ? N : M,
|
|
312
|
-
className: n.collapseToggle,
|
|
313
|
-
onClick: z,
|
|
314
|
-
children: /* @__PURE__ */ m("svg", {
|
|
315
|
-
viewBox: "0 0 16 16",
|
|
316
|
-
width: "14",
|
|
317
|
-
height: "14",
|
|
318
|
-
"aria-hidden": "true",
|
|
319
|
-
className: n.collapseIcon,
|
|
320
|
-
children: /* @__PURE__ */ m("path", {
|
|
321
|
-
d: "M10 4l-4 4 4 4",
|
|
322
|
-
fill: "none",
|
|
323
|
-
stroke: "currentColor",
|
|
324
|
-
strokeWidth: "1.5",
|
|
325
|
-
strokeLinecap: "round",
|
|
326
|
-
strokeLinejoin: "round"
|
|
327
|
-
})
|
|
328
|
-
})
|
|
329
|
-
})
|
|
330
|
-
]
|
|
331
|
-
});
|
|
332
|
-
}
|
|
333
|
-
//#endregion
|
|
334
|
-
export { x as SideNav };
|
|
1
|
+
"use client";import{Tooltip as e}from"../tooltip/tooltip.js";import{usePopover as t}from"../popover/use-popover.js";import n from"./side-nav.module.js";import{Fragment as r,useId as i}from"react";import{cn as a,focusElement as o,getLinkComponent as s,useSignal as c,useSignals as l}from"@cascivo/core";import{builtin as u,t as d}from"@cascivo/i18n";import{Fragment as f,jsx as p,jsxs as m}from"react/jsx-runtime";function isLinkSubItem(e){return!(`type`in e)}function renderSlot(e,t){return typeof e==`function`?e({collapsed:t}):e}function CheckMark(){return p(`svg`,{viewBox:`0 0 16 16`,width:`14`,height:`14`,"aria-hidden":`true`,className:n.checkMark,children:p(`path`,{d:`M3.5 8.5l3 3 6-7`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function renderSubControl(e,{inMenu:t,onActivate:r,extraClass:i}){let o=t?`menuitem`:void 0,c=a(n.link,n.sublink,i),l=m(f,{children:[e.icon?p(`span`,{className:n.icon,"aria-hidden":`true`,children:e.icon}):null,p(`span`,{className:n.label,children:e.label}),e.selected?p(CheckMark,{}):null]});return e.onSelect&&!e.href?p(`button`,{type:`button`,role:o,"aria-current":e.active?`page`:void 0,"data-state":e.active?`active`:void 0,"data-selected":e.selected||void 0,disabled:e.disabled,className:c,onClick:()=>{e.onSelect?.(),r?.()},children:l}):p(s(),{href:e.disabled?void 0:e.href,role:o,"aria-current":e.active?`page`:void 0,"aria-disabled":e.disabled||void 0,tabIndex:e.disabled?-1:void 0,"data-state":e.active?`active`:void 0,"data-selected":e.selected||void 0,className:c,onClick:t=>{if(e.disabled){t.preventDefault();return}e.onSelect?.(),r?.()},children:l})}function firstGrapheme(e){if(typeof Intl<`u`&&`Segmenter`in Intl){let t=new Intl.Segmenter(void 0,{granularity:`grapheme`});for(let n of t.segment(e))return n.segment}return[...e][0]??``}function RailGroupFlyout({item:e}){let{triggerRef:i,popoverRef:a,isOpen:s,anchorName:c,open:l,close:u,toggle:d}=t(),h=`[role="menuitem"]:not([disabled]):not([aria-disabled="true"])`;return m(f,{children:[p(`button`,{ref:i,type:`button`,"aria-haspopup":`menu`,"aria-expanded":s.value,"aria-label":e.label,"data-state":s.value?`open`:`closed`,style:{anchorName:c},className:n.groupTrigger,onClick:()=>d(),onKeyDown:e=>{if(e.key===`ArrowDown`){e.preventDefault(),s.value||l();let t=a.current;t&&setTimeout(()=>{t.querySelector(h)?.focus()},0)}else e.key===`Escape`&&u()},children:e.icon?p(`span`,{className:n.icon,"aria-hidden":`true`,children:e.icon}):p(`span`,{className:n.fallbackIcon,"data-fallback-icon":!0,"aria-hidden":`true`,children:firstGrapheme(e.label)})}),m(`div`,{ref:a,popover:`auto`,role:`menu`,"aria-label":e.label,style:{positionAnchor:c},className:n.railFlyout,onKeyDown:e=>{let t=a.current;if(!t)return;let n=Array.from(t.querySelectorAll(h)),r=n.indexOf(e.target);e.key===`ArrowDown`?(e.preventDefault(),n[(r+1)%n.length]?.focus()):e.key===`ArrowUp`?(e.preventDefault(),n[(r-1+n.length)%n.length]?.focus()):e.key===`Escape`&&(e.preventDefault(),u(),o(i.current))},children:[p(`div`,{className:n.railFlyoutCaption,"aria-hidden":`true`,children:e.label}),e.items.map((e,t)=>isLinkSubItem(e)?p(r,{children:renderSubControl(e,{inMenu:!0,onActivate:u,extraClass:n.flyoutItem})},t):e.type===`separator`?p(`div`,{role:`separator`,className:n.flyoutSeparator},t):p(`div`,{className:n.railFlyoutCaption,"aria-hidden":`true`,children:e.label},t))]})]})}function SideNav({items:t,groups:r,collapsed:o,defaultCollapsed:h=!1,onCollapsedChange:g,ariaLabel:_,label:v,collapseLabel:y,expandLabel:b,expandOnHover:x=!1,showCollapseToggle:S=!0,header:C,footer:w,className:T}){l();let E=_??v??d(u.sideNav.nav),D=y??d(u.sideNav.collapse),O=b??d(u.sideNav.expand),k=i(),A=c(h),j=o??A.value,M=r??(t?[{items:t}]:[{items:[]}]),N=c(M.flatMap(e=>e.items).filter(e=>e.items?.some(e=>isLinkSubItem(e)&&e.active)).map(e=>e.label)),toggleGroup=e=>{let t=N.value;N.value=t.includes(e)?t.filter(t=>t!==e):[...t,e]};return m(`nav`,{"aria-label":E,"data-state":j?`collapsed`:`expanded`,"data-expand-on-hover":j&&x?``:void 0,className:a(n.sideNav,T),children:[C!=null&&C!==!1&&p(`div`,{className:n.header,children:renderSlot(C,j)}),p(`ul`,{className:n.list,children:M.map((t,r)=>m(`li`,{className:n.group,children:[t.label&&p(`h3`,{className:n.groupLabel,children:t.label}),p(`ul`,{className:n.groupItems,children:t.items.map((t,i)=>{let a=`${r}-${i}`;if(t.items){if(j&&!x)return p(`li`,{children:p(RailGroupFlyout,{item:t})},t.id??a);let e=N.value.includes(t.label),r=`${k}-group-${a}`;return m(`li`,{children:[m(`button`,{type:`button`,"aria-expanded":e,"aria-controls":r,"aria-label":j?t.label:void 0,"data-state":e?`open`:`closed`,className:n.groupTrigger,onClick:()=>toggleGroup(t.label),children:[t.icon?p(`span`,{className:n.icon,"aria-hidden":`true`,children:t.icon}):j?p(`span`,{className:n.fallbackIcon,"data-fallback-icon":!0,"aria-hidden":`true`,children:firstGrapheme(t.label)}):null,p(`span`,{className:n.label,"data-rail-hidden":j||void 0,children:t.label}),p(`svg`,{viewBox:`0 0 16 16`,width:`12`,height:`12`,"aria-hidden":`true`,className:n.groupIndicator,children:p(`path`,{d:`M4 6l4 4 4-4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})})]}),p(`div`,{id:r,"data-state":e?`open`:`closed`,className:n.sublist,children:p(`ul`,{className:n.sublistInner,children:t.items.map((e,t)=>isLinkSubItem(e)?p(`li`,{children:renderSubControl(e,{inMenu:!1})},t):e.type===`separator`?p(`li`,{role:`separator`,className:n.subSeparator},t):p(`li`,{className:n.subGroupLabel,children:e.label},t))})})]},t.id??a)}let o=m(f,{children:[t.icon?p(`span`,{className:n.icon,"aria-hidden":`true`,children:t.icon}):j?p(`span`,{className:n.fallbackIcon,"data-fallback-icon":!0,"aria-hidden":`true`,children:firstGrapheme(t.label)}):null,p(`span`,{className:n.label,"data-rail-hidden":j||void 0,children:t.label}),t.trailing==null?null:p(`span`,{className:n.trailing,"data-rail-hidden":j||void 0,children:t.trailing})]}),c=t.tone&&t.tone!=="default"?t.tone:void 0,l={href:t.disabled?void 0:t.href,"aria-current":t.active?`page`:void 0,"aria-label":j?t.label:void 0,"aria-disabled":t.disabled||void 0,tabIndex:t.disabled?-1:void 0,"data-state":t.active?`active`:void 0,"data-tone":c,className:n.link,onClick:e=>{if(t.disabled){e.preventDefault();return}t.onClick?.(e)}};if(t.render)return p(`li`,{className:n.customItem,children:t.render({collapsed:j,children:o,linkProps:l})},t.id??a);let u=s(),d=t.onClick&&!t.href?p(`button`,{type:`button`,"aria-current":t.active?`page`:void 0,"aria-label":j?t.label:void 0,"data-state":t.active?`active`:void 0,"data-tone":c,className:n.link,disabled:t.disabled,onClick:e=>t.onClick?.(e),children:o}):p(u,{...l,children:o});return p(`li`,{children:j&&!x?p(e,{content:t.label,placement:`right`,children:d}):d},t.id??a)})})]},t.id??r))}),w!=null&&w!==!1&&p(`div`,{className:n.footer,children:renderSlot(w,j)}),S&&p(`button`,{type:`button`,"aria-label":j?O:D,className:n.collapseToggle,onClick:()=>{let e=!j;o===void 0&&(A.value=e),g?.(e)},children:p(`svg`,{viewBox:`0 0 16 16`,width:`14`,height:`14`,"aria-hidden":`true`,className:n.collapseIcon,children:p(`path`,{d:`M10 4l-4 4 4 4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})})})]})}export{SideNav};
|
|
@@ -1,31 +1 @@
|
|
|
1
|
-
var e
|
|
2
|
-
sideNav: "_sideNav_uayvm_2",
|
|
3
|
-
label: "_label_uayvm_24",
|
|
4
|
-
trailing: "_trailing_uayvm_25",
|
|
5
|
-
groupIndicator: "_groupIndicator_uayvm_29",
|
|
6
|
-
link: "_link_uayvm_50",
|
|
7
|
-
groupTrigger: "_groupTrigger_uayvm_51",
|
|
8
|
-
fallbackIcon: "_fallbackIcon_uayvm_60",
|
|
9
|
-
list: "_list_uayvm_67",
|
|
10
|
-
sublistInner: "_sublistInner_uayvm_68",
|
|
11
|
-
groupItems: "_groupItems_uayvm_69",
|
|
12
|
-
group: "_group_uayvm_29",
|
|
13
|
-
groupLabel: "_groupLabel_uayvm_84",
|
|
14
|
-
checkMark: "_checkMark_uayvm_185",
|
|
15
|
-
icon: "_icon_uayvm_191",
|
|
16
|
-
sublist: "_sublist_uayvm_68",
|
|
17
|
-
sublink: "_sublink_uayvm_251",
|
|
18
|
-
subSeparator: "_subSeparator_uayvm_263",
|
|
19
|
-
subGroupLabel: "_subGroupLabel_uayvm_270",
|
|
20
|
-
header: "_header_uayvm_282",
|
|
21
|
-
footer: "_footer_uayvm_289",
|
|
22
|
-
customItem: "_customItem_uayvm_297",
|
|
23
|
-
collapseToggle: "_collapseToggle_uayvm_302",
|
|
24
|
-
collapseIcon: "_collapseIcon_uayvm_328",
|
|
25
|
-
railFlyout: "_railFlyout_uayvm_337",
|
|
26
|
-
railFlyoutCaption: "_railFlyoutCaption_uayvm_369",
|
|
27
|
-
flyoutItem: "_flyoutItem_uayvm_379",
|
|
28
|
-
flyoutSeparator: "_flyoutSeparator_uayvm_384"
|
|
29
|
-
};
|
|
30
|
-
//#endregion
|
|
31
|
-
export { e as default };
|
|
1
|
+
var e={sideNav:`_sideNav_11mx5_2`,label:`_label_11mx5_24`,trailing:`_trailing_11mx5_25`,groupIndicator:`_groupIndicator_11mx5_29`,groupLabel:`_groupLabel_11mx5_39`,group:`_group_11mx5_29`,groupItems:`_groupItems_11mx5_47`,link:`_link_11mx5_79`,groupTrigger:`_groupTrigger_11mx5_80`,fallbackIcon:`_fallbackIcon_11mx5_89`,list:`_list_11mx5_96`,sublistInner:`_sublistInner_11mx5_97`,checkMark:`_checkMark_11mx5_214`,icon:`_icon_11mx5_220`,sublist:`_sublist_11mx5_97`,sublink:`_sublink_11mx5_280`,subSeparator:`_subSeparator_11mx5_292`,subGroupLabel:`_subGroupLabel_11mx5_299`,header:`_header_11mx5_311`,footer:`_footer_11mx5_318`,customItem:`_customItem_11mx5_326`,collapseToggle:`_collapseToggle_11mx5_331`,collapseIcon:`_collapseIcon_11mx5_357`,railFlyout:`_railFlyout_11mx5_366`,railFlyoutCaption:`_railFlyoutCaption_11mx5_398`,flyoutItem:`_flyoutItem_11mx5_408`,flyoutSeparator:`_flyoutSeparator_11mx5_413`};export{e as default};
|
|
@@ -1,23 +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/skeleton/skeleton.tsx
|
|
5
|
-
function r({ variant: r = "text", width: i, height: a, lines: o = 1, className: s, style: c, ...l }) {
|
|
6
|
-
let u = {
|
|
7
|
-
...i !== void 0 && { "--cascivo-skeleton-width": i },
|
|
8
|
-
...a !== void 0 && { "--cascivo-skeleton-height": a }
|
|
9
|
-
};
|
|
10
|
-
return /* @__PURE__ */ n("div", {
|
|
11
|
-
"aria-hidden": "true",
|
|
12
|
-
"data-variant": r,
|
|
13
|
-
className: t(e.skeleton, s),
|
|
14
|
-
style: {
|
|
15
|
-
...u,
|
|
16
|
-
...c
|
|
17
|
-
},
|
|
18
|
-
...l,
|
|
19
|
-
children: r === "text" && Array.from({ length: o }, (t, r) => /* @__PURE__ */ n("span", { className: e.line }, r))
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
//#endregion
|
|
23
|
-
export { r as Skeleton };
|
|
1
|
+
import e from"./skeleton.module.js";import{cn as t}from"@cascivo/core/pure";import{jsx as n}from"react/jsx-runtime";function Skeleton({variant:r=`text`,width:i,height:a,lines:o=1,className:s,style:c,...l}){let u={...i!==void 0&&{"--cascivo-skeleton-width":i},...a!==void 0&&{"--cascivo-skeleton-height":a}};return n(`div`,{"aria-hidden":`true`,"data-variant":r,className:t(e.skeleton,s),style:{...u,...c},...l,children:r===`text`&&Array.from({length:o},(t,r)=>n(`span`,{className:e.line},r))})}export{Skeleton};
|
|
@@ -1,28 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import e from "./skip-nav.module.js";
|
|
4
|
-
import { forwardRef as t } from "react";
|
|
5
|
-
import { cn as n, useSignals as r } from "@cascivo/core";
|
|
6
|
-
import { builtin as i, t as a } from "@cascivo/i18n";
|
|
7
|
-
import { jsx as o } from "react/jsx-runtime";
|
|
8
|
-
//#region ../components/src/skip-nav/skip-nav.tsx
|
|
9
|
-
var s = "cascade-skip-target", c = t(function({ targetId: t = s, labels: c, className: l, ...u }, d) {
|
|
10
|
-
r();
|
|
11
|
-
let f = c?.label ?? a(i.skipNav.label);
|
|
12
|
-
return /* @__PURE__ */ o("a", {
|
|
13
|
-
ref: d,
|
|
14
|
-
href: `#${t}`,
|
|
15
|
-
className: n(e.link, l),
|
|
16
|
-
...u,
|
|
17
|
-
children: f
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
function l({ id: e = s, ...t }) {
|
|
21
|
-
return /* @__PURE__ */ o("div", {
|
|
22
|
-
id: e,
|
|
23
|
-
tabIndex: -1,
|
|
24
|
-
...t
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
//#endregion
|
|
28
|
-
export { c as SkipNavLink, l as SkipNavTarget };
|
|
1
|
+
"use client";import e from"./skip-nav.module.js";import{forwardRef as t}from"react";import{cn as n,useSignals as r}from"@cascivo/core";import{builtin as i,t as a}from"@cascivo/i18n";import{jsx as o}from"react/jsx-runtime";var s=`cascade-skip-target`,c=t(function({targetId:t=s,labels:c,className:l,...u},d){r();let f=c?.label??a(i.skipNav.label);return o(`a`,{ref:d,href:`#${t}`,className:n(e.link,l),...u,children:f})});function SkipNavTarget({id:e=s,...t}){return o(`div`,{id:e,tabIndex:-1,...t})}export{c as SkipNavLink,SkipNavTarget};
|