@adiba-banking-cloud/backoffice 0.0.2 → 0.0.4

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.
@@ -0,0 +1,120 @@
1
+ 'use strict';
2
+
3
+ var _extends = require('@babel/runtime/helpers/extends');
4
+ var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
5
+ var React = require('react');
6
+ var core = require('@mantine/core');
7
+
8
+ const _excluded = ["primary", "size", "backgroundColor", "label"];
9
+ /** Primary UI component for user interaction */
10
+ const Button = _ref => {
11
+ let {
12
+ primary = false,
13
+ size = "medium",
14
+ backgroundColor,
15
+ label
16
+ } = _ref,
17
+ props = _objectWithoutProperties(_ref, _excluded);
18
+ const mode = primary ? "storybook-button--primary" : "storybook-button--secondary";
19
+ return /*#__PURE__*/React.createElement(core.Button, _extends({
20
+ type: "button",
21
+ className: ["storybook-button", "storybook-button--".concat(size), mode].join(" "),
22
+ style: {
23
+ backgroundColor
24
+ }
25
+ }, props, {
26
+ variant: "filled"
27
+ }), label);
28
+ };
29
+
30
+ const Header = _ref => {
31
+ let {
32
+ user,
33
+ onLogin,
34
+ onLogout,
35
+ onCreateAccount
36
+ } = _ref;
37
+ return /*#__PURE__*/React.createElement("header", null, /*#__PURE__*/React.createElement("div", {
38
+ className: "storybook-header"
39
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("svg", {
40
+ width: "32",
41
+ height: "32",
42
+ viewBox: "0 0 32 32",
43
+ xmlns: "http://www.w3.org/2000/svg"
44
+ }, /*#__PURE__*/React.createElement("g", {
45
+ fill: "none",
46
+ fillRule: "evenodd"
47
+ }, /*#__PURE__*/React.createElement("path", {
48
+ d: "M10 0h12a10 10 0 0110 10v12a10 10 0 01-10 10H10A10 10 0 010 22V10A10 10 0 0110 0z",
49
+ fill: "#FFF"
50
+ }), /*#__PURE__*/React.createElement("path", {
51
+ d: "M5.3 10.6l10.4 6v11.1l-10.4-6v-11zm11.4-6.2l9.7 5.5-9.7 5.6V4.4z",
52
+ fill: "#555AB9"
53
+ }), /*#__PURE__*/React.createElement("path", {
54
+ d: "M27.2 10.6v11.2l-10.5 6V16.5l10.5-6zM15.7 4.4v11L6 10l9.7-5.5z",
55
+ fill: "#91BAF8"
56
+ }))), /*#__PURE__*/React.createElement("h1", null, "Acme")), /*#__PURE__*/React.createElement("div", null, user ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
57
+ className: "welcome"
58
+ }, "Welcome, ", /*#__PURE__*/React.createElement("b", null, user.name), "!"), /*#__PURE__*/React.createElement(Button, {
59
+ size: "small",
60
+ onClick: onLogout,
61
+ label: "Log out"
62
+ })) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
63
+ size: "small",
64
+ onClick: onLogin,
65
+ label: "Log in"
66
+ }), /*#__PURE__*/React.createElement(Button, {
67
+ primary: true,
68
+ size: "small",
69
+ onClick: onCreateAccount,
70
+ label: "Sign up"
71
+ })))));
72
+ };
73
+
74
+ const Page = () => {
75
+ const [user, setUser] = React.useState();
76
+ return /*#__PURE__*/React.createElement("article", null, /*#__PURE__*/React.createElement(Header, {
77
+ user: user,
78
+ onLogin: () => setUser({
79
+ name: "Jane Doe"
80
+ }),
81
+ onLogout: () => setUser(undefined),
82
+ onCreateAccount: () => setUser({
83
+ name: "Jane Doe"
84
+ })
85
+ }), /*#__PURE__*/React.createElement("section", {
86
+ className: "storybook-page"
87
+ }, /*#__PURE__*/React.createElement("h2", null, "Pages in Storybook"), /*#__PURE__*/React.createElement("p", null, "We recommend building UIs with a", " ", /*#__PURE__*/React.createElement("a", {
88
+ href: "https://componentdriven.org",
89
+ target: "_blank",
90
+ rel: "noopener noreferrer"
91
+ }, /*#__PURE__*/React.createElement("strong", null, "component-driven")), " ", "process starting with atomic components and ending with pages."), /*#__PURE__*/React.createElement("p", null, "Render pages with mock data. This makes it easy to build and review page states without needing to navigate to them in your app. Here are some handy patterns for managing page data in Storybook:"), /*#__PURE__*/React.createElement("ul", null, /*#__PURE__*/React.createElement("li", null, "Use a higher-level connected component. Storybook helps you compose such data from the \"args\" of child component stories"), /*#__PURE__*/React.createElement("li", null, "Assemble data in the page component from your services. You can mock these services out using Storybook.")), /*#__PURE__*/React.createElement("p", null, "Get a guided tutorial on component-driven development at", " ", /*#__PURE__*/React.createElement("a", {
92
+ href: "https://storybook.js.org/tutorials/",
93
+ target: "_blank",
94
+ rel: "noopener noreferrer"
95
+ }, "Storybook tutorials"), ". Read more in the", " ", /*#__PURE__*/React.createElement("a", {
96
+ href: "https://storybook.js.org/docs",
97
+ target: "_blank",
98
+ rel: "noopener noreferrer"
99
+ }, "docs"), "."), /*#__PURE__*/React.createElement("div", {
100
+ className: "tip-wrapper"
101
+ }, /*#__PURE__*/React.createElement("span", {
102
+ className: "tip"
103
+ }, "Tip"), " Adjust the width of the canvas with the", " ", /*#__PURE__*/React.createElement("svg", {
104
+ width: "10",
105
+ height: "10",
106
+ viewBox: "0 0 12 12",
107
+ xmlns: "http://www.w3.org/2000/svg"
108
+ }, /*#__PURE__*/React.createElement("g", {
109
+ fill: "none",
110
+ fillRule: "evenodd"
111
+ }, /*#__PURE__*/React.createElement("path", {
112
+ d: "M1.5 5.2h4.8c.3 0 .5.2.5.4v5.1c-.1.2-.3.3-.4.3H1.4a.5.5 0 01-.5-.4V5.7c0-.3.2-.5.5-.5zm0-2.1h6.9c.3 0 .5.2.5.4v7a.5.5 0 01-1 0V4H1.5a.5.5 0 010-1zm0-2.1h9c.3 0 .5.2.5.4v9.1a.5.5 0 01-1 0V2H1.5a.5.5 0 010-1zm4.3 5.2H2V10h3.8V6.2z",
113
+ id: "a",
114
+ fill: "#999"
115
+ }))), "Viewports addon in the toolbar")));
116
+ };
117
+
118
+ exports.Button = Button;
119
+ exports.Header = Header;
120
+ exports.Page = Page;
@@ -0,0 +1,116 @@
1
+ import _extends from '@babel/runtime/helpers/extends';
2
+ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
3
+ import React from 'react';
4
+ import { Button as Button$1 } from '@mantine/core';
5
+
6
+ const _excluded = ["primary", "size", "backgroundColor", "label"];
7
+ /** Primary UI component for user interaction */
8
+ const Button = _ref => {
9
+ let {
10
+ primary = false,
11
+ size = "medium",
12
+ backgroundColor,
13
+ label
14
+ } = _ref,
15
+ props = _objectWithoutProperties(_ref, _excluded);
16
+ const mode = primary ? "storybook-button--primary" : "storybook-button--secondary";
17
+ return /*#__PURE__*/React.createElement(Button$1, _extends({
18
+ type: "button",
19
+ className: ["storybook-button", "storybook-button--".concat(size), mode].join(" "),
20
+ style: {
21
+ backgroundColor
22
+ }
23
+ }, props, {
24
+ variant: "filled"
25
+ }), label);
26
+ };
27
+
28
+ const Header = _ref => {
29
+ let {
30
+ user,
31
+ onLogin,
32
+ onLogout,
33
+ onCreateAccount
34
+ } = _ref;
35
+ return /*#__PURE__*/React.createElement("header", null, /*#__PURE__*/React.createElement("div", {
36
+ className: "storybook-header"
37
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("svg", {
38
+ width: "32",
39
+ height: "32",
40
+ viewBox: "0 0 32 32",
41
+ xmlns: "http://www.w3.org/2000/svg"
42
+ }, /*#__PURE__*/React.createElement("g", {
43
+ fill: "none",
44
+ fillRule: "evenodd"
45
+ }, /*#__PURE__*/React.createElement("path", {
46
+ d: "M10 0h12a10 10 0 0110 10v12a10 10 0 01-10 10H10A10 10 0 010 22V10A10 10 0 0110 0z",
47
+ fill: "#FFF"
48
+ }), /*#__PURE__*/React.createElement("path", {
49
+ d: "M5.3 10.6l10.4 6v11.1l-10.4-6v-11zm11.4-6.2l9.7 5.5-9.7 5.6V4.4z",
50
+ fill: "#555AB9"
51
+ }), /*#__PURE__*/React.createElement("path", {
52
+ d: "M27.2 10.6v11.2l-10.5 6V16.5l10.5-6zM15.7 4.4v11L6 10l9.7-5.5z",
53
+ fill: "#91BAF8"
54
+ }))), /*#__PURE__*/React.createElement("h1", null, "Acme")), /*#__PURE__*/React.createElement("div", null, user ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
55
+ className: "welcome"
56
+ }, "Welcome, ", /*#__PURE__*/React.createElement("b", null, user.name), "!"), /*#__PURE__*/React.createElement(Button, {
57
+ size: "small",
58
+ onClick: onLogout,
59
+ label: "Log out"
60
+ })) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
61
+ size: "small",
62
+ onClick: onLogin,
63
+ label: "Log in"
64
+ }), /*#__PURE__*/React.createElement(Button, {
65
+ primary: true,
66
+ size: "small",
67
+ onClick: onCreateAccount,
68
+ label: "Sign up"
69
+ })))));
70
+ };
71
+
72
+ const Page = () => {
73
+ const [user, setUser] = React.useState();
74
+ return /*#__PURE__*/React.createElement("article", null, /*#__PURE__*/React.createElement(Header, {
75
+ user: user,
76
+ onLogin: () => setUser({
77
+ name: "Jane Doe"
78
+ }),
79
+ onLogout: () => setUser(undefined),
80
+ onCreateAccount: () => setUser({
81
+ name: "Jane Doe"
82
+ })
83
+ }), /*#__PURE__*/React.createElement("section", {
84
+ className: "storybook-page"
85
+ }, /*#__PURE__*/React.createElement("h2", null, "Pages in Storybook"), /*#__PURE__*/React.createElement("p", null, "We recommend building UIs with a", " ", /*#__PURE__*/React.createElement("a", {
86
+ href: "https://componentdriven.org",
87
+ target: "_blank",
88
+ rel: "noopener noreferrer"
89
+ }, /*#__PURE__*/React.createElement("strong", null, "component-driven")), " ", "process starting with atomic components and ending with pages."), /*#__PURE__*/React.createElement("p", null, "Render pages with mock data. This makes it easy to build and review page states without needing to navigate to them in your app. Here are some handy patterns for managing page data in Storybook:"), /*#__PURE__*/React.createElement("ul", null, /*#__PURE__*/React.createElement("li", null, "Use a higher-level connected component. Storybook helps you compose such data from the \"args\" of child component stories"), /*#__PURE__*/React.createElement("li", null, "Assemble data in the page component from your services. You can mock these services out using Storybook.")), /*#__PURE__*/React.createElement("p", null, "Get a guided tutorial on component-driven development at", " ", /*#__PURE__*/React.createElement("a", {
90
+ href: "https://storybook.js.org/tutorials/",
91
+ target: "_blank",
92
+ rel: "noopener noreferrer"
93
+ }, "Storybook tutorials"), ". Read more in the", " ", /*#__PURE__*/React.createElement("a", {
94
+ href: "https://storybook.js.org/docs",
95
+ target: "_blank",
96
+ rel: "noopener noreferrer"
97
+ }, "docs"), "."), /*#__PURE__*/React.createElement("div", {
98
+ className: "tip-wrapper"
99
+ }, /*#__PURE__*/React.createElement("span", {
100
+ className: "tip"
101
+ }, "Tip"), " Adjust the width of the canvas with the", " ", /*#__PURE__*/React.createElement("svg", {
102
+ width: "10",
103
+ height: "10",
104
+ viewBox: "0 0 12 12",
105
+ xmlns: "http://www.w3.org/2000/svg"
106
+ }, /*#__PURE__*/React.createElement("g", {
107
+ fill: "none",
108
+ fillRule: "evenodd"
109
+ }, /*#__PURE__*/React.createElement("path", {
110
+ d: "M1.5 5.2h4.8c.3 0 .5.2.5.4v5.1c-.1.2-.3.3-.4.3H1.4a.5.5 0 01-.5-.4V5.7c0-.3.2-.5.5-.5zm0-2.1h6.9c.3 0 .5.2.5.4v7a.5.5 0 01-1 0V4H1.5a.5.5 0 010-1zm0-2.1h9c.3 0 .5.2.5.4v9.1a.5.5 0 01-1 0V2H1.5a.5.5 0 010-1zm4.3 5.2H2V10h3.8V6.2z",
111
+ id: "a",
112
+ fill: "#999"
113
+ }))), "Viewports addon in the toolbar")));
114
+ };
115
+
116
+ export { Button, Header, Page };
@@ -0,0 +1 @@
1
+ .storybook-button{border:0;border-radius:3em;cursor:pointer;display:inline-block;font-family:Nunito Sans,Helvetica Neue,Helvetica,Arial,sans-serif;font-weight:700;line-height:1}.storybook-button--primary{background-color:#1ea7fd;color:#fff}.storybook-button--secondary{background-color:transparent;box-shadow:inset 0 0 0 1px rgba(0,0,0,.15);color:#333}.storybook-button--small{font-size:12px;padding:10px 16px}.storybook-button--medium{font-size:14px;padding:11px 20px}.storybook-button--large{font-size:16px;padding:12px 24px}.storybook-header{align-items:center;border-bottom:1px solid rgba(0,0,0,.1);display:flex;font-family:Nunito Sans,Helvetica Neue,Helvetica,Arial,sans-serif;justify-content:space-between;padding:15px 20px}.storybook-header h1,.storybook-header svg{display:inline-block;vertical-align:top}.storybook-header h1{font-size:20px;font-weight:700;line-height:1;margin:6px 0 6px 10px}.storybook-header button+button{margin-left:10px}.storybook-header .welcome{color:#333;font-size:14px;margin-right:10px}.storybook-page{color:#333;font-family:Nunito Sans,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:14px;line-height:24px;margin:0 auto;max-width:600px;padding:48px 20px}.storybook-page h2{display:inline-block;font-size:32px;font-weight:700;line-height:1;margin:0 0 4px;vertical-align:top}.storybook-page p{margin:1em 0}.storybook-page a{color:#1ea7fd;text-decoration:none}.storybook-page ul{margin:1em 0;padding-left:30px}.storybook-page li{margin-bottom:8px}.storybook-page .tip{background:#e7fdd8;border-radius:1em;color:#66bf3c;display:inline-block;font-size:11px;font-weight:700;line-height:12px;margin-right:10px;padding:4px 12px;vertical-align:top}.storybook-page .tip-wrapper{font-size:13px;line-height:20px;margin-bottom:40px;margin-top:40px}.storybook-page .tip-wrapper svg{display:inline-block;height:12px;margin-right:4px;margin-top:3px;vertical-align:top;width:12px}.storybook-page .tip-wrapper svg path{fill:#1ea7fd}
@@ -0,0 +1,23 @@
1
+ import type { StoryObj } from "@storybook/react";
2
+ declare const meta: {
3
+ title: string;
4
+ component: ({ primary, size, backgroundColor, label, ...props }: import(".").ButtonProps) => import("react/jsx-runtime").JSX.Element;
5
+ parameters: {
6
+ layout: string;
7
+ };
8
+ tags: string[];
9
+ argTypes: {
10
+ backgroundColor: {
11
+ control: "color";
12
+ };
13
+ };
14
+ args: {
15
+ onClick: import("@vitest/spy").Mock<(...args: any[]) => any>;
16
+ };
17
+ };
18
+ export default meta;
19
+ type Story = StoryObj<typeof meta>;
20
+ export declare const Primary: Story;
21
+ export declare const Secondary: Story;
22
+ export declare const Large: Story;
23
+ export declare const Small: Story;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ import "./button.css";
2
+ export interface ButtonProps {
3
+ /** Is this the principal call to action on the page? */
4
+ primary?: boolean;
5
+ /** What background color to use */
6
+ backgroundColor?: string;
7
+ /** How large should the button be? */
8
+ size?: "small" | "medium" | "large";
9
+ /** Button contents */
10
+ label: string;
11
+ /** Optional click handler */
12
+ onClick?: () => void;
13
+ }
14
+ /** Primary UI component for user interaction */
15
+ declare const Button: ({ primary, size, backgroundColor, label, ...props }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
16
+ export default Button;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,18 @@
1
+ import type { StoryObj } from "@storybook/react";
2
+ declare const meta: {
3
+ title: string;
4
+ component: ({ user, onLogin, onLogout, onCreateAccount }: import(".").HeaderProps) => import("react/jsx-runtime").JSX.Element;
5
+ tags: string[];
6
+ parameters: {
7
+ layout: string;
8
+ };
9
+ args: {
10
+ onLogin: import("@vitest/spy").Mock<(...args: any[]) => any>;
11
+ onLogout: import("@vitest/spy").Mock<(...args: any[]) => any>;
12
+ onCreateAccount: import("@vitest/spy").Mock<(...args: any[]) => any>;
13
+ };
14
+ };
15
+ export default meta;
16
+ type Story = StoryObj<typeof meta>;
17
+ export declare const LoggedIn: Story;
18
+ export declare const LoggedOut: Story;
@@ -0,0 +1,12 @@
1
+ import "./header.css";
2
+ type User = {
3
+ name: string;
4
+ };
5
+ export interface HeaderProps {
6
+ user?: User;
7
+ onLogin?: () => void;
8
+ onLogout?: () => void;
9
+ onCreateAccount?: () => void;
10
+ }
11
+ declare const Header: ({ user, onLogin, onLogout, onCreateAccount }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
12
+ export default Header;
@@ -0,0 +1,12 @@
1
+ import type { StoryObj } from "@storybook/react";
2
+ declare const meta: {
3
+ title: string;
4
+ component: import("react").FC<{}>;
5
+ parameters: {
6
+ layout: string;
7
+ };
8
+ };
9
+ export default meta;
10
+ type Story = StoryObj<typeof meta>;
11
+ export declare const LoggedOut: Story;
12
+ export declare const LoggedIn: Story;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import "./page.css";
3
+ declare const Page: React.FC;
4
+ export default Page;
@@ -0,0 +1,3 @@
1
+ export { default as Button } from "./Button";
2
+ export { default as Header } from "./Header";
3
+ export { default as Page } from "./Page";
@@ -0,0 +1 @@
1
+ export * from "./components";
@@ -0,0 +1 @@
1
+ import "@testing-library/jest-dom";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@adiba-banking-cloud/backoffice",
3
3
  "author": "TUROG Technologies",
4
- "version": "0.0.2",
4
+ "version": "0.0.4",
5
5
  "description": "An ADIBA component library for backoffice and dashboard applications",
6
6
  "license": "ISC",
7
7
  "main": "build/index.cjs.js",
@@ -28,8 +28,15 @@
28
28
  "sideEffects": false,
29
29
  "types": "build/typings/index.d.ts",
30
30
  "peerDependencies": {
31
- "react": ">=19",
32
- "react-dom": ">=19"
31
+ "react": ">=18",
32
+ "react-dom": ">=18",
33
+ "@fontsource/poppins": "^5.1.0",
34
+ "@hello-pangea/dnd": "^16.5.0",
35
+ "@mantine/core": "^7.12.2",
36
+ "@mantine/hooks": "^7.12.2",
37
+ "highcharts-react-official": "^3.2.2",
38
+ "highcharts-rounded-corners": "^1.0.7",
39
+ "iconsax-react": "^0.0.8"
33
40
  },
34
41
  "repository": {
35
42
  "type": "git",
@@ -70,9 +77,9 @@
70
77
  "husky": "^9.1.6",
71
78
  "jest": "^29.5.0",
72
79
  "prettier": "^3.5.3",
73
- "react": "^19.0.0",
80
+ "react": "^18.0.0",
74
81
  "react-docgen-typescript-plugin": "^1.0.5",
75
- "react-dom": "^19.0.0",
82
+ "react-dom": "^18.0.0",
76
83
  "react-scripts": "^5.0.1",
77
84
  "rollup": "^4.24.2",
78
85
  "rollup-plugin-copy": "^3.5.0",
@@ -83,7 +90,14 @@
83
90
  "ts-jest": "^29.0.5",
84
91
  "typescript": "^5.0.2",
85
92
  "typescript-eslint": "^8.12.1",
86
- "vite": "^6.2.1"
93
+ "vite": "^6.2.1",
94
+ "@fontsource/poppins": "^5.1.0",
95
+ "@hello-pangea/dnd": "^16.5.0",
96
+ "@mantine/core": "^7.12.2",
97
+ "@mantine/hooks": "^7.12.2",
98
+ "highcharts-react-official": "^3.2.2",
99
+ "highcharts-rounded-corners": "^1.0.7",
100
+ "iconsax-react": "^0.0.8"
87
101
  },
88
102
  "dependencies": {
89
103
  "@babel/runtime": "^7.21.0"