@clickhouse/click-ui 0.7.0 → 0.8.0

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 (305) hide show
  1. package/dist/cjs/click-ui.css +1543 -71
  2. package/dist/cjs/components/AutoComplete/AutoComplete.css +97 -0
  3. package/dist/cjs/components/AutoComplete/AutoComplete.module.css.cjs +18 -0
  4. package/dist/cjs/components/AutoComplete/AutoComplete.module.css.cjs.map +1 -0
  5. package/dist/cjs/components/AutoComplete/index.cjs +14 -74
  6. package/dist/cjs/components/AutoComplete/index.cjs.map +1 -1
  7. package/dist/cjs/components/Button/BaseButton.cjs +10 -31
  8. package/dist/cjs/components/Button/BaseButton.cjs.map +1 -1
  9. package/dist/cjs/components/Button/BaseButton.css +40 -0
  10. package/dist/cjs/components/Button/BaseButton.module.css.cjs +10 -0
  11. package/dist/cjs/components/Button/BaseButton.module.css.cjs.map +1 -0
  12. package/dist/cjs/components/CardPromotion/CardPromotion.css +52 -0
  13. package/dist/cjs/components/CardPromotion/CardPromotion.module.css.cjs +21 -0
  14. package/dist/cjs/components/CardPromotion/CardPromotion.module.css.cjs.map +1 -0
  15. package/dist/cjs/components/CardPromotion/index.cjs +8 -54
  16. package/dist/cjs/components/CardPromotion/index.cjs.map +1 -1
  17. package/dist/cjs/components/CodeBlock/CodeBlock.css +48 -0
  18. package/dist/cjs/components/CodeBlock/CodeBlock.module.css.cjs +22 -0
  19. package/dist/cjs/components/CodeBlock/CodeBlock.module.css.cjs.map +1 -0
  20. package/dist/cjs/components/CodeBlock/InlineCodeBlock.cjs +7 -14
  21. package/dist/cjs/components/CodeBlock/InlineCodeBlock.cjs.map +1 -1
  22. package/dist/cjs/components/CodeBlock/InlineCodeBlock.css +10 -0
  23. package/dist/cjs/components/CodeBlock/InlineCodeBlock.module.css.cjs +12 -0
  24. package/dist/cjs/components/CodeBlock/InlineCodeBlock.module.css.cjs.map +1 -0
  25. package/dist/cjs/components/CodeBlock/index.cjs +18 -49
  26. package/dist/cjs/components/CodeBlock/index.cjs.map +1 -1
  27. package/dist/cjs/components/CodeBlock/useColorStyle.cjs +15 -0
  28. package/dist/cjs/components/CodeBlock/useColorStyle.cjs.map +1 -1
  29. package/dist/cjs/components/ContextMenu/ContextMenu.css +12 -0
  30. package/dist/cjs/components/ContextMenu/ContextMenu.module.css.cjs +8 -1
  31. package/dist/cjs/components/ContextMenu/ContextMenu.module.css.cjs.map +1 -1
  32. package/dist/cjs/components/ContextMenu/index.cjs +8 -20
  33. package/dist/cjs/components/ContextMenu/index.cjs.map +1 -1
  34. package/dist/cjs/components/CrossButton/CrossButton.css +12 -0
  35. package/dist/cjs/components/CrossButton/CrossButton.module.css.cjs +10 -0
  36. package/dist/cjs/components/CrossButton/CrossButton.module.css.cjs.map +1 -0
  37. package/dist/cjs/components/CrossButton/index.cjs +11 -18
  38. package/dist/cjs/components/CrossButton/index.cjs.map +1 -1
  39. package/dist/cjs/components/DatePicker/DateTimeRangePicker.cjs +1 -1
  40. package/dist/cjs/components/DatePicker/DateTimeRangePicker.cjs.map +1 -1
  41. package/dist/cjs/components/Dropdown/Dropdown.css +23 -0
  42. package/dist/cjs/components/Dropdown/Dropdown.module.css.cjs +3 -1
  43. package/dist/cjs/components/Dropdown/Dropdown.module.css.cjs.map +1 -1
  44. package/dist/cjs/components/Dropdown/index.cjs +12 -23
  45. package/dist/cjs/components/Dropdown/index.cjs.map +1 -1
  46. package/dist/cjs/components/EllipsisContent/EllipsisContent.css +21 -0
  47. package/dist/cjs/components/EllipsisContent/EllipsisContent.module.css.cjs +10 -0
  48. package/dist/cjs/components/EllipsisContent/EllipsisContent.module.css.cjs.map +1 -0
  49. package/dist/cjs/components/EllipsisContent/index.cjs +7 -6
  50. package/dist/cjs/components/EllipsisContent/index.cjs.map +1 -1
  51. package/dist/cjs/components/EmptyButton/EmptyButton.css +21 -0
  52. package/dist/cjs/components/EmptyButton/EmptyButton.module.css.cjs +10 -0
  53. package/dist/cjs/components/EmptyButton/EmptyButton.module.css.cjs.map +1 -0
  54. package/dist/cjs/components/EmptyButton/index.cjs +10 -4
  55. package/dist/cjs/components/EmptyButton/index.cjs.map +1 -1
  56. package/dist/cjs/components/FileTabs/FileTabs.css +167 -0
  57. package/dist/cjs/components/FileTabs/FileTabs.module.css.cjs +38 -0
  58. package/dist/cjs/components/FileTabs/FileTabs.module.css.cjs.map +1 -0
  59. package/dist/cjs/components/FileTabs/index.cjs +51 -80
  60. package/dist/cjs/components/FileTabs/index.cjs.map +1 -1
  61. package/dist/cjs/components/FileUpload/FileMultiUpload.cjs +3 -9
  62. package/dist/cjs/components/FileUpload/FileMultiUpload.cjs.map +1 -1
  63. package/dist/cjs/components/FileUpload/FileMultiUpload.css +8 -0
  64. package/dist/cjs/components/FileUpload/FileMultiUpload.module.css.cjs +10 -0
  65. package/dist/cjs/components/FileUpload/FileMultiUpload.module.css.cjs.map +1 -0
  66. package/dist/cjs/components/FileUpload/FileUpload.stories-common.css +14 -0
  67. package/dist/cjs/components/FileUpload/FileUploadArea.cjs +87 -64
  68. package/dist/cjs/components/FileUpload/FileUploadArea.cjs.map +1 -1
  69. package/dist/cjs/components/FileUpload/FileUploadArea.css +130 -0
  70. package/dist/cjs/components/FileUpload/FileUploadArea.module.css.cjs +38 -0
  71. package/dist/cjs/components/FileUpload/FileUploadArea.module.css.cjs.map +1 -0
  72. package/dist/cjs/components/FileUpload/FileUploadItem.cjs +56 -64
  73. package/dist/cjs/components/FileUpload/FileUploadItem.cjs.map +1 -1
  74. package/dist/cjs/components/FileUpload/FileUploadItem.css +82 -0
  75. package/dist/cjs/components/FileUpload/FileUploadItem.module.css.cjs +27 -0
  76. package/dist/cjs/components/FileUpload/FileUploadItem.module.css.cjs.map +1 -0
  77. package/dist/cjs/components/FormContainer/Error.cjs +8 -9
  78. package/dist/cjs/components/FormContainer/Error.cjs.map +1 -1
  79. package/dist/cjs/components/FormContainer/Error.css +4 -0
  80. package/dist/cjs/components/FormContainer/Error.module.css.cjs +12 -0
  81. package/dist/cjs/components/FormContainer/Error.module.css.cjs.map +1 -0
  82. package/dist/cjs/components/FormContainer/FormElementContainer.cjs +8 -6
  83. package/dist/cjs/components/FormContainer/FormElementContainer.cjs.map +1 -1
  84. package/dist/cjs/components/FormContainer/FormElementContainer.css +14 -0
  85. package/dist/cjs/components/FormContainer/FormElementContainer.module.css.cjs +10 -0
  86. package/dist/cjs/components/FormContainer/FormElementContainer.module.css.cjs.map +1 -0
  87. package/dist/cjs/components/FormContainer/FormRoot.cjs +32 -18
  88. package/dist/cjs/components/FormContainer/FormRoot.cjs.map +1 -1
  89. package/dist/cjs/components/FormContainer/FormRoot.css +33 -0
  90. package/dist/cjs/components/FormContainer/FormRoot.module.css.cjs +15 -0
  91. package/dist/cjs/components/FormContainer/FormRoot.module.css.cjs.map +1 -0
  92. package/dist/cjs/components/GridCenter/GridCenter.css +6 -0
  93. package/dist/cjs/components/GridContainer/GridContainer.css +71 -0
  94. package/dist/cjs/components/GridContainer/GridContainer.module.css.cjs +12 -0
  95. package/dist/cjs/components/GridContainer/GridContainer.module.css.cjs.map +1 -0
  96. package/dist/cjs/components/GridContainer/index.cjs +64 -64
  97. package/dist/cjs/components/GridContainer/index.cjs.map +1 -1
  98. package/dist/cjs/components/MiddleTruncator/MiddleTruncator.css +22 -0
  99. package/dist/cjs/components/MiddleTruncator/MiddleTruncator.module.css.cjs +18 -0
  100. package/dist/cjs/components/MiddleTruncator/MiddleTruncator.module.css.cjs.map +1 -0
  101. package/dist/cjs/components/MiddleTruncator/index.cjs +5 -17
  102. package/dist/cjs/components/MiddleTruncator/index.cjs.map +1 -1
  103. package/dist/cjs/components/Pagination/Pagination.css +7 -0
  104. package/dist/cjs/components/Pagination/Pagination.module.css.cjs +10 -0
  105. package/dist/cjs/components/Pagination/Pagination.module.css.cjs.map +1 -0
  106. package/dist/cjs/components/Pagination/index.cjs +3 -5
  107. package/dist/cjs/components/Pagination/index.cjs.map +1 -1
  108. package/dist/cjs/components/Panel/Panel.css +116 -0
  109. package/dist/cjs/components/Panel/Panel.module.css.cjs +87 -0
  110. package/dist/cjs/components/Panel/Panel.module.css.cjs.map +1 -0
  111. package/dist/cjs/components/Panel/index.cjs +85 -35
  112. package/dist/cjs/components/Panel/index.cjs.map +1 -1
  113. package/dist/cjs/components/Popover/Popover.css +20 -0
  114. package/dist/cjs/components/Popover/Popover.module.css.cjs +5 -1
  115. package/dist/cjs/components/Popover/Popover.module.css.cjs.map +1 -1
  116. package/dist/cjs/components/Popover/index.cjs +2 -18
  117. package/dist/cjs/components/Popover/index.cjs.map +1 -1
  118. package/dist/cjs/components/Select/MultiSelectValue.cjs +4 -9
  119. package/dist/cjs/components/Select/MultiSelectValue.cjs.map +1 -1
  120. package/dist/cjs/components/Select/MultiSelectValue.css +19 -0
  121. package/dist/cjs/components/Select/MultiSelectValue.module.css.cjs +11 -0
  122. package/dist/cjs/components/Select/MultiSelectValue.module.css.cjs.map +1 -0
  123. package/dist/cjs/components/Select/SingleSelectValue.cjs +3 -5
  124. package/dist/cjs/components/Select/SingleSelectValue.cjs.map +1 -1
  125. package/dist/cjs/components/Select/SingleSelectValue.css +10 -0
  126. package/dist/cjs/components/Select/SingleSelectValue.module.css.cjs +10 -0
  127. package/dist/cjs/components/Select/SingleSelectValue.module.css.cjs.map +1 -0
  128. package/dist/cjs/components/Select/common/InternalSelect.cjs +18 -23
  129. package/dist/cjs/components/Select/common/InternalSelect.cjs.map +1 -1
  130. package/dist/cjs/components/Select/common/SelectComponents.cjs +110 -0
  131. package/dist/cjs/components/Select/common/SelectComponents.cjs.map +1 -0
  132. package/dist/cjs/components/Select/common/SelectComponents.css +296 -0
  133. package/dist/cjs/components/Select/common/SelectComponents.module.css.cjs +31 -0
  134. package/dist/cjs/components/Select/common/SelectComponents.module.css.cjs.map +1 -0
  135. package/dist/cjs/components/SplitButton/SplitButton.css +138 -0
  136. package/dist/cjs/components/SplitButton/SplitButton.module.css.cjs +19 -0
  137. package/dist/cjs/components/SplitButton/SplitButton.module.css.cjs.map +1 -0
  138. package/dist/cjs/components/SplitButton/index.cjs +42 -88
  139. package/dist/cjs/components/SplitButton/index.cjs.map +1 -1
  140. package/dist/cjs/components/Table/Table.css +0 -1
  141. package/dist/esm/click-ui.css +1543 -71
  142. package/dist/esm/components/AutoComplete/AutoComplete.css +97 -0
  143. package/dist/esm/components/AutoComplete/AutoComplete.module.css.js +14 -0
  144. package/dist/esm/components/AutoComplete/AutoComplete.module.css.js.map +1 -0
  145. package/dist/esm/components/AutoComplete/index.js +15 -75
  146. package/dist/esm/components/AutoComplete/index.js.map +1 -1
  147. package/dist/esm/components/Button/BaseButton.css +40 -0
  148. package/dist/esm/components/Button/BaseButton.js +11 -32
  149. package/dist/esm/components/Button/BaseButton.js.map +1 -1
  150. package/dist/esm/components/Button/BaseButton.module.css.js +6 -0
  151. package/dist/esm/components/Button/BaseButton.module.css.js.map +1 -0
  152. package/dist/esm/components/CardPromotion/CardPromotion.css +52 -0
  153. package/dist/esm/components/CardPromotion/CardPromotion.module.css.js +13 -0
  154. package/dist/esm/components/CardPromotion/CardPromotion.module.css.js.map +1 -0
  155. package/dist/esm/components/CardPromotion/index.js +8 -54
  156. package/dist/esm/components/CardPromotion/index.js.map +1 -1
  157. package/dist/esm/components/CodeBlock/CodeBlock.css +48 -0
  158. package/dist/esm/components/CodeBlock/CodeBlock.module.css.js +14 -0
  159. package/dist/esm/components/CodeBlock/CodeBlock.module.css.js.map +1 -0
  160. package/dist/esm/components/CodeBlock/InlineCodeBlock.css +10 -0
  161. package/dist/esm/components/CodeBlock/InlineCodeBlock.js +7 -14
  162. package/dist/esm/components/CodeBlock/InlineCodeBlock.js.map +1 -1
  163. package/dist/esm/components/CodeBlock/InlineCodeBlock.module.css.js +7 -0
  164. package/dist/esm/components/CodeBlock/InlineCodeBlock.module.css.js.map +1 -0
  165. package/dist/esm/components/CodeBlock/index.js +20 -51
  166. package/dist/esm/components/CodeBlock/index.js.map +1 -1
  167. package/dist/esm/components/CodeBlock/useColorStyle.js +14 -1
  168. package/dist/esm/components/CodeBlock/useColorStyle.js.map +1 -1
  169. package/dist/esm/components/ContextMenu/ContextMenu.css +12 -0
  170. package/dist/esm/components/ContextMenu/ContextMenu.module.css.js +7 -2
  171. package/dist/esm/components/ContextMenu/ContextMenu.module.css.js.map +1 -1
  172. package/dist/esm/components/ContextMenu/index.js +8 -20
  173. package/dist/esm/components/ContextMenu/index.js.map +1 -1
  174. package/dist/esm/components/CrossButton/CrossButton.css +12 -0
  175. package/dist/esm/components/CrossButton/CrossButton.module.css.js +6 -0
  176. package/dist/esm/components/CrossButton/CrossButton.module.css.js.map +1 -0
  177. package/dist/esm/components/CrossButton/index.js +11 -18
  178. package/dist/esm/components/CrossButton/index.js.map +1 -1
  179. package/dist/esm/components/DatePicker/DateTimeRangePicker.js +1 -1
  180. package/dist/esm/components/DatePicker/DateTimeRangePicker.js.map +1 -1
  181. package/dist/esm/components/Dropdown/Dropdown.css +23 -0
  182. package/dist/esm/components/Dropdown/Dropdown.module.css.js +3 -1
  183. package/dist/esm/components/Dropdown/Dropdown.module.css.js.map +1 -1
  184. package/dist/esm/components/Dropdown/index.js +12 -23
  185. package/dist/esm/components/Dropdown/index.js.map +1 -1
  186. package/dist/esm/components/EllipsisContent/EllipsisContent.css +21 -0
  187. package/dist/esm/components/EllipsisContent/EllipsisContent.module.css.js +6 -0
  188. package/dist/esm/components/EllipsisContent/EllipsisContent.module.css.js.map +1 -0
  189. package/dist/esm/components/EllipsisContent/index.js +7 -6
  190. package/dist/esm/components/EllipsisContent/index.js.map +1 -1
  191. package/dist/esm/components/EmptyButton/EmptyButton.css +21 -0
  192. package/dist/esm/components/EmptyButton/EmptyButton.module.css.js +6 -0
  193. package/dist/esm/components/EmptyButton/EmptyButton.module.css.js.map +1 -0
  194. package/dist/esm/components/EmptyButton/index.js +10 -4
  195. package/dist/esm/components/EmptyButton/index.js.map +1 -1
  196. package/dist/esm/components/FileTabs/FileTabs.css +167 -0
  197. package/dist/esm/components/FileTabs/FileTabs.module.css.js +26 -0
  198. package/dist/esm/components/FileTabs/FileTabs.module.css.js.map +1 -0
  199. package/dist/esm/components/FileTabs/index.js +51 -80
  200. package/dist/esm/components/FileTabs/index.js.map +1 -1
  201. package/dist/esm/components/FileUpload/FileMultiUpload.css +8 -0
  202. package/dist/esm/components/FileUpload/FileMultiUpload.js +3 -9
  203. package/dist/esm/components/FileUpload/FileMultiUpload.js.map +1 -1
  204. package/dist/esm/components/FileUpload/FileMultiUpload.module.css.js +6 -0
  205. package/dist/esm/components/FileUpload/FileMultiUpload.module.css.js.map +1 -0
  206. package/dist/esm/components/FileUpload/FileUpload.stories-common.css +14 -0
  207. package/dist/esm/components/FileUpload/FileUploadArea.css +130 -0
  208. package/dist/esm/components/FileUpload/FileUploadArea.js +87 -64
  209. package/dist/esm/components/FileUpload/FileUploadArea.js.map +1 -1
  210. package/dist/esm/components/FileUpload/FileUploadArea.module.css.js +32 -0
  211. package/dist/esm/components/FileUpload/FileUploadArea.module.css.js.map +1 -0
  212. package/dist/esm/components/FileUpload/FileUploadItem.css +82 -0
  213. package/dist/esm/components/FileUpload/FileUploadItem.js +56 -64
  214. package/dist/esm/components/FileUpload/FileUploadItem.js.map +1 -1
  215. package/dist/esm/components/FileUpload/FileUploadItem.module.css.js +21 -0
  216. package/dist/esm/components/FileUpload/FileUploadItem.module.css.js.map +1 -0
  217. package/dist/esm/components/FormContainer/Error.css +4 -0
  218. package/dist/esm/components/FormContainer/Error.js +8 -9
  219. package/dist/esm/components/FormContainer/Error.js.map +1 -1
  220. package/dist/esm/components/FormContainer/Error.module.css.js +7 -0
  221. package/dist/esm/components/FormContainer/Error.module.css.js.map +1 -0
  222. package/dist/esm/components/FormContainer/FormElementContainer.css +14 -0
  223. package/dist/esm/components/FormContainer/FormElementContainer.js +8 -6
  224. package/dist/esm/components/FormContainer/FormElementContainer.js.map +1 -1
  225. package/dist/esm/components/FormContainer/FormElementContainer.module.css.js +6 -0
  226. package/dist/esm/components/FormContainer/FormElementContainer.module.css.js.map +1 -0
  227. package/dist/esm/components/FormContainer/FormRoot.css +33 -0
  228. package/dist/esm/components/FormContainer/FormRoot.js +32 -18
  229. package/dist/esm/components/FormContainer/FormRoot.js.map +1 -1
  230. package/dist/esm/components/FormContainer/FormRoot.module.css.js +11 -0
  231. package/dist/esm/components/FormContainer/FormRoot.module.css.js.map +1 -0
  232. package/dist/esm/components/GridCenter/GridCenter.css +6 -0
  233. package/dist/esm/components/GridContainer/GridContainer.css +71 -0
  234. package/dist/esm/components/GridContainer/GridContainer.module.css.js +8 -0
  235. package/dist/esm/components/GridContainer/GridContainer.module.css.js.map +1 -0
  236. package/dist/esm/components/GridContainer/index.js +65 -65
  237. package/dist/esm/components/GridContainer/index.js.map +1 -1
  238. package/dist/esm/components/MiddleTruncator/MiddleTruncator.css +22 -0
  239. package/dist/esm/components/MiddleTruncator/MiddleTruncator.module.css.js +11 -0
  240. package/dist/esm/components/MiddleTruncator/MiddleTruncator.module.css.js.map +1 -0
  241. package/dist/esm/components/MiddleTruncator/index.js +5 -17
  242. package/dist/esm/components/MiddleTruncator/index.js.map +1 -1
  243. package/dist/esm/components/Pagination/Pagination.css +7 -0
  244. package/dist/esm/components/Pagination/Pagination.module.css.js +6 -0
  245. package/dist/esm/components/Pagination/Pagination.module.css.js.map +1 -0
  246. package/dist/esm/components/Pagination/index.js +3 -5
  247. package/dist/esm/components/Pagination/index.js.map +1 -1
  248. package/dist/esm/components/Panel/Panel.css +116 -0
  249. package/dist/esm/components/Panel/Panel.module.css.js +58 -0
  250. package/dist/esm/components/Panel/Panel.module.css.js.map +1 -0
  251. package/dist/esm/components/Panel/index.js +85 -35
  252. package/dist/esm/components/Panel/index.js.map +1 -1
  253. package/dist/esm/components/Popover/Popover.css +20 -0
  254. package/dist/esm/components/Popover/Popover.module.css.js +5 -2
  255. package/dist/esm/components/Popover/Popover.module.css.js.map +1 -1
  256. package/dist/esm/components/Popover/index.js +2 -18
  257. package/dist/esm/components/Popover/index.js.map +1 -1
  258. package/dist/esm/components/Select/MultiSelectValue.css +19 -0
  259. package/dist/esm/components/Select/MultiSelectValue.js +4 -9
  260. package/dist/esm/components/Select/MultiSelectValue.js.map +1 -1
  261. package/dist/esm/components/Select/MultiSelectValue.module.css.js +7 -0
  262. package/dist/esm/components/Select/MultiSelectValue.module.css.js.map +1 -0
  263. package/dist/esm/components/Select/SingleSelectValue.css +10 -0
  264. package/dist/esm/components/Select/SingleSelectValue.js +3 -5
  265. package/dist/esm/components/Select/SingleSelectValue.js.map +1 -1
  266. package/dist/esm/components/Select/SingleSelectValue.module.css.js +6 -0
  267. package/dist/esm/components/Select/SingleSelectValue.module.css.js.map +1 -0
  268. package/dist/esm/components/Select/common/InternalSelect.js +4 -9
  269. package/dist/esm/components/Select/common/InternalSelect.js.map +1 -1
  270. package/dist/esm/components/Select/common/SelectComponents.css +296 -0
  271. package/dist/esm/components/Select/common/SelectComponents.js +92 -0
  272. package/dist/esm/components/Select/common/SelectComponents.js.map +1 -0
  273. package/dist/esm/components/Select/common/SelectComponents.module.css.js +27 -0
  274. package/dist/esm/components/Select/common/SelectComponents.module.css.js.map +1 -0
  275. package/dist/esm/components/SplitButton/SplitButton.css +138 -0
  276. package/dist/esm/components/SplitButton/SplitButton.module.css.js +15 -0
  277. package/dist/esm/components/SplitButton/SplitButton.module.css.js.map +1 -0
  278. package/dist/esm/components/SplitButton/index.js +43 -89
  279. package/dist/esm/components/SplitButton/index.js.map +1 -1
  280. package/dist/esm/components/Table/Table.css +0 -1
  281. package/dist/types/components/AutoComplete/AutoComplete.d.ts +1 -1
  282. package/dist/types/components/Button/BaseButton.d.ts +2 -1
  283. package/dist/types/components/CardPromotion/CardPromotion.d.ts +1 -1
  284. package/dist/types/components/CodeBlock/CodeBlock.d.ts +1 -1
  285. package/dist/types/components/CodeBlock/InlineCodeBlock.d.ts +1 -1
  286. package/dist/types/components/CodeBlock/useColorStyle.d.ts +6 -112
  287. package/dist/types/components/ContextMenu/ContextMenu.d.ts +1 -1
  288. package/dist/types/components/CrossButton/CrossButton.d.ts +2 -7
  289. package/dist/types/components/Dropdown/Dropdown.d.ts +2 -2
  290. package/dist/types/components/EmptyButton/EmptyButton.d.ts +2 -1
  291. package/dist/types/components/FileTabs/FileTabs.d.ts +3 -3
  292. package/dist/types/components/FileUpload/FileUpload.stories-common.d.ts +4 -1
  293. package/dist/types/components/FormContainer/Error.d.ts +2 -1
  294. package/dist/types/components/FormContainer/FormElementContainer.d.ts +2 -1
  295. package/dist/types/components/FormContainer/FormRoot.d.ts +6 -4
  296. package/dist/types/components/GridCenter/GridCenter.d.ts +9 -1
  297. package/dist/types/components/Panel/Panel.d.ts +2 -39
  298. package/dist/types/components/Select/common/SelectComponents.d.ts +33 -0
  299. package/dist/types/components/SplitButton/SplitButton.d.ts +1 -1
  300. package/package.json +1 -1
  301. package/dist/cjs/components/Select/common/SelectStyled.cjs +0 -194
  302. package/dist/cjs/components/Select/common/SelectStyled.cjs.map +0 -1
  303. package/dist/esm/components/Select/common/SelectStyled.js +0 -176
  304. package/dist/esm/components/Select/common/SelectStyled.js.map +0 -1
  305. package/dist/types/components/Select/common/SelectStyled.d.ts +0 -34
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CardPromotion.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
@@ -1,69 +1,23 @@
1
+ import "./CardPromotion.css";
1
2
  import { jsx, jsxs } from 'react/jsx-runtime';
2
3
  import { useState } from 'react';
3
- import { styled } from 'styled-components';
4
- import { Text } from '../Text/index.js';
4
+ import { cn } from '../../lib/cva.js';
5
+ import styles from './CardPromotion.module.css.js';
5
6
  import { Icon as SvgImage } from '../Icon/index.js';
7
+ import { Text } from '../Text/index.js';
6
8
 
7
- const Background = styled.div.withConfig({
8
- componentId: "sc-6jamj6-0"
9
- })(["", ""], ({
10
- theme
11
- }) => `
12
- background-image: ${theme.click.card.promotion.color.stroke.default};
13
- padding: 1px;
14
- border-radius: ${theme.click.card.promotion.radii.all};
15
- box-shadow: ${theme.click.card.shadow};
16
- display: flex;
17
-
18
- &:focus {
19
- background: ${theme.click.card.promotion.color.stroke.focus};
20
- }
21
- `);
22
- const Wrapper = styled.div.withConfig({
23
- componentId: "sc-6jamj6-1"
24
- })(["display:flex;width:100%;align-items:center;justify-content:flex-start;cursor:pointer;", ""], ({
25
- theme
26
- }) => `
27
- background: ${theme.click.card.promotion.color.background.default};
28
- color: ${theme.click.card.promotion.color.text.default};
29
- border-radius: ${theme.click.card.promotion.radii.all};
30
- padding: ${theme.click.card.promotion.space.y} ${theme.click.card.promotion.space.x};
31
- gap: ${theme.click.card.promotion.space.gap};
32
- transition: .2s ease-in-out all;
33
-
34
- &:hover {
35
- background: ${theme.click.card.promotion.color.background.hover};
36
- color: ${theme.click.card.promotion.color.text.hover};
37
- }
38
-
39
- &:active, &:focus {
40
- background: ${theme.click.card.promotion.color.background.active};
41
- color: ${theme.click.card.promotion.color.text.active};
42
- }
43
- `);
44
- const CardIcon = styled(SvgImage).withConfig({
45
- componentId: "sc-6jamj6-2"
46
- })(["", ""], ({
47
- theme
48
- }) => `
49
- height: ${theme.click.card.promotion.icon.size.all};
50
- width: ${theme.click.card.promotion.icon.size.all};
51
- color: ${theme.click.card.promotion.color.icon.default};
52
- `);
53
- const DismissWrapper = styled.button.withConfig({
54
- componentId: "sc-6jamj6-3"
55
- })(["display:flex;align-items:center;margin-left:auto;border:none;background-color:transparent;color:inherit;cursor:pointer;"]);
56
9
  const CardPromotion = ({
57
10
  label,
58
11
  icon,
59
12
  dismissible = false,
13
+ className,
60
14
  ...props
61
15
  }) => {
62
16
  const [isVisible, setIsVisible] = useState(true);
63
- return isVisible ? /* @__PURE__ */ jsx(Background, { children: /* @__PURE__ */ jsxs(Wrapper, { $dismissible: dismissible, ...props, children: [
64
- /* @__PURE__ */ jsx(CardIcon, { name: icon, "aria-hidden": true }),
17
+ return isVisible ? /* @__PURE__ */ jsx("div", { className: styles.background, children: /* @__PURE__ */ jsxs("div", { ...props, className: cn(styles.wrapper, className), children: [
18
+ /* @__PURE__ */ jsx(SvgImage, { name: icon, "aria-hidden": true, className: styles.cardicon }),
65
19
  /* @__PURE__ */ jsx(Text, { children: label }),
66
- dismissible && /* @__PURE__ */ jsx(DismissWrapper, { type: "button", "data-testid": "click-alert-dismiss-button", onClick: () => setIsVisible(false), children: /* @__PURE__ */ jsx(SvgImage, { name: "cross", "aria-label": "close" }) })
20
+ dismissible && /* @__PURE__ */ jsx("button", { type: "button", "data-testid": "click-alert-dismiss-button", onClick: () => setIsVisible(false), className: styles.dismisswrapper, children: /* @__PURE__ */ jsx(SvgImage, { name: "cross", "aria-label": "close" }) })
67
21
  ] }) }) : null;
68
22
  };
69
23
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/CardPromotion/CardPromotion.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { styled } from 'styled-components';\nimport { Icon } from '@/components/Icon';\nimport { Text } from '@/components/Text';\nimport { CardPromotionProps } from './CardPromotion.types';\nconst Background = styled.div`\n ${({ theme }) => `\n background-image: ${theme.click.card.promotion.color.stroke.default};\n padding: 1px;\n border-radius: ${theme.click.card.promotion.radii.all};\n box-shadow: ${theme.click.card.shadow};\n display: flex;\n\n &:focus {\n background: ${theme.click.card.promotion.color.stroke.focus};\n }\n `}\n`;\nconst Wrapper = styled.div<{\n $dismissible?: boolean;\n}>`\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: flex-start;\n cursor: pointer;\n\n ${({ theme }) => `\n background: ${theme.click.card.promotion.color.background.default};\n color: ${theme.click.card.promotion.color.text.default};\n border-radius: ${theme.click.card.promotion.radii.all};\n padding: ${theme.click.card.promotion.space.y} ${theme.click.card.promotion.space.x};\n gap: ${theme.click.card.promotion.space.gap};\n transition: .2s ease-in-out all;\n\n &:hover {\n background: ${theme.click.card.promotion.color.background.hover};\n color: ${theme.click.card.promotion.color.text.hover};\n }\n\n &:active, &:focus {\n background: ${theme.click.card.promotion.color.background.active};\n color: ${theme.click.card.promotion.color.text.active};\n }\n `}\n`;\n\nconst CardIcon = styled(Icon)`\n ${({ theme }) => `\n height: ${theme.click.card.promotion.icon.size.all};\n width: ${theme.click.card.promotion.icon.size.all};\n color: ${theme.click.card.promotion.color.icon.default};\n `}\n`;\n\nconst DismissWrapper = styled.button`\n display: flex;\n align-items: center;\n margin-left: auto;\n border: none;\n background-color: transparent;\n color: inherit;\n cursor: pointer;\n`;\n\nexport const CardPromotion = ({\n label,\n icon,\n dismissible = false,\n ...props\n}: CardPromotionProps) => {\n const [isVisible, setIsVisible] = useState(true);\n\n return isVisible ? (\n <Background>\n <Wrapper\n $dismissible={dismissible}\n {...props}\n >\n <CardIcon\n name={icon}\n aria-hidden\n />\n\n <Text>{label}</Text>\n\n {dismissible && (\n <DismissWrapper\n type=\"button\"\n data-testid=\"click-alert-dismiss-button\"\n onClick={() => setIsVisible(false)}\n >\n <Icon\n name=\"cross\"\n aria-label=\"close\"\n />\n </DismissWrapper>\n )}\n </Wrapper>\n </Background>\n ) : null;\n};\n"],"names":["Background","styled","div","withConfig","componentId","theme","click","card","promotion","color","stroke","default","radii","all","shadow","focus","Wrapper","background","text","space","y","x","gap","hover","active","CardIcon","Icon","icon","size","DismissWrapper","button","CardPromotion","label","dismissible","props","isVisible","setIsVisible","useState"],"mappings":";;;;;;AAKA,MAAMA,UAAAA,GAAaC,MAAAA,CAAOC,GAAAA,CAAGC,UAAAA,CAAA;AAAA,EAAAC,WAAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,EAAA,GACzB,CAAC;AAAA,EAAEC;AAAM,CAAA,KAAM;AAAA,sBAAA,EACKA,MAAMC,KAAAA,CAAMC,IAAAA,CAAKC,SAAAA,CAAUC,KAAAA,CAAMC,OAAOC,OAAO,CAAA;AAAA;AAAA,mBAAA,EAElDN,KAAAA,CAAMC,KAAAA,CAAMC,IAAAA,CAAKC,SAAAA,CAAUI,MAAMC,GAAG,CAAA;AAAA,gBAAA,EACv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C,YAAA,EAAcF,WAAAA,EACd,GAAIC,KAAAA,EAEJ,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,QAAA,EAAA,EACC,IAAA,EAAMP,IAAAA,EACN,aAAA,EAAW,IAAA,EAAA,CAAA;AAAA,oBAGb,GAAA,CAAC,QAAMK,QAAAA,EAAAA,KAAAA,EAAM,CAAA;AAAA,IAEZC,+BACC,GAAA,CAAC,cAAA,EAAA,EACC,MAAK,QAAA,EACL,aAAA,EAAY,8BACZ,OAAA,EAAS,MAAMG,YAAAA,CAAa,KAAK,GAEjC,QAAA,kBAAA,GAAA,CAACV,QAAA,EAAA,EACC,MAAK,OAAA,EACL,YAAA,EAAW,SAAO,CAAA,EAEtB;AAAA,GAAA,EAEJ,GACF,CAAA,GACE,IAAA;AACN;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/CardPromotion/CardPromotion.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { Icon } from '@/components/Icon';\nimport { Text } from '@/components/Text';\nimport { cn } from '@/lib/cva';\nimport { CardPromotionProps } from './CardPromotion.types';\nimport styles from './CardPromotion.module.css';\n\nexport const CardPromotion = ({\n label,\n icon,\n dismissible = false,\n className,\n ...props\n}: CardPromotionProps) => {\n const [isVisible, setIsVisible] = useState(true);\n\n return isVisible ? (\n <div className={styles.background}>\n <div\n {...props}\n className={cn(styles.wrapper, className)}\n >\n <Icon\n name={icon}\n aria-hidden\n className={styles.cardicon}\n />\n\n <Text>{label}</Text>\n\n {dismissible && (\n <button\n type=\"button\"\n data-testid=\"click-alert-dismiss-button\"\n onClick={() => setIsVisible(false)}\n className={styles.dismisswrapper}\n >\n <Icon\n name=\"cross\"\n aria-label=\"close\"\n />\n </button>\n )}\n </div>\n </div>\n ) : null;\n};\n"],"names":["CardPromotion","label","icon","dismissible","className","props","isVisible","setIsVisible","useState","styles","background","cn","wrapper","Icon","cardicon","dismisswrapper"],"mappings":";;;;;;;AAOO,MAAMA,gBAAgBA,CAAC;AAAA,EAC5BC,KAAAA;AAAAA,EACAC,IAAAA;AAAAA,EACAC,WAAAA,GAAc,KAAA;AAAA,EACdC,SAAAA;AAAAA,EACA,GAAGC;AACe,CAAA,KAAM;AACxB,EAAA,MAAM,CAACC,SAAAA,EAAWC,YAAY,CAAA,GAAIC,SAAS,IAAI,CAAA;AAE/C,EAAA,OAAOF,SAAAA,mBACL,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAWG,OAAOC,UAAAA,EACrB,QAAA,kBAAA,IAAA,CAAC,KAAA,EAAA,KACKL,OACJ,SAAA,EAAWM,EAAAA,CAAGF,MAAAA,CAAOG,OAAAA,EAASR,SAAS,CAAA,EAEvC,QAAA,EAAA;AAAA,oBAAA,GAAA,CAACS,YACC,IAAA,EAAMX,IAAAA,EACN,eAAW,IAAA,EACX,SAAA,EAAWO,OAAOK,QAAAA,EAAS,CAAA;AAAA,oBAG7B,GAAA,CAAC,QAAMb,QAAAA,EAAAA,KAAAA,EAAM,CAAA;AAAA,IAEZE,WAAAA,wBACE,QAAA,EAAA,EACC,IAAA,EAAK,UACL,aAAA,EAAY,4BAAA,EACZ,SAAS,MAAMI,YAAAA,CAAa,KAAK,CAAA,EACjC,SAAA,EAAWE,OAAOM,cAAAA,EAElB,QAAA,kBAAA,GAAA,CAACF,YACC,IAAA,EAAK,OAAA,EACL,YAAA,EAAW,OAAA,EAAO,CAAA,EAEtB;AAAA,GAAA,EAEJ,GACF,CAAA,GACE,IAAA;AACN;;;;"}
@@ -0,0 +1,48 @@
1
+ .codeblock__pRWOC {
2
+ position: relative;
3
+ width: 100%;
4
+ /* stylelint-disable plugin/no-unsupported-browser-features, declaration-property-value-no-unknown -- the original
5
+ styled-components rule used this same width fallback chain (100% →
6
+ -webkit-fill-available → fill-available → stretch) so the block fills the
7
+ available inline space. */
8
+ width: -webkit-fill-available;
9
+ width: fill-available;
10
+ width: stretch;
11
+ /* stylelint-enable plugin/no-unsupported-browser-features, declaration-property-value-no-unknown */
12
+ color: var(--codeblock-numbers);
13
+ }
14
+
15
+ /* This class is applied alongside the IconButton module classes on the same
16
+ <button>. `color`, `padding`, and `border` are set by both; the
17
+ styled-components original won them via source order. Double the class so
18
+ those three win regardless of CSS-module bundle order, matching the
19
+ pre-migration rendering. */
20
+ .codeblock__button__YDCMe.codeblock__button__YDCMe {
21
+ /* Reset so a copied/error state on one button can't inherit into another via
22
+ the custom property (custom properties inherit by default). The copied/error
23
+ colors are set inline per state via --codeblock-button, matching the
24
+ --codeblock-numbers pattern so both track the ThemeProvider runtime. */
25
+ --codeblock-button: initial;
26
+ padding: 0;
27
+ border: 0;
28
+ color: var(--codeblock-button, inherit);
29
+ }
30
+
31
+ .codeblock__highlighter__t4Xol {
32
+ margin: 0;
33
+ padding: 0;
34
+ background: transparent;
35
+ }
36
+
37
+ .codeblock__content__WKNWr {
38
+ color: inherit;
39
+ font-family: inherit;
40
+ }
41
+
42
+ .codeblock__button-container__D6yob {
43
+ display: flex;
44
+ position: absolute;
45
+ top: var(--click-codeblock-space-y);
46
+ right: var(--click-codeblock-space-x);
47
+ gap: 0.625rem;
48
+ }
@@ -0,0 +1,14 @@
1
+ const codeblock = "codeblock__pRWOC";
2
+ const codeblock__button = "codeblock__button__YDCMe";
3
+ const codeblock__highlighter = "codeblock__highlighter__t4Xol";
4
+ const codeblock__content = "codeblock__content__WKNWr";
5
+ const styles = {
6
+ codeblock: codeblock,
7
+ codeblock__button: codeblock__button,
8
+ codeblock__highlighter: codeblock__highlighter,
9
+ codeblock__content: codeblock__content,
10
+ "codeblock__button-container": "codeblock__button-container__D6yob"
11
+ };
12
+
13
+ export { codeblock, codeblock__button, codeblock__content, codeblock__highlighter, styles as default };
14
+ //# sourceMappingURL=CodeBlock.module.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CodeBlock.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
@@ -0,0 +1,10 @@
1
+ /* stylelint-disable custom-property-pattern -- design tokens use camelCase (e.g. codeInline) */
2
+
3
+ .inline__jYdpl {
4
+ padding: 0 var(--click-codeInline-space-x);
5
+ border: 1px solid var(--click-codeInline-color-stroke-default);
6
+ border-radius: var(--click-codeInline-radii-all);
7
+ background: var(--click-codeInline-color-background-default);
8
+ color: var(--click-codeInline-color-text-default);
9
+ font: var(--click-codeInline-typography-text-default);
10
+ }
@@ -1,19 +1,12 @@
1
+ import "./InlineCodeBlock.css";
1
2
  import { jsx } from 'react/jsx-runtime';
2
- import { styled } from 'styled-components';
3
+ import { cn } from '../../lib/cva.js';
4
+ import styles from './InlineCodeBlock.module.css.js';
3
5
 
4
- const InlineContainer = styled.span.withConfig({
5
- componentId: "sc-ugg5k0-0"
6
- })(["", ""], ({
7
- theme
8
- }) => `
9
- background: ${theme.click.codeInline.color.background.default};
10
- color: ${theme.click.codeInline.color.text.default};
11
- border: 1px solid ${theme.click.codeInline.color.stroke.default};
12
- font: ${theme.click.codeInline.typography.text.default};
13
- border-radius: ${theme.click.codeInline.radii.all};
14
- padding: 0 ${theme.click.codeInline.space.x};
15
- `);
16
- const InlineCodeBlock = (props) => /* @__PURE__ */ jsx(InlineContainer, { ...props });
6
+ const InlineCodeBlock = ({
7
+ className,
8
+ ...props
9
+ }) => /* @__PURE__ */ jsx("span", { ...props, className: cn(styles.inline, className) });
17
10
 
18
11
  export { InlineCodeBlock };
19
12
  //# sourceMappingURL=InlineCodeBlock.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InlineCodeBlock.js","sources":["../../../../src/components/CodeBlock/InlineCodeBlock.tsx"],"sourcesContent":["import { HTMLAttributes } from 'react';\nimport { styled } from 'styled-components';\n\nconst InlineContainer = styled.span`\n ${({ theme }) => `\n background: ${theme.click.codeInline.color.background.default};\n color: ${theme.click.codeInline.color.text.default};\n border: 1px solid ${theme.click.codeInline.color.stroke.default};\n font: ${theme.click.codeInline.typography.text.default};\n border-radius: ${theme.click.codeInline.radii.all};\n padding: 0 ${theme.click.codeInline.space.x};\n `}\n`;\nexport const InlineCodeBlock = (props: HTMLAttributes<HTMLSpanElement>) => (\n <InlineContainer {...props} />\n);\n"],"names":["InlineContainer","styled","span","withConfig","componentId","theme","click","codeInline","color","background","default","text","stroke","typography","radii","all","space","x","InlineCodeBlock","props"],"mappings":";;;AAGA,MAAMA,eAAAA,GAAkBC,MAAAA,CAAOC,IAAAA,CAAIC,UAAAA,CAAA;AAAA,EAAAC,WAAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,EAAA,GAC/B,CAAC;AAAA,EAAEC;AAAM,CAAA,KAAM;AAAA,gBAAA,EACDA,KAAAA,CAAMC,KAAAA,CAAMC,UAAAA,CAAWC,KAAAA,CAAMC,WAAWC,OAAO,CAAA;AAAA,WAAA,EACpDL,KAAAA,CAAMC,KAAAA,CAAMC,UAAAA,CAAWC,KAAAA,CAAMG,KAAKD,OAAO,CAAA;AAAA,sBAAA,EAC9BL,KAAAA,CAAMC,KAAAA,CAAMC,UAAAA,CAAWC,KAAAA,CAAMI,OAAOF,OAAO,CAAA;AAAA,UAAA,EACvDL,KAAAA,CAAMC,KAAAA,CAAMC,UAAAA,CAAWM,UAAAA,CAAWF,KAAKD,OAAO,CAAA;AAAA,mBAAA,EACrCL,KAAAA,CAAMC,KAAAA,CAAMC,UAAAA,CAAWO,KAAAA,CAAMC,GAAG,CAAA;AAAA,eAAA,EACpCV,KAAAA,CAAMC,KAAAA,CAAMC,UAAAA,CAAWS,KAAAA,CAAMC,CAAC,CAAA;AAAA,EAAA,CAC5C,CAAA;AAEI,MAAMC,kBAAkBA,CAACC,KAAAA,qBAC9B,GAAA,CAAC,eAAA,EAAA,EAAgB,GAAIA,KAAAA,EAAM;;;;"}
1
+ {"version":3,"file":"InlineCodeBlock.js","sources":["../../../../src/components/CodeBlock/InlineCodeBlock.tsx"],"sourcesContent":["import { HTMLAttributes } from 'react';\nimport { cn } from '@/lib/cva';\nimport styles from './InlineCodeBlock.module.css';\n\nexport const InlineCodeBlock = ({\n className,\n ...props\n}: HTMLAttributes<HTMLSpanElement>) => (\n <span\n {...props}\n className={cn(styles.inline, className)}\n />\n);\n"],"names":["InlineCodeBlock","className","props","cn","styles","inline"],"mappings":";;;;AAIO,MAAMA,kBAAkBA,CAAC;AAAA,EAC9BC,SAAAA;AAAAA,EACA,GAAGC;AAC4B,CAAA,qBAC/B,GAAA,CAAC,UACC,GAAIA,KAAAA,EACJ,WAAWC,EAAAA,CAAGC,MAAAA,CAAOC,MAAAA,EAAQJ,SAAS,CAAA,EAAE;;;;"}
@@ -0,0 +1,7 @@
1
+ const inline = "inline__jYdpl";
2
+ const styles = {
3
+ inline: inline
4
+ };
5
+
6
+ export { styles as default, inline };
7
+ //# sourceMappingURL=InlineCodeBlock.module.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InlineCodeBlock.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -1,9 +1,10 @@
1
+ import "./CodeBlock.css";
1
2
  import { jsxs, jsx } from 'react/jsx-runtime';
2
3
  import { useState } from 'react';
3
- import { createElement, Light } from 'react-syntax-highlighter';
4
- import { EmptyButton } from '../EmptyButton/index.js';
5
- import { styled } from 'styled-components';
6
- import useColorStyle from './useColorStyle.js';
4
+ import { Light, createElement } from 'react-syntax-highlighter';
5
+ import { cn } from '../../lib/cva.js';
6
+ import useColorStyle, { useNumbersColor, useButtonStateColors } from './useColorStyle.js';
7
+ import styles from './CodeBlock.module.css.js';
7
8
  import sql from 'react-syntax-highlighter/dist/cjs/languages/hljs/sql.js';
8
9
  import bash from 'react-syntax-highlighter/dist/cjs/languages/hljs/bash.js';
9
10
  import json from 'react-syntax-highlighter/dist/cjs/languages/hljs/json.js';
@@ -16,47 +17,6 @@ Light.registerLanguage("bash", bash.default || bash);
16
17
  Light.registerLanguage("json", json.default || json);
17
18
  Light.registerLanguage("tsx", tsx.default || tsx);
18
19
  Light.registerLanguage("plaintext", plaintext.default || plaintext);
19
- const CodeBlockContainer = styled.div.withConfig({
20
- componentId: "sc-18gnqgi-0"
21
- })(["width:100%;width:-webkit-fill-available;width:fill-available;width:stretch;position:relative;", ""], ({
22
- theme,
23
- $theme
24
- }) => {
25
- const themeName = theme.name;
26
- const codeTheme = theme.click.codeblock[`${!$theme ? themeName : $theme}Mode`].color;
27
- return `
28
- color: ${codeTheme.numbers.default};
29
- .linenumber {
30
- color: ${codeTheme.numbers.default}
31
- }
32
- `;
33
- });
34
- const CodeButton = styled(EmptyButton).withConfig({
35
- componentId: "sc-18gnqgi-1"
36
- })(["", ""], ({
37
- $copied,
38
- $error,
39
- theme
40
- }) => `
41
- color: ${$copied ? theme.click.alert.color.text.success : $error ? theme.click.alert.color.text.danger : "inherit"};
42
- padding: 0;
43
- border: 0;
44
- `);
45
- const Highlighter = styled(Light).withConfig({
46
- componentId: "sc-18gnqgi-2"
47
- })(["background:transparent;padding:0;margin:0;"]);
48
- const CodeContent = styled.code.withConfig({
49
- componentId: "sc-18gnqgi-3"
50
- })(["font-family:inherit;color:inherit;"]);
51
- const ButtonContainer = styled.div.withConfig({
52
- componentId: "sc-18gnqgi-4"
53
- })(["position:absolute;display:flex;", ""], ({
54
- theme
55
- }) => `
56
- gap: 0.625rem;
57
- top: ${theme.click.codeblock.space.y};
58
- right: ${theme.click.codeblock.space.x};
59
- `);
60
20
  const CodeBlock = ({
61
21
  children,
62
22
  language,
@@ -66,12 +26,16 @@ const CodeBlock = ({
66
26
  wrapLines = false,
67
27
  onCopy,
68
28
  onCopyError,
29
+ className,
30
+ style,
69
31
  ...props
70
32
  }) => {
71
33
  const [copied, setCopied] = useState(false);
72
34
  const [errorCopy, setErrorCopy] = useState(false);
73
35
  const [wrap, setWrap] = useState(wrapLines);
74
36
  const customStyle = useColorStyle(theme);
37
+ const numbersColor = useNumbersColor(theme);
38
+ const buttonStateColors = useButtonStateColors();
75
39
  const copyCodeToClipboard = async () => {
76
40
  try {
77
41
  await navigator.clipboard.writeText(children);
@@ -95,13 +59,18 @@ const CodeBlock = ({
95
59
  const wrapElement = () => {
96
60
  setWrap((wrap2) => !wrap2);
97
61
  };
98
- const CodeWithRef = (props2) => /* @__PURE__ */ jsx(CodeContent, { ...props2 });
99
- return /* @__PURE__ */ jsxs(CodeBlockContainer, { $theme: theme, ...props, children: [
100
- /* @__PURE__ */ jsxs(ButtonContainer, { children: [
101
- showWrapButton && /* @__PURE__ */ jsx(CodeButton, { as: IconButton, $copied: false, $error: false, icon: "document", onClick: wrapElement }),
102
- /* @__PURE__ */ jsx(CodeButton, { as: IconButton, $copied: copied, $error: errorCopy, icon: copied ? "check" : errorCopy ? "warning" : "copy", onClick: copyCodeToClipboard })
62
+ const CodeWithRef = (props2) => /* @__PURE__ */ jsx("code", { ...props2, className: cn(styles["codeblock__content"], props2.className) });
63
+ return /* @__PURE__ */ jsxs("div", { ...props, style: {
64
+ "--codeblock-numbers": numbersColor,
65
+ ...style
66
+ }, className: cn(styles.codeblock, className), children: [
67
+ /* @__PURE__ */ jsxs("div", { className: styles["codeblock__button-container"], children: [
68
+ showWrapButton && /* @__PURE__ */ jsx(IconButton, { className: styles["codeblock__button"], icon: "document", onClick: wrapElement }),
69
+ /* @__PURE__ */ jsx(IconButton, { className: styles["codeblock__button"], style: {
70
+ "--codeblock-button": copied ? buttonStateColors.success : errorCopy ? buttonStateColors.danger : void 0
71
+ }, icon: copied ? "check" : errorCopy ? "warning" : "copy", onClick: copyCodeToClipboard })
103
72
  ] }),
104
- /* @__PURE__ */ jsx(Highlighter, { language, style: customStyle, CodeTag: CodeWithRef, renderer: ({
73
+ /* @__PURE__ */ jsx(Light, { language, style: customStyle, CodeTag: CodeWithRef, className: styles["codeblock__highlighter"], renderer: ({
105
74
  rows,
106
75
  stylesheet,
107
76
  useInlineStyles
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/CodeBlock/CodeBlock.tsx"],"sourcesContent":["import React, { HTMLAttributes, useState } from 'react';\nimport { Light as SyntaxHighlighter, createElement } from 'react-syntax-highlighter';\n\nimport { EmptyButton } from '@/components/EmptyButton';\nimport { IconButton } from '@/components/IconButton';\n\nimport { styled } from 'styled-components';\nimport useColorStyle from './useColorStyle';\nimport { CodeBlockProps, CodeThemeType } from './CodeBlock.types';\n\n/* eslint-disable import/extensions */\n// @ts-expect-error - Importing CJS modules in ESM context requires explicit .js extension\nimport sql from 'react-syntax-highlighter/dist/cjs/languages/hljs/sql.js';\n// @ts-expect-error - Importing CJS modules in ESM context requires explicit .js extension\nimport bash from 'react-syntax-highlighter/dist/cjs/languages/hljs/bash.js';\n// @ts-expect-error - Importing CJS modules in ESM context requires explicit .js extension\nimport json from 'react-syntax-highlighter/dist/cjs/languages/hljs/json.js';\n// @ts-expect-error - Importing CJS modules in ESM context requires explicit .js extension\nimport tsx from 'react-syntax-highlighter/dist/cjs/languages/hljs/typescript.js';\n// @ts-expect-error - Importing CJS modules in ESM context requires explicit .js extension\nimport plaintext from 'react-syntax-highlighter/dist/cjs/languages/hljs/plaintext.js';\n/* eslint-enable import/extensions */\n\nSyntaxHighlighter.registerLanguage('sql', sql.default || sql);\nSyntaxHighlighter.registerLanguage('bash', bash.default || bash);\nSyntaxHighlighter.registerLanguage('json', json.default || json);\nSyntaxHighlighter.registerLanguage('tsx', tsx.default || tsx);\nSyntaxHighlighter.registerLanguage('plaintext', plaintext.default || plaintext);\n\ninterface RendererNodeType {\n type: 'element' | 'text';\n value?: string | number | undefined;\n tagName?: keyof React.JSX.IntrinsicElements | React.ComponentType | undefined;\n properties?: { className: unknown[]; [key: string]: unknown };\n children?: RendererNodeType[];\n}\ninterface CustomRendererProps {\n rows: RendererNodeType[];\n stylesheet: { [key: string]: React.CSSProperties };\n useInlineStyles: boolean;\n}\n\nconst CodeBlockContainer = styled.div<{ $theme?: CodeThemeType }>`\n width: 100%;\n width: -webkit-fill-available;\n width: fill-available;\n width: stretch;\n position: relative;\n ${({ theme, $theme }) => {\n const themeName = theme.name as CodeThemeType;\n\n const codeTheme = theme.click.codeblock[`${!$theme ? themeName : $theme}Mode`].color;\n return `\n color: ${codeTheme.numbers.default};\n .linenumber {\n color: ${codeTheme.numbers.default}\n }\n `;\n }}\n`;\n\nconst CodeButton = styled(EmptyButton)<{ $copied: boolean; $error: boolean }>`\n ${({ $copied, $error, theme }) => `\n color: ${\n $copied\n ? theme.click.alert.color.text.success\n : $error\n ? theme.click.alert.color.text.danger\n : 'inherit'\n };\n padding: 0;\n border: 0;\n `}\n`;\n\nconst Highlighter = styled(SyntaxHighlighter)`\n background: transparent;\n padding: 0;\n margin: 0;\n`;\n\nconst CodeContent = styled.code`\n font-family: inherit;\n color: inherit;\n`;\n\nconst ButtonContainer = styled.div`\n position: absolute;\n display: flex;\n ${({ theme }) => `\n gap: 0.625rem;\n top: ${theme.click.codeblock.space.y};\n right: ${theme.click.codeblock.space.x};\n `}\n`;\n\nexport const CodeBlock = ({\n children,\n language,\n theme,\n showLineNumbers,\n showWrapButton = false,\n wrapLines = false,\n onCopy,\n onCopyError,\n ...props\n}: CodeBlockProps) => {\n const [copied, setCopied] = useState(false);\n const [errorCopy, setErrorCopy] = useState(false);\n const [wrap, setWrap] = useState(wrapLines);\n const customStyle = useColorStyle(theme);\n\n const copyCodeToClipboard = async () => {\n try {\n await navigator.clipboard.writeText(children);\n if (typeof onCopy == 'function') {\n onCopy(children);\n }\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n } catch (error) {\n let message = 'Unable to copy code';\n if (error instanceof Error) {\n message = error.message;\n }\n setErrorCopy(true);\n if (typeof onCopyError === 'function') {\n onCopyError(message);\n }\n setTimeout(() => setErrorCopy(false), 2000);\n }\n };\n const wrapElement = () => {\n setWrap(wrap => !wrap);\n };\n\n const CodeWithRef = (props: HTMLAttributes<HTMLElement>) => <CodeContent {...props} />;\n return (\n <CodeBlockContainer\n $theme={theme}\n {...props}\n >\n <ButtonContainer>\n {showWrapButton && (\n <CodeButton\n as={IconButton}\n $copied={false}\n $error={false}\n icon=\"document\"\n onClick={wrapElement}\n />\n )}\n <CodeButton\n as={IconButton}\n $copied={copied}\n $error={errorCopy}\n icon={copied ? 'check' : errorCopy ? 'warning' : 'copy'}\n onClick={copyCodeToClipboard}\n />\n </ButtonContainer>\n <Highlighter\n language={language}\n style={customStyle}\n CodeTag={CodeWithRef}\n renderer={({ rows, stylesheet, useInlineStyles }: CustomRendererProps) => {\n return rows.map((row, index) => {\n const children = row.children;\n const lineNumberElement = children?.shift();\n\n /**\n * We will take current structure of the rows and rebuild it\n * according to the suggestion here https://github.com/react-syntax-highlighter/react-syntax-highlighter/issues/376#issuecomment-1246115899\n */\n if (lineNumberElement) {\n row.children = [\n lineNumberElement,\n {\n children,\n properties: {\n className: [],\n },\n tagName: 'span',\n type: 'element',\n },\n ];\n }\n\n return createElement({\n node: row,\n stylesheet,\n useInlineStyles,\n key: index,\n });\n });\n }}\n showLineNumbers={showLineNumbers}\n wrapLines={wrap || wrapLines}\n wrapLongLines={wrap || wrapLines}\n >\n {children}\n </Highlighter>\n </CodeBlockContainer>\n );\n};\n"],"names":["SyntaxHighlighter","registerLanguage","sql","default","bash","json","tsx","plaintext","CodeBlockContainer","styled","div","withConfig","componentId","theme","$theme","themeName","name","codeTheme","click","codeblock","color","numbers","CodeButton","EmptyButton","$copied","$error","alert","text","success","danger","Highlighter","CodeContent","code","ButtonContainer","space","y","x","CodeBlock","children","language","showLineNumbers","showWrapButton","wrapLines","onCopy","onCopyError","props","copied","setCopied","useState","errorCopy","setErrorCopy","wrap","setWrap","customStyle","useColorStyle","copyCodeToClipboard","navigator","clipboard","writeText","setTimeout","error","message","Error","wrapElement","CodeWithRef","IconButton","rows","stylesheet","useInlineStyles","map","row","index","lineNumberElement","shift","properties","className","tagName","type","createElement","node","key"],"mappings":";;;;;;;;;;;;;AAuBAA,KAAAA,CAAkBC,gBAAAA,CAAiB,KAAA,EAAOC,GAAAA,CAAIC,OAAAA,IAAWD,GAAG,CAAA;AAC5DF,KAAAA,CAAkBC,gBAAAA,CAAiB,MAAA,EAAQG,IAAAA,CAAKD,OAAA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A,UACNH,UAAAA;AAAAA,UACAC,eAAAA;AAAAA,UACAY,GAAAA,EAAKT;AAAAA,SACN,CAAA;AAAA,MACH,CAAC,CAAA;AAAA,IACH,CAAA,EACA,iBACA,SAAA,EAAWpB,IAAAA,IAAQT,WACnB,aAAA,EAAeS,IAAAA,IAAQT,WAEtBJ,QAAAA,EACH;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/CodeBlock/CodeBlock.tsx"],"sourcesContent":["import React, { HTMLAttributes, useState } from 'react';\nimport { Light as SyntaxHighlighter, createElement } from 'react-syntax-highlighter';\n\nimport { IconButton } from '@/components/IconButton';\n\nimport { cn } from '@/lib/cva';\nimport useColorStyle, { useButtonStateColors, useNumbersColor } from './useColorStyle';\nimport { CodeBlockProps } from './CodeBlock.types';\nimport styles from './CodeBlock.module.css';\n\n/* eslint-disable import/extensions */\n// @ts-expect-error - Importing CJS modules in ESM context requires explicit .js extension\nimport sql from 'react-syntax-highlighter/dist/cjs/languages/hljs/sql.js';\n// @ts-expect-error - Importing CJS modules in ESM context requires explicit .js extension\nimport bash from 'react-syntax-highlighter/dist/cjs/languages/hljs/bash.js';\n// @ts-expect-error - Importing CJS modules in ESM context requires explicit .js extension\nimport json from 'react-syntax-highlighter/dist/cjs/languages/hljs/json.js';\n// @ts-expect-error - Importing CJS modules in ESM context requires explicit .js extension\nimport tsx from 'react-syntax-highlighter/dist/cjs/languages/hljs/typescript.js';\n// @ts-expect-error - Importing CJS modules in ESM context requires explicit .js extension\nimport plaintext from 'react-syntax-highlighter/dist/cjs/languages/hljs/plaintext.js';\n/* eslint-enable import/extensions */\n\nSyntaxHighlighter.registerLanguage('sql', sql.default || sql);\nSyntaxHighlighter.registerLanguage('bash', bash.default || bash);\nSyntaxHighlighter.registerLanguage('json', json.default || json);\nSyntaxHighlighter.registerLanguage('tsx', tsx.default || tsx);\nSyntaxHighlighter.registerLanguage('plaintext', plaintext.default || plaintext);\n\ninterface RendererNodeType {\n type: 'element' | 'text';\n value?: string | number | undefined;\n tagName?: keyof React.JSX.IntrinsicElements | React.ComponentType | undefined;\n properties?: { className: unknown[]; [key: string]: unknown };\n children?: RendererNodeType[];\n}\ninterface CustomRendererProps {\n rows: RendererNodeType[];\n stylesheet: { [key: string]: React.CSSProperties };\n useInlineStyles: boolean;\n}\n\nexport const CodeBlock = ({\n children,\n language,\n theme,\n showLineNumbers,\n showWrapButton = false,\n wrapLines = false,\n onCopy,\n onCopyError,\n className,\n style,\n ...props\n}: CodeBlockProps) => {\n const [copied, setCopied] = useState(false);\n const [errorCopy, setErrorCopy] = useState(false);\n const [wrap, setWrap] = useState(wrapLines);\n const customStyle = useColorStyle(theme);\n const numbersColor = useNumbersColor(theme);\n const buttonStateColors = useButtonStateColors();\n\n const copyCodeToClipboard = async () => {\n try {\n await navigator.clipboard.writeText(children);\n if (typeof onCopy == 'function') {\n onCopy(children);\n }\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n } catch (error) {\n let message = 'Unable to copy code';\n if (error instanceof Error) {\n message = error.message;\n }\n setErrorCopy(true);\n if (typeof onCopyError === 'function') {\n onCopyError(message);\n }\n setTimeout(() => setErrorCopy(false), 2000);\n }\n };\n const wrapElement = () => {\n setWrap(wrap => !wrap);\n };\n\n const CodeWithRef = (props: HTMLAttributes<HTMLElement>) => (\n <code\n {...props}\n className={cn(styles['codeblock__content'], props.className)}\n />\n );\n return (\n <div\n {...props}\n style={{ '--codeblock-numbers': numbersColor, ...style } as React.CSSProperties}\n className={cn(styles.codeblock, className)}\n >\n <div className={styles['codeblock__button-container']}>\n {showWrapButton && (\n <IconButton\n className={styles['codeblock__button']}\n icon=\"document\"\n onClick={wrapElement}\n />\n )}\n <IconButton\n className={styles['codeblock__button']}\n style={\n {\n '--codeblock-button': copied\n ? buttonStateColors.success\n : errorCopy\n ? buttonStateColors.danger\n : undefined,\n } as React.CSSProperties\n }\n icon={copied ? 'check' : errorCopy ? 'warning' : 'copy'}\n onClick={copyCodeToClipboard}\n />\n </div>\n <SyntaxHighlighter\n language={language}\n style={customStyle}\n CodeTag={CodeWithRef}\n className={styles['codeblock__highlighter']}\n renderer={({ rows, stylesheet, useInlineStyles }: CustomRendererProps) => {\n return rows.map((row, index) => {\n const children = row.children;\n const lineNumberElement = children?.shift();\n\n /**\n * We will take current structure of the rows and rebuild it\n * according to the suggestion here https://github.com/react-syntax-highlighter/react-syntax-highlighter/issues/376#issuecomment-1246115899\n */\n if (lineNumberElement) {\n row.children = [\n lineNumberElement,\n {\n children,\n properties: {\n className: [],\n },\n tagName: 'span',\n type: 'element',\n },\n ];\n }\n\n return createElement({\n node: row,\n stylesheet,\n useInlineStyles,\n key: index,\n });\n });\n }}\n showLineNumbers={showLineNumbers}\n wrapLines={wrap || wrapLines}\n wrapLongLines={wrap || wrapLines}\n >\n {children}\n </SyntaxHighlighter>\n </div>\n );\n};\n"],"names":["SyntaxHighlighter","registerLanguage","sql","default","bash","json","tsx","plaintext","CodeBlock","children","language","theme","showLineNumbers","showWrapButton","wrapLines","onCopy","onCopyError","className","style","props","copied","setCopied","useState","errorCopy","setErrorCopy","wrap","setWrap","customStyle","useColorStyle","numbersColor","useNumbersColor","buttonStateColors","useButtonStateColors","copyCodeToClipboard","navigator","clipboard","writeText","setTimeout","error","message","Error","wrapElement","CodeWithRef","cn","styles","codeblock","success","danger","undefined","rows","stylesheet","useInlineStyles","map","row","index","lineNumberElement","shift","properties","tagName","type","createElement","node","key"],"mappings":";;;;;;;;;;;;;AAuBAA,KAAAA,CAAkBC,gBAAAA,CAAiB,KAAA,EAAOC,GAAAA,CAAIC,OAAAA,IAAWD,GAAG,CAAA;AAC5DF,KAAAA,CAAkBC,gBAAAA,CAAiB,MAAA,EAAQG,IAAAA,CAAKD,OAAAA,IAAWC,IAAI,CAAA;AAC/DJ,KAAAA,CAAkBC,gBAAAA,CAAiB,MAAA,EAAQI,IAAAA,CAAKF,OAAAA,IAAWE,IAAI,CAAA;AAC/DL,KAAAA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QX,WACnB,aAAA,EAAeW,IAAAA,IAAQX,WAEtBL,QAAAA,EACH;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
@@ -119,6 +119,19 @@ const useColorStyle = (defaultTheme) => {
119
119
  }
120
120
  };
121
121
  };
122
+ const useNumbersColor = (defaultTheme) => {
123
+ const theme = useTheme();
124
+ const inheritedThemeName = theme.name;
125
+ const themeName = !defaultTheme ? inheritedThemeName : defaultTheme;
126
+ return theme.click.codeblock[`${themeName}Mode`].color.numbers.default;
127
+ };
128
+ const useButtonStateColors = () => {
129
+ const theme = useTheme();
130
+ return {
131
+ success: theme.click.alert.color.text.success,
132
+ danger: theme.click.alert.color.text.danger
133
+ };
134
+ };
122
135
 
123
- export { useColorStyle as default };
136
+ export { useColorStyle as default, useButtonStateColors, useNumbersColor };
124
137
  //# sourceMappingURL=useColorStyle.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useColorStyle.js","sources":["../../../../src/components/CodeBlock/useColorStyle.ts"],"sourcesContent":["import { useTheme } from 'styled-components';\nimport { CodeThemeType } from './CodeBlock.types';\n\nconst useColorStyle = (defaultTheme?: CodeThemeType) => {\n const theme = useTheme();\n const inheritedThemeName = theme.name as CodeThemeType;\n const themeName = !defaultTheme ? inheritedThemeName : defaultTheme;\n const codeTheme = theme.click.codeblock[`${themeName}Mode`].color;\n\n return {\n hljs: {\n display: 'block',\n overflowX: 'auto',\n padding: `${theme.click.codeblock.space.y} ${theme.click.codeblock.space.x}`,\n color: codeTheme.text.default,\n background: codeTheme.background.default,\n borderRadius: theme.click.codeblock.radii.all,\n font: theme.click.codeblock.typography.text.default,\n },\n 'hljs-comment': {\n color: themeName === 'dark' ? '#999999' : '#656e77',\n },\n 'hljs-keyword': {\n color: themeName === 'dark' ? '#88aece' : '#015692',\n },\n 'hljs-selector-tag': {\n color: themeName === 'dark' ? '#88aece' : '#015692',\n },\n 'hljs-meta-keyword': {\n color: themeName === 'dark' ? '#88aece' : '#015692',\n },\n 'hljs-doctag': {\n color: themeName === 'dark' ? '#88aece' : '#015692',\n },\n 'hljs-section': {\n color: themeName === 'dark' ? '#88aece' : '#015692',\n },\n 'hljs-selector-class': {\n color: themeName === 'dark' ? '#88aece' : '#015692',\n },\n 'hljs-meta': {\n color: themeName === 'dark' ? '#88aece' : '#015692',\n },\n 'hljs-selector-pseudo': {\n color: themeName === 'dark' ? '#88aece' : '#015692',\n },\n 'hljs-attr': {\n color: themeName === 'dark' ? '#88aece' : '#015692',\n },\n 'hljs-attribute': {\n color: themeName === 'dark' ? '#c59bc1' : '#803378',\n },\n 'hljs-name': {\n color: themeName === 'dark' ? '#f08d49' : '#b75501',\n },\n 'hljs-type': {\n color: themeName === 'dark' ? '#f08d49' : '#b75501',\n },\n 'hljs-number': {\n color: themeName === 'dark' ? '#f08d49' : '#b75501',\n },\n 'hljs-selector-id': {\n color: themeName === 'dark' ? '#f08d49' : '#b75501',\n },\n 'hljs-quote': {\n color: themeName === 'dark' ? '#f08d49' : '#b75501',\n },\n 'hljs-template-tag': {\n color: themeName === 'dark' ? '#f08d49' : '#b75501',\n },\n 'hljs-built_in': {\n color: themeName === 'dark' ? '#f08d49' : '#b75501',\n },\n 'hljs-title': {\n color: themeName === 'dark' ? '#f08d49' : '#b75501',\n },\n 'hljs-literal': {\n color: themeName === 'dark' ? '#f08d49' : '#b75501',\n },\n 'hljs-string': {\n color: themeName === 'dark' ? '#b5bd68' : '#54790d',\n },\n 'hljs-regexp': {\n color: themeName === 'dark' ? '#b5bd68' : '#54790d',\n },\n 'hljs-symbol': {\n color: themeName === 'dark' ? '#b5bd68' : '#54790d',\n },\n 'hljs-variable': {\n color: themeName === 'dark' ? '#b5bd68' : '#54790d',\n },\n 'hljs-template-variable': {\n color: themeName === 'dark' ? '#b5bd68' : '#54790d',\n },\n 'hljs-link': {\n color: themeName === 'dark' ? '#b5bd68' : '#54790d',\n },\n 'hljs-selector-attr': {\n color: themeName === 'dark' ? '#b5bd68' : '#54790d',\n },\n 'hljs-meta-string': {\n color: themeName === 'dark' ? '#b5bd68' : '#54790d',\n },\n 'hljs-bullet': {\n color: themeName === 'dark' ? '#cccccc' : '#535a60',\n },\n 'hljs-code': {\n color: themeName === 'dark' ? '#cccccc' : '#535a60',\n },\n 'hljs-deletion': {\n color: themeName === 'dark' ? '#de7176' : '#c02d2e',\n },\n 'hljs-addition': {\n color: themeName === 'dark' ? '#76c490' : '#2f6f44',\n },\n 'hljs-emphasis': {\n fontStyle: 'italic',\n },\n 'hljs-strong': {\n fontWeight: 'bold',\n },\n };\n};\n\nexport default useColorStyle;\n"],"names":["useColorStyle","defaultTheme","theme","useTheme","inheritedThemeName","name","themeName","codeTheme","click","codeblock","color","hljs","display","overflowX","padding","space","y","x","text","default","background","borderRadius","radii","all","font","typography","fontStyle","fontWeight"],"mappings":";;AAGA,MAAMA,aAAAA,GAAgBA,CAACC,YAAAA,KAAiC;AACtD,EAAA,MAAMC,QAAQC,QAAAA,EAAS;AACvB,EAAA,MAAMC,qBAAqBF,KAAAA,CAAMG,IAAAA;AACjC,EAAA,MAAMC,SAAAA,GAAY,CAACL,YAAAA,GAAeG,kBAAAA,GAAqBH,YAAAA;AACvD,EAAA,MAAMM,YAAYL,KAAAA,CAAMM,KAAAA,CAAMC,UAAU,CAAA,EAAGH,SAAS,MAAM,CAAA,CAAEI,KAAAA;AAE5D,EAAA,OAAO;AAAA,IACLC,IAAAA,EAAM;AAAA,MACJC,OAAAA,EAAS,OAAA;AAAA,MACTC,SAAAA,EAAW,MAAA;AAAA,MACXC,OAAAA,EAAS,CAAA,EAAGZ,KAAAA,CAAMM,KAAAA,CAAMC,SAAAA,CAAUM,KAAAA,CAAMC,CAAC,CAAA,CAAA,EAAId,KAAAA,CAAMM,KAAAA,CAAMC,SAAAA,CAAUM,KAAAA,CAAME,CAAC,CAAA,CAAA;AAAA,MAC1EP,KAAAA,EAAOH,UAAUW,IAAAA,CAAKC,OAAAA;AAAAA,MACtBC,UAAAA,EAAYb,UAAUa,UAAAA,CAAWD,OAA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esContent":["import type { CSSProperties } from 'react';\nimport { useTheme } from 'styled-components';\nimport { CodeThemeType } from './CodeBlock.types';\n\nconst useColorStyle = (defaultTheme?: CodeThemeType): Record<string, CSSProperties> => {\n const theme = useTheme();\n const inheritedThemeName = theme.name as CodeThemeType;\n const themeName = !defaultTheme ? inheritedThemeName : defaultTheme;\n const codeTheme = theme.click.codeblock[`${themeName}Mode`].color;\n\n return {\n hljs: {\n display: 'block',\n overflowX: 'auto',\n padding: `${theme.click.codeblock.space.y} ${theme.click.codeblock.space.x}`,\n color: codeTheme.text.default,\n background: codeTheme.background.default,\n borderRadius: theme.click.codeblock.radii.all,\n font: theme.click.codeblock.typography.text.default,\n },\n 'hljs-comment': {\n color: themeName === 'dark' ? '#999999' : '#656e77',\n },\n 'hljs-keyword': {\n color: themeName === 'dark' ? '#88aece' : '#015692',\n },\n 'hljs-selector-tag': {\n color: themeName === 'dark' ? '#88aece' : '#015692',\n },\n 'hljs-meta-keyword': {\n color: themeName === 'dark' ? '#88aece' : '#015692',\n },\n 'hljs-doctag': {\n color: themeName === 'dark' ? '#88aece' : '#015692',\n },\n 'hljs-section': {\n color: themeName === 'dark' ? '#88aece' : '#015692',\n },\n 'hljs-selector-class': {\n color: themeName === 'dark' ? '#88aece' : '#015692',\n },\n 'hljs-meta': {\n color: themeName === 'dark' ? '#88aece' : '#015692',\n },\n 'hljs-selector-pseudo': {\n color: themeName === 'dark' ? '#88aece' : '#015692',\n },\n 'hljs-attr': {\n color: themeName === 'dark' ? '#88aece' : '#015692',\n },\n 'hljs-attribute': {\n color: themeName === 'dark' ? '#c59bc1' : '#803378',\n },\n 'hljs-name': {\n color: themeName === 'dark' ? '#f08d49' : '#b75501',\n },\n 'hljs-type': {\n color: themeName === 'dark' ? '#f08d49' : '#b75501',\n },\n 'hljs-number': {\n color: themeName === 'dark' ? '#f08d49' : '#b75501',\n },\n 'hljs-selector-id': {\n color: themeName === 'dark' ? '#f08d49' : '#b75501',\n },\n 'hljs-quote': {\n color: themeName === 'dark' ? '#f08d49' : '#b75501',\n },\n 'hljs-template-tag': {\n color: themeName === 'dark' ? '#f08d49' : '#b75501',\n },\n 'hljs-built_in': {\n color: themeName === 'dark' ? '#f08d49' : '#b75501',\n },\n 'hljs-title': {\n color: themeName === 'dark' ? '#f08d49' : '#b75501',\n },\n 'hljs-literal': {\n color: themeName === 'dark' ? '#f08d49' : '#b75501',\n },\n 'hljs-string': {\n color: themeName === 'dark' ? '#b5bd68' : '#54790d',\n },\n 'hljs-regexp': {\n color: themeName === 'dark' ? '#b5bd68' : '#54790d',\n },\n 'hljs-symbol': {\n color: themeName === 'dark' ? '#b5bd68' : '#54790d',\n },\n 'hljs-variable': {\n color: themeName === 'dark' ? '#b5bd68' : '#54790d',\n },\n 'hljs-template-variable': {\n color: themeName === 'dark' ? '#b5bd68' : '#54790d',\n },\n 'hljs-link': {\n color: themeName === 'dark' ? '#b5bd68' : '#54790d',\n },\n 'hljs-selector-attr': {\n color: themeName === 'dark' ? '#b5bd68' : '#54790d',\n },\n 'hljs-meta-string': {\n color: themeName === 'dark' ? '#b5bd68' : '#54790d',\n },\n 'hljs-bullet': {\n color: themeName === 'dark' ? '#cccccc' : '#535a60',\n },\n 'hljs-code': {\n color: themeName === 'dark' ? '#cccccc' : '#535a60',\n },\n 'hljs-deletion': {\n color: themeName === 'dark' ? '#de7176' : '#c02d2e',\n },\n 'hljs-addition': {\n color: themeName === 'dark' ? '#76c490' : '#2f6f44',\n },\n 'hljs-emphasis': {\n fontStyle: 'italic',\n },\n 'hljs-strong': {\n fontWeight: 'bold',\n },\n };\n};\n\nexport const useNumbersColor = (defaultTheme?: CodeThemeType): string => {\n const theme = useTheme();\n const inheritedThemeName = theme.name as CodeThemeType;\n const themeName = !defaultTheme ? inheritedThemeName : defaultTheme;\n return theme.click.codeblock[`${themeName}Mode`].color.numbers.default;\n};\n\nexport const useButtonStateColors = (): { success: string; danger: string } => {\n const theme = useTheme();\n return {\n success: theme.click.alert.color.text.success,\n danger: theme.click.alert.color.text.danger,\n };\n};\n\nexport default useColorStyle;\n"],"names":["useColorStyle","defaultTheme","theme","useTheme","inheritedThemeName","name","themeName","codeTheme","click","codeblock","color","hljs","display","overflowX","padding","space","y","x","text","default","background","borderRadius","radii","all","font","typography","fontStyle","fontWeight","useNumbersColor","numbers","useButtonStateColors","success","alert","danger"],"mappings":";;AAIA,MAAMA,aAAAA,GAAgBA,CAACC,YAAAA,KAAgE;AACrF,EAAA,MAAMC,QAAQC,QAAAA,EAAS;AACvB,EAAA,MAAMC,qBAAqBF,KAAAA,CAAMG,IAAAA;AACjC,EAAA,MAAMC,SAAAA,GAAY,CAACL,YAAAA,GAAeG,kBAAAA,GAAqBH,YAAAA;AACvD,EAAA,MAAMM,YAAYL,KAAAA,CAAMM,KAAAA,CAAMC,UAAU,CAAA,EAAGH,SAAS,MAAM,CAAA,CAAEI,KAAAA;AAE5D,EAAA,OAAO;AAAA,IACLC,IAAAA,EAAM;AAAA,MACJC,OAAAA,EAAS,OAAA;AAAA,MACTC,SAAAA,EAAW,MAAA;AAAA,MACXC,OAAAA,EAAS,CAAA,EAAGZ,KAAAA,CAAMM,KAAAA,CAAMC,SAAAA,CAAUM,KAAAA,CAAMC,CAAC,CAAA,CAAA,EAAId,KAAAA,CAAMM,KAAAA,CAAMC,SAAAA,CAAUM,KAAAA,CAAME,CAAC,CAAA,CAAA;AAAA,MAC1EP,KAAAA,EAAOH,UAAUW,IAAAA,CAAKC,OAAAA;AAAAA,MACtBC,UAAAA,EAAYb,UAAUa,UAAAA,CAAWD,OAAAA;AAAAA,MACjCE,YAAAA,EAAcnB,KAAAA,CAAMM,KAAAA,CAAMC,SAAAA,CAAUa,KAAAA,CAAMC,GAAAA;AAAAA,MAC1CC,IAAAA,EAAMtB,KAAAA,CAAMM,KAAAA,CAAMC,SAAAA,CAAUgB,WAAWP,IAAAA,CAAKC;AAAAA,KAC9C;AAAA,IACA,cAAA,EAAgB;AAAA,MACdT,KAAAA,EAAOJ,SAAAA,KA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AAAA;AACjE;AAEO,MAAMW,uBAAuBA,MAA2C;AAC7E,EAAA,MAAM5B,QAAQC,QAAAA,EAAS;AACvB,EAAA,OAAO;AAAA,IACL4B,OAAAA,EAAS7B,KAAAA,CAAMM,KAAAA,CAAMwB,KAAAA,CAAMtB,MAAMQ,IAAAA,CAAKa,OAAAA;AAAAA,IACtCE,MAAAA,EAAQ/B,KAAAA,CAAMM,KAAAA,CAAMwB,KAAAA,CAAMtB,MAAMQ,IAAAA,CAAKe;AAAAA,GACvC;AACF;;;;"}
@@ -1,3 +1,10 @@
1
+ /* stylelint-disable custom-property-pattern -- design tokens use camelCase (e.g. genericMenu) */
2
+
3
+ .trigger__4-zK2:focus-visible {
4
+ outline: 2px solid var(--click-global-color-outline-default);
5
+ outline-offset: 2px;
6
+ }
7
+
1
8
  .right-menu-content__0-EQz {
2
9
  z-index: 1;
3
10
  flex-direction: column;
@@ -26,3 +33,8 @@
26
33
  .right-menu-content_show-arrow__-yaE-[data-side='right'] .popover-arrow__z8r3W {
27
34
  margin-left: 1rem;
28
35
  }
36
+
37
+ .group__4UU7V {
38
+ width: 100%;
39
+ border-bottom: 1px solid var(--click-genericMenu-item-color-default-stroke-default);
40
+ }
@@ -1,6 +1,11 @@
1
+ const trigger = "trigger__4-zK2";
2
+ const group = "group__4UU7V";
1
3
  const styles = {
4
+ trigger: trigger,
2
5
  "right-menu-content": "right-menu-content__0-EQz",
3
- "right-menu-content_show-arrow": "right-menu-content_show-arrow__-yaE-"};
6
+ "right-menu-content_show-arrow": "right-menu-content_show-arrow__-yaE-",
7
+ group: group
8
+ };
4
9
 
5
- export { styles as default };
10
+ export { styles as default, group, trigger };
6
11
  //# sourceMappingURL=ContextMenu.module.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContextMenu.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
1
+ {"version":3,"file":"ContextMenu.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
@@ -1,7 +1,6 @@
1
1
  import "./ContextMenu.css";
2
2
  import { jsx, jsxs } from 'react/jsx-runtime';
3
3
  import * as RightMenu from '@radix-ui/react-context-menu';
4
- import { styled } from 'styled-components';
5
4
  import { forwardRef } from 'react';
6
5
  import { GenericMenuItem, GenericMenuPanel, Arrow } from '../GenericMenu/index.js';
7
6
  import { cn } from '../../lib/cva.js';
@@ -14,16 +13,12 @@ import { Icon as SvgImage } from '../Icon/index.js';
14
13
  import { cva } from 'class-variance-authority';
15
14
 
16
15
  const ContextMenu = (props) => /* @__PURE__ */ jsx(RightMenu.Root, { ...props });
17
- const TriggerDiv = styled.div.withConfig({
18
- componentId: "sc-8z6kye-0"
19
- })(["&:focus-visible{outline:2px solid ", ";outline-offset:2px;}"], ({
20
- theme
21
- }) => theme.click.global.color.outline.default);
22
16
  const ContextMenuTrigger = forwardRef(({
23
17
  disabled,
18
+ className,
24
19
  ...props
25
20
  }, ref) => {
26
- return /* @__PURE__ */ jsx(RightMenu.Trigger, { asChild: true, disabled, children: /* @__PURE__ */ jsx(TriggerDiv, { ref, ...props }) });
21
+ return /* @__PURE__ */ jsx(RightMenu.Trigger, { asChild: true, disabled, children: /* @__PURE__ */ jsx("div", { ref, ...props, className: cn(styles.trigger, className) }) });
27
22
  });
28
23
  ContextMenuTrigger.displayName = "ContextMenuTrigger";
29
24
  ContextMenu.Trigger = ContextMenuTrigger;
@@ -81,25 +76,18 @@ const ContextMenuContent = ({
81
76
  };
82
77
  ContextMenuContent.displayName = "ContextMenuContent";
83
78
  ContextMenu.Content = ContextMenuContent;
84
- const RightMenuGroup = styled(RightMenu.Group).withConfig({
85
- componentId: "sc-8z6kye-1"
86
- })(["width:100%;border-bottom:1px solid ", ";"], ({
87
- theme
88
- }) => theme.click.genericMenu.item.color.default.stroke.default);
89
- const ContextMenuGroup = (props) => {
90
- return /* @__PURE__ */ jsx(RightMenuGroup, { ...props });
79
+ const ContextMenuGroup = ({
80
+ className,
81
+ ...props
82
+ }) => {
83
+ return /* @__PURE__ */ jsx(RightMenu.Group, { ...props, className: cn(styles.group, className) });
91
84
  };
92
85
  ContextMenuGroup.displayName = "ContextMenuGroup";
93
86
  ContextMenu.Group = ContextMenuGroup;
94
- const RightMenuSub = styled(RightMenu.Sub).withConfig({
95
- componentId: "sc-8z6kye-2"
96
- })(["border-bottom:1px solid ", ";"], ({
97
- theme
98
- }) => theme.click.genericMenu.item.color.default.stroke.default);
99
87
  const ContextMenuSub = ({
100
88
  ...props
101
89
  }) => {
102
- return /* @__PURE__ */ jsx(RightMenuSub, { ...props });
90
+ return /* @__PURE__ */ jsx(RightMenu.Sub, { ...props });
103
91
  };
104
92
  ContextMenuSub.displayName = "ContextMenuSub";
105
93
  ContextMenu.Sub = ContextMenuSub;