analytica-frontend-lib 1.1.78 → 1.1.80

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.
package/dist/index.mjs CHANGED
@@ -2274,9 +2274,23 @@ var injectStore3 = (children, store) => {
2274
2274
  return Children3.map(children, (child) => {
2275
2275
  if (isValidElement3(child)) {
2276
2276
  const typedChild = child;
2277
- const newProps = {
2278
- store
2279
- };
2277
+ const displayName = typedChild.type.displayName;
2278
+ const allowed = [
2279
+ "DropdownMenuTrigger",
2280
+ "DropdownContent",
2281
+ "DropdownMenuContent",
2282
+ "DropdownMenuSeparator",
2283
+ "DropdownMenuItem",
2284
+ "MenuLabel",
2285
+ "ProfileMenuTrigger",
2286
+ "ProfileMenuHeader",
2287
+ "ProfileMenuFooter",
2288
+ "ProfileToggleTheme"
2289
+ ];
2290
+ let newProps = {};
2291
+ if (allowed.includes(displayName)) {
2292
+ newProps.store = store;
2293
+ }
2280
2294
  if (typedChild.props.children) {
2281
2295
  newProps.children = injectStore3(typedChild.props.children, store);
2282
2296
  }
@@ -2362,13 +2376,22 @@ var DropdownMenuTrigger = ({
2362
2376
  const open = useStore3(store, (s) => s.open);
2363
2377
  const toggleOpen = () => store.setState({ open: !open });
2364
2378
  return /* @__PURE__ */ jsx20(
2365
- "button",
2379
+ "div",
2366
2380
  {
2367
2381
  onClick: (e) => {
2368
2382
  e.stopPropagation();
2369
2383
  toggleOpen();
2370
2384
  if (onClick) onClick(e);
2371
2385
  },
2386
+ role: "button",
2387
+ onKeyDown: (e) => {
2388
+ if (e.key === "Enter" || e.key === " ") {
2389
+ e.preventDefault();
2390
+ toggleOpen();
2391
+ if (onClick) onClick(e);
2392
+ }
2393
+ },
2394
+ tabIndex: 0,
2372
2395
  "aria-expanded": open,
2373
2396
  className: cn(className),
2374
2397
  ...props,
@@ -11161,6 +11184,7 @@ var QuizResultPerformance = forwardRef21(({ showDetails = true, ...props }, ref)
11161
11184
  });
11162
11185
  var QuizListResult = forwardRef21(({ className, onSubjectClick, ...props }, ref) => {
11163
11186
  const { getQuestionsGroupedBySubject } = useQuizStore();
11187
+ const { isDark } = useTheme();
11164
11188
  const groupedQuestions = getQuestionsGroupedBySubject();
11165
11189
  const subjectsStats = Object.entries(groupedQuestions).map(
11166
11190
  ([subjectId, questions]) => {
@@ -11197,7 +11221,7 @@ var QuizListResult = forwardRef21(({ className, onSubjectClick, ...props }, ref)
11197
11221
  correct_answers: subject.correct,
11198
11222
  incorrect_answers: subject.incorrect,
11199
11223
  icon: subject.subject.icon || "Book",
11200
- color: subject.subject.color || void 0,
11224
+ color: getSubjectColorWithOpacity(subject.subject.color, isDark) || void 0,
11201
11225
  direction: "row"
11202
11226
  }
11203
11227
  ) }, subject.subject.id)) })