@cognite/aura 1.47321.0 → 1.47367.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 +3 -0
- package/dist/components/ui/core/breadcrumb/breadcrumb.gallery.d.ts +2 -0
- package/dist/components/ui/core/breadcrumb/breadcrumb.gallery.js +31 -0
- package/dist/components/ui/core/breadcrumb/breadcrumb.gallery.js.map +1 -0
- package/dist/components/ui/core/button-group/button-group.gallery.d.ts +2 -0
- package/dist/components/ui/core/button-group/button-group.gallery.js +62 -0
- package/dist/components/ui/core/button-group/button-group.gallery.js.map +1 -0
- package/dist/components/ui/core/collapsible/collapsible.gallery.d.ts +2 -0
- package/dist/components/ui/core/collapsible/collapsible.gallery.js +39 -0
- package/dist/components/ui/core/collapsible/collapsible.gallery.js.map +1 -0
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/components/ui/core/breadcrumb/breadcrumb.md +45 -0
- package/src/components/ui/core/button-group/button-group.md +38 -0
- package/src/components/ui/core/collapsible/collapsible.md +42 -0
package/package.json
CHANGED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
Use a Breadcrumb to show users where the current page sits in the product hierarchy and let them return to its ancestors.
|
|
2
|
+
Breadcrumbs are location-based, not path-based: they reflect the structure of the product, not the user's browsing history.
|
|
3
|
+
|
|
4
|
+
## When to use
|
|
5
|
+
|
|
6
|
+
- Users need to return to a parent page.
|
|
7
|
+
- Users need clarity on their current position in the product hierarchy.
|
|
8
|
+
- Quick access to ancestor pages is useful.
|
|
9
|
+
|
|
10
|
+
## When to use something else
|
|
11
|
+
|
|
12
|
+
- Leave out the Breadcrumb when the page structure is flat and there is no hierarchy to show.
|
|
13
|
+
- Use [Tabs](?path=/docs/primitives-tabs--docs) or a [Segmented Control](?path=/docs/primitives-segmented-control--docs) when users switch between pages at the same level.
|
|
14
|
+
|
|
15
|
+
## Content
|
|
16
|
+
|
|
17
|
+
- Wrap a `BreadcrumbList` in `Breadcrumb`, and put each step in a `BreadcrumbItem` with a `BreadcrumbSeparator` between items.
|
|
18
|
+
- Use `BreadcrumbLink` for ancestor pages and `BreadcrumbPage` for the current page.
|
|
19
|
+
- Use `BreadcrumbPageButton` instead of `BreadcrumbPage` when the current page opens a [Dropdown Menu](?path=/docs/primitives-dropdown-menu--docs) of page actions, such as rename or delete.
|
|
20
|
+
- Keep labels short and match them to the titles of the pages they link to.
|
|
21
|
+
|
|
22
|
+
## Overflow
|
|
23
|
+
|
|
24
|
+
- When space is limited, condense the middle items into a `BreadcrumbEllipsis`, keeping the first item and the last two visible.
|
|
25
|
+
- Wrap the ellipsis in a [Dropdown Menu](?path=/docs/primitives-dropdown-menu--docs) trigger so users can still reach the hidden pages.
|
|
26
|
+
- The current page always stays visible.
|
|
27
|
+
|
|
28
|
+
## Dos and don'ts
|
|
29
|
+
|
|
30
|
+
- **Do** truncate long labels and show the full text in a [Tooltip](?path=/docs/primitives-tooltip--docs).
|
|
31
|
+
- **Don't** make the current page a link.
|
|
32
|
+
- **Don't** pair a Breadcrumb with a back button.
|
|
33
|
+
- **Don't** wrap labels onto multiple lines.
|
|
34
|
+
- **Don't** show more than one Breadcrumb trail on a page.
|
|
35
|
+
|
|
36
|
+
## Behavior
|
|
37
|
+
|
|
38
|
+
- The Breadcrumb renders as a `nav` landmark labelled "breadcrumb".
|
|
39
|
+
- Every link except the current page is reachable with Tab and Shift+Tab and activates with Enter.
|
|
40
|
+
- The current page has `aria-current="page"` and is not focusable.
|
|
41
|
+
- Separators are hidden from assistive technology.
|
|
42
|
+
|
|
43
|
+
## Often used with
|
|
44
|
+
|
|
45
|
+
[Topbar](?path=/docs/primitives-topbar--docs), [Tooltip](?path=/docs/primitives-tooltip--docs) for truncated labels, and [Dropdown Menu](?path=/docs/primitives-dropdown-menu--docs) for overflow items and page actions.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
Use a Button Group to join related buttons into one connected row, showing that the actions belong to the same context.
|
|
2
|
+
|
|
3
|
+
## When to use
|
|
4
|
+
|
|
5
|
+
- Two or more actions are closely related and act on the same target, such as text alignment or a split button.
|
|
6
|
+
- Saving horizontal space compared with spacing individual [Buttons](?path=/docs/primitives-button--docs) apart.
|
|
7
|
+
|
|
8
|
+
## When to use something else
|
|
9
|
+
|
|
10
|
+
- Use separate [Buttons](?path=/docs/primitives-button--docs) when the actions are unrelated.
|
|
11
|
+
- Use a [Toolbar](?path=/docs/primitives-toolbar--docs) or a [Dropdown Menu](?path=/docs/primitives-dropdown-menu--docs) when there are more than a handful of actions.
|
|
12
|
+
- Use a [Segmented Control](?path=/docs/primitives-segmented-control--docs) when the buttons switch between views rather than run commands.
|
|
13
|
+
|
|
14
|
+
## Content
|
|
15
|
+
|
|
16
|
+
- Put `Button`s directly inside the group so their borders and corners join.
|
|
17
|
+
- Add `ButtonGroupText` for a short, non-interactive label at the start of the group.
|
|
18
|
+
- Add `ButtonGroupSeparator` to split sub-groups of actions within one group.
|
|
19
|
+
|
|
20
|
+
## Orientation
|
|
21
|
+
|
|
22
|
+
- Groups are horizontal by default.
|
|
23
|
+
- Set `orientation="vertical"` to stack buttons, for example in a narrow side panel.
|
|
24
|
+
|
|
25
|
+
## Dos and don'ts
|
|
26
|
+
|
|
27
|
+
- **Do** use the same `variant` and `size` for every button in a group.
|
|
28
|
+
- **Do** give icon-only buttons an `aria-label` and pair them with a [Tooltip](?path=/docs/primitives-tooltip--docs).
|
|
29
|
+
- **Don't** group more than a small set of actions.
|
|
30
|
+
|
|
31
|
+
## Behavior
|
|
32
|
+
|
|
33
|
+
- The group has the `group` role, so assistive technology announces its buttons together.
|
|
34
|
+
- Each button stays a separate Tab stop.
|
|
35
|
+
|
|
36
|
+
## Often used with
|
|
37
|
+
|
|
38
|
+
[Button](?path=/docs/primitives-button--docs), [Tooltip](?path=/docs/primitives-tooltip--docs) for icon-only buttons, and [Dropdown Menu](?path=/docs/primitives-dropdown-menu--docs) for split buttons.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
Use a Collapsible to show or hide one optional block of content inline.
|
|
2
|
+
It is designed for a single independent section, not for several stacked sections.
|
|
3
|
+
|
|
4
|
+
## When to use
|
|
5
|
+
|
|
6
|
+
- Showing one optional or secondary block of content, such as AI reasoning, advanced settings, or a preview.
|
|
7
|
+
- The content is useful but not essential to the primary task.
|
|
8
|
+
|
|
9
|
+
## When to use something else
|
|
10
|
+
|
|
11
|
+
- Use an [Accordion](?path=/docs/primitives-accordion--docs) when there are several expandable sections.
|
|
12
|
+
- Show the content by default when it is essential.
|
|
13
|
+
- Use [Tabs](?path=/docs/primitives-tabs--docs) or filter controls when users are navigating or filtering.
|
|
14
|
+
|
|
15
|
+
## Content
|
|
16
|
+
|
|
17
|
+
- Put the always-visible trigger in `CollapsibleTrigger` and the hidden content in `CollapsibleContent`.
|
|
18
|
+
- Render the trigger as a ghost [Button](?path=/docs/primitives-button--docs) through the `render` prop, with an `IconSelector` at the end that rotates when open.
|
|
19
|
+
- Write a descriptive trigger label that says what is inside, such as "Advanced settings" rather than "More".
|
|
20
|
+
|
|
21
|
+
## State
|
|
22
|
+
|
|
23
|
+
- Collapsibles start collapsed; set `defaultOpen` to start open.
|
|
24
|
+
- Use `open` with `onOpenChange` when the state lives elsewhere.
|
|
25
|
+
- Set `disabled` to stop the section from opening or closing.
|
|
26
|
+
|
|
27
|
+
## Dos and don'ts
|
|
28
|
+
|
|
29
|
+
- **Do** default to collapsed unless the content is the main purpose of the view.
|
|
30
|
+
- **Don't** nest Collapsibles; use an [Accordion](?path=/docs/primitives-accordion--docs) for layered disclosure.
|
|
31
|
+
- **Don't** hide errors or required information inside a Collapsible.
|
|
32
|
+
|
|
33
|
+
## Behavior
|
|
34
|
+
|
|
35
|
+
- One trigger controls one content region.
|
|
36
|
+
- Clicking the trigger, or pressing Space or Enter while it has focus, toggles the content.
|
|
37
|
+
- The trigger exposes the open state to assistive technology through `aria-expanded`.
|
|
38
|
+
- The content stays mounted while closed, so form fields inside keep their values.
|
|
39
|
+
|
|
40
|
+
## Often used with
|
|
41
|
+
|
|
42
|
+
[Button](?path=/docs/primitives-button--docs) as the trigger, [Badge](?path=/docs/primitives-badge--docs) for counts in the trigger, and [Separator](?path=/docs/primitives-separator--docs) between stacked Collapsibles.
|