@askrjs/themes 0.0.3 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +78 -0
- package/THEMING.md +50 -8
- package/dist/{_internal → components/_internal}/box-layout.js +4 -3
- package/dist/components/_internal/box-layout.js.map +1 -0
- package/dist/components/_internal/classes.js.map +1 -0
- package/dist/components/_internal/jsx.js.map +1 -0
- package/dist/components/_internal/layout.d.ts +6 -28
- package/dist/{_internal → components/_internal}/layout.js +7 -16
- package/dist/components/_internal/layout.js.map +1 -0
- package/dist/{_internal → components/_internal}/merge-props.js +5 -0
- package/dist/components/_internal/merge-props.js.map +1 -0
- package/dist/components/_internal/pathname.js +39 -0
- package/dist/components/_internal/pathname.js.map +1 -0
- package/dist/components/_internal/style.js +41 -0
- package/dist/components/_internal/style.js.map +1 -0
- package/dist/components/alert/alert.d.ts +7 -0
- package/dist/components/alert/alert.js +65 -0
- package/dist/components/alert/alert.js.map +1 -0
- package/dist/components/alert/alert.types.d.ts +22 -0
- package/dist/components/alert/index.d.ts +2 -0
- package/dist/components/aspect-ratio/aspect-ratio.d.ts +8 -3
- package/dist/components/aspect-ratio/aspect-ratio.js +33 -0
- package/dist/components/aspect-ratio/aspect-ratio.js.map +1 -0
- package/dist/components/aspect-ratio/aspect-ratio.types.d.ts +18 -12
- package/dist/components/aspect-ratio/index.d.ts +2 -2
- package/dist/components/badge/badge.a11y.d.ts +13 -9
- package/dist/components/badge/badge.d.ts +8 -3
- package/dist/{badge → components/badge}/badge.js +5 -0
- package/dist/components/badge/badge.js.map +1 -0
- package/dist/components/badge/badge.types.d.ts +18 -12
- package/dist/components/badge/index.d.ts +3 -3
- package/dist/components/block/block.a11y.d.ts +20 -0
- package/dist/components/block/block.d.ts +9 -0
- package/dist/components/block/block.js +66 -0
- package/dist/components/block/block.js.map +1 -0
- package/dist/components/block/block.types.d.ts +38 -0
- package/dist/components/block/index.d.ts +3 -0
- package/dist/components/box/box.a11y.d.ts +13 -9
- package/dist/components/box/box.d.ts +9 -4
- package/dist/{box → components/box}/box.js +3 -2
- package/dist/components/box/box.js.map +1 -0
- package/dist/components/box/box.types.d.ts +67 -61
- package/dist/components/box/index.d.ts +3 -3
- package/dist/components/breadcrumb/breadcrumb.a11y.d.ts +13 -9
- package/dist/components/breadcrumb/breadcrumb.a11y.js +15 -0
- package/dist/components/breadcrumb/breadcrumb.a11y.js.map +1 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts +18 -13
- package/dist/components/breadcrumb/breadcrumb.js.map +1 -0
- package/dist/components/breadcrumb/breadcrumb.types.d.ts +64 -58
- package/dist/components/breadcrumb/index.d.ts +3 -3
- package/dist/components/button-group/button-group.d.ts +7 -0
- package/dist/components/button-group/button-group.js +20 -0
- package/dist/components/button-group/button-group.js.map +1 -0
- package/dist/components/button-group/button-group.types.d.ts +14 -0
- package/dist/components/button-group/index.d.ts +2 -0
- package/dist/components/card/card.d.ts +13 -7
- package/dist/components/card/card.js +95 -0
- package/dist/components/card/card.js.map +1 -0
- package/dist/components/card/card.types.d.ts +32 -24
- package/dist/components/card/index.d.ts +2 -2
- package/dist/components/close/close.d.ts +7 -0
- package/dist/components/close/close.js +22 -0
- package/dist/components/close/close.js.map +1 -0
- package/dist/components/close/close.types.d.ts +10 -0
- package/dist/components/close/index.d.ts +2 -0
- package/dist/components/container/container.a11y.d.ts +18 -15
- package/dist/components/container/container.d.ts +8 -3
- package/dist/{container → components/container}/container.js +10 -10
- package/dist/components/container/container.js.map +1 -0
- package/dist/components/container/container.types.d.ts +25 -26
- package/dist/components/container/index.d.ts +3 -3
- package/dist/components/empty-state/empty-state.d.ts +7 -2
- package/dist/components/empty-state/empty-state.js.map +1 -0
- package/dist/components/empty-state/empty-state.types.d.ts +15 -8
- package/dist/components/empty-state/index.d.ts +2 -2
- package/dist/components/field/field.d.ts +9 -0
- package/dist/components/field/field.js +41 -0
- package/dist/components/field/field.js.map +1 -0
- package/dist/components/field/field.types.d.ts +20 -0
- package/dist/components/field/index.d.ts +2 -0
- package/dist/components/flex/flex.a11y.d.ts +21 -17
- package/dist/components/flex/flex.d.ts +9 -4
- package/dist/{flex → components/flex}/flex.js +3 -2
- package/dist/components/flex/flex.js.map +1 -0
- package/dist/components/flex/flex.types.d.ts +38 -37
- package/dist/components/flex/index.d.ts +3 -3
- package/dist/components/header/header.a11y.d.ts +13 -9
- package/dist/components/header/header.a11y.js +12 -0
- package/dist/components/header/header.a11y.js.map +1 -0
- package/dist/components/header/header.d.ts +7 -2
- package/dist/components/header/header.js.map +1 -0
- package/dist/components/header/header.types.d.ts +8 -4
- package/dist/components/inline/index.d.ts +8 -6
- package/dist/components/inline/index.js.map +1 -0
- package/dist/components/input-group/index.d.ts +2 -0
- package/dist/components/input-group/input-group.d.ts +9 -0
- package/dist/components/input-group/input-group.js +39 -0
- package/dist/components/input-group/input-group.js.map +1 -0
- package/dist/components/input-group/input-group.types.d.ts +26 -0
- package/dist/components/list-group/index.d.ts +2 -0
- package/dist/components/list-group/list-group.d.ts +9 -0
- package/dist/components/list-group/list-group.js +43 -0
- package/dist/components/list-group/list-group.js.map +1 -0
- package/dist/components/list-group/list-group.types.d.ts +32 -0
- package/dist/components/nav/index.d.ts +2 -0
- package/dist/components/nav/nav.d.ts +13 -0
- package/dist/components/nav/nav.js +113 -0
- package/dist/components/nav/nav.js.map +1 -0
- package/dist/components/nav/nav.types.d.ts +56 -0
- package/dist/components/navbar/index.d.ts +5 -2
- package/dist/components/navbar/navbar-panel.js +48 -0
- package/dist/components/navbar/navbar-panel.js.map +1 -0
- package/dist/components/navbar/navbar.context.js +13 -0
- package/dist/components/navbar/navbar.context.js.map +1 -0
- package/dist/components/navbar/navbar.d.ts +45 -7
- package/dist/components/navbar/navbar.js +221 -0
- package/dist/components/navbar/navbar.js.map +1 -0
- package/dist/components/navbar/navbar.render.js +26 -0
- package/dist/components/navbar/navbar.render.js.map +1 -0
- package/dist/components/navbar/navbar.shared.js +18 -0
- package/dist/components/navbar/navbar.shared.js.map +1 -0
- package/dist/components/navbar/navbar.types.d.ts +29 -22
- package/dist/components/overlays/dropdown-content.d.ts +8 -0
- package/dist/components/overlays/dropdown-content.js +18 -0
- package/dist/components/overlays/dropdown-content.js.map +1 -0
- package/dist/components/pagination/index.d.ts +2 -0
- package/dist/components/pagination/pagination.d.ts +11 -0
- package/dist/components/pagination/pagination.js +95 -0
- package/dist/components/pagination/pagination.js.map +1 -0
- package/dist/components/pagination/pagination.types.d.ts +40 -0
- package/dist/components/section/index.d.ts +3 -3
- package/dist/components/section/section.a11y.d.ts +14 -10
- package/dist/components/section/section.d.ts +8 -3
- package/dist/{section → components/section}/section.js +3 -2
- package/dist/components/section/section.js.map +1 -0
- package/dist/components/section/section.types.d.ts +20 -14
- package/dist/components/separator/index.d.ts +3 -3
- package/dist/components/separator/separator.a11y.d.ts +13 -9
- package/dist/components/separator/separator.a11y.js +15 -0
- package/dist/components/separator/separator.a11y.js.map +1 -0
- package/dist/components/separator/separator.d.ts +8 -3
- package/dist/components/separator/separator.js.map +1 -0
- package/dist/components/separator/separator.types.d.ts +19 -13
- package/dist/components/shell/index.d.ts +3 -0
- package/dist/components/shell/shell-nav.types.d.ts +7 -0
- package/dist/components/shell/shell-panel.js +54 -0
- package/dist/components/shell/shell-panel.js.map +1 -0
- package/dist/components/shell/shell-responsive.js +110 -0
- package/dist/components/shell/shell-responsive.js.map +1 -0
- package/dist/components/shell/shell.a11y.d.ts +23 -0
- package/dist/components/shell/shell.a11y.js +23 -0
- package/dist/components/shell/shell.a11y.js.map +1 -0
- package/dist/components/shell/shell.d.ts +13 -0
- package/dist/components/shell/shell.js +69 -0
- package/dist/components/shell/shell.js.map +1 -0
- package/dist/components/shell/shell.types.d.ts +58 -0
- package/dist/components/sidebar/sidebar-panel.d.ts +7 -0
- package/dist/components/sidebar/sidebar-panel.js +59 -0
- package/dist/components/sidebar/sidebar-panel.js.map +1 -0
- package/dist/components/sidebar/sidebar-toggle.d.ts +7 -0
- package/dist/components/sidebar/sidebar-toggle.js +8 -0
- package/dist/components/sidebar/sidebar-toggle.js.map +1 -0
- package/dist/components/sidebar/sidebar.context.js +21 -0
- package/dist/components/sidebar/sidebar.context.js.map +1 -0
- package/dist/components/sidebar/sidebar.d.ts +7 -0
- package/dist/components/sidebar/sidebar.js +228 -0
- package/dist/components/sidebar/sidebar.js.map +1 -0
- package/dist/components/sidebar/sidebar.shared.js +12 -0
- package/dist/components/sidebar/sidebar.shared.js.map +1 -0
- package/dist/components/sidebar/sidebar.types.d.ts +30 -0
- package/dist/components/skeleton/index.d.ts +3 -3
- package/dist/components/skeleton/skeleton.a11y.d.ts +12 -8
- package/dist/components/skeleton/skeleton.d.ts +8 -3
- package/dist/components/skeleton/skeleton.js.map +1 -0
- package/dist/components/skeleton/skeleton.types.d.ts +16 -10
- package/dist/components/spacer/index.d.ts +3 -3
- package/dist/components/spacer/spacer.a11y.d.ts +16 -12
- package/dist/components/spacer/spacer.d.ts +8 -3
- package/dist/{spacer → components/spacer}/spacer.js +3 -1
- package/dist/components/spacer/spacer.js.map +1 -0
- package/dist/components/spacer/spacer.types.d.ts +23 -21
- package/dist/components/spinner/index.d.ts +2 -2
- package/dist/components/spinner/spinner.d.ts +7 -2
- package/dist/components/spinner/spinner.js.map +1 -0
- package/dist/components/spinner/spinner.types.d.ts +9 -4
- package/dist/components/stack/index.d.ts +3 -3
- package/dist/components/stack/stack.a11y.d.ts +17 -13
- package/dist/components/stack/stack.d.ts +8 -3
- package/dist/components/stack/stack.js.map +1 -0
- package/dist/components/stack/stack.types.d.ts +19 -13
- package/dist/components/theme/index.d.ts +1 -2
- package/dist/components/theme/theme.d.ts +41 -34
- package/dist/{theme → components/theme}/theme.js +33 -4
- package/dist/components/theme/theme.js.map +1 -0
- package/dist/controls.d.ts +10 -0
- package/dist/controls.js +7 -0
- package/dist/feedback.d.ts +5 -0
- package/dist/feedback.js +4 -0
- package/dist/layouts.d.ts +25 -0
- package/dist/layouts.js +11 -0
- package/dist/navs.d.ts +15 -0
- package/dist/navs.js +9 -0
- package/dist/overlays.d.ts +3 -0
- package/dist/overlays.js +4 -0
- package/dist/shells.d.ts +16 -0
- package/dist/shells.js +11 -0
- package/dist/surfaces.d.ts +16 -0
- package/dist/surfaces.js +9 -0
- package/dist/theme.d.ts +2 -0
- package/dist/theme.js +3 -0
- package/dist/themes/default/index.css +3191 -812
- package/package.json +63 -24
- package/src/components/_internal/box-layout.ts +8 -0
- package/src/components/_internal/jsx.ts +91 -16
- package/src/components/_internal/layout.ts +5 -17
- package/src/components/_internal/merge-props.ts +9 -0
- package/src/components/_internal/pathname.ts +67 -0
- package/src/components/_internal/style.ts +51 -0
- package/src/components/alert/alert.tsx +84 -0
- package/src/components/alert/alert.types.ts +20 -0
- package/src/components/alert/index.ts +2 -0
- package/src/components/aspect-ratio/aspect-ratio.tsx +10 -24
- package/src/components/aspect-ratio/aspect-ratio.types.ts +2 -1
- package/src/components/badge/badge.tsx +6 -0
- package/src/components/badge/badge.types.ts +2 -1
- package/src/components/block/block.a11y.ts +17 -0
- package/src/components/block/block.tsx +71 -0
- package/src/components/block/block.types.ts +60 -0
- package/src/components/block/index.ts +11 -0
- package/src/components/box/box.tsx +3 -2
- package/src/components/box/box.types.ts +2 -1
- package/src/components/breadcrumb/breadcrumb.types.ts +2 -1
- package/src/components/button-group/button-group.tsx +32 -0
- package/src/components/button-group/button-group.types.ts +12 -0
- package/src/components/button-group/index.ts +2 -0
- package/src/components/card/card.tsx +72 -43
- package/src/components/card/card.types.ts +6 -1
- package/src/components/card/index.ts +10 -1
- package/src/components/close/close.tsx +19 -0
- package/src/components/close/close.types.ts +7 -0
- package/src/components/close/index.ts +2 -0
- package/src/components/container/container.a11y.ts +0 -1
- package/src/components/container/container.tsx +13 -23
- package/src/components/container/container.types.ts +3 -4
- package/src/components/empty-state/empty-state.types.ts +3 -0
- package/src/components/field/field.tsx +36 -0
- package/src/components/field/field.types.ts +19 -0
- package/src/components/field/index.ts +2 -0
- package/src/components/flex/flex.tsx +4 -2
- package/src/components/flex/flex.types.ts +2 -1
- package/src/components/input-group/index.ts +7 -0
- package/src/components/input-group/input-group.tsx +57 -0
- package/src/components/input-group/input-group.types.ts +26 -0
- package/src/components/list-group/index.ts +7 -0
- package/src/components/list-group/list-group.tsx +74 -0
- package/src/components/list-group/list-group.types.ts +32 -0
- package/src/components/nav/index.ts +14 -0
- package/src/components/nav/nav.tsx +203 -0
- package/src/components/nav/nav.types.ts +68 -0
- package/src/components/navbar/index.ts +9 -2
- package/src/components/navbar/navbar-panel.tsx +67 -0
- package/src/components/navbar/navbar.context.ts +22 -0
- package/src/components/navbar/navbar.render.tsx +32 -0
- package/src/components/navbar/navbar.shared.ts +21 -0
- package/src/components/navbar/navbar.tsx +252 -99
- package/src/components/navbar/navbar.types.ts +36 -22
- package/src/components/overlays/dropdown-content.tsx +28 -0
- package/src/components/pagination/index.ts +8 -0
- package/src/components/pagination/pagination.tsx +158 -0
- package/src/components/pagination/pagination.types.ts +41 -0
- package/src/components/section/section.tsx +3 -2
- package/src/components/section/section.types.ts +2 -1
- package/src/components/separator/separator.types.ts +2 -1
- package/src/components/shell/index.ts +16 -0
- package/src/components/shell/shell-nav.types.ts +3 -0
- package/src/components/shell/shell-panel.tsx +85 -0
- package/src/components/shell/shell-responsive.tsx +212 -0
- package/src/components/shell/shell.a11y.ts +20 -0
- package/src/components/shell/shell.tsx +74 -0
- package/src/components/shell/shell.types.ts +71 -0
- package/src/components/sidebar/index.ts +5 -0
- package/src/components/sidebar/sidebar-panel.tsx +76 -0
- package/src/components/sidebar/sidebar-toggle.tsx +5 -0
- package/src/components/sidebar/sidebar.context.ts +40 -0
- package/src/components/sidebar/sidebar.shared.ts +12 -0
- package/src/components/sidebar/sidebar.tsx +355 -0
- package/src/components/sidebar/sidebar.types.ts +35 -0
- package/src/components/skeleton/skeleton.types.ts +2 -1
- package/src/components/spacer/spacer.tsx +4 -1
- package/src/components/spacer/spacer.types.ts +3 -2
- package/src/components/stack/stack.types.ts +2 -1
- package/src/components/theme/index.ts +10 -1
- package/src/components/theme/theme.tsx +15 -4
- package/src/controls.ts +18 -0
- package/src/feedback.ts +6 -0
- package/src/layouts.ts +19 -0
- package/src/navs.ts +26 -0
- package/src/overlays.ts +90 -0
- package/src/shells.ts +13 -0
- package/src/surfaces.ts +23 -0
- package/src/theme.ts +21 -0
- package/src/themes/default/index.css +13 -3
- package/src/themes/default/styles/actions/button-group.css +74 -0
- package/src/themes/default/styles/actions/button.css +48 -8
- package/src/themes/default/styles/actions/toggle-group.css +19 -12
- package/src/themes/default/styles/actions/toggle.css +16 -10
- package/src/themes/default/styles/base/icon.css +2 -0
- package/src/themes/default/styles/base/reset.css +28 -0
- package/src/themes/default/styles/base/typography.css +37 -17
- package/src/themes/default/styles/base/utilities.css +56 -39
- package/src/themes/default/styles/disclosure/accordion.css +22 -14
- package/src/themes/default/styles/disclosure/collapsible.css +22 -11
- package/src/themes/default/styles/display/alert.css +109 -0
- package/src/themes/default/styles/display/avatar.css +9 -4
- package/src/themes/default/styles/display/badge.css +12 -3
- package/src/themes/default/styles/display/card.css +16 -4
- package/src/themes/default/styles/display/coverage.css +93 -15
- package/src/themes/default/styles/display/list-group.css +84 -0
- package/src/themes/default/styles/display/progress-circle.css +3 -2
- package/src/themes/default/styles/display/progress.css +8 -5
- package/src/themes/default/styles/display/scroll-area.css +15 -0
- package/src/themes/default/styles/display/separator.css +4 -4
- package/src/themes/default/styles/display/skeleton.css +25 -2
- package/src/themes/default/styles/display/spinner.css +1 -1
- package/src/themes/default/styles/display/table.css +7 -4
- package/src/themes/default/styles/display/virtual-list.css +29 -0
- package/src/themes/default/styles/display/virtual-table.css +68 -0
- package/src/themes/default/styles/forms/checkbox.css +2 -1
- package/src/themes/default/styles/forms/field.css +22 -0
- package/src/themes/default/styles/forms/form.css +1 -1
- package/src/themes/default/styles/forms/input-group.css +202 -0
- package/src/themes/default/styles/forms/input.css +22 -6
- package/src/themes/default/styles/forms/label.css +2 -0
- package/src/themes/default/styles/forms/radio-group.css +22 -13
- package/src/themes/default/styles/forms/select.css +71 -26
- package/src/themes/default/styles/forms/slider.css +32 -16
- package/src/themes/default/styles/forms/switch.css +2 -1
- package/src/themes/default/styles/forms/textarea.css +35 -6
- package/src/themes/default/styles/layout/aspect-ratio.css +3 -1
- package/src/themes/default/styles/layout/block.css +23 -0
- package/src/themes/default/styles/layout/layout.css +1 -1
- package/src/themes/default/styles/layout/patterns.css +155 -3
- package/src/themes/default/styles/layout/responsive-layout.css +142 -121
- package/src/themes/default/styles/navigation/breadcrumb.css +7 -1
- package/src/themes/default/styles/navigation/menu.css +150 -7
- package/src/themes/default/styles/navigation/menubar.css +194 -28
- package/src/themes/default/styles/navigation/nav.css +231 -0
- package/src/themes/default/styles/navigation/pagination.css +91 -0
- package/src/themes/default/styles/overlays/alert-dialog.css +1 -1
- package/src/themes/default/styles/overlays/dialog.css +42 -10
- package/src/themes/default/styles/overlays/dropdown.css +160 -0
- package/src/themes/default/styles/overlays/hover-card.css +28 -3
- package/src/themes/default/styles/overlays/popover.css +50 -6
- package/src/themes/default/styles/overlays/toast.css +66 -17
- package/src/themes/default/styles/overlays/tooltip.css +45 -18
- package/src/themes/default/styles/shell/header.css +18 -3
- package/src/themes/default/styles/shell/navbar.css +434 -73
- package/src/themes/default/styles/shell/sidebar.css +830 -0
- package/src/themes/default/styles/shell/theme.css +7 -5
- package/src/themes/default/tokens.css +186 -123
- package/src/themes/presets/calico.css +46 -0
- package/src/themes/presets/ginger.css +46 -0
- package/src/themes/presets/index.css +5 -0
- package/src/themes/presets/tabby.css +46 -0
- package/src/themes/presets/torty.css +49 -0
- package/src/themes/presets/tuxedo.css +49 -0
- package/templates/theme/index.css +14 -4
- package/templates/theme/styles/actions/button-group.css +74 -0
- package/templates/theme/styles/actions/button.css +48 -8
- package/templates/theme/styles/actions/toggle-group.css +19 -12
- package/templates/theme/styles/actions/toggle.css +16 -10
- package/templates/theme/styles/base/icon.css +2 -0
- package/templates/theme/styles/base/reset.css +28 -0
- package/templates/theme/styles/base/typography.css +37 -17
- package/templates/theme/styles/disclosure/accordion.css +22 -14
- package/templates/theme/styles/disclosure/collapsible.css +22 -11
- package/templates/theme/styles/display/alert.css +109 -0
- package/templates/theme/styles/display/avatar.css +9 -4
- package/templates/theme/styles/display/badge.css +12 -3
- package/templates/theme/styles/display/card.css +16 -4
- package/templates/theme/styles/display/coverage.css +194 -14
- package/templates/theme/styles/display/list-group.css +84 -0
- package/templates/theme/styles/display/progress-circle.css +3 -2
- package/templates/theme/styles/display/progress.css +8 -5
- package/templates/theme/styles/display/scroll-area.css +15 -0
- package/templates/theme/styles/display/separator.css +4 -4
- package/templates/theme/styles/display/skeleton.css +25 -2
- package/templates/theme/styles/display/spinner.css +1 -1
- package/templates/theme/styles/display/table.css +7 -4
- package/templates/theme/styles/display/virtual-list.css +29 -0
- package/templates/theme/styles/display/virtual-table.css +68 -0
- package/templates/theme/styles/forms/checkbox.css +2 -1
- package/templates/theme/styles/forms/field.css +22 -0
- package/templates/theme/styles/forms/form.css +1 -1
- package/templates/theme/styles/forms/input-group.css +202 -0
- package/templates/theme/styles/forms/input.css +22 -6
- package/templates/theme/styles/forms/label.css +2 -0
- package/templates/theme/styles/forms/radio-group.css +22 -13
- package/templates/theme/styles/forms/select.css +71 -26
- package/templates/theme/styles/forms/slider.css +32 -16
- package/templates/theme/styles/forms/switch.css +2 -1
- package/templates/theme/styles/forms/textarea.css +35 -6
- package/templates/theme/styles/layout/aspect-ratio.css +3 -1
- package/templates/theme/styles/layout/block.css +23 -0
- package/templates/theme/styles/layout/patterns.css +155 -3
- package/templates/theme/styles/layout/responsive-layout.css +142 -121
- package/templates/theme/styles/navigation/breadcrumb.css +22 -8
- package/templates/theme/styles/navigation/menu.css +150 -7
- package/templates/theme/styles/navigation/menubar.css +194 -28
- package/templates/theme/styles/navigation/nav.css +231 -0
- package/templates/theme/styles/navigation/pagination.css +91 -0
- package/templates/theme/styles/overlays/alert-dialog.css +1 -1
- package/templates/theme/styles/overlays/dialog.css +42 -10
- package/templates/theme/styles/overlays/dropdown.css +160 -0
- package/templates/theme/styles/overlays/hover-card.css +28 -3
- package/templates/theme/styles/overlays/popover.css +50 -6
- package/templates/theme/styles/overlays/toast.css +66 -17
- package/templates/theme/styles/overlays/tooltip.css +45 -18
- package/templates/theme/styles/shell/header.css +18 -3
- package/templates/theme/styles/shell/navbar.css +434 -73
- package/templates/theme/styles/shell/sidebar.css +809 -0
- package/templates/theme/styles/shell/theme.css +7 -5
- package/templates/theme/tokens.css +186 -123
- package/dist/_internal/box-layout.js.map +0 -1
- package/dist/_internal/classes.js.map +0 -1
- package/dist/_internal/jsx.js.map +0 -1
- package/dist/_internal/layout.d.ts +0 -9
- package/dist/_internal/layout.js.map +0 -1
- package/dist/_internal/merge-props.js.map +0 -1
- package/dist/accessible-icon/accessible-icon.d.ts +0 -7
- package/dist/accessible-icon/accessible-icon.js +0 -20
- package/dist/accessible-icon/accessible-icon.js.map +0 -1
- package/dist/accessible-icon/accessible-icon.types.d.ts +0 -9
- package/dist/aspect-ratio/aspect-ratio.d.ts +0 -8
- package/dist/aspect-ratio/aspect-ratio.js +0 -36
- package/dist/aspect-ratio/aspect-ratio.js.map +0 -1
- package/dist/aspect-ratio/aspect-ratio.types.d.ts +0 -20
- package/dist/aspect-ratio/index.d.ts +0 -2
- package/dist/badge/badge.d.ts +0 -8
- package/dist/badge/badge.js.map +0 -1
- package/dist/badge/badge.types.d.ts +0 -20
- package/dist/badge/index.d.ts +0 -2
- package/dist/box/box.d.ts +0 -9
- package/dist/box/box.js.map +0 -1
- package/dist/box/box.types.d.ts +0 -71
- package/dist/box/index.d.ts +0 -2
- package/dist/breadcrumb/breadcrumb.d.ts +0 -18
- package/dist/breadcrumb/breadcrumb.js.map +0 -1
- package/dist/breadcrumb/breadcrumb.types.d.ts +0 -64
- package/dist/breadcrumb/index.d.ts +0 -2
- package/dist/card/card.d.ts +0 -12
- package/dist/card/card.js +0 -68
- package/dist/card/card.js.map +0 -1
- package/dist/card/card.types.d.ts +0 -37
- package/dist/card/index.d.ts +0 -2
- package/dist/components/_internal/box-layout.d.ts +0 -7
- package/dist/components/_internal/classes.d.ts +0 -1
- package/dist/components/_internal/jsx.d.ts +0 -8
- package/dist/components/_internal/merge-props.d.ts +0 -1
- package/dist/components/_internal/style.d.ts +0 -1
- package/dist/components/accessible-icon/accessible-icon.d.ts +0 -2
- package/dist/components/accessible-icon/accessible-icon.types.d.ts +0 -5
- package/dist/components/accessible-icon/index.d.ts +0 -2
- package/dist/components/grid/grid.a11y.d.ts +0 -21
- package/dist/components/grid/grid.d.ts +0 -4
- package/dist/components/grid/grid.types.d.ts +0 -37
- package/dist/components/grid/index.d.ts +0 -3
- package/dist/components/header/index.d.ts +0 -3
- package/dist/components/index.d.ts +0 -49
- package/dist/components/index.js +0 -28
- package/dist/components/logos/create-logo.d.ts +0 -5
- package/dist/components/logos/github-logo.d.ts +0 -4
- package/dist/components/logos/google-logo.d.ts +0 -4
- package/dist/components/logos/index.d.ts +0 -5
- package/dist/components/logos/microsoft-logo.d.ts +0 -4
- package/dist/components/logos/types.d.ts +0 -14
- package/dist/components/sidebar-layout/index.d.ts +0 -3
- package/dist/components/sidebar-layout/sidebar-layout.a11y.d.ts +0 -15
- package/dist/components/sidebar-layout/sidebar-layout.d.ts +0 -2
- package/dist/components/sidebar-layout/sidebar-layout.types.d.ts +0 -20
- package/dist/components/topbar-layout/index.d.ts +0 -3
- package/dist/components/topbar-layout/topbar-layout.a11y.d.ts +0 -13
- package/dist/components/topbar-layout/topbar-layout.d.ts +0 -2
- package/dist/components/topbar-layout/topbar-layout.types.d.ts +0 -12
- package/dist/container/container.d.ts +0 -8
- package/dist/container/container.js.map +0 -1
- package/dist/container/container.types.d.ts +0 -28
- package/dist/container/index.d.ts +0 -2
- package/dist/empty-state/empty-state.d.ts +0 -7
- package/dist/empty-state/empty-state.js.map +0 -1
- package/dist/empty-state/empty-state.types.d.ts +0 -13
- package/dist/flex/flex.d.ts +0 -9
- package/dist/flex/flex.js.map +0 -1
- package/dist/flex/flex.types.d.ts +0 -41
- package/dist/flex/index.d.ts +0 -2
- package/dist/grid/grid.d.ts +0 -9
- package/dist/grid/grid.js +0 -115
- package/dist/grid/grid.js.map +0 -1
- package/dist/grid/grid.types.d.ts +0 -40
- package/dist/grid/index.d.ts +0 -2
- package/dist/header/header.d.ts +0 -7
- package/dist/header/header.js.map +0 -1
- package/dist/header/header.types.d.ts +0 -9
- package/dist/inline/index.d.ts +0 -7
- package/dist/inline/index.js.map +0 -1
- package/dist/logos/create-logo.d.ts +0 -1
- package/dist/logos/create-logo.js +0 -75
- package/dist/logos/create-logo.js.map +0 -1
- package/dist/logos/github-logo.d.ts +0 -18
- package/dist/logos/github-logo.js +0 -9
- package/dist/logos/github-logo.js.map +0 -1
- package/dist/logos/google-logo.d.ts +0 -18
- package/dist/logos/google-logo.js +0 -23
- package/dist/logos/google-logo.js.map +0 -1
- package/dist/logos/index.d.ts +0 -4
- package/dist/logos/microsoft-logo.d.ts +0 -18
- package/dist/logos/microsoft-logo.js +0 -35
- package/dist/logos/microsoft-logo.js.map +0 -1
- package/dist/logos/types.d.ts +0 -16
- package/dist/navbar/index.d.ts +0 -2
- package/dist/navbar/navbar.d.ts +0 -12
- package/dist/navbar/navbar.js +0 -103
- package/dist/navbar/navbar.js.map +0 -1
- package/dist/navbar/navbar.types.d.ts +0 -31
- package/dist/section/index.d.ts +0 -2
- package/dist/section/section.d.ts +0 -8
- package/dist/section/section.js.map +0 -1
- package/dist/section/section.types.d.ts +0 -22
- package/dist/separator/index.d.ts +0 -2
- package/dist/separator/separator.d.ts +0 -8
- package/dist/separator/separator.js.map +0 -1
- package/dist/separator/separator.types.d.ts +0 -21
- package/dist/sidebar-layout/index.d.ts +0 -2
- package/dist/sidebar-layout/sidebar-layout.d.ts +0 -7
- package/dist/sidebar-layout/sidebar-layout.js +0 -51
- package/dist/sidebar-layout/sidebar-layout.js.map +0 -1
- package/dist/sidebar-layout/sidebar-layout.types.d.ts +0 -20
- package/dist/skeleton/index.d.ts +0 -2
- package/dist/skeleton/skeleton.d.ts +0 -8
- package/dist/skeleton/skeleton.js.map +0 -1
- package/dist/skeleton/skeleton.types.d.ts +0 -18
- package/dist/spacer/index.d.ts +0 -2
- package/dist/spacer/spacer.d.ts +0 -8
- package/dist/spacer/spacer.js.map +0 -1
- package/dist/spacer/spacer.types.d.ts +0 -25
- package/dist/spinner/index.d.ts +0 -2
- package/dist/spinner/spinner.d.ts +0 -7
- package/dist/spinner/spinner.js.map +0 -1
- package/dist/spinner/spinner.types.d.ts +0 -10
- package/dist/stack/index.d.ts +0 -2
- package/dist/stack/stack.d.ts +0 -8
- package/dist/stack/stack.js.map +0 -1
- package/dist/stack/stack.types.d.ts +0 -21
- package/dist/theme/index.d.ts +0 -1
- package/dist/theme/theme.d.ts +0 -44
- package/dist/theme/theme.js.map +0 -1
- package/dist/topbar-layout/index.d.ts +0 -2
- package/dist/topbar-layout/topbar-layout.d.ts +0 -7
- package/dist/topbar-layout/topbar-layout.js +0 -37
- package/dist/topbar-layout/topbar-layout.js.map +0 -1
- package/dist/topbar-layout/topbar-layout.types.d.ts +0 -13
- package/src/askr-compat.d.ts +0 -110
- package/src/askr-router.d.ts +0 -16
- package/src/components/accessible-icon/accessible-icon.tsx +0 -18
- package/src/components/accessible-icon/accessible-icon.types.ts +0 -5
- package/src/components/accessible-icon/index.ts +0 -2
- package/src/components/grid/grid.a11y.ts +0 -22
- package/src/components/grid/grid.tsx +0 -172
- package/src/components/grid/grid.types.ts +0 -45
- package/src/components/grid/index.ts +0 -10
- package/src/components/index.ts +0 -108
- package/src/components/logos/create-logo.tsx +0 -103
- package/src/components/logos/github-logo.tsx +0 -13
- package/src/components/logos/google-logo.tsx +0 -34
- package/src/components/logos/index.ts +0 -5
- package/src/components/logos/microsoft-logo.tsx +0 -10
- package/src/components/logos/types.ts +0 -24
- package/src/components/sidebar-layout/index.ts +0 -6
- package/src/components/sidebar-layout/sidebar-layout.a11y.ts +0 -16
- package/src/components/sidebar-layout/sidebar-layout.tsx +0 -59
- package/src/components/sidebar-layout/sidebar-layout.types.ts +0 -22
- package/src/components/topbar-layout/index.ts +0 -3
- package/src/components/topbar-layout/topbar-layout.a11y.ts +0 -14
- package/src/components/topbar-layout/topbar-layout.tsx +0 -39
- package/src/components/topbar-layout/topbar-layout.types.ts +0 -13
- package/src/themes/default/styles/layout/dashboard-layout.css +0 -15
- package/src/themes/default/styles/layout/docs-layout.css +0 -10
- package/src/themes/default/styles/layout/sidebar.css +0 -10
- package/src/themes/default/styles/navigation/navigation-menu.css +0 -90
- package/src/themes/default/styles/navigation/tabs.css +0 -61
- package/src/themes/default/styles/overlays/dropdown-menu.css +0 -109
- package/templates/theme/styles/layout/dashboard-layout.css +0 -16
- package/templates/theme/styles/layout/docs-layout.css +0 -11
- package/templates/theme/styles/layout/sidebar.css +0 -11
- package/templates/theme/styles/navigation/navigation-menu.css +0 -90
- package/templates/theme/styles/navigation/tabs.css +0 -61
- package/templates/theme/styles/overlays/dropdown-menu.css +0 -109
- /package/dist/{_internal → components/_internal}/classes.js +0 -0
- /package/dist/{_internal → components/_internal}/jsx.js +0 -0
- /package/dist/{breadcrumb → components/breadcrumb}/breadcrumb.js +0 -0
- /package/dist/{empty-state → components/empty-state}/empty-state.js +0 -0
- /package/dist/{header → components/header}/header.js +0 -0
- /package/dist/{inline → components/inline}/index.js +0 -0
- /package/dist/{separator → components/separator}/separator.js +0 -0
- /package/dist/{skeleton → components/skeleton}/skeleton.js +0 -0
- /package/dist/{spinner → components/spinner}/spinner.js +0 -0
- /package/dist/{stack → components/stack}/stack.js +0 -0
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { Slot } from "@askrjs/askr/foundations";
|
|
2
|
+
import { classes } from "../_internal/classes";
|
|
2
3
|
import { mergeProps } from "../_internal/merge-props";
|
|
3
4
|
import type { BadgeAsChildProps, BadgeProps } from "./badge.types";
|
|
4
5
|
|
|
6
|
+
function normalizeBadgeVariant(variant: BadgeProps["variant"] | undefined) {
|
|
7
|
+
return variant && variant !== "default" ? `badge-${variant}` : undefined;
|
|
8
|
+
}
|
|
9
|
+
|
|
5
10
|
export function Badge(props: BadgeProps): JSX.Element;
|
|
6
11
|
export function Badge(props: BadgeAsChildProps): JSX.Element;
|
|
7
12
|
export function Badge(props: BadgeProps | BadgeAsChildProps) {
|
|
8
13
|
const { asChild, children, variant, ref, ...rest } = props;
|
|
9
14
|
const finalProps = mergeProps(rest, {
|
|
15
|
+
class: classes("badge", normalizeBadgeVariant(variant)),
|
|
10
16
|
ref,
|
|
11
17
|
"data-slot": "badge",
|
|
12
18
|
"data-badge": "true",
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const BLOCK_A11Y_CONTRACT = {
|
|
2
|
+
DATA_ATTRIBUTES: {
|
|
3
|
+
slot: "data-slot" as const,
|
|
4
|
+
layout: "data-ak-layout" as const,
|
|
5
|
+
gap: "data-gap" as const,
|
|
6
|
+
gapX: "data-gap-x" as const,
|
|
7
|
+
gapY: "data-gap-y" as const,
|
|
8
|
+
align: "data-align" as const,
|
|
9
|
+
justify: "data-justify" as const,
|
|
10
|
+
size: "data-size" as const,
|
|
11
|
+
},
|
|
12
|
+
SLOT_VALUES: {
|
|
13
|
+
root: "block" as const,
|
|
14
|
+
},
|
|
15
|
+
} as const;
|
|
16
|
+
|
|
17
|
+
export type BlockA11yContract = typeof BLOCK_A11Y_CONTRACT;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Slot } from "@askrjs/askr/foundations";
|
|
2
|
+
import { mergeProps } from "../_internal/merge-props";
|
|
3
|
+
import { serializeResponsiveValueIf } from "../_internal/layout";
|
|
4
|
+
import type { BlockAsChildProps, BlockDivProps, BlockSpanProps } from "./block.types";
|
|
5
|
+
|
|
6
|
+
const SPACE_TOKENS = new Set([
|
|
7
|
+
"1",
|
|
8
|
+
"2",
|
|
9
|
+
"3",
|
|
10
|
+
"4",
|
|
11
|
+
"5",
|
|
12
|
+
"6",
|
|
13
|
+
"7",
|
|
14
|
+
"8",
|
|
15
|
+
"9",
|
|
16
|
+
"xs",
|
|
17
|
+
"sm",
|
|
18
|
+
"md",
|
|
19
|
+
"lg",
|
|
20
|
+
"xl",
|
|
21
|
+
"2xl",
|
|
22
|
+
"3xl",
|
|
23
|
+
]);
|
|
24
|
+
|
|
25
|
+
export function Block(props: BlockDivProps): JSX.Element;
|
|
26
|
+
export function Block(props: BlockSpanProps): JSX.Element;
|
|
27
|
+
export function Block(props: BlockAsChildProps): JSX.Element;
|
|
28
|
+
export function Block(props: BlockDivProps | BlockSpanProps | BlockAsChildProps) {
|
|
29
|
+
const as = "as" in props ? props.as : "div";
|
|
30
|
+
const { asChild, children, gap, gapX, gapY, align, justify, size = "md", ref, ...rest } = props;
|
|
31
|
+
|
|
32
|
+
const finalProps = mergeProps(rest, {
|
|
33
|
+
ref,
|
|
34
|
+
"data-slot": "block",
|
|
35
|
+
"data-ak-layout": "true",
|
|
36
|
+
"data-gap": serializeResponsiveValueIf(
|
|
37
|
+
gap,
|
|
38
|
+
(value) => typeof value === "string" && SPACE_TOKENS.has(value.trim()),
|
|
39
|
+
),
|
|
40
|
+
"data-gap-x": serializeResponsiveValueIf(
|
|
41
|
+
gapX,
|
|
42
|
+
(value) => typeof value === "string" && SPACE_TOKENS.has(value.trim()),
|
|
43
|
+
),
|
|
44
|
+
"data-gap-y": serializeResponsiveValueIf(
|
|
45
|
+
gapY,
|
|
46
|
+
(value) => typeof value === "string" && SPACE_TOKENS.has(value.trim()),
|
|
47
|
+
),
|
|
48
|
+
"data-align": serializeResponsiveValueIf(
|
|
49
|
+
align,
|
|
50
|
+
(value) =>
|
|
51
|
+
typeof value === "string" &&
|
|
52
|
+
["start", "end", "center", "stretch", "baseline"].includes(value.trim()),
|
|
53
|
+
),
|
|
54
|
+
"data-justify": serializeResponsiveValueIf(
|
|
55
|
+
justify,
|
|
56
|
+
(value) =>
|
|
57
|
+
typeof value === "string" && ["start", "end", "center", "between"].includes(value.trim()),
|
|
58
|
+
),
|
|
59
|
+
"data-size": `initial:${size}`,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
if (asChild) {
|
|
63
|
+
return <Slot asChild {...finalProps} children={children as JSX.Element} />;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (as === "span") {
|
|
67
|
+
return <span {...finalProps}>{children}</span>;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return <div {...finalProps}>{children}</div>;
|
|
71
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { JSXElement } from "@askrjs/askr/foundations";
|
|
2
|
+
import type { Ref } from "@askrjs/askr/foundations/utilities";
|
|
3
|
+
|
|
4
|
+
export type BlockSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
5
|
+
|
|
6
|
+
export type BlockSpace =
|
|
7
|
+
| "1"
|
|
8
|
+
| "2"
|
|
9
|
+
| "3"
|
|
10
|
+
| "4"
|
|
11
|
+
| "5"
|
|
12
|
+
| "6"
|
|
13
|
+
| "7"
|
|
14
|
+
| "8"
|
|
15
|
+
| "9"
|
|
16
|
+
| "xs"
|
|
17
|
+
| "sm"
|
|
18
|
+
| "md"
|
|
19
|
+
| "lg"
|
|
20
|
+
| "xl"
|
|
21
|
+
| "2xl"
|
|
22
|
+
| "3xl";
|
|
23
|
+
|
|
24
|
+
export type BlockAlign = "start" | "end" | "center" | "stretch" | "baseline";
|
|
25
|
+
|
|
26
|
+
export type BlockJustify = "start" | "end" | "center" | "between";
|
|
27
|
+
|
|
28
|
+
export type BlockOwnProps = {
|
|
29
|
+
gap?: BlockSpace;
|
|
30
|
+
gapX?: BlockSpace;
|
|
31
|
+
gapY?: BlockSpace;
|
|
32
|
+
align?: BlockAlign;
|
|
33
|
+
justify?: BlockJustify;
|
|
34
|
+
size?: BlockSize;
|
|
35
|
+
as?: "div" | "span";
|
|
36
|
+
children?: unknown;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export type BlockNativeProps = Omit<JSX.IntrinsicElements["div"], "children" | "ref"> &
|
|
40
|
+
BlockOwnProps & {
|
|
41
|
+
as?: "div";
|
|
42
|
+
asChild?: false;
|
|
43
|
+
ref?: Ref<HTMLDivElement>;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export type BlockSpanProps = Omit<JSX.IntrinsicElements["span"], "children" | "ref"> &
|
|
47
|
+
BlockOwnProps & {
|
|
48
|
+
as: "span";
|
|
49
|
+
asChild?: false;
|
|
50
|
+
ref?: Ref<HTMLSpanElement>;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export type BlockAsChildProps = Omit<BlockOwnProps, "as"> & {
|
|
54
|
+
asChild: true;
|
|
55
|
+
children: JSXElement;
|
|
56
|
+
ref?: Ref<unknown>;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export type BlockDivProps = BlockNativeProps;
|
|
60
|
+
export type BlockProps = BlockDivProps | BlockSpanProps | BlockAsChildProps;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { Block } from "./block";
|
|
2
|
+
export { BLOCK_A11Y_CONTRACT, type BlockA11yContract } from "./block.a11y";
|
|
3
|
+
export type {
|
|
4
|
+
BlockAsChildProps,
|
|
5
|
+
BlockDivProps,
|
|
6
|
+
BlockNativeProps,
|
|
7
|
+
BlockOwnProps,
|
|
8
|
+
BlockProps,
|
|
9
|
+
BlockSize,
|
|
10
|
+
BlockSpanProps,
|
|
11
|
+
} from "./block.types";
|
|
@@ -3,7 +3,7 @@ import { mergeProps } from "../_internal/merge-props";
|
|
|
3
3
|
import {
|
|
4
4
|
applyBoxLayoutStyles,
|
|
5
5
|
splitBoxLayoutProps,
|
|
6
|
-
|
|
6
|
+
withBoxLayoutClass,
|
|
7
7
|
} from "../_internal/box-layout";
|
|
8
8
|
import type { BoxAsChildProps, BoxDivProps, BoxSpanProps } from "./box.types";
|
|
9
9
|
|
|
@@ -17,12 +17,13 @@ export function Box(props: BoxDivProps | BoxSpanProps | BoxAsChildProps) {
|
|
|
17
17
|
const { boxProps, rest: passthroughProps } = splitBoxLayoutProps(rest);
|
|
18
18
|
const layoutStyle: Record<string, string | number> = {};
|
|
19
19
|
applyBoxLayoutStyles(layoutStyle, boxProps);
|
|
20
|
+
const layoutClass = withBoxLayoutClass(layoutStyle, userStyle);
|
|
20
21
|
|
|
21
22
|
const finalProps = mergeProps(passthroughProps, {
|
|
22
23
|
ref,
|
|
23
24
|
"data-slot": "box",
|
|
24
25
|
"data-ak-layout": "true",
|
|
25
|
-
|
|
26
|
+
...(layoutClass ? { class: layoutClass } : {}),
|
|
26
27
|
});
|
|
27
28
|
|
|
28
29
|
if (asChild) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { JSXElement
|
|
1
|
+
import type { JSXElement } from "@askrjs/askr/foundations";
|
|
2
|
+
import type { Ref } from "@askrjs/askr/foundations/utilities";
|
|
2
3
|
import type { ResponsiveValue } from "../_internal/layout";
|
|
3
4
|
|
|
4
5
|
export type LayoutResponsive<T> = ResponsiveValue<T>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { classes } from "../_internal/classes";
|
|
2
|
+
import { ButtonGroupProps } from "./button-group.types";
|
|
3
|
+
|
|
4
|
+
export function ButtonGroup(props: ButtonGroupProps): JSX.Element {
|
|
5
|
+
const {
|
|
6
|
+
attached = true,
|
|
7
|
+
children,
|
|
8
|
+
class: className,
|
|
9
|
+
orientation = "horizontal",
|
|
10
|
+
ref,
|
|
11
|
+
role,
|
|
12
|
+
...rest
|
|
13
|
+
} = props;
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<div
|
|
17
|
+
{...rest}
|
|
18
|
+
ref={ref}
|
|
19
|
+
class={classes(
|
|
20
|
+
"btn-group",
|
|
21
|
+
orientation === "vertical" ? "btn-group-vertical" : undefined,
|
|
22
|
+
className,
|
|
23
|
+
)}
|
|
24
|
+
data-attached={attached ? "true" : "false"}
|
|
25
|
+
data-orientation={orientation}
|
|
26
|
+
data-slot="button-group"
|
|
27
|
+
role={role ?? "group"}
|
|
28
|
+
>
|
|
29
|
+
{children}
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Ref } from "@askrjs/askr/foundations/utilities";
|
|
2
|
+
|
|
3
|
+
export type ButtonGroupOrientation = "horizontal" | "vertical";
|
|
4
|
+
|
|
5
|
+
type DivProps = Omit<JSX.IntrinsicElements["div"], "children" | "ref">;
|
|
6
|
+
|
|
7
|
+
export type ButtonGroupProps = DivProps & {
|
|
8
|
+
children?: unknown;
|
|
9
|
+
attached?: boolean;
|
|
10
|
+
orientation?: ButtonGroupOrientation;
|
|
11
|
+
ref?: Ref<HTMLDivElement>;
|
|
12
|
+
};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { classes } from "../_internal/classes";
|
|
2
|
+
import { mergeProps } from "../_internal/merge-props";
|
|
1
3
|
import type {
|
|
4
|
+
CardActionsProps,
|
|
2
5
|
CardContentProps,
|
|
3
6
|
CardDescriptionProps,
|
|
4
7
|
CardFooterProps,
|
|
@@ -18,62 +21,88 @@ function normalizeVariant(variant: CardVariant | undefined) {
|
|
|
18
21
|
}
|
|
19
22
|
|
|
20
23
|
export function Card(props: CardProps): JSX.Element {
|
|
21
|
-
const { children, variant, padding = "md", ref, ...rest } = props;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
const { children, class: className, variant, padding = "md", ref, ...rest } = props;
|
|
25
|
+
const normalizedVariant = normalizeVariant(variant);
|
|
26
|
+
const normalizedPadding = normalizePadding(padding);
|
|
27
|
+
|
|
28
|
+
const finalProps = mergeProps(rest, {
|
|
29
|
+
ref,
|
|
30
|
+
class: classes(
|
|
31
|
+
"card",
|
|
32
|
+
normalizedVariant && `card-${normalizedVariant}`,
|
|
33
|
+
normalizedPadding && `card-${normalizedPadding}`,
|
|
34
|
+
className,
|
|
35
|
+
),
|
|
36
|
+
"data-padding": normalizedPadding,
|
|
37
|
+
"data-slot": "card",
|
|
38
|
+
"data-variant": normalizedVariant,
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
return <div {...finalProps}>{children}</div>;
|
|
34
42
|
}
|
|
35
43
|
|
|
36
44
|
export function CardHeader(props: CardHeaderProps): JSX.Element {
|
|
37
|
-
const { children, ref, ...rest } = props;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
);
|
|
45
|
+
const { children, class: className, ref, ...rest } = props;
|
|
46
|
+
const finalProps = mergeProps(rest, {
|
|
47
|
+
ref,
|
|
48
|
+
class: classes("card-header", className),
|
|
49
|
+
"data-slot": "card-header",
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
return <div {...finalProps}>{children}</div>;
|
|
43
53
|
}
|
|
44
54
|
|
|
45
55
|
export function CardTitle(props: CardTitleProps): JSX.Element {
|
|
46
|
-
const { children, ref, ...rest } = props;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
);
|
|
56
|
+
const { children, class: className, ref, ...rest } = props;
|
|
57
|
+
const finalProps = mergeProps(rest, {
|
|
58
|
+
ref,
|
|
59
|
+
class: classes("card-title", className),
|
|
60
|
+
"data-slot": "card-title",
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
return <h3 {...finalProps}>{children}</h3>;
|
|
52
64
|
}
|
|
53
65
|
|
|
54
66
|
export function CardDescription(props: CardDescriptionProps): JSX.Element {
|
|
55
|
-
const { children, ref, ...rest } = props;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
);
|
|
67
|
+
const { children, class: className, ref, ...rest } = props;
|
|
68
|
+
const finalProps = mergeProps(rest, {
|
|
69
|
+
ref,
|
|
70
|
+
class: classes("card-description", className),
|
|
71
|
+
"data-slot": "card-description",
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
return <p {...finalProps}>{children}</p>;
|
|
61
75
|
}
|
|
62
76
|
|
|
63
77
|
export function CardContent(props: CardContentProps): JSX.Element {
|
|
64
|
-
const { children, ref, ...rest } = props;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
);
|
|
78
|
+
const { children, class: className, ref, ...rest } = props;
|
|
79
|
+
const finalProps = mergeProps(rest, {
|
|
80
|
+
ref,
|
|
81
|
+
class: classes("card-content", className),
|
|
82
|
+
"data-slot": "card-content",
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
return <div {...finalProps}>{children}</div>;
|
|
70
86
|
}
|
|
71
87
|
|
|
72
88
|
export function CardFooter(props: CardFooterProps): JSX.Element {
|
|
73
|
-
const { children, ref, ...rest } = props;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
);
|
|
89
|
+
const { children, class: className, ref, ...rest } = props;
|
|
90
|
+
const finalProps = mergeProps(rest, {
|
|
91
|
+
ref,
|
|
92
|
+
class: classes("card-footer", className),
|
|
93
|
+
"data-slot": "card-footer",
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
return <div {...finalProps}>{children}</div>;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export function CardActions(props: CardActionsProps): JSX.Element {
|
|
100
|
+
const { children, class: className, ref, ...rest } = props;
|
|
101
|
+
const finalProps = mergeProps(rest, {
|
|
102
|
+
ref,
|
|
103
|
+
class: classes("card-actions", className),
|
|
104
|
+
"data-slot": "card-actions",
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
return <div {...finalProps}>{children}</div>;
|
|
79
108
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Ref } from "@askrjs/askr/foundations";
|
|
1
|
+
import type { Ref } from "@askrjs/askr/foundations/utilities";
|
|
2
2
|
|
|
3
3
|
export type CardVariant = "default" | "raised";
|
|
4
4
|
export type CardPadding = "sm" | "md" | "lg";
|
|
@@ -29,6 +29,11 @@ export type CardFooterProps = DivProps & {
|
|
|
29
29
|
ref?: Ref<HTMLDivElement>;
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
+
export type CardActionsProps = DivProps & {
|
|
33
|
+
children?: unknown;
|
|
34
|
+
ref?: Ref<HTMLDivElement>;
|
|
35
|
+
};
|
|
36
|
+
|
|
32
37
|
export type CardTitleProps = HeadingProps & {
|
|
33
38
|
children?: unknown;
|
|
34
39
|
ref?: Ref<HTMLHeadingElement>;
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {
|
|
2
|
+
Card,
|
|
3
|
+
CardActions,
|
|
4
|
+
CardContent,
|
|
5
|
+
CardDescription,
|
|
6
|
+
CardFooter,
|
|
7
|
+
CardHeader,
|
|
8
|
+
CardTitle,
|
|
9
|
+
} from "./card";
|
|
2
10
|
|
|
3
11
|
export type {
|
|
12
|
+
CardActionsProps,
|
|
4
13
|
CardContentProps,
|
|
5
14
|
CardDescriptionProps,
|
|
6
15
|
CardFooterProps,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Button, type ButtonNativeProps } from "@askrjs/ui";
|
|
2
|
+
import { classes } from "../_internal/classes";
|
|
3
|
+
import type { CloseNativeProps } from "./close.types";
|
|
4
|
+
|
|
5
|
+
export function Close(props: CloseNativeProps): JSX.Element;
|
|
6
|
+
export function Close(props: CloseNativeProps): JSX.Element {
|
|
7
|
+
const { children, class: className, label = "Close", size, variant, ...rest } = props;
|
|
8
|
+
return (
|
|
9
|
+
<Button
|
|
10
|
+
{...(rest as ButtonNativeProps)}
|
|
11
|
+
class={classes("btn-close", className)}
|
|
12
|
+
aria-label={label}
|
|
13
|
+
size={size ?? "icon"}
|
|
14
|
+
variant={variant ?? "ghost"}
|
|
15
|
+
>
|
|
16
|
+
{children ?? <span aria-hidden="true">×</span>}
|
|
17
|
+
</Button>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
@@ -3,7 +3,6 @@ export const CONTAINER_A11Y_CONTRACT = {
|
|
|
3
3
|
slot: "data-slot" as const,
|
|
4
4
|
layout: "data-ak-layout" as const,
|
|
5
5
|
variant: "data-variant" as const,
|
|
6
|
-
fluid: "data-fluid" as const,
|
|
7
6
|
maxWidth: "data-max-width" as const,
|
|
8
7
|
padding: "data-padding" as const,
|
|
9
8
|
size: "data-size" as const,
|
|
@@ -3,7 +3,7 @@ import { mergeProps } from "../_internal/merge-props";
|
|
|
3
3
|
import {
|
|
4
4
|
applyBoxLayoutStyles,
|
|
5
5
|
splitBoxLayoutProps,
|
|
6
|
-
|
|
6
|
+
withBoxLayoutClass,
|
|
7
7
|
} from "../_internal/box-layout";
|
|
8
8
|
import {
|
|
9
9
|
isResponsiveValue,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from "../_internal/layout";
|
|
16
16
|
import type { ContainerAsChildProps, ContainerNativeProps } from "./container.types";
|
|
17
17
|
|
|
18
|
-
const CONTAINER_WIDTH_TOKENS = new Set(["1", "2", "3", "4", "sm", "md", "lg", "xl"]);
|
|
18
|
+
const CONTAINER_WIDTH_TOKENS = new Set(["1", "2", "3", "4", "sm", "md", "lg", "xl", "fluid"]);
|
|
19
19
|
|
|
20
20
|
function isContainerWidthToken(value: unknown): value is string {
|
|
21
21
|
return typeof value === "string" && CONTAINER_WIDTH_TOKENS.has(value.trim());
|
|
@@ -45,7 +45,6 @@ export function Container(props: ContainerNativeProps | ContainerAsChildProps) {
|
|
|
45
45
|
asChild,
|
|
46
46
|
children,
|
|
47
47
|
variant,
|
|
48
|
-
fluid = false,
|
|
49
48
|
maxWidth,
|
|
50
49
|
padding,
|
|
51
50
|
size,
|
|
@@ -56,11 +55,7 @@ export function Container(props: ContainerNativeProps | ContainerAsChildProps) {
|
|
|
56
55
|
} = props;
|
|
57
56
|
|
|
58
57
|
const responsiveVariant =
|
|
59
|
-
|
|
60
|
-
? fluid
|
|
61
|
-
? "fluid"
|
|
62
|
-
: (variant ?? "default")
|
|
63
|
-
: undefined;
|
|
58
|
+
size === undefined && maxWidth === undefined ? (variant ?? "default") : undefined;
|
|
64
59
|
|
|
65
60
|
const { boxProps, rest: passthroughProps } = splitBoxLayoutProps(rest);
|
|
66
61
|
const layoutStyle: Record<string, string | number> = {
|
|
@@ -69,7 +64,7 @@ export function Container(props: ContainerNativeProps | ContainerAsChildProps) {
|
|
|
69
64
|
};
|
|
70
65
|
applyBoxLayoutStyles(layoutStyle, boxProps);
|
|
71
66
|
|
|
72
|
-
const widthValue =
|
|
67
|
+
const widthValue = maxWidth ?? size;
|
|
73
68
|
const usesInlineMaxWidth =
|
|
74
69
|
boxProps.maxWidth === undefined &&
|
|
75
70
|
widthValue !== undefined &&
|
|
@@ -104,9 +99,9 @@ export function Container(props: ContainerNativeProps | ContainerAsChildProps) {
|
|
|
104
99
|
applyAlign("marginRight", align);
|
|
105
100
|
}
|
|
106
101
|
|
|
107
|
-
const
|
|
102
|
+
const layoutClass =
|
|
108
103
|
Object.keys(layoutStyle).length > 2 || hasStyleValue(userStyle)
|
|
109
|
-
?
|
|
104
|
+
? withBoxLayoutClass(layoutStyle, userStyle)
|
|
110
105
|
: undefined;
|
|
111
106
|
|
|
112
107
|
const finalProps = mergeProps(passthroughProps, {
|
|
@@ -114,21 +109,16 @@ export function Container(props: ContainerNativeProps | ContainerAsChildProps) {
|
|
|
114
109
|
"data-slot": "container",
|
|
115
110
|
"data-ak-layout": "true",
|
|
116
111
|
"data-variant": responsiveVariant,
|
|
117
|
-
"data-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
: isStaticValue(size)
|
|
121
|
-
? serializeResponsiveValueIf(size, isContainerWidthToken)
|
|
122
|
-
: undefined,
|
|
112
|
+
"data-size": isStaticValue(size)
|
|
113
|
+
? serializeResponsiveValueIf(size, isContainerWidthToken)
|
|
114
|
+
: undefined,
|
|
123
115
|
"data-align": isStaticValue(align)
|
|
124
116
|
? serializeResponsiveValueIf(align, isContainerAlignToken)
|
|
125
117
|
: undefined,
|
|
126
|
-
"data-max-width":
|
|
127
|
-
?
|
|
128
|
-
:
|
|
129
|
-
|
|
130
|
-
: undefined,
|
|
131
|
-
style: mergedStyle,
|
|
118
|
+
"data-max-width": isStaticValue(maxWidth)
|
|
119
|
+
? serializeResponsiveValueIf(maxWidth, isContainerWidthToken)
|
|
120
|
+
: undefined,
|
|
121
|
+
...(layoutClass ? { class: layoutClass } : {}),
|
|
132
122
|
});
|
|
133
123
|
|
|
134
124
|
if (asChild) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { JSXElement
|
|
1
|
+
import type { JSXElement } from "@askrjs/askr/foundations";
|
|
2
|
+
import type { Ref } from "@askrjs/askr/foundations/utilities";
|
|
2
3
|
import type { BoxLayoutOwnProps, LayoutResponsive } from "../box/box.types";
|
|
3
4
|
|
|
4
5
|
export type ContainerVariant = "default" | "sm" | "md" | "lg" | "xl" | "xxl" | "fluid";
|
|
@@ -6,10 +7,8 @@ export type ContainerVariant = "default" | "sm" | "md" | "lg" | "xl" | "xxl" | "
|
|
|
6
7
|
export type ContainerOwnProps = BoxLayoutOwnProps & {
|
|
7
8
|
/** Bootstrap-like responsive container variant. */
|
|
8
9
|
variant?: ContainerVariant;
|
|
9
|
-
/** Makes the container span the full available width while preserving gutters. */
|
|
10
|
-
fluid?: boolean;
|
|
11
10
|
/** Radix-style container size token. */
|
|
12
|
-
size?: LayoutResponsive<"1" | "2" | "3" | "4" | "sm" | "md" | "lg" | "xl">;
|
|
11
|
+
size?: LayoutResponsive<"1" | "2" | "3" | "4" | "sm" | "md" | "lg" | "xl" | "fluid">;
|
|
13
12
|
/** Horizontal alignment of the constrained container. */
|
|
14
13
|
align?: LayoutResponsive<"left" | "center" | "right">;
|
|
15
14
|
/** Compatibility max-width override. */
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { Ref } from "@askrjs/askr/foundations/utilities";
|
|
2
|
+
|
|
1
3
|
export type EmptyStateHeadingTag = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
2
4
|
|
|
3
5
|
export type EmptyStateProps = Omit<JSX.IntrinsicElements["div"], "children"> & {
|
|
@@ -7,4 +9,5 @@ export type EmptyStateProps = Omit<JSX.IntrinsicElements["div"], "children"> & {
|
|
|
7
9
|
description?: unknown;
|
|
8
10
|
actions?: unknown;
|
|
9
11
|
children?: unknown;
|
|
12
|
+
ref?: Ref<HTMLDivElement>;
|
|
10
13
|
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { classes } from "../_internal/classes";
|
|
2
|
+
import { mergeProps } from "../_internal/merge-props";
|
|
3
|
+
import type { FieldErrorProps, FieldHintProps, FieldProps } from "./field.types";
|
|
4
|
+
|
|
5
|
+
export function Field(props: FieldProps): JSX.Element {
|
|
6
|
+
const { children, class: className, ref, ...rest } = props;
|
|
7
|
+
const finalProps = mergeProps(rest, {
|
|
8
|
+
class: classes("field", className),
|
|
9
|
+
ref,
|
|
10
|
+
"data-slot": "field",
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
return <div {...finalProps}>{children}</div>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function FieldHint(props: FieldHintProps): JSX.Element {
|
|
17
|
+
const { children, class: className, ref, ...rest } = props;
|
|
18
|
+
const finalProps = mergeProps(rest, {
|
|
19
|
+
class: classes("field-hint", className),
|
|
20
|
+
ref,
|
|
21
|
+
"data-slot": "field-hint",
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
return <p {...finalProps}>{children}</p>;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function FieldError(props: FieldErrorProps): JSX.Element {
|
|
28
|
+
const { children, class: className, ref, ...rest } = props;
|
|
29
|
+
const finalProps = mergeProps(rest, {
|
|
30
|
+
class: classes("field-error", className),
|
|
31
|
+
ref,
|
|
32
|
+
"data-slot": "field-error",
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
return <p {...finalProps}>{children}</p>;
|
|
36
|
+
}
|