@jirawatpyk/aura-react 5.1.0 → 5.2.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 +10 -0
- package/dist/aura.bundle.js +562 -183
- package/dist/cjs/index.cjs +562 -183
- package/dist/esm/AppShell.js +10 -2
- package/dist/esm/Avatar.js +4 -3
- package/dist/esm/BottomNav.js +2 -1
- package/dist/esm/Checkbox.js +3 -2
- package/dist/esm/Combobox.js +19 -19
- package/dist/esm/Command.js +1 -0
- package/dist/esm/DataTable.js +116 -29
- package/dist/esm/DatePicker.js +85 -22
- package/dist/esm/DropdownMenu.js +12 -0
- package/dist/esm/FileUpload.js +17 -1
- package/dist/esm/FormErrorSummary.js +19 -4
- package/dist/esm/Menu.js +20 -7
- package/dist/esm/NumberField.js +3 -1
- package/dist/esm/Pagination.js +3 -3
- package/dist/esm/Popover.js +26 -5
- package/dist/esm/RadioGroup.js +14 -1
- package/dist/esm/SideNav.js +2 -1
- package/dist/esm/Switch.js +1 -1
- package/dist/esm/Table.js +3 -2
- package/dist/esm/Tabs.js +11 -7
- package/dist/esm/TextField.js +2 -2
- package/dist/esm/Textarea.js +2 -2
- package/dist/esm/ThemeStyle.js +13 -3
- package/dist/esm/TimePicker.js +2 -1
- package/dist/esm/Toaster.js +1 -0
- package/dist/esm/Tooltip.js +54 -29
- package/dist/esm/colorScheme.js +7 -3
- package/dist/esm/colorSchemeScript.js +3 -3
- package/dist/esm/dates.js +34 -13
- package/dist/esm/internal.js +18 -7
- package/dist/esm/locale.js +6 -5
- package/dist/esm/strings.js +21 -0
- package/dist/esm/text.js +1 -0
- package/dist/esm/theme.js +3 -1
- package/dist/esm/useModal.js +31 -8
- package/dist/index.d.cts +1513 -0
- package/dist/index.d.ts +6 -1
- package/dist/server/index.cjs +51 -10
- package/dist/server/index.d.cts +182 -0
- package/dist/server/index.d.ts +6 -0
- package/dist/server/index.js +51 -10
- package/dist/styles.css +26 -5
- package/dist/styles.layer.css +26 -5
- package/package.json +19 -8
- package/scripts/aura-theme.mjs +31 -6
package/dist/styles.layer.css
CHANGED
|
@@ -214,7 +214,7 @@ a.aura-btn { text-decoration: none; }
|
|
|
214
214
|
|
|
215
215
|
/* Menu — popover list for column options and the column picker */
|
|
216
216
|
.aura-menu {
|
|
217
|
-
position: fixed; z-index: var(--aura-z-menu); min-width: 200px; padding: var(--aura-space-1);
|
|
217
|
+
position: fixed; z-index: var(--aura-z-menu); min-width: 200px; padding: var(--aura-space-1); overflow-y: auto; overscroll-behavior: contain;
|
|
218
218
|
background: var(--aura-bg-surface); color: var(--aura-fg-primary);
|
|
219
219
|
border: 1px solid var(--aura-border-default); border-radius: var(--aura-radius-md);
|
|
220
220
|
box-shadow: var(--aura-shadow-enterprise);
|
|
@@ -522,6 +522,8 @@ a.aura-icon-btn { text-decoration: none; }
|
|
|
522
522
|
font-family: var(--font-sans); font-size: 12px; line-height: 1.5; pointer-events: none;
|
|
523
523
|
animation: aura-fade-in var(--aura-duration-fast) var(--aura-ease);
|
|
524
524
|
}
|
|
525
|
+
/* The Tooltip component's own tips can be hovered (WCAG 1.4.13, 5.1.1); rail labels and cell tips stay click-through. */
|
|
526
|
+
.aura-tooltip--hoverable { pointer-events: auto; }
|
|
525
527
|
@keyframes aura-fade-in { from { opacity: 0; } }
|
|
526
528
|
|
|
527
529
|
/* ---------- Dialog ---------- */
|
|
@@ -679,6 +681,8 @@ a.aura-tab { text-decoration: none; }
|
|
|
679
681
|
.aura-avatar__status {
|
|
680
682
|
position: absolute; right: -1px; bottom: -1px; width: 30%; height: 30%; min-width: 8px; min-height: 8px;
|
|
681
683
|
border-radius: var(--aura-radius-full); background: var(--aura-accent-dot); box-shadow: 0 0 0 2px var(--aura-bg-surface);
|
|
684
|
+
/* 5.2: the lime fill is 1.2:1 on the white ring; the edge carries the 3:1 (WCAG 1.4.11). */
|
|
685
|
+
border: 1.5px solid var(--aura-fg-positive); box-sizing: border-box;
|
|
682
686
|
}
|
|
683
687
|
|
|
684
688
|
/* ---------- Combobox ---------- */
|
|
@@ -748,7 +752,7 @@ a.aura-tab { text-decoration: none; }
|
|
|
748
752
|
.aura-cal__day.is-outside { color: var(--aura-fg-tertiary); }
|
|
749
753
|
.aura-cal__day.is-today { box-shadow: inset 0 0 0 1px var(--aura-border-control); font-weight: 600; }
|
|
750
754
|
.aura-cal__day.is-selected { background: var(--aura-button-primary-bg); color: var(--aura-button-primary-fg); box-shadow: none; }
|
|
751
|
-
.aura-cal__day:disabled { opacity: var(--aura-disabled-opacity); cursor: not-allowed; background: transparent; text-decoration: line-through; }
|
|
755
|
+
.aura-cal__day:disabled, .aura-cal__day[aria-disabled='true'] { opacity: var(--aura-disabled-opacity); cursor: not-allowed; background: transparent; text-decoration: line-through; }
|
|
752
756
|
.aura-cal__day:focus-visible { outline: var(--aura-focus-ring-width) solid var(--aura-focus-ring); outline-offset: 1px; }
|
|
753
757
|
.aura-cal__grid td.is-in-range { background: var(--aura-bg-selected); }
|
|
754
758
|
.aura-cal__grid td.is-range-start { background: linear-gradient(to right, transparent 50%, var(--aura-bg-selected) 50%); }
|
|
@@ -921,6 +925,8 @@ button.aura-stat { font: inherit; width: 100%; cursor: pointer; }
|
|
|
921
925
|
.aura-upload__thumb.is-icon { display: inline-flex; align-items: center; justify-content: center; color: var(--aura-fg-secondary); }
|
|
922
926
|
.aura-upload__meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
|
|
923
927
|
.aura-upload__name { font-size: 13px; font-weight: 500; color: var(--aura-fg-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
928
|
+
a.aura-upload__name { color: var(--aura-fg-accent); text-decoration: underline; text-underline-offset: 2px; border-radius: var(--aura-radius-xs); }
|
|
929
|
+
a.aura-upload__name:focus-visible { outline: var(--aura-focus-ring-width) solid var(--aura-focus-ring); outline-offset: 2px; }
|
|
924
930
|
.aura-upload__sub { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--aura-fg-secondary); }
|
|
925
931
|
.aura-upload__item.is-error .aura-upload__sub { color: var(--aura-fg-danger); }
|
|
926
932
|
.aura-upload__bar { display: block; height: 4px; 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; }
|
|
@@ -1042,8 +1048,9 @@ button.aura-stat { font: inherit; width: 100%; cursor: pointer; }
|
|
|
1042
1048
|
position: fixed; z-index: var(--aura-z-menu); box-sizing: border-box; width: max-content; min-width: 200px; max-width: min(360px, calc(100vw - 16px));
|
|
1043
1049
|
background: var(--aura-bg-surface); color: var(--aura-fg-primary); border: 1px solid var(--aura-border-default); border-radius: var(--aura-radius-lg);
|
|
1044
1050
|
box-shadow: var(--aura-shadow-overlay); font-family: var(--font-sans); font-size: 14px; outline: none; animation: aura-fade-in var(--aura-duration-fast) var(--aura-ease);
|
|
1051
|
+
overflow-y: auto; overscroll-behavior: contain;
|
|
1045
1052
|
}
|
|
1046
|
-
.aura-popover__head { display: flex; align-items: center; justify-content: space-between; gap: var(--aura-space-2); padding: var(--aura-space-2) var(--aura-space-2) 0 var(--aura-space-4); }
|
|
1053
|
+
.aura-popover__head { display: flex; align-items: center; justify-content: space-between; gap: var(--aura-space-2); padding: var(--aura-space-2) var(--aura-space-2) 0 var(--aura-space-4); position: sticky; top: 0; z-index: 1; background: var(--aura-bg-surface); } /* 5.2: stays while a tall popover scrolls */
|
|
1047
1054
|
.aura-popover__title { margin: 0; font-size: 14px; font-weight: 600; }
|
|
1048
1055
|
.aura-popover__body { padding: var(--aura-space-4); }
|
|
1049
1056
|
.aura-popover__head + .aura-popover__body { padding-top: var(--aura-space-2); }
|
|
@@ -1143,7 +1150,7 @@ button.aura-stepper__step:hover .aura-stepper__label { text-decoration: underlin
|
|
|
1143
1150
|
.aura-segmented.is-full .aura-segmented__option { flex: 1 1 0; min-width: 0; }
|
|
1144
1151
|
.aura-segmented__option.is-icon { padding: 0; width: 36px; }
|
|
1145
1152
|
.aura-segmented__option:hover:not(:disabled):not(.is-selected) { color: var(--aura-fg-primary); }
|
|
1146
|
-
.aura-segmented__option.is-selected { background: var(--aura-bg-surface); color: var(--aura-fg-primary); box-shadow: var(--aura-shadow-enterprise); }
|
|
1153
|
+
.aura-segmented__option.is-selected { background: var(--aura-bg-surface); color: var(--aura-fg-primary); box-shadow: inset 0 0 0 1px var(--aura-border-control), var(--aura-shadow-enterprise); } /* 5.2: the edge marks the choice at 3:1; the fill alone was 1.04:1 on the track */
|
|
1147
1154
|
.aura-segmented__option:focus-visible { outline: var(--aura-focus-ring-width) solid var(--aura-focus-ring); outline-offset: 1px; }
|
|
1148
1155
|
.aura-segmented__option:disabled { opacity: var(--aura-disabled-opacity); cursor: default; }
|
|
1149
1156
|
.aura-segmented--sm .aura-segmented__option { height: 24px; padding: 0 var(--aura-space-3); font-size: 12px; }
|
|
@@ -1425,7 +1432,7 @@ button.aura-stepper__step:hover .aura-stepper__label { text-decoration: underlin
|
|
|
1425
1432
|
/* ---------- 4.20: DataTable width queries and cards, one markup ---------- */
|
|
1426
1433
|
/* Each .aura-table-q is the table's width × 10000 / its threshold (DataTable.tsx, Q), so `(width < 9999.5px)` is true
|
|
1427
1434
|
* exactly when the table is narrower than stackBelow or a hideBelow width — before hydration, at any width. */
|
|
1428
|
-
.aura-table-box { overflow-x: clip; }
|
|
1435
|
+
.aura-table-box { overflow-x: clip; width: 100%; } /* 5.1.1: container-type boxes have no content width; without this a table in a centred flex column collapsed to 0 */
|
|
1429
1436
|
.aura-table-q { width: calc(100% * var(--aura-q-scale)); container-type: inline-size; }
|
|
1430
1437
|
.aura-table-q--stack { container-name: aura-stack; }
|
|
1431
1438
|
.aura-table-q--h1 { container-name: aura-h1; }
|
|
@@ -1488,4 +1495,18 @@ button.aura-stepper__step:hover .aura-stepper__label { text-decoration: underlin
|
|
|
1488
1495
|
.aura-table__empty { background: var(--aura-bg-surface); border: 1px solid var(--aura-border-default); border-radius: var(--aura-radius-lg); }
|
|
1489
1496
|
}
|
|
1490
1497
|
|
|
1498
|
+
/* ---------- 5.1.1: Windows High Contrast / forced colours ---------- */
|
|
1499
|
+
/* Backgrounds are replaced in forced colours, so controls that show state only by fill get borders and system colours. */
|
|
1500
|
+
@media (forced-colors: active) {
|
|
1501
|
+
.aura-switch { border: 1px solid CanvasText; }
|
|
1502
|
+
.aura-switch__thumb { background: CanvasText; forced-color-adjust: none; }
|
|
1503
|
+
.aura-switch.is-on { background: Highlight; forced-color-adjust: none; }
|
|
1504
|
+
.aura-switch.is-on .aura-switch__thumb { background: HighlightText; }
|
|
1505
|
+
.aura-progress__track, .aura-upload__bar { border: 1px solid CanvasText; }
|
|
1506
|
+
.aura-progress__bar, .aura-upload__bar > span { background: Highlight; forced-color-adjust: none; }
|
|
1507
|
+
.aura-segmented__option.is-selected { outline: 2px solid Highlight; outline-offset: -2px; }
|
|
1508
|
+
.aura-tab { border-bottom-color: Canvas; }
|
|
1509
|
+
.aura-tab.is-active { border-bottom-color: Highlight; }
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1491
1512
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jirawatpyk/aura-react",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.2.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",
|
|
@@ -9,14 +9,24 @@
|
|
|
9
9
|
"types": "./dist/index.d.ts",
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
"import": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"default": "./dist/esm/index.js"
|
|
15
|
+
},
|
|
16
|
+
"require": {
|
|
17
|
+
"types": "./dist/index.d.cts",
|
|
18
|
+
"default": "./dist/cjs/index.cjs"
|
|
19
|
+
}
|
|
15
20
|
},
|
|
16
21
|
"./server": {
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
"import": {
|
|
23
|
+
"types": "./dist/server/index.d.ts",
|
|
24
|
+
"default": "./dist/server/index.js"
|
|
25
|
+
},
|
|
26
|
+
"require": {
|
|
27
|
+
"types": "./dist/server/index.d.cts",
|
|
28
|
+
"default": "./dist/server/index.cjs"
|
|
29
|
+
}
|
|
20
30
|
},
|
|
21
31
|
"./styles.css": "./dist/styles.css",
|
|
22
32
|
"./styles.layer.css": "./dist/styles.layer.css",
|
|
@@ -30,7 +40,8 @@
|
|
|
30
40
|
"LICENSE"
|
|
31
41
|
],
|
|
32
42
|
"sideEffects": [
|
|
33
|
-
"*.css"
|
|
43
|
+
"*.css",
|
|
44
|
+
"./dist/aura.bundle.js"
|
|
34
45
|
],
|
|
35
46
|
"scripts": {
|
|
36
47
|
"build": "node scripts/build.mjs && node scripts/sync-bundle.mjs",
|
package/scripts/aura-theme.mjs
CHANGED
|
@@ -5,17 +5,42 @@
|
|
|
5
5
|
import fs from 'node:fs';
|
|
6
6
|
import { createTheme } from '../dist/esm/theme.js';
|
|
7
7
|
|
|
8
|
+
const USAGE = 'Usage: aura-theme --brand "#0ea5e9" [--signal "#facc15"] [--primary ink|brand] [--name acme] [--selector .tenant] [--out theme.css]';
|
|
9
|
+
const KNOWN = ['brand', 'signal', 'primary', 'name', 'selector', 'out', 'help'];
|
|
10
|
+
function fail(msg) {
|
|
11
|
+
console.error('aura-theme: ' + msg + '\n' + USAGE);
|
|
12
|
+
process.exit(2);
|
|
13
|
+
}
|
|
14
|
+
/* --key value and --key=value (5.2); a value-taking option with no value is an error, not `true`. */
|
|
8
15
|
const args = {};
|
|
9
16
|
for (let i = 2; i < process.argv.length; i++) {
|
|
10
17
|
const a = process.argv[i];
|
|
11
|
-
if (a.startsWith('--'))
|
|
18
|
+
if (!a.startsWith('--')) fail('unexpected "' + a + '"');
|
|
19
|
+
const eq = a.indexOf('=');
|
|
20
|
+
const k = eq > 0 ? a.slice(2, eq) : a.slice(2);
|
|
21
|
+
if (KNOWN.indexOf(k) < 0) fail('unknown option --' + k);
|
|
22
|
+
if (k === 'help') { args.help = true; continue; }
|
|
23
|
+
const v = eq > 0 ? a.slice(eq + 1) : process.argv[i + 1] !== undefined && !process.argv[i + 1].startsWith('--') ? process.argv[++i] : undefined;
|
|
24
|
+
if (v === undefined || v === '') fail('--' + k + ' needs a value');
|
|
25
|
+
args[k] = v;
|
|
26
|
+
}
|
|
27
|
+
if (args.help) {
|
|
28
|
+
console.log(USAGE);
|
|
29
|
+
process.exit(0);
|
|
30
|
+
}
|
|
31
|
+
if (!args.brand) fail('--brand is required');
|
|
32
|
+
for (const k of ['brand', 'signal']) {
|
|
33
|
+
if (args[k] !== undefined && /^(?:[0-9a-f]{3}|[0-9a-f]{6})$/i.test(args[k])) args[k] = '#' + args[k]; /* a shell ate the # */
|
|
34
|
+
if (args[k] !== undefined && !/^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i.test(args[k])) fail('--' + k + ' must be a #rgb or #rrggbb colour (got "' + args[k] + '"; quote it in the shell: --' + k + ' "#0ea5e9")');
|
|
12
35
|
}
|
|
13
|
-
if (
|
|
14
|
-
|
|
15
|
-
|
|
36
|
+
if (args.primary !== undefined && args.primary !== 'ink' && args.primary !== 'brand') fail('--primary is ink or brand');
|
|
37
|
+
let t, css;
|
|
38
|
+
try {
|
|
39
|
+
t = createTheme({ brand: args.brand, signal: args.signal, primary: args.primary, name: args.name });
|
|
40
|
+
css = t.css(args.selector);
|
|
41
|
+
} catch (e) {
|
|
42
|
+
fail(e.message);
|
|
16
43
|
}
|
|
17
|
-
const t = createTheme({ brand: args.brand, signal: args.signal, primary: args.primary, name: args.name });
|
|
18
|
-
const css = t.css(args.selector);
|
|
19
44
|
if (args.out) fs.writeFileSync(args.out, css); else process.stdout.write(css);
|
|
20
45
|
const log = args.out ? console.log : console.error;
|
|
21
46
|
log(`\nContrast checks (${t.checks.filter((c) => c.pass).length}/${t.checks.length} pass):`);
|