@discourser/design-system 0.14.0 → 0.15.1

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 (90) hide show
  1. package/dist/{chunk-QC44JPCA.cjs → chunk-ABC7N32K.cjs} +316 -10
  2. package/dist/chunk-ABC7N32K.cjs.map +1 -0
  3. package/dist/{chunk-F7LHARS4.js → chunk-GD6Q2FUE.js} +447 -7
  4. package/dist/chunk-GD6Q2FUE.js.map +1 -0
  5. package/dist/{chunk-M7J7WKJY.js → chunk-SBKRSXSZ.js} +317 -11
  6. package/dist/chunk-SBKRSXSZ.js.map +1 -0
  7. package/dist/{chunk-QP4EJI3G.cjs → chunk-UNWXE6UB.cjs} +450 -2
  8. package/dist/chunk-UNWXE6UB.cjs.map +1 -0
  9. package/dist/components/Breadcrumb.d.ts +9 -0
  10. package/dist/components/Breadcrumb.d.ts.map +1 -0
  11. package/dist/components/Checkbox.d.ts +17 -17
  12. package/dist/components/Icons/ClockIcon.d.ts +6 -0
  13. package/dist/components/Icons/ClockIcon.d.ts.map +1 -0
  14. package/dist/components/Icons/GripDotsVerticalIcon.d.ts +6 -0
  15. package/dist/components/Icons/GripDotsVerticalIcon.d.ts.map +1 -0
  16. package/dist/components/Icons/index.d.ts +3 -0
  17. package/dist/components/Icons/index.d.ts.map +1 -0
  18. package/dist/components/ScenarioQueue/AddScenarioDialog.d.ts +16 -0
  19. package/dist/components/ScenarioQueue/AddScenarioDialog.d.ts.map +1 -0
  20. package/dist/components/ScenarioQueue/ScenarioCard.d.ts +10 -0
  21. package/dist/components/ScenarioQueue/ScenarioCard.d.ts.map +1 -0
  22. package/dist/components/ScenarioQueue/ScenarioCardDraggable.d.ts +15 -0
  23. package/dist/components/ScenarioQueue/ScenarioCardDraggable.d.ts.map +1 -0
  24. package/dist/components/ScenarioQueue/ScenarioQueue.d.ts +3 -0
  25. package/dist/components/ScenarioQueue/ScenarioQueue.d.ts.map +1 -0
  26. package/dist/components/ScenarioQueue/index.d.ts +6 -0
  27. package/dist/components/ScenarioQueue/index.d.ts.map +1 -0
  28. package/dist/components/ScenarioQueue/types.d.ts +56 -0
  29. package/dist/components/ScenarioQueue/types.d.ts.map +1 -0
  30. package/dist/components/index.cjs +65 -33
  31. package/dist/components/index.d.ts +4 -0
  32. package/dist/components/index.d.ts.map +1 -1
  33. package/dist/components/index.js +1 -1
  34. package/dist/index.cjs +69 -37
  35. package/dist/index.js +2 -2
  36. package/dist/preset/index.cjs +2 -2
  37. package/dist/preset/index.d.ts.map +1 -1
  38. package/dist/preset/index.js +1 -1
  39. package/dist/preset/recipes/avatar.d.ts.map +1 -1
  40. package/dist/preset/recipes/breadcrumb.d.ts +2 -0
  41. package/dist/preset/recipes/breadcrumb.d.ts.map +1 -0
  42. package/dist/preset/recipes/checkbox.d.ts.map +1 -1
  43. package/dist/preset/recipes/field.d.ts.map +1 -1
  44. package/dist/preset/recipes/index.d.ts +3 -0
  45. package/dist/preset/recipes/index.d.ts.map +1 -1
  46. package/dist/preset/recipes/progress.d.ts.map +1 -1
  47. package/dist/preset/recipes/radio-group.d.ts.map +1 -1
  48. package/dist/preset/recipes/scenario-card.d.ts +2 -0
  49. package/dist/preset/recipes/scenario-card.d.ts.map +1 -0
  50. package/dist/preset/recipes/scenario-queue.d.ts +2 -0
  51. package/dist/preset/recipes/scenario-queue.d.ts.map +1 -0
  52. package/dist/preset/recipes/steps.d.ts.map +1 -1
  53. package/dist/preset/recipes/toast.d.ts.map +1 -1
  54. package/dist/preset/recipes/tooltip.d.ts.map +1 -1
  55. package/dist/preset/semantic-tokens.d.ts +12 -0
  56. package/dist/preset/semantic-tokens.d.ts.map +1 -1
  57. package/package.json +33 -24
  58. package/src/components/Breadcrumb.tsx +34 -0
  59. package/src/components/Icons/ClockIcon.tsx +40 -0
  60. package/src/components/Icons/GripDotsVerticalIcon.tsx +26 -0
  61. package/src/components/Icons/index.ts +2 -0
  62. package/src/components/ScenarioQueue/AddScenarioDialog.tsx +137 -0
  63. package/src/components/ScenarioQueue/ScenarioCard.tsx +120 -0
  64. package/src/components/ScenarioQueue/ScenarioCardDraggable.tsx +41 -0
  65. package/src/components/ScenarioQueue/ScenarioQueue.test.tsx +398 -0
  66. package/src/components/ScenarioQueue/ScenarioQueue.tsx +162 -0
  67. package/src/components/ScenarioQueue/index.ts +11 -0
  68. package/src/components/ScenarioQueue/types.ts +86 -0
  69. package/src/components/index.ts +19 -0
  70. package/src/preset/__tests__/translation-component-completeness.test.ts +349 -0
  71. package/src/preset/__tests__/translation-token-accuracy.test.ts +349 -0
  72. package/src/preset/index.ts +9 -0
  73. package/src/preset/recipes/avatar.ts +1 -2
  74. package/src/preset/recipes/breadcrumb.ts +77 -0
  75. package/src/preset/recipes/checkbox.ts +1 -2
  76. package/src/preset/recipes/field.ts +1 -2
  77. package/src/preset/recipes/index.ts +7 -0
  78. package/src/preset/recipes/progress.ts +1 -2
  79. package/src/preset/recipes/radio-group.ts +1 -2
  80. package/src/preset/recipes/scenario-card.ts +151 -0
  81. package/src/preset/recipes/scenario-queue.ts +99 -0
  82. package/src/preset/recipes/steps.ts +1 -2
  83. package/src/preset/recipes/toast.ts +1 -2
  84. package/src/preset/recipes/tooltip.ts +1 -2
  85. package/src/preset/semantic-tokens.ts +4 -0
  86. package/src/test/setup.ts +12 -0
  87. package/dist/chunk-F7LHARS4.js.map +0 -1
  88. package/dist/chunk-M7J7WKJY.js.map +0 -1
  89. package/dist/chunk-QC44JPCA.cjs.map +0 -1
  90. package/dist/chunk-QP4EJI3G.cjs.map +0 -1
@@ -770,6 +770,10 @@ var m3SemanticTokens = dev.defineSemanticTokens.colors({
770
770
  inverseSurface: { value: { base: semantic.inverseSurface, _dark: semanticDark.inverseSurface } },
771
771
  inverseOnSurface: { value: { base: semantic.inverseOnSurface, _dark: semanticDark.inverseOnSurface } },
772
772
  inversePrimary: { value: { base: semantic.inversePrimary, _dark: semanticDark.inversePrimary } },
773
+ // Not standard M3 tokens, but follow inversePrimary's pattern:
774
+ // light mode = dark-palette value, dark mode = light-palette value.
775
+ inverseSecondary: { value: { base: semanticDark.secondary, _dark: semantic.secondary } },
776
+ inverseTertiary: { value: { base: semanticDark.tertiary, _dark: semantic.tertiary } },
773
777
  // Scrim/Shadow
774
778
  scrim: { value: { base: semantic.scrim, _dark: semanticDark.scrim } }
775
779
  });
@@ -1093,7 +1097,7 @@ var inputGroup = dev.defineSlotRecipe({
1093
1097
  });
1094
1098
  var field = dev.defineSlotRecipe({
1095
1099
  className: "field",
1096
- slots: anatomy.fieldAnatomy.keys(),
1100
+ slots: ["root", "errorText", "helperText", "input", "label", "select", "textarea", "requiredIndicator"],
1097
1101
  base: {
1098
1102
  root: {
1099
1103
  display: "flex",
@@ -1795,6 +1799,79 @@ var tabs = dev.defineSlotRecipe({
1795
1799
  variant: "line"
1796
1800
  }
1797
1801
  });
1802
+ var breadcrumb = dev.defineSlotRecipe({
1803
+ className: "breadcrumb",
1804
+ slots: ["root", "list", "link", "item", "separator", "ellipsis"],
1805
+ base: {
1806
+ list: {
1807
+ alignItems: "center",
1808
+ display: "flex",
1809
+ listStyle: "none",
1810
+ wordBreak: "break-word"
1811
+ },
1812
+ link: {
1813
+ alignItems: "center",
1814
+ borderRadius: "l1",
1815
+ display: "inline-flex",
1816
+ focusRing: "outside",
1817
+ gap: "2",
1818
+ outline: "0",
1819
+ textDecoration: "none",
1820
+ transition: "color",
1821
+ _icon: { boxSize: "1em" }
1822
+ },
1823
+ item: {
1824
+ display: "inline-flex",
1825
+ alignItems: "center",
1826
+ color: "fg.muted",
1827
+ _last: {
1828
+ color: "fg.default"
1829
+ }
1830
+ },
1831
+ separator: {
1832
+ color: "fg.subtle",
1833
+ _icon: { boxSize: "1em" },
1834
+ _rtl: { rotate: "180deg" }
1835
+ },
1836
+ ellipsis: {
1837
+ alignItems: "center",
1838
+ color: "fg.muted",
1839
+ display: "inline-flex",
1840
+ justifyContent: "center",
1841
+ _icon: { boxSize: "1em" }
1842
+ }
1843
+ },
1844
+ variants: {
1845
+ variant: {
1846
+ underline: {
1847
+ link: {
1848
+ textDecoration: "underline",
1849
+ textDecorationThickness: "0.1em",
1850
+ textUnderlineOffset: "0.125em",
1851
+ textDecorationColor: "fg.subtle",
1852
+ _hover: { textDecorationColor: "fg.default" }
1853
+ }
1854
+ },
1855
+ plain: {
1856
+ link: {
1857
+ color: "fg.muted",
1858
+ _hover: { color: "fg.default" },
1859
+ _currentPage: { color: "fg.default" }
1860
+ }
1861
+ }
1862
+ },
1863
+ size: {
1864
+ xs: { list: { gap: "1", textStyle: "xs" } },
1865
+ sm: { list: { gap: "1", textStyle: "sm" } },
1866
+ md: { list: { gap: "1.5", textStyle: "md" } },
1867
+ lg: { list: { gap: "2", textStyle: "lg" } }
1868
+ }
1869
+ },
1870
+ defaultVariants: {
1871
+ variant: "plain",
1872
+ size: "md"
1873
+ }
1874
+ });
1798
1875
  var switchRecipe = dev.defineSlotRecipe({
1799
1876
  className: "switchComponent",
1800
1877
  jsx: ["Switch", /Switch\.+/],
@@ -1929,7 +2006,7 @@ var switchRecipe = dev.defineSlotRecipe({
1929
2006
  }
1930
2007
  });
1931
2008
  var checkbox = dev.defineSlotRecipe({
1932
- slots: anatomy.checkboxAnatomy.keys(),
2009
+ slots: ["root", "label", "control", "indicator", "group"],
1933
2010
  className: "checkbox",
1934
2011
  base: {
1935
2012
  root: {
@@ -2032,7 +2109,7 @@ var checkbox = dev.defineSlotRecipe({
2032
2109
  });
2033
2110
  var radioGroup = dev.defineSlotRecipe({
2034
2111
  className: "radio-group",
2035
- slots: anatomy.radioGroupAnatomy.keys(),
2112
+ slots: ["root", "label", "item", "itemText", "itemControl", "indicator"],
2036
2113
  base: {
2037
2114
  root: {
2038
2115
  display: "flex",
@@ -2550,7 +2627,7 @@ var slider = dev.defineSlotRecipe({
2550
2627
  });
2551
2628
  var avatar = dev.defineSlotRecipe({
2552
2629
  className: "avatar",
2553
- slots: anatomy.avatarAnatomy.keys(),
2630
+ slots: ["root", "image", "fallback"],
2554
2631
  base: {
2555
2632
  root: {
2556
2633
  display: "inline-flex",
@@ -2745,7 +2822,7 @@ var badge = dev.defineRecipe({
2745
2822
  }
2746
2823
  });
2747
2824
  var progress = dev.defineSlotRecipe({
2748
- slots: anatomy.progressAnatomy.keys(),
2825
+ slots: ["root", "label", "track", "range", "valueText", "view", "circle", "circleTrack", "circleRange"],
2749
2826
  className: "progress",
2750
2827
  base: {
2751
2828
  root: {
@@ -2915,7 +2992,7 @@ var skeleton = dev.defineRecipe({
2915
2992
  });
2916
2993
  var toast = dev.defineSlotRecipe({
2917
2994
  className: "toast",
2918
- slots: anatomy.toastAnatomy.keys(),
2995
+ slots: ["group", "root", "title", "description", "actionTrigger", "closeTrigger"],
2919
2996
  base: {
2920
2997
  root: {
2921
2998
  alignItems: "start",
@@ -3189,7 +3266,7 @@ var popover = dev.defineSlotRecipe({
3189
3266
  });
3190
3267
  var tooltip = dev.defineSlotRecipe({
3191
3268
  className: "tooltip",
3192
- slots: anatomy.tooltipAnatomy.keys(),
3269
+ slots: ["trigger", "arrow", "arrowTip", "positioner", "content"],
3193
3270
  base: {
3194
3271
  content: {
3195
3272
  "--tooltip-bg": "colors.gray.solid.bg",
@@ -3452,6 +3529,231 @@ var stepper = dev.defineSlotRecipe({
3452
3529
  colorPalette: "primary"
3453
3530
  }
3454
3531
  });
3532
+ var scenarioCard = dev.defineSlotRecipe({
3533
+ className: "scenario-card",
3534
+ // Slots cover only scenario-specific styling.
3535
+ // Base card appearance (bg, border, borderRadius, overflow) comes from
3536
+ // Card.Root variant="outline" via the card slot recipe.
3537
+ // Layout structure (flex, gap, alignment) comes from Panda CSS JSX primitives.
3538
+ slots: ["root", "positionBadge", "dragHandle", "title", "switchRow", "switchLabel", "difficultyBadge", "durationBadge"],
3539
+ base: {
3540
+ root: {
3541
+ // Left accent border — inactive cards use transparent to preserve card width.
3542
+ borderLeftWidth: "3px",
3543
+ borderLeftStyle: "solid",
3544
+ borderLeftColor: "transparent",
3545
+ // Custom purple-tinted shadow from Figma spec (0px 2px 8px 0px rgba(167,139,250,0.15)).
3546
+ // This overrides Card.Root variant="elevated" (M3 level4) which is too heavy.
3547
+ // Raw value intentional: this non-standard shadow has no M3 elevation equivalent.
3548
+ boxShadow: "0px 2px 8px 0px rgba(167, 139, 250, 0.15)",
3549
+ // Figma cards use neutral/99 (#FDFCF5) — a warm off-white.
3550
+ // neutral.surface.bg resolves to white (#FFFFFF) in light mode, so we override.
3551
+ bg: "neutral.1",
3552
+ transition: "border-color",
3553
+ transitionDuration: "normal"
3554
+ },
3555
+ // Circle primitive handles: w/h (size="12"), borderRadius:full, flex centering.
3556
+ // Recipe handles: visual appearance (border, color, font).
3557
+ positionBadge: {
3558
+ fontSize: "md",
3559
+ fontWeight: "semibold",
3560
+ flexShrink: 0,
3561
+ borderWidth: "1px",
3562
+ borderStyle: "solid",
3563
+ borderColor: "neutral.6",
3564
+ color: "fg.default",
3565
+ bg: "transparent",
3566
+ transition: "all",
3567
+ transitionDuration: "normal"
3568
+ },
3569
+ dragHandle: {
3570
+ display: "flex",
3571
+ alignItems: "center",
3572
+ justifyContent: "center",
3573
+ // TODO: Create semantic token (e.g. colors.icon.subdued) that maps to secondary.6
3574
+ // Using palette bridge value directly until semantic token is defined
3575
+ color: "secondary.6",
3576
+ cursor: "grab",
3577
+ flexShrink: 0,
3578
+ width: "9",
3579
+ height: "10",
3580
+ _active: { cursor: "grabbing" }
3581
+ },
3582
+ title: {
3583
+ width: "full",
3584
+ fontSize: "sm",
3585
+ fontWeight: "semibold",
3586
+ lineHeight: "1.4",
3587
+ color: "fg.default"
3588
+ },
3589
+ // HStack handles: display:flex, alignItems:center, justifyContent:space-between.
3590
+ switchRow: {
3591
+ width: "full",
3592
+ pt: "1",
3593
+ mt: "1"
3594
+ },
3595
+ switchLabel: {
3596
+ fontSize: "sm",
3597
+ color: "fg.muted",
3598
+ fontWeight: "medium"
3599
+ },
3600
+ // Difficulty pill: M3 container tokens selected by data-difficulty attribute.
3601
+ // Default (beginner) = primaryContainer; overridden for intermediate/advanced.
3602
+ difficultyBadge: {
3603
+ display: "inline-flex",
3604
+ alignItems: "center",
3605
+ borderRadius: "l2",
3606
+ px: "2",
3607
+ h: "5",
3608
+ fontSize: "xs",
3609
+ fontWeight: "medium",
3610
+ bg: "m3Primary.container",
3611
+ color: "onM3Primary.container",
3612
+ '&[data-difficulty="intermediate"]': {
3613
+ bg: "m3Secondary.container",
3614
+ color: "onM3Secondary.container"
3615
+ },
3616
+ '&[data-difficulty="advanced"]': {
3617
+ bg: "m3Tertiary.container",
3618
+ color: "onM3Tertiary.container"
3619
+ }
3620
+ },
3621
+ // Duration pill: per-difficulty inverse palette colors.
3622
+ // Default (beginner): inversePrimary → semanticDark.primary (#B1D18A light, #4C662B dark)
3623
+ // Intermediate: inverseSecondary → semanticDark.secondary (#BFCBAD light, #586249 dark)
3624
+ // Advanced: inverseTertiary → semanticDark.tertiary (#A0D0CB light, #386663 dark)
3625
+ durationBadge: {
3626
+ display: "inline-flex",
3627
+ alignItems: "center",
3628
+ gap: "1",
3629
+ borderRadius: "l2",
3630
+ px: "2",
3631
+ h: "5",
3632
+ fontSize: "xs",
3633
+ fontWeight: "medium",
3634
+ bg: "inversePrimary",
3635
+ color: "onSurface",
3636
+ '&[data-difficulty="intermediate"]': {
3637
+ bg: "inverseSecondary"
3638
+ },
3639
+ '&[data-difficulty="advanced"]': {
3640
+ bg: "inverseTertiary"
3641
+ }
3642
+ }
3643
+ },
3644
+ variants: {
3645
+ isActive: {
3646
+ true: {
3647
+ root: {
3648
+ borderLeftColor: "primary.6"
3649
+ },
3650
+ positionBadge: {
3651
+ bg: "primary.6",
3652
+ color: "white",
3653
+ borderColor: "primary.6"
3654
+ }
3655
+ },
3656
+ false: {}
3657
+ },
3658
+ isDragging: {
3659
+ true: {
3660
+ root: {
3661
+ opacity: "0.4"
3662
+ }
3663
+ },
3664
+ false: {}
3665
+ }
3666
+ },
3667
+ defaultVariants: {
3668
+ isActive: false,
3669
+ isDragging: false
3670
+ }
3671
+ });
3672
+ var scenarioQueue = dev.defineSlotRecipe({
3673
+ className: "scenario-queue",
3674
+ description: "Panel component with tabs and draggable scenario cards",
3675
+ slots: [
3676
+ "root",
3677
+ "header",
3678
+ "title",
3679
+ "count",
3680
+ "tabsInner",
3681
+ "tabList",
3682
+ "tabsContent",
3683
+ "scrollArea",
3684
+ "emptyState",
3685
+ "addButtonArea",
3686
+ "addButton"
3687
+ ],
3688
+ base: {
3689
+ root: {
3690
+ display: "flex",
3691
+ flexDirection: "column",
3692
+ h: "full",
3693
+ minH: "320px",
3694
+ minW: "250px",
3695
+ maxW: "300px",
3696
+ overflow: "hidden",
3697
+ bg: "surface"
3698
+ },
3699
+ header: {
3700
+ px: "4",
3701
+ pt: "4",
3702
+ pb: "2",
3703
+ flexShrink: 0
3704
+ },
3705
+ title: {
3706
+ fontWeight: "semibold",
3707
+ fontSize: "md",
3708
+ color: "fg.default"
3709
+ },
3710
+ count: {
3711
+ fontSize: "xs",
3712
+ color: "fg.muted",
3713
+ mt: "0.5"
3714
+ },
3715
+ // Applied directly to Tabs.Root className — handles the flex column growth
3716
+ // and scroll containment without a redundant wrapper div.
3717
+ tabsInner: {
3718
+ flex: "1",
3719
+ minHeight: "0",
3720
+ overflow: "hidden",
3721
+ display: "flex",
3722
+ flexDirection: "column"
3723
+ },
3724
+ tabList: {
3725
+ px: "4",
3726
+ flexShrink: 0
3727
+ },
3728
+ // Applied to each Tabs.Content — allows independent scrolling per tab.
3729
+ tabsContent: {
3730
+ flex: "1",
3731
+ minHeight: "0",
3732
+ overflowY: "auto"
3733
+ },
3734
+ // Block layout so cards size to natural height and the container scrolls.
3735
+ scrollArea: {
3736
+ px: "4",
3737
+ py: "3",
3738
+ "& > * + *": { marginTop: "6" }
3739
+ },
3740
+ // Center primitive handles the flex centering; recipe provides spacing/text.
3741
+ emptyState: {
3742
+ py: "12",
3743
+ fontSize: "sm",
3744
+ color: "fg.muted"
3745
+ },
3746
+ addButtonArea: {
3747
+ px: "4",
3748
+ pb: "4",
3749
+ pt: "2",
3750
+ flexShrink: 0
3751
+ },
3752
+ addButton: {
3753
+ width: "full"
3754
+ }
3755
+ }
3756
+ });
3455
3757
  var layerStyles = dev.defineLayerStyles({
3456
3758
  disabled: {
3457
3759
  value: {
@@ -3598,6 +3900,8 @@ var discourserPandaPreset = dev.definePreset({
3598
3900
  accordion,
3599
3901
  drawer,
3600
3902
  tabs,
3903
+ // Navigation
3904
+ breadcrumb,
3601
3905
  // Form Elements
3602
3906
  switchComponent: switchRecipe,
3603
3907
  checkbox,
@@ -3613,7 +3917,9 @@ var discourserPandaPreset = dev.definePreset({
3613
3917
  popover,
3614
3918
  tooltip,
3615
3919
  // Custom Components
3616
- stepper
3920
+ stepper,
3921
+ scenarioCard,
3922
+ scenarioQueue
3617
3923
  }
3618
3924
  }
3619
3925
  },
@@ -3637,5 +3943,5 @@ var discourserPandaPreset = dev.definePreset({
3637
3943
  exports.discourserPandaPreset = discourserPandaPreset;
3638
3944
  exports.material3Language = material3Language;
3639
3945
  exports.transformToPandaTheme = transformToPandaTheme;
3640
- //# sourceMappingURL=chunk-QC44JPCA.cjs.map
3641
- //# sourceMappingURL=chunk-QC44JPCA.cjs.map
3946
+ //# sourceMappingURL=chunk-ABC7N32K.cjs.map
3947
+ //# sourceMappingURL=chunk-ABC7N32K.cjs.map