@flipova/foundation 1.13.0 → 2.0.4

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 (260) hide show
  1. package/CHANGELOG.md +181 -0
  2. package/README.md +53 -178
  3. package/components/ui/accordion/ANIMATION_CUSTOMIZATION.md +162 -0
  4. package/components/ui/accordion/AccordionAnimatedHeight.tsx +56 -0
  5. package/components/ui/accordion/AccordionAnimatedIcon.tsx +41 -0
  6. package/components/ui/accordion/AnimatedHeight.tsx +56 -0
  7. package/components/ui/accordion/AnimatedIcon.tsx +41 -0
  8. package/components/ui/accordion/MIGRATION_SUMMARY.md +250 -0
  9. package/components/ui/accordion/USAGE_EXAMPLE.tsx +179 -0
  10. package/components/ui/accordion/animation-config.ts +32 -0
  11. package/components/ui/accordion/index.tsx +253 -0
  12. package/components/ui/actionsheet/index.tsx +511 -0
  13. package/components/ui/alert/index.tsx +158 -0
  14. package/components/ui/alert-dialog/index.tsx +254 -0
  15. package/components/ui/avatar/index.tsx +139 -0
  16. package/components/ui/badge/index.tsx +163 -0
  17. package/components/ui/bottomsheet/index.tsx +477 -0
  18. package/components/ui/box/index.tsx +19 -0
  19. package/components/ui/box/index.web.tsx +19 -0
  20. package/components/ui/box/styles.tsx +10 -0
  21. package/components/ui/button/index.tsx +264 -0
  22. package/components/ui/calendar/creator.tsx +366 -0
  23. package/components/ui/calendar/index.tsx +462 -0
  24. package/components/ui/calendar/styles.tsx +140 -0
  25. package/components/ui/card/index.tsx +23 -0
  26. package/components/ui/card/index.web.tsx +26 -0
  27. package/components/ui/card/styles.tsx +16 -0
  28. package/components/ui/center/index.tsx +22 -0
  29. package/components/ui/center/index.web.tsx +20 -0
  30. package/components/ui/center/styles.tsx +8 -0
  31. package/components/ui/checkbox/index.tsx +184 -0
  32. package/components/ui/date-time-picker/creator.tsx +109 -0
  33. package/components/ui/date-time-picker/index.tsx +585 -0
  34. package/components/ui/date-time-picker/index.web.tsx +217 -0
  35. package/components/ui/date-time-picker/styles.tsx +56 -0
  36. package/components/ui/divider/index.tsx +40 -0
  37. package/components/ui/drawer/index.tsx +362 -0
  38. package/components/ui/fab/index.tsx +215 -0
  39. package/components/ui/flat-list/index.tsx +21 -0
  40. package/components/ui/form-control/index.tsx +352 -0
  41. package/components/ui/gluestack-ui-provider/config.ts +72 -0
  42. package/components/ui/gluestack-ui-provider/index.tsx +47 -0
  43. package/components/ui/gluestack-ui-provider/index.web.tsx +96 -0
  44. package/components/ui/gluestack-ui-provider/script.ts +19 -0
  45. package/components/ui/gluestack-ui-provider/tokens.d.ts +17 -0
  46. package/components/ui/gluestack-ui-provider/tokens.js +188 -0
  47. package/components/ui/gluestack-ui-provider/useGluestackColors.ts +82 -0
  48. package/components/ui/grid/index.tsx +283 -0
  49. package/components/ui/grid/index.web.tsx +66 -0
  50. package/components/ui/grid/styles.tsx +15 -0
  51. package/components/ui/heading/index.tsx +220 -0
  52. package/components/ui/heading/index.web.tsx +202 -0
  53. package/components/ui/heading/styles.tsx +43 -0
  54. package/components/ui/hstack/index.tsx +27 -0
  55. package/components/ui/hstack/index.web.tsx +26 -0
  56. package/components/ui/hstack/styles.tsx +25 -0
  57. package/components/ui/icon/index.tsx +1588 -0
  58. package/components/ui/icon/index.web.tsx +1573 -0
  59. package/components/ui/image/index.tsx +48 -0
  60. package/components/ui/image-background/index.tsx +25 -0
  61. package/components/ui/image-viewer/index.tsx +743 -0
  62. package/components/ui/image-viewer/index.web.tsx +302 -0
  63. package/components/ui/index.ts +58 -0
  64. package/components/ui/input/index.tsx +125 -0
  65. package/components/ui/input-accessory-view/index.tsx +2 -0
  66. package/components/ui/keyboard-avoiding-view/index.tsx +2 -0
  67. package/components/ui/link/index.tsx +102 -0
  68. package/components/ui/liquid-glass/index.tsx +74 -0
  69. package/components/ui/menu/index.tsx +186 -0
  70. package/components/ui/modal/index.tsx +237 -0
  71. package/components/ui/popover/index.tsx +272 -0
  72. package/components/ui/portal/index.tsx +17 -0
  73. package/components/ui/pressable/index.tsx +39 -0
  74. package/components/ui/progress/index.tsx +83 -0
  75. package/components/ui/radio/index.tsx +217 -0
  76. package/components/ui/refresh-control/index.tsx +2 -0
  77. package/components/ui/safe-area-view/index.tsx +2 -0
  78. package/components/ui/scroll-view/index.tsx +2 -0
  79. package/components/ui/section-list/index.tsx +2 -0
  80. package/components/ui/select/index.tsx +277 -0
  81. package/components/ui/select/select-actionsheet.tsx +562 -0
  82. package/components/ui/skeleton/index.tsx +105 -0
  83. package/components/ui/skeleton/index.web.tsx +103 -0
  84. package/components/ui/skeleton/styles.tsx +35 -0
  85. package/components/ui/slider/index.tsx +181 -0
  86. package/components/ui/spinner/index.tsx +40 -0
  87. package/components/ui/status-bar/index.tsx +2 -0
  88. package/components/ui/switch/index.tsx +41 -0
  89. package/components/ui/table/index.tsx +210 -0
  90. package/components/ui/table/index.web.tsx +157 -0
  91. package/components/ui/table/styles.tsx +44 -0
  92. package/components/ui/tabs/TabsAnimatedIndicator.tsx +160 -0
  93. package/components/ui/tabs/animation-config.ts +3 -0
  94. package/components/ui/tabs/creator.tsx +206 -0
  95. package/components/ui/tabs/index.tsx +484 -0
  96. package/components/ui/text/index.tsx +48 -0
  97. package/components/ui/text/index.web.tsx +45 -0
  98. package/components/ui/text/styles.tsx +47 -0
  99. package/components/ui/textarea/index.tsx +94 -0
  100. package/components/ui/toast/index.tsx +252 -0
  101. package/components/ui/tooltip/index.tsx +131 -0
  102. package/components/ui/view/index.tsx +2 -0
  103. package/components/ui/virtualized-list/index.tsx +2 -0
  104. package/components/ui/vstack/index.tsx +28 -0
  105. package/components/ui/vstack/index.web.tsx +27 -0
  106. package/components/ui/vstack/styles.tsx +25 -0
  107. package/design/canonical.index.txt +53 -0
  108. package/design/documentation.xml +519 -0
  109. package/design/manifest.xml +90 -0
  110. package/design/schema.xsd +639 -0
  111. package/design/themes.xml +204 -0
  112. package/design/tokens.xml +510 -0
  113. package/design/tools/design.js +165 -0
  114. package/design/tools/npm.js +65 -0
  115. package/design/tools/requirements.txt +35 -0
  116. package/design/tools/sources/.checker/__init__.py +81 -0
  117. package/design/tools/sources/.checker/checks.py +198 -0
  118. package/design/tools/sources/.checker/cli.py +154 -0
  119. package/design/tools/sources/.checker/io.py +242 -0
  120. package/design/tools/sources/.checker/model.py +144 -0
  121. package/design/tools/sources/.checker/registry.py +115 -0
  122. package/design/tools/sources/.checker/report.py +21 -0
  123. package/design/tools/sources/.docgen/__init__.py +45 -0
  124. package/design/tools/sources/.docgen/cli.py +101 -0
  125. package/design/tools/sources/.docgen/model.py +147 -0
  126. package/design/tools/sources/.docgen/reference.py +97 -0
  127. package/design/tools/sources/.docgen/site.py +145 -0
  128. package/design/tools/sources/.docgen/xsddoc.py +329 -0
  129. package/design/tools/sources/.generate/__init__.py +35 -0
  130. package/design/tools/sources/.generate/cli.py +76 -0
  131. package/design/tools/sources/.generate/common.py +33 -0
  132. package/design/tools/sources/.generate/config.py +119 -0
  133. package/design/tools/sources/.generate/model.py +51 -0
  134. package/design/tools/sources/.generate/tokens.py +141 -0
  135. package/design/tools/sources/.linter/__init__.py +9 -0
  136. package/design/tools/sources/.linter/cli.py +44 -0
  137. package/design/tools/sources/.linter/discovery.py +30 -0
  138. package/design/tools/sources/.linter/errors.py +45 -0
  139. package/design/tools/sources/.linter/linter.py +68 -0
  140. package/design/tools/sources/.xmleditor/__init__.py +74 -0
  141. package/design/tools/sources/.xmleditor/blocks.py +185 -0
  142. package/design/tools/sources/.xmleditor/cli.py +141 -0
  143. package/design/tools/sources/.xmleditor/editor.py +906 -0
  144. package/design/tools/sources/.xmleditor/model.py +708 -0
  145. package/design/tools/sources/.xmleditor/widgets.py +1832 -0
  146. package/design/tools/sources/.xmleditor/xsdmodel.py +753 -0
  147. package/design/tools/sources/checker.py +55 -0
  148. package/design/tools/sources/docgen.py +66 -0
  149. package/design/tools/sources/generate.py +48 -0
  150. package/design/tools/sources/linter.py +54 -0
  151. package/design/tools/sources/ruff.toml +12 -0
  152. package/design/tools/sources/xmleditor.py +62 -0
  153. package/design/tools/unix/_venv_python.sh +16 -0
  154. package/design/tools/unix/check.sh +13 -0
  155. package/design/tools/unix/doc.sh +14 -0
  156. package/design/tools/unix/gen.sh +14 -0
  157. package/design/tools/unix/lint.sh +10 -0
  158. package/design/tools/unix/run.sh +20 -0
  159. package/design/tools/unix/verify.sh +12 -0
  160. package/design/tools/unix/xmledit.sh +12 -0
  161. package/design/tools/windows/check.cmd +12 -0
  162. package/design/tools/windows/doc.cmd +12 -0
  163. package/design/tools/windows/gen.cmd +11 -0
  164. package/design/tools/windows/lint.cmd +9 -0
  165. package/design/tools/windows/run.cmd +26 -0
  166. package/design/tools/windows/verify.cmd +10 -0
  167. package/design/tools/windows/xmledit.cmd +10 -0
  168. package/dist/chunk-LV4UIEQN.js +9730 -0
  169. package/dist/chunk-LV4UIEQN.js.map +1 -0
  170. package/dist/chunk-WNVU3BM2.mjs +9401 -0
  171. package/dist/chunk-WNVU3BM2.mjs.map +1 -0
  172. package/dist/index.d.mts +40 -9
  173. package/dist/index.d.ts +40 -9
  174. package/dist/index.js +726 -414
  175. package/dist/index.mjs +1 -5
  176. package/dist/ui/index.d.mts +6931 -3070
  177. package/dist/ui/index.d.ts +6931 -3070
  178. package/dist/ui/index.js +779 -352
  179. package/dist/ui/index.mjs +1 -2
  180. package/package.json +66 -142
  181. package/dist/chunk-2XORADW6.js +0 -24552
  182. package/dist/chunk-2XORADW6.js.map +0 -1
  183. package/dist/chunk-52BHHF5M.js +0 -46
  184. package/dist/chunk-52BHHF5M.js.map +0 -1
  185. package/dist/chunk-5647JY7Z.mjs +0 -100
  186. package/dist/chunk-5647JY7Z.mjs.map +0 -1
  187. package/dist/chunk-5N5HC4ZA.mjs +0 -3
  188. package/dist/chunk-5N5HC4ZA.mjs.map +0 -1
  189. package/dist/chunk-7QFZMGL6.js +0 -8583
  190. package/dist/chunk-7QFZMGL6.js.map +0 -1
  191. package/dist/chunk-ASZEP37D.js +0 -423
  192. package/dist/chunk-ASZEP37D.js.map +0 -1
  193. package/dist/chunk-BH5SU2JQ.mjs +0 -8282
  194. package/dist/chunk-BH5SU2JQ.mjs.map +0 -1
  195. package/dist/chunk-BO65GO53.mjs +0 -422
  196. package/dist/chunk-BO65GO53.mjs.map +0 -1
  197. package/dist/chunk-BSVXX52E.mjs +0 -413
  198. package/dist/chunk-BSVXX52E.mjs.map +0 -1
  199. package/dist/chunk-DNV5UBNF.mjs +0 -3
  200. package/dist/chunk-DNV5UBNF.mjs.map +0 -1
  201. package/dist/chunk-EDTAMUO2.js +0 -8310
  202. package/dist/chunk-EDTAMUO2.js.map +0 -1
  203. package/dist/chunk-IJTI6EX4.js +0 -4
  204. package/dist/chunk-IJTI6EX4.js.map +0 -1
  205. package/dist/chunk-M3YLASM2.js +0 -428
  206. package/dist/chunk-M3YLASM2.js.map +0 -1
  207. package/dist/chunk-OXKOGLXE.js +0 -4
  208. package/dist/chunk-OXKOGLXE.js.map +0 -1
  209. package/dist/chunk-RQXQK3ZO.mjs +0 -8486
  210. package/dist/chunk-RQXQK3ZO.mjs.map +0 -1
  211. package/dist/chunk-SR25V4EA.mjs +0 -40
  212. package/dist/chunk-SR25V4EA.mjs.map +0 -1
  213. package/dist/chunk-UB34WFEQ.js +0 -106
  214. package/dist/chunk-UB34WFEQ.js.map +0 -1
  215. package/dist/chunk-ZBRWXKDF.mjs +0 -24431
  216. package/dist/chunk-ZBRWXKDF.mjs.map +0 -1
  217. package/dist/cli/ds.d.mts +0 -1
  218. package/dist/cli/ds.d.ts +0 -1
  219. package/dist/cli/ds.js +0 -602
  220. package/dist/cli/ds.js.map +0 -1
  221. package/dist/cli/ds.mjs +0 -579
  222. package/dist/cli/ds.mjs.map +0 -1
  223. package/dist/cli/flipova.d.mts +0 -1
  224. package/dist/cli/flipova.d.ts +0 -1
  225. package/dist/cli/flipova.js +0 -161
  226. package/dist/cli/flipova.js.map +0 -1
  227. package/dist/cli/flipova.mjs +0 -154
  228. package/dist/cli/flipova.mjs.map +0 -1
  229. package/dist/config/index.d.mts +0 -123
  230. package/dist/config/index.d.ts +0 -123
  231. package/dist/config/index.js +0 -28
  232. package/dist/config/index.js.map +0 -1
  233. package/dist/config/index.mjs +0 -3
  234. package/dist/config/index.mjs.map +0 -1
  235. package/dist/index-CuaJA3gM.d.mts +0 -78
  236. package/dist/index-CuaJA3gM.d.ts +0 -78
  237. package/dist/registry/index.d.mts +0 -10160
  238. package/dist/registry/index.d.ts +0 -10160
  239. package/dist/registry/index.js +0 -392
  240. package/dist/registry/index.js.map +0 -1
  241. package/dist/registry/index.mjs +0 -3
  242. package/dist/registry/index.mjs.map +0 -1
  243. package/dist/theme/index.d.mts +0 -109
  244. package/dist/theme/index.d.ts +0 -109
  245. package/dist/theme/index.js +0 -28
  246. package/dist/theme/index.js.map +0 -1
  247. package/dist/theme/index.mjs +0 -3
  248. package/dist/theme/index.mjs.map +0 -1
  249. package/dist/tokens/index.d.mts +0 -423
  250. package/dist/tokens/index.d.ts +0 -423
  251. package/dist/tokens/index.js +0 -44
  252. package/dist/tokens/index.js.map +0 -1
  253. package/dist/tokens/index.mjs +0 -3
  254. package/dist/tokens/index.mjs.map +0 -1
  255. package/dist/types/index.d.mts +0 -202
  256. package/dist/types/index.d.ts +0 -202
  257. package/dist/types/index.js +0 -4
  258. package/dist/types/index.js.map +0 -1
  259. package/dist/types/index.mjs +0 -3
  260. package/dist/types/index.mjs.map +0 -1
@@ -0,0 +1,519 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ Flipova Foundation Documentation Tree
4
+ =====================================
5
+ Separated from manifest.xml: this file is the single source of truth for the
6
+ documentation site (sections + narrative Markdown articles). Consumed by
7
+ design/tools/sources/docgen.py and validated against schema.xsd (global
8
+ <documentation> element).
9
+ -->
10
+ <documentation xmlns="urn:flipova:foundation:registry"
11
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:flipova:foundation:registry schema.xsd">
12
+ <section id="getting-started" title="Getting Started" order="1">
13
+ <article id="installation" title="Installation" slug="getting-started/installation">
14
+ <content><![CDATA[
15
+ # Installation
16
+
17
+ Flipova Foundation ships an editable gluestack-ui component source plus **two
18
+ generated design artifacts**, both compiled from the design registries
19
+ (`design/tokens.xml` + `design/themes.xml`) and never edited by hand:
20
+
21
+ - `components/ui/gluestack-ui-provider/config.ts` - the gluestack/nativewind
22
+ colour variables, for the light and dark modes;
23
+ - `components/ui/gluestack-ui-provider/tokens.js` - the whole Tailwind theme.
24
+
25
+ ## Requirements
26
+
27
+ - **Python 3.8+** for the design tooling.
28
+ - **`lxml`** (and, for `design:check`, **`ruff`**) - the only third-party
29
+ dependencies, pinned in `design/tools/requirements.txt`.
30
+ - Your own Node/TypeScript tooling to consume the gluestack components.
31
+
32
+ ## Install and initialize
33
+
34
+ ```bash
35
+ npm install @flipova/foundation
36
+ npm install gluestack-ui
37
+ npx flipova-design init
38
+ ```
39
+
40
+ `npx flipova-design init` creates the project-local `design/` workspace and the
41
+ gluestack source tree.
42
+
43
+ ## Wire the theme into your Tailwind config
44
+
45
+ `tailwind.config.js`, `globals.css` and `postcss.config.js` are app-level files,
46
+ so the package does not ship them: create yours and pull the generated theme in.
47
+ The whole design system is one generated Tailwind theme, published as
48
+ `@flipova/foundation/tokens`.
49
+
50
+ ```js
51
+ // tailwind.config.js
52
+ const tokens = require('@flipova/foundation/tokens');
53
+
54
+ /** @type {import('tailwindcss').Config} */
55
+ module.exports = {
56
+ content: ['./app/**/*.{tsx,ts,jsx,js}'],
57
+ presets: [require('nativewind/preset')],
58
+ important: 'html',
59
+ theme: { extend: tokens.theme },
60
+ };
61
+ ```
62
+
63
+ ```css
64
+ /* globals.css */
65
+ @tailwind base;
66
+ @tailwind components;
67
+ @tailwind utilities;
68
+ ```
69
+
70
+ ```js
71
+ // postcss.config.js
72
+ module.exports = { plugins: { tailwindcss: {}, autoprefixer: {} } };
73
+ ```
74
+
75
+ Every registry value is then available as an utility: `bg-primary/50`, `p-4`,
76
+ `rounded-md`, `text-2xs`, `shadow-hard-1`, `z-modal`, `ease-standard`, and the
77
+ `xs:`/`md:`/`lg:`/`2xl:` breakpoints.
78
+
79
+ Mount the provider once at the root so the colour variables actually exist:
80
+
81
+ ```tsx
82
+ import { GluestackUIProvider } from '@flipova/foundation/ui';
83
+
84
+ export default function App() {
85
+ return <GluestackUIProvider mode="system">{/* ... */}</GluestackUIProvider>;
86
+ }
87
+ ```
88
+
89
+ ### Font variables
90
+
91
+ Some `family` entries delegate to *your* app fonts through CSS variables. Define
92
+ them once (or through your font loader):
93
+
94
+ ```css
95
+ :root {
96
+ --font-sans: Inter, system-ui, sans-serif;
97
+ --font-heading: Inter, system-ui, sans-serif;
98
+ }
99
+ ```
100
+
101
+ If one is missing, `font-family: var(--font-sans)` is invalid and the text falls
102
+ back to the inherited font - it does not break, but it is not what you expect.
103
+ `font-system`, `font-mono` and `font-serif` are self-contained stacks that need
104
+ no variable.
105
+
106
+ ## Optional virtual environment
107
+
108
+ ```bash
109
+ python3 -m venv design/tools/.venv
110
+ design/tools/.venv/bin/pip install -r design/tools/requirements.txt # Linux/macOS
111
+ design/tools/.venv/Scripts/python -m pip install -r design/tools/requirements.txt # Windows
112
+ ```
113
+
114
+ ## Verify the install
115
+
116
+ ```bash
117
+ npx flipova-design lint
118
+ ```
119
+
120
+ A clean clone reports zero errors. Continue with **Quick Start**.
121
+ ]]> </content>
122
+ </article>
123
+ <article id="quick-start" title="Quick Start" slug="getting-started/quick-start">
124
+ <content><![CDATA[
125
+ # Quick Start
126
+
127
+ The design pipeline does one job: it turns the **tokens** and **themes**
128
+ registries into the gluestack/nativewind theme config. Edit the XML, then
129
+ regenerate.
130
+
131
+ ```bash
132
+ # 1. XSD conformance of every XML under design/
133
+ npm run design:lint
134
+
135
+ # 2. Determinism rules + ruff lint of the toolchain
136
+ npm run design:check
137
+
138
+ # 3. Compile tokens/themes -> config.ts (colour vars) + tokens.js (Tailwind theme)
139
+ npm run design:gen
140
+
141
+ # 4. Verify the committed canonical index is in sync
142
+ npm run design:verify
143
+
144
+ # 5. Regenerate the documentation site (docs/generated)
145
+ npm run design:doc
146
+ ```
147
+
148
+ Or run the whole chain at once:
149
+
150
+ ```bash
151
+ npm run design:pipeline
152
+ ```
153
+
154
+ Commit the regenerated `config.ts`, `tokens.js`, `docs/generated/**` and
155
+ `design/canonical.index.txt` together with the XML change.
156
+ ]]> </content>
157
+ </article>
158
+ </section>
159
+ <section id="theming" title="Theming" order="2">
160
+ <article id="overview" title="Theming Overview" slug="theming/overview">
161
+ <content><![CDATA[
162
+ # Theming Overview
163
+
164
+ Theming is registry-driven and has two halves:
165
+
166
+ - **`design/tokens.xml`** - the atomic values (spacing, colours, typography,
167
+ shadows, animation). Colours live in the `color` token as shaded palette
168
+ entries (e.g. `primary.600`, `gray.200`).
169
+ - **`design/themes.xml`** - each theme (`light`, `dark`) maps **semantic roles**
170
+ to token references. The role ids are exactly the gluestack/nativewind CSS
171
+ variable names without the leading `--`, so `primary-foreground` becomes
172
+ `--primary-foreground`, `card-foreground` becomes `--card-foreground`, and so
173
+ on.
174
+
175
+ At generation time `generate.py` turns those two files into two artifacts:
176
+
177
+ - **`config.ts`** - every role resolved to a concrete colour and emitted as a
178
+ **space-separated RGB triplet** (the format nativewind/gluestack expect, e.g.
179
+ `37 99 235`), which enables Tailwind opacity modifiers such as `bg-primary/50`;
180
+ - **`tokens.js`** - the **entire** Tailwind theme, where each role also becomes a
181
+ `rgb(var(--<role>)/<alpha-value>)` colour, alongside every scale token
182
+ (spacing, radii, breakpoints, typography, shadow, z-index, opacity, motion).
183
+
184
+ `tailwind.config.js` therefore holds **no design value at all**: it only wires
185
+ `extend: tokens.theme`. The XML registries are the single source of truth for
186
+ both the runtime variables and every utility class - the registry and the theme
187
+ can never drift apart.
188
+
189
+ See **Tokens**, **Themes** and the generated **gluestack config** for details.
190
+ ]]> </content>
191
+ </article>
192
+ <article id="tokens" title="Tokens" slug="theming/tokens">
193
+ <content><![CDATA[
194
+ # Tokens
195
+
196
+ `design/tokens.xml` declares the atomic design values. Every token has a
197
+ `kind` (`scale`, `map`, `font`, `color`, `shadow`, `animation`) and a set of
198
+ `<value>` entries. Token ids are addressable from themes and styles with the
199
+ `$ref.tokens.<id>.<value-id>` syntax.
200
+
201
+ The listing below is generated directly from the registry - it is never
202
+ duplicated by hand.
203
+ ]]> </content>
204
+ </article>
205
+ <article id="themes" title="Themes" slug="theming/themes">
206
+ <content><![CDATA[
207
+ # Themes
208
+
209
+ `design/themes.xml` declares the themes (`default="light"`). Each theme holds a
210
+ `roleMap` of semantic roles to colour token references. A role id is the
211
+ gluestack CSS variable name without the leading `--`, so the registry and the
212
+ runtime config stay in lockstep.
213
+
214
+ The generated listing below reflects the current registry.
215
+ ]]> </content>
216
+ </article>
217
+ <article id="gluestack-config" title="gluestack config" slug="theming/gluestack-config">
218
+ <content><![CDATA[
219
+ # gluestack config
220
+
221
+ `npm run design:gen` compiles the registries into
222
+ `components/ui/gluestack-ui-provider/config.ts`:
223
+
224
+ ```ts
225
+ // Generated by design/tools/sources/generate.py -- do not edit by hand.
226
+ // Source of truth: design/tokens.xml + design/themes.xml
227
+ import { vars } from 'nativewind';
228
+
229
+ export const colors = {
230
+ light: {
231
+ '--background': '250 250 250',
232
+ '--primary': '37 99 235',
233
+ '--primary-foreground': '255 255 255',
234
+ // ...
235
+ },
236
+ dark: {
237
+ '--background': '24 24 27',
238
+ '--primary': '59 130 246',
239
+ '--primary-foreground': '255 255 255',
240
+ // ...
241
+ },
242
+ };
243
+
244
+ export const config = {
245
+ light: vars(colors.light),
246
+ dark: vars(colors.dark),
247
+ };
248
+ ```
249
+
250
+ The provider (`components/ui/gluestack-ui-provider`) applies `config[mode]`, and
251
+ `useGluestackColors()` converts each space-separated triplet back to hex when a
252
+ library needs a literal colour.
253
+
254
+ To change a colour: edit `design/themes.xml` (or the palette in
255
+ `design/tokens.xml`) and run `npm run design:gen`.
256
+
257
+ ## Design tokens
258
+
259
+ The second generated artifact is `components/ui/gluestack-ui-provider/tokens.js`.
260
+ It is the **entire** Tailwind theme: `tailwind.config.js` contains no design
261
+ value at all, it only does `extend: tokens.theme`. So the XML registries are the
262
+ single source of truth for the gluestack/nativewind theme.
263
+
264
+ In a consuming project, that same theme is published as
265
+ `@flipova/foundation/tokens` - see **Installation** for the three-line setup.
266
+
267
+ Two inputs feed it:
268
+
269
+ - **semantic colours**, one per `themes.xml` role, bound to the CSS variables
270
+ emitted in `config.ts` (this is what keeps `bg-primary/50` working);
271
+ - **scale tokens**, from `design/tokens.xml`.
272
+
273
+ ```js
274
+ module.exports = {
275
+ theme: {
276
+ colors: {
277
+ primary: 'rgb(var(--primary)/<alpha-value>)',
278
+ 'primary-foreground': 'rgb(var(--primary-foreground)/<alpha-value>)',
279
+ success: 'rgb(var(--success)/<alpha-value>)',
280
+ // ... one entry per themes.xml role
281
+ },
282
+ spacing: { '0': '0px', '1': '4px', '4': '16px' },
283
+ borderRadius: { 'sm': '4px', 'md': '8px', 'full': '9999px' },
284
+ screens: { 'xs': '480px', 'sm': '640px', 'md': '768px' },
285
+ fontFamily: {
286
+ system: ['system-ui', '-apple-system', 'sans-serif'],
287
+ body: ['var(--font-sans)'],
288
+ roboto: ['Roboto', 'sans-serif'],
289
+ },
290
+ fontSize: { 'xs': '12px', 'md': '16px' },
291
+ fontWeight: { 'normal': '400', 'bold': '700' },
292
+ lineHeight: { 'md': '24px', '5xl': '1' },
293
+ letterSpacing: { 'tight': '-0.025em' },
294
+ boxShadow: { 'md': '0px 3px 4px rgb(0 0 0 / 0.1)', 'soft-1': '...' },
295
+ zIndex: { 'modal': '2000', 'toast': '3000' },
296
+ opacity: { 'faint': '0.08', 'muted': '0.4' },
297
+ transitionDuration: { 'normal': '200ms' },
298
+ transitionTimingFunction: { 'standard': 'cubic-bezier(0.4, 0, 0.2, 1)' },
299
+ },
300
+ };
301
+ ```
302
+
303
+ Adding a semantic colour = adding a `<role>` in **every** theme of
304
+ `themes.xml`; adding a scale = adding a `<value>` in `design/tokens.xml`. Then
305
+ run `npm run design:gen` and every utility (`bg-success`, `p-4`, `rounded-md`,
306
+ `shadow-hard-1`, `z-modal`, `ease-standard`, ...) exists.
307
+
308
+ The raw `color` palette is deliberately not injected into Tailwind: it is
309
+ internal, and only the semantic colours are meaningful as utilities.
310
+ ]]> </content>
311
+ </article>
312
+ </section>
313
+ <section id="tools" title="CLI &amp; Tools" order="3">
314
+ <article id="overview" title="Tools Overview" slug="tools/overview">
315
+ <content><![CDATA[
316
+ # Tools Overview
317
+
318
+ The design toolchain is a handful of Python scripts under
319
+ `design/tools/sources/`, wired together only through `manifest.xml` and
320
+ `schema.xsd`:
321
+
322
+ | Tool | Role |
323
+ |---|---|
324
+ | `linter.py` | Validates **XSD conformance** of every XML file. 100% agnostic: it only knows "XML <-> XSD". |
325
+ | `checker.py` | Applies the **determinism rules** declared in `meta/determinism`; during `--check` it also lints `sources/` with `ruff`. |
326
+ | `generate.py` | Compiles `tokens.xml` + `themes.xml` into `config.ts` (colour variables) and `tokens.js` (the whole Tailwind theme). |
327
+ | `docgen.py` | Generates the documentation site under `docs/generated` from `documentation.xml`, `schema.xsd`, `tokens.xml` and `themes.xml`. |
328
+ | `xmleditor.py` | Visual, XSD-driven XML block editor (tkinter GUI + headless CLI) for the registry files. |
329
+
330
+ Folder layout:
331
+
332
+ ```
333
+ design/tools/
334
+ ├── sources/ Python scripts + their dot-packages (.checker, .docgen, .generate, .linter, .xmleditor)
335
+ ├── windows/ Windows wrappers (.cmd) - pin the venv interpreter
336
+ ├── unix/ Linux/macOS wrappers (.sh) - pin the venv interpreter
337
+ ├── design.js cross-platform Node entry point used by the npm scripts
338
+ ├── requirements.txt
339
+ ```
340
+
341
+ ### Editor schema resolution
342
+
343
+ XML-aware editors (VS Code Red Hat XML / LemMinX, …) resolve the registries
344
+ through the OASIS catalog in `.vscode/xml-catalog.xml`, registered in
345
+ `.vscode/settings.json` under `xml.catalogs`. It maps
346
+ `urn:flipova:foundation:registry` to `design/schema.xsd`, so validation never
347
+ depends on `xsi:schemaLocation` path resolution (which is what makes the
348
+ `schema_reference.4` / `cvc-elt.1.a` errors appear on Windows when a path is
349
+ mis-resolved).
350
+ ]]> </content>
351
+ </article>
352
+ <article id="commands" title="Commands" slug="tools/commands">
353
+ <content><![CDATA[
354
+ # Commands
355
+
356
+ All commands go through `design/tools/design.js` (or the `.cmd`/`.sh`
357
+ wrappers) and are exposed as npm scripts:
358
+
359
+ | npm script | Target | Runs |
360
+ |---|---|---|
361
+ | `npm run design:gen` | `gen` | `generate.py` - compile tokens/themes into `config.ts` + `tokens.js` |
362
+ | `npm run design:gen:check` | `gen --check` | verify regeneration is a no-op (drift check) |
363
+ | `npm run design:check` | `check` | determinism rules + XSD pass + ruff |
364
+ | `npm run design:verify` | `verify` | verify the committed canonical index |
365
+ | `npm run design:canonical` | `canonical` | re-emit `design/canonical.index.txt` |
366
+ | `npm run design:lint` | `lint` | XSD-validate every design XML |
367
+ | `npm run design:doc` | `doc` | regenerate `docs/generated` |
368
+ | `npm run design:edit` | `edit` | open the XML editor (GUI) |
369
+ | `npm run design:pipeline` | `pipeline` | `gen` + `check` + `verify` + `lint` + `doc` |
370
+
371
+ `generate.py` also supports `--check` directly, and `checker.py` supports
372
+ `--list-rules`, `--emit-canonical`, `--verify-canonical` and
373
+ `--sync-version`.
374
+ ]]> </content>
375
+ </article>
376
+ </section>
377
+ <section id="contributing" title="Contributing" order="4">
378
+ <article id="how-to-contribute" title="How to Contribute" slug="contributing/how-to-contribute">
379
+ <content><![CDATA[
380
+ # How to Contribute
381
+
382
+ **One command runs the whole cycle.**
383
+
384
+ ```bash
385
+ npm run flow
386
+ ```
387
+
388
+ It walks, in order: the issue, the release decision, the branch, the checks, the
389
+ commit, the push, the pull request, and the link back to the issue. It skips
390
+ whatever is already done, so running it before and after your changes is the
391
+ expected way to work.
392
+
393
+ You make four decisions. Everything else is generated:
394
+
395
+ | You decide | Flow asks for |
396
+ | --- | --- |
397
+ | what the issue is | a title and a template (`feature`, `bug`, `chore`, blank) |
398
+ | whether this is a release | `major`, `minor`, `patch`, or `none` |
399
+ | what the change says | one line, which becomes the changelog entry |
400
+ | the commit subject | one line |
401
+
402
+ The `Issues:` trailer, the `Closes #n` line, the branch, the version file and the
403
+ labels are all derived, never typed.
404
+
405
+ ## Designing in this repository
406
+
407
+ The registries are the single source of truth. Change the XML, and the generated
408
+ files follow.
409
+
410
+ ```
411
+ design/
412
+ |-- manifest.xml pipeline config + determinism rules
413
+ |-- schema.xsd the contract the linter validates
414
+ |-- tokens.xml tokens: spacing, colours, typography, shadows, motion
415
+ |-- themes.xml theme role maps (light, dark)
416
+ |-- documentation.xml this page's own source
417
+ |-- canonical.index.txt generated index of every entry
418
+ |-- tools/ Python toolchain (linter, checker, generate, docgen, xmleditor)
419
+
420
+ components/ui/gluestack-ui-provider/
421
+ |-- config.ts GENERATED: colour variables, light and dark
422
+ |-- tokens.js GENERATED: the whole Tailwind theme
423
+
424
+ docs/generated/ GENERATED: this site
425
+ tailwind.config.js only wires `extend: tokens.theme` - never a design value
426
+ ```
427
+
428
+ Where a change goes:
429
+
430
+ | You want to change | Edit |
431
+ | --- | --- |
432
+ | a palette value, a scale | `design/tokens.xml` |
433
+ | a semantic colour, a role | `design/themes.xml` |
434
+ | a determinism rule | `<determinism>` in `design/manifest.xml` |
435
+ | a documentation page | the `<article><content>` in `design/documentation.xml` |
436
+
437
+ Four rules the tooling cannot check for you:
438
+
439
+ 1. **Add a semantic colour to every theme** in `design/themes.xml`. A role that
440
+ exists in only one theme renders as a missing role in the other.
441
+ 2. **Never add a design value to `tailwind.config.js`.** Colours, scales, font
442
+ families, shadows and z-index belong in the registries.
443
+ 3. **Never hand-edit a generated file** (`config.ts`, `tokens.js`,
444
+ `docs/generated/**`). The next run overwrites it.
445
+ 4. **Commit the sources and the regenerated output together**, or `flow verify`
446
+ fails on drift.
447
+
448
+ ### A theming change, in one line
449
+
450
+ Add or edit a `<role>` in `design/themes.xml` whose `id` is the gluestack CSS
451
+ variable name without the `--` prefix, point it at a token, then
452
+ `npm run design:gen`. `tokens.js` - and therefore every Tailwind utility -
453
+ follows on its own.
454
+
455
+ ## The gate
456
+
457
+ ```bash
458
+ npm run flow verify
459
+ ```
460
+
461
+ Runs, in order: the changeset against its declaration, the generated files
462
+ against the registries, the registry validation, and the types. It is a gate and
463
+ not a formatter: nothing is rewritten, so a failure always means "look at this".
464
+
465
+ For the full regeneration, `npm run design:pipeline` (`gen`, `check`, `verify`,
466
+ `lint`, `doc`). If you touched a registry, `npm run design:canonical` and commit
467
+ `design/canonical.index.txt`.
468
+
469
+ ## Versioning
470
+
471
+ There is exactly **one** version in this repository: the root `package.json`,
472
+ the one that actually gets published. The registries store no copy of it:
473
+
474
+ - `npm run version:bump` (= `changeset version` **+** `flow release reset` **+**
475
+ `npm run design:doc`) bumps `package.json`, returns the release declaration to
476
+ `none`, and regenerates the documentation in one step. The release workflow
477
+ uses that command, so the version pull request can never be inconsistent.
478
+ - `design/manifest.xml` has **no** `<version>` element: the XSD would reject it,
479
+ so a second copy cannot be reintroduced by accident.
480
+
481
+ There is exactly one changeset too, `.changeset/release.md`, generated from
482
+ `.github/flow/release.yml`. Declare the bump with `npm run flow -- release`;
483
+ never edit the generated file and never add a second one.
484
+
485
+ ### The release path
486
+
487
+ ```
488
+ branch
489
+ |
490
+ v pull request (CI: typecheck, design gate, changeset required, flow state in sync)
491
+ main
492
+ |
493
+ v changesets opens/updates the "chore: version packages" pull request
494
+ "chore: version packages" <-- the only path that publishes
495
+ |
496
+ v merging it runs the release preflight, then publishes
497
+ npm
498
+ ```
499
+
500
+ The preflight refuses to publish unless a changesets commit produced the version
501
+ currently in `package.json`, so a release cannot happen by accident. A `hotfix`
502
+ dispatch with a mandatory reason is the only exception, and the quality gates
503
+ still run.
504
+ ]]> </content>
505
+ </article>
506
+ </section>
507
+ <section id="schema-reference" title="Schema Reference" order="5">
508
+ <article id="schema" title="Schema Reference" slug="schema-reference/schema">
509
+ <content><![CDATA[
510
+ # Schema Reference
511
+
512
+ Generated directly from `design/schema.xsd` - a schema change flows through
513
+ automatically, with no hand-maintained copy.
514
+ ]]> </content>
515
+ </article>
516
+ </section>
517
+ </documentation>
518
+
519
+
@@ -0,0 +1,90 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ Flipova Foundation Registry Manifest
4
+ -->
5
+ <foundationRegistry xmlns="urn:flipova:foundation:registry"
6
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:flipova:foundation:registry schema.xsd" schema="flipova.foundation/registry/1">
7
+ <meta>
8
+ <project>flipova foundation</project>
9
+ <license>MIT</license>
10
+ <language>en</language>
11
+ <registryRoot>design</registryRoot>
12
+ <pipeline>
13
+ <source>design/tokens.xml, design/themes.xml</source>
14
+ <outputs>
15
+ <gluestackConfig>components/ui/gluestack-ui-provider/config.ts</gluestackConfig>
16
+ <gluestackTokens>components/ui/gluestack-ui-provider/tokens.js</gluestackTokens>
17
+ </outputs>
18
+ </pipeline>
19
+ <determinism>
20
+ <rule id="ids.stable-slug" kind="ids" severity="error">
21
+ <description>explicit uid, otherwise stable slug: element id (deterministic)</description>
22
+ <applyTo>*.xml</applyTo>
23
+ <params>
24
+ <param name="pattern">^[A-Za-z][A-Za-z0-9-]*$</param>
25
+ <param name="selectors">token,theme,role,item,register</param>
26
+ </params>
27
+ </rule>
28
+ <rule id="ordering.canonical" kind="ordering" severity="error">
29
+ <description>canonical sort by (register, id)</description>
30
+ <params>
31
+ <param name="mode">registers</param>
32
+ <param name="by">(register, id)</param>
33
+ </params>
34
+ </rule>
35
+ <rule id="references.explicit" kind="references" severity="error">
36
+ <description>$ref.&lt;register&gt;.&lt;id&gt;.&lt;path&gt; (never implicit links)</description>
37
+ <applyTo>*.xml</applyTo>
38
+ <params>
39
+ <param name="pattern">^\$ref\.[a-z][a-z0-9]*\.[A-Za-z0-9_.-]+$</param>
40
+ <param name="dotted">true</param>
41
+ </params>
42
+ </rule>
43
+ <rule id="timestamps.forbidden" kind="timestamps" severity="error">
44
+ <description>timestamps forbidden</description>
45
+ <applyTo>*.xml</applyTo>
46
+ </rule>
47
+ <rule id="locale.values-only" kind="locale" severity="error">
48
+ <description>locale forbidden in values; allowed only in labels</description>
49
+ <applyTo>*.xml</applyTo>
50
+ <params>
51
+ <param name="exemptTags">label,description,content</param>
52
+ </params>
53
+ </rule>
54
+ <rule id="version.sync" kind="sync" severity="error">
55
+ <description>manifest &lt;version&gt; and @schema propagate to every root tag declaring them (fix: checker.py --sync-version)</description>
56
+ <applyTo>*.xml</applyTo>
57
+ </rule>
58
+ </determinism>
59
+ </meta>
60
+ <catalogs>
61
+ <catalog register="tokens">
62
+ <file>tokens.xml</file>
63
+ </catalog>
64
+ <catalog register="themes">
65
+ <file>themes.xml</file>
66
+ </catalog>
67
+ </catalogs>
68
+ <index>
69
+ <register name="tokens">
70
+ <item>spacing</item>
71
+ <item>radii</item>
72
+ <item>breakpoints</item>
73
+ <item>family</item>
74
+ <item>fontSizes</item>
75
+ <item>fontWeights</item>
76
+ <item>lineHeights</item>
77
+ <item>letterSpacings</item>
78
+ <item>color</item>
79
+ <item>shadow</item>
80
+ <item>zIndex</item>
81
+ <item>opacity</item>
82
+ <item>duration</item>
83
+ <item>easing</item>
84
+ </register>
85
+ <register name="themes">
86
+ <item>light</item>
87
+ <item>dark</item>
88
+ </register>
89
+ </index>
90
+ </foundationRegistry>