@jonmilner/ui 0.12.0 → 0.13.0
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/dist/Avatar/Avatar.css +1 -1
- package/dist/Badge/Badge.css +1 -1
- package/dist/Box/Box.css +1 -1
- package/dist/Button/Button.css +1 -1
- package/dist/Checkbox/Checkbox.css +1 -1
- package/dist/Chip/Chip.css +1 -1
- package/dist/Clickable/Clickable.css +1 -1
- package/dist/ColorField/ColorField.css +1 -1
- package/dist/Combobox/Combobox.css +1 -1
- package/dist/Dialog/Dialog.css +1 -1
- package/dist/Field/Field.css +1 -1
- package/dist/Heading/Heading.css +1 -1
- package/dist/Icon/Icon.css +1 -1
- package/dist/IconButton/IconButton.css +1 -1
- package/dist/Inline/Inline.css +1 -1
- package/dist/Menu/Menu.css +1 -1
- package/dist/MultiSelect/MultiSelect.css +1 -1
- package/dist/NavList/NavList.css +2 -0
- package/dist/NavList/NavList.css.mjs +7 -0
- package/dist/NavList/index.d.mts +38 -0
- package/dist/NavList/index.mjs +104 -0
- package/dist/RadioGroup/RadioGroup.css +1 -1
- package/dist/SearchField/SearchField.css +1 -1
- package/dist/Select/Select.css +1 -1
- package/dist/Sidebar/Sidebar.css +2 -0
- package/dist/Sidebar/Sidebar.css.mjs +9 -0
- package/dist/Sidebar/index.d.mts +20 -0
- package/dist/Sidebar/index.mjs +56 -0
- package/dist/SidebarLayout/SidebarLayout.css +2 -0
- package/dist/SidebarLayout/SidebarLayout.css.mjs +9 -0
- package/dist/SidebarLayout/index.d.mts +14 -0
- package/dist/SidebarLayout/index.mjs +34 -0
- package/dist/Stack/Stack.css +1 -1
- package/dist/Switch/Switch.css +1 -1
- package/dist/Table/Table.css +1 -1
- package/dist/Tabs/Tabs.css +1 -1
- package/dist/Tag/Tag.css +1 -1
- package/dist/Text/Text.css +1 -1
- package/dist/TextField/TextField.css +1 -1
- package/dist/Textarea/Textarea.css +1 -1
- package/dist/Toast/Toast.css +1 -1
- package/dist/Tooltip/Tooltip.css +1 -1
- package/dist/VisuallyHidden/VisuallyHidden.css +1 -1
- package/dist/base.css +3 -3
- package/dist/brands/default.mjs +2 -0
- package/dist/brands/forced-colors.mjs +1 -0
- package/dist/contrast/contrast.mjs +2 -1
- package/dist/contrast/mixes.mjs +1 -1
- package/dist/docs/Box.md +1 -1
- package/dist/docs/Icon.md +3 -1
- package/dist/docs/Inline.md +1 -0
- package/dist/docs/Menu.md +1 -1
- package/dist/docs/NavList.md +138 -0
- package/dist/docs/Sidebar.md +104 -0
- package/dist/docs/SidebarLayout.md +123 -0
- package/dist/docs/Stack.md +1 -0
- package/dist/docs/Tabs.md +1 -1
- package/dist/docs/llms.txt +3 -0
- package/dist/docs/manifest.json +182 -7
- package/dist/docs/migrations/0.13.0.md +40 -0
- package/dist/icons/PanelLeftCloseIcon.d.mts +2 -0
- package/dist/icons/PanelLeftCloseIcon.mjs +16 -0
- package/dist/icons/PanelLeftOpenIcon.d.mts +2 -0
- package/dist/icons/PanelLeftOpenIcon.mjs +16 -0
- package/dist/icons/index.d.mts +4 -2
- package/dist/icons/index.mjs +28 -26
- package/dist/index.d.mts +4 -1
- package/dist/index.mjs +20 -17
- package/dist/styles/atoms.css +2 -2
- package/dist/styles/atoms.css.d.mts +17 -17
- package/dist/styles/atoms.css.mjs +1232 -1170
- package/dist/styles/layers.css +1 -1
- package/dist/styles/responsive.css +2 -2
- package/dist/tokens/contract.d.mts +3 -1
- package/dist/tokens/roles.d.mts +1 -1
- package/dist/tokens/roles.mjs +1 -1
- package/dist/tokens/scales.d.mts +2 -0
- package/dist/tokens/scales.mjs +2 -0
- package/package.json +13 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.combobox, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.visually-hidden, components.table;
|
|
1
|
+
@layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.sidebar, components.sidebar-layout, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.combobox, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.nav-list, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.visually-hidden, components.table;
|
|
2
2
|
@layer components.text-field{._20at410{clip-path:inset(50%);white-space:nowrap;border:0;block-size:1px;inline-size:1px;margin:0;padding:0;position:absolute;overflow:hidden}._20at411{appearance:none;border-width:var(--space-1);border-style:solid;border-color:var(--color-border-strong);border-radius:var(--radius-med);background-color:var(--color-bg);inline-size:100%;min-inline-size:0;color:var(--color-fg);padding-block:0}._20at411::placeholder{color:var(--color-fg-muted);opacity:1}._20at411:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:var(--space-2)}._20at411:disabled{background-color:var(--color-bg-muted);color:var(--color-fg-muted);cursor:not-allowed;border-style:dashed}._20at411[aria-invalid=true]{border-color:var(--color-danger)}._20at412{block-size:var(--size-xs);padding-inline:var(--space-6)}._20at413{block-size:var(--size-sm);padding-inline:var(--space-8)}._20at414{block-size:var(--size-med);padding-inline:var(--space-12)}@media (pointer:coarse){._20at411{font-size:var(--font-size-med)}}@media (forced-colors:active){._20at411:disabled{color:graytext;border-color:graytext}}}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.combobox, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.visually-hidden, components.table;
|
|
1
|
+
@layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.sidebar, components.sidebar-layout, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.combobox, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.nav-list, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.visually-hidden, components.table;
|
|
2
2
|
@layer components.textarea{._1kwv2lp0{clip-path:inset(50%);white-space:nowrap;border:0;block-size:1px;inline-size:1px;margin:0;padding:0;position:absolute;overflow:hidden}._1kwv2lp1{appearance:none;border-width:var(--space-1);border-style:solid;border-color:var(--color-border-strong);border-radius:var(--radius-med);background-color:var(--color-bg);inline-size:100%;min-inline-size:0;color:var(--color-fg);resize:block;padding-block:0}._1kwv2lp1::placeholder{color:var(--color-fg-muted);opacity:1}._1kwv2lp1:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:var(--space-2)}._1kwv2lp1:disabled{background-color:var(--color-bg-muted);color:var(--color-fg-muted);cursor:not-allowed;resize:none;border-style:dashed}._1kwv2lp1[aria-invalid=true]{border-color:var(--color-danger)}._1kwv2lp2{min-block-size:var(--size-xs);padding-block:calc((var(--size-xs) - 2 * var(--space-1) - var(--font-size-xs) * var(--line-height-med)) / 2);padding-inline:var(--space-6)}._1kwv2lp3{min-block-size:var(--size-sm);padding-block:calc((var(--size-sm) - 2 * var(--space-1) - var(--font-size-sm) * var(--line-height-med)) / 2);padding-inline:var(--space-8)}._1kwv2lp4{min-block-size:var(--size-med);padding-block:calc((var(--size-med) - 2 * var(--space-1) - var(--font-size-med) * var(--line-height-med)) / 2);padding-inline:var(--space-12)}@media (pointer:coarse){._1kwv2lp1{font-size:var(--font-size-med)}._1kwv2lp2{min-block-size:max(var(--size-xs), calc(2 * var(--space-1) + var(--font-size-med) * var(--line-height-med)));padding-block:max(var(--space-0), calc((var(--size-xs) - 2 * var(--space-1) - var(--font-size-med) * var(--line-height-med)) / 2))}._1kwv2lp3{min-block-size:max(var(--size-sm), calc(2 * var(--space-1) + var(--font-size-med) * var(--line-height-med)));padding-block:max(var(--space-0), calc((var(--size-sm) - 2 * var(--space-1) - var(--font-size-med) * var(--line-height-med)) / 2))}._1kwv2lp4{min-block-size:max(var(--size-med), calc(2 * var(--space-1) + var(--font-size-med) * var(--line-height-med)));padding-block:max(var(--space-0), calc((var(--size-med) - 2 * var(--space-1) - var(--font-size-med) * var(--line-height-med)) / 2))}}@media (forced-colors:active){._1kwv2lp1:disabled{color:graytext;border-color:graytext}}}
|
package/dist/Toast/Toast.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.combobox, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.visually-hidden, components.table;
|
|
1
|
+
@layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.sidebar, components.sidebar-layout, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.combobox, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.nav-list, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.visually-hidden, components.table;
|
|
2
2
|
@layer components.toast{.hcnvsc1{inline-size:min(100% - 2 * var(--space-16), 6 * var(--space-64));inset-block-end:var(--space-16);inset-inline-end:var(--space-16);container:hcnvsc0/inline-size}.hcnvsc1:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:var(--space-2)}.hcnvsc2{gap:var(--space-8);margin:calc(-1 * var(--space-16));padding:var(--space-16);overscroll-behavior:contain;flex-direction:column;max-block-size:100dvh;margin-inline-start:calc(-1 * var(--space-24));padding-inline-start:var(--space-24);display:flex;overflow:hidden auto}.hcnvsc2:empty{padding:0}.hcnvsc2:has([data-swiping],[data-swipe-direction=down]){overflow-y:hidden}.hcnvsc3{border:var(--space-1) solid var(--color-border);transform:translate(var(--toast-swipe-movement-x,0), var(--toast-swipe-movement-y,0));transition:opacity var(--duration-med) var(--easing-standard), translate var(--duration-med) var(--easing-enter), transform var(--duration-med) var(--easing-enter)}.hcnvsc3:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:var(--space-2)}.hcnvsc3[data-starting-style],.hcnvsc3[data-ending-style]{opacity:0;translate:0 var(--distance-med)}.hcnvsc3[data-swiping]{transition:none}.hcnvsc3[data-limited]{display:none}.hcnvsc4{overflow-wrap:anywhere}.hcnvsca{clip-path:inset(50%);white-space:nowrap;border:0;block-size:1px;inline-size:1px;margin:0;padding:0;position:absolute;inset-block-start:0;inset-inline-start:0;overflow:hidden}@container hcnvsc0 (inline-size<16rem){.hcnvsc3{flex-wrap:wrap}.hcnvsc4{flex-basis:100%;order:1}.hcnvsc5{margin-inline-start:auto}}}
|
package/dist/Tooltip/Tooltip.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.combobox, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.visually-hidden, components.table;
|
|
1
|
+
@layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.sidebar, components.sidebar-layout, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.combobox, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.nav-list, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.visually-hidden, components.table;
|
|
2
2
|
@layer components.tooltip{.ivrt881{border:var(--space-1) solid var(--color-border);max-inline-size:var(--available-width);transform-origin:var(--transform-origin);transition:opacity var(--duration-fast) var(--easing-standard), scale var(--duration-fast) var(--easing-enter)}.ivrt881[data-starting-style],.ivrt881[data-ending-style]{opacity:0;scale:calc(1 - var(--scale-med))}.ivrt881[data-instant]{transition:none}}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.combobox, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.visually-hidden, components.table;
|
|
1
|
+
@layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.sidebar, components.sidebar-layout, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.combobox, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.nav-list, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.visually-hidden, components.table;
|
|
2
2
|
@layer components.visually-hidden{._1qk18b30{clip-path:inset(50%);white-space:nowrap;border:0;block-size:1px;inline-size:1px;margin:0;padding:0;position:absolute;overflow:hidden}}
|
package/dist/base.css
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
@layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.combobox, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.visually-hidden, components.table;
|
|
2
|
-
@layer tokens{:root{--space-0:0rem;--space-1:.0625rem;--space-2:.125rem;--space-4:.25rem;--space-6:.375rem;--space-8:.5rem;--space-12:.75rem;--space-16:1rem;--space-20:1.25rem;--space-24:1.5rem;--space-32:2rem;--space-40:2.5rem;--space-48:3rem;--space-64:4rem;--space-80:5rem;--space-96:6rem;--size-xs:1.5rem;--size-sm:2rem;--size-med:2.5rem;--size-lg:3rem;--size-xl:3.5rem;--container-prose:40rem;--container-page:64rem;--container-wide:80rem;--radius-none:0;--radius-sm:.25rem;--radius-med:.5rem;--radius-lg:.75rem;--radius-xl:1rem;--radius-full:9999px;--font-size-xs:.75rem;--font-size-sm:.875rem;--font-size-med:1rem;--font-size-lg:1.125rem;--font-size-xl:1.25rem;--font-size-2xl:1.5rem;--font-size-3xl:1.875rem;--font-size-4xl:2.25rem;--font-weight-regular:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--line-height-sm:1.25;--line-height-med:1.5;--line-height-lg:1.75;--z-index-base:0;--z-index-raised:1;--z-index-dropdown:1000;--z-index-sticky:1100;--z-index-overlay:1200;--z-index-modal:1300;--z-index-popover:1400;--z-index-toast:1500;--z-index-tooltip:1600;--duration-fast:.12s;--duration-med:.2s;--duration-slow:.32s;--easing-standard:cubic-bezier(.2, 0, 0, 1);--easing-enter:cubic-bezier(0, 0, 0, 1);--easing-exit:cubic-bezier(.3, 0, 1, 1);--distance-sm:.25rem;--distance-med:.5rem;--distance-lg:1rem;--scale-sm:.02;--scale-med:.05;--scale-lg:.1}[data-brand]{--shadow-sm:0 1px 2px color-mix(in srgb, var(--color-shadow) 12%, transparent);--shadow-med:0 2px 8px color-mix(in srgb, var(--color-shadow) 14%, transparent), 0 1px 2px color-mix(in srgb, var(--color-shadow) 8%, transparent);--shadow-lg:0 8px 24px color-mix(in srgb, var(--color-shadow) 16%, transparent), 0 2px 6px color-mix(in srgb, var(--color-shadow) 8%, transparent)}[data-brand][data-mode=light]{color-scheme:light}[data-brand][data-mode=dark]{--shadow-sm:0 0 0 1px color-mix(in srgb, var(--color-fg) 10%, transparent), 0 1px 2px color-mix(in srgb, var(--color-shadow) 40%, transparent);--shadow-med:0 0 0 1px color-mix(in srgb, var(--color-fg) 10%, transparent), 0 2px 8px color-mix(in srgb, var(--color-shadow) 48%, transparent), 0 1px 2px color-mix(in srgb, var(--color-shadow) 32%, transparent);--shadow-lg:0 0 0 1px color-mix(in srgb, var(--color-fg) 10%, transparent), 0 8px 24px color-mix(in srgb, var(--color-shadow) 56%, transparent), 0 2px 6px color-mix(in srgb, var(--color-shadow) 32%, transparent);color-scheme:dark}[data-brand][data-mode=system]{color-scheme:light dark}:dir(ltr){--dir:1}:dir(rtl){--dir:-1}@media (prefers-color-scheme:dark){[data-brand][data-mode=system]{--shadow-sm:0 0 0 1px color-mix(in srgb, var(--color-fg) 10%, transparent), 0 1px 2px color-mix(in srgb, var(--color-shadow) 40%, transparent);--shadow-med:0 0 0 1px color-mix(in srgb, var(--color-fg) 10%, transparent), 0 2px 8px color-mix(in srgb, var(--color-shadow) 48%, transparent), 0 1px 2px color-mix(in srgb, var(--color-shadow) 32%, transparent);--shadow-lg:0 0 0 1px color-mix(in srgb, var(--color-fg) 10%, transparent), 0 8px 24px color-mix(in srgb, var(--color-shadow) 56%, transparent), 0 2px 6px color-mix(in srgb, var(--color-shadow) 32%, transparent)}}@media (prefers-reduced-motion:reduce){:root{--distance-sm:0rem;--distance-med:0rem;--distance-lg:0rem;--scale-sm:0;--scale-med:0;--scale-lg:0;--duration-fast:.12s;--duration-med:.12s;--duration-slow:.12s}}}
|
|
1
|
+
@layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.sidebar, components.sidebar-layout, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.combobox, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.nav-list, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.visually-hidden, components.table;
|
|
2
|
+
@layer tokens{:root{--space-0:0rem;--space-1:.0625rem;--space-2:.125rem;--space-4:.25rem;--space-6:.375rem;--space-8:.5rem;--space-12:.75rem;--space-16:1rem;--space-20:1.25rem;--space-24:1.5rem;--space-32:2rem;--space-40:2.5rem;--space-48:3rem;--space-64:4rem;--space-80:5rem;--space-96:6rem;--size-xs:1.5rem;--size-sm:2rem;--size-med:2.5rem;--size-lg:3rem;--size-xl:3.5rem;--container-sidebar:15rem;--container-rail:3.5rem;--container-prose:40rem;--container-page:64rem;--container-wide:80rem;--radius-none:0;--radius-sm:.25rem;--radius-med:.5rem;--radius-lg:.75rem;--radius-xl:1rem;--radius-full:9999px;--font-size-xs:.75rem;--font-size-sm:.875rem;--font-size-med:1rem;--font-size-lg:1.125rem;--font-size-xl:1.25rem;--font-size-2xl:1.5rem;--font-size-3xl:1.875rem;--font-size-4xl:2.25rem;--font-weight-regular:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--line-height-sm:1.25;--line-height-med:1.5;--line-height-lg:1.75;--z-index-base:0;--z-index-raised:1;--z-index-dropdown:1000;--z-index-sticky:1100;--z-index-overlay:1200;--z-index-modal:1300;--z-index-popover:1400;--z-index-toast:1500;--z-index-tooltip:1600;--duration-fast:.12s;--duration-med:.2s;--duration-slow:.32s;--easing-standard:cubic-bezier(.2, 0, 0, 1);--easing-enter:cubic-bezier(0, 0, 0, 1);--easing-exit:cubic-bezier(.3, 0, 1, 1);--distance-sm:.25rem;--distance-med:.5rem;--distance-lg:1rem;--scale-sm:.02;--scale-med:.05;--scale-lg:.1}[data-brand]{--shadow-sm:0 1px 2px color-mix(in srgb, var(--color-shadow) 12%, transparent);--shadow-med:0 2px 8px color-mix(in srgb, var(--color-shadow) 14%, transparent), 0 1px 2px color-mix(in srgb, var(--color-shadow) 8%, transparent);--shadow-lg:0 8px 24px color-mix(in srgb, var(--color-shadow) 16%, transparent), 0 2px 6px color-mix(in srgb, var(--color-shadow) 8%, transparent)}[data-brand][data-mode=light]{color-scheme:light}[data-brand][data-mode=dark]{--shadow-sm:0 0 0 1px color-mix(in srgb, var(--color-fg) 10%, transparent), 0 1px 2px color-mix(in srgb, var(--color-shadow) 40%, transparent);--shadow-med:0 0 0 1px color-mix(in srgb, var(--color-fg) 10%, transparent), 0 2px 8px color-mix(in srgb, var(--color-shadow) 48%, transparent), 0 1px 2px color-mix(in srgb, var(--color-shadow) 32%, transparent);--shadow-lg:0 0 0 1px color-mix(in srgb, var(--color-fg) 10%, transparent), 0 8px 24px color-mix(in srgb, var(--color-shadow) 56%, transparent), 0 2px 6px color-mix(in srgb, var(--color-shadow) 32%, transparent);color-scheme:dark}[data-brand][data-mode=system]{color-scheme:light dark}:dir(ltr){--dir:1}:dir(rtl){--dir:-1}@media (prefers-color-scheme:dark){[data-brand][data-mode=system]{--shadow-sm:0 0 0 1px color-mix(in srgb, var(--color-fg) 10%, transparent), 0 1px 2px color-mix(in srgb, var(--color-shadow) 40%, transparent);--shadow-med:0 0 0 1px color-mix(in srgb, var(--color-fg) 10%, transparent), 0 2px 8px color-mix(in srgb, var(--color-shadow) 48%, transparent), 0 1px 2px color-mix(in srgb, var(--color-shadow) 32%, transparent);--shadow-lg:0 0 0 1px color-mix(in srgb, var(--color-fg) 10%, transparent), 0 8px 24px color-mix(in srgb, var(--color-shadow) 56%, transparent), 0 2px 6px color-mix(in srgb, var(--color-shadow) 32%, transparent)}}@media (prefers-reduced-motion:reduce){:root{--distance-sm:0rem;--distance-med:0rem;--distance-lg:0rem;--scale-sm:0;--scale-med:0;--scale-lg:0;--duration-fast:.12s;--duration-med:.12s;--duration-slow:.12s}}}
|
|
3
3
|
|
|
4
|
-
@font-face{src:local(Arial),local(ArialMT);font-weight:400;font-style:normal;size-adjust:101.568%;ascent-override:95.3892%;descent-override:23.7511%;line-gap-override:0%;font-family:Inter Fallback Arial}@font-face{src:local(Arial Bold),local(Arial-BoldMT);font-weight:700;font-style:normal;size-adjust:101.637%;ascent-override:95.3241%;descent-override:23.7349%;line-gap-override:0%;font-family:Inter Fallback Arial}@font-face{src:local(Arial Italic),local(Arial-ItalicMT);font-weight:400;font-style:italic;size-adjust:101.637%;ascent-override:95.3241%;descent-override:23.7349%;line-gap-override:0%;font-family:Inter Fallback Arial}@font-face{src:local(Arial Bold Italic),local(Arial-BoldItalicMT);font-weight:700;font-style:italic;size-adjust:101.706%;ascent-override:95.2591%;descent-override:23.7187%;line-gap-override:0%;font-family:Inter Fallback Arial}@font-face{src:local(Menlo Regular),local(Menlo-Regular);font-weight:400;font-style:normal;size-adjust:100.137%;ascent-override:101.871%;descent-override:29.9621%;line-gap-override:0%;font-family:JetBrains Mono Fallback Menlo}@font-face{src:local(Menlo Bold),local(Menlo-Bold);font-weight:700;font-style:normal;size-adjust:100.003%;ascent-override:102.007%;descent-override:30.0022%;line-gap-override:0%;font-family:JetBrains Mono Fallback Menlo}@font-face{src:local(Menlo Italic),local(Menlo-Italic);font-weight:400;font-style:italic;size-adjust:100.137%;ascent-override:101.871%;descent-override:29.9621%;line-gap-override:0%;font-family:JetBrains Mono Fallback Menlo}@font-face{src:local(Menlo Bold Italic),local(Menlo-BoldItalic);font-weight:700;font-style:italic;size-adjust:100.003%;ascent-override:102.007%;descent-override:30.0022%;line-gap-override:0%;font-family:JetBrains Mono Fallback Menlo}@font-face{src:local(Consolas);font-weight:400;font-style:normal;size-adjust:114.387%;ascent-override:89.1798%;descent-override:26.2293%;line-gap-override:0%;font-family:JetBrains Mono Fallback Consolas}@font-face{src:local(Consolas Bold),local(Consolas-Bold);font-weight:700;font-style:normal;size-adjust:114.387%;ascent-override:89.1798%;descent-override:26.2293%;line-gap-override:0%;font-family:JetBrains Mono Fallback Consolas}@font-face{src:local(Consolas Italic),local(Consolas-Italic);font-weight:400;font-style:italic;size-adjust:114.387%;ascent-override:89.1798%;descent-override:26.2293%;line-gap-override:0%;font-family:JetBrains Mono Fallback Consolas}@font-face{src:local(Consolas Bold Italic),local(Consolas-BoldItalic);font-weight:700;font-style:italic;size-adjust:114.387%;ascent-override:89.1798%;descent-override:26.2293%;line-gap-override:0%;font-family:JetBrains Mono Fallback Consolas}@font-face{src:local(Courier New),local(CourierNewPSMT);font-weight:400;font-style:normal;size-adjust:127.781%;ascent-override:79.8319%;descent-override:23.48%;line-gap-override:0%;font-family:JetBrains Mono Fallback Courier New}@font-face{src:local(Courier New Bold),local(CourierNewPS-BoldMT);font-weight:700;font-style:normal;size-adjust:123.353%;ascent-override:82.6977%;descent-override:24.3229%;line-gap-override:0%;font-family:JetBrains Mono Fallback Courier New}@font-face{src:local(Courier New Italic),local(CourierNewPS-ItalicMT);font-weight:400;font-style:italic;size-adjust:127.781%;ascent-override:79.8319%;descent-override:23.48%;line-gap-override:0%;font-family:JetBrains Mono Fallback Courier New}@font-face{src:local(Courier New Bold Italic),local(CourierNewPS-BoldItalicMT);font-weight:700;font-style:italic;size-adjust:123.353%;ascent-override:82.6977%;descent-override:24.3229%;line-gap-override:0%;font-family:JetBrains Mono Fallback Courier New}@layer tokens{[data-brand=default]{--color-bg:light-dark(oklch(100% 0 0),oklch(14.5% .006 265));--color-bg-muted:light-dark(oklch(96.8% .004 265),oklch(27% .01 265));--color-bg-raised:light-dark(oklch(100% 0 0),oklch(20.5% .008 265));--color-fg:light-dark(oklch(14.5% .006 265),oklch(98.5% .002 265));--color-fg-muted:light-dark(oklch(44.5% .014 265),oklch(71% .012 265));--color-border:light-dark(oklch(92.5% .006 265),oklch(27% .01 265));--color-border-strong:oklch(55.5% .014 265);--color-accent:light-dark(oklch(54.6% .19 258),oklch(70.7% .14 258));--color-accent-fg:light-dark(oklch(100% 0 0),oklch(14.5% .006 265));--color-accent-fill:light-dark(oklch(54.6% .19 258),oklch(48.8% .18 258));--color-accent-fill-fg:oklch(100% 0 0);--color-danger:light-dark(oklch(56% .2 25),oklch(70.4% .17 25));--color-danger-fg:light-dark(oklch(100% 0 0),oklch(14.5% .006 265));--color-success:light-dark(oklch(52% .135 150),oklch(76% .15 150));--color-success-fg:light-dark(oklch(100% 0 0),oklch(14.5% .006 265));--color-warning:light-dark(oklch(53% .11 75),oklch(81% .145 75));--color-warning-fg:light-dark(oklch(100% 0 0),oklch(14.5% .006 265));--color-done:light-dark(oklch(55% .2 295),oklch(72% .15 295));--color-done-fg:light-dark(oklch(100% 0 0),oklch(14.5% .006 265));--color-neutral-subtle:light-dark(oklch(96.8% .004 265),oklch(27% .01 265));--color-neutral-subtle-fg:light-dark(oklch(37% .013 265),oklch(92.5% .006 265));--color-accent-subtle:light-dark(oklch(93.2% .032 258),oklch(28.2% .09 258));--color-accent-subtle-fg:light-dark(oklch(48.8% .18 258),oklch(80.9% .095 258));--color-success-subtle:light-dark(oklch(94.5% .04 150),oklch(26% .06 150));--color-success-subtle-fg:light-dark(oklch(46.5% .12 150),oklch(84% .115 150));--color-warning-subtle:light-dark(oklch(95.5% .03 75),oklch(27% .05 75));--color-warning-subtle-fg:light-dark(oklch(47.5% .1 75),oklch(86% .105 75));--color-danger-subtle:light-dark(oklch(93.6% .032 25),oklch(25.8% .085 25));--color-danger-subtle-fg:light-dark(oklch(50.5% .19 25),oklch(80.8% .105 25));--color-done-subtle:light-dark(oklch(93.8% .032 295),oklch(28% .095 295));--color-done-subtle-fg:light-dark(oklch(49% .19 295),oklch(81.5% .1 295));--color-focus:light-dark(oklch(54.6% .19 258),oklch(70.7% .14 258));--color-shadow:light-dark(oklch(14.5% .006 265),oklch(0% 0 0));--font-body:"Inter", "Inter Fallback Arial", sans-serif;--font-heading:"Inter", "Inter Fallback Arial", sans-serif;--font-display:"Inter", "Inter Fallback Arial", sans-serif;--font-label:"Inter", "Inter Fallback Arial", sans-serif;--font-mono:"JetBrains Mono", "JetBrains Mono Fallback Menlo", "JetBrains Mono Fallback Consolas", "JetBrains Mono Fallback Courier New", monospace;--font-trim-body-cap:.36377;--font-trim-body-baseline:.36377;--font-trim-heading-cap:.36377;--font-trim-heading-baseline:.36377;--font-trim-display-cap:.36377;--font-trim-display-baseline:.36377;--font-trim-label-cap:.36377;--font-trim-label-baseline:.36377;--font-trim-mono-cap:.37;--font-trim-mono-baseline:.36}@media (forced-colors:active){[data-brand][data-brand]{--color-bg:Canvas;--color-bg-muted:Canvas;--color-bg-raised:Canvas;--color-fg:CanvasText;--color-fg-muted:CanvasText;--color-border:CanvasText;--color-border-strong:CanvasText;--color-accent:LinkText;--color-accent-fg:Canvas;--color-accent-fill:LinkText;--color-accent-fill-fg:Canvas;--color-danger:CanvasText;--color-danger-fg:Canvas;--color-success:CanvasText;--color-success-fg:Canvas;--color-warning:CanvasText;--color-warning-fg:Canvas;--color-done:CanvasText;--color-done-fg:Canvas;--color-neutral-subtle:Canvas;--color-neutral-subtle-fg:CanvasText;--color-accent-subtle:Canvas;--color-accent-subtle-fg:CanvasText;--color-success-subtle:Canvas;--color-success-subtle-fg:CanvasText;--color-warning-subtle:Canvas;--color-warning-subtle-fg:CanvasText;--color-danger-subtle:Canvas;--color-danger-subtle-fg:CanvasText;--color-done-subtle:Canvas;--color-done-subtle-fg:CanvasText;--color-focus:Highlight;--color-shadow:CanvasText}}}
|
|
4
|
+
@font-face{src:local(Arial),local(ArialMT);font-weight:400;font-style:normal;size-adjust:101.568%;ascent-override:95.3892%;descent-override:23.7511%;line-gap-override:0%;font-family:Inter Fallback Arial}@font-face{src:local(Arial Bold),local(Arial-BoldMT);font-weight:700;font-style:normal;size-adjust:101.637%;ascent-override:95.3241%;descent-override:23.7349%;line-gap-override:0%;font-family:Inter Fallback Arial}@font-face{src:local(Arial Italic),local(Arial-ItalicMT);font-weight:400;font-style:italic;size-adjust:101.637%;ascent-override:95.3241%;descent-override:23.7349%;line-gap-override:0%;font-family:Inter Fallback Arial}@font-face{src:local(Arial Bold Italic),local(Arial-BoldItalicMT);font-weight:700;font-style:italic;size-adjust:101.706%;ascent-override:95.2591%;descent-override:23.7187%;line-gap-override:0%;font-family:Inter Fallback Arial}@font-face{src:local(Menlo Regular),local(Menlo-Regular);font-weight:400;font-style:normal;size-adjust:100.137%;ascent-override:101.871%;descent-override:29.9621%;line-gap-override:0%;font-family:JetBrains Mono Fallback Menlo}@font-face{src:local(Menlo Bold),local(Menlo-Bold);font-weight:700;font-style:normal;size-adjust:100.003%;ascent-override:102.007%;descent-override:30.0022%;line-gap-override:0%;font-family:JetBrains Mono Fallback Menlo}@font-face{src:local(Menlo Italic),local(Menlo-Italic);font-weight:400;font-style:italic;size-adjust:100.137%;ascent-override:101.871%;descent-override:29.9621%;line-gap-override:0%;font-family:JetBrains Mono Fallback Menlo}@font-face{src:local(Menlo Bold Italic),local(Menlo-BoldItalic);font-weight:700;font-style:italic;size-adjust:100.003%;ascent-override:102.007%;descent-override:30.0022%;line-gap-override:0%;font-family:JetBrains Mono Fallback Menlo}@font-face{src:local(Consolas);font-weight:400;font-style:normal;size-adjust:114.387%;ascent-override:89.1798%;descent-override:26.2293%;line-gap-override:0%;font-family:JetBrains Mono Fallback Consolas}@font-face{src:local(Consolas Bold),local(Consolas-Bold);font-weight:700;font-style:normal;size-adjust:114.387%;ascent-override:89.1798%;descent-override:26.2293%;line-gap-override:0%;font-family:JetBrains Mono Fallback Consolas}@font-face{src:local(Consolas Italic),local(Consolas-Italic);font-weight:400;font-style:italic;size-adjust:114.387%;ascent-override:89.1798%;descent-override:26.2293%;line-gap-override:0%;font-family:JetBrains Mono Fallback Consolas}@font-face{src:local(Consolas Bold Italic),local(Consolas-BoldItalic);font-weight:700;font-style:italic;size-adjust:114.387%;ascent-override:89.1798%;descent-override:26.2293%;line-gap-override:0%;font-family:JetBrains Mono Fallback Consolas}@font-face{src:local(Courier New),local(CourierNewPSMT);font-weight:400;font-style:normal;size-adjust:127.781%;ascent-override:79.8319%;descent-override:23.48%;line-gap-override:0%;font-family:JetBrains Mono Fallback Courier New}@font-face{src:local(Courier New Bold),local(CourierNewPS-BoldMT);font-weight:700;font-style:normal;size-adjust:123.353%;ascent-override:82.6977%;descent-override:24.3229%;line-gap-override:0%;font-family:JetBrains Mono Fallback Courier New}@font-face{src:local(Courier New Italic),local(CourierNewPS-ItalicMT);font-weight:400;font-style:italic;size-adjust:127.781%;ascent-override:79.8319%;descent-override:23.48%;line-gap-override:0%;font-family:JetBrains Mono Fallback Courier New}@font-face{src:local(Courier New Bold Italic),local(CourierNewPS-BoldItalicMT);font-weight:700;font-style:italic;size-adjust:123.353%;ascent-override:82.6977%;descent-override:24.3229%;line-gap-override:0%;font-family:JetBrains Mono Fallback Courier New}@layer tokens{[data-brand=default]{--color-bg:light-dark(oklch(100% 0 0),oklch(14.5% .006 265));--color-bg-muted:light-dark(oklch(96.8% .004 265),oklch(27% .01 265));--color-bg-raised:light-dark(oklch(100% 0 0),oklch(20.5% .008 265));--color-bg-panel:light-dark(oklch(98.5% .002 265),oklch(17.7% .007 265));--color-fg:light-dark(oklch(14.5% .006 265),oklch(98.5% .002 265));--color-fg-muted:light-dark(oklch(44.5% .014 265),oklch(71% .012 265));--color-border:light-dark(oklch(92.5% .006 265),oklch(27% .01 265));--color-border-strong:oklch(55.5% .014 265);--color-accent:light-dark(oklch(54.6% .19 258),oklch(70.7% .14 258));--color-accent-fg:light-dark(oklch(100% 0 0),oklch(14.5% .006 265));--color-accent-fill:light-dark(oklch(54.6% .19 258),oklch(48.8% .18 258));--color-accent-fill-fg:oklch(100% 0 0);--color-danger:light-dark(oklch(56% .2 25),oklch(70.4% .17 25));--color-danger-fg:light-dark(oklch(100% 0 0),oklch(14.5% .006 265));--color-success:light-dark(oklch(52% .135 150),oklch(76% .15 150));--color-success-fg:light-dark(oklch(100% 0 0),oklch(14.5% .006 265));--color-warning:light-dark(oklch(53% .11 75),oklch(81% .145 75));--color-warning-fg:light-dark(oklch(100% 0 0),oklch(14.5% .006 265));--color-done:light-dark(oklch(55% .2 295),oklch(72% .15 295));--color-done-fg:light-dark(oklch(100% 0 0),oklch(14.5% .006 265));--color-neutral-subtle:light-dark(oklch(96.8% .004 265),oklch(27% .01 265));--color-neutral-subtle-fg:light-dark(oklch(37% .013 265),oklch(92.5% .006 265));--color-accent-subtle:light-dark(oklch(93.2% .032 258),oklch(28.2% .09 258));--color-accent-subtle-fg:light-dark(oklch(48.8% .18 258),oklch(80.9% .095 258));--color-success-subtle:light-dark(oklch(94.5% .04 150),oklch(26% .06 150));--color-success-subtle-fg:light-dark(oklch(46.5% .12 150),oklch(84% .115 150));--color-warning-subtle:light-dark(oklch(95.5% .03 75),oklch(27% .05 75));--color-warning-subtle-fg:light-dark(oklch(47.5% .1 75),oklch(86% .105 75));--color-danger-subtle:light-dark(oklch(93.6% .032 25),oklch(25.8% .085 25));--color-danger-subtle-fg:light-dark(oklch(50.5% .19 25),oklch(80.8% .105 25));--color-done-subtle:light-dark(oklch(93.8% .032 295),oklch(28% .095 295));--color-done-subtle-fg:light-dark(oklch(49% .19 295),oklch(81.5% .1 295));--color-focus:light-dark(oklch(54.6% .19 258),oklch(70.7% .14 258));--color-shadow:light-dark(oklch(14.5% .006 265),oklch(0% 0 0));--font-body:"Inter", "Inter Fallback Arial", sans-serif;--font-heading:"Inter", "Inter Fallback Arial", sans-serif;--font-display:"Inter", "Inter Fallback Arial", sans-serif;--font-label:"Inter", "Inter Fallback Arial", sans-serif;--font-mono:"JetBrains Mono", "JetBrains Mono Fallback Menlo", "JetBrains Mono Fallback Consolas", "JetBrains Mono Fallback Courier New", monospace;--font-trim-body-cap:.36377;--font-trim-body-baseline:.36377;--font-trim-heading-cap:.36377;--font-trim-heading-baseline:.36377;--font-trim-display-cap:.36377;--font-trim-display-baseline:.36377;--font-trim-label-cap:.36377;--font-trim-label-baseline:.36377;--font-trim-mono-cap:.37;--font-trim-mono-baseline:.36}@media (forced-colors:active){[data-brand][data-brand]{--color-bg:Canvas;--color-bg-muted:Canvas;--color-bg-raised:Canvas;--color-bg-panel:Canvas;--color-fg:CanvasText;--color-fg-muted:CanvasText;--color-border:CanvasText;--color-border-strong:CanvasText;--color-accent:LinkText;--color-accent-fg:Canvas;--color-accent-fill:LinkText;--color-accent-fill-fg:Canvas;--color-danger:CanvasText;--color-danger-fg:Canvas;--color-success:CanvasText;--color-success-fg:Canvas;--color-warning:CanvasText;--color-warning-fg:Canvas;--color-done:CanvasText;--color-done-fg:Canvas;--color-neutral-subtle:Canvas;--color-neutral-subtle-fg:CanvasText;--color-accent-subtle:Canvas;--color-accent-subtle-fg:CanvasText;--color-success-subtle:Canvas;--color-success-subtle-fg:CanvasText;--color-warning-subtle:Canvas;--color-warning-subtle-fg:CanvasText;--color-danger-subtle:Canvas;--color-danger-subtle-fg:CanvasText;--color-done-subtle:Canvas;--color-done-subtle-fg:CanvasText;--color-focus:Highlight;--color-shadow:CanvasText}}}
|
|
5
5
|
|
|
6
6
|
@layer reset{*,:before,:after{box-sizing:border-box}*{margin:0}html{-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;min-block-size:100dvb;line-height:1.5}img,picture,video,canvas,svg{max-inline-size:100%;display:block}input,button,textarea,select{font:inherit;color:inherit}p,h1,h2,h3,h4,h5,h6{overflow-wrap:break-word}h1,h2,h3,h4,h5,h6{text-wrap:balance}}
|
package/dist/brands/default.mjs
CHANGED
|
@@ -12,6 +12,7 @@ var s = (e, t) => Object.fromEntries(Object.entries(t).map(([t, [n, r]]) => [t,
|
|
|
12
12
|
700: [.37, .013],
|
|
13
13
|
800: [.27, .01],
|
|
14
14
|
900: [.205, .008],
|
|
15
|
+
925: [.177, .007],
|
|
15
16
|
950: [.145, .006]
|
|
16
17
|
}), d = s(258, {
|
|
17
18
|
50: [.97, .014],
|
|
@@ -91,6 +92,7 @@ var s = (e, t) => Object.fromEntries(Object.entries(t).map(([t, [n, r]]) => [t,
|
|
|
91
92
|
bg: e(c, u[950]),
|
|
92
93
|
bgMuted: e(u[100], u[800]),
|
|
93
94
|
bgRaised: e(c, u[900]),
|
|
95
|
+
bgPanel: e(u[50], u[925]),
|
|
94
96
|
fg: e(u[950], u[50]),
|
|
95
97
|
fgMuted: e(u[600], u[400]),
|
|
96
98
|
border: e(u[200], u[800]),
|
package/dist/contrast/mixes.mjs
CHANGED
package/dist/docs/Box.md
CHANGED
|
@@ -21,7 +21,7 @@ The base element every component builds on: one element, chosen with `as`, style
|
|
|
21
21
|
|
|
22
22
|
- Style props take token keys only. Spacing keys are px values (`"16"`); the middle step is `med`, never `md`.
|
|
23
23
|
- Properties are logical: `paddingInline`, `marginBlockStart`, `inlineSize`. There is no `paddingLeft` or `width`.
|
|
24
|
-
- Sizing keys `xs`, `sm`, `med`, `lg` and `xl` are control heights, 24 to 56px: `maxInlineSize="lg"` is 48px wide. For a page or panel width use a container width, on `inlineSize`, `minInlineSize` and `maxInlineSize` only: `prose` (40rem, a reading column), `page` (64rem) or `wide` (80rem). `full`, `fit`, `min`, `max` and `auto` work on every sizing prop.
|
|
24
|
+
- Sizing keys `xs`, `sm`, `med`, `lg` and `xl` are control heights, 24 to 56px: `maxInlineSize="lg"` is 48px wide. For a page or panel width use a container width, on `inlineSize`, `minInlineSize` and `maxInlineSize` only: `sidebar` (15rem, a sidebar column), `prose` (40rem, a reading column), `page` (64rem) or `wide` (80rem). `full`, `fit`, `min`, `max` and `auto` work on every sizing prop.
|
|
25
25
|
- Only layout props are responsive: `{ base: "none", med: "flex" }` with breakpoints `sm`, `med`, `lg`, `xl`. Color and the rest take one value.
|
|
26
26
|
- The style-prop CSS ships in two files (decision 0111). Every component brings the base rules. The `sm`, `med`, `lg` and `xl` rules are `@jonmilner/ui/responsive.css`, which only Box, Stack and Inline import, so a Button alone ships none of them, whether imported from `@jonmilner/ui/Button` or from `@jonmilner/ui`.
|
|
27
27
|
- A responsive value on any other component (`<Button marginBlock={{ base: "8", med: "16" }}>`) keeps only its `base` value unless `responsive.css` is on the page. A Box, Stack or Inline on the page brings it, but one on another route only does if that route loaded first. So an app that sets one imports it once, as a JS import, in its root module beside `base.css`.
|
package/dist/docs/Icon.md
CHANGED
|
@@ -92,6 +92,8 @@ Generated from `src/icons/svg/` and exported from `@jonmilner/ui/icons`; each ta
|
|
|
92
92
|
- `InfoIcon` (`info.svg`)
|
|
93
93
|
- `LoaderCircleIcon` (`loader-circle.svg`)
|
|
94
94
|
- `LockOpenIcon` (`lock-open.svg`)
|
|
95
|
+
- `PanelLeftCloseIcon` (`panel-left-close.svg`)
|
|
96
|
+
- `PanelLeftOpenIcon` (`panel-left-open.svg`)
|
|
95
97
|
- `PencilIcon` (`pencil.svg`)
|
|
96
98
|
- `PlayIcon` (`play.svg`)
|
|
97
99
|
- `PlusIcon` (`plus.svg`)
|
|
@@ -119,7 +121,7 @@ Generated from the TypeScript types.
|
|
|
119
121
|
|
|
120
122
|
| Prop | Type | Required | Description |
|
|
121
123
|
| --- | --- | --- | --- |
|
|
122
|
-
| `color` | `"accent" \| "accentFg" \| "accentFillFg" \| "accentSubtleFg" \| "bg" \| "bgMuted" \| "bgRaised" \| "border" \| "borderStrong" \| "danger" \| "dangerFg" \| "dangerSubtleFg" \| "done" \| "doneFg" \| "doneSubtleFg" \| "fg" \| "fgMuted" \| "focus" \| "neutralSubtleFg" \| "success" \| "successFg" \| "successSubtleFg" \| "warning" \| "warningFg" \| "warningSubtleFg"` | no | |
|
|
124
|
+
| `color` | `"accent" \| "accentFg" \| "accentFillFg" \| "accentSubtleFg" \| "bg" \| "bgMuted" \| "bgPanel" \| "bgRaised" \| "border" \| "borderStrong" \| "danger" \| "dangerFg" \| "dangerSubtleFg" \| "done" \| "doneFg" \| "doneSubtleFg" \| "fg" \| "fgMuted" \| "focus" \| "neutralSubtleFg" \| "success" \| "successFg" \| "successSubtleFg" \| "warning" \| "warningFg" \| "warningSubtleFg"` | no | |
|
|
123
125
|
| `label` | `string` | no | |
|
|
124
126
|
| `size` | `"2xl" \| "3xl" \| "4xl" \| "lg" \| "med" \| "sm" \| "xl" \| "xs"` | no | |
|
|
125
127
|
| `strokeWidth` | `number` | no | |
|
package/dist/docs/Inline.md
CHANGED
|
@@ -15,6 +15,7 @@ A horizontal row of children that wraps onto new lines, with even space between
|
|
|
15
15
|
- A vertical column: use `Stack`.
|
|
16
16
|
- A row that must never wrap and splits space between ends (a toolbar, a header bar): use `Box` with `display="flex"` and `justifyContent="space-between"`, or pass `flexWrap="nowrap"`.
|
|
17
17
|
- A two-dimensional layout: use `Box` with `display="grid"`.
|
|
18
|
+
- A sidebar beside a page's main content: use `SidebarLayout`, which keeps the sidebar's width and stacks it when its container is narrow.
|
|
18
19
|
|
|
19
20
|
## Rules
|
|
20
21
|
|
package/dist/docs/Menu.md
CHANGED
|
@@ -13,7 +13,7 @@ A list of actions that opens from a button: a row's "Edit, Duplicate, Delete", a
|
|
|
13
13
|
## When not to use
|
|
14
14
|
|
|
15
15
|
- Picking a value for a form field: use `Select` for one value from a long list, `RadioGroup` for one of a few (all shown) and `MultiSelect` for several.
|
|
16
|
-
- Navigation between pages: a menu that is only links is still navigation, so show the links on the page or in a
|
|
16
|
+
- Navigation between pages: a menu that is only links is still navigation, so show the links on the page or in a `NavList`. Link items are for a menu that mixes actions and links.
|
|
17
17
|
- One or two actions: show them as buttons.
|
|
18
18
|
- Content a user reads, or anything interactive inside the list (fields, toggles): use a popover or a dialog.
|
|
19
19
|
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# NavList
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
A column of links to an app's pages, with the current page marked: a sidebar's or a settings page's navigation. The parts are `NavList` (a named `nav` around a list), `NavList.Group` (a heading over a run of items) and `NavList.Item` (one link, with an optional leading icon and trailing count). Items are links, not buttons: an `<a>` by default, or a router's `Link` through `as`, which keeps the router's props typed (ADR 0149). The app says which item is current; NavList reads nothing from the URL.
|
|
6
|
+
|
|
7
|
+
## When to use
|
|
8
|
+
|
|
9
|
+
- The pages of an app or a section, listed down a sidebar, with the one you are on marked.
|
|
10
|
+
- A settings page's sections, each its own route.
|
|
11
|
+
- Links with a count beside them (unread messages, open issues), or grouped under short headings.
|
|
12
|
+
|
|
13
|
+
## When not to use
|
|
14
|
+
|
|
15
|
+
- Switching views that share one page and keep the URL: use `Tabs`.
|
|
16
|
+
- Actions or commands, such as Rename or Delete: use `Menu` or `Button`. A NavList item navigates.
|
|
17
|
+
- Links in running text, or one link on its own: use a link (`Clickable as="a"`).
|
|
18
|
+
- A tree of collapsible or nested groups, or a drawer that slides in on a phone: not supported. One level of groups, always open.
|
|
19
|
+
- Working out the current page from the URL: the app's router does that, and passes `current`.
|
|
20
|
+
|
|
21
|
+
## Rules
|
|
22
|
+
|
|
23
|
+
- `NavList` needs a name, and its type requires one: `aria-label` ("Main", "Settings") or `aria-labelledby` when a visible heading names it. A page with two navs tells them apart by these names.
|
|
24
|
+
- Children are `NavList.Item` and `NavList.Group`, in any mix. `NavList.Group` takes `label`, a string: its heading's text, and its list's name. The heading is `h2` by default; set `headingLevel` to fit the page's outline. A group after another item or group gets `16` of room above it, and so does an item after a group.
|
|
25
|
+
- `NavList.Item` is an `<a>` by default: pass `href`. With `as={Link}`, it takes the router's props instead (`to`, `prefetch`) and its type checks them. Every other prop, `ref` and the style props included, lands on the link; the `li` around it is bare. Use the router's plain `Link`, not a `NavLink` that sets `aria-current` itself: NavList draws the current item from `current`, so the two would disagree.
|
|
26
|
+
- `current` marks the link to the page on screen: `aria-current="page"`, an `accentSubtle` fill with `accentSubtleFg` text, a semibold label and an accent bar at the inline-start edge. Set it on one item at most. It is the only way to set `aria-current`: the type omits the raw attribute.
|
|
27
|
+
- `icon` takes an icon component (`icon={InboxIcon}`), drawn at `sm` before the label and hidden from assistive tech: the label names the link.
|
|
28
|
+
- `avatar` takes an avatar in place of the icon, for a row that stands for a person, a team or a repository: `avatar={<Avatar initials="UI" label="" size="sm" />}`. It is hidden from assistive tech like the icon, so give the Avatar an empty `label`. An item takes `icon` or `avatar`, never both; the type rejects the pair.
|
|
29
|
+
- Inside a `Sidebar` rail (`collapsed`), group headings, labels and counts are visually hidden and each item is a 40px square around its icon or avatar, centered. Their text stays in the accessible names. Every item in a rail needs an icon or an avatar.
|
|
30
|
+
- `count` is a trailing subtle `Badge` at `xs`. It is part of the link's accessible name, read after the label, so a bare number says nothing ("Issues 12"). Give it its meaning with `VisuallyHidden`: `count={<>12<VisuallyHidden> open issues</VisuallyHidden></>}`. A nullish or empty count renders nothing.
|
|
31
|
+
- Labels wrap onto a second line in a narrow column, breaking a long word if they must; they never truncate.
|
|
32
|
+
- Items are `sm` text in `fg`, with `6` block and `8` inline padding, a `sm` radius and at least the `xs` (24px) block size, as default style props; the consumer's win. Hover tints a non-current item where hover is real (`(hover: hover)`).
|
|
33
|
+
- No part has hooks, so a server component can render the whole list, router `Link` included.
|
|
34
|
+
|
|
35
|
+
## Do
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
<NavList aria-label="Main">
|
|
39
|
+
<NavList.Item
|
|
40
|
+
count={
|
|
41
|
+
<>
|
|
42
|
+
12<VisuallyHidden> unread</VisuallyHidden>
|
|
43
|
+
</>
|
|
44
|
+
}
|
|
45
|
+
current
|
|
46
|
+
href="/"
|
|
47
|
+
icon={InboxIcon}
|
|
48
|
+
>
|
|
49
|
+
Inbox
|
|
50
|
+
</NavList.Item>
|
|
51
|
+
<NavList.Item href="/pulls" icon={GitPullRequestIcon}>
|
|
52
|
+
Pull requests
|
|
53
|
+
</NavList.Item>
|
|
54
|
+
<NavList.Item href="/settings" icon={SettingsIcon}>
|
|
55
|
+
Settings
|
|
56
|
+
</NavList.Item>
|
|
57
|
+
</NavList>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
// A router's link: its props stay typed. The router says which item is current.
|
|
62
|
+
<NavList aria-label="Settings">
|
|
63
|
+
<NavList.Group label="Account">
|
|
64
|
+
<NavList.Item as={Link} current={pathname === "/settings/profile"} to="/settings/profile">
|
|
65
|
+
Profile
|
|
66
|
+
</NavList.Item>
|
|
67
|
+
<NavList.Item as={Link} current={pathname === "/settings/billing"} to="/settings/billing">
|
|
68
|
+
Billing
|
|
69
|
+
</NavList.Item>
|
|
70
|
+
</NavList.Group>
|
|
71
|
+
</NavList>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Don't
|
|
75
|
+
|
|
76
|
+
```tsx
|
|
77
|
+
// No name: a second nav on the page could not be told apart. The type rejects it.
|
|
78
|
+
<NavList>
|
|
79
|
+
<NavList.Item href="/">Home</NavList.Item>
|
|
80
|
+
</NavList>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
```tsx
|
|
84
|
+
// A bare number: the link is announced as "Issues 12". Say what the count counts.
|
|
85
|
+
<NavList.Item count={12} href="/issues">
|
|
86
|
+
Issues
|
|
87
|
+
</NavList.Item>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
```tsx
|
|
91
|
+
// A button that runs an action: a NavList item navigates. Use Menu or Button.
|
|
92
|
+
<NavList.Item as="button" onClick={signOut}>
|
|
93
|
+
Sign out
|
|
94
|
+
</NavList.Item>
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Accessibility
|
|
98
|
+
|
|
99
|
+
- A `nav` landmark named by its `aria-label` or `aria-labelledby`, around a native list: screen readers announce the landmark and the number of links, and their landmark commands reach it (WAI-ARIA landmarks).
|
|
100
|
+
- Each group's list is named by its heading's text, and the heading is in the page's outline, so heading navigation reaches it.
|
|
101
|
+
- The current item has `aria-current="page"`, announced as "current page". Its fill, bar and heavier label show it without color alone (WCAG 1.4.1); under forced colors the fill is gone and the bar turns `Highlight`.
|
|
102
|
+
- The current item's text is `accentSubtleFg` on `accentSubtle`, a checked pair (4.5:1, light and dark). Other items are `fg` on the page's surface; under the hover tint, `fg` over `bg`, `bgMuted` and `bgRaised` is checked in `contrast/mixes.ts` (the ghost Button's tint).
|
|
103
|
+
- Links are in the tab order in reading order and show the shared focus ring. Every item is at least 24px high (WCAG 2.5.8, ADR 0124).
|
|
104
|
+
- The icon or avatar is hidden; the label and the count, with its meaning, make the link's name, in a Sidebar rail too, where they are only visually hidden.
|
|
105
|
+
|
|
106
|
+
## Props
|
|
107
|
+
|
|
108
|
+
Generated from the TypeScript types.
|
|
109
|
+
|
|
110
|
+
### NavList
|
|
111
|
+
|
|
112
|
+
| Prop | Type | Required | Description |
|
|
113
|
+
| --- | --- | --- | --- |
|
|
114
|
+
| `aria-label` | `string` | no | Defines a string value that labels the current element. |
|
|
115
|
+
| `aria-labelledby` | `string` | no | Identifies the element (or elements) that labels the current element. |
|
|
116
|
+
|
|
117
|
+
Also accepts the style props (see `manifest.json` `styleProps`).
|
|
118
|
+
|
|
119
|
+
### NavList.Group
|
|
120
|
+
|
|
121
|
+
| Prop | Type | Required | Description |
|
|
122
|
+
| --- | --- | --- | --- |
|
|
123
|
+
| `headingLevel` | `"h1" \| "h2" \| "h3" \| "h4" \| "h5" \| "h6"` | no | |
|
|
124
|
+
| `label` | `string` | yes | |
|
|
125
|
+
|
|
126
|
+
Also accepts the style props (see `manifest.json` `styleProps`).
|
|
127
|
+
|
|
128
|
+
### NavList.Item
|
|
129
|
+
|
|
130
|
+
| Prop | Type | Required | Description |
|
|
131
|
+
| --- | --- | --- | --- |
|
|
132
|
+
| `as` | `ElementType` | no | |
|
|
133
|
+
| `avatar` | `ReactNode` | no | |
|
|
134
|
+
| `count` | `ReactNode` | no | |
|
|
135
|
+
| `current` | `boolean` | no | |
|
|
136
|
+
| `icon` | `ComponentType` | no | |
|
|
137
|
+
|
|
138
|
+
Also accepts every `<a>` attribute (change the element with `as`) and the style props (see `manifest.json` `styleProps`).
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Sidebar
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
An app's sidebar: a named `aside` on the `bgPanel` surface, with a header row, the navigation, and a footer for app-wide controls, that collapses to a narrow icon rail. Open, it is the `sidebar` width (15rem); collapsed (`collapsed`), it is the `rail` width (3.5rem) and a `NavList` inside it shows each row's icon or avatar alone, its label and count kept for assistive tech. The app owns the collapsed state: pass `onCollapsedChange` and a toggle `IconButton` appears in the header. Place it in `SidebarLayout.Sidebar`, which then follows its width (ADR 0151).
|
|
6
|
+
|
|
7
|
+
## When to use
|
|
8
|
+
|
|
9
|
+
- An app shell whose navigation can fold down to icons to give the page more room.
|
|
10
|
+
- A sidebar that needs its own surface, a brand at the top and controls (theme, account) pinned to the bottom.
|
|
11
|
+
|
|
12
|
+
## When not to use
|
|
13
|
+
|
|
14
|
+
- A sidebar that never collapses and needs no surface or footer: `SidebarLayout.Sidebar` alone, with a `NavList` in it.
|
|
15
|
+
- A drawer that slides over the page on a phone: not supported. Below 48em of the layout's width the sidebar stacks above the page, full width.
|
|
16
|
+
- Secondary content beside the page (filters, an outline): `SidebarLayout.Sidebar as="aside"`.
|
|
17
|
+
|
|
18
|
+
## Rules
|
|
19
|
+
|
|
20
|
+
- The sidebar needs a name, and its type requires one: `aria-label` ("Sidebar", "Repositories") or `aria-labelledby`. It is an `aside`, a complementary landmark; put a named `NavList` inside it for the links.
|
|
21
|
+
- Place it in `SidebarLayout.Sidebar` with `inlineSize="auto"`, so the column follows the sidebar's own width, open or collapsed. `padding` stays at its default of none on that column.
|
|
22
|
+
- The rail is for a wide layout. Stacked, a collapsed sidebar still shows only icons, across the whole row: keep it open below the layout's 48em.
|
|
23
|
+
- `collapsed` switches to the rail. The app keeps the state (and any persistence or shortcut): `collapsed={collapsed} onCollapsedChange={setCollapsed}`. Without `onCollapsedChange` there is no toggle, and `collapsed` alone draws a fixed rail.
|
|
24
|
+
- The toggle is a ghost `sm` `IconButton` at the header's inline end, named `toggleLabel` ("Toggle sidebar" by default). Its name stays the same in both states and `aria-expanded` says which is on. Its panel icon points at the sidebar's edge, mirrored in a right-to-left page.
|
|
25
|
+
- `header` sits before the toggle (a brand); `footer` sits after a rule at the bottom (theme, account). In the rail both stack in a column and center: pass what fits 40px (a mark, icon-only controls).
|
|
26
|
+
- In the rail, every `NavList.Item` needs an `icon` or an `avatar`: it is the one part left in sight. Group headings, labels and counts are visually hidden, never removed.
|
|
27
|
+
- In a wide SidebarLayout the sidebar fills the viewport's height, so the footer sits at the bottom; stacked, it takes the whole row and its own height, with its rule below it. Outside a SidebarLayout it is the width above and its content's height: size it yourself.
|
|
28
|
+
- Its width is CSS keyed to the layout's container query, not a default style prop, and component CSS outranks style props: another width goes in your own `className`. `backgroundColor` (`bgPanel`), `display` and `flexDirection` are default style props; the consumer's win.
|
|
29
|
+
- No hooks: a server component can render it. Pass `onCollapsedChange` from a client component; the toggle is the only client part.
|
|
30
|
+
|
|
31
|
+
## Do
|
|
32
|
+
|
|
33
|
+
```tsx
|
|
34
|
+
const [collapsed, setCollapsed] = useState(false);
|
|
35
|
+
|
|
36
|
+
<SidebarLayout gap="0">
|
|
37
|
+
<SidebarLayout.Sidebar inlineSize="auto">
|
|
38
|
+
<Sidebar
|
|
39
|
+
aria-label="Sidebar"
|
|
40
|
+
collapsed={collapsed}
|
|
41
|
+
footer={<IconButton icon={SettingsIcon} label="Settings" variant="ghost" />}
|
|
42
|
+
header={<Logo />}
|
|
43
|
+
onCollapsedChange={setCollapsed}
|
|
44
|
+
>
|
|
45
|
+
<NavList aria-label="Repositories">
|
|
46
|
+
<NavList.Item current href="/" icon={InboxIcon}>
|
|
47
|
+
All repos
|
|
48
|
+
</NavList.Item>
|
|
49
|
+
<NavList.Item avatar={<Avatar initials="UI" label="" size="sm" />} href="/ui">
|
|
50
|
+
jonmilner/ui
|
|
51
|
+
</NavList.Item>
|
|
52
|
+
</NavList>
|
|
53
|
+
</Sidebar>
|
|
54
|
+
</SidebarLayout.Sidebar>
|
|
55
|
+
<SidebarLayout.Main as="main">…</SidebarLayout.Main>
|
|
56
|
+
</SidebarLayout>;
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Don't
|
|
60
|
+
|
|
61
|
+
```tsx
|
|
62
|
+
// A row with no icon or avatar: in the rail it shows nothing at all.
|
|
63
|
+
<Sidebar aria-label="Sidebar" collapsed>
|
|
64
|
+
<NavList aria-label="Main">
|
|
65
|
+
<NavList.Item href="/">Home</NavList.Item>
|
|
66
|
+
</NavList>
|
|
67
|
+
</Sidebar>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
```tsx
|
|
71
|
+
// The column keeps its default `sidebar` width, so the rail sits in a 15rem column.
|
|
72
|
+
<SidebarLayout.Sidebar>
|
|
73
|
+
<Sidebar aria-label="Sidebar" collapsed>
|
|
74
|
+
…
|
|
75
|
+
</Sidebar>
|
|
76
|
+
</SidebarLayout.Sidebar>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Accessibility
|
|
80
|
+
|
|
81
|
+
- An `aside` landmark, named by its `aria-label` or `aria-labelledby`, so landmark navigation reaches it and tells it apart from the page's other regions.
|
|
82
|
+
- The toggle is a button with a name and `aria-expanded` (true while open). It keeps focus when pressed, and its name never changes, so a screen reader hears the new state, not a new control.
|
|
83
|
+
- In the rail, NavList's labels, counts and group headings are visually hidden, not removed: each link keeps its full name, count included, and each group's list keeps its name. Rows stay in the tab order in reading order; there is no roving tabindex.
|
|
84
|
+
- Rail rows are 40px squares, above the 24px target floor (WCAG 2.5.8, ADR 0124). A rail row has no visible label: until a tooltip shows one on hover and focus, pair the rail with icons or avatars people recognise.
|
|
85
|
+
- The `bgPanel` surface is checked with every text role on it (`contrast.ts`); `fg` and `fgMuted` pass 4.5:1 on it, as on every surface. Under forced colors it is `Canvas` and the edge rule stays.
|
|
86
|
+
- Logical properties throughout: in a right-to-left page the sidebar, its rule and its toggle's icon mirror.
|
|
87
|
+
|
|
88
|
+
## Props
|
|
89
|
+
|
|
90
|
+
Generated from the TypeScript types.
|
|
91
|
+
|
|
92
|
+
### Sidebar
|
|
93
|
+
|
|
94
|
+
| Prop | Type | Required | Description |
|
|
95
|
+
| --- | --- | --- | --- |
|
|
96
|
+
| `aria-label` | `string` | no | Defines a string value that labels the current element. |
|
|
97
|
+
| `aria-labelledby` | `string` | no | Identifies the element (or elements) that labels the current element. |
|
|
98
|
+
| `collapsed` | `boolean` | no | |
|
|
99
|
+
| `footer` | `ReactNode` | no | |
|
|
100
|
+
| `header` | `ReactNode` | no | |
|
|
101
|
+
| `onCollapsedChange` | `((collapsed: boolean) => void)` | no | |
|
|
102
|
+
| `toggleLabel` | `string` | no | |
|
|
103
|
+
|
|
104
|
+
Also accepts the style props (see `manifest.json` `styleProps`).
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# SidebarLayout
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
A page's navigation or secondary column beside its main content. `SidebarLayout` is a wrapping flex row; `SidebarLayout.Sidebar` keeps a fixed width (`inlineSize="sidebar"`, 15rem) at the inline start and `SidebarLayout.Main` takes the rest. When the layout itself is narrower than 48em, the sidebar stacks above main at full width. It reads its own width through a container query, not the viewport's, so it stacks inside a narrow slot on a wide screen too. When wide, the sidebar is sticky: it stays in view while the page scrolls, capped at the viewport's height, and scrolls on its own when its content is taller. All three parts are `Box`es and take style props, except the few the layout fixes (see Rules).
|
|
6
|
+
|
|
7
|
+
## When to use
|
|
8
|
+
|
|
9
|
+
- An app shell: section navigation beside the page, stacking above it on a phone.
|
|
10
|
+
- A settings or docs page: a list of sections in one column, the open section in the other.
|
|
11
|
+
- A secondary column beside a detail view (filters, an outline) that should stay in reach while the content scrolls.
|
|
12
|
+
|
|
13
|
+
## When not to use
|
|
14
|
+
|
|
15
|
+
- A row of equal columns, or a grid of cards: use `Box` with `display="grid"`.
|
|
16
|
+
- A vertical column of content: use `Stack`, even when it turns into a row at a breakpoint.
|
|
17
|
+
- A row of small items that wraps: use `Inline`.
|
|
18
|
+
- A panel that slides over the page and is dismissed: use `Dialog`, not a sidebar that hides.
|
|
19
|
+
|
|
20
|
+
## Rules
|
|
21
|
+
|
|
22
|
+
- Put `SidebarLayout.Sidebar` first and `SidebarLayout.Main` second, as direct children. The sidebar's inline-start place and its place above main when stacked both come from that source order.
|
|
23
|
+
- The root is full width by default (`inlineSize="full"`). It measures its own inline size (inline-size containment), so it never sizes itself to its content: without that default a shrink-to-fit parent, such as a Stack with `alignItems="start"`, would collapse it to nothing. Override it with another width, never `"auto"` or `"fit"`. The parent must give it a definite width too: in a grid `auto` or `max-content` track, an inline-block, a float or a fit-content popup the full width resolves to nothing and the layout collapses.
|
|
24
|
+
- `gap` defaults to `"24"`, between the columns when wide and between the rows when stacked. Override it like any style prop: `gap="16"`.
|
|
25
|
+
- The sidebar's width is `inlineSize`; `"sidebar"` is the default. Pass another container width or size token to change it, well under 48em: the stacking width does not follow the sidebar's, so a `"prose"` sidebar leaves main a sliver just above it. A sidebar that holds its own width-owning content (a collapsible rail) sets `inlineSize="auto"`.
|
|
26
|
+
- The stacking width (48em), the sticky offset (0) and the viewport-height cap are fixed: they live in the component's stylesheet, so style props do not change them. When wide, the sidebar's `flexShrink`, `alignSelf`, `position`, `maxBlockSize` and `overflow` are fixed the same way, and main's `minInlineSize` always is. A page with a sticky header above the layout puts the header inside `SidebarLayout.Main`, or waits for a sticky offset this layout does not have yet.
|
|
27
|
+
- When wide, the sidebar is only as tall as its content, up to the viewport's height, so it can stick. The sticky offset and the cap assume the page itself scrolls: inside a scrolling pane shorter than the viewport, the sidebar's bottom stays out of reach until the pane scrolls to its end.
|
|
28
|
+
- Main has a zero minimum width, so wide content (a table, a code block) scrolls or wraps inside it instead of pushing the row wider than the page.
|
|
29
|
+
- When wide, the sidebar is a scroll container, which clips anything drawn past its edges. The focus ring draws 4px outside its element, so a sidebar of links gets `padding="8"` or more.
|
|
30
|
+
- Responsive style props on the parts (`gap={{ base: "16", lg: "32" }}`) need `@jonmilner/ui/responsive.css` on the page, as on every component other than Box, Stack and Inline (decision 0111).
|
|
31
|
+
- The consumer's `className` comes last on each part and `style` is passed through; `ref` is a plain prop typed for the `as` element.
|
|
32
|
+
|
|
33
|
+
## Do
|
|
34
|
+
|
|
35
|
+
```tsx
|
|
36
|
+
<SidebarLayout>
|
|
37
|
+
<SidebarLayout.Sidebar as="nav" aria-label="Settings" padding="8">
|
|
38
|
+
<Stack as="ul" gap="4" paddingInlineStart="0">
|
|
39
|
+
<Box as="li" display="block">
|
|
40
|
+
<Clickable as="a" display="flex" href="/settings/profile" justifyContent="start">
|
|
41
|
+
<Text as="span">Profile</Text>
|
|
42
|
+
</Clickable>
|
|
43
|
+
</Box>
|
|
44
|
+
<Box as="li" display="block">
|
|
45
|
+
<Clickable as="a" display="flex" href="/settings/billing" justifyContent="start">
|
|
46
|
+
<Text as="span">Billing</Text>
|
|
47
|
+
</Clickable>
|
|
48
|
+
</Box>
|
|
49
|
+
</Stack>
|
|
50
|
+
</SidebarLayout.Sidebar>
|
|
51
|
+
<SidebarLayout.Main as="main">
|
|
52
|
+
<Heading as="h1">Profile</Heading>
|
|
53
|
+
</SidebarLayout.Main>
|
|
54
|
+
</SidebarLayout>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
// A secondary column: `aside` with its own name, a narrower gap.
|
|
59
|
+
<SidebarLayout gap="16">
|
|
60
|
+
<SidebarLayout.Sidebar as="aside" aria-label="Filters">
|
|
61
|
+
…
|
|
62
|
+
</SidebarLayout.Sidebar>
|
|
63
|
+
<SidebarLayout.Main>…</SidebarLayout.Main>
|
|
64
|
+
</SidebarLayout>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Don't
|
|
68
|
+
|
|
69
|
+
```tsx
|
|
70
|
+
// Main first, then reordered: screen readers and the keyboard meet main first, sighted users
|
|
71
|
+
// the sidebar first.
|
|
72
|
+
<SidebarLayout>
|
|
73
|
+
<SidebarLayout.Main>…</SidebarLayout.Main>
|
|
74
|
+
<SidebarLayout.Sidebar>…</SidebarLayout.Sidebar>
|
|
75
|
+
</SidebarLayout>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
```tsx
|
|
79
|
+
// A hand-rolled sidebar: a column-to-row Stack switches on the viewport, not the slot it sits in,
|
|
80
|
+
// and the sidebar neither keeps its width nor stays in view.
|
|
81
|
+
<Stack gap="24" flexDirection={{ base: "column", med: "row" }}>
|
|
82
|
+
<Box as="nav" aria-label="Settings">
|
|
83
|
+
…
|
|
84
|
+
</Box>
|
|
85
|
+
<Box as="main">…</Box>
|
|
86
|
+
</Stack>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Accessibility
|
|
90
|
+
|
|
91
|
+
- SidebarLayout adds no role or ARIA. Pick each part's element with `as`: `nav` with an `aria-label` for navigation, `aside` with an `aria-label` for secondary content, and `main` for the page's main content (once per page).
|
|
92
|
+
- The sidebar comes first in reading and focus order, before main, in both layouts. A long sidebar of links pairs with a skip link to main.
|
|
93
|
+
- Layout uses logical properties only, so in a right-to-left page the sidebar sits on the right.
|
|
94
|
+
- When the sidebar is taller than the viewport it scrolls on its own; keyboard users reach its last links by tabbing, which scrolls them into view. A sidebar with nothing focusable in it (a read-only outline) gets `tabIndex={0}`, so keyboard users can scroll it in browsers that never focus a scroller.
|
|
95
|
+
- Stacking keeps the page usable at 400% zoom: at 320 CSS pixels the layout is well under 48em, so main gets the full width.
|
|
96
|
+
|
|
97
|
+
## Props
|
|
98
|
+
|
|
99
|
+
Generated from the TypeScript types.
|
|
100
|
+
|
|
101
|
+
### SidebarLayout
|
|
102
|
+
|
|
103
|
+
| Prop | Type | Required | Description |
|
|
104
|
+
| --- | --- | --- | --- |
|
|
105
|
+
| `as` | `ElementType` | no | |
|
|
106
|
+
|
|
107
|
+
Also accepts every `<div>` attribute (change the element with `as`) and the style props (see `manifest.json` `styleProps`).
|
|
108
|
+
|
|
109
|
+
### SidebarLayout.Main
|
|
110
|
+
|
|
111
|
+
| Prop | Type | Required | Description |
|
|
112
|
+
| --- | --- | --- | --- |
|
|
113
|
+
| `as` | `ElementType` | no | |
|
|
114
|
+
|
|
115
|
+
Also accepts every `<div>` attribute (change the element with `as`) and the style props (see `manifest.json` `styleProps`).
|
|
116
|
+
|
|
117
|
+
### SidebarLayout.Sidebar
|
|
118
|
+
|
|
119
|
+
| Prop | Type | Required | Description |
|
|
120
|
+
| --- | --- | --- | --- |
|
|
121
|
+
| `as` | `ElementType` | no | |
|
|
122
|
+
|
|
123
|
+
Also accepts every `<div>` attribute (change the element with `as`) and the style props (see `manifest.json` `styleProps`).
|
package/dist/docs/Stack.md
CHANGED
|
@@ -14,6 +14,7 @@ A vertical column of children with even space between them. `Stack` is a `Box` w
|
|
|
14
14
|
|
|
15
15
|
- A row of items that wraps (buttons, tags, metadata): use `Inline`.
|
|
16
16
|
- A two-dimensional layout: use `Box` with `display="grid"`.
|
|
17
|
+
- A page with a sidebar beside its main content that stacks when narrow: use `SidebarLayout`, not a column that turns into a row at a breakpoint.
|
|
17
18
|
- Records that share named columns, to compare row by row: use `Table`.
|
|
18
19
|
- One child, or spacing only on one side: use `Box` with padding or margin.
|
|
19
20
|
|
package/dist/docs/Tabs.md
CHANGED
|
@@ -11,7 +11,7 @@ Switches between views that share one place on the page. The parts are `Tabs` (t
|
|
|
11
11
|
|
|
12
12
|
## When not to use
|
|
13
13
|
|
|
14
|
-
- Moving between pages or routes: use links (`Clickable as="a"`) in a `nav`. Tabs do not change the URL and the panels are not separate pages.
|
|
14
|
+
- Moving between pages or routes: use `NavList`, or links (`Clickable as="a"`) in a `nav`. Tabs do not change the URL and the panels are not separate pages.
|
|
15
15
|
- A sequence the user must go through in order: use a stepper.
|
|
16
16
|
- Two or three options that set a value in a form: use `RadioGroup`.
|
|
17
17
|
- Content that should be readable at once, or compared side by side: show it all, or use sections with headings.
|
package/dist/docs/llms.txt
CHANGED
|
@@ -29,9 +29,12 @@
|
|
|
29
29
|
- [Inline](Inline.md): A horizontal row of children that wraps onto new lines, with even space between them on both axes. `Inline` is a `Box` with `display="flex"`, `flexDirection="row"`, `flexWrap="wrap"` and `alignItems="center"` as default style props, spaced by a required `gap`. Children render as they are: no wrapper per child.
|
|
30
30
|
- [Menu](Menu.md): A list of actions that opens from a button: a row's "Edit, Duplicate, Delete", a toolbar's overflow. It may mix in links ("Open invoice", "Download PDF") as `Menu.LinkItem`, real anchors that keep the browser's link behavior. Built on Base UI's Menu, which owns the keyboard and focus: arrow keys, Home and End move through the items, typing jumps to a matching item, Esc and an outside click close it, and focus returns to the trigger. The parts add the look: a raised surface with a border and shadow, a highlighted item, a zoom-and-fade that is a plain fade under reduced motion.
|
|
31
31
|
- [MultiSelect](MultiSelect.md): A form field for picking any number of values from a list too long to show at once. A trigger styled as Button's secondary look opens a listbox of options; each selected option shows a check mark, and the trigger summarises the selection as the joined labels, or a count ("3 selected") once the labels would not fit. Built on Base UI's `Select` in multiple mode (ADR 0003), which owns the keyboard and focus: arrow keys, Home and End move through the options, typing jumps to a match, Esc and an outside click close it, and focus returns to the trigger. It composes `Field` for its label, description and error (ADR 0026).
|
|
32
|
+
- [NavList](NavList.md): A column of links to an app's pages, with the current page marked: a sidebar's or a settings page's navigation. The parts are `NavList` (a named `nav` around a list), `NavList.Group` (a heading over a run of items) and `NavList.Item` (one link, with an optional leading icon and trailing count). Items are links, not buttons: an `<a>` by default, or a router's `Link` through `as`, which keeps the router's props typed (ADR 0149). The app says which item is current; NavList reads nothing from the URL.
|
|
32
33
|
- [RadioGroup](RadioGroup.md): One choice among a few options, all shown at once. A form field built on Base UI `RadioGroup` and `Radio` (ADR 0003, 0046) inside a `Fieldset`: a `radiogroup` named by its legend, with a `radio` per option. Each option is a 24 by 24 CSS px target (WCAG 2.2) with the shared focus ring; the 16px circle inside shows a dot when checked. It composes `Field` for the group's description and error and for each option's label and description (ADR 0026, 0133).
|
|
33
34
|
- [SearchField](SearchField.md): A form field for a search query: an `<input type="search">` (role `searchbox`) with a search icon at its inline start and, while it holds a value, a clear button at its inline end. Escape empties a field that has a value, and the clear button empties it and puts focus back in the input, so a keyboard user never loses their place (ADR 0087). Built on Base UI's `Input` (ADR 0003); it composes `Field` for its label, description and error (ADR 0026). Three sizes at Button's heights (`sm`, `med`, `lg`: 24, 32 and 40 px, ADR 0124); the clear button is 24px, or 32px in `lg`.
|
|
34
35
|
- [Select](Select.md): A form field for picking one value from a list too long to show as radios, with no typing. A trigger drawn as a field opens a listbox of options; the selected option shows a check mark, and the trigger shows its label on one line, truncated. Built on Base UI's `Select` in single mode (ADR 0003), which owns the keyboard and focus: Enter, Space and the arrow keys open it, arrow keys, Home and End move through the options, typing jumps to a match, Enter picks, Esc and an outside click close it, and focus returns to the trigger. It shares MultiSelect's trigger, popup and option rows (ADR 0134) and composes `Field` for its label, description and error (ADR 0026).
|
|
36
|
+
- [Sidebar](Sidebar.md): An app's sidebar: a named `aside` on the `bgPanel` surface, with a header row, the navigation, and a footer for app-wide controls, that collapses to a narrow icon rail. Open, it is the `sidebar` width (15rem); collapsed (`collapsed`), it is the `rail` width (3.5rem) and a `NavList` inside it shows each row's icon or avatar alone, its label and count kept for assistive tech. The app owns the collapsed state: pass `onCollapsedChange` and a toggle `IconButton` appears in the header. Place it in `SidebarLayout.Sidebar`, which then follows its width (ADR 0151).
|
|
37
|
+
- [SidebarLayout](SidebarLayout.md): A page's navigation or secondary column beside its main content. `SidebarLayout` is a wrapping flex row; `SidebarLayout.Sidebar` keeps a fixed width (`inlineSize="sidebar"`, 15rem) at the inline start and `SidebarLayout.Main` takes the rest. When the layout itself is narrower than 48em, the sidebar stacks above main at full width. It reads its own width through a container query, not the viewport's, so it stacks inside a narrow slot on a wide screen too. When wide, the sidebar is sticky: it stays in view while the page scrolls, capped at the viewport's height, and scrolls on its own when its content is taller. All three parts are `Box`es and take style props, except the few the layout fixes (see Rules).
|
|
35
38
|
- [Stack](Stack.md): A vertical column of children with even space between them. `Stack` is a `Box` with `display="flex"` and `flexDirection="column"` as default style props, spaced by a required `gap`. Children render as they are: no wrapper per child.
|
|
36
39
|
- [Switch](Switch.md): Turns one setting on or off, and the change applies the moment it flips. Built on Base UI `Switch` (ADR 0003, 0137): a `span` with `role="switch"` and `aria-checked`, plus a hidden checkbox input that submits with a form. The span is a 24 px target with the shared focus ring around a pill track: off is an outlined track with the thumb at the start, on a filled `accent` track with the thumb at the end. It composes `Field` for its label, description and error (ADR 0026), with the label after the switch.
|
|
37
40
|
- [Table](Table.md): Records in rows that share named columns, so a reader can scan and compare them: transactions, members, invoices. A native `table` with parts for each element (`Table.Head`, `Table.Body`, `Table.Foot`, `Table.Row`, `Table.HeaderCell`, `Table.Cell`, `Table.ColumnGroup`, `Table.Column`), and `Table.ScrollArea` for a table wider than its container. It has no `grid` role and no roving focus: a link, `Checkbox` or `Menu` in a cell keeps the page's tab order, and a screen reader's table commands work as on any table.
|