@setsquare/ui 0.1.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 (312) hide show
  1. package/CHANGELOG.md +70 -0
  2. package/LICENSE +202 -0
  3. package/NOTICE +49 -0
  4. package/README.md +313 -0
  5. package/dist/index.d.ts +129 -0
  6. package/dist/index.d.ts.map +1 -0
  7. package/dist/index.js +78 -0
  8. package/dist/index.js.map +1 -0
  9. package/dist/lib/cn.d.ts +4 -0
  10. package/dist/lib/cn.d.ts.map +1 -0
  11. package/dist/lib/cn.js +59 -0
  12. package/dist/lib/cn.js.map +1 -0
  13. package/dist/lib/tokens.d.ts +5 -0
  14. package/dist/lib/tokens.d.ts.map +1 -0
  15. package/dist/lib/tokens.js +22 -0
  16. package/dist/lib/tokens.js.map +1 -0
  17. package/dist/lib/use-element-width.d.ts +4 -0
  18. package/dist/lib/use-element-width.d.ts.map +1 -0
  19. package/dist/lib/use-element-width.js +17 -0
  20. package/dist/lib/use-element-width.js.map +1 -0
  21. package/dist/lint/index.d.ts +41 -0
  22. package/dist/lint/index.d.ts.map +1 -0
  23. package/dist/lint/index.js +648 -0
  24. package/dist/lint/index.js.map +1 -0
  25. package/dist/shell/app-header.d.ts +13 -0
  26. package/dist/shell/app-header.d.ts.map +1 -0
  27. package/dist/shell/app-header.js +11 -0
  28. package/dist/shell/app-header.js.map +1 -0
  29. package/dist/shell/dashboard-shell.d.ts +67 -0
  30. package/dist/shell/dashboard-shell.d.ts.map +1 -0
  31. package/dist/shell/dashboard-shell.js +168 -0
  32. package/dist/shell/dashboard-shell.js.map +1 -0
  33. package/dist/shell/page-header.d.ts +19 -0
  34. package/dist/shell/page-header.d.ts.map +1 -0
  35. package/dist/shell/page-header.js +11 -0
  36. package/dist/shell/page-header.js.map +1 -0
  37. package/dist/shell/right-panel.d.ts +25 -0
  38. package/dist/shell/right-panel.d.ts.map +1 -0
  39. package/dist/shell/right-panel.js +37 -0
  40. package/dist/shell/right-panel.js.map +1 -0
  41. package/dist/shell/sidebar.d.ts +68 -0
  42. package/dist/shell/sidebar.d.ts.map +1 -0
  43. package/dist/shell/sidebar.js +68 -0
  44. package/dist/shell/sidebar.js.map +1 -0
  45. package/dist/shell/site-footer.d.ts +28 -0
  46. package/dist/shell/site-footer.d.ts.map +1 -0
  47. package/dist/shell/site-footer.js +15 -0
  48. package/dist/shell/site-footer.js.map +1 -0
  49. package/dist/shell/site-header-padding.d.ts +7 -0
  50. package/dist/shell/site-header-padding.d.ts.map +1 -0
  51. package/dist/shell/site-header-padding.js +27 -0
  52. package/dist/shell/site-header-padding.js.map +1 -0
  53. package/dist/shell/site-header.d.ts +23 -0
  54. package/dist/shell/site-header.d.ts.map +1 -0
  55. package/dist/shell/site-header.js +13 -0
  56. package/dist/shell/site-header.js.map +1 -0
  57. package/dist/shell/site-menu.d.ts +27 -0
  58. package/dist/shell/site-menu.d.ts.map +1 -0
  59. package/dist/shell/site-menu.js +56 -0
  60. package/dist/shell/site-menu.js.map +1 -0
  61. package/dist/shell/site-nav-link.d.ts +24 -0
  62. package/dist/shell/site-nav-link.d.ts.map +1 -0
  63. package/dist/shell/site-nav-link.js +35 -0
  64. package/dist/shell/site-nav-link.js.map +1 -0
  65. package/dist/shell/site-nav.d.ts +12 -0
  66. package/dist/shell/site-nav.d.ts.map +1 -0
  67. package/dist/shell/site-nav.js +9 -0
  68. package/dist/shell/site-nav.js.map +1 -0
  69. package/dist/shell/site-path.d.ts +8 -0
  70. package/dist/shell/site-path.d.ts.map +1 -0
  71. package/dist/shell/site-path.js +11 -0
  72. package/dist/shell/site-path.js.map +1 -0
  73. package/dist/shell/site-shell.d.ts +25 -0
  74. package/dist/shell/site-shell.d.ts.map +1 -0
  75. package/dist/shell/site-shell.js +17 -0
  76. package/dist/shell/site-shell.js.map +1 -0
  77. package/dist/styles/styles.css +10 -0
  78. package/dist/styles/theme.css +579 -0
  79. package/dist/styles/tokens.css +295 -0
  80. package/dist/testing/index.d.ts +321 -0
  81. package/dist/testing/index.d.ts.map +1 -0
  82. package/dist/testing/index.js +1175 -0
  83. package/dist/testing/index.js.map +1 -0
  84. package/dist/tokens.json +982 -0
  85. package/dist/ui/alert.d.ts +35 -0
  86. package/dist/ui/alert.d.ts.map +1 -0
  87. package/dist/ui/alert.js +65 -0
  88. package/dist/ui/alert.js.map +1 -0
  89. package/dist/ui/avatar.d.ts +16 -0
  90. package/dist/ui/avatar.d.ts.map +1 -0
  91. package/dist/ui/avatar.js +13 -0
  92. package/dist/ui/avatar.js.map +1 -0
  93. package/dist/ui/badge.d.ts +13 -0
  94. package/dist/ui/badge.d.ts.map +1 -0
  95. package/dist/ui/badge.js +24 -0
  96. package/dist/ui/badge.js.map +1 -0
  97. package/dist/ui/breadcrumbs.d.ts +13 -0
  98. package/dist/ui/breadcrumbs.d.ts.map +1 -0
  99. package/dist/ui/breadcrumbs.js +12 -0
  100. package/dist/ui/breadcrumbs.js.map +1 -0
  101. package/dist/ui/button-styles.d.ts +24 -0
  102. package/dist/ui/button-styles.d.ts.map +1 -0
  103. package/dist/ui/button-styles.js +50 -0
  104. package/dist/ui/button-styles.js.map +1 -0
  105. package/dist/ui/button.d.ts +27 -0
  106. package/dist/ui/button.d.ts.map +1 -0
  107. package/dist/ui/button.js +30 -0
  108. package/dist/ui/button.js.map +1 -0
  109. package/dist/ui/calendar.d.ts +19 -0
  110. package/dist/ui/calendar.d.ts.map +1 -0
  111. package/dist/ui/calendar.js +52 -0
  112. package/dist/ui/calendar.js.map +1 -0
  113. package/dist/ui/card.d.ts +30 -0
  114. package/dist/ui/card.d.ts.map +1 -0
  115. package/dist/ui/card.js +18 -0
  116. package/dist/ui/card.js.map +1 -0
  117. package/dist/ui/checkbox.d.ts +36 -0
  118. package/dist/ui/checkbox.d.ts.map +1 -0
  119. package/dist/ui/checkbox.js +38 -0
  120. package/dist/ui/checkbox.js.map +1 -0
  121. package/dist/ui/code-block.d.ts +20 -0
  122. package/dist/ui/code-block.d.ts.map +1 -0
  123. package/dist/ui/code-block.js +22 -0
  124. package/dist/ui/code-block.js.map +1 -0
  125. package/dist/ui/combo-box.d.ts +17 -0
  126. package/dist/ui/combo-box.d.ts.map +1 -0
  127. package/dist/ui/combo-box.js +14 -0
  128. package/dist/ui/combo-box.js.map +1 -0
  129. package/dist/ui/copy-button.d.ts +14 -0
  130. package/dist/ui/copy-button.d.ts.map +1 -0
  131. package/dist/ui/copy-button.js +36 -0
  132. package/dist/ui/copy-button.js.map +1 -0
  133. package/dist/ui/date-field.d.ts +38 -0
  134. package/dist/ui/date-field.d.ts.map +1 -0
  135. package/dist/ui/date-field.js +78 -0
  136. package/dist/ui/date-field.js.map +1 -0
  137. package/dist/ui/dialog.d.ts +41 -0
  138. package/dist/ui/dialog.d.ts.map +1 -0
  139. package/dist/ui/dialog.js +69 -0
  140. package/dist/ui/dialog.js.map +1 -0
  141. package/dist/ui/disclosure.d.ts +18 -0
  142. package/dist/ui/disclosure.d.ts.map +1 -0
  143. package/dist/ui/disclosure.js +15 -0
  144. package/dist/ui/disclosure.js.map +1 -0
  145. package/dist/ui/empty-state.d.ts +17 -0
  146. package/dist/ui/empty-state.d.ts.map +1 -0
  147. package/dist/ui/empty-state.js +9 -0
  148. package/dist/ui/empty-state.js.map +1 -0
  149. package/dist/ui/error-state.d.ts +45 -0
  150. package/dist/ui/error-state.d.ts.map +1 -0
  151. package/dist/ui/error-state.js +88 -0
  152. package/dist/ui/error-state.js.map +1 -0
  153. package/dist/ui/field.d.ts +46 -0
  154. package/dist/ui/field.d.ts.map +1 -0
  155. package/dist/ui/field.js +79 -0
  156. package/dist/ui/field.js.map +1 -0
  157. package/dist/ui/file-upload.d.ts +54 -0
  158. package/dist/ui/file-upload.d.ts.map +1 -0
  159. package/dist/ui/file-upload.js +170 -0
  160. package/dist/ui/file-upload.js.map +1 -0
  161. package/dist/ui/form.d.ts +56 -0
  162. package/dist/ui/form.d.ts.map +1 -0
  163. package/dist/ui/form.js +137 -0
  164. package/dist/ui/form.js.map +1 -0
  165. package/dist/ui/grid-list.d.ts +24 -0
  166. package/dist/ui/grid-list.d.ts.map +1 -0
  167. package/dist/ui/grid-list.js +21 -0
  168. package/dist/ui/grid-list.js.map +1 -0
  169. package/dist/ui/hero.d.ts +36 -0
  170. package/dist/ui/hero.d.ts.map +1 -0
  171. package/dist/ui/hero.js +19 -0
  172. package/dist/ui/hero.js.map +1 -0
  173. package/dist/ui/icon-button.d.ts +18 -0
  174. package/dist/ui/icon-button.d.ts.map +1 -0
  175. package/dist/ui/icon-button.js +13 -0
  176. package/dist/ui/icon-button.js.map +1 -0
  177. package/dist/ui/icon.d.ts +20 -0
  178. package/dist/ui/icon.d.ts.map +1 -0
  179. package/dist/ui/icon.js +26 -0
  180. package/dist/ui/icon.js.map +1 -0
  181. package/dist/ui/kbd.d.ts +7 -0
  182. package/dist/ui/kbd.d.ts.map +1 -0
  183. package/dist/ui/kbd.js +7 -0
  184. package/dist/ui/kbd.js.map +1 -0
  185. package/dist/ui/link-card.d.ts +23 -0
  186. package/dist/ui/link-card.d.ts.map +1 -0
  187. package/dist/ui/link-card.js +19 -0
  188. package/dist/ui/link-card.js.map +1 -0
  189. package/dist/ui/list-box.d.ts +17 -0
  190. package/dist/ui/list-box.d.ts.map +1 -0
  191. package/dist/ui/list-box.js +18 -0
  192. package/dist/ui/list-box.js.map +1 -0
  193. package/dist/ui/menu.d.ts +31 -0
  194. package/dist/ui/menu.d.ts.map +1 -0
  195. package/dist/ui/menu.js +40 -0
  196. package/dist/ui/menu.js.map +1 -0
  197. package/dist/ui/number-field.d.ts +19 -0
  198. package/dist/ui/number-field.d.ts.map +1 -0
  199. package/dist/ui/number-field.js +19 -0
  200. package/dist/ui/number-field.js.map +1 -0
  201. package/dist/ui/prose.d.ts +12 -0
  202. package/dist/ui/prose.d.ts.map +1 -0
  203. package/dist/ui/prose.js +11 -0
  204. package/dist/ui/prose.js.map +1 -0
  205. package/dist/ui/radio-group.d.ts +20 -0
  206. package/dist/ui/radio-group.d.ts.map +1 -0
  207. package/dist/ui/radio-group.js +16 -0
  208. package/dist/ui/radio-group.js.map +1 -0
  209. package/dist/ui/scroll-region.d.ts +18 -0
  210. package/dist/ui/scroll-region.d.ts.map +1 -0
  211. package/dist/ui/scroll-region.js +29 -0
  212. package/dist/ui/scroll-region.js.map +1 -0
  213. package/dist/ui/search-field.d.ts +12 -0
  214. package/dist/ui/search-field.d.ts.map +1 -0
  215. package/dist/ui/search-field.js +12 -0
  216. package/dist/ui/search-field.js.map +1 -0
  217. package/dist/ui/search.d.ts +43 -0
  218. package/dist/ui/search.d.ts.map +1 -0
  219. package/dist/ui/search.js +45 -0
  220. package/dist/ui/search.js.map +1 -0
  221. package/dist/ui/section.d.ts +50 -0
  222. package/dist/ui/section.d.ts.map +1 -0
  223. package/dist/ui/section.js +25 -0
  224. package/dist/ui/section.js.map +1 -0
  225. package/dist/ui/segmented-control.d.ts +18 -0
  226. package/dist/ui/segmented-control.d.ts.map +1 -0
  227. package/dist/ui/segmented-control.js +17 -0
  228. package/dist/ui/segmented-control.js.map +1 -0
  229. package/dist/ui/select.d.ts +18 -0
  230. package/dist/ui/select.d.ts.map +1 -0
  231. package/dist/ui/select.js +13 -0
  232. package/dist/ui/select.js.map +1 -0
  233. package/dist/ui/selection-bar.d.ts +28 -0
  234. package/dist/ui/selection-bar.d.ts.map +1 -0
  235. package/dist/ui/selection-bar.js +35 -0
  236. package/dist/ui/selection-bar.js.map +1 -0
  237. package/dist/ui/sheet.d.ts +21 -0
  238. package/dist/ui/sheet.d.ts.map +1 -0
  239. package/dist/ui/sheet.js +16 -0
  240. package/dist/ui/sheet.js.map +1 -0
  241. package/dist/ui/skeleton.d.ts +31 -0
  242. package/dist/ui/skeleton.d.ts.map +1 -0
  243. package/dist/ui/skeleton.js +38 -0
  244. package/dist/ui/skeleton.js.map +1 -0
  245. package/dist/ui/slider.d.ts +31 -0
  246. package/dist/ui/slider.d.ts.map +1 -0
  247. package/dist/ui/slider.js +33 -0
  248. package/dist/ui/slider.js.map +1 -0
  249. package/dist/ui/spinner.d.ts +27 -0
  250. package/dist/ui/spinner.d.ts.map +1 -0
  251. package/dist/ui/spinner.js +21 -0
  252. package/dist/ui/spinner.js.map +1 -0
  253. package/dist/ui/split.d.ts +14 -0
  254. package/dist/ui/split.d.ts.map +1 -0
  255. package/dist/ui/split.js +11 -0
  256. package/dist/ui/split.js.map +1 -0
  257. package/dist/ui/stat-list.d.ts +25 -0
  258. package/dist/ui/stat-list.d.ts.map +1 -0
  259. package/dist/ui/stat-list.js +14 -0
  260. package/dist/ui/stat-list.js.map +1 -0
  261. package/dist/ui/steps.d.ts +23 -0
  262. package/dist/ui/steps.d.ts.map +1 -0
  263. package/dist/ui/steps.js +16 -0
  264. package/dist/ui/steps.js.map +1 -0
  265. package/dist/ui/switch.d.ts +13 -0
  266. package/dist/ui/switch.d.ts.map +1 -0
  267. package/dist/ui/switch.js +12 -0
  268. package/dist/ui/switch.js.map +1 -0
  269. package/dist/ui/table.d.ts +25 -0
  270. package/dist/ui/table.d.ts.map +1 -0
  271. package/dist/ui/table.js +29 -0
  272. package/dist/ui/table.js.map +1 -0
  273. package/dist/ui/tag.d.ts +14 -0
  274. package/dist/ui/tag.d.ts.map +1 -0
  275. package/dist/ui/tag.js +11 -0
  276. package/dist/ui/tag.js.map +1 -0
  277. package/dist/ui/text-field.d.ts +27 -0
  278. package/dist/ui/text-field.d.ts.map +1 -0
  279. package/dist/ui/text-field.js +17 -0
  280. package/dist/ui/text-field.js.map +1 -0
  281. package/dist/ui/text-link.d.ts +17 -0
  282. package/dist/ui/text-link.d.ts.map +1 -0
  283. package/dist/ui/text-link.js +15 -0
  284. package/dist/ui/text-link.js.map +1 -0
  285. package/dist/ui/theme-switcher.d.ts +26 -0
  286. package/dist/ui/theme-switcher.d.ts.map +1 -0
  287. package/dist/ui/theme-switcher.js +32 -0
  288. package/dist/ui/theme-switcher.js.map +1 -0
  289. package/dist/ui/theme.d.ts +54 -0
  290. package/dist/ui/theme.d.ts.map +1 -0
  291. package/dist/ui/theme.js +135 -0
  292. package/dist/ui/theme.js.map +1 -0
  293. package/dist/ui/toast.d.ts +34 -0
  294. package/dist/ui/toast.d.ts.map +1 -0
  295. package/dist/ui/toast.js +69 -0
  296. package/dist/ui/toast.js.map +1 -0
  297. package/dist/ui/tooltip.d.ts +10 -0
  298. package/dist/ui/tooltip.d.ts.map +1 -0
  299. package/dist/ui/tooltip.js +10 -0
  300. package/dist/ui/tooltip.js.map +1 -0
  301. package/package.json +123 -0
  302. package/templates/next/error.tsx +32 -0
  303. package/templates/next/loading.tsx +19 -0
  304. package/templates/next/not-found.tsx +18 -0
  305. package/templates/next/page-transition.tsx +33 -0
  306. package/templates/next/portal-layout.tsx +70 -0
  307. package/templates/next/prefetch-on-intent.ts +31 -0
  308. package/templates/next/root-layout.tsx +16 -0
  309. package/templates/next/site-layout.tsx +58 -0
  310. package/templates/next/site-nav.ts +16 -0
  311. package/templates/next/site-not-found.tsx +21 -0
  312. package/templates/next/site-router.tsx +17 -0
package/README.md ADDED
@@ -0,0 +1,313 @@
1
+ # @setsquare/ui
2
+
3
+ React components, design tokens, a dashboard shell and a site shell for public pages, built on [React Aria Components](https://react-spectrum.adobe.com/react-aria/components.html) and Tailwind CSS 4. One attribute switches every size, space and colour that WCAG 2.2 sets a level for between AA and AAA:
4
+
5
+ ```html
6
+ <html data-conformance="aaa">
7
+ ```
8
+
9
+ Setsquare's own portal runs at AAA. Docuccino runs at AA and can offer AAA as a per-person setting.
10
+
11
+ Controls are built in three layers, so the switch changes targets without changing what people see: at AAA a 36px button is still painted at 36px, inside a 44px target.
12
+
13
+ > **What this is and isn't.** The components are built to meet WCAG 2.2 AA, and AAA when AAA is switched on, and they are tested for it (see [What is tested](#what-is-tested)). Automated tests are evidence that the automated checks passed. They are not a conformance claim, and a product is not conformant because it uses these components: content, reading level, link text, headings and error wording are the product's.
14
+
15
+ ## Install
16
+
17
+ ```sh
18
+ pnpm add @setsquare/ui react-aria-components @internationalized/date
19
+ ```
20
+
21
+ It needs React 18.3 or later (Next.js 16 uses React 19), React Aria Components 1.21 or later, and Tailwind CSS 4 in the app. A module is a client component (`'use client'`) only when it needs to be: React Aria, a hook, a context or an event handler. The rest — `StatusBadge`, `Avatar`, `ProductMark`, `Kbd`, `EmptyState`, `IconButton`, `PageHeader`, `PageContent`, the site shell's `SiteShell`, `SiteMain`, `SiteHeader`, `SiteNav`, `SiteFooter` and `SiteFooterGroup`, the content components `Section`, `SectionHeader`, `Container`, `Eyebrow`, `Hero`, `HeroHighlight`, `Card`, `CardGrid`, `Prose`, `Steps`, `Step`, `Split`, `Tag`, `StatList` and `Stat`, `CodeBlock`, `ThemeScript`, `buttonTargetStyles()` and `buttonVisualStyles()` — have no directive, so a server component uses them without shipping them to the browser. Server components can render either kind. A server component that gives a client component an icon (`Alert`, `MenuItem`, `SidebarItem`, a search item) passes the element, `icon={<Folder />}`: a component can't cross into a client component.
22
+
23
+ In the app's global stylesheet, after Tailwind:
24
+
25
+ ```css
26
+ @import "tailwindcss";
27
+ @import "@setsquare/ui/styles.css";
28
+ ```
29
+
30
+ `styles.css` brings the tokens as CSS variables (four themes), Tailwind's theme mapping (`bg-primary`, `h-control`, `min-h-target`…), the `focus-ring` and type utilities, the `dark:` and `aaa:` variants, and an `@source` that points Tailwind at the package's compiled components, which Tailwind doesn't scan in `node_modules` by itself.
31
+
32
+ Load the fonts yourself: the tokens name Atkinson Hyperlegible Next and Atkinson Hyperlegible Mono (`next/font/google`), or set `--font-sans` and `--font-mono` to your own.
33
+
34
+ ```tsx
35
+ import { Button, DashboardShell, ShellMain, TextField } from '@setsquare/ui';
36
+ ```
37
+
38
+ ## Themes and levels
39
+
40
+ - `<html data-conformance="aa|aaa" class="dark?">` picks one of four themes: Light · AA, Dark · AA, Light · AAA, Dark · AAA.
41
+ - Components never read an `-aa` or `-aaa` token directly. They read the alias (`--target-min`, `--control-height`, `--choice-size`, `--focus-width`…) through its utility (`min-h-target`, `h-control`, `size-choice`, `focus-ring`), so no component code changes between levels. The design system's README lists every one.
42
+ - A product brings its `brand` and `brand-subtle` colours. `pnpm lint` runs `scripts/check-contrast.mjs`, which checks every pair the token notes promise in all four themes. Run it again after changing a colour.
43
+
44
+ ### Switching theme and level
45
+
46
+ `ThemeScript` goes in the root layout's `<head>`. It puts the stored choice on `<html>` before the first paint, so the page doesn't flash the wrong theme. `ThemeSwitcher` offers Light, Dark and System (with `level`, AA and AAA too) and keeps the choice where the script reads it.
47
+
48
+ ```tsx
49
+ // app/layout.tsx: the script changes <html> before React hydrates it.
50
+ <html lang="en" suppressHydrationWarning>
51
+ <head>
52
+ <ThemeScript />
53
+ </head>
54
+ <body>{children}</body>
55
+ </html>
56
+
57
+ // in a header or a footer
58
+ <ThemeSwitcher />
59
+ ```
60
+
61
+ - Give both the same options. `storage="cookie"` sends the choice with every request as well, so the server can render `<html>` with it; the default, `localStorage`, keeps it in the browser.
62
+ - System follows the operating system, including when it changes while the page is open. `defaultTheme` is what shows before anyone chooses: `system` unless you say otherwise.
63
+ - For a Content-Security-Policy that lists inline scripts by hash, these are the default scripts' hashes. `themeScriptHash(options)` gives the hash for any other options, and `nonce` takes a per-request nonce instead. `pnpm test` fails if this table and the scripts disagree.
64
+
65
+ | Script | Hash |
66
+ | --- | --- |
67
+ | `<ThemeScript />` | `sha256-Z5PHa59cVDw2tw79t4evpPh8wFvKN39vFaHoJmsq5XY=` |
68
+ | `<ThemeScript storage="cookie" />` | `sha256-RLgTmJnd9qBgn/qicRT4Fvi49baxiD9DFiphOXks2jc=` |
69
+
70
+ ## Three layers
71
+
72
+ Every control that can paint smaller than its target — buttons, links, icon buttons, segments, fields, the select trigger, menu and list rows, sidebar items, calendar days, slider thumbs, breadcrumbs — is built the way Themis (`@tribepad/themis`) builds its buttons:
73
+
74
+ 1. **Target:** the React Aria element a pointer hits (`<button>`, `<a>`, `<input>`, a row, a cell). Transparent, at least `--target-min` both ways — 24px at AA, 44px at AAA. It takes `className`.
75
+ 2. **Paint:** what people see — ground, border, radius, hover, and the focus ring. Sized by `visualSize` and the painted tokens (`--control-height` …), equal at AA and AAA by default. It takes `visualClassName`.
76
+ 3. **Content:** the label, icons and spinner.
77
+
78
+ ```tsx
79
+ <Button visualSize="sm" fullWidth visualClassName="justify-start">Archive</Button>
80
+ ```
81
+
82
+ - The target is the element itself, so checkers measure the size a pointer gets. A field's `<input>` is 44px tall at AAA with its 36px box painted behind it (`fieldBox` and `fieldInput`), rather than a wrapper that focuses the input with a script.
83
+ - The target is in the layout, so targets don't overlap. At AAA that makes things with small paint take more room than they look. The design system's README lists what that costs, and what a 44px target costs whatever the paint.
84
+ - To paint at the target's size instead, raise `--control-height-aaa`, `--control-height-sm-aaa` and `--nav-item-height-aaa` to 44px.
85
+ - For your own button-like element: `buttonTargetStyles()` on a React Aria `Button`, `Link` or `ToggleButton`, `buttonVisualStyles()` on a span inside it.
86
+
87
+ ## Links and cursors
88
+
89
+ - A link in a sentence is a `TextLink`, always underlined: colour alone would need 3:1 against the text around it (WCAG's G183), and `brand` doesn't have it. A plain `<a href>` with no `class` (Markdown, CMS content) gets the same underline from the base styles; `text-link` is the utility.
90
+ - One cursor rule on every target (Layer 1): `pointer` on anything pressed, buttons included; `text` on text entry; `grab` on a slider thumb; `not-allowed` when disabled; `wait` while a button is pending; the default arrow on the current breadcrumb and read-only choices. The design system's README has the table and the reasons.
91
+
92
+ ```tsx
93
+ <p>Invite people by email, or share the <TextLink href="/settings/invite">workspace link</TextLink>.</p>
94
+ ```
95
+
96
+ ## Site layer
97
+
98
+ For a public page — a marketing site, a privacy notice — the stylesheet also brings Tailwind 4 utilities built from the tokens. They work in any Tailwind 4 app, with or without React:
99
+
100
+ ```html
101
+ <section class="section-band">
102
+ <div class="site-container">
103
+ <div class="section-head">
104
+ <p class="eyebrow">How it works</p>
105
+ <h2 class="text-display-section">Three steps, no annotations</h2>
106
+ </div>
107
+ <ol role="list" class="steps">…</ol>
108
+ </div>
109
+ </section>
110
+ ```
111
+
112
+ - Layout: `site-container`, `site-container-narrow`, `section-band`, `section-band-tight`, `section-band-raised`, `section-head` and `split`.
113
+ - Previews: `site-preview` on a box shows a site shell at the box's width instead of the window's, with no iframe. The shell's breakpoints are `site-md`, `site-lg` and `site-xl`, media queries on a real page and container queries in the box.
114
+ - Content: `eyebrow`, `site-prose`, `card-surface`, `card-grid`, `steps`, `stat-list` and `tag`.
115
+ - Type: `text-display`, `text-display-page`, `text-display-section` and `text-lead`, fluid from a 320px viewport to 1280px. Each size has a `rem` part, so it still grows as the page zooms in.
116
+ - Tokens: `--site-max`, `--site-max-narrow`, `--site-gutter`, `--section-y` and `--section-y-tight`, with `max-w-site` and `max-w-site-narrow`.
117
+ - `Button` and `LinkButton` take `visualSize="lg"` for a page's call to action, painted at `--control-height-lg` (44px).
118
+
119
+ The design-system README's Site layer section has the rules. React components apply the same utilities, all server-safe except `LinkCard`:
120
+
121
+ ```tsx
122
+ <Hero
123
+ title={<>API docs that know <HeroHighlight>their history</HeroHighlight></>}
124
+ actions={<LinkButton href="/start" variant="primary" visualSize="lg">Get started</LinkButton>}
125
+ />
126
+ <Section eyebrow="What it reads" title="Everything you already wrote" raised>
127
+ <CardGrid>
128
+ <Card icon={<FileText />} title="Requests" description="Validation rules become request bodies." />
129
+ <LinkCard href="/docs" title="Getting started" description="Install it in a minute." />
130
+ </CardGrid>
131
+ </Section>
132
+ ```
133
+
134
+ - `Section` (with `SectionHeader`, `Container` and `Eyebrow`): a band with its heading. `landmark` names it by that heading; it's off by default.
135
+ - `Hero` and `HeroHighlight`: the landing page's first band, with an optional aside and media.
136
+ - `Card` and `CardGrid`: cards in a list, as many to a row as fit. `LinkCard`: a card that is one link, named by its heading.
137
+ - `Prose`: long text, such as a privacy notice.
138
+ - `Steps` and `Step`: numbered steps, read with their numbers. `Split`: text beside media. `Tag`: a label in a pill, not a status. `StatList` and `Stat`: figures, each with a required `source`.
139
+ - `CodeBlock`: code with a label and a Copy button that says whether it worked; `tone="terminal"` copies the commands without their `$`. `CopyButton` is the button on its own.
140
+
141
+ ## Site shell
142
+
143
+ For public pages: a header, the page and a footer in one column, with the document as the scroller. `SiteShell`, `SiteMain`, `SiteHeader`, `SiteNav`, `SiteFooter` and `SiteFooterGroup` have no directive; `SiteMenu`, `SiteNavLink` and `SitePathProvider` are the client parts.
144
+
145
+ ```tsx
146
+ const NAV = [
147
+ { href: '/product', label: 'Product' },
148
+ { href: '/pricing', label: 'Pricing' },
149
+ ];
150
+
151
+ <SiteShell>
152
+ <SiteHeader
153
+ lockup={<a href="/">Product</a>}
154
+ nav={<SiteNav items={NAV} />}
155
+ menu={<SiteMenu items={NAV} />}
156
+ />
157
+ <SiteMain>{children}</SiteMain>
158
+ <SiteFooter>
159
+ <SiteFooterGroup id="site-nav" title="Product" items={NAV} />
160
+ </SiteFooter>
161
+ </SiteShell>
162
+ ```
163
+
164
+ - One list feeds the header, the phone menu and a footer group, so every copy of the navigation keeps one order.
165
+ - Below `lg` (1024px, generated from the `bp-lg` token) the nav gives way to a Menu button. Its panel pushes the page down rather than covering it, and Escape closes it and puts focus back on the button.
166
+ - Until the page hydrates, the Menu is a link to `#site-nav`: the footer group with that id. So it works with JavaScript off, as long as that group lists every nav item.
167
+ - The current page gets `aria-current="page"`, bold and a marker. Give `SitePathProvider` the router's path, or pass `current`.
168
+ - The header is static. `sticky` sticks it and sets `scroll-padding-top` to its height, so a focused control doesn't end up under it.
169
+ - `Disclosure`, the panel the Menu uses, is also a component of its own: a heading whose button shows and hides what follows.
170
+
171
+ ## Templates
172
+
173
+ `templates/next/root-layout.tsx` is the root layout, `app/layout.tsx`, with `ThemeScript` in its `<head>`.
174
+
175
+ `templates/next/` has App Router files to copy into `app/(portal)/`: `portal-layout.tsx` (the dashboard shell, with React Aria links wired to Next's router), `loading.tsx`, `error.tsx`, `not-found.tsx`, `page-transition.tsx` (React's `<ViewTransition>`, for React 19.3 and later) and `prefetch-on-intent.ts` (prefetches a page when someone is about to open it, which also keeps the page transition). Each page wraps its `ShellMain` in `PageTransition`, not the other way round.
176
+
177
+ For public pages, into `app/(site)/`: `site-layout.tsx` (the site shell, a server component, with a `ThemeSwitcher` in the footer), `site-router.tsx` (React Aria links through Next's router, and the current path for the navigation), `site-nav.ts` (the navigation, once) and `site-not-found.tsx`. The root layout keeps `<html>` and `<head>`.
178
+
179
+ ## Guards
180
+
181
+ React Aria renders the real `<input>` of a checkbox, radio, switch, slider or date field, and the drop button of a drop zone, in a visually hidden span that is `position: absolute` with no offsets. Tailwind's `sr-only` is the same. Such an element is laid out against its nearest *positioned* ancestor. With a scroll container between the two, it doesn't scroll with the content, and when something scrolls it into view — focus, a screen reader's cursor, find in page — the browser scrolls the outer, often `overflow: hidden`, element instead. The page shifts and leaves blank space at the bottom.
182
+
183
+ The components avoid it: every scroll container and every control that hides an input is `relative`. And the three layers come apart as soon as a `className` shrinks a target or a link gets only the paint. Two guards keep product code from bringing either back.
184
+
185
+ ### Lint rules — `@setsquare/ui/lint`
186
+
187
+ | Rule | Reports |
188
+ | --- | --- |
189
+ | `setsquare-ui/no-raw-aria-controls` | Importing React Aria's `Checkbox`, `Radio`, `Switch`, `Slider`, date fields, `Calendar`, `DropZone` or `GridList` instead of the Setsquare version (and `ColorArea`, `ColorSlider`, `ColorWheel`, which have none yet). |
190
+ | `setsquare-ui/positioned-scroll-container` | A class list with `overflow-auto` or `overflow-scroll` (any axis or variant) and no `relative`, `absolute`, `fixed` or `sticky`, in `className`, `cn()`, `clsx()`, `cva()` and similar; and inline `overflow` styles without a `position`. Fixes itself by adding `relative`. |
191
+ | `setsquare-ui/no-static-control-root` | `static` passed in `className` to a Setsquare component whose root has to stay positioned. |
192
+ | `setsquare-ui/no-target-shrink` | `min-h-*` or `min-w-*` in the `className` of `Button`, `LinkButton`, `IconButton` or `Segment`. `className` is the target, and these replace its `--target-min` floor. |
193
+ | `setsquare-ui/no-visual-only-target` | `buttonVisualStyles()` in the `className` of a link or button: the paint on its own, which makes the painted box the pointer target. |
194
+ | `setsquare-ui/client-directive` | A module without `'use client'` that needs it (it imports React Aria, calls a hook other than `use`, `useCallback`, `useDebugValue`, `useId` or `useMemo`, calls `createContext`, or passes an event handler or a function as a prop or child), and one with it that needs none of those. Not in `recommended`: turn it on for the modules of a component library, where server components import them. |
195
+
196
+ ESLint (flat config, with a parser that reads TSX, such as typescript-eslint's):
197
+
198
+ ```js
199
+ // eslint.config.js
200
+ import setsquare from '@setsquare/ui/lint';
201
+ export default [setsquare.configs.recommended];
202
+ ```
203
+
204
+ oxlint (`jsPlugins`, which oxlint marks as alpha):
205
+
206
+ ```jsonc
207
+ // .oxlintrc.json
208
+ {
209
+ "jsPlugins": [{ "name": "setsquare-ui", "specifier": "@setsquare/ui/lint" }],
210
+ "rules": {
211
+ "setsquare-ui/no-raw-aria-controls": "error",
212
+ "setsquare-ui/positioned-scroll-container": "error",
213
+ "setsquare-ui/no-static-control-root": "error",
214
+ "setsquare-ui/no-target-shrink": "error",
215
+ "setsquare-ui/no-visual-only-target": "error"
216
+ }
217
+ }
218
+ ```
219
+
220
+ Turn `no-raw-aria-controls` off in the directory where you wrap React Aria yourself. `positioned-scroll-container` can't see positioning that a library sets inline at runtime (React Aria's popovers are `position: absolute` from a `style` attribute): disable it on that line and say why.
221
+
222
+ ### Page checks — `@setsquare/ui/testing`
223
+
224
+ The lint rules only see class names. These check what the browser laid out, so they also find wrappers, third-party widgets and CSS from elsewhere.
225
+
226
+ ```ts
227
+ import {
228
+ expectAnimationsPausable,
229
+ expectCursorsMatch,
230
+ expectFocusVisible,
231
+ expectLinksDistinguished,
232
+ expectPageReflows,
233
+ expectPositioningContained,
234
+ expectTargetsSized,
235
+ expectTextUnclipped,
236
+ } from '@setsquare/ui/testing';
237
+
238
+ test('settings page', async ({ page }) => {
239
+ await page.goto('/settings');
240
+ await expectPositioningContained(page); // each throws, listing every finding
241
+ await expectTargetsSized(page);
242
+ await expectFocusVisible(page);
243
+ await expectLinksDistinguished(page, { underline: true });
244
+ await expectCursorsMatch(page);
245
+ await expectTextUnclipped(page);
246
+ await expectAnimationsPausable(page);
247
+ await page.setViewportSize({ width: 320, height: 640 });
248
+ await expectPageReflows(page);
249
+ });
250
+ ```
251
+
252
+ - `findUncontainedPositioning()` lists every absolutely positioned element whose containing block is outside its nearest scroll container.
253
+ - `findHiddenOverflowScrolls()` focuses every focusable element, and brings every absolutely positioned one into view the way a screen reader's cursor or find-in-page would (so not a decorative, `aria-hidden` one with no text), with each scroll container scrolled to its start and then its end. It reports every time an `overflow: hidden` element scrolled as a result. It restores scroll positions and focus afterwards.
254
+
255
+ - `findSmallTargets(options?)` lists every pointer target under `--target-min` in either axis, measured as laid out: for a visually hidden input, the control around it. Disabled, hidden and inline elements (links in a sentence) are left out; `ignore` takes a selector for anything the Equivalent exception covers.
256
+ - `findOverlappingTargets()` lists targets whose boxes overlap on screen within one layer (a toast or popover over the page is left out), since WCAG doesn't count the overlapping area. `expectTargetsSized(page)` throws with both lists.
257
+ - `findInvisibleFocus(page)` focuses every control a keyboard reaches, one at a time, and compares a screenshot of it with focus on it and with focus on another control. Any that didn't change have no visible focus indicator (2.4.7). Tooltips, transitions and the caret are turned off for the comparison. A control that focus can't leave (the only one in a modal) comes back as `trapped` rather than passed. `{ ignore }` leaves controls unchecked, such as parts checked on another page, while focus can still move to them. `expectFocusVisible(page)` throws for the rest.
258
+ - `findUndistinguishedLinks(options?)` lists links in running text (laid out inline, in a block with words of its own) that nothing but colour marks, at under 3:1 against the text around them — WCAG's F73. An underline or bottom border, bold or italics the surrounding text doesn't have, or 3:1 passes. `{ underline: true }` holds links to this package's rule instead: underlined. `expectLinksDistinguished(page, options?)` throws with them.
259
+ - `findPageOverflow(options?)` lists everything that reaches past the right edge of the page at the width it is laid out at: `scrolls` when the page scrolls sideways because of it, `clipped` when an `overflow: hidden` or `clip` box at the page's edge cuts off something with words or media in it. Content in a scroller of its own that fits (a `ScrollRegion`, a code block), content clipped inside a component, and fixed-position elements are left out, so a decorative glow bleeding off the edge isn't reported. Set the viewport to 320px for WCAG 1.4.10's reflow width. `expectPageReflows(page, options?)` throws with them.
260
+ - `findClippedText(options?)` applies WCAG 1.4.12's four spacing metrics to the page (line height 1.5, 2em after paragraphs, letter spacing 0.12em, word spacing 0.16em) and lists every box whose content now runs out of it further than before: `clipped` for one that hides its overflow or truncates, `overflows` for one with a set size that the text spills out of. Scroll containers are left out, since their content can still be scrolled to, and so is text that runs out of a box inside a scroller that scrolls that way (code in a code block). The spacing comes off again afterwards. `expectTextUnclipped(page, options?)` throws with them.
261
+ - `findEndlessAnimations(options?)` lists what moves for longer than five seconds (`max`), or forever, with nothing to pause it: the CSS animations, CSS transitions and Web Animations running now (`document.getAnimations()`), and playing videos without `controls`, whether or not they are `aria-hidden`. Something is paused by a control when it sits inside an element whose `id` a visible button names in `data-pauses`. It can't see motion drawn with `requestAnimationFrame`, SVG animation, animated images or canvas, and only sees what is running when it is called. A duration comes back as `Infinity` for anything that repeats forever. `expectAnimationsPausable(page, options?)` throws with them.
262
+ - `findCursorMismatches(page, options?)` hovers every target and reads the cursor at its centre and just inside each corner, so the whole target is checked, not only its paint. Each kind has its expected cursors (`press`: `pointer`; `text`: `text` or `auto`; `drag`: `grab`; `disabled`: `not-allowed`; `pending`: `wait` or `progress`; `readonly` and `current`: `default`); `expect` changes them, and `{ press: ['default'] }` checks a product that keeps the arrow on buttons. `expectCursorsMatch(page, options?)` throws with them.
263
+
264
+ The positioning, target, link, reflow, text-spacing and motion scans run in the page (`page.evaluate(findUncontainedPositioning)`), so they work with any runner that has `evaluate`. The focus check takes screenshots and the cursor check moves the mouse, so they need a Playwright page. Nothing here imports Playwright. The checks that scroll turn smooth scrolling off while they measure, so a page with `scroll-behavior: smooth` is read where things land. Run them on each state that matters, such as with a panel open or errors showing: they only check what is rendered.
265
+
266
+ ## What is tested
267
+
268
+ `pnpm ci:local` runs all of it; each line says what it does and doesn't cover.
269
+
270
+ - **Types:** `tsc` on React 19 (the build) and React 18 (`pnpm typecheck:react18`).
271
+ - **Lint rules:** ESLint's `RuleTester`, and oxlint loading the built plugin through `jsPlugins`.
272
+ - **Contrast:** `scripts/check-contrast.mjs` computes every token pair the usage notes promise, in all four themes. It doesn't check colours a product adds.
273
+ - **Browser (Chromium only):** the design-system previews on React 18, loaded as the design-system artifact loads them:
274
+ - axe-core on every preview in all four themes;
275
+ - keyboard and focus behaviour for the dashboard shell, forms, feedback states, and the slider, date, file and selection controls;
276
+ - the site shell: the phone menu opening, pushing the page down and closing on Escape from the panel or the button; the current page's weight and marker; one order for the header, the phone menu and the footer; a sticky header covering no focused control; and the header fitting at seven widths from 320px to 1280px, either side of `lg` among them;
277
+ - the motion rule on the Hero card's media: the motion check exempts it only for its visible pause control, Pause stops it, reduced motion never starts it, and nothing waits hidden for it;
278
+ - code blocks copying, announcing a second copy, a terminal copying its commands only, and a refused copy; the theme switcher's choice, System following the operating system, the level, and the theme script running under a CSP that allows only its published hash;
279
+ - the content components: link cards named by their titles alone, card grids as lists, a region landmark only where a section asks for one, one `h1` naming `main` on the landing page, which doesn't scroll sideways at 320px, and the contact form's validation, confirmation and hidden honeypot;
280
+ - `ScrollRegion` and the shell's `main` becoming tab stops only while they scroll with nothing focusable in them;
281
+ - every target on every preview at least `--target-min`, and no two overlapping, at AA and AAA;
282
+ - the paint of every three-layer control the same height at AA and AAA, and the focus ring on the paint;
283
+ - every control a keyboard reaches visibly changing when it takes focus, in two themes;
284
+ - every link in running text underlined, and every target showing the cursor the rule gives it, across its whole area;
285
+ - toasts measured against the focused control;
286
+ - nothing on any preview running off its width, no text cut off or spilling with WCAG 1.4.12's spacing applied, and nothing but a loading indicator moving past five seconds, at AA and AAA;
287
+ - the page checks above, each also run on a page built to fail.
288
+ - **Packaging:** `pnpm package:verify` packs the tarball and installs it into a new Next.js app. It builds the app, loads it in both levels, and runs the page checks and the lint plugin from the installed package. It also follows a sidebar link on the freshly started app, to check the templates' page transition runs with its `nav-forward` type. The root layout's `ThemeScript` is checked to put a stored dark theme on `<html>` before any of the page's own JavaScript runs, and the footer's `ThemeSwitcher` to change it for the next page load. A route on the site templates is checked too: the current page, reflow at 320px, the Menu as a link to the footer's navigation with JavaScript off, and the swap to the Menu button when the page hydrates, in the same place and keeping focus.
289
+ - **The docs site** (`apps/docs`): `pnpm test:site` loads every page of its production build in all four themes at 1280px, and at AA and AAA at 390px (and each component the Playground shows). Each run has axe, positioning, targets, underlined links, sideways overflow and console errors. Visible focus runs in three of them (light, dark AAA and 390px AAA: both themes, both levels, both layouts) and cursors in three (light, light AAA and 390px AAA), and both check the sidebar and header, which are the same on every page, on the home page only; a check fails if that selector ever leaves out a control in a page's content. It also fails on console errors, sideways overflow, and any internal link to a page it doesn't check, and it follows a sidebar link, in Chromium and in WebKit, to check that the navigation stays client-side, runs the page transition, and covers the old page while it leaves. It also tries a shadcn/ui theme from the Playground: that it reaches every page, lasts through a reload without a flash, resets, and that a paste can set nothing but valid token values. The findings it accepts are listed in `test/site/pages.mjs`, each with its reason. The site brings its own palette, so its build runs the contrast audit against those colours.
290
+ - **Not tested:** other browsers; real screen readers (VoiceOver, NVDA and JAWS haven't been run on these components); Windows High Contrast; pasting files into the drop zone; everything that depends on a product's content.
291
+
292
+ ## Developing
293
+
294
+ ```sh
295
+ pnpm install
296
+ pnpm build # CSS from tokens/tokens.json, then tsc into dist/
297
+ pnpm test # lint-rule tests (vitest)
298
+ pnpm docs:build # the design-system artifact, into docs/.artifact/
299
+ pnpm test:browser # browser suites (after docs:build); pnpm test:axe for axe on every card
300
+ pnpm docs:site # the docs site (apps/docs) in development
301
+ pnpm docs:site:build # its production build; pnpm test:site then checks every page of it
302
+ pnpm ci:local # everything above, in CI order
303
+ ```
304
+
305
+ - `tokens/tokens.json` is the only place a token value lives. The CSS in `dist/styles/` is generated from it.
306
+ - `docs/design-system/` holds the design-system artifact's text, previews and cover. `pnpm docs:build` assembles the artifact from it and from `src/`.
307
+ - `apps/docs/` is the documentation site, a Next.js app built on the package. Its text is generated from this repository: the READMEs, `index.d.ts`, the lint fixtures, the templates and the changelog. Its colours are Setsquare's, in `apps/docs/palette/setsquare.json`.
308
+ - The site deploys to Vercel as a project whose Root Directory is `apps/docs`. Keep **Include source files outside of the Root Directory in the Build Step** on (the default for new projects): the build reads the READMEs, templates and scripts. `apps/docs/vercel.json` builds the package at the workspace root, then the site. Set `ENABLE_EXPERIMENTAL_COREPACK=1` in the project's environment variables, so Vercel uses the pnpm pinned in `packageManager`.
309
+ - `CLAUDE.md` has the rules this repository works by, and `RELEASING.md` has how a version is published.
310
+
311
+ ## Licence
312
+
313
+ Apache-2.0 licensed. See `LICENSE` and `NOTICE`. "Setsquare" is a trademark of WORKTREE AMIGOS LTD; the licence grants no right to use it.
@@ -0,0 +1,129 @@
1
+ /**
2
+ * @setsquare/ui — React Aria components, tokens, a dashboard shell and a site shell for public pages, with a
3
+ * WCAG 2.2 AA / AAA conformance switch. Controls are built in three layers (target, painted box, content), so the switch changes targets
4
+ * without changing what people see. A module is a client component ('use client') only when it needs to be —
5
+ * React Aria, a hook, a context, an event handler — so server components can use the rest without shipping them
6
+ * to the browser. Import from here, and the styles from "@setsquare/ui/styles.css".
7
+ */
8
+ export { cn } from './lib/cn.js';
9
+ export { useElementWidth } from './lib/use-element-width.js';
10
+ export { Button, LinkButton } from './ui/button.js';
11
+ export type { ButtonProps, LinkButtonProps } from './ui/button.js';
12
+ export { buttonTargetStyles, buttonVisualStyles } from './ui/button-styles.js';
13
+ export type { ButtonVariant, ButtonVisualSize } from './ui/button-styles.js';
14
+ export { TextLink } from './ui/text-link.js';
15
+ export type { TextLinkProps } from './ui/text-link.js';
16
+ export { IconButton } from './ui/icon-button.js';
17
+ export type { IconButtonProps } from './ui/icon-button.js';
18
+ export type { IconComponent, IconProp } from './ui/icon.js';
19
+ export { Tooltip, TooltipTrigger } from './ui/tooltip.js';
20
+ export { Kbd } from './ui/kbd.js';
21
+ export { StatusBadge } from './ui/badge.js';
22
+ export type { StatusTone, StatusBadgeProps } from './ui/badge.js';
23
+ export { Avatar, ProductMark } from './ui/avatar.js';
24
+ export { Breadcrumbs } from './ui/breadcrumbs.js';
25
+ export type { BreadcrumbItem, BreadcrumbsProps } from './ui/breadcrumbs.js';
26
+ export { Menu, MenuItem, MenuSection, MenuSeparator, MenuTrigger, Popover, rowTarget, itemVisual, } from './ui/menu.js';
27
+ export { SegmentedControl, Segment } from './ui/segmented-control.js';
28
+ export { Table, TableHeader, Column, TableBody, Row, Cell } from './ui/table.js';
29
+ export { ScrollRegion } from './ui/scroll-region.js';
30
+ export type { ScrollRegionProps } from './ui/scroll-region.js';
31
+ export { Sheet } from './ui/sheet.js';
32
+ export { AppSearch, CommandSearch, SearchTrigger } from './ui/search.js';
33
+ export type { SearchItem, SearchSection } from './ui/search.js';
34
+ export { DashboardShell, ShellInset, ShellBody, ShellMain, useShell, useOptionalShell, } from './shell/dashboard-shell.js';
35
+ export type { ShellSize, PanelMode, DashboardShellProps } from './shell/dashboard-shell.js';
36
+ export { Sidebar, SidebarHeader, SidebarContent, SidebarFooter, SidebarGroup, SidebarList, SidebarItem, SidebarSwitcher, SidebarTrigger, useSidebarCollapsed, } from './shell/sidebar.js';
37
+ export { AppHeader } from './shell/app-header.js';
38
+ export { SiteShell, SiteMain } from './shell/site-shell.js';
39
+ export type { SiteShellProps, SiteMainProps } from './shell/site-shell.js';
40
+ export { SiteHeader } from './shell/site-header.js';
41
+ export type { SiteHeaderProps } from './shell/site-header.js';
42
+ export { SiteNav } from './shell/site-nav.js';
43
+ export type { SiteNavProps } from './shell/site-nav.js';
44
+ export { SiteNavLink, SitePathProvider } from './shell/site-nav-link.js';
45
+ export type { SiteNavLinkProps, SiteNavLinkVariant } from './shell/site-nav-link.js';
46
+ export { SiteMenu } from './shell/site-menu.js';
47
+ export type { SiteMenuProps } from './shell/site-menu.js';
48
+ export { SiteFooter, SiteFooterGroup } from './shell/site-footer.js';
49
+ export type { SiteFooterProps, SiteFooterGroupProps } from './shell/site-footer.js';
50
+ export { samePath } from './shell/site-path.js';
51
+ export type { SiteNavItem } from './shell/site-path.js';
52
+ export { Disclosure } from './ui/disclosure.js';
53
+ export type { DisclosureProps } from './ui/disclosure.js';
54
+ export { Container, Eyebrow, Section, SectionHeader } from './ui/section.js';
55
+ export type { ContainerProps, SectionProps, SectionHeaderProps } from './ui/section.js';
56
+ export { Card, CardGrid } from './ui/card.js';
57
+ export type { CardProps, CardGridProps } from './ui/card.js';
58
+ export { LinkCard } from './ui/link-card.js';
59
+ export type { LinkCardProps } from './ui/link-card.js';
60
+ export { Hero, HeroHighlight } from './ui/hero.js';
61
+ export type { HeroProps } from './ui/hero.js';
62
+ export { Prose } from './ui/prose.js';
63
+ export type { ProseProps } from './ui/prose.js';
64
+ export { Steps, Step } from './ui/steps.js';
65
+ export type { StepsProps, StepProps } from './ui/steps.js';
66
+ export { Split } from './ui/split.js';
67
+ export type { SplitProps } from './ui/split.js';
68
+ export { Tag } from './ui/tag.js';
69
+ export type { TagProps } from './ui/tag.js';
70
+ export { StatList, Stat } from './ui/stat-list.js';
71
+ export type { StatListProps, StatProps } from './ui/stat-list.js';
72
+ export { CodeBlock } from './ui/code-block.js';
73
+ export type { CodeBlockProps } from './ui/code-block.js';
74
+ export { CopyButton } from './ui/copy-button.js';
75
+ export type { CopyButtonProps } from './ui/copy-button.js';
76
+ export { ThemeScript, themeScript, themeScriptHash, applyTheme, applyLevel, readTheme, readLevel, resolveTheme, subscribeTheme, THEME_CHANGE_EVENT, } from './ui/theme.js';
77
+ export type { ThemeOptions, ThemePreference, ConformanceLevel, ThemeScriptProps, } from './ui/theme.js';
78
+ export { ThemeSwitcher } from './ui/theme-switcher.js';
79
+ export type { ThemeSwitcherProps } from './ui/theme-switcher.js';
80
+ export { PageHeader, PageContent } from './shell/page-header.js';
81
+ export { RightPanel, PanelToggle, PanelSection } from './shell/right-panel.js';
82
+ export { FieldLabel, FieldDescription, FieldError, NecessityContext, fieldBox, fieldInput, fieldWidths, } from './ui/field.js';
83
+ export type { NecessityIndicator, FieldWidth } from './ui/field.js';
84
+ export { TextField, TextArea } from './ui/text-field.js';
85
+ export type { TextFieldProps, TextAreaProps } from './ui/text-field.js';
86
+ export { NumberField } from './ui/number-field.js';
87
+ export type { NumberFieldProps } from './ui/number-field.js';
88
+ export { SearchField } from './ui/search-field.js';
89
+ export type { SearchFieldProps } from './ui/search-field.js';
90
+ export { ListBox, Option, OptionSection } from './ui/list-box.js';
91
+ export { Select } from './ui/select.js';
92
+ export type { SelectProps } from './ui/select.js';
93
+ export { ComboBox } from './ui/combo-box.js';
94
+ export type { ComboBoxProps } from './ui/combo-box.js';
95
+ export { Checkbox, CheckboxGroup, SelectionCheckbox } from './ui/checkbox.js';
96
+ export type { CheckboxProps, CheckboxGroupProps, SelectionCheckboxProps } from './ui/checkbox.js';
97
+ export { RadioGroup, Radio } from './ui/radio-group.js';
98
+ export type { RadioGroupProps, RadioProps } from './ui/radio-group.js';
99
+ export { Switch } from './ui/switch.js';
100
+ export type { SwitchProps } from './ui/switch.js';
101
+ export { Form, FormSection, FormActions, ErrorSummary, StatusMessage } from './ui/form.js';
102
+ export type { FormProps, FormSectionProps, ErrorItem, ErrorSummaryProps } from './ui/form.js';
103
+ export { SpinnerIcon, Spinner, ProgressBar } from './ui/spinner.js';
104
+ export type { SpinnerProps, ProgressBarProps } from './ui/spinner.js';
105
+ export { Skeleton, SkeletonText, TableSkeleton, LoadingState } from './ui/skeleton.js';
106
+ export type { LoadingStateProps } from './ui/skeleton.js';
107
+ export { Alert, OfflineAlert, useOnline } from './ui/alert.js';
108
+ export type { AlertProps, AlertTone } from './ui/alert.js';
109
+ export { EmptyState } from './ui/empty-state.js';
110
+ export type { EmptyStateProps } from './ui/empty-state.js';
111
+ export { Dialog, ConfirmDialog } from './ui/dialog.js';
112
+ export type { DialogProps, ConfirmDialogProps } from './ui/dialog.js';
113
+ export { Toaster, toast, toastQueue } from './ui/toast.js';
114
+ export type { ToastContent, ToastTone } from './ui/toast.js';
115
+ export { ErrorState, ErrorBoundary } from './ui/error-state.js';
116
+ export type { ErrorStateProps, ErrorKind, ErrorBoundaryProps } from './ui/error-state.js';
117
+ export { Slider, RangeSlider } from './ui/slider.js';
118
+ export type { SliderProps, RangeSliderProps } from './ui/slider.js';
119
+ export { Calendar, RangeCalendar } from './ui/calendar.js';
120
+ export type { CalendarProps, RangeCalendarProps } from './ui/calendar.js';
121
+ export { DateField, TimeField, DatePicker, DateRangePicker } from './ui/date-field.js';
122
+ export type { DateFieldProps, TimeFieldProps, DatePickerProps, DateRangePickerProps, } from './ui/date-field.js';
123
+ export { FileUpload, formatBytes } from './ui/file-upload.js';
124
+ export type { FileUploadProps, FileUploadItem, FileUploadStatus, FileRejection, } from './ui/file-upload.js';
125
+ export { GridList, GridListItem } from './ui/grid-list.js';
126
+ export type { GridListProps, GridListItemProps } from './ui/grid-list.js';
127
+ export { SelectionBar } from './ui/selection-bar.js';
128
+ export type { SelectionBarProps } from './ui/selection-bar.js';
129
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACpD,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEnE,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC/E,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,Y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EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAChE,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC1F,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACrD,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC3D,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACvF,YAAY,EACV,cAAc,EACd,cAAc,EACd,eAAe,EACf,oBAAoB,GACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC9D,YAAY,EACV,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,aAAa,GACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC3D,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,YAAY,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,78 @@
1
+ /**
2
+ * @setsquare/ui — React Aria components, tokens, a dashboard shell and a site shell for public pages, with a
3
+ * WCAG 2.2 AA / AAA conformance switch. Controls are built in three layers (target, painted box, content), so the switch changes targets
4
+ * without changing what people see. A module is a client component ('use client') only when it needs to be —
5
+ * React Aria, a hook, a context, an event handler — so server components can use the rest without shipping them
6
+ * to the browser. Import from here, and the styles from "@setsquare/ui/styles.css".
7
+ */
8
+ export { cn } from './lib/cn.js';
9
+ export { useElementWidth } from './lib/use-element-width.js';
10
+ export { Button, LinkButton } from './ui/button.js';
11
+ // From their own module, which has no 'use client', so a server component can call them.
12
+ export { buttonTargetStyles, buttonVisualStyles } from './ui/button-styles.js';
13
+ export { TextLink } from './ui/text-link.js';
14
+ export { IconButton } from './ui/icon-button.js';
15
+ export { Tooltip, TooltipTrigger } from './ui/tooltip.js';
16
+ export { Kbd } from './ui/kbd.js';
17
+ export { StatusBadge } from './ui/badge.js';
18
+ export { Avatar, ProductMark } from './ui/avatar.js';
19
+ export { Breadcrumbs } from './ui/breadcrumbs.js';
20
+ export { Menu, MenuItem, MenuSection, MenuSeparator, MenuTrigger, Popover, rowTarget, itemVisual, } from './ui/menu.js';
21
+ export { SegmentedControl, Segment } from './ui/segmented-control.js';
22
+ export { Table, TableHeader, Column, TableBody, Row, Cell } from './ui/table.js';
23
+ export { ScrollRegion } from './ui/scroll-region.js';
24
+ export { Sheet } from './ui/sheet.js';
25
+ export { AppSearch, CommandSearch, SearchTrigger } from './ui/search.js';
26
+ export { DashboardShell, ShellInset, ShellBody, ShellMain, useShell, useOptionalShell, } from './shell/dashboard-shell.js';
27
+ export { Sidebar, SidebarHeader, SidebarContent, SidebarFooter, SidebarGroup, SidebarList, SidebarItem, SidebarSwitcher, SidebarTrigger, useSidebarCollapsed, } from './shell/sidebar.js';
28
+ export { AppHeader } from './shell/app-header.js';
29
+ // The site shell, for public pages. SiteShell, SiteMain, SiteHeader, SiteNav, SiteFooter and SiteFooterGroup
30
+ // have no 'use client'; SiteMenu and SiteNavLink do.
31
+ export { SiteShell, SiteMain } from './shell/site-shell.js';
32
+ export { SiteHeader } from './shell/site-header.js';
33
+ export { SiteNav } from './shell/site-nav.js';
34
+ export { SiteNavLink, SitePathProvider } from './shell/site-nav-link.js';
35
+ export { SiteMenu } from './shell/site-menu.js';
36
+ export { SiteFooter, SiteFooterGroup } from './shell/site-footer.js';
37
+ export { samePath } from './shell/site-path.js';
38
+ export { Disclosure } from './ui/disclosure.js';
39
+ export { Container, Eyebrow, Section, SectionHeader } from './ui/section.js';
40
+ export { Card, CardGrid } from './ui/card.js';
41
+ export { LinkCard } from './ui/link-card.js';
42
+ export { Hero, HeroHighlight } from './ui/hero.js';
43
+ export { Prose } from './ui/prose.js';
44
+ export { Steps, Step } from './ui/steps.js';
45
+ export { Split } from './ui/split.js';
46
+ export { Tag } from './ui/tag.js';
47
+ export { StatList, Stat } from './ui/stat-list.js';
48
+ export { CodeBlock } from './ui/code-block.js';
49
+ export { CopyButton } from './ui/copy-button.js';
50
+ export { ThemeScript, themeScript, themeScriptHash, applyTheme, applyLevel, readTheme, readLevel, resolveTheme, subscribeTheme, THEME_CHANGE_EVENT, } from './ui/theme.js';
51
+ export { ThemeSwitcher } from './ui/theme-switcher.js';
52
+ export { PageHeader, PageContent } from './shell/page-header.js';
53
+ export { RightPanel, PanelToggle, PanelSection } from './shell/right-panel.js';
54
+ export { FieldLabel, FieldDescription, FieldError, NecessityContext, fieldBox, fieldInput, fieldWidths, } from './ui/field.js';
55
+ export { TextField, TextArea } from './ui/text-field.js';
56
+ export { NumberField } from './ui/number-field.js';
57
+ export { SearchField } from './ui/search-field.js';
58
+ export { ListBox, Option, OptionSection } from './ui/list-box.js';
59
+ export { Select } from './ui/select.js';
60
+ export { ComboBox } from './ui/combo-box.js';
61
+ export { Checkbox, CheckboxGroup, SelectionCheckbox } from './ui/checkbox.js';
62
+ export { RadioGroup, Radio } from './ui/radio-group.js';
63
+ export { Switch } from './ui/switch.js';
64
+ export { Form, FormSection, FormActions, ErrorSummary, StatusMessage } from './ui/form.js';
65
+ export { SpinnerIcon, Spinner, ProgressBar } from './ui/spinner.js';
66
+ export { Skeleton, SkeletonText, TableSkeleton, LoadingState } from './ui/skeleton.js';
67
+ export { Alert, OfflineAlert, useOnline } from './ui/alert.js';
68
+ export { EmptyState } from './ui/empty-state.js';
69
+ export { Dialog, ConfirmDialog } from './ui/dialog.js';
70
+ export { Toaster, toast, toastQueue } from './ui/toast.js';
71
+ export { ErrorState, ErrorBoundary } from './ui/error-state.js';
72
+ export { Slider, RangeSlider } from './ui/slider.js';
73
+ export { Calendar, RangeCalendar } from './ui/calendar.js';
74
+ export { DateField, TimeField, DatePicker, DateRangePicker } from './ui/date-field.js';
75
+ export { FileUpload, formatBytes } from './ui/file-upload.js';
76
+ export { GridList, GridListItem } from './ui/grid-list.js';
77
+ export { SelectionBar } from './ui/selection-bar.js';
78
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEpD,yFAAyF;AACzF,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE/E,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjD,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,OAAO,EACL,IAAI,EACJ,QAAQ,EACR,WAAW,EACX,aAAa,EACb,WAAW,EACX,OAAO,EACP,SAAS,EACT,UAAU,GACX,MAAM,cAAc,CAAC;AAC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M,mBAAmB,CAAC;AAE3D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { type ClassValue } from 'clsx';
2
+ /** Join class names, later ones winning where two set the same property. */
3
+ export declare function cn(...parts: ClassValue[]): string;
4
+ //# sourceMappingURL=cn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../../src/lib/cn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;AAwD7C,4EAA4E;AAC5E,wBAAgB,EAAE,CAAC,GAAG,KAAK,EAAE,UAAU,EAAE,GAAG,MAAM,CAEjD"}