odoro 1.0.1 → 1.0.2

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.
Files changed (46) hide show
  1. package/README.md +73 -0
  2. package/dist/cli.js +2 -2
  3. package/dist/{create-LTT3SAWT.js → create-GD6O2TPL.js} +107 -63
  4. package/dist/{package-LK46RV2I.js → package-VMTZDORI.js} +1 -1
  5. package/dist/registry/index.d.ts +2 -2
  6. package/package.json +1 -1
  7. package/templates/{react-ts-server/_variantes/avec-moteur/client/src/sections/Fond.tsx → react-ts/_variantes/avec-moteur/src/fond.tsx} +13 -13
  8. package/templates/react-ts/_variantes/sans-libs/src/App.tsx +250 -21
  9. package/templates/react-ts/_variantes/sans-libs/src/{sections/Fond.tsx → fond.tsx} +1 -1
  10. package/templates/react-ts/_variantes/sans-libs/src/styles.css +68 -35
  11. package/templates/react-ts/_variantes/sans-routeur/src/App.tsx +309 -24
  12. package/templates/react-ts/public/favicon.svg +2 -3
  13. package/templates/react-ts/src/App.tsx +422 -49
  14. package/templates/react-ts/src/{sections/Fond.tsx → fond.tsx} +9 -9
  15. package/templates/react-ts/src/router.tsx +72 -0
  16. package/templates/{react-ts/_variantes/avec-moteur/src/sections/Fond.tsx → react-ts-server/_variantes/avec-moteur/client/src/fond.tsx} +13 -13
  17. package/templates/react-ts-server/_variantes/sans-libs/client/src/App.tsx +250 -21
  18. package/templates/react-ts-server/_variantes/sans-libs/client/src/{sections/Fond.tsx → fond.tsx} +1 -1
  19. package/templates/react-ts-server/_variantes/sans-libs/client/src/styles.css +68 -35
  20. package/templates/react-ts-server/_variantes/sans-routeur/client/src/App.tsx +309 -24
  21. package/templates/react-ts-server/client/public/favicon.svg +2 -3
  22. package/templates/react-ts-server/client/src/App.tsx +422 -49
  23. package/templates/react-ts-server/client/src/{sections/Fond.tsx → fond.tsx} +9 -9
  24. package/templates/react-ts-server/client/src/router.tsx +72 -0
  25. package/templates/react-ts/_variantes/sans-libs/src/composants/Marque.tsx +0 -37
  26. package/templates/react-ts/_variantes/sans-libs/src/sections/Cloture.tsx +0 -60
  27. package/templates/react-ts/_variantes/sans-libs/src/sections/Hero.tsx +0 -92
  28. package/templates/react-ts/_variantes/sans-libs/src/sections/Piliers.tsx +0 -44
  29. package/templates/react-ts/src/composants/Marque.tsx +0 -50
  30. package/templates/react-ts/src/routes/About.tsx +0 -43
  31. package/templates/react-ts/src/routes/Home.tsx +0 -28
  32. package/templates/react-ts/src/routes/NotFound.tsx +0 -14
  33. package/templates/react-ts/src/sections/Cloture.tsx +0 -69
  34. package/templates/react-ts/src/sections/Hero.tsx +0 -119
  35. package/templates/react-ts/src/sections/Piliers.tsx +0 -68
  36. package/templates/react-ts-server/_variantes/sans-libs/client/src/composants/Marque.tsx +0 -37
  37. package/templates/react-ts-server/_variantes/sans-libs/client/src/sections/Cloture.tsx +0 -60
  38. package/templates/react-ts-server/_variantes/sans-libs/client/src/sections/Hero.tsx +0 -92
  39. package/templates/react-ts-server/_variantes/sans-libs/client/src/sections/Piliers.tsx +0 -44
  40. package/templates/react-ts-server/client/src/composants/Marque.tsx +0 -50
  41. package/templates/react-ts-server/client/src/routes/About.tsx +0 -43
  42. package/templates/react-ts-server/client/src/routes/Home.tsx +0 -28
  43. package/templates/react-ts-server/client/src/routes/NotFound.tsx +0 -14
  44. package/templates/react-ts-server/client/src/sections/Cloture.tsx +0 -69
  45. package/templates/react-ts-server/client/src/sections/Hero.tsx +0 -119
  46. package/templates/react-ts-server/client/src/sections/Piliers.tsx +0 -68
@@ -1,48 +1,333 @@
1
- import type { ReactElement } from 'react'
1
+ /**
2
+ * Toute la page, en un fichier.
3
+ *
4
+ * ## Une seule page
5
+ *
6
+ * Le routeur n'a pas ete retenu a la creation : il n'y a donc ni `router.tsx`
7
+ * ni navigation entre pages, et les sections se suivent. Le dessin est le meme
8
+ * que dans la version routee.
9
+ *
10
+ * Pour en ajouter un plus tard, `@odoro-cli/libs/router` est deja installe : il
11
+ * vient avec les bibliotheques.
12
+ *
13
+ * ## La barre de navigation
14
+ *
15
+ * Elle ne peint pas de bandeau : ce sont des gelules posees sur ce qu'il y a
16
+ * derriere, avec un flou d'arriere-plan. Le fond decoratif continue donc de
17
+ * passer dessous, au lieu d'etre coupe par une bande opaque.
18
+ *
19
+ * @module
20
+ */
21
+
22
+ import { Reveal, Stagger } from '@odoro-cli/libs/motion'
23
+ import { buttonClasses } from '@odoro-cli/libs/ui'
24
+ import { useState, type CSSProperties, type ReactElement } from 'react'
2
25
 
3
- import { Marque } from '@/composants/Marque'
4
- import { Cloture } from '@/sections/Cloture'
5
- import { Fond } from '@/sections/Fond'
6
- import { Hero } from '@/sections/Hero'
7
- import { Piliers } from '@/sections/Piliers'
26
+ import { Fond } from '@/fond'
27
+
28
+ /* -------------------------------------------------------------------------- */
29
+ /* Marque */
30
+ /* -------------------------------------------------------------------------- */
8
31
 
9
32
  /**
10
- * Racine de l'application.
33
+ * Le signe de la marque.
11
34
  *
12
- * Une seule page : le routeur n'a pas ete retenu a la creation. Les sections
13
- * sont les memes que dans la version routee meme dessin, memes fichiers — et
14
- * seul leur assemblage change.
35
+ * La taille est en style et non en classe : une classe utilitaire a valeur
36
+ * arbitraire n'est emise que si le compilateur l'a vue passer, et une classe
37
+ * absente ne peint rien — le signe serait sans dimensions, donc invisible.
38
+ */
39
+ function Signe({ taille = '1.75rem' }: { readonly taille?: string }): ReactElement {
40
+ return (
41
+ <svg
42
+ viewBox="0 0 100 100"
43
+ fill="none"
44
+ aria-hidden="true"
45
+ style={{ width: taille, height: taille, flexShrink: 0 }}
46
+ >
47
+ <path
48
+ d="M20.25 20.25H50a29.75 29.75 0 1 1-29.75 29.75Z"
49
+ stroke="currentColor"
50
+ strokeWidth="10.5"
51
+ strokeLinejoin="miter"
52
+ />
53
+ </svg>
54
+ )
55
+ }
56
+
57
+ /* -------------------------------------------------------------------------- */
58
+ /* Barre de navigation */
59
+ /* -------------------------------------------------------------------------- */
60
+
61
+ /**
62
+ * La surface d'une gelule.
15
63
  *
16
- * Pour ajouter un routeur plus tard, `@odoro-cli/libs/router` est deja
17
- * installe : il vient avec les bibliotheques.
64
+ * Le systeme decline les echelles de noir et de blanc, mais pas leurs variantes
65
+ * sombres en alpha. Le melange se fait donc en style, ou il est exact et suit
66
+ * le theme sans qu'on ait a redire chaque couleur.
18
67
  */
19
- export function App(): ReactElement {
68
+ const GELULE: CSSProperties = {
69
+ backgroundColor: 'color-mix(in oklab, var(--o-theme-bg) 72%, transparent)',
70
+ borderColor: 'color-mix(in oklab, var(--o-theme-fg) 12%, transparent)',
71
+ }
72
+
73
+ /** La barre : la marque, et le lien vers le site. */
74
+ function Barre(): ReactElement {
20
75
  return (
21
- <div className="app-shell">
22
- <nav className="o-sticky o-top-0 o-z-20 o-border-b o-border-zinc-200/70 dark:o-border-zinc-800/70 o-bg-white/70 dark:o-bg-zinc-950/70 o-backdrop-blur">
23
- <div className="o-mx-auto o-flex o-w-full o-max-w-5xl o-items-center o-px-6 o-py-4">
24
- <Marque />
76
+ <header className="o-sticky o-top-0 o-z-20 o-px-5 md:o-px-8">
77
+ <div className="o-mx-auto o-flex o-h-20 o-w-full o-max-w-5xl o-items-center o-gap-3">
78
+ <span
79
+ className="o-inline-flex o-h-14 o-shrink-0 o-items-center o-gap-2.5 o-rounded-full o-border-w-1 o-pl-5 o-pr-6 o-backdrop-blur-xl"
80
+ style={GELULE}
81
+ >
82
+ <span className="o-text-brand-500">
83
+ <Signe />
84
+ </span>
85
+ <span className="o-text-lg o-font-bold o-tracking-wide o-text-zinc-950 dark:o-text-white">
86
+ ODORO
87
+ </span>
88
+ </span>
89
+
90
+ <a
91
+ href="https://odoro.dev"
92
+ target="_blank"
93
+ rel="noreferrer"
94
+ className="o-ml-auto o-inline-flex o-h-14 o-shrink-0 o-items-center o-rounded-full o-border-w-1 o-px-5 o-text-sm o-no-underline o-backdrop-blur-xl o-text-zinc-600 dark:o-text-zinc-300 hover:o-text-zinc-950 dark:hover:o-text-white"
95
+ style={GELULE}
96
+ >
97
+ odoro.dev
98
+ </a>
99
+ </div>
100
+ </header>
101
+ )
102
+ }
103
+
104
+ /* -------------------------------------------------------------------------- */
105
+ /* Sections */
106
+ /* -------------------------------------------------------------------------- */
107
+
108
+ /** Trois faits, pas trois slogans. */
109
+ const FAITS = ['Zero configuration', 'Theme clair et sombre', 'Mouvement reduit respecte']
110
+
111
+ /** Ce que la fenetre du produit montre. */
112
+ const EXTRAIT = `export function App() {
113
+ return (
114
+ <Reveal>
115
+ <h1 className="o-text-6xl o-font-bold">
116
+ Votre premiere page.
117
+ </h1>
118
+ </Reveal>
119
+ )
120
+ }`
121
+
122
+ /** Une fenetre de navigateur miniature. */
123
+ function Fenetre(): ReactElement {
124
+ return (
125
+ <div className="o-overflow-hidden o-rounded-2xl o-border-w-1 o-border-zinc-200 dark:o-border-zinc-800 o-bg-zinc-50 dark:o-bg-zinc-900 o-shadow-2xl">
126
+ <div className="o-flex o-items-center o-gap-2 o-border-b o-border-zinc-200 dark:o-border-zinc-800 o-px-4 o-py-2.5">
127
+ <span className="o-flex o-gap-1.5" aria-hidden="true">
128
+ <span className="o-size-2.5 o-rounded-full o-bg-zinc-300 dark:o-bg-zinc-700" />
129
+ <span className="o-size-2.5 o-rounded-full o-bg-zinc-300 dark:o-bg-zinc-700" />
130
+ <span className="o-size-2.5 o-rounded-full o-bg-zinc-300 dark:o-bg-zinc-700" />
131
+ </span>
132
+ <span className="o-ml-2 o-font-mono o-text-xs o-text-zinc-400">src/App.tsx</span>
133
+ </div>
134
+ <pre className="o-m-0 o-overflow-x-auto o-p-5 o-font-mono o-text-xs o-leading-relaxed o-text-zinc-600 dark:o-text-zinc-300">
135
+ {EXTRAIT}
136
+ </pre>
137
+ </div>
138
+ )
139
+ }
140
+
141
+ /** Le hero : la promesse, les actions, et la fenetre du produit. */
142
+ function Hero(): ReactElement {
143
+ return (
144
+ <section className="o-relative o-px-6 o-pb-20 o-pt-16 md:o-pt-24">
145
+ <div className="o-mx-auto o-w-full o-max-w-5xl">
146
+ <Reveal>
147
+ <span className="o-inline-flex o-items-center o-gap-2 o-whitespace-nowrap o-rounded-full o-border-w-1 o-border-brand-500/30 o-bg-brand-500/10 o-px-3 o-py-1 o-text-xs o-font-medium o-text-brand-600 dark:o-text-brand-400">
148
+ <Signe taille="0.9rem" />
149
+ Genere par odoro create
150
+ </span>
151
+
152
+ <h1 className="o-mt-6 o-max-w-3xl o-text-5xl o-font-bold o-tracking-tight md:o-text-6xl">
153
+ Votre premiere page, <span className="o-text-brand-500">deja vivante</span>.
154
+ </h1>
155
+
156
+ <p className="o-mt-5 o-max-w-xl o-text-lg o-text-zinc-500 dark:o-text-zinc-400">
157
+ Le moteur d animation et le systeme de style viennent de la meme librairie.
158
+ Modifiez cette page : elle se recharge sans perdre son etat.
159
+ </p>
160
+ </Reveal>
161
+
162
+ <Stagger step={70} className="o-mt-8 o-flex o-flex-wrap o-items-center o-gap-3">
25
163
  <a
26
- href="https://odoro.dev"
164
+ href="#piliers"
165
+ className={`o-no-underline ${buttonClasses({ tone: 'primary' })}`}
166
+ >
167
+ Voir ce qui est inclus
168
+ </a>
169
+ <a
170
+ href="https://odoro.dev/docs"
27
171
  target="_blank"
28
172
  rel="noreferrer"
29
- className="o-ml-auto o-text-sm o-text-zinc-500 dark:o-text-zinc-400 o-no-underline hover:o-text-brand-500"
173
+ className={`o-no-underline ${buttonClasses({ tone: 'secondary' })}`}
30
174
  >
31
- odoro.dev
175
+ Documentation
32
176
  </a>
33
- </div>
34
- </nav>
177
+ </Stagger>
178
+
179
+ <Stagger step={60} className="o-mt-6 o-flex o-flex-wrap o-gap-2">
180
+ {FAITS.map((fait) => (
181
+ <span
182
+ key={fait}
183
+ className="o-rounded-full o-border-w-1 o-border-zinc-200 dark:o-border-zinc-800 o-px-3 o-py-1 o-text-xs o-text-zinc-500 dark:o-text-zinc-400"
184
+ >
185
+ {fait}
186
+ </span>
187
+ ))}
188
+ </Stagger>
189
+
190
+ <Reveal>
191
+ <div className="o-mt-14">
192
+ <Fenetre />
193
+ </div>
194
+ </Reveal>
195
+ </div>
196
+ </section>
197
+ )
198
+ }
199
+
200
+ /** Ce que le projet a deja sous la main. */
201
+ const PILIERS = [
202
+ {
203
+ titre: 'Animations',
204
+ texte:
205
+ "Une couche mince sur le moteur du navigateur. Le mouvement reduit est respecte d'office.",
206
+ },
207
+ {
208
+ titre: 'Styles',
209
+ texte: 'Des jetons en source de verite, une feuille statique, aucun scan a l execution.',
210
+ },
211
+ {
212
+ titre: 'Interface',
213
+ texte: 'Des composants qui lisent les memes jetons que votre code : les rethemer suffit.',
214
+ },
215
+ ]
216
+
217
+ /** La section des piliers. */
218
+ function Piliers(): ReactElement {
219
+ return (
220
+ <section
221
+ id="piliers"
222
+ className="o-border-t o-border-zinc-200 dark:o-border-zinc-800 o-px-6 o-py-20"
223
+ >
224
+ <div className="o-mx-auto o-w-full o-max-w-5xl">
225
+ <h2 className="o-text-sm o-font-semibold o-uppercase o-tracking-widest o-text-zinc-400">
226
+ Ce qui est deja la
227
+ </h2>
228
+
229
+ <Stagger step={90} className="o-mt-8 o-grid o-gap-4 md:o-grid-cols-3">
230
+ {PILIERS.map((pilier, index) => (
231
+ <article
232
+ key={pilier.titre}
233
+ className="o-rounded-xl o-border-w-1 o-border-zinc-200 dark:o-border-zinc-800 o-bg-white dark:o-bg-zinc-900 o-p-6"
234
+ >
235
+ <span className="o-font-mono o-text-xs o-text-brand-500">
236
+ {String(index + 1).padStart(2, '0')}
237
+ </span>
238
+ <h3 className="o-mt-3 o-text-lg o-font-semibold o-tracking-tight">
239
+ {pilier.titre}
240
+ </h3>
241
+ <p className="o-mt-2 o-text-sm o-text-zinc-500 dark:o-text-zinc-400">
242
+ {pilier.texte}
243
+ </p>
244
+ </article>
245
+ ))}
246
+ </Stagger>
247
+ </div>
248
+ </section>
249
+ )
250
+ }
251
+
252
+ /** La commande que l'on copie le plus souvent. */
253
+ const COMMANDE = 'odoro add text/count-up'
35
254
 
255
+ /** La cloture : une commande, et la porte vers le catalogue. */
256
+ function Cloture(): ReactElement {
257
+ const [copie, setCopie] = useState(false)
258
+
259
+ return (
260
+ <section className="o-border-t o-border-zinc-200 dark:o-border-zinc-800 o-px-6 o-py-24">
261
+ <div className="o-mx-auto o-w-full o-max-w-3xl o-text-center">
262
+ <Reveal>
263
+ <h2 className="o-text-3xl o-font-bold o-tracking-tight md:o-text-4xl">
264
+ Ajoutez un composant, sans quitter le terminal.
265
+ </h2>
266
+ <p className="o-mx-auto o-mt-4 o-max-w-prose o-text-zinc-500 dark:o-text-zinc-400">
267
+ Le registre copie le code dans votre projet. Il vous appartient : on le lit,
268
+ on le modifie, il ne se met pas a jour dans votre dos.
269
+ </p>
270
+
271
+ <div className="o-mx-auto o-mt-8 o-flex o-max-w-md o-items-center o-gap-2 o-rounded-xl o-border-w-1 o-border-zinc-200 dark:o-border-zinc-800 o-bg-zinc-50 dark:o-bg-zinc-900 o-p-2 o-pl-4">
272
+ <code className="o-flex-1 o-text-left o-font-mono o-text-sm">{COMMANDE}</code>
273
+ <button
274
+ type="button"
275
+ className={buttonClasses({ tone: 'ghost', size: 'sm' })}
276
+ onClick={() => {
277
+ // Le presse-papiers peut etre refuse — hors contexte sur, ou
278
+ // permission retiree. L'echec ne casse pas la page.
279
+ void navigator.clipboard
280
+ ?.writeText(COMMANDE)
281
+ .then(() => {
282
+ setCopie(true)
283
+ setTimeout(() => {
284
+ setCopie(false)
285
+ }, 1600)
286
+ })
287
+ .catch(() => undefined)
288
+ }}
289
+ >
290
+ {copie ? 'Copie' : 'Copier'}
291
+ </button>
292
+ </div>
293
+
294
+ <a
295
+ href="https://odoro.dev/docs/registry"
296
+ target="_blank"
297
+ rel="noreferrer"
298
+ className="o-mt-6 o-inline-block o-text-sm o-text-zinc-500 dark:o-text-zinc-400 o-no-underline hover:o-text-brand-500"
299
+ >
300
+ Parcourir le catalogue
301
+ </a>
302
+ </Reveal>
303
+ </div>
304
+ </section>
305
+ )
306
+ }
307
+
308
+ /* -------------------------------------------------------------------------- */
309
+ /* Racine */
310
+ /* -------------------------------------------------------------------------- */
311
+
312
+ /** Racine de l'application. */
313
+ export function App(): ReactElement {
314
+ return (
315
+ <div className="app-shell">
316
+ <Barre />
36
317
  <main className="o-relative">
37
318
  <Fond />
38
319
  <Hero />
39
320
  <Piliers />
40
321
  <Cloture />
41
322
  </main>
42
-
43
323
  <footer className="o-border-t o-border-zinc-200 dark:o-border-zinc-800 o-px-6 o-py-8">
44
324
  <div className="o-mx-auto o-flex o-w-full o-max-w-5xl o-items-center o-justify-between o-gap-4 o-text-sm o-text-zinc-500 dark:o-text-zinc-400">
45
- <Marque />
325
+ <span className="o-inline-flex o-items-center o-gap-2">
326
+ <span className="o-text-brand-500">
327
+ <Signe taille="1.1rem" />
328
+ </span>
329
+ <span className="o-font-semibold o-tracking-wide">ODORO</span>
330
+ </span>
46
331
  <span>Construit avec Odoro.</span>
47
332
  </div>
48
333
  </footer>
@@ -1,4 +1,3 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
2
- <rect width="32" height="32" rx="8" fill="#5b62f4" />
3
- <circle cx="16" cy="16" r="7" fill="none" stroke="#fff" stroke-width="3" />
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" fill="none">
2
+ <path d="M20.25 20.25H50a29.75 29.75 0 1 1-29.75 29.75Z" stroke="#3b82f6" stroke-width="10.5" stroke-linejoin="miter"/>
4
3
  </svg>