analytica-frontend-lib 1.0.1 → 1.0.3

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/README.md CHANGED
@@ -21,7 +21,7 @@ yarn add analytica-frontend-lib
21
21
  1. Crie uma nova branch a partir da `main`.
22
22
  2. Crie o componente na pasta `/src/components`.
23
23
  3. Adicione testes unitários, com cobertura mínima de 80%.
24
- 4. Adicione o componente no Storybook, contemplando todas as variações.
24
+ 4. Adicione o componente no Ladle, contemplando todas as variações.
25
25
  5. Atualize a versão no campo `version` do arquivo `package.json`.
26
26
  6. Abra um Pull Request (PR) da sua branch para a `main`.
27
27
  7. O GitHub Actions cuidará da publicação automática após o merge.
@@ -33,3 +33,8 @@ yarn add analytica-frontend-lib
33
33
  - Os componentes devem ser totalmente compatíveis com Next.js versão 15+.
34
34
  - Testes unitários são obrigatórios, com coverage mínimo de 80%.
35
35
  - Siga o princípio da responsabilidade única (`single responsibility`): construa componentes compostos por componentes menores.
36
+
37
+ ## Ladle
38
+
39
+ Link público:
40
+ https://landle.nyc3.cdn.digitaloceanspaces.com/index.html
package/dist/index.css CHANGED
@@ -1,5 +1,17 @@
1
1
  /* src/styles.css */
2
2
  @layer properties;
3
+ .flex {
4
+ display: flex;
5
+ }
6
+ .transform {
7
+ transform: var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);
8
+ }
9
+ .flex-wrap {
10
+ flex-wrap: wrap;
11
+ }
12
+ .items-center {
13
+ align-items: center;
14
+ }
3
15
  .transition {
4
16
  transition-property:
5
17
  color,
@@ -46,6 +58,11 @@
46
58
  outline-style: none;
47
59
  }
48
60
  }
61
+ @property --tw-rotate-x { syntax: "*"; inherits: false; }
62
+ @property --tw-rotate-y { syntax: "*"; inherits: false; }
63
+ @property --tw-rotate-z { syntax: "*"; inherits: false; }
64
+ @property --tw-skew-x { syntax: "*"; inherits: false; }
65
+ @property --tw-skew-y { syntax: "*"; inherits: false; }
49
66
  @property --tw-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }
50
67
  @property --tw-shadow-color { syntax: "*"; inherits: false; }
51
68
  @property --tw-shadow-alpha { syntax: "<percentage>"; inherits: false; initial-value: 100%; }
@@ -66,6 +83,11 @@
66
83
  ::before,
67
84
  ::after,
68
85
  ::backdrop {
86
+ --tw-rotate-x: initial;
87
+ --tw-rotate-y: initial;
88
+ --tw-rotate-z: initial;
89
+ --tw-skew-x: initial;
90
+ --tw-skew-y: initial;
69
91
  --tw-shadow: 0 0 #0000;
70
92
  --tw-shadow-color: initial;
71
93
  --tw-shadow-alpha: 100%;
package/dist/index.d.mts CHANGED
@@ -1,12 +1,39 @@
1
- import * as react from 'react';
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode, ButtonHTMLAttributes } from 'react';
3
3
 
4
+ /**
5
+ * Button component props interface
6
+ */
4
7
  type ButtonProps = {
8
+ /** Content to be displayed inside the button */
5
9
  children: ReactNode;
10
+ /** Visual variant of the button */
6
11
  variant?: 'primary' | 'secondary' | 'danger';
12
+ /** Size variant of the button */
7
13
  size?: 'sm' | 'md' | 'lg';
14
+ /** Additional CSS classes to apply */
8
15
  className?: string;
9
16
  } & ButtonHTMLAttributes<HTMLButtonElement>;
10
- declare const Button: ({ children, variant, size, className, ...props }: ButtonProps) => react.JSX.Element;
17
+ /**
18
+ * Button component for Analytica Ensino platforms
19
+ *
20
+ * A flexible button component with multiple variants and sizes.
21
+ * Fully compatible with Next.js 15 and React 19.
22
+ *
23
+ * @param children - The content to display inside the button
24
+ * @param variant - The visual style variant (primary, secondary, danger)
25
+ * @param size - The size variant (sm, md, lg)
26
+ * @param className - Additional CSS classes
27
+ * @param props - All other standard button HTML attributes
28
+ * @returns A styled button element
29
+ *
30
+ * @example
31
+ * ```tsx
32
+ * <Button variant="primary" size="md" onClick={() => console.log('clicked')}>
33
+ * Click me
34
+ * </Button>
35
+ * ```
36
+ */
37
+ declare const Button: ({ children, variant, size, className, ...props }: ButtonProps) => react_jsx_runtime.JSX.Element;
11
38
 
12
39
  export { Button };
package/dist/index.d.ts CHANGED
@@ -1,12 +1,39 @@
1
- import * as react from 'react';
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode, ButtonHTMLAttributes } from 'react';
3
3
 
4
+ /**
5
+ * Button component props interface
6
+ */
4
7
  type ButtonProps = {
8
+ /** Content to be displayed inside the button */
5
9
  children: ReactNode;
10
+ /** Visual variant of the button */
6
11
  variant?: 'primary' | 'secondary' | 'danger';
12
+ /** Size variant of the button */
7
13
  size?: 'sm' | 'md' | 'lg';
14
+ /** Additional CSS classes to apply */
8
15
  className?: string;
9
16
  } & ButtonHTMLAttributes<HTMLButtonElement>;
10
- declare const Button: ({ children, variant, size, className, ...props }: ButtonProps) => react.JSX.Element;
17
+ /**
18
+ * Button component for Analytica Ensino platforms
19
+ *
20
+ * A flexible button component with multiple variants and sizes.
21
+ * Fully compatible with Next.js 15 and React 19.
22
+ *
23
+ * @param children - The content to display inside the button
24
+ * @param variant - The visual style variant (primary, secondary, danger)
25
+ * @param size - The size variant (sm, md, lg)
26
+ * @param className - Additional CSS classes
27
+ * @param props - All other standard button HTML attributes
28
+ * @returns A styled button element
29
+ *
30
+ * @example
31
+ * ```tsx
32
+ * <Button variant="primary" size="md" onClick={() => console.log('clicked')}>
33
+ * Click me
34
+ * </Button>
35
+ * ```
36
+ */
37
+ declare const Button: ({ children, variant, size, className, ...props }: ButtonProps) => react_jsx_runtime.JSX.Element;
11
38
 
12
39
  export { Button };
package/dist/index.js CHANGED
@@ -24,7 +24,8 @@ __export(index_exports, {
24
24
  });
25
25
  module.exports = __toCommonJS(index_exports);
26
26
 
27
- // src/components/Button.tsx
27
+ // src/components/Button/Button.tsx
28
+ var import_jsx_runtime = require("react/jsx-runtime");
28
29
  var Button = ({
29
30
  children,
30
31
  variant = "primary",
@@ -59,13 +60,13 @@ var Button = ({
59
60
  break;
60
61
  }
61
62
  const baseClasses = "rounded font-medium focus:outline-none focus:ring transition";
62
- return /* @__PURE__ */ React.createElement(
63
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
63
64
  "button",
64
65
  {
65
66
  className: `${baseClasses} ${variantClasses} ${sizeClasses} ${className}`,
66
- ...props
67
- },
68
- children
67
+ ...props,
68
+ children
69
+ }
69
70
  );
70
71
  };
71
72
  // Annotate the CommonJS export names for ESM import in node:
package/dist/index.mjs CHANGED
@@ -1,4 +1,5 @@
1
- // src/components/Button.tsx
1
+ // src/components/Button/Button.tsx
2
+ import { jsx } from "react/jsx-runtime";
2
3
  var Button = ({
3
4
  children,
4
5
  variant = "primary",
@@ -33,13 +34,13 @@ var Button = ({
33
34
  break;
34
35
  }
35
36
  const baseClasses = "rounded font-medium focus:outline-none focus:ring transition";
36
- return /* @__PURE__ */ React.createElement(
37
+ return /* @__PURE__ */ jsx(
37
38
  "button",
38
39
  {
39
40
  className: `${baseClasses} ${variantClasses} ${sizeClasses} ${className}`,
40
- ...props
41
- },
42
- children
41
+ ...props,
42
+ children
43
+ }
43
44
  );
44
45
  };
45
46
  export {
package/package.json CHANGED
@@ -1,18 +1,34 @@
1
1
  {
2
2
  "name": "analytica-frontend-lib",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Repositório público dos componentes utilizados nas plataformas da Analytica Ensino",
5
- "main": "./dist/index.cjs",
5
+ "main": "dist/index.cjs",
6
6
  "module": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
8
8
  "files": [
9
9
  "dist"
10
10
  ],
11
+ "exports": {
12
+ ".": {
13
+ "import": "./dist/index.js",
14
+ "require": "./dist/index.cjs"
15
+ }
16
+ },
11
17
  "scripts": {
12
18
  "lint": "npx eslint \"{src,app}/**/*.{js,jsx,ts,tsx}\" --fix",
13
19
  "typecheck": "npx tsc --noEmit",
14
20
  "prepare": "husky install",
15
- "build": "tsup src/index.ts --dts --format esm,cjs --out-dir dist --clean"
21
+ "test": "jest --coverage",
22
+ "test:watch": "jest --watch",
23
+ "test:coverage": "jest --coverage",
24
+ "test:sonar": "jest --coverage --testResultsProcessor=jest-sonar-reporter",
25
+ "build": "tsup src/index.ts --dts --format esm,cjs --out-dir dist --clean",
26
+ "build:check": "npm run typecheck && npm run build",
27
+ "dev": "tsup src/index.ts --dts --format esm,cjs --out-dir dist --watch",
28
+ "prepack": "npm run build:check",
29
+ "check-nextjs-compat": "echo 'Checking Next.js 15 compatibility...' && npm run typecheck && npm run test",
30
+ "ladle": "ladle serve",
31
+ "ladle:build": "ladle build"
16
32
  },
17
33
  "engines": {
18
34
  "node": "22.x"
@@ -22,11 +38,20 @@
22
38
  "analytica ensino",
23
39
  "frontend",
24
40
  "components",
25
- "nextjs"
41
+ "nextjs",
42
+ "nextjs-15",
43
+ "react-19",
44
+ "typescript",
45
+ "tailwindcss"
26
46
  ],
27
47
  "publishConfig": {
28
48
  "access": "public"
29
49
  },
50
+ "peerDependencies": {
51
+ "next": ">=15.0.0",
52
+ "react": ">=19.0.0",
53
+ "react-dom": ">=19.0.0"
54
+ },
30
55
  "author": "Analytica Ensino LTDA",
31
56
  "license": "MIT",
32
57
  "repository": {
@@ -42,7 +67,15 @@
42
67
  "react-dom": "^19.1.0"
43
68
  },
44
69
  "devDependencies": {
70
+ "@eslint/eslintrc": "^3.3.1",
71
+ "@eslint/js": "^9.28.0",
72
+ "@ladle/react": "^5.0.3",
45
73
  "@tailwindcss/postcss": "^4.1.8",
74
+ "@testing-library/dom": "^10.4.0",
75
+ "@testing-library/jest-dom": "^6.6.3",
76
+ "@testing-library/react": "^16.3.0",
77
+ "@testing-library/user-event": "^14.6.1",
78
+ "@types/jest": "^29.5.14",
46
79
  "@types/react": "^19.1.6",
47
80
  "@types/react-dom": "^19.1.6",
48
81
  "@typescript-eslint/eslint-plugin": "^8.34.0",
@@ -53,10 +86,17 @@
53
86
  "eslint-plugin-jsdoc": "^50.7.1",
54
87
  "eslint-plugin-prettier": "^5.4.1",
55
88
  "husky": "^9.1.7",
89
+ "jest": "^29.7.0",
90
+ "jest-environment-jsdom": "^29.7.0",
91
+ "jest-sonar-reporter": "^2.0.0",
92
+ "jsdom": "^26.1.0",
93
+ "next": "^15.3.3",
94
+ "polished": "^4.3.1",
56
95
  "postcss": "^8.5.4",
57
96
  "prettier": "^3.5.3",
58
97
  "sonarqube-scanner": "^4.3.0",
59
98
  "tailwindcss": "^4.1.8",
99
+ "ts-jest": "^29.3.4",
60
100
  "tsup": "^8.5.0",
61
101
  "typescript": "^5.8.3"
62
102
  }