@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,8 @@
|
|
|
1
|
+
import { AspectRatioAsChildProps, AspectRatioProps } from "./aspect-ratio.types.js";
|
|
2
|
+
|
|
3
|
+
//#region src/components/aspect-ratio/aspect-ratio.d.ts
|
|
4
|
+
declare function AspectRatio(props: AspectRatioProps): JSX.Element;
|
|
5
|
+
declare function AspectRatio(props: AspectRatioAsChildProps): JSX.Element;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { AspectRatio };
|
|
8
|
+
//# sourceMappingURL=aspect-ratio.d.ts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { mergeProps } from "../_internal/merge-props.js";
|
|
2
|
+
import { jsx } from "@askrjs/askr/jsx-runtime";
|
|
3
|
+
import { Slot } from "@askrjs/askr/foundations";
|
|
4
|
+
//#region src/components/aspect-ratio/aspect-ratio.tsx
|
|
5
|
+
function serializeStyle(base, user) {
|
|
6
|
+
const merged = { ...base };
|
|
7
|
+
if (user && typeof user === "object") Object.assign(merged, user);
|
|
8
|
+
if (typeof user === "string" && user.trim()) return `${Object.entries(merged).filter(([, value]) => value !== void 0 && value !== null).map(([key, value]) => key.replace(/([A-Z])/g, "-$1").toLowerCase() + ":" + String(value)).join(";")};${user.trim()}`;
|
|
9
|
+
return Object.entries(merged).filter(([, value]) => value !== void 0 && value !== null).map(([key, value]) => key.replace(/([A-Z])/g, "-$1").toLowerCase() + ":" + String(value)).join(";");
|
|
10
|
+
}
|
|
11
|
+
function AspectRatio(props) {
|
|
12
|
+
const { asChild, children, ratio = 1, ref, style, ...rest } = props;
|
|
13
|
+
const finalProps = mergeProps(rest, {
|
|
14
|
+
ref,
|
|
15
|
+
"data-slot": "aspect-ratio",
|
|
16
|
+
style: serializeStyle({
|
|
17
|
+
display: "block",
|
|
18
|
+
width: "100%",
|
|
19
|
+
aspectRatio: String(ratio),
|
|
20
|
+
overflow: "hidden"
|
|
21
|
+
}, style)
|
|
22
|
+
});
|
|
23
|
+
if (asChild) return /* @__PURE__ */ jsx(Slot, {
|
|
24
|
+
asChild: true,
|
|
25
|
+
...finalProps,
|
|
26
|
+
children
|
|
27
|
+
});
|
|
28
|
+
return /* @__PURE__ */ jsx("div", {
|
|
29
|
+
...finalProps,
|
|
30
|
+
children
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
export { AspectRatio };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=aspect-ratio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aspect-ratio.js","names":[],"sources":["../../src/components/aspect-ratio/aspect-ratio.tsx"],"sourcesContent":["import { Slot } from \"@askrjs/askr/foundations\";\nimport { mergeProps } from \"../_internal/merge-props\";\nimport type { AspectRatioAsChildProps, AspectRatioProps } from \"./aspect-ratio.types\";\n\nfunction serializeStyle(base: Record<string, string | number>, user: unknown): string {\n const merged: Record<string, unknown> = { ...base };\n\n if (user && typeof user === \"object\") {\n Object.assign(merged, user as Record<string, unknown>);\n }\n\n if (typeof user === \"string\" && user.trim()) {\n return `${Object.entries(merged)\n .filter(([, value]) => value !== undefined && value !== null)\n .map(([key, value]) => key.replace(/([A-Z])/g, \"-$1\").toLowerCase() + \":\" + String(value))\n .join(\";\")};${user.trim()}`;\n }\n\n return Object.entries(merged)\n .filter(([, value]) => value !== undefined && value !== null)\n .map(([key, value]) => key.replace(/([A-Z])/g, \"-$1\").toLowerCase() + \":\" + String(value))\n .join(\";\");\n}\n\nexport function AspectRatio(props: AspectRatioProps): JSX.Element;\nexport function AspectRatio(props: AspectRatioAsChildProps): JSX.Element;\nexport function AspectRatio(props: AspectRatioProps | AspectRatioAsChildProps) {\n const { asChild, children, ratio = 1, ref, style, ...rest } = props;\n const finalProps = mergeProps(rest, {\n ref,\n \"data-slot\": \"aspect-ratio\",\n style: serializeStyle(\n {\n display: \"block\",\n width: \"100%\",\n aspectRatio: String(ratio),\n overflow: \"hidden\",\n },\n style,\n ),\n });\n\n if (asChild) {\n return <Slot asChild {...finalProps} children={children} />;\n }\n\n return <div {...finalProps}>{children}</div>;\n}\n"],"mappings":";;;;AAIA,SAAS,eAAe,MAAuC,MAAuB;CACpF,MAAM,SAAkC,EAAE,GAAG,MAAM;AAEnD,KAAI,QAAQ,OAAO,SAAS,SAC1B,QAAO,OAAO,QAAQ,KAAgC;AAGxD,KAAI,OAAO,SAAS,YAAY,KAAK,MAAM,CACzC,QAAO,GAAG,OAAO,QAAQ,OAAO,CAC7B,QAAQ,GAAG,WAAW,UAAU,KAAA,KAAa,UAAU,KAAK,CAC5D,KAAK,CAAC,KAAK,WAAW,IAAI,QAAQ,YAAY,MAAM,CAAC,aAAa,GAAG,MAAM,OAAO,MAAM,CAAC,CACzF,KAAK,IAAI,CAAC,GAAG,KAAK,MAAM;AAG7B,QAAO,OAAO,QAAQ,OAAO,CAC1B,QAAQ,GAAG,WAAW,UAAU,KAAA,KAAa,UAAU,KAAK,CAC5D,KAAK,CAAC,KAAK,WAAW,IAAI,QAAQ,YAAY,MAAM,CAAC,aAAa,GAAG,MAAM,OAAO,MAAM,CAAC,CACzF,KAAK,IAAI;;AAKd,SAAgB,YAAY,OAAmD;CAC7E,MAAM,EAAE,SAAS,UAAU,QAAQ,GAAG,KAAK,OAAO,GAAG,SAAS;CAC9D,MAAM,aAAa,WAAW,MAAM;EAClC;EACA,aAAa;EACb,OAAO,eACL;GACE,SAAS;GACT,OAAO;GACP,aAAa,OAAO,MAAM;GAC1B,UAAU;GACX,EACD,MACD;EACF,CAAC;AAEF,KAAI,QACF,QAAO,oBAAC,MAAD;EAAM,SAAA;EAAQ,GAAI;EAAsB;EAAY,CAAA;AAG7D,QAAO,oBAAC,OAAD;EAAK,GAAI;EAAa;EAAe,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { JSXElement, Ref } from "@askrjs/askr/foundations";
|
|
2
|
+
|
|
3
|
+
//#region src/components/aspect-ratio/aspect-ratio.types.d.ts
|
|
4
|
+
type AspectRatioOwnProps = {
|
|
5
|
+
children?: unknown;
|
|
6
|
+
ratio?: number | string;
|
|
7
|
+
style?: unknown;
|
|
8
|
+
};
|
|
9
|
+
type AspectRatioProps = Omit<JSX.IntrinsicElements["div"], "children" | "ref"> & AspectRatioOwnProps & {
|
|
10
|
+
asChild?: false;
|
|
11
|
+
ref?: Ref<HTMLDivElement>;
|
|
12
|
+
};
|
|
13
|
+
type AspectRatioAsChildProps = AspectRatioOwnProps & {
|
|
14
|
+
asChild: true;
|
|
15
|
+
children: JSXElement;
|
|
16
|
+
ref?: Ref<unknown>;
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { AspectRatioAsChildProps, AspectRatioProps };
|
|
20
|
+
//# sourceMappingURL=aspect-ratio.types.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BadgeAsChildProps, BadgeProps } from "./badge.types.js";
|
|
2
|
+
|
|
3
|
+
//#region src/components/badge/badge.d.ts
|
|
4
|
+
declare function Badge(props: BadgeProps): JSX.Element;
|
|
5
|
+
declare function Badge(props: BadgeAsChildProps): JSX.Element;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { Badge };
|
|
8
|
+
//# sourceMappingURL=badge.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { mergeProps } from "../_internal/merge-props.js";
|
|
2
|
+
import { jsx } from "@askrjs/askr/jsx-runtime";
|
|
3
|
+
import { Slot } from "@askrjs/askr/foundations";
|
|
4
|
+
//#region src/components/badge/badge.tsx
|
|
5
|
+
function Badge(props) {
|
|
6
|
+
const { asChild, children, variant, ref, ...rest } = props;
|
|
7
|
+
const finalProps = mergeProps(rest, {
|
|
8
|
+
ref,
|
|
9
|
+
"data-slot": "badge",
|
|
10
|
+
"data-badge": "true",
|
|
11
|
+
"data-variant": variant && variant !== "default" ? variant : void 0
|
|
12
|
+
});
|
|
13
|
+
if (asChild) return /* @__PURE__ */ jsx(Slot, {
|
|
14
|
+
asChild: true,
|
|
15
|
+
...finalProps,
|
|
16
|
+
children
|
|
17
|
+
});
|
|
18
|
+
return /* @__PURE__ */ jsx("span", {
|
|
19
|
+
...finalProps,
|
|
20
|
+
children
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { Badge };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=badge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge.js","names":[],"sources":["../../src/components/badge/badge.tsx"],"sourcesContent":["import { Slot } from \"@askrjs/askr/foundations\";\nimport { mergeProps } from \"../_internal/merge-props\";\nimport type { BadgeAsChildProps, BadgeProps } from \"./badge.types\";\n\nexport function Badge(props: BadgeProps): JSX.Element;\nexport function Badge(props: BadgeAsChildProps): JSX.Element;\nexport function Badge(props: BadgeProps | BadgeAsChildProps) {\n const { asChild, children, variant, ref, ...rest } = props;\n const finalProps = mergeProps(rest, {\n ref,\n \"data-slot\": \"badge\",\n \"data-badge\": \"true\",\n \"data-variant\": variant && variant !== \"default\" ? variant : undefined,\n });\n\n if (asChild) {\n return <Slot asChild {...finalProps} children={children} />;\n }\n\n return <span {...finalProps}>{children}</span>;\n}\n"],"mappings":";;;;AAMA,SAAgB,MAAM,OAAuC;CAC3D,MAAM,EAAE,SAAS,UAAU,SAAS,KAAK,GAAG,SAAS;CACrD,MAAM,aAAa,WAAW,MAAM;EAClC;EACA,aAAa;EACb,cAAc;EACd,gBAAgB,WAAW,YAAY,YAAY,UAAU,KAAA;EAC9D,CAAC;AAEF,KAAI,QACF,QAAO,oBAAC,MAAD;EAAM,SAAA;EAAQ,GAAI;EAAsB;EAAY,CAAA;AAG7D,QAAO,oBAAC,QAAD;EAAM,GAAI;EAAa;EAAgB,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { JSXElement, Ref } from "@askrjs/askr/foundations";
|
|
2
|
+
|
|
3
|
+
//#region src/components/badge/badge.types.d.ts
|
|
4
|
+
type BadgeVariant = "default" | "secondary" | "outline" | "success" | "warning" | "danger" | "info";
|
|
5
|
+
type BadgeOwnProps = {
|
|
6
|
+
children?: unknown;
|
|
7
|
+
variant?: BadgeVariant;
|
|
8
|
+
};
|
|
9
|
+
type BadgeProps = Omit<JSX.IntrinsicElements["span"], "children" | "ref"> & BadgeOwnProps & {
|
|
10
|
+
asChild?: false;
|
|
11
|
+
ref?: Ref<HTMLSpanElement>;
|
|
12
|
+
};
|
|
13
|
+
type BadgeAsChildProps = BadgeOwnProps & {
|
|
14
|
+
asChild: true;
|
|
15
|
+
children: JSXElement;
|
|
16
|
+
ref?: Ref<unknown>;
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { BadgeAsChildProps, BadgeOwnProps, BadgeProps };
|
|
20
|
+
//# sourceMappingURL=badge.types.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BoxAsChildProps, BoxDivProps, BoxSpanProps } from "./box.types.js";
|
|
2
|
+
|
|
3
|
+
//#region src/components/box/box.d.ts
|
|
4
|
+
declare function Box(props: BoxDivProps): JSX.Element;
|
|
5
|
+
declare function Box(props: BoxSpanProps): JSX.Element;
|
|
6
|
+
declare function Box(props: BoxAsChildProps): JSX.Element;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { Box };
|
|
9
|
+
//# sourceMappingURL=box.d.ts.map
|
package/dist/box/box.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { mergeProps } from "../_internal/merge-props.js";
|
|
2
|
+
import { applyBoxLayoutStyles, splitBoxLayoutProps, withBoxLayoutStyle } from "../_internal/box-layout.js";
|
|
3
|
+
import { jsx } from "@askrjs/askr/jsx-runtime";
|
|
4
|
+
import { Slot } from "@askrjs/askr/foundations";
|
|
5
|
+
//#region src/components/box/box.tsx
|
|
6
|
+
function Box(props) {
|
|
7
|
+
const as = "as" in props ? props.as : "div";
|
|
8
|
+
const { asChild, children, ref, style: userStyle, ...rest } = props;
|
|
9
|
+
const { boxProps, rest: passthroughProps } = splitBoxLayoutProps(rest);
|
|
10
|
+
const layoutStyle = {};
|
|
11
|
+
applyBoxLayoutStyles(layoutStyle, boxProps);
|
|
12
|
+
const finalProps = mergeProps(passthroughProps, {
|
|
13
|
+
ref,
|
|
14
|
+
"data-slot": "box",
|
|
15
|
+
"data-ak-layout": "true",
|
|
16
|
+
style: withBoxLayoutStyle(layoutStyle, userStyle)
|
|
17
|
+
});
|
|
18
|
+
if (asChild) return /* @__PURE__ */ jsx(Slot, {
|
|
19
|
+
asChild: true,
|
|
20
|
+
...finalProps,
|
|
21
|
+
children
|
|
22
|
+
});
|
|
23
|
+
if (as === "span") return /* @__PURE__ */ jsx("span", {
|
|
24
|
+
...finalProps,
|
|
25
|
+
children
|
|
26
|
+
});
|
|
27
|
+
return /* @__PURE__ */ jsx("div", {
|
|
28
|
+
...finalProps,
|
|
29
|
+
children
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { Box };
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=box.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"box.js","names":[],"sources":["../../src/components/box/box.tsx"],"sourcesContent":["import { Slot } from \"@askrjs/askr/foundations\";\nimport { mergeProps } from \"../_internal/merge-props\";\nimport {\n applyBoxLayoutStyles,\n splitBoxLayoutProps,\n withBoxLayoutStyle,\n} from \"../_internal/box-layout\";\nimport type { BoxAsChildProps, BoxDivProps, BoxSpanProps } from \"./box.types\";\n\nexport function Box(props: BoxDivProps): JSX.Element;\nexport function Box(props: BoxSpanProps): JSX.Element;\nexport function Box(props: BoxAsChildProps): JSX.Element;\nexport function Box(props: BoxDivProps | BoxSpanProps | BoxAsChildProps) {\n const as = \"as\" in props ? props.as : \"div\";\n const { asChild, children, ref, style: userStyle, ...rest } = props;\n\n const { boxProps, rest: passthroughProps } = splitBoxLayoutProps(rest);\n const layoutStyle: Record<string, string | number> = {};\n applyBoxLayoutStyles(layoutStyle, boxProps);\n\n const finalProps = mergeProps(passthroughProps, {\n ref,\n \"data-slot\": \"box\",\n \"data-ak-layout\": \"true\",\n style: withBoxLayoutStyle(layoutStyle, userStyle),\n });\n\n if (asChild) {\n return <Slot asChild {...finalProps} children={children} />;\n }\n\n if (as === \"span\") {\n return <span {...finalProps}>{children}</span>;\n }\n\n return <div {...finalProps}>{children}</div>;\n}\n"],"mappings":";;;;;AAYA,SAAgB,IAAI,OAAqD;CACvE,MAAM,KAAK,QAAQ,QAAQ,MAAM,KAAK;CACtC,MAAM,EAAE,SAAS,UAAU,KAAK,OAAO,WAAW,GAAG,SAAS;CAE9D,MAAM,EAAE,UAAU,MAAM,qBAAqB,oBAAoB,KAAK;CACtE,MAAM,cAA+C,EAAE;AACvD,sBAAqB,aAAa,SAAS;CAE3C,MAAM,aAAa,WAAW,kBAAkB;EAC9C;EACA,aAAa;EACb,kBAAkB;EAClB,OAAO,mBAAmB,aAAa,UAAU;EAClD,CAAC;AAEF,KAAI,QACF,QAAO,oBAAC,MAAD;EAAM,SAAA;EAAQ,GAAI;EAAsB;EAAY,CAAA;AAG7D,KAAI,OAAO,OACT,QAAO,oBAAC,QAAD;EAAM,GAAI;EAAa;EAAgB,CAAA;AAGhD,QAAO,oBAAC,OAAD;EAAK,GAAI;EAAa;EAAe,CAAA"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { ResponsiveValue } from "../_internal/layout.js";
|
|
2
|
+
import { JSXElement, Ref } from "@askrjs/askr/foundations";
|
|
3
|
+
|
|
4
|
+
//#region src/components/box/box.types.d.ts
|
|
5
|
+
type LayoutResponsive<T> = ResponsiveValue<T>;
|
|
6
|
+
type BoxLayoutOwnProps = {
|
|
7
|
+
display?: ResponsiveValue<string>;
|
|
8
|
+
m?: ResponsiveValue<string | number>;
|
|
9
|
+
mx?: ResponsiveValue<string | number>;
|
|
10
|
+
my?: ResponsiveValue<string | number>;
|
|
11
|
+
mt?: ResponsiveValue<string | number>;
|
|
12
|
+
mr?: ResponsiveValue<string | number>;
|
|
13
|
+
mb?: ResponsiveValue<string | number>;
|
|
14
|
+
ml?: ResponsiveValue<string | number>;
|
|
15
|
+
p?: ResponsiveValue<string | number>;
|
|
16
|
+
px?: ResponsiveValue<string | number>;
|
|
17
|
+
py?: ResponsiveValue<string | number>;
|
|
18
|
+
pt?: ResponsiveValue<string | number>;
|
|
19
|
+
pr?: ResponsiveValue<string | number>;
|
|
20
|
+
pb?: ResponsiveValue<string | number>;
|
|
21
|
+
pl?: ResponsiveValue<string | number>;
|
|
22
|
+
width?: ResponsiveValue<string>;
|
|
23
|
+
minWidth?: ResponsiveValue<string>;
|
|
24
|
+
maxWidth?: ResponsiveValue<string>;
|
|
25
|
+
height?: ResponsiveValue<string>;
|
|
26
|
+
minHeight?: ResponsiveValue<string>;
|
|
27
|
+
maxHeight?: ResponsiveValue<string>;
|
|
28
|
+
position?: ResponsiveValue<string>;
|
|
29
|
+
inset?: ResponsiveValue<string | number>;
|
|
30
|
+
top?: ResponsiveValue<string | number>;
|
|
31
|
+
right?: ResponsiveValue<string | number>;
|
|
32
|
+
bottom?: ResponsiveValue<string | number>;
|
|
33
|
+
left?: ResponsiveValue<string | number>;
|
|
34
|
+
overflow?: ResponsiveValue<string>;
|
|
35
|
+
overflowX?: ResponsiveValue<string>;
|
|
36
|
+
overflowY?: ResponsiveValue<string>;
|
|
37
|
+
flexBasis?: ResponsiveValue<string>;
|
|
38
|
+
flexGrow?: ResponsiveValue<string | number>;
|
|
39
|
+
flexShrink?: ResponsiveValue<string | number>;
|
|
40
|
+
gridArea?: ResponsiveValue<string>;
|
|
41
|
+
gridColumn?: ResponsiveValue<string>;
|
|
42
|
+
gridColumnStart?: ResponsiveValue<string>;
|
|
43
|
+
gridColumnEnd?: ResponsiveValue<string>;
|
|
44
|
+
gridRow?: ResponsiveValue<string>;
|
|
45
|
+
gridRowStart?: ResponsiveValue<string>;
|
|
46
|
+
gridRowEnd?: ResponsiveValue<string>;
|
|
47
|
+
children?: unknown;
|
|
48
|
+
};
|
|
49
|
+
type BoxOwnProps = BoxLayoutOwnProps & {
|
|
50
|
+
as?: "div" | "span";
|
|
51
|
+
};
|
|
52
|
+
type BoxDivProps = Omit<JSX.IntrinsicElements["div"], "children" | "ref"> & BoxOwnProps & {
|
|
53
|
+
as?: "div";
|
|
54
|
+
asChild?: false;
|
|
55
|
+
ref?: Ref<HTMLDivElement>;
|
|
56
|
+
};
|
|
57
|
+
type BoxSpanProps = Omit<JSX.IntrinsicElements["span"], "children" | "ref"> & BoxOwnProps & {
|
|
58
|
+
as: "span";
|
|
59
|
+
asChild?: false;
|
|
60
|
+
ref?: Ref<HTMLSpanElement>;
|
|
61
|
+
};
|
|
62
|
+
type BoxAsChildProps = Omit<BoxOwnProps, "as"> & {
|
|
63
|
+
asChild: true;
|
|
64
|
+
children: JSXElement;
|
|
65
|
+
ref?: Ref<unknown>;
|
|
66
|
+
style?: JSX.IntrinsicElements["div"]["style"];
|
|
67
|
+
};
|
|
68
|
+
type BoxProps = BoxDivProps | BoxSpanProps | BoxAsChildProps;
|
|
69
|
+
//#endregion
|
|
70
|
+
export { BoxAsChildProps, BoxDivProps, BoxLayoutOwnProps, BoxOwnProps, BoxProps, BoxSpanProps, LayoutResponsive };
|
|
71
|
+
//# sourceMappingURL=box.types.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BreadcrumbAsChildProps, BreadcrumbCurrentAsChildProps, BreadcrumbCurrentProps, BreadcrumbItemAsChildProps, BreadcrumbItemProps, BreadcrumbLinkAsChildProps, BreadcrumbLinkProps, BreadcrumbListAsChildProps, BreadcrumbListProps, BreadcrumbProps, BreadcrumbSeparatorAsChildProps, BreadcrumbSeparatorProps } from "./breadcrumb.types.js";
|
|
2
|
+
|
|
3
|
+
//#region src/components/breadcrumb/breadcrumb.d.ts
|
|
4
|
+
declare function Breadcrumb(props: BreadcrumbProps): JSX.Element;
|
|
5
|
+
declare function Breadcrumb(props: BreadcrumbAsChildProps): JSX.Element;
|
|
6
|
+
declare function BreadcrumbList(props: BreadcrumbListProps): JSX.Element;
|
|
7
|
+
declare function BreadcrumbList(props: BreadcrumbListAsChildProps): JSX.Element;
|
|
8
|
+
declare function BreadcrumbItem(props: BreadcrumbItemProps): JSX.Element;
|
|
9
|
+
declare function BreadcrumbItem(props: BreadcrumbItemAsChildProps): JSX.Element;
|
|
10
|
+
declare function BreadcrumbLink(props: BreadcrumbLinkProps): JSX.Element;
|
|
11
|
+
declare function BreadcrumbLink(props: BreadcrumbLinkAsChildProps): JSX.Element;
|
|
12
|
+
declare function BreadcrumbCurrent(props: BreadcrumbCurrentProps): JSX.Element;
|
|
13
|
+
declare function BreadcrumbCurrent(props: BreadcrumbCurrentAsChildProps): JSX.Element;
|
|
14
|
+
declare function BreadcrumbSeparator(props: BreadcrumbSeparatorProps): JSX.Element;
|
|
15
|
+
declare function BreadcrumbSeparator(props: BreadcrumbSeparatorAsChildProps): JSX.Element;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { Breadcrumb, BreadcrumbCurrent, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbSeparator };
|
|
18
|
+
//# sourceMappingURL=breadcrumb.d.ts.map
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { mergeProps } from "../_internal/merge-props.js";
|
|
2
|
+
import { jsx } from "@askrjs/askr/jsx-runtime";
|
|
3
|
+
import { Slot } from "@askrjs/askr/foundations";
|
|
4
|
+
//#region src/components/breadcrumb/breadcrumb.tsx
|
|
5
|
+
function Breadcrumb(props) {
|
|
6
|
+
const { asChild, children, ref, "aria-label": ariaLabel, ...rest } = props;
|
|
7
|
+
const finalProps = mergeProps(rest, {
|
|
8
|
+
ref,
|
|
9
|
+
"aria-label": ariaLabel ?? "Breadcrumb",
|
|
10
|
+
"data-slot": "breadcrumb",
|
|
11
|
+
"data-breadcrumb": "true"
|
|
12
|
+
});
|
|
13
|
+
if (asChild) return /* @__PURE__ */ jsx(Slot, {
|
|
14
|
+
asChild: true,
|
|
15
|
+
...finalProps,
|
|
16
|
+
children
|
|
17
|
+
});
|
|
18
|
+
return /* @__PURE__ */ jsx("nav", {
|
|
19
|
+
...finalProps,
|
|
20
|
+
children
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function BreadcrumbList(props) {
|
|
24
|
+
const { asChild, children, ref, ...rest } = props;
|
|
25
|
+
const finalProps = mergeProps(rest, {
|
|
26
|
+
ref,
|
|
27
|
+
"data-slot": "breadcrumb-list",
|
|
28
|
+
"data-breadcrumb-list": "true"
|
|
29
|
+
});
|
|
30
|
+
if (asChild) return /* @__PURE__ */ jsx(Slot, {
|
|
31
|
+
asChild: true,
|
|
32
|
+
...finalProps,
|
|
33
|
+
children
|
|
34
|
+
});
|
|
35
|
+
return /* @__PURE__ */ jsx("ol", {
|
|
36
|
+
...finalProps,
|
|
37
|
+
children
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function BreadcrumbItem(props) {
|
|
41
|
+
const { asChild, children, ref, ...rest } = props;
|
|
42
|
+
const finalProps = mergeProps(rest, {
|
|
43
|
+
ref,
|
|
44
|
+
"data-slot": "breadcrumb-item",
|
|
45
|
+
"data-breadcrumb-item": "true"
|
|
46
|
+
});
|
|
47
|
+
if (asChild) return /* @__PURE__ */ jsx(Slot, {
|
|
48
|
+
asChild: true,
|
|
49
|
+
...finalProps,
|
|
50
|
+
children
|
|
51
|
+
});
|
|
52
|
+
return /* @__PURE__ */ jsx("li", {
|
|
53
|
+
...finalProps,
|
|
54
|
+
children
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
function BreadcrumbLink(props) {
|
|
58
|
+
const { asChild, children, ref, ...rest } = props;
|
|
59
|
+
const finalProps = mergeProps(rest, {
|
|
60
|
+
ref,
|
|
61
|
+
"data-slot": "breadcrumb-link",
|
|
62
|
+
"data-breadcrumb-link": "true"
|
|
63
|
+
});
|
|
64
|
+
if (asChild) return /* @__PURE__ */ jsx(Slot, {
|
|
65
|
+
asChild: true,
|
|
66
|
+
...finalProps,
|
|
67
|
+
children
|
|
68
|
+
});
|
|
69
|
+
return /* @__PURE__ */ jsx("a", {
|
|
70
|
+
...finalProps,
|
|
71
|
+
children
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
function BreadcrumbCurrent(props) {
|
|
75
|
+
const { asChild, children, ref, ...rest } = props;
|
|
76
|
+
const finalProps = mergeProps(rest, {
|
|
77
|
+
ref,
|
|
78
|
+
"aria-current": "page",
|
|
79
|
+
"data-slot": "breadcrumb-current",
|
|
80
|
+
"data-breadcrumb-current": "true"
|
|
81
|
+
});
|
|
82
|
+
if (asChild) return /* @__PURE__ */ jsx(Slot, {
|
|
83
|
+
asChild: true,
|
|
84
|
+
...finalProps,
|
|
85
|
+
children
|
|
86
|
+
});
|
|
87
|
+
return /* @__PURE__ */ jsx("span", {
|
|
88
|
+
...finalProps,
|
|
89
|
+
children
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
function BreadcrumbSeparator(props) {
|
|
93
|
+
const { asChild, children, ref, ...rest } = props;
|
|
94
|
+
const finalProps = mergeProps(rest, {
|
|
95
|
+
ref,
|
|
96
|
+
"aria-hidden": "true",
|
|
97
|
+
"data-slot": "breadcrumb-separator",
|
|
98
|
+
"data-breadcrumb-separator": "true"
|
|
99
|
+
});
|
|
100
|
+
if (asChild) return /* @__PURE__ */ jsx(Slot, {
|
|
101
|
+
asChild: true,
|
|
102
|
+
...finalProps,
|
|
103
|
+
children: children ?? "/"
|
|
104
|
+
});
|
|
105
|
+
return /* @__PURE__ */ jsx("span", {
|
|
106
|
+
...finalProps,
|
|
107
|
+
children: children ?? "/"
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
//#endregion
|
|
111
|
+
export { Breadcrumb, BreadcrumbCurrent, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbSeparator };
|
|
112
|
+
|
|
113
|
+
//# sourceMappingURL=breadcrumb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breadcrumb.js","names":[],"sources":["../../src/components/breadcrumb/breadcrumb.tsx"],"sourcesContent":["import { Slot } from \"@askrjs/askr/foundations\";\nimport { mergeProps } from \"../_internal/merge-props\";\nimport type {\n BreadcrumbAsChildProps,\n BreadcrumbCurrentAsChildProps,\n BreadcrumbCurrentProps,\n BreadcrumbItemAsChildProps,\n BreadcrumbItemProps,\n BreadcrumbLinkAsChildProps,\n BreadcrumbLinkProps,\n BreadcrumbListAsChildProps,\n BreadcrumbListProps,\n BreadcrumbProps,\n BreadcrumbSeparatorAsChildProps,\n BreadcrumbSeparatorProps,\n} from \"./breadcrumb.types\";\n\nexport function Breadcrumb(props: BreadcrumbProps): JSX.Element;\nexport function Breadcrumb(props: BreadcrumbAsChildProps): JSX.Element;\nexport function Breadcrumb(props: BreadcrumbProps | BreadcrumbAsChildProps) {\n const { asChild, children, ref, \"aria-label\": ariaLabel, ...rest } = props;\n const finalProps = mergeProps(rest, {\n ref,\n \"aria-label\": ariaLabel ?? \"Breadcrumb\",\n \"data-slot\": \"breadcrumb\",\n \"data-breadcrumb\": \"true\",\n });\n\n if (asChild) {\n return <Slot asChild {...finalProps} children={children} />;\n }\n\n return <nav {...finalProps}>{children}</nav>;\n}\n\nexport function BreadcrumbList(props: BreadcrumbListProps): JSX.Element;\nexport function BreadcrumbList(props: BreadcrumbListAsChildProps): JSX.Element;\nexport function BreadcrumbList(props: BreadcrumbListProps | BreadcrumbListAsChildProps) {\n const { asChild, children, ref, ...rest } = props;\n const finalProps = mergeProps(rest, {\n ref,\n \"data-slot\": \"breadcrumb-list\",\n \"data-breadcrumb-list\": \"true\",\n });\n\n if (asChild) {\n return <Slot asChild {...finalProps} children={children} />;\n }\n\n return <ol {...finalProps}>{children}</ol>;\n}\n\nexport function BreadcrumbItem(props: BreadcrumbItemProps): JSX.Element;\nexport function BreadcrumbItem(props: BreadcrumbItemAsChildProps): JSX.Element;\nexport function BreadcrumbItem(props: BreadcrumbItemProps | BreadcrumbItemAsChildProps) {\n const { asChild, children, ref, ...rest } = props;\n const finalProps = mergeProps(rest, {\n ref,\n \"data-slot\": \"breadcrumb-item\",\n \"data-breadcrumb-item\": \"true\",\n });\n\n if (asChild) {\n return <Slot asChild {...finalProps} children={children} />;\n }\n\n return <li {...finalProps}>{children}</li>;\n}\n\nexport function BreadcrumbLink(props: BreadcrumbLinkProps): JSX.Element;\nexport function BreadcrumbLink(props: BreadcrumbLinkAsChildProps): JSX.Element;\nexport function BreadcrumbLink(props: BreadcrumbLinkProps | BreadcrumbLinkAsChildProps) {\n const { asChild, children, ref, ...rest } = props;\n const finalProps = mergeProps(rest, {\n ref,\n \"data-slot\": \"breadcrumb-link\",\n \"data-breadcrumb-link\": \"true\",\n });\n\n if (asChild) {\n return <Slot asChild {...finalProps} children={children} />;\n }\n\n return <a {...finalProps}>{children}</a>;\n}\n\nexport function BreadcrumbCurrent(props: BreadcrumbCurrentProps): JSX.Element;\nexport function BreadcrumbCurrent(props: BreadcrumbCurrentAsChildProps): JSX.Element;\nexport function BreadcrumbCurrent(props: BreadcrumbCurrentProps | BreadcrumbCurrentAsChildProps) {\n const { asChild, children, ref, ...rest } = props;\n const finalProps = mergeProps(rest, {\n ref,\n \"aria-current\": \"page\",\n \"data-slot\": \"breadcrumb-current\",\n \"data-breadcrumb-current\": \"true\",\n });\n\n if (asChild) {\n return <Slot asChild {...finalProps} children={children} />;\n }\n\n return <span {...finalProps}>{children}</span>;\n}\n\nexport function BreadcrumbSeparator(props: BreadcrumbSeparatorProps): JSX.Element;\nexport function BreadcrumbSeparator(props: BreadcrumbSeparatorAsChildProps): JSX.Element;\nexport function BreadcrumbSeparator(\n props: BreadcrumbSeparatorProps | BreadcrumbSeparatorAsChildProps,\n) {\n const { asChild, children, ref, ...rest } = props;\n const finalProps = mergeProps(rest, {\n ref,\n \"aria-hidden\": \"true\",\n \"data-slot\": \"breadcrumb-separator\",\n \"data-breadcrumb-separator\": \"true\",\n });\n\n if (asChild) {\n return <Slot asChild {...finalProps} children={children ?? \"/\"} />;\n }\n\n return <span {...finalProps}>{children ?? \"/\"}</span>;\n}\n"],"mappings":";;;;AAmBA,SAAgB,WAAW,OAAiD;CAC1E,MAAM,EAAE,SAAS,UAAU,KAAK,cAAc,WAAW,GAAG,SAAS;CACrE,MAAM,aAAa,WAAW,MAAM;EAClC;EACA,cAAc,aAAa;EAC3B,aAAa;EACb,mBAAmB;EACpB,CAAC;AAEF,KAAI,QACF,QAAO,oBAAC,MAAD;EAAM,SAAA;EAAQ,GAAI;EAAsB;EAAY,CAAA;AAG7D,QAAO,oBAAC,OAAD;EAAK,GAAI;EAAa;EAAe,CAAA;;AAK9C,SAAgB,eAAe,OAAyD;CACtF,MAAM,EAAE,SAAS,UAAU,KAAK,GAAG,SAAS;CAC5C,MAAM,aAAa,WAAW,MAAM;EAClC;EACA,aAAa;EACb,wBAAwB;EACzB,CAAC;AAEF,KAAI,QACF,QAAO,oBAAC,MAAD;EAAM,SAAA;EAAQ,GAAI;EAAsB;EAAY,CAAA;AAG7D,QAAO,oBAAC,MAAD;EAAI,GAAI;EAAa;EAAc,CAAA;;AAK5C,SAAgB,eAAe,OAAyD;CACtF,MAAM,EAAE,SAAS,UAAU,KAAK,GAAG,SAAS;CAC5C,MAAM,aAAa,WAAW,MAAM;EAClC;EACA,aAAa;EACb,wBAAwB;EACzB,CAAC;AAEF,KAAI,QACF,QAAO,oBAAC,MAAD;EAAM,SAAA;EAAQ,GAAI;EAAsB;EAAY,CAAA;AAG7D,QAAO,oBAAC,MAAD;EAAI,GAAI;EAAa;EAAc,CAAA;;AAK5C,SAAgB,eAAe,OAAyD;CACtF,MAAM,EAAE,SAAS,UAAU,KAAK,GAAG,SAAS;CAC5C,MAAM,aAAa,WAAW,MAAM;EAClC;EACA,aAAa;EACb,wBAAwB;EACzB,CAAC;AAEF,KAAI,QACF,QAAO,oBAAC,MAAD;EAAM,SAAA;EAAQ,GAAI;EAAsB;EAAY,CAAA;AAG7D,QAAO,oBAAC,KAAD;EAAG,GAAI;EAAa;EAAa,CAAA;;AAK1C,SAAgB,kBAAkB,OAA+D;CAC/F,MAAM,EAAE,SAAS,UAAU,KAAK,GAAG,SAAS;CAC5C,MAAM,aAAa,WAAW,MAAM;EAClC;EACA,gBAAgB;EAChB,aAAa;EACb,2BAA2B;EAC5B,CAAC;AAEF,KAAI,QACF,QAAO,oBAAC,MAAD;EAAM,SAAA;EAAQ,GAAI;EAAsB;EAAY,CAAA;AAG7D,QAAO,oBAAC,QAAD;EAAM,GAAI;EAAa;EAAgB,CAAA;;AAKhD,SAAgB,oBACd,OACA;CACA,MAAM,EAAE,SAAS,UAAU,KAAK,GAAG,SAAS;CAC5C,MAAM,aAAa,WAAW,MAAM;EAClC;EACA,eAAe;EACf,aAAa;EACb,6BAA6B;EAC9B,CAAC;AAEF,KAAI,QACF,QAAO,oBAAC,MAAD;EAAM,SAAA;EAAQ,GAAI;EAAY,UAAU,YAAY;EAAO,CAAA;AAGpE,QAAO,oBAAC,QAAD;EAAM,GAAI;YAAa,YAAY;EAAW,CAAA"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { JSXElement, Ref } from "@askrjs/askr/foundations";
|
|
2
|
+
|
|
3
|
+
//#region src/components/breadcrumb/breadcrumb.types.d.ts
|
|
4
|
+
type BreadcrumbOwnProps = {
|
|
5
|
+
children?: unknown;
|
|
6
|
+
"aria-label"?: string;
|
|
7
|
+
};
|
|
8
|
+
type BreadcrumbProps = Omit<JSX.IntrinsicElements["nav"], "children" | "ref"> & BreadcrumbOwnProps & {
|
|
9
|
+
asChild?: false;
|
|
10
|
+
ref?: Ref<HTMLElement>;
|
|
11
|
+
};
|
|
12
|
+
type BreadcrumbAsChildProps = BreadcrumbOwnProps & {
|
|
13
|
+
asChild: true;
|
|
14
|
+
children: JSXElement;
|
|
15
|
+
ref?: Ref<unknown>;
|
|
16
|
+
};
|
|
17
|
+
type BreadcrumbListProps = Omit<JSX.IntrinsicElements["ol"], "children" | "ref"> & {
|
|
18
|
+
asChild?: false;
|
|
19
|
+
ref?: Ref<HTMLOListElement>;
|
|
20
|
+
};
|
|
21
|
+
type BreadcrumbListAsChildProps = {
|
|
22
|
+
asChild: true;
|
|
23
|
+
children: JSXElement;
|
|
24
|
+
ref?: Ref<unknown>;
|
|
25
|
+
};
|
|
26
|
+
type BreadcrumbItemProps = Omit<JSX.IntrinsicElements["li"], "children" | "ref"> & {
|
|
27
|
+
asChild?: false;
|
|
28
|
+
ref?: Ref<HTMLLIElement>;
|
|
29
|
+
};
|
|
30
|
+
type BreadcrumbItemAsChildProps = {
|
|
31
|
+
asChild: true;
|
|
32
|
+
children: JSXElement;
|
|
33
|
+
ref?: Ref<unknown>;
|
|
34
|
+
};
|
|
35
|
+
type BreadcrumbLinkProps = Omit<JSX.IntrinsicElements["a"], "children" | "ref"> & {
|
|
36
|
+
asChild?: false;
|
|
37
|
+
ref?: Ref<HTMLAnchorElement>;
|
|
38
|
+
};
|
|
39
|
+
type BreadcrumbLinkAsChildProps = {
|
|
40
|
+
asChild: true;
|
|
41
|
+
children: JSXElement;
|
|
42
|
+
ref?: Ref<unknown>;
|
|
43
|
+
};
|
|
44
|
+
type BreadcrumbCurrentProps = Omit<JSX.IntrinsicElements["span"], "children" | "ref"> & {
|
|
45
|
+
asChild?: false;
|
|
46
|
+
ref?: Ref<HTMLSpanElement>;
|
|
47
|
+
};
|
|
48
|
+
type BreadcrumbCurrentAsChildProps = {
|
|
49
|
+
asChild: true;
|
|
50
|
+
children: JSXElement;
|
|
51
|
+
ref?: Ref<unknown>;
|
|
52
|
+
};
|
|
53
|
+
type BreadcrumbSeparatorProps = Omit<JSX.IntrinsicElements["span"], "children" | "ref"> & {
|
|
54
|
+
asChild?: false;
|
|
55
|
+
ref?: Ref<HTMLSpanElement>;
|
|
56
|
+
};
|
|
57
|
+
type BreadcrumbSeparatorAsChildProps = {
|
|
58
|
+
asChild: true;
|
|
59
|
+
children: JSXElement;
|
|
60
|
+
ref?: Ref<unknown>;
|
|
61
|
+
};
|
|
62
|
+
//#endregion
|
|
63
|
+
export { BreadcrumbAsChildProps, BreadcrumbCurrentAsChildProps, BreadcrumbCurrentProps, BreadcrumbItemAsChildProps, BreadcrumbItemProps, BreadcrumbLinkAsChildProps, BreadcrumbLinkProps, BreadcrumbListAsChildProps, BreadcrumbListProps, BreadcrumbOwnProps, BreadcrumbProps, BreadcrumbSeparatorAsChildProps, BreadcrumbSeparatorProps };
|
|
64
|
+
//# sourceMappingURL=breadcrumb.types.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { BreadcrumbAsChildProps, BreadcrumbCurrentAsChildProps, BreadcrumbCurrentProps, BreadcrumbItemAsChildProps, BreadcrumbItemProps, BreadcrumbLinkAsChildProps, BreadcrumbLinkProps, BreadcrumbListAsChildProps, BreadcrumbListProps, BreadcrumbOwnProps, BreadcrumbProps, BreadcrumbSeparatorAsChildProps, BreadcrumbSeparatorProps } from "./breadcrumb.types.js";
|
|
2
|
+
import { Breadcrumb, BreadcrumbCurrent, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbSeparator } from "./breadcrumb.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CardContentProps, CardDescriptionProps, CardFooterProps, CardHeaderProps, CardProps, CardTitleProps } from "./card.types.js";
|
|
2
|
+
|
|
3
|
+
//#region src/components/card/card.d.ts
|
|
4
|
+
declare function Card(props: CardProps): JSX.Element;
|
|
5
|
+
declare function CardHeader(props: CardHeaderProps): JSX.Element;
|
|
6
|
+
declare function CardTitle(props: CardTitleProps): JSX.Element;
|
|
7
|
+
declare function CardDescription(props: CardDescriptionProps): JSX.Element;
|
|
8
|
+
declare function CardContent(props: CardContentProps): JSX.Element;
|
|
9
|
+
declare function CardFooter(props: CardFooterProps): JSX.Element;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
|
|
12
|
+
//# sourceMappingURL=card.d.ts.map
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsx } from "@askrjs/askr/jsx-runtime";
|
|
2
|
+
//#region src/components/card/card.tsx
|
|
3
|
+
function normalizePadding(padding) {
|
|
4
|
+
return padding && padding !== "md" ? padding : void 0;
|
|
5
|
+
}
|
|
6
|
+
function normalizeVariant(variant) {
|
|
7
|
+
return variant && variant !== "default" ? variant : void 0;
|
|
8
|
+
}
|
|
9
|
+
function Card(props) {
|
|
10
|
+
const { children, variant, padding = "md", ref, ...rest } = props;
|
|
11
|
+
return /* @__PURE__ */ jsx("div", {
|
|
12
|
+
...rest,
|
|
13
|
+
ref,
|
|
14
|
+
"data-slot": "card",
|
|
15
|
+
"data-variant": normalizeVariant(variant),
|
|
16
|
+
"data-padding": normalizePadding(padding),
|
|
17
|
+
children
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function CardHeader(props) {
|
|
21
|
+
const { children, ref, ...rest } = props;
|
|
22
|
+
return /* @__PURE__ */ jsx("div", {
|
|
23
|
+
...rest,
|
|
24
|
+
ref,
|
|
25
|
+
"data-slot": "card-header",
|
|
26
|
+
children
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function CardTitle(props) {
|
|
30
|
+
const { children, ref, ...rest } = props;
|
|
31
|
+
return /* @__PURE__ */ jsx("h3", {
|
|
32
|
+
...rest,
|
|
33
|
+
ref,
|
|
34
|
+
"data-slot": "card-title",
|
|
35
|
+
children
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function CardDescription(props) {
|
|
39
|
+
const { children, ref, ...rest } = props;
|
|
40
|
+
return /* @__PURE__ */ jsx("p", {
|
|
41
|
+
...rest,
|
|
42
|
+
ref,
|
|
43
|
+
"data-slot": "card-description",
|
|
44
|
+
children
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function CardContent(props) {
|
|
48
|
+
const { children, ref, ...rest } = props;
|
|
49
|
+
return /* @__PURE__ */ jsx("div", {
|
|
50
|
+
...rest,
|
|
51
|
+
ref,
|
|
52
|
+
"data-slot": "card-content",
|
|
53
|
+
children
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
function CardFooter(props) {
|
|
57
|
+
const { children, ref, ...rest } = props;
|
|
58
|
+
return /* @__PURE__ */ jsx("div", {
|
|
59
|
+
...rest,
|
|
60
|
+
ref,
|
|
61
|
+
"data-slot": "card-footer",
|
|
62
|
+
children
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
|
|
67
|
+
|
|
68
|
+
//# sourceMappingURL=card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.js","names":[],"sources":["../../src/components/card/card.tsx"],"sourcesContent":["import type {\n CardContentProps,\n CardDescriptionProps,\n CardFooterProps,\n CardHeaderProps,\n CardPadding,\n CardProps,\n CardTitleProps,\n CardVariant,\n} from \"./card.types\";\n\nfunction normalizePadding(padding: CardPadding | undefined) {\n return padding && padding !== \"md\" ? padding : undefined;\n}\n\nfunction normalizeVariant(variant: CardVariant | undefined) {\n return variant && variant !== \"default\" ? variant : undefined;\n}\n\nexport function Card(props: CardProps): JSX.Element {\n const { children, variant, padding = \"md\", ref, ...rest } = props;\n\n return (\n <div\n {...rest}\n ref={ref}\n data-slot=\"card\"\n data-variant={normalizeVariant(variant)}\n data-padding={normalizePadding(padding)}\n >\n {children}\n </div>\n );\n}\n\nexport function CardHeader(props: CardHeaderProps): JSX.Element {\n const { children, ref, ...rest } = props;\n return (\n <div {...rest} ref={ref} data-slot=\"card-header\">\n {children}\n </div>\n );\n}\n\nexport function CardTitle(props: CardTitleProps): JSX.Element {\n const { children, ref, ...rest } = props;\n return (\n <h3 {...rest} ref={ref} data-slot=\"card-title\">\n {children}\n </h3>\n );\n}\n\nexport function CardDescription(props: CardDescriptionProps): JSX.Element {\n const { children, ref, ...rest } = props;\n return (\n <p {...rest} ref={ref} data-slot=\"card-description\">\n {children}\n </p>\n );\n}\n\nexport function CardContent(props: CardContentProps): JSX.Element {\n const { children, ref, ...rest } = props;\n return (\n <div {...rest} ref={ref} data-slot=\"card-content\">\n {children}\n </div>\n );\n}\n\nexport function CardFooter(props: CardFooterProps): JSX.Element {\n const { children, ref, ...rest } = props;\n return (\n <div {...rest} ref={ref} data-slot=\"card-footer\">\n {children}\n </div>\n );\n}\n"],"mappings":";;AAWA,SAAS,iBAAiB,SAAkC;AAC1D,QAAO,WAAW,YAAY,OAAO,UAAU,KAAA;;AAGjD,SAAS,iBAAiB,SAAkC;AAC1D,QAAO,WAAW,YAAY,YAAY,UAAU,KAAA;;AAGtD,SAAgB,KAAK,OAA+B;CAClD,MAAM,EAAE,UAAU,SAAS,UAAU,MAAM,KAAK,GAAG,SAAS;AAE5D,QACE,oBAAC,OAAD;EACE,GAAI;EACC;EACL,aAAU;EACV,gBAAc,iBAAiB,QAAQ;EACvC,gBAAc,iBAAiB,QAAQ;EAEtC;EACG,CAAA;;AAIV,SAAgB,WAAW,OAAqC;CAC9D,MAAM,EAAE,UAAU,KAAK,GAAG,SAAS;AACnC,QACE,oBAAC,OAAD;EAAK,GAAI;EAAW;EAAK,aAAU;EAChC;EACG,CAAA;;AAIV,SAAgB,UAAU,OAAoC;CAC5D,MAAM,EAAE,UAAU,KAAK,GAAG,SAAS;AACnC,QACE,oBAAC,MAAD;EAAI,GAAI;EAAW;EAAK,aAAU;EAC/B;EACE,CAAA;;AAIT,SAAgB,gBAAgB,OAA0C;CACxE,MAAM,EAAE,UAAU,KAAK,GAAG,SAAS;AACnC,QACE,oBAAC,KAAD;EAAG,GAAI;EAAW;EAAK,aAAU;EAC9B;EACC,CAAA;;AAIR,SAAgB,YAAY,OAAsC;CAChE,MAAM,EAAE,UAAU,KAAK,GAAG,SAAS;AACnC,QACE,oBAAC,OAAD;EAAK,GAAI;EAAW;EAAK,aAAU;EAChC;EACG,CAAA;;AAIV,SAAgB,WAAW,OAAqC;CAC9D,MAAM,EAAE,UAAU,KAAK,GAAG,SAAS;AACnC,QACE,oBAAC,OAAD;EAAK,GAAI;EAAW;EAAK,aAAU;EAChC;EACG,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Ref } from "@askrjs/askr/foundations";
|
|
2
|
+
|
|
3
|
+
//#region src/components/card/card.types.d.ts
|
|
4
|
+
type CardVariant = "default" | "raised";
|
|
5
|
+
type CardPadding = "sm" | "md" | "lg";
|
|
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
|
+
type CardProps = DivProps & {
|
|
10
|
+
children?: unknown;
|
|
11
|
+
variant?: CardVariant;
|
|
12
|
+
padding?: CardPadding;
|
|
13
|
+
ref?: Ref<HTMLDivElement>;
|
|
14
|
+
};
|
|
15
|
+
type CardHeaderProps = DivProps & {
|
|
16
|
+
children?: unknown;
|
|
17
|
+
ref?: Ref<HTMLDivElement>;
|
|
18
|
+
};
|
|
19
|
+
type CardContentProps = DivProps & {
|
|
20
|
+
children?: unknown;
|
|
21
|
+
ref?: Ref<HTMLDivElement>;
|
|
22
|
+
};
|
|
23
|
+
type CardFooterProps = DivProps & {
|
|
24
|
+
children?: unknown;
|
|
25
|
+
ref?: Ref<HTMLDivElement>;
|
|
26
|
+
};
|
|
27
|
+
type CardTitleProps = HeadingProps & {
|
|
28
|
+
children?: unknown;
|
|
29
|
+
ref?: Ref<HTMLHeadingElement>;
|
|
30
|
+
};
|
|
31
|
+
type CardDescriptionProps = ParagraphProps & {
|
|
32
|
+
children?: unknown;
|
|
33
|
+
ref?: Ref<HTMLParagraphElement>;
|
|
34
|
+
};
|
|
35
|
+
//#endregion
|
|
36
|
+
export { CardContentProps, CardDescriptionProps, CardFooterProps, CardHeaderProps, CardPadding, CardProps, CardTitleProps, CardVariant };
|
|
37
|
+
//# sourceMappingURL=card.types.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { BoxLayoutOwnProps } from "../box/box.types";
|
|
2
|
+
export declare function splitBoxLayoutProps<T extends Record<string, unknown>>(props: T): {
|
|
3
|
+
boxProps: Partial<BoxLayoutOwnProps>;
|
|
4
|
+
rest: Omit<T, keyof BoxLayoutOwnProps>;
|
|
5
|
+
};
|
|
6
|
+
export declare function applyBoxLayoutStyles(styles: Record<string, string | number>, boxProps: Partial<BoxLayoutOwnProps>): void;
|
|
7
|
+
export declare function withBoxLayoutStyle(styles: Record<string, string | number>, userStyle: unknown): string | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function classes(...values: Array<unknown>): string | undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { JSXElement } from "@askrjs/askr/foundations";
|
|
2
|
+
export declare function isJsxElement(value: unknown): value is JSXElement;
|
|
3
|
+
export declare function hasJsxIntrinsicType(value: unknown, expectedType: string): value is JSXElement;
|
|
4
|
+
export declare function toChildArray(children: unknown): unknown[];
|
|
5
|
+
export declare function mapJsxTree(children: unknown, mapper: (element: JSXElement) => unknown): unknown;
|
|
6
|
+
export declare function collectJsxElements(children: unknown, predicate?: (element: JSXElement) => boolean): JSXElement[];
|
|
7
|
+
export declare function extractTextContent(value: unknown): string;
|
|
8
|
+
export declare function serializeForId(value: unknown): string;
|