@wireapp/react-ui-kit 9.17.9 → 9.18.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 (188) hide show
  1. package/lib/Form/Button.js +1 -15
  2. package/lib/Form/Button.styles.js +157 -110
  3. package/lib/Form/ButtonLink.d.ts.map +1 -1
  4. package/lib/Form/ButtonLink.js +5 -16
  5. package/lib/Form/Checkbox.js +75 -45
  6. package/lib/Form/CodeInput.js +17 -6
  7. package/lib/Form/DropFileInput.js +5 -14
  8. package/lib/Form/ErrorMessage.js +8 -19
  9. package/lib/Form/Form.d.ts.map +1 -1
  10. package/lib/Form/Form.js +2 -2
  11. package/lib/Form/IndicatorRangeInput.js +6 -19
  12. package/lib/Form/IndicatorRangeInput.styles.js +36 -6
  13. package/lib/Form/Input.js +21 -18
  14. package/lib/Form/InputBlock.d.ts +1 -1
  15. package/lib/Form/InputBlock.d.ts.map +1 -1
  16. package/lib/Form/InputBlock.js +1 -1
  17. package/lib/Form/InputLabel.js +6 -20
  18. package/lib/Form/InputSubmitCombo.js +22 -25
  19. package/lib/Form/RangeInput.d.ts +0 -1
  20. package/lib/Form/RangeInput.d.ts.map +1 -1
  21. package/lib/Form/RangeInput.js +2 -14
  22. package/lib/Form/RangeInput.styles.js +26 -14
  23. package/lib/Form/RoundIconButton.js +14 -16
  24. package/lib/Form/Select.d.ts.map +1 -1
  25. package/lib/Form/Select.js +9 -16
  26. package/lib/Form/SelectComponents.d.ts.map +1 -1
  27. package/lib/Form/SelectComponents.js +21 -35
  28. package/lib/Form/SelectStyles.js +164 -82
  29. package/lib/Form/TextArea.js +11 -4
  30. package/lib/Form/Tooltip.js +2 -14
  31. package/lib/GlobalStyle.d.ts +0 -1
  32. package/lib/GlobalStyle.d.ts.map +1 -1
  33. package/lib/GlobalStyle.js +17 -3
  34. package/lib/Icon/AddPeopleIcon.js +1 -15
  35. package/lib/Icon/ArchiveIcon.js +1 -1
  36. package/lib/Icon/ArrowDown.js +1 -15
  37. package/lib/Icon/ArrowIcon.js +1 -15
  38. package/lib/Icon/AttachmentIcon.js +1 -1
  39. package/lib/Icon/AudioVideoIcon.js +1 -1
  40. package/lib/Icon/BlockIcon.js +1 -1
  41. package/lib/Icon/Brand/AndroidIcon.js +1 -1
  42. package/lib/Icon/Brand/AppleIcon.js +1 -1
  43. package/lib/Icon/Brand/ChromeIcon.js +1 -1
  44. package/lib/Icon/Brand/FacebookIcon.js +1 -1
  45. package/lib/Icon/Brand/GitHubIcon.js +1 -1
  46. package/lib/Icon/Brand/LinkedInIcon.js +1 -1
  47. package/lib/Icon/Brand/LinuxIcon.js +1 -1
  48. package/lib/Icon/Brand/MicrosoftIcon.js +1 -1
  49. package/lib/Icon/Brand/TwitterIcon.js +1 -1
  50. package/lib/Icon/CallIcon.js +1 -1
  51. package/lib/Icon/CamIcon.js +1 -1
  52. package/lib/Icon/CameraIcon.js +1 -15
  53. package/lib/Icon/CertificateExpired.js +1 -1
  54. package/lib/Icon/CertificateRevoked.js +1 -1
  55. package/lib/Icon/CheckIcon.js +1 -1
  56. package/lib/Icon/CheckRoundIcon.js +1 -1
  57. package/lib/Icon/ChevronIcon.js +1 -15
  58. package/lib/Icon/CircleCloseIcon.js +1 -1
  59. package/lib/Icon/CloseIcon.js +1 -1
  60. package/lib/Icon/CopyIcon.js +1 -1
  61. package/lib/Icon/DeviceIcon.js +1 -1
  62. package/lib/Icon/DownloadIcon.js +1 -1
  63. package/lib/Icon/EditDocumentIcon.js +1 -15
  64. package/lib/Icon/EditIcon.js +1 -1
  65. package/lib/Icon/EnterIcon.js +1 -1
  66. package/lib/Icon/ErrorIcon.js +1 -1
  67. package/lib/Icon/ExpiresSoon.js +1 -1
  68. package/lib/Icon/FileIcon.js +1 -1
  69. package/lib/Icon/GifIcon.js +1 -1
  70. package/lib/Icon/GridIcon.js +1 -15
  71. package/lib/Icon/GroupIcon.js +1 -1
  72. package/lib/Icon/HangupIcon.js +1 -1
  73. package/lib/Icon/HideIcon.js +1 -1
  74. package/lib/Icon/ImageIcon.js +1 -1
  75. package/lib/Icon/InfoIcon.js +1 -1
  76. package/lib/Icon/InviteIcon.js +1 -1
  77. package/lib/Icon/LeaveIcon.js +1 -1
  78. package/lib/Icon/LinkIcon.js +1 -15
  79. package/lib/Icon/ListIcon.js +1 -1
  80. package/lib/Icon/LockIcon.js +1 -1
  81. package/lib/Icon/MLSVerified.js +1 -1
  82. package/lib/Icon/MessageIcon.js +1 -1
  83. package/lib/Icon/MinusIcon.js +1 -1
  84. package/lib/Icon/MoreIcon.js +1 -1
  85. package/lib/Icon/MuteIcon.js +1 -1
  86. package/lib/Icon/NotificationIcon.js +1 -1
  87. package/lib/Icon/NotificationOffIcon.js +1 -1
  88. package/lib/Icon/OptionsIcon.js +1 -1
  89. package/lib/Icon/OutlineCheck.d.ts +3 -0
  90. package/lib/Icon/OutlineCheck.d.ts.map +1 -0
  91. package/lib/Icon/OutlineCheck.js +25 -0
  92. package/lib/Icon/PeopleIcon.js +1 -15
  93. package/lib/Icon/PingIcon.js +1 -1
  94. package/lib/Icon/PlaneIcon.js +1 -1
  95. package/lib/Icon/PlusIcon.js +1 -1
  96. package/lib/Icon/ProfileIcon.js +1 -1
  97. package/lib/Icon/ProteusVerified.js +1 -1
  98. package/lib/Icon/RecordBoldIcon.js +4 -18
  99. package/lib/Icon/RecordIcon.js +1 -1
  100. package/lib/Icon/RecordPendingIcon.js +1 -1
  101. package/lib/Icon/ReloadIcon.js +1 -1
  102. package/lib/Icon/SVGIcon.js +2 -14
  103. package/lib/Icon/ScreenshareIcon.js +1 -1
  104. package/lib/Icon/SearchIcon.js +1 -1
  105. package/lib/Icon/ServicesIcon.js +1 -1
  106. package/lib/Icon/SettingsIcon.js +1 -1
  107. package/lib/Icon/ShowIcon.js +1 -1
  108. package/lib/Icon/SignIcon.js +1 -1
  109. package/lib/Icon/SpeakerIcon.js +1 -1
  110. package/lib/Icon/StarIcon.js +1 -1
  111. package/lib/Icon/SupportIcon.js +1 -1
  112. package/lib/Icon/TeamIcon.js +1 -1
  113. package/lib/Icon/TimedIcon.js +1 -1
  114. package/lib/Icon/TrashCrossIcon.js +1 -1
  115. package/lib/Icon/TrashIcon.js +1 -1
  116. package/lib/Icon/TriangleIcon.js +1 -15
  117. package/lib/Icon/UploadIcon.js +1 -1
  118. package/lib/Icon/VerificationShieldIcon.js +1 -4
  119. package/lib/Icon/WireIcon.js +1 -1
  120. package/lib/Icon/index.d.ts +1 -0
  121. package/lib/Icon/index.d.ts.map +1 -1
  122. package/lib/Icon/index.js +1 -0
  123. package/lib/Identity/Animation.js +62 -88
  124. package/lib/Identity/Avatar.js +2 -2
  125. package/lib/Identity/AvatarGrid.js +4 -16
  126. package/lib/Identity/Logo.js +1 -15
  127. package/lib/Identity/colors-v2.js +25 -3
  128. package/lib/Identity/colors.js +11 -2
  129. package/lib/Layout/Box.d.ts +1 -1
  130. package/lib/Layout/Box.d.ts.map +1 -1
  131. package/lib/Layout/Box.js +1 -1
  132. package/lib/Layout/Column.d.ts +1 -1
  133. package/lib/Layout/Column.d.ts.map +1 -1
  134. package/lib/Layout/Column.js +2 -2
  135. package/lib/Layout/Container.js +6 -20
  136. package/lib/Layout/Content.d.ts +1 -1
  137. package/lib/Layout/Content.d.ts.map +1 -1
  138. package/lib/Layout/Content.js +1 -1
  139. package/lib/Layout/FlexBox.js +1 -1
  140. package/lib/Layout/Footer.d.ts.map +1 -1
  141. package/lib/Layout/Footer.js +1 -1
  142. package/lib/Layout/Header.d.ts +1 -1
  143. package/lib/Layout/Header.d.ts.map +1 -1
  144. package/lib/Layout/Header.js +1 -1
  145. package/lib/Layout/MatchMedia.js +8 -8
  146. package/lib/Layout/Spacer.js +1 -2
  147. package/lib/Layout/StyledApp.js +2 -16
  148. package/lib/Layout/headerMenu/HeaderMenu.js +2 -14
  149. package/lib/Layout/headerMenu/HeaderSubMenu.d.ts +1 -1
  150. package/lib/Layout/headerMenu/HeaderSubMenu.d.ts.map +1 -1
  151. package/lib/Layout/headerMenu/HeaderSubMenu.js +4 -16
  152. package/lib/Layout/headerMenu/MenuContent.js +14 -2
  153. package/lib/Layout/headerMenu/MenuItems.js +1 -1
  154. package/lib/Layout/headerMenu/MenuLink.js +28 -35
  155. package/lib/Layout/headerMenu/MenuOpenButton.js +1 -1
  156. package/lib/Layout/headerMenu/MenuScrollableItems.js +1 -1
  157. package/lib/Layout/headerMenu/MenuSubLink.js +15 -5
  158. package/lib/Menu/MenuModal.d.ts.map +1 -1
  159. package/lib/Menu/MenuModal.js +28 -35
  160. package/lib/Menu/TabBar.d.ts +1 -1
  161. package/lib/Menu/TabBar.d.ts.map +1 -1
  162. package/lib/Menu/TabBar.js +13 -22
  163. package/lib/Misc/ButtonGroup.js +38 -35
  164. package/lib/Misc/IconButton.js +63 -50
  165. package/lib/Misc/IsInViewport.js +2 -14
  166. package/lib/Misc/Loading.js +3 -15
  167. package/lib/Misc/Pagination.js +2 -14
  168. package/lib/Misc/Pill.js +1 -1
  169. package/lib/Misc/childrenWithDefaultProps.d.ts.map +1 -1
  170. package/lib/Misc/childrenWithDefaultProps.js +1 -1
  171. package/lib/Modal/Modal.js +11 -22
  172. package/lib/Modal/Overlay.d.ts +2 -2
  173. package/lib/Modal/Overlay.d.ts.map +1 -1
  174. package/lib/Modal/Overlay.js +5 -19
  175. package/lib/Text/Heading.js +49 -45
  176. package/lib/Text/Label.d.ts.map +1 -1
  177. package/lib/Text/Label.js +13 -23
  178. package/lib/Text/Line.js +1 -1
  179. package/lib/Text/Link.js +26 -31
  180. package/lib/Text/Paragraph.js +15 -23
  181. package/lib/Text/Text.js +6 -6
  182. package/lib/Text/TextLink.d.ts.map +1 -1
  183. package/lib/Text/TextLink.js +4 -16
  184. package/lib/Text/Title.js +5 -16
  185. package/lib/Theme/Theme.js +1 -1
  186. package/lib/mediaQueries.js +1 -1
  187. package/lib/util.js +1 -1
  188. package/package.json +3 -3
@@ -1,15 +1,4 @@
1
1
  "use strict";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
2
  Object.defineProperty(exports, "__esModule", { value: true });
14
3
  exports.filterButtonProps = exports.Button = exports.ButtonVariant = void 0;
15
4
  const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
@@ -45,10 +34,7 @@ var ButtonVariant;
45
34
  ButtonVariant["SEND"] = "send";
46
35
  ButtonVariant["CANCEL"] = "cancel";
47
36
  })(ButtonVariant || (exports.ButtonVariant = ButtonVariant = {}));
48
- const Button = (_a) => {
49
- var { showLoading, children, loadingColor = Identity_1.COLOR.WHITE } = _a, props = __rest(_a, ["showLoading", "children", "loadingColor"]);
50
- return ((0, jsx_runtime_1.jsx)("button", Object.assign({ css: (theme) => (0, Button_styles_1.buttonStyle)(theme, props) }, (0, exports.filterButtonProps)(props), { children: showLoading ? (0, jsx_runtime_1.jsx)(Misc_1.Loading, { size: 30, color: loadingColor, style: { display: 'flex', margin: 'auto' } }) : children })));
51
- };
37
+ const Button = ({ showLoading, children, loadingColor = Identity_1.COLOR.WHITE, ...props }) => ((0, jsx_runtime_1.jsx)("button", { css: (theme) => (0, Button_styles_1.buttonStyle)(theme, props), ...(0, exports.filterButtonProps)(props), children: showLoading ? (0, jsx_runtime_1.jsx)(Misc_1.Loading, { size: 30, color: loadingColor, style: { display: 'flex', margin: 'auto' } }) : children }));
52
38
  exports.Button = Button;
53
39
  const filterButtonProps = (props) => {
54
40
  return (0, util_1.filterProps)((0, Text_1.filterTextProps)(props), ['backgroundColor', 'noCapital']);
@@ -17,17 +17,6 @@
17
17
  * along with this program. If not, see http://www.gnu.org/licenses/.
18
18
  *
19
19
  */
20
- var __rest = (this && this.__rest) || function (s, e) {
21
- var t = {};
22
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
23
- t[p] = s[p];
24
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
25
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
26
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
27
- t[p[i]] = s[p[i]];
28
- }
29
- return t;
30
- };
31
20
  Object.defineProperty(exports, "__esModule", { value: true });
32
21
  exports.buttonStyle = void 0;
33
22
  const Button_1 = require("./Button");
@@ -40,20 +29,23 @@ const buttonPrimaryStyles = (theme, { backgroundColor, disabled, isActive }) =>
40
29
  border: `1px solid ${theme.Button.primaryActiveBorder}`,
41
30
  color: Identity_1.COLOR.WHITE,
42
31
  };
43
- return Object.assign(Object.assign({}, (isActive
44
- ? activeStyles
45
- : {
46
- color: disabled ? theme.Button.primaryDisabledText : theme.general.contrastColor,
47
- backgroundColor: backgroundColor || disabled ? theme.Button.primaryDisabledBg : theme.Button.primaryBg,
48
- })), (!disabled && {
49
- '&:hover, &:focus': {
50
- backgroundColor: theme.Button.primaryHoverBg,
51
- },
52
- '&:focus': {
53
- border: `1px solid ${theme.Button.primaryFocusBorder}`,
54
- },
55
- '&:active': activeStyles,
56
- }));
32
+ return {
33
+ ...(isActive
34
+ ? activeStyles
35
+ : {
36
+ color: disabled ? theme.Button.primaryDisabledText : theme.general.contrastColor,
37
+ backgroundColor: backgroundColor || disabled ? theme.Button.primaryDisabledBg : theme.Button.primaryBg,
38
+ }),
39
+ ...(!disabled && {
40
+ '&:hover, &:focus': {
41
+ backgroundColor: theme.Button.primaryHoverBg,
42
+ },
43
+ '&:focus': {
44
+ border: `1px solid ${theme.Button.primaryFocusBorder}`,
45
+ },
46
+ '&:active': activeStyles,
47
+ }),
48
+ };
57
49
  };
58
50
  const buttonSecondaryStyles = (theme, { backgroundColor, disabled, isActive }) => {
59
51
  const activeStyles = {
@@ -61,20 +53,24 @@ const buttonSecondaryStyles = (theme, { backgroundColor, disabled, isActive }) =
61
53
  border: `1px solid ${theme.Button.secondaryActiveBorder}`,
62
54
  color: theme.general.primaryColor,
63
55
  };
64
- return Object.assign(Object.assign({ border: `1px solid ${theme.IconButton.primaryBorderColor}` }, (isActive
65
- ? activeStyles
66
- : {
67
- color: disabled ? theme.Input.placeholderColor : theme.general.color,
68
- backgroundColor: backgroundColor || disabled ? theme.IconButton.primaryDisabledBgColor : theme.IconButton.primaryBgColor,
69
- })), (!disabled && {
70
- '&:hover, &:focus': {
71
- border: `1px solid ${theme.Button.secondaryHoverBorder}`,
72
- },
73
- '&:focus': {
74
- color: theme.IconButton.primaryActiveFillColor,
75
- },
76
- '&:active': activeStyles,
77
- }));
56
+ return {
57
+ border: `1px solid ${theme.IconButton.primaryBorderColor}`,
58
+ ...(isActive
59
+ ? activeStyles
60
+ : {
61
+ color: disabled ? theme.Input.placeholderColor : theme.general.color,
62
+ backgroundColor: backgroundColor || disabled ? theme.IconButton.primaryDisabledBgColor : theme.IconButton.primaryBgColor,
63
+ }),
64
+ ...(!disabled && {
65
+ '&:hover, &:focus': {
66
+ border: `1px solid ${theme.Button.secondaryHoverBorder}`,
67
+ },
68
+ '&:focus': {
69
+ color: theme.IconButton.primaryActiveFillColor,
70
+ },
71
+ '&:active': activeStyles,
72
+ }),
73
+ };
78
74
  };
79
75
  const buttonTertiaryStyles = (theme, { backgroundColor, disabled, isActive }) => {
80
76
  const activeStyles = {
@@ -84,95 +80,146 @@ const buttonTertiaryStyles = (theme, { backgroundColor, disabled, isActive }) =>
84
80
  fill: theme.IconButton.primaryActiveFillColor,
85
81
  },
86
82
  };
87
- return Object.assign(Object.assign({ border: disabled ? `1px solid ${theme.Button.tertiaryDisabledBorder}` : `1px solid ${theme.Button.tertiaryBorder}`, borderRadius: '12px', fontSize: theme.fontSizes.medium, fontWeight: 700, lineHeight: '1.5rem', padding: '4px 8px', '& > svg > path': {
83
+ return {
84
+ border: disabled ? `1px solid ${theme.Button.tertiaryDisabledBorder}` : `1px solid ${theme.Button.tertiaryBorder}`,
85
+ borderRadius: '12px',
86
+ fontSize: theme.fontSizes.medium,
87
+ fontWeight: 700,
88
+ lineHeight: '1.5rem',
89
+ padding: '4px 8px',
90
+ '& > svg > path': {
88
91
  fill: disabled ? theme.Input.placeholderColor : theme.general.color,
89
- } }, (isActive
90
- ? activeStyles
91
- : {
92
- color: disabled ? theme.Input.placeholderColor : theme.general.color,
93
- backgroundColor: backgroundColor || disabled ? theme.Button.tertiarydisabledBg : theme.Button.tertiaryBg,
94
- })), (!disabled && {
95
- '&:hover, &:focus': {
96
- backgroundColor: theme.Button.tertiaryHoverBg,
97
- border: `1px solid ${theme.Button.tertiaryHoverBorder}`,
98
92
  },
99
- '&:focus': {
100
- border: `1px solid ${theme.general.focusColor}`,
101
- },
102
- '&:active': activeStyles,
103
- }));
93
+ ...(isActive
94
+ ? activeStyles
95
+ : {
96
+ color: disabled ? theme.Input.placeholderColor : theme.general.color,
97
+ backgroundColor: backgroundColor || disabled ? theme.Button.tertiarydisabledBg : theme.Button.tertiaryBg,
98
+ }),
99
+ ...(!disabled && {
100
+ '&:hover, &:focus': {
101
+ backgroundColor: theme.Button.tertiaryHoverBg,
102
+ border: `1px solid ${theme.Button.tertiaryHoverBorder}`,
103
+ },
104
+ '&:focus': {
105
+ border: `1px solid ${theme.general.focusColor}`,
106
+ },
107
+ '&:active': activeStyles,
108
+ }),
109
+ };
104
110
  };
105
111
  const buttonQuaternaryStyles = ({ backgroundColor, disabled, isActive }) => {
106
112
  const activeStyles = {
107
113
  backgroundColor: Identity_1.COLOR_V2.GREEN_LIGHT_700,
108
114
  };
109
- return Object.assign(Object.assign({ lineHeight: '1.5rem' }, (isActive
110
- ? activeStyles
111
- : {
112
- color: disabled ? Identity_1.COLOR_V2.GRAY_80 : Identity_1.COLOR_V2.WHITE,
113
- backgroundColor: backgroundColor || disabled ? Identity_1.COLOR_V2.GRAY_50 : Identity_1.COLOR_V2.GREEN,
114
- })), (!disabled && {
115
- '&:hover, &:focus': {
116
- backgroundColor: Identity_1.COLOR_V2.GREEN_LIGHT_600,
117
- },
118
- '&:focus': {
119
- border: `1px solid ${Identity_1.COLOR_V2.GREEN_LIGHT_700}`,
120
- },
121
- '&:active': activeStyles,
122
- }));
115
+ return {
116
+ lineHeight: '1.5rem',
117
+ ...(isActive
118
+ ? activeStyles
119
+ : {
120
+ color: disabled ? Identity_1.COLOR_V2.GRAY_80 : Identity_1.COLOR_V2.WHITE,
121
+ backgroundColor: backgroundColor || disabled ? Identity_1.COLOR_V2.GRAY_50 : Identity_1.COLOR_V2.GREEN,
122
+ }),
123
+ ...(!disabled && {
124
+ '&:hover, &:focus': {
125
+ backgroundColor: Identity_1.COLOR_V2.GREEN_LIGHT_600,
126
+ },
127
+ '&:focus': {
128
+ border: `1px solid ${Identity_1.COLOR_V2.GREEN_LIGHT_700}`,
129
+ },
130
+ '&:active': activeStyles,
131
+ }),
132
+ };
123
133
  };
124
134
  const buttonCancelStyles = ({ backgroundColor, disabled, isActive }) => {
125
135
  const activeStyles = {
126
136
  backgroundColor: Identity_1.COLOR_V2.RED_LIGHT_700,
127
137
  };
128
- return Object.assign(Object.assign({ lineHeight: '1.5rem' }, (isActive
129
- ? activeStyles
130
- : {
131
- color: disabled ? Identity_1.COLOR_V2.GRAY_80 : Identity_1.COLOR_V2.WHITE,
132
- backgroundColor: backgroundColor || disabled ? Identity_1.COLOR_V2.GRAY_50 : Identity_1.COLOR_V2.RED,
133
- })), (!disabled && {
134
- '&:hover, &:focus': {
135
- backgroundColor: Identity_1.COLOR_V2.RED_LIGHT_600,
136
- },
137
- '&:focus': {
138
- border: `1px solid ${Identity_1.COLOR_V2.RED_LIGHT_700}`,
139
- },
140
- '&:active': activeStyles,
141
- }));
138
+ return {
139
+ lineHeight: '1.5rem',
140
+ ...(isActive
141
+ ? activeStyles
142
+ : {
143
+ color: disabled ? Identity_1.COLOR_V2.GRAY_80 : Identity_1.COLOR_V2.WHITE,
144
+ backgroundColor: backgroundColor || disabled ? Identity_1.COLOR_V2.GRAY_50 : Identity_1.COLOR_V2.RED,
145
+ }),
146
+ ...(!disabled && {
147
+ '&:hover, &:focus': {
148
+ backgroundColor: Identity_1.COLOR_V2.RED_LIGHT_600,
149
+ },
150
+ '&:focus': {
151
+ border: `1px solid ${Identity_1.COLOR_V2.RED_LIGHT_700}`,
152
+ },
153
+ '&:active': activeStyles,
154
+ }),
155
+ };
142
156
  };
143
157
  const buttonSendStyles = ({ backgroundColor, disabled, isActive }) => {
144
158
  const activeStyles = {
145
159
  backgroundColor: Identity_1.COLOR_V2.BLUE_LIGHT_700,
146
160
  };
147
- return Object.assign(Object.assign({ width: '40px' }, (isActive
148
- ? activeStyles
149
- : {
150
- backgroundColor: backgroundColor || disabled ? Identity_1.COLOR_V2.GRAY_70 : Identity_1.COLOR_V2.BLUE,
151
- })), (!disabled && {
152
- '&:hover, &:focus': {
153
- backgroundColor: Identity_1.COLOR_V2.BLUE_LIGHT_600,
154
- },
155
- '&:focus': {
156
- border: `1px solid ${Identity_1.COLOR_V2.BLUE_LIGHT_800}`,
157
- },
158
- '&:active': activeStyles,
159
- }));
161
+ return {
162
+ width: '40px',
163
+ ...(isActive
164
+ ? activeStyles
165
+ : {
166
+ backgroundColor: backgroundColor || disabled ? Identity_1.COLOR_V2.GRAY_70 : Identity_1.COLOR_V2.BLUE,
167
+ }),
168
+ ...(!disabled && {
169
+ '&:hover, &:focus': {
170
+ backgroundColor: Identity_1.COLOR_V2.BLUE_LIGHT_600,
171
+ },
172
+ '&:focus': {
173
+ border: `1px solid ${Identity_1.COLOR_V2.BLUE_LIGHT_800}`,
174
+ },
175
+ '&:active': activeStyles,
176
+ }),
177
+ };
160
178
  };
161
- const buttonStyle = (theme, _a) => {
162
- var { variant = Button_1.ButtonVariant.PRIMARY, backgroundColor, block = false, disabled = false, noCapital = false, bold = true, center = true, color = Identity_1.COLOR.WHITE, fontSize = theme.fontSizes.base, noWrap = true, textTransform = 'none', truncate = true } = _a, props = __rest(_a, ["variant", "backgroundColor", "block", "disabled", "noCapital", "bold", "center", "color", "fontSize", "noWrap", "textTransform", "truncate"]);
163
- return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (0, Text_1.textStyle)(theme, Object.assign({ block,
164
- bold,
165
- center,
166
- disabled,
167
- fontSize,
168
- noWrap,
169
- textTransform,
170
- truncate }, props))), { border: 0, cursor: disabled ? 'default' : 'pointer', display: 'flex', alignItems: 'center', justifyContent: 'center', marginBottom: '16px', padding: 0, outline: 'none', textDecoration: 'none', touchAction: 'manipulation', transition: motions_1.defaultTransition, width: block ? '100%' : 'auto', '&:hover, &:focus': {
179
+ const buttonStyle = (theme, { variant = Button_1.ButtonVariant.PRIMARY, backgroundColor, block = false, disabled = false, noCapital = false, bold = true, center = true, color = Identity_1.COLOR.WHITE, fontSize = theme.fontSizes.base, noWrap = true, textTransform = 'none', truncate = true, ...props }) => {
180
+ return {
181
+ ...(0, Text_1.textStyle)(theme, {
182
+ block,
183
+ bold,
184
+ center,
185
+ disabled,
186
+ fontSize,
187
+ noWrap,
188
+ textTransform,
189
+ truncate,
190
+ ...props,
191
+ }),
192
+ border: 0,
193
+ cursor: disabled ? 'default' : 'pointer',
194
+ display: 'flex',
195
+ alignItems: 'center',
196
+ justifyContent: 'center',
197
+ marginBottom: '16px',
198
+ padding: 0,
199
+ outline: 'none',
200
+ textDecoration: 'none',
201
+ touchAction: 'manipulation',
202
+ transition: motions_1.defaultTransition,
203
+ width: block ? '100%' : 'auto',
204
+ '&:hover, &:focus': {
171
205
  textDecoration: 'none',
172
- } }), (variant !== Button_1.ButtonVariant.TERTIARY && Object.assign({ borderRadius: variant === Button_1.ButtonVariant.SEND ? '100%' : '16px', height: variant === Button_1.ButtonVariant.SEND ? '40px' : '48px', lineHeight: variant === Button_1.ButtonVariant.SEND ? '40px' : '48px' }, (variant !== Button_1.ButtonVariant.SEND && {
173
- maxWidth: '100%',
174
- minWidth: '125px',
175
- padding: '0 16px',
176
- })))), (variant === Button_1.ButtonVariant.PRIMARY && buttonPrimaryStyles(theme, props))), (variant === Button_1.ButtonVariant.SECONDARY && buttonSecondaryStyles(theme, props))), (variant === Button_1.ButtonVariant.TERTIARY && buttonTertiaryStyles(theme, props))), (variant === Button_1.ButtonVariant.QUATERNARY && buttonQuaternaryStyles(props))), (variant === Button_1.ButtonVariant.CANCEL && buttonCancelStyles(props))), (variant === Button_1.ButtonVariant.SEND && buttonSendStyles(props)));
206
+ },
207
+ ...(variant !== Button_1.ButtonVariant.TERTIARY && {
208
+ borderRadius: variant === Button_1.ButtonVariant.SEND ? '100%' : '16px',
209
+ height: variant === Button_1.ButtonVariant.SEND ? '40px' : '48px',
210
+ lineHeight: variant === Button_1.ButtonVariant.SEND ? '40px' : '48px',
211
+ ...(variant !== Button_1.ButtonVariant.SEND && {
212
+ maxWidth: '100%',
213
+ minWidth: '125px',
214
+ padding: '0 16px',
215
+ }),
216
+ }),
217
+ ...(variant === Button_1.ButtonVariant.PRIMARY && buttonPrimaryStyles(theme, props)),
218
+ ...(variant === Button_1.ButtonVariant.SECONDARY && buttonSecondaryStyles(theme, props)),
219
+ ...(variant === Button_1.ButtonVariant.TERTIARY && buttonTertiaryStyles(theme, props)),
220
+ ...(variant === Button_1.ButtonVariant.QUATERNARY && buttonQuaternaryStyles(props)),
221
+ ...(variant === Button_1.ButtonVariant.CANCEL && buttonCancelStyles(props)),
222
+ ...(variant === Button_1.ButtonVariant.SEND && buttonSendStyles(props)),
223
+ };
177
224
  };
178
225
  exports.buttonStyle = buttonStyle;
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonLink.d.ts","sourceRoot":"","sources":["../../src/Form/ButtonLink.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAC,WAAW,EAAC,MAAM,UAAU,CAAC;AAIrC,OAAO,EAAC,KAAK,EAAC,MAAM,WAAW,CAAC;AAKhC,eAAO,MAAM,eAAe,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,CAAC,iBAAiB,CAAC,KAAK,SAGrF,CAAC;AAUH,eAAO,MAAM,UAAU,sDAKpB,YAAY,iBAAiB,CAAC,qDAIhC,CAAC"}
1
+ {"version":3,"file":"ButtonLink.d.ts","sourceRoot":"","sources":["../../src/Form/ButtonLink.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAC,WAAW,EAAC,MAAM,UAAU,CAAC;AAIrC,OAAO,EAAC,KAAK,EAAC,MAAM,WAAW,CAAC;AAKhC,eAAO,MAAM,eAAe,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,CAAC,iBAAiB,CAAC,KAAK,SAGrF,CAAC;AAUH,eAAO,MAAM,UAAU,sDAKpB,WAAW,CAAC,iBAAiB,CAAC,qDAIhC,CAAC"}
@@ -1,15 +1,4 @@
1
1
  "use strict";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
2
  Object.defineProperty(exports, "__esModule", { value: true });
14
3
  exports.ButtonLink = exports.buttonLinkStyle = void 0;
15
4
  const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
@@ -18,7 +7,10 @@ const Identity_1 = require("../Identity");
18
7
  const Misc_1 = require("../Misc");
19
8
  const Text_1 = require("../Text");
20
9
  const util_1 = require("../util");
21
- const buttonLinkStyle = (theme, props) => (Object.assign(Object.assign({}, (0, Button_styles_1.buttonStyle)(theme, props)), { display: 'inline-flex !important' }));
10
+ const buttonLinkStyle = (theme, props) => ({
11
+ ...(0, Button_styles_1.buttonStyle)(theme, props),
12
+ display: 'inline-flex !important',
13
+ });
22
14
  exports.buttonLinkStyle = buttonLinkStyle;
23
15
  const filterButtonLinkProps = (props) => {
24
16
  return (0, util_1.filterProps)((0, Text_1.filterTextProps)(props), [
@@ -27,8 +19,5 @@ const filterButtonLinkProps = (props) => {
27
19
  'noCapital',
28
20
  ]);
29
21
  };
30
- const ButtonLink = (_a) => {
31
- var { children, showLoading, loadingColor = Identity_1.COLOR.WHITE } = _a, props = __rest(_a, ["children", "showLoading", "loadingColor"]);
32
- return ((0, jsx_runtime_1.jsx)("a", Object.assign({ css: (theme) => (0, exports.buttonLinkStyle)(theme, props) }, filterButtonLinkProps(props), { children: showLoading ? (0, jsx_runtime_1.jsx)(Misc_1.Loading, { size: 30, color: loadingColor, style: { display: 'flex', margin: 'auto' } }) : children })));
33
- };
22
+ const ButtonLink = ({ children, showLoading, loadingColor = Identity_1.COLOR.WHITE, ...props }) => ((0, jsx_runtime_1.jsx)("a", { css: (theme) => (0, exports.buttonLinkStyle)(theme, props), ...filterButtonLinkProps(props), children: showLoading ? (0, jsx_runtime_1.jsx)(Misc_1.Loading, { size: 30, color: loadingColor, style: { display: 'flex', margin: 'auto' } }) : children }));
34
23
  exports.ButtonLink = ButtonLink;
@@ -22,17 +22,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
- var __rest = (this && this.__rest) || function (s, e) {
26
- var t = {};
27
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
28
- t[p] = s[p];
29
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
30
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
31
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
32
- t[p[i]] = s[p[i]];
33
- }
34
- return t;
35
- };
36
25
  Object.defineProperty(exports, "__esModule", { value: true });
37
26
  exports.CheckboxLabel = exports.Checkbox = void 0;
38
27
  const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
@@ -58,53 +47,94 @@ const react_1 = require("react");
58
47
  const React = __importStar(require("react"));
59
48
  const Input_1 = require("./Input");
60
49
  const Text_1 = require("../Text");
61
- const StyledLabel = (_a) => {
62
- var { disabled, markInvalid, aligncenter = false, labelBeforeCheckbox = false, children } = _a, props = __rest(_a, ["disabled", "markInvalid", "aligncenter", "labelBeforeCheckbox", "children"]);
63
- return ((0, jsx_runtime_1.jsxs)("label", Object.assign({ css: (theme) => (Object.assign(Object.assign(Object.assign(Object.assign({ [`.${Input_1.INPUT_CLASSNAME}:checked + &::before`]: {
50
+ const StyledLabel = ({ disabled, markInvalid, aligncenter = false, labelBeforeCheckbox = false, children, ...props }) => {
51
+ return ((0, jsx_runtime_1.jsxs)("label", { css: (theme) => ({
52
+ [`.${Input_1.INPUT_CLASSNAME}:checked + &::before`]: {
64
53
  background: `${disabled ? theme.Checkbox.disablecheckedBgColor : theme.general.primaryColor}`,
65
54
  borderColor: theme.general.primaryColor,
66
- }, [`.${Input_1.INPUT_CLASSNAME}:checked + & > svg`]: {
55
+ },
56
+ [`.${Input_1.INPUT_CLASSNAME}:checked + & > svg`]: {
67
57
  fill: theme.general.backgroundColor,
68
- }, [`.${Input_1.INPUT_CLASSNAME} + & > svg`]: Object.assign({ fill: 'none', position: 'absolute', top: '50%', transform: 'translateY(-50%)' }, (labelBeforeCheckbox
69
- ? {
70
- right: '11px',
71
- }
72
- : {
73
- left: '4px',
74
- })) }, (!disabled && {
75
- [`.${Input_1.INPUT_CLASSNAME}:hover + &::before`]: {
76
- borderColor: theme.general.primaryColor,
77
58
  },
78
- })), { [`.${Input_1.INPUT_CLASSNAME} + &::before`]: Object.assign(Object.assign({ background: disabled ? theme.Checkbox.disableBgColor : theme.Checkbox.background }, (!disabled
79
- ? {
80
- border: markInvalid
81
- ? `2px solid ${theme.Checkbox.invalidBorderColor}`
82
- : `2px solid ${theme.Checkbox.border}`,
83
- }
84
- : {
85
- border: `2px solid ${theme.Checkbox.disableBorderColor}`,
86
- })), { borderRadius: '3px', boxSizing: 'border-box', content: '""', display: 'inline-block', minWidth: '22px', height: '22px', lineHeight: '1.4rem', margin: '0 8px 0 0px', color: theme.general.color }) }), (labelBeforeCheckbox && {
87
- flexDirection: 'row-reverse',
88
- justifyContent: 'space-between',
89
- })), { alignItems: 'center', position: 'relative', margin: '0 0 0 -16px', width: aligncenter ? 'auto' : '100%', lineHeight: '1.4rem', display: 'flex', opacity: disabled ? 0.56 : 1, cursor: disabled ? 'not-allowed' : 'pointer', borderRadius: '4px' })) }, props, { children: [children, (0, jsx_runtime_1.jsx)("svg", { width: "15", height: "13", viewBox: "0 0 16 13", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M5.65685 12.0711L15.9842 1.62738L14.57 0.213167L5.65685 9.24264L1.41421 5L0 6.41421L5.65685 12.0711Z" }) })] })));
59
+ [`.${Input_1.INPUT_CLASSNAME} + & > svg`]: {
60
+ fill: 'none',
61
+ position: 'absolute',
62
+ top: '50%',
63
+ transform: 'translateY(-50%)',
64
+ ...(labelBeforeCheckbox
65
+ ? {
66
+ right: '11px',
67
+ }
68
+ : {
69
+ left: '4px',
70
+ }),
71
+ },
72
+ ...(!disabled && {
73
+ [`.${Input_1.INPUT_CLASSNAME}:hover + &::before`]: {
74
+ borderColor: theme.general.primaryColor,
75
+ },
76
+ }),
77
+ [`.${Input_1.INPUT_CLASSNAME} + &::before`]: {
78
+ background: disabled ? theme.Checkbox.disableBgColor : theme.Checkbox.background,
79
+ ...(!disabled
80
+ ? {
81
+ border: markInvalid
82
+ ? `2px solid ${theme.Checkbox.invalidBorderColor}`
83
+ : `2px solid ${theme.Checkbox.border}`,
84
+ }
85
+ : {
86
+ border: `2px solid ${theme.Checkbox.disableBorderColor}`,
87
+ }),
88
+ borderRadius: '3px',
89
+ boxSizing: 'border-box',
90
+ content: '""',
91
+ display: 'inline-block',
92
+ minWidth: '22px',
93
+ height: '22px',
94
+ lineHeight: '1.4rem',
95
+ margin: '0 8px 0 0px',
96
+ color: theme.general.color,
97
+ },
98
+ ...(labelBeforeCheckbox && {
99
+ flexDirection: 'row-reverse',
100
+ justifyContent: 'space-between',
101
+ }),
102
+ alignItems: 'center',
103
+ position: 'relative',
104
+ margin: '0 0 0 -16px',
105
+ width: aligncenter ? 'auto' : '100%',
106
+ lineHeight: '1.4rem',
107
+ display: 'flex',
108
+ opacity: disabled ? 0.56 : 1,
109
+ cursor: disabled ? 'not-allowed' : 'pointer',
110
+ borderRadius: '4px',
111
+ }), ...props, children: [children, (0, jsx_runtime_1.jsx)("svg", { width: "15", height: "13", viewBox: "0 0 16 13", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M5.65685 12.0711L15.9842 1.62738L14.57 0.213167L5.65685 9.24264L1.41421 5L0 6.41421L5.65685 12.0711Z" }) })] }));
90
112
  };
91
- exports.Checkbox = React.forwardRef((_a, ref) => {
92
- var { id, children, style, disabled, wrapperCSS = {}, markInvalid, aligncenter, labelBeforeCheckbox, outlineOffset = '0.4rem' } = _a, props = __rest(_a, ["id", "children", "style", "disabled", "wrapperCSS", "markInvalid", "aligncenter", "labelBeforeCheckbox", "outlineOffset"]);
113
+ exports.Checkbox = React.forwardRef(({ id, children, style, disabled, wrapperCSS = {}, markInvalid, aligncenter, labelBeforeCheckbox, outlineOffset = '0.4rem', ...props }, ref) => {
93
114
  const inputId = (0, react_1.useId)();
94
- return ((0, jsx_runtime_1.jsxs)("div", { css: (theme) => (Object.assign({ alignItems: 'center', display: 'flex', justifyContent: 'flex-start', position: 'relative', left: '-0.3rem', [`.${Input_1.INPUT_CLASSNAME}:focus-visible + label`]: {
115
+ return ((0, jsx_runtime_1.jsxs)("div", { css: (theme) => ({
116
+ alignItems: 'center',
117
+ display: 'flex',
118
+ justifyContent: 'flex-start',
119
+ position: 'relative',
120
+ left: '-0.3rem',
121
+ [`.${Input_1.INPUT_CLASSNAME}:focus-visible + label`]: {
95
122
  outline: `1px solid ${theme.general.primaryColor}`,
96
123
  outlineOffset: outlineOffset,
97
- } }, wrapperCSS)), style: style, children: [(0, jsx_runtime_1.jsx)("input", Object.assign({ type: "checkbox", id: id !== null && id !== void 0 ? id : inputId, style: {
124
+ },
125
+ ...wrapperCSS,
126
+ }), style: style, children: [(0, jsx_runtime_1.jsx)("input", { type: "checkbox", id: id ?? inputId, style: {
98
127
  height: '22px',
99
128
  marginBottom: '0',
100
129
  opacity: 0,
101
130
  width: '22px',
102
131
  cursor: disabled ? 'not-allowed' : 'pointer',
103
- }, disabled: disabled, ref: ref, className: Input_1.INPUT_CLASSNAME }, props)), (0, jsx_runtime_1.jsx)(StyledLabel, { htmlFor: id !== null && id !== void 0 ? id : inputId, disabled: disabled, markInvalid: markInvalid, aligncenter: aligncenter, labelBeforeCheckbox: labelBeforeCheckbox, children: children })] }));
132
+ }, disabled: disabled, ref: ref, className: Input_1.INPUT_CLASSNAME, ...props }), (0, jsx_runtime_1.jsx)(StyledLabel, { htmlFor: id ?? inputId, disabled: disabled, markInvalid: markInvalid, aligncenter: aligncenter, labelBeforeCheckbox: labelBeforeCheckbox, children: children })] }));
104
133
  });
105
134
  exports.Checkbox.displayName = 'Checkbox';
106
- const CheckboxLabel = (_a) => {
107
- var props = __rest(_a, []);
108
- return ((0, jsx_runtime_1.jsx)(Text_1.Text, Object.assign({ css: (theme) => (Object.assign({}, (0, Text_1.textStyle)(theme, Object.assign({}, props)))) }, props)));
109
- };
135
+ const CheckboxLabel = ({ ...props }) => ((0, jsx_runtime_1.jsx)(Text_1.Text, { css: (theme) => ({
136
+ ...(0, Text_1.textStyle)(theme, {
137
+ ...props,
138
+ }),
139
+ }), ...props }));
110
140
  exports.CheckboxLabel = CheckboxLabel;
@@ -48,16 +48,27 @@ const React = __importStar(require("react"));
48
48
  const Input_1 = require("./Input");
49
49
  const Identity_1 = require("../Identity");
50
50
  const util_1 = require("../util");
51
- const CodeInputWrapper = (props) => ((0, jsx_runtime_1.jsx)("div", Object.assign({ css: {
51
+ const CodeInputWrapper = (props) => ((0, jsx_runtime_1.jsx)("div", { css: {
52
52
  display: 'flex',
53
53
  justifyContent: 'center',
54
- } }, props)));
55
- const digitInputStyle = (theme, props) => (Object.assign(Object.assign({}, (0, Input_1.inputStyle)(theme, props)), { '& + &': {
54
+ }, ...props }));
55
+ const digitInputStyle = (theme, props) => ({
56
+ ...(0, Input_1.inputStyle)(theme, props),
57
+ '& + &': {
56
58
  marginLeft: 'min(19px, 2vw)',
57
- }, '&:hover': {
59
+ },
60
+ '&:hover': {
58
61
  boxShadow: `0 0 0 1px ${Identity_1.COLOR_V2.GRAY_60}`,
59
- }, fontSize: theme.fontSizes.extraLarge, lineHeight: '1.75rem', borderRadius: '12px', padding: 0, textAlign: 'center', width: 'min(48px, 13vw)', height: '56px' }));
60
- const DigitInput = React.forwardRef((props, ref) => ((0, jsx_runtime_1.jsx)("input", Object.assign({ ref: ref, css: (theme) => digitInputStyle(theme, props) }, props, { type: "tel" }))));
62
+ },
63
+ fontSize: theme.fontSizes.extraLarge,
64
+ lineHeight: '1.75rem',
65
+ borderRadius: '12px',
66
+ padding: 0,
67
+ textAlign: 'center',
68
+ width: 'min(48px, 13vw)',
69
+ height: '56px',
70
+ });
71
+ const DigitInput = React.forwardRef((props, ref) => ((0, jsx_runtime_1.jsx)("input", { ref: ref, css: (theme) => digitInputStyle(theme, props), ...props, type: "tel" })));
61
72
  DigitInput.displayName = 'DigitInput';
62
73
  const CodeInput = ({ style, digits = 6, autoFocus = false, markInvalid, onCodeComplete = util_1.noop, disabled, }) => {
63
74
  const [values, setValues] = (0, react_1.useState)(Array(digits).fill(''));
@@ -1,15 +1,4 @@
1
1
  "use strict";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
2
  Object.defineProperty(exports, "__esModule", { value: true });
14
3
  exports.DropFileInput = exports.dropFileZonDescriptionStyle = exports.dropFileZoneHeadingStyle = exports.dropFileZoneLabelStyle = exports.dropFileZoneWrapperStyle = exports.dropFileWrapperStyle = void 0;
15
4
  const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
@@ -84,8 +73,7 @@ exports.dropFileZonDescriptionStyle = {
84
73
  color: Identity_1.COLOR.GRAY,
85
74
  whiteSpace: 'pre-line',
86
75
  };
87
- exports.DropFileInput = (0, react_1.forwardRef)((_a, ref) => {
88
- var { onFilesUploaded, onInvalidFilesDropError, dropFileZoneWrapperCSS, labelText, headingText, description, accept, multiple } = _a, inputProps = __rest(_a, ["onFilesUploaded", "onInvalidFilesDropError", "dropFileZoneWrapperCSS", "labelText", "headingText", "description", "accept", "multiple"]);
76
+ exports.DropFileInput = (0, react_1.forwardRef)(({ onFilesUploaded, onInvalidFilesDropError, dropFileZoneWrapperCSS, labelText, headingText, description, accept, multiple, ...inputProps }, ref) => {
89
77
  const [isDraggedOver, setIsDraggedOver] = (0, react_1.useState)(false);
90
78
  const resetDraggedOver = () => setIsDraggedOver(false);
91
79
  const handleDragOver = (event) => {
@@ -124,6 +112,9 @@ exports.DropFileInput = (0, react_1.forwardRef)((_a, ref) => {
124
112
  }
125
113
  onFilesUploaded(Array.from(files));
126
114
  };
127
- return ((0, jsx_runtime_1.jsxs)("div", { css: exports.dropFileWrapperStyle, children: [(0, jsx_runtime_1.jsx)("div", { css: (theme) => (Object.assign(Object.assign({}, (0, exports.dropFileZoneWrapperStyle)(theme, isDraggedOver)), dropFileZoneWrapperCSS)), "data-testid": "dropzone", onDragOver: handleDragOver, onDragLeave: resetDraggedOver, onDrop: handleDrop, children: (0, jsx_runtime_1.jsxs)(Layout_1.FlexBox, { align: "center", justify: "center", flexWrap: "wrap", css: { maxWidth: '280px', margin: '0 auto' }, children: [(0, jsx_runtime_1.jsx)(Icon_1.UploadIcon, { css: { margin: '12px 0' } }), (0, jsx_runtime_1.jsxs)("div", { css: { maxWidth: '160px', margin: '0 25px' }, children: [(0, jsx_runtime_1.jsx)("span", { css: exports.dropFileZoneHeadingStyle, children: headingText }), (0, jsx_runtime_1.jsxs)("label", { "aria-label": `${headingText} ${labelText} (${description})`, css: (theme) => (0, exports.dropFileZoneLabelStyle)(theme), children: [(0, jsx_runtime_1.jsx)("span", { children: labelText }), (0, jsx_runtime_1.jsx)("input", Object.assign({ "data-testid": "file-input", ref: ref, accept: accept, multiple: multiple, css: visuallyHiddenStyles, onChange: handleChange, type: "file" }, inputProps))] })] })] }) }), description && (0, jsx_runtime_1.jsx)("p", { css: exports.dropFileZonDescriptionStyle, children: description })] }));
115
+ return ((0, jsx_runtime_1.jsxs)("div", { css: exports.dropFileWrapperStyle, children: [(0, jsx_runtime_1.jsx)("div", { css: (theme) => ({
116
+ ...(0, exports.dropFileZoneWrapperStyle)(theme, isDraggedOver),
117
+ ...dropFileZoneWrapperCSS,
118
+ }), "data-testid": "dropzone", onDragOver: handleDragOver, onDragLeave: resetDraggedOver, onDrop: handleDrop, children: (0, jsx_runtime_1.jsxs)(Layout_1.FlexBox, { align: "center", justify: "center", flexWrap: "wrap", css: { maxWidth: '280px', margin: '0 auto' }, children: [(0, jsx_runtime_1.jsx)(Icon_1.UploadIcon, { css: { margin: '12px 0' } }), (0, jsx_runtime_1.jsxs)("div", { css: { maxWidth: '160px', margin: '0 25px' }, children: [(0, jsx_runtime_1.jsx)("span", { css: exports.dropFileZoneHeadingStyle, children: headingText }), (0, jsx_runtime_1.jsxs)("label", { "aria-label": `${headingText} ${labelText} (${description})`, css: (theme) => (0, exports.dropFileZoneLabelStyle)(theme), children: [(0, jsx_runtime_1.jsx)("span", { children: labelText }), (0, jsx_runtime_1.jsx)("input", { "data-testid": "file-input", ref: ref, accept: accept, multiple: multiple, css: visuallyHiddenStyles, onChange: handleChange, type: "file", ...inputProps })] })] })] }) }), description && (0, jsx_runtime_1.jsx)("p", { css: exports.dropFileZonDescriptionStyle, children: description })] }));
128
119
  });
129
120
  exports.DropFileInput.displayName = 'DropFileInput';