@xenosystem/elements 0.0.1

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 (223) hide show
  1. package/LICENSE +18 -0
  2. package/README.md +65 -0
  3. package/dist/elements/alert.d.ts +7 -0
  4. package/dist/elements/alert.js +20 -0
  5. package/dist/elements/app-window.d.ts +12 -0
  6. package/dist/elements/app-window.js +26 -0
  7. package/dist/elements/archive.d.ts +22 -0
  8. package/dist/elements/archive.js +40 -0
  9. package/dist/elements/arrow-left-right.d.ts +13 -0
  10. package/dist/elements/arrow-left-right.js +25 -0
  11. package/dist/elements/arrow-right.d.ts +7 -0
  12. package/dist/elements/arrow-right.js +18 -0
  13. package/dist/elements/arrow-up-right.d.ts +15 -0
  14. package/dist/elements/arrow-up-right.js +27 -0
  15. package/dist/elements/arrow-up.d.ts +7 -0
  16. package/dist/elements/arrow-up.js +18 -0
  17. package/dist/elements/attach.d.ts +7 -0
  18. package/dist/elements/attach.js +18 -0
  19. package/dist/elements/bell.d.ts +7 -0
  20. package/dist/elements/bell.js +19 -0
  21. package/dist/elements/bookmark.d.ts +14 -0
  22. package/dist/elements/bookmark.js +28 -0
  23. package/dist/elements/bot.d.ts +20 -0
  24. package/dist/elements/bot.js +35 -0
  25. package/dist/elements/brain-circuit.d.ts +24 -0
  26. package/dist/elements/brain-circuit.js +43 -0
  27. package/dist/elements/brain.d.ts +23 -0
  28. package/dist/elements/brain.js +38 -0
  29. package/dist/elements/briefcase.d.ts +14 -0
  30. package/dist/elements/briefcase.js +27 -0
  31. package/dist/elements/building.d.ts +15 -0
  32. package/dist/elements/building.js +34 -0
  33. package/dist/elements/calendar.d.ts +11 -0
  34. package/dist/elements/calendar.js +25 -0
  35. package/dist/elements/check-square.d.ts +13 -0
  36. package/dist/elements/check-square.js +25 -0
  37. package/dist/elements/check.d.ts +7 -0
  38. package/dist/elements/check.js +18 -0
  39. package/dist/elements/chevron-down.d.ts +7 -0
  40. package/dist/elements/chevron-down.js +18 -0
  41. package/dist/elements/chevron-right.d.ts +7 -0
  42. package/dist/elements/chevron-right.js +18 -0
  43. package/dist/elements/clock.d.ts +7 -0
  44. package/dist/elements/clock.js +19 -0
  45. package/dist/elements/code.d.ts +7 -0
  46. package/dist/elements/code.js +20 -0
  47. package/dist/elements/contrast.d.ts +22 -0
  48. package/dist/elements/contrast.js +41 -0
  49. package/dist/elements/copy.d.ts +7 -0
  50. package/dist/elements/copy.js +19 -0
  51. package/dist/elements/download.d.ts +7 -0
  52. package/dist/elements/download.js +21 -0
  53. package/dist/elements/edit.d.ts +7 -0
  54. package/dist/elements/edit.js +21 -0
  55. package/dist/elements/eye-off.d.ts +15 -0
  56. package/dist/elements/eye-off.js +28 -0
  57. package/dist/elements/eye.d.ts +7 -0
  58. package/dist/elements/eye.js +19 -0
  59. package/dist/elements/feather.d.ts +12 -0
  60. package/dist/elements/feather.js +25 -0
  61. package/dist/elements/file-clock.d.ts +20 -0
  62. package/dist/elements/file-clock.js +34 -0
  63. package/dist/elements/file-out.d.ts +13 -0
  64. package/dist/elements/file-out.js +27 -0
  65. package/dist/elements/file-x.d.ts +16 -0
  66. package/dist/elements/file-x.js +30 -0
  67. package/dist/elements/file.d.ts +7 -0
  68. package/dist/elements/file.js +23 -0
  69. package/dist/elements/filter.d.ts +7 -0
  70. package/dist/elements/filter.js +18 -0
  71. package/dist/elements/folder-up.d.ts +12 -0
  72. package/dist/elements/folder-up.js +25 -0
  73. package/dist/elements/folder.d.ts +7 -0
  74. package/dist/elements/folder.js +26 -0
  75. package/dist/elements/gear.d.ts +7 -0
  76. package/dist/elements/gear.js +20 -0
  77. package/dist/elements/globe.d.ts +7 -0
  78. package/dist/elements/globe.js +38 -0
  79. package/dist/elements/grid.d.ts +7 -0
  80. package/dist/elements/grid.js +21 -0
  81. package/dist/elements/hand.d.ts +13 -0
  82. package/dist/elements/hand.js +29 -0
  83. package/dist/elements/heart.d.ts +7 -0
  84. package/dist/elements/heart.js +20 -0
  85. package/dist/elements/help.d.ts +7 -0
  86. package/dist/elements/help.js +20 -0
  87. package/dist/elements/home.d.ts +7 -0
  88. package/dist/elements/home.js +21 -0
  89. package/dist/elements/image.d.ts +7 -0
  90. package/dist/elements/image.js +20 -0
  91. package/dist/elements/info.d.ts +7 -0
  92. package/dist/elements/info.js +20 -0
  93. package/dist/elements/layers.d.ts +7 -0
  94. package/dist/elements/layers.js +19 -0
  95. package/dist/elements/library.d.ts +15 -0
  96. package/dist/elements/library.js +28 -0
  97. package/dist/elements/lightbulb.d.ts +15 -0
  98. package/dist/elements/lightbulb.js +28 -0
  99. package/dist/elements/link.d.ts +7 -0
  100. package/dist/elements/link.js +20 -0
  101. package/dist/elements/list.d.ts +7 -0
  102. package/dist/elements/list.js +23 -0
  103. package/dist/elements/lock.d.ts +7 -0
  104. package/dist/elements/lock.js +21 -0
  105. package/dist/elements/maximize.d.ts +15 -0
  106. package/dist/elements/maximize.js +29 -0
  107. package/dist/elements/menu.d.ts +7 -0
  108. package/dist/elements/menu.js +20 -0
  109. package/dist/elements/message-plus.d.ts +12 -0
  110. package/dist/elements/message-plus.js +25 -0
  111. package/dist/elements/message-x.d.ts +12 -0
  112. package/dist/elements/message-x.js +25 -0
  113. package/dist/elements/message.d.ts +7 -0
  114. package/dist/elements/message.js +19 -0
  115. package/dist/elements/mic-off.d.ts +11 -0
  116. package/dist/elements/mic-off.js +25 -0
  117. package/dist/elements/mic.d.ts +7 -0
  118. package/dist/elements/mic.js +20 -0
  119. package/dist/elements/minimize.d.ts +13 -0
  120. package/dist/elements/minimize.js +27 -0
  121. package/dist/elements/minus.d.ts +7 -0
  122. package/dist/elements/minus.js +18 -0
  123. package/dist/elements/monitor.d.ts +12 -0
  124. package/dist/elements/monitor.js +25 -0
  125. package/dist/elements/more.d.ts +7 -0
  126. package/dist/elements/more.js +20 -0
  127. package/dist/elements/navigation.d.ts +11 -0
  128. package/dist/elements/navigation.js +22 -0
  129. package/dist/elements/next-dismiss.d.ts +30 -0
  130. package/dist/elements/next-dismiss.js +56 -0
  131. package/dist/elements/panel-left-close.d.ts +10 -0
  132. package/dist/elements/panel-left-close.js +24 -0
  133. package/dist/elements/panel-left.d.ts +13 -0
  134. package/dist/elements/panel-left.js +27 -0
  135. package/dist/elements/panel-right-close.d.ts +8 -0
  136. package/dist/elements/panel-right-close.js +21 -0
  137. package/dist/elements/panel-right.d.ts +11 -0
  138. package/dist/elements/panel-right.js +24 -0
  139. package/dist/elements/pause.d.ts +12 -0
  140. package/dist/elements/pause.js +24 -0
  141. package/dist/elements/play.d.ts +13 -0
  142. package/dist/elements/play.js +22 -0
  143. package/dist/elements/plus.d.ts +7 -0
  144. package/dist/elements/plus.js +19 -0
  145. package/dist/elements/quote.d.ts +15 -0
  146. package/dist/elements/quote.js +27 -0
  147. package/dist/elements/refresh.d.ts +7 -0
  148. package/dist/elements/refresh.js +21 -0
  149. package/dist/elements/save.d.ts +12 -0
  150. package/dist/elements/save.js +25 -0
  151. package/dist/elements/scan-eye.d.ts +16 -0
  152. package/dist/elements/scan-eye.js +32 -0
  153. package/dist/elements/search.d.ts +7 -0
  154. package/dist/elements/search.js +18 -0
  155. package/dist/elements/send.d.ts +7 -0
  156. package/dist/elements/send.js +19 -0
  157. package/dist/elements/shapes.d.ts +15 -0
  158. package/dist/elements/shapes.js +27 -0
  159. package/dist/elements/share.d.ts +7 -0
  160. package/dist/elements/share.js +21 -0
  161. package/dist/elements/sliders.d.ts +7 -0
  162. package/dist/elements/sliders.js +23 -0
  163. package/dist/elements/smile.d.ts +19 -0
  164. package/dist/elements/smile.js +33 -0
  165. package/dist/elements/sparkles.d.ts +21 -0
  166. package/dist/elements/sparkles.js +33 -0
  167. package/dist/elements/star.d.ts +14 -0
  168. package/dist/elements/star.js +28 -0
  169. package/dist/elements/stop.d.ts +12 -0
  170. package/dist/elements/stop.js +21 -0
  171. package/dist/elements/store.d.ts +12 -0
  172. package/dist/elements/store.js +25 -0
  173. package/dist/elements/sun.d.ts +7 -0
  174. package/dist/elements/sun.js +19 -0
  175. package/dist/elements/target.d.ts +22 -0
  176. package/dist/elements/target.js +35 -0
  177. package/dist/elements/terminal.d.ts +7 -0
  178. package/dist/elements/terminal.js +22 -0
  179. package/dist/elements/thumbs-down.d.ts +12 -0
  180. package/dist/elements/thumbs-down.js +24 -0
  181. package/dist/elements/thumbs-up.d.ts +21 -0
  182. package/dist/elements/thumbs-up.js +33 -0
  183. package/dist/elements/timer-off.d.ts +12 -0
  184. package/dist/elements/timer-off.js +31 -0
  185. package/dist/elements/trash.d.ts +7 -0
  186. package/dist/elements/trash.js +20 -0
  187. package/dist/elements/trending-up.d.ts +15 -0
  188. package/dist/elements/trending-up.js +27 -0
  189. package/dist/elements/upload.d.ts +7 -0
  190. package/dist/elements/upload.js +19 -0
  191. package/dist/elements/user-x.d.ts +16 -0
  192. package/dist/elements/user-x.js +30 -0
  193. package/dist/elements/user.d.ts +7 -0
  194. package/dist/elements/user.js +19 -0
  195. package/dist/elements/wand-sparkles.d.ts +21 -0
  196. package/dist/elements/wand-sparkles.js +34 -0
  197. package/dist/elements/waves.d.ts +11 -0
  198. package/dist/elements/waves.js +24 -0
  199. package/dist/elements/wrap-text.d.ts +12 -0
  200. package/dist/elements/wrap-text.js +25 -0
  201. package/dist/elements/x.d.ts +7 -0
  202. package/dist/elements/x.js +18 -0
  203. package/dist/elements/zap.d.ts +9 -0
  204. package/dist/elements/zap.js +20 -0
  205. package/dist/index.d.ts +14 -0
  206. package/dist/index.js +14 -0
  207. package/dist/schema.d.ts +240 -0
  208. package/dist/schema.js +101 -0
  209. package/dist/tokens/index.d.ts +17 -0
  210. package/dist/tokens/index.js +17 -0
  211. package/dist/tokens/interactive.d.ts +29 -0
  212. package/dist/tokens/interactive.js +26 -0
  213. package/dist/tokens/motion.d.ts +33 -0
  214. package/dist/tokens/motion.js +31 -0
  215. package/dist/tokens/radius.d.ts +22 -0
  216. package/dist/tokens/radius.js +21 -0
  217. package/dist/tokens/size.d.ts +98 -0
  218. package/dist/tokens/size.js +30 -0
  219. package/dist/tokens/status.d.ts +14 -0
  220. package/dist/tokens/status.js +13 -0
  221. package/dist/tokens/surfaces.d.ts +18 -0
  222. package/dist/tokens/surfaces.js +17 -0
  223. package/package.json +46 -0
@@ -0,0 +1,30 @@
1
+ /**
2
+ * `xeno.user-x` — a person, withdrawn. A degenerate element (pure geometry, no children).
3
+ *
4
+ * The same head and shoulders as `xeno.user`, with a cross set against the shoulder line. It exists
5
+ * because `user` alone cannot say it: the X IS the meaning — removed, excluded, not kept — and an icon
6
+ * that drops it says the opposite of what was intended.
7
+ *
8
+ * The shoulders are shortened on the right to make room, so the cross sits beside the figure rather
9
+ * than on top of it; two marks fighting for the same pixels read as neither.
10
+ *
11
+ * part[0] = head, part[1] = shoulders, part[2] and part[3] = the two strokes of the cross, kept apart
12
+ * so each can draw itself in turn.
13
+ */
14
+ export const UserX = {
15
+ id: 'xeno.user-x',
16
+ kind: 'icon',
17
+ contract: { viewBox: '0 0 24 24', weight: 'regular', strokeFamily: 'xeno-regular', axes: [], signals: [] },
18
+ geometry: {
19
+ base: [
20
+ { kind: 'rect', x: 5.5, y: 3.5, w: 8, h: 8, rx: 1.5 },
21
+ { kind: 'path', d: 'M2 20.5V18.5A2.5 2.5 0 0 1 4.5 16H14.5A2.5 2.5 0 0 1 17 18.5V20.5' },
22
+ { kind: 'path', d: 'M17.5 6.5l4.5 4.5' },
23
+ { kind: 'path', d: 'M22 6.5l-4.5 4.5' },
24
+ ],
25
+ },
26
+ bindings: [],
27
+ a11y: { role: 'img', label: 'Remove user' },
28
+ meta: { tags: ['temporary', 'remove', 'exclude'], since: '0.2.0' },
29
+ };
30
+ export default UserX;
@@ -0,0 +1,7 @@
1
+ import type { ElementDeclaration } from '../schema';
2
+ /**
3
+ * `xeno.user` — User. A degenerate element (pure geometry, no children).
4
+ * Imported from the foundry workbench; the declaration is the source of truth — edit here.
5
+ */
6
+ export declare const User: ElementDeclaration;
7
+ export default User;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * `xeno.user` — User. A degenerate element (pure geometry, no children).
3
+ * Imported from the foundry workbench; the declaration is the source of truth — edit here.
4
+ */
5
+ export const User = {
6
+ id: 'xeno.user',
7
+ kind: 'icon',
8
+ contract: { viewBox: '0 0 24 24', weight: 'regular', strokeFamily: 'xeno-regular', axes: [], signals: [] },
9
+ geometry: {
10
+ base: [
11
+ { kind: 'rect', x: 8, y: 3.5, w: 8, h: 8, rx: 1.5 },
12
+ { kind: 'path', d: 'M4.5 20.5V18.5A2.5 2.5 0 0 1 7 16H17A2.5 2.5 0 0 1 19.5 18.5V20.5' },
13
+ ],
14
+ },
15
+ bindings: [],
16
+ a11y: { role: 'img', label: 'User' },
17
+ meta: { tags: ['person', 'account', 'avatar'], since: '0.1.0' },
18
+ };
19
+ export default User;
@@ -0,0 +1,21 @@
1
+ import type { ElementDeclaration } from '../schema';
2
+ /**
3
+ * `xeno.wand-sparkles` — Rewrite. A degenerate element (pure geometry, no children).
4
+ *
5
+ * `sparkles`'s star, at the end of a stick. The family rule is the star: whatever it touches becomes the
6
+ * thing being made new, so the same shape that means "new" on its own means "made new BY this" once
7
+ * something is pointed at it.
8
+ *
9
+ * A wand is a hard thing to draw at this weight, because a single diagonal stroke is a slash and reads
10
+ * as a prohibition. The band across it is what fixes that — a stick with a joint is an object, and the
11
+ * joint is also where a hand would go. It sits at the lower third, so the wand has a handle and a
12
+ * length rather than a middle.
13
+ *
14
+ * The star floats OFF the tip rather than sitting on it. Touching, it would be a lollipop; a gap is what
15
+ * says the sparkle came out of the wand instead of being fixed to it — and it is what leaves the motion
16
+ * somewhere to happen.
17
+ *
18
+ * part[0] = shaft, part[1] = joint, part[2] = star.
19
+ */
20
+ export declare const WandSparkles: ElementDeclaration;
21
+ export default WandSparkles;
@@ -0,0 +1,34 @@
1
+ /**
2
+ * `xeno.wand-sparkles` — Rewrite. A degenerate element (pure geometry, no children).
3
+ *
4
+ * `sparkles`'s star, at the end of a stick. The family rule is the star: whatever it touches becomes the
5
+ * thing being made new, so the same shape that means "new" on its own means "made new BY this" once
6
+ * something is pointed at it.
7
+ *
8
+ * A wand is a hard thing to draw at this weight, because a single diagonal stroke is a slash and reads
9
+ * as a prohibition. The band across it is what fixes that — a stick with a joint is an object, and the
10
+ * joint is also where a hand would go. It sits at the lower third, so the wand has a handle and a
11
+ * length rather than a middle.
12
+ *
13
+ * The star floats OFF the tip rather than sitting on it. Touching, it would be a lollipop; a gap is what
14
+ * says the sparkle came out of the wand instead of being fixed to it — and it is what leaves the motion
15
+ * somewhere to happen.
16
+ *
17
+ * part[0] = shaft, part[1] = joint, part[2] = star.
18
+ */
19
+ export const WandSparkles = {
20
+ id: 'xeno.wand-sparkles',
21
+ kind: 'icon',
22
+ contract: { viewBox: '0 0 24 24', weight: 'regular', strokeFamily: 'xeno-regular', axes: [], signals: [] },
23
+ geometry: {
24
+ base: [
25
+ { kind: 'path', d: 'M3.8 20.2L14 10' },
26
+ { kind: 'path', d: 'M7 13.4L10.6 17' },
27
+ { kind: 'path', d: 'M18.2 3.2Q18.7 5.9 21.4 6.4Q18.7 6.9 18.2 9.6Q17.7 6.9 15 6.4Q17.7 5.9 18.2 3.2Z' },
28
+ ],
29
+ },
30
+ bindings: [],
31
+ a11y: { role: 'img', label: 'Rewrite' },
32
+ meta: { tags: ['wand', 'magic', 'rewrite', 'improve', 'ai'], since: '0.2.0' },
33
+ };
34
+ export default WandSparkles;
@@ -0,0 +1,11 @@
1
+ import type { ElementDeclaration } from '../schema';
2
+ /**
3
+ * `xeno.waves` - Waves. A degenerate element (pure geometry, no children).
4
+ *
5
+ * Three identical waves, stacked and offset by nothing - identical on purpose, so the motion can offset
6
+ * them instead. A glyph that was already staggered at rest would have nowhere left to go.
7
+ *
8
+ * part[0..2] = top, middle, bottom.
9
+ */
10
+ export declare const Waves: ElementDeclaration;
11
+ export default Waves;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * `xeno.waves` - Waves. A degenerate element (pure geometry, no children).
3
+ *
4
+ * Three identical waves, stacked and offset by nothing - identical on purpose, so the motion can offset
5
+ * them instead. A glyph that was already staggered at rest would have nowhere left to go.
6
+ *
7
+ * part[0..2] = top, middle, bottom.
8
+ */
9
+ export const Waves = {
10
+ id: 'xeno.waves',
11
+ kind: 'icon',
12
+ contract: { viewBox: '0 0 24 24', weight: 'regular', strokeFamily: 'xeno-regular', axes: [], signals: [] },
13
+ geometry: {
14
+ base: [
15
+ { kind: 'path', d: 'M2.6 7.4c1.6-1.9 3.2-1.9 4.7 0 1.6 1.9 3.2 1.9 4.7 0 1.6-1.9 3.2-1.9 4.7 0 1.6 1.9 3.2 1.9 4.7 0' },
16
+ { kind: 'path', d: 'M2.6 12c1.6-1.9 3.2-1.9 4.7 0 1.6 1.9 3.2 1.9 4.7 0 1.6-1.9 3.2-1.9 4.7 0 1.6 1.9 3.2 1.9 4.7 0' },
17
+ { kind: 'path', d: 'M2.6 16.6c1.6-1.9 3.2-1.9 4.7 0 1.6 1.9 3.2 1.9 4.7 0 1.6-1.9 3.2-1.9 4.7 0 1.6 1.9 3.2 1.9 4.7 0' },
18
+ ],
19
+ },
20
+ bindings: [],
21
+ a11y: { role: 'img', label: 'Waves' },
22
+ meta: { tags: ['audio', 'signal', 'flow', 'water'], since: '0.2.0' },
23
+ };
24
+ export default Waves;
@@ -0,0 +1,12 @@
1
+ import type { ElementDeclaration } from '../schema';
2
+ /**
3
+ * `xeno.wrap-text` - Wrap lines. A degenerate element (pure geometry, no children).
4
+ *
5
+ * Three rules, the middle one running into a hook that turns back and points left: the line that ran out
6
+ * of room and came round. `list`'s rules are the reference for the spacing, so a wrapping paragraph and
7
+ * a list line up when they sit next to each other in a toolbar.
8
+ *
9
+ * part[0] = the three rules, part[1] = the hook, part[2] = its head.
10
+ */
11
+ export declare const WrapText: ElementDeclaration;
12
+ export default WrapText;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * `xeno.wrap-text` - Wrap lines. A degenerate element (pure geometry, no children).
3
+ *
4
+ * Three rules, the middle one running into a hook that turns back and points left: the line that ran out
5
+ * of room and came round. `list`'s rules are the reference for the spacing, so a wrapping paragraph and
6
+ * a list line up when they sit next to each other in a toolbar.
7
+ *
8
+ * part[0] = the three rules, part[1] = the hook, part[2] = its head.
9
+ */
10
+ export const WrapText = {
11
+ id: 'xeno.wrap-text',
12
+ kind: 'icon',
13
+ contract: { viewBox: '0 0 24 24', weight: 'regular', strokeFamily: 'xeno-regular', axes: [], signals: [] },
14
+ geometry: {
15
+ base: [
16
+ { kind: 'path', d: 'M4 6.5h16M4 12h11M4 17.5h5.4' },
17
+ { kind: 'path', d: 'M15 12h2.6A2.6 2.6 0 0 1 20.2 14.6 2.6 2.6 0 0 1 17.6 17.2h-5.4' },
18
+ { kind: 'path', d: 'M14 15.4 12.2 17.2 14 19' },
19
+ ],
20
+ },
21
+ bindings: [],
22
+ a11y: { role: 'img', label: 'Wrap lines' },
23
+ meta: { tags: ['wrap', 'text', 'lines'], since: '0.2.0' },
24
+ };
25
+ export default WrapText;
@@ -0,0 +1,7 @@
1
+ import type { ElementDeclaration } from '../schema';
2
+ /**
3
+ * `xeno.x` — Close. A degenerate element (pure geometry, no children).
4
+ * Imported from the foundry workbench; the declaration is the source of truth — edit here.
5
+ */
6
+ export declare const X: ElementDeclaration;
7
+ export default X;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * `xeno.x` — Close. A degenerate element (pure geometry, no children).
3
+ * Imported from the foundry workbench; the declaration is the source of truth — edit here.
4
+ */
5
+ export const X = {
6
+ id: 'xeno.x',
7
+ kind: 'icon',
8
+ contract: { viewBox: '0 0 24 24', weight: 'regular', strokeFamily: 'xeno-regular', axes: [], signals: [] },
9
+ geometry: {
10
+ base: [
11
+ { kind: 'path', d: 'M6.5 6.5l11 11M17.5 6.5l-11 11' },
12
+ ],
13
+ },
14
+ bindings: [],
15
+ a11y: { role: 'img', label: 'Close' },
16
+ meta: { tags: ['cancel', 'dismiss', 'cross'], since: '0.1.0' },
17
+ };
18
+ export default X;
@@ -0,0 +1,9 @@
1
+ import type { ElementDeclaration } from '../schema';
2
+ /**
3
+ * `xeno.zap` - Fast. A degenerate element (pure geometry, no children).
4
+ *
5
+ * A bolt: the one glyph in the set with no right angle in it. That is what it is for - everything else
6
+ * here is built from a square, so the shape meaning "sudden" is the one that refuses the grid.
7
+ */
8
+ export declare const Zap: ElementDeclaration;
9
+ export default Zap;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * `xeno.zap` - Fast. A degenerate element (pure geometry, no children).
3
+ *
4
+ * A bolt: the one glyph in the set with no right angle in it. That is what it is for - everything else
5
+ * here is built from a square, so the shape meaning "sudden" is the one that refuses the grid.
6
+ */
7
+ export const Zap = {
8
+ id: 'xeno.zap',
9
+ kind: 'icon',
10
+ contract: { viewBox: '0 0 24 24', weight: 'regular', strokeFamily: 'xeno-regular', axes: [], signals: [] },
11
+ geometry: {
12
+ base: [
13
+ { kind: 'path', d: 'M13.4 2.8 5.2 13.4h5.6L10.6 21.2 18.8 10.6h-5.6z' },
14
+ ],
15
+ },
16
+ bindings: [],
17
+ a11y: { role: 'img', label: 'Fast' },
18
+ meta: { tags: ['bolt', 'fast', 'power', 'instant'], since: '0.2.0' },
19
+ };
20
+ export default Zap;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * `@xenosystem/elements` — the XENO element contract.
3
+ *
4
+ * The source of truth every renderer interprets. Zero dependencies, zero framework, zero
5
+ * platform: this package is a contract, not a component library.
6
+ *
7
+ * NOTE ON BARRELS: this index re-exports the *schema* (types and one pure function), which is
8
+ * small and tree-shakes cleanly. Element DECLARATIONS must never be barrelled — a single index
9
+ * importing every element is exactly why `lucide-react` weighs 2.4 MB. Declarations get
10
+ * per-element entry points when they land.
11
+ *
12
+ * @module
13
+ */
14
+ export * from './schema.js';
package/dist/index.js ADDED
@@ -0,0 +1,14 @@
1
+ /**
2
+ * `@xenosystem/elements` — the XENO element contract.
3
+ *
4
+ * The source of truth every renderer interprets. Zero dependencies, zero framework, zero
5
+ * platform: this package is a contract, not a component library.
6
+ *
7
+ * NOTE ON BARRELS: this index re-exports the *schema* (types and one pure function), which is
8
+ * small and tree-shakes cleanly. Element DECLARATIONS must never be barrelled — a single index
9
+ * importing every element is exactly why `lucide-react` weighs 2.4 MB. Declarations get
10
+ * per-element entry points when they land.
11
+ *
12
+ * @module
13
+ */
14
+ export * from './schema.js';
@@ -0,0 +1,240 @@
1
+ /**
2
+ * The XENO element contract.
3
+ *
4
+ * This file is the whole point of the repository. Everything else — every renderer on every
5
+ * platform, every product that consumes an element, every agent that drives one — is an
6
+ * interpretation of what is declared here.
7
+ *
8
+ * ## Two properties to preserve above all others
9
+ *
10
+ * **1. There is no "icon" type.** An icon is the degenerate {@link ElementDeclaration}: no
11
+ * children, pure geometry. A button is the compound one: geometry plus a slot plus behaviour.
12
+ * They share one schema and one release path, which is what makes "edit one icon" and "edit one
13
+ * button" the identical operation. A refactor that gives icons their own type has thrown away
14
+ * the reason this repo exists.
15
+ *
16
+ * **2. A declaration contains DATA, never code.** No functions, no expressions, no executable
17
+ * animation — {@link Binding} is a description that a renderer interprets. This is an
18
+ * architectural boundary with a legal edge: Apple permits downloading and running *interpreted*
19
+ * content (the React Native shape, where JavaScript only calls into natives audited at
20
+ * submission time), and 2026 enforcement fell on apps that generate and execute code to alter
21
+ * their own behaviour. Data interpreted by a pre-reviewed renderer is inside the line. Shipping
22
+ * animation functions would not be. See `docs/STATE-MODEL.md` §4.1.
23
+ *
24
+ * @module
25
+ */
26
+ /** Can this element be used at all? Persists. */
27
+ export type Availability = 'enabled' | 'disabled' | 'busy';
28
+ /**
29
+ * Is it on? **Semantic and persistent** — it outlives the gesture that set it.
30
+ *
31
+ * The axis most systems forget, and the most common animated-element case in real products:
32
+ * the bookmark, the like, the mute, the pin. `mixed` serves tri-state controls (a parent
33
+ * checkbox over partially-selected children).
34
+ */
35
+ export type Selection = 'off' | 'on' | 'mixed';
36
+ /**
37
+ * What is the user doing right now? **Transient** — exists only while input is present.
38
+ *
39
+ * `engaged` is NOT "hover". It means hover on pointer devices and *nothing at all* on touch.
40
+ * Naming it `hover` would bake a desktop assumption into a system that has to run on phones.
41
+ */
42
+ export type Interaction = 'idle' | 'engaged' | 'pressed';
43
+ /** The complete discrete state of an element. Every axis always has a value; there is no "unset". */
44
+ export interface ElementState {
45
+ readonly availability: Availability;
46
+ readonly selection: Selection;
47
+ readonly interaction: Interaction;
48
+ }
49
+ export declare const DEFAULT_STATE: ElementState;
50
+ /** The axis names an element can declare that it honours. */
51
+ export type AxisName = keyof ElementState;
52
+ export type SignalName =
53
+ /** 0…1, determinate. Gesture scrub, drag, pull-to-refresh, swipe-to-reveal, upload. */
54
+ 'progress'
55
+ /** Indeterminate. Spinner-class — work with no known endpoint. Visually a loop, not a fraction. */
56
+ | 'activity';
57
+ export interface SignalValues {
58
+ readonly progress?: number;
59
+ readonly activity?: boolean;
60
+ }
61
+ export type TransitionName =
62
+ /** Accepted — the tap/click acknowledgement. */
63
+ 'commit'
64
+ /** Refused — invalid input, denied permission. */
65
+ | 'reject'
66
+ /** Selection flipped; fires alongside the selection change. */
67
+ | 'toggle';
68
+ /**
69
+ * What a binding may change. Deliberately small and geometric.
70
+ *
71
+ * `fill`/`stroke` accept ONLY design-system token references — never literal colours. A colour
72
+ * that is not already in `DESIGN_SYSTEM.md` is a violation, not a feature; if a state has no
73
+ * token, that is a question for the design system rather than a local decision.
74
+ */
75
+ export type Channel = 'opacity' | 'scale' | 'rotate' | 'translateX' | 'translateY' | 'fill' | 'stroke' | 'strokeWidth' | 'strokeDashoffset'
76
+ /** Morph toward the geometry variant named by `to`. */
77
+ | 'geometry';
78
+ /** A momentary effect a renderer plays, then returns to whatever the axes say. */
79
+ export type Effect = 'pulse' | 'shake' | 'flash';
80
+ /** Matches a subset of the discrete state. Omitted axes are wildcards. */
81
+ export type StateMatch = Partial<ElementState>;
82
+ /** Applies while the state matches. */
83
+ export interface StateBinding {
84
+ readonly when: StateMatch;
85
+ readonly channel: Channel;
86
+ readonly to: number | string;
87
+ /** Transition duration. Omitted means instant. */
88
+ readonly ms?: number;
89
+ /** Easing token from the design system. Never a raw cubic-bezier. */
90
+ readonly ease?: string;
91
+ }
92
+ /** Maps a continuous signal onto a channel across a range. */
93
+ export interface SignalBinding {
94
+ readonly signal: SignalName;
95
+ readonly channel: Channel;
96
+ readonly from: number | string;
97
+ readonly to: number | string;
98
+ }
99
+ /** Plays once when a transition fires. */
100
+ export interface TransitionBinding {
101
+ readonly on: TransitionName;
102
+ readonly effect: Effect;
103
+ readonly ms?: number;
104
+ }
105
+ export type Binding = StateBinding | SignalBinding | TransitionBinding;
106
+ /**
107
+ * An axis-aligned rounded rectangle in viewBox units. Maps 1:1 to `<rect rx>` (SVG),
108
+ * RoundedRectangle / Path.addRoundedRect (SwiftUI), addRoundRect (Compose), and a rect op (PDF).
109
+ */
110
+ export interface RectPrimitive {
111
+ readonly kind: 'rect';
112
+ readonly x: number;
113
+ readonly y: number;
114
+ readonly w: number;
115
+ readonly h: number;
116
+ /** Corner radius, viewBox units. The XENO 0.4 corner cap lives here. Omitted = sharp. */
117
+ readonly rx?: number;
118
+ /**
119
+ * Fill role. Omitted = OUTLINE: the container paints it (`fill:none`; stroke = contract stroke).
120
+ * A design-system token reference (never a literal colour, per {@link Channel}) = a SOLID part,
121
+ * painted with that token and no stroke. This is the per-part fill flag the real glyphs use.
122
+ */
123
+ readonly fill?: string;
124
+ }
125
+ /**
126
+ * The bounded escape hatch for genuinely compound glyphs (e.g. `xeno.search`). Keeps the ONE string
127
+ * grammar that is cross-platform native: SVG path `d`, parsed by Android PathParser and a small parser
128
+ * on Apple. Any authoring-time transform is resolved INTO these coordinates, never carried. No markup,
129
+ * no elements, no CSS — just M/L/C/Q/A/Z and numbers.
130
+ */
131
+ export interface PathPrimitive {
132
+ readonly kind: 'path';
133
+ readonly d: string;
134
+ /** Same fill role as {@link RectPrimitive.fill}. Omitted = stroked outline. */
135
+ readonly fill?: string;
136
+ /** Fill rule for compound paths with holes (e.g. the search lens ring). Omitted = nonzero. */
137
+ readonly fillRule?: 'nonzero' | 'evenodd';
138
+ }
139
+ /** The closed primitive vocabulary. Extend by adding a kind; never by widening a field to a blob. */
140
+ export type Primitive = RectPrimitive | PathPrimitive;
141
+ /**
142
+ * Geometry for ONE variant. Backward-compatible union: a bare `string` is the LEGACY single path `d`,
143
+ * exactly equivalent to `[{ kind: 'path', d }]`; renderers normalise a string to that one primitive.
144
+ * New elements author a {@link Primitive} list. The string form is deprecated but never removed.
145
+ */
146
+ export type VariantGeometry = string | readonly Primitive[];
147
+ /**
148
+ * Geometry by variant. `base` is REQUIRED; further keys are `axis:value` (e.g. `selection:on` for a
149
+ * filled bookmark) reachable via the `geometry` channel.
150
+ */
151
+ export interface Geometry {
152
+ readonly base: VariantGeometry;
153
+ readonly [variant: string]: VariantGeometry;
154
+ }
155
+ /**
156
+ * Can two variants morph, or must the renderer crossfade? Fails CLOSED: unequal length, a per-index kind
157
+ * mismatch, or two paths whose command sequences differ → `false`. Deliberately NOT wired into
158
+ * {@link checkCompatibility} — geometry stays a refinement there — so behaviour is unchanged; adopting
159
+ * it into the checker is a separate decision.
160
+ *
161
+ * The command check is not pedantry, and it was learned the hard way. Matching KINDS is what an
162
+ * interpolator needs to pair the shapes up; matching COMMANDS is what it needs to pair the numbers up.
163
+ * `M4 12H19` and `M6.5 6.5L17.5 17.5` are both single paths of two points and this function used to call
164
+ * them morphable — but one ends in a horizontal-line command and the other in a general line, so a
165
+ * browser asked to interpolate them gives up and snaps to the end. Two of three strokes animated and the
166
+ * third teleported, which looks like a bug in the drawing rather than in the check.
167
+ */
168
+ export declare function geometryMorphable(a: VariantGeometry, b: VariantGeometry): boolean;
169
+ /**
170
+ * The stable, machine-checkable promise an element makes to its consumers.
171
+ *
172
+ * A product pins **the contract, not the bytes**. That distinction is what npm structurally
173
+ * cannot express — a package version cannot tell "we polished the glyph" from "we deleted the
174
+ * glyph" — and it is what lets a refinement propagate automatically while a breaking change
175
+ * cannot. See `SPEC.md` §7.1.
176
+ */
177
+ export interface ElementContract {
178
+ readonly viewBox: string;
179
+ /** Optical weight family. Elements of one weight must sit together without adjustment. */
180
+ readonly weight: 'light' | 'regular' | 'bold';
181
+ readonly strokeFamily: string;
182
+ /** Which axes this element honours. A decorative glyph declares none. */
183
+ readonly axes: readonly AxisName[];
184
+ /** Which continuous inputs it accepts. */
185
+ readonly signals: readonly SignalName[];
186
+ }
187
+ export type ElementKind =
188
+ /** Degenerate: no children, pure geometry. */
189
+ 'icon'
190
+ /** Interactive leaf — a toggle, a handle. */
191
+ | 'control'
192
+ /** Holds other elements. */
193
+ | 'container'
194
+ /** Compound: geometry + slot + label + behaviour. A button. */
195
+ | 'composite';
196
+ export interface ElementDeclaration {
197
+ /**
198
+ * Stable forever. This is the unit of change, the unit of pinning, and how every product,
199
+ * saved file and agent refers to the element. **Renaming one is an ecosystem-wide breaking
200
+ * change** — add a new id and deprecate instead.
201
+ */
202
+ readonly id: string;
203
+ readonly kind: ElementKind;
204
+ readonly contract: ElementContract;
205
+ /**
206
+ * Geometry by variant — a {@link Geometry}. `base` is required; further keys are `axis:value`
207
+ * variants (e.g. `selection:on` for a filled bookmark) reachable via the `geometry` channel. Each
208
+ * variant is a {@link Primitive} list (or a legacy path `string`, normalised to one path primitive).
209
+ */
210
+ readonly geometry: Geometry;
211
+ readonly bindings: readonly Binding[];
212
+ readonly a11y: {
213
+ readonly role: string;
214
+ readonly label: string;
215
+ };
216
+ readonly meta?: {
217
+ readonly tags?: readonly string[];
218
+ /** Version this element first appeared in. */
219
+ readonly since?: string;
220
+ /** Set when superseded; names the replacement id. Never delete an element outright. */
221
+ readonly deprecatedBy?: string;
222
+ };
223
+ }
224
+ export interface CompatibilityResult {
225
+ readonly compatible: boolean;
226
+ /** Human-readable reasons a change was refused. Empty when compatible. */
227
+ readonly breaks: readonly string[];
228
+ }
229
+ /**
230
+ * Decide whether `next` may replace `prev` for a consumer that pinned `prev`'s contract.
231
+ *
232
+ * Refinements pass: redrawn geometry, retuned timings, added variants, added elements.
233
+ * Breaks are refused: a dropped axis, a dropped signal, a changed viewBox or weight, a removed
234
+ * element.
235
+ *
236
+ * **Fails CLOSED.** Anything this function does not positively understand is a break. A
237
+ * permissive contract checker is worse than none — it produces evidence of safety it has not
238
+ * established, which is the failure mode this ecosystem has already hit three times.
239
+ */
240
+ export declare function checkCompatibility(prev: ElementDeclaration, next: ElementDeclaration | undefined): CompatibilityResult;
package/dist/schema.js ADDED
@@ -0,0 +1,101 @@
1
+ /**
2
+ * The XENO element contract.
3
+ *
4
+ * This file is the whole point of the repository. Everything else — every renderer on every
5
+ * platform, every product that consumes an element, every agent that drives one — is an
6
+ * interpretation of what is declared here.
7
+ *
8
+ * ## Two properties to preserve above all others
9
+ *
10
+ * **1. There is no "icon" type.** An icon is the degenerate {@link ElementDeclaration}: no
11
+ * children, pure geometry. A button is the compound one: geometry plus a slot plus behaviour.
12
+ * They share one schema and one release path, which is what makes "edit one icon" and "edit one
13
+ * button" the identical operation. A refactor that gives icons their own type has thrown away
14
+ * the reason this repo exists.
15
+ *
16
+ * **2. A declaration contains DATA, never code.** No functions, no expressions, no executable
17
+ * animation — {@link Binding} is a description that a renderer interprets. This is an
18
+ * architectural boundary with a legal edge: Apple permits downloading and running *interpreted*
19
+ * content (the React Native shape, where JavaScript only calls into natives audited at
20
+ * submission time), and 2026 enforcement fell on apps that generate and execute code to alter
21
+ * their own behaviour. Data interpreted by a pre-reviewed renderer is inside the line. Shipping
22
+ * animation functions would not be. See `docs/STATE-MODEL.md` §4.1.
23
+ *
24
+ * @module
25
+ */
26
+ export const DEFAULT_STATE = {
27
+ availability: 'enabled',
28
+ selection: 'off',
29
+ interaction: 'idle',
30
+ };
31
+ /**
32
+ * Can two variants morph, or must the renderer crossfade? Fails CLOSED: unequal length, a per-index kind
33
+ * mismatch, or two paths whose command sequences differ → `false`. Deliberately NOT wired into
34
+ * {@link checkCompatibility} — geometry stays a refinement there — so behaviour is unchanged; adopting
35
+ * it into the checker is a separate decision.
36
+ *
37
+ * The command check is not pedantry, and it was learned the hard way. Matching KINDS is what an
38
+ * interpolator needs to pair the shapes up; matching COMMANDS is what it needs to pair the numbers up.
39
+ * `M4 12H19` and `M6.5 6.5L17.5 17.5` are both single paths of two points and this function used to call
40
+ * them morphable — but one ends in a horizontal-line command and the other in a general line, so a
41
+ * browser asked to interpolate them gives up and snaps to the end. Two of three strokes animated and the
42
+ * third teleported, which looks like a bug in the drawing rather than in the check.
43
+ */
44
+ export function geometryMorphable(a, b) {
45
+ const listOf = (g) => typeof g === 'string' ? [{ kind: 'path', d: g }] : g;
46
+ /** The command letters, in order — the only part of a path an interpolator cares about structurally. */
47
+ const commands = (d) => (d.match(/[MmLlHhVvCcSsQqTtAaZz]/g) ?? []).join('');
48
+ const x = listOf(a);
49
+ const y = listOf(b);
50
+ if (x.length !== y.length)
51
+ return false;
52
+ for (let i = 0; i < x.length; i++) {
53
+ const p = x[i];
54
+ const q = y[i];
55
+ if (p.kind !== q.kind)
56
+ return false;
57
+ if (p.kind === 'path' && q.kind === 'path' && commands(p.d) !== commands(q.d))
58
+ return false;
59
+ }
60
+ return true;
61
+ }
62
+ /**
63
+ * Decide whether `next` may replace `prev` for a consumer that pinned `prev`'s contract.
64
+ *
65
+ * Refinements pass: redrawn geometry, retuned timings, added variants, added elements.
66
+ * Breaks are refused: a dropped axis, a dropped signal, a changed viewBox or weight, a removed
67
+ * element.
68
+ *
69
+ * **Fails CLOSED.** Anything this function does not positively understand is a break. A
70
+ * permissive contract checker is worse than none — it produces evidence of safety it has not
71
+ * established, which is the failure mode this ecosystem has already hit three times.
72
+ */
73
+ export function checkCompatibility(prev, next) {
74
+ const breaks = [];
75
+ if (next === undefined) {
76
+ return { compatible: false, breaks: [`${prev.id}: element removed`] };
77
+ }
78
+ if (next.id !== prev.id) {
79
+ breaks.push(`${prev.id}: id changed to ${next.id} — ids are permanent`);
80
+ }
81
+ if (next.contract.viewBox !== prev.contract.viewBox) {
82
+ breaks.push(`${prev.id}: viewBox ${prev.contract.viewBox} → ${next.contract.viewBox} — consumers size against it`);
83
+ }
84
+ if (next.contract.weight !== prev.contract.weight) {
85
+ breaks.push(`${prev.id}: weight ${prev.contract.weight} → ${next.contract.weight}`);
86
+ }
87
+ if (next.contract.strokeFamily !== prev.contract.strokeFamily) {
88
+ breaks.push(`${prev.id}: strokeFamily ${prev.contract.strokeFamily} → ${next.contract.strokeFamily}`);
89
+ }
90
+ for (const axis of prev.contract.axes) {
91
+ if (!next.contract.axes.includes(axis)) {
92
+ breaks.push(`${prev.id}: dropped axis "${axis}" — consumers may be driving it`);
93
+ }
94
+ }
95
+ for (const signal of prev.contract.signals) {
96
+ if (!next.contract.signals.includes(signal)) {
97
+ breaks.push(`${prev.id}: dropped signal "${signal}"`);
98
+ }
99
+ }
100
+ return { compatible: breaks.length === 0, breaks };
101
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * `@xenosystem/elements/tokens` — `DESIGN_SYSTEM.md §2` resolved into pure data.
3
+ *
4
+ * A SMALL, bounded set — not the per-element barrel the no-barrel rule forbids. Re-exporting the token
5
+ * groups is fine and tree-shakes cleanly. Values implement the LOCKED design system verbatim; where the
6
+ * doc gives a role without a concrete value, that value is PROPOSED in the PR, not silently locked here.
7
+ *
8
+ * Scope so far: §2 surfaces + interactive/text/glass, plus the radius scale, control size scale and
9
+ * status vocabulary (landed for Tier-1 controls, values from the locked chat lab / DESIGN_SYSTEM). Motion
10
+ * durations and the cursor map are the remaining ROADMAP tokens.
11
+ */
12
+ export * from './surfaces.js';
13
+ export * from './interactive.js';
14
+ export * from './radius.js';
15
+ export * from './size.js';
16
+ export * from './status.js';
17
+ export * from './motion.js';