@pure-ds/storybook 0.7.46 → 0.7.53

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.
Files changed (45) hide show
  1. package/.storybook/preview.js +14 -14
  2. package/dist/pds-reference.json +271 -41
  3. package/package.json +2 -2
  4. package/public/assets/js/app.js +8 -6
  5. package/public/assets/js/pds-ask.js +6 -6
  6. package/public/assets/js/pds-enhancers.js +1 -1
  7. package/public/assets/js/pds-manager.js +511 -291
  8. package/public/assets/js/pds.js +2 -2
  9. package/public/assets/pds/components/pds-live-edit.js +1 -1
  10. package/public/assets/pds/components/pds-toaster.js +55 -11
  11. package/public/assets/pds/core/pds-ask.js +6 -6
  12. package/public/assets/pds/core/pds-enhancers.js +1 -1
  13. package/public/assets/pds/core/pds-manager.js +511 -291
  14. package/public/assets/pds/core.js +2 -2
  15. package/public/assets/pds/pds-css-complete.json +544 -55
  16. package/public/assets/pds/pds.css-data.json +154 -0
  17. package/public/assets/pds/styles/pds-components.css +12 -11
  18. package/public/assets/pds/styles/pds-components.css.js +24 -22
  19. package/public/assets/pds/styles/pds-styles.css +12 -11
  20. package/public/assets/pds/styles/pds-styles.css.js +24 -22
  21. package/public/assets/pds/vscode-custom-data.json +30 -0
  22. package/src/js/app.js +7 -4
  23. package/src/js/common/common.js +120 -23
  24. package/src/js/common/toast.js +8 -0
  25. package/src/js/pds-core/pds-config.js +63 -10
  26. package/src/js/pds-core/pds-enhancers.js +6 -1
  27. package/src/js/pds-core/pds-generator.js +823 -217
  28. package/src/js/pds-core/pds-live.js +3 -4
  29. package/src/js/pds.d.ts +19 -6
  30. package/src/js/pds.js +11 -6
  31. package/stories/components/PdsFab.stories.js +2 -2
  32. package/stories/components/PdsForm.stories.js +3 -3
  33. package/stories/components/PdsIcon.stories.js +2 -2
  34. package/stories/components/PdsRating.stories.js +1 -1
  35. package/stories/components/PdsScrollrow.stories.js +10 -10
  36. package/stories/components/PdsSplitpanel.stories.js +8 -8
  37. package/stories/foundations/Colors.stories.js +1289 -187
  38. package/stories/foundations/HTMLDefaults.stories.js +3 -3
  39. package/stories/foundations/Icons.stories.js +20 -20
  40. package/stories/foundations/SmartSurfaces.stories.js +11 -14
  41. package/stories/patterns/InteractiveStates.stories.js +5 -5
  42. package/stories/primitives/Badges.stories.js +1 -0
  43. package/stories/primitives/Cards.stories.js +3 -3
  44. package/stories/reference/pds-object-docs.js +7 -2
  45. package/stories/utils/PdsToast.stories.js +62 -1
@@ -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: { tokens: ["--color-success-*"] },
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: { tokens: ["--color-warning-*"] },
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: { tokens: ["--color-danger-*"] },
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: { tokens: ["--color-info-*"] },
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: "#06c167", // Use bright green for dark mode buttons (was white)
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");