@jonmilner/ui 0.15.0 → 0.16.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.
Files changed (61) hide show
  1. package/dist/Avatar/Avatar.css +1 -1
  2. package/dist/Badge/Badge.css +1 -1
  3. package/dist/Box/Box.css +1 -1
  4. package/dist/Button/Button.css +1 -1
  5. package/dist/Checkbox/Checkbox.css +1 -1
  6. package/dist/Chip/Chip.css +1 -1
  7. package/dist/Clickable/Clickable.css +1 -1
  8. package/dist/ColorField/ColorField.css +1 -1
  9. package/dist/Combobox/Combobox.css +2 -2
  10. package/dist/Dialog/Dialog.css +1 -1
  11. package/dist/Field/Field.css +1 -1
  12. package/dist/Heading/Heading.css +1 -1
  13. package/dist/Icon/Icon.css +1 -1
  14. package/dist/IconButton/IconButton.css +1 -1
  15. package/dist/Inline/Inline.css +1 -1
  16. package/dist/Menu/Menu.css +1 -1
  17. package/dist/MultiSelect/MultiSelect.css +2 -2
  18. package/dist/NavList/NavList.css +2 -2
  19. package/dist/NavList/NavList.css.mjs +2 -2
  20. package/dist/NavList/client.mjs +36 -0
  21. package/dist/NavList/index.mjs +78 -57
  22. package/dist/RadioGroup/RadioGroup.css +1 -1
  23. package/dist/SearchField/SearchField.css +1 -1
  24. package/dist/Select/Select.css +1 -1
  25. package/dist/Sidebar/Sidebar.css +1 -1
  26. package/dist/SidebarLayout/SidebarLayout.css +1 -1
  27. package/dist/Stack/Stack.css +1 -1
  28. package/dist/Switch/Switch.css +1 -1
  29. package/dist/Table/Table.css +1 -1
  30. package/dist/Tabs/Tabs.css +1 -1
  31. package/dist/Tag/Tag.css +1 -1
  32. package/dist/Text/Text.css +2 -2
  33. package/dist/Text/Text.css.mjs +30 -30
  34. package/dist/Text/index.mjs +5 -4
  35. package/dist/TextField/TextField.css +1 -1
  36. package/dist/Textarea/Textarea.css +1 -1
  37. package/dist/Toast/Toast.css +1 -1
  38. package/dist/Tooltip/Tooltip.css +1 -1
  39. package/dist/Tooltip/base.d.mts +4 -0
  40. package/dist/Tooltip/base.mjs +38 -0
  41. package/dist/Tooltip/client.d.mts +0 -2
  42. package/dist/Tooltip/client.mjs +15 -77
  43. package/dist/Tooltip/index.d.mts +4 -8
  44. package/dist/Tooltip/index.mjs +12 -43
  45. package/dist/VisuallyHidden/VisuallyHidden.css +1 -1
  46. package/dist/base.css +1 -1
  47. package/dist/docs/NavList.md +4 -4
  48. package/dist/docs/Sidebar.md +1 -1
  49. package/dist/docs/Text.md +8 -7
  50. package/dist/docs/llms.txt +1 -1
  51. package/dist/docs/manifest.json +1 -1
  52. package/dist/docs/migrations/0.16.0.md +57 -0
  53. package/dist/index.d.mts +2 -1
  54. package/dist/popup/tooltip.d.mts +6 -0
  55. package/dist/popup/tooltip.mjs +81 -0
  56. package/dist/styles/atoms.css +1 -1
  57. package/dist/styles/custom-property.mjs +3 -0
  58. package/dist/styles/layers.css +1 -1
  59. package/dist/styles/responsive.css +1 -1
  60. package/dist/theme/define-theme.mjs +43 -42
  61. package/package.json +4 -2
@@ -3,35 +3,35 @@ import "./Text.css";
3
3
  /* empty css */
4
4
  /* empty css */
5
5
  // src/Text/Text.css.ts
6
- var e = "_1mgdisq4", t = "_1mgdisq5", n = "_1mgdisq6", r = {
7
- body: "_1mgdisq7",
8
- heading: "_1mgdisq8",
9
- display: "_1mgdisq9",
10
- label: "_1mgdisqa",
11
- mono: "_1mgdisqb"
12
- }, i = {
13
- xs: "_1mgdisqc",
14
- sm: "_1mgdisqd",
15
- med: "_1mgdisqe",
16
- lg: "_1mgdisqf",
17
- xl: "_1mgdisqg",
18
- "2xl": "_1mgdisqh",
19
- "3xl": "_1mgdisqi",
20
- "4xl": "_1mgdisqj"
6
+ var e = "_1mgdisq4", t = "_1mgdisq5", n = "_1mgdisq6", r = "_1mgdisq7", i = {
7
+ body: "_1mgdisq8",
8
+ heading: "_1mgdisq9",
9
+ display: "_1mgdisqa",
10
+ label: "_1mgdisqb",
11
+ mono: "_1mgdisqc"
21
12
  }, a = {
22
- regular: "_1mgdisqk",
23
- medium: "_1mgdisql",
24
- semibold: "_1mgdisqm",
25
- bold: "_1mgdisqn"
13
+ xs: "_1mgdisqd",
14
+ sm: "_1mgdisqe",
15
+ med: "_1mgdisqf",
16
+ lg: "_1mgdisqg",
17
+ xl: "_1mgdisqh",
18
+ "2xl": "_1mgdisqi",
19
+ "3xl": "_1mgdisqj",
20
+ "4xl": "_1mgdisqk"
26
21
  }, o = {
27
- sm: "_1mgdisqo",
28
- meta: "_1mgdisqp",
29
- body: "_1mgdisqq",
30
- med: "_1mgdisqr",
31
- lg: "_1mgdisqs"
32
- }, s = "_1mgdisqt", c = {
33
- nowrap: "_1mgdisqu",
34
- "pre-wrap": "_1mgdisqv",
35
- pre: "_1mgdisqw"
36
- }, l = "_1mgdisqx";
37
- export { t as block, r as font, o as leading, e as root, i as size, s as tabularNums, l as truncate, n as truncateBox, a as weight, c as wrap };
22
+ regular: "_1mgdisql",
23
+ medium: "_1mgdisqm",
24
+ semibold: "_1mgdisqn",
25
+ bold: "_1mgdisqo"
26
+ }, s = {
27
+ sm: "_1mgdisqp",
28
+ meta: "_1mgdisqq",
29
+ body: "_1mgdisqr",
30
+ med: "_1mgdisqs",
31
+ lg: "_1mgdisqt"
32
+ }, c = "_1mgdisqu", l = {
33
+ nowrap: "_1mgdisqv",
34
+ "pre-wrap": "_1mgdisqw",
35
+ pre: "_1mgdisqx"
36
+ }, u = "_1mgdisqy";
37
+ export { t as block, i as font, s as leading, e as root, n as scrollContainer, a as size, c as tabularNums, u as truncate, r as truncateBox, o as weight, l as wrap };
@@ -3,18 +3,19 @@ import { Box as t } from "../Box/base.mjs";
3
3
  import { font as n, leading as r, root as i, size as a, weight as o, wrap as s } from "./Text.css.mjs";
4
4
  import { jsx as c } from "react/jsx-runtime";
5
5
  // src/Text/index.tsx
6
- function l({ as: l, size: u, font: d, weight: f, leading: p, tabularNums: m, truncate: h, wrap: g, display: _ = "block", overflow: v = h ? "hidden" : void 0, className: y, ...b }) {
6
+ function l({ as: l, size: u, font: d, weight: f, leading: p, tabularNums: m, truncate: h, wrap: g, display: _ = "block", overflow: v = h ? "clip" : void 0, className: y, ...b }) {
7
7
  let x = [
8
8
  i,
9
9
  _ === "block" && "_1mgdisq5",
10
- h === "box" && "_1mgdisq6",
10
+ h === "box" && "_1mgdisq7",
11
+ h !== "box" && (v === "hidden" || v === "auto") && "_1mgdisq6",
11
12
  d && n[d],
12
13
  u && a[u],
13
14
  f && o[f],
14
15
  p && r[p],
15
- m && "_1mgdisqt",
16
+ m && "_1mgdisqu",
16
17
  g && !h && s[g],
17
- h === !0 && "_1mgdisqx",
18
+ h === !0 && "_1mgdisqy",
18
19
  y
19
20
  ];
20
21
  return /* @__PURE__ */ c(t, {
@@ -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.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;
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
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.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;
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
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}}}
@@ -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.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;
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
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}}}
@@ -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.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;
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
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}}
@@ -0,0 +1,4 @@
1
+ import { PartProps } from "../styles/part-props.mjs";
2
+ import { Tooltip } from "@base-ui/react/tooltip";
3
+ export type TooltipPopupProps = Omit<PartProps<Tooltip.Popup.Props>, "id" | "role"> & Pick<Tooltip.Positioner.Props, "side" | "align">;
4
+ export declare function TooltipPopup({ side, align, backgroundColor, borderRadius, boxShadow, paddingBlock, paddingInline, className, style, children, ...props }: TooltipPopupProps): import("react").JSX.Element;
@@ -0,0 +1,38 @@
1
+ import { join as e } from "../styles/join.mjs";
2
+ import { splitStyleProps as t } from "../styles/split-style-props.mjs";
3
+ import { Box as n } from "../Box/base.mjs";
4
+ import { Text as r } from "../Text/index.mjs";
5
+ import { TooltipPopupPart as i, TooltipPortal as a, TooltipPositioner as o } from "../popup/tooltip.mjs";
6
+ import { popup as s, positioner as c } from "./Tooltip.css.mjs";
7
+ import { Children as l } from "react";
8
+ import { jsx as u } from "react/jsx-runtime";
9
+ // src/Tooltip/base.tsx
10
+ function d({ side: r = "top", align: l = "center", backgroundColor: d = "bgRaised", borderRadius: p = "sm", boxShadow: m = "med", paddingBlock: h = "4", paddingInline: g = "8", className: _, style: v, children: y, ...b }) {
11
+ let [x, S] = t(b);
12
+ return /* @__PURE__ */ u(a, { children: /* @__PURE__ */ u(o, {
13
+ align: l,
14
+ className: c,
15
+ side: r,
16
+ children: /* @__PURE__ */ u(i, {
17
+ ...S,
18
+ render: /* @__PURE__ */ u(n, {
19
+ backgroundColor: d,
20
+ borderRadius: p,
21
+ boxShadow: m,
22
+ paddingBlock: h,
23
+ paddingInline: g,
24
+ ...x,
25
+ className: e(s, _),
26
+ style: v
27
+ }),
28
+ children: f(y)
29
+ })
30
+ }) });
31
+ }
32
+ function f(e) {
33
+ return l.toArray(e).some((e) => typeof e == "string" || typeof e == "number") ? /* @__PURE__ */ u(r, {
34
+ size: "sm",
35
+ children: e
36
+ }) : e;
37
+ }
38
+ export { d as TooltipPopup };
@@ -1,6 +1,4 @@
1
1
  import { TriggerElementProps, TriggerLookProps } from "../popup/client.mjs";
2
- import "./index.mjs";
3
- import { ReactNode } from "react";
4
2
  import { Tooltip } from "@base-ui/react/tooltip";
5
3
  type TriggerOwnProps = Pick<Tooltip.Trigger.Props, "delay" | "closeDelay">;
6
4
  export type TooltipTriggerProps = TriggerOwnProps & TriggerLookProps & Omit<TriggerElementProps, keyof TriggerLookProps | keyof TriggerOwnProps>;
@@ -1,82 +1,20 @@
1
1
  "use client";
2
- import { join as e } from "../styles/join.mjs";
3
- import { splitStyleProps as t } from "../styles/split-style-props.mjs";
4
- import { Box as n } from "../Box/base.mjs";
5
- import { triggerElement as r } from "../popup/client.mjs";
6
- import { positioner as i } from "./Tooltip.css.mjs";
7
- import { createContext as a, use as o, useCallback as s, useId as c, useMemo as l, useState as u } from "react";
8
- import { jsx as d } from "react/jsx-runtime";
9
- import { Tooltip as f } from "@base-ui/react/tooltip";
2
+ import { triggerElement as e } from "../popup/client.mjs";
3
+ import { TooltipLink as t } from "../popup/tooltip.mjs";
4
+ import { use as n } from "react";
5
+ import { jsx as r } from "react/jsx-runtime";
6
+ import { Tooltip as i } from "@base-ui/react/tooltip";
10
7
  // src/Tooltip/client.tsx
11
- var p = a({
12
- attach: () => {},
13
- container: null,
14
- id: void 0
15
- });
16
- function m({ children: e, ...t }) {
17
- let n = c(), [r, i] = u(null), a = s((e) => {
18
- e && i(e.closest("[data-brand]") ?? e.ownerDocument.body);
19
- }, []), o = l(() => ({
20
- id: t.disabled ? void 0 : n,
21
- container: r,
22
- attach: a
23
- }), [
24
- t.disabled,
25
- n,
26
- r,
27
- a
28
- ]);
29
- return /* @__PURE__ */ d(p, {
30
- value: o,
31
- children: /* @__PURE__ */ d(f.Root, {
32
- ...t,
33
- children: e
8
+ function a({ delay: a, closeDelay: o, ...s }) {
9
+ let { id: c, attach: l } = n(t), u = s["aria-describedby"];
10
+ return /* @__PURE__ */ r(i.Trigger, {
11
+ delay: a,
12
+ closeDelay: o,
13
+ ref: l,
14
+ render: e({
15
+ ...s,
16
+ "aria-describedby": [c, u].filter(Boolean).join(" ") || void 0
34
17
  })
35
18
  });
36
19
  }
37
- function h({ delay: e, closeDelay: t, ...n }) {
38
- let { id: i, attach: a } = o(p), s = n["aria-describedby"];
39
- return /* @__PURE__ */ d(f.Trigger, {
40
- delay: e,
41
- closeDelay: t,
42
- ref: a,
43
- render: r({
44
- ...n,
45
- "aria-describedby": [i, s].filter(Boolean).join(" ") || void 0
46
- })
47
- });
48
- }
49
- function g({ children: e }) {
50
- let { container: t } = o(p);
51
- return /* @__PURE__ */ d(f.Portal, {
52
- container: t,
53
- keepMounted: !0,
54
- children: e
55
- });
56
- }
57
- function _(e) {
58
- return /* @__PURE__ */ d(f.Positioner, {
59
- ...e,
60
- collisionPadding: 8,
61
- render: (e) => {
62
- let [, n] = t(e);
63
- return /* @__PURE__ */ d(v, { ...n });
64
- },
65
- sideOffset: 4
66
- });
67
- }
68
- function v({ className: t, ...r }) {
69
- return /* @__PURE__ */ d(n, {
70
- ...r,
71
- className: e(i, t),
72
- zIndex: "tooltip"
73
- });
74
- }
75
- function y(e) {
76
- return /* @__PURE__ */ d(f.Popup, {
77
- ...e,
78
- id: o(p).id,
79
- role: "tooltip"
80
- });
81
- }
82
- export { y as TooltipPopupPart, g as TooltipPortal, _ as TooltipPositioner, m as TooltipRootScope, h as TooltipTrigger };
20
+ export { a as TooltipTrigger };
@@ -1,17 +1,13 @@
1
- import { PartProps } from "../styles/part-props.mjs";
1
+ import { TooltipRootScopeProps } from "../popup/tooltip.mjs";
2
+ import { TooltipPopup, TooltipPopupProps } from "./base.mjs";
2
3
  import { TooltipTrigger, TooltipTriggerProps } from "./client.mjs";
3
- import { ReactNode } from "react";
4
4
  import { Tooltip as Tooltip$1 } from "@base-ui/react/tooltip";
5
- export type TooltipProps = Pick<Tooltip$1.Root.Props, "open" | "defaultOpen" | "onOpenChange" | "disabled"> & {
6
- children?: ReactNode;
7
- };
8
- export type TooltipPopupProps = Omit<PartProps<Tooltip$1.Popup.Props>, "id" | "role"> & Pick<Tooltip$1.Positioner.Props, "side" | "align">;
5
+ export type TooltipProps = Omit<TooltipRootScopeProps, "describes">;
9
6
  export type TooltipProviderProps = Tooltip$1.Provider.Props;
10
7
  declare function TooltipRoot(props: TooltipProps): import("react").JSX.Element;
11
- declare function TooltipPopup({ side, align, backgroundColor, borderRadius, boxShadow, paddingBlock, paddingInline, className, style, children, ...props }: TooltipPopupProps): import("react").JSX.Element;
12
8
  export declare const Tooltip: typeof TooltipRoot & {
13
9
  Trigger: typeof TooltipTrigger;
14
10
  Popup: typeof TooltipPopup;
15
11
  Provider: import("react").FC<import("@base-ui/react").TooltipProviderProps>;
16
12
  };
17
- export type { TooltipTriggerProps };
13
+ export type { TooltipPopupProps, TooltipTriggerProps };
@@ -1,46 +1,15 @@
1
- import { join as e } from "../styles/join.mjs";
2
- import { splitStyleProps as t } from "../styles/split-style-props.mjs";
3
- import { Box as n } from "../Box/base.mjs";
4
- import { Text as r } from "../Text/index.mjs";
5
- import { popup as i } from "./Tooltip.css.mjs";
6
- import { TooltipPopupPart as a, TooltipPortal as o, TooltipPositioner as s, TooltipRootScope as c, TooltipTrigger as l } from "./client.mjs";
7
- import { Children as u } from "react";
8
- import { jsx as d } from "react/jsx-runtime";
9
- import { Tooltip as f } from "@base-ui/react/tooltip";
1
+ import { TooltipRootScope as e } from "../popup/tooltip.mjs";
2
+ import { TooltipPopup as t } from "./base.mjs";
3
+ import { TooltipTrigger as n } from "./client.mjs";
4
+ import { jsx as r } from "react/jsx-runtime";
5
+ import { Tooltip as i } from "@base-ui/react/tooltip";
10
6
  // src/Tooltip/index.tsx
11
- function p(e) {
12
- return /* @__PURE__ */ d(c, { ...e });
7
+ function a(t) {
8
+ return /* @__PURE__ */ r(e, { ...t });
13
9
  }
14
- function m({ side: r = "top", align: c = "center", backgroundColor: l = "bgRaised", borderRadius: u = "sm", boxShadow: f = "med", paddingBlock: p = "4", paddingInline: m = "8", className: g, style: _, children: v, ...y }) {
15
- let [b, x] = t(y);
16
- return /* @__PURE__ */ d(o, { children: /* @__PURE__ */ d(s, {
17
- align: c,
18
- side: r,
19
- children: /* @__PURE__ */ d(a, {
20
- ...x,
21
- render: /* @__PURE__ */ d(n, {
22
- backgroundColor: l,
23
- borderRadius: u,
24
- boxShadow: f,
25
- paddingBlock: p,
26
- paddingInline: m,
27
- ...b,
28
- className: e(i, g),
29
- style: _
30
- }),
31
- children: h(v)
32
- })
33
- }) });
34
- }
35
- function h(e) {
36
- return u.toArray(e).some((e) => typeof e == "string" || typeof e == "number") ? /* @__PURE__ */ d(r, {
37
- size: "sm",
38
- children: e
39
- }) : e;
40
- }
41
- var g = Object.assign(p, {
42
- Trigger: l,
43
- Popup: m,
44
- Provider: f.Provider
10
+ var o = Object.assign(a, {
11
+ Trigger: n,
12
+ Popup: t,
13
+ Provider: i.Provider
45
14
  });
46
- export { g as Tooltip };
15
+ export { o as Tooltip };
@@ -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.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;
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
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,4 +1,4 @@
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;
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
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-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}}}
@@ -22,15 +22,15 @@ A column of links to an app's pages, with the current page marked: a sidebar's o
22
22
 
23
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
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.
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. A custom `as` component must pass its props and `ref` on to the element it renders: the rail tooltip opens from the event handlers and `ref` it adds there. 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
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
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
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. In a SidebarLayout stacked below 48em a collapsed Sidebar is no rail: the items show open (ADR 0156).
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
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.
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
36
36
 
@@ -101,7 +101,7 @@ A column of links to an app's pages, with the current page marked: a sidebar's o
101
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
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
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.
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. The rail tooltip repeats that name for sight only: it is `aria-hidden` and not the link's description, so the name is read once and there is no `aria-describedby`.
105
105
 
106
106
  ## Props
107
107
 
@@ -81,7 +81,7 @@ const [collapsed, setCollapsed] = useState(false);
81
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
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
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.
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 hover or focus shows it in a tooltip (NavList, ADR 0159), so pair the rail with icons or avatars people recognise; on touch there is no hover, and the label shows only to keyboard focus.
85
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
86
  - Logical properties throughout: in a right-to-left page the sidebar, its rule and its toggle's icon mirror.
87
87
 
package/dist/docs/Text.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Purpose
4
4
 
5
- The base of all visible text, and the primitive every text component builds on. Capsize trims the box to the cap height and the baseline, so the gap around text is the visible space. It takes every Box style prop (`color`, `textAlign`, margins), plus `size`, `font`, `weight`, `leading`, `truncate` and `wrap`.
5
+ The base of all visible text, and the primitive every text component builds on. Its box is trimmed to the cap height and the baseline, so the gap around text is the visible space and text sits centred in a padded control. It takes every Box style prop (`color`, `textAlign`, margins), plus `size`, `font`, `weight`, `leading`, `truncate` and `wrap`.
6
6
 
7
7
  ## When to use
8
8
 
@@ -20,7 +20,7 @@ The base of all visible text, and the primitive every text component builds on.
20
20
  - `as` defaults to `p`, so a run inside a paragraph must set an inline element: `as="span"`, `"strong"`, `"em"`, `"code"`, `"time"`. A `p` inside a `p` is invalid HTML and breaks hydration.
21
21
  - A run inherits the outer weight, so `<Text as="strong">` is not bold until it sets `weight="bold"` (or `semibold`).
22
22
  - A run is inline whatever its `display` prop, and `truncate` gives it no ellipsis; truncate a block Text instead.
23
- - `display="flex"` or `"grid"` makes the trim pseudo-elements flex or grid items, so `gap` adds space around them; wrap the text in a Box for layout instead. A block element (`p`, `div`, `h2`) or a Text inside a `Box` inside a Text keeps its own trimmed box.
23
+ - Do not set `display="flex"` or `"grid"`: natively the box is not trimmed, and on the fallback the trim pseudo-elements become flex or grid items that `gap` spaces. Wrap the text in a Box for layout instead. A block element (`p`, `div`, `h2`) or a Text inside a `Box` inside a Text keeps its own trimmed box.
24
24
  - `size` takes a `fontSize` step: `xs`, `sm`, `med`, `lg`, `xl`, `2xl`, `3xl`, `4xl`. The top-level default is `med`.
25
25
  - `font` takes a font role: `body` (default), `heading`, `display`, `label`, `mono`. The brand maps roles to fonts.
26
26
  - `weight` takes `regular` (default), `medium`, `semibold` or `bold`.
@@ -28,16 +28,17 @@ The base of all visible text, and the primitive every text component builds on.
28
28
  - `font` also sets the brand's tracking and font features for the role (the `default` brand tightens Inter by `-0.006em` and turns on `cv11` and `ss03`); a run inherits the outer Text's.
29
29
  - `tabularNums` gives every digit the same width, so figures in a column or a ticking count line up: amounts, durations, counts in a table. Prose numbers keep the font's own figures.
30
30
  - `color` takes a color role (`fg`, `fgMuted`, `accent`, …), never a raw color. Unset, it inherits.
31
- - `truncate` keeps one line and cuts it with an ellipsis, without clipping ascenders or descenders. It sets the block margins, so do not combine it with margin props.
32
- - `truncate="box"` cuts a part of another Text's line (a field's summary inside a button's label) at its own box: untrimmed, in the outer Text's font until its own props say otherwise. Use it only inside another Text, below a Box or element that is not a Text run.
31
+ - `truncate` keeps one line and cuts it with an ellipsis, without clipping ascenders or descenders. It clips with `overflow: clip` and a zero minimum size, so it shrinks in a flex or grid row; that minimum beats a `minInlineSize` or `minBlockSize` prop, so put a minimum on a wrapping Box. It sets the block margins, so do not combine it with margin props.
32
+ - `truncate="box"` cuts a part of another Text's line (a field's summary inside a button's label) at its own box: untrimmed, in the outer Text's font until its own props say otherwise. Use it only inside another Text, below a Box or element that is not a Text run. A block one is a line of the outer Text like any other, so the outer trim cuts it where it is the first or last line; it clips only across, so no glyph is cut. Put it directly in the outer Text or in a block, not in an inline element (Safari trims a block inside an inline wrongly) nor a grid or flex item (where `text-box` is supported, the outer trim does not reach one, so its line stays untrimmed).
33
33
  - `wrap="nowrap"` keeps the text on one line, uncut: a short label that must never break. A long string overflows its box, so cap it with `truncate` instead.
34
34
  - `wrap="pre-wrap"` keeps newlines and runs of spaces and wraps, breaking a long unbroken string (a path, a URL, a hash) anywhere so it stays in its box: logs, commit messages, user-entered text.
35
- - `wrap="pre"` keeps newlines and runs of spaces on unwrapped lines, so a long line overflows its box: aligned output whose columns must not reflow. Text is not a scroll container; where the box cannot grow, use `pre-wrap`.
35
+ - `wrap="pre"` keeps newlines and runs of spaces on unwrapped lines, so a long line overflows its box: aligned output whose columns must not reflow. Where the box cannot grow, use `pre-wrap`.
36
36
  - `truncate` wins over `wrap`: a Text with both keeps one line, collapses whitespace and ignores `wrap`.
37
37
  - Plain wrapped text with a long unbroken string and no whitespace to keep has no `wrap` value; its component sets `overflow-wrap` in its own styles.
38
38
  - A list item's text is a Text directly inside the `li`: `<li><Text>…</Text></li>`. At its default `display`, that Text keeps the marker on its first line at the trimmed height; with another `display` it does not. Do not render the Text as the `li` itself. Trimmed items touch, so space them with the list's `gap`: `<Stack as="ul" gap="8">`. The marker takes the body font, whatever the `li` or the Text's `font` sets; to change it, style `li::marker`.
39
- - The trim is two pseudo-elements; do not style `::before` or `::after` on a Text.
40
- - No native `text-box`; capsize only (ADR 0016).
39
+ - The trim has two paths (ADR 0160). Where the browser supports `text-box: trim-both cap alphabetic`, Text uses it, exact at the engine's own glyph positions. Elsewhere capsize trims with two pseudo-elements from the brand's font metrics, which can sit up to 0.8px off centre. Both give the same box height, so layout does not change between them.
40
+ - Do not style `::before` or `::after` on a Text: the fallback path uses them.
41
+ - To clip a Text, use `truncate` or `overflow="clip"`. At `overflow="hidden"` or `"auto"` it is a scroll container, which Firefox does not trim natively, so Text trims it with the pseudo-elements on both paths; set those through the `overflow` prop, never a class or `style`.
41
42
 
42
43
  ## Do
43
44
 
@@ -40,7 +40,7 @@
40
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.
41
41
  - [Tabs](Tabs.md): Switches between views that share one place on the page. The parts are `Tabs` (the root, a flex column; a row when vertical), `Tabs.List` (the `tablist`), `Tabs.Tab` (a `tab` button on `Clickable`) and `Tabs.Panel` (the `tabpanel`). Built on Base UI `Tabs` (ADR 0003, 0046): it owns the selection, one tab stop with arrow-key roving, `aria-selected`, and the ids that tie each tab to its panel. The selected tab shows an accent bar that fades and grows in (ADR 0049).
42
42
  - [Tag](Tag.md): A label that puts content in a category: a topic, a label, a user-made category. A `span` with a subtle tone fill (gray by default) and an `lg` radius (half a one-line tag's height, so one line reads as a pill and wrapped lines stay inside the fill) around a `Text` in the `label` font. It can be read-only, a link, or removable.
43
- - [Text](Text.md): The base of all visible text, and the primitive every text component builds on. Capsize trims the box to the cap height and the baseline, so the gap around text is the visible space. It takes every Box style prop (`color`, `textAlign`, margins), plus `size`, `font`, `weight`, `leading`, `truncate` and `wrap`.
43
+ - [Text](Text.md): The base of all visible text, and the primitive every text component builds on. Its box is trimmed to the cap height and the baseline, so the gap around text is the visible space and text sits centred in a padded control. It takes every Box style prop (`color`, `textAlign`, margins), plus `size`, `font`, `weight`, `leading`, `truncate` and `wrap`.
44
44
  - [TextField](TextField.md): A form field for one line of text that is not a search: an `<input>` (role `textbox`) with SearchField's look and no icon or button over it. `type` picks `text`, `email`, `url` or `tel`. Built on Base UI's `Input` (ADR 0003); it composes `Field` for its label, description and error (ADR 0026, 0110). Three sizes at Button's heights (`sm`, `med`, `lg`: 24, 32 and 40 px, ADR 0124).
45
45
  - [Textarea](Textarea.md): A form field for several lines of free text: a `<textarea>` (role `textbox`, multi-line) with TextField's look. Built on Base UI's `Input` rendered as a textarea (ADR 0003); it composes `Field` for its label, description and error (ADR 0026, 0136). `rows` sets its starting height, three by default, and the user can drag it taller or shorter. Three sizes (`sm`, `med`, `lg`) set TextField's text size and padding, so the first line sits where a TextField's text does (ADR 0124).
46
46
  - [Toast](Toast.md): Tells the user briefly about the result of an action without interrupting them: "Changes saved", "Message sent", "Couldn't upload the file". Material calls it a snackbar and Atlassian a flag. Built on Base UI's Toast, which owns the queue, the timers and swipe-to-dismiss. The parts add the look: a raised card in a stack at the bottom end corner, an icon per variant, a close button, and a slide-up-and-fade that is a plain fade under reduced motion. A toast never takes focus and moves nothing on the page.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "./manifest.schema.json",
3
3
  "package": "@jonmilner/ui",
4
- "version": "0.15.0",
4
+ "version": "0.16.0",
5
5
  "components": [
6
6
  {
7
7
  "name": "AlertDialog",
@@ -0,0 +1,57 @@
1
+ # 0.16.0
2
+
3
+ Text now trims with native `text-box: trim-both cap alphabetic` where the browser supports it and with capsize's `::before`/`::after` only where it does not (decision 0160), so labels sit exactly centred; `truncate` clips with `overflow: clip` instead of `hidden`. Most apps change nothing. The trim no longer reaches a flex or grid Text natively, a Text's pseudo-elements exist only on the fallback, and a Text placed inside an inline element mis-trims in WebKit.
4
+
5
+ ## Find
6
+
7
+ In the app's source (`*.tsx`):
8
+
9
+ - A Text laid out as a flex or grid container: regex `<(Text|Heading)\b[^>]*display=["{]["']?(inline-)?(flex|grid)`.
10
+ - A Text given a clipping overflow through a class or `style` instead of the `overflow` prop: regex `<(Text|Heading)\b[^>]*style=\{\{[^}]*overflow`.
11
+ - A truncating Text given a minimum size, which its own zero minimum now overrides: regex `<(Text|Heading)\b[^>]*\btruncate\b[^>]*min(Inline|Block)Size` and `<(Text|Heading)\b[^>]*min(Inline|Block)Size[^>]*\btruncate\b`.
12
+
13
+ In the app's styles (`*.css`, `*.css.ts`):
14
+
15
+ - Rules on a Text's pseudo-elements or its trim: regex `::?(before|after)|text-box`, kept where the selector targets a Text or Heading.
16
+
17
+ ## Replace
18
+
19
+ Move a flex or grid layout off the Text onto a Box around it:
20
+
21
+ ```tsx
22
+ // before
23
+ <Text display="flex" gap="1">
24
+ <CheckIcon /> Saved
25
+ </Text>
26
+ // after
27
+ <Box display="flex" gap="1">
28
+ <CheckIcon />
29
+ <Text>Saved</Text>
30
+ </Box>
31
+ ```
32
+
33
+ Pass a clipping or scrolling overflow as the prop, which keeps the trim in every engine:
34
+
35
+ ```tsx
36
+ // before
37
+ <Text style={{ overflow: "hidden" }}>{summary}</Text>
38
+ // after
39
+ <Text overflow="hidden">{summary}</Text>
40
+ ```
41
+
42
+ Move a truncating Text's minimum size onto a Box around it:
43
+
44
+ ```tsx
45
+ // before
46
+ <Text minInlineSize="xs" truncate>{name}</Text>
47
+ // after
48
+ <Box minInlineSize="xs">
49
+ <Text truncate>{name}</Text>
50
+ </Box>
51
+ ```
52
+
53
+ Delete styles on a Text's `::before` or `::after`, and any `text-box` override on a Text; put decoration on a wrapping Box instead.
54
+
55
+ ## Verify
56
+
57
+ The Find regexes match nothing. Then update the app's visual baselines: text moves by under a pixel inside padded controls (up to 0.8px in Chromium), and box heights stay the same.
package/dist/index.d.mts CHANGED
@@ -37,8 +37,9 @@ import { TextField, TextFieldInputProps, TextFieldProps } from "./TextField/inde
37
37
  import { Textarea, TextareaInputProps, TextareaProps } from "./Textarea/index.mjs";
38
38
  import { ToastOptions, ToastProviderProps, ToastVariant, useToast } from "./Toast/client.mjs";
39
39
  import { Toast } from "./Toast/index.mjs";
40
+ import { TooltipPopupProps } from "./Tooltip/base.mjs";
40
41
  import { TooltipTriggerProps } from "./Tooltip/client.mjs";
41
- import { Tooltip, TooltipPopupProps, TooltipProps, TooltipProviderProps } from "./Tooltip/index.mjs";
42
+ import { Tooltip, TooltipProps, TooltipProviderProps } from "./Tooltip/index.mjs";
42
43
  import { VisuallyHidden, VisuallyHiddenProps } from "./VisuallyHidden/index.mjs";
43
44
  import { Theme, defineTheme } from "./theme/define-theme.mjs";
44
45
  import { ThemeProvider, ThemeProviderProps } from "./theme/ThemeProvider.mjs";
@@ -0,0 +1,6 @@
1
+ import { ReactElement, ReactNode } from "react";
2
+ import { Tooltip } from "@base-ui/react/tooltip";
3
+ export type TooltipRootScopeProps = Pick<Tooltip.Root.Props, "open" | "defaultOpen" | "onOpenChange" | "disabled"> & {
4
+ children?: ReactNode;
5
+ describes?: boolean;
6
+ };