@newtone-dev/ui-react-web 0.19.0 → 0.20.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.
@@ -57,7 +57,10 @@
57
57
  * The span is the circle and the plate, from the rule above; the images fill one grid cell on top of
58
58
  * it. `overflow: hidden` because the radius is on the span and a radius does not round children.
59
59
  *
60
- * BOTH PICTURES FADE, NOT ONLY THE TOP ONE: they are transparent cut-outs, so a hover picture laid
60
+ * THE SWAP IS INSTANT, NO TRANSITION, from 0.19.1. 0.19.0 cross-faded over 200ms; Joshua: *"the
61
+ * transition between the pictures should be instant."* Mid-fade the circle held two faces.
62
+ *
63
+ * BOTH PICTURES SWAP, NOT ONLY THE TOP ONE: they are transparent cut-outs, so a hover picture laid
61
64
  * over a rest picture that stayed visible shows both faces at once.
62
65
  *
63
66
  * CLICKABLE IS READ FROM THE ANCESTOR. The avatar is never the control -- it sits in a card that is a
@@ -73,7 +76,6 @@
73
76
  inline-size: 100%;
74
77
  block-size: 100%;
75
78
  object-fit: cover;
76
- transition: opacity 200ms ease;
77
79
  }
78
80
 
79
81
  .newtone-avatar--swap > .newtone-avatar__hover {
@@ -87,9 +89,3 @@
87
89
  :is(a, button):is(:hover, :focus-visible) .newtone-avatar--swap > .newtone-avatar__hover {
88
90
  opacity: 1;
89
91
  }
90
-
91
- @media (prefers-reduced-motion: reduce) {
92
- .newtone-avatar--swap > img {
93
- transition: none;
94
- }
95
- }
@@ -63,11 +63,38 @@
63
63
  * through it, and the ring alone is not a card. */
64
64
 
65
65
  .newtone-card-box {
66
- background: var(--newtone-card-box-fill);
67
- border: 1px solid var(--newtone-card-box-ring, var(--newtone-card-box-border));
66
+ background: var(--newtone-card-box-rest-fill);
67
+ border: 1px solid var(--newtone-card-box-ring, var(--newtone-card-box-rest-border));
68
68
  border-radius: var(--newtone-card-box-radius);
69
69
  }
70
70
 
71
+ /* A CARD THAT IS A LINK, 2026-10-01: `href`. Joshua: *"the card itself need some subtle hover state
72
+ * colors, just make sure newtone studio has the right semantic tokens for me to fine-tune them."*
73
+ * Every colour is a `card-box` leaf, so each is a studio row; hover and pressed are offsets of the
74
+ * card's own ground in tokens, so they follow mode and elevation from here with nothing per rung.
75
+ * The anchor gives up the link's ink and underline: the card's text keeps its own. `ring` still wins
76
+ * over every state, as it wins over rest. card-box.md, *`href`*. */
77
+ a.newtone-card-box {
78
+ display: block;
79
+ color: inherit;
80
+ text-decoration: none;
81
+ }
82
+
83
+ a.newtone-card-box:hover {
84
+ background: var(--newtone-card-box-hover-fill);
85
+ border-color: var(--newtone-card-box-ring, var(--newtone-card-box-hover-border));
86
+ }
87
+
88
+ a.newtone-card-box:active {
89
+ background: var(--newtone-card-box-pressed-fill);
90
+ border-color: var(--newtone-card-box-ring, var(--newtone-card-box-pressed-border));
91
+ }
92
+
93
+ a.newtone-card-box:focus-visible {
94
+ outline: 2px solid var(--newtone-card-box-focus-ring);
95
+ outline-offset: 2px;
96
+ }
97
+
71
98
  /* No ring, 2026-09-25: `outlined={false}`, for a card whose ground tells it apart. card-box.md. */
72
99
  .newtone-card-box[data-outlined='false'] {
73
100
  border: none;
@@ -129,9 +129,18 @@ export interface CardBoxProps extends HTMLAttributes<HTMLElement> {
129
129
  * ring under its own selector passes its own `var()`. Since 2026-09-26, issue 201; card-box.md.
130
130
  */
131
131
  ring?: string;
132
+ /**
133
+ * Makes the whole card a link: it renders as an `<a>` and paints `card-box.hover` and
134
+ * `card-box.pressed`, studio rows. Without it the card is a `<div>` with no hover, because a card
135
+ * that is not a link must not look like one. Since 2026-10-01; card-box.md, *`href`*.
136
+ */
137
+ href?: string;
138
+ /** The link's own, passed through: a new tab is the page's decision, as on `IconLink`. */
139
+ target?: string;
140
+ rel?: string;
132
141
  /** The card's own class. It lands on the outer element, where a slot minimum belongs. */
133
142
  className?: string;
134
143
  children?: ReactNode;
135
144
  }
136
- export declare function CardBox({ direction, padding, gap, align, elevation, outlined, size, ring, className, style, children, ...rest }: CardBoxProps): import("react").JSX.Element;
145
+ export declare function CardBox({ direction, padding, gap, align, elevation, outlined, size, ring, href, className, style, children, ...rest }: CardBoxProps): import("react").JSX.Element;
137
146
  //# sourceMappingURL=card-box.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"card-box.d.ts","sourceRoot":"","sources":["../../src/card-box/card-box.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAW,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC7D,OAAO,EAEH,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACxB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAiB,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAErE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2FG;AACH,MAAM,WAAW,YAAa,SAAQ,cAAc,CAAC,WAAW,CAAC;IAC7D,yCAAyC;IACzC,SAAS,CAAC,EAAE,gBAAgB,CAAA;IAC5B;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,oEAAoE;IACpE,GAAG,CAAC,EAAE,SAAS,CAAA;IACf,8DAA8D;IAC9D,KAAK,CAAC,EAAE,YAAY,CAAA;IACpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;;OAIG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;IAClB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,yFAAyF;IACzF,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAA;CACvB;AAED,wBAAgB,OAAO,CAAC,EACpB,SAAS,EACT,OAAO,EACP,GAAG,EACH,KAAK,EACL,SAAS,EACT,QAAe,EACf,IAA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AAO,CAAC,EACpB,SAAS,EACT,OAAO,EACP,GAAG,EACH,KAAK,EACL,SAAS,EACT,QAAe,EACf,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,IAAI,EACV,EAAE,YAAY,+BA+Bd"}
@@ -3,8 +3,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  // this is a server component -- see the repo blueprint, section 4.3.
4
4
  import { Surface } from '../surface/index.js';
5
5
  import { Wrapper, } from '../wrapper/index.js';
6
- export function CardBox({ direction, padding, gap, align, elevation, outlined = true, size, ring, className, style, children, ...rest }) {
7
- return (_jsx(Surface, { elevation: elevation, className: ['newtone-card-box', className].filter(Boolean).join(' '), "data-outlined": outlined ? undefined : 'false', "data-size": size, style: ring === undefined
6
+ export function CardBox({ direction, padding, gap, align, elevation, outlined = true, size, ring, href, className, style, children, ...rest }) {
7
+ return (_jsx(Surface, { as: href === undefined ? 'div' : 'a', ...(href === undefined ? {} : { href }), elevation: elevation, className: ['newtone-card-box', className].filter(Boolean).join(' '), "data-outlined": outlined ? undefined : 'false', "data-size": size, style: ring === undefined
8
8
  ? style
9
9
  : { '--newtone-card-box-ring': ring, ...style }, ...rest, children: _jsx(Wrapper, { direction: direction, gap: gap ?? (size === 'sm' ? 2 : undefined), align: align, padding: padding ?? (size === 'sm' ? 4 : size === 'lg' ? 8 : 2), className: "newtone-card-box-body", children: children }) }));
10
10
  }
@@ -1 +1 @@
1
- {"version":3,"file":"card-box.js","sourceRoot":"","sources":["../../src/card-box/card-box.tsx"],"names":[],"mappings":";AAAA,uGAAuG;AACvG,qEAAqE;AACrE,OAAO,EAAE,OAAO,EAAkB,MAAM,qBAAqB,CAAA;AAC7D,OAAO,EACH,OAAO,GAIV,MAAM,qBAAqB,CAAA;AAwI5B,MAAM,UAAU,OAAO,CAAC,EACpB,SAAS,EACT,OAAO,EACP,GAAG,EACH,KAAK,EACL,SAAS,EACT,QAAQ,GAAG,IAAI,E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,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,IAAI,EACI;IACX,OAAO,CACH,KAAC,OAAO,IACJ,EAAE,EAAE,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAEhC,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EACxC,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,CAAC,kBAAkB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,mBACrD,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,eAClC,IAAI,EACf,KAAK,EACD,IAAI,KAAK,SAAS;YACd,CAAC,CAAC,KAAK;YACP,CAAC,CAAE,EAAE,yBAAyB,EAAE,IAAI,EAAE,GAAG,KAAK,EAAoB,KAEtE,IAAI,YAKR,KAAC,OAAO,IACJ,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,GAAG,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,EAC3C,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAC/D,SAAS,EAAC,uBAAuB,YAEhC,QAAQ,GACH,GACJ,CACb,CAAA;AACL,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newtone-dev/ui-react-web",
3
- "version": "0.19.0",
3
+ "version": "0.20.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",