@askrjs/themes 0.0.3 → 0.0.6
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 +78 -0
- package/THEMING.md +50 -8
- package/dist/{_internal → components/_internal}/box-layout.js +4 -3
- package/dist/components/_internal/box-layout.js.map +1 -0
- package/dist/components/_internal/classes.js.map +1 -0
- package/dist/components/_internal/jsx.js.map +1 -0
- package/dist/components/_internal/layout.d.ts +6 -28
- package/dist/{_internal → components/_internal}/layout.js +7 -16
- package/dist/components/_internal/layout.js.map +1 -0
- package/dist/{_internal → components/_internal}/merge-props.js +5 -0
- package/dist/components/_internal/merge-props.js.map +1 -0
- package/dist/components/_internal/pathname.js +39 -0
- package/dist/components/_internal/pathname.js.map +1 -0
- package/dist/components/_internal/style.js +41 -0
- package/dist/components/_internal/style.js.map +1 -0
- package/dist/components/alert/alert.d.ts +7 -0
- package/dist/components/alert/alert.js +65 -0
- package/dist/components/alert/alert.js.map +1 -0
- package/dist/components/alert/alert.types.d.ts +22 -0
- package/dist/components/alert/index.d.ts +2 -0
- package/dist/components/aspect-ratio/aspect-ratio.d.ts +8 -3
- package/dist/components/aspect-ratio/aspect-ratio.js +33 -0
- package/dist/components/aspect-ratio/aspect-ratio.js.map +1 -0
- package/dist/components/aspect-ratio/aspect-ratio.types.d.ts +18 -12
- package/dist/components/aspect-ratio/index.d.ts +2 -2
- package/dist/components/badge/badge.a11y.d.ts +13 -9
- package/dist/components/badge/badge.d.ts +8 -3
- package/dist/{badge → components/badge}/badge.js +5 -0
- package/dist/components/badge/badge.js.map +1 -0
- package/dist/components/badge/badge.types.d.ts +18 -12
- package/dist/components/badge/index.d.ts +3 -3
- package/dist/components/block/block.a11y.d.ts +20 -0
- package/dist/components/block/block.d.ts +9 -0
- package/dist/components/block/block.js +66 -0
- package/dist/components/block/block.js.map +1 -0
- package/dist/components/block/block.types.d.ts +38 -0
- package/dist/components/block/index.d.ts +3 -0
- package/dist/components/box/box.a11y.d.ts +13 -9
- package/dist/components/box/box.d.ts +9 -4
- package/dist/{box → components/box}/box.js +3 -2
- package/dist/components/box/box.js.map +1 -0
- package/dist/components/box/box.types.d.ts +67 -61
- package/dist/components/box/index.d.ts +3 -3
- package/dist/components/breadcrumb/breadcrumb.a11y.d.ts +13 -9
- package/dist/components/breadcrumb/breadcrumb.a11y.js +15 -0
- package/dist/components/breadcrumb/breadcrumb.a11y.js.map +1 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts +18 -13
- package/dist/components/breadcrumb/breadcrumb.js.map +1 -0
- package/dist/components/breadcrumb/breadcrumb.types.d.ts +64 -58
- package/dist/components/breadcrumb/index.d.ts +3 -3
- package/dist/components/button-group/button-group.d.ts +7 -0
- package/dist/components/button-group/button-group.js +20 -0
- package/dist/components/button-group/button-group.js.map +1 -0
- package/dist/components/button-group/button-group.types.d.ts +14 -0
- package/dist/components/button-group/index.d.ts +2 -0
- package/dist/components/card/card.d.ts +13 -7
- package/dist/components/card/card.js +95 -0
- package/dist/components/card/card.js.map +1 -0
- package/dist/components/card/card.types.d.ts +32 -24
- package/dist/components/card/index.d.ts +2 -2
- package/dist/components/close/close.d.ts +7 -0
- package/dist/components/close/close.js +22 -0
- package/dist/components/close/close.js.map +1 -0
- package/dist/components/close/close.types.d.ts +10 -0
- package/dist/components/close/index.d.ts +2 -0
- package/dist/components/container/container.a11y.d.ts +18 -15
- package/dist/components/container/container.d.ts +8 -3
- package/dist/{container → components/container}/container.js +10 -10
- package/dist/components/container/container.js.map +1 -0
- package/dist/components/container/container.types.d.ts +25 -26
- package/dist/components/container/index.d.ts +3 -3
- package/dist/components/empty-state/empty-state.d.ts +7 -2
- package/dist/components/empty-state/empty-state.js.map +1 -0
- package/dist/components/empty-state/empty-state.types.d.ts +15 -8
- package/dist/components/empty-state/index.d.ts +2 -2
- package/dist/components/field/field.d.ts +9 -0
- package/dist/components/field/field.js +41 -0
- package/dist/components/field/field.js.map +1 -0
- package/dist/components/field/field.types.d.ts +20 -0
- package/dist/components/field/index.d.ts +2 -0
- package/dist/components/flex/flex.a11y.d.ts +21 -17
- package/dist/components/flex/flex.d.ts +9 -4
- package/dist/{flex → components/flex}/flex.js +3 -2
- package/dist/components/flex/flex.js.map +1 -0
- package/dist/components/flex/flex.types.d.ts +38 -37
- package/dist/components/flex/index.d.ts +3 -3
- package/dist/components/header/header.a11y.d.ts +13 -9
- package/dist/components/header/header.a11y.js +12 -0
- package/dist/components/header/header.a11y.js.map +1 -0
- package/dist/components/header/header.d.ts +7 -2
- package/dist/components/header/header.js.map +1 -0
- package/dist/components/header/header.types.d.ts +8 -4
- package/dist/components/inline/index.d.ts +8 -6
- package/dist/components/inline/index.js.map +1 -0
- package/dist/components/input-group/index.d.ts +2 -0
- package/dist/components/input-group/input-group.d.ts +9 -0
- package/dist/components/input-group/input-group.js +39 -0
- package/dist/components/input-group/input-group.js.map +1 -0
- package/dist/components/input-group/input-group.types.d.ts +26 -0
- package/dist/components/list-group/index.d.ts +2 -0
- package/dist/components/list-group/list-group.d.ts +9 -0
- package/dist/components/list-group/list-group.js +43 -0
- package/dist/components/list-group/list-group.js.map +1 -0
- package/dist/components/list-group/list-group.types.d.ts +32 -0
- package/dist/components/nav/index.d.ts +2 -0
- package/dist/components/nav/nav.d.ts +13 -0
- package/dist/components/nav/nav.js +113 -0
- package/dist/components/nav/nav.js.map +1 -0
- package/dist/components/nav/nav.types.d.ts +56 -0
- package/dist/components/navbar/index.d.ts +5 -2
- package/dist/components/navbar/navbar-panel.js +48 -0
- package/dist/components/navbar/navbar-panel.js.map +1 -0
- package/dist/components/navbar/navbar.context.js +13 -0
- package/dist/components/navbar/navbar.context.js.map +1 -0
- package/dist/components/navbar/navbar.d.ts +45 -7
- package/dist/components/navbar/navbar.js +221 -0
- package/dist/components/navbar/navbar.js.map +1 -0
- package/dist/components/navbar/navbar.render.js +26 -0
- package/dist/components/navbar/navbar.render.js.map +1 -0
- package/dist/components/navbar/navbar.shared.js +18 -0
- package/dist/components/navbar/navbar.shared.js.map +1 -0
- package/dist/components/navbar/navbar.types.d.ts +29 -22
- package/dist/components/overlays/dropdown-content.d.ts +8 -0
- package/dist/components/overlays/dropdown-content.js +18 -0
- package/dist/components/overlays/dropdown-content.js.map +1 -0
- package/dist/components/pagination/index.d.ts +2 -0
- package/dist/components/pagination/pagination.d.ts +11 -0
- package/dist/components/pagination/pagination.js +95 -0
- package/dist/components/pagination/pagination.js.map +1 -0
- package/dist/components/pagination/pagination.types.d.ts +40 -0
- package/dist/components/section/index.d.ts +3 -3
- package/dist/components/section/section.a11y.d.ts +14 -10
- package/dist/components/section/section.d.ts +8 -3
- package/dist/{section → components/section}/section.js +3 -2
- package/dist/components/section/section.js.map +1 -0
- package/dist/components/section/section.types.d.ts +20 -14
- package/dist/components/separator/index.d.ts +3 -3
- package/dist/components/separator/separator.a11y.d.ts +13 -9
- package/dist/components/separator/separator.a11y.js +15 -0
- package/dist/components/separator/separator.a11y.js.map +1 -0
- package/dist/components/separator/separator.d.ts +8 -3
- package/dist/components/separator/separator.js.map +1 -0
- package/dist/components/separator/separator.types.d.ts +19 -13
- package/dist/components/shell/index.d.ts +3 -0
- package/dist/components/shell/shell-nav.types.d.ts +7 -0
- package/dist/components/shell/shell-panel.js +54 -0
- package/dist/components/shell/shell-panel.js.map +1 -0
- package/dist/components/shell/shell-responsive.js +110 -0
- package/dist/components/shell/shell-responsive.js.map +1 -0
- package/dist/components/shell/shell.a11y.d.ts +23 -0
- package/dist/components/shell/shell.a11y.js +23 -0
- package/dist/components/shell/shell.a11y.js.map +1 -0
- package/dist/components/shell/shell.d.ts +13 -0
- package/dist/components/shell/shell.js +69 -0
- package/dist/components/shell/shell.js.map +1 -0
- package/dist/components/shell/shell.types.d.ts +58 -0
- package/dist/components/sidebar/sidebar-panel.d.ts +7 -0
- package/dist/components/sidebar/sidebar-panel.js +59 -0
- package/dist/components/sidebar/sidebar-panel.js.map +1 -0
- package/dist/components/sidebar/sidebar-toggle.d.ts +7 -0
- package/dist/components/sidebar/sidebar-toggle.js +8 -0
- package/dist/components/sidebar/sidebar-toggle.js.map +1 -0
- package/dist/components/sidebar/sidebar.context.js +21 -0
- package/dist/components/sidebar/sidebar.context.js.map +1 -0
- package/dist/components/sidebar/sidebar.d.ts +7 -0
- package/dist/components/sidebar/sidebar.js +228 -0
- package/dist/components/sidebar/sidebar.js.map +1 -0
- package/dist/components/sidebar/sidebar.shared.js +12 -0
- package/dist/components/sidebar/sidebar.shared.js.map +1 -0
- package/dist/components/sidebar/sidebar.types.d.ts +30 -0
- package/dist/components/skeleton/index.d.ts +3 -3
- package/dist/components/skeleton/skeleton.a11y.d.ts +12 -8
- package/dist/components/skeleton/skeleton.d.ts +8 -3
- package/dist/components/skeleton/skeleton.js.map +1 -0
- package/dist/components/skeleton/skeleton.types.d.ts +16 -10
- package/dist/components/spacer/index.d.ts +3 -3
- package/dist/components/spacer/spacer.a11y.d.ts +16 -12
- package/dist/components/spacer/spacer.d.ts +8 -3
- package/dist/{spacer → components/spacer}/spacer.js +3 -1
- package/dist/components/spacer/spacer.js.map +1 -0
- package/dist/components/spacer/spacer.types.d.ts +23 -21
- package/dist/components/spinner/index.d.ts +2 -2
- package/dist/components/spinner/spinner.d.ts +7 -2
- package/dist/components/spinner/spinner.js.map +1 -0
- package/dist/components/spinner/spinner.types.d.ts +9 -4
- package/dist/components/stack/index.d.ts +3 -3
- package/dist/components/stack/stack.a11y.d.ts +17 -13
- package/dist/components/stack/stack.d.ts +8 -3
- package/dist/components/stack/stack.js.map +1 -0
- package/dist/components/stack/stack.types.d.ts +19 -13
- package/dist/components/theme/index.d.ts +1 -2
- package/dist/components/theme/theme.d.ts +41 -34
- package/dist/{theme → components/theme}/theme.js +33 -4
- package/dist/components/theme/theme.js.map +1 -0
- package/dist/controls.d.ts +10 -0
- package/dist/controls.js +7 -0
- package/dist/feedback.d.ts +5 -0
- package/dist/feedback.js +4 -0
- package/dist/layouts.d.ts +25 -0
- package/dist/layouts.js +11 -0
- package/dist/navs.d.ts +15 -0
- package/dist/navs.js +9 -0
- package/dist/overlays.d.ts +3 -0
- package/dist/overlays.js +4 -0
- package/dist/shells.d.ts +16 -0
- package/dist/shells.js +11 -0
- package/dist/surfaces.d.ts +16 -0
- package/dist/surfaces.js +9 -0
- package/dist/theme.d.ts +2 -0
- package/dist/theme.js +3 -0
- package/dist/themes/default/index.css +3191 -812
- package/package.json +63 -24
- package/src/components/_internal/box-layout.ts +8 -0
- package/src/components/_internal/jsx.ts +91 -16
- package/src/components/_internal/layout.ts +5 -17
- package/src/components/_internal/merge-props.ts +9 -0
- package/src/components/_internal/pathname.ts +67 -0
- package/src/components/_internal/style.ts +51 -0
- package/src/components/alert/alert.tsx +84 -0
- package/src/components/alert/alert.types.ts +20 -0
- package/src/components/alert/index.ts +2 -0
- package/src/components/aspect-ratio/aspect-ratio.tsx +10 -24
- package/src/components/aspect-ratio/aspect-ratio.types.ts +2 -1
- package/src/components/badge/badge.tsx +6 -0
- package/src/components/badge/badge.types.ts +2 -1
- package/src/components/block/block.a11y.ts +17 -0
- package/src/components/block/block.tsx +71 -0
- package/src/components/block/block.types.ts +60 -0
- package/src/components/block/index.ts +11 -0
- package/src/components/box/box.tsx +3 -2
- package/src/components/box/box.types.ts +2 -1
- package/src/components/breadcrumb/breadcrumb.types.ts +2 -1
- package/src/components/button-group/button-group.tsx +32 -0
- package/src/components/button-group/button-group.types.ts +12 -0
- package/src/components/button-group/index.ts +2 -0
- package/src/components/card/card.tsx +72 -43
- package/src/components/card/card.types.ts +6 -1
- package/src/components/card/index.ts +10 -1
- package/src/components/close/close.tsx +19 -0
- package/src/components/close/close.types.ts +7 -0
- package/src/components/close/index.ts +2 -0
- package/src/components/container/container.a11y.ts +0 -1
- package/src/components/container/container.tsx +13 -23
- package/src/components/container/container.types.ts +3 -4
- package/src/components/empty-state/empty-state.types.ts +3 -0
- package/src/components/field/field.tsx +36 -0
- package/src/components/field/field.types.ts +19 -0
- package/src/components/field/index.ts +2 -0
- package/src/components/flex/flex.tsx +4 -2
- package/src/components/flex/flex.types.ts +2 -1
- package/src/components/input-group/index.ts +7 -0
- package/src/components/input-group/input-group.tsx +57 -0
- package/src/components/input-group/input-group.types.ts +26 -0
- package/src/components/list-group/index.ts +7 -0
- package/src/components/list-group/list-group.tsx +74 -0
- package/src/components/list-group/list-group.types.ts +32 -0
- package/src/components/nav/index.ts +14 -0
- package/src/components/nav/nav.tsx +203 -0
- package/src/components/nav/nav.types.ts +68 -0
- package/src/components/navbar/index.ts +9 -2
- package/src/components/navbar/navbar-panel.tsx +67 -0
- package/src/components/navbar/navbar.context.ts +22 -0
- package/src/components/navbar/navbar.render.tsx +32 -0
- package/src/components/navbar/navbar.shared.ts +21 -0
- package/src/components/navbar/navbar.tsx +252 -99
- package/src/components/navbar/navbar.types.ts +36 -22
- package/src/components/overlays/dropdown-content.tsx +28 -0
- package/src/components/pagination/index.ts +8 -0
- package/src/components/pagination/pagination.tsx +158 -0
- package/src/components/pagination/pagination.types.ts +41 -0
- package/src/components/section/section.tsx +3 -2
- package/src/components/section/section.types.ts +2 -1
- package/src/components/separator/separator.types.ts +2 -1
- package/src/components/shell/index.ts +16 -0
- package/src/components/shell/shell-nav.types.ts +3 -0
- package/src/components/shell/shell-panel.tsx +85 -0
- package/src/components/shell/shell-responsive.tsx +212 -0
- package/src/components/shell/shell.a11y.ts +20 -0
- package/src/components/shell/shell.tsx +74 -0
- package/src/components/shell/shell.types.ts +71 -0
- package/src/components/sidebar/index.ts +5 -0
- package/src/components/sidebar/sidebar-panel.tsx +76 -0
- package/src/components/sidebar/sidebar-toggle.tsx +5 -0
- package/src/components/sidebar/sidebar.context.ts +40 -0
- package/src/components/sidebar/sidebar.shared.ts +12 -0
- package/src/components/sidebar/sidebar.tsx +355 -0
- package/src/components/sidebar/sidebar.types.ts +35 -0
- package/src/components/skeleton/skeleton.types.ts +2 -1
- package/src/components/spacer/spacer.tsx +4 -1
- package/src/components/spacer/spacer.types.ts +3 -2
- package/src/components/stack/stack.types.ts +2 -1
- package/src/components/theme/index.ts +10 -1
- package/src/components/theme/theme.tsx +15 -4
- package/src/controls.ts +18 -0
- package/src/feedback.ts +6 -0
- package/src/layouts.ts +19 -0
- package/src/navs.ts +26 -0
- package/src/overlays.ts +90 -0
- package/src/shells.ts +13 -0
- package/src/surfaces.ts +23 -0
- package/src/theme.ts +21 -0
- package/src/themes/default/index.css +13 -3
- package/src/themes/default/styles/actions/button-group.css +74 -0
- package/src/themes/default/styles/actions/button.css +48 -8
- package/src/themes/default/styles/actions/toggle-group.css +19 -12
- package/src/themes/default/styles/actions/toggle.css +16 -10
- package/src/themes/default/styles/base/icon.css +2 -0
- package/src/themes/default/styles/base/reset.css +28 -0
- package/src/themes/default/styles/base/typography.css +37 -17
- package/src/themes/default/styles/base/utilities.css +56 -39
- package/src/themes/default/styles/disclosure/accordion.css +22 -14
- package/src/themes/default/styles/disclosure/collapsible.css +22 -11
- package/src/themes/default/styles/display/alert.css +109 -0
- package/src/themes/default/styles/display/avatar.css +9 -4
- package/src/themes/default/styles/display/badge.css +12 -3
- package/src/themes/default/styles/display/card.css +16 -4
- package/src/themes/default/styles/display/coverage.css +93 -15
- package/src/themes/default/styles/display/list-group.css +84 -0
- package/src/themes/default/styles/display/progress-circle.css +3 -2
- package/src/themes/default/styles/display/progress.css +8 -5
- package/src/themes/default/styles/display/scroll-area.css +15 -0
- package/src/themes/default/styles/display/separator.css +4 -4
- package/src/themes/default/styles/display/skeleton.css +25 -2
- package/src/themes/default/styles/display/spinner.css +1 -1
- package/src/themes/default/styles/display/table.css +7 -4
- package/src/themes/default/styles/display/virtual-list.css +29 -0
- package/src/themes/default/styles/display/virtual-table.css +68 -0
- package/src/themes/default/styles/forms/checkbox.css +2 -1
- package/src/themes/default/styles/forms/field.css +22 -0
- package/src/themes/default/styles/forms/form.css +1 -1
- package/src/themes/default/styles/forms/input-group.css +202 -0
- package/src/themes/default/styles/forms/input.css +22 -6
- package/src/themes/default/styles/forms/label.css +2 -0
- package/src/themes/default/styles/forms/radio-group.css +22 -13
- package/src/themes/default/styles/forms/select.css +71 -26
- package/src/themes/default/styles/forms/slider.css +32 -16
- package/src/themes/default/styles/forms/switch.css +2 -1
- package/src/themes/default/styles/forms/textarea.css +35 -6
- package/src/themes/default/styles/layout/aspect-ratio.css +3 -1
- package/src/themes/default/styles/layout/block.css +23 -0
- package/src/themes/default/styles/layout/layout.css +1 -1
- package/src/themes/default/styles/layout/patterns.css +155 -3
- package/src/themes/default/styles/layout/responsive-layout.css +142 -121
- package/src/themes/default/styles/navigation/breadcrumb.css +7 -1
- package/src/themes/default/styles/navigation/menu.css +150 -7
- package/src/themes/default/styles/navigation/menubar.css +194 -28
- package/src/themes/default/styles/navigation/nav.css +231 -0
- package/src/themes/default/styles/navigation/pagination.css +91 -0
- package/src/themes/default/styles/overlays/alert-dialog.css +1 -1
- package/src/themes/default/styles/overlays/dialog.css +42 -10
- package/src/themes/default/styles/overlays/dropdown.css +160 -0
- package/src/themes/default/styles/overlays/hover-card.css +28 -3
- package/src/themes/default/styles/overlays/popover.css +50 -6
- package/src/themes/default/styles/overlays/toast.css +66 -17
- package/src/themes/default/styles/overlays/tooltip.css +45 -18
- package/src/themes/default/styles/shell/header.css +18 -3
- package/src/themes/default/styles/shell/navbar.css +434 -73
- package/src/themes/default/styles/shell/sidebar.css +830 -0
- package/src/themes/default/styles/shell/theme.css +7 -5
- package/src/themes/default/tokens.css +186 -123
- package/src/themes/presets/calico.css +46 -0
- package/src/themes/presets/ginger.css +46 -0
- package/src/themes/presets/index.css +5 -0
- package/src/themes/presets/tabby.css +46 -0
- package/src/themes/presets/torty.css +49 -0
- package/src/themes/presets/tuxedo.css +49 -0
- package/templates/theme/index.css +14 -4
- package/templates/theme/styles/actions/button-group.css +74 -0
- package/templates/theme/styles/actions/button.css +48 -8
- package/templates/theme/styles/actions/toggle-group.css +19 -12
- package/templates/theme/styles/actions/toggle.css +16 -10
- package/templates/theme/styles/base/icon.css +2 -0
- package/templates/theme/styles/base/reset.css +28 -0
- package/templates/theme/styles/base/typography.css +37 -17
- package/templates/theme/styles/disclosure/accordion.css +22 -14
- package/templates/theme/styles/disclosure/collapsible.css +22 -11
- package/templates/theme/styles/display/alert.css +109 -0
- package/templates/theme/styles/display/avatar.css +9 -4
- package/templates/theme/styles/display/badge.css +12 -3
- package/templates/theme/styles/display/card.css +16 -4
- package/templates/theme/styles/display/coverage.css +194 -14
- package/templates/theme/styles/display/list-group.css +84 -0
- package/templates/theme/styles/display/progress-circle.css +3 -2
- package/templates/theme/styles/display/progress.css +8 -5
- package/templates/theme/styles/display/scroll-area.css +15 -0
- package/templates/theme/styles/display/separator.css +4 -4
- package/templates/theme/styles/display/skeleton.css +25 -2
- package/templates/theme/styles/display/spinner.css +1 -1
- package/templates/theme/styles/display/table.css +7 -4
- package/templates/theme/styles/display/virtual-list.css +29 -0
- package/templates/theme/styles/display/virtual-table.css +68 -0
- package/templates/theme/styles/forms/checkbox.css +2 -1
- package/templates/theme/styles/forms/field.css +22 -0
- package/templates/theme/styles/forms/form.css +1 -1
- package/templates/theme/styles/forms/input-group.css +202 -0
- package/templates/theme/styles/forms/input.css +22 -6
- package/templates/theme/styles/forms/label.css +2 -0
- package/templates/theme/styles/forms/radio-group.css +22 -13
- package/templates/theme/styles/forms/select.css +71 -26
- package/templates/theme/styles/forms/slider.css +32 -16
- package/templates/theme/styles/forms/switch.css +2 -1
- package/templates/theme/styles/forms/textarea.css +35 -6
- package/templates/theme/styles/layout/aspect-ratio.css +3 -1
- package/templates/theme/styles/layout/block.css +23 -0
- package/templates/theme/styles/layout/patterns.css +155 -3
- package/templates/theme/styles/layout/responsive-layout.css +142 -121
- package/templates/theme/styles/navigation/breadcrumb.css +22 -8
- package/templates/theme/styles/navigation/menu.css +150 -7
- package/templates/theme/styles/navigation/menubar.css +194 -28
- package/templates/theme/styles/navigation/nav.css +231 -0
- package/templates/theme/styles/navigation/pagination.css +91 -0
- package/templates/theme/styles/overlays/alert-dialog.css +1 -1
- package/templates/theme/styles/overlays/dialog.css +42 -10
- package/templates/theme/styles/overlays/dropdown.css +160 -0
- package/templates/theme/styles/overlays/hover-card.css +28 -3
- package/templates/theme/styles/overlays/popover.css +50 -6
- package/templates/theme/styles/overlays/toast.css +66 -17
- package/templates/theme/styles/overlays/tooltip.css +45 -18
- package/templates/theme/styles/shell/header.css +18 -3
- package/templates/theme/styles/shell/navbar.css +434 -73
- package/templates/theme/styles/shell/sidebar.css +809 -0
- package/templates/theme/styles/shell/theme.css +7 -5
- package/templates/theme/tokens.css +186 -123
- package/dist/_internal/box-layout.js.map +0 -1
- package/dist/_internal/classes.js.map +0 -1
- package/dist/_internal/jsx.js.map +0 -1
- package/dist/_internal/layout.d.ts +0 -9
- package/dist/_internal/layout.js.map +0 -1
- package/dist/_internal/merge-props.js.map +0 -1
- package/dist/accessible-icon/accessible-icon.d.ts +0 -7
- package/dist/accessible-icon/accessible-icon.js +0 -20
- package/dist/accessible-icon/accessible-icon.js.map +0 -1
- package/dist/accessible-icon/accessible-icon.types.d.ts +0 -9
- package/dist/aspect-ratio/aspect-ratio.d.ts +0 -8
- package/dist/aspect-ratio/aspect-ratio.js +0 -36
- package/dist/aspect-ratio/aspect-ratio.js.map +0 -1
- package/dist/aspect-ratio/aspect-ratio.types.d.ts +0 -20
- package/dist/aspect-ratio/index.d.ts +0 -2
- package/dist/badge/badge.d.ts +0 -8
- package/dist/badge/badge.js.map +0 -1
- package/dist/badge/badge.types.d.ts +0 -20
- package/dist/badge/index.d.ts +0 -2
- package/dist/box/box.d.ts +0 -9
- package/dist/box/box.js.map +0 -1
- package/dist/box/box.types.d.ts +0 -71
- package/dist/box/index.d.ts +0 -2
- package/dist/breadcrumb/breadcrumb.d.ts +0 -18
- package/dist/breadcrumb/breadcrumb.js.map +0 -1
- package/dist/breadcrumb/breadcrumb.types.d.ts +0 -64
- package/dist/breadcrumb/index.d.ts +0 -2
- package/dist/card/card.d.ts +0 -12
- package/dist/card/card.js +0 -68
- package/dist/card/card.js.map +0 -1
- package/dist/card/card.types.d.ts +0 -37
- package/dist/card/index.d.ts +0 -2
- package/dist/components/_internal/box-layout.d.ts +0 -7
- package/dist/components/_internal/classes.d.ts +0 -1
- package/dist/components/_internal/jsx.d.ts +0 -8
- package/dist/components/_internal/merge-props.d.ts +0 -1
- package/dist/components/_internal/style.d.ts +0 -1
- package/dist/components/accessible-icon/accessible-icon.d.ts +0 -2
- package/dist/components/accessible-icon/accessible-icon.types.d.ts +0 -5
- package/dist/components/accessible-icon/index.d.ts +0 -2
- package/dist/components/grid/grid.a11y.d.ts +0 -21
- package/dist/components/grid/grid.d.ts +0 -4
- package/dist/components/grid/grid.types.d.ts +0 -37
- package/dist/components/grid/index.d.ts +0 -3
- package/dist/components/header/index.d.ts +0 -3
- package/dist/components/index.d.ts +0 -49
- package/dist/components/index.js +0 -28
- package/dist/components/logos/create-logo.d.ts +0 -5
- package/dist/components/logos/github-logo.d.ts +0 -4
- package/dist/components/logos/google-logo.d.ts +0 -4
- package/dist/components/logos/index.d.ts +0 -5
- package/dist/components/logos/microsoft-logo.d.ts +0 -4
- package/dist/components/logos/types.d.ts +0 -14
- package/dist/components/sidebar-layout/index.d.ts +0 -3
- package/dist/components/sidebar-layout/sidebar-layout.a11y.d.ts +0 -15
- package/dist/components/sidebar-layout/sidebar-layout.d.ts +0 -2
- package/dist/components/sidebar-layout/sidebar-layout.types.d.ts +0 -20
- package/dist/components/topbar-layout/index.d.ts +0 -3
- package/dist/components/topbar-layout/topbar-layout.a11y.d.ts +0 -13
- package/dist/components/topbar-layout/topbar-layout.d.ts +0 -2
- package/dist/components/topbar-layout/topbar-layout.types.d.ts +0 -12
- package/dist/container/container.d.ts +0 -8
- package/dist/container/container.js.map +0 -1
- package/dist/container/container.types.d.ts +0 -28
- package/dist/container/index.d.ts +0 -2
- package/dist/empty-state/empty-state.d.ts +0 -7
- package/dist/empty-state/empty-state.js.map +0 -1
- package/dist/empty-state/empty-state.types.d.ts +0 -13
- package/dist/flex/flex.d.ts +0 -9
- package/dist/flex/flex.js.map +0 -1
- package/dist/flex/flex.types.d.ts +0 -41
- package/dist/flex/index.d.ts +0 -2
- package/dist/grid/grid.d.ts +0 -9
- package/dist/grid/grid.js +0 -115
- package/dist/grid/grid.js.map +0 -1
- package/dist/grid/grid.types.d.ts +0 -40
- package/dist/grid/index.d.ts +0 -2
- package/dist/header/header.d.ts +0 -7
- package/dist/header/header.js.map +0 -1
- package/dist/header/header.types.d.ts +0 -9
- package/dist/inline/index.d.ts +0 -7
- package/dist/inline/index.js.map +0 -1
- package/dist/logos/create-logo.d.ts +0 -1
- package/dist/logos/create-logo.js +0 -75
- package/dist/logos/create-logo.js.map +0 -1
- package/dist/logos/github-logo.d.ts +0 -18
- package/dist/logos/github-logo.js +0 -9
- package/dist/logos/github-logo.js.map +0 -1
- package/dist/logos/google-logo.d.ts +0 -18
- package/dist/logos/google-logo.js +0 -23
- package/dist/logos/google-logo.js.map +0 -1
- package/dist/logos/index.d.ts +0 -4
- package/dist/logos/microsoft-logo.d.ts +0 -18
- package/dist/logos/microsoft-logo.js +0 -35
- package/dist/logos/microsoft-logo.js.map +0 -1
- package/dist/logos/types.d.ts +0 -16
- package/dist/navbar/index.d.ts +0 -2
- package/dist/navbar/navbar.d.ts +0 -12
- package/dist/navbar/navbar.js +0 -103
- package/dist/navbar/navbar.js.map +0 -1
- package/dist/navbar/navbar.types.d.ts +0 -31
- package/dist/section/index.d.ts +0 -2
- package/dist/section/section.d.ts +0 -8
- package/dist/section/section.js.map +0 -1
- package/dist/section/section.types.d.ts +0 -22
- package/dist/separator/index.d.ts +0 -2
- package/dist/separator/separator.d.ts +0 -8
- package/dist/separator/separator.js.map +0 -1
- package/dist/separator/separator.types.d.ts +0 -21
- package/dist/sidebar-layout/index.d.ts +0 -2
- package/dist/sidebar-layout/sidebar-layout.d.ts +0 -7
- package/dist/sidebar-layout/sidebar-layout.js +0 -51
- package/dist/sidebar-layout/sidebar-layout.js.map +0 -1
- package/dist/sidebar-layout/sidebar-layout.types.d.ts +0 -20
- package/dist/skeleton/index.d.ts +0 -2
- package/dist/skeleton/skeleton.d.ts +0 -8
- package/dist/skeleton/skeleton.js.map +0 -1
- package/dist/skeleton/skeleton.types.d.ts +0 -18
- package/dist/spacer/index.d.ts +0 -2
- package/dist/spacer/spacer.d.ts +0 -8
- package/dist/spacer/spacer.js.map +0 -1
- package/dist/spacer/spacer.types.d.ts +0 -25
- package/dist/spinner/index.d.ts +0 -2
- package/dist/spinner/spinner.d.ts +0 -7
- package/dist/spinner/spinner.js.map +0 -1
- package/dist/spinner/spinner.types.d.ts +0 -10
- package/dist/stack/index.d.ts +0 -2
- package/dist/stack/stack.d.ts +0 -8
- package/dist/stack/stack.js.map +0 -1
- package/dist/stack/stack.types.d.ts +0 -21
- package/dist/theme/index.d.ts +0 -1
- package/dist/theme/theme.d.ts +0 -44
- package/dist/theme/theme.js.map +0 -1
- package/dist/topbar-layout/index.d.ts +0 -2
- package/dist/topbar-layout/topbar-layout.d.ts +0 -7
- package/dist/topbar-layout/topbar-layout.js +0 -37
- package/dist/topbar-layout/topbar-layout.js.map +0 -1
- package/dist/topbar-layout/topbar-layout.types.d.ts +0 -13
- package/src/askr-compat.d.ts +0 -110
- package/src/askr-router.d.ts +0 -16
- package/src/components/accessible-icon/accessible-icon.tsx +0 -18
- package/src/components/accessible-icon/accessible-icon.types.ts +0 -5
- package/src/components/accessible-icon/index.ts +0 -2
- package/src/components/grid/grid.a11y.ts +0 -22
- package/src/components/grid/grid.tsx +0 -172
- package/src/components/grid/grid.types.ts +0 -45
- package/src/components/grid/index.ts +0 -10
- package/src/components/index.ts +0 -108
- package/src/components/logos/create-logo.tsx +0 -103
- package/src/components/logos/github-logo.tsx +0 -13
- package/src/components/logos/google-logo.tsx +0 -34
- package/src/components/logos/index.ts +0 -5
- package/src/components/logos/microsoft-logo.tsx +0 -10
- package/src/components/logos/types.ts +0 -24
- package/src/components/sidebar-layout/index.ts +0 -6
- package/src/components/sidebar-layout/sidebar-layout.a11y.ts +0 -16
- package/src/components/sidebar-layout/sidebar-layout.tsx +0 -59
- package/src/components/sidebar-layout/sidebar-layout.types.ts +0 -22
- package/src/components/topbar-layout/index.ts +0 -3
- package/src/components/topbar-layout/topbar-layout.a11y.ts +0 -14
- package/src/components/topbar-layout/topbar-layout.tsx +0 -39
- package/src/components/topbar-layout/topbar-layout.types.ts +0 -13
- package/src/themes/default/styles/layout/dashboard-layout.css +0 -15
- package/src/themes/default/styles/layout/docs-layout.css +0 -10
- package/src/themes/default/styles/layout/sidebar.css +0 -10
- package/src/themes/default/styles/navigation/navigation-menu.css +0 -90
- package/src/themes/default/styles/navigation/tabs.css +0 -61
- package/src/themes/default/styles/overlays/dropdown-menu.css +0 -109
- package/templates/theme/styles/layout/dashboard-layout.css +0 -16
- package/templates/theme/styles/layout/docs-layout.css +0 -11
- package/templates/theme/styles/layout/sidebar.css +0 -11
- package/templates/theme/styles/navigation/navigation-menu.css +0 -90
- package/templates/theme/styles/navigation/tabs.css +0 -61
- package/templates/theme/styles/overlays/dropdown-menu.css +0 -109
- /package/dist/{_internal → components/_internal}/classes.js +0 -0
- /package/dist/{_internal → components/_internal}/jsx.js +0 -0
- /package/dist/{breadcrumb → components/breadcrumb}/breadcrumb.js +0 -0
- /package/dist/{empty-state → components/empty-state}/empty-state.js +0 -0
- /package/dist/{header → components/header}/header.js +0 -0
- /package/dist/{inline → components/inline}/index.js +0 -0
- /package/dist/{separator → components/separator}/separator.js +0 -0
- /package/dist/{skeleton → components/skeleton}/skeleton.js +0 -0
- /package/dist/{spinner → components/spinner}/spinner.js +0 -0
- /package/dist/{stack → components/stack}/stack.js +0 -0
package/dist/theme/theme.d.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { ButtonNativeProps, PressEvent } from "@askrjs/ui";
|
|
2
|
-
|
|
3
|
-
//#region src/components/theme/theme.d.ts
|
|
4
|
-
type ThemeName = "light" | "dark" | "system" | (string & {});
|
|
5
|
-
type ThemeOption = {
|
|
6
|
-
value: ThemeName;
|
|
7
|
-
label: string;
|
|
8
|
-
};
|
|
9
|
-
type ThemeContextValue = {
|
|
10
|
-
theme: () => ThemeName;
|
|
11
|
-
setTheme: (theme: ThemeName) => void;
|
|
12
|
-
themes: readonly ThemeOption[];
|
|
13
|
-
storageKey: string;
|
|
14
|
-
};
|
|
15
|
-
type ThemeProviderProps = {
|
|
16
|
-
children?: unknown;
|
|
17
|
-
defaultTheme?: ThemeName;
|
|
18
|
-
themes?: readonly ThemeOption[];
|
|
19
|
-
storageKey?: string;
|
|
20
|
-
};
|
|
21
|
-
type ThemePickerProps = Omit<JSX.IntrinsicElements["select"], "children" | "value" | "defaultValue" | "onChange"> & {
|
|
22
|
-
themes?: readonly ThemeOption[];
|
|
23
|
-
label?: string;
|
|
24
|
-
};
|
|
25
|
-
type ThemeToggleRenderContext = {
|
|
26
|
-
theme: ThemeName;
|
|
27
|
-
nextTheme: ThemeName;
|
|
28
|
-
};
|
|
29
|
-
type ThemeToggleProps = Omit<ButtonNativeProps, "children" | "onPress"> & {
|
|
30
|
-
children?: unknown | ((context: ThemeToggleRenderContext) => unknown);
|
|
31
|
-
lightIcon?: unknown;
|
|
32
|
-
darkIcon?: unknown;
|
|
33
|
-
systemIcon?: unknown;
|
|
34
|
-
toggleThemes?: readonly ThemeName[];
|
|
35
|
-
onPress?: (event: PressEvent) => void;
|
|
36
|
-
};
|
|
37
|
-
declare const DEFAULT_THEME_OPTIONS: readonly ThemeOption[];
|
|
38
|
-
declare function useTheme(): ThemeContextValue;
|
|
39
|
-
declare function ThemeProvider(props: ThemeProviderProps): JSX.Element;
|
|
40
|
-
declare function ThemePicker(props: ThemePickerProps): JSX.Element;
|
|
41
|
-
declare function ThemeToggle(props: ThemeToggleProps): JSX.Element;
|
|
42
|
-
//#endregion
|
|
43
|
-
export { DEFAULT_THEME_OPTIONS, ThemeContextValue, ThemeName, ThemeOption, ThemePicker, ThemePickerProps, ThemeProvider, ThemeProviderProps, ThemeToggle, ThemeToggleProps, ThemeToggleRenderContext, useTheme };
|
|
44
|
-
//# sourceMappingURL=theme.d.ts.map
|
package/dist/theme/theme.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"theme.js","names":[],"sources":["../../src/components/theme/theme.tsx"],"sourcesContent":["import { defineContext, readContext, state } from \"@askrjs/askr\";\nimport { resource } from \"@askrjs/askr/resources\";\nimport { Button } from \"@askrjs/ui\";\nimport type { ButtonNativeProps, PressEvent } from \"@askrjs/ui\";\n\nexport type ThemeName = \"light\" | \"dark\" | \"system\" | (string & {});\n\nexport type ThemeOption = {\n value: ThemeName;\n label: string;\n};\n\nexport type ThemeContextValue = {\n theme: () => ThemeName;\n setTheme: (theme: ThemeName) => void;\n themes: readonly ThemeOption[];\n storageKey: string;\n};\n\nexport type ThemeProviderProps = {\n children?: unknown;\n defaultTheme?: ThemeName;\n themes?: readonly ThemeOption[];\n storageKey?: string;\n};\n\nexport type ThemePickerProps = Omit<\n JSX.IntrinsicElements[\"select\"],\n \"children\" | \"value\" | \"defaultValue\" | \"onChange\"\n> & {\n themes?: readonly ThemeOption[];\n label?: string;\n};\n\nexport type ThemeToggleRenderContext = {\n theme: ThemeName;\n nextTheme: ThemeName;\n};\n\nexport type ThemeToggleProps = Omit<ButtonNativeProps, \"children\" | \"onPress\"> & {\n children?: unknown | ((context: ThemeToggleRenderContext) => unknown);\n lightIcon?: unknown;\n darkIcon?: unknown;\n systemIcon?: unknown;\n toggleThemes?: readonly ThemeName[];\n onPress?: (event: PressEvent) => void;\n};\n\nexport const DEFAULT_THEME_OPTIONS: readonly ThemeOption[] = [\n { value: \"system\", label: \"System\" },\n { value: \"light\", label: \"Light\" },\n { value: \"dark\", label: \"Dark\" },\n];\n\nconst DEFAULT_STORAGE_KEY = \"askr-theme\";\n\nconst ThemeContext = defineContext<ThemeContextValue>({\n theme: () => \"system\",\n setTheme: () => undefined,\n themes: DEFAULT_THEME_OPTIONS,\n storageKey: DEFAULT_STORAGE_KEY,\n});\n\nexport function useTheme(): ThemeContextValue {\n return readContext(ThemeContext);\n}\n\nexport function ThemeProvider(props: ThemeProviderProps): JSX.Element {\n const {\n children,\n defaultTheme = \"system\",\n themes = DEFAULT_THEME_OPTIONS,\n storageKey = DEFAULT_STORAGE_KEY,\n } = props;\n\n const themeState = state<ThemeName>(readStoredTheme(storageKey) ?? defaultTheme);\n\n const setTheme = (nextTheme: ThemeName) => {\n themeState.set(nextTheme);\n writeStoredTheme(storageKey, nextTheme);\n syncThemeRoot(nextTheme);\n };\n\n const value: ThemeContextValue = {\n theme: themeState,\n setTheme,\n themes,\n storageKey,\n };\n\n const currentTheme = themeState();\n\n return (\n <ThemeContext.Scope value={value}>\n <ThemeRootSync theme={currentTheme} />\n <div data-slot=\"theme-provider\">{children}</div>\n </ThemeContext.Scope>\n );\n}\n\nfunction ThemeRootSync(props: { theme: ThemeName }): JSX.Element | null {\n const { theme } = props;\n\n resource(\n ({ signal }: { signal: AbortSignal }) => {\n if (typeof window === \"undefined\") {\n syncThemeRoot(theme);\n return null;\n }\n\n const timeoutId = window.setTimeout(() => {\n if (!signal.aborted) {\n syncThemeRoot(theme);\n }\n }, 0);\n\n signal.addEventListener(\n \"abort\",\n () => {\n window.clearTimeout(timeoutId);\n },\n { once: true },\n );\n\n return null;\n },\n [theme],\n );\n\n return null;\n}\n\nexport function ThemePicker(props: ThemePickerProps): JSX.Element {\n const theme = useTheme();\n const { themes = theme.themes, label = \"Theme\", ...rest } = props;\n\n return (\n <select\n {...rest}\n aria-label={rest[\"aria-label\"] ?? label}\n data-slot=\"theme-picker\"\n value={theme.theme()}\n onChange={(event: Event) => {\n const target = event.currentTarget as HTMLSelectElement;\n theme.setTheme(target.value as ThemeName);\n }}\n >\n {themes.map((option) => (\n <option key={option.value} value={option.value}>\n {option.label}\n </option>\n ))}\n </select>\n );\n}\n\nexport function ThemeToggle(props: ThemeToggleProps): JSX.Element {\n const theme = useTheme();\n const {\n children,\n lightIcon,\n darkIcon,\n systemIcon,\n toggleThemes = [\"light\", \"dark\"],\n onPress,\n ...rest\n } = props;\n\n const currentTheme = theme.theme();\n const nextTheme = getNextTheme(currentTheme, toggleThemes);\n const renderContext = { theme: currentTheme, nextTheme };\n const ariaLabel = (rest as Record<string, unknown>)[\"aria-label\"];\n const themedIcon = resolveThemeToggleIcon(currentTheme, nextTheme, {\n lightIcon,\n darkIcon,\n systemIcon,\n });\n const content =\n typeof children === \"function\" ? children(renderContext) : (children ?? themedIcon);\n\n return (\n <Button\n {...(rest as ButtonNativeProps)}\n aria-label={typeof ariaLabel === \"string\" ? ariaLabel : `Switch to ${nextTheme} theme`}\n data-theme-control=\"toggle\"\n data-theme-choice={currentTheme}\n data-next-theme={nextTheme}\n onPress={(event) => {\n onPress?.(event);\n if (!event.defaultPrevented) theme.setTheme(nextTheme);\n }}\n >\n {content}\n </Button>\n );\n}\n\nfunction getNextTheme(currentTheme: ThemeName, themes: readonly ThemeName[]): ThemeName {\n if (themes.length === 0) return currentTheme;\n const index = themes.indexOf(currentTheme);\n return themes[index >= 0 && index < themes.length - 1 ? index + 1 : 0]!;\n}\n\nfunction getThemeIcon(\n theme: ThemeName,\n icons: Pick<ThemeToggleProps, \"lightIcon\" | \"darkIcon\" | \"systemIcon\">,\n): unknown {\n if (theme === \"light\") return icons.lightIcon;\n if (theme === \"dark\") return icons.darkIcon;\n if (theme === \"system\") return icons.systemIcon;\n return undefined;\n}\n\nexport function resolveThemeToggleIcon(\n theme: ThemeName,\n nextTheme: ThemeName,\n icons: Pick<ThemeToggleProps, \"lightIcon\" | \"darkIcon\" | \"systemIcon\">,\n): unknown {\n return getThemeIcon(theme, icons) ?? getThemeIcon(nextTheme, icons);\n}\n\nfunction syncThemeRoot(themeChoice: ThemeName | null | undefined): void {\n if (typeof document === \"undefined\") {\n return;\n }\n\n const html = document.documentElement;\n\n if (themeChoice == null) {\n html.removeAttribute(\"data-theme\");\n html.removeAttribute(\"data-theme-choice\");\n return;\n }\n\n html.setAttribute(\"data-theme-choice\", themeChoice);\n\n if (themeChoice === \"system\") {\n html.removeAttribute(\"data-theme\");\n } else {\n html.setAttribute(\"data-theme\", themeChoice);\n }\n}\n\nfunction readStoredTheme(storageKey: string): ThemeName | undefined {\n if (typeof window === \"undefined\") return undefined;\n try {\n return (window.localStorage.getItem(storageKey) as ThemeName | null) ?? undefined;\n } catch {\n return undefined;\n }\n}\n\nfunction writeStoredTheme(storageKey: string, theme: ThemeName): void {\n if (typeof window === \"undefined\") return;\n try {\n window.localStorage.setItem(storageKey, theme);\n } catch {\n // Storage can be unavailable in private or locked-down browser contexts.\n }\n}\n"],"mappings":";;;;;AAgDA,MAAa,wBAAgD;CAC3D;EAAE,OAAO;EAAU,OAAO;EAAU;CACpC;EAAE,OAAO;EAAS,OAAO;EAAS;CAClC;EAAE,OAAO;EAAQ,OAAO;EAAQ;CACjC;AAED,MAAM,sBAAsB;AAE5B,MAAM,eAAe,cAAiC;CACpD,aAAa;CACb,gBAAgB,KAAA;CAChB,QAAQ;CACR,YAAY;CACb,CAAC;AAEF,SAAgB,WAA8B;AAC5C,QAAO,YAAY,aAAa;;AAGlC,SAAgB,cAAc,OAAwC;CACpE,MAAM,EACJ,UACA,eAAe,UACf,SAAS,uBACT,aAAa,wBACX;CAEJ,MAAM,aAAa,MAAiB,gBAAgB,WAAW,IAAI,aAAa;CAEhF,MAAM,YAAY,cAAyB;AACzC,aAAW,IAAI,UAAU;AACzB,mBAAiB,YAAY,UAAU;AACvC,gBAAc,UAAU;;CAG1B,MAAM,QAA2B;EAC/B,OAAO;EACP;EACA;EACA;EACD;CAED,MAAM,eAAe,YAAY;AAEjC,QACE,qBAAC,aAAa,OAAd;EAA2B;YAA3B,CACE,oBAAC,eAAD,EAAe,OAAO,cAAgB,CAAA,EACtC,oBAAC,OAAD;GAAK,aAAU;GAAkB;GAAe,CAAA,CAC7B;;;AAIzB,SAAS,cAAc,OAAiD;CACtE,MAAM,EAAE,UAAU;AAElB,WACG,EAAE,aAAsC;AACvC,MAAI,OAAO,WAAW,aAAa;AACjC,iBAAc,MAAM;AACpB,UAAO;;EAGT,MAAM,YAAY,OAAO,iBAAiB;AACxC,OAAI,CAAC,OAAO,QACV,eAAc,MAAM;KAErB,EAAE;AAEL,SAAO,iBACL,eACM;AACJ,UAAO,aAAa,UAAU;KAEhC,EAAE,MAAM,MAAM,CACf;AAED,SAAO;IAET,CAAC,MAAM,CACR;AAED,QAAO;;AAGT,SAAgB,YAAY,OAAsC;CAChE,MAAM,QAAQ,UAAU;CACxB,MAAM,EAAE,SAAS,MAAM,QAAQ,QAAQ,SAAS,GAAG,SAAS;AAE5D,QACE,oBAAC,UAAD;EACE,GAAI;EACJ,cAAY,KAAK,iBAAiB;EAClC,aAAU;EACV,OAAO,MAAM,OAAO;EACpB,WAAW,UAAiB;GAC1B,MAAM,SAAS,MAAM;AACrB,SAAM,SAAS,OAAO,MAAmB;;YAG1C,OAAO,KAAK,WACX,oBAAC,UAAD;GAA2B,OAAO,OAAO;aACtC,OAAO;GACD,EAFI,OAAO,MAEX,CACT;EACK,CAAA;;AAIb,SAAgB,YAAY,OAAsC;CAChE,MAAM,QAAQ,UAAU;CACxB,MAAM,EACJ,UACA,WACA,UACA,YACA,eAAe,CAAC,SAAS,OAAO,EAChC,SACA,GAAG,SACD;CAEJ,MAAM,eAAe,MAAM,OAAO;CAClC,MAAM,YAAY,aAAa,cAAc,aAAa;CAC1D,MAAM,gBAAgB;EAAE,OAAO;EAAc;EAAW;CACxD,MAAM,YAAa,KAAiC;CACpD,MAAM,aAAa,uBAAuB,cAAc,WAAW;EACjE;EACA;EACA;EACD,CAAC;CACF,MAAM,UACJ,OAAO,aAAa,aAAa,SAAS,cAAc,GAAI,YAAY;AAE1E,QACE,oBAAC,QAAD;EACE,GAAK;EACL,cAAY,OAAO,cAAc,WAAW,YAAY,aAAa,UAAU;EAC/E,sBAAmB;EACnB,qBAAmB;EACnB,mBAAiB;EACjB,UAAU,UAAU;AAClB,aAAU,MAAM;AAChB,OAAI,CAAC,MAAM,iBAAkB,OAAM,SAAS,UAAU;;YAGvD;EACM,CAAA;;AAIb,SAAS,aAAa,cAAyB,QAAyC;AACtF,KAAI,OAAO,WAAW,EAAG,QAAO;CAChC,MAAM,QAAQ,OAAO,QAAQ,aAAa;AAC1C,QAAO,OAAO,SAAS,KAAK,QAAQ,OAAO,SAAS,IAAI,QAAQ,IAAI;;AAGtE,SAAS,aACP,OACA,OACS;AACT,KAAI,UAAU,QAAS,QAAO,MAAM;AACpC,KAAI,UAAU,OAAQ,QAAO,MAAM;AACnC,KAAI,UAAU,SAAU,QAAO,MAAM;;AAIvC,SAAgB,uBACd,OACA,WACA,OACS;AACT,QAAO,aAAa,OAAO,MAAM,IAAI,aAAa,WAAW,MAAM;;AAGrE,SAAS,cAAc,aAAiD;AACtE,KAAI,OAAO,aAAa,YACtB;CAGF,MAAM,OAAO,SAAS;AAEtB,KAAI,eAAe,MAAM;AACvB,OAAK,gBAAgB,aAAa;AAClC,OAAK,gBAAgB,oBAAoB;AACzC;;AAGF,MAAK,aAAa,qBAAqB,YAAY;AAEnD,KAAI,gBAAgB,SAClB,MAAK,gBAAgB,aAAa;KAElC,MAAK,aAAa,cAAc,YAAY;;AAIhD,SAAS,gBAAgB,YAA2C;AAClE,KAAI,OAAO,WAAW,YAAa,QAAO,KAAA;AAC1C,KAAI;AACF,SAAQ,OAAO,aAAa,QAAQ,WAAW,IAAyB,KAAA;SAClE;AACN;;;AAIJ,SAAS,iBAAiB,YAAoB,OAAwB;AACpE,KAAI,OAAO,WAAW,YAAa;AACnC,KAAI;AACF,SAAO,aAAa,QAAQ,YAAY,MAAM;SACxC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { TopbarLayoutProps } from "./topbar-layout.types.js";
|
|
2
|
-
|
|
3
|
-
//#region src/components/topbar-layout/topbar-layout.d.ts
|
|
4
|
-
declare function TopbarLayout(props: TopbarLayoutProps): JSX.Element;
|
|
5
|
-
//#endregion
|
|
6
|
-
export { TopbarLayout };
|
|
7
|
-
//# sourceMappingURL=topbar-layout.d.ts.map
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { isCssLength, mergeLayoutStyles, serializeValueIf } from "../_internal/layout.js";
|
|
2
|
-
import { jsx } from "@askrjs/askr/jsx-runtime";
|
|
3
|
-
//#region src/components/topbar-layout/topbar-layout.tsx
|
|
4
|
-
function isThemeGapToken(value) {
|
|
5
|
-
return typeof value === "string" && [
|
|
6
|
-
"sm",
|
|
7
|
-
"md",
|
|
8
|
-
"lg",
|
|
9
|
-
"xl"
|
|
10
|
-
].includes(value.trim());
|
|
11
|
-
}
|
|
12
|
-
function TopbarLayout(props) {
|
|
13
|
-
const { topbar, children, topbarHeight, gap, ref, style: userStyle, ...rest } = props;
|
|
14
|
-
const wrapperStyle = {};
|
|
15
|
-
if (isCssLength(gap)) wrapperStyle.gap = gap;
|
|
16
|
-
const navbarStyle = {};
|
|
17
|
-
if (isCssLength(topbarHeight)) navbarStyle.height = topbarHeight;
|
|
18
|
-
return /* @__PURE__ */ jsx("div", {
|
|
19
|
-
...rest,
|
|
20
|
-
ref,
|
|
21
|
-
"data-slot": "topbar-layout",
|
|
22
|
-
"data-gap": serializeValueIf(gap, isThemeGapToken),
|
|
23
|
-
style: mergeLayoutStyles(wrapperStyle, userStyle),
|
|
24
|
-
children: [/* @__PURE__ */ jsx("header", {
|
|
25
|
-
"data-slot": "navbar",
|
|
26
|
-
style: mergeLayoutStyles(navbarStyle, void 0),
|
|
27
|
-
children: topbar
|
|
28
|
-
}, "topbar-layout-navbar"), /* @__PURE__ */ jsx("main", {
|
|
29
|
-
"data-slot": "main",
|
|
30
|
-
children
|
|
31
|
-
}, "topbar-layout-main")]
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
//#endregion
|
|
35
|
-
export { TopbarLayout };
|
|
36
|
-
|
|
37
|
-
//# sourceMappingURL=topbar-layout.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"topbar-layout.js","names":[],"sources":["../../src/components/topbar-layout/topbar-layout.tsx"],"sourcesContent":["import { isCssLength, mergeLayoutStyles, serializeValueIf } from \"../_internal/layout\";\nimport type { TopbarLayoutProps } from \"./topbar-layout.types\";\n\nfunction isThemeGapToken(value: unknown): value is string {\n return typeof value === \"string\" && [\"sm\", \"md\", \"lg\", \"xl\"].includes(value.trim());\n}\n\nexport function TopbarLayout(props: TopbarLayoutProps): JSX.Element {\n const { topbar, children, topbarHeight, gap, ref, style: userStyle, ...rest } = props;\n\n const wrapperStyle: Record<string, string | number> = {};\n if (isCssLength(gap)) wrapperStyle.gap = gap!;\n\n const navbarStyle: Record<string, string | number> = {};\n if (isCssLength(topbarHeight)) navbarStyle.height = topbarHeight!;\n\n return (\n <div\n {...rest}\n ref={ref}\n data-slot=\"topbar-layout\"\n data-gap={serializeValueIf(gap, isThemeGapToken)}\n style={mergeLayoutStyles(wrapperStyle, userStyle)}\n >\n {[\n <header\n key=\"topbar-layout-navbar\"\n data-slot=\"navbar\"\n style={mergeLayoutStyles(navbarStyle, undefined)}\n >\n {topbar}\n </header>,\n <main key=\"topbar-layout-main\" data-slot=\"main\">\n {children}\n </main>,\n ]}\n </div>\n );\n}\n"],"mappings":";;;AAGA,SAAS,gBAAgB,OAAiC;AACxD,QAAO,OAAO,UAAU,YAAY;EAAC;EAAM;EAAM;EAAM;EAAK,CAAC,SAAS,MAAM,MAAM,CAAC;;AAGrF,SAAgB,aAAa,OAAuC;CAClE,MAAM,EAAE,QAAQ,UAAU,cAAc,KAAK,KAAK,OAAO,WAAW,GAAG,SAAS;CAEhF,MAAM,eAAgD,EAAE;AACxD,KAAI,YAAY,IAAI,CAAE,cAAa,MAAM;CAEzC,MAAM,cAA+C,EAAE;AACvD,KAAI,YAAY,aAAa,CAAE,aAAY,SAAS;AAEpD,QACE,oBAAC,OAAD;EACE,GAAI;EACC;EACL,aAAU;EACV,YAAU,iBAAiB,KAAK,gBAAgB;EAChD,OAAO,kBAAkB,cAAc,UAAU;YAEhD,CACC,oBAAC,UAAD;GAEE,aAAU;GACV,OAAO,kBAAkB,aAAa,KAAA,EAAU;aAE/C;GACM,EALH,uBAKG,EACT,oBAAC,QAAD;GAA+B,aAAU;GACtC;GACI,EAFG,qBAEH,CACR;EACG,CAAA"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Ref } from "@askrjs/askr/foundations";
|
|
2
|
-
|
|
3
|
-
//#region src/components/topbar-layout/topbar-layout.types.d.ts
|
|
4
|
-
type TopbarLayoutProps = Omit<JSX.IntrinsicElements["div"], "children" | "ref"> & {
|
|
5
|
-
/** Content rendered into the topbar/navbar slot (header). */topbar?: unknown; /** Content rendered into the main slot. */
|
|
6
|
-
children?: unknown; /** CSS height for the topbar. Applied as inline style only when it is a real CSS length. */
|
|
7
|
-
topbarHeight?: string; /** CSS gap between topbar and main. Applied as inline style only when it is a real CSS length. */
|
|
8
|
-
gap?: string;
|
|
9
|
-
ref?: Ref<HTMLDivElement>;
|
|
10
|
-
};
|
|
11
|
-
//#endregion
|
|
12
|
-
export { TopbarLayoutProps };
|
|
13
|
-
//# sourceMappingURL=topbar-layout.types.d.ts.map
|
package/src/askr-compat.d.ts
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
// Temporary local type shim for sibling `file:` dependencies.
|
|
2
|
-
// Remove this once `../askr` and `../askr-ui` reliably emit the dist .d.ts
|
|
3
|
-
// files referenced by this package's tsconfig path mappings.
|
|
4
|
-
|
|
5
|
-
declare module "@askrjs/askr/foundations" {
|
|
6
|
-
export type Ref<T> = { current: T | null } | ((value: T | null) => void) | null | undefined;
|
|
7
|
-
|
|
8
|
-
export type Props = Record<string, unknown> & {
|
|
9
|
-
children?: unknown;
|
|
10
|
-
ref?: unknown;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export interface JSXElement {
|
|
14
|
-
$$typeof: symbol;
|
|
15
|
-
type: string | ((props: Props) => unknown) | symbol;
|
|
16
|
-
props: Props;
|
|
17
|
-
key?: string | number | null;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface SlotProps extends Props {
|
|
21
|
-
asChild?: boolean;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export function Slot(props: SlotProps): JSXElement;
|
|
25
|
-
|
|
26
|
-
export function mergeProps<
|
|
27
|
-
TProps extends Record<string, unknown>,
|
|
28
|
-
TOverrides extends Record<string, unknown>,
|
|
29
|
-
>(props: TProps, overrides: TOverrides): TProps & TOverrides;
|
|
30
|
-
|
|
31
|
-
export interface PresenceProps extends Props {
|
|
32
|
-
present?: boolean;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export function Presence(props: PresenceProps): JSXElement | null;
|
|
36
|
-
|
|
37
|
-
export function composeRefs<T>(...refs: Array<Ref<T>>): Ref<T>;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
declare module "@askrjs/askr" {
|
|
41
|
-
import type { JSXElement } from "@askrjs/askr/foundations";
|
|
42
|
-
|
|
43
|
-
export interface State<T> {
|
|
44
|
-
(): T;
|
|
45
|
-
set(value: T): void;
|
|
46
|
-
set(updater: (prev: T) => T): void;
|
|
47
|
-
[Symbol.iterator](): Iterator<State<T> | State<T>["set"]>;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export interface Context<T> {
|
|
51
|
-
readonly key: symbol;
|
|
52
|
-
readonly defaultValue: T;
|
|
53
|
-
readonly Scope: (props: { value: unknown; children?: unknown }) => JSXElement;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
type ForEachSource<T> = T[] | (() => T[]);
|
|
57
|
-
|
|
58
|
-
type ForBaseProps<T> = {
|
|
59
|
-
each: ForEachSource<T>;
|
|
60
|
-
fallback?: unknown;
|
|
61
|
-
children: (item: T, index: () => number) => unknown;
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
type KeyedForProps<T, K extends string | number> = ForBaseProps<T> & {
|
|
65
|
-
by: (item: T, index: number) => K;
|
|
66
|
-
byIndex?: never;
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
type IndexedForProps<T> = ForBaseProps<T> & {
|
|
70
|
-
by?: never;
|
|
71
|
-
byIndex: true;
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
export type ForProps<T, K extends string | number = string | number> =
|
|
75
|
-
| KeyedForProps<T, K>
|
|
76
|
-
| IndexedForProps<T>;
|
|
77
|
-
|
|
78
|
-
export function state<T>(initialValue: T): State<T>;
|
|
79
|
-
export function defineContext<T>(defaultValue: T): Context<T>;
|
|
80
|
-
export function readContext<T>(context: Context<T>): T;
|
|
81
|
-
export const For: <T, K extends string | number = string | number>(
|
|
82
|
-
props: ForProps<T, K>,
|
|
83
|
-
) => JSXElement;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
declare module "@askrjs/askr/jsx-runtime" {
|
|
87
|
-
import type { JSXElement } from "@askrjs/askr/foundations";
|
|
88
|
-
|
|
89
|
-
export const Fragment: symbol;
|
|
90
|
-
export function jsx(
|
|
91
|
-
type: unknown,
|
|
92
|
-
props: Record<string, unknown>,
|
|
93
|
-
key?: string | number,
|
|
94
|
-
): JSXElement;
|
|
95
|
-
export const jsxs: typeof jsx;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
declare module "@askrjs/askr/jsx-dev-runtime" {
|
|
99
|
-
import type { JSXElement } from "@askrjs/askr/foundations";
|
|
100
|
-
|
|
101
|
-
export const Fragment: symbol;
|
|
102
|
-
export function jsxDEV(
|
|
103
|
-
type: unknown,
|
|
104
|
-
props: Record<string, unknown>,
|
|
105
|
-
key?: string | number,
|
|
106
|
-
isStaticChildren?: boolean,
|
|
107
|
-
source?: unknown,
|
|
108
|
-
self?: unknown,
|
|
109
|
-
): JSXElement;
|
|
110
|
-
}
|
package/src/askr-router.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
declare module "@askrjs/askr/router" {
|
|
2
|
-
export type LinkProps = Omit<
|
|
3
|
-
JSX.IntrinsicElements["a"],
|
|
4
|
-
"children" | "href" | "class" | "rel" | "target" | "aria-current" | "aria-label"
|
|
5
|
-
> & {
|
|
6
|
-
href: string;
|
|
7
|
-
class?: string;
|
|
8
|
-
children?: unknown;
|
|
9
|
-
rel?: string;
|
|
10
|
-
target?: string;
|
|
11
|
-
"aria-current"?: "page" | "step" | "location" | "date" | "time" | "true" | "false";
|
|
12
|
-
"aria-label"?: string;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export function Link(props: LinkProps): JSX.Element;
|
|
16
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { AccessibleIconProps } from "./accessible-icon.types";
|
|
2
|
-
|
|
3
|
-
export function AccessibleIcon(props: AccessibleIconProps): JSX.Element {
|
|
4
|
-
const { children, label, decorative = label ? false : true } = props;
|
|
5
|
-
|
|
6
|
-
return (
|
|
7
|
-
<span
|
|
8
|
-
data-slot="accessible-icon"
|
|
9
|
-
data-decorative={decorative ? "true" : undefined}
|
|
10
|
-
role={decorative ? undefined : "img"}
|
|
11
|
-
aria-hidden={decorative ? "true" : undefined}
|
|
12
|
-
aria-label={decorative ? undefined : label}
|
|
13
|
-
>
|
|
14
|
-
{children}
|
|
15
|
-
{!decorative && label ? <span class="sr-only">{label}</span> : null}
|
|
16
|
-
</span>
|
|
17
|
-
);
|
|
18
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export const GRID_A11Y_CONTRACT = {
|
|
2
|
-
DATA_ATTRIBUTES: {
|
|
3
|
-
slot: "data-slot" as const,
|
|
4
|
-
layout: "data-ak-layout" as const,
|
|
5
|
-
areas: "data-areas" as const,
|
|
6
|
-
columns: "data-columns" as const,
|
|
7
|
-
rows: "data-rows" as const,
|
|
8
|
-
flow: "data-flow" as const,
|
|
9
|
-
minItemWidth: "data-min-item-width" as const,
|
|
10
|
-
gap: "data-gap" as const,
|
|
11
|
-
gapX: "data-gap-x" as const,
|
|
12
|
-
gapY: "data-gap-y" as const,
|
|
13
|
-
autoFit: "data-auto-fit" as const,
|
|
14
|
-
align: "data-align" as const,
|
|
15
|
-
justify: "data-justify" as const,
|
|
16
|
-
},
|
|
17
|
-
SLOT_VALUES: {
|
|
18
|
-
root: "grid" as const,
|
|
19
|
-
},
|
|
20
|
-
} as const;
|
|
21
|
-
|
|
22
|
-
export type GridA11yContract = typeof GRID_A11Y_CONTRACT;
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import { For } from "@askrjs/askr";
|
|
2
|
-
import { Slot } from "@askrjs/askr/foundations";
|
|
3
|
-
import { mergeProps } from "../_internal/merge-props";
|
|
4
|
-
import {
|
|
5
|
-
applyBoxLayoutStyles,
|
|
6
|
-
splitBoxLayoutProps,
|
|
7
|
-
withBoxLayoutStyle,
|
|
8
|
-
} from "../_internal/box-layout";
|
|
9
|
-
import { isJsxElement, toChildArray } from "../_internal/jsx";
|
|
10
|
-
import {
|
|
11
|
-
isResponsiveValue,
|
|
12
|
-
resolveAlignValue,
|
|
13
|
-
resolveGridTrackValue,
|
|
14
|
-
resolveJustifyValue,
|
|
15
|
-
resolveSpaceValue,
|
|
16
|
-
serializeResponsiveValueIf,
|
|
17
|
-
serializeValueIf,
|
|
18
|
-
setResponsiveStyleVar,
|
|
19
|
-
} from "../_internal/layout";
|
|
20
|
-
import type { GridAsChildProps, GridDivProps, GridSpanProps } from "./grid.types";
|
|
21
|
-
|
|
22
|
-
const SPACE_TOKENS = new Set([
|
|
23
|
-
"1",
|
|
24
|
-
"2",
|
|
25
|
-
"3",
|
|
26
|
-
"4",
|
|
27
|
-
"5",
|
|
28
|
-
"6",
|
|
29
|
-
"7",
|
|
30
|
-
"8",
|
|
31
|
-
"9",
|
|
32
|
-
"xs",
|
|
33
|
-
"sm",
|
|
34
|
-
"md",
|
|
35
|
-
"lg",
|
|
36
|
-
"xl",
|
|
37
|
-
"2xl",
|
|
38
|
-
"3xl",
|
|
39
|
-
]);
|
|
40
|
-
|
|
41
|
-
function isResponsiveObject(value: unknown): boolean {
|
|
42
|
-
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function isCssCoveredSpaceValue(value: unknown): value is string {
|
|
46
|
-
return typeof value === "string" && SPACE_TOKENS.has(value.trim());
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function isCssCoveredAlignValue(value: unknown): value is string {
|
|
50
|
-
return (
|
|
51
|
-
typeof value === "string" &&
|
|
52
|
-
["start", "end", "center", "stretch", "baseline"].includes(value.trim())
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function isCssCoveredJustifyValue(value: unknown): value is string {
|
|
57
|
-
return typeof value === "string" && ["start", "end", "center", "between"].includes(value.trim());
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function isCssCoveredGridColumnValue(value: unknown): boolean {
|
|
61
|
-
return typeof value === "number" || (typeof value === "string" && /^\d+$/.test(value.trim()));
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function isCssCoveredAutoFitValue(value: unknown): value is boolean {
|
|
65
|
-
return typeof value === "boolean";
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function serializeStaticThemeValue<T>(
|
|
69
|
-
value: T | Partial<Record<"initial" | "sm" | "md" | "lg" | "xl", T>> | undefined,
|
|
70
|
-
predicate: (value: T) => boolean,
|
|
71
|
-
): string | undefined {
|
|
72
|
-
if (isResponsiveValue(value)) return undefined;
|
|
73
|
-
return serializeResponsiveValueIf(value, predicate);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
function resolveCompatibilityGridTemplate(
|
|
77
|
-
minItemWidth: string | undefined,
|
|
78
|
-
autoFit: boolean | undefined,
|
|
79
|
-
): string | undefined {
|
|
80
|
-
if (!minItemWidth) return undefined;
|
|
81
|
-
const fitKeyword = autoFit === false ? "auto-fill" : "auto-fit";
|
|
82
|
-
return `repeat(${fitKeyword}, minmax(${minItemWidth}, 1fr))`;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export function Grid(props: GridDivProps): JSX.Element;
|
|
86
|
-
export function Grid(props: GridSpanProps): JSX.Element;
|
|
87
|
-
export function Grid(props: GridAsChildProps): JSX.Element;
|
|
88
|
-
export function Grid(props: GridDivProps | GridSpanProps | GridAsChildProps) {
|
|
89
|
-
const as = "as" in props ? props.as : "div";
|
|
90
|
-
const {
|
|
91
|
-
asChild,
|
|
92
|
-
children,
|
|
93
|
-
areas,
|
|
94
|
-
columns,
|
|
95
|
-
rows,
|
|
96
|
-
flow,
|
|
97
|
-
gap,
|
|
98
|
-
gapX,
|
|
99
|
-
gapY,
|
|
100
|
-
align,
|
|
101
|
-
justify,
|
|
102
|
-
minItemWidth,
|
|
103
|
-
autoFit,
|
|
104
|
-
ref,
|
|
105
|
-
style: userStyle,
|
|
106
|
-
...rest
|
|
107
|
-
} = props;
|
|
108
|
-
|
|
109
|
-
const { boxProps, rest: passthroughProps } = splitBoxLayoutProps(rest);
|
|
110
|
-
const layoutStyle: Record<string, string | number> = {};
|
|
111
|
-
applyBoxLayoutStyles(layoutStyle, boxProps);
|
|
112
|
-
|
|
113
|
-
if (boxProps.display !== undefined) {
|
|
114
|
-
setResponsiveStyleVar(layoutStyle, "display", boxProps.display, (value) => value);
|
|
115
|
-
}
|
|
116
|
-
setResponsiveStyleVar(layoutStyle, "grid-template-areas", areas, (value) => value);
|
|
117
|
-
setResponsiveStyleVar(
|
|
118
|
-
layoutStyle,
|
|
119
|
-
"grid-template-columns",
|
|
120
|
-
columns ?? resolveCompatibilityGridTemplate(minItemWidth, autoFit),
|
|
121
|
-
resolveGridTrackValue,
|
|
122
|
-
);
|
|
123
|
-
setResponsiveStyleVar(layoutStyle, "grid-template-rows", rows, resolveGridTrackValue);
|
|
124
|
-
setResponsiveStyleVar(layoutStyle, "grid-auto-flow", flow, (value) => value);
|
|
125
|
-
if (!isCssCoveredSpaceValue(gap) || isResponsiveObject(gap)) {
|
|
126
|
-
setResponsiveStyleVar(layoutStyle, "gap", gap, resolveSpaceValue);
|
|
127
|
-
}
|
|
128
|
-
if (!isCssCoveredSpaceValue(gapX) || isResponsiveObject(gapX)) {
|
|
129
|
-
setResponsiveStyleVar(layoutStyle, "column-gap", gapX, resolveSpaceValue);
|
|
130
|
-
}
|
|
131
|
-
if (!isCssCoveredSpaceValue(gapY) || isResponsiveObject(gapY)) {
|
|
132
|
-
setResponsiveStyleVar(layoutStyle, "row-gap", gapY, resolveSpaceValue);
|
|
133
|
-
}
|
|
134
|
-
if (!isCssCoveredAlignValue(align) || isResponsiveObject(align)) {
|
|
135
|
-
setResponsiveStyleVar(layoutStyle, "align-items", align, resolveAlignValue);
|
|
136
|
-
}
|
|
137
|
-
if (!isCssCoveredJustifyValue(justify) || isResponsiveObject(justify)) {
|
|
138
|
-
setResponsiveStyleVar(layoutStyle, "justify-content", justify, resolveJustifyValue);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
const finalProps = mergeProps(passthroughProps, {
|
|
142
|
-
ref,
|
|
143
|
-
"data-slot": "grid",
|
|
144
|
-
"data-ak-layout": "true",
|
|
145
|
-
"data-columns": serializeStaticThemeValue(columns, isCssCoveredGridColumnValue),
|
|
146
|
-
"data-gap": serializeStaticThemeValue(gap, isCssCoveredSpaceValue),
|
|
147
|
-
"data-gap-x": serializeStaticThemeValue(gapX, isCssCoveredSpaceValue),
|
|
148
|
-
"data-gap-y": serializeStaticThemeValue(gapY, isCssCoveredSpaceValue),
|
|
149
|
-
"data-align": serializeStaticThemeValue(align, isCssCoveredAlignValue),
|
|
150
|
-
"data-justify": serializeStaticThemeValue(justify, isCssCoveredJustifyValue),
|
|
151
|
-
"data-auto-fit": serializeValueIf(autoFit, isCssCoveredAutoFitValue),
|
|
152
|
-
style: withBoxLayoutStyle(layoutStyle, userStyle),
|
|
153
|
-
});
|
|
154
|
-
const keyedChildren = (
|
|
155
|
-
<For
|
|
156
|
-
each={() => toChildArray(children)}
|
|
157
|
-
by={(child, index) => (isJsxElement(child) && child.key != null ? child.key : index)}
|
|
158
|
-
>
|
|
159
|
-
{(child) => child as never}
|
|
160
|
-
</For>
|
|
161
|
-
);
|
|
162
|
-
|
|
163
|
-
if (asChild) {
|
|
164
|
-
return <Slot asChild {...finalProps} children={children as JSX.Element} />;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
if (as === "span") {
|
|
168
|
-
return <span {...finalProps}>{keyedChildren}</span>;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
return <div {...finalProps}>{keyedChildren}</div>;
|
|
172
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { JSXElement, Ref } from "@askrjs/askr/foundations";
|
|
2
|
-
import type { BoxLayoutOwnProps, LayoutResponsive } from "../box/box.types";
|
|
3
|
-
|
|
4
|
-
export type GridOwnProps = BoxLayoutOwnProps & {
|
|
5
|
-
areas?: LayoutResponsive<string>;
|
|
6
|
-
columns?: LayoutResponsive<number | string>;
|
|
7
|
-
rows?: LayoutResponsive<number | string>;
|
|
8
|
-
flow?: LayoutResponsive<string>;
|
|
9
|
-
gap?: LayoutResponsive<string | number>;
|
|
10
|
-
gapX?: LayoutResponsive<string | number>;
|
|
11
|
-
gapY?: LayoutResponsive<string | number>;
|
|
12
|
-
align?: LayoutResponsive<string>;
|
|
13
|
-
justify?: LayoutResponsive<string>;
|
|
14
|
-
/** Compatibility helper for auto-fit grids. */
|
|
15
|
-
minItemWidth?: string;
|
|
16
|
-
/** Compatibility helper for auto-fit grids. */
|
|
17
|
-
autoFit?: boolean;
|
|
18
|
-
as?: "div" | "span";
|
|
19
|
-
children?: unknown;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export type GridNativeProps = Omit<JSX.IntrinsicElements["div"], "children" | "ref"> &
|
|
23
|
-
GridOwnProps & {
|
|
24
|
-
as?: "div";
|
|
25
|
-
asChild?: false;
|
|
26
|
-
ref?: Ref<HTMLDivElement>;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export type GridSpanProps = Omit<JSX.IntrinsicElements["span"], "children" | "ref"> &
|
|
30
|
-
GridOwnProps & {
|
|
31
|
-
as: "span";
|
|
32
|
-
asChild?: false;
|
|
33
|
-
ref?: Ref<HTMLSpanElement>;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export type GridAsChildProps = Omit<GridOwnProps, "as"> & {
|
|
37
|
-
asChild: true;
|
|
38
|
-
children: JSXElement;
|
|
39
|
-
ref?: Ref<unknown>;
|
|
40
|
-
style?: JSX.IntrinsicElements["div"]["style"];
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export type GridDivProps = GridNativeProps;
|
|
44
|
-
|
|
45
|
-
export type GridProps = GridDivProps | GridSpanProps | GridAsChildProps;
|
package/src/components/index.ts
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import "../themes/default/index.css";
|
|
2
|
-
|
|
3
|
-
// Theme controls
|
|
4
|
-
export { Button } from "@askrjs/ui";
|
|
5
|
-
export type {
|
|
6
|
-
ButtonAsChildProps,
|
|
7
|
-
ButtonNativeProps,
|
|
8
|
-
ButtonOwnProps,
|
|
9
|
-
ButtonProps,
|
|
10
|
-
} from "@askrjs/ui";
|
|
11
|
-
export { DEFAULT_THEME_OPTIONS, ThemePicker, ThemeProvider, ThemeToggle, useTheme } from "./theme";
|
|
12
|
-
export type {
|
|
13
|
-
ThemeContextValue,
|
|
14
|
-
ThemeName,
|
|
15
|
-
ThemeOption,
|
|
16
|
-
ThemePickerProps,
|
|
17
|
-
ThemeProviderProps,
|
|
18
|
-
ThemeToggleProps,
|
|
19
|
-
ThemeToggleRenderContext,
|
|
20
|
-
} from "./theme";
|
|
21
|
-
|
|
22
|
-
// Visual primitives
|
|
23
|
-
export { Badge } from "./badge";
|
|
24
|
-
export type { BadgeProps } from "./badge";
|
|
25
|
-
export { AccessibleIcon } from "./accessible-icon";
|
|
26
|
-
export type { AccessibleIconProps } from "./accessible-icon";
|
|
27
|
-
export { AspectRatio } from "./aspect-ratio";
|
|
28
|
-
export type { AspectRatioAsChildProps, AspectRatioProps } from "./aspect-ratio";
|
|
29
|
-
export { Box } from "./box";
|
|
30
|
-
export type { BoxProps } from "./box";
|
|
31
|
-
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "./card";
|
|
32
|
-
export type {
|
|
33
|
-
CardContentProps,
|
|
34
|
-
CardDescriptionProps,
|
|
35
|
-
CardFooterProps,
|
|
36
|
-
CardHeaderProps,
|
|
37
|
-
CardProps,
|
|
38
|
-
CardTitleProps,
|
|
39
|
-
} from "./card";
|
|
40
|
-
export { Container } from "./container";
|
|
41
|
-
export type { ContainerProps, ContainerVariant } from "./container";
|
|
42
|
-
export { Flex } from "./flex";
|
|
43
|
-
export type { FlexProps } from "./flex";
|
|
44
|
-
export { Grid } from "./grid";
|
|
45
|
-
export type { GridProps } from "./grid";
|
|
46
|
-
export { Inline } from "./inline";
|
|
47
|
-
export type { InlineProps } from "./inline";
|
|
48
|
-
export { GitHubLogo, GoogleLogo, MicrosoftLogo } from "./logos";
|
|
49
|
-
export type { LogoProps } from "./logos";
|
|
50
|
-
export { Section } from "./section";
|
|
51
|
-
export type { SectionProps } from "./section";
|
|
52
|
-
export { Divider, Separator } from "./separator";
|
|
53
|
-
export type { DividerProps, SeparatorProps } from "./separator";
|
|
54
|
-
export { Skeleton } from "./skeleton";
|
|
55
|
-
export type { SkeletonProps } from "./skeleton";
|
|
56
|
-
export { Spacer } from "./spacer";
|
|
57
|
-
export type { SpacerProps } from "./spacer";
|
|
58
|
-
export { Stack } from "./stack";
|
|
59
|
-
export type { StackProps } from "./stack";
|
|
60
|
-
|
|
61
|
-
// Theme-owned wrappers
|
|
62
|
-
export {
|
|
63
|
-
Breadcrumb,
|
|
64
|
-
BreadcrumbCurrent,
|
|
65
|
-
BreadcrumbItem,
|
|
66
|
-
BreadcrumbLink,
|
|
67
|
-
BreadcrumbList,
|
|
68
|
-
BreadcrumbSeparator,
|
|
69
|
-
} from "./breadcrumb";
|
|
70
|
-
export type {
|
|
71
|
-
BreadcrumbAsChildProps,
|
|
72
|
-
BreadcrumbCurrentAsChildProps,
|
|
73
|
-
BreadcrumbCurrentProps,
|
|
74
|
-
BreadcrumbItemAsChildProps,
|
|
75
|
-
BreadcrumbItemProps,
|
|
76
|
-
BreadcrumbLinkAsChildProps,
|
|
77
|
-
BreadcrumbLinkProps,
|
|
78
|
-
BreadcrumbListAsChildProps,
|
|
79
|
-
BreadcrumbListProps,
|
|
80
|
-
BreadcrumbOwnProps,
|
|
81
|
-
BreadcrumbProps,
|
|
82
|
-
BreadcrumbSeparatorAsChildProps,
|
|
83
|
-
BreadcrumbSeparatorProps,
|
|
84
|
-
} from "./breadcrumb";
|
|
85
|
-
export { Spinner } from "./spinner";
|
|
86
|
-
export type { SpinnerOwnProps, SpinnerProps } from "./spinner";
|
|
87
|
-
|
|
88
|
-
// Empty state
|
|
89
|
-
export { EmptyState } from "./empty-state";
|
|
90
|
-
export type { EmptyStateHeadingTag, EmptyStateProps } from "./empty-state";
|
|
91
|
-
|
|
92
|
-
// Shell / chrome
|
|
93
|
-
export { Header } from "./header";
|
|
94
|
-
export type { HeaderPosition, HeaderProps } from "./header";
|
|
95
|
-
export { NavBrand, Navbar, NavGroup, NavItem, NavLink } from "./navbar";
|
|
96
|
-
export type {
|
|
97
|
-
NavBrandProps,
|
|
98
|
-
NavbarProps,
|
|
99
|
-
NavGroupProps,
|
|
100
|
-
NavItemAsChildProps,
|
|
101
|
-
NavItemProps,
|
|
102
|
-
NavItemVariant,
|
|
103
|
-
NavLinkProps,
|
|
104
|
-
} from "./navbar";
|
|
105
|
-
export { SidebarLayout } from "./sidebar-layout";
|
|
106
|
-
export type { SidebarLayoutProps, SidebarPosition } from "./sidebar-layout";
|
|
107
|
-
export { TopbarLayout } from "./topbar-layout";
|
|
108
|
-
export type { TopbarLayoutProps } from "./topbar-layout";
|