@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.
- package/lib/LICENSES.txt +3 -3
- package/lib/cjs/ai/presence/stories/ai-presence-thinking.story.js +0 -1
- package/lib/cjs/ai/presence/stories/ai-presence-thinking.story.js.map +1 -1
- package/lib/cjs/checkbox/stories/checkbox-fluid.story.js +30 -0
- package/lib/cjs/checkbox/stories/checkbox-fluid.story.js.map +1 -0
- package/lib/cjs/checkbox/stories/index.js +5 -1
- package/lib/cjs/checkbox/stories/index.js.map +1 -1
- package/lib/cjs/code/Code.js +2 -1
- package/lib/cjs/code/Code.js.map +1 -1
- package/lib/cjs/data-grid/data-grid-nav/keys.js +0 -1
- package/lib/cjs/data-grid/data-grid-nav/keys.js.map +1 -1
- package/lib/cjs/index.js +3 -4
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/loading-bar/LoadingBar.js +2 -2
- package/lib/cjs/loading-bar/LoadingBar.js.map +1 -1
- package/lib/cjs/loading-spinner/LoadingSpinner.js +2 -2
- package/lib/cjs/loading-spinner/LoadingSpinner.js.map +1 -1
- package/lib/cjs/progress-bar/ProgressBar.js +1 -1
- package/lib/cjs/progress-bar/ProgressBar.js.map +1 -1
- package/lib/cjs/tag-base/TagBase.js +8 -8
- package/lib/cjs/tag-base/TagBase.js.map +1 -1
- package/lib/esm/ai/presence/stories/ai-presence-thinking.story.js +0 -1
- package/lib/esm/ai/presence/stories/ai-presence-thinking.story.js.map +1 -1
- package/lib/esm/checkbox/stories/checkbox-fluid.story.js +28 -0
- package/lib/esm/checkbox/stories/checkbox-fluid.story.js.map +1 -0
- package/lib/esm/checkbox/stories/index.js +3 -0
- package/lib/esm/checkbox/stories/index.js.map +1 -1
- package/lib/esm/code/Code.js +2 -1
- package/lib/esm/code/Code.js.map +1 -1
- package/lib/esm/data-grid/data-grid-nav/keys.js +0 -1
- package/lib/esm/data-grid/data-grid-nav/keys.js.map +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/loading-bar/LoadingBar.js +2 -2
- package/lib/esm/loading-bar/LoadingBar.js.map +1 -1
- package/lib/esm/loading-spinner/LoadingSpinner.js +2 -2
- package/lib/esm/loading-spinner/LoadingSpinner.js.map +1 -1
- package/lib/esm/progress-bar/ProgressBar.js +1 -1
- package/lib/esm/progress-bar/ProgressBar.js.map +1 -1
- package/lib/esm/tag-base/TagBase.js +8 -8
- package/lib/esm/tag-base/TagBase.js.map +1 -1
- package/lib/types/ai/presence/stories/ai-presence-thinking.story.d.ts.map +1 -1
- package/lib/types/checkbox/stories/checkbox-fluid.story.d.ts +24 -0
- package/lib/types/checkbox/stories/checkbox-fluid.story.d.ts.map +1 -0
- package/lib/types/checkbox/stories/index.d.ts +2 -0
- package/lib/types/checkbox/stories/index.d.ts.map +1 -1
- package/lib/types/code/Code.d.ts.map +1 -1
- package/lib/types/data-grid/data-grid-nav/keys.d.ts +0 -1
- package/lib/types/data-grid/data-grid-nav/keys.d.ts.map +1 -1
- package/lib/types/index.d.ts +1 -1
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/loading-bar/LoadingBar.d.ts +4 -1
- package/lib/types/loading-bar/LoadingBar.d.ts.map +1 -1
- package/lib/types/loading-spinner/LoadingSpinner.d.ts +8 -1
- package/lib/types/loading-spinner/LoadingSpinner.d.ts.map +1 -1
- package/lib/types/progress-bar/ProgressBar.d.ts.map +1 -1
- package/package.json +6 -8
- package/skills/ndl-react/SKILL.md +20 -21
- package/skills/ndl-react/components/ai/presence.md +0 -1
- package/skills/ndl-react/components/loading-bar.md +18 -1
- package/skills/ndl-react/components/loading-spinner.md +12 -2
- 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
|
-
|
|
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
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
build at all gets only the prebuilt stylesheet's classes, which are
|
|
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
|
-
|
|
200
|
-
|
|
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
|
|