@doist/reactist 10.0.0-beta.7 → 11.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (277) hide show
  1. package/dist/reactist.cjs.development.js +253 -411
  2. package/dist/reactist.cjs.development.js.map +1 -1
  3. package/dist/reactist.cjs.production.min.js +1 -1
  4. package/dist/reactist.cjs.production.min.js.map +1 -1
  5. package/es/_virtual/_rollupPluginBabelHelpers.js +34 -20
  6. package/es/_virtual/_rollupPluginBabelHelpers.js.map +1 -1
  7. package/es/components/deprecated-button/deprecated-button.js +2 -1
  8. package/es/components/deprecated-button/deprecated-button.js.map +1 -1
  9. package/es/components/deprecated-modal/deprecated-modal.js +1 -1
  10. package/es/components/deprecated-modal/deprecated-modal.js.map +1 -1
  11. package/es/components/dropdown/dropdown.js +3 -1
  12. package/es/components/dropdown/dropdown.js.map +1 -1
  13. package/es/components/key-capturer/key-capturer.js.map +1 -1
  14. package/es/components/keyboard-shortcut/keyboard-shortcut.js +2 -1
  15. package/es/components/keyboard-shortcut/keyboard-shortcut.js.map +1 -1
  16. package/es/components/menu/menu.js +32 -12
  17. package/es/components/menu/menu.js.map +1 -1
  18. package/es/components/notification/notification.js +8 -3
  19. package/es/components/notification/notification.js.map +1 -1
  20. package/es/components/popover/popover.js.map +1 -1
  21. package/es/components/popover/positioning-utils.js.map +1 -1
  22. package/es/components/progress-bar/progress-bar.js +8 -2
  23. package/es/components/progress-bar/progress-bar.js.map +1 -1
  24. package/es/components/select/select.js +3 -1
  25. package/es/components/select/select.js.map +1 -1
  26. package/es/components/time/time-utils.js.map +1 -1
  27. package/es/components/time/time.js.map +1 -1
  28. package/es/components/tooltip/tooltip.js +3 -1
  29. package/es/components/tooltip/tooltip.js.map +1 -1
  30. package/es/index.js +0 -4
  31. package/es/index.js.map +1 -1
  32. package/es/new-components/base-button/base-button.js +3 -1
  33. package/es/new-components/base-button/base-button.js.map +1 -1
  34. package/es/new-components/base-button/base-button.module.css.js +1 -1
  35. package/es/new-components/box/box.js +5 -3
  36. package/es/new-components/box/box.js.map +1 -1
  37. package/es/new-components/box/box.module.css.js +1 -1
  38. package/es/new-components/box/width.module.css.js +4 -0
  39. package/es/new-components/box/width.module.css.js.map +1 -0
  40. package/es/new-components/button/button.js +2 -1
  41. package/es/new-components/button/button.js.map +1 -1
  42. package/es/new-components/button-link/button-link.js +2 -1
  43. package/es/new-components/button-link/button-link.js.map +1 -1
  44. package/es/new-components/checkbox-field/checkbox-field.js +27 -10
  45. package/es/new-components/checkbox-field/checkbox-field.js.map +1 -1
  46. package/es/new-components/checkbox-field/checkbox-field.module.css.js +1 -1
  47. package/es/new-components/checkbox-field/checkbox-icon.js +2 -1
  48. package/es/new-components/checkbox-field/checkbox-icon.js.map +1 -1
  49. package/es/new-components/columns/columns.js +4 -2
  50. package/es/new-components/columns/columns.js.map +1 -1
  51. package/es/new-components/divider/divider.js +5 -3
  52. package/es/new-components/divider/divider.js.map +1 -1
  53. package/es/new-components/divider/divider.module.css.js +1 -1
  54. package/es/new-components/heading/heading.js +2 -1
  55. package/es/new-components/heading/heading.js.map +1 -1
  56. package/es/new-components/hidden/hidden.js +2 -1
  57. package/es/new-components/hidden/hidden.js.map +1 -1
  58. package/es/new-components/icons/alert-icon.js +2 -1
  59. package/es/new-components/icons/alert-icon.js.map +1 -1
  60. package/es/new-components/inline/inline.js +2 -1
  61. package/es/new-components/inline/inline.js.map +1 -1
  62. package/es/new-components/loading/loading.js +6 -2
  63. package/es/new-components/loading/loading.js.map +1 -1
  64. package/es/new-components/modal/modal.js +32 -9
  65. package/es/new-components/modal/modal.js.map +1 -1
  66. package/es/new-components/modal/modal.module.css.js +1 -1
  67. package/es/new-components/password-field/password-field.js +2 -1
  68. package/es/new-components/password-field/password-field.js.map +1 -1
  69. package/es/new-components/select-field/select-field.js +2 -1
  70. package/es/new-components/select-field/select-field.js.map +1 -1
  71. package/es/new-components/select-field/select-field.module.css.js +1 -1
  72. package/es/new-components/stack/stack.js +5 -4
  73. package/es/new-components/stack/stack.js.map +1 -1
  74. package/es/new-components/switch-field/switch-field.js +28 -5
  75. package/es/new-components/switch-field/switch-field.js.map +1 -1
  76. package/es/new-components/switch-field/switch-field.module.css.js +1 -1
  77. package/es/new-components/tabs/tabs.js +10 -5
  78. package/es/new-components/tabs/tabs.js.map +1 -1
  79. package/es/new-components/tabs/tabs.module.css.js +1 -1
  80. package/es/new-components/text/text.js +2 -1
  81. package/es/new-components/text/text.js.map +1 -1
  82. package/es/new-components/text-area/text-area.js +3 -1
  83. package/es/new-components/text-area/text-area.js.map +1 -1
  84. package/es/new-components/text-area/text-area.module.css.js +1 -1
  85. package/es/new-components/text-field/text-field.js +2 -1
  86. package/es/new-components/text-field/text-field.js.map +1 -1
  87. package/es/new-components/text-field/text-field.module.css.js +1 -1
  88. package/es/new-components/text-link/text-link.js +2 -1
  89. package/es/new-components/text-link/text-link.js.map +1 -1
  90. package/lib/_virtual/_rollupPluginBabelHelpers.js +1 -1
  91. package/lib/components/deprecated-button/deprecated-button.js +1 -1
  92. package/lib/components/deprecated-button/deprecated-button.js.map +1 -1
  93. package/lib/components/deprecated-modal/deprecated-modal.js +1 -1
  94. package/lib/components/deprecated-modal/deprecated-modal.js.map +1 -1
  95. package/lib/components/dropdown/dropdown.js +1 -1
  96. package/lib/components/dropdown/dropdown.js.map +1 -1
  97. package/lib/components/keyboard-shortcut/keyboard-shortcut.js +1 -1
  98. package/lib/components/keyboard-shortcut/keyboard-shortcut.js.map +1 -1
  99. package/lib/components/menu/menu.js +1 -1
  100. package/lib/components/menu/menu.js.map +1 -1
  101. package/lib/components/notification/notification.d.ts +4 -2
  102. package/lib/components/notification/notification.js +1 -1
  103. package/lib/components/notification/notification.js.map +1 -1
  104. package/lib/components/progress-bar/progress-bar.d.ts +3 -1
  105. package/lib/components/progress-bar/progress-bar.js +1 -1
  106. package/lib/components/progress-bar/progress-bar.js.map +1 -1
  107. package/lib/components/select/select.js +1 -1
  108. package/lib/components/select/select.js.map +1 -1
  109. package/lib/components/tooltip/tooltip.js +1 -1
  110. package/lib/components/tooltip/tooltip.js.map +1 -1
  111. package/lib/index.d.ts +0 -4
  112. package/lib/index.js +1 -1
  113. package/lib/new-components/base-button/base-button.js +1 -1
  114. package/lib/new-components/base-button/base-button.js.map +1 -1
  115. package/lib/new-components/base-button/base-button.module.css.js +1 -1
  116. package/lib/new-components/box/box.d.ts +10 -9
  117. package/lib/new-components/box/box.js +1 -1
  118. package/lib/new-components/box/box.js.map +1 -1
  119. package/lib/new-components/box/box.module.css.js +1 -1
  120. package/lib/new-components/box/width.module.css.js +2 -0
  121. package/lib/new-components/box/width.module.css.js.map +1 -0
  122. package/lib/new-components/button/button.js +1 -1
  123. package/lib/new-components/button/button.js.map +1 -1
  124. package/lib/new-components/button-link/button-link.js +1 -1
  125. package/lib/new-components/button-link/button-link.js.map +1 -1
  126. package/lib/new-components/checkbox-field/checkbox-field.d.ts +15 -2
  127. package/lib/new-components/checkbox-field/checkbox-field.js +1 -1
  128. package/lib/new-components/checkbox-field/checkbox-field.js.map +1 -1
  129. package/lib/new-components/checkbox-field/checkbox-field.module.css.js +1 -1
  130. package/lib/new-components/checkbox-field/checkbox-icon.js +1 -1
  131. package/lib/new-components/checkbox-field/checkbox-icon.js.map +1 -1
  132. package/lib/new-components/columns/columns.js +1 -1
  133. package/lib/new-components/columns/columns.js.map +1 -1
  134. package/lib/new-components/common-types.d.ts +1 -0
  135. package/lib/new-components/divider/divider.d.ts +2 -2
  136. package/lib/new-components/divider/divider.js +1 -1
  137. package/lib/new-components/divider/divider.js.map +1 -1
  138. package/lib/new-components/divider/divider.module.css.js +1 -1
  139. package/lib/new-components/heading/heading.js +1 -1
  140. package/lib/new-components/heading/heading.js.map +1 -1
  141. package/lib/new-components/hidden/hidden.js +1 -1
  142. package/lib/new-components/hidden/hidden.js.map +1 -1
  143. package/lib/new-components/icons/alert-icon.js +1 -1
  144. package/lib/new-components/icons/alert-icon.js.map +1 -1
  145. package/lib/new-components/inline/inline.js +1 -1
  146. package/lib/new-components/inline/inline.js.map +1 -1
  147. package/lib/new-components/loading/loading.d.ts +8 -7
  148. package/lib/new-components/loading/loading.js +1 -1
  149. package/lib/new-components/loading/loading.js.map +1 -1
  150. package/lib/new-components/modal/modal.d.ts +7 -3
  151. package/lib/new-components/modal/modal.js +1 -1
  152. package/lib/new-components/modal/modal.js.map +1 -1
  153. package/lib/new-components/modal/modal.module.css.js +1 -1
  154. package/lib/new-components/password-field/password-field.js +1 -1
  155. package/lib/new-components/password-field/password-field.js.map +1 -1
  156. package/lib/new-components/select-field/select-field.js +1 -1
  157. package/lib/new-components/select-field/select-field.js.map +1 -1
  158. package/lib/new-components/select-field/select-field.module.css.js +1 -1
  159. package/lib/new-components/stack/stack.d.ts +3 -4
  160. package/lib/new-components/stack/stack.js +1 -1
  161. package/lib/new-components/stack/stack.js.map +1 -1
  162. package/lib/new-components/switch-field/switch-field.d.ts +9 -2
  163. package/lib/new-components/switch-field/switch-field.js +1 -1
  164. package/lib/new-components/switch-field/switch-field.js.map +1 -1
  165. package/lib/new-components/switch-field/switch-field.module.css.js +1 -1
  166. package/lib/new-components/tabs/tabs.js +1 -1
  167. package/lib/new-components/tabs/tabs.js.map +1 -1
  168. package/lib/new-components/tabs/tabs.module.css.js +1 -1
  169. package/lib/new-components/text/text.js +1 -1
  170. package/lib/new-components/text/text.js.map +1 -1
  171. package/lib/new-components/text-area/text-area.js +1 -1
  172. package/lib/new-components/text-area/text-area.js.map +1 -1
  173. package/lib/new-components/text-area/text-area.module.css.js +1 -1
  174. package/lib/new-components/text-field/text-field.js +1 -1
  175. package/lib/new-components/text-field/text-field.js.map +1 -1
  176. package/lib/new-components/text-field/text-field.module.css.js +1 -1
  177. package/lib/new-components/text-link/text-link.js +1 -1
  178. package/lib/new-components/text-link/text-link.js.map +1 -1
  179. package/package.json +15 -12
  180. package/styles/alert.css +2 -1
  181. package/styles/base-button.css +4 -3
  182. package/styles/base-button.module.css.css +1 -1
  183. package/styles/base-field.css +3 -2
  184. package/styles/box.css +3 -2
  185. package/styles/box.module.css.css +1 -1
  186. package/styles/checkbox-field.css +3 -3
  187. package/styles/checkbox-field.module.css.css +1 -1
  188. package/styles/color-picker.css +1 -1
  189. package/styles/columns.css +2 -1
  190. package/styles/deprecated-button.css +1 -1
  191. package/styles/deprecated-loading.css +1 -1
  192. package/styles/deprecated-modal.css +1 -1
  193. package/styles/divider.css +3 -2
  194. package/styles/divider.module.css.css +1 -1
  195. package/styles/dropdown.css +1 -1
  196. package/styles/heading.css +2 -1
  197. package/styles/hidden-visually.css +2 -1
  198. package/styles/hidden.css +2 -1
  199. package/styles/inline.css +2 -1
  200. package/styles/loading.css +3 -2
  201. package/styles/modal.css +6 -5
  202. package/styles/modal.module.css.css +1 -1
  203. package/styles/notice.css +2 -1
  204. package/styles/password-field.css +4 -3
  205. package/styles/progress-bar.css +5 -0
  206. package/styles/reactist.css +16 -19
  207. package/styles/select-field.css +4 -3
  208. package/styles/select-field.module.css.css +1 -1
  209. package/styles/spinner.module.css.css +1 -1
  210. package/styles/stack.css +3 -2
  211. package/styles/switch-field.css +4 -3
  212. package/styles/switch-field.module.css.css +1 -1
  213. package/styles/tabs.css +3 -2
  214. package/styles/tabs.module.css.css +1 -1
  215. package/styles/text-area.css +4 -3
  216. package/styles/text-area.module.css.css +1 -1
  217. package/styles/text-field.css +4 -3
  218. package/styles/text-field.module.css.css +1 -1
  219. package/styles/text-link.css +2 -1
  220. package/styles/text.css +2 -1
  221. package/styles/width.module.css.css +1 -0
  222. package/es/components/error-message/error-message.js +0 -90
  223. package/es/components/error-message/error-message.js.map +0 -1
  224. package/es/components/error-message/index.js +0 -6
  225. package/es/components/error-message/index.js.map +0 -1
  226. package/es/components/icon/icon.js +0 -96
  227. package/es/components/icon/icon.js.map +0 -1
  228. package/es/components/icon/index.js +0 -6
  229. package/es/components/icon/index.js.map +0 -1
  230. package/es/components/icons/ThinQuestionMarkIcon.svg.js +0 -24
  231. package/es/components/icons/ThinQuestionMarkIcon.svg.js.map +0 -1
  232. package/es/components/icons/ThreeDotsIcon.svg.js +0 -40
  233. package/es/components/icons/ThreeDotsIcon.svg.js.map +0 -1
  234. package/es/components/range-input/index.js +0 -6
  235. package/es/components/range-input/index.js.map +0 -1
  236. package/es/components/range-input/range-input.js +0 -55
  237. package/es/components/range-input/range-input.js.map +0 -1
  238. package/es/components/tip/index.js +0 -6
  239. package/es/components/tip/index.js.map +0 -1
  240. package/es/components/tip/tip.js +0 -30
  241. package/es/components/tip/tip.js.map +0 -1
  242. package/lib/components/error-message/error-message.d.ts +0 -23
  243. package/lib/components/error-message/error-message.js +0 -2
  244. package/lib/components/error-message/error-message.js.map +0 -1
  245. package/lib/components/error-message/error-message.test.d.ts +0 -1
  246. package/lib/components/error-message/index.d.ts +0 -2
  247. package/lib/components/error-message/index.js +0 -2
  248. package/lib/components/error-message/index.js.map +0 -1
  249. package/lib/components/icon/icon.d.ts +0 -31
  250. package/lib/components/icon/icon.js +0 -2
  251. package/lib/components/icon/icon.js.map +0 -1
  252. package/lib/components/icon/icon.test.d.ts +0 -1
  253. package/lib/components/icon/index.d.ts +0 -2
  254. package/lib/components/icon/index.js +0 -2
  255. package/lib/components/icon/index.js.map +0 -1
  256. package/lib/components/icons/ThinQuestionMarkIcon.svg.js +0 -2
  257. package/lib/components/icons/ThinQuestionMarkIcon.svg.js.map +0 -1
  258. package/lib/components/icons/ThreeDotsIcon.svg.js +0 -2
  259. package/lib/components/icons/ThreeDotsIcon.svg.js.map +0 -1
  260. package/lib/components/range-input/index.d.ts +0 -2
  261. package/lib/components/range-input/index.js +0 -2
  262. package/lib/components/range-input/index.js.map +0 -1
  263. package/lib/components/range-input/range-input.d.ts +0 -25
  264. package/lib/components/range-input/range-input.js +0 -2
  265. package/lib/components/range-input/range-input.js.map +0 -1
  266. package/lib/components/range-input/range-input.test.d.ts +0 -1
  267. package/lib/components/tip/index.d.ts +0 -2
  268. package/lib/components/tip/index.js +0 -2
  269. package/lib/components/tip/index.js.map +0 -1
  270. package/lib/components/tip/tip.d.ts +0 -20
  271. package/lib/components/tip/tip.js +0 -2
  272. package/lib/components/tip/tip.js.map +0 -1
  273. package/lib/components/tip/tip.test.d.ts +0 -1
  274. package/styles/error-message.css +0 -1
  275. package/styles/icon.css +0 -2
  276. package/styles/range-input.css +0 -1
  277. package/styles/tip.css +0 -4
@@ -1 +1 @@
1
- {"version":3,"file":"menu.js","sources":["../../../src/components/menu/menu.tsx"],"sourcesContent":["import * as React from 'react'\nimport classNames from 'classnames'\nimport { polymorphicComponent } from '../../utils/polymorphism'\n\n//\n// Reactist menu is a thin wrapper around Reakit's menu components. This may or may not be\n// temporary. Our goal is to make it transparent for the users of Reactist of this implementation\n// detail. We may change in the future the external lib we use, or even implement it all internally,\n// as long as we keep the same outer interface as intact as possible.\n//\n// Around the heavy lifting of the external lib we just add some features to better integrate the\n// menu to Reactist's more opinionated approach (e.g. using our button with its custom variants and\n// other features, easily show keyboard shortcuts in menu items, etc.)\n//\nimport * as Reakit from 'reakit/Menu'\nimport { PopoverBackdrop } from 'reakit/Popover'\n\nimport './menu.less'\n\ntype NativeProps<E extends HTMLElement> = React.DetailedHTMLProps<React.HTMLAttributes<E>, E>\n\ntype MenuContextState = Reakit.MenuStateReturn & {\n handleItemSelect: (value: string | null | undefined) => void\n}\n\nconst MenuContext = React.createContext<MenuContextState>(\n // Reakit gives us no means to obtain a valid initial/default value of type MenuStateReturn\n // (it is normally obtained by calling useMenuState but we can't call hooks outside components).\n // This is however of little consequence since this value is only used if some of the components\n // are used outside Menu, something that should not happen and we do not support.\n // @ts-expect-error\n {},\n)\n\n//\n// Menu\n//\n\ntype MenuProps = Omit<Reakit.MenuInitialState, 'visible'> & {\n /**\n * The `Menu` must contain a `MenuList` that defines the menu options. It must also contain a\n * `MenuButton` that triggers the menu to be opened or closed.\n */\n children: React.ReactNode\n\n /**\n * An optional callback that will be called back whenever a menu item is selected. It receives\n * the `value` of the selected `MenuItem`.\n *\n * If you pass down this callback, it is recommended that you properly memoize it so it does not\n * change on every render.\n */\n onItemSelect?: (value: string | null | undefined) => void\n}\n\n/**\n * Wrapper component to control a menu. It does not render anything, only providing the state\n * management for the menu components inside it.\n */\nfunction Menu({ children, onItemSelect, ...props }: MenuProps) {\n const state = Reakit.useMenuState({ loop: true, ...props })\n\n const handleItemSelect = React.useCallback(\n function handleItemSelect(value: string | null | undefined) {\n if (onItemSelect) onItemSelect(value)\n },\n [onItemSelect],\n )\n\n const value: MenuContextState = React.useMemo(\n () => ({\n ...state,\n handleItemSelect,\n }),\n [state, handleItemSelect],\n )\n\n return <MenuContext.Provider value={value}>{children}</MenuContext.Provider>\n}\n\n//\n// MenuButton\n//\n\ntype MenuButtonProps = Omit<Reakit.MenuButtonProps, keyof Reakit.MenuStateReturn | 'className'>\n\n/**\n * A button to toggle a dropdown menu open or closed.\n */\nconst MenuButton = polymorphicComponent<'button', MenuButtonProps>(function MenuButton(\n { exceptionallySetClassName, ...props },\n ref,\n) {\n const { handleItemSelect, ...state } = React.useContext(MenuContext)\n return (\n <Reakit.MenuButton\n {...props}\n {...state}\n ref={ref}\n className={classNames('reactist_menubutton', exceptionallySetClassName)}\n />\n )\n})\n\n//\n// MenuList\n//\n\ntype MenuBackdropProps = Reakit.MenuStateReturn & {\n children: React.ReactNode\n}\n\nconst BACKDROP_STYLE: React.CSSProperties = {\n width: '100%',\n height: '100%',\n position: 'fixed',\n top: 0,\n left: 0,\n}\n\n/**\n * Internal component to provide a backdrop/overlay to all menus. This is needed because reakit's\n * menus do not show an overlay by default.\n */\nfunction MenuBackdrop({\n baseId,\n visible,\n animated,\n animating,\n stopAnimation,\n modal,\n children,\n}: MenuBackdropProps) {\n return (\n <PopoverBackdrop\n baseId={baseId}\n visible={visible}\n animated={animated}\n animating={animating}\n stopAnimation={stopAnimation}\n modal={modal}\n style={BACKDROP_STYLE}\n >\n {children}\n </PopoverBackdrop>\n )\n}\n\ntype MenuListProps = Omit<Reakit.MenuProps, keyof Reakit.MenuStateReturn | 'className'>\n\n/**\n * The dropdown menu itself, containing a list of menu items.\n */\nconst MenuList = polymorphicComponent<'div', MenuListProps>(function MenuList(\n { exceptionallySetClassName, ...props },\n ref,\n) {\n const { handleItemSelect, ...state } = React.useContext(MenuContext)\n return state.visible ? (\n <MenuBackdrop {...state}>\n <Reakit.Menu\n {...props}\n {...state}\n ref={ref}\n className={classNames('reactist_menulist', exceptionallySetClassName)}\n />\n </MenuBackdrop>\n ) : null\n})\n\n//\n// MenuItem\n//\n\ntype MenuItemProps = {\n /**\n * An optional value given to this menu item. It is passed on to the parent `Menu`'s\n * `onItemSelect` when you provide that instead of (or alongside) providing individual\n * `onSelect` callbacks to each menu item.\n */\n value?: string\n /**\n * The content inside the menu item.\n */\n children: React.ReactNode\n /**\n * When `true` the menu item is disabled and won't be selectable or be part of the keyboard\n * navigation across the menu options.\n *\n * @default true\n */\n disabled?: boolean\n /**\n * When `true` the menu will close when the menu item is selected, in addition to performing the\n * action that the menu item is set out to do.\n *\n * Set this to `false` to make sure that a given menu item does not auto-closes the menu when\n * selected. This should be the exception and not the norm, as the default is to auto-close.\n *\n * @default true\n */\n hideOnSelect?: boolean\n /**\n * The action to perform when the menu item is selected.\n *\n * If you return `false` from this function, the menu will not auto-close when this menu item\n * is selected. Though you should use `hideOnSelect` for this purpose, this allows you to\n * achieve the same effect conditionally and dynamically deciding at run time.\n */\n onSelect?: () => unknown\n /**\n * The event handler called when the menu item is clicked.\n *\n * This is similar to `onSelect`, but a bit different. You can certainly use it to trigger the\n * action that the menu item represents. But in general you should prefer `onSelect` for that.\n *\n * The main use for this handler is to get access to the click event. This can be used, for\n * example, to call `event.preventDefault()`, which will effectively prevent the rest of the\n * consequences of the click, including preventing `onSelect` from being called. In particular,\n * this is useful in menu items that are links, and you want the click to not trigger navigation\n * under some circumstances.\n */\n onClick?: (event: React.MouseEvent) => void\n}\n\n/**\n * A menu item inside a menu list. It can be selected by the user, triggering the `onSelect`\n * callback.\n */\nconst MenuItem = polymorphicComponent<'button', MenuItemProps>(function MenuItem(\n {\n value,\n children,\n onSelect,\n hideOnSelect = true,\n onClick,\n exceptionallySetClassName,\n ...props\n },\n ref,\n) {\n const { handleItemSelect, ...state } = React.useContext(MenuContext)\n const { hide } = state\n\n const handleClick = React.useCallback(\n function handleClick(event: React.MouseEvent<HTMLButtonElement>) {\n onClick?.(event)\n const onSelectResult: unknown =\n onSelect && !event.defaultPrevented ? onSelect() : undefined\n const shouldClose = onSelectResult !== false && hideOnSelect\n handleItemSelect(value)\n if (shouldClose) hide()\n },\n [onSelect, onClick, handleItemSelect, hideOnSelect, hide, value],\n )\n\n return (\n <Reakit.MenuItem\n {...props}\n {...state}\n ref={ref}\n onClick={handleClick}\n className={exceptionallySetClassName}\n >\n {children}\n </Reakit.MenuItem>\n )\n})\n\n//\n// SubMenu\n//\n\ntype SubMenuProps = Pick<MenuProps, 'children' | 'onItemSelect'>\n\n/**\n * This component can be rendered alongside other `MenuItem` inside a `MenuList` in order to have\n * a sub-menu.\n *\n * Its children are expected to have the structure of a first level menu (a `MenuButton` and a\n * `MenuList`).\n *\n * ```jsx\n * <MenuItem label=\"Edit profile\" />\n * <SubMenu>\n * <MenuButton>More options</MenuButton>\n * <MenuList>\n * <MenuItem label=\"Preferences\" />\n * <MenuItem label=\"Sign out\" />\n * </MenuList>\n * </SubMenu>\n * ```\n *\n * The `MenuButton` will become a menu item in the current menu items list, and it will lead to\n * opening a sub-menu with the menu items list below it.\n */\nconst SubMenu = React.forwardRef<HTMLButtonElement, SubMenuProps>(function SubMenu(\n { children, onItemSelect, ...props },\n ref,\n) {\n const { handleItemSelect: parentMenuItemSelect, ...state } = React.useContext(MenuContext)\n const { hide: parentMenuHide } = state\n\n const handleSubItemSelect = React.useCallback(\n function handleSubItemSelect(value) {\n if (onItemSelect) onItemSelect(value)\n parentMenuItemSelect(value)\n parentMenuHide()\n },\n [parentMenuHide, parentMenuItemSelect, onItemSelect],\n )\n\n const [button, list] = React.Children.toArray(children)\n\n return (\n <Reakit.MenuItem {...state} {...props} ref={ref}>\n {(buttonProps) => (\n <Menu onItemSelect={handleSubItemSelect}>\n {React.cloneElement(button as React.ReactElement, {\n ...buttonProps,\n className: classNames(buttonProps.className, 'reactist_submenu_button'),\n })}\n {list}\n </Menu>\n )}\n </Reakit.MenuItem>\n )\n})\n\n//\n// MenuGroup\n//\n\ntype MenuGroupProps = Omit<NativeProps<HTMLDivElement>, 'className'> & {\n /**\n * A label to be shown visually and also used to semantically label the group.\n */\n label: string\n}\n\n/**\n * A way to semantically group some menu items.\n *\n * This group does not add any visual separator. You can do that yourself adding `<hr />` elements\n * before and/or after the group if you so wish.\n */\nconst MenuGroup = polymorphicComponent<'div', MenuGroupProps>(function MenuGroud(\n { label, children, exceptionallySetClassName, ...props },\n ref,\n) {\n const { handleItemSelect, ...state } = React.useContext(MenuContext)\n return (\n <Reakit.MenuGroup ref={ref} {...props} {...state} className={exceptionallySetClassName}>\n {label ? (\n <div role=\"presentation\" className=\"reactist_menugroup__label\">\n {label}\n </div>\n ) : null}\n {children}\n </Reakit.MenuGroup>\n )\n})\n\nexport { Menu, MenuButton, MenuList, MenuItem, SubMenu, MenuGroup }\nexport type { MenuButtonProps, MenuListProps, MenuItemProps, SubMenuProps, MenuGroupProps }\n"],"names":["MenuContext","React","Menu","children","onItemSelect","props","state","Reakit","loop","handleItemSelect","value","Provider","MenuButton","polymorphicComponent","ref","exceptionallySetClassName","className","classNames","BACKDROP_STYLE","width","height","position","top","left","MenuBackdrop","PopoverBackdrop","baseId","visible","animated","animating","stopAnimation","modal","style","MenuList","MenuItem","onSelect","hideOnSelect","onClick","hide","handleClick","event","shouldClose","defaultPrevented","undefined","SubMenu","parentMenuItemSelect","parentMenuHide","handleSubItemSelect","toArray","button","list","buttonProps","MenuGroup","label","role"],"mappings":"0VAyBMA,EAAcC,gBAMhB,IA4BJ,SAASC,SAAOC,IAAAA,SAAUC,IAAAA,aAAiBC,gEACjCC,EAAQC,gCAAsBC,MAAM,GAASH,IAE7CI,EAAmBR,eACrB,SAA0BS,GAClBN,GAAcA,EAAaM,KAEnC,CAACN,IAGCM,EAA0BT,WAC5B,qDACOK,OACHG,iBAAAA,MAEJ,CAACH,EAAOG,WAGLR,gBAACD,EAAYW,UAASD,MAAOA,GAAQP,OAY1CS,EAAaC,wBAAgD,WAE/DC,OADEC,IAAAA,0BAA8BV,oEAGOJ,aAAiBD,GAA3BM,gEAEzBL,gBAACM,8BACOF,EACAC,GACJQ,IAAKA,EACLE,UAAWC,EAAW,sBAAuBF,SAanDG,EAAsC,CACxCC,MAAO,OACPC,OAAQ,OACRC,SAAU,QACVC,IAAK,EACLC,KAAM,GAOV,SAASC,YAUDvB,gBAACwB,mBACGC,SAVRA,OAWQC,UAVRA,QAWQC,WAVRA,SAWQC,YAVRA,UAWQC,gBAVRA,cAWQC,QAVRA,MAWQC,MAAOd,KAVff,cAsBE8B,EAAWpB,wBAA2C,WAExDC,OADEC,IAAAA,0BAA8BV,oEAGOJ,aAAiBD,GAA3BM,gEACtBA,EAAMqB,QACT1B,gBAACuB,mBAAiBlB,GACdL,gBAACM,wBACOF,EACAC,GACJQ,IAAKA,EACLE,UAAWC,EAAW,oBAAqBF,OAGnD,QA8DFmB,EAAWrB,wBAA8C,WAU3DC,OARIJ,IAAAA,MACAP,IAAAA,SACAgC,IAAAA,aACAC,aAAAA,gBACAC,IAAAA,QACAtB,IAAAA,0BACGV,2HAIgCJ,aAAiBD,GAAhDS,IAAAA,iBAAqBH,yDACrBgC,EAAShC,EAATgC,KAEFC,EAActC,eAChB,SAAqBuC,GACjBH,MAAAA,GAAAA,EAAUG,OAGJC,GAAiC,KADnCN,IAAaK,EAAME,iBAAmBP,SAAaQ,IACPP,EAChD3B,EAAiBC,GACb+B,GAAaH,MAErB,CAACH,EAAUE,EAAS5B,EAAkB2B,EAAcE,EAAM5B,WAI1DT,gBAACM,4BACOF,EACAC,GACJQ,IAAKA,EACLuB,QAASE,EACTvB,UAAWD,IAEVZ,MAgCPyC,EAAU3C,cAAkD,WAE9Da,OADEX,IAAAA,SAAUC,IAAAA,aAAiBC,kEAGgCJ,aAAiBD,GAApD6C,IAAlBpC,iBAA2CH,yDACrCwC,EAAmBxC,EAAzBgC,KAEFS,EAAsB9C,eACxB,SAA6BS,GACrBN,GAAcA,EAAaM,GAC/BmC,EAAqBnC,GACrBoC,MAEJ,CAACA,EAAgBD,EAAsBzC,MAGpBH,WAAe+C,QAAQ7C,GAAvC8C,OAAQC,cAGXjD,gBAACM,4BAAoBD,EAAWD,GAAOS,IAAKA,KACvC,SAACqC,UACElD,gBAACC,GAAKE,aAAc2C,GACf9C,eAAmBgD,qCACbE,OACHnC,UAAWC,EAAWkC,EAAYnC,UAAW,8BAEhDkC,SAwBfE,EAAYvC,wBAA4C,WAE1DC,OADEuC,IAAAA,MAAOlD,IAAAA,SAAUY,IAAAA,0BAA8BV,uFAGVJ,aAAiBD,GAA3BM,gEAEzBL,gBAACM,2BAAiBO,IAAKA,GAAST,EAAWC,GAAOU,UAAWD,IACxDsC,EACGpD,uBAAKqD,KAAK,eAAetC,UAAU,6BAC9BqC,GAEL,KACHlD"}
1
+ {"version":3,"file":"menu.js","sources":["../../../src/components/menu/menu.tsx"],"sourcesContent":["import * as React from 'react'\nimport classNames from 'classnames'\nimport { polymorphicComponent } from '../../utils/polymorphism'\nimport { usePrevious } from '../../hooks/use-previous'\n\n//\n// Reactist menu is a thin wrapper around Reakit's menu components. This may or may not be\n// temporary. Our goal is to make it transparent for the users of Reactist of this implementation\n// detail. We may change in the future the external lib we use, or even implement it all internally,\n// as long as we keep the same outer interface as intact as possible.\n//\n// Around the heavy lifting of the external lib we just add some features to better integrate the\n// menu to Reactist's more opinionated approach (e.g. using our button with its custom variants and\n// other features, easily show keyboard shortcuts in menu items, etc.)\n//\nimport * as Reakit from 'reakit/Menu'\nimport { PopoverBackdrop } from 'reakit/Popover'\n\nimport './menu.less'\n\ntype NativeProps<E extends HTMLElement> = React.DetailedHTMLProps<React.HTMLAttributes<E>, E>\n\ntype MenuContextState = Reakit.MenuStateReturn & {\n handleItemSelect: (value: string | null | undefined) => void\n}\n\nconst MenuContext = React.createContext<MenuContextState>(\n // Reakit gives us no means to obtain a valid initial/default value of type MenuStateReturn\n // (it is normally obtained by calling useMenuState but we can't call hooks outside components).\n // This is however of little consequence since this value is only used if some of the components\n // are used outside Menu, something that should not happen and we do not support.\n // @ts-expect-error\n {},\n)\n\n//\n// Menu\n//\n\ntype MenuProps = Omit<Reakit.MenuInitialState, 'visible'> & {\n /**\n * The `Menu` must contain a `MenuList` that defines the menu options. It must also contain a\n * `MenuButton` that triggers the menu to be opened or closed.\n */\n children: React.ReactNode\n\n /**\n * An optional callback that will be called back whenever a menu item is selected. It receives\n * the `value` of the selected `MenuItem`.\n *\n * If you pass down this callback, it is recommended that you properly memoize it so it does not\n * change on every render.\n */\n onItemSelect?: (value: string | null | undefined) => void\n}\n\n/**\n * Wrapper component to control a menu. It does not render anything, only providing the state\n * management for the menu components inside it.\n */\nfunction Menu({ children, onItemSelect, ...props }: MenuProps) {\n const state = Reakit.useMenuState({ loop: true, ...props })\n\n const handleItemSelect = React.useCallback(\n function handleItemSelect(value: string | null | undefined) {\n if (onItemSelect) onItemSelect(value)\n },\n [onItemSelect],\n )\n\n const value: MenuContextState = React.useMemo(\n () => ({\n ...state,\n handleItemSelect,\n }),\n [state, handleItemSelect],\n )\n\n return <MenuContext.Provider value={value}>{children}</MenuContext.Provider>\n}\n\n//\n// MenuButton\n//\n\ntype MenuButtonProps = Omit<Reakit.MenuButtonProps, keyof Reakit.MenuStateReturn | 'className'>\n\n/**\n * A button to toggle a dropdown menu open or closed.\n */\nconst MenuButton = polymorphicComponent<'button', MenuButtonProps>(function MenuButton(\n { exceptionallySetClassName, ...props },\n ref,\n) {\n const { handleItemSelect, ...state } = React.useContext(MenuContext)\n return (\n <Reakit.MenuButton\n {...props}\n {...state}\n ref={ref}\n className={classNames('reactist_menubutton', exceptionallySetClassName)}\n />\n )\n})\n\n//\n// MenuList\n//\n\ntype MenuBackdropProps = Reakit.MenuStateReturn & {\n children: React.ReactNode\n}\n\nconst BACKDROP_STYLE: React.CSSProperties = {\n width: '100%',\n height: '100%',\n position: 'fixed',\n top: 0,\n left: 0,\n}\n\n/**\n * Internal component to provide a backdrop/overlay to all menus. This is needed because reakit's\n * menus do not show an overlay by default.\n */\nfunction MenuBackdrop({\n baseId,\n visible,\n animated,\n animating,\n stopAnimation,\n modal,\n children,\n}: MenuBackdropProps) {\n return (\n <PopoverBackdrop\n baseId={baseId}\n visible={visible}\n animated={animated}\n animating={animating}\n stopAnimation={stopAnimation}\n modal={modal}\n style={BACKDROP_STYLE}\n >\n {children}\n </PopoverBackdrop>\n )\n}\n\ntype MenuListProps = Omit<Reakit.MenuProps, keyof Reakit.MenuStateReturn | 'className'>\n\n/**\n * The dropdown menu itself, containing a list of menu items.\n */\nconst MenuList = polymorphicComponent<'div', MenuListProps>(function MenuList(\n { exceptionallySetClassName, ...props },\n ref,\n) {\n const { handleItemSelect, ...state } = React.useContext(MenuContext)\n const previousVisible = usePrevious(state.visible)\n\n React.useEffect(\n function focusTriggerOnClose() {\n if (state.visible === false && previousVisible === true) {\n state.unstable_referenceRef?.current?.focus()\n }\n },\n [state.visible, previousVisible, state.unstable_referenceRef],\n )\n\n return state.visible ? (\n <MenuBackdrop {...state}>\n <Reakit.Menu\n {...props}\n {...state}\n ref={ref}\n className={classNames('reactist_menulist', exceptionallySetClassName)}\n />\n </MenuBackdrop>\n ) : null\n})\n\n//\n// MenuItem\n//\n\ntype MenuItemProps = {\n /**\n * An optional value given to this menu item. It is passed on to the parent `Menu`'s\n * `onItemSelect` when you provide that instead of (or alongside) providing individual\n * `onSelect` callbacks to each menu item.\n */\n value?: string\n /**\n * The content inside the menu item.\n */\n children: React.ReactNode\n /**\n * When `true` the menu item is disabled and won't be selectable or be part of the keyboard\n * navigation across the menu options.\n *\n * @default true\n */\n disabled?: boolean\n /**\n * When `true` the menu will close when the menu item is selected, in addition to performing the\n * action that the menu item is set out to do.\n *\n * Set this to `false` to make sure that a given menu item does not auto-closes the menu when\n * selected. This should be the exception and not the norm, as the default is to auto-close.\n *\n * @default true\n */\n hideOnSelect?: boolean\n /**\n * The action to perform when the menu item is selected.\n *\n * If you return `false` from this function, the menu will not auto-close when this menu item\n * is selected. Though you should use `hideOnSelect` for this purpose, this allows you to\n * achieve the same effect conditionally and dynamically deciding at run time.\n */\n onSelect?: () => unknown\n /**\n * The event handler called when the menu item is clicked.\n *\n * This is similar to `onSelect`, but a bit different. You can certainly use it to trigger the\n * action that the menu item represents. But in general you should prefer `onSelect` for that.\n *\n * The main use for this handler is to get access to the click event. This can be used, for\n * example, to call `event.preventDefault()`, which will effectively prevent the rest of the\n * consequences of the click, including preventing `onSelect` from being called. In particular,\n * this is useful in menu items that are links, and you want the click to not trigger navigation\n * under some circumstances.\n */\n onClick?: (event: React.MouseEvent) => void\n}\n\n/**\n * A menu item inside a menu list. It can be selected by the user, triggering the `onSelect`\n * callback.\n */\nconst MenuItem = polymorphicComponent<'button', MenuItemProps>(function MenuItem(\n {\n value,\n children,\n onSelect,\n hideOnSelect = true,\n onClick,\n exceptionallySetClassName,\n ...props\n },\n ref,\n) {\n const { handleItemSelect, ...state } = React.useContext(MenuContext)\n const { hide } = state\n\n const handleClick = React.useCallback(\n function handleClick(event: React.MouseEvent<HTMLButtonElement>) {\n onClick?.(event)\n const onSelectResult: unknown =\n onSelect && !event.defaultPrevented ? onSelect() : undefined\n const shouldClose = onSelectResult !== false && hideOnSelect\n handleItemSelect(value)\n if (shouldClose) hide()\n },\n [onSelect, onClick, handleItemSelect, hideOnSelect, hide, value],\n )\n\n return (\n <Reakit.MenuItem\n {...props}\n {...state}\n ref={ref}\n onClick={handleClick}\n className={exceptionallySetClassName}\n >\n {children}\n </Reakit.MenuItem>\n )\n})\n\n//\n// SubMenu\n//\n\ntype SubMenuProps = Pick<MenuProps, 'children' | 'onItemSelect'>\n\n/**\n * This component can be rendered alongside other `MenuItem` inside a `MenuList` in order to have\n * a sub-menu.\n *\n * Its children are expected to have the structure of a first level menu (a `MenuButton` and a\n * `MenuList`).\n *\n * ```jsx\n * <MenuItem label=\"Edit profile\" />\n * <SubMenu>\n * <MenuButton>More options</MenuButton>\n * <MenuList>\n * <MenuItem label=\"Preferences\" />\n * <MenuItem label=\"Sign out\" />\n * </MenuList>\n * </SubMenu>\n * ```\n *\n * The `MenuButton` will become a menu item in the current menu items list, and it will lead to\n * opening a sub-menu with the menu items list below it.\n */\nconst SubMenu = React.forwardRef<HTMLButtonElement, SubMenuProps>(function SubMenu(\n { children, onItemSelect, ...props },\n ref,\n) {\n const { handleItemSelect: parentMenuItemSelect, ...state } = React.useContext(MenuContext)\n const { hide: parentMenuHide } = state\n\n const handleSubItemSelect = React.useCallback(\n function handleSubItemSelect(value) {\n if (onItemSelect) onItemSelect(value)\n parentMenuItemSelect(value)\n parentMenuHide()\n },\n [parentMenuHide, parentMenuItemSelect, onItemSelect],\n )\n\n const [button, list] = React.Children.toArray(children)\n\n return (\n <Reakit.MenuItem {...state} {...props} ref={ref}>\n {(buttonProps) => (\n <Menu onItemSelect={handleSubItemSelect}>\n {React.cloneElement(button as React.ReactElement, {\n ...buttonProps,\n className: classNames(buttonProps.className, 'reactist_submenu_button'),\n })}\n {list}\n </Menu>\n )}\n </Reakit.MenuItem>\n )\n})\n\n//\n// MenuGroup\n//\n\ntype MenuGroupProps = Omit<NativeProps<HTMLDivElement>, 'className'> & {\n /**\n * A label to be shown visually and also used to semantically label the group.\n */\n label: string\n}\n\n/**\n * A way to semantically group some menu items.\n *\n * This group does not add any visual separator. You can do that yourself adding `<hr />` elements\n * before and/or after the group if you so wish.\n */\nconst MenuGroup = polymorphicComponent<'div', MenuGroupProps>(function MenuGroud(\n { label, children, exceptionallySetClassName, ...props },\n ref,\n) {\n const { handleItemSelect, ...state } = React.useContext(MenuContext)\n return (\n <Reakit.MenuGroup ref={ref} {...props} {...state} className={exceptionallySetClassName}>\n {label ? (\n <div role=\"presentation\" className=\"reactist_menugroup__label\">\n {label}\n </div>\n ) : null}\n {children}\n </Reakit.MenuGroup>\n )\n})\n\nexport { Menu, MenuButton, MenuList, MenuItem, SubMenu, MenuGroup }\nexport type { MenuButtonProps, MenuListProps, MenuItemProps, SubMenuProps, MenuGroupProps }\n"],"names":["MenuContext","React","Menu","children","onItemSelect","props","state","Reakit","loop","handleItemSelect","value","Provider","MenuButton","polymorphicComponent","ref","exceptionallySetClassName","className","classNames","BACKDROP_STYLE","width","height","position","top","left","MenuBackdrop","PopoverBackdrop","baseId","visible","animated","animating","stopAnimation","modal","style","MenuList","previousVisible","usePrevious","unstable_referenceRef","current","focus","MenuItem","onSelect","hideOnSelect","onClick","hide","handleClick","event","shouldClose","defaultPrevented","undefined","SubMenu","parentMenuItemSelect","parentMenuHide","handleSubItemSelect","toArray","button","list","buttonProps","MenuGroup","label","role"],"mappings":"ywBA0BMA,EAAcC,gBAMhB,IA4BJ,SAASC,SAAOC,IAAAA,SAAUC,IAAAA,aAAiBC,sCACjCC,EAAQC,gCAAsBC,MAAM,GAASH,IAE7CI,EAAmBR,eACrB,SAA0BS,GAClBN,GAAcA,EAAaM,KAEnC,CAACN,IAGCM,EAA0BT,WAC5B,qDACOK,OACHG,iBAAAA,MAEJ,CAACH,EAAOG,WAGLR,gBAACD,EAAYW,UAASD,MAAOA,GAAQP,OAY1CS,EAAaC,wBAAgD,WAE/DC,OADEC,IAAAA,0BAA8BV,wCAGOJ,aAAiBD,GAA3BM,6CAEzBL,gBAACM,8BACOF,EACAC,GACJQ,IAAKA,EACLE,UAAWC,EAAW,sBAAuBF,SAanDG,EAAsC,CACxCC,MAAO,OACPC,OAAQ,OACRC,SAAU,QACVC,IAAK,EACLC,KAAM,GAOV,SAASC,YAUDvB,gBAACwB,mBACGC,SAVRA,OAWQC,UAVRA,QAWQC,WAVRA,SAWQC,YAVRA,UAWQC,gBAVRA,cAWQC,QAVRA,MAWQC,MAAOd,KAVff,cAsBE8B,EAAWpB,wBAA2C,WAExDC,OADEC,IAAAA,0BAA8BV,wCAGOJ,aAAiBD,GAA3BM,sCACvB4B,EAAkBC,cAAY7B,EAAMqB,gBAE1C1B,aACI,oBAC0B,IAAlBK,EAAMqB,UAAyC,IAApBO,cAC3B5B,EAAM8B,gDAAuBC,wBAASC,WAG9C,CAAChC,EAAMqB,QAASO,EAAiB5B,EAAM8B,wBAGpC9B,EAAMqB,QACT1B,gBAACuB,mBAAiBlB,GACdL,gBAACM,wBACOF,EACAC,GACJQ,IAAKA,EACLE,UAAWC,EAAW,oBAAqBF,OAGnD,QA8DFwB,EAAW1B,wBAA8C,WAU3DC,OARIJ,IAAAA,MACAP,IAAAA,SACAqC,IAAAA,aACAC,aAAAA,gBACAC,IAAAA,QACA3B,IAAAA,0BACGV,wCAIgCJ,aAAiBD,GAAhDS,IAAAA,iBAAqBH,sCACrBqC,EAASrC,EAATqC,KAEFC,EAAc3C,eAChB,SAAqB4C,GACjBH,MAAAA,GAAAA,EAAUG,OAGJC,GAAiC,KADnCN,IAAaK,EAAME,iBAAmBP,SAAaQ,IACPP,EAChDhC,EAAiBC,GACboC,GAAaH,MAErB,CAACH,EAAUE,EAASjC,EAAkBgC,EAAcE,EAAMjC,WAI1DT,gBAACM,4BACOF,EACAC,GACJQ,IAAKA,EACL4B,QAASE,EACT5B,UAAWD,IAEVZ,MAgCP8C,EAAUhD,cAAkD,WAE9Da,OADEX,IAAAA,SAAUC,IAAAA,aAAiBC,wCAGgCJ,aAAiBD,GAApDkD,IAAlBzC,iBAA2CH,sCACrC6C,EAAmB7C,EAAzBqC,KAEFS,EAAsBnD,eACxB,SAA6BS,GACrBN,GAAcA,EAAaM,GAC/BwC,EAAqBxC,GACrByC,MAEJ,CAACA,EAAgBD,EAAsB9C,MAGpBH,WAAeoD,QAAQlD,GAAvCmD,OAAQC,cAGXtD,gBAACM,4BAAoBD,EAAWD,GAAOS,IAAKA,KACvC,SAAC0C,UACEvD,gBAACC,GAAKE,aAAcgD,GACfnD,eAAmBqD,qCACbE,OACHxC,UAAWC,EAAWuC,EAAYxC,UAAW,8BAEhDuC,SAwBfE,EAAY5C,wBAA4C,WAE1DC,OADE4C,IAAAA,MAAOvD,IAAAA,SAAUY,IAAAA,0BAA8BV,wCAGVJ,aAAiBD,GAA3BM,6CAEzBL,gBAACM,2BAAiBO,IAAKA,GAAST,EAAWC,GAAOU,UAAWD,IACxD2C,EACGzD,uBAAK0D,KAAK,eAAe3C,UAAU,6BAC9B0C,GAEL,KACHvD"}
@@ -11,6 +11,8 @@ declare type NotificationProps = {
11
11
  onClose?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
12
12
  closeAltText?: string;
13
13
  className?: string;
14
- } & JSX.IntrinsicElements['div'];
15
- declare function Notification({ id, icon, title, subtitle, children, customCloseButton, onClick, onClose, closeAltText, className, ...rest }: NotificationProps): JSX.Element;
14
+ /** Indicates that the notification will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region. */
15
+ 'aria-live'?: 'off' | 'polite' | 'assertive';
16
+ } & Omit<JSX.IntrinsicElements['div'], 'aria-live'>;
17
+ declare function Notification({ id, icon, title, subtitle, children, customCloseButton, onClick, onClose, closeAltText, className, 'aria-live': ariaLive, ...rest }: NotificationProps): JSX.Element;
16
18
  export { Notification };
@@ -1,2 +1,2 @@
1
- "use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),l=t(require("react")),i=t(require("classnames")),n=require("../icons/CloseIcon.svg.js");exports.Notification=function(t){var o=t.id,a=t.icon,c=t.title,s=t.subtitle,r=t.children,u=t.customCloseButton,b=t.onClick,d=t.onClose,m=t.closeAltText,f=void 0===m?"Close":m,_=t.className,C=e.objectWithoutPropertiesLoose(t,["id","icon","title","subtitle","children","customCloseButton","onClick","onClose","closeAltText","className"]),N=c?o+"-title":null,g=N?{id:N}:null,j=s?o+"-subtitle":null,p=j?{id:j}:null,v=r?o+"-content":null,E=v?{"aria-labelledby":v}:N?{"aria-labelledby":N}:null,h=j&&!r?{"aria-describedby":j}:null,y=l.createElement("div",Object.assign({className:"reactist-notification__content"},r?{id:o+"-content"}:null),null!=r?r:l.createElement(l.Fragment,null,c?l.createElement("h3",Object.assign({className:"reactist-notification__title"},g),c):null,s?l.createElement("p",Object.assign({className:"reactist-notification__subtitle"},p),s):null)),B=l.createElement("div",{className:"reactist-notification__icon-content-group"},null!=a?a:null,y);return l.createElement("div",Object.assign({id:o,role:"dialog",className:i("reactist-notification",_,{"reactist-notification--with-button":Boolean(b),"reactist-notification--with-close-button":Boolean(d)})},E,h,C),b?l.createElement("button",{className:"reactist-notification__button",onClick:b},B):B,d?l.createElement("button",{className:"reactist-notification__close-button",onClick:d,"aria-label":f},null!=u?u:l.createElement(n.default,null)):null)};
1
+ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../../_virtual/_rollupPluginBabelHelpers.js"),l=e(require("react")),i=e(require("classnames")),n=require("../icons/CloseIcon.svg.js"),a=["id","icon","title","subtitle","children","customCloseButton","onClick","onClose","closeAltText","className","aria-live"];exports.Notification=function(e){var o=e.id,c=e.icon,s=e.title,r=e.subtitle,u=e.children,b=e.customCloseButton,d=e.onClick,m=e.onClose,f=e.closeAltText,_=void 0===f?"Close":f,v=e.className,p=e["aria-live"],C=void 0===p?"polite":p,N=t.objectWithoutPropertiesLoose(e,a),j=s?o+"-title":null,E=j?{id:j}:null,g=r?o+"-subtitle":null,h=g?{id:g}:null,y=u?o+"-content":null,B=y?{"aria-labelledby":y}:j?{"aria-labelledby":j}:null,O=g&&!u?{"aria-describedby":g}:null,k=l.createElement("div",Object.assign({className:"reactist-notification__content"},u?{id:o+"-content"}:null),null!=u?u:l.createElement(l.Fragment,null,s?l.createElement("h3",Object.assign({className:"reactist-notification__title"},E),s):null,r?l.createElement("p",Object.assign({className:"reactist-notification__subtitle"},h),r):null)),q=l.createElement("div",{className:"reactist-notification__icon-content-group"},null!=c?c:null,k);return l.createElement("div",Object.assign({id:o,role:"alert",className:i("reactist-notification",v,{"reactist-notification--with-button":Boolean(d),"reactist-notification--with-close-button":Boolean(m)}),"aria-live":C},B,O,N),d?l.createElement("button",{className:"reactist-notification__button",onClick:d},q):q,m?l.createElement("button",{className:"reactist-notification__close-button",onClick:m,"aria-label":_},null!=b?b:l.createElement(n.default,null)):null)};
2
2
  //# sourceMappingURL=notification.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"notification.js","sources":["../../../src/components/notification/notification.tsx"],"sourcesContent":["import React from 'react'\nimport classNames from 'classnames'\nimport CloseIcon from '../icons/CloseIcon.svg'\nimport './notification.less'\n\ntype NotificationProps = {\n id: string\n icon?: React.ReactNode\n title?: React.ReactNode\n subtitle?: React.ReactNode\n children?: React.ReactNode\n customCloseButton?: React.ReactNode\n onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void\n onClose?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void\n closeAltText?: string\n className?: string\n} & JSX.IntrinsicElements['div']\n\nfunction Notification({\n id,\n icon,\n title,\n subtitle,\n children,\n customCloseButton,\n onClick,\n onClose,\n closeAltText = 'Close',\n className,\n ...rest\n}: NotificationProps) {\n const titleId = title ? `${id}-title` : null\n const titleIdAttribute = titleId ? { id: titleId } : null\n const subtitleId = subtitle ? `${id}-subtitle` : null\n const subtitleIdAttribute = subtitleId ? { id: subtitleId } : null\n const contentId = children ? `${id}-content` : null\n const contentIdAttribute = children ? { id: `${id}-content` } : null\n const ariaLabelledBy = contentId\n ? { 'aria-labelledby': contentId }\n : titleId\n ? { 'aria-labelledby': titleId }\n : null\n const ariaDescribedBy = subtitleId && !children ? { 'aria-describedby': subtitleId } : null\n\n const notificationContent = (\n <div className=\"reactist-notification__content\" {...contentIdAttribute}>\n {children ?? (\n <>\n {title ? (\n <h3 className=\"reactist-notification__title\" {...titleIdAttribute}>\n {title}\n </h3>\n ) : null}\n {subtitle ? (\n <p className=\"reactist-notification__subtitle\" {...subtitleIdAttribute}>\n {subtitle}\n </p>\n ) : null}\n </>\n )}\n </div>\n )\n const notificationBody = (\n <div className=\"reactist-notification__icon-content-group\">\n {icon ?? null}\n {notificationContent}\n </div>\n )\n\n return (\n <div\n id={id}\n role=\"dialog\"\n className={classNames('reactist-notification', className, {\n 'reactist-notification--with-button': Boolean(onClick),\n 'reactist-notification--with-close-button': Boolean(onClose),\n })}\n {...ariaLabelledBy}\n {...ariaDescribedBy}\n {...rest}\n >\n {onClick ? (\n <button className=\"reactist-notification__button\" onClick={onClick}>\n {notificationBody}\n </button>\n ) : (\n notificationBody\n )}\n\n {onClose ? (\n <button\n className=\"reactist-notification__close-button\"\n onClick={onClose}\n aria-label={closeAltText}\n >\n {customCloseButton ?? <CloseIcon />}\n </button>\n ) : null}\n </div>\n )\n}\n\nexport { Notification }\n"],"names":["id","icon","title","subtitle","children","customCloseButton","onClick","onClose","closeAltText","className","rest","titleId","titleIdAttribute","subtitleId","subtitleIdAttribute","contentId","ariaLabelledBy","ariaDescribedBy","notificationContent","React","notificationBody","role","classNames","Boolean","CloseIcon"],"mappings":"oTAkBA,gBACIA,IAAAA,GACAC,IAAAA,KACAC,IAAAA,MACAC,IAAAA,SACAC,IAAAA,SACAC,IAAAA,kBACAC,IAAAA,QACAC,IAAAA,YACAC,aAAAA,aAAe,UACfC,IAAAA,UACGC,mJAEGC,EAAUT,EAAWF,WAAa,KAClCY,EAAmBD,EAAU,CAAEX,GAAIW,GAAY,KAC/CE,EAAaV,EAAcH,cAAgB,KAC3Cc,EAAsBD,EAAa,CAAEb,GAAIa,GAAe,KACxDE,EAAYX,EAAcJ,aAAe,KAEzCgB,EAAiBD,EACjB,mBAAqBA,GACrBJ,EACA,mBAAqBA,GACrB,KACAM,EAAkBJ,IAAeT,EAAW,oBAAsBS,GAAe,KAEjFK,EACFC,qCAAKV,UAAU,kCATQL,EAAW,CAAEJ,GAAOA,cAAiB,MAUvDI,MAAAA,EAAAA,EACGe,gCACKjB,EACGiB,oCAAIV,UAAU,gCAAmCG,GAC5CV,GAEL,KACHC,EACGgB,mCAAGV,UAAU,mCAAsCK,GAC9CX,GAEL,OAKdiB,EACFD,uBAAKV,UAAU,6CACVR,MAAAA,EAAAA,EAAQ,KACRiB,UAKLC,qCACInB,GAAIA,EACJqB,KAAK,SACLZ,UAAWa,EAAW,wBAAyBb,EAAW,sCAChBc,QAAQjB,8CACFiB,QAAQhB,MAEpDS,EACAC,EACAP,GAEHJ,EACGa,0BAAQV,UAAU,gCAAgCH,QAASA,GACtDc,GAGLA,EAGHb,EACGY,0BACIV,UAAU,sCACVH,QAASC,eACGC,GAEXH,MAAAA,EAAAA,EAAqBc,gBAACK,iBAE3B"}
1
+ {"version":3,"file":"notification.js","sources":["../../../src/components/notification/notification.tsx"],"sourcesContent":["import React from 'react'\nimport classNames from 'classnames'\nimport CloseIcon from '../icons/CloseIcon.svg'\nimport './notification.less'\n\ntype NotificationProps = {\n id: string\n icon?: React.ReactNode\n title?: React.ReactNode\n subtitle?: React.ReactNode\n children?: React.ReactNode\n customCloseButton?: React.ReactNode\n onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void\n onClose?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void\n closeAltText?: string\n className?: string\n /** Indicates that the notification will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region. */\n 'aria-live'?: 'off' | 'polite' | 'assertive'\n} & Omit<JSX.IntrinsicElements['div'], 'aria-live'>\n\nfunction Notification({\n id,\n icon,\n title,\n subtitle,\n children,\n customCloseButton,\n onClick,\n onClose,\n closeAltText = 'Close',\n className,\n 'aria-live': ariaLive = 'polite',\n ...rest\n}: NotificationProps) {\n const titleId = title ? `${id}-title` : null\n const titleIdAttribute = titleId ? { id: titleId } : null\n const subtitleId = subtitle ? `${id}-subtitle` : null\n const subtitleIdAttribute = subtitleId ? { id: subtitleId } : null\n const contentId = children ? `${id}-content` : null\n const contentIdAttribute = children ? { id: `${id}-content` } : null\n const ariaLabelledBy = contentId\n ? { 'aria-labelledby': contentId }\n : titleId\n ? { 'aria-labelledby': titleId }\n : null\n const ariaDescribedBy = subtitleId && !children ? { 'aria-describedby': subtitleId } : null\n\n const notificationContent = (\n <div className=\"reactist-notification__content\" {...contentIdAttribute}>\n {children ?? (\n <>\n {title ? (\n <h3 className=\"reactist-notification__title\" {...titleIdAttribute}>\n {title}\n </h3>\n ) : null}\n {subtitle ? (\n <p className=\"reactist-notification__subtitle\" {...subtitleIdAttribute}>\n {subtitle}\n </p>\n ) : null}\n </>\n )}\n </div>\n )\n const notificationBody = (\n <div className=\"reactist-notification__icon-content-group\">\n {icon ?? null}\n {notificationContent}\n </div>\n )\n\n return (\n <div\n id={id}\n role=\"alert\"\n className={classNames('reactist-notification', className, {\n 'reactist-notification--with-button': Boolean(onClick),\n 'reactist-notification--with-close-button': Boolean(onClose),\n })}\n aria-live={ariaLive}\n {...ariaLabelledBy}\n {...ariaDescribedBy}\n {...rest}\n >\n {onClick ? (\n <button className=\"reactist-notification__button\" onClick={onClick}>\n {notificationBody}\n </button>\n ) : (\n notificationBody\n )}\n\n {onClose ? (\n <button\n className=\"reactist-notification__close-button\"\n onClick={onClose}\n aria-label={closeAltText}\n >\n {customCloseButton ?? <CloseIcon />}\n </button>\n ) : null}\n </div>\n )\n}\n\nexport { Notification }\n"],"names":["id","icon","title","subtitle","children","customCloseButton","onClick","onClose","closeAltText","className","ariaLive","rest","titleId","titleIdAttribute","subtitleId","subtitleIdAttribute","contentId","ariaLabelledBy","ariaDescribedBy","notificationContent","React","notificationBody","role","classNames","Boolean","CloseIcon"],"mappings":"ibAoBA,gBACIA,IAAAA,GACAC,IAAAA,KACAC,IAAAA,MACAC,IAAAA,SACAC,IAAAA,SACAC,IAAAA,kBACAC,IAAAA,QACAC,IAAAA,YACAC,aAAAA,aAAe,UACfC,IAAAA,cACA,aAAaC,aAAW,WACrBC,sCAEGC,EAAUV,EAAWF,WAAa,KAClCa,EAAmBD,EAAU,CAAEZ,GAAIY,GAAY,KAC/CE,EAAaX,EAAcH,cAAgB,KAC3Ce,EAAsBD,EAAa,CAAEd,GAAIc,GAAe,KACxDE,EAAYZ,EAAcJ,aAAe,KAEzCiB,EAAiBD,EACjB,mBAAqBA,GACrBJ,EACA,mBAAqBA,GACrB,KACAM,EAAkBJ,IAAeV,EAAW,oBAAsBU,GAAe,KAEjFK,EACFC,qCAAKX,UAAU,kCATQL,EAAW,CAAEJ,GAAOA,cAAiB,MAUvDI,MAAAA,EAAAA,EACGgB,gCACKlB,EACGkB,oCAAIX,UAAU,gCAAmCI,GAC5CX,GAEL,KACHC,EACGiB,mCAAGX,UAAU,mCAAsCM,GAC9CZ,GAEL,OAKdkB,EACFD,uBAAKX,UAAU,6CACVR,MAAAA,EAAAA,EAAQ,KACRkB,UAKLC,qCACIpB,GAAIA,EACJsB,KAAK,QACLb,UAAWc,EAAW,wBAAyBd,EAAW,sCAChBe,QAAQlB,8CACFkB,QAAQjB,iBAE7CG,GACPO,EACAC,EACAP,GAEHL,EACGc,0BAAQX,UAAU,gCAAgCH,QAASA,GACtDe,GAGLA,EAGHd,EACGa,0BACIX,UAAU,sCACVH,QAASC,eACGC,GAEXH,MAAAA,EAAAA,EAAqBe,gBAACK,iBAE3B"}
@@ -5,8 +5,10 @@ declare type Props = {
5
5
  className?: string;
6
6
  /** How much of the progress bar should be filled. Number between 0 and 100 inclusive. */
7
7
  fillPercentage?: number;
8
+ /** Defines the human readable text alternative for assitive technologies. */
9
+ 'aria-valuetext'?: string;
8
10
  };
9
- declare function ProgressBar({ fillPercentage, className }: Props): JSX.Element;
11
+ declare function ProgressBar({ fillPercentage, className, 'aria-valuetext': ariaValuetext }: Props): JSX.Element;
10
12
  declare namespace ProgressBar {
11
13
  var displayName: string;
12
14
  }
@@ -1,2 +1,2 @@
1
- "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var r=e(require("react")),t=e(require("classnames"));function a(e){var a=e.fillPercentage,s=void 0===a?0:a,i=t("reactist_progress_bar",e.className);return r.createElement("div",{className:i},r.createElement("div",{className:"inner",style:{width:(s<0?0:s>100?100:s)+"%"}}))}a.displayName="ProgressBar",exports.ProgressBar=a;
1
+ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var r=e(require("react")),a=e(require("classnames")),t=require("../../new-components/hidden-visually/hidden-visually.js");function s(e){var s=e.fillPercentage,l=void 0===s?0:s,i=e["aria-valuetext"],n=a("reactist_progress_bar",e.className),u=l<0?0:l>100?100:l;return r.createElement("div",{className:n},r.createElement("div",{className:"inner",style:{width:u+"%"}}),r.createElement(t.HiddenVisually,null,r.createElement("progress",{value:u,max:100,"aria-valuetext":null!=i?i:void 0})))}s.displayName="ProgressBar",exports.ProgressBar=s;
2
2
  //# sourceMappingURL=progress-bar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"progress-bar.js","sources":["../../../src/components/progress-bar/progress-bar.tsx"],"sourcesContent":["import React from 'react'\nimport classNames from 'classnames'\n\nimport './progress-bar.less'\n\ntype Props = {\n /** Additional css class applied to the progress bar. */\n className?: string\n /** How much of the progress bar should be filled. Number between 0 and 100 inclusive. */\n fillPercentage?: number\n}\nfunction ProgressBar({ fillPercentage = 0, className }: Props) {\n const finalClassName = classNames('reactist_progress_bar', className)\n const width = fillPercentage < 0 ? 0 : fillPercentage > 100 ? 100 : fillPercentage\n return (\n <div className={finalClassName}>\n <div className=\"inner\" style={{ width: `${width}%` }} />\n </div>\n )\n}\nProgressBar.displayName = 'ProgressBar'\n\nexport { ProgressBar }\n"],"names":["ProgressBar","fillPercentage","finalClassName","classNames","className","React","style","width","displayName"],"mappings":"+LAWA,SAASA,aAAcC,eAAAA,aAAiB,IAC9BC,EAAiBC,EAAW,0BADKC,kBAInCC,uBAAKD,UAAWF,GACZG,uBAAKD,UAAU,QAAQE,MAAO,CAAEC,OAH1BN,EAAiB,EAAI,EAAIA,EAAiB,IAAM,IAAMA,WAOxED,EAAYQ,YAAc"}
1
+ {"version":3,"file":"progress-bar.js","sources":["../../../src/components/progress-bar/progress-bar.tsx"],"sourcesContent":["import React from 'react'\nimport { HiddenVisually } from '../../new-components/hidden-visually'\nimport classNames from 'classnames'\n\nimport './progress-bar.less'\n\ntype Props = {\n /** Additional css class applied to the progress bar. */\n className?: string\n /** How much of the progress bar should be filled. Number between 0 and 100 inclusive. */\n fillPercentage?: number\n /** Defines the human readable text alternative for assitive technologies. */\n 'aria-valuetext'?: string\n}\nfunction ProgressBar({ fillPercentage = 0, className, 'aria-valuetext': ariaValuetext }: Props) {\n const finalClassName = classNames('reactist_progress_bar', className)\n const width = fillPercentage < 0 ? 0 : fillPercentage > 100 ? 100 : fillPercentage\n return (\n <div className={finalClassName}>\n <div className=\"inner\" style={{ width: `${width}%` }} />\n <HiddenVisually>\n <progress value={width} max={100} aria-valuetext={ariaValuetext ?? undefined} />\n </HiddenVisually>\n </div>\n )\n}\nProgressBar.displayName = 'ProgressBar'\n\nexport { ProgressBar }\n"],"names":["ProgressBar","fillPercentage","ariaValuetext","finalClassName","classNames","className","width","React","style","HiddenVisually","value","max","undefined","displayName"],"mappings":"oQAcA,SAASA,aAAcC,eAAAA,aAAiB,IAAgCC,IAAlB,kBAC5CC,EAAiBC,EAAW,0BADKC,WAEjCC,EAAQL,EAAiB,EAAI,EAAIA,EAAiB,IAAM,IAAMA,SAEhEM,uBAAKF,UAAWF,GACZI,uBAAKF,UAAU,QAAQG,MAAO,CAAEF,MAAUA,SAC1CC,gBAACE,sBACGF,4BAAUG,MAAOJ,EAAOK,IAAK,qBAAqBT,MAAAA,EAAAA,OAAiBU,MAKnFZ,EAAYa,YAAc"}
@@ -1,2 +1,2 @@
1
- "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var a=require("../../_virtual/_rollupPluginBabelHelpers.js"),t=e(require("react")),l=e(require("classnames"));function s(e){var s=e.value,u=e.options,i=void 0===u?[]:u,o=e.onChange,r=e.disabled,n=void 0===r||r,d=e.className,c=void 0===d?"":d,v=e.defaultValue,p=a.objectWithoutPropertiesLoose(e,["value","options","onChange","disabled","className","defaultValue"]),b=l("reactist_select",{disabled:n},c);return t.createElement("select",Object.assign({className:b,value:s,onChange:function(e){return o?o(e.target.value):void 0},disabled:n,defaultValue:v},p),null==i?void 0:i.map((function(e){return t.createElement("option",{key:e.key||e.value,value:e.value,disabled:e.disabled},e.text)})))}s.displayName="Select",s.defaultProps={options:[],disabled:!1},exports.Select=s;
1
+ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var a=require("../../_virtual/_rollupPluginBabelHelpers.js"),t=e(require("react")),l=e(require("classnames")),s=["value","options","onChange","disabled","className","defaultValue"];function u(e){var u=e.value,i=e.options,o=void 0===i?[]:i,r=e.onChange,n=e.disabled,d=void 0===n||n,c=e.className,v=void 0===c?"":c,p=e.defaultValue,b=a.objectWithoutPropertiesLoose(e,s),f=l("reactist_select",{disabled:d},v);return t.createElement("select",Object.assign({className:f,value:u,onChange:function(e){return r?r(e.target.value):void 0},disabled:d,defaultValue:p},b),null==o?void 0:o.map((function(e){return t.createElement("option",{key:e.key||e.value,value:e.value,disabled:e.disabled},e.text)})))}u.displayName="Select",u.defaultProps={options:[],disabled:!1},exports.Select=u;
2
2
  //# sourceMappingURL=select.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"select.js","sources":["../../../src/components/select/select.tsx"],"sourcesContent":["import React from 'react'\nimport classNames from 'classnames'\n\nimport './select.less'\n\ntype Option = {\n /** Optional key for each option. If not provided `value` is used. */\n key?: string | number\n /** Value of the option. */\n value: string | number\n /** Text to display for the option. */\n text?: string | number\n /** Whether the options is disabled or not. */\n disabled?: boolean\n}\n\ntype Props = {\n className?: string\n disabled?: boolean\n /** Currently selected value. */\n value?: string | number\n /** Callback for the change event. Will be called with the next value (not the full event). */\n onChange?: (value: string) => void\n /** Options that are rendered in the select. */\n options?: Option[]\n /** Value to initially be set */\n defaultValue?: string | number\n}\n\nfunction Select({\n value,\n options = [],\n onChange,\n disabled = true,\n className = '',\n defaultValue,\n ...otherProps\n}: Props) {\n const selectClassName = classNames('reactist_select', { disabled }, className)\n return (\n <select\n className={selectClassName}\n value={value}\n onChange={(event) => (onChange ? onChange(event.target.value) : undefined)}\n disabled={disabled}\n defaultValue={defaultValue}\n {...otherProps}\n >\n {options?.map((option) => (\n <option\n key={option.key || option.value}\n value={option.value}\n disabled={option.disabled}\n >\n {option.text}\n </option>\n ))}\n </select>\n )\n}\nSelect.displayName = 'Select'\nSelect.defaultProps = {\n options: [],\n disabled: false,\n}\n\nexport { Select }\n"],"names":["Select","value","options","onChange","disabled","className","defaultValue","otherProps","selectClassName","classNames","React","event","target","undefined","map","option","key","text","displayName","defaultProps"],"mappings":"wPA6BA,SAASA,SACLC,IAAAA,UACAC,QAAAA,aAAU,KACVC,IAAAA,aACAC,SAAAA,oBACAC,UAAAA,aAAY,KACZC,IAAAA,aACGC,yGAEGC,EAAkBC,EAAW,kBAAmB,CAAEL,SAAAA,GAAYC,UAEhEK,wCACIL,UAAWG,EACXP,MAAOA,EACPE,SAAU,SAACQ,UAAWR,EAAWA,EAASQ,EAAMC,OAAOX,YAASY,GAChET,SAAUA,EACVE,aAAcA,GACVC,GAEHL,MAAAA,SAAAA,EAASY,KAAI,SAACC,UACXL,0BACIM,IAAKD,EAAOC,KAAOD,EAAOd,MAC1BA,MAAOc,EAAOd,MACdG,SAAUW,EAAOX,UAEhBW,EAAOE,UAM5BjB,EAAOkB,YAAc,SACrBlB,EAAOmB,aAAe,CAClBjB,QAAS,GACTE,UAAU"}
1
+ {"version":3,"file":"select.js","sources":["../../../src/components/select/select.tsx"],"sourcesContent":["import React from 'react'\nimport classNames from 'classnames'\n\nimport './select.less'\n\ntype Option = {\n /** Optional key for each option. If not provided `value` is used. */\n key?: string | number\n /** Value of the option. */\n value: string | number\n /** Text to display for the option. */\n text?: string | number\n /** Whether the options is disabled or not. */\n disabled?: boolean\n}\n\ntype Props = {\n className?: string\n disabled?: boolean\n /** Currently selected value. */\n value?: string | number\n /** Callback for the change event. Will be called with the next value (not the full event). */\n onChange?: (value: string) => void\n /** Options that are rendered in the select. */\n options?: Option[]\n /** Value to initially be set */\n defaultValue?: string | number\n}\n\nfunction Select({\n value,\n options = [],\n onChange,\n disabled = true,\n className = '',\n defaultValue,\n ...otherProps\n}: Props) {\n const selectClassName = classNames('reactist_select', { disabled }, className)\n return (\n <select\n className={selectClassName}\n value={value}\n onChange={(event) => (onChange ? onChange(event.target.value) : undefined)}\n disabled={disabled}\n defaultValue={defaultValue}\n {...otherProps}\n >\n {options?.map((option) => (\n <option\n key={option.key || option.value}\n value={option.value}\n disabled={option.disabled}\n >\n {option.text}\n </option>\n ))}\n </select>\n )\n}\nSelect.displayName = 'Select'\nSelect.defaultProps = {\n options: [],\n disabled: false,\n}\n\nexport { Select }\n"],"names":["Select","value","options","onChange","disabled","className","defaultValue","otherProps","selectClassName","classNames","React","event","target","undefined","map","option","key","text","displayName","defaultProps"],"mappings":"+TA6BA,SAASA,SACLC,IAAAA,UACAC,QAAAA,aAAU,KACVC,IAAAA,aACAC,SAAAA,oBACAC,UAAAA,aAAY,KACZC,IAAAA,aACGC,sCAEGC,EAAkBC,EAAW,kBAAmB,CAAEL,SAAAA,GAAYC,UAEhEK,wCACIL,UAAWG,EACXP,MAAOA,EACPE,SAAU,SAACQ,UAAWR,EAAWA,EAASQ,EAAMC,OAAOX,YAASY,GAChET,SAAUA,EACVE,aAAcA,GACVC,GAEHL,MAAAA,SAAAA,EAASY,KAAI,SAACC,UACXL,0BACIM,IAAKD,EAAOC,KAAOD,EAAOd,MAC1BA,MAAOc,EAAOd,MACdG,SAAUW,EAAOX,UAEhBW,EAAOE,UAM5BjB,EAAOkB,YAAc,SACrBlB,EAAOmB,aAAe,CAClBjB,QAAS,GACTE,UAAU"}
@@ -1,2 +1,2 @@
1
- "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../../_virtual/_rollupPluginBabelHelpers.js"),n=e(require("react")),o=e(require("classnames")),r=require("reakit/Tooltip");exports.HIDE_DELAY=100,exports.SHOW_DELAY=500,exports.Tooltip=function(e){var u,i,c,s,l=e.children,a=e.content,p=e.position,f=void 0===p?"top":p,d=e.gapSize,m=void 0===d?3:d,b=e.className,E=t.objectWithoutPropertiesLoose(e,["children","content","position","gapSize","className"]),v=(c=r.useTooltipState({placement:f,gutter:m}),u=n.useRef(),i=n.useCallback((function(){null!=u.current&&clearTimeout(u.current)}),[]),n.useEffect((function(){return i}),[i]),s=n.useCallback((function(e,t){return function(){i(),u.current=setTimeout(e,t)}}),[i]),n.useMemo((function(){return t.objectSpread2(t.objectSpread2({},c),{},{show:s((function(){return c.show()}),500),hide:s((function(){return c.hide()}),100)})}),[s,c])),h=n.Children.only(l);return a?n.createElement(n.Fragment,null,n.createElement(r.TooltipReference,Object.assign({},v,{ref:h.ref},h.props,{onFocus:function(e){e.currentTarget.addEventListener("keyup",(function(e){var t=e.key;"Escape"!==t&&"Enter"!==t&&"Space"!==t&&v.show()}),{once:!0}),e.preventDefault(),"function"==typeof h.props.onFocus&&h.props.onFocus(e)}}),(function(e){return n.cloneElement(h,e)})),v.visible?n.createElement(r.Tooltip,Object.assign({},v,E,{className:o("reactist_tooltip",b)}),"function"==typeof a?a():a):null):h};
1
+ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../../_virtual/_rollupPluginBabelHelpers.js"),n=e(require("react")),o=e(require("classnames")),r=require("reakit/Tooltip"),u=["children","content","position","gapSize","className"];exports.HIDE_DELAY=100,exports.SHOW_DELAY=500,exports.Tooltip=function(e){var i,c,s,l,a=e.children,p=e.content,f=e.position,d=void 0===f?"top":f,m=e.gapSize,b=void 0===m?3:m,E=e.className,v=t.objectWithoutPropertiesLoose(e,u),h=(s=r.useTooltipState({placement:d,gutter:b}),i=n.useRef(),c=n.useCallback((function(){null!=i.current&&clearTimeout(i.current)}),[]),n.useEffect((function(){return c}),[c]),l=n.useCallback((function(e,t){return function(){c(),i.current=setTimeout(e,t)}}),[c]),n.useMemo((function(){return t.objectSpread2(t.objectSpread2({},s),{},{show:l((function(){return s.show()}),500),hide:l((function(){return s.hide()}),100)})}),[l,s])),g=n.Children.only(a);return p?n.createElement(n.Fragment,null,n.createElement(r.TooltipReference,Object.assign({},h,{ref:g.ref},g.props,{onFocus:function(e){e.currentTarget.addEventListener("keyup",(function(e){var t=e.key;"Escape"!==t&&"Enter"!==t&&"Space"!==t&&h.show()}),{once:!0}),e.preventDefault(),"function"==typeof g.props.onFocus&&g.props.onFocus(e)}}),(function(e){return n.cloneElement(g,e)})),h.visible?n.createElement(r.Tooltip,Object.assign({},h,v,{className:o("reactist_tooltip",E)}),"function"==typeof p?p():p):null):g};
2
2
  //# sourceMappingURL=tooltip.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.js","sources":["../../../src/components/tooltip/tooltip.tsx"],"sourcesContent":["import React from 'react'\nimport classNames from 'classnames'\n\nimport {\n useTooltipState,\n TooltipInitialState,\n Tooltip as ReakitTooltip,\n TooltipReference,\n TooltipProps as ReakitTooltipProps,\n} from 'reakit/Tooltip'\nimport { PopoverState } from 'reakit/Popover'\n\nimport './tooltip.less'\n\ntype TooltipProps = Omit<ReakitTooltipProps, 'children'> & {\n children: React.ReactNode\n content: React.ReactNode | (() => React.ReactNode)\n position?: PopoverState['placement']\n gapSize?: number\n}\n\n// These are exported to be used in the tests, they are not meant to be exported publicly\nexport const SHOW_DELAY = 500\nexport const HIDE_DELAY = 100\n\nfunction useDelayedTooltipState(initialState: TooltipInitialState) {\n const tooltipState = useTooltipState(initialState)\n const delay = useDelay()\n return React.useMemo(\n () => ({\n ...tooltipState,\n show: delay(() => tooltipState.show(), SHOW_DELAY),\n hide: delay(() => tooltipState.hide(), HIDE_DELAY),\n }),\n [delay, tooltipState],\n )\n}\n\nfunction Tooltip({\n children,\n content,\n position = 'top',\n gapSize = 3,\n className,\n ...props\n}: TooltipProps) {\n const tooltip = useDelayedTooltipState({ placement: position, gutter: gapSize })\n\n const child = React.Children.only<React.ReactElement>(children as React.ReactElement)\n if (!content) {\n return child\n }\n\n /**\n * Prevents the tooltip from automatically firing on focus all the time. This is to prevent\n * tooltips from showing when the trigger element is focused back after a popover or dialog that\n * it opened was closed. See link below for more details.\n * @see https://github.com/reakit/reakit/discussions/749\n */\n function handleFocus(event: React.FocusEvent) {\n // If focus is not followed by a key up event, does it mean that it's not\n // an intentional keyboard focus? Not sure but it seems to work.\n // This may be resolved soon in an upcoming version of reakit:\n // https://github.com/reakit/reakit/issues/750\n function handleKeyUp(e: Event) {\n const eventKey = (e as KeyboardEvent).key\n if (eventKey !== 'Escape' && eventKey !== 'Enter' && eventKey !== 'Space') {\n tooltip.show()\n }\n }\n event.currentTarget.addEventListener('keyup', handleKeyUp, { once: true })\n // Prevent tooltip.show from being called by TooltipReference\n event.preventDefault()\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access\n if (typeof child.props.onFocus === 'function') child.props.onFocus(event)\n }\n\n return (\n <>\n <TooltipReference\n {...tooltip}\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment\n ref={(child as any).ref}\n {...child.props}\n onFocus={handleFocus}\n >\n {(referenceProps) => React.cloneElement(child, referenceProps)}\n </TooltipReference>\n {tooltip.visible ? (\n <ReakitTooltip\n {...tooltip}\n {...props}\n className={classNames('reactist_tooltip', className)}\n >\n {typeof content === 'function' ? content() : content}\n </ReakitTooltip>\n ) : null}\n </>\n )\n}\n\nexport type { TooltipProps }\nexport { Tooltip }\n\n//\n// Internal helpers\n//\n\n/**\n * Returns a function offering the same interface as setTimeout, but cleans up on unmount.\n *\n * The timeout state is shared, and only one delayed function can be active at any given time. If\n * a new delayed function is called while another one was waiting for its time to run, that older\n * invocation is cleared and it never runs.\n *\n * This is suitable for our use case here, but probably not the most intuitive thing in general.\n * That's why this is not made a shared util or something like it.\n */\nfunction useDelay() {\n const timeoutRef = React.useRef<ReturnType<typeof setTimeout>>()\n\n const clearTimeouts = React.useCallback(function clearTimeouts() {\n if (timeoutRef.current != null) {\n clearTimeout(timeoutRef.current)\n }\n }, [])\n\n // Runs clearTimeouts when the component is unmounted\n React.useEffect(() => clearTimeouts, [clearTimeouts])\n\n return React.useCallback(\n function delay(fn: () => void, delay: number) {\n return () => {\n clearTimeouts()\n timeoutRef.current = setTimeout(fn, delay)\n }\n },\n [clearTimeouts],\n )\n}\n"],"names":["timeoutRef","clearTimeouts","tooltipState","delay","children","content","position","gapSize","className","props","tooltip","useTooltipState","placement","gutter","React","useRef","useCallback","current","clearTimeout","useEffect","fn","setTimeout","useMemo","show","hide","child","Children","only","TooltipReference","ref","onFocus","event","currentTarget","addEventListener","e","eventKey","key","once","preventDefault","referenceProps","cloneElement","visible","ReakitTooltip","classNames"],"mappings":"uSAuB0B,uBADA,oBAgB1B,gBAiFUA,EAEAC,EA/FAC,EACAC,EAYNC,IAAAA,SACAC,IAAAA,YACAC,SAAAA,aAAW,YACXC,QAAAA,aAAU,IACVC,IAAAA,UACGC,4FAEGC,GApBAR,EAAeS,kBAoBkB,CAAEC,UAAWN,EAAUO,OAAQN,IAyEhEP,EAAac,EAAMC,SAEnBd,EAAgBa,EAAME,aAAY,WACV,MAAtBhB,EAAWiB,SACXC,aAAalB,EAAWiB,WAE7B,IAGHH,EAAMK,WAAU,kBAAMlB,IAAe,CAACA,IArGhCE,EAuGCW,EAAME,aACT,SAAeI,EAAgBjB,UACpB,WACHF,IACAD,EAAWiB,QAAUI,WAAWD,EAAIjB,MAG5C,CAACF,IA7GEa,EAAMQ,SACT,qDACOpB,OACHqB,KAAMpB,GAAM,kBAAMD,EAAaqB,SATjB,KAUdC,KAAMrB,GAAM,kBAAMD,EAAasB,SATjB,SAWlB,CAACrB,EAAOD,KAcNuB,EAAQX,EAAMY,SAASC,KAAyBvB,UACjDC,EA6BDS,gCACIA,gBAACc,oCACOlB,GAEJmB,IAAMJ,EAAcI,KAChBJ,EAAMhB,OACVqB,iBAzBSC,GAWjBA,EAAMC,cAAcC,iBAAiB,kBANhBC,OACXC,EAAYD,EAAoBE,IACrB,WAAbD,GAAsC,UAAbA,GAAqC,UAAbA,GACjDzB,EAAQa,SAG2C,CAAEc,MAAM,IAEnEN,EAAMO,iBAE6B,mBAAxBb,EAAMhB,MAAMqB,SAAwBL,EAAMhB,MAAMqB,QAAQC,OAY1D,SAACQ,UAAmBzB,EAAM0B,aAAaf,EAAOc,MAElD7B,EAAQ+B,QACL3B,gBAAC4B,2BACOhC,EACAD,GACJD,UAAWmC,EAAW,mBAAoBnC,KAEtB,mBAAZH,EAAyBA,IAAYA,GAEjD,MA9CDoB"}
1
+ {"version":3,"file":"tooltip.js","sources":["../../../src/components/tooltip/tooltip.tsx"],"sourcesContent":["import React from 'react'\nimport classNames from 'classnames'\n\nimport {\n useTooltipState,\n TooltipInitialState,\n Tooltip as ReakitTooltip,\n TooltipReference,\n TooltipProps as ReakitTooltipProps,\n} from 'reakit/Tooltip'\nimport { PopoverState } from 'reakit/Popover'\n\nimport './tooltip.less'\n\ntype TooltipProps = Omit<ReakitTooltipProps, 'children'> & {\n children: React.ReactNode\n content: React.ReactNode | (() => React.ReactNode)\n position?: PopoverState['placement']\n gapSize?: number\n}\n\n// These are exported to be used in the tests, they are not meant to be exported publicly\nexport const SHOW_DELAY = 500\nexport const HIDE_DELAY = 100\n\nfunction useDelayedTooltipState(initialState: TooltipInitialState) {\n const tooltipState = useTooltipState(initialState)\n const delay = useDelay()\n return React.useMemo(\n () => ({\n ...tooltipState,\n show: delay(() => tooltipState.show(), SHOW_DELAY),\n hide: delay(() => tooltipState.hide(), HIDE_DELAY),\n }),\n [delay, tooltipState],\n )\n}\n\nfunction Tooltip({\n children,\n content,\n position = 'top',\n gapSize = 3,\n className,\n ...props\n}: TooltipProps) {\n const tooltip = useDelayedTooltipState({ placement: position, gutter: gapSize })\n\n const child = React.Children.only<React.ReactElement>(children as React.ReactElement)\n if (!content) {\n return child\n }\n\n /**\n * Prevents the tooltip from automatically firing on focus all the time. This is to prevent\n * tooltips from showing when the trigger element is focused back after a popover or dialog that\n * it opened was closed. See link below for more details.\n * @see https://github.com/reakit/reakit/discussions/749\n */\n function handleFocus(event: React.FocusEvent) {\n // If focus is not followed by a key up event, does it mean that it's not\n // an intentional keyboard focus? Not sure but it seems to work.\n // This may be resolved soon in an upcoming version of reakit:\n // https://github.com/reakit/reakit/issues/750\n function handleKeyUp(e: Event) {\n const eventKey = (e as KeyboardEvent).key\n if (eventKey !== 'Escape' && eventKey !== 'Enter' && eventKey !== 'Space') {\n tooltip.show()\n }\n }\n event.currentTarget.addEventListener('keyup', handleKeyUp, { once: true })\n // Prevent tooltip.show from being called by TooltipReference\n event.preventDefault()\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access\n if (typeof child.props.onFocus === 'function') child.props.onFocus(event)\n }\n\n return (\n <>\n <TooltipReference\n {...tooltip}\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment\n ref={(child as any).ref}\n {...child.props}\n onFocus={handleFocus}\n >\n {(referenceProps) => React.cloneElement(child, referenceProps)}\n </TooltipReference>\n {tooltip.visible ? (\n <ReakitTooltip\n {...tooltip}\n {...props}\n className={classNames('reactist_tooltip', className)}\n >\n {typeof content === 'function' ? content() : content}\n </ReakitTooltip>\n ) : null}\n </>\n )\n}\n\nexport type { TooltipProps }\nexport { Tooltip }\n\n//\n// Internal helpers\n//\n\n/**\n * Returns a function offering the same interface as setTimeout, but cleans up on unmount.\n *\n * The timeout state is shared, and only one delayed function can be active at any given time. If\n * a new delayed function is called while another one was waiting for its time to run, that older\n * invocation is cleared and it never runs.\n *\n * This is suitable for our use case here, but probably not the most intuitive thing in general.\n * That's why this is not made a shared util or something like it.\n */\nfunction useDelay() {\n const timeoutRef = React.useRef<ReturnType<typeof setTimeout>>()\n\n const clearTimeouts = React.useCallback(function clearTimeouts() {\n if (timeoutRef.current != null) {\n clearTimeout(timeoutRef.current)\n }\n }, [])\n\n // Runs clearTimeouts when the component is unmounted\n React.useEffect(() => clearTimeouts, [clearTimeouts])\n\n return React.useCallback(\n function delay(fn: () => void, delay: number) {\n return () => {\n clearTimeouts()\n timeoutRef.current = setTimeout(fn, delay)\n }\n },\n [clearTimeouts],\n )\n}\n"],"names":["timeoutRef","clearTimeouts","tooltipState","delay","children","content","position","gapSize","className","props","tooltip","useTooltipState","placement","gutter","React","useRef","useCallback","current","clearTimeout","useEffect","fn","setTimeout","useMemo","show","hide","child","Children","only","TooltipReference","ref","onFocus","event","currentTarget","addEventListener","e","eventKey","key","once","preventDefault","referenceProps","cloneElement","visible","ReakitTooltip","classNames"],"mappings":"iWAuB0B,uBADA,oBAgB1B,gBAiFUA,EAEAC,EA/FAC,EACAC,EAYNC,IAAAA,SACAC,IAAAA,YACAC,SAAAA,aAAW,YACXC,QAAAA,aAAU,IACVC,IAAAA,UACGC,sCAEGC,GApBAR,EAAeS,kBAoBkB,CAAEC,UAAWN,EAAUO,OAAQN,IAyEhEP,EAAac,EAAMC,SAEnBd,EAAgBa,EAAME,aAAY,WACV,MAAtBhB,EAAWiB,SACXC,aAAalB,EAAWiB,WAE7B,IAGHH,EAAMK,WAAU,kBAAMlB,IAAe,CAACA,IArGhCE,EAuGCW,EAAME,aACT,SAAeI,EAAgBjB,UACpB,WACHF,IACAD,EAAWiB,QAAUI,WAAWD,EAAIjB,MAG5C,CAACF,IA7GEa,EAAMQ,SACT,qDACOpB,OACHqB,KAAMpB,GAAM,kBAAMD,EAAaqB,SATjB,KAUdC,KAAMrB,GAAM,kBAAMD,EAAasB,SATjB,SAWlB,CAACrB,EAAOD,KAcNuB,EAAQX,EAAMY,SAASC,KAAyBvB,UACjDC,EA6BDS,gCACIA,gBAACc,oCACOlB,GAEJmB,IAAMJ,EAAcI,KAChBJ,EAAMhB,OACVqB,iBAzBSC,GAWjBA,EAAMC,cAAcC,iBAAiB,kBANhBC,OACXC,EAAYD,EAAoBE,IACrB,WAAbD,GAAsC,UAAbA,GAAqC,UAAbA,GACjDzB,EAAQa,SAG2C,CAAEc,MAAM,IAEnEN,EAAMO,iBAE6B,mBAAxBb,EAAMhB,MAAMqB,SAAwBL,EAAMhB,MAAMqB,QAAQC,OAY1D,SAACQ,UAAmBzB,EAAM0B,aAAaf,EAAOc,MAElD7B,EAAQ+B,QACL3B,gBAAC4B,2BACOhC,EACAD,GACJD,UAAWmC,EAAW,mBAAoBnC,KAEtB,mBAAZH,EAAyBA,IAAYA,GAEjD,MA9CDoB"}
package/lib/index.d.ts CHANGED
@@ -27,17 +27,13 @@ export { default as Avatar } from './components/avatar';
27
27
  export { default as Checkbox } from './components/checkbox';
28
28
  export { default as ColorPicker, COLORS } from './components/color-picker';
29
29
  export { default as Dropdown } from './components/dropdown';
30
- export { default as ErrorMessage } from './components/error-message';
31
- export { default as Icon } from './components/icon';
32
30
  export { default as Input } from './components/input';
33
31
  export { default as KeyboardShortcut } from './components/keyboard-shortcut';
34
32
  export { default as KeyCapturer, SUPPORTED_KEYS } from './components/key-capturer';
35
33
  export { default as Popover } from './components/popover';
36
34
  export { default as ProgressBar } from './components/progress-bar';
37
- export { default as RangeInput } from './components/range-input';
38
35
  export { default as Select } from './components/select';
39
36
  export { default as Time } from './components/time';
40
- export { default as Tip } from './components/tip';
41
37
  export { Notification } from './components/notification/notification';
42
38
  export { Tooltip, TooltipProps } from './components/tooltip';
43
39
  export * from './components/menu';
package/lib/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./new-components/box/box.js"),o=require("./new-components/columns/columns.js"),t=require("./new-components/divider/divider.js"),r=require("./new-components/inline/inline.js"),n=require("./new-components/stack/stack.js"),s=require("./new-components/hidden/hidden.js"),i=require("./new-components/hidden-visually/hidden-visually.js"),p=require("./new-components/alert/alert.js"),d=require("./new-components/loading/loading.js"),u=require("./new-components/notice/notice.js"),a=require("./new-components/heading/heading.js"),x=require("./new-components/text/text.js"),l=require("./components/tooltip/tooltip.js"),c=require("./new-components/button/button.js"),m=require("./new-components/button-link/button-link.js"),j=require("./new-components/text-link/text-link.js"),q=require("./new-components/checkbox-field/checkbox-field.js"),w=require("./new-components/password-field/password-field.js"),f=require("./new-components/select-field/select-field.js"),b=require("./new-components/switch-field/switch-field.js"),k=require("./new-components/text-area/text-area.js"),M=require("./new-components/text-field/text-field.js"),T=require("./hooks/use-previous/use-previous.js"),h=require("./new-components/tabs/tabs.js"),g=require("./new-components/modal/modal.js"),S=require("./components/avatar/index.js"),v=require("./components/checkbox/index.js"),B=require("./components/deprecated-button/index.js"),L=require("./components/dropdown/index.js"),P=require("./components/color-picker/color-picker.js"),y=require("./components/color-picker/index.js"),C=require("./components/error-message/index.js"),F=require("./components/icon/index.js"),A=require("./components/input/index.js"),D=require("./components/keyboard-shortcut/index.js"),H=require("./components/key-capturer/key-capturer.js"),I=require("./components/key-capturer/index.js"),O=require("./components/popover/index.js"),E=require("./components/progress-bar/index.js"),R=require("./components/range-input/index.js"),K=require("./components/select/index.js"),N=require("./components/time/index.js"),_=require("./components/tip/index.js"),G=require("./components/notification/notification.js"),U=require("./components/menu/menu.js"),V=require("./components/deprecated-modal/index.js"),Y=require("./components/deprecated-loading/deprecated-loading.js");exports.Box=e.Box,exports.Column=o.Column,exports.Columns=o.Columns,exports.Divider=t.Divider,exports.Inline=r.Inline,exports.Stack=n.Stack,exports.Hidden=s.Hidden,exports.HiddenVisually=i.HiddenVisually,exports.Alert=p.Alert,exports.Loading=d.Loading,exports.Notice=u.Notice,exports.Heading=a.Heading,exports.Text=x.Text,exports.Tooltip=l.Tooltip,exports.Button=c.Button,exports.ButtonLink=m.ButtonLink,exports.TextLink=j.TextLink,exports.CheckboxField=q.CheckboxField,exports.PasswordField=w.PasswordField,exports.SelectField=f.SelectField,exports.SwitchField=b.SwitchField,exports.TextArea=k.TextArea,exports.TextField=M.TextField,exports.usePrevious=T.usePrevious,exports.Tab=h.Tab,exports.TabAwareSlot=h.TabAwareSlot,exports.TabList=h.TabList,exports.TabPanel=h.TabPanel,exports.Tabs=h.Tabs,exports.Modal=g.Modal,exports.ModalActions=g.ModalActions,exports.ModalBody=g.ModalBody,exports.ModalCloseButton=g.ModalCloseButton,exports.ModalFooter=g.ModalFooter,exports.ModalHeader=g.ModalHeader,exports.Avatar=S.default,exports.Checkbox=v.default,exports.DeprecatedButton=B.default,exports.Dropdown=L.default,exports.COLORS=P.COLORS,exports.ColorPicker=y.default,exports.ErrorMessage=C.default,exports.Icon=F.default,exports.Input=A.default,exports.KeyboardShortcut=D.default,exports.SUPPORTED_KEYS=H.SUPPORTED_KEYS,exports.KeyCapturer=I.default,exports.Popover=O.default,exports.ProgressBar=E.default,exports.RangeInput=R.default,exports.Select=K.default,exports.Time=N.default,exports.Tip=_.default,exports.Notification=G.Notification,exports.Menu=U.Menu,exports.MenuButton=U.MenuButton,exports.MenuGroup=U.MenuGroup,exports.MenuItem=U.MenuItem,exports.MenuList=U.MenuList,exports.SubMenu=U.SubMenu,exports.DeprecatedModal=V.default,exports.DeprecatedLoading=Y.Loading;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./new-components/box/box.js"),o=require("./new-components/columns/columns.js"),t=require("./new-components/divider/divider.js"),r=require("./new-components/inline/inline.js"),n=require("./new-components/stack/stack.js"),s=require("./new-components/hidden/hidden.js"),i=require("./new-components/hidden-visually/hidden-visually.js"),p=require("./new-components/alert/alert.js"),d=require("./new-components/loading/loading.js"),u=require("./new-components/notice/notice.js"),a=require("./new-components/heading/heading.js"),l=require("./new-components/text/text.js"),c=require("./components/tooltip/tooltip.js"),x=require("./new-components/button/button.js"),m=require("./new-components/button-link/button-link.js"),j=require("./new-components/text-link/text-link.js"),q=require("./new-components/checkbox-field/checkbox-field.js"),w=require("./new-components/password-field/password-field.js"),b=require("./new-components/select-field/select-field.js"),f=require("./new-components/switch-field/switch-field.js"),k=require("./new-components/text-area/text-area.js"),M=require("./new-components/text-field/text-field.js"),T=require("./hooks/use-previous/use-previous.js"),h=require("./new-components/tabs/tabs.js"),S=require("./new-components/modal/modal.js"),v=require("./components/avatar/index.js"),g=require("./components/checkbox/index.js"),B=require("./components/deprecated-button/index.js"),L=require("./components/dropdown/index.js"),P=require("./components/color-picker/color-picker.js"),y=require("./components/color-picker/index.js"),C=require("./components/input/index.js"),F=require("./components/keyboard-shortcut/index.js"),A=require("./components/key-capturer/key-capturer.js"),D=require("./components/key-capturer/index.js"),H=require("./components/popover/index.js"),O=require("./components/progress-bar/index.js"),I=require("./components/select/index.js"),E=require("./components/time/index.js"),K=require("./components/notification/notification.js"),N=require("./components/menu/menu.js"),R=require("./components/deprecated-modal/index.js"),_=require("./components/deprecated-loading/deprecated-loading.js");exports.Box=e.Box,exports.Column=o.Column,exports.Columns=o.Columns,exports.Divider=t.Divider,exports.Inline=r.Inline,exports.Stack=n.Stack,exports.Hidden=s.Hidden,exports.HiddenVisually=i.HiddenVisually,exports.Alert=p.Alert,exports.Loading=d.Loading,exports.Notice=u.Notice,exports.Heading=a.Heading,exports.Text=l.Text,exports.Tooltip=c.Tooltip,exports.Button=x.Button,exports.ButtonLink=m.ButtonLink,exports.TextLink=j.TextLink,exports.CheckboxField=q.CheckboxField,exports.PasswordField=w.PasswordField,exports.SelectField=b.SelectField,exports.SwitchField=f.SwitchField,exports.TextArea=k.TextArea,exports.TextField=M.TextField,exports.usePrevious=T.usePrevious,exports.Tab=h.Tab,exports.TabAwareSlot=h.TabAwareSlot,exports.TabList=h.TabList,exports.TabPanel=h.TabPanel,exports.Tabs=h.Tabs,exports.Modal=S.Modal,exports.ModalActions=S.ModalActions,exports.ModalBody=S.ModalBody,exports.ModalCloseButton=S.ModalCloseButton,exports.ModalFooter=S.ModalFooter,exports.ModalHeader=S.ModalHeader,exports.Avatar=v.default,exports.Checkbox=g.default,exports.DeprecatedButton=B.default,exports.Dropdown=L.default,exports.COLORS=P.COLORS,exports.ColorPicker=y.default,exports.Input=C.default,exports.KeyboardShortcut=F.default,exports.SUPPORTED_KEYS=A.SUPPORTED_KEYS,exports.KeyCapturer=D.default,exports.Popover=H.default,exports.ProgressBar=O.default,exports.Select=I.default,exports.Time=E.default,exports.Notification=K.Notification,exports.Menu=N.Menu,exports.MenuButton=N.MenuButton,exports.MenuGroup=N.MenuGroup,exports.MenuItem=N.MenuItem,exports.MenuList=N.MenuList,exports.SubMenu=N.SubMenu,exports.DeprecatedModal=R.default,exports.DeprecatedLoading=_.Loading;
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),l=require("react"),t=require("../../utils/polymorphism.js"),n=require("../box/box.js"),a=require("../spinner/spinner.js"),o=require("../../components/tooltip/tooltip.js"),i=require("./base-button.module.css.js");function r(e){e.preventDefault()}exports.BaseButton=t.polymorphicComponent((function(t,s){var u=t.as,c=void 0===u?"div":u,d=t.variant,p=t.tone,m=void 0===p?"normal":p,f=t.size,b=void 0===f?"normal":f,v=t.disabled,x=void 0!==v&&v,j=t.loading,E=void 0!==j&&j,B=t.tooltip,h=t.onClick,q=t.exceptionallySetClassName,y=t.children,C=t.startIcon,I=t.endIcon,N=t.icon,g=e.objectWithoutPropertiesLoose(t,["as","variant","tone","size","disabled","loading","tooltip","onClick","exceptionallySetClassName","children","startIcon","endIcon","icon"]),S=E||x,_=l.createElement(n.Box,Object.assign({},g,{as:c,ref:s,"aria-disabled":S,onClick:S?r:h,className:[q,i.default.baseButton,i.default["variant-"+d],i.default["tone-"+m],i.default["size-"+b],N?i.default.iconButton:null,x?i.default.disabled:null]}),N?E&&l.createElement(a.Spinner,null)||N:l.createElement(l.Fragment,null,C?l.createElement(n.Box,{display:"flex",className:i.default.startIcon,"aria-hidden":!0},E&&!I?l.createElement(a.Spinner,null):C):null,y?l.createElement("span",{className:i.default.label},y):null,I||E&&!C?l.createElement(n.Box,{display:"flex",className:i.default.endIcon,"aria-hidden":!0},E?l.createElement(a.Spinner,null):I):null)),k=N?null!=B?B:g["aria-label"]:B;return k?l.createElement(o.Tooltip,{content:k},_):_}));
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),l=require("react"),t=require("../../utils/polymorphism.js"),n=require("../box/box.js"),a=require("../spinner/spinner.js"),o=require("../../components/tooltip/tooltip.js"),i=require("./base-button.module.css.js"),r=["as","variant","tone","size","disabled","loading","tooltip","onClick","exceptionallySetClassName","children","startIcon","endIcon","icon"];function s(e){e.preventDefault()}exports.BaseButton=t.polymorphicComponent((function(t,u){var c=t.as,d=void 0===c?"div":c,p=t.variant,m=t.tone,f=void 0===m?"normal":m,b=t.size,v=void 0===b?"normal":b,x=t.disabled,j=void 0!==x&&x,E=t.loading,B=void 0!==E&&E,h=t.tooltip,q=t.onClick,y=t.exceptionallySetClassName,C=t.children,I=t.startIcon,N=t.endIcon,g=t.icon,S=e.objectWithoutPropertiesLoose(t,r),_=B||j,k=l.createElement(n.Box,Object.assign({},S,{as:d,ref:u,"aria-disabled":_,onClick:_?s:q,className:[y,i.default.baseButton,i.default["variant-"+p],i.default["tone-"+f],i.default["size-"+v],g?i.default.iconButton:null,j?i.default.disabled:null]}),g?B&&l.createElement(a.Spinner,null)||g:l.createElement(l.Fragment,null,I?l.createElement(n.Box,{display:"flex",className:i.default.startIcon,"aria-hidden":!0},B&&!N?l.createElement(a.Spinner,null):I):null,C?l.createElement("span",{className:i.default.label},C):null,N||B&&!I?l.createElement(n.Box,{display:"flex",className:i.default.endIcon,"aria-hidden":!0},B?l.createElement(a.Spinner,null):N):null)),z=g?null!=h?h:S["aria-label"]:h;return z?l.createElement(o.Tooltip,{content:z},k):k}));
2
2
  //# sourceMappingURL=base-button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"base-button.js","sources":["../../../src/new-components/base-button/base-button.tsx"],"sourcesContent":["import * as React from 'react'\nimport { Tooltip, TooltipProps } from '../../components/tooltip'\nimport { polymorphicComponent } from '../../utils/polymorphism'\nimport { Box } from '../box'\nimport { Spinner } from '../spinner'\nimport styles from './base-button.module.css'\n\nfunction preventDefault(event: React.SyntheticEvent) {\n event.preventDefault()\n}\n\ntype ButtonVariant = 'primary' | 'secondary' | 'tertiary' | 'quaternary'\ntype ButtonTone = 'normal' | 'destructive'\ntype ButtonSize = 'small' | 'normal' | 'large'\ntype IconElement = React.ReactChild\n\ntype CommonProps = {\n /**\n * The button's variant.\n */\n variant: ButtonVariant\n /**\n * The button's tone.\n * @default 'normal'\n */\n tone?: ButtonTone\n /**\n * The button's size.\n * @default 'normal'\n */\n size?: ButtonSize\n /**\n * Whether the button is disabled or not.\n * @default false\n */\n disabled?: boolean\n /**\n * Whether the button is busy/loading.\n *\n * A button in this state is functionally and semantically disabled. Visually is does not look\n * dimmed (as disabled buttons normally do), but it shows a loading spinner instead.\n *\n * @default false\n */\n loading?: boolean\n /**\n * A tooltip linked to the button element.\n */\n tooltip?: TooltipProps['content']\n}\n\ntype IconButtonProps = {\n icon: IconElement\n 'aria-label': string\n children?: never\n startIcon?: never\n endIcon?: never\n}\n\ntype LabelledButtonProps = {\n children: NonNullable<React.ReactNode>\n startIcon?: IconElement\n endIcon?: IconElement\n icon?: never\n}\n\nexport type BaseButtonProps = CommonProps & (IconButtonProps | LabelledButtonProps)\n\n/**\n * The component that powers `Button` and `ButtonLink`, where the button styling logic and some\n * common functionality resides. This component is internal to Reactist.\n *\n * 🎨 [Figma](https://www.figma.com/file/LYlWNzvhMDh907l07mPPQk/Product-Web?node-id=4693%3A175143)\n *\n * @see Button\n * @see ButtonLink\n */\nexport const BaseButton = polymorphicComponent<'div', BaseButtonProps>(function BaseButton(\n {\n as = 'div',\n variant,\n tone = 'normal',\n size = 'normal',\n disabled = false,\n loading = false,\n tooltip,\n onClick,\n exceptionallySetClassName,\n children,\n startIcon,\n endIcon,\n icon,\n ...props\n },\n ref,\n) {\n const isDisabled = loading || disabled\n const buttonElement = (\n <Box\n {...props}\n as={as}\n ref={ref}\n aria-disabled={isDisabled}\n onClick={isDisabled ? preventDefault : onClick}\n className={[\n exceptionallySetClassName,\n styles.baseButton,\n styles[`variant-${variant}`],\n styles[`tone-${tone}`],\n styles[`size-${size}`],\n icon ? styles.iconButton : null,\n disabled ? styles.disabled : null,\n ]}\n >\n {icon ? (\n (loading && <Spinner />) || icon\n ) : (\n <>\n {startIcon ? (\n <Box display=\"flex\" className={styles.startIcon} aria-hidden>\n {loading && !endIcon ? <Spinner /> : startIcon}\n </Box>\n ) : null}\n {children ? <span className={styles.label}>{children}</span> : null}\n {endIcon || (loading && !startIcon) ? (\n <Box display=\"flex\" className={styles.endIcon} aria-hidden>\n {loading ? <Spinner /> : endIcon}\n </Box>\n ) : null}\n </>\n )}\n </Box>\n )\n\n // If it's an icon-only button, make sure it uses the aria-label as tooltip if no tooltip was provided\n const tooltipContent = icon ? tooltip ?? props['aria-label'] : tooltip\n return tooltipContent ? (\n <Tooltip content={tooltipContent}>{buttonElement}</Tooltip>\n ) : (\n buttonElement\n )\n})\n"],"names":["preventDefault","event","polymorphicComponent","ref","as","variant","tone","size","disabled","loading","tooltip","onClick","exceptionallySetClassName","children","startIcon","endIcon","icon","props","isDisabled","buttonElement","React","Box","className","styles","baseButton","iconButton","Spinner","display","label","tooltipContent","Tooltip","content"],"mappings":"qVAOA,SAASA,EAAeC,GACpBA,EAAMD,oCAqEgBE,wBAA6C,WAiBnEC,WAfIC,GAAAA,aAAK,QACLC,IAAAA,YACAC,KAAAA,aAAO,eACPC,KAAAA,aAAO,eACPC,SAAAA,oBACAC,QAAAA,gBACAC,IAAAA,QACAC,IAAAA,QACAC,IAAAA,0BACAC,IAAAA,SACAC,IAAAA,UACAC,IAAAA,QACAC,IAAAA,KACGC,gLAIDC,EAAaT,GAAWD,EACxBW,EACFC,gBAACC,uBACOJ,GACJb,GAAIA,EACJD,IAAKA,kBACUe,EACfP,QAASO,EAAalB,EAAiBW,EACvCW,UAAW,CACPV,EACAW,UAAOC,WACPD,qBAAkBlB,GAClBkB,kBAAejB,GACfiB,kBAAehB,GACfS,EAAOO,UAAOE,WAAa,KAC3BjB,EAAWe,UAAOf,SAAW,QAGhCQ,EACIP,GAAWW,gBAACM,iBAAeV,EAE5BI,gCACKN,EACGM,gBAACC,OAAIM,QAAQ,OAAOL,UAAWC,UAAOT,4BACjCL,IAAYM,EAAUK,gBAACM,gBAAaZ,GAEzC,KACHD,EAAWO,wBAAME,UAAWC,UAAOK,OAAQf,GAAmB,KAC9DE,GAAYN,IAAYK,EACrBM,gBAACC,OAAIM,QAAQ,OAAOL,UAAWC,UAAOR,0BACjCN,EAAUW,gBAACM,gBAAaX,GAE7B,OAOdc,EAAiBb,EAAON,MAAAA,EAAAA,EAAWO,EAAM,cAAgBP,SACxDmB,EACHT,gBAACU,WAAQC,QAASF,GAAiBV,GAEnCA"}
1
+ {"version":3,"file":"base-button.js","sources":["../../../src/new-components/base-button/base-button.tsx"],"sourcesContent":["import * as React from 'react'\nimport { Tooltip, TooltipProps } from '../../components/tooltip'\nimport { polymorphicComponent } from '../../utils/polymorphism'\nimport { Box } from '../box'\nimport { Spinner } from '../spinner'\nimport styles from './base-button.module.css'\n\nfunction preventDefault(event: React.SyntheticEvent) {\n event.preventDefault()\n}\n\ntype ButtonVariant = 'primary' | 'secondary' | 'tertiary' | 'quaternary'\ntype ButtonTone = 'normal' | 'destructive'\ntype ButtonSize = 'small' | 'normal' | 'large'\ntype IconElement = React.ReactChild\n\ntype CommonProps = {\n /**\n * The button's variant.\n */\n variant: ButtonVariant\n /**\n * The button's tone.\n * @default 'normal'\n */\n tone?: ButtonTone\n /**\n * The button's size.\n * @default 'normal'\n */\n size?: ButtonSize\n /**\n * Whether the button is disabled or not.\n * @default false\n */\n disabled?: boolean\n /**\n * Whether the button is busy/loading.\n *\n * A button in this state is functionally and semantically disabled. Visually is does not look\n * dimmed (as disabled buttons normally do), but it shows a loading spinner instead.\n *\n * @default false\n */\n loading?: boolean\n /**\n * A tooltip linked to the button element.\n */\n tooltip?: TooltipProps['content']\n}\n\ntype IconButtonProps = {\n icon: IconElement\n 'aria-label': string\n children?: never\n startIcon?: never\n endIcon?: never\n}\n\ntype LabelledButtonProps = {\n children: NonNullable<React.ReactNode>\n startIcon?: IconElement\n endIcon?: IconElement\n icon?: never\n}\n\nexport type BaseButtonProps = CommonProps & (IconButtonProps | LabelledButtonProps)\n\n/**\n * The component that powers `Button` and `ButtonLink`, where the button styling logic and some\n * common functionality resides. This component is internal to Reactist.\n *\n * 🎨 [Figma](https://www.figma.com/file/LYlWNzvhMDh907l07mPPQk/Product-Web?node-id=4693%3A175143)\n *\n * @see Button\n * @see ButtonLink\n */\nexport const BaseButton = polymorphicComponent<'div', BaseButtonProps>(function BaseButton(\n {\n as = 'div',\n variant,\n tone = 'normal',\n size = 'normal',\n disabled = false,\n loading = false,\n tooltip,\n onClick,\n exceptionallySetClassName,\n children,\n startIcon,\n endIcon,\n icon,\n ...props\n },\n ref,\n) {\n const isDisabled = loading || disabled\n const buttonElement = (\n <Box\n {...props}\n as={as}\n ref={ref}\n aria-disabled={isDisabled}\n onClick={isDisabled ? preventDefault : onClick}\n className={[\n exceptionallySetClassName,\n styles.baseButton,\n styles[`variant-${variant}`],\n styles[`tone-${tone}`],\n styles[`size-${size}`],\n icon ? styles.iconButton : null,\n disabled ? styles.disabled : null,\n ]}\n >\n {icon ? (\n (loading && <Spinner />) || icon\n ) : (\n <>\n {startIcon ? (\n <Box display=\"flex\" className={styles.startIcon} aria-hidden>\n {loading && !endIcon ? <Spinner /> : startIcon}\n </Box>\n ) : null}\n {children ? <span className={styles.label}>{children}</span> : null}\n {endIcon || (loading && !startIcon) ? (\n <Box display=\"flex\" className={styles.endIcon} aria-hidden>\n {loading ? <Spinner /> : endIcon}\n </Box>\n ) : null}\n </>\n )}\n </Box>\n )\n\n // If it's an icon-only button, make sure it uses the aria-label as tooltip if no tooltip was provided\n const tooltipContent = icon ? tooltip ?? props['aria-label'] : tooltip\n return tooltipContent ? (\n <Tooltip content={tooltipContent}>{buttonElement}</Tooltip>\n ) : (\n buttonElement\n )\n})\n"],"names":["preventDefault","event","polymorphicComponent","ref","as","variant","tone","size","disabled","loading","tooltip","onClick","exceptionallySetClassName","children","startIcon","endIcon","icon","props","isDisabled","buttonElement","React","Box","className","styles","baseButton","iconButton","Spinner","display","label","tooltipContent","Tooltip","content"],"mappings":"meAOA,SAASA,EAAeC,GACpBA,EAAMD,oCAqEgBE,wBAA6C,WAiBnEC,WAfIC,GAAAA,aAAK,QACLC,IAAAA,YACAC,KAAAA,aAAO,eACPC,KAAAA,aAAO,eACPC,SAAAA,oBACAC,QAAAA,gBACAC,IAAAA,QACAC,IAAAA,QACAC,IAAAA,0BACAC,IAAAA,SACAC,IAAAA,UACAC,IAAAA,QACAC,IAAAA,KACGC,sCAIDC,EAAaT,GAAWD,EACxBW,EACFC,gBAACC,uBACOJ,GACJb,GAAIA,EACJD,IAAKA,kBACUe,EACfP,QAASO,EAAalB,EAAiBW,EACvCW,UAAW,CACPV,EACAW,UAAOC,WACPD,qBAAkBlB,GAClBkB,kBAAejB,GACfiB,kBAAehB,GACfS,EAAOO,UAAOE,WAAa,KAC3BjB,EAAWe,UAAOf,SAAW,QAGhCQ,EACIP,GAAWW,gBAACM,iBAAeV,EAE5BI,gCACKN,EACGM,gBAACC,OAAIM,QAAQ,OAAOL,UAAWC,UAAOT,4BACjCL,IAAYM,EAAUK,gBAACM,gBAAaZ,GAEzC,KACHD,EAAWO,wBAAME,UAAWC,UAAOK,OAAQf,GAAmB,KAC9DE,GAAYN,IAAYK,EACrBM,gBAACC,OAAIM,QAAQ,OAAOL,UAAWC,UAAOR,0BACjCN,EAAUW,gBAACM,gBAAaX,GAE7B,OAOdc,EAAiBb,EAAON,MAAAA,EAAAA,EAAWO,EAAM,cAAgBP,SACxDmB,EACHT,gBAACU,WAAQC,QAASF,GAAiBV,GAEnCA"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default={label:"_7b1ce450",baseButton:"f965f9b1","size-small":"f3be2031","size-normal":"d4949176","size-large":"d5280734",disabled:"e68f590f",iconButton:"cf7da434",startIcon:"_670452f3",endIcon:"_9e9147ff","variant-primary":"e862434a","variant-secondary":"feec851f","variant-tertiary":"bf0a371f","variant-quaternary":"_5c9816d1","tone-destructive":"_8eac7f47"};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default={label:"_1f20c88a",baseButton:"_623015f3","size-small":"_062de645","size-normal":"_55e2a6a9","size-large":"cab32a7c",disabled:"e71c191a",iconButton:"_368efc16",startIcon:"d35389c1",endIcon:"_900d41d8","variant-primary":"_7c95e162","variant-secondary":"_9cb889aa","variant-tertiary":"_611b5b28","variant-quaternary":"_80c2bb84","tone-destructive":"ee13c455"};
2
2
  //# sourceMappingURL=base-button.module.css.js.map
@@ -1,5 +1,5 @@
1
1
  import type { ResponsiveProp } from '../responsive-props';
2
- import type { Space, SpaceWithNegatives, WithEnhancedClassName } from '../common-types';
2
+ import type { DividerWeight, Space, SpaceWithNegatives, WithEnhancedClassName } from '../common-types';
3
3
  interface BoxPaddingProps {
4
4
  padding?: ResponsiveProp<Space>;
5
5
  paddingX?: ResponsiveProp<Space>;
@@ -18,25 +18,27 @@ interface BoxMarginProps {
18
18
  marginBottom?: ResponsiveProp<SpaceWithNegatives>;
19
19
  marginLeft?: ResponsiveProp<SpaceWithNegatives>;
20
20
  }
21
- declare type BoxMaxMinWidth = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
22
21
  declare type BoxDisplay = 'block' | 'flex' | 'inline' | 'inlineBlock' | 'inlineFlex' | 'none';
23
22
  declare type BoxFlexDirection = 'column' | 'row';
24
23
  declare type BoxFlexWrap = 'nowrap' | 'wrap';
25
24
  declare type BoxAlignItems = 'center' | 'flexEnd' | 'flexStart' | 'baseline';
26
25
  declare type BoxJustifyContent = 'center' | 'flexEnd' | 'flexStart' | 'spaceAround' | 'spaceBetween' | 'spaceEvenly';
27
26
  declare type BoxOverflow = 'hidden' | 'auto' | 'visible' | 'scroll';
27
+ declare type BoxMaxMinWidth = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
28
+ declare type BoxMinWidth = 0 | BoxMaxMinWidth;
29
+ declare type BoxMaxWidth = BoxMaxMinWidth | 'full';
30
+ declare type BoxWidth = 0 | BoxMaxMinWidth | 'full' | 'auto' | 'maxContent' | 'minContent' | 'fitContent';
28
31
  interface BorderProps {
29
32
  borderRadius?: 'standard' | 'none' | 'full';
30
- border?: 'standard' | 'none';
33
+ border?: DividerWeight;
31
34
  }
32
35
  interface ReusableBoxProps extends BorderProps, BoxPaddingProps {
33
- minWidth?: 0 | BoxMaxMinWidth;
34
- maxWidth?: BoxMaxMinWidth | 'full';
36
+ minWidth?: BoxMinWidth;
37
+ maxWidth?: BoxMaxWidth;
38
+ width?: BoxWidth;
35
39
  background?: 'default' | 'aside' | 'highlight' | 'selected';
36
40
  flexGrow?: 0 | 1;
37
41
  flexShrink?: 0;
38
- width?: 'full';
39
- height?: 'full';
40
42
  }
41
43
  declare type BoxPosition = 'absolute' | 'fixed' | 'relative' | 'static' | 'sticky';
42
44
  interface BoxProps extends WithEnhancedClassName, ReusableBoxProps, BoxMarginProps {
@@ -47,10 +49,9 @@ interface BoxProps extends WithEnhancedClassName, ReusableBoxProps, BoxMarginPro
47
49
  alignItems?: ResponsiveProp<BoxAlignItems>;
48
50
  justifyContent?: ResponsiveProp<BoxJustifyContent>;
49
51
  overflow?: BoxOverflow;
50
- width?: 'full';
51
52
  height?: 'full';
52
53
  textAlign?: ResponsiveProp<'start' | 'center' | 'end' | 'justify'>;
53
54
  }
54
55
  declare const Box: import("../../utils/polymorphism").PolymorphicComponent<"div", BoxProps, "keepClassName">;
55
- export type { BoxProps, BoxPaddingProps, BoxMarginProps, ReusableBoxProps, BoxMaxMinWidth, BoxDisplay, BoxPosition, BoxFlexDirection, BoxFlexWrap, BoxAlignItems, BoxJustifyContent, BoxOverflow, };
56
+ export type { BoxProps, BoxPaddingProps, BoxMarginProps, ReusableBoxProps, BoxMinWidth, BoxMaxWidth, BoxDisplay, BoxPosition, BoxFlexDirection, BoxFlexWrap, BoxAlignItems, BoxJustifyContent, BoxOverflow, };
56
57
  export { Box };
@@ -1,2 +1,2 @@
1
- "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var l=require("../../_virtual/_rollupPluginBabelHelpers.js"),a=require("react"),t=(e(a),e(require("classnames"))),i=require("../../utils/polymorphism.js"),s=require("../responsive-props.js"),n=require("./box.module.css.js"),d=require("./padding.module.css.js"),r=require("./margin.module.css.js");exports.Box=i.polymorphicComponent((function(e,i){var o,u,g,m,f,p,h,C,N=e.as,c=void 0===N?"div":N,x=e.position,v=void 0===x?"static":x,b=e.display,j=e.flexDirection,y=void 0===j?"row":j,w=e.flexWrap,W=e.flexGrow,R=e.flexShrink,q=e.alignItems,B=e.justifyContent,S=e.overflow,L=e.width,T=e.height,k=e.background,X=e.border,Y=e.borderRadius,_=e.minWidth,A=e.maxWidth,D=e.textAlign,G=void 0===D?"start":D,I=e.padding,P=e.paddingY,E=e.paddingX,F=e.paddingTop,H=e.paddingRight,M=e.paddingBottom,O=e.paddingLeft,z=e.margin,J=e.marginY,K=e.marginX,Q=e.marginTop,U=e.marginRight,V=e.marginBottom,Z=e.marginLeft,$=e.className,ee=e.children,le=l.objectWithoutPropertiesLoose(e,["as","position","display","flexDirection","flexWrap","flexGrow","flexShrink","alignItems","justifyContent","overflow","width","height","background","border","borderRadius","minWidth","maxWidth","textAlign","padding","paddingY","paddingX","paddingTop","paddingRight","paddingBottom","paddingLeft","margin","marginY","marginX","marginTop","marginRight","marginBottom","marginLeft","className","children"]),ae=null!==(o=null!=F?F:P)&&void 0!==o?o:I,te=null!==(u=null!=H?H:E)&&void 0!==u?u:I,ie=null!==(g=null!=M?M:P)&&void 0!==g?g:I,se=null!==(m=null!=O?O:E)&&void 0!==m?m:I,ne=null!==(f=null!=Q?Q:J)&&void 0!==f?f:z,de=null!==(p=null!=U?U:K)&&void 0!==p?p:z,re=null!==(h=null!=V?V:J)&&void 0!==h?h:z,oe=null!==(C=null!=Z?Z:K)&&void 0!==C?C:z,ue=!b||"string"==typeof b&&"flex"!==b&&"inlineFlex"!==b;return a.createElement(c,l.objectSpread2(l.objectSpread2({},le),{},{className:t($,n.default.box,b?s.getClassNames(n.default,"display",b):null,"static"!==v?s.getClassNames(n.default,"position",v):null,null!=_?s.getClassNames(n.default,"minWidth",String(_)):null,s.getClassNames(n.default,"maxWidth",A),"start"!==G?s.getClassNames(n.default,"textAlign",G):null,s.getClassNames(d.default,"paddingTop",ae),s.getClassNames(d.default,"paddingRight",te),s.getClassNames(d.default,"paddingBottom",ie),s.getClassNames(d.default,"paddingLeft",se),s.getClassNames(r.default,"marginTop",ne),s.getClassNames(r.default,"marginRight",de),s.getClassNames(r.default,"marginBottom",re),s.getClassNames(r.default,"marginLeft",oe),ue?null:s.getClassNames(n.default,"flexDirection",y),ue?null:s.getClassNames(n.default,"flexWrap",w),ue?null:s.getClassNames(n.default,"alignItems",q),ue?null:s.getClassNames(n.default,"justifyContent",B),null!=R?s.getClassNames(n.default,"flexShrink",String(R)):null,null!=W?s.getClassNames(n.default,"flexGrow",String(W)):null,s.getClassNames(n.default,"overflow",S),s.getClassNames(n.default,"width",L),s.getClassNames(n.default,"height",T),s.getClassNames(n.default,"bg",k),"none"!==Y?s.getClassNames(n.default,"borderRadius",Y):null,"none"!==X?s.getClassNames(n.default,"border",X):null)||void 0,ref:i}),ee)}));
1
+ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var l=require("../../_virtual/_rollupPluginBabelHelpers.js"),a=require("react"),t=(e(a),e(require("classnames"))),i=require("../../utils/polymorphism.js"),s=require("../responsive-props.js"),n=require("./box.module.css.js"),d=require("./padding.module.css.js"),r=require("./margin.module.css.js"),o=require("./width.module.css.js"),u=["as","position","display","flexDirection","flexWrap","flexGrow","flexShrink","alignItems","justifyContent","overflow","width","height","background","border","borderRadius","minWidth","maxWidth","textAlign","padding","paddingY","paddingX","paddingTop","paddingRight","paddingBottom","paddingLeft","margin","marginY","marginX","marginTop","marginRight","marginBottom","marginLeft","className","children"];exports.Box=i.polymorphicComponent((function(e,i){var g,m,f,p,h,C,c,N,x=e.as,v=void 0===x?"div":x,b=e.position,j=void 0===b?"static":b,w=e.display,y=e.flexDirection,W=void 0===y?"row":y,q=e.flexWrap,R=e.flexGrow,S=e.flexShrink,B=e.alignItems,L=e.justifyContent,T=e.overflow,k=e.width,X=e.height,Y=e.background,_=e.border,A=e.borderRadius,D=e.minWidth,G=e.maxWidth,I=e.textAlign,P=void 0===I?"start":I,E=e.padding,F=e.paddingY,H=e.paddingX,M=e.paddingTop,O=e.paddingRight,z=e.paddingBottom,J=e.paddingLeft,K=e.margin,Q=e.marginY,U=e.marginX,V=e.marginTop,Z=e.marginRight,$=e.marginBottom,ee=e.marginLeft,le=e.className,ae=e.children,te=l.objectWithoutPropertiesLoose(e,u),ie=null!==(g=null!=M?M:F)&&void 0!==g?g:E,se=null!==(m=null!=O?O:H)&&void 0!==m?m:E,ne=null!==(f=null!=z?z:F)&&void 0!==f?f:E,de=null!==(p=null!=J?J:H)&&void 0!==p?p:E,re=null!==(h=null!=V?V:Q)&&void 0!==h?h:K,oe=null!==(C=null!=Z?Z:U)&&void 0!==C?C:K,ue=null!==(c=null!=$?$:Q)&&void 0!==c?c:K,ge=null!==(N=null!=ee?ee:U)&&void 0!==N?N:K,me=!w||"string"==typeof w&&"flex"!==w&&"inlineFlex"!==w;return a.createElement(v,l.objectSpread2(l.objectSpread2({},te),{},{className:t(le,n.default.box,w?s.getClassNames(n.default,"display",w):null,"static"!==j?s.getClassNames(n.default,"position",j):null,null!=D?s.getClassNames(o.default,"minWidth",String(D)):null,s.getClassNames(o.default,"maxWidth",G),"start"!==P?s.getClassNames(n.default,"textAlign",P):null,s.getClassNames(d.default,"paddingTop",ie),s.getClassNames(d.default,"paddingRight",se),s.getClassNames(d.default,"paddingBottom",ne),s.getClassNames(d.default,"paddingLeft",de),s.getClassNames(r.default,"marginTop",re),s.getClassNames(r.default,"marginRight",oe),s.getClassNames(r.default,"marginBottom",ue),s.getClassNames(r.default,"marginLeft",ge),me?null:s.getClassNames(n.default,"flexDirection",W),me?null:s.getClassNames(n.default,"flexWrap",q),me?null:s.getClassNames(n.default,"alignItems",B),me?null:s.getClassNames(n.default,"justifyContent",L),null!=S?s.getClassNames(n.default,"flexShrink",String(S)):null,null!=R?s.getClassNames(n.default,"flexGrow",String(R)):null,s.getClassNames(n.default,"overflow",T),null!=k?s.getClassNames(o.default,"width",String(k)):null,s.getClassNames(n.default,"height",X),s.getClassNames(n.default,"bg",Y),"none"!==A?s.getClassNames(n.default,"borderRadius",A):null,"none"!==_?s.getClassNames(n.default,"border",_):null)||void 0,ref:i}),ae)}));
2
2
  //# sourceMappingURL=box.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"box.js","sources":["../../../src/new-components/box/box.tsx"],"sourcesContent":["import * as React from 'react'\nimport classNames from 'classnames'\nimport { polymorphicComponent } from '../../utils/polymorphism'\nimport { getClassNames } from '../responsive-props'\n\nimport type { ResponsiveProp } from '../responsive-props'\nimport type { Space, SpaceWithNegatives, WithEnhancedClassName } from '../common-types'\n\nimport styles from './box.module.css'\nimport paddingStyles from './padding.module.css'\nimport marginStyles from './margin.module.css'\n\ninterface BoxPaddingProps {\n padding?: ResponsiveProp<Space>\n paddingX?: ResponsiveProp<Space>\n paddingY?: ResponsiveProp<Space>\n paddingTop?: ResponsiveProp<Space>\n paddingRight?: ResponsiveProp<Space>\n paddingBottom?: ResponsiveProp<Space>\n paddingLeft?: ResponsiveProp<Space>\n}\n\ninterface BoxMarginProps {\n margin?: ResponsiveProp<SpaceWithNegatives>\n marginX?: ResponsiveProp<SpaceWithNegatives>\n marginY?: ResponsiveProp<SpaceWithNegatives>\n marginTop?: ResponsiveProp<SpaceWithNegatives>\n marginRight?: ResponsiveProp<SpaceWithNegatives>\n marginBottom?: ResponsiveProp<SpaceWithNegatives>\n marginLeft?: ResponsiveProp<SpaceWithNegatives>\n}\n\ntype BoxMaxMinWidth = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge'\ntype BoxDisplay = 'block' | 'flex' | 'inline' | 'inlineBlock' | 'inlineFlex' | 'none'\ntype BoxFlexDirection = 'column' | 'row'\ntype BoxFlexWrap = 'nowrap' | 'wrap'\ntype BoxAlignItems = 'center' | 'flexEnd' | 'flexStart' | 'baseline'\ntype BoxJustifyContent =\n | 'center'\n | 'flexEnd'\n | 'flexStart'\n | 'spaceAround'\n | 'spaceBetween'\n | 'spaceEvenly'\ntype BoxOverflow = 'hidden' | 'auto' | 'visible' | 'scroll'\n\ninterface BorderProps {\n borderRadius?: 'standard' | 'none' | 'full'\n border?: 'standard' | 'none' // to be extended with more options\n}\n\ninterface ReusableBoxProps extends BorderProps, BoxPaddingProps {\n minWidth?: 0 | BoxMaxMinWidth\n maxWidth?: BoxMaxMinWidth | 'full'\n background?: 'default' | 'aside' | 'highlight' | 'selected'\n flexGrow?: 0 | 1\n flexShrink?: 0\n width?: 'full'\n height?: 'full'\n}\n\ntype BoxPosition = 'absolute' | 'fixed' | 'relative' | 'static' | 'sticky'\n\ninterface BoxProps extends WithEnhancedClassName, ReusableBoxProps, BoxMarginProps {\n position?: ResponsiveProp<BoxPosition>\n display?: ResponsiveProp<BoxDisplay>\n flexDirection?: ResponsiveProp<BoxFlexDirection>\n flexWrap?: BoxFlexWrap\n alignItems?: ResponsiveProp<BoxAlignItems>\n justifyContent?: ResponsiveProp<BoxJustifyContent>\n overflow?: BoxOverflow\n width?: 'full'\n height?: 'full'\n textAlign?: ResponsiveProp<'start' | 'center' | 'end' | 'justify'>\n}\n\nconst Box = polymorphicComponent<'div', BoxProps, 'keepClassName'>(function Box(\n {\n as: component = 'div',\n position = 'static',\n display,\n flexDirection = 'row',\n flexWrap,\n flexGrow,\n flexShrink,\n alignItems,\n justifyContent,\n overflow,\n width,\n height,\n background,\n border,\n borderRadius,\n minWidth,\n maxWidth,\n textAlign = 'start',\n padding,\n paddingY,\n paddingX,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n margin,\n marginY,\n marginX,\n marginTop,\n marginRight,\n marginBottom,\n marginLeft,\n className,\n children,\n ...props\n },\n ref,\n) {\n const resolvedPaddingTop = paddingTop ?? paddingY ?? padding\n const resolvedPaddingRight = paddingRight ?? paddingX ?? padding\n const resolvedPaddingBottom = paddingBottom ?? paddingY ?? padding\n const resolvedPaddingLeft = paddingLeft ?? paddingX ?? padding\n\n const resolvedMarginTop = marginTop ?? marginY ?? margin\n const resolvedMarginRight = marginRight ?? marginX ?? margin\n const resolvedMarginBottom = marginBottom ?? marginY ?? margin\n const resolvedMarginLeft = marginLeft ?? marginX ?? margin\n\n const omitFlex =\n !display || (typeof display === 'string' && display !== 'flex' && display !== 'inlineFlex')\n\n return React.createElement(\n component,\n {\n ...props,\n className:\n classNames(\n className,\n styles.box,\n display ? getClassNames(styles, 'display', display) : null,\n position !== 'static' ? getClassNames(styles, 'position', position) : null,\n minWidth != null ? getClassNames(styles, 'minWidth', String(minWidth)) : null,\n getClassNames(styles, 'maxWidth', maxWidth),\n textAlign !== 'start' ? getClassNames(styles, 'textAlign', textAlign) : null,\n // padding\n getClassNames(paddingStyles, 'paddingTop', resolvedPaddingTop),\n getClassNames(paddingStyles, 'paddingRight', resolvedPaddingRight),\n getClassNames(paddingStyles, 'paddingBottom', resolvedPaddingBottom),\n getClassNames(paddingStyles, 'paddingLeft', resolvedPaddingLeft),\n // margin\n getClassNames(marginStyles, 'marginTop', resolvedMarginTop),\n getClassNames(marginStyles, 'marginRight', resolvedMarginRight),\n getClassNames(marginStyles, 'marginBottom', resolvedMarginBottom),\n getClassNames(marginStyles, 'marginLeft', resolvedMarginLeft),\n // flex props\n omitFlex ? null : getClassNames(styles, 'flexDirection', flexDirection),\n omitFlex ? null : getClassNames(styles, 'flexWrap', flexWrap),\n omitFlex ? null : getClassNames(styles, 'alignItems', alignItems),\n omitFlex ? null : getClassNames(styles, 'justifyContent', justifyContent),\n flexShrink != null\n ? getClassNames(styles, 'flexShrink', String(flexShrink))\n : null,\n flexGrow != null ? getClassNames(styles, 'flexGrow', String(flexGrow)) : null,\n // other props\n getClassNames(styles, 'overflow', overflow),\n getClassNames(styles, 'width', width),\n getClassNames(styles, 'height', height),\n getClassNames(styles, 'bg', background),\n borderRadius !== 'none'\n ? getClassNames(styles, 'borderRadius', borderRadius)\n : null,\n border !== 'none' ? getClassNames(styles, 'border', border) : null,\n ) || undefined,\n ref,\n },\n children,\n )\n})\n\nexport type {\n BoxProps,\n BoxPaddingProps,\n BoxMarginProps,\n ReusableBoxProps,\n BoxMaxMinWidth,\n BoxDisplay,\n BoxPosition,\n BoxFlexDirection,\n BoxFlexWrap,\n BoxAlignItems,\n BoxJustifyContent,\n BoxOverflow,\n}\n\nexport { Box }\n"],"names":["polymorphicComponent","ref","as","component","position","display","flexDirection","flexWrap","flexGrow","flexShrink","alignItems","justifyContent","overflow","width","height","background","border","borderRadius","minWidth","maxWidth","textAlign","padding","paddingY","paddingX","paddingTop","paddingRight","paddingBottom","paddingLeft","margin","marginY","marginX","marginTop","marginRight","marginBottom","marginLeft","className","children","props","resolvedPaddingTop","resolvedPaddingRight","resolvedPaddingBottom","resolvedPaddingLeft","resolvedMarginTop","resolvedMarginRight","resolvedMarginBottom","resolvedMarginLeft","omitFlex","React","classNames","styles","box","getClassNames","String","paddingStyles","marginStyles","undefined"],"mappings":"+bA4EYA,wBAAuD,WAsC/DC,2BApCIC,GAAIC,aAAY,YAChBC,SAAAA,aAAW,WACXC,IAAAA,YACAC,cAAAA,aAAgB,QAChBC,IAAAA,SACAC,IAAAA,SACAC,IAAAA,WACAC,IAAAA,WACAC,IAAAA,eACAC,IAAAA,SACAC,IAAAA,MACAC,IAAAA,OACAC,IAAAA,WACAC,IAAAA,OACAC,IAAAA,aACAC,IAAAA,SACAC,IAAAA,aACAC,UAAAA,aAAY,UACZC,IAAAA,QACAC,IAAAA,SACAC,IAAAA,SACAC,IAAAA,WACAC,IAAAA,aACAC,IAAAA,cACAC,IAAAA,YACAC,IAAAA,OACAC,IAAAA,QACAC,IAAAA,QACAC,IAAAA,UACAC,IAAAA,YACAC,IAAAA,aACAC,IAAAA,WACAC,IAAAA,UACAC,KAAAA,SACGC,ybAIDC,aAAqBd,MAAAA,EAAAA,EAAcF,iBAAYD,EAC/CkB,aAAuBd,MAAAA,EAAAA,EAAgBF,iBAAYF,EACnDmB,aAAwBd,MAAAA,EAAAA,EAAiBJ,iBAAYD,EACrDoB,aAAsBd,MAAAA,EAAAA,EAAeJ,iBAAYF,EAEjDqB,aAAoBX,MAAAA,EAAAA,EAAaF,iBAAWD,EAC5Ce,aAAsBX,MAAAA,EAAAA,EAAeF,iBAAWF,EAChDgB,aAAuBX,MAAAA,EAAAA,EAAgBJ,iBAAWD,EAClDiB,aAAqBX,MAAAA,EAAAA,EAAcJ,iBAAWF,EAE9CkB,IACDzC,GAA+B,iBAAZA,GAAoC,SAAZA,GAAkC,eAAZA,SAE/D0C,gBACH5C,qCAEOkC,QACHF,UACIa,EACIb,EACAc,UAAOC,IACP7C,EAAU8C,gBAAcF,UAAQ,UAAW5C,GAAW,KACzC,WAAbD,EAAwB+C,gBAAcF,UAAQ,WAAY7C,GAAY,KAC1D,MAAZc,EAAmBiC,gBAAcF,UAAQ,WAAYG,OAAOlC,IAAa,KACzEiC,gBAAcF,UAAQ,WAAY9B,GACpB,UAAdC,EAAwB+B,gBAAcF,UAAQ,YAAa7B,GAAa,KAExE+B,gBAAcE,UAAe,aAAcf,IAC3Ca,gBAAcE,UAAe,eAAgBd,IAC7CY,gBAAcE,UAAe,gBAAiBb,IAC9CW,gBAAcE,UAAe,cAAeZ,IAE5CU,gBAAcG,UAAc,YAAaZ,IACzCS,gBAAcG,UAAc,cAAeX,IAC3CQ,gBAAcG,UAAc,eAAgBV,IAC5CO,gBAAcG,UAAc,aAAcT,IAE1CC,GAAW,KAAOK,gBAAcF,UAAQ,gBAAiB3C,GACzDwC,GAAW,KAAOK,gBAAcF,UAAQ,WAAY1C,GACpDuC,GAAW,KAAOK,gBAAcF,UAAQ,aAAcvC,GACtDoC,GAAW,KAAOK,gBAAcF,UAAQ,iBAAkBtC,GAC5C,MAAdF,EACM0C,gBAAcF,UAAQ,aAAcG,OAAO3C,IAC3C,KACM,MAAZD,EAAmB2C,gBAAcF,UAAQ,WAAYG,OAAO5C,IAAa,KAEzE2C,gBAAcF,UAAQ,WAAYrC,GAClCuC,gBAAcF,UAAQ,QAASpC,GAC/BsC,gBAAcF,UAAQ,SAAUnC,GAChCqC,gBAAcF,UAAQ,KAAMlC,GACX,SAAjBE,EACMkC,gBAAcF,UAAQ,eAAgBhC,GACtC,KACK,SAAXD,EAAoBmC,gBAAcF,UAAQ,SAAUjC,GAAU,YAC7DuC,EACTtD,IAAAA,IAEJmC"}
1
+ {"version":3,"file":"box.js","sources":["../../../src/new-components/box/box.tsx"],"sourcesContent":["import * as React from 'react'\nimport classNames from 'classnames'\nimport { polymorphicComponent } from '../../utils/polymorphism'\nimport { getClassNames } from '../responsive-props'\n\nimport type { ResponsiveProp } from '../responsive-props'\nimport type {\n DividerWeight,\n Space,\n SpaceWithNegatives,\n WithEnhancedClassName,\n} from '../common-types'\n\nimport styles from './box.module.css'\nimport paddingStyles from './padding.module.css'\nimport marginStyles from './margin.module.css'\nimport widthStyles from './width.module.css'\n\ninterface BoxPaddingProps {\n padding?: ResponsiveProp<Space>\n paddingX?: ResponsiveProp<Space>\n paddingY?: ResponsiveProp<Space>\n paddingTop?: ResponsiveProp<Space>\n paddingRight?: ResponsiveProp<Space>\n paddingBottom?: ResponsiveProp<Space>\n paddingLeft?: ResponsiveProp<Space>\n}\n\ninterface BoxMarginProps {\n margin?: ResponsiveProp<SpaceWithNegatives>\n marginX?: ResponsiveProp<SpaceWithNegatives>\n marginY?: ResponsiveProp<SpaceWithNegatives>\n marginTop?: ResponsiveProp<SpaceWithNegatives>\n marginRight?: ResponsiveProp<SpaceWithNegatives>\n marginBottom?: ResponsiveProp<SpaceWithNegatives>\n marginLeft?: ResponsiveProp<SpaceWithNegatives>\n}\n\ntype BoxDisplay = 'block' | 'flex' | 'inline' | 'inlineBlock' | 'inlineFlex' | 'none'\ntype BoxFlexDirection = 'column' | 'row'\ntype BoxFlexWrap = 'nowrap' | 'wrap'\ntype BoxAlignItems = 'center' | 'flexEnd' | 'flexStart' | 'baseline'\ntype BoxJustifyContent =\n | 'center'\n | 'flexEnd'\n | 'flexStart'\n | 'spaceAround'\n | 'spaceBetween'\n | 'spaceEvenly'\ntype BoxOverflow = 'hidden' | 'auto' | 'visible' | 'scroll'\n\ntype BoxMaxMinWidth = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge'\ntype BoxMinWidth = 0 | BoxMaxMinWidth\ntype BoxMaxWidth = BoxMaxMinWidth | 'full'\ntype BoxWidth = 0 | BoxMaxMinWidth | 'full' | 'auto' | 'maxContent' | 'minContent' | 'fitContent'\n\ninterface BorderProps {\n borderRadius?: 'standard' | 'none' | 'full'\n border?: DividerWeight\n}\n\ninterface ReusableBoxProps extends BorderProps, BoxPaddingProps {\n minWidth?: BoxMinWidth\n maxWidth?: BoxMaxWidth\n width?: BoxWidth\n background?: 'default' | 'aside' | 'highlight' | 'selected'\n flexGrow?: 0 | 1\n flexShrink?: 0\n}\n\ntype BoxPosition = 'absolute' | 'fixed' | 'relative' | 'static' | 'sticky'\n\ninterface BoxProps extends WithEnhancedClassName, ReusableBoxProps, BoxMarginProps {\n position?: ResponsiveProp<BoxPosition>\n display?: ResponsiveProp<BoxDisplay>\n flexDirection?: ResponsiveProp<BoxFlexDirection>\n flexWrap?: BoxFlexWrap\n alignItems?: ResponsiveProp<BoxAlignItems>\n justifyContent?: ResponsiveProp<BoxJustifyContent>\n overflow?: BoxOverflow\n height?: 'full'\n textAlign?: ResponsiveProp<'start' | 'center' | 'end' | 'justify'>\n}\n\nconst Box = polymorphicComponent<'div', BoxProps, 'keepClassName'>(function Box(\n {\n as: component = 'div',\n position = 'static',\n display,\n flexDirection = 'row',\n flexWrap,\n flexGrow,\n flexShrink,\n alignItems,\n justifyContent,\n overflow,\n width,\n height,\n background,\n border,\n borderRadius,\n minWidth,\n maxWidth,\n textAlign = 'start',\n padding,\n paddingY,\n paddingX,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n margin,\n marginY,\n marginX,\n marginTop,\n marginRight,\n marginBottom,\n marginLeft,\n className,\n children,\n ...props\n },\n ref,\n) {\n const resolvedPaddingTop = paddingTop ?? paddingY ?? padding\n const resolvedPaddingRight = paddingRight ?? paddingX ?? padding\n const resolvedPaddingBottom = paddingBottom ?? paddingY ?? padding\n const resolvedPaddingLeft = paddingLeft ?? paddingX ?? padding\n\n const resolvedMarginTop = marginTop ?? marginY ?? margin\n const resolvedMarginRight = marginRight ?? marginX ?? margin\n const resolvedMarginBottom = marginBottom ?? marginY ?? margin\n const resolvedMarginLeft = marginLeft ?? marginX ?? margin\n\n const omitFlex =\n !display || (typeof display === 'string' && display !== 'flex' && display !== 'inlineFlex')\n\n return React.createElement(\n component,\n {\n ...props,\n className:\n classNames(\n className,\n styles.box,\n display ? getClassNames(styles, 'display', display) : null,\n position !== 'static' ? getClassNames(styles, 'position', position) : null,\n minWidth != null\n ? getClassNames(widthStyles, 'minWidth', String(minWidth))\n : null,\n getClassNames(widthStyles, 'maxWidth', maxWidth),\n textAlign !== 'start' ? getClassNames(styles, 'textAlign', textAlign) : null,\n // padding\n getClassNames(paddingStyles, 'paddingTop', resolvedPaddingTop),\n getClassNames(paddingStyles, 'paddingRight', resolvedPaddingRight),\n getClassNames(paddingStyles, 'paddingBottom', resolvedPaddingBottom),\n getClassNames(paddingStyles, 'paddingLeft', resolvedPaddingLeft),\n // margin\n getClassNames(marginStyles, 'marginTop', resolvedMarginTop),\n getClassNames(marginStyles, 'marginRight', resolvedMarginRight),\n getClassNames(marginStyles, 'marginBottom', resolvedMarginBottom),\n getClassNames(marginStyles, 'marginLeft', resolvedMarginLeft),\n // flex props\n omitFlex ? null : getClassNames(styles, 'flexDirection', flexDirection),\n omitFlex ? null : getClassNames(styles, 'flexWrap', flexWrap),\n omitFlex ? null : getClassNames(styles, 'alignItems', alignItems),\n omitFlex ? null : getClassNames(styles, 'justifyContent', justifyContent),\n flexShrink != null\n ? getClassNames(styles, 'flexShrink', String(flexShrink))\n : null,\n flexGrow != null ? getClassNames(styles, 'flexGrow', String(flexGrow)) : null,\n // other props\n getClassNames(styles, 'overflow', overflow),\n width != null ? getClassNames(widthStyles, 'width', String(width)) : null,\n getClassNames(styles, 'height', height),\n getClassNames(styles, 'bg', background),\n borderRadius !== 'none'\n ? getClassNames(styles, 'borderRadius', borderRadius)\n : null,\n border !== 'none' ? getClassNames(styles, 'border', border) : null,\n ) || undefined,\n ref,\n },\n children,\n )\n})\n\nexport type {\n BoxProps,\n BoxPaddingProps,\n BoxMarginProps,\n ReusableBoxProps,\n BoxMinWidth,\n BoxMaxWidth,\n BoxDisplay,\n BoxPosition,\n BoxFlexDirection,\n BoxFlexWrap,\n BoxAlignItems,\n BoxJustifyContent,\n BoxOverflow,\n}\n\nexport { Box }\n"],"names":["polymorphicComponent","ref","as","component","position","display","flexDirection","flexWrap","flexGrow","flexShrink","alignItems","justifyContent","overflow","width","height","background","border","borderRadius","minWidth","maxWidth","textAlign","padding","paddingY","paddingX","paddingTop","paddingRight","paddingBottom","paddingLeft","margin","marginY","marginX","marginTop","marginRight","marginBottom","marginLeft","className","children","props","resolvedPaddingTop","resolvedPaddingRight","resolvedPaddingBottom","resolvedPaddingLeft","resolvedMarginTop","resolvedMarginRight","resolvedMarginBottom","resolvedMarginLeft","omitFlex","React","classNames","styles","box","getClassNames","widthStyles","String","paddingStyles","marginStyles","undefined"],"mappings":"w3BAoFYA,wBAAuD,WAsC/DC,2BApCIC,GAAIC,aAAY,YAChBC,SAAAA,aAAW,WACXC,IAAAA,YACAC,cAAAA,aAAgB,QAChBC,IAAAA,SACAC,IAAAA,SACAC,IAAAA,WACAC,IAAAA,WACAC,IAAAA,eACAC,IAAAA,SACAC,IAAAA,MACAC,IAAAA,OACAC,IAAAA,WACAC,IAAAA,OACAC,IAAAA,aACAC,IAAAA,SACAC,IAAAA,aACAC,UAAAA,aAAY,UACZC,IAAAA,QACAC,IAAAA,SACAC,IAAAA,SACAC,IAAAA,WACAC,IAAAA,aACAC,IAAAA,cACAC,IAAAA,YACAC,IAAAA,OACAC,IAAAA,QACAC,IAAAA,QACAC,IAAAA,UACAC,IAAAA,YACAC,IAAAA,aACAC,KAAAA,WACAC,KAAAA,UACAC,KAAAA,SACGC,uCAIDC,aAAqBd,MAAAA,EAAAA,EAAcF,iBAAYD,EAC/CkB,aAAuBd,MAAAA,EAAAA,EAAgBF,iBAAYF,EACnDmB,aAAwBd,MAAAA,EAAAA,EAAiBJ,iBAAYD,EACrDoB,aAAsBd,MAAAA,EAAAA,EAAeJ,iBAAYF,EAEjDqB,aAAoBX,MAAAA,EAAAA,EAAaF,iBAAWD,EAC5Ce,aAAsBX,MAAAA,EAAAA,EAAeF,iBAAWF,EAChDgB,aAAuBX,MAAAA,EAAAA,EAAgBJ,iBAAWD,EAClDiB,aAAqBX,MAAAA,GAAAA,GAAcJ,iBAAWF,EAE9CkB,IACDzC,GAA+B,iBAAZA,GAAoC,SAAZA,GAAkC,eAAZA,SAE/D0C,gBACH5C,qCAEOkC,QACHF,UACIa,EACIb,GACAc,UAAOC,IACP7C,EAAU8C,gBAAcF,UAAQ,UAAW5C,GAAW,KACzC,WAAbD,EAAwB+C,gBAAcF,UAAQ,WAAY7C,GAAY,KAC1D,MAAZc,EACMiC,gBAAcC,UAAa,WAAYC,OAAOnC,IAC9C,KACNiC,gBAAcC,UAAa,WAAYjC,GACzB,UAAdC,EAAwB+B,gBAAcF,UAAQ,YAAa7B,GAAa,KAExE+B,gBAAcG,UAAe,aAAchB,IAC3Ca,gBAAcG,UAAe,eAAgBf,IAC7CY,gBAAcG,UAAe,gBAAiBd,IAC9CW,gBAAcG,UAAe,cAAeb,IAE5CU,gBAAcI,UAAc,YAAab,IACzCS,gBAAcI,UAAc,cAAeZ,IAC3CQ,gBAAcI,UAAc,eAAgBX,IAC5CO,gBAAcI,UAAc,aAAcV,IAE1CC,GAAW,KAAOK,gBAAcF,UAAQ,gBAAiB3C,GACzDwC,GAAW,KAAOK,gBAAcF,UAAQ,WAAY1C,GACpDuC,GAAW,KAAOK,gBAAcF,UAAQ,aAAcvC,GACtDoC,GAAW,KAAOK,gBAAcF,UAAQ,iBAAkBtC,GAC5C,MAAdF,EACM0C,gBAAcF,UAAQ,aAAcI,OAAO5C,IAC3C,KACM,MAAZD,EAAmB2C,gBAAcF,UAAQ,WAAYI,OAAO7C,IAAa,KAEzE2C,gBAAcF,UAAQ,WAAYrC,GACzB,MAATC,EAAgBsC,gBAAcC,UAAa,QAASC,OAAOxC,IAAU,KACrEsC,gBAAcF,UAAQ,SAAUnC,GAChCqC,gBAAcF,UAAQ,KAAMlC,GACX,SAAjBE,EACMkC,gBAAcF,UAAQ,eAAgBhC,GACtC,KACK,SAAXD,EAAoBmC,gBAAcF,UAAQ,SAAUjC,GAAU,YAC7DwC,EACTvD,IAAAA,IAEJmC"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default={box:"_3aac345d","position-absolute":"_5f5fbe05","position-fixed":"_2e1dcb18","position-relative":"_6b073eae","position-sticky":"ed69c0f9","tablet-position-absolute":"b895daa3","tablet-position-fixed":"_81f67db7","tablet-position-relative":"bf7d2da5","tablet-position-sticky":"e0ab99ed","desktop-position-absolute":"_5dade286","desktop-position-fixed":"_584d7ee7","desktop-position-relative":"c7f56545","desktop-position-sticky":"_70b5ef21","display-block":"_5bca176b","display-flex":"_32670f8f","display-inline":"_3f9cb619","display-inlineBlock":"a42dded2","display-inlineFlex":"_7a45d80c","display-none":"a469c553","tablet-display-block":"_8e5cf5df","tablet-display-flex":"_640f3795","tablet-display-inline":"f1a1c131","tablet-display-inlineBlock":"e9f55809","tablet-display-inlineFlex":"_9fd7bd31","tablet-display-none":"_389a387a","desktop-display-block":"_3e730e39","desktop-display-flex":"_8407ca0e","desktop-display-inline":"_596653e1","desktop-display-inlineBlock":"eb198bac","desktop-display-inlineFlex":"c89ef13b","desktop-display-none":"_868c554e","minWidth-0":"a6e042e3","minWidth-xsmall":"_9ce11446","minWidth-small":"_2db5e251","minWidth-medium":"ef281ffc","minWidth-large":"f938efbe","minWidth-xlarge":"f87c0f55","maxWidth-xsmall":"_873d4d51","maxWidth-small":"_400d4800","maxWidth-medium":"_94ecdffd","maxWidth-large":"f9eeefb5","maxWidth-xlarge":"_2253ed9a","maxWidth-full":"bde40dfb","flexDirection-column":"c45f6767","flexDirection-row":"c167e8da","tablet-flexDirection-column":"c0ca97a9","tablet-flexDirection-row":"_45ebc391","desktop-flexDirection-column":"dfd69d4d","desktop-flexDirection-row":"f3d06da6","flexWrap-wrap":"_7fb6a141","flexWrap-nowrap":"_30a701b3","flexShrink-0":"_24cf9746","flexGrow-0":"d2a4825d","flexGrow-1":"a2a05bbf","alignItems-flexStart":"_4ada17a4","alignItems-center":"c2c1d3b2","alignItems-flexEnd":"_259506f5","alignItems-baseline":"_3cb51936","tablet-alignItems-flexStart":"_86497cb0","tablet-alignItems-center":"_5a281eb4","tablet-alignItems-flexEnd":"d7c8f9b0","tablet-alignItems-baseline":"_9b92f4b7","desktop-alignItems-flexStart":"_4d2b7f03","desktop-alignItems-center":"_521b4677","desktop-alignItems-flexEnd":"_239714b3","desktop-alignItems-baseline":"_49fa952b","justifyContent-flexStart":"_84c5c8b7","justifyContent-center":"_84df2447","justifyContent-flexEnd":"_96a7db47","justifyContent-spaceAround":"e7ad8d72","justifyContent-spaceBetween":"e5a5ea05","justifyContent-spaceEvenly":"_08952f29","tablet-justifyContent-flexStart":"_69d750a7","tablet-justifyContent-center":"be616f82","tablet-justifyContent-flexEnd":"_4e22f886","tablet-justifyContent-spaceAround":"_9b848fa4","tablet-justifyContent-spaceBetween":"_346ba50f","tablet-justifyContent-spaceEvenly":"_8e101549","desktop-justifyContent-flexStart":"_3e1b3f62","desktop-justifyContent-center":"a285086c","desktop-justifyContent-flexEnd":"_32759d54","desktop-justifyContent-spaceBetween":"_543f6141","overflow-hidden":"d91c9bdf","overflow-auto":"_438cafe6","overflow-visible":"_9527349d","overflow-scroll":"a086ce42","width-full":"d32e2047","height-full":"_2d523b97","bg-default":"_581ad1ab","bg-aside":"a554f678","bg-highlight":"_2d74468c","bg-selected":"eb3848be","borderRadius-standard":"_14fe8bc8","borderRadius-full":"c1bf716d","border-standard":"f605be96","textAlign-start":"_083a10ea","textAlign-center":"_8c05b9dc","textAlign-end":"e9c0981c","textAlign-justify":"a21c651d","tablet-textAlign-start":"_62b208d9","tablet-textAlign-center":"_7198bfc5","tablet-textAlign-end":"_4156cdf8","tablet-textAlign-justify":"_5dce5b3b","desktop-textAlign-start":"_526ba24a","desktop-textAlign-center":"f98d87d4","desktop-textAlign-end":"_9679b54a","desktop-textAlign-justify":"_4b25a07f"};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default={box:"_2a8ae321","position-absolute":"_29e047b9","position-fixed":"fe54fea9","position-relative":"_6a95a38d","position-sticky":"ccc689fe","tablet-position-absolute":"aad88ae1","tablet-position-fixed":"_2044ccd3","tablet-position-relative":"a0904035","tablet-position-sticky":"_770506a5","desktop-position-absolute":"_5a954855","desktop-position-fixed":"_2dc73359","desktop-position-relative":"_6ab005ed","desktop-position-sticky":"fa60c726","display-block":"_221ad6a3","display-flex":"_6764f5bc","display-inline":"_50c37dba","display-inlineBlock":"_16546fe0","display-inlineFlex":"_2782a687","display-none":"b70b4fb7","tablet-display-block":"_5b3547cc","tablet-display-flex":"_099432e6","tablet-display-inline":"d99fcd80","tablet-display-inlineBlock":"_8f160568","tablet-display-inlineFlex":"_5b7b4be4","tablet-display-none":"_553721f8","desktop-display-block":"_6b86b317","desktop-display-flex":"eb20eda4","desktop-display-inline":"be19d1e9","desktop-display-inlineBlock":"dcf7c80a","desktop-display-inlineFlex":"e4f02b1f","desktop-display-none":"_3974e6d8","flexDirection-column":"daf5e366","flexDirection-row":"_47f2ddb7","tablet-flexDirection-column":"_27490d54","tablet-flexDirection-row":"_0317f51b","desktop-flexDirection-column":"_97590faa","desktop-flexDirection-row":"bf5d416e","flexWrap-wrap":"_210c1f9e","flexWrap-nowrap":"_2c775d07","flexShrink-0":"_25cae61d","flexGrow-0":"_6068a9cf","flexGrow-1":"c63f682c","alignItems-flexStart":"_0e774dfc","alignItems-center":"_5695a5d5","alignItems-flexEnd":"_139515d8","alignItems-baseline":"cea92f0a","tablet-alignItems-flexStart":"_3dc7ec16","tablet-alignItems-center":"_7993a7fa","tablet-alignItems-flexEnd":"b90d7edc","tablet-alignItems-baseline":"_7bd633f1","desktop-alignItems-flexStart":"_260d232b","desktop-alignItems-center":"_9e2e0a07","desktop-alignItems-flexEnd":"fc97448b","desktop-alignItems-baseline":"_0f76a529","justifyContent-flexStart":"_21d759bf","justifyContent-center":"ff70e049","justifyContent-flexEnd":"ae15d5ad","justifyContent-spaceAround":"_84374266","justifyContent-spaceBetween":"e72a8ca2","justifyContent-spaceEvenly":"_86224cb5","tablet-justifyContent-flexStart":"dceedee0","tablet-justifyContent-center":"_34ab3dab","tablet-justifyContent-flexEnd":"d5da2eb9","tablet-justifyContent-spaceAround":"_1677560d","tablet-justifyContent-spaceBetween":"ef77b2e7","tablet-justifyContent-spaceEvenly":"_685ef848","desktop-justifyContent-flexStart":"_695667f2","desktop-justifyContent-center":"ebb180cc","desktop-justifyContent-flexEnd":"bd5bb675","desktop-justifyContent-spaceBetween":"ae08a70c","overflow-hidden":"_4afa6fac","overflow-auto":"d8d342e4","overflow-visible":"c104da68","overflow-scroll":"_2d6bc0d0","height-full":"_99458759","bg-default":"aadb417c","bg-aside":"_36dca662","bg-highlight":"a1054115","bg-selected":"d17b4e9a","borderRadius-standard":"e3a3ee05","borderRadius-full":"be0cb60b","border-primary":"b9999f44","border-secondary":"_91063996","border-tertiary":"_0902977e","textAlign-start":"a7c58898","textAlign-center":"_2c9a262a","textAlign-end":"_46f07e93","textAlign-justify":"e526003e","tablet-textAlign-start":"_26864fce","tablet-textAlign-center":"e8f51d21","tablet-textAlign-end":"c1dc8b90","tablet-textAlign-justify":"_36bb3fa9","desktop-textAlign-start":"_942e35b0","desktop-textAlign-center":"_92da5c98","desktop-textAlign-end":"_2b0ecaf6","desktop-textAlign-justify":"_3dd24641"};
2
2
  //# sourceMappingURL=box.module.css.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default={"minWidth-0":"_68ab48ca","minWidth-xsmall":"_6fa2b565","minWidth-small":"dd50fabd","minWidth-medium":"e7e2c808","minWidth-large":"_6abbe25e","minWidth-xlarge":"_54f479ac","maxWidth-xsmall":"_148492bc","maxWidth-small":"bd023b96","maxWidth-medium":"e102903f","maxWidth-large":"_0e8d76d7","maxWidth-xlarge":"_47a031d0","maxWidth-full":"cd4c8183","width-0":"_5f5959e8","width-full":"_8c75067a","width-auto":"_56a651f6","width-maxContent":"_26f87bb8","width-minContent":"_07a6ab44","width-fitContent":"a87016fa","width-xsmall":"_1a972e50","width-small":"c96d8261","width-medium":"f3829d42","width-large":"_2caef228","width-xlarge":"_069e1491"};
2
+ //# sourceMappingURL=width.module.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"width.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),t=require("react"),a=require("../base-button/base-button.js");exports.Button=t.forwardRef((function(o,r){var s=o.variant,i=o.tone,n=void 0===i?"normal":i,l=o.size,u=void 0===l?"normal":l,b=o.type,d=void 0===b?"button":b,p=o.disabled,v=void 0!==p&&p,c=o.exceptionallySetClassName,y=e.objectWithoutPropertiesLoose(o,["variant","tone","size","type","disabled","exceptionallySetClassName"]);return t.createElement(a.BaseButton,Object.assign({},y,{as:"button",ref:r,variant:s,tone:n,size:u,type:d,disabled:v,exceptionallySetClassName:c}))}));
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),t=require("react"),a=require("../base-button/base-button.js"),o=["variant","tone","size","type","disabled","exceptionallySetClassName"];exports.Button=t.forwardRef((function(r,s){var i=r.variant,n=r.tone,l=void 0===n?"normal":n,u=r.size,b=void 0===u?"normal":u,d=r.type,p=void 0===d?"button":d,v=r.disabled,c=void 0!==v&&v,y=r.exceptionallySetClassName,m=e.objectWithoutPropertiesLoose(r,o);return t.createElement(a.BaseButton,Object.assign({},m,{as:"button",ref:s,variant:i,tone:l,size:b,type:p,disabled:c,exceptionallySetClassName:y}))}));
2
2
  //# sourceMappingURL=button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"button.js","sources":["../../../src/new-components/button/button.tsx"],"sourcesContent":["import * as React from 'react'\nimport { BaseButton } from '../base-button'\nimport type { BaseButtonProps } from '../base-button'\n\ntype NativeButtonProps = Omit<\n React.AllHTMLAttributes<HTMLButtonElement>,\n 'aria-disabled' | 'className' | keyof BaseButtonProps\n>\n\nexport type ButtonProps = NativeButtonProps &\n BaseButtonProps & {\n type?: 'button' | 'submit' | 'reset'\n exceptionallySetClassName?: string\n }\n\n/**\n * A semantic button that also looks like a button, and provides all the necessary visual variants.\n * It follows the [WAI-ARIA Button Pattern](https://www.w3.org/TR/wai-aria-practices/#button).\n *\n * 🎨 [Figma](https://www.figma.com/file/LYlWNzvhMDh907l07mPPQk/Product-Web?node-id=4693%3A175143)\n *\n * @see ButtonLink\n */\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n variant,\n tone = 'normal',\n size = 'normal',\n type = 'button',\n disabled = false,\n exceptionallySetClassName,\n ...props\n },\n ref,\n) {\n return (\n <BaseButton\n {...props}\n as=\"button\"\n ref={ref}\n variant={variant}\n tone={tone}\n size={size}\n type={type}\n disabled={disabled}\n exceptionallySetClassName={exceptionallySetClassName}\n />\n )\n})\n"],"names":["React","ref","variant","tone","size","type","disabled","exceptionallySetClassName","props","BaseButton","as"],"mappings":"8MAuBsBA,cAAiD,WAUnEC,OARIC,IAAAA,YACAC,KAAAA,aAAO,eACPC,KAAAA,aAAO,eACPC,KAAAA,aAAO,eACPC,SAAAA,gBACAC,IAAAA,0BACGC,mHAKHR,gBAACS,8BACOD,GACJE,GAAG,SACHT,IAAKA,EACLC,QAASA,EACTC,KAAMA,EACNC,KAAMA,EACNC,KAAMA,EACNC,SAAUA,EACVC,0BAA2BA"}
1
+ {"version":3,"file":"button.js","sources":["../../../src/new-components/button/button.tsx"],"sourcesContent":["import * as React from 'react'\nimport { BaseButton } from '../base-button'\nimport type { BaseButtonProps } from '../base-button'\n\ntype NativeButtonProps = Omit<\n React.AllHTMLAttributes<HTMLButtonElement>,\n 'aria-disabled' | 'className' | keyof BaseButtonProps\n>\n\nexport type ButtonProps = NativeButtonProps &\n BaseButtonProps & {\n type?: 'button' | 'submit' | 'reset'\n exceptionallySetClassName?: string\n }\n\n/**\n * A semantic button that also looks like a button, and provides all the necessary visual variants.\n * It follows the [WAI-ARIA Button Pattern](https://www.w3.org/TR/wai-aria-practices/#button).\n *\n * 🎨 [Figma](https://www.figma.com/file/LYlWNzvhMDh907l07mPPQk/Product-Web?node-id=4693%3A175143)\n *\n * @see ButtonLink\n */\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n variant,\n tone = 'normal',\n size = 'normal',\n type = 'button',\n disabled = false,\n exceptionallySetClassName,\n ...props\n },\n ref,\n) {\n return (\n <BaseButton\n {...props}\n as=\"button\"\n ref={ref}\n variant={variant}\n tone={tone}\n size={size}\n type={type}\n disabled={disabled}\n exceptionallySetClassName={exceptionallySetClassName}\n />\n )\n})\n"],"names":["React","ref","variant","tone","size","type","disabled","exceptionallySetClassName","props","BaseButton","as"],"mappings":"wRAuBsBA,cAAiD,WAUnEC,OARIC,IAAAA,YACAC,KAAAA,aAAO,eACPC,KAAAA,aAAO,eACPC,KAAAA,aAAO,eACPC,SAAAA,gBACAC,IAAAA,0BACGC,6CAKHR,gBAACS,8BACOD,GACJE,GAAG,SACHT,IAAKA,EACLC,QAASA,EACTC,KAAMA,EACNC,KAAMA,EACNC,KAAMA,EACNC,SAAUA,EACVC,0BAA2BA"}