@yanolja-next/design-core 0.0.0-stage → 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 (226) hide show
  1. package/AGENTS.md +37 -0
  2. package/README.md +146 -2
  3. package/RULES.md +470 -0
  4. package/catalog.json +1345 -0
  5. package/dist/catalog.d.ts +11 -0
  6. package/dist/components/button/ActionRow.d.ts +2 -0
  7. package/dist/components/button/Button.d.ts +20 -0
  8. package/dist/components/button/ButtonLink.d.ts +9 -0
  9. package/dist/components/button/CopyBox.d.ts +7 -0
  10. package/dist/components/button/CopyButton.d.ts +6 -0
  11. package/dist/components/button/CopyText.d.ts +10 -0
  12. package/dist/components/button/ExpandToggle.d.ts +8 -0
  13. package/dist/components/button/GoLink.d.ts +11 -0
  14. package/dist/components/button/TextButton.d.ts +3 -0
  15. package/dist/components/button/ToolButton.d.ts +7 -0
  16. package/dist/components/button/index.d.ts +19 -0
  17. package/dist/components/data/card/Card.d.ts +31 -0
  18. package/dist/components/data/card/index.d.ts +2 -0
  19. package/dist/components/data/change-group/ChangeGroup.d.ts +10 -0
  20. package/dist/components/data/change-group/MarkList.d.ts +12 -0
  21. package/dist/components/data/change-group/index.d.ts +4 -0
  22. package/dist/components/data/clip-text/ClipText.d.ts +6 -0
  23. package/dist/components/data/clip-text/index.d.ts +2 -0
  24. package/dist/components/data/collection-filter/CollectionFilter.d.ts +19 -0
  25. package/dist/components/data/collection-filter/ToolbarDivider.d.ts +2 -0
  26. package/dist/components/data/collection-filter/index.d.ts +3 -0
  27. package/dist/components/data/container/Container.d.ts +26 -0
  28. package/dist/components/data/container/SectionStack.d.ts +2 -0
  29. package/dist/components/data/container/index.d.ts +3 -0
  30. package/dist/components/data/disclosure/Disclosure.d.ts +10 -0
  31. package/dist/components/data/disclosure/index.d.ts +2 -0
  32. package/dist/components/data/divided/Divided.d.ts +2 -0
  33. package/dist/components/data/divided/index.d.ts +1 -0
  34. package/dist/components/data/empty-state/EmptyState.d.ts +16 -0
  35. package/dist/components/data/empty-state/index.d.ts +2 -0
  36. package/dist/components/data/facts/Facts.d.ts +11 -0
  37. package/dist/components/data/facts/index.d.ts +2 -0
  38. package/dist/components/data/fail-state/FailLine.d.ts +5 -0
  39. package/dist/components/data/fail-state/FailState.d.ts +11 -0
  40. package/dist/components/data/fail-state/index.d.ts +4 -0
  41. package/dist/components/data/figures/Figures.d.ts +30 -0
  42. package/dist/components/data/figures/index.d.ts +2 -0
  43. package/dist/components/data/index.d.ts +38 -0
  44. package/dist/components/data/info-panel/InfoPanel.d.ts +22 -0
  45. package/dist/components/data/info-panel/index.d.ts +2 -0
  46. package/dist/components/data/inline-list/InlineList.d.ts +5 -0
  47. package/dist/components/data/inline-list/index.d.ts +2 -0
  48. package/dist/components/data/key-value/KeyValue.d.ts +7 -0
  49. package/dist/components/data/key-value/KeyValueColumns.d.ts +10 -0
  50. package/dist/components/data/key-value/index.d.ts +4 -0
  51. package/dist/components/data/lines/Lines.d.ts +6 -0
  52. package/dist/components/data/lines/index.d.ts +2 -0
  53. package/dist/components/data/link-card/LinkCard.d.ts +22 -0
  54. package/dist/components/data/link-card/index.d.ts +2 -0
  55. package/dist/components/data/machine-text/MachineText.d.ts +6 -0
  56. package/dist/components/data/machine-text/index.d.ts +2 -0
  57. package/dist/components/data/meta/Meta.d.ts +7 -0
  58. package/dist/components/data/meta/index.d.ts +2 -0
  59. package/dist/components/data/metric-strip/MetricStrip.d.ts +17 -0
  60. package/dist/components/data/metric-strip/index.d.ts +2 -0
  61. package/dist/components/data/more-text/MoreText.d.ts +8 -0
  62. package/dist/components/data/more-text/index.d.ts +2 -0
  63. package/dist/components/data/name-text/NameText.d.ts +4 -0
  64. package/dist/components/data/name-text/index.d.ts +2 -0
  65. package/dist/components/data/note/Note.d.ts +7 -0
  66. package/dist/components/data/note/index.d.ts +2 -0
  67. package/dist/components/data/page-foot/PageFoot.d.ts +3 -0
  68. package/dist/components/data/page-foot/index.d.ts +1 -0
  69. package/dist/components/data/pagination/Pagination.d.ts +10 -0
  70. package/dist/components/data/pagination/index.d.ts +2 -0
  71. package/dist/components/data/pick-list/PickList.d.ts +24 -0
  72. package/dist/components/data/pick-list/index.d.ts +2 -0
  73. package/dist/components/data/prose/PlainText.d.ts +3 -0
  74. package/dist/components/data/prose/Prose.d.ts +3 -0
  75. package/dist/components/data/prose/index.d.ts +4 -0
  76. package/dist/components/data/rail/Rail.d.ts +30 -0
  77. package/dist/components/data/rail/index.d.ts +1 -0
  78. package/dist/components/data/skeleton/Skeleton.d.ts +48 -0
  79. package/dist/components/data/skeleton/index.d.ts +2 -0
  80. package/dist/components/data/skeleton/placeholder.d.ts +13 -0
  81. package/dist/components/data/split-panes/SplitPanes.d.ts +3 -0
  82. package/dist/components/data/split-panes/index.d.ts +2 -0
  83. package/dist/components/data/steps/Steps.d.ts +10 -0
  84. package/dist/components/data/steps/index.d.ts +2 -0
  85. package/dist/components/data/sub-head/SubHead.d.ts +6 -0
  86. package/dist/components/data/sub-head/index.d.ts +2 -0
  87. package/dist/components/data/table/Table.d.ts +95 -0
  88. package/dist/components/data/table/TableClip.d.ts +6 -0
  89. package/dist/components/data/table/TableMore.d.ts +2 -0
  90. package/dist/components/data/table/TableSkeleton.d.ts +20 -0
  91. package/dist/components/data/table/TableSubLine.d.ts +8 -0
  92. package/dist/components/data/table/index.d.ts +9 -0
  93. package/dist/components/data/tabs/Tabs.d.ts +14 -0
  94. package/dist/components/data/tabs/index.d.ts +2 -0
  95. package/dist/components/data/term-list/TermList.d.ts +10 -0
  96. package/dist/components/data/term-list/index.d.ts +2 -0
  97. package/dist/components/data/url-text/UrlText.d.ts +11 -0
  98. package/dist/components/data/url-text/index.d.ts +2 -0
  99. package/dist/components/data/usage-bar/UsageBar.d.ts +19 -0
  100. package/dist/components/data/usage-bar/index.d.ts +2 -0
  101. package/dist/components/data/veiled/Veiled.d.ts +6 -0
  102. package/dist/components/data/veiled/index.d.ts +2 -0
  103. package/dist/components/data/warn-line/WarnLine.d.ts +6 -0
  104. package/dist/components/data/warn-line/index.d.ts +2 -0
  105. package/dist/components/forms/badge/Badge.d.ts +10 -0
  106. package/dist/components/forms/badge/index.d.ts +2 -0
  107. package/dist/components/forms/checkbox/Checkbox.d.ts +18 -0
  108. package/dist/components/forms/checkbox/index.d.ts +2 -0
  109. package/dist/components/forms/chip/Chip.d.ts +14 -0
  110. package/dist/components/forms/chip/ChipList.d.ts +2 -0
  111. package/dist/components/forms/chip/index.d.ts +3 -0
  112. package/dist/components/forms/code-input/CodeInput.d.ts +8 -0
  113. package/dist/components/forms/code-input/index.d.ts +2 -0
  114. package/dist/components/forms/combobox/Combobox.d.ts +28 -0
  115. package/dist/components/forms/combobox/index.d.ts +2 -0
  116. package/dist/components/forms/control.d.ts +6 -0
  117. package/dist/components/forms/field/Field.d.ts +32 -0
  118. package/dist/components/forms/field/index.d.ts +2 -0
  119. package/dist/components/forms/field-group/FieldGroup.d.ts +6 -0
  120. package/dist/components/forms/field-group/index.d.ts +2 -0
  121. package/dist/components/forms/form/Form.d.ts +2 -0
  122. package/dist/components/forms/form/index.d.ts +1 -0
  123. package/dist/components/forms/form-actions/FormActions.d.ts +5 -0
  124. package/dist/components/forms/form-actions/index.d.ts +2 -0
  125. package/dist/components/forms/index.d.ts +16 -0
  126. package/dist/components/forms/input/Input.d.ts +12 -0
  127. package/dist/components/forms/input/index.d.ts +2 -0
  128. package/dist/components/forms/radio/Radio.d.ts +10 -0
  129. package/dist/components/forms/radio/index.d.ts +2 -0
  130. package/dist/components/forms/segmented/Segmented.d.ts +20 -0
  131. package/dist/components/forms/segmented/index.d.ts +2 -0
  132. package/dist/components/forms/select/Select.d.ts +30 -0
  133. package/dist/components/forms/select/SelectText.d.ts +2 -0
  134. package/dist/components/forms/select/index.d.ts +3 -0
  135. package/dist/components/forms/status-indicator/StatusIndicator.d.ts +12 -0
  136. package/dist/components/forms/status-indicator/index.d.ts +2 -0
  137. package/dist/components/forms/switch/Switch.d.ts +7 -0
  138. package/dist/components/forms/switch/index.d.ts +2 -0
  139. package/dist/components/forms/textarea/Textarea.d.ts +5 -0
  140. package/dist/components/forms/textarea/index.d.ts +2 -0
  141. package/dist/components/icon/Icon.d.ts +10 -0
  142. package/dist/components/icon/SwapIcon.d.ts +2 -0
  143. package/dist/components/icon/icons.d.ts +286 -0
  144. package/dist/components/icon/index.d.ts +3 -0
  145. package/dist/components/link/Link.d.ts +12 -0
  146. package/dist/components/link/TextLink.d.ts +8 -0
  147. package/dist/components/link/index.d.ts +4 -0
  148. package/dist/components/overlay/index.d.ts +6 -0
  149. package/dist/components/overlay/menu/Menu.d.ts +36 -0
  150. package/dist/components/overlay/menu/index.d.ts +2 -0
  151. package/dist/components/overlay/modal/ConfirmModal.d.ts +15 -0
  152. package/dist/components/overlay/modal/Modal.d.ts +34 -0
  153. package/dist/components/overlay/modal/PanelHeader.d.ts +32 -0
  154. package/dist/components/overlay/modal/index.d.ts +5 -0
  155. package/dist/components/overlay/popover/Popover.d.ts +23 -0
  156. package/dist/components/overlay/popover/index.d.ts +2 -0
  157. package/dist/components/overlay/sheet/Sheet.d.ts +31 -0
  158. package/dist/components/overlay/sheet/index.d.ts +2 -0
  159. package/dist/components/overlay/toast/Toast.d.ts +20 -0
  160. package/dist/components/overlay/toast/index.d.ts +2 -0
  161. package/dist/components/overlay/tooltip/InfoTip.d.ts +8 -0
  162. package/dist/components/overlay/tooltip/TipText.d.ts +6 -0
  163. package/dist/components/overlay/tooltip/Tooltip.d.ts +14 -0
  164. package/dist/components/overlay/tooltip/index.d.ts +6 -0
  165. package/dist/components/reason/LockedPreview.d.ts +2 -0
  166. package/dist/components/reason/WithReason.d.ts +10 -0
  167. package/dist/components/reason/index.d.ts +3 -0
  168. package/dist/components/shell/app-shell/AppShell.d.ts +7 -0
  169. package/dist/components/shell/app-shell/index.d.ts +4 -0
  170. package/dist/components/shell/app-shell/sideNav.d.ts +12 -0
  171. package/dist/components/shell/drawer/Drawer.d.ts +36 -0
  172. package/dist/components/shell/drawer/index.d.ts +2 -0
  173. package/dist/components/shell/help-panel/HelpPanel.d.ts +33 -0
  174. package/dist/components/shell/help-panel/index.d.ts +2 -0
  175. package/dist/components/shell/index.d.ts +12 -0
  176. package/dist/components/shell/match/Keycap.d.ts +2 -0
  177. package/dist/components/shell/match/MatchText.d.ts +4 -0
  178. package/dist/components/shell/page-head/HeadMore.d.ts +15 -0
  179. package/dist/components/shell/page-head/PageHead.d.ts +39 -0
  180. package/dist/components/shell/page-head/index.d.ts +6 -0
  181. package/dist/components/shell/page-head/pagePath.d.ts +10 -0
  182. package/dist/components/shell/rank.d.ts +1 -0
  183. package/dist/components/shell/sidebar/Sidebar.d.ts +40 -0
  184. package/dist/components/shell/sidebar/index.d.ts +2 -0
  185. package/dist/components/shell/sign-in-card/SignInCard.d.ts +29 -0
  186. package/dist/components/shell/sign-in-card/index.d.ts +2 -0
  187. package/dist/components/shell/slash.d.ts +3 -0
  188. package/dist/components/shell/standalone-panel/StandalonePanel.d.ts +6 -0
  189. package/dist/components/shell/standalone-panel/index.d.ts +2 -0
  190. package/dist/components/shell/topbar/Topbar.d.ts +76 -0
  191. package/dist/components/shell/topbar/index.d.ts +2 -0
  192. package/dist/components/viz/chart/BarChart.d.ts +6 -0
  193. package/dist/components/viz/chart/ChartFrame.d.ts +34 -0
  194. package/dist/components/viz/chart/ChartHead.d.ts +9 -0
  195. package/dist/components/viz/chart/ChartLegend.d.ts +17 -0
  196. package/dist/components/viz/chart/ChartSkeleton.d.ts +6 -0
  197. package/dist/components/viz/chart/LineChart.d.ts +6 -0
  198. package/dist/components/viz/chart/Sparkline.d.ts +14 -0
  199. package/dist/components/viz/chart/TimeSeriesChart.d.ts +7 -0
  200. package/dist/components/viz/chart/bubble.d.ts +1 -0
  201. package/dist/components/viz/chart/index.d.ts +16 -0
  202. package/dist/components/viz/chart/layout.d.ts +212 -0
  203. package/dist/components/viz/chart/timeSeries.d.ts +44 -0
  204. package/dist/components/viz/code-block/CodeBlock.d.ts +18 -0
  205. package/dist/components/viz/code-block/index.d.ts +2 -0
  206. package/dist/components/viz/index.d.ts +2 -0
  207. package/dist/i18n/en.d.ts +88 -0
  208. package/dist/i18n/index.d.ts +15 -0
  209. package/dist/index.d.ts +22 -0
  210. package/dist/index.js +10142 -0
  211. package/dist/lib/afterPress.d.ts +1 -0
  212. package/dist/lib/arrival.d.ts +3 -0
  213. package/dist/lib/cn.d.ts +2 -0
  214. package/dist/lib/copied.d.ts +5 -0
  215. package/dist/lib/floating.d.ts +5 -0
  216. package/dist/lib/focusAfter.d.ts +2 -0
  217. package/dist/lib/hit.d.ts +1 -0
  218. package/dist/lib/level.d.ts +1 -0
  219. package/dist/lib/media.d.ts +3 -0
  220. package/dist/lib/motion.d.ts +20 -0
  221. package/dist/lib/pageScroll.d.ts +6 -0
  222. package/dist/lib/scrollbar.d.ts +1 -0
  223. package/dist/styles.css +2 -0
  224. package/llms.txt +201 -0
  225. package/package.json +68 -3
  226. package/skill/SKILL.md +38 -0
package/AGENTS.md ADDED
@@ -0,0 +1,37 @@
1
+ # Instructions for AI agents
2
+
3
+ This package (`@yanolja-next/design-core`) holds the product-neutral parts of the Yanolja NEXT design system. Follow these steps when you build or change a React screen in a product that uses it.
4
+
5
+ ## Before you write a screen
6
+
7
+ 1. Read `catalog.json` in this package. If the package is not installed, install it first (see `README.md`). If the repository is next-hub, read `design-system/core/src/catalog.ts` in the workspace instead. When the two differ, the installed package is correct for that product.
8
+ 2. Write in one line what the screen part must do. Find the entry whose `intent` and `use` match that line.
9
+ 3. If the entry's `avoid` matches your case, go to an entry in `instead`.
10
+ 4. Read the rule that the entry names (`rule`, E.g., `P6`) in `RULES.md`.
11
+ 5. Read the props of the part in `dist/index.d.ts`. In the next-hub workspace, `dist` exists only after a build. Read the part source in `design-system/core/src/components` instead.
12
+
13
+ ## App setup
14
+
15
+ Before the first screen, check the app setup in `README.md`: the CSS imports, `setLocale` for an English app, `LinkProvider` for a router app, `ToastProvider`, the sign-out route, the page path in the top bar and the jsdom test stubs.
16
+
17
+ ## Screen CSS holds layout only
18
+
19
+ - Screen CSS holds page layout only: grids, column widths, spacing between sections and one-off positions.
20
+ - Do not build a part in screen CSS. A part is anything with its own look or behavior: a box, a text style, a state, a hover or press, or a keyboard pattern.
21
+ - Do not write raw colours, font sizes, radii or durations. Use the token variables (`var(--c-text)`, `var(--t-13)`) or a part.
22
+
23
+ ## When no part fits
24
+
25
+ 1. Build the part in the product's own kit, with a catalog entry (intent, use, avoid, instead). Do not build it in screen CSS.
26
+ 2. Design the part by its intent. Its props name what varies inside that intent, such as tone, size or state. Do not add a flag that copies one screen's CSS.
27
+ 3. If another product already has a kit part with the same intent, open an issue or a next-hub pull request to move the part to core. A part moves to core when a second product needs it, and the move removes product words from its catalog entry and its props.
28
+
29
+ ## Themes
30
+
31
+ Do not add or change a theme by yourself. A theme is a design decision. Ask the user which semantic values must change.
32
+
33
+ ## Do not
34
+
35
+ - Do not import from a path inside the package (`@yanolja-next/design-core/dist/...`). Import from the package name.
36
+ - Do not copy a part into the product to change its look. Extend the part, or ask for a new part.
37
+ - Do not use this package with React 18. Stop and tell the user.
package/README.md CHANGED
@@ -1,3 +1,147 @@
1
- # Temporary Holding Version
1
+ # @yanolja-next/design-core
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Product-neutral React parts of the Yanolja NEXT design system, with their prebuilt CSS.
4
+ The values (colours, sizes, motion, fonts) come from `@yanolja-next/design-tokens`.
5
+
6
+ ## Install
7
+
8
+ ```sh
9
+ pnpm add @yanolja-next/design-tokens @yanolja-next/design-core pretendard
10
+ ```
11
+
12
+ The parts need React 19 (`react` and `react-dom` are peer dependencies).
13
+
14
+ ## CSS
15
+
16
+ Import the fonts and the prebuilt CSS once, at the app entry:
17
+
18
+ ```ts
19
+ import 'pretendard/dist/web/variable/pretendardvariable-dynamic-subset.css';
20
+ import '@yanolja-next/design-tokens/fonts.css';
21
+ import '@yanolja-next/design-core/styles.css';
22
+ ```
23
+
24
+ - `styles.css` holds the token variables, the Tailwind utilities that the parts use and the base rules. The app does not need Tailwind.
25
+ - All layered rules sit under the cascade layer `ds` (`ds.theme`, `ds.base`, `ds.components`, `ds.utilities`). Your unlayered CSS wins over them. A layer you declare before `ds` loses to them (see the Tailwind notes below).
26
+ - An app that runs Tailwind can add `@yanolja-next/design-tokens/tailwind.css` to its own Tailwind entry. Then classes such as `bg-panel` and `text-13` read the same tokens.
27
+ - For visually hidden text (a label that only screen readers read), use the `sr-only` class. `styles.css` ships it, so an app without Tailwind can use it too.
28
+
29
+ ### Tailwind apps: put your layers before `ds`
30
+
31
+ Your utilities and the part utilities share names (`grid`, `flex`, `hidden`). If your utility layer comes after `ds`, your `.grid` beats a part's responsive rule on the same element, such as `tablet:hidden`. On a phone the top bar then shows two menu buttons. Import your Tailwind entry before `@yanolja-next/design-core/styles.css`, so your layers are declared first and the parts win on their own elements.
32
+
33
+ ### Tailwind apps: do not add the preflight again
34
+
35
+ `styles.css` already holds the Tailwind preflight in `ds.base`. Do not use `@import 'tailwindcss'` in your Tailwind entry. That import adds the preflight again in a layer after `ds`, and it removes the backgrounds and borders of the parts. Import the theme and the utilities only:
36
+
37
+ ```css
38
+ @layer theme, base, components, utilities;
39
+ @import 'tailwindcss/theme.css' layer(theme);
40
+ @import '@yanolja-next/design-tokens/tailwind.css';
41
+ @import 'tailwindcss/utilities.css' layer(utilities);
42
+
43
+ /* The same narrow-screen variants as core */
44
+ @custom-variant laptop (@media (max-width: 1180px));
45
+ @custom-variant tablet (@media (max-width: 900px));
46
+ @custom-variant phone (@media (max-width: 640px));
47
+ ```
48
+
49
+ ## App setup
50
+
51
+ Do these steps once, at the app entry.
52
+
53
+ ### Language
54
+
55
+ The text inside the parts is Korean by default. An English app calls `setLocale('en')` before the first render. Call it in the test setup too, or the tests see Korean text.
56
+
57
+ ```ts
58
+ import { setLocale } from '@yanolja-next/design-core';
59
+
60
+ setLocale('en');
61
+ ```
62
+
63
+ ### Router links
64
+
65
+ Topbar, Sidebar, Drawer, Tabs, `TableName href`, `MetricStrip href` and other parts draw their own links. Without `LinkProvider`, they draw a plain `<a>` and each click reloads the page. Give the router link to `LinkProvider` at the top of the app:
66
+
67
+ ```tsx
68
+ import { type LinkProps, LinkProvider, ToastProvider } from '@yanolja-next/design-core';
69
+ import { Link as RouterLink } from 'react-router-dom';
70
+
71
+ const Link = ({ href, ...props }: LinkProps) => <RouterLink to={href} {...props} />;
72
+
73
+ <LinkProvider component={Link}>
74
+ <ToastProvider>
75
+ <App />
76
+ </ToastProvider>
77
+ </LinkProvider>;
78
+ ```
79
+
80
+ ### Toasts
81
+
82
+ `ToastProvider` draws the toasts. Inside it, a component calls `useToast().show({ title })`.
83
+
84
+ Code outside a component, such as a data hook at the end of a request, calls `showToast({ title })`. It uses the mounted `ToastProvider`. When no `ToastProvider` is mounted, it does nothing.
85
+
86
+ ### Sign-out
87
+
88
+ The account menu in Topbar has a sign-out link, not a callback. Give its address in `signOutHref` and add a route at that address that signs the user out (E.g., `/sign-out`).
89
+
90
+ ### Page path in the top bar
91
+
92
+ `PageHead crumbs` does not draw the path in the page. It sends the path to the shell through `PagePathContext`, and Topbar draws it. `AppShell` does not do this by itself. Keep the path in state, provide the setter, and give the path to `Topbar path`:
93
+
94
+ ```tsx
95
+ const [path, setPath] = useState<PagePath>();
96
+
97
+ <AppShell topbar={<Topbar path={path} signOutHref="/sign-out" {...rest} />} sidebar={sidebar}>
98
+ <PagePathContext.Provider value={setPath}>{children}</PagePathContext.Provider>
99
+ </AppShell>;
100
+ ```
101
+
102
+ ## Tests in jsdom
103
+
104
+ The Radix parts (Select, Popover, Menu, Toast and others) call browser APIs that jsdom does not have, and the tests crash. Add these stubs to the test setup file:
105
+
106
+ ```ts
107
+ class ResizeObserverStub {
108
+ observe() {}
109
+ unobserve() {}
110
+ disconnect() {}
111
+ }
112
+ globalThis.ResizeObserver ??= ResizeObserverStub as unknown as typeof ResizeObserver;
113
+ Element.prototype.hasPointerCapture ??= () => false;
114
+ Element.prototype.releasePointerCapture ??= () => {};
115
+ Element.prototype.scrollIntoView ??= () => {};
116
+ window.matchMedia ??= ((query: string) => ({
117
+ matches: query === '(prefers-reduced-motion: reduce)',
118
+ media: query,
119
+ onchange: null,
120
+ addListener: () => {},
121
+ removeListener: () => {},
122
+ addEventListener: () => {},
123
+ removeEventListener: () => {},
124
+ dispatchEvent: () => false,
125
+ })) as unknown as typeof window.matchMedia;
126
+ ```
127
+
128
+ The `matchMedia` stub turns on reduced motion, so counters and bars show their final value at once.
129
+
130
+ Some parts behave differently from native elements in tests:
131
+
132
+ - `Select` is a Radix select, not a native `<select>`. `fireEvent.change` does nothing. Open it with a click and click the option.
133
+ - `Button loading` sets `aria-busy`, not `disabled`. Assert `aria-busy="true"`, not `toBeDisabled()`.
134
+
135
+ ## Theme
136
+
137
+ The default theme is the light theme of the NEXT Hub console. A product theme changes only semantic values (for example `--c-accent`). Ask the design owner before you add one.
138
+
139
+ ## Find a part
140
+
141
+ Pick a part by what you want to do, not by its name:
142
+
143
+ - `catalog.json`: every part with its intent, where to use it, where not to use it, what to use instead, and the rule it follows. The package also exports it as `catalog`.
144
+ - `RULES.md`: the screen rules (P1 to P20, L1 to L5) that the catalog names.
145
+ - `llms.txt`: a one-screen index for AI agents.
146
+ - `AGENTS.md`: instructions for AI agents. Point your repository `AGENTS.md` or `CLAUDE.md` at `node_modules/@yanolja-next/design-core/AGENTS.md`.
147
+ - `dist/index.d.ts`: the props of every part. In the next-hub workspace, `dist` exists only after a build. Read the part source in `design-system/core/src/components` instead.