@jirawatpyk/aura-react 5.27.0 → 5.29.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.
@@ -1125,23 +1125,45 @@ const DataTableImpl = React.forwardRef(function DataTable(props, ref) {
1125
1125
  /* @__PURE__ */ React.createElement("span", { key: "__sel", className: cx("aura-table__sel", nPinned && "is-pinned") }, /* @__PURE__ */ React.createElement("span", { className: "aura-skel aura-skel--box" }))
1126
1126
  );
1127
1127
  vis.forEach(function(c, j) {
1128
+ const part = cardPart(c, j);
1129
+ const action = part === "footer" || part === "actions";
1130
+ const lines = c.pill ? 1 : Math.max(1, Math.min(10, Math.floor(Number(c.skeletonLines)) || 1));
1131
+ const bar = function(n2) {
1132
+ return /* @__PURE__ */ React.createElement(
1133
+ "span",
1134
+ {
1135
+ key: n2,
1136
+ className: cx("aura-skel", c.pill && "aura-skel--pill", lines > 1 && "aura-skel--text"),
1137
+ style: c.pill ? void 0 : { width: SKELETON_WIDTHS[(i + j + n2) % SKELETON_WIDTHS.length] }
1138
+ }
1139
+ );
1140
+ };
1141
+ const bars = [];
1142
+ for (let b = 0; b < lines; b++) bars.push(bar(b));
1128
1143
  sk.push(
1129
1144
  /* @__PURE__ */ React.createElement(
1130
1145
  "span",
1131
1146
  {
1132
1147
  key: c.key,
1133
- className: cx("aura-table__td", c.align === "end" && "is-end", isPinned(c) && "is-pinned"),
1148
+ className: cx(
1149
+ "aura-table__td",
1150
+ autoRows && "aura-table__td--auto",
1151
+ c.align === "end" && "is-end",
1152
+ isPinned(c) && "is-pinned"
1153
+ ),
1134
1154
  style: cellStyle(c, j),
1135
- ...cardAttrs(c, j),
1136
- "data-label": void 0
1155
+ ...cardAttrs(c, j)
1137
1156
  },
1138
- /* @__PURE__ */ React.createElement(
1157
+ action ? /* @__PURE__ */ React.createElement(
1139
1158
  "span",
1140
1159
  {
1141
- className: cx("aura-skel", c.pill && "aura-skel--pill"),
1142
- style: c.pill ? void 0 : { width: SKELETON_WIDTHS[(i + j) % SKELETON_WIDTHS.length] }
1160
+ className: cx(
1161
+ "aura-skel aura-skel--action",
1162
+ part === "footer" && "is-footer",
1163
+ c.skeletonTouch && "is-touch"
1164
+ )
1143
1165
  }
1144
- )
1166
+ ) : lines > 1 ? /* @__PURE__ */ React.createElement("span", { className: "aura-skel-lines" }, bars) : bars[0]
1145
1167
  )
1146
1168
  );
1147
1169
  });
@@ -1150,7 +1172,16 @@ const DataTableImpl = React.forwardRef(function DataTable(props, ref) {
1150
1172
  /* @__PURE__ */ React.createElement("span", { key: "__gr", className: cx("aura-table__gutter aura-table__gutter--end", controls && "has-picker") })
1151
1173
  );
1152
1174
  skRows.push(
1153
- /* @__PURE__ */ React.createElement("div", { key: "sk" + i, className: "aura-table__row aura-table__row--skeleton", "aria-hidden": true, style: rowStyle }, sk)
1175
+ /* @__PURE__ */ React.createElement(
1176
+ "div",
1177
+ {
1178
+ key: "sk" + i,
1179
+ className: cx("aura-table__row aura-table__row--skeleton", autoRows && "aura-table__row--auto"),
1180
+ "aria-hidden": true,
1181
+ style: rowStyle
1182
+ },
1183
+ sk
1184
+ )
1154
1185
  );
1155
1186
  }
1156
1187
  } else if (!rows.length) {
package/dist/esm/Tag.js CHANGED
@@ -1,16 +1,20 @@
1
1
  'use client';
2
2
  import * as React from "react";
3
3
  import { Icon } from "./Icon.js";
4
- import { cx, devWarnOnce, omit } from "./internal.js";
4
+ import { cx, devWarnOnce, omit, useIsoLayoutEffect } from "./internal.js";
5
+ import { Tooltip } from "./Tooltip.js";
5
6
  import { useStrings } from "./locale.js";
6
7
  import { IconCheck, IconX } from "./icons.js";
7
- function textOf(node) {
8
+ function textOf(node, all) {
8
9
  if (node == null || typeof node === "boolean") return "";
9
10
  if (typeof node === "string" || typeof node === "number") return String(node);
10
- if (Array.isArray(node)) return node.map(textOf).join("");
11
+ if (Array.isArray(node))
12
+ return node.map(function(n) {
13
+ return textOf(n, all);
14
+ }).join("");
11
15
  if (React.isValidElement(node)) {
12
16
  const p = node.props;
13
- return p["aria-hidden"] === true || p["aria-hidden"] === "true" ? "" : textOf(p.children);
17
+ return !all && (p["aria-hidden"] === true || p["aria-hidden"] === "true") ? "" : textOf(p.children, all);
14
18
  }
15
19
  return "";
16
20
  }
@@ -27,9 +31,29 @@ const Tag = React.forwardRef(function Tag2(props, ref) {
27
31
  "removeLabel",
28
32
  "touchHeight"
29
33
  ]);
34
+ const textRef = React.useRef(null);
35
+ const cutState = React.useState(false), isCut = cutState[0];
36
+ const check = React.useCallback(function() {
37
+ const el = textRef.current;
38
+ if (el) cutState[1](el.scrollWidth > el.clientWidth + 1);
39
+ }, []);
40
+ useIsoLayoutEffect(check);
41
+ useIsoLayoutEffect(
42
+ function() {
43
+ const el = textRef.current;
44
+ if (!el || typeof ResizeObserver === "undefined") return;
45
+ const ro = new ResizeObserver(check);
46
+ ro.observe(el);
47
+ return function() {
48
+ ro.disconnect();
49
+ };
50
+ },
51
+ [check]
52
+ );
53
+ const fullText = isCut ? textOf(props.children, true).replace(/\s+/g, " ").trim() : "";
30
54
  const inner = [
31
55
  props.icon ? /* @__PURE__ */ React.createElement(Icon, { key: "i", name: props.icon, size: 14 }) : null,
32
- /* @__PURE__ */ React.createElement("span", { key: "t", className: "aura-tag__text" }, props.children)
56
+ /* @__PURE__ */ React.createElement("span", { key: "t", ref: textRef, className: "aura-tag__text", title: fullText || void 0 }, props.children)
33
57
  ];
34
58
  if (selectable) {
35
59
  return /* @__PURE__ */ React.createElement(
@@ -57,16 +81,19 @@ const Tag = React.forwardRef(function Tag2(props, ref) {
57
81
  "tag-remove-label",
58
82
  'Tag: the remove button has no name \u2014 its children have no text. Pass removeLabel (e.g. "Remove Acme AB").'
59
83
  );
60
- return /* @__PURE__ */ React.createElement("span", { ...rest, ref, className: cx("aura-tag", props.disabled && "is-disabled", props.className) }, inner, props.onRemove && !props.disabled ? /* @__PURE__ */ React.createElement(
61
- "button",
62
- {
63
- type: "button",
64
- className: "aura-tag__remove",
65
- "aria-label": props.removeLabel || t.remove(name),
66
- onClick: props.onRemove
67
- },
68
- /* @__PURE__ */ React.createElement(Icon, { name: /* @__PURE__ */ React.createElement(IconX, null), size: 12 })
69
- ) : null);
84
+ return /* @__PURE__ */ React.createElement("span", { ...rest, ref, className: cx("aura-tag", props.disabled && "is-disabled", props.className) }, inner, props.onRemove && !props.disabled ? function() {
85
+ const btn = /* @__PURE__ */ React.createElement(
86
+ "button",
87
+ {
88
+ type: "button",
89
+ className: "aura-tag__remove",
90
+ "aria-label": props.removeLabel || t.remove(name),
91
+ onClick: props.onRemove
92
+ },
93
+ /* @__PURE__ */ React.createElement(Icon, { name: /* @__PURE__ */ React.createElement(IconX, null), size: 12 })
94
+ );
95
+ return /* @__PURE__ */ React.createElement(Tooltip, { content: fullText, open: fullText ? void 0 : false }, btn);
96
+ }() : null);
70
97
  });
71
98
  export {
72
99
  Tag
package/dist/index.d.cts CHANGED
@@ -114,6 +114,14 @@ export interface DataTableColumn<Row extends Record<string, any> = Record<string
114
114
  * after the half-width fields (in column order; `cardOrder` doesn't move it), its label above and its text wrapping —
115
115
  * a reason with its evidence. Default: today's rule. The grid is unchanged by any of them. */
116
116
  card?: "hide" | "field" | "title" | "pill" | "footer" | "wide" | undefined;
117
+ /** How many text lines its loading skeleton draws (5.29, Chamber-OS 134) — 2 for a cell that shows two lines (a
118
+ * reason and its evidence), so the skeleton row is as tall as the real one with `rowHeight="auto"`. Default 1, at
119
+ * most 10; ignored on a `pill` column. */
120
+ skeletonLines?: number | undefined;
121
+ /** For a `card: 'footer'` or `actions` column whose buttons use `touchHeight` (5.29, Chamber-OS 134): its loading
122
+ * skeleton's bar is 44px below 640px and on a coarse pointer, as those buttons are. Without it the bar is the small
123
+ * button's 32px. */
124
+ skeletonTouch?: boolean | undefined;
117
125
  /** The order of fields in a stacked card (5.13), lowest first; the grid's column order is unchanged. Fields
118
126
  * without one sort by their column index (0-based). Screen readers and arrow keys follow the grid's order. */
119
127
  cardOrder?: number | undefined;
@@ -437,6 +445,8 @@ export interface FormErrorSummaryProps {
437
445
  /** An applied filter, shown as a removable chip. */
438
446
  export interface ActiveFilter {
439
447
  id: string;
448
+ /** The chip's text, "{filter}: {value}". It takes its own width in the chips row; only a chip wider than the row is
449
+ * cut, and then its full text shows on hover and on the remove button's focus (5.28). */
440
450
  label: React$1.ReactNode;
441
451
  onRemove: () => void;
442
452
  }
package/dist/index.d.ts CHANGED
@@ -114,6 +114,14 @@ export interface DataTableColumn<Row extends Record<string, any> = Record<string
114
114
  * after the half-width fields (in column order; `cardOrder` doesn't move it), its label above and its text wrapping —
115
115
  * a reason with its evidence. Default: today's rule. The grid is unchanged by any of them. */
116
116
  card?: "hide" | "field" | "title" | "pill" | "footer" | "wide" | undefined;
117
+ /** How many text lines its loading skeleton draws (5.29, Chamber-OS 134) — 2 for a cell that shows two lines (a
118
+ * reason and its evidence), so the skeleton row is as tall as the real one with `rowHeight="auto"`. Default 1, at
119
+ * most 10; ignored on a `pill` column. */
120
+ skeletonLines?: number | undefined;
121
+ /** For a `card: 'footer'` or `actions` column whose buttons use `touchHeight` (5.29, Chamber-OS 134): its loading
122
+ * skeleton's bar is 44px below 640px and on a coarse pointer, as those buttons are. Without it the bar is the small
123
+ * button's 32px. */
124
+ skeletonTouch?: boolean | undefined;
117
125
  /** The order of fields in a stacked card (5.13), lowest first; the grid's column order is unchanged. Fields
118
126
  * without one sort by their column index (0-based). Screen readers and arrow keys follow the grid's order. */
119
127
  cardOrder?: number | undefined;
@@ -437,6 +445,8 @@ export interface FormErrorSummaryProps {
437
445
  /** An applied filter, shown as a removable chip. */
438
446
  export interface ActiveFilter {
439
447
  id: string;
448
+ /** The chip's text, "{filter}: {value}". It takes its own width in the chips row; only a chip wider than the row is
449
+ * cut, and then its full text shows on hover and on the remove button's focus (5.28). */
440
450
  label: React$1.ReactNode;
441
451
  onRemove: () => void;
442
452
  }
package/dist/styles.css CHANGED
@@ -321,6 +321,7 @@ a.aura-icon-btn { text-decoration: none; }
321
321
  .aura-btn.aura-btn--touch.aura-btn--full { height: auto; min-height: var(--aura-touch-target); }
322
322
  .aura-icon-btn.aura-icon-btn--touch { width: var(--aura-touch-target); height: var(--aura-touch-target); }
323
323
  .aura-tag.aura-tag--touch { min-height: var(--aura-touch-target); }
324
+ .aura-filterbar__clear { min-height: var(--aura-touch-target); } /* 5.28 (Chamber-OS 133) */
324
325
  }
325
326
  /* Touch: same 32px look, a 44px hit area around it (WCAG 2.5.5). */
326
327
  @media (pointer: coarse) {
@@ -337,6 +338,16 @@ a.aura-icon-btn { text-decoration: none; }
337
338
  .aura-skel--pill { width: 72px; height: 20px; }
338
339
  .aura-skel--box { width: var(--aura-icon-sm); height: var(--aura-icon-sm); border-radius: var(--aura-radius-xs); }
339
340
  @media (prefers-reduced-motion: reduce) { .aura-skel { animation: none; } }
341
+ /* 5.29 (Chamber-OS 134): a DataTable skeleton row stands in for the real one — text lines (skeletonLines) on the 20px
342
+ * line, and a button-height bar where row actions go: 32px, or 44px under the touchHeight rule with the column's
343
+ * skeletonTouch; full width in a card footer. */
344
+ .aura-skel--action { flex: none; width: var(--aura-button-height-sm); height: var(--aura-button-height-sm); border-radius: var(--aura-radius-md); }
345
+ .aura-skel--action.is-footer { width: 100%; }
346
+ .aura-table__td.is-end > .aura-skel-lines { align-items: flex-end; }
347
+ @media (max-width: 639.98px), (pointer: coarse) {
348
+ .aura-skel--action.is-touch { height: var(--aura-touch-target); }
349
+ .aura-skel--action.is-touch:not(.is-footer) { width: var(--aura-touch-target); }
350
+ }
340
351
  .aura-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
341
352
 
342
353
  /* Empty state */
@@ -1503,6 +1514,12 @@ button.aura-stepper__step:hover .aura-stepper__label { text-decoration: underlin
1503
1514
  .aura-filterbar__count { font-size: 13px; color: var(--aura-fg-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }
1504
1515
  .aura-filterbar__actions { display: flex; align-items: center; gap: var(--aura-space-2); }
1505
1516
  .aura-filterbar__chips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--aura-space-2); }
1517
+ /* 5.28 (Chamber-OS 132): an applied-filter chip takes its text's width, cut only when it is wider than the row. */
1518
+ .aura-filterbar__chips > .aura-tag { max-width: 100%; min-width: 0; }
1519
+ /* A long chip mustn't widen the bar or anything around it: the row's width comes from the bar, never from its chips.
1520
+ * (So a FilterBar with only chips needs a width from its parent — it is full width in a block.) */
1521
+ .aura-filterbar__chips { contain: inline-size; }
1522
+ .aura-filterbar__chips > .aura-tag .aura-tag__text { max-width: none; min-width: 0; }
1506
1523
  .aura-filterbar__clear {
1507
1524
  border: 0; background: transparent; padding: 4px var(--aura-space-2); border-radius: var(--aura-radius-sm);
1508
1525
  font: inherit; font-size: 13px; font-weight: 500; color: var(--aura-fg-accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
@@ -1945,6 +1962,12 @@ button.aura-stepper__step:hover .aura-stepper__label { text-decoration: underlin
1945
1962
  /* 5.22: a footer row ends the card with no margin under it, so the card keeps its full 16px. */
1946
1963
  .aura-table__row:has(> [data-card='footer']:not(.is-blank)) { padding-bottom: var(--aura-space-4); }
1947
1964
  .aura-table__row--skeleton .aura-table__td { display: flex; }
1965
+ /* 5.29: a skeleton field shows its label above a bar on the field's value line (15px: 13px text, normal line
1966
+ * height — 1lh, so it follows the font), as a real field does; the title keeps the 20px line. */
1967
+ .aura-table__row--skeleton .aura-table__td[data-label] { flex-direction: column; align-items: stretch; }
1968
+ .aura-table__row--skeleton .aura-table__td > .aura-skel:not(.aura-skel--pill):not(.aura-skel--action) { margin: 5px 0; }
1969
+ .aura-table__row--skeleton .aura-table__td[data-label] .aura-skel:not(.aura-skel--pill):not(.aura-skel--action) { margin: 2.5px 0; margin: calc((1lh - 10px) / 2) 0; }
1970
+ .aura-table__row--skeleton .aura-table__td > .aura-skel-lines { align-items: flex-start; }
1948
1971
  .aura-table__total { background: var(--aura-bg-canvas); }
1949
1972
  .aura-table__total > .is-blank { display: none; }
1950
1973
  .aura-table__foot { border: 1px solid var(--aura-border-default); border-radius: var(--aura-radius-lg); margin-top: var(--aura-space-2); background: var(--aura-bg-surface); }
@@ -323,6 +323,7 @@ a.aura-icon-btn { text-decoration: none; }
323
323
  .aura-btn.aura-btn--touch.aura-btn--full { height: auto; min-height: var(--aura-touch-target); }
324
324
  .aura-icon-btn.aura-icon-btn--touch { width: var(--aura-touch-target); height: var(--aura-touch-target); }
325
325
  .aura-tag.aura-tag--touch { min-height: var(--aura-touch-target); }
326
+ .aura-filterbar__clear { min-height: var(--aura-touch-target); } /* 5.28 (Chamber-OS 133) */
326
327
  }
327
328
  /* Touch: same 32px look, a 44px hit area around it (WCAG 2.5.5). */
328
329
  @media (pointer: coarse) {
@@ -339,6 +340,16 @@ a.aura-icon-btn { text-decoration: none; }
339
340
  .aura-skel--pill { width: 72px; height: 20px; }
340
341
  .aura-skel--box { width: var(--aura-icon-sm); height: var(--aura-icon-sm); border-radius: var(--aura-radius-xs); }
341
342
  @media (prefers-reduced-motion: reduce) { .aura-skel { animation: none; } }
343
+ /* 5.29 (Chamber-OS 134): a DataTable skeleton row stands in for the real one — text lines (skeletonLines) on the 20px
344
+ * line, and a button-height bar where row actions go: 32px, or 44px under the touchHeight rule with the column's
345
+ * skeletonTouch; full width in a card footer. */
346
+ .aura-skel--action { flex: none; width: var(--aura-button-height-sm); height: var(--aura-button-height-sm); border-radius: var(--aura-radius-md); }
347
+ .aura-skel--action.is-footer { width: 100%; }
348
+ .aura-table__td.is-end > .aura-skel-lines { align-items: flex-end; }
349
+ @media (max-width: 639.98px), (pointer: coarse) {
350
+ .aura-skel--action.is-touch { height: var(--aura-touch-target); }
351
+ .aura-skel--action.is-touch:not(.is-footer) { width: var(--aura-touch-target); }
352
+ }
342
353
  .aura-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
343
354
 
344
355
  /* Empty state */
@@ -1505,6 +1516,12 @@ button.aura-stepper__step:hover .aura-stepper__label { text-decoration: underlin
1505
1516
  .aura-filterbar__count { font-size: 13px; color: var(--aura-fg-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }
1506
1517
  .aura-filterbar__actions { display: flex; align-items: center; gap: var(--aura-space-2); }
1507
1518
  .aura-filterbar__chips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--aura-space-2); }
1519
+ /* 5.28 (Chamber-OS 132): an applied-filter chip takes its text's width, cut only when it is wider than the row. */
1520
+ .aura-filterbar__chips > .aura-tag { max-width: 100%; min-width: 0; }
1521
+ /* A long chip mustn't widen the bar or anything around it: the row's width comes from the bar, never from its chips.
1522
+ * (So a FilterBar with only chips needs a width from its parent — it is full width in a block.) */
1523
+ .aura-filterbar__chips { contain: inline-size; }
1524
+ .aura-filterbar__chips > .aura-tag .aura-tag__text { max-width: none; min-width: 0; }
1508
1525
  .aura-filterbar__clear {
1509
1526
  border: 0; background: transparent; padding: 4px var(--aura-space-2); border-radius: var(--aura-radius-sm);
1510
1527
  font: inherit; font-size: 13px; font-weight: 500; color: var(--aura-fg-accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
@@ -1947,6 +1964,12 @@ button.aura-stepper__step:hover .aura-stepper__label { text-decoration: underlin
1947
1964
  /* 5.22: a footer row ends the card with no margin under it, so the card keeps its full 16px. */
1948
1965
  .aura-table__row:has(> [data-card='footer']:not(.is-blank)) { padding-bottom: var(--aura-space-4); }
1949
1966
  .aura-table__row--skeleton .aura-table__td { display: flex; }
1967
+ /* 5.29: a skeleton field shows its label above a bar on the field's value line (15px: 13px text, normal line
1968
+ * height — 1lh, so it follows the font), as a real field does; the title keeps the 20px line. */
1969
+ .aura-table__row--skeleton .aura-table__td[data-label] { flex-direction: column; align-items: stretch; }
1970
+ .aura-table__row--skeleton .aura-table__td > .aura-skel:not(.aura-skel--pill):not(.aura-skel--action) { margin: 5px 0; }
1971
+ .aura-table__row--skeleton .aura-table__td[data-label] .aura-skel:not(.aura-skel--pill):not(.aura-skel--action) { margin: 2.5px 0; margin: calc((1lh - 10px) / 2) 0; }
1972
+ .aura-table__row--skeleton .aura-table__td > .aura-skel-lines { align-items: flex-start; }
1950
1973
  .aura-table__total { background: var(--aura-bg-canvas); }
1951
1974
  .aura-table__total > .is-blank { display: none; }
1952
1975
  .aura-table__foot { border: 1px solid var(--aura-border-default); border-radius: var(--aura-radius-lg); margin-top: var(--aura-space-2); background: var(--aura-bg-surface); }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jirawatpyk/aura-react",
3
- "version": "5.27.0",
3
+ "version": "5.29.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",