@neo4j-ndl/react 5.3.0 → 5.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/lib/LICENSES.txt +3 -3
  2. package/lib/cjs/ai/presence/stories/ai-presence-thinking.story.js +0 -1
  3. package/lib/cjs/ai/presence/stories/ai-presence-thinking.story.js.map +1 -1
  4. package/lib/cjs/checkbox/stories/checkbox-fluid.story.js +30 -0
  5. package/lib/cjs/checkbox/stories/checkbox-fluid.story.js.map +1 -0
  6. package/lib/cjs/checkbox/stories/index.js +5 -1
  7. package/lib/cjs/checkbox/stories/index.js.map +1 -1
  8. package/lib/cjs/code/Code.js +2 -1
  9. package/lib/cjs/code/Code.js.map +1 -1
  10. package/lib/cjs/data-grid/data-grid-nav/keys.js +0 -1
  11. package/lib/cjs/data-grid/data-grid-nav/keys.js.map +1 -1
  12. package/lib/cjs/index.js +3 -4
  13. package/lib/cjs/index.js.map +1 -1
  14. package/lib/cjs/loading-bar/LoadingBar.js +2 -2
  15. package/lib/cjs/loading-bar/LoadingBar.js.map +1 -1
  16. package/lib/cjs/loading-spinner/LoadingSpinner.js +2 -2
  17. package/lib/cjs/loading-spinner/LoadingSpinner.js.map +1 -1
  18. package/lib/cjs/progress-bar/ProgressBar.js +1 -1
  19. package/lib/cjs/progress-bar/ProgressBar.js.map +1 -1
  20. package/lib/cjs/tag-base/TagBase.js +8 -8
  21. package/lib/cjs/tag-base/TagBase.js.map +1 -1
  22. package/lib/esm/ai/presence/stories/ai-presence-thinking.story.js +0 -1
  23. package/lib/esm/ai/presence/stories/ai-presence-thinking.story.js.map +1 -1
  24. package/lib/esm/checkbox/stories/checkbox-fluid.story.js +28 -0
  25. package/lib/esm/checkbox/stories/checkbox-fluid.story.js.map +1 -0
  26. package/lib/esm/checkbox/stories/index.js +3 -0
  27. package/lib/esm/checkbox/stories/index.js.map +1 -1
  28. package/lib/esm/code/Code.js +2 -1
  29. package/lib/esm/code/Code.js.map +1 -1
  30. package/lib/esm/data-grid/data-grid-nav/keys.js +0 -1
  31. package/lib/esm/data-grid/data-grid-nav/keys.js.map +1 -1
  32. package/lib/esm/index.js +1 -1
  33. package/lib/esm/index.js.map +1 -1
  34. package/lib/esm/loading-bar/LoadingBar.js +2 -2
  35. package/lib/esm/loading-bar/LoadingBar.js.map +1 -1
  36. package/lib/esm/loading-spinner/LoadingSpinner.js +2 -2
  37. package/lib/esm/loading-spinner/LoadingSpinner.js.map +1 -1
  38. package/lib/esm/progress-bar/ProgressBar.js +1 -1
  39. package/lib/esm/progress-bar/ProgressBar.js.map +1 -1
  40. package/lib/esm/tag-base/TagBase.js +8 -8
  41. package/lib/esm/tag-base/TagBase.js.map +1 -1
  42. package/lib/types/ai/presence/stories/ai-presence-thinking.story.d.ts.map +1 -1
  43. package/lib/types/checkbox/stories/checkbox-fluid.story.d.ts +24 -0
  44. package/lib/types/checkbox/stories/checkbox-fluid.story.d.ts.map +1 -0
  45. package/lib/types/checkbox/stories/index.d.ts +2 -0
  46. package/lib/types/checkbox/stories/index.d.ts.map +1 -1
  47. package/lib/types/code/Code.d.ts.map +1 -1
  48. package/lib/types/data-grid/data-grid-nav/keys.d.ts +0 -1
  49. package/lib/types/data-grid/data-grid-nav/keys.d.ts.map +1 -1
  50. package/lib/types/index.d.ts +1 -1
  51. package/lib/types/index.d.ts.map +1 -1
  52. package/lib/types/loading-bar/LoadingBar.d.ts +4 -1
  53. package/lib/types/loading-bar/LoadingBar.d.ts.map +1 -1
  54. package/lib/types/loading-spinner/LoadingSpinner.d.ts +8 -1
  55. package/lib/types/loading-spinner/LoadingSpinner.d.ts.map +1 -1
  56. package/lib/types/progress-bar/ProgressBar.d.ts.map +1 -1
  57. package/package.json +6 -8
  58. package/skills/ndl-react/SKILL.md +20 -21
  59. package/skills/ndl-react/components/ai/presence.md +0 -1
  60. package/skills/ndl-react/components/loading-bar.md +18 -1
  61. package/skills/ndl-react/components/loading-spinner.md +12 -2
  62. package/skills/ndl-react/references/styling.md +9 -8
@@ -11,9 +11,26 @@ Import: `import { LoadingBar } from '@neo4j-ndl/react'`
11
11
  | Prop | Type | Required | Default | Description |
12
12
  |------|------|----------|---------|-------------|
13
13
  | `as` | `ElementType<any, keyof IntrinsicElements>` | | | An override of the default HTML tag of the root of the component. Can also be another React component. |
14
- | `hasRail` | `boolean` | | `false` | |
14
+ | `hasRail` | `boolean` | | `false` | Whether the loading bar has a background rail |
15
+ | `loadingMessage` | `string` | | `Loading` | Visually hidden message for screen readers, for example "Loading search results". |
15
16
  | `ref` | `any` | | | A ref to apply to the root element. |
16
17
 
18
+ ## Accessibility
19
+
20
+ ## Implementation guidelines
21
+
22
+ `LoadingBar` renders an element with `role="status"` that contains visually hidden text.
23
+
24
+ - The text defaults to "Loading". Use `loadingMessage` to say what is loading, for example "Loading search results".
25
+ - Screen readers may not announce the bar when it is added to the page already populated. Announce the loading state yourself, for example by updating a persistent `role="status"` element in your application.
26
+
27
+ ### Related WCAG criteria
28
+
29
+ - [1.1.1 Non-text Content](https://www.w3.org/WAI/WCAG22/Understanding/non-text-content.html) (A): The bar has a visually hidden text alternative that can be customized
30
+ - [2.2.2 Pause, Stop, Hide](https://www.w3.org/WAI/WCAG22/Understanding/pause-stop-hide.html) (A): The indicator animates continuously but loading indicators are generally treated as essential movement.
31
+ - [4.1.2 Name, Role, Value](https://www.w3.org/WAI/WCAG22/Understanding/name-role-value.html) (A): The bar exposes the `status` role
32
+ - [4.1.3 Status Messages](https://www.w3.org/WAI/WCAG22/Understanding/status-messages.html) (AA): The application is responsible for announcing the loading state, see above
33
+
17
34
  ## Examples
18
35
 
19
36
  ### Default
@@ -11,14 +11,24 @@ Import: `import { LoadingSpinner } from '@neo4j-ndl/react'`
11
11
  | Prop | Type | Required | Default | Description |
12
12
  |------|------|----------|---------|-------------|
13
13
  | `as` | `ElementType<any, keyof IntrinsicElements>` | | | An override of the default HTML tag of the root of the component. Can also be another React component. |
14
+ | `loadingMessage` | `string` | | `Loading content` | The aria label for the loading spinner. If not provided, defaults to "Loading content". |
14
15
  | `ref` | `any` | | | A ref to apply to the root element. |
15
- | `size` | `'large' \| 'medium' \| 'small'` | | `small` | |
16
+ | `size` | `'large' \| 'medium' \| 'small'` | | `small` | The size of the loading spinner. |
16
17
 
17
18
  ## Accessibility
18
19
 
19
20
  ## Implementation guidelines
20
21
 
21
- The loading spinner component uses `role='status'` and `aria-label='Loading content'` to notify assistive technologies that a background process is occurring. The `aria-live='polite'` setting ensures screen readers announce the message non-intrusively when the spinner appears or updates. This informs users that content is loading without interrupting their workflow.
22
+ `LoadingSpinner` renders an element with `role="status"` and an accessible name.
23
+
24
+ - The accessible name defaults to "Loading content". Use `loadingMessage` to say what is loading, for example "Loading dashboard".
25
+ - The spinner is a visual indicator without text content, so screen readers may not announce it when it appears. Announce the loading state yourself, for example by updating a persistent `role="status"` element in your application.
26
+
27
+ ### Related WCAG criteria
28
+
29
+ - [1.1.1 Non-text Content](https://www.w3.org/WAI/WCAG22/Understanding/non-text-content.html) (A): The spinner has an accessible name that can be customized
30
+ - [4.1.2 Name, Role, Value](https://www.w3.org/WAI/WCAG22/Understanding/name-role-value.html) (A): The spinner exposes the `status` role with a name
31
+ - [4.1.3 Status Messages](https://www.w3.org/WAI/WCAG22/Understanding/status-messages.html) (AA): The application is responsible for announcing the loading state, see above
22
32
 
23
33
  ## Examples
24
34
 
@@ -187,17 +187,18 @@ exist.
187
187
 
188
188
  **2. What prefix does it use?**
189
189
 
190
- Since `@neo4j-ndl/base` v5 the Needle preset sets **no prefix**, so utilities
191
- are written as plain Tailwind — `flex`, `gap-4`, `text-neutral-text-weak`. An
192
- app can still set its own `prefix` (apps on base v4 got `n-` by default, and
193
- some keep it), and the app's config wins: there every utility carries that
194
- prefix (`n-flex`), and the bare name does nothing. An app with no Tailwind
195
- build at all gets only the prebuilt stylesheet's classes, which are unprefixed.
190
+ The Needle preset sets **no prefix**, so utilities are written as plain
191
+ Tailwind — `flex`, `gap-4`, `text-neutral-text-weak`. An app can still set its own
192
+ `prefix` in its Tailwind config, and the app's config wins: there every utility
193
+ carries that prefix (with `prefix: 'foo-'` you write `foo-flex`) and the bare
194
+ name does nothing. Read `tailwind.config.*` before writing a class. An app with
195
+ no Tailwind build at all gets only the prebuilt stylesheet's classes, which are
196
+ unprefixed.
196
197
 
197
198
  Getting this wrong is invisible: a class at the wrong prefix compiles, passes
198
199
  type-checking and renders nothing. And it can look fine by accident — in a
199
- `prefix: 'n-'` app that also imports the prebuilt CSS, `text-neutral-text-weak`
200
- still renders because the prebuilt file safelists it, while `flex` does not.
200
+ prefixed app that also imports the prebuilt CSS, `text-neutral-text-weak` still
201
+ renders because the prebuilt file safelists it, while `flex` does not.
201
202
 
202
203
  ### Why the prebuilt stylesheet has no layout utilities
203
204