ui-foundations 0.6.0 → 0.7.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.
Files changed (35) hide show
  1. package/LICENSE +73 -0
  2. package/README.md +43 -8
  3. package/dist/macros/ui.njk +33 -0
  4. package/dist/main.css +230 -84
  5. package/dist/react/form.js +111 -0
  6. package/dist/react/index.js +1 -0
  7. package/dist/react/input.js +7 -0
  8. package/dist/react/textarea.js +7 -0
  9. package/dist/tokens/css/appearance-modes.tokens.mode-dark.css +7 -1
  10. package/dist/tokens/css/appearance-modes.tokens.mode-light.css +7 -1
  11. package/dist/tokens/css/components-ui.tokens.css +55 -33
  12. package/dist/tokens/css/core-primitives.tokens.css +1 -1
  13. package/dist/tokens/css/semantics-roles.tokens.css +1 -1
  14. package/dist/tokens/css/themes-brands.tokens.brand-a.css +1 -1
  15. package/dist/tokens/css/themes-brands.tokens.brand-b.css +1 -1
  16. package/dist/tokens/css/themes-brands.tokens.brand-c.css +1 -1
  17. package/dist/tokens/json/appearance-modes.tokens.mode-dark.json +24 -0
  18. package/dist/tokens/json/appearance-modes.tokens.mode-light.json +24 -0
  19. package/dist/tokens/json/components-ui.tokens.json +161 -25
  20. package/dist/tokens/tokens.yaml +509 -67
  21. package/dist/tokens/ts/appearance-modes.tokens.mode-dark.ts +7 -1
  22. package/dist/tokens/ts/appearance-modes.tokens.mode-light.ts +7 -1
  23. package/dist/tokens/ts/components-ui.tokens.ts +55 -33
  24. package/dist/tokens/ts/core-primitives.tokens.ts +1 -1
  25. package/dist/tokens/ts/semantics-roles.tokens.ts +1 -1
  26. package/dist/tokens/ts/themes-brands.tokens.brand-a.ts +1 -1
  27. package/dist/tokens/ts/themes-brands.tokens.brand-b.ts +1 -1
  28. package/dist/tokens/ts/themes-brands.tokens.brand-c.ts +1 -1
  29. package/dist/ui/index.css +1 -0
  30. package/dist/ui/patterns/button.css +3 -3
  31. package/dist/ui/patterns/checkbox.css +28 -28
  32. package/dist/ui/patterns/form.css +112 -0
  33. package/dist/ui/patterns/input.css +12 -12
  34. package/dist/ui/patterns/label.css +1 -1
  35. package/package.json +14 -3
package/LICENSE ADDED
@@ -0,0 +1,73 @@
1
+ # PolyForm Noncommercial License 1.0.0
2
+
3
+ <https://polyformproject.org/licenses/noncommercial/1.0.0>
4
+
5
+ Required Notice: Copyright Thomas Bielich (https://konsumkit.com)
6
+
7
+ ## Acceptance
8
+
9
+ In order to get any license under these terms, you must agree to them as both strict obligations and conditions to all your licenses.
10
+
11
+ ## Copyright License
12
+
13
+ The licensor grants you a copyright license for the software to do everything you might do with the software that would otherwise infringe the licensor's copyright in it for any permitted purpose. However, you may only distribute the software according to [Distribution License](#distribution-license) and make changes or new works based on the software according to [Changes and New Works License](#changes-and-new-works-license).
14
+
15
+ ## Distribution License
16
+
17
+ The licensor grants you an additional copyright license to distribute copies of the software. Your license to distribute covers distributing the software with changes and new works permitted by [Changes and New Works License](#changes-and-new-works-license).
18
+
19
+ ## Notices
20
+
21
+ You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms or the URL for them above, as well as copies of any plain-text lines beginning with `Required Notice:` that the licensor provided with the software.
22
+
23
+ ## Changes and New Works License
24
+
25
+ The licensor grants you an additional copyright license to make changes and new works based on the software for any permitted purpose.
26
+
27
+ ## Patent License
28
+
29
+ The licensor grants you a patent license for the software that covers patent claims the licensor can license, or becomes able to license, that you would infringe by using the software.
30
+
31
+ ## Noncommercial Purposes
32
+
33
+ Any noncommercial purpose is a permitted purpose.
34
+
35
+ ## Personal Uses
36
+
37
+ Personal use for research, experiment, and testing for the benefit of public knowledge, personal study, private entertainment, hobby projects, amateur pursuits, or religious observance, without any anticipated commercial application, is use for a permitted purpose.
38
+
39
+ ## Noncommercial Organizations
40
+
41
+ Use by any charitable organization, educational institution, public research organization, public safety or health organization, environmental protection organization, or government institution is use for a permitted purpose regardless of the source of funding or obligations resulting from the funding.
42
+
43
+ ## Fair Use
44
+
45
+ You may have "fair use" rights for the software under the law. These terms do not limit them.
46
+
47
+ ## No Other Rights
48
+
49
+ These terms do not allow you to sublicense or transfer any of your licenses to anyone else, or prevent the licensor from granting licenses to anyone else. These terms do not imply any other licenses.
50
+
51
+ ## Patent Defense
52
+
53
+ If you make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
54
+
55
+ ## Violations
56
+
57
+ The first time you are notified in writing that you have violated any of these terms, or done anything with the software not covered by your licenses, your licenses can nonetheless continue if you come into full compliance with these terms, and take practical steps to correct past violations, within 32 days of receiving notice. Otherwise, all your licenses end immediately.
58
+
59
+ ## No Liability
60
+
61
+ ***As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.***
62
+
63
+ ## Definitions
64
+
65
+ The **licensor** is the individual or entity offering these terms, and the **software** is the software the licensor makes available under these terms.
66
+
67
+ **You** refers to the individual or entity agreeing to these terms.
68
+
69
+ **Your company** is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. **Control** means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
70
+
71
+ **Your licenses** are all the licenses granted to you for the software under these terms.
72
+
73
+ **Use** means anything you do with the software requiring one of your licenses.
package/README.md CHANGED
@@ -68,8 +68,9 @@ Components reference only Semantic or Core. Never raw values.
68
68
  ### Component Integration
69
69
 
70
70
  Every component ships with:
71
- CSS pattern, React wrapper, Nunjucks macro, playground page, docs page,
72
- and Code Connect mapping.
71
+ CSS pattern, Nunjucks macro, playground page, docs page,
72
+ and Code Connect mapping. React wrappers are available as an optional
73
+ convenience layer but are not required — the CSS classes work in any framework.
73
74
 
74
75
  All surfaces must be present for the component to work predictably across
75
76
  docs, playgrounds, and consumer apps.
@@ -108,11 +109,29 @@ npm install ui-foundations
108
109
 
109
110
  ### Import
110
111
 
112
+ ```css
113
+ @import "ui-foundations/core.css";
114
+ @import "ui-foundations/ui.css";
115
+ ```
116
+
117
+ ### Use Components (plain HTML)
118
+
119
+ ```html
120
+ <button class="button">Label</button>
121
+ <button class="button outline">Outline</button>
122
+ <input class="input" type="text" />
123
+ ```
124
+
125
+ ### Optional: React Wrappers
126
+
111
127
  ```js
112
- import "ui-foundations/core.css";
113
- import "ui-foundations/ui.css";
128
+ import { Button } from "ui-foundations/react/button";
114
129
  ```
115
130
 
131
+ The React wrappers are thin convenience layers that apply CSS classes and
132
+ add dev-mode accessibility warnings. They contain no framework-specific
133
+ logic — the same result is achievable with plain HTML + CSS classes.
134
+
116
135
  ### Apply Theming
117
136
 
118
137
  ```js
@@ -129,9 +148,10 @@ to see it in action.
129
148
  ## Components
130
149
 
131
150
  Label, Button (solid / outline / ghost), ButtonGroup, Badge, Input, Icon, Checkbox,
132
- Radio, Switch, Link
151
+ Radio, Switch, Link, Divider, TextArea, Avatar, Accordion, Tabs, Tooltip
133
152
 
134
- Each component uses its own token layer and supports theming out of the box.
153
+ Each component uses semantic tokens (or its own token layer for complex variants)
154
+ and supports theming out of the box.
135
155
 
136
156
  ---
137
157
 
@@ -223,6 +243,15 @@ Figma integration uses the Model Context Protocol. Token exports live in
223
243
  - Validate before commit: `npm run ci:check`
224
244
  - Work on feature branches
225
245
 
246
+ ### Adding a New Component
247
+
248
+ Load the `#component-creation` steering file for the full 10-phase workflow.
249
+ Key steps: semantic HTML first, then Figma tokens (bind variables, never hardcode),
250
+ CSS pattern, Nunjucks macro, React wrapper, docs page, playground, Code Connect.
251
+
252
+ See `.kiro/steering/workflows/component-creation.md` for details and
253
+ `.kiro/steering/figma/figma-components.md` for Figma-specific rules.
254
+
226
255
  ---
227
256
 
228
257
  ## Release
@@ -237,8 +266,14 @@ npm run release:publish
237
266
 
238
267
  ## Tech Stack
239
268
 
240
- Vanilla CSS (Custom Properties, `@layer`) · Node.js · Eleventy · React (optional wrappers) · Nunjucks macros · Figma MCP
269
+ Vanilla CSS (Custom Properties, `@layer`) · Node.js · Eleventy · Nunjucks macros · Figma MCP · React (optional wrappers)
270
+
271
+ ---
272
+
273
+ ## Roadmap
274
+
275
+ - **Web Components** — replace React wrappers with framework-agnostic custom elements (light DOM, no shadow DOM) so the library is truly platform-independent.
241
276
 
242
277
  ---
243
278
 
244
- MIT License
279
+ PolyForm Noncommercial License 1.0.0
@@ -201,3 +201,36 @@
201
201
  {%- if className -%}{%- set classes = classes + " " + className -%}{%- endif -%}
202
202
  <span class="{{ classes }}">{{ caller() }}<span class="tooltip" role="tooltip" data-placement="{{ placement }}">{{ text }}</span></span>
203
203
  {%- endmacro %}
204
+
205
+ {% macro form(borderless=false, className='') -%}
206
+ {%- set classes = "form" -%}
207
+ {%- if borderless -%}{%- set classes = classes + " borderless" -%}{%- endif -%}
208
+ {%- if className -%}{%- set classes = classes + " " + className -%}{%- endif -%}
209
+ <form class="{{ classes }}" novalidate>{{ caller() }}</form>
210
+ {%- endmacro %}
211
+
212
+ {% macro formGroup(title='', className='') -%}
213
+ {%- set classes = "form-group" -%}
214
+ {%- if className -%}{%- set classes = classes + " " + className -%}{%- endif -%}
215
+ <fieldset class="{{ classes }}">
216
+ {%- if title %}<legend class="form-group__title">{{ title }}</legend>{% endif -%}
217
+ {{ caller() }}
218
+ </fieldset>
219
+ {%- endmacro %}
220
+
221
+ {% macro formField(labelPosition='top', invalid=false, className='') -%}
222
+ {%- set classes = "form-field" -%}
223
+ {%- if invalid -%}{%- set classes = classes + " is-invalid" -%}{%- endif -%}
224
+ {%- if className -%}{%- set classes = classes + " " + className -%}{%- endif -%}
225
+ <div class="{{ classes }}"{% if labelPosition == "side" %} data-label-position="side"{% endif %}>{{ caller() }}</div>
226
+ {%- endmacro %}
227
+
228
+ {% macro formHelper(text='') -%}
229
+ <p class="form-field__helper">{{ text }}</p>
230
+ {%- endmacro %}
231
+
232
+ {% macro formActions(align='end', className='') -%}
233
+ {%- set classes = "form-actions" -%}
234
+ {%- if className -%}{%- set classes = classes + " " + className -%}{%- endif -%}
235
+ <div class="{{ classes }}"{% if align != "end" %} data-align="{{ align }}"{% endif %}>{{ caller() }}</div>
236
+ {%- endmacro %}