@veeqo/ui 9.7.1 → 9.9.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 (222) hide show
  1. package/dist/components/ActionMenu/ActionMenu.cjs +1 -0
  2. package/dist/components/ActionMenu/ActionMenu.cjs.map +1 -1
  3. package/dist/components/ActionMenu/ActionMenu.js +1 -0
  4. package/dist/components/ActionMenu/ActionMenu.js.map +1 -1
  5. package/dist/components/DataGrid/DataGrid.cjs +104 -0
  6. package/dist/components/DataGrid/DataGrid.cjs.map +1 -0
  7. package/dist/components/DataGrid/DataGrid.d.ts +21 -0
  8. package/dist/components/DataGrid/DataGrid.js +98 -0
  9. package/dist/components/DataGrid/DataGrid.js.map +1 -0
  10. package/dist/components/DataGrid/components/Body/Body.cjs +21 -0
  11. package/dist/components/DataGrid/components/Body/Body.cjs.map +1 -0
  12. package/dist/components/DataGrid/components/Body/Body.d.ts +23 -0
  13. package/dist/components/DataGrid/components/Body/Body.js +14 -0
  14. package/dist/components/DataGrid/components/Body/Body.js.map +1 -0
  15. package/dist/components/DataGrid/components/Body/BodyCell/BodyCell.cjs +29 -0
  16. package/dist/components/DataGrid/components/Body/BodyCell/BodyCell.cjs.map +1 -0
  17. package/dist/components/DataGrid/components/Body/BodyCell/BodyCell.d.ts +18 -0
  18. package/dist/components/DataGrid/components/Body/BodyCell/BodyCell.js +23 -0
  19. package/dist/components/DataGrid/components/Body/BodyCell/BodyCell.js.map +1 -0
  20. package/dist/components/DataGrid/components/Body/BodyCell/BodyCell.module.css.cjs +11 -0
  21. package/dist/components/DataGrid/components/Body/BodyCell/BodyCell.module.css.cjs.map +1 -0
  22. package/dist/components/DataGrid/components/Body/BodyCell/BodyCell.module.css.js +9 -0
  23. package/dist/components/DataGrid/components/Body/BodyCell/BodyCell.module.css.js.map +1 -0
  24. package/dist/components/DataGrid/components/Body/BodyCell/index.d.ts +1 -0
  25. package/dist/components/DataGrid/components/Body/Row/Row.cjs +14 -0
  26. package/dist/components/DataGrid/components/Body/Row/Row.cjs.map +1 -0
  27. package/dist/components/DataGrid/components/Body/Row/Row.d.ts +18 -0
  28. package/dist/components/DataGrid/components/Body/Row/Row.js +8 -0
  29. package/dist/components/DataGrid/components/Body/Row/Row.js.map +1 -0
  30. package/dist/components/DataGrid/components/Body/Row/index.d.ts +1 -0
  31. package/dist/components/DataGrid/components/Body/index.d.ts +1 -0
  32. package/dist/components/DataGrid/components/CellContent/CellContent.cjs +21 -0
  33. package/dist/components/DataGrid/components/CellContent/CellContent.cjs.map +1 -0
  34. package/dist/components/DataGrid/components/CellContent/CellContent.d.ts +15 -0
  35. package/dist/components/DataGrid/components/CellContent/CellContent.js +15 -0
  36. package/dist/components/DataGrid/components/CellContent/CellContent.js.map +1 -0
  37. package/dist/components/DataGrid/components/CellContent/CellContent.module.css.cjs +11 -0
  38. package/dist/components/DataGrid/components/CellContent/CellContent.module.css.cjs.map +1 -0
  39. package/dist/components/DataGrid/components/CellContent/CellContent.module.css.js +9 -0
  40. package/dist/components/DataGrid/components/CellContent/CellContent.module.css.js.map +1 -0
  41. package/dist/components/DataGrid/components/CellContent/index.d.ts +1 -0
  42. package/dist/components/DataGrid/components/Columns/Columns.cjs +56 -0
  43. package/dist/components/DataGrid/components/Columns/Columns.cjs.map +1 -0
  44. package/dist/components/DataGrid/components/Columns/Columns.d.ts +17 -0
  45. package/dist/components/DataGrid/components/Columns/Columns.js +50 -0
  46. package/dist/components/DataGrid/components/Columns/Columns.js.map +1 -0
  47. package/dist/components/DataGrid/components/Columns/index.d.ts +1 -0
  48. package/dist/components/DataGrid/components/Footer/Footer.cjs +18 -0
  49. package/dist/components/DataGrid/components/Footer/Footer.cjs.map +1 -0
  50. package/dist/components/DataGrid/components/Footer/Footer.d.ts +15 -0
  51. package/dist/components/DataGrid/components/Footer/Footer.js +12 -0
  52. package/dist/components/DataGrid/components/Footer/Footer.js.map +1 -0
  53. package/dist/components/DataGrid/components/Footer/FooterCell/FooterCell.cjs +25 -0
  54. package/dist/components/DataGrid/components/Footer/FooterCell/FooterCell.cjs.map +1 -0
  55. package/dist/components/DataGrid/components/Footer/FooterCell/FooterCell.d.ts +18 -0
  56. package/dist/components/DataGrid/components/Footer/FooterCell/FooterCell.js +19 -0
  57. package/dist/components/DataGrid/components/Footer/FooterCell/FooterCell.js.map +1 -0
  58. package/dist/components/DataGrid/components/Footer/FooterCell/FooterCell.module.css.cjs +11 -0
  59. package/dist/components/DataGrid/components/Footer/FooterCell/FooterCell.module.css.cjs.map +1 -0
  60. package/dist/components/DataGrid/components/Footer/FooterCell/FooterCell.module.css.js +9 -0
  61. package/dist/components/DataGrid/components/Footer/FooterCell/FooterCell.module.css.js.map +1 -0
  62. package/dist/components/DataGrid/components/Footer/FooterCell/index.d.ts +1 -0
  63. package/dist/components/DataGrid/components/Footer/index.d.ts +1 -0
  64. package/dist/components/DataGrid/components/GridContainer/Container/Container.cjs +23 -0
  65. package/dist/components/DataGrid/components/GridContainer/Container/Container.cjs.map +1 -0
  66. package/dist/components/DataGrid/components/GridContainer/Container/Container.d.ts +21 -0
  67. package/dist/components/DataGrid/components/GridContainer/Container/Container.js +17 -0
  68. package/dist/components/DataGrid/components/GridContainer/Container/Container.js.map +1 -0
  69. package/dist/components/DataGrid/components/GridContainer/Container/Container.module.css.cjs +17 -0
  70. package/dist/components/DataGrid/components/GridContainer/Container/Container.module.css.cjs.map +1 -0
  71. package/dist/components/DataGrid/components/GridContainer/Container/Container.module.css.js +12 -0
  72. package/dist/components/DataGrid/components/GridContainer/Container/Container.module.css.js.map +1 -0
  73. package/dist/components/DataGrid/components/GridContainer/Container/index.d.ts +1 -0
  74. package/dist/components/DataGrid/components/GridContainer/GridContainer.cjs +25 -0
  75. package/dist/components/DataGrid/components/GridContainer/GridContainer.cjs.map +1 -0
  76. package/dist/components/DataGrid/components/GridContainer/GridContainer.d.ts +49 -0
  77. package/dist/components/DataGrid/components/GridContainer/GridContainer.js +19 -0
  78. package/dist/components/DataGrid/components/GridContainer/GridContainer.js.map +1 -0
  79. package/dist/components/DataGrid/components/GridContainer/GridContainer.module.css.cjs +11 -0
  80. package/dist/components/DataGrid/components/GridContainer/GridContainer.module.css.cjs.map +1 -0
  81. package/dist/components/DataGrid/components/GridContainer/GridContainer.module.css.js +9 -0
  82. package/dist/components/DataGrid/components/GridContainer/GridContainer.module.css.js.map +1 -0
  83. package/dist/components/DataGrid/components/GridContainer/index.d.ts +1 -0
  84. package/dist/components/DataGrid/components/Header/Header.cjs +20 -0
  85. package/dist/components/DataGrid/components/Header/Header.cjs.map +1 -0
  86. package/dist/components/DataGrid/components/Header/Header.d.ts +13 -0
  87. package/dist/components/DataGrid/components/Header/Header.js +14 -0
  88. package/dist/components/DataGrid/components/Header/Header.js.map +1 -0
  89. package/dist/components/DataGrid/components/Header/HeaderCell/HeaderCell.cjs +40 -0
  90. package/dist/components/DataGrid/components/Header/HeaderCell/HeaderCell.cjs.map +1 -0
  91. package/dist/components/DataGrid/components/Header/HeaderCell/HeaderCell.d.ts +22 -0
  92. package/dist/components/DataGrid/components/Header/HeaderCell/HeaderCell.js +34 -0
  93. package/dist/components/DataGrid/components/Header/HeaderCell/HeaderCell.js.map +1 -0
  94. package/dist/components/DataGrid/components/Header/HeaderCell/HeaderCell.module.css.cjs +15 -0
  95. package/dist/components/DataGrid/components/Header/HeaderCell/HeaderCell.module.css.cjs.map +1 -0
  96. package/dist/components/DataGrid/components/Header/HeaderCell/HeaderCell.module.css.js +11 -0
  97. package/dist/components/DataGrid/components/Header/HeaderCell/HeaderCell.module.css.js.map +1 -0
  98. package/dist/components/DataGrid/components/Header/HeaderCell/index.d.ts +1 -0
  99. package/dist/components/DataGrid/components/Header/Resizer/Resizer.cjs +25 -0
  100. package/dist/components/DataGrid/components/Header/Resizer/Resizer.cjs.map +1 -0
  101. package/dist/components/DataGrid/components/Header/Resizer/Resizer.d.ts +21 -0
  102. package/dist/components/DataGrid/components/Header/Resizer/Resizer.js +19 -0
  103. package/dist/components/DataGrid/components/Header/Resizer/Resizer.js.map +1 -0
  104. package/dist/components/DataGrid/components/Header/Resizer/Resizer.module.css.cjs +11 -0
  105. package/dist/components/DataGrid/components/Header/Resizer/Resizer.module.css.cjs.map +1 -0
  106. package/dist/components/DataGrid/components/Header/Resizer/Resizer.module.css.js +9 -0
  107. package/dist/components/DataGrid/components/Header/Resizer/Resizer.module.css.js.map +1 -0
  108. package/dist/components/DataGrid/components/Header/Resizer/index.d.ts +1 -0
  109. package/dist/components/DataGrid/components/Header/index.d.ts +1 -0
  110. package/dist/components/DataGrid/components/index.d.ts +5 -0
  111. package/dist/components/DataGrid/constants.cjs +12 -0
  112. package/dist/components/DataGrid/constants.cjs.map +1 -0
  113. package/dist/components/DataGrid/constants.d.ts +4 -0
  114. package/dist/components/DataGrid/constants.js +7 -0
  115. package/dist/components/DataGrid/constants.js.map +1 -0
  116. package/dist/components/DataGrid/index.d.ts +1 -0
  117. package/dist/components/DataGrid/types/AriaRoles.d.ts +4 -0
  118. package/dist/components/DataGrid/types/ColumnDefinition.d.ts +75 -0
  119. package/dist/components/DataGrid/types/DataGridProps.d.ts +70 -0
  120. package/dist/components/DataGrid/types/declarations.d.ts +9 -0
  121. package/dist/components/DataGrid/types/enums.d.ts +2 -0
  122. package/dist/components/DataGrid/types/index.d.ts +4 -0
  123. package/dist/components/DataGrid/utils/ColumnMapper.cjs +95 -0
  124. package/dist/components/DataGrid/utils/ColumnMapper.cjs.map +1 -0
  125. package/dist/components/DataGrid/utils/ColumnMapper.d.ts +10 -0
  126. package/dist/components/DataGrid/utils/ColumnMapper.js +93 -0
  127. package/dist/components/DataGrid/utils/ColumnMapper.js.map +1 -0
  128. package/dist/components/DataGrid/utils/getAriaRoles.cjs +11 -0
  129. package/dist/components/DataGrid/utils/getAriaRoles.cjs.map +1 -0
  130. package/dist/components/DataGrid/utils/getAriaRoles.d.ts +2 -0
  131. package/dist/components/DataGrid/utils/getAriaRoles.js +9 -0
  132. package/dist/components/DataGrid/utils/getAriaRoles.js.map +1 -0
  133. package/dist/components/DataGrid/utils/index.d.ts +3 -0
  134. package/dist/components/DataGrid/utils/isLastColumn.cjs +11 -0
  135. package/dist/components/DataGrid/utils/isLastColumn.cjs.map +1 -0
  136. package/dist/components/DataGrid/utils/isLastColumn.d.ts +2 -0
  137. package/dist/components/DataGrid/utils/isLastColumn.js +9 -0
  138. package/dist/components/DataGrid/utils/isLastColumn.js.map +1 -0
  139. package/dist/components/DataTable/DataTable.cjs +5 -2
  140. package/dist/components/DataTable/DataTable.cjs.map +1 -1
  141. package/dist/components/DataTable/DataTable.js +5 -2
  142. package/dist/components/DataTable/DataTable.js.map +1 -1
  143. package/dist/components/DataTable/hooks/index.d.ts +0 -1
  144. package/dist/components/DataTable/index.d.ts +1 -1
  145. package/dist/components/FilterTag/FilterTag.cjs +1 -0
  146. package/dist/components/FilterTag/FilterTag.cjs.map +1 -1
  147. package/dist/components/FilterTag/FilterTag.js +1 -0
  148. package/dist/components/FilterTag/FilterTag.js.map +1 -1
  149. package/dist/components/Modal/Modal.cjs +26 -6
  150. package/dist/components/Modal/Modal.cjs.map +1 -1
  151. package/dist/components/Modal/Modal.js +27 -7
  152. package/dist/components/Modal/Modal.js.map +1 -1
  153. package/dist/components/Modal/components/Dialog/Dialog.cjs.map +1 -1
  154. package/dist/components/Modal/components/Dialog/Dialog.d.ts +2 -1
  155. package/dist/components/Modal/components/Dialog/Dialog.js.map +1 -1
  156. package/dist/components/Modal/components/Dialog/styled.cjs +34 -11
  157. package/dist/components/Modal/components/Dialog/styled.cjs.map +1 -1
  158. package/dist/components/Modal/components/Dialog/styled.d.ts +4 -22
  159. package/dist/components/Modal/components/Dialog/styled.js +34 -11
  160. package/dist/components/Modal/components/Dialog/styled.js.map +1 -1
  161. package/dist/components/Modal/components/Dialog/styles/baseStyles.cjs +13 -0
  162. package/dist/components/Modal/components/Dialog/styles/baseStyles.cjs.map +1 -0
  163. package/dist/components/Modal/components/Dialog/styles/baseStyles.d.ts +4 -0
  164. package/dist/components/Modal/components/Dialog/styles/baseStyles.js +11 -0
  165. package/dist/components/Modal/components/Dialog/styles/baseStyles.js.map +1 -0
  166. package/dist/components/Modal/components/Dialog/styles/modalTypeStyles.cjs +17 -0
  167. package/dist/components/Modal/components/Dialog/styles/modalTypeStyles.cjs.map +1 -0
  168. package/dist/components/Modal/components/Dialog/styles/modalTypeStyles.d.ts +6 -0
  169. package/dist/components/Modal/components/Dialog/styles/modalTypeStyles.js +13 -0
  170. package/dist/components/Modal/components/Dialog/styles/modalTypeStyles.js.map +1 -0
  171. package/dist/components/Modal/types.cjs +7 -0
  172. package/dist/components/Modal/types.cjs.map +1 -1
  173. package/dist/components/Modal/types.d.ts +56 -7
  174. package/dist/components/Modal/types.js +7 -1
  175. package/dist/components/Modal/types.js.map +1 -1
  176. package/dist/components/SelectDropdown/ListItem/ListItem.cjs +1 -0
  177. package/dist/components/SelectDropdown/ListItem/ListItem.cjs.map +1 -1
  178. package/dist/components/SelectDropdown/ListItem/ListItem.js +1 -0
  179. package/dist/components/SelectDropdown/ListItem/ListItem.js.map +1 -1
  180. package/dist/components/VideoModal/VideoModal.cjs +1 -0
  181. package/dist/components/VideoModal/VideoModal.cjs.map +1 -1
  182. package/dist/components/VideoModal/VideoModal.js +1 -0
  183. package/dist/components/VideoModal/VideoModal.js.map +1 -1
  184. package/dist/components/View/View.cjs +1 -0
  185. package/dist/components/View/View.cjs.map +1 -1
  186. package/dist/components/View/View.js +1 -0
  187. package/dist/components/View/View.js.map +1 -1
  188. package/dist/components/ViewTab/ViewTab.cjs +1 -0
  189. package/dist/components/ViewTab/ViewTab.cjs.map +1 -1
  190. package/dist/components/ViewTab/ViewTab.js +1 -0
  191. package/dist/components/ViewTab/ViewTab.js.map +1 -1
  192. package/dist/components/index.d.ts +2 -1
  193. package/dist/hooks/index.d.ts +3 -0
  194. package/dist/{components/DataTable/hooks → hooks}/useDragToScroll.cjs +10 -2
  195. package/dist/hooks/useDragToScroll.cjs.map +1 -0
  196. package/dist/hooks/useDragToScroll.d.ts +12 -0
  197. package/dist/{components/DataTable/hooks → hooks}/useDragToScroll.js +10 -2
  198. package/dist/hooks/useDragToScroll.js.map +1 -0
  199. package/dist/hooks/useIntersectionObserver.cjs +57 -0
  200. package/dist/hooks/useIntersectionObserver.cjs.map +1 -0
  201. package/dist/hooks/useIntersectionObserver.d.ts +15 -0
  202. package/dist/hooks/useIntersectionObserver.js +51 -0
  203. package/dist/hooks/useIntersectionObserver.js.map +1 -0
  204. package/dist/hooks/useResizeObserver.cjs +67 -0
  205. package/dist/hooks/useResizeObserver.cjs.map +1 -0
  206. package/dist/hooks/useResizeObserver.d.ts +18 -0
  207. package/dist/hooks/useResizeObserver.js +61 -0
  208. package/dist/hooks/useResizeObserver.js.map +1 -0
  209. package/dist/index.cjs +8 -2
  210. package/dist/index.cjs.map +1 -1
  211. package/dist/index.js +4 -1
  212. package/dist/index.js.map +1 -1
  213. package/dist/theme/index.d.ts +1 -0
  214. package/dist/theme/modules/layers.cjs +1 -0
  215. package/dist/theme/modules/layers.cjs.map +1 -1
  216. package/dist/theme/modules/layers.d.ts +1 -0
  217. package/dist/theme/modules/layers.js +1 -0
  218. package/dist/theme/modules/layers.js.map +1 -1
  219. package/package.json +2 -1
  220. package/dist/components/DataTable/hooks/useDragToScroll.cjs.map +0 -1
  221. package/dist/components/DataTable/hooks/useDragToScroll.d.ts +0 -2
  222. package/dist/components/DataTable/hooks/useDragToScroll.js.map +0 -1
@@ -1,18 +1,41 @@
1
1
  import styled from 'styled-components';
2
2
  import { motion } from 'framer-motion';
3
- import { getOpaqueHexColor } from '../../../../utils/color.js';
4
- import { Card } from '../../../Card/Card.js';
5
- import { theme } from '../../../../theme/index.js';
6
- import { heightMap, widthMap, fullScreenBreakpointMap } from './constants.js';
7
- import { MainSection } from '../styled.js';
3
+ import { modalStyles, leftDrawerStyles, rightDrawerStyles } from './styles/modalTypeStyles.js';
4
+ import { baseModalStyles } from './styles/baseStyles.js';
8
5
 
9
- const { breakpoints } = theme;
10
- const StyledDialog = styled(motion.dialog).attrs({
11
- initial: { opacity: 0, y: -50, bounce: 0 },
12
- exit: { opacity: 0, y: -50, bounce: 0 },
13
- animate: { opacity: 1, y: 0, bounce: 0 },
6
+ // Animation configurations
7
+ const animations = {
8
+ leftDrawer: {
9
+ initial: { opacity: 0, x: -300, bounce: 0 },
10
+ exit: { opacity: 0, x: -300, bounce: 0 },
11
+ animate: { opacity: 1, x: 0, bounce: 0 },
12
+ },
13
+ rightDrawer: {
14
+ initial: { opacity: 0, x: 300, bounce: 0 },
15
+ exit: { opacity: 0, x: 300, bounce: 0 },
16
+ animate: { opacity: 1, x: 0, bounce: 0 },
17
+ },
18
+ modal: {
19
+ initial: { opacity: 0, y: -50, bounce: 0 },
20
+ exit: { opacity: 0, y: -50, bounce: 0 },
21
+ animate: { opacity: 1, y: 0, bounce: 0 },
22
+ },
23
+ };
24
+ const stylesByType = {
25
+ modal: modalStyles,
26
+ leftDrawer: leftDrawerStyles,
27
+ rightDrawer: rightDrawerStyles,
28
+ };
29
+ const StyledDialog = styled(motion.dialog).attrs(({ displayMode }) => ({
30
+ ...animations[displayMode],
14
31
  transition: { type: 'tween', duration: 0.25 },
15
- }).withConfig({ displayName: "vui--StyledDialog", componentId: "vui--1ohvs0u" }) `padding:0;border:none;border-radius:${theme.sizes.sm};box-shadow:${theme.shadows.lg};min-width:464px;&::backdrop{animation:fadeIn 0.25s ease forwards;}& > ${Card.Surface}{display:flex;flex-direction:column;${({ variant }) => `max-height: ${heightMap[variant]};`} ${MainSection}{padding-bottom:${theme.sizes.md};}${Card.Footer}{margin-top:0;}}@keyframes fadeIn{from{opacity:0;}to{opacity:1;}}@media (min-width: calc(${breakpoints.mobile} + 1px))and (max-width: ${breakpoints.tablet}){max-width:${({ variant }) => widthMap[breakpoints.tablet][variant]};}@media (min-width: ${breakpoints.tablet})and (max-width: ${breakpoints.lgTablet}){max-width:${({ variant }) => widthMap[breakpoints.lgTablet][variant]};}@media (min-width: ${breakpoints.lgTablet})and (max-width: ${breakpoints.desktop}){max-width:${({ variant }) => widthMap[breakpoints.desktop][variant]};}@media (min-width: ${breakpoints.desktop}){max-width:${({ variant }) => widthMap[breakpoints.lgDesktop][variant]};}@media (max-width: ${({ variant }) => fullScreenBreakpointMap[variant]}){margin:0;width:100%;max-width:100vw;max-height:100vh;&,& > ${Card.Surface}{border-radius:0;height:100%;width:100%;max-height:unset;}}&::backdrop{background-color:${getOpaqueHexColor(theme.colors.neutral.ink.base, 0.5)};}&:not([open]){display:block;position:fixed;top:0;left:0;right:0;bottom:0;transform:translate(-50%, -50%);}`;
32
+ })).withConfig({ displayName: "vui--StyledDialog", componentId: "vui--1ohvs0u" }) `${baseModalStyles} ${({ displayMode }) => stylesByType[displayMode]} ${({ appearance }) => appearance === 'secondary' &&
33
+ `
34
+ &::backdrop {
35
+ animation: none;
36
+ opacity: 0;
37
+ }
38
+ `}`;
16
39
 
17
40
  export { StyledDialog };
18
41
  //# sourceMappingURL=styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"styled.js","sources":["../../../../../src/components/Modal/components/Dialog/styled.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { motion } from 'framer-motion';\nimport { getOpaqueHexColor } from '../../../../utils/color';\nimport { Card } from '../../../Card';\nimport { theme } from '../../../../theme';\nimport { ModalVariants } from '../../types';\nimport { fullScreenBreakpointMap, heightMap, widthMap } from './constants';\nimport { MainSection } from '../styled';\n\nconst { breakpoints } = theme;\n\nexport const StyledDialog = styled(motion.dialog).attrs({\n initial: { opacity: 0, y: -50, bounce: 0 },\n exit: { opacity: 0, y: -50, bounce: 0 },\n animate: { opacity: 1, y: 0, bounce: 0 },\n transition: { type: 'tween', duration: 0.25 },\n})<{ variant: ModalVariants }>`\n padding: 0;\n border: none;\n border-radius: ${theme.sizes.sm};\n box-shadow: ${theme.shadows.lg};\n\n min-width: 464px;\n\n &::backdrop {\n animation: fadeIn 0.25s ease forwards;\n }\n\n & > ${Card.Surface} {\n display: flex;\n flex-direction: column;\n\n ${({ variant }) => `max-height: ${heightMap[variant]};`}\n\n ${MainSection} {\n padding-bottom: ${theme.sizes.md};\n }\n\n ${Card.Footer} {\n margin-top: 0;\n }\n }\n\n @keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n\n // ** Responsive Design ** //\n\n // Tablet\n @media (min-width: calc(${breakpoints.mobile} + 1px)) and (max-width: ${breakpoints.tablet}) {\n max-width: ${({ variant }) => widthMap[breakpoints.tablet][variant]};\n }\n\n // Lg Tablet\n @media (min-width: ${breakpoints.tablet}) and (max-width: ${breakpoints.lgTablet}) {\n max-width: ${({ variant }) => widthMap[breakpoints.lgTablet][variant]};\n }\n\n // Desktop\n @media (min-width: ${breakpoints.lgTablet}) and (max-width: ${breakpoints.desktop}) {\n max-width: ${({ variant }) => widthMap[breakpoints.desktop][variant]};\n }\n\n // Lg Desktop\n @media (min-width: ${breakpoints.desktop}) {\n max-width: ${({ variant }) => widthMap[breakpoints.lgDesktop][variant]};\n }\n\n // Full Screen Mode\n @media (max-width: ${({ variant }) => fullScreenBreakpointMap[variant]}) {\n margin: 0;\n width: 100%;\n max-width: 100vw;\n max-height: 100vh;\n\n &,\n & > ${Card.Surface} {\n border-radius: 0;\n height: 100%;\n width: 100%;\n max-height: unset;\n }\n }\n\n &::backdrop {\n background-color: ${getOpaqueHexColor(theme.colors.neutral.ink.base, 0.5)};\n }\n\n &:not([open]) {\n display: block;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n transform: translate(-50%, -50%);\n }\n`;\n"],"names":[],"mappings":";;;;;;;;AASA,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK;AAEtB,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC;AACtD,IAAA,OAAO,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,EAAE;AAC1C,IAAA,IAA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InD,CAAC,EAAE,OAAO,EAAE,KAAK,uBAAuB,CAAC,OAAO,CAAC,CAO9D,6DAAA,EAAA,IAAI,CAAC,OAAO,CAAA,wFAAA,EASE,iBAAiB,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC;;;;"}
1
+ {"version":3,"file":"styled.js","sources":["../../../../../src/components/Modal/components/Dialog/styled.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { motion } from 'framer-motion';\nimport { ModalAppearance, ModalTypes, ModalVariants } from '../../types';\nimport { leftDrawerStyles, modalStyles, rightDrawerStyles } from './styles/modalTypeStyles';\nimport { baseModalStyles } from './styles/baseStyles';\n\n// Animation configurations\nconst animations = {\n leftDrawer: {\n initial: { opacity: 0, x: -300, bounce: 0 },\n exit: { opacity: 0, x: -300, bounce: 0 },\n animate: { opacity: 1, x: 0, bounce: 0 },\n },\n rightDrawer: {\n initial: { opacity: 0, x: 300, bounce: 0 },\n exit: { opacity: 0, x: 300, bounce: 0 },\n animate: { opacity: 1, x: 0, bounce: 0 },\n },\n modal: {\n initial: { opacity: 0, y: -50, bounce: 0 },\n exit: { opacity: 0, y: -50, bounce: 0 },\n animate: { opacity: 1, y: 0, bounce: 0 },\n },\n};\n\nconst stylesByType = {\n modal: modalStyles,\n leftDrawer: leftDrawerStyles,\n rightDrawer: rightDrawerStyles,\n};\n\nexport const StyledDialog = styled(motion.dialog).attrs<{ displayMode: ModalTypes }>(\n ({ displayMode }) => ({\n ...animations[displayMode],\n transition: { type: 'tween', duration: 0.25 },\n }),\n)<{ variant: ModalVariants; displayMode: ModalTypes; appearance?: ModalAppearance }>`\n ${baseModalStyles}\n ${({ displayMode }) => stylesByType[displayMode]}\n\n ${({ appearance }) =>\n appearance === 'secondary' &&\n `\n &::backdrop {\n animation: none;\n opacity: 0;\n }\n `}\n`;\n"],"names":[],"mappings":";;;;;AAMA;AACA,MAAM,UAAU,GAAG;AACjB,IAAA,UAAU,EA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,MAAM;IACpB,GAAG,UAAU,CAAC,WAAW,CAAC;IAC1B,UAAU,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE;CAC9C,CAAC,CACH,CACG,UAAA,CAAA,EAAA,WAAA,EAAA,mBAAA,EAAA,WAAA,EAAA,cAAA,EAAA,CAAA,CAAA,CAAA,EAAA,eAAe,CACf,CAAA,EAAA,CAAC,EAAE,WAAW,EAAE,KAAK,YAAY,CAAC,WAAW,CAAC,CAE9C,CAAA,EAAA,CAAC,EAAE,UAAU,EAAE,KACf,UAAU,KAAK,WAAW;AAC1B,IAAA;;;;;AAKD,EAAA,CAAA,CAAA;;;;"}
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ var styled = require('styled-components');
4
+ var color = require('../../../../../utils/color.cjs');
5
+ var Card = require('../../../../Card/Card.cjs');
6
+ var index = require('../../../../../theme/index.cjs');
7
+ var styled$1 = require('../../styled.cjs');
8
+ var constants = require('../constants.cjs');
9
+
10
+ const baseModalStyles = styled.css `padding:0;border:none;border-radius:${index.theme.sizes.sm};box-shadow:${index.theme.shadows.lg};z-index:${index.theme.layers.modal};&::backdrop{animation:fadeIn 0.25s ease forwards;background-color:${color.getOpaqueHexColor(index.theme.colors.neutral.ink.base, 0.5)};width:100%;height:100%;}@keyframes fadeIn{from{opacity:0;}to{opacity:1;}}& > ${Card.Card.Surface}{display:flex;flex-direction:column;${styled$1.MainSection}{padding-bottom:${index.theme.sizes.md};}${Card.Card.Footer}{margin-top:0;}}@media (max-width: ${({ variant }) => constants.fullScreenBreakpointMap[variant]}){margin:0;width:100%;max-width:100vw;max-height:100vh;&,& > ${Card.Card.Surface}{border-radius:0;height:100%;width:100%;max-height:unset;}}`;
11
+
12
+ exports.baseModalStyles = baseModalStyles;
13
+ //# sourceMappingURL=baseStyles.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"baseStyles.cjs","sources":["../../../../../../src/components/Modal/components/Dialog/styles/baseStyles.ts"],"sourcesContent":["import { css } from 'styled-components';\nimport { ModalVariants } from 'src/components/Modal/types';\nimport { getOpaqueHexColor } from '../../../../../utils/color';\nimport { Card } from '../../../../Card';\nimport { theme } from '../../../../../theme';\nimport { MainSection } from '../../styled';\nimport { fullScreenBreakpointMap } from '../constants';\n\nexport const baseModalStyles = css<{ variant: ModalVariants }>`\n padding: 0;\n border: none;\n border-radius: ${theme.sizes.sm};\n box-shadow: ${theme.shadows.lg};\n z-index: ${theme.layers.modal};\n\n &::backdrop {\n animation: fadeIn 0.25s ease forwards;\n background-color: ${getOpaqueHexColor(theme.colors.neutral.ink.base, 0.5)};\n width: 100%;\n height: 100%;\n }\n\n @keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n\n & > ${Card.Surface} {\n display: flex;\n flex-direction: column;\n\n ${MainSection} {\n padding-bottom: ${theme.sizes.md};\n }\n\n ${Card.Footer} {\n margin-top: 0;\n }\n }\n\n @media (max-width: ${({ variant }) => fullScreenBreakpointMap[variant]}) {\n margin: 0;\n width: 100%;\n max-width: 100vw;\n max-height: 100vh;\n\n &,\n & > ${Card.Surface} {\n border-radius: 0;\n height: 100%;\n width: 100%;\n max-height: unset;\n }\n }\n`;\n"],"names":["css","theme","getOpaqueHexColor","Card","MainSection","fullScreenBreakpointMap"],"mappings":";;;;;;;;;AAQO,MAAM,eAAe,GAAGA,UAAG,CAGf,CAAA,oCAAA,EAAAC,WAAK,CAAC,KAAK,CAAC,EAAE,CACjB,YAAA,EAAAA,WAAK,CAAC,OAAO,CAAC,EAAE,CAAA,SAAA,EACnBA,WAAK,CAAC,MAAM,CAAC,KAAK,CAIP,mEAAA,EAAAC,uBAAiB,CAACD,WAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA,8EAAA,EAcrEE,SAAI,CAAC,OAAO,CAId,oCAAA,EAAAC,oBAAW,CACO,gBAAA,EAAAH,WAAK,CAAC,KAAK,CAAC,EAAE,CAAA,EAAA,EAGhCE,SAAI,CAAC,MAAM,CAKM,mCAAA,EAAA,CAAC,EAAE,OAAO,EAAE,KAAKE,iCAAuB,CAAC,OAAO,CAAC,CAO9D,6DAAA,EAAAF,SAAI,CAAC,OAAO;;;;"}
@@ -0,0 +1,4 @@
1
+ import { ModalVariants } from 'src/components/Modal/types';
2
+ export declare const baseModalStyles: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<{
3
+ variant: ModalVariants;
4
+ }, any>>;
@@ -0,0 +1,11 @@
1
+ import { css } from 'styled-components';
2
+ import { getOpaqueHexColor } from '../../../../../utils/color.js';
3
+ import { Card } from '../../../../Card/Card.js';
4
+ import { theme } from '../../../../../theme/index.js';
5
+ import { MainSection } from '../../styled.js';
6
+ import { fullScreenBreakpointMap } from '../constants.js';
7
+
8
+ const baseModalStyles = css `padding:0;border:none;border-radius:${theme.sizes.sm};box-shadow:${theme.shadows.lg};z-index:${theme.layers.modal};&::backdrop{animation:fadeIn 0.25s ease forwards;background-color:${getOpaqueHexColor(theme.colors.neutral.ink.base, 0.5)};width:100%;height:100%;}@keyframes fadeIn{from{opacity:0;}to{opacity:1;}}& > ${Card.Surface}{display:flex;flex-direction:column;${MainSection}{padding-bottom:${theme.sizes.md};}${Card.Footer}{margin-top:0;}}@media (max-width: ${({ variant }) => fullScreenBreakpointMap[variant]}){margin:0;width:100%;max-width:100vw;max-height:100vh;&,& > ${Card.Surface}{border-radius:0;height:100%;width:100%;max-height:unset;}}`;
9
+
10
+ export { baseModalStyles };
11
+ //# sourceMappingURL=baseStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"baseStyles.js","sources":["../../../../../../src/components/Modal/components/Dialog/styles/baseStyles.ts"],"sourcesContent":["import { css } from 'styled-components';\nimport { ModalVariants } from 'src/components/Modal/types';\nimport { getOpaqueHexColor } from '../../../../../utils/color';\nimport { Card } from '../../../../Card';\nimport { theme } from '../../../../../theme';\nimport { MainSection } from '../../styled';\nimport { fullScreenBreakpointMap } from '../constants';\n\nexport const baseModalStyles = css<{ variant: ModalVariants }>`\n padding: 0;\n border: none;\n border-radius: ${theme.sizes.sm};\n box-shadow: ${theme.shadows.lg};\n z-index: ${theme.layers.modal};\n\n &::backdrop {\n animation: fadeIn 0.25s ease forwards;\n background-color: ${getOpaqueHexColor(theme.colors.neutral.ink.base, 0.5)};\n width: 100%;\n height: 100%;\n }\n\n @keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n\n & > ${Card.Surface} {\n display: flex;\n flex-direction: column;\n\n ${MainSection} {\n padding-bottom: ${theme.sizes.md};\n }\n\n ${Card.Footer} {\n margin-top: 0;\n }\n }\n\n @media (max-width: ${({ variant }) => fullScreenBreakpointMap[variant]}) {\n margin: 0;\n width: 100%;\n max-width: 100vw;\n max-height: 100vh;\n\n &,\n & > ${Card.Surface} {\n border-radius: 0;\n height: 100%;\n width: 100%;\n max-height: unset;\n }\n }\n`;\n"],"names":[],"mappings":";;;;;;;AAQO,MAAM,eAAe,GAAG,GAAG,CAGf,CAAA,oCAAA,EAAA,KAAK,CAAC,KAAK,CAAC,EAAE,CACjB,YAAA,EAAA,KAAK,CAAC,OAAO,CAAC,EAAE,CAAA,SAAA,EACnB,KAAK,CAAC,MAAM,CAAC,KAAK,CAIP,mEAAA,EAAA,iBAAiB,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA,8EAAA,EAcrE,IAAI,CAAC,OAAO,CAId,oCAAA,EAAA,WAAW,CACO,gBAAA,EAAA,KAAK,CAAC,KAAK,CAAC,EAAE,CAAA,EAAA,EAGhC,IAAI,CAAC,MAAM,CAKM,mCAAA,EAAA,CAAC,EAAE,OAAO,EAAE,KAAK,uBAAuB,CAAC,OAAO,CAAC,CAO9D,6DAAA,EAAA,IAAI,CAAC,OAAO;;;;"}
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+
3
+ var styled = require('styled-components');
4
+ var Card = require('../../../../Card/Card.cjs');
5
+ var index = require('../../../../../theme/index.cjs');
6
+ var constants = require('../constants.cjs');
7
+
8
+ const { breakpoints } = index.theme;
9
+ const modalStyles = styled.css `min-width:464px;& > ${Card.Card.Surface}{max-height:${({ variant }) => constants.heightMap[variant]};}&:not([open]){display:block;position:fixed;inset:0;transform:translate(-50%, -50%);}@media (min-width: calc(${breakpoints.mobile} + 1px))and (max-width: ${breakpoints.tablet}){max-width:${({ variant }) => constants.widthMap[breakpoints.tablet][variant]};}@media (min-width: ${breakpoints.tablet})and (max-width: ${breakpoints.lgTablet}){max-width:${({ variant }) => constants.widthMap[breakpoints.lgTablet][variant]};}@media (min-width: ${breakpoints.lgTablet})and (max-width: ${breakpoints.desktop}){max-width:${({ variant }) => constants.widthMap[breakpoints.desktop][variant]};}@media (min-width: ${breakpoints.desktop}){max-width:${({ variant }) => constants.widthMap[breakpoints.lgDesktop][variant]};}`;
10
+ const sideDrawerBaseStyles = styled.css `height:100%;max-height:100%;min-width:320px;width:400px;margin:0;position:fixed;transform:none;border-radius:0;overflow:visible;& > ${Card.Card.Surface}{border-radius:0;height:100%;}&:not([open]){display:block;}`;
11
+ const leftDrawerStyles = styled.css `${sideDrawerBaseStyles} inset:0 auto 0 0;`;
12
+ const rightDrawerStyles = styled.css `${sideDrawerBaseStyles} inset:0 0 0 auto;`;
13
+
14
+ exports.leftDrawerStyles = leftDrawerStyles;
15
+ exports.modalStyles = modalStyles;
16
+ exports.rightDrawerStyles = rightDrawerStyles;
17
+ //# sourceMappingURL=modalTypeStyles.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modalTypeStyles.cjs","sources":["../../../../../../src/components/Modal/components/Dialog/styles/modalTypeStyles.ts"],"sourcesContent":["import { ModalVariants } from 'src/components/Modal/types';\nimport { css } from 'styled-components';\nimport { Card } from '../../../../Card';\nimport { theme } from '../../../../../theme';\nimport { heightMap, widthMap } from '../constants';\n\nconst { breakpoints } = theme;\n\nexport const modalStyles = css<{ variant: ModalVariants }>`\n min-width: 464px;\n\n & > ${Card.Surface} {\n max-height: ${({ variant }) => heightMap[variant]};\n }\n\n &:not([open]) {\n display: block;\n position: fixed;\n inset: 0;\n transform: translate(-50%, -50%);\n }\n\n // ** Responsive Design ** //\n\n // Tablet\n @media (min-width: calc(${breakpoints.mobile} + 1px)) and (max-width: ${breakpoints.tablet}) {\n max-width: ${({ variant }) => widthMap[breakpoints.tablet][variant]};\n }\n\n // Lg Tablet\n @media (min-width: ${breakpoints.tablet}) and (max-width: ${breakpoints.lgTablet}) {\n max-width: ${({ variant }) => widthMap[breakpoints.lgTablet][variant]};\n }\n\n // Desktop\n @media (min-width: ${breakpoints.lgTablet}) and (max-width: ${breakpoints.desktop}) {\n max-width: ${({ variant }) => widthMap[breakpoints.desktop][variant]};\n }\n\n // Lg Desktop\n @media (min-width: ${breakpoints.desktop}) {\n max-width: ${({ variant }) => widthMap[breakpoints.lgDesktop][variant]};\n }\n`;\n\nconst sideDrawerBaseStyles = css`\n height: 100%;\n max-height: 100%;\n min-width: 320px;\n width: 400px;\n margin: 0;\n position: fixed;\n transform: none;\n border-radius: 0;\n overflow: visible;\n\n & > ${Card.Surface} {\n border-radius: 0;\n height: 100%;\n }\n\n &:not([open]) {\n display: block;\n }\n`;\n\nexport const leftDrawerStyles = css`\n ${sideDrawerBaseStyles}\n inset: 0 auto 0 0;\n`;\n\nexport const rightDrawerStyles = css`\n ${sideDrawerBaseStyles}\n inset: 0 0 0 auto;\n`;\n"],"names":["theme","css","Card","heightMap","widthMap"],"mappings":";;;;;;;AAMA,MAAM,EAAE,WAAW,EAAE,GAAGA,WAAK;AAEhB,MAAA,WAAW,GAAGC,UAAG,CAGtB,CAAA,oBAAA,EAAAC,SAAI,CAAC,OAAO,CACF,YAAA,EAAA,CAAC,EAAE,OAAO,EAAE,KAAKC,mBAAS,CAAC,OAAO,CAAC,CAAA,8GAAA,EAazB,WAAW,CAAC,MAAM,CAAA,wBAAA,EAA4B,WAAW,CAAC,MAAM,CAC3E,YAAA,EAAA,CAAC,EAAE,OAAO,EAAE,KAAKC,kBAAQ,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAA,qBAAA,EAIhD,WAAW,CAAC,MAAM,CAAA,iBAAA,EAAqB,WAAW,CAAC,QAAQ,CAAA,YAAA,EACjE,CAAC,EAAE,OAAO,EAAE,KAAKA,kBAAQ,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAA,qBAAA,EAIlD,WAAW,CAAC,QAAQ,CAAqB,iBAAA,EAAA,WAAW,CAAC,OAAO,CAClE,YAAA,EAAA,CAAC,EAAE,OAAO,EAAE,KAAKA,kBAAQ,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAIjD,qBAAA,EAAA,WAAW,CAAC,OAAO,CACzB,YAAA,EAAA,CAAC,EAAE,OAAO,EAAE,KAAKA,kBAAQ,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAA,EAAA;AAI1E,MAAM,oBAAoB,GAAGH,UAAG,CAAA,CAAA,oIAAA,EAWxBC,SAAI,CAAC,OAAO,6DAQnB;MAEY,gBAAgB,GAAGD,UAAG,CAC/B,CAAA,EAAA,oBAAoB;MAIX,iBAAiB,GAAGA,UAAG,CAChC,CAAA,EAAA,oBAAoB;;;;;;"}
@@ -0,0 +1,6 @@
1
+ import { ModalVariants } from 'src/components/Modal/types';
2
+ export declare const modalStyles: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<{
3
+ variant: ModalVariants;
4
+ }, any>>;
5
+ export declare const leftDrawerStyles: import("styled-components").FlattenSimpleInterpolation;
6
+ export declare const rightDrawerStyles: import("styled-components").FlattenSimpleInterpolation;
@@ -0,0 +1,13 @@
1
+ import { css } from 'styled-components';
2
+ import { Card } from '../../../../Card/Card.js';
3
+ import { theme } from '../../../../../theme/index.js';
4
+ import { heightMap, widthMap } from '../constants.js';
5
+
6
+ const { breakpoints } = theme;
7
+ const modalStyles = css `min-width:464px;& > ${Card.Surface}{max-height:${({ variant }) => heightMap[variant]};}&:not([open]){display:block;position:fixed;inset:0;transform:translate(-50%, -50%);}@media (min-width: calc(${breakpoints.mobile} + 1px))and (max-width: ${breakpoints.tablet}){max-width:${({ variant }) => widthMap[breakpoints.tablet][variant]};}@media (min-width: ${breakpoints.tablet})and (max-width: ${breakpoints.lgTablet}){max-width:${({ variant }) => widthMap[breakpoints.lgTablet][variant]};}@media (min-width: ${breakpoints.lgTablet})and (max-width: ${breakpoints.desktop}){max-width:${({ variant }) => widthMap[breakpoints.desktop][variant]};}@media (min-width: ${breakpoints.desktop}){max-width:${({ variant }) => widthMap[breakpoints.lgDesktop][variant]};}`;
8
+ const sideDrawerBaseStyles = css `height:100%;max-height:100%;min-width:320px;width:400px;margin:0;position:fixed;transform:none;border-radius:0;overflow:visible;& > ${Card.Surface}{border-radius:0;height:100%;}&:not([open]){display:block;}`;
9
+ const leftDrawerStyles = css `${sideDrawerBaseStyles} inset:0 auto 0 0;`;
10
+ const rightDrawerStyles = css `${sideDrawerBaseStyles} inset:0 0 0 auto;`;
11
+
12
+ export { leftDrawerStyles, modalStyles, rightDrawerStyles };
13
+ //# sourceMappingURL=modalTypeStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modalTypeStyles.js","sources":["../../../../../../src/components/Modal/components/Dialog/styles/modalTypeStyles.ts"],"sourcesContent":["import { ModalVariants } from 'src/components/Modal/types';\nimport { css } from 'styled-components';\nimport { Card } from '../../../../Card';\nimport { theme } from '../../../../../theme';\nimport { heightMap, widthMap } from '../constants';\n\nconst { breakpoints } = theme;\n\nexport const modalStyles = css<{ variant: ModalVariants }>`\n min-width: 464px;\n\n & > ${Card.Surface} {\n max-height: ${({ variant }) => heightMap[variant]};\n }\n\n &:not([open]) {\n display: block;\n position: fixed;\n inset: 0;\n transform: translate(-50%, -50%);\n }\n\n // ** Responsive Design ** //\n\n // Tablet\n @media (min-width: calc(${breakpoints.mobile} + 1px)) and (max-width: ${breakpoints.tablet}) {\n max-width: ${({ variant }) => widthMap[breakpoints.tablet][variant]};\n }\n\n // Lg Tablet\n @media (min-width: ${breakpoints.tablet}) and (max-width: ${breakpoints.lgTablet}) {\n max-width: ${({ variant }) => widthMap[breakpoints.lgTablet][variant]};\n }\n\n // Desktop\n @media (min-width: ${breakpoints.lgTablet}) and (max-width: ${breakpoints.desktop}) {\n max-width: ${({ variant }) => widthMap[breakpoints.desktop][variant]};\n }\n\n // Lg Desktop\n @media (min-width: ${breakpoints.desktop}) {\n max-width: ${({ variant }) => widthMap[breakpoints.lgDesktop][variant]};\n }\n`;\n\nconst sideDrawerBaseStyles = css`\n height: 100%;\n max-height: 100%;\n min-width: 320px;\n width: 400px;\n margin: 0;\n position: fixed;\n transform: none;\n border-radius: 0;\n overflow: visible;\n\n & > ${Card.Surface} {\n border-radius: 0;\n height: 100%;\n }\n\n &:not([open]) {\n display: block;\n }\n`;\n\nexport const leftDrawerStyles = css`\n ${sideDrawerBaseStyles}\n inset: 0 auto 0 0;\n`;\n\nexport const rightDrawerStyles = css`\n ${sideDrawerBaseStyles}\n inset: 0 0 0 auto;\n`;\n"],"names":[],"mappings":";;;;;AAMA,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK;AAEhB,MAAA,WAAW,GAAG,GAAG,CAGtB,CAAA,oBAAA,EAAA,IAAI,CAAC,OAAO,CACF,YAAA,EAAA,CAAC,EAAE,OAAO,EAAE,KAAK,SAAS,CAAC,OAAO,CAAC,CAAA,8GAAA,EAazB,WAAW,CAAC,MAAM,CAAA,wBAAA,EAA4B,WAAW,CAAC,MAAM,CAC3E,YAAA,EAAA,CAAC,EAAE,OAAO,EAAE,KAAK,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAA,qBAAA,EAIhD,WAAW,CAAC,MAAM,CAAA,iBAAA,EAAqB,WAAW,CAAC,QAAQ,CAAA,YAAA,EACjE,CAAC,EAAE,OAAO,EAAE,KAAK,QAAQ,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAA,qBAAA,EAIlD,WAAW,CAAC,QAAQ,CAAqB,iBAAA,EAAA,WAAW,CAAC,OAAO,CAClE,YAAA,EAAA,CAAC,EAAE,OAAO,EAAE,KAAK,QAAQ,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAIjD,qBAAA,EAAA,WAAW,CAAC,OAAO,CACzB,YAAA,EAAA,CAAC,EAAE,OAAO,EAAE,KAAK,QAAQ,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAA,EAAA;AAI1E,MAAM,oBAAoB,GAAG,GAAG,CAAA,CAAA,oIAAA,EAWxB,IAAI,CAAC,OAAO,6DAQnB;MAEY,gBAAgB,GAAG,GAAG,CAC/B,CAAA,EAAA,oBAAoB;MAIX,iBAAiB,GAAG,GAAG,CAChC,CAAA,EAAA,oBAAoB;;;;"}
@@ -12,7 +12,14 @@ const hasHeaderSlot = (props) => {
12
12
  const hasFooterSlot = (props) => {
13
13
  return !!props.footerSlot;
14
14
  };
15
+ /**
16
+ * Type guard to check if the modal is a sidedraw
17
+ */
18
+ const isSideDraw = (props) => {
19
+ return props.displayMode === 'leftDrawer' || props.displayMode === 'rightDrawer';
20
+ };
15
21
 
16
22
  exports.hasFooterSlot = hasFooterSlot;
17
23
  exports.hasHeaderSlot = hasHeaderSlot;
24
+ exports.isSideDraw = isSideDraw;
18
25
  //# sourceMappingURL=types.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.cjs","sources":["../../../src/components/Modal/types.ts"],"sourcesContent":["import { ButtonProps } from '../Button/types';\n\nexport type ModalVariants = 'xs' | 'sm' | 'base' | 'lg';\n\n// Base Modal props shared by all variants.\ntype BaseModalProps = {\n shouldShow: boolean;\n showHeaderCloseButton?: boolean;\n preventClose?: boolean;\n fullBleed?: boolean;\n variant?: ModalVariants;\n onClose: () => void;\n children: React.ReactNode;\n className?: string;\n};\n\n// Optional slot types.\n\ntype WithHeaderSlot = {\n headerSlot: React.ReactNode;\n};\n\ntype WithFooterSlot = {\n footerSlot: React.ReactNode;\n};\n\n// Default header and footer options.\n\ntype DefaultHeaderOptions = {\n headerTitle: string;\n headerSubtitle?: string;\n};\n\nexport type Action = { label: string } & ButtonProps;\ntype DefaultFooterOptions = {\n leftActions?: Action[];\n rightActions?: Action[];\n};\n\n// Either we have a header slot or default header options, same for footer.\ntype HeaderOptions = WithHeaderSlot | DefaultHeaderOptions;\ntype FooterOptions = WithFooterSlot | DefaultFooterOptions;\n\n// Modal props are shared props + the header and footer options (potentially with slots.)\nexport type ModalProps = BaseModalProps & HeaderOptions & FooterOptions;\n\n/**\n * Type guard to check if a header slot has been passed to the component.\n */\nexport const hasHeaderSlot = (\n props: ModalProps,\n): props is BaseModalProps & WithHeaderSlot & FooterOptions => {\n return !!(props as WithHeaderSlot).headerSlot;\n};\n\n/**\n * Type guard to check if a footer slot has been passed to the component.\n */\nexport const hasFooterSlot = (\n props: ModalProps,\n): props is BaseModalProps & HeaderOptions & WithFooterSlot => {\n return !!(props as WithFooterSlot).footerSlot;\n};\n"],"names":[],"mappings":";;AA8CA;;AAEG;AACU,MAAA,aAAa,GAAG,CAC3B,KAAiB,KAC2C;AAC5D,IAAA,OAAO,CAAC,CAAE,KAAwB,CAAC,UAAU;AAC/C;AAEA;;AAEG;AACU,MAAA,aAAa,GAAG,CAC3B,KAAiB,KAC2C;AAC5D,IAAA,OAAO,CAAC,CAAE,KAAwB,CAAC,UAAU;AAC/C;;;;;"}
1
+ {"version":3,"file":"types.cjs","sources":["../../../src/components/Modal/types.ts"],"sourcesContent":["import { CSSProperties, HTMLAttributes } from 'react';\nimport { ButtonProps } from '../Button/types';\n\nexport type ModalVariants = 'xs' | 'sm' | 'base' | 'lg';\nexport type ModalTypes = 'modal' | 'leftDrawer' | 'rightDrawer';\nexport type ModalAppearance = 'primary' | 'secondary';\n\n// Base Modal props shared by all variants.\ntype BaseModalProps = {\n shouldShow: boolean;\n showHeaderCloseButton?: boolean;\n preventClose?: boolean;\n fullBleed?: boolean;\n variant?: ModalVariants;\n displayMode?: ModalTypes;\n style?: CSSProperties;\n onClose: () => void | boolean;\n children?: React.ReactNode;\n className?: string;\n} & Omit<HTMLAttributes<HTMLDialogElement>, 'onClose'>;\n\n// Optional slot types.\n\ntype WithHeaderSlot = {\n headerSlot: React.ReactNode;\n};\n\ntype WithFooterSlot = {\n footerSlot: React.ReactNode;\n};\n\ntype SideDrawType = {\n displayMode: 'leftDrawer' | 'rightDrawer';\n appearance?: ModalAppearance; // Required for sidedraw\n};\n\n// Default header and footer options.\n\ntype DefaultHeaderOptions = {\n headerTitle: string;\n headerSubtitle?: string;\n};\n\ntype ModalType = {\n displayMode?: 'modal';\n};\n\nexport type Action = { label: string } & ButtonProps;\ntype DefaultFooterOptions = {\n leftActions?: Action[];\n rightActions?: Action[];\n};\n\n// Either we have a header slot or default header options, same for footer.\ntype HeaderOptions = WithHeaderSlot | DefaultHeaderOptions;\ntype FooterOptions = WithFooterSlot | DefaultFooterOptions;\ntype TypeProps = ModalType | SideDrawType;\n\n// Modal props are shared props + the header and footer options (potentially with slots.)\nexport type ModalProps = BaseModalProps & HeaderOptions & FooterOptions & TypeProps;\n\n/**\n * Type guard to check if a header slot has been passed to the component.\n */\nexport const hasHeaderSlot = (\n props: ModalProps,\n): props is BaseModalProps & WithHeaderSlot & FooterOptions & TypeProps => {\n return !!(props as WithHeaderSlot).headerSlot;\n};\n\n/**\n * Type guard to check if a footer slot has been passed to the component.\n */\nexport const hasFooterSlot = (\n props: ModalProps,\n): props is BaseModalProps & HeaderOptions & WithFooterSlot & TypeProps => {\n return !!(props as WithFooterSlot).footerSlot;\n};\n\n/**\n * Type guard to check if the modal is a sidedraw\n */\nexport const isSideDraw = (\n props: ModalProps,\n): props is BaseModalProps & HeaderOptions & FooterOptions & SideDrawType => {\n return props.displayMode === 'leftDrawer' || props.displayMode === 'rightDrawer';\n};\n"],"names":[],"mappings":";;AA6DA;;AAEG;AACU,MAAA,aAAa,GAAG,CAC3B,KAAiB,KACuD;AACxE,IAAA,OAAO,CAAC,CAAE,KAAwB,CAAC,UAAU;AAC/C;AAEA;;AAEG;AACU,MAAA,aAAa,GAAG,CAC3B,KAAiB,KACuD;AACxE,IAAA,OAAO,CAAC,CAAE,KAAwB,CAAC,UAAU;AAC/C;AAEA;;AAEG;AACU,MAAA,UAAU,GAAG,CACxB,KAAiB,KACyD;IAC1E,OAAO,KAAK,CAAC,WAAW,KAAK,YAAY,IAAI,KAAK,CAAC,WAAW,KAAK,aAAa;AAClF;;;;;;"}
@@ -1,26 +1,37 @@
1
- /// <reference types="react" />
1
+ import { CSSProperties, HTMLAttributes } from 'react';
2
2
  import { ButtonProps } from '../Button/types';
3
3
  export type ModalVariants = 'xs' | 'sm' | 'base' | 'lg';
4
+ export type ModalTypes = 'modal' | 'leftDrawer' | 'rightDrawer';
5
+ export type ModalAppearance = 'primary' | 'secondary';
4
6
  type BaseModalProps = {
5
7
  shouldShow: boolean;
6
8
  showHeaderCloseButton?: boolean;
7
9
  preventClose?: boolean;
8
10
  fullBleed?: boolean;
9
11
  variant?: ModalVariants;
10
- onClose: () => void;
11
- children: React.ReactNode;
12
+ displayMode?: ModalTypes;
13
+ style?: CSSProperties;
14
+ onClose: () => void | boolean;
15
+ children?: React.ReactNode;
12
16
  className?: string;
13
- };
17
+ } & Omit<HTMLAttributes<HTMLDialogElement>, 'onClose'>;
14
18
  type WithHeaderSlot = {
15
19
  headerSlot: React.ReactNode;
16
20
  };
17
21
  type WithFooterSlot = {
18
22
  footerSlot: React.ReactNode;
19
23
  };
24
+ type SideDrawType = {
25
+ displayMode: 'leftDrawer' | 'rightDrawer';
26
+ appearance?: ModalAppearance;
27
+ };
20
28
  type DefaultHeaderOptions = {
21
29
  headerTitle: string;
22
30
  headerSubtitle?: string;
23
31
  };
32
+ type ModalType = {
33
+ displayMode?: 'modal';
34
+ };
24
35
  export type Action = {
25
36
  label: string;
26
37
  } & ButtonProps;
@@ -30,13 +41,51 @@ type DefaultFooterOptions = {
30
41
  };
31
42
  type HeaderOptions = WithHeaderSlot | DefaultHeaderOptions;
32
43
  type FooterOptions = WithFooterSlot | DefaultFooterOptions;
33
- export type ModalProps = BaseModalProps & HeaderOptions & FooterOptions;
44
+ type TypeProps = ModalType | SideDrawType;
45
+ export type ModalProps = BaseModalProps & HeaderOptions & FooterOptions & TypeProps;
34
46
  /**
35
47
  * Type guard to check if a header slot has been passed to the component.
36
48
  */
37
- export declare const hasHeaderSlot: (props: ModalProps) => props is BaseModalProps & WithHeaderSlot & FooterOptions;
49
+ export declare const hasHeaderSlot: (props: ModalProps) => props is {
50
+ shouldShow: boolean;
51
+ showHeaderCloseButton?: boolean | undefined;
52
+ preventClose?: boolean | undefined;
53
+ fullBleed?: boolean | undefined;
54
+ variant?: ModalVariants | undefined;
55
+ displayMode?: ModalTypes | undefined;
56
+ style?: CSSProperties | undefined;
57
+ onClose: () => void | boolean;
58
+ children?: React.ReactNode;
59
+ className?: string | undefined;
60
+ } & Omit<HTMLAttributes<HTMLDialogElement>, "onClose"> & WithHeaderSlot & FooterOptions & TypeProps;
38
61
  /**
39
62
  * Type guard to check if a footer slot has been passed to the component.
40
63
  */
41
- export declare const hasFooterSlot: (props: ModalProps) => props is BaseModalProps & HeaderOptions & WithFooterSlot;
64
+ export declare const hasFooterSlot: (props: ModalProps) => props is {
65
+ shouldShow: boolean;
66
+ showHeaderCloseButton?: boolean | undefined;
67
+ preventClose?: boolean | undefined;
68
+ fullBleed?: boolean | undefined;
69
+ variant?: ModalVariants | undefined;
70
+ displayMode?: ModalTypes | undefined;
71
+ style?: CSSProperties | undefined;
72
+ onClose: () => void | boolean;
73
+ children?: React.ReactNode;
74
+ className?: string | undefined;
75
+ } & Omit<HTMLAttributes<HTMLDialogElement>, "onClose"> & HeaderOptions & WithFooterSlot & TypeProps;
76
+ /**
77
+ * Type guard to check if the modal is a sidedraw
78
+ */
79
+ export declare const isSideDraw: (props: ModalProps) => props is {
80
+ shouldShow: boolean;
81
+ showHeaderCloseButton?: boolean | undefined;
82
+ preventClose?: boolean | undefined;
83
+ fullBleed?: boolean | undefined;
84
+ variant?: ModalVariants | undefined;
85
+ displayMode?: ModalTypes | undefined;
86
+ style?: CSSProperties | undefined;
87
+ onClose: () => void | boolean;
88
+ children?: React.ReactNode;
89
+ className?: string | undefined;
90
+ } & Omit<HTMLAttributes<HTMLDialogElement>, "onClose"> & HeaderOptions & FooterOptions & SideDrawType;
42
91
  export {};
@@ -10,6 +10,12 @@ const hasHeaderSlot = (props) => {
10
10
  const hasFooterSlot = (props) => {
11
11
  return !!props.footerSlot;
12
12
  };
13
+ /**
14
+ * Type guard to check if the modal is a sidedraw
15
+ */
16
+ const isSideDraw = (props) => {
17
+ return props.displayMode === 'leftDrawer' || props.displayMode === 'rightDrawer';
18
+ };
13
19
 
14
- export { hasFooterSlot, hasHeaderSlot };
20
+ export { hasFooterSlot, hasHeaderSlot, isSideDraw };
15
21
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sources":["../../../src/components/Modal/types.ts"],"sourcesContent":["import { ButtonProps } from '../Button/types';\n\nexport type ModalVariants = 'xs' | 'sm' | 'base' | 'lg';\n\n// Base Modal props shared by all variants.\ntype BaseModalProps = {\n shouldShow: boolean;\n showHeaderCloseButton?: boolean;\n preventClose?: boolean;\n fullBleed?: boolean;\n variant?: ModalVariants;\n onClose: () => void;\n children: React.ReactNode;\n className?: string;\n};\n\n// Optional slot types.\n\ntype WithHeaderSlot = {\n headerSlot: React.ReactNode;\n};\n\ntype WithFooterSlot = {\n footerSlot: React.ReactNode;\n};\n\n// Default header and footer options.\n\ntype DefaultHeaderOptions = {\n headerTitle: string;\n headerSubtitle?: string;\n};\n\nexport type Action = { label: string } & ButtonProps;\ntype DefaultFooterOptions = {\n leftActions?: Action[];\n rightActions?: Action[];\n};\n\n// Either we have a header slot or default header options, same for footer.\ntype HeaderOptions = WithHeaderSlot | DefaultHeaderOptions;\ntype FooterOptions = WithFooterSlot | DefaultFooterOptions;\n\n// Modal props are shared props + the header and footer options (potentially with slots.)\nexport type ModalProps = BaseModalProps & HeaderOptions & FooterOptions;\n\n/**\n * Type guard to check if a header slot has been passed to the component.\n */\nexport const hasHeaderSlot = (\n props: ModalProps,\n): props is BaseModalProps & WithHeaderSlot & FooterOptions => {\n return !!(props as WithHeaderSlot).headerSlot;\n};\n\n/**\n * Type guard to check if a footer slot has been passed to the component.\n */\nexport const hasFooterSlot = (\n props: ModalProps,\n): props is BaseModalProps & HeaderOptions & WithFooterSlot => {\n return !!(props as WithFooterSlot).footerSlot;\n};\n"],"names":[],"mappings":"AA8CA;;AAEG;AACU,MAAA,aAAa,GAAG,CAC3B,KAAiB,KAC2C;AAC5D,IAAA,OAAO,CAAC,CAAE,KAAwB,CAAC,UAAU;AAC/C;AAEA;;AAEG;AACU,MAAA,aAAa,GAAG,CAC3B,KAAiB,KAC2C;AAC5D,IAAA,OAAO,CAAC,CAAE,KAAwB,CAAC,UAAU;AAC/C;;;;"}
1
+ {"version":3,"file":"types.js","sources":["../../../src/components/Modal/types.ts"],"sourcesContent":["import { CSSProperties, HTMLAttributes } from 'react';\nimport { ButtonProps } from '../Button/types';\n\nexport type ModalVariants = 'xs' | 'sm' | 'base' | 'lg';\nexport type ModalTypes = 'modal' | 'leftDrawer' | 'rightDrawer';\nexport type ModalAppearance = 'primary' | 'secondary';\n\n// Base Modal props shared by all variants.\ntype BaseModalProps = {\n shouldShow: boolean;\n showHeaderCloseButton?: boolean;\n preventClose?: boolean;\n fullBleed?: boolean;\n variant?: ModalVariants;\n displayMode?: ModalTypes;\n style?: CSSProperties;\n onClose: () => void | boolean;\n children?: React.ReactNode;\n className?: string;\n} & Omit<HTMLAttributes<HTMLDialogElement>, 'onClose'>;\n\n// Optional slot types.\n\ntype WithHeaderSlot = {\n headerSlot: React.ReactNode;\n};\n\ntype WithFooterSlot = {\n footerSlot: React.ReactNode;\n};\n\ntype SideDrawType = {\n displayMode: 'leftDrawer' | 'rightDrawer';\n appearance?: ModalAppearance; // Required for sidedraw\n};\n\n// Default header and footer options.\n\ntype DefaultHeaderOptions = {\n headerTitle: string;\n headerSubtitle?: string;\n};\n\ntype ModalType = {\n displayMode?: 'modal';\n};\n\nexport type Action = { label: string } & ButtonProps;\ntype DefaultFooterOptions = {\n leftActions?: Action[];\n rightActions?: Action[];\n};\n\n// Either we have a header slot or default header options, same for footer.\ntype HeaderOptions = WithHeaderSlot | DefaultHeaderOptions;\ntype FooterOptions = WithFooterSlot | DefaultFooterOptions;\ntype TypeProps = ModalType | SideDrawType;\n\n// Modal props are shared props + the header and footer options (potentially with slots.)\nexport type ModalProps = BaseModalProps & HeaderOptions & FooterOptions & TypeProps;\n\n/**\n * Type guard to check if a header slot has been passed to the component.\n */\nexport const hasHeaderSlot = (\n props: ModalProps,\n): props is BaseModalProps & WithHeaderSlot & FooterOptions & TypeProps => {\n return !!(props as WithHeaderSlot).headerSlot;\n};\n\n/**\n * Type guard to check if a footer slot has been passed to the component.\n */\nexport const hasFooterSlot = (\n props: ModalProps,\n): props is BaseModalProps & HeaderOptions & WithFooterSlot & TypeProps => {\n return !!(props as WithFooterSlot).footerSlot;\n};\n\n/**\n * Type guard to check if the modal is a sidedraw\n */\nexport const isSideDraw = (\n props: ModalProps,\n): props is BaseModalProps & HeaderOptions & FooterOptions & SideDrawType => {\n return props.displayMode === 'leftDrawer' || props.displayMode === 'rightDrawer';\n};\n"],"names":[],"mappings":"AA6DA;;AAEG;AACU,MAAA,aAAa,GAAG,CAC3B,KAAiB,KACuD;AACxE,IAAA,OAAO,CAAC,CAAE,KAAwB,CAAC,UAAU;AAC/C;AAEA;;AAEG;AACU,MAAA,aAAa,GAAG,CAC3B,KAAiB,KACuD;AACxE,IAAA,OAAO,CAAC,CAAE,KAAwB,CAAC,UAAU;AAC/C;AAEA;;AAEG;AACU,MAAA,UAAU,GAAG,CACxB,KAAiB,KACyD;IAC1E,OAAO,KAAK,CAAC,WAAW,KAAK,YAAY,IAAI,KAAK,CAAC,WAAW,KAAK,aAAa;AAClF;;;;"}
@@ -3,6 +3,7 @@
3
3
  var React = require('react');
4
4
  require('../../../hooks/useFocusVisible.cjs');
5
5
  var useId = require('../../../hooks/useId.cjs');
6
+ require('lodash.throttle');
6
7
  var styled = require('./styled.cjs');
7
8
  var ListItemContent = require('./components/ListItemContent.cjs');
8
9
 
@@ -1 +1 @@
1
- {"version":3,"file":"ListItem.cjs","sources":["../../../../src/components/SelectDropdown/ListItem/ListItem.tsx"],"sourcesContent":["import React from 'react';\nimport { ListBoxItemRenderProps } from 'react-aria-components';\nimport { useId } from '../../../hooks';\nimport { StyledListItem } from './styled';\nimport { ListItemProps } from './types';\nimport { ListItemContent } from './components/ListItemContent';\n\nexport const ListItem = ({ id, label, href, ...props }: ListItemProps) => {\n const idComputed = useId({ id, prefix: 'list-item' });\n return (\n <StyledListItem id={idComputed} textValue={label} href={href} {...props}>\n {/* use react aria's render props to add more such as isHovered */}\n {({ selectionMode, allowsDragging, isSelected }: ListBoxItemRenderProps) => (\n <ListItemContent\n selectionMode={selectionMode}\n allowsDragging={allowsDragging}\n isSelected={isSelected}\n label={label}\n isLink={Boolean(href)}\n {...props}\n />\n )}\n </StyledListItem>\n );\n};\n"],"names":["useId","React","StyledListItem","ListItemContent"],"mappings":";;;;;;;;;;;;AAOa,MAAA,QAAQ,GAAG,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,KAAK,EAAiB,KAAI;AACvE,IAAA,MAAM,UAAU,GAAGA,WAAK,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;AACrD,IAAA,QACEC,sBAAA,CAAA,aAAA,CAACC,qBAAc,EAAA,EAAC,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAA,GAAM,KAAK,EAAA,EAEpE,CAAC,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,EAA0B,MACrED,sBAAC,CAAA,aAAA,CAAAE,+BAAe,EACd,EAAA,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,EAAA,GACjB,KAAK,EAAA,CACT,CACH,CACc;AAErB;;;;"}
1
+ {"version":3,"file":"ListItem.cjs","sources":["../../../../src/components/SelectDropdown/ListItem/ListItem.tsx"],"sourcesContent":["import React from 'react';\nimport { ListBoxItemRenderProps } from 'react-aria-components';\nimport { useId } from '../../../hooks';\nimport { StyledListItem } from './styled';\nimport { ListItemProps } from './types';\nimport { ListItemContent } from './components/ListItemContent';\n\nexport const ListItem = ({ id, label, href, ...props }: ListItemProps) => {\n const idComputed = useId({ id, prefix: 'list-item' });\n return (\n <StyledListItem id={idComputed} textValue={label} href={href} {...props}>\n {/* use react aria's render props to add more such as isHovered */}\n {({ selectionMode, allowsDragging, isSelected }: ListBoxItemRenderProps) => (\n <ListItemContent\n selectionMode={selectionMode}\n allowsDragging={allowsDragging}\n isSelected={isSelected}\n label={label}\n isLink={Boolean(href)}\n {...props}\n />\n )}\n </StyledListItem>\n );\n};\n"],"names":["useId","React","StyledListItem","ListItemContent"],"mappings":";;;;;;;;;;;;;AAOa,MAAA,QAAQ,GAAG,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,KAAK,EAAiB,KAAI;AACvE,IAAA,MAAM,UAAU,GAAGA,WAAK,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;AACrD,IAAA,QACEC,sBAAA,CAAA,aAAA,CAACC,qBAAc,EAAA,EAAC,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAA,GAAM,KAAK,EAAA,EAEpE,CAAC,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,EAA0B,MACrED,sBAAC,CAAA,aAAA,CAAAE,+BAAe,EACd,EAAA,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,EAAA,GACjB,KAAK,EAAA,CACT,CACH,CACc;AAErB;;;;"}
@@ -1,6 +1,7 @@
1
1
  import React__default from 'react';
2
2
  import '../../../hooks/useFocusVisible.js';
3
3
  import { useId } from '../../../hooks/useId.js';
4
+ import 'lodash.throttle';
4
5
  import { StyledListItem } from './styled.js';
5
6
  import { ListItemContent } from './components/ListItemContent.js';
6
7
 
@@ -1 +1 @@
1
- {"version":3,"file":"ListItem.js","sources":["../../../../src/components/SelectDropdown/ListItem/ListItem.tsx"],"sourcesContent":["import React from 'react';\nimport { ListBoxItemRenderProps } from 'react-aria-components';\nimport { useId } from '../../../hooks';\nimport { StyledListItem } from './styled';\nimport { ListItemProps } from './types';\nimport { ListItemContent } from './components/ListItemContent';\n\nexport const ListItem = ({ id, label, href, ...props }: ListItemProps) => {\n const idComputed = useId({ id, prefix: 'list-item' });\n return (\n <StyledListItem id={idComputed} textValue={label} href={href} {...props}>\n {/* use react aria's render props to add more such as isHovered */}\n {({ selectionMode, allowsDragging, isSelected }: ListBoxItemRenderProps) => (\n <ListItemContent\n selectionMode={selectionMode}\n allowsDragging={allowsDragging}\n isSelected={isSelected}\n label={label}\n isLink={Boolean(href)}\n {...props}\n />\n )}\n </StyledListItem>\n );\n};\n"],"names":["React"],"mappings":";;;;;;AAOa,MAAA,QAAQ,GAAG,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,KAAK,EAAiB,KAAI;AACvE,IAAA,MAAM,UAAU,GAAG,KAAK,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;AACrD,IAAA,QACEA,cAAA,CAAA,aAAA,CAAC,cAAc,EAAA,EAAC,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAA,GAAM,KAAK,EAAA,EAEpE,CAAC,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,EAA0B,MACrEA,cAAC,CAAA,aAAA,CAAA,eAAe,EACd,EAAA,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,EAAA,GACjB,KAAK,EAAA,CACT,CACH,CACc;AAErB;;;;"}
1
+ {"version":3,"file":"ListItem.js","sources":["../../../../src/components/SelectDropdown/ListItem/ListItem.tsx"],"sourcesContent":["import React from 'react';\nimport { ListBoxItemRenderProps } from 'react-aria-components';\nimport { useId } from '../../../hooks';\nimport { StyledListItem } from './styled';\nimport { ListItemProps } from './types';\nimport { ListItemContent } from './components/ListItemContent';\n\nexport const ListItem = ({ id, label, href, ...props }: ListItemProps) => {\n const idComputed = useId({ id, prefix: 'list-item' });\n return (\n <StyledListItem id={idComputed} textValue={label} href={href} {...props}>\n {/* use react aria's render props to add more such as isHovered */}\n {({ selectionMode, allowsDragging, isSelected }: ListBoxItemRenderProps) => (\n <ListItemContent\n selectionMode={selectionMode}\n allowsDragging={allowsDragging}\n isSelected={isSelected}\n label={label}\n isLink={Boolean(href)}\n {...props}\n />\n )}\n </StyledListItem>\n );\n};\n"],"names":["React"],"mappings":";;;;;;;AAOa,MAAA,QAAQ,GAAG,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,KAAK,EAAiB,KAAI;AACvE,IAAA,MAAM,UAAU,GAAG,KAAK,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;AACrD,IAAA,QACEA,cAAA,CAAA,aAAA,CAAC,cAAc,EAAA,EAAC,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAA,GAAM,KAAK,EAAA,EAEpE,CAAC,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,EAA0B,MACrEA,cAAC,CAAA,aAAA,CAAA,eAAe,EACd,EAAA,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,EAAA,GACjB,KAAK,EAAA,CACT,CACH,CACc;AAErB;;;;"}
@@ -6,6 +6,7 @@ var styled = require('./styled.cjs');
6
6
  var useClickOutside = require('../../hooks/useClickOutside.cjs');
7
7
  require('../../hooks/useFocusVisible.cjs');
8
8
  require('uid/secure');
9
+ require('lodash.throttle');
9
10
  var CrossIcon = require('../../tempIcons/CrossIcon.cjs');
10
11
 
11
12
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
@@ -1 +1 @@
1
- {"version":3,"file":"VideoModal.cjs","sources":["../../../src/components/VideoModal/VideoModal.tsx"],"sourcesContent":["import React from 'react';\nimport { Popup } from './components/Popup';\nimport { VideoModalProps } from './types';\nimport { PopupContent, VideoWrapper, ButtonSC } from './styled';\nimport { useClickOutside } from '../../hooks';\nimport { CrossIcon } from '../../tempIcons/CrossIcon';\n\nexport const VideoModal = ({\n id,\n youtubeVideoId,\n showVideoModal,\n handleCloseClick,\n}: VideoModalProps) => {\n const ref = useClickOutside(showVideoModal, handleCloseClick);\n\n return (\n <Popup shouldShow={showVideoModal} className={`${id}-video`}>\n <PopupContent\n data-testid=\"video-modal_popup-content\"\n className={`video-modal--${showVideoModal ? 'visible' : 'hidden'}`}\n >\n <VideoWrapper ref={ref}>\n <iframe\n title={`${id}-video`}\n src={`https://www.youtube.com/embed/${youtubeVideoId}`}\n frameBorder=\"0\"\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\n allowFullScreen\n />\n <ButtonSC\n variant=\"flat\"\n onClick={handleCloseClick}\n data-testid=\"video-modal--close\"\n iconSlot={<CrossIcon color=\"white\" />}\n />\n </VideoWrapper>\n </PopupContent>\n </Popup>\n );\n};\n"],"names":["useClickOutside","React","Popup","PopupContent","VideoWrapper","ButtonSC","CrossIcon"],"mappings":";;;;;;;;;;;;;;AAOO,MAAM,UAAU,GAAG,CAAC,EACzB,EAAE,EACF,cAAc,EACd,cAAc,EACd,gBAAgB,GACA,KAAI;IACpB,MAAM,GAAG,GAAGA,+BAAe,CAAC,cAAc,EAAE,gBAAgB,CAAC;AAE7D,IAAA,QACEC,sBAAA,CAAA,aAAA,CAACC,WAAK,EAAA,EAAC,UAAU,EAAE,cAAc,EAAE,SAAS,EAAE,CAAG,EAAA,EAAE,CAAQ,MAAA,CAAA,EAAA;AACzD,QAAAD,sBAAA,CAAA,aAAA,CAACE,mBAAY,EACC,EAAA,aAAA,EAAA,2BAA2B,EACvC,SAAS,EAAE,CAAgB,aAAA,EAAA,cAAc,GAAG,SAAS,GAAG,QAAQ,CAAE,CAAA,EAAA;AAElE,YAAAF,sBAAA,CAAA,aAAA,CAACG,mBAAY,EAAA,EAAC,GAAG,EAAE,GAAG,EAAA;gBACpBH,sBACE,CAAA,aAAA,CAAA,QAAA,EAAA,EAAA,KAAK,EAAE,CAAG,EAAA,EAAE,QAAQ,EACpB,GAAG,EAAE,CAAiC,8BAAA,EAAA,cAAc,EAAE,EACtD,WAAW,EAAC,GAAG,EACf,KAAK,EAAC,0FAA0F,EAChG,eAAe,EACf,IAAA,EAAA,CAAA;gBACFA,sBAAC,CAAA,aAAA,CAAAI,eAAQ,EACP,EAAA,OAAO,EAAC,MAAM,EACd,OAAO,EAAE,gBAAgB,EACb,aAAA,EAAA,oBAAoB,EAChC,QAAQ,EAAEJ,sBAAC,CAAA,aAAA,CAAAK,mBAAS,EAAC,EAAA,KAAK,EAAC,OAAO,EAAG,CAAA,EAAA,CACrC,CACW,CACF,CACT;AAEZ;;;;"}
1
+ {"version":3,"file":"VideoModal.cjs","sources":["../../../src/components/VideoModal/VideoModal.tsx"],"sourcesContent":["import React from 'react';\nimport { Popup } from './components/Popup';\nimport { VideoModalProps } from './types';\nimport { PopupContent, VideoWrapper, ButtonSC } from './styled';\nimport { useClickOutside } from '../../hooks';\nimport { CrossIcon } from '../../tempIcons/CrossIcon';\n\nexport const VideoModal = ({\n id,\n youtubeVideoId,\n showVideoModal,\n handleCloseClick,\n}: VideoModalProps) => {\n const ref = useClickOutside(showVideoModal, handleCloseClick);\n\n return (\n <Popup shouldShow={showVideoModal} className={`${id}-video`}>\n <PopupContent\n data-testid=\"video-modal_popup-content\"\n className={`video-modal--${showVideoModal ? 'visible' : 'hidden'}`}\n >\n <VideoWrapper ref={ref}>\n <iframe\n title={`${id}-video`}\n src={`https://www.youtube.com/embed/${youtubeVideoId}`}\n frameBorder=\"0\"\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\n allowFullScreen\n />\n <ButtonSC\n variant=\"flat\"\n onClick={handleCloseClick}\n data-testid=\"video-modal--close\"\n iconSlot={<CrossIcon color=\"white\" />}\n />\n </VideoWrapper>\n </PopupContent>\n </Popup>\n );\n};\n"],"names":["useClickOutside","React","Popup","PopupContent","VideoWrapper","ButtonSC","CrossIcon"],"mappings":";;;;;;;;;;;;;;;AAOO,MAAM,UAAU,GAAG,CAAC,EACzB,EAAE,EACF,cAAc,EACd,cAAc,EACd,gBAAgB,GACA,KAAI;IACpB,MAAM,GAAG,GAAGA,+BAAe,CAAC,cAAc,EAAE,gBAAgB,CAAC;AAE7D,IAAA,QACEC,sBAAA,CAAA,aAAA,CAACC,WAAK,EAAA,EAAC,UAAU,EAAE,cAAc,EAAE,SAAS,EAAE,CAAG,EAAA,EAAE,CAAQ,MAAA,CAAA,EAAA;AACzD,QAAAD,sBAAA,CAAA,aAAA,CAACE,mBAAY,EACC,EAAA,aAAA,EAAA,2BAA2B,EACvC,SAAS,EAAE,CAAgB,aAAA,EAAA,cAAc,GAAG,SAAS,GAAG,QAAQ,CAAE,CAAA,EAAA;AAElE,YAAAF,sBAAA,CAAA,aAAA,CAACG,mBAAY,EAAA,EAAC,GAAG,EAAE,GAAG,EAAA;gBACpBH,sBACE,CAAA,aAAA,CAAA,QAAA,EAAA,EAAA,KAAK,EAAE,CAAG,EAAA,EAAE,QAAQ,EACpB,GAAG,EAAE,CAAiC,8BAAA,EAAA,cAAc,EAAE,EACtD,WAAW,EAAC,GAAG,EACf,KAAK,EAAC,0FAA0F,EAChG,eAAe,EACf,IAAA,EAAA,CAAA;gBACFA,sBAAC,CAAA,aAAA,CAAAI,eAAQ,EACP,EAAA,OAAO,EAAC,MAAM,EACd,OAAO,EAAE,gBAAgB,EACb,aAAA,EAAA,oBAAoB,EAChC,QAAQ,EAAEJ,sBAAC,CAAA,aAAA,CAAAK,mBAAS,EAAC,EAAA,KAAK,EAAC,OAAO,EAAG,CAAA,EAAA,CACrC,CACW,CACF,CACT;AAEZ;;;;"}
@@ -4,6 +4,7 @@ import { PopupContent, VideoWrapper, ButtonSC } from './styled.js';
4
4
  import { useClickOutside } from '../../hooks/useClickOutside.js';
5
5
  import '../../hooks/useFocusVisible.js';
6
6
  import 'uid/secure';
7
+ import 'lodash.throttle';
7
8
  import { CrossIcon } from '../../tempIcons/CrossIcon.js';
8
9
 
9
10
  const VideoModal = ({ id, youtubeVideoId, showVideoModal, handleCloseClick, }) => {
@@ -1 +1 @@
1
- {"version":3,"file":"VideoModal.js","sources":["../../../src/components/VideoModal/VideoModal.tsx"],"sourcesContent":["import React from 'react';\nimport { Popup } from './components/Popup';\nimport { VideoModalProps } from './types';\nimport { PopupContent, VideoWrapper, ButtonSC } from './styled';\nimport { useClickOutside } from '../../hooks';\nimport { CrossIcon } from '../../tempIcons/CrossIcon';\n\nexport const VideoModal = ({\n id,\n youtubeVideoId,\n showVideoModal,\n handleCloseClick,\n}: VideoModalProps) => {\n const ref = useClickOutside(showVideoModal, handleCloseClick);\n\n return (\n <Popup shouldShow={showVideoModal} className={`${id}-video`}>\n <PopupContent\n data-testid=\"video-modal_popup-content\"\n className={`video-modal--${showVideoModal ? 'visible' : 'hidden'}`}\n >\n <VideoWrapper ref={ref}>\n <iframe\n title={`${id}-video`}\n src={`https://www.youtube.com/embed/${youtubeVideoId}`}\n frameBorder=\"0\"\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\n allowFullScreen\n />\n <ButtonSC\n variant=\"flat\"\n onClick={handleCloseClick}\n data-testid=\"video-modal--close\"\n iconSlot={<CrossIcon color=\"white\" />}\n />\n </VideoWrapper>\n </PopupContent>\n </Popup>\n );\n};\n"],"names":["React"],"mappings":";;;;;;;;AAOO,MAAM,UAAU,GAAG,CAAC,EACzB,EAAE,EACF,cAAc,EACd,cAAc,EACd,gBAAgB,GACA,KAAI;IACpB,MAAM,GAAG,GAAG,eAAe,CAAC,cAAc,EAAE,gBAAgB,CAAC;AAE7D,IAAA,QACEA,cAAA,CAAA,aAAA,CAAC,KAAK,EAAA,EAAC,UAAU,EAAE,cAAc,EAAE,SAAS,EAAE,CAAG,EAAA,EAAE,CAAQ,MAAA,CAAA,EAAA;AACzD,QAAAA,cAAA,CAAA,aAAA,CAAC,YAAY,EACC,EAAA,aAAA,EAAA,2BAA2B,EACvC,SAAS,EAAE,CAAgB,aAAA,EAAA,cAAc,GAAG,SAAS,GAAG,QAAQ,CAAE,CAAA,EAAA;AAElE,YAAAA,cAAA,CAAA,aAAA,CAAC,YAAY,EAAA,EAAC,GAAG,EAAE,GAAG,EAAA;gBACpBA,cACE,CAAA,aAAA,CAAA,QAAA,EAAA,EAAA,KAAK,EAAE,CAAG,EAAA,EAAE,QAAQ,EACpB,GAAG,EAAE,CAAiC,8BAAA,EAAA,cAAc,EAAE,EACtD,WAAW,EAAC,GAAG,EACf,KAAK,EAAC,0FAA0F,EAChG,eAAe,EACf,IAAA,EAAA,CAAA;gBACFA,cAAC,CAAA,aAAA,CAAA,QAAQ,EACP,EAAA,OAAO,EAAC,MAAM,EACd,OAAO,EAAE,gBAAgB,EACb,aAAA,EAAA,oBAAoB,EAChC,QAAQ,EAAEA,cAAC,CAAA,aAAA,CAAA,SAAS,EAAC,EAAA,KAAK,EAAC,OAAO,EAAG,CAAA,EAAA,CACrC,CACW,CACF,CACT;AAEZ;;;;"}
1
+ {"version":3,"file":"VideoModal.js","sources":["../../../src/components/VideoModal/VideoModal.tsx"],"sourcesContent":["import React from 'react';\nimport { Popup } from './components/Popup';\nimport { VideoModalProps } from './types';\nimport { PopupContent, VideoWrapper, ButtonSC } from './styled';\nimport { useClickOutside } from '../../hooks';\nimport { CrossIcon } from '../../tempIcons/CrossIcon';\n\nexport const VideoModal = ({\n id,\n youtubeVideoId,\n showVideoModal,\n handleCloseClick,\n}: VideoModalProps) => {\n const ref = useClickOutside(showVideoModal, handleCloseClick);\n\n return (\n <Popup shouldShow={showVideoModal} className={`${id}-video`}>\n <PopupContent\n data-testid=\"video-modal_popup-content\"\n className={`video-modal--${showVideoModal ? 'visible' : 'hidden'}`}\n >\n <VideoWrapper ref={ref}>\n <iframe\n title={`${id}-video`}\n src={`https://www.youtube.com/embed/${youtubeVideoId}`}\n frameBorder=\"0\"\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\n allowFullScreen\n />\n <ButtonSC\n variant=\"flat\"\n onClick={handleCloseClick}\n data-testid=\"video-modal--close\"\n iconSlot={<CrossIcon color=\"white\" />}\n />\n </VideoWrapper>\n </PopupContent>\n </Popup>\n );\n};\n"],"names":["React"],"mappings":";;;;;;;;;AAOO,MAAM,UAAU,GAAG,CAAC,EACzB,EAAE,EACF,cAAc,EACd,cAAc,EACd,gBAAgB,GACA,KAAI;IACpB,MAAM,GAAG,GAAG,eAAe,CAAC,cAAc,EAAE,gBAAgB,CAAC;AAE7D,IAAA,QACEA,cAAA,CAAA,aAAA,CAAC,KAAK,EAAA,EAAC,UAAU,EAAE,cAAc,EAAE,SAAS,EAAE,CAAG,EAAA,EAAE,CAAQ,MAAA,CAAA,EAAA;AACzD,QAAAA,cAAA,CAAA,aAAA,CAAC,YAAY,EACC,EAAA,aAAA,EAAA,2BAA2B,EACvC,SAAS,EAAE,CAAgB,aAAA,EAAA,cAAc,GAAG,SAAS,GAAG,QAAQ,CAAE,CAAA,EAAA;AAElE,YAAAA,cAAA,CAAA,aAAA,CAAC,YAAY,EAAA,EAAC,GAAG,EAAE,GAAG,EAAA;gBACpBA,cACE,CAAA,aAAA,CAAA,QAAA,EAAA,EAAA,KAAK,EAAE,CAAG,EAAA,EAAE,QAAQ,EACpB,GAAG,EAAE,CAAiC,8BAAA,EAAA,cAAc,EAAE,EACtD,WAAW,EAAC,GAAG,EACf,KAAK,EAAC,0FAA0F,EAChG,eAAe,EACf,IAAA,EAAA,CAAA;gBACFA,cAAC,CAAA,aAAA,CAAA,QAAQ,EACP,EAAA,OAAO,EAAC,MAAM,EACd,OAAO,EAAE,gBAAgB,EACb,aAAA,EAAA,oBAAoB,EAChC,QAAQ,EAAEA,cAAC,CAAA,aAAA,CAAA,SAAS,EAAC,EAAA,KAAK,EAAC,OAAO,EAAG,CAAA,EAAA,CACrC,CACW,CACF,CACT;AAEZ;;;;"}
@@ -5,6 +5,7 @@ require('../../hooks/useFocusVisible.cjs');
5
5
  var useHover = require('../../hooks/useHover.cjs');
6
6
  var buildClassnames = require('../../utils/buildClassnames.cjs');
7
7
  require('uid/secure');
8
+ require('lodash.throttle');
8
9
  var colors = require('../../theme/modules/colors.cjs');
9
10
  var types = require('./types.cjs');
10
11
  var styled = require('./styled.cjs');
@@ -1 +1 @@
1
- {"version":3,"file":"View.cjs","sources":["../../../src/components/View/View.tsx"],"sourcesContent":["import React, { useCallback } from 'react';\n\nimport { useHover } from '../../hooks';\nimport { colors } from '../../theme/modules/colors';\n\nimport { ViewProps, ViewTypes } from './types';\n\nimport {\n Container,\n Contour,\n CounterContainer,\n CounterText,\n CustomIconWrapper,\n IconStyling,\n Text,\n} from './styled';\nimport { buildClassnames } from '../../utils/buildClassnames';\nimport { CrossIcon } from '../../tempIcons/CrossIcon';\nimport { EditIcon } from '../../tempIcons/EditIcon';\n\nexport interface ClassNamesReturnPayload {\n delete?: string;\n options?: string;\n edit?: string;\n container?: string;\n active?: string;\n counter?: string;\n}\n\nconst generateClassNames = (prefix?: string): ClassNamesReturnPayload => ({\n delete: prefix ? `${prefix}-delete` : undefined,\n options: prefix ? `${prefix}-options` : undefined,\n edit: prefix ? `${prefix}-edit` : undefined,\n container: prefix ? `${prefix}-container` : undefined,\n active: prefix ? `${prefix}-active` : undefined,\n counter: prefix ? `${prefix}-counter` : undefined,\n});\n\n/**\n *\n * @deprecated\n *\n * use ViewTab component instead\n *\n */\nexport const View = ({\n id,\n iconSlot,\n name,\n type,\n className,\n colourPalette = colors.secondary.blue,\n customTextColour,\n count,\n active = false,\n onClick,\n onDelete,\n onEdit,\n e2eClassName,\n}: ViewProps) => {\n const classNames = generateClassNames(className);\n const e2eClassNames = generateClassNames(e2eClassName);\n const [isHovered, handleEnter, handleLeave] = useHover();\n\n const handleClick = useCallback(() => onClick(id), [id, onClick]);\n const handleDelete = useCallback(\n (event) => {\n event.stopPropagation();\n if (onDelete) onDelete(id);\n },\n [onDelete, id],\n );\n const handleEdit = useCallback(\n (event) => {\n event.stopPropagation();\n if (onEdit) onEdit(id);\n },\n [onEdit, id],\n );\n\n const isDraft = type === ViewTypes.draft;\n const isSaved = type === ViewTypes.saved;\n const fill = active ? colors.neutral.ink.dark : colors.neutral.ink.base;\n\n return (\n <Container\n className={`${buildClassnames([classNames?.container, e2eClassNames?.container])} ${\n (active && e2eClassNames?.active) || ''\n }`}\n onClick={handleClick}\n >\n <Contour\n active={active}\n onMouseEnter={handleEnter}\n onMouseLeave={handleLeave}\n colourPalette={colourPalette}\n customTextColour={customTextColour}\n >\n {iconSlot && <CustomIconWrapper>{iconSlot}</CustomIconWrapper>}\n <Text variant=\"bodyBold\">{name}</Text>\n {count && (\n <CounterContainer\n active={active || isHovered}\n colourPalette={colourPalette}\n customTextColour={customTextColour}\n >\n <CounterText className={e2eClassNames?.counter} variant=\"subheadingSmall\">\n {count}\n </CounterText>\n </CounterContainer>\n )}\n {isDraft && (\n <CrossIcon\n {...IconStyling}\n color={fill}\n className={e2eClassNames?.delete}\n onClick={handleDelete}\n />\n )}\n {isSaved && active && (\n <EditIcon\n {...IconStyling}\n color={fill}\n className={e2eClassNames?.edit}\n onClick={handleEdit}\n />\n )}\n </Contour>\n </Container>\n );\n};\n"],"names":["colors","useHover","useCallback","ViewTypes","React","Container","buildClassnames","Contour","CustomIconWrapper","Text","CounterContainer","CounterText","CrossIcon","IconStyling","EditIcon"],"mappings":";;;;;;;;;;;;;;;;;;AA6BA,MAAM,kBAAkB,GAAG,CAAC,MAAe,MAA+B;IACxE,MAAM,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAS,OAAA,CAAA,GAAG,SAAS;IAC/C,OAAO,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAU,QAAA,CAAA,GAAG,SAAS;IACjD,IAAI,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAO,KAAA,CAAA,GAAG,SAAS;IAC3C,SAAS,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAY,UAAA,CAAA,GAAG,SAAS;IACrD,MAAM,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAS,OAAA,CAAA,GAAG,SAAS;IAC/C,OAAO,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAU,QAAA,CAAA,GAAG,SAAS;AAClD,CAAA,CAAC;AAEF;;;;;;AAMG;AACU,MAAA,IAAI,GAAG,CAAC,EACnB,EAAE,EACF,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,aAAa,GAAGA,aAAM,CAAC,SAAS,CAAC,IAAI,EACrC,gBAAgB,EAChB,KAAK,EACL,MAAM,GAAG,KAAK,EACd,OAAO,EACP,QAAQ,E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AI,EACX,SAAS,EAAE,aAAa,KAAA,IAAA,IAAb,aAAa,KAAA,SAAA,GAAA,SAAA,GAAb,aAAa,CAAE,IAAI,EAC9B,OAAO,EAAE,UAAU,EACnB,CAAA,CACH,CACO,CACA;AAEhB;;;;"}
1
+ {"version":3,"file":"View.cjs","sources":["../../../src/components/View/View.tsx"],"sourcesContent":["import React, { useCallback } from 'react';\n\nimport { useHover } from '../../hooks';\nimport { colors } from '../../theme/modules/colors';\n\nimport { ViewProps, ViewTypes } from './types';\n\nimport {\n Container,\n Contour,\n CounterContainer,\n CounterText,\n CustomIconWrapper,\n IconStyling,\n Text,\n} from './styled';\nimport { buildClassnames } from '../../utils/buildClassnames';\nimport { CrossIcon } from '../../tempIcons/CrossIcon';\nimport { EditIcon } from '../../tempIcons/EditIcon';\n\nexport interface ClassNamesReturnPayload {\n delete?: string;\n options?: string;\n edit?: string;\n container?: string;\n active?: string;\n counter?: string;\n}\n\nconst generateClassNames = (prefix?: string): ClassNamesReturnPayload => ({\n delete: prefix ? `${prefix}-delete` : undefined,\n options: prefix ? `${prefix}-options` : undefined,\n edit: prefix ? `${prefix}-edit` : undefined,\n container: prefix ? `${prefix}-container` : undefined,\n active: prefix ? `${prefix}-active` : undefined,\n counter: prefix ? `${prefix}-counter` : undefined,\n});\n\n/**\n *\n * @deprecated\n *\n * use ViewTab component instead\n *\n */\nexport const View = ({\n id,\n iconSlot,\n name,\n type,\n className,\n colourPalette = colors.secondary.blue,\n customTextColour,\n count,\n active = false,\n onClick,\n onDelete,\n onEdit,\n e2eClassName,\n}: ViewProps) => {\n const classNames = generateClassNames(className);\n const e2eClassNames = generateClassNames(e2eClassName);\n const [isHovered, handleEnter, handleLeave] = useHover();\n\n const handleClick = useCallback(() => onClick(id), [id, onClick]);\n const handleDelete = useCallback(\n (event) => {\n event.stopPropagation();\n if (onDelete) onDelete(id);\n },\n [onDelete, id],\n );\n const handleEdit = useCallback(\n (event) => {\n event.stopPropagation();\n if (onEdit) onEdit(id);\n },\n [onEdit, id],\n );\n\n const isDraft = type === ViewTypes.draft;\n const isSaved = type === ViewTypes.saved;\n const fill = active ? colors.neutral.ink.dark : colors.neutral.ink.base;\n\n return (\n <Container\n className={`${buildClassnames([classNames?.container, e2eClassNames?.container])} ${\n (active && e2eClassNames?.active) || ''\n }`}\n onClick={handleClick}\n >\n <Contour\n active={active}\n onMouseEnter={handleEnter}\n onMouseLeave={handleLeave}\n colourPalette={colourPalette}\n customTextColour={customTextColour}\n >\n {iconSlot && <CustomIconWrapper>{iconSlot}</CustomIconWrapper>}\n <Text variant=\"bodyBold\">{name}</Text>\n {count && (\n <CounterContainer\n active={active || isHovered}\n colourPalette={colourPalette}\n customTextColour={customTextColour}\n >\n <CounterText className={e2eClassNames?.counter} variant=\"subheadingSmall\">\n {count}\n </CounterText>\n </CounterContainer>\n )}\n {isDraft && (\n <CrossIcon\n {...IconStyling}\n color={fill}\n className={e2eClassNames?.delete}\n onClick={handleDelete}\n />\n )}\n {isSaved && active && (\n <EditIcon\n {...IconStyling}\n color={fill}\n className={e2eClassNames?.edit}\n onClick={handleEdit}\n />\n )}\n </Contour>\n </Container>\n );\n};\n"],"names":["colors","useHover","useCallback","ViewTypes","React","Container","buildClassnames","Contour","CustomIconWrapper","Text","CounterContainer","CounterText","CrossIcon","IconStyling","EditIcon"],"mappings":";;;;;;;;;;;;;;;;;;;AA6BA,MAAM,kBAAkB,GAAG,CAAC,MAAe,MAA+B;IACxE,MAAM,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAS,OAAA,CAAA,GAAG,SAAS;IAC/C,OAAO,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAU,QAAA,CAAA,GAAG,SAAS;IACjD,IAAI,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAO,KAAA,CAAA,GAAG,SAAS;IAC3C,SAAS,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAY,UAAA,CAAA,GAAG,SAAS;IACrD,MAAM,EAAE,MAAM,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,IACtE,KAAK,CACM,CACG,CACpB;YACA,OAAO,KACNP,sBAAA,CAAA,aAAA,CAACQ,mBAAS,EAAA,EAAA,GACJC,kBAAW,EACf,KAAK,EAAE,IAAI,EACX,SAAS,EAAE,aAAa,KAAA,IAAA,IAAb,aAAa,KAAA,SAAA,GAAA,SAAA,GAAb,aAAa,CAAE,MAAM,EAChC,OAAO,EAAE,YAAY,EAAA,CACrB,CACH;AACA,YAAA,OAAO,IAAI,MAAM,KAChBT,sBAAC,CAAA,aAAA,CAAAU,iBAAQ,EACH,EAAA,GAAAD,kBAAW,EACf,KAAK,EAAE,IAAI,EACX,SAAS,EAAE,aAAa,KAAA,IAAA,IAAb,aAAa,KAAA,SAAA,GAAA,SAAA,GAAb,aAAa,CAAE,IAAI,EAC9B,OAAO,EAAE,UAAU,EACnB,CAAA,CACH,CACO,CACA;AAEhB;;;;"}
@@ -3,6 +3,7 @@ import '../../hooks/useFocusVisible.js';
3
3
  import { useHover } from '../../hooks/useHover.js';
4
4
  import { buildClassnames } from '../../utils/buildClassnames.js';
5
5
  import 'uid/secure';
6
+ import 'lodash.throttle';
6
7
  import { colors } from '../../theme/modules/colors.js';
7
8
  import { ViewTypes } from './types.js';
8
9
  import { Container, Contour, CustomIconWrapper, CounterContainer, CounterText, IconStyling } from './styled.js';
@@ -1 +1 @@
1
- {"version":3,"file":"View.js","sources":["../../../src/components/View/View.tsx"],"sourcesContent":["import React, { useCallback } from 'react';\n\nimport { useHover } from '../../hooks';\nimport { colors } from '../../theme/modules/colors';\n\nimport { ViewProps, ViewTypes } from './types';\n\nimport {\n Container,\n Contour,\n CounterContainer,\n CounterText,\n CustomIconWrapper,\n IconStyling,\n Text,\n} from './styled';\nimport { buildClassnames } from '../../utils/buildClassnames';\nimport { CrossIcon } from '../../tempIcons/CrossIcon';\nimport { EditIcon } from '../../tempIcons/EditIcon';\n\nexport interface ClassNamesReturnPayload {\n delete?: string;\n options?: string;\n edit?: string;\n container?: string;\n active?: string;\n counter?: string;\n}\n\nconst generateClassNames = (prefix?: string): ClassNamesReturnPayload => ({\n delete: prefix ? `${prefix}-delete` : undefined,\n options: prefix ? `${prefix}-options` : undefined,\n edit: prefix ? `${prefix}-edit` : undefined,\n container: prefix ? `${prefix}-container` : undefined,\n active: prefix ? `${prefix}-active` : undefined,\n counter: prefix ? `${prefix}-counter` : undefined,\n});\n\n/**\n *\n * @deprecated\n *\n * use ViewTab component instead\n *\n */\nexport const View = ({\n id,\n iconSlot,\n name,\n type,\n className,\n colourPalette = colors.secondary.blue,\n customTextColour,\n count,\n active = false,\n onClick,\n onDelete,\n onEdit,\n e2eClassName,\n}: ViewProps) => {\n const classNames = generateClassNames(className);\n const e2eClassNames = generateClassNames(e2eClassName);\n const [isHovered, handleEnter, handleLeave] = useHover();\n\n const handleClick = useCallback(() => onClick(id), [id, onClick]);\n const handleDelete = useCallback(\n (event) => {\n event.stopPropagation();\n if (onDelete) onDelete(id);\n },\n [onDelete, id],\n );\n const handleEdit = useCallback(\n (event) => {\n event.stopPropagation();\n if (onEdit) onEdit(id);\n },\n [onEdit, id],\n );\n\n const isDraft = type === ViewTypes.draft;\n const isSaved = type === ViewTypes.saved;\n const fill = active ? colors.neutral.ink.dark : colors.neutral.ink.base;\n\n return (\n <Container\n className={`${buildClassnames([classNames?.container, e2eClassNames?.container])} ${\n (active && e2eClassNames?.active) || ''\n }`}\n onClick={handleClick}\n >\n <Contour\n active={active}\n onMouseEnter={handleEnter}\n onMouseLeave={handleLeave}\n colourPalette={colourPalette}\n customTextColour={customTextColour}\n >\n {iconSlot && <CustomIconWrapper>{iconSlot}</CustomIconWrapper>}\n <Text variant=\"bodyBold\">{name}</Text>\n {count && (\n <CounterContainer\n active={active || isHovered}\n colourPalette={colourPalette}\n customTextColour={customTextColour}\n >\n <CounterText className={e2eClassNames?.counter} variant=\"subheadingSmall\">\n {count}\n </CounterText>\n </CounterContainer>\n )}\n {isDraft && (\n <CrossIcon\n {...IconStyling}\n color={fill}\n className={e2eClassNames?.delete}\n onClick={handleDelete}\n />\n )}\n {isSaved && active && (\n <EditIcon\n {...IconStyling}\n color={fill}\n className={e2eClassNames?.edit}\n onClick={handleEdit}\n />\n )}\n </Contour>\n </Container>\n );\n};\n"],"names":["React"],"mappings":";;;;;;;;;;;;AA6BA,MAAM,kBAAkB,GAAG,CAAC,MAAe,MAA+B;IACxE,MAAM,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAS,OAAA,CAAA,GAAG,SAAS;IAC/C,OAAO,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAU,QAAA,CAAA,GAAG,SAAS;IACjD,IAAI,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAO,KAAA,CAAA,GAAG,SAAS;IAC3C,SAAS,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAY,UAAA,CAAA,GAAG,SAAS;IACrD,MAAM,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAS,OAAA,CAAA,GAAG,SAAS;IAC/C,OAAO,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAU,QAAA,CAAA,GAAG,SAAS;AAClD,CAAA,CAAC;AAEF;;;;;;AAMG;AACU,MAAA,IAAI,GAAG,CAAC,EACnB,EAAE,EACF,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,aAAa,GAAG,MAAM,CAAC,SAAS,CAAC,IAAI,EACrC,gBAAgB,EAChB,KAAK,EACL,MAAM,GAAG,KAAK,EACd,OAAO,EACP,QAAQ,EACR,MAAM,EACN,YAAY,GACF,KAAI;AACd,IAAA,MAAM,UAAU,GAAG,kBAAkB,CAAC,SAAS,CAAC;AAChD,IAAA,MAAM,aAAa,GAAG,kBAAkB,CAAC,YAAY,CAAC;IACtD,MAAM,CAAC,SAAS,EAAE,WAAW,EAAE,WAAW,CAAC,GAAG,QAAQ,EAAE;AAExD,IAAA,MAAM,WAAW,GAAG,WAAW,CAAC,MAAM,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,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;AAEjC,YAAA,QAAQ,IAAIA,cAAA,CAAA,aAAA,CAAC,iBAAiB,EAAA,IAAA,EAAE,QAAQ,CAAqB;AAC9D,YAAAA,cAAA,CAAA,aAAA,CAAC,IAAI,EAAC,EAAA,OAAO,EAAC,UAAU,EAAA,EAAE,IAAI,CAAQ;AACrC,YAAA,KAAK,KACJA,cAAA,CAAA,aAAA,CAAC,gBAAgB,EAAA,EACf,MAAM,EAAE,MAAM,IAAI,SAAS,EAC3B,aAAa,EAAE,aAAa,EAC5B,gBAAgB,EAAE,gBAAgB,EAAA;AAElC,gBAAAA,cAAA,CAAA,aAAA,CAAC,WAAW,EAAC,EAAA,SAAS,EAAE,aAAa,KAAA,IAAA,IAAb,aAAa,KAAb,SAAA,GAAA,SAAA,GAAA,aAAa,CAAE,OAAO,EAAE,OAAO,EAAC,iBAAiB,IACtE,KAAK,CACM,CACG,CACpB;YACA,OAAO,KACNA,cAAA,CAAA,aAAA,CAAC,SAAS,EAAA,EAAA,GACJ,WAAW,EACf,KAAK,EAAE,IAAI,EACX,SAAS,EAAE,aAAa,KAAA,IAAA,IAAb,aAAa,KAAA,SAAA,GAAA,SAAA,GAAb,aAAa,CAAE,MAAM,EAChC,OAAO,EAAE,YAAY,EAAA,CACrB,CACH;AACA,YAAA,OAAO,IAAI,MAAM,KAChBA,cAAC,CAAA,aAAA,CAAA,QAAQ,EACH,EAAA,GAAA,WAAW,EACf,KAAK,EAAE,IAAI,EACX,SAAS,EAAE,aAAa,KAAA,IAAA,IAAb,aAAa,KAAA,SAAA,GAAA,SAAA,GAAb,aAAa,CAAE,IAAI,EAC9B,OAAO,EAAE,UAAU,EACnB,CAAA,CACH,CACO,CACA;AAEhB;;;;"}
1
+ {"version":3,"file":"View.js","sources":["../../../src/components/View/View.tsx"],"sourcesContent":["import React, { useCallback } from 'react';\n\nimport { useHover } from '../../hooks';\nimport { colors } from '../../theme/modules/colors';\n\nimport { ViewProps, ViewTypes } from './types';\n\nimport {\n Container,\n Contour,\n CounterContainer,\n CounterText,\n CustomIconWrapper,\n IconStyling,\n Text,\n} from './styled';\nimport { buildClassnames } from '../../utils/buildClassnames';\nimport { CrossIcon } from '../../tempIcons/CrossIcon';\nimport { EditIcon } from '../../tempIcons/EditIcon';\n\nexport interface ClassNamesReturnPayload {\n delete?: string;\n options?: string;\n edit?: string;\n container?: string;\n active?: string;\n counter?: string;\n}\n\nconst generateClassNames = (prefix?: string): ClassNamesReturnPayload => ({\n delete: prefix ? `${prefix}-delete` : undefined,\n options: prefix ? `${prefix}-options` : undefined,\n edit: prefix ? `${prefix}-edit` : undefined,\n container: prefix ? `${prefix}-container` : undefined,\n active: prefix ? `${prefix}-active` : undefined,\n counter: prefix ? `${prefix}-counter` : undefined,\n});\n\n/**\n *\n * @deprecated\n *\n * use ViewTab component instead\n *\n */\nexport const View = ({\n id,\n iconSlot,\n name,\n type,\n className,\n colourPalette = colors.secondary.blue,\n customTextColour,\n count,\n active = false,\n onClick,\n onDelete,\n onEdit,\n e2eClassName,\n}: ViewProps) => {\n const classNames = generateClassNames(className);\n const e2eClassNames = generateClassNames(e2eClassName);\n const [isHovered, handleEnter, handleLeave] = useHover();\n\n const handleClick = useCallback(() => onClick(id), [id, onClick]);\n const handleDelete = useCallback(\n (event) => {\n event.stopPropagation();\n if (onDelete) onDelete(id);\n },\n [onDelete, id],\n );\n const handleEdit = useCallback(\n (event) => {\n event.stopPropagation();\n if (onEdit) onEdit(id);\n },\n [onEdit, id],\n );\n\n const isDraft = type === ViewTypes.draft;\n const isSaved = type === ViewTypes.saved;\n const fill = active ? colors.neutral.ink.dark : colors.neutral.ink.base;\n\n return (\n <Container\n className={`${buildClassnames([classNames?.container, e2eClassNames?.container])} ${\n (active && e2eClassNames?.active) || ''\n }`}\n onClick={handleClick}\n >\n <Contour\n active={active}\n onMouseEnter={handleEnter}\n onMouseLeave={handleLeave}\n colourPalette={colourPalette}\n customTextColour={customTextColour}\n >\n {iconSlot && <CustomIconWrapper>{iconSlot}</CustomIconWrapper>}\n <Text variant=\"bodyBold\">{name}</Text>\n {count && (\n <CounterContainer\n active={active || isHovered}\n colourPalette={colourPalette}\n customTextColour={customTextColour}\n >\n <CounterText className={e2eClassNames?.counter} variant=\"subheadingSmall\">\n {count}\n </CounterText>\n </CounterContainer>\n )}\n {isDraft && (\n <CrossIcon\n {...IconStyling}\n color={fill}\n className={e2eClassNames?.delete}\n onClick={handleDelete}\n />\n )}\n {isSaved && active && (\n <EditIcon\n {...IconStyling}\n color={fill}\n className={e2eClassNames?.edit}\n onClick={handleEdit}\n />\n )}\n </Contour>\n </Container>\n );\n};\n"],"names":["React"],"mappings":";;;;;;;;;;;;;AA6BA,MAAM,kBAAkB,GAAG,CAAC,MAAe,MAA+B;IACxE,MAAM,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAS,OAAA,CAAA,GAAG,SAAS;IAC/C,OAAO,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAU,QAAA,CAAA,GAAG,SAAS;IACjD,IAAI,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAO,KAAA,CAAA,GAAG,SAAS;IAC3C,SAAS,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAY,UAAA,CAAA,GAAG,SAAS;IACrD,MAAM,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAS,OAAA,CAAA,GAAG,SAAS;IAC/C,OAAO,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAU,QAAA,CAAA,GAAG,SAAS;AAClD,CAAA,CAAC;AAEF;;;;;;AAMG;AACU,MAAA,IAAI,GAAG,CAAC,EACnB,EAAE,EACF,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,aAAa,GAAG,MAAM,CAAC,SAAS,CAAC,IAAI,EACrC,gBAAgB,EAChB,KAAK,EACL,MAAM,GAAG,KAAK,EACd,OAAO,EACP,QAAQ,EACR,MAAM,EACN,YAAY,GACF,KAAI;AACd,IAAA,MAAM,UAAU,GAAG,kBA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9B,OAAO,EAAE,UAAU,EACnB,CAAA,CACH,CACO,CACA;AAEhB;;;;"}
@@ -5,6 +5,7 @@ require('../../hooks/useFocusVisible.cjs');
5
5
  var useHover = require('../../hooks/useHover.cjs');
6
6
  var buildClassnames = require('../../utils/buildClassnames.cjs');
7
7
  require('uid/secure');
8
+ require('lodash.throttle');
8
9
  var colors = require('../../theme/modules/colors.cjs');
9
10
  var types = require('./types.cjs');
10
11
  var styled = require('./styled.cjs');
@@ -1 +1 @@
1
- {"version":3,"file":"ViewTab.cjs","sources":["../../../src/components/ViewTab/ViewTab.tsx"],"sourcesContent":["import React, { Ref } from 'react';\n\nimport { useHover } from '../../hooks';\nimport { colors } from '../../theme/modules/colors';\n\nimport { ViewTabProps, ViewTabTypes } from './types';\n\nimport {\n Contour,\n CounterContainer,\n CounterText,\n CrossIconStyling,\n CustomIconWrapper,\n IconStyling,\n Text,\n ThreeDotsIconStyling,\n ViewButton,\n} from './styled';\nimport { buildClassnames } from '../../utils/buildClassnames';\n\nexport interface ClassNamesReturnPayload {\n delete?: string;\n edit?: string;\n container?: string;\n active?: string;\n counter?: string;\n}\n\nconst generateClassNames = (prefix?: string): ClassNamesReturnPayload => ({\n delete: prefix ? `${prefix}-delete` : undefined,\n edit: prefix ? `${prefix}-edit` : undefined,\n container: prefix ? `${prefix}-view` : undefined,\n active: prefix ? `${prefix}-active` : undefined,\n counter: prefix ? `${prefix}-counter` : undefined,\n});\n\nexport const ViewTab = React.forwardRef<HTMLButtonElement, ViewTabProps>(\n (\n {\n id,\n iconSlot,\n name,\n type,\n className,\n colourPalette = colors.secondary.blue,\n customTextColour,\n count,\n active = false,\n onClick,\n subAction,\n ariaContext,\n ...props\n }: ViewTabProps,\n ref: Ref<HTMLButtonElement>,\n ) => {\n const classNames = generateClassNames(className);\n const [isHovered, handleEnter, handleLeave] = useHover();\n\n const action = active && subAction ? subAction : onClick;\n const handleAction = () => action(id);\n\n const isDraft = type === ViewTabTypes.draft;\n const isSaved = type === ViewTabTypes.saved;\n\n const getLabelAction = () => {\n if (active && isDraft) return 'Delete';\n if (active && isSaved) return 'Edit';\n return '';\n };\n\n return (\n <ViewButton\n className={buildClassnames([classNames?.container])}\n onClick={handleAction}\n role=\"tab\"\n aria-selected={active}\n aria-label={`${getLabelAction()} ${name} view ${\n count ? `with ${count} ${ariaContext}` : ''\n }`}\n customTextColour={customTextColour}\n ref={ref}\n {...props}\n >\n <Contour\n active={active}\n onMouseEnter={handleEnter}\n onMouseLeave={handleLeave}\n colourPalette={colourPalette}\n customTextColour={customTextColour}\n >\n {iconSlot && <CustomIconWrapper>{iconSlot}</CustomIconWrapper>}\n <Text variant=\"bodyBold\">{name}</Text>\n {count !== undefined && count !== null && (\n <CounterContainer\n data-testid=\"countContainer\"\n active={active || isHovered}\n colourPalette={colourPalette}\n customTextColour={customTextColour}\n >\n <CounterText variant=\"subheadingSmall\">{count}</CounterText>\n </CounterContainer>\n )}\n {isDraft && <CrossIconStyling {...IconStyling} aria-label=\"delete icon\" />}\n {isSaved && active && <ThreeDotsIconStyling {...IconStyling} aria-label=\"edit icon\" />}\n </Contour>\n </ViewButton>\n );\n },\n);\n"],"names":["React","colors","useHover","ViewTabTypes","ViewButton","buildClassnames","Contour","CustomIconWrapper","Text","CounterContainer","CounterText","CrossIconStyling","IconStyling","ThreeDotsIconStyling"],"mappings":";;;;;;;;;;;;;;;;AA4BA,MAAM,kBAAkB,GAAG,CAAC,MAAe,MAA+B;IACxE,MAAM,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAS,OAAA,CAAA,GAAG,SAAS;IAC/C,IAAI,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAO,KAAA,CAAA,GAAG,SAAS;IAC3C,SAAS,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAO,KAAA,CAAA,GAAG,SAAS;IAChD,MAAM,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAS,OAAA,CAAA,GAAG,SAAS;IAC/C,OAAO,EAAE,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ref } from 'react';\n\nimport { useHover } from '../../hooks';\nimport { colors } from '../../theme/modules/colors';\n\nimport { ViewTabProps, ViewTabTypes } from './types';\n\nimport {\n Contour,\n CounterContainer,\n CounterText,\n CrossIconStyling,\n CustomIconWrapper,\n IconStyling,\n Text,\n ThreeDotsIconStyling,\n ViewButton,\n} from './styled';\nimport { buildClassnames } from '../../utils/buildClassnames';\n\nexport interface ClassNamesReturnPayload {\n delete?: string;\n edit?: string;\n container?: string;\n active?: string;\n counter?: string;\n}\n\nconst generateClassNames = (prefix?: string): ClassNamesReturnPayload => ({\n delete: prefix ? `${prefix}-delete` : undefined,\n edit: prefix ? `${prefix}-edit` : undefined,\n container: prefix ? `${prefix}-view` : undefined,\n active: prefix ? `${prefix}-active` : undefined,\n counter: prefix ? `${prefix}-counter` : undefined,\n});\n\nexport const ViewTab = React.forwardRef<HTMLButtonElement, ViewTabProps>(\n (\n {\n id,\n iconSlot,\n name,\n type,\n className,\n colourPalette = colors.secondary.blue,\n customTextColour,\n count,\n active = false,\n onClick,\n subAction,\n ariaContext,\n ...props\n }: ViewTabProps,\n ref: Ref<HTMLButtonElement>,\n ) => {\n const classNames = generateClassNames(className);\n const [isHovered, handleEnter, handleLeave] = useHover();\n\n const action = active && subAction ? subAction : onClick;\n const handleAction = () => action(id);\n\n const isDraft = type === ViewTabTypes.draft;\n const isSaved = type === ViewTabTypes.saved;\n\n const getLabelAction = () => {\n if (active && isDraft) return 'Delete';\n if (active && isSaved) return 'Edit';\n return '';\n };\n\n return (\n <ViewButton\n className={buildClassnames([classNames?.container])}\n onClick={handleAction}\n role=\"tab\"\n aria-selected={active}\n aria-label={`${getLabelAction()} ${name} view ${\n count ? `with ${count} ${ariaContext}` : ''\n }`}\n customTextColour={customTextColour}\n ref={ref}\n {...props}\n >\n <Contour\n active={active}\n onMouseEnter={handleEnter}\n onMouseLeave={handleLeave}\n colourPalette={colourPalette}\n customTextColour={customTextColour}\n >\n {iconSlot && <CustomIconWrapper>{iconSlot}</CustomIconWrapper>}\n <Text variant=\"bodyBold\">{name}</Text>\n {count !== undefined && count !== null && (\n <CounterContainer\n data-testid=\"countContainer\"\n active={active || isHovered}\n colourPalette={colourPalette}\n customTextColour={customTextColour}\n >\n <CounterText variant=\"subheadingSmall\">{count}</CounterText>\n </CounterContainer>\n )}\n {isDraft && <CrossIconStyling {...IconStyling} aria-label=\"delete icon\" />}\n {isSaved && active && <ThreeDotsIconStyling {...IconStyling} aria-label=\"edit icon\" />}\n </Contour>\n </ViewButton>\n );\n },\n);\n"],"names":["React","colors","useHover","ViewTabTypes","ViewButton","buildClassnames","Contour","CustomIconWrapper","Text","CounterContainer","CounterText","CrossIconStyling","IconStyling","ThreeDotsIconStyling"],"mappings":";;;;;;;;;;;;;;;;;AA4BA,MAAM,kBAAkB,GAAG,CAAC,MAAe,MAA+B;IACxE,MAAM,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAS,OAAA,CAAA,GAAG,SAAS;IAC/C,IAAI,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAO,KAAA,CAAA,GAAG,SAAS;IAC3C,SAAS,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAO,KAAA,CAAA,GAAG,SAAS;IAChD,MAAM,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAS,OAAA,CAAA,GAAG,SAAS;IAC/C,OAAO,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAU,QAAA,CAAA,GAAG,SAAS;AAClD,CAAA,CAAC;MAEW,OAAO,GAAGA,sBAAK,CAAC,UAAU,CACrC,CACE,EACE,EAAE,EACF,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,aAAa,GAAGC,aAAM,CAAC,SAAS,CAAC,IAAI,EACrC,gBAAgB,EAChB,KAAK,EACL,MAAM,GAAG,KAAK,EACd,OAAO,EACP,SAAS,EACT,WAAW,EACX,GAAG,KAAK,EACK,EACf,GAA2B,KACzB;AACF,IAAA,MAAM,UAAU,GAAG,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