@pushwoosh/dumb-components 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (249) hide show
  1. package/ActionsGroup/ActionsGroup.d.ts +3 -0
  2. package/ActionsGroup/ActionsGroup.js +18 -0
  3. package/ActionsGroup/ActionsGroupItem.d.ts +3 -0
  4. package/ActionsGroup/ActionsGroupItem.js +12 -0
  5. package/ActionsGroup/index.d.ts +3 -0
  6. package/ActionsGroup/index.js +2 -0
  7. package/ActionsGroup/styles.d.ts +7 -0
  8. package/ActionsGroup/styles.js +22 -0
  9. package/ActionsGroup/types.d.ts +12 -0
  10. package/Badge/Badge.d.ts +3 -0
  11. package/Badge/Badge.js +16 -0
  12. package/Badge/index.d.ts +2 -0
  13. package/Badge/index.js +1 -0
  14. package/Badge/maps.d.ts +19 -0
  15. package/Badge/maps.js +19 -0
  16. package/Badge/styles.d.ts +5 -0
  17. package/Badge/styles.js +14 -0
  18. package/Badge/types.d.ts +8 -0
  19. package/Banner/Banner.d.ts +3 -0
  20. package/Banner/Banner.js +82 -0
  21. package/Banner/colors.d.ts +12 -0
  22. package/Banner/colors.js +115 -0
  23. package/Banner/index.d.ts +2 -0
  24. package/Banner/index.js +1 -0
  25. package/Banner/maps.d.ts +27 -0
  26. package/Banner/maps.js +19 -0
  27. package/Banner/styles.d.ts +29 -0
  28. package/Banner/styles.js +45 -0
  29. package/Banner/types.d.ts +20 -0
  30. package/Button/Button.d.ts +5 -0
  31. package/Button/Button.js +48 -0
  32. package/Button/GhostButton.d.ts +1 -0
  33. package/Button/GhostButton.js +5 -0
  34. package/Button/colors.d.ts +16 -0
  35. package/Button/colors.js +130 -0
  36. package/Button/index.d.ts +3 -0
  37. package/Button/index.js +2 -0
  38. package/Button/maps.d.ts +132 -0
  39. package/Button/maps.js +37 -0
  40. package/Button/styles.d.ts +120 -0
  41. package/Button/styles.js +103 -0
  42. package/Button/types.d.ts +26 -0
  43. package/CardMetric/CardChildren.d.ts +3 -0
  44. package/CardMetric/CardChildren.js +25 -0
  45. package/CardMetric/CardCollapse.d.ts +3 -0
  46. package/CardMetric/CardCollapse.js +13 -0
  47. package/CardMetric/CardMetric.d.ts +3 -0
  48. package/CardMetric/CardMetric.js +62 -0
  49. package/CardMetric/index.d.ts +2 -0
  50. package/CardMetric/index.js +1 -0
  51. package/CardMetric/styles.d.ts +13 -0
  52. package/CardMetric/styles.js +74 -0
  53. package/CardMetric/types.d.ts +34 -0
  54. package/Checkbox/Checkbox.d.ts +3 -0
  55. package/Checkbox/Checkbox.js +47 -0
  56. package/Checkbox/index.d.ts +2 -0
  57. package/Checkbox/index.js +1 -0
  58. package/Checkbox/maps.d.ts +3 -0
  59. package/Checkbox/maps.js +7 -0
  60. package/Checkbox/styles.d.ts +9 -0
  61. package/Checkbox/styles.js +17 -0
  62. package/Checkbox/types.d.ts +15 -0
  63. package/Drawer/Drawer.d.ts +3 -0
  64. package/Drawer/Drawer.js +62 -0
  65. package/Drawer/index.d.ts +1 -0
  66. package/Drawer/index.js +1 -0
  67. package/Drawer/maps.d.ts +6 -0
  68. package/Drawer/maps.js +6 -0
  69. package/Drawer/styles.d.ts +11 -0
  70. package/Drawer/styles.js +57 -0
  71. package/Drawer/types.d.ts +18 -0
  72. package/EditableField/EditableField.d.ts +3 -0
  73. package/EditableField/EditableField.js +61 -0
  74. package/EditableField/index.d.ts +2 -0
  75. package/EditableField/index.js +1 -0
  76. package/EditableField/styles.d.ts +8 -0
  77. package/EditableField/styles.js +25 -0
  78. package/EditableField/types.d.ts +15 -0
  79. package/EmailTemplatePreview/EmailTemplatePreview.d.ts +3 -11
  80. package/EmailTemplatePreview/EmailTemplatePreview.js +11 -10
  81. package/EmailTemplatePreview/components/NoEmailTemplatePreview/NoEmailTemplatePreview.d.ts +2 -2
  82. package/EmailTemplatePreview/components/NoEmailTemplatePreview/NoEmailTemplatePreview.js +3 -3
  83. package/EmailTemplatePreview/components/NoEmailTemplatePreview/assets/PW_logo.svg +1 -5
  84. package/EmailTemplatePreview/components/NoEmailTemplatePreview/{styled.js → styles.js} +2 -2
  85. package/EmailTemplatePreview/{styled.js → styles.js} +1 -1
  86. package/EmailTemplatePreview/types.d.ts +8 -0
  87. package/ExportResult/ExportResult.d.ts +2 -2
  88. package/ExportResult/ExportResult.js +10 -9
  89. package/ExportResult/{styled.js → styles.js} +5 -5
  90. package/FieldBox/FieldBox.d.ts +3 -3
  91. package/FieldBox/FieldBox.js +8 -7
  92. package/FieldBox/index.d.ts +1 -1
  93. package/FieldBox/types.js +1 -0
  94. package/NumberPicker/NumberPicker.js +2 -2
  95. package/NumberPicker/{AutosizeInput.d.ts → components/AutosizeInput/AutosizeInput.d.ts} +1 -1
  96. package/NumberPicker/{AutosizeInput.js → components/AutosizeInput/AutosizeInput.js} +3 -3
  97. package/NumberPicker/components/AutosizeInput/index.d.ts +1 -0
  98. package/NumberPicker/components/AutosizeInput/index.js +1 -0
  99. package/NumberPicker/{AutosizeInput.styled.js → components/AutosizeInput/styles.js} +1 -1
  100. package/NumberPicker/components/AutosizeInput/types.js +1 -0
  101. package/NumberPicker/{styled.js → styles.js} +3 -3
  102. package/Popover/Popover.d.ts +3 -0
  103. package/Popover/Popover.js +44 -0
  104. package/Popover/index.d.ts +4 -0
  105. package/Popover/index.js +2 -0
  106. package/Popover/styles.d.ts +6 -0
  107. package/Popover/styles.js +19 -0
  108. package/Popover/types.d.ts +12 -0
  109. package/Popover/types.js +1 -0
  110. package/ProgressBar/ProgressBar.d.ts +2 -2
  111. package/ProgressBar/ProgressBar.js +19 -16
  112. package/ProgressBar/{styled.js → styles.js} +10 -10
  113. package/PushPreview/PushPreview.js +3 -3
  114. package/PushPreview/{styled.js → styles.js} +8 -8
  115. package/Radio/Radio.d.ts +3 -0
  116. package/Radio/Radio.js +37 -0
  117. package/Radio/index.d.ts +2 -0
  118. package/Radio/index.js +1 -0
  119. package/Radio/maps.d.ts +3 -0
  120. package/Radio/maps.js +8 -0
  121. package/Radio/styled.d.ts +5 -0
  122. package/Radio/styled.js +13 -0
  123. package/Radio/types.d.ts +12 -0
  124. package/Radio/types.js +1 -0
  125. package/Spinner/Spinner.d.ts +3 -0
  126. package/Spinner/Spinner.js +20 -0
  127. package/Spinner/assets/index.d.ts +4 -0
  128. package/Spinner/assets/index.js +6 -0
  129. package/Spinner/assets/spinner.medium.svg +1 -0
  130. package/Spinner/assets/spinner.small.svg +1 -0
  131. package/Spinner/index.d.ts +2 -0
  132. package/Spinner/index.js +1 -0
  133. package/Spinner/maps.d.ts +5 -0
  134. package/Spinner/maps.js +5 -0
  135. package/Spinner/styles.d.ts +5 -0
  136. package/Spinner/styles.js +20 -0
  137. package/Spinner/types.d.ts +6 -0
  138. package/Spinner/types.js +1 -0
  139. package/StatisticCard/StatisticCard.d.ts +2 -2
  140. package/StatisticCard/StatisticCard.js +15 -14
  141. package/Tabs/{tab/tab.d.ts → components/Tab/Tab.d.ts} +2 -2
  142. package/Tabs/{tab/tab.js → components/Tab/Tab.js} +2 -2
  143. package/Tabs/components/Tab/index.d.ts +1 -0
  144. package/Tabs/components/Tab/index.js +1 -0
  145. package/Tabs/{tab/tab.types.d.ts → components/Tab/types.d.ts} +1 -1
  146. package/Tabs/components/Tab/types.js +1 -0
  147. package/Tabs/{tab-bar/tab-bar.js → components/TabBar/TabBar.js} +2 -2
  148. package/Tabs/components/TabBar/index.d.ts +1 -0
  149. package/Tabs/components/TabBar/index.js +1 -0
  150. package/Tabs/{tab-bar/tab-bar.styles.js → components/TabBar/styles.js} +2 -2
  151. package/Tabs/components/TabBar/types.js +1 -0
  152. package/Tabs/{tabs-list-slide-frame/tabs-list-slide-frame.d.ts → components/TabBarScrollableFrame/TabBarScrollableFrame.d.ts} +1 -1
  153. package/Tabs/{tabs-list-slide-frame/tabs-list-slide-frame.js → components/TabBarScrollableFrame/TabBarScrollableFrame.js} +2 -2
  154. package/Tabs/components/TabBarScrollableFrame/index.d.ts +1 -0
  155. package/Tabs/components/TabBarScrollableFrame/index.js +1 -0
  156. package/Tabs/{tabs-list-slide-frame/tabs-list-slide-frame.styles.js → components/TabBarScrollableFrame/styles.js} +5 -5
  157. package/Tabs/components/TabBarScrollableFrame/types.js +1 -0
  158. package/Tabs/{tab-base/tab-base.js → components/TabBase/TabBase.js} +1 -1
  159. package/Tabs/components/TabBase/index.d.ts +1 -0
  160. package/Tabs/components/TabBase/index.js +1 -0
  161. package/Tabs/{tab-base/tab-base.styles.js → components/TabBase/styles.js} +4 -4
  162. package/Tabs/components/TabBase/types.js +1 -0
  163. package/Tabs/{tab-panel/tab-panel.d.ts → components/TabPanel/TabPanel.d.ts} +1 -1
  164. package/Tabs/{tab-panel/tab-panel.js → components/TabPanel/TabPanel.js} +1 -1
  165. package/Tabs/components/TabPanel/index.d.ts +1 -0
  166. package/Tabs/components/TabPanel/index.js +1 -0
  167. package/Tabs/{tab-panel → components/TabPanel}/styles.js +1 -1
  168. package/Tabs/{tab-panel/tab-panel.types.d.ts → components/TabPanel/types.d.ts} +1 -1
  169. package/Tabs/components/TabPanel/types.js +1 -0
  170. package/Tabs/{tabs/tabs.d.ts → components/Tabs/Tabs.d.ts} +1 -1
  171. package/Tabs/{tabs/tabs.js → components/Tabs/Tabs.js} +1 -1
  172. package/Tabs/components/Tabs/index.d.ts +1 -0
  173. package/Tabs/components/Tabs/index.js +1 -0
  174. package/Tabs/{tabs → components/Tabs}/styles.js +1 -1
  175. package/Tabs/{tabs/tabs.types.d.ts → components/Tabs/types.d.ts} +1 -1
  176. package/Tabs/components/Tabs/types.js +1 -0
  177. package/Tabs/{tabs.context.d.ts → context.d.ts} +1 -1
  178. package/Tabs/index.d.ts +5 -5
  179. package/Tabs/index.js +4 -5
  180. package/Tabs/types.js +1 -0
  181. package/Tooltip/Tooltip.d.ts +3 -0
  182. package/Tooltip/Tooltip.js +47 -0
  183. package/Tooltip/index.d.ts +2 -0
  184. package/Tooltip/index.js +1 -0
  185. package/Tooltip/maps.d.ts +48 -0
  186. package/Tooltip/maps.js +161 -0
  187. package/Tooltip/styles.d.ts +5 -0
  188. package/Tooltip/styles.js +22 -0
  189. package/Tooltip/types.d.ts +14 -0
  190. package/Tooltip/types.js +1 -0
  191. package/hooks/index.d.ts +2 -0
  192. package/hooks/index.js +2 -0
  193. package/hooks/useElementWidth.d.ts +11 -0
  194. package/hooks/useElementWidth.js +27 -0
  195. package/hooks/useOnClickOutside.d.ts +4 -0
  196. package/hooks/useOnClickOutside.js +23 -0
  197. package/index.d.ts +14 -3
  198. package/index.js +12 -1
  199. package/package.json +6 -3
  200. package/Tabs/tab/index.d.ts +0 -2
  201. package/Tabs/tab/index.js +0 -2
  202. package/Tabs/tab-bar/index.d.ts +0 -2
  203. package/Tabs/tab-bar/index.js +0 -2
  204. package/Tabs/tab-base/index.d.ts +0 -3
  205. package/Tabs/tab-base/index.js +0 -3
  206. package/Tabs/tab-panel/index.d.ts +0 -2
  207. package/Tabs/tab-panel/index.js +0 -2
  208. package/Tabs/tabs/index.d.ts +0 -2
  209. package/Tabs/tabs/index.js +0 -2
  210. package/Tabs/tabs-list-slide-frame/index.d.ts +0 -3
  211. package/Tabs/tabs-list-slide-frame/index.js +0 -3
  212. package/{FieldBox/FieldBox.types.js → ActionsGroup/types.js} +0 -0
  213. package/{NumberPicker/AutosizeInput.types.js → Badge/types.js} +0 -0
  214. package/{Tabs/tab-bar/tab-bar.types.js → Banner/types.js} +0 -0
  215. package/{Tabs/tab-base/tab-base.types.js → Button/types.js} +0 -0
  216. package/{Tabs/tab-panel/tab-panel.types.js → CardMetric/types.js} +0 -0
  217. package/{Tabs/tab/tab.types.js → Checkbox/types.js} +0 -0
  218. package/{Tabs/tabs-list-slide-frame/tabs-list-slide-frame.types.js → Drawer/types.js} +0 -0
  219. package/{Tabs/tabs.types.js → EditableField/types.js} +0 -0
  220. package/EmailTemplatePreview/components/NoEmailTemplatePreview/{styled.d.ts → styles.d.ts} +0 -0
  221. package/EmailTemplatePreview/{styled.d.ts → styles.d.ts} +0 -0
  222. package/{Tabs/tabs/tabs.types.js → EmailTemplatePreview/types.js} +0 -0
  223. package/ExportResult/{styled.d.ts → styles.d.ts} +0 -0
  224. package/FieldBox/{FieldBox.types.d.ts → types.d.ts} +0 -0
  225. package/NumberPicker/{AutosizeInput.constants.d.ts → components/AutosizeInput/constants.d.ts} +0 -0
  226. package/NumberPicker/{AutosizeInput.constants.js → components/AutosizeInput/constants.js} +0 -0
  227. package/NumberPicker/{AutosizeInput.styled.d.ts → components/AutosizeInput/styles.d.ts} +0 -0
  228. package/NumberPicker/{AutosizeInput.types.d.ts → components/AutosizeInput/types.d.ts} +0 -0
  229. package/NumberPicker/{styled.d.ts → styles.d.ts} +0 -0
  230. package/ProgressBar/{styled.d.ts → styles.d.ts} +0 -0
  231. package/PushPreview/{constants/urls.d.ts → constants.d.ts} +0 -0
  232. package/PushPreview/{constants/urls.js → constants.js} +0 -0
  233. package/PushPreview/{helpers/helpers.d.ts → helpers.d.ts} +0 -0
  234. package/PushPreview/{helpers/helpers.js → helpers.js} +0 -0
  235. package/PushPreview/{styled.d.ts → styles.d.ts} +0 -0
  236. package/Tabs/{tab-bar/tab-bar.d.ts → components/TabBar/TabBar.d.ts} +0 -0
  237. package/Tabs/{tab-bar/tab-bar.styles.d.ts → components/TabBar/styles.d.ts} +0 -0
  238. package/Tabs/{tab-bar/tab-bar.types.d.ts → components/TabBar/types.d.ts} +0 -0
  239. package/Tabs/{tabs-list-slide-frame/tabs-list-slide-frame.styles.d.ts → components/TabBarScrollableFrame/styles.d.ts} +0 -0
  240. package/Tabs/{tabs-list-slide-frame/tabs-list-slide-frame.types.d.ts → components/TabBarScrollableFrame/types.d.ts} +0 -0
  241. package/Tabs/{tab-base/tab-base.d.ts → components/TabBase/TabBase.d.ts} +1 -1
  242. package/Tabs/{tab-base/tab-base.styles.d.ts → components/TabBase/styles.d.ts} +0 -0
  243. package/Tabs/{tab-base/tab-base.types.d.ts → components/TabBase/types.d.ts} +1 -1
  244. /package/Tabs/{tab-panel → components/TabPanel}/styles.d.ts +0 -0
  245. /package/Tabs/{tabs → components/Tabs}/styles.d.ts +0 -0
  246. /package/Tabs/{tabs.context.js → context.js} +0 -0
  247. /package/Tabs/{tabs.helpers.d.ts → helpers.d.ts} +0 -0
  248. /package/Tabs/{tabs.helpers.js → helpers.js} +0 -0
  249. /package/Tabs/{tabs.types.d.ts → types.d.ts} +0 -0
@@ -0,0 +1,130 @@
1
+ import { css } from 'styled-components';
2
+ import { Color } from '@pushwoosh/kit-constants';
3
+ export const colors = {
4
+ primary: {
5
+ shape: {
6
+ base: {
7
+ color: `var(--primary-shape-base-color, ${Color.CLEAR})`,
8
+ bgColor: `var(--primary-shape-base-bg-color, ${Color.PRIMARY})`
9
+ },
10
+ disabled: {
11
+ bgColor: `var(--primary-shape-disabled-bg-color, ${Color.LOCKED})`
12
+ },
13
+ hover: {
14
+ bgColor: `var(--primary-shape-hover-bg-color, ${Color.PRIMARY_HOVER})`
15
+ }
16
+ },
17
+ ghost: {
18
+ base: {
19
+ color: `var(--primary-ghost-base-color, ${Color.PRIMARY})`,
20
+ bgColor: 'var(--primary-ghost-base-bg-color, transparent)'
21
+ },
22
+ disabled: {
23
+ color: `var(--primary-ghost-disabled-color, ${Color.LOCKED})`
24
+ },
25
+ hover: {
26
+ color: `var(--primary-ghost-hover-color, ${Color.PRIMARY_HOVER})`,
27
+ bgColor: `var(--primary-ghost-hover-bg-color, ${Color.BRIGHT_LIGHT})`
28
+ }
29
+ }
30
+ },
31
+ secondary: {
32
+ shape: {
33
+ base: {
34
+ color: `var(--secondary-shape-base-color, ${Color.MAIN})`,
35
+ bgColor: `var(--secondary-shape-base-bg-color, ${Color.FROZEN})`,
36
+ borderColor: `var(--secondary-shape-base-border-color, ${Color.FORM})`
37
+ },
38
+ disabled: {
39
+ color: `var(--secondary-shape-disabled-color, ${Color.LOCKED})`
40
+ },
41
+ hover: {
42
+ color: `var(--secondary-shape-hover-color, ${Color.PRIMARY_HOVER})`,
43
+ bgColor: `var(--secondary-shape-hover-bg-color, ${Color.BRIGHT_LIGHT})`,
44
+ borderColor: 'var(--secondary-shape-hover-border-color, #005EFF24)'
45
+ }
46
+ },
47
+ ghost: {
48
+ base: {
49
+ color: `var(--secondary-ghost-base-color, ${Color.MAIN})`,
50
+ bgColor: 'var(--secondary-ghost-base-bg-color, transparent)'
51
+ },
52
+ disabled: {
53
+ color: `var(--secondary-ghost-disabled-color, ${Color.LOCKED})`
54
+ },
55
+ hover: {
56
+ color: `var(--secondary-ghost-hover-color, ${Color.PRIMARY_HOVER})`,
57
+ bgColor: `var(--secondary-ghost-hover-bg-color, ${Color.BRIGHT_LIGHT})`
58
+ }
59
+ }
60
+ },
61
+ danger: {
62
+ shape: {
63
+ base: {
64
+ color: `var(--danger-shape-base-color, ${Color.CLEAR})`,
65
+ bgColor: `var(--danger-shape-base-bg-color, ${Color.DANGER})`
66
+ },
67
+ disabled: {
68
+ color: `var(--danger-shape-disabled-color, ${Color.LOCKED})`
69
+ },
70
+ hover: {
71
+ bgColor: `var(--danger-shape-hover-bg-color, ${Color.DANGER_HOVER})`
72
+ }
73
+ },
74
+ ghost: {
75
+ base: {
76
+ color: `var(--danger-ghost-base-color, ${Color.DANGER})`,
77
+ bgColor: 'var(--danger-ghost-base-bg-color, transparent)'
78
+ },
79
+ disabled: {
80
+ color: `var(--danger-ghost-disabled-color, ${Color.LOCKED})`
81
+ },
82
+ hover: {
83
+ color: `var(--danger-ghost-hover-color, ${Color.DANGER_HOVER})`,
84
+ bgColor: `var(--danger-ghost-hover-bg-color, ${Color.DANGER_LIGHT})`
85
+ }
86
+ }
87
+ }
88
+ };
89
+ export function createColors(buttonColors) {
90
+ const base = {
91
+ borderColor: 'transparent',
92
+ ...buttonColors.base
93
+ };
94
+ const disabled = {
95
+ ...base,
96
+ ...buttonColors.disabled
97
+ };
98
+ const hover = {
99
+ ...base,
100
+ ...buttonColors.hover
101
+ };
102
+ const hoverCss = css(["&:hover:not([disabled]){color:", ";background-color:", ";border-color:", ";}"], hover.color, hover.bgColor, hover.borderColor);
103
+ return css(["color:", ";background-color:", ";border-color:", ";&:disabled{color:", ";background-color:", ";border-color:", ";}", " &:active:not([disabled]){color:", ";background-color:", ";border-color:", ";opacity:0.5;}"], ({
104
+ $isOpen,
105
+ $isDisabled
106
+ }) => {
107
+ if ($isOpen) {
108
+ return Color.CLEAR;
109
+ }
110
+ return $isDisabled ? disabled.color : base.color;
111
+ }, ({
112
+ $isOpen,
113
+ $isDisabled
114
+ }) => {
115
+ if ($isOpen) {
116
+ return Color.MAIN;
117
+ }
118
+ return $isDisabled ? disabled.color : base.bgColor;
119
+ }, ({
120
+ $isOpen,
121
+ $isDisabled
122
+ }) => {
123
+ if ($isOpen) {
124
+ return Color.MAIN;
125
+ }
126
+ return $isDisabled ? disabled.color : base.bgColor;
127
+ }, disabled.color, disabled.bgColor, disabled.borderColor, ({
128
+ $isOpen
129
+ }) => $isOpen ? '' : hoverCss /* sc-custom "display: none;" */, hover.color, hover.bgColor, hover.borderColor);
130
+ }
@@ -0,0 +1,3 @@
1
+ export { Button } from './Button';
2
+ export type { ButtonPropsWithoutAs, ButtonPropsWithAsTag, ButtonPropsWithAsComponent, RequiredButtonProps, } from './types';
3
+ export { GhostButton } from './GhostButton';
@@ -0,0 +1,2 @@
1
+ export { Button } from './Button';
2
+ export { GhostButton } from './GhostButton';
@@ -0,0 +1,132 @@
1
+ export declare const SpinnerSizeByButtonSizeMap: {
2
+ compact: "small";
3
+ field: "medium";
4
+ };
5
+ export declare const ButtonPropsToButtonBoxMap: {
6
+ readonly danger: {
7
+ readonly shape: {
8
+ readonly field: import("styled-components").StyledComponent<"button", any, {
9
+ $isDisabled?: boolean;
10
+ $isLoading?: boolean;
11
+ $isOpen?: boolean;
12
+ $hideContent?: boolean;
13
+ $hasLeftIcon?: boolean;
14
+ $hasRightIcon?: boolean;
15
+ $hasContent?: boolean;
16
+ }, never>;
17
+ readonly compact: import("styled-components").StyledComponent<"button", any, {
18
+ $isDisabled?: boolean;
19
+ $isLoading?: boolean;
20
+ $isOpen?: boolean;
21
+ $hideContent?: boolean;
22
+ $hasLeftIcon?: boolean;
23
+ $hasRightIcon?: boolean;
24
+ $hasContent?: boolean;
25
+ }, never>;
26
+ };
27
+ readonly ghost: {
28
+ readonly field: import("styled-components").StyledComponent<"button", any, {
29
+ $isDisabled?: boolean;
30
+ $isLoading?: boolean;
31
+ $isOpen?: boolean;
32
+ $hideContent?: boolean;
33
+ $hasLeftIcon?: boolean;
34
+ $hasRightIcon?: boolean;
35
+ $hasContent?: boolean;
36
+ }, never>;
37
+ readonly compact: import("styled-components").StyledComponent<"button", any, {
38
+ $isDisabled?: boolean;
39
+ $isLoading?: boolean;
40
+ $isOpen?: boolean;
41
+ $hideContent?: boolean;
42
+ $hasLeftIcon?: boolean;
43
+ $hasRightIcon?: boolean;
44
+ $hasContent?: boolean;
45
+ }, never>;
46
+ };
47
+ };
48
+ readonly primary: {
49
+ readonly shape: {
50
+ readonly field: import("styled-components").StyledComponent<"button", any, {
51
+ $isDisabled?: boolean;
52
+ $isLoading?: boolean;
53
+ $isOpen?: boolean;
54
+ $hideContent?: boolean;
55
+ $hasLeftIcon?: boolean;
56
+ $hasRightIcon?: boolean;
57
+ $hasContent?: boolean;
58
+ }, never>;
59
+ readonly compact: import("styled-components").StyledComponent<"button", any, {
60
+ $isDisabled?: boolean;
61
+ $isLoading?: boolean;
62
+ $isOpen?: boolean;
63
+ $hideContent?: boolean;
64
+ $hasLeftIcon?: boolean;
65
+ $hasRightIcon?: boolean;
66
+ $hasContent?: boolean;
67
+ }, never>;
68
+ };
69
+ readonly ghost: {
70
+ readonly field: import("styled-components").StyledComponent<"button", any, {
71
+ $isDisabled?: boolean;
72
+ $isLoading?: boolean;
73
+ $isOpen?: boolean;
74
+ $hideContent?: boolean;
75
+ $hasLeftIcon?: boolean;
76
+ $hasRightIcon?: boolean;
77
+ $hasContent?: boolean;
78
+ }, never>;
79
+ readonly compact: import("styled-components").StyledComponent<"button", any, {
80
+ $isDisabled?: boolean;
81
+ $isLoading?: boolean;
82
+ $isOpen?: boolean;
83
+ $hideContent?: boolean;
84
+ $hasLeftIcon?: boolean;
85
+ $hasRightIcon?: boolean;
86
+ $hasContent?: boolean;
87
+ }, never>;
88
+ };
89
+ };
90
+ readonly secondary: {
91
+ readonly shape: {
92
+ readonly field: import("styled-components").StyledComponent<"button", any, {
93
+ $isDisabled?: boolean;
94
+ $isLoading?: boolean;
95
+ $isOpen?: boolean;
96
+ $hideContent?: boolean;
97
+ $hasLeftIcon?: boolean;
98
+ $hasRightIcon?: boolean;
99
+ $hasContent?: boolean;
100
+ }, never>;
101
+ readonly compact: import("styled-components").StyledComponent<"button", any, {
102
+ $isDisabled?: boolean;
103
+ $isLoading?: boolean;
104
+ $isOpen?: boolean;
105
+ $hideContent?: boolean;
106
+ $hasLeftIcon?: boolean;
107
+ $hasRightIcon?: boolean;
108
+ $hasContent?: boolean;
109
+ }, never>;
110
+ };
111
+ readonly ghost: {
112
+ readonly field: import("styled-components").StyledComponent<"button", any, {
113
+ $isDisabled?: boolean;
114
+ $isLoading?: boolean;
115
+ $isOpen?: boolean;
116
+ $hideContent?: boolean;
117
+ $hasLeftIcon?: boolean;
118
+ $hasRightIcon?: boolean;
119
+ $hasContent?: boolean;
120
+ }, never>;
121
+ readonly compact: import("styled-components").StyledComponent<"button", any, {
122
+ $isDisabled?: boolean;
123
+ $isLoading?: boolean;
124
+ $isOpen?: boolean;
125
+ $hideContent?: boolean;
126
+ $hasLeftIcon?: boolean;
127
+ $hasRightIcon?: boolean;
128
+ $hasContent?: boolean;
129
+ }, never>;
130
+ };
131
+ };
132
+ };
package/Button/maps.js ADDED
@@ -0,0 +1,37 @@
1
+ import { ButtonBoxDangerShapeCompact, ButtonBoxDangerGhostCompact, ButtonBoxDangerShapeField, ButtonBoxDangerGhostField, ButtonBoxPrimaryShapeCompact, ButtonBoxPrimaryGhostCompact, ButtonBoxPrimaryShapeField, ButtonBoxPrimaryGhostField, ButtonBoxSecondaryShapeCompact, ButtonBoxSecondaryGhostCompact, ButtonBoxSecondaryShapeField, ButtonBoxSecondaryGhostField } from './styles';
2
+ export const SpinnerSizeByButtonSizeMap = {
3
+ compact: 'small',
4
+ field: 'medium'
5
+ };
6
+ export const ButtonPropsToButtonBoxMap = {
7
+ danger: {
8
+ shape: {
9
+ field: ButtonBoxDangerShapeField,
10
+ compact: ButtonBoxDangerShapeCompact
11
+ },
12
+ ghost: {
13
+ field: ButtonBoxDangerGhostField,
14
+ compact: ButtonBoxDangerGhostCompact
15
+ }
16
+ },
17
+ primary: {
18
+ shape: {
19
+ field: ButtonBoxPrimaryShapeField,
20
+ compact: ButtonBoxPrimaryShapeCompact
21
+ },
22
+ ghost: {
23
+ field: ButtonBoxPrimaryGhostField,
24
+ compact: ButtonBoxPrimaryGhostCompact
25
+ }
26
+ },
27
+ secondary: {
28
+ shape: {
29
+ field: ButtonBoxSecondaryShapeField,
30
+ compact: ButtonBoxSecondaryShapeCompact
31
+ },
32
+ ghost: {
33
+ field: ButtonBoxSecondaryGhostField,
34
+ compact: ButtonBoxSecondaryGhostCompact
35
+ }
36
+ }
37
+ };
@@ -0,0 +1,120 @@
1
+ export declare const ButtonIcon: import("styled-components").StyledComponent<"div", any, {}, never>;
2
+ export declare const ButtonContent: import("styled-components").StyledComponent<"div", any, {}, never>;
3
+ export declare const ButtonSpinner: import("styled-components").StyledComponent<"div", any, {}, never>;
4
+ export declare const ButtonBox: import("styled-components").StyledComponent<"button", any, {
5
+ $isDisabled?: boolean;
6
+ $isLoading?: boolean;
7
+ $isOpen?: boolean;
8
+ $hideContent?: boolean;
9
+ $hasLeftIcon?: boolean;
10
+ $hasRightIcon?: boolean;
11
+ $hasContent?: boolean;
12
+ }, never>;
13
+ export declare const ButtonBoxDangerGhostCompact: import("styled-components").StyledComponent<"button", any, {
14
+ $isDisabled?: boolean;
15
+ $isLoading?: boolean;
16
+ $isOpen?: boolean;
17
+ $hideContent?: boolean;
18
+ $hasLeftIcon?: boolean;
19
+ $hasRightIcon?: boolean;
20
+ $hasContent?: boolean;
21
+ }, never>;
22
+ export declare const ButtonBoxDangerGhostField: import("styled-components").StyledComponent<"button", any, {
23
+ $isDisabled?: boolean;
24
+ $isLoading?: boolean;
25
+ $isOpen?: boolean;
26
+ $hideContent?: boolean;
27
+ $hasLeftIcon?: boolean;
28
+ $hasRightIcon?: boolean;
29
+ $hasContent?: boolean;
30
+ }, never>;
31
+ export declare const ButtonBoxDangerShapeCompact: import("styled-components").StyledComponent<"button", any, {
32
+ $isDisabled?: boolean;
33
+ $isLoading?: boolean;
34
+ $isOpen?: boolean;
35
+ $hideContent?: boolean;
36
+ $hasLeftIcon?: boolean;
37
+ $hasRightIcon?: boolean;
38
+ $hasContent?: boolean;
39
+ }, never>;
40
+ export declare const ButtonBoxDangerShapeField: import("styled-components").StyledComponent<"button", any, {
41
+ $isDisabled?: boolean;
42
+ $isLoading?: boolean;
43
+ $isOpen?: boolean;
44
+ $hideContent?: boolean;
45
+ $hasLeftIcon?: boolean;
46
+ $hasRightIcon?: boolean;
47
+ $hasContent?: boolean;
48
+ }, never>;
49
+ export declare const ButtonBoxPrimaryShapeCompact: import("styled-components").StyledComponent<"button", any, {
50
+ $isDisabled?: boolean;
51
+ $isLoading?: boolean;
52
+ $isOpen?: boolean;
53
+ $hideContent?: boolean;
54
+ $hasLeftIcon?: boolean;
55
+ $hasRightIcon?: boolean;
56
+ $hasContent?: boolean;
57
+ }, never>;
58
+ export declare const ButtonBoxPrimaryShapeField: import("styled-components").StyledComponent<"button", any, {
59
+ $isDisabled?: boolean;
60
+ $isLoading?: boolean;
61
+ $isOpen?: boolean;
62
+ $hideContent?: boolean;
63
+ $hasLeftIcon?: boolean;
64
+ $hasRightIcon?: boolean;
65
+ $hasContent?: boolean;
66
+ }, never>;
67
+ export declare const ButtonBoxPrimaryGhostCompact: import("styled-components").StyledComponent<"button", any, {
68
+ $isDisabled?: boolean;
69
+ $isLoading?: boolean;
70
+ $isOpen?: boolean;
71
+ $hideContent?: boolean;
72
+ $hasLeftIcon?: boolean;
73
+ $hasRightIcon?: boolean;
74
+ $hasContent?: boolean;
75
+ }, never>;
76
+ export declare const ButtonBoxPrimaryGhostField: import("styled-components").StyledComponent<"button", any, {
77
+ $isDisabled?: boolean;
78
+ $isLoading?: boolean;
79
+ $isOpen?: boolean;
80
+ $hideContent?: boolean;
81
+ $hasLeftIcon?: boolean;
82
+ $hasRightIcon?: boolean;
83
+ $hasContent?: boolean;
84
+ }, never>;
85
+ export declare const ButtonBoxSecondaryGhostCompact: import("styled-components").StyledComponent<"button", any, {
86
+ $isDisabled?: boolean;
87
+ $isLoading?: boolean;
88
+ $isOpen?: boolean;
89
+ $hideContent?: boolean;
90
+ $hasLeftIcon?: boolean;
91
+ $hasRightIcon?: boolean;
92
+ $hasContent?: boolean;
93
+ }, never>;
94
+ export declare const ButtonBoxSecondaryGhostField: import("styled-components").StyledComponent<"button", any, {
95
+ $isDisabled?: boolean;
96
+ $isLoading?: boolean;
97
+ $isOpen?: boolean;
98
+ $hideContent?: boolean;
99
+ $hasLeftIcon?: boolean;
100
+ $hasRightIcon?: boolean;
101
+ $hasContent?: boolean;
102
+ }, never>;
103
+ export declare const ButtonBoxSecondaryShapeCompact: import("styled-components").StyledComponent<"button", any, {
104
+ $isDisabled?: boolean;
105
+ $isLoading?: boolean;
106
+ $isOpen?: boolean;
107
+ $hideContent?: boolean;
108
+ $hasLeftIcon?: boolean;
109
+ $hasRightIcon?: boolean;
110
+ $hasContent?: boolean;
111
+ }, never>;
112
+ export declare const ButtonBoxSecondaryShapeField: import("styled-components").StyledComponent<"button", any, {
113
+ $isDisabled?: boolean;
114
+ $isLoading?: boolean;
115
+ $isOpen?: boolean;
116
+ $hideContent?: boolean;
117
+ $hasLeftIcon?: boolean;
118
+ $hasRightIcon?: boolean;
119
+ $hasContent?: boolean;
120
+ }, never>;
@@ -0,0 +1,103 @@
1
+ import styled from 'styled-components';
2
+ import { Color, FontSize, LineHeight, Spacing, ShapeRadius, FontWeight, UnitSize } from '@pushwoosh/kit-constants';
3
+ import { colors, createColors } from './colors';
4
+ export const ButtonIcon = styled.div.withConfig({
5
+ displayName: "ButtonIcon",
6
+ componentId: "sc-qltvdl-0"
7
+ })(["flex:0 0 auto;"]);
8
+ export const ButtonContent = styled.div.withConfig({
9
+ displayName: "ButtonContent",
10
+ componentId: "sc-qltvdl-1"
11
+ })(["display:grid;justify-content:start;& > div{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}&:first-child{justify-content:center;}&:first-child:last-child{padding-left:", ";padding-right:", ";}&:last-child:not(:first-child){padding-right:", ";}"], Spacing.S2, Spacing.S2, Spacing.S2);
12
+ export const ButtonSpinner = styled.div.withConfig({
13
+ displayName: "ButtonSpinner",
14
+ componentId: "sc-qltvdl-2"
15
+ })(["position:absolute;top:0;left:0;right:0;bottom:0;display:flex;flex-wrap:nowrap;align-items:center;justify-content:center;"]);
16
+ export const ButtonBox = styled.button.withConfig({
17
+ displayName: "ButtonBox",
18
+ componentId: "sc-qltvdl-3"
19
+ })(["position:relative;display:inline-grid;grid-template-columns:", ";gap:", ";align-items:center;appearance:none !important;border:1px solid transparent;border-radius:", ";font-size:", ";line-height:", ";text-decoration:none;cursor:", ";user-select:none;&:hover{text-decoration:none;}&:focus{outline:none;}&:active{pointer-events:", ";}& ", "{opacity:", ";}"], props => `${props.$hasLeftIcon ? 'auto ' : ''}${props.$hasContent ? '1fr' : ''}${props.$hasRightIcon ? ' auto' : ''}`, Spacing.S1, ShapeRadius.CONTROL, FontSize.REGULAR, LineHeight.REGULAR, props => props.$isDisabled || props.$isLoading ? 'not-allowed!important' : 'pointer', props => props.$isDisabled || props.$isLoading ? 'none' : 'auto', /* sc-selector */ButtonContent, ({
20
+ $hideContent,
21
+ $isLoading
22
+ }) => {
23
+ if ($hideContent) {
24
+ return 0;
25
+ }
26
+ return $isLoading ? 0.5 : 1;
27
+ });
28
+ // danger ghost --------------
29
+ const dangerGhostColors = createColors(colors.danger.ghost);
30
+ export const ButtonBoxDangerGhostCompact = styled(ButtonBox).withConfig({
31
+ displayName: "ButtonBoxDangerGhostCompact",
32
+ componentId: "sc-qltvdl-4"
33
+ })(["height:16px;padding:0;font-size:", ";font-weight:", ";text-transform:uppercase;& ", "{padding:0;}& ", " + ", "{padding:0 0 0 ", ";}", ";--danger-ghost-hover-bg-color:transparent;"], FontSize.SMALL, FontWeight.BOLD, /* sc-selector */ButtonContent, /* sc-selector */ButtonIcon, /* sc-selector */ButtonContent, Spacing.S1, /* sc-custom "display: none;" */dangerGhostColors);
34
+ export const ButtonBoxDangerGhostField = styled(ButtonBox).withConfig({
35
+ displayName: "ButtonBoxDangerGhostField",
36
+ componentId: "sc-qltvdl-5"
37
+ })(["height:", ";padding:0 calc(", " - 1px);font-weight:", ";", ";"], UnitSize.FIELD_HEIGHT, Spacing.S2, FontWeight.MEDIUM, /* sc-custom "display: none;" */dangerGhostColors);
38
+ // danger shape --------------
39
+ const dangerShapeColors = createColors(colors.danger.shape);
40
+ export const ButtonBoxDangerShapeCompact = styled(ButtonBox).withConfig({
41
+ displayName: "ButtonBoxDangerShapeCompact",
42
+ componentId: "sc-qltvdl-6"
43
+ })(["height:28px;padding:0 calc(", " - 1px);font-size:", ";font-weight:", ";text-transform:uppercase;", ";"], Spacing.S2, FontSize.SMALL, FontWeight.BOLD, /* sc-custom "display: none;" */dangerShapeColors);
44
+ export const ButtonBoxDangerShapeField = styled(ButtonBox).withConfig({
45
+ displayName: "ButtonBoxDangerShapeField",
46
+ componentId: "sc-qltvdl-7"
47
+ })(["height:", ";padding:0 calc(", " - 1px);font-weight:", ";", ";"], UnitSize.FIELD_HEIGHT, Spacing.S2, FontWeight.MEDIUM, /* sc-custom "display: none;" */dangerShapeColors);
48
+ // primary shape --------------
49
+ const primaryShapeColors = createColors(colors.primary.shape);
50
+ export const ButtonBoxPrimaryShapeCompact = styled(ButtonBox).withConfig({
51
+ displayName: "ButtonBoxPrimaryShapeCompact",
52
+ componentId: "sc-qltvdl-8"
53
+ })(["height:28px;padding:0 calc(", " - 1px);font-size:", ";font-weight:", ";text-transform:uppercase;", ";"], Spacing.S2, FontSize.SMALL, FontWeight.BOLD, /* sc-custom "display: none;" */primaryShapeColors);
54
+ export const ButtonBoxPrimaryShapeField = styled(ButtonBox).withConfig({
55
+ displayName: "ButtonBoxPrimaryShapeField",
56
+ componentId: "sc-qltvdl-9"
57
+ })(["height:", ";padding:0 calc(", " - 1px);font-weight:", ";", ";"], UnitSize.FIELD_HEIGHT, Spacing.S2, FontWeight.MEDIUM, /* sc-custom "display: none;" */primaryShapeColors);
58
+ // primary ghost --------------
59
+ const primaryGhostColors = createColors(colors.primary.ghost);
60
+ export const ButtonBoxPrimaryGhostCompact = styled(ButtonBox).withConfig({
61
+ displayName: "ButtonBoxPrimaryGhostCompact",
62
+ componentId: "sc-qltvdl-10"
63
+ })(["height:16px;padding:0;font-size:", ";font-weight:", ";text-transform:uppercase;& ", "{padding:0;}& ", " + ", "{padding:0 0 0 ", ";}", ";--primary-ghost-hover-bg-color:transparent;"], FontSize.SMALL, FontWeight.BOLD, /* sc-selector */ButtonContent, /* sc-selector */ButtonIcon, /* sc-selector */ButtonContent, Spacing.S1, /* sc-custom "display: none;" */primaryGhostColors);
64
+ export const ButtonBoxPrimaryGhostField = styled(ButtonBox).withConfig({
65
+ displayName: "ButtonBoxPrimaryGhostField",
66
+ componentId: "sc-qltvdl-11"
67
+ })(["height:", ";padding:0 calc(", " - 1px);font-weight:", ";", ";"], UnitSize.FIELD_HEIGHT, Spacing.S2, FontWeight.MEDIUM, /* sc-custom "display: none;" */primaryGhostColors);
68
+ // secondary ghost --------------
69
+ const secondaryGhostColors = createColors(colors.secondary.ghost);
70
+ export const ButtonBoxSecondaryGhostCompact = styled(ButtonBox).withConfig({
71
+ displayName: "ButtonBoxSecondaryGhostCompact",
72
+ componentId: "sc-qltvdl-12"
73
+ })(["height:16px;padding:0;font-size:", ";font-weight:", ";text-transform:uppercase;& ", "{padding:0;}& ", " + ", "{padding:0 0 0 ", ";}", ";--secondary-ghost-base-color:", ";--secondary-ghost-hover-bg-color:transparent;"], FontSize.SMALL, FontWeight.BOLD, /* sc-selector */ButtonContent, /* sc-selector */ButtonIcon, /* sc-selector */ButtonContent, Spacing.S1, /* sc-custom "display: none;" */secondaryGhostColors, Color.SOFT);
74
+ export const ButtonBoxSecondaryGhostField = styled(ButtonBox).withConfig({
75
+ displayName: "ButtonBoxSecondaryGhostField",
76
+ componentId: "sc-qltvdl-13"
77
+ })(["height:", ";padding:0 calc(", " - 1px);font-weight:", ";", ";"], UnitSize.FIELD_HEIGHT, Spacing.S2, FontWeight.MEDIUM, /* sc-custom "display: none;" */secondaryGhostColors);
78
+ // secondary shape --------------
79
+ const secondaryShapeColors = createColors(colors.secondary.shape);
80
+ export const ButtonBoxSecondaryShapeCompact = styled(ButtonBox).withConfig({
81
+ displayName: "ButtonBoxSecondaryShapeCompact",
82
+ componentId: "sc-qltvdl-14"
83
+ })(["height:28px;padding:0 calc(", " - 1px);font-size:", ";font-weight:", ";text-transform:uppercase;", ";"], Spacing.S2, FontSize.SMALL, FontWeight.MEDIUM, /* sc-custom "display: none;" */secondaryShapeColors);
84
+ export const ButtonBoxSecondaryShapeField = styled(ButtonBox).withConfig({
85
+ displayName: "ButtonBoxSecondaryShapeField",
86
+ componentId: "sc-qltvdl-15"
87
+ })(["height:", ";padding:0 calc(", " - 1px);font-weight:", ";", ";"], UnitSize.FIELD_HEIGHT, Spacing.S2, FontWeight.MEDIUM, /* sc-custom "display: none;" */secondaryShapeColors);
88
+ ButtonBox.displayName = 'ButtonBox';
89
+ ButtonIcon.displayName = 'ButtonIcon';
90
+ ButtonContent.displayName = 'ButtonContent';
91
+ ButtonSpinner.displayName = 'ButtonSpinner';
92
+ ButtonBoxDangerGhostCompact.displayName = 'ButtonBoxDangerGhostCompact';
93
+ ButtonBoxDangerGhostField.displayName = 'ButtonBoxDangerGhostField';
94
+ ButtonBoxDangerShapeCompact.displayName = 'ButtonBoxDangerShapeCompact';
95
+ ButtonBoxDangerShapeField.displayName = 'ButtonBoxDangerShapeField';
96
+ ButtonBoxPrimaryGhostCompact.displayName = 'ButtonBoxPrimaryGhostCompact';
97
+ ButtonBoxPrimaryGhostField.displayName = 'ButtonBoxPrimaryGhostField';
98
+ ButtonBoxPrimaryShapeCompact.displayName = 'ButtonBoxPrimaryShapeCompact';
99
+ ButtonBoxPrimaryShapeField.displayName = 'ButtonBoxPrimaryShapeField';
100
+ ButtonBoxSecondaryGhostCompact.displayName = 'ButtonBoxSecondaryGhostCompact';
101
+ ButtonBoxSecondaryGhostField.displayName = 'ButtonBoxSecondaryGhostField';
102
+ ButtonBoxSecondaryShapeCompact.displayName = 'ButtonBoxSecondaryShapeCompact';
103
+ ButtonBoxSecondaryShapeField.displayName = 'ButtonBoxSecondaryShapeField';
@@ -0,0 +1,26 @@
1
+ import type { JSX, ReactNode, Ref, ComponentType } from 'react';
2
+ export type RequiredButtonProps = {
3
+ readonly boxRef?: any;
4
+ readonly color: 'primary' | 'secondary' | 'danger';
5
+ readonly size?: 'field' | 'compact';
6
+ readonly view?: 'shape' | 'ghost';
7
+ readonly className?: string;
8
+ readonly isDisabled?: boolean;
9
+ readonly isLoading?: boolean;
10
+ readonly isOpen?: boolean;
11
+ readonly icon?: ReactNode;
12
+ readonly rightIcon?: ReactNode;
13
+ readonly children?: ReactNode;
14
+ };
15
+ export type ButtonPropsWithoutAs = Omit<JSX.IntrinsicElements['button'], 'ref'> & RequiredButtonProps & {
16
+ readonly boxRef?: Ref<HTMLButtonElement>;
17
+ readonly type?: 'button' | 'submit';
18
+ };
19
+ export type ButtonPropsWithAsTag<AS extends keyof HTMLElementTagNameMap> = Omit<JSX.IntrinsicElements[AS], 'ref'> & RequiredButtonProps & {
20
+ readonly boxRef?: Ref<HTMLElementTagNameMap[AS]>;
21
+ readonly as?: AS;
22
+ };
23
+ export type ButtonPropsWithAsComponent<OuterProps extends object> = OuterProps & RequiredButtonProps & {
24
+ readonly boxRef?: Ref<HTMLElement>;
25
+ readonly as?: ComponentType<OuterProps>;
26
+ };
@@ -0,0 +1,3 @@
1
+ import { type ReactElement } from 'react';
2
+ import type { CardChildrenProps } from './types';
3
+ export declare function CardChildren(props: CardChildrenProps): ReactElement | null;
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ import { Spinner } from '../Spinner';
3
+ import { CardCollapse } from './CardCollapse';
4
+ export function CardChildren(props) {
5
+ const {
6
+ loading,
7
+ collapse,
8
+ isCollapsed,
9
+ children
10
+ } = props;
11
+ if (!children) {
12
+ return null;
13
+ }
14
+ if (loading) {
15
+ return React.createElement(Spinner, {
16
+ size: "medium"
17
+ });
18
+ }
19
+ if (collapse !== undefined) {
20
+ return React.createElement(CardCollapse, {
21
+ isCollapsed: isCollapsed
22
+ }, children);
23
+ }
24
+ return React.createElement(React.Fragment, null, children);
25
+ }
@@ -0,0 +1,3 @@
1
+ import { type ReactElement } from 'react';
2
+ import type { CollapseContainerProps } from './types';
3
+ export declare function CardCollapse(props: CollapseContainerProps): ReactElement;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { CollapseContainer, CollapseInner } from './styles';
3
+ export function CardCollapse(props) {
4
+ const {
5
+ children,
6
+ isCollapsed
7
+ } = props;
8
+ return React.createElement(CollapseContainer, {
9
+ isCollapsed: isCollapsed
10
+ }, React.createElement(CollapseInner, {
11
+ isCollapsed: isCollapsed
12
+ }, children));
13
+ }
@@ -0,0 +1,3 @@
1
+ import { type ReactElement } from 'react';
2
+ import type { CardMetricProps } from './types';
3
+ export declare function CardMetric(props: CardMetricProps): ReactElement;