cherry-styled-components 0.2.2 → 0.2.3

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/modal.d.ts CHANGED
@@ -6,10 +6,14 @@ export interface ModalProps {
6
6
  $title?: string;
7
7
  $width?: number;
8
8
  $hideCloseButton?: boolean;
9
- /** Enables restyling via styled(Modal); applied to the overlay root. The
10
- inner parts expose class hooks: .modal-inner, .modal-close, .modal-title,
11
- .modal-content. */
9
+ /** Escape hatches for app-level restyling, both applied to the overlay
10
+ root. Note that wrapping with styled(Modal) does NOT work for the $-props
11
+ API (styled-components strips transient props before they reach the
12
+ wrapped component), so restyle by targeting a passed class instead. The
13
+ inner parts expose stable class hooks: .modal-inner, .modal-close,
14
+ .modal-title, .modal-content. */
12
15
  className?: string;
16
+ style?: React.CSSProperties;
13
17
  }
14
- declare function Modal({ children, $isOpen, $onClose, $title, $width, $hideCloseButton, className, }: ModalProps): React.ReactPortal | null;
18
+ declare function Modal({ children, $isOpen, $onClose, $title, $width, $hideCloseButton, className, style, }: ModalProps): React.ReactPortal | null;
15
19
  export { Modal };
package/dist/modal.js CHANGED
@@ -21,7 +21,7 @@ var innerRiseIn = keyframes([`from{transform:translateY(40px);}to{transform:tran
21
21
  var innerSinkOut = keyframes([`from{transform:translateY(0);}to{transform:translateY(40px);}`]);
22
22
  var StyledModal = styled.div.withConfig({
23
23
  displayName: "modal__StyledModal",
24
- componentId: "sc-e8a3a913-0"
24
+ componentId: "sc-14a8d5c-0"
25
25
  })([
26
26
  `position:fixed;top:0;left:0;width:100%;height:100%;background:`,
27
27
  `;display:flex;justify-content:center;align-items:center;z-index:1010;animation:`,
@@ -35,11 +35,11 @@ var StyledModal = styled.div.withConfig({
35
35
  ], ({ theme }) => rgba(theme.colors.primary, .5), ({ $isClosing }) => $isClosing ? overlayFadeOut : overlayFadeIn, ({ $isClosing }) => $isClosing && css([`pointer-events:none;`]), ({ theme }) => theme.colors.light, ({ theme }) => theme.spacing.radius.lg, ({ $isClosing }) => $isClosing ? innerSinkOut : innerRiseIn, mq("lg"), ({ $width }) => $width && css([`max-width:`, `px;`], $width));
36
36
  var StyledModalClose = styled(IconButton).withConfig({
37
37
  displayName: "modal__StyledModalClose",
38
- componentId: "sc-e8a3a913-1"
38
+ componentId: "sc-14a8d5c-1"
39
39
  })([`position:absolute;top:20px;right:20px;z-index:10;`]);
40
40
  var StyledModalTitle = styled.h2.withConfig({
41
41
  displayName: "modal__StyledModalTitle",
42
- componentId: "sc-e8a3a913-2"
42
+ componentId: "sc-14a8d5c-2"
43
43
  })([
44
44
  `--divider-color:`,
45
45
  `;margin:0 0 15px 0;padding:0 0 15px 0;color:`,
@@ -48,13 +48,13 @@ var StyledModalTitle = styled.h2.withConfig({
48
48
  ], ({ theme }) => theme.colors.grayLight, ({ theme }) => theme.colors.dark, ({ theme }) => styledH5(theme));
49
49
  var StyledModalContent = styled.div.withConfig({
50
50
  displayName: "modal__StyledModalContent",
51
- componentId: "sc-e8a3a913-3"
51
+ componentId: "sc-14a8d5c-3"
52
52
  })([
53
53
  `max-height:calc(100svh - 200px);overflow-y:auto;padding:5px;margin:-5px;--divider-color:`,
54
54
  `;`,
55
55
  `;& hr{margin:20px 0;border:none;border-bottom:solid 1px var(--divider-color);}`
56
56
  ], ({ theme }) => theme.colors.grayLight, ({ theme }) => styledText(theme));
57
- function Modal({ children, $isOpen, $onClose, $title, $width, $hideCloseButton, className }) {
57
+ function Modal({ children, $isOpen, $onClose, $title, $width, $hideCloseButton, className, style }) {
58
58
  const wrapperRef = useRef(null);
59
59
  const elmRef = useRef(null);
60
60
  const isClient = useIsClient();
@@ -85,6 +85,7 @@ function Modal({ children, $isOpen, $onClose, $title, $width, $hideCloseButton,
85
85
  $isClosing: isClosing,
86
86
  $width,
87
87
  className,
88
+ style,
88
89
  onAnimationEnd: handleAnimationEnd,
89
90
  children: /*#__PURE__*/ jsxs("div", {
90
91
  className: "modal-inner",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cherry-styled-components",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
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",