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

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;
@@ -0,0 +1,2 @@
1
+ export * from './image.component';
2
+ export * from './image.model';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./image.component"), exports);
18
+ __exportStar(require("./image.model"), exports);
@@ -1,11 +1,12 @@
1
- export * from './theme';
2
1
  export * from './border';
2
+ export * from './container';
3
3
  export * from './flex';
4
+ export * from './hooks';
4
5
  export * from './icon';
6
+ export * from './image';
5
7
  export * from './layout';
6
- export * from './container';
8
+ export * from './overlay';
7
9
  export * from './padding';
8
10
  export * from './shadow';
9
11
  export * from './text';
10
- export * from './overlay';
11
- export * from './hooks';
12
+ export * from './theme';
@@ -14,14 +14,15 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./theme"), exports);
18
17
  __exportStar(require("./border"), exports);
18
+ __exportStar(require("./container"), exports);
19
19
  __exportStar(require("./flex"), exports);
20
+ __exportStar(require("./hooks"), exports);
20
21
  __exportStar(require("./icon"), exports);
22
+ __exportStar(require("./image"), exports);
21
23
  __exportStar(require("./layout"), exports);
22
- __exportStar(require("./container"), exports);
24
+ __exportStar(require("./overlay"), exports);
23
25
  __exportStar(require("./padding"), exports);
24
26
  __exportStar(require("./shadow"), exports);
25
27
  __exportStar(require("./text"), exports);
26
- __exportStar(require("./overlay"), exports);
27
- __exportStar(require("./hooks"), exports);
28
+ __exportStar(require("./theme"), exports);
@@ -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
  };
@@ -0,0 +1,2 @@
1
+ export * from './image.component';
2
+ export * from './image.model';
@@ -0,0 +1,2 @@
1
+ export * from './image.component';
2
+ export * from './image.model';
@@ -1,11 +1,12 @@
1
- export * from './theme';
2
1
  export * from './border';
2
+ export * from './container';
3
3
  export * from './flex';
4
+ export * from './hooks';
4
5
  export * from './icon';
6
+ export * from './image';
5
7
  export * from './layout';
6
- export * from './container';
8
+ export * from './overlay';
7
9
  export * from './padding';
8
10
  export * from './shadow';
9
11
  export * from './text';
10
- export * from './overlay';
11
- export * from './hooks';
12
+ export * from './theme';
@@ -1,11 +1,12 @@
1
- export * from './theme';
2
1
  export * from './border';
2
+ export * from './container';
3
3
  export * from './flex';
4
+ export * from './hooks';
4
5
  export * from './icon';
6
+ export * from './image';
5
7
  export * from './layout';
6
- export * from './container';
8
+ export * from './overlay';
7
9
  export * from './padding';
8
10
  export * from './shadow';
9
11
  export * from './text';
10
- export * from './overlay';
11
- export * from './hooks';
12
+ export * from './theme';
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.11",
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",