@arkkad/design-system 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 +74 -0
- package/assets/fonts/OTSono/OTSono-Medium.woff +0 -0
- package/assets/fonts/OTSono/OTSono-Medium.woff2 +0 -0
- package/assets/fonts/OTSono/OTSono-Regular.woff +0 -0
- package/assets/fonts/OTSono/OTSono-Regular.woff2 +0 -0
- package/package.json +29 -0
- package/src/tailwind.css +338 -0
- package/tailwind.config.js +13 -0
- package/tailwind.preset.js +29 -0
package/README.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Fondr Design System
|
|
2
|
+
|
|
3
|
+
Design system TailwindCSS réutilisable sous forme de preset + CSS compilé.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Depuis ce repo :
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Build du CSS
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm run build:ds
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Le fichier généré :
|
|
20
|
+
- `packages/fondr-design-system/dist/tailwind.css`
|
|
21
|
+
|
|
22
|
+
## Utilisation dans un projet
|
|
23
|
+
|
|
24
|
+
1. Installer le package (workspace ou via repo).
|
|
25
|
+
2. Ajouter le preset dans `tailwind.config.js`.
|
|
26
|
+
3. Importer le CSS généré.
|
|
27
|
+
|
|
28
|
+
Exemple `tailwind.config.js` :
|
|
29
|
+
|
|
30
|
+
```js
|
|
31
|
+
module.exports = {
|
|
32
|
+
presets: [require("@fondr/design-system/preset")],
|
|
33
|
+
content: ["./src/**/*.{html,js,ts,jsx,tsx,php}"]
|
|
34
|
+
};
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Importer le CSS :
|
|
38
|
+
|
|
39
|
+
```css
|
|
40
|
+
@import "@fondr/design-system/styles";
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Police OTSono (auto)
|
|
44
|
+
|
|
45
|
+
Le CSS du design system inclut les `@font-face` OTSono.
|
|
46
|
+
Les fichiers `.woff/.woff2` sont packagés dans `@fondr/design-system/assets/fonts/OTSono`.
|
|
47
|
+
|
|
48
|
+
Si ton bundler gère les assets (Vite, Webpack, etc.), l'import du CSS suffit.
|
|
49
|
+
Sinon, il faut copier ce dossier dans un chemin public et ajuster les URLs dans `src/tailwind.css`.
|
|
50
|
+
|
|
51
|
+
## Variables de thème
|
|
52
|
+
|
|
53
|
+
Tu peux changer l’accent par site sans modifier le design system :
|
|
54
|
+
|
|
55
|
+
```css
|
|
56
|
+
:root {
|
|
57
|
+
--color-accent: #ff6b00;
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Valeurs par défaut :
|
|
62
|
+
- `--color-text: #14140f`
|
|
63
|
+
- `--color-card: #f5f5eb`
|
|
64
|
+
- `--color-accent: #2e5dff`
|
|
65
|
+
|
|
66
|
+
## Démo rapide
|
|
67
|
+
|
|
68
|
+
1. Builder le CSS.
|
|
69
|
+
2. Ouvrir `packages/fondr-design-system/demo/index.html` dans un navigateur.
|
|
70
|
+
|
|
71
|
+
## Notes
|
|
72
|
+
|
|
73
|
+
- Les polices `Inter` et `Space Grotesk` doivent être chargées (Google Fonts ou self-host).
|
|
74
|
+
- Les composants de base incluent `btn`, `btn-primary` et `card`.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@arkkad/design-system",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"main": "tailwind.preset.js",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": "./tailwind.preset.js",
|
|
11
|
+
"./preset": "./tailwind.preset.js",
|
|
12
|
+
"./styles": "./dist/tailwind.css"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"assets",
|
|
16
|
+
"dist",
|
|
17
|
+
"src",
|
|
18
|
+
"tailwind.preset.js",
|
|
19
|
+
"tailwind.config.js"
|
|
20
|
+
],
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"tailwindcss": "3.4.17"
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "tailwindcss -c tailwind.config.js -i ./src/tailwind.css -o ./dist/tailwind.css",
|
|
26
|
+
"build:public": "tailwindcss -c tailwind.config.js -i ./src/tailwind.css -o ../../public/assets/style/design-system.css",
|
|
27
|
+
"dev:public": "tailwindcss -c tailwind.config.js -i ./src/tailwind.css -o ../../public/assets/style/design-system.css --watch"
|
|
28
|
+
}
|
|
29
|
+
}
|
package/src/tailwind.css
ADDED
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
@tailwind base;
|
|
2
|
+
@tailwind components;
|
|
3
|
+
@tailwind utilities;
|
|
4
|
+
|
|
5
|
+
@font-face {
|
|
6
|
+
font-family: "OTSono";
|
|
7
|
+
src: url("/public/assets/fonts/OTSono/OTSono-Regular.woff2") format("woff2"),
|
|
8
|
+
url("/public/assets/fonts/OTSono/OTSono-Regular.woff") format("woff");
|
|
9
|
+
font-weight: 400;
|
|
10
|
+
font-style: normal;
|
|
11
|
+
font-display: swap;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@font-face {
|
|
15
|
+
font-family: "OTSono";
|
|
16
|
+
src: url("/public/assets/fonts/OTSono/OTSono-Medium.woff2") format("woff2"),
|
|
17
|
+
url("/public/assets/fonts/OTSono/OTSono-Medium.woff") format("woff");
|
|
18
|
+
font-weight: 500;
|
|
19
|
+
font-style: normal;
|
|
20
|
+
font-display: swap;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@layer base {
|
|
24
|
+
:root {
|
|
25
|
+
color-scheme: light;
|
|
26
|
+
--color-text: #14140f;
|
|
27
|
+
--color-card: #ffffff;
|
|
28
|
+
--color-accent: #2e5dff;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
body {
|
|
32
|
+
font-family: theme("fontFamily.body");
|
|
33
|
+
font-weight: 400;
|
|
34
|
+
color: theme("colors.text");
|
|
35
|
+
background: #ffffff;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
h1,
|
|
39
|
+
h2,
|
|
40
|
+
h3,
|
|
41
|
+
h4,
|
|
42
|
+
h5,
|
|
43
|
+
h6 {
|
|
44
|
+
font-family: theme("fontFamily.display");
|
|
45
|
+
font-weight: 500;
|
|
46
|
+
letter-spacing: -0.02em;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.shadow,
|
|
50
|
+
[class*="shadow-"] {
|
|
51
|
+
box-shadow: none !important;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.sidebar {
|
|
55
|
+
transition: width 200ms ease;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.sidebar-text,
|
|
59
|
+
.sidebar-section {
|
|
60
|
+
transition: opacity 150ms ease, transform 200ms ease;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.sidebar-collapsed .sidebar {
|
|
64
|
+
width: 88px !important;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.sidebar-collapsed .sidebar-text,
|
|
68
|
+
.sidebar-collapsed .sidebar-section {
|
|
69
|
+
opacity: 0;
|
|
70
|
+
transform: translateX(-8px);
|
|
71
|
+
pointer-events: none;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.sidebar-collapsed .sidebar summary {
|
|
75
|
+
justify-content: center;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
@layer components {
|
|
80
|
+
.btn {
|
|
81
|
+
@apply inline-flex items-center gap-2 rounded-md px-4 py-2 text-sm transition;
|
|
82
|
+
border-radius: 8px;
|
|
83
|
+
padding-left: 16px;
|
|
84
|
+
padding-right: 16px;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.btn-primary {
|
|
88
|
+
@apply btn bg-accent text-white hover:brightness-95;
|
|
89
|
+
border-radius: 8px !important;
|
|
90
|
+
color: #ffffff;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.btn-primary:hover {
|
|
94
|
+
color: #ffffff;
|
|
95
|
+
filter: brightness(0.9);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.btn-ghost {
|
|
99
|
+
@apply btn border border-black/10 text-text hover:border-black/20;
|
|
100
|
+
border-width: 1.5px;
|
|
101
|
+
border-radius: 8px !important;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.card {
|
|
105
|
+
@apply rounded-lg border border-[#f5f5eb] bg-card p-6;
|
|
106
|
+
border-width: 1.5px;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.badge {
|
|
110
|
+
@apply inline-flex items-center rounded-full border border-black/10 bg-white px-2.5 py-1 text-xs font-semibold text-text;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.badge-brand {
|
|
114
|
+
@apply inline-flex items-center rounded-full border-transparent bg-accent px-2.5 py-1 text-xs font-semibold text-white;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.badge-soft {
|
|
118
|
+
@apply inline-flex items-center rounded-full border border-black/10 bg-[#f5f5eb] px-2.5 py-1 text-xs text-text;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.badge-new {
|
|
122
|
+
@apply inline-flex items-center rounded-full border border-transparent bg-black text-white px-2.5 py-1 text-xs;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.badge-success {
|
|
126
|
+
@apply inline-flex items-center rounded-full border border-transparent bg-[#1f7a3d] text-white px-2.5 py-1 text-xs;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.badge-warning {
|
|
130
|
+
@apply inline-flex items-center rounded-full border border-transparent bg-[#b76a00] text-white px-2.5 py-1 text-xs;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.badge-error {
|
|
134
|
+
@apply inline-flex items-center rounded-full border border-transparent bg-[#b91c1c] text-white px-2.5 py-1 text-xs;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.chip {
|
|
138
|
+
@apply inline-flex items-center gap-2 rounded-full border border-black/10 bg-white px-3 py-1 text-xs text-text;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.chip-dot::before {
|
|
142
|
+
content: "";
|
|
143
|
+
width: 6px;
|
|
144
|
+
height: 6px;
|
|
145
|
+
border-radius: 999px;
|
|
146
|
+
background: currentColor;
|
|
147
|
+
display: inline-block;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.alert {
|
|
151
|
+
@apply flex items-start gap-3 rounded-lg border border-black/10 bg-white p-4 text-sm text-text;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.alert-info {
|
|
155
|
+
@apply border-[#d9d9d1] bg-[#f8f8f2];
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.alert-success {
|
|
159
|
+
@apply border-[#c9e7d0] bg-[#f3fbf5];
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.alert-warning {
|
|
163
|
+
@apply border-[#f0dd9c] bg-[#fff9e6];
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.alert-danger {
|
|
167
|
+
@apply border-[#f2c0c0] bg-[#fff2f2];
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.input {
|
|
171
|
+
@apply w-full rounded-md border border-black/10 bg-white px-3 py-2 text-sm text-text transition focus:border-black/40 focus:outline-none;
|
|
172
|
+
border-width: 1.5px;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.select {
|
|
176
|
+
@apply w-full rounded-md border border-black/10 bg-white px-3 py-2 text-sm text-text transition focus:border-black/40 focus:outline-none;
|
|
177
|
+
appearance: none;
|
|
178
|
+
border-width: 1.5px;
|
|
179
|
+
background-image:
|
|
180
|
+
linear-gradient(45deg, transparent 50%, currentColor 50%),
|
|
181
|
+
linear-gradient(135deg, currentColor 50%, transparent 50%),
|
|
182
|
+
linear-gradient(to right, transparent, transparent);
|
|
183
|
+
background-position:
|
|
184
|
+
calc(100% - 18px) calc(50% - 2px),
|
|
185
|
+
calc(100% - 12px) calc(50% - 2px),
|
|
186
|
+
calc(100% - 2.2rem) 50%;
|
|
187
|
+
background-size: 6px 6px, 6px 6px, 1px 60%;
|
|
188
|
+
background-repeat: no-repeat;
|
|
189
|
+
padding-right: 2.5rem;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.select option {
|
|
193
|
+
color: #14140f;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.input-error {
|
|
197
|
+
@apply border-red-400 focus:border-red-500;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.input-help {
|
|
201
|
+
@apply text-xs text-black/50;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.input-error-text {
|
|
205
|
+
@apply text-xs text-red-600;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.navbar {
|
|
209
|
+
@apply flex items-center justify-between gap-6 rounded-xl border border-black/10 bg-white/90 px-5 py-3 backdrop-blur;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.nav-link {
|
|
213
|
+
@apply text-sm font-semibold text-text transition hover:text-black;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.nav-link-active {
|
|
217
|
+
@apply text-accent;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.table {
|
|
221
|
+
@apply w-full border-collapse text-left text-sm;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.table thead th {
|
|
225
|
+
@apply border-b border-black/15 pb-3 text-xs font-semibold uppercase tracking-[0.2em] text-black/40;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.table tbody tr {
|
|
229
|
+
@apply border-b border-black/10;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.table tbody tr:hover {
|
|
233
|
+
@apply bg-black/5;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.table td {
|
|
237
|
+
@apply py-3 text-text;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.table-compact td {
|
|
241
|
+
@apply py-2;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.table-zebra tbody tr:nth-child(even) {
|
|
245
|
+
@apply bg-[#fafaf6];
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.table-cell-muted {
|
|
249
|
+
@apply text-black/55;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.table-cell-strong {
|
|
253
|
+
@apply font-medium text-text;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.tooltip {
|
|
257
|
+
position: relative;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.tooltip::after {
|
|
261
|
+
content: attr(data-tooltip);
|
|
262
|
+
position: absolute;
|
|
263
|
+
bottom: calc(100% + 8px);
|
|
264
|
+
left: 50%;
|
|
265
|
+
transform: translateX(-50%);
|
|
266
|
+
white-space: nowrap;
|
|
267
|
+
background: #14140f;
|
|
268
|
+
color: #ffffff;
|
|
269
|
+
font-size: 0.75rem;
|
|
270
|
+
padding: 6px 10px;
|
|
271
|
+
border-radius: 8px;
|
|
272
|
+
opacity: 0;
|
|
273
|
+
pointer-events: none;
|
|
274
|
+
transition: opacity 120ms ease;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.tooltip:hover::after,
|
|
278
|
+
.tooltip:focus-visible::after {
|
|
279
|
+
opacity: 1;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.tabs {
|
|
283
|
+
@apply flex items-center gap-2 border-b border-[#f5f5eb];
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.tab {
|
|
287
|
+
@apply px-3 py-2 text-sm text-black/60 transition;
|
|
288
|
+
border-bottom: 2px solid transparent;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.tab-active {
|
|
292
|
+
@apply text-text;
|
|
293
|
+
border-bottom-color: var(--color-accent);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.modal-overlay {
|
|
297
|
+
@apply fixed inset-0 bg-black/30;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.modal {
|
|
301
|
+
@apply fixed left-1/2 top-1/2 w-[90vw] max-w-lg -translate-x-1/2 -translate-y-1/2 rounded-lg border border-[#f5f5eb] bg-white p-6;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.pagination {
|
|
305
|
+
@apply flex items-center gap-2;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.page-link {
|
|
309
|
+
@apply inline-flex items-center justify-center border border-black/10 text-sm text-text;
|
|
310
|
+
width: 36px;
|
|
311
|
+
height: 36px;
|
|
312
|
+
border-radius: 8px;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.page-link-active {
|
|
316
|
+
@apply bg-accent text-white border-transparent;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.empty-state {
|
|
320
|
+
@apply flex flex-col items-center justify-center gap-2 rounded-lg border border-[#f5f5eb] bg-white p-8 text-center text-black/60;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.toast {
|
|
324
|
+
@apply flex items-start gap-3 rounded-lg border border-[#f5f5eb] bg-white px-4 py-3 text-sm text-text;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.toast-success {
|
|
328
|
+
@apply border-[#c9e7d0] bg-[#f3fbf5];
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.toast-warning {
|
|
332
|
+
@apply border-[#f0dd9c] bg-[#fff9e6];
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.toast-error {
|
|
336
|
+
@apply border-[#f2c0c0] bg-[#fff2f2];
|
|
337
|
+
}
|
|
338
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** @type {import('tailwindcss').Config} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
presets: [require("./tailwind.preset.js")],
|
|
4
|
+
content: [
|
|
5
|
+
"./src/**/*.{css,html,js,ts,jsx,tsx}",
|
|
6
|
+
"../../src/**/*.{php,html,js,ts,jsx,tsx}",
|
|
7
|
+
"../../views/**/*.{php,html}",
|
|
8
|
+
"../../public/**/*.{php,html,js,ts,jsx,tsx}"
|
|
9
|
+
],
|
|
10
|
+
theme: {
|
|
11
|
+
extend: {}
|
|
12
|
+
}
|
|
13
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** @type {import('tailwindcss').Config} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
theme: {
|
|
4
|
+
extend: {
|
|
5
|
+
colors: {
|
|
6
|
+
accent: "var(--color-accent)",
|
|
7
|
+
text: "var(--color-text)",
|
|
8
|
+
card: "var(--color-card)"
|
|
9
|
+
},
|
|
10
|
+
fontFamily: {
|
|
11
|
+
display: ["OTSono", "system-ui", "sans-serif"],
|
|
12
|
+
body: ["OTSono", "system-ui", "sans-serif"]
|
|
13
|
+
},
|
|
14
|
+
borderRadius: {
|
|
15
|
+
sm: "16px",
|
|
16
|
+
DEFAULT: "16px",
|
|
17
|
+
md: "16px",
|
|
18
|
+
lg: "16px",
|
|
19
|
+
xl: "16px",
|
|
20
|
+
"2xl": "16px",
|
|
21
|
+
"3xl": "16px"
|
|
22
|
+
},
|
|
23
|
+
boxShadow: {
|
|
24
|
+
soft: "none",
|
|
25
|
+
edge: "none"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|