@nuskin/react-loyalty-elements 1.0.1 → 1.0.2
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/SampleComponent/SampleComponent.d.ts +3 -0
- package/dist/SampleComponent/SampleComponent.spec.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +32 -14
- package/src/SampleComponent/SampleComponent.spec.tsx +0 -27
- package/src/SampleComponent/SampleComponent.tsx +0 -16
- package/src/index.ts +0 -1
- /package/{src/SampleComponent/index.ts → dist/SampleComponent/index.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SampleComponent';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function r(r,e){if(e==null||e>r.length)e=r.length;for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function e(r){if(Array.isArray(r))return r}function t(r,e){var t=r==null?null:typeof Symbol!=="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(t==null)return;var n=[];var o=true;var u=false;var i,a;try{for(t=t.call(r);!(o=(i=t.next()).done);o=true){n.push(i.value);if(e&&n.length===e)break}}catch(r){u=true;a=r}finally{try{if(!o&&t["return"]!=null)t["return"]()}finally{if(u)throw a}}return n}function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(r,o){return e(r)||t(r,o)||i(r,o)||n()}function u(r){"@swc/helpers - typeof";return r&&typeof Symbol!=="undefined"&&r.constructor===Symbol?"symbol":typeof r}function i(e,t){if(!e)return;if(typeof e==="string")return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor)n=e.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}var a=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var s=function(r,e){for(var t in e)a(r,t,{get:e[t],enumerable:!0})},y=function(r,e,t,n){var o=true,i=false,s=undefined;if(e&&(typeof e==="undefined"?"undefined":u(e))=="object"||typeof e=="function")try{var y=function(){var o=d.value;!f.call(r,o)&&o!==t&&a(r,o,{get:function(){return e[o]},enumerable:!(n=l(e,o))||n.enumerable})};for(var p=c(e)[Symbol.iterator](),d;!(o=(d=p.next()).done);o=true)y()}catch(r){i=true;s=r}finally{try{if(!o&&p.return!=null){p.return()}}finally{if(i){throw s}}}return r};var p=function(r){return y(a({},"__esModule",{value:!0}),r)};var d={};s(d,{SampleComponent:function(){return j}});module.exports=p(d);var m=require("react"),v=require("@nuskin/foundation-ui-components"),b=require("react/jsx-runtime"),h=function(){var r=o((0,m.useState)(0),2),e=r[0],t=r[1];return(0,b.jsxs)("div",{children:[(0,b.jsx)("h1",{children:"Sample Component"}),(0,b.jsxs)("p",{children:["Count: ",e]}),(0,b.jsx)(v.NsButton,{onClick:function(){return t(e+1)},children:"Increment"}),(0,b.jsx)(v.NsButton,{onClick:function(){return t(e-1)},children:"Decrement"})]})},j=h;//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/gitlab-runner-data/builds/nextgen-development/loyalty/npm/react-loyalty-elements/dist/index.js","../src/index.ts","../src/SampleComponent/SampleComponent.tsx"],"names":["p","Object","defineProperty","l","getOwnPropertyDescriptor","s","getOwnPropertyNames","C","prototype","hasOwnProperty","f","e","t","m","get","enumerable","i","u","n","call","d","value","index_exports","__export","SampleComponent","SampleComponent_default","module","exports","__toCommonJS","import_react","require","import_foundation_ui_components","import_jsx_runtime","a","useState","count","setCount","o","jsxs","children","jsx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A,EAAC,MAAA,CACGC,SAAA,CAAA,CAAA,EAAAF,EAAAG,GAAA,EAAC,KAAA,CAAGD,SAAA,kBAAA,GAAgB,CAAA,EACpBF,EAAAC,IAAA,EAAC,IAAA,CAAEC,SAAA,CAAA,UAAQJ,EAAAA,GAAM,CAAA,EACjBE,EAAAG,GAAA,EAACC,EAAAC,QAAA,CAAA,CAASC,QAAS,kBAAMP,EAASD,EAAQ,IAAII,SAAA,WAAA,GAAS,CAAA,EACvDF,EAAAG,GAAA,EAACC,EAAAC,QAAA,CAAA,CAASC,QAAS,kBAAMP,EAASD,EAAQ,IAAII,SAAA,WAAA,GAAS,EAGnE,EACOd,EAAQD","sourcesContent":["\"use strict\";var p=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var f=(e,t)=>{for(var m in t)p(e,m,{get:t[m],enumerable:!0})},i=(e,t,m,u)=>{if(t&&typeof t==\"object\"||typeof t==\"function\")for(let n of s(t))!C.call(e,n)&&n!==m&&p(e,n,{get:()=>t[n],enumerable:!(u=l(t,n))||u.enumerable});return e};var d=e=>i(p({},\"__esModule\",{value:!0}),e);var B={};f(B,{SampleComponent:()=>c});module.exports=d(B);var a=require(\"react\"),r=require(\"@nuskin/foundation-ui-components\"),o=require(\"react/jsx-runtime\"),S=()=>{let[e,t]=(0,a.useState)(0);return(0,o.jsxs)(\"div\",{children:[(0,o.jsx)(\"h1\",{children:\"Sample Component\"}),(0,o.jsxs)(\"p\",{children:[\"Count: \",e]}),(0,o.jsx)(r.NsButton,{onClick:()=>t(e+1),children:\"Increment\"}),(0,o.jsx)(r.NsButton,{onClick:()=>t(e-1),children:\"Decrement\"})]})},c=S;\n","export * from './SampleComponent';\n","import React, { ReactElement, useState } from 'react';\nimport { NsButton } from '@nuskin/foundation-ui-components';\n\nconst SampleComponent = (): ReactElement => {\n const [count, setCount] = useState<number>(0);\n return (\n <div>\n <h1>Sample Component</h1>\n <p>Count: {count}</p>\n <NsButton onClick={() => setCount(count + 1)}>Increment</NsButton>\n <NsButton onClick={() => setCount(count - 1)}>Decrement</NsButton>\n </div>\n );\n};\nexport default SampleComponent;\n"]}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function r(r,t){if(t==null||t>r.length)t=r.length;for(var n=0,e=new Array(t);n<t;n++)e[n]=r[n];return e}function t(r){if(Array.isArray(r))return r}function n(r,t){var n=r==null?null:typeof Symbol!=="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(n==null)return;var e=[];var o=true;var i=false;var a,u;try{for(n=n.call(r);!(o=(a=n.next()).done);o=true){e.push(a.value);if(t&&e.length===t)break}}catch(r){i=true;u=r}finally{try{if(!o&&n["return"]!=null)n["return"]()}finally{if(i)throw u}}return e}function e(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(r,o){return t(r)||n(r,o)||i(r,o)||e()}function i(t,n){if(!t)return;if(typeof t==="string")return r(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor)e=t.constructor.name;if(e==="Map"||e==="Set")return Array.from(e);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return r(t,n)}import{useState as a}from"react";import{NsButton as u}from"@nuskin/foundation-ui-components";import{jsx as l,jsxs as c}from"react/jsx-runtime";var f=function(){var r=o(a(0),2),t=r[0],n=r[1];return c("div",{children:[l("h1",{children:"Sample Component"}),c("p",{children:["Count: ",t]}),l(u,{onClick:function(){return n(t+1)},children:"Increment"}),l(u,{onClick:function(){return n(t-1)},children:"Decrement"})]})},s=f;export{s as SampleComponent};//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/SampleComponent/SampleComponent.tsx"],"names":["useState","NsButton","jsx","jsxs","SampleComponent","count","setCount","children","onClick","SampleComponent_default"],"mappings":"ggCAAA,OAA8BA,YAAAA,CAAAA,KAAgB,OAC9C,QAASC,YAAAA,CAAAA,KAAgB,kCAMb,QAAAC,OAAAA,CAAAA,CACAC,QAAAA,CAAAA,KADA,mBAJZ,CAAA,IAAMC,EAAkB,WACpB,IAA0BJ,IAAAA,EAAiB,MAApCK,EAAmBL,KAAZM,EAAYN,KAC1B,OACIG,EAAC,MAAA,CACGI,SAAA,CAAAL,EAAC,KAAA,CAAGK,SAAA,kBAAA,GACJJ,EAAC,IAAA,CAAEI,SAAA,CAAA,UAAQF,EAAAA,GACXH,EAACD,EAAA,CAASO,QAAS,kBAAMF,EAASD,EAAQ,IAAIE,SAAA,WAAA,GAC9CL,EAACD,EAAA,CAASO,QAAS,kBAAMF,EAASD,EAAQ,IAAIE,SAAA,WAAA,GAAS,EAGnE,EACOE,EAAQL,SAAAA,KAAAA,eAAAA","sourcesContent":["import React, { ReactElement, useState } from 'react';\nimport { NsButton } from '@nuskin/foundation-ui-components';\n\nconst SampleComponent = (): ReactElement => {\n const [count, setCount] = useState<number>(0);\n return (\n <div>\n <h1>Sample Component</h1>\n <p>Count: {count}</p>\n <NsButton onClick={() => setCount(count + 1)}>Increment</NsButton>\n <NsButton onClick={() => setCount(count - 1)}>Decrement</NsButton>\n </div>\n );\n};\nexport default SampleComponent;\n"]}
|
package/package.json
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuskin/react-loyalty-elements",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "A React based component library for reusable Nextgen Loyalty component",
|
|
5
|
-
"
|
|
5
|
+
"types": "dist/index.d.ts",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"module": "dist/index.esm.js",
|
|
6
8
|
"repository": {
|
|
7
9
|
"type": "git",
|
|
8
10
|
"url": "git@code.tls.nuskin.io:nextgen-development/loyalty/npm/react-loyalty-elements.git"
|
|
@@ -19,18 +21,21 @@
|
|
|
19
21
|
],
|
|
20
22
|
"license": "MIT",
|
|
21
23
|
"scripts": {
|
|
22
|
-
"
|
|
24
|
+
"build:package": "tsup",
|
|
25
|
+
"lint": "eslint src",
|
|
23
26
|
"test": "jest --coverage",
|
|
24
27
|
"test:watch": "jest --watch",
|
|
25
28
|
"test:update-snapshot": "jest -u",
|
|
26
29
|
"test:failed": "npx jest --onlyFailures",
|
|
27
30
|
"test:coverage": "jest --coverage",
|
|
28
|
-
"types:check": "tsc --pretty
|
|
31
|
+
"types:check": "tsc --pretty"
|
|
29
32
|
},
|
|
30
33
|
"dependencies": {
|
|
31
34
|
"@types/react": "^18.2.0",
|
|
32
35
|
"@types/react-dom": "^18.2.0",
|
|
33
|
-
"react-
|
|
36
|
+
"react-circular-progressbar": "^2.1.0",
|
|
37
|
+
"react-dom": "^18.2.0",
|
|
38
|
+
"react-icons": "^4.0.0"
|
|
34
39
|
},
|
|
35
40
|
"devDependencies": {
|
|
36
41
|
"@babel/core": "^7.23.2",
|
|
@@ -38,36 +43,49 @@
|
|
|
38
43
|
"@babel/preset-react": "^7.22.15",
|
|
39
44
|
"@babel/preset-typescript": "^7.23.2",
|
|
40
45
|
"@nuskin/eslint-config": "^1.0.0-setup.1",
|
|
41
|
-
"@nuskin/foundation-ui-components": "
|
|
42
|
-
"@
|
|
43
|
-
"@testing-library/
|
|
44
|
-
"@testing-library/
|
|
46
|
+
"@nuskin/foundation-ui-components": "2.0.0",
|
|
47
|
+
"@swc/core": "1.10.15",
|
|
48
|
+
"@testing-library/dom": "10.4.0",
|
|
49
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
50
|
+
"@testing-library/react": "16.2.0",
|
|
45
51
|
"@types/jest": "^29.5.7",
|
|
46
52
|
"@types/lodash": "^4.14.200",
|
|
47
53
|
"@types/node": "^20.8.7",
|
|
48
54
|
"@types/react-test-renderer": "^18.0.5",
|
|
55
|
+
"@typescript-eslint/eslint-plugin": "^8.28.0",
|
|
56
|
+
"@typescript-eslint/parser": "^8.28.0",
|
|
49
57
|
"babel-jest": "^29.7.0",
|
|
50
58
|
"babel-loader": "^9.1.3",
|
|
51
59
|
"babel-plugin-emotion": "^11.0.0",
|
|
52
60
|
"eslint": "^8.51.0",
|
|
53
|
-
"eslint-config-prettier": "^
|
|
61
|
+
"eslint-config-prettier": "^10.1.1",
|
|
54
62
|
"eslint-plugin-json": "^3.1.0",
|
|
55
|
-
"eslint-plugin-prettier": "^5.
|
|
63
|
+
"eslint-plugin-prettier": "^5.2.4",
|
|
64
|
+
"eslint-plugin-react": "^7.37.4",
|
|
65
|
+
"eslint-plugin-spellcheck": "^0.0.20",
|
|
66
|
+
"eslint-plugin-unused-imports": "^4.1.4",
|
|
56
67
|
"jest": "^29.7.0",
|
|
57
68
|
"jest-environment-jsdom": "^29.7.0",
|
|
69
|
+
"prettier": "^3.5.3",
|
|
58
70
|
"react": "^18.2.0",
|
|
71
|
+
"tsup": "8.3.6",
|
|
59
72
|
"typescript": "^5.4.2"
|
|
60
73
|
},
|
|
61
74
|
"peerDependencies": {
|
|
62
|
-
"@nuskin/foundation-ui-components": "
|
|
75
|
+
"@nuskin/foundation-ui-components": "2.0.0",
|
|
63
76
|
"react": "^18.2.0",
|
|
64
77
|
"typescript": "^5.4.2"
|
|
65
78
|
},
|
|
66
79
|
"resolutions": {
|
|
67
|
-
"@nuskin/foundation-theme": "1.
|
|
80
|
+
"@nuskin/foundation-theme": "1.7.0",
|
|
81
|
+
"esbuild": "0.25.0",
|
|
82
|
+
"@babel/runtime": "7.26.10",
|
|
83
|
+
"@babel/helpers": "7.26.10"
|
|
68
84
|
},
|
|
69
85
|
"files": [
|
|
70
|
-
"
|
|
86
|
+
"dist",
|
|
87
|
+
"README.md",
|
|
88
|
+
"package.json"
|
|
71
89
|
],
|
|
72
90
|
"readme": "./README.md"
|
|
73
91
|
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render, screen, fireEvent } from '@testing-library/react';
|
|
3
|
-
import SampleComponent from './SampleComponent';
|
|
4
|
-
|
|
5
|
-
describe('NsInputField', () => {
|
|
6
|
-
it('should render component', () => {
|
|
7
|
-
render(<SampleComponent />);
|
|
8
|
-
const sampleComponent = screen.getByText('Sample Component');
|
|
9
|
-
expect(sampleComponent).toBeTruthy();
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
it('should increment count', () => {
|
|
13
|
-
render(<SampleComponent />);
|
|
14
|
-
const incrementButton = screen.getByText('Increment');
|
|
15
|
-
fireEvent.click(incrementButton);
|
|
16
|
-
const count = screen.getByText('Count: 1');
|
|
17
|
-
expect(count).toBeTruthy();
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it('should decrement count', () => {
|
|
21
|
-
render(<SampleComponent />);
|
|
22
|
-
const decrementButton = screen.getByText('Decrement');
|
|
23
|
-
fireEvent.click(decrementButton);
|
|
24
|
-
const count = screen.getByText('Count: -1');
|
|
25
|
-
expect(count).toBeTruthy();
|
|
26
|
-
});
|
|
27
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React, { ReactElement, useState } from 'react';
|
|
2
|
-
import { NsButton } from '@nuskin/foundation-ui-components';
|
|
3
|
-
|
|
4
|
-
const SampleComponent = (): ReactElement => {
|
|
5
|
-
const [count, setCount] = useState<number>(0);
|
|
6
|
-
|
|
7
|
-
return (
|
|
8
|
-
<div>
|
|
9
|
-
<h1>Sample Component</h1>
|
|
10
|
-
<p>Count: {count}</p>
|
|
11
|
-
<NsButton onClick={() => setCount(count + 1)}>Increment</NsButton>
|
|
12
|
-
<NsButton onClick={() => setCount(count - 1)}>Decrement</NsButton>
|
|
13
|
-
</div>
|
|
14
|
-
);
|
|
15
|
-
};
|
|
16
|
-
export default SampleComponent;
|
package/src/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './SampleComponent';
|
|
File without changes
|