analytica-frontend-lib 1.1.95 → 1.1.97

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 (41) hide show
  1. package/dist/Accordation/index.d.mts +4 -1
  2. package/dist/Accordation/index.d.ts +4 -1
  3. package/dist/Accordation/index.js +37 -8
  4. package/dist/Accordation/index.js.map +1 -1
  5. package/dist/Accordation/index.mjs +39 -9
  6. package/dist/Accordation/index.mjs.map +1 -1
  7. package/dist/Input/index.js +8 -2
  8. package/dist/Input/index.js.map +1 -1
  9. package/dist/Input/index.mjs +8 -2
  10. package/dist/Input/index.mjs.map +1 -1
  11. package/dist/Quiz/index.js +8 -2
  12. package/dist/Quiz/index.js.map +1 -1
  13. package/dist/Quiz/index.mjs +8 -2
  14. package/dist/Quiz/index.mjs.map +1 -1
  15. package/dist/StatisticsCard/index.d.mts +3 -1
  16. package/dist/StatisticsCard/index.d.ts +3 -1
  17. package/dist/StatisticsCard/index.js +23 -8
  18. package/dist/StatisticsCard/index.js.map +1 -1
  19. package/dist/StatisticsCard/index.mjs +23 -8
  20. package/dist/StatisticsCard/index.mjs.map +1 -1
  21. package/dist/Table/index.d.mts +17 -4
  22. package/dist/Table/index.d.ts +17 -4
  23. package/dist/Table/index.js +65 -38
  24. package/dist/Table/index.js.map +1 -1
  25. package/dist/Table/index.mjs +65 -38
  26. package/dist/Table/index.mjs.map +1 -1
  27. package/dist/TextArea/index.js +8 -2
  28. package/dist/TextArea/index.js.map +1 -1
  29. package/dist/TextArea/index.mjs +8 -2
  30. package/dist/TextArea/index.mjs.map +1 -1
  31. package/dist/index.css +44 -0
  32. package/dist/index.css.map +1 -1
  33. package/dist/index.d.mts +12 -2
  34. package/dist/index.d.ts +12 -2
  35. package/dist/index.js +1196 -949
  36. package/dist/index.js.map +1 -1
  37. package/dist/index.mjs +1020 -772
  38. package/dist/index.mjs.map +1 -1
  39. package/dist/styles.css +44 -0
  40. package/dist/styles.css.map +1 -1
  41. package/package.json +1 -1
@@ -5,8 +5,11 @@ interface CardAccordationProps extends HTMLAttributes<HTMLDivElement> {
5
5
  trigger: ReactNode;
6
6
  children: ReactNode;
7
7
  defaultExpanded?: boolean;
8
+ expanded?: boolean;
8
9
  onToggleExpanded?: (isExpanded: boolean) => void;
10
+ value?: string;
11
+ disabled?: boolean;
9
12
  }
10
13
  declare const CardAccordation: react.ForwardRefExoticComponent<CardAccordationProps & react.RefAttributes<HTMLDivElement>>;
11
14
 
12
- export { CardAccordation };
15
+ export { CardAccordation, type CardAccordationProps };
@@ -5,8 +5,11 @@ interface CardAccordationProps extends HTMLAttributes<HTMLDivElement> {
5
5
  trigger: ReactNode;
6
6
  children: ReactNode;
7
7
  defaultExpanded?: boolean;
8
+ expanded?: boolean;
8
9
  onToggleExpanded?: (isExpanded: boolean) => void;
10
+ value?: string;
11
+ disabled?: boolean;
9
12
  }
10
13
  declare const CardAccordation: react.ForwardRefExoticComponent<CardAccordationProps & react.RefAttributes<HTMLDivElement>>;
11
14
 
12
- export { CardAccordation };
15
+ export { CardAccordation, type CardAccordationProps };
@@ -2165,17 +2165,33 @@ var CardAccordation = (0, import_react3.forwardRef)(
2165
2165
  children,
2166
2166
  className,
2167
2167
  defaultExpanded = false,
2168
+ expanded: controlledExpanded,
2168
2169
  onToggleExpanded,
2170
+ value,
2171
+ disabled = false,
2169
2172
  ...props
2170
2173
  }, ref) => {
2171
- const [isExpanded, setIsExpanded] = (0, import_react3.useState)(defaultExpanded);
2172
- const contentId = (0, import_react3.useId)();
2174
+ const [internalExpanded, setInternalExpanded] = (0, import_react3.useState)(defaultExpanded);
2175
+ const generatedId = (0, import_react3.useId)();
2176
+ const contentId = value ? `accordion-content-${value}` : generatedId;
2177
+ const headerId = value ? `accordion-header-${value}` : `${generatedId}-header`;
2178
+ const isControlled = controlledExpanded !== void 0;
2179
+ const isExpanded = isControlled ? controlledExpanded : internalExpanded;
2180
+ (0, import_react3.useEffect)(() => {
2181
+ if (isControlled) {
2182
+ setInternalExpanded(controlledExpanded);
2183
+ }
2184
+ }, [isControlled, controlledExpanded]);
2173
2185
  const handleToggle = () => {
2186
+ if (disabled) return;
2174
2187
  const newExpanded = !isExpanded;
2175
- setIsExpanded(newExpanded);
2188
+ if (!isControlled) {
2189
+ setInternalExpanded(newExpanded);
2190
+ }
2176
2191
  onToggleExpanded?.(newExpanded);
2177
2192
  };
2178
2193
  const handleKeyDown = (event) => {
2194
+ if (disabled) return;
2179
2195
  if (event.key === "Enter" || event.key === " ") {
2180
2196
  event.preventDefault();
2181
2197
  handleToggle();
@@ -2194,11 +2210,19 @@ var CardAccordation = (0, import_react3.forwardRef)(
2194
2210
  /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
2195
2211
  "button",
2196
2212
  {
2213
+ id: headerId,
2214
+ type: "button",
2197
2215
  onClick: handleToggle,
2198
2216
  onKeyDown: handleKeyDown,
2199
- className: "w-full cursor-pointer text-text-950 not-aria-expanded:rounded-xl aria-expanded:rounded-t-xl p-4 flex items-center justify-between gap-3 text-left transition-colors duration-200 focus:outline-none focus:border-2 focus:border-primary-950 focus:ring-inset",
2217
+ disabled,
2218
+ className: cn(
2219
+ "w-full cursor-pointer not-aria-expanded:rounded-xl aria-expanded:rounded-t-xl flex items-center justify-between gap-3 text-left transition-colors duration-200 focus:outline-none focus:border-2 focus:border-primary-950 focus:ring-inset px-2",
2220
+ disabled && "cursor-not-allowed text-text-400"
2221
+ ),
2200
2222
  "aria-expanded": isExpanded,
2201
- "aria-controls": "accordion-content",
2223
+ "aria-controls": contentId,
2224
+ "aria-disabled": disabled,
2225
+ "data-value": value,
2202
2226
  children: [
2203
2227
  trigger,
2204
2228
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
@@ -2206,7 +2230,8 @@ var CardAccordation = (0, import_react3.forwardRef)(
2206
2230
  {
2207
2231
  size: 20,
2208
2232
  className: cn(
2209
- "text-text-700 transition-transform duration-200 flex-shrink-0",
2233
+ "transition-transform duration-200 flex-shrink-0",
2234
+ disabled ? "text-gray-400" : "text-text-700",
2210
2235
  isExpanded ? "rotate-90" : "rotate-0"
2211
2236
  ),
2212
2237
  "data-testid": "accordion-caret"
@@ -2216,15 +2241,18 @@ var CardAccordation = (0, import_react3.forwardRef)(
2216
2241
  }
2217
2242
  ),
2218
2243
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2219
- "div",
2244
+ "section",
2220
2245
  {
2221
2246
  id: contentId,
2247
+ "aria-labelledby": headerId,
2248
+ "aria-hidden": !isExpanded,
2222
2249
  className: cn(
2223
2250
  "transition-all duration-300 ease-in-out overflow-hidden",
2224
2251
  isExpanded ? "max-h-screen opacity-100" : "max-h-0 opacity-0"
2225
2252
  ),
2226
2253
  "data-testid": "accordion-content",
2227
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "p-4 pt-0 border-border-50", children })
2254
+ "data-value": value,
2255
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "p-4 pt-0", children })
2228
2256
  }
2229
2257
  )
2230
2258
  ]
@@ -2232,6 +2260,7 @@ var CardAccordation = (0, import_react3.forwardRef)(
2232
2260
  );
2233
2261
  }
2234
2262
  );
2263
+ CardAccordation.displayName = "CardAccordation";
2235
2264
  // Annotate the CommonJS export names for ESM import in node:
2236
2265
  0 && (module.exports = {
2237
2266
  CardAccordation