@chayns-components/swipeable-wrapper 5.0.0-beta.457 → 5.0.0-beta.459

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.
@@ -1,7 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  /// <reference types="react" />
3
3
  export declare const StyledMotionSwipeableWrapper: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<{
4
- color?: string | undefined;
5
4
  title?: string | undefined;
6
5
  slot?: string | undefined;
7
6
  defaultChecked?: boolean | undefined;
@@ -38,6 +37,7 @@ export declare const StyledMotionSwipeableWrapper: import("styled-components").I
38
37
  autoCapitalize?: string | undefined;
39
38
  autoCorrect?: string | undefined;
40
39
  autoSave?: string | undefined;
40
+ color?: string | undefined;
41
41
  itemProp?: string | undefined;
42
42
  itemScope?: boolean | undefined;
43
43
  itemType?: string | undefined;
@@ -80,15 +80,15 @@ const SwipeableAction = _ref => {
80
80
  });
81
81
  }, [actionOverlayOffset, activationThreshold, index, listItemXOffset, position, totalActionCount]);
82
82
  return /*#__PURE__*/React.createElement(StyledMotionSwipeableAction, {
83
- backgroundColor: item.backgroundColor,
84
- position: position,
83
+ $backgroundColor: item.backgroundColor,
84
+ $position: position,
85
85
  style: {
86
86
  x: actionX
87
87
  }
88
88
  }, /*#__PURE__*/React.createElement(StyledSwipeableActionButton, {
89
- color: item.color,
89
+ $color: item.color,
90
90
  onClick: handleButtonClick,
91
- width: `${SWIPEABLE_ACTION_WIDTH}px`
91
+ $width: `${SWIPEABLE_ACTION_WIDTH}px`
92
92
  }, item.icon, item.text));
93
93
  };
94
94
  SwipeableAction.displayName = 'SwipeableAction';
@@ -1 +1 @@
1
- {"version":3,"file":"SwipeableAction.js","names":["useSpring","useTransform","React","useEffect","StyledMotionSwipeableAction","StyledSwipeableActionButton","SWIPEABLE_ACTION_WIDTH","SwipeableAction","_ref","activationThreshold","close","index","item","listItemXOffset","position","totalActionCount","handleButtonClick","action","actionOffset","newValue","maxOffset","fractionalOffset","Math","max","min","actionOverlayOffset","bounce","actionX","_ref2","x","y","isOuterMost","undefined","onChange","lastValue","getPrevious","set","createElement","backgroundColor","style","color","onClick","width","icon","text","displayName"],"sources":["../../../../src/components/swipeable-wrapper/swipeable-action/SwipeableAction.tsx"],"sourcesContent":["import { MotionValue, useSpring, useTransform } from 'framer-motion';\nimport React, { FC, useEffect } from 'react';\nimport type { SwipeableActionItem } from '../SwipeableWrapper';\nimport { StyledMotionSwipeableAction, StyledSwipeableActionButton } from './SwipeableAction.styles';\n\nexport const SWIPEABLE_ACTION_WIDTH = 72;\n\nexport type SwipeableActionProps = {\n activationThreshold: number;\n close: VoidFunction;\n index: number;\n item: SwipeableActionItem;\n listItemXOffset: MotionValue<number>;\n position: 'left' | 'right';\n totalActionCount: number;\n};\n\nconst SwipeableAction: FC<SwipeableActionProps> = ({\n activationThreshold,\n close,\n index,\n item,\n listItemXOffset,\n position,\n totalActionCount,\n}) => {\n const handleButtonClick = () => {\n item.action();\n close();\n };\n\n /**\n * By default, the action sticks to the content of the swipeable item. This\n * makes it move outwards to reveal the inner items.\n */\n const actionOffset = useTransform(listItemXOffset, (newValue) => {\n const maxOffset = SWIPEABLE_ACTION_WIDTH * index;\n const fractionalOffset = (-newValue / totalActionCount) * index;\n\n switch (position) {\n case 'left':\n return Math.max(-maxOffset, fractionalOffset);\n case 'right':\n return Math.min(maxOffset, fractionalOffset);\n default:\n return 0;\n }\n });\n\n /**\n * Brings the item in again if past the threshold. Only relevant for\n * outermost items.\n */\n const actionOverlayOffset = useSpring(0, {\n bounce: 0,\n }) as MotionValue<number>;\n\n /**\n * Combines the two values above to create the correct X transform that has\n * to be applied to the action.\n */\n const actionX = useTransform<number, number>([actionOffset, actionOverlayOffset], ([x, y]) => {\n if (position === 'left') {\n return Math.min((x ?? 0) + (y ?? 0), 0);\n }\n\n return Math.max((x ?? 0) + (y ?? 0), 0);\n });\n\n // Animate to the middle after passing threshold if outermost item\n useEffect(() => {\n const isOuterMost = index === totalActionCount - 1;\n\n if (!isOuterMost) return undefined;\n\n return listItemXOffset.onChange((newValue) => {\n const lastValue = listItemXOffset.getPrevious();\n\n // eslint-disable-next-line default-case\n switch (position) {\n case 'left':\n if (newValue > activationThreshold && lastValue <= activationThreshold) {\n actionOverlayOffset.set(SWIPEABLE_ACTION_WIDTH * index);\n } else if (newValue < activationThreshold && lastValue >= activationThreshold) {\n actionOverlayOffset.set(0);\n }\n break;\n case 'right':\n if (newValue < activationThreshold && lastValue >= activationThreshold) {\n actionOverlayOffset.set(SWIPEABLE_ACTION_WIDTH * -1 * index);\n } else if (newValue > activationThreshold && lastValue <= activationThreshold) {\n actionOverlayOffset.set(0);\n }\n }\n });\n }, [\n actionOverlayOffset,\n activationThreshold,\n index,\n listItemXOffset,\n position,\n totalActionCount,\n ]);\n\n return (\n <StyledMotionSwipeableAction\n backgroundColor={item.backgroundColor}\n position={position}\n style={{ x: actionX }}\n >\n <StyledSwipeableActionButton\n color={item.color}\n onClick={handleButtonClick}\n width={`${SWIPEABLE_ACTION_WIDTH}px`}\n >\n {item.icon}\n {item.text}\n </StyledSwipeableActionButton>\n </StyledMotionSwipeableAction>\n );\n};\n\nSwipeableAction.displayName = 'SwipeableAction';\n\nexport default SwipeableAction;\n"],"mappings":"AAAA,SAAsBA,SAAS,EAAEC,YAAY,QAAQ,eAAe;AACpE,OAAOC,KAAK,IAAQC,SAAS,QAAQ,OAAO;AAE5C,SAASC,2BAA2B,EAAEC,2BAA2B,QAAQ,0BAA0B;AAEnG,OAAO,MAAMC,sBAAsB,GAAG,EAAE;AAYxC,MAAMC,eAAyC,GAAGC,IAAA,IAQ5C;EAAA,IAR6C;IAC/CC,mBAAmB;IACnBC,KAAK;IACLC,KAAK;IACLC,IAAI;IACJC,eAAe;IACfC,QAAQ;IACRC;EACJ,CAAC,GAAAP,IAAA;EACG,MAAMQ,iBAAiB,GAAGA,CAAA,KAAM;IAC5BJ,IAAI,CAACK,MAAM,CAAC,CAAC;IACbP,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EACT/B,IAAI,CAACgC,IACmB,CACJ,CAAC;AAEtC,CAAC;AAEDrC,eAAe,CAACsC,WAAW,GAAG,iBAAiB;AAE/C,eAAetC,eAAe"}
1
+ {"version":3,"file":"SwipeableAction.js","names":["useSpring","useTransform","React","useEffect","StyledMotionSwipeableAction","StyledSwipeableActionButton","SWIPEABLE_ACTION_WIDTH","SwipeableAction","_ref","activationThreshold","close","index","item","listItemXOffset","position","totalActionCount","handleButtonClick","action","actionOffset","newValue","maxOffset","fractionalOffset","Math","max","min","actionOverlayOffset","bounce","actionX","_ref2","x","y","isOuterMost","undefined","onChange","lastValue","getPrevious","set","createElement","$backgroundColor","backgroundColor","$position","style","$color","color","onClick","$width","icon","text","displayName"],"sources":["../../../../src/components/swipeable-wrapper/swipeable-action/SwipeableAction.tsx"],"sourcesContent":["import { MotionValue, useSpring, useTransform } from 'framer-motion';\nimport React, { FC, useEffect } from 'react';\nimport type { SwipeableActionItem } from '../SwipeableWrapper';\nimport { StyledMotionSwipeableAction, StyledSwipeableActionButton } from './SwipeableAction.styles';\n\nexport const SWIPEABLE_ACTION_WIDTH = 72;\n\nexport type SwipeableActionProps = {\n activationThreshold: number;\n close: VoidFunction;\n index: number;\n item: SwipeableActionItem;\n listItemXOffset: MotionValue<number>;\n position: 'left' | 'right';\n totalActionCount: number;\n};\n\nconst SwipeableAction: FC<SwipeableActionProps> = ({\n activationThreshold,\n close,\n index,\n item,\n listItemXOffset,\n position,\n totalActionCount,\n}) => {\n const handleButtonClick = () => {\n item.action();\n close();\n };\n\n /**\n * By default, the action sticks to the content of the swipeable item. This\n * makes it move outwards to reveal the inner items.\n */\n const actionOffset = useTransform(listItemXOffset, (newValue) => {\n const maxOffset = SWIPEABLE_ACTION_WIDTH * index;\n const fractionalOffset = (-newValue / totalActionCount) * index;\n\n switch (position) {\n case 'left':\n return Math.max(-maxOffset, fractionalOffset);\n case 'right':\n return Math.min(maxOffset, fractionalOffset);\n default:\n return 0;\n }\n });\n\n /**\n * Brings the item in again if past the threshold. Only relevant for\n * outermost items.\n */\n const actionOverlayOffset = useSpring(0, {\n bounce: 0,\n }) as MotionValue<number>;\n\n /**\n * Combines the two values above to create the correct X transform that has\n * to be applied to the action.\n */\n const actionX = useTransform<number, number>([actionOffset, actionOverlayOffset], ([x, y]) => {\n if (position === 'left') {\n return Math.min((x ?? 0) + (y ?? 0), 0);\n }\n\n return Math.max((x ?? 0) + (y ?? 0), 0);\n });\n\n // Animate to the middle after passing threshold if outermost item\n useEffect(() => {\n const isOuterMost = index === totalActionCount - 1;\n\n if (!isOuterMost) return undefined;\n\n return listItemXOffset.onChange((newValue) => {\n const lastValue = listItemXOffset.getPrevious();\n\n // eslint-disable-next-line default-case\n switch (position) {\n case 'left':\n if (newValue > activationThreshold && lastValue <= activationThreshold) {\n actionOverlayOffset.set(SWIPEABLE_ACTION_WIDTH * index);\n } else if (newValue < activationThreshold && lastValue >= activationThreshold) {\n actionOverlayOffset.set(0);\n }\n break;\n case 'right':\n if (newValue < activationThreshold && lastValue >= activationThreshold) {\n actionOverlayOffset.set(SWIPEABLE_ACTION_WIDTH * -1 * index);\n } else if (newValue > activationThreshold && lastValue <= activationThreshold) {\n actionOverlayOffset.set(0);\n }\n }\n });\n }, [\n actionOverlayOffset,\n activationThreshold,\n index,\n listItemXOffset,\n position,\n totalActionCount,\n ]);\n\n return (\n <StyledMotionSwipeableAction\n $backgroundColor={item.backgroundColor}\n $position={position}\n style={{ x: actionX }}\n >\n <StyledSwipeableActionButton\n $color={item.color}\n onClick={handleButtonClick}\n $width={`${SWIPEABLE_ACTION_WIDTH}px`}\n >\n {item.icon}\n {item.text}\n </StyledSwipeableActionButton>\n </StyledMotionSwipeableAction>\n );\n};\n\nSwipeableAction.displayName = 'SwipeableAction';\n\nexport default SwipeableAction;\n"],"mappings":"AAAA,SAAsBA,SAAS,EAAEC,YAAY,QAAQ,eAAe;AACpE,OAAOC,KAAK,IAAQC,SAAS,QAAQ,OAAO;AAE5C,SAASC,2BAA2B,EA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2B;IACxBkC,gBAAgB,EAAE1B,IAAI,CAAC2B,eAAgB;IACvCC,SAAS,EAAE1B,QAAS;IACpB2B,KAAK,EAAE;MAAEZ,CAAC,EAAEF;IAAQ;EAAE,gBAEtBzB,KAAA,CAAAmC,aAAA,CAAChC,2BAA2B;IACxBqC,MAAM,EAAE9B,IAAI,CAAC+B,KAAM;IACnBC,OAAO,EAAE5B,iBAAkB;IAC3B6B,MAAM,EAAG,GAAEvC,sBAAuB;EAAI,GAErCM,IAAI,CAACkC,IAAI,EACTlC,IAAI,CAACmC,IACmB,CACJ,CAAC;AAEtC,CAAC;AAEDxC,eAAe,CAACyC,WAAW,GAAG,iBAAiB;AAE/C,eAAezC,eAAe"}
@@ -1,9 +1,9 @@
1
1
  import type { CSSProperties } from 'react';
2
- import type { SwipeableActionItem } from '../SwipeableWrapper';
3
- import type { SwipeableActionProps } from './SwipeableAction';
4
- type StyledSwipeableActionProps = Pick<SwipeableActionProps, 'position'> & Pick<SwipeableActionItem, 'backgroundColor'>;
2
+ type StyledSwipeableActionProps = {
3
+ $position: 'left' | 'right';
4
+ $backgroundColor: CSSProperties['backgroundColor'];
5
+ };
5
6
  export declare const StyledMotionSwipeableAction: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<{
6
- color?: string | undefined;
7
7
  title?: string | undefined;
8
8
  slot?: string | undefined;
9
9
  defaultChecked?: boolean | undefined;
@@ -40,6 +40,7 @@ export declare const StyledMotionSwipeableAction: import("styled-components").IS
40
40
  autoCapitalize?: string | undefined;
41
41
  autoCorrect?: string | undefined;
42
42
  autoSave?: string | undefined;
43
+ color?: string | undefined;
43
44
  itemProp?: string | undefined;
44
45
  itemScope?: boolean | undefined;
45
46
  itemType?: string | undefined;
@@ -265,8 +266,9 @@ export declare const StyledMotionSwipeableAction: import("styled-components").IS
265
266
  onTransitionEnd?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
266
267
  onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
267
268
  } & import("framer-motion").MotionProps & import("react").RefAttributes<HTMLDivElement>, StyledSwipeableActionProps>> & Omit<import("framer-motion").ForwardRefComponent<HTMLDivElement, import("framer-motion").HTMLMotionProps<"div">>, keyof import("react").Component<any, {}, any>>;
268
- type StyledSwipeableActionButtonsProps = Pick<SwipeableActionItem, 'color'> & {
269
- width: CSSProperties['width'];
269
+ type StyledSwipeableActionButtonsProps = {
270
+ $width: CSSProperties['width'];
271
+ $color: CSSProperties['color'];
270
272
  };
271
273
  export declare const StyledSwipeableActionButton: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, StyledSwipeableActionButtonsProps>>;
272
274
  export {};
@@ -3,9 +3,9 @@ import styled, { css } from 'styled-components';
3
3
  export const StyledMotionSwipeableAction = styled(motion.div)`
4
4
  background-color: ${_ref => {
5
5
  let {
6
- backgroundColor
6
+ $backgroundColor
7
7
  } = _ref;
8
- return backgroundColor;
8
+ return $backgroundColor;
9
9
  }};
10
10
  display: flex;
11
11
  height: 100%;
@@ -15,9 +15,9 @@ export const StyledMotionSwipeableAction = styled(motion.div)`
15
15
 
16
16
  ${_ref2 => {
17
17
  let {
18
- position
18
+ $position
19
19
  } = _ref2;
20
- if (position === 'left') {
20
+ if ($position === 'left') {
21
21
  return css`
22
22
  justify-content: flex-end;
23
23
  right: 100%;
@@ -36,9 +36,9 @@ export const StyledSwipeableActionButton = styled.button`
36
36
  box-shadow: none;
37
37
  color: ${_ref3 => {
38
38
  let {
39
- color
39
+ $color
40
40
  } = _ref3;
41
- return color;
41
+ return $color;
42
42
  }};
43
43
  display: flex;
44
44
  flex-direction: column;
@@ -50,9 +50,9 @@ export const StyledSwipeableActionButton = styled.button`
50
50
  padding: 0;
51
51
  width: ${_ref4 => {
52
52
  let {
53
- width
53
+ $width
54
54
  } = _ref4;
55
- return width;
55
+ return $width;
56
56
  }};
57
57
  `;
58
58
  //# sourceMappingURL=SwipeableAction.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SwipeableAction.styles.js","names":["motion","styled","css","StyledMotionSwipeableAction","div","_ref","backgroundColor","_ref2","position","StyledSwipeableActionButton","button","_ref3","color","_ref4","width"],"sources":["../../../../src/components/swipeable-wrapper/swipeable-action/SwipeableAction.styles.ts"],"sourcesContent":["import { motion } from 'framer-motion';\nimport type { CSSProperties } from 'react';\nimport styled, { css } from 'styled-components';\nimport type { SwipeableActionItem } from '../SwipeableWrapper';\nimport type { SwipeableActionProps } from './SwipeableAction';\n\ntype StyledSwipeableActionProps = Pick<SwipeableActionProps, 'position'> &\n Pick<SwipeableActionItem, 'backgroundColor'>;\n\nexport const StyledMotionSwipeableAction = styled(motion.div)<StyledSwipeableActionProps>`\n background-color: ${({ backgroundColor }) => backgroundColor};\n display: flex;\n height: 100%;\n position: absolute;\n top: 0;\n width: 200vw;\n\n ${({ position }) => {\n if (position === 'left') {\n return css`\n justify-content: flex-end;\n right: 100%;\n `;\n }\n return css`\n justify-content: flex-start;\n left: 100%;\n `;\n }}\n`;\n\ntype StyledSwipeableActionButtonsProps = Pick<SwipeableActionItem, 'color'> & {\n width: CSSProperties['width'];\n};\n\nexport const StyledSwipeableActionButton = styled.button<StyledSwipeableActionButtonsProps>`\n align-items: center;\n appearance: none;\n background: none;\n box-shadow: none;\n color: ${({ color }) => color};\n display: flex;\n flex-direction: column;\n font-size: 88%;\n gap: 4px;\n height: 100%;\n justify-content: center;\n margin: 0;\n padding: 0;\n width: ${({ width }) => width};\n`;\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,eAAe;AAEtC,OAAOC,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAO/C,OAAO,MAAMC,2BAA2B,GAAGF,MAAM,CAACD,MAAM,CAACI,GAAG,CAA8B;AAC1F,wBAAwBC,IAAA;EAAA,IAAC;IAAEC;EAAgB,CAAC,GAAAD,IAAA;EAAA,OAAKC,eAAe;AAAA,CAAC;AACjE;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,KAAA,IAAkB;EAAA,IAAjB;IAAEC;EAAS,CAAC,GAAAD,KAAA;EACX,IAAIC,QAAQ,KAAK,MAAM,EAAE;IACrB,OAAON,GAAI;AACvB;AACA;AACA,aAAa;EACL;EACA,OAAOA,GAAI;AACnB;AACA;AACA,SAAS;AACL,CAAE;AACN,CAAC;AAMD,OAAO,MAAMO,2BAA2B,GAAGR,MAAM,CAACS,MAA0C;AAC5F;AACA;AACA;AACA;AACA,aAAaC,KAAA;EAAA,IAAC;IAAEC;EAAM,CAAC,GAAAD,KAAA;EAAA,OAAKC,KAAK;AAAA,CAAC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAaC,KAAA;EAAA,IAAC;IAAEC;EAAM,CAAC,GAAAD,KAAA;EAAA,OAAKC,KAAK;AAAA,CAAC;AAClC,CAAC"}
1
+ {"version":3,"file":"SwipeableAction.styles.js","names":["motion","styled","css","StyledMotionSwipeableAction","div","_ref","$backgroundColor","_ref2","$position","StyledSwipeableActionButton","button","_ref3","$color","_ref4","$width"],"sources":["../../../../src/components/swipeable-wrapper/swipeable-action/SwipeableAction.styles.ts"],"sourcesContent":["import { motion } from 'framer-motion';\nimport type { CSSProperties } from 'react';\nimport styled, { css } from 'styled-components';\n\ntype StyledSwipeableActionProps = {\n $position: 'left' | 'right';\n $backgroundColor: CSSProperties['backgroundColor'];\n};\n\nexport const StyledMotionSwipeableAction = styled(motion.div)<StyledSwipeableActionProps>`\n background-color: ${({ $backgroundColor }) => $backgroundColor};\n display: flex;\n height: 100%;\n position: absolute;\n top: 0;\n width: 200vw;\n\n ${({ $position }) => {\n if ($position === 'left') {\n return css`\n justify-content: flex-end;\n right: 100%;\n `;\n }\n return css`\n justify-content: flex-start;\n left: 100%;\n `;\n }}\n`;\n\ntype StyledSwipeableActionButtonsProps = {\n $width: CSSProperties['width'];\n $color: CSSProperties['color'];\n};\n\nexport const StyledSwipeableActionButton = styled.button<StyledSwipeableActionButtonsProps>`\n align-items: center;\n appearance: none;\n background: none;\n box-shadow: none;\n color: ${({ $color }) => $color};\n display: flex;\n flex-direction: column;\n font-size: 88%;\n gap: 4px;\n height: 100%;\n justify-content: center;\n margin: 0;\n padding: 0;\n width: ${({ $width }) => $width};\n`;\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,eAAe;AAEtC,OAAOC,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAO/C,OAAO,MAAMC,2BAA2B,GAAGF,MAAM,CAACD,MAAM,CAACI,GAAG,CAA8B;AAC1F,wBAAwBC,IAAA;EAAA,IAAC;IAAEC;EAAiB,CAAC,GAAAD,IAAA;EAAA,OAAKC,gBAAgB;AAAA,CAAC;AACnE;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,KAAA,IAAmB;EAAA,IAAlB;IAAEC;EAAU,CAAC,GAAAD,KAAA;EACZ,IAAIC,SAAS,KAAK,MAAM,EAAE;IACtB,OAAON,GAAI;AACvB;AACA;AACA,aAAa;EACL;EACA,OAAOA,GAAI;AACnB;AACA;AACA,SAAS;AACL,CAAE;AACN,CAAC;AAOD,OAAO,MAAMO,2BAA2B,GAAGR,MAAM,CAACS,MAA0C;AAC5F;AACA;AACA;AACA;AACA,aAAaC,KAAA;EAAA,IAAC;IAAEC;EAAO,CAAC,GAAAD,KAAA;EAAA,OAAKC,MAAM;AAAA,CAAC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAaC,KAAA;EAAA,IAAC;IAAEC;EAAO,CAAC,GAAAD,KAAA;EAAA,OAAKC,MAAM;AAAA,CAAC;AACpC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chayns-components/swipeable-wrapper",
3
- "version": "5.0.0-beta.457",
3
+ "version": "5.0.0-beta.459",
4
4
  "description": "A set of beautiful React components for developing your own applications with chayns.",
5
5
  "sideEffects": false,
6
6
  "browserslist": [
@@ -57,7 +57,7 @@
57
57
  "typescript": "^5.3.3"
58
58
  },
59
59
  "dependencies": {
60
- "@chayns-components/core": "^5.0.0-beta.457"
60
+ "@chayns-components/core": "^5.0.0-beta.459"
61
61
  },
62
62
  "peerDependencies": {
63
63
  "chayns-api": ">=1.0.50",
@@ -69,5 +69,5 @@
69
69
  "publishConfig": {
70
70
  "access": "public"
71
71
  },
72
- "gitHead": "14f7fd7ff2e7c85c81793db66efc02482cdbd527"
72
+ "gitHead": "70efaed48eba0238cf94810511767ee85cbb4066"
73
73
  }