@jirawatpyk/aura-react 5.64.0 → 5.65.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/README.md CHANGED
@@ -186,6 +186,10 @@ DataTable with sort and page in the URL (4.17): `onStateChange={({ sort, page })
186
186
  - **Time zone**: `timeZone` on AuraProvider, DatePicker, DateRangePicker and Calendar decides "today" (the marker, `min`/`max="today"`, the first month shown); or pass `today` as an ISO date. `todayIn('Asia/Bangkok')` is exported from the root and `/server`.
187
187
  - **Toasts** queue past three instead of dropping: six in a row all show, in order, three at a time.
188
188
 
189
+ ## 5.65 — Chamber-OS addendum 81 (#180)
190
+
191
+ - **A pressed IconButton looks on:** an IconButton with `aria-pressed="true"` — or the new `pressed` prop, which sets `aria-pressed` for you — draws the selected fill (`aura-bg-selected`, as a selected Tag or nav item) with an accent icon (`aura-fg-accent`, at least 3:1 on it in light and dark); `tone` is ignored while pressed. Hover still shows on a pressed one (an accent hairline inside), an `outline` toggle takes an accent border, a pressed menu trigger stays on while its menu is open, and the focus ring is unchanged. In forced colours a pressed toggle is Highlight with a CanvasText focus ring. `pressed={false}`, no prop and `aria-pressed="mixed"` draw as before. Inside a field the reveal eye of PasswordField (which uses `aria-pressed`) stays quiet. On a selected DataTable row, which has the same fill, only the accent icon shows it. For an editor toolbar's Bold / Italic / lists; drop `aria-pressed:bg-… aria-pressed:text-…` stand-ins.
192
+
189
193
  ## 5.64 — Chamber-OS addendum 80 (#179)
190
194
 
191
195
  - **Progress `legend` — a key for the reserved part:** `legend={{ value: 'Used', secondary: 'Reserved (in review or scheduled)' }}` draws a key under the bar (above the `hint`): a swatch in the bar's tone for each part (`value` is optional), the second striped like the reserved segment, so it follows `tone="danger"`. It shows only while the reserved segment is drawn and wraps on a phone. It is `aria-hidden`, so while it shows the bar reads both counts ("2 of 6 used, 1 reserved") even when you pass a `valueLabel` — pass `valueText` to word it yourself. In forced colours the bar and the swatches use Highlight in every tone (before 5.64 a toned bar kept its colour). Drop a hand-drawn key that copies the stripe.
@@ -1649,7 +1649,7 @@ window.Aura = (() => {
1649
1649
 
1650
1650
  // src/IconButton.tsx
1651
1651
  var IconButton = React8.forwardRef(function IconButton2(props, ref) {
1652
- const rest = omit(props, ["icon", "label", "className", "size", "tone", "touchHeight", "variant"]);
1652
+ const rest = omit(props, ["icon", "label", "className", "size", "tone", "touchHeight", "variant", "pressed"]);
1653
1653
  useAutoTip();
1654
1654
  const own = props.title !== void 0;
1655
1655
  return /* @__PURE__ */ React8.createElement(
@@ -1659,6 +1659,7 @@ window.Aura = (() => {
1659
1659
  ref,
1660
1660
  type: props.type || "button",
1661
1661
  "aria-label": props.label,
1662
+ "aria-pressed": props.pressed != null ? props.pressed : props["aria-pressed"],
1662
1663
  "data-aura-tip": own ? void 0 : props.label,
1663
1664
  className: cx(
1664
1665
  "aura-icon-btn",
@@ -1631,7 +1631,7 @@ function useAutoTip() {
1631
1631
 
1632
1632
  // src/IconButton.tsx
1633
1633
  var IconButton = React8.forwardRef(function IconButton2(props, ref) {
1634
- const rest = omit(props, ["icon", "label", "className", "size", "tone", "touchHeight", "variant"]);
1634
+ const rest = omit(props, ["icon", "label", "className", "size", "tone", "touchHeight", "variant", "pressed"]);
1635
1635
  useAutoTip();
1636
1636
  const own = props.title !== void 0;
1637
1637
  return /* @__PURE__ */ React8.createElement(
@@ -1641,6 +1641,7 @@ var IconButton = React8.forwardRef(function IconButton2(props, ref) {
1641
1641
  ref,
1642
1642
  type: props.type || "button",
1643
1643
  "aria-label": props.label,
1644
+ "aria-pressed": props.pressed != null ? props.pressed : props["aria-pressed"],
1644
1645
  "data-aura-tip": own ? void 0 : props.label,
1645
1646
  className: cx(
1646
1647
  "aura-icon-btn",
@@ -4,7 +4,7 @@ import { cx, omit } from "./internal.js";
4
4
  import { Icon } from "./Icon.js";
5
5
  import { useAutoTip } from "./autoTip.js";
6
6
  const IconButton = React.forwardRef(function IconButton2(props, ref) {
7
- const rest = omit(props, ["icon", "label", "className", "size", "tone", "touchHeight", "variant"]);
7
+ const rest = omit(props, ["icon", "label", "className", "size", "tone", "touchHeight", "variant", "pressed"]);
8
8
  useAutoTip();
9
9
  const own = props.title !== void 0;
10
10
  return /* @__PURE__ */ React.createElement(
@@ -14,6 +14,7 @@ const IconButton = React.forwardRef(function IconButton2(props, ref) {
14
14
  ref,
15
15
  type: props.type || "button",
16
16
  "aria-label": props.label,
17
+ "aria-pressed": props.pressed != null ? props.pressed : props["aria-pressed"],
17
18
  "data-aura-tip": own ? void 0 : props.label,
18
19
  className: cx(
19
20
  "aura-icon-btn",
package/dist/index.d.cts CHANGED
@@ -384,6 +384,9 @@ export interface IconButtonProps extends React$1.ButtonHTMLAttributes<HTMLButton
384
384
  /** 44×44 instead of 32×32 below 640px (the viewport's) or wherever the primary pointer is coarse (a tablet, 5.24) —
385
385
  * a phone sheet's close button, a card's ⋯ trigger (5.15, Chamber-OS 100). */
386
386
  touchHeight?: boolean | undefined;
387
+ /** A toggle (5.65, Chamber-OS 180): sets `aria-pressed`, and a pressed button draws as on — the selected fill and the
388
+ * accent icon. Omit for an ordinary button. An `aria-pressed` you pass draws the same. */
389
+ pressed?: boolean | undefined;
387
390
  }
388
391
  export interface MenuItem {
389
392
  label?: string | undefined;
package/dist/index.d.ts CHANGED
@@ -384,6 +384,9 @@ export interface IconButtonProps extends React$1.ButtonHTMLAttributes<HTMLButton
384
384
  /** 44×44 instead of 32×32 below 640px (the viewport's) or wherever the primary pointer is coarse (a tablet, 5.24) —
385
385
  * a phone sheet's close button, a card's ⋯ trigger (5.15, Chamber-OS 100). */
386
386
  touchHeight?: boolean | undefined;
387
+ /** A toggle (5.65, Chamber-OS 180): sets `aria-pressed`, and a pressed button draws as on — the selected fill and the
388
+ * accent icon. Omit for an ordinary button. An `aria-pressed` you pass draws the same. */
389
+ pressed?: boolean | undefined;
387
390
  }
388
391
  export interface MenuItem {
389
392
  label?: string | undefined;
package/dist/styles.css CHANGED
@@ -358,6 +358,13 @@ a.aura-icon-btn { text-decoration: none; }
358
358
  .aura-icon-btn--outline { box-sizing: border-box; border: 1px solid var(--aura-button-secondary-border); } /* 5.44 (Chamber-OS 149): reads as a button beside outlined ones */
359
359
  .aura-icon-btn--danger:hover { background: var(--aura-alert-danger-bg); }
360
360
  .aura-icon-btn:disabled { opacity: var(--aura-disabled-opacity); pointer-events: none; }
361
+ /* 5.65 (Chamber-OS 180): a toggle (aria-pressed="true", or the pressed prop) looks on — the selected fill and the
362
+ * accent icon — and hover still shows on top of it (an accent hairline inside). Outline toggles take an accent border.
363
+ * The focus ring is unchanged. Not inside a field: PasswordField's reveal eye (aria-pressed) stays quiet (5.30 #14).
364
+ * One class stronger than the open-menu fill, so a pressed menu trigger stays on while its menu is open. */
365
+ .aura-icon-btn[aria-pressed="true"]:not(.aura-input *) { background: var(--aura-bg-selected); color: var(--aura-fg-accent); }
366
+ .aura-icon-btn[aria-pressed="true"]:not(.aura-input *):hover { background: var(--aura-bg-selected); box-shadow: inset 0 0 0 1px var(--aura-fg-accent); }
367
+ .aura-icon-btn--outline[aria-pressed="true"]:not(.aura-input *) { border-color: var(--aura-fg-accent); }
361
368
  .aura-icon-btn:focus-visible { outline: var(--aura-focus-ring-width) solid var(--aura-focus-ring); outline-offset: var(--aura-focus-ring-offset); }
362
369
  /* 5.15 (Chamber-OS 100): touchHeight — visibly 44px on phones, for buttons and icon buttons a phone design wants full size.
363
370
  * 5.24 (Chamber-OS 123): also wherever the primary pointer is coarse — a tablet at 768–1366px is a finger, not a mouse.
@@ -2552,6 +2559,9 @@ button.aura-stepper__step:hover .aura-stepper__label { text-decoration: underlin
2552
2559
  .aura-switch-row.is-disabled .aura-choice__label { color: GrayText; }
2553
2560
  .aura-progress__track, .aura-upload__bar { border: 1px solid CanvasText; }
2554
2561
  .aura-progress :is(.aura-progress__bar, .aura-progress__swatch), .aura-upload__bar > span { background: Highlight; forced-color-adjust: none; } /* every tone (5.64) */
2562
+ .aura-icon-btn[aria-pressed="true"]:not(.aura-input *) { background: Highlight; color: HighlightText; forced-color-adjust: none; } /* 5.65 */
2563
+ .aura-icon-btn[aria-pressed="true"]:not(.aura-input *):hover { box-shadow: inset 0 0 0 1px HighlightText; }
2564
+ .aura-icon-btn[aria-pressed="true"]:not(.aura-input *):focus-visible { outline-color: CanvasText; }
2555
2565
  .aura-segmented__option.is-selected { outline: 2px solid Highlight; outline-offset: -2px; }
2556
2566
  .aura-tab { border-bottom-color: Canvas; }
2557
2567
  .aura-tab.is-active { border-bottom-color: Highlight; }
@@ -360,6 +360,13 @@ a.aura-icon-btn { text-decoration: none; }
360
360
  .aura-icon-btn--outline { box-sizing: border-box; border: 1px solid var(--aura-button-secondary-border); } /* 5.44 (Chamber-OS 149): reads as a button beside outlined ones */
361
361
  .aura-icon-btn--danger:hover { background: var(--aura-alert-danger-bg); }
362
362
  .aura-icon-btn:disabled { opacity: var(--aura-disabled-opacity); pointer-events: none; }
363
+ /* 5.65 (Chamber-OS 180): a toggle (aria-pressed="true", or the pressed prop) looks on — the selected fill and the
364
+ * accent icon — and hover still shows on top of it (an accent hairline inside). Outline toggles take an accent border.
365
+ * The focus ring is unchanged. Not inside a field: PasswordField's reveal eye (aria-pressed) stays quiet (5.30 #14).
366
+ * One class stronger than the open-menu fill, so a pressed menu trigger stays on while its menu is open. */
367
+ .aura-icon-btn[aria-pressed="true"]:not(.aura-input *) { background: var(--aura-bg-selected); color: var(--aura-fg-accent); }
368
+ .aura-icon-btn[aria-pressed="true"]:not(.aura-input *):hover { background: var(--aura-bg-selected); box-shadow: inset 0 0 0 1px var(--aura-fg-accent); }
369
+ .aura-icon-btn--outline[aria-pressed="true"]:not(.aura-input *) { border-color: var(--aura-fg-accent); }
363
370
  .aura-icon-btn:focus-visible { outline: var(--aura-focus-ring-width) solid var(--aura-focus-ring); outline-offset: var(--aura-focus-ring-offset); }
364
371
  /* 5.15 (Chamber-OS 100): touchHeight — visibly 44px on phones, for buttons and icon buttons a phone design wants full size.
365
372
  * 5.24 (Chamber-OS 123): also wherever the primary pointer is coarse — a tablet at 768–1366px is a finger, not a mouse.
@@ -2554,6 +2561,9 @@ button.aura-stepper__step:hover .aura-stepper__label { text-decoration: underlin
2554
2561
  .aura-switch-row.is-disabled .aura-choice__label { color: GrayText; }
2555
2562
  .aura-progress__track, .aura-upload__bar { border: 1px solid CanvasText; }
2556
2563
  .aura-progress :is(.aura-progress__bar, .aura-progress__swatch), .aura-upload__bar > span { background: Highlight; forced-color-adjust: none; } /* every tone (5.64) */
2564
+ .aura-icon-btn[aria-pressed="true"]:not(.aura-input *) { background: Highlight; color: HighlightText; forced-color-adjust: none; } /* 5.65 */
2565
+ .aura-icon-btn[aria-pressed="true"]:not(.aura-input *):hover { box-shadow: inset 0 0 0 1px HighlightText; }
2566
+ .aura-icon-btn[aria-pressed="true"]:not(.aura-input *):focus-visible { outline-color: CanvasText; }
2557
2567
  .aura-segmented__option.is-selected { outline: 2px solid Highlight; outline-offset: -2px; }
2558
2568
  .aura-tab { border-bottom-color: Canvas; }
2559
2569
  .aura-tab.is-active { border-bottom-color: Highlight; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jirawatpyk/aura-react",
3
- "version": "5.64.0",
3
+ "version": "5.65.0",
4
4
  "description": "AURA Design System — React components (Enterprise Standard, Human Creative). Thai-first: Buddhist-era dates, Thai collation.",
5
5
  "license": "MIT",
6
6
  "type": "module",