@artivism/ui 0.1.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.
@@ -0,0 +1,10 @@
1
+ import * as react from 'react';
2
+ import { ButtonHTMLAttributes } from 'react';
3
+
4
+ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
5
+ variant?: "primary" | "secondary" | "ghost";
6
+ size?: "sm" | "md" | "lg";
7
+ }
8
+ declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
9
+
10
+ export { Button, type ButtonProps };
@@ -0,0 +1,31 @@
1
+ // src/button.tsx
2
+ import { forwardRef } from "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ var Button = forwardRef(
5
+ ({ variant = "primary", size = "md", className = "", children, ...props }, ref) => {
6
+ const baseClasses = "inline-flex items-center justify-center font-medium transition-colors disabled:opacity-50 disabled:cursor-not-allowed";
7
+ const variantClasses = {
8
+ primary: "bg-accent text-white hover:bg-accent-hover",
9
+ secondary: "bg-surface-muted text-text hover:bg-border",
10
+ ghost: "text-text hover:bg-surface-muted"
11
+ };
12
+ const sizeClasses = {
13
+ sm: "px-3 py-1.5 text-sm rounded-sm",
14
+ md: "px-4 py-2 text-base rounded-md",
15
+ lg: "px-6 py-3 text-lg rounded-lg"
16
+ };
17
+ return /* @__PURE__ */ jsx(
18
+ "button",
19
+ {
20
+ ref,
21
+ className: `${baseClasses} ${variantClasses[variant]} ${sizeClasses[size]} ${className}`,
22
+ ...props,
23
+ children
24
+ }
25
+ );
26
+ }
27
+ );
28
+ Button.displayName = "Button";
29
+ export {
30
+ Button
31
+ };
@@ -0,0 +1,9 @@
1
+ import * as react from 'react';
2
+ import { HTMLAttributes } from 'react';
3
+
4
+ interface CardProps extends HTMLAttributes<HTMLDivElement> {
5
+ variant?: "default" | "bordered";
6
+ }
7
+ declare const Card: react.ForwardRefExoticComponent<CardProps & react.RefAttributes<HTMLDivElement>>;
8
+
9
+ export { Card, type CardProps };
package/dist/card.mjs ADDED
@@ -0,0 +1,25 @@
1
+ // src/card.tsx
2
+ import { forwardRef } from "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ var Card = forwardRef(
5
+ ({ variant = "default", className = "", children, ...props }, ref) => {
6
+ const baseClasses = "rounded-lg p-6";
7
+ const variantClasses = {
8
+ default: "bg-surface shadow-sm",
9
+ bordered: "bg-surface border border-border"
10
+ };
11
+ return /* @__PURE__ */ jsx(
12
+ "div",
13
+ {
14
+ ref,
15
+ className: `${baseClasses} ${variantClasses[variant]} ${className}`,
16
+ ...props,
17
+ children
18
+ }
19
+ );
20
+ }
21
+ );
22
+ Card.displayName = "Card";
23
+ export {
24
+ Card
25
+ };
@@ -0,0 +1,3 @@
1
+ export { Button, ButtonProps } from './button.mjs';
2
+ export { Card, CardProps } from './card.mjs';
3
+ import 'react';
package/dist/index.mjs ADDED
@@ -0,0 +1,55 @@
1
+ // src/button.tsx
2
+ import { forwardRef } from "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ var Button = forwardRef(
5
+ ({ variant = "primary", size = "md", className = "", children, ...props }, ref) => {
6
+ const baseClasses = "inline-flex items-center justify-center font-medium transition-colors disabled:opacity-50 disabled:cursor-not-allowed";
7
+ const variantClasses = {
8
+ primary: "bg-accent text-white hover:bg-accent-hover",
9
+ secondary: "bg-surface-muted text-text hover:bg-border",
10
+ ghost: "text-text hover:bg-surface-muted"
11
+ };
12
+ const sizeClasses = {
13
+ sm: "px-3 py-1.5 text-sm rounded-sm",
14
+ md: "px-4 py-2 text-base rounded-md",
15
+ lg: "px-6 py-3 text-lg rounded-lg"
16
+ };
17
+ return /* @__PURE__ */ jsx(
18
+ "button",
19
+ {
20
+ ref,
21
+ className: `${baseClasses} ${variantClasses[variant]} ${sizeClasses[size]} ${className}`,
22
+ ...props,
23
+ children
24
+ }
25
+ );
26
+ }
27
+ );
28
+ Button.displayName = "Button";
29
+
30
+ // src/card.tsx
31
+ import { forwardRef as forwardRef2 } from "react";
32
+ import { jsx as jsx2 } from "react/jsx-runtime";
33
+ var Card = forwardRef2(
34
+ ({ variant = "default", className = "", children, ...props }, ref) => {
35
+ const baseClasses = "rounded-lg p-6";
36
+ const variantClasses = {
37
+ default: "bg-surface shadow-sm",
38
+ bordered: "bg-surface border border-border"
39
+ };
40
+ return /* @__PURE__ */ jsx2(
41
+ "div",
42
+ {
43
+ ref,
44
+ className: `${baseClasses} ${variantClasses[variant]} ${className}`,
45
+ ...props,
46
+ children
47
+ }
48
+ );
49
+ }
50
+ );
51
+ Card.displayName = "Card";
52
+ export {
53
+ Button,
54
+ Card
55
+ };
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@artivism/ui",
3
+ "version": "0.1.0",
4
+ "description": "React UI components for Artivism Design System",
5
+ "main": "./dist/index.mjs",
6
+ "types": "./dist/index.d.mts",
7
+ "exports": {
8
+ ".": "./dist/index.mjs",
9
+ "./button": "./dist/button.mjs",
10
+ "./card": "./dist/card.mjs"
11
+ },
12
+ "files": [
13
+ "dist"
14
+ ],
15
+ "peerDependencies": {
16
+ "react": "^18.0.0"
17
+ },
18
+ "scripts": {
19
+ "build": "tsup",
20
+ "dev": "tsup --watch",
21
+ "typecheck": "tsc --noEmit"
22
+ },
23
+ "devDependencies": {
24
+ "@types/react": "^18.2.48",
25
+ "react": "^18.2.0",
26
+ "tsup": "^8.0.1",
27
+ "typescript": "^5.3.3"
28
+ },
29
+ "keywords": [
30
+ "design-system",
31
+ "react",
32
+ "components",
33
+ "ui",
34
+ "artivism"
35
+ ],
36
+ "author": "artivism",
37
+ "license": "MIT",
38
+ "repository": {
39
+ "type": "git",
40
+ "url": "https://github.com/artivism/design-system.git",
41
+ "directory": "packages/ui"
42
+ },
43
+ "homepage": "https://design.artivism.it"
44
+ }