@invoicebox/ui 0.1.0-alpha.11 → 0.1.0-alpha.12

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,2 +1,6 @@
1
1
  import { FC } from 'react';
2
- export declare const Skeleton: FC;
2
+ export type TProps = {
3
+ width?: string;
4
+ height?: string;
5
+ };
6
+ export declare const Skeleton: FC<TProps>;
@@ -10,6 +10,11 @@ var S = _interopRequireWildcard(require("./styles"));
10
10
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
11
11
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
- var Skeleton = exports.Skeleton = function Skeleton() {
14
- return /*#__PURE__*/_react["default"].createElement(S.Wrapper, null, /*#__PURE__*/_react["default"].createElement(S.Inner, null));
13
+ var Skeleton = exports.Skeleton = function Skeleton(_ref) {
14
+ var width = _ref.width,
15
+ height = _ref.height;
16
+ return /*#__PURE__*/_react["default"].createElement(S.Wrapper, {
17
+ $width: width,
18
+ $height: height
19
+ }, /*#__PURE__*/_react["default"].createElement(S.Inner, null));
15
20
  };
@@ -1,12 +1,14 @@
1
1
  /// <reference types="react" />
2
2
  import type { StoryObj } from '@storybook/react';
3
+ import { Skeleton, TProps } from '.';
3
4
  declare const meta: {
4
5
  title: string;
5
- component: import("react").FC<{}>;
6
+ component: import("react").FC<TProps>;
6
7
  tags: string[];
7
8
  };
8
9
  export default meta;
9
- export declare const Primary: StoryObj<{
10
- width: number;
11
- height: number;
10
+ export declare const ByContainer: StoryObj<TProps & {
11
+ containerWidth: number;
12
+ containerHeight: number;
12
13
  }>;
14
+ export declare const ByOwnSize: StoryObj<typeof Skeleton>;
@@ -3,25 +3,37 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports["default"] = exports.Primary = void 0;
6
+ exports["default"] = exports.ByOwnSize = exports.ByContainer = void 0;
7
7
  var _ = require(".");
8
+ var _excluded = ["containerWidth", "containerHeight"];
9
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
10
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
8
11
  var meta = {
9
12
  title: 'Common/Skeleton',
10
13
  component: _.Skeleton,
11
14
  tags: ['autodocs']
12
15
  };
13
16
  var _default = exports["default"] = meta;
14
- var Primary = exports.Primary = {
17
+ var ByContainer = exports.ByContainer = {
15
18
  args: {
16
- width: 100,
17
- height: 200
19
+ containerWidth: 200,
20
+ containerHeight: 100
18
21
  },
19
- render: function render(args) {
22
+ render: function render(_ref) {
23
+ var containerWidth = _ref.containerWidth,
24
+ containerHeight = _ref.containerHeight,
25
+ rest = _objectWithoutProperties(_ref, _excluded);
20
26
  return /*#__PURE__*/React.createElement("div", {
21
27
  style: {
22
- width: args.width,
23
- height: args.height
28
+ width: containerWidth,
29
+ height: containerHeight
24
30
  }
25
- }, /*#__PURE__*/React.createElement(_.Skeleton, null));
31
+ }, /*#__PURE__*/React.createElement(_.Skeleton, rest));
32
+ }
33
+ };
34
+ var ByOwnSize = exports.ByOwnSize = {
35
+ args: {
36
+ width: '200px',
37
+ height: '100px'
26
38
  }
27
39
  };
@@ -1,3 +1,6 @@
1
1
  /// <reference types="react" />
2
- export declare const Wrapper: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>;
2
+ export declare const Wrapper: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
3
+ $width?: string | undefined;
4
+ $height?: string | undefined;
5
+ }>>;
3
6
  export declare const Inner: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>;
@@ -12,7 +12,13 @@ var shine = (0, _styledComponents.keyframes)(["0%{left:calc(0% - 200px);}100%{le
12
12
  var Wrapper = exports.Wrapper = _styledComponents["default"].div.withConfig({
13
13
  displayName: "styles__Wrapper",
14
14
  componentId: "sc-mb3gd0-0"
15
- })(["width:100%;height:100%;border-radius:10px;overflow:hidden;position:relative;background:#f1f2f6;"]);
15
+ })(["width:", ";height:", ";border-radius:10px;overflow:hidden;position:relative;background:#f1f2f6;"], function (_ref) {
16
+ var $width = _ref.$width;
17
+ return $width !== null && $width !== void 0 ? $width : '100%';
18
+ }, function (_ref2) {
19
+ var $height = _ref2.$height;
20
+ return $height !== null && $height !== void 0 ? $height : '100%';
21
+ });
16
22
  var Inner = exports.Inner = _styledComponents["default"].div.withConfig({
17
23
  displayName: "styles__Inner",
18
24
  componentId: "sc-mb3gd0-1"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@invoicebox/ui",
3
- "version": "0.1.0-alpha.11",
3
+ "version": "0.1.0-alpha.12",
4
4
  "description": "Invoicebox UI",
5
5
  "license": "ISC",
6
6
  "scripts": {