@cognite/aura 1.46884.0 → 1.47174.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 +5 -0
- package/dist/components/ui/core/banner/banner.gallery.d.ts +2 -0
- package/dist/components/ui/core/banner/banner.gallery.js +56 -0
- package/dist/components/ui/core/banner/banner.gallery.js.map +1 -0
- package/dist/components/ui/core/data-grid/data-grid.js +1 -19
- package/dist/components/ui/core/data-grid/data-grid.js.map +1 -1
- package/dist/components/ui/core/input/input.gallery.d.ts +2 -0
- package/dist/components/ui/core/input/input.gallery.js +89 -0
- package/dist/components/ui/core/input/input.gallery.js.map +1 -0
- package/dist/components/ui/core/label/label.gallery.d.ts +2 -0
- package/dist/components/ui/core/label/label.gallery.js +57 -0
- package/dist/components/ui/core/label/label.gallery.js.map +1 -0
- package/dist/components/ui/core/radio-group/radio-group.gallery.d.ts +2 -0
- package/dist/components/ui/core/radio-group/radio-group.gallery.js +44 -0
- package/dist/components/ui/core/radio-group/radio-group.gallery.js.map +1 -0
- package/dist/components/ui/core/textarea/textarea.gallery.d.ts +2 -0
- package/dist/components/ui/core/textarea/textarea.gallery.js +51 -0
- package/dist/components/ui/core/textarea/textarea.gallery.js.map +1 -0
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/components/ui/core/banner/banner.md +51 -0
- package/src/components/ui/core/input/input.md +48 -0
- package/src/components/ui/core/label/label.md +35 -0
- package/src/components/ui/core/radio-group/radio-group.md +38 -0
- package/src/components/ui/core/textarea/textarea.md +42 -0
package/package.json
CHANGED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
Use a Banner for a persistent or dismissible message scoped to a page or section.
|
|
2
|
+
Banners are stronger than inline helper text and stay visible while the user continues working.
|
|
3
|
+
|
|
4
|
+
## When to use
|
|
5
|
+
|
|
6
|
+
- Announcing environment or product state, such as maintenance, a trial period, or a feature preview.
|
|
7
|
+
- Page-wide outcomes that should stay visible while the user continues.
|
|
8
|
+
- Explaining why a page is read-only and offering the action that unlocks it.
|
|
9
|
+
|
|
10
|
+
## When to use something else
|
|
11
|
+
|
|
12
|
+
- Use an [Alert](?path=/docs/primitives-alert--docs) for task-specific guidance inside a flow.
|
|
13
|
+
- Use a [Sonner Toast](?path=/docs/primitives-sonner-toast--docs) for brief confirmation after an action.
|
|
14
|
+
- Use a [Dialog](?path=/docs/primitives-dialog--docs) when the user must respond before continuing.
|
|
15
|
+
|
|
16
|
+
## Placement
|
|
17
|
+
|
|
18
|
+
- Place Banners at the top of the page or section they describe.
|
|
19
|
+
- Banners span the full width of their container by default.
|
|
20
|
+
- Set `inset` to round the corners when the Banner sits inside padded content rather than edge to edge.
|
|
21
|
+
|
|
22
|
+
## Variants
|
|
23
|
+
|
|
24
|
+
| Variant | Use |
|
|
25
|
+
| :------------ | :--------------------------------------------------- |
|
|
26
|
+
| `default` | Neutral state, such as read-only or preview mode |
|
|
27
|
+
| `info` | Helpful updates, such as new data being available |
|
|
28
|
+
| `warning` | Upcoming issues, such as an expiring trial |
|
|
29
|
+
| `destructive` | Failures that affect the page, such as a failed save |
|
|
30
|
+
|
|
31
|
+
## Content
|
|
32
|
+
|
|
33
|
+
- Keep the title to one short sentence; Banners are a single line high.
|
|
34
|
+
- Start with a `BannerIcon` that matches the variant.
|
|
35
|
+
- Put actions in `BannerActions`, using `BannerAction` for actions and `BannerClose` for dismissal.
|
|
36
|
+
|
|
37
|
+
## Dos and don'ts
|
|
38
|
+
|
|
39
|
+
- **Do** limit actions to ones that resolve or explain the message.
|
|
40
|
+
- **Do** make Banners dismissible unless the state they describe is still active.
|
|
41
|
+
- **Don't** stack several Banners on one page; combine or prioritize the messages instead.
|
|
42
|
+
- **Don't** use a Banner for field-level validation.
|
|
43
|
+
|
|
44
|
+
## Behavior
|
|
45
|
+
|
|
46
|
+
- `BannerClose` hides the Banner and calls `onClose`.
|
|
47
|
+
- Use `visible` and `onClose` to control visibility, or `defaultVisible` to leave it uncontrolled.
|
|
48
|
+
|
|
49
|
+
## Often used with
|
|
50
|
+
|
|
51
|
+
[Button](?path=/docs/primitives-button--docs) through `BannerAction`, and [Topbar](?path=/docs/primitives-topbar--docs) above page-level Banners.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
Use an Input to capture short, single-line text in forms and toolbars.
|
|
2
|
+
|
|
3
|
+
## When to use
|
|
4
|
+
|
|
5
|
+
- Collecting specific text data, such as names, credentials, or asset identifiers.
|
|
6
|
+
- A form field needs free text that does not fit a structured picker.
|
|
7
|
+
|
|
8
|
+
## When to use something else
|
|
9
|
+
|
|
10
|
+
- Use a [Select](?path=/docs/primitives-select--docs), [Combobox](?path=/docs/primitives-combobox--docs), [Checkbox](?path=/docs/primitives-checkbox--docs), or [Radio](?path=/docs/primitives-radio-group--docs) when choosing from predefined options.
|
|
11
|
+
- Use a [Combobox](?path=/docs/primitives-combobox--docs) when suggestions should appear as the user types.
|
|
12
|
+
- Use a [Date Picker](?path=/docs/primitives-datepicker--docs) or [Time Picker](?path=/docs/primitives-timepicker--docs) for dates and times.
|
|
13
|
+
- Use a [Textarea](?path=/docs/primitives-textarea--docs) when multi-line text is expected.
|
|
14
|
+
- Use [Search](?path=/docs/primitives-search--docs) for filtering or searching content.
|
|
15
|
+
|
|
16
|
+
## Content
|
|
17
|
+
|
|
18
|
+
- Give every Input a visible [Label](?path=/docs/primitives-label--docs).
|
|
19
|
+
- Use placeholder text only for a short example of the expected format.
|
|
20
|
+
- Set `type` to match the data, such as `email`, `number`, `tel`, or `url`, so browsers offer the right keyboard and autofill.
|
|
21
|
+
|
|
22
|
+
## States
|
|
23
|
+
|
|
24
|
+
| State | How to set it |
|
|
25
|
+
| :-------- | :----------------------------------------------------------- |
|
|
26
|
+
| Default | No extra props |
|
|
27
|
+
| Filled | `value` or `defaultValue` |
|
|
28
|
+
| Disabled | `disabled`, with `data-disabled="true"` on the field wrapper |
|
|
29
|
+
| Read-only | `readOnly` for values users can see and copy but not edit |
|
|
30
|
+
| Error | `aria-invalid`, with error helper text below the Input |
|
|
31
|
+
|
|
32
|
+
## Dos and don'ts
|
|
33
|
+
|
|
34
|
+
- **Do** show validation messages below the Input with helper text.
|
|
35
|
+
- **Do** prefer `readOnly` over `disabled` when users still need to read or copy the value.
|
|
36
|
+
- **Don't** use long placeholder text that duplicates the label.
|
|
37
|
+
- **Don't** mimic pre-filled content with placeholder text.
|
|
38
|
+
- **Don't** wrap text inside an Input; truncate it or switch to a Textarea.
|
|
39
|
+
|
|
40
|
+
## Behavior
|
|
41
|
+
|
|
42
|
+
- Inputs are single-line and update as the user types.
|
|
43
|
+
- Associate validation messages with the field so assistive technology announces them.
|
|
44
|
+
- Use an [Input Group](?path=/docs/primitives-input-group--docs) for leading or trailing slots such as icons, prefixes, suffixes, or buttons.
|
|
45
|
+
|
|
46
|
+
## Often used with
|
|
47
|
+
|
|
48
|
+
[Label](?path=/docs/primitives-label--docs), [Helper Text](?path=/docs/primitives-helper-text--docs), [Button](?path=/docs/primitives-button--docs), and [Tooltip](?path=/docs/primitives-tooltip--docs).
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
Use a Label to identify a form field and associate it programmatically with that field.
|
|
2
|
+
Labels are not intended as general-purpose text.
|
|
3
|
+
|
|
4
|
+
## When to use
|
|
5
|
+
|
|
6
|
+
- Every [Input](?path=/docs/primitives-input--docs), [Select](?path=/docs/primitives-select--docs), [Combobox](?path=/docs/primitives-combobox--docs), [Textarea](?path=/docs/primitives-textarea--docs), [Slider](?path=/docs/primitives-slider--docs), or [Date Picker](?path=/docs/primitives-datepicker--docs) needs one.
|
|
7
|
+
- Groups of [Checkboxes](?path=/docs/primitives-checkbox--docs), [Radios](?path=/docs/primitives-radio-group--docs), or [Switches](?path=/docs/primitives-switch--docs) need one to name the group.
|
|
8
|
+
|
|
9
|
+
## When to use something else
|
|
10
|
+
|
|
11
|
+
- Use a heading for section titles.
|
|
12
|
+
- Use [Helper Text](?path=/docs/primitives-helper-text--docs) for descriptive text below a field.
|
|
13
|
+
- Use plain text or a [Badge](?path=/docs/primitives-badge--docs) for non-interactive elements such as status indicators.
|
|
14
|
+
|
|
15
|
+
## Required fields
|
|
16
|
+
|
|
17
|
+
- Set `required` on the Label to show the required asterisk.
|
|
18
|
+
- `Label.required` is visual only, so also set `required` on the form control for native validation and assistive technology.
|
|
19
|
+
- Mark required fields consistently across a form.
|
|
20
|
+
|
|
21
|
+
## Dos and don'ts
|
|
22
|
+
|
|
23
|
+
- **Do** associate every Label with its field through `htmlFor` and `id`.
|
|
24
|
+
- **Do** keep Labels short and descriptive.
|
|
25
|
+
- **Don't** replace Labels with placeholder text; placeholders disappear and are not reliably announced.
|
|
26
|
+
- **Don't** hide Labels for visual cleanliness; use a [Tooltip](?path=/docs/primitives-tooltip--docs) to supplement shortened Labels.
|
|
27
|
+
|
|
28
|
+
## Behavior
|
|
29
|
+
|
|
30
|
+
- Clicking a Label focuses or toggles its associated field.
|
|
31
|
+
- Wrapping the Label and field in an element with the `group` class and `data-disabled="true"` applies the disabled style to the Label.
|
|
32
|
+
|
|
33
|
+
## Often used with
|
|
34
|
+
|
|
35
|
+
[Input](?path=/docs/primitives-input--docs), [Select](?path=/docs/primitives-select--docs), [Combobox](?path=/docs/primitives-combobox--docs), [Checkbox](?path=/docs/primitives-checkbox--docs), [Radio](?path=/docs/primitives-radio-group--docs), [Switch](?path=/docs/primitives-switch--docs), [Slider](?path=/docs/primitives-slider--docs), [Textarea](?path=/docs/primitives-textarea--docs), and [Date Picker](?path=/docs/primitives-datepicker--docs).
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
Use a Radio Group to let users select exactly one option from a small set of mutually exclusive choices.
|
|
2
|
+
|
|
3
|
+
## When to use
|
|
4
|
+
|
|
5
|
+
- A single selection from a small, visible set of predefined options.
|
|
6
|
+
- All options should be visible side by side for comparison.
|
|
7
|
+
|
|
8
|
+
## When to use something else
|
|
9
|
+
|
|
10
|
+
- Use a [Checkbox](?path=/docs/primitives-checkbox--docs) when multiple selections are allowed.
|
|
11
|
+
- Use a [Select](?path=/docs/primitives-select--docs) or [Combobox](?path=/docs/primitives-combobox--docs) when there are more than about five options or space is limited.
|
|
12
|
+
- Use a [Switch](?path=/docs/primitives-switch--docs) when the choice is binary and takes immediate effect.
|
|
13
|
+
- Use a [Segmented Control](?path=/docs/primitives-segmented-control--docs) to switch between views rather than set a value.
|
|
14
|
+
|
|
15
|
+
## Layout
|
|
16
|
+
|
|
17
|
+
- Groups stack vertically by default; set `orientation="horizontal"` to lay options out in a row.
|
|
18
|
+
- Use `variant="card"` on `RadioGroupItem` for options that need descriptions, such as plan or template choices.
|
|
19
|
+
- Add `RadioGroupItemDescription` under the label when an option needs a short explanation.
|
|
20
|
+
|
|
21
|
+
## Dos and don'ts
|
|
22
|
+
|
|
23
|
+
- **Do** give every option a descriptive label.
|
|
24
|
+
- **Do** pre-select a sensible default when one exists.
|
|
25
|
+
- **Don't** group unrelated options.
|
|
26
|
+
- **Don't** use more than five options.
|
|
27
|
+
- **Don't** use card variants for long option lists.
|
|
28
|
+
|
|
29
|
+
## Behavior
|
|
30
|
+
|
|
31
|
+
- Clicking or pressing Space selects the focused option and deselects the others in the group.
|
|
32
|
+
- Arrow keys move focus and selection between options.
|
|
33
|
+
- Set `disabled` on the `RadioGroup` to disable every option, or on a `RadioGroupItemControl` to disable a single option.
|
|
34
|
+
- Set `name` and `required` on the `RadioGroup` for native form submission.
|
|
35
|
+
|
|
36
|
+
## Often used with
|
|
37
|
+
|
|
38
|
+
[Label](?path=/docs/primitives-label--docs) to name the group, [Helper Text](?path=/docs/primitives-helper-text--docs), and the card variant for options that need descriptions.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
Use a Textarea for extended, free-form, multi-line input such as comments, feedback, messages, descriptions, or notes.
|
|
2
|
+
|
|
3
|
+
## When to use
|
|
4
|
+
|
|
5
|
+
- Multi-line text is expected, such as comments, notes, bios, or explanations.
|
|
6
|
+
- Editing large chunks of existing text.
|
|
7
|
+
|
|
8
|
+
## When to use something else
|
|
9
|
+
|
|
10
|
+
- Use an [Input](?path=/docs/primitives-input--docs) when a single line of text is enough.
|
|
11
|
+
- Use an [Input](?path=/docs/primitives-input--docs), [Date Picker](?path=/docs/primitives-datepicker--docs), [Select](?path=/docs/primitives-select--docs), or [Combobox](?path=/docs/primitives-combobox--docs) when structured data is expected.
|
|
12
|
+
- Use a rich-text editor when formatting is needed.
|
|
13
|
+
- Use [Prompt Input](?path=/docs/ai-prompt-input--docs) for messages sent to an AI assistant.
|
|
14
|
+
|
|
15
|
+
## Content
|
|
16
|
+
|
|
17
|
+
- Give every Textarea a visible [Label](?path=/docs/primitives-label--docs).
|
|
18
|
+
- Keep placeholder text concise and use it for an example, not instructions the user needs later.
|
|
19
|
+
- Show a character count in helper text when there is a length limit.
|
|
20
|
+
|
|
21
|
+
## Sizing
|
|
22
|
+
|
|
23
|
+
- A Textarea starts at a minimum height and grows with its content.
|
|
24
|
+
- Resizing by the user is disabled by default.
|
|
25
|
+
- Set a maximum height with `className` when the Textarea sits in a constrained layout, so long content scrolls instead of pushing the layout.
|
|
26
|
+
|
|
27
|
+
## Dos and don'ts
|
|
28
|
+
|
|
29
|
+
- **Do** use concise labels and placeholder text.
|
|
30
|
+
- **Do** let content scroll when it exceeds the maximum height.
|
|
31
|
+
- **Don't** set a small fixed height when lengthy input is expected.
|
|
32
|
+
- **Don't** pre-fill the Textarea with default text users might overlook.
|
|
33
|
+
|
|
34
|
+
## States
|
|
35
|
+
|
|
36
|
+
- Set `aria-invalid` and show error helper text below the Textarea when the value is invalid.
|
|
37
|
+
- Set `disabled`, with `data-disabled="true"` on the field wrapper, when the field is unavailable.
|
|
38
|
+
- Set `readOnly` when users need to read or copy the text but not change it.
|
|
39
|
+
|
|
40
|
+
## Often used with
|
|
41
|
+
|
|
42
|
+
[Label](?path=/docs/primitives-label--docs) and [Helper Text](?path=/docs/primitives-helper-text--docs), optionally with a character count.
|