analytica-frontend-lib 1.0.0
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 +2 -0
- package/dist/index.css +86 -0
- package/dist/index.d.mts +12 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +74 -0
- package/dist/index.mjs +47 -0
- package/package.json +43 -0
package/README.md
ADDED
package/dist/index.css
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/* src/styles.css */
|
|
2
|
+
@layer properties;
|
|
3
|
+
.transition {
|
|
4
|
+
transition-property:
|
|
5
|
+
color,
|
|
6
|
+
background-color,
|
|
7
|
+
border-color,
|
|
8
|
+
outline-color,
|
|
9
|
+
text-decoration-color,
|
|
10
|
+
fill,
|
|
11
|
+
stroke,
|
|
12
|
+
--tw-gradient-from,
|
|
13
|
+
--tw-gradient-via,
|
|
14
|
+
--tw-gradient-to,
|
|
15
|
+
opacity,
|
|
16
|
+
box-shadow,
|
|
17
|
+
transform,
|
|
18
|
+
translate,
|
|
19
|
+
scale,
|
|
20
|
+
rotate,
|
|
21
|
+
filter,
|
|
22
|
+
-webkit-backdrop-filter,
|
|
23
|
+
backdrop-filter,
|
|
24
|
+
display,
|
|
25
|
+
visibility,
|
|
26
|
+
content-visibility,
|
|
27
|
+
overlay,
|
|
28
|
+
pointer-events;
|
|
29
|
+
transition-timing-function: var(--tw-ease, ease);
|
|
30
|
+
transition-duration: var(--tw-duration, 0s);
|
|
31
|
+
}
|
|
32
|
+
.focus\:ring {
|
|
33
|
+
&:focus {
|
|
34
|
+
--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
|
|
35
|
+
box-shadow:
|
|
36
|
+
var(--tw-inset-shadow),
|
|
37
|
+
var(--tw-inset-ring-shadow),
|
|
38
|
+
var(--tw-ring-offset-shadow),
|
|
39
|
+
var(--tw-ring-shadow),
|
|
40
|
+
var(--tw-shadow);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
.focus\:outline-none {
|
|
44
|
+
&:focus {
|
|
45
|
+
--tw-outline-style: none;
|
|
46
|
+
outline-style: none;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
@property --tw-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }
|
|
50
|
+
@property --tw-shadow-color { syntax: "*"; inherits: false; }
|
|
51
|
+
@property --tw-shadow-alpha { syntax: "<percentage>"; inherits: false; initial-value: 100%; }
|
|
52
|
+
@property --tw-inset-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }
|
|
53
|
+
@property --tw-inset-shadow-color { syntax: "*"; inherits: false; }
|
|
54
|
+
@property --tw-inset-shadow-alpha { syntax: "<percentage>"; inherits: false; initial-value: 100%; }
|
|
55
|
+
@property --tw-ring-color { syntax: "*"; inherits: false; }
|
|
56
|
+
@property --tw-ring-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }
|
|
57
|
+
@property --tw-inset-ring-color { syntax: "*"; inherits: false; }
|
|
58
|
+
@property --tw-inset-ring-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }
|
|
59
|
+
@property --tw-ring-inset { syntax: "*"; inherits: false; }
|
|
60
|
+
@property --tw-ring-offset-width { syntax: "<length>"; inherits: false; initial-value: 0px; }
|
|
61
|
+
@property --tw-ring-offset-color { syntax: "*"; inherits: false; initial-value: #fff; }
|
|
62
|
+
@property --tw-ring-offset-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }
|
|
63
|
+
@layer properties {
|
|
64
|
+
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
|
|
65
|
+
*,
|
|
66
|
+
::before,
|
|
67
|
+
::after,
|
|
68
|
+
::backdrop {
|
|
69
|
+
--tw-shadow: 0 0 #0000;
|
|
70
|
+
--tw-shadow-color: initial;
|
|
71
|
+
--tw-shadow-alpha: 100%;
|
|
72
|
+
--tw-inset-shadow: 0 0 #0000;
|
|
73
|
+
--tw-inset-shadow-color: initial;
|
|
74
|
+
--tw-inset-shadow-alpha: 100%;
|
|
75
|
+
--tw-ring-color: initial;
|
|
76
|
+
--tw-ring-shadow: 0 0 #0000;
|
|
77
|
+
--tw-inset-ring-color: initial;
|
|
78
|
+
--tw-inset-ring-shadow: 0 0 #0000;
|
|
79
|
+
--tw-ring-inset: initial;
|
|
80
|
+
--tw-ring-offset-width: 0px;
|
|
81
|
+
--tw-ring-offset-color: #fff;
|
|
82
|
+
--tw-ring-offset-shadow: 0 0 #0000;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
/*! tailwindcss v4.1.8 | MIT License | https://tailwindcss.com */
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode, ButtonHTMLAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
type ButtonProps = {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
variant?: 'primary' | 'secondary' | 'danger';
|
|
7
|
+
size?: 'sm' | 'md' | 'lg';
|
|
8
|
+
className?: string;
|
|
9
|
+
} & ButtonHTMLAttributes<HTMLButtonElement>;
|
|
10
|
+
declare const Button: ({ children, variant, size, className, ...props }: ButtonProps) => react.JSX.Element;
|
|
11
|
+
|
|
12
|
+
export { Button };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode, ButtonHTMLAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
type ButtonProps = {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
variant?: 'primary' | 'secondary' | 'danger';
|
|
7
|
+
size?: 'sm' | 'md' | 'lg';
|
|
8
|
+
className?: string;
|
|
9
|
+
} & ButtonHTMLAttributes<HTMLButtonElement>;
|
|
10
|
+
declare const Button: ({ children, variant, size, className, ...props }: ButtonProps) => react.JSX.Element;
|
|
11
|
+
|
|
12
|
+
export { Button };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
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/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
Button: () => Button
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(index_exports);
|
|
26
|
+
|
|
27
|
+
// src/components/Button.tsx
|
|
28
|
+
var Button = ({
|
|
29
|
+
children,
|
|
30
|
+
variant = "primary",
|
|
31
|
+
size = "md",
|
|
32
|
+
className = "",
|
|
33
|
+
...props
|
|
34
|
+
}) => {
|
|
35
|
+
let variantClasses = "";
|
|
36
|
+
let sizeClasses = "";
|
|
37
|
+
switch (variant) {
|
|
38
|
+
case "secondary":
|
|
39
|
+
variantClasses = "bg-gray-200 hover:bg-gray-300 text-black";
|
|
40
|
+
break;
|
|
41
|
+
case "danger":
|
|
42
|
+
variantClasses = "bg-red-600 hover:bg-red-700 text-white";
|
|
43
|
+
break;
|
|
44
|
+
case "primary":
|
|
45
|
+
default:
|
|
46
|
+
variantClasses = "bg-blue-600 hover:bg-blue-700 text-white";
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
switch (size) {
|
|
50
|
+
case "sm":
|
|
51
|
+
sizeClasses = "text-sm px-3 py-1.5";
|
|
52
|
+
break;
|
|
53
|
+
case "lg":
|
|
54
|
+
sizeClasses = "text-lg px-5 py-3";
|
|
55
|
+
break;
|
|
56
|
+
case "md":
|
|
57
|
+
default:
|
|
58
|
+
sizeClasses = "text-base px-4 py-2";
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
const baseClasses = "rounded font-medium focus:outline-none focus:ring transition";
|
|
62
|
+
return /* @__PURE__ */ React.createElement(
|
|
63
|
+
"button",
|
|
64
|
+
{
|
|
65
|
+
className: `${baseClasses} ${variantClasses} ${sizeClasses} ${className}`,
|
|
66
|
+
...props
|
|
67
|
+
},
|
|
68
|
+
children
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
72
|
+
0 && (module.exports = {
|
|
73
|
+
Button
|
|
74
|
+
});
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// src/components/Button.tsx
|
|
2
|
+
var Button = ({
|
|
3
|
+
children,
|
|
4
|
+
variant = "primary",
|
|
5
|
+
size = "md",
|
|
6
|
+
className = "",
|
|
7
|
+
...props
|
|
8
|
+
}) => {
|
|
9
|
+
let variantClasses = "";
|
|
10
|
+
let sizeClasses = "";
|
|
11
|
+
switch (variant) {
|
|
12
|
+
case "secondary":
|
|
13
|
+
variantClasses = "bg-gray-200 hover:bg-gray-300 text-black";
|
|
14
|
+
break;
|
|
15
|
+
case "danger":
|
|
16
|
+
variantClasses = "bg-red-600 hover:bg-red-700 text-white";
|
|
17
|
+
break;
|
|
18
|
+
case "primary":
|
|
19
|
+
default:
|
|
20
|
+
variantClasses = "bg-blue-600 hover:bg-blue-700 text-white";
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
23
|
+
switch (size) {
|
|
24
|
+
case "sm":
|
|
25
|
+
sizeClasses = "text-sm px-3 py-1.5";
|
|
26
|
+
break;
|
|
27
|
+
case "lg":
|
|
28
|
+
sizeClasses = "text-lg px-5 py-3";
|
|
29
|
+
break;
|
|
30
|
+
case "md":
|
|
31
|
+
default:
|
|
32
|
+
sizeClasses = "text-base px-4 py-2";
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
const baseClasses = "rounded font-medium focus:outline-none focus:ring transition";
|
|
36
|
+
return /* @__PURE__ */ React.createElement(
|
|
37
|
+
"button",
|
|
38
|
+
{
|
|
39
|
+
className: `${baseClasses} ${variantClasses} ${sizeClasses} ${className}`,
|
|
40
|
+
...props
|
|
41
|
+
},
|
|
42
|
+
children
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
export {
|
|
46
|
+
Button
|
|
47
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "analytica-frontend-lib",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Repositório público dos componentes utilizados nas plataformas da Analytica Ensino",
|
|
5
|
+
"main": "./dist/index.cjs",
|
|
6
|
+
"module": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "tsup src/index.ts --dts --format esm,cjs --out-dir dist --clean"
|
|
13
|
+
},
|
|
14
|
+
"engines": {
|
|
15
|
+
"node": "22.x"
|
|
16
|
+
},
|
|
17
|
+
"packageManager": "yarn@4.9.0",
|
|
18
|
+
"keywords": [
|
|
19
|
+
"analytica",
|
|
20
|
+
"ensino",
|
|
21
|
+
"frontend",
|
|
22
|
+
"components"
|
|
23
|
+
],
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public"
|
|
26
|
+
},
|
|
27
|
+
"author": "Analytica Ensino LTDA",
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"react": "^19.1.0",
|
|
31
|
+
"react-dom": "^19.1.0"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@tailwindcss/postcss": "^4.1.8",
|
|
35
|
+
"@types/react": "^19.1.6",
|
|
36
|
+
"@types/react-dom": "^19.1.6",
|
|
37
|
+
"autoprefixer": "^10.4.21",
|
|
38
|
+
"postcss": "^8.5.4",
|
|
39
|
+
"tailwindcss": "^4.1.8",
|
|
40
|
+
"tsup": "^8.5.0",
|
|
41
|
+
"typescript": "^5.8.3"
|
|
42
|
+
}
|
|
43
|
+
}
|