@pure-ds/core 0.7.46 → 0.7.48
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/custom-elements.json +193 -2
- package/dist/types/public/assets/pds/components/pds-toaster.d.ts.map +1 -1
- package/dist/types/src/js/pds-core/pds-config.d.ts +4 -5
- package/dist/types/src/js/pds-core/pds-config.d.ts.map +1 -1
- package/dist/types/src/js/pds-core/pds-enhancers.d.ts.map +1 -1
- package/dist/types/src/js/pds-core/pds-generator.d.ts +16 -2
- package/dist/types/src/js/pds-core/pds-generator.d.ts.map +1 -1
- package/dist/types/src/js/pds-core/pds-live.d.ts.map +1 -1
- package/package.json +1 -1
- package/packages/pds-cli/bin/pds-mcp-health.js +1 -1
- package/packages/pds-cli/bin/pds-mcp-server.js +1 -1
- package/packages/pds-cli/bin/pds-setup-mcp.js +1 -1
- package/packages/pds-cli/bin/templates/bootstrap/esbuild-dev.cjs +65 -6
- package/packages/pds-cli/bin/templates/bootstrap/esbuild-dev.mjs +65 -6
- package/packages/pds-cli/bin/templates/bootstrap/public/assets/js/dev-reload.js +68 -9
- package/public/assets/js/app.js +1 -1
- package/public/assets/js/pds-enhancers.js +1 -1
- package/public/assets/js/pds-manager.js +450 -275
- package/public/assets/pds/components/pds-live-edit.js +1 -1
- package/public/assets/pds/components/pds-toaster.js +30 -4
- package/public/assets/pds/core/pds-enhancers.js +1 -1
- package/public/assets/pds/core/pds-manager.js +450 -275
- package/public/assets/pds/pds-css-complete.json +544 -55
- package/public/assets/pds/pds.css-data.json +154 -0
- package/public/assets/pds/vscode-custom-data.json +30 -0
- package/readme.md +15 -1
- package/src/js/pds-core/pds-config.js +63 -10
- package/src/js/pds-core/pds-enhancers.js +6 -1
- package/src/js/pds-core/pds-generator.js +773 -212
- package/src/js/pds-core/pds-live.js +3 -4
- package/src/js/pds.js +4 -4
|
@@ -1167,6 +1167,160 @@
|
|
|
1167
1167
|
}
|
|
1168
1168
|
]
|
|
1169
1169
|
},
|
|
1170
|
+
{
|
|
1171
|
+
"name": "--color-accentInteractive-light",
|
|
1172
|
+
"description": "accentInteractive color scale - shade light",
|
|
1173
|
+
"syntax": "<color>",
|
|
1174
|
+
"references": [
|
|
1175
|
+
{
|
|
1176
|
+
"name": "Value",
|
|
1177
|
+
"url": "data:text/plain,%5Bobject%20Object%5D"
|
|
1178
|
+
}
|
|
1179
|
+
]
|
|
1180
|
+
},
|
|
1181
|
+
{
|
|
1182
|
+
"name": "--color-accentInteractive-dark",
|
|
1183
|
+
"description": "accentInteractive color scale - shade dark",
|
|
1184
|
+
"syntax": "<color>",
|
|
1185
|
+
"references": [
|
|
1186
|
+
{
|
|
1187
|
+
"name": "Value",
|
|
1188
|
+
"url": "data:text/plain,%5Bobject%20Object%5D"
|
|
1189
|
+
}
|
|
1190
|
+
]
|
|
1191
|
+
},
|
|
1192
|
+
{
|
|
1193
|
+
"name": "--color-surfaceAccent-light",
|
|
1194
|
+
"description": "surfaceAccent color scale - shade light",
|
|
1195
|
+
"syntax": "<color>",
|
|
1196
|
+
"references": [
|
|
1197
|
+
{
|
|
1198
|
+
"name": "Value",
|
|
1199
|
+
"url": "data:text/plain,%5Bobject%20Object%5D"
|
|
1200
|
+
}
|
|
1201
|
+
]
|
|
1202
|
+
},
|
|
1203
|
+
{
|
|
1204
|
+
"name": "--color-surfaceAccent-dark",
|
|
1205
|
+
"description": "surfaceAccent color scale - shade dark",
|
|
1206
|
+
"syntax": "<color>",
|
|
1207
|
+
"references": [
|
|
1208
|
+
{
|
|
1209
|
+
"name": "Value",
|
|
1210
|
+
"url": "data:text/plain,%5Bobject%20Object%5D"
|
|
1211
|
+
}
|
|
1212
|
+
]
|
|
1213
|
+
},
|
|
1214
|
+
{
|
|
1215
|
+
"name": "--color-dangerInteractive-light",
|
|
1216
|
+
"description": "dangerInteractive color scale - shade light",
|
|
1217
|
+
"syntax": "<color>",
|
|
1218
|
+
"references": [
|
|
1219
|
+
{
|
|
1220
|
+
"name": "Value",
|
|
1221
|
+
"url": "data:text/plain,%5Bobject%20Object%5D"
|
|
1222
|
+
}
|
|
1223
|
+
]
|
|
1224
|
+
},
|
|
1225
|
+
{
|
|
1226
|
+
"name": "--color-dangerInteractive-dark",
|
|
1227
|
+
"description": "dangerInteractive color scale - shade dark",
|
|
1228
|
+
"syntax": "<color>",
|
|
1229
|
+
"references": [
|
|
1230
|
+
{
|
|
1231
|
+
"name": "Value",
|
|
1232
|
+
"url": "data:text/plain,%5Bobject%20Object%5D"
|
|
1233
|
+
}
|
|
1234
|
+
]
|
|
1235
|
+
},
|
|
1236
|
+
{
|
|
1237
|
+
"name": "--color-successInteractive-light",
|
|
1238
|
+
"description": "successInteractive color scale - shade light",
|
|
1239
|
+
"syntax": "<color>",
|
|
1240
|
+
"references": [
|
|
1241
|
+
{
|
|
1242
|
+
"name": "Value",
|
|
1243
|
+
"url": "data:text/plain,%5Bobject%20Object%5D"
|
|
1244
|
+
}
|
|
1245
|
+
]
|
|
1246
|
+
},
|
|
1247
|
+
{
|
|
1248
|
+
"name": "--color-successInteractive-dark",
|
|
1249
|
+
"description": "successInteractive color scale - shade dark",
|
|
1250
|
+
"syntax": "<color>",
|
|
1251
|
+
"references": [
|
|
1252
|
+
{
|
|
1253
|
+
"name": "Value",
|
|
1254
|
+
"url": "data:text/plain,%5Bobject%20Object%5D"
|
|
1255
|
+
}
|
|
1256
|
+
]
|
|
1257
|
+
},
|
|
1258
|
+
{
|
|
1259
|
+
"name": "--color-warningInteractive-light",
|
|
1260
|
+
"description": "warningInteractive color scale - shade light",
|
|
1261
|
+
"syntax": "<color>",
|
|
1262
|
+
"references": [
|
|
1263
|
+
{
|
|
1264
|
+
"name": "Value",
|
|
1265
|
+
"url": "data:text/plain,%5Bobject%20Object%5D"
|
|
1266
|
+
}
|
|
1267
|
+
]
|
|
1268
|
+
},
|
|
1269
|
+
{
|
|
1270
|
+
"name": "--color-warningInteractive-dark",
|
|
1271
|
+
"description": "warningInteractive color scale - shade dark",
|
|
1272
|
+
"syntax": "<color>",
|
|
1273
|
+
"references": [
|
|
1274
|
+
{
|
|
1275
|
+
"name": "Value",
|
|
1276
|
+
"url": "data:text/plain,%5Bobject%20Object%5D"
|
|
1277
|
+
}
|
|
1278
|
+
]
|
|
1279
|
+
},
|
|
1280
|
+
{
|
|
1281
|
+
"name": "--color-infoInteractive-light",
|
|
1282
|
+
"description": "infoInteractive color scale - shade light",
|
|
1283
|
+
"syntax": "<color>",
|
|
1284
|
+
"references": [
|
|
1285
|
+
{
|
|
1286
|
+
"name": "Value",
|
|
1287
|
+
"url": "data:text/plain,%5Bobject%20Object%5D"
|
|
1288
|
+
}
|
|
1289
|
+
]
|
|
1290
|
+
},
|
|
1291
|
+
{
|
|
1292
|
+
"name": "--color-infoInteractive-dark",
|
|
1293
|
+
"description": "infoInteractive color scale - shade dark",
|
|
1294
|
+
"syntax": "<color>",
|
|
1295
|
+
"references": [
|
|
1296
|
+
{
|
|
1297
|
+
"name": "Value",
|
|
1298
|
+
"url": "data:text/plain,%5Bobject%20Object%5D"
|
|
1299
|
+
}
|
|
1300
|
+
]
|
|
1301
|
+
},
|
|
1302
|
+
{
|
|
1303
|
+
"name": "--color-surfaceStatus-light",
|
|
1304
|
+
"description": "surfaceStatus color scale - shade light",
|
|
1305
|
+
"syntax": "<color>",
|
|
1306
|
+
"references": [
|
|
1307
|
+
{
|
|
1308
|
+
"name": "Value",
|
|
1309
|
+
"url": "data:text/plain,%5Bobject%20Object%5D"
|
|
1310
|
+
}
|
|
1311
|
+
]
|
|
1312
|
+
},
|
|
1313
|
+
{
|
|
1314
|
+
"name": "--color-surfaceStatus-dark",
|
|
1315
|
+
"description": "surfaceStatus color scale - shade dark",
|
|
1316
|
+
"syntax": "<color>",
|
|
1317
|
+
"references": [
|
|
1318
|
+
{
|
|
1319
|
+
"name": "Value",
|
|
1320
|
+
"url": "data:text/plain,%5Bobject%20Object%5D"
|
|
1321
|
+
}
|
|
1322
|
+
]
|
|
1323
|
+
},
|
|
1170
1324
|
{
|
|
1171
1325
|
"name": "--spacing-0",
|
|
1172
1326
|
"description": "Spacing scale value 0",
|
|
@@ -769,6 +769,36 @@
|
|
|
769
769
|
"name": "pds-locale",
|
|
770
770
|
"description": "Locale switcher component.\r\n\r\nThe component only persists canonical 5-letter locale tags (`xx-YY`),\r\nfor example `en-US` and `nl-NL`.",
|
|
771
771
|
"attributes": [
|
|
772
|
+
{
|
|
773
|
+
"name": "name",
|
|
774
|
+
"description": "Form field name used during submit."
|
|
775
|
+
},
|
|
776
|
+
{
|
|
777
|
+
"name": "value",
|
|
778
|
+
"description": "Selected canonical locale tag (`xx-YY`)."
|
|
779
|
+
},
|
|
780
|
+
{
|
|
781
|
+
"name": "required",
|
|
782
|
+
"description": "Requires a locale value for validity.",
|
|
783
|
+
"valueSet": "v"
|
|
784
|
+
},
|
|
785
|
+
{
|
|
786
|
+
"name": "disabled",
|
|
787
|
+
"description": "Disables interaction and omits form value.",
|
|
788
|
+
"valueSet": "v"
|
|
789
|
+
},
|
|
790
|
+
{
|
|
791
|
+
"name": "mode",
|
|
792
|
+
"description": "Label display mode. In `compact`, the UI shows 2-letter aliases and puts the full Intl language name in the `title` attribute. In `full`, it renders the full Intl language name as the visible label.",
|
|
793
|
+
"values": [
|
|
794
|
+
{
|
|
795
|
+
"name": "compact"
|
|
796
|
+
},
|
|
797
|
+
{
|
|
798
|
+
"name": "full"
|
|
799
|
+
}
|
|
800
|
+
]
|
|
801
|
+
},
|
|
772
802
|
{
|
|
773
803
|
"name": "data-label",
|
|
774
804
|
"description": "Accessible label for the locale radio group."
|
package/readme.md
CHANGED
|
@@ -1055,6 +1055,16 @@ Validates all presets during build and reports issues:
|
|
|
1055
1055
|
[dark/btn-primary] (/colors/darkMode/primary)
|
|
1056
1056
|
```
|
|
1057
1057
|
|
|
1058
|
+
Build can also emit non-blocking identity warnings when a dark mode brand override drifts too far from the light mode hue:
|
|
1059
|
+
|
|
1060
|
+
```
|
|
1061
|
+
⚠️ Preset identity warnings (non-blocking):
|
|
1062
|
+
|
|
1063
|
+
— Travel Market
|
|
1064
|
+
• Dark mode primary hue drifts 48.6deg from light primary...
|
|
1065
|
+
[dark/identity-hue-primary] (/colors/darkMode/primary)
|
|
1066
|
+
```
|
|
1067
|
+
|
|
1058
1068
|
### Manual Validation
|
|
1059
1069
|
|
|
1060
1070
|
```javascript
|
|
@@ -1081,6 +1091,10 @@ if (!result.ok) {
|
|
|
1081
1091
|
// }
|
|
1082
1092
|
// ]
|
|
1083
1093
|
}
|
|
1094
|
+
|
|
1095
|
+
if (result.warnings?.length) {
|
|
1096
|
+
console.table(result.warnings);
|
|
1097
|
+
}
|
|
1084
1098
|
```
|
|
1085
1099
|
|
|
1086
1100
|
### Batch Validation
|
|
@@ -1337,7 +1351,7 @@ Validate design for accessibility.
|
|
|
1337
1351
|
import { validateDesign } from '@pure-ds/core/pds-core/pds-generator.js';
|
|
1338
1352
|
|
|
1339
1353
|
const result = validateDesign(config, { minContrast: 4.5 });
|
|
1340
|
-
// Returns: { ok: boolean, issues: Array }
|
|
1354
|
+
// Returns: { ok: boolean, issues: Array, warnings: Array }
|
|
1341
1355
|
```
|
|
1342
1356
|
|
|
1343
1357
|
### PDS.adoptLayers(shadowRoot, layers, additionalSheets)
|
|
@@ -19,10 +19,10 @@ import { enums } from "./pds-enums.js";
|
|
|
19
19
|
* @property {string} [secondary] - Drives neutral scale: --color-gray-50..900.
|
|
20
20
|
* @property {string} [accent] - Drives accent scale: --color-accent-50..900.
|
|
21
21
|
* @property {string} [background] - Drives surface shades: --color-surface-* and smart surfaces.
|
|
22
|
-
* @property {string | null} [success] - Drives semantic success scale: --color-success
|
|
23
|
-
* @property {string | null} [warning] - Drives semantic warning scale: --color-warning
|
|
24
|
-
* @property {string | null} [danger] - Drives semantic danger scale: --color-danger
|
|
25
|
-
* @property {string | null} [info] - Drives semantic info scale: --color-info
|
|
22
|
+
* @property {string | null} [success] - Drives semantic success scale and role tokens: --color-success-*, --color-success-fill/text/*, and --surface-*-success-text.
|
|
23
|
+
* @property {string | null} [warning] - Drives semantic warning scale and role tokens: --color-warning-*, --color-warning-fill/text/*, and --surface-*-warning-text.
|
|
24
|
+
* @property {string | null} [danger] - Drives semantic danger scale and role tokens: --color-danger-*, --color-danger-fill/text/*, and --surface-*-danger-text.
|
|
25
|
+
* @property {string | null} [info] - Drives semantic info scale and role tokens: --color-info-*, --color-info-fill/text/*, and --surface-*-info-text.
|
|
26
26
|
* @property {number} [gradientStops] - Affects generated gradient scales.
|
|
27
27
|
* @property {number} [elevationOpacity] - Affects smart surface shadows (opacity).
|
|
28
28
|
* @property {PDSDarkModeColorsConfig} [darkMode] - Overrides dark mode palette generation.
|
|
@@ -407,19 +407,71 @@ const __DESIGN_CONFIG_SPEC__ = {
|
|
|
407
407
|
},
|
|
408
408
|
success: {
|
|
409
409
|
type: ["string", "null"],
|
|
410
|
-
relations: {
|
|
410
|
+
relations: {
|
|
411
|
+
tokens: [
|
|
412
|
+
"--color-success-*",
|
|
413
|
+
"--color-success-fill",
|
|
414
|
+
"--color-success-fill-hover",
|
|
415
|
+
"--color-success-fill-active",
|
|
416
|
+
"--color-success-text",
|
|
417
|
+
"--color-success-text-hover",
|
|
418
|
+
"--color-success-contrast",
|
|
419
|
+
"--color-success-display-*",
|
|
420
|
+
"--surface-*-success-text",
|
|
421
|
+
"--surface-*-success-text-hover",
|
|
422
|
+
],
|
|
423
|
+
},
|
|
411
424
|
},
|
|
412
425
|
warning: {
|
|
413
426
|
type: ["string", "null"],
|
|
414
|
-
relations: {
|
|
427
|
+
relations: {
|
|
428
|
+
tokens: [
|
|
429
|
+
"--color-warning-*",
|
|
430
|
+
"--color-warning-fill",
|
|
431
|
+
"--color-warning-fill-hover",
|
|
432
|
+
"--color-warning-fill-active",
|
|
433
|
+
"--color-warning-text",
|
|
434
|
+
"--color-warning-text-hover",
|
|
435
|
+
"--color-warning-contrast",
|
|
436
|
+
"--color-warning-display-*",
|
|
437
|
+
"--surface-*-warning-text",
|
|
438
|
+
"--surface-*-warning-text-hover",
|
|
439
|
+
],
|
|
440
|
+
},
|
|
415
441
|
},
|
|
416
442
|
danger: {
|
|
417
443
|
type: ["string", "null"],
|
|
418
|
-
relations: {
|
|
444
|
+
relations: {
|
|
445
|
+
tokens: [
|
|
446
|
+
"--color-danger-*",
|
|
447
|
+
"--color-danger-fill",
|
|
448
|
+
"--color-danger-fill-hover",
|
|
449
|
+
"--color-danger-fill-active",
|
|
450
|
+
"--color-danger-text",
|
|
451
|
+
"--color-danger-text-hover",
|
|
452
|
+
"--color-danger-contrast",
|
|
453
|
+
"--color-danger-display-*",
|
|
454
|
+
"--surface-*-danger-text",
|
|
455
|
+
"--surface-*-danger-text-hover",
|
|
456
|
+
],
|
|
457
|
+
},
|
|
419
458
|
},
|
|
420
459
|
info: {
|
|
421
460
|
type: ["string", "null"],
|
|
422
|
-
relations: {
|
|
461
|
+
relations: {
|
|
462
|
+
tokens: [
|
|
463
|
+
"--color-info-*",
|
|
464
|
+
"--color-info-fill",
|
|
465
|
+
"--color-info-fill-hover",
|
|
466
|
+
"--color-info-fill-active",
|
|
467
|
+
"--color-info-text",
|
|
468
|
+
"--color-info-text-hover",
|
|
469
|
+
"--color-info-contrast",
|
|
470
|
+
"--color-info-display-*",
|
|
471
|
+
"--surface-*-info-text",
|
|
472
|
+
"--surface-*-info-text-hover",
|
|
473
|
+
],
|
|
474
|
+
},
|
|
423
475
|
},
|
|
424
476
|
gradientStops: { type: "number" },
|
|
425
477
|
elevationOpacity: {
|
|
@@ -1998,7 +2050,7 @@ export const presets = {
|
|
|
1998
2050
|
darkMode: {
|
|
1999
2051
|
background: "#1a1d21", // deep charcoal like WHOOP
|
|
2000
2052
|
secondary: "#78909c",
|
|
2001
|
-
primary: "#0a4ca4",
|
|
2053
|
+
//primary: "#0a4ca4",
|
|
2002
2054
|
},
|
|
2003
2055
|
},
|
|
2004
2056
|
typography: {
|
|
@@ -2106,7 +2158,8 @@ export const presets = {
|
|
|
2106
2158
|
darkMode: {
|
|
2107
2159
|
background: "#0f0f0f",
|
|
2108
2160
|
secondary: "#8a8a8a",
|
|
2109
|
-
primary: "#
|
|
2161
|
+
primary: "#b1b1b1"
|
|
2162
|
+
//primary: "#06c167", // Use bright green for dark mode buttons (was white)
|
|
2110
2163
|
},
|
|
2111
2164
|
},
|
|
2112
2165
|
typography: {
|
|
@@ -555,6 +555,11 @@ function enhanceRange(elem) {
|
|
|
555
555
|
if (hasRangeOutputClass) {
|
|
556
556
|
const labelSpan = label.querySelector("span");
|
|
557
557
|
if (labelSpan && !labelSpan.classList.contains("range-output-wrapper")) {
|
|
558
|
+
const explicitRangeLabel =
|
|
559
|
+
labelSpan.getAttribute("data-range-label") ||
|
|
560
|
+
label.getAttribute("data-range-label") ||
|
|
561
|
+
"";
|
|
562
|
+
|
|
558
563
|
const wrapper = document.createElement("span");
|
|
559
564
|
wrapper.className = "range-output-wrapper";
|
|
560
565
|
wrapper.style.display = "flex";
|
|
@@ -562,7 +567,7 @@ function enhanceRange(elem) {
|
|
|
562
567
|
wrapper.style.alignItems = "center";
|
|
563
568
|
|
|
564
569
|
const textSpan = document.createElement("span");
|
|
565
|
-
textSpan.textContent = labelSpan.textContent;
|
|
570
|
+
textSpan.textContent = explicitRangeLabel || labelSpan.textContent;
|
|
566
571
|
wrapper.appendChild(textSpan);
|
|
567
572
|
|
|
568
573
|
const output = document.createElement("output");
|