cherry-styled-components 0.1.13 → 0.1.14
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.
- package/dist/box.js +20 -11
- package/dist/button.js +80 -150
- package/dist/col.js +26 -18
- package/dist/container.js +32 -30
- package/dist/flex.js +39 -34
- package/dist/grid.js +36 -33
- package/dist/icon.js +14 -23
- package/dist/index.js +9 -76
- package/dist/input.js +136 -312
- package/dist/max-width.js +41 -26
- package/dist/range.js +74 -141
- package/dist/select.js +56 -100
- package/dist/space.js +38 -24
- package/dist/styled-components/registry.js +17 -19
- package/dist/styled-components/theme-provider.js +27 -31
- package/dist/textarea.js +49 -73
- package/dist/toggle.js +66 -121
- package/dist/utils/global.js +11 -92
- package/dist/utils/icons.js +66 -77
- package/dist/utils/mixins.js +41 -83
- package/dist/utils/theme.js +265 -142
- package/dist/utils/typography.js +31 -49
- package/package.json +10 -9
- /package/dist/{App.d.ts → src/App.d.ts} +0 -0
- /package/dist/{lib → src/lib}/box.d.ts +0 -0
- /package/dist/{lib → src/lib}/button.d.ts +0 -0
- /package/dist/{lib → src/lib}/col.d.ts +0 -0
- /package/dist/{lib → src/lib}/container.d.ts +0 -0
- /package/dist/{lib → src/lib}/flex.d.ts +0 -0
- /package/dist/{lib → src/lib}/grid.d.ts +0 -0
- /package/dist/{lib → src/lib}/icon.d.ts +0 -0
- /package/dist/{lib → src/lib}/index.d.ts +0 -0
- /package/dist/{lib → src/lib}/input.d.ts +0 -0
- /package/dist/{lib → src/lib}/max-width.d.ts +0 -0
- /package/dist/{lib → src/lib}/range.d.ts +0 -0
- /package/dist/{lib → src/lib}/select.d.ts +0 -0
- /package/dist/{lib → src/lib}/space.d.ts +0 -0
- /package/dist/{lib → src/lib}/styled-components/index.d.ts +0 -0
- /package/dist/{lib → src/lib}/styled-components/registry.d.ts +0 -0
- /package/dist/{lib → src/lib}/styled-components/theme-provider.d.ts +0 -0
- /package/dist/{lib → src/lib}/textarea.d.ts +0 -0
- /package/dist/{lib → src/lib}/toggle.d.ts +0 -0
- /package/dist/{lib → src/lib}/utils/global.d.ts +0 -0
- /package/dist/{lib → src/lib}/utils/icons.d.ts +0 -0
- /package/dist/{lib → src/lib}/utils/index.d.ts +0 -0
- /package/dist/{lib → src/lib}/utils/mixins.d.ts +0 -0
- /package/dist/{lib → src/lib}/utils/theme.d.ts +0 -0
- /package/dist/{lib → src/lib}/utils/typography.d.ts +0 -0
- /package/dist/{main.d.ts → src/main.d.ts} +0 -0
- /package/dist/{toggle-theme.d.ts → src/toggle-theme.d.ts} +0 -0
package/dist/range.js
CHANGED
|
@@ -1,110 +1,59 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
2
|
+
"use client";
|
|
3
|
+
import { fullWidthStyles, resetButton, statusBorderStyles } from "./utils/mixins.js";
|
|
4
|
+
import { StyledLabel } from "./input.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
6
|
import { forwardRef } from "react";
|
|
4
7
|
import styled from "styled-components";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
transition: all 0.3s ease;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
&::-moz-range-thumb {
|
|
58
|
-
${resetButton};
|
|
59
|
-
background: ${({ theme }) => theme.colors.primary};
|
|
60
|
-
border: 0 solid transparent;
|
|
61
|
-
border-radius: 50%;
|
|
62
|
-
transition: all 0.3s ease;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
&:hover:not([disabled]) {
|
|
66
|
-
&::-webkit-slider-runnable-track {
|
|
67
|
-
border: solid 2px ${({ theme }) => theme.colors.primary};
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
&::-moz-range-track {
|
|
71
|
-
border: solid 2px ${({ theme }) => theme.colors.primary};
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
&:focus:not([disabled]) {
|
|
76
|
-
&::-webkit-slider-runnable-track {
|
|
77
|
-
border: solid 2px ${({ theme }) => theme.colors.primary};
|
|
78
|
-
box-shadow: 0 0 0 4px ${({ theme }) => theme.colors.primaryLight};
|
|
79
|
-
}
|
|
80
|
-
&::-webkit-slider-thumb {
|
|
81
|
-
box-shadow: 0 0 0 4px ${({ theme }) => theme.colors.primaryLight};
|
|
82
|
-
}
|
|
83
|
-
&::-moz-range-track {
|
|
84
|
-
border: solid 2px ${({ theme }) => theme.colors.primary};
|
|
85
|
-
box-shadow: 0 0 0 4px ${({ theme }) => theme.colors.primaryLight};
|
|
86
|
-
}
|
|
87
|
-
&::-moz-range-thumb {
|
|
88
|
-
box-shadow: 0 0 0 4px ${({ theme }) => theme.colors.primaryLight};
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
&:active:not([disabled]) {
|
|
93
|
-
&::-webkit-slider-runnable-track {
|
|
94
|
-
box-shadow: 0 0 0 2px ${({ theme }) => theme.colors.primaryLight};
|
|
95
|
-
}
|
|
96
|
-
&::-webkit-slider-thumb {
|
|
97
|
-
box-shadow: 0 0 0 2px ${({ theme }) => theme.colors.primaryLight};
|
|
98
|
-
}
|
|
99
|
-
&::-moz-range-track {
|
|
100
|
-
box-shadow: 0 0 0 2px ${({ theme }) => theme.colors.primaryLight};
|
|
101
|
-
}
|
|
102
|
-
&::-moz-range-thumb {
|
|
103
|
-
box-shadow: 0 0 0 2px ${({ theme }) => theme.colors.primaryLight};
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
${({ disabled, theme }) => disabled && `
|
|
8
|
+
//#region src/lib/range.tsx
|
|
9
|
+
var StyledInputWrapper = styled.span.withConfig({
|
|
10
|
+
displayName: "range__StyledInputWrapper",
|
|
11
|
+
componentId: "sc-cb330c1b-0"
|
|
12
|
+
})([
|
|
13
|
+
`display:inline-flex;flex-wrap:`,
|
|
14
|
+
`;gap:10px;align-items:center;`,
|
|
15
|
+
``
|
|
16
|
+
], ({ type }) => type === "checkbox" || type === "radio" ? "nowrap" : "wrap", ({ $fullWidth }) => fullWidthStyles($fullWidth));
|
|
17
|
+
var StyledInput = styled.input.withConfig({
|
|
18
|
+
displayName: "range__StyledInput",
|
|
19
|
+
componentId: "sc-cb330c1b-1"
|
|
20
|
+
})([
|
|
21
|
+
``,
|
|
22
|
+
`;padding:0;height:10px;font-size:0;background:transparent;min-width:100px;&::-webkit-slider-runnable-track{width:100%;cursor:pointer;border-radius:`,
|
|
23
|
+
`;background:`,
|
|
24
|
+
`;border:solid 2px `,
|
|
25
|
+
`;box-shadow:0 0 0 0 `,
|
|
26
|
+
`;transition:all 0.3s ease;`,
|
|
27
|
+
`}&::-moz-range-track{width:100%;cursor:pointer;border-radius:`,
|
|
28
|
+
`;background:`,
|
|
29
|
+
`;border:solid 2px `,
|
|
30
|
+
`;box-shadow:0 0 0 0 `,
|
|
31
|
+
`;transition:all 0.3s ease;`,
|
|
32
|
+
`}&::-webkit-slider-thumb{`,
|
|
33
|
+
`;background:`,
|
|
34
|
+
`;border:0 solid transparent;border-radius:50%;transition:all 0.3s ease;}&::-moz-range-thumb{`,
|
|
35
|
+
`;background:`,
|
|
36
|
+
`;border:0 solid transparent;border-radius:50%;transition:all 0.3s ease;}&:hover:not([disabled]){&::-webkit-slider-runnable-track{border:solid 2px `,
|
|
37
|
+
`;}&::-moz-range-track{border:solid 2px `,
|
|
38
|
+
`;}}&:focus:not([disabled]){&::-webkit-slider-runnable-track{border:solid 2px `,
|
|
39
|
+
`;box-shadow:0 0 0 4px `,
|
|
40
|
+
`;}&::-webkit-slider-thumb{box-shadow:0 0 0 4px `,
|
|
41
|
+
`;}&::-moz-range-track{border:solid 2px `,
|
|
42
|
+
`;box-shadow:0 0 0 4px `,
|
|
43
|
+
`;}&::-moz-range-thumb{box-shadow:0 0 0 4px `,
|
|
44
|
+
`;}}&:active:not([disabled]){&::-webkit-slider-runnable-track{box-shadow:0 0 0 2px `,
|
|
45
|
+
`;}&::-webkit-slider-thumb{box-shadow:0 0 0 2px `,
|
|
46
|
+
`;}&::-moz-range-track{box-shadow:0 0 0 2px `,
|
|
47
|
+
`;}&::-moz-range-thumb{box-shadow:0 0 0 2px `,
|
|
48
|
+
`;}}`,
|
|
49
|
+
` `,
|
|
50
|
+
` `,
|
|
51
|
+
``
|
|
52
|
+
], resetButton, ({ theme }) => theme.spacing.radius.xl, ({ theme }) => theme.colors.light, ({ theme }) => theme.colors.grayLight, ({ theme }) => theme.colors.primaryLight, ({ $error, $success, theme }) => {
|
|
53
|
+
return statusBorderStyles($error, $success, theme);
|
|
54
|
+
}, ({ theme }) => theme.spacing.radius.xl, ({ theme }) => theme.colors.light, ({ theme }) => theme.colors.grayLight, ({ theme }) => theme.colors.primaryLight, ({ $error, $success, theme }) => {
|
|
55
|
+
return statusBorderStyles($error, $success, theme);
|
|
56
|
+
}, resetButton, ({ theme }) => theme.colors.primary, resetButton, ({ theme }) => theme.colors.primary, ({ theme }) => theme.colors.primary, ({ theme }) => theme.colors.primary, ({ theme }) => theme.colors.primary, ({ theme }) => theme.colors.primaryLight, ({ theme }) => theme.colors.primaryLight, ({ theme }) => theme.colors.primary, ({ theme }) => theme.colors.primaryLight, ({ theme }) => theme.colors.primaryLight, ({ theme }) => theme.colors.primaryLight, ({ theme }) => theme.colors.primaryLight, ({ theme }) => theme.colors.primaryLight, ({ theme }) => theme.colors.primaryLight, ({ disabled, theme }) => disabled && `
|
|
108
57
|
cursor: not-allowed;
|
|
109
58
|
|
|
110
59
|
&::-webkit-slider-runnable-track {
|
|
@@ -126,13 +75,8 @@ const StyledInput = styled.input`
|
|
|
126
75
|
background: ${theme.colors.gray};
|
|
127
76
|
cursor: not-allowed;
|
|
128
77
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
${({ $fullWidth }) => fullWidthStyles($fullWidth)}
|
|
132
|
-
|
|
133
|
-
${({ $size }) => {
|
|
134
|
-
if ($size === "big") {
|
|
135
|
-
return `
|
|
78
|
+
`, ({ $fullWidth }) => fullWidthStyles($fullWidth), ({ $size }) => {
|
|
79
|
+
if ($size === "big") return `
|
|
136
80
|
height: 32px;
|
|
137
81
|
|
|
138
82
|
&::-webkit-slider-runnable-track {
|
|
@@ -154,8 +98,7 @@ const StyledInput = styled.input`
|
|
|
154
98
|
height: 32px;
|
|
155
99
|
}
|
|
156
100
|
`;
|
|
157
|
-
|
|
158
|
-
return `
|
|
101
|
+
else if ($size === "small") return `
|
|
159
102
|
height: 18px;
|
|
160
103
|
|
|
161
104
|
&::-webkit-slider-runnable-track {
|
|
@@ -177,8 +120,7 @@ const StyledInput = styled.input`
|
|
|
177
120
|
height: 18px;
|
|
178
121
|
}
|
|
179
122
|
`;
|
|
180
|
-
|
|
181
|
-
return `
|
|
123
|
+
else return `
|
|
182
124
|
height: 22px;
|
|
183
125
|
|
|
184
126
|
&::-webkit-slider-runnable-track {
|
|
@@ -200,31 +142,22 @@ const StyledInput = styled.input`
|
|
|
200
142
|
height: 22px;
|
|
201
143
|
}
|
|
202
144
|
`;
|
|
203
|
-
|
|
204
|
-
}}
|
|
205
|
-
`;
|
|
145
|
+
});
|
|
206
146
|
function LocalRange({ ...props }, ref) {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
ref
|
|
221
|
-
}
|
|
222
|
-
)
|
|
223
|
-
]
|
|
224
|
-
}
|
|
225
|
-
);
|
|
147
|
+
return /* @__PURE__ */ jsxs(StyledInputWrapper, {
|
|
148
|
+
$fullWidth: props.$fullWidth,
|
|
149
|
+
className: props.$wrapperClassName,
|
|
150
|
+
children: [props.$label && /* @__PURE__ */ jsx(StyledLabel, {
|
|
151
|
+
htmlFor: props.id,
|
|
152
|
+
children: props.$label
|
|
153
|
+
}), /* @__PURE__ */ jsx(StyledInput, {
|
|
154
|
+
...props,
|
|
155
|
+
"aria-invalid": props.$error || void 0,
|
|
156
|
+
type: "range",
|
|
157
|
+
ref
|
|
158
|
+
})]
|
|
159
|
+
});
|
|
226
160
|
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
};
|
|
161
|
+
var Range = /* @__PURE__ */ forwardRef(LocalRange);
|
|
162
|
+
//#endregion
|
|
163
|
+
export { Range };
|
package/dist/select.js
CHANGED
|
@@ -1,108 +1,64 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
2
|
+
"use client";
|
|
3
|
+
import { IconArrow } from "./utils/icons.js";
|
|
4
|
+
import { formElementHeightStyles, fullWidthStyles, resetButton, resetInput, statusBorderStyles } from "./utils/mixins.js";
|
|
5
|
+
import { StyledInputWrapper, StyledLabel } from "./input.js";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
7
|
import { forwardRef } from "react";
|
|
4
8
|
import styled from "styled-components";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
&:focus:not([disabled]) {
|
|
33
|
-
box-shadow: 0 0 0 4px ${({ theme }) => theme.colors.primaryLight};
|
|
34
|
-
border-color: ${({ theme }) => theme.colors.primary};
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
&:active:not([disabled]) {
|
|
38
|
-
box-shadow: 0 0 0 2px ${({ theme }) => theme.colors.primaryLight};
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
${({ $size }) => formElementHeightStyles($size)}
|
|
42
|
-
|
|
43
|
-
${({ $size, theme }) => $size === "big" ? `font-size: ${theme.fontSizes.inputBig.lg};` : $size === "small" ? `font-size: ${theme.fontSizes.inputSmall.lg}; padding: 0 12px;` : `font-size: ${theme.fontSizes.input.lg};`}
|
|
44
|
-
|
|
45
|
-
${({ $error, $success, theme }) => {
|
|
46
|
-
return statusBorderStyles($error, $success, theme);
|
|
47
|
-
}}
|
|
48
|
-
|
|
49
|
-
${({ disabled, theme }) => disabled && `cursor: not-allowed;
|
|
9
|
+
//#region src/lib/select.tsx
|
|
10
|
+
var StyledSelect = styled.select.withConfig({
|
|
11
|
+
displayName: "select__StyledSelect",
|
|
12
|
+
componentId: "sc-b63bf03d-0"
|
|
13
|
+
})([
|
|
14
|
+
``,
|
|
15
|
+
`;`,
|
|
16
|
+
`;font-family:inherit;display:inline-block;padding:0 15px;border-radius:`,
|
|
17
|
+
`;font-weight:400;white-space:nowrap;hyphens:auto;color:`,
|
|
18
|
+
`;background:`,
|
|
19
|
+
`;border:solid 2px `,
|
|
20
|
+
`;box-shadow:0 0 0 0px `,
|
|
21
|
+
`;transition:all 0.3s ease;&::placeholder{color:`,
|
|
22
|
+
`;}&:hover:not([disabled]){border-color:`,
|
|
23
|
+
`;}&:focus:not([disabled]){box-shadow:0 0 0 4px `,
|
|
24
|
+
`;border-color:`,
|
|
25
|
+
`;}&:active:not([disabled]){box-shadow:0 0 0 2px `,
|
|
26
|
+
`;}`,
|
|
27
|
+
` `,
|
|
28
|
+
` `,
|
|
29
|
+
` `,
|
|
30
|
+
` `,
|
|
31
|
+
``
|
|
32
|
+
], 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.primaryLight, ({ theme }) => theme.colors.primary, ({ theme }) => theme.colors.primaryLight, ({ $size }) => formElementHeightStyles($size), ({ $size, theme }) => $size === "big" ? `font-size: ${theme.fontSizes.inputBig.lg};` : $size === "small" ? `font-size: ${theme.fontSizes.inputSmall.lg}; padding: 0 12px;` : `font-size: ${theme.fontSizes.input.lg};`, ({ $error, $success, theme }) => {
|
|
33
|
+
return statusBorderStyles($error, $success, theme);
|
|
34
|
+
}, ({ disabled, theme }) => disabled && `cursor: not-allowed;
|
|
50
35
|
background: ${theme.colors.grayLight};
|
|
51
36
|
border-color: ${theme.colors.gray};
|
|
52
37
|
color: ${theme.colors.gray};
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
position: relative;
|
|
59
|
-
${({ $fullWidth }) => fullWidthStyles($fullWidth)}
|
|
60
|
-
|
|
61
|
-
& svg {
|
|
62
|
-
position: absolute;
|
|
63
|
-
top: 50%;
|
|
64
|
-
right: 15px;
|
|
65
|
-
transform: translateY(-50%) rotate(0);
|
|
66
|
-
transition: all 0.3s ease;
|
|
67
|
-
pointer-events: none;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
& select {
|
|
71
|
-
padding-right: 40px;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
& select:active:not([disabled]) ~ svg,
|
|
75
|
-
& select:focus:not([disabled]) ~ svg {
|
|
76
|
-
transform: translateY(-50%) rotate(180deg);
|
|
77
|
-
}
|
|
78
|
-
`;
|
|
38
|
+
`, ({ $fullWidth }) => fullWidthStyles($fullWidth));
|
|
39
|
+
var StyledIconWrapper = styled.span.withConfig({
|
|
40
|
+
displayName: "select__StyledIconWrapper",
|
|
41
|
+
componentId: "sc-b63bf03d-1"
|
|
42
|
+
})([`position:relative;`, ` & svg{position:absolute;top:50%;right:15px;transform:translateY(-50%) rotate(0);transition:all 0.3s ease;pointer-events:none;}& select{padding-right:40px;}& select:active:not([disabled]) ~ svg,& select:focus:not([disabled]) ~ svg{transform:translateY(-50%) rotate(180deg);}`], ({ $fullWidth }) => fullWidthStyles($fullWidth));
|
|
79
43
|
function LocalSelect({ ...props }, ref) {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
),
|
|
98
|
-
/* @__PURE__ */ jsx(IconArrow, { "aria-hidden": "true" })
|
|
99
|
-
] })
|
|
100
|
-
]
|
|
101
|
-
}
|
|
102
|
-
);
|
|
44
|
+
return /* @__PURE__ */ jsxs(StyledInputWrapper, {
|
|
45
|
+
$fullWidth: props.$fullWidth,
|
|
46
|
+
$label: props.$label,
|
|
47
|
+
className: props.$wrapperClassName,
|
|
48
|
+
children: [props.$label && /* @__PURE__ */ jsx(StyledLabel, {
|
|
49
|
+
htmlFor: props.id,
|
|
50
|
+
children: props.$label
|
|
51
|
+
}), /* @__PURE__ */ jsxs(StyledIconWrapper, {
|
|
52
|
+
$fullWidth: props.$fullWidth,
|
|
53
|
+
children: [/* @__PURE__ */ jsx(StyledSelect, {
|
|
54
|
+
...props,
|
|
55
|
+
"aria-invalid": props.$error || void 0,
|
|
56
|
+
ref,
|
|
57
|
+
children: props.children
|
|
58
|
+
}), /* @__PURE__ */ jsx(IconArrow, { "aria-hidden": "true" })]
|
|
59
|
+
})]
|
|
60
|
+
});
|
|
103
61
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
StyledIconWrapper
|
|
108
|
-
};
|
|
62
|
+
var Select = /* @__PURE__ */ forwardRef(LocalSelect);
|
|
63
|
+
//#endregion
|
|
64
|
+
export { Select, StyledIconWrapper };
|
package/dist/space.js
CHANGED
|
@@ -1,37 +1,51 @@
|
|
|
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
|
-
|
|
6
|
-
|
|
7
|
+
//#region src/lib/space.tsx
|
|
8
|
+
var styles = ($size, $horizontal) => $size === "none" ? `display: none;` : $horizontal ? `display: inline-block;
|
|
7
9
|
max-height: 0;
|
|
8
10
|
min-width: ${$size}px;
|
|
9
11
|
max-width: ${$size}px;` : `display: block;
|
|
10
12
|
min-height: ${$size}px;
|
|
11
13
|
max-height: ${$size}px;`;
|
|
12
|
-
|
|
14
|
+
var breakpointKeys = [
|
|
15
|
+
"xs",
|
|
16
|
+
"sm",
|
|
17
|
+
"md",
|
|
18
|
+
"lg",
|
|
19
|
+
"xl",
|
|
20
|
+
"xxl",
|
|
21
|
+
"xxxl"
|
|
22
|
+
];
|
|
13
23
|
function responsiveStyles(props) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
(key) => mq(key) + `{ ${styles(propMap[key], props.$horizontal || false)} }`
|
|
25
|
-
).join("");
|
|
24
|
+
const propMap = {
|
|
25
|
+
xs: props.$xs,
|
|
26
|
+
sm: props.$sm,
|
|
27
|
+
md: props.$md,
|
|
28
|
+
lg: props.$lg,
|
|
29
|
+
xl: props.$xl,
|
|
30
|
+
xxl: props.$xxl,
|
|
31
|
+
xxxl: props.$xxxl
|
|
32
|
+
};
|
|
33
|
+
return breakpointKeys.filter((key) => propMap[key] !== void 0).map((key) => mq(key) + `{ ${styles(propMap[key], props.$horizontal || false)} }`).join("");
|
|
26
34
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
35
|
+
var StyledSpace = styled.span.withConfig({
|
|
36
|
+
displayName: "space__StyledSpace",
|
|
37
|
+
componentId: "sc-d047ac9d-0"
|
|
38
|
+
})([
|
|
39
|
+
``,
|
|
40
|
+
` `,
|
|
41
|
+
``
|
|
42
|
+
], ({ $horizontal, $size }) => $size ? styles($size, $horizontal || false) : "", (props) => responsiveStyles(props));
|
|
31
43
|
function LocalSpace({ ...props }, ref) {
|
|
32
|
-
|
|
44
|
+
return /* @__PURE__ */ jsx(StyledSpace, {
|
|
45
|
+
...props,
|
|
46
|
+
ref
|
|
47
|
+
});
|
|
33
48
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
};
|
|
49
|
+
var Space = /* @__PURE__ */ forwardRef(LocalSpace);
|
|
50
|
+
//#endregion
|
|
51
|
+
export { Space };
|
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
2
|
+
"use client";
|
|
3
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
3
4
|
import { useState } from "react";
|
|
4
5
|
import { useServerInsertedHTML } from "next/navigation";
|
|
5
6
|
import { ServerStyleSheet, StyleSheetManager } from "styled-components";
|
|
7
|
+
//#region src/lib/styled-components/registry.tsx
|
|
6
8
|
function StyledComponentsRegistry({ children }) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
children
|
|
20
|
-
}
|
|
21
|
-
);
|
|
9
|
+
const [styledComponentsStyleSheet] = useState(() => new ServerStyleSheet());
|
|
10
|
+
const isServer = typeof window === "undefined";
|
|
11
|
+
useServerInsertedHTML(() => {
|
|
12
|
+
const styles = styledComponentsStyleSheet.getStyleElement();
|
|
13
|
+
styledComponentsStyleSheet.instance.clearTag();
|
|
14
|
+
return /* @__PURE__ */ jsx(Fragment, { children: styles });
|
|
15
|
+
});
|
|
16
|
+
return /* @__PURE__ */ jsx(StyleSheetManager, {
|
|
17
|
+
sheet: isServer ? styledComponentsStyleSheet.instance : void 0,
|
|
18
|
+
enableVendorPrefixes: true,
|
|
19
|
+
children
|
|
20
|
+
});
|
|
22
21
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
};
|
|
22
|
+
//#endregion
|
|
23
|
+
export { StyledComponentsRegistry };
|
|
@@ -1,35 +1,31 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import { GlobalStyles } from "../utils/global.js";
|
|
2
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
5
|
+
import { createContext, useEffect, useState } from "react";
|
|
4
6
|
import { ThemeProvider } from "styled-components";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return /* @__PURE__ */ jsx(ThemeProvider, { theme: currentTheme, children: /* @__PURE__ */ jsxs(ThemeContext.Provider, { value: { setTheme }, children: [
|
|
28
|
-
/* @__PURE__ */ jsx(GlobalStylesComponent, {}),
|
|
29
|
-
children
|
|
30
|
-
] }) });
|
|
7
|
+
//#region src/lib/styled-components/theme-provider.tsx
|
|
8
|
+
var ThemeContext = /* @__PURE__ */ createContext({ setTheme: () => {} });
|
|
9
|
+
function CherryThemeProvider({ children, theme, themeDark }) {
|
|
10
|
+
const [currentTheme, setTheme] = useState(theme);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (!themeDark) return setTheme(theme);
|
|
13
|
+
if (localStorage.theme === "dark" || !("theme" in localStorage) && window.matchMedia("(prefers-color-scheme: dark)").matches) {
|
|
14
|
+
document.documentElement.classList.add("dark");
|
|
15
|
+
setTheme(themeDark);
|
|
16
|
+
} else {
|
|
17
|
+
document.documentElement.classList.remove("dark");
|
|
18
|
+
setTheme(theme);
|
|
19
|
+
}
|
|
20
|
+
}, [theme, themeDark]);
|
|
21
|
+
const GlobalStylesComponent = GlobalStyles(currentTheme);
|
|
22
|
+
return /* @__PURE__ */ jsx(ThemeProvider, {
|
|
23
|
+
theme: currentTheme,
|
|
24
|
+
children: /* @__PURE__ */ jsxs(ThemeContext.Provider, {
|
|
25
|
+
value: { setTheme },
|
|
26
|
+
children: [/* @__PURE__ */ jsx(GlobalStylesComponent, {}), children]
|
|
27
|
+
})
|
|
28
|
+
});
|
|
31
29
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
ThemeContext
|
|
35
|
-
};
|
|
30
|
+
//#endregion
|
|
31
|
+
export { CherryThemeProvider, ThemeContext };
|