@jirawatpyk/aura-tokens 5.10.0 → 5.11.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/aura-tailwind.css +1 -1
- package/aura-tailwind.prefixed.css +1 -1
- package/aura.css +1 -1
- package/components/aura.bundle.js +30 -5
- package/components/aura.components.css +34 -2
- package/components/index.d.ts +8 -1
- package/package.json +1 -1
- package/tokens.json +1 -1
package/aura-tailwind.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* AURA v5.
|
|
1
|
+
/* AURA v5.11.0 — Tailwind v4 theme. GENERATED by scripts/build-tokens.mts from tokens.json. Do not edit by hand.
|
|
2
2
|
* @import "tailwindcss";
|
|
3
3
|
* @import "@jirawatpyk/aura-tokens/tailwind.css";
|
|
4
4
|
* Gives bg-bg-surface, text-fg-primary, border-border-strong, p-aura-6, rounded-aura-xl, shadow-aura-overlay,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* AURA v5.
|
|
1
|
+
/* AURA v5.11.0 — Tailwind v4 theme with aura- prefixed names. GENERATED by scripts/build-tokens.mts. Do not edit by hand.
|
|
2
2
|
* For apps that already have a Tailwind theme (shadcn): nothing here redefines an existing name.
|
|
3
3
|
* @layer aura-tokens, theme, base, aura, components, utilities;
|
|
4
4
|
* @import "tailwindcss";
|
package/aura.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* AURA v5.
|
|
1
|
+
/* AURA v5.11.0 — GENERATED by scripts/build-tokens.mts from tokens.json. Do not edit by hand. */
|
|
2
2
|
/* Fonts: load aura-fonts.css (or the <link> tags in README) separately, so a blocked Google Fonts never breaks this file. */
|
|
3
3
|
|
|
4
4
|
:root, [data-theme="light"] {
|
|
@@ -1524,7 +1524,7 @@ window.Aura = (() => {
|
|
|
1524
1524
|
checked: on,
|
|
1525
1525
|
tabIndex: props.tabIndex,
|
|
1526
1526
|
disabled: props.disabled,
|
|
1527
|
-
"aria-describedby": descId,
|
|
1527
|
+
"aria-describedby": cx(props["aria-describedby"], descId) || void 0,
|
|
1528
1528
|
"aria-label": labelled ? void 0 : props.label,
|
|
1529
1529
|
onChange: function(e) {
|
|
1530
1530
|
st[1](e.target.checked);
|
|
@@ -3883,6 +3883,16 @@ window.Aura = (() => {
|
|
|
3883
3883
|
|
|
3884
3884
|
// src/Tag.tsx
|
|
3885
3885
|
var React24 = __toESM(require_react(), 1);
|
|
3886
|
+
function textOf(node) {
|
|
3887
|
+
if (node == null || typeof node === "boolean") return "";
|
|
3888
|
+
if (typeof node === "string" || typeof node === "number") return String(node);
|
|
3889
|
+
if (Array.isArray(node)) return node.map(textOf).join("");
|
|
3890
|
+
if (React24.isValidElement(node)) {
|
|
3891
|
+
const p = node.props;
|
|
3892
|
+
return p["aria-hidden"] === true || p["aria-hidden"] === "true" ? "" : textOf(p.children);
|
|
3893
|
+
}
|
|
3894
|
+
return "";
|
|
3895
|
+
}
|
|
3886
3896
|
var Tag = React24.forwardRef(function Tag2(props, ref) {
|
|
3887
3897
|
const t = useStrings();
|
|
3888
3898
|
const selectable = props.onClick != null || props.selected != null;
|
|
@@ -3906,12 +3916,18 @@ window.Aura = (() => {
|
|
|
3906
3916
|
inner[1]
|
|
3907
3917
|
);
|
|
3908
3918
|
}
|
|
3919
|
+
const name = props.onRemove && !props.removeLabel ? textOf(props.children).replace(/\s+/g, " ").trim() : "";
|
|
3920
|
+
if (props.onRemove && !props.disabled && !props.removeLabel && !name)
|
|
3921
|
+
devWarnOnce(
|
|
3922
|
+
"tag-remove-label",
|
|
3923
|
+
'Tag: the remove button has no name \u2014 its children have no text. Pass removeLabel (e.g. "Remove Acme AB").'
|
|
3924
|
+
);
|
|
3909
3925
|
return /* @__PURE__ */ React24.createElement("span", { ...rest, ref, className: cx("aura-tag", props.disabled && "is-disabled", props.className) }, inner, props.onRemove && !props.disabled ? /* @__PURE__ */ React24.createElement(
|
|
3910
3926
|
"button",
|
|
3911
3927
|
{
|
|
3912
3928
|
type: "button",
|
|
3913
3929
|
className: "aura-tag__remove",
|
|
3914
|
-
"aria-label": props.removeLabel || t.remove(
|
|
3930
|
+
"aria-label": props.removeLabel || t.remove(name),
|
|
3915
3931
|
onClick: props.onRemove
|
|
3916
3932
|
},
|
|
3917
3933
|
/* @__PURE__ */ React24.createElement(Icon, { name: /* @__PURE__ */ React24.createElement(IconX, null), size: 12 })
|
|
@@ -4980,6 +4996,12 @@ window.Aura = (() => {
|
|
|
4980
4996
|
return rowHref ? /* @__PURE__ */ React30.createElement(Link, { href: rowHref(r), className: "aura-table__row-link" }, content) : content;
|
|
4981
4997
|
}
|
|
4982
4998
|
const height = props.height || 0;
|
|
4999
|
+
const autoRows = props.rowHeight === "auto" && !height;
|
|
5000
|
+
if (props.rowHeight === "auto" && height)
|
|
5001
|
+
devWarnOnce(
|
|
5002
|
+
"table-row-height-auto",
|
|
5003
|
+
'DataTable `rowHeight="auto"` is ignored with `height`: virtualized rows are one fixed height. Drop `height` (and paginate) to let rows grow.'
|
|
5004
|
+
);
|
|
4983
5005
|
const virtual = !!height && !loading && pageRows.length > 0 && !stacked;
|
|
4984
5006
|
const stickyTotal = !!(props.footer && props.stickyFooter && rows.length && !loading);
|
|
4985
5007
|
const bodyH = Math.max(ROW_H, height - ROW_H - (stickyTotal ? ROW_H : 0));
|
|
@@ -5504,6 +5526,7 @@ window.Aura = (() => {
|
|
|
5504
5526
|
}
|
|
5505
5527
|
function rowCells(r, i, k, isSel) {
|
|
5506
5528
|
const ri = i + 1;
|
|
5529
|
+
const selLabel = selectable && canSelect(r) ? props.rowSelectLabel && props.rowSelectLabel(r) || t.selectRow(k) : void 0;
|
|
5507
5530
|
const cells = [/* @__PURE__ */ React30.createElement("span", { key: "__gl", className: "aura-table__gutter", "aria-hidden": true })];
|
|
5508
5531
|
if (selectable)
|
|
5509
5532
|
cells.push(
|
|
@@ -5516,7 +5539,7 @@ window.Aura = (() => {
|
|
|
5516
5539
|
className: cx("aura-table__sel", nPinned && "is-pinned"),
|
|
5517
5540
|
tabIndex: tabFor(ri, 0),
|
|
5518
5541
|
"data-rc": ri + ":0",
|
|
5519
|
-
"aria-label": canSelect(r) ?
|
|
5542
|
+
"aria-label": canSelect(r) ? selLabel : props.rowSelectDisabledLabel ? props.rowSelectDisabledLabel(r) : void 0,
|
|
5520
5543
|
onFocus: function(e) {
|
|
5521
5544
|
if (e.target === e.currentTarget) activeState[1]({ r: ri, c: 0 });
|
|
5522
5545
|
}
|
|
@@ -5527,7 +5550,7 @@ window.Aura = (() => {
|
|
|
5527
5550
|
hideLabel: true,
|
|
5528
5551
|
checked: isSel,
|
|
5529
5552
|
tabIndex: -1,
|
|
5530
|
-
label:
|
|
5553
|
+
label: selLabel,
|
|
5531
5554
|
onChange: function(on) {
|
|
5532
5555
|
toggle(k, on);
|
|
5533
5556
|
}
|
|
@@ -5548,6 +5571,7 @@ window.Aura = (() => {
|
|
|
5548
5571
|
"data-rc": ri + ":" + ci,
|
|
5549
5572
|
className: cx(
|
|
5550
5573
|
"aura-table__td",
|
|
5574
|
+
autoRows && "aura-table__td--auto",
|
|
5551
5575
|
c.mono && "aura-table__mono",
|
|
5552
5576
|
c.align === "end" && "is-end",
|
|
5553
5577
|
pin && "is-pinned",
|
|
@@ -5559,7 +5583,7 @@ window.Aura = (() => {
|
|
|
5559
5583
|
if (activeState[0].r !== ri || activeState[0].c !== ci) activeState[1]({ r: ri, c: ci });
|
|
5560
5584
|
}
|
|
5561
5585
|
},
|
|
5562
|
-
j === 0 ? rowLinkWrap(r, cellContent(c, r)) : cellContent(c, r)
|
|
5586
|
+
autoRows ? /* @__PURE__ */ React30.createElement("span", { className: "aura-table__cell" }, j === 0 ? rowLinkWrap(r, cellContent(c, r)) : cellContent(c, r)) : j === 0 ? rowLinkWrap(r, cellContent(c, r)) : cellContent(c, r)
|
|
5563
5587
|
)
|
|
5564
5588
|
);
|
|
5565
5589
|
});
|
|
@@ -5638,6 +5662,7 @@ window.Aura = (() => {
|
|
|
5638
5662
|
"aria-selected": selectable && canSelect(r) ? isSel : void 0,
|
|
5639
5663
|
className: cx(
|
|
5640
5664
|
"aura-table__row",
|
|
5665
|
+
autoRows && "aura-table__row--auto",
|
|
5641
5666
|
isSel && "is-selected",
|
|
5642
5667
|
(props.onRowActivate || rowHref) && "is-actionable"
|
|
5643
5668
|
),
|
|
@@ -130,7 +130,21 @@ a.aura-btn { text-decoration: none; }
|
|
|
130
130
|
box-sizing: border-box; height: 100%; line-height: calc(var(--aura-table-row-height) - 1px);
|
|
131
131
|
overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: var(--aura-space-4);
|
|
132
132
|
}
|
|
133
|
-
|
|
133
|
+
/* 5.11 rowHeight="auto" (never virtualized): a row grows to fit what wraps in it; each cell centres its content.
|
|
134
|
+
* The padding only shows once content is taller than the row: a small Button or IconButton (32px), a pill or one line
|
|
135
|
+
* still fits the density's row height (7.5px above and below at 48px, 3.5px compact). */
|
|
136
|
+
.aura-table__row--auto { height: auto; min-height: var(--aura-table-row-height); }
|
|
137
|
+
.aura-table__td--auto {
|
|
138
|
+
--aura-cell-pad-y: clamp(0px, calc((var(--aura-table-row-height) - 1px - var(--aura-button-height-sm)) / 2), var(--aura-space-2));
|
|
139
|
+
display: flex; align-items: center; height: auto; line-height: 20px; white-space: normal;
|
|
140
|
+
padding-top: var(--aura-cell-pad-y); padding-bottom: var(--aura-cell-pad-y);
|
|
141
|
+
}
|
|
142
|
+
.aura-table__cell { flex: 1 1 auto; min-width: 0; overflow-wrap: break-word; }
|
|
143
|
+
/* Badges and pills side by side keep apart when they wrap onto a second line. */
|
|
144
|
+
.aura-table__cell > .aura-badge, .aura-table__cell > .aura-pill { vertical-align: middle; margin-top: 2px; margin-bottom: 2px; }
|
|
145
|
+
.aura-table__cell > .aura-badge:not(:last-child), .aura-table__cell > .aura-pill:not(:last-child) { margin-inline-end: var(--aura-space-1); }
|
|
146
|
+
.aura-table__td .aura-pill, .aura-table__td .aura-dropdown, .aura-table__td > .aura-icon-btn, .aura-table__td > .aura-btn,
|
|
147
|
+
.aura-table__cell > .aura-icon-btn, .aura-table__cell > .aura-btn { vertical-align: middle; }
|
|
134
148
|
.aura-table__th { position: relative; box-sizing: border-box; display: flex; align-items: center; padding-right: var(--aura-space-2); }
|
|
135
149
|
/* Column sizes come from custom properties set per cell (4.20), so the card layout can override them. */
|
|
136
150
|
.aura-table__th, .aura-table__td { flex: var(--aura-cell-flex, none); width: var(--aura-cell-w, auto); min-width: var(--aura-cell-min, 0); }
|
|
@@ -153,6 +167,10 @@ a.aura-btn { text-decoration: none; }
|
|
|
153
167
|
|
|
154
168
|
/* Selection column */
|
|
155
169
|
.aura-table__sel { width: var(--aura-table-select-width); flex: none; display: flex; align-items: center; background: inherit; }
|
|
170
|
+
/* 5.11: the selection box's invisible input reaches 24×24 (WCAG 2.5.8) around the 16px box it draws. Its left edge
|
|
171
|
+
* overlaps the sticky 24px gutter, so it sits one layer up — unless the column has scrolled under that gutter. */
|
|
172
|
+
.aura-table__sel .aura-check__input { inset: calc((var(--aura-icon-sm) - 24px) / 2); z-index: 2; }
|
|
173
|
+
.aura-table.is-scrolled-x .aura-table__sel:not(.is-pinned) .aura-check__input { z-index: auto; }
|
|
156
174
|
.aura-table__sel.is-pinned { position: sticky; left: var(--aura-space-6); z-index: 2; }
|
|
157
175
|
|
|
158
176
|
/* Pinned columns */
|
|
@@ -466,7 +484,13 @@ a.aura-icon-btn { text-decoration: none; }
|
|
|
466
484
|
.aura-radio-group.is-invalid .aura-radio:not(:checked) { border-color: var(--aura-border-danger); }
|
|
467
485
|
|
|
468
486
|
.aura-switch-row { display: flex; align-items: flex-start; gap: var(--aura-space-3); font-family: var(--font-sans); }
|
|
469
|
-
.
|
|
487
|
+
/* 5.10.1: disabled rows, on or off, are treated alike and stay readable — the label turns secondary, the description
|
|
488
|
+
* keeps its colour (often the reason it's locked) — and only the switch fades: off to the disabled opacity, on to 0.75,
|
|
489
|
+
* ≥3:1 apart in both themes, so "locked on" never looks like "off". */
|
|
490
|
+
.aura-switch-row.is-disabled { cursor: not-allowed; }
|
|
491
|
+
.aura-switch-row.is-disabled .aura-choice__label { color: var(--aura-fg-secondary); cursor: not-allowed; }
|
|
492
|
+
.aura-switch:disabled { opacity: var(--aura-disabled-opacity); }
|
|
493
|
+
.aura-switch.is-on:disabled { opacity: 0.75; }
|
|
470
494
|
.aura-switch {
|
|
471
495
|
position: relative; flex: none; box-sizing: border-box; margin: 0; padding: 0;
|
|
472
496
|
width: var(--aura-switch-width); height: var(--aura-switch-height); border-radius: var(--aura-radius-full);
|
|
@@ -1574,6 +1598,9 @@ button.aura-stepper__step:hover .aura-stepper__label { text-decoration: underlin
|
|
|
1574
1598
|
padding: 0; line-height: normal;
|
|
1575
1599
|
}
|
|
1576
1600
|
.aura-table__td[data-hide], .aura-table__head > .aura-table__th[data-hide] { display: block; }
|
|
1601
|
+
/* 5.11: rowHeight="auto" leaves cards as they are. */
|
|
1602
|
+
.aura-table__td--auto { display: block; white-space: nowrap; }
|
|
1603
|
+
.aura-table__td--auto .aura-table__cell > .aura-badge, .aura-table__td--auto .aura-table__cell > .aura-pill { margin: 0; }
|
|
1577
1604
|
.aura-table__spacer { display: none; }
|
|
1578
1605
|
.aura-table__td[data-label]::before {
|
|
1579
1606
|
content: attr(data-label); content: attr(data-label) / '';
|
|
@@ -1601,6 +1628,11 @@ button.aura-stepper__step:hover .aura-stepper__label { text-decoration: underlin
|
|
|
1601
1628
|
.aura-switch__thumb { background: CanvasText; forced-color-adjust: none; }
|
|
1602
1629
|
.aura-switch.is-on { background: Highlight; forced-color-adjust: none; }
|
|
1603
1630
|
.aura-switch.is-on .aura-switch__thumb { background: HighlightText; }
|
|
1631
|
+
.aura-switch:disabled, .aura-switch.is-on:disabled { border-color: GrayText; opacity: 1; }
|
|
1632
|
+
.aura-switch:disabled .aura-switch__thumb { background: GrayText; }
|
|
1633
|
+
.aura-switch.is-on:disabled { background: GrayText; }
|
|
1634
|
+
.aura-switch.is-on:disabled .aura-switch__thumb { background: Canvas; }
|
|
1635
|
+
.aura-switch-row.is-disabled .aura-choice__label { color: GrayText; }
|
|
1604
1636
|
.aura-progress__track, .aura-upload__bar { border: 1px solid CanvasText; }
|
|
1605
1637
|
.aura-progress__bar, .aura-upload__bar > span { background: Highlight; forced-color-adjust: none; }
|
|
1606
1638
|
.aura-segmented__option.is-selected { outline: 2px solid Highlight; outline-offset: -2px; }
|
package/components/index.d.ts
CHANGED
|
@@ -129,6 +129,9 @@ export interface DataTableProps<Row extends Record<string, any> = Record<string,
|
|
|
129
129
|
isRowSelectable?: RowCallback<boolean, Row> | undefined;
|
|
130
130
|
/** Accessible name for a rejected row's empty cell, e.g. `(r) => 'Not awaiting review'` (5.6). */
|
|
131
131
|
rowSelectDisabledLabel?: RowCallback<string, Row> | undefined;
|
|
132
|
+
/** Accessible name for a row's checkbox (and its cell), e.g. `(r) => 'Select ' + r.company` (5.11). Default: the
|
|
133
|
+
* `selectRow` string with the row key ("Select M-102"), also used when this returns an empty string. */
|
|
134
|
+
rowSelectLabel?: RowCallback<string, Row> | undefined;
|
|
132
135
|
/** Controlled selection (row keys); pair with onSelectionChange. */
|
|
133
136
|
selected?: Array<string | number> | undefined;
|
|
134
137
|
/** Initial selection when uncontrolled. */
|
|
@@ -175,6 +178,10 @@ export interface DataTableProps<Row extends Record<string, any> = Record<string,
|
|
|
175
178
|
onRowActivate?: RowCallback<void, Row> | undefined;
|
|
176
179
|
/** Fixed height in px: sticky header, and only the rows in view are rendered. */
|
|
177
180
|
height?: number | undefined;
|
|
181
|
+
/** `'auto'` (5.11): rows grow to fit content that wraps (two badges, a long name); cells stay vertically centred and
|
|
182
|
+
* rows keep at least the density's row height. Needs every row in the DOM, so it is ignored with `height`
|
|
183
|
+
* (virtualized rows are one fixed height). Default: one fixed-height line per row, long text ends in an ellipsis. */
|
|
184
|
+
rowHeight?: "auto" | undefined;
|
|
178
185
|
/** Column menu on every header, drag-to-reorder, and the show/hide columns button. */
|
|
179
186
|
columnControls?: boolean | undefined;
|
|
180
187
|
/** Set false to keep column controls but turn off reordering. */
|
|
@@ -256,7 +263,7 @@ export interface CheckboxProps extends Omit<React$1.InputHTMLAttributes<HTMLInpu
|
|
|
256
263
|
hideLabel?: boolean | undefined;
|
|
257
264
|
/** The visible label beside the box. */
|
|
258
265
|
children?: React$1.ReactNode | undefined;
|
|
259
|
-
/** Second line under the visible label
|
|
266
|
+
/** Second line under the visible label, linked by `aria-describedby` after any id you pass there (5.11). */
|
|
260
267
|
description?: React$1.ReactNode | undefined;
|
|
261
268
|
onChange?: ((checked: boolean) => void) | undefined;
|
|
262
269
|
disabled?: boolean | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jirawatpyk/aura-tokens",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.11.0",
|
|
4
4
|
"description": "AURA Design System — tokens (CSS variables, Tailwind preset, Figma variables), theme contrast checks and token lint.",
|
|
5
5
|
"main": "tailwind.tokens.cjs",
|
|
6
6
|
"types": "components/index.d.ts",
|
package/tokens.json
CHANGED