@agent-native/design-system 0.229.0 → 0.237.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 (608) hide show
  1. package/README.md +45 -16
  2. package/css/components/announcement.css +6 -0
  3. package/css/components/autocomplete.css +4 -0
  4. package/css/components/button.css +2 -0
  5. package/css/components/combobox.css +3 -0
  6. package/css/components/design-file-panel.css +5 -0
  7. package/css/components/dialog.css +2 -0
  8. package/css/components/dock-workspace.css +5 -0
  9. package/css/components/font-picker.css +7 -0
  10. package/css/components/icon-button.css +2 -0
  11. package/css/components/image-card.css +4 -0
  12. package/css/components/layer-tree.css +4 -0
  13. package/css/components/meter.css +1 -0
  14. package/css/components/progress.css +2 -0
  15. package/css/components/property-token.css +3 -0
  16. package/css/components/tabs.css +3 -0
  17. package/css/components/toast.css +2 -0
  18. package/css/direction.css +24 -0
  19. package/css/main.css +3 -2
  20. package/css/parts/accordion.css +4 -3
  21. package/css/parts/alert-dialog.css +19 -51
  22. package/css/parts/alignment-picker.css +363 -0
  23. package/css/parts/autocomplete.css +47 -117
  24. package/css/parts/avatar.css +3 -30
  25. package/css/parts/badge.css +11 -25
  26. package/css/parts/blockquote.css +1 -1
  27. package/css/parts/button.css +75 -61
  28. package/css/parts/callout.css +4 -24
  29. package/css/parts/card.css +31 -39
  30. package/css/parts/checkbox-cards.css +10 -11
  31. package/css/parts/checkbox-group.css +1 -1
  32. package/css/parts/checkbox.css +35 -18
  33. package/css/parts/code.css +4 -64
  34. package/css/parts/color-swatch.css +36 -0
  35. package/css/parts/combobox.css +24 -10
  36. package/css/parts/constraint-controls.css +140 -0
  37. package/css/parts/context-menu.css +1 -1
  38. package/css/parts/data-list.css +9 -22
  39. package/css/parts/design-file-panel.css +189 -0
  40. package/css/parts/design-property-inspector.css +200 -0
  41. package/css/parts/dialog.css +87 -91
  42. package/css/parts/dock-workspace.css +123 -0
  43. package/css/parts/drawer.css +14 -54
  44. package/css/parts/field.css +2 -2
  45. package/css/parts/fieldset.css +1 -1
  46. package/css/parts/font-picker.css +205 -0
  47. package/css/parts/grid-size-picker.css +220 -0
  48. package/css/parts/heading.css +1 -1
  49. package/css/parts/icon-button.css +2 -12
  50. package/css/parts/image-card.css +126 -0
  51. package/css/parts/input.css +37 -31
  52. package/css/parts/inset.css +1 -0
  53. package/css/parts/inspector.css +67 -0
  54. package/css/parts/item.css +5 -8
  55. package/css/parts/kbd.css +10 -49
  56. package/css/parts/layer-tree.css +174 -0
  57. package/css/parts/layout.css +18 -0
  58. package/css/parts/link.css +1 -1
  59. package/css/parts/menu.css +48 -47
  60. package/css/parts/menubar.css +3 -3
  61. package/css/parts/meter.css +28 -14
  62. package/css/parts/navigation-menu.css +6 -6
  63. package/css/parts/number-field.css +18 -12
  64. package/css/parts/otp-field.css +12 -26
  65. package/css/parts/page-header.css +1 -1
  66. package/css/parts/paint-editor.css +70 -0
  67. package/css/parts/popover.css +33 -36
  68. package/css/parts/preview-card.css +19 -21
  69. package/css/parts/progress.css +32 -18
  70. package/css/parts/property-list.css +34 -0
  71. package/css/parts/property-token.css +104 -0
  72. package/css/parts/radio-cards.css +28 -20
  73. package/css/parts/radio-group.css +28 -15
  74. package/css/parts/scroll-area.css +10 -17
  75. package/css/parts/segmented-control.css +66 -45
  76. package/css/parts/select.css +56 -53
  77. package/css/parts/separator.css +7 -19
  78. package/css/parts/sidebar.css +6 -9
  79. package/css/parts/skeleton.css +14 -1
  80. package/css/parts/slider.css +33 -24
  81. package/css/parts/spinner.css +5 -14
  82. package/css/parts/split-pane.css +117 -0
  83. package/css/parts/switch.css +73 -36
  84. package/css/parts/tab-nav.css +1 -1
  85. package/css/parts/table.css +23 -38
  86. package/css/parts/tabs.css +151 -30
  87. package/css/parts/text-area.css +11 -20
  88. package/css/parts/text.css +21 -58
  89. package/css/parts/toast.css +28 -19
  90. package/css/parts/toggle-group.css +1 -1
  91. package/css/parts/toggle.css +34 -21
  92. package/css/parts/toolbar.css +40 -37
  93. package/css/parts/tooltip.css +2 -2
  94. package/css/styles.css +18 -3
  95. package/css/text-style-utilities.css +113 -0
  96. package/css/text-styles.css +115 -0
  97. package/css/themes/agent-native.css +51 -44
  98. package/css/themes/analytics.css +40 -30
  99. package/css/themes/assets.css +40 -30
  100. package/css/themes/baseline.css +93 -28
  101. package/css/themes/brain.css +40 -30
  102. package/css/themes/calendar.css +40 -30
  103. package/css/themes/chat.css +40 -30
  104. package/css/themes/clips.css +40 -30
  105. package/css/themes/content.css +40 -30
  106. package/css/themes/crm.css +40 -30
  107. package/css/themes/design.css +40 -30
  108. package/css/themes/desktop.css +40 -30
  109. package/css/themes/dispatch.css +40 -30
  110. package/css/themes/docs.css +40 -30
  111. package/css/themes/factory.css +40 -30
  112. package/css/themes/forms.css +40 -30
  113. package/css/themes/mail.css +40 -30
  114. package/css/themes/plan.css +40 -30
  115. package/css/themes/slides.css +40 -30
  116. package/css/themes/tasks.css +40 -30
  117. package/css/tokens.css +93 -72
  118. package/dist/catalog/components/alert-dialog.d.ts +2 -0
  119. package/dist/catalog/components/alert-dialog.d.ts.map +1 -0
  120. package/dist/catalog/components/alert-dialog.js +2 -0
  121. package/dist/catalog/components/alert-dialog.js.map +1 -0
  122. package/dist/catalog/components/alignment-picker.d.ts +11 -0
  123. package/dist/catalog/components/alignment-picker.d.ts.map +1 -0
  124. package/dist/catalog/components/alignment-picker.js +12 -0
  125. package/dist/catalog/components/alignment-picker.js.map +1 -0
  126. package/dist/catalog/components/aspect-ratio.d.ts +7 -0
  127. package/dist/catalog/components/aspect-ratio.d.ts.map +1 -0
  128. package/dist/catalog/components/aspect-ratio.js +7 -0
  129. package/dist/catalog/components/aspect-ratio.js.map +1 -0
  130. package/dist/catalog/components/autocomplete.d.ts +13 -0
  131. package/dist/catalog/components/autocomplete.d.ts.map +1 -0
  132. package/dist/catalog/components/autocomplete.js +14 -0
  133. package/dist/catalog/components/autocomplete.js.map +1 -0
  134. package/dist/catalog/components/avatar.d.ts +7 -0
  135. package/dist/catalog/components/avatar.d.ts.map +1 -0
  136. package/dist/catalog/components/avatar.js +8 -0
  137. package/dist/catalog/components/avatar.js.map +1 -0
  138. package/dist/catalog/components/badge.d.ts +8 -0
  139. package/dist/catalog/components/badge.d.ts.map +1 -0
  140. package/dist/catalog/components/badge.js +9 -0
  141. package/dist/catalog/components/badge.js.map +1 -0
  142. package/dist/catalog/components/blockquote.d.ts +8 -0
  143. package/dist/catalog/components/blockquote.d.ts.map +1 -0
  144. package/dist/catalog/components/blockquote.js +9 -0
  145. package/dist/catalog/components/blockquote.js.map +1 -0
  146. package/dist/catalog/components/button.d.ts +29 -0
  147. package/dist/catalog/components/button.d.ts.map +1 -0
  148. package/dist/catalog/components/button.js +23 -0
  149. package/dist/catalog/components/button.js.map +1 -0
  150. package/dist/catalog/components/callout.d.ts +6 -0
  151. package/dist/catalog/components/callout.d.ts.map +1 -0
  152. package/dist/catalog/components/callout.js +7 -0
  153. package/dist/catalog/components/callout.js.map +1 -0
  154. package/dist/catalog/components/card.d.ts +4 -0
  155. package/dist/catalog/components/card.d.ts.map +1 -0
  156. package/dist/catalog/components/card.js +5 -0
  157. package/dist/catalog/components/card.js.map +1 -0
  158. package/dist/catalog/components/checkbox-cards.d.ts +7 -0
  159. package/dist/catalog/components/checkbox-cards.d.ts.map +1 -0
  160. package/dist/catalog/components/checkbox-cards.js +8 -0
  161. package/dist/catalog/components/checkbox-cards.js.map +1 -0
  162. package/dist/catalog/components/checkbox-group.d.ts +6 -0
  163. package/dist/catalog/components/checkbox-group.d.ts.map +1 -0
  164. package/dist/catalog/components/checkbox-group.js +7 -0
  165. package/dist/catalog/components/checkbox-group.js.map +1 -0
  166. package/dist/catalog/components/checkbox.d.ts +6 -0
  167. package/dist/catalog/components/checkbox.d.ts.map +1 -0
  168. package/dist/catalog/components/checkbox.js +7 -0
  169. package/dist/catalog/components/checkbox.js.map +1 -0
  170. package/dist/catalog/components/code.d.ts +9 -0
  171. package/dist/catalog/components/code.d.ts.map +1 -0
  172. package/dist/catalog/components/code.js +10 -0
  173. package/dist/catalog/components/code.js.map +1 -0
  174. package/dist/catalog/components/color-swatch.d.ts +5 -0
  175. package/dist/catalog/components/color-swatch.d.ts.map +1 -0
  176. package/dist/catalog/components/color-swatch.js +6 -0
  177. package/dist/catalog/components/color-swatch.js.map +1 -0
  178. package/dist/catalog/components/combobox.d.ts +13 -0
  179. package/dist/catalog/components/combobox.d.ts.map +1 -0
  180. package/dist/catalog/components/combobox.js +14 -0
  181. package/dist/catalog/components/combobox.js.map +1 -0
  182. package/dist/catalog/components/context-menu.d.ts +11 -0
  183. package/dist/catalog/components/context-menu.d.ts.map +1 -0
  184. package/dist/catalog/components/context-menu.js +12 -0
  185. package/dist/catalog/components/context-menu.js.map +1 -0
  186. package/dist/catalog/components/data-list.d.ts +5 -0
  187. package/dist/catalog/components/data-list.d.ts.map +1 -0
  188. package/dist/catalog/components/data-list.js +6 -0
  189. package/dist/catalog/components/data-list.js.map +1 -0
  190. package/dist/catalog/components/dialog.d.ts +2 -0
  191. package/dist/catalog/components/dialog.d.ts.map +1 -0
  192. package/dist/catalog/components/dialog.js +2 -0
  193. package/dist/catalog/components/dialog.js.map +1 -0
  194. package/dist/catalog/components/drawer.d.ts +4 -0
  195. package/dist/catalog/components/drawer.d.ts.map +1 -0
  196. package/dist/catalog/components/drawer.js +5 -0
  197. package/dist/catalog/components/drawer.js.map +1 -0
  198. package/dist/catalog/components/font-picker.d.ts +10 -0
  199. package/dist/catalog/components/font-picker.d.ts.map +1 -0
  200. package/dist/catalog/components/font-picker.js +11 -0
  201. package/dist/catalog/components/font-picker.js.map +1 -0
  202. package/dist/catalog/components/grid-size-picker.d.ts +11 -0
  203. package/dist/catalog/components/grid-size-picker.d.ts.map +1 -0
  204. package/dist/catalog/components/grid-size-picker.js +12 -0
  205. package/dist/catalog/components/grid-size-picker.js.map +1 -0
  206. package/dist/catalog/components/heading.d.ts +13 -0
  207. package/dist/catalog/components/heading.d.ts.map +1 -0
  208. package/dist/catalog/components/heading.js +9 -0
  209. package/dist/catalog/components/heading.js.map +1 -0
  210. package/dist/catalog/components/index.d.ts +56 -0
  211. package/dist/catalog/components/index.d.ts.map +1 -0
  212. package/dist/catalog/components/index.js +56 -0
  213. package/dist/catalog/components/index.js.map +1 -0
  214. package/dist/catalog/components/input.d.ts +11 -0
  215. package/dist/catalog/components/input.d.ts.map +1 -0
  216. package/dist/catalog/components/input.js +12 -0
  217. package/dist/catalog/components/input.js.map +1 -0
  218. package/dist/catalog/components/inset.d.ts +6 -0
  219. package/dist/catalog/components/inset.d.ts.map +1 -0
  220. package/dist/catalog/components/inset.js +7 -0
  221. package/dist/catalog/components/inset.js.map +1 -0
  222. package/dist/catalog/components/item.d.ts +11 -0
  223. package/dist/catalog/components/item.d.ts.map +1 -0
  224. package/dist/catalog/components/item.js +12 -0
  225. package/dist/catalog/components/item.js.map +1 -0
  226. package/dist/catalog/components/kbd.d.ts +4 -0
  227. package/dist/catalog/components/kbd.d.ts.map +1 -0
  228. package/dist/catalog/components/kbd.js +5 -0
  229. package/dist/catalog/components/kbd.js.map +1 -0
  230. package/dist/catalog/components/link.d.ts +10 -0
  231. package/dist/catalog/components/link.d.ts.map +1 -0
  232. package/dist/catalog/components/link.js +11 -0
  233. package/dist/catalog/components/link.js.map +1 -0
  234. package/dist/catalog/components/menu.d.ts +11 -0
  235. package/dist/catalog/components/menu.d.ts.map +1 -0
  236. package/dist/catalog/components/menu.js +12 -0
  237. package/dist/catalog/components/menu.js.map +1 -0
  238. package/dist/catalog/components/menubar.d.ts +11 -0
  239. package/dist/catalog/components/menubar.d.ts.map +1 -0
  240. package/dist/catalog/components/menubar.js +12 -0
  241. package/dist/catalog/components/menubar.js.map +1 -0
  242. package/dist/catalog/components/meter.d.ts +7 -0
  243. package/dist/catalog/components/meter.d.ts.map +1 -0
  244. package/dist/catalog/components/meter.js +8 -0
  245. package/dist/catalog/components/meter.js.map +1 -0
  246. package/dist/catalog/components/number-field.d.ts +8 -0
  247. package/dist/catalog/components/number-field.d.ts.map +1 -0
  248. package/dist/catalog/components/number-field.js +9 -0
  249. package/dist/catalog/components/number-field.js.map +1 -0
  250. package/dist/catalog/components/otp-field.d.ts +6 -0
  251. package/dist/catalog/components/otp-field.d.ts.map +1 -0
  252. package/dist/catalog/components/otp-field.js +7 -0
  253. package/dist/catalog/components/otp-field.js.map +1 -0
  254. package/dist/catalog/components/popover.d.ts +2 -0
  255. package/dist/catalog/components/popover.d.ts.map +1 -0
  256. package/dist/catalog/components/popover.js +2 -0
  257. package/dist/catalog/components/popover.js.map +1 -0
  258. package/dist/catalog/components/preview-card.d.ts +2 -0
  259. package/dist/catalog/components/preview-card.d.ts.map +1 -0
  260. package/dist/catalog/components/preview-card.js +2 -0
  261. package/dist/catalog/components/preview-card.js.map +1 -0
  262. package/dist/catalog/components/progress.d.ts +11 -0
  263. package/dist/catalog/components/progress.d.ts.map +1 -0
  264. package/dist/catalog/components/progress.js +12 -0
  265. package/dist/catalog/components/progress.js.map +1 -0
  266. package/dist/catalog/components/radio-cards.d.ts +7 -0
  267. package/dist/catalog/components/radio-cards.d.ts.map +1 -0
  268. package/dist/catalog/components/radio-cards.js +8 -0
  269. package/dist/catalog/components/radio-cards.js.map +1 -0
  270. package/dist/catalog/components/radio-group.d.ts +6 -0
  271. package/dist/catalog/components/radio-group.d.ts.map +1 -0
  272. package/dist/catalog/components/radio-group.js +7 -0
  273. package/dist/catalog/components/radio-group.js.map +1 -0
  274. package/dist/catalog/components/scroll-area.d.ts +5 -0
  275. package/dist/catalog/components/scroll-area.d.ts.map +1 -0
  276. package/dist/catalog/components/scroll-area.js +6 -0
  277. package/dist/catalog/components/scroll-area.js.map +1 -0
  278. package/dist/catalog/components/segmented-control.d.ts +7 -0
  279. package/dist/catalog/components/segmented-control.d.ts.map +1 -0
  280. package/dist/catalog/components/segmented-control.js +8 -0
  281. package/dist/catalog/components/segmented-control.js.map +1 -0
  282. package/dist/catalog/components/select.d.ts +15 -0
  283. package/dist/catalog/components/select.d.ts.map +1 -0
  284. package/dist/catalog/components/select.js +16 -0
  285. package/dist/catalog/components/select.js.map +1 -0
  286. package/dist/catalog/components/separator.d.ts +4 -0
  287. package/dist/catalog/components/separator.d.ts.map +1 -0
  288. package/dist/catalog/components/separator.js +5 -0
  289. package/dist/catalog/components/separator.js.map +1 -0
  290. package/dist/catalog/components/skeleton.d.ts +8 -0
  291. package/dist/catalog/components/skeleton.d.ts.map +1 -0
  292. package/dist/catalog/components/skeleton.js +8 -0
  293. package/dist/catalog/components/skeleton.js.map +1 -0
  294. package/dist/catalog/components/slider.d.ts +7 -0
  295. package/dist/catalog/components/slider.d.ts.map +1 -0
  296. package/dist/catalog/components/slider.js +8 -0
  297. package/dist/catalog/components/slider.js.map +1 -0
  298. package/dist/catalog/components/spinner.d.ts +8 -0
  299. package/dist/catalog/components/spinner.d.ts.map +1 -0
  300. package/dist/catalog/components/spinner.js +8 -0
  301. package/dist/catalog/components/spinner.js.map +1 -0
  302. package/dist/catalog/components/switch.d.ts +7 -0
  303. package/dist/catalog/components/switch.d.ts.map +1 -0
  304. package/dist/catalog/components/switch.js +8 -0
  305. package/dist/catalog/components/switch.js.map +1 -0
  306. package/dist/catalog/components/tab-nav.d.ts +8 -0
  307. package/dist/catalog/components/tab-nav.d.ts.map +1 -0
  308. package/dist/catalog/components/tab-nav.js +9 -0
  309. package/dist/catalog/components/tab-nav.js.map +1 -0
  310. package/dist/catalog/components/table.d.ts +23 -0
  311. package/dist/catalog/components/table.d.ts.map +1 -0
  312. package/dist/catalog/components/table.js +15 -0
  313. package/dist/catalog/components/table.js.map +1 -0
  314. package/dist/catalog/components/tabs.d.ts +8 -0
  315. package/dist/catalog/components/tabs.d.ts.map +1 -0
  316. package/dist/catalog/components/tabs.js +9 -0
  317. package/dist/catalog/components/tabs.js.map +1 -0
  318. package/dist/catalog/components/text-area.d.ts +8 -0
  319. package/dist/catalog/components/text-area.d.ts.map +1 -0
  320. package/dist/catalog/components/text-area.js +9 -0
  321. package/dist/catalog/components/text-area.js.map +1 -0
  322. package/dist/catalog/components/text.d.ts +13 -0
  323. package/dist/catalog/components/text.d.ts.map +1 -0
  324. package/dist/catalog/components/text.js +9 -0
  325. package/dist/catalog/components/text.js.map +1 -0
  326. package/dist/catalog/components/toast.d.ts +7 -0
  327. package/dist/catalog/components/toast.d.ts.map +1 -0
  328. package/dist/catalog/components/toast.js +8 -0
  329. package/dist/catalog/components/toast.js.map +1 -0
  330. package/dist/catalog/components/toggle-group.d.ts +9 -0
  331. package/dist/catalog/components/toggle-group.d.ts.map +1 -0
  332. package/dist/catalog/components/toggle-group.js +10 -0
  333. package/dist/catalog/components/toggle-group.js.map +1 -0
  334. package/dist/catalog/components/toggle.d.ts +9 -0
  335. package/dist/catalog/components/toggle.d.ts.map +1 -0
  336. package/dist/catalog/components/toggle.js +10 -0
  337. package/dist/catalog/components/toggle.js.map +1 -0
  338. package/dist/catalog/components/toolbar.d.ts +5 -0
  339. package/dist/catalog/components/toolbar.d.ts.map +1 -0
  340. package/dist/catalog/components/toolbar.js +6 -0
  341. package/dist/catalog/components/toolbar.js.map +1 -0
  342. package/dist/catalog/css-inputs.d.ts +258 -0
  343. package/dist/catalog/css-inputs.d.ts.map +1 -0
  344. package/dist/catalog/css-inputs.js +232 -0
  345. package/dist/catalog/css-inputs.js.map +1 -0
  346. package/dist/catalog/index.d.ts +6 -0
  347. package/dist/catalog/index.d.ts.map +1 -0
  348. package/dist/catalog/index.js +4 -0
  349. package/dist/catalog/index.js.map +1 -0
  350. package/dist/catalog/parts.d.ts +40 -0
  351. package/dist/catalog/parts.d.ts.map +1 -0
  352. package/dist/catalog/parts.js +971 -0
  353. package/dist/catalog/parts.js.map +1 -0
  354. package/dist/catalog/prop-types-source.d.ts +11 -0
  355. package/dist/catalog/prop-types-source.d.ts.map +1 -0
  356. package/dist/catalog/prop-types-source.js +75 -0
  357. package/dist/catalog/prop-types-source.js.map +1 -0
  358. package/dist/catalog/prop-types.generated.d.ts +1155 -0
  359. package/dist/catalog/prop-types.generated.d.ts.map +1 -0
  360. package/dist/catalog/prop-types.generated.js +3 -0
  361. package/dist/catalog/prop-types.generated.js.map +1 -0
  362. package/dist/catalog/props.d.ts +87 -0
  363. package/dist/catalog/props.d.ts.map +1 -0
  364. package/dist/catalog/props.js +142 -0
  365. package/dist/catalog/props.js.map +1 -0
  366. package/dist/css.d.ts +38 -0
  367. package/dist/css.d.ts.map +1 -0
  368. package/dist/css.js +257 -0
  369. package/dist/css.js.map +1 -0
  370. package/dist/generated-css.d.ts +6 -0
  371. package/dist/generated-css.d.ts.map +1 -0
  372. package/dist/generated-css.js +19 -0
  373. package/dist/generated-css.js.map +1 -0
  374. package/dist/index.d.ts +9 -0
  375. package/dist/index.d.ts.map +1 -0
  376. package/dist/index.js +9 -0
  377. package/dist/index.js.map +1 -0
  378. package/dist/model/compare.d.ts +40 -0
  379. package/dist/model/compare.d.ts.map +1 -0
  380. package/dist/model/compare.js +83 -0
  381. package/dist/model/compare.js.map +1 -0
  382. package/dist/model/dom.d.ts +60 -0
  383. package/dist/model/dom.d.ts.map +1 -0
  384. package/dist/model/dom.js +192 -0
  385. package/dist/model/dom.js.map +1 -0
  386. package/dist/model/ids.d.ts +8 -0
  387. package/dist/model/ids.d.ts.map +1 -0
  388. package/dist/model/ids.js +25 -0
  389. package/dist/model/ids.js.map +1 -0
  390. package/dist/model/index.d.ts +8 -0
  391. package/dist/model/index.d.ts.map +1 -0
  392. package/dist/model/index.js +8 -0
  393. package/dist/model/index.js.map +1 -0
  394. package/dist/model/parts.d.ts +18 -0
  395. package/dist/model/parts.d.ts.map +1 -0
  396. package/dist/model/parts.js +91 -0
  397. package/dist/model/parts.js.map +1 -0
  398. package/dist/model/styles.d.ts +59 -0
  399. package/dist/model/styles.d.ts.map +1 -0
  400. package/dist/model/styles.js +191 -0
  401. package/dist/model/styles.js.map +1 -0
  402. package/dist/model/types.d.ts +96 -0
  403. package/dist/model/types.d.ts.map +1 -0
  404. package/dist/model/types.js +2 -0
  405. package/dist/model/types.js.map +1 -0
  406. package/dist/model/validate.d.ts +54 -0
  407. package/dist/model/validate.d.ts.map +1 -0
  408. package/dist/model/validate.js +92 -0
  409. package/dist/model/validate.js.map +1 -0
  410. package/dist/themes/appearances.d.ts +98 -0
  411. package/dist/themes/appearances.d.ts.map +1 -0
  412. package/dist/themes/appearances.js +98 -0
  413. package/dist/themes/appearances.js.map +1 -0
  414. package/dist/themes/baseline.d.ts +9 -0
  415. package/dist/themes/baseline.d.ts.map +1 -0
  416. package/dist/themes/baseline.js +21 -0
  417. package/dist/themes/baseline.js.map +1 -0
  418. package/dist/themes/index.d.ts +15 -0
  419. package/dist/themes/index.d.ts.map +1 -0
  420. package/dist/themes/index.js +68 -0
  421. package/dist/themes/index.js.map +1 -0
  422. package/dist/themes/reference.d.ts +7 -0
  423. package/dist/themes/reference.d.ts.map +1 -0
  424. package/dist/themes/reference.js +9 -0
  425. package/dist/themes/reference.js.map +1 -0
  426. package/dist/themes/shadcn.d.ts +21 -0
  427. package/dist/themes/shadcn.d.ts.map +1 -0
  428. package/dist/themes/shadcn.js +189 -0
  429. package/dist/themes/shadcn.js.map +1 -0
  430. package/dist/themes/types.d.ts +58 -0
  431. package/dist/themes/types.d.ts.map +1 -0
  432. package/dist/themes/types.js +2 -0
  433. package/dist/themes/types.js.map +1 -0
  434. package/dist/tokens/at.d.ts +6 -0
  435. package/dist/tokens/at.d.ts.map +1 -0
  436. package/dist/tokens/at.js +12 -0
  437. package/dist/tokens/at.js.map +1 -0
  438. package/dist/tokens/base.d.ts +21 -0
  439. package/dist/tokens/base.d.ts.map +1 -0
  440. package/dist/tokens/base.js +43 -0
  441. package/dist/tokens/base.js.map +1 -0
  442. package/dist/tokens/color/bezier.d.ts +2 -0
  443. package/dist/tokens/color/bezier.d.ts.map +1 -0
  444. package/dist/tokens/color/bezier.js +79 -0
  445. package/dist/tokens/color/bezier.js.map +1 -0
  446. package/dist/tokens/color/index.d.ts +3 -0
  447. package/dist/tokens/color/index.d.ts.map +1 -0
  448. package/dist/tokens/color/index.js +3 -0
  449. package/dist/tokens/color/index.js.map +1 -0
  450. package/dist/tokens/color/radix-generator.d.ts +31 -0
  451. package/dist/tokens/color/radix-generator.d.ts.map +1 -0
  452. package/dist/tokens/color/radix-generator.js +311 -0
  453. package/dist/tokens/color/radix-generator.js.map +1 -0
  454. package/dist/tokens/component-inputs.d.ts +15 -0
  455. package/dist/tokens/component-inputs.d.ts.map +1 -0
  456. package/dist/tokens/component-inputs.js +119 -0
  457. package/dist/tokens/component-inputs.js.map +1 -0
  458. package/dist/tokens/dtcg.d.ts +59 -0
  459. package/dist/tokens/dtcg.d.ts.map +1 -0
  460. package/dist/tokens/dtcg.js +214 -0
  461. package/dist/tokens/dtcg.js.map +1 -0
  462. package/dist/tokens/files/components.tokens.json +184 -0
  463. package/dist/tokens/files/foundations.tokens.json +322 -0
  464. package/dist/tokens/files/palette.tokens.json +58 -0
  465. package/dist/tokens/files/text-styles.tokens.json +158 -0
  466. package/dist/tokens/files/themes/agent-native.dark.tokens.json +391 -0
  467. package/dist/tokens/files/themes/agent-native.light.tokens.json +391 -0
  468. package/dist/tokens/files/themes/analytics.dark.tokens.json +391 -0
  469. package/dist/tokens/files/themes/analytics.light.tokens.json +391 -0
  470. package/dist/tokens/files/themes/assets.dark.tokens.json +391 -0
  471. package/dist/tokens/files/themes/assets.light.tokens.json +391 -0
  472. package/dist/tokens/files/themes/brain.dark.tokens.json +391 -0
  473. package/dist/tokens/files/themes/brain.light.tokens.json +391 -0
  474. package/dist/tokens/files/themes/calendar.dark.tokens.json +391 -0
  475. package/dist/tokens/files/themes/calendar.light.tokens.json +391 -0
  476. package/dist/tokens/files/themes/chat.dark.tokens.json +391 -0
  477. package/dist/tokens/files/themes/chat.light.tokens.json +391 -0
  478. package/dist/tokens/files/themes/clips.dark.tokens.json +391 -0
  479. package/dist/tokens/files/themes/clips.light.tokens.json +391 -0
  480. package/dist/tokens/files/themes/content.dark.tokens.json +391 -0
  481. package/dist/tokens/files/themes/content.light.tokens.json +391 -0
  482. package/dist/tokens/files/themes/crm.dark.tokens.json +391 -0
  483. package/dist/tokens/files/themes/crm.light.tokens.json +391 -0
  484. package/dist/tokens/files/themes/design.dark.tokens.json +391 -0
  485. package/dist/tokens/files/themes/design.light.tokens.json +391 -0
  486. package/dist/tokens/files/themes/desktop.dark.tokens.json +391 -0
  487. package/dist/tokens/files/themes/desktop.light.tokens.json +391 -0
  488. package/dist/tokens/files/themes/dispatch.dark.tokens.json +391 -0
  489. package/dist/tokens/files/themes/dispatch.light.tokens.json +391 -0
  490. package/dist/tokens/files/themes/docs.dark.tokens.json +391 -0
  491. package/dist/tokens/files/themes/docs.light.tokens.json +391 -0
  492. package/dist/tokens/files/themes/factory.dark.tokens.json +391 -0
  493. package/dist/tokens/files/themes/factory.light.tokens.json +391 -0
  494. package/dist/tokens/files/themes/forms.dark.tokens.json +391 -0
  495. package/dist/tokens/files/themes/forms.light.tokens.json +391 -0
  496. package/dist/tokens/files/themes/mail.dark.tokens.json +391 -0
  497. package/dist/tokens/files/themes/mail.light.tokens.json +391 -0
  498. package/dist/tokens/files/themes/plan.dark.tokens.json +391 -0
  499. package/dist/tokens/files/themes/plan.light.tokens.json +391 -0
  500. package/dist/tokens/files/themes/slides.dark.tokens.json +391 -0
  501. package/dist/tokens/files/themes/slides.light.tokens.json +391 -0
  502. package/dist/tokens/files/themes/tasks.dark.tokens.json +391 -0
  503. package/dist/tokens/files/themes/tasks.light.tokens.json +391 -0
  504. package/dist/tokens/palette.d.ts +46 -0
  505. package/dist/tokens/palette.d.ts.map +1 -0
  506. package/dist/tokens/palette.js +223 -0
  507. package/dist/tokens/palette.js.map +1 -0
  508. package/dist/tokens/primitives.d.ts +52 -0
  509. package/dist/tokens/primitives.d.ts.map +1 -0
  510. package/dist/tokens/primitives.js +80 -0
  511. package/dist/tokens/primitives.js.map +1 -0
  512. package/dist/tokens/roles.d.ts +37 -0
  513. package/dist/tokens/roles.d.ts.map +1 -0
  514. package/dist/tokens/roles.js +208 -0
  515. package/dist/tokens/roles.js.map +1 -0
  516. package/dist/tokens/round-trip.d.ts +50 -0
  517. package/dist/tokens/round-trip.d.ts.map +1 -0
  518. package/dist/tokens/round-trip.js +226 -0
  519. package/dist/tokens/round-trip.js.map +1 -0
  520. package/dist/tokens/source.d.ts +111 -0
  521. package/dist/tokens/source.d.ts.map +1 -0
  522. package/dist/tokens/source.js +311 -0
  523. package/dist/tokens/source.js.map +1 -0
  524. package/package.json +21 -15
  525. package/src/catalog/components/alert-dialog.ts +1 -9
  526. package/src/catalog/components/alignment-picker.ts +16 -0
  527. package/src/catalog/components/autocomplete.ts +2 -2
  528. package/src/catalog/components/avatar.ts +0 -3
  529. package/src/catalog/components/badge.ts +0 -2
  530. package/src/catalog/components/blockquote.ts +1 -2
  531. package/src/catalog/components/button.ts +14 -2
  532. package/src/catalog/components/callout.ts +1 -11
  533. package/src/catalog/components/card.ts +1 -6
  534. package/src/catalog/components/checkbox-cards.ts +1 -7
  535. package/src/catalog/components/checkbox-group.ts +1 -7
  536. package/src/catalog/components/checkbox.ts +1 -7
  537. package/src/catalog/components/code.ts +0 -5
  538. package/src/catalog/components/color-swatch.ts +6 -0
  539. package/src/catalog/components/combobox.ts +2 -2
  540. package/src/catalog/components/context-menu.ts +1 -3
  541. package/src/catalog/components/data-list.ts +0 -1
  542. package/src/catalog/components/dialog.ts +1 -9
  543. package/src/catalog/components/font-picker.ts +11 -0
  544. package/src/catalog/components/grid-size-picker.ts +12 -0
  545. package/src/catalog/components/heading.ts +10 -1
  546. package/src/catalog/components/index.ts +4 -3
  547. package/src/catalog/components/input.ts +2 -2
  548. package/src/catalog/components/item.ts +1 -6
  549. package/src/catalog/components/kbd.ts +1 -5
  550. package/src/catalog/components/link.ts +1 -5
  551. package/src/catalog/components/menu.ts +1 -3
  552. package/src/catalog/components/menubar.ts +1 -3
  553. package/src/catalog/components/meter.ts +0 -6
  554. package/src/catalog/components/number-field.ts +8 -3
  555. package/src/catalog/components/otp-field.ts +1 -3
  556. package/src/catalog/components/popover.ts +1 -9
  557. package/src/catalog/components/preview-card.ts +1 -9
  558. package/src/catalog/components/progress.ts +0 -6
  559. package/src/catalog/components/radio-cards.ts +1 -7
  560. package/src/catalog/components/radio-group.ts +1 -7
  561. package/src/catalog/components/scroll-area.ts +0 -5
  562. package/src/catalog/components/segmented-control.ts +2 -2
  563. package/src/catalog/components/select.ts +3 -3
  564. package/src/catalog/components/separator.ts +0 -5
  565. package/src/catalog/components/slider.ts +0 -6
  566. package/src/catalog/components/spinner.ts +0 -7
  567. package/src/catalog/components/switch.ts +0 -6
  568. package/src/catalog/components/tab-nav.ts +0 -1
  569. package/src/catalog/components/table.ts +0 -5
  570. package/src/catalog/components/tabs.ts +0 -1
  571. package/src/catalog/components/text-area.ts +2 -2
  572. package/src/catalog/components/text.ts +5 -0
  573. package/src/catalog/components/toggle-group.ts +3 -3
  574. package/src/catalog/components/toggle.ts +2 -2
  575. package/src/catalog/components/toolbar.ts +2 -2
  576. package/src/catalog/css-inputs.ts +261 -0
  577. package/src/catalog/index.ts +1 -0
  578. package/src/catalog/parts.ts +292 -49
  579. package/src/catalog/prop-types-source.ts +1 -1
  580. package/src/catalog/prop-types.generated.ts +179 -277
  581. package/src/catalog/props.ts +29 -11
  582. package/src/css.ts +115 -31
  583. package/src/generated-css.ts +12 -8
  584. package/src/model/compare.ts +11 -11
  585. package/src/model/dom.ts +30 -30
  586. package/src/model/index.ts +1 -0
  587. package/src/model/parts.ts +114 -0
  588. package/src/model/styles.ts +28 -28
  589. package/src/model/types.ts +2 -2
  590. package/src/model/validate.ts +4 -13
  591. package/src/themes/index.ts +13 -9
  592. package/src/themes/shadcn.ts +1 -1
  593. package/src/tokens/component-inputs.ts +165 -0
  594. package/src/tokens/files/components.tokens.json +184 -0
  595. package/src/tokens/files/foundations.tokens.json +5 -1
  596. package/src/tokens/files/text-styles.tokens.json +158 -0
  597. package/src/tokens/files/themes/agent-native.dark.tokens.json +0 -14
  598. package/src/tokens/files/themes/agent-native.light.tokens.json +0 -14
  599. package/src/tokens/primitives.ts +28 -3
  600. package/src/tokens/roles.ts +6 -6
  601. package/src/tokens/round-trip.ts +46 -1
  602. package/src/tokens/source.ts +114 -2
  603. package/css/parts/em.css +0 -16
  604. package/css/parts/quote.css +0 -18
  605. package/css/parts/strong.css +0 -15
  606. package/src/catalog/components/em.ts +0 -7
  607. package/src/catalog/components/quote.ts +0 -7
  608. package/src/catalog/components/strong.ts +0 -7
@@ -0,0 +1,311 @@
1
+ import { at } from "./at.js";
2
+ import { COMPONENTS_FILE, readSwitchComponent } from "./component-inputs.js";
3
+ import { flattenTokens, TokenError, TokenReader } from "./dtcg.js";
4
+ import componentsFile from "./files/components.tokens.json" with { type: "json" };
5
+ import foundationsFile from "./files/foundations.tokens.json" with { type: "json" };
6
+ import paletteFile from "./files/palette.tokens.json" with { type: "json" };
7
+ import textStylesFile from "./files/text-styles.tokens.json" with { type: "json" };
8
+ import agentNativeDark from "./files/themes/agent-native.dark.tokens.json" with { type: "json" };
9
+ import agentNativeLight from "./files/themes/agent-native.light.tokens.json" with { type: "json" };
10
+ import analyticsDark from "./files/themes/analytics.dark.tokens.json" with { type: "json" };
11
+ import analyticsLight from "./files/themes/analytics.light.tokens.json" with { type: "json" };
12
+ import assetsDark from "./files/themes/assets.dark.tokens.json" with { type: "json" };
13
+ import assetsLight from "./files/themes/assets.light.tokens.json" with { type: "json" };
14
+ import brainDark from "./files/themes/brain.dark.tokens.json" with { type: "json" };
15
+ import brainLight from "./files/themes/brain.light.tokens.json" with { type: "json" };
16
+ import calendarDark from "./files/themes/calendar.dark.tokens.json" with { type: "json" };
17
+ import calendarLight from "./files/themes/calendar.light.tokens.json" with { type: "json" };
18
+ import chatDark from "./files/themes/chat.dark.tokens.json" with { type: "json" };
19
+ import chatLight from "./files/themes/chat.light.tokens.json" with { type: "json" };
20
+ import clipsDark from "./files/themes/clips.dark.tokens.json" with { type: "json" };
21
+ import clipsLight from "./files/themes/clips.light.tokens.json" with { type: "json" };
22
+ import contentDark from "./files/themes/content.dark.tokens.json" with { type: "json" };
23
+ import contentLight from "./files/themes/content.light.tokens.json" with { type: "json" };
24
+ import crmDark from "./files/themes/crm.dark.tokens.json" with { type: "json" };
25
+ import crmLight from "./files/themes/crm.light.tokens.json" with { type: "json" };
26
+ import designDark from "./files/themes/design.dark.tokens.json" with { type: "json" };
27
+ import designLight from "./files/themes/design.light.tokens.json" with { type: "json" };
28
+ import desktopDark from "./files/themes/desktop.dark.tokens.json" with { type: "json" };
29
+ import desktopLight from "./files/themes/desktop.light.tokens.json" with { type: "json" };
30
+ import dispatchDark from "./files/themes/dispatch.dark.tokens.json" with { type: "json" };
31
+ import dispatchLight from "./files/themes/dispatch.light.tokens.json" with { type: "json" };
32
+ import docsDark from "./files/themes/docs.dark.tokens.json" with { type: "json" };
33
+ import docsLight from "./files/themes/docs.light.tokens.json" with { type: "json" };
34
+ import factoryDark from "./files/themes/factory.dark.tokens.json" with { type: "json" };
35
+ import factoryLight from "./files/themes/factory.light.tokens.json" with { type: "json" };
36
+ import formsDark from "./files/themes/forms.dark.tokens.json" with { type: "json" };
37
+ import formsLight from "./files/themes/forms.light.tokens.json" with { type: "json" };
38
+ import mailDark from "./files/themes/mail.dark.tokens.json" with { type: "json" };
39
+ import mailLight from "./files/themes/mail.light.tokens.json" with { type: "json" };
40
+ import planDark from "./files/themes/plan.dark.tokens.json" with { type: "json" };
41
+ import planLight from "./files/themes/plan.light.tokens.json" with { type: "json" };
42
+ import slidesDark from "./files/themes/slides.dark.tokens.json" with { type: "json" };
43
+ import slidesLight from "./files/themes/slides.light.tokens.json" with { type: "json" };
44
+ import tasksDark from "./files/themes/tasks.dark.tokens.json" with { type: "json" };
45
+ import tasksLight from "./files/themes/tasks.light.tokens.json" with { type: "json" };
46
+ export const TOKEN_FILES = {
47
+ "foundations.tokens.json": foundationsFile,
48
+ "palette.tokens.json": paletteFile,
49
+ [COMPONENTS_FILE]: componentsFile,
50
+ "text-styles.tokens.json": textStylesFile,
51
+ "themes/agent-native.light.tokens.json": agentNativeLight,
52
+ "themes/agent-native.dark.tokens.json": agentNativeDark,
53
+ "themes/analytics.light.tokens.json": analyticsLight,
54
+ "themes/analytics.dark.tokens.json": analyticsDark,
55
+ "themes/assets.light.tokens.json": assetsLight,
56
+ "themes/assets.dark.tokens.json": assetsDark,
57
+ "themes/brain.light.tokens.json": brainLight,
58
+ "themes/brain.dark.tokens.json": brainDark,
59
+ "themes/calendar.light.tokens.json": calendarLight,
60
+ "themes/calendar.dark.tokens.json": calendarDark,
61
+ "themes/chat.light.tokens.json": chatLight,
62
+ "themes/chat.dark.tokens.json": chatDark,
63
+ "themes/clips.light.tokens.json": clipsLight,
64
+ "themes/clips.dark.tokens.json": clipsDark,
65
+ "themes/content.light.tokens.json": contentLight,
66
+ "themes/content.dark.tokens.json": contentDark,
67
+ "themes/crm.light.tokens.json": crmLight,
68
+ "themes/crm.dark.tokens.json": crmDark,
69
+ "themes/design.light.tokens.json": designLight,
70
+ "themes/design.dark.tokens.json": designDark,
71
+ "themes/desktop.light.tokens.json": desktopLight,
72
+ "themes/desktop.dark.tokens.json": desktopDark,
73
+ "themes/dispatch.light.tokens.json": dispatchLight,
74
+ "themes/dispatch.dark.tokens.json": dispatchDark,
75
+ "themes/docs.light.tokens.json": docsLight,
76
+ "themes/docs.dark.tokens.json": docsDark,
77
+ "themes/factory.light.tokens.json": factoryLight,
78
+ "themes/factory.dark.tokens.json": factoryDark,
79
+ "themes/forms.light.tokens.json": formsLight,
80
+ "themes/forms.dark.tokens.json": formsDark,
81
+ "themes/mail.light.tokens.json": mailLight,
82
+ "themes/mail.dark.tokens.json": mailDark,
83
+ "themes/plan.light.tokens.json": planLight,
84
+ "themes/plan.dark.tokens.json": planDark,
85
+ "themes/slides.light.tokens.json": slidesLight,
86
+ "themes/slides.dark.tokens.json": slidesDark,
87
+ "themes/tasks.light.tokens.json": tasksLight,
88
+ "themes/tasks.dark.tokens.json": tasksDark,
89
+ };
90
+ export const FOUNDATIONS_FILE = "foundations.tokens.json";
91
+ export const PALETTE_FILE = "palette.tokens.json";
92
+ export const TEXT_STYLES_FILE = "text-styles.tokens.json";
93
+ export const THEME_NAMES = [
94
+ "agent-native",
95
+ "analytics",
96
+ "assets",
97
+ "brain",
98
+ "calendar",
99
+ "chat",
100
+ "clips",
101
+ "content",
102
+ "crm",
103
+ "design",
104
+ "desktop",
105
+ "dispatch",
106
+ "docs",
107
+ "factory",
108
+ "forms",
109
+ "mail",
110
+ "plan",
111
+ "slides",
112
+ "tasks",
113
+ ];
114
+ export const THEME_MODES = ["light", "dark"];
115
+ export const themeFile = (name, mode) => `themes/${name}.${mode}.tokens.json`;
116
+ const FONT_WEIGHT_NAMES = [
117
+ "light",
118
+ "regular",
119
+ "medium",
120
+ "strong",
121
+ "semibold",
122
+ "bold",
123
+ ];
124
+ const FONT_FAMILY_NAMES = ["sans", "heading", "mono", "wordmark"];
125
+ function isTextStyleName(name) {
126
+ return Object.hasOwn(textStylesFile["text-style"], name);
127
+ }
128
+ /** Each text style's name, in the order the file lists them. */
129
+ export const TEXT_STYLE_NAMES = Object.keys(textStylesFile["text-style"]).filter(isTextStyleName);
130
+ /** The type scale starts at step 0, the 10px step below the 12px UI base. */
131
+ export const TYPE_FIRST_STEP = 0;
132
+ function steps(reader, group, first = 1) {
133
+ const numbers = reader
134
+ .paths()
135
+ .filter((tokenPath) => tokenPath.startsWith(`${group}.`))
136
+ .map((tokenPath) => Number(tokenPath.slice(group.length + 1)))
137
+ .sort((a, b) => a - b);
138
+ numbers.forEach((step, index) => {
139
+ if (step !== index + first) {
140
+ throw new TokenError(reader.file, `${group}.${index + first}`, "is missing");
141
+ }
142
+ });
143
+ return numbers.map((step) => reader.number(`${group}.${step}`));
144
+ }
145
+ function file(files, path) {
146
+ if (!(path in files))
147
+ throw new TokenError(path, "(file)", "is missing");
148
+ return files[path];
149
+ }
150
+ function readFoundations(files) {
151
+ const foundations = new TokenReader(FOUNDATIONS_FILE, file(files, FOUNDATIONS_FILE));
152
+ const typeSizes = steps(foundations, "font.size", TYPE_FIRST_STEP);
153
+ const lineHeights = steps(foundations, "font.line-height", TYPE_FIRST_STEP);
154
+ const letterSpacings = steps(foundations, "font.letter-spacing", TYPE_FIRST_STEP);
155
+ if (lineHeights.length !== typeSizes.length ||
156
+ letterSpacings.length !== typeSizes.length) {
157
+ throw new TokenError(FOUNDATIONS_FILE, "font", "has steps of different lengths");
158
+ }
159
+ return {
160
+ controlHeights: steps(foundations, "size.control"),
161
+ controlIconSizes: steps(foundations, "size.control-icon"),
162
+ sizeRamp: steps(foundations, "size.box"),
163
+ radiusSteps: steps(foundations, "radius"),
164
+ typeRamp: typeSizes.map((size, index) => ({
165
+ step: index + TYPE_FIRST_STEP,
166
+ size,
167
+ lineHeight: at(lineHeights, index),
168
+ letterSpacing: `${at(letterSpacings, index)}em`,
169
+ })),
170
+ fontWeights: Object.fromEntries(FONT_WEIGHT_NAMES.map((name) => [
171
+ name,
172
+ foundations.number(`font.weight.${name}`),
173
+ ])),
174
+ fontFamilies: Object.fromEntries(FONT_FAMILY_NAMES.map((name) => [
175
+ name,
176
+ foundations.string(`font.family.${name}`),
177
+ ])),
178
+ };
179
+ }
180
+ const TEXT_STYLE_PREFIX = "text-style.";
181
+ const TEXT_STYLE_PARTS = [
182
+ ["fontSize", "size"],
183
+ ["lineHeight", "line-height"],
184
+ ["letterSpacing", "letter-spacing"],
185
+ ];
186
+ function isOneOf(values, value) {
187
+ return values.some((candidate) => candidate === value);
188
+ }
189
+ function readTextStyles(files, steps) {
190
+ const tokens = flattenTokens(file(files, TEXT_STYLES_FILE), TEXT_STYLES_FILE);
191
+ const styles = [];
192
+ for (const [tokenPath, token] of tokens) {
193
+ const fail = (problem) => {
194
+ throw new TokenError(TEXT_STYLES_FILE, tokenPath, problem);
195
+ };
196
+ if (!tokenPath.startsWith(TEXT_STYLE_PREFIX))
197
+ fail("is not a text-style.*");
198
+ const name = tokenPath.slice(TEXT_STYLE_PREFIX.length);
199
+ if (!isTextStyleName(name))
200
+ fail("is not a style text-styles.tokens.json names");
201
+ if (String(token.$type) !== "typography")
202
+ fail("is not a typography token");
203
+ const description = token.$description ?? "";
204
+ if (description.trim() === "")
205
+ fail("has no $description");
206
+ const value = token.$value;
207
+ if (typeof value !== "object" || value === null)
208
+ fail("has no value");
209
+ const fields = new Map(Object.entries(value));
210
+ const alias = (key, group) => {
211
+ const raw = fields.get(key);
212
+ const match = typeof raw === "string"
213
+ ? new RegExp(`^\\{font\\.${group}\\.([a-z0-9-]+)\\}$`).exec(raw)
214
+ : null;
215
+ const target = match?.at(1);
216
+ return target ?? fail(`${key} is not an alias of a font.${group} token`);
217
+ };
218
+ const [first, ...rest] = TEXT_STYLE_PARTS.map(([key, group]) => Number(alias(key, group)));
219
+ if (first === undefined || !steps.has(first)) {
220
+ fail("fontSize is not a step of the type scale");
221
+ }
222
+ if (rest.some((step) => step !== first)) {
223
+ fail("sets its size, line height and letter spacing from different steps");
224
+ }
225
+ const weight = alias("fontWeight", "weight");
226
+ const family = alias("fontFamily", "family");
227
+ if (!isOneOf(FONT_WEIGHT_NAMES, weight))
228
+ fail(`fontWeight ${weight} is not a weight`);
229
+ if (!isOneOf(FONT_FAMILY_NAMES, family))
230
+ fail(`fontFamily ${family} is not a family`);
231
+ styles.push({ name, description, step: first, weight, family });
232
+ }
233
+ if (styles.length === 0) {
234
+ throw new TokenError(TEXT_STYLES_FILE, "text-style", "has no text styles");
235
+ }
236
+ return styles;
237
+ }
238
+ function readPalette(files) {
239
+ const palette = new TokenReader(PALETTE_FILE, file(files, PALETTE_FILE));
240
+ return {
241
+ brand: palette.hex("brand"),
242
+ gray: palette.hex("gray"),
243
+ background: {
244
+ light: palette.hex("background.light"),
245
+ dark: palette.hex("background.dark"),
246
+ },
247
+ status: {
248
+ danger: palette.string("status.danger"),
249
+ warning: palette.string("status.warning"),
250
+ success: palette.string("status.success"),
251
+ info: palette.string("status.info"),
252
+ },
253
+ };
254
+ }
255
+ function readThemeMode(files, name, mode) {
256
+ const path = themeFile(name, mode);
257
+ const reader = new TokenReader(path, file(files, path));
258
+ const values = {};
259
+ for (const tokenPath of reader.paths()) {
260
+ if (tokenPath.startsWith("color.")) {
261
+ values[tokenPath.slice("color.".length)] = reader.hslTriplet(tokenPath);
262
+ }
263
+ else if (tokenPath === "radius") {
264
+ values.radius = `${reader.number("radius") / 16}rem`;
265
+ }
266
+ else {
267
+ throw new TokenError(path, tokenPath, "is not a theme value (color.* or radius)");
268
+ }
269
+ }
270
+ return values;
271
+ }
272
+ /**
273
+ * Everything code reads from a set of token files. Throws a `TokenError` on
274
+ * the first file that is missing a token or holds one of the wrong shape.
275
+ */
276
+ export function readTokenFiles(files) {
277
+ const foundations = readFoundations(files);
278
+ return {
279
+ foundations,
280
+ switchCssInputs: readSwitchComponent(file(files, COMPONENTS_FILE)).inputs,
281
+ textStyles: readTextStyles(files, new Set(foundations.typeRamp.map(({ step }) => step))),
282
+ palette: readPalette(files),
283
+ themes: Object.fromEntries(THEME_NAMES.map((name) => [
284
+ name,
285
+ {
286
+ light: readThemeMode(files, name, "light"),
287
+ dark: readThemeMode(files, name, "dark"),
288
+ },
289
+ ])),
290
+ };
291
+ }
292
+ const tokens = readTokenFiles(TOKEN_FILES);
293
+ export const FOUNDATIONS = tokens.foundations;
294
+ export const TEXT_STYLE_DEFINITIONS = tokens.textStyles;
295
+ export const PALETTE_DEFAULTS = tokens.palette;
296
+ /**
297
+ * A theme's values from its light and dark token files. The appearance it
298
+ * renders with no class is `base`; the other carries only what differs.
299
+ */
300
+ export function tokenThemeValues(name, defaultAppearance) {
301
+ const modes = tokens.themes[name];
302
+ if (!modes)
303
+ throw new Error(`No token files for theme ${name}`);
304
+ const base = modes[defaultAppearance];
305
+ const other = modes[defaultAppearance === "light" ? "dark" : "light"];
306
+ const differs = Object.fromEntries(Object.entries(other).filter(([key, value]) => base[key] !== value));
307
+ return defaultAppearance === "light"
308
+ ? { base, dark: differs }
309
+ : { base, light: differs };
310
+ }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design tokens, brand color generation, and component CSS for Agent-Native apps.",
3
+ "version": "0.237.1",
4
+ "description": "Themable design tokens, brand color generation, and component CSS for Agent-Native apps.",
5
5
  "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/BuilderIO/agent-native",
9
+ "directory": "packages/design-system"
10
+ },
6
11
  "files": [
7
12
  "css",
8
13
  "dist",
@@ -36,6 +41,7 @@
36
41
  "./tokens.css": "./css/tokens.css",
37
42
  "./main.css": "./css/main.css",
38
43
  "./styles.css": "./css/styles.css",
44
+ "./components/*.css": "./css/components/*.css",
39
45
  "./themes/*.css": "./css/themes/*.css",
40
46
  "./appearances.css": "./css/appearances.css",
41
47
  "./package.json": "./package.json"
@@ -44,6 +50,17 @@
44
50
  "access": "public",
45
51
  "provenance": true
46
52
  },
53
+ "dependencies": {
54
+ "@radix-ui/colors": "^3.0.0",
55
+ "colorjs.io": "^0.7.1"
56
+ },
57
+ "devDependencies": {
58
+ "@types/node": "^24.2.1",
59
+ "jsdom": "30.1.2",
60
+ "tsx": "^4.20.3",
61
+ "typescript-7": "npm:typescript@^7.0.2",
62
+ "vitest": "^5.1.2"
63
+ },
47
64
  "scripts": {
48
65
  "build": "tsc",
49
66
  "css": "tsx scripts/build-css.ts",
@@ -52,18 +69,7 @@
52
69
  "props:check": "tsx scripts/build-prop-types.ts --check",
53
70
  "tokens:export": "tsx scripts/tokens.ts export",
54
71
  "tokens:import": "tsx scripts/tokens.ts import",
55
- "typecheck": "tsc --noEmit",
72
+ "typecheck": "tsgo --noEmit",
56
73
  "test": "vitest --run"
57
- },
58
- "dependencies": {
59
- "@radix-ui/colors": "^3.0.0",
60
- "colorjs.io": "^0.7.1"
61
- },
62
- "devDependencies": {
63
- "@types/node": "^24.2.1",
64
- "jsdom": "30.1.2",
65
- "tsx": "^4.20.3",
66
- "typescript-7": "catalog:",
67
- "vitest": "catalog:"
68
74
  }
69
- }
75
+ }
@@ -1,9 +1 @@
1
- import { enumProp } from "../props.js";
2
-
3
- export const alertDialogContentProps = {
4
- size: enumProp(
5
- ["1", "2", "3", "4"],
6
- "Padding and type step of the popup, as in Radix Themes.",
7
- "3",
8
- ),
9
- } as const;
1
+ export const alertDialogPopupProps = {} as const;
@@ -0,0 +1,16 @@
1
+ import { colorProp, enumProp, radiusProp, variantProp } from "../props.js";
2
+
3
+ /**
4
+ * A 3×3 matrix of flex alignments for a layout inspector. The value maps
5
+ * 1:1 to `justify-content` and `align-items`.
6
+ */
7
+ export const alignmentPickerProps = {
8
+ variant: variantProp(["surface", "soft"], "surface"),
9
+ color: colorProp,
10
+ radius: radiusProp,
11
+ direction: enumProp(
12
+ ["row", "column"],
13
+ "The layout's main axis. It orients the glyphs only: a row draws vertical bars, a column horizontal ones.",
14
+ "row",
15
+ ),
16
+ } as const;
@@ -1,16 +1,16 @@
1
- import { CONTROL_SIZES } from "../../tokens/roles.js";
2
1
  import {
3
2
  colorProp,
4
3
  highContrastProp,
5
4
  popupColorProp,
6
5
  radiusProp,
6
+ CONTROL_SIZES,
7
7
  sizeProp,
8
8
  variantProp,
9
9
  } from "../props.js";
10
10
 
11
11
  /** The input takes Input's props; the popup takes Menu's. */
12
12
  export const autocompleteProps = {
13
- size: sizeProp(CONTROL_SIZES, "3"),
13
+ size: sizeProp(CONTROL_SIZES, "md"),
14
14
  variant: variantProp(["surface", "soft"], "surface"),
15
15
  color: colorProp,
16
16
  radius: radiusProp,
@@ -1,14 +1,11 @@
1
- import { CONTROL_SIZES } from "../../tokens/roles.js";
2
1
  import {
3
2
  colorProp,
4
3
  highContrastProp,
5
4
  radiusProp,
6
- sizeProp,
7
5
  variantProp,
8
6
  } from "../props.js";
9
7
 
10
8
  export const avatarProps = {
11
- size: sizeProp(CONTROL_SIZES, "3", "Diameter"),
12
9
  variant: variantProp(["solid", "soft"], "soft"),
13
10
  color: colorProp,
14
11
  highContrast: highContrastProp,
@@ -3,12 +3,10 @@ import {
3
3
  colorProp,
4
4
  highContrastProp,
5
5
  radiusProp,
6
- sizeProp,
7
6
  variantProp,
8
7
  } from "../props.js";
9
8
 
10
9
  export const badgeProps = {
11
- size: sizeProp(["1", "2", "3"], "2"),
12
10
  variant: variantProp(["solid", "soft", "surface", "outline"], "soft"),
13
11
  color: colorProp,
14
12
  highContrast: highContrastProp,
@@ -1,7 +1,6 @@
1
- import { enumProp, TEXT_SIZES, textProps } from "../props.js";
1
+ import { textProps } from "../props.js";
2
2
 
3
3
  export const blockquoteProps = {
4
- size: enumProp(TEXT_SIZES, "A step of the type scale; unset, it inherits."),
5
4
  weight: textProps.weight,
6
5
  truncate: textProps.truncate,
7
6
  wrap: textProps.wrap,
@@ -1,9 +1,9 @@
1
- import { CONTROL_SIZES } from "../../tokens/roles.js";
2
1
  import {
3
2
  booleanProp,
4
3
  colorProp,
5
4
  highContrastProp,
6
5
  radiusProp,
6
+ CONTROL_SIZES,
7
7
  sizeProp,
8
8
  VARIANTS,
9
9
  variantProp,
@@ -11,7 +11,7 @@ import {
11
11
 
12
12
  /** Button and Icon Button share their props, as in Radix Themes. */
13
13
  export const buttonProps = {
14
- size: sizeProp(CONTROL_SIZES, "3"),
14
+ size: sizeProp(CONTROL_SIZES, "md"),
15
15
  variant: variantProp(VARIANTS, "solid"),
16
16
  color: colorProp,
17
17
  highContrast: highContrastProp,
@@ -22,3 +22,15 @@ export const buttonProps = {
22
22
  } as const;
23
23
 
24
24
  export const iconButtonProps = buttonProps;
25
+
26
+ /**
27
+ * ButtonLink and IconButtonLink: Button's look on a link, which has no
28
+ * loading state.
29
+ */
30
+ export const buttonLinkProps = {
31
+ size: buttonProps.size,
32
+ variant: buttonProps.variant,
33
+ color: buttonProps.color,
34
+ highContrast: buttonProps.highContrast,
35
+ radius: buttonProps.radius,
36
+ } as const;
@@ -1,16 +1,6 @@
1
- import {
2
- colorProp,
3
- enumProp,
4
- highContrastProp,
5
- variantProp,
6
- } from "../props.js";
1
+ import { colorProp, highContrastProp, variantProp } from "../props.js";
7
2
 
8
3
  export const calloutProps = {
9
- size: enumProp(
10
- ["1", "2", "3"],
11
- "Padding, gap and type step of the callout: compact, standard, roomy.",
12
- "2",
13
- ),
14
4
  variant: variantProp(["soft", "surface", "outline"], "soft"),
15
5
  color: colorProp,
16
6
  highContrast: highContrastProp,
@@ -1,10 +1,5 @@
1
- import { enumProp, variantProp } from "../props.js";
1
+ import { variantProp } from "../props.js";
2
2
 
3
3
  export const cardProps = {
4
- size: enumProp(
5
- ["1", "2", "3", "4", "5"],
6
- "Padding: 1 is 8px, 2 12px, 3 16px, 4 24px, 5 32px.",
7
- "2",
8
- ),
9
4
  variant: variantProp(["surface", "ghost"], "surface"),
10
5
  } as const;
@@ -1,13 +1,7 @@
1
- import {
2
- colorProp,
3
- enumProp,
4
- highContrastProp,
5
- variantProp,
6
- } from "../props.js";
1
+ import { colorProp, highContrastProp, variantProp } from "../props.js";
7
2
 
8
3
  /** Radix Themes' checkbox cards: a Checkbox Group whose options are cards. */
9
4
  export const checkboxCardsProps = {
10
- size: enumProp(["1", "2", "3"], "Padding and type step of each card.", "2"),
11
5
  variant: variantProp(["surface", "soft"], "surface"),
12
6
  color: colorProp,
13
7
  highContrast: highContrastProp,
@@ -1,12 +1,6 @@
1
- import {
2
- colorProp,
3
- enumProp,
4
- highContrastProp,
5
- variantProp,
6
- } from "../props.js";
1
+ import { colorProp, highContrastProp, variantProp } from "../props.js";
7
2
 
8
3
  export const checkboxGroupProps = {
9
- size: enumProp(["1", "2", "3"], "Box: 1 is 12px, 2 is 16px, 3 is 20px.", "2"),
10
4
  variant: variantProp(["surface", "soft"], "surface"),
11
5
  color: colorProp,
12
6
  highContrast: highContrastProp,
@@ -1,12 +1,6 @@
1
- import {
2
- colorProp,
3
- enumProp,
4
- highContrastProp,
5
- variantProp,
6
- } from "../props.js";
1
+ import { colorProp, highContrastProp, variantProp } from "../props.js";
7
2
 
8
3
  export const checkboxProps = {
9
- size: enumProp(["1", "2", "3"], "Box: 1 is 12px, 2 is 16px, 3 is 20px.", "2"),
10
4
  variant: variantProp(["surface", "soft"], "surface"),
11
5
  color: colorProp,
12
6
  highContrast: highContrastProp,
@@ -2,17 +2,12 @@ import {
2
2
  colorProp,
3
3
  enumProp,
4
4
  highContrastProp,
5
- TEXT_SIZES,
6
5
  TEXT_WEIGHTS,
7
6
  textProps,
8
7
  variantProp,
9
8
  } from "../props.js";
10
9
 
11
10
  export const codeProps = {
12
- size: enumProp(
13
- TEXT_SIZES,
14
- "A step of the type scale; unset, it follows the surrounding text.",
15
- ),
16
11
  variant: variantProp(["solid", "soft", "outline", "ghost"], "soft"),
17
12
  weight: enumProp(TEXT_WEIGHTS, "Font weight, one of the weight tokens."),
18
13
  truncate: textProps.truncate,
@@ -0,0 +1,6 @@
1
+ import { CONTROL_SIZES, radiusProp, sizeProp } from "../props.js";
2
+
3
+ export const colorSwatchProps = {
4
+ size: sizeProp(CONTROL_SIZES, "md"),
5
+ radius: radiusProp,
6
+ } as const;
@@ -1,16 +1,16 @@
1
- import { CONTROL_SIZES } from "../../tokens/roles.js";
2
1
  import {
3
2
  colorProp,
4
3
  highContrastProp,
5
4
  popupColorProp,
6
5
  radiusProp,
6
+ CONTROL_SIZES,
7
7
  sizeProp,
8
8
  variantProp,
9
9
  } from "../props.js";
10
10
 
11
11
  /** The input takes Input's props; the popup takes Menu's. */
12
12
  export const comboboxProps = {
13
- size: sizeProp(CONTROL_SIZES, "3"),
13
+ size: sizeProp(CONTROL_SIZES, "md"),
14
14
  variant: variantProp(["surface", "soft"], "surface"),
15
15
  color: colorProp,
16
16
  radius: radiusProp,