@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
package/Radio/Radio.js ADDED
@@ -0,0 +1,37 @@
1
+ import React, { useState } from 'react';
2
+ import { NativeLabel, NativeRadio } from './styled';
3
+ // eslint-disable-next-line prefer-const
4
+ let counter = 0;
5
+ export function Radio(props) {
6
+ const {
7
+ label,
8
+ id,
9
+ name,
10
+ value,
11
+ color,
12
+ isChecked,
13
+ isDisabled,
14
+ onChange,
15
+ onBlur
16
+ } = props;
17
+ const [localId] = useState(() => {
18
+ if (id) {
19
+ return id;
20
+ }
21
+ const newCounter = counter + 1;
22
+ return `radio-id-${newCounter}`;
23
+ });
24
+ return React.createElement(NativeLabel, {
25
+ htmlFor: localId,
26
+ "$color": isDisabled ? 'locked' : color
27
+ }, React.createElement(NativeRadio, {
28
+ type: "radio",
29
+ id: localId,
30
+ value: value,
31
+ name: name,
32
+ checked: isChecked,
33
+ disabled: isDisabled,
34
+ onChange: event => onChange === null || onChange === void 0 ? void 0 : onChange(event.currentTarget.value),
35
+ onBlur: onBlur
36
+ }), label && React.createElement("span", null, label));
37
+ }
@@ -0,0 +1,2 @@
1
+ export { Radio } from './Radio';
2
+ export type { RadioProps } from './types';
package/Radio/index.js ADDED
@@ -0,0 +1 @@
1
+ export { Radio } from './Radio';
@@ -0,0 +1,3 @@
1
+ import { Color } from '@pushwoosh/kit-constants';
2
+ import type { RadioTextColor } from './types';
3
+ export declare const ColorMap: Record<RadioTextColor, Color>;
package/Radio/maps.js ADDED
@@ -0,0 +1,8 @@
1
+ import { Color } from '@pushwoosh/kit-constants';
2
+ export const ColorMap = {
3
+ main: Color.MAIN,
4
+ primary: Color.PRIMARY,
5
+ danger: Color.DANGER,
6
+ current: Color.CURRENT,
7
+ locked: Color.LOCKED
8
+ };
@@ -0,0 +1,5 @@
1
+ import type { RadioTextColor } from './types';
2
+ export declare const NativeRadio: import("styled-components").StyledComponent<"input", any, {}, never>;
3
+ export declare const NativeLabel: import("styled-components").StyledComponent<"label", any, {
4
+ $color?: RadioTextColor;
5
+ }, never>;
@@ -0,0 +1,13 @@
1
+ import styled from 'styled-components';
2
+ import { Color, Spacing, FontSize, LineHeight } from '@pushwoosh/kit-constants';
3
+ import { ColorMap } from './maps';
4
+ export const NativeRadio = styled.input.withConfig({
5
+ displayName: "NativeRadio",
6
+ componentId: "sc-154q01x-0"
7
+ })(["appearance:none;-webkit-appearance:none;-moz-appearance:none;width:20px;height:20px;border:2px solid ", ";border-radius:50%;background-color:", ";transition:border 0.1s,background-color 0.1s;cursor:pointer;&:focus{outline:none;}&[type=radio]:hover{border-color:", ";}&[type=radio]:disabled{cursor:not-allowed;border-color:", ";background-color:", ";}&[type=radio]:checked{border:6px solid ", ";}&[type=radio]:checked:hover{border-color:", ";}&[type=radio]:checked:disabled{border-color:", ";background-color:", ";}"], Color.PHANTOM, Color.CLEAR, Color.PRIMARY_HOVER, Color.LOCKED, Color.FROZEN, Color.PRIMARY, Color.PRIMARY_HOVER, Color.LOCKED, Color.FROZEN);
8
+ export const NativeLabel = styled.label.withConfig({
9
+ displayName: "NativeLabel",
10
+ componentId: "sc-154q01x-1"
11
+ })(["display:inline-flex;align-items:center;font-size:", ";line-height:", ";user-select:none;", " & > ", "{&:not(:last-child){margin-right:", ";}}"], FontSize.REGULAR, LineHeight.REGULAR, ({
12
+ $color
13
+ }) => $color && `color: ${ColorMap[$color]};`, NativeRadio, Spacing.S3);
@@ -0,0 +1,12 @@
1
+ export type RadioTextColor = 'main' | 'primary' | 'danger' | 'current' | 'locked';
2
+ export type RadioProps = {
3
+ label?: string;
4
+ id?: string;
5
+ name?: string;
6
+ value?: string;
7
+ color?: RadioTextColor;
8
+ isChecked?: boolean;
9
+ isDisabled?: boolean;
10
+ onChange?: (checked: string | number) => void;
11
+ onBlur?: () => void;
12
+ };
package/Radio/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import { type ReactElement } from 'react';
2
+ import { type SpinnerProps } from './types';
3
+ export declare function Spinner(props: SpinnerProps): ReactElement | null;
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import { AssetsMap } from './assets';
3
+ import { SpinnerBox, SpinnerAnimate } from './styles';
4
+ export function Spinner(props) {
5
+ const {
6
+ boxRef,
7
+ size,
8
+ ...rest
9
+ } = props;
10
+ const Icon = AssetsMap[size];
11
+ if (!Icon) {
12
+ console.error(`[Spinner]: incorrect size: ${size}!`);
13
+ return null;
14
+ }
15
+ return React.createElement(SpinnerBox, {
16
+ ...rest,
17
+ size: size,
18
+ ref: boxRef
19
+ }, React.createElement(SpinnerAnimate, null, React.createElement(Icon, null)));
20
+ }
@@ -0,0 +1,4 @@
1
+ export declare const AssetsMap: {
2
+ small: any;
3
+ medium: any;
4
+ };
@@ -0,0 +1,6 @@
1
+ import SpinnerMediumIcon from './spinner.medium.svg';
2
+ import SpinnerSmallIcon from './spinner.small.svg';
3
+ export const AssetsMap = {
4
+ small: SpinnerSmallIcon,
5
+ medium: SpinnerMediumIcon
6
+ };
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none"><circle cx="12" cy="12" r="7" stroke="#00A2FF" stroke-width="3" opacity=".2"/><path stroke="#00A2FF" stroke-linecap="round" stroke-width="3" d="M19 12a7 7 0 0 0-7-7"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none"><circle cx="8" cy="8" r="5" stroke="#00A2FF" stroke-width="2" opacity=".2"/><path stroke="#00A2FF" stroke-linecap="round" stroke-width="2" d="M13 8a5 5 0 0 0-5-5"/></svg>
@@ -0,0 +1,2 @@
1
+ export { Spinner } from './Spinner';
2
+ export type { SpinnerProps } from './types';
@@ -0,0 +1 @@
1
+ export { Spinner } from './Spinner';
@@ -0,0 +1,5 @@
1
+ import { UnitSize } from '@pushwoosh/kit-constants';
2
+ export declare const SizeInPxBySpinnerSizeMap: {
3
+ small: UnitSize;
4
+ medium: UnitSize;
5
+ };
@@ -0,0 +1,5 @@
1
+ import { UnitSize } from '@pushwoosh/kit-constants';
2
+ export const SizeInPxBySpinnerSizeMap = {
3
+ small: UnitSize.ICON_SMALL,
4
+ medium: UnitSize.ICON_MEDIUM
5
+ };
@@ -0,0 +1,5 @@
1
+ import type { SpinnerProps } from './types';
2
+ export declare const SpinnerBox: import("styled-components").StyledComponent<"div", any, {
3
+ size: SpinnerProps["size"];
4
+ }, never>;
5
+ export declare const SpinnerAnimate: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -0,0 +1,20 @@
1
+ import styled, { keyframes } from 'styled-components';
2
+ import { Color } from '@pushwoosh/kit-constants';
3
+ import { SizeInPxBySpinnerSizeMap } from './maps';
4
+ const rotate = keyframes(["from{transform:rotate(0deg);}to{transform:rotate(360deg);}"]);
5
+ export const SpinnerBox = styled.div.withConfig({
6
+ displayName: "SpinnerBox",
7
+ componentId: "sc-y39y31-0"
8
+ })(["width:", ";height:", ";color:", ";line-height:0;user-select:none;"], ({
9
+ size
10
+ }) => SizeInPxBySpinnerSizeMap[size], ({
11
+ size
12
+ }) => SizeInPxBySpinnerSizeMap[size], ({
13
+ color
14
+ }) => color || Color.CURRENT);
15
+ export const SpinnerAnimate = styled.div.withConfig({
16
+ displayName: "SpinnerAnimate",
17
+ componentId: "sc-y39y31-1"
18
+ })(["line-height:0;animation:", " 0.5s linear infinite;"], rotate);
19
+ SpinnerBox.displayName = 'SpinnerBox';
20
+ SpinnerAnimate.displayName = 'SpinnerAnimate';
@@ -0,0 +1,6 @@
1
+ import { type Ref } from 'react';
2
+ export interface SpinnerProps {
3
+ readonly boxRef?: Ref<HTMLDivElement>;
4
+ readonly color?: string;
5
+ readonly size: 'small' | 'medium';
6
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,3 +1,3 @@
1
- import React from 'react';
1
+ import { type ReactElement } from 'react';
2
2
  import { type StatisticCardProps } from './types';
3
- export declare const StatisticCard: ({ title, value, valueSubtext, footer, active, selectable, rightSlot, width, isLoading, onClick, ...rest }: StatisticCardProps) => React.JSX.Element;
3
+ export declare function StatisticCard(props: StatisticCardProps): ReactElement;
@@ -5,19 +5,20 @@ import { Spinner } from '@pushwoosh/kit-spinner';
5
5
  import { Container, RightSlotContainer, StatValue, Title } from './styles';
6
6
  import { LockedText } from '../common';
7
7
  import { formatNumberWithSpaces } from './helpers';
8
- export const StatisticCard = ({
9
- title,
10
- value,
11
- valueSubtext,
12
- footer,
13
- active,
14
- selectable,
15
- rightSlot,
16
- width,
17
- isLoading,
18
- onClick,
19
- ...rest
20
- }) => {
8
+ export function StatisticCard(props) {
9
+ const {
10
+ title,
11
+ value,
12
+ valueSubtext,
13
+ footer,
14
+ active,
15
+ selectable,
16
+ rightSlot,
17
+ width,
18
+ isLoading,
19
+ onClick,
20
+ ...rest
21
+ } = props;
21
22
  const statisticValue = useMemo(() => {
22
23
  if (isLoading) {
23
24
  return React.createElement(Spinner, {
@@ -45,4 +46,4 @@ export const StatisticCard = ({
45
46
  }, rightSlot), statisticValue, footer && React.createElement(LockedText, {
46
47
  "$small": true
47
48
  }, footer));
48
- };
49
+ }
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  export declare const Tab: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref" | "onClick"> & Readonly<{
3
- code: import("..").TabCode;
4
- onActivate?: (code: import("..").TabCode) => void;
3
+ code: import("../..").TabCode;
4
+ onActivate?: (code: import("../..").TabCode) => void;
5
5
  isDisabled?: boolean;
6
6
  isNew?: boolean;
7
7
  icon?: React.ReactNode;
@@ -1,6 +1,6 @@
1
1
  import React, { forwardRef } from 'react';
2
- import { TabBase } from '../tab-base';
3
- import { useTabsContext } from '../tabs.context';
2
+ import { TabBase } from '../TabBase';
3
+ import { useTabsContext } from '../../context';
4
4
  export const Tab = forwardRef((props, ref) => {
5
5
  const {
6
6
  code,
@@ -0,0 +1 @@
1
+ export { Tab } from './Tab';
@@ -0,0 +1 @@
1
+ export { Tab } from './Tab';
@@ -1,5 +1,5 @@
1
1
  import type { ReactNode } from 'react';
2
- import type { TabCode } from '../tabs.types';
2
+ import type { TabCode } from '../../types';
3
3
  export type TabProps = Omit<JSX.IntrinsicElements['div'], 'ref' | 'onClick'> & Readonly<{
4
4
  code: TabCode;
5
5
  onActivate?: (code: TabCode) => void;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,7 +1,7 @@
1
1
  import React, { forwardRef } from 'react';
2
2
  import { H4 } from '@pushwoosh/kit-typography';
3
- import { TabBarTitleBox, TabBarContainer } from './tab-bar.styles';
4
- import { TabBarScrollableFrame } from '../tabs-list-slide-frame';
3
+ import { TabBarTitleBox, TabBarContainer } from './styles';
4
+ import { TabBarScrollableFrame } from '../TabBarScrollableFrame';
5
5
  export const TabBar = forwardRef((props, ref) => {
6
6
  const {
7
7
  children,
@@ -0,0 +1 @@
1
+ export { TabBar } from './TabBar';
@@ -0,0 +1 @@
1
+ export { TabBar } from './TabBar';
@@ -2,11 +2,11 @@ import styled from 'styled-components';
2
2
  import { Color, Spacing } from '@pushwoosh/kit-constants';
3
3
  export const TabBarContainer = styled.div.withConfig({
4
4
  displayName: "TabBarContainer",
5
- componentId: "sc-1z0lfzo-0"
5
+ componentId: "sc-pu8yhh-0"
6
6
  })(["position:relative;display:grid;grid-template-columns:", ";width:100%;height:40px;background:", ";border-radius:8px;padding:", ";overflow:hidden;"], ({
7
7
  hasTitle
8
8
  }) => hasTitle ? 'max-content 1fr' : '1fr', Color.SOFT_LIGHT, Spacing.S1);
9
9
  export const TabBarTitleBox = styled.div.withConfig({
10
10
  displayName: "TabBarTitleBox",
11
- componentId: "sc-1z0lfzo-1"
11
+ componentId: "sc-pu8yhh-1"
12
12
  })(["display:flex;align-items:center;position:relative;padding:0 ", " 0 ", ";"], Spacing.S4, Spacing.S5);
@@ -0,0 +1 @@
1
+ export {};
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
- import { type TabsListSlideFrameProps } from './tabs-list-slide-frame.types';
2
+ import type { TabsListSlideFrameProps } from './types';
3
3
  export declare const TabBarScrollableFrame: React.ForwardRefExoticComponent<TabsListSlideFrameProps & React.RefAttributes<HTMLDivElement>>;
@@ -1,8 +1,8 @@
1
1
  import debounce from 'lodash/debounce';
2
2
  import React, { forwardRef, useCallback, useEffect, useRef, useState } from 'react';
3
3
  import { ChevronIcon } from '@pushwoosh/kit-icons';
4
- import { TabBarContent, TabBarFrame, TabBarArrowContainer, TabBarWindow } from './tabs-list-slide-frame.styles';
5
- import { widthObserver } from '../tabs.helpers';
4
+ import { TabBarContent, TabBarFrame, TabBarArrowContainer, TabBarWindow } from './styles';
5
+ import { widthObserver } from '../../helpers';
6
6
  export const TabBarScrollableFrame = forwardRef(({
7
7
  children,
8
8
  ...props
@@ -0,0 +1 @@
1
+ export { TabBarScrollableFrame } from './TabBarScrollableFrame';
@@ -0,0 +1 @@
1
+ export { TabBarScrollableFrame } from './TabBarScrollableFrame';
@@ -2,25 +2,25 @@ import styled from 'styled-components';
2
2
  import { Color, Shadow, ShapeRadius, Spacing } from '@pushwoosh/kit-constants';
3
3
  export const TabBarArrowContainer = styled.div.withConfig({
4
4
  displayName: "TabBarArrowContainer",
5
- componentId: "sc-u8lb05-0"
5
+ componentId: "sc-1sonok9-0"
6
6
  })(["position:absolute;top:0;", ":0;display:flex;align-items:center;height:32px;cursor:pointer;color:", ";background-color:", ";box-shadow:", ";border-radius:", ";padding:", " ", ";&:hover{color:", ";}"], ({
7
7
  $right
8
8
  }) => $right ? 'right' : 'left', Color.MAIN, Color.CLEAR, Shadow.SMALL, ShapeRadius.CONTROL, Spacing.S3, Spacing.S1, Color.PRIMARY_HOVER);
9
9
  export const TabBarWindow = styled.div.withConfig({
10
10
  displayName: "TabBarWindow",
11
- componentId: "sc-u8lb05-1"
11
+ componentId: "sc-1sonok9-1"
12
12
  })(["position:relative;height:32px;width:100%;"]);
13
13
  export const TabsListContentBase = styled.div.withConfig({
14
14
  displayName: "TabsListContentBase",
15
- componentId: "sc-u8lb05-2"
15
+ componentId: "sc-1sonok9-2"
16
16
  })(["position:absolute;top:0;display:flex;align-items:center;transition:left .4s ease-in;"]);
17
17
  export const TabBarContent = styled(TabsListContentBase).withConfig({
18
18
  displayName: "TabBarContent",
19
- componentId: "sc-u8lb05-3"
19
+ componentId: "sc-1sonok9-3"
20
20
  })(["left:", "px;gap:", ";"], ({
21
21
  left
22
22
  }) => left, Spacing.S1);
23
23
  export const TabBarFrame = styled.div.withConfig({
24
24
  displayName: "TabBarFrame",
25
- componentId: "sc-u8lb05-4"
25
+ componentId: "sc-1sonok9-4"
26
26
  })(["position:relative;width:100%;"]);
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,5 @@
1
1
  import React, { forwardRef } from 'react';
2
- import { TabIconBox, TabRedDot, TabBody, TabButtonLabel } from './tab-base.styles';
2
+ import { TabIconBox, TabRedDot, TabBody, TabButtonLabel } from './styles';
3
3
  export const TabBase = forwardRef((props, ref) => {
4
4
  const {
5
5
  isActive,
@@ -0,0 +1 @@
1
+ export { TabBase } from './TabBase';
@@ -0,0 +1 @@
1
+ export { TabBase } from './TabBase';
@@ -4,7 +4,7 @@ import { H4 } from '@pushwoosh/kit-typography';
4
4
  const tabBodyHover = css(["&:hover{color:", ";background-color:", ";}"], Color.PRIMARY_HOVER, Color.BRIGHT_LIGHT);
5
5
  export const TabBody = styled.div.withConfig({
6
6
  displayName: "TabBody",
7
- componentId: "sc-1vksurj-0"
7
+ componentId: "sc-133yrgu-0"
8
8
  })(["display:flex;justify-content:center;align-items:center;position:relative;padding:", " ", " ", " ", ";background-color:", ";border-radius:", ";box-shadow:", ";cursor:", ";user-select:none;white-space:nowrap;color:", ";", ""], Spacing.S2, ({
9
9
  $hasIcon
10
10
  }) => $hasIcon ? Spacing.S4 : Spacing.S5, Spacing.S2, Spacing.S5, ({
@@ -27,15 +27,15 @@ export const TabBody = styled.div.withConfig({
27
27
  }) => !$isActive && !$isDisabled && tabBodyHover);
28
28
  export const TabRedDot = styled.div.withConfig({
29
29
  displayName: "TabRedDot",
30
- componentId: "sc-1vksurj-1"
30
+ componentId: "sc-133yrgu-1"
31
31
  })(["width:4px;height:20px;position:relative;&::before{content:\"\";background-color:", ";position:absolute;top:0;left:0;width:4px;height:4px;border-radius:4px;}"], Color.DANGER);
32
32
  export const TabButtonLabel = styled(H4).withConfig({
33
33
  displayName: "TabButtonLabel",
34
- componentId: "sc-1vksurj-2"
34
+ componentId: "sc-133yrgu-2"
35
35
  })(["opacity:", ";"], ({
36
36
  $isActive
37
37
  }) => $isActive ? 1 : 0.8);
38
38
  export const TabIconBox = styled.div.withConfig({
39
39
  displayName: "TabIconBox",
40
- componentId: "sc-1vksurj-3"
40
+ componentId: "sc-133yrgu-3"
41
41
  })(["margin-left:", ";"], Spacing.S1);
@@ -0,0 +1 @@
1
+ export {};
@@ -1,3 +1,3 @@
1
1
  import { type FC } from 'react';
2
- import type { TabPanelProps } from './tab-panel.types';
2
+ import type { TabPanelProps } from './types';
3
3
  export declare const TabPanel: FC<TabPanelProps>;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { TabPanelContainer } from './styles';
3
- import { useTabsContext } from '../tabs.context';
3
+ import { useTabsContext } from '../../context';
4
4
  export const TabPanel = props => {
5
5
  const {
6
6
  code,
@@ -0,0 +1 @@
1
+ export { TabPanel } from './TabPanel';
@@ -0,0 +1 @@
1
+ export { TabPanel } from './TabPanel';
@@ -1,5 +1,5 @@
1
1
  import styled from 'styled-components';
2
2
  export const TabPanelContainer = styled.div.withConfig({
3
3
  displayName: "TabPanelContainer",
4
- componentId: "sc-1kewjsc-0"
4
+ componentId: "sc-2k9ddn-0"
5
5
  })(["overflow:auto;flex:1;"]);
@@ -1,5 +1,5 @@
1
1
  import type { PropsWithChildren } from 'react';
2
- import type { TabCode } from '../tabs.types';
2
+ import type { TabCode } from '../../types';
3
3
  export type TabPanelProps = PropsWithChildren<Readonly<{
4
4
  code: TabCode;
5
5
  }>>;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,3 +1,3 @@
1
1
  import { type ReactElement } from 'react';
2
- import type { TabsProps } from './tabs.types';
2
+ import type { TabsProps } from './types';
3
3
  export declare function Tabs(props: TabsProps): ReactElement;
@@ -1,6 +1,6 @@
1
1
  import React, { useMemo } from 'react';
2
2
  import { TabsContainer } from './styles';
3
- import { TabContext } from '../tabs.context';
3
+ import { TabContext } from '../../context';
4
4
  export function Tabs(props) {
5
5
  const {
6
6
  activeCode: activeTabCode,
@@ -0,0 +1 @@
1
+ export { Tabs } from './Tabs';
@@ -0,0 +1 @@
1
+ export { Tabs } from './Tabs';
@@ -2,5 +2,5 @@ import styled from 'styled-components';
2
2
  import { Spacing } from '@pushwoosh/kit-constants';
3
3
  export const TabsContainer = styled.div.withConfig({
4
4
  displayName: "TabsContainer",
5
- componentId: "sc-1z082s8-0"
5
+ componentId: "sc-1pr0dun-0"
6
6
  })(["display:flex;flex-direction:column;gap:", ";width:100%;height:100%;"], Spacing.S5);
@@ -1,5 +1,5 @@
1
1
  import type { PropsWithChildren } from 'react';
2
- import { type TabCode } from '../tabs.types';
2
+ import { type TabCode } from '../../types';
3
3
  export type TabsProps = PropsWithChildren<Readonly<{
4
4
  activeCode: TabCode;
5
5
  onChange: (code: TabCode) => void;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import type { TabContextType } from './tabs.types';
2
+ import type { TabContextType } from './types';
3
3
  export declare const TabContext: React.Context<TabContextType>;
4
4
  export declare function useTabsContext(): TabContextType;
package/Tabs/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export * from './tabs.types';
2
- export * from './tab';
3
- export * from './tabs';
4
- export * from './tab-bar';
5
- export * from './tab-panel';
1
+ export { Tab } from './components/Tab';
2
+ export { TabBar } from './components/TabBar';
3
+ export { TabPanel } from './components/TabPanel';
4
+ export { Tabs } from './components/Tabs';
5
+ export type { TabCode } from './types';
package/Tabs/index.js CHANGED
@@ -1,5 +1,4 @@
1
- export * from './tabs.types';
2
- export * from './tab';
3
- export * from './tabs';
4
- export * from './tab-bar';
5
- export * from './tab-panel';
1
+ export { Tab } from './components/Tab';
2
+ export { TabBar } from './components/TabBar';
3
+ export { TabPanel } from './components/TabPanel';
4
+ export { Tabs } from './components/Tabs';
package/Tabs/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import { type ReactElement } from 'react';
2
+ import type { TooltipProps } from './types';
3
+ export declare function Tooltip(props: TooltipProps): ReactElement;
@@ -0,0 +1,47 @@
1
+ import React from 'react';
2
+ import { TooltipPositionToArrowOffsetMap, TooltipPositionToTippyOffsetMap, TooltipPositionToTippyPlacementMap } from './maps';
3
+ import { TooltipBox } from './styles';
4
+ export function Tooltip(props) {
5
+ const {
6
+ position = 'top-start',
7
+ arrowOffset = TooltipPositionToArrowOffsetMap[position],
8
+ offset = TooltipPositionToTippyOffsetMap[position],
9
+ maxWidth = 240,
10
+ zIndex = 999999,
11
+ isDisabled,
12
+ isVisible,
13
+ ...rest
14
+ } = props;
15
+ return React.createElement(TooltipBox, {
16
+ animation: false,
17
+ delay: 0,
18
+ duration: 0,
19
+ disabled: isDisabled,
20
+ maxWidth: maxWidth,
21
+ zIndex: zIndex,
22
+ placement: TooltipPositionToTippyPlacementMap[position],
23
+ visible: isVisible,
24
+ "$position": position,
25
+ "$arrowOffset": arrowOffset,
26
+ popperOptions: {
27
+ strategy: 'fixed',
28
+ modifiers: [{
29
+ name: 'offset',
30
+ options: {
31
+ offset
32
+ }
33
+ }, {
34
+ name: 'flip',
35
+ options: {
36
+ fallbackPlacements: []
37
+ }
38
+ }, {
39
+ name: 'preventOverflow',
40
+ options: {
41
+ mainAxis: false
42
+ }
43
+ }]
44
+ },
45
+ ...rest
46
+ });
47
+ }
@@ -0,0 +1,2 @@
1
+ export { Tooltip } from './Tooltip';
2
+ export type { TooltipPosition } from './types';
@@ -0,0 +1 @@
1
+ export { Tooltip } from './Tooltip';