@askrjs/themes 0.0.9 → 0.0.10
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 +19 -13
- package/THEMING.md +24 -18
- package/dist/components/_internal/block-layout.d.ts +49 -0
- package/dist/components/_internal/block-layout.js +210 -0
- package/dist/components/_internal/block-layout.js.map +1 -0
- package/dist/components/alert/alert.js +2 -2
- package/dist/components/alert/alert.js.map +1 -1
- package/dist/components/alert/alert.types.d.ts +0 -1
- package/dist/components/aside/aside.d.ts +7 -0
- package/dist/components/aside/aside.js +16 -0
- package/dist/components/aside/aside.js.map +1 -0
- package/dist/components/aside/aside.types.d.ts +6 -0
- package/dist/components/aside/index.d.ts +2 -0
- package/dist/components/aspect-ratio/aspect-ratio.js +1 -1
- package/dist/components/aspect-ratio/aspect-ratio.js.map +1 -1
- package/dist/components/badge/index.d.ts +1 -2
- package/dist/components/block/block.d.ts +2 -3
- package/dist/components/block/block.js +16 -46
- package/dist/components/block/block.js.map +1 -1
- package/dist/components/block/block.types.d.ts +13 -23
- package/dist/components/block/index.d.ts +3 -3
- package/dist/components/brand/brand.d.ts +9 -0
- package/dist/components/brand/brand.js +49 -0
- package/dist/components/brand/brand.js.map +1 -0
- package/dist/components/brand/brand.types.d.ts +31 -0
- package/dist/components/brand/index.d.ts +2 -0
- package/dist/components/card/card.d.ts +3 -3
- package/dist/components/card/card.js +6 -11
- package/dist/components/card/card.js.map +1 -1
- package/dist/components/card/card.types.d.ts +10 -12
- package/dist/components/card/index.d.ts +2 -2
- package/dist/components/catalog.d.ts +156 -0
- package/dist/components/catalog.js +723 -0
- package/dist/components/catalog.js.map +1 -0
- package/dist/components/container/container.d.ts +2 -3
- package/dist/components/container/container.js +8 -71
- package/dist/components/container/container.js.map +1 -1
- package/dist/components/container/container.types.d.ts +5 -24
- package/dist/components/container/index.d.ts +2 -3
- package/dist/components/empty-state/empty-state.js +34 -28
- package/dist/components/empty-state/empty-state.js.map +1 -1
- package/dist/components/empty-state/empty-state.types.d.ts +3 -6
- package/dist/components/field/field.js +4 -2
- package/dist/components/field/field.js.map +1 -1
- package/dist/components/field/field.types.d.ts +1 -0
- package/dist/components/footer/footer.d.ts +13 -0
- package/dist/components/footer/footer.js +86 -0
- package/dist/components/footer/footer.js.map +1 -0
- package/dist/components/footer/footer.types.d.ts +37 -0
- package/dist/components/footer/index.d.ts +2 -0
- package/dist/components/grid/grid.d.ts +7 -0
- package/dist/components/grid/grid.js +76 -0
- package/dist/components/grid/grid.js.map +1 -0
- package/dist/components/grid/grid.types.d.ts +19 -0
- package/dist/components/grid/index.d.ts +2 -0
- package/dist/components/header/header.js +9 -6
- package/dist/components/header/header.js.map +1 -1
- package/dist/components/header/header.types.d.ts +5 -5
- package/dist/components/header/index.d.ts +2 -0
- package/dist/components/main/index.d.ts +2 -0
- package/dist/components/main/main.d.ts +7 -0
- package/dist/components/main/main.js +17 -0
- package/dist/components/main/main.js.map +1 -0
- package/dist/components/main/main.types.d.ts +6 -0
- package/dist/components/nav/index.d.ts +2 -2
- package/dist/components/nav/nav.d.ts +8 -6
- package/dist/components/nav/nav.js +93 -58
- package/dist/components/nav/nav.js.map +1 -1
- package/dist/components/nav/nav.types.d.ts +16 -20
- package/dist/components/navbar/index.d.ts +4 -5
- package/dist/components/navbar/navbar.d.ts +3 -38
- package/dist/components/navbar/navbar.js +103 -210
- package/dist/components/navbar/navbar.js.map +1 -1
- package/dist/components/navbar/navbar.types.d.ts +14 -24
- package/dist/components/page/index.d.ts +2 -0
- package/dist/components/page/page.d.ts +7 -0
- package/dist/components/page/page.js +22 -0
- package/dist/components/page/page.js.map +1 -0
- package/dist/components/page/page.types.d.ts +6 -0
- package/dist/components/page-header/index.d.ts +2 -0
- package/dist/components/page-header/page-header.d.ts +7 -0
- package/dist/components/page-header/page-header.js +37 -0
- package/dist/components/page-header/page-header.js.map +1 -0
- package/dist/components/page-header/page-header.types.d.ts +10 -0
- package/dist/components/section/index.d.ts +2 -3
- package/dist/components/section/section.d.ts +2 -3
- package/dist/components/section/section.js +7 -30
- package/dist/components/section/section.js.map +1 -1
- package/dist/components/section/section.types.d.ts +3 -20
- package/dist/components/separator/index.d.ts +1 -2
- package/dist/components/sidebar/index.d.ts +2 -0
- package/dist/components/sidebar/sidebar.d.ts +17 -2
- package/dist/components/sidebar/sidebar.js +115 -225
- package/dist/components/sidebar/sidebar.js.map +1 -1
- package/dist/components/sidebar/sidebar.types.d.ts +21 -23
- package/dist/components/skeleton/index.d.ts +1 -2
- package/dist/components/skeleton/skeleton.js +12 -1
- package/dist/components/skeleton/skeleton.js.map +1 -1
- package/dist/components/skeleton/skeleton.types.d.ts +2 -0
- package/dist/components/spinner/index.d.ts +1 -1
- package/dist/components/spinner/spinner.js +6 -3
- package/dist/components/spinner/spinner.js.map +1 -1
- package/dist/components/spinner/spinner.types.d.ts +3 -1
- package/dist/components/stat/index.d.ts +2 -0
- package/dist/components/stat/stat.d.ts +10 -0
- package/dist/components/stat/stat.js +52 -0
- package/dist/components/stat/stat.js.map +1 -0
- package/dist/components/stat/stat.types.d.ts +24 -0
- package/dist/components/text/index.d.ts +2 -0
- package/dist/components/text/text.d.ts +7 -0
- package/dist/components/text/text.js +28 -0
- package/dist/components/text/text.js.map +1 -0
- package/dist/components/text/text.types.d.ts +26 -0
- package/dist/components/theme/theme.js +50 -8
- package/dist/components/theme/theme.js.map +1 -1
- package/dist/components/toolbar/index.d.ts +2 -0
- package/dist/components/toolbar/toolbar.d.ts +7 -0
- package/dist/components/toolbar/toolbar.js +30 -0
- package/dist/components/toolbar/toolbar.js.map +1 -0
- package/dist/components/toolbar/toolbar.types.d.ts +9 -0
- package/dist/components.d.ts +60 -0
- package/dist/components.js +35 -0
- package/dist/controls.d.ts +2 -2
- package/dist/controls.js +3 -3
- package/dist/core.d.ts +36 -0
- package/dist/core.js +19 -0
- package/dist/navs.d.ts +3 -15
- package/dist/navs.js +2 -8
- package/dist/overlays.d.ts +2 -2
- package/dist/overlays.js +2 -2
- package/dist/surfaces.d.ts +10 -8
- package/dist/surfaces.js +6 -4
- package/dist/themes/default/index.css +3661 -3945
- package/package.json +235 -69
- package/src/components/_internal/block-layout.ts +354 -0
- package/src/components/alert/alert.tsx +1 -2
- package/src/components/alert/alert.types.ts +0 -1
- package/src/components/aside/aside.tsx +12 -0
- package/src/components/aside/aside.types.ts +3 -0
- package/src/components/aside/index.ts +2 -0
- package/src/components/aspect-ratio/aspect-ratio.tsx +1 -1
- package/src/components/badge/index.ts +0 -1
- package/src/components/block/block.a11y.ts +0 -6
- package/src/components/block/block.tsx +40 -56
- package/src/components/block/block.types.ts +59 -41
- package/src/components/block/index.ts +1 -10
- package/src/components/brand/brand.tsx +61 -0
- package/src/components/brand/brand.types.ts +39 -0
- package/src/components/brand/index.ts +2 -0
- package/src/components/card/card.tsx +6 -18
- package/src/components/card/card.types.ts +9 -11
- package/src/components/card/index.ts +2 -3
- package/src/components/catalog.tsx +713 -0
- package/src/components/container/container.a11y.ts +0 -5
- package/src/components/container/container.tsx +18 -128
- package/src/components/container/container.types.ts +3 -32
- package/src/components/container/index.ts +1 -8
- package/src/components/empty-state/empty-state.tsx +17 -35
- package/src/components/empty-state/empty-state.types.ts +3 -5
- package/src/components/field/field.tsx +3 -1
- package/src/components/field/field.types.ts +1 -0
- package/src/components/footer/footer.tsx +88 -0
- package/src/components/footer/footer.types.ts +40 -0
- package/src/components/footer/index.ts +10 -0
- package/src/components/grid/grid.tsx +113 -0
- package/src/components/grid/grid.types.ts +20 -0
- package/src/components/grid/index.ts +2 -0
- package/src/components/header/header.tsx +10 -7
- package/src/components/header/header.types.ts +4 -4
- package/src/components/header/index.ts +1 -2
- package/src/components/main/index.ts +2 -0
- package/src/components/main/main.tsx +12 -0
- package/src/components/main/main.types.ts +3 -0
- package/src/components/nav/index.ts +7 -9
- package/src/components/nav/nav.tsx +153 -110
- package/src/components/nav/nav.types.ts +26 -27
- package/src/components/navbar/index.ts +4 -11
- package/src/components/navbar/navbar.tsx +103 -265
- package/src/components/navbar/navbar.types.ts +16 -42
- package/src/components/page/index.ts +2 -0
- package/src/components/page/page.tsx +17 -0
- package/src/components/page/page.types.ts +3 -0
- package/src/components/page-header/index.ts +2 -0
- package/src/components/page-header/page-header.tsx +29 -0
- package/src/components/page-header/page-header.types.ts +7 -0
- package/src/components/section/index.ts +1 -7
- package/src/components/section/section.a11y.ts +0 -1
- package/src/components/section/section.tsx +9 -35
- package/src/components/section/section.types.ts +2 -22
- package/src/components/separator/index.ts +4 -9
- package/src/components/sidebar/index.ts +27 -5
- package/src/components/sidebar/sidebar.tsx +146 -336
- package/src/components/sidebar/sidebar.types.ts +21 -28
- package/src/components/skeleton/index.ts +1 -2
- package/src/components/skeleton/skeleton.tsx +33 -1
- package/src/components/skeleton/skeleton.types.ts +2 -0
- package/src/components/spinner/index.ts +1 -1
- package/src/components/spinner/spinner.tsx +7 -2
- package/src/components/spinner/spinner.types.ts +3 -0
- package/src/components/stat/index.ts +2 -0
- package/src/components/stat/stat.tsx +47 -0
- package/src/components/stat/stat.types.ts +24 -0
- package/src/components/text/index.ts +2 -0
- package/src/components/text/text.tsx +39 -0
- package/src/components/text/text.types.ts +35 -0
- package/src/components/theme/theme.tsx +83 -9
- package/src/components/toolbar/index.ts +2 -0
- package/src/components/toolbar/toolbar.tsx +24 -0
- package/src/components/toolbar/toolbar.types.ts +6 -0
- package/src/components.ts +289 -0
- package/src/controls.ts +69 -2
- package/src/core.ts +42 -0
- package/src/navs.ts +9 -24
- package/src/overlays.ts +101 -59
- package/src/parity.ts +125 -0
- package/src/surfaces.ts +60 -13
- package/src/themes/default/index.css +11 -14
- package/src/themes/default/styles/actions/button-group.css +6 -6
- package/src/themes/default/styles/actions/button.css +98 -60
- package/src/themes/default/styles/actions/toggle-group.css +61 -25
- package/src/themes/default/styles/base/text.css +87 -0
- package/src/themes/default/styles/base/typography.css +24 -117
- package/src/themes/default/styles/base/utilities.css +0 -250
- package/src/themes/default/styles/disclosure/accordion.css +35 -28
- package/src/themes/default/styles/display/alert.css +7 -7
- package/src/themes/default/styles/display/badge.css +8 -9
- package/src/themes/default/styles/display/card.css +10 -47
- package/src/themes/default/styles/display/catalog.css +753 -0
- package/src/themes/default/styles/display/coverage.css +30 -305
- package/src/themes/default/styles/display/progress-circle.css +2 -0
- package/src/themes/default/styles/display/scroll-area.css +29 -24
- package/src/themes/default/styles/display/spinner.css +38 -1
- package/src/themes/default/styles/display/stat.css +21 -0
- package/src/themes/default/styles/display/table.css +37 -12
- package/src/themes/default/styles/display/virtual-list.css +24 -13
- package/src/themes/default/styles/display/virtual-table.css +58 -36
- package/src/themes/default/styles/forms/checkbox.css +12 -21
- package/src/themes/default/styles/forms/input-group.css +2 -1
- package/src/themes/default/styles/forms/input.css +11 -12
- package/src/themes/default/styles/forms/radio-group.css +44 -27
- package/src/themes/default/styles/forms/select.css +27 -35
- package/src/themes/default/styles/forms/slider.css +61 -47
- package/src/themes/default/styles/forms/switch.css +18 -23
- package/src/themes/default/styles/forms/textarea.css +12 -12
- package/src/themes/default/styles/layout/block.css +96 -12
- package/src/themes/default/styles/layout/grid.css +78 -0
- package/src/themes/default/styles/layout/layout.css +502 -772
- package/src/themes/default/styles/layout/patterns.css +0 -155
- package/src/themes/default/styles/navigation/nav.css +104 -154
- package/src/themes/default/styles/overlays/alert-dialog.css +2 -2
- package/src/themes/default/styles/overlays/dialog.css +76 -22
- package/src/themes/default/styles/overlays/dropdown.css +108 -31
- package/src/themes/default/styles/overlays/hover-card.css +39 -17
- package/src/themes/default/styles/overlays/menubar.css +223 -0
- package/src/themes/default/styles/overlays/popover.css +69 -23
- package/src/themes/default/styles/overlays/toast.css +91 -33
- package/src/themes/default/styles/overlays/tooltip.css +88 -14
- package/src/themes/default/styles/shell/brand.css +48 -0
- package/src/themes/default/styles/shell/footer.css +72 -0
- package/src/themes/default/styles/shell/header.css +7 -50
- package/src/themes/default/styles/shell/navbar.css +226 -454
- package/src/themes/default/styles/shell/sidebar.css +243 -829
- package/src/themes/default/tokens.css +145 -98
- package/templates/theme/index.css +11 -14
- package/templates/theme/styles/actions/button-group.css +6 -6
- package/templates/theme/styles/actions/button.css +98 -60
- package/templates/theme/styles/actions/toggle-group.css +61 -25
- package/templates/theme/styles/base/text.css +87 -0
- package/templates/theme/styles/base/typography.css +24 -117
- package/templates/theme/styles/disclosure/accordion.css +35 -28
- package/templates/theme/styles/display/alert.css +7 -7
- package/templates/theme/styles/display/badge.css +8 -9
- package/templates/theme/styles/display/card.css +10 -47
- package/templates/theme/styles/display/catalog.css +753 -0
- package/templates/theme/styles/display/coverage.css +30 -305
- package/templates/theme/styles/display/scroll-area.css +29 -24
- package/templates/theme/styles/display/spinner.css +38 -1
- package/templates/theme/styles/display/stat.css +21 -0
- package/templates/theme/styles/display/table.css +37 -12
- package/templates/theme/styles/display/virtual-list.css +24 -13
- package/templates/theme/styles/display/virtual-table.css +58 -36
- package/templates/theme/styles/forms/checkbox.css +12 -21
- package/templates/theme/styles/forms/input.css +11 -12
- package/templates/theme/styles/forms/radio-group.css +44 -27
- package/templates/theme/styles/forms/select.css +27 -35
- package/templates/theme/styles/forms/slider.css +61 -47
- package/templates/theme/styles/forms/switch.css +18 -23
- package/templates/theme/styles/forms/textarea.css +12 -12
- package/templates/theme/styles/layout/block.css +96 -12
- package/templates/theme/styles/layout/grid.css +78 -0
- package/templates/theme/styles/layout/layout.css +676 -1
- package/templates/theme/styles/layout/patterns.css +0 -155
- package/templates/theme/styles/navigation/nav.css +104 -154
- package/templates/theme/styles/overlays/alert-dialog.css +2 -2
- package/templates/theme/styles/overlays/dialog.css +76 -22
- package/templates/theme/styles/overlays/dropdown.css +108 -31
- package/templates/theme/styles/overlays/hover-card.css +39 -17
- package/templates/theme/styles/overlays/menubar.css +223 -0
- package/templates/theme/styles/overlays/popover.css +69 -23
- package/templates/theme/styles/overlays/toast.css +80 -33
- package/templates/theme/styles/overlays/tooltip.css +88 -14
- package/templates/theme/styles/shell/brand.css +48 -0
- package/templates/theme/styles/shell/footer.css +72 -0
- package/templates/theme/styles/shell/header.css +7 -50
- package/templates/theme/styles/shell/navbar.css +226 -454
- package/templates/theme/styles/shell/sidebar.css +197 -779
- package/templates/theme/tokens.css +145 -98
- package/dist/components/_internal/box-layout.js +0 -116
- package/dist/components/_internal/box-layout.js.map +0 -1
- package/dist/components/_internal/layout.d.ts +0 -9
- package/dist/components/_internal/layout.js +0 -142
- package/dist/components/_internal/layout.js.map +0 -1
- package/dist/components/badge/badge.a11y.d.ts +0 -17
- package/dist/components/block/block.a11y.d.ts +0 -20
- package/dist/components/box/box.a11y.d.ts +0 -14
- package/dist/components/box/box.d.ts +0 -9
- package/dist/components/box/box.js +0 -36
- package/dist/components/box/box.js.map +0 -1
- package/dist/components/box/box.types.d.ts +0 -72
- package/dist/components/box/index.d.ts +0 -3
- package/dist/components/breadcrumb/breadcrumb.a11y.d.ts +0 -17
- package/dist/components/breadcrumb/breadcrumb.a11y.js +0 -15
- package/dist/components/breadcrumb/breadcrumb.a11y.js.map +0 -1
- package/dist/components/breadcrumb/breadcrumb.d.ts +0 -18
- package/dist/components/breadcrumb/breadcrumb.js +0 -113
- package/dist/components/breadcrumb/breadcrumb.js.map +0 -1
- package/dist/components/breadcrumb/breadcrumb.types.d.ts +0 -65
- package/dist/components/breadcrumb/index.d.ts +0 -3
- package/dist/components/container/container.a11y.d.ts +0 -19
- package/dist/components/flex/flex.a11y.d.ts +0 -22
- package/dist/components/flex/flex.d.ts +0 -9
- package/dist/components/flex/flex.js +0 -115
- package/dist/components/flex/flex.js.map +0 -1
- package/dist/components/flex/flex.types.d.ts +0 -42
- package/dist/components/flex/index.d.ts +0 -3
- package/dist/components/header/header.a11y.d.ts +0 -14
- package/dist/components/header/header.a11y.js +0 -12
- package/dist/components/header/header.a11y.js.map +0 -1
- package/dist/components/inline/index.d.ts +0 -8
- package/dist/components/inline/index.js +0 -13
- package/dist/components/inline/index.js.map +0 -1
- package/dist/components/list-group/index.d.ts +0 -2
- package/dist/components/list-group/list-group.d.ts +0 -9
- package/dist/components/list-group/list-group.js +0 -43
- package/dist/components/list-group/list-group.js.map +0 -1
- package/dist/components/list-group/list-group.types.d.ts +0 -32
- package/dist/components/navbar/navbar-panel.js +0 -42
- package/dist/components/navbar/navbar-panel.js.map +0 -1
- package/dist/components/navbar/navbar.context.js +0 -13
- package/dist/components/navbar/navbar.context.js.map +0 -1
- package/dist/components/navbar/navbar.render.js +0 -26
- package/dist/components/navbar/navbar.render.js.map +0 -1
- package/dist/components/navbar/navbar.shared.js +0 -18
- package/dist/components/navbar/navbar.shared.js.map +0 -1
- package/dist/components/pagination/index.d.ts +0 -2
- package/dist/components/pagination/pagination.d.ts +0 -11
- package/dist/components/pagination/pagination.js +0 -95
- package/dist/components/pagination/pagination.js.map +0 -1
- package/dist/components/pagination/pagination.types.d.ts +0 -40
- package/dist/components/section/section.a11y.d.ts +0 -15
- package/dist/components/separator/separator.a11y.d.ts +0 -17
- package/dist/components/separator/separator.a11y.js +0 -15
- package/dist/components/separator/separator.a11y.js.map +0 -1
- package/dist/components/shell/index.d.ts +0 -3
- package/dist/components/shell/shell-nav.types.d.ts +0 -7
- package/dist/components/shell/shell-panel.js +0 -54
- package/dist/components/shell/shell-panel.js.map +0 -1
- package/dist/components/shell/shell-responsive.js +0 -141
- package/dist/components/shell/shell-responsive.js.map +0 -1
- package/dist/components/shell/shell.a11y.d.ts +0 -23
- package/dist/components/shell/shell.a11y.js +0 -23
- package/dist/components/shell/shell.a11y.js.map +0 -1
- package/dist/components/shell/shell.d.ts +0 -13
- package/dist/components/shell/shell.js +0 -69
- package/dist/components/shell/shell.js.map +0 -1
- package/dist/components/shell/shell.types.d.ts +0 -58
- package/dist/components/sidebar/sidebar-panel.d.ts +0 -7
- package/dist/components/sidebar/sidebar-panel.js +0 -49
- package/dist/components/sidebar/sidebar-panel.js.map +0 -1
- package/dist/components/sidebar/sidebar-toggle.d.ts +0 -7
- package/dist/components/sidebar/sidebar-toggle.js +0 -8
- package/dist/components/sidebar/sidebar-toggle.js.map +0 -1
- package/dist/components/sidebar/sidebar.context.js +0 -21
- package/dist/components/sidebar/sidebar.context.js.map +0 -1
- package/dist/components/sidebar/sidebar.shared.js +0 -12
- package/dist/components/sidebar/sidebar.shared.js.map +0 -1
- package/dist/components/skeleton/skeleton.a11y.d.ts +0 -16
- package/dist/components/spacer/index.d.ts +0 -3
- package/dist/components/spacer/spacer.a11y.d.ts +0 -17
- package/dist/components/spacer/spacer.d.ts +0 -8
- package/dist/components/spacer/spacer.js +0 -49
- package/dist/components/spacer/spacer.js.map +0 -1
- package/dist/components/spacer/spacer.types.d.ts +0 -26
- package/dist/components/stack/index.d.ts +0 -3
- package/dist/components/stack/stack.a11y.d.ts +0 -18
- package/dist/components/stack/stack.d.ts +0 -8
- package/dist/components/stack/stack.js +0 -16
- package/dist/components/stack/stack.js.map +0 -1
- package/dist/components/stack/stack.types.d.ts +0 -22
- package/dist/feedback.d.ts +0 -5
- package/dist/feedback.js +0 -4
- package/dist/layouts.d.ts +0 -25
- package/dist/layouts.js +0 -11
- package/dist/shells.d.ts +0 -16
- package/dist/shells.js +0 -11
- package/src/components/_internal/box-layout.ts +0 -164
- package/src/components/_internal/layout.ts +0 -202
- package/src/components/box/box.a11y.ts +0 -11
- package/src/components/box/box.tsx +0 -38
- package/src/components/box/box.types.ts +0 -76
- package/src/components/box/index.ts +0 -11
- package/src/components/breadcrumb/breadcrumb.a11y.ts +0 -15
- package/src/components/breadcrumb/breadcrumb.tsx +0 -123
- package/src/components/breadcrumb/breadcrumb.types.ts +0 -74
- package/src/components/breadcrumb/index.ts +0 -24
- package/src/components/flex/flex.a11y.ts +0 -19
- package/src/components/flex/flex.tsx +0 -162
- package/src/components/flex/flex.types.ts +0 -51
- package/src/components/flex/index.ts +0 -16
- package/src/components/inline/index.tsx +0 -28
- package/src/components/list-group/index.ts +0 -7
- package/src/components/list-group/list-group.tsx +0 -74
- package/src/components/list-group/list-group.types.ts +0 -32
- package/src/components/navbar/navbar-panel.tsx +0 -62
- package/src/components/navbar/navbar.context.ts +0 -22
- package/src/components/navbar/navbar.render.tsx +0 -32
- package/src/components/navbar/navbar.shared.ts +0 -21
- package/src/components/pagination/index.ts +0 -8
- package/src/components/pagination/pagination.tsx +0 -158
- package/src/components/pagination/pagination.types.ts +0 -41
- package/src/components/shell/index.ts +0 -16
- package/src/components/shell/shell-nav.types.ts +0 -3
- package/src/components/shell/shell-panel.tsx +0 -85
- package/src/components/shell/shell-responsive.tsx +0 -262
- package/src/components/shell/shell.a11y.ts +0 -20
- package/src/components/shell/shell.tsx +0 -74
- package/src/components/shell/shell.types.ts +0 -71
- package/src/components/sidebar/sidebar-panel.tsx +0 -67
- package/src/components/sidebar/sidebar-toggle.tsx +0 -5
- package/src/components/sidebar/sidebar.context.ts +0 -40
- package/src/components/sidebar/sidebar.shared.ts +0 -12
- package/src/components/spacer/index.ts +0 -9
- package/src/components/spacer/spacer.a11y.ts +0 -14
- package/src/components/spacer/spacer.tsx +0 -61
- package/src/components/spacer/spacer.types.ts +0 -31
- package/src/components/stack/index.ts +0 -3
- package/src/components/stack/stack.a11y.ts +0 -15
- package/src/components/stack/stack.tsx +0 -13
- package/src/components/stack/stack.types.ts +0 -22
- package/src/feedback.ts +0 -6
- package/src/layouts.ts +0 -19
- package/src/shells.ts +0 -13
- package/src/themes/default/styles/actions/toggle.css +0 -50
- package/src/themes/default/styles/disclosure/collapsible.css +0 -58
- package/src/themes/default/styles/display/list-group.css +0 -84
- package/src/themes/default/styles/forms/form.css +0 -5
- package/src/themes/default/styles/layout/responsive-layout.css +0 -230
- package/src/themes/default/styles/navigation/breadcrumb.css +0 -45
- package/src/themes/default/styles/navigation/menu.css +0 -203
- package/src/themes/default/styles/navigation/menubar.css +0 -255
- package/src/themes/default/styles/navigation/pagination.css +0 -91
- package/src/themes/default/styles/shell/theme.css +0 -37
- package/templates/theme/styles/actions/toggle.css +0 -50
- package/templates/theme/styles/disclosure/collapsible.css +0 -58
- package/templates/theme/styles/display/list-group.css +0 -84
- package/templates/theme/styles/forms/form.css +0 -5
- package/templates/theme/styles/layout/responsive-layout.css +0 -230
- package/templates/theme/styles/navigation/breadcrumb.css +0 -45
- package/templates/theme/styles/navigation/menu.css +0 -203
- package/templates/theme/styles/navigation/menubar.css +0 -255
- package/templates/theme/styles/navigation/pagination.css +0 -91
- package/templates/theme/styles/shell/theme.css +0 -37
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
-webkit-font-smoothing: antialiased;
|
|
3
3
|
-moz-osx-font-smoothing: grayscale;
|
|
4
4
|
--ak-font-family-body:
|
|
5
|
-
"
|
|
6
|
-
|
|
5
|
+
"Inter", "Geist", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif,
|
|
6
|
+
"Apple Color Emoji", "Segoe UI Emoji";
|
|
7
|
+
--ak-font-family-display: var(--ak-font-family-body);
|
|
7
8
|
--ak-font-family-mono:
|
|
8
|
-
"IBM Plex Mono", "SFMono-Regular", "Menlo", "Consolas", ui-monospace, monospace,
|
|
9
|
+
"Geist Mono", "IBM Plex Mono", "SFMono-Regular", "Menlo", "Consolas", ui-monospace, monospace,
|
|
9
10
|
"Apple Color Emoji", "Segoe UI Emoji";
|
|
10
11
|
--ak-font-family-emphasis: var(--ak-font-family-body);
|
|
11
12
|
--ak-font-family-quote: "Iowan Old Style", "Palatino Linotype", ui-serif, serif;
|
|
@@ -18,11 +19,12 @@
|
|
|
18
19
|
--ak-font-size-xl: 1.25rem;
|
|
19
20
|
--ak-font-size-2xl: 1.5rem;
|
|
20
21
|
--ak-font-size-3xl: 1.75rem;
|
|
21
|
-
--ak-font-size-heading:
|
|
22
|
-
--ak-font-size-display:
|
|
22
|
+
--ak-font-size-heading: var(--ak-type-6-size);
|
|
23
|
+
--ak-font-size-display: var(--ak-type-9-size);
|
|
23
24
|
|
|
24
25
|
--ak-font-weight-light: 300;
|
|
25
26
|
--ak-font-weight-regular: 400;
|
|
27
|
+
--ak-font-weight-normal: var(--ak-font-weight-regular);
|
|
26
28
|
--ak-font-weight-medium: 500;
|
|
27
29
|
--ak-font-weight-semibold: 600;
|
|
28
30
|
--ak-font-weight-bold: 700;
|
|
@@ -33,7 +35,7 @@
|
|
|
33
35
|
|
|
34
36
|
--ak-type-1-size: 0.75rem;
|
|
35
37
|
--ak-type-1-line-height: 1rem;
|
|
36
|
-
--ak-type-1-letter-spacing:
|
|
38
|
+
--ak-type-1-letter-spacing: 0em;
|
|
37
39
|
--ak-type-2-size: 0.875rem;
|
|
38
40
|
--ak-type-2-line-height: 1.25rem;
|
|
39
41
|
--ak-type-2-letter-spacing: 0em;
|
|
@@ -42,22 +44,22 @@
|
|
|
42
44
|
--ak-type-3-letter-spacing: 0em;
|
|
43
45
|
--ak-type-4-size: 1.125rem;
|
|
44
46
|
--ak-type-4-line-height: 1.625rem;
|
|
45
|
-
--ak-type-4-letter-spacing:
|
|
47
|
+
--ak-type-4-letter-spacing: 0em;
|
|
46
48
|
--ak-type-5-size: 1.25rem;
|
|
47
49
|
--ak-type-5-line-height: 1.75rem;
|
|
48
|
-
--ak-type-5-letter-spacing:
|
|
50
|
+
--ak-type-5-letter-spacing: 0em;
|
|
49
51
|
--ak-type-6-size: 1.625rem;
|
|
50
52
|
--ak-type-6-line-height: 2rem;
|
|
51
|
-
--ak-type-6-letter-spacing:
|
|
53
|
+
--ak-type-6-letter-spacing: 0em;
|
|
52
54
|
--ak-type-7-size: 2rem;
|
|
53
55
|
--ak-type-7-line-height: 2.35rem;
|
|
54
|
-
--ak-type-7-letter-spacing:
|
|
56
|
+
--ak-type-7-letter-spacing: 0em;
|
|
55
57
|
--ak-type-8-size: 2.625rem;
|
|
56
58
|
--ak-type-8-line-height: 2.85rem;
|
|
57
|
-
--ak-type-8-letter-spacing:
|
|
59
|
+
--ak-type-8-letter-spacing: 0em;
|
|
58
60
|
--ak-type-9-size: 4.25rem;
|
|
59
61
|
--ak-type-9-line-height: 4.2rem;
|
|
60
|
-
--ak-type-9-letter-spacing:
|
|
62
|
+
--ak-type-9-letter-spacing: 0em;
|
|
61
63
|
|
|
62
64
|
/* Semantic spacing is the authored scale. Numeric steps are compatibility aliases. */
|
|
63
65
|
--ak-space-xs: 0.25rem;
|
|
@@ -80,16 +82,34 @@
|
|
|
80
82
|
--ak-radius-sm: 6px;
|
|
81
83
|
--ak-radius-md: 8px;
|
|
82
84
|
--ak-radius-lg: 10px;
|
|
83
|
-
--ak-radius-xl:
|
|
85
|
+
--ak-radius-xl: 12px;
|
|
84
86
|
--ak-radius-round: 9999px;
|
|
85
87
|
|
|
86
88
|
--ak-border-width-sm: 1px;
|
|
87
89
|
--ak-border-width-md: 2px;
|
|
88
|
-
--ak-
|
|
89
|
-
--ak-
|
|
90
|
-
--ak-
|
|
91
|
-
|
|
92
|
-
--ak-
|
|
90
|
+
--ak-border-base: 0 solid transparent;
|
|
91
|
+
--ak-border-sm: var(--ak-border-width-sm) solid var(--ak-color-border);
|
|
92
|
+
--ak-border-md: var(--ak-border-width-md) solid var(--ak-color-border);
|
|
93
|
+
--ak-border-bottom-base: var(--ak-border-base);
|
|
94
|
+
--ak-border-bottom-sm: var(--ak-border-sm);
|
|
95
|
+
--ak-border-bottom-md: var(--ak-border-md);
|
|
96
|
+
--ak-border-right-base: var(--ak-border-base);
|
|
97
|
+
--ak-border-right-sm: var(--ak-border-sm);
|
|
98
|
+
--ak-border-right-md: var(--ak-border-md);
|
|
99
|
+
--ak-border-radius-base: 0;
|
|
100
|
+
--ak-border-radius-sm: var(--ak-radius-sm);
|
|
101
|
+
--ak-border-radius-md: var(--ak-radius-md);
|
|
102
|
+
--ak-background-base: transparent;
|
|
103
|
+
--ak-background-sm: var(--ak-color-surface);
|
|
104
|
+
--ak-background-md: var(--ak-color-surface-muted);
|
|
105
|
+
--ak-shadow-xs: none;
|
|
106
|
+
--ak-shadow-sm: none;
|
|
107
|
+
--ak-shadow-md: 0 8px 18px -12px rgb(0 0 0 / 0.24);
|
|
108
|
+
--ak-shadow-lg: 0 25px 50px -12px rgb(0 0 0 / 0.25);
|
|
109
|
+
--ak-box-shadow-base: none;
|
|
110
|
+
--ak-box-shadow-sm: var(--ak-shadow-sm);
|
|
111
|
+
--ak-box-shadow-md: var(--ak-shadow-md);
|
|
112
|
+
--ak-focus-ring-width: 3px;
|
|
93
113
|
--ak-focus-ring-offset: 2px;
|
|
94
114
|
--ak-duration-fast: 160ms;
|
|
95
115
|
--ak-duration-normal: 220ms;
|
|
@@ -121,12 +141,14 @@
|
|
|
121
141
|
--ak-layout-page-gutter: clamp(1rem, 0.7rem + 1.25vw, 1.75rem);
|
|
122
142
|
--ak-layout-panel-padding: clamp(0.9rem, 0.78rem + 0.45vw, 1.2rem);
|
|
123
143
|
--ak-container-inline-size: 100%;
|
|
144
|
+
--ak-density-control-height-xs: 1.5rem;
|
|
124
145
|
--ak-density-control-height-sm: 2rem;
|
|
125
|
-
--ak-density-control-height-md: 2.
|
|
126
|
-
--ak-density-control-height-lg: 2.
|
|
146
|
+
--ak-density-control-height-md: 2.25rem;
|
|
147
|
+
--ak-density-control-height-lg: 2.5rem;
|
|
148
|
+
--ak-density-control-padding-x-xs: 0.5rem;
|
|
127
149
|
--ak-density-control-padding-x-sm: 0.75rem;
|
|
128
|
-
--ak-density-control-padding-x-md:
|
|
129
|
-
--ak-density-control-padding-x-lg: 1.
|
|
150
|
+
--ak-density-control-padding-x-md: 1rem;
|
|
151
|
+
--ak-density-control-padding-x-lg: 1.5rem;
|
|
130
152
|
--ak-container-1: 30rem;
|
|
131
153
|
--ak-container-2: 42rem;
|
|
132
154
|
--ak-container-3: 58rem;
|
|
@@ -137,6 +159,9 @@
|
|
|
137
159
|
--ak-section-4: var(--ak-space-7);
|
|
138
160
|
|
|
139
161
|
--ak-z-dropdown: 1000;
|
|
162
|
+
--ak-z-index-base: auto;
|
|
163
|
+
--ak-z-index-sm: 10;
|
|
164
|
+
--ak-z-index-md: 100;
|
|
140
165
|
--ak-z-sticky: 1100;
|
|
141
166
|
--ak-z-fixed: 1200;
|
|
142
167
|
--ak-z-modal-backdrop: 1300;
|
|
@@ -145,80 +170,81 @@
|
|
|
145
170
|
--ak-z-toast: 1550;
|
|
146
171
|
--ak-z-tooltip: 1600;
|
|
147
172
|
|
|
148
|
-
--ak-dark-color-primary:
|
|
149
|
-
--ak-dark-color-primary-hover:
|
|
150
|
-
--ak-dark-color-primary-active:
|
|
151
|
-
--ak-dark-color-primary-soft:
|
|
152
|
-
--ak-dark-color-primary-ink:
|
|
173
|
+
--ak-dark-color-primary: oklch(0.922 0 0);
|
|
174
|
+
--ak-dark-color-primary-hover: color-mix(in oklch, var(--ak-dark-color-primary) 90%, transparent);
|
|
175
|
+
--ak-dark-color-primary-active: color-mix(in oklch, var(--ak-dark-color-primary) 84%, black);
|
|
176
|
+
--ak-dark-color-primary-soft: oklch(0.269 0 0);
|
|
177
|
+
--ak-dark-color-primary-ink: oklch(0.205 0 0);
|
|
153
178
|
|
|
154
|
-
--ak-dark-color-text:
|
|
155
|
-
--ak-dark-color-text-muted:
|
|
156
|
-
--ak-dark-color-text-subtle:
|
|
157
|
-
--ak-dark-color-text-inverse:
|
|
179
|
+
--ak-dark-color-text: oklch(0.985 0 0);
|
|
180
|
+
--ak-dark-color-text-muted: oklch(0.708 0 0);
|
|
181
|
+
--ak-dark-color-text-subtle: oklch(0.556 0 0);
|
|
182
|
+
--ak-dark-color-text-inverse: oklch(0.205 0 0);
|
|
158
183
|
|
|
159
|
-
--ak-dark-color-bg:
|
|
160
|
-
--ak-dark-color-surface:
|
|
161
|
-
--ak-dark-color-surface-muted:
|
|
162
|
-
--ak-dark-color-surface-raised:
|
|
163
|
-
--ak-dark-color-surface-overlay:
|
|
184
|
+
--ak-dark-color-bg: oklch(0.145 0 0);
|
|
185
|
+
--ak-dark-color-surface: oklch(0.205 0 0);
|
|
186
|
+
--ak-dark-color-surface-muted: oklch(0.269 0 0);
|
|
187
|
+
--ak-dark-color-surface-raised: oklch(0.205 0 0);
|
|
188
|
+
--ak-dark-color-surface-overlay: oklch(0.205 0 0);
|
|
164
189
|
|
|
165
|
-
--ak-dark-color-border-subtle:
|
|
166
|
-
--ak-dark-color-border:
|
|
167
|
-
--ak-dark-color-border-strong:
|
|
190
|
+
--ak-dark-color-border-subtle: oklch(0.269 0 0);
|
|
191
|
+
--ak-dark-color-border: oklch(1 0 0 / 10%);
|
|
192
|
+
--ak-dark-color-border-strong: oklch(0.439 0 0);
|
|
168
193
|
|
|
169
194
|
--ak-dark-color-success: #4ade80;
|
|
170
|
-
--ak-dark-color-success-soft:
|
|
171
|
-
--ak-dark-color-success-ink: #
|
|
195
|
+
--ak-dark-color-success-soft: #052e16;
|
|
196
|
+
--ak-dark-color-success-ink: #bbf7d0;
|
|
172
197
|
--ak-dark-color-warning: #fbbf24;
|
|
173
|
-
--ak-dark-color-warning-soft:
|
|
174
|
-
--ak-dark-color-warning-ink: #
|
|
175
|
-
--ak-dark-color-danger:
|
|
176
|
-
--ak-dark-color-danger-soft:
|
|
198
|
+
--ak-dark-color-warning-soft: #422006;
|
|
199
|
+
--ak-dark-color-warning-ink: #fde68a;
|
|
200
|
+
--ak-dark-color-danger: oklch(0.704 0.191 22.216);
|
|
201
|
+
--ak-dark-color-danger-soft: oklch(0.704 0.191 22.216 / 0.2);
|
|
177
202
|
--ak-dark-color-danger-ink: #ffe4e6;
|
|
178
203
|
--ak-dark-color-info: #38bdf8;
|
|
179
|
-
--ak-dark-color-info-soft:
|
|
180
|
-
--ak-dark-color-info-ink: #
|
|
181
|
-
|
|
182
|
-
--ak-dark-color-link: var(--ak-dark-color-
|
|
183
|
-
--ak-dark-color-link-hover: var(--ak-dark-color-
|
|
184
|
-
--ak-dark-color-focus-ring:
|
|
185
|
-
--ak-dark-color-disabled-bg:
|
|
186
|
-
--ak-dark-color-disabled-surface:
|
|
187
|
-
--ak-dark-color-disabled-border:
|
|
188
|
-
--ak-dark-color-disabled-text:
|
|
189
|
-
--ak-dark-color-selected:
|
|
190
|
-
--ak-dark-color-selected-border:
|
|
191
|
-
--ak-dark-color-hover:
|
|
192
|
-
--ak-dark-color-active:
|
|
193
|
-
--ak-dark-color-backdrop:
|
|
194
|
-
|
|
195
|
-
--ak-dark-shadow-
|
|
196
|
-
--ak-dark-shadow-
|
|
197
|
-
--ak-dark-shadow-
|
|
204
|
+
--ak-dark-color-info-soft: #082f49;
|
|
205
|
+
--ak-dark-color-info-ink: #bae6fd;
|
|
206
|
+
|
|
207
|
+
--ak-dark-color-link: var(--ak-dark-color-text);
|
|
208
|
+
--ak-dark-color-link-hover: color-mix(in oklch, var(--ak-dark-color-link) 88%, transparent);
|
|
209
|
+
--ak-dark-color-focus-ring: oklch(0.556 0 0 / 0.5);
|
|
210
|
+
--ak-dark-color-disabled-bg: oklch(0.269 0 0);
|
|
211
|
+
--ak-dark-color-disabled-surface: oklch(0.205 0 0);
|
|
212
|
+
--ak-dark-color-disabled-border: oklch(1 0 0 / 10%);
|
|
213
|
+
--ak-dark-color-disabled-text: oklch(0.708 0 0);
|
|
214
|
+
--ak-dark-color-selected: oklch(0.269 0 0);
|
|
215
|
+
--ak-dark-color-selected-border: oklch(1 0 0 / 10%);
|
|
216
|
+
--ak-dark-color-hover: oklch(0.269 0 0);
|
|
217
|
+
--ak-dark-color-active: color-mix(in oklch, var(--ak-dark-color-hover) 82%, white);
|
|
218
|
+
--ak-dark-color-backdrop: rgb(0 0 0 / 0.5);
|
|
219
|
+
|
|
220
|
+
--ak-dark-shadow-xs: none;
|
|
221
|
+
--ak-dark-shadow-sm: none;
|
|
222
|
+
--ak-dark-shadow-md: 0 8px 18px -12px rgb(0 0 0 / 0.6);
|
|
223
|
+
--ak-dark-shadow-lg: 0 25px 50px -12px rgb(0 0 0 / 0.7);
|
|
198
224
|
}
|
|
199
225
|
|
|
200
226
|
:root,
|
|
201
227
|
[data-theme="light"] {
|
|
202
|
-
--ak-color-primary:
|
|
203
|
-
--ak-color-primary-hover:
|
|
204
|
-
--ak-color-primary-active:
|
|
205
|
-
--ak-color-primary-soft:
|
|
206
|
-
--ak-color-primary-ink:
|
|
207
|
-
|
|
208
|
-
--ak-color-text:
|
|
209
|
-
--ak-color-text-muted:
|
|
210
|
-
--ak-color-text-subtle:
|
|
211
|
-
--ak-color-text-inverse:
|
|
212
|
-
|
|
213
|
-
--ak-color-bg:
|
|
214
|
-
--ak-color-surface:
|
|
215
|
-
--ak-color-surface-muted:
|
|
216
|
-
--ak-color-surface-raised:
|
|
217
|
-
--ak-color-surface-overlay:
|
|
218
|
-
|
|
219
|
-
--ak-color-border-subtle:
|
|
220
|
-
--ak-color-border:
|
|
221
|
-
--ak-color-border-strong:
|
|
228
|
+
--ak-color-primary: oklch(0.205 0 0);
|
|
229
|
+
--ak-color-primary-hover: color-mix(in oklch, var(--ak-color-primary) 90%, transparent);
|
|
230
|
+
--ak-color-primary-active: color-mix(in oklch, var(--ak-color-primary) 88%, black);
|
|
231
|
+
--ak-color-primary-soft: oklch(0.97 0 0);
|
|
232
|
+
--ak-color-primary-ink: oklch(0.205 0 0);
|
|
233
|
+
|
|
234
|
+
--ak-color-text: oklch(0.145 0 0);
|
|
235
|
+
--ak-color-text-muted: oklch(0.556 0 0);
|
|
236
|
+
--ak-color-text-subtle: oklch(0.708 0 0);
|
|
237
|
+
--ak-color-text-inverse: oklch(0.985 0 0);
|
|
238
|
+
|
|
239
|
+
--ak-color-bg: oklch(1 0 0);
|
|
240
|
+
--ak-color-surface: oklch(1 0 0);
|
|
241
|
+
--ak-color-surface-muted: oklch(0.97 0 0);
|
|
242
|
+
--ak-color-surface-raised: oklch(1 0 0);
|
|
243
|
+
--ak-color-surface-overlay: oklch(1 0 0);
|
|
244
|
+
|
|
245
|
+
--ak-color-border-subtle: oklch(0.922 0 0);
|
|
246
|
+
--ak-color-border: oklch(0.922 0 0);
|
|
247
|
+
--ak-color-border-strong: oklch(0.708 0 0);
|
|
222
248
|
|
|
223
249
|
--ak-color-success: #16a34a;
|
|
224
250
|
--ak-color-success-soft: rgba(22, 163, 74, 0.14);
|
|
@@ -226,25 +252,32 @@
|
|
|
226
252
|
--ak-color-warning: #f59e0b;
|
|
227
253
|
--ak-color-warning-soft: rgba(245, 158, 11, 0.16);
|
|
228
254
|
--ak-color-warning-ink: #854d0e;
|
|
229
|
-
--ak-color-danger:
|
|
230
|
-
--ak-color-danger-soft:
|
|
255
|
+
--ak-color-danger: oklch(0.577 0.245 27.325);
|
|
256
|
+
--ak-color-danger-soft: oklch(0.577 0.245 27.325 / 0.2);
|
|
231
257
|
--ak-color-danger-ink: #991b1b;
|
|
232
258
|
--ak-color-info: #0ea5e9;
|
|
233
259
|
--ak-color-info-soft: rgba(14, 165, 233, 0.16);
|
|
234
260
|
--ak-color-info-ink: #0c4a6e;
|
|
235
261
|
|
|
236
|
-
--ak-color-link:
|
|
237
|
-
--ak-color-link-hover:
|
|
238
|
-
--ak-color-focus-ring:
|
|
239
|
-
--ak-color-disabled-bg:
|
|
240
|
-
--ak-color-disabled-surface:
|
|
241
|
-
--ak-color-disabled-border:
|
|
242
|
-
--ak-color-disabled-text:
|
|
243
|
-
--ak-color-selected:
|
|
244
|
-
--ak-color-selected-border:
|
|
245
|
-
--ak-color-hover:
|
|
246
|
-
--ak-color-active:
|
|
247
|
-
--ak-color-backdrop:
|
|
262
|
+
--ak-color-link: var(--ak-color-primary);
|
|
263
|
+
--ak-color-link-hover: color-mix(in oklch, var(--ak-color-link) 88%, transparent);
|
|
264
|
+
--ak-color-focus-ring: oklch(0.708 0 0 / 0.5);
|
|
265
|
+
--ak-color-disabled-bg: oklch(0.97 0 0);
|
|
266
|
+
--ak-color-disabled-surface: oklch(1 0 0);
|
|
267
|
+
--ak-color-disabled-border: oklch(0.922 0 0);
|
|
268
|
+
--ak-color-disabled-text: oklch(0.556 0 0);
|
|
269
|
+
--ak-color-selected: oklch(0.97 0 0);
|
|
270
|
+
--ak-color-selected-border: oklch(0.922 0 0);
|
|
271
|
+
--ak-color-hover: oklch(0.97 0 0);
|
|
272
|
+
--ak-color-active: color-mix(in oklch, var(--ak-color-hover) 82%, black);
|
|
273
|
+
--ak-color-backdrop: rgb(0 0 0 / 0.1);
|
|
274
|
+
|
|
275
|
+
--ak-color-accent: var(--ak-color-hover);
|
|
276
|
+
--ak-color-accent-ink: var(--ak-color-text);
|
|
277
|
+
--ak-color-input: var(--ak-color-border);
|
|
278
|
+
--ak-color-popover: var(--ak-color-surface-overlay);
|
|
279
|
+
--ak-color-popover-ink: var(--ak-color-text);
|
|
280
|
+
--ak-color-ring: var(--ak-color-border-strong);
|
|
248
281
|
|
|
249
282
|
--ak-color-fg: var(--ak-color-text);
|
|
250
283
|
--ak-color-muted: var(--ak-color-text-muted);
|
|
@@ -303,9 +336,16 @@
|
|
|
303
336
|
--ak-shadow-sm: var(--ak-dark-shadow-sm);
|
|
304
337
|
--ak-shadow-md: var(--ak-dark-shadow-md);
|
|
305
338
|
--ak-shadow-lg: var(--ak-dark-shadow-lg);
|
|
339
|
+
--ak-shadow-xs: var(--ak-dark-shadow-xs);
|
|
306
340
|
|
|
307
341
|
--ak-color-fg: var(--ak-color-text);
|
|
308
342
|
--ak-color-muted: var(--ak-color-text-muted);
|
|
343
|
+
--ak-color-accent: var(--ak-color-hover);
|
|
344
|
+
--ak-color-accent-ink: var(--ak-color-text);
|
|
345
|
+
--ak-color-input: var(--ak-color-border);
|
|
346
|
+
--ak-color-popover: var(--ak-color-surface-overlay);
|
|
347
|
+
--ak-color-popover-ink: var(--ak-color-text);
|
|
348
|
+
--ak-color-ring: var(--ak-color-border-strong);
|
|
309
349
|
|
|
310
350
|
color-scheme: dark;
|
|
311
351
|
}
|
|
@@ -370,9 +410,16 @@
|
|
|
370
410
|
--ak-shadow-sm: var(--ak-dark-shadow-sm);
|
|
371
411
|
--ak-shadow-md: var(--ak-dark-shadow-md);
|
|
372
412
|
--ak-shadow-lg: var(--ak-dark-shadow-lg);
|
|
413
|
+
--ak-shadow-xs: var(--ak-dark-shadow-xs);
|
|
373
414
|
|
|
374
415
|
--ak-color-fg: var(--ak-color-text);
|
|
375
416
|
--ak-color-muted: var(--ak-color-text-muted);
|
|
417
|
+
--ak-color-accent: var(--ak-color-hover);
|
|
418
|
+
--ak-color-accent-ink: var(--ak-color-text);
|
|
419
|
+
--ak-color-input: var(--ak-color-border);
|
|
420
|
+
--ak-color-popover: var(--ak-color-surface-overlay);
|
|
421
|
+
--ak-color-popover-ink: var(--ak-color-text);
|
|
422
|
+
--ak-color-ring: var(--ak-color-border-strong);
|
|
376
423
|
|
|
377
424
|
color-scheme: dark;
|
|
378
425
|
}
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { styleDeclarationsToClass } from "./style.js";
|
|
2
|
-
import { mergeLayoutStyles, resolveSpaceValue, setResponsiveStyleVar } from "./layout.js";
|
|
3
|
-
//#region src/components/_internal/box-layout.ts
|
|
4
|
-
const SPACE_PROP_KEYS = new Set([
|
|
5
|
-
"m",
|
|
6
|
-
"mx",
|
|
7
|
-
"my",
|
|
8
|
-
"mt",
|
|
9
|
-
"mr",
|
|
10
|
-
"mb",
|
|
11
|
-
"ml",
|
|
12
|
-
"p",
|
|
13
|
-
"px",
|
|
14
|
-
"py",
|
|
15
|
-
"pt",
|
|
16
|
-
"pr",
|
|
17
|
-
"pb",
|
|
18
|
-
"pl",
|
|
19
|
-
"inset",
|
|
20
|
-
"top",
|
|
21
|
-
"right",
|
|
22
|
-
"bottom",
|
|
23
|
-
"left"
|
|
24
|
-
]);
|
|
25
|
-
const BOX_PROP_KEYS = new Set([
|
|
26
|
-
"display",
|
|
27
|
-
"m",
|
|
28
|
-
"mx",
|
|
29
|
-
"my",
|
|
30
|
-
"mt",
|
|
31
|
-
"mr",
|
|
32
|
-
"mb",
|
|
33
|
-
"ml",
|
|
34
|
-
"p",
|
|
35
|
-
"px",
|
|
36
|
-
"py",
|
|
37
|
-
"pt",
|
|
38
|
-
"pr",
|
|
39
|
-
"pb",
|
|
40
|
-
"pl",
|
|
41
|
-
"width",
|
|
42
|
-
"minWidth",
|
|
43
|
-
"maxWidth",
|
|
44
|
-
"height",
|
|
45
|
-
"minHeight",
|
|
46
|
-
"maxHeight",
|
|
47
|
-
"position",
|
|
48
|
-
"inset",
|
|
49
|
-
"top",
|
|
50
|
-
"right",
|
|
51
|
-
"bottom",
|
|
52
|
-
"left",
|
|
53
|
-
"overflow",
|
|
54
|
-
"overflowX",
|
|
55
|
-
"overflowY",
|
|
56
|
-
"flexBasis",
|
|
57
|
-
"flexGrow",
|
|
58
|
-
"flexShrink",
|
|
59
|
-
"gridArea",
|
|
60
|
-
"gridColumn",
|
|
61
|
-
"gridColumnStart",
|
|
62
|
-
"gridColumnEnd",
|
|
63
|
-
"gridRow",
|
|
64
|
-
"gridRowStart",
|
|
65
|
-
"gridRowEnd"
|
|
66
|
-
]);
|
|
67
|
-
function variableNameForProp(prop) {
|
|
68
|
-
switch (prop) {
|
|
69
|
-
case "overflowX": return "overflow-x";
|
|
70
|
-
case "overflowY": return "overflow-y";
|
|
71
|
-
case "minWidth": return "min-width";
|
|
72
|
-
case "maxWidth": return "max-width";
|
|
73
|
-
case "minHeight": return "min-height";
|
|
74
|
-
case "maxHeight": return "max-height";
|
|
75
|
-
case "flexBasis": return "flex-basis";
|
|
76
|
-
case "flexGrow": return "flex-grow";
|
|
77
|
-
case "flexShrink": return "flex-shrink";
|
|
78
|
-
case "gridArea": return "grid-area";
|
|
79
|
-
case "gridColumn": return "grid-column";
|
|
80
|
-
case "gridColumnStart": return "grid-column-start";
|
|
81
|
-
case "gridColumnEnd": return "grid-column-end";
|
|
82
|
-
case "gridRow": return "grid-row";
|
|
83
|
-
case "gridRowStart": return "grid-row-start";
|
|
84
|
-
case "gridRowEnd": return "grid-row-end";
|
|
85
|
-
default: return prop;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
function splitBoxLayoutProps(props) {
|
|
89
|
-
const boxProps = {};
|
|
90
|
-
const rest = {};
|
|
91
|
-
for (const [key, value] of Object.entries(props)) if (BOX_PROP_KEYS.has(key)) boxProps[key] = value;
|
|
92
|
-
else rest[key] = value;
|
|
93
|
-
return {
|
|
94
|
-
boxProps,
|
|
95
|
-
rest
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
function applyBoxLayoutStyles(styles, boxProps) {
|
|
99
|
-
for (const key of BOX_PROP_KEYS) {
|
|
100
|
-
const value = boxProps[key];
|
|
101
|
-
if (value === void 0) continue;
|
|
102
|
-
const variable = variableNameForProp(key);
|
|
103
|
-
if (SPACE_PROP_KEYS.has(key)) {
|
|
104
|
-
setResponsiveStyleVar(styles, variable, value, resolveSpaceValue);
|
|
105
|
-
continue;
|
|
106
|
-
}
|
|
107
|
-
setResponsiveStyleVar(styles, variable, value, (input) => input);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
function withBoxLayoutClass(styles, userStyle) {
|
|
111
|
-
return styleDeclarationsToClass(mergeLayoutStyles(styles, userStyle));
|
|
112
|
-
}
|
|
113
|
-
//#endregion
|
|
114
|
-
export { applyBoxLayoutStyles, splitBoxLayoutProps, withBoxLayoutClass };
|
|
115
|
-
|
|
116
|
-
//# sourceMappingURL=box-layout.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"box-layout.js","names":[],"sources":["../../../src/components/_internal/box-layout.ts"],"sourcesContent":["import { mergeLayoutStyles, resolveSpaceValue, setResponsiveStyleVar } from \"./layout\";\nimport { styleDeclarationsToClass } from \"./style\";\nimport type { BoxLayoutOwnProps } from \"../box/box.types\";\n\nconst SPACE_PROP_KEYS = new Set([\n \"m\",\n \"mx\",\n \"my\",\n \"mt\",\n \"mr\",\n \"mb\",\n \"ml\",\n \"p\",\n \"px\",\n \"py\",\n \"pt\",\n \"pr\",\n \"pb\",\n \"pl\",\n \"inset\",\n \"top\",\n \"right\",\n \"bottom\",\n \"left\",\n]);\n\nconst BOX_PROP_KEYS = new Set<keyof BoxLayoutOwnProps>([\n \"display\",\n \"m\",\n \"mx\",\n \"my\",\n \"mt\",\n \"mr\",\n \"mb\",\n \"ml\",\n \"p\",\n \"px\",\n \"py\",\n \"pt\",\n \"pr\",\n \"pb\",\n \"pl\",\n \"width\",\n \"minWidth\",\n \"maxWidth\",\n \"height\",\n \"minHeight\",\n \"maxHeight\",\n \"position\",\n \"inset\",\n \"top\",\n \"right\",\n \"bottom\",\n \"left\",\n \"overflow\",\n \"overflowX\",\n \"overflowY\",\n \"flexBasis\",\n \"flexGrow\",\n \"flexShrink\",\n \"gridArea\",\n \"gridColumn\",\n \"gridColumnStart\",\n \"gridColumnEnd\",\n \"gridRow\",\n \"gridRowStart\",\n \"gridRowEnd\",\n]);\n\nfunction variableNameForProp(prop: keyof BoxLayoutOwnProps): string {\n switch (prop) {\n case \"overflowX\":\n return \"overflow-x\";\n case \"overflowY\":\n return \"overflow-y\";\n case \"minWidth\":\n return \"min-width\";\n case \"maxWidth\":\n return \"max-width\";\n case \"minHeight\":\n return \"min-height\";\n case \"maxHeight\":\n return \"max-height\";\n case \"flexBasis\":\n return \"flex-basis\";\n case \"flexGrow\":\n return \"flex-grow\";\n case \"flexShrink\":\n return \"flex-shrink\";\n case \"gridArea\":\n return \"grid-area\";\n case \"gridColumn\":\n return \"grid-column\";\n case \"gridColumnStart\":\n return \"grid-column-start\";\n case \"gridColumnEnd\":\n return \"grid-column-end\";\n case \"gridRow\":\n return \"grid-row\";\n case \"gridRowStart\":\n return \"grid-row-start\";\n case \"gridRowEnd\":\n return \"grid-row-end\";\n default:\n return prop;\n }\n}\n\nexport function splitBoxLayoutProps<T extends Record<string, unknown>>(\n props: T,\n): {\n boxProps: Partial<BoxLayoutOwnProps>;\n rest: Omit<T, keyof BoxLayoutOwnProps>;\n} {\n const boxProps: Partial<BoxLayoutOwnProps> = {};\n const rest: Record<string, unknown> = {};\n\n for (const [key, value] of Object.entries(props)) {\n if (BOX_PROP_KEYS.has(key as keyof BoxLayoutOwnProps)) {\n (boxProps as Record<string, unknown>)[key] = value;\n } else {\n rest[key] = value;\n }\n }\n\n return { boxProps, rest: rest as Omit<T, keyof BoxLayoutOwnProps> };\n}\n\nexport function applyBoxLayoutStyles(\n styles: Record<string, string | number>,\n boxProps: Partial<BoxLayoutOwnProps>,\n) {\n for (const key of BOX_PROP_KEYS) {\n const value = boxProps[key];\n if (value === undefined) continue;\n\n const variable = variableNameForProp(key);\n if (SPACE_PROP_KEYS.has(key)) {\n setResponsiveStyleVar(styles, variable, value as string | number, resolveSpaceValue);\n continue;\n }\n\n setResponsiveStyleVar(\n styles,\n variable,\n value as string | number,\n (input) => input as string | number,\n );\n }\n}\n\nexport function withBoxLayoutStyle(\n styles: Record<string, string | number>,\n userStyle: unknown,\n): string | undefined {\n return mergeLayoutStyles(styles, userStyle);\n}\n\nexport function withBoxLayoutClass(\n styles: Record<string, string | number>,\n userStyle: unknown,\n): string | undefined {\n return styleDeclarationsToClass(mergeLayoutStyles(styles, userStyle));\n}\n"],"mappings":";;;AAIA,MAAM,kBAAkB,IAAI,IAAI;CAC9B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAM,gBAAgB,IAAI,IAA6B;CACrD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,SAAS,oBAAoB,MAAuC;CAClE,QAAQ,MAAR;EACE,KAAK,aACH,OAAO;EACT,KAAK,aACH,OAAO;EACT,KAAK,YACH,OAAO;EACT,KAAK,YACH,OAAO;EACT,KAAK,aACH,OAAO;EACT,KAAK,aACH,OAAO;EACT,KAAK,aACH,OAAO;EACT,KAAK,YACH,OAAO;EACT,KAAK,cACH,OAAO;EACT,KAAK,YACH,OAAO;EACT,KAAK,cACH,OAAO;EACT,KAAK,mBACH,OAAO;EACT,KAAK,iBACH,OAAO;EACT,KAAK,WACH,OAAO;EACT,KAAK,gBACH,OAAO;EACT,KAAK,cACH,OAAO;EACT,SACE,OAAO;CACX;AACF;AAEA,SAAgB,oBACd,OAIA;CACA,MAAM,WAAuC,CAAC;CAC9C,MAAM,OAAgC,CAAC;CAEvC,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,KAAK,GAC7C,IAAI,cAAc,IAAI,GAA8B,GAClD,SAAsC,OAAO;MAE7C,KAAK,OAAO;CAIhB,OAAO;EAAE;EAAgB;CAAyC;AACpE;AAEA,SAAgB,qBACd,QACA,UACA;CACA,KAAK,MAAM,OAAO,eAAe;EAC/B,MAAM,QAAQ,SAAS;EACvB,IAAI,UAAU,KAAA,GAAW;EAEzB,MAAM,WAAW,oBAAoB,GAAG;EACxC,IAAI,gBAAgB,IAAI,GAAG,GAAG;GAC5B,sBAAsB,QAAQ,UAAU,OAA0B,iBAAiB;GACnF;EACF;EAEA,sBACE,QACA,UACA,QACC,UAAU,KACb;CACF;AACF;AASA,SAAgB,mBACd,QACA,WACoB;CACpB,OAAO,yBAAyB,kBAAkB,QAAQ,SAAS,CAAC;AACtE"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
//#region src/components/_internal/layout.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Layout helpers shared by headless layout primitives.
|
|
4
|
-
*/
|
|
5
|
-
type LayoutBreakpoint = "initial" | "sm" | "md" | "lg" | "xl";
|
|
6
|
-
type ResponsiveValue<T> = T | Partial<Record<LayoutBreakpoint, T>>;
|
|
7
|
-
//#endregion
|
|
8
|
-
export { ResponsiveValue };
|
|
9
|
-
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
import { serializeCssDeclarations } from "./style.js";
|
|
2
|
-
//#region src/components/_internal/layout.ts
|
|
3
|
-
const BREAKPOINTS = [
|
|
4
|
-
"initial",
|
|
5
|
-
"sm",
|
|
6
|
-
"md",
|
|
7
|
-
"lg",
|
|
8
|
-
"xl"
|
|
9
|
-
];
|
|
10
|
-
/** Units and patterns that identify a concrete CSS length value. */
|
|
11
|
-
const CSS_UNIT_RE = /^-?[\d.]+(%|px|em|rem|ex|ch|ic|lh|rlh|vw|vh|vmin|vmax|svw|svh|dvw|dvh|cqw|cqh|cqi|cqb|fr|cm|mm|in|pt|pc|Q)$/;
|
|
12
|
-
const SPACE_TOKEN_MAP = {
|
|
13
|
-
"1": "var(--ak-space-1)",
|
|
14
|
-
"2": "var(--ak-space-2)",
|
|
15
|
-
"3": "var(--ak-space-3)",
|
|
16
|
-
"4": "var(--ak-space-4)",
|
|
17
|
-
"5": "var(--ak-space-5)",
|
|
18
|
-
"6": "var(--ak-space-6)",
|
|
19
|
-
"7": "var(--ak-space-7)",
|
|
20
|
-
"8": "var(--ak-space-8)",
|
|
21
|
-
"9": "var(--ak-space-9)",
|
|
22
|
-
xs: "var(--ak-space-xs)",
|
|
23
|
-
sm: "var(--ak-space-sm)",
|
|
24
|
-
md: "var(--ak-space-md)",
|
|
25
|
-
lg: "var(--ak-space-lg)",
|
|
26
|
-
xl: "var(--ak-space-xl)",
|
|
27
|
-
"2xl": "var(--ak-space-2xl)",
|
|
28
|
-
"3xl": "var(--ak-space-3xl)"
|
|
29
|
-
};
|
|
30
|
-
const CONTAINER_SIZE_MAP = {
|
|
31
|
-
"1": "var(--ak-container-1)",
|
|
32
|
-
"2": "var(--ak-container-2)",
|
|
33
|
-
"3": "var(--ak-container-3)",
|
|
34
|
-
"4": "var(--ak-container-4)",
|
|
35
|
-
sm: "var(--ak-container-1)",
|
|
36
|
-
md: "var(--ak-container-2)",
|
|
37
|
-
lg: "var(--ak-container-3)",
|
|
38
|
-
xl: "var(--ak-container-4)",
|
|
39
|
-
fluid: "100%"
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* Returns true when `value` is a concrete CSS length/size that can be serialized
|
|
43
|
-
* into a CSS declaration without token translation.
|
|
44
|
-
*/
|
|
45
|
-
function isCssLength(value) {
|
|
46
|
-
if (typeof value !== "string") return false;
|
|
47
|
-
const v = value.trim();
|
|
48
|
-
if (v === "0") return true;
|
|
49
|
-
if (CSS_UNIT_RE.test(v)) return true;
|
|
50
|
-
if (/^[a-z][a-z-]*\(/.test(v)) return true;
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
53
|
-
function isResponsiveValue(value) {
|
|
54
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) return false;
|
|
55
|
-
return BREAKPOINTS.some((breakpoint) => breakpoint in value);
|
|
56
|
-
}
|
|
57
|
-
function normalizeResponsiveValue(value) {
|
|
58
|
-
if (value === void 0) return void 0;
|
|
59
|
-
if (isResponsiveValue(value)) return value;
|
|
60
|
-
return { initial: value };
|
|
61
|
-
}
|
|
62
|
-
function serializeResponsiveValue(value) {
|
|
63
|
-
const normalized = normalizeResponsiveValue(value);
|
|
64
|
-
if (!normalized) return void 0;
|
|
65
|
-
return BREAKPOINTS.map((breakpoint) => {
|
|
66
|
-
const breakpointValue = normalized[breakpoint];
|
|
67
|
-
if (breakpointValue === void 0) return "";
|
|
68
|
-
return `${breakpoint}:${String(breakpointValue)}`;
|
|
69
|
-
}).filter(Boolean).join("|");
|
|
70
|
-
}
|
|
71
|
-
function serializeResponsiveValueIf(value, predicate) {
|
|
72
|
-
const normalized = normalizeResponsiveValue(value);
|
|
73
|
-
if (!normalized) return void 0;
|
|
74
|
-
for (const breakpoint of BREAKPOINTS) {
|
|
75
|
-
const breakpointValue = normalized[breakpoint];
|
|
76
|
-
if (breakpointValue === void 0) continue;
|
|
77
|
-
if (!predicate(breakpointValue)) return void 0;
|
|
78
|
-
}
|
|
79
|
-
return serializeResponsiveValue(value);
|
|
80
|
-
}
|
|
81
|
-
function setResponsiveStyleVar(styles, variable, value, resolve = (input) => input) {
|
|
82
|
-
const normalized = normalizeResponsiveValue(value);
|
|
83
|
-
if (!normalized) return;
|
|
84
|
-
for (const breakpoint of BREAKPOINTS) {
|
|
85
|
-
const breakpointValue = normalized[breakpoint];
|
|
86
|
-
if (breakpointValue === void 0) continue;
|
|
87
|
-
const resolved = resolve(breakpointValue);
|
|
88
|
-
if (resolved === void 0 || resolved === null || resolved === "") continue;
|
|
89
|
-
styles[`--ak-${variable}-${breakpoint}`] = resolved;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
function resolveSpaceValue(value) {
|
|
93
|
-
if (typeof value === "number") return String(value);
|
|
94
|
-
const trimmed = value.trim();
|
|
95
|
-
return SPACE_TOKEN_MAP[trimmed] ?? trimmed;
|
|
96
|
-
}
|
|
97
|
-
function resolveContainerSizeValue(value) {
|
|
98
|
-
const trimmed = value.trim();
|
|
99
|
-
return CONTAINER_SIZE_MAP[trimmed] ?? trimmed;
|
|
100
|
-
}
|
|
101
|
-
function resolveJustifyValue(value) {
|
|
102
|
-
const trimmed = value.trim();
|
|
103
|
-
if (trimmed === "between") return "space-between";
|
|
104
|
-
if (trimmed === "start") return "flex-start";
|
|
105
|
-
if (trimmed === "end") return "flex-end";
|
|
106
|
-
return trimmed;
|
|
107
|
-
}
|
|
108
|
-
function resolveAlignValue(value) {
|
|
109
|
-
const trimmed = value.trim();
|
|
110
|
-
if (trimmed === "start") return "flex-start";
|
|
111
|
-
if (trimmed === "end") return "flex-end";
|
|
112
|
-
return trimmed;
|
|
113
|
-
}
|
|
114
|
-
function resolveInlineAlignValue(value) {
|
|
115
|
-
if (value === "left") return {
|
|
116
|
-
marginLeft: "0",
|
|
117
|
-
marginRight: "auto"
|
|
118
|
-
};
|
|
119
|
-
if (value === "right") return {
|
|
120
|
-
marginLeft: "auto",
|
|
121
|
-
marginRight: "0"
|
|
122
|
-
};
|
|
123
|
-
return {
|
|
124
|
-
marginLeft: "auto",
|
|
125
|
-
marginRight: "auto"
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Merges a record of computed layout declarations with a user-supplied style
|
|
130
|
-
* value. The user's declarations take precedence for conflicting keys.
|
|
131
|
-
*/
|
|
132
|
-
function mergeLayoutStyles(layout, user) {
|
|
133
|
-
const merged = { ...layout };
|
|
134
|
-
if (user !== null && user !== void 0 && typeof user === "object") Object.assign(merged, user);
|
|
135
|
-
const mergedString = serializeCssDeclarations(merged);
|
|
136
|
-
if (typeof user === "string" && user.trim()) return mergedString ? `${mergedString};${user.trim()}` : user.trim();
|
|
137
|
-
return mergedString || void 0;
|
|
138
|
-
}
|
|
139
|
-
//#endregion
|
|
140
|
-
export { isCssLength, isResponsiveValue, mergeLayoutStyles, resolveAlignValue, resolveContainerSizeValue, resolveInlineAlignValue, resolveJustifyValue, resolveSpaceValue, serializeResponsiveValueIf, setResponsiveStyleVar };
|
|
141
|
-
|
|
142
|
-
//# sourceMappingURL=layout.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"layout.js","names":[],"sources":["../../../src/components/_internal/layout.ts"],"sourcesContent":["import { serializeCssDeclarations } from \"./style\";\n\n/**\n * Layout helpers shared by headless layout primitives.\n */\n\nexport type LayoutBreakpoint = \"initial\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\nexport type ResponsiveValue<T> = T | Partial<Record<LayoutBreakpoint, T>>;\n\nconst BREAKPOINTS: readonly LayoutBreakpoint[] = [\"initial\", \"sm\", \"md\", \"lg\", \"xl\"];\n\n/** Units and patterns that identify a concrete CSS length value. */\nconst CSS_UNIT_RE =\n /^-?[\\d.]+(%|px|em|rem|ex|ch|ic|lh|rlh|vw|vh|vmin|vmax|svw|svh|dvw|dvh|cqw|cqh|cqi|cqb|fr|cm|mm|in|pt|pc|Q)$/;\n\nconst SPACE_TOKEN_MAP: Record<string, string> = {\n \"1\": \"var(--ak-space-1)\",\n \"2\": \"var(--ak-space-2)\",\n \"3\": \"var(--ak-space-3)\",\n \"4\": \"var(--ak-space-4)\",\n \"5\": \"var(--ak-space-5)\",\n \"6\": \"var(--ak-space-6)\",\n \"7\": \"var(--ak-space-7)\",\n \"8\": \"var(--ak-space-8)\",\n \"9\": \"var(--ak-space-9)\",\n xs: \"var(--ak-space-xs)\",\n sm: \"var(--ak-space-sm)\",\n md: \"var(--ak-space-md)\",\n lg: \"var(--ak-space-lg)\",\n xl: \"var(--ak-space-xl)\",\n \"2xl\": \"var(--ak-space-2xl)\",\n \"3xl\": \"var(--ak-space-3xl)\",\n};\n\nconst CONTAINER_SIZE_MAP: Record<string, string> = {\n \"1\": \"var(--ak-container-1)\",\n \"2\": \"var(--ak-container-2)\",\n \"3\": \"var(--ak-container-3)\",\n \"4\": \"var(--ak-container-4)\",\n sm: \"var(--ak-container-1)\",\n md: \"var(--ak-container-2)\",\n lg: \"var(--ak-container-3)\",\n xl: \"var(--ak-container-4)\",\n fluid: \"100%\",\n};\n\nconst SECTION_SIZE_MAP: Record<string, string> = {\n \"1\": \"var(--ak-section-1)\",\n \"2\": \"var(--ak-section-2)\",\n \"3\": \"var(--ak-section-3)\",\n \"4\": \"var(--ak-section-4)\",\n};\n\n/**\n * Returns true when `value` is a concrete CSS length/size that can be serialized\n * into a CSS declaration without token translation.\n */\nexport function isCssLength(value: unknown): value is string {\n if (typeof value !== \"string\") return false;\n const v = value.trim();\n if (v === \"0\") return true;\n if (CSS_UNIT_RE.test(v)) return true;\n // CSS functions: calc(), min(), max(), clamp(), fit-content(), env(), var()\n if (/^[a-z][a-z-]*\\(/.test(v)) return true;\n return false;\n}\n\nexport function isResponsiveValue<T>(\n value: ResponsiveValue<T> | undefined,\n): value is Partial<Record<LayoutBreakpoint, T>> {\n if (!value || typeof value !== \"object\" || Array.isArray(value)) return false;\n return BREAKPOINTS.some((breakpoint) => breakpoint in value);\n}\n\nexport function normalizeResponsiveValue<T>(\n value: ResponsiveValue<T> | undefined,\n): Partial<Record<LayoutBreakpoint, T>> | undefined {\n if (value === undefined) return undefined;\n if (isResponsiveValue(value)) return value;\n return { initial: value };\n}\n\nexport function serializeResponsiveValue<T>(\n value: ResponsiveValue<T> | undefined,\n): string | undefined {\n const normalized = normalizeResponsiveValue(value);\n if (!normalized) return undefined;\n\n return BREAKPOINTS.map((breakpoint) => {\n const breakpointValue = normalized[breakpoint];\n if (breakpointValue === undefined) return \"\";\n return `${breakpoint}:${String(breakpointValue)}`;\n })\n .filter(Boolean)\n .join(\"|\");\n}\n\nexport function serializeResponsiveValueIf<T>(\n value: ResponsiveValue<T> | undefined,\n predicate: (value: T) => boolean,\n): string | undefined {\n const normalized = normalizeResponsiveValue(value);\n if (!normalized) return undefined;\n\n for (const breakpoint of BREAKPOINTS) {\n const breakpointValue = normalized[breakpoint];\n if (breakpointValue === undefined) continue;\n if (!predicate(breakpointValue)) return undefined;\n }\n\n return serializeResponsiveValue(value);\n}\n\nexport function serializeValueIf<T>(\n value: T | undefined,\n predicate: (value: T) => boolean,\n): string | undefined {\n if (value === undefined || !predicate(value)) return undefined;\n return String(value);\n}\n\nexport function setResponsiveStyleVar<T>(\n styles: Record<string, string | number>,\n variable: string,\n value: ResponsiveValue<T> | undefined,\n resolve: (value: T) => string | number | undefined = (input) =>\n input as string | number | undefined,\n) {\n const normalized = normalizeResponsiveValue(value);\n if (!normalized) return;\n\n for (const breakpoint of BREAKPOINTS) {\n const breakpointValue = normalized[breakpoint];\n if (breakpointValue === undefined) continue;\n const resolved = resolve(breakpointValue);\n if (resolved === undefined || resolved === null || resolved === \"\") continue;\n styles[`--ak-${variable}-${breakpoint}`] = resolved;\n }\n}\n\nexport function resolveSpaceValue(value: string | number): string | number {\n if (typeof value === \"number\") return String(value);\n const trimmed = value.trim();\n return SPACE_TOKEN_MAP[trimmed] ?? trimmed;\n}\n\nexport function resolveContainerSizeValue(value: string): string {\n const trimmed = value.trim();\n return CONTAINER_SIZE_MAP[trimmed] ?? trimmed;\n}\n\nexport function resolveSectionSizeValue(value: string): string {\n const trimmed = value.trim();\n return SECTION_SIZE_MAP[trimmed] ?? trimmed;\n}\n\nexport function resolveJustifyValue(value: string): string {\n const trimmed = value.trim();\n if (trimmed === \"between\") return \"space-between\";\n if (trimmed === \"start\") return \"flex-start\";\n if (trimmed === \"end\") return \"flex-end\";\n return trimmed;\n}\n\nexport function resolveAlignValue(value: string): string {\n const trimmed = value.trim();\n if (trimmed === \"start\") return \"flex-start\";\n if (trimmed === \"end\") return \"flex-end\";\n return trimmed;\n}\n\nexport function resolveInlineAlignValue(value: \"left\" | \"center\" | \"right\"): {\n marginLeft?: string;\n marginRight?: string;\n} {\n if (value === \"left\") return { marginLeft: \"0\", marginRight: \"auto\" };\n if (value === \"right\") return { marginLeft: \"auto\", marginRight: \"0\" };\n return { marginLeft: \"auto\", marginRight: \"auto\" };\n}\n\n/**\n * Merges a record of computed layout declarations with a user-supplied style\n * value. The user's declarations take precedence for conflicting keys.\n */\nexport function mergeLayoutStyles(\n layout: Record<string, string | number>,\n user: unknown,\n): string | undefined {\n const merged: Record<string, unknown> = { ...layout };\n\n if (user !== null && user !== undefined && typeof user === \"object\") {\n Object.assign(merged, user as Record<string, unknown>);\n }\n\n const mergedString = serializeCssDeclarations(merged);\n\n if (typeof user === \"string\" && user.trim()) {\n return mergedString ? `${mergedString};${user.trim()}` : user.trim();\n }\n\n return mergedString || undefined;\n}\n"],"mappings":";;AASA,MAAM,cAA2C;CAAC;CAAW;CAAM;CAAM;CAAM;AAAI;;AAGnF,MAAM,cACJ;AAEF,MAAM,kBAA0C;CAC9C,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,OAAO;CACP,OAAO;AACT;AAEA,MAAM,qBAA6C;CACjD,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,OAAO;AACT;;;;;AAaA,SAAgB,YAAY,OAAiC;CAC3D,IAAI,OAAO,UAAU,UAAU,OAAO;CACtC,MAAM,IAAI,MAAM,KAAK;CACrB,IAAI,MAAM,KAAK,OAAO;CACtB,IAAI,YAAY,KAAK,CAAC,GAAG,OAAO;CAEhC,IAAI,kBAAkB,KAAK,CAAC,GAAG,OAAO;CACtC,OAAO;AACT;AAEA,SAAgB,kBACd,OAC+C;CAC/C,IAAI,CAAC,SAAS,OAAO,UAAU,YAAY,MAAM,QAAQ,KAAK,GAAG,OAAO;CACxE,OAAO,YAAY,MAAM,eAAe,cAAc,KAAK;AAC7D;AAEA,SAAgB,yBACd,OACkD;CAClD,IAAI,UAAU,KAAA,GAAW,OAAO,KAAA;CAChC,IAAI,kBAAkB,KAAK,GAAG,OAAO;CACrC,OAAO,EAAE,SAAS,MAAM;AAC1B;AAEA,SAAgB,yBACd,OACoB;CACpB,MAAM,aAAa,yBAAyB,KAAK;CACjD,IAAI,CAAC,YAAY,OAAO,KAAA;CAExB,OAAO,YAAY,KAAK,eAAe;EACrC,MAAM,kBAAkB,WAAW;EACnC,IAAI,oBAAoB,KAAA,GAAW,OAAO;EAC1C,OAAO,GAAG,WAAW,GAAG,OAAO,eAAe;CAChD,CAAC,CAAC,CACC,OAAO,OAAO,CAAC,CACf,KAAK,GAAG;AACb;AAEA,SAAgB,2BACd,OACA,WACoB;CACpB,MAAM,aAAa,yBAAyB,KAAK;CACjD,IAAI,CAAC,YAAY,OAAO,KAAA;CAExB,KAAK,MAAM,cAAc,aAAa;EACpC,MAAM,kBAAkB,WAAW;EACnC,IAAI,oBAAoB,KAAA,GAAW;EACnC,IAAI,CAAC,UAAU,eAAe,GAAG,OAAO,KAAA;CAC1C;CAEA,OAAO,yBAAyB,KAAK;AACvC;AAUA,SAAgB,sBACd,QACA,UACA,OACA,WAAsD,UACpD,OACF;CACA,MAAM,aAAa,yBAAyB,KAAK;CACjD,IAAI,CAAC,YAAY;CAEjB,KAAK,MAAM,cAAc,aAAa;EACpC,MAAM,kBAAkB,WAAW;EACnC,IAAI,oBAAoB,KAAA,GAAW;EACnC,MAAM,WAAW,QAAQ,eAAe;EACxC,IAAI,aAAa,KAAA,KAAa,aAAa,QAAQ,aAAa,IAAI;EACpE,OAAO,QAAQ,SAAS,GAAG,gBAAgB;CAC7C;AACF;AAEA,SAAgB,kBAAkB,OAAyC;CACzE,IAAI,OAAO,UAAU,UAAU,OAAO,OAAO,KAAK;CAClD,MAAM,UAAU,MAAM,KAAK;CAC3B,OAAO,gBAAgB,YAAY;AACrC;AAEA,SAAgB,0BAA0B,OAAuB;CAC/D,MAAM,UAAU,MAAM,KAAK;CAC3B,OAAO,mBAAmB,YAAY;AACxC;AAOA,SAAgB,oBAAoB,OAAuB;CACzD,MAAM,UAAU,MAAM,KAAK;CAC3B,IAAI,YAAY,WAAW,OAAO;CAClC,IAAI,YAAY,SAAS,OAAO;CAChC,IAAI,YAAY,OAAO,OAAO;CAC9B,OAAO;AACT;AAEA,SAAgB,kBAAkB,OAAuB;CACvD,MAAM,UAAU,MAAM,KAAK;CAC3B,IAAI,YAAY,SAAS,OAAO;CAChC,IAAI,YAAY,OAAO,OAAO;CAC9B,OAAO;AACT;AAEA,SAAgB,wBAAwB,OAGtC;CACA,IAAI,UAAU,QAAQ,OAAO;EAAE,YAAY;EAAK,aAAa;CAAO;CACpE,IAAI,UAAU,SAAS,OAAO;EAAE,YAAY;EAAQ,aAAa;CAAI;CACrE,OAAO;EAAE,YAAY;EAAQ,aAAa;CAAO;AACnD;;;;;AAMA,SAAgB,kBACd,QACA,MACoB;CACpB,MAAM,SAAkC,EAAE,GAAG,OAAO;CAEpD,IAAI,SAAS,QAAQ,SAAS,KAAA,KAAa,OAAO,SAAS,UACzD,OAAO,OAAO,QAAQ,IAA+B;CAGvD,MAAM,eAAe,yBAAyB,MAAM;CAEpD,IAAI,OAAO,SAAS,YAAY,KAAK,KAAK,GACxC,OAAO,eAAe,GAAG,aAAa,GAAG,KAAK,KAAK,MAAM,KAAK,KAAK;CAGrE,OAAO,gBAAgB,KAAA;AACzB"}
|