@tangible/ui 0.2.41 → 0.2.42
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/components/CommandPalette/CommandPalette.d.ts +30 -0
- package/components/CommandPalette/CommandPalette.js +409 -0
- package/components/CommandPalette/CommandPaletteContext.d.ts +31 -0
- package/components/CommandPalette/CommandPaletteContext.js +8 -0
- package/components/CommandPalette/index.d.ts +3 -0
- package/components/CommandPalette/index.js +2 -0
- package/components/CommandPalette/shortcut.d.ts +15 -0
- package/components/CommandPalette/shortcut.js +83 -0
- package/components/CommandPalette/types.d.ts +152 -0
- package/components/CommandPalette/types.js +16 -0
- package/components/IconTile/IconTile.d.ts +16 -0
- package/components/IconTile/IconTile.js +17 -0
- package/components/IconTile/index.d.ts +2 -0
- package/components/IconTile/index.js +1 -0
- package/components/IconTile/types.d.ts +29 -0
- package/components/IconTile/types.js +1 -0
- package/components/SegmentedControl/SegmentedControl.js +2 -2
- package/components/SegmentedControl/types.d.ts +10 -0
- package/components/Table/DataTable.js +1 -1
- package/components/Table/types.d.ts +6 -0
- package/components/Table/types.js +3 -0
- package/components/index.d.ts +4 -0
- package/components/index.js +2 -0
- package/figma-tokens.json +101 -3
- package/icons/icons.svg +1 -1
- package/icons/sprite-version.js +1 -1
- package/icons/sprite.php +1 -1
- package/package.json +13 -1
- package/skills/building-with-tui/SKILL.md +15 -1
- package/styles/all.css +1 -1
- package/styles/all.expanded.css +514 -63
- package/styles/all.expanded.unlayered.css +514 -63
- package/styles/all.unlayered.css +1 -1
- package/styles/components/_bundle.scss +8 -0
- package/styles/components/avatar.scss +6 -23
- package/styles/components/button.scss +15 -15
- package/styles/components/chip.scss +35 -11
- package/styles/components/command-palette.scss +314 -0
- package/styles/components/content-indicator.scss +6 -1
- package/styles/components/date-picker.scss +1 -1
- package/styles/components/icon-button.scss +6 -7
- package/styles/components/icon-tile.scss +89 -0
- package/styles/components/input/index.scss +4 -0
- package/styles/components/multi-select.scss +1 -1
- package/styles/components/progress.scss +23 -0
- package/styles/components/segmented-control.scss +11 -1
- package/styles/components/step-indicator.scss +1 -1
- package/styles/components/tabs.scss +1 -1
- package/styles/core.css +1 -1
- package/styles/core.unlayered.css +1 -1
- package/styles/system/_constants.scss +5 -0
- package/styles/system/_palettes.scss +1 -0
- package/styles/system/_tokens.scss +40 -1
- package/tui-manifest.json +166 -2
- package/utils/color/theme.d.ts +66 -0
- package/utils/color/theme.js +232 -0
- package/vanilla/styles.css +1 -1
- package/vanilla/styles.unlayered.css +1 -1
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import type { ButtonHTMLAttributes, HTMLAttributes, ReactNode, RefObject } from 'react';
|
|
2
|
+
import type { IconSource } from '../Icon';
|
|
3
|
+
import type { SizeStandard } from '../../types';
|
|
4
|
+
import type { ListboxGroupProps, ListboxLabelProps } from '../../utils/listbox';
|
|
5
|
+
import type { OptionValue } from '../../utils/value-key';
|
|
6
|
+
/** Where the palette is in fetching results. */
|
|
7
|
+
export type CommandPaletteStatus = 'ready' | 'loading' | 'error';
|
|
8
|
+
export type CommandPaletteLabels = {
|
|
9
|
+
/** The dialog's name, rendered as a visually hidden heading. */
|
|
10
|
+
title: string;
|
|
11
|
+
/** The search field's accessible name. */
|
|
12
|
+
search: string;
|
|
13
|
+
/** The results list's accessible name. Distinct from `title`, so AT doesn't hear "Search" three times. */
|
|
14
|
+
list: string;
|
|
15
|
+
/** Placeholder text in the search field. */
|
|
16
|
+
placeholder: string;
|
|
17
|
+
/**
|
|
18
|
+
* The narrow-screen close button (wide screens show an Esc hint instead).
|
|
19
|
+
* "Cancel" rather than `hintClose`'s "Close": it's the touch-sheet
|
|
20
|
+
* convention, and the two never show at once.
|
|
21
|
+
*/
|
|
22
|
+
close: string;
|
|
23
|
+
/** Read with the field when results have an `href`, so the new-tab keys are discoverable. */
|
|
24
|
+
newTabHint: string;
|
|
25
|
+
/** Visible and announced when nothing matches. */
|
|
26
|
+
noResults: (query: string) => string;
|
|
27
|
+
/** Announced as the result count changes. */
|
|
28
|
+
results: (count: number) => string;
|
|
29
|
+
/** Visible and announced while `status` is `loading`. */
|
|
30
|
+
loading: string;
|
|
31
|
+
/** Visible and announced while `status` is `error`. */
|
|
32
|
+
error: string;
|
|
33
|
+
/** The retry button, shown with `onRetry` while `status` is `error`. */
|
|
34
|
+
retry: string;
|
|
35
|
+
/** Footer hint for the arrow keys. */
|
|
36
|
+
hintNavigate: string;
|
|
37
|
+
/** Footer hint for Enter. */
|
|
38
|
+
hintOpen: string;
|
|
39
|
+
/** Footer hint for Escape. */
|
|
40
|
+
hintClose: string;
|
|
41
|
+
};
|
|
42
|
+
export declare const defaultCommandPaletteLabels: CommandPaletteLabels;
|
|
43
|
+
/** Extra detail handed to `onSelect`. */
|
|
44
|
+
export type CommandPaletteSelectDetail = {
|
|
45
|
+
/** The item's `href`, when it has one. */
|
|
46
|
+
href?: string;
|
|
47
|
+
};
|
|
48
|
+
/** Custom match for built-in filtering. `keywords` are the item's own, unjoined. */
|
|
49
|
+
export type CommandPaletteFilter = (text: string, query: string, keywords: readonly string[]) => boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Remaining props (`id`, `data-testid`, `aria-describedby`…) land on the
|
|
52
|
+
* dialog element.
|
|
53
|
+
*/
|
|
54
|
+
export type CommandPaletteProps = Omit<HTMLAttributes<HTMLDivElement>, 'role' | 'aria-modal' | 'tabIndex' | 'children' | 'onSelect' | 'aria-labelledby' | 'defaultValue'> & {
|
|
55
|
+
/** Whether the palette is showing (controlled). Pair with `onOpenChange`. */
|
|
56
|
+
open?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Initial state when `open` is uncontrolled: enough for a palette opened
|
|
59
|
+
* only by its `shortcut`. A separate `Trigger` needs controlled `open`.
|
|
60
|
+
* @default false
|
|
61
|
+
*/
|
|
62
|
+
defaultOpen?: boolean;
|
|
63
|
+
/** Called to open or close: Escape, the backdrop, a selection, the shortcut. */
|
|
64
|
+
onOpenChange?: (open: boolean) => void;
|
|
65
|
+
/**
|
|
66
|
+
* The search text (controlled). Controlling it hands filtering to you: every
|
|
67
|
+
* item you render is shown, so filter (or fetch) before rendering. Leave it
|
|
68
|
+
* uncontrolled and the palette filters items by their text and `keywords`.
|
|
69
|
+
*/
|
|
70
|
+
inputValue?: string;
|
|
71
|
+
/** Called with the search text on every change. */
|
|
72
|
+
onInputChange?: (value: string) => void;
|
|
73
|
+
/**
|
|
74
|
+
* Custom match for built-in filtering, or `false` to show every item.
|
|
75
|
+
* Ignored when `inputValue` is controlled.
|
|
76
|
+
* @default case-insensitive substring match on the item's text or any keyword
|
|
77
|
+
*/
|
|
78
|
+
filter?: CommandPaletteFilter | false;
|
|
79
|
+
/**
|
|
80
|
+
* Called when an item is chosen with Enter or a click. When it's omitted, an
|
|
81
|
+
* item with an `href` navigates there (http, https and relative URLs only).
|
|
82
|
+
* Opening an `href` in a new tab (Cmd/Ctrl+Enter, Cmd/Ctrl+click,
|
|
83
|
+
* middle-click) never calls it: items are options, not links, so these are
|
|
84
|
+
* the only new-tab routes.
|
|
85
|
+
*/
|
|
86
|
+
onSelect?: (value: OptionValue, detail: CommandPaletteSelectDetail) => void;
|
|
87
|
+
/**
|
|
88
|
+
* `loading` and `error` show a message under the results, which is also
|
|
89
|
+
* announced. Items you still render stay visible and navigable.
|
|
90
|
+
* @default 'ready'
|
|
91
|
+
*/
|
|
92
|
+
status?: CommandPaletteStatus;
|
|
93
|
+
/** Shows a retry button in the `error` state. */
|
|
94
|
+
onRetry?: () => void;
|
|
95
|
+
/**
|
|
96
|
+
* A global shortcut that toggles the palette, e.g. `"mod+k"` (`mod` is Cmd
|
|
97
|
+
* on Apple platforms, Ctrl elsewhere). Omit for none. A shortcut without
|
|
98
|
+
* `mod` or `alt` (such as `"/"`) is ignored while the user is typing in a
|
|
99
|
+
* field. Avoid `alt+<letter>` on macOS, where Option changes the character.
|
|
100
|
+
* The shortcut stands down while another modal dialog is open.
|
|
101
|
+
*/
|
|
102
|
+
shortcut?: string;
|
|
103
|
+
/**
|
|
104
|
+
* Show the keyboard hints footer. It is hidden on narrow screens regardless.
|
|
105
|
+
* @default true
|
|
106
|
+
*/
|
|
107
|
+
showHints?: boolean;
|
|
108
|
+
/** Where focus returns on close. Defaults to whatever had focus on open. */
|
|
109
|
+
restoreFocusTo?: RefObject<HTMLElement | null> | (() => HTMLElement | null);
|
|
110
|
+
labels?: Partial<CommandPaletteLabels>;
|
|
111
|
+
className?: string;
|
|
112
|
+
/** `CommandPalette.Group`s and `CommandPalette.Item`s. */
|
|
113
|
+
children?: ReactNode;
|
|
114
|
+
};
|
|
115
|
+
export type CommandPaletteItemProps = {
|
|
116
|
+
/** Handed to `onSelect`. Unique within the palette. */
|
|
117
|
+
value: OptionValue;
|
|
118
|
+
/** Searchable text, when `children` isn't a plain string. */
|
|
119
|
+
textValue?: string;
|
|
120
|
+
/** Extra words that match in built-in filtering but aren't shown. */
|
|
121
|
+
keywords?: string[];
|
|
122
|
+
/** A leading icon. */
|
|
123
|
+
icon?: IconSource;
|
|
124
|
+
/** A second, muted line. */
|
|
125
|
+
description?: ReactNode;
|
|
126
|
+
/** A destination. Cmd/Ctrl+Enter opens it in a new tab. */
|
|
127
|
+
href?: string;
|
|
128
|
+
/** Keep the palette open after this item is chosen. */
|
|
129
|
+
keepOpen?: boolean;
|
|
130
|
+
disabled?: boolean;
|
|
131
|
+
className?: string;
|
|
132
|
+
children?: ReactNode;
|
|
133
|
+
};
|
|
134
|
+
export type CommandPaletteGroupProps = ListboxGroupProps;
|
|
135
|
+
export type CommandPaletteLabelProps = ListboxLabelProps;
|
|
136
|
+
export type CommandPaletteTriggerProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'type'> & {
|
|
137
|
+
/**
|
|
138
|
+
* Visible text, which is also the button's accessible name.
|
|
139
|
+
* @default defaultCommandPaletteLabels.placeholder ("Search…")
|
|
140
|
+
*/
|
|
141
|
+
children?: ReactNode;
|
|
142
|
+
/**
|
|
143
|
+
* Shown as a key hint and in `aria-keyshortcuts`, e.g. `"mod+k"`. Display
|
|
144
|
+
* only: it registers nothing, so match the palette's own `shortcut`.
|
|
145
|
+
*/
|
|
146
|
+
shortcut?: string;
|
|
147
|
+
/**
|
|
148
|
+
* Control height tier, as for the form controls. App headers usually want `sm`.
|
|
149
|
+
* @default 'md'
|
|
150
|
+
*/
|
|
151
|
+
size?: SizeStandard;
|
|
152
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const defaultCommandPaletteLabels = {
|
|
2
|
+
title: 'Search',
|
|
3
|
+
search: 'Search',
|
|
4
|
+
list: 'Search results',
|
|
5
|
+
placeholder: 'Search…',
|
|
6
|
+
close: 'Cancel',
|
|
7
|
+
newTabHint: 'Press Control or Command with Enter to open a page in a new tab.',
|
|
8
|
+
noResults: (query) => (query ? `No results for “${query}”` : 'No results'),
|
|
9
|
+
results: (count) => (count === 1 ? '1 result' : `${count} results`),
|
|
10
|
+
loading: 'Searching…',
|
|
11
|
+
error: 'Something went wrong while searching.',
|
|
12
|
+
retry: 'Try again',
|
|
13
|
+
hintNavigate: 'Navigate',
|
|
14
|
+
hintOpen: 'Open',
|
|
15
|
+
hintClose: 'Close',
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An icon in a tinted tile: a stat's category, an empty state, a step in a
|
|
3
|
+
* list. Avatar's sibling. Avatar is a person, drawn from their name; IconTile
|
|
4
|
+
* is a thing, coloured by meaning (a theme). They share one size ladder so
|
|
5
|
+
* they line up in the same list.
|
|
6
|
+
*
|
|
7
|
+
* Decorative by default: the text beside it says what it means. Give it a
|
|
8
|
+
* `label` when it stands alone. Not interactive: wrap it in a Button to act.
|
|
9
|
+
*/
|
|
10
|
+
export declare const IconTile: import("react").ForwardRefExoticComponent<Omit<import("react").HTMLAttributes<HTMLSpanElement>, "role" | "aria-hidden" | "children" | "aria-label" | "tabIndex" | "aria-labelledby"> & {
|
|
11
|
+
icon: import("..").IconSource;
|
|
12
|
+
size?: import("./types").IconTileSize;
|
|
13
|
+
shape?: import("./types").IconTileShape;
|
|
14
|
+
theme?: import("./types").IconTileTheme;
|
|
15
|
+
label?: string;
|
|
16
|
+
} & import("react").RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { cx } from "../../utils/cx.js";
|
|
4
|
+
import { Icon } from "../Icon/index.js";
|
|
5
|
+
/**
|
|
6
|
+
* An icon in a tinted tile: a stat's category, an empty state, a step in a
|
|
7
|
+
* list. Avatar's sibling. Avatar is a person, drawn from their name; IconTile
|
|
8
|
+
* is a thing, coloured by meaning (a theme). They share one size ladder so
|
|
9
|
+
* they line up in the same list.
|
|
10
|
+
*
|
|
11
|
+
* Decorative by default: the text beside it says what it means. Give it a
|
|
12
|
+
* `label` when it stands alone. Not interactive: wrap it in a Button to act.
|
|
13
|
+
*/
|
|
14
|
+
export const IconTile = forwardRef(function IconTile({ icon, size = "md", shape = "square", theme = "primary", label, className, ...rest }, ref) {
|
|
15
|
+
const name = label?.trim();
|
|
16
|
+
return (_jsx("span", { ...rest, ref: ref, className: cx("tui-icon-tile", `is-size-${size}`, `is-shape-${shape}`, `is-theme-${theme}`, className), role: name ? "img" : undefined, "aria-label": name || undefined, "aria-hidden": name ? undefined : true, "aria-labelledby": undefined, tabIndex: undefined, children: _jsx(Icon, { name: icon }) }));
|
|
17
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { IconTile } from "./IconTile.js";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "react";
|
|
2
|
+
import type { SizeExtended, ThemeIntent, ThemeStatus } from "../../types";
|
|
3
|
+
import type { IconSource } from "../Icon";
|
|
4
|
+
/** Avatar's box ladder: xs 24, sm 32, md 40, lg 48, xl 64, xxl 80 */
|
|
5
|
+
export type IconTileSize = SizeExtended;
|
|
6
|
+
export type IconTileShape = "square" | "circle";
|
|
7
|
+
export type IconTileTheme = ThemeIntent | ThemeStatus;
|
|
8
|
+
/**
|
|
9
|
+
* Not interactive, so no tabIndex; and named only through `label`, so no
|
|
10
|
+
* aria-labelledby (it would outrank `label`, and a dangling id blanks the
|
|
11
|
+
* name). To make a tile act, wrap it in a Button.
|
|
12
|
+
*/
|
|
13
|
+
export type IconTileProps = Omit<HTMLAttributes<HTMLSpanElement>, "children" | "role" | "aria-label" | "aria-labelledby" | "aria-hidden" | "tabIndex"> & {
|
|
14
|
+
/** The icon, by registry name (`"system/folder"`) or as an imported icon component */
|
|
15
|
+
icon: IconSource;
|
|
16
|
+
/** Default `md` (40px). The same ladder as Avatar, so the two line up in a list. */
|
|
17
|
+
size?: IconTileSize;
|
|
18
|
+
/** Default `square` (radius-md) */
|
|
19
|
+
shape?: IconTileShape;
|
|
20
|
+
/** Default `primary`. Meaning, not identity: the tint and icon colour follow the theme. */
|
|
21
|
+
theme?: IconTileTheme;
|
|
22
|
+
/**
|
|
23
|
+
* Names the tile as an image. Leave it out when the text beside the tile
|
|
24
|
+
* already says what it means (the usual case): the tile is then decorative
|
|
25
|
+
* and hidden from assistive tech. Don't repeat text that's already beside it,
|
|
26
|
+
* or it's read twice. Blank or whitespace-only counts as no label.
|
|
27
|
+
*/
|
|
28
|
+
label?: string;
|
|
29
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -8,7 +8,7 @@ import { SegmentedControlContext, useSegmentedControlContext } from './Segmented
|
|
|
8
8
|
// =============================================================================
|
|
9
9
|
// SegmentedControl Root
|
|
10
10
|
// =============================================================================
|
|
11
|
-
function SegmentedControlRoot({ value: controlledValue, defaultValue, onValueChange, variant = 'pill', size = 'md', orientation = 'horizontal', loop = true, wrap = false, disabled = false, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, className, children, }) {
|
|
11
|
+
function SegmentedControlRoot({ value: controlledValue, defaultValue, onValueChange, variant = 'pill', size = 'md', orientation = 'horizontal', loop = true, wrap = false, disabled = false, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, 'aria-invalid': ariaInvalid, 'aria-required': ariaRequired, className, children, }) {
|
|
12
12
|
const [internalValue, setInternalValue] = useState(defaultValue);
|
|
13
13
|
// Lock controlled/uncontrolled decision at mount to prevent mode switching
|
|
14
14
|
const isControlled = useRef(controlledValue !== undefined).current;
|
|
@@ -61,7 +61,7 @@ function SegmentedControlRoot({ value: controlledValue, defaultValue, onValueCha
|
|
|
61
61
|
unregisterItem,
|
|
62
62
|
onSelect,
|
|
63
63
|
]);
|
|
64
|
-
return (_jsx(SegmentedControlContext.Provider, { value: contextValue, children: _jsx("div", { role: "radiogroup", className: cx('tui-segmented', `is-variant-${variant}`, `is-size-${size}`, orientation === 'vertical' && 'is-vertical', wrap && 'is-wrap', className), "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-disabled": disabled || undefined, "aria-orientation": orientation, onKeyDown: handleKeyDown, children: children }) }));
|
|
64
|
+
return (_jsx(SegmentedControlContext.Provider, { value: contextValue, children: _jsx("div", { role: "radiogroup", className: cx('tui-segmented', `is-variant-${variant}`, `is-size-${size}`, orientation === 'vertical' && 'is-vertical', wrap && 'is-wrap', className), "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, "aria-disabled": disabled || undefined, "aria-orientation": orientation, onKeyDown: handleKeyDown, children: children }) }));
|
|
65
65
|
}
|
|
66
66
|
// =============================================================================
|
|
67
67
|
// SegmentedControl.Item
|
|
@@ -34,6 +34,16 @@ export type SegmentedControlProps = {
|
|
|
34
34
|
* At least one of `aria-label` or `aria-labelledby` is required.
|
|
35
35
|
*/
|
|
36
36
|
'aria-labelledby'?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Help or error text, by id. Declared (not left to a rest spread) so
|
|
39
|
+
* Field.Control's injection reaches the radiogroup: help and errors are
|
|
40
|
+
* announced, as on RadioGroup.
|
|
41
|
+
*/
|
|
42
|
+
'aria-describedby'?: string;
|
|
43
|
+
/** Marks the group invalid; Field.Control injects it from `error` */
|
|
44
|
+
'aria-invalid'?: boolean | 'true' | 'false';
|
|
45
|
+
/** Marks the group required; Field.Control injects it from `required` */
|
|
46
|
+
'aria-required'?: boolean | 'true' | 'false';
|
|
37
47
|
/** Additional classes */
|
|
38
48
|
className?: string;
|
|
39
49
|
children: ReactNode;
|
|
@@ -237,7 +237,7 @@ enableRowSelection = false, getRowId, getRowLabelForSelection, onSelectionChange
|
|
|
237
237
|
selectedRowIds,
|
|
238
238
|
clearSelection: () => table.resetRowSelection(),
|
|
239
239
|
selectedCount
|
|
240
|
-
})) : (_jsx(BulkActionsBar, { count: selectedCount, onClear: () => table.resetRowSelection(), "aria-controls": tableId }))), _jsxs("table", { ...rest, id: tableId, className: "tui-table", "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-busy": loading || undefined, children: [_jsx("thead", { className: "tui-table__head", children: table.getHeaderGroups().map((headerGroup) => (_jsx("tr", { className: "tui-table__row tui-table__row--head", children: headerGroup.headers.map((header) => {
|
|
240
|
+
})) : (_jsx(BulkActionsBar, { count: selectedCount, onClear: () => table.resetRowSelection(), "aria-controls": tableId, labels: { selected: labels.bulkSelected, actions: labels.bulkActions }, clearLabel: labels.bulkClear }))), _jsxs("table", { ...rest, id: tableId, className: "tui-table", "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-busy": loading || undefined, children: [_jsx("thead", { className: "tui-table__head", children: table.getHeaderGroups().map((headerGroup) => (_jsx("tr", { className: "tui-table__row tui-table__row--head", children: headerGroup.headers.map((header) => {
|
|
241
241
|
const canSort = header.column.getCanSort();
|
|
242
242
|
const sortDirection = header.column.getIsSorted();
|
|
243
243
|
const headerDef = header.column.columnDef.header;
|
|
@@ -16,5 +16,11 @@ export type DataTableLabels = {
|
|
|
16
16
|
sortBy?: (column: string) => string;
|
|
17
17
|
/** Live-region announcement after sorting. Default: `` `Sorted by ${column}, ${direction}` `` */
|
|
18
18
|
sorted?: (column: string, direction: 'ascending' | 'descending') => string;
|
|
19
|
+
/** Built-in bulk bar's visible count. Default: BulkActionsBar's `selected`, `` `${count} selected` `` */
|
|
20
|
+
bulkSelected?: (count: number) => string;
|
|
21
|
+
/** Built-in bulk bar's group `aria-label`. Default: BulkActionsBar's `actions` */
|
|
22
|
+
bulkActions?: (count: number) => string;
|
|
23
|
+
/** Built-in bulk bar's clear-selection button. Default: `"Clear"` */
|
|
24
|
+
bulkClear?: string;
|
|
19
25
|
};
|
|
20
26
|
export declare const defaultDataTableLabels: Required<DataTableLabels>;
|
|
@@ -8,4 +8,7 @@ export const defaultDataTableLabels = {
|
|
|
8
8
|
pageStatus: (current, total) => `Page ${current} of ${total}`,
|
|
9
9
|
sortBy: (column) => `Sort by ${column}`,
|
|
10
10
|
sorted: (column, direction) => `Sorted by ${column}, ${direction}`,
|
|
11
|
+
bulkSelected: defaultBulkActionsBarLabels.selected,
|
|
12
|
+
bulkActions: defaultBulkActionsBarLabels.actions,
|
|
13
|
+
bulkClear: 'Clear',
|
|
11
14
|
};
|
package/components/index.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export { MultiSelect, MultiSelectTrigger, MultiSelectContent, MultiSelectOption,
|
|
|
21
21
|
export { Select, SelectTrigger, SelectContent, SelectOption, SelectGroup, SelectLabel, useSelect } from './Select';
|
|
22
22
|
export { Icon } from './Icon';
|
|
23
23
|
export { IconButton, defaultIconButtonLabels } from './IconButton';
|
|
24
|
+
export { IconTile } from './IconTile';
|
|
24
25
|
export { Modal } from './Modal';
|
|
25
26
|
export { MoveHandle } from './MoveHandle';
|
|
26
27
|
export { Notice } from './Notice';
|
|
@@ -37,6 +38,7 @@ export { NavMenu, defaultNavMenuLabels } from './NavMenu';
|
|
|
37
38
|
export { StepIndicator, defaultStepIndicatorLabels } from './StepIndicator';
|
|
38
39
|
export { StepList, defaultStepListLabels } from './StepList';
|
|
39
40
|
export { DataTable, BulkActionsBar, defaultDataTableLabels, defaultBulkActionsBarLabels } from './Table';
|
|
41
|
+
export { CommandPalette, CommandPaletteItem, CommandPaletteGroup, CommandPaletteLabel, CommandPaletteTrigger, defaultCommandPaletteLabels, } from './CommandPalette';
|
|
40
42
|
export { SearchInput } from './SearchInput';
|
|
41
43
|
export { SecretInput, defaultSecretInputLabels } from './SecretInput';
|
|
42
44
|
export { SearchSelect, SearchSelectTrigger, SearchSelectContent, SearchSelectOption, SearchSelectGroup, SearchSelectLabel, useSearchSelect, } from './SearchSelect';
|
|
@@ -69,6 +71,7 @@ export type { MultiSelectProps, MultiSelectTriggerProps, MultiSelectContentProps
|
|
|
69
71
|
export type { SelectProps, SelectTriggerProps, SelectContentProps, SelectOptionProps, SelectGroupProps, SelectLabelProps, OptionValue as SelectOptionValue, } from './Select';
|
|
70
72
|
export type { IconProps, IconSource, IconComponent } from './Icon';
|
|
71
73
|
export type { IconButtonProps, IconButtonLabels, Shape as IconButtonShape, Theme as IconButtonTheme, Variant as IconButtonVariant, } from './IconButton';
|
|
74
|
+
export type { IconTileProps, IconTileSize, IconTileShape, IconTileTheme } from './IconTile';
|
|
72
75
|
export type { ModalProps, ModalRole, ModalFootProps, ModalFootJustify } from './Modal';
|
|
73
76
|
export type { MoveHandleLabels, MoveHandleMode, MoveHandleProps, MoveHandleSize } from './MoveHandle';
|
|
74
77
|
export type { NoticeProps, NoticeHandle, NoticeExitAnimation } from './Notice';
|
|
@@ -85,6 +88,7 @@ export type { StepIndicatorProps, StepStatus, StepIndicatorLabels } from './Step
|
|
|
85
88
|
export type { StepListProps, StepListItemProps, StepListLabels } from './StepList';
|
|
86
89
|
export type { DataTableProps, DataTableLabels, BulkActionsBarLabels } from './Table';
|
|
87
90
|
export type { TabsProps, TabsListProps, TabProps, TabPanelProps, TabsVariant, TabsActivationMode, TabsOrientation, } from './Tabs';
|
|
91
|
+
export type { CommandPaletteProps, CommandPaletteItemProps, CommandPaletteGroupProps, CommandPaletteLabelProps, CommandPaletteTriggerProps, CommandPaletteLabels, CommandPaletteStatus, CommandPaletteSelectDetail, CommandPaletteFilter, } from './CommandPalette';
|
|
88
92
|
export type { SearchInputProps } from './SearchInput';
|
|
89
93
|
export type { SliderProps } from './Slider';
|
|
90
94
|
export type { SecretInputProps, SecretInputLabels } from './SecretInput';
|
package/components/index.js
CHANGED
|
@@ -19,6 +19,7 @@ export { MultiSelect, MultiSelectTrigger, MultiSelectContent, MultiSelectOption,
|
|
|
19
19
|
export { Select, SelectTrigger, SelectContent, SelectOption, SelectGroup, SelectLabel, useSelect } from './Select/index.js';
|
|
20
20
|
export { Icon } from './Icon/index.js';
|
|
21
21
|
export { IconButton, defaultIconButtonLabels } from './IconButton/index.js';
|
|
22
|
+
export { IconTile } from './IconTile/index.js';
|
|
22
23
|
export { Modal } from './Modal/index.js';
|
|
23
24
|
export { MoveHandle } from './MoveHandle/index.js';
|
|
24
25
|
export { Notice } from './Notice/index.js';
|
|
@@ -35,6 +36,7 @@ export { NavMenu, defaultNavMenuLabels } from './NavMenu/index.js';
|
|
|
35
36
|
export { StepIndicator, defaultStepIndicatorLabels } from './StepIndicator/index.js';
|
|
36
37
|
export { StepList, defaultStepListLabels } from './StepList/index.js';
|
|
37
38
|
export { DataTable, BulkActionsBar, defaultDataTableLabels, defaultBulkActionsBarLabels } from './Table/index.js';
|
|
39
|
+
export { CommandPalette, CommandPaletteItem, CommandPaletteGroup, CommandPaletteLabel, CommandPaletteTrigger, defaultCommandPaletteLabels, } from './CommandPalette/index.js';
|
|
38
40
|
export { SearchInput } from './SearchInput/index.js';
|
|
39
41
|
export { SecretInput, defaultSecretInputLabels } from './SecretInput/index.js';
|
|
40
42
|
export { SearchSelect, SearchSelectTrigger, SearchSelectContent, SearchSelectOption, SearchSelectGroup, SearchSelectLabel, useSearchSelect, } from './SearchSelect/index.js';
|
package/figma-tokens.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.2.
|
|
2
|
+
"version": "0.2.42",
|
|
3
3
|
"source": "publish/styles/all.expanded.css",
|
|
4
4
|
"prefix": "tui-",
|
|
5
5
|
"note": "Layer 1 primitives only. Component API tokens (--tui-{component}-*) are never defined in CSS — they exist only as fallback reads — so they have no Figma representation. CONTRACT: consumers read TUI defaults from this file at build time (variables[].cssVar, the \"Light\"/\"Dark\" mode names, and alias chains into TUI/Primitives). Renaming a cssVar or a mode is a breaking change to those consumers even when the CSS value is unchanged — a rename silently becomes an undefined default downstream — so treat it as at least a minor bump and call it out in the CHANGELOG.",
|
|
@@ -326,6 +326,18 @@
|
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
328
|
},
|
|
329
|
+
{
|
|
330
|
+
"name": "palette/gray/550",
|
|
331
|
+
"type": "COLOR",
|
|
332
|
+
"values": {
|
|
333
|
+
"Default": {
|
|
334
|
+
"r": 0.3764705882352941,
|
|
335
|
+
"g": 0.40784313725490196,
|
|
336
|
+
"b": 0.4627450980392157,
|
|
337
|
+
"a": 1
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
},
|
|
329
341
|
{
|
|
330
342
|
"name": "palette/gray/600",
|
|
331
343
|
"type": "COLOR",
|
|
@@ -1462,9 +1474,9 @@
|
|
|
1462
1474
|
"type": "COLOR",
|
|
1463
1475
|
"values": {
|
|
1464
1476
|
"Light": {
|
|
1465
|
-
"alias": "palette/gray/
|
|
1477
|
+
"alias": "palette/gray/550",
|
|
1466
1478
|
"collection": "TUI/Primitives",
|
|
1467
|
-
"hex": "#
|
|
1479
|
+
"hex": "#606876"
|
|
1468
1480
|
},
|
|
1469
1481
|
"Dark": {
|
|
1470
1482
|
"alias": "palette/gray/400",
|
|
@@ -2894,6 +2906,21 @@
|
|
|
2894
2906
|
}
|
|
2895
2907
|
}
|
|
2896
2908
|
},
|
|
2909
|
+
{
|
|
2910
|
+
"name": "theme/danger/on-base",
|
|
2911
|
+
"cssVar": "--tui-theme-danger-on-base",
|
|
2912
|
+
"type": "COLOR",
|
|
2913
|
+
"values": {
|
|
2914
|
+
"Light": {
|
|
2915
|
+
"alias": "color/fg/on-accent"
|
|
2916
|
+
},
|
|
2917
|
+
"Dark": {
|
|
2918
|
+
"alias": "palette/gray/950",
|
|
2919
|
+
"collection": "TUI/Primitives",
|
|
2920
|
+
"hex": "#0c121f"
|
|
2921
|
+
}
|
|
2922
|
+
}
|
|
2923
|
+
},
|
|
2897
2924
|
{
|
|
2898
2925
|
"name": "theme/danger/soft",
|
|
2899
2926
|
"cssVar": "--tui-theme-danger-soft",
|
|
@@ -3013,6 +3040,19 @@
|
|
|
3013
3040
|
}
|
|
3014
3041
|
}
|
|
3015
3042
|
},
|
|
3043
|
+
{
|
|
3044
|
+
"name": "theme/info/on-base",
|
|
3045
|
+
"cssVar": "--tui-theme-info-on-base",
|
|
3046
|
+
"type": "COLOR",
|
|
3047
|
+
"values": {
|
|
3048
|
+
"Light": {
|
|
3049
|
+
"alias": "color/fg/on-accent"
|
|
3050
|
+
},
|
|
3051
|
+
"Dark": {
|
|
3052
|
+
"alias": "color/fg/on-accent"
|
|
3053
|
+
}
|
|
3054
|
+
}
|
|
3055
|
+
},
|
|
3016
3056
|
{
|
|
3017
3057
|
"name": "theme/info/soft",
|
|
3018
3058
|
"cssVar": "--tui-theme-info-soft",
|
|
@@ -3132,6 +3172,19 @@
|
|
|
3132
3172
|
}
|
|
3133
3173
|
}
|
|
3134
3174
|
},
|
|
3175
|
+
{
|
|
3176
|
+
"name": "theme/primary/on-base",
|
|
3177
|
+
"cssVar": "--tui-theme-primary-on-base",
|
|
3178
|
+
"type": "COLOR",
|
|
3179
|
+
"values": {
|
|
3180
|
+
"Light": {
|
|
3181
|
+
"alias": "color/fg/on-accent"
|
|
3182
|
+
},
|
|
3183
|
+
"Dark": {
|
|
3184
|
+
"alias": "color/fg/on-accent"
|
|
3185
|
+
}
|
|
3186
|
+
}
|
|
3187
|
+
},
|
|
3135
3188
|
{
|
|
3136
3189
|
"name": "theme/primary/soft",
|
|
3137
3190
|
"cssVar": "--tui-theme-primary-soft",
|
|
@@ -3251,6 +3304,21 @@
|
|
|
3251
3304
|
}
|
|
3252
3305
|
}
|
|
3253
3306
|
},
|
|
3307
|
+
{
|
|
3308
|
+
"name": "theme/secondary/on-base",
|
|
3309
|
+
"cssVar": "--tui-theme-secondary-on-base",
|
|
3310
|
+
"type": "COLOR",
|
|
3311
|
+
"values": {
|
|
3312
|
+
"Light": {
|
|
3313
|
+
"alias": "color/fg/on-accent"
|
|
3314
|
+
},
|
|
3315
|
+
"Dark": {
|
|
3316
|
+
"alias": "palette/gray/950",
|
|
3317
|
+
"collection": "TUI/Primitives",
|
|
3318
|
+
"hex": "#0c121f"
|
|
3319
|
+
}
|
|
3320
|
+
}
|
|
3321
|
+
},
|
|
3254
3322
|
{
|
|
3255
3323
|
"name": "theme/secondary/soft",
|
|
3256
3324
|
"cssVar": "--tui-theme-secondary-soft",
|
|
@@ -3370,6 +3438,21 @@
|
|
|
3370
3438
|
}
|
|
3371
3439
|
}
|
|
3372
3440
|
},
|
|
3441
|
+
{
|
|
3442
|
+
"name": "theme/success/on-base",
|
|
3443
|
+
"cssVar": "--tui-theme-success-on-base",
|
|
3444
|
+
"type": "COLOR",
|
|
3445
|
+
"values": {
|
|
3446
|
+
"Light": {
|
|
3447
|
+
"alias": "color/fg/on-accent"
|
|
3448
|
+
},
|
|
3449
|
+
"Dark": {
|
|
3450
|
+
"alias": "palette/gray/950",
|
|
3451
|
+
"collection": "TUI/Primitives",
|
|
3452
|
+
"hex": "#0c121f"
|
|
3453
|
+
}
|
|
3454
|
+
}
|
|
3455
|
+
},
|
|
3373
3456
|
{
|
|
3374
3457
|
"name": "theme/success/soft",
|
|
3375
3458
|
"cssVar": "--tui-theme-success-soft",
|
|
@@ -3489,6 +3572,21 @@
|
|
|
3489
3572
|
}
|
|
3490
3573
|
}
|
|
3491
3574
|
},
|
|
3575
|
+
{
|
|
3576
|
+
"name": "theme/warning/on-base",
|
|
3577
|
+
"cssVar": "--tui-theme-warning-on-base",
|
|
3578
|
+
"type": "COLOR",
|
|
3579
|
+
"values": {
|
|
3580
|
+
"Light": {
|
|
3581
|
+
"alias": "color/fg/on-accent"
|
|
3582
|
+
},
|
|
3583
|
+
"Dark": {
|
|
3584
|
+
"alias": "palette/gray/950",
|
|
3585
|
+
"collection": "TUI/Primitives",
|
|
3586
|
+
"hex": "#0c121f"
|
|
3587
|
+
}
|
|
3588
|
+
}
|
|
3589
|
+
},
|
|
3492
3590
|
{
|
|
3493
3591
|
"name": "theme/warning/soft",
|
|
3494
3592
|
"cssVar": "--tui-theme-warning-soft",
|
package/icons/icons.svg
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" data-tui-icon-sprite="all" data-tui-icon-sprite-version="0.2.
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" data-tui-icon-sprite="all" data-tui-icon-sprite-version="0.2.42" aria-hidden="true" focusable="false" style="position:absolute;width:0;height:0;overflow:hidden">
|
|
2
2
|
<symbol id="tui-cred-badge-check" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M10.893 4.558a1.377 1.377 0 0 1 2.214 0c.381.515 1.068.7 1.656.444a1.377 1.377 0 0 1 1.917 1.106c.072.637.575 1.14 1.212 1.213a1.377 1.377 0 0 1 1.106 1.916 1.38 1.38 0 0 0 .444 1.656c.744.55.744 1.663 0 2.214a1.38 1.38 0 0 0-.444 1.656 1.377 1.377 0 0 1-1.106 1.917 1.38 1.38 0 0 0-1.212 1.212 1.377 1.377 0 0 1-1.917 1.106 1.38 1.38 0 0 0-1.656.444 1.377 1.377 0 0 1-2.214 0 1.38 1.38 0 0 0-1.656-.444 1.377 1.377 0 0 1-1.916-1.106 1.38 1.38 0 0 0-1.213-1.212 1.377 1.377 0 0 1-1.106-1.917 1.38 1.38 0 0 0-.444-1.656 1.377 1.377 0 0 1 0-2.214c.515-.381.7-1.068.444-1.656a1.377 1.377 0 0 1 1.106-1.916 1.38 1.38 0 0 0 1.213-1.213 1.377 1.377 0 0 1 1.916-1.106 1.38 1.38 0 0 0 1.656-.444m5.193 5.91a.75.75 0 0 0-1.172-.936l-3.531 4.414-1.914-1.532a.75.75 0 1 0-.937 1.172l3.085 2.468z" clip-rule="evenodd"/></symbol>
|
|
3
3
|
<symbol id="tui-cred-badge-ribbon" viewBox="0 0 24 24"><path d="M11.032 3.488a1.205 1.205 0 0 1 1.936 0c.334.451.935.612 1.45.388a1.205 1.205 0 0 1 1.677.969c.063.557.503.997 1.06 1.06.805.092 1.291.935.969 1.678a1.204 1.204 0 0 0 .388 1.449c.65.481.65 1.455 0 1.936a1.205 1.205 0 0 0-.388 1.45 1.205 1.205 0 0 1-.969 1.677 1.204 1.204 0 0 0-1.06 1.06 1.205 1.205 0 0 1-1.678.969 1.205 1.205 0 0 0-1.449.388c-.481.65-1.455.65-1.936 0a1.204 1.204 0 0 0-1.45-.388 1.205 1.205 0 0 1-1.677-.969 1.205 1.205 0 0 0-1.06-1.06 1.205 1.205 0 0 1-.969-1.678 1.205 1.205 0 0 0-.388-1.449 1.205 1.205 0 0 1 0-1.936c.451-.334.612-.935.388-1.45a1.205 1.205 0 0 1 .969-1.677 1.205 1.205 0 0 0 1.06-1.06 1.205 1.205 0 0 1 1.678-.969 1.205 1.205 0 0 0 1.449-.388M8 17.482c.442.175.953.185 1.437-.025a.88.88 0 0 1 1.054.282 1.877 1.877 0 0 0 3.018 0 .88.88 0 0 1 1.054-.282c.484.21.995.2 1.437.025V21l-4-2.286L8 21z"/></symbol>
|
|
4
4
|
<symbol id="tui-cred-badge" viewBox="0 0 24 24"><path d="M13.107 4.558a1.377 1.377 0 0 0-2.214 0c-.381.515-1.068.7-1.656.444a1.377 1.377 0 0 0-1.916 1.106 1.38 1.38 0 0 1-1.213 1.213 1.377 1.377 0 0 0-1.106 1.916 1.38 1.38 0 0 1-.444 1.656 1.377 1.377 0 0 0 0 2.214c.515.381.7 1.068.444 1.656a1.377 1.377 0 0 0 1.106 1.917c.637.072 1.14.575 1.213 1.212a1.377 1.377 0 0 0 1.916 1.106 1.38 1.38 0 0 1 1.656.444c.55.744 1.663.744 2.214 0a1.38 1.38 0 0 1 1.656-.444 1.377 1.377 0 0 0 1.917-1.106 1.38 1.38 0 0 1 1.212-1.212 1.377 1.377 0 0 0 1.106-1.917 1.38 1.38 0 0 1 .444-1.656 1.377 1.377 0 0 0 0-2.214 1.38 1.38 0 0 1-.444-1.656 1.377 1.377 0 0 0-1.106-1.916 1.38 1.38 0 0 1-1.212-1.213 1.377 1.377 0 0 0-1.917-1.106 1.38 1.38 0 0 1-1.656-.444"/></symbol>
|
package/icons/sprite-version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SPRITE_VERSION = '0.2.
|
|
1
|
+
export const SPRITE_VERSION = '0.2.42';
|
package/icons/sprite.php
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
23
|
// Replaced with the package version at build time.
|
|
24
|
-
$GLOBALS['tangible_ui_icon_sprite_copies'][__DIR__] = '0.2.
|
|
24
|
+
$GLOBALS['tangible_ui_icon_sprite_copies'][__DIR__] = '0.2.42';
|
|
25
25
|
|
|
26
26
|
if (!function_exists('tangible_ui_print_icon_sprite')) {
|
|
27
27
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangible/ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.42",
|
|
4
4
|
"description": "React design system for Tangible's products: standalone React apps and WordPress plugins. Components, CSS custom property tokens, cascade layers.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./components/index.js",
|
|
@@ -50,6 +50,10 @@
|
|
|
50
50
|
"import": "./utils/color/gradient.js",
|
|
51
51
|
"types": "./utils/color/gradient.d.ts"
|
|
52
52
|
},
|
|
53
|
+
"./utils/color/theme": {
|
|
54
|
+
"import": "./utils/color/theme.js",
|
|
55
|
+
"types": "./utils/color/theme.d.ts"
|
|
56
|
+
},
|
|
53
57
|
"./utils/color-scheme": {
|
|
54
58
|
"import": "./utils/color-scheme.js",
|
|
55
59
|
"types": "./utils/color-scheme.d.ts"
|
|
@@ -116,6 +120,10 @@
|
|
|
116
120
|
"import": "./components/Combobox/index.js",
|
|
117
121
|
"types": "./components/Combobox/index.d.ts"
|
|
118
122
|
},
|
|
123
|
+
"./components/CommandPalette": {
|
|
124
|
+
"import": "./components/CommandPalette/index.js",
|
|
125
|
+
"types": "./components/CommandPalette/index.d.ts"
|
|
126
|
+
},
|
|
119
127
|
"./components/ContentIndicator": {
|
|
120
128
|
"import": "./components/ContentIndicator/index.js",
|
|
121
129
|
"types": "./components/ContentIndicator/index.d.ts"
|
|
@@ -144,6 +152,10 @@
|
|
|
144
152
|
"import": "./components/IconButton/index.js",
|
|
145
153
|
"types": "./components/IconButton/index.d.ts"
|
|
146
154
|
},
|
|
155
|
+
"./components/IconTile": {
|
|
156
|
+
"import": "./components/IconTile/index.js",
|
|
157
|
+
"types": "./components/IconTile/index.d.ts"
|
|
158
|
+
},
|
|
147
159
|
"./components/Modal": {
|
|
148
160
|
"import": "./components/Modal/index.js",
|
|
149
161
|
"types": "./components/Modal/index.d.ts"
|
|
@@ -398,7 +398,7 @@ Oct 24 2026.
|
|
|
398
398
|
| ColorField | `trigger`, `dynamic`, `modes`, `solidTab`, `gradientTab` (its popover takes ColorPicker's) |
|
|
399
399
|
| ColorPicker | `group`, `area`, `hue`, `alpha`, `format`, `value`, `copy`, `copied`, `variable`, `formats`, `channels`, channel names, value texts |
|
|
400
400
|
| Combobox | `clear` |
|
|
401
|
-
| DataTable / BulkActionsBar | `selectAll`, `selectRow`, `pageStatus`, `sortBy`, `sorted` / `selected`, `actions` |
|
|
401
|
+
| DataTable / BulkActionsBar | `selectAll`, `selectRow`, `pageStatus`, `sortBy`, `sorted`, `bulkSelected`, `bulkActions`, `bulkClear` (the built-in bulk bar, 0.2.42+) / `selected`, `actions` |
|
|
402
402
|
| DatePicker | `title`, `titleWithTime`, `now`, `close`, `placeholder`, `timeSection`, `dateSection`, `month`, `dayOfMonth`, `year`, `hour`, `minute`, `am`, `pm`, `meridiem`, `trigger`, `triggerEmpty` |
|
|
403
403
|
| DateRangePicker | `from`, `to`, `apply`, `cancel`, `placeholder`, `presets`, `trigger`, `triggerEmpty`, `openEnd` |
|
|
404
404
|
| Field | `required` (the visually hidden "required" after the label) |
|
|
@@ -469,12 +469,26 @@ Colour maths ships as public utils: `@tangible/ui/utils/color` (`parseColor`, `f
|
|
|
469
469
|
`>= 4.5` check fails closed). Use them for user-selected colours and theme tooling (deriving or
|
|
470
470
|
validating a ladder), not to pick a component's own theming at runtime.
|
|
471
471
|
|
|
472
|
+
To theme from a brand colour, `@tangible/ui/utils/color/theme` derives every colour token, in
|
|
473
|
+
both modes, from a primary or from `{ primary, secondary, neutral }` (secondary chrome gets its own
|
|
474
|
+
ladder; neutral sets the temperature of the greys, and `vibrance` from 0 to 1 lets it colour the page outright): `deriveThemeCss(source)` returns a stylesheet (light on `.tui-interface`, dark
|
|
475
|
+
and `auto` one specificity step above TUI's own dark block, nested interfaces included), and
|
|
476
|
+
`deriveThemeTokens(source, 'light' | 'dark')` returns the `--tui-*` map as hex. Each step is solved
|
|
477
|
+
for its WCAG contrast, so text, primary fills and control borders clear AA on every surface
|
|
478
|
+
(`bg`, `-surface`, `-muted`, `-elevated`) for any hue. Only each colour's hue and chroma are used.
|
|
479
|
+
In dark mode the accent fills are light, so they pair with dark text through
|
|
480
|
+
`--tui-theme-{primary,secondary}-on-base`.
|
|
481
|
+
|
|
472
482
|
Useful primitives:
|
|
473
483
|
|
|
474
484
|
- Surfaces / text: `--tui-color-bg`, `-bg-surface`, `-bg-elevated`, `-bg-muted`, `-bg-inverted`,
|
|
475
485
|
`--tui-color-fg`, `-fg-secondary`, `-fg-muted`, `-fg-on-accent`, `--tui-color-border`,
|
|
476
486
|
`--tui-color-border-control` (form-control boundaries, 3:1; `--tui-color-border` is decorative), `--tui-color-divider`, `--tui-color-fill{,-subtle,-strong}`, `--tui-color-focus-ring`.
|
|
477
487
|
- Themes: `--tui-theme-{primary,secondary,success,warning,danger,info}-{subtlest,subtle,soft,base,strong,stronger,strongest}`.
|
|
488
|
+
Text on a theme's `base` fill: `--tui-theme-{name}-on-base` (white in light; dark text on
|
|
489
|
+
secondary/success/warning/danger in dark, where white fails AA). Prefer it to `-fg-on-accent`.
|
|
490
|
+
If you re-point a theme's `-base` fill, re-point its `-on-base` with it: the dark values are
|
|
491
|
+
fixed, so overriding `--tui-color-fg-on-accent` only moves primary and info.
|
|
478
492
|
The ladder is **contrast-based** — "stronger" always means more contrast against the current
|
|
479
493
|
background, so a single choice reads correctly in both light and dark mode.
|
|
480
494
|
- Control heights, shared by every form control *and* Button / IconButton / SegmentedControl /
|