@jonmilner/ui 0.11.0 → 0.11.2

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 (207) hide show
  1. package/THIRD_PARTY_NOTICES.md +1 -1
  2. package/dist/AlertDialog/client.mjs +1 -2
  3. package/dist/AlertDialog/index.d.mts +0 -2
  4. package/dist/AlertDialog/index.mjs +1 -2
  5. package/dist/Avatar/Avatar.css.mjs +1 -2
  6. package/dist/Avatar/index.d.mts +0 -2
  7. package/dist/Avatar/index.mjs +1 -2
  8. package/dist/Avatar/ink.mjs +1 -2
  9. package/dist/Badge/Badge.css.mjs +1 -2
  10. package/dist/Badge/index.d.mts +1 -3
  11. package/dist/Badge/index.mjs +1 -2
  12. package/dist/Box/Box.css.mjs +1 -2
  13. package/dist/Box/ResponsiveCheck.mjs +1 -2
  14. package/dist/Box/base.d.mts +1 -3
  15. package/dist/Box/base.mjs +1 -2
  16. package/dist/Box/index.d.mts +0 -2
  17. package/dist/Box/index.mjs +1 -2
  18. package/dist/Button/Button.css.mjs +1 -2
  19. package/dist/Button/index.d.mts +1 -3
  20. package/dist/Button/index.mjs +1 -2
  21. package/dist/Checkbox/Checkbox.css.mjs +1 -2
  22. package/dist/Checkbox/index.d.mts +1 -3
  23. package/dist/Checkbox/index.mjs +1 -2
  24. package/dist/Chip/Chip.css.mjs +1 -2
  25. package/dist/Chip/index.d.mts +1 -3
  26. package/dist/Chip/index.mjs +1 -2
  27. package/dist/Clickable/Clickable.css.mjs +1 -2
  28. package/dist/Clickable/index.d.mts +1 -3
  29. package/dist/Clickable/index.mjs +1 -2
  30. package/dist/ColorField/ColorField.css.mjs +1 -2
  31. package/dist/ColorField/client.d.mts +1 -3
  32. package/dist/ColorField/client.mjs +1 -2
  33. package/dist/ColorField/index.d.mts +0 -2
  34. package/dist/ColorField/index.mjs +1 -2
  35. package/dist/Dialog/Dialog.css.d.mts +1 -3
  36. package/dist/Dialog/Dialog.css.mjs +1 -2
  37. package/dist/Dialog/client.d.mts +0 -2
  38. package/dist/Dialog/client.mjs +1 -2
  39. package/dist/Dialog/index.d.mts +0 -2
  40. package/dist/Dialog/index.mjs +1 -2
  41. package/dist/Field/Field.css.mjs +1 -2
  42. package/dist/Field/client.mjs +1 -2
  43. package/dist/Field/index.d.mts +0 -2
  44. package/dist/Field/index.mjs +1 -2
  45. package/dist/Heading/Heading.css.mjs +1 -2
  46. package/dist/Heading/index.d.mts +1 -3
  47. package/dist/Heading/index.mjs +1 -2
  48. package/dist/Icon/Icon.css.mjs +1 -2
  49. package/dist/Icon/index.d.mts +1 -3
  50. package/dist/Icon/index.mjs +1 -2
  51. package/dist/IconButton/IconButton.css.mjs +1 -2
  52. package/dist/IconButton/index.d.mts +1 -3
  53. package/dist/IconButton/index.mjs +1 -2
  54. package/dist/Inline/Inline.css.mjs +1 -2
  55. package/dist/Inline/index.d.mts +0 -2
  56. package/dist/Inline/index.mjs +1 -2
  57. package/dist/Menu/Menu.css.mjs +1 -2
  58. package/dist/Menu/client.d.mts +0 -2
  59. package/dist/Menu/client.mjs +1 -2
  60. package/dist/Menu/index.d.mts +0 -2
  61. package/dist/Menu/index.mjs +1 -2
  62. package/dist/MultiSelect/MultiSelect.css.mjs +1 -2
  63. package/dist/MultiSelect/client.d.mts +1 -3
  64. package/dist/MultiSelect/client.mjs +1 -2
  65. package/dist/MultiSelect/index.d.mts +1 -3
  66. package/dist/MultiSelect/index.mjs +1 -2
  67. package/dist/SearchField/SearchField.css.mjs +1 -2
  68. package/dist/SearchField/client.d.mts +1 -3
  69. package/dist/SearchField/client.mjs +1 -2
  70. package/dist/SearchField/index.d.mts +0 -2
  71. package/dist/SearchField/index.mjs +1 -2
  72. package/dist/Stack/Stack.css.mjs +1 -2
  73. package/dist/Stack/index.d.mts +0 -2
  74. package/dist/Stack/index.mjs +1 -2
  75. package/dist/Tabs/Tabs.css.mjs +1 -2
  76. package/dist/Tabs/index.d.mts +0 -2
  77. package/dist/Tabs/index.mjs +1 -2
  78. package/dist/Tag/Tag.css.mjs +1 -2
  79. package/dist/Tag/index.d.mts +1 -3
  80. package/dist/Tag/index.mjs +1 -2
  81. package/dist/Text/Text.css.mjs +1 -2
  82. package/dist/Text/index.d.mts +1 -3
  83. package/dist/Text/index.mjs +1 -2
  84. package/dist/TextField/TextField.css.mjs +1 -2
  85. package/dist/TextField/index.d.mts +1 -3
  86. package/dist/TextField/index.mjs +1 -2
  87. package/dist/Toast/Toast.css.mjs +1 -2
  88. package/dist/Toast/client.d.mts +0 -2
  89. package/dist/Toast/client.mjs +5 -3
  90. package/dist/Toast/index.d.mts +0 -2
  91. package/dist/Toast/index.mjs +1 -2
  92. package/dist/VisuallyHidden/VisuallyHidden.css.mjs +1 -2
  93. package/dist/VisuallyHidden/index.d.mts +1 -3
  94. package/dist/VisuallyHidden/index.mjs +1 -2
  95. package/dist/brands/brand.d.mts +1 -3
  96. package/dist/brands/brand.mjs +1 -2
  97. package/dist/brands/check-fonts.mjs +1 -2
  98. package/dist/brands/default.d.mts +1 -3
  99. package/dist/brands/default.mjs +1 -2
  100. package/dist/brands/font.d.mts +1 -3
  101. package/dist/brands/font.mjs +1 -2
  102. package/dist/brands/forced-colors.mjs +1 -2
  103. package/dist/brands/index.d.mts +0 -2
  104. package/dist/brands/index.mjs +1 -2
  105. package/dist/brands/metrics.mjs +1 -2
  106. package/dist/contrast/color.d.mts +1 -3
  107. package/dist/contrast/color.mjs +1 -2
  108. package/dist/contrast/contrast.d.mts +0 -2
  109. package/dist/contrast/contrast.mjs +1 -2
  110. package/dist/contrast/mixes.mjs +1 -2
  111. package/dist/docs/Checkbox.md +2 -2
  112. package/dist/docs/Field.md +2 -2
  113. package/dist/docs/Menu.md +1 -1
  114. package/dist/docs/MultiSelect.md +2 -2
  115. package/dist/docs/SearchField.md +1 -1
  116. package/dist/docs/TextField.md +3 -3
  117. package/dist/docs/Toast.md +2 -2
  118. package/dist/docs/manifest.json +1 -1
  119. package/dist/icons/ArrowLeftIcon.d.mts +1 -3
  120. package/dist/icons/ArrowLeftIcon.mjs +1 -2
  121. package/dist/icons/ArrowRightIcon.d.mts +1 -3
  122. package/dist/icons/ArrowRightIcon.mjs +1 -2
  123. package/dist/icons/CheckIcon.d.mts +1 -3
  124. package/dist/icons/CheckIcon.mjs +1 -2
  125. package/dist/icons/ChevronDownIcon.d.mts +1 -3
  126. package/dist/icons/ChevronDownIcon.mjs +1 -2
  127. package/dist/icons/ChevronRightIcon.d.mts +1 -3
  128. package/dist/icons/ChevronRightIcon.mjs +1 -2
  129. package/dist/icons/CircleAlertIcon.d.mts +1 -3
  130. package/dist/icons/CircleAlertIcon.mjs +1 -2
  131. package/dist/icons/CircleCheckIcon.d.mts +1 -3
  132. package/dist/icons/CircleCheckIcon.mjs +1 -2
  133. package/dist/icons/CircleDotIcon.d.mts +1 -3
  134. package/dist/icons/CircleDotIcon.mjs +1 -2
  135. package/dist/icons/CircleSlashIcon.d.mts +1 -3
  136. package/dist/icons/CircleSlashIcon.mjs +1 -2
  137. package/dist/icons/EllipsisIcon.d.mts +1 -3
  138. package/dist/icons/EllipsisIcon.mjs +1 -2
  139. package/dist/icons/GitMergeIcon.d.mts +1 -3
  140. package/dist/icons/GitMergeIcon.mjs +1 -2
  141. package/dist/icons/GitPullRequestClosedIcon.d.mts +1 -3
  142. package/dist/icons/GitPullRequestClosedIcon.mjs +1 -2
  143. package/dist/icons/GitPullRequestDraftIcon.d.mts +1 -3
  144. package/dist/icons/GitPullRequestDraftIcon.mjs +1 -2
  145. package/dist/icons/GitPullRequestIcon.d.mts +1 -3
  146. package/dist/icons/GitPullRequestIcon.mjs +1 -2
  147. package/dist/icons/InboxIcon.d.mts +1 -3
  148. package/dist/icons/InboxIcon.mjs +1 -2
  149. package/dist/icons/InfoIcon.d.mts +1 -3
  150. package/dist/icons/InfoIcon.mjs +1 -2
  151. package/dist/icons/LoaderCircleIcon.d.mts +1 -3
  152. package/dist/icons/LoaderCircleIcon.mjs +1 -2
  153. package/dist/icons/LockOpenIcon.d.mts +1 -3
  154. package/dist/icons/LockOpenIcon.mjs +1 -2
  155. package/dist/icons/PencilIcon.d.mts +1 -3
  156. package/dist/icons/PencilIcon.mjs +1 -2
  157. package/dist/icons/PlayIcon.d.mts +1 -3
  158. package/dist/icons/PlayIcon.mjs +1 -2
  159. package/dist/icons/PlusIcon.d.mts +1 -3
  160. package/dist/icons/PlusIcon.mjs +1 -2
  161. package/dist/icons/RefreshCwIcon.d.mts +1 -3
  162. package/dist/icons/RefreshCwIcon.mjs +1 -2
  163. package/dist/icons/ReplyIcon.d.mts +1 -3
  164. package/dist/icons/ReplyIcon.mjs +1 -2
  165. package/dist/icons/SearchIcon.d.mts +1 -3
  166. package/dist/icons/SearchIcon.mjs +1 -2
  167. package/dist/icons/SettingsIcon.d.mts +1 -3
  168. package/dist/icons/SettingsIcon.mjs +1 -2
  169. package/dist/icons/Trash2Icon.d.mts +1 -3
  170. package/dist/icons/Trash2Icon.mjs +1 -2
  171. package/dist/icons/XIcon.d.mts +1 -3
  172. package/dist/icons/XIcon.mjs +1 -2
  173. package/dist/icons/index.d.mts +0 -2
  174. package/dist/icons/index.mjs +1 -2
  175. package/dist/lint/index.d.mts +1 -3
  176. package/dist/lint/index.mjs +1 -2
  177. package/dist/popup/client.d.mts +1 -3
  178. package/dist/popup/client.mjs +1 -2
  179. package/dist/styles/atoms.css.d.mts +1 -3
  180. package/dist/styles/atoms.css.mjs +1 -2
  181. package/dist/styles/button-fills.mjs +1 -2
  182. package/dist/styles/button-parts.css.mjs +1 -2
  183. package/dist/styles/control-size.mjs +1 -2
  184. package/dist/styles/highlight.mjs +1 -2
  185. package/dist/styles/hover-tint.mjs +1 -2
  186. package/dist/styles/join.mjs +1 -2
  187. package/dist/styles/part-props.d.mts +1 -3
  188. package/dist/styles/split-style-props.mjs +1 -2
  189. package/dist/styles/split-text-props.mjs +1 -2
  190. package/dist/styles/subtle-fills.d.mts +1 -3
  191. package/dist/styles/subtle-fills.mjs +1 -2
  192. package/dist/testing/motion.d.mts +1 -3
  193. package/dist/testing/motion.mjs +1 -2
  194. package/dist/theme/FontCheck.mjs +1 -2
  195. package/dist/theme/ThemeProvider.d.mts +1 -3
  196. package/dist/theme/ThemeProvider.mjs +1 -2
  197. package/dist/theme/define-theme.d.mts +1 -3
  198. package/dist/theme/define-theme.mjs +1 -2
  199. package/dist/theme/use-theme-container.mjs +1 -2
  200. package/dist/tokens/contract.d.mts +0 -2
  201. package/dist/tokens/contract.mjs +1 -2
  202. package/dist/tokens/roles.d.mts +1 -3
  203. package/dist/tokens/roles.mjs +1 -2
  204. package/dist/tokens/scales.d.mts +1 -3
  205. package/dist/tokens/scales.mjs +1 -2
  206. package/dist/types.d.mts +1 -3
  207. package/package.json +4 -4
@@ -3,7 +3,6 @@ import { CircleCheckIcon } from "../icons/CircleCheckIcon.mjs";
3
3
  import { InfoIcon } from "../icons/InfoIcon.mjs";
4
4
  import { CSSProperties, ReactNode } from "react";
5
5
  import "@base-ui/react/toast";
6
- //#region src/Toast/client.d.ts
7
6
  export type ToastVariant = keyof typeof icons;
8
7
  export type ToastOptions = {
9
8
  action?: {
@@ -42,5 +41,4 @@ export declare function useToast(): {
42
41
  add: ({ title, description, variant, duration, action }: ToastOptions) => string;
43
42
  close: (id: string) => void;
44
43
  };
45
- //#endregion
46
44
  export { ToastProvider };
@@ -13,7 +13,7 @@ import { announcer as u, close as d, content as f, list as p, root as m, toast a
13
13
  import { createContext as _, use as v, useCallback as y, useEffect as b, useLayoutEffect as x, useMemo as S, useRef as C, useState as w } from "react";
14
14
  import { jsx as T, jsxs as E } from "react/jsx-runtime";
15
15
  import { Toast as D } from "@base-ui/react/toast";
16
- //#region src/Toast/client.tsx
16
+ // src/Toast/client.tsx
17
17
  var O = {
18
18
  info: {
19
19
  Icon: l,
@@ -68,7 +68,7 @@ function N({ regionLabel: n, className: r, style: i, children: a }) {
68
68
  })));
69
69
  }, i = (t) => {
70
70
  let r = t.relatedTarget;
71
- (!r || !e.contains(r)) && (n = !1);
71
+ r && e.contains(r) || (n = !1);
72
72
  };
73
73
  return t.addEventListener("mouseover", r), t.addEventListener("mouseout", i), () => {
74
74
  t.removeEventListener("mouseover", r), t.removeEventListener("mouseout", i);
@@ -82,6 +82,9 @@ function N({ regionLabel: n, className: r, style: i, children: a }) {
82
82
  let t = e.relatedTarget;
83
83
  t && !e.currentTarget.contains(t) && (o.current = t);
84
84
  },
85
+ onKeyDown: (e) => {
86
+ e.key === "Escape" && e.stopPropagation();
87
+ },
85
88
  ref: s,
86
89
  render: /* @__PURE__ */ T(t, {
87
90
  className: e(g, r),
@@ -240,5 +243,4 @@ function R() {
240
243
  };
241
244
  }, [e]);
242
245
  }
243
- //#endregion
244
246
  export { P as ToastAnnouncer, I as ToastItem, M as ToastProvider, N as ToastStack, R as useToast };
@@ -1,7 +1,5 @@
1
1
  import { ToastOptions, ToastProvider, ToastProviderProps, ToastVariant, useToast } from "./client.mjs";
2
- //#region src/Toast/index.d.ts
3
2
  export declare const Toast: {
4
3
  Provider: typeof ToastProvider;
5
4
  };
6
- //#endregion
7
5
  export { type ToastOptions, type ToastProviderProps, type ToastVariant, useToast };
@@ -1,5 +1,4 @@
1
1
  import { ToastProvider as e, useToast as t } from "./client.mjs";
2
- //#region src/Toast/index.tsx
2
+ // src/Toast/index.tsx
3
3
  var n = { Provider: e };
4
- //#endregion
5
4
  export { n as Toast, t as useToast };
@@ -2,7 +2,6 @@ import "../styles/layers.css";
2
2
  import "./VisuallyHidden.css";
3
3
  /* empty css */
4
4
  /* empty css */
5
- //#region src/VisuallyHidden/VisuallyHidden.css.ts
5
+ // src/VisuallyHidden/VisuallyHidden.css.ts
6
6
  var e = "_1qk18b30";
7
- //#endregion
8
7
  export { e as root };
@@ -1,6 +1,4 @@
1
1
  import { PolymorphicProps } from "../types.mjs";
2
2
  import { ElementType } from "react";
3
- //#region src/VisuallyHidden/index.d.ts
4
3
  export type VisuallyHiddenProps<T extends ElementType = "span"> = PolymorphicProps<T>;
5
- export declare function VisuallyHidden<T extends ElementType = "span">({ as, className, ...props }: VisuallyHiddenProps<T>): import("react").JSX.Element;
6
- //#endregion
4
+ export declare function VisuallyHidden<T extends ElementType = "span">({ as, className, ...props }: VisuallyHiddenProps<T>): import("react").JSX.Element;
@@ -1,12 +1,11 @@
1
1
  import { join as e } from "../styles/join.mjs";
2
2
  import { root as t } from "./VisuallyHidden.css.mjs";
3
3
  import { jsx as n } from "react/jsx-runtime";
4
- //#region src/VisuallyHidden/index.tsx
4
+ // src/VisuallyHidden/index.tsx
5
5
  function r({ as: r, className: i, ...a }) {
6
6
  return /* @__PURE__ */ n(r ?? "span", {
7
7
  ...a,
8
8
  className: e(t, i)
9
9
  });
10
10
  }
11
- //#endregion
12
11
  export { r as VisuallyHidden };
@@ -1,9 +1,7 @@
1
1
  import { ColorRole, FontRole } from "../tokens/roles.mjs";
2
2
  import { BrandFont } from "./font.mjs";
3
- //#region src/brands/brand.d.ts
4
3
  export interface Brand {
5
4
  readonly name: string;
6
5
  readonly color: Readonly<Record<ColorRole, string>>;
7
6
  readonly font: Readonly<Record<FontRole, BrandFont>>;
8
- }
9
- //#endregion
7
+ }
@@ -1,4 +1,3 @@
1
- //#region src/brands/brand.ts
1
+ // src/brands/brand.ts
2
2
  var e = (e, t) => `light-dark(${e}, ${t})`;
3
- //#endregion
4
3
  export { e as lightDark };
@@ -1,4 +1,4 @@
1
- //#region src/brands/check-fonts.ts
1
+ // src/brands/check-fonts.ts
2
2
  var e = /* @__PURE__ */ new Set();
3
3
  async function t(t, n = 5e3) {
4
4
  if (process.env.NODE_ENV === "production" || typeof document > "u") return;
@@ -11,5 +11,4 @@ async function t(t, n = 5e3) {
11
11
  a && (e.add(t), console.warn(`@jonmilner/ui: font "${t}" ${a}, so text uses its fallback. Load the font files for this brand (see the brand docs).`));
12
12
  }
13
13
  }
14
- //#endregion
15
14
  export { t as checkFonts };
@@ -1,4 +1,2 @@
1
1
  import { Brand } from "./brand.mjs";
2
- //#region src/brands/default.d.ts
3
- export declare const defaultBrand: Brand;
4
- //#endregion
2
+ export declare const defaultBrand: Brand;
@@ -1,6 +1,6 @@
1
1
  import { lightDark as e } from "./brand.mjs";
2
2
  import { arial as t, consolas as n, courierNew as r, inter as i, jetBrainsMono as a, menlo as o } from "./metrics.mjs";
3
- //#region src/brands/default.ts
3
+ // src/brands/default.ts
4
4
  var s = (e, t) => Object.fromEntries(Object.entries(t).map(([t, [n, r]]) => [t, `oklch(${n} ${r} ${e})`])), c = "oklch(1 0 0)", l = "oklch(0 0 0)", u = s(265, {
5
5
  50: [.985, .002],
6
6
  100: [.968, .004],
@@ -130,5 +130,4 @@ var s = (e, t) => Object.fromEntries(Object.entries(t).map(([t, [n, r]]) => [t,
130
130
  mono: _
131
131
  }
132
132
  };
133
- //#endregion
134
133
  export { v as defaultBrand };
@@ -1,4 +1,3 @@
1
- //#region src/brands/font.d.ts
2
1
  export interface FontMetrics {
3
2
  readonly familyName: string;
4
3
  readonly fullName?: string;
@@ -15,5 +14,4 @@ export interface BrandFont {
15
14
  readonly metrics: FontMetrics;
16
15
  readonly fallback: FontMetrics | readonly [FontMetrics, ...FontMetrics[]];
17
16
  readonly generic: "sans-serif" | "serif" | "monospace";
18
- }
19
- //#endregion
17
+ }
@@ -1,4 +1,4 @@
1
- //#region src/brands/font.ts
1
+ // src/brands/font.ts
2
2
  var e = (e) => `"${e}"`, t = (e) => String(Number(e.toFixed(6))), n = (e) => `${t(e * 100)}%`;
3
3
  function r({ metrics: e, fallback: t }) {
4
4
  let n = [t].flat();
@@ -48,5 +48,4 @@ function f(e) {
48
48
  }
49
49
  return new Map([...t].map(([e, t]) => [e, [...t.values()]]));
50
50
  }
51
- //#endregion
52
51
  export { d as fallbackFace, f as fallbackFaces, i as fallbackFamily, r as fallbackPairs, u as fallbackVariants, a as fontStack, o as fontTrim };
@@ -1,4 +1,4 @@
1
- //#region src/brands/forced-colors.ts
1
+ // src/brands/forced-colors.ts
2
2
  var e = {
3
3
  bg: "Canvas",
4
4
  bgMuted: "Canvas",
@@ -34,5 +34,4 @@ var e = {
34
34
  focus: "Highlight",
35
35
  shadow: "CanvasText"
36
36
  };
37
- //#endregion
38
37
  export { e as forcedColors };
@@ -1,8 +1,6 @@
1
1
  import { Brand } from "./brand.mjs";
2
2
  import { defaultBrand } from "./default.mjs";
3
- //#region src/brands/index.d.ts
4
3
  export declare const presets: {
5
4
  default: Brand;
6
5
  };
7
- //#endregion
8
6
  export { type Brand, defaultBrand };
@@ -1,5 +1,4 @@
1
1
  import { defaultBrand as e } from "./default.mjs";
2
- //#region src/brands/index.ts
2
+ // src/brands/index.ts
3
3
  var t = { default: e };
4
- //#endregion
5
4
  export { e as defaultBrand, t as presets };
@@ -1,4 +1,4 @@
1
- //#region src/brands/metrics.ts
1
+ // src/brands/metrics.ts
2
2
  var e = {
3
3
  familyName: "Inter",
4
4
  fullName: "Inter Regular",
@@ -159,5 +159,4 @@ var e = {
159
159
  }
160
160
  }
161
161
  };
162
- //#endregion
163
162
  export { n as arial, c as consolas, r as courierNew, e as inter, t as jetBrainsMono, o as menlo };
@@ -1,3 +1 @@
1
- //#region src/contrast/color.d.ts
2
- export type Mode = "light" | "dark";
3
- //#endregion
1
+ export type Mode = "light" | "dark";
@@ -1,4 +1,4 @@
1
- //#region src/contrast/color.ts
1
+ // src/contrast/color.ts
2
2
  var e = {
3
3
  black: {
4
4
  space: "srgb",
@@ -218,5 +218,4 @@ function b([e, t, n], r) {
218
218
  (c + 360) % 360
219
219
  ];
220
220
  }
221
- //#endregion
222
221
  export { _ as decode, t as resolveColor };
@@ -1,7 +1,6 @@
1
1
  import { ColorRole } from "../tokens/roles.mjs";
2
2
  import { Brand } from "../brands/brand.mjs";
3
3
  import { Mode } from "./color.mjs";
4
- //#region src/contrast/contrast.d.ts
5
4
  export interface ContrastPair {
6
5
  fg: ColorRole;
7
6
  bg: ColorRole;
@@ -14,5 +13,4 @@ export interface ContrastFailure extends ContrastPair {
14
13
  export declare const contrastPairs: readonly ContrastPair[];
15
14
  export declare function contrastRatio(fg: string, bg: string, mode?: Mode): number;
16
15
  export declare function checkContrast(brand: Brand): ContrastFailure[];
17
- //#endregion
18
16
  export type { Mode };
@@ -1,6 +1,6 @@
1
1
  import { subtleFills as e } from "../styles/subtle-fills.mjs";
2
2
  import { decode as t, resolveColor as n } from "./color.mjs";
3
- //#region src/contrast/contrast.ts
3
+ // src/contrast/contrast.ts
4
4
  var r = [
5
5
  "bg",
6
6
  "bgMuted",
@@ -59,5 +59,4 @@ function d(e) {
59
59
  });
60
60
  });
61
61
  }
62
- //#endregion
63
62
  export { d as checkContrast, o as contrastPairs, l as contrastRatio, r as surfaces };
@@ -2,7 +2,7 @@ import { fills as e } from "../styles/button-fills.mjs";
2
2
  import { contrastRatio as t, surfaces as n } from "./contrast.mjs";
3
3
  import { highlightFill as r, highlightText as i } from "../styles/highlight.mjs";
4
4
  import { hoverFill as a } from "../styles/hover-tint.mjs";
5
- //#region src/contrast/mixes.ts
5
+ // src/contrast/mixes.ts
6
6
  var o = [
7
7
  {
8
8
  name: "Menu highlight",
@@ -38,5 +38,4 @@ function s(e) {
38
38
  });
39
39
  }));
40
40
  }
41
- //#endregion
42
41
  export { s as checkMixes, o as contrastMixes };
@@ -11,8 +11,8 @@ A two-state choice, with a third mixed state for a "select all" over a partly se
11
11
 
12
12
  ## When not to use
13
13
 
14
- - A setting that applies the moment it flips: v0.2 adds `Switch`.
15
- - One choice out of several: v0.2 adds `Radio`.
14
+ - A setting that applies the moment it flips: `Switch` is planned.
15
+ - One choice out of several: `RadioGroup` is planned.
16
16
  - Picking several options from a long list in a popup: use `MultiSelect`.
17
17
 
18
18
  ## Rules
@@ -7,13 +7,13 @@ Wires one form control to its label, description and error: ids, `htmlFor`, `ari
7
7
  ## When to use
8
8
 
9
9
  - Any form control that needs a visible label, help text or an error, including a control a component builds (Checkbox, MultiSelect build on Field rather than their own wiring).
10
- - Showing a server validation error from a React Router action next to its control.
10
+ - Showing a server validation error next to its control. The app's action or submit handler returns it; set `invalid` and put the message in `Field.Error` (a props control such as `TextField` takes it as `error` instead; ADR 0133).
11
11
 
12
12
  ## When not to use
13
13
 
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
- - A group of controls with one legend (a radio group): v0.2 adds `Fieldset`.
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` is planned and carries its own legend.
17
17
  - A single line of text, a search, a colour or a choice from a list: use `TextField`, `SearchField`, `ColorField` or `MultiSelect`, which build on this Field.
18
18
 
19
19
  ## Rules
package/dist/docs/Menu.md CHANGED
@@ -12,7 +12,7 @@ A list of actions that opens from a button: a row's "Edit, Duplicate, Delete", a
12
12
 
13
13
  ## When not to use
14
14
 
15
- - Picking a value for a form field: use a select (v0.2 forms) or radio buttons; for several values from a long list, use `MultiSelect`.
15
+ - Picking a value for a form field: a single `Select` and `RadioGroup` are planned; for several values from a long list, use `MultiSelect`.
16
16
  - Navigation between pages: a menu that is only links is still navigation, so show the links on the page or in a nav. Link items are for a menu that mixes actions and links.
17
17
  - One or two actions: show them as buttons.
18
18
  - Content a user reads, or anything interactive inside the list (fields, toggles): use a popover or a dialog.
@@ -12,10 +12,10 @@ A form field for picking any number of values from a list too long to show at on
12
12
  ## When not to use
13
13
 
14
14
  - A few options, all visible on the page: use `ChipGroup multiple`.
15
- - A short list shown inline, each with its own label: use a `Checkbox` group in a `Field`.
15
+ - A short list shown inline, each with its own label: use a group of `Checkbox`es, one `Field` each, in a native `fieldset` with a `legend`.
16
16
  - Actions: use `Menu`; a multi-select picks values and runs nothing.
17
17
  - One choice out of several: use a radio group or a single select.
18
- - Search, filtering or async options: wait for Select and Combobox (v0.2, ADR 0026).
18
+ - Search, filtering or async options: wait for `Select` and `Combobox` (planned).
19
19
  - Users who need to see every selected value at once: use `Chip` or `ChipGroup`, or show the selection beside the field.
20
20
 
21
21
  ## Rules
@@ -12,7 +12,7 @@ A form field for a search query: an `<input type="search">` (role `searchbox`) w
12
12
  ## When not to use
13
13
 
14
14
  - Any other single-line text: use `TextField`; a search field announces itself as a search.
15
- - Picking from a known list as the user types: wait for Combobox (v0.2, ADR 0026).
15
+ - Picking from a known list as the user types: wait for `Combobox` (planned).
16
16
  - Picking several values from a list: use `MultiSelect` or `ChipGroup`.
17
17
  - A colour: use `ColorField`.
18
18
 
@@ -12,9 +12,9 @@ A form field for one line of text that is not a search: an `<input>` (role `text
12
12
  ## When not to use
13
13
 
14
14
  - A query that searches or filters: use `SearchField`; it is announced as a search and has a clear button.
15
- - Several lines of text: wait for a text area (planned, ADR 0026).
16
- - A number with steppers or a range: wait for a number field (planned, ADR 0026).
17
- - Picking from a known list as the user types: wait for Combobox (planned, ADR 0026).
15
+ - Several lines of text: wait for `Textarea` (planned).
16
+ - A number with steppers or a range: a number field is not planned (ADR 0133); use `TextField` with `inputMode` in `inputProps` and validate in the app.
17
+ - Picking from a known list as the user types: wait for `Combobox` (planned).
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.
20
20
  - A password: TextField has no `password` type, since a password field needs a show and hide toggle of its own.
@@ -86,11 +86,11 @@ toast.add({ title: "Update", description: releaseNotes });
86
86
  - The stack is a `region` landmark named by `regionLabel` ("Notifications" by default); F6 moves focus to it, and Shift+Tab from there returns focus where it was. Each toast is a `group` named by its title. Neither the stack (`aria-live="off"`) nor the toasts are live regions; the provider renders two visually hidden ones that exist before any toast, and adds each toast's title and description to one as it arrives: `info` and `success` to a polite `status`, `error` to an assertive `alert`. So each toast is announced once, and an error at once (ADR 0074). Adding a toast never moves focus.
87
87
  - A toast hidden by `limit` was announced when it arrived. When a newer one leaves and it shows again, it is not announced a second time; a user who needs it finds it in the stack with F6.
88
88
  - An error raised from inside a modal `Dialog` is still announced: the dialog hides the rest of the page from assistive tech, but not the announcer's regions.
89
- - Inside a modal `Dialog`: F6 still reaches the stack past the dialog's focus trap, so an error's action and close button stay in keyboard reach; Tab past the last toast returns focus to the dialog. Escape in the stack currently closes the dialog too, not only the toast (#145).
89
+ - Inside a modal `Dialog`: F6 still reaches the stack past the dialog's focus trap, so an error's action and close button stay in keyboard reach; Tab past the last toast returns focus to the dialog. Escape on a toast closes only the toast; the dialog, and what was typed in it, stays (ADR 0132). Escape anywhere in the stack goes no further, so on the stack itself it does nothing, and an app's own `document` or `window` Escape listener never sees it.
90
90
  - Reflow (WCAG 1.4.10): a stack taller than the window, as at 320px wide with 200% text, scrolls inside itself with the newest toast on top, so the older ones stay in reach.
91
91
  - Resize text (WCAG 1.4.4): when the stack is narrower than 16rem, as at 320px wide with 200% text, the content moves to its own line below the icon and close button, so the button stays inside the card and words wrap whole (ADR 0067).
92
92
  - Timing (WCAG 2.2.1, Timing Adjustable): a toast closes on its own only when it is not essential. The timer pauses while the pointer is over the stack, while keyboard focus is in it, and while the window is in the background, so a user who reaches it gets the time they need. An error stays until dismissed by default, and `duration: 0` keeps any toast. The close button dismisses a toast at any time.
93
- - Dismissing a toast from the keyboard (Enter or Space on its close button, or a screen reader's activation) moves focus to the close button of the toast that takes its place: the next one, else the previous one. Dismissing the last returns focus to where it was before Tab or F6 brought it into the stack, so focus never falls to the page (ADR 0085). Focus after a click or swipe is #149.
93
+ - Dismissing a toast from the keyboard (Enter or Space on its close button, or a screen reader's activation) moves focus to the close button of the toast that takes its place: the next one, else the previous one. Dismissing the last returns focus to where it was before Tab or F6 brought it into the stack, so focus never falls to the page (ADR 0085). A click or swipe that leaves focus in the leaving toast also returns it there, without scrolling.
94
94
  - The close button and the action are native buttons with the shared focus ring and a 24px target. The close button's name is `closeLabel`.
95
95
  - Swiping a toast away, down or toward the stack's inline end (right, or left under `dir="rtl"`), is a shortcut; the close button does the same.
96
96
  - Under reduced motion a toast only fades. Under forced colors it keeps its border.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "./manifest.schema.json",
3
3
  "package": "@jonmilner/ui",
4
- "version": "0.11.0",
4
+ "version": "0.11.2",
5
5
  "components": [
6
6
  {
7
7
  "name": "AlertDialog",
@@ -1,4 +1,2 @@
1
1
  import { IconProps } from "../Icon/index.mjs";
2
- //#region src/icons/ArrowLeftIcon.d.ts
3
- export declare function ArrowLeftIcon(props: Omit<IconProps, "children" | "viewBox">): import("react").JSX.Element;
4
- //#endregion
2
+ export declare function ArrowLeftIcon(props: Omit<IconProps, "children" | "viewBox">): import("react").JSX.Element;
@@ -1,11 +1,10 @@
1
1
  import { Icon as e } from "../Icon/index.mjs";
2
2
  import { jsx as t } from "react/jsx-runtime";
3
- //#region src/icons/ArrowLeftIcon.tsx
3
+ // src/icons/ArrowLeftIcon.tsx
4
4
  function n(n) {
5
5
  return /* @__PURE__ */ t(e, {
6
6
  ...n,
7
7
  children: /* @__PURE__ */ t("path", { d: "m12 19-7-7 7-7M19 12H5" })
8
8
  });
9
9
  }
10
- //#endregion
11
10
  export { n as ArrowLeftIcon };
@@ -1,4 +1,2 @@
1
1
  import { IconProps } from "../Icon/index.mjs";
2
- //#region src/icons/ArrowRightIcon.d.ts
3
- export declare function ArrowRightIcon(props: Omit<IconProps, "children" | "viewBox">): import("react").JSX.Element;
4
- //#endregion
2
+ export declare function ArrowRightIcon(props: Omit<IconProps, "children" | "viewBox">): import("react").JSX.Element;
@@ -1,11 +1,10 @@
1
1
  import { Icon as e } from "../Icon/index.mjs";
2
2
  import { jsx as t } from "react/jsx-runtime";
3
- //#region src/icons/ArrowRightIcon.tsx
3
+ // src/icons/ArrowRightIcon.tsx
4
4
  function n(n) {
5
5
  return /* @__PURE__ */ t(e, {
6
6
  ...n,
7
7
  children: /* @__PURE__ */ t("path", { d: "M5 12h14M12 5l7 7-7 7" })
8
8
  });
9
9
  }
10
- //#endregion
11
10
  export { n as ArrowRightIcon };
@@ -1,4 +1,2 @@
1
1
  import { IconProps } from "../Icon/index.mjs";
2
- //#region src/icons/CheckIcon.d.ts
3
- export declare function CheckIcon(props: Omit<IconProps, "children" | "viewBox">): import("react").JSX.Element;
4
- //#endregion
2
+ export declare function CheckIcon(props: Omit<IconProps, "children" | "viewBox">): import("react").JSX.Element;
@@ -1,11 +1,10 @@
1
1
  import { Icon as e } from "../Icon/index.mjs";
2
2
  import { jsx as t } from "react/jsx-runtime";
3
- //#region src/icons/CheckIcon.tsx
3
+ // src/icons/CheckIcon.tsx
4
4
  function n(n) {
5
5
  return /* @__PURE__ */ t(e, {
6
6
  ...n,
7
7
  children: /* @__PURE__ */ t("path", { d: "M20 6 9 17l-5-5" })
8
8
  });
9
9
  }
10
- //#endregion
11
10
  export { n as CheckIcon };
@@ -1,4 +1,2 @@
1
1
  import { IconProps } from "../Icon/index.mjs";
2
- //#region src/icons/ChevronDownIcon.d.ts
3
- export declare function ChevronDownIcon(props: Omit<IconProps, "children" | "viewBox">): import("react").JSX.Element;
4
- //#endregion
2
+ export declare function ChevronDownIcon(props: Omit<IconProps, "children" | "viewBox">): import("react").JSX.Element;
@@ -1,11 +1,10 @@
1
1
  import { Icon as e } from "../Icon/index.mjs";
2
2
  import { jsx as t } from "react/jsx-runtime";
3
- //#region src/icons/ChevronDownIcon.tsx
3
+ // src/icons/ChevronDownIcon.tsx
4
4
  function n(n) {
5
5
  return /* @__PURE__ */ t(e, {
6
6
  ...n,
7
7
  children: /* @__PURE__ */ t("path", { d: "m6 9 6 6 6-6" })
8
8
  });
9
9
  }
10
- //#endregion
11
10
  export { n as ChevronDownIcon };
@@ -1,4 +1,2 @@
1
1
  import { IconProps } from "../Icon/index.mjs";
2
- //#region src/icons/ChevronRightIcon.d.ts
3
- export declare function ChevronRightIcon(props: Omit<IconProps, "children" | "viewBox">): import("react").JSX.Element;
4
- //#endregion
2
+ export declare function ChevronRightIcon(props: Omit<IconProps, "children" | "viewBox">): import("react").JSX.Element;
@@ -1,11 +1,10 @@
1
1
  import { Icon as e } from "../Icon/index.mjs";
2
2
  import { jsx as t } from "react/jsx-runtime";
3
- //#region src/icons/ChevronRightIcon.tsx
3
+ // src/icons/ChevronRightIcon.tsx
4
4
  function n(n) {
5
5
  return /* @__PURE__ */ t(e, {
6
6
  ...n,
7
7
  children: /* @__PURE__ */ t("path", { d: "m9 18 6-6-6-6" })
8
8
  });
9
9
  }
10
- //#endregion
11
10
  export { n as ChevronRightIcon };
@@ -1,4 +1,2 @@
1
1
  import { IconProps } from "../Icon/index.mjs";
2
- //#region src/icons/CircleAlertIcon.d.ts
3
- export declare function CircleAlertIcon(props: Omit<IconProps, "children" | "viewBox">): import("react").JSX.Element;
4
- //#endregion
2
+ export declare function CircleAlertIcon(props: Omit<IconProps, "children" | "viewBox">): import("react").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { Icon as e } from "../Icon/index.mjs";
2
2
  import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
- //#region src/icons/CircleAlertIcon.tsx
3
+ // src/icons/CircleAlertIcon.tsx
4
4
  function r(r) {
5
5
  return /* @__PURE__ */ n(e, {
6
6
  ...r,
@@ -11,5 +11,4 @@ function r(r) {
11
11
  }), /* @__PURE__ */ t("path", { d: "M12 8v4M12 16h.01" })]
12
12
  });
13
13
  }
14
- //#endregion
15
14
  export { r as CircleAlertIcon };
@@ -1,4 +1,2 @@
1
1
  import { IconProps } from "../Icon/index.mjs";
2
- //#region src/icons/CircleCheckIcon.d.ts
3
- export declare function CircleCheckIcon(props: Omit<IconProps, "children" | "viewBox">): import("react").JSX.Element;
4
- //#endregion
2
+ export declare function CircleCheckIcon(props: Omit<IconProps, "children" | "viewBox">): import("react").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { Icon as e } from "../Icon/index.mjs";
2
2
  import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
- //#region src/icons/CircleCheckIcon.tsx
3
+ // src/icons/CircleCheckIcon.tsx
4
4
  function r(r) {
5
5
  return /* @__PURE__ */ n(e, {
6
6
  ...r,
@@ -11,5 +11,4 @@ function r(r) {
11
11
  }), /* @__PURE__ */ t("path", { d: "m16 9-5.5 5.5L8 12" })]
12
12
  });
13
13
  }
14
- //#endregion
15
14
  export { r as CircleCheckIcon };
@@ -1,4 +1,2 @@
1
1
  import { IconProps } from "../Icon/index.mjs";
2
- //#region src/icons/CircleDotIcon.d.ts
3
- export declare function CircleDotIcon(props: Omit<IconProps, "children" | "viewBox">): import("react").JSX.Element;
4
- //#endregion
2
+ export declare function CircleDotIcon(props: Omit<IconProps, "children" | "viewBox">): import("react").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { Icon as e } from "../Icon/index.mjs";
2
2
  import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
- //#region src/icons/CircleDotIcon.tsx
3
+ // src/icons/CircleDotIcon.tsx
4
4
  function r(r) {
5
5
  return /* @__PURE__ */ n(e, {
6
6
  ...r,
@@ -15,5 +15,4 @@ function r(r) {
15
15
  })]
16
16
  });
17
17
  }
18
- //#endregion
19
18
  export { r as CircleDotIcon };
@@ -1,4 +1,2 @@
1
1
  import { IconProps } from "../Icon/index.mjs";
2
- //#region src/icons/CircleSlashIcon.d.ts
3
- export declare function CircleSlashIcon(props: Omit<IconProps, "children" | "viewBox">): import("react").JSX.Element;
4
- //#endregion
2
+ export declare function CircleSlashIcon(props: Omit<IconProps, "children" | "viewBox">): import("react").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { Icon as e } from "../Icon/index.mjs";
2
2
  import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
- //#region src/icons/CircleSlashIcon.tsx
3
+ // src/icons/CircleSlashIcon.tsx
4
4
  function r(r) {
5
5
  return /* @__PURE__ */ n(e, {
6
6
  ...r,
@@ -11,5 +11,4 @@ function r(r) {
11
11
  }), /* @__PURE__ */ t("path", { d: "m9 15 6-6" })]
12
12
  });
13
13
  }
14
- //#endregion
15
14
  export { r as CircleSlashIcon };
@@ -1,4 +1,2 @@
1
1
  import { IconProps } from "../Icon/index.mjs";
2
- //#region src/icons/EllipsisIcon.d.ts
3
- export declare function EllipsisIcon(props: Omit<IconProps, "children" | "viewBox">): import("react").JSX.Element;
4
- //#endregion
2
+ export declare function EllipsisIcon(props: Omit<IconProps, "children" | "viewBox">): import("react").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { Icon as e } from "../Icon/index.mjs";
2
2
  import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
- //#region src/icons/EllipsisIcon.tsx
3
+ // src/icons/EllipsisIcon.tsx
4
4
  function r(r) {
5
5
  return /* @__PURE__ */ n(e, {
6
6
  ...r,
@@ -23,5 +23,4 @@ function r(r) {
23
23
  ]
24
24
  });
25
25
  }
26
- //#endregion
27
26
  export { r as EllipsisIcon };
@@ -1,4 +1,2 @@
1
1
  import { IconProps } from "../Icon/index.mjs";
2
- //#region src/icons/GitMergeIcon.d.ts
3
- export declare function GitMergeIcon(props: Omit<IconProps, "children" | "viewBox">): import("react").JSX.Element;
4
- //#endregion
2
+ export declare function GitMergeIcon(props: Omit<IconProps, "children" | "viewBox">): import("react").JSX.Element;