@dipesh.singh/proton 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.
- package/README.md +170 -0
- package/dist/ProtonTypography-Cp9sfQ06.js +650 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +22 -0
- package/dist/react/components/ProtonButton.d.ts +16 -0
- package/dist/react/components/ProtonCard.d.ts +25 -0
- package/dist/react/components/ProtonDialog.d.ts +13 -0
- package/dist/react/components/ProtonInput.d.ts +17 -0
- package/dist/react/components/ProtonMetricBox.d.ts +15 -0
- package/dist/react/components/ProtonSlider.d.ts +13 -0
- package/dist/react/components/ProtonStatusBadge.d.ts +12 -0
- package/dist/react/components/ProtonTypography.d.ts +15 -0
- package/dist/react/components/index.d.ts +8 -0
- package/dist/react/index.d.ts +3 -0
- package/dist/react/index.js +22 -0
- package/dist/react/theme/ProtonThemeProvider.d.ts +12 -0
- package/dist/react/theme/index.d.ts +2 -0
- package/dist/react/theme/muiTheme.d.ts +4 -0
- package/dist/tokens/colors.d.ts +79 -0
- package/dist/tokens/index.d.ts +179 -0
- package/dist/tokens/index.js +168 -0
- package/dist/tokens/radii.d.ts +11 -0
- package/dist/tokens/shadows.d.ts +10 -0
- package/dist/tokens/spacing.d.ts +21 -0
- package/dist/tokens/typography.d.ts +54 -0
- package/dist/vue/components/ProtonButton.d.ts +48 -0
- package/dist/vue/components/ProtonCard.d.ts +27 -0
- package/dist/vue/components/ProtonStatusBadge.d.ts +47 -0
- package/dist/vue/components/index.d.ts +3 -0
- package/dist/vue/index.d.ts +2 -0
- package/dist/vue/index.js +115 -0
- package/package.json +67 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export declare const typography: {
|
|
2
|
+
readonly fonts: {
|
|
3
|
+
readonly sans: "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif";
|
|
4
|
+
readonly display: "\"Playfair Display\", Georgia, Cambria, \"Times New Roman\", Times, serif";
|
|
5
|
+
readonly mono: "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", monospace";
|
|
6
|
+
};
|
|
7
|
+
readonly sizes: {
|
|
8
|
+
readonly xs: {
|
|
9
|
+
readonly fontSize: "0.75rem";
|
|
10
|
+
readonly lineHeight: "1rem";
|
|
11
|
+
};
|
|
12
|
+
readonly sm: {
|
|
13
|
+
readonly fontSize: "0.875rem";
|
|
14
|
+
readonly lineHeight: "1.25rem";
|
|
15
|
+
};
|
|
16
|
+
readonly base: {
|
|
17
|
+
readonly fontSize: "1rem";
|
|
18
|
+
readonly lineHeight: "1.5rem";
|
|
19
|
+
};
|
|
20
|
+
readonly lg: {
|
|
21
|
+
readonly fontSize: "1.125rem";
|
|
22
|
+
readonly lineHeight: "1.75rem";
|
|
23
|
+
};
|
|
24
|
+
readonly xl: {
|
|
25
|
+
readonly fontSize: "1.25rem";
|
|
26
|
+
readonly lineHeight: "1.75rem";
|
|
27
|
+
};
|
|
28
|
+
readonly '2xl': {
|
|
29
|
+
readonly fontSize: "1.5rem";
|
|
30
|
+
readonly lineHeight: "2rem";
|
|
31
|
+
};
|
|
32
|
+
readonly '3xl': {
|
|
33
|
+
readonly fontSize: "1.875rem";
|
|
34
|
+
readonly lineHeight: "2.25rem";
|
|
35
|
+
};
|
|
36
|
+
readonly '4xl': {
|
|
37
|
+
readonly fontSize: "2.25rem";
|
|
38
|
+
readonly lineHeight: "2.5rem";
|
|
39
|
+
};
|
|
40
|
+
readonly '5xl': {
|
|
41
|
+
readonly fontSize: "3rem";
|
|
42
|
+
readonly lineHeight: "1";
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
readonly weights: {
|
|
46
|
+
readonly regular: 400;
|
|
47
|
+
readonly medium: 500;
|
|
48
|
+
readonly semibold: 600;
|
|
49
|
+
readonly bold: 700;
|
|
50
|
+
readonly extrabold: 800;
|
|
51
|
+
readonly black: 900;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
export type Typography = typeof typography;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export interface VueProtonButtonProps {
|
|
2
|
+
variant?: 'primary' | 'secondary' | 'outline' | 'ghost' | 'danger';
|
|
3
|
+
size?: 'sm' | 'md' | 'lg';
|
|
4
|
+
isLoading?: boolean;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
type?: 'button' | 'submit' | 'reset';
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Vue 3 Component definition for ProtonButton.
|
|
11
|
+
* Emits click events and applies the unified Proton Design Token styling.
|
|
12
|
+
*/
|
|
13
|
+
export declare const ProtonButton: {
|
|
14
|
+
name: string;
|
|
15
|
+
props: {
|
|
16
|
+
variant: {
|
|
17
|
+
type: StringConstructor;
|
|
18
|
+
default: string;
|
|
19
|
+
};
|
|
20
|
+
size: {
|
|
21
|
+
type: StringConstructor;
|
|
22
|
+
default: string;
|
|
23
|
+
};
|
|
24
|
+
isLoading: {
|
|
25
|
+
type: BooleanConstructor;
|
|
26
|
+
default: boolean;
|
|
27
|
+
};
|
|
28
|
+
disabled: {
|
|
29
|
+
type: BooleanConstructor;
|
|
30
|
+
default: boolean;
|
|
31
|
+
};
|
|
32
|
+
type: {
|
|
33
|
+
type: StringConstructor;
|
|
34
|
+
default: string;
|
|
35
|
+
};
|
|
36
|
+
className: {
|
|
37
|
+
type: StringConstructor;
|
|
38
|
+
default: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
emits: string[];
|
|
42
|
+
setup(props: VueProtonButtonProps, { slots, emit }: any): {
|
|
43
|
+
getStyle: () => Record<string, string>;
|
|
44
|
+
handleClick: (e: Event) => void;
|
|
45
|
+
slots: any;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
export default ProtonButton;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface VueProtonCardProps {
|
|
2
|
+
variant?: 'elevated' | 'outlined' | 'flat';
|
|
3
|
+
padding?: 'none' | 'sm' | 'md' | 'lg';
|
|
4
|
+
hoverEffect?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const ProtonCard: {
|
|
7
|
+
name: string;
|
|
8
|
+
props: {
|
|
9
|
+
variant: {
|
|
10
|
+
type: StringConstructor;
|
|
11
|
+
default: string;
|
|
12
|
+
};
|
|
13
|
+
padding: {
|
|
14
|
+
type: StringConstructor;
|
|
15
|
+
default: string;
|
|
16
|
+
};
|
|
17
|
+
hoverEffect: {
|
|
18
|
+
type: BooleanConstructor;
|
|
19
|
+
default: boolean;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
setup(props: VueProtonCardProps, { slots }: any): {
|
|
23
|
+
getStyle: () => Record<string, string>;
|
|
24
|
+
slots: any;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export default ProtonCard;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export interface VueProtonStatusBadgeProps {
|
|
2
|
+
label: string;
|
|
3
|
+
status?: 'success' | 'warning' | 'error' | 'info' | 'neutral' | 'coffee';
|
|
4
|
+
pulse?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const ProtonStatusBadge: {
|
|
7
|
+
name: string;
|
|
8
|
+
props: {
|
|
9
|
+
label: {
|
|
10
|
+
type: StringConstructor;
|
|
11
|
+
required: boolean;
|
|
12
|
+
};
|
|
13
|
+
status: {
|
|
14
|
+
type: StringConstructor;
|
|
15
|
+
default: string;
|
|
16
|
+
};
|
|
17
|
+
pulse: {
|
|
18
|
+
type: BooleanConstructor;
|
|
19
|
+
default: boolean;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
setup(props: VueProtonStatusBadgeProps): {
|
|
23
|
+
getStyle: () => {
|
|
24
|
+
pill: {
|
|
25
|
+
display: string;
|
|
26
|
+
alignItems: string;
|
|
27
|
+
gap: string;
|
|
28
|
+
padding: string;
|
|
29
|
+
borderRadius: "9999px";
|
|
30
|
+
backgroundColor: string;
|
|
31
|
+
color: string;
|
|
32
|
+
border: string;
|
|
33
|
+
fontSize: string;
|
|
34
|
+
fontWeight: string;
|
|
35
|
+
};
|
|
36
|
+
dot: {
|
|
37
|
+
width: string;
|
|
38
|
+
height: string;
|
|
39
|
+
borderRadius: string;
|
|
40
|
+
backgroundColor: string;
|
|
41
|
+
display: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
props: VueProtonStatusBadgeProps;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
export default ProtonStatusBadge;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { radii as l, colors as e, shadows as i } from "../tokens/index.js";
|
|
2
|
+
import { spacing as p, default as x, typography as m } from "../tokens/index.js";
|
|
3
|
+
const f = {
|
|
4
|
+
name: "ProtonButton",
|
|
5
|
+
props: {
|
|
6
|
+
variant: { type: String, default: "primary" },
|
|
7
|
+
size: { type: String, default: "md" },
|
|
8
|
+
isLoading: { type: Boolean, default: !1 },
|
|
9
|
+
disabled: { type: Boolean, default: !1 },
|
|
10
|
+
type: { type: String, default: "button" },
|
|
11
|
+
className: { type: String, default: "" }
|
|
12
|
+
},
|
|
13
|
+
emits: ["click"],
|
|
14
|
+
setup(a, { slots: n, emit: s }) {
|
|
15
|
+
return {
|
|
16
|
+
getStyle: () => {
|
|
17
|
+
const t = {
|
|
18
|
+
borderRadius: l.xl,
|
|
19
|
+
fontWeight: "700",
|
|
20
|
+
letterSpacing: "-0.01em",
|
|
21
|
+
cursor: a.disabled || a.isLoading ? "not-allowed" : "pointer",
|
|
22
|
+
opacity: a.disabled ? "0.6" : "1",
|
|
23
|
+
display: "inline-flex",
|
|
24
|
+
alignItems: "center",
|
|
25
|
+
justifyContent: "center",
|
|
26
|
+
gap: "6px",
|
|
27
|
+
border: "none",
|
|
28
|
+
transition: "all 0.2s ease-in-out"
|
|
29
|
+
};
|
|
30
|
+
switch (a.size === "sm" ? (t.fontSize = "0.75rem", t.padding = "6px 12px") : a.size === "lg" ? (t.fontSize = "0.95rem", t.padding = "12px 24px") : (t.fontSize = "0.85rem", t.padding = "9px 18px"), a.variant) {
|
|
31
|
+
case "secondary":
|
|
32
|
+
t.backgroundColor = e.coffee[900], t.color = "#ffffff";
|
|
33
|
+
break;
|
|
34
|
+
case "outline":
|
|
35
|
+
t.backgroundColor = "transparent", t.color = e.slate[800], t.border = `1px solid ${e.slate[300]}`;
|
|
36
|
+
break;
|
|
37
|
+
case "ghost":
|
|
38
|
+
t.backgroundColor = "transparent", t.color = e.slate[700];
|
|
39
|
+
break;
|
|
40
|
+
case "danger":
|
|
41
|
+
t.backgroundColor = e.status.error.main, t.color = "#ffffff";
|
|
42
|
+
break;
|
|
43
|
+
default:
|
|
44
|
+
t.backgroundColor = e.amber[700], t.color = "#ffffff";
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
return t;
|
|
48
|
+
},
|
|
49
|
+
handleClick: (t) => {
|
|
50
|
+
!a.disabled && !a.isLoading && s("click", t);
|
|
51
|
+
},
|
|
52
|
+
slots: n
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}, u = {
|
|
56
|
+
name: "ProtonCard",
|
|
57
|
+
props: {
|
|
58
|
+
variant: { type: String, default: "outlined" },
|
|
59
|
+
padding: { type: String, default: "md" },
|
|
60
|
+
hoverEffect: { type: Boolean, default: !1 }
|
|
61
|
+
},
|
|
62
|
+
setup(a, { slots: n }) {
|
|
63
|
+
return { getStyle: () => {
|
|
64
|
+
const r = {
|
|
65
|
+
borderRadius: l["2xl"],
|
|
66
|
+
transition: "all 0.25s cubic-bezier(0.4, 0, 0.2, 1)"
|
|
67
|
+
};
|
|
68
|
+
return a.padding === "none" ? r.padding = "0px" : a.padding === "sm" ? r.padding = "12px" : a.padding === "lg" ? r.padding = "28px" : r.padding = "20px", a.variant === "elevated" ? (r.backgroundColor = "#ffffff", r.boxShadow = i.md) : a.variant === "flat" ? (r.backgroundColor = e.slate[50], r.border = `1px solid ${e.slate[100]}`) : (r.backgroundColor = "#ffffff", r.border = `1px solid ${e.slate[200]}`, r.boxShadow = i.xs), r;
|
|
69
|
+
}, slots: n };
|
|
70
|
+
}
|
|
71
|
+
}, g = {
|
|
72
|
+
name: "ProtonStatusBadge",
|
|
73
|
+
props: {
|
|
74
|
+
label: { type: String, required: !0 },
|
|
75
|
+
status: { type: String, default: "neutral" },
|
|
76
|
+
pulse: { type: Boolean, default: !1 }
|
|
77
|
+
},
|
|
78
|
+
setup(a) {
|
|
79
|
+
return { getStyle: () => {
|
|
80
|
+
let s = e.slate[100], r = e.slate[700], t = e.slate[200], o = e.slate[500];
|
|
81
|
+
return a.status === "success" ? (s = e.status.success.light, r = e.status.success.text, t = e.status.success.border, o = e.status.success.main) : a.status === "warning" ? (s = e.status.warning.light, r = e.status.warning.text, t = e.status.warning.border, o = e.status.warning.main) : a.status === "error" ? (s = e.status.error.light, r = e.status.error.text, t = e.status.error.border, o = e.status.error.main) : a.status === "coffee" && (s = e.amber[50], r = e.amber[800], t = e.amber[200], o = e.amber[600]), {
|
|
82
|
+
pill: {
|
|
83
|
+
display: "inline-flex",
|
|
84
|
+
alignItems: "center",
|
|
85
|
+
gap: "6px",
|
|
86
|
+
padding: "4px 10px",
|
|
87
|
+
borderRadius: l.full,
|
|
88
|
+
backgroundColor: s,
|
|
89
|
+
color: r,
|
|
90
|
+
border: `1px solid ${t}`,
|
|
91
|
+
fontSize: "0.75rem",
|
|
92
|
+
fontWeight: "700"
|
|
93
|
+
},
|
|
94
|
+
dot: {
|
|
95
|
+
width: "6px",
|
|
96
|
+
height: "6px",
|
|
97
|
+
borderRadius: "50%",
|
|
98
|
+
backgroundColor: o,
|
|
99
|
+
display: "inline-block"
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
}, props: a };
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
export {
|
|
106
|
+
f as ProtonButton,
|
|
107
|
+
u as ProtonCard,
|
|
108
|
+
g as ProtonStatusBadge,
|
|
109
|
+
e as colors,
|
|
110
|
+
l as radii,
|
|
111
|
+
i as shadows,
|
|
112
|
+
p as spacing,
|
|
113
|
+
x as tokens,
|
|
114
|
+
m as typography
|
|
115
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dipesh.singh/proton",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Unified Design System & Framework-Agnostic Abstraction Layer for Hiljhil Cafe",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/dipeshsingh2012/proton.git"
|
|
9
|
+
},
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"design-system",
|
|
15
|
+
"material-ui",
|
|
16
|
+
"tokens",
|
|
17
|
+
"react",
|
|
18
|
+
"vue",
|
|
19
|
+
"hiljhil-cafe"
|
|
20
|
+
],
|
|
21
|
+
"type": "module",
|
|
22
|
+
"main": "./dist/react/index.js",
|
|
23
|
+
"module": "./dist/react/index.js",
|
|
24
|
+
"types": "./dist/react/index.d.ts",
|
|
25
|
+
"exports": {
|
|
26
|
+
".": {
|
|
27
|
+
"types": "./dist/react/index.d.ts",
|
|
28
|
+
"import": "./dist/react/index.js"
|
|
29
|
+
},
|
|
30
|
+
"./react": {
|
|
31
|
+
"types": "./dist/react/index.d.ts",
|
|
32
|
+
"import": "./dist/react/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./vue": {
|
|
35
|
+
"types": "./dist/vue/index.d.ts",
|
|
36
|
+
"import": "./dist/vue/index.js"
|
|
37
|
+
},
|
|
38
|
+
"./tokens": {
|
|
39
|
+
"types": "./dist/tokens/index.d.ts",
|
|
40
|
+
"import": "./dist/tokens/index.js"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"files": [
|
|
44
|
+
"dist"
|
|
45
|
+
],
|
|
46
|
+
"scripts": {
|
|
47
|
+
"build": "rm -rf dist && tsc -p tsconfig.json && vite build",
|
|
48
|
+
"type-check": "tsc --noEmit"
|
|
49
|
+
},
|
|
50
|
+
"peerDependencies": {
|
|
51
|
+
"react": ">=18.0.0",
|
|
52
|
+
"react-dom": ">=18.0.0"
|
|
53
|
+
},
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"@emotion/react": "^11.14.0",
|
|
56
|
+
"@emotion/styled": "^11.14.0",
|
|
57
|
+
"@mui/material": "^6.5.0"
|
|
58
|
+
},
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"@types/react": "^18.2.66",
|
|
61
|
+
"@types/react-dom": "^18.2.22",
|
|
62
|
+
"typescript": "^5.2.2",
|
|
63
|
+
"vite": "^5.1.6",
|
|
64
|
+
"react": "^18.2.0",
|
|
65
|
+
"react-dom": "^18.2.0"
|
|
66
|
+
}
|
|
67
|
+
}
|