@kushagradhawan/kookie-ui 0.1.77 → 0.1.79

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 (38) hide show
  1. package/components.css +69 -29
  2. package/dist/cjs/components/combobox.d.ts +57 -7
  3. package/dist/cjs/components/combobox.d.ts.map +1 -1
  4. package/dist/cjs/components/combobox.js +1 -1
  5. package/dist/cjs/components/combobox.js.map +3 -3
  6. package/dist/cjs/components/text-field.d.ts +2 -2
  7. package/dist/cjs/components/text-field.d.ts.map +1 -1
  8. package/dist/cjs/components/text-field.js +2 -2
  9. package/dist/cjs/components/text-field.js.map +3 -3
  10. package/dist/cjs/components/text-field.props.d.ts +26 -0
  11. package/dist/cjs/components/text-field.props.d.ts.map +1 -1
  12. package/dist/cjs/components/text-field.props.js +1 -1
  13. package/dist/cjs/components/text-field.props.js.map +1 -1
  14. package/dist/esm/components/combobox.d.ts +57 -7
  15. package/dist/esm/components/combobox.d.ts.map +1 -1
  16. package/dist/esm/components/combobox.js +1 -1
  17. package/dist/esm/components/combobox.js.map +3 -3
  18. package/dist/esm/components/text-field.d.ts +2 -2
  19. package/dist/esm/components/text-field.d.ts.map +1 -1
  20. package/dist/esm/components/text-field.js +2 -2
  21. package/dist/esm/components/text-field.js.map +3 -3
  22. package/dist/esm/components/text-field.props.d.ts +26 -0
  23. package/dist/esm/components/text-field.props.d.ts.map +1 -1
  24. package/dist/esm/components/text-field.props.js +1 -1
  25. package/dist/esm/components/text-field.props.js.map +1 -1
  26. package/package.json +2 -2
  27. package/schemas/base-button.json +1 -1
  28. package/schemas/button.json +1 -1
  29. package/schemas/icon-button.json +1 -1
  30. package/schemas/index.json +6 -6
  31. package/schemas/toggle-button.json +1 -1
  32. package/schemas/toggle-icon-button.json +1 -1
  33. package/src/components/combobox.css +56 -55
  34. package/src/components/combobox.tsx +305 -73
  35. package/src/components/text-field.css +83 -0
  36. package/src/components/text-field.props.tsx +28 -0
  37. package/src/components/text-field.tsx +222 -5
  38. package/styles.css +69 -29
@@ -10,6 +10,17 @@
10
10
  flex-direction: column;
11
11
  }
12
12
 
13
+ /*
14
+ * Hide content when closed (forceMount keeps items mounted for label registration).
15
+ * Using visibility + position to keep items in DOM for label registration while
16
+ * making them invisible and non-interactive.
17
+ */
18
+ .rt-ComboboxContent:where([data-state='closed']) {
19
+ visibility: hidden;
20
+ position: absolute;
21
+ pointer-events: none;
22
+ }
23
+
13
24
  .rt-ComboboxCommand {
14
25
  display: flex;
15
26
  flex-direction: column;
@@ -39,11 +50,17 @@
39
50
  --base-menu-item-padding-left: var(--space-5);
40
51
  }
41
52
 
42
- /* Override disabled styles when data-disabled is false or empty (cmdk may set it incorrectly) */
53
+ /*
54
+ * Override disabled styles when data-disabled is false or empty (cmdk may set it incorrectly).
55
+ * This CSS-only approach replaces the per-item MutationObserver workaround for better performance.
56
+ * We reset all visual properties that base-menu applies to [data-disabled] items.
57
+ */
43
58
  .rt-BaseMenuContent :where(.rt-BaseMenuItem.rt-ComboboxItem[data-disabled='false']),
44
59
  .rt-BaseMenuContent :where(.rt-BaseMenuItem.rt-ComboboxItem[data-disabled='']) {
45
60
  color: inherit !important;
46
61
  cursor: var(--cursor-menu-item) !important;
62
+ opacity: 1 !important;
63
+ pointer-events: auto !important;
47
64
  }
48
65
 
49
66
  /* Sticky search input with consistent padding */
@@ -69,67 +86,51 @@
69
86
  min-height: 0;
70
87
  }
71
88
 
72
- /* Map cmdk's selected state to base-menu highlighted state */
73
- .rt-BaseMenuContent:where(.rt-variant-solid) {
74
- & :where(.rt-BaseMenuItem.rt-ComboboxItem[data-selected='true']),
75
- & :where(.rt-BaseMenuItem.rt-ComboboxItem[aria-selected='true']) {
76
- background-color: var(--accent-9);
77
- color: var(--accent-contrast);
78
-
79
- & :where(.rt-Text) {
80
- color: inherit !important;
81
- }
82
-
83
- & :where([data-accent-color='gray']:not(.rt-Badge)) {
84
- color: inherit !important;
85
- }
86
- }
89
+ /*
90
+ * Map cmdk's data-selected state to highlighted styling.
91
+ * Mirrors base-menu's [data-highlighted] styling but for cmdk's [data-selected].
92
+ *
93
+ * IMPORTANT: background-color applies only to the item itself.
94
+ * color is explicitly set on ALL descendants (* selector) because user content
95
+ * (Flex, icons, text) may have intermediate wrappers that break CSS inheritance.
96
+ */
97
+
98
+ /* Solid variant - highlighted item */
99
+ .rt-BaseMenuContent:where(.rt-variant-solid) :where(.rt-ComboboxItem[data-selected='true']) {
100
+ background-color: var(--accent-9);
101
+ color: var(--accent-contrast);
87
102
  }
88
103
 
89
- .rt-BaseMenuContent:where(.rt-variant-soft) {
90
- & :where(.rt-BaseMenuItem.rt-ComboboxItem[data-selected='true']),
91
- & :where(.rt-BaseMenuItem.rt-ComboboxItem[aria-selected='true']) {
92
- background-color: var(--accent-4);
93
-
94
- :where([data-panel-background='translucent'], [data-material='translucent']) & {
95
- background-color: var(--accent-a4);
96
- }
97
-
98
- &:where([data-panel-background='solid'], [data-material='solid']) {
99
- background-color: var(--accent-4);
100
- }
101
-
102
- &:where([data-panel-background='translucent'], [data-material='translucent']) {
103
- background-color: var(--accent-a4);
104
- }
105
- }
104
+ /* Force color on all descendants (text, icons, wrappers) */
105
+ .rt-BaseMenuContent:where(.rt-variant-solid) :where(.rt-ComboboxItem[data-selected='true']) * {
106
+ color: var(--accent-contrast) !important;
106
107
  }
107
108
 
108
- .rt-BaseMenuContent:where(.rt-high-contrast) {
109
- & :where(.rt-BaseMenuItem.rt-ComboboxItem[data-selected='true']),
110
- & :where(.rt-BaseMenuItem.rt-ComboboxItem[aria-selected='true']) {
111
- background-color: var(--accent-12);
112
- color: var(--accent-1);
109
+ /* Soft variant - highlighted item */
110
+ .rt-BaseMenuContent:where(.rt-variant-soft) :where(.rt-ComboboxItem[data-selected='true']) {
111
+ background-color: var(--accent-4);
112
+ }
113
113
 
114
- & :where(.rt-Text) {
115
- color: inherit !important;
116
- }
114
+ :where([data-panel-background='translucent'], [data-material='translucent']) .rt-BaseMenuContent:where(.rt-variant-soft) :where(.rt-ComboboxItem[data-selected='true']) {
115
+ background-color: var(--accent-a4);
116
+ }
117
117
 
118
- & :where([data-accent-color='gray']:not(.rt-Badge)) {
119
- color: inherit !important;
120
- }
118
+ /* High contrast - highlighted item */
119
+ .rt-BaseMenuContent:where(.rt-high-contrast) :where(.rt-ComboboxItem[data-selected='true']) {
120
+ background-color: var(--accent-12);
121
+ color: var(--accent-1);
122
+ }
121
123
 
122
- &:where([data-accent-color]) {
123
- background-color: var(--accent-9);
124
- color: var(--accent-contrast);
124
+ .rt-BaseMenuContent:where(.rt-high-contrast) :where(.rt-ComboboxItem[data-selected='true']) * {
125
+ color: var(--accent-1) !important;
126
+ }
125
127
 
126
- & :where(.rt-Text) {
127
- color: inherit !important;
128
- }
128
+ /* High contrast with accent color */
129
+ .rt-BaseMenuContent:where(.rt-high-contrast[data-accent-color]) :where(.rt-ComboboxItem[data-selected='true']) {
130
+ background-color: var(--accent-9);
131
+ color: var(--accent-contrast);
132
+ }
129
133
 
130
- & :where([data-accent-color='gray']:not(.rt-Badge)) {
131
- color: inherit !important;
132
- }
133
- }
134
- }
134
+ .rt-BaseMenuContent:where(.rt-high-contrast[data-accent-color]) :where(.rt-ComboboxItem[data-selected='true']) * {
135
+ color: var(--accent-contrast) !important;
135
136
  }