@uni-design-system/uni-react 0.0.9 → 0.0.10

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.
@@ -6,18 +6,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.Card = void 0;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const core_1 = require("../../core");
9
- const framer_motion_1 = require("framer-motion");
10
9
  function Card({ children, cardType, elevation, colorToken = 'primary-container', width, height, borderRadius, }) {
11
10
  const { colors, containers } = (0, core_1.useTheme)();
12
11
  const { borderRadii } = containers.card;
13
12
  const style = Object.assign({ height,
14
- width, position: 'fixed', backgroundColor: colors[colorToken || 'surface'], color: colors[`on-${colorToken}` || 'on-surface'] }, (0, core_1.Padding)('md', 'all'));
13
+ width, backgroundColor: colors[colorToken || 'surface'], color: colors[`on-${colorToken}` || 'on-surface'] }, (0, core_1.Padding)('md', 'all'));
15
14
  if (cardType === 'elevated') {
16
15
  style.boxShadow = (0, core_1.BoxShadow)(elevation || 'raised');
17
16
  }
18
17
  if (borderRadii && borderRadius !== 'none') {
19
18
  style.borderRadius = borderRadii[borderRadius || 'md'];
20
19
  }
21
- return (react_1.default.createElement(framer_motion_1.motion.div, { style: style, initial: { y: 36, opacity: 0 }, animate: { y: 0, opacity: 1 }, exit: { y: 36, opacity: 0 }, transition: { duration: 0.2 } }, children));
20
+ return react_1.default.createElement("div", { style: style }, children);
22
21
  }
23
22
  exports.Card = Card;
@@ -7,6 +7,7 @@ exports.Modal = void 0;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const card_1 = require("../card");
9
9
  const core_1 = require("../../core");
10
+ const framer_motion_1 = require("framer-motion");
10
11
  const ModalSizes = {
11
12
  sm: 260,
12
13
  md: 320,
@@ -15,6 +16,7 @@ const ModalSizes = {
15
16
  const Modal = ({ children, isOpen, size = 'lg' }) => {
16
17
  return (react_1.default.createElement(react_1.default.Fragment, null,
17
18
  react_1.default.createElement(core_1.Overlay, { isOpen: isOpen },
18
- react_1.default.createElement(card_1.Card, { colorToken: "background", width: ModalSizes[size], cardType: "elevated", elevation: "modal" }, children))));
19
+ react_1.default.createElement(framer_motion_1.motion.div, { style: { position: 'fixed' }, initial: { y: 36, opacity: 0 }, animate: { y: 0, opacity: 1 }, exit: { y: 36, opacity: 0 }, transition: { duration: 0.2 } },
20
+ react_1.default.createElement(card_1.Card, { colorToken: "background", width: ModalSizes[size], cardType: "elevated", elevation: "modal" }, children)))));
19
21
  };
20
22
  exports.Modal = Modal;
@@ -1,16 +1,15 @@
1
1
  import React from 'react';
2
2
  import { BoxShadow, Padding, useTheme } from '../../core';
3
- import { motion } from 'framer-motion';
4
3
  export function Card({ children, cardType, elevation, colorToken = 'primary-container', width, height, borderRadius, }) {
5
4
  const { colors, containers } = useTheme();
6
5
  const { borderRadii } = containers.card;
7
6
  const style = Object.assign({ height,
8
- width, position: 'fixed', backgroundColor: colors[colorToken || 'surface'], color: colors[`on-${colorToken}` || 'on-surface'] }, Padding('md', 'all'));
7
+ width, backgroundColor: colors[colorToken || 'surface'], color: colors[`on-${colorToken}` || 'on-surface'] }, Padding('md', 'all'));
9
8
  if (cardType === 'elevated') {
10
9
  style.boxShadow = BoxShadow(elevation || 'raised');
11
10
  }
12
11
  if (borderRadii && borderRadius !== 'none') {
13
12
  style.borderRadius = borderRadii[borderRadius || 'md'];
14
13
  }
15
- return (React.createElement(motion.div, { style: style, initial: { y: 36, opacity: 0 }, animate: { y: 0, opacity: 1 }, exit: { y: 36, opacity: 0 }, transition: { duration: 0.2 } }, children));
14
+ return React.createElement("div", { style: style }, children);
16
15
  }
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { Card } from '../card';
3
3
  import { Overlay } from '../../core';
4
+ import { motion } from 'framer-motion';
4
5
  const ModalSizes = {
5
6
  sm: 260,
6
7
  md: 320,
@@ -9,5 +10,6 @@ const ModalSizes = {
9
10
  export const Modal = ({ children, isOpen, size = 'lg' }) => {
10
11
  return (React.createElement(React.Fragment, null,
11
12
  React.createElement(Overlay, { isOpen: isOpen },
12
- React.createElement(Card, { colorToken: "background", width: ModalSizes[size], cardType: "elevated", elevation: "modal" }, children))));
13
+ React.createElement(motion.div, { style: { position: 'fixed' }, initial: { y: 36, opacity: 0 }, animate: { y: 0, opacity: 1 }, exit: { y: 36, opacity: 0 }, transition: { duration: 0.2 } },
14
+ React.createElement(Card, { colorToken: "background", width: ModalSizes[size], cardType: "elevated", elevation: "modal" }, children)))));
13
15
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uni-design-system/uni-react",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "description": "React component library for the UNI Design System.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",