@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
@@ -0,0 +1,102 @@
1
+ import React from 'react';
2
+ declare const PopupStories: {
3
+ title: string;
4
+ component: React.FC<import("./Popup").PopupProps>;
5
+ tags: string[];
6
+ parameters: {
7
+ docs: {
8
+ description: {
9
+ component: string;
10
+ };
11
+ };
12
+ };
13
+ argTypes: {
14
+ children: {
15
+ control: {
16
+ type: string;
17
+ };
18
+ };
19
+ open: {};
20
+ className: {
21
+ control: null;
22
+ };
23
+ };
24
+ args: {
25
+ title: string;
26
+ primaryBtnLabel: string;
27
+ secondaryBtnLabel: string;
28
+ children: string;
29
+ onSecondaryButtonClick: null;
30
+ img: string;
31
+ };
32
+ };
33
+ export default PopupStories;
34
+ export declare const Overview: {
35
+ render: (args: any) => JSX.Element;
36
+ };
37
+ export declare const WithChildren: {
38
+ render: () => JSX.Element;
39
+ name: string;
40
+ parameters: {
41
+ docs: {
42
+ description: {
43
+ story: string;
44
+ };
45
+ };
46
+ };
47
+ };
48
+ export declare const ButtonGroupDemo: {
49
+ render: () => JSX.Element;
50
+ name: string;
51
+ parameters: {
52
+ docs: {
53
+ description: {
54
+ story: string;
55
+ };
56
+ };
57
+ };
58
+ };
59
+ export declare const ButtonDirection: {
60
+ render: () => JSX.Element;
61
+ name: string;
62
+ parameters: {
63
+ docs: {
64
+ description: {
65
+ story: string;
66
+ };
67
+ };
68
+ };
69
+ };
70
+ export declare const ImageDemo: {
71
+ render: () => JSX.Element;
72
+ name: string;
73
+ parameters: {
74
+ docs: {
75
+ description: {
76
+ story: string;
77
+ };
78
+ };
79
+ };
80
+ };
81
+ export declare const SpecialUsageDemo: {
82
+ render: () => JSX.Element;
83
+ name: string;
84
+ parameters: {
85
+ docs: {
86
+ description: {
87
+ story: string;
88
+ };
89
+ };
90
+ };
91
+ };
92
+ export declare const BoxExample: {
93
+ render: () => JSX.Element;
94
+ name: string;
95
+ parameters: {
96
+ docs: {
97
+ description: {
98
+ story: string;
99
+ };
100
+ };
101
+ };
102
+ };
@@ -1,30 +1,41 @@
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<any> | undefined;
3
- }>;
4
- export const StyledPopup: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
5
- as?: import("react").ElementType<any> | undefined;
6
- }>;
7
- export const CloseButtonClass: import("@linaria/core").LinariaClassName;
8
- export const StyledHeader: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
9
- as?: import("react").ElementType<any> | undefined;
10
- }>;
11
- /**
12
- * @type {React.FC<any>}
13
- */
14
- export const StyledWrapper: React.FC<any>;
15
- export const ChildrenWrapper: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
16
- as?: import("react").ElementType<any> | undefined;
17
- }>;
18
- /**
19
- * @type {React.FC<any>}
20
- */
21
- export const StyledButtonGroup: React.FC<any>;
22
- export const StyledImage: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLImageElement> & import("react").ImgHTMLAttributes<HTMLImageElement> & Record<never, unknown> & {
23
- as?: import("react").ElementType<any> | undefined;
24
- }>;
25
- export const Backdrop: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
26
- as?: import("react").ElementType<any> | undefined;
27
- }>;
28
- export const buttonClass: import("@linaria/core").LinariaClassName;
29
- export const showChildrenOverflowClass: import("@linaria/core").LinariaClassName;
30
- export const preventBodyScrollClass: import("@linaria/core").LinariaClassName;
1
+ declare 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;
3
+ }>;
4
+ declare const StyledPopup: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
5
+ as?: import("react").ElementType;
6
+ }>;
7
+ declare const StyledTitle: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLHeadingElement> & import("react").HTMLAttributes<HTMLHeadingElement> & Record<never, unknown> & {
8
+ as?: import("react").ElementType;
9
+ }>;
10
+ declare const StyledHeader: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
11
+ as?: import("react").ElementType;
12
+ }>;
13
+ declare const StyledWrapper: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
14
+ haveClose: boolean;
15
+ } & {
16
+ as?: import("react").ElementType;
17
+ }>;
18
+ declare const StyledButtonGroup: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
19
+ position: {
20
+ justifyContent: string;
21
+ };
22
+ btnGroupDirection: {
23
+ flexDirection: string;
24
+ };
25
+ } & {
26
+ as?: import("react").ElementType;
27
+ }>;
28
+ declare const buttonClass: import("@linaria/core").LinariaClassName;
29
+ declare const CloseButtonClass: import("@linaria/core").LinariaClassName;
30
+ declare const ChildrenWrapper: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
31
+ as?: import("react").ElementType;
32
+ }>;
33
+ declare const StyledImage: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLImageElement> & import("react").ImgHTMLAttributes<HTMLImageElement> & Record<never, unknown> & {
34
+ as?: import("react").ElementType;
35
+ }>;
36
+ declare const preventBodyScrollClass: import("@linaria/core").LinariaClassName;
37
+ declare const showChildrenOverflowClass: import("@linaria/core").LinariaClassName;
38
+ declare const Backdrop: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
39
+ as?: import("react").ElementType;
40
+ }>;
41
+ export { Modal, StyledPopup, CloseButtonClass, StyledHeader, StyledWrapper, ChildrenWrapper, StyledButtonGroup, StyledImage, Backdrop, buttonClass, showChildrenOverflowClass, preventBodyScrollClass, StyledTitle, };
@@ -39,14 +39,6 @@ const StyledPopup = styled.div`
39
39
  animation: 0.2s ease-out 0s 1 scaleToFull;
40
40
  text-align: center;
41
41
 
42
- & > h5 {
43
- margin: ${space.md} 0 ${space.sm};
44
- font-size: ${fontSizes.h5};
45
- line-height: ${lineHeights.sm};
46
- color: ${colors.textPrimary};
47
- font-weight: bold;
48
- }
49
-
50
42
  /* we keep class name so it's esier to select in overwrite */
51
43
  & > .main-icon {
52
44
  display: grid;
@@ -61,10 +53,18 @@ const StyledPopup = styled.div`
61
53
  }
62
54
  `;
63
55
 
56
+ const StyledTitle = styled.h5`
57
+ padding: ${space.md} ${space.md} ${space.xs} ${space.sm};
58
+ font-size: ${fontSizes.h5};
59
+ margin: 0;
60
+ line-height: ${lineHeights.sm};
61
+ color: ${colors.textPrimary};
62
+ font-weight: bold;
63
+ `;
64
+
64
65
  const StyledHeader = styled.div`
65
66
  position: relative;
66
67
  display: flex;
67
- justify-content: center;
68
68
  align-items: center;
69
69
 
70
70
  &.sm {
@@ -124,38 +124,31 @@ const StyledHeader = styled.div`
124
124
  }
125
125
  `;
126
126
 
127
- /**
128
- * @type {React.FC<any>}
129
- */
130
- const StyledWrapper = styled.div`
131
- margin: ${({ haveClose }) => (haveClose ? space.xl : space.lg)} 40px ${space.xl} 40px;
132
-
133
- @media ${mediaQueries.tablet} {
134
- margin: ${({ haveClose }) => (haveClose ? space.lg : space.md)} ${space.lg};
135
- }
127
+ const StyledWrapper = styled.div<{ haveClose: boolean }>`
128
+ padding: ${({ haveClose }) => (haveClose ? space.xs : space.md)} ${space.md} ${space.md}
129
+ ${space.md};
136
130
  `;
137
131
 
138
- /**
139
- * @type {React.FC<any>}
140
- */
141
- const StyledButtonGroup = styled.div`
132
+ const StyledButtonGroup = styled.div<{
133
+ position: { justifyContent: string };
134
+ btnGroupDirection: { flexDirection: string };
135
+ }>`
142
136
  display: flex;
143
137
  flex-direction: ${({ btnGroupDirection }) => btnGroupDirection.flexDirection};
144
138
  width: ${sizes.full};
145
139
  justify-content: ${({ position }) => position.justifyContent};
146
140
  align-items: center;
147
141
  gap: ${space.xs};
142
+ padding-top: ${space.xs};
148
143
  `;
149
144
 
150
145
  const buttonClass = css`
151
146
  justify-content: center;
152
- text-transform: uppercase;
153
147
  width: ${sizes.full};
154
148
  `;
155
149
 
156
150
  const CloseButtonClass = css`
157
- position: absolute;
158
- padding: ${space.none};
151
+ padding: ${space.md} ${space.md} ${space.none} ${space.md};
159
152
  top: ${space.md};
160
153
  left: ${space.md};
161
154
  background-color: transparent;
@@ -163,7 +156,6 @@ const CloseButtonClass = css`
163
156
  white-space: nowrap;
164
157
  font-size: ${sizes.xs};
165
158
  display: grid;
166
- place-items: center;
167
159
  border-radius: ${radii.circle};
168
160
  svg {
169
161
  color: ${colors.iconPrimary};
@@ -181,8 +173,8 @@ const CloseButtonClass = css`
181
173
  }
182
174
 
183
175
  @media ${mediaQueries.tablet} {
184
- top: ${space.sm};
185
- left: ${space.sm};
176
+ top: ${space.md};
177
+ left: ${space.md};
186
178
  }
187
179
  `;
188
180
 
@@ -191,9 +183,9 @@ const ChildrenWrapper = styled.div`
191
183
  line-height: 20px;
192
184
  max-height: calc(${sizes.vH} - 280px);
193
185
  /* move scrollbar to edge so that is doesn't overlie text */
194
- width: calc(${sizes.full} + ${space.sm} * 2);
186
+ width: calc(${sizes.full} + ${space.md} * 2);
195
187
  padding: 0 ${space.sm};
196
- margin: 0 -${space.sm} ${space.lg};
188
+ margin: 0 -${space.sm} ${space.md};
197
189
  overflow-y: auto;
198
190
  text-align: center;
199
191
 
@@ -213,9 +205,9 @@ const ChildrenWrapper = styled.div`
213
205
 
214
206
  @media ${mediaQueries.tablet} {
215
207
  /* move scrollbar to edge so that is doesn't overlie text */
216
- width: calc(${sizes.full} + ${space.lg} * 2);
217
- padding: 0 ${space.lg};
218
- margin: 0 -${space.lg} ${space.lg};
208
+ width: calc(${sizes.full} + ${space.md} * 2);
209
+ padding: 0 ${space.md};
210
+ margin: 0 -${space.md} ${space.md};
219
211
  text-align: left;
220
212
 
221
213
  & {
@@ -267,4 +259,5 @@ export {
267
259
  buttonClass,
268
260
  showChildrenOverflowClass,
269
261
  preventBodyScrollClass,
262
+ StyledTitle,
270
263
  };
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { cx, noop } from '../../utils';
3
3
  import createUniversalPortal from '../../utils/createUniversalPortal';
4
- import Button from '../../components/Button/Button';
4
+ import Button, { type ButtonColor } from '../../components/Button/Button';
5
5
  import {
6
6
  Modal,
7
7
  StyledPopup,
@@ -15,6 +15,7 @@ import {
15
15
  showChildrenOverflowClass,
16
16
  preventBodyScrollClass,
17
17
  Backdrop,
18
+ StyledTitle,
18
19
  } from './Popup.styles';
19
20
 
20
21
  import Close from '../../icons/Close';
@@ -40,7 +41,7 @@ const BTN_GROUP_DIRECTION = {
40
41
  },
41
42
  };
42
43
 
43
- export type PopupProps = {
44
+ export interface PopupProps {
44
45
  /**
45
46
  * Dialog className (can be used to add more styles to mainIcon by targeting `main-icon` class in case of using a custom string)
46
47
  */
@@ -92,50 +93,28 @@ export type PopupProps = {
92
93
  /**
93
94
  * Callback when close icon is clicked. Normally, it is used to update `open` prop to close the dialog.
94
95
  */
95
- onClose?: () => void;
96
+ onClose?: React.MouseEventHandler<HTMLElement>;
96
97
  /**
97
98
  * Callback when dialog main button is clicked
98
99
  */
99
- onPrimaryButtonClick?: () => void;
100
+ onPrimaryButtonClick?: React.MouseEventHandler<HTMLButtonElement>;
100
101
  /**
101
102
  * Callback when dialog secondary button is clicked
102
103
  */
103
- onSecondaryButtonClick?: () => void;
104
+ onSecondaryButtonClick?: React.MouseEventHandler<HTMLButtonElement>;
104
105
  /**
105
106
  * Primary Button Color
106
107
  */
107
- primaryColor?:
108
- | 'accent'
109
- | 'caution'
110
- | 'chotot'
111
- | 'critical'
112
- | 'error'
113
- | 'info'
114
- | 'neutral'
115
- | 'positive'
116
- | 'primary'
117
- | 'success'
118
- | 'tertiary';
108
+ primaryColor?: ButtonColor;
119
109
  /**
120
110
  * Secondary Button Color
121
111
  */
122
- secondaryColor?:
123
- | 'accent'
124
- | 'caution'
125
- | 'chotot'
126
- | 'critical'
127
- | 'error'
128
- | 'info'
129
- | 'neutral'
130
- | 'positive'
131
- | 'primary'
132
- | 'success'
133
- | 'tertiary';
112
+ secondaryColor?: ButtonColor;
134
113
  /**
135
114
  * To apply `overflow-y: visible` for the `ChildrenWrapper` in some specific case that have to use some `custom Dropdown relatives` inside Popup
136
115
  */
137
116
  childrenOverflowVisible?: boolean;
138
- };
117
+ }
139
118
 
140
119
  /**
141
120
  * Popup is a window sitting overtop of the main content to provide information or inquire confirmation.
@@ -204,20 +183,21 @@ const Popup: React.FC<PopupProps> = ({
204
183
  <Backdrop onClick={onClose} />
205
184
  <StyledPopup className={cx(className)}>
206
185
  <StyledHeader className={imgSize}>
207
- {!!img && <StyledImage src={img} />}
208
186
  {!!haveClose && (
209
187
  <button className={CloseButtonClass} type="button" onClick={onClose}>
210
188
  <Close />
211
189
  </button>
212
190
  )}
213
191
  </StyledHeader>
214
- <StyledWrapper>
215
- <h5>{title}</h5>
192
+ <StyledWrapper haveClose={haveClose}>
193
+ {!!img && <StyledImage src={img} />}
194
+ <StyledTitle>{title}</StyledTitle>
216
195
  <ChildrenWrapper className={childrenWrapperClasses}>{children}</ChildrenWrapper>
217
196
  {!!primaryBtnLabel && (
218
197
  <StyledButtonGroup {...btnGroupProps}>
219
198
  <Button
220
199
  color={primaryColor}
200
+ size="large"
221
201
  extraClasses={cx(
222
202
  // Keep button width maintain on column direction
223
203
  (btnRowPosition === 'justify' || btnGroupDirection === 'column') &&
@@ -230,6 +210,7 @@ const Popup: React.FC<PopupProps> = ({
230
210
  {!!secondaryBtnLabel && (
231
211
  <Button
232
212
  variant="outline"
213
+ size="large"
233
214
  color={secondaryColor}
234
215
  extraClasses={cx(
235
216
  // Keep button width maintain on column direction
@@ -1,24 +1,32 @@
1
1
  import * as React from 'react';
2
- declare const keysOfSizes: readonly string[];
3
- type Size = (typeof keysOfSizes)[number];
4
- type OptionPropType = {
5
- text?: string;
2
+ import { type Sizes } from '@clad-ui/theme';
3
+ export interface SearchInputOption {
4
+ /** to display at input */
5
+ text: string;
6
+ /** to display in dropdown items, with HTML format capability */
6
7
  html?: string;
7
- data?: Record<string, any>;
8
- };
9
- type ValueData = {
8
+ /** arbitrary data object */
9
+ data?: any;
10
+ }
11
+ /**
12
+ * Value data for this component, the text always reflects the input value, while selected is the selected option from the dropdown menu.
13
+ */
14
+ export interface SearchInputValue {
10
15
  text: string;
11
- selected: OptionPropType;
12
- };
13
- export type SearchInputProps = {
16
+ selected?: SearchInputOption;
17
+ }
18
+ export interface SearchInputEvent extends React.ChangeEvent<HTMLInputElement> {
19
+ value: SearchInputValue;
20
+ }
21
+ export interface SearchInputProps {
14
22
  /**
15
23
  * The id attribute of this component
16
24
  */
17
- id?: string | null;
25
+ id?: string;
18
26
  /**
19
27
  * Value data of this component.
20
28
  */
21
- value?: ValueData;
29
+ value?: SearchInputValue;
22
30
  /**
23
31
  * Variant to choose between SearchDropdown/ Input
24
32
  */
@@ -26,19 +34,19 @@ export type SearchInputProps = {
26
34
  /**
27
35
  * Options array to provide for the dropdown menu
28
36
  */
29
- options?: OptionPropType[];
37
+ options?: SearchInputOption[];
30
38
  /**
31
39
  * Callback when user types in the search text field
32
40
  */
33
- onInput?: React.ChangeEventHandler;
41
+ onInput?: (event: SearchInputEvent) => void;
34
42
  /**
35
43
  * Callback when user selects an item on the dropdown menu
36
44
  */
37
- onSelect?: React.ChangeEventHandler;
45
+ onSelect?: (event: SearchInputEvent) => void;
38
46
  /**
39
47
  * Callback when user either types in text field or makes selection
40
48
  */
41
- onChange?: React.ChangeEventHandler;
49
+ onChange?: (event: SearchInputEvent) => void;
42
50
  /**
43
51
  * Input name
44
52
  */
@@ -58,11 +66,11 @@ export type SearchInputProps = {
58
66
  /**
59
67
  * Callback when input is blur
60
68
  */
61
- onBlur?: React.FocusEventHandler;
69
+ onBlur?: React.FocusEventHandler<HTMLElement>;
62
70
  /**
63
71
  * Callback when input is focus
64
72
  */
65
- onFocus?: React.FocusEventHandler;
73
+ onFocus?: React.FocusEventHandler<HTMLElement>;
66
74
  /**
67
75
  * Disable the input
68
76
  */
@@ -73,6 +81,7 @@ export type SearchInputProps = {
73
81
  required?: boolean;
74
82
  /**
75
83
  * If allow to remove input content with clear icon
84
+ * @default true
76
85
  */
77
86
  allowClear?: boolean;
78
87
  /**
@@ -83,6 +92,10 @@ export type SearchInputProps = {
83
92
  * Promp a helptext below input (useful when implemented with form validation)
84
93
  */
85
94
  helptext?: string;
95
+ /**
96
+ * Custom helptext
97
+ */
98
+ helptextClassName?: string;
86
99
  /**
87
100
  * Show a icon that contains tooltip
88
101
  */
@@ -94,12 +107,16 @@ export type SearchInputProps = {
94
107
  /**
95
108
  * Input width
96
109
  */
97
- width?: Size;
110
+ width?: Sizes;
98
111
  /**
99
112
  * Input menu max-height
100
113
  */
101
- menuMaxHeight?: Size;
102
- };
114
+ menuMaxHeight?: Sizes;
115
+ /**
116
+ * Show search icon or not
117
+ */
118
+ showSearchIcon?: boolean;
119
+ }
103
120
  /**
104
121
  * Search Input component that carefully takes care of accessibility and allow keyboard controls.
105
122
  *