cherry-styled-components 0.1.13 → 0.1.15

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 (50) hide show
  1. package/dist/box.js +20 -11
  2. package/dist/button.js +80 -150
  3. package/dist/col.js +26 -18
  4. package/dist/container.js +32 -30
  5. package/dist/flex.js +39 -34
  6. package/dist/grid.js +36 -33
  7. package/dist/icon.js +14 -23
  8. package/dist/index.js +9 -76
  9. package/dist/input.js +136 -312
  10. package/dist/max-width.js +41 -26
  11. package/dist/range.js +74 -141
  12. package/dist/select.js +56 -100
  13. package/dist/space.js +38 -24
  14. package/dist/styled-components/registry.js +17 -19
  15. package/dist/styled-components/theme-provider.js +27 -31
  16. package/dist/textarea.js +49 -73
  17. package/dist/toggle.js +66 -121
  18. package/dist/utils/global.js +11 -92
  19. package/dist/utils/icons.js +66 -77
  20. package/dist/utils/mixins.js +41 -83
  21. package/dist/utils/theme.js +265 -142
  22. package/dist/utils/typography.js +31 -49
  23. package/package.json +12 -11
  24. package/dist/App.d.ts +0 -2
  25. package/dist/main.d.ts +0 -1
  26. package/dist/toggle-theme.d.ts +0 -3
  27. /package/dist/{lib → src/lib}/box.d.ts +0 -0
  28. /package/dist/{lib → src/lib}/button.d.ts +0 -0
  29. /package/dist/{lib → src/lib}/col.d.ts +0 -0
  30. /package/dist/{lib → src/lib}/container.d.ts +0 -0
  31. /package/dist/{lib → src/lib}/flex.d.ts +0 -0
  32. /package/dist/{lib → src/lib}/grid.d.ts +0 -0
  33. /package/dist/{lib → src/lib}/icon.d.ts +0 -0
  34. /package/dist/{lib → src/lib}/index.d.ts +0 -0
  35. /package/dist/{lib → src/lib}/input.d.ts +0 -0
  36. /package/dist/{lib → src/lib}/max-width.d.ts +0 -0
  37. /package/dist/{lib → src/lib}/range.d.ts +0 -0
  38. /package/dist/{lib → src/lib}/select.d.ts +0 -0
  39. /package/dist/{lib → src/lib}/space.d.ts +0 -0
  40. /package/dist/{lib → src/lib}/styled-components/index.d.ts +0 -0
  41. /package/dist/{lib → src/lib}/styled-components/registry.d.ts +0 -0
  42. /package/dist/{lib → src/lib}/styled-components/theme-provider.d.ts +0 -0
  43. /package/dist/{lib → src/lib}/textarea.d.ts +0 -0
  44. /package/dist/{lib → src/lib}/toggle.d.ts +0 -0
  45. /package/dist/{lib → src/lib}/utils/global.d.ts +0 -0
  46. /package/dist/{lib → src/lib}/utils/icons.d.ts +0 -0
  47. /package/dist/{lib → src/lib}/utils/index.d.ts +0 -0
  48. /package/dist/{lib → src/lib}/utils/mixins.d.ts +0 -0
  49. /package/dist/{lib → src/lib}/utils/theme.d.ts +0 -0
  50. /package/dist/{lib → src/lib}/utils/typography.d.ts +0 -0
package/dist/index.js CHANGED
@@ -1,7 +1,14 @@
1
+ import { StyledComponentsRegistry } from "./styled-components/registry.js";
2
+ import { GlobalStyles } from "./utils/global.js";
3
+ import { IconArrow, IconCalendar, IconCheck } from "./utils/icons.js";
4
+ import { breakpoints, colors, colorsDark, fontSizes, fonts, lineHeights, mq, shadows, shadowsDark, spacing, theme, themeDark } from "./utils/theme.js";
5
+ import { formElementHeightStyles, fullWidthStyles, generateColSpanStyles, generateColsStyles, generateGapStyles, generateJustifyContentStyles, generatePaddingStyles, resetButton, resetInput, statusBorderStyles } from "./utils/mixins.js";
6
+ import { createTypographyStyle, styledBlockquote, styledButton, styledButtonBig, styledCode, styledH1, styledH2, styledH3, styledH4, styledH5, styledH6, styledHero1, styledHero2, styledHero3, styledInput, styledInputBig, styledSmall, styledStrong, styledText } from "./utils/typography.js";
7
+ import { CherryThemeProvider, ThemeContext } from "./styled-components/theme-provider.js";
8
+ import { Container } from "./container.js";
1
9
  import { Box } from "./box.js";
2
10
  import { Button, buttonStyles } from "./button.js";
3
11
  import { Col } from "./col.js";
4
- import { Container } from "./container.js";
5
12
  import { Flex } from "./flex.js";
6
13
  import { Grid } from "./grid.js";
7
14
  import { Icon } from "./icon.js";
@@ -12,78 +19,4 @@ import { Select, StyledIconWrapper } from "./select.js";
12
19
  import { Space } from "./space.js";
13
20
  import { Textarea } from "./textarea.js";
14
21
  import { Toggle } from "./toggle.js";
15
- import { CherryThemeProvider, ThemeContext } from "./styled-components/theme-provider.js";
16
- import { GlobalStyles } from "./utils/global.js";
17
- import { IconArrow, IconCalendar, IconCheck } from "./utils/icons.js";
18
- import { StyledComponentsRegistry } from "./styled-components/registry.js";
19
- import { breakpoints, colors, colorsDark, fontSizes, fonts, lineHeights, mq, shadows, shadowsDark, spacing, theme, themeDark } from "./utils/theme.js";
20
- import { createTypographyStyle, styledBlockquote, styledButton, styledButtonBig, styledCode, styledH1, styledH2, styledH3, styledH4, styledH5, styledH6, styledHero1, styledHero2, styledHero3, styledInput, styledInputBig, styledSmall, styledStrong, styledText } from "./utils/typography.js";
21
- import { formElementHeightStyles, fullWidthStyles, generateColSpanStyles, generateColsStyles, generateGapStyles, generateJustifyContentStyles, generatePaddingStyles, resetButton, resetInput, statusBorderStyles } from "./utils/mixins.js";
22
- export {
23
- Box,
24
- Button,
25
- CherryThemeProvider,
26
- Col,
27
- Container,
28
- Flex,
29
- GlobalStyles,
30
- Grid,
31
- Icon,
32
- IconArrow,
33
- IconCalendar,
34
- IconCheck,
35
- Input,
36
- MaxWidth,
37
- Range,
38
- Select,
39
- Space,
40
- StyledComponentsRegistry,
41
- StyledIconWrapper,
42
- StyledInputWrapper,
43
- StyledLabel,
44
- Textarea,
45
- ThemeContext,
46
- Toggle,
47
- breakpoints,
48
- buttonStyles,
49
- colors,
50
- colorsDark,
51
- createTypographyStyle,
52
- fontSizes,
53
- fonts,
54
- formElementHeightStyles,
55
- fullWidthStyles,
56
- generateColSpanStyles,
57
- generateColsStyles,
58
- generateGapStyles,
59
- generateJustifyContentStyles,
60
- generatePaddingStyles,
61
- lineHeights,
62
- mq,
63
- resetButton,
64
- resetInput,
65
- shadows,
66
- shadowsDark,
67
- spacing,
68
- statusBorderStyles,
69
- styledBlockquote,
70
- styledButton,
71
- styledButtonBig,
72
- styledCode,
73
- styledH1,
74
- styledH2,
75
- styledH3,
76
- styledH4,
77
- styledH5,
78
- styledH6,
79
- styledHero1,
80
- styledHero2,
81
- styledHero3,
82
- styledInput,
83
- styledInputBig,
84
- styledSmall,
85
- styledStrong,
86
- styledText,
87
- theme,
88
- themeDark
89
- };
22
+ export { Box, Button, CherryThemeProvider, Col, Container, Flex, GlobalStyles, Grid, Icon, IconArrow, IconCalendar, IconCheck, Input, MaxWidth, Range, Select, Space, StyledComponentsRegistry, StyledIconWrapper, StyledInputWrapper, StyledLabel, Textarea, ThemeContext, Toggle, breakpoints, buttonStyles, colors, colorsDark, createTypographyStyle, fontSizes, fonts, formElementHeightStyles, fullWidthStyles, generateColSpanStyles, generateColsStyles, generateGapStyles, generateJustifyContentStyles, generatePaddingStyles, lineHeights, mq, resetButton, resetInput, shadows, shadowsDark, spacing, statusBorderStyles, styledBlockquote, styledButton, styledButtonBig, styledCode, styledH1, styledH2, styledH3, styledH4, styledH5, styledH6, styledHero1, styledHero2, styledHero3, styledInput, styledInputBig, styledSmall, styledStrong, styledText, theme, themeDark };
package/dist/input.js CHANGED
@@ -1,219 +1,100 @@
1
1
  "use client";
2
- import { jsxs, jsx } from "react/jsx-runtime";
2
+ "use client";
3
+ import { IconCalendar, IconCheck } from "./utils/icons.js";
4
+ import { formElementHeightStyles, fullWidthStyles, resetButton, resetInput, statusBorderStyles } from "./utils/mixins.js";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
3
6
  import { forwardRef } from "react";
4
7
  import styled, { css } from "styled-components";
5
- import { IconCheck, IconCalendar } from "./utils/icons.js";
6
- import { fullWidthStyles, resetButton, statusBorderStyles, resetInput, formElementHeightStyles } from "./utils/mixins.js";
7
- const StyledInputWrapper = styled.span`
8
- display: inline-flex;
9
- flex-wrap: ${({ type }) => type === "checkbox" || type === "radio" ? "nowrap" : "wrap"};
10
- align-items: center;
11
-
12
- ${({ $label }) => $label && css`
13
- gap: 5px;
14
- align-items: flex-start;
15
- `}
16
-
17
- & .icon-calendar {
18
- position: absolute;
19
- top: 50%;
20
- right: 17px;
21
- left: initial;
22
- transform: translateY(-50%);
23
- pointer-events: none;
24
- width: 24px;
25
- height: 24px;
26
-
27
- @supports (-moz-appearance: none) {
28
- display: none;
29
- }
30
- }
31
-
32
- ${({ $fullWidth }) => fullWidthStyles($fullWidth)}
33
- `;
34
- const StyledLabel = styled.label`
35
- display: inline-block;
36
- color: ${({ theme }) => theme.colors.grayDark};
37
- font-size: ${({ theme }) => theme.fontSizes.small.lg};
38
- line-height: ${({ theme }) => theme.lineHeights.small.lg};
39
- `;
40
- const StyledInput = styled.input`
41
- ${resetButton};
42
- ${resetInput};
43
- font-family: inherit;
44
- display: inline-block;
45
- padding: 17px 15px;
46
- border-radius: ${({ theme }) => theme.spacing.radius.xs};
47
- font-weight: 400;
48
- white-space: nowrap;
49
- hyphens: auto;
50
- color: ${({ theme }) => theme.colors.dark};
51
- background: ${({ theme }) => theme.colors.light};
52
- border: solid 2px ${({ theme }) => theme.colors.grayLight};
53
- box-shadow: 0 0 0 0px ${({ theme }) => theme.colors.primaryLight};
54
- transition: all 0.3s ease;
55
- word-break: keep-all;
56
- white-space: nowrap;
57
- display: inline-flex;
58
-
59
- &[type="date"] {
60
- padding: 17px 45px 17px 15px;
61
-
62
- @supports (-moz-appearance: none) {
63
- padding: 13px 15px;
64
- }
65
- }
66
-
67
- &::-webkit-datetime-edit {
68
- padding: 0;
69
- margin: 0;
70
- vertical-align: middle;
71
- }
72
-
73
- &::-webkit-datetime-edit-fields-wrapper {
74
- padding: 4px 0;
75
- margin: 0;
76
- vertical-align: middle;
77
- }
78
-
79
- &::-webkit-calendar-picker-indicator {
80
- background: transparent;
81
- cursor: pointer;
82
- position: absolute;
83
- right: 15px;
84
- top: 50%;
85
- transform: translateY(-50%);
86
- width: 24px;
87
- height: 24px;
88
- }
89
-
90
- &::-webkit-datetime-edit-text {
91
- color: ${({ theme }) => theme.colors.gray};
92
- }
93
-
94
- &::-webkit-datetime-edit-month-field {
95
- &:focus {
96
- background: ${({ theme }) => theme.colors.primary};
97
- color: ${({ theme }) => theme.colors.light};
98
- border-radius: 4px;
99
- }
100
- }
101
-
102
- &::-webkit-datetime-edit-day-field {
103
- &:focus {
104
- background: ${({ theme }) => theme.colors.primary};
105
- color: ${({ theme }) => theme.colors.light};
106
- border-radius: 4px;
107
- }
108
- }
109
-
110
- &::-webkit-datetime-edit-year-field {
111
- &:focus {
112
- background: ${({ theme }) => theme.colors.primary};
113
- color: ${({ theme }) => theme.colors.light};
114
- border-radius: 4px;
115
- }
116
- }
117
-
118
- &::placeholder {
119
- color: ${({ theme }) => theme.colors.gray};
120
- }
121
-
122
- &:hover:not([disabled]) {
123
- border-color: ${({ theme }) => theme.colors.primary};
124
- }
125
-
126
- &:focus:not([disabled]) {
127
- box-shadow: 0 0 0 4px ${({ theme }) => theme.colors.primaryLight};
128
- border-color: ${({ theme }) => theme.colors.primary};
129
- }
130
-
131
- &:active:not([disabled]) {
132
- box-shadow: 0 0 0 2px ${({ theme }) => theme.colors.primaryLight};
133
- }
134
-
135
- ${({ $size }) => formElementHeightStyles($size)}
136
-
137
- ${({ $size, theme }) => $size === "big" ? `font-size: ${theme.fontSizes.inputBig.lg};
8
+ //#region src/lib/input.tsx
9
+ var StyledInputWrapper = styled.span.withConfig({
10
+ displayName: "input__StyledInputWrapper",
11
+ componentId: "sc-6fe5d34a-0"
12
+ })([
13
+ `display:inline-flex;flex-wrap:`,
14
+ `;align-items:center;`,
15
+ ` & .icon-calendar{position:absolute;top:50%;right:17px;left:initial;transform:translateY(-50%);pointer-events:none;width:24px;height:24px;@supports (-moz-appearance:none){display:none;}}`,
16
+ ``
17
+ ], ({ type }) => type === "checkbox" || type === "radio" ? "nowrap" : "wrap", ({ $label }) => $label && css([`gap:5px;align-items:flex-start;`]), ({ $fullWidth }) => fullWidthStyles($fullWidth));
18
+ var StyledLabel = styled.label.withConfig({
19
+ displayName: "input__StyledLabel",
20
+ componentId: "sc-6fe5d34a-1"
21
+ })([
22
+ `display:inline-block;color:`,
23
+ `;font-size:`,
24
+ `;line-height:`,
25
+ `;`
26
+ ], ({ theme }) => theme.colors.grayDark, ({ theme }) => theme.fontSizes.small.lg, ({ theme }) => theme.lineHeights.small.lg);
27
+ var StyledInput = styled.input.withConfig({
28
+ displayName: "input__StyledInput",
29
+ componentId: "sc-6fe5d34a-2"
30
+ })([
31
+ ``,
32
+ `;`,
33
+ `;font-family:inherit;display:inline-block;padding:17px 15px;border-radius:`,
34
+ `;font-weight:400;white-space:nowrap;hyphens:auto;color:`,
35
+ `;background:`,
36
+ `;border:solid 2px `,
37
+ `;box-shadow:0 0 0 0px `,
38
+ `;transition:all 0.3s ease;word-break:keep-all;white-space:nowrap;display:inline-flex;&[type="date"]{padding:17px 45px 17px 15px;@supports (-moz-appearance:none){padding:13px 15px;}}&::-webkit-datetime-edit{padding:0;margin:0;vertical-align:middle;}&::-webkit-datetime-edit-fields-wrapper{padding:4px 0;margin:0;vertical-align:middle;}&::-webkit-calendar-picker-indicator{background:transparent;cursor:pointer;position:absolute;right:15px;top:50%;transform:translateY(-50%);width:24px;height:24px;}&::-webkit-datetime-edit-text{color:`,
39
+ `;}&::-webkit-datetime-edit-month-field{&:focus{background:`,
40
+ `;color:`,
41
+ `;border-radius:4px;}}&::-webkit-datetime-edit-day-field{&:focus{background:`,
42
+ `;color:`,
43
+ `;border-radius:4px;}}&::-webkit-datetime-edit-year-field{&:focus{background:`,
44
+ `;color:`,
45
+ `;border-radius:4px;}}&::placeholder{color:`,
46
+ `;}&:hover:not([disabled]){border-color:`,
47
+ `;}&:focus:not([disabled]){box-shadow:0 0 0 4px `,
48
+ `;border-color:`,
49
+ `;}&:active:not([disabled]){box-shadow:0 0 0 2px `,
50
+ `;}`,
51
+ ` `,
52
+ ` `,
53
+ ` `,
54
+ ` `,
55
+ ``
56
+ ], resetButton, resetInput, ({ theme }) => theme.spacing.radius.xs, ({ theme }) => theme.colors.dark, ({ theme }) => theme.colors.light, ({ theme }) => theme.colors.grayLight, ({ theme }) => theme.colors.primaryLight, ({ theme }) => theme.colors.gray, ({ theme }) => theme.colors.primary, ({ theme }) => theme.colors.light, ({ theme }) => theme.colors.primary, ({ theme }) => theme.colors.light, ({ theme }) => theme.colors.primary, ({ theme }) => theme.colors.light, ({ theme }) => theme.colors.gray, ({ theme }) => theme.colors.primary, ({ theme }) => theme.colors.primaryLight, ({ theme }) => theme.colors.primary, ({ theme }) => theme.colors.primaryLight, ({ $size }) => formElementHeightStyles($size), ({ $size, theme }) => $size === "big" ? `font-size: ${theme.fontSizes.inputBig.lg};
138
57
  line-height: ${theme.lineHeights.inputBig.lg};
139
58
  ` : $size === "small" ? `font-size: ${theme.fontSizes.inputSmall.lg};
140
59
  line-height: ${theme.lineHeights.inputSmall.lg};
141
60
  padding: 12px 12px;
142
61
  ` : `font-size: ${theme.fontSizes.input.lg};
143
- line-height: ${theme.lineHeights.input.lg};`}
144
-
145
- ${({ $error, $success, theme }) => {
146
- return statusBorderStyles($error, $success, theme);
147
- }}
148
-
149
- ${({ disabled, theme }) => disabled && `cursor: not-allowed;
62
+ line-height: ${theme.lineHeights.input.lg};`, ({ $error, $success, theme }) => {
63
+ return statusBorderStyles($error, $success, theme);
64
+ }, ({ disabled, theme }) => disabled && `cursor: not-allowed;
150
65
  background: ${theme.colors.grayLight};
151
66
  border-color: ${theme.colors.gray};
152
67
  color: ${theme.colors.gray};
153
- `}
154
-
155
- ${({ $fullWidth }) => fullWidthStyles($fullWidth)}
156
- `;
157
- const StyledIconWrapper = styled.span`
158
- display: inline-flex;
159
- position: relative;
160
- line-height: 0;
161
- min-width: fit-content;
162
-
163
- & em {
164
- display: block;
165
- border-radius: 50%;
166
- background: ${({ theme }) => theme.colors.primary};
167
- }
168
-
169
- & svg,
170
- & em {
171
- object-fit: contain;
172
- position: absolute;
173
- top: 50%;
174
- left: 50%;
175
- transform: translate(-50%, -50%) scale(0.7);
176
- opacity: 0;
177
- pointer-events: none;
178
- transition: all 0.3s ease;
179
- }
180
- `;
181
- const StyledRadioCheckboxInput = styled.input`
182
- ${resetButton};
183
- display: inline-block;
184
- background: ${({ theme }) => theme.colors.light};
185
- border: solid 2px ${({ theme }) => theme.colors.grayLight};
186
- box-shadow: 0 0 0 0px ${({ theme }) => theme.colors.primaryLight};
187
- transition: all 0.3s ease;
188
-
189
- &:hover:not([disabled]) {
190
- border-color: ${({ theme }) => theme.colors.primary};
191
- }
192
-
193
- &:focus:not([disabled]) {
194
- box-shadow: 0 0 0 4px ${({ theme }) => theme.colors.primaryLight};
195
- border-color: ${({ theme }) => theme.colors.primary};
196
- }
197
-
198
- &:active:not([disabled]) {
199
- box-shadow: 0 0 0 2px ${({ theme }) => theme.colors.primaryLight};
200
- }
201
-
202
- ${({ type, theme }) => type === "checkbox" ? `border-radius: ${theme.spacing.radius.xs};` : `border-radius: 50%;`}
203
-
204
- ${({ disabled, theme }) => disabled && `cursor: not-allowed;
68
+ `, ({ $fullWidth }) => fullWidthStyles($fullWidth));
69
+ var StyledIconWrapper = styled.span.withConfig({
70
+ displayName: "input__StyledIconWrapper",
71
+ componentId: "sc-6fe5d34a-3"
72
+ })([`display:inline-flex;position:relative;line-height:0;min-width:fit-content;& em{display:block;border-radius:50%;background:`, `;}& svg,& em{object-fit:contain;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%) scale(0.7);opacity:0;pointer-events:none;transition:all 0.3s ease;}`], ({ theme }) => theme.colors.primary);
73
+ var StyledRadioCheckboxInput = styled.input.withConfig({
74
+ displayName: "input__StyledRadioCheckboxInput",
75
+ componentId: "sc-6fe5d34a-4"
76
+ })([
77
+ ``,
78
+ `;display:inline-block;background:`,
79
+ `;border:solid 2px `,
80
+ `;box-shadow:0 0 0 0px `,
81
+ `;transition:all 0.3s ease;&:hover:not([disabled]){border-color:`,
82
+ `;}&:focus:not([disabled]){box-shadow:0 0 0 4px `,
83
+ `;border-color:`,
84
+ `;}&:active:not([disabled]){box-shadow:0 0 0 2px `,
85
+ `;}`,
86
+ ` `,
87
+ ` `,
88
+ ` `,
89
+ ` &:checked ~ svg,&:checked ~ em{opacity:1;transform:translate(-50%,-50%) scale(1);}`
90
+ ], resetButton, ({ theme }) => theme.colors.light, ({ theme }) => theme.colors.grayLight, ({ theme }) => theme.colors.primaryLight, ({ theme }) => theme.colors.primary, ({ theme }) => theme.colors.primaryLight, ({ theme }) => theme.colors.primary, ({ theme }) => theme.colors.primaryLight, ({ type, theme }) => type === "checkbox" ? `border-radius: ${theme.spacing.radius.xs};` : `border-radius: 50%;`, ({ disabled, theme }) => disabled && `cursor: not-allowed;
205
91
  background: ${theme.colors.grayLight};
206
92
  border: solid 2px ${theme.colors.gray};
207
93
  color: ${theme.colors.gray};
208
- `}
209
-
210
- ${({ $error, $success, theme }) => {
211
- return statusBorderStyles($error, $success, theme);
212
- }}
213
-
214
- ${({ $size }) => {
215
- if ($size === "big") {
216
- return `
94
+ `, ({ $error, $success, theme }) => {
95
+ return statusBorderStyles($error, $success, theme);
96
+ }, ({ $size }) => {
97
+ if ($size === "big") return `
217
98
  min-width: 32px;
218
99
  width: 32px;
219
100
  min-height: 32px;
@@ -233,8 +114,7 @@ const StyledRadioCheckboxInput = styled.input`
233
114
  height: 14px;
234
115
  }
235
116
  `;
236
- } else if ($size === "small") {
237
- return `
117
+ else if ($size === "small") return `
238
118
  min-width: 18px;
239
119
  width: 18px;
240
120
  min-height: 18px;
@@ -254,8 +134,7 @@ const StyledRadioCheckboxInput = styled.input`
254
134
  height: 6px;
255
135
  }
256
136
  `;
257
- } else {
258
- return `
137
+ else return `
259
138
  min-width: 22px;
260
139
  width: 22px;
261
140
  min-height: 22px;
@@ -275,111 +154,56 @@ const StyledRadioCheckboxInput = styled.input`
275
154
  height: 8px;
276
155
  }
277
156
  `;
278
- }
279
- }}
280
-
281
- &:checked ~ svg,
282
- &:checked ~ em {
283
- opacity: 1;
284
- transform: translate(-50%, -50%) scale(1);
285
- }
286
- `;
287
- const StyledCustomIconWrapper = styled.span`
288
- position: relative;
289
- ${({ $fullWidth }) => fullWidthStyles($fullWidth)};
290
-
291
- & svg {
292
- position: absolute;
293
- top: 50%;
294
- transform: translateY(-50%);
295
- pointer-events: none;
296
- width: 24px;
297
- height: 24px;
298
- object-fit: contain;
299
- color: ${({ theme }) => theme.colors.primary};
300
- }
301
-
302
- ${({ $icon, $iconPosition }) => $icon && $iconPosition === "right" ? css`
303
- & svg {
304
- right: 16px;
305
- }
306
-
307
- & input {
308
- padding-right: 50px;
309
- }
310
- ` : css`
311
- & svg {
312
- left: 16px;
313
- }
314
-
315
- & svg ~ input {
316
- padding-left: 50px;
317
- }
318
- `}
319
- `;
157
+ });
158
+ var StyledCustomIconWrapper = styled.span.withConfig({
159
+ displayName: "input__StyledCustomIconWrapper",
160
+ componentId: "sc-6fe5d34a-5"
161
+ })([
162
+ `position:relative;`,
163
+ `;& svg{position:absolute;top:50%;transform:translateY(-50%);pointer-events:none;width:24px;height:24px;object-fit:contain;color:`,
164
+ `;}`,
165
+ ``
166
+ ], ({ $fullWidth }) => fullWidthStyles($fullWidth), ({ theme }) => theme.colors.primary, ({ $icon, $iconPosition }) => $icon && $iconPosition === "right" ? css([`& svg{right:16px;}& input{padding-right:50px;}`]) : css([`& svg{left:16px;}& svg ~ input{padding-left:50px;}`]));
320
167
  function LocalInput({ ...props }, ref) {
321
- if (props.type === "checkbox" || props.type === "radio") {
322
- return /* @__PURE__ */ jsxs(
323
- StyledInputWrapper,
324
- {
325
- $fullWidth: props.$fullWidth,
326
- type: props.type,
327
- $label: props.$label,
328
- className: props.$wrapperClassName,
329
- children: [
330
- /* @__PURE__ */ jsxs(StyledIconWrapper, { children: [
331
- /* @__PURE__ */ jsx(
332
- StyledRadioCheckboxInput,
333
- {
334
- ...props,
335
- "aria-invalid": props.$error || void 0,
336
- ref
337
- }
338
- ),
339
- !props.disabled && props.type === "checkbox" ? /* @__PURE__ */ jsx(IconCheck, {}) : /* @__PURE__ */ jsx("em", {})
340
- ] }),
341
- props.$label && /* @__PURE__ */ jsx(StyledLabel, { htmlFor: props.id, children: props.$label })
342
- ]
343
- }
344
- );
345
- }
346
- return /* @__PURE__ */ jsxs(
347
- StyledInputWrapper,
348
- {
349
- $fullWidth: props.$fullWidth,
350
- type: props.type,
351
- $label: props.$label,
352
- className: props.$wrapperClassName,
353
- children: [
354
- props.$label && /* @__PURE__ */ jsx(StyledLabel, { htmlFor: props.id, children: props.$label }),
355
- /* @__PURE__ */ jsxs(
356
- StyledCustomIconWrapper,
357
- {
358
- $fullWidth: props.$fullWidth,
359
- $iconPosition: props.$iconPosition,
360
- $icon: props.$icon,
361
- children: [
362
- props.$iconPosition !== "right" && props.$icon && props.$icon,
363
- /* @__PURE__ */ jsx(
364
- StyledInput,
365
- {
366
- ...props,
367
- "aria-invalid": props.$error || void 0,
368
- ref
369
- }
370
- ),
371
- props.$iconPosition === "right" && props.$icon && props.$icon,
372
- props.type === "date" && /* @__PURE__ */ jsx(IconCalendar, { className: "icon-calendar" })
373
- ]
374
- }
375
- )
376
- ]
377
- }
378
- );
168
+ if (props.type === "checkbox" || props.type === "radio") return /* @__PURE__ */ jsxs(StyledInputWrapper, {
169
+ $fullWidth: props.$fullWidth,
170
+ type: props.type,
171
+ $label: props.$label,
172
+ className: props.$wrapperClassName,
173
+ children: [/* @__PURE__ */ jsxs(StyledIconWrapper, { children: [/* @__PURE__ */ jsx(StyledRadioCheckboxInput, {
174
+ ...props,
175
+ "aria-invalid": props.$error || void 0,
176
+ ref
177
+ }), !props.disabled && props.type === "checkbox" ? /* @__PURE__ */ jsx(IconCheck, {}) : /* @__PURE__ */ jsx("em", {})] }), props.$label && /* @__PURE__ */ jsx(StyledLabel, {
178
+ htmlFor: props.id,
179
+ children: props.$label
180
+ })]
181
+ });
182
+ return /* @__PURE__ */ jsxs(StyledInputWrapper, {
183
+ $fullWidth: props.$fullWidth,
184
+ type: props.type,
185
+ $label: props.$label,
186
+ className: props.$wrapperClassName,
187
+ children: [props.$label && /* @__PURE__ */ jsx(StyledLabel, {
188
+ htmlFor: props.id,
189
+ children: props.$label
190
+ }), /* @__PURE__ */ jsxs(StyledCustomIconWrapper, {
191
+ $fullWidth: props.$fullWidth,
192
+ $iconPosition: props.$iconPosition,
193
+ $icon: props.$icon,
194
+ children: [
195
+ props.$iconPosition !== "right" && props.$icon && props.$icon,
196
+ /* @__PURE__ */ jsx(StyledInput, {
197
+ ...props,
198
+ "aria-invalid": props.$error || void 0,
199
+ ref
200
+ }),
201
+ props.$iconPosition === "right" && props.$icon && props.$icon,
202
+ props.type === "date" && /* @__PURE__ */ jsx(IconCalendar, { className: "icon-calendar" })
203
+ ]
204
+ })]
205
+ });
379
206
  }
380
- const Input = forwardRef(LocalInput);
381
- export {
382
- Input,
383
- StyledInputWrapper,
384
- StyledLabel
385
- };
207
+ var Input = /* @__PURE__ */ forwardRef(LocalInput);
208
+ //#endregion
209
+ export { Input, StyledInputWrapper, StyledLabel };
package/dist/max-width.js CHANGED
@@ -1,35 +1,50 @@
1
1
  "use client";
2
+ "use client";
3
+ import { mq } from "./utils/theme.js";
2
4
  import { jsx } from "react/jsx-runtime";
3
5
  import { forwardRef } from "react";
4
6
  import styled from "styled-components";
5
- import { mq } from "./utils/theme.js";
6
- const styles = ($size) => `max-width: ${$size}px;`;
7
- const breakpointKeys = ["xs", "sm", "md", "lg", "xl", "xxl", "xxxl"];
7
+ //#region src/lib/max-width.tsx
8
+ var styles = ($size) => `max-width: ${$size}px;`;
9
+ var breakpointKeys = [
10
+ "xs",
11
+ "sm",
12
+ "md",
13
+ "lg",
14
+ "xl",
15
+ "xxl",
16
+ "xxxl"
17
+ ];
8
18
  function responsiveStyles(props) {
9
- const propMap = {
10
- xs: props.$xs,
11
- sm: props.$sm,
12
- md: props.$md,
13
- lg: props.$lg,
14
- xl: props.$xl,
15
- xxl: props.$xxl,
16
- xxxl: props.$xxxl
17
- };
18
- return breakpointKeys.filter((key) => propMap[key] !== void 0).map((key) => mq(key) + `{ ${styles(propMap[key])} }`).join("");
19
+ const propMap = {
20
+ xs: props.$xs,
21
+ sm: props.$sm,
22
+ md: props.$md,
23
+ lg: props.$lg,
24
+ xl: props.$xl,
25
+ xxl: props.$xxl,
26
+ xxxl: props.$xxxl
27
+ };
28
+ return breakpointKeys.filter((key) => propMap[key] !== void 0).map((key) => mq(key) + `{ ${styles(propMap[key])} }`).join("");
19
29
  }
20
- const StyledMaxWidth = styled.div`
21
- display: block;
22
- margin: ${({ $m0 }) => $m0 ? "0" : "auto"};
23
-
24
- ${({ $size }) => `
30
+ var StyledMaxWidth = styled.div.withConfig({
31
+ displayName: "max-width__StyledMaxWidth",
32
+ componentId: "sc-1a736de7-0"
33
+ })([
34
+ `display:block;margin:`,
35
+ `;`,
36
+ ` `,
37
+ ``
38
+ ], ({ $m0 }) => $m0 ? "0" : "auto", ({ $size }) => `
25
39
  ${$size && styles($size)};
26
- `}
27
- ${(props) => responsiveStyles(props)}
28
- `;
40
+ `, (props) => responsiveStyles(props));
29
41
  function LocalMaxWidth({ ...props }, ref) {
30
- return /* @__PURE__ */ jsx(StyledMaxWidth, { ...props, ref, children: props.children });
42
+ return /* @__PURE__ */ jsx(StyledMaxWidth, {
43
+ ...props,
44
+ ref,
45
+ children: props.children
46
+ });
31
47
  }
32
- const MaxWidth = forwardRef(LocalMaxWidth);
33
- export {
34
- MaxWidth
35
- };
48
+ var MaxWidth = /* @__PURE__ */ forwardRef(LocalMaxWidth);
49
+ //#endregion
50
+ export { MaxWidth };