@dxc-technology/halstack-react 0.0.0-22220e6 → 0.0.0-2289057

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 (342) hide show
  1. package/BackgroundColorContext.d.ts +1 -10
  2. package/BackgroundColorContext.js +5 -22
  3. package/HalstackContext.d.ts +1249 -0
  4. package/HalstackContext.js +310 -0
  5. package/README.md +47 -0
  6. package/accordion/Accordion.d.ts +1 -1
  7. package/accordion/Accordion.js +116 -181
  8. package/accordion/Accordion.stories.tsx +103 -127
  9. package/accordion/Accordion.test.js +32 -33
  10. package/accordion/types.d.ts +9 -16
  11. package/accordion-group/AccordionGroup.d.ts +5 -4
  12. package/accordion-group/AccordionGroup.js +38 -107
  13. package/accordion-group/AccordionGroup.stories.tsx +95 -68
  14. package/accordion-group/AccordionGroup.test.js +55 -90
  15. package/accordion-group/AccordionGroupAccordion.d.ts +4 -0
  16. package/accordion-group/AccordionGroupAccordion.js +31 -0
  17. package/accordion-group/types.d.ts +15 -16
  18. package/action-icon/ActionIcon.d.ts +4 -0
  19. package/action-icon/ActionIcon.js +47 -0
  20. package/action-icon/ActionIcon.stories.tsx +41 -0
  21. package/action-icon/ActionIcon.test.js +64 -0
  22. package/action-icon/types.d.ts +26 -0
  23. package/alert/Alert.js +23 -59
  24. package/alert/Alert.stories.tsx +28 -0
  25. package/alert/Alert.test.js +29 -46
  26. package/alert/types.d.ts +5 -5
  27. package/badge/Badge.d.ts +1 -1
  28. package/badge/Badge.js +141 -41
  29. package/badge/Badge.stories.tsx +210 -0
  30. package/badge/Badge.test.js +30 -0
  31. package/badge/types.d.ts +52 -2
  32. package/bleed/Bleed.js +14 -55
  33. package/bleed/Bleed.stories.tsx +95 -95
  34. package/bleed/types.d.ts +26 -2
  35. package/box/Box.d.ts +1 -1
  36. package/box/Box.js +30 -81
  37. package/box/Box.stories.tsx +38 -51
  38. package/box/Box.test.js +2 -7
  39. package/box/types.d.ts +3 -14
  40. package/bulleted-list/BulletedList.d.ts +7 -0
  41. package/bulleted-list/BulletedList.js +89 -0
  42. package/bulleted-list/BulletedList.stories.tsx +115 -0
  43. package/bulleted-list/types.d.ts +38 -0
  44. package/button/Button.d.ts +1 -1
  45. package/button/Button.js +62 -113
  46. package/button/Button.stories.tsx +160 -90
  47. package/button/Button.test.js +20 -17
  48. package/button/types.d.ts +12 -8
  49. package/card/Card.d.ts +1 -1
  50. package/card/Card.js +58 -102
  51. package/card/Card.stories.tsx +12 -42
  52. package/card/Card.test.js +11 -22
  53. package/card/types.d.ts +6 -11
  54. package/checkbox/Checkbox.d.ts +2 -2
  55. package/checkbox/Checkbox.js +144 -182
  56. package/checkbox/Checkbox.stories.tsx +166 -136
  57. package/checkbox/Checkbox.test.js +163 -29
  58. package/checkbox/types.d.ts +18 -6
  59. package/chip/Chip.js +39 -79
  60. package/chip/Chip.stories.tsx +121 -26
  61. package/chip/Chip.test.js +16 -31
  62. package/chip/types.d.ts +4 -4
  63. package/common/OpenSans.css +68 -80
  64. package/common/coreTokens.d.ts +237 -0
  65. package/common/coreTokens.js +184 -0
  66. package/common/utils.d.ts +1 -0
  67. package/common/utils.js +6 -12
  68. package/common/variables.d.ts +1395 -0
  69. package/common/variables.js +1030 -1136
  70. package/container/Container.d.ts +4 -0
  71. package/container/Container.js +194 -0
  72. package/container/Container.stories.tsx +214 -0
  73. package/container/types.d.ts +74 -0
  74. package/contextual-menu/ContextualMenu.d.ts +7 -0
  75. package/contextual-menu/ContextualMenu.js +71 -0
  76. package/contextual-menu/ContextualMenu.stories.tsx +182 -0
  77. package/contextual-menu/ContextualMenu.test.js +71 -0
  78. package/contextual-menu/MenuItemAction.d.ts +4 -0
  79. package/contextual-menu/MenuItemAction.js +46 -0
  80. package/contextual-menu/types.d.ts +22 -0
  81. package/date-input/Calendar.d.ts +4 -0
  82. package/date-input/Calendar.js +214 -0
  83. package/date-input/DateInput.js +171 -306
  84. package/date-input/DateInput.stories.tsx +203 -56
  85. package/date-input/DateInput.test.js +708 -369
  86. package/date-input/DatePicker.d.ts +4 -0
  87. package/date-input/DatePicker.js +115 -0
  88. package/date-input/Icons.d.ts +6 -0
  89. package/date-input/Icons.js +58 -0
  90. package/date-input/YearPicker.d.ts +4 -0
  91. package/date-input/YearPicker.js +100 -0
  92. package/date-input/types.d.ts +86 -22
  93. package/dialog/Dialog.d.ts +1 -1
  94. package/dialog/Dialog.js +68 -130
  95. package/dialog/Dialog.stories.tsx +320 -167
  96. package/dialog/Dialog.test.js +287 -20
  97. package/dialog/types.d.ts +18 -25
  98. package/dropdown/Dropdown.d.ts +1 -1
  99. package/dropdown/Dropdown.js +248 -307
  100. package/dropdown/Dropdown.stories.tsx +245 -56
  101. package/dropdown/Dropdown.test.js +575 -165
  102. package/dropdown/DropdownMenu.d.ts +4 -0
  103. package/dropdown/DropdownMenu.js +63 -0
  104. package/dropdown/DropdownMenuItem.d.ts +4 -0
  105. package/dropdown/DropdownMenuItem.js +67 -0
  106. package/dropdown/types.d.ts +32 -14
  107. package/file-input/FileInput.d.ts +2 -2
  108. package/file-input/FileInput.js +246 -357
  109. package/file-input/FileInput.stories.tsx +123 -12
  110. package/file-input/FileInput.test.js +369 -367
  111. package/file-input/FileItem.d.ts +4 -14
  112. package/file-input/FileItem.js +50 -99
  113. package/file-input/types.d.ts +25 -8
  114. package/flex/Flex.d.ts +4 -0
  115. package/flex/Flex.js +57 -0
  116. package/flex/Flex.stories.tsx +112 -0
  117. package/flex/types.d.ts +97 -0
  118. package/footer/Footer.d.ts +1 -1
  119. package/footer/Footer.js +70 -190
  120. package/footer/Footer.stories.tsx +60 -19
  121. package/footer/Footer.test.js +33 -57
  122. package/footer/Icons.d.ts +3 -2
  123. package/footer/Icons.js +67 -8
  124. package/footer/types.d.ts +25 -26
  125. package/grid/Grid.d.ts +7 -0
  126. package/grid/Grid.js +76 -0
  127. package/grid/Grid.stories.tsx +219 -0
  128. package/grid/types.d.ts +115 -0
  129. package/header/Header.d.ts +4 -3
  130. package/header/Header.js +99 -203
  131. package/header/Header.stories.tsx +152 -63
  132. package/header/Header.test.js +31 -28
  133. package/header/Icons.d.ts +2 -2
  134. package/header/Icons.js +4 -9
  135. package/header/types.d.ts +5 -19
  136. package/heading/Heading.js +10 -32
  137. package/heading/Heading.test.js +71 -88
  138. package/heading/types.d.ts +7 -7
  139. package/image/Image.d.ts +4 -0
  140. package/image/Image.js +70 -0
  141. package/image/Image.stories.tsx +129 -0
  142. package/image/types.d.ts +72 -0
  143. package/image/types.js +5 -0
  144. package/inset/Inset.js +14 -55
  145. package/inset/Inset.stories.tsx +37 -36
  146. package/inset/types.d.ts +26 -2
  147. package/layout/ApplicationLayout.d.ts +16 -6
  148. package/layout/ApplicationLayout.js +84 -181
  149. package/layout/ApplicationLayout.stories.tsx +85 -94
  150. package/layout/Icons.d.ts +8 -0
  151. package/layout/Icons.js +51 -48
  152. package/layout/SidenavContext.d.ts +5 -0
  153. package/layout/SidenavContext.js +13 -0
  154. package/layout/types.d.ts +19 -35
  155. package/link/Link.d.ts +3 -2
  156. package/link/Link.js +61 -99
  157. package/link/Link.stories.tsx +155 -53
  158. package/link/Link.test.js +25 -53
  159. package/link/types.d.ts +15 -31
  160. package/main.d.ts +15 -13
  161. package/main.js +72 -101
  162. package/nav-tabs/NavTabs.d.ts +8 -0
  163. package/nav-tabs/NavTabs.js +93 -0
  164. package/nav-tabs/NavTabs.stories.tsx +276 -0
  165. package/nav-tabs/NavTabs.test.js +76 -0
  166. package/nav-tabs/Tab.d.ts +4 -0
  167. package/nav-tabs/Tab.js +118 -0
  168. package/nav-tabs/types.d.ts +52 -0
  169. package/nav-tabs/types.js +5 -0
  170. package/number-input/NumberInput.d.ts +7 -0
  171. package/number-input/NumberInput.js +48 -45
  172. package/number-input/NumberInput.stories.tsx +44 -28
  173. package/number-input/NumberInput.test.js +862 -381
  174. package/number-input/types.d.ts +28 -15
  175. package/package.json +46 -47
  176. package/paginator/Icons.d.ts +5 -0
  177. package/paginator/Icons.js +21 -47
  178. package/paginator/Paginator.js +34 -91
  179. package/paginator/Paginator.stories.tsx +24 -0
  180. package/paginator/Paginator.test.js +280 -211
  181. package/paginator/types.d.ts +3 -3
  182. package/paragraph/Paragraph.d.ts +5 -0
  183. package/paragraph/Paragraph.js +22 -0
  184. package/paragraph/Paragraph.stories.tsx +27 -0
  185. package/password-input/Icons.d.ts +6 -0
  186. package/password-input/Icons.js +35 -0
  187. package/password-input/PasswordInput.js +57 -123
  188. package/password-input/PasswordInput.stories.tsx +1 -33
  189. package/password-input/PasswordInput.test.js +162 -147
  190. package/password-input/types.d.ts +21 -17
  191. package/progress-bar/ProgressBar.js +65 -91
  192. package/progress-bar/ProgressBar.stories.tsx +93 -0
  193. package/progress-bar/ProgressBar.test.js +72 -44
  194. package/progress-bar/types.d.ts +3 -3
  195. package/quick-nav/QuickNav.d.ts +4 -0
  196. package/quick-nav/QuickNav.js +94 -0
  197. package/quick-nav/QuickNav.stories.tsx +356 -0
  198. package/quick-nav/types.d.ts +21 -0
  199. package/quick-nav/types.js +5 -0
  200. package/radio-group/Radio.d.ts +1 -1
  201. package/radio-group/Radio.js +59 -76
  202. package/radio-group/RadioGroup.js +72 -116
  203. package/radio-group/RadioGroup.stories.tsx +135 -17
  204. package/radio-group/RadioGroup.test.js +529 -467
  205. package/radio-group/types.d.ts +86 -9
  206. package/resultset-table/Icons.d.ts +7 -0
  207. package/resultset-table/Icons.js +47 -0
  208. package/resultset-table/ResultsetTable.d.ts +7 -0
  209. package/resultset-table/ResultsetTable.js +166 -0
  210. package/{resultsetTable → resultset-table}/ResultsetTable.stories.tsx +152 -30
  211. package/resultset-table/ResultsetTable.test.js +371 -0
  212. package/{resultsetTable → resultset-table}/types.d.ts +13 -7
  213. package/resultset-table/types.js +5 -0
  214. package/select/Icons.d.ts +7 -7
  215. package/select/Icons.js +1 -5
  216. package/select/Listbox.d.ts +4 -0
  217. package/select/Listbox.js +143 -0
  218. package/select/Option.js +27 -50
  219. package/select/Select.js +212 -362
  220. package/select/Select.stories.tsx +534 -145
  221. package/select/Select.test.js +2009 -1539
  222. package/select/types.d.ts +53 -27
  223. package/sidenav/Icons.d.ts +7 -0
  224. package/sidenav/Icons.js +47 -0
  225. package/sidenav/Sidenav.d.ts +6 -5
  226. package/sidenav/Sidenav.js +131 -71
  227. package/sidenav/Sidenav.stories.tsx +251 -151
  228. package/sidenav/Sidenav.test.js +26 -45
  229. package/sidenav/types.d.ts +52 -26
  230. package/slider/Slider.d.ts +2 -2
  231. package/slider/Slider.js +148 -180
  232. package/slider/Slider.test.js +198 -73
  233. package/slider/types.d.ts +11 -3
  234. package/spinner/Spinner.js +31 -75
  235. package/spinner/{Spinner.stories.jsx → Spinner.stories.tsx} +53 -27
  236. package/spinner/Spinner.test.js +26 -35
  237. package/spinner/types.d.ts +3 -3
  238. package/status-light/StatusLight.d.ts +4 -0
  239. package/status-light/StatusLight.js +51 -0
  240. package/status-light/StatusLight.stories.tsx +74 -0
  241. package/status-light/StatusLight.test.js +25 -0
  242. package/status-light/types.d.ts +17 -0
  243. package/status-light/types.js +5 -0
  244. package/switch/Switch.d.ts +2 -2
  245. package/switch/Switch.js +149 -114
  246. package/switch/Switch.stories.tsx +44 -67
  247. package/switch/Switch.test.js +146 -39
  248. package/switch/types.d.ts +13 -5
  249. package/table/DropdownTheme.js +62 -0
  250. package/table/Table.d.ts +6 -2
  251. package/table/Table.js +87 -35
  252. package/table/Table.stories.tsx +658 -0
  253. package/table/Table.test.js +95 -8
  254. package/table/types.d.ts +48 -6
  255. package/tabs/Tab.d.ts +4 -0
  256. package/tabs/Tab.js +116 -0
  257. package/tabs/Tabs.d.ts +1 -1
  258. package/tabs/Tabs.js +316 -145
  259. package/tabs/Tabs.stories.tsx +120 -14
  260. package/tabs/Tabs.test.js +238 -67
  261. package/tabs/types.d.ts +29 -15
  262. package/tag/Tag.js +41 -78
  263. package/tag/Tag.stories.tsx +25 -8
  264. package/tag/Tag.test.js +20 -31
  265. package/tag/types.d.ts +7 -7
  266. package/text-input/Icons.d.ts +8 -0
  267. package/text-input/Icons.js +56 -0
  268. package/text-input/Suggestion.d.ts +4 -0
  269. package/text-input/Suggestion.js +67 -0
  270. package/text-input/Suggestions.d.ts +4 -0
  271. package/text-input/Suggestions.js +84 -0
  272. package/text-input/TextInput.js +325 -556
  273. package/text-input/TextInput.stories.tsx +272 -281
  274. package/text-input/TextInput.test.js +1442 -1377
  275. package/text-input/types.d.ts +70 -24
  276. package/textarea/Textarea.js +82 -134
  277. package/textarea/Textarea.stories.tsx +174 -0
  278. package/textarea/Textarea.test.js +168 -198
  279. package/textarea/types.d.ts +27 -16
  280. package/toggle-group/ToggleGroup.d.ts +2 -2
  281. package/toggle-group/ToggleGroup.js +92 -105
  282. package/toggle-group/ToggleGroup.stories.tsx +53 -8
  283. package/toggle-group/ToggleGroup.test.js +78 -66
  284. package/toggle-group/types.d.ts +34 -17
  285. package/typography/Typography.d.ts +4 -0
  286. package/typography/Typography.js +23 -0
  287. package/typography/Typography.stories.tsx +198 -0
  288. package/typography/types.d.ts +18 -0
  289. package/typography/types.js +5 -0
  290. package/useTheme.d.ts +1147 -1
  291. package/useTheme.js +4 -11
  292. package/useTranslatedLabels.d.ts +85 -0
  293. package/useTranslatedLabels.js +14 -0
  294. package/utils/BaseTypography.d.ts +21 -0
  295. package/utils/BaseTypography.js +94 -0
  296. package/utils/FocusLock.d.ts +13 -0
  297. package/utils/FocusLock.js +124 -0
  298. package/wizard/Wizard.d.ts +1 -1
  299. package/wizard/Wizard.js +70 -101
  300. package/wizard/Wizard.stories.tsx +48 -19
  301. package/wizard/Wizard.test.js +73 -87
  302. package/wizard/types.d.ts +12 -8
  303. package/ThemeContext.d.ts +0 -10
  304. package/ThemeContext.js +0 -243
  305. package/card/ice-cream.jpg +0 -0
  306. package/common/RequiredComponent.js +0 -32
  307. package/list/List.d.ts +0 -4
  308. package/list/List.js +0 -47
  309. package/list/List.stories.tsx +0 -95
  310. package/list/types.d.ts +0 -7
  311. package/number-input/NumberInputContext.d.ts +0 -4
  312. package/number-input/NumberInputContext.js +0 -19
  313. package/number-input/numberInputContextTypes.d.ts +0 -19
  314. package/progress-bar/ProgressBar.stories.jsx +0 -58
  315. package/radio/Radio.d.ts +0 -4
  316. package/radio/Radio.js +0 -174
  317. package/radio/Radio.stories.tsx +0 -192
  318. package/radio/Radio.test.js +0 -71
  319. package/radio/types.d.ts +0 -54
  320. package/resultsetTable/ResultsetTable.d.ts +0 -4
  321. package/resultsetTable/ResultsetTable.js +0 -254
  322. package/resultsetTable/ResultsetTable.test.js +0 -306
  323. package/row/Row.d.ts +0 -3
  324. package/row/Row.js +0 -127
  325. package/row/Row.stories.tsx +0 -237
  326. package/row/types.d.ts +0 -10
  327. package/slider/Slider.stories.tsx +0 -177
  328. package/stack/Stack.d.ts +0 -3
  329. package/stack/Stack.js +0 -97
  330. package/stack/Stack.stories.tsx +0 -164
  331. package/stack/types.d.ts +0 -9
  332. package/table/Table.stories.jsx +0 -277
  333. package/text/Text.d.ts +0 -7
  334. package/text/Text.js +0 -30
  335. package/text/Text.stories.tsx +0 -19
  336. package/textarea/Textarea.stories.jsx +0 -157
  337. /package/{list → action-icon}/types.js +0 -0
  338. /package/{radio → bulleted-list}/types.js +0 -0
  339. /package/{resultsetTable → container}/types.js +0 -0
  340. /package/{row → contextual-menu}/types.js +0 -0
  341. /package/{stack → flex}/types.js +0 -0
  342. /package/{number-input/numberInputContextTypes.js → grid/types.js} +0 -0
@@ -0,0 +1,182 @@
1
+ import React from "react";
2
+ import Title from "../../.storybook/components/Title";
3
+ import DxcContextualMenu from "./ContextualMenu";
4
+ import DxcContainer from "../container/Container";
5
+ import MenuItemAction from "./MenuItemAction";
6
+ import ExampleContainer from "../../.storybook/components/ExampleContainer";
7
+
8
+ export default {
9
+ title: "Contextual Menu",
10
+ component: DxcContextualMenu,
11
+ };
12
+
13
+ const key_icon = (
14
+ <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24" fill="currentColor">
15
+ <path d="M280-400q-33 0-56.5-23.5T200-480q0-33 23.5-56.5T280-560q33 0 56.5 23.5T360-480q0 33-23.5 56.5T280-400Zm0 160q-100 0-170-70T40-480q0-100 70-170t170-70q67 0 121.5 33t86.5 87h352l120 120-180 180-80-60-80 60-85-60h-47q-32 54-86.5 87T280-240Zm0-80q56 0 98.5-34t56.5-86h125l58 41 82-61 71 55 75-75-40-40H435q-14-52-56.5-86T280-640q-66 0-113 47t-47 113q0 66 47 113t113 47Z" />
16
+ </svg>
17
+ );
18
+
19
+ const fav_icon = (
20
+ <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24" fill="currentColor">
21
+ <path d="m480-120-58-52q-101-91-167-157T150-447.5Q111-500 95.5-544T80-634q0-94 63-157t157-63q52 0 99 22t81 62q34-40 81-62t99-22q94 0 157 63t63 157q0 46-15.5 90T810-447.5Q771-395 705-329T538-172l-58 52Zm0-108q96-86 158-147.5t98-107q36-45.5 50-81t14-70.5q0-60-40-100t-100-40q-47 0-87 26.5T518-680h-76q-15-41-55-67.5T300-774q-60 0-100 40t-40 100q0 35 14 70.5t50 81q36 45.5 98 107T480-228Zm0-273Z" />
22
+ </svg>
23
+ );
24
+
25
+ const items = [{ label: "Item 1" }, { label: "Item 2" }, { label: "Item 3" }, { label: "Item 4" }];
26
+
27
+ const sections = [
28
+ {
29
+ title: "Team repositories",
30
+ items: [{ label: "Approved locations" }, { label: "Approved locations" }, { label: "Approved locations" }],
31
+ },
32
+ {
33
+ items: [{ label: "Approved locations" }, { label: "Approved locations" }, { label: "Approved locations" }],
34
+ },
35
+ ];
36
+
37
+ const itemsWithIcon = [
38
+ {
39
+ label: "Item 1",
40
+ icon: key_icon,
41
+ },
42
+ {
43
+ label: "Item 2",
44
+ icon: fav_icon,
45
+ },
46
+ ];
47
+
48
+ const itemsWithSlot = [
49
+ {
50
+ label: "Item 1",
51
+ slot: <DxcContextualMenu.Badge color="green" label="New" />,
52
+ },
53
+ {
54
+ label: "Item 2",
55
+ slot: (
56
+ <svg width="12" height="12" viewBox="0 0 12 12" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
57
+ <path
58
+ d="M10.6667 10.6667H1.33333V1.33333H6V0H1.33333C0.593333 0 0 0.6 0 1.33333V10.6667C0 11.4 0.593333 12 1.33333 12H10.6667C11.4 12 12 11.4 12 10.6667V6H10.6667V10.6667ZM7.33333 0V1.33333H9.72667L3.17333 7.88667L4.11333 8.82667L10.6667 2.27333V4.66667H12V0H7.33333Z"
59
+ fill="#323232"
60
+ />
61
+ </svg>
62
+ ),
63
+ },
64
+ ];
65
+
66
+ const sectionsWithScroll = [
67
+ {
68
+ title: "Team repositories",
69
+ items: [{ label: "Approved locations" }, { label: "Approved locations" }, { label: "Approved locations" }],
70
+ },
71
+ {
72
+ items: [
73
+ { label: "Approved locations" },
74
+ { label: "Approved locations" },
75
+ { label: "Approved locations" },
76
+ { label: "Approved locations" },
77
+ { label: "Approved locations" },
78
+ { label: "Approved locations" },
79
+ { label: "Approved locations" },
80
+ { label: "Approved locations" },
81
+ { label: "Approved locations" },
82
+ ],
83
+ },
84
+ ];
85
+
86
+ const itemsWithTruncatedText = [
87
+ {
88
+ label: "Item with a very long label that should be truncated",
89
+ slot: <DxcContextualMenu.Badge color="green" label="New" />,
90
+ icon: key_icon,
91
+ },
92
+ {
93
+ label: "Item 2",
94
+ slot: (
95
+ <svg width="12" height="12" viewBox="0 0 12 12" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
96
+ <path
97
+ d="M10.6667 10.6667H1.33333V1.33333H6V0H1.33333C0.593333 0 0 0.6 0 1.33333V10.6667C0 11.4 0.593333 12 1.33333 12H10.6667C11.4 12 12 11.4 12 10.6667V6H10.6667V10.6667ZM7.33333 0V1.33333H9.72667L3.17333 7.88667L4.11333 8.82667L10.6667 2.27333V4.66667H12V0H7.33333Z"
98
+ fill="#323232"
99
+ />
100
+ </svg>
101
+ ),
102
+ icon: fav_icon,
103
+ },
104
+ ];
105
+
106
+ export const Chromatic = () => (
107
+ <>
108
+ <Title title="Default" theme="light" level={3} />
109
+ <ExampleContainer>
110
+ <DxcContextualMenu items={items} />
111
+ </ExampleContainer>
112
+ <Title title="With sections" theme="light" level={3} />
113
+ <ExampleContainer>
114
+ <DxcContainer width="300px">
115
+ <DxcContextualMenu items={sections} />
116
+ </DxcContainer>
117
+ </ExampleContainer>
118
+ <Title title="With icons" theme="light" level={3} />
119
+ <ExampleContainer>
120
+ <DxcContainer width="300px">
121
+ <DxcContextualMenu items={itemsWithIcon} defaultSelectedItemIndex={0} />
122
+ </DxcContainer>
123
+ </ExampleContainer>
124
+ <Title title="With slot" theme="light" level={3} />
125
+ <ExampleContainer>
126
+ <DxcContainer width="300px">
127
+ <DxcContextualMenu items={itemsWithSlot} />
128
+ </DxcContainer>
129
+ </ExampleContainer>
130
+ <Title title="With label truncated" theme="light" level={3} />
131
+ <ExampleContainer>
132
+ <DxcContainer width="300px">
133
+ <DxcContextualMenu items={itemsWithTruncatedText} />
134
+ </DxcContainer>
135
+ </ExampleContainer>
136
+ <Title title="With scroll" theme="light" level={3} />
137
+ <ExampleContainer>
138
+ <DxcContainer height="300px" width="300px">
139
+ <DxcContextualMenu items={sectionsWithScroll} />
140
+ </DxcContainer>
141
+ </ExampleContainer>
142
+ <Title title="Width doesn't go below 248px" theme="light" level={3} />
143
+ <ExampleContainer>
144
+ <DxcContainer width="200px">
145
+ <DxcContextualMenu items={items} />
146
+ </DxcContainer>
147
+ </ExampleContainer>
148
+ </>
149
+ );
150
+
151
+ export const MenuItemStates = () => (
152
+ <>
153
+ <Title title="Default" theme="light" level={3} />
154
+ <ExampleContainer>
155
+ <MenuItemAction {...items[0]} selected={false} />
156
+ </ExampleContainer>
157
+ <Title title="Focus" theme="light" level={3} />
158
+ <ExampleContainer pseudoState="pseudo-focus">
159
+ <MenuItemAction {...items[0]} selected={false} />
160
+ </ExampleContainer>
161
+ <Title title="Hover" theme="light" level={3} />
162
+ <ExampleContainer pseudoState="pseudo-hover">
163
+ <MenuItemAction {...items[0]} selected={false} />
164
+ </ExampleContainer>
165
+ <Title title="Active" theme="light" level={3} />
166
+ <ExampleContainer pseudoState="pseudo-active">
167
+ <MenuItemAction {...items[0]} selected={false} />
168
+ </ExampleContainer>
169
+ <Title title="Selected" theme="light" level={3} />
170
+ <ExampleContainer>
171
+ <MenuItemAction {...items[0]} selected />
172
+ </ExampleContainer>
173
+ <Title title="Selected hover" theme="light" level={3} />
174
+ <ExampleContainer pseudoState="pseudo-hover">
175
+ <MenuItemAction {...items[0]} selected />
176
+ </ExampleContainer>
177
+ <Title title="Selected active" theme="light" level={3} />
178
+ <ExampleContainer pseudoState="pseudo-active">
179
+ <MenuItemAction {...items[0]} selected />
180
+ </ExampleContainer>
181
+ </>
182
+ );
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _react = _interopRequireDefault(require("react"));
5
+ var _react2 = require("@testing-library/react");
6
+ var _ContextualMenu = _interopRequireDefault(require("./ContextualMenu.tsx"));
7
+ var items = [{
8
+ label: "Item 1"
9
+ }, {
10
+ label: "Item 2"
11
+ }, {
12
+ label: "Item 3"
13
+ }, {
14
+ label: "Item 4"
15
+ }];
16
+ var sections = [{
17
+ title: "Team repositories",
18
+ items: [{
19
+ label: "Approved locations"
20
+ }, {
21
+ label: "Approved locations"
22
+ }, {
23
+ label: "Approved locations"
24
+ }]
25
+ }, {
26
+ items: [{
27
+ label: "Approved locations"
28
+ }, {
29
+ label: "Approved locations"
30
+ }, {
31
+ label: "Approved locations"
32
+ }]
33
+ }];
34
+ describe("Context menu component tests", function () {
35
+ test("Context menu renders with correct aria attributes", function () {
36
+ var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ContextualMenu["default"], {
37
+ items: items,
38
+ defaultSelectedItemIndex: 0
39
+ })),
40
+ getAllByRole = _render.getAllByRole,
41
+ getByRole = _render.getByRole;
42
+ expect(getAllByRole("menuitem").length).toBe(4);
43
+ var actions = getAllByRole("button");
44
+ expect(actions[0].getAttribute("aria-selected")).toBeTruthy();
45
+ expect(getByRole("menu")).toBeTruthy();
46
+ });
47
+ test("Context menu (with sections) renders with correct aria attributes", function () {
48
+ var _render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ContextualMenu["default"], {
49
+ items: sections,
50
+ defaultSelectedItemIndex: 4
51
+ })),
52
+ getAllByRole = _render2.getAllByRole;
53
+ expect(getAllByRole("menuitem").length).toBe(6);
54
+ var actions = getAllByRole("button");
55
+ expect(actions[4].getAttribute("aria-selected")).toBeTruthy();
56
+ expect(getAllByRole("group").length).toBe(2);
57
+ });
58
+ test("onSelect event from each item is called correctly", function () {
59
+ var test = [{
60
+ label: "Tested item",
61
+ onSelect: jest.fn()
62
+ }];
63
+ var _render3 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ContextualMenu["default"], {
64
+ items: test
65
+ })),
66
+ getByRole = _render3.getByRole;
67
+ var item = getByRole("button");
68
+ _react2.fireEvent.click(item);
69
+ expect(test[0].onSelect).toHaveBeenCalled();
70
+ });
71
+ });
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { MenuItemActionProps } from "./types";
3
+ declare const _default: React.MemoExoticComponent<({ label, icon, slot, selected, onSelect }: MenuItemActionProps) => React.JSX.Element>;
4
+ export default _default;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports["default"] = void 0;
8
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
9
+ var _react = _interopRequireDefault(require("react"));
10
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
11
+ var _coreTokens = _interopRequireDefault(require("../common/coreTokens"));
12
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4;
13
+ var MenuItemAction = function MenuItemAction(_ref) {
14
+ var label = _ref.label,
15
+ icon = _ref.icon,
16
+ slot = _ref.slot,
17
+ selected = _ref.selected,
18
+ onSelect = _ref.onSelect;
19
+ return /*#__PURE__*/_react["default"].createElement(Action, {
20
+ "aria-selected": selected,
21
+ selected: selected,
22
+ onClick: function onClick() {
23
+ return onSelect();
24
+ }
25
+ }, /*#__PURE__*/_react["default"].createElement(Label, null, icon && /*#__PURE__*/_react["default"].createElement(Icon, {
26
+ "aria-hidden": true
27
+ }, typeof icon === "string" ? /*#__PURE__*/_react["default"].createElement("img", {
28
+ src: icon
29
+ }) : icon), /*#__PURE__*/_react["default"].createElement(Text, {
30
+ onMouseEnter: function onMouseEnter(event) {
31
+ var text = event.currentTarget;
32
+ if (text.title === "" && text.scrollWidth > text.clientWidth) text.title = label;
33
+ }
34
+ }, label)), slot);
35
+ };
36
+ var Action = _styledComponents["default"].button(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n border: none;\n border-radius: 4px;\n padding: ", " ", ";\n box-shadow: inset 0 0 0 2px transparent;\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: ", ";\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n line-height: 24px;\n ", ";\n cursor: pointer;\n overflow: hidden;\n\n &:hover {\n ", ";\n }\n &:active {\n ", ";\n }\n &:focus {\n outline: 2px solid ", ";\n outline-offset: -1px;\n }\n"])), _coreTokens["default"].spacing_4, _coreTokens["default"].spacing_8, _coreTokens["default"].spacing_16, _coreTokens["default"].color_grey_900, _coreTokens["default"].type_sans, _coreTokens["default"].type_scale_02, function (props) {
37
+ return props.selected ? "background-color: ".concat(_coreTokens["default"].color_purple_100, "; font-weight: ").concat(_coreTokens["default"].type_semibold, ";") : "background-color: ".concat(_coreTokens["default"].color_transparent);
38
+ }, function (props) {
39
+ return props.selected ? "background-color: ".concat(_coreTokens["default"].color_purple_200, ";") : "background-color: ".concat(_coreTokens["default"].color_grey_100, ";");
40
+ }, function (props) {
41
+ return props.selected ? "background-color: ".concat(_coreTokens["default"].color_purple_200, ";") : "background-color: ".concat(_coreTokens["default"].color_grey_100, ";");
42
+ }, _coreTokens["default"].color_blue_600);
43
+ var Label = _styledComponents["default"].span(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n gap: ", ";\n overflow: hidden;\n"])), _coreTokens["default"].spacing_8);
44
+ var Text = _styledComponents["default"].span(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n"])));
45
+ var Icon = _styledComponents["default"].span(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n justify-content: center;\n width: 16px;\n height: 16px;\n"])));
46
+ var _default = exports["default"] = /*#__PURE__*/_react["default"].memo(MenuItemAction);
@@ -0,0 +1,22 @@
1
+ /// <reference types="react" />
2
+ import { NotificationProps, CommonProps, ContextualProps } from "../badge/types";
3
+ type SVG = React.ReactNode & React.SVGProps<SVGSVGElement>;
4
+ export type Item = {
5
+ label: string;
6
+ icon?: string | SVG;
7
+ slot?: React.ReactNode;
8
+ onSelect?: () => void;
9
+ };
10
+ export type Section = {
11
+ title?: string;
12
+ items: Item[];
13
+ };
14
+ type Props = {
15
+ defaultSelectedItemIndex?: number;
16
+ items: Item[] | Section[];
17
+ };
18
+ export type MenuItemActionProps = Item & {
19
+ selected: boolean;
20
+ };
21
+ export type BadgeProps = (ContextualProps | NotificationProps) & Omit<CommonProps, "size">;
22
+ export default Props;
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { CalendarPropsType } from "./types";
3
+ declare const _default: React.MemoExoticComponent<({ selectedDate, innerDate, onInnerDateChange, onDaySelect, today, }: CalendarPropsType) => JSX.Element>;
4
+ export default _default;
@@ -0,0 +1,214 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = void 0;
9
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
10
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
+ var _react = _interopRequireWildcard(require("react"));
12
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
13
+ var _useTranslatedLabels = _interopRequireDefault(require("../useTranslatedLabels"));
14
+ var _Flex = _interopRequireDefault(require("../flex/Flex"));
15
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4;
16
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
17
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
18
+ var getDays = function getDays(innerDate) {
19
+ var monthDayCells = [];
20
+ var lastMonthNumberOfDays = innerDate.set("month", innerDate.get("month") - 1).endOf("month");
21
+ var firstDayOfMonth = innerDate.startOf("month").day() === 0 ? 6 : innerDate.startOf("month").day() - 1;
22
+ var daysInMonth = firstDayOfMonth + innerDate.daysInMonth();
23
+ for (var i = 0; i < 42; i++) {
24
+ if (i < firstDayOfMonth) {
25
+ monthDayCells.push({
26
+ day: lastMonthNumberOfDays.get("date") - firstDayOfMonth + i + 1,
27
+ month: innerDate.get("month") ? innerDate.get("month") - 1 : 11,
28
+ year: innerDate.set("month", innerDate.get("month") - 1).get("year")
29
+ });
30
+ } else if (i < daysInMonth) {
31
+ monthDayCells.push({
32
+ day: i - firstDayOfMonth + 1,
33
+ month: innerDate.get("month"),
34
+ year: innerDate.get("year")
35
+ });
36
+ } else {
37
+ monthDayCells.push({
38
+ day: i - daysInMonth + 1,
39
+ month: innerDate.get("month") === 11 ? 0 : innerDate.get("month") + 1,
40
+ year: innerDate.set("month", innerDate.get("month") + 1).get("year")
41
+ });
42
+ }
43
+ }
44
+ return monthDayCells;
45
+ };
46
+ var getDateToFocus = function getDateToFocus(selectedDate, innerDate, today) {
47
+ return (selectedDate === null || selectedDate === void 0 ? void 0 : selectedDate.get("month")) === innerDate.get("month") && (selectedDate === null || selectedDate === void 0 ? void 0 : selectedDate.get("year")) === innerDate.get("year") ? selectedDate : today.get("month") === innerDate.get("month") && today.get("year") === innerDate.get("year") ? today : innerDate.set("date", 1);
48
+ };
49
+ var isDaySelected = function isDaySelected(date, selectedDate) {
50
+ return (selectedDate === null || selectedDate === void 0 ? void 0 : selectedDate.get("month")) === date.month && (selectedDate === null || selectedDate === void 0 ? void 0 : selectedDate.get("year")) === date.year && (selectedDate === null || selectedDate === void 0 ? void 0 : selectedDate.get("date")) === date.day;
51
+ };
52
+ var Calendar = function Calendar(_ref) {
53
+ var selectedDate = _ref.selectedDate,
54
+ innerDate = _ref.innerDate,
55
+ onInnerDateChange = _ref.onInnerDateChange,
56
+ onDaySelect = _ref.onDaySelect,
57
+ today = _ref.today;
58
+ var _useState = (0, _react.useState)(getDateToFocus(selectedDate, innerDate, today)),
59
+ _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
60
+ dateToFocus = _useState2[0],
61
+ setDateToFocus = _useState2[1];
62
+ var _useState3 = (0, _react.useState)(false),
63
+ _useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
64
+ isFocusable = _useState4[0],
65
+ setIsFocusable = _useState4[1];
66
+ var dayCells = (0, _react.useMemo)(function () {
67
+ return getDays(innerDate);
68
+ }, [innerDate]);
69
+ var translatedLabels = (0, _useTranslatedLabels["default"])();
70
+ var weekDays = translatedLabels.calendar.daysShort;
71
+ var onDateClickHandler = function onDateClickHandler(date) {
72
+ var newDate = innerDate.set("month", date.month).set("date", date.day);
73
+ onDaySelect(newDate);
74
+ setDateToFocus(newDate);
75
+ };
76
+ var handleOnBlur = function handleOnBlur(event) {
77
+ if (!(event !== null && event !== void 0 && event.currentTarget.contains(event.relatedTarget))) {
78
+ setDateToFocus(getDateToFocus(selectedDate, innerDate, today));
79
+ }
80
+ };
81
+ var focusDate = function focusDate(date) {
82
+ if (innerDate.get("month") !== date.get("month") || innerDate.get("year") !== date.get("year")) {
83
+ onInnerDateChange(date);
84
+ }
85
+ setDateToFocus(date);
86
+ setIsFocusable(true);
87
+ };
88
+ (0, _react.useEffect)(function () {
89
+ if (isFocusable) {
90
+ var _document$getElementB;
91
+ (_document$getElementB = document.getElementById("day_".concat(dateToFocus.get("date"), "_month").concat(dateToFocus.get("month")))) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.focus();
92
+ setIsFocusable(false);
93
+ }
94
+ }, [dateToFocus, isFocusable]);
95
+ (0, _react.useEffect)(function () {
96
+ if (dateToFocus.get("month") !== innerDate.get("month") || dateToFocus.get("year") !== innerDate.get("year")) {
97
+ setDateToFocus(getDateToFocus(selectedDate, innerDate, today));
98
+ }
99
+ }, [innerDate, dateToFocus, selectedDate, today]);
100
+ var handleDayKeyboardEvent = function handleDayKeyboardEvent(event, date) {
101
+ var dateToFocusTemp = date.month === innerDate.get("month") ? innerDate.set("date", date.day) : innerDate.set("date", date.day).set("month", date.month);
102
+ switch (event.key) {
103
+ case "PageUp":
104
+ event.preventDefault();
105
+ event.shiftKey ? dateToFocusTemp = dateToFocusTemp.set("year", dateToFocusTemp.get("year") - 1) : dateToFocusTemp = dateToFocusTemp.set("month", dateToFocusTemp.get("month") - 1);
106
+ focusDate(dateToFocusTemp);
107
+ break;
108
+ case "PageDown":
109
+ event.preventDefault();
110
+ event.shiftKey ? dateToFocusTemp = dateToFocusTemp.set("year", dateToFocusTemp.get("year") + 1) : dateToFocusTemp = dateToFocusTemp.set("month", dateToFocusTemp.get("month") + 1);
111
+ focusDate(dateToFocusTemp);
112
+ break;
113
+ case "ArrowLeft":
114
+ event.preventDefault();
115
+ dateToFocusTemp = dateToFocusTemp.set("date", dateToFocusTemp.get("date") - 1);
116
+ focusDate(dateToFocusTemp);
117
+ break;
118
+ case "ArrowRight":
119
+ event.preventDefault();
120
+ dateToFocusTemp = dateToFocusTemp.set("date", dateToFocusTemp.get("date") + 1);
121
+ focusDate(dateToFocusTemp);
122
+ break;
123
+ case "ArrowUp":
124
+ event.preventDefault();
125
+ dateToFocusTemp = dateToFocusTemp.set("date", dateToFocusTemp.get("date") - 7);
126
+ focusDate(dateToFocusTemp);
127
+ break;
128
+ case "ArrowDown":
129
+ event.preventDefault();
130
+ dateToFocusTemp = dateToFocusTemp.set("date", dateToFocusTemp.get("date") + 7);
131
+ focusDate(dateToFocusTemp);
132
+ break;
133
+ case "Home":
134
+ event.preventDefault();
135
+ dateToFocus.get("day") !== 0 ? dateToFocusTemp = dateToFocusTemp.day(1) : dateToFocusTemp = innerDate.date(date.day - 1).day(1);
136
+ focusDate(dateToFocusTemp);
137
+ break;
138
+ case "End":
139
+ event.preventDefault();
140
+ dateToFocusTemp.get("day") !== 0 && (dateToFocusTemp = dateToFocusTemp.day(7));
141
+ focusDate(dateToFocusTemp);
142
+ break;
143
+ case " ":
144
+ event.preventDefault();
145
+ onDaySelect(dateToFocusTemp);
146
+ break;
147
+ }
148
+ };
149
+ return /*#__PURE__*/_react["default"].createElement(CalendarContainer, null, /*#__PURE__*/_react["default"].createElement(_Flex["default"], {
150
+ alignItems: "center",
151
+ justifyContent: "space-between"
152
+ }, weekDays.map(function (weekDay) {
153
+ return /*#__PURE__*/_react["default"].createElement(WeekHeaderCell, {
154
+ key: weekDay
155
+ }, weekDay);
156
+ })), /*#__PURE__*/_react["default"].createElement(DayCellsContainer, {
157
+ onBlur: handleOnBlur
158
+ }, dayCells.map(function (date, index) {
159
+ return /*#__PURE__*/_react["default"].createElement(DayCell, {
160
+ onKeyDown: function onKeyDown(event) {
161
+ return handleDayKeyboardEvent(event, date);
162
+ },
163
+ "aria-label": date.day,
164
+ id: "day_".concat(date.day, "_month").concat(date.month),
165
+ key: "day_".concat(index),
166
+ onClick: function onClick() {
167
+ return onDateClickHandler(date);
168
+ },
169
+ selected: isDaySelected(date, selectedDate),
170
+ actualMonth: date.month === innerDate.get("month"),
171
+ autoFocus: date.day === dateToFocus.get("date") && date.month === dateToFocus.get("month"),
172
+ "aria-selected": isDaySelected(date, selectedDate),
173
+ tabIndex: date.day === dateToFocus.get("date") && date.month === dateToFocus.get("month") ? 0 : -1,
174
+ isCurrentDay: today.get("date") === date.day && today.get("month") === innerDate.get("month") && today.get("month") === date.month && today.get("year") === innerDate.get("year")
175
+ }, date.day);
176
+ })));
177
+ };
178
+ var CalendarContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n justify-content: center;\n padding: 0px 8px 8px 8px;\n width: 292px;\n font-family: ", ";\n font-size: ", ";\n color: ", ";\n font-weight: ", ";\n"])), function (props) {
179
+ return props.theme.dateInput.pickerFontFamily;
180
+ }, function (props) {
181
+ return props.theme.dateInput.pickerFontSize;
182
+ }, function (props) {
183
+ return props.theme.dateInput.pickerFontColor;
184
+ }, function (props) {
185
+ return props.theme.dateInput.pickerFontWeight;
186
+ });
187
+ var WeekHeaderCell = _styledComponents["default"].span(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n justify-content: center;\n width: 36px;\n height: 36px;\n"])));
188
+ var DayCellsContainer = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n box-sizing: border-box;\n display: flex;\n gap: 4px;\n flex-wrap: wrap;\n justify-content: space-between;\n"])));
189
+ var DayCell = _styledComponents["default"].button(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n justify-content: center;\n align-items: center;\n width: 36px;\n height: 36px;\n padding: 0;\n border: none;\n border-radius: 50%;\n cursor: pointer;\n font-family: ", ";\n font-size: ", ";\n color: ", ";\n font-weight: ", ";\n\n &:focus {\n outline: ", " solid 2px;\n }\n &:hover {\n background-color: ", ";\n color: ", ";\n }\n &:active {\n background-color: ", ";\n color: ", ";\n }\n\n ", "\n background-color: ", ";\n color: ", ";\n"])), function (props) {
190
+ return props.theme.dateInput.pickerFontFamily;
191
+ }, function (props) {
192
+ return props.theme.dateInput.pickerFontSize;
193
+ }, function (props) {
194
+ return props.theme.dateInput.pickerFontColor;
195
+ }, function (props) {
196
+ return props.theme.dateInput.pickerFontWeight;
197
+ }, function (props) {
198
+ return props.theme.dateInput.pickerFocusColor;
199
+ }, function (props) {
200
+ return props.selected ? props.theme.dateInput.pickerSelectedBackgroundColor : props.theme.dateInput.pickerHoverBackgroundColor;
201
+ }, function (props) {
202
+ return props.selected ? props.theme.dateInput.pickerSelectedFontColor : props.theme.dateInput.pickerHoverFontColor;
203
+ }, function (props) {
204
+ return props.theme.dateInput.pickerActiveBackgroundColor;
205
+ }, function (props) {
206
+ return props.theme.dateInput.pickerActiveFontColor;
207
+ }, function (props) {
208
+ return props.isCurrentDay && !props.selected && "border: ".concat(props.theme.dateInput.pickerCurrentDateBorderWidth, " solid ").concat(props.theme.dateInput.pickerCurrentDateBorderColor, ";");
209
+ }, function (props) {
210
+ return props.selected ? props.theme.dateInput.pickerSelectedBackgroundColor : "transparent";
211
+ }, function (props) {
212
+ return props.selected ? props.theme.dateInput.pickerSelectedFontColor : props.isCurrentDay ? props.theme.dateInput.pickerCurrentDateFontColor : !props.actualMonth ? props.theme.dateInput.pickerNonCurrentMonthFontColor : props.theme.dateInput.pickerFontColor;
213
+ });
214
+ var _default = exports["default"] = /*#__PURE__*/_react["default"].memo(Calendar);