@sparkstudio/accounts-ui 1.1.54 → 1.1.56

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/dist/index.cjs CHANGED
@@ -79,6 +79,7 @@ var SparkStudioAccountsSDK = class {
79
79
  };
80
80
 
81
81
  // src/components/TestButton.tsx
82
+ var import_common_ui = require("@sparkstudio/common-ui");
82
83
  var import_jsx_runtime = require("react/jsx-runtime");
83
84
  function TestButton({ className = "" }) {
84
85
  const [loading, setLoading] = (0, import_react.useState)(false);
@@ -99,26 +100,26 @@ ${err?.message ?? err}`);
99
100
  setLoading(false);
100
101
  }
101
102
  };
102
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `w-100 text-center mb-3 ${className}`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
103
- "button",
104
- {
105
- type: "button",
106
- className: "btn btn-primary btn-lg",
107
- onClick: handleClick,
108
- disabled: loading,
109
- children: loading ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
110
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
111
- "span",
112
- {
113
- className: "spinner-border spinner-border-sm me-2",
114
- role: "status",
115
- "aria-hidden": "true"
116
- }
117
- ),
118
- "Loading..."
119
- ] }) : "Test"
120
- }
121
- ) });
103
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `w-100 text-center mb-3 ${className}`, children: [
104
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_common_ui.Button, { onClick: handleClick, disabled: loading, children: loading ? "Loading..." : "Test" }),
105
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
106
+ import_common_ui.Button,
107
+ {
108
+ loadingText: "We are waiting...",
109
+ onAction: async () => {
110
+ await new Promise((resolve) => setTimeout(resolve, 2e3));
111
+ return "Finished after 2 seconds!";
112
+ },
113
+ onDone: (msg) => {
114
+ alert(msg);
115
+ },
116
+ onError: (err) => {
117
+ alert("Something went wrong: " + err);
118
+ },
119
+ children: "My test button"
120
+ }
121
+ )
122
+ ] });
122
123
  }
123
124
  // Annotate the CommonJS export names for ESM import in node:
124
125
  0 && (module.exports = {
package/dist/index.css ADDED
@@ -0,0 +1,3 @@
1
+ @import "/node_modules/@sparkstudio/common-ui/dist/index.css";
2
+
3
+ /*# sourceMappingURL=index.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sourceRoot":"","sources":["../src/index.scss"],"names":[],"mappings":"AAAQ","file":"index.css"}
package/dist/index.js CHANGED
@@ -53,7 +53,8 @@ var SparkStudioAccountsSDK = class {
53
53
  };
54
54
 
55
55
  // src/components/TestButton.tsx
56
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
56
+ import { Button } from "@sparkstudio/common-ui";
57
+ import { jsx, jsxs } from "react/jsx-runtime";
57
58
  function TestButton({ className = "" }) {
58
59
  const [loading, setLoading] = useState(false);
59
60
  const handleClick = async () => {
@@ -73,26 +74,26 @@ ${err?.message ?? err}`);
73
74
  setLoading(false);
74
75
  }
75
76
  };
76
- return /* @__PURE__ */ jsx("div", { className: `w-100 text-center mb-3 ${className}`, children: /* @__PURE__ */ jsx(
77
- "button",
78
- {
79
- type: "button",
80
- className: "btn btn-primary btn-lg",
81
- onClick: handleClick,
82
- disabled: loading,
83
- children: loading ? /* @__PURE__ */ jsxs(Fragment, { children: [
84
- /* @__PURE__ */ jsx(
85
- "span",
86
- {
87
- className: "spinner-border spinner-border-sm me-2",
88
- role: "status",
89
- "aria-hidden": "true"
90
- }
91
- ),
92
- "Loading..."
93
- ] }) : "Test"
94
- }
95
- ) });
77
+ return /* @__PURE__ */ jsxs("div", { className: `w-100 text-center mb-3 ${className}`, children: [
78
+ /* @__PURE__ */ jsx(Button, { onClick: handleClick, disabled: loading, children: loading ? "Loading..." : "Test" }),
79
+ /* @__PURE__ */ jsx(
80
+ Button,
81
+ {
82
+ loadingText: "We are waiting...",
83
+ onAction: async () => {
84
+ await new Promise((resolve) => setTimeout(resolve, 2e3));
85
+ return "Finished after 2 seconds!";
86
+ },
87
+ onDone: (msg) => {
88
+ alert(msg);
89
+ },
90
+ onError: (err) => {
91
+ alert("Something went wrong: " + err);
92
+ },
93
+ children: "My test button"
94
+ }
95
+ )
96
+ ] });
96
97
  }
97
98
  export {
98
99
  TestButton
package/package.json CHANGED
@@ -1,23 +1,30 @@
1
1
  {
2
2
  "name": "@sparkstudio/accounts-ui",
3
- "version": "1.1.54",
3
+ "version": "1.1.56",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs",
6
- "module": "dist/index.mjs",
6
+ "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "exports": {
9
9
  ".": {
10
10
  "types": "./dist/index.d.ts",
11
- "import": "./dist/index.mjs",
11
+ "import": "./dist/index.js",
12
12
  "require": "./dist/index.cjs"
13
- }
13
+ },
14
+ "./dist/index.css": "./dist/index.css"
14
15
  },
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "sideEffects": [
20
+ "./dist/index.css"
21
+ ],
15
22
  "publishConfig": {
16
23
  "access": "public"
17
24
  },
18
25
  "scripts": {
19
26
  "dev": "vite",
20
- "build": "tsup src/index.ts --format cjs,esm --dts --tsconfig tsconfig.lib.json",
27
+ "build": "tsup src/index.ts --format cjs,esm --dts --tsconfig tsconfig.lib.json && sass --load-path=node_modules src/index.scss dist/index.css",
21
28
  "lint": "eslint .",
22
29
  "preview": "vite preview",
23
30
  "start": "vite"
@@ -27,12 +34,7 @@
27
34
  "react-dom": "18.3.1"
28
35
  },
29
36
  "dependencies": {
30
- "@fortawesome/fontawesome-free": "^7.1.0",
31
- "@popperjs/core": "^2.11.8",
32
- "bootstrap": "^5.3.8",
33
- "highcharts": "^12.4.0",
34
- "highcharts-react-official": "^3.2.3",
35
- "tsup": "^8.5.1"
37
+ "@sparkstudio/common-ui": "^1.0.5"
36
38
  },
37
39
  "devDependencies": {
38
40
  "@eslint/js": "^9.36.0",
@@ -44,6 +46,7 @@
44
46
  "eslint-plugin-react-hooks": "^5.2.0",
45
47
  "eslint-plugin-react-refresh": "^0.4.22",
46
48
  "globals": "^16.4.0",
49
+ "tsup": "^8.5.1",
47
50
  "typescript": "~5.9.3",
48
51
  "typescript-eslint": "^8.45.0",
49
52
  "vite": "^7.1.7"
package/eslint.config.js DELETED
@@ -1,23 +0,0 @@
1
- import js from '@eslint/js'
2
- import globals from 'globals'
3
- import reactHooks from 'eslint-plugin-react-hooks'
4
- import reactRefresh from 'eslint-plugin-react-refresh'
5
- import tseslint from 'typescript-eslint'
6
- import { defineConfig, globalIgnores } from 'eslint/config'
7
-
8
- export default defineConfig([
9
- globalIgnores(['dist']),
10
- {
11
- files: ['**/*.{ts,tsx}'],
12
- extends: [
13
- js.configs.recommended,
14
- tseslint.configs.recommended,
15
- reactHooks.configs['recommended-latest'],
16
- reactRefresh.configs.vite,
17
- ],
18
- languageOptions: {
19
- ecmaVersion: 2020,
20
- globals: globals.browser,
21
- },
22
- },
23
- ])
package/index.html DELETED
@@ -1,13 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- <title>my-stockmarket-simulator</title>
8
- </head>
9
- <body>
10
- <div id="root"></div>
11
- <script type="module" src="/src/main.tsx"></script>
12
- </body>
13
- </html>
package/public/vite.svg DELETED
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
Binary file