@economic/taco 2.19.0 → 2.20.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (329) hide show
  1. package/dist/components/Provider/Localization.d.ts +18 -0
  2. package/dist/components/Report/components/Body/Body.d.ts +8 -0
  3. package/dist/components/Report/components/Cell/Cell.d.ts +3 -0
  4. package/dist/components/Report/components/Cell/DisplayCell.d.ts +7 -0
  5. package/dist/components/Report/components/Cell/GroupedCell.d.ts +7 -0
  6. package/dist/components/Report/components/Cell/util.d.ts +18 -0
  7. package/dist/components/Report/components/Footer/Footer.d.ts +6 -0
  8. package/dist/components/Report/components/Footer/Summary.d.ts +7 -0
  9. package/dist/components/Report/components/Header/Header.d.ts +37 -0
  10. package/dist/components/Report/components/Header/components/Goto.d.ts +6 -0
  11. package/dist/components/Report/components/Header/components/Menu.d.ts +17 -0
  12. package/dist/components/Report/components/Header/components/Resizer.d.ts +12 -0
  13. package/dist/components/Report/components/Header/components/SortIndicator.d.ts +15 -0
  14. package/dist/components/Report/components/Header/util.d.ts +4 -0
  15. package/dist/components/Report/components/Internal/Actions.d.ts +13 -0
  16. package/dist/components/Report/components/Internal/Expansion.d.ts +4 -0
  17. package/dist/components/Report/components/Internal/Selection.d.ts +4 -0
  18. package/dist/components/Report/components/Row/DisplayRow.d.ts +16 -0
  19. package/dist/components/Report/components/Row/Row.d.ts +8 -0
  20. package/dist/components/Report/components/Row/RowContext.d.ts +9 -0
  21. package/dist/components/Report/components/Row/SkeletonRow.d.ts +10 -0
  22. package/dist/components/Report/components/Toolbar/Toolbar.d.ts +15 -0
  23. package/dist/components/Report/components/Toolbar/components/Filters/Filters.d.ts +7 -0
  24. package/dist/components/Report/components/Toolbar/components/Filters/ManageFiltersPopover.d.ts +7 -0
  25. package/dist/components/Report/components/Toolbar/components/Filters/components/Filter.d.ts +12 -0
  26. package/dist/components/Report/components/Toolbar/components/Filters/components/FilterColumn.d.ts +9 -0
  27. package/dist/components/Report/components/Toolbar/components/Filters/components/FilterComparator.d.ts +7 -0
  28. package/dist/components/Report/components/Toolbar/components/Filters/components/FilterValue.d.ts +10 -0
  29. package/dist/components/Report/components/Toolbar/components/Filters/components/Placeholder.d.ts +12 -0
  30. package/dist/components/Report/components/Toolbar/components/Filters/util.d.ts +2 -0
  31. package/dist/components/Report/components/Toolbar/components/Print/Print.d.ts +9 -0
  32. package/dist/components/Report/components/Toolbar/components/Print/PrintDialog.d.ts +17 -0
  33. package/dist/components/Report/components/Toolbar/components/Search/Search.d.ts +8 -0
  34. package/dist/components/Report/components/Toolbar/components/Settings/HideOrOrderPopover.d.ts +7 -0
  35. package/dist/components/Report/components/Toolbar/components/Settings/Settings.d.ts +8 -0
  36. package/dist/components/Report/features/useReportExport.d.ts +3 -0
  37. package/dist/components/Report/styles/useColumnPinningStylesheet.d.ts +2 -0
  38. package/dist/components/Report/styles/useCssGridStylesheet.d.ts +3 -0
  39. package/dist/components/Report/styles/useStylesheet.d.ts +3 -0
  40. package/dist/components/Report/styles/util.d.ts +3 -0
  41. package/dist/components/Report/types.d.ts +20 -0
  42. package/dist/components/Report/useReport.d.ts +14 -0
  43. package/dist/components/Report/util/rows.d.ts +7 -0
  44. package/dist/components/Report/util/useTableGlobalShortcuts.d.ts +4 -0
  45. package/dist/components/Report/util/useTableRenderer.d.ts +9 -0
  46. package/dist/components/Table3/components/rows/Row.d.ts +1 -1
  47. package/dist/components/Table3/hooks/features/usePrinting.d.ts +7 -0
  48. package/dist/components/Table3/hooks/useTable.d.ts +5 -5
  49. package/dist/components/Table3/types.d.ts +21 -3
  50. package/dist/esm/packages/taco/src/components/Accordion/Accordion.js +1 -1
  51. package/dist/esm/packages/taco/src/components/Accordion/Accordion.js.map +1 -1
  52. package/dist/esm/packages/taco/src/components/Alert/Alert.js +1 -1
  53. package/dist/esm/packages/taco/src/components/Alert/Alert.js.map +1 -1
  54. package/dist/esm/packages/taco/src/components/AlertDialog/components/Content.js +1 -1
  55. package/dist/esm/packages/taco/src/components/AlertDialog/components/Content.js.map +1 -1
  56. package/dist/esm/packages/taco/src/components/Backdrop/Backdrop.js +2 -2
  57. package/dist/esm/packages/taco/src/components/Backdrop/Backdrop.js.map +1 -1
  58. package/dist/esm/packages/taco/src/components/Badge/Badge.js +1 -1
  59. package/dist/esm/packages/taco/src/components/Badge/Badge.js.map +1 -1
  60. package/dist/esm/packages/taco/src/components/BadgeIcon/BadgeIcon.js +1 -1
  61. package/dist/esm/packages/taco/src/components/BadgeIcon/BadgeIcon.js.map +1 -1
  62. package/dist/esm/packages/taco/src/components/Banner/Banner.js +2 -2
  63. package/dist/esm/packages/taco/src/components/Banner/Banner.js.map +1 -1
  64. package/dist/esm/packages/taco/src/components/Button/Button.js +1 -1
  65. package/dist/esm/packages/taco/src/components/Button/Button.js.map +1 -1
  66. package/dist/esm/packages/taco/src/components/Calendar/Calendar.js +1 -1
  67. package/dist/esm/packages/taco/src/components/Calendar/Calendar.js.map +1 -1
  68. package/dist/esm/packages/taco/src/components/Card/Card.js +2 -2
  69. package/dist/esm/packages/taco/src/components/Card/Card.js.map +1 -1
  70. package/dist/esm/packages/taco/src/components/Checkbox/Checkbox.js +1 -1
  71. package/dist/esm/packages/taco/src/components/Checkbox/Checkbox.js.map +1 -1
  72. package/dist/esm/packages/taco/src/components/Combobox/Combobox.js +1 -1
  73. package/dist/esm/packages/taco/src/components/Combobox/Combobox.js.map +1 -1
  74. package/dist/esm/packages/taco/src/components/Datepicker/Datepicker.js +1 -1
  75. package/dist/esm/packages/taco/src/components/Datepicker/Datepicker.js.map +1 -1
  76. package/dist/esm/packages/taco/src/components/Dialog/components/Content.js +5 -5
  77. package/dist/esm/packages/taco/src/components/Dialog/components/Content.js.map +1 -1
  78. package/dist/esm/packages/taco/src/components/Dialog/components/DialogDrawer.js +1 -1
  79. package/dist/esm/packages/taco/src/components/Dialog/components/DialogDrawer.js.map +1 -1
  80. package/dist/esm/packages/taco/src/components/Dialog/components/Extra.js +1 -1
  81. package/dist/esm/packages/taco/src/components/Dialog/components/Extra.js.map +1 -1
  82. package/dist/esm/packages/taco/src/components/Drawer/Drawer.js +1 -1
  83. package/dist/esm/packages/taco/src/components/Drawer/Drawer.js.map +1 -1
  84. package/dist/esm/packages/taco/src/components/Drawer/components/Content.js +1 -1
  85. package/dist/esm/packages/taco/src/components/Drawer/components/Content.js.map +1 -1
  86. package/dist/esm/packages/taco/src/components/Drawer/util.js +1 -1
  87. package/dist/esm/packages/taco/src/components/Drawer/util.js.map +1 -1
  88. package/dist/esm/packages/taco/src/components/Field/Field.js +1 -1
  89. package/dist/esm/packages/taco/src/components/Field/Field.js.map +1 -1
  90. package/dist/esm/packages/taco/src/components/Form/Form.js +1 -1
  91. package/dist/esm/packages/taco/src/components/Form/Form.js.map +1 -1
  92. package/dist/esm/packages/taco/src/components/Group/Group.js +1 -1
  93. package/dist/esm/packages/taco/src/components/Group/Group.js.map +1 -1
  94. package/dist/esm/packages/taco/src/components/Hanger/Hanger.js +2 -2
  95. package/dist/esm/packages/taco/src/components/Hanger/Hanger.js.map +1 -1
  96. package/dist/esm/packages/taco/src/components/Header/Header.js +1 -1
  97. package/dist/esm/packages/taco/src/components/Header/Header.js.map +1 -1
  98. package/dist/esm/packages/taco/src/components/Header/components/Agreement/Avatar.js +1 -1
  99. package/dist/esm/packages/taco/src/components/Header/components/Agreement/Avatar.js.map +1 -1
  100. package/dist/esm/packages/taco/src/components/Header/components/Agreement/Display.js +2 -2
  101. package/dist/esm/packages/taco/src/components/Header/components/Agreement/Display.js.map +1 -1
  102. package/dist/esm/packages/taco/src/components/Header/components/Agreement/Item.js +2 -2
  103. package/dist/esm/packages/taco/src/components/Header/components/Agreement/Item.js.map +1 -1
  104. package/dist/esm/packages/taco/src/components/Header/components/Button.js +1 -1
  105. package/dist/esm/packages/taco/src/components/Header/components/Button.js.map +1 -1
  106. package/dist/esm/packages/taco/src/components/Header/components/Link.js +1 -1
  107. package/dist/esm/packages/taco/src/components/Header/components/Link.js.map +1 -1
  108. package/dist/esm/packages/taco/src/components/Header/components/Logo.js +1 -1
  109. package/dist/esm/packages/taco/src/components/Header/components/Logo.js.map +1 -1
  110. package/dist/esm/packages/taco/src/components/Header/components/MenuButton.js +1 -1
  111. package/dist/esm/packages/taco/src/components/Header/components/MenuButton.js.map +1 -1
  112. package/dist/esm/packages/taco/src/components/Header/components/PrimaryNavigation.js +1 -1
  113. package/dist/esm/packages/taco/src/components/Header/components/PrimaryNavigation.js.map +1 -1
  114. package/dist/esm/packages/taco/src/components/Header/components/SecondaryNavigation.js +1 -1
  115. package/dist/esm/packages/taco/src/components/Header/components/SecondaryNavigation.js.map +1 -1
  116. package/dist/esm/packages/taco/src/components/HoverCard/HoverCard.js +1 -1
  117. package/dist/esm/packages/taco/src/components/HoverCard/HoverCard.js.map +1 -1
  118. package/dist/esm/packages/taco/src/components/Icon/Icon.js +1 -1
  119. package/dist/esm/packages/taco/src/components/Icon/Icon.js.map +1 -1
  120. package/dist/esm/packages/taco/src/components/IconButton/IconButton.js +1 -1
  121. package/dist/esm/packages/taco/src/components/IconButton/IconButton.js.map +1 -1
  122. package/dist/esm/packages/taco/src/components/Input/Input.js +1 -1
  123. package/dist/esm/packages/taco/src/components/Input/Input.js.map +1 -1
  124. package/dist/esm/packages/taco/src/components/Input/util.js +1 -1
  125. package/dist/esm/packages/taco/src/components/Input/util.js.map +1 -1
  126. package/dist/esm/packages/taco/src/components/Layout/Layout.js +2 -2
  127. package/dist/esm/packages/taco/src/components/Layout/Layout.js.map +1 -1
  128. package/dist/esm/packages/taco/src/components/Layout/components/Content.js +2 -2
  129. package/dist/esm/packages/taco/src/components/Layout/components/Content.js.map +1 -1
  130. package/dist/esm/packages/taco/src/components/Layout/components/Page.js +2 -2
  131. package/dist/esm/packages/taco/src/components/Layout/components/Page.js.map +1 -1
  132. package/dist/esm/packages/taco/src/components/Layout/components/Sidebar.js +2 -2
  133. package/dist/esm/packages/taco/src/components/Layout/components/Sidebar.js.map +1 -1
  134. package/dist/esm/packages/taco/src/components/Listbox/Listbox.js +1 -1
  135. package/dist/esm/packages/taco/src/components/Listbox/Listbox.js.map +1 -1
  136. package/dist/esm/packages/taco/src/components/Listbox/ScrollableList.js +1 -1
  137. package/dist/esm/packages/taco/src/components/Listbox/ScrollableList.js.map +1 -1
  138. package/dist/esm/packages/taco/src/components/Menu/components/Content.js +1 -1
  139. package/dist/esm/packages/taco/src/components/Menu/components/Content.js.map +1 -1
  140. package/dist/esm/packages/taco/src/components/Menu/components/Header.js +1 -1
  141. package/dist/esm/packages/taco/src/components/Menu/components/Header.js.map +1 -1
  142. package/dist/esm/packages/taco/src/components/Menu/components/Item.js +1 -1
  143. package/dist/esm/packages/taco/src/components/Menu/components/Item.js.map +1 -1
  144. package/dist/esm/packages/taco/src/components/Menu/components/RadioGroup.js +1 -1
  145. package/dist/esm/packages/taco/src/components/Menu/components/RadioGroup.js.map +1 -1
  146. package/dist/esm/packages/taco/src/components/Menu/components/SubMenu.js +1 -1
  147. package/dist/esm/packages/taco/src/components/Menu/components/SubMenu.js.map +1 -1
  148. package/dist/esm/packages/taco/src/components/ModeSwitch/ModeSwitch.js +1 -1
  149. package/dist/esm/packages/taco/src/components/ModeSwitch/ModeSwitch.js.map +1 -1
  150. package/dist/esm/packages/taco/src/components/Navigation/Navigation.js +1 -1
  151. package/dist/esm/packages/taco/src/components/Navigation/Navigation.js.map +1 -1
  152. package/dist/esm/packages/taco/src/components/Navigation2/Navigation2.js +1 -1
  153. package/dist/esm/packages/taco/src/components/Navigation2/Navigation2.js.map +1 -1
  154. package/dist/esm/packages/taco/src/components/Navigation2/components/Content.js +1 -1
  155. package/dist/esm/packages/taco/src/components/Navigation2/components/Content.js.map +1 -1
  156. package/dist/esm/packages/taco/src/components/Navigation2/components/Group.js +1 -1
  157. package/dist/esm/packages/taco/src/components/Navigation2/components/Group.js.map +1 -1
  158. package/dist/esm/packages/taco/src/components/Navigation2/components/Link.js +2 -2
  159. package/dist/esm/packages/taco/src/components/Navigation2/components/Link.js.map +1 -1
  160. package/dist/esm/packages/taco/src/components/Navigation2/components/Section.js +1 -1
  161. package/dist/esm/packages/taco/src/components/Navigation2/components/Section.js.map +1 -1
  162. package/dist/esm/packages/taco/src/components/Navigation2/components/util.js +1 -1
  163. package/dist/esm/packages/taco/src/components/Navigation2/components/util.js.map +1 -1
  164. package/dist/esm/packages/taco/src/components/OverflowGroup/OverflowGroup.js +1 -1
  165. package/dist/esm/packages/taco/src/components/OverflowGroup/OverflowGroup.js.map +1 -1
  166. package/dist/esm/packages/taco/src/components/Pagination/Pagination.js +1 -1
  167. package/dist/esm/packages/taco/src/components/Pagination/Pagination.js.map +1 -1
  168. package/dist/esm/packages/taco/src/components/Popover/Popover.js +1 -1
  169. package/dist/esm/packages/taco/src/components/Popover/Popover.js.map +1 -1
  170. package/dist/esm/packages/taco/src/components/Progress/Progress.js +1 -1
  171. package/dist/esm/packages/taco/src/components/Progress/Progress.js.map +1 -1
  172. package/dist/esm/packages/taco/src/components/Provider/Localization.js +18 -0
  173. package/dist/esm/packages/taco/src/components/Provider/Localization.js.map +1 -1
  174. package/dist/esm/packages/taco/src/components/RadioGroup/RadioGroup.js +1 -1
  175. package/dist/esm/packages/taco/src/components/RadioGroup/RadioGroup.js.map +1 -1
  176. package/dist/esm/packages/taco/src/components/RadioGroup/util.js +1 -1
  177. package/dist/esm/packages/taco/src/components/RadioGroup/util.js.map +1 -1
  178. package/dist/esm/packages/taco/src/components/ScrollArea/ScrollArea.js +1 -1
  179. package/dist/esm/packages/taco/src/components/ScrollArea/ScrollArea.js.map +1 -1
  180. package/dist/esm/packages/taco/src/components/SearchInput2/SearchInput2.js +3 -3
  181. package/dist/esm/packages/taco/src/components/SearchInput2/SearchInput2.js.map +1 -1
  182. package/dist/esm/packages/taco/src/components/Select/Select.js +1 -1
  183. package/dist/esm/packages/taco/src/components/Select/Select.js.map +1 -1
  184. package/dist/esm/packages/taco/src/components/Select/useSelect.js +1 -1
  185. package/dist/esm/packages/taco/src/components/Select/useSelect.js.map +1 -1
  186. package/dist/esm/packages/taco/src/components/Select2/Select2.js +1 -1
  187. package/dist/esm/packages/taco/src/components/Select2/Select2.js.map +1 -1
  188. package/dist/esm/packages/taco/src/components/Select2/components/Create.js +1 -1
  189. package/dist/esm/packages/taco/src/components/Select2/components/Create.js.map +1 -1
  190. package/dist/esm/packages/taco/src/components/Select2/components/Edit.js +1 -1
  191. package/dist/esm/packages/taco/src/components/Select2/components/Edit.js.map +1 -1
  192. package/dist/esm/packages/taco/src/components/Select2/components/Group.js +1 -1
  193. package/dist/esm/packages/taco/src/components/Select2/components/Group.js.map +1 -1
  194. package/dist/esm/packages/taco/src/components/Select2/components/Option.js +1 -1
  195. package/dist/esm/packages/taco/src/components/Select2/components/Option.js.map +1 -1
  196. package/dist/esm/packages/taco/src/components/Select2/components/Search.js +1 -1
  197. package/dist/esm/packages/taco/src/components/Select2/components/Search.js.map +1 -1
  198. package/dist/esm/packages/taco/src/components/Select2/components/Title.js +1 -1
  199. package/dist/esm/packages/taco/src/components/Select2/components/Title.js.map +1 -1
  200. package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js +2 -2
  201. package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js.map +1 -1
  202. package/dist/esm/packages/taco/src/components/Select2/utilities.js +1 -1
  203. package/dist/esm/packages/taco/src/components/Select2/utilities.js.map +1 -1
  204. package/dist/esm/packages/taco/src/components/Shortcut/Shortcut.js +1 -1
  205. package/dist/esm/packages/taco/src/components/Shortcut/Shortcut.js.map +1 -1
  206. package/dist/esm/packages/taco/src/components/Spinner/Spinner.js +1 -1
  207. package/dist/esm/packages/taco/src/components/Spinner/Spinner.js.map +1 -1
  208. package/dist/esm/packages/taco/src/components/Switch/Switch.js +1 -1
  209. package/dist/esm/packages/taco/src/components/Switch/Switch.js.map +1 -1
  210. package/dist/esm/packages/taco/src/components/Table/components/BaseTable.js +2 -2
  211. package/dist/esm/packages/taco/src/components/Table/components/BaseTable.js.map +1 -1
  212. package/dist/esm/packages/taco/src/components/Table/components/WindowedTable.js +1 -1
  213. package/dist/esm/packages/taco/src/components/Table/components/WindowedTable.js.map +1 -1
  214. package/dist/esm/packages/taco/src/components/Table/util/renderColumn.js +1 -1
  215. package/dist/esm/packages/taco/src/components/Table/util/renderColumn.js.map +1 -1
  216. package/dist/esm/packages/taco/src/components/Table/util/renderRow.js +1 -1
  217. package/dist/esm/packages/taco/src/components/Table/util/renderRow.js.map +1 -1
  218. package/dist/esm/packages/taco/src/components/Table3/Table3.js +1 -6
  219. package/dist/esm/packages/taco/src/components/Table3/Table3.js.map +1 -1
  220. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/DisplayCell.js +1 -1
  221. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/DisplayCell.js.map +1 -1
  222. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingCell.js +4 -2
  223. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingCell.js.map +1 -1
  224. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingControl.js +1 -1
  225. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingControl.js.map +1 -1
  226. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/Highlight.js +2 -2
  227. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/Highlight.js.map +1 -1
  228. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/Indicator.js +1 -1
  229. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/Indicator.js.map +1 -1
  230. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/controls/TextareaControl.js +2 -2
  231. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/controls/TextareaControl.js.map +1 -1
  232. package/dist/esm/packages/taco/src/components/Table3/components/columns/footer/Footer.js +1 -1
  233. package/dist/esm/packages/taco/src/components/Table3/components/columns/footer/Footer.js.map +1 -1
  234. package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Group.js +1 -1
  235. package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Group.js.map +1 -1
  236. package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Header.js +5 -2
  237. package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Header.js.map +1 -1
  238. package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Menu.js +1 -1
  239. package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Menu.js.map +1 -1
  240. package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Resizer.js +1 -1
  241. package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Resizer.js.map +1 -1
  242. package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Actions.js +1 -1
  243. package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Actions.js.map +1 -1
  244. package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/EditingActions.js +1 -1
  245. package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/EditingActions.js.map +1 -1
  246. package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Selection.js +1 -1
  247. package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Selection.js.map +1 -1
  248. package/dist/esm/packages/taco/src/components/Table3/components/columns/styles.js +1 -1
  249. package/dist/esm/packages/taco/src/components/Table3/components/columns/styles.js.map +1 -1
  250. package/dist/esm/packages/taco/src/components/Table3/components/rows/Row.js +1 -1
  251. package/dist/esm/packages/taco/src/components/Table3/components/rows/Row.js.map +1 -1
  252. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/ColumnSettings.js +2 -2
  253. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/ColumnSettings.js.map +1 -1
  254. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/Filters.js +1 -1
  255. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/Filters.js.map +1 -1
  256. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterValue.js +1 -1
  257. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterValue.js.map +1 -1
  258. package/dist/esm/packages/taco/src/{primitives/Table/useTable/features/useTablePrinting.js → components/Table3/hooks/features/usePrinting.js} +3 -3
  259. package/dist/esm/packages/taco/src/components/Table3/hooks/features/usePrinting.js.map +1 -0
  260. package/dist/esm/packages/taco/src/components/Table3/hooks/useTable.js +4 -3
  261. package/dist/esm/packages/taco/src/components/Table3/hooks/useTable.js.map +1 -1
  262. package/dist/esm/packages/taco/src/components/Table3/types.js.map +1 -1
  263. package/dist/esm/packages/taco/src/components/Tabs/Tabs.js +1 -1
  264. package/dist/esm/packages/taco/src/components/Tabs/Tabs.js.map +1 -1
  265. package/dist/esm/packages/taco/src/components/Tag/Tag.js +2 -2
  266. package/dist/esm/packages/taco/src/components/Tag/Tag.js.map +1 -1
  267. package/dist/esm/packages/taco/src/components/Textarea/Textarea.js +1 -1
  268. package/dist/esm/packages/taco/src/components/Textarea/Textarea.js.map +1 -1
  269. package/dist/esm/packages/taco/src/components/Toast/Toast.js +2 -2
  270. package/dist/esm/packages/taco/src/components/Toast/Toast.js.map +1 -1
  271. package/dist/esm/packages/taco/src/components/Tooltip/Tooltip.js +2 -2
  272. package/dist/esm/packages/taco/src/components/Tooltip/Tooltip.js.map +1 -1
  273. package/dist/esm/packages/taco/src/components/Treeview/Treeview.js +1 -1
  274. package/dist/esm/packages/taco/src/components/Treeview/Treeview.js.map +1 -1
  275. package/dist/esm/packages/taco/src/primitives/Table/types.js +27 -0
  276. package/dist/esm/packages/taco/src/primitives/Table/types.js.map +1 -0
  277. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableColumnOrdering.js +1 -1
  278. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableColumnOrdering.js.map +1 -1
  279. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowActive.js +11 -21
  280. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowActive.js.map +1 -1
  281. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowClick.js.map +1 -1
  282. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowGoto.js +1 -1
  283. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowGoto.js.map +1 -1
  284. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowSelection.js +1 -0
  285. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowSelection.js.map +1 -1
  286. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableServerLoading.js +42 -2
  287. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableServerLoading.js.map +1 -1
  288. package/dist/esm/packages/taco/src/primitives/Table/useTable/util/columns.js +10 -8
  289. package/dist/esm/packages/taco/src/primitives/Table/useTable/util/columns.js.map +1 -1
  290. package/dist/esm/packages/taco/src/primitives/Table/useTableDataLoader.js +7 -0
  291. package/dist/esm/packages/taco/src/primitives/Table/useTableDataLoader.js.map +1 -0
  292. package/dist/esm/packages/taco/src/utils/dom.js +10 -1
  293. package/dist/esm/packages/taco/src/utils/dom.js.map +1 -1
  294. package/dist/primitives/Table/types.d.ts +187 -2
  295. package/dist/primitives/Table/useTable/features/useTableColumnFreezing.d.ts +6 -0
  296. package/dist/primitives/Table/useTable/features/useTableFooter.d.ts +3 -0
  297. package/dist/primitives/Table/useTable/features/useTablePrinting.d.ts +1 -0
  298. package/dist/primitives/Table/useTable/features/useTableRef.d.ts +4 -0
  299. package/dist/primitives/Table/useTable/features/useTableRowActions.d.ts +6 -0
  300. package/dist/primitives/Table/useTable/features/useTableRowActive.d.ts +0 -1
  301. package/dist/primitives/Table/useTable/features/useTableRowClick.d.ts +1 -1
  302. package/dist/primitives/Table/useTable/features/useTableRowExpansion.d.ts +5 -0
  303. package/dist/primitives/Table/useTable/features/useTableRowGoto.d.ts +1 -1
  304. package/dist/primitives/Table/useTable/features/useTableRowGroups.d.ts +5 -0
  305. package/dist/primitives/Table/useTable/features/useTableRowSelection.d.ts +1 -0
  306. package/dist/primitives/Table/useTable/features/useTableSearch.d.ts +11 -0
  307. package/dist/primitives/Table/useTable/features/useTableServerLoading.d.ts +5 -2
  308. package/dist/primitives/Table/useTable/features/useTableSettings.d.ts +3 -0
  309. package/dist/primitives/Table/useTable/listeners/useTableRowHeightListener.d.ts +2 -0
  310. package/dist/primitives/Table/useTable/listeners/useTableSearchListener.d.ts +2 -0
  311. package/dist/primitives/Table/useTable/listeners/useTableSettingsListener.d.ts +3 -0
  312. package/dist/primitives/Table/useTable/useTable.d.ts +57 -0
  313. package/dist/primitives/Table/useTable/util/columns.d.ts +7 -1
  314. package/dist/primitives/Table/useTable/util/columns.spec.d.ts +1 -0
  315. package/dist/primitives/Table/useTable/util/filtering.d.ts +7 -0
  316. package/dist/primitives/Table/useTable/util/presets.d.ts +2 -0
  317. package/dist/primitives/Table/useTable/util/search.d.ts +2 -0
  318. package/dist/primitives/Table/useTable/util/settings.d.ts +13 -0
  319. package/dist/primitives/Table/useTable/util/setup.d.ts +14 -0
  320. package/dist/primitives/Table/useTable/util/sorting.d.ts +2 -0
  321. package/dist/primitives/Table/useTableDataLoader.d.ts +23 -0
  322. package/dist/taco.cjs.development.js +149 -68
  323. package/dist/taco.cjs.development.js.map +1 -1
  324. package/dist/taco.cjs.production.min.js +1 -1
  325. package/dist/taco.cjs.production.min.js.map +1 -1
  326. package/dist/utils/dom.d.ts +1 -0
  327. package/package.json +4 -3
  328. package/types.json +20882 -7749
  329. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTablePrinting.js.map +0 -1
@@ -2,7 +2,7 @@
2
2
  import { ColumnOrderState, ColumnSizingState, SortingState, VisibilityState, BuiltInSortingFn } from '@tanstack/react-table';
3
3
  import { MenuProps } from '../Menu/Menu';
4
4
  import { MenuItemProps } from '../Menu/components/Item';
5
- import { TableColumnFilter, TableColumnSort, TableFilterHandler, TableRef, TableRowClickHandler, TableRowGotoHandler, TableRowHeight, TableRowSelectHandler, TableServerLoadAllHandler, TableServerLoadPageHandler, TableSortHandler } from '../../primitives/Table/types';
5
+ import { TableColumnFilter, TableColumnRendererControl, TableColumnSort, TableFilterHandler, TableRef, TableRowClickHandler, TableRowGotoHandler, TableRowHeight, TableRowSelectHandler, TableServerLoadAllHandler, TableServerLoadPageHandler, TableSortHandler } from '../../primitives/Table/types';
6
6
  import { FontSize, ValueOf } from '../../types';
7
7
  export declare type Table3SortDirection = 'asc' | 'desc';
8
8
  export declare type Table3SortFn<TType = unknown> = ((rowA: TType, rowB: TType, columnId: string) => -1 | 0 | 1) | BuiltInSortingFn | 'auto';
@@ -15,6 +15,7 @@ export declare type Table3ColumnHeaderMenu = (props: Partial<MenuProps>) => JSX.
15
15
  export declare type Table3ColumnControlProps = {
16
16
  className?: string;
17
17
  disabled?: boolean;
18
+ fontSize?: FontSize;
18
19
  invalid?: boolean;
19
20
  onBlur?: (value: any) => void;
20
21
  onFocus?: React.FocusEventHandler;
@@ -22,9 +23,8 @@ export declare type Table3ColumnControlProps = {
22
23
  ref: React.RefObject<HTMLElement> | ((instance: HTMLElement | null | undefined) => void);
23
24
  setValue: (value: any) => void;
24
25
  value: any;
25
- fontSize?: FontSize;
26
26
  };
27
- export declare type Table3ColumnControlRenderer<TType = unknown> = ((props: Table3ColumnControlProps, row?: TType) => JSX.Element) | 'datepicker' | 'input' | 'switch' | 'textarea';
27
+ export declare type Table3ColumnControlRenderer<TType = unknown> = TableColumnRendererControl<TType>;
28
28
  export declare type Table3ColumnProps<TType = unknown> = ValueOf<{
29
29
  [K in keyof TType]: {
30
30
  accessor: K;
@@ -307,6 +307,7 @@ export declare type Table3Texts = {
307
307
  value: string;
308
308
  };
309
309
  hiddenColumn: string;
310
+ hiddenGroupedColumn: string;
310
311
  tooltip: string;
311
312
  total: string;
312
313
  };
@@ -336,6 +337,23 @@ export declare type Table3Texts = {
336
337
  cancelButtonText: string;
337
338
  printButtonText: string;
338
339
  };
340
+ settingsDialog: {
341
+ title: string;
342
+ size: string;
343
+ sizeA5: string;
344
+ sizeA4: string;
345
+ sizeA3: string;
346
+ sizeLetter: string;
347
+ sizeLegal: string;
348
+ orientation: string;
349
+ orientationLandscape: string;
350
+ orientationPortrait: string;
351
+ rows: string;
352
+ rowsAll: string;
353
+ rowsSelected: string;
354
+ layout: string;
355
+ layoutSplitGroups: string;
356
+ };
339
357
  };
340
358
  rowHeight: {
341
359
  tooltip: string;
@@ -1,5 +1,5 @@
1
1
  import React__default from 'react';
2
- import cn from 'classnames';
2
+ import cn from 'clsx';
3
3
  import { Icon } from '../Icon/Icon.js';
4
4
  import { Root, Header, Trigger as Trigger$1, Content as Content$1, Item as Item$1 } from '@radix-ui/react-accordion';
5
5
 
@@ -1 +1 @@
1
- {"version":3,"file":"Accordion.js","sources":["../../../../../../../src/components/Accordion/Accordion.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport * as AccordionPrimitive from '@radix-ui/react-accordion';\nimport { Icon } from '../Icon/Icon';\n\ntype AccordionContext = {\n as: 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n};\nconst AccordionContext = React.createContext<AccordionContext>({\n as: 'h2',\n});\n\nexport type AccordionTriggerProps = React.HTMLAttributes<HTMLElement>;\n\nconst StyledTrigger = React.forwardRef(function AccordionStyledTrigger(\n props: AccordionPrimitive.AccordionTriggerProps,\n ref: React.Ref<HTMLButtonElement>\n) {\n const isExpanded = !!props['aria-expanded'];\n\n const className = cn(\n 'w-full inline-flex justify-between items-center align-middle',\n 'focus:rounded-sm focus:border-blue-500 focus:yt-focus',\n props.className\n );\n\n return (\n <button {...props} ref={ref} className={className}>\n {props.children}\n <Icon name={isExpanded ? 'chevron-up' : 'chevron-down'} />\n </button>\n );\n});\n\nconst Trigger = React.forwardRef(function AccordionTrigger(props: AccordionTriggerProps, ref: React.Ref<HTMLButtonElement>) {\n const { children } = props;\n const { as: Heading } = React.useContext(AccordionContext);\n\n return (\n <AccordionPrimitive.Header asChild>\n <Heading className=\"my-3\">\n <AccordionPrimitive.Trigger ref={ref} asChild>\n <StyledTrigger>{children}</StyledTrigger>\n </AccordionPrimitive.Trigger>\n </Heading>\n </AccordionPrimitive.Header>\n );\n});\n\nexport type AccordionContentProps = React.HTMLAttributes<HTMLElement>;\nconst Content = React.forwardRef(function AccordionContent(props: AccordionContentProps, ref: React.Ref<HTMLDivElement>) {\n return <AccordionPrimitive.Content {...props} ref={ref} />;\n});\n\nexport type AccordionItemProps = React.HTMLAttributes<HTMLDivElement> & {\n id: string;\n disabled?: boolean;\n};\nconst Item = (props: AccordionItemProps) => {\n const { id, ...otherProps } = props;\n return <AccordionPrimitive.Item {...otherProps} value={id} />;\n};\n\ntype AccordionBaseProps = {\n children: React.ReactNode[];\n\n /** Change what heading element accordion regions will render */\n as?: 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n\n /** Additional classes for Accordion root element */\n className?: string;\n};\n\nexport interface AccordionUncontrolledProps extends AccordionBaseProps {\n /** Default expanded accordion(s) */\n defaultId?: string | string[];\n\n id?: never;\n onChange?: never;\n}\n\nexport interface AccordionMultipleControlledProps extends AccordionBaseProps {\n /** Expanded accordions */\n id: string[];\n\n /** onChange function to receive ids of expanded accordions */\n onChange: (id: string[]) => void;\n\n defaultId?: never;\n}\nexport interface AccordionSingleControlledProps extends AccordionBaseProps {\n /** Expanded accordion */\n id: string;\n\n /** onChange function to receive id of expanded accordion */\n onChange: (id: string) => void;\n\n defaultId?: never;\n}\n\nexport type AccordionProps = AccordionUncontrolledProps | AccordionMultipleControlledProps | AccordionSingleControlledProps;\n\nexport const Accordion = (props: AccordionProps) => {\n const { id, defaultId, onChange, as = 'h2', ...otherProps } = props;\n const context = React.useMemo(() => ({ as }), [as]);\n\n let valueProps;\n\n if (defaultId) {\n valueProps = {\n defaultValue: defaultId || undefined,\n };\n } else {\n valueProps = {\n onValueChange: onChange,\n value: id || undefined,\n };\n }\n\n const type = typeof valueProps.defaultValue === 'string' || typeof valueProps.value === 'string' ? 'single' : 'multiple';\n const className = cn('divide-y divide-grey-200', props.className);\n\n return (\n <AccordionContext.Provider value={context}>\n <AccordionPrimitive.Root {...otherProps} {...valueProps} data-taco=\"accordion\" className={className} type={type} />\n </AccordionContext.Provider>\n );\n};\n\nAccordion.Item = Item;\nAccordion.Trigger = Trigger;\nAccordion.Content = Content;\n"],"names":["AccordionContext","React","createContext","as","StyledTrigger","forwardRef","AccordionStyledTrigger","props","ref","isExpanded","className","cn","children","Icon","name","Trigger","AccordionTrigger","Heading","useContext","AccordionPrimitive","asChild","Content","AccordionContent","Item","id","otherProps","value","Accordion","defaultId","onChange","context","useMemo","valueProps","defaultValue","undefined","onValueChange","type","Provider"],"mappings":";;;;;AAQA,MAAMA,gBAAgB,gBAAGC,cAAK,CAACC,aAAa,CAAmB;EAC3DC,EAAE,EAAE;CACP,CAAC;AAIF,MAAMC,aAAa,gBAAGH,cAAK,CAACI,UAAU,CAAC,SAASC,sBAAsBA,CAClEC,KAA+C,EAC/CC,GAAiC;EAEjC,MAAMC,UAAU,GAAG,CAAC,CAACF,KAAK,CAAC,eAAe,CAAC;EAE3C,MAAMG,SAAS,GAAGC,EAAE,CAChB,8DAA8D,EAC9D,uDAAuD,EACvDJ,KAAK,CAACG,SAAS,CAClB;EAED,oBACIT,yDAAYM,KAAK;IAAEC,GAAG,EAAEA,GAAG;IAAEE,SAAS,EAAEA;MACnCH,KAAK,CAACK,QAAQ,eACfX,6BAACY,IAAI;IAACC,IAAI,EAAEL,UAAU,GAAG,YAAY,GAAG;IAAkB,CACrD;AAEjB,CAAC,CAAC;AAEF,MAAMM,OAAO,gBAAGd,cAAK,CAACI,UAAU,CAAC,SAASW,gBAAgBA,CAACT,KAA4B,EAAEC,GAAiC;EACtH,MAAM;IAAEI;GAAU,GAAGL,KAAK;EAC1B,MAAM;IAAEJ,EAAE,EAAEc;GAAS,GAAGhB,cAAK,CAACiB,UAAU,CAAClB,gBAAgB,CAAC;EAE1D,oBACIC,6BAACkB,MAAyB;IAACC,OAAO;kBAC9BnB,6BAACgB,OAAO;IAACP,SAAS,EAAC;kBACfT,6BAACkB,SAA0B;IAACX,GAAG,EAAEA,GAAG;IAAEY,OAAO;kBACzCnB,6BAACG,aAAa,QAAEQ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,SAAS,EAAEA,SAAS;IAAE0B,IAAI,EAAEA;KAAQ,CAC3F;AAEpC;AAEAT,SAAS,CAACJ,IAAI,GAAGA,IAAI;AACrBI,SAAS,CAACZ,OAAO,GAAGA,OAAO;AAC3BY,SAAS,CAACN,OAAO,GAAGA,OAAO;;;;"}
1
+ {"version":3,"file":"Accordion.js","sources":["../../../../../../../src/components/Accordion/Accordion.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'clsx';\nimport * as AccordionPrimitive from '@radix-ui/react-accordion';\nimport { Icon } from '../Icon/Icon';\n\ntype AccordionContext = {\n as: 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n};\nconst AccordionContext = React.createContext<AccordionContext>({\n as: 'h2',\n});\n\nexport type AccordionTriggerProps = React.HTMLAttributes<HTMLElement>;\n\nconst StyledTrigger = React.forwardRef(function AccordionStyledTrigger(\n props: AccordionPrimitive.AccordionTriggerProps,\n ref: React.Ref<HTMLButtonElement>\n) {\n const isExpanded = !!props['aria-expanded'];\n\n const className = cn(\n 'w-full inline-flex justify-between items-center align-middle',\n 'focus:rounded-sm focus:border-blue-500 focus:yt-focus',\n props.className\n );\n\n return (\n <button {...props} ref={ref} className={className}>\n {props.children}\n <Icon name={isExpanded ? 'chevron-up' : 'chevron-down'} />\n </button>\n );\n});\n\nconst Trigger = React.forwardRef(function AccordionTrigger(props: AccordionTriggerProps, ref: React.Ref<HTMLButtonElement>) {\n const { children } = props;\n const { as: Heading } = React.useContext(AccordionContext);\n\n return (\n <AccordionPrimitive.Header asChild>\n <Heading className=\"my-3\">\n <AccordionPrimitive.Trigger ref={ref} asChild>\n <StyledTrigger>{children}</StyledTrigger>\n </AccordionPrimitive.Trigger>\n </Heading>\n </AccordionPrimitive.Header>\n );\n});\n\nexport type AccordionContentProps = React.HTMLAttributes<HTMLElement>;\nconst Content = React.forwardRef(function AccordionContent(props: AccordionContentProps, ref: React.Ref<HTMLDivElement>) {\n return <AccordionPrimitive.Content {...props} ref={ref} />;\n});\n\nexport type AccordionItemProps = React.HTMLAttributes<HTMLDivElement> & {\n id: string;\n disabled?: boolean;\n};\nconst Item = (props: AccordionItemProps) => {\n const { id, ...otherProps } = props;\n return <AccordionPrimitive.Item {...otherProps} value={id} />;\n};\n\ntype AccordionBaseProps = {\n children: React.ReactNode[];\n\n /** Change what heading element accordion regions will render */\n as?: 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n\n /** Additional classes for Accordion root element */\n className?: string;\n};\n\nexport interface AccordionUncontrolledProps extends AccordionBaseProps {\n /** Default expanded accordion(s) */\n defaultId?: string | string[];\n\n id?: never;\n onChange?: never;\n}\n\nexport interface AccordionMultipleControlledProps extends AccordionBaseProps {\n /** Expanded accordions */\n id: string[];\n\n /** onChange function to receive ids of expanded accordions */\n onChange: (id: string[]) => void;\n\n defaultId?: never;\n}\nexport interface AccordionSingleControlledProps extends AccordionBaseProps {\n /** Expanded accordion */\n id: string;\n\n /** onChange function to receive id of expanded accordion */\n onChange: (id: string) => void;\n\n defaultId?: never;\n}\n\nexport type AccordionProps = AccordionUncontrolledProps | AccordionMultipleControlledProps | AccordionSingleControlledProps;\n\nexport const Accordion = (props: AccordionProps) => {\n const { id, defaultId, onChange, as = 'h2', ...otherProps } = props;\n const context = React.useMemo(() => ({ as }), [as]);\n\n let valueProps;\n\n if (defaultId) {\n valueProps = {\n defaultValue: defaultId || undefined,\n };\n } else {\n valueProps = {\n onValueChange: onChange,\n value: id || undefined,\n };\n }\n\n const type = typeof valueProps.defaultValue === 'string' || typeof valueProps.value === 'string' ? 'single' : 'multiple';\n const className = cn('divide-y divide-grey-200', props.className);\n\n return (\n <AccordionContext.Provider value={context}>\n <AccordionPrimitive.Root {...otherProps} {...valueProps} data-taco=\"accordion\" className={className} type={type} />\n </AccordionContext.Provider>\n );\n};\n\nAccordion.Item = Item;\nAccordion.Trigger = Trigger;\nAccordion.Content = Content;\n"],"names":["AccordionContext","React","createContext","as","StyledTrigger","forwardRef","AccordionStyledTrigger","props","ref","isExpanded","className","cn","children","Icon","name","Trigger","AccordionTrigger","Heading","useContext","AccordionPrimitive","asChild","Content","AccordionContent","Item","id","otherProps","value","Accordion","defaultId","onChange","context","useMemo","valueProps","defaultValue","undefined","onValueChange","type","Provider"],"mappings":";;;;;AAQA,MAAMA,gBAAgB,gBAAGC,cAAK,CAACC,aAAa,CAAmB;EAC3DC,EAAE,EAAE;CACP,CAAC;AAIF,MAAMC,aAAa,gBAAGH,cAAK,CAACI,UAAU,CAAC,SAASC,sBAAsBA,CAClEC,KAA+C,EAC/CC,GAAiC;EAEjC,MAAMC,UAAU,GAAG,CAAC,CAACF,KAAK,CAAC,eAAe,CAAC;EAE3C,MAAMG,SAAS,GAAGC,EAAE,CAChB,8DAA8D,EAC9D,uDAAuD,EACvDJ,KAAK,CAACG,SAAS,CAClB;EAED,oBACIT,yDAAYM,KAAK;IAAEC,GAAG,EAAEA,GAAG;IAAEE,SAAS,EAAEA;MACnCH,KAAK,CAACK,QAAQ,eACfX,6BAACY,IAAI;IAACC,IAAI,EAAEL,UAAU,GAAG,YAAY,GAAG;IAAkB,CACrD;AAEjB,CAAC,CAAC;AAEF,MAAMM,OAAO,gBAAGd,cAAK,CAACI,UAAU,CAAC,SAASW,gBAAgBA,CAACT,KAA4B,EAAEC,GAAiC;EACtH,MAAM;IAAEI;GAAU,GAAGL,KAAK;EAC1B,MAAM;IAAEJ,EAAE,EAAEc;GAAS,GAAGhB,cAAK,CAACiB,UAAU,CAAClB,gBAAgB,CAAC;EAE1D,oBACIC,6BAACkB,MAAyB;IAACC,OAAO;kBAC9BnB,6BAACgB,OAAO;IAACP,SAAS,EAAC;kBACfT,6BAACkB,SAA0B;IAACX,GAAG,EAAEA,GAAG;IAAEY,OAAO;kBACzCnB,6BAACG,aAAa,QAAEQ,QAAQ,CAAiB,CAChB,CACvB,CACc;AAEpC,CAAC,CAAC;AAGF,MAAMS,OAAO,gBAAGpB,cAAK,CAACI,UAAU,CAAC,SAASiB,gBAAgBA,CAACf,KAA4B,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,OAAO;AAC3BY,SAAS,CAACN,OAAO,GAAGA,OAAO;;;;"}
@@ -1,5 +1,5 @@
1
1
  import React__default from 'react';
2
- import cn from 'classnames';
2
+ import cn from 'clsx';
3
3
  import { getSubtleColorShadeClasses, getColorByState } from '../../utils/tailwind.js';
4
4
  import { Icon } from '../Icon/Icon.js';
5
5
  import { BadgeIcon } from '../BadgeIcon/BadgeIcon.js';
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.js","sources":["../../../../../../../src/components/Alert/Alert.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { BadgeIcon } from '../BadgeIcon/BadgeIcon';\nimport { getColorByState, getSubtleColorShadeClasses } from '../../utils/tailwind';\nimport { Icon, IconName } from '../Icon/Icon';\nimport { State } from '../../types';\n\nexport type AlertProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> & {\n children: React.ReactNode;\n state?: State;\n onClose?: () => void;\n};\n\nconst getIconName = (state: State | undefined): IconName => {\n switch (state) {\n case 'information':\n return 'info';\n case 'warning':\n return 'warning';\n case 'error':\n return 'close';\n case 'success':\n return 'tick';\n default:\n return 'question-mark';\n }\n};\n\nexport const Alert = React.forwardRef(function Alert(props: AlertProps, ref: React.Ref<HTMLDivElement>) {\n const { children, title, state, onClose } = props;\n\n const className = cn(\n `flex w-full flex-row items-start gap-2 rounded-md border-transparent p-3 ${getSubtleColorShadeClasses(\n getColorByState(state)\n )}`,\n props.className\n );\n\n return (\n <div {...props} ref={ref} className={className} data-taco=\"alert\" role=\"alert\">\n <BadgeIcon className=\"flex-none\" icon={getIconName(state)} color={getColorByState(state)} />\n <div className=\"grow text-sm\">\n {title && <div className=\"font-bold\">{title}</div>}\n {children}\n </div>\n {onClose && <Icon className=\"flex-none cursor-pointer\" name=\"close\" onClick={onClose} />}\n </div>\n );\n});\n"],"names":["getIconName","state","Alert","React","forwardRef","props","ref","children","title","onClose","className","cn","getSubtleColorShadeClasses","getColorByState","role","BadgeIcon","icon","color","Icon","name","onClick"],"mappings":";;;;;;AAaA,MAAMA,WAAW,GAAIC,KAAwB;EACzC,QAAQA,KAAK;IACT,KAAK,aAAa;MACd,OAAO,MAAM;IACjB,KAAK,SAAS;MACV,OAAO,SAAS;IACpB,KAAK,OAAO;MACR,OAAO,OAAO;IAClB,KAAK,SAAS;MACV,OAAO,MAAM;IACjB;MACI,OAAO,eAAe;;AAElC,CAAC;MAEYC,KAAK,gBAAGC,cAAK,CAACC,UAAU,CAAC,SAASF,KAAKA,CAACG,KAAiB,EAAEC,GAA8B;EAClG,MAAM;IAAEC,QAAQ;IAAEC,KAAK;IAAEP,KAAK;IAAEQ;GAAS,GAAGJ,KAAK;EAEjD,MAAMK,SAAS,GAAGC,EAAE,6EAC4DC,0BAA0B,CAClGC,eAAe,CAACZ,KAAK,CAAC,GACvB,EACHI,KAAK,CAACK,SAAS,CAClB;EAED,oBACIP,sDAASE,KAAK;IAAEC,GAAG,EAAEA,GAAG;IAAEI,SAAS,EAAEA,SAAS;iBAAY,OAAO;IAACI,IAAI,EAAC;mBACnEX,6BAACY,SAAS;IAACL,SAAS,EAAC,WAAW;IAACM,IAAI,EAAEhB,WAAW,CAACC,KAAK,CAAC;IAAEgB,KAAK,EAAEJ,eAAe,CAACZ,KAAK;IAAK,eAC5FE;IAAKO,SAAS,EAAC;KACVF,KAAK,iBAAIL;IAAKO,SAAS,EAAC;KAAaF,KAAK,CAAO,EACjDD,QAAQ,CACP,EACLE,OAAO,iBAAIN,6BAACe,IAAI;IAACR,SAAS,EAAC,0BAA0B;IAACS,IAAI,EAAC,OAAO;IAACC,OAAO,EAAEX;IAAW,CACtF;AAEd,CAAC;;;;"}
1
+ {"version":3,"file":"Alert.js","sources":["../../../../../../../src/components/Alert/Alert.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'clsx';\nimport { BadgeIcon } from '../BadgeIcon/BadgeIcon';\nimport { getColorByState, getSubtleColorShadeClasses } from '../../utils/tailwind';\nimport { Icon, IconName } from '../Icon/Icon';\nimport { State } from '../../types';\n\nexport type AlertProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> & {\n children: React.ReactNode;\n state?: State;\n onClose?: () => void;\n};\n\nconst getIconName = (state: State | undefined): IconName => {\n switch (state) {\n case 'information':\n return 'info';\n case 'warning':\n return 'warning';\n case 'error':\n return 'close';\n case 'success':\n return 'tick';\n default:\n return 'question-mark';\n }\n};\n\nexport const Alert = React.forwardRef(function Alert(props: AlertProps, ref: React.Ref<HTMLDivElement>) {\n const { children, title, state, onClose } = props;\n\n const className = cn(\n `flex w-full flex-row items-start gap-2 rounded-md border-transparent p-3 ${getSubtleColorShadeClasses(\n getColorByState(state)\n )}`,\n props.className\n );\n\n return (\n <div {...props} ref={ref} className={className} data-taco=\"alert\" role=\"alert\">\n <BadgeIcon className=\"flex-none\" icon={getIconName(state)} color={getColorByState(state)} />\n <div className=\"grow text-sm\">\n {title && <div className=\"font-bold\">{title}</div>}\n {children}\n </div>\n {onClose && <Icon className=\"flex-none cursor-pointer\" name=\"close\" onClick={onClose} />}\n </div>\n );\n});\n"],"names":["getIconName","state","Alert","React","forwardRef","props","ref","children","title","onClose","className","cn","getSubtleColorShadeClasses","getColorByState","role","BadgeIcon","icon","color","Icon","name","onClick"],"mappings":";;;;;;AAaA,MAAMA,WAAW,GAAIC,KAAwB;EACzC,QAAQA,KAAK;IACT,KAAK,aAAa;MACd,OAAO,MAAM;IACjB,KAAK,SAAS;MACV,OAAO,SAAS;IACpB,KAAK,OAAO;MACR,OAAO,OAAO;IAClB,KAAK,SAAS;MACV,OAAO,MAAM;IACjB;MACI,OAAO,eAAe;;AAElC,CAAC;MAEYC,KAAK,gBAAGC,cAAK,CAACC,UAAU,CAAC,SAASF,KAAKA,CAACG,KAAiB,EAAEC,GAA8B;EAClG,MAAM;IAAEC,QAAQ;IAAEC,KAAK;IAAEP,KAAK;IAAEQ;GAAS,GAAGJ,KAAK;EAEjD,MAAMK,SAAS,GAAGC,EAAE,6EAC4DC,0BAA0B,CAClGC,eAAe,CAACZ,KAAK,CAAC,GACvB,EACHI,KAAK,CAACK,SAAS,CAClB;EAED,oBACIP,sDAASE,KAAK;IAAEC,GAAG,EAAEA,GAAG;IAAEI,SAAS,EAAEA,SAAS;iBAAY,OAAO;IAACI,IAAI,EAAC;mBACnEX,6BAACY,SAAS;IAACL,SAAS,EAAC,WAAW;IAACM,IAAI,EAAEhB,WAAW,CAACC,KAAK,CAAC;IAAEgB,KAAK,EAAEJ,eAAe,CAACZ,KAAK;IAAK,eAC5FE;IAAKO,SAAS,EAAC;KACVF,KAAK,iBAAIL;IAAKO,SAAS,EAAC;KAAaF,KAAK,CAAO,EACjDD,QAAQ,CACP,EACLE,OAAO,iBAAIN,6BAACe,IAAI;IAACR,SAAS,EAAC,0BAA0B;IAACS,IAAI,EAAC,OAAO;IAACC,OAAO,EAAEX;IAAW,CACtF;AAEd,CAAC;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { forwardRef, createElement } from 'react';
2
- import cn from 'classnames';
2
+ import cn from 'clsx';
3
3
  import { Title as Title$1, Portal, Overlay, Content as Content$1 } from '@radix-ui/react-alert-dialog';
4
4
  import { Backdrop } from '../../Backdrop/Backdrop.js';
5
5
  import { getDialogPositionClassnames, getDialogStylingClassnames, getDialogSizeClassnames } from '../../Dialog/util.js';
@@ -1 +1 @@
1
- {"version":3,"file":"Content.js","sources":["../../../../../../../../src/components/AlertDialog/components/Content.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';\nimport cn from 'classnames';\nimport { Backdrop } from '../../Backdrop/Backdrop';\nimport { getDialogPositionClassnames, getDialogSizeClassnames, getDialogStylingClassnames } from '../../Dialog/util';\n\nexport type AlertDialogTitleProps = React.HTMLAttributes<HTMLHeadingElement>;\nexport const Title = React.forwardRef(function AlertDialogTitle(\n props: AlertDialogTitleProps,\n ref: React.Ref<HTMLHeadingElement>\n) {\n const className = cn('text-center', props.className);\n return <AlertDialogPrimitive.Title {...props} className={className} ref={ref} />;\n});\n\nexport type AlertDialogContentProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> & {\n /** An accessible label to be announced when the dialog is opened */\n 'aria-label': string;\n children: React.ReactNode;\n};\nexport const Content = React.forwardRef(function AlertDialogContent(\n props: AlertDialogContentProps,\n ref: React.Ref<HTMLDivElement>\n) {\n const className = cn('p-6', getDialogPositionClassnames(), getDialogStylingClassnames(), getDialogSizeClassnames('dialog'));\n\n return (\n <AlertDialogPrimitive.Portal>\n <AlertDialogPrimitive.Overlay asChild>\n <Backdrop>\n <AlertDialogPrimitive.Content\n {...props}\n ref={ref}\n className={className}\n onEscapeKeyDown={event => event.preventDefault()}>\n {props.children}\n </AlertDialogPrimitive.Content>\n </Backdrop>\n </AlertDialogPrimitive.Overlay>\n </AlertDialogPrimitive.Portal>\n );\n});\n"],"names":["Title","React","AlertDialogTitle","props","ref","className","cn","AlertDialogPrimitive","Content","AlertDialogContent","getDialogPositionClassnames","getDialogStylingClassnames","getDialogSizeClassnames","asChild","Backdrop","onEscapeKeyDown","event","preventDefault","children"],"mappings":";;;;;;MAOaA,KAAK,gBAAGC,UAAgB,CAAC,SAASC,gBAAgBA,CAC3DC,KAA4B,EAC5BC,GAAkC;EAElC,MAAMC,SAAS,GAAGC,EAAE,CAAC,aAAa,EAAEH,KAAK,CAACE,SAAS,CAAC;EACpD,oBAAOJ,cAACM,OAA0B,oBAAKJ,KAAK;IAAEE,SAAS,EAAEA,SAAS;IAAED,GAAG,EAAEA;KAAO;AACpF,CAAC;MAOYI,OAAO,gBAAGP,UAAgB,CAAC,SAASQ,kBAAkBA,CAC/DN,KAA8B,EAC9BC,GAA8B;EAE9B,MAAMC,SAAS,GAAGC,EAAE,CAAC,KAAK,EAAEI,2BAA2B,EAAE,EAAEC,0BAA0B,EAAE,EAAEC,uBAAuB,CAAC,QAAQ,CAAC,CAAC;EAE3H,oBACIX,cAACM,MAA2B,qBACxBN,cAACM,OAA4B;IAACM,OAAO;kBACjCZ,cAACa,QAAQ,qBACLb,cAACM,SAA4B,oBACrBJ,KAAK;IACTC,GAAG,EAAEA,GAAG;IACRC,SAAS,EAAEA,SAAS;IACpBU,eAAe,EAAEC,KAAK,IAAIA,KAAK,CAACC,cAAc;MAC7Cd,KAAK,CAACe,QAAQ,CACY,CACxB,CACgB,CACL;AAEtC,CAAC;;;;"}
1
+ {"version":3,"file":"Content.js","sources":["../../../../../../../../src/components/AlertDialog/components/Content.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';\nimport cn from 'clsx';\nimport { Backdrop } from '../../Backdrop/Backdrop';\nimport { getDialogPositionClassnames, getDialogSizeClassnames, getDialogStylingClassnames } from '../../Dialog/util';\n\nexport type AlertDialogTitleProps = React.HTMLAttributes<HTMLHeadingElement>;\nexport const Title = React.forwardRef(function AlertDialogTitle(\n props: AlertDialogTitleProps,\n ref: React.Ref<HTMLHeadingElement>\n) {\n const className = cn('text-center', props.className);\n return <AlertDialogPrimitive.Title {...props} className={className} ref={ref} />;\n});\n\nexport type AlertDialogContentProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> & {\n /** An accessible label to be announced when the dialog is opened */\n 'aria-label': string;\n children: React.ReactNode;\n};\nexport const Content = React.forwardRef(function AlertDialogContent(\n props: AlertDialogContentProps,\n ref: React.Ref<HTMLDivElement>\n) {\n const className = cn('p-6', getDialogPositionClassnames(), getDialogStylingClassnames(), getDialogSizeClassnames('dialog'));\n\n return (\n <AlertDialogPrimitive.Portal>\n <AlertDialogPrimitive.Overlay asChild>\n <Backdrop>\n <AlertDialogPrimitive.Content\n {...props}\n ref={ref}\n className={className}\n onEscapeKeyDown={event => event.preventDefault()}>\n {props.children}\n </AlertDialogPrimitive.Content>\n </Backdrop>\n </AlertDialogPrimitive.Overlay>\n </AlertDialogPrimitive.Portal>\n );\n});\n"],"names":["Title","React","AlertDialogTitle","props","ref","className","cn","AlertDialogPrimitive","Content","AlertDialogContent","getDialogPositionClassnames","getDialogStylingClassnames","getDialogSizeClassnames","asChild","Backdrop","onEscapeKeyDown","event","preventDefault","children"],"mappings":";;;;;;MAOaA,KAAK,gBAAGC,UAAgB,CAAC,SAASC,gBAAgBA,CAC3DC,KAA4B,EAC5BC,GAAkC;EAElC,MAAMC,SAAS,GAAGC,EAAE,CAAC,aAAa,EAAEH,KAAK,CAACE,SAAS,CAAC;EACpD,oBAAOJ,cAACM,OAA0B,oBAAKJ,KAAK;IAAEE,SAAS,EAAEA,SAAS;IAAED,GAAG,EAAEA;KAAO;AACpF,CAAC;MAOYI,OAAO,gBAAGP,UAAgB,CAAC,SAASQ,kBAAkBA,CAC/DN,KAA8B,EAC9BC,GAA8B;EAE9B,MAAMC,SAAS,GAAGC,EAAE,CAAC,KAAK,EAAEI,2BAA2B,EAAE,EAAEC,0BAA0B,EAAE,EAAEC,uBAAuB,CAAC,QAAQ,CAAC,CAAC;EAE3H,oBACIX,cAACM,MAA2B,qBACxBN,cAACM,OAA4B;IAACM,OAAO;kBACjCZ,cAACa,QAAQ,qBACLb,cAACM,SAA4B,oBACrBJ,KAAK;IACTC,GAAG,EAAEA,GAAG;IACRC,SAAS,EAAEA,SAAS;IACpBU,eAAe,EAAEC,KAAK,IAAIA,KAAK,CAACC,cAAc;MAC7Cd,KAAK,CAACe,QAAQ,CACY,CACxB,CACgB,CACL;AAEtC,CAAC;;;;"}
@@ -1,8 +1,8 @@
1
1
  import { forwardRef, createElement } from 'react';
2
- import cn from 'classnames';
2
+ import cn from 'clsx';
3
3
 
4
4
  const Backdrop = /*#__PURE__*/forwardRef(function Backdrop(props, ref) {
5
- const className = cn('fixed inset-0 cursor-default overflow-y-auto bg-blue-900/[0.3] aria-hidden:invisible', props.className);
5
+ const className = cn('fixed inset-0 cursor-default overflow-y-auto bg-blue-900/[0.3] aria-hidden:invisible print:overflow-visible print:absolute', props.className);
6
6
  return /*#__PURE__*/createElement("div", Object.assign({}, props, {
7
7
  className: className,
8
8
  "data-taco": "backdrop",
@@ -1 +1 @@
1
- {"version":3,"file":"Backdrop.js","sources":["../../../../../../../src/components/Backdrop/Backdrop.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\n\nexport type BackdropProps = React.HTMLAttributes<HTMLDivElement>;\n\nexport const Backdrop = React.forwardRef<HTMLDivElement, BackdropProps>(function Backdrop(props, ref) {\n const className = cn('fixed inset-0 cursor-default overflow-y-auto bg-blue-900/[0.3] aria-hidden:invisible', props.className);\n\n return <div {...props} className={className} data-taco=\"backdrop\" ref={ref} />;\n});\n"],"names":["Backdrop","React","props","ref","className","cn"],"mappings":";;;MAKaA,QAAQ,gBAAGC,UAAgB,CAAgC,SAASD,QAAQA,CAACE,KAAK,EAAEC,GAAG;EAChG,MAAMC,SAAS,GAAGC,EAAE,CAAC,sFAAsF,EAAEH,KAAK,CAACE,SAAS,CAAC;EAE7H,oBAAOH,uCAASC,KAAK;IAAEE,SAAS,EAAEA,SAAS;iBAAY,UAAU;IAACD,GAAG,EAAEA;KAAO;AAClF,CAAC;;;;"}
1
+ {"version":3,"file":"Backdrop.js","sources":["../../../../../../../src/components/Backdrop/Backdrop.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'clsx';\n\nexport type BackdropProps = React.HTMLAttributes<HTMLDivElement>;\n\nexport const Backdrop = React.forwardRef<HTMLDivElement, BackdropProps>(function Backdrop(props, ref) {\n const className = cn(\n 'fixed inset-0 cursor-default overflow-y-auto bg-blue-900/[0.3] aria-hidden:invisible print:overflow-visible print:absolute',\n props.className\n );\n\n return <div {...props} className={className} data-taco=\"backdrop\" ref={ref} />;\n});\n"],"names":["Backdrop","React","props","ref","className","cn"],"mappings":";;;MAKaA,QAAQ,gBAAGC,UAAgB,CAAgC,SAASD,QAAQA,CAACE,KAAK,EAAEC,GAAG;EAChG,MAAMC,SAAS,GAAGC,EAAE,CAChB,4HAA4H,EAC5HH,KAAK,CAACE,SAAS,CAClB;EAED,oBAAOH,uCAASC,KAAK;IAAEE,SAAS,EAAEA,SAAS;iBAAY,UAAU;IAACD,GAAG,EAAEA;KAAO;AAClF,CAAC;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { forwardRef, createElement, Fragment } from 'react';
2
- import cn from 'classnames';
2
+ import cn from 'clsx';
3
3
  import { getOutlineColorShadeClasses, getSubtleColorShadeClasses, getColorShadeClasses } from '../../utils/tailwind.js';
4
4
  import { VisuallyHidden } from '../VisuallyHidden/VisuallyHidden.js';
5
5
 
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.js","sources":["../../../../../../../src/components/Badge/Badge.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport { VisuallyHidden } from '../VisuallyHidden/VisuallyHidden';\nimport { Color } from '../../types';\nimport { getSubtleColorShadeClasses, getColorShadeClasses, getOutlineColorShadeClasses } from '../../utils/tailwind';\nimport './Badge.css';\n\nexport type BadgeBaseProps = React.HTMLAttributes<HTMLSpanElement> & {\n /** Content should be a numerical value or tag/status like text **/\n children: React.ReactNode;\n /** Show small version of badge **/\n small?: boolean;\n /** Background color **/\n color?: Color;\n};\n\ninterface CompactBadgeProps extends BadgeBaseProps {\n /** Show compact version **/\n compact?: boolean;\n /** Show outlined version **/\n outline?: never;\n /** Show subtle version **/\n subtle?: never;\n /** Show status dot - can be used only in subtle badge **/\n status?: never;\n}\n\ninterface OutlineBadgeProps extends BadgeBaseProps {\n /** Show compact version **/\n compact?: never;\n /** Show outlined version **/\n outline?: boolean;\n /** Show subtle version **/\n subtle?: never;\n /** Show status dot - can be used only in subtle badge **/\n status?: never;\n}\n\ninterface SubtleBadgeProps extends BadgeBaseProps {\n /** Show compact version **/\n compact?: never;\n /** Show outlined version **/\n outline?: never;\n /** Show subtle version **/\n subtle?: boolean;\n /** Show status dot - can be used only in subtle badge **/\n status?: never;\n}\n\ninterface StatusBadgeProps extends BadgeBaseProps {\n /** Show compact version **/\n compact?: never;\n /** Show outlined version **/\n outline?: never;\n /** Show subtle version **/\n subtle?: boolean;\n /** Show status dot - can be used only in subtle badge **/\n status?: boolean;\n}\n\nexport type BadgeProps = CompactBadgeProps | OutlineBadgeProps | SubtleBadgeProps | StatusBadgeProps;\n\nexport const Badge = React.forwardRef(function Badge(props: BadgeProps, ref: React.Ref<HTMLSpanElement>) {\n const {\n children,\n compact = false,\n outline = false,\n status = false,\n subtle = false,\n small = false,\n color,\n ...otherProps\n } = props;\n const isTransparent = color === 'transparent';\n const className = cn(\n 'rounded-full border overflow-hidden whitespace-nowrap inline-flex items-center justify-center',\n {\n [`border ${getOutlineColorShadeClasses(color)}`]: outline,\n [`border-transparent font-normal ${getSubtleColorShadeClasses(color)}`]: subtle,\n [`border-transparent ${getColorShadeClasses(color)}`]: !outline && !subtle,\n 'h-4 min-w-0 py-0 px-1 text-xs': small,\n 'h-2 w-2 min-w-0': compact,\n 'font-bold': outline || !subtle,\n 'text-sm': !small,\n 'h-5 py-0 px-1.5': !compact && !small, // custom padding keeps single digits in a perfect circle\n '!bg-grey-700': compact && isTransparent,\n },\n props.className\n );\n\n const content = () => {\n if (compact) {\n return <VisuallyHidden>{children}</VisuallyHidden>;\n }\n if (status) {\n return (\n <>\n <div className={cn('mr-1 h-2 w-2 rounded-full', getColorShadeClasses(color))} />\n {children}\n </>\n );\n }\n return children;\n };\n\n return (\n <span\n {...otherProps}\n aria-atomic=\"true\"\n aria-live=\"polite\"\n className={className}\n data-taco=\"badge\"\n ref={ref}\n role=\"status\"\n title={props['aria-label']}>\n {content()}\n </span>\n );\n});\n"],"names":["Badge","React","props","ref","children","compact","outline","status","subtle","small","color","otherProps","isTransparent","className","cn","getOutlineColorShadeClasses","getSubtleColorShadeClasses","getColorShadeClasses","content","VisuallyHidden","role","title"],"mappings":";;;;;MA8DaA,KAAK,gBAAGC,UAAgB,CAAC,SAASD,KAAKA,CAACE,KAAiB,EAAEC,GAA+B;EACnG,MAAM;IACFC,QAAQ;IACRC,OAAO,GAAG,KAAK;IACfC,OAAO,GAAG,KAAK;IACfC,MAAM,GAAG,KAAK;IACdC,MAAM,GAAG,KAAK;IACdC,KAAK,GAAG,KAAK;IACbC,KAAK;IACL,GAAGC;GACN,GAAGT,KAAK;EACT,MAAMU,aAAa,GAAGF,KAAK,KAAK,aAAa;EAC7C,MAAMG,SAAS,GAAGC,EAAE,CAChB,+FAA+F,EAC/F;IACI,WAAWC,2BAA2B,CAACL,KAAK,GAAG,GAAGJ,OAAO;IACzD,mCAAmCU,0BAA0B,CAACN,KAAK,GAAG,GAAGF,MAAM;IAC/E,uBAAuBS,oBAAoB,CAACP,KAAK,GAAG,GAAG,CAACJ,OAAO,IAAI,CAACE,MAAM;IAC1E,+BAA+B,EAAEC,KAAK;IACtC,iBAAiB,EAAEJ,OAAO;IAC1B,WAAW,EAAEC,OAAO,IAAI,CAACE,MAAM;IAC/B,SAAS,EAAE,CAACC,KAAK;IACjB,iBAAiB,EAAE,CAACJ,OAAO,IAAI,CAACI,KAAK;IACrC,cAAc,EAAEJ,OAAO,IAAIO;GAC9B,EACDV,KAAK,CAACW,SAAS,CAClB;EAED,MAAMK,OAAO,GAAGA;IACZ,IAAIb,OAAO,EAAE;MACT,oBAAOJ,cAACkB,cAAc,QAAEf,QAAQ,CAAkB;;IAEtD,IAAIG,MAAM,EAAE;MACR,oBACIN,2CACIA;QAAKY,SAAS,EAAEC,EAAE,CAAC,2BAA2B,EAAEG,oBAAoB,CAACP,KAAK,CAAC;QAAK,EAC/EN,QAAQ,CACV;;IAGX,OAAOA,QAAQ;GAClB;EAED,oBACIH,wCACQU,UAAU;mBACF,MAAM;iBACR,QAAQ;IAClBE,SAAS,EAAEA,SAAS;iBACV,OAAO;IACjBV,GAAG,EAAEA,GAAG;IACRiB,IAAI,EAAC,QAAQ;IACbC,KAAK,EAAEnB,KAAK,CAAC,YAAY;MACxBgB,OAAO,EAAE,CACP;AAEf,CAAC;;;;"}
1
+ {"version":3,"file":"Badge.js","sources":["../../../../../../../src/components/Badge/Badge.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'clsx';\nimport { VisuallyHidden } from '../VisuallyHidden/VisuallyHidden';\nimport { Color } from '../../types';\nimport { getSubtleColorShadeClasses, getColorShadeClasses, getOutlineColorShadeClasses } from '../../utils/tailwind';\nimport './Badge.css';\n\nexport type BadgeBaseProps = React.HTMLAttributes<HTMLSpanElement> & {\n /** Content should be a numerical value or tag/status like text **/\n children: React.ReactNode;\n /** Show small version of badge **/\n small?: boolean;\n /** Background color **/\n color?: Color;\n};\n\ninterface CompactBadgeProps extends BadgeBaseProps {\n /** Show compact version **/\n compact?: boolean;\n /** Show outlined version **/\n outline?: never;\n /** Show subtle version **/\n subtle?: never;\n /** Show status dot - can be used only in subtle badge **/\n status?: never;\n}\n\ninterface OutlineBadgeProps extends BadgeBaseProps {\n /** Show compact version **/\n compact?: never;\n /** Show outlined version **/\n outline?: boolean;\n /** Show subtle version **/\n subtle?: never;\n /** Show status dot - can be used only in subtle badge **/\n status?: never;\n}\n\ninterface SubtleBadgeProps extends BadgeBaseProps {\n /** Show compact version **/\n compact?: never;\n /** Show outlined version **/\n outline?: never;\n /** Show subtle version **/\n subtle?: boolean;\n /** Show status dot - can be used only in subtle badge **/\n status?: never;\n}\n\ninterface StatusBadgeProps extends BadgeBaseProps {\n /** Show compact version **/\n compact?: never;\n /** Show outlined version **/\n outline?: never;\n /** Show subtle version **/\n subtle?: boolean;\n /** Show status dot - can be used only in subtle badge **/\n status?: boolean;\n}\n\nexport type BadgeProps = CompactBadgeProps | OutlineBadgeProps | SubtleBadgeProps | StatusBadgeProps;\n\nexport const Badge = React.forwardRef(function Badge(props: BadgeProps, ref: React.Ref<HTMLSpanElement>) {\n const {\n children,\n compact = false,\n outline = false,\n status = false,\n subtle = false,\n small = false,\n color,\n ...otherProps\n } = props;\n const isTransparent = color === 'transparent';\n const className = cn(\n 'rounded-full border overflow-hidden whitespace-nowrap inline-flex items-center justify-center',\n {\n [`border ${getOutlineColorShadeClasses(color)}`]: outline,\n [`border-transparent font-normal ${getSubtleColorShadeClasses(color)}`]: subtle,\n [`border-transparent ${getColorShadeClasses(color)}`]: !outline && !subtle,\n 'h-4 min-w-0 py-0 px-1 text-xs': small,\n 'h-2 w-2 min-w-0': compact,\n 'font-bold': outline || !subtle,\n 'text-sm': !small,\n 'h-5 py-0 px-1.5': !compact && !small, // custom padding keeps single digits in a perfect circle\n '!bg-grey-700': compact && isTransparent,\n },\n props.className\n );\n\n const content = () => {\n if (compact) {\n return <VisuallyHidden>{children}</VisuallyHidden>;\n }\n if (status) {\n return (\n <>\n <div className={cn('mr-1 h-2 w-2 rounded-full', getColorShadeClasses(color))} />\n {children}\n </>\n );\n }\n return children;\n };\n\n return (\n <span\n {...otherProps}\n aria-atomic=\"true\"\n aria-live=\"polite\"\n className={className}\n data-taco=\"badge\"\n ref={ref}\n role=\"status\"\n title={props['aria-label']}>\n {content()}\n </span>\n );\n});\n"],"names":["Badge","React","props","ref","children","compact","outline","status","subtle","small","color","otherProps","isTransparent","className","cn","getOutlineColorShadeClasses","getSubtleColorShadeClasses","getColorShadeClasses","content","VisuallyHidden","role","title"],"mappings":";;;;;MA8DaA,KAAK,gBAAGC,UAAgB,CAAC,SAASD,KAAKA,CAACE,KAAiB,EAAEC,GAA+B;EACnG,MAAM;IACFC,QAAQ;IACRC,OAAO,GAAG,KAAK;IACfC,OAAO,GAAG,KAAK;IACfC,MAAM,GAAG,KAAK;IACdC,MAAM,GAAG,KAAK;IACdC,KAAK,GAAG,KAAK;IACbC,KAAK;IACL,GAAGC;GACN,GAAGT,KAAK;EACT,MAAMU,aAAa,GAAGF,KAAK,KAAK,aAAa;EAC7C,MAAMG,SAAS,GAAGC,EAAE,CAChB,+FAA+F,EAC/F;IACI,WAAWC,2BAA2B,CAACL,KAAK,GAAG,GAAGJ,OAAO;IACzD,mCAAmCU,0BAA0B,CAACN,KAAK,GAAG,GAAGF,MAAM;IAC/E,uBAAuBS,oBAAoB,CAACP,KAAK,GAAG,GAAG,CAACJ,OAAO,IAAI,CAACE,MAAM;IAC1E,+BAA+B,EAAEC,KAAK;IACtC,iBAAiB,EAAEJ,OAAO;IAC1B,WAAW,EAAEC,OAAO,IAAI,CAACE,MAAM;IAC/B,SAAS,EAAE,CAACC,KAAK;IACjB,iBAAiB,EAAE,CAACJ,OAAO,IAAI,CAACI,KAAK;IACrC,cAAc,EAAEJ,OAAO,IAAIO;GAC9B,EACDV,KAAK,CAACW,SAAS,CAClB;EAED,MAAMK,OAAO,GAAGA;IACZ,IAAIb,OAAO,EAAE;MACT,oBAAOJ,cAACkB,cAAc,QAAEf,QAAQ,CAAkB;;IAEtD,IAAIG,MAAM,EAAE;MACR,oBACIN,2CACIA;QAAKY,SAAS,EAAEC,EAAE,CAAC,2BAA2B,EAAEG,oBAAoB,CAACP,KAAK,CAAC;QAAK,EAC/EN,QAAQ,CACV;;IAGX,OAAOA,QAAQ;GAClB;EAED,oBACIH,wCACQU,UAAU;mBACF,MAAM;iBACR,QAAQ;IAClBE,SAAS,EAAEA,SAAS;iBACV,OAAO;IACjBV,GAAG,EAAEA,GAAG;IACRiB,IAAI,EAAC,QAAQ;IACbC,KAAK,EAAEnB,KAAK,CAAC,YAAY;MACxBgB,OAAO,EAAE,CACP;AAEf,CAAC;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { forwardRef, createElement } from 'react';
2
- import cn from 'classnames';
2
+ import cn from 'clsx';
3
3
  import { getSubtleColorShadeClasses, getColorShadeClasses } from '../../utils/tailwind.js';
4
4
  import { Icon } from '../Icon/Icon.js';
5
5
 
@@ -1 +1 @@
1
- {"version":3,"file":"BadgeIcon.js","sources":["../../../../../../../src/components/BadgeIcon/BadgeIcon.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport { getSubtleColorShadeClasses, getColorShadeClasses } from '../../utils/tailwind';\nimport { Icon, IconName } from '../Icon/Icon';\nimport { Color } from '../../types';\n\nexport type BadgeIconProps = React.HTMLAttributes<HTMLSpanElement> & {\n /** Icon type **/\n icon: IconName;\n /** Background color **/\n color?: Color;\n /** Show subtle version **/\n subtle?: boolean;\n /** Show small version of badge icon **/\n small?: boolean;\n};\n\nexport const BadgeIcon = React.forwardRef(function Badge(props: BadgeIconProps, ref: React.Ref<HTMLSpanElement>) {\n const { color, icon, subtle, small, ...otherProps } = props;\n\n const className = cn(\n `rounded-full border overflow-hidden whitespace-nowrap inline-flex items-center justify-center border-transparent [&>*]:max-h-full`,\n { 'w-5 h-5': !small },\n { 'w-4 h-4 text-xs': small },\n { [getSubtleColorShadeClasses(color)]: subtle, [getColorShadeClasses(color)]: !subtle },\n props.className\n );\n\n const iconProps = {\n strokeWidth: 1,\n stroke: 'currentColor',\n };\n\n return (\n <span\n {...otherProps}\n aria-label=\"icon\"\n className={className}\n data-taco=\"badge-icon\"\n ref={ref}\n role=\"status\"\n title={props['aria-label']}>\n <Icon name={icon} {...iconProps} />\n </span>\n );\n});\n"],"names":["BadgeIcon","React","Badge","props","ref","color","icon","subtle","small","otherProps","className","cn","getSubtleColorShadeClasses","getColorShadeClasses","iconProps","strokeWidth","stroke","role","title","Icon","name"],"mappings":";;;;;MAiBaA,SAAS,gBAAGC,UAAgB,CAAC,SAASC,KAAKA,CAACC,KAAqB,EAAEC,GAA+B;EAC3G,MAAM;IAAEC,KAAK;IAAEC,IAAI;IAAEC,MAAM;IAAEC,KAAK;IAAE,GAAGC;GAAY,GAAGN,KAAK;EAE3D,MAAMO,SAAS,GAAGC,EAAE,oIACmH,EACnI;IAAE,SAAS,EAAE,CAACH;GAAO,EACrB;IAAE,iBAAiB,EAAEA;GAAO,EAC5B;IAAE,CAACI,0BAA0B,CAACP,KAAK,CAAC,GAAGE,MAAM;IAAE,CAACM,oBAAoB,CAACR,KAAK,CAAC,GAAG,CAACE;GAAQ,EACvFJ,KAAK,CAACO,SAAS,CAClB;EAED,MAAMI,SAAS,GAAG;IACdC,WAAW,EAAE,CAAC;IACdC,MAAM,EAAE;GACX;EAED,oBACIf,wCACQQ,UAAU;kBACH,MAAM;IACjBC,SAAS,EAAEA,SAAS;iBACV,YAAY;IACtBN,GAAG,EAAEA,GAAG;IACRa,IAAI,EAAC,QAAQ;IACbC,KAAK,EAAEf,KAAK,CAAC,YAAY;mBACzBF,cAACkB,IAAI;IAACC,IAAI,EAAEd;KAAUQ,SAAS,EAAI,CAChC;AAEf,CAAC;;;;"}
1
+ {"version":3,"file":"BadgeIcon.js","sources":["../../../../../../../src/components/BadgeIcon/BadgeIcon.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'clsx';\nimport { getSubtleColorShadeClasses, getColorShadeClasses } from '../../utils/tailwind';\nimport { Icon, IconName } from '../Icon/Icon';\nimport { Color } from '../../types';\n\nexport type BadgeIconProps = React.HTMLAttributes<HTMLSpanElement> & {\n /** Icon type **/\n icon: IconName;\n /** Background color **/\n color?: Color;\n /** Show subtle version **/\n subtle?: boolean;\n /** Show small version of badge icon **/\n small?: boolean;\n};\n\nexport const BadgeIcon = React.forwardRef(function Badge(props: BadgeIconProps, ref: React.Ref<HTMLSpanElement>) {\n const { color, icon, subtle, small, ...otherProps } = props;\n\n const className = cn(\n `rounded-full border overflow-hidden whitespace-nowrap inline-flex items-center justify-center border-transparent [&>*]:max-h-full`,\n { 'w-5 h-5': !small },\n { 'w-4 h-4 text-xs': small },\n { [getSubtleColorShadeClasses(color)]: subtle, [getColorShadeClasses(color)]: !subtle },\n props.className\n );\n\n const iconProps = {\n strokeWidth: 1,\n stroke: 'currentColor',\n };\n\n return (\n <span\n {...otherProps}\n aria-label=\"icon\"\n className={className}\n data-taco=\"badge-icon\"\n ref={ref}\n role=\"status\"\n title={props['aria-label']}>\n <Icon name={icon} {...iconProps} />\n </span>\n );\n});\n"],"names":["BadgeIcon","React","Badge","props","ref","color","icon","subtle","small","otherProps","className","cn","getSubtleColorShadeClasses","getColorShadeClasses","iconProps","strokeWidth","stroke","role","title","Icon","name"],"mappings":";;;;;MAiBaA,SAAS,gBAAGC,UAAgB,CAAC,SAASC,KAAKA,CAACC,KAAqB,EAAEC,GAA+B;EAC3G,MAAM;IAAEC,KAAK;IAAEC,IAAI;IAAEC,MAAM;IAAEC,KAAK;IAAE,GAAGC;GAAY,GAAGN,KAAK;EAE3D,MAAMO,SAAS,GAAGC,EAAE,oIACmH,EACnI;IAAE,SAAS,EAAE,CAACH;GAAO,EACrB;IAAE,iBAAiB,EAAEA;GAAO,EAC5B;IAAE,CAACI,0BAA0B,CAACP,KAAK,CAAC,GAAGE,MAAM;IAAE,CAACM,oBAAoB,CAACR,KAAK,CAAC,GAAG,CAACE;GAAQ,EACvFJ,KAAK,CAACO,SAAS,CAClB;EAED,MAAMI,SAAS,GAAG;IACdC,WAAW,EAAE,CAAC;IACdC,MAAM,EAAE;GACX;EAED,oBACIf,wCACQQ,UAAU;kBACH,MAAM;IACjBC,SAAS,EAAEA,SAAS;iBACV,YAAY;IACtBN,GAAG,EAAEA,GAAG;IACRa,IAAI,EAAC,QAAQ;IACbC,KAAK,EAAEf,KAAK,CAAC,YAAY;mBACzBF,cAACkB,IAAI;IAACC,IAAI,EAAEd;KAAUQ,SAAS,EAAI,CAChC;AAEf,CAAC;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { forwardRef, createElement } from 'react';
2
- import cn from 'classnames';
2
+ import cn from 'clsx';
3
3
  import { getBannerIcon } from './util.js';
4
4
  import { IconButton } from '../IconButton/IconButton.js';
5
5
  import { useLocalization } from '../Provider/Localization.js';
@@ -20,7 +20,7 @@ const Banner = /*#__PURE__*/forwardRef(function Banner(props, ref) {
20
20
  ref: ref
21
21
  }, getBannerIcon(state), children, onClose ? ( /*#__PURE__*/createElement(IconButton, {
22
22
  "aria-label": texts.banner.close,
23
- className: "ml-auto -mr-2 self-start",
23
+ className: "-mr-2 ml-auto self-start",
24
24
  icon: "close",
25
25
  appearance: "discrete",
26
26
  onClick: onClose
@@ -1 +1 @@
1
- {"version":3,"file":"Banner.js","sources":["../../../../../../../src/components/Banner/Banner.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport { State } from '../../types';\nimport { getBannerIcon } from './util';\nimport { IconButton } from '../IconButton/IconButton';\nimport { useLocalization } from '../Provider/Localization';\n\nexport type BannerProps = React.HTMLAttributes<HTMLDivElement> & {\n /** Content can be any react element, for e.g. a `div` */\n children: React.ReactNode;\n /** State will change the icon displayed in banner */\n state: State;\n onClose?: () => void;\n};\n\nexport type BannerTexts = {\n /** Aria-label for the close icon button of banner */\n close: string;\n};\n\nexport const Banner = React.forwardRef(function Banner(props: BannerProps, ref: React.Ref<HTMLDivElement>) {\n const { children, state, onClose } = props;\n const { texts } = useLocalization();\n const className = cn('bg-white relative flex items-center gap-2 py-2 px-4 leading-6 shadow-md z-10', props.className);\n\n return (\n <div className={className} data-taco=\"banner\" ref={ref}>\n {getBannerIcon(state)}\n {children}\n {onClose ? (\n <IconButton\n aria-label={texts.banner.close}\n className=\"ml-auto -mr-2 self-start\"\n icon=\"close\"\n appearance=\"discrete\"\n onClick={onClose}\n />\n ) : null}\n </div>\n );\n});\n"],"names":["Banner","React","props","ref","children","state","onClose","texts","useLocalization","className","cn","getBannerIcon","IconButton","banner","close","icon","appearance","onClick"],"mappings":";;;;;;MAoBaA,MAAM,gBAAGC,UAAgB,CAAC,SAASD,MAAMA,CAACE,KAAkB,EAAEC,GAA8B;EACrG,MAAM;IAAEC,QAAQ;IAAEC,KAAK;IAAEC;GAAS,GAAGJ,KAAK;EAC1C,MAAM;IAAEK;GAAO,GAAGC,eAAe,EAAE;EACnC,MAAMC,SAAS,GAAGC,EAAE,CAAC,8EAA8E,EAAER,KAAK,CAACO,SAAS,CAAC;EAErH,oBACIR;IAAKQ,SAAS,EAAEA,SAAS;iBAAY,QAAQ;IAACN,GAAG,EAAEA;KAC9CQ,aAAa,CAACN,KAAK,CAAC,EACpBD,QAAQ,EACRE,OAAO,kBACJL,cAACW,UAAU;kBACKL,KAAK,CAACM,MAAM,CAACC,KAAK;IAC9BL,SAAS,EAAC,0BAA0B;IACpCM,IAAI,EAAC,OAAO;IACZC,UAAU,EAAC,UAAU;IACrBC,OAAO,EAAEX;IACX,IACF,IAAI,CACN;AAEd,CAAC;;;;"}
1
+ {"version":3,"file":"Banner.js","sources":["../../../../../../../src/components/Banner/Banner.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'clsx';\nimport { State } from '../../types';\nimport { getBannerIcon } from './util';\nimport { IconButton } from '../IconButton/IconButton';\nimport { useLocalization } from '../Provider/Localization';\n\nexport type BannerProps = React.HTMLAttributes<HTMLDivElement> & {\n /** Content can be any react element, for e.g. a `div` */\n children: React.ReactNode;\n /** State will change the icon displayed in banner */\n state: State;\n onClose?: () => void;\n};\n\nexport type BannerTexts = {\n /** Aria-label for the close icon button of banner */\n close: string;\n};\n\nexport const Banner = React.forwardRef(function Banner(props: BannerProps, ref: React.Ref<HTMLDivElement>) {\n const { children, state, onClose } = props;\n const { texts } = useLocalization();\n const className = cn('bg-white relative flex items-center gap-2 py-2 px-4 leading-6 shadow-md z-10', props.className);\n\n return (\n <div className={className} data-taco=\"banner\" ref={ref}>\n {getBannerIcon(state)}\n {children}\n {onClose ? (\n <IconButton\n aria-label={texts.banner.close}\n className=\"-mr-2 ml-auto self-start\"\n icon=\"close\"\n appearance=\"discrete\"\n onClick={onClose}\n />\n ) : null}\n </div>\n );\n});\n"],"names":["Banner","React","props","ref","children","state","onClose","texts","useLocalization","className","cn","getBannerIcon","IconButton","banner","close","icon","appearance","onClick"],"mappings":";;;;;;MAoBaA,MAAM,gBAAGC,UAAgB,CAAC,SAASD,MAAMA,CAACE,KAAkB,EAAEC,GAA8B;EACrG,MAAM;IAAEC,QAAQ;IAAEC,KAAK;IAAEC;GAAS,GAAGJ,KAAK;EAC1C,MAAM;IAAEK;GAAO,GAAGC,eAAe,EAAE;EACnC,MAAMC,SAAS,GAAGC,EAAE,CAAC,8EAA8E,EAAER,KAAK,CAACO,SAAS,CAAC;EAErH,oBACIR;IAAKQ,SAAS,EAAEA,SAAS;iBAAY,QAAQ;IAACN,GAAG,EAAEA;KAC9CQ,aAAa,CAACN,KAAK,CAAC,EACpBD,QAAQ,EACRE,OAAO,kBACJL,cAACW,UAAU;kBACKL,KAAK,CAACM,MAAM,CAACC,KAAK;IAC9BL,SAAS,EAAC,0BAA0B;IACpCM,IAAI,EAAC,OAAO;IACZC,UAAU,EAAC,UAAU;IACrBC,OAAO,EAAEX;IACX,IACF,IAAI,CACN;AAEd,CAAC;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { forwardRef, createElement } from 'react';
2
- import cn from 'classnames';
2
+ import cn from 'clsx';
3
3
  import { Icon } from '../Icon/Icon.js';
4
4
  import { createButtonWithOverlays, getButtonClasses, getAppearanceClasses, createButtonWithTooltip } from './util.js';
5
5
 
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sources":["../../../../../../../src/components/Button/Button.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport { Appearance } from '../../types';\nimport * as ButtonPrimitive from '../../primitives/Button';\nimport { getAppearanceClasses, getButtonClasses, createButtonWithTooltip, createButtonWithOverlays } from './util';\nimport { HangerProps } from '../Hanger/Hanger';\nimport { MenuProps } from '../Menu/Menu';\nimport { DialogProps } from '../Dialog/Dialog';\nimport { PopoverProps } from '../Popover/Popover';\nimport './Button.css';\nimport { Icon } from '../Icon/Icon';\nimport { DrawerProps } from '../Drawer/Drawer';\n\nexport type ButtonProps = ButtonPrimitive.ButtonProps & {\n /** Appearance will change the style of the button */\n appearance?: Appearance;\n /**\n * Dialog component associated with the button, clicking the button will open the dialog.\n * *Note* that `onClick` event on button won't be handled, as in this case, the purpose of\n * the button should be only to open the associated dialog when clicked.\n */\n dialog?: (props: Partial<DialogProps>) => JSX.Element;\n /**\n * Drawer component associated with the button, clicking the button will open the drawer.\n * *Note* that `onClick` event on button won't be handled, as in this case, the purpose of\n * the button should be only to open the associated drawer when clicked.\n */\n drawer?: (props: Partial<DrawerProps>) => JSX.Element;\n /** If fluid, button expands to the width of it's container */\n fluid?: boolean;\n /** Hanger component associated with the button. */\n hanger?: (props: Partial<HangerProps>) => JSX.Element;\n /** Menu component associated with the button. */\n menu?: (props: Partial<MenuProps>) => JSX.Element;\n /**\n * Popover component associated with the button, clicking the button will open the popover.\n * *Note* that `onClick` event on button won't be handled, as in this case, the purpose of\n * the button should be only to open the associated popover when clicked.\n */\n popover?: (props: Partial<PopoverProps>) => JSX.Element;\n /** A tooltip to show when hovering over the button */\n tooltip?: string | JSX.Element;\n};\n\nconst Base = React.forwardRef(function ButtonBase(props: ButtonProps, ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>) {\n const { appearance, fluid, ...otherProps } = props;\n const className = cn(\n getButtonClasses(),\n getAppearanceClasses(appearance),\n 'rounded px-3',\n {\n 'w-full': fluid,\n },\n props.className\n );\n\n return createButtonWithTooltip({ ...otherProps, 'data-taco': 'button' }, className, ref);\n});\n\nexport const Button = React.forwardRef(function Button(\n props: ButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>\n) {\n const { dialog, drawer, hanger, menu, popover, ...buttonProps } = props;\n\n let children = buttonProps.children;\n\n // add a chevron icon to menu buttons\n if (typeof menu === 'function') {\n children = Array.isArray(children)\n ? [...children, <Icon key=\"chevron-down\" name=\"chevron-down\" />]\n : [children, <Icon key=\"chevron-down\" name=\"chevron-down\" />];\n }\n\n const button = (\n <Base {...buttonProps} ref={ref}>\n {children}\n </Base>\n );\n\n return createButtonWithOverlays({ dialog, drawer, hanger, menu, popover }, button);\n});\n"],"names":["Base","React","ButtonBase","props","ref","appearance","fluid","otherProps","className","cn","getButtonClasses","getAppearanceClasses","createButtonWithTooltip","Button","dialog","drawer","hanger","menu","popover","buttonProps","children","Array","isArray","Icon","key","name","button","createButtonWithOverlays"],"mappings":";;;;;AA4CA,MAAMA,IAAI,gBAAGC,UAAgB,CAAC,SAASC,UAAUA,CAACC,KAAkB,EAAEC,GAAqD;EACvH,MAAM;IAAEC,UAAU;IAAEC,KAAK;IAAE,GAAGC;GAAY,GAAGJ,KAAK;EAClD,MAAMK,SAAS,GAAGC,EAAE,CAChBC,gBAAgB,EAAE,EAClBC,oBAAoB,CAACN,UAAU,CAAC,EAChC,cAAc,EACd;IACI,QAAQ,EAAEC;GACb,EACDH,KAAK,CAACK,SAAS,CAClB;EAED,OAAOI,uBAAuB,CAAC;IAAE,GAAGL,UAAU;IAAE,WAAW,EAAE;GAAU,EAAEC,SAAS,EAAEJ,GAAG,CAAC;AAC5F,CAAC,CAAC;MAEWS,MAAM,gBAAGZ,UAAgB,CAAC,SAASY,MAAMA,CAClDV,KAAkB,EAClBC,GAAqD;EAErD,MAAM;IAAEU,MAAM;IAAEC,MAAM;IAAEC,MAAM;IAAEC,IAAI;IAAEC,OAAO;IAAE,GAAGC;GAAa,GAAGhB,KAAK;EAEvE,IAAIiB,QAAQ,GAAGD,WAAW,CAACC,QAAQ;;EAGnC,IAAI,OAAOH,IAAI,KAAK,UAAU,EAAE;IAC5BG,QAAQ,GAAGC,KAAK,CAACC,OAAO,CAACF,QAAQ,CAAC,GAC5B,CAAC,GAAGA,QAAQ,eAAEnB,cAACsB,IAAI;MAACC,GAAG,EAAC,cAAc;MAACC,IAAI,EAAC;MAAiB,CAAC,GAC9D,CAACL,QAAQ,eAAEnB,cAACsB,IAAI;MAACC,GAAG,EAAC,cAAc;MAACC,IAAI,EAAC;MAAiB,CAAC;;EAGrE,MAAMC,MAAM,gBACRzB,cAACD,IAAI,oBAAKmB,WAAW;IAAEf,GAAG,EAAEA;MACvBgB,QAAQ,CAEhB;EAED,OAAOO,wBAAwB,CAAC;IAAEb,MAAM;IAAEC,MAAM;IAAEC,MAAM;IAAEC,IAAI;IAAEC;GAAS,EAAEQ,MAAM,CAAC;AACtF,CAAC;;;;"}
1
+ {"version":3,"file":"Button.js","sources":["../../../../../../../src/components/Button/Button.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'clsx';\nimport { Appearance } from '../../types';\nimport * as ButtonPrimitive from '../../primitives/Button';\nimport { getAppearanceClasses, getButtonClasses, createButtonWithTooltip, createButtonWithOverlays } from './util';\nimport { HangerProps } from '../Hanger/Hanger';\nimport { MenuProps } from '../Menu/Menu';\nimport { DialogProps } from '../Dialog/Dialog';\nimport { PopoverProps } from '../Popover/Popover';\nimport './Button.css';\nimport { Icon } from '../Icon/Icon';\nimport { DrawerProps } from '../Drawer/Drawer';\n\nexport type ButtonProps = ButtonPrimitive.ButtonProps & {\n /** Appearance will change the style of the button */\n appearance?: Appearance;\n /**\n * Dialog component associated with the button, clicking the button will open the dialog.\n * *Note* that `onClick` event on button won't be handled, as in this case, the purpose of\n * the button should be only to open the associated dialog when clicked.\n */\n dialog?: (props: Partial<DialogProps>) => JSX.Element;\n /**\n * Drawer component associated with the button, clicking the button will open the drawer.\n * *Note* that `onClick` event on button won't be handled, as in this case, the purpose of\n * the button should be only to open the associated drawer when clicked.\n */\n drawer?: (props: Partial<DrawerProps>) => JSX.Element;\n /** If fluid, button expands to the width of it's container */\n fluid?: boolean;\n /** Hanger component associated with the button. */\n hanger?: (props: Partial<HangerProps>) => JSX.Element;\n /** Menu component associated with the button. */\n menu?: (props: Partial<MenuProps>) => JSX.Element;\n /**\n * Popover component associated with the button, clicking the button will open the popover.\n * *Note* that `onClick` event on button won't be handled, as in this case, the purpose of\n * the button should be only to open the associated popover when clicked.\n */\n popover?: (props: Partial<PopoverProps>) => JSX.Element;\n /** A tooltip to show when hovering over the button */\n tooltip?: string | JSX.Element;\n};\n\nconst Base = React.forwardRef(function ButtonBase(props: ButtonProps, ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>) {\n const { appearance, fluid, ...otherProps } = props;\n const className = cn(\n getButtonClasses(),\n getAppearanceClasses(appearance),\n 'rounded px-3',\n {\n 'w-full': fluid,\n },\n props.className\n );\n\n return createButtonWithTooltip({ ...otherProps, 'data-taco': 'button' }, className, ref);\n});\n\nexport const Button = React.forwardRef(function Button(\n props: ButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>\n) {\n const { dialog, drawer, hanger, menu, popover, ...buttonProps } = props;\n\n let children = buttonProps.children;\n\n // add a chevron icon to menu buttons\n if (typeof menu === 'function') {\n children = Array.isArray(children)\n ? [...children, <Icon key=\"chevron-down\" name=\"chevron-down\" />]\n : [children, <Icon key=\"chevron-down\" name=\"chevron-down\" />];\n }\n\n const button = (\n <Base {...buttonProps} ref={ref}>\n {children}\n </Base>\n );\n\n return createButtonWithOverlays({ dialog, drawer, hanger, menu, popover }, button);\n});\n"],"names":["Base","React","ButtonBase","props","ref","appearance","fluid","otherProps","className","cn","getButtonClasses","getAppearanceClasses","createButtonWithTooltip","Button","dialog","drawer","hanger","menu","popover","buttonProps","children","Array","isArray","Icon","key","name","button","createButtonWithOverlays"],"mappings":";;;;;AA4CA,MAAMA,IAAI,gBAAGC,UAAgB,CAAC,SAASC,UAAUA,CAACC,KAAkB,EAAEC,GAAqD;EACvH,MAAM;IAAEC,UAAU;IAAEC,KAAK;IAAE,GAAGC;GAAY,GAAGJ,KAAK;EAClD,MAAMK,SAAS,GAAGC,EAAE,CAChBC,gBAAgB,EAAE,EAClBC,oBAAoB,CAACN,UAAU,CAAC,EAChC,cAAc,EACd;IACI,QAAQ,EAAEC;GACb,EACDH,KAAK,CAACK,SAAS,CAClB;EAED,OAAOI,uBAAuB,CAAC;IAAE,GAAGL,UAAU;IAAE,WAAW,EAAE;GAAU,EAAEC,SAAS,EAAEJ,GAAG,CAAC;AAC5F,CAAC,CAAC;MAEWS,MAAM,gBAAGZ,UAAgB,CAAC,SAASY,MAAMA,CAClDV,KAAkB,EAClBC,GAAqD;EAErD,MAAM;IAAEU,MAAM;IAAEC,MAAM;IAAEC,MAAM;IAAEC,IAAI;IAAEC,OAAO;IAAE,GAAGC;GAAa,GAAGhB,KAAK;EAEvE,IAAIiB,QAAQ,GAAGD,WAAW,CAACC,QAAQ;;EAGnC,IAAI,OAAOH,IAAI,KAAK,UAAU,EAAE;IAC5BG,QAAQ,GAAGC,KAAK,CAACC,OAAO,CAACF,QAAQ,CAAC,GAC5B,CAAC,GAAGA,QAAQ,eAAEnB,cAACsB,IAAI;MAACC,GAAG,EAAC,cAAc;MAACC,IAAI,EAAC;MAAiB,CAAC,GAC9D,CAACL,QAAQ,eAAEnB,cAACsB,IAAI;MAACC,GAAG,EAAC,cAAc;MAACC,IAAI,EAAC;MAAiB,CAAC;;EAGrE,MAAMC,MAAM,gBACRzB,cAACD,IAAI,oBAAKmB,WAAW;IAAEf,GAAG,EAAEA;MACvBgB,QAAQ,CAEhB;EAED,OAAOO,wBAAwB,CAAC;IAAEb,MAAM;IAAEC,MAAM;IAAEC,MAAM;IAAEC,IAAI;IAAEC;GAAS,EAAEQ,MAAM,CAAC;AACtF,CAAC;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { forwardRef, useState, useEffect, createElement, memo } from 'react';
2
- import cn from 'classnames';
2
+ import cn from 'clsx';
3
3
  import { Tooltip } from '../Tooltip/Tooltip.js';
4
4
  import { IconButton } from '../IconButton/IconButton.js';
5
5
  import { useLocalization } from '../Provider/Localization.js';
@@ -1 +1 @@
1
- {"version":3,"file":"Calendar.js","sources":["../../../../../../../src/components/Calendar/Calendar.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport ReactDayPicker, { NavbarElementProps, Modifier } from 'react-day-picker';\nimport { useLocalization } from '../Provider/Localization';\nimport './Calendar.css';\nimport { IconButton } from '../IconButton/IconButton';\nimport { Tooltip } from '../Tooltip/Tooltip';\n\nexport type CalendarTextsActions = {\n /** Aria-label for previous month action button */\n previousMonth: string;\n /** Aria-label for next month action button */\n nextMonth: string;\n /** Aria-label for previous year action button */\n previousYear: string;\n /** Aria-label for next year action button */\n nextYear: string;\n /** Text displayed within today action button */\n today: string;\n};\n\nexport type CalendarTexts = {\n /** Text and aria-label for action buttons in Calendar */\n actions: CalendarTextsActions;\n /** Text abbreviation for months in Calendar's header, starting with January */\n months: string[];\n /** Text abbreviation for days in Calendar's header, starting with Sunday */\n weekdaysShort: string[];\n /** Text for days in Calendar's header, starting with Sunday */\n weekdays: string[];\n};\n\n/** @internal */\ntype CustomNavbarElementProps = NavbarElementProps & {\n onMonthChange: (month: Date) => void;\n value?: Date;\n};\n\nconst thisYear = new Date().getFullYear();\nconst years: number[] = [];\n\nfor (let i = thisYear - 50; i <= thisYear + 10; i += 1) {\n years.push(i);\n}\n\nconst Navbar = React.memo(\n ({ onMonthChange, onNextClick, onPreviousClick, value = new Date() }: CustomNavbarElementProps): JSX.Element => {\n const {\n texts: {\n calendar: { actions, months },\n },\n } = useLocalization();\n\n const handleChange = function handleChange(event) {\n const { year, month } = event.target.form;\n onMonthChange(new Date(year.value, month.value));\n };\n\n return (\n <div className=\"mb-1 flex items-center justify-between\">\n <form className=\"inline-flex space-x-1\">\n <select className=\"h-8 px-2\" name=\"month\" onChange={handleChange} value={value.getMonth()}>\n {months.map((month, i) => (\n <option key={month} value={i}>\n {month}\n </option>\n ))}\n </select>\n <select className=\"h-8 px-2\" name=\"year\" onChange={handleChange} value={value.getFullYear()}>\n {years.map(year => (\n <option key={year} value={year}>\n {String(year)}\n </option>\n ))}\n </select>\n </form>\n <div>\n <Tooltip title={actions.previousMonth}>\n <IconButton\n appearance=\"discrete\"\n icon=\"chevron-left\"\n aria-label={actions.previousMonth}\n onClick={() => onPreviousClick()}\n rounded\n />\n </Tooltip>\n <Tooltip title={actions.nextMonth}>\n <IconButton\n appearance=\"discrete\"\n icon=\"chevron-right\"\n aria-label={actions.nextMonth}\n onClick={() => onNextClick()}\n rounded\n />\n </Tooltip>\n </div>\n </div>\n );\n }\n);\n\nexport type CalendarProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'value'> & {\n /** Handler called when a day is clicked in calendar */\n onChange: (date: Date, event?: React.MouseEvent<HTMLDivElement>) => void;\n value?: Date;\n disabledDays?: Modifier[];\n};\n\nexport const Calendar = React.forwardRef(function Calendar(props: CalendarProps, ref: React.Ref<ReactDayPicker>) {\n const { onChange: handleChange, value, disabledDays, ...otherProps } = props;\n const { locale, texts } = useLocalization();\n const [visibleMonth, setVisibleMonth] = React.useState(value ?? new Date());\n\n React.useEffect(() => {\n if (visibleMonth !== value) {\n setVisibleMonth(value ?? new Date());\n }\n // visibleMonth in deps array breaking month switching logic. It should not be in deps array.\n }, [value]);\n\n const handleDayClick = (date, modifiers, event) => {\n if (modifiers.outside || modifiers.disabled) {\n return;\n }\n\n handleChange(date, event);\n };\n\n const handleCalendarClickToday = (): void => {\n const today = new Date();\n\n // set to midday to avoid UTC offset causing dates to be mismatched server side\n today.setHours(12);\n today.setMinutes(0);\n today.setSeconds(0);\n\n handleChange(today);\n };\n\n const className = cn('flex bg-white text-xs p-2', otherProps.className);\n\n return (\n <div data-taco=\"calendar\">\n <ReactDayPicker\n {...otherProps}\n className={className}\n month={visibleMonth}\n selectedDays={value}\n locale={locale.substring(0, 2)}\n firstDayOfWeek={1}\n months={texts.calendar.months}\n weekdaysLong={texts.calendar.weekdays}\n weekdaysShort={texts.calendar.weekdaysShort}\n navbarElement={navProps => <Navbar {...navProps} onMonthChange={setVisibleMonth} value={visibleMonth} />}\n onDayClick={handleDayClick}\n onMonthChange={setVisibleMonth}\n onTodayButtonClick={handleCalendarClickToday}\n captionElement={() => null}\n todayButton={texts.calendar.actions.today}\n numberOfMonths={1}\n ref={ref}\n disabledDays={disabledDays}\n />\n </div>\n );\n});\n"],"names":["thisYear","Date","getFullYear","years","i","push","Navbar","React","onMonthChange","onNextClick","onPreviousClick","value","texts","calendar","actions","months","useLocalization","handleChange","event","year","month","target","form","className","name","onChange","getMonth","map","key","String","Tooltip","title","previousMonth","IconButton","appearance","icon","onClick","rounded","nextMonth","Calendar","props","ref","disabledDays","otherProps","locale","visibleMonth","setVisibleMonth","handleDayClick","date","modifiers","outside","disabled","handleCalendarClickToday","today","setHours","setMinutes","setSeconds","cn","ReactDayPicker","selectedDays","substring","firstDayOfWeek","weekdaysLong","weekdays","weekdaysShort","navbarElement","navProps","onDayClick","onTodayButtonClick","captionElement","todayButton","numberOfMonths"],"mappings":";;;;;;;AAsCA,MAAMA,Q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1
+ {"version":3,"file":"Calendar.js","sources":["../../../../../../../src/components/Calendar/Calendar.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'clsx';\nimport ReactDayPicker, { NavbarElementProps, Modifier } from 'react-day-picker';\nimport { useLocalization } from '../Provider/Localization';\nimport './Calendar.css';\nimport { IconButton } from '../IconButton/IconButton';\nimport { Tooltip } from '../Tooltip/Tooltip';\n\nexport type CalendarTextsActions = {\n /** Aria-label for previous month action button */\n previousMonth: string;\n /** Aria-label for next month action button */\n nextMonth: string;\n /** Aria-label for previous year action button */\n previousYear: string;\n /** Aria-label for next year action button */\n nextYear: string;\n /** Text displayed within today action button */\n today: string;\n};\n\nexport type CalendarTexts = {\n /** Text and aria-label for action buttons in Calendar */\n actions: CalendarTextsActions;\n /** Text abbreviation for months in Calendar's header, starting with January */\n months: string[];\n /** Text abbreviation for days in Calendar's header, starting with Sunday */\n weekdaysShort: string[];\n /** Text for days in Calendar's header, starting with Sunday */\n weekdays: string[];\n};\n\n/** @internal */\ntype CustomNavbarElementProps = NavbarElementProps & {\n onMonthChange: (month: Date) => void;\n value?: Date;\n};\n\nconst thisYear = new Date().getFullYear();\nconst years: number[] = [];\n\nfor (let i = thisYear - 50; i <= thisYear + 10; i += 1) {\n years.push(i);\n}\n\nconst Navbar = React.memo(\n ({ onMonthChange, onNextClick, onPreviousClick, value = new Date() }: CustomNavbarElementProps): JSX.Element => {\n const {\n texts: {\n calendar: { actions, months },\n },\n } = useLocalization();\n\n const handleChange = function handleChange(event) {\n const { year, month } = event.target.form;\n onMonthChange(new Date(year.value, month.value));\n };\n\n return (\n <div className=\"mb-1 flex items-center justify-between\">\n <form className=\"inline-flex space-x-1\">\n <select className=\"h-8 px-2\" name=\"month\" onChange={handleChange} value={value.getMonth()}>\n {months.map((month, i) => (\n <option key={month} value={i}>\n {month}\n </option>\n ))}\n </select>\n <select className=\"h-8 px-2\" name=\"year\" onChange={handleChange} value={value.getFullYear()}>\n {years.map(year => (\n <option key={year} value={year}>\n {String(year)}\n </option>\n ))}\n </select>\n </form>\n <div>\n <Tooltip title={actions.previousMonth}>\n <IconButton\n appearance=\"discrete\"\n icon=\"chevron-left\"\n aria-label={actions.previousMonth}\n onClick={() => onPreviousClick()}\n rounded\n />\n </Tooltip>\n <Tooltip title={actions.nextMonth}>\n <IconButton\n appearance=\"discrete\"\n icon=\"chevron-right\"\n aria-label={actions.nextMonth}\n onClick={() => onNextClick()}\n rounded\n />\n </Tooltip>\n </div>\n </div>\n );\n }\n);\n\nexport type CalendarProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'value'> & {\n /** Handler called when a day is clicked in calendar */\n onChange: (date: Date, event?: React.MouseEvent<HTMLDivElement>) => void;\n value?: Date;\n disabledDays?: Modifier[];\n};\n\nexport const Calendar = React.forwardRef(function Calendar(props: CalendarProps, ref: React.Ref<ReactDayPicker>) {\n const { onChange: handleChange, value, disabledDays, ...otherProps } = props;\n const { locale, texts } = useLocalization();\n const [visibleMonth, setVisibleMonth] = React.useState(value ?? new Date());\n\n React.useEffect(() => {\n if (visibleMonth !== value) {\n setVisibleMonth(value ?? new Date());\n }\n // visibleMonth in deps array breaking month switching logic. It should not be in deps array.\n }, [value]);\n\n const handleDayClick = (date, modifiers, event) => {\n if (modifiers.outside || modifiers.disabled) {\n return;\n }\n\n handleChange(date, event);\n };\n\n const handleCalendarClickToday = (): void => {\n const today = new Date();\n\n // set to midday to avoid UTC offset causing dates to be mismatched server side\n today.setHours(12);\n today.setMinutes(0);\n today.setSeconds(0);\n\n handleChange(today);\n };\n\n const className = cn('flex bg-white text-xs p-2', otherProps.className);\n\n return (\n <div data-taco=\"calendar\">\n <ReactDayPicker\n {...otherProps}\n className={className}\n month={visibleMonth}\n selectedDays={value}\n locale={locale.substring(0, 2)}\n firstDayOfWeek={1}\n months={texts.calendar.months}\n weekdaysLong={texts.calendar.weekdays}\n weekdaysShort={texts.calendar.weekdaysShort}\n navbarElement={navProps => <Navbar {...navProps} onMonthChange={setVisibleMonth} value={visibleMonth} />}\n onDayClick={handleDayClick}\n onMonthChange={setVisibleMonth}\n onTodayButtonClick={handleCalendarClickToday}\n captionElement={() => null}\n todayButton={texts.calendar.actions.today}\n numberOfMonths={1}\n ref={ref}\n disabledDays={disabledDays}\n />\n </div>\n );\n});\n"],"names":["thisYear","Date","getFullYear","years","i","push","Navbar","React","onMonthChange","onNextClick","onPreviousClick","value","texts","calendar","actions","months","useLocalization","handleChange","event","year","month","target","form","className","name","onChange","getMonth","map","key","String","Tooltip","title","previousMonth","IconButton","appearance","icon","onClick","rounded","nextMonth","Calendar","props","ref","disabledDays","otherProps","locale","visibleMonth","setVisibleMonth","handleDayClick","date","modifiers","outside","disabled","handleCalendarClickToday","today","setHours","setMinutes","setSeconds","cn","ReactDayPicker","selectedDays","substring","firstDayOfWeek","weekdaysLong","weekdays","weekdaysShort","navbarElement","navProps","onDayClick","onTodayButtonClick","captionElement","todayButton","numberOfMonths"],"mappings":";;;;;;;AAsCA,MAAMA,QAAQ,gBAAG,IAAIC,IAAI,EAAE,CAACC,WAAW,EAAE;AACzC,MAAMC,KAAK,GAAa,EAAE;AAE1B,KAAK,IAAIC,CAAC,GAAGJ,QAAQ,GAAG,EAAE,EAAEI,CAAC,IAAIJ,QAAQ,GAAG,EAAE,EAAEI,CAAC,IAAI,CAAC,EAAE;EACpDD,KAAK,CAACE,IAAI,CAACD,CAAC,CAAC;;AAGjB,MAAME,MAAM,gBAAGC,IAAU,CACrB,CAAC;EAAEC,aAAa;EAAEC,WAAW;EAAEC,eAAe;EAAEC,KAAK,GAAG,IAAIV,IAAI;CAA8B;EAC1F,MAAM;IACFW,KAAK,EAAE;MACHC,QAAQ,EAAE;QAAEC,OAAO;QAAEC;;;GAE5B,GAAGC,eAAe,EAAE;EAErB,MAAMC,YAAY,GAAG,SAASA,YAAYA,CAACC,KAAK;IAC5C,MAAM;MAAEC,IAAI;MAAEC;KAAO,GAAGF,KAAK,CAACG,MAAM,CAACC,IAAI;IACzCd,aAAa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AC9BC,cAAc,EAAE,CAAC;IACjB9C,MAAM,EAAEH,KAAK,CAACC,QAAQ,CAACE,MAAM;IAC7B+C,YAAY,EAAElD,KAAK,CAACC,QAAQ,CAACkD,QAAQ;IACrCC,aAAa,EAAEpD,KAAK,CAACC,QAAQ,CAACmD,aAAa;IAC3CC,aAAa,EAAEC,QAAQ,iBAAI3D,cAACD,MAAM,oBAAK4D,QAAQ;MAAE1D,aAAa,EAAEsC,eAAe;MAAEnC,KAAK,EAAEkC;OAAgB;IACxGsB,UAAU,EAAEpB,cAAc;IAC1BvC,aAAa,EAAEsC,eAAe;IAC9BsB,kBAAkB,EAAEhB,wBAAwB;IAC5CiB,cAAc,EAAEA,MAAM,IAAI;IAC1BC,WAAW,EAAE1D,KAAK,CAACC,QAAQ,CAACC,OAAO,CAACuC,KAAK;IACzCkB,cAAc,EAAE,CAAC;IACjB9B,GAAG,EAAEA,GAAG;IACRC,YAAY,EAAEA;KAChB,CACA;AAEd,CAAC;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { forwardRef, createElement } from 'react';
2
- import cn from 'classnames';
2
+ import cn from 'clsx';
3
3
  import { IconButton } from '../IconButton/IconButton.js';
4
4
 
5
5
  const Content = /*#__PURE__*/forwardRef(function CardContent(externalProps, ref) {
@@ -27,7 +27,7 @@ const Card = /*#__PURE__*/forwardRef(function Card(props, ref) {
27
27
  "data-taco": "card",
28
28
  ref: ref
29
29
  }, /*#__PURE__*/createElement("div", {
30
- className: "mx-4 mt-4 mb-2 flex"
30
+ className: "mx-4 mb-2 mt-4 flex"
31
31
  }, title && /*#__PURE__*/createElement("h4", {
32
32
  className: "mb-0 flex-grow text-left"
33
33
  }, title), menu ? /*#__PURE__*/createElement(IconButton, {
@@ -1 +1 @@
1
- {"version":3,"file":"Card.js","sources":["../../../../../../../src/components/Card/Card.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\n\nimport { MenuProps } from '../Menu/Menu';\nimport { IconButton } from '../IconButton/IconButton';\n\nexport type CardContentProps = React.HTMLAttributes<HTMLDivElement> & {\n noPadding?: boolean;\n};\n\nconst Content = React.forwardRef<HTMLDivElement, CardContentProps>(function CardContent(externalProps, ref) {\n const { noPadding, ...props } = externalProps;\n const className = cn(\n 'flex-grow overflow-auto',\n {\n 'mx-4 mb-4': !noPadding,\n },\n props.className\n );\n return <div {...props} className={className} ref={ref} />;\n});\n\nexport type CardProps = React.HTMLAttributes<HTMLDivElement> & {\n /** Title of the Card */\n title: string | React.ReactElement;\n /** Menu component associated with the Card */\n menu?: (props: Partial<MenuProps>) => JSX.Element;\n};\n\nexport const Card = React.forwardRef<HTMLDivElement, CardProps>(function Card(props, ref) {\n const { title, menu, children } = props;\n const className = cn(\n 'bg-white flex flex-col rounded-xl border border-solid border-radius-[12px] border-grey-300 hover:border-grey-500',\n props.className\n );\n\n return (\n <div className={className} data-taco=\"card\" ref={ref}>\n <div className=\"mx-4 mt-4 mb-2 flex\">\n {title && <h4 className=\"mb-0 flex-grow text-left\">{title}</h4>}\n {menu ? <IconButton icon=\"ellipsis-horizontal\" appearance=\"discrete\" menu={menu} className=\"-mt-[4px]\" /> : null}\n </div>\n {children}\n </div>\n );\n}) as React.ForwardRefExoticComponent<CardProps> & {\n Content: React.ForwardRefExoticComponent<CardContentProps>;\n};\nCard.Content = Content;\n"],"names":["Content","React","CardContent","externalProps","ref","noPadding","props","className","cn","Card","title","menu","children","IconButton","icon","appearance"],"mappings":";;;;AAUA,MAAMA,OAAO,gBAAGC,UAAgB,CAAmC,SAASC,WAAWA,CAACC,aAAa,EAAEC,GAAG;EACtG,MAAM;IAAEC,SAAS;IAAE,GAAGC;GAAO,GAAGH,aAAa;EAC7C,MAAMI,SAAS,GAAGC,EAAE,CAChB,yBAAyB,EACzB;IACI,WAAW,EAAE,CAACH;GACjB,EACDC,KAAK,CAACC,SAAS,CAClB;EACD,oBAAON,uCAASK,KAAK;IAAEC,SAAS,EAAEA,SAAS;IAAEH,GAAG,EAAEA;KAAO;AAC7D,CAAC,CAAC;MASWK,IAAI,gBAAGR,UAAgB,CAA4B,SAASQ,IAAIA,CAACH,KAAK,EAAEF,GAAG;EACpF,MAAM;IAAEM,KAAK;IAAEC,IAAI;IAAEC;GAAU,GAAGN,KAAK;EACvC,MAAMC,SAAS,GAAGC,EAAE,CAChB,kHAAkH,EAClHF,KAAK,CAACC,SAAS,CAClB;EAED,oBACIN;IAAKM,SAAS,EAAEA,SAAS;iBAAY,MAAM;IAACH,GAAG,EAAEA;kBAC7CH;IAAKM,SAAS,EAAC;KACVG,KAAK,iBAAIT;IAAIM,SAAS,EAAC;KAA4BG,KAAK,CAAM,EAC9DC,IAAI,gBAAGV,cAACY,UAAU;IAACC,IAAI,EAAC,qBAAqB;IAACC,UAAU,EAAC,UAAU;IAACJ,IAAI,EAAEA,IAAI;IAAEJ,SAAS,EAAC;IAAc,GAAG,IAAI,CAC9G,EACLK,QAAQ,CACP;AAEd,CAAC;AAGDH,IAAI,CAACT,OAAO,GAAGA,OAAO;;;;"}
1
+ {"version":3,"file":"Card.js","sources":["../../../../../../../src/components/Card/Card.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'clsx';\n\nimport { MenuProps } from '../Menu/Menu';\nimport { IconButton } from '../IconButton/IconButton';\n\nexport type CardContentProps = React.HTMLAttributes<HTMLDivElement> & {\n noPadding?: boolean;\n};\n\nconst Content = React.forwardRef<HTMLDivElement, CardContentProps>(function CardContent(externalProps, ref) {\n const { noPadding, ...props } = externalProps;\n const className = cn(\n 'flex-grow overflow-auto',\n {\n 'mx-4 mb-4': !noPadding,\n },\n props.className\n );\n return <div {...props} className={className} ref={ref} />;\n});\n\nexport type CardProps = React.HTMLAttributes<HTMLDivElement> & {\n /** Title of the Card */\n title: string | React.ReactElement;\n /** Menu component associated with the Card */\n menu?: (props: Partial<MenuProps>) => JSX.Element;\n};\n\nexport const Card = React.forwardRef<HTMLDivElement, CardProps>(function Card(props, ref) {\n const { title, menu, children } = props;\n const className = cn(\n 'bg-white flex flex-col rounded-xl border border-solid border-radius-[12px] border-grey-300 hover:border-grey-500',\n props.className\n );\n\n return (\n <div className={className} data-taco=\"card\" ref={ref}>\n <div className=\"mx-4 mb-2 mt-4 flex\">\n {title && <h4 className=\"mb-0 flex-grow text-left\">{title}</h4>}\n {menu ? <IconButton icon=\"ellipsis-horizontal\" appearance=\"discrete\" menu={menu} className=\"-mt-[4px]\" /> : null}\n </div>\n {children}\n </div>\n );\n}) as React.ForwardRefExoticComponent<CardProps> & {\n Content: React.ForwardRefExoticComponent<CardContentProps>;\n};\nCard.Content = Content;\n"],"names":["Content","React","CardContent","externalProps","ref","noPadding","props","className","cn","Card","title","menu","children","IconButton","icon","appearance"],"mappings":";;;;AAUA,MAAMA,OAAO,gBAAGC,UAAgB,CAAmC,SAASC,WAAWA,CAACC,aAAa,EAAEC,GAAG;EACtG,MAAM;IAAEC,SAAS;IAAE,GAAGC;GAAO,GAAGH,aAAa;EAC7C,MAAMI,SAAS,GAAGC,EAAE,CAChB,yBAAyB,EACzB;IACI,WAAW,EAAE,CAACH;GACjB,EACDC,KAAK,CAACC,SAAS,CAClB;EACD,oBAAON,uCAASK,KAAK;IAAEC,SAAS,EAAEA,SAAS;IAAEH,GAAG,EAAEA;KAAO;AAC7D,CAAC,CAAC;MASWK,IAAI,gBAAGR,UAAgB,CAA4B,SAASQ,IAAIA,CAACH,KAAK,EAAEF,GAAG;EACpF,MAAM;IAAEM,KAAK;IAAEC,IAAI;IAAEC;GAAU,GAAGN,KAAK;EACvC,MAAMC,SAAS,GAAGC,EAAE,CAChB,kHAAkH,EAClHF,KAAK,CAACC,SAAS,CAClB;EAED,oBACIN;IAAKM,SAAS,EAAEA,SAAS;iBAAY,MAAM;IAACH,GAAG,EAAEA;kBAC7CH;IAAKM,SAAS,EAAC;KACVG,KAAK,iBAAIT;IAAIM,SAAS,EAAC;KAA4BG,KAAK,CAAM,EAC9DC,IAAI,gBAAGV,cAACY,UAAU;IAACC,IAAI,EAAC,qBAAqB;IAACC,UAAU,EAAC,UAAU;IAACJ,IAAI,EAAEA,IAAI;IAAEJ,SAAS,EAAC;IAAc,GAAG,IAAI,CAC9G,EACLK,QAAQ,CACP;AAEd,CAAC;AAGDH,IAAI,CAACT,OAAO,GAAGA,OAAO;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { forwardRef, createElement } from 'react';
2
- import cn from 'classnames';
2
+ import cn from 'clsx';
3
3
  import { Icon } from '../Icon/Icon.js';
4
4
  import { Root, Indicator } from '@radix-ui/react-checkbox';
5
5
  import { useId } from '../../hooks/useId.js';
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.js","sources":["../../../../../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox';\nimport { Icon } from '../Icon/Icon';\nimport { useId } from '../../hooks/useId';\n\ntype CheckedState = boolean | 'indeterminate';\n\ntype CheckboxBaseProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'onChange'> & {\n /**\n * Indeterminate state should only be used with sub-checkboxes. The indeterminate state is shown if not all\n * sub-checkboxes are selected. This only affects the style, changing the icon in the checkbox.\n */\n indeterminate?: boolean;\n /* Whether the checkbox is in an invalid state */\n invalid?: boolean;\n /** Label for the checkbox */\n label?: React.ReactNode;\n /* Whether user input is required */\n required?: boolean;\n};\n\ninterface UncontrolledCheckboxProps extends CheckboxBaseProps {\n checked?: never;\n onChange?: never;\n /* The default checked state (uncontrolled) */\n defaultChecked?: boolean;\n}\n\ninterface ControlledCheckboxProps extends CheckboxBaseProps {\n defaultChecked?: never;\n /* The current checked state (controlled) */\n checked: boolean;\n /* Handler called when the checked state changes */\n onChange: (checked: boolean) => void;\n}\n\nexport type CheckboxProps = UncontrolledCheckboxProps | ControlledCheckboxProps;\n\nexport const Checkbox = React.forwardRef(function Checkbox(props: CheckboxProps, ref: React.Ref<HTMLButtonElement>) {\n const { checked, indeterminate, invalid, label, onChange, ...otherProps } = props;\n const id = useId(props.id);\n\n const className = cn(\n 'bg-white h-5 w-5 border rounded text-sm flex-shrink-0 mt-[0.1rem] focus-visible:yt-focus disabled:cursor-not-allowed text-white',\n {\n 'self-start': !!label,\n },\n invalid\n ? {\n 'border-red-500 hover:border-red-700 aria-checked:border-red-500 aria-checked-mixed:border-red-500 aria-checked:bg-red-500 aria-checked-mixed:bg-red-500 aria-checked:hover:border-red-700 aria-checked-mixed:hover:border-red-700 aria-checked:hover:bg-red-700 aria-checked-mixed:hover:bg-red-700':\n !props.disabled,\n 'border-red-500/50 aria-checked:wcag-red-500/50 aria-checked-mixed:wcag-red-500/50': props.disabled,\n }\n : {\n 'border-grey-500 hover:border-grey-700 aria-checked:border-blue-500 aria-checked-mixed:border-blue-500 aria-checked:bg-blue-500 aria-checked-mixed:bg-blue-500 aria-checked:hover:border-blue-700 aria-checked-mixed:hover:border-blue-700 aria-checked:hover:bg-blue-700 aria-checked-mixed:hover:bg-blue-700':\n !props.disabled,\n 'border-grey-500/50 aria-checked:bg-blue-500/50 aria-checked-mixed:bg-blue-500/50': props.disabled,\n },\n props.className\n );\n\n let handleChange: ((checked: CheckedState) => void) | undefined;\n\n if (onChange) {\n handleChange = (checked: CheckedState) => onChange(checked === 'indeterminate' ? false : checked);\n }\n\n let labelledByProps: Record<string, string> | null = null;\n\n if (label) {\n labelledByProps = {\n 'aria-labelledby': `${id}-label`,\n id,\n };\n }\n\n // the enter keyboard shortcut isn't supported by default, but we want it\n const handleKeyDown = (event: React.KeyboardEvent<HTMLButtonElement>) => {\n if (event.key === 'Enter') {\n event.currentTarget.click();\n }\n };\n\n const element = (\n <CheckboxPrimitive.Root\n {...otherProps}\n {...labelledByProps}\n aria-invalid={invalid ? 'true' : undefined}\n data-taco=\"checkbox\"\n checked={indeterminate ? 'indeterminate' : checked}\n className={className}\n onCheckedChange={handleChange}\n onKeyDown={handleKeyDown}\n ref={ref}>\n <CheckboxPrimitive.Indicator className=\"flex h-full w-full\">\n <Icon name={indeterminate ? 'line' : 'tick'} className=\"!h-full !w-full\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n\n if (label) {\n const labelContainerClassName = cn('flex items-center cursor-pointer gap-2', {\n 'cursor-not-allowed text-grey-300': props.disabled,\n });\n\n return (\n <span className={labelContainerClassName} data-taco=\"checkbox-container\">\n {element}\n <label htmlFor={id} id={`${id}-label`}>\n {label}\n </label>\n </span>\n );\n }\n\n return element;\n});\nCheckbox.displayName = 'Checkbox';\n"],"names":["Checkbox","React","props","ref","checked","indeterminate","invalid","label","onChange","otherProps","id","useId","className","cn","disabled","handleChange","labelledByProps","handleKeyDown","event","key","currentTarget","click","element","CheckboxPrimitive","undefined","onCheckedChange","onKeyDown","Icon","name","labelContainerClassName","htmlFor","displayName"],"mappings":";;;;;;MAuCaA,QAAQ,gBAAGC,UAAgB,CAAC,SAASD,QAAQA,CAACE,KAAoB,EAAEC,GAAiC;EAC9G,MAAM;IAAEC,OAAO;IAAEC,aAAa;IAAEC,OAAO;IAAEC,KAAK;IAAEC,QAAQ;IAAE,GAAGC;GAAY,GAAGP,KAAK;EACjF,MAAMQ,EAAE,GAAGC,KAAK,CAACT,KAAK,CAACQ,EAAE,CAAC;EAE1B,MAAME,SAAS,GAAGC,EAAE,CAChB,iIAAiI,EACjI;IACI,YAAY,EAAE,CAAC,CAACN;GACnB,EACDD,OAAO,GACD;IACI,qSAAqS,EACjS,CAACJ,KAAK,CAACY,QAAQ;IACnB,mFAAmF,EAAEZ,KAAK,CAACY;GAC9F,GACD;IACI,+SAA+S,EAC3S,CAACZ,KAAK,CAACY,QAAQ;IACnB,kFAAkF,EAAEZ,KAAK,CAACY;GAC7F,EACPZ,KAAK,CAACU,SAAS,CAClB;EAED,IAAIG,YAA2D;EAE/D,IAAIP,QAAQ,EAAE;IACVO,YAAY,GAAIX,OAAqB,IAAKI,QAAQ,CAACJ,OAAO,KAAK,eAAe,GAAG,KAAK,GAAGA,OAAO,CAAC;;EAGrG,IAAIY,eAAe,GAAkC,IAAI;EAEzD,IAAIT,KAAK,EAAE;IACPS,eAAe,GAAG;MACd,iBAAiB,KAAKN,UAAU;MAChCA;KACH;;;EAIL,MAAMO,aAAa,GAAIC,KAA6C;IAChE,IAAIA,KAAK,CAACC,GAAG,KAAK,OAAO,EAAE;MACvBD,KAAK,CAACE,aAAa,CAACC,KAAK,EAAE;;GAElC;EAED,MAAMC,OAAO,gBACTrB,cAACsB,IAAsB,oBACfd,UAAU,EACVO,eAAe;oBACLV,OAAO,GAAG,MAAM,GAAGkB,SAAS;iBAChC,UAAU;IACpBpB,OAAO,EAAEC,aAAa,GAAG,eAAe,GAAGD,OAAO;IAClDQ,SAAS,EAAEA,SAAS;IACpBa,eAAe,EAAEV,YAAY;IAC7BW,SAAS,EAAET,aAAa;IACxBd,GAAG,EAAEA;mBACLF,cAACsB,SAA2B;IAACX,SAAS,EAAC;kBACnCX,cAAC0B,IAAI;IAACC,IAAI,EAAEvB,aAAa,GAAG,MAAM,GAAG,MAAM;IAAEO,SAAS,EAAC;IAAoB,CACjD,CAErC;EAED,IAAIL,KAAK,EAAE;IACP,MAAMsB,uBAAuB,GAAGhB,EAAE,CAAC,wCAAwC,EAAE;MACzE,kCAAkC,EAAEX,KAAK,CAACY;KAC7C,CAAC;IAEF,oBACIb;MAAMW,SAAS,EAAEiB,uBAAuB;mBAAY;OAC/CP,OAAO,eACRrB;MAAO6B,OAAO,EAAEpB,EAAE;MAAEA,EAAE,KAAKA;OACtBH,KAAK,CACF,CACL;;EAIf,OAAOe,OAAO;AAClB,CAAC;AACDtB,QAAQ,CAAC+B,WAAW,GAAG,UAAU;;;;"}
1
+ {"version":3,"file":"Checkbox.js","sources":["../../../../../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'clsx';\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox';\nimport { Icon } from '../Icon/Icon';\nimport { useId } from '../../hooks/useId';\n\ntype CheckedState = boolean | 'indeterminate';\n\ntype CheckboxBaseProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'onChange'> & {\n /**\n * Indeterminate state should only be used with sub-checkboxes. The indeterminate state is shown if not all\n * sub-checkboxes are selected. This only affects the style, changing the icon in the checkbox.\n */\n indeterminate?: boolean;\n /* Whether the checkbox is in an invalid state */\n invalid?: boolean;\n /** Label for the checkbox */\n label?: React.ReactNode;\n /* Whether user input is required */\n required?: boolean;\n};\n\ninterface UncontrolledCheckboxProps extends CheckboxBaseProps {\n checked?: never;\n onChange?: never;\n /* The default checked state (uncontrolled) */\n defaultChecked?: boolean;\n}\n\ninterface ControlledCheckboxProps extends CheckboxBaseProps {\n defaultChecked?: never;\n /* The current checked state (controlled) */\n checked: boolean;\n /* Handler called when the checked state changes */\n onChange: (checked: boolean) => void;\n}\n\nexport type CheckboxProps = UncontrolledCheckboxProps | ControlledCheckboxProps;\n\nexport const Checkbox = React.forwardRef(function Checkbox(props: CheckboxProps, ref: React.Ref<HTMLButtonElement>) {\n const { checked, indeterminate, invalid, label, onChange, ...otherProps } = props;\n const id = useId(props.id);\n\n const className = cn(\n 'bg-white h-5 w-5 border rounded text-sm flex-shrink-0 mt-[0.1rem] focus-visible:yt-focus disabled:cursor-not-allowed text-white',\n {\n 'self-start': !!label,\n },\n invalid\n ? {\n 'border-red-500 hover:border-red-700 aria-checked:border-red-500 aria-checked-mixed:border-red-500 aria-checked:bg-red-500 aria-checked-mixed:bg-red-500 aria-checked:hover:border-red-700 aria-checked-mixed:hover:border-red-700 aria-checked:hover:bg-red-700 aria-checked-mixed:hover:bg-red-700':\n !props.disabled,\n 'border-red-500/50 aria-checked:wcag-red-500/50 aria-checked-mixed:wcag-red-500/50': props.disabled,\n }\n : {\n 'border-grey-500 hover:border-grey-700 aria-checked:border-blue-500 aria-checked-mixed:border-blue-500 aria-checked:bg-blue-500 aria-checked-mixed:bg-blue-500 aria-checked:hover:border-blue-700 aria-checked-mixed:hover:border-blue-700 aria-checked:hover:bg-blue-700 aria-checked-mixed:hover:bg-blue-700':\n !props.disabled,\n 'border-grey-500/50 aria-checked:bg-blue-500/50 aria-checked-mixed:bg-blue-500/50': props.disabled,\n },\n props.className\n );\n\n let handleChange: ((checked: CheckedState) => void) | undefined;\n\n if (onChange) {\n handleChange = (checked: CheckedState) => onChange(checked === 'indeterminate' ? false : checked);\n }\n\n let labelledByProps: Record<string, string> | null = null;\n\n if (label) {\n labelledByProps = {\n 'aria-labelledby': `${id}-label`,\n id,\n };\n }\n\n // the enter keyboard shortcut isn't supported by default, but we want it\n const handleKeyDown = (event: React.KeyboardEvent<HTMLButtonElement>) => {\n if (event.key === 'Enter') {\n event.currentTarget.click();\n }\n };\n\n const element = (\n <CheckboxPrimitive.Root\n {...otherProps}\n {...labelledByProps}\n aria-invalid={invalid ? 'true' : undefined}\n data-taco=\"checkbox\"\n checked={indeterminate ? 'indeterminate' : checked}\n className={className}\n onCheckedChange={handleChange}\n onKeyDown={handleKeyDown}\n ref={ref}>\n <CheckboxPrimitive.Indicator className=\"flex h-full w-full\">\n <Icon name={indeterminate ? 'line' : 'tick'} className=\"!h-full !w-full\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n\n if (label) {\n const labelContainerClassName = cn('flex items-center cursor-pointer gap-2', {\n 'cursor-not-allowed text-grey-300': props.disabled,\n });\n\n return (\n <span className={labelContainerClassName} data-taco=\"checkbox-container\">\n {element}\n <label htmlFor={id} id={`${id}-label`}>\n {label}\n </label>\n </span>\n );\n }\n\n return element;\n});\nCheckbox.displayName = 'Checkbox';\n"],"names":["Checkbox","React","props","ref","checked","indeterminate","invalid","label","onChange","otherProps","id","useId","className","cn","disabled","handleChange","labelledByProps","handleKeyDown","event","key","currentTarget","click","element","CheckboxPrimitive","undefined","onCheckedChange","onKeyDown","Icon","name","labelContainerClassName","htmlFor","displayName"],"mappings":";;;;;;MAuCaA,QAAQ,gBAAGC,UAAgB,CAAC,SAASD,QAAQA,CAACE,KAAoB,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AC0B,IAAI;IAACC,IAAI,EAAEvB,aAAa,GAAG,MAAM,GAAG,MAAM;IAAEO,SAAS,EAAC;IAAoB,CACjD,CAErC;EAED,IAAIL,KAAK,EAAE;IACP,MAAMsB,uBAAuB,GAAGhB,EAAE,CAAC,wCAAwC,EAAE;MACzE,kCAAkC,EAAEX,KAAK,CAACY;KAC7C,CAAC;IAEF,oBACIb;MAAMW,SAAS,EAAEiB,uBAAuB;mBAAY;OAC/CP,OAAO,eACRrB;MAAO6B,OAAO,EAAEpB,EAAE;MAAEA,EAAE,KAAKA;OACtBH,KAAK,CACF,CACL;;EAIf,OAAOe,OAAO;AAClB,CAAC;AACDtB,QAAQ,CAAC+B,WAAW,GAAG,UAAU;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { forwardRef, useRef, createElement } from 'react';
2
- import cn from 'classnames';
2
+ import cn from 'clsx';
3
3
  import { IconButton } from '../IconButton/IconButton.js';
4
4
  import { useLocalization } from '../Provider/Localization.js';
5
5
  import { Root, Anchor, Portal, Content } from '@radix-ui/react-popover';
@@ -1 +1 @@
1
- {"version":3,"file":"Combobox.js","sources":["../../../../../../../src/components/Combobox/Combobox.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\nimport { Input, InputProps } from '../Input/Input';\nimport { useCombobox } from './useCombobox';\nimport { ScrollableList, ScrollableListItem, ScrollableListItemValue } from '../Listbox/ScrollableList';\nimport { useBoundingClientRectListener } from '../../hooks/useBoundingClientRectListener';\nimport { IconButton } from '../IconButton/IconButton';\nimport './Combobox.css';\nimport { DialogProps } from '../Dialog/Dialog';\nimport { useLocalization } from '../Provider/Localization';\n\nexport type ComboboxTexts = {\n /* Tooltip shown for the dialog button */\n tooltip: string;\n};\n\nexport type ComboboxItem = ScrollableListItem;\nexport type ComboboxValue = ScrollableListItemValue;\n\ntype ComboboxBaseProps = Omit<InputProps, 'defaultValue' | 'button' | 'onChange' | 'value'> & {\n /** Array of options in combobox */\n data?: ComboboxItem[];\n /**\n * Initial value of the input in combobox.\n * This is used when combobox is mounted, if no value is provided.\n * *Note* that combobox is a controlled component, setting this will also trigger the `onChange` event\n */\n defaultValue?: ComboboxValue;\n /** Set what value should have an empty option in combobox */\n emptyValue?: ComboboxValue;\n /** Draws attention to the combobox by changing its style and making it visually prominent */\n highlighted?: boolean;\n /** Displays loading state in listbox */\n loading?: boolean;\n /**\n * Handler called when user chooses an option from the provided suggestions.\n * Suggestions will be calculated based on the input value.\n * There are two ways to choose an option: either click on it, or navigate using keyboard and press `enter`\n */\n onChange?: React.ChangeEventHandler<HTMLInputElement>;\n /** Handler called when the user enters a query **/\n onSearch?: (query: string) => void | Promise<void>;\n /** Value of the input in combobox */\n value?: ComboboxValue;\n};\n\ninterface InlineComboboxProps extends ComboboxBaseProps {\n dialog?: never;\n /**\n * Combobox will display its data when input is clicked/focused, even if the input is empty.\n * *Note* that default combobox will display matching data only when user starts typing in input.\n */\n inline: boolean; // Example 3 on https://www.w3.org/TR/wai-aria-practices/examples/combobox/aria1.1pattern/listbox-combo.html\n}\n\ninterface DialogComboboxProps extends ComboboxBaseProps {\n dialog: (props: Partial<DialogProps>) => JSX.Element;\n inline?: never;\n}\n\nexport type ComboboxProps = InlineComboboxProps | DialogComboboxProps;\n\nexport const Combobox = React.forwardRef(function Combobox(props: ComboboxProps, ref: React.Ref<HTMLInputElement>) {\n const { className: externalClassName, dialog, style, ...otherProps } = props;\n const { combobox, button, input, popover, list } = useCombobox(otherProps, ref);\n const internalRef = React.useRef<HTMLDivElement>(null);\n const { texts } = useLocalization();\n const selectDimensions = useBoundingClientRectListener(internalRef);\n const className = cn(\n 'inline-flex relative',\n {\n 'yt-combobox--inline': props.inline,\n },\n externalClassName\n );\n\n return (\n <span className={className} data-taco=\"combobox\" style={style}>\n <PopoverPrimitive.Root {...popover}>\n <PopoverPrimitive.Anchor asChild ref={internalRef}>\n <div {...combobox} className=\"inline w-full\" ref={ref}>\n <Input\n {...input}\n autoComplete=\"off\"\n button={\n props.inline ? (\n <IconButton\n // In case of inline combobox, this icon button acts only as visual chevron representation,\n // so should be taken out of screen reader scope.\n aria-hidden\n appearance=\"discrete\"\n className=\"!border-l-0 focus:!border-none focus:!shadow-none active:!border-none\"\n icon={popover.open ? 'chevron-up' : 'chevron-down'}\n onClick={() => {\n popover.onOpenChange(true);\n input.ref.current?.focus();\n }}\n tabIndex={-1}\n />\n ) : dialog ? (\n <IconButton\n aria-label={texts.combobox.tooltip}\n icon=\"list-search\"\n disabled={props.readOnly || props.disabled}\n dialog={dialog}\n onFocus={(event: React.FocusEvent<HTMLButtonElement>) => {\n // Prevents the default focus behaviour of showing the tooltip, on parent tooltip element\n event.preventDefault();\n input.ref.current?.focus();\n }}\n ref={button.ref}\n tabIndex={-1}\n tooltip={texts.combobox.tooltip}\n />\n ) : undefined\n }\n />\n </div>\n </PopoverPrimitive.Anchor>\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n align=\"start\"\n onOpenAutoFocus={event => {\n event.preventDefault();\n }}\n sideOffset={4}>\n <ScrollableList\n {...list}\n className={cn('max-h-[calc(12rem+2px)] w-auto max-w-[theme(spacing.96)] !border-blue-500')}\n style={{ minWidth: selectDimensions?.width }}\n tabIndex={popover.open ? 0 : -1}\n />\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n </PopoverPrimitive.Root>\n </span>\n );\n});\n"],"names":["Combobox","React","props","ref","className","externalClassName","dialog","style","otherProps","combobox","button","input","popover","list","useCombobox","internalRef","texts","useLocalization","selectDimensions","useBoundingClientRectListener","cn","inline","PopoverPrimitive","asChild","Input","autoComplete","IconButton","appearance","icon","open","onClick","onOpenChange","_input$ref$current","current","focus","tabIndex","tooltip","disabled","readOnly","onFocus","event","preventDefault","_input$ref$current2","undefined","align","onOpenAutoFocus","sideOffset","ScrollableList","minWidth","width"],"mappings":";;;;;;;;;;MA+DaA,QAAQ,gBAAGC,UAAgB,CAAC,SAASD,QAAQA,CAACE,KA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,UAAU;oBACKV,KAAK,CAACP,QAAQ,CAAC2B,OAAO;MAClCR,IAAI,EAAC,aAAa;MAClBS,QAAQ,EAAEnC,KAAK,CAACoC,QAAQ,IAAIpC,KAAK,CAACmC,QAAQ;MAC1C/B,MAAM,EAAEA,MAAM;MACdiC,OAAO,EAAGC,KAA0C;;;QAEhDA,KAAK,CAACC,cAAc,EAAE;QACtB,CAAAC,mBAAA,GAAA/B,KAAK,CAACR,GAAG,CAAC8B,OAAO,cAAAS,mBAAA,uBAAjBA,mBAAA,CAAmBR,KAAK,EAAE;OAC7B;MACD/B,GAAG,EAAEO,MAAM,CAACP,GAAG;MACfgC,QAAQ,EAAE,CAAC,CAAC;MACZC,OAAO,EAAEpB,KAAK,CAACP,QAAQ,CAAC2B;MAC1B,IACFO;KAEV,CACA,CACgB,eAC1B1C,cAACqB,MAAuB,qBACpBrB,cAACqB,OAAwB;IACrBsB,KAAK,EAAC,OAAO;IACbC,eAAe,EAAEL,KAAK;MAClBA,KAAK,CAACC,cAAc,EAAE;KACzB;IACDK,UAAU,EAAE;kBACZ7C,cAAC8C,cAAc,oBACPlC,IAAI;IACRT,SAAS,EAAEgB,EAAE,CAAC,2EAA2E,CAAC;IAC1Fb,KAAK,EAAE;MAAEyC,QAAQ,EAAE9B,gBAAgB,aAAhBA,gBAAgB,uBAAhBA,gBAAgB,CAAE+B;KAAO;IAC5Cd,QAAQ,EAAEvB,OAAO,CAACiB,IAAI,GAAG,CAAC,GAAG,CAAC;KAChC,CACqB,CACL,CACN,CACrB;AAEf,CAAC;;;;"}
1
+ {"version":3,"file":"Combobox.js","sources":["../../../../../../../src/components/Combobox/Combobox.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'clsx';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\nimport { Input, InputProps } from '../Input/Input';\nimport { useCombobox } from './useCombobox';\nimport { ScrollableList, ScrollableListItem, ScrollableListItemValue } from '../Listbox/ScrollableList';\nimport { useBoundingClientRectListener } from '../../hooks/useBoundingClientRectListener';\nimport { IconButton } from '../IconButton/IconButton';\nimport './Combobox.css';\nimport { DialogProps } from '../Dialog/Dialog';\nimport { useLocalization } from '../Provider/Localization';\n\nexport type ComboboxTexts = {\n /* Tooltip shown for the dialog button */\n tooltip: string;\n};\n\nexport type ComboboxItem = ScrollableListItem;\nexport type ComboboxValue = ScrollableListItemValue;\n\ntype ComboboxBaseProps = Omit<InputProps, 'defaultValue' | 'button' | 'onChange' | 'value'> & {\n /** Array of options in combobox */\n data?: ComboboxItem[];\n /**\n * Initial value of the input in combobox.\n * This is used when combobox is mounted, if no value is provided.\n * *Note* that combobox is a controlled component, setting this will also trigger the `onChange` event\n */\n defaultValue?: ComboboxValue;\n /** Set what value should have an empty option in combobox */\n emptyValue?: ComboboxValue;\n /** Draws attention to the combobox by changing its style and making it visually prominent */\n highlighted?: boolean;\n /** Displays loading state in listbox */\n loading?: boolean;\n /**\n * Handler called when user chooses an option from the provided suggestions.\n * Suggestions will be calculated based on the input value.\n * There are two ways to choose an option: either click on it, or navigate using keyboard and press `enter`\n */\n onChange?: React.ChangeEventHandler<HTMLInputElement>;\n /** Handler called when the user enters a query **/\n onSearch?: (query: string) => void | Promise<void>;\n /** Value of the input in combobox */\n value?: ComboboxValue;\n};\n\ninterface InlineComboboxProps extends ComboboxBaseProps {\n dialog?: never;\n /**\n * Combobox will display its data when input is clicked/focused, even if the input is empty.\n * *Note* that default combobox will display matching data only when user starts typing in input.\n */\n inline: boolean; // Example 3 on https://www.w3.org/TR/wai-aria-practices/examples/combobox/aria1.1pattern/listbox-combo.html\n}\n\ninterface DialogComboboxProps extends ComboboxBaseProps {\n dialog: (props: Partial<DialogProps>) => JSX.Element;\n inline?: never;\n}\n\nexport type ComboboxProps = InlineComboboxProps | DialogComboboxProps;\n\nexport const Combobox = React.forwardRef(function Combobox(props: ComboboxProps, ref: React.Ref<HTMLInputElement>) {\n const { className: externalClassName, dialog, style, ...otherProps } = props;\n const { combobox, button, input, popover, list } = useCombobox(otherProps, ref);\n const internalRef = React.useRef<HTMLDivElement>(null);\n const { texts } = useLocalization();\n const selectDimensions = useBoundingClientRectListener(internalRef);\n const className = cn(\n 'inline-flex relative',\n {\n 'yt-combobox--inline': props.inline,\n },\n externalClassName\n );\n\n return (\n <span className={className} data-taco=\"combobox\" style={style}>\n <PopoverPrimitive.Root {...popover}>\n <PopoverPrimitive.Anchor asChild ref={internalRef}>\n <div {...combobox} className=\"inline w-full\" ref={ref}>\n <Input\n {...input}\n autoComplete=\"off\"\n button={\n props.inline ? (\n <IconButton\n // In case of inline combobox, this icon button acts only as visual chevron representation,\n // so should be taken out of screen reader scope.\n aria-hidden\n appearance=\"discrete\"\n className=\"!border-l-0 focus:!border-none focus:!shadow-none active:!border-none\"\n icon={popover.open ? 'chevron-up' : 'chevron-down'}\n onClick={() => {\n popover.onOpenChange(true);\n input.ref.current?.focus();\n }}\n tabIndex={-1}\n />\n ) : dialog ? (\n <IconButton\n aria-label={texts.combobox.tooltip}\n icon=\"list-search\"\n disabled={props.readOnly || props.disabled}\n dialog={dialog}\n onFocus={(event: React.FocusEvent<HTMLButtonElement>) => {\n // Prevents the default focus behaviour of showing the tooltip, on parent tooltip element\n event.preventDefault();\n input.ref.current?.focus();\n }}\n ref={button.ref}\n tabIndex={-1}\n tooltip={texts.combobox.tooltip}\n />\n ) : undefined\n }\n />\n </div>\n </PopoverPrimitive.Anchor>\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n align=\"start\"\n onOpenAutoFocus={event => {\n event.preventDefault();\n }}\n sideOffset={4}>\n <ScrollableList\n {...list}\n className={cn('max-h-[calc(12rem+2px)] w-auto max-w-[theme(spacing.96)] !border-blue-500')}\n style={{ minWidth: selectDimensions?.width }}\n tabIndex={popover.open ? 0 : -1}\n />\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n </PopoverPrimitive.Root>\n </span>\n );\n});\n"],"names":["Combobox","React","props","ref","className","externalClassName","dialog","style","otherProps","combobox","button","input","popover","list","useCombobox","internalRef","texts","useLocalization","selectDimensions","useBoundingClientRectListener","cn","inline","PopoverPrimitive","asChild","Input","autoComplete","IconButton","appearance","icon","open","onClick","onOpenChange","_input$ref$current","current","focus","tabIndex","tooltip","disabled","readOnly","onFocus","event","preventDefault","_input$ref$current2","undefined","align","onOpenAutoFocus","sideOffset","ScrollableList","minWidth","width"],"mappings":";;;;;;;;;;MA+DaA,QAAQ,gBAAGC,UAAgB,CAAC,SAASD,QAAQA,CAACE,KAAoB,EAAEC,GAAgC;EAC7G,MAAM;IAAEC,SAAS,EAAEC,iBAAiB;IAAEC,MAAM;IAAEC,KAAK;IAAE,GAAGC;GAAY,GAAGN,KAAK;EAC5E,MAAM;IAAEO,QAAQ;IAAEC,MAAM;IAAEC,KAAK;IAAEC,OAAO;IAAEC;GAAM,GAAGC,WAAW,CAACN,UAAU,EAAEL,GAAG,CAAC;EAC/E,MAAMY,WAAW,GAAGd,MAAY,CAAiB,IAAI,CAAC;EACtD,MAAM;IAAEe;GAAO,GAAGC,eAAe,EAAE;EACnC,MAAMC,gBAAgB,GAAGC,6BAA6B,CAACJ,WAAW,CAAC;EACnE,MAAMX,SAAS,GAAGgB,EAAE,CAChB,sBAAsB,EACtB;IACI,qBAAqB,EAAElB,KAAK,CAACmB;GAChC,EACDhB,iBAAiB,CACpB;EAED,oBACIJ;IAAMG,SAAS,EAAEA,SAAS;iBAAY,UAAU;IAACG,KAAK,EAAEA;kBACpDN,cAACqB,IAAqB,oBAAKV,OAAO,gBAC9BX,cAACqB,MAAuB;IAACC,OAAO;IAACpB,GAAG,EAAEY;kBAClCd,uCAASQ,QAAQ;IAAEL,SAAS,EAAC,eAAe;IAACD,GAAG,EAAEA;mBAC9CF,cAACuB,KAAK,oBACEb,KAAK;IACTc,YAAY,EAAC,KAAK;IAClBf,MAAM,EACFR,KAAK,CAACmB,MAAM,kBACRpB,cAACyB;;;;;MAIGC,UAAU,EAAC,UAAU;MACrBvB,SAAS,EAAC,uEAAuE;MACjFwB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,CACL,CACN,CACrB;AAEf,CAAC;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { forwardRef, createElement } from 'react';
2
- import cn from 'classnames';
2
+ import cn from 'clsx';
3
3
  import { IconButton } from '../IconButton/IconButton.js';
4
4
  import { useLocalization } from '../Provider/Localization.js';
5
5
  import { Calendar } from '../Calendar/Calendar.js';
@@ -1 +1 @@
1
- {"version":3,"file":"Datepicker.js","sources":["../../../../../../../src/components/Datepicker/Datepicker.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport { Calendar, CalendarProps } from '../Calendar/Calendar';\nimport { Input, InputProps } from '../Input/Input';\nimport { useLocalization } from '../Provider/Localization';\nimport { useDatepicker } from './useDatepicker';\nimport { IconButton } from '../IconButton/IconButton';\nimport { Popover } from '../Popover/Popover';\n\nexport type DatepickerTexts = {\n /** Aria-label for calendar */\n calendar: string;\n /** Clear button text */\n clear: string;\n /**\n * Aria-label for calendar icon button in the input.\n * Calendar will open when user clicks this icon button.\n */\n expand: string;\n /** Shortcut heading text */\n shortcuts: string;\n};\n\nexport type DatePickerShortcut = {\n onClick: (event: React.MouseEvent) => void;\n text: string;\n};\n\nexport type DatepickerProps = Omit<InputProps, 'value'> & {\n /** [Calendar](component:calendar) component associated with the DatePicker */\n calendar?: CalendarProps;\n /** List of shortcuts */\n shortcuts?: DatePickerShortcut[];\n /** Title for the shortcuts panel */\n shortcutsText?: string;\n /** Handler to be called when the clear button is clicked */\n onReset?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n /**\n * Date value of the calendar.\n * This will be displayed in DatePicker's input in the format given to the [Provider](component:provider) component\n */\n value?: Date;\n};\n\nexport const Datepicker = React.forwardRef(function Datepicker(props: DatepickerProps, ref: React.Ref<HTMLInputElement>) {\n const { className: externalClassName, onReset: handleReset, style, shortcuts, shortcutsText, ...otherProps } = props;\n const { calendar, input } = useDatepicker(otherProps, ref);\n const { texts } = useLocalization();\n const className = cn('inline-flex w-full text-black font-normal', externalClassName);\n\n return (\n <span className={className} data-taco=\"datepicker\" style={style}>\n <Input\n {...input}\n button={\n <IconButton\n aria-label={texts.datepicker.expand}\n disabled={input.disabled || input.readOnly}\n icon=\"calendar\"\n tabIndex={-1}\n popover={props => (\n <Popover {...props}>\n <Popover.Content>\n {({ close }) => (\n <div className=\"-m-3 flex\">\n <Calendar\n {...calendar}\n onChange={(date: Date, event?: React.MouseEvent<HTMLDivElement>) => {\n calendar.onChange(date, event);\n close();\n }}\n />\n {shortcuts && (\n <div className=\"border-grey-300 flex flex-col border-l\">\n <span className=\"m-4 mb-3 flex h-8 w-32 items-center text-xs font-semibold\">\n {shortcutsText ?? texts.datepicker.shortcuts}\n </span>\n <ul>\n {shortcuts.map(shortcut => (\n <li key={shortcut.text}>\n <button\n type=\"button\"\n className=\"hover:wcag-grey-200 flex w-full items-start px-4 py-1 text-xs\"\n onClick={event => {\n event.persist();\n shortcut.onClick(event);\n close();\n }}>\n {shortcut.text}\n </button>\n </li>\n ))}\n </ul>\n {handleReset && (\n <button\n type=\"button\"\n className=\"mx-auto my-4 mt-auto inline-flex cursor-pointer border-none bg-transparent text-xs text-blue-500 hover:text-blue-300\"\n onClick={event => {\n event.persist();\n handleReset(event);\n close();\n }}>\n {texts.datepicker.clear}\n </button>\n )}\n </div>\n )}\n </div>\n )}\n </Popover.Content>\n </Popover>\n )}\n tooltip={texts.datepicker.calendar}\n />\n }\n />\n </span>\n );\n});\nDatepicker.displayName = 'Datepicker';\n"],"names":["Datepicker","React","props","ref","className","externalClassName","onReset","handleReset","style","shortcuts","shortcutsText","otherProps","calendar","input","useDatepicker","texts","useLocalization","cn","Input","button","IconButton","datepicker","expand","disabled","readOnly","icon","tabIndex","popover","Popover","Content","close","Calendar","onChange","date","event","map","shortcut","key","text","type","onClick","persist","clear","tooltip","displayName"],"mappings":";;;;;;;;;MA4CaA,UAAU,gBAAGC,UAAgB,CAAC,SAASD,UAAUA,CAACE,KAAsB,EAAEC,GAAgC;EACnH,MAAM;IAAEC,SAAS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AS,EAAC,+DAA+D;QACzEoC,OAAO,EAAEN,KAAK;UACVA,KAAK,CAACO,OAAO,EAAE;UACfL,QAAQ,CAACI,OAAO,CAACN,KAAK,CAAC;UACvBJ,KAAK,EAAE;;SAEVM,QAAQ,CAACE,IAAI,CACT,CACR,CACR,CAAC,CACD,EACJ/B,WAAW,mBACRN;QACIsC,IAAI,EAAC,QAAQ;QACbnC,SAAS,EAAC,sHAAsH;QAChIoC,OAAO,EAAEN,KAAK;UACVA,KAAK,CAACO,OAAO,EAAE;UACflC,WAAW,CAAC2B,KAAK,CAAC;UAClBJ,KAAK,EAAE;;SAEVf,KAAK,CAACM,UAAU,CAACqB,KAAK,CAClB,CACZ,CACC,CACT,CACC,CACT,CACa,CACZ,CACb;MACDC,OAAO,EAAE5B,KAAK,CAACM,UAAU,CAACT;;KAGpC,CACC;AAEf,CAAC;AACDZ,UAAU,CAAC4C,WAAW,GAAG,YAAY;;;;"}
1
+ {"version":3,"file":"Datepicker.js","sources":["../../../../../../../src/components/Datepicker/Datepicker.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'clsx';\nimport { Calendar, CalendarProps } from '../Calendar/Calendar';\nimport { Input, InputProps } from '../Input/Input';\nimport { useLocalization } from '../Provider/Localization';\nimport { useDatepicker } from './useDatepicker';\nimport { IconButton } from '../IconButton/IconButton';\nimport { Popover } from '../Popover/Popover';\n\nexport type DatepickerTexts = {\n /** Aria-label for calendar */\n calendar: string;\n /** Clear button text */\n clear: string;\n /**\n * Aria-label for calendar icon button in the input.\n * Calendar will open when user clicks this icon button.\n */\n expand: string;\n /** Shortcut heading text */\n shortcuts: string;\n};\n\nexport type DatePickerShortcut = {\n onClick: (event: React.MouseEvent) => void;\n text: string;\n};\n\nexport type DatepickerProps = Omit<InputProps, 'value'> & {\n /** [Calendar](component:calendar) component associated with the DatePicker */\n calendar?: CalendarProps;\n /** List of shortcuts */\n shortcuts?: DatePickerShortcut[];\n /** Title for the shortcuts panel */\n shortcutsText?: string;\n /** Handler to be called when the clear button is clicked */\n onReset?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n /**\n * Date value of the calendar.\n * This will be displayed in DatePicker's input in the format given to the [Provider](component:provider) component\n */\n value?: Date;\n};\n\nexport const Datepicker = React.forwardRef(function Datepicker(props: DatepickerProps, ref: React.Ref<HTMLInputElement>) {\n const { className: externalClassName, onReset: handleReset, style, shortcuts, shortcutsText, ...otherProps } = props;\n const { calendar, input } = useDatepicker(otherProps, ref);\n const { texts } = useLocalization();\n const className = cn('inline-flex w-full text-black font-normal', externalClassName);\n\n return (\n <span className={className} data-taco=\"datepicker\" style={style}>\n <Input\n {...input}\n button={\n <IconButton\n aria-label={texts.datepicker.expand}\n disabled={input.disabled || input.readOnly}\n icon=\"calendar\"\n tabIndex={-1}\n popover={props => (\n <Popover {...props}>\n <Popover.Content>\n {({ close }) => (\n <div className=\"-m-3 flex\">\n <Calendar\n {...calendar}\n onChange={(date: Date, event?: React.MouseEvent<HTMLDivElement>) => {\n calendar.onChange(date, event);\n close();\n }}\n />\n {shortcuts && (\n <div className=\"border-grey-300 flex flex-col border-l\">\n <span className=\"m-4 mb-3 flex h-8 w-32 items-center text-xs font-semibold\">\n {shortcutsText ?? texts.datepicker.shortcuts}\n </span>\n <ul>\n {shortcuts.map(shortcut => (\n <li key={shortcut.text}>\n <button\n type=\"button\"\n className=\"hover:wcag-grey-200 flex w-full items-start px-4 py-1 text-xs\"\n onClick={event => {\n event.persist();\n shortcut.onClick(event);\n close();\n }}>\n {shortcut.text}\n </button>\n </li>\n ))}\n </ul>\n {handleReset && (\n <button\n type=\"button\"\n className=\"mx-auto my-4 mt-auto inline-flex cursor-pointer border-none bg-transparent text-xs text-blue-500 hover:text-blue-300\"\n onClick={event => {\n event.persist();\n handleReset(event);\n close();\n }}>\n {texts.datepicker.clear}\n </button>\n )}\n </div>\n )}\n </div>\n )}\n </Popover.Content>\n </Popover>\n )}\n tooltip={texts.datepicker.calendar}\n />\n }\n />\n </span>\n );\n});\nDatepicker.displayName = 'Datepicker';\n"],"names":["Datepicker","React","props","ref","className","externalClassName","onReset","handleReset","style","shortcuts","shortcutsText","otherProps","calendar","input","useDatepicker","texts","useLocalization","cn","Input","button","IconButton","datepicker","expand","disabled","readOnly","icon","tabIndex","popover","Popover","Content","close","Calendar","onChange","date","event","map","shortcut","key","text","type","onClick","persist","clear","tooltip","displayName"],"mappings":";;;;;;;;;MA4CaA,UAAU,gBAAGC,UAAgB,CAAC,SAASD,UAAUA,CAACE,KAAsB,EAAEC,GAAgC;EACnH,MAAM;IAAEC,SAAS,EAAEC,iBAAiB;IAAEC,OAAO,EAAEC,WAAW;IAAEC,KAAK;IAAEC,SAAS;IAAEC,aAAa;IAAE,GAAGC;GAAY,GAAGT,KAAK;EACpH,MAAM;IAAEU,QAAQ;IAAEC;GAAO,GAAGC,aAAa,CAACH,UAAU,EAAER,GAAG,CAAC;EAC1D,MAAM;IAAEY;GAAO,GAAGC,eAAe,EAAE;EACnC,MAAMZ,SAAS,GAAGa,EAAE,CAAC,2CAA2C,EAAEZ,iBAAiB,CAAC;EAEpF,oBACIJ;IAAMG,SAAS,EAAEA,SAAS;iBAAY,YAAY;IAACI,KAAK,EAAEA;kBACtDP,cAACiB,KAAK,oBACEL,KAAK;IACTM,MAAM,eACFlB,cAACmB,UAAU;oBACKL,KAAK,CAACM,UAAU,CAACC,MAAM;MACnCC,QAAQ,EAAEV,KAAK,CAACU,QAAQ,IAAIV,KAAK,CAACW,QAAQ;MAC1CC,IAAI,EAAC,UAAU;MACfC,QAAQ,EAAE,CAAC,CAAC;MACZC,OAAO,EAAEzB,KAAK,mBACVD,cAAC2B,OAAO,oBAAK1B,KAAK,gBACdD,cAAC2B,OAAO,CAACC,OAAO,QACX,CAAC;QAAEC;OAAO,oBACP7B;QAAKG,SAAS,EAAC;sBACXH,cAAC8B,QAAQ,oBACDnB,QAAQ;QACZoB,QAAQ,EAAEA,CAACC,IAAU,EAAEC,KAAwC;UAC3DtB,QAAQ,CAACoB,Q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