@jonmilner/ui 0.16.0 → 0.17.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/Badge/index.mjs +1 -1
- package/dist/Box/Box.css +1 -1
- package/dist/Button/Button.css +1 -1
- package/dist/Checkbox/Checkbox.css +2 -2
- package/dist/Chip/Chip.css +1 -1
- package/dist/Clickable/Clickable.css +1 -1
- package/dist/ColorField/ColorField.css +2 -2
- 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/Menu/index.mjs +2 -2
- package/dist/MultiSelect/MultiSelect.css +1 -1
- package/dist/NavList/NavList.css +1 -1
- package/dist/NavList/index.mjs +1 -1
- package/dist/NumberField/NumberField.css +2 -0
- package/dist/NumberField/NumberField.css.mjs +17 -0
- package/dist/NumberField/index.d.mts +28 -0
- package/dist/NumberField/index.mjs +78 -0
- package/dist/RadioGroup/RadioGroup.css +1 -1
- package/dist/SearchField/SearchField.css +1 -1
- package/dist/SearchField/client.mjs +21 -26
- package/dist/Select/Select.css +1 -1
- package/dist/Sidebar/Sidebar.css +1 -1
- package/dist/SidebarLayout/SidebarLayout.css +1 -1
- 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/Toast/client.mjs +1 -1
- package/dist/Tooltip/Tooltip.css +1 -1
- package/dist/Tooltip/base.mjs +1 -1
- package/dist/VisuallyHidden/VisuallyHidden.css +1 -1
- package/dist/base.css +2 -2
- package/dist/docs/Field.md +1 -1
- package/dist/docs/Icon.md +1 -0
- package/dist/docs/NavList.md +1 -1
- package/dist/docs/NumberField.md +105 -0
- package/dist/docs/TextField.md +1 -1
- package/dist/docs/Tooltip.md +3 -3
- package/dist/docs/llms.txt +1 -0
- package/dist/docs/manifest.json +119 -3
- package/dist/docs/migrations/0.17.0.md +47 -0
- package/dist/docs/theming.md +4 -0
- package/dist/icons/MinusIcon.d.mts +2 -0
- package/dist/icons/MinusIcon.mjs +10 -0
- package/dist/icons/index.d.mts +3 -2
- package/dist/icons/index.mjs +31 -30
- package/dist/index.d.mts +2 -1
- package/dist/index.mjs +20 -19
- package/dist/popup/listbox-row.mjs +1 -1
- package/dist/styles/atoms.css +2 -2
- package/dist/styles/atoms.css.d.mts +1 -1
- package/dist/styles/atoms.css.mjs +30 -29
- package/dist/styles/control-size.mjs +5 -1
- package/dist/styles/layers.css +1 -1
- package/dist/styles/responsive.css +1 -1
- package/dist/tokens/contract.d.mts +1 -0
- package/dist/tokens/scales.d.mts +1 -0
- package/dist/tokens/scales.mjs +2 -1
- package/package.json +5 -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.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.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.nav-list, 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.number-field, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.nav-list, 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.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.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.nav-list, 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.number-field, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.nav-list, 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.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.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.nav-list, 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.number-field, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.nav-list, 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/Toast/client.mjs
CHANGED
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.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.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.nav-list, 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.number-field, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.nav-list, 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}}
|
package/dist/Tooltip/base.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { popup as s, positioner as c } from "./Tooltip.css.mjs";
|
|
|
7
7
|
import { Children as l } from "react";
|
|
8
8
|
import { jsx as u } from "react/jsx-runtime";
|
|
9
9
|
// src/Tooltip/base.tsx
|
|
10
|
-
function d({ side: r = "top", align: l = "center", backgroundColor: d = "bgRaised", borderRadius: p = "
|
|
10
|
+
function d({ side: r = "top", align: l = "center", backgroundColor: d = "bgRaised", borderRadius: p = "xs", boxShadow: m = "med", paddingBlock: h = "4", paddingInline: g = "8", className: _, style: v, children: y, ...b }) {
|
|
11
11
|
let [x, S] = t(b);
|
|
12
12
|
return /* @__PURE__ */ u(a, { children: /* @__PURE__ */ u(o, {
|
|
13
13
|
align: l,
|
|
@@ -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.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.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.nav-list, 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.number-field, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.nav-list, 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,5 +1,5 @@
|
|
|
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.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.nav-list, 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-
|
|
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.number-field, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.nav-list, 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-xs:.25rem;--radius-sm:.375rem;--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-meta:1.3334;--line-height-body:1.4286;--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
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% .006 265),oklch(27% .006 265));--color-bg-raised:light-dark(oklch(100% 0 0),oklch(20.5% .006 265));--color-bg-panel:light-dark(oklch(98.5% .006 265),oklch(17.7% .006 265));--color-fg:light-dark(oklch(14.5% .006 265),oklch(98.5% .006 265));--color-fg-muted:light-dark(oklch(44.5% .006 265),oklch(71% .006 265));--color-border:light-dark(oklch(92.5% .006 265),oklch(27% .006 265));--color-border-strong:oklch(55.5% .006 265);--color-hover:light-dark(oklch(14.5% .006 265/.04),oklch(98.5% .006 265/.04));--color-control-fill:light-dark(oklch(14.5% .006 265/.05),oklch(98.5% .006 265/.05));--color-selected:light-dark(oklch(14.5% .006 265/.07),oklch(98.5% .006 265/.07));--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% .006 265),oklch(27% .006 265));--color-neutral-subtle-fg:light-dark(oklch(37% .006 265),oklch(87% .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;--font-tracking-body:-.006em;--font-tracking-heading:-.006em;--font-tracking-display:-.006em;--font-tracking-label:-.006em;--font-tracking-mono:normal;--font-features-body:"cv11", "ss03";--font-features-heading:"cv11", "ss03";--font-features-display:"cv11", "ss03";--font-features-label:"cv11", "ss03";--font-features-mono:normal}@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-hover:Highlight;--color-control-fill:ButtonFace;--color-selected:Highlight;--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
|
|
package/dist/docs/Field.md
CHANGED
|
@@ -14,7 +14,7 @@ Wires one form control to its label, description and error: ids, `htmlFor`, `ari
|
|
|
14
14
|
- An error about the whole form (a failed save, a network error): put it in a reserved slot at the form level, not on one field.
|
|
15
15
|
- The result of submitting the form ("Profile saved"): use `Toast`; the field's message is for that one input.
|
|
16
16
|
- A group of controls with one legend: a public `Fieldset` is not planned (ADR 0133). For checkboxes, write a native `fieldset` and `legend` with one Field per Checkbox. For one choice among a few, `RadioGroup` carries its own legend.
|
|
17
|
-
- A single line of text, several lines, a search, a colour, or one or several values from a list: use `TextField`, `Textarea`, `SearchField`, `ColorField`, `Select` or `MultiSelect`, which build on this Field.
|
|
17
|
+
- A single line of text, several lines, a search, a colour, a bounded number, or one or several values from a list: use `TextField`, `Textarea`, `SearchField`, `ColorField`, `NumberField`, `Select` or `MultiSelect`, which build on this Field.
|
|
18
18
|
|
|
19
19
|
## Rules
|
|
20
20
|
|
package/dist/docs/Icon.md
CHANGED
|
@@ -92,6 +92,7 @@ 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
|
+
- `MinusIcon` (`minus.svg`)
|
|
95
96
|
- `PanelLeftCloseIcon` (`panel-left-close.svg`)
|
|
96
97
|
- `PanelLeftOpenIcon` (`panel-left-open.svg`)
|
|
97
98
|
- `PencilIcon` (`pencil.svg`)
|
package/dist/docs/NavList.md
CHANGED
|
@@ -29,7 +29,7 @@ A column of links to an app's pages, with the current page marked: a sidebar's o
|
|
|
29
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. In a SidebarLayout stacked below 48em a collapsed Sidebar is no rail: the items show open (ADR 0156). In the rail, hover or keyboard focus on an item shows its label and count in a tooltip past its inline end (right, or left right to left); Esc, blur and pointer leave close it, and the pointer can move onto it. Items in one NavList share the tooltip delay: once one has opened, the next opens at once. Outside a rail no tooltip shows (ADR 0159). The tooltip repeats the item's children, so keep them to text and a count: content with an `id` would repeat it.
|
|
30
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
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,
|
|
32
|
+
- Items are `sm` text in `fg`, with `6` block and `8` inline padding, an `xs` 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
33
|
- A server component can render the whole list, router `Link` included. `NavList` and `NavList.Group` have no hooks; each `NavList.Item` renders its link inside a client part, the rail tooltip (ADR 0159).
|
|
34
34
|
|
|
35
35
|
## Do
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# NumberField
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
A form field for a bounded number: a text input between a decrement button (inline start) and an increment button (inline end), with the number centred between them. Built on Base UI's `NumberField` (ADR 0003, 0161); 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 input fills the Field's width.
|
|
6
|
+
|
|
7
|
+
## When to use
|
|
8
|
+
|
|
9
|
+
- A small count with a known range that the user nudges up or down: a cap (1 to 20), a number of slots (1 to 10), a retry limit, a quantity.
|
|
10
|
+
- A settings form whose fields line up with a `TextField` or `Select`: they share the heights and the border.
|
|
11
|
+
|
|
12
|
+
## When not to use
|
|
13
|
+
|
|
14
|
+
- Free text, or a number nobody steps (a phone number, a postcode, an account number, a year typed in full): use `TextField` with `inputMode` in `inputProps`.
|
|
15
|
+
- One of a few named options ("Low", "Medium", "High"), or a fixed list of values: use `Select` or `RadioGroup`.
|
|
16
|
+
- A value picked by dragging along a range: a slider is not in the library.
|
|
17
|
+
- Money or a percentage that needs a formatter: NumberField shows a plain number.
|
|
18
|
+
|
|
19
|
+
## Rules
|
|
20
|
+
|
|
21
|
+
- `label` is required and names the input, even when the design shows none: pass `hideLabel` to keep it for assistive technology and hide it from sight. Never pass an empty label, and never let `placeholder` stand in for one.
|
|
22
|
+
- `value` with `onValueChange` controls it; `defaultValue` leaves it uncontrolled. `onValueChange` gets the number, or `null` when the input is emptied.
|
|
23
|
+
- `min` and `max` bound the value. The buttons and the arrow keys stop at them, and each button is disabled at its bound. A typed value outside them is clamped as it is typed: `onValueChange` gets the bound at once, and the input shows it when it loses focus.
|
|
24
|
+
- `step` (default 1) is how far a button press or an arrow key moves the value; Shift with an arrow moves ten steps, and Home and End jump to `min` and `max` when they are set. A whole-number `step` keeps the value whole: a typed fraction rounds to the nearest whole number.
|
|
25
|
+
- With a `name` and a `step` above 1, keep `max` a whole number of steps from `min` (`min={5} max={50} step={5}`, not `min={1} max={20} step={5}`): the submitted input checks the value against the steps, and a value between them, the clamped `max` included, blocks the form's submission. A typed value is kept as typed, not snapped to a step: with `min={5} step={5}`, a typed 7 stays 7 and blocks submission until the user steps or retypes it.
|
|
26
|
+
- `description` and `error` render below the input through `Field`; a non-empty `error` marks the field invalid (`aria-invalid`, a danger border) and joins the input's `aria-describedby`.
|
|
27
|
+
- `disabled` disables the input and both buttons: the input leaves the tab order and does not submit, with a dashed border. `required` sets the native `required` on the submitted input.
|
|
28
|
+
- `name` submits the number with its form, through a hidden native number input that carries the bounds and step.
|
|
29
|
+
- `incrementLabel` and `decrementLabel` name the buttons ("Increase" and "Decrease"); pass translated strings in another language.
|
|
30
|
+
- Style props, `className` and `style` go to the `Field` around the label, control and messages, not to the input.
|
|
31
|
+
- `inputProps` reach the input: `ref`, `id`, `autoFocus`, `enterKeyHint`, `onKeyDown`, and only the `aria-*` valid on a text box that Base UI does not set (ADR 0110, 0154): `aria-controls`, `aria-details`, `aria-keyshortcuts`, `aria-owns`, `aria-flowto`, `aria-current`, `aria-busy`, `aria-live`, `aria-atomic` and `aria-relevant`. Base UI sets `inputMode`, `autoComplete`, `spellCheck` and `aria-roledescription`, and filters the characters typed, so those and `maxLength` are not among them; `min`, `max` and `step` are the field's own props. The type closes the set; nothing strips another prop at runtime.
|
|
32
|
+
- A consumer `onKeyDown` runs before the field's own arrow-key stepping.
|
|
33
|
+
- A consumer `ref` gets the input. A consumer `id` takes over from Field's generated one at hydration, and the label follows it.
|
|
34
|
+
- The module has no hooks, so a server component can render it; `onValueChange`, and an `inputProps` `ref` or `onKeyDown`, must come from a client component.
|
|
35
|
+
|
|
36
|
+
## Do
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
<NumberField label="Attention cap" name="attentionCap" min={1} max={20} defaultValue={5} />
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
<NumberField
|
|
44
|
+
label="Session slots"
|
|
45
|
+
description="How many sessions run at once."
|
|
46
|
+
min={1}
|
|
47
|
+
max={10}
|
|
48
|
+
value={slots}
|
|
49
|
+
onValueChange={(next) => setSlots(next ?? 1)}
|
|
50
|
+
/>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Don't
|
|
54
|
+
|
|
55
|
+
```tsx
|
|
56
|
+
// A number nobody steps: a postcode or phone number is text.
|
|
57
|
+
<NumberField label="Phone" />
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
// Named options: pick them from a list.
|
|
62
|
+
<NumberField label="Priority" min={1} max={3} />
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
```tsx
|
|
66
|
+
// No bounds on a count that has them: the buttons never disable and any value submits.
|
|
67
|
+
<NumberField label="Session slots" />
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Accessibility
|
|
71
|
+
|
|
72
|
+
- The input is a text box named by its label, announced as a "Number field" (`aria-roledescription`), with a numeric keypad on touch devices. On iOS Base UI asks for the decimal pad when `min` is 0 or more, and the full keyboard otherwise, since neither iOS pad has a minus key. Base UI does not give it the `spinbutton` role (ADR 0161); the arrow keys still step it.
|
|
73
|
+
- The buttons are named "Decrease" and "Increase", are out of the tab order (the arrow keys do their job) and keep focus in the input when pressed. At a bound the button is `aria-disabled` and takes IconButton's disabled look, a dashed border on a muted fill, so the state is not colour alone.
|
|
74
|
+
- Every size is at least 24 px tall, and at `sm` each button is a 24 px square target. Invalid adds a danger border and the error message with its icon, never colour alone; disabled adds a dashed border. Under forced colors the border, text, buttons and disabled state use system colors. On a coarse pointer the input text is 16px at every size, so iOS Safari does not zoom the page when the field takes focus.
|
|
75
|
+
|
|
76
|
+
## Props
|
|
77
|
+
|
|
78
|
+
Generated from the TypeScript types.
|
|
79
|
+
|
|
80
|
+
### NumberField
|
|
81
|
+
|
|
82
|
+
| Prop | Type | Required | Description |
|
|
83
|
+
| --- | --- | --- | --- |
|
|
84
|
+
| `className` | `string` | no | |
|
|
85
|
+
| `decrementLabel` | `string` | no | |
|
|
86
|
+
| `defaultValue` | `number` | no | |
|
|
87
|
+
| `description` | `ReactNode` | no | |
|
|
88
|
+
| `disabled` | `boolean` | no | |
|
|
89
|
+
| `error` | `ReactNode` | no | |
|
|
90
|
+
| `hideLabel` | `boolean` | no | |
|
|
91
|
+
| `incrementLabel` | `string` | no | |
|
|
92
|
+
| `inputProps` | `NumberFieldInputProps` | no | |
|
|
93
|
+
| `label` | `ReactNode` | yes | |
|
|
94
|
+
| `max` | `number` | no | |
|
|
95
|
+
| `min` | `number` | no | |
|
|
96
|
+
| `name` | `string` | no | |
|
|
97
|
+
| `onValueChange` | `((value: number \| null) => void)` | no | |
|
|
98
|
+
| `placeholder` | `string` | no | |
|
|
99
|
+
| `required` | `boolean` | no | |
|
|
100
|
+
| `size` | `"lg" \| "med" \| "sm"` | no | |
|
|
101
|
+
| `step` | `number` | no | |
|
|
102
|
+
| `style` | `CSSProperties` | no | |
|
|
103
|
+
| `value` | `number` | no | |
|
|
104
|
+
|
|
105
|
+
Also accepts the style props (see `manifest.json` `styleProps`).
|
package/dist/docs/TextField.md
CHANGED
|
@@ -13,7 +13,7 @@ A form field for one line of text that is not a search: an `<input>` (role `text
|
|
|
13
13
|
|
|
14
14
|
- A query that searches or filters: use `SearchField`; it is announced as a search and has a clear button.
|
|
15
15
|
- Several lines of text (a reply, a note, a description): use `Textarea`.
|
|
16
|
-
- A number
|
|
16
|
+
- A bounded number the user steps up or down (a cap, a count, a quantity): use `NumberField`. A number nobody steps (a postcode, a phone number) stays a `TextField` with `inputMode` in `inputProps`.
|
|
17
17
|
- Picking from a known list as the user types: use `Combobox`.
|
|
18
18
|
- Picking one or several values from a list: use `MultiSelect` or `ChipGroup`.
|
|
19
19
|
- A colour: use `ColorField`; it pairs the hex with the browser's colour picker.
|
package/dist/docs/Tooltip.md
CHANGED
|
@@ -30,7 +30,7 @@ A short hint about a control that shows on hover after a delay and at once on ke
|
|
|
30
30
|
- Wrap a group of triggers (a toolbar, a row of status pills) in `Tooltip.Provider`: once one tooltip has opened, the next opens at once as the pointer moves along. Pass `delay` to the provider to change the group's.
|
|
31
31
|
- Children with a string or number among them (`{failed} of {total} checks failed`, a sentence with a `<strong>`) render in one `Text size="sm"`. Anything else renders as given: a lone `<strong>`, a fragment or a component that returns text needs its own `Text size="sm"`. For rows, pass `Stack` and `Inline` with `Text size="sm"` and no bare text; they are read as one description, so keep them few.
|
|
32
32
|
- `side` (`top` by default) and `align` (`center`) place the popup against the trigger; it flips when it would overflow the viewport, and never grows wider than the space beside the trigger.
|
|
33
|
-
- Fill (`backgroundColor`, `bgRaised`), `borderRadius` (`
|
|
33
|
+
- Fill (`backgroundColor`, `bgRaised`), `borderRadius` (`xs`), `boxShadow` (`med`), `paddingBlock` (`4`) and `paddingInline` (`8`) are default style props on the popup: pass one to change it.
|
|
34
34
|
- The popup portals into the trigger's nearest `ThemeProvider`, so it keeps the brand and mode, and sits on `zIndex` `tooltip`, above popovers and dialogs. That provider must not clip its content (see Menu).
|
|
35
35
|
- Never add key handlers or `tabIndex` to the parts; Base UI handles the keyboard.
|
|
36
36
|
- The module has no hooks, so a server component can render the parts; `onOpenChange` must come from a client component.
|
|
@@ -39,7 +39,7 @@ A short hint about a control that shows on hover after a delay and at once on ke
|
|
|
39
39
|
|
|
40
40
|
```tsx
|
|
41
41
|
<Tooltip>
|
|
42
|
-
<Tooltip.Trigger borderRadius="
|
|
42
|
+
<Tooltip.Trigger borderRadius="xs" paddingInline="4">
|
|
43
43
|
<Badge variant="danger">Checks failed</Badge>
|
|
44
44
|
</Tooltip.Trigger>
|
|
45
45
|
<Tooltip.Popup>2 of 5 checks failed on the last push</Tooltip.Popup>
|
|
@@ -57,7 +57,7 @@ A short hint about a control that shows on hover after a delay and at once on ke
|
|
|
57
57
|
|
|
58
58
|
```tsx
|
|
59
59
|
<Tooltip>
|
|
60
|
-
<Tooltip.Trigger borderRadius="
|
|
60
|
+
<Tooltip.Trigger borderRadius="xs">
|
|
61
61
|
<Text as="span" size="sm">
|
|
62
62
|
Running 12m
|
|
63
63
|
</Text>
|
package/dist/docs/llms.txt
CHANGED
|
@@ -30,6 +30,7 @@
|
|
|
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
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.
|
|
33
|
+
- [NumberField](NumberField.md): A form field for a bounded number: a text input between a decrement button (inline start) and an increment button (inline end), with the number centred between them. Built on Base UI's `NumberField` (ADR 0003, 0161); 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 input fills the Field's width.
|
|
33
34
|
- [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).
|
|
34
35
|
- [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`.
|
|
35
36
|
- [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).
|
package/dist/docs/manifest.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "./manifest.schema.json",
|
|
3
3
|
"package": "@jonmilner/ui",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.17.0",
|
|
5
5
|
"components": [
|
|
6
6
|
{
|
|
7
7
|
"name": "AlertDialog",
|
|
@@ -1920,6 +1920,119 @@
|
|
|
1920
1920
|
],
|
|
1921
1921
|
"exports": []
|
|
1922
1922
|
},
|
|
1923
|
+
{
|
|
1924
|
+
"name": "NumberField",
|
|
1925
|
+
"styleProps": true,
|
|
1926
|
+
"props": [
|
|
1927
|
+
{
|
|
1928
|
+
"name": "className",
|
|
1929
|
+
"type": "string",
|
|
1930
|
+
"required": false
|
|
1931
|
+
},
|
|
1932
|
+
{
|
|
1933
|
+
"name": "decrementLabel",
|
|
1934
|
+
"type": "string",
|
|
1935
|
+
"required": false
|
|
1936
|
+
},
|
|
1937
|
+
{
|
|
1938
|
+
"name": "defaultValue",
|
|
1939
|
+
"type": "number",
|
|
1940
|
+
"required": false
|
|
1941
|
+
},
|
|
1942
|
+
{
|
|
1943
|
+
"name": "description",
|
|
1944
|
+
"type": "ReactNode",
|
|
1945
|
+
"required": false
|
|
1946
|
+
},
|
|
1947
|
+
{
|
|
1948
|
+
"name": "disabled",
|
|
1949
|
+
"type": "boolean",
|
|
1950
|
+
"required": false
|
|
1951
|
+
},
|
|
1952
|
+
{
|
|
1953
|
+
"name": "error",
|
|
1954
|
+
"type": "ReactNode",
|
|
1955
|
+
"required": false
|
|
1956
|
+
},
|
|
1957
|
+
{
|
|
1958
|
+
"name": "hideLabel",
|
|
1959
|
+
"type": "boolean",
|
|
1960
|
+
"required": false
|
|
1961
|
+
},
|
|
1962
|
+
{
|
|
1963
|
+
"name": "incrementLabel",
|
|
1964
|
+
"type": "string",
|
|
1965
|
+
"required": false
|
|
1966
|
+
},
|
|
1967
|
+
{
|
|
1968
|
+
"name": "inputProps",
|
|
1969
|
+
"type": "NumberFieldInputProps",
|
|
1970
|
+
"required": false
|
|
1971
|
+
},
|
|
1972
|
+
{
|
|
1973
|
+
"name": "label",
|
|
1974
|
+
"type": "ReactNode",
|
|
1975
|
+
"required": true
|
|
1976
|
+
},
|
|
1977
|
+
{
|
|
1978
|
+
"name": "max",
|
|
1979
|
+
"type": "number",
|
|
1980
|
+
"required": false
|
|
1981
|
+
},
|
|
1982
|
+
{
|
|
1983
|
+
"name": "min",
|
|
1984
|
+
"type": "number",
|
|
1985
|
+
"required": false
|
|
1986
|
+
},
|
|
1987
|
+
{
|
|
1988
|
+
"name": "name",
|
|
1989
|
+
"type": "string",
|
|
1990
|
+
"required": false
|
|
1991
|
+
},
|
|
1992
|
+
{
|
|
1993
|
+
"name": "onValueChange",
|
|
1994
|
+
"type": "((value: number | null) => void)",
|
|
1995
|
+
"required": false
|
|
1996
|
+
},
|
|
1997
|
+
{
|
|
1998
|
+
"name": "placeholder",
|
|
1999
|
+
"type": "string",
|
|
2000
|
+
"required": false
|
|
2001
|
+
},
|
|
2002
|
+
{
|
|
2003
|
+
"name": "required",
|
|
2004
|
+
"type": "boolean",
|
|
2005
|
+
"required": false
|
|
2006
|
+
},
|
|
2007
|
+
{
|
|
2008
|
+
"name": "size",
|
|
2009
|
+
"type": "\"lg\" | \"med\" | \"sm\"",
|
|
2010
|
+
"required": false,
|
|
2011
|
+
"values": [
|
|
2012
|
+
"lg",
|
|
2013
|
+
"med",
|
|
2014
|
+
"sm"
|
|
2015
|
+
]
|
|
2016
|
+
},
|
|
2017
|
+
{
|
|
2018
|
+
"name": "step",
|
|
2019
|
+
"type": "number",
|
|
2020
|
+
"required": false
|
|
2021
|
+
},
|
|
2022
|
+
{
|
|
2023
|
+
"name": "style",
|
|
2024
|
+
"type": "CSSProperties",
|
|
2025
|
+
"required": false
|
|
2026
|
+
},
|
|
2027
|
+
{
|
|
2028
|
+
"name": "value",
|
|
2029
|
+
"type": "number",
|
|
2030
|
+
"required": false
|
|
2031
|
+
}
|
|
2032
|
+
],
|
|
2033
|
+
"parts": [],
|
|
2034
|
+
"exports": []
|
|
2035
|
+
},
|
|
1923
2036
|
{
|
|
1924
2037
|
"name": "RadioGroup",
|
|
1925
2038
|
"styleProps": true,
|
|
@@ -3475,7 +3588,7 @@
|
|
|
3475
3588
|
},
|
|
3476
3589
|
{
|
|
3477
3590
|
"name": "borderRadius",
|
|
3478
|
-
"type": "\"full\" | \"lg\" | \"med\" | \"none\" | \"sm\" | \"xl\"",
|
|
3591
|
+
"type": "\"full\" | \"lg\" | \"med\" | \"none\" | \"sm\" | \"xl\" | \"xs\"",
|
|
3479
3592
|
"required": false,
|
|
3480
3593
|
"values": [
|
|
3481
3594
|
"full",
|
|
@@ -3483,7 +3596,8 @@
|
|
|
3483
3596
|
"med",
|
|
3484
3597
|
"none",
|
|
3485
3598
|
"sm",
|
|
3486
|
-
"xl"
|
|
3599
|
+
"xl",
|
|
3600
|
+
"xs"
|
|
3487
3601
|
]
|
|
3488
3602
|
},
|
|
3489
3603
|
{
|
|
@@ -4144,6 +4258,7 @@
|
|
|
4144
4258
|
"InfoIcon",
|
|
4145
4259
|
"LoaderCircleIcon",
|
|
4146
4260
|
"LockOpenIcon",
|
|
4261
|
+
"MinusIcon",
|
|
4147
4262
|
"PanelLeftCloseIcon",
|
|
4148
4263
|
"PanelLeftOpenIcon",
|
|
4149
4264
|
"PencilIcon",
|
|
@@ -4184,6 +4299,7 @@
|
|
|
4184
4299
|
"container.page": "var(--container-page)",
|
|
4185
4300
|
"container.wide": "var(--container-wide)",
|
|
4186
4301
|
"radius.none": "var(--radius-none)",
|
|
4302
|
+
"radius.xs": "var(--radius-xs)",
|
|
4187
4303
|
"radius.sm": "var(--radius-sm)",
|
|
4188
4304
|
"radius.med": "var(--radius-med)",
|
|
4189
4305
|
"radius.lg": "var(--radius-lg)",
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# 0.17.0
|
|
2
|
+
|
|
3
|
+
The radius scale gains a 6px step (decision 0162): `xs` is 4px, the old `sm`, and `sm` is now 6px. An app that passes `sm` still type-checks but its corners grow from 4px to 6px. Library components look the same.
|
|
4
|
+
|
|
5
|
+
## Find
|
|
6
|
+
|
|
7
|
+
In every source and style file the app owns (`*.ts`, `*.tsx`, `*.js`, `*.jsx`, `*.mjs`, `*.cjs`, `*.mdx`, `*.css`, `*.scss`):
|
|
8
|
+
|
|
9
|
+
- The style prop, as a JSX prop, an object key or a default parameter (`borderRadius = "sm"`): regex `borderRadius\s*[=:]\s*\{?\s*["']sm["']`.
|
|
10
|
+
- The token, by dot or bracket: regex `radius(\.sm\b|\[\s*["']sm["']\s*\])`.
|
|
11
|
+
- The CSS variable, in CSS or inside a string: regex `--radius-sm\b`.
|
|
12
|
+
- A conditional or computed value on a radius line (`borderRadius={dense ? "sm" : "med"}`): regex `[Rr]adius.*["']sm["']`. It also matches lines where `sm` is another prop's value, such as `size="sm"`; skip those.
|
|
13
|
+
- A value that reaches the radius through a variable or the app's own prop (`const r = "sm"; <Box borderRadius={r} />`): no regex finds it. Review each `"sm"` the app passes on to a `borderRadius`.
|
|
14
|
+
|
|
15
|
+
## Replace
|
|
16
|
+
|
|
17
|
+
Rename each match to `xs`, which is the same 4px:
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
// before
|
|
21
|
+
<Box borderRadius="sm" />;
|
|
22
|
+
function Pill({ borderRadius = "sm" }) {}
|
|
23
|
+
style({ borderRadius: vars.radius.sm });
|
|
24
|
+
// after
|
|
25
|
+
<Box borderRadius="xs" />;
|
|
26
|
+
function Pill({ borderRadius = "xs" }) {}
|
|
27
|
+
style({ borderRadius: vars.radius.xs });
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
```css
|
|
31
|
+
/* before */
|
|
32
|
+
border-radius: var(--radius-sm);
|
|
33
|
+
/* after */
|
|
34
|
+
border-radius: var(--radius-xs);
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Verify
|
|
38
|
+
|
|
39
|
+
From the app's root, this prints nothing, or only lines where `sm` is not a radius:
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
grep -rnE --include='*.ts' --include='*.tsx' --include='*.js' --include='*.jsx' --include='*.mjs' --include='*.cjs' --include='*.mdx' --include='*.css' --include='*.scss' \
|
|
43
|
+
-e 'borderRadius\s*[=:]\s*\{?\s*["'"'"']sm["'"'"']' -e 'radius(\.sm\b|\[\s*["'"'"']sm["'"'"']\s*\])' -e '--radius-sm\b' -e '[Rr]adius.*["'"'"']sm["'"'"']' \
|
|
44
|
+
--exclude-dir=node_modules --exclude-dir=dist .
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Then the app's visual baselines pass unchanged.
|
package/dist/docs/theming.md
CHANGED
|
@@ -58,6 +58,10 @@ Three overlay roles lay a tint over whatever surface is under them: `hover` for
|
|
|
58
58
|
- **Each change gets its own `href`.** The `href` hashes the CSS, so a theme rebuilt with new colors replaces the old one instead of being deduped away.
|
|
59
59
|
- Under forced colors, every role maps to a system color, as for presets.
|
|
60
60
|
|
|
61
|
+
## Radius
|
|
62
|
+
|
|
63
|
+
`vars.radius` (CSS variables `--radius-*`, and the `borderRadius` style prop) has seven steps: `none` 0, `xs` 4px, `sm` 6px, `med` 8px, `lg` 12px, `xl` 16px and `full`. Override a component's radius with its `borderRadius` prop. Each component role is moving to one step at every size: `xs` for badges, tags, tooltips and rows inside a menu or list, `sm` for controls (buttons and fields), `med` for menus, listboxes and toasts, `lg` for cards and dialogs, `full` for avatars, switches and radios. In this release badges, tooltips, rows, popups, dialogs and the `full` shapes already match; Button and IconButton are still `full`, fields and select triggers `med`, and Tag `lg`, until later releases move them.
|
|
64
|
+
|
|
61
65
|
## The page canvas
|
|
62
66
|
|
|
63
67
|
A provider's `color-scheme` stops at its `div`, so the page canvas and scrollbars stay light in dark mode. Set it on `:root` too, matching the outer provider's mode:
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Icon as e } from "../Icon/index.mjs";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
// src/icons/MinusIcon.tsx
|
|
4
|
+
function n(n) {
|
|
5
|
+
return /* @__PURE__ */ t(e, {
|
|
6
|
+
...n,
|
|
7
|
+
children: /* @__PURE__ */ t("path", { d: "M5 12h14" })
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
export { n as MinusIcon };
|
package/dist/icons/index.d.mts
CHANGED
|
@@ -18,6 +18,7 @@ import { GitPullRequestIcon } from "./GitPullRequestIcon.mjs";
|
|
|
18
18
|
import { InboxIcon } from "./InboxIcon.mjs";
|
|
19
19
|
import { LoaderCircleIcon } from "./LoaderCircleIcon.mjs";
|
|
20
20
|
import { LockOpenIcon } from "./LockOpenIcon.mjs";
|
|
21
|
+
import { MinusIcon } from "./MinusIcon.mjs";
|
|
21
22
|
import { PanelLeftCloseIcon } from "./PanelLeftCloseIcon.mjs";
|
|
22
23
|
import { PanelLeftOpenIcon } from "./PanelLeftOpenIcon.mjs";
|
|
23
24
|
import { PencilIcon } from "./PencilIcon.mjs";
|
|
@@ -29,6 +30,6 @@ import { SearchIcon } from "./SearchIcon.mjs";
|
|
|
29
30
|
import { SettingsIcon } from "./SettingsIcon.mjs";
|
|
30
31
|
import { Trash2Icon } from "./Trash2Icon.mjs";
|
|
31
32
|
import { XIcon } from "./XIcon.mjs";
|
|
32
|
-
export declare const iconNames: readonly ["ArrowDownIcon", "ArrowLeftIcon", "ArrowRightIcon", "ArrowUpIcon", "CheckIcon", "ChevronDownIcon", "ChevronRightIcon", "CircleAlertIcon", "CircleCheckIcon", "CircleDotIcon", "CircleSlashIcon", "EllipsisIcon", "GitMergeIcon", "GitPullRequestClosedIcon", "GitPullRequestDraftIcon", "GitPullRequestIcon", "InboxIcon", "InfoIcon", "LoaderCircleIcon", "LockOpenIcon", "PanelLeftCloseIcon", "PanelLeftOpenIcon", "PencilIcon", "PlayIcon", "PlusIcon", "RefreshCwIcon", "ReplyIcon", "SearchIcon", "SettingsIcon", "Trash2Icon", "XIcon"];
|
|
33
|
+
export declare const iconNames: readonly ["ArrowDownIcon", "ArrowLeftIcon", "ArrowRightIcon", "ArrowUpIcon", "CheckIcon", "ChevronDownIcon", "ChevronRightIcon", "CircleAlertIcon", "CircleCheckIcon", "CircleDotIcon", "CircleSlashIcon", "EllipsisIcon", "GitMergeIcon", "GitPullRequestClosedIcon", "GitPullRequestDraftIcon", "GitPullRequestIcon", "InboxIcon", "InfoIcon", "LoaderCircleIcon", "LockOpenIcon", "MinusIcon", "PanelLeftCloseIcon", "PanelLeftOpenIcon", "PencilIcon", "PlayIcon", "PlusIcon", "RefreshCwIcon", "ReplyIcon", "SearchIcon", "SettingsIcon", "Trash2Icon", "XIcon"];
|
|
33
34
|
export type IconName = (typeof iconNames)[number];
|
|
34
|
-
export { ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, CheckIcon, ChevronDownIcon, ChevronRightIcon, CircleAlertIcon, CircleCheckIcon, CircleDotIcon, CircleSlashIcon, EllipsisIcon, GitMergeIcon, GitPullRequestClosedIcon, GitPullRequestDraftIcon, GitPullRequestIcon, InboxIcon, InfoIcon, LoaderCircleIcon, LockOpenIcon, PanelLeftCloseIcon, PanelLeftOpenIcon, PencilIcon, PlayIcon, PlusIcon, RefreshCwIcon, ReplyIcon, SearchIcon, SettingsIcon, Trash2Icon, XIcon };
|
|
35
|
+
export { ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, CheckIcon, ChevronDownIcon, ChevronRightIcon, CircleAlertIcon, CircleCheckIcon, CircleDotIcon, CircleSlashIcon, EllipsisIcon, GitMergeIcon, GitPullRequestClosedIcon, GitPullRequestDraftIcon, GitPullRequestIcon, InboxIcon, InfoIcon, LoaderCircleIcon, LockOpenIcon, MinusIcon, PanelLeftCloseIcon, PanelLeftOpenIcon, PencilIcon, PlayIcon, PlusIcon, RefreshCwIcon, ReplyIcon, SearchIcon, SettingsIcon, Trash2Icon, XIcon };
|