cherry-styled-components 0.1.17 → 0.1.19
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/accordion.d.ts +11 -0
- package/dist/accordion.js +88 -0
- package/dist/avatar-dropzone.d.ts +19 -0
- package/dist/avatar-dropzone.js +157 -0
- package/dist/box.js +2 -2
- package/dist/button.js +3 -3
- package/dist/col.js +2 -2
- package/dist/container.js +2 -2
- package/dist/dropzone.d.ts +35 -0
- package/dist/dropzone.js +255 -0
- package/dist/flex.d.ts +53 -0
- package/dist/flex.js +28 -5
- package/dist/grid.js +2 -2
- package/dist/icon-button.d.ts +11 -0
- package/dist/icon-button.js +72 -0
- package/dist/icon.js +1 -1
- package/dist/{src/lib/index.d.ts → index.d.ts} +7 -0
- package/dist/index.js +11 -3
- package/dist/{src/lib/input.d.ts → input.d.ts} +1 -1
- package/dist/input.js +15 -15
- package/dist/max-width.js +2 -2
- package/dist/modal.d.ts +10 -0
- package/dist/modal.js +96 -0
- package/dist/password.d.ts +5 -0
- package/dist/password.js +75 -0
- package/dist/range.js +4 -4
- package/dist/select.js +6 -6
- package/dist/space.js +2 -2
- package/dist/styled-components/registry.js +2 -2
- package/dist/styled-components/theme-provider.js +4 -4
- package/dist/textarea.js +4 -4
- package/dist/toast.d.ts +40 -0
- package/dist/toast.js +115 -0
- package/dist/toggle.js +5 -5
- package/dist/utils/icons.js +15 -15
- package/dist/{src/lib/utils → utils}/index.d.ts +1 -0
- package/dist/{src/lib/utils → utils}/mixins.d.ts +3 -0
- package/dist/utils/mixins.js +16 -1
- package/dist/utils/use-on-click-outside.d.ts +2 -0
- package/dist/utils/use-on-click-outside.js +17 -0
- package/package.json +16 -16
- package/dist/src/lib/flex.d.ts +0 -27
- /package/dist/{src/lib/box.d.ts → box.d.ts} +0 -0
- /package/dist/{src/lib/button.d.ts → button.d.ts} +0 -0
- /package/dist/{src/lib/col.d.ts → col.d.ts} +0 -0
- /package/dist/{src/lib/container.d.ts → container.d.ts} +0 -0
- /package/dist/{src/lib/grid.d.ts → grid.d.ts} +0 -0
- /package/dist/{src/lib/icon.d.ts → icon.d.ts} +0 -0
- /package/dist/{src/lib/max-width.d.ts → max-width.d.ts} +0 -0
- /package/dist/{src/lib/range.d.ts → range.d.ts} +0 -0
- /package/dist/{src/lib/select.d.ts → select.d.ts} +0 -0
- /package/dist/{src/lib/space.d.ts → space.d.ts} +0 -0
- /package/dist/{src/lib/styled-components → styled-components}/index.d.ts +0 -0
- /package/dist/{src/lib/styled-components → styled-components}/registry.d.ts +0 -0
- /package/dist/{src/lib/styled-components → styled-components}/theme-provider.d.ts +0 -0
- /package/dist/{src/lib/textarea.d.ts → textarea.d.ts} +0 -0
- /package/dist/{src/lib/toggle.d.ts → toggle.d.ts} +0 -0
- /package/dist/{src/lib/utils → utils}/global.d.ts +0 -0
- /package/dist/{src/lib/utils → utils}/icons.d.ts +0 -0
- /package/dist/{src/lib/utils → utils}/theme.d.ts +0 -0
- /package/dist/{src/lib/utils → utils}/typography.d.ts +0 -0
package/dist/select.js
CHANGED
|
@@ -41,24 +41,24 @@ var StyledIconWrapper = styled.span.withConfig({
|
|
|
41
41
|
componentId: "sc-b63bf03d-1"
|
|
42
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));
|
|
43
43
|
function LocalSelect({ ...props }, ref) {
|
|
44
|
-
return
|
|
44
|
+
return /*#__PURE__*/ jsxs(StyledInputWrapper, {
|
|
45
45
|
$fullWidth: props.$fullWidth,
|
|
46
46
|
$label: props.$label,
|
|
47
47
|
className: props.$wrapperClassName,
|
|
48
|
-
children: [props.$label &&
|
|
48
|
+
children: [props.$label && /*#__PURE__*/ jsx(StyledLabel, {
|
|
49
49
|
htmlFor: props.id,
|
|
50
50
|
children: props.$label
|
|
51
|
-
}),
|
|
51
|
+
}), /*#__PURE__*/ jsxs(StyledIconWrapper, {
|
|
52
52
|
$fullWidth: props.$fullWidth,
|
|
53
|
-
children: [
|
|
53
|
+
children: [/*#__PURE__*/ jsx(StyledSelect, {
|
|
54
54
|
...props,
|
|
55
55
|
"aria-invalid": props.$error || void 0,
|
|
56
56
|
ref,
|
|
57
57
|
children: props.children
|
|
58
|
-
}),
|
|
58
|
+
}), /*#__PURE__*/ jsx(IconArrow, { "aria-hidden": "true" })]
|
|
59
59
|
})]
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
|
-
var Select =
|
|
62
|
+
var Select = /*#__PURE__*/ forwardRef(LocalSelect);
|
|
63
63
|
//#endregion
|
|
64
64
|
export { Select, StyledIconWrapper };
|
package/dist/space.js
CHANGED
|
@@ -41,11 +41,11 @@ var StyledSpace = styled.span.withConfig({
|
|
|
41
41
|
``
|
|
42
42
|
], ({ $horizontal, $size }) => $size ? styles($size, $horizontal || false) : "", (props) => responsiveStyles(props));
|
|
43
43
|
function LocalSpace({ ...props }, ref) {
|
|
44
|
-
return
|
|
44
|
+
return /*#__PURE__*/ jsx(StyledSpace, {
|
|
45
45
|
...props,
|
|
46
46
|
ref
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
|
-
var Space =
|
|
49
|
+
var Space = /*#__PURE__*/ forwardRef(LocalSpace);
|
|
50
50
|
//#endregion
|
|
51
51
|
export { Space };
|
|
@@ -11,9 +11,9 @@ function StyledComponentsRegistry({ children }) {
|
|
|
11
11
|
useServerInsertedHTML(() => {
|
|
12
12
|
const styles = styledComponentsStyleSheet.getStyleElement();
|
|
13
13
|
styledComponentsStyleSheet.instance.clearTag();
|
|
14
|
-
return
|
|
14
|
+
return /*#__PURE__*/ jsx(Fragment, { children: styles });
|
|
15
15
|
});
|
|
16
|
-
return
|
|
16
|
+
return /*#__PURE__*/ jsx(StyleSheetManager, {
|
|
17
17
|
sheet: isServer ? styledComponentsStyleSheet.instance : void 0,
|
|
18
18
|
enableVendorPrefixes: true,
|
|
19
19
|
children
|
|
@@ -5,7 +5,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
5
5
|
import { createContext, useEffect, useState } from "react";
|
|
6
6
|
import { ThemeProvider } from "styled-components";
|
|
7
7
|
//#region src/lib/styled-components/theme-provider.tsx
|
|
8
|
-
var ThemeContext =
|
|
8
|
+
var ThemeContext = /*#__PURE__*/ createContext({ setTheme: () => {} });
|
|
9
9
|
function CherryThemeProvider({ children, theme, themeDark }) {
|
|
10
10
|
const [currentTheme, setTheme] = useState(theme);
|
|
11
11
|
useEffect(() => {
|
|
@@ -19,11 +19,11 @@ function CherryThemeProvider({ children, theme, themeDark }) {
|
|
|
19
19
|
}
|
|
20
20
|
}, [theme, themeDark]);
|
|
21
21
|
const GlobalStylesComponent = GlobalStyles(currentTheme);
|
|
22
|
-
return
|
|
22
|
+
return /*#__PURE__*/ jsx(ThemeProvider, {
|
|
23
23
|
theme: currentTheme,
|
|
24
|
-
children:
|
|
24
|
+
children: /*#__PURE__*/ jsxs(ThemeContext.Provider, {
|
|
25
25
|
value: { setTheme },
|
|
26
|
-
children: [
|
|
26
|
+
children: [/*#__PURE__*/ jsx(GlobalStylesComponent, {}), children]
|
|
27
27
|
})
|
|
28
28
|
});
|
|
29
29
|
}
|
package/dist/textarea.js
CHANGED
|
@@ -41,15 +41,15 @@ var StyledTextarea = styled.textarea.withConfig({
|
|
|
41
41
|
color: ${theme.colors.gray};
|
|
42
42
|
`, ({ $fullWidth }) => fullWidthStyles($fullWidth));
|
|
43
43
|
function LocalTextarea({ ...props }, ref) {
|
|
44
|
-
return
|
|
44
|
+
return /*#__PURE__*/ jsxs(StyledInputWrapper, {
|
|
45
45
|
$fullWidth: props.$fullWidth,
|
|
46
46
|
$label: props.$label,
|
|
47
47
|
className: props.$wrapperClassName,
|
|
48
|
-
children: [props.$label &&
|
|
48
|
+
children: [props.$label && /*#__PURE__*/ jsx(StyledLabel, {
|
|
49
49
|
htmlFor: props.id,
|
|
50
50
|
$label: props.$label,
|
|
51
51
|
children: props.$label
|
|
52
|
-
}),
|
|
52
|
+
}), /*#__PURE__*/ jsx(StyledTextarea, {
|
|
53
53
|
...props,
|
|
54
54
|
"aria-invalid": props.$error || void 0,
|
|
55
55
|
ref,
|
|
@@ -57,6 +57,6 @@ function LocalTextarea({ ...props }, ref) {
|
|
|
57
57
|
})]
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
|
-
var Textarea =
|
|
60
|
+
var Textarea = /*#__PURE__*/ forwardRef(LocalTextarea);
|
|
61
61
|
//#endregion
|
|
62
62
|
export { Textarea };
|
package/dist/toast.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Theme } from './utils';
|
|
3
|
+
export type ToastColor = "info" | "success" | "error" | "warning";
|
|
4
|
+
export interface ToastConfig {
|
|
5
|
+
color?: ToastColor;
|
|
6
|
+
autoHide?: number;
|
|
7
|
+
}
|
|
8
|
+
type Toast = {
|
|
9
|
+
text: string;
|
|
10
|
+
status: "hidden" | "visible";
|
|
11
|
+
color: ToastColor;
|
|
12
|
+
autoHide: number;
|
|
13
|
+
};
|
|
14
|
+
declare const ToastNotificationsContext: React.Context<{
|
|
15
|
+
notifications: Toast[];
|
|
16
|
+
addNotification: (text: string, config?: ToastConfig) => void;
|
|
17
|
+
}>;
|
|
18
|
+
declare function useToastNotifications(): {
|
|
19
|
+
notifications: Toast[];
|
|
20
|
+
addNotification: (text: string, config?: ToastConfig) => void;
|
|
21
|
+
};
|
|
22
|
+
interface ToastNotificationsProviderProps {
|
|
23
|
+
children: React.ReactNode;
|
|
24
|
+
}
|
|
25
|
+
declare function ToastNotificationsProvider({ children, }: ToastNotificationsProviderProps): React.JSX.Element;
|
|
26
|
+
export declare const StyledNotifications: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('styled-components').FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "theme" | "$align" | "$bottom"> & {
|
|
27
|
+
theme: Theme;
|
|
28
|
+
$align?: "center" | "left" | "right";
|
|
29
|
+
$bottom?: boolean;
|
|
30
|
+
}, never> & Partial<Pick<import('styled-components').FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "theme" | "$align" | "$bottom"> & {
|
|
31
|
+
theme: Theme;
|
|
32
|
+
$align?: "center" | "left" | "right";
|
|
33
|
+
$bottom?: boolean;
|
|
34
|
+
}, never>>> & string;
|
|
35
|
+
export interface ToastNotificationsProps {
|
|
36
|
+
$align?: "center" | "left" | "right";
|
|
37
|
+
$bottom?: boolean;
|
|
38
|
+
}
|
|
39
|
+
declare function ToastNotifications({ $align, $bottom, }: ToastNotificationsProps): React.JSX.Element;
|
|
40
|
+
export { ToastNotifications, ToastNotificationsContext, ToastNotificationsProvider, useToastNotifications, };
|
package/dist/toast.js
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import { Icon } from "./icon.js";
|
|
4
|
+
import { IconButton } from "./icon-button.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { createContext, useContext, useEffect, useState } from "react";
|
|
7
|
+
import styled, { css } from "styled-components";
|
|
8
|
+
//#region src/lib/toast.tsx
|
|
9
|
+
var statusIcons = {
|
|
10
|
+
success: "CircleCheck",
|
|
11
|
+
error: "CircleX",
|
|
12
|
+
warning: "TriangleAlert",
|
|
13
|
+
info: "Info"
|
|
14
|
+
};
|
|
15
|
+
var ToastNotificationsContext = /*#__PURE__*/ createContext({
|
|
16
|
+
notifications: [],
|
|
17
|
+
addNotification: () => null
|
|
18
|
+
});
|
|
19
|
+
function useToastNotifications() {
|
|
20
|
+
return useContext(ToastNotificationsContext);
|
|
21
|
+
}
|
|
22
|
+
function ToastNotificationsProvider({ children }) {
|
|
23
|
+
const [notifications, setNotifications] = useState([]);
|
|
24
|
+
const addNotification = (text, config) => {
|
|
25
|
+
setNotifications((prev) => [...prev, {
|
|
26
|
+
text,
|
|
27
|
+
status: "hidden",
|
|
28
|
+
color: config?.color || "info",
|
|
29
|
+
autoHide: config?.autoHide || 0
|
|
30
|
+
}]);
|
|
31
|
+
setTimeout(() => {
|
|
32
|
+
setNotifications((prev) => prev.map((toast) => toast.status === "hidden" ? {
|
|
33
|
+
...toast,
|
|
34
|
+
status: "visible"
|
|
35
|
+
} : toast));
|
|
36
|
+
}, 50);
|
|
37
|
+
};
|
|
38
|
+
return /*#__PURE__*/ jsx(ToastNotificationsContext.Provider, {
|
|
39
|
+
value: {
|
|
40
|
+
notifications,
|
|
41
|
+
addNotification
|
|
42
|
+
},
|
|
43
|
+
children
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
var StyledNotifications = styled.ul.withConfig({
|
|
47
|
+
displayName: "toast__StyledNotifications",
|
|
48
|
+
componentId: "sc-1dfe4a8-0"
|
|
49
|
+
})([
|
|
50
|
+
`position:fixed;z-index:99999;margin:0;padding:0;list-style:none;`,
|
|
51
|
+
` `,
|
|
52
|
+
` `,
|
|
53
|
+
` `,
|
|
54
|
+
` & li{justify-content:center;display:flex;margin:0;opacity:0;pointer-events:none;transform:translateY(-20px);padding:0;max-height:0;transition:opacity 0.2s ease,transform 0.2s ease,max-height 0.25s ease 0.15s,margin 0.25s ease 0.15s;`,
|
|
55
|
+
` `,
|
|
56
|
+
` & .item{display:inline-flex;align-items:center;gap:10px;max-width:min(420px,calc(100vw - 40px));padding:10px 10px 10px 18px;margin:0;border-radius:`,
|
|
57
|
+
`;background:`,
|
|
58
|
+
`;border:solid 1px `,
|
|
59
|
+
`;box-shadow:`,
|
|
60
|
+
`;color:`,
|
|
61
|
+
`;font-size:`,
|
|
62
|
+
`;line-height:`,
|
|
63
|
+
`;font-weight:500;& .status-icon{display:inline-flex;flex-shrink:0;& svg{width:20px;height:20px;color:`,
|
|
64
|
+
`;}}& .message{flex:1;min-width:0;line-height:1.5;overflow-wrap:anywhere;}& .close-button{flex-shrink:0;}}&.error{& .item .status-icon svg{color:`,
|
|
65
|
+
`;}}&.success{& .item .status-icon svg{color:`,
|
|
66
|
+
`;}}&.warning{& .item .status-icon svg{color:`,
|
|
67
|
+
`;}}&.info{& .item .status-icon svg{color:`,
|
|
68
|
+
`;}}&.visible{opacity:1;pointer-events:all;transform:translateY(0);max-height:320px;transition:max-height 0.25s ease,margin 0.25s ease,opacity 0.2s ease 0.15s,transform 0.2s ease 0.15s;`,
|
|
69
|
+
`}&.static{position:relative;z-index:10;}}`
|
|
70
|
+
], ({ $align }) => $align === "center" && css([`left:50%;transform:translateX(-50%);`]), ({ $align }) => $align === "right" && css([`right:20px;`]), ({ $align }) => $align === "left" && css([`left:20px;`]), ({ $bottom }) => $bottom ? css([`bottom:20px;`]) : css([`top:20px;`]), ({ $align }) => $align === "right" && css([`justify-content:flex-end;`]), ({ $align }) => $align === "left" && css([`justify-content:flex-start;`]), ({ theme }) => theme.spacing.radius.xl, ({ theme }) => theme.colors.light, ({ theme }) => theme.colors.grayLight, ({ theme }) => theme.isDark ? theme.shadows.sm : theme.shadows.xs, ({ theme }) => theme.colors.dark, ({ theme }) => theme.fontSizes.small.lg, ({ theme }) => theme.lineHeights.small.lg, ({ theme }) => theme.colors.info, ({ theme }) => theme.colors.error, ({ theme }) => theme.colors.success, ({ theme }) => theme.colors.warning, ({ theme }) => theme.colors.info, ({ $bottom }) => $bottom ? css([`margin-top:10px;`]) : css([`margin-bottom:10px;`]));
|
|
71
|
+
function ToastNotifications({ $align = "center", $bottom }) {
|
|
72
|
+
const { notifications } = useToastNotifications();
|
|
73
|
+
return /*#__PURE__*/ jsx(StyledNotifications, {
|
|
74
|
+
$align,
|
|
75
|
+
$bottom,
|
|
76
|
+
children: notifications.map((notification, i) => /*#__PURE__*/ jsx(NotificationItem, { ...notification }, i))
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
function NotificationItem(notification) {
|
|
80
|
+
const [visible, setVisible] = useState(true);
|
|
81
|
+
useEffect(() => {
|
|
82
|
+
if (!notification.autoHide) return;
|
|
83
|
+
const timeout = setTimeout(() => setVisible(false), notification.autoHide);
|
|
84
|
+
return () => clearTimeout(timeout);
|
|
85
|
+
}, [notification.autoHide]);
|
|
86
|
+
return /*#__PURE__*/ jsx("li", {
|
|
87
|
+
className: [
|
|
88
|
+
visible ? notification.status : "hidden",
|
|
89
|
+
notification.color,
|
|
90
|
+
!notification.autoHide && "static"
|
|
91
|
+
].filter(Boolean).join(" "),
|
|
92
|
+
children: /*#__PURE__*/ jsxs("span", {
|
|
93
|
+
className: "item",
|
|
94
|
+
children: [
|
|
95
|
+
/*#__PURE__*/ jsx("span", {
|
|
96
|
+
className: "status-icon",
|
|
97
|
+
children: /*#__PURE__*/ jsx(Icon, { name: statusIcons[notification.color] || statusIcons.info })
|
|
98
|
+
}),
|
|
99
|
+
/*#__PURE__*/ jsx("span", {
|
|
100
|
+
className: "message",
|
|
101
|
+
children: notification.text
|
|
102
|
+
}),
|
|
103
|
+
/*#__PURE__*/ jsx(IconButton, {
|
|
104
|
+
$size: "small",
|
|
105
|
+
className: "close-button",
|
|
106
|
+
"aria-label": "Dismiss notification",
|
|
107
|
+
onClick: () => setVisible(false),
|
|
108
|
+
children: /*#__PURE__*/ jsx(Icon, { name: "X" })
|
|
109
|
+
})
|
|
110
|
+
]
|
|
111
|
+
})
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
//#endregion
|
|
115
|
+
export { StyledNotifications, ToastNotifications, ToastNotificationsContext, ToastNotificationsProvider, useToastNotifications };
|
package/dist/toggle.js
CHANGED
|
@@ -57,26 +57,26 @@ var StyledToggle = styled.input.withConfig({
|
|
|
57
57
|
}
|
|
58
58
|
}`);
|
|
59
59
|
function LocalToggle({ type = "checkbox", ...props }, ref) {
|
|
60
|
-
return
|
|
60
|
+
return /*#__PURE__*/ jsxs(StyledInputWrapper, {
|
|
61
61
|
$fullWidth: props.$fullWidth,
|
|
62
62
|
$label: props.$label,
|
|
63
63
|
className: props.$wrapperClassName,
|
|
64
|
-
children: [
|
|
64
|
+
children: [/*#__PURE__*/ jsxs(StyledToggleWrapper, { children: [/*#__PURE__*/ jsx(StyledToggle, {
|
|
65
65
|
...props,
|
|
66
66
|
type,
|
|
67
67
|
role: "switch",
|
|
68
68
|
ref
|
|
69
|
-
}),
|
|
69
|
+
}), /*#__PURE__*/ jsx(StyledFakeToggle, {
|
|
70
70
|
$error: props.$error,
|
|
71
71
|
$success: props.$success,
|
|
72
72
|
className: "fake-toggle",
|
|
73
73
|
$size: props.$size
|
|
74
|
-
})] }), props.$label &&
|
|
74
|
+
})] }), props.$label && /*#__PURE__*/ jsx(StyledLabel, {
|
|
75
75
|
htmlFor: props.id,
|
|
76
76
|
children: props.$label
|
|
77
77
|
})]
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
|
-
var Toggle =
|
|
80
|
+
var Toggle = /*#__PURE__*/ forwardRef(LocalToggle);
|
|
81
81
|
//#endregion
|
|
82
82
|
export { Toggle };
|
package/dist/utils/icons.js
CHANGED
|
@@ -5,14 +5,14 @@ import { useTheme } from "styled-components";
|
|
|
5
5
|
//#region src/lib/utils/icons.tsx
|
|
6
6
|
function IconCheck({ ...props }) {
|
|
7
7
|
const theme = useTheme();
|
|
8
|
-
return
|
|
8
|
+
return /*#__PURE__*/ jsx("svg", {
|
|
9
9
|
width: "12",
|
|
10
10
|
height: "10",
|
|
11
11
|
viewBox: "0 0 12 10",
|
|
12
12
|
fill: "none",
|
|
13
13
|
xmlns: "http://www.w3.org/2000/svg",
|
|
14
14
|
...props,
|
|
15
|
-
children:
|
|
15
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
16
16
|
d: "M10 2L4.4 8L2 5.75",
|
|
17
17
|
stroke: theme.colors.primary,
|
|
18
18
|
strokeWidth: "3",
|
|
@@ -23,14 +23,14 @@ function IconCheck({ ...props }) {
|
|
|
23
23
|
}
|
|
24
24
|
function IconArrow({ ...props }) {
|
|
25
25
|
const theme = useTheme();
|
|
26
|
-
return
|
|
26
|
+
return /*#__PURE__*/ jsx("svg", {
|
|
27
27
|
width: "16",
|
|
28
28
|
height: "10",
|
|
29
29
|
viewBox: "0 0 16 10",
|
|
30
30
|
fill: "none",
|
|
31
31
|
xmlns: "http://www.w3.org/2000/svg",
|
|
32
32
|
...props,
|
|
33
|
-
children:
|
|
33
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
34
34
|
d: "M2 2L8 8L14 2",
|
|
35
35
|
stroke: theme.colors.primary,
|
|
36
36
|
strokeWidth: "3",
|
|
@@ -40,7 +40,7 @@ function IconArrow({ ...props }) {
|
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
function IconCalendar({ ...props }) {
|
|
43
|
-
return
|
|
43
|
+
return /*#__PURE__*/ jsxs("svg", {
|
|
44
44
|
xmlns: "http://www.w3.org/2000/svg",
|
|
45
45
|
width: "24",
|
|
46
46
|
height: "24",
|
|
@@ -52,22 +52,22 @@ function IconCalendar({ ...props }) {
|
|
|
52
52
|
strokeLinejoin: "round",
|
|
53
53
|
...props,
|
|
54
54
|
children: [
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
/*#__PURE__*/ jsx("path", { d: "M8 2v4" }),
|
|
56
|
+
/*#__PURE__*/ jsx("path", { d: "M16 2v4" }),
|
|
57
|
+
/*#__PURE__*/ jsx("rect", {
|
|
58
58
|
width: "18",
|
|
59
59
|
height: "18",
|
|
60
60
|
x: "3",
|
|
61
61
|
y: "4",
|
|
62
62
|
rx: "2"
|
|
63
63
|
}),
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
64
|
+
/*#__PURE__*/ jsx("path", { d: "M3 10h18" }),
|
|
65
|
+
/*#__PURE__*/ jsx("path", { d: "M8 14h.01" }),
|
|
66
|
+
/*#__PURE__*/ jsx("path", { d: "M12 14h.01" }),
|
|
67
|
+
/*#__PURE__*/ jsx("path", { d: "M16 14h.01" }),
|
|
68
|
+
/*#__PURE__*/ jsx("path", { d: "M8 18h.01" }),
|
|
69
|
+
/*#__PURE__*/ jsx("path", { d: "M12 18h.01" }),
|
|
70
|
+
/*#__PURE__*/ jsx("path", { d: "M16 18h.01" })
|
|
71
71
|
]
|
|
72
72
|
});
|
|
73
73
|
}
|
|
@@ -9,3 +9,6 @@ export declare const generateColsStyles: (size: keyof Breakpoints<number>, cols:
|
|
|
9
9
|
export declare const generateColSpanStyles: (size: keyof Breakpoints<number>, span: number) => import('styled-components').RuleSet<object>;
|
|
10
10
|
export declare const generatePaddingStyles: (size: keyof Breakpoints<number>, padding: number | "none") => import('styled-components').RuleSet<object>;
|
|
11
11
|
export declare const generateJustifyContentStyles: (size: keyof Breakpoints<number>, justifyContent?: "center" | "flex-start" | "flex-end" | "space-between" | "space-around" | "space-evenly") => import('styled-components').RuleSet<object>;
|
|
12
|
+
export declare const generateAlignItemsStyles: (size: keyof Breakpoints<number>, alignItems?: "stretch" | "center" | "flex-start" | "flex-end" | "baseline") => import('styled-components').RuleSet<object>;
|
|
13
|
+
export declare const generateAlignContentStyles: (size: keyof Breakpoints<number>, alignContent?: "stretch" | "center" | "flex-start" | "flex-end" | "space-between" | "space-around" | "space-evenly") => import('styled-components').RuleSet<object>;
|
|
14
|
+
export declare const generateDirectionStyles: (size: keyof Breakpoints<number>, direction?: "row" | "column" | "row-reverse" | "column-reverse") => import('styled-components').RuleSet<object>;
|
package/dist/utils/mixins.js
CHANGED
|
@@ -42,5 +42,20 @@ var generateJustifyContentStyles = (size, justifyContent) => css([
|
|
|
42
42
|
`{justify-content:`,
|
|
43
43
|
`;}`
|
|
44
44
|
], mq(size), justifyContent && `${justifyContent}`);
|
|
45
|
+
var generateAlignItemsStyles = (size, alignItems) => css([
|
|
46
|
+
``,
|
|
47
|
+
`{align-items:`,
|
|
48
|
+
`;}`
|
|
49
|
+
], mq(size), alignItems && `${alignItems}`);
|
|
50
|
+
var generateAlignContentStyles = (size, alignContent) => css([
|
|
51
|
+
``,
|
|
52
|
+
`{align-content:`,
|
|
53
|
+
`;}`
|
|
54
|
+
], mq(size), alignContent && `${alignContent}`);
|
|
55
|
+
var generateDirectionStyles = (size, direction) => css([
|
|
56
|
+
``,
|
|
57
|
+
`{flex-direction:`,
|
|
58
|
+
`;}`
|
|
59
|
+
], mq(size), direction && `${direction}`);
|
|
45
60
|
//#endregion
|
|
46
|
-
export { formElementHeightStyles, fullWidthStyles, generateColSpanStyles, generateColsStyles, generateGapStyles, generateJustifyContentStyles, generatePaddingStyles, resetButton, resetInput, statusBorderStyles };
|
|
61
|
+
export { formElementHeightStyles, fullWidthStyles, generateAlignContentStyles, generateAlignItemsStyles, generateColSpanStyles, generateColsStyles, generateDirectionStyles, generateGapStyles, generateJustifyContentStyles, generatePaddingStyles, resetButton, resetInput, statusBorderStyles };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import { useEffect } from "react";
|
|
4
|
+
//#region src/lib/utils/use-on-click-outside.tsx
|
|
5
|
+
function useOnClickOutside(refs, cb) {
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
function handleClickOutside(event) {
|
|
8
|
+
if (refs && refs.map((ref) => ref && ref.current && ref.current.contains(event.target)).every((i) => i === false)) cb();
|
|
9
|
+
}
|
|
10
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
11
|
+
return () => {
|
|
12
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
13
|
+
};
|
|
14
|
+
}, [refs, cb]);
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { useOnClickOutside };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cherry-styled-components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.19",
|
|
4
4
|
"description": "Cherry is a design system for the modern web. Designed in Figma, built in React using Typescript.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"format": "prettier --write ."
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"lucide-react": "^1.
|
|
44
|
+
"lucide-react": "^1.23.0",
|
|
45
45
|
"polished": "^4.3.1"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
@@ -50,21 +50,21 @@
|
|
|
50
50
|
"styled-components": "^6.0.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@swc/plugin-styled-components": "^12.
|
|
54
|
-
"@types/node": "^
|
|
55
|
-
"@types/react": "^19.2.
|
|
53
|
+
"@swc/plugin-styled-components": "^12.14.1",
|
|
54
|
+
"@types/node": "^26.1.0",
|
|
55
|
+
"@types/react": "^19.2.17",
|
|
56
56
|
"@types/react-dom": "^19.2.3",
|
|
57
|
-
"@vitejs/plugin-react-swc": "^4.3.
|
|
58
|
-
"eslint-plugin-react-hooks": "^7.
|
|
59
|
-
"eslint-plugin-react-refresh": "^0.5.
|
|
60
|
-
"next": "^16.2.
|
|
61
|
-
"prettier": "^3.
|
|
62
|
-
"react": "^19.2.
|
|
63
|
-
"react-dom": "^19.2.
|
|
57
|
+
"@vitejs/plugin-react-swc": "^4.3.1",
|
|
58
|
+
"eslint-plugin-react-hooks": "^7.1.1",
|
|
59
|
+
"eslint-plugin-react-refresh": "^0.5.3",
|
|
60
|
+
"next": "^16.2.10",
|
|
61
|
+
"prettier": "^3.9.4",
|
|
62
|
+
"react": "^19.2.7",
|
|
63
|
+
"react-dom": "^19.2.7",
|
|
64
64
|
"rollup-plugin-preserve-directives": "^0.4.0",
|
|
65
|
-
"styled-components": "^6.4.
|
|
66
|
-
"typescript": "^6.0.
|
|
67
|
-
"vite": "^8.
|
|
68
|
-
"vite-plugin-dts": "^
|
|
65
|
+
"styled-components": "^6.4.3",
|
|
66
|
+
"typescript": "^6.0.3",
|
|
67
|
+
"vite": "^8.1.3",
|
|
68
|
+
"vite-plugin-dts": "^5.0.3"
|
|
69
69
|
}
|
|
70
70
|
}
|
package/dist/src/lib/flex.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
type JustifyContentType = "center" | "flex-start" | "flex-end" | "space-between" | "space-around" | "space-evenly";
|
|
3
|
-
type GapType = number | "none";
|
|
4
|
-
interface FlexProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
$justifyContent?: JustifyContentType;
|
|
7
|
-
$xsJustifyContent?: JustifyContentType;
|
|
8
|
-
$smJustifyContent?: JustifyContentType;
|
|
9
|
-
$mdJustifyContent?: JustifyContentType;
|
|
10
|
-
$lgJustifyContent?: JustifyContentType;
|
|
11
|
-
$xlJustifyContent?: JustifyContentType;
|
|
12
|
-
$xxlJustifyContent?: JustifyContentType;
|
|
13
|
-
$xxxlJustifyContent?: JustifyContentType;
|
|
14
|
-
$wrap?: "wrap" | "nowrap" | "wrap-reverse";
|
|
15
|
-
$gap?: GapType;
|
|
16
|
-
$xsGap?: GapType;
|
|
17
|
-
$smGap?: GapType;
|
|
18
|
-
$mdGap?: GapType;
|
|
19
|
-
$lgGap?: GapType;
|
|
20
|
-
$xlGap?: GapType;
|
|
21
|
-
$xxlGap?: GapType;
|
|
22
|
-
$xxxlGap?: GapType;
|
|
23
|
-
$direction?: "row" | "column" | "row-reverse" | "column-reverse";
|
|
24
|
-
$fullWidth?: boolean;
|
|
25
|
-
}
|
|
26
|
-
declare const Flex: React.ForwardRefExoticComponent<FlexProps & React.RefAttributes<HTMLDivElement>>;
|
|
27
|
-
export { Flex };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|