@inzumer/ui-library 0.1.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 +133 -0
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/es/components/atoms/Button/Button.js +54 -0
- package/dist/es/components/atoms/Button/Button.js.map +1 -0
- package/dist/es/components/atoms/Button/Button.styles.js +54 -0
- package/dist/es/components/atoms/Button/Button.styles.js.map +1 -0
- package/dist/es/index.js +17 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/tokens/colors.js +40 -0
- package/dist/es/tokens/colors.js.map +1 -0
- package/dist/es/tokens/motion.js +15 -0
- package/dist/es/tokens/motion.js.map +1 -0
- package/dist/es/tokens/radius.js +10 -0
- package/dist/es/tokens/radius.js.map +1 -0
- package/dist/es/tokens/spacing.js +12 -0
- package/dist/es/tokens/spacing.js.map +1 -0
- package/dist/es/tokens/typography.js +24 -0
- package/dist/es/tokens/typography.js.map +1 -0
- package/dist/es/tokens/z-index.js +12 -0
- package/dist/es/tokens/z-index.js.map +1 -0
- package/dist/es/utils/cn.js +9 -0
- package/dist/es/utils/cn.js.map +1 -0
- package/dist/globals.css +1 -0
- package/dist/types/index.d.ts +122 -0
- package/package.json +105 -0
package/README.md
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# @inzumer/ui
|
|
2
|
+
|
|
3
|
+
Production-grade React component library for web applications and mobile WebViews.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
|
|
9
|
+
`@inzumer/ui` provides a unified, accessible, and performant design system for TypeScript React projects. It enforces consistent visual language, interaction patterns, and WCAG 2.1 AA accessibility standards across web and WebView platforms.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Stack
|
|
14
|
+
|
|
15
|
+
| Tool | Purpose |
|
|
16
|
+
|---|---|
|
|
17
|
+
| React 18 | Component model |
|
|
18
|
+
| TypeScript (strict) | Type safety |
|
|
19
|
+
| Vite | Build tooling (library mode) |
|
|
20
|
+
| Tailwind CSS | Token-driven styling |
|
|
21
|
+
| class-variance-authority | Variant management |
|
|
22
|
+
| Vitest + RTL | Unit and accessibility testing |
|
|
23
|
+
| Storybook 8 | Component documentation |
|
|
24
|
+
| ESLint + Prettier | Code quality |
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Setup
|
|
29
|
+
|
|
30
|
+
### Prerequisites
|
|
31
|
+
|
|
32
|
+
- Node.js >=20
|
|
33
|
+
- npm >=10
|
|
34
|
+
|
|
35
|
+
### Install dependencies
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm install
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Development
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npm run dev
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Opens Storybook at `http://localhost:6006`.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Scripts
|
|
52
|
+
|
|
53
|
+
| Command | Description |
|
|
54
|
+
|---|---|
|
|
55
|
+
| `npm run dev` | Start Storybook development server |
|
|
56
|
+
| `npm run build` | Build library for distribution |
|
|
57
|
+
| `npm run build:storybook` | Build static Storybook |
|
|
58
|
+
| `npm test` | Run test suite |
|
|
59
|
+
| `npm run test:watch` | Run tests in watch mode |
|
|
60
|
+
| `npm run test:coverage` | Run tests with coverage report |
|
|
61
|
+
| `npm run typecheck` | TypeScript type check (no emit) |
|
|
62
|
+
| `npm run lint` | Lint source files |
|
|
63
|
+
| `npm run lint:fix` | Lint and auto-fix |
|
|
64
|
+
| `npm run format` | Format source files with Prettier |
|
|
65
|
+
| `npm run format:check` | Check formatting without writing |
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Using the library
|
|
70
|
+
|
|
71
|
+
```tsx
|
|
72
|
+
import { Button } from '@inzumer/ui'
|
|
73
|
+
import '@inzumer/ui/dist/style.css'
|
|
74
|
+
|
|
75
|
+
export function App() {
|
|
76
|
+
return (
|
|
77
|
+
<Button variant="primary" onClick={() => console.log('clicked')}>
|
|
78
|
+
Click me
|
|
79
|
+
</Button>
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Contributing
|
|
87
|
+
|
|
88
|
+
### Architecture rules
|
|
89
|
+
|
|
90
|
+
All agents and architecture rules are defined in `.claude/agents/`. Read them before contributing.
|
|
91
|
+
|
|
92
|
+
### Planning requirement
|
|
93
|
+
|
|
94
|
+
All non-trivial changes require a planning document in `/docs/plans/` before implementation begins.
|
|
95
|
+
See `YYYY-MM-DD-task-name.md` format.
|
|
96
|
+
|
|
97
|
+
### Architectural decisions
|
|
98
|
+
|
|
99
|
+
Significant architecture changes require an ADR in `/docs/adr/`.
|
|
100
|
+
|
|
101
|
+
### Code standards
|
|
102
|
+
|
|
103
|
+
- Zero `any` — strict TypeScript throughout
|
|
104
|
+
- Semantic HTML first — no clickable `div`s
|
|
105
|
+
- Token-only Tailwind — no arbitrary values
|
|
106
|
+
- Every component must: be tested, be accessible, be Storybook-documented, be exported
|
|
107
|
+
|
|
108
|
+
### Commit convention
|
|
109
|
+
|
|
110
|
+
Conventional Commits format:
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
feat(button): add loading state
|
|
114
|
+
fix(button): correct focus ring on Firefox
|
|
115
|
+
docs: update README setup instructions
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Pull request checklist
|
|
119
|
+
|
|
120
|
+
- [ ] Planning document exists in `/docs/plans/`
|
|
121
|
+
- [ ] All tests pass (`npm test`)
|
|
122
|
+
- [ ] TypeScript passes (`npm run typecheck`)
|
|
123
|
+
- [ ] Lint passes (`npm run lint`)
|
|
124
|
+
- [ ] Storybook stories cover new states
|
|
125
|
+
- [ ] axe-core violations: zero
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## Accessibility commitment
|
|
130
|
+
|
|
131
|
+
This library targets **WCAG 2.1 AA** compliance for every component. Accessibility is not optional and is tested automatically via axe-core on every build.
|
|
132
|
+
|
|
133
|
+
If you find an accessibility issue, please open an issue with the label `a11y`.
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("react"),b=require("clsx"),f=require("tailwind-merge"),g=require("class-variance-authority");function p(...t){return f.twMerge(b.clsx(t))}const x=g.cva(["inline-flex items-center justify-center gap-2","font-medium rounded-md","transition-colors duration-base ease-ui","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50","motion-reduce:transition-none","min-h-touch min-w-touch"],{variants:{variant:{primary:["bg-primary-600 text-white","hover:bg-primary-700 active:bg-primary-800","focus-visible:ring-primary-500"],secondary:["bg-neutral-100 text-neutral-900 border border-neutral-300","hover:bg-neutral-200 active:bg-neutral-300","focus-visible:ring-neutral-500","dark:bg-neutral-800 dark:text-neutral-100 dark:border-neutral-600","dark:hover:bg-neutral-700"],ghost:["bg-transparent text-neutral-700","hover:bg-neutral-100 active:bg-neutral-200","focus-visible:ring-neutral-500","dark:text-neutral-300 dark:hover:bg-neutral-800"],danger:["bg-danger-500 text-white","hover:bg-danger-600 active:bg-danger-600","focus-visible:ring-danger-500"]},size:{sm:"h-8 px-3 text-sm",md:"h-10 px-4 text-sm",lg:"h-12 px-6 text-base"}},defaultVariants:{variant:"primary",size:"md"}}),h=()=>e.jsxs("svg",{className:"animate-spin h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),s=d.forwardRef(({variant:t,size:n,isLoading:r=!1,loadingText:a,disabled:i,children:o,className:c,...l},u)=>{const m=i||r;return e.jsxs("button",{ref:u,disabled:m,"aria-busy":r,className:p(x({variant:t,size:n}),c),...l,children:[r&&e.jsx(h,{}),r&&a?a:o]})});s.displayName="Button";const v={primary:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},neutral:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},danger:{500:"#ef4444",600:"#dc2626"},success:{500:"#22c55e",600:"#16a34a"}},y={xs:"0.25rem",sm:"0.5rem",md:"1rem",lg:"1.5rem",xl:"2rem","2xl":"3rem"},w={sm:"0.25rem",md:"0.375rem",lg:"0.5rem",full:"9999px"},k={fontFamily:{sans:"Inter, system-ui, sans-serif",mono:"JetBrains Mono, monospace"},fontSize:{xs:"0.75rem",sm:"0.875rem",base:"1rem",lg:"1.125rem",xl:"1.25rem"},lineHeight:{xs:"1rem",sm:"1.25rem",base:"1.5rem",lg:"1.75rem",xl:"1.75rem"}},j={dropdown:1e3,sticky:1100,overlay:1200,modal:1300,toast:1400,tooltip:1500},z={duration:{fast:"100ms",base:"200ms",slow:"350ms"},easing:{ui:"cubic-bezier(0.4, 0, 0.2, 1)",spring:"cubic-bezier(0.34, 1.56, 0.64, 1)"}};exports.Button=s;exports.colors=v;exports.motion=z;exports.radius=w;exports.spacing=y;exports.typography=k;exports.zIndex=j;
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/utils/cn.ts","../../src/components/atoms/Button/Button.styles.ts","../../src/components/atoms/Button/Button.tsx","../../src/tokens/colors.ts","../../src/tokens/spacing.ts","../../src/tokens/radius.ts","../../src/tokens/typography.ts","../../src/tokens/z-index.ts","../../src/tokens/motion.ts"],"sourcesContent":["import { clsx, type ClassValue } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import { cva } from 'class-variance-authority'\n\nexport const buttonVariants = cva(\n [\n 'inline-flex items-center justify-center gap-2',\n 'font-medium rounded-md',\n 'transition-colors duration-base ease-ui',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2',\n 'disabled:pointer-events-none disabled:opacity-50',\n 'motion-reduce:transition-none',\n 'min-h-touch min-w-touch',\n ],\n {\n variants: {\n variant: {\n primary: [\n 'bg-primary-600 text-white',\n 'hover:bg-primary-700 active:bg-primary-800',\n 'focus-visible:ring-primary-500',\n ],\n secondary: [\n 'bg-neutral-100 text-neutral-900 border border-neutral-300',\n 'hover:bg-neutral-200 active:bg-neutral-300',\n 'focus-visible:ring-neutral-500',\n 'dark:bg-neutral-800 dark:text-neutral-100 dark:border-neutral-600',\n 'dark:hover:bg-neutral-700',\n ],\n ghost: [\n 'bg-transparent text-neutral-700',\n 'hover:bg-neutral-100 active:bg-neutral-200',\n 'focus-visible:ring-neutral-500',\n 'dark:text-neutral-300 dark:hover:bg-neutral-800',\n ],\n danger: [\n 'bg-danger-500 text-white',\n 'hover:bg-danger-600 active:bg-danger-600',\n 'focus-visible:ring-danger-500',\n ],\n },\n size: {\n sm: 'h-8 px-3 text-sm',\n md: 'h-10 px-4 text-sm',\n lg: 'h-12 px-6 text-base',\n },\n },\n defaultVariants: {\n variant: 'primary',\n size: 'md',\n },\n },\n)\n","import { forwardRef } from 'react'\nimport { cn } from '@/utils/cn'\nimport { buttonVariants } from './Button.styles'\nimport type { ButtonProps } from './Button.types'\n\nconst Spinner = () => (\n <svg\n className=\"animate-spin h-4 w-4\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <circle className=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" strokeWidth=\"4\" />\n <path\n className=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z\"\n />\n </svg>\n)\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n variant,\n size,\n isLoading = false,\n loadingText,\n disabled,\n children,\n className,\n ...props\n },\n ref,\n ) => {\n const isDisabled = disabled || isLoading\n\n return (\n <button\n ref={ref}\n disabled={isDisabled}\n aria-busy={isLoading}\n className={cn(buttonVariants({ variant, size }), className)}\n {...props}\n >\n {isLoading && <Spinner />}\n {isLoading && loadingText ? loadingText : children}\n </button>\n )\n },\n)\n\nButton.displayName = 'Button'\n","export const colors = {\n primary: {\n 50: '#eff6ff',\n 100: '#dbeafe',\n 200: '#bfdbfe',\n 300: '#93c5fd',\n 400: '#60a5fa',\n 500: '#3b82f6',\n 600: '#2563eb',\n 700: '#1d4ed8',\n 800: '#1e40af',\n 900: '#1e3a8a',\n 950: '#172554',\n },\n neutral: {\n 50: '#f9fafb',\n 100: '#f3f4f6',\n 200: '#e5e7eb',\n 300: '#d1d5db',\n 400: '#9ca3af',\n 500: '#6b7280',\n 600: '#4b5563',\n 700: '#374151',\n 800: '#1f2937',\n 900: '#111827',\n 950: '#030712',\n },\n danger: {\n 500: '#ef4444',\n 600: '#dc2626',\n },\n success: {\n 500: '#22c55e',\n 600: '#16a34a',\n },\n} as const\n","export const spacing = {\n xs: '0.25rem',\n sm: '0.5rem',\n md: '1rem',\n lg: '1.5rem',\n xl: '2rem',\n '2xl': '3rem',\n} as const\n","export const radius = {\n sm: '0.25rem',\n md: '0.375rem',\n lg: '0.5rem',\n full: '9999px',\n} as const\n","export const typography = {\n fontFamily: {\n sans: 'Inter, system-ui, sans-serif',\n mono: 'JetBrains Mono, monospace',\n },\n fontSize: {\n xs: '0.75rem',\n sm: '0.875rem',\n base: '1rem',\n lg: '1.125rem',\n xl: '1.25rem',\n },\n lineHeight: {\n xs: '1rem',\n sm: '1.25rem',\n base: '1.5rem',\n lg: '1.75rem',\n xl: '1.75rem',\n },\n} as const\n","export const zIndex = {\n dropdown: 1000,\n sticky: 1100,\n overlay: 1200,\n modal: 1300,\n toast: 1400,\n tooltip: 1500,\n} as const\n","export const motion = {\n duration: {\n fast: '100ms',\n base: '200ms',\n slow: '350ms',\n },\n easing: {\n ui: 'cubic-bezier(0.4, 0, 0.2, 1)',\n spring: 'cubic-bezier(0.34, 1.56, 0.64, 1)',\n },\n} as const\n"],"names":["cn","inputs","twMerge","clsx","buttonVariants","cva","Spinner","jsxs","jsx","Button","forwardRef","variant","size","isLoading","loadingText","disabled","children","className","props","ref","isDisabled","colors","spacing","radius","typography","zIndex","motion"],"mappings":"4NAGO,SAASA,KAAMC,EAAsB,CAC1C,OAAOC,EAAAA,QAAQC,OAAKF,CAAM,CAAC,CAC7B,CCHO,MAAMG,EAAiBC,EAAAA,IAC5B,CACE,gDACA,yBACA,0CACA,8EACA,mDACA,gCACA,yBAAA,EAEF,CACE,SAAU,CACR,QAAS,CACP,QAAS,CACP,4BACA,6CACA,gCAAA,EAEF,UAAW,CACT,4DACA,6CACA,iCACA,oEACA,2BAAA,EAEF,MAAO,CACL,kCACA,6CACA,iCACA,iDAAA,EAEF,OAAQ,CACN,2BACA,2CACA,+BAAA,CACF,EAEF,KAAM,CACJ,GAAI,mBACJ,GAAI,oBACJ,GAAI,qBAAA,CACN,EAEF,gBAAiB,CACf,QAAS,UACT,KAAM,IAAA,CACR,CAEJ,EC7CMC,EAAU,IACdC,EAAAA,KAAC,MAAA,CACC,UAAU,uBACV,MAAM,6BACN,KAAK,OACL,QAAQ,YACR,cAAY,OAEZ,SAAA,CAAAC,EAAAA,IAAC,SAAA,CAAO,UAAU,aAAa,GAAG,KAAK,GAAG,KAAK,EAAE,KAAK,OAAO,eAAe,YAAY,IAAI,EAC5FA,EAAAA,IAAC,OAAA,CACC,UAAU,aACV,KAAK,eACL,EAAE,6CAAA,CAAA,CACJ,CAAA,CACF,EAGWC,EAASC,EAAAA,WACpB,CACE,CACE,QAAAC,EACA,KAAAC,EACA,UAAAC,EAAY,GACZ,YAAAC,EACA,SAAAC,EACA,SAAAC,EACA,UAAAC,EACA,GAAGC,CAAA,EAELC,IACG,CACH,MAAMC,EAAaL,GAAYF,EAE/B,OACEN,EAAAA,KAAC,SAAA,CACC,IAAAY,EACA,SAAUC,EACV,YAAWP,EACX,UAAWb,EAAGI,EAAe,CAAE,QAAAO,EAAS,KAAAC,CAAA,CAAM,EAAGK,CAAS,EACzD,GAAGC,EAEH,SAAA,CAAAL,SAAcP,EAAA,EAAQ,EACtBO,GAAaC,EAAcA,EAAcE,CAAA,CAAA,CAAA,CAGhD,CACF,EAEAP,EAAO,YAAc,SCrDd,MAAMY,EAAS,CACpB,QAAS,CACP,GAAI,UACJ,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,SAAA,EAEP,QAAS,CACP,GAAI,UACJ,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,SAAA,EAEP,OAAQ,CACN,IAAK,UACL,IAAK,SAAA,EAEP,QAAS,CACP,IAAK,UACL,IAAK,SAAA,CAET,ECnCaC,EAAU,CACrB,GAAI,UACJ,GAAI,SACJ,GAAI,OACJ,GAAI,SACJ,GAAI,OACJ,MAAO,MACT,ECPaC,EAAS,CACpB,GAAI,UACJ,GAAI,WACJ,GAAI,SACJ,KAAM,QACR,ECLaC,EAAa,CACxB,WAAY,CACV,KAAM,+BACN,KAAM,2BAAA,EAER,SAAU,CACR,GAAI,UACJ,GAAI,WACJ,KAAM,OACN,GAAI,WACJ,GAAI,SAAA,EAEN,WAAY,CACV,GAAI,OACJ,GAAI,UACJ,KAAM,SACN,GAAI,UACJ,GAAI,SAAA,CAER,ECnBaC,EAAS,CACpB,SAAU,IACV,OAAQ,KACR,QAAS,KACT,MAAO,KACP,MAAO,KACP,QAAS,IACX,ECPaC,EAAS,CACpB,SAAU,CACR,KAAM,QACN,KAAM,QACN,KAAM,OAAA,EAER,OAAQ,CACN,GAAI,+BACJ,OAAQ,mCAAA,CAEZ"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsxs as e, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as p } from "react";
|
|
3
|
+
import { cn as f } from "../../../utils/cn.js";
|
|
4
|
+
import { buttonVariants as u } from "./Button.styles.js";
|
|
5
|
+
const d = () => /* @__PURE__ */ e(
|
|
6
|
+
"svg",
|
|
7
|
+
{
|
|
8
|
+
className: "animate-spin h-4 w-4",
|
|
9
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
10
|
+
fill: "none",
|
|
11
|
+
viewBox: "0 0 24 24",
|
|
12
|
+
"aria-hidden": "true",
|
|
13
|
+
children: [
|
|
14
|
+
/* @__PURE__ */ t("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
15
|
+
/* @__PURE__ */ t(
|
|
16
|
+
"path",
|
|
17
|
+
{
|
|
18
|
+
className: "opacity-75",
|
|
19
|
+
fill: "currentColor",
|
|
20
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"
|
|
21
|
+
}
|
|
22
|
+
)
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
), h = p(
|
|
26
|
+
({
|
|
27
|
+
variant: o,
|
|
28
|
+
size: a,
|
|
29
|
+
isLoading: r = !1,
|
|
30
|
+
loadingText: s,
|
|
31
|
+
disabled: i,
|
|
32
|
+
children: c,
|
|
33
|
+
className: l,
|
|
34
|
+
...n
|
|
35
|
+
}, m) => /* @__PURE__ */ e(
|
|
36
|
+
"button",
|
|
37
|
+
{
|
|
38
|
+
ref: m,
|
|
39
|
+
disabled: i || r,
|
|
40
|
+
"aria-busy": r,
|
|
41
|
+
className: f(u({ variant: o, size: a }), l),
|
|
42
|
+
...n,
|
|
43
|
+
children: [
|
|
44
|
+
r && /* @__PURE__ */ t(d, {}),
|
|
45
|
+
r && s ? s : c
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
);
|
|
50
|
+
h.displayName = "Button";
|
|
51
|
+
export {
|
|
52
|
+
h as Button
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=Button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../../../../../src/components/atoms/Button/Button.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { cn } from '@/utils/cn'\nimport { buttonVariants } from './Button.styles'\nimport type { ButtonProps } from './Button.types'\n\nconst Spinner = () => (\n <svg\n className=\"animate-spin h-4 w-4\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <circle className=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" strokeWidth=\"4\" />\n <path\n className=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z\"\n />\n </svg>\n)\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n variant,\n size,\n isLoading = false,\n loadingText,\n disabled,\n children,\n className,\n ...props\n },\n ref,\n ) => {\n const isDisabled = disabled || isLoading\n\n return (\n <button\n ref={ref}\n disabled={isDisabled}\n aria-busy={isLoading}\n className={cn(buttonVariants({ variant, size }), className)}\n {...props}\n >\n {isLoading && <Spinner />}\n {isLoading && loadingText ? loadingText : children}\n </button>\n )\n },\n)\n\nButton.displayName = 'Button'\n"],"names":["Spinner","jsxs","jsx","Button","forwardRef","variant","size","isLoading","loadingText","disabled","children","className","props","ref","cn","buttonVariants"],"mappings":";;;;AAKA,MAAMA,IAAU,MACd,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAU;AAAA,IACV,OAAM;AAAA,IACN,MAAK;AAAA,IACL,SAAQ;AAAA,IACR,eAAY;AAAA,IAEZ,UAAA;AAAA,MAAA,gBAAAC,EAAC,UAAA,EAAO,WAAU,cAAa,IAAG,MAAK,IAAG,MAAK,GAAE,MAAK,QAAO,gBAAe,aAAY,KAAI;AAAA,MAC5F,gBAAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAU;AAAA,UACV,MAAK;AAAA,UACL,GAAE;AAAA,QAAA;AAAA,MAAA;AAAA,IACJ;AAAA,EAAA;AACF,GAGWC,IAASC;AAAA,EACpB,CACE;AAAA,IACE,SAAAC;AAAA,IACA,MAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,aAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAELC,MAKE,gBAAAZ;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAY;AAAA,MACA,UALeJ,KAAYF;AAAA,MAM3B,aAAWA;AAAA,MACX,WAAWO,EAAGC,EAAe,EAAE,SAAAV,GAAS,MAAAC,EAAA,CAAM,GAAGK,CAAS;AAAA,MACzD,GAAGC;AAAA,MAEH,UAAA;AAAA,QAAAL,uBAAcP,GAAA,EAAQ;AAAA,QACtBO,KAAaC,IAAcA,IAAcE;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIlD;AAEAP,EAAO,cAAc;"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { cva as e } from "class-variance-authority";
|
|
2
|
+
const t = e(
|
|
3
|
+
[
|
|
4
|
+
"inline-flex items-center justify-center gap-2",
|
|
5
|
+
"font-medium rounded-md",
|
|
6
|
+
"transition-colors duration-base ease-ui",
|
|
7
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
|
|
8
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
9
|
+
"motion-reduce:transition-none",
|
|
10
|
+
"min-h-touch min-w-touch"
|
|
11
|
+
],
|
|
12
|
+
{
|
|
13
|
+
variants: {
|
|
14
|
+
variant: {
|
|
15
|
+
primary: [
|
|
16
|
+
"bg-primary-600 text-white",
|
|
17
|
+
"hover:bg-primary-700 active:bg-primary-800",
|
|
18
|
+
"focus-visible:ring-primary-500"
|
|
19
|
+
],
|
|
20
|
+
secondary: [
|
|
21
|
+
"bg-neutral-100 text-neutral-900 border border-neutral-300",
|
|
22
|
+
"hover:bg-neutral-200 active:bg-neutral-300",
|
|
23
|
+
"focus-visible:ring-neutral-500",
|
|
24
|
+
"dark:bg-neutral-800 dark:text-neutral-100 dark:border-neutral-600",
|
|
25
|
+
"dark:hover:bg-neutral-700"
|
|
26
|
+
],
|
|
27
|
+
ghost: [
|
|
28
|
+
"bg-transparent text-neutral-700",
|
|
29
|
+
"hover:bg-neutral-100 active:bg-neutral-200",
|
|
30
|
+
"focus-visible:ring-neutral-500",
|
|
31
|
+
"dark:text-neutral-300 dark:hover:bg-neutral-800"
|
|
32
|
+
],
|
|
33
|
+
danger: [
|
|
34
|
+
"bg-danger-500 text-white",
|
|
35
|
+
"hover:bg-danger-600 active:bg-danger-600",
|
|
36
|
+
"focus-visible:ring-danger-500"
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
size: {
|
|
40
|
+
sm: "h-8 px-3 text-sm",
|
|
41
|
+
md: "h-10 px-4 text-sm",
|
|
42
|
+
lg: "h-12 px-6 text-base"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
defaultVariants: {
|
|
46
|
+
variant: "primary",
|
|
47
|
+
size: "md"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
export {
|
|
52
|
+
t as buttonVariants
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=Button.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.styles.js","sources":["../../../../../src/components/atoms/Button/Button.styles.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nexport const buttonVariants = cva(\n [\n 'inline-flex items-center justify-center gap-2',\n 'font-medium rounded-md',\n 'transition-colors duration-base ease-ui',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2',\n 'disabled:pointer-events-none disabled:opacity-50',\n 'motion-reduce:transition-none',\n 'min-h-touch min-w-touch',\n ],\n {\n variants: {\n variant: {\n primary: [\n 'bg-primary-600 text-white',\n 'hover:bg-primary-700 active:bg-primary-800',\n 'focus-visible:ring-primary-500',\n ],\n secondary: [\n 'bg-neutral-100 text-neutral-900 border border-neutral-300',\n 'hover:bg-neutral-200 active:bg-neutral-300',\n 'focus-visible:ring-neutral-500',\n 'dark:bg-neutral-800 dark:text-neutral-100 dark:border-neutral-600',\n 'dark:hover:bg-neutral-700',\n ],\n ghost: [\n 'bg-transparent text-neutral-700',\n 'hover:bg-neutral-100 active:bg-neutral-200',\n 'focus-visible:ring-neutral-500',\n 'dark:text-neutral-300 dark:hover:bg-neutral-800',\n ],\n danger: [\n 'bg-danger-500 text-white',\n 'hover:bg-danger-600 active:bg-danger-600',\n 'focus-visible:ring-danger-500',\n ],\n },\n size: {\n sm: 'h-8 px-3 text-sm',\n md: 'h-10 px-4 text-sm',\n lg: 'h-12 px-6 text-base',\n },\n },\n defaultVariants: {\n variant: 'primary',\n size: 'md',\n },\n },\n)\n"],"names":["buttonVariants","cva"],"mappings":";AAEO,MAAMA,IAAiBC;AAAA,EAC5B;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAAA,EAEF;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,UACP;AAAA,UACA;AAAA,UACA;AAAA,QAAA;AAAA,QAEF,WAAW;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QAAA;AAAA,QAEF,OAAO;AAAA,UACL;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QAAA;AAAA,QAEF,QAAQ;AAAA,UACN;AAAA,UACA;AAAA,UACA;AAAA,QAAA;AAAA,MACF;AAAA,MAEF,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA;AAAA,IACN;AAAA,IAEF,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,IAAA;AAAA,EACR;AAEJ;"}
|
package/dist/es/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Button as t } from "./components/atoms/Button/Button.js";
|
|
2
|
+
import { colors as e } from "./tokens/colors.js";
|
|
3
|
+
import { motion as x } from "./tokens/motion.js";
|
|
4
|
+
import { radius as n } from "./tokens/radius.js";
|
|
5
|
+
import { spacing as i } from "./tokens/spacing.js";
|
|
6
|
+
import { typography as c } from "./tokens/typography.js";
|
|
7
|
+
import { zIndex as g } from "./tokens/z-index.js";
|
|
8
|
+
export {
|
|
9
|
+
t as Button,
|
|
10
|
+
e as colors,
|
|
11
|
+
x as motion,
|
|
12
|
+
n as radius,
|
|
13
|
+
i as spacing,
|
|
14
|
+
c as typography,
|
|
15
|
+
g as zIndex
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const f = {
|
|
2
|
+
primary: {
|
|
3
|
+
50: "#eff6ff",
|
|
4
|
+
100: "#dbeafe",
|
|
5
|
+
200: "#bfdbfe",
|
|
6
|
+
300: "#93c5fd",
|
|
7
|
+
400: "#60a5fa",
|
|
8
|
+
500: "#3b82f6",
|
|
9
|
+
600: "#2563eb",
|
|
10
|
+
700: "#1d4ed8",
|
|
11
|
+
800: "#1e40af",
|
|
12
|
+
900: "#1e3a8a",
|
|
13
|
+
950: "#172554"
|
|
14
|
+
},
|
|
15
|
+
neutral: {
|
|
16
|
+
50: "#f9fafb",
|
|
17
|
+
100: "#f3f4f6",
|
|
18
|
+
200: "#e5e7eb",
|
|
19
|
+
300: "#d1d5db",
|
|
20
|
+
400: "#9ca3af",
|
|
21
|
+
500: "#6b7280",
|
|
22
|
+
600: "#4b5563",
|
|
23
|
+
700: "#374151",
|
|
24
|
+
800: "#1f2937",
|
|
25
|
+
900: "#111827",
|
|
26
|
+
950: "#030712"
|
|
27
|
+
},
|
|
28
|
+
danger: {
|
|
29
|
+
500: "#ef4444",
|
|
30
|
+
600: "#dc2626"
|
|
31
|
+
},
|
|
32
|
+
success: {
|
|
33
|
+
500: "#22c55e",
|
|
34
|
+
600: "#16a34a"
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
export {
|
|
38
|
+
f as colors
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=colors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colors.js","sources":["../../../src/tokens/colors.ts"],"sourcesContent":["export const colors = {\n primary: {\n 50: '#eff6ff',\n 100: '#dbeafe',\n 200: '#bfdbfe',\n 300: '#93c5fd',\n 400: '#60a5fa',\n 500: '#3b82f6',\n 600: '#2563eb',\n 700: '#1d4ed8',\n 800: '#1e40af',\n 900: '#1e3a8a',\n 950: '#172554',\n },\n neutral: {\n 50: '#f9fafb',\n 100: '#f3f4f6',\n 200: '#e5e7eb',\n 300: '#d1d5db',\n 400: '#9ca3af',\n 500: '#6b7280',\n 600: '#4b5563',\n 700: '#374151',\n 800: '#1f2937',\n 900: '#111827',\n 950: '#030712',\n },\n danger: {\n 500: '#ef4444',\n 600: '#dc2626',\n },\n success: {\n 500: '#22c55e',\n 600: '#16a34a',\n },\n} as const\n"],"names":["colors"],"mappings":"AAAO,MAAMA,IAAS;AAAA,EACpB,SAAS;AAAA,IACP,IAAI;AAAA,IACJ,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,EAAA;AAAA,EAEP,SAAS;AAAA,IACP,IAAI;AAAA,IACJ,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,EAAA;AAAA,EAEP,QAAQ;AAAA,IACN,KAAK;AAAA,IACL,KAAK;AAAA,EAAA;AAAA,EAEP,SAAS;AAAA,IACP,KAAK;AAAA,IACL,KAAK;AAAA,EAAA;AAET;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const i = {
|
|
2
|
+
duration: {
|
|
3
|
+
fast: "100ms",
|
|
4
|
+
base: "200ms",
|
|
5
|
+
slow: "350ms"
|
|
6
|
+
},
|
|
7
|
+
easing: {
|
|
8
|
+
ui: "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
9
|
+
spring: "cubic-bezier(0.34, 1.56, 0.64, 1)"
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
i as motion
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=motion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"motion.js","sources":["../../../src/tokens/motion.ts"],"sourcesContent":["export const motion = {\n duration: {\n fast: '100ms',\n base: '200ms',\n slow: '350ms',\n },\n easing: {\n ui: 'cubic-bezier(0.4, 0, 0.2, 1)',\n spring: 'cubic-bezier(0.34, 1.56, 0.64, 1)',\n },\n} as const\n"],"names":["motion"],"mappings":"AAAO,MAAMA,IAAS;AAAA,EACpB,UAAU;AAAA,IACR,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,EAAA;AAAA,EAER,QAAQ;AAAA,IACN,IAAI;AAAA,IACJ,QAAQ;AAAA,EAAA;AAEZ;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radius.js","sources":["../../../src/tokens/radius.ts"],"sourcesContent":["export const radius = {\n sm: '0.25rem',\n md: '0.375rem',\n lg: '0.5rem',\n full: '9999px',\n} as const\n"],"names":["radius"],"mappings":"AAAO,MAAMA,IAAS;AAAA,EACpB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,MAAM;AACR;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spacing.js","sources":["../../../src/tokens/spacing.ts"],"sourcesContent":["export const spacing = {\n xs: '0.25rem',\n sm: '0.5rem',\n md: '1rem',\n lg: '1.5rem',\n xl: '2rem',\n '2xl': '3rem',\n} as const\n"],"names":["spacing"],"mappings":"AAAO,MAAMA,IAAU;AAAA,EACrB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,OAAO;AACT;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const e = {
|
|
2
|
+
fontFamily: {
|
|
3
|
+
sans: "Inter, system-ui, sans-serif",
|
|
4
|
+
mono: "JetBrains Mono, monospace"
|
|
5
|
+
},
|
|
6
|
+
fontSize: {
|
|
7
|
+
xs: "0.75rem",
|
|
8
|
+
sm: "0.875rem",
|
|
9
|
+
base: "1rem",
|
|
10
|
+
lg: "1.125rem",
|
|
11
|
+
xl: "1.25rem"
|
|
12
|
+
},
|
|
13
|
+
lineHeight: {
|
|
14
|
+
xs: "1rem",
|
|
15
|
+
sm: "1.25rem",
|
|
16
|
+
base: "1.5rem",
|
|
17
|
+
lg: "1.75rem",
|
|
18
|
+
xl: "1.75rem"
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
e as typography
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=typography.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typography.js","sources":["../../../src/tokens/typography.ts"],"sourcesContent":["export const typography = {\n fontFamily: {\n sans: 'Inter, system-ui, sans-serif',\n mono: 'JetBrains Mono, monospace',\n },\n fontSize: {\n xs: '0.75rem',\n sm: '0.875rem',\n base: '1rem',\n lg: '1.125rem',\n xl: '1.25rem',\n },\n lineHeight: {\n xs: '1rem',\n sm: '1.25rem',\n base: '1.5rem',\n lg: '1.75rem',\n xl: '1.75rem',\n },\n} as const\n"],"names":["typography"],"mappings":"AAAO,MAAMA,IAAa;AAAA,EACxB,YAAY;AAAA,IACV,MAAM;AAAA,IACN,MAAM;AAAA,EAAA;AAAA,EAER,UAAU;AAAA,IACR,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA;AAAA,EAEN,YAAY;AAAA,IACV,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA;AAER;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"z-index.js","sources":["../../../src/tokens/z-index.ts"],"sourcesContent":["export const zIndex = {\n dropdown: 1000,\n sticky: 1100,\n overlay: 1200,\n modal: 1300,\n toast: 1400,\n tooltip: 1500,\n} as const\n"],"names":["zIndex"],"mappings":"AAAO,MAAMA,IAAS;AAAA,EACpB,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,OAAO;AAAA,EACP,OAAO;AAAA,EACP,SAAS;AACX;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cn.js","sources":["../../../src/utils/cn.ts"],"sourcesContent":["import { clsx, type ClassValue } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n"],"names":["cn","inputs","twMerge","clsx"],"mappings":";;AAGO,SAASA,KAAMC,GAAsB;AAC1C,SAAOC,EAAQC,EAAKF,CAAM,CAAC;AAC7B;"}
|
package/dist/globals.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.19 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:var(--font-sans),system-ui,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:var(--font-mono),monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}*,:after,:before{box-sizing:border-box}[role=button],a,button{touch-action:manipulation}@media (prefers-reduced-motion:reduce){*,:after,:before{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.sticky{position:sticky}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.h-10{height:2.5rem}.h-12{height:3rem}.h-4{height:1rem}.h-8{height:2rem}.min-h-screen{min-height:100vh}.min-h-touch{min-height:44px}.w-4{width:1rem}.min-w-touch{min-width:44px}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin{animation:spin 1s linear infinite}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.gap-2{gap:.5rem}.gap-4{gap:1rem}.rounded-md{border-radius:var(--radius-md)}.border{border-width:1px}.border-neutral-300{border-color:var(--color-neutral-300)}.bg-danger-500{background-color:var(--color-danger-500)}.bg-neutral-100{background-color:var(--color-neutral-100)}.bg-neutral-900{background-color:var(--color-neutral-900)}.bg-primary-600{background-color:var(--color-primary-600)}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.p-4{padding:1rem}.p-8{padding:2rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.text-base{font-size:var(--text-base);line-height:var(--leading-base)}.text-sm{font-size:var(--text-sm);line-height:var(--leading-sm)}.font-medium{font-weight:500}.text-neutral-700{color:var(--color-neutral-700)}.text-neutral-900{color:var(--color-neutral-900)}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.opacity-25{opacity:.25}.opacity-75{opacity:.75}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-base{transition-duration:var(--duration-base)}:root{--color-primary-50:#eff6ff;--color-primary-100:#dbeafe;--color-primary-200:#bfdbfe;--color-primary-300:#93c5fd;--color-primary-400:#60a5fa;--color-primary-500:#3b82f6;--color-primary-600:#2563eb;--color-primary-700:#1d4ed8;--color-primary-800:#1e40af;--color-primary-900:#1e3a8a;--color-primary-950:#172554;--color-neutral-50:#f9fafb;--color-neutral-100:#f3f4f6;--color-neutral-200:#e5e7eb;--color-neutral-300:#d1d5db;--color-neutral-400:#9ca3af;--color-neutral-500:#6b7280;--color-neutral-600:#4b5563;--color-neutral-700:#374151;--color-neutral-800:#1f2937;--color-neutral-900:#111827;--color-neutral-950:#030712;--color-danger-500:#ef4444;--color-danger-600:#dc2626;--color-success-500:#22c55e;--color-success-600:#16a34a;--spacing-xs:0.25rem;--spacing-sm:0.5rem;--spacing-md:1rem;--spacing-lg:1.5rem;--spacing-xl:2rem;--spacing-2xl:3rem;--radius-sm:0.25rem;--radius-md:0.375rem;--radius-lg:0.5rem;--font-sans:Inter,system-ui,sans-serif;--font-mono:"JetBrains Mono",monospace;--text-xs:0.75rem;--text-sm:0.875rem;--text-base:1rem;--text-lg:1.125rem;--text-xl:1.25rem;--leading-xs:1rem;--leading-sm:1.25rem;--leading-base:1.5rem;--leading-lg:1.75rem;--leading-xl:1.75rem;--z-dropdown:1000;--z-sticky:1100;--z-overlay:1200;--z-modal:1300;--z-toast:1400;--z-tooltip:1500;--duration-fast:100ms;--duration-base:200ms;--duration-slow:350ms;--ease-ui:cubic-bezier(0.4,0,0.2,1);--ease-spring:cubic-bezier(0.34,1.56,0.64,1)}html.dark{--color-primary-600:#3b82f6;--color-primary-700:#2563eb;--color-primary-800:#1d4ed8;--color-neutral-50:#111827;--color-neutral-100:#1f2937;--color-neutral-200:#374151;--color-neutral-300:#4b5563;--color-neutral-400:#6b7280;--color-neutral-500:#9ca3af;--color-neutral-600:#d1d5db;--color-neutral-700:#e5e7eb;--color-neutral-800:#f3f4f6;--color-neutral-900:#f9fafb;--color-neutral-950:#fff;--color-danger-500:#f87171;--color-danger-600:#ef4444}.hover\:bg-danger-600:hover{background-color:var(--color-danger-600)}.hover\:bg-neutral-100:hover{background-color:var(--color-neutral-100)}.hover\:bg-neutral-200:hover{background-color:var(--color-neutral-200)}.hover\:bg-primary-700:hover{background-color:var(--color-primary-700)}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\:ring-danger-500:focus-visible{--tw-ring-color:var(--color-danger-500)}.focus-visible\:ring-neutral-500:focus-visible{--tw-ring-color:var(--color-neutral-500)}.focus-visible\:ring-primary-500:focus-visible{--tw-ring-color:var(--color-primary-500)}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px}.active\:bg-danger-600:active{background-color:var(--color-danger-600)}.active\:bg-neutral-200:active{background-color:var(--color-neutral-200)}.active\:bg-neutral-300:active{background-color:var(--color-neutral-300)}.active\:bg-primary-800:active{background-color:var(--color-primary-800)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:opacity-50:disabled{opacity:.5}@media (prefers-reduced-motion:reduce){.motion-reduce\:transition-none{transition-property:none}}.dark\:border-neutral-600:is(.dark *){border-color:var(--color-neutral-600)}.dark\:bg-neutral-800:is(.dark *){background-color:var(--color-neutral-800)}.dark\:text-neutral-100:is(.dark *){color:var(--color-neutral-100)}.dark\:text-neutral-300:is(.dark *){color:var(--color-neutral-300)}.dark\:hover\:bg-neutral-700:hover:is(.dark *){background-color:var(--color-neutral-700)}.dark\:hover\:bg-neutral-800:hover:is(.dark *){background-color:var(--color-neutral-800)}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes } from 'react';
|
|
2
|
+
import { ForwardRefExoticComponent } from 'react';
|
|
3
|
+
import { RefAttributes } from 'react';
|
|
4
|
+
|
|
5
|
+
export declare const Button: ForwardRefExoticComponent<ButtonProps & RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
|
|
7
|
+
export declare interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
8
|
+
variant?: ButtonVariant;
|
|
9
|
+
size?: ButtonSize;
|
|
10
|
+
isLoading?: boolean;
|
|
11
|
+
loadingText?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export declare type ButtonSize = 'sm' | 'md' | 'lg';
|
|
15
|
+
|
|
16
|
+
export declare type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger';
|
|
17
|
+
|
|
18
|
+
export declare const colors: {
|
|
19
|
+
readonly primary: {
|
|
20
|
+
readonly 50: "#eff6ff";
|
|
21
|
+
readonly 100: "#dbeafe";
|
|
22
|
+
readonly 200: "#bfdbfe";
|
|
23
|
+
readonly 300: "#93c5fd";
|
|
24
|
+
readonly 400: "#60a5fa";
|
|
25
|
+
readonly 500: "#3b82f6";
|
|
26
|
+
readonly 600: "#2563eb";
|
|
27
|
+
readonly 700: "#1d4ed8";
|
|
28
|
+
readonly 800: "#1e40af";
|
|
29
|
+
readonly 900: "#1e3a8a";
|
|
30
|
+
readonly 950: "#172554";
|
|
31
|
+
};
|
|
32
|
+
readonly neutral: {
|
|
33
|
+
readonly 50: "#f9fafb";
|
|
34
|
+
readonly 100: "#f3f4f6";
|
|
35
|
+
readonly 200: "#e5e7eb";
|
|
36
|
+
readonly 300: "#d1d5db";
|
|
37
|
+
readonly 400: "#9ca3af";
|
|
38
|
+
readonly 500: "#6b7280";
|
|
39
|
+
readonly 600: "#4b5563";
|
|
40
|
+
readonly 700: "#374151";
|
|
41
|
+
readonly 800: "#1f2937";
|
|
42
|
+
readonly 900: "#111827";
|
|
43
|
+
readonly 950: "#030712";
|
|
44
|
+
};
|
|
45
|
+
readonly danger: {
|
|
46
|
+
readonly 500: "#ef4444";
|
|
47
|
+
readonly 600: "#dc2626";
|
|
48
|
+
};
|
|
49
|
+
readonly success: {
|
|
50
|
+
readonly 500: "#22c55e";
|
|
51
|
+
readonly 600: "#16a34a";
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export declare const motion: {
|
|
56
|
+
readonly duration: {
|
|
57
|
+
readonly fast: "100ms";
|
|
58
|
+
readonly base: "200ms";
|
|
59
|
+
readonly slow: "350ms";
|
|
60
|
+
};
|
|
61
|
+
readonly easing: {
|
|
62
|
+
readonly ui: "cubic-bezier(0.4, 0, 0.2, 1)";
|
|
63
|
+
readonly spring: "cubic-bezier(0.34, 1.56, 0.64, 1)";
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export declare const radius: {
|
|
68
|
+
readonly sm: "0.25rem";
|
|
69
|
+
readonly md: "0.375rem";
|
|
70
|
+
readonly lg: "0.5rem";
|
|
71
|
+
readonly full: "9999px";
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export declare const spacing: {
|
|
75
|
+
readonly xs: "0.25rem";
|
|
76
|
+
readonly sm: "0.5rem";
|
|
77
|
+
readonly md: "1rem";
|
|
78
|
+
readonly lg: "1.5rem";
|
|
79
|
+
readonly xl: "2rem";
|
|
80
|
+
readonly '2xl': "3rem";
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export declare const typography: {
|
|
84
|
+
readonly fontFamily: {
|
|
85
|
+
readonly sans: "Inter, system-ui, sans-serif";
|
|
86
|
+
readonly mono: "JetBrains Mono, monospace";
|
|
87
|
+
};
|
|
88
|
+
readonly fontSize: {
|
|
89
|
+
readonly xs: "0.75rem";
|
|
90
|
+
readonly sm: "0.875rem";
|
|
91
|
+
readonly base: "1rem";
|
|
92
|
+
readonly lg: "1.125rem";
|
|
93
|
+
readonly xl: "1.25rem";
|
|
94
|
+
};
|
|
95
|
+
readonly lineHeight: {
|
|
96
|
+
readonly xs: "1rem";
|
|
97
|
+
readonly sm: "1.25rem";
|
|
98
|
+
readonly base: "1.5rem";
|
|
99
|
+
readonly lg: "1.75rem";
|
|
100
|
+
readonly xl: "1.75rem";
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export declare interface UIThemeTokens {
|
|
105
|
+
colors: typeof colors;
|
|
106
|
+
spacing: typeof spacing;
|
|
107
|
+
radius: typeof radius;
|
|
108
|
+
typography: typeof typography;
|
|
109
|
+
zIndex: typeof zIndex;
|
|
110
|
+
motion: typeof motion;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export declare const zIndex: {
|
|
114
|
+
readonly dropdown: 1000;
|
|
115
|
+
readonly sticky: 1100;
|
|
116
|
+
readonly overlay: 1200;
|
|
117
|
+
readonly modal: 1300;
|
|
118
|
+
readonly toast: 1400;
|
|
119
|
+
readonly tooltip: 1500;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export { }
|
package/package.json
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@inzumer/ui-library",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Production-grade React component library for web and mobile webview.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"react",
|
|
7
|
+
"ui",
|
|
8
|
+
"component-library",
|
|
9
|
+
"accessibility",
|
|
10
|
+
"design-system",
|
|
11
|
+
"tailwind"
|
|
12
|
+
],
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"main": "./dist/cjs/index.js",
|
|
15
|
+
"module": "./dist/es/index.js",
|
|
16
|
+
"types": "./dist/types/index.d.ts",
|
|
17
|
+
"sideEffects": false,
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/types/index.d.ts",
|
|
21
|
+
"import": "./dist/es/index.js",
|
|
22
|
+
"require": "./dist/cjs/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./styles": "./dist/globals.css"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"dist"
|
|
28
|
+
],
|
|
29
|
+
"scripts": {
|
|
30
|
+
"dev": "storybook dev -p 6006",
|
|
31
|
+
"prebuild": "rm -rf dist",
|
|
32
|
+
"build": "BUILD_FORMAT=es vite build && BUILD_FORMAT=cjs vite build && npx tailwindcss -i ./src/styles/globals.css -o ./dist/globals.css --minify",
|
|
33
|
+
"build:storybook": "storybook build",
|
|
34
|
+
"test": "vitest run",
|
|
35
|
+
"test:watch": "vitest",
|
|
36
|
+
"test:coverage": "vitest run --coverage",
|
|
37
|
+
"typecheck": "tsc --noEmit",
|
|
38
|
+
"lint": "eslint src --ext .ts,.tsx",
|
|
39
|
+
"lint:fix": "eslint src --ext .ts,.tsx --fix",
|
|
40
|
+
"format": "prettier --write \"src/**/*.{ts,tsx}\"",
|
|
41
|
+
"format:check": "prettier --check \"src/**/*.{ts,tsx}\"",
|
|
42
|
+
"pre-publish": "npm run typecheck && npm run test && npm run build",
|
|
43
|
+
"publish:dry": "npm pack --dry-run",
|
|
44
|
+
"publish:local": "npm pack",
|
|
45
|
+
"release": "npm run pre-publish && npm publish --access public"
|
|
46
|
+
},
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"class-variance-authority": ">=0.7.0",
|
|
49
|
+
"clsx": ">=2.0.0",
|
|
50
|
+
"react": ">=18",
|
|
51
|
+
"react-dom": ">=18",
|
|
52
|
+
"tailwind-merge": ">=2.0.0"
|
|
53
|
+
},
|
|
54
|
+
"peerDependenciesMeta": {
|
|
55
|
+
"class-variance-authority": {
|
|
56
|
+
"optional": false
|
|
57
|
+
},
|
|
58
|
+
"clsx": {
|
|
59
|
+
"optional": false
|
|
60
|
+
},
|
|
61
|
+
"tailwind-merge": {
|
|
62
|
+
"optional": false
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"devDependencies": {
|
|
66
|
+
"@storybook/addon-a11y": "^8.4.7",
|
|
67
|
+
"@storybook/addon-actions": "8.6.18",
|
|
68
|
+
"@storybook/addon-docs": "8.6.18",
|
|
69
|
+
"@storybook/addon-interactions": "8.6.18",
|
|
70
|
+
"@storybook/addon-themes": "8.6.18",
|
|
71
|
+
"@storybook/addon-viewport": "^8.4.7",
|
|
72
|
+
"@storybook/react": "^8.4.7",
|
|
73
|
+
"@storybook/react-vite": "^8.4.7",
|
|
74
|
+
"@storybook/test": "^8.4.7",
|
|
75
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
76
|
+
"@testing-library/react": "^16.1.0",
|
|
77
|
+
"@testing-library/user-event": "^14.5.2",
|
|
78
|
+
"@types/jest-axe": "3.5.9",
|
|
79
|
+
"@types/react": "^18.3.12",
|
|
80
|
+
"@types/react-dom": "^18.3.1",
|
|
81
|
+
"@typescript-eslint/eslint-plugin": "^8.16.0",
|
|
82
|
+
"@typescript-eslint/parser": "^8.16.0",
|
|
83
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
84
|
+
"@vitest/coverage-v8": "^2.1.6",
|
|
85
|
+
"autoprefixer": "^10.4.20",
|
|
86
|
+
"class-variance-authority": "^0.7.1",
|
|
87
|
+
"clsx": "^2.1.1",
|
|
88
|
+
"eslint": "^9.16.0",
|
|
89
|
+
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
90
|
+
"eslint-plugin-react": "^7.37.3",
|
|
91
|
+
"eslint-plugin-react-hooks": "^5.0.0",
|
|
92
|
+
"eslint-plugin-storybook": "^0.11.1",
|
|
93
|
+
"jest-axe": "^9.0.0",
|
|
94
|
+
"jsdom": "^25.0.1",
|
|
95
|
+
"postcss": "^8.4.49",
|
|
96
|
+
"prettier": "^3.4.2",
|
|
97
|
+
"storybook": "^8.4.7",
|
|
98
|
+
"tailwind-merge": "^2.5.5",
|
|
99
|
+
"tailwindcss": "^3.4.16",
|
|
100
|
+
"typescript": "^5.7.2",
|
|
101
|
+
"vite": "^6.0.5",
|
|
102
|
+
"vite-plugin-dts": "^4.3.0",
|
|
103
|
+
"vitest": "^2.1.6"
|
|
104
|
+
}
|
|
105
|
+
}
|