@vokality/design-system 5.0.0 → 5.1.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 +13 -0
- package/README.md +1 -1
- package/dist/components/Menu/Menu.d.ts +2 -2
- package/dist/components/Menu/Menu.js +2 -2
- package/dist/components/Popover/Popover.d.ts +2 -2
- package/dist/components/Select/Select.d.ts +2 -0
- package/dist/components/Select/Select.js +2 -2
- package/dist/components.css +7 -2
- package/dist/icons/refresh.svg +1 -0
- package/dist/icons/settings.svg +1 -0
- package/dist/lib/icons.d.ts +15 -0
- package/dist/lib/icons.js +9 -0
- package/dist/vokality.css +7 -2
- package/dist/vokality.iife.js +10 -2
- package/docs/components/Icon/README.md +1 -1
- package/docs/components/Menu/README.md +1 -1
- package/docs/components/Popover/README.md +3 -2
- package/docs/components/Select/README.md +2 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@vokality/design-system`. The package follows [semantic versioning](https://semver.org); see CONTRIBUTING.md for what counts as breaking.
|
|
4
4
|
|
|
5
|
+
## 5.1.0 — 2026-10-19
|
|
6
|
+
|
|
7
|
+
Compact toolbar and status-line controls.
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- `settings` (Lucide settings) and `refresh` (Lucide rotate-cw) icons, 18px by default, in `iconData`, `Icon`, `IconButton` and `icons/*.svg`.
|
|
11
|
+
- `variant="text"` on `Menu` and `Popover` triggers: sentence case with the chevron after the label; at `size="xs"` it is 12px, the size of `Text size="small"` under compact density. With `size="xs"` it sits at `--control-height-xs`, like `Button variant="text" size="xs"`.
|
|
12
|
+
- `Select` `size="xs"`: a 24px toolbar trigger with 12px text and tighter padding on fine pointers; coarse pointers keep 44px, and form fields keep the control height.
|
|
13
|
+
- Stories: `IconButton` `Settings`, `Popover` `StatusLine`, `Select` `Sizes`, and the text variant in the `Menu` and `Popover` `Sizes` stories.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
- An icon-only `Menu` trigger with `variant="primary"` rendered a class with no styles; it is a ghost icon button, as for every variant other than `outline`.
|
|
17
|
+
|
|
5
18
|
## 5.0.0 — 2026-10-19
|
|
6
19
|
|
|
7
20
|
Agent activity in chat transcripts.
|
package/README.md
CHANGED
|
@@ -89,7 +89,7 @@ Pages not rendered by React can inline `themeScript()` instead. See `docs/compon
|
|
|
89
89
|
|
|
90
90
|
Pass `density="compact"` to `ThemeProvider` for dense operational interfaces. It uses 20px page titles, 16px section titles, 14px body text and 24px statistics, never enlarges smaller text, and tightens table cells, list and navigation rows, menus and cards. Page-header actions align with the title; headers leave section spacing to `Stack` instead of adding another margin. With only a fine pointer, buttons and fields share a 32px height and inputs use 14px text; when a coarse pointer is available they keep 44px targets and 16px input text, which stops iOS zooming on focus. Density redefines the control tokens (`--control-height`, `--control-font-size`, `--control-padding-block`) and the button heights, so components that size from them follow it while component-specific sizes still apply. The provider sets it on `html`, so portalled dialogs and menus inherit it. Without it the defaults apply. Prose follows the compact scale (14px text, headings from 20px), and alert and toast titles use 14px.
|
|
91
91
|
|
|
92
|
-
For toolbars, record rows and status lines, `size="xs"` on `Button`, `IconButton`, `Menu`, `Popover` and `SegmentedControl` gives 24px actions with 11px labels.
|
|
92
|
+
For toolbars, record rows and status lines, `size="xs"` on `Button`, `IconButton`, `Menu`, `Popover` and `SegmentedControl` gives 24px actions with 11px labels, and on `Select` a 24px toolbar picker with 12px text. A status-line `Menu` or `Popover` takes `variant="text"` to read in sentence case, at 12px with `size="xs"`, like compact `Text size="small"`. Form fields keep the control height, so forms stay readable. Extra-small sizes apply with fine pointers only; a coarse pointer keeps the 44px target. The `--control-height-xs` token holds the height.
|
|
93
93
|
|
|
94
94
|
Compose pages with `Stack`, `Inline` and `Grid`; these forward standard attributes and events typed for the element they render, including `Inline as="form" onSubmit={...}`. Use `Fieldset` for related controls, `Button variant="text"` for record names, and `Text numeric overflowWrap="anywhere"` for long identifiers.
|
|
95
95
|
|
|
@@ -3,8 +3,8 @@ export interface MenuProps {
|
|
|
3
3
|
items: MenuEntry[];
|
|
4
4
|
label?: string;
|
|
5
5
|
icon?: IconName;
|
|
6
|
-
triggerLabel?: string;
|
|
7
|
-
variant?: 'outline' | 'ghost' | 'primary';
|
|
6
|
+
triggerLabel?: string; /** text reads as a sentence-case label, 12px at xs; it applies to labelled triggers. */
|
|
7
|
+
variant?: 'outline' | 'ghost' | 'primary' | 'text';
|
|
8
8
|
size?: 'sm' | 'xs';
|
|
9
9
|
align?: 'start' | 'end';
|
|
10
10
|
disabled?: boolean;
|
|
@@ -6,10 +6,10 @@ import { Icon } from "../Icon/Icon.js";
|
|
|
6
6
|
import { cx } from "../../lib/cx.js";
|
|
7
7
|
import { MenuEntries } from "./entries.js";
|
|
8
8
|
/** Menu button (WAI-ARIA), built on Radix DropdownMenu. */
|
|
9
|
-
/** An icon button when the trigger has only an icon, else a labelled button; both follow size. */
|
|
9
|
+
/** An icon button (ghost or outline) when the trigger has only an icon, else a labelled button; both follow size. */
|
|
10
10
|
function triggerClass(iconOnly, variant, size) {
|
|
11
11
|
return iconOnly
|
|
12
|
-
? cx("vk-icon-btn", "vk-icon-btn-"
|
|
12
|
+
? cx("vk-icon-btn", variant === "outline" ? "vk-icon-btn-outline" : "vk-icon-btn-ghost", size === "xs" && "vk-icon-btn-xs")
|
|
13
13
|
: cx("vk-btn", "vk-btn-" + (variant || "outline"), size === "sm" && "vk-btn-sm", size === "xs" && "vk-btn-xs");
|
|
14
14
|
}
|
|
15
15
|
export function Menu({ items, label, icon, triggerLabel, variant, size, align, disabled, className }) {
|
|
@@ -4,8 +4,8 @@ import type { IconName } from "../../types.js";
|
|
|
4
4
|
export interface PopoverProps extends Pick<Primitive.PopoverProps, 'open' | 'defaultOpen' | 'onOpenChange' | 'modal'> {
|
|
5
5
|
label: string;
|
|
6
6
|
title?: string;
|
|
7
|
-
icon?: IconName;
|
|
8
|
-
variant?: 'outline' | 'ghost' | 'primary';
|
|
7
|
+
icon?: IconName; /** text reads as a sentence-case status ("2 issues"), 12px at xs; outline is the default. */
|
|
8
|
+
variant?: 'outline' | 'ghost' | 'primary' | 'text';
|
|
9
9
|
size?: 'sm' | 'xs';
|
|
10
10
|
align?: 'start' | 'end';
|
|
11
11
|
width?: string;
|
|
@@ -13,6 +13,8 @@ export interface SelectProps extends Omit<RootProps, "children" | "value" | "def
|
|
|
13
13
|
defaultValue?: string;
|
|
14
14
|
/** Receives Radix's changed value and its matching option. */
|
|
15
15
|
onChange?: (value: string, option: SelectOption) => void;
|
|
16
|
+
/** xs for toolbars and status lines (24px with small type on fine pointers, 44px on touch); forms keep the control height. */
|
|
17
|
+
size?: 'xs';
|
|
16
18
|
id?: string;
|
|
17
19
|
className?: string;
|
|
18
20
|
"aria-label"?: string;
|
|
@@ -8,7 +8,7 @@ import { normalizeOptions } from "../../internal/options.js";
|
|
|
8
8
|
import { useUid } from "../../internal/useUid.js";
|
|
9
9
|
import { cx } from "../../lib/cx.js";
|
|
10
10
|
/** Styled Radix Select. Radix owns state, form participation, focus, keys and dismissal. */
|
|
11
|
-
export const Select = forwardRef(function Select({ options: optionValues, placeholder, value, defaultValue, onChange, id, className, "aria-label": ariaLabel, "aria-labelledby": labelledBy, "aria-describedby": describedBy, "aria-invalid": invalid, ...rootProps }, ref) {
|
|
11
|
+
export const Select = forwardRef(function Select({ options: optionValues, placeholder, value, defaultValue, onChange, size, id, className, "aria-label": ariaLabel, "aria-labelledby": labelledBy, "aria-describedby": describedBy, "aria-invalid": invalid, ...rootProps }, ref) {
|
|
12
12
|
const { messages } = useLocale();
|
|
13
13
|
const options = normalizeOptions(optionValues);
|
|
14
14
|
const baseId = useUid("vk-select");
|
|
@@ -17,5 +17,5 @@ export const Select = forwardRef(function Select({ options: optionValues, placeh
|
|
|
17
17
|
if (option)
|
|
18
18
|
onChange?.(option.value, option);
|
|
19
19
|
};
|
|
20
|
-
return (_jsx("div", { className: cx("vk-select", className), children: _jsxs(Primitive.Root, { ...rootProps, value: value === null ? "" : value, defaultValue: defaultValue, onValueChange: onValueChange, children: [_jsxs(Primitive.Trigger, { ref: ref, id: id, className: "vk-input vk-select-trigger", "aria-label": ariaLabel, "aria-labelledby": labelledBy, "aria-describedby": describedBy, "aria-invalid": invalid, children: [_jsx("span", { className: "vk-select-value", children: _jsx(Primitive.Value, { placeholder: placeholder ?? messages.selectOne }) }), _jsx(Primitive.Icon, { asChild: true, children: _jsx(Icon, { name: "chevron-down", className: "vk-select-icon" }) })] }), _jsx(Primitive.Portal, { children: _jsx(Primitive.Content, { position: "popper", side: "bottom", align: "start", sideOffset: 4, collisionPadding: 8, className: "vk-select-menu vk-select-content", "aria-label": ariaLabel, "aria-labelledby": labelledBy, children: _jsx(Primitive.Viewport, { className: "vk-select-viewport", children: options.map((option, index) => (_jsxs(Primitive.Item, { value: option.value, textValue: option.label, disabled: option.disabled, "data-index": index, "aria-describedby": option.description ? baseId + "-" + String(index) + "-desc" : undefined, className: "vk-select-option", children: [_jsxs("span", { className: "vk-select-option-text", children: [_jsx(Primitive.ItemText, { children: option.label }), option.description ? _jsx("span", { id: baseId + "-" + String(index) + "-desc", className: "vk-select-option-description", children: option.description }) : null] }), _jsx(Primitive.ItemIndicator, { asChild: true, children: _jsx(Icon, { name: "check", size: 16, className: "vk-select-check" }) })] }, option.value))) }) }) })] }) }));
|
|
20
|
+
return (_jsx("div", { className: cx("vk-select", size === "xs" && "vk-select-xs", className), children: _jsxs(Primitive.Root, { ...rootProps, value: value === null ? "" : value, defaultValue: defaultValue, onValueChange: onValueChange, children: [_jsxs(Primitive.Trigger, { ref: ref, id: id, className: "vk-input vk-select-trigger", "aria-label": ariaLabel, "aria-labelledby": labelledBy, "aria-describedby": describedBy, "aria-invalid": invalid, children: [_jsx("span", { className: "vk-select-value", children: _jsx(Primitive.Value, { placeholder: placeholder ?? messages.selectOne }) }), _jsx(Primitive.Icon, { asChild: true, children: _jsx(Icon, { name: "chevron-down", className: "vk-select-icon" }) })] }), _jsx(Primitive.Portal, { children: _jsx(Primitive.Content, { position: "popper", side: "bottom", align: "start", sideOffset: 4, collisionPadding: 8, className: "vk-select-menu vk-select-content", "aria-label": ariaLabel, "aria-labelledby": labelledBy, children: _jsx(Primitive.Viewport, { className: "vk-select-viewport", children: options.map((option, index) => (_jsxs(Primitive.Item, { value: option.value, textValue: option.label, disabled: option.disabled, "data-index": index, "aria-describedby": option.description ? baseId + "-" + String(index) + "-desc" : undefined, className: "vk-select-option", children: [_jsxs("span", { className: "vk-select-option-text", children: [_jsx(Primitive.ItemText, { children: option.label }), option.description ? _jsx("span", { id: baseId + "-" + String(index) + "-desc", className: "vk-select-option-description", children: option.description }) : null] }), _jsx(Primitive.ItemIndicator, { asChild: true, children: _jsx(Icon, { name: "check", size: 16, className: "vk-select-check" }) })] }, option.value))) }) }) })] }) }));
|
|
21
21
|
});
|
package/dist/components.css
CHANGED
|
@@ -115,6 +115,8 @@ body {
|
|
|
115
115
|
border: 1px solid transparent;
|
|
116
116
|
}
|
|
117
117
|
.vk-btn-text .vk-btn-label, .vk-btn-text .vk-btn-label:only-child { padding: var(--space-xs) 0; }
|
|
118
|
+
/* A text Menu or Popover trigger keeps its chevron beside the label instead of in a square cell. */
|
|
119
|
+
.vk-btn-text .vk-btn-glyph { width: auto; padding-left: var(--space-xs); }
|
|
118
120
|
.vk-btn-text:hover { color: var(--primary); text-decoration: underline; text-underline-offset: var(--space-xs); }
|
|
119
121
|
.vk-btn-text:disabled { cursor: not-allowed; opacity: 0.5; }
|
|
120
122
|
|
|
@@ -2142,16 +2144,19 @@ html[data-density="compact"] body { font-size: var(--text-sm); }
|
|
|
2142
2144
|
@media (max-width: 40rem) {
|
|
2143
2145
|
.vk-btn-xs { width: auto; justify-content: flex-start; }
|
|
2144
2146
|
}
|
|
2145
|
-
/* Extra-small
|
|
2146
|
-
Menu, Popover and
|
|
2147
|
+
/* Extra-small controls for toolbars, record rows and status lines: size="xs" on Button, IconButton,
|
|
2148
|
+
Menu, Popover, SegmentedControl and Select. Fine pointers only; with any coarse pointer they keep the 44px touch target. */
|
|
2147
2149
|
@media (pointer: fine) and (not (any-pointer: coarse)) {
|
|
2148
2150
|
.vk-btn-xs { min-height: var(--control-height-xs); font-size: 0.6875rem; }
|
|
2149
2151
|
.vk-btn-xs .vk-btn-label, .vk-btn-xs .vk-btn-label:only-child { padding: 0 var(--space-sm); }
|
|
2150
2152
|
.vk-btn-xs .vk-btn-glyph { width: var(--control-height-xs); }
|
|
2151
2153
|
.vk-btn-text.vk-btn-xs { font-size: var(--text-xs); }
|
|
2152
2154
|
.vk-btn-text.vk-btn-xs .vk-btn-label, .vk-btn-text.vk-btn-xs .vk-btn-label:only-child { padding: 0; }
|
|
2155
|
+
.vk-btn-text.vk-btn-xs .vk-btn-glyph { width: auto; }
|
|
2153
2156
|
.vk-icon-btn-xs { width: var(--control-height-xs); height: var(--control-height-xs); }
|
|
2154
2157
|
.vk-icon-btn-xs .vk-icon { width: 16px; height: 16px; }
|
|
2158
|
+
.vk-select-xs .vk-select-trigger { min-height: var(--control-height-xs); padding: 0 calc(var(--space-sm) + 14px + var(--space-xs)) 0 var(--space-sm); font-size: var(--text-xs); }
|
|
2159
|
+
.vk-select-xs .vk-select-icon { top: calc(var(--control-height-xs) / 2); right: var(--space-sm); width: 14px; height: 14px; }
|
|
2155
2160
|
.vk-segmented-xs .vk-segment { min-height: calc(var(--control-height-xs) - 2px); padding: 0 var(--space-sm); font-size: var(--text-xs); }
|
|
2156
2161
|
}
|
|
2157
2162
|
/* Touch: buttons and rows meet a 44px target in every density (WCAG 2.5.5, Apple HIG); density only tightens fine-pointer layouts. */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="#e1dfdb" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"/><path d="M21 3v5h-5"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="#e1dfdb" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915"/><circle cx="12" cy="12" r="3"/></svg>
|
package/dist/lib/icons.d.ts
CHANGED
|
@@ -196,6 +196,21 @@ export declare const ICONS: {
|
|
|
196
196
|
stroke: number;
|
|
197
197
|
d: string[];
|
|
198
198
|
};
|
|
199
|
+
settings: {
|
|
200
|
+
size: number;
|
|
201
|
+
stroke: number;
|
|
202
|
+
d: string[];
|
|
203
|
+
circle: {
|
|
204
|
+
cx: number;
|
|
205
|
+
cy: number;
|
|
206
|
+
r: number;
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
refresh: {
|
|
210
|
+
size: number;
|
|
211
|
+
stroke: number;
|
|
212
|
+
d: string[];
|
|
213
|
+
};
|
|
199
214
|
menu: {
|
|
200
215
|
size: number;
|
|
201
216
|
stroke: number;
|
package/dist/lib/icons.js
CHANGED
|
@@ -38,6 +38,15 @@ export const ICONS = {
|
|
|
38
38
|
chart: { size: 16, stroke: 1.5, d: ["M3 3v16a2 2 0 0 0 2 2h16", "M18 17V9", "M13 17V5", "M8 17v-3"] },
|
|
39
39
|
clock: { size: 16, stroke: 1.75, d: ["M12 6v6l4 2"], circle: { cx: 12, cy: 12, r: 10 } },
|
|
40
40
|
sidebar: { size: 18, stroke: 1.75, d: ["M5 3h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z", "M9 3v18"] },
|
|
41
|
+
// https://github.com/lucide-icons/lucide/blob/main/icons/settings.svg
|
|
42
|
+
settings: {
|
|
43
|
+
size: 18,
|
|
44
|
+
stroke: 1.75,
|
|
45
|
+
d: ["M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915"],
|
|
46
|
+
circle: { cx: 12, cy: 12, r: 3 }
|
|
47
|
+
},
|
|
48
|
+
// https://github.com/lucide-icons/lucide/blob/main/icons/rotate-cw.svg
|
|
49
|
+
refresh: { size: 18, stroke: 1.75, d: ["M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8", "M21 3v5h-5"] },
|
|
41
50
|
menu: { size: 22, stroke: 1.75, d: ["M4 6h16M4 12h16M4 18h16"] },
|
|
42
51
|
x: { size: 22, stroke: 1.75, d: ["M18 6 6 18M6 6l12 12"] },
|
|
43
52
|
phone: {
|
package/dist/vokality.css
CHANGED
|
@@ -459,6 +459,8 @@ body {
|
|
|
459
459
|
border: 1px solid transparent;
|
|
460
460
|
}
|
|
461
461
|
.vk-btn-text .vk-btn-label, .vk-btn-text .vk-btn-label:only-child { padding: var(--space-xs) 0; }
|
|
462
|
+
/* A text Menu or Popover trigger keeps its chevron beside the label instead of in a square cell. */
|
|
463
|
+
.vk-btn-text .vk-btn-glyph { width: auto; padding-left: var(--space-xs); }
|
|
462
464
|
.vk-btn-text:hover { color: var(--primary); text-decoration: underline; text-underline-offset: var(--space-xs); }
|
|
463
465
|
.vk-btn-text:disabled { cursor: not-allowed; opacity: 0.5; }
|
|
464
466
|
|
|
@@ -2486,16 +2488,19 @@ html[data-density="compact"] body { font-size: var(--text-sm); }
|
|
|
2486
2488
|
@media (max-width: 40rem) {
|
|
2487
2489
|
.vk-btn-xs { width: auto; justify-content: flex-start; }
|
|
2488
2490
|
}
|
|
2489
|
-
/* Extra-small
|
|
2490
|
-
Menu, Popover and
|
|
2491
|
+
/* Extra-small controls for toolbars, record rows and status lines: size="xs" on Button, IconButton,
|
|
2492
|
+
Menu, Popover, SegmentedControl and Select. Fine pointers only; with any coarse pointer they keep the 44px touch target. */
|
|
2491
2493
|
@media (pointer: fine) and (not (any-pointer: coarse)) {
|
|
2492
2494
|
.vk-btn-xs { min-height: var(--control-height-xs); font-size: 0.6875rem; }
|
|
2493
2495
|
.vk-btn-xs .vk-btn-label, .vk-btn-xs .vk-btn-label:only-child { padding: 0 var(--space-sm); }
|
|
2494
2496
|
.vk-btn-xs .vk-btn-glyph { width: var(--control-height-xs); }
|
|
2495
2497
|
.vk-btn-text.vk-btn-xs { font-size: var(--text-xs); }
|
|
2496
2498
|
.vk-btn-text.vk-btn-xs .vk-btn-label, .vk-btn-text.vk-btn-xs .vk-btn-label:only-child { padding: 0; }
|
|
2499
|
+
.vk-btn-text.vk-btn-xs .vk-btn-glyph { width: auto; }
|
|
2497
2500
|
.vk-icon-btn-xs { width: var(--control-height-xs); height: var(--control-height-xs); }
|
|
2498
2501
|
.vk-icon-btn-xs .vk-icon { width: 16px; height: 16px; }
|
|
2502
|
+
.vk-select-xs .vk-select-trigger { min-height: var(--control-height-xs); padding: 0 calc(var(--space-sm) + 14px + var(--space-xs)) 0 var(--space-sm); font-size: var(--text-xs); }
|
|
2503
|
+
.vk-select-xs .vk-select-icon { top: calc(var(--control-height-xs) / 2); right: var(--space-sm); width: 14px; height: 14px; }
|
|
2499
2504
|
.vk-segmented-xs .vk-segment { min-height: calc(var(--control-height-xs) - 2px); padding: 0 var(--space-sm); font-size: var(--text-xs); }
|
|
2500
2505
|
}
|
|
2501
2506
|
/* Touch: buttons and rows meet a 44px target in every density (WCAG 2.5.5, Apple HIG); density only tightens fine-pointer layouts. */
|
package/dist/vokality.iife.js
CHANGED
|
@@ -1293,6 +1293,13 @@ Check the top-level render call using <` + parentName + ">.";
|
|
|
1293
1293
|
chart: { size: 16, stroke: 1.5, d: ["M3 3v16a2 2 0 0 0 2 2h16", "M18 17V9", "M13 17V5", "M8 17v-3"] },
|
|
1294
1294
|
clock: { size: 16, stroke: 1.75, d: ["M12 6v6l4 2"], circle: { cx: 12, cy: 12, r: 10 } },
|
|
1295
1295
|
sidebar: { size: 18, stroke: 1.75, d: ["M5 3h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z", "M9 3v18"] },
|
|
1296
|
+
settings: {
|
|
1297
|
+
size: 18,
|
|
1298
|
+
stroke: 1.75,
|
|
1299
|
+
d: ["M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915"],
|
|
1300
|
+
circle: { cx: 12, cy: 12, r: 3 }
|
|
1301
|
+
},
|
|
1302
|
+
refresh: { size: 18, stroke: 1.75, d: ["M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8", "M21 3v5h-5"] },
|
|
1296
1303
|
menu: { size: 22, stroke: 1.75, d: ["M4 6h16M4 12h16M4 18h16"] },
|
|
1297
1304
|
x: { size: 22, stroke: 1.75, d: ["M18 6 6 18M6 6l12 12"] },
|
|
1298
1305
|
phone: {
|
|
@@ -14843,6 +14850,7 @@ Defaulting to \`null\`.`;
|
|
|
14843
14850
|
value,
|
|
14844
14851
|
defaultValue,
|
|
14845
14852
|
onChange,
|
|
14853
|
+
size,
|
|
14846
14854
|
id,
|
|
14847
14855
|
className,
|
|
14848
14856
|
"aria-label": ariaLabel,
|
|
@@ -14860,7 +14868,7 @@ Defaulting to \`null\`.`;
|
|
|
14860
14868
|
onChange?.(option.value, option);
|
|
14861
14869
|
};
|
|
14862
14870
|
return /* @__PURE__ */ jsx_dev_runtime24.jsxDEV("div", {
|
|
14863
|
-
className: cx("vk-select", className),
|
|
14871
|
+
className: cx("vk-select", size === "xs" && "vk-select-xs", className),
|
|
14864
14872
|
children: /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Select, {
|
|
14865
14873
|
...rootProps,
|
|
14866
14874
|
value: value === null ? "" : value,
|
|
@@ -16967,7 +16975,7 @@ Defaulting to \`null\`.`;
|
|
|
16967
16975
|
var jsx_dev_runtime40 = __toESM(require_jsx_dev_runtime(), 1);
|
|
16968
16976
|
"use client";
|
|
16969
16977
|
function triggerClass(iconOnly, variant, size) {
|
|
16970
|
-
return iconOnly ? cx("vk-icon-btn", "vk-icon-btn-"
|
|
16978
|
+
return iconOnly ? cx("vk-icon-btn", variant === "outline" ? "vk-icon-btn-outline" : "vk-icon-btn-ghost", size === "xs" && "vk-icon-btn-xs") : cx("vk-btn", "vk-btn-" + (variant || "outline"), size === "sm" && "vk-btn-sm", size === "xs" && "vk-btn-xs");
|
|
16971
16979
|
}
|
|
16972
16980
|
function Menu2({ items, label, icon, triggerLabel, variant, size, align, disabled, className }) {
|
|
16973
16981
|
const { messages } = useLocale();
|
|
@@ -8,7 +8,7 @@ An outline icon from the Vokality set (Lucide), drawn inline with `currentColor`
|
|
|
8
8
|
## The set
|
|
9
9
|
| Group | Icons | Default size |
|
|
10
10
|
| --- | --- | --- |
|
|
11
|
-
| Actions | `arrow-up-right`, `pencil`, `copy`, `trash`, `plus`, `minus`, `upload`, `ellipsis` | 16–20px (arrow 17px) |
|
|
11
|
+
| Actions | `arrow-up-right`, `pencil`, `copy`, `trash`, `plus`, `minus`, `upload`, `ellipsis`, `refresh`, `settings` | 16–20px (arrow 17px; refresh and settings 18px) |
|
|
12
12
|
| Status | `info`, `circle-check`, `triangle-alert`, `circle-alert`, `check` | 18px (check 16px) |
|
|
13
13
|
| Navigation | `chevron-left`, `chevron-right`, `chevron-down`, `menu`, `x`, `home`, `folder`, `users`, `chart`, `search`, `calendar` | 16px (menu and x 22px) |
|
|
14
14
|
| Data | `arrow-up`, `arrow-down`, `chevrons-up-down`, `file` | 14–16px |
|
|
@@ -41,7 +41,7 @@ WAI-ARIA menu button: the trigger has `aria-haspopup="menu"`, `aria-expanded` an
|
|
|
41
41
|
|
|
42
42
|
## Props
|
|
43
43
|
- `items`: `{ label, onSelect, icon, shortcut, danger, disabled }`, checkable and submenu items as above, `{ type: 'separator' }` or `{ type: 'label', label }`.
|
|
44
|
-
- `label` or `icon` + `triggerLabel`, `variant`, `size` (`sm` or `xs`; an icon-only trigger becomes a 24px icon button at `xs`), `align`, `disabled`.
|
|
44
|
+
- `label` or `icon` + `triggerLabel`, `variant` (`outline`, `ghost`, `primary` or `text`), `size` (`sm` or `xs`; an icon-only trigger becomes a 24px icon button at `xs`), `align`, `disabled`. `text` draws a labelled trigger in sentence case (12px at `xs`, the size of compact `Text size="small"`); an icon-only trigger is a ghost icon button unless `variant="outline"`.
|
|
45
45
|
|
|
46
46
|
## Rules
|
|
47
47
|
- Menus hold actions. To pick a value, use `Select`; to navigate, use links.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
A small non-modal panel attached to a button, for interactive content that doesn't need a full dialog: filters, quick settings, a short form. Built on Radix Popover.
|
|
4
4
|
|
|
5
5
|
## Anatomy
|
|
6
|
-
1. **Trigger**: an outline `Button` with a chevron glyph cell (optional leading `icon`).
|
|
6
|
+
1. **Trigger**: an outline `Button` with a chevron glyph cell (optional leading `icon`). `variant="text"` draws it as `Button variant="text"`: sentence case, no edge, the chevron right after the label.
|
|
7
7
|
2. **Panel**: `surface-elevated`, 1px `border`, square, 0.75rem padding, at least 16rem wide (`width` to set it), with an optional title in Manrope 600. It sits 4px below the trigger, lined up with its start (or end, `align="end"`) edge, flips above when there is no room below and shrinks to the room it has; it rises 0.5rem as it fades in.
|
|
8
8
|
|
|
9
9
|
## Behaviour
|
|
@@ -12,7 +12,7 @@ A small non-modal panel attached to a button, for interactive content that doesn
|
|
|
12
12
|
- The page stays usable behind it; nothing else is blocked.
|
|
13
13
|
|
|
14
14
|
## Props
|
|
15
|
-
- `label`, `title`, `icon`, `variant`, `size` (`sm` or `xs`), `align`, `width`.
|
|
15
|
+
- `label`, `title`, `icon`, `variant` (`outline`, `ghost`, `primary` or `text`), `size` (`sm` or `xs`), `align`, `width`.
|
|
16
16
|
- Native Radix state and mode: `open`, `defaultOpen`, `onOpenChange`, `modal`.
|
|
17
17
|
- `children`: panel content. `close`: one focusable element rendered through Radix Close. The former render-function child is replaced by native Close composition; for more application-specific actions, control `open` through `onOpenChange`.
|
|
18
18
|
|
|
@@ -22,5 +22,6 @@ The trigger has `aria-haspopup="dialog"`, `aria-expanded` and `aria-controls`; t
|
|
|
22
22
|
## Rules
|
|
23
23
|
- Use a `Dialog` when the content needs full attention or a decision before continuing.
|
|
24
24
|
- Use a `Tooltip` for plain text with nothing to interact with.
|
|
25
|
+
- In a status line, use `variant="text" size="xs"`: the trigger reads in sentence case at 12px (`text-xs`, the size of `Text size="small"` under compact density) and sits at `--control-height-xs`.
|
|
25
26
|
|
|
26
27
|
[Radix Popover documentation](https://www.radix-ui.com/primitives/docs/components/popover) defines focus and dismissal behavior.
|
|
@@ -39,10 +39,11 @@ Implements the WAI-ARIA *select-only combobox* pattern with Radix Select: the tr
|
|
|
39
39
|
- `name`, `form`, `required` and `disabled` pass to Radix Root. Its native form select posts the value, participates in validation and handles reset; disabled controls are excluded.
|
|
40
40
|
- `aria-label` when there is no `Field`; `aria-labelledby`, `aria-describedby` and `aria-invalid` wire accessible presentation.
|
|
41
41
|
- `open`, `defaultOpen` and `onOpenChange` pass directly to Radix; `dir` and `autoComplete` are supported through its Root contract.
|
|
42
|
+
- `size="xs"`: the compact trigger for toolbars and status lines, 24px (`--control-height-xs`) with `text-xs` and `space-sm` padding on fine pointers; a coarse pointer keeps the 44px target. Name it with `aria-label` or a visible label beside it. Forms keep the default size.
|
|
42
43
|
- The ref is the trigger `<button>`, so a `Select` can be a `Tooltip` trigger.
|
|
43
44
|
|
|
44
45
|
## Rules
|
|
45
|
-
- Render inside a `Field
|
|
46
|
+
- Render inside a `Field`, except a `size="xs"` select in a toolbar.
|
|
46
47
|
- With five or fewer options that people should compare, use a `RadioGroup`.
|
|
47
48
|
- For long lists that need search, use `Combobox`; to pick several, use `MultiSelect`.
|
|
48
49
|
- Never fall back to a native `<select>`.
|
package/package.json
CHANGED