@tcn/ui 0.0.3 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (404) hide show
  1. package/dist/actions/button/base_button/base_button.d.ts.map +1 -1
  2. package/dist/actions/button/base_button/base_button.js +20 -15
  3. package/dist/actions/button/base_button/base_button.js.map +1 -1
  4. package/dist/actions/button/button/button.d.ts.map +1 -1
  5. package/dist/actions/button/button/button.js +7 -7
  6. package/dist/actions/button/button/button.js.map +1 -1
  7. package/dist/actions/button/button_group/button_group.d.ts.map +1 -1
  8. package/dist/actions/button/button_group/button_group.js +2 -5
  9. package/dist/actions/button/button_group/button_group.js.map +1 -1
  10. package/dist/actions/button/select_group/select_group.js +7 -7
  11. package/dist/actions/button/select_group/select_group.js.map +1 -1
  12. package/dist/actions/button/slim_button/slim_button.d.ts.map +1 -1
  13. package/dist/actions/button/slim_button/slim_button.js +5 -5
  14. package/dist/actions/button/slim_button/slim_button.js.map +1 -1
  15. package/dist/button.css +1 -1
  16. package/dist/feedback/progress/progress_bar.js +1 -1
  17. package/dist/footer.css +1 -1
  18. package/dist/form/field/common/field_control/field_control.js +6 -6
  19. package/dist/form/field/common/field_control/field_control.js.map +1 -1
  20. package/dist/form/field/common/field_description.js +1 -1
  21. package/dist/form/field/common/field_error.js +2 -2
  22. package/dist/form/field/common/field_header.js +8 -8
  23. package/dist/form/field/common/field_header.js.map +1 -1
  24. package/dist/form/field/common/field_label.js +1 -1
  25. package/dist/form/field/common/status_input/status_input.d.ts.map +1 -1
  26. package/dist/form/field/common/status_input/status_input.js +9 -15
  27. package/dist/form/field/common/status_input/status_input.js.map +1 -1
  28. package/dist/form/field/h_field/h_field.js +9 -9
  29. package/dist/form/field/h_field/h_field.js.map +1 -1
  30. package/dist/form/field/v_field/v_field.js +8 -8
  31. package/dist/form/field/v_field/v_field.js.map +1 -1
  32. package/dist/form/field_set/field_set.d.ts.map +1 -1
  33. package/dist/form/field_set/field_set.js +12 -19
  34. package/dist/form/field_set/field_set.js.map +1 -1
  35. package/dist/inputs/checkbox/checkbox.js +12 -12
  36. package/dist/inputs/checkbox/checkbox.js.map +1 -1
  37. package/dist/inputs/color_input/color_input.d.ts.map +1 -1
  38. package/dist/inputs/color_input/color_input.js +13 -17
  39. package/dist/inputs/color_input/color_input.js.map +1 -1
  40. package/dist/inputs/color_input/color_picker.js +6 -6
  41. package/dist/inputs/color_input/color_picker.js.map +1 -1
  42. package/dist/inputs/combo_box/combo_box.js +15 -15
  43. package/dist/inputs/combo_box/combo_box.js.map +1 -1
  44. package/dist/inputs/date_picker/date_picker.js +6 -6
  45. package/dist/inputs/date_picker/date_picker.js.map +1 -1
  46. package/dist/inputs/date_picker/date_picker_date.js +13 -13
  47. package/dist/inputs/date_picker/date_picker_date.js.map +1 -1
  48. package/dist/inputs/date_picker/date_picker_day.js +1 -1
  49. package/dist/inputs/date_picker/date_picker_header.js +24 -24
  50. package/dist/inputs/date_picker/date_picker_header.js.map +1 -1
  51. package/dist/inputs/date_picker/date_picker_input.js +19 -19
  52. package/dist/inputs/date_picker/date_picker_input.js.map +1 -1
  53. package/dist/inputs/date_picker/date_picker_time_selector.d.ts.map +1 -1
  54. package/dist/inputs/date_picker/date_picker_time_selector.js +6 -9
  55. package/dist/inputs/date_picker/date_picker_time_selector.js.map +1 -1
  56. package/dist/inputs/date_picker/date_picker_year_input.js +3 -3
  57. package/dist/inputs/date_picker/date_picker_year_input.js.map +1 -1
  58. package/dist/inputs/date_picker/date_picker_year_selector.d.ts.map +1 -1
  59. package/dist/inputs/date_picker/date_picker_year_selector.js +18 -24
  60. package/dist/inputs/date_picker/date_picker_year_selector.js.map +1 -1
  61. package/dist/inputs/input/input.d.ts +2 -2
  62. package/dist/inputs/input/input.d.ts.map +1 -1
  63. package/dist/inputs/input/input.js +4 -4
  64. package/dist/inputs/input/input.js.map +1 -1
  65. package/dist/inputs/multi_combo_box/multi_combo_box.js +1 -1
  66. package/dist/inputs/multi_combo_box/multi_combo_box.js.map +1 -1
  67. package/dist/inputs/multiselect/multiselect_values.js +8 -8
  68. package/dist/inputs/multiselect/multiselect_values.js.map +1 -1
  69. package/dist/inputs/options/option.d.ts +1 -0
  70. package/dist/inputs/options/option.d.ts.map +1 -1
  71. package/dist/inputs/options/option.js.map +1 -1
  72. package/dist/inputs/phone_number_input/phone_number_input.d.ts +6 -1
  73. package/dist/inputs/phone_number_input/phone_number_input.d.ts.map +1 -1
  74. package/dist/inputs/phone_number_input/phone_number_input.js +169 -128
  75. package/dist/inputs/phone_number_input/phone_number_input.js.map +1 -1
  76. package/dist/inputs/radio/radio.js +14 -14
  77. package/dist/inputs/radio/radio.js.map +1 -1
  78. package/dist/inputs/select/select.js +16 -16
  79. package/dist/inputs/select/select.js.map +1 -1
  80. package/dist/inputs/slider/slider.js +7 -7
  81. package/dist/inputs/slider/slider.js.map +1 -1
  82. package/dist/inputs/suggestions/suggestion_item.d.ts +1 -1
  83. package/dist/inputs/suggestions/suggestion_item.d.ts.map +1 -1
  84. package/dist/inputs/suggestions/suggestion_item.js +23 -18
  85. package/dist/inputs/suggestions/suggestion_item.js.map +1 -1
  86. package/dist/inputs/suggestions/suggestion_list.d.ts +1 -1
  87. package/dist/inputs/suggestions/suggestion_list.d.ts.map +1 -1
  88. package/dist/inputs/suggestions/suggestion_list.js +105 -95
  89. package/dist/inputs/suggestions/suggestion_list.js.map +1 -1
  90. package/dist/inputs/switch/switch.js +14 -14
  91. package/dist/inputs/switch/switch.js.map +1 -1
  92. package/dist/inputs/textarea/textarea.js +6 -6
  93. package/dist/inputs/textarea/textarea.js.map +1 -1
  94. package/dist/inputs/unit_input/unit_input.js +5 -5
  95. package/dist/inputs/unit_input/unit_input.js.map +1 -1
  96. package/dist/layouts/body/h_body.js +10 -10
  97. package/dist/layouts/body/h_body.js.map +1 -1
  98. package/dist/layouts/body/v_body.js +8 -8
  99. package/dist/layouts/body/v_body.js.map +1 -1
  100. package/dist/layouts/column/column.js +16 -16
  101. package/dist/layouts/column/column.js.map +1 -1
  102. package/dist/layouts/divider/divider.js +9 -9
  103. package/dist/layouts/divider/divider.js.map +1 -1
  104. package/dist/layouts/footer/footer.js +6 -6
  105. package/dist/layouts/footer/footer.js.map +1 -1
  106. package/dist/layouts/grid/grid.d.ts.map +1 -1
  107. package/dist/layouts/grid/grid.js +22 -31
  108. package/dist/layouts/grid/grid.js.map +1 -1
  109. package/dist/layouts/header/header.js +11 -11
  110. package/dist/layouts/header/header.js.map +1 -1
  111. package/dist/layouts/index.d.ts +3 -2
  112. package/dist/layouts/index.d.ts.map +1 -1
  113. package/dist/layouts/index.js +26 -24
  114. package/dist/layouts/index.js.map +1 -1
  115. package/dist/layouts/list/item.d.ts +1 -0
  116. package/dist/layouts/list/item.d.ts.map +1 -1
  117. package/dist/layouts/list/item.js +18 -7
  118. package/dist/layouts/list/item.js.map +1 -1
  119. package/dist/layouts/list/list.js +12 -12
  120. package/dist/layouts/list/list.js.map +1 -1
  121. package/dist/layouts/sidebar_end/sidebar_end.js +15 -15
  122. package/dist/layouts/sidebar_end/sidebar_end.js.map +1 -1
  123. package/dist/layouts/sidebar_start/sidebar_start.js +16 -16
  124. package/dist/layouts/sidebar_start/sidebar_start.js.map +1 -1
  125. package/dist/layouts/utility_bar/utility_bar.js +14 -14
  126. package/dist/layouts/utility_bar/utility_bar.js.map +1 -1
  127. package/dist/modal.css +1 -1
  128. package/dist/overlay/context_menu/context_menu.js +4 -4
  129. package/dist/overlay/index.js +3 -3
  130. package/dist/overlay/menu/menu.js +8 -8
  131. package/dist/overlay/menu/menu.js.map +1 -1
  132. package/dist/overlay/popper/popper.js +12 -12
  133. package/dist/{portal-qqIp4SIl.js → overlay/portal/portal.js} +3 -3
  134. package/dist/overlay/portal/portal.js.map +1 -0
  135. package/dist/overlay/portal/portal_platform.js +3 -4
  136. package/dist/overlay/portal/portal_platform.js.map +1 -1
  137. package/dist/overlay/tooltip/tooltip.js +10 -10
  138. package/dist/overlay/tooltip/tooltip.js.map +1 -1
  139. package/dist/phone_number_input.css +1 -1
  140. package/dist/slim_button.css +1 -1
  141. package/dist/stacks/box/bottom_resize_handle.js +9 -9
  142. package/dist/stacks/box/bottom_resize_handle.js.map +1 -1
  143. package/dist/stacks/box/box.js +42 -42
  144. package/dist/stacks/box/box.js.map +1 -1
  145. package/dist/stacks/box/end_resize_handle.js +6 -6
  146. package/dist/stacks/box/end_resize_handle.js.map +1 -1
  147. package/dist/stacks/box/left_resize_handle.js +3 -3
  148. package/dist/stacks/box/left_resize_handle.js.map +1 -1
  149. package/dist/stacks/box/right_resize_handle.js +8 -8
  150. package/dist/stacks/box/right_resize_handle.js.map +1 -1
  151. package/dist/stacks/box/start_resize_handle.js +7 -7
  152. package/dist/stacks/box/start_resize_handle.js.map +1 -1
  153. package/dist/stacks/box/top_resize_handle.js +8 -8
  154. package/dist/stacks/box/top_resize_handle.js.map +1 -1
  155. package/dist/stacks/h_collapsible_box.js +5 -5
  156. package/dist/stacks/h_collapsible_box.js.map +1 -1
  157. package/dist/stacks/h_stack.js +26 -26
  158. package/dist/stacks/h_stack.js.map +1 -1
  159. package/dist/stacks/spacer.js +5 -5
  160. package/dist/stacks/spacer.js.map +1 -1
  161. package/dist/stacks/story_components/circle.js +6 -6
  162. package/dist/stacks/story_components/circle.js.map +1 -1
  163. package/dist/stacks/story_components/picture_placeholder.js +8 -8
  164. package/dist/stacks/story_components/picture_placeholder.js.map +1 -1
  165. package/dist/stacks/story_components/rect.js +11 -11
  166. package/dist/stacks/story_components/rect.js.map +1 -1
  167. package/dist/stacks/v_collapsible_box.js +8 -8
  168. package/dist/stacks/v_collapsible_box.js.map +1 -1
  169. package/dist/stacks/v_stack.js +35 -35
  170. package/dist/stacks/v_stack.js.map +1 -1
  171. package/dist/stacks/z_stack.js +34 -34
  172. package/dist/stacks/z_stack.js.map +1 -1
  173. package/dist/surfaces/alert/alert.js +8 -8
  174. package/dist/surfaces/alert/alert.js.map +1 -1
  175. package/dist/surfaces/card/card.d.ts.map +1 -1
  176. package/dist/surfaces/card/card.js +6 -15
  177. package/dist/surfaces/card/card.js.map +1 -1
  178. package/dist/surfaces/confirm/confirm.d.ts.map +1 -1
  179. package/dist/surfaces/confirm/confirm.js +17 -24
  180. package/dist/surfaces/confirm/confirm.js.map +1 -1
  181. package/dist/surfaces/drawers/drawer_bottom/drawer_bottom.js +5 -5
  182. package/dist/surfaces/drawers/drawer_bottom/drawer_bottom.js.map +1 -1
  183. package/dist/surfaces/drawers/drawer_end/drawer_end.js +8 -8
  184. package/dist/surfaces/drawers/drawer_end/drawer_end.js.map +1 -1
  185. package/dist/surfaces/drawers/drawer_start/drawer_start.js +4 -4
  186. package/dist/surfaces/drawers/drawer_start/drawer_start.js.map +1 -1
  187. package/dist/surfaces/drawers/drawer_top/drawer_top.js +4 -4
  188. package/dist/surfaces/drawers/drawer_top/drawer_top.js.map +1 -1
  189. package/dist/surfaces/modal/modal.d.ts +2 -4
  190. package/dist/surfaces/modal/modal.d.ts.map +1 -1
  191. package/dist/surfaces/modal/modal.js +16 -7
  192. package/dist/surfaces/modal/modal.js.map +1 -1
  193. package/dist/surfaces/page/h_page.js +6 -6
  194. package/dist/surfaces/page/h_page.js.map +1 -1
  195. package/dist/surfaces/page/v_page.js +9 -9
  196. package/dist/surfaces/page/v_page.js.map +1 -1
  197. package/dist/surfaces/panel/h_panel.d.ts.map +1 -1
  198. package/dist/surfaces/panel/h_panel.js +18 -24
  199. package/dist/surfaces/panel/h_panel.js.map +1 -1
  200. package/dist/surfaces/panel/v_panel.js +9 -9
  201. package/dist/surfaces/panel/v_panel.js.map +1 -1
  202. package/dist/surfaces/popover/popover.js +34 -34
  203. package/dist/surfaces/popover/popover.js.map +1 -1
  204. package/dist/surfaces/window/window.d.ts.map +1 -1
  205. package/dist/surfaces/window/window.js +6 -14
  206. package/dist/surfaces/window/window.js.map +1 -1
  207. package/dist/themes/index.d.ts +0 -2
  208. package/dist/themes/index.d.ts.map +1 -1
  209. package/dist/themes/index.js +6 -402
  210. package/dist/themes/index.js.map +1 -1
  211. package/dist/themes/stylesheets/reset.js +140 -0
  212. package/dist/themes/stylesheets/reset.js.map +1 -0
  213. package/dist/themes/themes/ergo/ergo_theme.js +595 -0
  214. package/dist/themes/themes/ergo/ergo_theme.js.map +1 -0
  215. package/dist/tokens/badge/badge.js +13 -13
  216. package/dist/tokens/badge/badge.js.map +1 -1
  217. package/dist/tokens/bubble/bubble.js +11 -11
  218. package/dist/tokens/bubble/bubble.js.map +1 -1
  219. package/dist/tokens/chip/chip.js +11 -11
  220. package/dist/tokens/chip/chip.js.map +1 -1
  221. package/dist/typography/body_text/body_text.js +21 -21
  222. package/dist/typography/body_text/body_text.js.map +1 -1
  223. package/dist/typography/callout/callout.js +16 -16
  224. package/dist/typography/callout/callout.js.map +1 -1
  225. package/dist/typography/caption/caption.js +13 -13
  226. package/dist/typography/caption/caption.js.map +1 -1
  227. package/dist/typography/footnote/footnote.js +14 -14
  228. package/dist/typography/footnote/footnote.js.map +1 -1
  229. package/dist/typography/headline/headline.js +12 -12
  230. package/dist/typography/headline/headline.js.map +1 -1
  231. package/dist/typography/subheadline/subheadline.js +13 -13
  232. package/dist/typography/subheadline/subheadline.js.map +1 -1
  233. package/dist/typography/title/title.js +17 -17
  234. package/dist/typography/title/title.js.map +1 -1
  235. package/package.json +23 -4
  236. package/src/actions/button/__stories__/button.stories.tsx +1 -1
  237. package/src/actions/button/__stories__/button_group.stories.tsx +1 -1
  238. package/src/actions/button/__stories__/select_group.stories.tsx +1 -1
  239. package/src/actions/button/__stories__/slim_button.stories.tsx +1 -1
  240. package/src/actions/button/base_button/base_button.tsx +8 -3
  241. package/src/actions/button/button/button.module.css +0 -78
  242. package/src/actions/button/button/button.tsx +3 -5
  243. package/src/actions/button/button_group/button_group.tsx +4 -7
  244. package/src/actions/button/select_group/select_group.tsx +3 -3
  245. package/src/actions/button/slim_button/slim_button.module.css +0 -26
  246. package/src/actions/button/slim_button/slim_button.tsx +3 -2
  247. package/src/feedback/lazy/lazy.stories.tsx +1 -1
  248. package/src/feedback/loading/__storybook__/loading.stories.tsx +1 -1
  249. package/src/feedback/progress/progress_bar.stories.tsx +1 -1
  250. package/src/form/field/common/field_control/field_control.tsx +2 -2
  251. package/src/form/field/common/field_header.tsx +2 -2
  252. package/src/form/field/common/status_input/status_input.tsx +3 -6
  253. package/src/form/field/field.stories.tsx +2 -1
  254. package/src/form/field/h_field/h_field.stories.tsx +10 -1
  255. package/src/form/field/h_field/h_field.tsx +2 -2
  256. package/src/form/field/v_field/v_field.stories.tsx +10 -1
  257. package/src/form/field/v_field/v_field.tsx +2 -2
  258. package/src/form/field_set/field_set.stories.tsx +9 -1
  259. package/src/form/field_set/field_set.tsx +4 -7
  260. package/src/inputs/checkbox/checkbox.stories.tsx +9 -1
  261. package/src/inputs/checkbox/checkbox.tsx +2 -2
  262. package/src/inputs/color_input/color_input.stories.tsx +9 -1
  263. package/src/inputs/color_input/color_input.tsx +2 -6
  264. package/src/inputs/color_input/color_picker.tsx +2 -2
  265. package/src/inputs/combo_box/combo_box.stories.tsx +14 -5
  266. package/src/inputs/combo_box/combo_box.tsx +2 -2
  267. package/src/inputs/date_picker/date_picker.stories.tsx +18 -10
  268. package/src/inputs/date_picker/date_picker.tsx +3 -3
  269. package/src/inputs/date_picker/date_picker_date.tsx +3 -3
  270. package/src/inputs/date_picker/date_picker_header.tsx +2 -2
  271. package/src/inputs/date_picker/date_picker_input.stories.tsx +15 -7
  272. package/src/inputs/date_picker/date_picker_input.tsx +3 -3
  273. package/src/inputs/date_picker/date_picker_time_selector.tsx +5 -8
  274. package/src/inputs/date_picker/date_picker_year_input.tsx +2 -2
  275. package/src/inputs/date_picker/date_picker_year_selector.tsx +3 -9
  276. package/src/inputs/input/input.stories.tsx +9 -1
  277. package/src/inputs/input/input.tsx +5 -4
  278. package/src/inputs/mask_input/key_capture_input.stories.tsx +9 -1
  279. package/src/inputs/mask_input/mask_input.stories.tsx +10 -1
  280. package/src/inputs/multi_combo_box/multi_combo_box.stories.tsx +10 -1
  281. package/src/inputs/multi_combo_box/multi_combo_box.tsx +2 -2
  282. package/src/inputs/multiselect/multiselect_values.tsx +2 -2
  283. package/src/inputs/multiselect/mutliselect.stories.tsx +10 -1
  284. package/src/inputs/options/option.tsx +1 -0
  285. package/src/inputs/phone_number_input/phone_number_input.module.css +12 -0
  286. package/src/inputs/phone_number_input/phone_number_input.stories.tsx +18 -1
  287. package/src/inputs/phone_number_input/phone_number_input.tsx +104 -29
  288. package/src/inputs/radio/radio.stories.tsx +14 -6
  289. package/src/inputs/radio/radio.tsx +2 -2
  290. package/src/inputs/select/select.stories.tsx +18 -9
  291. package/src/inputs/select/select.tsx +2 -2
  292. package/src/inputs/slider/slider.stories.tsx +9 -1
  293. package/src/inputs/slider/slider.tsx +2 -2
  294. package/src/inputs/suggestions/suggestion_item.tsx +14 -4
  295. package/src/inputs/suggestions/suggestion_list.stories.tsx +21 -12
  296. package/src/inputs/suggestions/suggestion_list.tsx +25 -6
  297. package/src/inputs/switch/switch.stories.tsx +9 -1
  298. package/src/inputs/switch/switch.tsx +4 -4
  299. package/src/inputs/textarea/textarea.stories.tsx +9 -1
  300. package/src/inputs/textarea/textarea.tsx +2 -2
  301. package/src/inputs/unit_input/unit_input.stories.tsx +9 -1
  302. package/src/inputs/unit_input/unit_input.tsx +4 -4
  303. package/src/layouts/body/h_body.tsx +2 -2
  304. package/src/layouts/body/v_body.tsx +2 -2
  305. package/src/layouts/column/column.tsx +3 -3
  306. package/src/layouts/divider/__stories__/divider.stories.tsx +59 -19
  307. package/src/layouts/divider/divider.tsx +3 -3
  308. package/src/layouts/footer/footer.module.css +0 -1
  309. package/src/layouts/footer/footer.tsx +2 -2
  310. package/src/layouts/grid/grid.stories.tsx +42 -34
  311. package/src/layouts/grid/grid.tsx +2 -7
  312. package/src/layouts/header/header.tsx +2 -2
  313. package/src/layouts/index.ts +3 -2
  314. package/src/layouts/list/item.tsx +11 -3
  315. package/src/layouts/list/list.tsx +3 -3
  316. package/src/layouts/sidebar_end/sidebar_end.tsx +2 -2
  317. package/src/layouts/sidebar_start/sidebar_start.tsx +2 -2
  318. package/src/layouts/utility_bar/utility_bar.tsx +2 -2
  319. package/src/overlay/context_menu/context_menu.stories.tsx +13 -5
  320. package/src/overlay/menu/menu.stories.tsx +22 -14
  321. package/src/overlay/menu/menu.tsx +3 -3
  322. package/src/overlay/popper/popper.stories.tsx +43 -22
  323. package/src/overlay/portal/portal.stories.tsx +10 -1
  324. package/src/overlay/tooltip/tooltip.stories.tsx +9 -2
  325. package/src/overlay/tooltip/tooltip.tsx +2 -2
  326. package/src/stacks/box/bottom_resize_handle.tsx +2 -2
  327. package/src/stacks/box/box.tsx +2 -2
  328. package/src/stacks/box/end_resize_handle.tsx +2 -2
  329. package/src/stacks/box/left_resize_handle.tsx +2 -2
  330. package/src/stacks/box/right_resize_handle.tsx +2 -2
  331. package/src/stacks/box/start_resize_handle.tsx +2 -2
  332. package/src/stacks/box/top_resize_handle.tsx +2 -2
  333. package/src/stacks/collapsible_box.stories.tsx +10 -1
  334. package/src/stacks/h_collapsible_box.tsx +2 -2
  335. package/src/stacks/h_stack.stories.tsx +104 -59
  336. package/src/stacks/h_stack.tsx +2 -2
  337. package/src/stacks/spacer.tsx +2 -2
  338. package/src/stacks/story_components/circle.tsx +2 -2
  339. package/src/stacks/story_components/picture_placeholder.tsx +2 -2
  340. package/src/stacks/story_components/rect.tsx +2 -2
  341. package/src/stacks/v_collapsible_box.tsx +2 -2
  342. package/src/stacks/v_stack.stories.tsx +91 -10
  343. package/src/stacks/v_stack.tsx +2 -2
  344. package/src/stacks/z_stack.stories.tsx +9 -1
  345. package/src/stacks/z_stack.tsx +2 -2
  346. package/src/surfaces/alert/alert.stories.tsx +4 -4
  347. package/src/surfaces/alert/alert.tsx +2 -2
  348. package/src/surfaces/card/card.tsx +3 -9
  349. package/src/surfaces/confirm/confirm.stories.tsx +4 -4
  350. package/src/surfaces/confirm/confirm.tsx +3 -6
  351. package/src/surfaces/drawers/__stories__/drawers.stories.tsx +1 -1
  352. package/src/surfaces/drawers/drawer_bottom/drawer_bottom.tsx +2 -2
  353. package/src/surfaces/drawers/drawer_end/drawer_end.tsx +2 -2
  354. package/src/surfaces/drawers/drawer_start/drawer_start.tsx +2 -2
  355. package/src/surfaces/drawers/drawer_top/drawer_top.tsx +2 -2
  356. package/src/surfaces/modal/__stories__/modal.stories.tsx +54 -0
  357. package/src/surfaces/modal/modal.module.css +2 -1
  358. package/src/surfaces/modal/modal.tsx +9 -6
  359. package/src/surfaces/page/h_page.tsx +2 -2
  360. package/src/surfaces/page/v_page.tsx +2 -2
  361. package/src/surfaces/panel/__stories__/panel.stories.tsx +13 -12
  362. package/src/surfaces/panel/h_panel.tsx +3 -9
  363. package/src/surfaces/panel/v_panel.tsx +3 -3
  364. package/src/surfaces/popover/popover.tsx +2 -2
  365. package/src/surfaces/window/window.stories.tsx +1 -1
  366. package/src/surfaces/window/window.tsx +2 -6
  367. package/src/themes/index.ts +0 -2
  368. package/src/themes/stories/themes.stories.tsx +1 -1
  369. package/src/themes/themes/ergo/__stories__/components/material_picker/sb_inverted_materials.module.css +34 -0
  370. package/src/themes/themes/ergo/__stories__/components/material_picker/sb_material_picker.tsx +52 -0
  371. package/src/themes/themes/ergo/__stories__/components/tone_picker/sb_card.module.css +5 -0
  372. package/src/themes/themes/ergo/__stories__/components/tone_picker/sb_tone_card.tsx +40 -0
  373. package/src/themes/themes/ergo/__stories__/components/tone_picker/sb_tone_picker.tsx +83 -0
  374. package/src/themes/themes/ergo/__stories__/components/tone_picker/types.ts +7 -0
  375. package/src/themes/themes/ergo/__stories__/material.stories.tsx +154 -0
  376. package/src/themes/themes/ergo/__stories__/sb_materials.module.css +110 -0
  377. package/src/themes/themes/ergo/__stories__/utils.ts +92 -0
  378. package/src/themes/themes/ergo/ergo_theme.css +348 -15
  379. package/src/tokens/badge/badge.stories.tsx +6 -6
  380. package/src/tokens/badge/badge.tsx +3 -3
  381. package/src/tokens/bubble/bubble.stories.tsx +16 -9
  382. package/src/tokens/bubble/bubble.tsx +2 -2
  383. package/src/tokens/chip/chip.stories.tsx +1 -1
  384. package/src/tokens/chip/chip.tsx +2 -2
  385. package/src/typography/body_text/body_text.tsx +2 -2
  386. package/src/typography/callout/callout.tsx +2 -2
  387. package/src/typography/caption/caption.tsx +2 -2
  388. package/src/typography/footnote/footnote.tsx +2 -2
  389. package/src/typography/headline/headline.tsx +2 -2
  390. package/src/typography/subheadline/subheadline.tsx +2 -2
  391. package/src/typography/title/title.tsx +2 -2
  392. package/src/typography/typography-showcase.stories.tsx +2 -2
  393. package/src/utils/click_away_listener.stories.tsx +21 -11
  394. package/src/utils/responsive/responsive_renderer.stories.tsx +7 -7
  395. package/src/utils/scroll_away_listener.stories.tsx +11 -1
  396. package/tsconfig.json +0 -3
  397. package/dist/card.css +0 -1
  398. package/dist/portal-qqIp4SIl.js.map +0 -1
  399. package/dist/themes/stylesheets/reset.css +0 -1
  400. package/dist/themes/themes/ergo/ergo_theme.css +0 -1
  401. package/dist/themes/themes/windows_98/windows_98.css +0 -1
  402. package/src/surfaces/card/card.module.css +0 -5
  403. package/src/surfaces/modal/modal.stories.tsx +0 -15
  404. /package/dist/{overlay/portal/portal.css → portal_platform.css} +0 -0
@@ -1,5 +1,5 @@
1
1
  import { HStack, type HStackProps } from '../../stacks/h_stack.js';
2
- import classNames from 'classnames';
2
+ import { clsx } from 'clsx';
3
3
  import React, {
4
4
  useCallback,
5
5
  useLayoutEffect,
@@ -21,6 +21,16 @@ import { NotebookIcon } from '@tcn/icons/notebook_icon.js';
21
21
  import { Option, OptionProps } from '../options/option.js';
22
22
  import { SuggestionList } from '../suggestions/suggestion_list.js';
23
23
  import { stripNonNumericAfterCountryCode } from './utils.js';
24
+ import { useForkRef } from '../../utils/index.js';
25
+
26
+ const OBFUSCATED_CHARACTER = '•';
27
+
28
+ function createObfuscatedMasks(masks: { mask: string; placeholder?: string }[]) {
29
+ return masks.map(m => ({
30
+ ...m,
31
+ placeholder: m.mask.replace(/[9a*]/g, OBFUSCATED_CHARACTER),
32
+ }));
33
+ }
24
34
 
25
35
  const countryList = countriesPhoneInformation.map(i => ({
26
36
  name: i.name,
@@ -109,7 +119,12 @@ export interface PhoneNumberInputProps
109
119
  extends Omit<HStackProps, 'onChange' | 'children'> {
110
120
  value?: string;
111
121
  defaultCountry?: string;
112
- onChange?: (value: string) => void;
122
+ /**
123
+ * Callback fired when the phone number value changes.
124
+ * @param value - The phone number value with country prefix
125
+ * @param obfuscate - Whether the selected phone number is obfuscated (e.g., from a phone book entry marked as obfuscated)
126
+ */
127
+ onChange?: (value: string, obfuscate: boolean) => void;
113
128
  countrySelectRef?: React.Ref<HTMLButtonElement>;
114
129
  phoneNumberInputRef?: React.Ref<HTMLInputElement>;
115
130
  disabled?: boolean;
@@ -161,6 +176,10 @@ export const PhoneNumberInput = React.forwardRef(function PhoneNumberInput(
161
176
  const [currentMasks, setCurrentMasks] = useState([
162
177
  ...countriesPhoneInformation[0].masks,
163
178
  ]);
179
+ const [obfuscateValue, setObfuscateValue] = useState(false);
180
+ const [shouldFocusAfterClear, setShouldFocusAfterClear] = useState(false);
181
+ const internalInputRef = useRef<HTMLInputElement>(null);
182
+ const forkedInputRef = useForkRef(numberRef, internalInputRef);
164
183
 
165
184
  const countryOptions = useMemo(() => {
166
185
  return createCountryOptions(allowedCountryCodes);
@@ -183,7 +202,7 @@ export const PhoneNumberInput = React.forwardRef(function PhoneNumberInput(
183
202
 
184
203
  const value = `${countryInformation.prefix}${stripNonNumericAfterCountryCode(phoneNumber)}`;
185
204
  lastOutputValueRef.current = value;
186
- onChange && onChange(value);
205
+ onChange && onChange(value, false);
187
206
  }
188
207
 
189
208
  useLayoutEffect(() => {
@@ -202,9 +221,14 @@ export const PhoneNumberInput = React.forwardRef(function PhoneNumberInput(
202
221
  const lineNumber = stripNonNumericAfterCountryCode(newPhoneNumber);
203
222
  const outputValue = countryPrefix + lineNumber;
204
223
 
224
+ // Clear obfuscated state when user types manually
225
+ if (obfuscateValue) {
226
+ setObfuscateValue(false);
227
+ }
228
+
205
229
  lastOutputValueRef.current = outputValue;
206
230
  phoneNumber !== newPhoneNumber && setPhoneNumber(newPhoneNumber);
207
- onChange && onChange(outputValue);
231
+ onChange && onChange(outputValue, false);
208
232
  }
209
233
 
210
234
  function togglePhoneBook(e: React.MouseEvent<HTMLButtonElement>) {
@@ -219,9 +243,15 @@ export const PhoneNumberInput = React.forwardRef(function PhoneNumberInput(
219
243
  setPhoneBookElement(null);
220
244
  }
221
245
 
222
- function handlePhoneBookOptionSelect(value: string) {
246
+ function handlePhoneBookOptionSelect(
247
+ value: string,
248
+ _label: string | undefined,
249
+ _isSuggestion: boolean,
250
+ obfuscate: boolean
251
+ ) {
223
252
  // Update the phone number with the selected value
224
- updatePhoneNumber(value);
253
+ setObfuscateValue(obfuscate);
254
+ updatePhoneNumber(value, obfuscate);
225
255
  closePhoneBook();
226
256
  }
227
257
 
@@ -244,8 +274,22 @@ export const PhoneNumberInput = React.forwardRef(function PhoneNumberInput(
244
274
  return value;
245
275
  }
246
276
 
277
+ function handleObfuscatedInputChange(newValue: string) {
278
+ // When user types on a obfuscated input, clear the obfuscated state and start fresh
279
+ // The newValue will be the digits the user typed (mask filters to valid input)
280
+ setShouldFocusAfterClear(true);
281
+ setObfuscateValue(false);
282
+ setPhoneNumber(newValue);
283
+
284
+ const countryPrefix = countryCodeMap.get(countryCode)?.prefix;
285
+ const lineNumber = stripNonNumericAfterCountryCode(newValue);
286
+ const outputValue = countryPrefix + lineNumber;
287
+ lastOutputValueRef.current = outputValue;
288
+ onChange && onChange(outputValue, false);
289
+ }
290
+
247
291
  const updatePhoneNumber = useCallback(
248
- (value: string) => {
292
+ (value: string, obfuscate = false) => {
249
293
  const oldValue = lastOutputValueRef.current;
250
294
  const countryInformation = getCountryCodeFromValue(
251
295
  value,
@@ -259,7 +303,7 @@ export const PhoneNumberInput = React.forwardRef(function PhoneNumberInput(
259
303
 
260
304
  if (oldValue !== value) {
261
305
  setPhoneNumber(phoneNumber);
262
- onChange && onChange(value);
306
+ onChange && onChange(value, obfuscate);
263
307
  }
264
308
  },
265
309
  [defaultCountry, selectedCountry, onChange]
@@ -269,45 +313,76 @@ export const PhoneNumberInput = React.forwardRef(function PhoneNumberInput(
269
313
  updatePhoneNumber(value);
270
314
  }, [value, updatePhoneNumber]);
271
315
 
316
+ // Focus the input after transitioning from obfuscated to normal mode
317
+ useLayoutEffect(() => {
318
+ if (shouldFocusAfterClear && !obfuscateValue && internalInputRef.current) {
319
+ internalInputRef.current.focus();
320
+ setShouldFocusAfterClear(false);
321
+ }
322
+ }, [shouldFocusAfterClear, obfuscateValue]);
323
+
272
324
  return (
273
325
  <HStack
274
326
  ref={ref}
275
- className={classNames(styles['phone-number-input'], 'phone-number-input')}
327
+ className={clsx(styles['phone-number-input'], 'phone-number-input')}
276
328
  height="auto"
277
329
  {...props}
278
330
  >
279
331
  <Select
280
- className={classNames(
281
- styles['phone-number-input-select'],
282
- 'phone-number-input-select'
283
- )}
332
+ className={clsx(styles['phone-number-input-select'], 'phone-number-input-select')}
284
333
  ref={countryRef}
285
334
  width="auto"
286
- value={countryCode}
335
+ value={obfuscateValue ? '' : countryCode}
287
336
  onChange={changeCountry}
288
- disabled={disabled}
289
- data-is-disabled={disabled}
337
+ disabled={disabled || obfuscateValue}
338
+ data-is-disabled={disabled || obfuscateValue}
339
+ data-is-obfuscated={obfuscateValue}
340
+ placeholder={obfuscateValue ? '––' : undefined}
290
341
  >
291
342
  {countryOptions}
292
343
  </Select>
293
- <HStack width="flex" className={styles['phone-number-input-container']}>
294
- <MaskInput
295
- ref={numberRef}
296
- value={phoneNumber}
297
- mask={currentMasks}
298
- onChange={transformValue}
299
- disabled={disabled}
300
- data-is-disabled={disabled}
301
- data-has-phone-book={showPhoneBook}
302
- className={classNames(styles['phone-number-input'], 'phone-number-input')}
303
- preparePasteValue={preparePasteValue}
304
- />
344
+ <HStack width="flex" className={clsx(styles['phone-number-input-container'])}>
345
+ {obfuscateValue ? (
346
+ <MaskInput
347
+ key="obfuscated"
348
+ ref={forkedInputRef}
349
+ value=""
350
+ mask={createObfuscatedMasks(currentMasks)}
351
+ onChange={handleObfuscatedInputChange}
352
+ disabled={disabled}
353
+ data-is-disabled={disabled}
354
+ data-has-phone-book={showPhoneBook}
355
+ data-is-obfuscated={true}
356
+ className={clsx(
357
+ styles['phone-number-input'],
358
+ styles['phone-number-input-obfuscated'],
359
+ 'phone-number-input'
360
+ )}
361
+ preparePasteValue={() => ''}
362
+ prepareCopyValue={() => ''}
363
+ prepareCutValue={() => ''}
364
+ />
365
+ ) : (
366
+ <MaskInput
367
+ key="normal"
368
+ ref={forkedInputRef}
369
+ value={phoneNumber}
370
+ mask={currentMasks}
371
+ onChange={transformValue}
372
+ disabled={disabled}
373
+ data-is-disabled={disabled}
374
+ data-has-phone-book={showPhoneBook}
375
+ data-is-obfuscated={false}
376
+ className={clsx(styles['phone-number-input'], 'phone-number-input')}
377
+ preparePasteValue={preparePasteValue}
378
+ />
379
+ )}
305
380
  </HStack>
306
381
  {showPhoneBook && (
307
382
  <>
308
383
  <SlimButton
309
384
  disabled={disabled}
310
- className={classNames(
385
+ className={clsx(
311
386
  styles['phone-number-input-phone-book'],
312
387
  'phone-number-input-phone-book'
313
388
  )}
@@ -1,20 +1,28 @@
1
1
  import React from 'react';
2
- import { Radio } from './radio.js';
2
+ import { Radio as RadioComponent } from './radio.js';
3
3
  import { HStack } from '../../stacks/h_stack.js';
4
4
  import { Spacer } from '../../stacks/spacer.js';
5
5
 
6
6
  export default {
7
- title: 'Radio',
7
+ title: 'Inputs/Radio',
8
+ parameters: {
9
+ docs: {
10
+ description: {
11
+ component: 'A radio component that allows the user to select a value.',
12
+ },
13
+ },
14
+ },
15
+ tags: ['autodocs'],
8
16
  };
9
17
 
10
- export function Default() {
18
+ export function Radio() {
11
19
  return (
12
20
  <HStack hAlign="center" height="auto">
13
- <Radio name="options" id="1" value="option-1" label="Option 1" />
21
+ <RadioComponent name="options" id="1" value="option-1" label="Option 1" />
14
22
  <Spacer width="8px" />
15
- <Radio name="options" id="2" value="option-2" label="Option 2" />
23
+ <RadioComponent name="options" id="2" value="option-2" label="Option 2" />
16
24
  <Spacer width="8px" />
17
- <Radio name="options" id="3" value="option-3" label="Option 3" />
25
+ <RadioComponent name="options" id="3" value="option-3" label="Option 3" />
18
26
  </HStack>
19
27
  );
20
28
  }
@@ -1,4 +1,4 @@
1
- import classnames from 'classnames';
1
+ import { clsx } from 'clsx';
2
2
  import React, { HTMLAttributes } from 'react';
3
3
  import styles from './radio.module.css';
4
4
  import { HStack } from '../../stacks/h_stack.js';
@@ -39,7 +39,7 @@ export const Radio = React.forwardRef(function Radio(
39
39
  <HStack inline width="auto">
40
40
  <input
41
41
  ref={ref}
42
- className={classnames(className, styles.radio, 'radio')}
42
+ className={clsx(className, styles.radio, 'radio')}
43
43
  type="radio"
44
44
  id={finalId}
45
45
  name={name}
@@ -1,20 +1,29 @@
1
1
  import React, { useState } from 'react';
2
2
  import { Option } from '../options/option.js';
3
- import { Select, SelectProps } from './select.js';
3
+ import { Select as SelectComponent, SelectProps } from './select.js';
4
4
  import { HStack } from '../../stacks/h_stack.js';
5
5
  import { VStack } from '../../stacks/v_stack.js';
6
6
  import { Headline } from '../../typography/headline/headline.js';
7
7
  import { BodyText } from '../../typography/body_text/body_text.js';
8
8
 
9
9
  export default {
10
- title: 'Select',
10
+ title: 'Inputs/Select',
11
+ parameters: {
12
+ docs: {
13
+ description: {
14
+ component:
15
+ 'A select component that allows the user to select a value from a list of options.',
16
+ },
17
+ },
18
+ },
19
+ tags: ['autodocs'],
11
20
  };
12
21
 
13
- export function Default(_: Omit<SelectProps, 'children'>) {
22
+ export function Select(_: Omit<SelectProps, 'children'>) {
14
23
  const [value, setValue] = useState<string>('');
15
24
 
16
25
  return (
17
- <Select value={value} onChange={setValue}>
26
+ <SelectComponent value={value} onChange={setValue}>
18
27
  <Option value="apple" label="Apple" keywords={['fruit', 'red', 'sweet']}>
19
28
  Apple
20
29
  </Option>
@@ -58,7 +67,7 @@ export function Default(_: Omit<SelectProps, 'children'>) {
58
67
  >
59
68
  Really Really Long Options
60
69
  </Option>
61
- </Select>
70
+ </SelectComponent>
62
71
  );
63
72
  }
64
73
 
@@ -66,7 +75,7 @@ export function CustomWidth(_: Omit<SelectProps, 'children'>) {
66
75
  const [value, setValue] = useState<string>('');
67
76
 
68
77
  return (
69
- <Select value={value} onChange={setValue} width="100px">
78
+ <SelectComponent value={value} onChange={setValue} width="100px">
70
79
  <Option value="apple" label="Apple" keywords={['fruit', 'red', 'sweet']}>
71
80
  Apple
72
81
  </Option>
@@ -110,7 +119,7 @@ export function CustomWidth(_: Omit<SelectProps, 'children'>) {
110
119
  >
111
120
  Really Really Long Options
112
121
  </Option>
113
- </Select>
122
+ </SelectComponent>
114
123
  );
115
124
  }
116
125
 
@@ -118,7 +127,7 @@ export function CustomOptions() {
118
127
  const [value, setValue] = useState<string>('');
119
128
 
120
129
  return (
121
- <Select value={value} onChange={setValue} width="100px">
130
+ <SelectComponent value={value} onChange={setValue} width="100px">
122
131
  <Option value="new-york" label="New York" keywords={['city', 'usa', 'big apple']}>
123
132
  <HStack height="auto" gap="8px" padding="4px">
124
133
  <span>🗽</span>
@@ -168,6 +177,6 @@ export function CustomOptions() {
168
177
  </VStack>
169
178
  </HStack>
170
179
  </Option>
171
- </Select>
180
+ </SelectComponent>
172
181
  );
173
182
  }
@@ -1,5 +1,5 @@
1
1
  import { useForkRef } from '../../utils/index.js';
2
- import classNames from 'classnames';
2
+ import { clsx } from 'clsx';
3
3
  import React, { useRef, useState } from 'react';
4
4
  import { SuggestionList } from '../suggestions/suggestion_list.js';
5
5
  import { OptionProps } from '../options/option.js';
@@ -130,7 +130,7 @@ export const Select = React.forwardRef(function Select(
130
130
  <>
131
131
  <Button
132
132
  ref={forkedRef}
133
- className={classNames(className, 'select', styles.select)}
133
+ className={clsx(className, 'select', styles.select)}
134
134
  width="100%"
135
135
  {...props}
136
136
  hAlign="start"
@@ -16,7 +16,15 @@ function BaseWithValue(props: SliderProps) {
16
16
  }
17
17
 
18
18
  export default {
19
- title: 'Slider',
19
+ title: 'Inputs/Slider',
20
+ parameters: {
21
+ docs: {
22
+ description: {
23
+ component: 'A slider component that allows the user to select a value.',
24
+ },
25
+ },
26
+ },
27
+ tags: ['autodocs'],
20
28
  };
21
29
 
22
30
  export function Slider() {
@@ -1,4 +1,4 @@
1
- import classnames from 'classnames';
1
+ import { clsx } from 'clsx';
2
2
  import React, { useLayoutEffect, useRef } from 'react';
3
3
  import { HTMLAttributes } from 'react';
4
4
  import styles from './slider.module.css';
@@ -41,7 +41,7 @@ export const Slider = React.forwardRef(function Slider(
41
41
  return (
42
42
  <input
43
43
  type="range"
44
- className={classnames(className, styles.slider, 'slider')}
44
+ className={clsx(className, styles.slider, 'slider')}
45
45
  data-is-disabled={props.disabled || false}
46
46
  ref={forkedRef}
47
47
  onChange={e => {
@@ -1,4 +1,4 @@
1
- import classNames from 'classnames';
1
+ import { clsx } from 'clsx';
2
2
  import React, { useEffect, useRef } from 'react';
3
3
  import styles from './suggestion_item.module.css';
4
4
 
@@ -6,7 +6,12 @@ export interface SuggestionItemProps {
6
6
  isFocused: boolean;
7
7
  isSelected: boolean;
8
8
  option: React.ReactElement;
9
- onClick?: (value: string, label: string, isSuggestion: boolean) => void;
9
+ onClick?: (
10
+ value: string,
11
+ label: string,
12
+ isSuggestion: boolean,
13
+ obfuscate: boolean
14
+ ) => void;
10
15
  }
11
16
 
12
17
  export function SuggestionItem({
@@ -36,14 +41,19 @@ export function SuggestionItem({
36
41
  <button
37
42
  tabIndex={-1}
38
43
  ref={buttonRef}
39
- className={classNames(styles['suggestion-item'], 'suggestion-item')}
44
+ className={clsx(styles['suggestion-item'], 'suggestion-item')}
40
45
  data-is-selected={isSelected}
41
46
  data-is-focused={isFocused}
42
47
  data-disabled={isDisabled}
43
48
  disabled={isDisabled}
44
49
  onClick={() => {
45
50
  if (!isDisabled && onClick) {
46
- onClick(option.props.value, option.props.label, true);
51
+ onClick(
52
+ option.props.value,
53
+ option.props.label,
54
+ true,
55
+ option.props.obfuscate ?? false
56
+ );
47
57
  }
48
58
  }}
49
59
  >
@@ -1,19 +1,28 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react-vite';
2
2
  import React, { useState } from 'react';
3
- import { SuggestionList } from './suggestion_list.js';
3
+ import { SuggestionList as SuggestionListComponent } from './suggestion_list.js';
4
4
  import { Option } from '../options/option.js';
5
5
  import { HStack } from '../../stacks/h_stack.js';
6
6
  import { VStack } from '../../stacks/v_stack.js';
7
7
  import { BodyText, Headline } from '../../typography/index.js';
8
8
 
9
- const meta: Meta<typeof SuggestionList> = {
10
- title: 'SuggestionList',
9
+ const meta: Meta<typeof SuggestionListComponent> = {
10
+ title: 'Inputs/Suggestion List',
11
+ parameters: {
12
+ docs: {
13
+ description: {
14
+ component:
15
+ 'A suggestion list component that displays a list of suggestions and allows the user to select a value.',
16
+ },
17
+ },
18
+ },
19
+ tags: ['autodocs'],
11
20
  };
12
21
 
13
22
  export default meta;
14
23
  type Story = StoryObj<typeof meta>;
15
24
 
16
- export const Default: Story = {
25
+ export const SuggestionList: Story = {
17
26
  render: () => {
18
27
  const [anchorElement, setAnchorElement] = useState<HTMLInputElement | null>(null);
19
28
  const [isOpen, setIsOpen] = useState(false);
@@ -30,7 +39,7 @@ export const Default: Story = {
30
39
  style={{ width: '100%', padding: '8px' }}
31
40
  />
32
41
  {isOpen && anchorElement && (
33
- <SuggestionList
42
+ <SuggestionListComponent
34
43
  value={value}
35
44
  anchorElement={anchorElement}
36
45
  onChange={setValue}
@@ -67,7 +76,7 @@ export const Default: Story = {
67
76
  >
68
77
  🫐 Elderberry
69
78
  </Option>
70
- </SuggestionList>
79
+ </SuggestionListComponent>
71
80
  )}
72
81
  </div>
73
82
  );
@@ -91,7 +100,7 @@ export const WithCustomContent: Story = {
91
100
  style={{ width: '100%', padding: '8px' }}
92
101
  />
93
102
  {isOpen && anchorElement && (
94
- <SuggestionList
103
+ <SuggestionListComponent
95
104
  value={label}
96
105
  anchorElement={anchorElement}
97
106
  onChange={setLabel}
@@ -132,7 +141,7 @@ export const WithCustomContent: Story = {
132
141
  </VStack>
133
142
  </HStack>
134
143
  </Option>
135
- </SuggestionList>
144
+ </SuggestionListComponent>
136
145
  )}
137
146
  </div>
138
147
  );
@@ -156,7 +165,7 @@ export const WithDisabledOptions: Story = {
156
165
  style={{ width: '100%', padding: '8px' }}
157
166
  />
158
167
  {isOpen && anchorElement && (
159
- <SuggestionList
168
+ <SuggestionListComponent
160
169
  value={value}
161
170
  anchorElement={anchorElement}
162
171
  onChange={setValue}
@@ -206,7 +215,7 @@ export const WithDisabledOptions: Story = {
206
215
  <Option value="grape" label="Grape" keywords={['fruit', 'purple', 'bunch']}>
207
216
  🍇 Grape
208
217
  </Option>
209
- </SuggestionList>
218
+ </SuggestionListComponent>
210
219
  )}
211
220
  </div>
212
221
  );
@@ -329,7 +338,7 @@ export const PerformanceTest: Story = {
329
338
  style={{ width: '100%', padding: '8px' }}
330
339
  />
331
340
  {isOpen && anchorElement && (
332
- <SuggestionList
341
+ <SuggestionListComponent
333
342
  value={label}
334
343
  anchorElement={anchorElement}
335
344
  onChange={setLabel}
@@ -340,7 +349,7 @@ export const PerformanceTest: Story = {
340
349
  onClose={() => setIsOpen(false)}
341
350
  >
342
351
  {PERFORMANCE_TEST_ITEMS}
343
- </SuggestionList>
352
+ </SuggestionListComponent>
344
353
  )}
345
354
  </div>
346
355
  );
@@ -1,7 +1,7 @@
1
1
  import { BodyText } from '../../typography/index.js';
2
2
  import { VStack } from '../../stacks/v_stack.js';
3
3
  import { ZStack } from '../../stacks/z_stack.js';
4
- import classNames from 'classnames';
4
+ import { clsx } from 'clsx';
5
5
  import React, { useLayoutEffect, Children, isValidElement } from 'react';
6
6
  import { useRef, useState } from 'react';
7
7
  import { FocusRedirect } from '../../utils/index.js';
@@ -25,7 +25,8 @@ export interface SuggestionListProps
25
25
  onOptionSelect?: (
26
26
  value: string,
27
27
  label: string | undefined,
28
- isSuggestion: boolean
28
+ isSuggestion: boolean,
29
+ obfuscate: boolean
29
30
  ) => void;
30
31
  noSuggestionMessage?: React.ReactNode;
31
32
  trimCustomInput?: boolean;
@@ -112,7 +113,13 @@ export function SuggestionList({
112
113
  const optionValue = option?.props.value || value;
113
114
 
114
115
  requestAnimationFrame(() => {
115
- onOptionSelect && onOptionSelect(optionValue, label, isSuggestion);
116
+ onOptionSelect &&
117
+ onOptionSelect(
118
+ optionValue,
119
+ label,
120
+ isSuggestion,
121
+ option?.props.obfuscate ?? false
122
+ );
116
123
  });
117
124
 
118
125
  break;
@@ -126,7 +133,13 @@ export function SuggestionList({
126
133
  }
127
134
 
128
135
  requestAnimationFrame(() => {
129
- onOptionSelect && onOptionSelect(optionProps.value, optionProps.label, true);
136
+ onOptionSelect &&
137
+ onOptionSelect(
138
+ optionProps.value,
139
+ optionProps.label,
140
+ true,
141
+ optionProps.obfuscate ?? false
142
+ );
130
143
  });
131
144
  break;
132
145
  }
@@ -260,6 +273,12 @@ export function SuggestionList({
260
273
  const keywords = props.keywords?.map(k => k.toLocaleLowerCase()) || [];
261
274
  const optionValue = String(props.value).toLocaleLowerCase();
262
275
  const searchValue = value.toLocaleLowerCase();
276
+ const obfuscate = props.obfuscate ?? false;
277
+
278
+ // Obfuscated options can only be searched by label or keywords, not by value
279
+ if (obfuscate) {
280
+ return label.includes(searchValue) || keywords.some(k => k.includes(searchValue));
281
+ }
263
282
 
264
283
  return (
265
284
  label.includes(searchValue) ||
@@ -369,7 +388,7 @@ export function SuggestionList({
369
388
  minWidth={suggestionsWidth}
370
389
  width="auto"
371
390
  hAlign="start"
372
- className={classNames(styles['suggestion-list'], 'suggestion-list')}
391
+ className={clsx(styles['suggestion-list'], 'suggestion-list')}
373
392
  >
374
393
  <input
375
394
  ref={internalInputRef}
@@ -378,7 +397,7 @@ export function SuggestionList({
378
397
  onKeyUp={handleKeyUp}
379
398
  onKeyDown={handleKeyDown}
380
399
  onChange={handleChange}
381
- className={classNames(styles.input, 'suggestion-list-search-input')}
400
+ className={clsx(styles.input, 'suggestion-list-search-input')}
382
401
  {...props}
383
402
  />
384
403
  <VStack>
@@ -3,7 +3,15 @@ import { Switch as Component, SwitchProps } from './switch.js';
3
3
  import styles from '../__storybook__/stories.module.css';
4
4
 
5
5
  export default {
6
- title: 'Switch',
6
+ title: 'Inputs/Switch',
7
+ parameters: {
8
+ docs: {
9
+ description: {
10
+ component: 'A switch component that allows the user to toggle a value.',
11
+ },
12
+ },
13
+ },
14
+ tags: ['autodocs'],
7
15
  };
8
16
 
9
17
  function Base(props: SwitchProps) {
@@ -1,6 +1,6 @@
1
1
  import React, { useRef, useState, HTMLAttributes, ChangeEvent } from 'react';
2
2
  import { useForkRef } from '../../utils/index.js';
3
- import classnames from 'classnames';
3
+ import { clsx } from 'clsx';
4
4
  import styles from './switch.module.css';
5
5
  import { CheckIcon } from '@tcn/icons/check_icon.js';
6
6
  import { CrossIcon } from '@tcn/icons/cross_icon.js';
@@ -55,18 +55,18 @@ export const Switch = React.forwardRef(function Switch(
55
55
  data-is-checked={Boolean(checked)}
56
56
  data-is-disabled={props.disabled || false}
57
57
  data-width="fixed"
58
- className={classnames(styles['switch-wrapper'], className, 'switch-wrapper')}
58
+ className={clsx(styles['switch-wrapper'], className, 'switch-wrapper')}
59
59
  >
60
60
  {!omitIcons && (
61
61
  <Icon
62
- className={classnames(styles['switch-icon'], 'switch-icon')}
62
+ className={clsx(styles['switch-icon'], 'switch-icon')}
63
63
  data-is-checked={checked}
64
64
  />
65
65
  )}
66
66
  <input
67
67
  ref={forkedInputRef}
68
68
  type="checkbox"
69
- className={classnames(styles.switch, 'switch')}
69
+ className={clsx(styles.switch, 'switch')}
70
70
  onBlur={blur}
71
71
  onFocus={focus}
72
72
  style={{ ...style, ...customStyles }}