@askrjs/themes 0.0.8 → 0.0.10
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/_internal/jsx.js.map +1 -1
- package/dist/components/_internal/style.js +25 -1
- package/dist/components/_internal/style.js.map +1 -1
- 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 +102 -198
- 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 -211
- 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 +97 -18
- 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 +3691 -3959
- package/package.json +239 -73
- package/src/components/_internal/block-layout.ts +354 -0
- package/src/components/_internal/jsx.ts +18 -6
- package/src/components/_internal/style.ts +42 -4
- 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 +104 -251
- 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 +145 -317
- 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 +163 -21
- 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/avatar.css +7 -1
- package/src/themes/default/styles/display/badge.css +10 -10
- 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 +39 -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 +33 -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 -453
- 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/avatar.css +7 -1
- package/templates/theme/styles/display/badge.css +10 -10
- 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 +39 -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 +33 -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 -453
- 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 -147
- 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 -118
- 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 -211
- 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 -246
- 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,76 +0,0 @@
|
|
|
1
|
-
import type { JSXElement } from "@askrjs/askr/foundations";
|
|
2
|
-
import type { Ref } from "@askrjs/askr/foundations/utilities";
|
|
3
|
-
import type { ResponsiveValue } from "../_internal/layout";
|
|
4
|
-
|
|
5
|
-
export type LayoutResponsive<T> = ResponsiveValue<T>;
|
|
6
|
-
|
|
7
|
-
export type BoxLayoutOwnProps = {
|
|
8
|
-
display?: ResponsiveValue<string>;
|
|
9
|
-
m?: ResponsiveValue<string | number>;
|
|
10
|
-
mx?: ResponsiveValue<string | number>;
|
|
11
|
-
my?: ResponsiveValue<string | number>;
|
|
12
|
-
mt?: ResponsiveValue<string | number>;
|
|
13
|
-
mr?: ResponsiveValue<string | number>;
|
|
14
|
-
mb?: ResponsiveValue<string | number>;
|
|
15
|
-
ml?: ResponsiveValue<string | number>;
|
|
16
|
-
p?: ResponsiveValue<string | number>;
|
|
17
|
-
px?: ResponsiveValue<string | number>;
|
|
18
|
-
py?: ResponsiveValue<string | number>;
|
|
19
|
-
pt?: ResponsiveValue<string | number>;
|
|
20
|
-
pr?: ResponsiveValue<string | number>;
|
|
21
|
-
pb?: ResponsiveValue<string | number>;
|
|
22
|
-
pl?: ResponsiveValue<string | number>;
|
|
23
|
-
width?: ResponsiveValue<string>;
|
|
24
|
-
minWidth?: ResponsiveValue<string>;
|
|
25
|
-
maxWidth?: ResponsiveValue<string>;
|
|
26
|
-
height?: ResponsiveValue<string>;
|
|
27
|
-
minHeight?: ResponsiveValue<string>;
|
|
28
|
-
maxHeight?: ResponsiveValue<string>;
|
|
29
|
-
position?: ResponsiveValue<string>;
|
|
30
|
-
inset?: ResponsiveValue<string | number>;
|
|
31
|
-
top?: ResponsiveValue<string | number>;
|
|
32
|
-
right?: ResponsiveValue<string | number>;
|
|
33
|
-
bottom?: ResponsiveValue<string | number>;
|
|
34
|
-
left?: ResponsiveValue<string | number>;
|
|
35
|
-
overflow?: ResponsiveValue<string>;
|
|
36
|
-
overflowX?: ResponsiveValue<string>;
|
|
37
|
-
overflowY?: ResponsiveValue<string>;
|
|
38
|
-
flexBasis?: ResponsiveValue<string>;
|
|
39
|
-
flexGrow?: ResponsiveValue<string | number>;
|
|
40
|
-
flexShrink?: ResponsiveValue<string | number>;
|
|
41
|
-
gridArea?: ResponsiveValue<string>;
|
|
42
|
-
gridColumn?: ResponsiveValue<string>;
|
|
43
|
-
gridColumnStart?: ResponsiveValue<string>;
|
|
44
|
-
gridColumnEnd?: ResponsiveValue<string>;
|
|
45
|
-
gridRow?: ResponsiveValue<string>;
|
|
46
|
-
gridRowStart?: ResponsiveValue<string>;
|
|
47
|
-
gridRowEnd?: ResponsiveValue<string>;
|
|
48
|
-
children?: unknown;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export type BoxOwnProps = BoxLayoutOwnProps & {
|
|
52
|
-
as?: "div" | "span";
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
export type BoxDivProps = Omit<JSX.IntrinsicElements["div"], "children" | "ref"> &
|
|
56
|
-
BoxOwnProps & {
|
|
57
|
-
as?: "div";
|
|
58
|
-
asChild?: false;
|
|
59
|
-
ref?: Ref<HTMLDivElement>;
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export type BoxSpanProps = Omit<JSX.IntrinsicElements["span"], "children" | "ref"> &
|
|
63
|
-
BoxOwnProps & {
|
|
64
|
-
as: "span";
|
|
65
|
-
asChild?: false;
|
|
66
|
-
ref?: Ref<HTMLSpanElement>;
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
export type BoxAsChildProps = Omit<BoxOwnProps, "as"> & {
|
|
70
|
-
asChild: true;
|
|
71
|
-
children: JSXElement;
|
|
72
|
-
ref?: Ref<unknown>;
|
|
73
|
-
style?: JSX.IntrinsicElements["div"]["style"];
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
export type BoxProps = BoxDivProps | BoxSpanProps | BoxAsChildProps;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export { Box } from "./box";
|
|
2
|
-
export { BOX_A11Y_CONTRACT, type BoxA11yContract } from "./box.a11y";
|
|
3
|
-
export type {
|
|
4
|
-
BoxProps,
|
|
5
|
-
BoxOwnProps,
|
|
6
|
-
BoxLayoutOwnProps,
|
|
7
|
-
BoxDivProps,
|
|
8
|
-
BoxSpanProps,
|
|
9
|
-
BoxAsChildProps,
|
|
10
|
-
LayoutResponsive,
|
|
11
|
-
} from "./box.types";
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Breadcrumb accessibility contract.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
export const BREADCRUMB_A11Y_CONTRACT = {
|
|
6
|
-
DATA_ATTRIBUTES: {
|
|
7
|
-
slot: "data-slot" as const,
|
|
8
|
-
},
|
|
9
|
-
NAV_ROLE: "navigation" as const,
|
|
10
|
-
CURRENT_PAGE_ATTRIBUTE: "aria-current" as const,
|
|
11
|
-
CURRENT_PAGE_VALUE: "page" as const,
|
|
12
|
-
SEPARATOR_MARKER: "data-breadcrumb-separator" as const,
|
|
13
|
-
} as const;
|
|
14
|
-
|
|
15
|
-
export type BreadcrumbA11yContract = typeof BREADCRUMB_A11Y_CONTRACT;
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { Slot } from "@askrjs/askr/foundations";
|
|
2
|
-
import { mergeProps } from "../_internal/merge-props";
|
|
3
|
-
import type {
|
|
4
|
-
BreadcrumbAsChildProps,
|
|
5
|
-
BreadcrumbCurrentAsChildProps,
|
|
6
|
-
BreadcrumbCurrentProps,
|
|
7
|
-
BreadcrumbItemAsChildProps,
|
|
8
|
-
BreadcrumbItemProps,
|
|
9
|
-
BreadcrumbLinkAsChildProps,
|
|
10
|
-
BreadcrumbLinkProps,
|
|
11
|
-
BreadcrumbListAsChildProps,
|
|
12
|
-
BreadcrumbListProps,
|
|
13
|
-
BreadcrumbProps,
|
|
14
|
-
BreadcrumbSeparatorAsChildProps,
|
|
15
|
-
BreadcrumbSeparatorProps,
|
|
16
|
-
} from "./breadcrumb.types";
|
|
17
|
-
|
|
18
|
-
export function Breadcrumb(props: BreadcrumbProps): JSX.Element;
|
|
19
|
-
export function Breadcrumb(props: BreadcrumbAsChildProps): JSX.Element;
|
|
20
|
-
export function Breadcrumb(props: BreadcrumbProps | BreadcrumbAsChildProps) {
|
|
21
|
-
const { asChild, children, ref, "aria-label": ariaLabel, ...rest } = props;
|
|
22
|
-
const finalProps = mergeProps(rest, {
|
|
23
|
-
ref,
|
|
24
|
-
"aria-label": ariaLabel ?? "Breadcrumb",
|
|
25
|
-
"data-slot": "breadcrumb",
|
|
26
|
-
"data-breadcrumb": "true",
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
if (asChild) {
|
|
30
|
-
return <Slot asChild {...finalProps} children={children} />;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return <nav {...finalProps}>{children}</nav>;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export function BreadcrumbList(props: BreadcrumbListProps): JSX.Element;
|
|
37
|
-
export function BreadcrumbList(props: BreadcrumbListAsChildProps): JSX.Element;
|
|
38
|
-
export function BreadcrumbList(props: BreadcrumbListProps | BreadcrumbListAsChildProps) {
|
|
39
|
-
const { asChild, children, ref, ...rest } = props;
|
|
40
|
-
const finalProps = mergeProps(rest, {
|
|
41
|
-
ref,
|
|
42
|
-
"data-slot": "breadcrumb-list",
|
|
43
|
-
"data-breadcrumb-list": "true",
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
if (asChild) {
|
|
47
|
-
return <Slot asChild {...finalProps} children={children} />;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return <ol {...finalProps}>{children}</ol>;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export function BreadcrumbItem(props: BreadcrumbItemProps): JSX.Element;
|
|
54
|
-
export function BreadcrumbItem(props: BreadcrumbItemAsChildProps): JSX.Element;
|
|
55
|
-
export function BreadcrumbItem(props: BreadcrumbItemProps | BreadcrumbItemAsChildProps) {
|
|
56
|
-
const { asChild, children, ref, ...rest } = props;
|
|
57
|
-
const finalProps = mergeProps(rest, {
|
|
58
|
-
ref,
|
|
59
|
-
"data-slot": "breadcrumb-item",
|
|
60
|
-
"data-breadcrumb-item": "true",
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
if (asChild) {
|
|
64
|
-
return <Slot asChild {...finalProps} children={children} />;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return <li {...finalProps}>{children}</li>;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export function BreadcrumbLink(props: BreadcrumbLinkProps): JSX.Element;
|
|
71
|
-
export function BreadcrumbLink(props: BreadcrumbLinkAsChildProps): JSX.Element;
|
|
72
|
-
export function BreadcrumbLink(props: BreadcrumbLinkProps | BreadcrumbLinkAsChildProps) {
|
|
73
|
-
const { asChild, children, ref, ...rest } = props;
|
|
74
|
-
const finalProps = mergeProps(rest, {
|
|
75
|
-
ref,
|
|
76
|
-
"data-slot": "breadcrumb-link",
|
|
77
|
-
"data-breadcrumb-link": "true",
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
if (asChild) {
|
|
81
|
-
return <Slot asChild {...finalProps} children={children} />;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
return <a {...finalProps}>{children}</a>;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export function BreadcrumbCurrent(props: BreadcrumbCurrentProps): JSX.Element;
|
|
88
|
-
export function BreadcrumbCurrent(props: BreadcrumbCurrentAsChildProps): JSX.Element;
|
|
89
|
-
export function BreadcrumbCurrent(props: BreadcrumbCurrentProps | BreadcrumbCurrentAsChildProps) {
|
|
90
|
-
const { asChild, children, ref, ...rest } = props;
|
|
91
|
-
const finalProps = mergeProps(rest, {
|
|
92
|
-
ref,
|
|
93
|
-
"aria-current": "page",
|
|
94
|
-
"data-slot": "breadcrumb-current",
|
|
95
|
-
"data-breadcrumb-current": "true",
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
if (asChild) {
|
|
99
|
-
return <Slot asChild {...finalProps} children={children} />;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
return <span {...finalProps}>{children}</span>;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export function BreadcrumbSeparator(props: BreadcrumbSeparatorProps): JSX.Element;
|
|
106
|
-
export function BreadcrumbSeparator(props: BreadcrumbSeparatorAsChildProps): JSX.Element;
|
|
107
|
-
export function BreadcrumbSeparator(
|
|
108
|
-
props: BreadcrumbSeparatorProps | BreadcrumbSeparatorAsChildProps,
|
|
109
|
-
) {
|
|
110
|
-
const { asChild, children, ref, ...rest } = props;
|
|
111
|
-
const finalProps = mergeProps(rest, {
|
|
112
|
-
ref,
|
|
113
|
-
"aria-hidden": "true",
|
|
114
|
-
"data-slot": "breadcrumb-separator",
|
|
115
|
-
"data-breadcrumb-separator": "true",
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
if (asChild) {
|
|
119
|
-
return <Slot asChild {...finalProps} children={children ?? "/"} />;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
return <span {...finalProps}>{children ?? "/"}</span>;
|
|
123
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import type { JSXElement } from "@askrjs/askr/foundations";
|
|
2
|
-
import type { Ref } from "@askrjs/askr/foundations/utilities";
|
|
3
|
-
|
|
4
|
-
export type BreadcrumbOwnProps = {
|
|
5
|
-
children?: unknown;
|
|
6
|
-
"aria-label"?: string;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export type BreadcrumbProps = Omit<JSX.IntrinsicElements["nav"], "children" | "ref"> &
|
|
10
|
-
BreadcrumbOwnProps & {
|
|
11
|
-
asChild?: false;
|
|
12
|
-
ref?: Ref<HTMLElement>;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export type BreadcrumbAsChildProps = BreadcrumbOwnProps & {
|
|
16
|
-
asChild: true;
|
|
17
|
-
children: JSXElement;
|
|
18
|
-
ref?: Ref<unknown>;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export type BreadcrumbListProps = Omit<JSX.IntrinsicElements["ol"], "children" | "ref"> & {
|
|
22
|
-
asChild?: false;
|
|
23
|
-
ref?: Ref<HTMLOListElement>;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export type BreadcrumbListAsChildProps = {
|
|
27
|
-
asChild: true;
|
|
28
|
-
children: JSXElement;
|
|
29
|
-
ref?: Ref<unknown>;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export type BreadcrumbItemProps = Omit<JSX.IntrinsicElements["li"], "children" | "ref"> & {
|
|
33
|
-
asChild?: false;
|
|
34
|
-
ref?: Ref<HTMLLIElement>;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export type BreadcrumbItemAsChildProps = {
|
|
38
|
-
asChild: true;
|
|
39
|
-
children: JSXElement;
|
|
40
|
-
ref?: Ref<unknown>;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export type BreadcrumbLinkProps = Omit<JSX.IntrinsicElements["a"], "children" | "ref"> & {
|
|
44
|
-
asChild?: false;
|
|
45
|
-
ref?: Ref<HTMLAnchorElement>;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export type BreadcrumbLinkAsChildProps = {
|
|
49
|
-
asChild: true;
|
|
50
|
-
children: JSXElement;
|
|
51
|
-
ref?: Ref<unknown>;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export type BreadcrumbCurrentProps = Omit<JSX.IntrinsicElements["span"], "children" | "ref"> & {
|
|
55
|
-
asChild?: false;
|
|
56
|
-
ref?: Ref<HTMLSpanElement>;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
export type BreadcrumbCurrentAsChildProps = {
|
|
60
|
-
asChild: true;
|
|
61
|
-
children: JSXElement;
|
|
62
|
-
ref?: Ref<unknown>;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
export type BreadcrumbSeparatorProps = Omit<JSX.IntrinsicElements["span"], "children" | "ref"> & {
|
|
66
|
-
asChild?: false;
|
|
67
|
-
ref?: Ref<HTMLSpanElement>;
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
export type BreadcrumbSeparatorAsChildProps = {
|
|
71
|
-
asChild: true;
|
|
72
|
-
children: JSXElement;
|
|
73
|
-
ref?: Ref<unknown>;
|
|
74
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export {
|
|
2
|
-
Breadcrumb,
|
|
3
|
-
BreadcrumbList,
|
|
4
|
-
BreadcrumbItem,
|
|
5
|
-
BreadcrumbLink,
|
|
6
|
-
BreadcrumbCurrent,
|
|
7
|
-
BreadcrumbSeparator,
|
|
8
|
-
} from "./breadcrumb";
|
|
9
|
-
export { BREADCRUMB_A11Y_CONTRACT, type BreadcrumbA11yContract } from "./breadcrumb.a11y";
|
|
10
|
-
export type {
|
|
11
|
-
BreadcrumbOwnProps,
|
|
12
|
-
BreadcrumbProps,
|
|
13
|
-
BreadcrumbAsChildProps,
|
|
14
|
-
BreadcrumbListProps,
|
|
15
|
-
BreadcrumbListAsChildProps,
|
|
16
|
-
BreadcrumbItemProps,
|
|
17
|
-
BreadcrumbItemAsChildProps,
|
|
18
|
-
BreadcrumbLinkProps,
|
|
19
|
-
BreadcrumbLinkAsChildProps,
|
|
20
|
-
BreadcrumbCurrentProps,
|
|
21
|
-
BreadcrumbCurrentAsChildProps,
|
|
22
|
-
BreadcrumbSeparatorProps,
|
|
23
|
-
BreadcrumbSeparatorAsChildProps,
|
|
24
|
-
} from "./breadcrumb.types";
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export const FLEX_A11Y_CONTRACT = {
|
|
2
|
-
DATA_ATTRIBUTES: {
|
|
3
|
-
slot: "data-slot" as const,
|
|
4
|
-
layout: "data-ak-layout" as const,
|
|
5
|
-
direction: "data-direction" as const,
|
|
6
|
-
gap: "data-gap" as const,
|
|
7
|
-
gapX: "data-gap-x" as const,
|
|
8
|
-
gapY: "data-gap-y" as const,
|
|
9
|
-
align: "data-align" as const,
|
|
10
|
-
justify: "data-justify" as const,
|
|
11
|
-
wrap: "data-wrap" as const,
|
|
12
|
-
collapseBelow: "data-collapse-below" as const,
|
|
13
|
-
},
|
|
14
|
-
SLOT_VALUES: {
|
|
15
|
-
root: "flex" as const,
|
|
16
|
-
},
|
|
17
|
-
} as const;
|
|
18
|
-
|
|
19
|
-
export type FlexA11yContract = typeof FLEX_A11Y_CONTRACT;
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import { Slot } from "@askrjs/askr/foundations";
|
|
2
|
-
import { mergeProps } from "../_internal/merge-props";
|
|
3
|
-
import {
|
|
4
|
-
applyBoxLayoutStyles,
|
|
5
|
-
splitBoxLayoutProps,
|
|
6
|
-
withBoxLayoutClass,
|
|
7
|
-
} from "../_internal/box-layout";
|
|
8
|
-
import {
|
|
9
|
-
isResponsiveValue,
|
|
10
|
-
resolveAlignValue,
|
|
11
|
-
resolveJustifyValue,
|
|
12
|
-
resolveSpaceValue,
|
|
13
|
-
serializeResponsiveValueIf,
|
|
14
|
-
setResponsiveStyleVar,
|
|
15
|
-
} from "../_internal/layout";
|
|
16
|
-
import type { FlexAsChildProps, FlexDivProps, FlexSpanProps } from "./flex.types";
|
|
17
|
-
|
|
18
|
-
const SPACE_TOKENS = new Set([
|
|
19
|
-
"1",
|
|
20
|
-
"2",
|
|
21
|
-
"3",
|
|
22
|
-
"4",
|
|
23
|
-
"5",
|
|
24
|
-
"6",
|
|
25
|
-
"7",
|
|
26
|
-
"8",
|
|
27
|
-
"9",
|
|
28
|
-
"xs",
|
|
29
|
-
"sm",
|
|
30
|
-
"md",
|
|
31
|
-
"lg",
|
|
32
|
-
"xl",
|
|
33
|
-
"2xl",
|
|
34
|
-
"3xl",
|
|
35
|
-
]);
|
|
36
|
-
|
|
37
|
-
function isResponsiveObject(value: unknown): boolean {
|
|
38
|
-
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function isCssCoveredSpaceValue(value: unknown): value is string {
|
|
42
|
-
return typeof value === "string" && SPACE_TOKENS.has(value.trim());
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function isCssCoveredDirectionValue(value: unknown): value is string {
|
|
46
|
-
return (
|
|
47
|
-
typeof value === "string" &&
|
|
48
|
-
["row", "column", "row-reverse", "column-reverse"].includes(value.trim())
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function isCssCoveredAlignValue(value: unknown): value is string {
|
|
53
|
-
return (
|
|
54
|
-
typeof value === "string" &&
|
|
55
|
-
["start", "end", "center", "stretch", "baseline"].includes(value.trim())
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function isCssCoveredJustifyValue(value: unknown): value is string {
|
|
60
|
-
return typeof value === "string" && ["start", "end", "center", "between"].includes(value.trim());
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
function isCssCoveredWrapValue(value: unknown): value is string {
|
|
64
|
-
return typeof value === "string" && ["wrap", "nowrap", "wrap-reverse"].includes(value.trim());
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
function serializeStaticThemeValue<T>(
|
|
68
|
-
value: T | Partial<Record<"initial" | "sm" | "md" | "lg" | "xl", T>> | undefined,
|
|
69
|
-
predicate: (value: T) => boolean,
|
|
70
|
-
): string | undefined {
|
|
71
|
-
if (isResponsiveValue(value)) return undefined;
|
|
72
|
-
return serializeResponsiveValueIf(value, predicate);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const SLOTS = {
|
|
76
|
-
root: "flex",
|
|
77
|
-
} as const;
|
|
78
|
-
|
|
79
|
-
export function Flex(props: FlexDivProps): JSX.Element;
|
|
80
|
-
export function Flex(props: FlexSpanProps): JSX.Element;
|
|
81
|
-
export function Flex(props: FlexAsChildProps): JSX.Element;
|
|
82
|
-
export function Flex(props: FlexDivProps | FlexSpanProps | FlexAsChildProps) {
|
|
83
|
-
const as = "as" in props ? props.as : "div";
|
|
84
|
-
const {
|
|
85
|
-
asChild,
|
|
86
|
-
children,
|
|
87
|
-
direction = "row",
|
|
88
|
-
gap,
|
|
89
|
-
gapX,
|
|
90
|
-
gapY,
|
|
91
|
-
align,
|
|
92
|
-
justify,
|
|
93
|
-
wrap,
|
|
94
|
-
collapseBelow,
|
|
95
|
-
ref,
|
|
96
|
-
style: userStyle,
|
|
97
|
-
...rest
|
|
98
|
-
} = props;
|
|
99
|
-
|
|
100
|
-
const { boxProps, rest: passthroughProps } = splitBoxLayoutProps(rest);
|
|
101
|
-
const rootSlot =
|
|
102
|
-
typeof (passthroughProps as Record<string, unknown>)["data-slot"] === "string"
|
|
103
|
-
? String((passthroughProps as Record<string, unknown>)["data-slot"])
|
|
104
|
-
: SLOTS.root;
|
|
105
|
-
const layoutStyle: Record<string, string | number> = {};
|
|
106
|
-
applyBoxLayoutStyles(layoutStyle, boxProps);
|
|
107
|
-
|
|
108
|
-
if (boxProps.display !== undefined) {
|
|
109
|
-
setResponsiveStyleVar(layoutStyle, "display", boxProps.display, (value) => value);
|
|
110
|
-
}
|
|
111
|
-
if (
|
|
112
|
-
direction !== "row" &&
|
|
113
|
-
(!isCssCoveredDirectionValue(direction) || isResponsiveObject(direction))
|
|
114
|
-
) {
|
|
115
|
-
setResponsiveStyleVar(layoutStyle, "flex-direction", direction, (value) => value);
|
|
116
|
-
}
|
|
117
|
-
if (!isCssCoveredSpaceValue(gap) || isResponsiveObject(gap)) {
|
|
118
|
-
setResponsiveStyleVar(layoutStyle, "gap", gap, resolveSpaceValue);
|
|
119
|
-
}
|
|
120
|
-
if (!isCssCoveredSpaceValue(gapX) || isResponsiveObject(gapX)) {
|
|
121
|
-
setResponsiveStyleVar(layoutStyle, "column-gap", gapX, resolveSpaceValue);
|
|
122
|
-
}
|
|
123
|
-
if (!isCssCoveredSpaceValue(gapY) || isResponsiveObject(gapY)) {
|
|
124
|
-
setResponsiveStyleVar(layoutStyle, "row-gap", gapY, resolveSpaceValue);
|
|
125
|
-
}
|
|
126
|
-
if (!isCssCoveredAlignValue(align) || isResponsiveObject(align)) {
|
|
127
|
-
setResponsiveStyleVar(layoutStyle, "align-items", align, resolveAlignValue);
|
|
128
|
-
}
|
|
129
|
-
if (!isCssCoveredJustifyValue(justify) || isResponsiveObject(justify)) {
|
|
130
|
-
setResponsiveStyleVar(layoutStyle, "justify-content", justify, resolveJustifyValue);
|
|
131
|
-
}
|
|
132
|
-
if (!isCssCoveredWrapValue(wrap) || isResponsiveObject(wrap)) {
|
|
133
|
-
setResponsiveStyleVar(layoutStyle, "flex-wrap", wrap, (value) => value);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
const layoutClass = withBoxLayoutClass(layoutStyle, userStyle);
|
|
137
|
-
|
|
138
|
-
const finalProps = mergeProps(passthroughProps, {
|
|
139
|
-
ref,
|
|
140
|
-
"data-slot": rootSlot,
|
|
141
|
-
"data-ak-layout": "true",
|
|
142
|
-
"data-direction": serializeStaticThemeValue(direction, isCssCoveredDirectionValue),
|
|
143
|
-
"data-gap": serializeStaticThemeValue(gap, isCssCoveredSpaceValue),
|
|
144
|
-
"data-gap-x": serializeStaticThemeValue(gapX, isCssCoveredSpaceValue),
|
|
145
|
-
"data-gap-y": serializeStaticThemeValue(gapY, isCssCoveredSpaceValue),
|
|
146
|
-
"data-align": serializeStaticThemeValue(align, isCssCoveredAlignValue),
|
|
147
|
-
"data-justify": serializeStaticThemeValue(justify, isCssCoveredJustifyValue),
|
|
148
|
-
"data-wrap": serializeStaticThemeValue(wrap, isCssCoveredWrapValue),
|
|
149
|
-
"data-collapse-below": collapseBelow,
|
|
150
|
-
...(layoutClass ? { class: layoutClass } : {}),
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
if (asChild) {
|
|
154
|
-
return <Slot asChild {...finalProps} children={children as JSX.Element} />;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
if (as === "span") {
|
|
158
|
-
return <span {...finalProps}>{children}</span>;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
return <div {...finalProps}>{children}</div>;
|
|
162
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import type { JSXElement } from "@askrjs/askr/foundations";
|
|
2
|
-
import type { Ref } from "@askrjs/askr/foundations/utilities";
|
|
3
|
-
import type { BoxLayoutOwnProps, LayoutResponsive } from "../box/box.types";
|
|
4
|
-
|
|
5
|
-
export type FlexOwnProps = BoxLayoutOwnProps & {
|
|
6
|
-
direction?: LayoutResponsive<"row" | "column" | "row-reverse" | "column-reverse">;
|
|
7
|
-
gap?: LayoutResponsive<string | number>;
|
|
8
|
-
gapX?: LayoutResponsive<string | number>;
|
|
9
|
-
gapY?: LayoutResponsive<string | number>;
|
|
10
|
-
align?: LayoutResponsive<string>;
|
|
11
|
-
justify?: LayoutResponsive<string>;
|
|
12
|
-
wrap?: LayoutResponsive<"wrap" | "nowrap" | "wrap-reverse">;
|
|
13
|
-
/**
|
|
14
|
-
* Compatibility breakpoint helper. Prefer responsive `direction` instead.
|
|
15
|
-
*/
|
|
16
|
-
collapseBelow?: string;
|
|
17
|
-
as?: "div" | "span";
|
|
18
|
-
children?: unknown;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export type FlexNativeProps = Omit<JSX.IntrinsicElements["div"], "children" | "ref"> &
|
|
22
|
-
FlexOwnProps & {
|
|
23
|
-
as?: "div";
|
|
24
|
-
asChild?: false;
|
|
25
|
-
ref?: Ref<HTMLDivElement>;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export type FlexSpanProps = Omit<JSX.IntrinsicElements["span"], "children" | "ref"> &
|
|
29
|
-
FlexOwnProps & {
|
|
30
|
-
as: "span";
|
|
31
|
-
asChild?: false;
|
|
32
|
-
ref?: Ref<HTMLSpanElement>;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export type FlexAsChildProps = Omit<FlexOwnProps, "as"> & {
|
|
36
|
-
asChild: true;
|
|
37
|
-
children: JSXElement;
|
|
38
|
-
ref?: Ref<unknown>;
|
|
39
|
-
style?: JSX.IntrinsicElements["div"]["style"];
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export type FlexDivProps = FlexNativeProps;
|
|
43
|
-
|
|
44
|
-
export type FlexProps = FlexDivProps | FlexSpanProps | FlexAsChildProps;
|
|
45
|
-
|
|
46
|
-
export type InlineOwnProps = FlexOwnProps;
|
|
47
|
-
export type InlineNativeProps = FlexNativeProps;
|
|
48
|
-
export type InlineDivProps = FlexDivProps;
|
|
49
|
-
export type InlineSpanProps = FlexSpanProps;
|
|
50
|
-
export type InlineAsChildProps = FlexAsChildProps;
|
|
51
|
-
export type InlineProps = FlexProps;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export { Flex } from "./flex";
|
|
2
|
-
export { FLEX_A11Y_CONTRACT, type FlexA11yContract } from "./flex.a11y";
|
|
3
|
-
export type {
|
|
4
|
-
FlexProps,
|
|
5
|
-
FlexOwnProps,
|
|
6
|
-
FlexNativeProps,
|
|
7
|
-
FlexDivProps,
|
|
8
|
-
FlexSpanProps,
|
|
9
|
-
FlexAsChildProps,
|
|
10
|
-
InlineProps,
|
|
11
|
-
InlineOwnProps,
|
|
12
|
-
InlineNativeProps,
|
|
13
|
-
InlineDivProps,
|
|
14
|
-
InlineSpanProps,
|
|
15
|
-
InlineAsChildProps,
|
|
16
|
-
} from "./flex.types";
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Flex } from "../flex";
|
|
2
|
-
import type { InlineProps } from "../flex";
|
|
3
|
-
|
|
4
|
-
export function Inline(props: InlineProps): JSX.Element {
|
|
5
|
-
return <Flex {...(props as Record<string, unknown>)} data-slot="inline" />;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export { Flex };
|
|
9
|
-
export {
|
|
10
|
-
FLEX_A11Y_CONTRACT,
|
|
11
|
-
FLEX_A11Y_CONTRACT as INLINE_A11Y_CONTRACT,
|
|
12
|
-
type FlexA11yContract,
|
|
13
|
-
type FlexA11yContract as InlineA11yContract,
|
|
14
|
-
} from "../flex/flex.a11y";
|
|
15
|
-
export type {
|
|
16
|
-
FlexProps,
|
|
17
|
-
FlexOwnProps,
|
|
18
|
-
FlexNativeProps,
|
|
19
|
-
FlexDivProps,
|
|
20
|
-
FlexSpanProps,
|
|
21
|
-
FlexAsChildProps,
|
|
22
|
-
FlexProps as InlineProps,
|
|
23
|
-
FlexOwnProps as InlineOwnProps,
|
|
24
|
-
FlexNativeProps as InlineNativeProps,
|
|
25
|
-
FlexDivProps as InlineDivProps,
|
|
26
|
-
FlexSpanProps as InlineSpanProps,
|
|
27
|
-
FlexAsChildProps as InlineAsChildProps,
|
|
28
|
-
} from "../flex/flex.types";
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { Slot } from "@askrjs/askr/foundations";
|
|
2
|
-
import { mergeProps } from "@askrjs/askr/foundations/utilities";
|
|
3
|
-
import { classes } from "../_internal/classes";
|
|
4
|
-
import type {
|
|
5
|
-
ListGroupItemAsChildProps,
|
|
6
|
-
ListGroupItemProps,
|
|
7
|
-
ListGroupProps,
|
|
8
|
-
} from "./list-group.types";
|
|
9
|
-
|
|
10
|
-
export function ListGroup(props: ListGroupProps): JSX.Element {
|
|
11
|
-
const {
|
|
12
|
-
children,
|
|
13
|
-
class: className,
|
|
14
|
-
flush = false,
|
|
15
|
-
orientation = "vertical",
|
|
16
|
-
ref,
|
|
17
|
-
...rest
|
|
18
|
-
} = props;
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<ul
|
|
22
|
-
{...rest}
|
|
23
|
-
ref={ref}
|
|
24
|
-
class={classes(
|
|
25
|
-
"list-group",
|
|
26
|
-
flush ? "list-group-flush" : undefined,
|
|
27
|
-
orientation === "horizontal" ? "list-group-horizontal" : undefined,
|
|
28
|
-
className,
|
|
29
|
-
)}
|
|
30
|
-
data-flush={flush ? "true" : "false"}
|
|
31
|
-
data-orientation={orientation}
|
|
32
|
-
data-slot="list-group"
|
|
33
|
-
>
|
|
34
|
-
{children}
|
|
35
|
-
</ul>
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export function ListGroupItem(props: ListGroupItemProps): JSX.Element;
|
|
40
|
-
export function ListGroupItem(props: ListGroupItemAsChildProps): JSX.Element;
|
|
41
|
-
export function ListGroupItem(props: ListGroupItemProps | ListGroupItemAsChildProps): JSX.Element {
|
|
42
|
-
const {
|
|
43
|
-
action = false,
|
|
44
|
-
active = false,
|
|
45
|
-
asChild,
|
|
46
|
-
children,
|
|
47
|
-
disabled = false,
|
|
48
|
-
ref,
|
|
49
|
-
class: className,
|
|
50
|
-
...rest
|
|
51
|
-
} = props;
|
|
52
|
-
const finalProps = mergeProps(rest, {
|
|
53
|
-
class: classes(
|
|
54
|
-
"list-group-item",
|
|
55
|
-
action ? "list-group-item-action" : undefined,
|
|
56
|
-
active ? "active" : undefined,
|
|
57
|
-
disabled ? "disabled" : undefined,
|
|
58
|
-
className,
|
|
59
|
-
),
|
|
60
|
-
ref,
|
|
61
|
-
"aria-current": active ? "page" : undefined,
|
|
62
|
-
"aria-disabled": disabled ? "true" : undefined,
|
|
63
|
-
"data-action": action ? "true" : undefined,
|
|
64
|
-
"data-active": active ? "true" : undefined,
|
|
65
|
-
"data-disabled": disabled ? "true" : undefined,
|
|
66
|
-
"data-slot": "list-group-item",
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
if (asChild) {
|
|
70
|
-
return <Slot asChild {...finalProps} children={children} />;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
return <li {...finalProps}>{children}</li>;
|
|
74
|
-
}
|