@askrjs/themes 0.0.9 → 0.0.11
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 +19 -13
- package/THEMING.md +24 -18
- package/dist/components/_internal/block-layout.d.ts +49 -0
- package/dist/components/_internal/block-layout.js +210 -0
- package/dist/components/_internal/block-layout.js.map +1 -0
- package/dist/components/alert/alert.js +2 -2
- package/dist/components/alert/alert.js.map +1 -1
- package/dist/components/alert/alert.types.d.ts +0 -1
- package/dist/components/aside/aside.d.ts +7 -0
- package/dist/components/aside/aside.js +16 -0
- package/dist/components/aside/aside.js.map +1 -0
- package/dist/components/aside/aside.types.d.ts +6 -0
- package/dist/components/aside/index.d.ts +2 -0
- package/dist/components/aspect-ratio/aspect-ratio.js +1 -1
- package/dist/components/aspect-ratio/aspect-ratio.js.map +1 -1
- package/dist/components/badge/index.d.ts +1 -2
- package/dist/components/block/block.d.ts +2 -3
- package/dist/components/block/block.js +16 -46
- package/dist/components/block/block.js.map +1 -1
- package/dist/components/block/block.types.d.ts +13 -23
- package/dist/components/block/index.d.ts +3 -3
- package/dist/components/brand/brand.d.ts +9 -0
- package/dist/components/brand/brand.js +49 -0
- package/dist/components/brand/brand.js.map +1 -0
- package/dist/components/brand/brand.types.d.ts +31 -0
- package/dist/components/brand/index.d.ts +2 -0
- package/dist/components/card/card.d.ts +3 -3
- package/dist/components/card/card.js +6 -11
- package/dist/components/card/card.js.map +1 -1
- package/dist/components/card/card.types.d.ts +10 -12
- package/dist/components/card/index.d.ts +2 -2
- package/dist/components/catalog.d.ts +156 -0
- package/dist/components/catalog.js +723 -0
- package/dist/components/catalog.js.map +1 -0
- package/dist/components/container/container.d.ts +2 -3
- package/dist/components/container/container.js +8 -71
- package/dist/components/container/container.js.map +1 -1
- package/dist/components/container/container.types.d.ts +5 -24
- package/dist/components/container/index.d.ts +2 -3
- package/dist/components/empty-state/empty-state.js +34 -28
- package/dist/components/empty-state/empty-state.js.map +1 -1
- package/dist/components/empty-state/empty-state.types.d.ts +3 -6
- package/dist/components/field/field.js +4 -2
- package/dist/components/field/field.js.map +1 -1
- package/dist/components/field/field.types.d.ts +1 -0
- package/dist/components/footer/footer.d.ts +13 -0
- package/dist/components/footer/footer.js +86 -0
- package/dist/components/footer/footer.js.map +1 -0
- package/dist/components/footer/footer.types.d.ts +37 -0
- package/dist/components/footer/index.d.ts +2 -0
- package/dist/components/grid/grid.d.ts +7 -0
- package/dist/components/grid/grid.js +76 -0
- package/dist/components/grid/grid.js.map +1 -0
- package/dist/components/grid/grid.types.d.ts +19 -0
- package/dist/components/grid/index.d.ts +2 -0
- package/dist/components/header/header.js +9 -6
- package/dist/components/header/header.js.map +1 -1
- package/dist/components/header/header.types.d.ts +5 -5
- package/dist/components/header/index.d.ts +2 -0
- package/dist/components/main/index.d.ts +2 -0
- package/dist/components/main/main.d.ts +7 -0
- package/dist/components/main/main.js +17 -0
- package/dist/components/main/main.js.map +1 -0
- package/dist/components/main/main.types.d.ts +6 -0
- package/dist/components/nav/index.d.ts +2 -2
- package/dist/components/nav/nav.d.ts +8 -6
- package/dist/components/nav/nav.js +93 -58
- package/dist/components/nav/nav.js.map +1 -1
- package/dist/components/nav/nav.types.d.ts +16 -20
- package/dist/components/navbar/index.d.ts +4 -5
- package/dist/components/navbar/navbar.d.ts +3 -38
- package/dist/components/navbar/navbar.js +103 -210
- package/dist/components/navbar/navbar.js.map +1 -1
- package/dist/components/navbar/navbar.types.d.ts +14 -24
- package/dist/components/page/index.d.ts +2 -0
- package/dist/components/page/page.d.ts +7 -0
- package/dist/components/page/page.js +22 -0
- package/dist/components/page/page.js.map +1 -0
- package/dist/components/page/page.types.d.ts +6 -0
- package/dist/components/page-header/index.d.ts +2 -0
- package/dist/components/page-header/page-header.d.ts +7 -0
- package/dist/components/page-header/page-header.js +37 -0
- package/dist/components/page-header/page-header.js.map +1 -0
- package/dist/components/page-header/page-header.types.d.ts +10 -0
- package/dist/components/section/index.d.ts +2 -3
- package/dist/components/section/section.d.ts +2 -3
- package/dist/components/section/section.js +7 -30
- package/dist/components/section/section.js.map +1 -1
- package/dist/components/section/section.types.d.ts +3 -20
- package/dist/components/separator/index.d.ts +1 -2
- package/dist/components/sidebar/index.d.ts +2 -0
- package/dist/components/sidebar/sidebar.d.ts +17 -2
- package/dist/components/sidebar/sidebar.js +115 -225
- package/dist/components/sidebar/sidebar.js.map +1 -1
- package/dist/components/sidebar/sidebar.types.d.ts +21 -23
- package/dist/components/skeleton/index.d.ts +1 -2
- package/dist/components/skeleton/skeleton.js +12 -1
- package/dist/components/skeleton/skeleton.js.map +1 -1
- package/dist/components/skeleton/skeleton.types.d.ts +2 -0
- package/dist/components/spinner/index.d.ts +1 -1
- package/dist/components/spinner/spinner.js +6 -3
- package/dist/components/spinner/spinner.js.map +1 -1
- package/dist/components/spinner/spinner.types.d.ts +3 -1
- package/dist/components/stat/index.d.ts +2 -0
- package/dist/components/stat/stat.d.ts +10 -0
- package/dist/components/stat/stat.js +52 -0
- package/dist/components/stat/stat.js.map +1 -0
- package/dist/components/stat/stat.types.d.ts +24 -0
- package/dist/components/text/index.d.ts +2 -0
- package/dist/components/text/text.d.ts +7 -0
- package/dist/components/text/text.js +28 -0
- package/dist/components/text/text.js.map +1 -0
- package/dist/components/text/text.types.d.ts +26 -0
- package/dist/components/theme/theme.js +50 -8
- package/dist/components/theme/theme.js.map +1 -1
- package/dist/components/toolbar/index.d.ts +2 -0
- package/dist/components/toolbar/toolbar.d.ts +7 -0
- package/dist/components/toolbar/toolbar.js +30 -0
- package/dist/components/toolbar/toolbar.js.map +1 -0
- package/dist/components/toolbar/toolbar.types.d.ts +9 -0
- package/dist/components.d.ts +60 -0
- package/dist/components.js +35 -0
- package/dist/controls.d.ts +2 -2
- package/dist/controls.js +3 -3
- package/dist/core.d.ts +36 -0
- package/dist/core.js +19 -0
- package/dist/navs.d.ts +3 -15
- package/dist/navs.js +2 -8
- package/dist/overlays.d.ts +2 -2
- package/dist/overlays.js +2 -2
- package/dist/surfaces.d.ts +10 -8
- package/dist/surfaces.js +6 -4
- package/dist/themes/default/index.css +3661 -3945
- package/package.json +235 -69
- package/src/components/_internal/block-layout.ts +354 -0
- package/src/components/alert/alert.tsx +1 -2
- package/src/components/alert/alert.types.ts +0 -1
- package/src/components/aside/aside.tsx +12 -0
- package/src/components/aside/aside.types.ts +3 -0
- package/src/components/aside/index.ts +2 -0
- package/src/components/aspect-ratio/aspect-ratio.tsx +1 -1
- package/src/components/badge/index.ts +0 -1
- package/src/components/block/block.a11y.ts +0 -6
- package/src/components/block/block.tsx +40 -56
- package/src/components/block/block.types.ts +59 -41
- package/src/components/block/index.ts +1 -10
- package/src/components/brand/brand.tsx +61 -0
- package/src/components/brand/brand.types.ts +39 -0
- package/src/components/brand/index.ts +2 -0
- package/src/components/card/card.tsx +6 -18
- package/src/components/card/card.types.ts +9 -11
- package/src/components/card/index.ts +2 -3
- package/src/components/catalog.tsx +713 -0
- package/src/components/container/container.a11y.ts +0 -5
- package/src/components/container/container.tsx +18 -128
- package/src/components/container/container.types.ts +3 -32
- package/src/components/container/index.ts +1 -8
- package/src/components/empty-state/empty-state.tsx +17 -35
- package/src/components/empty-state/empty-state.types.ts +3 -5
- package/src/components/field/field.tsx +3 -1
- package/src/components/field/field.types.ts +1 -0
- package/src/components/footer/footer.tsx +88 -0
- package/src/components/footer/footer.types.ts +40 -0
- package/src/components/footer/index.ts +10 -0
- package/src/components/grid/grid.tsx +113 -0
- package/src/components/grid/grid.types.ts +20 -0
- package/src/components/grid/index.ts +2 -0
- package/src/components/header/header.tsx +10 -7
- package/src/components/header/header.types.ts +4 -4
- package/src/components/header/index.ts +1 -2
- package/src/components/main/index.ts +2 -0
- package/src/components/main/main.tsx +12 -0
- package/src/components/main/main.types.ts +3 -0
- package/src/components/nav/index.ts +7 -9
- package/src/components/nav/nav.tsx +153 -110
- package/src/components/nav/nav.types.ts +26 -27
- package/src/components/navbar/index.ts +4 -11
- package/src/components/navbar/navbar.tsx +103 -265
- package/src/components/navbar/navbar.types.ts +16 -42
- package/src/components/page/index.ts +2 -0
- package/src/components/page/page.tsx +17 -0
- package/src/components/page/page.types.ts +3 -0
- package/src/components/page-header/index.ts +2 -0
- package/src/components/page-header/page-header.tsx +29 -0
- package/src/components/page-header/page-header.types.ts +7 -0
- package/src/components/section/index.ts +1 -7
- package/src/components/section/section.a11y.ts +0 -1
- package/src/components/section/section.tsx +9 -35
- package/src/components/section/section.types.ts +2 -22
- package/src/components/separator/index.ts +4 -9
- package/src/components/sidebar/index.ts +27 -5
- package/src/components/sidebar/sidebar.tsx +146 -336
- package/src/components/sidebar/sidebar.types.ts +21 -28
- package/src/components/skeleton/index.ts +1 -2
- package/src/components/skeleton/skeleton.tsx +33 -1
- package/src/components/skeleton/skeleton.types.ts +2 -0
- package/src/components/spinner/index.ts +1 -1
- package/src/components/spinner/spinner.tsx +7 -2
- package/src/components/spinner/spinner.types.ts +3 -0
- package/src/components/stat/index.ts +2 -0
- package/src/components/stat/stat.tsx +47 -0
- package/src/components/stat/stat.types.ts +24 -0
- package/src/components/text/index.ts +2 -0
- package/src/components/text/text.tsx +39 -0
- package/src/components/text/text.types.ts +35 -0
- package/src/components/theme/theme.tsx +83 -9
- package/src/components/toolbar/index.ts +2 -0
- package/src/components/toolbar/toolbar.tsx +24 -0
- package/src/components/toolbar/toolbar.types.ts +6 -0
- package/src/components.ts +289 -0
- package/src/controls.ts +69 -2
- package/src/core.ts +42 -0
- package/src/navs.ts +9 -24
- package/src/overlays.ts +101 -59
- package/src/parity.ts +125 -0
- package/src/surfaces.ts +60 -13
- package/src/themes/default/index.css +11 -14
- package/src/themes/default/styles/actions/button-group.css +6 -6
- package/src/themes/default/styles/actions/button.css +98 -60
- package/src/themes/default/styles/actions/toggle-group.css +61 -25
- package/src/themes/default/styles/base/text.css +87 -0
- package/src/themes/default/styles/base/typography.css +24 -117
- package/src/themes/default/styles/base/utilities.css +0 -250
- package/src/themes/default/styles/disclosure/accordion.css +35 -28
- package/src/themes/default/styles/display/alert.css +7 -7
- package/src/themes/default/styles/display/badge.css +8 -9
- package/src/themes/default/styles/display/card.css +10 -47
- package/src/themes/default/styles/display/catalog.css +753 -0
- package/src/themes/default/styles/display/coverage.css +30 -305
- package/src/themes/default/styles/display/progress-circle.css +2 -0
- package/src/themes/default/styles/display/scroll-area.css +29 -24
- package/src/themes/default/styles/display/spinner.css +38 -1
- package/src/themes/default/styles/display/stat.css +21 -0
- package/src/themes/default/styles/display/table.css +37 -12
- package/src/themes/default/styles/display/virtual-list.css +24 -13
- package/src/themes/default/styles/display/virtual-table.css +58 -36
- package/src/themes/default/styles/forms/checkbox.css +12 -21
- package/src/themes/default/styles/forms/input-group.css +2 -1
- package/src/themes/default/styles/forms/input.css +11 -12
- package/src/themes/default/styles/forms/radio-group.css +44 -27
- package/src/themes/default/styles/forms/select.css +27 -35
- package/src/themes/default/styles/forms/slider.css +61 -47
- package/src/themes/default/styles/forms/switch.css +18 -23
- package/src/themes/default/styles/forms/textarea.css +12 -12
- package/src/themes/default/styles/layout/block.css +96 -12
- package/src/themes/default/styles/layout/grid.css +78 -0
- package/src/themes/default/styles/layout/layout.css +502 -772
- package/src/themes/default/styles/layout/patterns.css +0 -155
- package/src/themes/default/styles/navigation/nav.css +104 -154
- package/src/themes/default/styles/overlays/alert-dialog.css +2 -2
- package/src/themes/default/styles/overlays/dialog.css +76 -22
- package/src/themes/default/styles/overlays/dropdown.css +108 -31
- package/src/themes/default/styles/overlays/hover-card.css +39 -17
- package/src/themes/default/styles/overlays/menubar.css +223 -0
- package/src/themes/default/styles/overlays/popover.css +69 -23
- package/src/themes/default/styles/overlays/toast.css +91 -33
- package/src/themes/default/styles/overlays/tooltip.css +88 -14
- package/src/themes/default/styles/shell/brand.css +48 -0
- package/src/themes/default/styles/shell/footer.css +72 -0
- package/src/themes/default/styles/shell/header.css +7 -50
- package/src/themes/default/styles/shell/navbar.css +226 -454
- package/src/themes/default/styles/shell/sidebar.css +243 -829
- package/src/themes/default/tokens.css +145 -98
- package/templates/theme/index.css +11 -14
- package/templates/theme/styles/actions/button-group.css +6 -6
- package/templates/theme/styles/actions/button.css +98 -60
- package/templates/theme/styles/actions/toggle-group.css +61 -25
- package/templates/theme/styles/base/text.css +87 -0
- package/templates/theme/styles/base/typography.css +24 -117
- package/templates/theme/styles/disclosure/accordion.css +35 -28
- package/templates/theme/styles/display/alert.css +7 -7
- package/templates/theme/styles/display/badge.css +8 -9
- package/templates/theme/styles/display/card.css +10 -47
- package/templates/theme/styles/display/catalog.css +753 -0
- package/templates/theme/styles/display/coverage.css +30 -305
- package/templates/theme/styles/display/scroll-area.css +29 -24
- package/templates/theme/styles/display/spinner.css +38 -1
- package/templates/theme/styles/display/stat.css +21 -0
- package/templates/theme/styles/display/table.css +37 -12
- package/templates/theme/styles/display/virtual-list.css +24 -13
- package/templates/theme/styles/display/virtual-table.css +58 -36
- package/templates/theme/styles/forms/checkbox.css +12 -21
- package/templates/theme/styles/forms/input.css +11 -12
- package/templates/theme/styles/forms/radio-group.css +44 -27
- package/templates/theme/styles/forms/select.css +27 -35
- package/templates/theme/styles/forms/slider.css +61 -47
- package/templates/theme/styles/forms/switch.css +18 -23
- package/templates/theme/styles/forms/textarea.css +12 -12
- package/templates/theme/styles/layout/block.css +96 -12
- package/templates/theme/styles/layout/grid.css +78 -0
- package/templates/theme/styles/layout/layout.css +676 -1
- package/templates/theme/styles/layout/patterns.css +0 -155
- package/templates/theme/styles/navigation/nav.css +104 -154
- package/templates/theme/styles/overlays/alert-dialog.css +2 -2
- package/templates/theme/styles/overlays/dialog.css +76 -22
- package/templates/theme/styles/overlays/dropdown.css +108 -31
- package/templates/theme/styles/overlays/hover-card.css +39 -17
- package/templates/theme/styles/overlays/menubar.css +223 -0
- package/templates/theme/styles/overlays/popover.css +69 -23
- package/templates/theme/styles/overlays/toast.css +80 -33
- package/templates/theme/styles/overlays/tooltip.css +88 -14
- package/templates/theme/styles/shell/brand.css +48 -0
- package/templates/theme/styles/shell/footer.css +72 -0
- package/templates/theme/styles/shell/header.css +7 -50
- package/templates/theme/styles/shell/navbar.css +226 -454
- package/templates/theme/styles/shell/sidebar.css +197 -779
- package/templates/theme/tokens.css +145 -98
- package/dist/components/_internal/box-layout.js +0 -116
- package/dist/components/_internal/box-layout.js.map +0 -1
- package/dist/components/_internal/layout.d.ts +0 -9
- package/dist/components/_internal/layout.js +0 -142
- package/dist/components/_internal/layout.js.map +0 -1
- package/dist/components/badge/badge.a11y.d.ts +0 -17
- package/dist/components/block/block.a11y.d.ts +0 -20
- package/dist/components/box/box.a11y.d.ts +0 -14
- package/dist/components/box/box.d.ts +0 -9
- package/dist/components/box/box.js +0 -36
- package/dist/components/box/box.js.map +0 -1
- package/dist/components/box/box.types.d.ts +0 -72
- package/dist/components/box/index.d.ts +0 -3
- package/dist/components/breadcrumb/breadcrumb.a11y.d.ts +0 -17
- package/dist/components/breadcrumb/breadcrumb.a11y.js +0 -15
- package/dist/components/breadcrumb/breadcrumb.a11y.js.map +0 -1
- package/dist/components/breadcrumb/breadcrumb.d.ts +0 -18
- package/dist/components/breadcrumb/breadcrumb.js +0 -113
- package/dist/components/breadcrumb/breadcrumb.js.map +0 -1
- package/dist/components/breadcrumb/breadcrumb.types.d.ts +0 -65
- package/dist/components/breadcrumb/index.d.ts +0 -3
- package/dist/components/container/container.a11y.d.ts +0 -19
- package/dist/components/flex/flex.a11y.d.ts +0 -22
- package/dist/components/flex/flex.d.ts +0 -9
- package/dist/components/flex/flex.js +0 -115
- package/dist/components/flex/flex.js.map +0 -1
- package/dist/components/flex/flex.types.d.ts +0 -42
- package/dist/components/flex/index.d.ts +0 -3
- package/dist/components/header/header.a11y.d.ts +0 -14
- package/dist/components/header/header.a11y.js +0 -12
- package/dist/components/header/header.a11y.js.map +0 -1
- package/dist/components/inline/index.d.ts +0 -8
- package/dist/components/inline/index.js +0 -13
- package/dist/components/inline/index.js.map +0 -1
- package/dist/components/list-group/index.d.ts +0 -2
- package/dist/components/list-group/list-group.d.ts +0 -9
- package/dist/components/list-group/list-group.js +0 -43
- package/dist/components/list-group/list-group.js.map +0 -1
- package/dist/components/list-group/list-group.types.d.ts +0 -32
- package/dist/components/navbar/navbar-panel.js +0 -42
- package/dist/components/navbar/navbar-panel.js.map +0 -1
- package/dist/components/navbar/navbar.context.js +0 -13
- package/dist/components/navbar/navbar.context.js.map +0 -1
- package/dist/components/navbar/navbar.render.js +0 -26
- package/dist/components/navbar/navbar.render.js.map +0 -1
- package/dist/components/navbar/navbar.shared.js +0 -18
- package/dist/components/navbar/navbar.shared.js.map +0 -1
- package/dist/components/pagination/index.d.ts +0 -2
- package/dist/components/pagination/pagination.d.ts +0 -11
- package/dist/components/pagination/pagination.js +0 -95
- package/dist/components/pagination/pagination.js.map +0 -1
- package/dist/components/pagination/pagination.types.d.ts +0 -40
- package/dist/components/section/section.a11y.d.ts +0 -15
- package/dist/components/separator/separator.a11y.d.ts +0 -17
- package/dist/components/separator/separator.a11y.js +0 -15
- package/dist/components/separator/separator.a11y.js.map +0 -1
- package/dist/components/shell/index.d.ts +0 -3
- package/dist/components/shell/shell-nav.types.d.ts +0 -7
- package/dist/components/shell/shell-panel.js +0 -54
- package/dist/components/shell/shell-panel.js.map +0 -1
- package/dist/components/shell/shell-responsive.js +0 -141
- package/dist/components/shell/shell-responsive.js.map +0 -1
- package/dist/components/shell/shell.a11y.d.ts +0 -23
- package/dist/components/shell/shell.a11y.js +0 -23
- package/dist/components/shell/shell.a11y.js.map +0 -1
- package/dist/components/shell/shell.d.ts +0 -13
- package/dist/components/shell/shell.js +0 -69
- package/dist/components/shell/shell.js.map +0 -1
- package/dist/components/shell/shell.types.d.ts +0 -58
- package/dist/components/sidebar/sidebar-panel.d.ts +0 -7
- package/dist/components/sidebar/sidebar-panel.js +0 -49
- package/dist/components/sidebar/sidebar-panel.js.map +0 -1
- package/dist/components/sidebar/sidebar-toggle.d.ts +0 -7
- package/dist/components/sidebar/sidebar-toggle.js +0 -8
- package/dist/components/sidebar/sidebar-toggle.js.map +0 -1
- package/dist/components/sidebar/sidebar.context.js +0 -21
- package/dist/components/sidebar/sidebar.context.js.map +0 -1
- package/dist/components/sidebar/sidebar.shared.js +0 -12
- package/dist/components/sidebar/sidebar.shared.js.map +0 -1
- package/dist/components/skeleton/skeleton.a11y.d.ts +0 -16
- package/dist/components/spacer/index.d.ts +0 -3
- package/dist/components/spacer/spacer.a11y.d.ts +0 -17
- package/dist/components/spacer/spacer.d.ts +0 -8
- package/dist/components/spacer/spacer.js +0 -49
- package/dist/components/spacer/spacer.js.map +0 -1
- package/dist/components/spacer/spacer.types.d.ts +0 -26
- package/dist/components/stack/index.d.ts +0 -3
- package/dist/components/stack/stack.a11y.d.ts +0 -18
- package/dist/components/stack/stack.d.ts +0 -8
- package/dist/components/stack/stack.js +0 -16
- package/dist/components/stack/stack.js.map +0 -1
- package/dist/components/stack/stack.types.d.ts +0 -22
- package/dist/feedback.d.ts +0 -5
- package/dist/feedback.js +0 -4
- package/dist/layouts.d.ts +0 -25
- package/dist/layouts.js +0 -11
- package/dist/shells.d.ts +0 -16
- package/dist/shells.js +0 -11
- package/src/components/_internal/box-layout.ts +0 -164
- package/src/components/_internal/layout.ts +0 -202
- package/src/components/box/box.a11y.ts +0 -11
- package/src/components/box/box.tsx +0 -38
- package/src/components/box/box.types.ts +0 -76
- package/src/components/box/index.ts +0 -11
- package/src/components/breadcrumb/breadcrumb.a11y.ts +0 -15
- package/src/components/breadcrumb/breadcrumb.tsx +0 -123
- package/src/components/breadcrumb/breadcrumb.types.ts +0 -74
- package/src/components/breadcrumb/index.ts +0 -24
- package/src/components/flex/flex.a11y.ts +0 -19
- package/src/components/flex/flex.tsx +0 -162
- package/src/components/flex/flex.types.ts +0 -51
- package/src/components/flex/index.ts +0 -16
- package/src/components/inline/index.tsx +0 -28
- package/src/components/list-group/index.ts +0 -7
- package/src/components/list-group/list-group.tsx +0 -74
- package/src/components/list-group/list-group.types.ts +0 -32
- package/src/components/navbar/navbar-panel.tsx +0 -62
- package/src/components/navbar/navbar.context.ts +0 -22
- package/src/components/navbar/navbar.render.tsx +0 -32
- package/src/components/navbar/navbar.shared.ts +0 -21
- package/src/components/pagination/index.ts +0 -8
- package/src/components/pagination/pagination.tsx +0 -158
- package/src/components/pagination/pagination.types.ts +0 -41
- package/src/components/shell/index.ts +0 -16
- package/src/components/shell/shell-nav.types.ts +0 -3
- package/src/components/shell/shell-panel.tsx +0 -85
- package/src/components/shell/shell-responsive.tsx +0 -262
- package/src/components/shell/shell.a11y.ts +0 -20
- package/src/components/shell/shell.tsx +0 -74
- package/src/components/shell/shell.types.ts +0 -71
- package/src/components/sidebar/sidebar-panel.tsx +0 -67
- package/src/components/sidebar/sidebar-toggle.tsx +0 -5
- package/src/components/sidebar/sidebar.context.ts +0 -40
- package/src/components/sidebar/sidebar.shared.ts +0 -12
- package/src/components/spacer/index.ts +0 -9
- package/src/components/spacer/spacer.a11y.ts +0 -14
- package/src/components/spacer/spacer.tsx +0 -61
- package/src/components/spacer/spacer.types.ts +0 -31
- package/src/components/stack/index.ts +0 -3
- package/src/components/stack/stack.a11y.ts +0 -15
- package/src/components/stack/stack.tsx +0 -13
- package/src/components/stack/stack.types.ts +0 -22
- package/src/feedback.ts +0 -6
- package/src/layouts.ts +0 -19
- package/src/shells.ts +0 -13
- package/src/themes/default/styles/actions/toggle.css +0 -50
- package/src/themes/default/styles/disclosure/collapsible.css +0 -58
- package/src/themes/default/styles/display/list-group.css +0 -84
- package/src/themes/default/styles/forms/form.css +0 -5
- package/src/themes/default/styles/layout/responsive-layout.css +0 -230
- package/src/themes/default/styles/navigation/breadcrumb.css +0 -45
- package/src/themes/default/styles/navigation/menu.css +0 -203
- package/src/themes/default/styles/navigation/menubar.css +0 -255
- package/src/themes/default/styles/navigation/pagination.css +0 -91
- package/src/themes/default/styles/shell/theme.css +0 -37
- package/templates/theme/styles/actions/toggle.css +0 -50
- package/templates/theme/styles/disclosure/collapsible.css +0 -58
- package/templates/theme/styles/display/list-group.css +0 -84
- package/templates/theme/styles/forms/form.css +0 -5
- package/templates/theme/styles/layout/responsive-layout.css +0 -230
- package/templates/theme/styles/navigation/breadcrumb.css +0 -45
- package/templates/theme/styles/navigation/menu.css +0 -203
- package/templates/theme/styles/navigation/menubar.css +0 -255
- package/templates/theme/styles/navigation/pagination.css +0 -91
- package/templates/theme/styles/shell/theme.css +0 -37
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shell-panel.js","names":[],"sources":["../../../src/components/shell/shell-panel.tsx"],"sourcesContent":["import { classes } from \"../_internal/classes\";\nimport { mergeProps } from \"../_internal/merge-props\";\n\nexport type ShellPanelRenderProps = {\n active: boolean;\n brand?: unknown;\n children?: unknown;\n className?: unknown;\n collapseLabel: string;\n dataOrientation?: string;\n onClose: () => void;\n open: boolean;\n panelId?: string;\n prefix: \"navbar\" | \"sidebar\";\n ref?: unknown;\n rest: Record<string, unknown>;\n};\n\nexport function renderShellPanel(props: ShellPanelRenderProps): JSX.Element | null {\n const {\n active,\n brand,\n children,\n className,\n collapseLabel,\n dataOrientation,\n onClose,\n open,\n panelId,\n prefix,\n ref,\n rest,\n } = props;\n\n if (active && !open) {\n return null;\n }\n\n const panelClass = `${prefix}-panel`;\n const headerClass = `${prefix}-panel-header`;\n const closeClass = `${prefix}-panel-close`;\n const headerSlot = `${prefix}-panel-header`;\n const closeSlot = `${prefix}-panel-close`;\n\n const finalProps = mergeProps(rest, {\n ref,\n class: classes(panelClass, className),\n \"aria-label\": active ? collapseLabel : rest[\"aria-label\"],\n \"aria-modal\": active ? \"true\" : rest[\"aria-modal\"],\n \"data-slot\": panelClass,\n \"data-state\": active ? (open ? \"open\" : \"closed\") : \"open\",\n id: panelId,\n role: rest.role,\n tabIndex: active ? -1 : rest.tabIndex,\n ...(dataOrientation !== undefined ? { \"data-orientation\": dataOrientation } : {}),\n }) as Record<string, unknown>;\n\n if (active) {\n finalProps.role = \"dialog\";\n finalProps[\"aria-modal\"] = \"true\";\n finalProps[\"aria-label\"] = collapseLabel;\n finalProps.tabIndex = -1;\n finalProps.id = panelId;\n }\n\n return (\n <div {...finalProps}>\n {active ? (\n <div class={headerClass} data-slot={headerSlot}>\n {brand}\n <button\n aria-label={`Close ${collapseLabel}`}\n class={closeClass}\n data-slot={closeSlot}\n type=\"button\"\n onClick={() => onClose()}\n >\n <span aria-hidden=\"true\">x</span>\n </button>\n </div>\n ) : null}\n {children}\n </div>\n );\n}\n"],"mappings":";;;;AAkBA,SAAgB,iBAAiB,OAAkD;CACjF,MAAM,EACJ,QACA,OACA,UACA,WACA,eACA,iBACA,SACA,MACA,SACA,QACA,KACA,SACE;CAEJ,IAAI,UAAU,CAAC,MACb,OAAO;CAGT,MAAM,aAAa,GAAG,OAAO;CAC7B,MAAM,cAAc,GAAG,OAAO;CAC9B,MAAM,aAAa,GAAG,OAAO;CAC7B,MAAM,aAAa,GAAG,OAAO;CAC7B,MAAM,YAAY,GAAG,OAAO;CAE5B,MAAM,aAAa,WAAW,MAAM;EAClC;EACA,OAAO,QAAQ,YAAY,SAAS;EACpC,cAAc,SAAS,gBAAgB,KAAK;EAC5C,cAAc,SAAS,SAAS,KAAK;EACrC,aAAa;EACb,cAAc,SAAU,OAAO,SAAS,WAAY;EACpD,IAAI;EACJ,MAAM,KAAK;EACX,UAAU,SAAS,KAAK,KAAK;EAC7B,GAAI,oBAAoB,KAAA,IAAY,EAAE,oBAAoB,gBAAgB,IAAI,CAAC;CACjF,CAAC;CAED,IAAI,QAAQ;EACV,WAAW,OAAO;EAClB,WAAW,gBAAgB;EAC3B,WAAW,gBAAgB;EAC3B,WAAW,WAAW;EACtB,WAAW,KAAK;CAClB;CAEA,OACE,qBAAC,OAAD;EAAK,GAAI;YAAT,CACG,SACC,qBAAC,OAAD;GAAK,OAAO;GAAa,aAAW;aAApC,CACG,OACD,oBAAC,UAAD;IACE,cAAY,SAAS;IACrB,OAAO;IACP,aAAW;IACX,MAAK;IACL,eAAe,QAAQ;cAEvB,oBAAC,QAAD;KAAM,eAAY;eAAO;IAAO,CAAA;GAC1B,CAAA,CACL;OACH,MACH,QACE;;AAET"}
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import { isJsxElement, toChildArray } from "../_internal/jsx.js";
|
|
2
|
-
import { jsx } from "@askrjs/askr/jsx-runtime";
|
|
3
|
-
import { For } from "@askrjs/askr/control";
|
|
4
|
-
import { resource } from "@askrjs/askr/resources";
|
|
5
|
-
//#region src/components/shell/shell-responsive.tsx
|
|
6
|
-
let shellScrollLockCount = 0;
|
|
7
|
-
let shellScrollLockPreviousValue = null;
|
|
8
|
-
function acquireShellScrollLock() {
|
|
9
|
-
if (typeof document === "undefined") return;
|
|
10
|
-
const body = document.body;
|
|
11
|
-
if (shellScrollLockCount === 0) shellScrollLockPreviousValue = body.getAttribute("data-shell-scroll-lock");
|
|
12
|
-
shellScrollLockCount += 1;
|
|
13
|
-
body.setAttribute("data-shell-scroll-lock", "true");
|
|
14
|
-
}
|
|
15
|
-
function releaseShellScrollLock() {
|
|
16
|
-
if (typeof document === "undefined" || shellScrollLockCount === 0) return;
|
|
17
|
-
shellScrollLockCount -= 1;
|
|
18
|
-
if (shellScrollLockCount > 0) return;
|
|
19
|
-
const body = document.body;
|
|
20
|
-
if (shellScrollLockPreviousValue === null) body.removeAttribute("data-shell-scroll-lock");
|
|
21
|
-
else body.setAttribute("data-shell-scroll-lock", shellScrollLockPreviousValue);
|
|
22
|
-
shellScrollLockPreviousValue = null;
|
|
23
|
-
}
|
|
24
|
-
function isShellPanelChild(child, panelComponent) {
|
|
25
|
-
return isJsxElement(child) && child.type === panelComponent;
|
|
26
|
-
}
|
|
27
|
-
function renderShellChildKey(child, index, keyPrefix) {
|
|
28
|
-
return isJsxElement(child) && child.key != null ? String(child.key) : `${keyPrefix}-${index}`;
|
|
29
|
-
}
|
|
30
|
-
function keyMissingShellChildren(children, keyPrefix) {
|
|
31
|
-
let keyedChildren;
|
|
32
|
-
for (let index = 0; index < children.length; index += 1) {
|
|
33
|
-
const child = children[index];
|
|
34
|
-
if (isJsxElement(child) && child.key == null) {
|
|
35
|
-
keyedChildren ??= children.slice(0, index);
|
|
36
|
-
keyedChildren.push({
|
|
37
|
-
...child,
|
|
38
|
-
key: `${keyPrefix}-${index}`
|
|
39
|
-
});
|
|
40
|
-
continue;
|
|
41
|
-
}
|
|
42
|
-
keyedChildren?.push(child);
|
|
43
|
-
}
|
|
44
|
-
return keyedChildren ?? children;
|
|
45
|
-
}
|
|
46
|
-
function hasPanelProps(props, panelProps) {
|
|
47
|
-
return props?.active === panelProps.active && props?.collapseLabel === panelProps.collapseLabel && props?.onClose === panelProps.onClose && props?.open === panelProps.open && props?.panelId === panelProps.panelId;
|
|
48
|
-
}
|
|
49
|
-
function applyShellPanelProps(children, keyPrefix, panelProps) {
|
|
50
|
-
let panelChildren;
|
|
51
|
-
for (let index = 0; index < children.length; index += 1) {
|
|
52
|
-
const child = children[index];
|
|
53
|
-
if (!isJsxElement(child)) {
|
|
54
|
-
panelChildren?.push(child);
|
|
55
|
-
continue;
|
|
56
|
-
}
|
|
57
|
-
const props = child.props;
|
|
58
|
-
if (hasPanelProps(props, panelProps)) {
|
|
59
|
-
panelChildren?.push(child);
|
|
60
|
-
continue;
|
|
61
|
-
}
|
|
62
|
-
panelChildren ??= children.slice(0, index);
|
|
63
|
-
panelChildren.push({
|
|
64
|
-
...child,
|
|
65
|
-
key: child.key != null ? child.key : `${keyPrefix}-${index}`,
|
|
66
|
-
props: {
|
|
67
|
-
...props,
|
|
68
|
-
active: panelProps.active,
|
|
69
|
-
collapseLabel: panelProps.collapseLabel,
|
|
70
|
-
onClose: panelProps.onClose,
|
|
71
|
-
open: panelProps.open,
|
|
72
|
-
panelId: panelProps.panelId
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
return panelChildren ?? children;
|
|
77
|
-
}
|
|
78
|
-
function renderKeyedShellChildren(children, keyPrefix) {
|
|
79
|
-
const keyedChildren = keyMissingShellChildren(toChildArray(children), keyPrefix);
|
|
80
|
-
return /* @__PURE__ */ jsx(For, {
|
|
81
|
-
each: () => keyedChildren,
|
|
82
|
-
by: (child, index) => renderShellChildKey(child, index, keyPrefix),
|
|
83
|
-
children: (child) => child
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
function renderKeyedShellPanelChildren(children, keyPrefix, panelProps) {
|
|
87
|
-
const keyedChildren = applyShellPanelProps(toChildArray(children), keyPrefix, panelProps);
|
|
88
|
-
return /* @__PURE__ */ jsx(For, {
|
|
89
|
-
each: () => keyedChildren,
|
|
90
|
-
by: (child, index) => renderShellChildKey(child, index, keyPrefix),
|
|
91
|
-
children: (child) => child
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
function ShellResponsiveWatcher(props) {
|
|
95
|
-
const { breakpoint, isCollapsed, onExpand, onResize } = props;
|
|
96
|
-
resource(({ signal }) => {
|
|
97
|
-
const updateCollapsedState = () => {
|
|
98
|
-
const nextCollapsed = isCollapsed(breakpoint);
|
|
99
|
-
onResize(nextCollapsed);
|
|
100
|
-
if (!nextCollapsed) onExpand();
|
|
101
|
-
};
|
|
102
|
-
updateCollapsedState();
|
|
103
|
-
if (typeof window === "undefined") return null;
|
|
104
|
-
window.addEventListener("resize", updateCollapsedState);
|
|
105
|
-
signal.addEventListener("abort", () => {
|
|
106
|
-
window.removeEventListener("resize", updateCollapsedState);
|
|
107
|
-
}, { once: true });
|
|
108
|
-
return null;
|
|
109
|
-
}, [breakpoint]);
|
|
110
|
-
return null;
|
|
111
|
-
}
|
|
112
|
-
function ShellPanelWatcher(props) {
|
|
113
|
-
const { contentId, onClose, open, panelSlot } = props;
|
|
114
|
-
resource(({ signal }) => {
|
|
115
|
-
if (!open || typeof window === "undefined") {
|
|
116
|
-
releaseShellScrollLock();
|
|
117
|
-
return null;
|
|
118
|
-
}
|
|
119
|
-
const onKeyDown = (event) => {
|
|
120
|
-
if (event.key !== "Escape") return;
|
|
121
|
-
event.preventDefault();
|
|
122
|
-
onClose();
|
|
123
|
-
};
|
|
124
|
-
window.addEventListener("keydown", onKeyDown);
|
|
125
|
-
const focusFrame = typeof window.requestAnimationFrame === "function" ? window.requestAnimationFrame(() => {
|
|
126
|
-
((typeof contentId === "string" ? document.getElementById(contentId) : null) ?? document.querySelector(`[data-slot="${panelSlot}"][data-state="open"]`))?.focus({ preventScroll: true });
|
|
127
|
-
}) : void 0;
|
|
128
|
-
acquireShellScrollLock();
|
|
129
|
-
signal.addEventListener("abort", () => {
|
|
130
|
-
window.removeEventListener("keydown", onKeyDown);
|
|
131
|
-
if (focusFrame !== void 0 && typeof window.cancelAnimationFrame === "function") window.cancelAnimationFrame(focusFrame);
|
|
132
|
-
releaseShellScrollLock();
|
|
133
|
-
}, { once: true });
|
|
134
|
-
return null;
|
|
135
|
-
}, [open]);
|
|
136
|
-
return null;
|
|
137
|
-
}
|
|
138
|
-
//#endregion
|
|
139
|
-
export { ShellPanelWatcher, ShellResponsiveWatcher, isShellPanelChild, renderKeyedShellChildren, renderKeyedShellPanelChildren };
|
|
140
|
-
|
|
141
|
-
//# sourceMappingURL=shell-responsive.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shell-responsive.js","names":[],"sources":["../../../src/components/shell/shell-responsive.tsx"],"sourcesContent":["import { For } from \"@askrjs/askr/control\";\nimport { resource } from \"@askrjs/askr/resources\";\nimport type { JSXElement } from \"@askrjs/askr/foundations\";\nimport { isJsxElement, toChildArray } from \"../_internal/jsx\";\n\nexport type ShellResponsivePanelProps = {\n active: boolean;\n collapseLabel: string;\n onClose: () => void;\n open: boolean;\n panelId?: string;\n};\n\nlet shellScrollLockCount = 0;\nlet shellScrollLockPreviousValue: string | null = null;\n\nfunction acquireShellScrollLock(): void {\n if (typeof document === \"undefined\") return;\n\n const body = document.body;\n if (shellScrollLockCount === 0) {\n shellScrollLockPreviousValue = body.getAttribute(\"data-shell-scroll-lock\");\n }\n\n shellScrollLockCount += 1;\n body.setAttribute(\"data-shell-scroll-lock\", \"true\");\n}\n\nfunction releaseShellScrollLock(): void {\n if (typeof document === \"undefined\" || shellScrollLockCount === 0) return;\n\n shellScrollLockCount -= 1;\n if (shellScrollLockCount > 0) return;\n\n const body = document.body;\n if (shellScrollLockPreviousValue === null) {\n body.removeAttribute(\"data-shell-scroll-lock\");\n } else {\n body.setAttribute(\"data-shell-scroll-lock\", shellScrollLockPreviousValue);\n }\n\n shellScrollLockPreviousValue = null;\n}\n\nexport function isShellPanelChild(child: unknown, panelComponent: unknown): child is JSXElement {\n return isJsxElement(child) && child.type === panelComponent;\n}\n\nfunction renderShellChildKey(child: unknown, index: number, keyPrefix: string): string {\n return isJsxElement(child) && child.key != null ? String(child.key) : `${keyPrefix}-${index}`;\n}\n\nfunction keyMissingShellChildren(children: unknown[], keyPrefix: string): unknown[] {\n let keyedChildren: unknown[] | undefined;\n\n for (let index = 0; index < children.length; index += 1) {\n const child = children[index];\n\n if (isJsxElement(child) && child.key == null) {\n keyedChildren ??= children.slice(0, index);\n keyedChildren.push({\n ...child,\n key: `${keyPrefix}-${index}`,\n });\n continue;\n }\n\n keyedChildren?.push(child);\n }\n\n return keyedChildren ?? children;\n}\n\nfunction hasPanelProps(\n props: Record<string, unknown> | undefined,\n panelProps: ShellResponsivePanelProps,\n): boolean {\n return (\n props?.active === panelProps.active &&\n props?.collapseLabel === panelProps.collapseLabel &&\n props?.onClose === panelProps.onClose &&\n props?.open === panelProps.open &&\n props?.panelId === panelProps.panelId\n );\n}\n\nfunction applyShellPanelProps(\n children: unknown[],\n keyPrefix: string,\n panelProps: ShellResponsivePanelProps,\n): unknown[] {\n let panelChildren: unknown[] | undefined;\n\n for (let index = 0; index < children.length; index += 1) {\n const child = children[index];\n\n if (!isJsxElement(child)) {\n panelChildren?.push(child);\n continue;\n }\n\n const props = child.props as Record<string, unknown> | undefined;\n\n if (hasPanelProps(props, panelProps)) {\n panelChildren?.push(child);\n continue;\n }\n\n panelChildren ??= children.slice(0, index);\n panelChildren.push({\n ...child,\n key: child.key != null ? child.key : `${keyPrefix}-${index}`,\n props: {\n ...props,\n active: panelProps.active,\n collapseLabel: panelProps.collapseLabel,\n onClose: panelProps.onClose,\n open: panelProps.open,\n panelId: panelProps.panelId,\n },\n });\n }\n\n return panelChildren ?? children;\n}\n\nexport function renderKeyedShellChildren(children: unknown, keyPrefix: string): JSX.Element {\n const childList = toChildArray(children);\n const keyedChildren = keyMissingShellChildren(childList, keyPrefix);\n\n return (\n <For\n each={() => keyedChildren}\n by={(child, index) => renderShellChildKey(child, index, keyPrefix)}\n >\n {(child) => child as never}\n </For>\n );\n}\n\nexport function renderKeyedShellPanelChildren(\n children: unknown,\n keyPrefix: string,\n panelProps: ShellResponsivePanelProps,\n): JSX.Element {\n const childList = toChildArray(children);\n const keyedChildren = applyShellPanelProps(childList, keyPrefix, panelProps);\n\n return (\n <For\n each={() => keyedChildren}\n by={(child, index) => renderShellChildKey(child, index, keyPrefix)}\n >\n {(child) => child as never}\n </For>\n );\n}\n\nexport function ShellResponsiveWatcher<TBreakpoint extends string>(props: {\n breakpoint: TBreakpoint;\n isCollapsed: (breakpoint: TBreakpoint) => boolean;\n onExpand: () => void;\n onResize: (nextCollapsed: boolean) => void;\n}): JSX.Element | null {\n const { breakpoint, isCollapsed, onExpand, onResize } = props;\n\n resource(\n ({ signal }: { signal: AbortSignal }) => {\n const updateCollapsedState = () => {\n const nextCollapsed = isCollapsed(breakpoint);\n onResize(nextCollapsed);\n\n if (!nextCollapsed) {\n onExpand();\n }\n };\n\n updateCollapsedState();\n\n if (typeof window === \"undefined\") {\n return null;\n }\n\n window.addEventListener(\"resize\", updateCollapsedState);\n signal.addEventListener(\n \"abort\",\n () => {\n window.removeEventListener(\"resize\", updateCollapsedState);\n },\n { once: true },\n );\n\n return null;\n },\n [breakpoint],\n );\n\n return null;\n}\n\nexport function ShellPanelWatcher(props: {\n contentId?: string;\n onClose: () => void;\n open: boolean;\n panelSlot: string;\n}): JSX.Element | null {\n const { contentId, onClose, open, panelSlot } = props;\n\n resource(\n ({ signal }: { signal: AbortSignal }) => {\n if (!open || typeof window === \"undefined\") {\n releaseShellScrollLock();\n return null;\n }\n\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\") {\n return;\n }\n\n event.preventDefault();\n onClose();\n };\n\n window.addEventListener(\"keydown\", onKeyDown);\n\n const focusFrame =\n typeof window.requestAnimationFrame === \"function\"\n ? window.requestAnimationFrame(() => {\n const content =\n (typeof contentId === \"string\" ? document.getElementById(contentId) : null) ??\n document.querySelector<HTMLElement>(\n `[data-slot=\"${panelSlot}\"][data-state=\"open\"]`,\n );\n\n content?.focus({ preventScroll: true });\n })\n : undefined;\n\n acquireShellScrollLock();\n\n signal.addEventListener(\n \"abort\",\n () => {\n window.removeEventListener(\"keydown\", onKeyDown);\n\n if (focusFrame !== undefined && typeof window.cancelAnimationFrame === \"function\") {\n window.cancelAnimationFrame(focusFrame);\n }\n\n releaseShellScrollLock();\n },\n { once: true },\n );\n\n return null;\n },\n [open],\n );\n\n return null;\n}\n"],"mappings":";;;;;AAaA,IAAI,uBAAuB;AAC3B,IAAI,+BAA8C;AAElD,SAAS,yBAA+B;CACtC,IAAI,OAAO,aAAa,aAAa;CAErC,MAAM,OAAO,SAAS;CACtB,IAAI,yBAAyB,GAC3B,+BAA+B,KAAK,aAAa,wBAAwB;CAG3E,wBAAwB;CACxB,KAAK,aAAa,0BAA0B,MAAM;AACpD;AAEA,SAAS,yBAA+B;CACtC,IAAI,OAAO,aAAa,eAAe,yBAAyB,GAAG;CAEnE,wBAAwB;CACxB,IAAI,uBAAuB,GAAG;CAE9B,MAAM,OAAO,SAAS;CACtB,IAAI,iCAAiC,MACnC,KAAK,gBAAgB,wBAAwB;MAE7C,KAAK,aAAa,0BAA0B,4BAA4B;CAG1E,+BAA+B;AACjC;AAEA,SAAgB,kBAAkB,OAAgB,gBAA8C;CAC9F,OAAO,aAAa,KAAK,KAAK,MAAM,SAAS;AAC/C;AAEA,SAAS,oBAAoB,OAAgB,OAAe,WAA2B;CACrF,OAAO,aAAa,KAAK,KAAK,MAAM,OAAO,OAAO,OAAO,MAAM,GAAG,IAAI,GAAG,UAAU,GAAG;AACxF;AAEA,SAAS,wBAAwB,UAAqB,WAA8B;CAClF,IAAI;CAEJ,KAAK,IAAI,QAAQ,GAAG,QAAQ,SAAS,QAAQ,SAAS,GAAG;EACvD,MAAM,QAAQ,SAAS;EAEvB,IAAI,aAAa,KAAK,KAAK,MAAM,OAAO,MAAM;GAC5C,kBAAkB,SAAS,MAAM,GAAG,KAAK;GACzC,cAAc,KAAK;IACjB,GAAG;IACH,KAAK,GAAG,UAAU,GAAG;GACvB,CAAC;GACD;EACF;EAEA,eAAe,KAAK,KAAK;CAC3B;CAEA,OAAO,iBAAiB;AAC1B;AAEA,SAAS,cACP,OACA,YACS;CACT,OACE,OAAO,WAAW,WAAW,UAC7B,OAAO,kBAAkB,WAAW,iBACpC,OAAO,YAAY,WAAW,WAC9B,OAAO,SAAS,WAAW,QAC3B,OAAO,YAAY,WAAW;AAElC;AAEA,SAAS,qBACP,UACA,WACA,YACW;CACX,IAAI;CAEJ,KAAK,IAAI,QAAQ,GAAG,QAAQ,SAAS,QAAQ,SAAS,GAAG;EACvD,MAAM,QAAQ,SAAS;EAEvB,IAAI,CAAC,aAAa,KAAK,GAAG;GACxB,eAAe,KAAK,KAAK;GACzB;EACF;EAEA,MAAM,QAAQ,MAAM;EAEpB,IAAI,cAAc,OAAO,UAAU,GAAG;GACpC,eAAe,KAAK,KAAK;GACzB;EACF;EAEA,kBAAkB,SAAS,MAAM,GAAG,KAAK;EACzC,cAAc,KAAK;GACjB,GAAG;GACH,KAAK,MAAM,OAAO,OAAO,MAAM,MAAM,GAAG,UAAU,GAAG;GACrD,OAAO;IACL,GAAG;IACH,QAAQ,WAAW;IACnB,eAAe,WAAW;IAC1B,SAAS,WAAW;IACpB,MAAM,WAAW;IACjB,SAAS,WAAW;GACtB;EACF,CAAC;CACH;CAEA,OAAO,iBAAiB;AAC1B;AAEA,SAAgB,yBAAyB,UAAmB,WAAgC;CAE1F,MAAM,gBAAgB,wBADJ,aAAa,QACuB,GAAG,SAAS;CAElE,OACE,oBAAC,KAAD;EACE,YAAY;EACZ,KAAK,OAAO,UAAU,oBAAoB,OAAO,OAAO,SAAS;aAE/D,UAAU;CACT,CAAA;AAET;AAEA,SAAgB,8BACd,UACA,WACA,YACa;CAEb,MAAM,gBAAgB,qBADJ,aAAa,QACoB,GAAG,WAAW,UAAU;CAE3E,OACE,oBAAC,KAAD;EACE,YAAY;EACZ,KAAK,OAAO,UAAU,oBAAoB,OAAO,OAAO,SAAS;aAE/D,UAAU;CACT,CAAA;AAET;AAEA,SAAgB,uBAAmD,OAK5C;CACrB,MAAM,EAAE,YAAY,aAAa,UAAU,aAAa;CAExD,UACG,EAAE,aAAsC;EACvC,MAAM,6BAA6B;GACjC,MAAM,gBAAgB,YAAY,UAAU;GAC5C,SAAS,aAAa;GAEtB,IAAI,CAAC,eACH,SAAS;EAEb;EAEA,qBAAqB;EAErB,IAAI,OAAO,WAAW,aACpB,OAAO;EAGT,OAAO,iBAAiB,UAAU,oBAAoB;EACtD,OAAO,iBACL,eACM;GACJ,OAAO,oBAAoB,UAAU,oBAAoB;EAC3D,GACA,EAAE,MAAM,KAAK,CACf;EAEA,OAAO;CACT,GACA,CAAC,UAAU,CACb;CAEA,OAAO;AACT;AAEA,SAAgB,kBAAkB,OAKX;CACrB,MAAM,EAAE,WAAW,SAAS,MAAM,cAAc;CAEhD,UACG,EAAE,aAAsC;EACvC,IAAI,CAAC,QAAQ,OAAO,WAAW,aAAa;GAC1C,uBAAuB;GACvB,OAAO;EACT;EAEA,MAAM,aAAa,UAAyB;GAC1C,IAAI,MAAM,QAAQ,UAChB;GAGF,MAAM,eAAe;GACrB,QAAQ;EACV;EAEA,OAAO,iBAAiB,WAAW,SAAS;EAE5C,MAAM,aACJ,OAAO,OAAO,0BAA0B,aACpC,OAAO,4BAA4B;GAOjC,EALG,OAAO,cAAc,WAAW,SAAS,eAAe,SAAS,IAAI,SACtE,SAAS,cACP,eAAe,UAAU,sBAC3B,EAAA,EAEO,MAAM,EAAE,eAAe,KAAK,CAAC;EACxC,CAAC,IACD,KAAA;EAEN,uBAAuB;EAEvB,OAAO,iBACL,eACM;GACJ,OAAO,oBAAoB,WAAW,SAAS;GAE/C,IAAI,eAAe,KAAA,KAAa,OAAO,OAAO,yBAAyB,YACrE,OAAO,qBAAqB,UAAU;GAGxC,uBAAuB;EACzB,GACA,EAAE,MAAM,KAAK,CACf;EAEA,OAAO;CACT,GACA,CAAC,IAAI,CACP;CAEA,OAAO;AACT"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
//#region src/components/shell/shell.a11y.d.ts
|
|
2
|
-
declare const SHELL_A11Y_CONTRACT: {
|
|
3
|
-
readonly DATA_ATTRIBUTES: {
|
|
4
|
-
readonly slot: "data-slot";
|
|
5
|
-
readonly layout: "data-ak-layout";
|
|
6
|
-
readonly variant: "data-variant";
|
|
7
|
-
readonly gap: "data-gap";
|
|
8
|
-
};
|
|
9
|
-
readonly SLOT_VALUES: {
|
|
10
|
-
readonly root: "shell";
|
|
11
|
-
readonly nav: "shell-nav";
|
|
12
|
-
readonly main: "shell-main";
|
|
13
|
-
};
|
|
14
|
-
readonly VARIANT_VALUES: {
|
|
15
|
-
readonly sidebar: "sidebar";
|
|
16
|
-
readonly topbar: "topbar";
|
|
17
|
-
readonly rail: "rail";
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
type ShellA11yContract = typeof SHELL_A11Y_CONTRACT;
|
|
21
|
-
//#endregion
|
|
22
|
-
export { SHELL_A11Y_CONTRACT, ShellA11yContract };
|
|
23
|
-
//# sourceMappingURL=shell.a11y.d.ts.map
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
//#region src/components/shell/shell.a11y.ts
|
|
2
|
-
const SHELL_A11Y_CONTRACT = {
|
|
3
|
-
DATA_ATTRIBUTES: {
|
|
4
|
-
slot: "data-slot",
|
|
5
|
-
layout: "data-ak-layout",
|
|
6
|
-
variant: "data-variant",
|
|
7
|
-
gap: "data-gap"
|
|
8
|
-
},
|
|
9
|
-
SLOT_VALUES: {
|
|
10
|
-
root: "shell",
|
|
11
|
-
nav: "shell-nav",
|
|
12
|
-
main: "shell-main"
|
|
13
|
-
},
|
|
14
|
-
VARIANT_VALUES: {
|
|
15
|
-
sidebar: "sidebar",
|
|
16
|
-
topbar: "topbar",
|
|
17
|
-
rail: "rail"
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
//#endregion
|
|
21
|
-
export { SHELL_A11Y_CONTRACT };
|
|
22
|
-
|
|
23
|
-
//# sourceMappingURL=shell.a11y.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shell.a11y.js","names":[],"sources":["../../../src/components/shell/shell.a11y.ts"],"sourcesContent":["export const SHELL_A11Y_CONTRACT = {\n DATA_ATTRIBUTES: {\n slot: \"data-slot\" as const,\n layout: \"data-ak-layout\" as const,\n variant: \"data-variant\" as const,\n gap: \"data-gap\" as const,\n },\n SLOT_VALUES: {\n root: \"shell\" as const,\n nav: \"shell-nav\" as const,\n main: \"shell-main\" as const,\n },\n VARIANT_VALUES: {\n sidebar: \"sidebar\" as const,\n topbar: \"topbar\" as const,\n rail: \"rail\" as const,\n },\n} as const;\n\nexport type ShellA11yContract = typeof SHELL_A11Y_CONTRACT;\n"],"mappings":";AAAA,MAAa,sBAAsB;CACjC,iBAAiB;EACf,MAAM;EACN,QAAQ;EACR,SAAS;EACT,KAAK;CACP;CACA,aAAa;EACX,MAAM;EACN,KAAK;EACL,MAAM;CACR;CACA,gBAAgB;EACd,SAAS;EACT,QAAQ;EACR,MAAM;CACR;AACF"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ShellAsChildProps, ShellDivProps, ShellMainAsChildProps, ShellMainDivProps, ShellMainMainProps, ShellNavAsChildProps, ShellNavDivProps } from "./shell.types.js";
|
|
2
|
-
|
|
3
|
-
//#region src/components/shell/shell.d.ts
|
|
4
|
-
declare function Shell(props: ShellDivProps): JSX.Element;
|
|
5
|
-
declare function Shell(props: ShellAsChildProps): JSX.Element;
|
|
6
|
-
declare function ShellNav(props: ShellNavDivProps): JSX.Element;
|
|
7
|
-
declare function ShellNav(props: ShellNavAsChildProps): JSX.Element;
|
|
8
|
-
declare function ShellMain(props: ShellMainMainProps): JSX.Element;
|
|
9
|
-
declare function ShellMain(props: ShellMainDivProps): JSX.Element;
|
|
10
|
-
declare function ShellMain(props: ShellMainAsChildProps): JSX.Element;
|
|
11
|
-
//#endregion
|
|
12
|
-
export { Shell, ShellMain, ShellNav };
|
|
13
|
-
//# sourceMappingURL=shell.d.ts.map
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { classes } from "../_internal/classes.js";
|
|
2
|
-
import { mergeProps } from "../_internal/merge-props.js";
|
|
3
|
-
import { jsx } from "@askrjs/askr/jsx-runtime";
|
|
4
|
-
import { Slot } from "@askrjs/askr/foundations";
|
|
5
|
-
//#region src/components/shell/shell.tsx
|
|
6
|
-
function Shell(props) {
|
|
7
|
-
const { asChild, children, class: className, variant = "sidebar", ref, ...rest } = props;
|
|
8
|
-
const finalProps = mergeProps(rest, {
|
|
9
|
-
ref,
|
|
10
|
-
class: classes("shell", className),
|
|
11
|
-
"data-slot": "shell",
|
|
12
|
-
"data-ak-layout": "true",
|
|
13
|
-
"data-variant": variant
|
|
14
|
-
});
|
|
15
|
-
if (asChild) return /* @__PURE__ */ jsx(Slot, {
|
|
16
|
-
asChild: true,
|
|
17
|
-
...finalProps,
|
|
18
|
-
children
|
|
19
|
-
});
|
|
20
|
-
return /* @__PURE__ */ jsx("div", {
|
|
21
|
-
...finalProps,
|
|
22
|
-
children
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
function ShellNav(props) {
|
|
26
|
-
const { asChild, children, class: className, ref, ...rest } = props;
|
|
27
|
-
const finalProps = mergeProps(rest, {
|
|
28
|
-
ref,
|
|
29
|
-
class: classes("shell-nav", className),
|
|
30
|
-
"data-slot": "shell-nav",
|
|
31
|
-
"data-ak-layout": "true"
|
|
32
|
-
});
|
|
33
|
-
if (asChild) return /* @__PURE__ */ jsx(Slot, {
|
|
34
|
-
asChild: true,
|
|
35
|
-
...finalProps,
|
|
36
|
-
children
|
|
37
|
-
});
|
|
38
|
-
return /* @__PURE__ */ jsx("div", {
|
|
39
|
-
...finalProps,
|
|
40
|
-
children
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
function ShellMain(props) {
|
|
44
|
-
const as = "as" in props ? props.as : "main";
|
|
45
|
-
const { asChild, children, class: className, ref, ...rest } = props;
|
|
46
|
-
const finalProps = mergeProps(rest, {
|
|
47
|
-
ref,
|
|
48
|
-
class: classes("shell-main", className),
|
|
49
|
-
"data-slot": "shell-main",
|
|
50
|
-
"data-ak-layout": "true"
|
|
51
|
-
});
|
|
52
|
-
if (asChild) return /* @__PURE__ */ jsx(Slot, {
|
|
53
|
-
asChild: true,
|
|
54
|
-
...finalProps,
|
|
55
|
-
children
|
|
56
|
-
});
|
|
57
|
-
if (as === "div") return /* @__PURE__ */ jsx("div", {
|
|
58
|
-
...finalProps,
|
|
59
|
-
children
|
|
60
|
-
});
|
|
61
|
-
return /* @__PURE__ */ jsx("main", {
|
|
62
|
-
...finalProps,
|
|
63
|
-
children
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
//#endregion
|
|
67
|
-
export { Shell, ShellMain, ShellNav };
|
|
68
|
-
|
|
69
|
-
//# sourceMappingURL=shell.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shell.js","names":[],"sources":["../../../src/components/shell/shell.tsx"],"sourcesContent":["import { Slot } from \"@askrjs/askr/foundations\";\nimport { classes } from \"../_internal/classes\";\nimport { mergeProps } from \"../_internal/merge-props\";\nimport type {\n ShellAsChildProps,\n ShellDivProps,\n ShellMainAsChildProps,\n ShellMainDivProps,\n ShellMainMainProps,\n ShellNavAsChildProps,\n ShellNavDivProps,\n} from \"./shell.types\";\n\nexport function Shell(props: ShellDivProps): JSX.Element;\nexport function Shell(props: ShellAsChildProps): JSX.Element;\nexport function Shell(props: ShellDivProps | ShellAsChildProps) {\n const { asChild, children, class: className, variant = \"sidebar\", ref, ...rest } = props;\n\n const finalProps = mergeProps(rest, {\n ref,\n class: classes(\"shell\", className),\n \"data-slot\": \"shell\",\n \"data-ak-layout\": \"true\",\n \"data-variant\": variant,\n });\n\n if (asChild) {\n return <Slot asChild {...finalProps} children={children as JSX.Element} />;\n }\n\n return <div {...finalProps}>{children}</div>;\n}\n\nexport function ShellNav(props: ShellNavDivProps): JSX.Element;\nexport function ShellNav(props: ShellNavAsChildProps): JSX.Element;\nexport function ShellNav(props: ShellNavDivProps | ShellNavAsChildProps) {\n const { asChild, children, class: className, ref, ...rest } = props;\n const finalProps = mergeProps(rest, {\n ref,\n class: classes(\"shell-nav\", className),\n \"data-slot\": \"shell-nav\",\n \"data-ak-layout\": \"true\",\n });\n\n if (asChild) {\n return <Slot asChild {...finalProps} children={children as JSX.Element} />;\n }\n\n return <div {...finalProps}>{children}</div>;\n}\n\nexport function ShellMain(props: ShellMainMainProps): JSX.Element;\nexport function ShellMain(props: ShellMainDivProps): JSX.Element;\nexport function ShellMain(props: ShellMainAsChildProps): JSX.Element;\nexport function ShellMain(props: ShellMainMainProps | ShellMainDivProps | ShellMainAsChildProps) {\n const as = \"as\" in props ? props.as : \"main\";\n const { asChild, children, class: className, ref, ...rest } = props;\n const finalProps = mergeProps(rest, {\n ref,\n class: classes(\"shell-main\", className),\n \"data-slot\": \"shell-main\",\n \"data-ak-layout\": \"true\",\n });\n\n if (asChild) {\n return <Slot asChild {...finalProps} children={children as JSX.Element} />;\n }\n\n if (as === \"div\") {\n return <div {...finalProps}>{children}</div>;\n }\n\n return <main {...finalProps}>{children}</main>;\n}\n"],"mappings":";;;;;AAeA,SAAgB,MAAM,OAA0C;CAC9D,MAAM,EAAE,SAAS,UAAU,OAAO,WAAW,UAAU,WAAW,KAAK,GAAG,SAAS;CAEnF,MAAM,aAAa,WAAW,MAAM;EAClC;EACA,OAAO,QAAQ,SAAS,SAAS;EACjC,aAAa;EACb,kBAAkB;EAClB,gBAAgB;CAClB,CAAC;CAED,IAAI,SACF,OAAO,oBAAC,MAAD;EAAM,SAAA;EAAQ,GAAI;EAAsB;CAA0B,CAAA;CAG3E,OAAO,oBAAC,OAAD;EAAK,GAAI;EAAa;CAAc,CAAA;AAC7C;AAIA,SAAgB,SAAS,OAAgD;CACvE,MAAM,EAAE,SAAS,UAAU,OAAO,WAAW,KAAK,GAAG,SAAS;CAC9D,MAAM,aAAa,WAAW,MAAM;EAClC;EACA,OAAO,QAAQ,aAAa,SAAS;EACrC,aAAa;EACb,kBAAkB;CACpB,CAAC;CAED,IAAI,SACF,OAAO,oBAAC,MAAD;EAAM,SAAA;EAAQ,GAAI;EAAsB;CAA0B,CAAA;CAG3E,OAAO,oBAAC,OAAD;EAAK,GAAI;EAAa;CAAc,CAAA;AAC7C;AAKA,SAAgB,UAAU,OAAuE;CAC/F,MAAM,KAAK,QAAQ,QAAQ,MAAM,KAAK;CACtC,MAAM,EAAE,SAAS,UAAU,OAAO,WAAW,KAAK,GAAG,SAAS;CAC9D,MAAM,aAAa,WAAW,MAAM;EAClC;EACA,OAAO,QAAQ,cAAc,SAAS;EACtC,aAAa;EACb,kBAAkB;CACpB,CAAC;CAED,IAAI,SACF,OAAO,oBAAC,MAAD;EAAM,SAAA;EAAQ,GAAI;EAAsB;CAA0B,CAAA;CAG3E,IAAI,OAAO,OACT,OAAO,oBAAC,OAAD;EAAK,GAAI;EAAa;CAAc,CAAA;CAG7C,OAAO,oBAAC,QAAD;EAAM,GAAI;EAAa;CAAe,CAAA;AAC/C"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { JSXElement } from "@askrjs/askr/foundations";
|
|
2
|
-
import { Ref } from "@askrjs/askr/foundations/utilities";
|
|
3
|
-
|
|
4
|
-
//#region src/components/shell/shell.types.d.ts
|
|
5
|
-
type ShellVariant = "sidebar" | "topbar" | "rail";
|
|
6
|
-
type ShellOwnProps = {
|
|
7
|
-
variant?: ShellVariant;
|
|
8
|
-
class?: string;
|
|
9
|
-
children?: unknown;
|
|
10
|
-
};
|
|
11
|
-
type ShellDivProps = Omit<JSX.IntrinsicElements["div"], "children" | "ref"> & ShellOwnProps & {
|
|
12
|
-
asChild?: false;
|
|
13
|
-
ref?: Ref<HTMLDivElement>;
|
|
14
|
-
};
|
|
15
|
-
type ShellAsChildProps = Omit<ShellOwnProps, "as"> & {
|
|
16
|
-
asChild: true;
|
|
17
|
-
children: JSXElement;
|
|
18
|
-
ref?: Ref<unknown>;
|
|
19
|
-
};
|
|
20
|
-
type ShellProps = ShellDivProps | ShellAsChildProps;
|
|
21
|
-
type ShellNavOwnProps = {
|
|
22
|
-
class?: string;
|
|
23
|
-
children?: unknown;
|
|
24
|
-
};
|
|
25
|
-
type ShellNavDivProps = Omit<JSX.IntrinsicElements["div"], "children" | "ref"> & ShellNavOwnProps & {
|
|
26
|
-
asChild?: false;
|
|
27
|
-
ref?: Ref<HTMLDivElement>;
|
|
28
|
-
};
|
|
29
|
-
type ShellNavAsChildProps = Omit<ShellNavOwnProps, "as"> & {
|
|
30
|
-
asChild: true;
|
|
31
|
-
children: JSXElement;
|
|
32
|
-
ref?: Ref<unknown>;
|
|
33
|
-
};
|
|
34
|
-
type ShellNavProps = ShellNavDivProps | ShellNavAsChildProps;
|
|
35
|
-
type ShellMainOwnProps = {
|
|
36
|
-
as?: "main" | "div";
|
|
37
|
-
class?: string;
|
|
38
|
-
children?: unknown;
|
|
39
|
-
};
|
|
40
|
-
type ShellMainMainProps = Omit<JSX.IntrinsicElements["main"], "children" | "ref"> & ShellMainOwnProps & {
|
|
41
|
-
as?: "main";
|
|
42
|
-
asChild?: false;
|
|
43
|
-
ref?: Ref<HTMLElement>;
|
|
44
|
-
};
|
|
45
|
-
type ShellMainDivProps = Omit<JSX.IntrinsicElements["div"], "children" | "ref"> & ShellMainOwnProps & {
|
|
46
|
-
as: "div";
|
|
47
|
-
asChild?: false;
|
|
48
|
-
ref?: Ref<HTMLDivElement>;
|
|
49
|
-
};
|
|
50
|
-
type ShellMainAsChildProps = Omit<ShellMainOwnProps, "as"> & {
|
|
51
|
-
asChild: true;
|
|
52
|
-
children: JSXElement;
|
|
53
|
-
ref?: Ref<unknown>;
|
|
54
|
-
};
|
|
55
|
-
type ShellMainProps = ShellMainMainProps | ShellMainDivProps | ShellMainAsChildProps;
|
|
56
|
-
//#endregion
|
|
57
|
-
export { ShellAsChildProps, ShellDivProps, ShellMainAsChildProps, ShellMainDivProps, ShellMainMainProps, ShellMainProps, ShellNavAsChildProps, ShellNavDivProps, ShellNavProps, ShellOwnProps, ShellProps, ShellVariant };
|
|
58
|
-
//# sourceMappingURL=shell.types.d.ts.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { SidebarPanelProps } from "./sidebar.types.js";
|
|
2
|
-
|
|
3
|
-
//#region src/components/sidebar/sidebar-panel.d.ts
|
|
4
|
-
declare function SidebarPanel(props: SidebarPanelProps): JSX.Element | null;
|
|
5
|
-
//#endregion
|
|
6
|
-
export { SidebarPanel };
|
|
7
|
-
//# sourceMappingURL=sidebar-panel.d.ts.map
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { renderShellPanel } from "../shell/shell-panel.js";
|
|
2
|
-
import { SidebarResponsiveContext } from "./sidebar.context.js";
|
|
3
|
-
import { readContext } from "@askrjs/askr";
|
|
4
|
-
//#region src/components/sidebar/sidebar-panel.tsx
|
|
5
|
-
const DEFAULT_SIDEBAR_RESPONSIVE_CONTEXT = {
|
|
6
|
-
active: () => false,
|
|
7
|
-
collapseLabel: () => "Menu",
|
|
8
|
-
closePanel: () => void 0,
|
|
9
|
-
iconCollapsed: () => false,
|
|
10
|
-
isRailCollapsible: () => false,
|
|
11
|
-
orientation: () => "vertical",
|
|
12
|
-
panelId: () => void 0,
|
|
13
|
-
panelOpen: () => false,
|
|
14
|
-
togglePanel: () => void 0,
|
|
15
|
-
toggleRail: () => void 0
|
|
16
|
-
};
|
|
17
|
-
function SidebarPanel(props) {
|
|
18
|
-
const { active: activeProp, brand, children, class: className, collapseLabel: collapseLabelProp, onClose, open: openProp, panelId: panelIdProp, ref, ...rest } = props;
|
|
19
|
-
const responsive = activeProp === void 0 || collapseLabelProp === void 0 || onClose === void 0 || openProp === void 0 || panelIdProp === void 0 ? (() => {
|
|
20
|
-
try {
|
|
21
|
-
return readContext(SidebarResponsiveContext);
|
|
22
|
-
} catch {
|
|
23
|
-
return DEFAULT_SIDEBAR_RESPONSIVE_CONTEXT;
|
|
24
|
-
}
|
|
25
|
-
})() : DEFAULT_SIDEBAR_RESPONSIVE_CONTEXT;
|
|
26
|
-
const active = activeProp ?? responsive.active();
|
|
27
|
-
const open = openProp ?? responsive.panelOpen();
|
|
28
|
-
const panelId = panelIdProp ?? responsive.panelId();
|
|
29
|
-
const collapseLabel = collapseLabelProp ?? responsive.collapseLabel();
|
|
30
|
-
const closePanel = onClose ?? responsive.closePanel;
|
|
31
|
-
return renderShellPanel({
|
|
32
|
-
active,
|
|
33
|
-
brand,
|
|
34
|
-
children,
|
|
35
|
-
className,
|
|
36
|
-
collapseLabel,
|
|
37
|
-
dataOrientation: responsive.orientation(),
|
|
38
|
-
onClose: closePanel,
|
|
39
|
-
open,
|
|
40
|
-
panelId,
|
|
41
|
-
prefix: "sidebar",
|
|
42
|
-
ref,
|
|
43
|
-
rest
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
//#endregion
|
|
47
|
-
export { SidebarPanel };
|
|
48
|
-
|
|
49
|
-
//# sourceMappingURL=sidebar-panel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar-panel.js","names":[],"sources":["../../../src/components/sidebar/sidebar-panel.tsx"],"sourcesContent":["import { readContext } from \"@askrjs/askr\";\nimport { renderShellPanel } from \"../shell/shell-panel\";\nimport { SidebarResponsiveContext } from \"./sidebar.context\";\nimport type { SidebarPanelProps } from \"./sidebar.types\";\n\nconst DEFAULT_SIDEBAR_RESPONSIVE_CONTEXT = {\n active: () => false,\n collapseLabel: () => \"Menu\",\n closePanel: () => undefined,\n iconCollapsed: () => false,\n isRailCollapsible: () => false,\n orientation: () => \"vertical\" as const,\n panelId: () => undefined,\n panelOpen: () => false,\n togglePanel: () => undefined,\n toggleRail: () => undefined,\n};\n\nexport function SidebarPanel(props: SidebarPanelProps): JSX.Element | null {\n const {\n active: activeProp,\n brand,\n children,\n class: className,\n collapseLabel: collapseLabelProp,\n onClose,\n open: openProp,\n panelId: panelIdProp,\n ref,\n ...rest\n } = props;\n const needsResponsiveContext =\n activeProp === undefined ||\n collapseLabelProp === undefined ||\n onClose === undefined ||\n openProp === undefined ||\n panelIdProp === undefined;\n const responsive = needsResponsiveContext\n ? (() => {\n try {\n return readContext(SidebarResponsiveContext);\n } catch {\n return DEFAULT_SIDEBAR_RESPONSIVE_CONTEXT;\n }\n })()\n : DEFAULT_SIDEBAR_RESPONSIVE_CONTEXT;\n const active = activeProp ?? responsive.active();\n const open = openProp ?? responsive.panelOpen();\n const panelId = panelIdProp ?? responsive.panelId();\n const collapseLabel = collapseLabelProp ?? responsive.collapseLabel();\n const closePanel = onClose ?? responsive.closePanel;\n\n return renderShellPanel({\n active,\n brand,\n children,\n className,\n collapseLabel,\n dataOrientation: responsive.orientation(),\n onClose: closePanel,\n open,\n panelId,\n prefix: \"sidebar\",\n ref,\n rest,\n });\n}\n"],"mappings":";;;;AAKA,MAAM,qCAAqC;CACzC,cAAc;CACd,qBAAqB;CACrB,kBAAkB,KAAA;CAClB,qBAAqB;CACrB,yBAAyB;CACzB,mBAAmB;CACnB,eAAe,KAAA;CACf,iBAAiB;CACjB,mBAAmB,KAAA;CACnB,kBAAkB,KAAA;AACpB;AAEA,SAAgB,aAAa,OAA8C;CACzE,MAAM,EACJ,QAAQ,YACR,OACA,UACA,OAAO,WACP,eAAe,mBACf,SACA,MAAM,UACN,SAAS,aACT,KACA,GAAG,SACD;CAOJ,MAAM,aALJ,eAAe,KAAA,KACf,sBAAsB,KAAA,KACtB,YAAY,KAAA,KACZ,aAAa,KAAA,KACb,gBAAgB,KAAA,WAEP;EACL,IAAI;GACF,OAAO,YAAY,wBAAwB;EAC7C,QAAQ;GACN,OAAO;EACT;CACF,EAAA,CAAG,IACH;CACJ,MAAM,SAAS,cAAc,WAAW,OAAO;CAC/C,MAAM,OAAO,YAAY,WAAW,UAAU;CAC9C,MAAM,UAAU,eAAe,WAAW,QAAQ;CAClD,MAAM,gBAAgB,qBAAqB,WAAW,cAAc;CACpE,MAAM,aAAa,WAAW,WAAW;CAEzC,OAAO,iBAAiB;EACtB;EACA;EACA;EACA;EACA;EACA,iBAAiB,WAAW,YAAY;EACxC,SAAS;EACT;EACA;EACA,QAAQ;EACR;EACA;CACF,CAAC;AACH"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { SidebarToggleProps } from "./sidebar.types.js";
|
|
2
|
-
|
|
3
|
-
//#region src/components/sidebar/sidebar-toggle.d.ts
|
|
4
|
-
declare function SidebarToggle(_props: SidebarToggleProps): null;
|
|
5
|
-
//#endregion
|
|
6
|
-
export { SidebarToggle };
|
|
7
|
-
//# sourceMappingURL=sidebar-toggle.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar-toggle.js","names":[],"sources":["../../../src/components/sidebar/sidebar-toggle.tsx"],"sourcesContent":["import type { SidebarToggleProps } from \"./sidebar.types\";\n\nexport function SidebarToggle(_props: SidebarToggleProps): null {\n return null;\n}\n"],"mappings":";AAEA,SAAgB,cAAc,QAAkC;CAC9D,OAAO;AACT"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { defineContext } from "@askrjs/askr";
|
|
2
|
-
//#region src/components/sidebar/sidebar.context.ts
|
|
3
|
-
const defaultOrientation = () => "vertical";
|
|
4
|
-
const defaultResponsiveContext = {
|
|
5
|
-
active: () => false,
|
|
6
|
-
collapseLabel: () => "Menu",
|
|
7
|
-
closePanel: () => void 0,
|
|
8
|
-
iconCollapsed: () => false,
|
|
9
|
-
isRailCollapsible: () => false,
|
|
10
|
-
orientation: defaultOrientation,
|
|
11
|
-
panelId: () => void 0,
|
|
12
|
-
panelOpen: () => false,
|
|
13
|
-
togglePanel: () => void 0,
|
|
14
|
-
toggleRail: () => void 0
|
|
15
|
-
};
|
|
16
|
-
const SidebarContext = defineContext({ orientation: defaultOrientation });
|
|
17
|
-
const SidebarResponsiveContext = defineContext(defaultResponsiveContext);
|
|
18
|
-
//#endregion
|
|
19
|
-
export { SidebarContext, SidebarResponsiveContext };
|
|
20
|
-
|
|
21
|
-
//# sourceMappingURL=sidebar.context.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar.context.js","names":[],"sources":["../../../src/components/sidebar/sidebar.context.ts"],"sourcesContent":["import { defineContext } from \"@askrjs/askr\";\n\nexport type SidebarContextValue = {\n orientation: () => \"vertical\";\n};\n\nexport type SidebarResponsiveContextValue = {\n active: () => boolean;\n collapseLabel: () => string;\n closePanel: () => void;\n iconCollapsed: () => boolean;\n isRailCollapsible: () => boolean;\n orientation: () => \"vertical\";\n panelId: () => string | undefined;\n panelOpen: () => boolean;\n togglePanel: () => void;\n toggleRail: () => void;\n};\n\nconst defaultOrientation = () => \"vertical\" as const;\n\nconst defaultResponsiveContext: SidebarResponsiveContextValue = {\n active: () => false,\n collapseLabel: () => \"Menu\",\n closePanel: () => undefined,\n iconCollapsed: () => false,\n isRailCollapsible: () => false,\n orientation: defaultOrientation,\n panelId: () => undefined,\n panelOpen: () => false,\n togglePanel: () => undefined,\n toggleRail: () => undefined,\n};\n\nexport const SidebarContext = defineContext<SidebarContextValue>({\n orientation: defaultOrientation,\n});\n\nexport const SidebarResponsiveContext =\n defineContext<SidebarResponsiveContextValue>(defaultResponsiveContext);\n"],"mappings":";;AAmBA,MAAM,2BAA2B;AAEjC,MAAM,2BAA0D;CAC9D,cAAc;CACd,qBAAqB;CACrB,kBAAkB,KAAA;CAClB,qBAAqB;CACrB,yBAAyB;CACzB,aAAa;CACb,eAAe,KAAA;CACf,iBAAiB;CACjB,mBAAmB,KAAA;CACnB,kBAAkB,KAAA;AACpB;AAEA,MAAa,iBAAiB,cAAmC,EAC/D,aAAa,mBACf,CAAC;AAED,MAAa,2BACX,cAA6C,wBAAwB"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { isNavbarCollapsed } from "../navbar/navbar.shared.js";
|
|
2
|
-
//#region src/components/sidebar/sidebar.shared.ts
|
|
3
|
-
function resolveSidebarCollapsible(collapsible) {
|
|
4
|
-
return collapsible ?? "none";
|
|
5
|
-
}
|
|
6
|
-
function isSidebarCollapsed(breakpoint) {
|
|
7
|
-
return isNavbarCollapsed(breakpoint);
|
|
8
|
-
}
|
|
9
|
-
//#endregion
|
|
10
|
-
export { isSidebarCollapsed, resolveSidebarCollapsible };
|
|
11
|
-
|
|
12
|
-
//# sourceMappingURL=sidebar.shared.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar.shared.js","names":[],"sources":["../../../src/components/sidebar/sidebar.shared.ts"],"sourcesContent":["import { NAVBAR_COLLAPSE_BREAKPOINTS, isNavbarCollapsed } from \"../navbar/navbar.shared\";\nimport type { CollapseBreakpoint, Collapsible } from \"../shell/shell-nav.types\";\n\nexport { NAVBAR_COLLAPSE_BREAKPOINTS, isNavbarCollapsed };\n\nexport function resolveSidebarCollapsible(collapsible: Collapsible | undefined): Collapsible {\n return collapsible ?? \"none\";\n}\n\nexport function isSidebarCollapsed(breakpoint: CollapseBreakpoint): boolean {\n return isNavbarCollapsed(breakpoint);\n}\n"],"mappings":";;AAKA,SAAgB,0BAA0B,aAAmD;CAC3F,OAAO,eAAe;AACxB;AAEA,SAAgB,mBAAmB,YAAyC;CAC1E,OAAO,kBAAkB,UAAU;AACrC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
//#region src/components/skeleton/skeleton.a11y.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Accessibility contract for Skeleton.
|
|
4
|
-
*/
|
|
5
|
-
declare const SKELETON_A11Y_CONTRACT: {
|
|
6
|
-
readonly DATA_ATTRIBUTES: {
|
|
7
|
-
readonly slot: "data-slot";
|
|
8
|
-
};
|
|
9
|
-
readonly MARKER: "data-skeleton";
|
|
10
|
-
readonly DECORATIVE_ATTRIBUTE: "aria-hidden";
|
|
11
|
-
readonly DECORATIVE_VALUE: "true";
|
|
12
|
-
};
|
|
13
|
-
type SkeletonA11yContract = typeof SKELETON_A11Y_CONTRACT;
|
|
14
|
-
//#endregion
|
|
15
|
-
export { SKELETON_A11Y_CONTRACT, SkeletonA11yContract };
|
|
16
|
-
//# sourceMappingURL=skeleton.a11y.d.ts.map
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
//#region src/components/spacer/spacer.a11y.d.ts
|
|
2
|
-
declare const SPACER_A11Y_CONTRACT: {
|
|
3
|
-
readonly DATA_ATTRIBUTES: {
|
|
4
|
-
readonly slot: "data-slot";
|
|
5
|
-
readonly axis: "data-axis";
|
|
6
|
-
readonly grow: "data-grow";
|
|
7
|
-
readonly shrink: "data-shrink";
|
|
8
|
-
readonly basis: "data-basis";
|
|
9
|
-
};
|
|
10
|
-
readonly SLOT_VALUES: {
|
|
11
|
-
readonly root: "spacer";
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
type SpacerA11yContract = typeof SPACER_A11Y_CONTRACT;
|
|
15
|
-
//#endregion
|
|
16
|
-
export { SPACER_A11Y_CONTRACT, SpacerA11yContract };
|
|
17
|
-
//# sourceMappingURL=spacer.a11y.d.ts.map
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { SpacerAsChildProps, SpacerNativeProps } from "./spacer.types.js";
|
|
2
|
-
|
|
3
|
-
//#region src/components/spacer/spacer.d.ts
|
|
4
|
-
declare function Spacer(props: SpacerNativeProps): JSX.Element;
|
|
5
|
-
declare function Spacer(props: SpacerAsChildProps): JSX.Element;
|
|
6
|
-
//#endregion
|
|
7
|
-
export { Spacer };
|
|
8
|
-
//# sourceMappingURL=spacer.d.ts.map
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { mergeProps } from "../_internal/merge-props.js";
|
|
2
|
-
import { styleDeclarationsToClass } from "../_internal/style.js";
|
|
3
|
-
import { isCssLength, mergeLayoutStyles } from "../_internal/layout.js";
|
|
4
|
-
import { isJsxElement, toChildArray } from "../_internal/jsx.js";
|
|
5
|
-
import { jsx } from "@askrjs/askr/jsx-runtime";
|
|
6
|
-
import { Slot } from "@askrjs/askr/foundations";
|
|
7
|
-
//#region src/components/spacer/spacer.tsx
|
|
8
|
-
function Spacer(props) {
|
|
9
|
-
const { asChild, children, grow, shrink, basis, axis, ref, style: userStyle, ...rest } = props;
|
|
10
|
-
const layoutStyle = {};
|
|
11
|
-
if (axis === "inline") {
|
|
12
|
-
if (shrink !== void 0 && shrink !== 0) layoutStyle.flexShrink = shrink;
|
|
13
|
-
if (isCssLength(basis)) layoutStyle.width = basis;
|
|
14
|
-
} else if (axis === "block") {
|
|
15
|
-
if (shrink !== void 0 && shrink !== 0) layoutStyle.flexShrink = shrink;
|
|
16
|
-
if (isCssLength(basis)) layoutStyle.height = basis;
|
|
17
|
-
} else {
|
|
18
|
-
if (grow !== void 0 && grow !== 1) layoutStyle.flexGrow = grow;
|
|
19
|
-
if (shrink !== void 0 && shrink !== 1) layoutStyle.flexShrink = shrink;
|
|
20
|
-
if (isCssLength(basis)) layoutStyle.flexBasis = basis;
|
|
21
|
-
}
|
|
22
|
-
const layoutClass = styleDeclarationsToClass(mergeLayoutStyles(layoutStyle, userStyle));
|
|
23
|
-
const finalProps = mergeProps(rest, {
|
|
24
|
-
ref,
|
|
25
|
-
"data-slot": "spacer",
|
|
26
|
-
"data-axis": axis,
|
|
27
|
-
...layoutClass ? { class: layoutClass } : {}
|
|
28
|
-
});
|
|
29
|
-
const keyedChildren = toChildArray(children).map((child, index) => {
|
|
30
|
-
if (!isJsxElement(child) || child.key != null) return child;
|
|
31
|
-
return {
|
|
32
|
-
...child,
|
|
33
|
-
key: `spacer-${index}`
|
|
34
|
-
};
|
|
35
|
-
});
|
|
36
|
-
if (asChild) return /* @__PURE__ */ jsx(Slot, {
|
|
37
|
-
asChild: true,
|
|
38
|
-
...finalProps,
|
|
39
|
-
children
|
|
40
|
-
});
|
|
41
|
-
return /* @__PURE__ */ jsx("div", {
|
|
42
|
-
...finalProps,
|
|
43
|
-
children: keyedChildren
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
//#endregion
|
|
47
|
-
export { Spacer };
|
|
48
|
-
|
|
49
|
-
//# sourceMappingURL=spacer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spacer.js","names":[],"sources":["../../../src/components/spacer/spacer.tsx"],"sourcesContent":["import { Slot } from \"@askrjs/askr/foundations\";\nimport { mergeProps } from \"../_internal/merge-props\";\nimport { isCssLength, mergeLayoutStyles } from \"../_internal/layout\";\nimport { styleDeclarationsToClass } from \"../_internal/style\";\nimport { isJsxElement, toChildArray } from \"../_internal/jsx\";\nimport type { SpacerAsChildProps, SpacerNativeProps } from \"./spacer.types\";\n\nexport function Spacer(props: SpacerNativeProps): JSX.Element;\nexport function Spacer(props: SpacerAsChildProps): JSX.Element;\nexport function Spacer(props: SpacerNativeProps | SpacerAsChildProps) {\n const { asChild, children, grow, shrink, basis, axis, ref, style: userStyle, ...rest } = props;\n\n const layoutStyle: Record<string, string | number> = {};\n\n if (axis === \"inline\") {\n if (shrink !== undefined && shrink !== 0) {\n layoutStyle.flexShrink = shrink;\n }\n if (isCssLength(basis)) layoutStyle.width = basis!;\n } else if (axis === \"block\") {\n if (shrink !== undefined && shrink !== 0) {\n layoutStyle.flexShrink = shrink;\n }\n if (isCssLength(basis)) layoutStyle.height = basis!;\n } else {\n if (grow !== undefined && grow !== 1) {\n layoutStyle.flexGrow = grow;\n }\n if (shrink !== undefined && shrink !== 1) {\n layoutStyle.flexShrink = shrink;\n }\n if (isCssLength(basis)) {\n layoutStyle.flexBasis = basis!;\n }\n }\n\n const layoutClass = styleDeclarationsToClass(mergeLayoutStyles(layoutStyle, userStyle));\n\n const finalProps = mergeProps(rest, {\n ref,\n \"data-slot\": \"spacer\",\n \"data-axis\": axis,\n ...(layoutClass ? { class: layoutClass } : {}),\n });\n const keyedChildren = toChildArray(children).map((child, index) => {\n if (!isJsxElement(child) || child.key != null) {\n return child;\n }\n\n return {\n ...child,\n key: `spacer-${index}`,\n };\n });\n\n if (asChild) {\n return <Slot asChild {...finalProps} children={children} />;\n }\n\n return <div {...finalProps}>{keyedChildren}</div>;\n}\n"],"mappings":";;;;;;;AASA,SAAgB,OAAO,OAA+C;CACpE,MAAM,EAAE,SAAS,UAAU,MAAM,QAAQ,OAAO,MAAM,KAAK,OAAO,WAAW,GAAG,SAAS;CAEzF,MAAM,cAA+C,CAAC;CAEtD,IAAI,SAAS,UAAU;EACrB,IAAI,WAAW,KAAA,KAAa,WAAW,GACrC,YAAY,aAAa;EAE3B,IAAI,YAAY,KAAK,GAAG,YAAY,QAAQ;CAC9C,OAAO,IAAI,SAAS,SAAS;EAC3B,IAAI,WAAW,KAAA,KAAa,WAAW,GACrC,YAAY,aAAa;EAE3B,IAAI,YAAY,KAAK,GAAG,YAAY,SAAS;CAC/C,OAAO;EACL,IAAI,SAAS,KAAA,KAAa,SAAS,GACjC,YAAY,WAAW;EAEzB,IAAI,WAAW,KAAA,KAAa,WAAW,GACrC,YAAY,aAAa;EAE3B,IAAI,YAAY,KAAK,GACnB,YAAY,YAAY;CAE5B;CAEA,MAAM,cAAc,yBAAyB,kBAAkB,aAAa,SAAS,CAAC;CAEtF,MAAM,aAAa,WAAW,MAAM;EAClC;EACA,aAAa;EACb,aAAa;EACb,GAAI,cAAc,EAAE,OAAO,YAAY,IAAI,CAAC;CAC9C,CAAC;CACD,MAAM,gBAAgB,aAAa,QAAQ,CAAC,CAAC,KAAK,OAAO,UAAU;EACjE,IAAI,CAAC,aAAa,KAAK,KAAK,MAAM,OAAO,MACvC,OAAO;EAGT,OAAO;GACL,GAAG;GACH,KAAK,UAAU;EACjB;CACF,CAAC;CAED,IAAI,SACF,OAAO,oBAAC,MAAD;EAAM,SAAA;EAAQ,GAAI;EAAsB;CAAW,CAAA;CAG5D,OAAO,oBAAC,OAAD;EAAK,GAAI;YAAa;CAAmB,CAAA;AAClD"}
|