@sigep/react 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/dist/index.d.mts +97 -0
- package/dist/index.d.ts +97 -0
- package/dist/index.js +69 -0
- package/dist/index.mjs +41 -0
- package/package.json +35 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
import * as tailwind_variants from 'tailwind-variants';
|
|
4
|
+
import { VariantProps } from 'tailwind-variants';
|
|
5
|
+
import * as tailwind_variants_dist_config_js from 'tailwind-variants/dist/config.js';
|
|
6
|
+
|
|
7
|
+
declare const button: tailwind_variants.TVReturnType<{
|
|
8
|
+
variant: {
|
|
9
|
+
primary: string;
|
|
10
|
+
secondary: string;
|
|
11
|
+
tertiary: string;
|
|
12
|
+
danger: string;
|
|
13
|
+
};
|
|
14
|
+
size: {
|
|
15
|
+
sm: string;
|
|
16
|
+
md: string;
|
|
17
|
+
lg: string;
|
|
18
|
+
};
|
|
19
|
+
}, undefined, "inline-flex items-center justify-center gap-2 rounded-md font-medium transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-50", tailwind_variants_dist_config_js.TVConfig<{
|
|
20
|
+
variant: {
|
|
21
|
+
primary: string;
|
|
22
|
+
secondary: string;
|
|
23
|
+
tertiary: string;
|
|
24
|
+
danger: string;
|
|
25
|
+
};
|
|
26
|
+
size: {
|
|
27
|
+
sm: string;
|
|
28
|
+
md: string;
|
|
29
|
+
lg: string;
|
|
30
|
+
};
|
|
31
|
+
}, {
|
|
32
|
+
variant: {
|
|
33
|
+
primary: string;
|
|
34
|
+
secondary: string;
|
|
35
|
+
tertiary: string;
|
|
36
|
+
danger: string;
|
|
37
|
+
};
|
|
38
|
+
size: {
|
|
39
|
+
sm: string;
|
|
40
|
+
md: string;
|
|
41
|
+
lg: string;
|
|
42
|
+
};
|
|
43
|
+
}>, {
|
|
44
|
+
variant: {
|
|
45
|
+
primary: string;
|
|
46
|
+
secondary: string;
|
|
47
|
+
tertiary: string;
|
|
48
|
+
danger: string;
|
|
49
|
+
};
|
|
50
|
+
size: {
|
|
51
|
+
sm: string;
|
|
52
|
+
md: string;
|
|
53
|
+
lg: string;
|
|
54
|
+
};
|
|
55
|
+
}, undefined, tailwind_variants.TVReturnType<{
|
|
56
|
+
variant: {
|
|
57
|
+
primary: string;
|
|
58
|
+
secondary: string;
|
|
59
|
+
tertiary: string;
|
|
60
|
+
danger: string;
|
|
61
|
+
};
|
|
62
|
+
size: {
|
|
63
|
+
sm: string;
|
|
64
|
+
md: string;
|
|
65
|
+
lg: string;
|
|
66
|
+
};
|
|
67
|
+
}, undefined, "inline-flex items-center justify-center gap-2 rounded-md font-medium transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-50", tailwind_variants_dist_config_js.TVConfig<{
|
|
68
|
+
variant: {
|
|
69
|
+
primary: string;
|
|
70
|
+
secondary: string;
|
|
71
|
+
tertiary: string;
|
|
72
|
+
danger: string;
|
|
73
|
+
};
|
|
74
|
+
size: {
|
|
75
|
+
sm: string;
|
|
76
|
+
md: string;
|
|
77
|
+
lg: string;
|
|
78
|
+
};
|
|
79
|
+
}, {
|
|
80
|
+
variant: {
|
|
81
|
+
primary: string;
|
|
82
|
+
secondary: string;
|
|
83
|
+
tertiary: string;
|
|
84
|
+
danger: string;
|
|
85
|
+
};
|
|
86
|
+
size: {
|
|
87
|
+
sm: string;
|
|
88
|
+
md: string;
|
|
89
|
+
lg: string;
|
|
90
|
+
};
|
|
91
|
+
}>, unknown, unknown, undefined>>;
|
|
92
|
+
type ButtonVariants = VariantProps<typeof button>;
|
|
93
|
+
interface ButtonProps extends ComponentProps<"button">, ButtonVariants {
|
|
94
|
+
}
|
|
95
|
+
declare const Button: react.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
96
|
+
|
|
97
|
+
export { Button, type ButtonProps, button };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
import * as tailwind_variants from 'tailwind-variants';
|
|
4
|
+
import { VariantProps } from 'tailwind-variants';
|
|
5
|
+
import * as tailwind_variants_dist_config_js from 'tailwind-variants/dist/config.js';
|
|
6
|
+
|
|
7
|
+
declare const button: tailwind_variants.TVReturnType<{
|
|
8
|
+
variant: {
|
|
9
|
+
primary: string;
|
|
10
|
+
secondary: string;
|
|
11
|
+
tertiary: string;
|
|
12
|
+
danger: string;
|
|
13
|
+
};
|
|
14
|
+
size: {
|
|
15
|
+
sm: string;
|
|
16
|
+
md: string;
|
|
17
|
+
lg: string;
|
|
18
|
+
};
|
|
19
|
+
}, undefined, "inline-flex items-center justify-center gap-2 rounded-md font-medium transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-50", tailwind_variants_dist_config_js.TVConfig<{
|
|
20
|
+
variant: {
|
|
21
|
+
primary: string;
|
|
22
|
+
secondary: string;
|
|
23
|
+
tertiary: string;
|
|
24
|
+
danger: string;
|
|
25
|
+
};
|
|
26
|
+
size: {
|
|
27
|
+
sm: string;
|
|
28
|
+
md: string;
|
|
29
|
+
lg: string;
|
|
30
|
+
};
|
|
31
|
+
}, {
|
|
32
|
+
variant: {
|
|
33
|
+
primary: string;
|
|
34
|
+
secondary: string;
|
|
35
|
+
tertiary: string;
|
|
36
|
+
danger: string;
|
|
37
|
+
};
|
|
38
|
+
size: {
|
|
39
|
+
sm: string;
|
|
40
|
+
md: string;
|
|
41
|
+
lg: string;
|
|
42
|
+
};
|
|
43
|
+
}>, {
|
|
44
|
+
variant: {
|
|
45
|
+
primary: string;
|
|
46
|
+
secondary: string;
|
|
47
|
+
tertiary: string;
|
|
48
|
+
danger: string;
|
|
49
|
+
};
|
|
50
|
+
size: {
|
|
51
|
+
sm: string;
|
|
52
|
+
md: string;
|
|
53
|
+
lg: string;
|
|
54
|
+
};
|
|
55
|
+
}, undefined, tailwind_variants.TVReturnType<{
|
|
56
|
+
variant: {
|
|
57
|
+
primary: string;
|
|
58
|
+
secondary: string;
|
|
59
|
+
tertiary: string;
|
|
60
|
+
danger: string;
|
|
61
|
+
};
|
|
62
|
+
size: {
|
|
63
|
+
sm: string;
|
|
64
|
+
md: string;
|
|
65
|
+
lg: string;
|
|
66
|
+
};
|
|
67
|
+
}, undefined, "inline-flex items-center justify-center gap-2 rounded-md font-medium transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-50", tailwind_variants_dist_config_js.TVConfig<{
|
|
68
|
+
variant: {
|
|
69
|
+
primary: string;
|
|
70
|
+
secondary: string;
|
|
71
|
+
tertiary: string;
|
|
72
|
+
danger: string;
|
|
73
|
+
};
|
|
74
|
+
size: {
|
|
75
|
+
sm: string;
|
|
76
|
+
md: string;
|
|
77
|
+
lg: string;
|
|
78
|
+
};
|
|
79
|
+
}, {
|
|
80
|
+
variant: {
|
|
81
|
+
primary: string;
|
|
82
|
+
secondary: string;
|
|
83
|
+
tertiary: string;
|
|
84
|
+
danger: string;
|
|
85
|
+
};
|
|
86
|
+
size: {
|
|
87
|
+
sm: string;
|
|
88
|
+
md: string;
|
|
89
|
+
lg: string;
|
|
90
|
+
};
|
|
91
|
+
}>, unknown, unknown, undefined>>;
|
|
92
|
+
type ButtonVariants = VariantProps<typeof button>;
|
|
93
|
+
interface ButtonProps extends ComponentProps<"button">, ButtonVariants {
|
|
94
|
+
}
|
|
95
|
+
declare const Button: react.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
96
|
+
|
|
97
|
+
export { Button, type ButtonProps, button };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
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
|
+
button: () => button
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(index_exports);
|
|
27
|
+
|
|
28
|
+
// src/components/Button/index.tsx
|
|
29
|
+
var import_react = require("react");
|
|
30
|
+
var import_tailwind_variants = require("tailwind-variants");
|
|
31
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
32
|
+
var button = (0, import_tailwind_variants.tv)({
|
|
33
|
+
base: "inline-flex items-center justify-center gap-2 rounded-md font-medium transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
34
|
+
variants: {
|
|
35
|
+
variant: {
|
|
36
|
+
primary: "bg-blue-600 text-white hover:bg-blue-700 focus-visible:outline-blue-600",
|
|
37
|
+
secondary: "border border-blue-600 text-blue-600 hover:bg-blue-50 focus-visible:outline-blue-600",
|
|
38
|
+
tertiary: "text-blue-600 hover:bg-blue-50 focus-visible:outline-blue-600",
|
|
39
|
+
danger: "bg-red-600 text-white hover:bg-red-700 focus-visible:outline-red-600"
|
|
40
|
+
},
|
|
41
|
+
size: {
|
|
42
|
+
sm: "h-9 px-3 text-sm",
|
|
43
|
+
md: "h-10 px-4 text-sm",
|
|
44
|
+
lg: "h-11 px-6 text-base"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
defaultVariants: {
|
|
48
|
+
variant: "primary",
|
|
49
|
+
size: "md"
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
var Button = (0, import_react.forwardRef)(
|
|
53
|
+
({ variant, size, className, ...props }, ref) => {
|
|
54
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
55
|
+
"button",
|
|
56
|
+
{
|
|
57
|
+
ref,
|
|
58
|
+
className: button({ variant, size, className }),
|
|
59
|
+
...props
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
Button.displayName = "Button";
|
|
65
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
66
|
+
0 && (module.exports = {
|
|
67
|
+
Button,
|
|
68
|
+
button
|
|
69
|
+
});
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// src/components/Button/index.tsx
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { tv } from "tailwind-variants";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
var button = tv({
|
|
6
|
+
base: "inline-flex items-center justify-center gap-2 rounded-md font-medium transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
primary: "bg-blue-600 text-white hover:bg-blue-700 focus-visible:outline-blue-600",
|
|
10
|
+
secondary: "border border-blue-600 text-blue-600 hover:bg-blue-50 focus-visible:outline-blue-600",
|
|
11
|
+
tertiary: "text-blue-600 hover:bg-blue-50 focus-visible:outline-blue-600",
|
|
12
|
+
danger: "bg-red-600 text-white hover:bg-red-700 focus-visible:outline-red-600"
|
|
13
|
+
},
|
|
14
|
+
size: {
|
|
15
|
+
sm: "h-9 px-3 text-sm",
|
|
16
|
+
md: "h-10 px-4 text-sm",
|
|
17
|
+
lg: "h-11 px-6 text-base"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: {
|
|
21
|
+
variant: "primary",
|
|
22
|
+
size: "md"
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
var Button = forwardRef(
|
|
26
|
+
({ variant, size, className, ...props }, ref) => {
|
|
27
|
+
return /* @__PURE__ */ jsx(
|
|
28
|
+
"button",
|
|
29
|
+
{
|
|
30
|
+
ref,
|
|
31
|
+
className: button({ variant, size, className }),
|
|
32
|
+
...props
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
Button.displayName = "Button";
|
|
38
|
+
export {
|
|
39
|
+
Button,
|
|
40
|
+
button
|
|
41
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sigep/react",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.mjs",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.mjs",
|
|
11
|
+
"require": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": ["dist"],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "tsup src/index.ts --format esm,cjs --dts --external react",
|
|
18
|
+
"dev": "tsup src/index.ts --format esm,cjs --dts --external react --watch"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"tailwind-variants": "^0.3"
|
|
22
|
+
},
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"react": "^19",
|
|
25
|
+
"react-dom": "^19",
|
|
26
|
+
"tailwindcss": "^4"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@sigep/ts-config": "*",
|
|
30
|
+
"@types/react": "^19",
|
|
31
|
+
"react": "^19",
|
|
32
|
+
"tsup": "^8",
|
|
33
|
+
"typescript": "^5"
|
|
34
|
+
}
|
|
35
|
+
}
|