@invoicebox/ui 0.1.0-alpha.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.
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # invoicebox-ui
2
+
3
+ Invoicebox UI
@@ -0,0 +1 @@
1
+ export { Button } from './stories/Button';
package/dist/index.js ADDED
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "Button", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _Button.Button;
10
+ }
11
+ });
12
+ var _Button = require("./stories/Button");
@@ -0,0 +1,26 @@
1
+ export interface ButtonProps {
2
+ /**
3
+ * Is this the principal call to action on the page?
4
+ */
5
+ primary?: boolean;
6
+ /**
7
+ * What background color to use
8
+ */
9
+ backgroundColor?: string;
10
+ /**
11
+ * How large should the button be?
12
+ */
13
+ size?: 'small' | 'medium' | 'large';
14
+ /**
15
+ * Button contents
16
+ */
17
+ label: string;
18
+ /**
19
+ * Optional click handler
20
+ */
21
+ onClick?: () => void;
22
+ }
23
+ /**
24
+ * Primary UI component for user interaction
25
+ */
26
+ export declare const Button: ({ primary, size, backgroundColor, label, ...props }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+
3
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.Button = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _styles = _interopRequireWildcard(require("./styles"));
10
+ var S = _styles;
11
+ var _excluded = ["primary", "size", "backgroundColor", "label"];
12
+ 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); }
13
+ 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; }
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
16
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
17
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
18
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
19
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
20
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
21
+ 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; }
22
+ 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; }
23
+ /**
24
+ * Primary UI component for user interaction
25
+ */
26
+ var Button = exports.Button = function Button(_ref) {
27
+ var _ref$primary = _ref.primary,
28
+ primary = _ref$primary === void 0 ? false : _ref$primary,
29
+ _ref$size = _ref.size,
30
+ size = _ref$size === void 0 ? 'medium' : _ref$size,
31
+ backgroundColor = _ref.backgroundColor,
32
+ label = _ref.label,
33
+ props = _objectWithoutProperties(_ref, _excluded);
34
+ var modeStyles = primary ? _styles.primaryStyles : _styles.secondaryStyles;
35
+ var sizeStyles = {
36
+ small: _styles.smallStyles,
37
+ medium: _styles.mediumStyles,
38
+ large: _styles.largeStyles
39
+ }[size];
40
+ return /*#__PURE__*/_react["default"].createElement(S.Wrapper, _extends({
41
+ type: "button",
42
+ style: _objectSpread(_objectSpread(_objectSpread({}, modeStyles), sizeStyles), backgroundColor ? {
43
+ backgroundColor: backgroundColor
44
+ } : {})
45
+ }, props), label);
46
+ };
@@ -0,0 +1,21 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ import { ButtonProps } from './Button';
3
+ declare const meta: {
4
+ title: string;
5
+ component: ({ primary, size, backgroundColor, label, ...props }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
6
+ parameters: {
7
+ layout: string;
8
+ };
9
+ tags: string[];
10
+ argTypes: {
11
+ backgroundColor: {
12
+ control: string;
13
+ };
14
+ };
15
+ };
16
+ export default meta;
17
+ type Story = StoryObj<typeof meta>;
18
+ export declare const Primary: Story;
19
+ export declare const Secondary: Story;
20
+ export declare const Large: Story;
21
+ export declare const Small: Story;
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = exports.Small = exports.Secondary = exports.Primary = exports.Large = void 0;
7
+ var _Button = require("./Button");
8
+ // More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
9
+ var meta = {
10
+ title: 'Example/Button',
11
+ component: _Button.Button,
12
+ parameters: {
13
+ // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
14
+ layout: 'centered'
15
+ },
16
+ // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
17
+ tags: ['autodocs'],
18
+ // More on argTypes: https://storybook.js.org/docs/api/argtypes
19
+ argTypes: {
20
+ backgroundColor: {
21
+ control: 'color'
22
+ }
23
+ }
24
+ };
25
+ var _default = exports["default"] = meta;
26
+ // More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
27
+ var Primary = exports.Primary = {
28
+ args: {
29
+ primary: true,
30
+ label: 'Button'
31
+ }
32
+ };
33
+ var Secondary = exports.Secondary = {
34
+ args: {
35
+ label: 'Button'
36
+ }
37
+ };
38
+ var Large = exports.Large = {
39
+ args: {
40
+ size: 'large',
41
+ label: 'Button'
42
+ }
43
+ };
44
+ var Small = exports.Small = {
45
+ args: {
46
+ size: 'small',
47
+ label: 'Button'
48
+ }
49
+ };
@@ -0,0 +1,23 @@
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").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>>;
3
+ export declare const primaryStyles: {
4
+ color: string;
5
+ backgroundColor: string;
6
+ };
7
+ export declare const secondaryStyles: {
8
+ color: string;
9
+ backgroundColor: string;
10
+ boxShadow: string;
11
+ };
12
+ export declare const smallStyles: {
13
+ fontSize: string;
14
+ padding: string;
15
+ };
16
+ export declare const mediumStyles: {
17
+ fontSize: string;
18
+ padding: string;
19
+ };
20
+ export declare const largeStyles: {
21
+ fontSize: string;
22
+ padding: string;
23
+ };
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.smallStyles = exports.secondaryStyles = exports.primaryStyles = exports.mediumStyles = exports.largeStyles = exports.Wrapper = void 0;
7
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
9
+ var Wrapper = exports.Wrapper = _styledComponents["default"].button.withConfig({
10
+ displayName: "styles__Wrapper",
11
+ componentId: "sc-11ohbjf-0"
12
+ })(["font-family:'Nunito Sans','Helvetica Neue',Helvetica,Arial,sans-serif;font-weight:700;border:0;border-radius:3em;cursor:pointer;display:inline-block;line-height:1;"]);
13
+ var primaryStyles = exports.primaryStyles = {
14
+ color: 'white',
15
+ backgroundColor: '#1ea7fd'
16
+ };
17
+ var secondaryStyles = exports.secondaryStyles = {
18
+ color: '#333',
19
+ backgroundColor: 'transparent',
20
+ boxShadow: 'rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset'
21
+ };
22
+ var smallStyles = exports.smallStyles = {
23
+ fontSize: '12px',
24
+ padding: '10px 16px'
25
+ };
26
+ var mediumStyles = exports.mediumStyles = {
27
+ fontSize: '14px',
28
+ padding: '11px 20px'
29
+ };
30
+ var largeStyles = exports.largeStyles = {
31
+ fontSize: '16px',
32
+ padding: '12px 24px'
33
+ };
package/package.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "@invoicebox/ui",
3
+ "version": "0.1.0-alpha.10",
4
+ "description": "Invoicebox UI",
5
+ "license": "ISC",
6
+ "scripts": {
7
+ "storybook": "storybook dev -p 6006",
8
+ "build-storybook": "storybook build",
9
+ "build": "babel src --extensions .ts,.tsx --out-dir dist && tsc --project tsconfig.json",
10
+ "release": "git checkout develop && npm run build && npm version $VERSION && git push && git push --tags && git checkout main && git merge develop && git push && npm publish && git checkout develop"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/InvoiceBox/invoicebox-ui/issues"
14
+ },
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/InvoiceBox/invoicebox-ui.git"
18
+ },
19
+ "homepage": "https://github.com/InvoiceBox/invoicebox-ui#readme",
20
+ "devDependencies": {
21
+ "@babel/cli": "^7.23.9",
22
+ "@babel/core": "^7.23.9",
23
+ "@babel/plugin-proposal-private-property-in-object": "^7.21.11",
24
+ "@babel/preset-env": "^7.23.9",
25
+ "@babel/preset-react": "^7.23.3",
26
+ "@babel/preset-typescript": "^7.23.3",
27
+ "@storybook/addon-essentials": "^7.6.13",
28
+ "@storybook/addon-interactions": "^7.6.13",
29
+ "@storybook/addon-links": "^7.6.13",
30
+ "@storybook/addon-onboarding": "^1.0.11",
31
+ "@storybook/blocks": "^7.6.13",
32
+ "@storybook/preset-create-react-app": "^7.6.13",
33
+ "@storybook/react": "^7.6.13",
34
+ "@storybook/react-webpack5": "^7.6.13",
35
+ "@storybook/test": "^7.6.13",
36
+ "@typescript-eslint/eslint-plugin": "^5.62.0",
37
+ "@typescript-eslint/parser": "^5.62.0",
38
+ "babel-plugin-styled-components": "^2.1.4",
39
+ "eslint": "^8.56.0",
40
+ "eslint-config-prettier": "^9.1.0",
41
+ "eslint-plugin-prettier": "^5.1.3",
42
+ "eslint-plugin-storybook": "^0.6.15",
43
+ "prettier": "^3.2.5",
44
+ "prop-types": "^15.8.1",
45
+ "storybook": "^7.6.13",
46
+ "styled-components": "^6.1.8",
47
+ "typescript": "^4.9.5",
48
+ "webpack": "^5.90.1"
49
+ },
50
+ "peerDependencies": {
51
+ "react": "^18.2.0",
52
+ "styled-components": "^6.1.8"
53
+ },
54
+ "engines": {
55
+ "node": "^16.17.1"
56
+ },
57
+ "files": [
58
+ "dist"
59
+ ],
60
+ "main": "./dist/index.js"
61
+ }