cherry-styled-components 0.1.0-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 (183) hide show
  1. package/.DS_Store +0 -0
  2. package/.eslintrc.json +3 -0
  3. package/.gitignore +43 -0
  4. package/.next/app-build-manifest.json +15 -0
  5. package/.next/build-manifest.json +19 -0
  6. package/.next/cache/.tsbuildinfo +1 -0
  7. package/.next/cache/eslint/.cache_hc9deq +1 -0
  8. package/.next/cache/webpack/client-development/0.pack.gz +0 -0
  9. package/.next/cache/webpack/client-development/1.pack.gz +0 -0
  10. package/.next/cache/webpack/client-development/10.pack.gz +0 -0
  11. package/.next/cache/webpack/client-development/11.pack.gz +0 -0
  12. package/.next/cache/webpack/client-development/12.pack.gz +0 -0
  13. package/.next/cache/webpack/client-development/13.pack.gz +0 -0
  14. package/.next/cache/webpack/client-development/14.pack.gz +0 -0
  15. package/.next/cache/webpack/client-development/15.pack.gz +0 -0
  16. package/.next/cache/webpack/client-development/16.pack.gz +0 -0
  17. package/.next/cache/webpack/client-development/17.pack.gz +0 -0
  18. package/.next/cache/webpack/client-development/18.pack.gz +0 -0
  19. package/.next/cache/webpack/client-development/19.pack.gz +0 -0
  20. package/.next/cache/webpack/client-development/2.pack.gz +0 -0
  21. package/.next/cache/webpack/client-development/20.pack.gz +0 -0
  22. package/.next/cache/webpack/client-development/21.pack.gz +0 -0
  23. package/.next/cache/webpack/client-development/22.pack.gz +0 -0
  24. package/.next/cache/webpack/client-development/23.pack.gz +0 -0
  25. package/.next/cache/webpack/client-development/3.pack.gz +0 -0
  26. package/.next/cache/webpack/client-development/4.pack.gz +0 -0
  27. package/.next/cache/webpack/client-development/5.pack.gz +0 -0
  28. package/.next/cache/webpack/client-development/6.pack.gz +0 -0
  29. package/.next/cache/webpack/client-development/7.pack.gz +0 -0
  30. package/.next/cache/webpack/client-development/8.pack.gz +0 -0
  31. package/.next/cache/webpack/client-development/9.pack.gz +0 -0
  32. package/.next/cache/webpack/client-development/index.pack.gz +0 -0
  33. package/.next/cache/webpack/client-development/index.pack.gz.old +0 -0
  34. package/.next/cache/webpack/client-development-fallback/0.pack.gz +0 -0
  35. package/.next/cache/webpack/client-development-fallback/1.pack.gz +0 -0
  36. package/.next/cache/webpack/client-development-fallback/index.pack.gz +0 -0
  37. package/.next/cache/webpack/client-development-fallback/index.pack.gz.old +0 -0
  38. package/.next/cache/webpack/client-production/0.pack +0 -0
  39. package/.next/cache/webpack/client-production/1.pack +0 -0
  40. package/.next/cache/webpack/client-production/2.pack +0 -0
  41. package/.next/cache/webpack/client-production/index.pack +0 -0
  42. package/.next/cache/webpack/client-production/index.pack.old +0 -0
  43. package/.next/cache/webpack/server-development/0.pack.gz +0 -0
  44. package/.next/cache/webpack/server-development/1.pack.gz +0 -0
  45. package/.next/cache/webpack/server-development/10.pack.gz +0 -0
  46. package/.next/cache/webpack/server-development/11.pack.gz +0 -0
  47. package/.next/cache/webpack/server-development/12.pack.gz +0 -0
  48. package/.next/cache/webpack/server-development/13.pack.gz +0 -0
  49. package/.next/cache/webpack/server-development/14.pack.gz +0 -0
  50. package/.next/cache/webpack/server-development/15.pack.gz +0 -0
  51. package/.next/cache/webpack/server-development/16.pack.gz +0 -0
  52. package/.next/cache/webpack/server-development/17.pack.gz +0 -0
  53. package/.next/cache/webpack/server-development/18.pack.gz +0 -0
  54. package/.next/cache/webpack/server-development/19.pack.gz +0 -0
  55. package/.next/cache/webpack/server-development/2.pack.gz +0 -0
  56. package/.next/cache/webpack/server-development/20.pack.gz +0 -0
  57. package/.next/cache/webpack/server-development/21.pack.gz +0 -0
  58. package/.next/cache/webpack/server-development/22.pack.gz +0 -0
  59. package/.next/cache/webpack/server-development/23.pack.gz +0 -0
  60. package/.next/cache/webpack/server-development/24.pack.gz +0 -0
  61. package/.next/cache/webpack/server-development/25.pack.gz +0 -0
  62. package/.next/cache/webpack/server-development/26.pack.gz +0 -0
  63. package/.next/cache/webpack/server-development/27.pack.gz +0 -0
  64. package/.next/cache/webpack/server-development/28.pack.gz +0 -0
  65. package/.next/cache/webpack/server-development/29.pack.gz +0 -0
  66. package/.next/cache/webpack/server-development/3.pack.gz +0 -0
  67. package/.next/cache/webpack/server-development/30.pack.gz +0 -0
  68. package/.next/cache/webpack/server-development/31.pack.gz +0 -0
  69. package/.next/cache/webpack/server-development/32.pack.gz +0 -0
  70. package/.next/cache/webpack/server-development/4.pack.gz +0 -0
  71. package/.next/cache/webpack/server-development/5.pack.gz +0 -0
  72. package/.next/cache/webpack/server-development/6.pack.gz +0 -0
  73. package/.next/cache/webpack/server-development/7.pack.gz +0 -0
  74. package/.next/cache/webpack/server-development/8.pack.gz +0 -0
  75. package/.next/cache/webpack/server-development/9.pack.gz +0 -0
  76. package/.next/cache/webpack/server-development/index.pack.gz +0 -0
  77. package/.next/cache/webpack/server-development/index.pack.gz.old +0 -0
  78. package/.next/cache/webpack/server-production/0.pack +0 -0
  79. package/.next/cache/webpack/server-production/1.pack +0 -0
  80. package/.next/cache/webpack/server-production/index.pack +0 -0
  81. package/.next/cache/webpack/server-production/index.pack.old +0 -0
  82. package/.next/package.json +1 -0
  83. package/.next/react-loadable-manifest.json +1 -0
  84. package/.next/server/app/page.js +1072 -0
  85. package/.next/server/app/page_client-reference-manifest.js +1 -0
  86. package/.next/server/app-paths-manifest.json +1 -0
  87. package/.next/server/middleware-build-manifest.js +1 -0
  88. package/.next/server/middleware-manifest.json +6 -0
  89. package/.next/server/middleware-react-loadable-manifest.js +1 -0
  90. package/.next/server/next-font-manifest.js +1 -0
  91. package/.next/server/next-font-manifest.json +1 -0
  92. package/.next/server/pages-manifest.json +1 -0
  93. package/.next/server/server-reference-manifest.js +1 -0
  94. package/.next/server/server-reference-manifest.json +5 -0
  95. package/.next/server/vendor-chunks/@emotion.js +45 -0
  96. package/.next/server/vendor-chunks/@swc.js +75 -0
  97. package/.next/server/vendor-chunks/next.js +2197 -0
  98. package/.next/server/vendor-chunks/shallowequal.js +24 -0
  99. package/.next/server/vendor-chunks/styled-components.js +35 -0
  100. package/.next/server/vendor-chunks/stylis.js +85 -0
  101. package/.next/server/webpack-runtime.js +220 -0
  102. package/.next/static/chunks/app/layout.js +695 -0
  103. package/.next/static/chunks/app/page.js +28 -0
  104. package/.next/static/chunks/app-pages-internals.js +105 -0
  105. package/.next/static/chunks/main-app.js +1893 -0
  106. package/.next/static/chunks/polyfills.js +1 -0
  107. package/.next/static/chunks/webpack.js +1416 -0
  108. package/.next/static/css/app/layout.css +69 -0
  109. package/.next/static/development/_buildManifest.js +1 -0
  110. package/.next/static/development/_ssgManifest.js +1 -0
  111. package/.next/static/media/05a31a2ca4975f99-s.woff2 +0 -0
  112. package/.next/static/media/513657b02c5c193f-s.woff2 +0 -0
  113. package/.next/static/media/51ed15f9841b9f9d-s.woff2 +0 -0
  114. package/.next/static/media/c9a5bc6a7c948fb0-s.p.woff2 +0 -0
  115. package/.next/static/media/d6b16ce4a6175f26-s.woff2 +0 -0
  116. package/.next/static/media/ec159349637c90ad-s.woff2 +0 -0
  117. package/.next/static/media/fd4db3eb5472fc27-s.woff2 +0 -0
  118. package/.next/static/webpack/633457081244afec._.hot-update.json +1 -0
  119. package/.next/trace +19 -0
  120. package/.next/types/app/layout.ts +79 -0
  121. package/.next/types/app/page.ts +79 -0
  122. package/.next/types/package.json +1 -0
  123. package/.prettierrc +11 -0
  124. package/.vscode/settings.json +67 -0
  125. package/README.md +15 -0
  126. package/next-env.d.ts +5 -0
  127. package/next.config.mjs +8 -0
  128. package/package.json +51 -0
  129. package/src/app/components/box.tsx +16 -0
  130. package/src/app/components/button.tsx +177 -0
  131. package/src/app/components/col.tsx +39 -0
  132. package/src/app/components/container.tsx +55 -0
  133. package/src/app/components/flex.tsx +90 -0
  134. package/src/app/components/grid.tsx +60 -0
  135. package/src/app/components/index.ts +15 -0
  136. package/src/app/components/input.tsx +254 -0
  137. package/src/app/components/max-width.tsx +43 -0
  138. package/src/app/components/range.tsx +223 -0
  139. package/src/app/components/select.tsx +122 -0
  140. package/src/app/components/space.tsx +54 -0
  141. package/src/app/components/styled-components/index.ts +2 -0
  142. package/src/app/components/styled-components/registry.tsx +26 -0
  143. package/src/app/components/styled-components/theme-provider.tsx +21 -0
  144. package/src/app/components/textarea.tsx +98 -0
  145. package/src/app/components/toggle.tsx +148 -0
  146. package/src/app/components/utils/global.tsx +78 -0
  147. package/src/app/components/utils/icons.tsx +168 -0
  148. package/src/app/components/utils/index.ts +5 -0
  149. package/src/app/components/utils/mixins.tsx +107 -0
  150. package/src/app/components/utils/theme.ts +241 -0
  151. package/src/app/components/utils/typography.tsx +204 -0
  152. package/src/app/layout.tsx +19 -0
  153. package/src/app/page.tsx +14 -0
  154. package/tsconfig.json +29 -0
  155. package/tsconfig.tsbuildinfo +1 -0
  156. package/types/.next/types/app/layout.d.ts +9 -0
  157. package/types/.next/types/app/page.d.ts +9 -0
  158. package/types/src/app/components/box.d.ts +4 -0
  159. package/types/src/app/components/button.d.ts +17 -0
  160. package/types/src/app/components/col.d.ts +16 -0
  161. package/types/src/app/components/container.d.ts +19 -0
  162. package/types/src/app/components/flex.d.ts +27 -0
  163. package/types/src/app/components/grid.d.ts +24 -0
  164. package/types/src/app/components/index.d.ts +15 -0
  165. package/types/src/app/components/input.d.ts +15 -0
  166. package/types/src/app/components/max-width.d.ts +13 -0
  167. package/types/src/app/components/range.d.ts +13 -0
  168. package/types/src/app/components/select.d.ts +14 -0
  169. package/types/src/app/components/space.d.ts +14 -0
  170. package/types/src/app/components/styled-components/index.d.ts +2 -0
  171. package/types/src/app/components/styled-components/registry.d.ts +5 -0
  172. package/types/src/app/components/styled-components/theme-provider.d.ts +6 -0
  173. package/types/src/app/components/textarea.d.ts +13 -0
  174. package/types/src/app/components/toggle.d.ts +14 -0
  175. package/types/src/app/components/utils/global.d.ts +3 -0
  176. package/types/src/app/components/utils/icons.d.ts +9 -0
  177. package/types/src/app/components/utils/index.d.ts +5 -0
  178. package/types/src/app/components/utils/mixins.d.ts +11 -0
  179. package/types/src/app/components/utils/theme.d.ts +227 -0
  180. package/types/src/app/components/utils/typography.d.ts +20 -0
  181. package/types/src/app/layout.d.ts +2 -0
  182. package/types/src/app/page.d.ts +4 -0
  183. package/types/tsconfig.tsbuildinfo +1 -0
@@ -0,0 +1,90 @@
1
+ "use client";
2
+ import React from "react";
3
+ import styled from "styled-components";
4
+ import {
5
+ Theme,
6
+ mq,
7
+ generateGapStyles,
8
+ generateJustifyContentStyles,
9
+ } from "./utils";
10
+
11
+ type JustifyContentType =
12
+ | "center"
13
+ | "flex-start"
14
+ | "flex-end"
15
+ | "space-between"
16
+ | "space-around"
17
+ | "space-evenly";
18
+
19
+ type GapType = number | "none";
20
+
21
+ interface FlexProps extends React.AllHTMLAttributes<FlexProps> {
22
+ children?: React.ReactNode;
23
+ $justifyContent?: JustifyContentType;
24
+ $xsJustifyContent?: JustifyContentType;
25
+ $smJustifyContent?: JustifyContentType;
26
+ $mdJustifyContent?: JustifyContentType;
27
+ $lgJustifyContent?: JustifyContentType;
28
+ $xlJustifyContent?: JustifyContentType;
29
+ $xxlJustifyContent?: JustifyContentType;
30
+ $xxxlJustifyContent?: JustifyContentType;
31
+ $wrap?: "wrap" | "nowrap" | "wrap-reverse";
32
+ $gap?: GapType;
33
+ $xsGap?: GapType;
34
+ $smGap?: GapType;
35
+ $mdGap?: GapType;
36
+ $lgGap?: GapType;
37
+ $xlGap?: GapType;
38
+ $xxlGap?: GapType;
39
+ $xxxlGap?: GapType;
40
+ theme?: Theme;
41
+ }
42
+
43
+ const StyledFlex = styled.div<FlexProps>`
44
+ display: flex;
45
+ justify-content: ${({ $justifyContent }) =>
46
+ $justifyContent || "flex-start"};
47
+ flex-wrap: ${({ $wrap }) => $wrap || "wrap"};
48
+ gap: ${({ $gap, theme }) =>
49
+ ($gap && `${$gap}px`) || theme.spacing.gridGap.xs};
50
+
51
+ ${mq("lg")} {
52
+ gap: ${({ $gap, theme }) =>
53
+ ($gap && `${$gap}px`) || theme.spacing.gridGap.lg};
54
+ }
55
+
56
+ ${({ $xsGap }) => $xsGap && generateGapStyles("xs", $xsGap)}
57
+ ${({ $xsJustifyContent }) =>
58
+ $xsJustifyContent &&
59
+ generateJustifyContentStyles("xs", $xsJustifyContent)}
60
+ ${({ $smGap }) => $smGap && generateGapStyles("sm", $smGap)}
61
+ ${({ $smJustifyContent }) =>
62
+ $smJustifyContent &&
63
+ generateJustifyContentStyles("sm", $smJustifyContent)}
64
+ ${({ $mdGap }) => $mdGap && generateGapStyles("md", $mdGap)}
65
+ ${({ $mdJustifyContent }) =>
66
+ $mdJustifyContent &&
67
+ generateJustifyContentStyles("md", $mdJustifyContent)}
68
+ ${({ $lgGap }) => $lgGap && generateGapStyles("lg", $lgGap)}
69
+ ${({ $lgJustifyContent }) =>
70
+ $lgJustifyContent &&
71
+ generateJustifyContentStyles("lg", $lgJustifyContent)}
72
+ ${({ $xlGap }) => $xlGap && generateGapStyles("xl", $xlGap)}
73
+ ${({ $xlJustifyContent }) =>
74
+ $xlJustifyContent &&
75
+ generateJustifyContentStyles("xl", $xlJustifyContent)}
76
+ ${({ $xxlGap }) => $xxlGap && generateGapStyles("xxl", $xxlGap)}
77
+ ${({ $xxlJustifyContent }) =>
78
+ $xxlJustifyContent &&
79
+ generateJustifyContentStyles("xxl", $xxlJustifyContent)}
80
+ ${({ $xxxlGap }) => $xxxlGap && generateGapStyles("xxxl", $xxxlGap)}
81
+ ${({ $xxxlJustifyContent }) =>
82
+ $xxxlJustifyContent &&
83
+ generateJustifyContentStyles("xxxl", $xxxlJustifyContent)}
84
+ `;
85
+
86
+ function Flex({ ...props }: FlexProps) {
87
+ return <StyledFlex {...props}>{props.children}</StyledFlex>;
88
+ }
89
+
90
+ export { Flex };
@@ -0,0 +1,60 @@
1
+ "use client";
2
+ import React from "react";
3
+ import styled from "styled-components";
4
+ import { Theme, mq, generateColsStyles, generateGapStyles } from "./utils";
5
+
6
+ interface GridProps extends React.HTMLAttributes<HTMLDivElement> {
7
+ children?: React.ReactNode;
8
+ $gap?: number | "none";
9
+ $xsGap?: number | "none";
10
+ $smGap?: number | "none";
11
+ $mdGap?: number | "none";
12
+ $lgGap?: number | "none";
13
+ $xlGap?: number | "none";
14
+ $xxlGap?: number | "none";
15
+ $xxxlGap?: number | "none";
16
+ $cols?: number;
17
+ $xsCols?: number;
18
+ $smCols?: number;
19
+ $mdCols?: number;
20
+ $lgCols?: number;
21
+ $xlCols?: number;
22
+ $xxlCols?: number;
23
+ $xxxlCols?: number;
24
+ theme?: Theme;
25
+ }
26
+
27
+ const StyledGrid = styled.div<GridProps>`
28
+ display: grid;
29
+ grid-template-columns: ${({ $cols }) =>
30
+ `repeat(${$cols || 3}, minmax(0, 1fr))`};
31
+ gap: ${({ $gap, theme }) =>
32
+ ($gap && `${$gap}px`) || theme.spacing.gridGap.xs};
33
+
34
+ ${mq("lg")} {
35
+ gap: ${({ $gap, theme }) =>
36
+ ($gap && `${$gap}px`) || theme.spacing.gridGap.lg};
37
+ }
38
+
39
+ ${({ $xsGap }) => $xsGap && generateGapStyles("xs", $xsGap)}
40
+ ${({ $smGap }) => $smGap && generateGapStyles("sm", $smGap)}
41
+ ${({ $mdGap }) => $mdGap && generateGapStyles("md", $mdGap)}
42
+ ${({ $lgGap }) => $lgGap && generateGapStyles("lg", $lgGap)}
43
+ ${({ $xlGap }) => $xlGap && generateGapStyles("xl", $xlGap)}
44
+ ${({ $xxlGap }) => $xxlGap && generateGapStyles("xxl", $xxlGap)}
45
+ ${({ $xxxlGap }) => $xxxlGap && generateGapStyles("xxxl", $xxxlGap)}
46
+
47
+ ${({ $xsCols }) => $xsCols && generateColsStyles("xs", $xsCols)}
48
+ ${({ $smCols }) => $smCols && generateColsStyles("sm", $smCols)}
49
+ ${({ $mdCols }) => $mdCols && generateColsStyles("md", $mdCols)}
50
+ ${({ $lgCols }) => $lgCols && generateColsStyles("lg", $lgCols)}
51
+ ${({ $xlCols }) => $xlCols && generateColsStyles("xl", $xlCols)}
52
+ ${({ $xxlCols }) => $xxlCols && generateColsStyles("xxl", $xxlCols)}
53
+ ${({ $xxxlCols }) => $xxxlCols && generateColsStyles("xxxl", $xxxlCols)}
54
+ `;
55
+
56
+ function Grid({ ...props }: GridProps) {
57
+ return <StyledGrid {...props}>{props.children}</StyledGrid>;
58
+ }
59
+
60
+ export { Grid };
@@ -0,0 +1,15 @@
1
+ export * from "./styled-components";
2
+ export * from "./utils/";
3
+ export * from "./box";
4
+ export * from "./button";
5
+ export * from "./col";
6
+ export * from "./container";
7
+ export * from "./flex";
8
+ export * from "./grid";
9
+ export * from "./input";
10
+ export * from "./max-width";
11
+ export * from "./range";
12
+ export * from "./select";
13
+ export * from "./space";
14
+ export * from "./textarea";
15
+ export * from "./toggle";
@@ -0,0 +1,254 @@
1
+ "use client";
2
+ import React from "react";
3
+ import styled from "styled-components";
4
+ import {
5
+ Theme,
6
+ IconCheck,
7
+ formElementHeightStyles,
8
+ fullWidthStyles,
9
+ resetButton,
10
+ resetInput,
11
+ statusBorderStyles,
12
+ } from "./utils";
13
+
14
+ interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
15
+ children?: React.ReactNode;
16
+ $label?: string;
17
+ $size?: "default" | "big";
18
+ $error?: boolean;
19
+ $success?: boolean;
20
+ $fullWidth?: boolean;
21
+ theme?: Theme;
22
+ }
23
+
24
+ export const StyledInputWrapper = styled.span<InputProps>`
25
+ display: inline-flex;
26
+ flex-wrap: ${({ type }) =>
27
+ type === "checkbox" || type === "radio" ? "nowrap" : "wrap"};
28
+ gap: 10px;
29
+ align-items: center;
30
+
31
+ ${({ $fullWidth }) => fullWidthStyles($fullWidth ? true : false)}
32
+ `;
33
+
34
+ export const StyledLabel = styled.label<InputProps>`
35
+ display: inline-block;
36
+ color: ${({ theme }) => theme.colors.grayDark};
37
+ font-size: ${({ theme }) => theme.fontSizes.text.lg};
38
+ line-height: ${({ theme }) => theme.lineHeights.text.lg};
39
+ `;
40
+
41
+ const StyledInput = styled.input<InputProps>`
42
+ ${resetButton};
43
+ ${resetInput};
44
+ font-family: inherit;
45
+ display: inline-block;
46
+ padding: 17px 15px;
47
+ border-radius: ${({ theme }) => theme.spacing.radius.xs};
48
+ font-weight: 400;
49
+ white-space: nowrap;
50
+ hyphens: auto;
51
+ color: ${({ theme }) => theme.colors.dark};
52
+ background: ${({ theme }) => theme.colors.light};
53
+ border: solid 2px ${({ theme }) => theme.colors.grayLight};
54
+ box-shadow: 0 0 0 0px ${({ theme }) => theme.colors.primaryLight};
55
+ transition: all 0.3s ease;
56
+
57
+ &::placeholder {
58
+ color: ${({ theme }) => theme.colors.gray};
59
+ }
60
+
61
+ @media (hover: hover) {
62
+ &:hover:not([disabled]) {
63
+ border-color: ${({ theme }) => theme.colors.primary};
64
+ }
65
+ }
66
+
67
+ &:focus:not([disabled]) {
68
+ box-shadow: 0 0 0 4px ${({ theme }) => theme.colors.primaryLight};
69
+ border-color: ${({ theme }) => theme.colors.primary};
70
+ }
71
+
72
+ &:active:not([disabled]) {
73
+ box-shadow: 0 0 0 2px ${({ theme }) => theme.colors.primaryLight};
74
+ }
75
+
76
+ ${({ $size }) => formElementHeightStyles($size)}
77
+
78
+ ${({ $size, theme }) =>
79
+ $size === "big"
80
+ ? `font-size: ${theme.fontSizes.inputBig.lg};
81
+ line-height: ${theme.lineHeights.inputBig.lg};
82
+ `
83
+ : `font-size: ${theme.fontSizes.input.lg};
84
+ line-height: ${theme.lineHeights.input.lg};`}
85
+
86
+ ${({ $error, $success, theme }) => {
87
+ return statusBorderStyles(
88
+ $error ? true : false,
89
+ $success ? true : false,
90
+ theme,
91
+ );
92
+ }}
93
+
94
+ ${({ disabled, theme }) =>
95
+ disabled &&
96
+ `cursor: not-allowed;
97
+ background: ${theme.colors.grayLight};
98
+ border-color: ${theme.colors.gray};
99
+ color: ${theme.colors.gray};
100
+ `}
101
+
102
+ ${({ $fullWidth }) => fullWidthStyles($fullWidth ? true : false)}
103
+ `;
104
+
105
+ const StyledIconWrapper = styled.span<InputProps>`
106
+ display: inline-flex;
107
+ position: relative;
108
+ line-height: 0;
109
+
110
+ & em {
111
+ display: block;
112
+ border-radius: 50%;
113
+ background: ${({ theme }) => theme.colors.primary};
114
+ }
115
+
116
+ & svg,
117
+ & em {
118
+ object-fit: contain;
119
+ position: absolute;
120
+ top: 50%;
121
+ left: 50%;
122
+ transform: translate(-50%, -50%) scale(0.7);
123
+ opacity: 0;
124
+ pointer-events: none;
125
+ transition: all 0.3s ease;
126
+ }
127
+ `;
128
+
129
+ const StyledRadioCheckboxInput = styled.input<InputProps>`
130
+ ${resetButton};
131
+ display: inline-block;
132
+ border: solid 2px ${({ theme }) => theme.colors.grayLight};
133
+ box-shadow: 0 0 0 0px ${({ theme }) => theme.colors.primaryLight};
134
+ transition: all 0.3s ease;
135
+
136
+ @media (hover: hover) {
137
+ &:hover:not([disabled]) {
138
+ border-color: ${({ theme }) => theme.colors.primary};
139
+ }
140
+ }
141
+
142
+ &:focus:not([disabled]) {
143
+ box-shadow: 0 0 0 4px ${({ theme }) => theme.colors.primaryLight};
144
+ border-color: ${({ theme }) => theme.colors.primary};
145
+ }
146
+
147
+ &:active:not([disabled]) {
148
+ box-shadow: 0 0 0 2px ${({ theme }) => theme.colors.primaryLight};
149
+ }
150
+
151
+ ${({ type, theme }) =>
152
+ type === "checkbox"
153
+ ? `border-radius: ${theme.spacing.radius.xs};`
154
+ : `border-radius: 50%;`}
155
+
156
+ ${({ disabled, theme }) =>
157
+ disabled &&
158
+ `cursor: not-allowed;
159
+ background: ${theme.colors.grayLight};
160
+ border-color: ${theme.colors.gray};
161
+ color: ${theme.colors.gray};
162
+ `}
163
+
164
+ ${({ $error, $success, theme }) => {
165
+ return statusBorderStyles(
166
+ $error ? true : false,
167
+ $success ? true : false,
168
+ theme,
169
+ );
170
+ }}
171
+
172
+ ${({ $size }) => {
173
+ if ($size === "big") {
174
+ return `
175
+ min-width: 32px;
176
+ width: 32px;
177
+ min-height: 32px;
178
+ height: 32px;
179
+
180
+ & ~ svg {
181
+ min-width: 18px;
182
+ width: 18px;
183
+ min-height: 18px;
184
+ height: 18px;
185
+ }
186
+
187
+ & ~ em {
188
+ min-width: 14px;
189
+ width: 14px;
190
+ min-height: 14px;
191
+ height: 14px;
192
+ }
193
+ `;
194
+ } else {
195
+ return `
196
+ min-width: 22px;
197
+ width: 22px;
198
+ min-height: 22px;
199
+ height: 22px;
200
+
201
+ & ~ svg {
202
+ min-width: 12px;
203
+ width: 12px;
204
+ min-height: 12px;
205
+ height: 12px;
206
+ }
207
+
208
+ & ~ em {
209
+ min-width: 8px;
210
+ width: 8px;
211
+ min-height: 8px;
212
+ height: 8px;
213
+ }
214
+ `;
215
+ }
216
+ }}
217
+
218
+ &:checked ~ svg,
219
+ &:checked ~ em {
220
+ opacity: 1;
221
+ transform: translate(-50%, -50%) scale(1);
222
+ }
223
+ `;
224
+
225
+ function Input({ ...props }: InputProps) {
226
+ if (props.type === "checkbox" || props.type === "radio") {
227
+ return (
228
+ <StyledInputWrapper $fullWidth={props.$fullWidth} type={props.type}>
229
+ <StyledIconWrapper>
230
+ <StyledRadioCheckboxInput {...props} />
231
+ {!props.disabled && props.type === "checkbox" ? (
232
+ <IconCheck />
233
+ ) : (
234
+ <em />
235
+ )}
236
+ </StyledIconWrapper>
237
+ {props.$label && (
238
+ <StyledLabel htmlFor={props.id}>{props.$label}</StyledLabel>
239
+ )}
240
+ </StyledInputWrapper>
241
+ );
242
+ }
243
+
244
+ return (
245
+ <StyledInputWrapper $fullWidth={props.$fullWidth} type={props.type}>
246
+ {props.$label && (
247
+ <StyledLabel htmlFor={props.id}>{props.$label}</StyledLabel>
248
+ )}
249
+ <StyledInput {...props} />
250
+ </StyledInputWrapper>
251
+ );
252
+ }
253
+
254
+ export { Input };
@@ -0,0 +1,43 @@
1
+ "use client";
2
+ import React from "react";
3
+ import styled from "styled-components";
4
+ import { Breakpoints, mq } from "./utils";
5
+
6
+ interface MaxWidthProps extends React.HTMLAttributes<HTMLDivElement> {
7
+ $size?: number;
8
+ $xs?: number;
9
+ $sm?: number;
10
+ $md?: number;
11
+ $lg?: number;
12
+ $xl?: number;
13
+ $xxl?: number;
14
+ $xxxl?: number;
15
+ }
16
+
17
+ const styles = ($size: number | "none") => `max-width: ${$size}px;`;
18
+
19
+ function responsiveStyles(props: any) {
20
+ return Object.keys(props)
21
+ .filter((key) => key.startsWith("$"))
22
+ .map((key) => {
23
+ const size = key.substring(1) as keyof Breakpoints<number>;
24
+ return props[key] && mq(size) + `{ ${styles(props[key])} }`;
25
+ })
26
+ .join("");
27
+ }
28
+
29
+ const StyledMaxWidth = styled.div<MaxWidthProps>`
30
+ display: block;
31
+ margin: auto;
32
+
33
+ ${({ $size }) => `
34
+ ${$size && styles($size)};
35
+ `}
36
+ ${(props) => responsiveStyles(props)}
37
+ `;
38
+
39
+ function MaxWidth({ ...props }: MaxWidthProps) {
40
+ return <StyledMaxWidth {...props}>{props.children}</StyledMaxWidth>;
41
+ }
42
+
43
+ export { MaxWidth };
@@ -0,0 +1,223 @@
1
+ "use client";
2
+ import React from "react";
3
+ import styled from "styled-components";
4
+ import {
5
+ Theme,
6
+ fullWidthStyles,
7
+ resetButton,
8
+ statusBorderStyles,
9
+ } from "./utils";
10
+ import { StyledLabel } from "./input";
11
+
12
+ interface InputProps
13
+ extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> {
14
+ className?: string;
15
+ $label?: string;
16
+ $size?: "default" | "big";
17
+ $error?: boolean;
18
+ $success?: boolean;
19
+ $fullWidth?: boolean;
20
+ theme?: Theme;
21
+ }
22
+
23
+ const StyledInputWrapper = styled.span<InputProps>`
24
+ display: inline-flex;
25
+ flex-wrap: ${({ type }) =>
26
+ type === "checkbox" || type === "radio" ? "fprnowrap" : "wrap"};
27
+ gap: 10px;
28
+ align-items: center;
29
+
30
+ ${({ $fullWidth }) => fullWidthStyles($fullWidth ? true : false)}
31
+ `;
32
+
33
+ const StyledInput = styled.input<InputProps>`
34
+ ${resetButton};
35
+ padding: 0;
36
+ height: 10px;
37
+ font-size: 0;
38
+ background: transparent;
39
+ min-width: 100px;
40
+
41
+ &::-webkit-slider-runnable-track {
42
+ width: 100%;
43
+ cursor: pointer;
44
+ border-radius: ${({ theme }) => theme.spacing.radius.xl};
45
+ border: solid 2px ${({ theme }) => theme.colors.grayLight};
46
+ box-shadow: 0 0 0 0 ${({ theme }) => theme.colors.primaryLight};
47
+ transition: all 0.3s ease;
48
+ ${({ $error, $success, theme }) => {
49
+ return statusBorderStyles(
50
+ $error ? true : false,
51
+ $success ? true : false,
52
+ theme,
53
+ );
54
+ }}
55
+ }
56
+
57
+ &::-moz-range-track {
58
+ width: 100%;
59
+ cursor: pointer;
60
+ border-radius: ${({ theme }) => theme.spacing.radius.xl};
61
+ border: solid 2px ${({ theme }) => theme.colors.grayLight};
62
+ box-shadow: 0 0 0 0 ${({ theme }) => theme.colors.primaryLight};
63
+ transition: all 0.3s ease;
64
+ ${({ $error, $success, theme }) => {
65
+ return statusBorderStyles(
66
+ $error ? true : false,
67
+ $success ? true : false,
68
+ theme,
69
+ );
70
+ }}
71
+ }
72
+
73
+ &::-webkit-slider-thumb {
74
+ ${resetButton};
75
+ background: ${({ theme }) => theme.colors.primary};
76
+ border: 0 solid transparent;
77
+ border-radius: 50%;
78
+ transition: all 0.3s ease;
79
+ }
80
+
81
+ &::-moz-range-thumb {
82
+ ${resetButton};
83
+ background: ${({ theme }) => theme.colors.primary};
84
+ border: 0 solid transparent;
85
+ border-radius: 50%;
86
+ transition: all 0.3s ease;
87
+ }
88
+
89
+ @media (hover: hover) {
90
+ &:hover:not([disabled]) {
91
+ &::-webkit-slider-runnable-track {
92
+ border: solid 2px ${({ theme }) => theme.colors.primary};
93
+ }
94
+
95
+ &::-moz-range-track {
96
+ border: solid 2px ${({ theme }) => theme.colors.primary};
97
+ }
98
+ }
99
+ }
100
+
101
+ &:focus:not([disabled]) {
102
+ &::-webkit-slider-runnable-track {
103
+ border: solid 2px ${({ theme }) => theme.colors.primary};
104
+ box-shadow: 0 0 0 4px ${({ theme }) => theme.colors.primaryLight};
105
+ }
106
+ &::-webkit-slider-thumb {
107
+ box-shadow: 0 0 0 4px ${({ theme }) => theme.colors.primaryLight};
108
+ }
109
+ &::-moz-range-track {
110
+ border: solid 2px ${({ theme }) => theme.colors.primary};
111
+ box-shadow: 0 0 0 4px ${({ theme }) => theme.colors.primaryLight};
112
+ }
113
+ &::-moz-range-thumb {
114
+ box-shadow: 0 0 0 4px ${({ theme }) => theme.colors.primaryLight};
115
+ }
116
+ }
117
+
118
+ &:active:not([disabled]) {
119
+ &::-webkit-slider-runnable-track {
120
+ box-shadow: 0 0 0 2px ${({ theme }) => theme.colors.primaryLight};
121
+ }
122
+ &::-webkit-slider-thumb {
123
+ box-shadow: 0 0 0 2px ${({ theme }) => theme.colors.primaryLight};
124
+ }
125
+ &::-moz-range-track {
126
+ box-shadow: 0 0 0 2px ${({ theme }) => theme.colors.primaryLight};
127
+ }
128
+ &::-moz-range-thumb {
129
+ box-shadow: 0 0 0 2px ${({ theme }) => theme.colors.primaryLight};
130
+ }
131
+ }
132
+
133
+ ${({ disabled, theme }) =>
134
+ disabled &&
135
+ `
136
+ cursor: not-allowed;
137
+
138
+ &::-webkit-slider-runnable-track {
139
+ background: ${theme.colors.grayLight};
140
+ cursor: not-allowed;
141
+ }
142
+
143
+ &::-moz-range-track {
144
+ background: ${theme.colors.grayLight};
145
+ cursor: not-allowed;
146
+ }
147
+
148
+ &::-webkit-slider-thumb {
149
+ background: ${theme.colors.gray};
150
+ cursor: not-allowed;
151
+ }
152
+
153
+ &::-moz-range-thumb {
154
+ background: ${theme.colors.gray};
155
+ cursor: not-allowed;
156
+ }
157
+ `}
158
+
159
+ ${({ $fullWidth }) => fullWidthStyles($fullWidth ? true : false)}
160
+
161
+ ${({ $size }) => {
162
+ if ($size === "big") {
163
+ return `
164
+ height: 32px;
165
+
166
+ &::-webkit-slider-runnable-track {
167
+ height: 14px;
168
+ }
169
+
170
+ &::-moz-range-track {
171
+ height: 10px;
172
+ }
173
+
174
+ &::-webkit-slider-thumb {
175
+ width: 32px;
176
+ height: 32px;
177
+ margin-top: -11px;
178
+ }
179
+
180
+ &::-moz-range-thumb {
181
+ width: 32px;
182
+ height: 32px;
183
+ }
184
+ `;
185
+ } else {
186
+ return `
187
+ height: 22px;
188
+
189
+ &::-webkit-slider-runnable-track {
190
+ height: 10px;
191
+ }
192
+
193
+ &::-moz-range-track {
194
+ height: 6px;
195
+ }
196
+
197
+ &::-webkit-slider-thumb {
198
+ width: 22px;
199
+ height: 22px;
200
+ margin-top: -8px;
201
+ }
202
+
203
+ &::-moz-range-thumb {
204
+ width: 22px;
205
+ height: 22px;
206
+ }
207
+ `;
208
+ }
209
+ }}
210
+ `;
211
+
212
+ function Range({ ...props }: InputProps) {
213
+ return (
214
+ <StyledInputWrapper $fullWidth={props.$fullWidth}>
215
+ {props.$label && (
216
+ <StyledLabel htmlFor={props.id}>{props.$label}</StyledLabel>
217
+ )}
218
+ <StyledInput {...props} type="range" />
219
+ </StyledInputWrapper>
220
+ );
221
+ }
222
+
223
+ export { Range };