@jonmilner/ui 0.11.1 → 0.11.3

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 (209) 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 +2 -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/Box.md +24 -3
  112. package/dist/docs/Checkbox.md +2 -2
  113. package/dist/docs/Field.md +2 -2
  114. package/dist/docs/Menu.md +1 -1
  115. package/dist/docs/MultiSelect.md +2 -2
  116. package/dist/docs/SearchField.md +1 -1
  117. package/dist/docs/Stack.md +26 -0
  118. package/dist/docs/TextField.md +3 -3
  119. package/dist/docs/llms.txt +7 -0
  120. package/dist/docs/manifest.json +1 -1
  121. package/dist/icons/ArrowLeftIcon.d.mts +1 -3
  122. package/dist/icons/ArrowLeftIcon.mjs +1 -2
  123. package/dist/icons/ArrowRightIcon.d.mts +1 -3
  124. package/dist/icons/ArrowRightIcon.mjs +1 -2
  125. package/dist/icons/CheckIcon.d.mts +1 -3
  126. package/dist/icons/CheckIcon.mjs +1 -2
  127. package/dist/icons/ChevronDownIcon.d.mts +1 -3
  128. package/dist/icons/ChevronDownIcon.mjs +1 -2
  129. package/dist/icons/ChevronRightIcon.d.mts +1 -3
  130. package/dist/icons/ChevronRightIcon.mjs +1 -2
  131. package/dist/icons/CircleAlertIcon.d.mts +1 -3
  132. package/dist/icons/CircleAlertIcon.mjs +1 -2
  133. package/dist/icons/CircleCheckIcon.d.mts +1 -3
  134. package/dist/icons/CircleCheckIcon.mjs +1 -2
  135. package/dist/icons/CircleDotIcon.d.mts +1 -3
  136. package/dist/icons/CircleDotIcon.mjs +1 -2
  137. package/dist/icons/CircleSlashIcon.d.mts +1 -3
  138. package/dist/icons/CircleSlashIcon.mjs +1 -2
  139. package/dist/icons/EllipsisIcon.d.mts +1 -3
  140. package/dist/icons/EllipsisIcon.mjs +1 -2
  141. package/dist/icons/GitMergeIcon.d.mts +1 -3
  142. package/dist/icons/GitMergeIcon.mjs +1 -2
  143. package/dist/icons/GitPullRequestClosedIcon.d.mts +1 -3
  144. package/dist/icons/GitPullRequestClosedIcon.mjs +1 -2
  145. package/dist/icons/GitPullRequestDraftIcon.d.mts +1 -3
  146. package/dist/icons/GitPullRequestDraftIcon.mjs +1 -2
  147. package/dist/icons/GitPullRequestIcon.d.mts +1 -3
  148. package/dist/icons/GitPullRequestIcon.mjs +1 -2
  149. package/dist/icons/InboxIcon.d.mts +1 -3
  150. package/dist/icons/InboxIcon.mjs +1 -2
  151. package/dist/icons/InfoIcon.d.mts +1 -3
  152. package/dist/icons/InfoIcon.mjs +1 -2
  153. package/dist/icons/LoaderCircleIcon.d.mts +1 -3
  154. package/dist/icons/LoaderCircleIcon.mjs +1 -2
  155. package/dist/icons/LockOpenIcon.d.mts +1 -3
  156. package/dist/icons/LockOpenIcon.mjs +1 -2
  157. package/dist/icons/PencilIcon.d.mts +1 -3
  158. package/dist/icons/PencilIcon.mjs +1 -2
  159. package/dist/icons/PlayIcon.d.mts +1 -3
  160. package/dist/icons/PlayIcon.mjs +1 -2
  161. package/dist/icons/PlusIcon.d.mts +1 -3
  162. package/dist/icons/PlusIcon.mjs +1 -2
  163. package/dist/icons/RefreshCwIcon.d.mts +1 -3
  164. package/dist/icons/RefreshCwIcon.mjs +1 -2
  165. package/dist/icons/ReplyIcon.d.mts +1 -3
  166. package/dist/icons/ReplyIcon.mjs +1 -2
  167. package/dist/icons/SearchIcon.d.mts +1 -3
  168. package/dist/icons/SearchIcon.mjs +1 -2
  169. package/dist/icons/SettingsIcon.d.mts +1 -3
  170. package/dist/icons/SettingsIcon.mjs +1 -2
  171. package/dist/icons/Trash2Icon.d.mts +1 -3
  172. package/dist/icons/Trash2Icon.mjs +1 -2
  173. package/dist/icons/XIcon.d.mts +1 -3
  174. package/dist/icons/XIcon.mjs +1 -2
  175. package/dist/icons/index.d.mts +0 -2
  176. package/dist/icons/index.mjs +1 -2
  177. package/dist/lint/index.d.mts +1 -3
  178. package/dist/lint/index.mjs +1 -2
  179. package/dist/popup/client.d.mts +1 -3
  180. package/dist/popup/client.mjs +1 -2
  181. package/dist/styles/atoms.css.d.mts +1 -3
  182. package/dist/styles/atoms.css.mjs +1 -2
  183. package/dist/styles/button-fills.mjs +1 -2
  184. package/dist/styles/button-parts.css.mjs +1 -2
  185. package/dist/styles/control-size.mjs +1 -2
  186. package/dist/styles/highlight.mjs +1 -2
  187. package/dist/styles/hover-tint.mjs +1 -2
  188. package/dist/styles/join.mjs +1 -2
  189. package/dist/styles/part-props.d.mts +1 -3
  190. package/dist/styles/split-style-props.mjs +1 -2
  191. package/dist/styles/split-text-props.mjs +1 -2
  192. package/dist/styles/subtle-fills.d.mts +1 -3
  193. package/dist/styles/subtle-fills.mjs +1 -2
  194. package/dist/testing/motion.d.mts +1 -3
  195. package/dist/testing/motion.mjs +1 -2
  196. package/dist/theme/FontCheck.mjs +1 -2
  197. package/dist/theme/ThemeProvider.d.mts +1 -3
  198. package/dist/theme/ThemeProvider.mjs +1 -2
  199. package/dist/theme/define-theme.d.mts +1 -3
  200. package/dist/theme/define-theme.mjs +1 -2
  201. package/dist/theme/use-theme-container.mjs +1 -2
  202. package/dist/tokens/contract.d.mts +0 -2
  203. package/dist/tokens/contract.mjs +1 -2
  204. package/dist/tokens/roles.d.mts +1 -3
  205. package/dist/tokens/roles.mjs +1 -2
  206. package/dist/tokens/scales.d.mts +1 -3
  207. package/dist/tokens/scales.mjs +1 -2
  208. package/dist/types.d.mts +1 -3
  209. 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);
@@ -243,5 +243,4 @@ function R() {
243
243
  };
244
244
  }, [e]);
245
245
  }
246
- //#endregion
247
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 };
package/dist/docs/Box.md CHANGED
@@ -6,14 +6,14 @@ The base element every component builds on: one element, chosen with `as`, style
6
6
 
7
7
  ## When to use
8
8
 
9
- - Layout and surfaces that need tokens but no behavior: a padded panel, a flex row, a sticky bar.
9
+ - Surfaces that need tokens but no behavior: a padded panel, a sticky bar, a grid.
10
10
  - A semantic element (`as="section"`, `as="nav"`, `as="ul"`) that needs style props.
11
11
  - Building a new component: render a `Box` and pass its tunable values as default style props.
12
12
 
13
13
  ## When not to use
14
14
 
15
15
  - Text: use `Text` or `Heading`; all visible text goes through them.
16
- - Stacks and rows of children with a gap: use `Stack` or `Inline`.
16
+ - Stacks and rows of children with a gap: use `Stack` or `Inline`. A Box with `display="flex"`, `flexDirection="column"` and `gap` is a `Stack` rebuilt by hand.
17
17
  - Anything interactive: use `Button` or a link component, which bring focus and states.
18
18
 
19
19
  ## Rules
@@ -33,7 +33,20 @@ The base element every component builds on: one element, chosen with `as`, style
33
33
  ## Do
34
34
 
35
35
  ```tsx
36
- <Box as="section" display={{ base: "block", med: "flex" }} gap="16" paddingInline="24">
36
+ // A centered column: `Stack`, not a Box with flex props (see Don't).
37
+ <Stack gap="16" alignItems="center">
38
+ <Heading>No projects yet</Heading>
39
+ <Button variant="primary">Create project</Button>
40
+ </Stack>
41
+ ```
42
+
43
+ ```tsx
44
+ <Box
45
+ as="section"
46
+ aria-label="Billing"
47
+ padding={{ base: "16", med: "24" }}
48
+ backgroundColor="bgRaised"
49
+ >
37
50
  …
38
51
  </Box>
39
52
  ```
@@ -57,6 +70,14 @@ import "@jonmilner/ui/responsive.css";
57
70
 
58
71
  ## Don't
59
72
 
73
+ ```tsx
74
+ // A Box rebuilding Stack: write `<Stack gap="16" alignItems="center">` (see Do).
75
+ <Box display="flex" flexDirection="column" alignItems="center" gap="16">
76
+ <Heading>No projects yet</Heading>
77
+ <Button variant="primary">Create project</Button>
78
+ </Box>
79
+ ```
80
+
60
81
  ```tsx
61
82
  // Physical property, `md`: neither type-checks.
62
83
  <Box paddingLeft="16" gap="md" />
@@ -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
 
@@ -22,6 +22,7 @@ A vertical column of children with even space between them. `Stack` is a `Box` w
22
22
  - Space comes from `gap`, never from margins on the children.
23
23
  - It takes every `Box` prop, and the layout defaults are style props, so `display`, `flexDirection` and `alignItems` override them.
24
24
  - Children are not wrapped, so each child is a flex item: it stretches to the column's width unless `alignItems` says otherwise.
25
+ - A list needs no `className` or stylesheet. `paddingInlineStart="0"` drops the `ul` indent, and a row that is a `Box as="li"` with a `display` other than `list-item` draws no marker.
25
26
  - The consumer's `className` comes last and `style` is passed through; `ref` is a plain prop typed for the `as` element.
26
27
 
27
28
  ## Do
@@ -39,8 +40,33 @@ A vertical column of children with even space between them. `Stack` is a `Box` w
39
40
  </Stack>
40
41
  ```
41
42
 
43
+ ```tsx
44
+ // A styled list with no className: the rows are surfaces, and a flex `li` draws no marker.
45
+ <Stack as="ul" gap="8" paddingInlineStart="0" aria-label="Projects">
46
+ {projects.map((project) => (
47
+ <Box
48
+ as="li"
49
+ key={project.id}
50
+ display="flex"
51
+ padding="12"
52
+ backgroundColor="bgRaised"
53
+ borderRadius="med"
54
+ >
55
+ <Text>{project.name}</Text>
56
+ </Box>
57
+ ))}
58
+ </Stack>
59
+ ```
60
+
42
61
  ## Don't
43
62
 
63
+ ```tsx
64
+ // A class and an app stylesheet for what style props cover.
65
+ <Stack as="ul" gap="8" className="project-list">
66
+ <li>…</li>
67
+ </Stack>
68
+ ```
69
+
44
70
  ```tsx
45
71
  // Margins on children instead of gap; and `gap` is required.
46
72
  <Stack>
@@ -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.
@@ -2,6 +2,13 @@
2
2
 
3
3
  > React design system. Each component's docs say when to use it, its rules and props.
4
4
 
5
+ ## Rules for every screen
6
+
7
+ - Lay out with `Stack` (a column) and `Inline` (a row that wraps), spaced by their `gap`. Never rebuild them from a `Box` with `display`, `flexDirection` and `gap`.
8
+ - `Box` is for a surface (padding, background, radius, shadow) or a semantic element that needs style props.
9
+ - No `className`, `style` or app stylesheet for what a style prop or a component covers. Style props take token keys, so no raw colors or lengths either.
10
+ - A list is `Stack as="ul"` with `li` children. For one without markers or indent, add `paddingInlineStart="0"` and make each row a `Box as="li" display="flex"`, as Stack's docs show.
11
+
5
12
  ## Components
6
13
 
7
14
  - [AlertDialog](AlertDialog.md): Asks the user to confirm a consequential action before it runs: delete a project, discard unsaved changes, sign out every device. Built on Base UI's AlertDialog, which owns the behavior: `role="alertdialog"`, focus moves into the dialog and stays there, the page behind is inert, Esc closes it, and a click outside does not. It wears Dialog's panel at the `sm` width with a title, a description, Cancel and one confirm button, and Cancel takes focus on open.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "./manifest.schema.json",
3
3
  "package": "@jonmilner/ui",
4
- "version": "0.11.1",
4
+ "version": "0.11.3",
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 };