@cognite/aura 0.3.2 → 0.3.4
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 +134 -5
- package/README.md +24 -3
- package/dist/components/index.d.ts +5 -1
- package/dist/components/index.js +59 -327
- package/dist/components/ui/core/accordion/accordion.js +79 -114
- package/dist/components/ui/core/action-toolbar/action-toolbar.js +108 -176
- package/dist/components/ui/core/alert/alert.js +158 -206
- package/dist/components/ui/core/avatar/avatar.js +64 -90
- package/dist/components/ui/core/badge/badge.js +73 -108
- package/dist/components/ui/core/banner/banner.js +146 -215
- package/dist/components/ui/core/breadcrumb/breadcrumb.js +105 -200
- package/dist/components/ui/core/button/button.js +47 -52
- package/dist/components/ui/core/button-group/button-group.js +40 -79
- package/dist/components/ui/core/calendar/calendar-header.js +63 -0
- package/dist/components/ui/core/calendar/calendar-utils.js +39 -0
- package/dist/components/ui/core/calendar/calendar.js +68 -0
- package/dist/components/ui/core/calendar/constants.d.ts +1 -0
- package/dist/components/ui/core/card/card.js +102 -185
- package/dist/components/ui/core/chart/chart.js +116 -206
- package/dist/components/ui/core/chart/index.js +2 -8
- package/dist/components/ui/core/checkbox/checkbox.js +67 -132
- package/dist/components/ui/core/checkbox/checkbox.metadata.js +7 -7
- package/dist/components/ui/core/code-block/code-block.d.ts +1 -1
- package/dist/components/ui/core/code-block/code-block.js +179 -267
- package/dist/components/ui/core/collapsible/collapsible.js +29 -49
- package/dist/components/ui/core/combobox/combobox.js +41 -0
- package/dist/components/ui/core/command/command.js +85 -150
- package/dist/components/ui/core/count/count.js +21 -32
- package/dist/components/ui/core/data-grid/data-grid-cell.d.ts +10 -0
- package/dist/components/ui/core/data-grid/data-grid-header-row.d.ts +13 -0
- package/dist/components/ui/core/data-grid/data-grid-row.d.ts +18 -0
- package/dist/components/ui/core/data-grid/data-grid.d.ts +43 -0
- package/dist/components/ui/core/data-grid/data-grid.fixtures.d.ts +12 -0
- package/dist/components/ui/core/data-grid/data-grid.utils.d.ts +9 -0
- package/dist/components/ui/core/date-time-pickers/date-picker/date-picker.js +60 -72
- package/dist/components/ui/core/date-time-pickers/date-picker/types.d.ts +2 -1
- package/dist/components/ui/core/date-time-pickers/date-picker/use-date-picker.js +36 -51
- package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.js +63 -87
- package/dist/components/ui/core/date-time-pickers/date-range-picker/types.d.ts +2 -1
- package/dist/components/ui/core/date-time-pickers/date-range-picker/use-date-range-picker.js +60 -68
- package/dist/components/ui/core/date-time-pickers/date-time-picker/index.d.ts +1 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/types.d.ts +36 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/use-date-time-picker.d.ts +3 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.js +118 -174
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/types.d.ts +7 -6
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/use-date-time-range-picker.js +104 -145
- package/dist/components/ui/core/date-time-pickers/index.d.ts +3 -1
- package/dist/components/ui/core/date-time-pickers/index.js +6 -10
- package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.d.ts +3 -2
- package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.js +42 -56
- package/dist/components/ui/core/date-time-pickers/shared/constants.d.ts +3 -8
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.js +64 -98
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/range-input-display.js +38 -67
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.js +23 -23
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-date-state.js +52 -62
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-step-manager.js +18 -18
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-single-date-state.js +24 -31
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.d.ts +3 -3
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.js +24 -33
- package/dist/components/ui/core/date-time-pickers/shared/scroll-cell-classes.js +4 -7
- package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.d.ts +3 -2
- package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.js +17 -31
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.d.ts +3 -2
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.js +40 -40
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-scroll/time-picker-scroll.js +33 -50
- package/dist/components/ui/core/date-time-pickers/time-picker/time-picker.js +78 -99
- package/dist/components/ui/core/date-time-pickers/time-picker/types.d.ts +5 -4
- package/dist/components/ui/core/date-time-pickers/time-picker/use-time-picker.js +41 -63
- package/dist/components/ui/core/date-time-pickers/time-range-picker/index.d.ts +1 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/types.d.ts +40 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/use-time-range-picker.d.ts +3 -0
- package/dist/components/ui/core/date-time-pickers/utils/format-utils.d.ts +1 -0
- package/dist/components/ui/core/date-time-pickers/utils/time-utils.d.ts +3 -3
- package/dist/components/ui/core/date-time-pickers/utils/time-utils.js +7 -15
- package/dist/components/ui/core/dialog/dialog.js +82 -155
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.d.ts +2 -2
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.js +150 -248
- package/dist/components/ui/core/empty-state/empty-state.context.js +5 -8
- package/dist/components/ui/core/empty-state/empty-state.js +86 -138
- package/dist/components/ui/core/helper-text/helper-text.js +37 -65
- package/dist/components/ui/core/hover-card/hover-card.js +54 -80
- package/dist/components/ui/core/inline-citation/inline-citation.js +98 -181
- package/dist/components/ui/core/input/input.js +12 -27
- package/dist/components/ui/core/input-group/input-group.js +76 -173
- package/dist/components/ui/core/kbd/kbd.js +20 -36
- package/dist/components/ui/core/label/label.js +26 -43
- package/dist/components/ui/core/loader/loader.js +80 -117
- package/dist/components/ui/core/message/message-response-default-streamdown-controls.js +12 -12
- package/dist/components/ui/core/message/message.d.ts +2 -2
- package/dist/components/ui/core/message/message.js +316 -542
- package/dist/components/ui/core/overflow-list/overflow-list.utils.d.ts +52 -0
- package/dist/components/ui/core/pagination/pagination-size-context.js +5 -6
- package/dist/components/ui/core/pagination/pagination-teleport.js +86 -106
- package/dist/components/ui/core/pagination/pagination-teleport.utils.js +6 -6
- package/dist/components/ui/core/pagination/pagination.js +231 -334
- package/dist/components/ui/core/popover/popover.js +90 -157
- package/dist/components/ui/core/progress/progress.js +36 -61
- package/dist/components/ui/core/prompt-input/prompt-input.js +274 -413
- package/dist/components/ui/core/radio-group/radio-group.js +58 -113
- package/dist/components/ui/core/reasoning/reasoning.js +55 -86
- package/dist/components/ui/core/scroll-area/scroll-area.js +41 -71
- package/dist/components/ui/core/search/search.js +77 -99
- package/dist/components/ui/core/segmented-control/segmented-control.js +110 -167
- package/dist/components/ui/core/select/select.js +168 -293
- package/dist/components/ui/core/separator/separator.js +13 -23
- package/dist/components/ui/core/shimmer/shimmer.d.ts +2 -4
- package/dist/components/ui/core/shimmer/shimmer.js +40 -107
- package/dist/components/ui/core/skeleton/skeleton.js +13 -18
- package/dist/components/ui/core/slider/slider.d.ts +9 -0
- package/dist/components/ui/core/slider/slider.js +40 -0
- package/dist/components/ui/core/sonner-toast/sonner-toast.js +54 -47
- package/dist/components/ui/core/sources/sources.d.ts +5 -1
- package/dist/components/ui/core/sources/sources.js +58 -79
- package/dist/components/ui/core/switch/switch.js +62 -0
- package/dist/components/ui/core/tabs/tabs.js +149 -223
- package/dist/components/ui/core/tabs/tabs.utils.js +6 -8
- package/dist/components/ui/core/textarea/textarea.js +13 -27
- package/dist/components/ui/core/toggle/toggle.js +55 -74
- package/dist/components/ui/core/tool/tool.js +127 -163
- package/dist/components/ui/core/tooltip/tooltip.js +47 -86
- package/dist/components/ui/core/topbar/topbar.js +106 -190
- package/dist/eslint/index.js +5 -10
- package/dist/eslint/no-overriding-styles.js +178 -237
- package/dist/icons/index.d.ts +1 -0
- package/dist/icons/index.js +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/lib/highlight-code.d.ts +9 -0
- package/dist/lib/highlight-code.js +42 -0
- package/dist/lib/portal-container-context.js +8 -9
- package/dist/lib/style-scope.js +6 -6
- package/dist/lib/use-controllable-state.js +21 -30
- package/dist/lib/utils.d.ts +0 -2
- package/dist/lib/utils.js +32 -112
- package/dist/styles.css +1 -1
- package/dist/styles.source.css +26 -0
- package/package.json +42 -8
- package/dist/components/ui/core/date-time-pickers/shared/calendar/calendar.js +0 -119
- package/dist/components/ui/core/date-time-pickers/shared/calendar-header/calendar-header.js +0 -93
- package/dist/components/ui/core/date-time-pickers/shared/constants.js +0 -14
- package/dist/components/ui/core/date-time-pickers/utils/calendar-utils.js +0 -52
- /package/dist/components/ui/core/{date-time-pickers/shared/calendar-header → calendar}/calendar-header.d.ts +0 -0
- /package/dist/components/ui/core/{date-time-pickers/utils → calendar}/calendar-utils.d.ts +0 -0
- /package/dist/components/ui/core/{date-time-pickers/shared/calendar → calendar}/calendar.d.ts +0 -0
package/DESIGN.md
CHANGED
|
@@ -2135,21 +2135,73 @@ App icons identify **products, workspaces, or integrations** (launcher tiles, ch
|
|
|
2135
2135
|
|
|
2136
2136
|
### System icons
|
|
2137
2137
|
|
|
2138
|
-
System icons are **functional** shorthand for actions, state, and navigation. Aura standardizes on **Tabler Icons** (`@tabler/icons-react` in the library). Names describe intent — **do not repurpose** an icon for an unrelated meaning.
|
|
2138
|
+
System icons are **functional** shorthand for actions, state, and navigation. Aura standardizes on **Tabler Icons** (`@tabler/icons-react` in the library). Names describe intent — **do not repurpose** an icon for an unrelated meaning. For the full set of icons, visit [tabler.io/icons](https://tabler.io/icons), or search for a single icon by name with a query parameter: https://tabler.io/icons?icon={icon_name}.
|
|
2139
2139
|
|
|
2140
2140
|
**Sizes**
|
|
2141
2141
|
|
|
2142
2142
|
- **Default / recommended:** 16×16px
|
|
2143
|
-
- **Accepted in UI components:** 12×12px, 14×14px, 16×16px (match the component’s density; Aura primitives often default to **16px** via `size-4` classes on icons)
|
|
2143
|
+
- **Accepted in UI components:** 12×12px, 14×14px, 16×16px, 24×24px (match the component’s density; Aura primitives often default to **16px** via `size-4` classes on icons) with a stroke weight of 1.5px.
|
|
2144
2144
|
|
|
2145
2145
|
**Guidance**
|
|
2146
2146
|
|
|
2147
|
-
- **Must** use **filled** variants where brand or application chrome calls for weight (e.g. persistent app strip); use **outlined** variants for in-product actions and navigation unless a specific Aura component specifies otherwise.
|
|
2147
|
+
- **Must** use **filled** variants where brand or application chrome calls for weight or within sonner-toast or alert components (e.g. persistent app strip); use **outlined** variants for in-product actions and navigation unless a specific Aura component specifies otherwise.
|
|
2148
2148
|
- **Must not** edit, merge, or warp glyphs; icons stay **single-color** (typically `currentColor` so **Tokens** foreground colors apply). Exceptions: **branded** marks supplied as dedicated assets (see below).
|
|
2149
2149
|
- **Must not** hang hover, active, or focus styling on the raw icon — those states belong on the **control** (button, link, menu item).
|
|
2150
2150
|
- **Should** limit how many distinct icons compete on one view so each stays recognizable.
|
|
2151
2151
|
- **Avoid** icon-only interactive targets without a **Tooltip** or visible label (see accessibility).
|
|
2152
2152
|
|
|
2153
|
+
**Action icons**
|
|
2154
|
+
|
|
2155
|
+
Action icons represent operations a user can perform that trigger a change in state, content, or system behavior. They typically appear in interactive, contextual components like buttons, toolbars, context menus, dropdown menus, and inline controls.
|
|
2156
|
+
|
|
2157
|
+
| Concept | Icon name | Source | Keywords / aliases | Accepted labels |
|
|
2158
|
+
|---|---|---|---|---|
|
|
2159
|
+
| Add / New | `plus` | [Tabler](https://tabler.io/icons?icon=plus) | create, add, new, insert | Add, Create |
|
|
2160
|
+
| Cancel | `cancel` | [Tabler](https://tabler.io/icons?icon=cancel) | abort, stop | Cancel |
|
|
2161
|
+
| Collapse (window) | `arrows-diagonal-minimize-2` | [Tabler](https://tabler.io/icons?icon=arrows-diagonal-minimize-2) | exit fullscreen, collapse, minimize | Collapse |
|
|
2162
|
+
| Copy | `copy` | [Tabler](https://tabler.io/icons?icon=copy) | duplicate, clone | Copy |
|
|
2163
|
+
| Delete | `trash` | [Tabler](https://tabler.io/icons?icon=trash) | delete, destroy | Delete |
|
|
2164
|
+
| Download | `download` | [Tabler](https://tabler.io/icons?icon=download) | save to file, export file | Download |
|
|
2165
|
+
| Edit | `pencil` | [Tabler](https://tabler.io/icons?icon=pencil) | modify, rename, update | Edit |
|
|
2166
|
+
| Expand (window) | `arrows-diagonal` | [Tabler](https://tabler.io/icons?icon=arrows-diagonal) | fullscreen, expand, maximize | Expand |
|
|
2167
|
+
| Filter | `filter` | [Tabler](https://tabler.io/icons?icon=filter) | narrow, refine, search filters | Filter |
|
|
2168
|
+
| Hide | `eye-off` | [Tabler](https://tabler.io/icons?icon=eye-off) | hide; conceal, invisible, toggle visibility | Hide |
|
|
2169
|
+
| Link | `link` | [Tabler](https://tabler.io/icons?icon=link) | hyperlink, relationship, connected | — |
|
|
2170
|
+
| More options (menu opens above or below) | `dots-vertical` | [Tabler](https://tabler.io/icons?icon=dots-vertical) | overflow, actions, kebab menu | — |
|
|
2171
|
+
| Notifications | `bell` | [Tabler](https://tabler.io/icons?icon=bell) | alerts, notification center | Notifications |
|
|
2172
|
+
| Open external link | `external-link` | [Tabler](https://tabler.io/icons?icon=external-link) | open in new tab, link out | Open |
|
|
2173
|
+
| Publish | `rocket` | [Tabler](https://tabler.io/icons?icon=rocket) | deploy, release, go live, launch | Publish |
|
|
2174
|
+
| Redo | `arrow-forward-up` | [Tabler](https://tabler.io/icons?icon=arrow-forward-up) | step forward, redo | Redo |
|
|
2175
|
+
| Refresh | `reload` | [Tabler](https://tabler.io/icons?icon=reload) | reload page, refresh view | Refresh |
|
|
2176
|
+
| Remove / Close | `x` | [Tabler](https://tabler.io/icons?icon=x) | close, dismiss, remove, exit | Close, Remove |
|
|
2177
|
+
| Save | `check` | [Tabler](https://tabler.io/icons?icon=check) | save changes, confirm, persist, write | Save |
|
|
2178
|
+
| Search | `search` | [Tabler](https://tabler.io/icons?icon=search) | find, look up, query | Search |
|
|
2179
|
+
| Settings | `settings` | [Tabler](https://tabler.io/icons?icon=settings) | configure, preferences, gear | Settings |
|
|
2180
|
+
| Share | `share` | [Tabler](https://tabler.io/icons?icon=share) | send, distribute, invite | Share |
|
|
2181
|
+
| Show | `eye` | [Tabler](https://tabler.io/icons?icon=eye) | show; reveal, visible, unhide | Show |
|
|
2182
|
+
| Sync | `refresh` | [Tabler](https://tabler.io/icons?icon=refresh) | synchronize, pull latest, update data | Sync |
|
|
2183
|
+
| Undo | `arrow-back-up` | [Tabler](https://tabler.io/icons?icon=arrow-back-up) | revert, undo, step back | Undo |
|
|
2184
|
+
| Upload | `upload` | [Tabler](https://tabler.io/icons?icon=upload) | import from file, attach | Upload |
|
|
2185
|
+
|
|
2186
|
+
**Navigation icons**
|
|
2187
|
+
|
|
2188
|
+
Navigation icons represent spatial or positional concepts that help users understand where they are, where they can go, or how to move through an interface. They typically appear in structural, persistent components like sidebars, top bars, breadcrumbs, tabs, and pagination controls.
|
|
2189
|
+
|
|
2190
|
+
| Concept | Icon name | Source | Keywords / aliases | Accepted labels |
|
|
2191
|
+
|---|---|---|---|---|
|
|
2192
|
+
| App switcher | `grid-dots` | [Tabler](https://tabler.io/icons?icon=grid-dots) | apps, modules, switcher, launcher | — |
|
|
2193
|
+
| Back | `arrow-left` | [Tabler](https://tabler.io/icons?icon=arrow-left) | back, go back, previous, navigate back | Back |
|
|
2194
|
+
| Home | `home` | [Tabler](https://tabler.io/icons?icon=home) | root, dashboard, start, homepage | Home |
|
|
2195
|
+
| Open | `chevron-down` | [Tabler](https://tabler.io/icons?icon=chevron-down) | expand, open, closed or opened state | — |
|
|
2196
|
+
| Close | `chevron-up` | [Tabler](https://tabler.io/icons?icon=chevron-up) | collapse, close, opened state | — |
|
|
2197
|
+
| Open, Next page | `chevron-right` | [Tabler](https://tabler.io/icons?icon=chevron-right) | expand, open, closed state, next, right | — |
|
|
2198
|
+
| Last page, skip | `chevrons-right` | [Tabler](https://tabler.io/icons?icon=chevrons-right) | last page, pagination, skip to end | — |
|
|
2199
|
+
| Previous page | `chevron-left` | [Tabler](https://tabler.io/icons?icon=chevron-left) | previous, left | — |
|
|
2200
|
+
| First page, skip | `chevrons-left` | [Tabler](https://tabler.io/icons?icon=chevrons-left) | first page, pagination, skip to start | — |
|
|
2201
|
+
| Location | `map-pin` | [Tabler](https://tabler.io/icons?icon=map-pin) | place, geographic, anchor, location, plant, site, rig, factory, warehouse | — |
|
|
2202
|
+
| Sign in | `login-2` | [Tabler](https://tabler.io/icons?icon=login-2) | log in, authenticate, sign in | Sign in |
|
|
2203
|
+
| Sign out | `login` | [Tabler](https://tabler.io/icons?icon=login) | log out, sign out, exit session | Sign out |
|
|
2204
|
+
|
|
2153
2205
|
**Branded icons**
|
|
2154
2206
|
|
|
2155
2207
|
Rare exceptions (third-party or Cognite logos inside a cell) use **provided SVGs only** — same rules as app icons for distortion and clear space; color may be multi-hue **only** when the asset is the official brand mark.
|
|
@@ -2157,12 +2209,89 @@ Rare exceptions (third-party or Cognite logos inside a cell) use **provided SVGs
|
|
|
2157
2209
|
**Accessibility**
|
|
2158
2210
|
|
|
2159
2211
|
- **Must** meet **4.5:1** contrast against the icon’s background (same bar as body text when the icon communicates meaning).
|
|
2160
|
-
- **Must** give icon-only controls an accessible name (`aria-label` / `aria-labelledby`) **and** a
|
|
2212
|
+
- **Must** give icon-only controls an accessible name (`aria-label` / `aria-labelledby`) **and** a
|
|
2213
|
+
**Tooltip** on hover/focus where the design hides the text label.
|
|
2161
2214
|
- Icons that only repeat the meaning of adjacent visible text **should** be `aria-hidden="true"`.
|
|
2162
2215
|
|
|
2163
2216
|
### Motion (reference)
|
|
2164
2217
|
|
|
2165
|
-
|
|
2218
|
+
#### Motion
|
|
2219
|
+
|
|
2220
|
+
**What this is:** the rules for **when**, **how fast**, and **how** something should move in Aura-based UIs — durations, easing curves, and which properties to animate — so engineers and agents pick consistent motion instead of inventing values per component.
|
|
2221
|
+
|
|
2222
|
+
**Motion roles**
|
|
2223
|
+
|
|
2224
|
+
Every animation plays one of two roles. Role determines how visible, fast, and expressive it should be.
|
|
2225
|
+
|
|
2226
|
+
- **Productive motion** — supports without drawing attention: menus opening, content fading in, cards rearranging, tooltips. **Must** be fast, subtle, and functional — barely conscious, but noticeably missing if removed.
|
|
2227
|
+
- **Expressive motion** — motion people are meant to see: AI generating a response, a view transition, onboarding. **Should** take more time, use more of the aurora accent language, and be more visible — these are the moments that give Aura character.
|
|
2228
|
+
- **Must not** let productive motion compete with whatever the user is actually focused on.
|
|
2229
|
+
|
|
2230
|
+
**Timing**
|
|
2231
|
+
|
|
2232
|
+
- **Must** scale duration to distance and area: small, local changes (checkbox, toggle) get shorter durations; large or page-level transitions get longer ones. Values are relative to each other within one experience, not absolute.
|
|
2233
|
+
- Reference bands: **short** motion (state changes, small components) stays under **~200ms**; **longer** expressive transitions (page-level, content entrances) run **~400–500ms**.
|
|
2234
|
+
- **Should** use **stagger** — a timing offset between elements animating in sequence rather than all at once — for groups of similar items (list rows, dashboard cards, revealed menu items). Typical offset: **~30–35ms per item**.
|
|
2235
|
+
- **Must not** apply stagger to elements leaving the screen — exits animate together, without a staggered trail.
|
|
2236
|
+
- **Should** make exits slightly quicker than entrances for the same element — once the user has acted, the UI does not need to hold their attention on the way out.
|
|
2237
|
+
|
|
2238
|
+
**Easing**
|
|
2239
|
+
|
|
2240
|
+
Easing is the rate of speed change — it makes motion feel physical rather than mechanical. Use `cubic-bezier` curves, not linear or default browser easing.
|
|
2241
|
+
|
|
2242
|
+
| Curve | cubic-bezier | Use |
|
|
2243
|
+
| :--- | :--- | :--- |
|
|
2244
|
+
| Standard | `(0.40, 0.00, 0.15, 1.00)` | Motion between two states — most repositioning and in-view transitions |
|
|
2245
|
+
| Entrance | `(0.00, 0.00, 0.15, 1.00)` | Elements appearing — decelerates into place, arrives with momentum and lands softly |
|
|
2246
|
+
| Exit | `(0.67, 0.00, 0.83, 0.83)` | Elements leaving — accelerates away, lifts off and clears the view decisively |
|
|
2247
|
+
| Sine | `(0.33, 0.00, 0.67, 1.00)` | Near-linear; opacity fades and subtle color shifts where a strong ease would distract |
|
|
2248
|
+
|
|
2249
|
+
- **Should** treat heavier or larger elements as slower to start and more settled on arrival; lighter, smaller elements can respond and land more quickly.
|
|
2250
|
+
- **Must not** let easings overshoot or bounce — restraint is part of the Aura feel (see **Animation anchors**, Calm).
|
|
2251
|
+
|
|
2252
|
+
**Tailwind implementation**
|
|
2253
|
+
|
|
2254
|
+
Aura has no custom `duration-*`/`ease-*` theme tokens — use [Tailwind's transition utilities](https://tailwindcss.com/docs/transition-duration) directly, matching existing components (`accordion.tsx`, `tabs.tsx`, `segmented-control.tsx`):
|
|
2255
|
+
|
|
2256
|
+
| Concept | Tailwind utility |
|
|
2257
|
+
| :--- | :--- |
|
|
2258
|
+
| Duration | `duration-150` / `duration-200` / `duration-300`, or an arbitrary value like `duration-[233ms]` for values off the default scale |
|
|
2259
|
+
| Standard / Entrance / Exit / Sine easing | Tailwind's built-in `ease-*` keywords don't match Aura's curves — use an arbitrary value, e.g. `ease-[cubic-bezier(0.40,0.00,0.15,1.00)]` |
|
|
2260
|
+
| Which properties animate | `transition-[property-list]`, e.g. `transition-[top,left,width,height]` (see `tabs.tsx`), rather than the broader `transition-all` |
|
|
2261
|
+
| Stagger | `delay-[Nms]` per item (arbitrary value, since Tailwind has no stagger primitive), or `[animation-delay:Nms]` when using `@keyframes` |
|
|
2262
|
+
| Respect reduced motion | Prefix with `motion-safe:` (already used in `tabs.tsx`, `segmented-control.tsx`) so the transition is skipped for users with reduced-motion enabled |
|
|
2263
|
+
|
|
2264
|
+
**What to animate**
|
|
2265
|
+
|
|
2266
|
+
Every animation is built from a combination of these properties:
|
|
2267
|
+
|
|
2268
|
+
| Property | Use |
|
|
2269
|
+
| :--- | :--- |
|
|
2270
|
+
| Position | Moving elements on screen — the most common property for entrances, exits, and layout transitions |
|
|
2271
|
+
| Scale | Growing or shrinking — drawing attention or showing hierarchy |
|
|
2272
|
+
| Rotation | Less common in UI; adds dynamism when used with restraint |
|
|
2273
|
+
| Opacity | Fading in/out — often paired with position or scale for softer transitions |
|
|
2274
|
+
| Color | Shifting an element's color — state changes, hover feedback, the aurora accent language |
|
|
2275
|
+
| Mask / morph | Revealing through a mask or transforming one shape into another — expressive moments, progressive disclosure |
|
|
2276
|
+
|
|
2277
|
+
- **Should** combine 2–3 properties per transition (e.g. position + opacity) rather than relying on one alone.
|
|
2278
|
+
- **Avoid** animating more properties than the moment needs — restraint keeps productive motion productive.
|
|
2279
|
+
|
|
2280
|
+
**Animation anchors**
|
|
2281
|
+
|
|
2282
|
+
Three qualities every Aura animation should reinforce. Use them to test a motion design, not as literal component names.
|
|
2283
|
+
|
|
2284
|
+
- **Flow** — continuity. Elements arrive and leave with direction and connection; nothing jumps or teleports. Groups reveal with a natural stagger. *Test: can I follow the motion with my eyes without losing my place?*
|
|
2285
|
+
- **Calm** — confidence in restraint. Motion never competes with the industrial data it's presenting. Easings don't overshoot, staggers don't drag, nothing bounces when it should settle. Calm does not mean slow — most motion is quiet **and** fast. *Test: does this still feel good after 8 hours of use?*
|
|
2286
|
+
- **Tactile** — motion builds intuition. Buttons snap, panels slide from the edge they belong to, cards lift when selected — the way something moves signals what's possible before the user thinks about it. *Test: can I tell what's interactive just by how it moves?*
|
|
2287
|
+
|
|
2288
|
+
**Reference example — anatomy of a transition**
|
|
2289
|
+
|
|
2290
|
+
Illustrative breakdown of a dropdown + content entrance, showing how role, timing, easing, and stagger combine (values are examples, not fixed tokens):
|
|
2291
|
+
|
|
2292
|
+
- **Dropdown open** (~233ms total): panel expands with **entrance easing**, 200ms — `transition-[height] duration-200 ease-[cubic-bezier(0.00,0.00,0.15,1.00)]`; list items fade in with a **33ms stagger** per item — `transition-opacity duration-150` plus `delay-[calc(var(--item-index)*33ms)]` (or per-item inline `style={{ transitionDelay: … }}` when the index isn't known at build time).
|
|
2293
|
+
- **Dropdown close** (~233ms total, faster exit): panel and list items fade out together with **exit easing**, no stagger on the way out — `transition-[height,opacity] duration-150 ease-[cubic-bezier(0.67,0.00,0.83,0.83)]`; button copy cross-fades to the new selection with a brief accent wipe for confirmation.
|
|
2294
|
+
- **Content entrance** (~467ms total, expressive): main content scales in from 110% with **entrance easing** — `transition-[transform,opacity] duration-[300ms] ease-[cubic-bezier(0.00,0.00,0.15,1.00)]`; supporting elements (buttons, separators) follow with a **~100–133ms stagger** via `delay-[100ms]`/`delay-[133ms]`; any internal line/chart animation runs slower and separately so it doesn't compete for attention.
|
|
2166
2295
|
|
|
2167
2296
|
---
|
|
2168
2297
|
|
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ Aura exports Cognite's UI components, styles, utilities, and ESLint guidance for
|
|
|
10
10
|
|
|
11
11
|
Aura ships two flavours of component import. Both resolve through the package's `exports` map — never reach into `src/`.
|
|
12
12
|
|
|
13
|
-
**Per-component subpath (preferred for app code)** keeps bundles small by only pulling in what each module actually needs:
|
|
13
|
+
**Per-component subpath (strongly preferred for app code)** keeps bundles small *and* keeps builds fast by only pulling in what each module actually needs:
|
|
14
14
|
|
|
15
15
|
```tsx
|
|
16
16
|
import { Button } from '@cognite/aura/components/button';
|
|
@@ -18,12 +18,33 @@ import { Card } from '@cognite/aura/components/card';
|
|
|
18
18
|
import { DatePicker } from '@cognite/aura/components/date-time-pickers';
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
**Aggregate barrel** is convenient for stories, prototypes, and code that already pulls in many components
|
|
21
|
+
**Aggregate barrel** is convenient for stories, prototypes, and code that already pulls in many components:
|
|
22
22
|
|
|
23
23
|
```tsx
|
|
24
24
|
import { Button, Card } from '@cognite/aura/components';
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
+
> ⚠️ **The barrel is not free at build time.** Even though the runtime output tree-shakes (the barrel is side-effect-free apart from `*.css`), a bundler must still *load and transform* every module the barrel re-exports before tree-shaking can drop the unused ones. That includes heavy graphs such as `shiki` (via `CodeBlock`) and `mermaid` + `streamdown` (via `Message`). For a small app this can mean transforming ~10k modules and exhausting the default Node heap (`JavaScript heap out of memory`). Reaching for a single component from the barrel (`import { Card } from '@cognite/aura/components'`) pays this whole cost. Use per-component subpaths in app code; reserve the barrel for stories/prototypes.
|
|
28
|
+
|
|
29
|
+
Lightweight components never pull the heavy graphs: `shiki` is only imported by `@cognite/aura/components/code-block`, and `mermaid`/`streamdown` only by `@cognite/aura/components/message`. Importing e.g. `@cognite/aura/components/card` (or the shared `@cognite/aura/utils` `cn` helper) pulls neither — the `cn` helper is deliberately kept in a module that has no path to `shiki`.
|
|
30
|
+
|
|
31
|
+
> The `highlightCode` helper (Shiki wrapper) previously lived on `@cognite/aura/utils`. It now has its own entry point, `@cognite/aura/highlight-code`, so that importing `cn` from `@cognite/aura/utils` never drags Shiki into your build graph.
|
|
32
|
+
|
|
33
|
+
**System icons** are provided by Tabler through Aura's icon entry point. Use named imports so application bundlers can tree-shake unused icons:
|
|
34
|
+
|
|
35
|
+
```tsx
|
|
36
|
+
import { IconSearch, IconSettings } from '@cognite/aura/icons';
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Aura styles default Tabler icons to 16px with a 1.5px stroke. Override these defaults with Tailwind utilities, which take precedence over Aura's base styles:
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
<IconSearch />
|
|
43
|
+
<IconSettings className="size-6 stroke-2" />
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Use `size-*` and `stroke-*` utilities rather than Tabler's `size` and `stroke` props when Aura styles are loaded, because CSS takes precedence over SVG presentation attributes.
|
|
47
|
+
|
|
27
48
|
Stylesheets and tokens are imported the same way regardless of which component-import style you use:
|
|
28
49
|
|
|
29
50
|
```tsx
|
|
@@ -33,7 +54,7 @@ import '@cognite/aura/styles.css';
|
|
|
33
54
|
|
|
34
55
|
Canonical token sources in this repo: `src/colors.css` and `src/styles.source.css`. In consuming apps, import from the published package paths above — not from `src/` next to your app code.
|
|
35
56
|
|
|
36
|
-
Do not import Aura through relative paths from another project, such as `../../../libs/aura/src/components`. Fusion resolves Aura through its package exports, so use `@cognite/aura/components` (or a per-component subpath), `@cognite/aura/colors.css`, and `@cognite/aura/styles.css`.
|
|
57
|
+
Do not import Aura through relative paths from another project, such as `../../../libs/aura/src/components`. Fusion resolves Aura through its package exports, so use `@cognite/aura/components` (or a per-component subpath), `@cognite/aura/icons`, `@cognite/aura/colors.css`, and `@cognite/aura/styles.css`.
|
|
37
58
|
|
|
38
59
|
#### Adding a new component
|
|
39
60
|
|
|
@@ -19,13 +19,17 @@ export { RadioGroup, RadioGroupItem, RadioGroupItemControl, RadioGroupItemDescri
|
|
|
19
19
|
export { Badge, badgeVariants } from './ui/core/badge/badge';
|
|
20
20
|
export { Banner, BannerAction, BannerActions, BannerClose, BannerIcon, BannerStatus, BannerTitle, } from './ui/core/banner/banner';
|
|
21
21
|
export { Breadcrumb, BreadcrumbEllipsis, BreadcrumbEllipsisButton, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbPageButton, BreadcrumbSeparator, } from './ui/core/breadcrumb/breadcrumb';
|
|
22
|
+
export { type CollapseStrategy } from './ui/core/overflow-list/overflow-list.utils';
|
|
22
23
|
export { Topbar, TopbarAction, TopbarBreadcrumbs, TopbarCenter, TopbarIcon, TopbarLeft, TopbarMetadata, TopbarRight, TopbarThemeSwitcher, type TopbarTheme, } from './ui/core/topbar/topbar';
|
|
23
24
|
export { Collapsible, CollapsibleContent, CollapsibleTrigger, } from './ui/core/collapsible/collapsible';
|
|
24
25
|
export { HoverCard, HoverCardTrigger, HoverCardContent, } from './ui/core/hover-card/hover-card';
|
|
25
26
|
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, } from './ui/core/select/select';
|
|
26
27
|
export { SegmentedControl, SegmentedControlButton, SegmentedControlContent, SegmentedControlList, segmentedControlButtonVariants, segmentedControlListVariants, } from './ui/core/segmented-control/segmented-control';
|
|
27
28
|
export { Skeleton } from './ui/core/skeleton/skeleton';
|
|
29
|
+
export { Slider } from './ui/core/slider/slider';
|
|
30
|
+
export { Switch } from './ui/core/switch/switch';
|
|
28
31
|
export { Toaster, toast } from './ui/core/sonner-toast/sonner-toast';
|
|
32
|
+
export { Combobox } from './ui/core/combobox/combobox';
|
|
29
33
|
export { Input } from './ui/core/input/input';
|
|
30
34
|
export { Kbd, KbdGroup } from './ui/core/kbd/kbd';
|
|
31
35
|
export { Progress } from './ui/core/progress/progress';
|
|
@@ -48,6 +52,6 @@ export { Popover, PopoverClose, PopoverContent, PopoverDescription, PopoverHeade
|
|
|
48
52
|
export { Pagination, PaginationContent, PaginationEllipsis, PaginationFirst, PaginationItem, PaginationLast, PaginationLink, PaginationNext, PaginationPrevious, PaginationResultsPerPage, PaginationResultsPerPageLabel, PaginationSelectTrigger, PaginationStatus, PaginationTeleport, } from './ui/core/pagination/pagination';
|
|
49
53
|
export { Sources, SourcesTitle, Source } from './ui/core/sources/sources';
|
|
50
54
|
export { DatePicker, DateRangePicker, DateTimeRangePicker, TimePicker, } from './ui/core/date-time-pickers';
|
|
51
|
-
export type { DatePickerProps, DateRangePickerProps, DateTimeRangePickerProps, ShortcutItem, TimeFormat, TimePickerProps, } from './ui/core/date-time-pickers';
|
|
55
|
+
export type { AmPm, DatePickerProps, DateRangePickerProps, DateTimeRangePickerProps, ShortcutItem, TimeFormat, TimePickerProps, } from './ui/core/date-time-pickers';
|
|
52
56
|
export { PortalContainerContext } from '../lib/portal-container-context';
|
|
53
57
|
export type { ComponentMeta, ComponentStatusType } from '../lib/types';
|