@vokality/design-system 1.2.3 → 2.0.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/CHANGELOG.md +35 -0
- package/README.md +6 -0
- package/dist/components/Badge/Badge.d.ts +6 -4
- package/dist/components/Badge/Badge.js +6 -4
- package/dist/components/Button/Button.d.ts +2 -1
- package/dist/components/Field/Field.js +2 -2
- package/dist/components/Fieldset/Fieldset.d.ts +11 -0
- package/dist/components/Fieldset/Fieldset.js +12 -0
- package/dist/components/Grid/Grid.d.ts +866 -4
- package/dist/components/Grid/Grid.js +3 -4
- package/dist/components/Inline/Inline.d.ts +866 -4
- package/dist/components/Inline/Inline.js +3 -4
- package/dist/components/Stack/Stack.d.ts +866 -4
- package/dist/components/Stack/Stack.js +3 -4
- package/dist/components/Text/Text.d.ts +15 -4
- package/dist/components/Text/Text.js +3 -4
- package/dist/components.css +166 -19
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/internal/describedBy.d.ts +3 -0
- package/dist/internal/describedBy.js +4 -0
- package/dist/tokens.css +2 -0
- package/dist/tokens.dtcg.json +10 -0
- package/dist/tokens.json +10 -0
- package/dist/types.d.ts +6 -1
- package/dist/vokality.css +168 -19
- package/dist/vokality.iife.js +945 -912
- package/docs/brand.md +3 -1
- package/docs/components/Badge/README.md +2 -0
- package/docs/components/Button/README.md +7 -3
- package/docs/components/Fieldset/README.md +25 -0
- package/docs/components/Grid/README.md +2 -0
- package/docs/components/Inline/README.md +2 -0
- package/docs/components/PageHeader/README.md +2 -0
- package/docs/components/Stack/README.md +2 -0
- package/docs/components/Text/README.md +4 -0
- package/package.json +1 -1
package/docs/brand.md
CHANGED
|
@@ -98,6 +98,8 @@ The test suite checks these pairs in every theme and fails the build if one slip
|
|
|
98
98
|
|
|
99
99
|
## Space and layout
|
|
100
100
|
|
|
101
|
+
- Dense operational apps can opt in with `data-density="compact"` on `<html>`. The shared compact scale is 20px page titles, 16px section titles, 14px body and fine-pointer controls (16px input text with a coarse pointer, which stops iOS focus zoom), 24px statistics; smaller text (metadata, captions) keeps its size. Table cells, list and navigation rows, menus and cards tighten too. Headers add no trailing section margin; compose vertical rhythm with `Stack`. Actions align with the page title. Controls share a 32px height for fine pointers and retain 44px when a coarse pointer is available. The default scale is unchanged.
|
|
102
|
+
|
|
101
103
|
- Apps: wrap the screen in `AppShell` (56px top bar, 15rem sidebar that collapses to icons and becomes an overlay below 48rem), put a `PageHeader` at the top of each page, and lay out content with `Stack`, `Inline` and `Grid`. Start new pages from the templates.
|
|
102
104
|
- Sites and documents: set content in one frame, max-width 80rem (`--content-max`), outlined left, right and bottom by `border-subtle`, over a faint 10px dot grid (`.vk-dot-grid`) on marketing pages.
|
|
103
105
|
- The horizontal gutter is fluid: `--section-gutter: clamp(1.5rem, 5vw, 2.5rem)`. Marketing sections pad `clamp(2.75rem, 7vw, 4rem)` vertically; dense app screens use `space-lg` to `space-xl`.
|
|
@@ -146,7 +148,7 @@ The test suite checks these pairs in every theme and fails the build if one slip
|
|
|
146
148
|
## Touch and pointer
|
|
147
149
|
|
|
148
150
|
- Tooltips open on hover after 400ms, at once on keyboard focus, and on a tap for 1.5s. They hold only a hint: anything a touch user needs must also be visible or in the control's label.
|
|
149
|
-
- Every target is at least
|
|
151
|
+
- Every target is at least 24px (WCAG 2.5.8); small controls such as tag remove buttons and sort headers extend their hit area without changing their look. With a coarse pointer, buttons, form controls, menu, navigation and tree rows, choices and pagination are 44px in every density. Context menus also open with the keyboard (Shift+F10 or the Menu key).
|
|
150
152
|
|
|
151
153
|
## Using the system in code
|
|
152
154
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Badge
|
|
2
2
|
|
|
3
|
+
`icon` adds a system status icon beside the label. Standard span attributes and a forwarded ref allow a badge to be a tooltip trigger: `<Tooltip content="Connected recently"><Badge tone="success" icon="circle-check" tabIndex={0}>Online</Badge></Tooltip>`. Focusable badges show the shared focus ring and provide a `--button-height-sm` target (32px, 44px with a coarse pointer); essential information must also remain visible.
|
|
4
|
+
|
|
3
5
|
A small outlined tag for status, set beside a title or in a table cell.
|
|
4
6
|
|
|
5
7
|
## Anatomy
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Button
|
|
2
2
|
|
|
3
|
-
The
|
|
3
|
+
The button for actions and record names, with square corners and a visible keyboard focus ring.
|
|
4
4
|
|
|
5
5
|
## Anatomy
|
|
6
6
|
1. **Container**: square (`radius`), 1px border, 40px minimum height (32px at `sm`).
|
|
@@ -14,6 +14,7 @@ The text button for every action, in three variants and two sizes, always square
|
|
|
14
14
|
| `outline` | Secondary actions | none | `primary` | `foreground`, 600 |
|
|
15
15
|
| `ghost` | Low-emphasis actions in toolbars, dialogs and dense rows | none | none | `foreground`, 600 |
|
|
16
16
|
| `danger` | The confirming action of a destructive dialog ("Delete invoice") | `danger` | `danger` | `on-status`, 700 |
|
|
17
|
+
| `text` | A record name that opens details | none | none | `foreground`, sentence case, 500 |
|
|
17
18
|
|
|
18
19
|
## Sizes
|
|
19
20
|
| Size | Min height | Label | Padding |
|
|
@@ -31,7 +32,7 @@ The text button for every action, in three variants and two sizes, always square
|
|
|
31
32
|
|
|
32
33
|
## Props
|
|
33
34
|
- `children`: the label in sentence case, starting with a verb.
|
|
34
|
-
- `variant`: `primary` (default), `outline`, `ghost` or `
|
|
35
|
+
- `variant`: `primary` (default), `outline`, `ghost`, `danger` or `text`. `size`: `sm` for dense screens.
|
|
35
36
|
- `href` renders an `<a>`; otherwise a `<button type="button">`. Pass `type="submit"` in forms.
|
|
36
37
|
- `arrow` adds the external-link glyph cell. Other attributes pass through.
|
|
37
38
|
- `loading` disables the button, sets `aria-busy` and shows a spinner before the label; `loadingLabel` replaces the label while it runs ("Saving…"). Use it instead of building the spinner yourself.
|
|
@@ -39,5 +40,8 @@ The text button for every action, in three variants and two sizes, always square
|
|
|
39
40
|
|
|
40
41
|
## Rules
|
|
41
42
|
- One `primary` per view. Put it first in a row and last in a dialog footer.
|
|
42
|
-
- Under 40rem, buttons stretch to the column width.
|
|
43
|
+
- Under 40rem, buttons stretch to the column width; `text` stays content-sized. Text buttons support multiline labels and keep a 32px minimum target.
|
|
44
|
+
- With `data-density="compact"` on `html`, record names use 14px and action labels keep their size (12px, 11px at `sm`). Compact redefines `--button-height` and `--button-height-sm` to the control height, so buttons of both sizes align with inputs at 32px for fine pointers or 44px when a coarse pointer is available.
|
|
45
|
+
- Beside a field in an `Inline` row, a button takes the field height (44px by default, 32px compact with a fine pointer).
|
|
46
|
+
- With a coarse pointer, every button and icon button is 44px in any density (`--button-height` and `--button-height-sm` follow `--control-height`).
|
|
43
47
|
- Don't use a button for navigation inside running text; use `Link`.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Fieldset
|
|
2
|
+
|
|
3
|
+
A labelled group of related controls, such as permissions or notification preferences.
|
|
4
|
+
|
|
5
|
+
## Anatomy
|
|
6
|
+
- Native `fieldset` and `legend` preserve grouping for assistive technology.
|
|
7
|
+
- A square 1px `border-subtle` rule and `space-md` padding enclose the group; controls use `space-sm` gaps.
|
|
8
|
+
- Optional `hint` and `error` text describe the entire group through `aria-describedby`. An error also sets `aria-invalid`.
|
|
9
|
+
|
|
10
|
+
## Props
|
|
11
|
+
- `legend`: the visible accessible name.
|
|
12
|
+
- `hint`, `error`: instructions or validation applying to the whole group.
|
|
13
|
+
- `children`: controls, usually `Checkbox` or `Radio`.
|
|
14
|
+
- Native fieldset attributes, including `disabled`, plus a forwarded ref.
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
<Fieldset legend="Permissions" hint="Choose what this staff member can do.">
|
|
20
|
+
<Checkbox label="Read operations" checked={read} onChange={setRead} />
|
|
21
|
+
<Checkbox label="Manage invitations" checked={invite} onChange={setInvite} />
|
|
22
|
+
</Fieldset>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Keep individual control errors in `Field`; use the group error only when the group itself is invalid. The native disabled state prevents interaction with controls in the group.
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Grid
|
|
2
2
|
|
|
3
|
+
Standard element attributes and events pass through to `as`, including IDs and ARIA labels.
|
|
4
|
+
|
|
3
5
|
A responsive grid. With `columns` it is a fixed count (one column under 40rem); without, it fits as many columns of at least `min` width as the space allows.
|
|
4
6
|
|
|
5
7
|
## Props
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Inline
|
|
2
2
|
|
|
3
|
+
Standard element attributes and events pass through to `as`, including IDs, ARIA labels and form events. Use `<Inline as="form" onSubmit={...}>` for a search toolbar. When a row contains a field, its buttons and icon buttons take the field height (`--control-height`), whatever their `size`, so they sit flush. `style` can size a flex item; visual controls remain system components.
|
|
4
|
+
|
|
3
5
|
Lays children out in a row that wraps, with one gap. For button groups, tag lists, metadata rows and toolbars.
|
|
4
6
|
|
|
5
7
|
## Props
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# PageHeader
|
|
2
2
|
|
|
3
|
+
With `data-density="compact"` on `html`, the title is 20px and the description is 14px. Actions share the title row, including when an eyebrow is present, and move below the description when the header itself is narrower than 40rem (including beside a sidebar). The header contributes no trailing margin; use the parent `Stack` gap for separation.
|
|
4
|
+
|
|
3
5
|
The top of a page inside an app: breadcrumbs, the page title (the page's `h1`), an optional description and the page's main actions.
|
|
4
6
|
|
|
5
7
|
## Anatomy
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Stack
|
|
2
2
|
|
|
3
|
+
Standard element attributes and events pass through to `as`, including IDs, ARIA labels and form events. `style` is available for product-specific sizing and placement; use the layout props for shared spacing and alignment.
|
|
4
|
+
|
|
3
5
|
Lays children out vertically with one gap from the spacing scale. Use it instead of margins between siblings.
|
|
4
6
|
|
|
5
7
|
## Props
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Text
|
|
2
2
|
|
|
3
|
+
Use `numeric` for Space Grotesk with tabular figures, `overflowWrap="anywhere"` for long IDs, and `weight="regular" | "medium" | "semibold" | "bold"` for emphasis independent of size. Standard element attributes pass through. For example: `<Text as="span" size="small" numeric overflowWrap="anywhere">{record.id}</Text>`.
|
|
4
|
+
|
|
5
|
+
Use `truncate` for a single line that ends in an ellipsis when its container narrows, such as the two lines of an app-shell brand. The full text remains available to assistive technology.
|
|
6
|
+
|
|
3
7
|
Running text in one of the system's text styles and tones.
|
|
4
8
|
|
|
5
9
|
## Props
|
package/package.json
CHANGED