@cognite/aura 1.46768.0 → 1.46840.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.
- package/DESIGN.md +12 -0
- package/dist/components/ui/core/alert/alert.gallery.d.ts +2 -0
- package/dist/components/ui/core/alert/alert.gallery.js +54 -0
- package/dist/components/ui/core/alert/alert.gallery.js.map +1 -0
- package/dist/components/ui/core/avatar/avatar.gallery.d.ts +2 -0
- package/dist/components/ui/core/avatar/avatar.gallery.js +67 -0
- package/dist/components/ui/core/avatar/avatar.gallery.js.map +1 -0
- package/dist/components/ui/core/badge/badge.gallery.d.ts +2 -0
- package/dist/components/ui/core/badge/badge.gallery.js +64 -0
- package/dist/components/ui/core/badge/badge.gallery.js.map +1 -0
- package/dist/components/ui/core/checkbox/checkbox.gallery.d.ts +2 -0
- package/dist/components/ui/core/checkbox/checkbox.gallery.js +36 -0
- package/dist/components/ui/core/checkbox/checkbox.gallery.js.map +1 -0
- package/dist/components/ui/core/switch/switch.gallery.d.ts +2 -0
- package/dist/components/ui/core/switch/switch.gallery.js +67 -0
- package/dist/components/ui/core/switch/switch.gallery.js.map +1 -0
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/components/ui/core/alert/alert.md +46 -0
- package/src/components/ui/core/avatar/avatar.md +30 -0
- package/src/components/ui/core/badge/badge.md +32 -0
- package/src/components/ui/core/checkbox/checkbox.md +37 -0
- package/src/components/ui/core/switch/switch.md +26 -0
package/package.json
CHANGED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
Use an Alert to communicate contextual, medium-emphasis information inside the current page or task flow.
|
|
2
|
+
Alerts are inline and never block the user the way a modal does.
|
|
3
|
+
|
|
4
|
+
## When to use
|
|
5
|
+
|
|
6
|
+
- Providing inline guidance or recommendations in the current task.
|
|
7
|
+
- Calling attention to warnings or issues that need awareness but are not blocking.
|
|
8
|
+
- Offering direct actions that resolve the issue in context.
|
|
9
|
+
|
|
10
|
+
## When to use something else
|
|
11
|
+
|
|
12
|
+
- Use field-level validation when the message relates to a single input.
|
|
13
|
+
- Use a [Banner](?path=/docs/primitives-banner--docs) for page-wide state that should stay visible while users continue.
|
|
14
|
+
- Use a [Sonner Toast](?path=/docs/primitives-sonner-toast--docs) for brief confirmation after an action.
|
|
15
|
+
- Use an Alert Dialog when the user must make a choice before continuing.
|
|
16
|
+
|
|
17
|
+
## Placement
|
|
18
|
+
|
|
19
|
+
- Align Alerts with surrounding content and do not pin them flush against dividers.
|
|
20
|
+
- Use the `card` style for wrapped content in constrained areas.
|
|
21
|
+
- Use the `strip` style for short messages in wider areas.
|
|
22
|
+
|
|
23
|
+
## Variants
|
|
24
|
+
|
|
25
|
+
| Variant | Use |
|
|
26
|
+
| :-------- | :------------------------------------------------------ |
|
|
27
|
+
| `default` | Neutral guidance or information |
|
|
28
|
+
| `info` | Helpful context the user should notice |
|
|
29
|
+
| `warning` | Issues that need attention but do not block the task |
|
|
30
|
+
| `error` | Failures the user needs to resolve to continue the task |
|
|
31
|
+
|
|
32
|
+
## Dos and don'ts
|
|
33
|
+
|
|
34
|
+
- **Do** include action buttons only when they directly resolve or dismiss the Alert.
|
|
35
|
+
- **Do** evaluate simpler feedback methods first, such as field-level validation.
|
|
36
|
+
- **Don't** attach unrelated actions.
|
|
37
|
+
|
|
38
|
+
## Behavior
|
|
39
|
+
|
|
40
|
+
- Alerts sit inline with the page flow.
|
|
41
|
+
- Dismissal removes or hides the Alert, depending on the variant.
|
|
42
|
+
- Keep the action path clear and minimal.
|
|
43
|
+
|
|
44
|
+
## Often used with
|
|
45
|
+
|
|
46
|
+
[Button](?path=/docs/primitives-button--docs) for direct resolution actions.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
Use an Avatar to visually represent a user, team, or concept and help recognition in collaborative UI.
|
|
2
|
+
|
|
3
|
+
## When to use
|
|
4
|
+
|
|
5
|
+
- Showing people in comments, chat, sharing, or collaborator lists.
|
|
6
|
+
- Representing accounts, teams, or organizations.
|
|
7
|
+
- Displaying AI or agent identities in conversational interfaces.
|
|
8
|
+
|
|
9
|
+
## Content
|
|
10
|
+
|
|
11
|
+
- Use an image when one is available, with initials as the fallback if it fails to load.
|
|
12
|
+
- Use initials when no image exists.
|
|
13
|
+
- Use an icon for system users, bots, or special entities.
|
|
14
|
+
|
|
15
|
+
## Colorways and sizes
|
|
16
|
+
|
|
17
|
+
- Decorative colorways (`decorative-1` to `decorative-7`) carry no semantic meaning.
|
|
18
|
+
- Use the `overflow` colorway for "+N" avatars that summarize hidden members.
|
|
19
|
+
- Choose the size based on context density: `default` for most layouts, `xsm` and `xxsm` for dense lists and tables.
|
|
20
|
+
|
|
21
|
+
## Behavior
|
|
22
|
+
|
|
23
|
+
- Avatars are not interactive by default, but can be made interactive when the context needs it.
|
|
24
|
+
- Use overflow patterns in constrained spaces, such as a "+N" Avatar that opens a [Menu](?path=/docs/primitives-dropdown-menu--docs).
|
|
25
|
+
- Avatars can include status badges or dots.
|
|
26
|
+
- Give every Avatar an accessible name with `aria-label`.
|
|
27
|
+
|
|
28
|
+
## Often used with
|
|
29
|
+
|
|
30
|
+
[Badge](?path=/docs/primitives-badge--docs), [Tooltip](?path=/docs/primitives-tooltip--docs) for full names, and [Menu](?path=/docs/primitives-dropdown-menu--docs) for overflow.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
Use a Badge as a compact label for status, category, or metadata.
|
|
2
|
+
|
|
3
|
+
## When to use
|
|
4
|
+
|
|
5
|
+
- Surfacing state at a glance, such as active, draft, or error.
|
|
6
|
+
- Tagging items without taking primary focus from the page.
|
|
7
|
+
|
|
8
|
+
## When to use something else
|
|
9
|
+
|
|
10
|
+
- Use an [Alert](?path=/docs/primitives-alert--docs) or inline text when the message needs explanation or recovery steps.
|
|
11
|
+
- Use a [Button](?path=/docs/primitives-button--docs) for a primary action.
|
|
12
|
+
|
|
13
|
+
## Variants
|
|
14
|
+
|
|
15
|
+
| Variant | Use |
|
|
16
|
+
| :------------------------------- | :-------------------------------------------------------- |
|
|
17
|
+
| `decorative-1` to `decorative-7` | Categories and tags with no semantic meaning; filled only |
|
|
18
|
+
| `inProgress` | Neutral, ongoing status |
|
|
19
|
+
| `success`, `warning`, `error` | Status that carries meaning |
|
|
20
|
+
| `archived` | Items that are no longer active |
|
|
21
|
+
| `secondary` | Counts and low-emphasis metadata |
|
|
22
|
+
| `closable` | Tags the user can remove |
|
|
23
|
+
|
|
24
|
+
## Dos and don'ts
|
|
25
|
+
|
|
26
|
+
- **Do** use semantic variants when the Badge communicates status.
|
|
27
|
+
- **Don't** use decorative variants to communicate status, since they carry no semantic meaning.
|
|
28
|
+
- **Don't** outline decorative variants; they are filled only.
|
|
29
|
+
|
|
30
|
+
## Often used with
|
|
31
|
+
|
|
32
|
+
[Avatar](?path=/docs/primitives-avatar--docs), tables and lists, and filter chips.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
Use a Checkbox to let users independently select one or more options.
|
|
2
|
+
Checkboxes can appear standalone or within menus, tree views, tables, or cards.
|
|
3
|
+
|
|
4
|
+
## When to use
|
|
5
|
+
|
|
6
|
+
- Multiple independent selections are required, such as column visibility in a table.
|
|
7
|
+
- Enabling or disabling settings where changes do not take immediate effect.
|
|
8
|
+
- Confirming agreement before an action, such as delete verification.
|
|
9
|
+
|
|
10
|
+
## When to use something else
|
|
11
|
+
|
|
12
|
+
- Use a [Radio](?path=/docs/primitives-radio-group--docs) when only one option can be selected at a time.
|
|
13
|
+
- Use a [Select](?path=/docs/primitives-select--docs) when options are not displayed simultaneously.
|
|
14
|
+
- Use a [Switch](?path=/docs/primitives-switch--docs) for an immediate on/off toggle.
|
|
15
|
+
|
|
16
|
+
## Layout
|
|
17
|
+
|
|
18
|
+
- Groups stack vertically by default; set `orientation="horizontal"` to lay options out in a row.
|
|
19
|
+
- Use the card layout for options that need descriptions.
|
|
20
|
+
|
|
21
|
+
## Dos and don'ts
|
|
22
|
+
|
|
23
|
+
- **Do** provide a label for every Checkbox.
|
|
24
|
+
- **Do** use the indeterminate state for partial group selection.
|
|
25
|
+
- **Don't** pre-select Checkboxes automatically.
|
|
26
|
+
- **Don't** use a single Checkbox unless it confirms agreement.
|
|
27
|
+
- **Don't** use card variants for long option lists.
|
|
28
|
+
|
|
29
|
+
## Behavior
|
|
30
|
+
|
|
31
|
+
- The Space key toggles the focused Checkbox.
|
|
32
|
+
- The indeterminate state is set programmatically, not by user interaction.
|
|
33
|
+
- Parent and child Checkboxes follow selection cascading rules.
|
|
34
|
+
|
|
35
|
+
## Often used with
|
|
36
|
+
|
|
37
|
+
[Label](?path=/docs/primitives-label--docs), helper text for groups, and the card variant for options that need descriptions.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Use a Switch to turn a setting on or off, with the change taking effect immediately.
|
|
2
|
+
|
|
3
|
+
## When to use
|
|
4
|
+
|
|
5
|
+
- Toggling a setting that takes immediate effect, such as dark mode or notifications.
|
|
6
|
+
|
|
7
|
+
## When to use something else
|
|
8
|
+
|
|
9
|
+
- Use a [Checkbox](?path=/docs/primitives-checkbox--docs) or [Button](?path=/docs/primitives-button--docs) when the change depends on a form and is applied later.
|
|
10
|
+
- Use a [Button](?path=/docs/primitives-button--docs) for one-time or destructive actions.
|
|
11
|
+
- Use a Toggle Group, [Checkbox](?path=/docs/primitives-checkbox--docs), or [Select](?path=/docs/primitives-select--docs) when multiple related toggles need grouping.
|
|
12
|
+
|
|
13
|
+
## Dos and don'ts
|
|
14
|
+
|
|
15
|
+
- **Do** give every Switch a clear, descriptive label that explains what it controls.
|
|
16
|
+
- **Don't** embed Switches inside a [Menu](?path=/docs/primitives-dropdown-menu--docs); use menu checkmarks instead.
|
|
17
|
+
- **Don't** use a Switch for destructive actions.
|
|
18
|
+
|
|
19
|
+
## Behavior
|
|
20
|
+
|
|
21
|
+
- A Switch responds instantly, without a separate form submission.
|
|
22
|
+
- Connect the label to the Switch with `htmlFor` and `id`, or give the Switch an `aria-label` when there is no visible label.
|
|
23
|
+
|
|
24
|
+
## Often used with
|
|
25
|
+
|
|
26
|
+
[Label](?path=/docs/primitives-label--docs) and helper text.
|