@newtone-dev/ui-react-web 0.38.1 → 0.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/action/action.css
CHANGED
|
@@ -157,9 +157,15 @@
|
|
|
157
157
|
* slice-is-earned.md. With no fill, its ink sits on the page's ground, which is what
|
|
158
158
|
* `role.text.primary` is for. Pressed equals hover because no role holds a darker step; a call site
|
|
159
159
|
* that needs to see it pressed is the trigger for a slice. */
|
|
160
|
-
|
|
160
|
+
/* ICON-ONLY, EITHER TIER, from 2026-10-14: a circle the rung's height, its glyph at the rung's block
|
|
161
|
+
* clearance. The secondary adds its own paint below; the primary keeps the accent.
|
|
162
|
+
* components/action.md, *The primary tier can be icon-only too*. */
|
|
163
|
+
.newtone-action--icon {
|
|
161
164
|
inline-size: var(--newtone-action-height);
|
|
162
165
|
padding: calc(var(--newtone-action-pad-y) - 1px);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.newtone-action--secondary {
|
|
163
169
|
background: none;
|
|
164
170
|
color: var(--newtone-role-text-primary);
|
|
165
171
|
border-color: currentColor;
|
package/dist/action/action.d.ts
CHANGED
|
@@ -47,21 +47,44 @@ interface ActionPrimary extends ActionShared {
|
|
|
47
47
|
*/
|
|
48
48
|
iconEnd?: string;
|
|
49
49
|
icon?: undefined;
|
|
50
|
+
iconFill?: undefined;
|
|
50
51
|
}
|
|
51
52
|
/**
|
|
52
53
|
* Beside the ask: one glyph in a circle, no word. **No words is what keeps it from being a second
|
|
53
54
|
* ask**, so the type refuses `label`, and requires the name the missing words would have carried.
|
|
54
55
|
*/
|
|
56
|
+
/**
|
|
57
|
+
* THE PRIMARY TIER WITHOUT WORDS, from 2026-10-14: the secondary's circle in the primary's paint, for a
|
|
58
|
+
* control whose two states must keep one shape (the OFJ deck's speaker, primary when the music is up).
|
|
59
|
+
* Still a named ask: `ariaLabel` is required. components/action.md, *The primary tier can be icon-only too*.
|
|
60
|
+
*/
|
|
61
|
+
interface ActionPrimaryIcon extends ActionShared {
|
|
62
|
+
variant?: 'primary';
|
|
63
|
+
/** The glyph, by name. Sized by the rung, 24 at both. */
|
|
64
|
+
icon: string;
|
|
65
|
+
/** Its accessible name, required because nothing visible names it. */
|
|
66
|
+
ariaLabel: string;
|
|
67
|
+
/** The glyph filled, as the secondary's can be. */
|
|
68
|
+
iconFill?: boolean;
|
|
69
|
+
label?: undefined;
|
|
70
|
+
iconEnd?: undefined;
|
|
71
|
+
}
|
|
55
72
|
interface ActionSecondary extends ActionShared {
|
|
56
73
|
variant: 'secondary';
|
|
57
74
|
/** The glyph, by name. Sized by the rung, 24 at both. */
|
|
58
75
|
icon: string;
|
|
59
76
|
/** Its accessible name, required because nothing visible names it. */
|
|
60
77
|
ariaLabel: string;
|
|
78
|
+
/**
|
|
79
|
+
* Fill the glyph, the family's `FILL` axis; the circle stays unfilled. From 2026-10-13, for a
|
|
80
|
+
* transport control's play and pause, which read filled. Defaults to outlined.
|
|
81
|
+
* components/action.md, *The secondary tier*.
|
|
82
|
+
*/
|
|
83
|
+
iconFill?: boolean;
|
|
61
84
|
label?: undefined;
|
|
62
85
|
iconEnd?: undefined;
|
|
63
86
|
}
|
|
64
|
-
export type ActionProps = (ActionPrimary | ActionSecondary) & ((Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'aria-label'> & {
|
|
87
|
+
export type ActionProps = (ActionPrimary | ActionPrimaryIcon | ActionSecondary) & ((Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'aria-label'> & {
|
|
65
88
|
href?: undefined;
|
|
66
89
|
}) | (Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'children' | 'href' | 'aria-label'> & {
|
|
67
90
|
/** Where it goes. Its presence turns the rendered element into an `<a>`. */
|
|
@@ -103,6 +126,6 @@ export type ActionProps = (ActionPrimary | ActionSecondary) & ((Omit<ButtonHTMLA
|
|
|
103
126
|
* does nothing, which is an honest placeholder and not a form control: `type="button"` is
|
|
104
127
|
* hardcoded, so it cannot submit a form it happens to be standing in.
|
|
105
128
|
*/
|
|
106
|
-
export declare function Action({ variant, label, icon, ariaLabel, iconEnd, size, fill, className, ...rest }: ActionProps): import("react").JSX.Element;
|
|
129
|
+
export declare function Action({ variant, label, icon, ariaLabel, iconEnd, iconFill, size, fill, className, ...rest }: ActionProps): import("react").JSX.Element;
|
|
107
130
|
export {};
|
|
108
131
|
//# sourceMappingURL=action.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../src/action/action.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAA;AAGvE;;;;;;;;;;GAUG;AACH,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,CAAA;AAEpC;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,CAAA;AAgBnD,UAAU,YAAY;IAClB;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,2FAA2F;IAC3F,IAAI,CAAC,EAAE,OAAO,CAAA;CACjB;AAED,kCAAkC;AAClC,UAAU,aAAc,SAAQ,YAAY;IACxC,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,8FAA8F;IAC9F,KAAK,EAAE,MAAM,CAAA;IACb,qFAAqF;IACrF,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../src/action/action.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAA;AAGvE;;;;;;;;;;GAUG;AACH,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,CAAA;AAEpC;;;;GA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E,UAAU,GAAG,YAAY,CAAC,GAAG;IACxE,IAAI,CAAC,EAAE,SAAS,CAAA;CACnB,CAAC,GACF,CAAC,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,YAAY,CAAC,GAAG;IACjF,4EAA4E;IAC5E,IAAI,EAAE,MAAM,CAAA;CACf,CAAC,CACP,CAAA;AAEL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,MAAM,CAAC,EACnB,OAAmB,EACnB,KAAK,EACL,IAAI,EACJ,SAAS,EACT,OAAO,EACP,QAAgB,EAChB,IAAW,EACX,IAAY,EACZ,SAAS,EACT,GAAG,IAAI,EACV,EAAE,WAAW,+BAkDb"}
|
package/dist/action/action.js
CHANGED
|
@@ -49,13 +49,14 @@ const GLYPH = { sm: 'md', lg: 'md' };
|
|
|
49
49
|
* does nothing, which is an honest placeholder and not a form control: `type="button"` is
|
|
50
50
|
* hardcoded, so it cannot submit a form it happens to be standing in.
|
|
51
51
|
*/
|
|
52
|
-
export function Action({ variant = 'primary', label, icon, ariaLabel, iconEnd, size = 'lg', fill = false, className, ...rest }) {
|
|
52
|
+
export function Action({ variant = 'primary', label, icon, ariaLabel, iconEnd, iconFill = false, size = 'lg', fill = false, className, ...rest }) {
|
|
53
53
|
// `--icon-end` is keyed on the glyph being PRESENT and not on the prop being declared, because
|
|
54
54
|
// the class does one thing -- take a gap off the padding on the glyph's side -- and a pill with
|
|
55
55
|
// no glyph in it would be 16px short on one side for nothing. See action.css.
|
|
56
56
|
const classes = [
|
|
57
57
|
'newtone-action',
|
|
58
58
|
`newtone-action--${size}`,
|
|
59
|
+
icon === undefined ? null : 'newtone-action--icon',
|
|
59
60
|
variant === 'secondary' ? 'newtone-action--secondary' : null,
|
|
60
61
|
iconEnd === undefined ? null : 'newtone-action--icon-end',
|
|
61
62
|
fill ? 'newtone-action--fill' : null,
|
|
@@ -65,7 +66,7 @@ export function Action({ variant = 'primary', label, icon, ariaLabel, iconEnd, s
|
|
|
65
66
|
.join(' ');
|
|
66
67
|
// A primary's label is always present, so it always has a name and the glyph is decorative. A
|
|
67
68
|
// secondary's name is its required `ariaLabel`. `Icon` writes its own `aria-hidden`.
|
|
68
|
-
const content =
|
|
69
|
+
const content = icon !== undefined ? (_jsx(Icon, { name: icon, size: GLYPH[size], fill: iconFill })) : (_jsxs(_Fragment, { children: [_jsx("span", { className: "newtone-action-label", children: label }), iconEnd === undefined ? null : _jsx(Icon, { name: iconEnd, size: GLYPH[size] })] }));
|
|
69
70
|
if (rest.href !== undefined) {
|
|
70
71
|
const { href, ...anchor } = rest;
|
|
71
72
|
return (_jsx("a", { href: href, className: classes, "aria-label": ariaLabel, ...anchor, children: content }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.js","sourceRoot":"","sources":["../../src/action/action.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAiB,MAAM,kBAAkB,CAAA;AAsBtD;;;;;;;;;;;GAWG;AACH,MAAM,KAAK,GAAiC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"action.js","sourceRoot":"","sources":["../../src/action/action.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAiB,MAAM,kBAAkB,CAAA;AAsBtD;;;;;;;;;;;GAWG;AACH,MAAM,KAAK,GAAiC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,CAAA;AAoFlE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,UAAU,MAAM,CAAC,EACnB,OAAO,GAAG,SAAS,EACnB,KAAK,EACL,IAAI,EACJ,SAAS,EACT,OAAO,EACP,QAAQ,GAAG,KAAK,EAChB,IAAI,GAAG,IAAI,EACX,IAAI,GAAG,KAAK,EACZ,SAAS,EACT,GAAG,IAAI,EACG;IACV,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