@chotot/clad-ui 1.2.5 → 1.3.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 (224) hide show
  1. package/README.md +3 -3
  2. package/components/Announcer/Announcer.d.ts +9 -4
  3. package/components/Announcer/Announcer.stories.d.ts +142 -0
  4. package/components/Announcer/{Announcer.stories.js → Announcer.stories.tsx} +36 -31
  5. package/components/Announcer/Announcer.styles.d.ts +24 -12
  6. package/components/Announcer/{Announcer.styles.js → Announcer.styles.ts} +43 -18
  7. package/components/Announcer/Announcer.tsx +62 -47
  8. package/components/Badge/Badge.d.ts +4 -2
  9. package/components/Badge/Badge.stories.d.ts +61 -0
  10. package/components/Badge/{Badge.stories.js → Badge.stories.tsx} +5 -5
  11. package/components/Badge/Badge.styles.d.ts +20 -5
  12. package/components/Badge/{Badge.styles.js → Badge.styles.ts} +14 -1
  13. package/components/Badge/Badge.tsx +8 -4
  14. package/components/Box/Box.d.ts +3 -3
  15. package/components/Box/Box.stories.d.ts +240 -0
  16. package/components/Box/{Box.stories.js → Box.stories.tsx} +2 -2
  17. package/components/Box/Box.styles.d.ts +19 -4
  18. package/components/Box/{Box.styles.js → Box.styles.ts} +17 -4
  19. package/components/Box/Box.tsx +4 -4
  20. package/components/Breadcrumbs/Breadcrumbs.d.ts +2 -2
  21. package/components/Breadcrumbs/Breadcrumbs.stories.d.ts +52 -0
  22. package/components/Breadcrumbs/{Breadcrumbs.stories.js → Breadcrumbs.stories.tsx} +17 -15
  23. package/components/Breadcrumbs/Breadcrumbs.styles.d.ts +5 -4
  24. package/components/Breadcrumbs/Breadcrumbs.tsx +2 -2
  25. package/components/Button/Button.d.ts +21 -6
  26. package/components/Button/Button.stories.d.ts +103 -0
  27. package/components/Button/{Button.stories.js → Button.stories.tsx} +5 -1
  28. package/components/Button/Button.styles.d.ts +1 -1
  29. package/components/Button/{Button.styles.js → Button.styles.ts} +100 -6
  30. package/components/Button/Button.tsx +51 -18
  31. package/components/Button/ButtonLink.d.ts +4 -4
  32. package/components/Button/ButtonLink.stories.d.ts +30 -0
  33. package/components/Button/ButtonLink.styles.d.ts +1 -1
  34. package/components/Button/ButtonLink.tsx +5 -5
  35. package/components/Button/IconButton.d.ts +3 -29
  36. package/components/Button/IconButton.stories.d.ts +60 -0
  37. package/components/Button/{IconButton.stories.js → IconButton.stories.tsx} +27 -0
  38. package/components/Button/IconButton.tsx +2 -42
  39. package/components/Checkbox/Checkbox.d.ts +3 -3
  40. package/components/Checkbox/Checkbox.stories.d.ts +88 -0
  41. package/components/Checkbox/Checkbox.styles.d.ts +2 -2
  42. package/components/Checkbox/Checkbox.tsx +3 -6
  43. package/components/Chip/Chip.d.ts +5 -4
  44. package/components/Chip/Chip.stories.d.ts +153 -0
  45. package/components/Chip/{Chip.stories.js → Chip.stories.tsx} +4 -5
  46. package/components/Chip/Chip.styles.d.ts +11 -8
  47. package/components/Chip/{Chip.styles.js → Chip.styles.ts} +4 -4
  48. package/components/Chip/Chip.tsx +19 -12
  49. package/components/CurrencyInput/CurrencyInput.d.ts +3 -56
  50. package/components/CurrencyInput/CurrencyInput.stories.d.ts +104 -0
  51. package/components/CurrencyInput/{CurrencyInput.stories.js → CurrencyInput.stories.tsx} +2 -2
  52. package/components/CurrencyInput/CurrencyInput.styles.d.ts +16 -10
  53. package/components/CurrencyInput/{CurrencyInput.styles.js → CurrencyInput.styles.ts} +23 -9
  54. package/components/CurrencyInput/CurrencyInput.tsx +7 -61
  55. package/components/Dropdown/Dropdown.d.ts +22 -7
  56. package/components/Dropdown/Dropdown.stories.d.ts +148 -0
  57. package/components/Dropdown/{Dropdown.stories.js → Dropdown.stories.tsx} +115 -1
  58. package/components/Dropdown/Dropdown.styles.d.ts +10 -0
  59. package/components/Dropdown/Dropdown.styles.ts +42 -0
  60. package/components/Dropdown/Dropdown.tsx +120 -24
  61. package/components/Grid/Col.d.ts +2 -2
  62. package/components/Grid/Col.tsx +6 -3
  63. package/components/Grid/Grid.styles.d.ts +25 -5
  64. package/components/Grid/{Grid.styles.js → Grid.styles.ts} +16 -3
  65. package/components/Grid/aGrid.stories.d.ts +127 -0
  66. package/components/Grid/bCol.stories.d.ts +74 -0
  67. package/components/Input/Input.d.ts +14 -10
  68. package/components/Input/Input.stories.d.ts +226 -0
  69. package/components/Input/{Input.stories.js → Input.stories.tsx} +20 -16
  70. package/components/Input/Input.styles.d.ts +22 -11
  71. package/components/Input/{Input.styles.js → Input.styles.ts} +29 -7
  72. package/components/Input/Input.tsx +22 -20
  73. package/components/Popover/Popover.d.ts +44 -0
  74. package/components/Popover/Popover.stories.d.ts +53 -0
  75. package/components/Popover/Popover.stories.tsx +133 -0
  76. package/components/Popover/Popover.tsx +121 -0
  77. package/components/RadioButton/RadioButton.d.ts +5 -6
  78. package/components/RadioButton/RadioButton.stories.d.ts +94 -0
  79. package/components/RadioButton/RadioButton.styles.d.ts +7 -3
  80. package/components/RadioButton/{RadioButton.styles.js → RadioButton.styles.ts} +1 -1
  81. package/components/RadioButton/RadioButton.tsx +5 -11
  82. package/components/RowItem/RowItem.d.ts +27 -9
  83. package/components/RowItem/RowItem.stories.d.ts +131 -0
  84. package/components/RowItem/RowItem.stories.tsx +710 -0
  85. package/components/RowItem/RowItem.styles.d.ts +31 -10
  86. package/components/RowItem/{RowItem.styles.js → RowItem.styles.ts} +41 -13
  87. package/components/RowItem/RowItem.tsx +106 -42
  88. package/components/ShapeIcon/ShapeIcon.d.ts +23 -16
  89. package/components/ShapeIcon/ShapeIcon.stories.d.ts +91 -0
  90. package/components/ShapeIcon/{ShapeIcon.stories.js → ShapeIcon.stories.tsx} +21 -8
  91. package/components/ShapeIcon/ShapeIcon.styles.d.ts +8 -3
  92. package/components/ShapeIcon/{ShapeIcon.styles.js → ShapeIcon.styles.ts} +6 -3
  93. package/components/ShapeIcon/ShapeIcon.tsx +25 -21
  94. package/components/Slider/Slider.d.ts +9 -7
  95. package/components/Slider/Slider.stories.d.ts +81 -0
  96. package/components/Slider/{Slider.stories.js → Slider.stories.tsx} +7 -7
  97. package/components/Slider/Slider.styles.d.ts +15 -11
  98. package/components/Slider/{Slider.styles.js → Slider.styles.ts} +1 -1
  99. package/components/Slider/Slider.tsx +21 -16
  100. package/components/Snack/Snack.d.ts +4 -5
  101. package/components/Snack/Snack.stories.d.ts +87 -0
  102. package/components/Snack/Snack.styles.d.ts +9 -8
  103. package/components/Snack/{Snack.styles.js → Snack.styles.ts} +4 -4
  104. package/components/Snack/Snack.tsx +14 -11
  105. package/components/Tabs/Tab.d.ts +6 -6
  106. package/components/Tabs/Tab.tsx +6 -7
  107. package/components/Tabs/Tabs.d.ts +7 -4
  108. package/components/Tabs/Tabs.stories.d.ts +64 -0
  109. package/components/Tabs/{Tabs.stories.js → Tabs.stories.tsx} +2 -2
  110. package/components/Tabs/Tabs.styles.d.ts +30 -12
  111. package/components/Tabs/{Tabs.styles.js → Tabs.styles.ts} +4 -4
  112. package/components/Tabs/Tabs.tsx +11 -7
  113. package/components/TextArea/TextArea.d.ts +24 -11
  114. package/components/TextArea/TextArea.stories.d.ts +151 -0
  115. package/components/TextArea/{TextArea.stories.js → TextArea.stories.tsx} +5 -96
  116. package/components/TextArea/TextArea.styles.d.ts +18 -16
  117. package/components/TextArea/{TextArea.styles.js → TextArea.styles.ts} +39 -19
  118. package/components/TextArea/TextArea.tsx +85 -31
  119. package/components/TextLabel/TextLabel.d.ts +35 -0
  120. package/components/TextLabel/TextLabel.stories.d.ts +40 -0
  121. package/components/TextLabel/TextLabel.stories.tsx +177 -0
  122. package/components/TextLabel/TextLabel.styles.d.ts +9 -0
  123. package/components/TextLabel/TextLabel.styles.ts +24 -0
  124. package/components/TextLabel/TextLabel.tsx +112 -0
  125. package/components/ToggleSwitch/ToggleSwitch.d.ts +2 -2
  126. package/components/ToggleSwitch/ToggleSwitch.stories.d.ts +38 -0
  127. package/components/ToggleSwitch/ToggleSwitch.styles.d.ts +21 -14
  128. package/components/ToggleSwitch/{ToggleSwitch.styles.js → ToggleSwitch.styles.ts} +8 -12
  129. package/components/ToggleSwitch/ToggleSwitch.tsx +12 -6
  130. package/components/Tooltip/Tooltip.d.ts +9 -3
  131. package/components/Tooltip/Tooltip.spec.js +5 -3
  132. package/components/Tooltip/Tooltip.styles.d.ts +7 -8
  133. package/components/Tooltip/Tooltip.tsx +10 -3
  134. package/components/index.d.ts +2 -0
  135. package/components/index.ts +2 -0
  136. package/icons/PrivateSellerAvatar.d.ts +3 -0
  137. package/icons/PrivateSellerAvatar.js +3 -0
  138. package/icons/Sda.d.ts +5 -2
  139. package/icons/Sda.js +7 -7
  140. package/icons/VerifiedShop.d.ts +3 -0
  141. package/icons/VerifiedShop.js +3 -0
  142. package/package.json +6 -6
  143. package/patterns/Drawer/Drawer.d.ts +13 -13
  144. package/patterns/Drawer/Drawer.stories.d.ts +90 -0
  145. package/patterns/Drawer/{Drawer.stories.js → Drawer.stories.tsx} +25 -0
  146. package/patterns/Drawer/Drawer.styles.d.ts +30 -26
  147. package/patterns/Drawer/{Drawer.styles.js → Drawer.styles.ts} +2 -5
  148. package/patterns/Drawer/Drawer.tsx +20 -41
  149. package/patterns/EmptyState/EmptyState.d.ts +5 -4
  150. package/patterns/EmptyState/EmptyState.stories.d.ts +40 -0
  151. package/patterns/EmptyState/EmptyState.styles.d.ts +10 -10
  152. package/patterns/EmptyState/{EmptyState.styles.js → EmptyState.styles.ts} +5 -4
  153. package/patterns/EmptyState/EmptyState.tsx +14 -12
  154. package/patterns/InputGroup/InputGroup.d.ts +4 -0
  155. package/patterns/InputGroup/InputGroup.styles.d.ts +5 -4
  156. package/patterns/InputGroup/InputGroup.tsx +11 -5
  157. package/patterns/LegacyDialog/DialogMainIcon.d.ts +1 -0
  158. package/patterns/LegacyDialog/DialogMainIcon.js +51 -0
  159. package/patterns/LegacyDialog/LegacyDialog.d.ts +3 -3
  160. package/patterns/LegacyDialog/LegacyDialog.styles.d.ts +8 -10
  161. package/patterns/LegacyDialog/LegacyDialog.styles.js +1 -46
  162. package/patterns/LegacyDialog/LegacyDialog.tsx +5 -11
  163. package/patterns/LegacyPopup/LegacyPopup.d.ts +4 -4
  164. package/patterns/LegacyPopup/LegacyPopup.styles.d.ts +18 -13
  165. package/patterns/LegacyPopup/{LegacyPopup.styles.js → LegacyPopup.styles.ts} +3 -1
  166. package/patterns/LegacyPopup/LegacyPopup.tsx +4 -6
  167. package/patterns/MultiSearchDropdown/MultiSearchDropdown.d.ts +20 -17
  168. package/patterns/MultiSearchDropdown/MultiSearchDropdown.stories.d.ts +125 -0
  169. package/patterns/MultiSearchDropdown/{MultiSearchDropdown.stories.js → MultiSearchDropdown.stories.tsx} +31 -30
  170. package/patterns/MultiSearchDropdown/MultiSearchDropdown.styles.d.ts +22 -21
  171. package/patterns/MultiSearchDropdown/{MultiSearchDropdown.styles.js → MultiSearchDropdown.styles.ts} +1 -7
  172. package/patterns/MultiSearchDropdown/MultiSearchDropdown.tsx +33 -32
  173. package/patterns/Popup/Popup.d.ts +8 -7
  174. package/patterns/Popup/Popup.stories.d.ts +102 -0
  175. package/patterns/Popup/Popup.styles.d.ts +41 -30
  176. package/patterns/Popup/{Popup.styles.js → Popup.styles.ts} +26 -33
  177. package/patterns/Popup/Popup.tsx +14 -33
  178. package/patterns/SearchInput/SearchInput.d.ts +38 -21
  179. package/patterns/SearchInput/SearchInput.stories.d.ts +186 -0
  180. package/patterns/SearchInput/{SearchInput.stories.js → SearchInput.stories.tsx} +78 -45
  181. package/patterns/SearchInput/SearchInput.styles.d.ts +6 -5
  182. package/patterns/SearchInput/{SearchInput.styles.js → SearchInput.styles.ts} +7 -4
  183. package/patterns/SearchInput/SearchInput.tsx +53 -34
  184. package/patterns/TagCloud/TagCloud.d.ts +19 -6
  185. package/patterns/TagCloud/TagCloud.stories.d.ts +159 -0
  186. package/patterns/TagCloud/{TagCloud.stories.js → TagCloud.stories.tsx} +59 -14
  187. package/patterns/TagCloud/TagCloud.styles.d.ts +12 -8
  188. package/patterns/TagCloud/{TagCloud.styles.js → TagCloud.styles.ts} +6 -7
  189. package/patterns/TagCloud/TagCloud.tsx +24 -8
  190. package/patterns/TagCloud/TagCloudMultiActive.d.ts +6 -4
  191. package/patterns/TagCloud/TagCloudMultiActive.tsx +5 -5
  192. package/patterns/TagCloud/TagCloudSingleActive.d.ts +5 -2
  193. package/patterns/TagCloud/TagCloudSingleActive.tsx +18 -5
  194. package/patterns/patterns-index.spec.js +1 -1
  195. package/storybook/GuideImage.d.ts +2 -2
  196. package/storybook/Swatch.d.ts +2 -2
  197. package/theme/__snapshots__/chotot.spec.js.snap +2 -2
  198. package/theme/chotot-color1.d.ts +7 -14
  199. package/theme/chotot.d.ts +32 -32
  200. package/theme/chotot.js +4 -4
  201. package/theme/ct-job.d.ts +6 -14
  202. package/theme/ct-pty.d.ts +6 -8
  203. package/theme/mudah.d.ts +14 -13
  204. package/types.d.ts +0 -9
  205. package/utils/_simulateChangeEvent.d.ts +18 -3
  206. package/utils/_simulateChangeEvent.js +13 -6
  207. package/utils/_simulateChangeEvent.spec.js +1 -1
  208. package/utils/cx.d.ts +8 -4
  209. package/utils/cx.js +8 -4
  210. package/utils/sx.d.ts +12 -4192
  211. package/components/RowItem/RowItem.stories.js +0 -560
  212. /package/components/Breadcrumbs/{Breadcrumbs.styles.js → Breadcrumbs.styles.ts} +0 -0
  213. /package/components/Button/{ButtonLink.stories.js → ButtonLink.stories.tsx} +0 -0
  214. /package/components/Button/{ButtonLink.styles.js → ButtonLink.styles.ts} +0 -0
  215. /package/components/Checkbox/{Checkbox.stories.js → Checkbox.stories.tsx} +0 -0
  216. /package/components/Checkbox/{Checkbox.styles.js → Checkbox.styles.ts} +0 -0
  217. /package/components/Grid/{aGrid.stories.js → aGrid.stories.tsx} +0 -0
  218. /package/components/Grid/{bCol.stories.js → bCol.stories.tsx} +0 -0
  219. /package/components/RadioButton/{RadioButton.stories.js → RadioButton.stories.tsx} +0 -0
  220. /package/components/Snack/{Snack.stories.js → Snack.stories.tsx} +0 -0
  221. /package/components/ToggleSwitch/{ToggleSwitch.stories.js → ToggleSwitch.stories.tsx} +0 -0
  222. /package/patterns/EmptyState/{EmptyState.stories.js → EmptyState.stories.tsx} +0 -0
  223. /package/patterns/InputGroup/{InputGroup.styles.js → InputGroup.styles.ts} +0 -0
  224. /package/patterns/Popup/{Popup.stories.js → Popup.stories.tsx} +0 -0
@@ -1,7 +1,7 @@
1
1
  import theme from '@clad-ui/theme';
2
2
  import { styled } from '@linaria/react';
3
3
 
4
- const { colors, breakpoints, sizes, fontSizes, lineHeights, fontWeights } = theme;
4
+ const { colors, breakpoints, sizes, space, fontSizes, lineHeights, fontWeights } = theme;
5
5
 
6
6
  export const StyledEmptyState = styled.div`
7
7
  display: flex;
@@ -10,20 +10,21 @@ export const StyledEmptyState = styled.div`
10
10
  flex-direction: column;
11
11
  `;
12
12
 
13
- export const StyledEmptyHeaderText = styled.p`
13
+ export const StyledEmptyHeaderText = styled.h3`
14
14
  font-size: ${fontSizes.h3};
15
15
  line-height: ${lineHeights.md};
16
16
  font-weight: ${fontWeights.bold};
17
17
  color: ${colors.textPrimary};
18
18
  `;
19
19
 
20
- export const StyledEmptyBodyText = styled.pre`
20
+ export const StyledEmptyBodyText = styled.p`
21
21
  font-size: ${fontSizes.sm};
22
22
  line-height: ${lineHeights.xs};
23
23
  color: ${colors.textPrimary};
24
24
  text-align: center;
25
25
  white-space: break-spaces;
26
- max-width: 300px;
26
+ max-width: ${sizes.$md};
27
+ margin-bottom: ${space.md};
27
28
 
28
29
  @media screen and (min-width: ${breakpoints.md}) {
29
30
  max-width: ${sizes.$xl};
@@ -56,23 +56,25 @@ Hãy thử những tin đăng khác, bạn nhé.`,
56
56
  },
57
57
  };
58
58
 
59
- export type EmptyStateProps = {
59
+ export type EmptyStateType =
60
+ | 'connectionError'
61
+ | 'emptyAd'
62
+ | 'noFilterResult'
63
+ | 'noNetwork'
64
+ | 'noResult'
65
+ | 'notFound'
66
+ | 'other'
67
+ | 'underMaintenance';
68
+
69
+ export interface EmptyStateProps {
60
70
  /**
61
71
  * Type of Empty State
62
72
  */
63
- type:
64
- | 'connectionError'
65
- | 'emptyAd'
66
- | 'noFilterResult'
67
- | 'noNetwork'
68
- | 'noResult'
69
- | 'notFound'
70
- | 'other'
71
- | 'underMaintenance';
73
+ type: EmptyStateType;
72
74
  /**
73
75
  * Action Button on Click
74
76
  */
75
- onButtonClick?: () => void;
77
+ onButtonClick?: React.MouseEventHandler<HTMLButtonElement>;
76
78
  /**
77
79
  * Custom title
78
80
  */
@@ -89,7 +91,7 @@ export type EmptyStateProps = {
89
91
  * Custom buttonLabel
90
92
  */
91
93
  buttonLabel?: string;
92
- };
94
+ }
93
95
  /**
94
96
  *
95
97
  *
@@ -12,6 +12,10 @@ export type InputGroupProps = {
12
12
  * Promp a helptext below input group (useful when implemented with form validation)
13
13
  */
14
14
  helptext?: string;
15
+ /**
16
+ * Custom helptext
17
+ */
18
+ helptextClassName?: string;
15
19
  };
16
20
  declare const InputGroup: React.FC<InputGroupProps>;
17
21
  export default InputGroup;
@@ -1,6 +1,7 @@
1
- export const Wrapper: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
2
- as?: import("react").ElementType<any> | undefined;
1
+ declare const Wrapper: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
2
+ as?: import("react").ElementType;
3
3
  }>;
4
- export const Paragraph: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLParagraphElement> & import("react").HTMLAttributes<HTMLParagraphElement> & Record<never, unknown> & {
5
- as?: import("react").ElementType<any> | undefined;
4
+ declare const Paragraph: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLParagraphElement> & import("react").HTMLAttributes<HTMLParagraphElement> & Record<never, unknown> & {
5
+ as?: import("react").ElementType;
6
6
  }>;
7
+ export { Wrapper, Paragraph };
@@ -15,21 +15,27 @@ export type InputGroupProps = {
15
15
  * Promp a helptext below input group (useful when implemented with form validation)
16
16
  */
17
17
  helptext?: string;
18
+ /**
19
+ * Custom helptext
20
+ */
21
+ helptextClassName?: string;
18
22
  };
19
23
 
20
-
21
-
22
- const InputGroup: React.FC<InputGroupProps> = ({ children, status = 'default', helptext = '' }) => {
24
+ const InputGroup: React.FC<InputGroupProps> = ({
25
+ children,
26
+ status = 'default',
27
+ helptext = '',
28
+ helptextClassName = '',
29
+ }) => {
23
30
  const isWithError = status === 'error';
24
31
  const wrapperClassname = cx(isWithError && 'error');
25
32
 
26
33
  return (
27
34
  <>
28
35
  <Wrapper className={wrapperClassname}>{children}</Wrapper>
29
- <Paragraph>{helptext}</Paragraph>
36
+ <Paragraph className={helptextClassName}>{helptext}</Paragraph>
30
37
  </>
31
38
  );
32
39
  };
33
40
 
34
-
35
41
  export default InputGroup;
@@ -0,0 +1 @@
1
+ export function DialogMainIcon(): JSX.Element;
@@ -0,0 +1,51 @@
1
+ import React from 'react';
2
+ import theme from '@clad-ui/theme';
3
+
4
+ const { colors } = theme;
5
+
6
+ const DialogMainIcon = () => (
7
+ <svg
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ xmlnsXlink="http://www.w3.org/1999/xlink"
10
+ width="1em"
11
+ height="1em"
12
+ viewBox="0 0 80 80"
13
+ >
14
+ <defs>
15
+ <path id="a" d="M0 0h80v80H0z" />
16
+ </defs>
17
+ <g fill="none" fillRule="evenodd">
18
+ <mask id="b" fill={colors.white}>
19
+ <use xlinkHref="#a" />
20
+ </mask>
21
+ <path
22
+ fill="#F79A1B"
23
+ d="M14.216 12.709L41 1l26.441 9.937A7.033 7.033 0 0172 17.521v30.23C66.2 59.057 55.868 68.807 41 77c-15.343-9.119-25.676-18.868-31-29.25V19.153a7.033 7.033 0 014.216-6.444z"
24
+ mask="url(#b)"
25
+ />
26
+ <path
27
+ fill={colors.primary}
28
+ d="M15.026 14.566L39 5.714l23.974 8.852a7.033 7.033 0 014.597 6.598v26.748C62.551 58.108 53.027 66.9 39 74.286c-14.438-8.222-23.962-17.013-28.571-26.374V21.164a7.033 7.033 0 014.597-6.598z"
29
+ mask="url(#b)"
30
+ />
31
+ <path
32
+ fill={colors.white}
33
+ d="M34.41 55.971L19.17 41.138 25.1 35.35l8.446 8.111 16.703-16.718 6.895 6.044z"
34
+ mask="url(#b)"
35
+ />
36
+ <path
37
+ fill={colors.black}
38
+ d="M36.045 54.286L22.857 41.635l4.396-4.215 8.351 8.013L52.312 28.57l4.83 4.216z"
39
+ mask="url(#b)"
40
+ />
41
+ <path
42
+ stroke={colors.black}
43
+ strokeWidth="2.286"
44
+ d="M39 1.22l28.025 10.452a5.883 5.883 0 013.832 5.519h0v31.774C65.185 60.44 54.553 70.332 39.02 78.691 23.023 69.406 12.372 59.518 7.143 48.965h0V17.191a5.883 5.883 0 013.832-5.519h0L39 1.22z"
45
+ mask="url(#b)"
46
+ />
47
+ </g>
48
+ </svg>
49
+ );
50
+
51
+ export { DialogMainIcon };
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- export type LegacyDialogProps = {
2
+ export interface LegacyDialogProps {
3
3
  /**
4
4
  * Dialog className (can be used to add more styles to mainIcon by targeting `main-icon` class in case of using a custom string)
5
5
  */
@@ -39,8 +39,8 @@ export type LegacyDialogProps = {
39
39
  /**
40
40
  * Callback when dialog main button is clicked
41
41
  */
42
- onButtonClick?: () => void;
43
- };
42
+ onButtonClick?: React.MouseEventHandler<HTMLButtonElement>;
43
+ }
44
44
  /**
45
45
  * Dialog informs users about critical information or require decisions.
46
46
  *
@@ -1,14 +1,12 @@
1
- export function DialogMainIcon(): JSX.Element;
2
- export const Modal: import("@linaria/react").StyledMeta & React.FunctionComponent<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
3
- as?: React.ElementType<any> | undefined;
1
+ export const Modal: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
2
+ as?: import("react").ElementType;
4
3
  }>;
5
- export const StyledDialog: import("@linaria/react").StyledMeta & React.FunctionComponent<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
6
- as?: React.ElementType<any> | undefined;
4
+ export const StyledDialog: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
5
+ as?: import("react").ElementType;
7
6
  }>;
8
- export const CloseButton: import("@linaria/react").StyledMeta & React.FunctionComponent<React.ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown> & {
9
- as?: React.ElementType<any> | undefined;
7
+ export const CloseButton: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown> & {
8
+ as?: import("react").ElementType;
10
9
  }>;
11
- export const ChildrenWrapper: import("@linaria/react").StyledMeta & React.FunctionComponent<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
12
- as?: React.ElementType<any> | undefined;
10
+ export const ChildrenWrapper: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
11
+ as?: import("react").ElementType;
13
12
  }>;
14
- import React from 'react';
@@ -1,54 +1,9 @@
1
- import React from 'react';
2
1
  import { styled } from '@linaria/react';
3
2
  import theme from '@clad-ui/theme';
4
3
 
5
4
  const { colors, radii, sizes, space, mediaQueries, shadows, fontSizes, lineHeights, zIndices } =
6
5
  theme;
7
6
 
8
- const DialogMainIcon = () => (
9
- <svg
10
- xmlns="http://www.w3.org/2000/svg"
11
- xmlnsXlink="http://www.w3.org/1999/xlink"
12
- width="1em"
13
- height="1em"
14
- viewBox="0 0 80 80"
15
- >
16
- <defs>
17
- <path id="a" d="M0 0h80v80H0z" />
18
- </defs>
19
- <g fill="none" fillRule="evenodd">
20
- <mask id="b" fill={colors.white}>
21
- <use xlinkHref="#a" />
22
- </mask>
23
- <path
24
- fill="#F79A1B"
25
- d="M14.216 12.709L41 1l26.441 9.937A7.033 7.033 0 0172 17.521v30.23C66.2 59.057 55.868 68.807 41 77c-15.343-9.119-25.676-18.868-31-29.25V19.153a7.033 7.033 0 014.216-6.444z"
26
- mask="url(#b)"
27
- />
28
- <path
29
- fill={colors.primary}
30
- d="M15.026 14.566L39 5.714l23.974 8.852a7.033 7.033 0 014.597 6.598v26.748C62.551 58.108 53.027 66.9 39 74.286c-14.438-8.222-23.962-17.013-28.571-26.374V21.164a7.033 7.033 0 014.597-6.598z"
31
- mask="url(#b)"
32
- />
33
- <path
34
- fill={colors.white}
35
- d="M34.41 55.971L19.17 41.138 25.1 35.35l8.446 8.111 16.703-16.718 6.895 6.044z"
36
- mask="url(#b)"
37
- />
38
- <path
39
- fill={colors.black}
40
- d="M36.045 54.286L22.857 41.635l4.396-4.215 8.351 8.013L52.312 28.57l4.83 4.216z"
41
- mask="url(#b)"
42
- />
43
- <path
44
- stroke={colors.black}
45
- strokeWidth="2.286"
46
- d="M39 1.22l28.025 10.452a5.883 5.883 0 013.832 5.519h0v31.774C65.185 60.44 54.553 70.332 39.02 78.691 23.023 69.406 12.372 59.518 7.143 48.965h0V17.191a5.883 5.883 0 013.832-5.519h0L39 1.22z"
47
- mask="url(#b)"
48
- />
49
- </g>
50
- </svg>
51
- );
52
7
 
53
8
  const Modal = styled.div`
54
9
  display: grid;
@@ -186,4 +141,4 @@ const ChildrenWrapper = styled.div`
186
141
  }
187
142
  `;
188
143
 
189
- export { DialogMainIcon, Modal, StyledDialog, CloseButton, ChildrenWrapper };
144
+ export { Modal, StyledDialog, CloseButton, ChildrenWrapper };
@@ -3,16 +3,11 @@ import { cx } from '../../utils';
3
3
  import createUniversalPortal from '../../utils/createUniversalPortal';
4
4
  import Button from '../../components/Button/Button';
5
5
  import { buttonClass, Backdrop } from '../LegacyPopup/LegacyPopup.styles';
6
- import {
7
- DialogMainIcon,
8
- Modal,
9
- StyledDialog,
10
- CloseButton,
11
- ChildrenWrapper,
12
- } from './LegacyDialog.styles';
6
+ import { Modal, StyledDialog, CloseButton, ChildrenWrapper } from './LegacyDialog.styles';
13
7
  import Close from '../../icons/Close';
8
+ import { DialogMainIcon } from './DialogMainIcon';
14
9
 
15
- export type LegacyDialogProps = {
10
+ export interface LegacyDialogProps {
16
11
  /**
17
12
  * Dialog className (can be used to add more styles to mainIcon by targeting `main-icon` class in case of using a custom string)
18
13
  */
@@ -52,8 +47,8 @@ export type LegacyDialogProps = {
52
47
  /**
53
48
  * Callback when dialog main button is clicked
54
49
  */
55
- onButtonClick?: () => void;
56
- };
50
+ onButtonClick?: React.MouseEventHandler<HTMLButtonElement>;
51
+ }
57
52
  /**
58
53
  * Dialog informs users about critical information or require decisions.
59
54
  *
@@ -116,5 +111,4 @@ const LegacyDialog: React.FC<LegacyDialogProps> = ({
116
111
  );
117
112
  };
118
113
 
119
-
120
114
  export default LegacyDialog;
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  declare const keyOfSpace: readonly string[];
3
3
  type Space = (typeof keyOfSpace)[number];
4
4
  declare const getSpaces: (value: string[] | string, defaultValue: string) => any[];
5
- export type LegacyPopupProps = {
5
+ export interface LegacyPopupProps {
6
6
  /**
7
7
  * Popup title
8
8
  */
@@ -42,11 +42,11 @@ export type LegacyPopupProps = {
42
42
  /**
43
43
  * rightIcon click event
44
44
  */
45
- onRightIconClick?: () => void;
45
+ onRightIconClick?: React.MouseEventHandler<HTMLButtonElement>;
46
46
  /**
47
47
  * Popup main button click event
48
48
  */
49
- onButtonClick?: () => void;
49
+ onButtonClick?: React.MouseEventHandler<HTMLButtonElement>;
50
50
  /**
51
51
  * [Responsive Prop] Popup content padding (Popup header excluded)
52
52
  */
@@ -55,7 +55,7 @@ export type LegacyPopupProps = {
55
55
  * To apply `overflow-y: visible` for the `ChildrenWrapper` in some specific case that have to use some `custom Dropdown relatives` inside Popup
56
56
  */
57
57
  childrenOverflowVisible?: boolean;
58
- };
58
+ }
59
59
  /**
60
60
  * Popup is a pattern that allow sliding in supplement floating contents (such as filters) on top of current one.
61
61
  *
@@ -1,21 +1,26 @@
1
- export const buttonClass: import("@linaria/core").LinariaClassName;
2
- export const showChildrenOverflowClass: import("@linaria/core").LinariaClassName;
3
- export const Modal: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
4
- as?: import("react").ElementType<any> | undefined;
1
+ declare const buttonClass: import("@linaria/core").LinariaClassName;
2
+ declare const Modal: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
3
+ as?: import("react").ElementType;
5
4
  }>;
6
- export const Backdrop: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
7
- as?: import("react").ElementType<any> | undefined;
5
+ declare const Backdrop: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
6
+ as?: import("react").ElementType;
8
7
  }>;
9
- export const PopupHeader: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
10
- as?: import("react").ElementType<any> | undefined;
8
+ declare const StyledPopup: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
9
+ as?: import("react").ElementType;
11
10
  }>;
12
- export const StyledPopup: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
13
- as?: import("react").ElementType<any> | undefined;
11
+ declare const PopupHeader: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
12
+ as?: import("react").ElementType;
14
13
  }>;
15
14
  /**
16
15
  * @type {React.FC<any>}
17
16
  */
18
- export const PopupContent: React.FC<any>;
19
- export const ChildrenWrapper: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
20
- as?: import("react").ElementType<any> | undefined;
17
+ declare const PopupContent: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
18
+ padding: string[];
19
+ } & {
20
+ as?: import("react").ElementType;
21
21
  }>;
22
+ declare const ChildrenWrapper: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
23
+ as?: import("react").ElementType;
24
+ }>;
25
+ declare const showChildrenOverflowClass: import("@linaria/core").LinariaClassName;
26
+ export { buttonClass, showChildrenOverflowClass, Modal, Backdrop, PopupHeader, StyledPopup, PopupContent, ChildrenWrapper, };
@@ -153,7 +153,9 @@ const PopupHeader = styled.div`
153
153
  /**
154
154
  * @type {React.FC<any>}
155
155
  */
156
- const PopupContent = styled.div`
156
+ const PopupContent = styled.div<{
157
+ padding: string[];
158
+ }>`
157
159
  display: flex;
158
160
  flex-direction: column;
159
161
  align-items: center;
@@ -22,7 +22,7 @@ type Space = (typeof keyOfSpace)[number];
22
22
  const getSpaces = (value: string[] | string, defaultValue: string) =>
23
23
  getBreakpointsValues(value, defaultValue).map((v) => space[v] || space.none);
24
24
 
25
- export type LegacyPopupProps = {
25
+ export interface LegacyPopupProps {
26
26
  /**
27
27
  * Popup title
28
28
  */
@@ -62,11 +62,11 @@ export type LegacyPopupProps = {
62
62
  /**
63
63
  * rightIcon click event
64
64
  */
65
- onRightIconClick?: () => void;
65
+ onRightIconClick?: React.MouseEventHandler<HTMLButtonElement>;
66
66
  /**
67
67
  * Popup main button click event
68
68
  */
69
- onButtonClick?: () => void;
69
+ onButtonClick?: React.MouseEventHandler<HTMLButtonElement>;
70
70
  /**
71
71
  * [Responsive Prop] Popup content padding (Popup header excluded)
72
72
  */
@@ -75,14 +75,13 @@ export type LegacyPopupProps = {
75
75
  * To apply `overflow-y: visible` for the `ChildrenWrapper` in some specific case that have to use some `custom Dropdown relatives` inside Popup
76
76
  */
77
77
  childrenOverflowVisible?: boolean;
78
- };
78
+ }
79
79
 
80
80
  /**
81
81
  * Popup is a pattern that allow sliding in supplement floating contents (such as filters) on top of current one.
82
82
  *
83
83
  * `✅ Stable`
84
84
  */
85
-
86
85
  const LegacyPopup: React.FC<LegacyPopupProps> = ({
87
86
  title = '',
88
87
  children,
@@ -154,6 +153,5 @@ const LegacyPopup: React.FC<LegacyPopupProps> = ({
154
153
  );
155
154
  };
156
155
 
157
-
158
156
  export { getSpaces };
159
157
  export default LegacyPopup;
@@ -1,15 +1,14 @@
1
1
  import * as React from 'react';
2
- declare const keysOfSizes: readonly string[];
3
- type Size = (typeof keysOfSizes)[number];
4
- type OptionPropType = {
2
+ import { type Sizes } from '@clad-ui/theme';
3
+ export type MultiSearchDropdownOption = {
5
4
  /** to display at input */
6
5
  text: string;
7
6
  /** to display in dropdown items */
8
7
  html: string;
9
8
  /** arbitrary data object */
10
- data: Record<string, any>;
9
+ data: unknown;
11
10
  };
12
- export type MultiSearchDropdownProps = {
11
+ export interface MultiSearchDropdownProps {
13
12
  /**
14
13
  * The id attribute of this component
15
14
  */
@@ -17,27 +16,27 @@ export type MultiSearchDropdownProps = {
17
16
  /**
18
17
  * Value data of this component.
19
18
  */
20
- value?: OptionPropType[];
19
+ value?: MultiSearchDropdownOption[];
21
20
  /**
22
21
  * Options array to provide for the dropdown menu, manually control option when delete/ add
23
22
  */
24
- options?: OptionPropType[];
23
+ options?: MultiSearchDropdownOption[];
25
24
  /**
26
25
  * Callback when user either add or remove option
27
26
  */
28
- onChange?: any;
27
+ onChange?: (value: MultiSearchDropdownOption, e: React.SyntheticEvent) => void;
29
28
  /**
30
29
  * Callback when user types in the search text field
31
30
  */
32
- onInput?: any;
31
+ onInput?: (e: React.ChangeEvent<HTMLInputElement>) => void;
33
32
  /**
34
33
  * Callback when user select option
35
34
  */
36
- onSelect?: any;
35
+ onSelect?: (value: MultiSearchDropdownOption, e: React.SyntheticEvent) => void;
37
36
  /**
38
37
  * Callback when remove option
39
38
  */
40
- onRemoveOption?: any;
39
+ onRemoveOption?: (deletedValue: MultiSearchDropdownOption, e: React.SyntheticEvent) => void;
41
40
  /**
42
41
  * Input name
43
42
  */
@@ -53,19 +52,19 @@ export type MultiSearchDropdownProps = {
53
52
  /**
54
53
  * Input width
55
54
  */
56
- width?: Size;
55
+ width?: Sizes;
57
56
  /**
58
57
  * Callback when input is blur
59
58
  */
60
- onBlur?: (e: React.SyntheticEvent) => void;
59
+ onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
61
60
  /**
62
61
  * Callback when input is focus
63
62
  */
64
- onFocus?: () => void;
63
+ onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;
65
64
  /**
66
65
  * If allow to remove input content with clear icon
67
66
  */
68
- onClearData?: (e: React.SyntheticEvent) => void;
67
+ onClearData?: (e: React.MouseEvent<HTMLElement>) => void;
69
68
  /**
70
69
  * Empty string on no options
71
70
  */
@@ -73,7 +72,7 @@ export type MultiSearchDropdownProps = {
73
72
  /**
74
73
  * Input menu max-height
75
74
  */
76
- menuMaxHeight?: Size;
75
+ menuMaxHeight?: Sizes;
77
76
  /**
78
77
  * Disable the input
79
78
  */
@@ -86,6 +85,10 @@ export type MultiSearchDropdownProps = {
86
85
  * Promp a helptext below input group (useful when implemented with form validation)
87
86
  */
88
87
  helptext?: string;
88
+ /**
89
+ * Custom helptext
90
+ */
91
+ helptextClassName?: string;
89
92
  /**
90
93
  * Input status (useful when implemented with form validation)
91
94
  */
@@ -94,7 +97,7 @@ export type MultiSearchDropdownProps = {
94
97
  * Component classname
95
98
  */
96
99
  className?: string;
97
- };
100
+ }
98
101
  /**
99
102
  * Search Input component that carefully takes care of accessibility
100
103
  and allow keyboard controls.