@askrjs/themes 0.0.3 → 0.0.4
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 +5 -15
- 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 +19 -15
- package/dist/components/container/container.d.ts +8 -3
- package/dist/{container → components/container}/container.js +3 -3
- package/dist/components/container/container.js.map +1 -0
- package/dist/components/container/container.types.d.ts +26 -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 +3132 -832
- 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 +4 -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.tsx +4 -4
- package/src/components/container/container.types.ts +2 -1
- 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 +2 -14
- 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/patterns.css +155 -3
- package/src/themes/default/styles/layout/responsive-layout.css +140 -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 +809 -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 +105 -15
- 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 +140 -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,103 +0,0 @@
|
|
|
1
|
-
import { jsx as createSvgNode, jsxs as createSvgNodes } from "@askrjs/askr/jsx-runtime";
|
|
2
|
-
import type { IconSizeToken, LogoNode, LogoProps, LogoStyleObject } from "./types";
|
|
3
|
-
|
|
4
|
-
const ICON_SIZE_TOKENS: readonly IconSizeToken[] = ["sm", "md", "lg", "xl"];
|
|
5
|
-
|
|
6
|
-
function isIconSizeToken(value: unknown): value is IconSizeToken {
|
|
7
|
-
return typeof value === "string" && ICON_SIZE_TOKENS.includes(value as IconSizeToken);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
function normalizeIconSizeValue(size: number | string): string {
|
|
11
|
-
if (typeof size === "number") return `${size}px`;
|
|
12
|
-
return size;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function resolveIconSizeVariable(size: number | string): string {
|
|
16
|
-
if (isIconSizeToken(size)) {
|
|
17
|
-
return `var(--ak-icon-size-${size}, var(--ak-icon-size-md, 1.25rem))`;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return normalizeIconSizeValue(size);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function camelToKebab(key: string): string {
|
|
24
|
-
return key.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function serializeLogoStyle(style: string | LogoStyleObject | undefined): string {
|
|
28
|
-
if (!style) return "";
|
|
29
|
-
if (typeof style === "string") return style.trim();
|
|
30
|
-
|
|
31
|
-
return Object.entries(style)
|
|
32
|
-
.filter(([, value]) => value !== undefined && value !== null)
|
|
33
|
-
.map(([key, value]) => `${camelToKebab(key)}:${String(value)}`)
|
|
34
|
-
.join(";");
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function joinLogoStyle(...styles: Array<string | undefined>): string | undefined {
|
|
38
|
-
const merged = styles.map((style) => style?.trim()).filter(Boolean);
|
|
39
|
-
return merged.length > 0 ? merged.join(";") : undefined;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function getLogoContractProps({
|
|
43
|
-
size = 20,
|
|
44
|
-
title,
|
|
45
|
-
style,
|
|
46
|
-
iconName,
|
|
47
|
-
}: Pick<LogoProps, "iconName" | "size" | "style" | "title">) {
|
|
48
|
-
const sizeToken = isIconSizeToken(size) ? size : undefined;
|
|
49
|
-
const decorative = title ? undefined : "true";
|
|
50
|
-
const resolvedSize = resolveIconSizeVariable(size);
|
|
51
|
-
const logoStyle = joinLogoStyle(
|
|
52
|
-
`--ak-icon-size:${resolvedSize}`,
|
|
53
|
-
"display:inline-block",
|
|
54
|
-
"flex-shrink:0",
|
|
55
|
-
"width:var(--ak-icon-size)",
|
|
56
|
-
"height:var(--ak-icon-size)",
|
|
57
|
-
serializeLogoStyle(style),
|
|
58
|
-
);
|
|
59
|
-
|
|
60
|
-
return {
|
|
61
|
-
attrs: {
|
|
62
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
63
|
-
width: "24",
|
|
64
|
-
height: "24",
|
|
65
|
-
role: "img",
|
|
66
|
-
"aria-hidden": title ? undefined : "true",
|
|
67
|
-
style: logoStyle,
|
|
68
|
-
"data-slot": "icon",
|
|
69
|
-
"data-icon": iconName,
|
|
70
|
-
"data-size": sizeToken,
|
|
71
|
-
"data-decorative": decorative,
|
|
72
|
-
},
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export function createLogo(displayName: string, viewBox: string, logoNode: LogoNode) {
|
|
77
|
-
function Logo({ size = 20, title, class: className, style, ref, ...rest }: LogoProps) {
|
|
78
|
-
const { attrs } = getLogoContractProps({
|
|
79
|
-
size,
|
|
80
|
-
title,
|
|
81
|
-
style,
|
|
82
|
-
iconName: displayName,
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
const children = logoNode.map(([tag, nodeAttrs], index) =>
|
|
86
|
-
createSvgNode(tag, nodeAttrs as Record<string, unknown>, index),
|
|
87
|
-
);
|
|
88
|
-
|
|
89
|
-
return createSvgNodes("svg", {
|
|
90
|
-
...rest,
|
|
91
|
-
...attrs,
|
|
92
|
-
viewBox,
|
|
93
|
-
fill: "none",
|
|
94
|
-
stroke: "none",
|
|
95
|
-
class: className,
|
|
96
|
-
ref,
|
|
97
|
-
children: title ? [createSvgNode("title", { children: title }), ...children] : children,
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
Logo.displayName = displayName;
|
|
102
|
-
return Logo;
|
|
103
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { createLogo } from "./create-logo";
|
|
2
|
-
|
|
3
|
-
const GITHUB_LOGO_NODE = [
|
|
4
|
-
[
|
|
5
|
-
"path",
|
|
6
|
-
{
|
|
7
|
-
fill: "#181717",
|
|
8
|
-
d: "M12 1C5.923 1 1 5.924 1 12.002c0 4.862 3.151 8.987 7.521 10.443.55.102.751-.239.751-.53 0-.262-.01-.956-.015-1.876-3.059.665-3.706-1.475-3.706-1.475-.5-1.271-1.22-1.609-1.22-1.609-.998-.682.076-.668.076-.668 1.104.078 1.685 1.134 1.685 1.134.981 1.682 2.575 1.196 3.203.915.1-.711.384-1.196.698-1.471-2.442-.278-5.01-1.221-5.01-5.436 0-1.201.429-2.184 1.133-2.954-.114-.278-.491-1.397.107-2.913 0 0 .924-.296 3.026 1.128A10.52 10.52 0 0 1 12 6.32c.935.004 1.876.127 2.755.373 2.1-1.424 3.023-1.128 3.023-1.128.6 1.516.223 2.635.109 2.913.706.77 1.131 1.753 1.131 2.954 0 4.225-2.572 5.155-5.02 5.427.395.34.746 1.011.746 2.038 0 1.472-.013 2.659-.013 3.021 0 .294.198.637.757.529C19.851 20.985 23 16.862 23 12.002 23 5.924 18.075 1 12 1Z",
|
|
9
|
-
},
|
|
10
|
-
],
|
|
11
|
-
] as const;
|
|
12
|
-
|
|
13
|
-
export const GitHubLogo = createLogo("GitHubLogo", "0 0 24 24", GITHUB_LOGO_NODE);
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { createLogo } from "./create-logo";
|
|
2
|
-
|
|
3
|
-
const GOOGLE_LOGO_NODE = [
|
|
4
|
-
[
|
|
5
|
-
"path",
|
|
6
|
-
{
|
|
7
|
-
fill: "#4285F4",
|
|
8
|
-
d: "M23.49 12.276c0-.816-.073-1.6-.209-2.351H12v4.451h6.437a5.505 5.505 0 0 1-2.387 3.613v2.997h3.861c2.259-2.079 3.579-5.142 3.579-8.71Z",
|
|
9
|
-
},
|
|
10
|
-
],
|
|
11
|
-
[
|
|
12
|
-
"path",
|
|
13
|
-
{
|
|
14
|
-
fill: "#34A853",
|
|
15
|
-
d: "M12 24c3.24 0 5.957-1.074 7.943-2.914l-3.861-2.997c-1.074.72-2.448 1.146-4.082 1.146-3.136 0-5.793-2.118-6.741-4.965H1.267v3.092A11.997 11.997 0 0 0 12 24Z",
|
|
16
|
-
},
|
|
17
|
-
],
|
|
18
|
-
[
|
|
19
|
-
"path",
|
|
20
|
-
{
|
|
21
|
-
fill: "#FBBC05",
|
|
22
|
-
d: "M5.259 14.27A7.192 7.192 0 0 1 4.882 12c0-.788.135-1.553.377-2.27V6.638H1.267A11.997 11.997 0 0 0 0 12c0 1.937.464 3.771 1.267 5.362L5.259 14.27Z",
|
|
23
|
-
},
|
|
24
|
-
],
|
|
25
|
-
[
|
|
26
|
-
"path",
|
|
27
|
-
{
|
|
28
|
-
fill: "#EA4335",
|
|
29
|
-
d: "M12 4.765c1.762 0 3.344.606 4.589 1.795l3.44-3.44C17.952 1.181 15.236 0 12 0 7.307 0 3.267 2.691 1.267 6.638L5.259 9.73c.948-2.847 3.605-4.965 6.741-4.965Z",
|
|
30
|
-
},
|
|
31
|
-
],
|
|
32
|
-
] as const;
|
|
33
|
-
|
|
34
|
-
export const GoogleLogo = createLogo("GoogleLogo", "0 0 24 24", GOOGLE_LOGO_NODE);
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { createLogo } from "./create-logo";
|
|
2
|
-
|
|
3
|
-
const MICROSOFT_LOGO_NODE = [
|
|
4
|
-
["rect", { x: "2", y: "2", width: "9", height: "9", fill: "#F25022" }],
|
|
5
|
-
["rect", { x: "13", y: "2", width: "9", height: "9", fill: "#7FBA00" }],
|
|
6
|
-
["rect", { x: "2", y: "13", width: "9", height: "9", fill: "#00A4EF" }],
|
|
7
|
-
["rect", { x: "13", y: "13", width: "9", height: "9", fill: "#FFB900" }],
|
|
8
|
-
] as const;
|
|
9
|
-
|
|
10
|
-
export const MicrosoftLogo = createLogo("MicrosoftLogo", "0 0 24 24", MICROSOFT_LOGO_NODE);
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export type IconSizeToken = "sm" | "md" | "lg" | "xl";
|
|
2
|
-
|
|
3
|
-
export type LogoStyleObject = Record<string, unknown>;
|
|
4
|
-
|
|
5
|
-
export type LogoOwnProps = {
|
|
6
|
-
size?: number | string;
|
|
7
|
-
title?: string;
|
|
8
|
-
class?: string;
|
|
9
|
-
style?: string | LogoStyleObject;
|
|
10
|
-
iconName?: string;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export type LogoProps = Omit<
|
|
14
|
-
JSX.IntrinsicElements["svg"],
|
|
15
|
-
"children" | "class" | "height" | "ref" | "role" | "stroke" | "style" | "title" | "width"
|
|
16
|
-
> &
|
|
17
|
-
LogoOwnProps & {
|
|
18
|
-
children?: unknown;
|
|
19
|
-
ref?: unknown;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export type LogoNode = ReadonlyArray<
|
|
23
|
-
readonly [tag: string, attrs: Readonly<Record<string, string>>]
|
|
24
|
-
>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export const SIDEBAR_LAYOUT_A11Y_CONTRACT = {
|
|
2
|
-
DATA_ATTRIBUTES: {
|
|
3
|
-
slot: "data-slot" as const,
|
|
4
|
-
sidebarPosition: "data-sidebar-position" as const,
|
|
5
|
-
sidebarWidth: "data-sidebar-width" as const,
|
|
6
|
-
gap: "data-gap" as const,
|
|
7
|
-
collapseBelow: "data-collapse-below" as const,
|
|
8
|
-
},
|
|
9
|
-
SLOT_VALUES: {
|
|
10
|
-
root: "sidebar-layout" as const,
|
|
11
|
-
sidebar: "sidebar" as const,
|
|
12
|
-
main: "main" as const,
|
|
13
|
-
},
|
|
14
|
-
} as const;
|
|
15
|
-
|
|
16
|
-
export type SidebarLayoutA11yContract = typeof SIDEBAR_LAYOUT_A11Y_CONTRACT;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { isCssLength, mergeLayoutStyles, serializeValueIf } from "../_internal/layout";
|
|
2
|
-
import type { SidebarLayoutProps } from "./sidebar-layout.types";
|
|
3
|
-
|
|
4
|
-
function isThemeGapToken(value: unknown): value is string {
|
|
5
|
-
return typeof value === "string" && ["sm", "md", "lg", "xl"].includes(value.trim());
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
function isThemeSidebarWidthToken(value: unknown): value is string {
|
|
9
|
-
return typeof value === "string" && ["sm", "md", "lg", "xl"].includes(value.trim());
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export function SidebarLayout(props: SidebarLayoutProps): JSX.Element {
|
|
13
|
-
const {
|
|
14
|
-
sidebar,
|
|
15
|
-
children,
|
|
16
|
-
sidebarPosition = "start",
|
|
17
|
-
sidebarWidth,
|
|
18
|
-
gap,
|
|
19
|
-
collapseBelow,
|
|
20
|
-
ref,
|
|
21
|
-
style: userStyle,
|
|
22
|
-
...rest
|
|
23
|
-
} = props;
|
|
24
|
-
|
|
25
|
-
const wrapperStyle: Record<string, string | number> = {};
|
|
26
|
-
if (isCssLength(gap)) wrapperStyle.gap = gap!;
|
|
27
|
-
|
|
28
|
-
const sidebarStyle: Record<string, string | number> = {};
|
|
29
|
-
if (isCssLength(sidebarWidth)) {
|
|
30
|
-
sidebarStyle.width = sidebarWidth!;
|
|
31
|
-
sidebarStyle.flexBasis = sidebarWidth!;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return (
|
|
35
|
-
<div
|
|
36
|
-
{...rest}
|
|
37
|
-
ref={ref}
|
|
38
|
-
data-slot="sidebar-layout"
|
|
39
|
-
data-sidebar-position={sidebarPosition}
|
|
40
|
-
data-sidebar-width={serializeValueIf(sidebarWidth, isThemeSidebarWidthToken)}
|
|
41
|
-
data-gap={serializeValueIf(gap, isThemeGapToken)}
|
|
42
|
-
data-collapse-below={collapseBelow}
|
|
43
|
-
style={mergeLayoutStyles(wrapperStyle, userStyle)}
|
|
44
|
-
>
|
|
45
|
-
{[
|
|
46
|
-
<aside
|
|
47
|
-
key="sidebar-layout-sidebar"
|
|
48
|
-
data-slot="sidebar"
|
|
49
|
-
style={mergeLayoutStyles(sidebarStyle, undefined)}
|
|
50
|
-
>
|
|
51
|
-
{sidebar}
|
|
52
|
-
</aside>,
|
|
53
|
-
<main key="sidebar-layout-main" data-slot="main">
|
|
54
|
-
{children}
|
|
55
|
-
</main>,
|
|
56
|
-
]}
|
|
57
|
-
</div>
|
|
58
|
-
);
|
|
59
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { Ref } from "@askrjs/askr/foundations";
|
|
2
|
-
|
|
3
|
-
export type SidebarPosition = "start" | "end";
|
|
4
|
-
|
|
5
|
-
export type SidebarLayoutProps = Omit<JSX.IntrinsicElements["div"], "children" | "ref"> & {
|
|
6
|
-
/** Content rendered into the sidebar slot (aside). */
|
|
7
|
-
sidebar?: unknown;
|
|
8
|
-
/** Content rendered into the main slot. */
|
|
9
|
-
children?: unknown;
|
|
10
|
-
/** Which side the sidebar appears on. Defaults to 'start'. */
|
|
11
|
-
sidebarPosition?: SidebarPosition;
|
|
12
|
-
/** CSS width for the sidebar. Applied as inline style only when it is a real CSS length. */
|
|
13
|
-
sidebarWidth?: string;
|
|
14
|
-
/** CSS gap between sidebar and main. Applied as inline style only when it is a real CSS length. */
|
|
15
|
-
gap?: string;
|
|
16
|
-
/**
|
|
17
|
-
* Named breakpoint below which the layout collapses to a single column.
|
|
18
|
-
* Official themes recognize `sm`, `md`, `lg`, and `xl`.
|
|
19
|
-
*/
|
|
20
|
-
collapseBelow?: string;
|
|
21
|
-
ref?: Ref<HTMLDivElement>;
|
|
22
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export const TOPBAR_LAYOUT_A11Y_CONTRACT = {
|
|
2
|
-
DATA_ATTRIBUTES: {
|
|
3
|
-
slot: "data-slot" as const,
|
|
4
|
-
topbarHeight: "data-topbar-height" as const,
|
|
5
|
-
gap: "data-gap" as const,
|
|
6
|
-
},
|
|
7
|
-
SLOT_VALUES: {
|
|
8
|
-
root: "topbar-layout" as const,
|
|
9
|
-
navbar: "navbar" as const,
|
|
10
|
-
main: "main" as const,
|
|
11
|
-
},
|
|
12
|
-
} as const;
|
|
13
|
-
|
|
14
|
-
export type TopbarLayoutA11yContract = typeof TOPBAR_LAYOUT_A11Y_CONTRACT;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { isCssLength, mergeLayoutStyles, serializeValueIf } from "../_internal/layout";
|
|
2
|
-
import type { TopbarLayoutProps } from "./topbar-layout.types";
|
|
3
|
-
|
|
4
|
-
function isThemeGapToken(value: unknown): value is string {
|
|
5
|
-
return typeof value === "string" && ["sm", "md", "lg", "xl"].includes(value.trim());
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export function TopbarLayout(props: TopbarLayoutProps): JSX.Element {
|
|
9
|
-
const { topbar, children, topbarHeight, gap, ref, style: userStyle, ...rest } = props;
|
|
10
|
-
|
|
11
|
-
const wrapperStyle: Record<string, string | number> = {};
|
|
12
|
-
if (isCssLength(gap)) wrapperStyle.gap = gap!;
|
|
13
|
-
|
|
14
|
-
const navbarStyle: Record<string, string | number> = {};
|
|
15
|
-
if (isCssLength(topbarHeight)) navbarStyle.height = topbarHeight!;
|
|
16
|
-
|
|
17
|
-
return (
|
|
18
|
-
<div
|
|
19
|
-
{...rest}
|
|
20
|
-
ref={ref}
|
|
21
|
-
data-slot="topbar-layout"
|
|
22
|
-
data-gap={serializeValueIf(gap, isThemeGapToken)}
|
|
23
|
-
style={mergeLayoutStyles(wrapperStyle, userStyle)}
|
|
24
|
-
>
|
|
25
|
-
{[
|
|
26
|
-
<header
|
|
27
|
-
key="topbar-layout-navbar"
|
|
28
|
-
data-slot="navbar"
|
|
29
|
-
style={mergeLayoutStyles(navbarStyle, undefined)}
|
|
30
|
-
>
|
|
31
|
-
{topbar}
|
|
32
|
-
</header>,
|
|
33
|
-
<main key="topbar-layout-main" data-slot="main">
|
|
34
|
-
{children}
|
|
35
|
-
</main>,
|
|
36
|
-
]}
|
|
37
|
-
</div>
|
|
38
|
-
);
|
|
39
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Ref } from "@askrjs/askr/foundations";
|
|
2
|
-
|
|
3
|
-
export type TopbarLayoutProps = Omit<JSX.IntrinsicElements["div"], "children" | "ref"> & {
|
|
4
|
-
/** Content rendered into the topbar/navbar slot (header). */
|
|
5
|
-
topbar?: unknown;
|
|
6
|
-
/** Content rendered into the main slot. */
|
|
7
|
-
children?: unknown;
|
|
8
|
-
/** CSS height for the topbar. Applied as inline style only when it is a real CSS length. */
|
|
9
|
-
topbarHeight?: string;
|
|
10
|
-
/** CSS gap between topbar and main. Applied as inline style only when it is a real CSS length. */
|
|
11
|
-
gap?: string;
|
|
12
|
-
ref?: Ref<HTMLDivElement>;
|
|
13
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
[data-slot="container"] {
|
|
2
|
-
max-inline-size: var(--ak-layout-content-max-width);
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
[data-slot="grid"] {
|
|
6
|
-
gap: var(--ak-space-md);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
[data-slot="grid"][data-columns="2"] {
|
|
10
|
-
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
[data-slot="grid"][data-columns="3"] {
|
|
14
|
-
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
15
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
[data-slot="sidebar-layout"] > [data-slot="sidebar"] {
|
|
2
|
-
inline-size: var(--ak-layout-sidebar-width);
|
|
3
|
-
max-inline-size: 100%;
|
|
4
|
-
background: var(--ak-color-surface);
|
|
5
|
-
border-inline-end: 1px solid var(--ak-color-border);
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
[data-slot="sidebar-layout"] > [data-slot="main"] {
|
|
9
|
-
min-inline-size: 0;
|
|
10
|
-
}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
[data-slot="navigation-menu"] {
|
|
2
|
-
position: relative;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
[data-slot="navigation-menu-list"] {
|
|
6
|
-
display: flex;
|
|
7
|
-
align-items: center;
|
|
8
|
-
gap: 0.25rem;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
[data-slot="navigation-menu-trigger"] {
|
|
12
|
-
display: inline-flex;
|
|
13
|
-
align-items: center;
|
|
14
|
-
justify-content: center;
|
|
15
|
-
min-height: 2.25rem;
|
|
16
|
-
padding: 0 var(--ak-space-sm);
|
|
17
|
-
border: 1px solid var(--ak-color-border);
|
|
18
|
-
border-radius: var(--ak-radius-sm);
|
|
19
|
-
background: var(--ak-color-surface);
|
|
20
|
-
color: var(--ak-color-text);
|
|
21
|
-
cursor: pointer;
|
|
22
|
-
transition:
|
|
23
|
-
background var(--ak-duration-fast) var(--ak-ease-standard),
|
|
24
|
-
border-color var(--ak-duration-fast) var(--ak-ease-standard),
|
|
25
|
-
color var(--ak-duration-fast) var(--ak-ease-standard),
|
|
26
|
-
box-shadow var(--ak-duration-fast) var(--ak-ease-standard);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
[data-slot="navigation-menu-trigger"][data-state="open"] {
|
|
30
|
-
border-color: var(--ak-color-primary);
|
|
31
|
-
background: var(--ak-color-primary-soft);
|
|
32
|
-
color: var(--ak-color-primary-ink);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
[data-slot="navigation-menu-trigger"]:hover {
|
|
36
|
-
background: var(--ak-color-hover);
|
|
37
|
-
border-color: var(--ak-color-border-strong);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
[data-slot="navigation-menu-content"] {
|
|
41
|
-
display: grid;
|
|
42
|
-
gap: 0.25rem;
|
|
43
|
-
min-width: 14rem;
|
|
44
|
-
max-block-size: min(20rem, calc(100vh - 4rem));
|
|
45
|
-
overflow-y: auto;
|
|
46
|
-
padding: var(--ak-space-sm);
|
|
47
|
-
border: 1px solid var(--ak-color-border);
|
|
48
|
-
border-radius: var(--ak-radius-md);
|
|
49
|
-
background: var(--ak-color-surface-raised);
|
|
50
|
-
color: var(--ak-color-text);
|
|
51
|
-
box-shadow: var(--ak-shadow-sm);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
[data-slot="navigation-menu-link"],
|
|
55
|
-
[data-slot="navigation-menu-sub-trigger"] {
|
|
56
|
-
display: flex;
|
|
57
|
-
align-items: center;
|
|
58
|
-
min-height: 2.25rem;
|
|
59
|
-
padding: 0 var(--ak-space-sm);
|
|
60
|
-
border-radius: var(--ak-radius-sm);
|
|
61
|
-
color: var(--ak-color-text);
|
|
62
|
-
text-decoration: none;
|
|
63
|
-
cursor: pointer;
|
|
64
|
-
transition:
|
|
65
|
-
background var(--ak-duration-fast) var(--ak-ease-standard),
|
|
66
|
-
color var(--ak-duration-fast) var(--ak-ease-standard);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
[data-slot="navigation-menu-link"]:hover,
|
|
70
|
-
[data-slot="navigation-menu-sub-trigger"]:hover {
|
|
71
|
-
background: var(--ak-color-surface-muted);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
[data-slot="navigation-menu-sub-trigger"][data-disabled] {
|
|
75
|
-
opacity: 0.5;
|
|
76
|
-
pointer-events: none;
|
|
77
|
-
cursor: not-allowed;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
[data-slot="navigation-menu-viewport"] {
|
|
81
|
-
margin-top: var(--ak-space-sm);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
[data-slot="navigation-menu-indicator"] {
|
|
85
|
-
block-size: 2px;
|
|
86
|
-
inline-size: 2rem;
|
|
87
|
-
margin-top: 0.125rem;
|
|
88
|
-
border-radius: 999px;
|
|
89
|
-
background: var(--ak-color-primary);
|
|
90
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
[data-slot="tabs"] {
|
|
2
|
-
display: grid;
|
|
3
|
-
gap: var(--ak-space-md);
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
[data-slot="tabs-list"] {
|
|
7
|
-
display: inline-flex;
|
|
8
|
-
align-items: center;
|
|
9
|
-
gap: 0.25rem;
|
|
10
|
-
padding: 0.25rem;
|
|
11
|
-
border: 1px solid var(--ak-color-border);
|
|
12
|
-
border-radius: calc(var(--ak-radius-md) + 2px);
|
|
13
|
-
background: var(--ak-color-surface-muted);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
[data-slot="tabs-list"][data-orientation="vertical"] {
|
|
17
|
-
flex-direction: column;
|
|
18
|
-
align-items: stretch;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
[data-slot="tabs-trigger"] {
|
|
22
|
-
display: inline-flex;
|
|
23
|
-
align-items: center;
|
|
24
|
-
justify-content: center;
|
|
25
|
-
min-height: 2.5rem;
|
|
26
|
-
padding: 0 var(--ak-space-md);
|
|
27
|
-
border: 0;
|
|
28
|
-
border-radius: var(--ak-radius-sm);
|
|
29
|
-
background: transparent;
|
|
30
|
-
color: var(--ak-color-text-muted);
|
|
31
|
-
cursor: pointer;
|
|
32
|
-
transition:
|
|
33
|
-
background var(--ak-duration-fast) var(--ak-ease-standard),
|
|
34
|
-
color var(--ak-duration-fast) var(--ak-ease-standard),
|
|
35
|
-
box-shadow var(--ak-duration-fast) var(--ak-ease-standard);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
[data-slot="tabs-trigger"][data-state="active"] {
|
|
39
|
-
background: var(--ak-color-surface);
|
|
40
|
-
color: var(--ak-color-text);
|
|
41
|
-
box-shadow: var(--ak-shadow-sm);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
[data-slot="tabs-trigger"]:focus-visible {
|
|
45
|
-
outline: none;
|
|
46
|
-
box-shadow: 0 0 0 3px var(--ak-color-focus-ring);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
[data-slot="tabs-trigger"][data-disabled] {
|
|
50
|
-
opacity: 0.5;
|
|
51
|
-
pointer-events: none;
|
|
52
|
-
cursor: not-allowed;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
[data-slot="tabs-content"] {
|
|
56
|
-
padding: var(--ak-space-md);
|
|
57
|
-
border: 1px solid var(--ak-color-border);
|
|
58
|
-
border-radius: var(--ak-radius-md);
|
|
59
|
-
background: var(--ak-color-surface);
|
|
60
|
-
color: var(--ak-color-text);
|
|
61
|
-
}
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
[data-slot="dropdown-menu-trigger"] {
|
|
2
|
-
display: inline-flex;
|
|
3
|
-
align-items: center;
|
|
4
|
-
justify-content: center;
|
|
5
|
-
min-height: 2.5rem;
|
|
6
|
-
padding: 0 var(--ak-space-md);
|
|
7
|
-
border: 1px solid var(--ak-color-border);
|
|
8
|
-
border-radius: var(--ak-radius-md);
|
|
9
|
-
background: var(--ak-color-surface);
|
|
10
|
-
color: var(--ak-color-text);
|
|
11
|
-
cursor: pointer;
|
|
12
|
-
transition:
|
|
13
|
-
border-color var(--ak-duration-fast) var(--ak-ease-standard),
|
|
14
|
-
box-shadow var(--ak-duration-fast) var(--ak-ease-standard);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
[data-slot="dropdown-menu-trigger"][data-state="open"] {
|
|
18
|
-
border-color: var(--ak-color-primary);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
[data-slot="dropdown-menu-trigger"][data-disabled] {
|
|
22
|
-
opacity: 0.5;
|
|
23
|
-
pointer-events: none;
|
|
24
|
-
cursor: not-allowed;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
@keyframes ak-menu-in {
|
|
28
|
-
from {
|
|
29
|
-
opacity: 0;
|
|
30
|
-
transform: translateY(4px);
|
|
31
|
-
}
|
|
32
|
-
to {
|
|
33
|
-
opacity: 1;
|
|
34
|
-
transform: translateY(0);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
@keyframes ak-menu-out {
|
|
39
|
-
from {
|
|
40
|
-
opacity: 1;
|
|
41
|
-
transform: translateY(0);
|
|
42
|
-
}
|
|
43
|
-
to {
|
|
44
|
-
opacity: 0;
|
|
45
|
-
transform: translateY(4px);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
[data-slot="dropdown-menu-content"] {
|
|
50
|
-
display: grid;
|
|
51
|
-
gap: 0.25rem;
|
|
52
|
-
min-width: 12rem;
|
|
53
|
-
max-block-size: min(20rem, calc(100vh - 4rem));
|
|
54
|
-
overflow-y: auto;
|
|
55
|
-
padding: var(--ak-space-sm);
|
|
56
|
-
border: 1px solid var(--ak-color-border);
|
|
57
|
-
border-radius: var(--ak-radius-md);
|
|
58
|
-
background: var(--ak-color-surface-raised);
|
|
59
|
-
color: var(--ak-color-text);
|
|
60
|
-
box-shadow: var(--ak-shadow-sm);
|
|
61
|
-
animation: ak-menu-in var(--ak-duration-fast) var(--ak-ease-standard);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
[data-slot="dropdown-menu-content"][data-state="closed"] {
|
|
65
|
-
animation: ak-menu-out var(--ak-duration-fast) var(--ak-ease-standard);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
[data-slot="dropdown-menu-item"] {
|
|
69
|
-
display: flex;
|
|
70
|
-
align-items: center;
|
|
71
|
-
min-height: 2.25rem;
|
|
72
|
-
padding: 0 var(--ak-space-sm);
|
|
73
|
-
border: 0;
|
|
74
|
-
border-radius: var(--ak-radius-sm);
|
|
75
|
-
background: transparent;
|
|
76
|
-
color: var(--ak-color-text);
|
|
77
|
-
cursor: pointer;
|
|
78
|
-
transition:
|
|
79
|
-
background var(--ak-duration-fast) var(--ak-ease-standard),
|
|
80
|
-
color var(--ak-duration-fast) var(--ak-ease-standard);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
[data-slot="dropdown-menu-item"]:hover {
|
|
84
|
-
background: var(--ak-color-surface-muted);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
[data-slot="dropdown-menu-item"]:focus-visible {
|
|
88
|
-
outline: none;
|
|
89
|
-
background: var(--ak-color-surface-muted);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
[data-slot="dropdown-menu-item"][data-disabled] {
|
|
93
|
-
opacity: 0.5;
|
|
94
|
-
pointer-events: none;
|
|
95
|
-
cursor: not-allowed;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
[data-slot="dropdown-menu-label"] {
|
|
99
|
-
padding: 0 var(--ak-space-sm);
|
|
100
|
-
color: var(--ak-color-text-muted);
|
|
101
|
-
font-size: var(--ak-font-size-sm);
|
|
102
|
-
font-weight: var(--ak-font-weight-semibold);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
[data-slot="dropdown-menu-separator"] {
|
|
106
|
-
block-size: 1px;
|
|
107
|
-
margin: 0.25rem 0;
|
|
108
|
-
background: var(--ak-color-border);
|
|
109
|
-
}
|