@okshaun/components 3.0.0 → 4.1.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.
Files changed (69) hide show
  1. package/dist/icon-metadata.json +359 -42
  2. package/dist/index.js +12890 -5844
  3. package/dist/index.js.map +1 -1
  4. package/dist/panda.buildinfo.json +523 -501
  5. package/dist/playroom-static.css +2 -2
  6. package/dist/{preset-BAn5LBiW.js → preset-CLoY9s9i.js} +2031 -2086
  7. package/dist/preset-CLoY9s9i.js.map +1 -0
  8. package/dist/preset.js +1 -1
  9. package/dist/specs/conditions.json +75 -51
  10. package/dist/specs/keyframes.json +22 -0
  11. package/dist/specs/recipes.json +222 -106
  12. package/dist/specs/semantic-tokens.json +194 -86
  13. package/dist/specs/tokens.json +16 -36
  14. package/dist/sprite.svg +1 -1
  15. package/dist/sprite.symbol.html +445 -44
  16. package/dist/styles.css +11441 -13424
  17. package/dist/svgs/cheese.svg +1 -0
  18. package/dist/svgs/collapse-vertical.svg +1 -0
  19. package/dist/svgs/expand-vertical.svg +1 -0
  20. package/dist/svgs/magnet.svg +1 -0
  21. package/dist/svgs/to-date-backward.svg +1 -0
  22. package/dist/svgs/to-date-forward.svg +1 -0
  23. package/dist/types/index.d.ts +2815 -288
  24. package/package.json +4 -2
  25. package/src/recipes/autocomplete.ts +266 -0
  26. package/src/recipes/badge.ts +25 -54
  27. package/src/recipes/button.ts +155 -316
  28. package/src/recipes/calendar.ts +91 -0
  29. package/src/recipes/card.ts +4 -70
  30. package/src/recipes/chip.ts +212 -266
  31. package/src/recipes/dateMenus.ts +40 -0
  32. package/src/recipes/dateTimeMenus.ts +43 -0
  33. package/src/recipes/formField.ts +1 -1
  34. package/src/recipes/kbd.ts +42 -39
  35. package/src/recipes/list.ts +11 -85
  36. package/src/recipes/listDensity.ts +66 -0
  37. package/src/recipes/listItem.ts +27 -166
  38. package/src/recipes/listItemGroup.ts +16 -16
  39. package/src/recipes/menu.ts +17 -3
  40. package/src/recipes/modal.ts +65 -65
  41. package/src/recipes/radio.ts +6 -6
  42. package/src/recipes/recipes-slot.ts +7 -2
  43. package/src/recipes/segmentedFields.ts +192 -0
  44. package/src/recipes/segmentedInputs.ts +109 -0
  45. package/src/recipes/tag.ts +218 -210
  46. package/src/recipes/text.ts +37 -19
  47. package/src/recipes/textInput.ts +103 -155
  48. package/src/recipes/themeSwitcher.ts +3 -3
  49. package/src/recipes/timeMenus.ts +110 -0
  50. package/src/recipes/toggle.ts +3 -1
  51. package/src/styles/primitives/shadows.ts +26 -60
  52. package/src/styles/primitives/zIndex.ts +1 -0
  53. package/src/styles/semantics/colors.ts +84 -37
  54. package/src/styles/semantics/shadows.ts +4 -30
  55. package/src/styles/semantics/zIndex.ts +2 -0
  56. package/src/styles/utilities/conditions.ts +61 -51
  57. package/src/styles/utilities/dropShadows.ts +51 -0
  58. package/src/styles/utilities/filters.ts +22 -7
  59. package/src/styles/utilities/globalStyle.ts +5 -2
  60. package/src/styles/utilities/index.ts +3 -0
  61. package/src/styles/utilities/keyframes.ts +27 -4
  62. package/src/styles/utilities/recipeGlobalStyles.ts +22 -0
  63. package/src/styles/utilities/shadowDefinitions.ts +112 -0
  64. package/src/utils/dsChain.ts +113 -0
  65. package/src/utils/dsComponent.ts +44 -0
  66. package/src/utils/dsPart.ts +41 -0
  67. package/dist/preset-BAn5LBiW.js.map +0 -1
  68. package/src/recipes/datePicker.ts +0 -234
  69. package/src/recipes/timePicker.ts +0 -216
@@ -496,17 +496,17 @@ export const colors = defineSemanticTokens.colors({
496
496
  },
497
497
  },
498
498
  selected: {
499
- value: { base: '{colors.blue.60}', _dark: '{colors.blue.40}' },
499
+ value: { base: '{colors.blue.70}', _dark: '{colors.blue.40}' },
500
500
  },
501
501
  input: {
502
502
  value: { base: '{colors.neutral.50}', _dark: '{colors.darkNeutral.60}' },
503
503
  },
504
- success: { value: { base: '{colors.lime.50}', _dark: '{colors.lime.50}' } },
504
+ success: { value: { base: '{colors.lime.60}', _dark: '{colors.lime.50}' } },
505
505
  warning: {
506
- value: { base: '{colors.orange.50}', _dark: '{colors.orange.50}' },
506
+ value: { base: '{colors.orange.60}', _dark: '{colors.orange.50}' },
507
507
  },
508
- danger: { value: { base: '{colors.red.50}', _dark: '{colors.red.50}' } },
509
- info: { value: { base: '{colors.blue.50}', _dark: '{colors.blue.50}' } },
508
+ danger: { value: { base: '{colors.red.60}', _dark: '{colors.red.50}' } },
509
+ info: { value: { base: '{colors.blue.60}', _dark: '{colors.blue.50}' } },
510
510
  },
511
511
  icon: {
512
512
  DEFAULT: {
@@ -525,7 +525,7 @@ export const colors = defineSemanticTokens.colors({
525
525
  value: { base: '{colors.neutral.0}', _dark: '{colors.darkNeutral.10}' },
526
526
  },
527
527
  selected: {
528
- value: { base: '{colors.blue.60}', _dark: '{colors.blue.40}' },
528
+ value: { base: '{colors.blue.70}', _dark: '{colors.blue.40}' },
529
529
  },
530
530
  disabled: {
531
531
  value: {
@@ -578,13 +578,58 @@ export const colors = defineSemanticTokens.colors({
578
578
  },
579
579
  danger: {
580
580
  DEFAULT: { value: { base: '{colors.red.70}', _dark: '{colors.red.50}' } },
581
- inverse: { value: { base: '{colors.red.10}', _dark: '{colors.red.70}' } },
581
+ inverse: {
582
+ value: { base: '{colors.red.10}', _dark: '{colors.neutral.110}' },
583
+ },
582
584
  },
583
585
  info: { value: { base: '{colors.blue.60}', _dark: '{colors.blue.50}' } },
584
586
  },
585
587
  link: {
586
- DEFAULT: { value: { base: '{colors.blue.50}', _dark: '{colors.blue.40}' } },
587
- pressed: { value: { base: '{colors.blue.60}', _dark: '{colors.blue.50}' } },
588
+ DEFAULT: { value: { base: '{colors.blue.70}', _dark: '{colors.blue.40}' } },
589
+ pressed: { value: { base: '{colors.blue.80}', _dark: '{colors.blue.50}' } },
590
+ },
591
+ // Shadow layer colors. These were primitives holding explicit `.light` and
592
+ // `.dark` leaves, which forced every shadow to exist twice. As semantic
593
+ // tokens they resolve per mode on their own, so one geometry serves both.
594
+ shadow: {
595
+ raised: {
596
+ 1: {
597
+ value: { base: 'rgba(30, 31, 33, 0.25)', _dark: 'rgba(1, 4, 4, 0.5)' },
598
+ },
599
+ 2: {
600
+ value: { base: 'rgba(30, 31, 33, 0.31)', _dark: 'rgba(1, 4, 4, 0.5)' },
601
+ },
602
+ },
603
+ elevated: {
604
+ 1: {
605
+ value: { base: 'rgba(0, 0, 0, 0)', _dark: 'rgba(95, 95, 95, 0.06)' },
606
+ },
607
+ 2: {
608
+ value: { base: 'rgba(30, 31, 33, 0.2)', _dark: 'rgba(1, 4, 4, 0.43)' },
609
+ },
610
+ 3: {
611
+ value: { base: 'rgba(30, 31, 33, 0.31)', _dark: 'rgba(1, 4, 4, 0.5)' },
612
+ },
613
+ },
614
+ overlay: {
615
+ 1: {
616
+ value: { base: 'rgba(0, 0, 0, 0)', _dark: 'rgba(189, 189, 189, 0.12)' },
617
+ },
618
+ 2: {
619
+ value: { base: 'rgba(30, 31, 33, 0.15)', _dark: 'rgba(1, 4, 4, 0.36)' },
620
+ },
621
+ 3: {
622
+ value: { base: 'rgba(30, 31, 33, 0.31)', _dark: 'rgba(1, 4, 4, 0.5)' },
623
+ },
624
+ },
625
+ overflow: {
626
+ 1: {
627
+ value: { base: 'rgba(30, 31, 33, 0.16)', _dark: 'rgba(1, 4, 4, 0.56)' },
628
+ },
629
+ 2: {
630
+ value: { base: 'rgba(30, 31, 33, 0.12)', _dark: 'rgba(1, 4, 4, 0.5)' },
631
+ },
632
+ },
588
633
  },
589
634
  surface: {
590
635
  DEFAULT: {
@@ -682,10 +727,10 @@ export const colors = defineSemanticTokens.colors({
682
727
  },
683
728
  },
684
729
  selected: {
685
- value: { base: '{colors.blue.60}', _dark: '{colors.blue.40}' },
730
+ value: { base: '{colors.blue.70}', _dark: '{colors.blue.40}' },
686
731
  },
687
732
  placeholder: {
688
- value: { base: '{colors.neutral.40}', _dark: '{colors.darkNeutral.40}' },
733
+ value: { base: '{colors.neutral.70}', _dark: '{colors.darkNeutral.70}' },
689
734
  },
690
735
  disabled: {
691
736
  value: {
@@ -695,30 +740,32 @@ export const colors = defineSemanticTokens.colors({
695
740
  },
696
741
  success: {
697
742
  DEFAULT: {
698
- value: { base: '{colors.lime.50}', _dark: '{colors.lime.30}' },
743
+ value: { base: '{colors.lime.80}', _dark: '{colors.lime.30}' },
699
744
  },
700
745
  inverse: {
701
- value: { base: '{colors.lime.30}', _dark: '{colors.lime.50}' },
746
+ value: { base: '{colors.neutral.0}', _dark: '{colors.neutral.110}' },
702
747
  },
703
748
  },
704
749
  warning: {
705
750
  DEFAULT: {
706
- value: { base: '{colors.orange.60}', _dark: '{colors.orange.40}' },
751
+ value: { base: '{colors.orange.80}', _dark: '{colors.orange.40}' },
707
752
  },
708
753
  inverse: {
709
- value: { base: '{colors.orange.40}', _dark: '{colors.orange.60}' },
754
+ value: { base: '{colors.neutral.110}', _dark: '{colors.neutral.110}' },
710
755
  },
711
756
  },
712
757
  danger: {
713
- DEFAULT: { value: { base: '{colors.red.50}', _dark: '{colors.red.30}' } },
714
- inverse: { value: { base: '{colors.red.30}', _dark: '{colors.red.50}' } },
758
+ DEFAULT: { value: { base: '{colors.red.80}', _dark: '{colors.red.30}' } },
759
+ inverse: {
760
+ value: { base: '{colors.neutral.0}', _dark: '{colors.neutral.110}' },
761
+ },
715
762
  },
716
763
  info: {
717
764
  DEFAULT: {
718
- value: { base: '{colors.blue.50}', _dark: '{colors.blue.40}' },
765
+ value: { base: '{colors.blue.80}', _dark: '{colors.blue.40}' },
719
766
  },
720
767
  inverse: {
721
- value: { base: '{colors.blue.40}', _dark: '{colors.blue.50}' },
768
+ value: { base: '{colors.neutral.0}', _dark: '{colors.neutral.110}' },
722
769
  },
723
770
  },
724
771
  accent: {
@@ -738,15 +785,15 @@ export const colors = defineSemanticTokens.colors({
738
785
  },
739
786
  red: {
740
787
  DEFAULT: {
741
- value: { base: '{colors.red.50}', _dark: '{colors.red.30}' },
788
+ value: { base: '{colors.red.70}', _dark: '{colors.red.30}' },
742
789
  },
743
790
  bold: {
744
- value: { base: '{colors.red.60}', _dark: '{colors.red.20}' },
791
+ value: { base: '{colors.red.70}', _dark: '{colors.red.20}' },
745
792
  },
746
793
  },
747
794
  orange: {
748
795
  DEFAULT: {
749
- value: { base: '{colors.orange.60}', _dark: '{colors.orange.50}' },
796
+ value: { base: '{colors.orange.70}', _dark: '{colors.orange.50}' },
750
797
  },
751
798
  bold: {
752
799
  value: { base: '{colors.orange.70}', _dark: '{colors.orange.30}' },
@@ -754,47 +801,47 @@ export const colors = defineSemanticTokens.colors({
754
801
  },
755
802
  yellow: {
756
803
  DEFAULT: {
757
- value: { base: '{colors.yellow.50}', _dark: '{colors.yellow.30}' },
804
+ value: { base: '{colors.yellow.80}', _dark: '{colors.yellow.30}' },
758
805
  },
759
806
  bold: {
760
- value: { base: '{colors.yellow.60}', _dark: '{colors.yellow.20}' },
807
+ value: { base: '{colors.yellow.80}', _dark: '{colors.yellow.20}' },
761
808
  },
762
809
  },
763
810
  lime: {
764
811
  DEFAULT: {
765
- value: { base: '{colors.lime.50}', _dark: '{colors.lime.40}' },
812
+ value: { base: '{colors.lime.70}', _dark: '{colors.lime.40}' },
766
813
  },
767
814
  bold: {
768
- value: { base: '{colors.lime.60}', _dark: '{colors.lime.20}' },
815
+ value: { base: '{colors.lime.70}', _dark: '{colors.lime.20}' },
769
816
  },
770
817
  },
771
818
  green: {
772
819
  DEFAULT: {
773
- value: { base: '{colors.green.50}', _dark: '{colors.green.40}' },
820
+ value: { base: '{colors.green.70}', _dark: '{colors.green.40}' },
774
821
  },
775
822
  bold: {
776
- value: { base: '{colors.green.60}', _dark: '{colors.green.20}' },
823
+ value: { base: '{colors.green.70}', _dark: '{colors.green.20}' },
777
824
  },
778
825
  },
779
826
  teal: {
780
827
  DEFAULT: {
781
- value: { base: '{colors.teal.50}', _dark: '{colors.teal.40}' },
828
+ value: { base: '{colors.teal.70}', _dark: '{colors.teal.40}' },
782
829
  },
783
830
  bold: {
784
- value: { base: '{colors.teal.60}', _dark: '{colors.teal.20}' },
831
+ value: { base: '{colors.teal.70}', _dark: '{colors.teal.20}' },
785
832
  },
786
833
  },
787
834
  blue: {
788
835
  DEFAULT: {
789
- value: { base: '{colors.blue.50}', _dark: '{colors.blue.40}' },
836
+ value: { base: '{colors.blue.70}', _dark: '{colors.blue.40}' },
790
837
  },
791
838
  bold: {
792
- value: { base: '{colors.blue.60}', _dark: '{colors.blue.30}' },
839
+ value: { base: '{colors.blue.70}', _dark: '{colors.blue.30}' },
793
840
  },
794
841
  },
795
842
  indigo: {
796
843
  DEFAULT: {
797
- value: { base: '{colors.indigo.40}', _dark: '{colors.indigo.20}' },
844
+ value: { base: '{colors.indigo.60}', _dark: '{colors.indigo.20}' },
798
845
  },
799
846
  bold: {
800
847
  value: { base: '{colors.indigo.60}', _dark: '{colors.indigo.10}' },
@@ -802,15 +849,15 @@ export const colors = defineSemanticTokens.colors({
802
849
  },
803
850
  purple: {
804
851
  DEFAULT: {
805
- value: { base: '{colors.purple.50}', _dark: '{colors.purple.40}' },
852
+ value: { base: '{colors.purple.70}', _dark: '{colors.purple.40}' },
806
853
  },
807
854
  bold: {
808
- value: { base: '{colors.purple.60}', _dark: '{colors.purple.30}' },
855
+ value: { base: '{colors.purple.70}', _dark: '{colors.purple.30}' },
809
856
  },
810
857
  },
811
858
  magenta: {
812
859
  DEFAULT: {
813
- value: { base: '{colors.magenta.60}', _dark: '{colors.magenta.40}' },
860
+ value: { base: '{colors.magenta.70}', _dark: '{colors.magenta.40}' },
814
861
  },
815
862
  bold: {
816
863
  value: { base: '{colors.magenta.70}', _dark: '{colors.magenta.30}' },
@@ -818,7 +865,7 @@ export const colors = defineSemanticTokens.colors({
818
865
  },
819
866
  tan: {
820
867
  DEFAULT: {
821
- value: { base: '{colors.tan.50}', _dark: '{colors.tan.30}' },
868
+ value: { base: '{colors.tan.60}', _dark: '{colors.tan.30}' },
822
869
  },
823
870
  bold: {
824
871
  value: { base: '{colors.tan.60}', _dark: '{colors.tan.20}' },
@@ -1,41 +1,15 @@
1
1
  import { defineSemanticTokens } from '@pandacss/dev';
2
2
 
3
3
  export const shadows = defineSemanticTokens.shadows({
4
- zero: {
5
- value: { base: '{shadows.zeroShadow}', _dark: '{shadows.zeroShadow}' },
6
- },
4
+ zero: { value: { base: '{shadows.zeroLight}', _dark: '{shadows.zeroDark}' } },
7
5
  raised: {
8
- DEFAULT: {
9
- value: { base: '{shadows.raisedLight}', _dark: '{shadows.raisedDark}' },
10
- },
11
- up: {
12
- value: {
13
- base: '{shadows.raisedLightUp}',
14
- _dark: '{shadows.raisedDarkUp}',
15
- },
16
- },
6
+ value: { base: '{shadows.raisedLight}', _dark: '{shadows.raisedDark}' },
17
7
  },
18
8
  elevated: {
19
- DEFAULT: {
20
- value: {
21
- base: '{shadows.elevatedLight}',
22
- _dark: '{shadows.elevatedDark}',
23
- },
24
- },
25
- up: {
26
- value: {
27
- base: '{shadows.elevatedLightUp}',
28
- _dark: '{shadows.elevatedDarkUp}',
29
- },
30
- },
9
+ value: { base: '{shadows.elevatedLight}', _dark: '{shadows.elevatedDark}' },
31
10
  },
32
11
  overlay: {
33
- DEFAULT: {
34
- value: { base: '{shadows.overlayLight}', _dark: '{shadows.overlayDark}' },
35
- },
36
- dark: {
37
- value: { base: '{shadows.overlayDark}', _dark: '{shadows.overlayLight}' },
38
- },
12
+ value: { base: '{shadows.overlayLight}', _dark: '{shadows.overlayDark}' },
39
13
  },
40
14
  overflow: {
41
15
  value: { base: '{shadows.overflowLight}', _dark: '{shadows.overflowDark}' },
@@ -6,6 +6,7 @@ import { defineSemanticTokens } from '@pandacss/dev';
6
6
  * elevated → shadows.elevated (menus, dropdowns)
7
7
  * overlay → shadows.overlay / surface.overlay (modal backdrop)
8
8
  * modal → (modal container, above backdrop)
9
+ * modalFloating → (floating content inside a modal)
9
10
  * tooltip → (always on top)
10
11
  */
11
12
  export const zIndex = defineSemanticTokens.zIndex({
@@ -14,5 +15,6 @@ export const zIndex = defineSemanticTokens.zIndex({
14
15
  elevated: { value: '{zIndex.1000}' },
15
16
  overlay: { value: '{zIndex.1100}' },
16
17
  modal: { value: '{zIndex.1101}' },
18
+ modalFloating: { value: '{zIndex.1102}' },
17
19
  tooltip: { value: '{zIndex.1200}' },
18
20
  });
@@ -1,28 +1,34 @@
1
+ // Adopted from the Cetec design system. The important difference is that every
2
+ // data-attribute condition matches `=true` rather than bare presence: React
3
+ // stringifies `false` for data-* props, so `data-disabled="false"` matched the
4
+ // looser selectors and rendered the element as disabled.
1
5
  export const conditions = {
2
6
  hover: '&:is(:hover, [data-hover=true])',
3
7
  focus: '&:is(:focus, [data-focus=true])',
4
8
  focusWithin: '&:focus-within',
5
9
  focusVisible: '&:is(:focus-visible, [data-focus-visible=true])',
6
10
  disabled:
7
- '&:is(:disabled, [disabled], [data-disabled], [aria-disabled=true])',
11
+ '&:is(:disabled, [disabled], [data-disabled=true], [aria-disabled=true])',
8
12
  deleted: '&:is(:deleted, [deleted], [data-deleted=true])',
9
13
  active: '&:is(:active, [data-active=true])',
10
14
  visited: '&:visited',
11
15
  target: '&:target',
12
- readOnly: '&:is(:read-only, [data-read-only], [aria-readonly=true])',
16
+ readOnly:
17
+ '&:is(:read-only, [readonly], [data-read-only=true], [aria-readonly=true])',
13
18
  readWrite: '&:read-write',
14
- empty: '&:is(:empty, [data-empty])',
19
+ empty: '&:is(:empty, [data-empty=true])',
15
20
  checked:
16
- '&:is(:checked, [data-checked], [aria-checked=true], [data-state="checked"])',
21
+ '&:is(:checked, [data-checked=true], [aria-checked=true], [data-state="checked"])',
17
22
  enabled: '&:enabled',
18
23
  expanded:
19
- '&:is([aria-expanded=true], [data-expanded], [data-state="expanded"])',
24
+ '&:is([aria-expanded=true], [data-expanded=true], [data-state="expanded"])',
20
25
  collapsed:
21
- '&:is([aria-collapsed=true], [data-collapsed], [data-state="collapsed"])',
22
- highlighted: '&[data-highlighted]',
23
- complete: '&[data-complete]',
24
- incomplete: '&[data-incomplete]',
25
- dragging: '&[data-dragging]',
26
+ '&:is([aria-collapsed=true], [data-collapsed=true], [data-state="collapsed"])',
27
+ highlighted: '&[data-highlighted=true]',
28
+ new: '&[data-new=true]',
29
+ complete: '&[data-complete=true]',
30
+ incomplete: '&[data-incomplete=true]',
31
+ dragging: '&[data-dragging=true]',
26
32
  utility: '&[data-utility=true]',
27
33
 
28
34
  before: '&::before',
@@ -44,68 +50,71 @@ export const conditions = {
44
50
  lastOfType: '&:last-of-type',
45
51
  onlyOfType: '&:only-of-type',
46
52
 
47
- peerFocus: '.peer:is(:focus, [data-focus]) ~ &',
48
- peerHover: '.peer:is(:hover, [data-hover]) ~ &',
49
- peerActive: '.peer:is(:active, [data-active]) ~ &',
53
+ peerFocus: '.peer:is(:focus, [data-focus=true]) ~ &',
54
+ peerHover: '.peer:is(:hover, [data-hover=true]) ~ &',
55
+ peerActive: '.peer:is(:active, [data-active=true]) ~ &',
50
56
  peerFocusWithin: '.peer:focus-within ~ &',
51
57
  peerFocusVisible: '.peer:is(:focus-visible, [data-focus-visible]) ~ &',
52
58
  peerDisabled:
53
- '.peer:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]) ~ &',
59
+ '.peer:is(:disabled, [disabled], [data-disabled=true], [aria-disabled=true]) ~ &',
54
60
  peerChecked:
55
- '.peer:is(:checked, [data-checked], [aria-checked=true], [data-state="checked"]) ~ &',
56
- peerInvalid: '.peer:is(:invalid, [data-invalid], [aria-invalid=true]) ~ &',
61
+ '.peer:is(:checked, [data-checked=true], [aria-checked=true], [data-state="checked"]) ~ &',
62
+ peerInvalid:
63
+ '.peer:is(:invalid, [data-invalid=true], [aria-invalid=true]) ~ &',
57
64
  peerExpanded:
58
- '.peer:is([aria-expanded=true], [data-expanded], [data-state="expanded"]) ~ &',
65
+ '.peer:is([aria-expanded=true], [data-expanded=true], [data-state="expanded"]) ~ &',
59
66
  peerPlaceholderShown: '.peer:placeholder-shown ~ &',
60
67
 
61
- groupFocus: '.group:is(:focus, [data-focus]) &',
62
- groupHover: '.group:is(:hover, [data-hover]) &',
63
- groupActive: '.group:is(:active, [data-active]) &',
68
+ groupFocus: '.group:is(:focus, [data-focus=true]) &',
69
+ groupHover: '.group:is(:hover, [data-hover=true]) &',
70
+ groupActive: '.group:is(:active, [data-active=true]) &',
64
71
  groupFocusWithin: '.group:focus-within &',
65
- groupFocusVisible: '.group:is(:focus-visible, [data-focus-visible]) &',
72
+ groupFocusVisible: '.group:is(:focus-visible, [data-focus-visible=true]) &',
66
73
  groupDisabled:
67
- '.group:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]) &',
74
+ '.group:is(:disabled, [disabled], [data-disabled=true], [aria-disabled=true]) &',
68
75
  groupChecked:
69
- '.group:is(:checked, [data-checked], [aria-checked=true], [data-state="checked"]) &',
76
+ '.group:is(:checked, [data-checked=true], [aria-checked=true], [data-state="checked"]) &',
70
77
  groupExpanded:
71
- '.group:is([aria-expanded=true], [data-expanded], [data-state="expanded"]) &',
72
- groupInvalid: '.group:is(:invalid, [data-invalid], [aria-invalid=true]) &',
78
+ '.group:is([aria-expanded=true], [data-expanded=true], [data-state="expanded"]) &',
79
+ groupInvalid:
80
+ '.group:is(:invalid, [data-invalid=true], [aria-invalid=true]) &',
73
81
 
74
82
  indeterminate:
75
- '&:is(:indeterminate, [data-indeterminate], [aria-checked=mixed], [data-state="indeterminate"])',
76
- required: '&:is(:required, [data-required], [aria-required=true])',
77
- valid: '&:is(:valid, [data-valid])',
83
+ '&:is(:indeterminate, [data-indeterminate=true], [aria-checked=mixed], [data-state="indeterminate"])',
84
+ required: '&:is(:required, [data-required=true], [aria-required=true])',
85
+ valid: '&:is(:valid, [data-valid=true])',
78
86
  invalid: '&:is(:invalid, [data-invalid=true], [aria-invalid=true])',
79
87
  error: '&:is([data-error=true])',
88
+ success: '&:is([data-success=true])',
80
89
  autofill: '&:autofill',
81
- inRange: '&:is(:in-range, [data-in-range])',
82
- outOfRange: '&:is(:out-of-range, [data-outside-range])',
83
- placeholder: '&::placeholder, &[data-placeholder]',
84
- placeholderShown: '&:is(:placeholder-shown, [data-placeholder-shown])',
85
- pressed: '&:is([aria-pressed=true], [data-pressed])',
90
+ inRange: '&:is(:in-range, [data-in-range=true])',
91
+ outOfRange: '&:is(:out-of-range, [data-outside-range=true])',
92
+ placeholder: '&::placeholder, &[data-placeholder=true]',
93
+ placeholderShown: '&:is(:placeholder-shown, [data-placeholder-shown=true])',
94
+ pressed: '&:is([aria-pressed=true], [data-pressed=true])',
86
95
  selected: '&:is([aria-selected=true], [data-selected=true])',
87
- grabbed: '&:is([aria-grabbed=true], [data-grabbed])',
88
- underValue: '&[data-state=under-value]',
89
- overValue: '&[data-state=over-value]',
90
- atValue: '&[data-state=at-value]',
96
+ grabbed: '&:is([aria-grabbed=true], [data-grabbed=true])',
97
+ underValue: '&[data-state="under-value"]',
98
+ overValue: '&[data-state="over-value"]',
99
+ atValue: '&[data-state="at-value"]',
91
100
 
92
101
  default: '&:default',
93
102
  optional: '&:optional',
94
- open: '&:is([open], [data-open], [data-state="open"], :popover-open)',
95
- closed: '&:is([closed], [data-closed], [data-state="closed"])',
96
- fullscreen: '&:is(:fullscreen, [data-fullscreen])',
97
- loading: '&:is([data-loading], [aria-busy=true])',
98
- hidden: '&:is([hidden], [data-hidden])',
103
+ open: '&:is([open], [data-open=true], [data-state="open"], :popover-open)',
104
+ closed: '&:is([closed], [data-closed=true], [data-state="closed"])',
105
+ fullscreen: '&:is(:fullscreen, [data-fullscreen=true])',
106
+ loading: '&:is([data-loading=true], [aria-busy=true])',
107
+ hidden: '&:is([hidden], [data-hidden=true])',
99
108
 
100
- current: '&:is([aria-current=true], [data-current])',
109
+ current: '&:is([aria-current=true], [data-current=true])',
101
110
  currentPage: '&[aria-current=page]',
102
111
  currentStep: '&[aria-current=step]',
103
- today: '&:is([data-today])',
104
- unavailable: '&[data-unavailable]',
105
- rangeStart: '&[data-range-start]',
106
- rangeEnd: '&[data-range-end]',
107
- now: '&[data-now]',
108
- topmost: '&[data-topmost]',
112
+ today: '&:is([data-today=true])',
113
+ unavailable: '&[data-unavailable=true]',
114
+ rangeStart: '&[data-range-start=true]',
115
+ rangeEnd: '&[data-range-end=true]',
116
+ now: '&[data-now=true]',
117
+ topmost: '&[data-topmost=true]',
109
118
 
110
119
  motionReduce: '@media (prefers-reduced-motion: reduce)',
111
120
  motionSafe: '@media (prefers-reduced-motion: no-preference)',
@@ -114,8 +123,9 @@ export const conditions = {
114
123
  landscape: '@media (orientation: landscape)',
115
124
  portrait: '@media (orientation: portrait)',
116
125
 
117
- dark: '.dark &, &:is([data-color-mode=dark] *), [data-color-mode=dark] &',
118
- light: '.light &, &:is([data-color-mode=light] *), [data-color-mode=light] &',
126
+ dark: '.dark &, &:is([data-color-mode="dark"] *), [data-color-mode="dark"] &',
127
+ light:
128
+ '.light &, &:is([data-color-mode="light"] *), [data-color-mode="light"] &',
119
129
  osDark: '@media (prefers-color-scheme: dark)',
120
130
  osLight: '@media (prefers-color-scheme: light)',
121
131
 
@@ -0,0 +1,51 @@
1
+ import { defineUtility } from '@pandacss/dev';
2
+
3
+ import { filterAutoValue } from './filters';
4
+ import {
5
+ type DropShadowName,
6
+ dropShadowColorToken,
7
+ elevationShadowDefinitions,
8
+ } from './shadowDefinitions';
9
+
10
+ const dropShadowValues = {
11
+ zero: 'zero',
12
+ raised: 'raised',
13
+ elevated: 'elevated',
14
+ overlay: 'overlay',
15
+ } satisfies Record<DropShadowName, DropShadowName>;
16
+
17
+ const resolveDropShadowValue = (
18
+ value: DropShadowName,
19
+ token: (path: string) => string | undefined,
20
+ ) =>
21
+ elevationShadowDefinitions[value]
22
+ .map((layer) => {
23
+ const x = token(`sizes.${layer.x}`);
24
+ const y = token(`sizes.${layer.y}`);
25
+ const blur = token(`sizes.${layer.blur}`);
26
+ const color = token(dropShadowColorToken(layer.color));
27
+
28
+ if (!x || !y || !blur || !color) {
29
+ throw new Error(`Unable to resolve dropShadow token for ${value}`);
30
+ }
31
+
32
+ return `drop-shadow(${x} ${y} ${blur} ${color})`;
33
+ })
34
+ .join(' ');
35
+
36
+ /**
37
+ * Replaces Panda's built-in dropShadow utility so drop shadows use the same
38
+ * layer definitions as the boxShadow tokens. Writing through `--drop-shadow`
39
+ * keeps the value composable with the other filter slots.
40
+ */
41
+ export const dropShadowProperty = defineUtility({
42
+ className: 'drop-shadow',
43
+ group: 'Effect',
44
+ values: dropShadowValues,
45
+ transform(value: DropShadowName, ctx) {
46
+ return {
47
+ filter: filterAutoValue,
48
+ '--drop-shadow': resolveDropShadowValue(value, ctx.token),
49
+ };
50
+ },
51
+ });
@@ -1,12 +1,27 @@
1
1
  import { defineUtility } from '@pandacss/dev';
2
2
 
3
- export const filters = {
4
- invert: { value: 'invert(1)' },
5
- blur: { value: 'blur(8px)' },
6
- none: { value: 'none' },
3
+ /**
4
+ * Every filter slot, each empty until a utility fills it. Composing through
5
+ * custom properties lets dropShadow set its own slot without clearing the rest.
6
+ * The string matches Panda's own `filter: auto` value, so the base utility and
7
+ * `dropShadow` stay in agreement.
8
+ */
9
+ export const filterAutoValue =
10
+ 'var(--blur, ) var(--brightness, ) var(--contrast, ) var(--grayscale, ) var(--hue-rotate, ) var(--invert, ) var(--saturate, ) var(--sepia, ) var(--drop-shadow, )';
11
+
12
+ export const filterValues = {
13
+ auto: filterAutoValue,
14
+ invert: 'invert(1)',
15
+ blur: 'blur(8px)',
16
+ none: 'none',
7
17
  };
8
18
 
9
- export const filtersProperty = defineUtility({
10
- className: 'filters',
11
- values: 'filters',
19
+ /**
20
+ * Extends Panda's base `filter` utility, which ships `auto` alone, with the
21
+ * library's named filters.
22
+ */
23
+ export const filterProperty = defineUtility({
24
+ className: 'filter',
25
+ group: 'Effect',
26
+ values: filterValues,
12
27
  });
@@ -51,12 +51,15 @@ export const globalCss = defineGlobalStyles({
51
51
  u: {
52
52
  textDecoration: 'underline',
53
53
  },
54
- 'code, kbd, samp, pre': {
54
+ // `kbd` is deliberately excluded: the Kbd recipe owns its own type scale, and
55
+ // this element-selector rule sits in the `base` layer where it was beating
56
+ // the recipe's font-size. Cetec has no equivalent global rule.
57
+ 'code, samp, pre': {
55
58
  fontFamily: 'mono',
56
59
  fontSize: '1em',
57
60
  },
58
61
  table: {
59
- borderColor: 'border.subtle',
62
+ borderColor: 'token(colors.border.subtle)',
60
63
  },
61
64
  'button, input, optgroup, select, textarea': {
62
65
  fontFamily: 'body',
@@ -4,9 +4,12 @@ export * from './breakpoints';
4
4
  export * from './conditions';
5
5
  export * from './containerSizes';
6
6
  // Custom utilities we've added that are not part of Panda's core properties
7
+ export * from './dropShadows';
7
8
  export * from './filters';
8
9
  export * from './globalStyle';
9
10
  export * from './keyframes';
10
11
  export * from './layerStyles';
12
+ export * from './recipeGlobalStyles';
13
+ export * from './shadowDefinitions';
11
14
  export * from './textStyles';
12
15
  export * from './transitions';
@@ -70,24 +70,47 @@ export const keyframes = defineKeyframes({
70
70
  '0%': { opacity: '1' },
71
71
  '100%': { opacity: '0' },
72
72
  },
73
+ // The dialog is centred by `place-content` on the position wrapper, so these
74
+ // carry no translate(-50%, -50%). The old absolutely-positioned modal needed
75
+ // one; keeping it shifted the panel up and left by half its size.
73
76
  modalScaleIn: {
74
77
  '0%': {
75
78
  opacity: '0',
76
- transform: 'translate(-50%, -50%) scale(0.95) translateY(-10px)',
79
+ transform: 'scale(0.95) translateY(20px)',
77
80
  },
78
81
  '100%': {
79
82
  opacity: '1',
80
- transform: 'translate(-50%, -50%) scale(1) translateY(0)',
83
+ transform: 'scale(1) translateY(0)',
81
84
  },
82
85
  },
83
86
  modalScaleOut: {
84
87
  '0%': {
85
88
  opacity: '1',
86
- transform: 'translate(-50%, -50%) scale(1) translateY(0)',
89
+ transform: 'scale(1) translateY(0)',
87
90
  },
88
91
  '100%': {
89
92
  opacity: '0',
90
- transform: 'translate(-50%, -50%) scale(0.95) translateY(-10px)',
93
+ transform: 'scale(0.95) translateY(20px)',
94
+ },
95
+ },
96
+ modalScaleInTop: {
97
+ '0%': {
98
+ opacity: '0',
99
+ transform: 'scale(0.97) translateY(-40px)',
100
+ },
101
+ '100%': {
102
+ opacity: '1',
103
+ transform: 'scale(1) translateY(0)',
104
+ },
105
+ },
106
+ modalScaleOutTop: {
107
+ '0%': {
108
+ opacity: '1',
109
+ transform: 'scale(1) translateY(0)',
110
+ },
111
+ '100%': {
112
+ opacity: '0',
113
+ transform: 'scale(0.97) translateY(-40px)',
91
114
  },
92
115
  },
93
116
  });