@tangible/ui 0.2.45 → 0.2.46
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/PasswordInput/PasswordInput.d.ts +7 -0
- package/components/PasswordInput/PasswordInput.js +64 -0
- package/components/PasswordInput/index.d.ts +3 -0
- package/components/PasswordInput/index.js +2 -0
- package/components/PasswordInput/types.d.ts +45 -0
- package/components/PasswordInput/types.js +6 -0
- package/components/SecretInput/SecretInput.js +10 -33
- package/components/index.d.ts +2 -0
- package/components/index.js +1 -0
- package/figma-tokens.json +1 -1
- package/icons/icons.svg +1 -1
- package/icons/sprite-version.js +1 -1
- package/icons/sprite.php +1 -1
- package/package.json +5 -1
- package/skills/building-with-tui/SKILL.md +9 -3
- package/styles/all.css +1 -1
- package/styles/all.expanded.css +51 -0
- package/styles/all.expanded.unlayered.css +51 -0
- package/styles/all.unlayered.css +1 -1
- package/styles/components/_bundle.scss +5 -1
- package/styles/components/password-input.scss +24 -0
- package/styles/components/secret-input.scss +1 -65
- package/styles/system/_reveal.scss +82 -0
- package/styles/system/index.scss +1 -0
- package/tui-manifest.json +87 -2
- package/utils/reveal/RevealToggle.d.ts +32 -0
- package/utils/reveal/RevealToggle.js +57 -0
- package/utils/reveal/index.d.ts +3 -0
- package/utils/reveal/index.js +4 -0
- package/utils/reveal/useReveal.d.ts +26 -0
- package/utils/reveal/useReveal.js +55 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const PasswordInput: import("react").ForwardRefExoticComponent<Omit<import("..").TextInputProps, "type" | "autoCapitalize" | "spellCheck" | "prefix" | "autoCorrect" | "autoComplete" | "suffix"> & {
|
|
2
|
+
purpose: import("./types").PasswordInputPurpose;
|
|
3
|
+
revealed?: boolean;
|
|
4
|
+
defaultRevealed?: boolean;
|
|
5
|
+
onRevealChange?: (revealed: boolean) => void;
|
|
6
|
+
labels?: import("./types").PasswordInputLabels;
|
|
7
|
+
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useEffect, useRef } from 'react';
|
|
3
|
+
import { cx } from '../../utils/cx.js';
|
|
4
|
+
import { composeRefs } from '../../utils/compose-refs.js';
|
|
5
|
+
import { TextInput } from '../TextInput/index.js';
|
|
6
|
+
import { RevealToggle, useReveal } from '../../utils/reveal/index.js';
|
|
7
|
+
import { defaultPasswordInputLabels } from './types.js';
|
|
8
|
+
// =============================================================================
|
|
9
|
+
// PasswordInput Component
|
|
10
|
+
// =============================================================================
|
|
11
|
+
//
|
|
12
|
+
// TextInput variant for a password someone signs in with or chooses: masked,
|
|
13
|
+
// with a show/hide toggle. Its sibling SecretInput is for stored secrets (API
|
|
14
|
+
// keys) and does the opposite with password managers, keeping them out; this
|
|
15
|
+
// one is built to let them in.
|
|
16
|
+
//
|
|
17
|
+
// - `purpose` sets autocomplete (current-password / new-password), so managers
|
|
18
|
+
// fill a saved password or offer to generate one.
|
|
19
|
+
// - Shown as text, it must not be autocorrected, capitalised or spellchecked:
|
|
20
|
+
// those would change what's typed, and a cloud spellchecker would send it
|
|
21
|
+
// off the page. So those three are set after the consumer's props.
|
|
22
|
+
// - A native submit masks it again, quietly, so a password left showing isn't
|
|
23
|
+
// saved as plain text in a browser's form history. A submit the app cancels
|
|
24
|
+
// (preventDefault) leaves it as it is.
|
|
25
|
+
// - The reveal toggle is shared with SecretInput (src/utils/reveal and the
|
|
26
|
+
// system reveal-button mixin), so the two can't drift.
|
|
27
|
+
//
|
|
28
|
+
// =============================================================================
|
|
29
|
+
export const PasswordInput = forwardRef(function PasswordInput({ purpose, revealed: revealedProp, defaultRevealed, onRevealChange, labels, className, inputClassName, disabled, ...rest }, forwardedRef) {
|
|
30
|
+
const text = { ...defaultPasswordInputLabels, ...labels };
|
|
31
|
+
const inputRef = useRef(null);
|
|
32
|
+
const { revealed, setRevealed, announcement } = useReveal({
|
|
33
|
+
revealed: revealedProp,
|
|
34
|
+
defaultRevealed,
|
|
35
|
+
onRevealChange,
|
|
36
|
+
shown: text.shown,
|
|
37
|
+
hidden: text.hidden,
|
|
38
|
+
});
|
|
39
|
+
// Re-mask when the form really submits. Listened for on the document in
|
|
40
|
+
// the bubble phase, so it runs after React's own handlers and can see
|
|
41
|
+
// whether one cancelled the submit: an app that handles sign-in itself
|
|
42
|
+
// (preventDefault) keeps the password showing, so a failed attempt can be
|
|
43
|
+
// checked for a typo. A native submit masks it first, so the browser never
|
|
44
|
+
// stores it as plain text in form history. Matched to the field's form at
|
|
45
|
+
// the time, so it holds if the field mounts before its form. The ref keeps
|
|
46
|
+
// the latest setter without re-adding the listener on every toggle.
|
|
47
|
+
const remask = useRef(() => { });
|
|
48
|
+
remask.current = () => setRevealed(false, { announce: false });
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
const doc = inputRef.current?.ownerDocument;
|
|
51
|
+
if (!doc)
|
|
52
|
+
return;
|
|
53
|
+
const onSubmit = (event) => {
|
|
54
|
+
if (!event.defaultPrevented && event.target === inputRef.current?.form)
|
|
55
|
+
remask.current();
|
|
56
|
+
};
|
|
57
|
+
doc.addEventListener('submit', onSubmit);
|
|
58
|
+
return () => doc.removeEventListener('submit', onSubmit);
|
|
59
|
+
}, []);
|
|
60
|
+
return (_jsx(TextInput, { ...rest, ref: composeRefs(forwardedRef, inputRef), type: revealed ? 'text' : 'password', autoComplete: purpose === 'new' ? 'new-password' : 'current-password', spellCheck: false, autoCapitalize: "off", autoCorrect: "off", disabled: disabled, className: cx('tui-password-input', className),
|
|
61
|
+
// tui-input-reset strips Edge's own ::-ms-reveal eye, which would sit
|
|
62
|
+
// beside our toggle and unmask the field without changing `type`.
|
|
63
|
+
inputClassName: cx('tui-input-reset', 'tui-password-input__input', inputClassName), suffix: _jsx(RevealToggle, { revealed: revealed, onToggle: () => setRevealed(!revealed), revealLabel: text.reveal, hideLabel: text.hide, announcement: announcement, disabled: disabled, className: "tui-password-input__reveal", inputRef: inputRef, rootClassName: "tui-password-input" }) }));
|
|
64
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { TextInputProps } from '../TextInput/types';
|
|
2
|
+
/**
|
|
3
|
+
* What the password is for. It sets `autocomplete`, which is how browsers and
|
|
4
|
+
* password managers know to fill a saved password (`current`) or offer to
|
|
5
|
+
* generate and save a new one (`new`). A wrong value fails silently, so it's
|
|
6
|
+
* a required prop rather than a default.
|
|
7
|
+
*/
|
|
8
|
+
export type PasswordInputPurpose = 'current' | 'new';
|
|
9
|
+
/** Overridable strings, for i18n and for naming a second field on a page. */
|
|
10
|
+
export type PasswordInputLabels = {
|
|
11
|
+
/**
|
|
12
|
+
* The reveal toggle's name while the password is masked. Two password
|
|
13
|
+
* fields on one page need different names ("Show new password"): override
|
|
14
|
+
* all four strings together, so the announcements name the field too.
|
|
15
|
+
* @default "Show password"
|
|
16
|
+
*/
|
|
17
|
+
reveal?: string;
|
|
18
|
+
/** @default "Hide password" */
|
|
19
|
+
hide?: string;
|
|
20
|
+
/** Announced when the password is shown. @default "Password shown." */
|
|
21
|
+
shown?: string;
|
|
22
|
+
/** Announced when it's masked again. @default "Password hidden." */
|
|
23
|
+
hidden?: string;
|
|
24
|
+
};
|
|
25
|
+
export declare const defaultPasswordInputLabels: Required<PasswordInputLabels>;
|
|
26
|
+
/**
|
|
27
|
+
* `autoComplete` comes from `purpose`; `spellCheck`, `autoCapitalize` and
|
|
28
|
+
* `autoCorrect` are always off (shown as text, they'd change or send the
|
|
29
|
+
* password), so none of the four is a prop.
|
|
30
|
+
*/
|
|
31
|
+
export type PasswordInputProps = Omit<TextInputProps, 'type' | 'prefix' | 'suffix' | 'autoComplete' | 'spellCheck' | 'autoCapitalize' | 'autoCorrect'> & {
|
|
32
|
+
/**
|
|
33
|
+
* `current` to sign in or confirm who you are; `new` to choose a password
|
|
34
|
+
* (sign up, reset, change). Sets `autocomplete` to `current-password` or
|
|
35
|
+
* `new-password`.
|
|
36
|
+
*/
|
|
37
|
+
purpose: PasswordInputPurpose;
|
|
38
|
+
/** Controlled: whether the password shows as text */
|
|
39
|
+
revealed?: boolean;
|
|
40
|
+
/** Uncontrolled: start shown. @default false */
|
|
41
|
+
defaultRevealed?: boolean;
|
|
42
|
+
/** Fires on the toggle, and with `false` when a native submit re-masks the field */
|
|
43
|
+
onRevealChange?: (revealed: boolean) => void;
|
|
44
|
+
labels?: PasswordInputLabels;
|
|
45
|
+
};
|
|
@@ -6,7 +6,8 @@ import { isDev } from '../../utils/is-dev.js';
|
|
|
6
6
|
import { Icon } from '../Icon/index.js';
|
|
7
7
|
import { TextInput } from '../TextInput/index.js';
|
|
8
8
|
import { defaultSecretInputLabels } from './types.js';
|
|
9
|
-
import {
|
|
9
|
+
import { RevealToggle, useReveal } from '../../utils/reveal/index.js';
|
|
10
|
+
import { LockSmall as LockSmallIcon } from '../../icons/system/index.js';
|
|
10
11
|
// =============================================================================
|
|
11
12
|
// SecretInput Component
|
|
12
13
|
// =============================================================================
|
|
@@ -29,11 +30,13 @@ export const SecretInput = forwardRef(function SecretInput({ isSet = false, reve
|
|
|
29
30
|
// none of them is assembled from fragments.
|
|
30
31
|
const text = { ...defaultSecretInputLabels, ...labels };
|
|
31
32
|
const inputRef = useRef(null);
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
const { revealed, setRevealed, announcement } = useReveal({
|
|
34
|
+
revealed: revealedProp,
|
|
35
|
+
defaultRevealed,
|
|
36
|
+
onRevealChange,
|
|
37
|
+
shown: text.shown,
|
|
38
|
+
hidden: text.hidden,
|
|
39
|
+
});
|
|
37
40
|
const [isValueControlled] = useState(value !== undefined);
|
|
38
41
|
// Emptiness decides the set-state, which drives an ARIA description as well
|
|
39
42
|
// as the placeholder — so a wrong answer here tells a screen-reader user
|
|
@@ -82,30 +85,6 @@ export const SecretInput = forwardRef(function SecretInput({ isSet = false, reve
|
|
|
82
85
|
setDomHasValue(e.target.value.length > 0);
|
|
83
86
|
onChange?.(e);
|
|
84
87
|
};
|
|
85
|
-
// Announced state, for the screen-reader-plus-mouse case: pointerdown is
|
|
86
|
-
// prevented so focus stays in the field, which means the toggle is never
|
|
87
|
-
// focused on a mouse click and neither its name nor its state is ever read.
|
|
88
|
-
// Without this, a user flips their key into the clear in total silence.
|
|
89
|
-
// Empty until the first toggle so nothing is announced on mount.
|
|
90
|
-
const [announcement, setAnnouncement] = useState('');
|
|
91
|
-
const toggleReveal = () => {
|
|
92
|
-
const next = !revealed;
|
|
93
|
-
if (!isRevealControlled)
|
|
94
|
-
setRevealedState(next);
|
|
95
|
-
setAnnouncement(next ? text.shown : text.hidden);
|
|
96
|
-
onRevealChange?.(next);
|
|
97
|
-
};
|
|
98
|
-
const handleToggleClick = () => {
|
|
99
|
-
toggleReveal();
|
|
100
|
-
// Pointer activation leaves focus wherever it was — including on <body>
|
|
101
|
-
// if nothing was focused, which strands the user at the top of the
|
|
102
|
-
// document. Recover only in that case: on keyboard activation focus is
|
|
103
|
-
// already on the button, and stealing it would break the toggle.
|
|
104
|
-
const input = inputRef.current;
|
|
105
|
-
const active = input?.ownerDocument.activeElement;
|
|
106
|
-
if (input && !active?.closest('.tui-secret-input'))
|
|
107
|
-
input.focus();
|
|
108
|
-
};
|
|
109
88
|
// The set-state treatment only makes sense while there is nothing typed —
|
|
110
89
|
// once there is, the field shows what the user is entering.
|
|
111
90
|
const showSetState = isSet && isEmpty;
|
|
@@ -142,7 +121,5 @@ export const SecretInput = forwardRef(function SecretInput({ isSet = false, reve
|
|
|
142
121
|
// tui-input-reset strips native in-field chrome — here Edge's own
|
|
143
122
|
// ::-ms-reveal eye, which would sit beside our toggle AND unmask the
|
|
144
123
|
// field without changing `type`, so the toggle's state would be wrong.
|
|
145
|
-
inputClassName: cx('tui-input-reset', 'tui-secret-input__input', inputClassName), suffix: _jsxs(_Fragment, { children: [describeSetState && (_jsx("span", { id: setDescId, className: "tui-visually-hidden", children: text.valueSetDescription })), locked ? (_jsxs(_Fragment, { children: [_jsx("span", { id: lockedDescId, className: "tui-visually-hidden", children: lockedMessage ?? text.locked }), _jsx(Icon, { name: LockSmallIcon, className: "tui-secret-input__lock" })] })) : (
|
|
146
|
-
// Keep pointerdown from stealing focus before the click fires.
|
|
147
|
-
onPointerDown: (e) => e.preventDefault(), children: _jsx(Icon, { name: revealed ? ViewOffIcon : ViewIcon }) }), _jsx("span", { role: "status", "aria-live": "polite", className: "tui-visually-hidden", children: announcement })] }))] }) }));
|
|
124
|
+
inputClassName: cx('tui-input-reset', 'tui-secret-input__input', inputClassName), suffix: _jsxs(_Fragment, { children: [describeSetState && (_jsx("span", { id: setDescId, className: "tui-visually-hidden", children: text.valueSetDescription })), locked ? (_jsxs(_Fragment, { children: [_jsx("span", { id: lockedDescId, className: "tui-visually-hidden", children: lockedMessage ?? text.locked }), _jsx(Icon, { name: LockSmallIcon, className: "tui-secret-input__lock" })] })) : (_jsx(RevealToggle, { revealed: revealed, onToggle: () => setRevealed(!revealed), revealLabel: text.reveal, hideLabel: text.hide, announcement: announcement, disabled: disabled, className: "tui-secret-input__reveal", inputRef: inputRef, rootClassName: "tui-secret-input" }))] }) }));
|
|
148
125
|
});
|
package/components/index.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ export { DataTable, BulkActionsBar, defaultDataTableLabels, defaultBulkActionsBa
|
|
|
41
41
|
export { CommandPalette, CommandPaletteItem, CommandPaletteGroup, CommandPaletteLabel, CommandPaletteTrigger, defaultCommandPaletteLabels, } from './CommandPalette';
|
|
42
42
|
export { SearchInput } from './SearchInput';
|
|
43
43
|
export { SecretInput, defaultSecretInputLabels } from './SecretInput';
|
|
44
|
+
export { PasswordInput, defaultPasswordInputLabels } from './PasswordInput';
|
|
44
45
|
export { SearchSelect, SearchSelectTrigger, SearchSelectContent, SearchSelectOption, SearchSelectGroup, SearchSelectLabel, useSearchSelect, } from './SearchSelect';
|
|
45
46
|
export { Switch } from './Switch';
|
|
46
47
|
export { Tabs } from './Tabs';
|
|
@@ -92,6 +93,7 @@ export type { CommandPaletteProps, CommandPaletteItemProps, CommandPaletteGroupP
|
|
|
92
93
|
export type { SearchInputProps } from './SearchInput';
|
|
93
94
|
export type { SliderProps } from './Slider';
|
|
94
95
|
export type { SecretInputProps, SecretInputLabels } from './SecretInput';
|
|
96
|
+
export type { PasswordInputProps, PasswordInputLabels, PasswordInputPurpose } from './PasswordInput';
|
|
95
97
|
export type { SearchSelectProps, SearchSelectTriggerProps, SearchSelectContentProps, SearchSelectOptionProps, SearchSelectGroupProps, SearchSelectLabelProps, SearchSelectLabels, } from './SearchSelect';
|
|
96
98
|
export type { SwitchProps } from './Switch';
|
|
97
99
|
export type { TextareaProps, TextareaResize } from './Textarea';
|
package/components/index.js
CHANGED
|
@@ -39,6 +39,7 @@ export { DataTable, BulkActionsBar, defaultDataTableLabels, defaultBulkActionsBa
|
|
|
39
39
|
export { CommandPalette, CommandPaletteItem, CommandPaletteGroup, CommandPaletteLabel, CommandPaletteTrigger, defaultCommandPaletteLabels, } from './CommandPalette/index.js';
|
|
40
40
|
export { SearchInput } from './SearchInput/index.js';
|
|
41
41
|
export { SecretInput, defaultSecretInputLabels } from './SecretInput/index.js';
|
|
42
|
+
export { PasswordInput, defaultPasswordInputLabels } from './PasswordInput/index.js';
|
|
42
43
|
export { SearchSelect, SearchSelectTrigger, SearchSelectContent, SearchSelectOption, SearchSelectGroup, SearchSelectLabel, useSearchSelect, } from './SearchSelect/index.js';
|
|
43
44
|
export { Switch } from './Switch/index.js';
|
|
44
45
|
export { Tabs } from './Tabs/index.js';
|
package/figma-tokens.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.2.
|
|
2
|
+
"version": "0.2.46",
|
|
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.
|
|
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">
|
|
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.46';
|
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.46';
|
|
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.46",
|
|
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",
|
|
@@ -188,6 +188,10 @@
|
|
|
188
188
|
"import": "./components/Pager/index.js",
|
|
189
189
|
"types": "./components/Pager/index.d.ts"
|
|
190
190
|
},
|
|
191
|
+
"./components/PasswordInput": {
|
|
192
|
+
"import": "./components/PasswordInput/index.js",
|
|
193
|
+
"types": "./components/PasswordInput/index.d.ts"
|
|
194
|
+
},
|
|
191
195
|
"./components/Popover": {
|
|
192
196
|
"import": "./components/Popover/index.js",
|
|
193
197
|
"types": "./components/Popover/index.d.ts"
|
|
@@ -737,9 +737,15 @@ together (same blue). `showLabels={false}` leaves sighted users with color alone
|
|
|
737
737
|
numbers elsewhere; `showPercent` replaces counts for screen readers too. Don't re-point
|
|
738
738
|
`--tui-progress-zN-fill` per position and pass a legend as children: plain `segments` without
|
|
739
739
|
`breakdown` stay cumulative ("Pending 100%").
|
|
740
|
-
**
|
|
741
|
-
|
|
742
|
-
|
|
740
|
+
**Sign-in or new password → `PasswordInput`** (a `TextInput` variant: masked, with a reveal toggle
|
|
741
|
+
named "Show password"; `purpose: 'current' | 'new'` is required and sets `autocomplete`, so password
|
|
742
|
+
managers fill or generate it; never autocorrected or spellchecked when shown; a native submit masks
|
|
743
|
+
it again, an app-handled one leaves it; for a second field on a page override all four `labels`,
|
|
744
|
+
"Show new password" / "New password shown."). **API key / token
|
|
745
|
+
field → `SecretInput`** (masked, with the same toggle, but it keeps password managers out; `isSet`
|
|
746
|
+
is a boolean so a stored secret never reaches the client, it shows a "Saved" placeholder and typing
|
|
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
|
|
743
749
|
`DatePicker` / `DateRangePicker` take `withTime` for an hour/minute field (12- or 24-hour via
|
|
744
750
|
`hour12`) plus a display-only `zoneLabel`; the value is a plain `Date` with wall-clock semantics,
|
|
745
751
|
so timezone interpretation stays yours. A range with a start and no end (a membership, a
|