@nuskin/marketing-components 1.0.0-components-app.1

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/LICENSE.md ADDED
@@ -0,0 +1,15 @@
1
+ ISC License
2
+
3
+ Copyright (c) 2023, Nuskin
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted, provided that the above
7
+ copyright notice and this permission notice appear in all copies.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,48 @@
1
+ # Marketing Components
2
+
3
+ A reusable component library for **Nu Skin marketing applications**, starting with the Foundation Web App and Visual Builder.
4
+ This package extracts shared UI components from the Foundation Web App into a standalone library so they can be reused across microfrontends without duplication.
5
+
6
+ ---
7
+
8
+ ## ✨ Features
9
+
10
+ - Centralized marketing-focused React components
11
+ - Built for SSR-compatible microfrontends
12
+ - Versioned and published as a package
13
+ - Easy to import and extend as new components are added
14
+
15
+ ---
16
+
17
+ ## 📦 Installation
18
+
19
+ ```bash
20
+ # Install from internal/private registry
21
+ yarn add @nuskin/marketing-components
22
+
23
+ 🚀 Usage
24
+ After installing, import components directly into your application:
25
+ import { SimpleText } from '@nuskin/marketing-components';
26
+
27
+ export default function Example() {
28
+ return <SimpleText text="Hello from Marketing Components!" />;
29
+ }
30
+
31
+ 🛠 Development
32
+ Clone the repo:
33
+ git clone https://code.tls.nuskin.io/ns-am/content-foundation/marketing-components.git
34
+ cd marketing-components
35
+ Install dependencies:
36
+ yarn install
37
+ Start Storybook (if enabled):
38
+ yarn storybook
39
+ Build the library:
40
+ yarn build
41
+ Run tests:
42
+ yarn test
43
+
44
+ 📦 Publishing
45
+ This package is published as a pre-release for internal use:
46
+ yarn version --prerelease --preid alpha
47
+ yarn npm publish --tag alpha
48
+ Later releases will be versioned and tagged accordingly (beta, latest).
@@ -0,0 +1,3 @@
1
+ import { ReactElement } from 'react';
2
+ declare const SampleComponent: () => ReactElement;
3
+ export default SampleComponent;
@@ -0,0 +1 @@
1
+ export { default as SampleComponent } from './SampleComponent';
@@ -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/ns-am/content-foundation/marketing-components/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","r","NsButton","onClick"],"mappings":"AAAA,moCAAa,IAAIA,EAAEC,OAAOC,cAAc,CAAC,IAAIC,EAAEF,OAAOG,wBAAwB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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 ADDED
@@ -0,0 +1,114 @@
1
+ {
2
+ "name": "@nuskin/marketing-components",
3
+ "version": "1.0.0-components-app.1",
4
+ "description": "A React based component library for marketing components to use with content stack pagebuilding",
5
+ "types": "dist/index.d.ts",
6
+ "main": "dist/index.js",
7
+ "module": "dist/index.esm.js",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git@code.tls.nuskin.io:ns-am/content-foundation/marketing-components.git"
11
+ },
12
+ "homepage": "https://code.tls.nuskin.io/ns-am/content-foundation/marketing-components",
13
+ "publishConfig": {
14
+ "access": "public"
15
+ },
16
+ "keywords": [
17
+ "react",
18
+ "marketing-components",
19
+ "Content Foundation",
20
+ "cft",
21
+ "Content Stack"
22
+ ],
23
+ "license": "MIT",
24
+ "scripts": {
25
+ "build:package": "tsup",
26
+ "lint": "eslint src",
27
+ "test": "jest --coverage",
28
+ "test:watch": "jest --watch",
29
+ "test:update-snapshot": "jest -u",
30
+ "test:failed": "npx jest --onlyFailures",
31
+ "test:coverage": "jest --coverage",
32
+ "types:check": "tsc --pretty"
33
+ },
34
+ "dependencies": {
35
+ "@types/react": "^18.2.0",
36
+ "@types/react-dom": "^18.2.0",
37
+ "react-circular-progressbar": "^2.1.0",
38
+ "react-dom": "^18.2.0",
39
+ "react-icons": "^4.0.0"
40
+ },
41
+ "devDependencies": {
42
+ "@babel/core": "^7.23.2",
43
+ "@babel/preset-env": "^7.23.2",
44
+ "@babel/preset-react": "^7.22.15",
45
+ "@babel/preset-typescript": "^7.23.2",
46
+ "@nuskin/eslint-config": "^1.0.0-setup.1",
47
+ "@nuskin/foundation-ui-components": "2.0.0",
48
+ "@swc/core": "1.10.15",
49
+ "@testing-library/dom": "10.4.0",
50
+ "@testing-library/jest-dom": "^6.6.3",
51
+ "@testing-library/react": "16.2.0",
52
+ "@types/jest": "^29.5.7",
53
+ "@types/lodash": "^4.14.200",
54
+ "@types/node": "^20.8.7",
55
+ "@types/react-test-renderer": "^18.0.5",
56
+ "@typescript-eslint/eslint-plugin": "^8.28.0",
57
+ "@typescript-eslint/parser": "^8.28.0",
58
+ "babel-jest": "^29.7.0",
59
+ "babel-loader": "^9.1.3",
60
+ "babel-plugin-emotion": "^11.0.0",
61
+ "eslint": "^8.51.0",
62
+ "eslint-config-prettier": "^10.1.1",
63
+ "eslint-plugin-json": "^3.1.0",
64
+ "eslint-plugin-prettier": "^5.2.4",
65
+ "eslint-plugin-react": "^7.37.4",
66
+ "eslint-plugin-spellcheck": "^0.0.20",
67
+ "eslint-plugin-unused-imports": "^4.1.4",
68
+ "jest": "^29.7.0",
69
+ "jest-environment-jsdom": "^29.7.0",
70
+ "prettier": "^3.5.3",
71
+ "react": "^18.2.0",
72
+ "tsup": "8.3.6",
73
+ "typescript": "^5.4.2"
74
+ },
75
+ "peerDependencies": {
76
+ "@nuskin/foundation-ui-components": "2.0.0",
77
+ "react": "^18.2.0",
78
+ "typescript": "^5.4.2"
79
+ },
80
+ "resolutions": {
81
+ "@nuskin/foundation-theme": "1.7.0",
82
+ "esbuild": "0.25.0",
83
+ "@babel/runtime": "7.26.10",
84
+ "@babel/helpers": "7.26.10"
85
+ },
86
+ "files": [
87
+ "dist",
88
+ "README.md",
89
+ "package.json"
90
+ ],
91
+ "readme": "./README.md",
92
+ "exports": {
93
+ ".": {
94
+ "types": "./dist/index.d.ts",
95
+ "import": "./dist/index.mjs",
96
+ "require": "./dist/index.js"
97
+ },
98
+ "./*": {
99
+ "types": "./dist/*/index.d.ts",
100
+ "import": "./dist/*/index.mjs",
101
+ "require": "./dist/*/index.js"
102
+ }
103
+ },
104
+ "typesVersions": {
105
+ "*": {
106
+ "*": [
107
+ "./dist/*/index.d.ts"
108
+ ],
109
+ ".": [
110
+ "./dist/index.d.ts"
111
+ ]
112
+ }
113
+ }
114
+ }