@open-pencil/scene-graph 0.15.1 → 0.16.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (234) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -1
  3. package/dist/chunks/behaviours/kinds.js +273 -0
  4. package/dist/chunks/behaviours/kinds.js.map +1 -0
  5. package/dist/chunks/behaviours/layers.js +607 -0
  6. package/dist/chunks/behaviours/layers.js.map +1 -0
  7. package/dist/chunks/behaviours/spec.js +181 -0
  8. package/dist/chunks/behaviours/spec.js.map +1 -0
  9. package/dist/chunks/buffered-events.js +57 -0
  10. package/dist/chunks/buffered-events.js.map +1 -0
  11. package/dist/chunks/color/contrast.js +57 -0
  12. package/dist/chunks/color/contrast.js.map +1 -0
  13. package/dist/chunks/{components/properties.js → color/index.js} +577 -522
  14. package/dist/chunks/color/index.js.map +1 -0
  15. package/dist/chunks/comments/document.js +32 -0
  16. package/dist/chunks/comments/document.js.map +1 -0
  17. package/dist/chunks/comments/list.js +182 -0
  18. package/dist/chunks/comments/list.js.map +1 -0
  19. package/dist/chunks/comments/merge.js +58 -0
  20. package/dist/chunks/comments/merge.js.map +1 -0
  21. package/dist/chunks/components/exposure.js +2291 -0
  22. package/dist/chunks/components/exposure.js.map +1 -0
  23. package/dist/chunks/components/variants.js +32 -0
  24. package/dist/chunks/components/variants.js.map +1 -0
  25. package/dist/chunks/coordinate.js +93 -55
  26. package/dist/chunks/coordinate.js.map +1 -1
  27. package/dist/chunks/css/grid.js +94 -0
  28. package/dist/chunks/css/grid.js.map +1 -0
  29. package/dist/chunks/css/index.js +160 -0
  30. package/dist/chunks/css/index.js.map +1 -0
  31. package/dist/chunks/fields/geometry.js +14 -0
  32. package/dist/chunks/fields/geometry.js.map +1 -0
  33. package/dist/chunks/group-bounds.js +104 -0
  34. package/dist/chunks/group-bounds.js.map +1 -0
  35. package/dist/chunks/icons/glyph.js +147 -0
  36. package/dist/chunks/icons/glyph.js.map +1 -0
  37. package/dist/chunks/index.js +1724 -663
  38. package/dist/chunks/index.js.map +1 -1
  39. package/dist/color.d.ts +72 -0
  40. package/dist/color.d.ts.map +1 -0
  41. package/dist/color.js +3 -0
  42. package/dist/constants.d.ts +2 -2
  43. package/dist/constants.js +2 -2
  44. package/dist/constants2.d.ts +3 -1
  45. package/dist/constants2.d.ts.map +1 -1
  46. package/dist/coordinate.d.ts +2 -448
  47. package/dist/coordinate.js +2 -2
  48. package/dist/copy.d.ts +1 -1
  49. package/dist/copy.js +1 -1
  50. package/dist/css.d.ts +39 -0
  51. package/dist/css.d.ts.map +1 -0
  52. package/dist/css.js +3 -0
  53. package/dist/geometry.d.ts +1 -1
  54. package/dist/geometry.js +1 -1
  55. package/dist/gradient.d.ts +51 -0
  56. package/dist/gradient.d.ts.map +1 -0
  57. package/dist/gradient.js +132 -0
  58. package/dist/gradient.js.map +1 -0
  59. package/dist/guides.d.ts +2 -2
  60. package/dist/guides.js +39 -0
  61. package/dist/guides.js.map +1 -0
  62. package/dist/hit-test.d.ts +2 -9
  63. package/dist/hit-test.js +176 -34
  64. package/dist/hit-test.js.map +1 -1
  65. package/dist/index.d.ts +4 -8
  66. package/dist/index.js +19 -5
  67. package/dist/instances.d.ts +2 -2
  68. package/dist/instances.js +2 -2
  69. package/dist/layout.d.ts +2 -0
  70. package/dist/layout.js +4 -0
  71. package/dist/node-defaults.d.ts +2 -8
  72. package/dist/node-defaults.js +2 -2
  73. package/dist/order-keys.d.ts +39 -0
  74. package/dist/order-keys.d.ts.map +1 -0
  75. package/dist/order-keys.js +136 -0
  76. package/dist/order-keys.js.map +1 -0
  77. package/dist/parse-path.d.ts +7 -1
  78. package/dist/parse-path.d.ts.map +1 -1
  79. package/dist/parse-path.js +6 -2
  80. package/dist/parse-path.js.map +1 -1
  81. package/dist/polygon.d.ts +53 -0
  82. package/dist/polygon.d.ts.map +1 -0
  83. package/dist/polygon.js +205 -0
  84. package/dist/polygon.js.map +1 -0
  85. package/dist/preview.d.ts +1 -1
  86. package/dist/random.d.ts +7 -0
  87. package/dist/random.d.ts.map +1 -0
  88. package/dist/random.js +2 -0
  89. package/dist/resize.d.ts +11 -2
  90. package/dist/resize.d.ts.map +1 -1
  91. package/dist/resize.js +2 -184
  92. package/dist/snap.d.ts +1 -1
  93. package/dist/text-direction.d.ts +13 -0
  94. package/dist/text-direction.d.ts.map +1 -0
  95. package/dist/text-direction.js +31 -0
  96. package/dist/text-direction.js.map +1 -0
  97. package/dist/text-picture.d.ts +1 -1
  98. package/dist/text-picture.d.ts.map +1 -1
  99. package/dist/text.d.ts +2 -0
  100. package/dist/text.js +3 -0
  101. package/dist/types.d.ts +2121 -15
  102. package/dist/types.d.ts.map +1 -1
  103. package/dist/types.js +2 -1
  104. package/dist/types2.d.ts +2 -2
  105. package/dist/undo.d.ts +2 -2
  106. package/dist/undo.js +2 -2
  107. package/dist/undo2.d.ts +29 -1
  108. package/dist/undo2.d.ts.map +1 -1
  109. package/dist/variables.d.ts +2 -29
  110. package/dist/variables.js +2 -2
  111. package/dist/variant-properties.d.ts +9 -1
  112. package/dist/variant-properties.d.ts.map +1 -1
  113. package/dist/variant-properties.js +36 -1
  114. package/dist/variant-properties.js.map +1 -1
  115. package/dist/vector-network.d.ts +1 -1
  116. package/dist/vector-network.js +1 -1
  117. package/package.json +60 -9
  118. package/src/behaviours/kinds.ts +185 -0
  119. package/src/behaviours/layers.ts +51 -0
  120. package/src/behaviours/model.ts +192 -0
  121. package/src/behaviours/schema.ts +58 -0
  122. package/src/behaviours/spec.ts +223 -0
  123. package/src/buffered-events.ts +64 -0
  124. package/src/color/contrast.ts +31 -0
  125. package/src/color/index.ts +88 -0
  126. package/src/color/management.ts +210 -0
  127. package/src/color/normalize.ts +7 -0
  128. package/src/color/okhcl.ts +201 -0
  129. package/src/comments/document.ts +51 -0
  130. package/src/comments/list.ts +52 -0
  131. package/src/comments/merge.ts +63 -0
  132. package/src/comments/threads.ts +156 -0
  133. package/src/components/exposure.ts +61 -0
  134. package/src/components/properties.ts +18 -15
  135. package/src/components/variants.ts +53 -0
  136. package/src/constants.ts +2 -0
  137. package/src/coordinate.ts +100 -43
  138. package/src/copy.ts +17 -6
  139. package/src/css/grid.ts +70 -0
  140. package/src/css/index.ts +9 -0
  141. package/src/css/layout.ts +53 -0
  142. package/src/css/shadows.ts +68 -0
  143. package/src/css/values.ts +42 -0
  144. package/src/export-format.ts +12 -0
  145. package/src/fields/geometry.ts +11 -0
  146. package/src/fields/text.ts +35 -0
  147. package/src/gradient.ts +166 -0
  148. package/src/group-bounds.ts +131 -0
  149. package/src/guides.ts +39 -0
  150. package/src/hit-test.ts +262 -46
  151. package/src/icons/glyph.ts +128 -0
  152. package/src/icons/model.ts +54 -0
  153. package/src/icons/schema.ts +18 -0
  154. package/src/index.ts +347 -57
  155. package/src/instance-overrides.ts +27 -0
  156. package/src/instances/content-size.ts +58 -0
  157. package/src/instances/copies.ts +239 -0
  158. package/src/instances/cycles.ts +73 -0
  159. package/src/instances/fields.ts +143 -0
  160. package/src/instances/main-component.ts +19 -0
  161. package/src/instances/placement.ts +29 -0
  162. package/src/instances/source-walk.ts +41 -0
  163. package/src/instances/sync.ts +600 -0
  164. package/src/instances/vector-geometry.ts +81 -0
  165. package/src/instances.ts +125 -330
  166. package/src/layout/aspect-ratio.ts +51 -0
  167. package/src/{layout-guides.ts → layout/guides.ts} +41 -12
  168. package/src/layout/index.ts +4 -0
  169. package/src/layout/keywords.ts +73 -0
  170. package/src/layout/sizing.ts +196 -0
  171. package/src/mutation-impact.ts +25 -10
  172. package/src/node-defaults.ts +50 -2
  173. package/src/order-keys.ts +162 -0
  174. package/src/parse-path.ts +10 -2
  175. package/src/plugin-data/field.ts +131 -0
  176. package/src/plugin-data/fields.ts +246 -0
  177. package/src/polygon.ts +211 -0
  178. package/src/preview.ts +1 -1
  179. package/src/random.ts +28 -0
  180. package/src/resize.ts +99 -12
  181. package/src/scaling/index.ts +2 -0
  182. package/src/scaling/node.ts +164 -0
  183. package/src/scaling/tree.ts +50 -0
  184. package/src/shaders/model.ts +98 -0
  185. package/src/shaders/schema.ts +48 -0
  186. package/src/shared-styles.ts +5 -2
  187. package/src/slots/authoring.ts +101 -0
  188. package/src/slots/content.ts +124 -0
  189. package/src/slots/frames.ts +160 -0
  190. package/src/slots/limits.ts +49 -0
  191. package/src/text/direction.ts +55 -0
  192. package/src/text/index.ts +3 -0
  193. package/src/text/lists.ts +138 -0
  194. package/src/text/paragraphs.ts +241 -0
  195. package/src/{text-picture.ts → text/picture.ts} +21 -29
  196. package/src/text/references.ts +50 -0
  197. package/src/transfer/apply.ts +84 -0
  198. package/src/transfer/history.ts +49 -0
  199. package/src/transfer/identity.ts +16 -0
  200. package/src/transfer/index.ts +6 -0
  201. package/src/transfer/nodes.ts +120 -0
  202. package/src/transfer/plan.ts +130 -0
  203. package/src/transfer/references.ts +9 -0
  204. package/src/transfer/remove.ts +39 -0
  205. package/src/transfer/validation.ts +59 -0
  206. package/src/transfer/variables.ts +82 -0
  207. package/src/types.ts +257 -13
  208. package/src/undo.ts +54 -2
  209. package/src/variables/bindings.ts +224 -0
  210. package/src/variables/fields.ts +43 -0
  211. package/src/variables/token.ts +14 -0
  212. package/src/variables/units.ts +15 -0
  213. package/src/variables.ts +118 -69
  214. package/src/variant-properties.ts +50 -0
  215. package/dist/chunks/components/properties.js.map +0 -1
  216. package/dist/chunks/export-scale.js +0 -19
  217. package/dist/chunks/export-scale.js.map +0 -1
  218. package/dist/coordinate.d.ts.map +0 -1
  219. package/dist/coordinate2.d.ts +0 -2
  220. package/dist/guides2.d.ts +0 -11
  221. package/dist/guides2.d.ts.map +0 -1
  222. package/dist/hit-test.d.ts.map +0 -1
  223. package/dist/layout-guides.d.ts +0 -2
  224. package/dist/layout-guides.js +0 -2
  225. package/dist/layout-guides2.d.ts +0 -16
  226. package/dist/layout-guides2.d.ts.map +0 -1
  227. package/dist/node-defaults.d.ts.map +0 -1
  228. package/dist/preview2.d.ts +0 -12
  229. package/dist/preview2.d.ts.map +0 -1
  230. package/dist/resize.js.map +0 -1
  231. package/dist/variables.d.ts.map +0 -1
  232. package/dist/vector-network2.d.ts +0 -32
  233. package/dist/vector-network2.d.ts.map +0 -1
  234. package/src/instance-overrides.test.ts +0 -67
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Danila Poyarkov and OpenPencil contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -2,4 +2,4 @@
2
2
 
3
3
  Shared OpenPencil design document model.
4
4
 
5
- This package owns `SceneGraph`, `SceneNode`, paint/effect/layout/variable types, graph mutation helpers, source metadata, and model-level utilities. It does not own editor state, UI, file format policy, rendering, or app document I/O.
5
+ This package owns `SceneGraph`, `SceneNode`, paint/effect/layout/variable types, graph mutation helpers, source metadata, and model-level utilities, including component slots and behaviours: the contracts after Reka UI's primitives, the behaviour stored in plugin data, and specs that name properties and slots. It does not own editor state, UI, file format policy, rendering, or app document I/O.
@@ -0,0 +1,273 @@
1
+ //#region src/behaviours/kinds.ts
2
+ /** The controls a main component can behave as, in the order the picker lists them. */
3
+ const BEHAVIOUR_KINDS = [
4
+ "button",
5
+ "textField",
6
+ "textarea",
7
+ "numberField",
8
+ "toggle",
9
+ "switch",
10
+ "checkbox",
11
+ "radio",
12
+ "radioGroup",
13
+ "toggleGroup",
14
+ "slider",
15
+ "progress",
16
+ "tabs",
17
+ "collapsible",
18
+ "accordion"
19
+ ];
20
+ /**
21
+ * The interaction states a control can show, each drawn as a value of one variant property:
22
+ * at rest, under the pointer, while pressed, focused from the keyboard, and disabled.
23
+ */
24
+ const INTERACTION_STATES = [
25
+ "rest",
26
+ "hover",
27
+ "pressed",
28
+ "focus",
29
+ "disabled"
30
+ ];
31
+ /**
32
+ * A text field or textarea: its text is a text property, and `filled`, when bound, draws the
33
+ * empty field with its placeholder.
34
+ */
35
+ const TEXT_INPUT = {
36
+ values: [
37
+ {
38
+ id: "value",
39
+ type: "text",
40
+ required: true
41
+ },
42
+ {
43
+ id: "filled",
44
+ type: "boolean",
45
+ required: false
46
+ },
47
+ {
48
+ id: "disabled",
49
+ type: "boolean",
50
+ required: false
51
+ }
52
+ ],
53
+ parts: []
54
+ };
55
+ /**
56
+ * The behaviours OpenPencil knows, after Reka UI's primitives. Their states are drawn as the
57
+ * component's variants and properties; their subcomponents (thumb, range, trigger, …) are the
58
+ * component's slots, and the component itself is the control's root.
59
+ */
60
+ const BEHAVIOUR_CONTRACTS = {
61
+ button: {
62
+ values: [{
63
+ id: "disabled",
64
+ type: "boolean",
65
+ required: false
66
+ }],
67
+ parts: []
68
+ },
69
+ textField: TEXT_INPUT,
70
+ textarea: TEXT_INPUT,
71
+ numberField: {
72
+ values: [
73
+ {
74
+ id: "value",
75
+ type: "number",
76
+ required: false
77
+ },
78
+ {
79
+ id: "text",
80
+ type: "text",
81
+ required: true
82
+ },
83
+ {
84
+ id: "disabled",
85
+ type: "boolean",
86
+ required: false
87
+ }
88
+ ],
89
+ parts: [{
90
+ id: "increment",
91
+ required: false
92
+ }, {
93
+ id: "decrement",
94
+ required: false
95
+ }]
96
+ },
97
+ toggle: {
98
+ values: [{
99
+ id: "value",
100
+ type: "boolean",
101
+ required: true
102
+ }, {
103
+ id: "disabled",
104
+ type: "boolean",
105
+ required: false
106
+ }],
107
+ parts: []
108
+ },
109
+ switch: {
110
+ values: [{
111
+ id: "value",
112
+ type: "boolean",
113
+ required: true
114
+ }, {
115
+ id: "disabled",
116
+ type: "boolean",
117
+ required: false
118
+ }],
119
+ parts: [{
120
+ id: "thumb",
121
+ required: false
122
+ }]
123
+ },
124
+ checkbox: {
125
+ values: [{
126
+ id: "value",
127
+ type: "boolean",
128
+ required: true
129
+ }, {
130
+ id: "disabled",
131
+ type: "boolean",
132
+ required: false
133
+ }],
134
+ parts: [{
135
+ id: "indicator",
136
+ required: false
137
+ }]
138
+ },
139
+ radio: {
140
+ values: [{
141
+ id: "value",
142
+ type: "boolean",
143
+ required: true
144
+ }, {
145
+ id: "disabled",
146
+ type: "boolean",
147
+ required: false
148
+ }],
149
+ parts: [{
150
+ id: "indicator",
151
+ required: false
152
+ }]
153
+ },
154
+ radioGroup: {
155
+ values: [{
156
+ id: "disabled",
157
+ type: "boolean",
158
+ required: false
159
+ }],
160
+ parts: [{
161
+ id: "items",
162
+ required: true,
163
+ items: true,
164
+ children: "item"
165
+ }]
166
+ },
167
+ toggleGroup: {
168
+ values: [{
169
+ id: "disabled",
170
+ type: "boolean",
171
+ required: false
172
+ }],
173
+ parts: [{
174
+ id: "items",
175
+ required: true,
176
+ items: true,
177
+ children: "item"
178
+ }]
179
+ },
180
+ slider: {
181
+ values: [{
182
+ id: "value",
183
+ type: "number",
184
+ required: false
185
+ }, {
186
+ id: "disabled",
187
+ type: "boolean",
188
+ required: false
189
+ }],
190
+ parts: [
191
+ {
192
+ id: "track",
193
+ required: true
194
+ },
195
+ {
196
+ id: "range",
197
+ required: false
198
+ },
199
+ {
200
+ id: "thumb",
201
+ required: true
202
+ }
203
+ ]
204
+ },
205
+ tabs: {
206
+ values: [{
207
+ id: "value",
208
+ type: "choice",
209
+ required: false
210
+ }],
211
+ parts: [{
212
+ id: "list",
213
+ required: true,
214
+ children: "trigger"
215
+ }, {
216
+ id: "panels",
217
+ required: false,
218
+ children: "content"
219
+ }]
220
+ },
221
+ progress: {
222
+ values: [{
223
+ id: "value",
224
+ type: "number",
225
+ required: false
226
+ }],
227
+ parts: [{
228
+ id: "track",
229
+ required: true
230
+ }, {
231
+ id: "indicator",
232
+ required: true
233
+ }]
234
+ },
235
+ collapsible: {
236
+ values: [{
237
+ id: "open",
238
+ type: "boolean",
239
+ required: false
240
+ }, {
241
+ id: "disabled",
242
+ type: "boolean",
243
+ required: false
244
+ }],
245
+ parts: [{
246
+ id: "trigger",
247
+ required: true
248
+ }, {
249
+ id: "content",
250
+ required: true
251
+ }]
252
+ },
253
+ accordion: {
254
+ values: [{
255
+ id: "disabled",
256
+ type: "boolean",
257
+ required: false
258
+ }],
259
+ parts: [{
260
+ id: "items",
261
+ required: true,
262
+ items: true,
263
+ children: "item"
264
+ }]
265
+ }
266
+ };
267
+ function behaviourContract(kind) {
268
+ return BEHAVIOUR_CONTRACTS[kind];
269
+ }
270
+ //#endregion
271
+ export { BEHAVIOUR_CONTRACTS, BEHAVIOUR_KINDS, INTERACTION_STATES, behaviourContract };
272
+
273
+ //# sourceMappingURL=kinds.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kinds.js","names":[],"sources":["../../../src/behaviours/kinds.ts"],"sourcesContent":["/** The controls a main component can behave as, in the order the picker lists them. */\nexport const BEHAVIOUR_KINDS = [\n 'button',\n 'textField',\n 'textarea',\n 'numberField',\n 'toggle',\n 'switch',\n 'checkbox',\n 'radio',\n 'radioGroup',\n 'toggleGroup',\n 'slider',\n 'progress',\n 'tabs',\n 'collapsible',\n 'accordion'\n] as const\n\nexport type BehaviourKind = (typeof BEHAVIOUR_KINDS)[number]\n\n/**\n * The interaction states a control can show, each drawn as a value of one variant property:\n * at rest, under the pointer, while pressed, focused from the keyboard, and disabled.\n */\nexport const INTERACTION_STATES = ['rest', 'hover', 'pressed', 'focus', 'disabled'] as const\n\nexport type InteractionState = (typeof INTERACTION_STATES)[number]\n\n/**\n * How a behaviour value is held. A boolean is a variant or boolean property of the component,\n * and text is a text property. Figma has no number property, so a number is the behaviour's\n * own (min, max, step, default); a choice is which item of a slot is active, the first by\n * default.\n */\nexport type BehaviourValueType = 'boolean' | 'text' | 'number' | 'choice'\n\n/** A value of the control: its state, which preview reads and changes. */\nexport interface BehaviourValueContract {\n id: string\n type: BehaviourValueType\n /** Whether a boolean or text value must be bound before the behaviour is complete. */\n required: boolean\n}\n\n/**\n * A Reka UI subcomponent of the control, which is a slot of the component: the behaviour binds\n * it to one of the component's slot properties, never to a layer found by name.\n */\nexport interface BehaviourPartContract {\n id: string\n required: boolean\n /**\n * Whether the slot holds the control's items, each an instance with its own behaviour (a\n * radio, a toggle, a collapsible), which the control turns on and off.\n */\n items?: boolean\n /**\n * The Reka UI part each child of the slot is, when the slot holds repeated parts: a tab list's\n * triggers, the tabs' content panels, or a group's items.\n */\n children?: string\n}\n\nexport interface BehaviourContract {\n values: BehaviourValueContract[]\n parts: BehaviourPartContract[]\n}\n\n/**\n * A text field or textarea: its text is a text property, and `filled`, when bound, draws the\n * empty field with its placeholder.\n */\nconst TEXT_INPUT: BehaviourContract = {\n values: [\n { id: 'value', type: 'text', required: true },\n { id: 'filled', type: 'boolean', required: false },\n { id: 'disabled', type: 'boolean', required: false }\n ],\n parts: []\n}\n\n/**\n * The behaviours OpenPencil knows, after Reka UI's primitives. Their states are drawn as the\n * component's variants and properties; their subcomponents (thumb, range, trigger, …) are the\n * component's slots, and the component itself is the control's root.\n */\nexport const BEHAVIOUR_CONTRACTS: Readonly<Record<BehaviourKind, BehaviourContract>> = {\n button: {\n values: [{ id: 'disabled', type: 'boolean', required: false }],\n parts: []\n },\n textField: TEXT_INPUT,\n textarea: TEXT_INPUT,\n numberField: {\n values: [\n { id: 'value', type: 'number', required: false },\n { id: 'text', type: 'text', required: true },\n { id: 'disabled', type: 'boolean', required: false }\n ],\n parts: [\n { id: 'increment', required: false },\n { id: 'decrement', required: false }\n ]\n },\n toggle: {\n values: [\n { id: 'value', type: 'boolean', required: true },\n { id: 'disabled', type: 'boolean', required: false }\n ],\n parts: []\n },\n switch: {\n values: [\n { id: 'value', type: 'boolean', required: true },\n { id: 'disabled', type: 'boolean', required: false }\n ],\n parts: [{ id: 'thumb', required: false }]\n },\n checkbox: {\n values: [\n { id: 'value', type: 'boolean', required: true },\n { id: 'disabled', type: 'boolean', required: false }\n ],\n parts: [{ id: 'indicator', required: false }]\n },\n radio: {\n values: [\n { id: 'value', type: 'boolean', required: true },\n { id: 'disabled', type: 'boolean', required: false }\n ],\n parts: [{ id: 'indicator', required: false }]\n },\n radioGroup: {\n values: [{ id: 'disabled', type: 'boolean', required: false }],\n parts: [{ id: 'items', required: true, items: true, children: 'item' }]\n },\n toggleGroup: {\n values: [{ id: 'disabled', type: 'boolean', required: false }],\n parts: [{ id: 'items', required: true, items: true, children: 'item' }]\n },\n slider: {\n values: [\n { id: 'value', type: 'number', required: false },\n { id: 'disabled', type: 'boolean', required: false }\n ],\n parts: [\n { id: 'track', required: true },\n { id: 'range', required: false },\n { id: 'thumb', required: true }\n ]\n },\n tabs: {\n values: [{ id: 'value', type: 'choice', required: false }],\n parts: [\n { id: 'list', required: true, children: 'trigger' },\n { id: 'panels', required: false, children: 'content' }\n ]\n },\n progress: {\n values: [{ id: 'value', type: 'number', required: false }],\n parts: [\n { id: 'track', required: true },\n { id: 'indicator', required: true }\n ]\n },\n collapsible: {\n values: [\n { id: 'open', type: 'boolean', required: false },\n { id: 'disabled', type: 'boolean', required: false }\n ],\n parts: [\n { id: 'trigger', required: true },\n { id: 'content', required: true }\n ]\n },\n accordion: {\n values: [{ id: 'disabled', type: 'boolean', required: false }],\n parts: [{ id: 'items', required: true, items: true, children: 'item' }]\n }\n}\n\nexport function behaviourContract(kind: BehaviourKind): BehaviourContract {\n return BEHAVIOUR_CONTRACTS[kind]\n}\n"],"mappings":";;AACA,MAAa,kBAAkB;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;;;AAQA,MAAa,qBAAqB;CAAC;CAAQ;CAAS;CAAW;CAAS;AAAU;;;;;AAgDlF,MAAM,aAAgC;CACpC,QAAQ;EACN;GAAE,IAAI;GAAS,MAAM;GAAQ,UAAU;EAAK;EAC5C;GAAE,IAAI;GAAU,MAAM;GAAW,UAAU;EAAM;EACjD;GAAE,IAAI;GAAY,MAAM;GAAW,UAAU;EAAM;CACrD;CACA,OAAO,CAAC;AACV;;;;;;AAOA,MAAa,sBAA0E;CACrF,QAAQ;EACN,QAAQ,CAAC;GAAE,IAAI;GAAY,MAAM;GAAW,UAAU;EAAM,CAAC;EAC7D,OAAO,CAAC;CACV;CACA,WAAW;CACX,UAAU;CACV,aAAa;EACX,QAAQ;GACN;IAAE,IAAI;IAAS,MAAM;IAAU,UAAU;GAAM;GAC/C;IAAE,IAAI;IAAQ,MAAM;IAAQ,UAAU;GAAK;GAC3C;IAAE,IAAI;IAAY,MAAM;IAAW,UAAU;GAAM;EACrD;EACA,OAAO,CACL;GAAE,IAAI;GAAa,UAAU;EAAM,GACnC;GAAE,IAAI;GAAa,UAAU;EAAM,CACrC;CACF;CACA,QAAQ;EACN,QAAQ,CACN;GAAE,IAAI;GAAS,MAAM;GAAW,UAAU;EAAK,GAC/C;GAAE,IAAI;GAAY,MAAM;GAAW,UAAU;EAAM,CACrD;EACA,OAAO,CAAC;CACV;CACA,QAAQ;EACN,QAAQ,CACN;GAAE,IAAI;GAAS,MAAM;GAAW,UAAU;EAAK,GAC/C;GAAE,IAAI;GAAY,MAAM;GAAW,UAAU;EAAM,CACrD;EACA,OAAO,CAAC;GAAE,IAAI;GAAS,UAAU;EAAM,CA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