@oneli8/react 1.0.0-beta.2 → 1.0.0-beta.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 (51) hide show
  1. package/AGENTS.md +12 -0
  2. package/PRINCIPLES.md +48 -0
  3. package/README.md +61 -75
  4. package/ai-context.json +146 -0
  5. package/package.json +30 -24
  6. package/skills/oneli8-figma-to-code/SKILL.md +25 -0
  7. package/skills/oneli8-icons/SKILL.md +24 -0
  8. package/skills/oneli8-ui/SKILL.md +24 -0
  9. package/src/atoms/Icon.js +31 -29
  10. package/src/atoms/SelectionIndicator.js +43 -0
  11. package/src/foundations/geometry.js +72 -0
  12. package/src/foundations/icons.generated.d.ts +38 -0
  13. package/src/foundations/icons.generated.js +406 -0
  14. package/src/index.d.ts +167 -4
  15. package/src/index.js +9 -4
  16. package/src/molecules/Button.js +47 -18
  17. package/src/molecules/ChoiceItem.js +55 -0
  18. package/src/molecules/IconButton.js +31 -16
  19. package/src/molecules/SelectionOption.js +41 -0
  20. package/src/organisms/ChoiceGroup.js +78 -0
  21. package/src/styles/button.css +195 -0
  22. package/src/styles/choice-group.css +95 -0
  23. package/src/styles/choice-item.css +192 -0
  24. package/src/styles/gem.css +173 -0
  25. package/src/styles/icon-button.css +224 -0
  26. package/src/styles/icon.css +56 -0
  27. package/src/styles/selection-indicator.css +153 -0
  28. package/src/styles/selection-option.css +123 -0
  29. package/styles.css +12 -6
  30. package/src/Button.d.ts +0 -20
  31. package/src/Button.js +0 -1
  32. package/src/Icon.d.ts +0 -4
  33. package/src/Icon.js +0 -1
  34. package/src/IconButton.d.ts +0 -20
  35. package/src/IconButton.js +0 -1
  36. package/src/Link.d.ts +0 -16
  37. package/src/Link.js +0 -1
  38. package/src/atoms/AnchorControl.js +0 -7
  39. package/src/atoms/BusyIndicator.js +0 -6
  40. package/src/atoms/ButtonControl.js +0 -14
  41. package/src/atoms/IconFrame.js +0 -19
  42. package/src/atoms/Label.js +0 -5
  43. package/src/foundations/collection.js +0 -13
  44. package/src/foundations/runtime.js +0 -44
  45. package/src/molecules/Link.js +0 -14
  46. package/styles/accessibility.css +0 -1
  47. package/styles/button.css +0 -176
  48. package/styles/gem-control-focus.css +0 -33
  49. package/styles/icon-button.css +0 -42
  50. package/styles/icon-frame.css +0 -1
  51. package/styles/link.css +0 -20
package/AGENTS.md ADDED
@@ -0,0 +1,12 @@
1
+ # OneLi8 public beta usage
2
+
3
+ Read README.md and PRINCIPLES.md first. Public React exports are limited to Icon,
4
+ iconNames, Button, IconButton and Link. Do not treat unused token families as
5
+ available components. Use skills/oneli8-ui/SKILL.md for composition,
6
+ skills/oneli8-icons/SKILL.md for icon work, and
7
+ skills/oneli8-figma-to-code/SKILL.md for mapping work.
8
+
9
+ Reuse canonical code and semantic tokens. Do not create consumer-local copies
10
+ of existing icons, component skins or state geometry. Ask the maintainer about
11
+ missing design decisions. This public beta does not enforce arbitrary downstream
12
+ code automatically and does not claim complete Figma parity.
package/PRINCIPLES.md ADDED
@@ -0,0 +1,48 @@
1
+ # OneLi8 principles
2
+
3
+ OneLi8 is intended for broad human benefit and conceived as service to Guruji
4
+ Shrii Arnav. His teachings inspire the project; implementation specifications
5
+ are OneLi8's own work. Service, clarity, harmony, proportion, restraint and
6
+ evolution guide its decisions.
7
+
8
+ ## Three distinct operating laws
9
+
10
+ 1. Atomic Design governs composition: atoms → molecules → organisms → templates
11
+ → pages. Icon plus label is a molecule, not a new atom. Private vector pieces
12
+ and layout wrappers need not become public components.
13
+ 2. OneLi8 Modularity governs ownership, reuse, semantic token dependencies,
14
+ optional-slot collapse and independent updates. Reuse an existing owner,
15
+ extend its API, or compose it before inventing another owner.
16
+ 3. Numerical atomicity governs the 3px construction rhythm and approved optical
17
+ exceptions, including the shared 1.8 icon stroke. Do not invent per-size strokes.
18
+
19
+ An optional sixth level, Spatial Experience, follows Page; it is not an extra
20
+ layer inside a button. Spatial ambition does not imply physical-device validation.
21
+
22
+ ## Materials and color
23
+
24
+ Gem Morphism is a transparent material skin, not a separate component anatomy.
25
+ Its four guiding qualities are Cut (bezel/edge), Color (semantic tint), Clarity
26
+ (legibility), and Carat/weight (appropriate visual presence). Facets are rare
27
+ accents, not mandatory decoration. Preserve near-white Gem content and test
28
+ contrast on the actual backdrop; do not promise automatic background sensing.
29
+
30
+ Regular and Gem reuse structure, measurements and behavior. Theme and primary
31
+ color are independent. Product colors consume semantic/component roles rather
32
+ than copied palette values. Use approved inward focus treatment without clipping
33
+ or changing a control's outer dimensions.
34
+
35
+ ## Structural space
36
+
37
+ Declare Fill, Hug or governed Fixed sizing. State surfaces share their owner's
38
+ boundary. Parent inset plus child inset is intentional, not accidental duplicated
39
+ padding. Removing an optional icon removes its gap. Preserve canonical spacing,
40
+ radius relationships, typography and icon pool rather than drawing lookalikes.
41
+
42
+ ## Evidence before claims
43
+
44
+ For new patterns, inspect Mobbin examples and relevant official interaction
45
+ guidance, then apply OneLi8's own identity. For repairs, approved decisions and
46
+ canonical owners come first. Record property, structural/token, visual and
47
+ runtime evidence separately. Changes require a Figma/code impact assessment;
48
+ no access or missing mapping means an explicit gap, not assumed synchronization.
package/README.md CHANGED
@@ -1,101 +1,87 @@
1
- # OneLi8 Design System
1
+ # @oneli8/react
2
2
 
3
- September 9, 2026 · Apache-2.0 · `1.0.0-beta.2`
4
-
5
- OneLi8 means One Light: a modular design system created by Akshay Dhore,
6
- inspired by Guruji Shrii Arnav and the 9×12 Way. This is a deliberately small
7
- public beta, not a completed SaaS suite or a claim of full Figma/code certification.
8
-
9
- ## Included
10
-
11
- - React `Icon`, `iconNames`, `Button`, `IconButton`, and `Link`.
12
- - Existing Regular and Gem button treatments, without redesigning their source.
13
- - Canonical editable tokens, CSS variables, JavaScript, and Tailwind adapters.
14
- - Three AI skills, design principles, and explicit Button/IconButton/Link property mappings.
15
-
16
- Other component families are not exported. The complete token vocabulary is
17
- retained so its reference graph stays intact; tokens for another family do not
18
- mean that family's component implementation is included. Internal shared helpers
19
- are implementation details, not additional public components.
20
-
21
- ## Install into an existing React project
22
-
23
- Requires Node 20+ and React 18+. React 18.3.1 is the tested version.
24
- Unzip this bundle, then use the two local archives in `tarballs/`:
3
+ OneLi8 Design System for React.
25
4
 
26
5
  ```sh
27
- npm install /absolute/path/to/tarballs/oneli8-tokens-1.0.0-beta.2.tgz /absolute/path/to/tarballs/oneli8-react-1.0.0-beta.2.tgz
6
+ npm install @oneli8/react
28
7
  ```
29
8
 
30
- These are local packages, not a claim that this version is on npm.
31
-
32
9
  ```jsx
33
- import {Button, IconButton, Icon, Link} from '@oneli8/react';
10
+ import { Button, Icon } from '@oneli8/react';
34
11
  import '@oneli8/react/styles.css';
35
12
 
36
13
  export function Actions() {
37
- return <div data-ol8-color-scheme="light" data-ol8-primary="blue">
38
- <Button leadingIcon={<Icon name="add" />}>Add item</Button>
39
- <IconButton accessibleName="Search" icon={<Icon name="search" />} />
40
- <Link href="/help">Help</Link>
41
- </div>;
14
+ return <Button variant="primary" leadingIcon="add">Add item</Button>;
42
15
  }
43
16
  ```
44
17
 
45
- This is a usage snippet, not an approved composed page. Use existing component
46
- properties and tokens when arranging your product. `material="gem"` is available
47
- on Button and IconButton, not Link. Test Gem content against its actual backdrop;
48
- near-white content alone cannot guarantee readable contrast.
18
+ ## What is included
49
19
 
50
- ## API and tokens
20
+ | Tier | Components |
21
+ |---|---|
22
+ | Atom | `Icon`, `SelectionIndicator` |
23
+ | Molecule | `Button`, `IconButton`, `ChoiceItem`, `SelectionOption` |
24
+ | Organism | `RadioGroup`, `CheckboxGroup` |
25
+ | Material | Gem, an attribute adapter rather than a tier |
51
26
 
52
- The declaration files in `packages/react/src/` describe the API. Button variants
53
- are primary/secondary/quiet/destructive; sizes are compact/standard/comfortable/large.
54
- IconButton supports rounded/circle and requires an accessible name. Icons are
55
- decorative; give meaning to their parent control. Do not pass an invented icon
56
- name: choose from `iconNames`. Buttons select their shared icon size internally.
27
+ ## The system travels with the package
57
28
 
58
- Read `packages/tokens/README.md` for theme attributes and Tailwind adapters.
59
- Change editable `packages/tokens/src/` values, then run:
29
+ If you need a component OneLi8 does not ship, build it from these foundations
30
+ rather than inventing a parallel system. Everything needed to do that is inside
31
+ the install:
60
32
 
61
- ```sh
62
- node packages/tokens/scripts/build.mjs --standalone
63
- node packages/tokens/scripts/test.mjs --standalone
33
+ | File | What it carries |
34
+ |---|---|
35
+ | `PRINCIPLES.md` | the design language and the three operating laws |
36
+ | `ai-context.json` | the atomic rules, the component inventory, and how to extend |
37
+ | `skills/oneli8-icons` | drawing a new glyph on the shared 1.8 stroke |
38
+ | `skills/oneli8-ui` | composing with existing owners |
39
+ | `skills/oneli8-figma-to-code` | reading the Figma source |
40
+ | `AGENTS.md` | where an agent should start |
41
+
42
+ The inventory in `ai-context.json` is generated from the source tree, so it can
43
+ never describe a component that is not there.
44
+
45
+ Point your agent at them:
46
+
47
+ ```
48
+ Read @oneli8/react/ai-context.json and PRINCIPLES.md before writing any OneLi8 UI.
64
49
  ```
65
50
 
66
- This regenerates token files, not Figma. Repack/reinstall the packages after edits.
67
- Token status records describe development maturity, not public beta certification.
51
+ ## Rules that matter most
52
+
53
+ Reach for a **semantic** token, never a primitive and never a literal.
54
+ `--ol8-color-actionprimary-default`, not `--ol8-color-blue-600` and not
55
+ `#2c438b`. Primitives are hidden from the Figma pickers for the same reason.
56
+
57
+ Every dimension sits on the **3px grid**. An exception needs an approval record.
68
58
 
69
- ## AI use and free Figma mapping
59
+ Icons come from the pool. `OL8_ICONS` is the whole set, an invented name throws.
60
+ A new glyph is a 24px neutral source on the shared **1.8 stroke**, never a
61
+ per-size stroke.
70
62
 
71
- Start with `AGENTS.md` and choose a task-specific skill in `skills/`. AI tools
72
- that do not discover skills can read those Markdown instructions explicitly.
73
- Skills guide agents; they do not force arbitrary AI tools to comply automatically.
63
+ Margins belong to the parent, never to the component.
74
64
 
75
- `mappings/` contains offline translators and dated canonical property tables.
76
- They accept inspected observations and return a component plan or explicit gaps.
77
- No Code Connect subscription, credentials, or network access is required to run
78
- them. They do not extract Figma automatically or certify visual parity. Copied
79
- Figma libraries can have different IDs: inspect and update mappings, never guess.
65
+ States are not classes. There is no `.ol8-btn--hover`; there is `:hover`,
66
+ `:active`, `:focus-visible`, `[disabled]` and `[data-ol8-loading]`.
80
67
 
81
- ## Validation and limits
68
+ ## Accessibility is enforced, not suggested
82
69
 
83
- See `BUILD-REPORT.json` and `SMOKE-REPORT.json` for this artifact's checks.
84
- `SOURCE-MANIFEST.json` records hashes of reused source files. The React source
85
- owners and CSS are copied unchanged; package entry points are scoped to this release.
70
+ `IconButton` throws without an `accessibleName`. `Button` throws for
71
+ `material="gem"` on Quiet or Destructive, because Figma approves Gem for Primary
72
+ and Secondary only. Errors rather than review comments, by design.
73
+
74
+ ## Theming
75
+
76
+ Two independent attributes, set on any ancestor:
77
+
78
+ ```html
79
+ <html data-ol8-color-scheme="dark" data-ol8-primary="orange">
80
+ ```
86
81
 
87
- Passing packaging, import, rendering, or mapping tests does not certify every
88
- browser state, screen-reader interaction, visual match, background, or XR device.
89
- Full-system synchronization remains incomplete. Report gaps rather than silently
90
- recreating components. This bundle has no backend, analytics, or credentials.
82
+ To change the brand colour beyond the three built families, or to swap the
83
+ typefaces, see `@oneli8/tokens/overrides.example.css`.
91
84
 
92
- ## Ownership and evolution
85
+ ## Licence
93
86
 
94
- Akshay Dhore is currently the sole creator and approver of canonical OneLi8
95
- components. Apache-2.0 permits reuse and forks; upstream design approval is separate.
96
- Feedback and proposals are welcome, but no contribution process or additional
97
- maintainer is implied. Future releases can add fixed families incrementally.
98
- See `PRINCIPLES.md`, `LICENSE` and `NOTICE`. Preserve applicable copyright and
99
- attribution notices when redistributing under Apache-2.0. This does not require
100
- a visible badge in your product or imply OneLi8 endorsement. Earlier MIT releases
101
- retain their original permissions. This license update changes no component designs.
87
+ Apache 2.0. Created by Akshay Dhore. See `LICENSE` and `NOTICE`.
@@ -0,0 +1,146 @@
1
+ {
2
+ "$comment": "GENERATED by packages/sync/src/build-package-context.mjs — do not edit.",
3
+ "system": "OneLi8",
4
+ "version": "1.0.0-beta.4",
5
+ "meaning": "OneLi8 means One Light.",
6
+ "foundations": {
7
+ "package": "@oneli8/tokens",
8
+ "css": "@oneli8/tokens/css",
9
+ "tokenPrefix": "--ol8-",
10
+ "namingAuthority": "Figma. Every variable carries an explicit codeSyntax, recorded verbatim in packages/tokens/src/figma-code-syntax.txt. Names are never derived from a rule.",
11
+ "rules": [
12
+ "Components consume SEMANTIC roles only. Primitives (color-<family>-<step>) are hidden from pickers in Figma and must not appear in component code.",
13
+ "color-primary-* is an alias ramp onto color-blue-* — identical values, distinct names. Prefer the semantic role over either.",
14
+ "Dimension scale is 3px-atomic. Even multiples for structural layout; odd multiples are deliberate optical or micro-gap choices.",
15
+ "Elevation ink is cyan-840 rgb(22,63,75) — never default black.",
16
+ "Typography roles are composite. Use the .ol8-type-<role> class, not the individual font vars.",
17
+ "shape-radius-full (999px) is reserved for pills and circles. Soft hexagons are component-specific recipes, not a radius token."
18
+ ]
19
+ },
20
+ "readFirst": [
21
+ "PRINCIPLES.md",
22
+ "AGENTS.md",
23
+ "skills/"
24
+ ],
25
+ "model": "React components. Same DOM and same stylesheets as @oneli8/core, verified identical.",
26
+ "architecture": {
27
+ "convention": "Atomic Design for developers (benjaminwfox.com/blog/tech/atomic-design-for-developers)",
28
+ "rules": [
29
+ "ATOM: composes no other component — native elements only. May hold internal state; must not read application state.",
30
+ "MOLECULE: composed of one or more atoms. Reusable, more specialised.",
31
+ "ORGANISM: composed of atoms/molecules/organisms. May hold business logic and application state.",
32
+ "MATERIALS are not an atomic tier. They are cross-cutting surface adapters applied by attribute (data-ol8-material) to an existing component, and live outside the hierarchy.",
33
+ "Assign margins to a component via its parent, NEVER to the component itself. Enforced by packages/sync/src/check-structure.mjs, which runs in npm run build."
34
+ ]
35
+ },
36
+ "components": [
37
+ {
38
+ "tier": "atom",
39
+ "module": "atoms/Icon.js",
40
+ "exports": [
41
+ "Icon"
42
+ ],
43
+ "constraint": "Composes no other component. Native elements only."
44
+ },
45
+ {
46
+ "tier": "atom",
47
+ "module": "atoms/SelectionIndicator.js",
48
+ "exports": [
49
+ "SelectionIndicator"
50
+ ],
51
+ "constraint": "Composes no other component. Native elements only."
52
+ },
53
+ {
54
+ "tier": "molecule",
55
+ "module": "molecules/Button.js",
56
+ "exports": [
57
+ "Button"
58
+ ],
59
+ "constraint": "Composed of atoms. Reusable and more specialised."
60
+ },
61
+ {
62
+ "tier": "molecule",
63
+ "module": "molecules/ChoiceItem.js",
64
+ "exports": [
65
+ "ChoiceItem"
66
+ ],
67
+ "constraint": "Composed of atoms. Reusable and more specialised."
68
+ },
69
+ {
70
+ "tier": "molecule",
71
+ "module": "molecules/IconButton.js",
72
+ "exports": [
73
+ "IconButton"
74
+ ],
75
+ "constraint": "Composed of atoms. Reusable and more specialised."
76
+ },
77
+ {
78
+ "tier": "molecule",
79
+ "module": "molecules/SelectionOption.js",
80
+ "exports": [
81
+ "SelectionOption"
82
+ ],
83
+ "constraint": "Composed of atoms. Reusable and more specialised."
84
+ },
85
+ {
86
+ "tier": "organism",
87
+ "module": "organisms/ChoiceGroup.js",
88
+ "exports": [
89
+ "RadioGroup",
90
+ "CheckboxGroup"
91
+ ],
92
+ "constraint": "Composed of atoms, molecules or organisms. May hold application state."
93
+ }
94
+ ],
95
+ "buildingWhatIsNotHere": {
96
+ "principle": "A component OneLi8 does not ship is still a OneLi8 component. Compose it from these foundations rather than inventing a parallel system.",
97
+ "steps": [
98
+ "Check the inventory below first. Do not rebuild something that exists.",
99
+ "Pick the tier by what it composes, not by how complex it feels.",
100
+ "Reach for a SEMANTIC token, never a primitive and never a literal. color-actionprimary-default, not color-blue-600 and not #2c438b.",
101
+ "Every dimension sits on the 3px grid. An exception needs an approval record, not a rounded number.",
102
+ "Icons come from the pool. To draw a new one follow skills/oneli8-icons: a 24px neutral source on the shared 1.8 stroke.",
103
+ "Give margins to the parent, never to the component.",
104
+ "States are not classes. Use :hover, :active, :focus-visible, [disabled] and data attributes.",
105
+ "Colour is currentColor on icons; the parent supplies the semantic role."
106
+ ],
107
+ "forbidden": [
108
+ "A literal colour, size or font value anywhere in a component.",
109
+ "A primitive token in a component. Primitives are hidden from the Figma pickers for the same reason.",
110
+ "An invented icon name. Choose from OL8_ICONS.",
111
+ "A per-size icon stroke. The 1.8 stroke is shared, and the 18px master is an exact 0.75 scale of the 24px one.",
112
+ "Mixing a filled treatment with an outlined one across selection controls. Checkbox and Radio share one language."
113
+ ]
114
+ },
115
+ "materials": {
116
+ "gem": {
117
+ "strategy": "attribute",
118
+ "emitAs": {
119
+ "data-ol8-material": "gem"
120
+ },
121
+ "note": "Gem is an attribute on an existing button, never a new class or variant. renderButton/renderIconButton throw for quiet and destructive.",
122
+ "appliesTo": {
123
+ "ol8-btn": [
124
+ "primary",
125
+ "secondary"
126
+ ],
127
+ "ol8-icon-btn": [
128
+ "primary",
129
+ "secondary"
130
+ ]
131
+ }
132
+ }
133
+ },
134
+ "pending": {
135
+ "Select and Combobox": {
136
+ "page": "1034:12628",
137
+ "remaining": {
138
+ "02 Selection Popup (organism)": "574:534, 6 variants — Width Content|Anchor|Wide x Size Standard|Large",
139
+ "03 Select Trigger": "583:338, 24 variants — Size x Appearance Outline|Filled x Condition",
140
+ "04 Choice Chip Foundation": "612:657 — Soft Hexagon 636:847 and Neutral 983:6552",
141
+ "05 Mobbin-informed Compositions": "603:281 (documentation)",
142
+ "06 Canonical Public Owners": "875:1399 (documentation)"
143
+ }
144
+ }
145
+ }
146
+ }
package/package.json CHANGED
@@ -1,39 +1,45 @@
1
1
  {
2
2
  "name": "@oneli8/react",
3
- "version": "1.0.0-beta.2",
4
- "type": "module",
3
+ "version": "1.0.0-beta.4",
4
+ "description": "OneLi8 Design System for React. Components, design tokens, the Gem material, and the design language they follow.",
5
+ "keywords": ["react", "design-system", "components", "design-tokens", "accessibility", "atomic-design", "oneli8"],
6
+ "homepage": "https://github.com/Akshay007ad/OneLi8-Design-System#readme",
7
+ "bugs": { "url": "https://github.com/Akshay007ad/OneLi8-Design-System/issues" },
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/Akshay007ad/OneLi8-Design-System.git",
11
+ "directory": "packages/react"
12
+ },
5
13
  "license": "Apache-2.0",
14
+ "author": "Akshay Dhore",
15
+ "type": "module",
16
+ "exports": {
17
+ ".": { "types": "./src/index.d.ts", "import": "./src/index.js", "default": "./src/index.js" },
18
+ "./styles.css": "./styles.css",
19
+ "./styles/*.css": "./src/styles/*.css",
20
+ "./ai-context.json": "./ai-context.json",
21
+ "./skills/*": "./skills/*",
22
+ "./package.json": "./package.json"
23
+ },
24
+ "types": "./src/index.d.ts",
25
+ "sideEffects": ["./styles.css", "**/*.css"],
6
26
  "files": [
7
27
  "src",
8
- "styles",
9
28
  "styles.css",
29
+ "ai-context.json",
30
+ "skills",
31
+ "PRINCIPLES.md",
32
+ "AGENTS.md",
10
33
  "README.md",
11
34
  "LICENSE",
12
35
  "NOTICE"
13
36
  ],
14
- "sideEffects": [
15
- "./styles.css",
16
- "./styles/*.css"
17
- ],
18
- "exports": {
19
- ".": {
20
- "types": "./src/index.d.ts",
21
- "import": "./src/index.js"
22
- },
23
- "./styles.css": "./styles.css",
24
- "./styles/accessibility.css": "./styles/accessibility.css",
25
- "./styles/icon-frame.css": "./styles/icon-frame.css",
26
- "./styles/button.css": "./styles/button.css",
27
- "./styles/icon-button.css": "./styles/icon-button.css",
28
- "./styles/gem-control-focus.css": "./styles/gem-control-focus.css",
29
- "./styles/link.css": "./styles/link.css"
37
+ "dependencies": {
38
+ "@oneli8/tokens": "1.0.0-beta.4"
30
39
  },
31
40
  "peerDependencies": {
32
41
  "react": ">=18"
33
42
  },
34
- "dependencies": {
35
- "@oneli8/tokens": "1.0.0-beta.2"
36
- },
37
- "publishConfig": {"access":"public","tag":"beta"},
38
- "repository": {"type":"git","url":"git+https://github.com/Akshay007ad/OneLi8-Design-System.git","directory":"packages/react"}
43
+ "engines": { "node": ">=20" },
44
+ "publishConfig": { "access": "public" }
39
45
  }
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: oneli8-figma-to-code
3
+ description: Translate inspected OneLi8 Button, IconButton and Link properties into canonical code without paid Code Connect.
4
+ ---
5
+
6
+ Locate the bundle; read README.md, PRINCIPLES.md and the matching JSON and module
7
+ in mappings/. These are property translators, not a Figma exporter. They need no
8
+ paid Code Connect service. They do not supply a consumer's Figma access.
9
+
10
+ Use an authorized connector, user-run read-only plugin, or manually supplied
11
+ observations to obtain owner identity, exact properties, nested icon identities
12
+ and token bindings. Never require enterprise Variables REST access. Screenshots
13
+ alone support provisional visual work, not structural certification.
14
+
15
+ Call mapButton, mapIconButton or mapLink with the shipped mapping and explicit
16
+ observations; use the function signature in its module. Block unknown properties
17
+ and missing identities. Copied libraries may change IDs: inspect rather than
18
+ silently guessing. Do not build replacement HTML from a screenshot when a public
19
+ owner exists. No component outside the public beta is supported by these adapters.
20
+
21
+ Preserve approved Figma and decisions. Code mapping does not authorize changing
22
+ Figma. Map focus/hover to real browser interactions, not invented public props.
23
+ Verify properties, structural/token ownership, matched visual states, and runtime
24
+ behavior separately. Record remaining gaps and observation dates. A mapped plan
25
+ or successful render is not full synchronization or accessibility certification.
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: oneli8-icons
3
+ description: Reuse or propose additions to the OneLi8 public beta neutral 24px icon pool with shared presentation and color.
4
+ ---
5
+
6
+ Locate the public beta bundle. Read PRINCIPLES.md, packages/react/src/atoms/Icon.js,
7
+ packages/react/src/atoms/IconFrame.js and packages/react/src/Icon.d.ts. These are
8
+ the actual drawing and presentation owners, not templates to copy into controls.
9
+
10
+ Search iconNames first. Existing meaning uses its existing identity. For a missing
11
+ meaning, propose one neutral 24×24 source definition in the pool and update the
12
+ IconName type; no size-, color-, Gem- or consumer-specific duplicate masters.
13
+ Follow adjacent approved geometry and the shared semantic stroke token. The
14
+ shipped outlined paths use non-scaling-stroke; filled dots have no outline.
15
+ Do not substitute historic proportional stroke rules or invent per-size values.
16
+
17
+ Color follows currentColor and the consumer's semantic state. Button and
18
+ IconButton already own their IconFrame sizing. A new icon is a candidate until
19
+ Akshay approves it; an AI-generated candidate is not automatically canonical.
20
+ This skill is guidance, not an autonomous icon-generation program.
21
+
22
+ Test multi-part paths, clipping and color at 9, 12, 24 and a large display size;
23
+ test swaps in light/dark and Regular/Gem. Compare Figma geometry/instance behavior
24
+ when authorized access exists. Record unavailable checks instead of claiming sync.
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: oneli8-ui
3
+ description: Compose UI using the OneLi8 public beta components and tokens without recreating canonical owners.
4
+ ---
5
+
6
+ Locate the extracted public beta bundle and read its README.md, PRINCIPLES.md and
7
+ packages/react/src/index.d.ts. If unavailable, obtain it rather than inventing
8
+ APIs. Paths here are relative to the bundle root.
9
+
10
+ Before composition, record the public component, icon identity, semantic color,
11
+ material, size and layout responsibility. Import from @oneli8/react; use generated
12
+ tokens rather than copied values. Reuse source atoms inside their existing
13
+ molecules. A new wrapper does not become a new atom merely because it is small.
14
+
15
+ Keep optional slots collapsible and parent/child insets intentional. Do not copy
16
+ private implementations into a product. For unsupported families, explicitly
17
+ separate consumer-owned work from canonical OneLi8; do not claim it is provided.
18
+ New canonical patterns need Mobbin visual research, official interaction guidance
19
+ and maintainer approval, not copied visual identity.
20
+
21
+ Check light/dark, Regular/Gem, focus, loading/disabled, accessible names and long
22
+ content where applicable. Do not claim screen-reader testing from HTML checks.
23
+ Record changed owners and the Figma/code impact; unavailable evidence stays open.
24
+ The public beta's smoke tests verify packaging, not downstream UI correctness.
package/src/atoms/Icon.js CHANGED
@@ -1,32 +1,34 @@
1
- import {createElement} from "react";
1
+ import { createElement } from 'react';
2
+ import { OL8_ICONS, OL8_ICON_VIEWBOX } from '../foundations/icons.generated.js';
3
+ import { isOl8IconName } from '../foundations/geometry.js';
2
4
 
3
- const definitions={
4
- "add":[["path",{d:"M12 5V19M5 12H19"}]],
5
- "forward":[["path",{d:"M3 12H21M15 18L21 12L15 6"}]],
6
- "critical":[["circle",{cx:12,cy:12,r:9}],["path",{d:"M9 9L15 15M15 9L9 15"}]],
7
- "visibility-open":[["path",{d:"M3 12C5.25 8.25 8.25 6.375 12 6.375C15.75 6.375 18.75 8.25 21 12C18.75 15.75 15.75 17.625 12 17.625C8.25 17.625 5.25 15.75 3 12Z"}],["circle",{cx:12,cy:12,r:2.625}]],
8
- "loading":[["path",{d:"M12 3C14.082 2.998 16.101 3.718 17.712 5.038C19.322 6.358 20.426 8.195 20.834 10.237C21.241 12.279 20.929 14.399 19.949 16.236C18.968 18.074 17.382 19.514 15.458 20.312C13.535 21.111 11.395 21.217 9.402 20.614C7.409 20.011 5.686 18.736 4.528 17.005C3.37 15.275 2.848 13.196 3.051 11.124C3.253 9.051 4.169 7.113 5.64 5.64"}]],
9
- "caution":[["circle",{cx:12,cy:12,r:9}],["path",{d:"M12 7V13"}],["circle",{cx:12,cy:16.6,r:1,fill:"currentColor",stroke:"none"}]],
10
- "positive":[["circle",{cx:12,cy:12,r:9}],["path",{d:"M7.6 12.2L10.6 15.2L16.6 9.2"}]],
11
- "informative":[["circle",{cx:12,cy:12,r:9}],["path",{d:"M12 11V16"}],["circle",{cx:12,cy:7.6,r:1,fill:"currentColor",stroke:"none"}]],
12
- "visibility-closed":[["path",{d:"M4.5 10.5C6.75 13.5 9.25 15 12 15C14.75 15 17.25 13.5 19.5 10.5M6.75 13.05L5.4 15M9.75 14.55L9.3 16.8M14.25 14.55L14.7 16.8M17.25 13.05L18.6 15"}]],
13
- "chevron-down":[["path",{d:"M5 8.5L12 15.5L19 8.5"}]],
14
- "chevron-up":[["path",{d:"M5 15.5L12 8.5L19 15.5"}]],
15
- "search":[["path",{d:"M15 15L20 20M10 3C6.134 3 3 6.134 3 10C3 13.866 6.134 17 10 17C13.866 17 17 13.866 17 10C17 6.134 13.866 3 10 3Z"}]],
16
- "clear":[["path",{d:"M5 5L19 19M19 5L5 19"}]],
17
- "close":[["path",{d:"M6 6L18 18M18 6L6 18"}]],
18
- "selection-check":[["path",{d:"M6.9 12.15L10.2 15.45L17.1 8.55"}]],
19
- "selection-mixed":[["path",{d:"M7.5 12H16.5"}]],
20
- "selection-dot":[["circle",{cx:12,cy:12,r:6,fill:"currentColor",stroke:"none"}]]
21
- };
22
-
23
- export const iconNames=Object.freeze(Object.keys(definitions));
5
+ /**
6
+ * Icons are decorative by default. Meaning belongs to the parent control, so an
7
+ * unnamed icon is hidden from assistive technology rather than announced as an
8
+ * unlabelled graphic. Colour is never set here: every stroke and fill is
9
+ * currentColor and the consuming component supplies the semantic role.
10
+ */
11
+ /** The bare <svg>, for slots that already carry the ol8-icon class. */
12
+ export function IconGlyph({ name }) {
13
+ if (!isOl8IconName(name)) throw new Error(`[ol8] unknown icon "${name}".`);
14
+ return createElement('svg', { viewBox: OL8_ICON_VIEWBOX, fill: 'none', focusable: 'false' },
15
+ OL8_ICONS[name].elements.map((el, i) => createElement(el.tag, { key: i, ...el.attrs })));
16
+ }
24
17
 
25
- export function Icon({name,className=""}){
26
- const definition=definitions[name];
27
- if(!definition)return null;
28
- return createElement("svg",{className:["ol8-Icon",className].filter(Boolean).join(" "),viewBox:"0 0 24 24",fill:"none",
29
- stroke:"currentColor",strokeWidth:"var(--ol8-component-icon-stroke)",strokeLinecap:"round",strokeLinejoin:"round",
30
- "data-ol8-icon":name,"aria-hidden":"true",focusable:"false"},
31
- ...definition.map(([element,props],index)=>createElement(element,{vectorEffect:props.stroke==="none"?undefined:"non-scaling-stroke",...props,key:index})));
18
+ export function Icon({ name, size = 24, label, className = '', ...rest }) {
19
+ if (!isOl8IconName(name)) {
20
+ throw new Error(`[ol8] unknown icon "${name}". Choose from OL8_ICONS rather than inventing a name.`);
21
+ }
22
+ const semantic = typeof label === 'string' && label.length > 0;
23
+ return createElement(
24
+ 'span',
25
+ {
26
+ ...rest,
27
+ className: `ol8-icon${className ? ` ${className}` : ''}`,
28
+ 'data-ol8-icon': name,
29
+ 'data-ol8-icon-size': size,
30
+ ...(semantic ? { role: 'img', 'aria-label': label } : { 'aria-hidden': 'true' }),
31
+ },
32
+ createElement(IconGlyph, { name })
33
+ );
32
34
  }
@@ -0,0 +1,43 @@
1
+ import { createElement } from 'react';
2
+ import { IconGlyph } from './Icon.js';
3
+ import { OL8_SELECTION_KINDS, OL8_SELECTION_STATES } from '../foundations/geometry.js';
4
+
5
+ /**
6
+ * Only the checked checkbox carries artwork. Mixed and selected are drawn by
7
+ * CSS from the token geometry, and an unset control has no mark at all.
8
+ */
9
+ function Mark({ kind, state, icon }) {
10
+ if (kind === 'checkbox') {
11
+ if (state === 'checked') return createElement('span', { className: 'ol8-selection__mark' }, createElement(IconGlyph, { name: 'check' }));
12
+ if (state === 'mixed') return createElement('span', { className: 'ol8-selection__mark' });
13
+ return null;
14
+ }
15
+ if (kind === 'radio') return state === 'selected' ? createElement('span', { className: 'ol8-selection__mark' }) : null;
16
+ return createElement('span', { className: 'ol8-selection__mark' },
17
+ icon ? createElement('span', { className: 'ol8-icon' }, createElement(IconGlyph, { name: icon })) : null);
18
+ }
19
+
20
+ /**
21
+ * ATOM. Purely presentational: it draws the mark a checkbox, radio or switch
22
+ * shows and owns no state, role or focus. The native input inside Choice Item
23
+ * owns all of that.
24
+ */
25
+ export function SelectionIndicator({ kind, selection, size = 'compact', disabled = false, icon, className = '', ...rest }) {
26
+ if (!OL8_SELECTION_KINDS.includes(kind)) throw new Error(`[ol8] unknown selection kind "${kind}"`);
27
+ const states = OL8_SELECTION_STATES[kind];
28
+ const state = selection ?? states[0];
29
+ if (!states.includes(state)) throw new Error(`[ol8] "${state}" is not a ${kind} selection state`);
30
+ if (icon && kind !== 'switch') throw new Error('[ol8] only the switch thumb carries optional artwork');
31
+ return createElement(
32
+ 'span',
33
+ {
34
+ ...rest,
35
+ className: `ol8-selection ol8-selection--${kind}${className ? ` ${className}` : ''}`,
36
+ 'data-ol8-size': size,
37
+ 'data-ol8-selection': state,
38
+ 'data-ol8-availability': disabled ? 'disabled' : 'enabled',
39
+ 'aria-hidden': 'true',
40
+ },
41
+ createElement(Mark, { kind, state, icon })
42
+ );
43
+ }