@dscout/particle 1.0.0-alpha.22 → 1.0.0-alpha.24

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 (428) hide show
  1. package/README.md +45 -76
  2. package/lib/cjs/components/advanced_options.d.ts +3 -3
  3. package/lib/cjs/components/advanced_options.js +14 -13
  4. package/lib/cjs/components/advanced_options.js.map +1 -1
  5. package/lib/cjs/components/attribute_input.d.ts +3 -3
  6. package/lib/cjs/components/attribute_input.js +3 -2
  7. package/lib/cjs/components/attribute_input.js.map +1 -1
  8. package/lib/cjs/components/attribute_selector.d.ts +3 -3
  9. package/lib/cjs/components/attribute_selector.js +3 -2
  10. package/lib/cjs/components/attribute_selector.js.map +1 -1
  11. package/lib/cjs/components/avatar.d.ts +3 -3
  12. package/lib/cjs/components/avatar.js +3 -2
  13. package/lib/cjs/components/avatar.js.map +1 -1
  14. package/lib/cjs/components/button.d.ts +3 -3
  15. package/lib/cjs/components/button.js +3 -2
  16. package/lib/cjs/components/button.js.map +1 -1
  17. package/lib/cjs/components/button_control.d.ts +3 -3
  18. package/lib/cjs/components/button_control.js +3 -2
  19. package/lib/cjs/components/button_control.js.map +1 -1
  20. package/lib/cjs/components/button_icon.d.ts +10 -10
  21. package/lib/cjs/components/button_icon.js +3 -2
  22. package/lib/cjs/components/button_icon.js.map +1 -1
  23. package/lib/cjs/components/button_mode.d.ts +3 -3
  24. package/lib/cjs/components/button_mode.js +3 -2
  25. package/lib/cjs/components/button_mode.js.map +1 -1
  26. package/lib/cjs/components/button_plain.d.ts +3 -3
  27. package/lib/cjs/components/button_plain.js +3 -2
  28. package/lib/cjs/components/button_plain.js.map +1 -1
  29. package/lib/cjs/components/card.d.ts +3 -3
  30. package/lib/cjs/components/card.js +3 -2
  31. package/lib/cjs/components/card.js.map +1 -1
  32. package/lib/cjs/components/card_body.d.ts +3 -3
  33. package/lib/cjs/components/card_body.js +3 -2
  34. package/lib/cjs/components/card_body.js.map +1 -1
  35. package/lib/cjs/components/card_footer.d.ts +3 -3
  36. package/lib/cjs/components/card_footer.js +3 -2
  37. package/lib/cjs/components/card_footer.js.map +1 -1
  38. package/lib/cjs/components/cards.d.ts +3 -3
  39. package/lib/cjs/components/cards.js +3 -2
  40. package/lib/cjs/components/cards.js.map +1 -1
  41. package/lib/cjs/components/checkbox_input.d.ts +3 -3
  42. package/lib/cjs/components/checkbox_input.js +3 -2
  43. package/lib/cjs/components/checkbox_input.js.map +1 -1
  44. package/lib/cjs/components/chip.d.ts +3 -3
  45. package/lib/cjs/components/chip.js +3 -2
  46. package/lib/cjs/components/chip.js.map +1 -1
  47. package/lib/cjs/components/collapsible_content.d.ts +3 -3
  48. package/lib/cjs/components/collapsible_content.js +11 -3
  49. package/lib/cjs/components/collapsible_content.js.map +1 -1
  50. package/lib/cjs/components/collapsing_menu.d.ts +3 -3
  51. package/lib/cjs/components/collapsing_menu.js +39 -16
  52. package/lib/cjs/components/collapsing_menu.js.map +1 -1
  53. package/lib/cjs/components/column.d.ts +2 -2
  54. package/lib/cjs/components/common_input.d.ts +3 -3
  55. package/lib/cjs/components/common_input.js +4 -2
  56. package/lib/cjs/components/common_input.js.map +1 -1
  57. package/lib/cjs/components/common_menu_item.d.ts +3 -3
  58. package/lib/cjs/components/common_menu_item.js +2 -2
  59. package/lib/cjs/components/common_menu_item.js.map +1 -1
  60. package/lib/cjs/components/container.d.ts +4 -3
  61. package/lib/cjs/components/container.js +8 -3
  62. package/lib/cjs/components/container.js.map +1 -1
  63. package/lib/cjs/components/container_header.d.ts +2 -2
  64. package/lib/cjs/components/date_input.d.ts +3 -3
  65. package/lib/cjs/components/date_input.js +2 -2
  66. package/lib/cjs/components/date_input.js.map +1 -1
  67. package/lib/cjs/components/drag_and_drop.d.ts +3 -3
  68. package/lib/cjs/components/drag_and_drop.js +3 -2
  69. package/lib/cjs/components/drag_and_drop.js.map +1 -1
  70. package/lib/cjs/components/dropdown.d.ts +2 -2
  71. package/lib/cjs/components/dropdown.js +3 -2
  72. package/lib/cjs/components/dropdown.js.map +1 -1
  73. package/lib/cjs/components/dropdown_input_toggle.d.ts +3 -3
  74. package/lib/cjs/components/dropdown_input_toggle.js +3 -2
  75. package/lib/cjs/components/dropdown_input_toggle.js.map +1 -1
  76. package/lib/cjs/components/editing_container.d.ts +2 -2
  77. package/lib/cjs/components/editing_container.js +8 -3
  78. package/lib/cjs/components/editing_container.js.map +1 -1
  79. package/lib/cjs/components/email_input.d.ts +3 -3
  80. package/lib/cjs/components/email_input.js +2 -2
  81. package/lib/cjs/components/email_input.js.map +1 -1
  82. package/lib/cjs/components/file_input.d.ts +3 -3
  83. package/lib/cjs/components/file_input.js +5 -3
  84. package/lib/cjs/components/file_input.js.map +1 -1
  85. package/lib/cjs/components/flex.d.ts +11 -4
  86. package/lib/cjs/components/flex.js +17 -11
  87. package/lib/cjs/components/flex.js.map +1 -1
  88. package/lib/cjs/components/footnote.d.ts +3 -3
  89. package/lib/cjs/components/footnote.js +3 -2
  90. package/lib/cjs/components/footnote.js.map +1 -1
  91. package/lib/cjs/components/heading.d.ts +3 -3
  92. package/lib/cjs/components/heading.js +4 -3
  93. package/lib/cjs/components/heading.js.map +1 -1
  94. package/lib/cjs/components/input_addon.js +1 -1
  95. package/lib/cjs/components/input_addon.js.map +1 -1
  96. package/lib/cjs/components/input_group.d.ts +3 -3
  97. package/lib/cjs/components/input_group.js +3 -2
  98. package/lib/cjs/components/input_group.js.map +1 -1
  99. package/lib/cjs/components/input_group_item.js +1 -1
  100. package/lib/cjs/components/input_group_item.js.map +1 -1
  101. package/lib/cjs/components/link_text.d.ts +3 -3
  102. package/lib/cjs/components/link_text.js +3 -2
  103. package/lib/cjs/components/link_text.js.map +1 -1
  104. package/lib/cjs/components/list.d.ts +3 -3
  105. package/lib/cjs/components/list.js +4 -3
  106. package/lib/cjs/components/list.js.map +1 -1
  107. package/lib/cjs/components/list_inline.d.ts +3 -3
  108. package/lib/cjs/components/list_inline.js +4 -3
  109. package/lib/cjs/components/list_inline.js.map +1 -1
  110. package/lib/cjs/components/menu.d.ts +3 -3
  111. package/lib/cjs/components/menu.js +3 -2
  112. package/lib/cjs/components/menu.js.map +1 -1
  113. package/lib/cjs/components/menu_item.d.ts +3 -3
  114. package/lib/cjs/components/menu_item.js +2 -2
  115. package/lib/cjs/components/menu_item.js.map +1 -1
  116. package/lib/cjs/components/menu_item_li.d.ts +2 -2
  117. package/lib/cjs/components/menu_item_li.js +2 -2
  118. package/lib/cjs/components/menu_item_li.js.map +1 -1
  119. package/lib/cjs/components/menu_link.d.ts +3 -3
  120. package/lib/cjs/components/menu_link.js +2 -2
  121. package/lib/cjs/components/menu_link.js.map +1 -1
  122. package/lib/cjs/components/menu_list.d.ts +3 -3
  123. package/lib/cjs/components/menu_list.js +3 -2
  124. package/lib/cjs/components/menu_list.js.map +1 -1
  125. package/lib/cjs/components/menu_section.d.ts +3 -3
  126. package/lib/cjs/components/menu_section.js +3 -2
  127. package/lib/cjs/components/menu_section.js.map +1 -1
  128. package/lib/cjs/components/menu_title.d.ts +3 -3
  129. package/lib/cjs/components/menu_title.js +3 -2
  130. package/lib/cjs/components/menu_title.js.map +1 -1
  131. package/lib/cjs/components/modal.d.ts +3 -1
  132. package/lib/cjs/components/modal.js +4 -4
  133. package/lib/cjs/components/modal.js.map +1 -1
  134. package/lib/cjs/components/modifier.d.ts +13 -13
  135. package/lib/cjs/components/modifier.js +3 -43
  136. package/lib/cjs/components/modifier.js.map +1 -1
  137. package/lib/cjs/components/number_input.d.ts +3 -3
  138. package/lib/cjs/components/number_input.js +2 -2
  139. package/lib/cjs/components/number_input.js.map +1 -1
  140. package/lib/cjs/components/password_input.d.ts +3 -3
  141. package/lib/cjs/components/password_input.js +2 -2
  142. package/lib/cjs/components/password_input.js.map +1 -1
  143. package/lib/cjs/components/pill.d.ts +3 -3
  144. package/lib/cjs/components/pill.js +3 -2
  145. package/lib/cjs/components/pill.js.map +1 -1
  146. package/lib/cjs/components/radio_input.d.ts +3 -3
  147. package/lib/cjs/components/radio_input.js +3 -2
  148. package/lib/cjs/components/radio_input.js.map +1 -1
  149. package/lib/cjs/components/range_input.d.ts +3 -3
  150. package/lib/cjs/components/range_input.js +4 -2
  151. package/lib/cjs/components/range_input.js.map +1 -1
  152. package/lib/cjs/components/row.d.ts +3 -3
  153. package/lib/cjs/components/row.js +3 -2
  154. package/lib/cjs/components/row.js.map +1 -1
  155. package/lib/cjs/components/search_input.d.ts +3 -3
  156. package/lib/cjs/components/search_input.js +2 -2
  157. package/lib/cjs/components/search_input.js.map +1 -1
  158. package/lib/cjs/components/segmented_controls.d.ts +3 -3
  159. package/lib/cjs/components/segmented_controls.js +3 -2
  160. package/lib/cjs/components/segmented_controls.js.map +1 -1
  161. package/lib/cjs/components/select_input.d.ts +3 -3
  162. package/lib/cjs/components/select_input.js +4 -2
  163. package/lib/cjs/components/select_input.js.map +1 -1
  164. package/lib/cjs/components/separator.d.ts +2 -2
  165. package/lib/cjs/components/speech_bubble.d.ts +3 -3
  166. package/lib/cjs/components/speech_bubble.js +3 -2
  167. package/lib/cjs/components/speech_bubble.js.map +1 -1
  168. package/lib/cjs/components/tags_input.d.ts +2 -2
  169. package/lib/cjs/components/tags_input.js +3 -2
  170. package/lib/cjs/components/tags_input.js.map +1 -1
  171. package/lib/cjs/components/text_input.d.ts +3 -3
  172. package/lib/cjs/components/text_input.js +2 -2
  173. package/lib/cjs/components/text_input.js.map +1 -1
  174. package/lib/cjs/components/textarea.d.ts +3 -3
  175. package/lib/cjs/components/textarea.js +3 -2
  176. package/lib/cjs/components/textarea.js.map +1 -1
  177. package/lib/cjs/components/thumbnail.d.ts +3 -3
  178. package/lib/cjs/components/thumbnail.js +3 -2
  179. package/lib/cjs/components/thumbnail.js.map +1 -1
  180. package/lib/cjs/components/togglable_fieldset.d.ts +3 -3
  181. package/lib/cjs/components/togglable_fieldset.js +7 -7
  182. package/lib/cjs/components/togglable_fieldset.js.map +1 -1
  183. package/lib/cjs/components/toggle.d.ts +3 -3
  184. package/lib/cjs/components/toggle.js +3 -2
  185. package/lib/cjs/components/toggle.js.map +1 -1
  186. package/lib/cjs/components/tooltip.d.ts +2 -2
  187. package/lib/cjs/components/tooltip_container.d.ts +3 -3
  188. package/lib/cjs/components/tooltip_container.js +3 -2
  189. package/lib/cjs/components/tooltip_container.js.map +1 -1
  190. package/lib/cjs/components/with_addons.d.ts +3 -3
  191. package/lib/cjs/components/with_addons.js +2 -2
  192. package/lib/cjs/components/with_addons.js.map +1 -1
  193. package/lib/cjs/index.d.ts +0 -1
  194. package/lib/cjs/index.js +5 -7
  195. package/lib/cjs/index.js.map +1 -1
  196. package/lib/cjs/types.d.ts +17 -4
  197. package/lib/cjs/utils/dom.d.ts +1 -1
  198. package/lib/cjs/utils/modifier_classes.d.ts +6 -0
  199. package/lib/cjs/utils/modifier_classes.js +57 -0
  200. package/lib/cjs/utils/modifier_classes.js.map +1 -0
  201. package/lib/cjs/utils/strings.d.ts +0 -2
  202. package/lib/cjs/utils/strings.js +1 -8
  203. package/lib/cjs/utils/strings.js.map +1 -1
  204. package/lib/esm/components/advanced_options.d.ts +3 -3
  205. package/lib/esm/components/advanced_options.js +15 -14
  206. package/lib/esm/components/advanced_options.js.map +1 -1
  207. package/lib/esm/components/attribute_input.d.ts +3 -3
  208. package/lib/esm/components/attribute_input.js +3 -2
  209. package/lib/esm/components/attribute_input.js.map +1 -1
  210. package/lib/esm/components/attribute_selector.d.ts +3 -3
  211. package/lib/esm/components/attribute_selector.js +3 -2
  212. package/lib/esm/components/attribute_selector.js.map +1 -1
  213. package/lib/esm/components/avatar.d.ts +3 -3
  214. package/lib/esm/components/avatar.js +3 -2
  215. package/lib/esm/components/avatar.js.map +1 -1
  216. package/lib/esm/components/button.d.ts +3 -3
  217. package/lib/esm/components/button.js +3 -2
  218. package/lib/esm/components/button.js.map +1 -1
  219. package/lib/esm/components/button_control.d.ts +3 -3
  220. package/lib/esm/components/button_control.js +3 -2
  221. package/lib/esm/components/button_control.js.map +1 -1
  222. package/lib/esm/components/button_icon.d.ts +10 -10
  223. package/lib/esm/components/button_icon.js +3 -2
  224. package/lib/esm/components/button_icon.js.map +1 -1
  225. package/lib/esm/components/button_mode.d.ts +3 -3
  226. package/lib/esm/components/button_mode.js +3 -2
  227. package/lib/esm/components/button_mode.js.map +1 -1
  228. package/lib/esm/components/button_plain.d.ts +3 -3
  229. package/lib/esm/components/button_plain.js +3 -2
  230. package/lib/esm/components/button_plain.js.map +1 -1
  231. package/lib/esm/components/card.d.ts +3 -3
  232. package/lib/esm/components/card.js +3 -2
  233. package/lib/esm/components/card.js.map +1 -1
  234. package/lib/esm/components/card_body.d.ts +3 -3
  235. package/lib/esm/components/card_body.js +3 -2
  236. package/lib/esm/components/card_body.js.map +1 -1
  237. package/lib/esm/components/card_footer.d.ts +3 -3
  238. package/lib/esm/components/card_footer.js +3 -2
  239. package/lib/esm/components/card_footer.js.map +1 -1
  240. package/lib/esm/components/cards.d.ts +3 -3
  241. package/lib/esm/components/cards.js +3 -2
  242. package/lib/esm/components/cards.js.map +1 -1
  243. package/lib/esm/components/checkbox_input.d.ts +3 -3
  244. package/lib/esm/components/checkbox_input.js +3 -2
  245. package/lib/esm/components/checkbox_input.js.map +1 -1
  246. package/lib/esm/components/chip.d.ts +3 -3
  247. package/lib/esm/components/chip.js +3 -2
  248. package/lib/esm/components/chip.js.map +1 -1
  249. package/lib/esm/components/collapsible_content.d.ts +3 -3
  250. package/lib/esm/components/collapsible_content.js +11 -3
  251. package/lib/esm/components/collapsible_content.js.map +1 -1
  252. package/lib/esm/components/collapsing_menu.d.ts +3 -3
  253. package/lib/esm/components/collapsing_menu.js +16 -16
  254. package/lib/esm/components/collapsing_menu.js.map +1 -1
  255. package/lib/esm/components/column.d.ts +2 -2
  256. package/lib/esm/components/common_input.d.ts +3 -3
  257. package/lib/esm/components/common_input.js +4 -2
  258. package/lib/esm/components/common_input.js.map +1 -1
  259. package/lib/esm/components/common_menu_item.d.ts +3 -3
  260. package/lib/esm/components/common_menu_item.js +2 -2
  261. package/lib/esm/components/common_menu_item.js.map +1 -1
  262. package/lib/esm/components/container.d.ts +4 -3
  263. package/lib/esm/components/container.js +8 -3
  264. package/lib/esm/components/container.js.map +1 -1
  265. package/lib/esm/components/container_header.d.ts +2 -2
  266. package/lib/esm/components/date_input.d.ts +3 -3
  267. package/lib/esm/components/date_input.js +2 -2
  268. package/lib/esm/components/date_input.js.map +1 -1
  269. package/lib/esm/components/drag_and_drop.d.ts +3 -3
  270. package/lib/esm/components/drag_and_drop.js +3 -2
  271. package/lib/esm/components/drag_and_drop.js.map +1 -1
  272. package/lib/esm/components/dropdown.d.ts +2 -2
  273. package/lib/esm/components/dropdown.js +3 -2
  274. package/lib/esm/components/dropdown.js.map +1 -1
  275. package/lib/esm/components/dropdown_input_toggle.d.ts +3 -3
  276. package/lib/esm/components/dropdown_input_toggle.js +3 -2
  277. package/lib/esm/components/dropdown_input_toggle.js.map +1 -1
  278. package/lib/esm/components/editing_container.d.ts +2 -2
  279. package/lib/esm/components/editing_container.js +8 -3
  280. package/lib/esm/components/editing_container.js.map +1 -1
  281. package/lib/esm/components/email_input.d.ts +3 -3
  282. package/lib/esm/components/email_input.js +2 -2
  283. package/lib/esm/components/email_input.js.map +1 -1
  284. package/lib/esm/components/file_input.d.ts +3 -3
  285. package/lib/esm/components/file_input.js +5 -3
  286. package/lib/esm/components/file_input.js.map +1 -1
  287. package/lib/esm/components/flex.d.ts +11 -4
  288. package/lib/esm/components/flex.js +17 -11
  289. package/lib/esm/components/flex.js.map +1 -1
  290. package/lib/esm/components/footnote.d.ts +3 -3
  291. package/lib/esm/components/footnote.js +3 -2
  292. package/lib/esm/components/footnote.js.map +1 -1
  293. package/lib/esm/components/heading.d.ts +3 -3
  294. package/lib/esm/components/heading.js +4 -3
  295. package/lib/esm/components/heading.js.map +1 -1
  296. package/lib/esm/components/input_addon.js +1 -1
  297. package/lib/esm/components/input_addon.js.map +1 -1
  298. package/lib/esm/components/input_group.d.ts +3 -3
  299. package/lib/esm/components/input_group.js +3 -2
  300. package/lib/esm/components/input_group.js.map +1 -1
  301. package/lib/esm/components/input_group_item.js +1 -1
  302. package/lib/esm/components/input_group_item.js.map +1 -1
  303. package/lib/esm/components/link_text.d.ts +3 -3
  304. package/lib/esm/components/link_text.js +3 -2
  305. package/lib/esm/components/link_text.js.map +1 -1
  306. package/lib/esm/components/list.d.ts +3 -3
  307. package/lib/esm/components/list.js +4 -3
  308. package/lib/esm/components/list.js.map +1 -1
  309. package/lib/esm/components/list_inline.d.ts +3 -3
  310. package/lib/esm/components/list_inline.js +4 -3
  311. package/lib/esm/components/list_inline.js.map +1 -1
  312. package/lib/esm/components/menu.d.ts +3 -3
  313. package/lib/esm/components/menu.js +3 -2
  314. package/lib/esm/components/menu.js.map +1 -1
  315. package/lib/esm/components/menu_item.d.ts +3 -3
  316. package/lib/esm/components/menu_item.js +2 -2
  317. package/lib/esm/components/menu_item.js.map +1 -1
  318. package/lib/esm/components/menu_item_li.d.ts +2 -2
  319. package/lib/esm/components/menu_item_li.js +2 -2
  320. package/lib/esm/components/menu_item_li.js.map +1 -1
  321. package/lib/esm/components/menu_link.d.ts +3 -3
  322. package/lib/esm/components/menu_link.js +2 -2
  323. package/lib/esm/components/menu_link.js.map +1 -1
  324. package/lib/esm/components/menu_list.d.ts +3 -3
  325. package/lib/esm/components/menu_list.js +3 -2
  326. package/lib/esm/components/menu_list.js.map +1 -1
  327. package/lib/esm/components/menu_section.d.ts +3 -3
  328. package/lib/esm/components/menu_section.js +3 -2
  329. package/lib/esm/components/menu_section.js.map +1 -1
  330. package/lib/esm/components/menu_title.d.ts +3 -3
  331. package/lib/esm/components/menu_title.js +3 -2
  332. package/lib/esm/components/menu_title.js.map +1 -1
  333. package/lib/esm/components/modal.d.ts +3 -1
  334. package/lib/esm/components/modal.js +4 -4
  335. package/lib/esm/components/modal.js.map +1 -1
  336. package/lib/esm/components/modifier.d.ts +13 -13
  337. package/lib/esm/components/modifier.js +3 -43
  338. package/lib/esm/components/modifier.js.map +1 -1
  339. package/lib/esm/components/number_input.d.ts +3 -3
  340. package/lib/esm/components/number_input.js +2 -2
  341. package/lib/esm/components/number_input.js.map +1 -1
  342. package/lib/esm/components/password_input.d.ts +3 -3
  343. package/lib/esm/components/password_input.js +2 -2
  344. package/lib/esm/components/password_input.js.map +1 -1
  345. package/lib/esm/components/pill.d.ts +3 -3
  346. package/lib/esm/components/pill.js +3 -2
  347. package/lib/esm/components/pill.js.map +1 -1
  348. package/lib/esm/components/radio_input.d.ts +3 -3
  349. package/lib/esm/components/radio_input.js +3 -2
  350. package/lib/esm/components/radio_input.js.map +1 -1
  351. package/lib/esm/components/range_input.d.ts +3 -3
  352. package/lib/esm/components/range_input.js +4 -2
  353. package/lib/esm/components/range_input.js.map +1 -1
  354. package/lib/esm/components/row.d.ts +3 -3
  355. package/lib/esm/components/row.js +3 -2
  356. package/lib/esm/components/row.js.map +1 -1
  357. package/lib/esm/components/search_input.d.ts +3 -3
  358. package/lib/esm/components/search_input.js +2 -2
  359. package/lib/esm/components/search_input.js.map +1 -1
  360. package/lib/esm/components/segmented_controls.d.ts +3 -3
  361. package/lib/esm/components/segmented_controls.js +3 -2
  362. package/lib/esm/components/segmented_controls.js.map +1 -1
  363. package/lib/esm/components/select_input.d.ts +3 -3
  364. package/lib/esm/components/select_input.js +4 -2
  365. package/lib/esm/components/select_input.js.map +1 -1
  366. package/lib/esm/components/separator.d.ts +2 -2
  367. package/lib/esm/components/speech_bubble.d.ts +3 -3
  368. package/lib/esm/components/speech_bubble.js +3 -2
  369. package/lib/esm/components/speech_bubble.js.map +1 -1
  370. package/lib/esm/components/tags_input.d.ts +2 -2
  371. package/lib/esm/components/tags_input.js +3 -2
  372. package/lib/esm/components/tags_input.js.map +1 -1
  373. package/lib/esm/components/text_input.d.ts +3 -3
  374. package/lib/esm/components/text_input.js +2 -2
  375. package/lib/esm/components/text_input.js.map +1 -1
  376. package/lib/esm/components/textarea.d.ts +3 -3
  377. package/lib/esm/components/textarea.js +3 -2
  378. package/lib/esm/components/textarea.js.map +1 -1
  379. package/lib/esm/components/thumbnail.d.ts +3 -3
  380. package/lib/esm/components/thumbnail.js +3 -2
  381. package/lib/esm/components/thumbnail.js.map +1 -1
  382. package/lib/esm/components/togglable_fieldset.d.ts +3 -3
  383. package/lib/esm/components/togglable_fieldset.js +7 -7
  384. package/lib/esm/components/togglable_fieldset.js.map +1 -1
  385. package/lib/esm/components/toggle.d.ts +3 -3
  386. package/lib/esm/components/toggle.js +3 -2
  387. package/lib/esm/components/toggle.js.map +1 -1
  388. package/lib/esm/components/tooltip.d.ts +2 -2
  389. package/lib/esm/components/tooltip_container.d.ts +3 -3
  390. package/lib/esm/components/tooltip_container.js +3 -2
  391. package/lib/esm/components/tooltip_container.js.map +1 -1
  392. package/lib/esm/components/with_addons.d.ts +3 -3
  393. package/lib/esm/components/with_addons.js +2 -2
  394. package/lib/esm/components/with_addons.js.map +1 -1
  395. package/lib/esm/index.d.ts +0 -1
  396. package/lib/esm/index.js +0 -1
  397. package/lib/esm/index.js.map +1 -1
  398. package/lib/esm/types.d.ts +17 -4
  399. package/lib/esm/utils/dom.d.ts +1 -1
  400. package/lib/esm/utils/modifier_classes.d.ts +6 -0
  401. package/lib/esm/utils/modifier_classes.js +46 -0
  402. package/lib/esm/utils/modifier_classes.js.map +1 -0
  403. package/lib/esm/utils/strings.d.ts +0 -2
  404. package/lib/esm/utils/strings.js +0 -6
  405. package/lib/esm/utils/strings.js.map +1 -1
  406. package/lib/stylesheets/particle.css +178 -142
  407. package/lib/stylesheets/particle.css.map +1 -1
  408. package/lib/stylesheets/particle.min.css +1 -1
  409. package/lib/stylesheets/particle.min.css.gz +0 -0
  410. package/package.json +1 -1
  411. package/styles/components/collapsible/_base.scss +11 -3
  412. package/styles/components/container/_base.scss +32 -4
  413. package/styles/components/container/themes/_theme_builder.scss +12 -6
  414. package/styles/components/modal/base.scss +4 -0
  415. package/styles/utilities/_shadows.scss +4 -0
  416. package/styles/utilities/_spacing.scss +59 -39
  417. package/lib/cjs/components/collapsible.d.ts +0 -10
  418. package/lib/cjs/components/collapsible.js +0 -17
  419. package/lib/cjs/components/collapsible.js.map +0 -1
  420. package/lib/cjs/components/focus_intent.d.ts +0 -23
  421. package/lib/cjs/components/focus_intent.js +0 -92
  422. package/lib/cjs/components/focus_intent.js.map +0 -1
  423. package/lib/esm/components/collapsible.d.ts +0 -10
  424. package/lib/esm/components/collapsible.js +0 -13
  425. package/lib/esm/components/collapsible.js.map +0 -1
  426. package/lib/esm/components/focus_intent.d.ts +0 -23
  427. package/lib/esm/components/focus_intent.js +0 -66
  428. package/lib/esm/components/focus_intent.js.map +0 -1
package/README.md CHANGED
@@ -1,30 +1,29 @@
1
- # particle
1
+ # Particle
2
2
 
3
- A pattern library for building dscout user interfaces with [React].
3
+ A CSS framework and React component library for building dscout user interfaces. Visit the [documentation site] to learn more.
4
+
5
+ ## Usage
4
6
 
5
7
  Install particle using [yarn] or [npm]:
6
8
 
7
- ```shell
9
+ ```bash
8
10
  $ yarn add @dscout/particle
9
11
  $ npm install --save @dscout/particle
10
12
  ```
11
13
 
12
- Visit the [demo site] to see example code of the components.
13
14
  Everything is a named export on the namespace "@dscout/particle," for example:
14
15
 
15
16
  ```javascript
16
- import React from 'react'
17
- import { Container, ContainerInner } from '@dscout/particle'
17
+ import React from 'react';
18
+ import { Container, Heading } from '@dscout/particle';
18
19
 
19
20
  export default function Announcement() {
20
21
  return (
21
22
  <Container>
22
- <ContainerInner>
23
- <h2>Important!</h2>
24
- <p>Make sure to eat your vegetables.</p>
25
- </ContainerInner>
23
+ <Heading level="2">Important!</Heading>
24
+ <p>Make sure to eat your vegetables.</p>
26
25
  </Container>
27
- )
26
+ );
28
27
  }
29
28
  ```
30
29
 
@@ -43,106 +42,76 @@ To import into a plain CSS file:
43
42
  The source `scss` file is located in the `styles` directory.
44
43
  You can import it into your own `scss` file like so:
45
44
 
46
- ```css
47
- @import '~@dscout/particle/styles/particle.scss';
45
+ ```scss
46
+ @import '@dscout/particle/styles/particle.scss';
48
47
  ```
49
48
 
50
49
  ## Developing with Storybook
51
- Particle uses asdf to manage the node dependencies. To develop locally first
52
- install asdf with:
53
50
 
54
- ```
55
- $ brew install asdf
56
- ```
51
+ Storybook provides an isolated development environment for Particle components as well as a published static site that serves as a playground and documentation.
57
52
 
58
- Then in order to install nodejs, you must first install its dependencies:
53
+ ### Install dependencies
59
54
 
60
- ```
61
- $ brew install coreutils
62
- $ brew install gpg
55
+ Particle uses asdf to manage the node dependencies. To develop locally first
56
+ install asdf with:
57
+
58
+ ```bash
59
+ brew install asdf
63
60
  ```
64
61
 
65
- Import the Node.js release team's OpenPGP keys to main keystring:
62
+ Then install nodejs. If you don't already have nodejs set up on your machine you may first need install its dependencies and OpenPGP keys:
66
63
 
67
- ```
68
- $ bash ~/.asdf/plugins/nodejs/bin/import-release-team-keyring
64
+ ```bash
65
+ brew install coreutils
66
+ brew install gpg
67
+ bash ~/.asdf/plugins/nodejs/bin/import-release-team-keyring
69
68
  ```
70
69
 
71
70
  Install asdf dependencies
72
71
 
73
- ```
74
- $ asdf install
72
+ ```bash
73
+ asdf install
75
74
  ```
76
75
 
77
- Install dependencies with [yarn]:
76
+ Install NPM dependencies with [yarn]:
78
77
 
78
+ ```bash
79
+ yarn install
79
80
  ```
80
- $ yarn install
81
- ```
82
-
83
- ### Storybook
84
81
 
85
- [Storybook] provides a neat approach to developing UI components.
86
- Start up the development server with `yarn start` and open your
87
- browser to `http://localhost:6006`.
82
+ ### Start Storybook
88
83
 
89
- ### Styleguide
84
+ Run Storybook locally:
90
85
 
91
- A PostCSS plugin automatically generates a basic styleguide site from
92
- comments in the CSS. Run the styleguide locally with `yarn styleguide` and open
93
- your browser to `http://localhost:9090`.
86
+ ```bash
87
+ yarn start
88
+ ```
94
89
 
95
90
  ## Scripts
96
91
 
97
92
  A variety of scripts are provided for running common tasks.
98
93
 
99
- Lint with ESLint:
100
- ```
101
- $ yarn lint
102
- ```
103
-
104
- Watch the tests with Karma:
105
- ```
106
- $ yarn test
107
- ```
108
-
109
- Lint, then run the test suite:
110
- ```
111
- $ yarn ci
112
- ```
94
+ Lint with ESLint and run typechecker:
113
95
 
114
- Remove and re-create the `lib` directory:
115
- ```
116
- $ yarn clean
96
+ ```bash
97
+ yarn lint
117
98
  ```
118
99
 
119
- Create a build (outputs to the `lib` directory):
120
- ```
121
- $ yarn build
122
- ```
100
+ Start the Vitest test runner in watch mode:
123
101
 
124
- Minify the CSS build:
125
- ```
126
- $ yarn nano
102
+ ```bash
103
+ yarn test
127
104
  ```
128
105
 
129
- Create a release with a minified CSS build:
130
- ```
131
- $ yarn release
132
- ```
106
+ ## Contributing
133
107
 
134
- Generate the documentation website (output to the `docs` directory):
135
- ```
136
- $ yarn build-docs
137
- ```
108
+ [See the wiki](https://github.com/dscout/particle/wiki/Development-and-QA-workflow) for details on how to contribute to Particle.
138
109
 
139
110
  ## Releasing a new version
140
111
 
141
-
142
112
  Instructions for preparing a new release and submitting it to npm can be found [here](https://github.com/dscout/particle/wiki/Versioning-&-Releases).
143
113
 
144
- [demo site]: https://dscout.github.io/particle/
145
- [npm]: https://www.npmjs.com/
146
- [React]: https://facebook.github.io/react/
114
+ [documentation site]: https://dscout.github.io/particle/
115
+ [npm]: https://www.npmjs.com/
147
116
  [Storybook]: https://getstorybook.io/
148
- [yarn]: https://yarnpkg.com/en/docs/install
117
+ [yarn]: https://yarnpkg.com/en/docs/install
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import type { CommonComponentProps, ModifierProps } from '../types';
2
+ import type { CommonComponentProps, MarginModifierProp, ModifierClassProp } from '../types';
3
3
  import type { GetRef } from '../utils/refs';
4
- interface AdvancedOptionsProps extends CommonComponentProps, ModifierProps {
4
+ interface AdvancedOptionsProps extends CommonComponentProps, MarginModifierProp, ModifierClassProp {
5
5
  children?: React.ReactNode;
6
6
  disabled?: boolean;
7
7
  getRef?: GetRef<HTMLDivElement>;
@@ -10,5 +10,5 @@ interface AdvancedOptionsProps extends CommonComponentProps, ModifierProps {
10
10
  name?: string;
11
11
  title: React.ReactNode;
12
12
  }
13
- export declare function AdvancedOptions({ _modifierClass, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, children, disabled, getRef, id, initialCollapsed, name, title, ...rest }: AdvancedOptionsProps): React.JSX.Element;
13
+ export declare function AdvancedOptions({ _modifierClass, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, children, disabled, getRef, id, initialCollapsed, margin, name, title, ...rest }: AdvancedOptionsProps): React.JSX.Element;
14
14
  export {};
@@ -52,26 +52,27 @@ exports.AdvancedOptions = void 0;
52
52
  var react_1 = __importStar(require("react"));
53
53
  var class_names_1 = __importDefault(require("../utils/class_names"));
54
54
  var data_attributes_1 = __importDefault(require("../utils/data_attributes"));
55
+ var modifier_classes_1 = require("../utils/modifier_classes");
55
56
  var button_plain_1 = require("./button_plain");
56
57
  var collapsible_content_1 = require("./collapsible_content");
57
58
  var triangle_inverted_1 = require("../icons/triangle_inverted");
58
59
  var flex_1 = require("./flex");
59
60
  var modifier_1 = require("./modifier");
60
- var collapsible_1 = require("./collapsible");
61
61
  function AdvancedOptions(_a) {
62
- var _modifierClass = _a._modifierClass, ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaDescribedby = _a["aria-describedby"], children = _a.children, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, _b = _a.initialCollapsed, initialCollapsed = _b === void 0 ? true : _b, name = _a.name, title = _a.title, rest = __rest(_a, ["_modifierClass", 'aria-label', 'aria-labelledby', 'aria-describedby', "children", "disabled", "getRef", "id", "initialCollapsed", "name", "title"]);
62
+ var _modifierClass = _a._modifierClass, ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaDescribedby = _a["aria-describedby"], children = _a.children, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, _b = _a.initialCollapsed, initialCollapsed = _b === void 0 ? true : _b, margin = _a.margin, name = _a.name, title = _a.title, rest = __rest(_a, ["_modifierClass", 'aria-label', 'aria-labelledby', 'aria-describedby', "children", "disabled", "getRef", "id", "initialCollapsed", "margin", "name", "title"]);
63
+ var _c = (0, react_1.useState)(initialCollapsed), isCollapsed = _c[0], setIsCollapsed = _c[1];
63
64
  var collapsibleContentId = (0, react_1.useId)();
64
- return (react_1.default.createElement(collapsible_1.CollapsibleStateProvider, { initialCollapsed: initialCollapsed }, function (_a) {
65
- var isCollapsed = _a.isCollapsed, toggleCollapsed = _a.toggleCollapsed;
66
- return (react_1.default.createElement("div", { className: (0, class_names_1.default)(_modifierClass), ref: getRef },
67
- react_1.default.createElement(modifier_1.Modifier, { margin: { bottom: '0.75' } },
68
- react_1.default.createElement(button_plain_1.ButtonPlain, __assign({}, (0, data_attributes_1.default)(rest), { "aria-controls": collapsibleContentId, "aria-expanded": !isCollapsed, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, disabled: disabled, id: id, onClick: toggleCollapsed, name: name || (typeof title === 'string' ? title : undefined) }),
69
- react_1.default.createElement(flex_1.Flex, null,
70
- title,
71
- ' ',
72
- react_1.default.createElement(triangle_inverted_1.IconTriangleInverted, { direction: isCollapsed ? 'right' : 'down' })))),
73
- react_1.default.createElement(collapsible_content_1.CollapsibleContent, { collapsed: isCollapsed, id: collapsibleContentId }, children)));
74
- }));
65
+ return (react_1.default.createElement("div", { className: (0, class_names_1.default)((0, modifier_classes_1.getMarginClass)(margin), _modifierClass), ref: getRef },
66
+ react_1.default.createElement(modifier_1.Modifier, { margin: { bottom: 'none' } },
67
+ react_1.default.createElement(button_plain_1.ButtonPlain, __assign({}, (0, data_attributes_1.default)(rest), { "aria-controls": collapsibleContentId, "aria-expanded": !isCollapsed, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, disabled: disabled, id: id, onClick: function () {
68
+ setIsCollapsed(function (prevCollapsed) { return !prevCollapsed; });
69
+ }, name: name || (typeof title === 'string' ? title : undefined) }),
70
+ react_1.default.createElement(flex_1.Flex, null,
71
+ title,
72
+ ' ',
73
+ react_1.default.createElement(triangle_inverted_1.IconTriangleInverted, { direction: isCollapsed ? 'right' : 'down' })))),
74
+ react_1.default.createElement(collapsible_content_1.CollapsibleContent, { collapsed: isCollapsed, id: collapsibleContentId },
75
+ react_1.default.createElement("div", { className: "margin-t--0.75" }, children))));
75
76
  }
76
77
  exports.AdvancedOptions = AdvancedOptions;
77
78
  //# sourceMappingURL=advanced_options.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"advanced_options.js","sourceRoot":"","sources":["../../../src/components/advanced_options.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAqC;AAKrC,qEAA8C;AAC9C,6EAAyD;AAEzD,+CAA6C;AAC7C,6DAA2D;AAC3D,gEAAkE;AAClE,+BAA8B;AAC9B,uCAAsC;AAEtC,6CAAyD;AAYzD,SAAgB,eAAe,CAAC,EAaT;IAZrB,IAAA,cAAc,oBAAA,EACA,SAAS,mBAAA,EACJ,cAAc,wBAAA,EACb,eAAe,yBAAA,EACnC,QAAQ,cAAA,EACR,QAAQ,cAAA,EACR,MAAM,YAAA,EACN,EAAE,QAAA,EACF,wBAAuB,EAAvB,gBAAgB,mBAAG,IAAI,KAAA,EACvB,IAAI,UAAA,EACJ,KAAK,WAAA,EACF,IAAI,cAZuB,oJAa/B,CADQ;IAEP,IAAM,oBAAoB,GAAG,IAAA,aAAK,GAAE,CAAC;IAErC,OAAO,CACL,8BAAC,sCAAwB,IAAC,gBAAgB,EAAE,gBAAgB,IACzD,UAAC,EAAgC;YAA9B,WAAW,iBAAA,EAAE,eAAe,qBAAA;QAAO,OAAA,CACrC,uCAAK,SAAS,EAAE,IAAA,qBAAU,EAAC,cAAc,CAAC,EAAE,GAAG,EAAE,MAAM;YACrD,8BAAC,mBAAQ,IAAC,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE;gBAClC,8BAAC,0BAAW,eACN,IAAA,yBAAiB,EAAC,IAAI,CAAC,qBACZ,oBAAoB,mBACpB,CAAC,WAAW,gBACf,SAAS,qBACJ,cAAc,sBACb,eAAe,EACjC,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,EAAE,EACN,OAAO,EAAE,eAAe,EACxB,IAAI,EAAE,IAAI,IAAI,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;oBAE7D,8BAAC,WAAI;wBACF,KAAK;wBAAE,GAAG;wBACX,8BAAC,wCAAoB,IACnB,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,GACzC,CACG,CACK,CACL;YACX,8BAAC,wCAAkB,IAAC,SAAS,EAAE,WAAW,EAAE,EAAE,EAAE,oBAAoB,IACjE,QAAQ,CACU,CACjB,CACP;IA3BsC,CA2BtC,CACwB,CAC5B,CAAC;AACJ,CAAC;AAhDD,0CAgDC"}
1
+ {"version":3,"file":"advanced_options.js","sourceRoot":"","sources":["../../../src/components/advanced_options.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+C;AAS/C,qEAA8C;AAC9C,6EAAyD;AACzD,8DAA2D;AAE3D,+CAA6C;AAC7C,6DAA2D;AAC3D,gEAAkE;AAClE,+BAA8B;AAC9B,uCAAsC;AAetC,SAAgB,eAAe,CAAC,EAcT;IAbrB,IAAA,cAAc,oBAAA,EACA,SAAS,mBAAA,EACJ,cAAc,wBAAA,EACb,eAAe,yBAAA,EACnC,QAAQ,cAAA,EACR,QAAQ,cAAA,EACR,MAAM,YAAA,EACN,EAAE,QAAA,EACF,wBAAuB,EAAvB,gBAAgB,mBAAG,IAAI,KAAA,EACvB,MAAM,YAAA,EACN,IAAI,UAAA,EACJ,KAAK,WAAA,EACF,IAAI,cAbuB,8JAc/B,CADQ;IAED,IAAA,KAAgC,IAAA,gBAAQ,EAAC,gBAAgB,CAAC,EAAzD,WAAW,QAAA,EAAE,cAAc,QAA8B,CAAC;IACjE,IAAM,oBAAoB,GAAG,IAAA,aAAK,GAAE,CAAC;IAErC,OAAO,CACL,uCACE,SAAS,EAAE,IAAA,qBAAU,EAAC,IAAA,iCAAc,EAAC,MAAM,CAAC,EAAE,cAAc,CAAC,EAC7D,GAAG,EAAE,MAAM;QAEX,8BAAC,mBAAQ,IAAC,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE;YAClC,8BAAC,0BAAW,eACN,IAAA,yBAAiB,EAAC,IAAI,CAAC,qBACZ,oBAAoB,mBACpB,CAAC,WAAW,gBACf,SAAS,qBACJ,cAAc,sBACb,eAAe,EACjC,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,EAAE,EACN,OAAO,EAAE;oBACP,cAAc,CAAC,UAAC,aAAa,IAAK,OAAA,CAAC,aAAa,EAAd,CAAc,CAAC,CAAC;gBACpD,CAAC,EACD,IAAI,EAAE,IAAI,IAAI,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;gBAE7D,8BAAC,WAAI;oBACF,KAAK;oBAAE,GAAG;oBACX,8BAAC,wCAAoB,IAAC,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,GAAI,CAC9D,CACK,CACL;QACX,8BAAC,wCAAkB,IAAC,SAAS,EAAE,WAAW,EAAE,EAAE,EAAE,oBAAoB;YAClE,uCAAK,SAAS,EAAC,gBAAgB,IAAE,QAAQ,CAAO,CAC7B,CACjB,CACP,CAAC;AACJ,CAAC;AAjDD,0CAiDC"}
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import type { CommonComponentProps, ModifierProps } from '../types';
2
+ import type { CommonComponentProps, MarginModifierProp, ModifierClassProp } from '../types';
3
3
  import type { GetRef } from '../utils/refs';
4
- interface AttributeInputProps extends CommonComponentProps, ModifierProps {
4
+ interface AttributeInputProps extends CommonComponentProps, MarginModifierProp, ModifierClassProp {
5
5
  'aria-invalid'?: React.AriaAttributes['aria-invalid'];
6
6
  checked?: boolean;
7
7
  defaultChecked?: boolean;
@@ -16,5 +16,5 @@ interface AttributeInputProps extends CommonComponentProps, ModifierProps {
16
16
  tabIndex?: number;
17
17
  value: number | string;
18
18
  }
19
- export declare function AttributeInput({ _modifierClass, 'aria-describedby': ariaDescribedby, 'aria-invalid': ariaInvalid, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, defaultChecked, checked, disabled, getRef, id, label, name, value, onChange, readOnly, required, tabIndex, ...rest }: AttributeInputProps): React.JSX.Element;
19
+ export declare function AttributeInput({ _modifierClass, 'aria-describedby': ariaDescribedby, 'aria-invalid': ariaInvalid, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, defaultChecked, checked, disabled, getRef, id, label, margin, name, value, onChange, readOnly, required, tabIndex, ...rest }: AttributeInputProps): React.JSX.Element;
20
20
  export {};
@@ -29,11 +29,12 @@ exports.AttributeInput = void 0;
29
29
  var react_1 = __importDefault(require("react"));
30
30
  var class_names_1 = __importDefault(require("../utils/class_names"));
31
31
  var data_attributes_1 = __importDefault(require("../utils/data_attributes"));
32
+ var modifier_classes_1 = require("../utils/modifier_classes");
32
33
  var shared_hooks_1 = require("./shared_hooks");
33
34
  function AttributeInput(_a) {
34
- var _modifierClass = _a._modifierClass, ariaDescribedby = _a["aria-describedby"], ariaInvalid = _a["aria-invalid"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], defaultChecked = _a.defaultChecked, checked = _a.checked, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, label = _a.label, name = _a.name, value = _a.value, onChange = _a.onChange, readOnly = _a.readOnly, required = _a.required, tabIndex = _a.tabIndex, rest = __rest(_a, ["_modifierClass", 'aria-describedby', 'aria-invalid', 'aria-label', 'aria-labelledby', "defaultChecked", "checked", "disabled", "getRef", "id", "label", "name", "value", "onChange", "readOnly", "required", "tabIndex"]);
35
+ var _modifierClass = _a._modifierClass, ariaDescribedby = _a["aria-describedby"], ariaInvalid = _a["aria-invalid"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], defaultChecked = _a.defaultChecked, checked = _a.checked, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, label = _a.label, margin = _a.margin, name = _a.name, value = _a.value, onChange = _a.onChange, readOnly = _a.readOnly, required = _a.required, tabIndex = _a.tabIndex, rest = __rest(_a, ["_modifierClass", 'aria-describedby', 'aria-invalid', 'aria-label', 'aria-labelledby', "defaultChecked", "checked", "disabled", "getRef", "id", "label", "margin", "name", "value", "onChange", "readOnly", "required", "tabIndex"]);
35
36
  var attributeId = (0, shared_hooks_1.useFallbackId)(id);
36
- var selectorClassName = (0, class_names_1.default)('Attribute', _modifierClass);
37
+ var selectorClassName = (0, class_names_1.default)('Attribute', (0, modifier_classes_1.getMarginClass)(margin), _modifierClass);
37
38
  var labelClassName = (0, class_names_1.default)('Attribute__Label', {
38
39
  'Attribute__Label--read-only': readOnly
39
40
  });
@@ -1 +1 @@
1
- {"version":3,"file":"attribute_input.js","sourceRoot":"","sources":["../../../src/components/attribute_input.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAK1B,qEAA8C;AAC9C,6EAAyD;AAEzD,+CAA+C;AAkB/C,SAAgB,cAAc,CAAC,EAmBT;IAlBpB,IAAA,cAAc,oBAAA,EACM,eAAe,yBAAA,EACnB,WAAW,qBAAA,EACb,SAAS,mBAAA,EACJ,cAAc,wBAAA,EACjC,cAAc,oBAAA,EACd,OAAO,aAAA,EACP,QAAQ,cAAA,EACR,MAAM,YAAA,EACN,EAAE,QAAA,EACF,KAAK,WAAA,EACL,IAAI,UAAA,EACJ,KAAK,WAAA,EACL,QAAQ,cAAA,EACR,Q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AAS,EAAC,2BAA2B,IAAE,KAAK,CAAQ,CACpD,CACJ,CACP,CAAC;AACJ,CAAC;AA5DD,wCA4DC"}
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
- import type { CommonComponentProps, ModifierProps } from '../types';
2
+ import type { CommonComponentProps, MarginModifierProp, ModifierClassProp } from '../types';
3
3
  import type { GetRef } from '../utils/refs';
4
4
  type AttributesMap = {
5
5
  [name: string]: string;
6
6
  };
7
- interface AttributeSelectorProps extends CommonComponentProps, ModifierProps {
7
+ interface AttributeSelectorProps extends CommonComponentProps, MarginModifierProp, ModifierClassProp {
8
8
  /**
9
9
  * A mapping of each inputs `value` to is `<label>` text.
10
10
  */
@@ -18,5 +18,5 @@ interface AttributeSelectorProps extends CommonComponentProps, ModifierProps {
18
18
  required?: boolean;
19
19
  selected?: keyof AttributesMap;
20
20
  }
21
- export declare function AttributeSelector({ _modifierClass, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, attributes, disabled, getRef, id, name, onClick, readOnly, required, selected, ...rest }: AttributeSelectorProps): React.JSX.Element;
21
+ export declare function AttributeSelector({ _modifierClass, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, attributes, disabled, getRef, id, margin, name, onClick, readOnly, required, selected, ...rest }: AttributeSelectorProps): React.JSX.Element;
22
22
  export {};
@@ -29,9 +29,10 @@ exports.AttributeSelector = void 0;
29
29
  var react_1 = __importDefault(require("react"));
30
30
  var class_names_1 = __importDefault(require("../utils/class_names"));
31
31
  var data_attributes_1 = __importDefault(require("../utils/data_attributes"));
32
+ var modifier_classes_1 = require("../utils/modifier_classes");
32
33
  var attribute_input_1 = require("./attribute_input");
33
34
  function AttributeSelector(_a) {
34
- var _modifierClass = _a._modifierClass, ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaDescribedby = _a["aria-describedby"], attributes = _a.attributes, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, name = _a.name, onClick = _a.onClick, readOnly = _a.readOnly, required = _a.required, selected = _a.selected, rest = __rest(_a, ["_modifierClass", 'aria-label', 'aria-labelledby', 'aria-describedby', "attributes", "disabled", "getRef", "id", "name", "onClick", "readOnly", "required", "selected"]);
35
+ var _modifierClass = _a._modifierClass, ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaDescribedby = _a["aria-describedby"], attributes = _a.attributes, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, margin = _a.margin, name = _a.name, onClick = _a.onClick, readOnly = _a.readOnly, required = _a.required, selected = _a.selected, rest = __rest(_a, ["_modifierClass", 'aria-label', 'aria-labelledby', 'aria-describedby', "attributes", "disabled", "getRef", "id", "margin", "name", "onClick", "readOnly", "required", "selected"]);
35
36
  function handleAttributeSelected(_a) {
36
37
  var target = _a.target;
37
38
  if (onClick)
@@ -40,7 +41,7 @@ function AttributeSelector(_a) {
40
41
  function renderAttribute(attribute) {
41
42
  return (react_1.default.createElement(attribute_input_1.AttributeInput, { checked: selected !== undefined ? attribute === selected : undefined, disabled: disabled, id: "".concat(name, "[").concat(attribute, "]"), key: attribute, label: attributes[attribute], name: name, onChange: handleAttributeSelected, readOnly: readOnly, required: required, value: attribute }));
42
43
  }
43
- return (react_1.default.createElement("div", __assign({}, (0, data_attributes_1.default)(rest), { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, className: (0, class_names_1.default)('Attribute__Selector spacing-h--0.25', _modifierClass), id: id, ref: getRef }), Object.keys(attributes).map(renderAttribute)));
44
+ return (react_1.default.createElement("div", __assign({}, (0, data_attributes_1.default)(rest), { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, className: (0, class_names_1.default)('Attribute__Selector spacing-h--0.25', (0, modifier_classes_1.getMarginClass)(margin), _modifierClass), id: id, ref: getRef }), Object.keys(attributes).map(renderAttribute)));
44
45
  }
45
46
  exports.AttributeSelector = AttributeSelector;
46
47
  //# sourceMappingURL=attribute_selector.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"attribute_selector.js","sourceRoot":"","sources":["../../../src/components/attribute_selector.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAK1B,qEAA8C;AAC9C,6EAAyD;AAEzD,qDAAmD;AAqBnD,SAAgB,iBAAiB,CAAC,EAeT;IAdvB,IAAA,cAAc,oBAAA,EACA,SAAS,mBAAA,EACJ,cAAc,wBAAA,EACb,eAAe,yBAAA,EACnC,UAAU,gBAAA,EACV,QAAQ,cAAA,EACR,MAAM,YAAA,EACN,EAAE,QAAA,EACF,IAAI,UAAA,EACJ,OAAO,aAAA,EACP,QAAQ,cAAA,EACR,QAAQ,cAAA,EACR,QAAQ,cAAA,EACL,IAAI,cAdyB,wKAejC,CADQ;IAEP,SAAS,uBAAuB,CAAC,EAEK;YADpC,MAAM,YAAA;QAEN,IAAI,OAAO;YAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;IAED,SAAS,eAAe,CAAC,SAA8B;QACrD,OAAO,CACL,8BAAC,gCAAc,IACb,OAAO,EAAE,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,EACpE,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,UAAG,IAAI,cAAI,SAAS,MAAG,EAC3B,GAAG,EAAE,SAAS,EACd,KAAK,EAAE,UAAU,CAAC,SAAS,CAAC,EAC5B,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,uBAAuB,EACjC,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,SAAS,GAChB,CACH,CAAC;IACJ,CAAC;IAED,OAAO,CACL,kDACM,IAAA,yBAAiB,EAAC,IAAI,CAAC,kBACf,SAAS,qBACJ,cAAc,sBACb,eAAe,EACjC,SAAS,EAAE,IAAA,qBAAU,EACnB,qCAAqC,EACrC,cAAc,CACf,EACD,EAAE,EAAE,EAAE,EACN,GAAG,EAAE,MAAM,KAEV,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,CACzC,CACP,CAAC;AACJ,CAAC;AAvDD,8CAuDC"}
1
+ {"version":3,"file":"attribute_selector.js","sourceRoot":"","sources":["../../../src/components/attribute_selector.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAS1B,qEAA8C;AAC9C,6EAAyD;AACzD,8DAA2D;AAE3D,qDAAmD;AAwBnD,SAAgB,iBAAiB,CAAC,EAgBT;IAfvB,IAAA,cAAc,oBAAA,EACA,SAAS,mBAAA,EACJ,cAAc,wBAAA,EACb,eAAe,yBAAA,EACnC,UAAU,gBAAA,EACV,QAAQ,cAAA,EACR,MAAM,YAAA,EACN,EAAE,QAAA,EACF,MAAM,YAAA,EACN,IAAI,UAAA,EACJ,OAAO,aAAA,EACP,QAAQ,cAAA,EACR,QAAQ,cAAA,EACR,QAAQ,cAAA,EACL,IAAI,cAfyB,kLAgBjC,CADQ;IAEP,SAAS,uBAAuB,CAAC,EAEK;YADpC,MAAM,YAAA;QAEN,IAAI,OAAO;YAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;IAED,SAAS,eAAe,CAAC,SAA8B;QACrD,OAAO,CACL,8BAAC,gCAAc,IACb,OAAO,EAAE,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,EACpE,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,UAAG,IAAI,cAAI,SAAS,MAAG,EAC3B,GAAG,EAAE,SAAS,EACd,KAAK,EAAE,UAAU,CAAC,SAAS,CAAC,EAC5B,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,uBAAuB,EACjC,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,SAAS,GAChB,CACH,CAAC;IACJ,CAAC;IAED,OAAO,CACL,kDACM,IAAA,yBAAiB,EAAC,IAAI,CAAC,kBACf,SAAS,qBACJ,cAAc,sBACb,eAAe,EACjC,SAAS,EAAE,IAAA,qBAAU,EACnB,qCAAqC,EACrC,IAAA,iCAAc,EAAC,MAAM,CAAC,EACtB,cAAc,CACf,EACD,EAAE,EAAE,EAAE,EACN,GAAG,EAAE,MAAM,KAEV,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,CACzC,CACP,CAAC;AACJ,CAAC;AAzDD,8CAyDC"}
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import type { Colors, CommonComponentProps, ModifierProps } from '../types';
2
+ import type { Colors, CommonComponentProps, MarginModifierProp, ModifierClassProp } from '../types';
3
3
  import type { GetRef } from '../utils/refs';
4
- interface AvatarProps extends CommonComponentProps, ModifierProps {
4
+ interface AvatarProps extends CommonComponentProps, MarginModifierProp, ModifierClassProp {
5
5
  active?: boolean;
6
6
  avatarUrl: string | null;
7
7
  backgroundColor?: Colors;
@@ -13,5 +13,5 @@ interface AvatarProps extends CommonComponentProps, ModifierProps {
13
13
  textColor?: Colors;
14
14
  title?: string;
15
15
  }
16
- export declare function Avatar({ _modifierClass, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, active, avatarUrl, backgroundColor, getRef, id, name, outlineColor, size, textColor, title, ...rest }: AvatarProps): React.JSX.Element;
16
+ export declare function Avatar({ _modifierClass, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, active, avatarUrl, backgroundColor, getRef, id, margin, name, outlineColor, size, textColor, title, ...rest }: AvatarProps): React.JSX.Element;
17
17
  export {};
@@ -53,6 +53,7 @@ var react_1 = __importStar(require("react"));
53
53
  var class_names_1 = __importDefault(require("../utils/class_names"));
54
54
  var strings_1 = require("../utils/strings");
55
55
  var data_attributes_1 = __importDefault(require("../utils/data_attributes"));
56
+ var modifier_classes_1 = require("../utils/modifier_classes");
56
57
  var FONT_SIZE_RATIO = 0.375;
57
58
  function fontSizeStyle(size) {
58
59
  var calculatedSize = typeof size === 'number' ? "".concat(size, "px") : size;
@@ -60,7 +61,7 @@ function fontSizeStyle(size) {
60
61
  }
61
62
  function Avatar(_a) {
62
63
  var _b;
63
- var _modifierClass = _a._modifierClass, ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaDescribedby = _a["aria-describedby"], _c = _a.active, active = _c === void 0 ? false : _c, avatarUrl = _a.avatarUrl, _d = _a.backgroundColor, backgroundColor = _d === void 0 ? 'dscout' : _d, getRef = _a.getRef, id = _a.id, name = _a.name, _e = _a.outlineColor, outlineColor = _e === void 0 ? 'dscout' : _e, size = _a.size, _f = _a.textColor, textColor = _f === void 0 ? 'invert' : _f, title = _a.title, rest = __rest(_a, ["_modifierClass", 'aria-label', 'aria-labelledby', 'aria-describedby', "active", "avatarUrl", "backgroundColor", "getRef", "id", "name", "outlineColor", "size", "textColor", "title"]);
64
+ var _modifierClass = _a._modifierClass, ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaDescribedby = _a["aria-describedby"], _c = _a.active, active = _c === void 0 ? false : _c, avatarUrl = _a.avatarUrl, _d = _a.backgroundColor, backgroundColor = _d === void 0 ? 'dscout' : _d, getRef = _a.getRef, id = _a.id, margin = _a.margin, name = _a.name, _e = _a.outlineColor, outlineColor = _e === void 0 ? 'dscout' : _e, size = _a.size, _f = _a.textColor, textColor = _f === void 0 ? 'invert' : _f, title = _a.title, rest = __rest(_a, ["_modifierClass", 'aria-label', 'aria-labelledby', 'aria-describedby', "active", "avatarUrl", "backgroundColor", "getRef", "id", "margin", "name", "outlineColor", "size", "textColor", "title"]);
64
65
  var _g = (0, react_1.useState)(false), loaded = _g[0], setLoaded = _g[1];
65
66
  (0, react_1.useEffect)(function () {
66
67
  setLoaded(false);
@@ -73,7 +74,7 @@ function Avatar(_a) {
73
74
  };
74
75
  img.src = avatarUrl;
75
76
  }, [avatarUrl]);
76
- var className = (0, class_names_1.default)('Avatar', _modifierClass, (_b = {
77
+ var className = (0, class_names_1.default)('Avatar', _modifierClass, (0, modifier_classes_1.getMarginClass)(margin), (_b = {
77
78
  'Avatar--loaded': loaded,
78
79
  'Avatar--active': active
79
80
  },
@@ -1 +1 @@
1
- {"version":3,"file":"avatar.js","sourceRoot":"","sources":["../../../src/components/avatar.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAmD;AAKnD,qEAA8C;AAC9C,4CAA+C;AAC/C,6EAAyD;AAezD,IAAM,eAAe,GAAG,KAAK,CAAC;AAE9B,SAAS,aAAa,CAAC,IAAqB;IAC1C,IAAM,cAAc,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAG,IAAI,OAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IAErE,OAAO,EAAE,QAAQ,EAAE,eAAQ,cAAc,gBAAM,eAAe,MAAG,EAAE,CAAC;AACtE,CAAC;AAED,SAAgB,MAAM,CAAC,EAgBT;;IAfZ,IAAA,cAAc,oBAAA,EACA,SAAS,mBAAA,EACJ,cAAc,wBAAA,EACb,eAAe,yBAAA,EACnC,cAAc,EAAd,MAAM,mBAAG,KAAK,KAAA,EACd,SAAS,eAAA,EACT,uBAA0B,EAA1B,eAAe,mBAAG,QAAQ,KAAA,EAC1B,MAAM,YAAA,EACN,EAAE,QAAA,EACF,IAAI,UAAA,EACJ,oBAAuB,EAAvB,YAAY,mBAAG,QAAQ,KAAA,EACvB,IAAI,UAAA,EACJ,iBAAoB,EAApB,SAAS,mBAAG,QAAQ,KAAA,EACpB,KAAK,WAAA,EACF,IAAI,cAfc,uLAgBtB,CADQ;IAED,IAAA,KAAsB,IAAA,gBAAQ,EAAC,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EAAE,CAAC;QAEtB,GAAG,CAAC,MAAM,GAAG;YACX,SAAS,CAAC,IAAI,CAAC,CAAC;YAChB,GAAG,GAAG,IAAI,CAAC;QACb,CAAC,CAAC;QACF,GAAG,CAAC,GAAG,GAAG,SAAS,CAAC;IACtB,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhB,IAAM,SAAS,GAAG,IAAA,qBAAU,EAC1B,QAAQ,EACR,cAAc,EACd,IAAA,iCAAc,EAAC,MAAM,CAAC;YAEpB,gBAAgB,EAAE,MAAM;YACxB,gBAAgB,EAAE,MAAM;;QACxB,GAAC,oBAAa,eAAe,CAAE,IAAG,eAAe;QACjD,GAAC,iBAAU,SAAS,CAAE,IAAG,SAAS;YAErC,CAAC;IACF,IAAM,KAAK,GAAG;QACZ,eAAe,EAAE,MAAM,CAAC,CAAC,CAAC,eAAQ,SAAS,OAAI,CAAC,CAAC,CAAC,SAAS;QAC3D,MAAM,EAAE,IAAI;QACZ,YAAY,EAAE,uBAAgB,YAAY,MAAG;QAC7C,KAAK,EAAE,IAAI;KACZ,CAAC;IAEF,OAAO,CACL,kDACM,IAAA,yBAAiB,EAAC,IAAI,CAAC,kBACf,SAAS,qBACJ,cAAc,sBACb,eAAe,EACjC,SAAS,EAAE,SAAS,EACpB,EAAE,EAAE,EAAE,EACN,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,IAAI,IAAI,KAEnB,CAAC,MAAM,IAAI,CACV,wCACE,SAAS,EAAC,kBAAkB,EAC5B,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,IAEvC,IAAA,qBAAW,EAAC,IAAI,CAAC,CACb,CACR,CACG,CACP,CAAC;AACJ,CAAC;AA1ED,wBA0EC"}
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { CommonComponentProps, ModifierProps } from '../types';
2
+ import type { CommonComponentProps, MarginModifierProp, ModifierClassProp } from '../types';
3
3
  import type { GetRef } from '../utils/refs';
4
4
  declare const COLORS: readonly ["alert", "close", "coachmark", "dscout", "archive", "none", "success", "note", "screener", "live", "diary", "test", "invert", "black", "white"];
5
5
  declare const SIZES: readonly ["tiny", "small", "big"];
@@ -9,7 +9,7 @@ type Colors = (typeof COLORS)[number];
9
9
  type Sizes = (typeof SIZES)[number];
10
10
  type Widths = (typeof WIDTHS)[number];
11
11
  type Variants = (typeof VARIANTS)[number];
12
- interface ButtonProps extends CommonComponentProps, ModifierProps {
12
+ interface ButtonProps extends CommonComponentProps, MarginModifierProp, ModifierClassProp {
13
13
  'aria-controls'?: string;
14
14
  'aria-expanded'?: React.AriaAttributes['aria-expanded'];
15
15
  'aria-pressed'?: boolean;
@@ -32,5 +32,5 @@ interface ButtonProps extends CommonComponentProps, ModifierProps {
32
32
  width?: Widths;
33
33
  variant?: Variants;
34
34
  }
35
- export declare function Button({ _modifierClass, 'aria-controls': ariaControls, 'aria-expanded': ariaExpanded, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, 'aria-pressed': ariaPressed, children, color, disabled, getRef, id, linkComponent, linkProps, name, onClick, onMouseUp, onMouseDown, refProp, size, tabIndex, title, type, width, variant, ...rest }: ButtonProps): React.JSX.Element;
35
+ export declare function Button({ _modifierClass, 'aria-controls': ariaControls, 'aria-expanded': ariaExpanded, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, 'aria-pressed': ariaPressed, children, color, disabled, getRef, id, linkComponent, linkProps, margin, name, onClick, onMouseUp, onMouseDown, refProp, size, tabIndex, title, type, width, variant, ...rest }: ButtonProps): React.JSX.Element;
36
36
  export {};
@@ -29,6 +29,7 @@ exports.Button = void 0;
29
29
  var react_1 = __importDefault(require("react"));
30
30
  var class_names_1 = __importDefault(require("../utils/class_names"));
31
31
  var data_attributes_1 = __importDefault(require("../utils/data_attributes"));
32
+ var modifier_classes_1 = require("../utils/modifier_classes");
32
33
  var common_button_1 = require("./common_button");
33
34
  var COLORS = [
34
35
  'alert',
@@ -66,8 +67,8 @@ function supportedClassFor(type, value) {
66
67
  }
67
68
  }
68
69
  function Button(_a) {
69
- var _modifierClass = _a._modifierClass, ariaControls = _a["aria-controls"], ariaExpanded = _a["aria-expanded"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaDescribedby = _a["aria-describedby"], ariaPressed = _a["aria-pressed"], children = _a.children, color = _a.color, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, linkComponent = _a.linkComponent, linkProps = _a.linkProps, name = _a.name, onClick = _a.onClick, onMouseUp = _a.onMouseUp, onMouseDown = _a.onMouseDown, refProp = _a.refProp, size = _a.size, tabIndex = _a.tabIndex, title = _a.title, type = _a.type, width = _a.width, variant = _a.variant, rest = __rest(_a, ["_modifierClass", 'aria-controls', 'aria-expanded', 'aria-label', 'aria-labelledby', 'aria-describedby', 'aria-pressed', "children", "color", "disabled", "getRef", "id", "linkComponent", "linkProps", "name", "onClick", "onMouseUp", "onMouseDown", "refProp", "size", "tabIndex", "title", "type", "width", "variant"]);
70
- var className = (0, class_names_1.default)('Button', supportedClassFor('size', size), supportedClassFor('width', width), supportedClassFor('variant', variant), supportedClassFor('color', color), _modifierClass);
70
+ var _modifierClass = _a._modifierClass, ariaControls = _a["aria-controls"], ariaExpanded = _a["aria-expanded"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaDescribedby = _a["aria-describedby"], ariaPressed = _a["aria-pressed"], children = _a.children, color = _a.color, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, linkComponent = _a.linkComponent, linkProps = _a.linkProps, margin = _a.margin, name = _a.name, onClick = _a.onClick, onMouseUp = _a.onMouseUp, onMouseDown = _a.onMouseDown, refProp = _a.refProp, size = _a.size, tabIndex = _a.tabIndex, title = _a.title, type = _a.type, width = _a.width, variant = _a.variant, rest = __rest(_a, ["_modifierClass", 'aria-controls', 'aria-expanded', 'aria-label', 'aria-labelledby', 'aria-describedby', 'aria-pressed', "children", "color", "disabled", "getRef", "id", "linkComponent", "linkProps", "margin", "name", "onClick", "onMouseUp", "onMouseDown", "refProp", "size", "tabIndex", "title", "type", "width", "variant"]);
71
+ var className = (0, class_names_1.default)('Button', supportedClassFor('size', size), supportedClassFor('width', width), supportedClassFor('variant', variant), supportedClassFor('color', color), _modifierClass, (0, modifier_classes_1.getMarginClass)(margin));
71
72
  return (react_1.default.createElement(common_button_1.CommonButton, __assign({}, (0, data_attributes_1.default)(rest), { "aria-controls": ariaControls, "aria-expanded": ariaExpanded, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, "aria-pressed": ariaPressed, className: className, disabled: disabled, getRef: getRef, id: id, linkComponent: linkComponent, linkProps: linkProps, name: name, onClick: onClick, onMouseUp: onMouseUp, onMouseDown: onMouseDown, refProp: refProp, tabIndex: tabIndex, title: title, type: type }), children));
72
73
  }
73
74
  exports.Button = Button;
@@ -1 +1 @@
1
- {"version":3,"file":"button.js","sourceRoot":"","sources":["../../../src/components/button.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAK1B,qEAA8C;AAC9C,6EAAyD;AAEzD,iDAA+C;AAE/C,IAAM,MAAM,GAAG;IACb,OAAO;IACP,OAAO;IACP,WAAW;IACX,QAAQ;IACR,SAAS;IACT,MAAM;IACN,SAAS;IACT,MAAM;IACN,UAAU;IACV,MAAM;IACN,OAAO;IACP,MAAM;IACN,QAAQ;IACR,OAAO;IACP,OAAO;CACC,CAAC;AAEX,IAAM,KAAK,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,CAAU,CAAC;AAEhD,IAAM,MAAM,GAAG,CAAC,WAAW,EAAE,OAAO,CAAU,CAAC;AAE/C,IAAM,QAAQ,GAAG,CAAC,OAAO,EAAE,SAAS,CAAU,CAAC;AAE/C,IAAM,KAAK,GAAG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AC,EACjC,cAAc,CACf,CAAC;IAEF,OAAO,CACL,8BAAC,4BAAY,eACP,IAAA,yBAAiB,EAAC,IAAI,CAAC,qBACZ,YAAY,mBACZ,YAAY,gBACf,SAAS,qBACJ,cAAc,sBACb,eAAe,kBACnB,WAAW,EACzB,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,EAAE,EACN,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,KAET,QAAQ,CACI,CAChB,CAAC;AACJ,CAAC;AAhED,wBAgEC"}
1
+ {"version":3,"file":"button.js","sourceRoot":"","sources":["../../../src/components/button.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAS1B,qEAA8C;AAC9C,6EAAyD;AACzD,8DAA2D;AAE3D,iDAA+C;AAE/C,IAAM,MAAM,GAAG;IACb,OAAO;IACP,OAAO;IACP,WAAW;IACX,QAAQ;IACR,SAAS;IACT,MAAM;IACN,SAAS;IACT,MAAM;IACN,UAAU;IACV,MAAM;IACN,OAAO;IACP,MAAM;IACN,QAAQ;IACR,OAAO;IACP,OAAO;CACC,CAAC;AAEX,IAAM,KAAK,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,CAAU,CAAC;AAEhD,IAAM,MAAM,GAAG,CAAC,WAAW,EAAE,OAAO,CAAU,CAAC;AAE/C,IAAM,QAAQ,GAAG,CAAC,OAAO,EAAE,SAAS,CAAU,CAAC;AAE/C,IAAM,KAAK,GAAG;IACZ,KAAK,EAAE,MAAM;IACb,IAAI,EAAE,KAAK;IACX,KAAK,EAAE,M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C,CACvB,CAAC;IAEF,OAAO,CACL,8BAAC,4BAAY,eACP,IAAA,yBAAiB,EAAC,IAAI,CAAC,qBACZ,YAAY,mBACZ,YAAY,gBACf,SAAS,qBACJ,cAAc,sBACb,eAAe,kBACnB,WAAW,EACzB,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,EAAE,EACN,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,KAET,QAAQ,CACI,CAChB,CAAC;AACJ,CAAC;AAlED,wBAkEC"}
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { GetRef } from '../utils/refs';
3
- import type { CommonComponentProps, ModifierProps } from '../types';
4
- interface ButtonControlProps extends CommonComponentProps, ModifierProps {
3
+ import type { CommonComponentProps, MarginModifierProp, ModifierClassProp } from '../types';
4
+ interface ButtonControlProps extends CommonComponentProps, MarginModifierProp, ModifierClassProp {
5
5
  active?: boolean;
6
6
  'aria-controls'?: string;
7
7
  'aria-expanded'?: React.AriaAttributes['aria-expanded'];
@@ -13,5 +13,5 @@ interface ButtonControlProps extends CommonComponentProps, ModifierProps {
13
13
  onClick?: React.MouseEventHandler<HTMLButtonElement>;
14
14
  title?: string;
15
15
  }
16
- export declare function ButtonControl({ _modifierClass, active, 'aria-controls': ariaControls, 'aria-expanded': ariaExpanded, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, children, disabled, getRef, id, name, onClick, title, ...rest }: ButtonControlProps): React.JSX.Element;
16
+ export declare function ButtonControl({ _modifierClass, active, 'aria-controls': ariaControls, 'aria-expanded': ariaExpanded, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, children, disabled, getRef, id, margin, name, onClick, title, ...rest }: ButtonControlProps): React.JSX.Element;
17
17
  export {};
@@ -29,9 +29,10 @@ exports.ButtonControl = void 0;
29
29
  var react_1 = __importDefault(require("react"));
30
30
  var class_names_1 = __importDefault(require("../utils/class_names"));
31
31
  var data_attributes_1 = __importDefault(require("../utils/data_attributes"));
32
+ var modifier_classes_1 = require("../utils/modifier_classes");
32
33
  function ButtonControl(_a) {
33
- var _modifierClass = _a._modifierClass, active = _a.active, ariaControls = _a["aria-controls"], ariaExpanded = _a["aria-expanded"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaDescribedby = _a["aria-describedby"], children = _a.children, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, name = _a.name, onClick = _a.onClick, title = _a.title, rest = __rest(_a, ["_modifierClass", "active", 'aria-controls', 'aria-expanded', 'aria-label', 'aria-labelledby', 'aria-describedby', "children", "disabled", "getRef", "id", "name", "onClick", "title"]);
34
- var className = (0, class_names_1.default)('Button__Control', _modifierClass, {
34
+ var _modifierClass = _a._modifierClass, active = _a.active, ariaControls = _a["aria-controls"], ariaExpanded = _a["aria-expanded"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaDescribedby = _a["aria-describedby"], children = _a.children, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, margin = _a.margin, name = _a.name, onClick = _a.onClick, title = _a.title, rest = __rest(_a, ["_modifierClass", "active", 'aria-controls', 'aria-expanded', 'aria-label', 'aria-labelledby', 'aria-describedby', "children", "disabled", "getRef", "id", "margin", "name", "onClick", "title"]);
35
+ var className = (0, class_names_1.default)('Button__Control', _modifierClass, (0, modifier_classes_1.getMarginClass)(margin), {
35
36
  'Button__Control--active': active
36
37
  });
37
38
  return (react_1.default.createElement("button", __assign({}, (0, data_attributes_1.default)(rest), { "aria-controls": ariaControls, "aria-expanded": ariaExpanded, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, className: className, disabled: disabled, id: id, name: name, onClick: onClick, ref: getRef, title: title, type: "button" }), children));
@@ -1 +1 @@
1
- {"version":3,"file":"button_control.js","sourceRoot":"","sources":["../../../src/components/button_control.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAK1B,qEAA8C;AAC9C,6EAAyD;AAezD,SAAgB,aAAa,CAAC,EAgBT;IAfnB,IAAA,cAAc,oBAAA,EACd,MAAM,YAAA,EACW,YAAY,sBAAA,EACZ,YAAY,sBAAA,EACf,SAAS,mBAAA,EACJ,cAAc,wBAAA,EACb,eAAe,yBAAA,EACnC,QAAQ,cAAA,EACR,QAAQ,cAAA,EACR,MAAM,YAAA,EACN,EAAE,QAAA,EACF,IAAI,UAAA,EACJ,OAAO,aAAA,EACP,KAAK,WAAA,EACF,IAAI,cAfqB,uLAgB7B,CADQ;IAEP,IAAM,SAAS,GAAG,IAAA,qBAAU,EAAC,iBAAiB,EAAE,cAAc,EAAE;QAC9D,yBAAyB,EAAE,MAAM;KAClC,CAAC,CAAC;IAEH,OAAO,CACL,qDACM,IAAA,yBAAiB,EAAC,IAAI,CAAC,qBACZ,YAAY,mBACZ,YAAY,gBACf,SAAS,qBACJ,cAAc,sBACb,eAAe,EACjC,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,KAAK,EACZ,IAAI,EAAC,QAAQ,KAEZ,QAAQ,CACF,CACV,CAAC;AACJ,CAAC;AAzCD,sCAyCC"}
1
+ {"version":3,"file":"button_control.js","sourceRoot":"","sources":["../../../src/components/button_control.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAS1B,qEAA8C;AAC9C,6EAAyD;AACzD,8DAA2D;AAkB3D,SAAgB,aAAa,CAAC,EAiBT;IAhBnB,IAAA,cAAc,oBAAA,EACd,MAAM,YAAA,EACW,YAAY,sBAAA,EACZ,YAAY,sBAAA,EACf,SAAS,mBAAA,EACJ,cAAc,wBAAA,EACb,eAAe,yBAAA,EACnC,QAAQ,cAAA,EACR,QAAQ,cAAA,EACR,MAAM,YAAA,EACN,EAAE,QAAA,EACF,MAAM,YAAA,EACN,IAAI,UAAA,EACJ,OAAO,aAAA,EACP,KAAK,WAAA,EACF,IAAI,cAhBqB,iMAiB7B,CADQ;IAEP,IAAM,SAAS,GAAG,IAAA,qBAAU,EAC1B,iBAAiB,EACjB,cAAc,EACd,IAAA,iCAAc,EAAC,MAAM,CAAC,EACtB;QACE,yBAAyB,EAAE,MAAM;KAClC,CACF,CAAC;IAEF,OAAO,CACL,qDACM,IAAA,yBAAiB,EAAC,IAAI,CAAC,qBACZ,YAAY,mBACZ,YAAY,gBACf,SAAS,qBACJ,cAAc,sBACb,eAAe,EACjC,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,KAAK,EACZ,IAAI,EAAC,QAAQ,KAEZ,QAAQ,CACF,CACV,CAAC;AACJ,CAAC;AA/CD,sCA+CC"}
@@ -1,20 +1,20 @@
1
1
  import React from 'react';
2
2
  import type { GetRef } from '../utils/refs';
3
- import type { CommonComponentProps, ModifierProps } from '../types';
4
- interface ButtonIconProps extends CommonComponentProps, ModifierProps {
3
+ import type { Colors, CommonComponentProps, MarginModifierProp, ModifierClassProp, Radii } from '../types';
4
+ interface ButtonIconProps extends CommonComponentProps, MarginModifierProp, ModifierClassProp {
5
5
  'aria-controls'?: string;
6
6
  'aria-expanded'?: React.AriaAttributes['aria-expanded'];
7
7
  'aria-pressed'?: boolean;
8
- bgColor?: string;
8
+ bgColor?: Colors;
9
9
  bgSize?: string | number;
10
- borderColor?: string;
10
+ borderColor?: Colors;
11
11
  children?: React.ReactNode;
12
- color?: string;
12
+ color?: Colors;
13
13
  disabled?: boolean;
14
14
  getRef?: GetRef<HTMLButtonElement>;
15
- hoverBgColor?: string;
16
- hoverBorderColor?: string;
17
- hoverColor?: string;
15
+ hoverBgColor?: Colors;
16
+ hoverBorderColor?: Colors;
17
+ hoverColor?: Colors;
18
18
  hoverBgSize?: string | number;
19
19
  id?: string;
20
20
  linkComponent?: 'a' | React.ComponentType;
@@ -23,10 +23,10 @@ interface ButtonIconProps extends CommonComponentProps, ModifierProps {
23
23
  onClick?: React.MouseEventHandler<HTMLButtonElement>;
24
24
  onMouseUp?: React.MouseEventHandler<HTMLButtonElement>;
25
25
  onMouseDown?: React.MouseEventHandler<HTMLButtonElement>;
26
- radius?: string;
26
+ radius?: Radii;
27
27
  refProp?: string;
28
28
  title?: string;
29
29
  type?: 'button' | 'submit';
30
30
  }
31
- export declare function ButtonIcon({ _modifierClass, 'aria-controls': ariaControls, 'aria-expanded': ariaExpanded, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, 'aria-pressed': ariaPressed, bgColor, bgSize, borderColor, children, color, disabled, getRef, hoverBgColor, hoverBorderColor, hoverColor, hoverBgSize, id, linkComponent, linkProps, name, onClick, onMouseUp, radius, onMouseDown, refProp, title, type, ...rest }: ButtonIconProps): React.JSX.Element;
31
+ export declare function ButtonIcon({ _modifierClass, 'aria-controls': ariaControls, 'aria-expanded': ariaExpanded, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, 'aria-pressed': ariaPressed, bgColor, bgSize, borderColor, children, color, disabled, getRef, hoverBgColor, hoverBorderColor, hoverColor, hoverBgSize, id, linkComponent, linkProps, margin, name, onClick, onMouseUp, radius, onMouseDown, refProp, title, type, ...rest }: ButtonIconProps): React.JSX.Element;
32
32
  export {};
@@ -52,13 +52,14 @@ exports.ButtonIcon = void 0;
52
52
  var react_1 = __importStar(require("react"));
53
53
  var class_names_1 = __importDefault(require("../utils/class_names"));
54
54
  var data_attributes_1 = __importDefault(require("../utils/data_attributes"));
55
+ var modifier_classes_1 = require("../utils/modifier_classes");
55
56
  var common_button_1 = require("./common_button");
56
57
  var DEFAULT_COLOR = 'gray-1';
57
58
  var DEFAULT_HOVER_COLOR = 'main';
58
59
  var DEFAULT_DISABLED_COLOR = 'gray-3';
59
60
  var DEFAULT_RADIUS = 'circle';
60
61
  function ButtonIcon(_a) {
61
- var _modifierClass = _a._modifierClass, ariaControls = _a["aria-controls"], ariaExpanded = _a["aria-expanded"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaDescribedby = _a["aria-describedby"], ariaPressed = _a["aria-pressed"], bgColor = _a.bgColor, bgSize = _a.bgSize, borderColor = _a.borderColor, children = _a.children, color = _a.color, disabled = _a.disabled, getRef = _a.getRef, hoverBgColor = _a.hoverBgColor, hoverBorderColor = _a.hoverBorderColor, hoverColor = _a.hoverColor, hoverBgSize = _a.hoverBgSize, id = _a.id, linkComponent = _a.linkComponent, linkProps = _a.linkProps, name = _a.name, onClick = _a.onClick, onMouseUp = _a.onMouseUp, radius = _a.radius, onMouseDown = _a.onMouseDown, refProp = _a.refProp, title = _a.title, type = _a.type, rest = __rest(_a, ["_modifierClass", 'aria-controls', 'aria-expanded', 'aria-label', 'aria-labelledby', 'aria-describedby', 'aria-pressed', "bgColor", "bgSize", "borderColor", "children", "color", "disabled", "getRef", "hoverBgColor", "hoverBorderColor", "hoverColor", "hoverBgSize", "id", "linkComponent", "linkProps", "name", "onClick", "onMouseUp", "radius", "onMouseDown", "refProp", "title", "type"]);
62
+ var _modifierClass = _a._modifierClass, ariaControls = _a["aria-controls"], ariaExpanded = _a["aria-expanded"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaDescribedby = _a["aria-describedby"], ariaPressed = _a["aria-pressed"], bgColor = _a.bgColor, bgSize = _a.bgSize, borderColor = _a.borderColor, children = _a.children, color = _a.color, disabled = _a.disabled, getRef = _a.getRef, hoverBgColor = _a.hoverBgColor, hoverBorderColor = _a.hoverBorderColor, hoverColor = _a.hoverColor, hoverBgSize = _a.hoverBgSize, id = _a.id, linkComponent = _a.linkComponent, linkProps = _a.linkProps, margin = _a.margin, name = _a.name, onClick = _a.onClick, onMouseUp = _a.onMouseUp, radius = _a.radius, onMouseDown = _a.onMouseDown, refProp = _a.refProp, title = _a.title, type = _a.type, rest = __rest(_a, ["_modifierClass", 'aria-controls', 'aria-expanded', 'aria-label', 'aria-labelledby', 'aria-describedby', 'aria-pressed', "bgColor", "bgSize", "borderColor", "children", "color", "disabled", "getRef", "hoverBgColor", "hoverBorderColor", "hoverColor", "hoverBgSize", "id", "linkComponent", "linkProps", "margin", "name", "onClick", "onMouseUp", "radius", "onMouseDown", "refProp", "title", "type"]);
62
63
  var _b = (0, react_1.useState)(false), hovered = _b[0], setHovered = _b[1];
63
64
  function getBgColorClass() {
64
65
  var colorEnum = bgColor;
@@ -97,7 +98,7 @@ function ButtonIcon(_a) {
97
98
  }
98
99
  return "rounded--".concat(radiusEnum);
99
100
  }
100
- var btnClass = (0, class_names_1.default)('Button-Icon', getBgColorClass(), getColorClass(), getBorderColorClass(), getRadiusClass(), _modifierClass);
101
+ var btnClass = (0, class_names_1.default)('Button-Icon', getBgColorClass(), getColorClass(), getBorderColorClass(), getRadiusClass(), (0, modifier_classes_1.getMarginClass)(margin), _modifierClass);
101
102
  var style = {
102
103
  height: hovered ? hoverBgSize || bgSize : bgSize,
103
104
  width: hovered ? hoverBgSize || bgSize : bgSize