@jirawatpyk/aura-react 5.63.0 → 5.64.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.64 — Chamber-OS addendum 80 (#179)
190
+
191
+ - **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.
192
+
189
193
  ## 5.63 — Chamber-OS addendum 79 (#178)
190
194
 
191
195
  - **A lazy chip still makes `meta` the chip row:** a Server Component's Badge or StatusPill passed through a `'use client'` wrapper can arrive as a lazy node on Next's dev server. PageHeader now looks through a resolved lazy node (a chip makes the row, text keeps the line, as when it arrives resolved), and an unresolved one is neutral — the other children decide — so the layout no longer depends on the build mode. Anything else unresolved (a promise, an iterator) keeps a line.
@@ -10171,7 +10171,8 @@ window.Aura = (() => {
10171
10171
  const pct = det ? Math.max(0, Math.min(100, props.value / max * 100)) : 0;
10172
10172
  const sec = det && props.secondaryValue != null && props.secondaryValue > 0 ? props.secondaryValue : 0;
10173
10173
  const spct = sec ? Math.max(0, Math.min(100 - pct, sec / max * 100)) : 0;
10174
- const valueText = props.valueText != null ? props.valueText : props.valueLabel != null ? String(props.valueLabel) : sec ? t.progressReserved(props.value, sec, max) : void 0;
10174
+ const keyed = !!props.legend && spct > 0;
10175
+ const valueText = props.valueText != null ? props.valueText : keyed ? t.progressReserved(props.value, sec, max) : props.valueLabel != null ? String(props.valueLabel) : sec ? t.progressReserved(props.value, sec, max) : void 0;
10175
10176
  const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
10176
10177
  return /* @__PURE__ */ React61.createElement(
10177
10178
  "div",
@@ -10206,6 +10207,7 @@ window.Aura = (() => {
10206
10207
  }
10207
10208
  ) : null
10208
10209
  ),
10210
+ keyed ? /* @__PURE__ */ React61.createElement("div", { className: "aura-progress__legend", "aria-hidden": "true" }, props.legend.value != null && props.legend.value !== false ? /* @__PURE__ */ React61.createElement("span", { className: "aura-progress__key" }, /* @__PURE__ */ React61.createElement("span", { className: "aura-progress__swatch" }), props.legend.value) : null, /* @__PURE__ */ React61.createElement("span", { className: "aura-progress__key" }, /* @__PURE__ */ React61.createElement("span", { className: "aura-progress__swatch aura-progress__swatch--reserved" }), props.legend.secondary)) : null,
10209
10211
  props.hint ? /* @__PURE__ */ React61.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
10210
10212
  );
10211
10213
  });
@@ -10153,7 +10153,8 @@ var Progress = React61.forwardRef(function Progress2(props, ref) {
10153
10153
  const pct = det ? Math.max(0, Math.min(100, props.value / max * 100)) : 0;
10154
10154
  const sec = det && props.secondaryValue != null && props.secondaryValue > 0 ? props.secondaryValue : 0;
10155
10155
  const spct = sec ? Math.max(0, Math.min(100 - pct, sec / max * 100)) : 0;
10156
- const valueText = props.valueText != null ? props.valueText : props.valueLabel != null ? String(props.valueLabel) : sec ? t.progressReserved(props.value, sec, max) : void 0;
10156
+ const keyed = !!props.legend && spct > 0;
10157
+ const valueText = props.valueText != null ? props.valueText : keyed ? t.progressReserved(props.value, sec, max) : props.valueLabel != null ? String(props.valueLabel) : sec ? t.progressReserved(props.value, sec, max) : void 0;
10157
10158
  const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
10158
10159
  return /* @__PURE__ */ React61.createElement(
10159
10160
  "div",
@@ -10188,6 +10189,7 @@ var Progress = React61.forwardRef(function Progress2(props, ref) {
10188
10189
  }
10189
10190
  ) : null
10190
10191
  ),
10192
+ keyed ? /* @__PURE__ */ React61.createElement("div", { className: "aura-progress__legend", "aria-hidden": "true" }, props.legend.value != null && props.legend.value !== false ? /* @__PURE__ */ React61.createElement("span", { className: "aura-progress__key" }, /* @__PURE__ */ React61.createElement("span", { className: "aura-progress__swatch" }), props.legend.value) : null, /* @__PURE__ */ React61.createElement("span", { className: "aura-progress__key" }, /* @__PURE__ */ React61.createElement("span", { className: "aura-progress__swatch aura-progress__swatch--reserved" }), props.legend.secondary)) : null,
10191
10193
  props.hint ? /* @__PURE__ */ React61.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
10192
10194
  );
10193
10195
  });
@@ -9,7 +9,8 @@ const Progress = React.forwardRef(function Progress2(props, ref) {
9
9
  const pct = det ? Math.max(0, Math.min(100, props.value / max * 100)) : 0;
10
10
  const sec = det && props.secondaryValue != null && props.secondaryValue > 0 ? props.secondaryValue : 0;
11
11
  const spct = sec ? Math.max(0, Math.min(100 - pct, sec / max * 100)) : 0;
12
- const valueText = props.valueText != null ? props.valueText : props.valueLabel != null ? String(props.valueLabel) : sec ? t.progressReserved(props.value, sec, max) : void 0;
12
+ const keyed = !!props.legend && spct > 0;
13
+ const valueText = props.valueText != null ? props.valueText : keyed ? t.progressReserved(props.value, sec, max) : props.valueLabel != null ? String(props.valueLabel) : sec ? t.progressReserved(props.value, sec, max) : void 0;
13
14
  const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
14
15
  return /* @__PURE__ */ React.createElement(
15
16
  "div",
@@ -44,6 +45,7 @@ const Progress = React.forwardRef(function Progress2(props, ref) {
44
45
  }
45
46
  ) : null
46
47
  ),
48
+ keyed ? /* @__PURE__ */ React.createElement("div", { className: "aura-progress__legend", "aria-hidden": "true" }, props.legend.value != null && props.legend.value !== false ? /* @__PURE__ */ React.createElement("span", { className: "aura-progress__key" }, /* @__PURE__ */ React.createElement("span", { className: "aura-progress__swatch" }), props.legend.value) : null, /* @__PURE__ */ React.createElement("span", { className: "aura-progress__key" }, /* @__PURE__ */ React.createElement("span", { className: "aura-progress__swatch aura-progress__swatch--reserved" }), props.legend.secondary)) : null,
47
49
  props.hint ? /* @__PURE__ */ React.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
48
50
  );
49
51
  });
package/dist/index.d.cts CHANGED
@@ -1653,6 +1653,14 @@ export interface ProgressProps {
1653
1653
  /** A reserved amount drawn after `value` as a striped segment of the same tone — queued sends on a quota
1654
1654
  * (5.15, Chamber-OS 89). Both counts are read out ("2 of 6 used, 1 reserved") unless `valueLabel` is given. */
1655
1655
  secondaryValue?: number | undefined;
1656
+ /** A key under the bar for its two parts (5.64, Chamber-OS 179): `{ value: 'Used', secondary: 'Reserved' }` — a
1657
+ * swatch in the bar's tone for each (`value` optional), the second striped like the reserved segment. Shown only
1658
+ * while the reserved segment is drawn; hidden from screen readers — so while it shows, the bar reads both counts
1659
+ * ("2 of 6 used, 1 reserved") even with a `valueLabel`, unless you pass `valueText`. */
1660
+ legend?: {
1661
+ value?: React$1.ReactNode;
1662
+ secondary: React$1.ReactNode;
1663
+ } | undefined;
1656
1664
  hint?: React$1.ReactNode | undefined;
1657
1665
  tone?: Tone | undefined;
1658
1666
  size?: "sm" | "md" | undefined;
package/dist/index.d.ts CHANGED
@@ -1653,6 +1653,14 @@ export interface ProgressProps {
1653
1653
  /** A reserved amount drawn after `value` as a striped segment of the same tone — queued sends on a quota
1654
1654
  * (5.15, Chamber-OS 89). Both counts are read out ("2 of 6 used, 1 reserved") unless `valueLabel` is given. */
1655
1655
  secondaryValue?: number | undefined;
1656
+ /** A key under the bar for its two parts (5.64, Chamber-OS 179): `{ value: 'Used', secondary: 'Reserved' }` — a
1657
+ * swatch in the bar's tone for each (`value` optional), the second striped like the reserved segment. Shown only
1658
+ * while the reserved segment is drawn; hidden from screen readers — so while it shows, the bar reads both counts
1659
+ * ("2 of 6 used, 1 reserved") even with a `valueLabel`, unless you pass `valueText`. */
1660
+ legend?: {
1661
+ value?: React$1.ReactNode;
1662
+ secondary: React$1.ReactNode;
1663
+ } | undefined;
1656
1664
  hint?: React$1.ReactNode | undefined;
1657
1665
  tone?: Tone | undefined;
1658
1666
  size?: "sm" | "md" | undefined;
package/dist/styles.css CHANGED
@@ -1578,13 +1578,19 @@ a.aura-upload__name:focus-visible { outline: var(--aura-focus-ring-width) solid
1578
1578
  .aura-progress__track { position: relative; height: 8px; border-radius: var(--aura-radius-full); background: var(--aura-progress-track); box-shadow: inset 0 0 0 1px var(--aura-progress-track-edge); overflow: hidden; }
1579
1579
  .aura-progress.is-sm .aura-progress__track { height: 4px; }
1580
1580
  .aura-progress__bar { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--aura-fg-accent); transition: width var(--aura-duration-base) var(--aura-ease); }
1581
- .aura-progress--success .aura-progress__bar { background: var(--aura-fg-positive); }
1582
- .aura-progress--warning .aura-progress__bar { background: var(--aura-alert-warning-fg); }
1583
- .aura-progress--danger .aura-progress__bar { background: var(--aura-fg-danger); }
1584
- .aura-progress--neutral .aura-progress__bar { background: var(--aura-fg-secondary); }
1581
+ /* 5.64 (Chamber-OS 179): legend — a swatch per part in the bar's tone, the reserved one striped like its segment. */
1582
+ .aura-progress__legend { display: flex; flex-wrap: wrap; gap: var(--aura-space-1) var(--aura-space-4); font-size: max(12px, .75rem); line-height: 1.5; color: var(--aura-fg-secondary); }
1583
+ .aura-progress__key { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
1584
+ .aura-progress__swatch { flex: none; width: 12px; height: 8px; border-radius: 2px; background: var(--aura-fg-accent); }
1585
+ .aura-progress--success :is(.aura-progress__bar, .aura-progress__swatch) { background: var(--aura-fg-positive); }
1586
+ .aura-progress--warning :is(.aura-progress__bar, .aura-progress__swatch) { background: var(--aura-alert-warning-fg); }
1587
+ .aura-progress--danger :is(.aura-progress__bar, .aura-progress__swatch) { background: var(--aura-fg-danger); }
1588
+ .aura-progress--neutral :is(.aura-progress__bar, .aura-progress__swatch) { background: var(--aura-fg-secondary); }
1585
1589
  /* 5.15 (Chamber-OS 89): a reserved amount after the value — the same tone, striped, so it reads without colour. */
1586
1590
  .aura-progress__bar--reserved {
1587
1591
  transition: left var(--aura-duration-base) var(--aura-ease), width var(--aura-duration-base) var(--aura-ease);
1592
+ }
1593
+ .aura-progress__bar--reserved, .aura-progress__swatch--reserved {
1588
1594
  -webkit-mask-image: repeating-linear-gradient(135deg, currentColor 0 3px, transparent 3px 6px);
1589
1595
  mask-image: repeating-linear-gradient(135deg, currentColor 0 3px, transparent 3px 6px);
1590
1596
  }
@@ -2545,7 +2551,7 @@ button.aura-stepper__step:hover .aura-stepper__label { text-decoration: underlin
2545
2551
  .aura-switch.is-on:disabled .aura-switch__thumb { background: Canvas; }
2546
2552
  .aura-switch-row.is-disabled .aura-choice__label { color: GrayText; }
2547
2553
  .aura-progress__track, .aura-upload__bar { border: 1px solid CanvasText; }
2548
- .aura-progress__bar, .aura-upload__bar > span { background: Highlight; forced-color-adjust: none; }
2554
+ .aura-progress :is(.aura-progress__bar, .aura-progress__swatch), .aura-upload__bar > span { background: Highlight; forced-color-adjust: none; } /* every tone (5.64) */
2549
2555
  .aura-segmented__option.is-selected { outline: 2px solid Highlight; outline-offset: -2px; }
2550
2556
  .aura-tab { border-bottom-color: Canvas; }
2551
2557
  .aura-tab.is-active { border-bottom-color: Highlight; }
@@ -1580,13 +1580,19 @@ a.aura-upload__name:focus-visible { outline: var(--aura-focus-ring-width) solid
1580
1580
  .aura-progress__track { position: relative; height: 8px; border-radius: var(--aura-radius-full); background: var(--aura-progress-track); box-shadow: inset 0 0 0 1px var(--aura-progress-track-edge); overflow: hidden; }
1581
1581
  .aura-progress.is-sm .aura-progress__track { height: 4px; }
1582
1582
  .aura-progress__bar { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--aura-fg-accent); transition: width var(--aura-duration-base) var(--aura-ease); }
1583
- .aura-progress--success .aura-progress__bar { background: var(--aura-fg-positive); }
1584
- .aura-progress--warning .aura-progress__bar { background: var(--aura-alert-warning-fg); }
1585
- .aura-progress--danger .aura-progress__bar { background: var(--aura-fg-danger); }
1586
- .aura-progress--neutral .aura-progress__bar { background: var(--aura-fg-secondary); }
1583
+ /* 5.64 (Chamber-OS 179): legend — a swatch per part in the bar's tone, the reserved one striped like its segment. */
1584
+ .aura-progress__legend { display: flex; flex-wrap: wrap; gap: var(--aura-space-1) var(--aura-space-4); font-size: max(12px, .75rem); line-height: 1.5; color: var(--aura-fg-secondary); }
1585
+ .aura-progress__key { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
1586
+ .aura-progress__swatch { flex: none; width: 12px; height: 8px; border-radius: 2px; background: var(--aura-fg-accent); }
1587
+ .aura-progress--success :is(.aura-progress__bar, .aura-progress__swatch) { background: var(--aura-fg-positive); }
1588
+ .aura-progress--warning :is(.aura-progress__bar, .aura-progress__swatch) { background: var(--aura-alert-warning-fg); }
1589
+ .aura-progress--danger :is(.aura-progress__bar, .aura-progress__swatch) { background: var(--aura-fg-danger); }
1590
+ .aura-progress--neutral :is(.aura-progress__bar, .aura-progress__swatch) { background: var(--aura-fg-secondary); }
1587
1591
  /* 5.15 (Chamber-OS 89): a reserved amount after the value — the same tone, striped, so it reads without colour. */
1588
1592
  .aura-progress__bar--reserved {
1589
1593
  transition: left var(--aura-duration-base) var(--aura-ease), width var(--aura-duration-base) var(--aura-ease);
1594
+ }
1595
+ .aura-progress__bar--reserved, .aura-progress__swatch--reserved {
1590
1596
  -webkit-mask-image: repeating-linear-gradient(135deg, currentColor 0 3px, transparent 3px 6px);
1591
1597
  mask-image: repeating-linear-gradient(135deg, currentColor 0 3px, transparent 3px 6px);
1592
1598
  }
@@ -2547,7 +2553,7 @@ button.aura-stepper__step:hover .aura-stepper__label { text-decoration: underlin
2547
2553
  .aura-switch.is-on:disabled .aura-switch__thumb { background: Canvas; }
2548
2554
  .aura-switch-row.is-disabled .aura-choice__label { color: GrayText; }
2549
2555
  .aura-progress__track, .aura-upload__bar { border: 1px solid CanvasText; }
2550
- .aura-progress__bar, .aura-upload__bar > span { background: Highlight; forced-color-adjust: none; }
2556
+ .aura-progress :is(.aura-progress__bar, .aura-progress__swatch), .aura-upload__bar > span { background: Highlight; forced-color-adjust: none; } /* every tone (5.64) */
2551
2557
  .aura-segmented__option.is-selected { outline: 2px solid Highlight; outline-offset: -2px; }
2552
2558
  .aura-tab { border-bottom-color: Canvas; }
2553
2559
  .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.63.0",
3
+ "version": "5.64.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",