@askrjs/themes 0.0.1
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/LICENSE +201 -0
- package/THEMING.md +930 -0
- package/dist/_internal/box-layout.js +115 -0
- package/dist/_internal/box-layout.js.map +1 -0
- package/dist/_internal/classes.js +8 -0
- package/dist/_internal/classes.js.map +1 -0
- package/dist/_internal/jsx.js +12 -0
- package/dist/_internal/jsx.js.map +1 -0
- package/dist/_internal/layout.d.ts +9 -0
- package/dist/_internal/layout.js +156 -0
- package/dist/_internal/layout.js.map +1 -0
- package/dist/_internal/merge-props.js +50 -0
- package/dist/_internal/merge-props.js.map +1 -0
- package/dist/accessible-icon/accessible-icon.d.ts +7 -0
- package/dist/accessible-icon/accessible-icon.js +20 -0
- package/dist/accessible-icon/accessible-icon.js.map +1 -0
- package/dist/accessible-icon/accessible-icon.types.d.ts +9 -0
- package/dist/askr/dist/common/jsx.d.ts +16 -0
- package/dist/askr/dist/common/props.d.ts +22 -0
- package/dist/askr-themes/src/themes/default/index.css +3736 -0
- package/dist/aspect-ratio/aspect-ratio.d.ts +8 -0
- package/dist/aspect-ratio/aspect-ratio.js +36 -0
- package/dist/aspect-ratio/aspect-ratio.js.map +1 -0
- package/dist/aspect-ratio/aspect-ratio.types.d.ts +20 -0
- package/dist/aspect-ratio/index.d.ts +2 -0
- package/dist/badge/badge.d.ts +8 -0
- package/dist/badge/badge.js +26 -0
- package/dist/badge/badge.js.map +1 -0
- package/dist/badge/badge.types.d.ts +20 -0
- package/dist/badge/index.d.ts +2 -0
- package/dist/box/box.d.ts +9 -0
- package/dist/box/box.js +35 -0
- package/dist/box/box.js.map +1 -0
- package/dist/box/box.types.d.ts +71 -0
- package/dist/box/index.d.ts +2 -0
- package/dist/breadcrumb/breadcrumb.d.ts +18 -0
- package/dist/breadcrumb/breadcrumb.js +113 -0
- package/dist/breadcrumb/breadcrumb.js.map +1 -0
- package/dist/breadcrumb/breadcrumb.types.d.ts +64 -0
- package/dist/breadcrumb/index.d.ts +2 -0
- package/dist/card/card.d.ts +12 -0
- package/dist/card/card.js +68 -0
- package/dist/card/card.js.map +1 -0
- package/dist/card/card.types.d.ts +37 -0
- package/dist/card/index.d.ts +2 -0
- package/dist/components/_internal/box-layout.d.ts +7 -0
- package/dist/components/_internal/classes.d.ts +1 -0
- package/dist/components/_internal/jsx.d.ts +8 -0
- package/dist/components/_internal/layout.d.ts +31 -0
- package/dist/components/_internal/merge-props.d.ts +1 -0
- package/dist/components/_internal/style.d.ts +1 -0
- package/dist/components/accessible-icon/accessible-icon.d.ts +2 -0
- package/dist/components/accessible-icon/accessible-icon.types.d.ts +5 -0
- package/dist/components/accessible-icon/index.d.ts +2 -0
- package/dist/components/aspect-ratio/aspect-ratio.d.ts +3 -0
- package/dist/components/aspect-ratio/aspect-ratio.types.d.ts +15 -0
- package/dist/components/aspect-ratio/index.d.ts +2 -0
- package/dist/components/badge/badge.a11y.d.ts +13 -0
- package/dist/components/badge/badge.d.ts +3 -0
- package/dist/components/badge/badge.types.d.ts +15 -0
- package/dist/components/badge/index.d.ts +3 -0
- package/dist/components/box/box.a11y.d.ts +10 -0
- package/dist/components/box/box.d.ts +4 -0
- package/dist/components/box/box.types.d.ts +66 -0
- package/dist/components/box/index.d.ts +3 -0
- package/dist/components/breadcrumb/breadcrumb.a11y.d.ts +13 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts +13 -0
- package/dist/components/breadcrumb/breadcrumb.types.d.ts +59 -0
- package/dist/components/breadcrumb/index.d.ts +3 -0
- package/dist/components/card/card.d.ts +7 -0
- package/dist/components/card/card.types.d.ts +33 -0
- package/dist/components/card/index.d.ts +2 -0
- package/dist/components/container/container.a11y.d.ts +16 -0
- package/dist/components/container/container.d.ts +3 -0
- package/dist/components/container/container.types.d.ts +29 -0
- package/dist/components/container/index.d.ts +3 -0
- package/dist/components/empty-state/empty-state.d.ts +2 -0
- package/dist/components/empty-state/empty-state.types.d.ts +9 -0
- package/dist/components/empty-state/index.d.ts +2 -0
- package/dist/components/flex/flex.a11y.d.ts +18 -0
- package/dist/components/flex/flex.d.ts +4 -0
- package/dist/components/flex/flex.types.d.ts +41 -0
- package/dist/components/flex/index.d.ts +3 -0
- package/dist/components/grid/grid.a11y.d.ts +21 -0
- package/dist/components/grid/grid.d.ts +4 -0
- package/dist/components/grid/grid.types.d.ts +37 -0
- package/dist/components/grid/index.d.ts +3 -0
- package/dist/components/header/header.a11y.d.ts +10 -0
- package/dist/components/header/header.d.ts +2 -0
- package/dist/components/header/header.types.d.ts +5 -0
- package/dist/components/header/index.d.ts +3 -0
- package/dist/components/index.d.ts +49 -0
- package/dist/components/index.js +28 -0
- package/dist/components/inline/index.d.ts +6 -0
- package/dist/components/logos/create-logo.d.ts +5 -0
- package/dist/components/logos/github-logo.d.ts +4 -0
- package/dist/components/logos/google-logo.d.ts +4 -0
- package/dist/components/logos/index.d.ts +5 -0
- package/dist/components/logos/microsoft-logo.d.ts +4 -0
- package/dist/components/logos/types.d.ts +14 -0
- package/dist/components/navbar/index.d.ts +2 -0
- package/dist/components/navbar/navbar.d.ts +6 -0
- package/dist/components/navbar/navbar.types.d.ts +24 -0
- package/dist/components/section/index.d.ts +3 -0
- package/dist/components/section/section.a11y.d.ts +11 -0
- package/dist/components/section/section.d.ts +3 -0
- package/dist/components/section/section.types.d.ts +17 -0
- package/dist/components/separator/index.d.ts +3 -0
- package/dist/components/separator/separator.a11y.d.ts +13 -0
- package/dist/components/separator/separator.d.ts +3 -0
- package/dist/components/separator/separator.types.d.ts +16 -0
- package/dist/components/sidebar-layout/index.d.ts +3 -0
- package/dist/components/sidebar-layout/sidebar-layout.a11y.d.ts +15 -0
- package/dist/components/sidebar-layout/sidebar-layout.d.ts +2 -0
- package/dist/components/sidebar-layout/sidebar-layout.types.d.ts +20 -0
- package/dist/components/skeleton/index.d.ts +3 -0
- package/dist/components/skeleton/skeleton.a11y.d.ts +12 -0
- package/dist/components/skeleton/skeleton.d.ts +3 -0
- package/dist/components/skeleton/skeleton.types.d.ts +13 -0
- package/dist/components/spacer/index.d.ts +3 -0
- package/dist/components/spacer/spacer.a11y.d.ts +13 -0
- package/dist/components/spacer/spacer.d.ts +3 -0
- package/dist/components/spacer/spacer.types.d.ts +24 -0
- package/dist/components/spinner/index.d.ts +2 -0
- package/dist/components/spinner/spinner.d.ts +2 -0
- package/dist/components/spinner/spinner.types.d.ts +5 -0
- package/dist/components/stack/index.d.ts +3 -0
- package/dist/components/stack/stack.a11y.d.ts +14 -0
- package/dist/components/stack/stack.d.ts +3 -0
- package/dist/components/stack/stack.types.d.ts +16 -0
- package/dist/components/theme/index.d.ts +2 -0
- package/dist/components/theme/theme.d.ts +40 -0
- package/dist/components/topbar-layout/index.d.ts +3 -0
- package/dist/components/topbar-layout/topbar-layout.a11y.d.ts +13 -0
- package/dist/components/topbar-layout/topbar-layout.d.ts +2 -0
- package/dist/components/topbar-layout/topbar-layout.types.d.ts +12 -0
- package/dist/container/container.d.ts +8 -0
- package/dist/container/container.js +82 -0
- package/dist/container/container.js.map +1 -0
- package/dist/container/container.types.d.ts +28 -0
- package/dist/container/index.d.ts +2 -0
- package/dist/empty-state/empty-state.d.ts +7 -0
- package/dist/empty-state/empty-state.js +39 -0
- package/dist/empty-state/empty-state.js.map +1 -0
- package/dist/empty-state/empty-state.types.d.ts +13 -0
- package/dist/flex/flex.d.ts +9 -0
- package/dist/flex/flex.js +114 -0
- package/dist/flex/flex.js.map +1 -0
- package/dist/flex/flex.types.d.ts +41 -0
- package/dist/flex/index.d.ts +2 -0
- package/dist/grid/grid.d.ts +9 -0
- package/dist/grid/grid.js +115 -0
- package/dist/grid/grid.js.map +1 -0
- package/dist/grid/grid.types.d.ts +40 -0
- package/dist/grid/index.d.ts +2 -0
- package/dist/header/header.d.ts +7 -0
- package/dist/header/header.js +18 -0
- package/dist/header/header.js.map +1 -0
- package/dist/header/header.types.d.ts +9 -0
- package/dist/inline/index.d.ts +7 -0
- package/dist/inline/index.js +13 -0
- package/dist/inline/index.js.map +1 -0
- package/dist/logos/create-logo.js +75 -0
- package/dist/logos/create-logo.js.map +1 -0
- package/dist/logos/github-logo.d.ts +18 -0
- package/dist/logos/github-logo.js +9 -0
- package/dist/logos/github-logo.js.map +1 -0
- package/dist/logos/google-logo.d.ts +18 -0
- package/dist/logos/google-logo.js +23 -0
- package/dist/logos/google-logo.js.map +1 -0
- package/dist/logos/microsoft-logo.d.ts +18 -0
- package/dist/logos/microsoft-logo.js +35 -0
- package/dist/logos/microsoft-logo.js.map +1 -0
- package/dist/logos/types.d.ts +16 -0
- package/dist/navbar/index.d.ts +2 -0
- package/dist/navbar/navbar.d.ts +11 -0
- package/dist/navbar/navbar.js +57 -0
- package/dist/navbar/navbar.js.map +1 -0
- package/dist/navbar/navbar.types.d.ts +29 -0
- package/dist/section/index.d.ts +2 -0
- package/dist/section/section.d.ts +8 -0
- package/dist/section/section.js +40 -0
- package/dist/section/section.js.map +1 -0
- package/dist/section/section.types.d.ts +22 -0
- package/dist/separator/index.d.ts +2 -0
- package/dist/separator/separator.d.ts +8 -0
- package/dist/separator/separator.js +27 -0
- package/dist/separator/separator.js.map +1 -0
- package/dist/separator/separator.types.d.ts +21 -0
- package/dist/sidebar-layout/index.d.ts +2 -0
- package/dist/sidebar-layout/sidebar-layout.d.ts +7 -0
- package/dist/sidebar-layout/sidebar-layout.js +51 -0
- package/dist/sidebar-layout/sidebar-layout.js.map +1 -0
- package/dist/sidebar-layout/sidebar-layout.types.d.ts +20 -0
- package/dist/skeleton/index.d.ts +2 -0
- package/dist/skeleton/skeleton.d.ts +8 -0
- package/dist/skeleton/skeleton.js +26 -0
- package/dist/skeleton/skeleton.js.map +1 -0
- package/dist/skeleton/skeleton.types.d.ts +18 -0
- package/dist/spacer/index.d.ts +2 -0
- package/dist/spacer/spacer.d.ts +8 -0
- package/dist/spacer/spacer.js +47 -0
- package/dist/spacer/spacer.js.map +1 -0
- package/dist/spacer/spacer.types.d.ts +25 -0
- package/dist/spinner/index.d.ts +2 -0
- package/dist/spinner/spinner.d.ts +7 -0
- package/dist/spinner/spinner.js +16 -0
- package/dist/spinner/spinner.js.map +1 -0
- package/dist/spinner/spinner.types.d.ts +10 -0
- package/dist/stack/index.d.ts +2 -0
- package/dist/stack/stack.d.ts +8 -0
- package/dist/stack/stack.js +16 -0
- package/dist/stack/stack.js.map +1 -0
- package/dist/stack/stack.types.d.ts +21 -0
- package/dist/theme/index.d.ts +1 -0
- package/dist/theme/theme.d.ts +44 -0
- package/dist/theme/theme.js +159 -0
- package/dist/theme/theme.js.map +1 -0
- package/dist/topbar-layout/index.d.ts +2 -0
- package/dist/topbar-layout/topbar-layout.d.ts +7 -0
- package/dist/topbar-layout/topbar-layout.js +37 -0
- package/dist/topbar-layout/topbar-layout.js.map +1 -0
- package/dist/topbar-layout/topbar-layout.types.d.ts +13 -0
- package/package.json +122 -0
- package/scripts/new-theme.js +87 -0
- package/src/askr-compat.d.ts +110 -0
- package/src/components/_internal/box-layout.ts +156 -0
- package/src/components/_internal/classes.ts +5 -0
- package/src/components/_internal/jsx.ts +141 -0
- package/src/components/_internal/layout.ts +223 -0
- package/src/components/_internal/merge-props.ts +89 -0
- package/src/components/_internal/style.ts +18 -0
- package/src/components/accessible-icon/accessible-icon.tsx +18 -0
- package/src/components/accessible-icon/accessible-icon.types.ts +5 -0
- package/src/components/accessible-icon/index.ts +2 -0
- package/src/components/aspect-ratio/aspect-ratio.tsx +48 -0
- package/src/components/aspect-ratio/aspect-ratio.types.ts +19 -0
- package/src/components/aspect-ratio/index.ts +2 -0
- package/src/components/badge/badge.a11y.ts +15 -0
- package/src/components/badge/badge.tsx +21 -0
- package/src/components/badge/badge.types.ts +27 -0
- package/src/components/badge/index.ts +3 -0
- package/src/components/box/box.a11y.ts +11 -0
- package/src/components/box/box.tsx +37 -0
- package/src/components/box/box.types.ts +75 -0
- package/src/components/box/index.ts +11 -0
- package/src/components/breadcrumb/breadcrumb.a11y.ts +15 -0
- package/src/components/breadcrumb/breadcrumb.tsx +123 -0
- package/src/components/breadcrumb/breadcrumb.types.ts +73 -0
- package/src/components/breadcrumb/index.ts +24 -0
- package/src/components/card/card.tsx +79 -0
- package/src/components/card/card.types.ts +40 -0
- package/src/components/card/index.ts +12 -0
- package/src/components/container/container.a11y.ts +17 -0
- package/src/components/container/container.tsx +139 -0
- package/src/components/container/container.types.ts +35 -0
- package/src/components/container/index.ts +9 -0
- package/src/components/empty-state/empty-state.tsx +42 -0
- package/src/components/empty-state/empty-state.types.ts +10 -0
- package/src/components/empty-state/index.ts +2 -0
- package/src/components/flex/flex.a11y.ts +19 -0
- package/src/components/flex/flex.tsx +160 -0
- package/src/components/flex/flex.types.ts +50 -0
- package/src/components/flex/index.ts +16 -0
- package/src/components/grid/grid.a11y.ts +22 -0
- package/src/components/grid/grid.tsx +172 -0
- package/src/components/grid/grid.types.ts +45 -0
- package/src/components/grid/index.ts +10 -0
- package/src/components/header/header.a11y.ts +11 -0
- package/src/components/header/header.tsx +18 -0
- package/src/components/header/header.types.ts +6 -0
- package/src/components/header/index.ts +3 -0
- package/src/components/index.ts +107 -0
- package/src/components/inline/index.tsx +28 -0
- package/src/components/logos/create-logo.tsx +103 -0
- package/src/components/logos/github-logo.tsx +13 -0
- package/src/components/logos/google-logo.tsx +34 -0
- package/src/components/logos/index.ts +5 -0
- package/src/components/logos/microsoft-logo.tsx +10 -0
- package/src/components/logos/types.ts +24 -0
- package/src/components/navbar/index.ts +9 -0
- package/src/components/navbar/navbar.tsx +59 -0
- package/src/components/navbar/navbar.types.ts +33 -0
- package/src/components/section/index.ts +8 -0
- package/src/components/section/section.a11y.ts +12 -0
- package/src/components/section/section.tsx +37 -0
- package/src/components/section/section.types.ts +22 -0
- package/src/components/separator/index.ts +12 -0
- package/src/components/separator/separator.a11y.ts +15 -0
- package/src/components/separator/separator.tsx +23 -0
- package/src/components/separator/separator.types.ts +21 -0
- package/src/components/sidebar-layout/index.ts +6 -0
- package/src/components/sidebar-layout/sidebar-layout.a11y.ts +16 -0
- package/src/components/sidebar-layout/sidebar-layout.tsx +59 -0
- package/src/components/sidebar-layout/sidebar-layout.types.ts +22 -0
- package/src/components/skeleton/index.ts +3 -0
- package/src/components/skeleton/skeleton.a11y.ts +14 -0
- package/src/components/skeleton/skeleton.tsx +21 -0
- package/src/components/skeleton/skeleton.types.ts +17 -0
- package/src/components/spacer/index.ts +9 -0
- package/src/components/spacer/spacer.a11y.ts +14 -0
- package/src/components/spacer/spacer.tsx +58 -0
- package/src/components/spacer/spacer.types.ts +30 -0
- package/src/components/spinner/index.ts +2 -0
- package/src/components/spinner/spinner.tsx +21 -0
- package/src/components/spinner/spinner.types.ts +7 -0
- package/src/components/stack/index.ts +3 -0
- package/src/components/stack/stack.a11y.ts +15 -0
- package/src/components/stack/stack.tsx +13 -0
- package/src/components/stack/stack.types.ts +21 -0
- package/src/components/theme/index.ts +10 -0
- package/src/components/theme/theme.tsx +260 -0
- package/src/components/topbar-layout/index.ts +3 -0
- package/src/components/topbar-layout/topbar-layout.a11y.ts +14 -0
- package/src/components/topbar-layout/topbar-layout.tsx +39 -0
- package/src/components/topbar-layout/topbar-layout.types.ts +13 -0
- package/src/css.d.ts +1 -0
- package/src/index.css +1 -0
- package/src/jsx.d.ts +23 -0
- package/src/themes/default/index.css +48 -0
- package/src/themes/default/styles/actions/button.css +196 -0
- package/src/themes/default/styles/actions/toggle-group.css +52 -0
- package/src/themes/default/styles/actions/toggle.css +44 -0
- package/src/themes/default/styles/base/icon.css +10 -0
- package/src/themes/default/styles/base/typography.css +208 -0
- package/src/themes/default/styles/base/utilities.css +223 -0
- package/src/themes/default/styles/disclosure/accordion.css +62 -0
- package/src/themes/default/styles/disclosure/collapsible.css +47 -0
- package/src/themes/default/styles/display/avatar.css +25 -0
- package/src/themes/default/styles/display/badge.css +51 -0
- package/src/themes/default/styles/display/card.css +53 -0
- package/src/themes/default/styles/display/coverage.css +248 -0
- package/src/themes/default/styles/display/progress-circle.css +18 -0
- package/src/themes/default/styles/display/progress.css +18 -0
- package/src/themes/default/styles/display/scroll-area.css +34 -0
- package/src/themes/default/styles/display/separator.css +15 -0
- package/src/themes/default/styles/display/skeleton.css +6 -0
- package/src/themes/default/styles/display/spinner.css +9 -0
- package/src/themes/default/styles/display/table.css +63 -0
- package/src/themes/default/styles/forms/checkbox.css +64 -0
- package/src/themes/default/styles/forms/form.css +5 -0
- package/src/themes/default/styles/forms/input.css +49 -0
- package/src/themes/default/styles/forms/label.css +6 -0
- package/src/themes/default/styles/forms/radio-group.css +53 -0
- package/src/themes/default/styles/forms/select.css +143 -0
- package/src/themes/default/styles/forms/slider.css +75 -0
- package/src/themes/default/styles/forms/switch.css +70 -0
- package/src/themes/default/styles/forms/textarea.css +37 -0
- package/src/themes/default/styles/layout/aspect-ratio.css +5 -0
- package/src/themes/default/styles/layout/dashboard-layout.css +15 -0
- package/src/themes/default/styles/layout/docs-layout.css +10 -0
- package/src/themes/default/styles/layout/layout.css +946 -0
- package/src/themes/default/styles/layout/patterns.css +43 -0
- package/src/themes/default/styles/layout/responsive-layout.css +209 -0
- package/src/themes/default/styles/layout/sidebar.css +10 -0
- package/src/themes/default/styles/navigation/breadcrumb.css +39 -0
- package/src/themes/default/styles/navigation/menu.css +60 -0
- package/src/themes/default/styles/navigation/menubar.css +89 -0
- package/src/themes/default/styles/navigation/navigation-menu.css +90 -0
- package/src/themes/default/styles/navigation/tabs.css +61 -0
- package/src/themes/default/styles/overlays/alert-dialog.css +9 -0
- package/src/themes/default/styles/overlays/dialog.css +116 -0
- package/src/themes/default/styles/overlays/dropdown-menu.css +109 -0
- package/src/themes/default/styles/overlays/hover-card.css +46 -0
- package/src/themes/default/styles/overlays/popover.css +72 -0
- package/src/themes/default/styles/overlays/toast.css +123 -0
- package/src/themes/default/styles/overlays/tooltip.css +83 -0
- package/src/themes/default/styles/shell/header.css +36 -0
- package/src/themes/default/styles/shell/navbar.css +158 -0
- package/src/themes/default/styles/shell/theme.css +35 -0
- package/src/themes/default/tokens.css +316 -0
- package/templates/theme/index.css +48 -0
- package/templates/theme/styles/actions/button.css +196 -0
- package/templates/theme/styles/actions/toggle-group.css +52 -0
- package/templates/theme/styles/actions/toggle.css +44 -0
- package/templates/theme/styles/base/icon.css +10 -0
- package/templates/theme/styles/base/typography.css +208 -0
- package/templates/theme/styles/base/utilities.css +19 -0
- package/templates/theme/styles/disclosure/accordion.css +62 -0
- package/templates/theme/styles/disclosure/collapsible.css +47 -0
- package/templates/theme/styles/display/avatar.css +25 -0
- package/templates/theme/styles/display/badge.css +51 -0
- package/templates/theme/styles/display/card.css +53 -0
- package/templates/theme/styles/display/coverage.css +146 -0
- package/templates/theme/styles/display/progress-circle.css +18 -0
- package/templates/theme/styles/display/progress.css +18 -0
- package/templates/theme/styles/display/scroll-area.css +34 -0
- package/templates/theme/styles/display/separator.css +15 -0
- package/templates/theme/styles/display/skeleton.css +6 -0
- package/templates/theme/styles/display/spinner.css +9 -0
- package/templates/theme/styles/display/table.css +63 -0
- package/templates/theme/styles/forms/checkbox.css +64 -0
- package/templates/theme/styles/forms/form.css +5 -0
- package/templates/theme/styles/forms/input.css +49 -0
- package/templates/theme/styles/forms/label.css +6 -0
- package/templates/theme/styles/forms/radio-group.css +53 -0
- package/templates/theme/styles/forms/select.css +143 -0
- package/templates/theme/styles/forms/slider.css +75 -0
- package/templates/theme/styles/forms/switch.css +70 -0
- package/templates/theme/styles/forms/textarea.css +37 -0
- package/templates/theme/styles/layout/aspect-ratio.css +5 -0
- package/templates/theme/styles/layout/dashboard-layout.css +16 -0
- package/templates/theme/styles/layout/docs-layout.css +11 -0
- package/templates/theme/styles/layout/layout.css +1 -0
- package/templates/theme/styles/layout/patterns.css +43 -0
- package/templates/theme/styles/layout/responsive-layout.css +209 -0
- package/templates/theme/styles/layout/sidebar.css +11 -0
- package/templates/theme/styles/navigation/breadcrumb.css +31 -0
- package/templates/theme/styles/navigation/menu.css +60 -0
- package/templates/theme/styles/navigation/menubar.css +89 -0
- package/templates/theme/styles/navigation/navigation-menu.css +90 -0
- package/templates/theme/styles/navigation/tabs.css +61 -0
- package/templates/theme/styles/overlays/alert-dialog.css +9 -0
- package/templates/theme/styles/overlays/dialog.css +116 -0
- package/templates/theme/styles/overlays/dropdown-menu.css +109 -0
- package/templates/theme/styles/overlays/hover-card.css +46 -0
- package/templates/theme/styles/overlays/popover.css +72 -0
- package/templates/theme/styles/overlays/toast.css +123 -0
- package/templates/theme/styles/overlays/tooltip.css +83 -0
- package/templates/theme/styles/shell/header.css +36 -0
- package/templates/theme/styles/shell/navbar.css +158 -0
- package/templates/theme/styles/shell/theme.css +35 -0
- package/templates/theme/tokens.css +316 -0
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { Slot } from "@askrjs/askr/foundations";
|
|
2
|
+
import { mergeProps } from "../_internal/merge-props";
|
|
3
|
+
import {
|
|
4
|
+
applyBoxLayoutStyles,
|
|
5
|
+
splitBoxLayoutProps,
|
|
6
|
+
withBoxLayoutStyle,
|
|
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 finalProps = mergeProps(passthroughProps, {
|
|
137
|
+
ref,
|
|
138
|
+
"data-slot": rootSlot,
|
|
139
|
+
"data-ak-layout": "true",
|
|
140
|
+
"data-direction": serializeStaticThemeValue(direction, isCssCoveredDirectionValue),
|
|
141
|
+
"data-gap": serializeStaticThemeValue(gap, isCssCoveredSpaceValue),
|
|
142
|
+
"data-gap-x": serializeStaticThemeValue(gapX, isCssCoveredSpaceValue),
|
|
143
|
+
"data-gap-y": serializeStaticThemeValue(gapY, isCssCoveredSpaceValue),
|
|
144
|
+
"data-align": serializeStaticThemeValue(align, isCssCoveredAlignValue),
|
|
145
|
+
"data-justify": serializeStaticThemeValue(justify, isCssCoveredJustifyValue),
|
|
146
|
+
"data-wrap": serializeStaticThemeValue(wrap, isCssCoveredWrapValue),
|
|
147
|
+
"data-collapse-below": collapseBelow,
|
|
148
|
+
style: withBoxLayoutStyle(layoutStyle, userStyle),
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
if (asChild) {
|
|
152
|
+
return <Slot asChild {...finalProps} children={children as JSX.Element} />;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
if (as === "span") {
|
|
156
|
+
return <span {...finalProps}>{children}</span>;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
return <div {...finalProps}>{children}</div>;
|
|
160
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { JSXElement, Ref } from "@askrjs/askr/foundations";
|
|
2
|
+
import type { BoxLayoutOwnProps, LayoutResponsive } from "../box/box.types";
|
|
3
|
+
|
|
4
|
+
export type FlexOwnProps = BoxLayoutOwnProps & {
|
|
5
|
+
direction?: LayoutResponsive<"row" | "column" | "row-reverse" | "column-reverse">;
|
|
6
|
+
gap?: LayoutResponsive<string | number>;
|
|
7
|
+
gapX?: LayoutResponsive<string | number>;
|
|
8
|
+
gapY?: LayoutResponsive<string | number>;
|
|
9
|
+
align?: LayoutResponsive<string>;
|
|
10
|
+
justify?: LayoutResponsive<string>;
|
|
11
|
+
wrap?: LayoutResponsive<"wrap" | "nowrap" | "wrap-reverse">;
|
|
12
|
+
/**
|
|
13
|
+
* Compatibility breakpoint helper. Prefer responsive `direction` instead.
|
|
14
|
+
*/
|
|
15
|
+
collapseBelow?: string;
|
|
16
|
+
as?: "div" | "span";
|
|
17
|
+
children?: unknown;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type FlexNativeProps = Omit<JSX.IntrinsicElements["div"], "children" | "ref"> &
|
|
21
|
+
FlexOwnProps & {
|
|
22
|
+
as?: "div";
|
|
23
|
+
asChild?: false;
|
|
24
|
+
ref?: Ref<HTMLDivElement>;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type FlexSpanProps = Omit<JSX.IntrinsicElements["span"], "children" | "ref"> &
|
|
28
|
+
FlexOwnProps & {
|
|
29
|
+
as: "span";
|
|
30
|
+
asChild?: false;
|
|
31
|
+
ref?: Ref<HTMLSpanElement>;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export type FlexAsChildProps = Omit<FlexOwnProps, "as"> & {
|
|
35
|
+
asChild: true;
|
|
36
|
+
children: JSXElement;
|
|
37
|
+
ref?: Ref<unknown>;
|
|
38
|
+
style?: JSX.IntrinsicElements["div"]["style"];
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export type FlexDivProps = FlexNativeProps;
|
|
42
|
+
|
|
43
|
+
export type FlexProps = FlexDivProps | FlexSpanProps | FlexAsChildProps;
|
|
44
|
+
|
|
45
|
+
export type InlineOwnProps = FlexOwnProps;
|
|
46
|
+
export type InlineNativeProps = FlexNativeProps;
|
|
47
|
+
export type InlineDivProps = FlexDivProps;
|
|
48
|
+
export type InlineSpanProps = FlexSpanProps;
|
|
49
|
+
export type InlineAsChildProps = FlexAsChildProps;
|
|
50
|
+
export type InlineProps = FlexProps;
|
|
@@ -0,0 +1,16 @@
|
|
|
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";
|
|
@@ -0,0 +1,22 @@
|
|
|
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;
|
|
@@ -0,0 +1,172 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
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;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const HEADER_A11Y_CONTRACT = {
|
|
2
|
+
DATA_ATTRIBUTES: {
|
|
3
|
+
slot: "data-slot" as const,
|
|
4
|
+
position: "data-position" as const,
|
|
5
|
+
},
|
|
6
|
+
SLOT_VALUES: {
|
|
7
|
+
root: "header" as const,
|
|
8
|
+
},
|
|
9
|
+
} as const;
|
|
10
|
+
|
|
11
|
+
export type HeaderA11yContract = typeof HEADER_A11Y_CONTRACT;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { classes } from "../_internal/classes";
|
|
2
|
+
import type { HeaderProps } from "./header.types";
|
|
3
|
+
|
|
4
|
+
export function Header(props: HeaderProps): JSX.Element {
|
|
5
|
+
const { children, position = "static", ref, class: className, ...rest } = props;
|
|
6
|
+
|
|
7
|
+
return (
|
|
8
|
+
<header
|
|
9
|
+
{...rest}
|
|
10
|
+
ref={ref}
|
|
11
|
+
class={classes("header", className)}
|
|
12
|
+
data-slot="header"
|
|
13
|
+
data-position={position}
|
|
14
|
+
>
|
|
15
|
+
{children}
|
|
16
|
+
</header>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
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 } from "./navbar";
|
|
96
|
+
export type {
|
|
97
|
+
NavBrandProps,
|
|
98
|
+
NavbarProps,
|
|
99
|
+
NavGroupProps,
|
|
100
|
+
NavItemAsChildProps,
|
|
101
|
+
NavItemProps,
|
|
102
|
+
NavItemVariant,
|
|
103
|
+
} from "./navbar";
|
|
104
|
+
export { SidebarLayout } from "./sidebar-layout";
|
|
105
|
+
export type { SidebarLayoutProps, SidebarPosition } from "./sidebar-layout";
|
|
106
|
+
export { TopbarLayout } from "./topbar-layout";
|
|
107
|
+
export type { TopbarLayoutProps } from "./topbar-layout";
|
|
@@ -0,0 +1,28 @@
|
|
|
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";
|