@prokodo/ui 0.1.11 → 0.1.13

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 (107) hide show
  1. package/README.md +6 -1
  2. package/dist/components/RTE/RTE.client.js +46 -5
  3. package/dist/components/RTE/RTE.css +226 -6
  4. package/dist/components/RTE/RTE.module.css +226 -6
  5. package/dist/components/RTE/RTE.module.scss.js +3 -0
  6. package/dist/components/RTE/RTE.utils.js +23 -1
  7. package/dist/components/accordion/Accordion.css +46 -0
  8. package/dist/components/accordion/Accordion.module.css +46 -0
  9. package/dist/components/accordion/Accordion.module.scss.js +4 -0
  10. package/dist/components/accordion/Accordion.view.js +25 -5
  11. package/dist/components/autocomplete/Autocomplete.client.js +132 -0
  12. package/dist/components/autocomplete/Autocomplete.css +317 -0
  13. package/dist/components/autocomplete/Autocomplete.js +12 -0
  14. package/dist/components/autocomplete/Autocomplete.lazy.js +12 -0
  15. package/dist/components/autocomplete/Autocomplete.module.css +317 -0
  16. package/dist/components/autocomplete/Autocomplete.module.scss.js +21 -0
  17. package/dist/components/autocomplete/Autocomplete.server.js +11 -0
  18. package/dist/components/autocomplete/Autocomplete.view.js +142 -0
  19. package/dist/components/autocomplete/index.js +4 -0
  20. package/dist/components/button/Button.css +1 -0
  21. package/dist/components/button/Button.module.css +1 -0
  22. package/dist/components/card/Card.css +9 -0
  23. package/dist/components/card/Card.module.css +9 -0
  24. package/dist/components/card/Card.module.scss.js +1 -0
  25. package/dist/components/dynamic-list/DynamicList.view.js +1 -1
  26. package/dist/components/input/Input.css +23 -4
  27. package/dist/components/input/Input.module.css +23 -4
  28. package/dist/components/pagination/Pagination.client.js +14 -0
  29. package/dist/components/pagination/Pagination.css +191 -0
  30. package/dist/components/pagination/Pagination.js +12 -0
  31. package/dist/components/pagination/Pagination.lazy.js +12 -0
  32. package/dist/components/pagination/Pagination.module.css +191 -0
  33. package/dist/components/pagination/Pagination.module.scss.js +12 -0
  34. package/dist/components/pagination/Pagination.server.js +11 -0
  35. package/dist/components/pagination/Pagination.utils.js +55 -0
  36. package/dist/components/pagination/Pagination.view.js +98 -0
  37. package/dist/components/pagination/index.js +4 -0
  38. package/dist/components/rich-text/RichText.css +0 -1
  39. package/dist/components/rich-text/RichText.module.css +0 -1
  40. package/dist/components/select/Select.client.js +230 -8
  41. package/dist/components/select/Select.css +47 -16
  42. package/dist/components/select/Select.module.css +47 -16
  43. package/dist/components/select/Select.module.scss.js +2 -0
  44. package/dist/components/select/Select.view.js +20 -57
  45. package/dist/components/switch/Switch.css +1 -1
  46. package/dist/components/switch/Switch.module.css +1 -1
  47. package/dist/components/switch/Switch.view.js +3 -1
  48. package/dist/components/tabs/Tabs.client.js +182 -0
  49. package/dist/components/tabs/Tabs.css +330 -0
  50. package/dist/components/tabs/Tabs.js +13 -0
  51. package/dist/components/tabs/Tabs.lazy.js +15 -0
  52. package/dist/components/tabs/Tabs.module.css +330 -0
  53. package/dist/components/tabs/Tabs.module.scss.js +19 -0
  54. package/dist/components/tabs/Tabs.server.js +11 -0
  55. package/dist/components/tabs/Tabs.view.js +157 -0
  56. package/dist/components/tabs/index.js +4 -0
  57. package/dist/components/tooltip/Tooltip.client.js +382 -0
  58. package/dist/components/tooltip/Tooltip.css +242 -0
  59. package/dist/components/tooltip/Tooltip.js +16 -0
  60. package/dist/components/tooltip/Tooltip.module.css +242 -0
  61. package/dist/components/tooltip/Tooltip.module.scss.js +15 -0
  62. package/dist/components/tooltip/Tooltip.server.js +12 -0
  63. package/dist/components/tooltip/Tooltip.view.js +127 -0
  64. package/dist/components/tooltip/index.js +4 -0
  65. package/dist/constants/project.js +1 -1
  66. package/dist/index.js +8 -0
  67. package/dist/theme.css +640 -22
  68. package/dist/tsconfig.build.tsbuildinfo +1 -1
  69. package/dist/types/components/RTE/RTE.utils.d.ts +1 -0
  70. package/dist/types/components/accordion/Accordion.d.ts +3 -0
  71. package/dist/types/components/accordion/Accordion.lazy.d.ts +3 -0
  72. package/dist/types/components/accordion/Accordion.model.d.ts +3 -0
  73. package/dist/types/components/accordion/Accordion.view.d.ts +1 -1
  74. package/dist/types/components/autocomplete/Autocomplete.client.d.ts +5 -0
  75. package/dist/types/components/autocomplete/Autocomplete.d.ts +4 -0
  76. package/dist/types/components/autocomplete/Autocomplete.lazy.d.ts +5 -0
  77. package/dist/types/components/autocomplete/Autocomplete.model.d.ts +58 -0
  78. package/dist/types/components/autocomplete/Autocomplete.server.d.ts +3 -0
  79. package/dist/types/components/autocomplete/Autocomplete.view.d.ts +3 -0
  80. package/dist/types/components/autocomplete/index.d.ts +2 -0
  81. package/dist/types/components/card/Card.model.d.ts +1 -1
  82. package/dist/types/components/grid/Grid.model.d.ts +37 -7
  83. package/dist/types/components/pagination/Pagination.client.d.ts +5 -0
  84. package/dist/types/components/pagination/Pagination.d.ts +4 -0
  85. package/dist/types/components/pagination/Pagination.lazy.d.ts +5 -0
  86. package/dist/types/components/pagination/Pagination.model.d.ts +22 -0
  87. package/dist/types/components/pagination/Pagination.server.d.ts +3 -0
  88. package/dist/types/components/pagination/Pagination.utils.d.ts +13 -0
  89. package/dist/types/components/pagination/Pagination.view.d.ts +3 -0
  90. package/dist/types/components/pagination/index.d.ts +2 -0
  91. package/dist/types/components/select/Select.model.d.ts +16 -1
  92. package/dist/types/components/tabs/Tabs.client.d.ts +5 -0
  93. package/dist/types/components/tabs/Tabs.d.ts +4 -0
  94. package/dist/types/components/tabs/Tabs.lazy.d.ts +5 -0
  95. package/dist/types/components/tabs/Tabs.model.d.ts +43 -0
  96. package/dist/types/components/tabs/Tabs.server.d.ts +3 -0
  97. package/dist/types/components/tabs/Tabs.view.d.ts +3 -0
  98. package/dist/types/components/tabs/index.d.ts +2 -0
  99. package/dist/types/components/tooltip/Tooltip.client.d.ts +5 -0
  100. package/dist/types/components/tooltip/Tooltip.d.ts +4 -0
  101. package/dist/types/components/tooltip/Tooltip.lazy.d.ts +5 -0
  102. package/dist/types/components/tooltip/Tooltip.model.d.ts +47 -0
  103. package/dist/types/components/tooltip/Tooltip.server.d.ts +3 -0
  104. package/dist/types/components/tooltip/Tooltip.view.d.ts +3 -0
  105. package/dist/types/components/tooltip/index.d.ts +2 -0
  106. package/dist/types/index.d.ts +4 -0
  107. package/package.json +23 -2
@@ -213,7 +213,6 @@ html[data-theme=dark] .prokodo-RichText__pre {
213
213
  .prokodo-RichText__ul, .prokodo-RichText__ol {
214
214
  padding: 0;
215
215
  list-style-type: none;
216
- color: var(--color-grey-500);
217
216
  }
218
217
  .prokodo-RichText__li {
219
218
  display: flex;
@@ -1,8 +1,9 @@
1
1
  "use client";
2
2
  var __defProp = Object.defineProperty;
3
3
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
4
- import { jsx } from "react/jsx-runtime";
5
- import { memo, useRef, useState, useEffect, useCallback } from "react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { memo, useRef, useState, useEffect, useCallback, useMemo } from "react";
6
+ import { createPortal } from "react-dom";
6
7
  import { SelectView } from "./Select.view.js";
7
8
  function isMulti(v) {
8
9
  return Array.isArray(v);
@@ -30,18 +31,106 @@ function SelectClient({
30
31
  const btnRef = useRef(null);
31
32
  const listRef = useRef(null);
32
33
  const [open, setOpen] = useState(false);
34
+ const [activeIndex, setActiveIndex] = useState(-1);
33
35
  const [val, setVal] = useState(
34
36
  extValue ?? (Boolean(multiple) ? [] : "")
35
37
  );
38
+ const [popupStyle, setPopupStyle] = useState({});
39
+ const [popupReady, setPopupReady] = useState(false);
40
+ const hasPlaceholder = !Boolean(required) && !Boolean(multiple);
41
+ const optionCount = (hasPlaceholder ? 1 : 0) + items.length;
36
42
  useEffect(() => {
37
43
  setVal(extValue ?? (Boolean(multiple) ? [] : ""));
38
44
  }, [extValue, multiple]);
45
+ const clampIndex = useCallback(
46
+ (i) => {
47
+ if (optionCount <= 0) return -1;
48
+ if (i < 0) return optionCount - 1;
49
+ if (i >= optionCount) return 0;
50
+ return i;
51
+ },
52
+ [optionCount]
53
+ );
54
+ const indexToValue = useCallback(
55
+ (i) => {
56
+ var _a, _b;
57
+ if (hasPlaceholder) {
58
+ if (i === 0) return null;
59
+ return (_a = items[i - 1]) == null ? void 0 : _a.value;
60
+ }
61
+ return (_b = items[i]) == null ? void 0 : _b.value;
62
+ },
63
+ [hasPlaceholder, items]
64
+ );
65
+ const valueToIndex = useCallback(() => {
66
+ if (!Boolean(multiple)) {
67
+ const current = String(val ?? "");
68
+ if (hasPlaceholder && current === "") return 0;
69
+ const idx = items.findIndex((x) => String(x.value) === current);
70
+ if (idx >= 0) return idx + (hasPlaceholder ? 1 : 0);
71
+ } else {
72
+ const arr = Array.isArray(val) ? val : [];
73
+ const idx = items.findIndex((x) => arr.includes(x.value));
74
+ if (idx >= 0) return idx + (hasPlaceholder ? 1 : 0);
75
+ }
76
+ return optionCount > 0 ? 0 : -1;
77
+ }, [val, multiple, hasPlaceholder, items, optionCount]);
39
78
  const close = useCallback(() => {
40
79
  var _a;
41
80
  setOpen(false);
81
+ setPopupReady(false);
42
82
  (_a = btnRef == null ? void 0 : btnRef.current) == null ? void 0 : _a.focus();
43
83
  }, []);
44
- const toggle = useCallback(() => setOpen((o) => !o), []);
84
+ const updatePopupPosition = useCallback(() => {
85
+ const btn = btnRef.current;
86
+ if (!btn) return false;
87
+ const r = btn.getBoundingClientRect();
88
+ setPopupStyle({
89
+ position: "fixed",
90
+ left: r.left,
91
+ top: r.bottom,
92
+ width: r.width,
93
+ zIndex: 2147483647
94
+ });
95
+ return true;
96
+ }, []);
97
+ useEffect(() => {
98
+ if (!open || !popupReady) return;
99
+ setActiveIndex(valueToIndex());
100
+ requestAnimationFrame(() => {
101
+ var _a;
102
+ (_a = listRef.current) == null ? void 0 : _a.focus();
103
+ });
104
+ }, [open, popupReady, valueToIndex]);
105
+ const openWithPosition = useCallback(() => {
106
+ if (Boolean(disabled)) return;
107
+ const ok = updatePopupPosition();
108
+ if (ok) setPopupReady(true);
109
+ setOpen(true);
110
+ }, [disabled, updatePopupPosition]);
111
+ const toggle = useCallback(() => {
112
+ setOpen((prev) => {
113
+ if (prev) {
114
+ setPopupReady(false);
115
+ return false;
116
+ }
117
+ openWithPosition();
118
+ return true;
119
+ });
120
+ }, [openWithPosition]);
121
+ useEffect(() => {
122
+ if (!open) return;
123
+ updatePopupPosition();
124
+ setPopupReady(true);
125
+ const onResize = /* @__PURE__ */ __name(() => updatePopupPosition(), "onResize");
126
+ const onScroll = /* @__PURE__ */ __name(() => updatePopupPosition(), "onScroll");
127
+ window.addEventListener("resize", onResize);
128
+ window.addEventListener("scroll", onScroll, true);
129
+ return () => {
130
+ window.removeEventListener("resize", onResize);
131
+ window.removeEventListener("scroll", onScroll, true);
132
+ };
133
+ }, [open, updatePopupPosition]);
45
134
  useEffect(() => {
46
135
  if (!open) return;
47
136
  const handleOutside = /* @__PURE__ */ __name((e) => {
@@ -54,23 +143,40 @@ function SelectClient({
54
143
  return () => window.removeEventListener("click", handleOutside);
55
144
  }, [open, close]);
56
145
  const handleKey = /* @__PURE__ */ __name((e) => {
146
+ var _a, _b;
57
147
  if (Boolean(disabled)) return;
58
148
  if (e.key === "Escape") {
59
149
  e.preventDefault();
60
150
  close();
151
+ return;
152
+ }
153
+ if (e.key === "ArrowDown") {
154
+ e.preventDefault();
155
+ if (!open) {
156
+ openWithPosition();
157
+ return;
158
+ }
159
+ setActiveIndex((i) => clampIndex((i < 0 ? valueToIndex() : i) + 1));
160
+ (_a = listRef.current) == null ? void 0 : _a.focus();
161
+ return;
61
162
  }
62
- if (e.key === "ArrowDown" && !open) {
163
+ if (e.key === "ArrowUp") {
63
164
  e.preventDefault();
64
- setOpen(true);
165
+ if (!open) {
166
+ openWithPosition();
167
+ return;
168
+ }
169
+ setActiveIndex((i) => clampIndex((i < 0 ? valueToIndex() : i) - 1));
170
+ (_b = listRef.current) == null ? void 0 : _b.focus();
65
171
  }
66
172
  }, "handleKey");
67
- const dataset = (() => {
173
+ const dataset = useMemo(() => {
68
174
  const d = {};
69
175
  for (const [k, v] of Object.entries(rest)) {
70
176
  if (k.startsWith("data-")) d[toDatasetKey(k.slice(5))] = v;
71
177
  }
72
178
  return d;
73
- })();
179
+ }, [rest]);
74
180
  const clickOption = /* @__PURE__ */ __name((opt) => {
75
181
  const newVal = opt === null ? Boolean(multiple) ? [] : "" : mergeValue(val, opt, multiple);
76
182
  const syntheticEvt = { target: { dataset } };
@@ -78,6 +184,12 @@ function SelectClient({
78
184
  onChange == null ? void 0 : onChange(syntheticEvt, newVal);
79
185
  if (!Boolean(multiple)) close();
80
186
  }, "clickOption");
187
+ const onOptionKeyDown = /* @__PURE__ */ __name((e, v) => {
188
+ if (e.key === "Enter" || e.key === " ") {
189
+ e.preventDefault();
190
+ clickOption(v);
191
+ }
192
+ }, "onOptionKeyDown");
81
193
  return /* @__PURE__ */ jsx(
82
194
  SelectView,
83
195
  {
@@ -94,7 +206,117 @@ function SelectClient({
94
206
  listRef,
95
207
  onButtonClick: toggle,
96
208
  onButtonKey: handleKey,
97
- onOptionClick: clickOption
209
+ onOptionClick: clickOption,
210
+ renderListbox: /* @__PURE__ */ __name((args) => {
211
+ if (!args.open) return null;
212
+ if (!popupReady) return null;
213
+ if (typeof document === "undefined") return null;
214
+ const onListKeyDown = /* @__PURE__ */ __name((e) => {
215
+ if (e.key === "Escape") {
216
+ e.preventDefault();
217
+ close();
218
+ return;
219
+ }
220
+ if (e.key === "ArrowDown") {
221
+ e.preventDefault();
222
+ setActiveIndex((i) => clampIndex((i < 0 ? valueToIndex() : i) + 1));
223
+ return;
224
+ }
225
+ if (e.key === "ArrowUp") {
226
+ e.preventDefault();
227
+ setActiveIndex((i) => clampIndex((i < 0 ? valueToIndex() : i) - 1));
228
+ return;
229
+ }
230
+ if (e.key === "Home") {
231
+ e.preventDefault();
232
+ setActiveIndex(optionCount > 0 ? 0 : -1);
233
+ return;
234
+ }
235
+ if (e.key === "End") {
236
+ e.preventDefault();
237
+ setActiveIndex(optionCount > 0 ? optionCount - 1 : -1);
238
+ return;
239
+ }
240
+ if (e.key === "Enter" || e.key === " ") {
241
+ e.preventDefault();
242
+ const v = indexToValue(activeIndex);
243
+ clickOption(v);
244
+ }
245
+ }, "onListKeyDown");
246
+ const listbox = /* @__PURE__ */ jsxs(
247
+ "ul",
248
+ {
249
+ ref: listRef,
250
+ "aria-multiselectable": Boolean(args.multiple) || void 0,
251
+ className: args.className,
252
+ id: args.id,
253
+ role: "listbox",
254
+ style: popupStyle,
255
+ tabIndex: 0,
256
+ "aria-activedescendant": activeIndex >= 0 ? `${args.id}-opt-${activeIndex}` : void 0,
257
+ onKeyDown: onListKeyDown,
258
+ children: [
259
+ !Boolean(args.required) && !Boolean(args.multiple) && /* @__PURE__ */ jsx(
260
+ "li",
261
+ {
262
+ id: `${args.id}-opt-0`,
263
+ role: "option",
264
+ tabIndex: -1,
265
+ "aria-selected": Array.isArray(args.value) ? args.value.length === 0 : String(args.value ?? "") === "",
266
+ className: args.bemItem({
267
+ selected: Array.isArray(args.value) ? args.value.length === 0 : String(args.value ?? "") === "",
268
+ active: activeIndex === 0
269
+ }),
270
+ onClick: /* @__PURE__ */ __name(() => args.onOptionClick(null), "onClick"),
271
+ onKeyDown: /* @__PURE__ */ __name((e) => onOptionKeyDown(e, null), "onKeyDown"),
272
+ onMouseMove: /* @__PURE__ */ __name(() => setActiveIndex(0), "onMouseMove"),
273
+ children: args.placeholder
274
+ },
275
+ "placeholder"
276
+ ),
277
+ args.items.map((opt) => {
278
+ var _a;
279
+ const hasPh = !Boolean(args.required) && !Boolean(args.multiple);
280
+ const idx = args.items.findIndex((x) => x.value === opt.value);
281
+ const index = idx + (hasPh ? 1 : 0);
282
+ const selected = Array.isArray(args.value) ? args.value.includes(opt.value) : opt.value === args.value;
283
+ return /* @__PURE__ */ jsxs(
284
+ "li",
285
+ {
286
+ "aria-selected": selected,
287
+ id: `${args.id}-opt-${index}`,
288
+ role: "option",
289
+ tabIndex: -1,
290
+ className: args.bemItem({
291
+ selected,
292
+ active: activeIndex === index
293
+ }),
294
+ onClick: /* @__PURE__ */ __name(() => args.onOptionClick(opt.value), "onClick"),
295
+ onKeyDown: /* @__PURE__ */ __name((e) => onOptionKeyDown(e, opt.value), "onKeyDown"),
296
+ onMouseMove: /* @__PURE__ */ __name(() => setActiveIndex(index), "onMouseMove"),
297
+ children: [
298
+ Boolean(args.multiple) && /* @__PURE__ */ jsx(
299
+ "input",
300
+ {
301
+ readOnly: true,
302
+ "aria-hidden": "true",
303
+ className: args.bemCheckbox({ checked: selected }),
304
+ defaultChecked: selected,
305
+ type: "checkbox"
306
+ }
307
+ ),
308
+ Boolean(args.iconVisible) && ((_a = opt.icon) == null ? void 0 : _a.call(opt)),
309
+ opt.label
310
+ ]
311
+ },
312
+ `${args.id}-${opt.value}`
313
+ );
314
+ })
315
+ ]
316
+ }
317
+ );
318
+ return createPortal(listbox, document.body);
319
+ }, "renderListbox")
98
320
  }
99
321
  }
100
322
  );
@@ -127,22 +127,19 @@
127
127
  */
128
128
  /* fade-in / out for the popup ------------------------------------------------ */
129
129
  @keyframes fade-in {
130
- 0% {
130
+ from {
131
131
  opacity: 0;
132
- transform: scale(0.95, 0.8);
133
132
  }
134
- 100% {
133
+ to {
135
134
  opacity: 1;
136
135
  }
137
136
  }
138
137
  @keyframes fade-out {
139
- 0% {
138
+ from {
140
139
  opacity: 1;
141
- transform: scale(1, 1);
142
140
  }
143
- 100% {
141
+ to {
144
142
  opacity: 0;
145
- transform: scale(0.95, 0.8);
146
143
  }
147
144
  }
148
145
  .prokodo-Select {
@@ -180,6 +177,9 @@
180
177
  -webkit-box-orient: vertical;
181
178
  overflow: hidden;
182
179
  }
180
+ html[data-theme=dark] .prokodo-Select__label {
181
+ background-color: rgb(16, 19, 27);
182
+ }
183
183
  }
184
184
  .prokodo-Select__field {
185
185
  position: relative;
@@ -189,6 +189,7 @@
189
189
  }
190
190
  .prokodo-Select__field--expanded {
191
191
  box-shadow: none;
192
+ z-index: 100;
192
193
  }
193
194
  .prokodo-Select__button {
194
195
  box-sizing: border-box;
@@ -219,7 +220,7 @@
219
220
  background: var(--gradient-border-4);
220
221
  }
221
222
  .prokodo-Select__button:disabled {
222
- color: var(--color-grey-300);
223
+ color: var(--color-grey-700);
223
224
  cursor: default;
224
225
  background: var(--gradient-border-8);
225
226
  }
@@ -251,9 +252,8 @@
251
252
  align-items: center;
252
253
  padding: 0.875rem 1rem;
253
254
  margin: 2px;
254
- background: var(--color-white);
255
- border-radius: 1.5rem;
256
255
  background-color: var(--color-white);
256
+ border-radius: 1.5rem;
257
257
  font-weight: 400;
258
258
  font-size: 1.125rem;
259
259
  font-family: var(--font-secondary), -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
@@ -274,6 +274,9 @@
274
274
  font-size: 1rem;
275
275
  }
276
276
  }
277
+ html[data-theme=dark] .prokodo-Select__button__inner {
278
+ background-color: rgb(16, 19, 27);
279
+ }
277
280
  .prokodo-Select__button__inner {
278
281
  font-size: 1rem;
279
282
  }
@@ -287,10 +290,9 @@
287
290
  color: var(--color-grey-500);
288
291
  }
289
292
  .prokodo-Select__button__inner--is-placeholder--disabled {
290
- color: var(--color-grey-300);
293
+ color: var(--color-grey-500);
291
294
  }
292
295
  .prokodo-Select__listbox {
293
- position: absolute;
294
296
  box-sizing: border-box;
295
297
  padding: 2px;
296
298
  margin: -2px 0 0 0;
@@ -304,7 +306,7 @@
304
306
  background: var(--gradient-border-4);
305
307
  box-shadow: var(--elevation-3);
306
308
  scrollbar-width: none;
307
- z-index: 10;
309
+ z-index: 2147483647;
308
310
  /* animation – your JS toggles .is-open / .is-closed */
309
311
  }
310
312
  .prokodo-Select__listbox--is-open {
@@ -335,6 +337,8 @@
335
337
  text-decoration: none;
336
338
  /* hover / focus */
337
339
  /* selected */
340
+ /* keyboard "active" option (aria-activedescendant) */
341
+ /* if both selected + active, keep it clearly active */
338
342
  /* disabled (if you add aria-disabled) */
339
343
  }
340
344
  @media screen and (min-width: 480px) {
@@ -347,6 +351,9 @@
347
351
  font-size: 1rem;
348
352
  }
349
353
  }
354
+ html[data-theme=dark] .prokodo-Select__item {
355
+ background: rgb(16, 19, 27);
356
+ }
350
357
  .prokodo-Select__item {
351
358
  font-size: 1rem;
352
359
  }
@@ -355,14 +362,35 @@
355
362
  border-bottom-right-radius: 1.5625rem;
356
363
  }
357
364
  .prokodo-Select__item:hover {
358
- background-color: var(--color-grey-50);
365
+ background: var(--color-primary-50);
366
+ }
367
+ html[data-theme=dark] .prokodo-Select__item:hover {
368
+ background: var(--color-primary-50);
359
369
  }
360
370
  .prokodo-Select__item:focus-visible {
361
371
  outline: 0;
362
- background: var(--color-primary-100);
372
+ background: var(--color-primary-50);
373
+ }
374
+ html[data-theme=dark] .prokodo-Select__item:focus-visible {
375
+ background: var(--color-primary-50);
363
376
  }
364
377
  .prokodo-Select__item--selected {
365
- background-color: var(--color-primary-50);
378
+ background: var(--color-primary-100);
379
+ }
380
+ html[data-theme=dark] .prokodo-Select__item--selected {
381
+ background: var(--color-primary-100);
382
+ }
383
+ .prokodo-Select__item--active {
384
+ background: var(--color-primary-100);
385
+ }
386
+ html[data-theme=dark] .prokodo-Select__item--active {
387
+ background: var(--color-primary-100);
388
+ }
389
+ .prokodo-Select__item--selected--active {
390
+ background: var(--color-primary-100);
391
+ }
392
+ html[data-theme=dark] .prokodo-Select__item--selected--active {
393
+ background: var(--color-primary-100);
366
394
  }
367
395
  .prokodo-Select__item[aria-disabled=true] {
368
396
  color: var(--color-grey-400);
@@ -392,6 +420,9 @@
392
420
  inset: 2px;
393
421
  background: var(--color-white);
394
422
  }
423
+ html[data-theme=dark] .prokodo-Select__checkbox:before {
424
+ background-color: rgb(16, 19, 27);
425
+ }
395
426
  .prokodo-Select__checkbox--checked { /* gradient + tick mark */
396
427
  background: var(--gradient-border-4);
397
428
  }
@@ -127,22 +127,19 @@
127
127
  */
128
128
  /* fade-in / out for the popup ------------------------------------------------ */
129
129
  @keyframes fade-in {
130
- 0% {
130
+ from {
131
131
  opacity: 0;
132
- transform: scale(0.95, 0.8);
133
132
  }
134
- 100% {
133
+ to {
135
134
  opacity: 1;
136
135
  }
137
136
  }
138
137
  @keyframes fade-out {
139
- 0% {
138
+ from {
140
139
  opacity: 1;
141
- transform: scale(1, 1);
142
140
  }
143
- 100% {
141
+ to {
144
142
  opacity: 0;
145
- transform: scale(0.95, 0.8);
146
143
  }
147
144
  }
148
145
  .prokodo-Select {
@@ -180,6 +177,9 @@
180
177
  -webkit-box-orient: vertical;
181
178
  overflow: hidden;
182
179
  }
180
+ html[data-theme=dark] .prokodo-Select__label {
181
+ background-color: rgb(16, 19, 27);
182
+ }
183
183
  }
184
184
  .prokodo-Select__field {
185
185
  position: relative;
@@ -189,6 +189,7 @@
189
189
  }
190
190
  .prokodo-Select__field--expanded {
191
191
  box-shadow: none;
192
+ z-index: 100;
192
193
  }
193
194
  .prokodo-Select__button {
194
195
  box-sizing: border-box;
@@ -219,7 +220,7 @@
219
220
  background: var(--gradient-border-4);
220
221
  }
221
222
  .prokodo-Select__button:disabled {
222
- color: var(--color-grey-300);
223
+ color: var(--color-grey-700);
223
224
  cursor: default;
224
225
  background: var(--gradient-border-8);
225
226
  }
@@ -251,9 +252,8 @@
251
252
  align-items: center;
252
253
  padding: 0.875rem 1rem;
253
254
  margin: 2px;
254
- background: var(--color-white);
255
- border-radius: 1.5rem;
256
255
  background-color: var(--color-white);
256
+ border-radius: 1.5rem;
257
257
  font-weight: 400;
258
258
  font-size: 1.125rem;
259
259
  font-family: var(--font-secondary), -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
@@ -274,6 +274,9 @@
274
274
  font-size: 1rem;
275
275
  }
276
276
  }
277
+ html[data-theme=dark] .prokodo-Select__button__inner {
278
+ background-color: rgb(16, 19, 27);
279
+ }
277
280
  .prokodo-Select__button__inner {
278
281
  font-size: 1rem;
279
282
  }
@@ -287,10 +290,9 @@
287
290
  color: var(--color-grey-500);
288
291
  }
289
292
  .prokodo-Select__button__inner--is-placeholder--disabled {
290
- color: var(--color-grey-300);
293
+ color: var(--color-grey-500);
291
294
  }
292
295
  .prokodo-Select__listbox {
293
- position: absolute;
294
296
  box-sizing: border-box;
295
297
  padding: 2px;
296
298
  margin: -2px 0 0 0;
@@ -304,7 +306,7 @@
304
306
  background: var(--gradient-border-4);
305
307
  box-shadow: var(--elevation-3);
306
308
  scrollbar-width: none;
307
- z-index: 10;
309
+ z-index: 2147483647;
308
310
  /* animation – your JS toggles .is-open / .is-closed */
309
311
  }
310
312
  .prokodo-Select__listbox--is-open {
@@ -335,6 +337,8 @@
335
337
  text-decoration: none;
336
338
  /* hover / focus */
337
339
  /* selected */
340
+ /* keyboard "active" option (aria-activedescendant) */
341
+ /* if both selected + active, keep it clearly active */
338
342
  /* disabled (if you add aria-disabled) */
339
343
  }
340
344
  @media screen and (min-width: 480px) {
@@ -347,6 +351,9 @@
347
351
  font-size: 1rem;
348
352
  }
349
353
  }
354
+ html[data-theme=dark] .prokodo-Select__item {
355
+ background: rgb(16, 19, 27);
356
+ }
350
357
  .prokodo-Select__item {
351
358
  font-size: 1rem;
352
359
  }
@@ -355,14 +362,35 @@
355
362
  border-bottom-right-radius: 1.5625rem;
356
363
  }
357
364
  .prokodo-Select__item:hover {
358
- background-color: var(--color-grey-50);
365
+ background: var(--color-primary-50);
366
+ }
367
+ html[data-theme=dark] .prokodo-Select__item:hover {
368
+ background: var(--color-primary-50);
359
369
  }
360
370
  .prokodo-Select__item:focus-visible {
361
371
  outline: 0;
362
- background: var(--color-primary-100);
372
+ background: var(--color-primary-50);
373
+ }
374
+ html[data-theme=dark] .prokodo-Select__item:focus-visible {
375
+ background: var(--color-primary-50);
363
376
  }
364
377
  .prokodo-Select__item--selected {
365
- background-color: var(--color-primary-50);
378
+ background: var(--color-primary-100);
379
+ }
380
+ html[data-theme=dark] .prokodo-Select__item--selected {
381
+ background: var(--color-primary-100);
382
+ }
383
+ .prokodo-Select__item--active {
384
+ background: var(--color-primary-100);
385
+ }
386
+ html[data-theme=dark] .prokodo-Select__item--active {
387
+ background: var(--color-primary-100);
388
+ }
389
+ .prokodo-Select__item--selected--active {
390
+ background: var(--color-primary-100);
391
+ }
392
+ html[data-theme=dark] .prokodo-Select__item--selected--active {
393
+ background: var(--color-primary-100);
366
394
  }
367
395
  .prokodo-Select__item[aria-disabled=true] {
368
396
  color: var(--color-grey-400);
@@ -392,6 +420,9 @@
392
420
  inset: 2px;
393
421
  background: var(--color-white);
394
422
  }
423
+ html[data-theme=dark] .prokodo-Select__checkbox:before {
424
+ background-color: rgb(16, 19, 27);
425
+ }
395
426
  .prokodo-Select__checkbox--checked { /* gradient + tick mark */
396
427
  background: var(--gradient-border-4);
397
428
  }
@@ -19,6 +19,8 @@ const styles = {
19
19
  "fade-out": "fade-out",
20
20
  "prokodo-Select__item": "prokodo-Select__item",
21
21
  "prokodo-Select__item--selected": "prokodo-Select__item--selected",
22
+ "prokodo-Select__item--active": "prokodo-Select__item--active",
23
+ "prokodo-Select__item--selected--active": "prokodo-Select__item--selected--active",
22
24
  "prokodo-Select__checkbox": "prokodo-Select__checkbox",
23
25
  "prokodo-Select__checkbox--checked": "prokodo-Select__checkbox--checked",
24
26
  "prokodo-Select__helperText": "prokodo-Select__helperText",