@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,123 @@
|
|
|
1
|
+
import { Slot } from "@askrjs/askr/foundations";
|
|
2
|
+
import { mergeProps } from "../_internal/merge-props";
|
|
3
|
+
import type {
|
|
4
|
+
BreadcrumbAsChildProps,
|
|
5
|
+
BreadcrumbCurrentAsChildProps,
|
|
6
|
+
BreadcrumbCurrentProps,
|
|
7
|
+
BreadcrumbItemAsChildProps,
|
|
8
|
+
BreadcrumbItemProps,
|
|
9
|
+
BreadcrumbLinkAsChildProps,
|
|
10
|
+
BreadcrumbLinkProps,
|
|
11
|
+
BreadcrumbListAsChildProps,
|
|
12
|
+
BreadcrumbListProps,
|
|
13
|
+
BreadcrumbProps,
|
|
14
|
+
BreadcrumbSeparatorAsChildProps,
|
|
15
|
+
BreadcrumbSeparatorProps,
|
|
16
|
+
} from "./breadcrumb.types";
|
|
17
|
+
|
|
18
|
+
export function Breadcrumb(props: BreadcrumbProps): JSX.Element;
|
|
19
|
+
export function Breadcrumb(props: BreadcrumbAsChildProps): JSX.Element;
|
|
20
|
+
export function Breadcrumb(props: BreadcrumbProps | BreadcrumbAsChildProps) {
|
|
21
|
+
const { asChild, children, ref, "aria-label": ariaLabel, ...rest } = props;
|
|
22
|
+
const finalProps = mergeProps(rest, {
|
|
23
|
+
ref,
|
|
24
|
+
"aria-label": ariaLabel ?? "Breadcrumb",
|
|
25
|
+
"data-slot": "breadcrumb",
|
|
26
|
+
"data-breadcrumb": "true",
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
if (asChild) {
|
|
30
|
+
return <Slot asChild {...finalProps} children={children} />;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return <nav {...finalProps}>{children}</nav>;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function BreadcrumbList(props: BreadcrumbListProps): JSX.Element;
|
|
37
|
+
export function BreadcrumbList(props: BreadcrumbListAsChildProps): JSX.Element;
|
|
38
|
+
export function BreadcrumbList(props: BreadcrumbListProps | BreadcrumbListAsChildProps) {
|
|
39
|
+
const { asChild, children, ref, ...rest } = props;
|
|
40
|
+
const finalProps = mergeProps(rest, {
|
|
41
|
+
ref,
|
|
42
|
+
"data-slot": "breadcrumb-list",
|
|
43
|
+
"data-breadcrumb-list": "true",
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
if (asChild) {
|
|
47
|
+
return <Slot asChild {...finalProps} children={children} />;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return <ol {...finalProps}>{children}</ol>;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function BreadcrumbItem(props: BreadcrumbItemProps): JSX.Element;
|
|
54
|
+
export function BreadcrumbItem(props: BreadcrumbItemAsChildProps): JSX.Element;
|
|
55
|
+
export function BreadcrumbItem(props: BreadcrumbItemProps | BreadcrumbItemAsChildProps) {
|
|
56
|
+
const { asChild, children, ref, ...rest } = props;
|
|
57
|
+
const finalProps = mergeProps(rest, {
|
|
58
|
+
ref,
|
|
59
|
+
"data-slot": "breadcrumb-item",
|
|
60
|
+
"data-breadcrumb-item": "true",
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
if (asChild) {
|
|
64
|
+
return <Slot asChild {...finalProps} children={children} />;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return <li {...finalProps}>{children}</li>;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function BreadcrumbLink(props: BreadcrumbLinkProps): JSX.Element;
|
|
71
|
+
export function BreadcrumbLink(props: BreadcrumbLinkAsChildProps): JSX.Element;
|
|
72
|
+
export function BreadcrumbLink(props: BreadcrumbLinkProps | BreadcrumbLinkAsChildProps) {
|
|
73
|
+
const { asChild, children, ref, ...rest } = props;
|
|
74
|
+
const finalProps = mergeProps(rest, {
|
|
75
|
+
ref,
|
|
76
|
+
"data-slot": "breadcrumb-link",
|
|
77
|
+
"data-breadcrumb-link": "true",
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
if (asChild) {
|
|
81
|
+
return <Slot asChild {...finalProps} children={children} />;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return <a {...finalProps}>{children}</a>;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export function BreadcrumbCurrent(props: BreadcrumbCurrentProps): JSX.Element;
|
|
88
|
+
export function BreadcrumbCurrent(props: BreadcrumbCurrentAsChildProps): JSX.Element;
|
|
89
|
+
export function BreadcrumbCurrent(props: BreadcrumbCurrentProps | BreadcrumbCurrentAsChildProps) {
|
|
90
|
+
const { asChild, children, ref, ...rest } = props;
|
|
91
|
+
const finalProps = mergeProps(rest, {
|
|
92
|
+
ref,
|
|
93
|
+
"aria-current": "page",
|
|
94
|
+
"data-slot": "breadcrumb-current",
|
|
95
|
+
"data-breadcrumb-current": "true",
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
if (asChild) {
|
|
99
|
+
return <Slot asChild {...finalProps} children={children} />;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return <span {...finalProps}>{children}</span>;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export function BreadcrumbSeparator(props: BreadcrumbSeparatorProps): JSX.Element;
|
|
106
|
+
export function BreadcrumbSeparator(props: BreadcrumbSeparatorAsChildProps): JSX.Element;
|
|
107
|
+
export function BreadcrumbSeparator(
|
|
108
|
+
props: BreadcrumbSeparatorProps | BreadcrumbSeparatorAsChildProps,
|
|
109
|
+
) {
|
|
110
|
+
const { asChild, children, ref, ...rest } = props;
|
|
111
|
+
const finalProps = mergeProps(rest, {
|
|
112
|
+
ref,
|
|
113
|
+
"aria-hidden": "true",
|
|
114
|
+
"data-slot": "breadcrumb-separator",
|
|
115
|
+
"data-breadcrumb-separator": "true",
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
if (asChild) {
|
|
119
|
+
return <Slot asChild {...finalProps} children={children ?? "/"} />;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return <span {...finalProps}>{children ?? "/"}</span>;
|
|
123
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { JSXElement, Ref } from "@askrjs/askr/foundations";
|
|
2
|
+
|
|
3
|
+
export type BreadcrumbOwnProps = {
|
|
4
|
+
children?: unknown;
|
|
5
|
+
"aria-label"?: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export type BreadcrumbProps = Omit<JSX.IntrinsicElements["nav"], "children" | "ref"> &
|
|
9
|
+
BreadcrumbOwnProps & {
|
|
10
|
+
asChild?: false;
|
|
11
|
+
ref?: Ref<HTMLElement>;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type BreadcrumbAsChildProps = BreadcrumbOwnProps & {
|
|
15
|
+
asChild: true;
|
|
16
|
+
children: JSXElement;
|
|
17
|
+
ref?: Ref<unknown>;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type BreadcrumbListProps = Omit<JSX.IntrinsicElements["ol"], "children" | "ref"> & {
|
|
21
|
+
asChild?: false;
|
|
22
|
+
ref?: Ref<HTMLOListElement>;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export type BreadcrumbListAsChildProps = {
|
|
26
|
+
asChild: true;
|
|
27
|
+
children: JSXElement;
|
|
28
|
+
ref?: Ref<unknown>;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export type BreadcrumbItemProps = Omit<JSX.IntrinsicElements["li"], "children" | "ref"> & {
|
|
32
|
+
asChild?: false;
|
|
33
|
+
ref?: Ref<HTMLLIElement>;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export type BreadcrumbItemAsChildProps = {
|
|
37
|
+
asChild: true;
|
|
38
|
+
children: JSXElement;
|
|
39
|
+
ref?: Ref<unknown>;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export type BreadcrumbLinkProps = Omit<JSX.IntrinsicElements["a"], "children" | "ref"> & {
|
|
43
|
+
asChild?: false;
|
|
44
|
+
ref?: Ref<HTMLAnchorElement>;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export type BreadcrumbLinkAsChildProps = {
|
|
48
|
+
asChild: true;
|
|
49
|
+
children: JSXElement;
|
|
50
|
+
ref?: Ref<unknown>;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export type BreadcrumbCurrentProps = Omit<JSX.IntrinsicElements["span"], "children" | "ref"> & {
|
|
54
|
+
asChild?: false;
|
|
55
|
+
ref?: Ref<HTMLSpanElement>;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export type BreadcrumbCurrentAsChildProps = {
|
|
59
|
+
asChild: true;
|
|
60
|
+
children: JSXElement;
|
|
61
|
+
ref?: Ref<unknown>;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export type BreadcrumbSeparatorProps = Omit<JSX.IntrinsicElements["span"], "children" | "ref"> & {
|
|
65
|
+
asChild?: false;
|
|
66
|
+
ref?: Ref<HTMLSpanElement>;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export type BreadcrumbSeparatorAsChildProps = {
|
|
70
|
+
asChild: true;
|
|
71
|
+
children: JSXElement;
|
|
72
|
+
ref?: Ref<unknown>;
|
|
73
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export {
|
|
2
|
+
Breadcrumb,
|
|
3
|
+
BreadcrumbList,
|
|
4
|
+
BreadcrumbItem,
|
|
5
|
+
BreadcrumbLink,
|
|
6
|
+
BreadcrumbCurrent,
|
|
7
|
+
BreadcrumbSeparator,
|
|
8
|
+
} from "./breadcrumb";
|
|
9
|
+
export { BREADCRUMB_A11Y_CONTRACT, type BreadcrumbA11yContract } from "./breadcrumb.a11y";
|
|
10
|
+
export type {
|
|
11
|
+
BreadcrumbOwnProps,
|
|
12
|
+
BreadcrumbProps,
|
|
13
|
+
BreadcrumbAsChildProps,
|
|
14
|
+
BreadcrumbListProps,
|
|
15
|
+
BreadcrumbListAsChildProps,
|
|
16
|
+
BreadcrumbItemProps,
|
|
17
|
+
BreadcrumbItemAsChildProps,
|
|
18
|
+
BreadcrumbLinkProps,
|
|
19
|
+
BreadcrumbLinkAsChildProps,
|
|
20
|
+
BreadcrumbCurrentProps,
|
|
21
|
+
BreadcrumbCurrentAsChildProps,
|
|
22
|
+
BreadcrumbSeparatorProps,
|
|
23
|
+
BreadcrumbSeparatorAsChildProps,
|
|
24
|
+
} from "./breadcrumb.types";
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
CardContentProps,
|
|
3
|
+
CardDescriptionProps,
|
|
4
|
+
CardFooterProps,
|
|
5
|
+
CardHeaderProps,
|
|
6
|
+
CardPadding,
|
|
7
|
+
CardProps,
|
|
8
|
+
CardTitleProps,
|
|
9
|
+
CardVariant,
|
|
10
|
+
} from "./card.types";
|
|
11
|
+
|
|
12
|
+
function normalizePadding(padding: CardPadding | undefined) {
|
|
13
|
+
return padding && padding !== "md" ? padding : undefined;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function normalizeVariant(variant: CardVariant | undefined) {
|
|
17
|
+
return variant && variant !== "default" ? variant : undefined;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function Card(props: CardProps): JSX.Element {
|
|
21
|
+
const { children, variant, padding = "md", ref, ...rest } = props;
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<div
|
|
25
|
+
{...rest}
|
|
26
|
+
ref={ref}
|
|
27
|
+
data-slot="card"
|
|
28
|
+
data-variant={normalizeVariant(variant)}
|
|
29
|
+
data-padding={normalizePadding(padding)}
|
|
30
|
+
>
|
|
31
|
+
{children}
|
|
32
|
+
</div>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function CardHeader(props: CardHeaderProps): JSX.Element {
|
|
37
|
+
const { children, ref, ...rest } = props;
|
|
38
|
+
return (
|
|
39
|
+
<div {...rest} ref={ref} data-slot="card-header">
|
|
40
|
+
{children}
|
|
41
|
+
</div>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function CardTitle(props: CardTitleProps): JSX.Element {
|
|
46
|
+
const { children, ref, ...rest } = props;
|
|
47
|
+
return (
|
|
48
|
+
<h3 {...rest} ref={ref} data-slot="card-title">
|
|
49
|
+
{children}
|
|
50
|
+
</h3>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function CardDescription(props: CardDescriptionProps): JSX.Element {
|
|
55
|
+
const { children, ref, ...rest } = props;
|
|
56
|
+
return (
|
|
57
|
+
<p {...rest} ref={ref} data-slot="card-description">
|
|
58
|
+
{children}
|
|
59
|
+
</p>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function CardContent(props: CardContentProps): JSX.Element {
|
|
64
|
+
const { children, ref, ...rest } = props;
|
|
65
|
+
return (
|
|
66
|
+
<div {...rest} ref={ref} data-slot="card-content">
|
|
67
|
+
{children}
|
|
68
|
+
</div>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function CardFooter(props: CardFooterProps): JSX.Element {
|
|
73
|
+
const { children, ref, ...rest } = props;
|
|
74
|
+
return (
|
|
75
|
+
<div {...rest} ref={ref} data-slot="card-footer">
|
|
76
|
+
{children}
|
|
77
|
+
</div>
|
|
78
|
+
);
|
|
79
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Ref } from "@askrjs/askr/foundations";
|
|
2
|
+
|
|
3
|
+
export type CardVariant = "default" | "raised";
|
|
4
|
+
export type CardPadding = "sm" | "md" | "lg";
|
|
5
|
+
|
|
6
|
+
type DivProps = Omit<JSX.IntrinsicElements["div"], "children" | "ref">;
|
|
7
|
+
type HeadingProps = Omit<JSX.IntrinsicElements["h3"], "children" | "ref">;
|
|
8
|
+
type ParagraphProps = Omit<JSX.IntrinsicElements["p"], "children" | "ref">;
|
|
9
|
+
|
|
10
|
+
export type CardProps = DivProps & {
|
|
11
|
+
children?: unknown;
|
|
12
|
+
variant?: CardVariant;
|
|
13
|
+
padding?: CardPadding;
|
|
14
|
+
ref?: Ref<HTMLDivElement>;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type CardHeaderProps = DivProps & {
|
|
18
|
+
children?: unknown;
|
|
19
|
+
ref?: Ref<HTMLDivElement>;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type CardContentProps = DivProps & {
|
|
23
|
+
children?: unknown;
|
|
24
|
+
ref?: Ref<HTMLDivElement>;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type CardFooterProps = DivProps & {
|
|
28
|
+
children?: unknown;
|
|
29
|
+
ref?: Ref<HTMLDivElement>;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export type CardTitleProps = HeadingProps & {
|
|
33
|
+
children?: unknown;
|
|
34
|
+
ref?: Ref<HTMLHeadingElement>;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export type CardDescriptionProps = ParagraphProps & {
|
|
38
|
+
children?: unknown;
|
|
39
|
+
ref?: Ref<HTMLParagraphElement>;
|
|
40
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "./card";
|
|
2
|
+
|
|
3
|
+
export type {
|
|
4
|
+
CardContentProps,
|
|
5
|
+
CardDescriptionProps,
|
|
6
|
+
CardFooterProps,
|
|
7
|
+
CardHeaderProps,
|
|
8
|
+
CardPadding,
|
|
9
|
+
CardProps,
|
|
10
|
+
CardTitleProps,
|
|
11
|
+
CardVariant,
|
|
12
|
+
} from "./card.types";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const CONTAINER_A11Y_CONTRACT = {
|
|
2
|
+
DATA_ATTRIBUTES: {
|
|
3
|
+
slot: "data-slot" as const,
|
|
4
|
+
layout: "data-ak-layout" as const,
|
|
5
|
+
variant: "data-variant" as const,
|
|
6
|
+
fluid: "data-fluid" as const,
|
|
7
|
+
maxWidth: "data-max-width" as const,
|
|
8
|
+
padding: "data-padding" as const,
|
|
9
|
+
size: "data-size" as const,
|
|
10
|
+
align: "data-align" as const,
|
|
11
|
+
},
|
|
12
|
+
SLOT_VALUES: {
|
|
13
|
+
root: "container" as const,
|
|
14
|
+
},
|
|
15
|
+
} as const;
|
|
16
|
+
|
|
17
|
+
export type ContainerA11yContract = typeof CONTAINER_A11Y_CONTRACT;
|
|
@@ -0,0 +1,139 @@
|
|
|
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
|
+
resolveContainerSizeValue,
|
|
11
|
+
resolveInlineAlignValue,
|
|
12
|
+
resolveSpaceValue,
|
|
13
|
+
serializeResponsiveValueIf,
|
|
14
|
+
setResponsiveStyleVar,
|
|
15
|
+
} from "../_internal/layout";
|
|
16
|
+
import type { ContainerAsChildProps, ContainerNativeProps } from "./container.types";
|
|
17
|
+
|
|
18
|
+
const CONTAINER_WIDTH_TOKENS = new Set(["1", "2", "3", "4", "sm", "md", "lg", "xl"]);
|
|
19
|
+
|
|
20
|
+
function isContainerWidthToken(value: unknown): value is string {
|
|
21
|
+
return typeof value === "string" && CONTAINER_WIDTH_TOKENS.has(value.trim());
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function isContainerAlignToken(value: unknown): value is "left" | "center" | "right" {
|
|
25
|
+
return typeof value === "string" && ["left", "center", "right"].includes(value.trim());
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function hasStyleValue(value: unknown): boolean {
|
|
29
|
+
if (typeof value === "string") return value.trim().length > 0;
|
|
30
|
+
if (value && typeof value === "object") {
|
|
31
|
+
return Object.keys(value as Record<string, unknown>).length > 0;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function isStaticValue(value: unknown): boolean {
|
|
38
|
+
return !isResponsiveValue(value as Record<string, unknown> | undefined);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function Container(props: ContainerNativeProps): JSX.Element;
|
|
42
|
+
export function Container(props: ContainerAsChildProps): JSX.Element;
|
|
43
|
+
export function Container(props: ContainerNativeProps | ContainerAsChildProps) {
|
|
44
|
+
const {
|
|
45
|
+
asChild,
|
|
46
|
+
children,
|
|
47
|
+
variant,
|
|
48
|
+
fluid = false,
|
|
49
|
+
maxWidth,
|
|
50
|
+
padding,
|
|
51
|
+
size,
|
|
52
|
+
align = "center",
|
|
53
|
+
ref,
|
|
54
|
+
style: userStyle,
|
|
55
|
+
...rest
|
|
56
|
+
} = props;
|
|
57
|
+
|
|
58
|
+
const responsiveVariant =
|
|
59
|
+
fluid || (size === undefined && maxWidth === undefined)
|
|
60
|
+
? fluid
|
|
61
|
+
? "fluid"
|
|
62
|
+
: (variant ?? "default")
|
|
63
|
+
: undefined;
|
|
64
|
+
|
|
65
|
+
const { boxProps, rest: passthroughProps } = splitBoxLayoutProps(rest);
|
|
66
|
+
const layoutStyle: Record<string, string | number> = {
|
|
67
|
+
boxSizing: "border-box",
|
|
68
|
+
width: "100%",
|
|
69
|
+
};
|
|
70
|
+
applyBoxLayoutStyles(layoutStyle, boxProps);
|
|
71
|
+
|
|
72
|
+
const widthValue = fluid ? undefined : (maxWidth ?? size);
|
|
73
|
+
const usesInlineMaxWidth =
|
|
74
|
+
boxProps.maxWidth === undefined &&
|
|
75
|
+
widthValue !== undefined &&
|
|
76
|
+
(isResponsiveValue(widthValue) || !isContainerWidthToken(widthValue));
|
|
77
|
+
|
|
78
|
+
if (usesInlineMaxWidth) {
|
|
79
|
+
setResponsiveStyleVar(layoutStyle, "max-width", widthValue, (value) =>
|
|
80
|
+
typeof value === "string" && isContainerWidthToken(value)
|
|
81
|
+
? resolveContainerSizeValue(value)
|
|
82
|
+
: value,
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (
|
|
87
|
+
padding !== undefined &&
|
|
88
|
+
boxProps.px === undefined &&
|
|
89
|
+
boxProps.pl === undefined &&
|
|
90
|
+
boxProps.pr === undefined
|
|
91
|
+
) {
|
|
92
|
+
setResponsiveStyleVar(layoutStyle, "px", padding, resolveSpaceValue);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const applyAlign = (side: "marginLeft" | "marginRight", value: typeof align) => {
|
|
96
|
+
setResponsiveStyleVar(layoutStyle, side === "marginLeft" ? "ml" : "mr", value, (input) => {
|
|
97
|
+
const margins = resolveInlineAlignValue(input);
|
|
98
|
+
return side === "marginLeft" ? margins.marginLeft : margins.marginRight;
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
if (boxProps.ml === undefined && boxProps.mr === undefined && isResponsiveValue(align)) {
|
|
103
|
+
applyAlign("marginLeft", align);
|
|
104
|
+
applyAlign("marginRight", align);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const mergedStyle =
|
|
108
|
+
Object.keys(layoutStyle).length > 2 || hasStyleValue(userStyle)
|
|
109
|
+
? withBoxLayoutStyle(layoutStyle, userStyle)
|
|
110
|
+
: undefined;
|
|
111
|
+
|
|
112
|
+
const finalProps = mergeProps(passthroughProps, {
|
|
113
|
+
ref,
|
|
114
|
+
"data-slot": "container",
|
|
115
|
+
"data-ak-layout": "true",
|
|
116
|
+
"data-variant": responsiveVariant,
|
|
117
|
+
"data-fluid": fluid ? "true" : undefined,
|
|
118
|
+
"data-size": fluid
|
|
119
|
+
? undefined
|
|
120
|
+
: isStaticValue(size)
|
|
121
|
+
? serializeResponsiveValueIf(size, isContainerWidthToken)
|
|
122
|
+
: undefined,
|
|
123
|
+
"data-align": isStaticValue(align)
|
|
124
|
+
? serializeResponsiveValueIf(align, isContainerAlignToken)
|
|
125
|
+
: undefined,
|
|
126
|
+
"data-max-width": fluid
|
|
127
|
+
? undefined
|
|
128
|
+
: isStaticValue(maxWidth)
|
|
129
|
+
? serializeResponsiveValueIf(maxWidth, isContainerWidthToken)
|
|
130
|
+
: undefined,
|
|
131
|
+
style: mergedStyle,
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
if (asChild) {
|
|
135
|
+
return <Slot asChild {...finalProps} children={children} />;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return <div {...finalProps}>{children}</div>;
|
|
139
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { JSXElement, Ref } from "@askrjs/askr/foundations";
|
|
2
|
+
import type { BoxLayoutOwnProps, LayoutResponsive } from "../box/box.types";
|
|
3
|
+
|
|
4
|
+
export type ContainerVariant = "default" | "sm" | "md" | "lg" | "xl" | "xxl" | "fluid";
|
|
5
|
+
|
|
6
|
+
export type ContainerOwnProps = BoxLayoutOwnProps & {
|
|
7
|
+
/** Bootstrap-like responsive container variant. */
|
|
8
|
+
variant?: ContainerVariant;
|
|
9
|
+
/** Makes the container span the full available width while preserving gutters. */
|
|
10
|
+
fluid?: boolean;
|
|
11
|
+
/** Radix-style container size token. */
|
|
12
|
+
size?: LayoutResponsive<"1" | "2" | "3" | "4" | "sm" | "md" | "lg" | "xl">;
|
|
13
|
+
/** Horizontal alignment of the constrained container. */
|
|
14
|
+
align?: LayoutResponsive<"left" | "center" | "right">;
|
|
15
|
+
/** Compatibility max-width override. */
|
|
16
|
+
maxWidth?: LayoutResponsive<string>;
|
|
17
|
+
/** Compatibility horizontal padding override. */
|
|
18
|
+
padding?: LayoutResponsive<string | number>;
|
|
19
|
+
children?: unknown;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type ContainerNativeProps = Omit<JSX.IntrinsicElements["div"], "children" | "ref"> &
|
|
23
|
+
ContainerOwnProps & {
|
|
24
|
+
asChild?: false;
|
|
25
|
+
ref?: Ref<HTMLDivElement>;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export type ContainerAsChildProps = ContainerOwnProps & {
|
|
29
|
+
asChild: true;
|
|
30
|
+
children: JSXElement;
|
|
31
|
+
ref?: Ref<unknown>;
|
|
32
|
+
style?: JSX.IntrinsicElements["div"]["style"];
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export type ContainerProps = ContainerNativeProps | ContainerAsChildProps;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { Container } from "./container";
|
|
2
|
+
export { CONTAINER_A11Y_CONTRACT, type ContainerA11yContract } from "./container.a11y";
|
|
3
|
+
export type {
|
|
4
|
+
ContainerProps,
|
|
5
|
+
ContainerVariant,
|
|
6
|
+
ContainerOwnProps,
|
|
7
|
+
ContainerNativeProps,
|
|
8
|
+
ContainerAsChildProps,
|
|
9
|
+
} from "./container.types";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { classes } from "../_internal/classes";
|
|
2
|
+
import type { EmptyStateProps } from "./empty-state.types";
|
|
3
|
+
|
|
4
|
+
export function EmptyState(props: EmptyStateProps): JSX.Element {
|
|
5
|
+
const {
|
|
6
|
+
icon,
|
|
7
|
+
title,
|
|
8
|
+
titleAs: TitleTag = "h2",
|
|
9
|
+
description,
|
|
10
|
+
actions,
|
|
11
|
+
children,
|
|
12
|
+
ref,
|
|
13
|
+
class: className,
|
|
14
|
+
...rest
|
|
15
|
+
} = props;
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<div {...rest} ref={ref} class={classes("empty-state", className)} data-slot="empty-state">
|
|
19
|
+
{icon !== undefined ? (
|
|
20
|
+
<div class="empty-state-icon" data-slot="empty-state-icon">
|
|
21
|
+
{icon}
|
|
22
|
+
</div>
|
|
23
|
+
) : null}
|
|
24
|
+
{title !== undefined ? (
|
|
25
|
+
<TitleTag class="empty-state-title" data-slot="empty-state-title">
|
|
26
|
+
{title}
|
|
27
|
+
</TitleTag>
|
|
28
|
+
) : null}
|
|
29
|
+
{description !== undefined ? (
|
|
30
|
+
<p class="empty-state-description" data-slot="empty-state-description">
|
|
31
|
+
{description}
|
|
32
|
+
</p>
|
|
33
|
+
) : null}
|
|
34
|
+
{children}
|
|
35
|
+
{actions !== undefined ? (
|
|
36
|
+
<div class="empty-state-actions" data-slot="empty-state-actions">
|
|
37
|
+
{actions}
|
|
38
|
+
</div>
|
|
39
|
+
) : null}
|
|
40
|
+
</div>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type EmptyStateHeadingTag = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
2
|
+
|
|
3
|
+
export type EmptyStateProps = Omit<JSX.IntrinsicElements["div"], "children"> & {
|
|
4
|
+
icon?: unknown;
|
|
5
|
+
title?: unknown;
|
|
6
|
+
titleAs?: EmptyStateHeadingTag;
|
|
7
|
+
description?: unknown;
|
|
8
|
+
actions?: unknown;
|
|
9
|
+
children?: unknown;
|
|
10
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export const FLEX_A11Y_CONTRACT = {
|
|
2
|
+
DATA_ATTRIBUTES: {
|
|
3
|
+
slot: "data-slot" as const,
|
|
4
|
+
layout: "data-ak-layout" as const,
|
|
5
|
+
direction: "data-direction" as const,
|
|
6
|
+
gap: "data-gap" as const,
|
|
7
|
+
gapX: "data-gap-x" as const,
|
|
8
|
+
gapY: "data-gap-y" as const,
|
|
9
|
+
align: "data-align" as const,
|
|
10
|
+
justify: "data-justify" as const,
|
|
11
|
+
wrap: "data-wrap" as const,
|
|
12
|
+
collapseBelow: "data-collapse-below" as const,
|
|
13
|
+
},
|
|
14
|
+
SLOT_VALUES: {
|
|
15
|
+
root: "flex" as const,
|
|
16
|
+
},
|
|
17
|
+
} as const;
|
|
18
|
+
|
|
19
|
+
export type FlexA11yContract = typeof FLEX_A11Y_CONTRACT;
|