@ponti-studios/ui 1.7.0 → 2.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 +54 -20
- package/dist/styles.css +3 -0
- package/package.json +28 -9
- package/scripts/create-project.mjs +82 -0
- package/src/components/forms/checkbox.stories.tsx +35 -0
- package/src/components/forms/checkbox.tsx +38 -0
- package/src/components/forms/index.ts +2 -0
- package/src/components/forms/label.stories.tsx +16 -0
- package/src/components/forms/label.tsx +25 -0
- package/src/components/forms/select.tsx +3 -1
- package/src/components/overlays/bottom-sheet.stories.tsx +52 -0
- package/src/components/overlays/bottom-sheet.tsx +179 -0
- package/src/components/overlays/command.tsx +1 -1
- package/src/components/overlays/dropdown-menu.tsx +6 -2
- package/src/components/overlays/index.ts +2 -0
- package/src/components/overlays/popover.tsx +12 -3
- package/src/components/overlays/tooltip.stories.tsx +29 -0
- package/src/components/overlays/tooltip.tsx +41 -0
- package/src/components/primitives/index.ts +2 -0
- package/src/components/primitives/segmented-control.stories.tsx +54 -0
- package/src/components/primitives/segmented-control.tsx +73 -0
- package/src/components/primitives/separator.stories.tsx +34 -0
- package/src/components/primitives/separator.tsx +27 -0
- package/src/index.ts +2 -0
- package/src/native/components.tsx +198 -0
- package/src/native/index.ts +2 -0
- package/src/native/theme.tsx +69 -0
- package/src/styles/build.ts +1 -0
- package/src/styles/index.css +102 -8
- package/src/styles/package.css +3 -0
- package/src/styles/tokens/color-systems.stories.tsx +173 -25
- package/src/styles/tokens/generated/dark-class.css +39 -0
- package/src/styles/tokens/generated/dark.colors.generated.ts +31 -26
- package/src/styles/tokens/generated/dark.css +31 -26
- package/src/styles/tokens/generated/foundations.css +2 -2
- package/src/styles/tokens/generated/foundations.generated.ts +2 -0
- package/src/styles/tokens/generated/light.colors.generated.ts +30 -25
- package/src/styles/tokens/generated/light.css +30 -25
- package/src/styles/tokens/index.ts +6 -6
- package/src/styles/tokens/scripts/check-source.mjs +10 -0
- package/src/styles/tokens/source/dark.tokens.json +48 -27
- package/src/styles/tokens/source/foundations.tokens.json +2 -0
- package/src/styles/tokens/source/light.tokens.json +47 -26
- package/src/styles/tokens/style-dictionary.dark-class.json +16 -0
- package/templates/web-vite/index.html +13 -0
- package/templates/web-vite/package.json +27 -0
- package/templates/web-vite/src/App.tsx +31 -0
- package/templates/web-vite/src/main.tsx +12 -0
- package/templates/web-vite/src/styles.css +110 -0
- package/templates/web-vite/tsconfig.json +21 -0
- package/templates/web-vite/vite.config.ts +6 -0
|
@@ -1,114 +1,135 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$extensions": {
|
|
3
|
-
"org.ponti.license": "MIT"
|
|
3
|
+
"org.ponti.license": "MIT",
|
|
4
|
+
"org.ponti.identity": "mono"
|
|
4
5
|
},
|
|
5
6
|
"background": {
|
|
6
7
|
"$type": "color",
|
|
7
|
-
"$value": "rgb(
|
|
8
|
+
"$value": "rgb(255, 255, 255)"
|
|
8
9
|
},
|
|
9
10
|
"card": {
|
|
10
11
|
"$type": "color",
|
|
11
|
-
"$value": "rgb(
|
|
12
|
+
"$value": "rgb(255, 255, 255)"
|
|
13
|
+
},
|
|
14
|
+
"secondary": {
|
|
15
|
+
"$type": "color",
|
|
16
|
+
"$value": "rgb(245, 245, 245)"
|
|
12
17
|
},
|
|
13
18
|
"popover": {
|
|
14
19
|
"$type": "color",
|
|
15
|
-
"$value": "rgb(
|
|
20
|
+
"$value": "rgb(255, 255, 255)"
|
|
16
21
|
},
|
|
17
22
|
"muted": {
|
|
18
23
|
"$type": "color",
|
|
19
|
-
"$value": "rgb(
|
|
24
|
+
"$value": "rgb(250, 250, 250)"
|
|
20
25
|
},
|
|
21
26
|
"text-primary": {
|
|
22
27
|
"$type": "color",
|
|
23
|
-
"$value": "rgb(17, 17,
|
|
28
|
+
"$value": "rgb(17, 17, 17)"
|
|
24
29
|
},
|
|
25
30
|
"text-secondary": {
|
|
26
31
|
"$type": "color",
|
|
27
|
-
"$value": "rgb(
|
|
32
|
+
"$value": "rgb(107, 107, 107)"
|
|
28
33
|
},
|
|
29
34
|
"tertiary": {
|
|
30
35
|
"$type": "color",
|
|
31
|
-
"$value": "
|
|
36
|
+
"$value": "{text-secondary}"
|
|
32
37
|
},
|
|
33
38
|
"primary": {
|
|
34
39
|
"$type": "color",
|
|
35
|
-
"$value": "rgb(
|
|
40
|
+
"$value": "rgb(23, 23, 23)"
|
|
41
|
+
},
|
|
42
|
+
"accent": {
|
|
43
|
+
"$type": "color",
|
|
44
|
+
"$value": "rgb(239, 246, 255)"
|
|
36
45
|
},
|
|
37
46
|
"destructive": {
|
|
38
47
|
"$type": "color",
|
|
39
|
-
"$value": "rgb(
|
|
48
|
+
"$value": "rgb(220, 38, 38)"
|
|
40
49
|
},
|
|
41
50
|
"success": {
|
|
42
51
|
"$type": "color",
|
|
43
|
-
"$value": "rgb(
|
|
52
|
+
"$value": "rgb(22, 163, 74)"
|
|
44
53
|
},
|
|
45
54
|
"warning": {
|
|
46
55
|
"$type": "color",
|
|
47
|
-
"$value": "rgb(
|
|
56
|
+
"$value": "rgb(217, 119, 6)"
|
|
57
|
+
},
|
|
58
|
+
"text-success": {
|
|
59
|
+
"$type": "color",
|
|
60
|
+
"$value": "rgb(21, 128, 61)"
|
|
61
|
+
},
|
|
62
|
+
"text-warning": {
|
|
63
|
+
"$type": "color",
|
|
64
|
+
"$value": "rgb(146, 64, 14)"
|
|
48
65
|
},
|
|
49
66
|
"success-foreground": {
|
|
50
67
|
"$type": "color",
|
|
51
|
-
"$value": "rgb(
|
|
68
|
+
"$value": "rgb(10, 10, 10)"
|
|
52
69
|
},
|
|
53
70
|
"warning-foreground": {
|
|
54
71
|
"$type": "color",
|
|
55
|
-
"$value": "rgb(
|
|
72
|
+
"$value": "rgb(10, 10, 10)"
|
|
56
73
|
},
|
|
57
74
|
"primary-foreground": {
|
|
58
75
|
"$type": "color",
|
|
59
76
|
"$value": "rgb(255, 255, 255)"
|
|
60
77
|
},
|
|
78
|
+
"accent-foreground": {
|
|
79
|
+
"$type": "color",
|
|
80
|
+
"$value": "rgb(29, 78, 216)"
|
|
81
|
+
},
|
|
61
82
|
"destructive-foreground": {
|
|
62
83
|
"$type": "color",
|
|
63
84
|
"$value": "rgb(255, 255, 255)"
|
|
64
85
|
},
|
|
65
86
|
"text-destructive": {
|
|
66
87
|
"$type": "color",
|
|
67
|
-
"$value": "rgb(
|
|
88
|
+
"$value": "rgb(185, 28, 28)"
|
|
68
89
|
},
|
|
69
90
|
"text-accent": {
|
|
70
91
|
"$type": "color",
|
|
71
|
-
"$value": "rgb(
|
|
92
|
+
"$value": "rgb(37, 99, 235)"
|
|
72
93
|
},
|
|
73
94
|
"border-default": {
|
|
74
95
|
"$type": "color",
|
|
75
|
-
"$value": "rgb(
|
|
96
|
+
"$value": "rgb(229, 229, 229)"
|
|
76
97
|
},
|
|
77
98
|
"focus-ring": {
|
|
78
99
|
"$type": "color",
|
|
79
|
-
"$value": "rgb(
|
|
100
|
+
"$value": "rgb(37, 99, 235)"
|
|
80
101
|
},
|
|
81
102
|
"chart-1": {
|
|
82
103
|
"$type": "color",
|
|
83
|
-
"$value": "rgb(
|
|
104
|
+
"$value": "rgb(37, 99, 235)"
|
|
84
105
|
},
|
|
85
106
|
"chart-2": {
|
|
86
107
|
"$type": "color",
|
|
87
|
-
"$value": "rgb(
|
|
108
|
+
"$value": "rgb(17, 17, 17)"
|
|
88
109
|
},
|
|
89
110
|
"chart-3": {
|
|
90
111
|
"$type": "color",
|
|
91
|
-
"$value": "rgb(
|
|
112
|
+
"$value": "rgb(115, 115, 115)"
|
|
92
113
|
},
|
|
93
114
|
"chart-4": {
|
|
94
115
|
"$type": "color",
|
|
95
|
-
"$value": "rgb(
|
|
116
|
+
"$value": "rgb(147, 197, 253)"
|
|
96
117
|
},
|
|
97
118
|
"chart-5": {
|
|
98
119
|
"$type": "color",
|
|
99
|
-
"$value": "rgb(
|
|
120
|
+
"$value": "rgb(212, 212, 216)"
|
|
100
121
|
},
|
|
101
122
|
"chart-positive": {
|
|
102
123
|
"$type": "color",
|
|
103
|
-
"$value": "rgb(
|
|
124
|
+
"$value": "rgb(21, 128, 61)"
|
|
104
125
|
},
|
|
105
126
|
"chart-negative": {
|
|
106
127
|
"$type": "color",
|
|
107
|
-
"$value": "rgb(
|
|
128
|
+
"$value": "rgb(220, 38, 38)"
|
|
108
129
|
},
|
|
109
130
|
"chart-neutral": {
|
|
110
131
|
"$type": "color",
|
|
111
|
-
"$value": "rgb(
|
|
132
|
+
"$value": "rgb(115, 115, 115)"
|
|
112
133
|
},
|
|
113
134
|
"overlay-scrim": {
|
|
114
135
|
"$type": "color",
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"source": ["src/styles/tokens/source/dark.tokens.json"],
|
|
3
|
+
"platforms": {
|
|
4
|
+
"css": {
|
|
5
|
+
"transformGroup": "css",
|
|
6
|
+
"buildPath": "src/styles/tokens/generated/",
|
|
7
|
+
"files": [
|
|
8
|
+
{
|
|
9
|
+
"destination": "dark-class.css",
|
|
10
|
+
"format": "css/variables",
|
|
11
|
+
"options": { "selector": ":root.dark" }
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<meta name="description" content="A Ponti Studios project." />
|
|
7
|
+
<title>New Ponti project</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="root"></div>
|
|
11
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "project-name-placeholder",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite",
|
|
8
|
+
"build": "tsc --noEmit && vite build",
|
|
9
|
+
"preview": "vite preview",
|
|
10
|
+
"typecheck": "tsc --noEmit"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@ponti-studios/ui": "^1.8.0",
|
|
14
|
+
"react": "19.2.7",
|
|
15
|
+
"react-dom": "19.2.7"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@types/react": "19.2.17",
|
|
19
|
+
"@types/react-dom": "19.2.3",
|
|
20
|
+
"@vitejs/plugin-react": "6.1.2",
|
|
21
|
+
"typescript": "7.0.2",
|
|
22
|
+
"vite": "8.3.4"
|
|
23
|
+
},
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">=20.19.0"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Button } from "@ponti-studios/ui/primitives";
|
|
2
|
+
|
|
3
|
+
export default function App() {
|
|
4
|
+
return (
|
|
5
|
+
<main className="starter-page">
|
|
6
|
+
<header className="starter-header">
|
|
7
|
+
<a aria-label="Project home" className="starter-home" href="/">
|
|
8
|
+
New project
|
|
9
|
+
</a>
|
|
10
|
+
<span className="starter-caption">Built with Ponti UI</span>
|
|
11
|
+
</header>
|
|
12
|
+
|
|
13
|
+
<section className="starter-content">
|
|
14
|
+
<p className="starter-eyebrow">A fresh start</p>
|
|
15
|
+
<h1 className="starter-title">Start with the system. Make the product yours.</h1>
|
|
16
|
+
<p className="starter-description">
|
|
17
|
+
Your project already has Ponti tokens, themes, styles, and components. Replace this page
|
|
18
|
+
with the thing you want to make.
|
|
19
|
+
</p>
|
|
20
|
+
<div className="starter-actions">
|
|
21
|
+
<Button>Primary action</Button>
|
|
22
|
+
<Button variant="outline">Secondary action</Button>
|
|
23
|
+
</div>
|
|
24
|
+
</section>
|
|
25
|
+
|
|
26
|
+
<footer className="starter-footer">
|
|
27
|
+
Change the shared system through @ponti-studios/ui; keep product-specific choices here.
|
|
28
|
+
</footer>
|
|
29
|
+
</main>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import ReactDOM from "react-dom/client";
|
|
3
|
+
|
|
4
|
+
import App from "./App";
|
|
5
|
+
import "@ponti-studios/ui";
|
|
6
|
+
import "./styles.css";
|
|
7
|
+
|
|
8
|
+
ReactDOM.createRoot(document.getElementById("root")!).render(
|
|
9
|
+
<React.StrictMode>
|
|
10
|
+
<App />
|
|
11
|
+
</React.StrictMode>,
|
|
12
|
+
);
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
font-family: var(--font-sans);
|
|
3
|
+
color: var(--text-primary);
|
|
4
|
+
background: var(--background);
|
|
5
|
+
font-synthesis: none;
|
|
6
|
+
text-rendering: optimizeLegibility;
|
|
7
|
+
-webkit-font-smoothing: antialiased;
|
|
8
|
+
-moz-osx-font-smoothing: grayscale;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
body {
|
|
12
|
+
min-width: 320px;
|
|
13
|
+
min-height: 100vh;
|
|
14
|
+
margin: 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
a {
|
|
18
|
+
color: inherit;
|
|
19
|
+
text-decoration: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.starter-page {
|
|
23
|
+
box-sizing: border-box;
|
|
24
|
+
display: flex;
|
|
25
|
+
width: min(100%, 1024px);
|
|
26
|
+
min-height: 100vh;
|
|
27
|
+
margin-inline: auto;
|
|
28
|
+
padding: 2rem 1.5rem;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.starter-header,
|
|
33
|
+
.starter-footer {
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
justify-content: space-between;
|
|
37
|
+
border-color: var(--border-default);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.starter-header {
|
|
41
|
+
padding-bottom: 1.25rem;
|
|
42
|
+
border-bottom: 1px solid var(--border-default);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.starter-home {
|
|
46
|
+
font-size: 0.875rem;
|
|
47
|
+
font-weight: 600;
|
|
48
|
+
letter-spacing: -0.025em;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.starter-caption,
|
|
52
|
+
.starter-eyebrow,
|
|
53
|
+
.starter-footer {
|
|
54
|
+
color: var(--text-secondary);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.starter-caption,
|
|
58
|
+
.starter-footer {
|
|
59
|
+
font-size: 0.75rem;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.starter-content {
|
|
63
|
+
display: flex;
|
|
64
|
+
flex: 1;
|
|
65
|
+
padding-block: 5rem;
|
|
66
|
+
flex-direction: column;
|
|
67
|
+
align-items: flex-start;
|
|
68
|
+
justify-content: center;
|
|
69
|
+
gap: 1.5rem;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.starter-eyebrow {
|
|
73
|
+
margin: 0;
|
|
74
|
+
font-size: 0.875rem;
|
|
75
|
+
font-weight: 500;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.starter-title {
|
|
79
|
+
max-width: 48rem;
|
|
80
|
+
margin: 0;
|
|
81
|
+
font-size: clamp(2.5rem, 8vw, 3.75rem);
|
|
82
|
+
font-weight: 600;
|
|
83
|
+
letter-spacing: -0.04em;
|
|
84
|
+
line-height: 1.05;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.starter-description {
|
|
88
|
+
max-width: 36rem;
|
|
89
|
+
margin: 0;
|
|
90
|
+
color: var(--text-secondary);
|
|
91
|
+
font-size: 1.125rem;
|
|
92
|
+
line-height: 1.75;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.starter-actions {
|
|
96
|
+
display: flex;
|
|
97
|
+
flex-wrap: wrap;
|
|
98
|
+
gap: 0.75rem;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.starter-footer {
|
|
102
|
+
padding-block: 1rem;
|
|
103
|
+
border-top: 1px solid var(--border-default);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
@media (min-width: 640px) {
|
|
107
|
+
.starter-page {
|
|
108
|
+
padding-inline: 2.5rem;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
"moduleResolution": "Bundler",
|
|
9
|
+
"allowImportingTsExtensions": true,
|
|
10
|
+
"verbatimModuleSyntax": true,
|
|
11
|
+
"moduleDetection": "force",
|
|
12
|
+
"noEmit": true,
|
|
13
|
+
"jsx": "react-jsx",
|
|
14
|
+
"strict": true,
|
|
15
|
+
"noUnusedLocals": true,
|
|
16
|
+
"noUnusedParameters": true,
|
|
17
|
+
"noFallthroughCasesInSwitch": true,
|
|
18
|
+
"types": ["vite/client"]
|
|
19
|
+
},
|
|
20
|
+
"include": ["src", "vite.config.ts"]
|
|
21
|
+
}
|