analytica-frontend-lib 1.1.93 → 1.1.95

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/BreadcrumbMenu/breadcrumbStore/index.d.mts +77 -0
  2. package/dist/BreadcrumbMenu/breadcrumbStore/index.d.ts +77 -0
  3. package/dist/BreadcrumbMenu/breadcrumbStore/index.js +146 -0
  4. package/dist/BreadcrumbMenu/breadcrumbStore/index.js.map +1 -0
  5. package/dist/BreadcrumbMenu/breadcrumbStore/index.mjs +120 -0
  6. package/dist/BreadcrumbMenu/breadcrumbStore/index.mjs.map +1 -0
  7. package/dist/BreadcrumbMenu/index.d.mts +31 -0
  8. package/dist/BreadcrumbMenu/index.d.ts +31 -0
  9. package/dist/BreadcrumbMenu/index.js +308 -0
  10. package/dist/BreadcrumbMenu/index.js.map +1 -0
  11. package/dist/BreadcrumbMenu/index.mjs +289 -0
  12. package/dist/BreadcrumbMenu/index.mjs.map +1 -0
  13. package/dist/BreadcrumbMenu/useBreadcrumbBuilder/index.d.mts +48 -0
  14. package/dist/BreadcrumbMenu/useBreadcrumbBuilder/index.d.ts +48 -0
  15. package/dist/BreadcrumbMenu/useBreadcrumbBuilder/index.js +189 -0
  16. package/dist/BreadcrumbMenu/useBreadcrumbBuilder/index.js.map +1 -0
  17. package/dist/BreadcrumbMenu/useBreadcrumbBuilder/index.mjs +164 -0
  18. package/dist/BreadcrumbMenu/useBreadcrumbBuilder/index.mjs.map +1 -0
  19. package/dist/BreadcrumbMenu/useUrlParams/index.d.mts +28 -0
  20. package/dist/BreadcrumbMenu/useUrlParams/index.d.ts +28 -0
  21. package/dist/BreadcrumbMenu/useUrlParams/index.js +43 -0
  22. package/dist/BreadcrumbMenu/useUrlParams/index.js.map +1 -0
  23. package/dist/BreadcrumbMenu/useUrlParams/index.mjs +18 -0
  24. package/dist/BreadcrumbMenu/useUrlParams/index.mjs.map +1 -0
  25. package/dist/StatisticsCard/index.d.mts +77 -0
  26. package/dist/StatisticsCard/index.d.ts +77 -0
  27. package/dist/StatisticsCard/index.js +608 -0
  28. package/dist/StatisticsCard/index.js.map +1 -0
  29. package/dist/StatisticsCard/index.mjs +589 -0
  30. package/dist/StatisticsCard/index.mjs.map +1 -0
  31. package/dist/index.css +41 -0
  32. package/dist/index.css.map +1 -1
  33. package/dist/index.d.mts +5 -0
  34. package/dist/index.d.ts +5 -0
  35. package/dist/index.js +699 -354
  36. package/dist/index.js.map +1 -1
  37. package/dist/index.mjs +679 -339
  38. package/dist/index.mjs.map +1 -1
  39. package/dist/styles.css +41 -0
  40. package/dist/styles.css.map +1 -1
  41. package/package.json +3 -1
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/components/BreadcrumbMenu/useUrlParams.ts
21
+ var useUrlParams_exports = {};
22
+ __export(useUrlParams_exports, {
23
+ useUrlParams: () => useUrlParams
24
+ });
25
+ module.exports = __toCommonJS(useUrlParams_exports);
26
+ var import_react = require("react");
27
+ var import_react_router_dom = require("react-router-dom");
28
+ var useUrlParams = (config) => {
29
+ const location = (0, import_react_router_dom.useLocation)();
30
+ return (0, import_react.useMemo)(() => {
31
+ const segments = location.pathname.split("/").filter(Boolean);
32
+ const params = {};
33
+ for (const [key, index] of Object.entries(config)) {
34
+ params[key] = segments[index];
35
+ }
36
+ return params;
37
+ }, [location.pathname, config]);
38
+ };
39
+ // Annotate the CommonJS export names for ESM import in node:
40
+ 0 && (module.exports = {
41
+ useUrlParams
42
+ });
43
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/BreadcrumbMenu/useUrlParams.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { useLocation } from 'react-router-dom';\n\n/**\n * Configuração para extração de parâmetros da URL\n */\nexport interface UrlParamsConfig {\n /** Mapa de nome do parâmetro para seu índice no path */\n [key: string]: number;\n}\n\n/**\n * Hook genérico para extrair parâmetros de uma URL baseado em índices\n *\n * @param config - Configuração com os índices dos parâmetros no path\n * @returns Objeto com os parâmetros extraídos\n *\n * @example\n * ```tsx\n * // URL: /desempenho/lista-temas/123/subtemas/456\n * // Path segments: ['desempenho', 'lista-temas', '123', 'subtemas', '456']\n * const params = useUrlParams({\n * subjectId: 2, // índice 2 = '123'\n * topicId: 4, // índice 4 = '456'\n * });\n *\n * console.log(params); // { subjectId: '123', topicId: '456' }\n * ```\n */\nexport const useUrlParams = <T extends UrlParamsConfig>(\n config: T\n): Record<keyof T, string | undefined> => {\n const location = useLocation();\n\n return useMemo(() => {\n const segments = location.pathname.split('/').filter(Boolean);\n const params: Record<string, string | undefined> = {};\n\n for (const [key, index] of Object.entries(config)) {\n params[key] = segments[index];\n }\n\n return params as Record<keyof T, string | undefined>;\n }, [location.pathname, config]);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAwB;AACxB,8BAA4B;AA4BrB,IAAM,eAAe,CAC1B,WACwC;AACxC,QAAM,eAAW,qCAAY;AAE7B,aAAO,sBAAQ,MAAM;AACnB,UAAM,WAAW,SAAS,SAAS,MAAM,GAAG,EAAE,OAAO,OAAO;AAC5D,UAAM,SAA6C,CAAC;AAEpD,eAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,MAAM,GAAG;AACjD,aAAO,GAAG,IAAI,SAAS,KAAK;AAAA,IAC9B;AAEA,WAAO;AAAA,EACT,GAAG,CAAC,SAAS,UAAU,MAAM,CAAC;AAChC;","names":[]}
@@ -0,0 +1,18 @@
1
+ // src/components/BreadcrumbMenu/useUrlParams.ts
2
+ import { useMemo } from "react";
3
+ import { useLocation } from "react-router-dom";
4
+ var useUrlParams = (config) => {
5
+ const location = useLocation();
6
+ return useMemo(() => {
7
+ const segments = location.pathname.split("/").filter(Boolean);
8
+ const params = {};
9
+ for (const [key, index] of Object.entries(config)) {
10
+ params[key] = segments[index];
11
+ }
12
+ return params;
13
+ }, [location.pathname, config]);
14
+ };
15
+ export {
16
+ useUrlParams
17
+ };
18
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/BreadcrumbMenu/useUrlParams.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { useLocation } from 'react-router-dom';\n\n/**\n * Configuração para extração de parâmetros da URL\n */\nexport interface UrlParamsConfig {\n /** Mapa de nome do parâmetro para seu índice no path */\n [key: string]: number;\n}\n\n/**\n * Hook genérico para extrair parâmetros de uma URL baseado em índices\n *\n * @param config - Configuração com os índices dos parâmetros no path\n * @returns Objeto com os parâmetros extraídos\n *\n * @example\n * ```tsx\n * // URL: /desempenho/lista-temas/123/subtemas/456\n * // Path segments: ['desempenho', 'lista-temas', '123', 'subtemas', '456']\n * const params = useUrlParams({\n * subjectId: 2, // índice 2 = '123'\n * topicId: 4, // índice 4 = '456'\n * });\n *\n * console.log(params); // { subjectId: '123', topicId: '456' }\n * ```\n */\nexport const useUrlParams = <T extends UrlParamsConfig>(\n config: T\n): Record<keyof T, string | undefined> => {\n const location = useLocation();\n\n return useMemo(() => {\n const segments = location.pathname.split('/').filter(Boolean);\n const params: Record<string, string | undefined> = {};\n\n for (const [key, index] of Object.entries(config)) {\n params[key] = segments[index];\n }\n\n return params as Record<keyof T, string | undefined>;\n }, [location.pathname, config]);\n};\n"],"mappings":";AAAA,SAAS,eAAe;AACxB,SAAS,mBAAmB;AA4BrB,IAAM,eAAe,CAC1B,WACwC;AACxC,QAAM,WAAW,YAAY;AAE7B,SAAO,QAAQ,MAAM;AACnB,UAAM,WAAW,SAAS,SAAS,MAAM,GAAG,EAAE,OAAO,OAAO;AAC5D,UAAM,SAA6C,CAAC;AAEpD,eAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,MAAM,GAAG;AACjD,aAAO,GAAG,IAAI,SAAS,KAAK;AAAA,IAC9B;AAEA,WAAO;AAAA,EACT,GAAG,CAAC,SAAS,UAAU,MAAM,CAAC;AAChC;","names":[]}
@@ -0,0 +1,77 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ /**
4
+ * Statistics data item
5
+ */
6
+ interface StatItem {
7
+ /** Statistic label */
8
+ label: string;
9
+ /** Statistic value */
10
+ value: string | number;
11
+ /** Color variant */
12
+ variant: 'high' | 'medium' | 'low' | 'total';
13
+ }
14
+ /**
15
+ * Props for StatisticsCard component
16
+ */
17
+ interface StatisticsCardProps {
18
+ /** Title displayed at the top of the card */
19
+ title: string;
20
+ /** Statistics data to display */
21
+ data?: StatItem[];
22
+ /** Message shown in empty state */
23
+ emptyStateMessage?: string;
24
+ /** Text for the empty state button */
25
+ emptyStateButtonText?: string;
26
+ /** Callback when empty state button is clicked */
27
+ onEmptyStateButtonClick?: () => void;
28
+ /** Optional dropdown options for filtering */
29
+ dropdownOptions?: Array<{
30
+ label: string;
31
+ value: string;
32
+ }>;
33
+ /** Currently selected dropdown value */
34
+ selectedDropdownValue?: string;
35
+ /** Callback when dropdown value changes */
36
+ onDropdownChange?: (value: string) => void;
37
+ /** Placeholder text for the dropdown select */
38
+ selectPlaceholder?: string;
39
+ /** Accessible label for the dropdown select */
40
+ dropdownAriaLabel?: string;
41
+ /** Additional CSS classes */
42
+ className?: string;
43
+ }
44
+ /**
45
+ * StatisticsCard component - displays statistics with empty state support
46
+ *
47
+ * @example
48
+ * ```tsx
49
+ * // With data
50
+ * <StatisticsCard
51
+ * title="Estatística das atividades"
52
+ * data={[
53
+ * { label: 'Acertos', value: '85%', variant: 'high' },
54
+ * { label: 'Em andamento', value: 12, variant: 'medium' },
55
+ * { label: 'Erros', value: '15%', variant: 'low' },
56
+ * { label: 'Concluídas', value: 24, variant: 'total' }
57
+ * ]}
58
+ * dropdownOptions={[
59
+ * { label: '1 ano', value: '1year' },
60
+ * { label: '6 meses', value: '6months' }
61
+ * ]}
62
+ * selectedDropdownValue="1year"
63
+ * onDropdownChange={(value) => console.log(value)}
64
+ * />
65
+ *
66
+ * // Empty state
67
+ * <StatisticsCard
68
+ * title="Estatística das atividades"
69
+ * emptyStateMessage="Sem dados por enquanto. Crie uma atividade para que os resultados apareçam aqui."
70
+ * emptyStateButtonText="Criar atividade"
71
+ * onEmptyStateButtonClick={() => console.log('Create activity')}
72
+ * />
73
+ * ```
74
+ */
75
+ declare const StatisticsCard: ({ title, data, emptyStateMessage, emptyStateButtonText, onEmptyStateButtonClick, dropdownOptions, selectedDropdownValue, onDropdownChange, selectPlaceholder, dropdownAriaLabel, className, }: StatisticsCardProps) => react_jsx_runtime.JSX.Element;
76
+
77
+ export { StatisticsCard };
@@ -0,0 +1,77 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ /**
4
+ * Statistics data item
5
+ */
6
+ interface StatItem {
7
+ /** Statistic label */
8
+ label: string;
9
+ /** Statistic value */
10
+ value: string | number;
11
+ /** Color variant */
12
+ variant: 'high' | 'medium' | 'low' | 'total';
13
+ }
14
+ /**
15
+ * Props for StatisticsCard component
16
+ */
17
+ interface StatisticsCardProps {
18
+ /** Title displayed at the top of the card */
19
+ title: string;
20
+ /** Statistics data to display */
21
+ data?: StatItem[];
22
+ /** Message shown in empty state */
23
+ emptyStateMessage?: string;
24
+ /** Text for the empty state button */
25
+ emptyStateButtonText?: string;
26
+ /** Callback when empty state button is clicked */
27
+ onEmptyStateButtonClick?: () => void;
28
+ /** Optional dropdown options for filtering */
29
+ dropdownOptions?: Array<{
30
+ label: string;
31
+ value: string;
32
+ }>;
33
+ /** Currently selected dropdown value */
34
+ selectedDropdownValue?: string;
35
+ /** Callback when dropdown value changes */
36
+ onDropdownChange?: (value: string) => void;
37
+ /** Placeholder text for the dropdown select */
38
+ selectPlaceholder?: string;
39
+ /** Accessible label for the dropdown select */
40
+ dropdownAriaLabel?: string;
41
+ /** Additional CSS classes */
42
+ className?: string;
43
+ }
44
+ /**
45
+ * StatisticsCard component - displays statistics with empty state support
46
+ *
47
+ * @example
48
+ * ```tsx
49
+ * // With data
50
+ * <StatisticsCard
51
+ * title="Estatística das atividades"
52
+ * data={[
53
+ * { label: 'Acertos', value: '85%', variant: 'high' },
54
+ * { label: 'Em andamento', value: 12, variant: 'medium' },
55
+ * { label: 'Erros', value: '15%', variant: 'low' },
56
+ * { label: 'Concluídas', value: 24, variant: 'total' }
57
+ * ]}
58
+ * dropdownOptions={[
59
+ * { label: '1 ano', value: '1year' },
60
+ * { label: '6 meses', value: '6months' }
61
+ * ]}
62
+ * selectedDropdownValue="1year"
63
+ * onDropdownChange={(value) => console.log(value)}
64
+ * />
65
+ *
66
+ * // Empty state
67
+ * <StatisticsCard
68
+ * title="Estatística das atividades"
69
+ * emptyStateMessage="Sem dados por enquanto. Crie uma atividade para que os resultados apareçam aqui."
70
+ * emptyStateButtonText="Criar atividade"
71
+ * onEmptyStateButtonClick={() => console.log('Create activity')}
72
+ * />
73
+ * ```
74
+ */
75
+ declare const StatisticsCard: ({ title, data, emptyStateMessage, emptyStateButtonText, onEmptyStateButtonClick, dropdownOptions, selectedDropdownValue, onDropdownChange, selectPlaceholder, dropdownAriaLabel, className, }: StatisticsCardProps) => react_jsx_runtime.JSX.Element;
76
+
77
+ export { StatisticsCard };