@tangible/ui 0.2.46 → 0.2.48

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.
@@ -388,15 +388,27 @@ const { Group: CommandPaletteGroupComponent, Label: CommandPaletteLabelComponent
388
388
  //
389
389
  // A search-field-shaped button for a header. Standalone, not context-bound:
390
390
  // the trigger and the palette usually live in different parts of the tree, so
391
- // the consumer wires `onClick` to the same state as `open`.
391
+ // the consumer wires `onClick` to the same state as `open`, and passes the
392
+ // same `shortcut` string (a shared constant) to both.
393
+ //
394
+ // It focuses itself on click, before the consumer's handler opens the
395
+ // palette. Safari doesn't focus a clicked button, so the palette would
396
+ // otherwise record <body> as "what had focus" and return focus there on close.
392
397
  //
393
398
  // =============================================================================
394
- const CommandPaletteTriggerComponent = React.forwardRef(function CommandPaletteTrigger({ shortcut, size = 'md', className, children = defaultCommandPaletteLabels.placeholder, ...rest }, ref) {
399
+ const CommandPaletteTriggerComponent = React.forwardRef(function CommandPaletteTrigger({ shortcut, size = 'md', className, children = defaultCommandPaletteLabels.placeholder, onClick, ...rest }, ref) {
395
400
  // Platform is read after mount so server and first client render agree.
396
401
  const [apple, setApple] = useState(false);
397
402
  useEffect(() => setApple(isApplePlatform()), []);
398
403
  const parsed = shortcut ? parseShortcut(shortcut) : null;
399
- return (_jsxs("button", { ref: ref, type: "button", "aria-haspopup": "dialog", "aria-keyshortcuts": parsed ? ariaShortcut(parsed, apple) : undefined, ...rest, className: cx('tui-input-group', 'tui-command-palette-trigger', size !== 'md' && `is-size-${size}`, className), children: [_jsx(Icon, { name: SearchIcon, className: "tui-command-palette-trigger__icon" }), _jsx("span", { className: "tui-command-palette-trigger__text", children: children }), parsed && (
404
+ return (_jsxs("button", { ref: ref, type: "button", "aria-haspopup": "dialog", "aria-keyshortcuts": parsed ? ariaShortcut(parsed, apple) : undefined, ...rest, onClick: (event) => {
405
+ // Focus first, so the palette records the trigger as what to return to
406
+ if (event.currentTarget.ownerDocument.activeElement !== event.currentTarget) {
407
+ // It was just clicked, so it's in view: don't let focus scroll it
408
+ event.currentTarget.focus({ preventScroll: true });
409
+ }
410
+ onClick?.(event);
411
+ }, className: cx('tui-input-group', 'tui-command-palette-trigger', size !== 'md' && `is-size-${size}`, className), children: [_jsx(Icon, { name: SearchIcon, className: "tui-command-palette-trigger__icon" }), _jsx("span", { className: "tui-command-palette-trigger__text", children: children }), parsed && (
400
412
  // aria-keyshortcuts carries it for AT
401
413
  _jsx("kbd", { className: "tui-command-palette__kbd", "aria-hidden": "true", children: formatShortcut(parsed, apple) }))] }));
402
414
  });
@@ -141,7 +141,9 @@ export type CommandPaletteTriggerProps = Omit<ButtonHTMLAttributes<HTMLButtonEle
141
141
  children?: ReactNode;
142
142
  /**
143
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`.
144
+ * only: it registers nothing. The trigger usually sits outside the
145
+ * palette's tree, so it can't read the palette's `shortcut`: define the
146
+ * string once as a constant and pass it to both, so they can't drift.
145
147
  */
146
148
  shortcut?: string;
147
149
  /**
@@ -0,0 +1,7 @@
1
+ import type { PasswordStrengthScore } from './types';
2
+ export declare const PasswordStrength: import("react").ForwardRefExoticComponent<Omit<import("react").HTMLAttributes<HTMLDivElement>, "children"> & {
3
+ score?: PasswordStrengthScore;
4
+ feedback?: string;
5
+ labels?: import("./types").PasswordStrengthLabels;
6
+ announce?: boolean;
7
+ } & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,73 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { forwardRef, useEffect, useRef, useState } from 'react';
3
+ import { cx } from '../../utils/cx.js';
4
+ import { defaultPasswordStrengthLabels } from './types.js';
5
+ // =============================================================================
6
+ // PasswordStrength Component
7
+ // =============================================================================
8
+ //
9
+ // A meter for a new password: four bars and the score in words, with an
10
+ // optional hint. Display only: the app supplies the score (zxcvbn-ts or a
11
+ // server check), and it advises, it doesn't gate. The password rule stays
12
+ // the field's validation.
13
+ //
14
+ // - The bars are decoration (aria-hidden); the words carry the meaning, so
15
+ // it never relies on colour.
16
+ // - Link it to the field: give it an `id` and pass that as the input's
17
+ // `aria-describedby` (Field.Control merges it with help and errors), so
18
+ // the score is read whenever the field is focused.
19
+ // - A polite live region says the score a second after it settles on a new
20
+ // value, never on every keystroke. Only the score: the hint is read with
21
+ // the field. The region sits beside the element `id` names, never inside
22
+ // it, or the field's description would read the score twice.
23
+ // - Render it from the first paint, score or not: a live region inserted
24
+ // together with its text may not be announced.
25
+ //
26
+ // =============================================================================
27
+ /** How long a new score must hold before it's announced */
28
+ const ANNOUNCE_AFTER_MS = 1000;
29
+ /** Bars lit per score: something typed always lights one */
30
+ const BARS = 4;
31
+ const lit = (score) => Math.max(1, score);
32
+ /** Anything but a whole number from 0 to 4 (null, NaN, 7) is no score */
33
+ const validScore = (score) => typeof score === 'number' && Number.isInteger(score) && score >= 0 && score <= 4
34
+ ? score
35
+ : undefined;
36
+ /** How long an announcement stays before it's cleared, as Toast's announcers do */
37
+ const CLEAR_AFTER_MS = 3000;
38
+ export const PasswordStrength = forwardRef(function PasswordStrength({ score: scoreProp, feedback, labels, announce = true, className, ...rest }, ref) {
39
+ const score = validScore(scoreProp);
40
+ // Per key, so a label passed as undefined (a missing translation) falls back
41
+ const text = {
42
+ label: labels?.label ?? defaultPasswordStrengthLabels.label,
43
+ scores: labels?.scores ?? defaultPasswordStrengthLabels.scores,
44
+ };
45
+ const scoreText = score === undefined ? undefined : text.scores[score];
46
+ // Announce a changed score once it has held for a second
47
+ const [spoken, setSpoken] = useState('');
48
+ const lastSpoken = useRef(undefined);
49
+ useEffect(() => {
50
+ if (!announce)
51
+ return;
52
+ if (scoreText === lastSpoken.current)
53
+ return;
54
+ // The old score is wrong now: clear it at once (silently), so nobody
55
+ // reading the region finds it in the meantime
56
+ lastSpoken.current = undefined;
57
+ setSpoken('');
58
+ if (scoreText === undefined)
59
+ return;
60
+ let clear;
61
+ const timer = setTimeout(() => {
62
+ lastSpoken.current = scoreText;
63
+ setSpoken(`${text.label}: ${scoreText}`);
64
+ // Then clear it, so browse mode doesn't come across a stale score
65
+ clear = setTimeout(() => setSpoken(''), CLEAR_AFTER_MS);
66
+ }, ANNOUNCE_AFTER_MS);
67
+ return () => {
68
+ clearTimeout(timer);
69
+ clearTimeout(clear);
70
+ };
71
+ }, [announce, scoreText, text.label]);
72
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { ...rest, ref: ref, className: cx('tui-password-strength', className), "data-score": score, children: [_jsx("div", { className: "tui-password-strength__bars", "aria-hidden": "true", children: Array.from({ length: BARS }, (_, i) => (_jsx("span", { className: "tui-password-strength__bar", "data-lit": score !== undefined && i < lit(score) ? 'true' : undefined }, i))) }), scoreText !== undefined && (_jsxs("p", { className: "tui-password-strength__text", children: [_jsxs("span", { className: "tui-password-strength__label", children: [text.label, ":"] }), ' ', _jsxs("span", { className: "tui-password-strength__score", children: [scoreText, "."] }), feedback && (_jsxs(_Fragment, { children: [' ', _jsx("span", { className: "tui-password-strength__feedback", children: feedback })] }))] }))] }), announce && (_jsx("span", { role: "status", className: "tui-visually-hidden", children: spoken }))] }));
73
+ });
@@ -0,0 +1,3 @@
1
+ export { PasswordStrength } from './PasswordStrength';
2
+ export { defaultPasswordStrengthLabels } from './types';
3
+ export type { PasswordStrengthProps, PasswordStrengthLabels, PasswordStrengthScore } from './types';
@@ -0,0 +1,2 @@
1
+ export { PasswordStrength } from './PasswordStrength.js';
2
+ export { defaultPasswordStrengthLabels } from './types.js';
@@ -0,0 +1,36 @@
1
+ import type { HTMLAttributes } from 'react';
2
+ /**
3
+ * How hard the password is to guess, 0 to 4: the scale zxcvbn and its ports
4
+ * return, so a score from one can be passed straight in. TUI doesn't estimate
5
+ * it: a meter that counts character types praises `Password1!` and marks down
6
+ * a long passphrase.
7
+ */
8
+ export type PasswordStrengthScore = 0 | 1 | 2 | 3 | 4;
9
+ export type PasswordStrengthLabels = {
10
+ /** Names the meter, before the score. @default "Password strength" */
11
+ label?: string;
12
+ /** One per score, 0 to 4. @default ["Very weak", "Weak", "Fair", "Strong", "Very strong"] */
13
+ scores?: readonly [string, string, string, string, string];
14
+ };
15
+ export declare const defaultPasswordStrengthLabels: Required<PasswordStrengthLabels>;
16
+ /** Rest props land on the meter (bars and words), the element `id` names for `aria-describedby` */
17
+ export type PasswordStrengthProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'> & {
18
+ /**
19
+ * The estimate, 0 to 4. Leave it out while the field is empty, or while an
20
+ * estimator is still loading: the meter then shows no score and says
21
+ * nothing. Anything but a whole number from 0 to 4 counts as no score.
22
+ */
23
+ score?: PasswordStrengthScore;
24
+ /** What would make it stronger: "Add another word or two." */
25
+ feedback?: string;
26
+ labels?: PasswordStrengthLabels;
27
+ /**
28
+ * Say the score through a polite live region a second after it settles on
29
+ * a new value. Only the score: the hint is read with the field. Off, both
30
+ * are still read with the field, through `aria-describedby` on the input.
31
+ * Render the meter from the first paint, even with no score, so the region
32
+ * exists before it has anything to say.
33
+ * @default true
34
+ */
35
+ announce?: boolean;
36
+ };
@@ -0,0 +1,4 @@
1
+ export const defaultPasswordStrengthLabels = {
2
+ label: 'Password strength',
3
+ scores: ['Very weak', 'Weak', 'Fair', 'Strong', 'Very strong'],
4
+ };
@@ -22,7 +22,13 @@ export type DataTableProps<T> = {
22
22
  loading?: boolean;
23
23
  /** Shown in place of rows while `loading`. */
24
24
  loadingMessage?: React.ReactNode;
25
- /** Shown in place of rows when `data` is empty. */
25
+ /**
26
+ * Shown in place of rows when `data` is empty. Plain text, or a small empty
27
+ * state (a line and a "Clear search" button). It isn't a live region: when
28
+ * the rows run out, the table's own status says so once, as `emptyMessage`
29
+ * if it's a string, else `labels.empty`. A full-page empty state belongs
30
+ * outside the table, in its place.
31
+ */
26
32
  emptyMessage?: React.ReactNode;
27
33
  /** Override hardcoded English strings for i18n. Unset keys use English defaults. */
28
34
  labels?: DataTableLabels;
@@ -229,6 +229,23 @@ enableRowSelection = false, getRowId, getRowLabelForSelection, onSelectionChange
229
229
  prevPageRef.current = currentPageIndex;
230
230
  prevSortRef.current = currentSorting;
231
231
  }, [currentPageIndex, currentSorting, pageCount, columns, labels]);
232
+ // Rows running out (a search that matches nothing) is said once, through
233
+ // the status above: the empty cell itself isn't a live region, or its whole
234
+ // content, buttons and all, would be read out each time it changed. Not on
235
+ // mount: a table that starts empty is read as a table. A table that mounts
236
+ // loading and resolves to no rows does say it: that's the fetch's outcome.
237
+ // Keep this effect BELOW the page/sort one: a search that empties the table
238
+ // on page 3 also clamps the page in the same commit, and the last write
239
+ // ("No results", not "Page 1 of 0") is the one spoken.
240
+ const prevEmptyRef = React.useRef(isEmpty);
241
+ React.useEffect(() => {
242
+ if (isEmpty && !prevEmptyRef.current) {
243
+ const text = typeof emptyMessage === 'string' ? emptyMessage : labels.empty;
244
+ // The same words twice in a row are no change, so nudge them to be heard
245
+ setAnnouncement((prev) => (prev === text ? `${text}\u00A0` : text));
246
+ }
247
+ prevEmptyRef.current = isEmpty;
248
+ }, [isEmpty, emptyMessage, labels]);
232
249
  return (
233
250
  // The container scrolls horizontally (overflow-x) — it must be keyboard
234
251
  // reachable and named, or clipped content is mouse-only (WCAG 2.1.1).
@@ -255,7 +272,7 @@ enableRowSelection = false, getRowId, getRowLabelForSelection, onSelectionChange
255
272
  : sortDirection === 'desc'
256
273
  ? '▼'
257
274
  : '' })] })) : (headerContent) }, header.id));
258
- }) }, headerGroup.id))) }), _jsx("tbody", { className: "tui-table__body", children: loading ? (_jsx("tr", { className: "tui-table__row tui-table__row--loading", children: _jsx("td", { className: "tui-table__cell tui-table__cell--body", colSpan: table.getAllLeafColumns().length, children: loadingMessage }) })) : isEmpty ? (_jsx("tr", { className: "tui-table__row tui-table__row--empty", children: _jsx("td", { className: "tui-table__cell tui-table__cell--body", colSpan: table.getAllLeafColumns().length, role: "status", children: emptyMessage }) })) : (rows.map((row) => {
275
+ }) }, headerGroup.id))) }), _jsx("tbody", { className: "tui-table__body", children: loading ? (_jsx("tr", { className: "tui-table__row tui-table__row--loading", children: _jsx("td", { className: "tui-table__cell tui-table__cell--body", colSpan: table.getAllLeafColumns().length, children: loadingMessage }) })) : isEmpty ? (_jsx("tr", { className: "tui-table__row tui-table__row--empty", children: _jsx("td", { className: "tui-table__cell tui-table__cell--body", colSpan: table.getAllLeafColumns().length, children: emptyMessage }) })) : (rows.map((row) => {
259
276
  const rowProps = getRowProps?.(row);
260
277
  return (
261
278
  // Consumer props spread first: className merges with the
@@ -22,5 +22,11 @@ export type DataTableLabels = {
22
22
  bulkActions?: (count: number) => string;
23
23
  /** Built-in bulk bar's clear-selection button. Default: `"Clear"` */
24
24
  bulkClear?: string;
25
+ /**
26
+ * Live-region announcement when the rows run out (a filter or search that
27
+ * matches nothing), used when `emptyMessage` isn't plain text. A string
28
+ * `emptyMessage` is announced as it is. Default: `"No results"`
29
+ */
30
+ empty?: string;
25
31
  };
26
32
  export declare const defaultDataTableLabels: Required<DataTableLabels>;
@@ -11,4 +11,5 @@ export const defaultDataTableLabels = {
11
11
  bulkSelected: defaultBulkActionsBarLabels.selected,
12
12
  bulkActions: defaultBulkActionsBarLabels.actions,
13
13
  bulkClear: 'Clear',
14
+ empty: 'No results',
14
15
  };
@@ -42,6 +42,7 @@ export { CommandPalette, CommandPaletteItem, CommandPaletteGroup, CommandPalette
42
42
  export { SearchInput } from './SearchInput';
43
43
  export { SecretInput, defaultSecretInputLabels } from './SecretInput';
44
44
  export { PasswordInput, defaultPasswordInputLabels } from './PasswordInput';
45
+ export { PasswordStrength, defaultPasswordStrengthLabels } from './PasswordStrength';
45
46
  export { SearchSelect, SearchSelectTrigger, SearchSelectContent, SearchSelectOption, SearchSelectGroup, SearchSelectLabel, useSearchSelect, } from './SearchSelect';
46
47
  export { Switch } from './Switch';
47
48
  export { Tabs } from './Tabs';
@@ -94,6 +95,7 @@ export type { SearchInputProps } from './SearchInput';
94
95
  export type { SliderProps } from './Slider';
95
96
  export type { SecretInputProps, SecretInputLabels } from './SecretInput';
96
97
  export type { PasswordInputProps, PasswordInputLabels, PasswordInputPurpose } from './PasswordInput';
98
+ export type { PasswordStrengthProps, PasswordStrengthLabels, PasswordStrengthScore } from './PasswordStrength';
97
99
  export type { SearchSelectProps, SearchSelectTriggerProps, SearchSelectContentProps, SearchSelectOptionProps, SearchSelectGroupProps, SearchSelectLabelProps, SearchSelectLabels, } from './SearchSelect';
98
100
  export type { SwitchProps } from './Switch';
99
101
  export type { TextareaProps, TextareaResize } from './Textarea';
@@ -40,6 +40,7 @@ export { CommandPalette, CommandPaletteItem, CommandPaletteGroup, CommandPalette
40
40
  export { SearchInput } from './SearchInput/index.js';
41
41
  export { SecretInput, defaultSecretInputLabels } from './SecretInput/index.js';
42
42
  export { PasswordInput, defaultPasswordInputLabels } from './PasswordInput/index.js';
43
+ export { PasswordStrength, defaultPasswordStrengthLabels } from './PasswordStrength/index.js';
43
44
  export { SearchSelect, SearchSelectTrigger, SearchSelectContent, SearchSelectOption, SearchSelectGroup, SearchSelectLabel, useSearchSelect, } from './SearchSelect/index.js';
44
45
  export { Switch } from './Switch/index.js';
45
46
  export { Tabs } from './Tabs/index.js';
package/figma-tokens.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.2.46",
2
+ "version": "0.2.48",
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.",
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.46" aria-hidden="true" focusable="false" style="position:absolute;width:0;height:0;overflow:hidden">
1
+ <svg xmlns="http://www.w3.org/2000/svg" data-tui-icon-sprite="all" data-tui-icon-sprite-version="0.2.48" 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>
@@ -1 +1 @@
1
- export const SPRITE_VERSION = '0.2.46';
1
+ export const SPRITE_VERSION = '0.2.48';
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.46';
24
+ $GLOBALS['tangible_ui_icon_sprite_copies'][__DIR__] = '0.2.48';
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.46",
3
+ "version": "0.2.48",
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",
@@ -192,6 +192,10 @@
192
192
  "import": "./components/PasswordInput/index.js",
193
193
  "types": "./components/PasswordInput/index.d.ts"
194
194
  },
195
+ "./components/PasswordStrength": {
196
+ "import": "./components/PasswordStrength/index.js",
197
+ "types": "./components/PasswordStrength/index.d.ts"
198
+ },
195
199
  "./components/Popover": {
196
200
  "import": "./components/Popover/index.js",
197
201
  "types": "./components/Popover/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`, `bulkSelected`, `bulkActions`, `bulkClear` (the built-in bulk bar, 0.2.42+) / `selected`, `actions` |
401
+ | DataTable / BulkActionsBar | `selectAll`, `selectRow`, `pageStatus`, `sortBy`, `sorted`, `bulkSelected`, `bulkActions`, `bulkClear` (the built-in bulk bar, 0.2.42+), `empty` (0.2.48+; announced when the rows run out and `emptyMessage` isn't plain text) / `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) |
@@ -745,7 +745,9 @@ it again, an app-handled one leaves it; for a second field on a page override al
745
745
  field → `SecretInput`** (masked, with the same toggle, but it keeps password managers out; `isSet`
746
746
  is a boolean so a stored secret never reaches the client, it shows a "Saved" placeholder and typing
747
747
  replaces it; `locked` makes it read-only with no toggle). Don't use one for the other: SecretInput on
748
- a login stops managers filling it. No Breadcrumb, no Skeleton, and no *standalone* time picker — but
748
+ a login stops managers filling it. **Password strength → `PasswordStrength`** under the field (display only: pass a 0–4
749
+ `score` from zxcvbn-ts or a server check, never a character-type count; link it with the input's
750
+ `aria-describedby`; it advises, the length rule still validates). No Breadcrumb, no Skeleton, and no *standalone* time picker — but
749
751
  `DatePicker` / `DateRangePicker` take `withTime` for an hour/minute field (12- or 24-hour via
750
752
  `hour12`) plus a display-only `zoneLabel`; the value is a plain `Date` with wall-clock semantics,
751
753
  so timezone interpretation stays yours. A range with a start and no end (a membership, a
@@ -822,6 +824,27 @@ track and a bare `1fr` track alike. Use `grid-template-columns: minmax(0, 1fr)`,
822
824
  `min-width: 0` on the item. A DataTable placed directly in the track is fine: its root is the
823
825
  scroll container.
824
826
 
827
+ ### CommandPalette and its trigger
828
+
829
+ `CommandPalette.Trigger` usually sits in a header, far from the palette, so it can't read the
830
+ palette's props. Wire its `onClick` to the palette's `open` state, and define the shortcut once:
831
+
832
+ ```tsx
833
+ const SEARCH_SHORTCUT = 'mod+k';
834
+ <CommandPalette.Trigger shortcut={SEARCH_SHORTCUT} onClick={() => setOpen(true)} />
835
+ <CommandPalette shortcut={SEARCH_SHORTCUT} open={open} onOpenChange={setOpen}>…</CommandPalette>
836
+ ```
837
+
838
+ The trigger's `shortcut` only shows the hint; the palette's registers the keys. The trigger focuses
839
+ itself on click (0.2.48+), so focus returns to it on close in Safari too: drop any
840
+ `event.currentTarget.focus()` workaround.
841
+
842
+ ### DataTable's empty state
843
+
844
+ `emptyMessage` renders in the empty row and is not a live region (0.2.48+): when the rows run out,
845
+ the table's own status says `emptyMessage` once if it's a string, else `labels.empty`. A line plus a
846
+ "Clear search" button fits; a full empty state (illustration, heading) belongs in the table's place.
847
+
825
848
  ### Fixed bars while a dialog is open
826
849
 
827
850
  A Modal (CommandPalette, the vanilla modal) locks page scroll. With classic scrollbars that frees