system-one-design 1.0.0
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,51 @@
|
|
|
1
|
+
# system-one-design
|
|
2
|
+
|
|
3
|
+
React design system components built from **Figma System One Token Demo (Flowbite)**. Use these components in your app for consistent, design-token–driven UI.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install system-one-design
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
**Peer dependencies:** `react` and `react-dom` (v17+). Install them if your project doesn’t already have them.
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
1. Import the component(s) and the package styles in your app (e.g. in your root layout or `main.jsx`):
|
|
16
|
+
|
|
17
|
+
```jsx
|
|
18
|
+
import { Button } from 'system-one-design';
|
|
19
|
+
import 'system-one-design/style.css';
|
|
20
|
+
|
|
21
|
+
function App() {
|
|
22
|
+
return (
|
|
23
|
+
<div>
|
|
24
|
+
<Button>Click me</Button>
|
|
25
|
+
<Button onClick={() => alert('Hi')}>Alert</Button>
|
|
26
|
+
</div>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
2. Use the stylesheet once per app (e.g. in your entry file or root layout). The CSS is required for components to look correct.
|
|
32
|
+
|
|
33
|
+
## Components
|
|
34
|
+
|
|
35
|
+
- **Button** – Primary button (blue, rounded). Supports `children`, `onClick`, `type`, `disabled`, `className`, and other native `button` props.
|
|
36
|
+
|
|
37
|
+
## Development
|
|
38
|
+
|
|
39
|
+
- `npm run build` – Build the library into `dist/`
|
|
40
|
+
- `npm run dev` – Run the local demo app (Vite dev server)
|
|
41
|
+
- `npm run preview` – Preview the demo app production build
|
|
42
|
+
|
|
43
|
+
## Publishing
|
|
44
|
+
|
|
45
|
+
Before publishing to npm:
|
|
46
|
+
|
|
47
|
+
1. Set `name`, `version`, `description`, `author`, and optionally `repository` in `package.json`.
|
|
48
|
+
2. Run `npm run build`. `prepublishOnly` runs this automatically on `npm publish`.
|
|
49
|
+
3. Publish: `npm publish` (or `npm publish --access public` for a scoped package like `@yourscope/system-one-design`).
|
|
50
|
+
|
|
51
|
+
Only the `dist` folder is included in the published package (`files` in `package.json`).
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),a=({children:t="Button",onClick:e,type:n="button",disabled:o=!1,className:u="",...s})=>r.jsx("button",{type:n,onClick:e,disabled:o,className:`figma-button ${u}`,...s,children:t});exports.Button=a;
|
|
2
|
+
//# sourceMappingURL=system-one-design.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system-one-design.cjs","sources":["../src/components/Button.jsx"],"sourcesContent":["/**\n * Button component – from Figma System One Token Demo (Flowbite)\n * Node: 11385-3248\n * Design: Primary blue rounded button with white text\n */\nimport './Button.css';\n\nconst Button = ({\n children = 'Button',\n onClick,\n type = 'button',\n disabled = false,\n className = '',\n ...props\n}) => {\n return (\n <button\n type={type}\n onClick={onClick}\n disabled={disabled}\n className={`figma-button ${className}`}\n {...props}\n >\n {children}\n </button>\n );\n};\n\nexport default Button;\n"],"names":["Button","children","onClick","type","disabled","className","props","jsx"],"mappings":"qHAOMA,EAAS,CAAC,CACd,SAAAC,EAAW,SACX,QAAAC,EACA,KAAAC,EAAO,SACP,SAAAC,EAAW,GACX,UAAAC,EAAY,GACZ,GAAGC,CACL,IAEIC,EAAAA,IAAC,SAAA,CACC,KAAAJ,EACA,QAAAD,EACA,SAAAE,EACA,UAAW,gBAAgBC,CAAS,GACnC,GAAGC,EAEH,SAAAL,CAAA,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.figma-button{display:inline-flex;align-items:center;justify-content:center;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:.875rem;font-weight:500;line-height:1.25rem;color:red;background-color:purple;border:none;border-radius:.5rem;padding:.5rem 1rem;cursor:pointer;transition:background-color .15s ease}.figma-button:hover:not(:disabled){background-color:#2563eb}.figma-button:active:not(:disabled){background-color:#1d4ed8}.figma-button:disabled{opacity:.6;cursor:not-allowed}.figma-button:focus-visible{outline:2px solid #3b82f6;outline-offset:2px}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
const m = ({
|
|
3
|
+
children: t = "Button",
|
|
4
|
+
onClick: o,
|
|
5
|
+
type: n = "button",
|
|
6
|
+
disabled: u = !1,
|
|
7
|
+
className: r = "",
|
|
8
|
+
...s
|
|
9
|
+
}) => /* @__PURE__ */ a(
|
|
10
|
+
"button",
|
|
11
|
+
{
|
|
12
|
+
type: n,
|
|
13
|
+
onClick: o,
|
|
14
|
+
disabled: u,
|
|
15
|
+
className: `figma-button ${r}`,
|
|
16
|
+
...s,
|
|
17
|
+
children: t
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
export {
|
|
21
|
+
m as Button
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=system-one-design.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system-one-design.js","sources":["../src/components/Button.jsx"],"sourcesContent":["/**\n * Button component – from Figma System One Token Demo (Flowbite)\n * Node: 11385-3248\n * Design: Primary blue rounded button with white text\n */\nimport './Button.css';\n\nconst Button = ({\n children = 'Button',\n onClick,\n type = 'button',\n disabled = false,\n className = '',\n ...props\n}) => {\n return (\n <button\n type={type}\n onClick={onClick}\n disabled={disabled}\n className={`figma-button ${className}`}\n {...props}\n >\n {children}\n </button>\n );\n};\n\nexport default Button;\n"],"names":["Button","children","onClick","type","disabled","className","props","jsx"],"mappings":";AAOA,MAAMA,IAAS,CAAC;AAAA,EACd,UAAAC,IAAW;AAAA,EACX,SAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,UAAAC,IAAW;AAAA,EACX,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,MAEI,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,MAAAJ;AAAA,IACA,SAAAD;AAAA,IACA,UAAAE;AAAA,IACA,WAAW,gBAAgBC,CAAS;AAAA,IACnC,GAAGC;AAAA,IAEH,UAAAL;AAAA,EAAA;AAAA;"}
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "system-one-design",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "React design system components built from Figma System One Token Demo (Flowbite)",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/system-one-design.cjs",
|
|
7
|
+
"module": "./dist/system-one-design.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/system-one-design.js",
|
|
11
|
+
"require": "./dist/system-one-design.cjs"
|
|
12
|
+
},
|
|
13
|
+
"./style.css": "./dist/system-one-design.css"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "vite build",
|
|
20
|
+
"dev": "vite",
|
|
21
|
+
"preview": "vite preview",
|
|
22
|
+
"prepublishOnly": "npm run build"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"react": ">=17.0.0",
|
|
26
|
+
"react-dom": ">=17.0.0"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
30
|
+
"react": "^18.3.1",
|
|
31
|
+
"react-dom": "^18.3.1",
|
|
32
|
+
"vite": "^6.0.3"
|
|
33
|
+
},
|
|
34
|
+
"keywords": [
|
|
35
|
+
"react",
|
|
36
|
+
"design-system",
|
|
37
|
+
"components",
|
|
38
|
+
"figma",
|
|
39
|
+
"flowbite",
|
|
40
|
+
"ui"
|
|
41
|
+
],
|
|
42
|
+
"author": "",
|
|
43
|
+
"license": "ISC"
|
|
44
|
+
}
|