hans-ui-design-lib 0.0.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/README.md +150 -0
- package/dist/hans-ui-design-lib.css +1 -0
- package/dist/index.cjs.js +22 -0
- package/dist/index.es.js +305 -0
- package/dist/vite.svg +1 -0
- package/package.json +85 -0
package/README.md
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# Hans UI Design Library
|
|
2
|
+
|
|
3
|
+
A **React + TypeScript component library** that serves as the base design system for my personal projects.
|
|
4
|
+
This library provides reusable, styled and documented UI components with a consistent structure and best practices.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## ๐ Features
|
|
9
|
+
|
|
10
|
+
- โ๏ธ **React 19** with **TypeScript** for type safety
|
|
11
|
+
- ๐จ **TailwindCSS + SCSS** for styling flexibility
|
|
12
|
+
- ๐ **Storybook** for interactive component documentation
|
|
13
|
+
- โ
**Vitest + React Testing Library + JSDOM** for unit and integration testing
|
|
14
|
+
- ๐ **Test Coverage (V8)** with HTML reports
|
|
15
|
+
- ๐งน **ESLint + Prettier** for code quality and formatting
|
|
16
|
+
- โก **Vite** as the bundler for fast builds and DX
|
|
17
|
+
- ๐ Ready to be published and consumed via **npm**
|
|
18
|
+
- ๐ Documentation ready to be used (deployed by **Vercel**) at https://hans-ui-design-lib.vercel.app/
|
|
19
|
+
- **Node Version to build this project: 22.18.0 and npm 10.9.3**
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## ๐ฆ Installation
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install hans-ui-design-lib
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## ๐ ๏ธ Usage
|
|
32
|
+
|
|
33
|
+
```tsx
|
|
34
|
+
import { Button } from 'hans-ui-design-lib';
|
|
35
|
+
|
|
36
|
+
function App() {
|
|
37
|
+
return <Button>Click me</Button>;
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## ๐งโ๐ป Development
|
|
44
|
+
|
|
45
|
+
Clone the repo and install dependencies:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
git clone https://github.com/Hanszman/hans-ui-design-lib.git
|
|
49
|
+
cd hans-ui-design-lib
|
|
50
|
+
npm install
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Start the dev server:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
npm run dev
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Run tests:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
npm test
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Run tests with coverage:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
npm run test:coverage
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Lint code:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
npm run lint
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Build the package:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
npm run build
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## ๐ Documentation
|
|
86
|
+
|
|
87
|
+
The components are documented using **Storybook**.
|
|
88
|
+
|
|
89
|
+
Run Storybook:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
npm run storybook
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
To build the static documentation:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
npm run build-storybook
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## ๐ข Publishing to npm
|
|
104
|
+
|
|
105
|
+
Make sure you are logged in to npm:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
npm login
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Then build and publish:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
npm run build
|
|
115
|
+
npm publish
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## ๐ ๏ธ Tech Stack
|
|
121
|
+
|
|
122
|
+
- **React 19**
|
|
123
|
+
- **TypeScript**
|
|
124
|
+
- **Vite**
|
|
125
|
+
- **Storybook**
|
|
126
|
+
- **TailwindCSS**
|
|
127
|
+
- **SCSS**
|
|
128
|
+
- **Vitest**
|
|
129
|
+
- **React Testing Library**
|
|
130
|
+
- **JSDOM**
|
|
131
|
+
- **ESLint (flat config)**
|
|
132
|
+
- **Prettier**
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## ๐ History of commands used to build this project:
|
|
137
|
+
|
|
138
|
+
```
|
|
139
|
+
npm create vite@latest my-ui -- --template react-ts
|
|
140
|
+
|
|
141
|
+
npm i -D eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-config-prettier eslint-plugin-react eslint-plugin-react-hooks prettier
|
|
142
|
+
|
|
143
|
+
npm i -D tailwindcss @tailwindcss/vite
|
|
144
|
+
|
|
145
|
+
npx storybook@latest init --builder @storybook/builder-vite
|
|
146
|
+
|
|
147
|
+
npm i -D vitest @testing-library/react @testing-library/jest-dom @types/testing-library\_\_jest-dom jsdom
|
|
148
|
+
|
|
149
|
+
npm i -D sass
|
|
150
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.storybook-button{display:inline-block;cursor:pointer;border:0;border-radius:3em;font-weight:700;line-height:1;font-family:Nunito Sans,Helvetica Neue,Helvetica,Arial,sans-serif}.storybook-button--primary{background-color:#555ab9;color:#fff}.storybook-button--secondary{box-shadow:#00000026 0 0 0 1px inset;background-color:transparent;color:#333}.storybook-button--small{padding:10px 16px;font-size:12px}.storybook-button--medium{padding:11px 20px;font-size:14px}.storybook-button--large{padding:12px 24px;font-size:16px}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ee=require("react");var T={exports:{}},_={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var I;function re(){if(I)return _;I=1;var c=Symbol.for("react.transitional.element"),d=Symbol.for("react.fragment");function i(f,a,s){var b=null;if(s!==void 0&&(b=""+s),a.key!==void 0&&(b=""+a.key),"key"in a){s={};for(var E in a)E!=="key"&&(s[E]=a[E])}else s=a;return a=s.ref,{$$typeof:c,type:f,key:b,ref:a!==void 0?a:null,props:s}}return _.Fragment=d,_.jsx=i,_.jsxs=i,_}var R={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var F;function te(){return F||(F=1,process.env.NODE_ENV!=="production"&&(function(){function c(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Z?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case p:return"Fragment";case q:return"Profiler";case U:return"StrictMode";case G:return"Suspense";case X:return"SuspenseList";case H:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case W:return"Portal";case z:return(e.displayName||"Context")+".Provider";case J:return(e._context.displayName||"Context")+".Consumer";case V:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case B:return r=e.displayName||null,r!==null?r:c(e.type)||"Memo";case g:r=e._payload,e=e._init;try{return c(e(r))}catch{}}return null}function d(e){return""+e}function i(e){try{d(e);var r=!1}catch{r=!0}if(r){r=console;var t=r.error,n=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",n),d(e)}}function f(e){if(e===p)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===g)return"<...>";try{var r=c(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function a(){var e=k.A;return e===null?null:e.getOwner()}function s(){return Error("react-stack-top-frame")}function b(e){if(x.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function E(e,r){function t(){h||(h=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}function M(){var e=c(this.type);return N[e]||(N[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function L(e,r,t,n,l,u,S,y){return t=u.ref,e={$$typeof:w,type:e,key:r,props:u,_owner:l},(t!==void 0?t:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:M}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:S}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:y}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function P(e,r,t,n,l,u,S,y){var o=r.children;if(o!==void 0)if(n)if(Q(o)){for(n=0;n<o.length;n++)j(o[n]);Object.freeze&&Object.freeze(o)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else j(o);if(x.call(r,"key")){o=c(e);var m=Object.keys(r).filter(function(K){return K!=="key"});n=0<m.length?"{key: someKey, "+m.join(": ..., ")+": ...}":"{key: someKey}",$[o+n]||(m=0<m.length?"{"+m.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
|
+
let props = %s;
|
|
19
|
+
<%s {...props} />
|
|
20
|
+
React keys must be passed directly to JSX without using spread:
|
|
21
|
+
let props = %s;
|
|
22
|
+
<%s key={someKey} {...props} />`,n,o,m,o),$[o+n]=!0)}if(o=null,t!==void 0&&(i(t),o=""+t),b(r)&&(i(r.key),o=""+r.key),"key"in r){t={};for(var A in r)A!=="key"&&(t[A]=r[A])}else t=r;return o&&E(t,typeof e=="function"?e.displayName||e.name||"Unknown":e),L(e,o,u,l,a(),t,S,y)}function j(e){typeof e=="object"&&e!==null&&e.$$typeof===w&&e._store&&(e._store.validated=1)}var v=ee,w=Symbol.for("react.transitional.element"),W=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),U=Symbol.for("react.strict_mode"),q=Symbol.for("react.profiler"),J=Symbol.for("react.consumer"),z=Symbol.for("react.context"),V=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),X=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),Z=Symbol.for("react.client.reference"),k=v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,x=Object.prototype.hasOwnProperty,Q=Array.isArray,O=console.createTask?console.createTask:function(){return null};v={react_stack_bottom_frame:function(e){return e()}};var h,N={},C=v.react_stack_bottom_frame.bind(v,s)(),Y=O(f(s)),$={};R.Fragment=p,R.jsx=function(e,r,t,n,l){var u=1e4>k.recentlyCreatedOwnerStacks++;return P(e,r,t,!1,n,l,u?Error("react-stack-top-frame"):C,u?O(f(e)):Y)},R.jsxs=function(e,r,t,n,l){var u=1e4>k.recentlyCreatedOwnerStacks++;return P(e,r,t,!0,n,l,u?Error("react-stack-top-frame"):C,u?O(f(e)):Y)}})()),R}var D;function ne(){return D||(D=1,process.env.NODE_ENV==="production"?T.exports=re():T.exports=te()),T.exports}var oe=ne();const ae=({primary:c=!1,size:d="medium",backgroundColor:i,label:f,...a})=>{const s=c?"storybook-button--primary":"storybook-button--secondary";return oe.jsx("button",{type:"button",className:["storybook-button",`storybook-button--${d}`,s].join(" "),style:{backgroundColor:i},...a,children:f})};exports.Button=ae;
|
package/dist/index.es.js
ADDED
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
import ee from "react";
|
|
2
|
+
var T = { exports: {} }, _ = {};
|
|
3
|
+
/**
|
|
4
|
+
* @license React
|
|
5
|
+
* react-jsx-runtime.production.js
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the MIT license found in the
|
|
10
|
+
* LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/
|
|
12
|
+
var I;
|
|
13
|
+
function re() {
|
|
14
|
+
if (I) return _;
|
|
15
|
+
I = 1;
|
|
16
|
+
var c = Symbol.for("react.transitional.element"), m = Symbol.for("react.fragment");
|
|
17
|
+
function i(f, a, s) {
|
|
18
|
+
var b = null;
|
|
19
|
+
if (s !== void 0 && (b = "" + s), a.key !== void 0 && (b = "" + a.key), "key" in a) {
|
|
20
|
+
s = {};
|
|
21
|
+
for (var E in a)
|
|
22
|
+
E !== "key" && (s[E] = a[E]);
|
|
23
|
+
} else s = a;
|
|
24
|
+
return a = s.ref, {
|
|
25
|
+
$$typeof: c,
|
|
26
|
+
type: f,
|
|
27
|
+
key: b,
|
|
28
|
+
ref: a !== void 0 ? a : null,
|
|
29
|
+
props: s
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
return _.Fragment = m, _.jsx = i, _.jsxs = i, _;
|
|
33
|
+
}
|
|
34
|
+
var R = {};
|
|
35
|
+
/**
|
|
36
|
+
* @license React
|
|
37
|
+
* react-jsx-runtime.development.js
|
|
38
|
+
*
|
|
39
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
40
|
+
*
|
|
41
|
+
* This source code is licensed under the MIT license found in the
|
|
42
|
+
* LICENSE file in the root directory of this source tree.
|
|
43
|
+
*/
|
|
44
|
+
var F;
|
|
45
|
+
function te() {
|
|
46
|
+
return F || (F = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
47
|
+
function c(e) {
|
|
48
|
+
if (e == null) return null;
|
|
49
|
+
if (typeof e == "function")
|
|
50
|
+
return e.$$typeof === Z ? null : e.displayName || e.name || null;
|
|
51
|
+
if (typeof e == "string") return e;
|
|
52
|
+
switch (e) {
|
|
53
|
+
case p:
|
|
54
|
+
return "Fragment";
|
|
55
|
+
case q:
|
|
56
|
+
return "Profiler";
|
|
57
|
+
case U:
|
|
58
|
+
return "StrictMode";
|
|
59
|
+
case G:
|
|
60
|
+
return "Suspense";
|
|
61
|
+
case X:
|
|
62
|
+
return "SuspenseList";
|
|
63
|
+
case H:
|
|
64
|
+
return "Activity";
|
|
65
|
+
}
|
|
66
|
+
if (typeof e == "object")
|
|
67
|
+
switch (typeof e.tag == "number" && console.error(
|
|
68
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
69
|
+
), e.$$typeof) {
|
|
70
|
+
case W:
|
|
71
|
+
return "Portal";
|
|
72
|
+
case z:
|
|
73
|
+
return (e.displayName || "Context") + ".Provider";
|
|
74
|
+
case J:
|
|
75
|
+
return (e._context.displayName || "Context") + ".Consumer";
|
|
76
|
+
case V:
|
|
77
|
+
var r = e.render;
|
|
78
|
+
return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
79
|
+
case B:
|
|
80
|
+
return r = e.displayName || null, r !== null ? r : c(e.type) || "Memo";
|
|
81
|
+
case x:
|
|
82
|
+
r = e._payload, e = e._init;
|
|
83
|
+
try {
|
|
84
|
+
return c(e(r));
|
|
85
|
+
} catch {
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
function m(e) {
|
|
91
|
+
return "" + e;
|
|
92
|
+
}
|
|
93
|
+
function i(e) {
|
|
94
|
+
try {
|
|
95
|
+
m(e);
|
|
96
|
+
var r = !1;
|
|
97
|
+
} catch {
|
|
98
|
+
r = !0;
|
|
99
|
+
}
|
|
100
|
+
if (r) {
|
|
101
|
+
r = console;
|
|
102
|
+
var t = r.error, n = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
103
|
+
return t.call(
|
|
104
|
+
r,
|
|
105
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
106
|
+
n
|
|
107
|
+
), m(e);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
function f(e) {
|
|
111
|
+
if (e === p) return "<>";
|
|
112
|
+
if (typeof e == "object" && e !== null && e.$$typeof === x)
|
|
113
|
+
return "<...>";
|
|
114
|
+
try {
|
|
115
|
+
var r = c(e);
|
|
116
|
+
return r ? "<" + r + ">" : "<...>";
|
|
117
|
+
} catch {
|
|
118
|
+
return "<...>";
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
function a() {
|
|
122
|
+
var e = k.A;
|
|
123
|
+
return e === null ? null : e.getOwner();
|
|
124
|
+
}
|
|
125
|
+
function s() {
|
|
126
|
+
return Error("react-stack-top-frame");
|
|
127
|
+
}
|
|
128
|
+
function b(e) {
|
|
129
|
+
if (g.call(e, "key")) {
|
|
130
|
+
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
131
|
+
if (r && r.isReactWarning) return !1;
|
|
132
|
+
}
|
|
133
|
+
return e.key !== void 0;
|
|
134
|
+
}
|
|
135
|
+
function E(e, r) {
|
|
136
|
+
function t() {
|
|
137
|
+
h || (h = !0, console.error(
|
|
138
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
139
|
+
r
|
|
140
|
+
));
|
|
141
|
+
}
|
|
142
|
+
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
143
|
+
get: t,
|
|
144
|
+
configurable: !0
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
function L() {
|
|
148
|
+
var e = c(this.type);
|
|
149
|
+
return N[e] || (N[e] = !0, console.error(
|
|
150
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
151
|
+
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
152
|
+
}
|
|
153
|
+
function M(e, r, t, n, l, u, A, S) {
|
|
154
|
+
return t = u.ref, e = {
|
|
155
|
+
$$typeof: w,
|
|
156
|
+
type: e,
|
|
157
|
+
key: r,
|
|
158
|
+
props: u,
|
|
159
|
+
_owner: l
|
|
160
|
+
}, (t !== void 0 ? t : null) !== null ? Object.defineProperty(e, "ref", {
|
|
161
|
+
enumerable: !1,
|
|
162
|
+
get: L
|
|
163
|
+
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
164
|
+
configurable: !1,
|
|
165
|
+
enumerable: !1,
|
|
166
|
+
writable: !0,
|
|
167
|
+
value: 0
|
|
168
|
+
}), Object.defineProperty(e, "_debugInfo", {
|
|
169
|
+
configurable: !1,
|
|
170
|
+
enumerable: !1,
|
|
171
|
+
writable: !0,
|
|
172
|
+
value: null
|
|
173
|
+
}), Object.defineProperty(e, "_debugStack", {
|
|
174
|
+
configurable: !1,
|
|
175
|
+
enumerable: !1,
|
|
176
|
+
writable: !0,
|
|
177
|
+
value: A
|
|
178
|
+
}), Object.defineProperty(e, "_debugTask", {
|
|
179
|
+
configurable: !1,
|
|
180
|
+
enumerable: !1,
|
|
181
|
+
writable: !0,
|
|
182
|
+
value: S
|
|
183
|
+
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
184
|
+
}
|
|
185
|
+
function P(e, r, t, n, l, u, A, S) {
|
|
186
|
+
var o = r.children;
|
|
187
|
+
if (o !== void 0)
|
|
188
|
+
if (n)
|
|
189
|
+
if (Q(o)) {
|
|
190
|
+
for (n = 0; n < o.length; n++)
|
|
191
|
+
j(o[n]);
|
|
192
|
+
Object.freeze && Object.freeze(o);
|
|
193
|
+
} else
|
|
194
|
+
console.error(
|
|
195
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
196
|
+
);
|
|
197
|
+
else j(o);
|
|
198
|
+
if (g.call(r, "key")) {
|
|
199
|
+
o = c(e);
|
|
200
|
+
var d = Object.keys(r).filter(function(K) {
|
|
201
|
+
return K !== "key";
|
|
202
|
+
});
|
|
203
|
+
n = 0 < d.length ? "{key: someKey, " + d.join(": ..., ") + ": ...}" : "{key: someKey}", $[o + n] || (d = 0 < d.length ? "{" + d.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
204
|
+
`A props object containing a "key" prop is being spread into JSX:
|
|
205
|
+
let props = %s;
|
|
206
|
+
<%s {...props} />
|
|
207
|
+
React keys must be passed directly to JSX without using spread:
|
|
208
|
+
let props = %s;
|
|
209
|
+
<%s key={someKey} {...props} />`,
|
|
210
|
+
n,
|
|
211
|
+
o,
|
|
212
|
+
d,
|
|
213
|
+
o
|
|
214
|
+
), $[o + n] = !0);
|
|
215
|
+
}
|
|
216
|
+
if (o = null, t !== void 0 && (i(t), o = "" + t), b(r) && (i(r.key), o = "" + r.key), "key" in r) {
|
|
217
|
+
t = {};
|
|
218
|
+
for (var y in r)
|
|
219
|
+
y !== "key" && (t[y] = r[y]);
|
|
220
|
+
} else t = r;
|
|
221
|
+
return o && E(
|
|
222
|
+
t,
|
|
223
|
+
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
224
|
+
), M(
|
|
225
|
+
e,
|
|
226
|
+
o,
|
|
227
|
+
u,
|
|
228
|
+
l,
|
|
229
|
+
a(),
|
|
230
|
+
t,
|
|
231
|
+
A,
|
|
232
|
+
S
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
function j(e) {
|
|
236
|
+
typeof e == "object" && e !== null && e.$$typeof === w && e._store && (e._store.validated = 1);
|
|
237
|
+
}
|
|
238
|
+
var v = ee, w = Symbol.for("react.transitional.element"), W = Symbol.for("react.portal"), p = Symbol.for("react.fragment"), U = Symbol.for("react.strict_mode"), q = Symbol.for("react.profiler"), J = Symbol.for("react.consumer"), z = Symbol.for("react.context"), V = Symbol.for("react.forward_ref"), G = Symbol.for("react.suspense"), X = Symbol.for("react.suspense_list"), B = Symbol.for("react.memo"), x = Symbol.for("react.lazy"), H = Symbol.for("react.activity"), Z = Symbol.for("react.client.reference"), k = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, g = Object.prototype.hasOwnProperty, Q = Array.isArray, O = console.createTask ? console.createTask : function() {
|
|
239
|
+
return null;
|
|
240
|
+
};
|
|
241
|
+
v = {
|
|
242
|
+
react_stack_bottom_frame: function(e) {
|
|
243
|
+
return e();
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
var h, N = {}, C = v.react_stack_bottom_frame.bind(
|
|
247
|
+
v,
|
|
248
|
+
s
|
|
249
|
+
)(), Y = O(f(s)), $ = {};
|
|
250
|
+
R.Fragment = p, R.jsx = function(e, r, t, n, l) {
|
|
251
|
+
var u = 1e4 > k.recentlyCreatedOwnerStacks++;
|
|
252
|
+
return P(
|
|
253
|
+
e,
|
|
254
|
+
r,
|
|
255
|
+
t,
|
|
256
|
+
!1,
|
|
257
|
+
n,
|
|
258
|
+
l,
|
|
259
|
+
u ? Error("react-stack-top-frame") : C,
|
|
260
|
+
u ? O(f(e)) : Y
|
|
261
|
+
);
|
|
262
|
+
}, R.jsxs = function(e, r, t, n, l) {
|
|
263
|
+
var u = 1e4 > k.recentlyCreatedOwnerStacks++;
|
|
264
|
+
return P(
|
|
265
|
+
e,
|
|
266
|
+
r,
|
|
267
|
+
t,
|
|
268
|
+
!0,
|
|
269
|
+
n,
|
|
270
|
+
l,
|
|
271
|
+
u ? Error("react-stack-top-frame") : C,
|
|
272
|
+
u ? O(f(e)) : Y
|
|
273
|
+
);
|
|
274
|
+
};
|
|
275
|
+
})()), R;
|
|
276
|
+
}
|
|
277
|
+
var D;
|
|
278
|
+
function ne() {
|
|
279
|
+
return D || (D = 1, process.env.NODE_ENV === "production" ? T.exports = re() : T.exports = te()), T.exports;
|
|
280
|
+
}
|
|
281
|
+
var oe = ne();
|
|
282
|
+
const se = ({
|
|
283
|
+
primary: c = !1,
|
|
284
|
+
size: m = "medium",
|
|
285
|
+
backgroundColor: i,
|
|
286
|
+
label: f,
|
|
287
|
+
...a
|
|
288
|
+
}) => {
|
|
289
|
+
const s = c ? "storybook-button--primary" : "storybook-button--secondary";
|
|
290
|
+
return /* @__PURE__ */ oe.jsx(
|
|
291
|
+
"button",
|
|
292
|
+
{
|
|
293
|
+
type: "button",
|
|
294
|
+
className: ["storybook-button", `storybook-button--${m}`, s].join(
|
|
295
|
+
" "
|
|
296
|
+
),
|
|
297
|
+
style: { backgroundColor: i },
|
|
298
|
+
...a,
|
|
299
|
+
children: f
|
|
300
|
+
}
|
|
301
|
+
);
|
|
302
|
+
};
|
|
303
|
+
export {
|
|
304
|
+
se as Button
|
|
305
|
+
};
|
package/dist/vite.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
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>
|
package/package.json
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "hans-ui-design-lib",
|
|
3
|
+
"description": "UI Design System Base Lib",
|
|
4
|
+
"author": "Victor Hanszman",
|
|
5
|
+
"version": "0.0.1",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"main": "dist/index.cjs.js",
|
|
9
|
+
"module": "dist/index.es.js",
|
|
10
|
+
"types": "dist/index.d.ts",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
14
|
+
"publishConfig": {
|
|
15
|
+
"access": "public"
|
|
16
|
+
},
|
|
17
|
+
"sideEffects": false,
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"import": "./dist/index.es.js",
|
|
21
|
+
"require": "./dist/index.cjs.js"
|
|
22
|
+
},
|
|
23
|
+
"./package.json": "./package.json"
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"dev": "vite",
|
|
27
|
+
"start": "vite",
|
|
28
|
+
"preview": "vite preview",
|
|
29
|
+
"storybook": "storybook dev -p 6006",
|
|
30
|
+
"build-storybook": "storybook build",
|
|
31
|
+
"build": "tsc -p tsconfig.build.json && vite build",
|
|
32
|
+
"lint": "eslint .",
|
|
33
|
+
"test": "vitest run",
|
|
34
|
+
"test:coverage": "npm run test -- --coverage",
|
|
35
|
+
"test:watch": "vitest"
|
|
36
|
+
},
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"react": "^19.1.1",
|
|
39
|
+
"react-dom": "^19.1.1"
|
|
40
|
+
},
|
|
41
|
+
"peerDependenciesMeta": {
|
|
42
|
+
"react": {
|
|
43
|
+
"optional": false
|
|
44
|
+
},
|
|
45
|
+
"react-dom": {
|
|
46
|
+
"optional": false
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@chromatic-com/storybook": "^4.1.1",
|
|
51
|
+
"@eslint/js": "^9.36.0",
|
|
52
|
+
"@storybook/addon-a11y": "^9.1.8",
|
|
53
|
+
"@storybook/addon-docs": "^9.1.8",
|
|
54
|
+
"@storybook/addon-vitest": "^9.1.8",
|
|
55
|
+
"@storybook/react-vite": "^9.1.8",
|
|
56
|
+
"@tailwindcss/vite": "^4.1.13",
|
|
57
|
+
"@testing-library/jest-dom": "^6.8.0",
|
|
58
|
+
"@testing-library/react": "^16.3.0",
|
|
59
|
+
"@types/react": "^19.1.13",
|
|
60
|
+
"@types/react-dom": "^19.1.9",
|
|
61
|
+
"@types/testing-library__jest-dom": "^5.14.9",
|
|
62
|
+
"@typescript-eslint/eslint-plugin": "^8.44.1",
|
|
63
|
+
"@typescript-eslint/parser": "^8.44.1",
|
|
64
|
+
"@vitejs/plugin-react": "^5.0.3",
|
|
65
|
+
"@vitest/browser": "^3.2.4",
|
|
66
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
67
|
+
"eslint": "^9.36.0",
|
|
68
|
+
"eslint-config-prettier": "^10.1.8",
|
|
69
|
+
"eslint-plugin-react": "^7.37.5",
|
|
70
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
71
|
+
"eslint-plugin-react-refresh": "^0.4.20",
|
|
72
|
+
"eslint-plugin-storybook": "^9.1.8",
|
|
73
|
+
"globals": "^16.4.0",
|
|
74
|
+
"jsdom": "^27.0.0",
|
|
75
|
+
"playwright": "^1.55.1",
|
|
76
|
+
"prettier": "^3.6.2",
|
|
77
|
+
"sass": "^1.93.2",
|
|
78
|
+
"storybook": "^9.1.8",
|
|
79
|
+
"tailwindcss": "^4.1.13",
|
|
80
|
+
"typescript": "~5.8.3",
|
|
81
|
+
"typescript-eslint": "^8.44.0",
|
|
82
|
+
"vite": "^7.1.7",
|
|
83
|
+
"vitest": "^3.2.4"
|
|
84
|
+
}
|
|
85
|
+
}
|