twico-ui 0.1.0 → 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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Twico UI
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Twico UI
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,182 +1,233 @@
1
- # Twico UI
2
-
3
- A **free**, modern, themeable **React** component library — 53 components with **dark mode**, motion, and accessibility built in. No runtime CSS framework required: components are styled with CSS custom properties (design tokens), so they theme by overriding variables and work great alongside Tailwind or plain CSS.
4
-
5
- ```bash
6
- npm install twico-ui
7
- ```
8
-
9
- > Requires **React 18+** (`react` and `react-dom` are peer dependencies).
10
-
11
- ## Framework setup
12
-
13
- Twico UI works in any React 18+ app. Every component ships with a `"use client"` boundary, so it drops straight into **Next.js App Router** Server Components without extra wrapping.
14
-
15
- ### React (Vite / CRA)
16
-
17
- Import the stylesheet once at your entry, then use components anywhere:
18
-
19
- ```jsx
20
- // main.jsx
21
- import "twico-ui/styles.css";
22
- ```
23
-
24
- ```jsx
25
- // App.jsx
26
- import { Button, Datatable } from "twico-ui";
27
- ```
28
-
29
- ### Next.js — App Router (`app/`)
30
-
31
- Import the CSS once in the root layout. Components can be used directly in Server **or** Client Components (they self-mark as client):
32
-
33
- ```tsx
34
- // app/layout.tsx
35
- import "twico-ui/styles.css";
36
-
37
- export default function RootLayout({ children }: { children: React.ReactNode }) {
38
- return (
39
- <html lang="en">
40
- <body>{children}</body>
41
- </html>
42
- );
43
- }
44
- ```
45
-
46
- ```tsx
47
- // app/page.tsx (a Server Component — no "use client" needed)
48
- import { Stat, Button } from "twico-ui";
49
-
50
- export default function Page() {
51
- return (
52
- <main>
53
- <Stat label="Revenue" value="$48,200" delta="+12.5%" />
54
- <Button>Get started</Button>
55
- </main>
56
- );
57
- }
58
- ```
59
-
60
- For dark mode in the App Router, toggle the class on `<html>` from a Client Component (e.g. a theme button) or set it server-side via the `className` on `<html>`.
61
-
62
- ### Next.js — Pages Router (`pages/`)
63
-
64
- Import the CSS once in the custom `_app`:
65
-
66
- ```tsx
67
- // pages/_app.tsx
68
- import "twico-ui/styles.css";
69
- import type { AppProps } from "next/app";
70
-
71
- export default function App({ Component, pageProps }: AppProps) {
72
- return <Component {...pageProps} />;
73
- }
74
- ```
75
-
76
- ### SSR / hydration notes
77
-
78
- - Components are **SSR-safe** — nothing touches `window`/`document` during render; all browser access is inside effects and event handlers.
79
- - The global stylesheet (`twico-ui/styles.css`) provides the design tokens, base reset, and self-hosted fonts at first paint. Each component also injects its own scoped CSS on mount, so styles settle immediately after hydration.
80
- - Overlays (Menu, Popover, Select, CommandPalette, Drawer, Dialog) render through React **portals** to `document.body` only while open, so they never run on the server.
81
-
82
- ## Quick start
83
-
84
- Import the stylesheet **once** at your app root, then use any component:
85
-
86
- ```jsx
87
- import "twico-ui/styles.css";
88
- import { Button, Datatable, Input, Switch } from "twico-ui";
89
-
90
- export default function App() {
91
- return (
92
- <div style={{ padding: 24 }}>
93
- <Input label="Email" placeholder="you@example.com" />
94
- <Button>Save changes</Button>
95
-
96
- <Datatable
97
- rows={[
98
- { id: 1, name: "Jane Cooper", role: "Admin", mrr: 480 },
99
- { id: 2, name: "Wade Warren", role: "Editor", mrr: 48 },
100
- ]}
101
- rowKey={(r) => r.id}
102
- columns={[
103
- { field: "name", headerName: "Member", width: 200 },
104
- { field: "role", headerName: "Role", valueOptions: ["Admin", "Editor"] },
105
- { field: "mrr", headerName: "MRR", type: "number", valueFormatter: (v) => `$${v}` },
106
- ]}
107
- />
108
- </div>
109
- );
110
- }
111
- ```
112
-
113
- ## Dark mode
114
-
115
- Dark tokens live on the document root. Add `class="dark"` (or `data-theme="dark"`) to `<html>`:
116
-
117
- ```js
118
- document.documentElement.classList.toggle("dark");
119
- ```
120
-
121
- Everything — including portaled menus, popovers, and the command palette — re-themes together.
122
-
123
- ## Theming
124
-
125
- All visuals derive from CSS custom properties. Override them in your own CSS to rebrand without touching components:
126
-
127
- ```css
128
- :root {
129
- --color-primary: #7c3aed; /* brand color */
130
- --radius-md: 10px; /* corner radius */
131
- --font-sans: "Inter", sans-serif;/* typeface */
132
- }
133
- ```
134
-
135
- See `styles/twico-ui.css` for the full token set (colors, typography, spacing, radius, motion). The bundled stylesheet also self-hosts the default fonts (Plus Jakarta Sans + JetBrains Mono, OFL) under `twico-ui/styles/fonts/`.
136
-
137
- ## Components
138
-
139
- **Buttons & actions:** Button, IconButton
140
- **Inputs:** Input, Textarea, Currency, CurrencyField, Select, MultiSelect, Combobox, Checkbox, Radio, Switch, Slider, Rating, FileUpload, DatePicker, DateRangePicker, ColorPicker
141
- **Data display:** Card, Avatar, AvatarMenu, Badge, Tag, Stat, List, Timeline, Chart, Table, Pagination, Datatable, Kanban
142
- **Navigation:** Tabs, Accordion, Breadcrumb, Stepper, Navbar, Sidebar, TreeView
143
- **Overlay:** Tooltip, Popover, Menu, Dialog, Drawer, CommandPalette
144
- **Feedback:** Alert, Spinner, Progress, Skeleton, Toast (+ ToastViewport), EmptyState, Divider, Carousel
145
-
146
- Every component ships full TypeScript types (e.g. `import type { DatatableProps } from "twico-ui"`).
147
-
148
- ## Building & publishing (maintainers)
149
-
150
- This repo is both the Twico UI **design system** and the source of the npm package. The published package contains only the built output (`dist/` + `styles/`).
151
-
152
- ```bash
153
- npm install # install build tooling (tsup, typescript)
154
- npm run build # bundle src/index.ts -> dist (ESM + CJS + .d.ts)
155
- npm publish # prepublishOnly runs the build automatically
156
- ```
157
-
158
- - `src/index.ts` is an auto-generated barrel that re-exports every component from `components/`.
159
- - `tsup` bundles the JSX to `dist/index.mjs` / `dist/index.cjs` and rolls the hand-written `.d.ts` props contracts into `dist/index.d.ts`.
160
- - A post-build step (`scripts/add-use-client.mjs`) prepends the `"use client"` directive to the bundles (a tsup `banner` is stripped by esbuild), so the package imports cleanly into Next.js App Router Server Components.
161
- - `react` / `react-dom` stay external (peer deps).
162
-
163
- See [`DESIGN-SYSTEM.md`](./DESIGN-SYSTEM.md) for the full design guide (tokens, voice, visual foundations, iconography).
164
-
165
- ### Branching & releases
166
-
167
- Twico UI follows **[semantic versioning](https://semver.org/)** (`MAJOR.MINOR.PATCH`):
168
-
169
- - **`dev`** — the integration branch. All day-to-day work happens here or on `feat/*` / `fix/*` branches that merge into it. Every push and PR runs **CI** (`.github/workflows/ci.yml`): type-check, build, and an assertion that the `"use client"` banner survived bundling.
170
- - **`main`** — the release branch. It is the **only** branch wired to publish (`.github/workflows/publish.yml`). Merging `dev → main` triggers a release.
171
-
172
- To cut a release:
173
-
174
- 1. On `dev`, bump the version in `package.json` per semver (`patch` = fixes, `minor` = new components/props, `major` = breaking changes).
175
- 2. Open a PR from `dev` into `main` and merge it.
176
- 3. The publish workflow builds, publishes to npm with provenance, and tags the commit `vX.Y.Z`. It is **idempotent** — if `package.json`'s version is already on npm, the publish step is skipped, so an accidental merge without a version bump never errors.
177
-
178
- > Publishing requires an `NPM_TOKEN` repository secret (an npm automation token with publish rights).
179
-
180
- ## License
181
-
182
- MIT © Twico UI. Free for any use — personal or commercial.
1
+ # Twico UI
2
+
3
+ A **free**, modern, themeable **React** component library — 61 components with **dark mode**, motion, and accessibility built in. No runtime CSS framework required: components are styled with CSS custom properties (design tokens), so they theme by overriding variables and work great alongside Tailwind or plain CSS.
4
+
5
+ ```bash
6
+ npm install twico-ui
7
+ ```
8
+
9
+ > Requires **React 18+** (`react` and `react-dom` are peer dependencies).
10
+
11
+ 📖 **Documentation, live examples & API reference:** **https://encryptionl.github.io/twico-ui/**
12
+
13
+ ## Framework setup
14
+
15
+ Twico UI works in any React 18+ app. Every component ships with a `"use client"` boundary, so it drops straight into **Next.js App Router** Server Components without extra wrapping.
16
+
17
+ ### React (Vite / CRA)
18
+
19
+ Import the stylesheet once at your entry, then use components anywhere:
20
+
21
+ ```jsx
22
+ // main.jsx
23
+ import "twico-ui/styles.css";
24
+ ```
25
+
26
+ ```jsx
27
+ // App.jsx
28
+ import { Button, Datatable } from "twico-ui";
29
+ ```
30
+
31
+ ### Next.js — App Router (`app/`)
32
+
33
+ Import the CSS once in the root layout. Components can be used directly in Server **or** Client Components (they self-mark as client):
34
+
35
+ ```tsx
36
+ // app/layout.tsx
37
+ import "twico-ui/styles.css";
38
+
39
+ export default function RootLayout({ children }: { children: React.ReactNode }) {
40
+ return (
41
+ <html lang="en">
42
+ <body>{children}</body>
43
+ </html>
44
+ );
45
+ }
46
+ ```
47
+
48
+ ```tsx
49
+ // app/page.tsx (a Server Component — no "use client" needed)
50
+ import { Stat, Button } from "twico-ui";
51
+
52
+ export default function Page() {
53
+ return (
54
+ <main>
55
+ <Stat label="Revenue" value="$48,200" delta="+12.5%" />
56
+ <Button>Get started</Button>
57
+ </main>
58
+ );
59
+ }
60
+ ```
61
+
62
+ For dark mode in the App Router, toggle the class on `<html>` from a Client Component (e.g. a theme button) or set it server-side via the `className` on `<html>`.
63
+
64
+ ### Next.js — Pages Router (`pages/`)
65
+
66
+ Import the CSS once in the custom `_app`:
67
+
68
+ ```tsx
69
+ // pages/_app.tsx
70
+ import "twico-ui/styles.css";
71
+ import type { AppProps } from "next/app";
72
+
73
+ export default function App({ Component, pageProps }: AppProps) {
74
+ return <Component {...pageProps} />;
75
+ }
76
+ ```
77
+
78
+ ### SSR / hydration notes
79
+
80
+ - Components are **SSR-safe** — nothing touches `window`/`document` during render; all browser access is inside effects and event handlers.
81
+ - The global stylesheet (`twico-ui/styles.css`) provides the design tokens, base reset, and self-hosted fonts at first paint. Each component also injects its own scoped CSS on mount, so styles settle immediately after hydration.
82
+ - Overlays (Menu, Popover, Select, CommandPalette, Drawer, Dialog) render through React **portals** to `document.body` only while open, so they never run on the server.
83
+
84
+ ## TypeScript & JavaScript
85
+
86
+ Twico UI ships as a dual **ESM + CommonJS** package with bundled type declarations, so it works identically in a plain JavaScript project or a TypeScript one:
87
+
88
+ - **TypeScript** — every component and hook ships full types; `import { Button, type ButtonProps } from "twico-ui"` resolves and is fully checked. Verified across `node16` (CJS **and** ESM) and `bundler` resolution with [are-the-types-wrong](https://github.com/arethetypeswrong/arethetypeswrong.github.io) (`npm run check:exports`). The `twico-ui/colors` subpath uses `exports`, a Node 12.7+ feature, so it requires `node16`-style resolution (the main entry also resolves under legacy `node10`).
89
+ - **JavaScript (ESM)** — `import { Button } from "twico-ui"`.
90
+ - **JavaScript (CommonJS)** — `const { Button } = require("twico-ui")`.
91
+
92
+ ```tsx
93
+ // TypeScript — full prop types + autocomplete
94
+ import { Button } from "twico-ui";
95
+ import type { ButtonProps } from "twico-ui";
96
+
97
+ const props: ButtonProps = { variant: "soft", size: "sm" };
98
+ ```
99
+
100
+ ## Quick start
101
+
102
+ Import the stylesheet **once** at your app root, then use any component:
103
+
104
+ ```jsx
105
+ import "twico-ui/styles.css";
106
+ import { Button, Datatable, Input, Switch } from "twico-ui";
107
+
108
+ export default function App() {
109
+ return (
110
+ <div style={{ padding: 24 }}>
111
+ <Input label="Email" placeholder="you@example.com" />
112
+ <Button>Save changes</Button>
113
+
114
+ <Datatable
115
+ rows={[
116
+ { id: 1, name: "Jane Cooper", role: "Admin", mrr: 480 },
117
+ { id: 2, name: "Wade Warren", role: "Editor", mrr: 48 },
118
+ ]}
119
+ rowKey={(r) => r.id}
120
+ columns={[
121
+ { field: "name", headerName: "Member", width: 200 },
122
+ { field: "role", headerName: "Role", valueOptions: ["Admin", "Editor"] },
123
+ { field: "mrr", headerName: "MRR", type: "number", valueFormatter: (v) => `$${v}` },
124
+ ]}
125
+ />
126
+ </div>
127
+ );
128
+ }
129
+ ```
130
+
131
+ ## Dark mode
132
+
133
+ Dark tokens live on the document root. Add `class="dark"` (or `data-theme="dark"`) to `<html>`:
134
+
135
+ ```js
136
+ document.documentElement.classList.toggle("dark");
137
+ ```
138
+
139
+ Everything — including portaled menus, popovers, and the command palette — re-themes together.
140
+
141
+ ## Theming
142
+
143
+ All visuals derive from CSS custom properties. Override them in your own CSS to rebrand without touching components:
144
+
145
+ ```css
146
+ :root {
147
+ --color-primary: #7c3aed; /* brand color */
148
+ --radius-md: 10px; /* corner radius */
149
+ --font-sans: "Inter", sans-serif;/* typeface */
150
+ }
151
+ ```
152
+
153
+ See `styles/twico-ui.css` for the full token set (colors, typography, spacing, radius, motion). The bundled stylesheet also self-hosts the default fonts (Plus Jakarta Sans + JetBrains Mono, OFL) under `twico-ui/styles/fonts/`.
154
+
155
+ ### Colors in JavaScript
156
+
157
+ For app theming prefer the semantic CSS variables above. When a token is awkward (charts, canvas, inline maths), the **primitive scales** are also available as JS — `import { red } from '@mui/material/colors'`–style:
158
+
159
+ ```js
160
+ import { indigo, slate, emerald, amber, rose, sky } from "twico-ui/colors";
161
+
162
+ const brand = indigo[500]; // "#6366f1"
163
+ ```
164
+
165
+ Each hue is an object keyed by shade — a full `50`–`950` ramp (`50, 100, 200, … 900, 950`). These are static values — unlike the `--color-*` aliases, they do not flip in dark mode.
166
+
167
+ ## Components
168
+
169
+ **Buttons & actions:** Button, IconButton
170
+ **Layout:** Box, Stack, Grid, Container
171
+ **Typography:** Heading, Text, Code
172
+ **Inputs:** Input, Textarea, Currency, CurrencyField, Select, MultiSelect, Combobox, Checkbox, Radio, Switch, Slider, Rating, FileUpload, DatePicker, DateRangePicker, ColorPicker
173
+ **Data display:** Card, Avatar, AvatarMenu, Badge, Tag, Stat, List, Timeline, Chart, Table, Pagination, Datatable, Kanban
174
+ **Navigation:** Tabs, Accordion, Breadcrumb, Stepper, Navbar, Sidebar, TreeView
175
+ **Overlay:** Tooltip, Popover, Menu, Dialog, Drawer, CommandPalette
176
+ **Feedback:** Alert, Spinner, Progress, Skeleton, Toast (+ ToastViewport), EmptyState, Divider, Carousel
177
+
178
+ Every component ships full TypeScript types (e.g. `import type { DatatableProps } from "twico-ui"`).
179
+
180
+ ## Hooks
181
+
182
+ The same SSR-safe, fully-typed React hooks the components are built on are exported from the package:
183
+
184
+ ```jsx
185
+ import { useMediaQuery, useDisclosure, useColorScheme, useCopyToClipboard } from "twico-ui";
186
+ ```
187
+
188
+ **State:** `useDisclosure`, `useToggle`, `useControllableState`, `useLocalStorage`, `usePrevious`
189
+ **Responsive & theme:** `useMediaQuery`, `usePrefersReducedMotion`, `useColorScheme`, `useWindowSize`
190
+ **Events & DOM:** `useEventListener`, `useClickOutside`, `useKeyPress`, `useHover`, `useIntersectionObserver`, `useScrollLock`
191
+ **Timing:** `useDebouncedValue`, `useDebouncedCallback`, `useInterval`, `useTimeout`
192
+ **Utilities:** `useCopyToClipboard`, `useId`, `useMounted`, `useIsomorphicLayoutEffect`
193
+
194
+ ## Building & publishing (maintainers)
195
+
196
+ This repo is both the Twico UI **design system** and the source of the npm package. The published package contains only the built output (`dist/` + `styles/`).
197
+
198
+ ```bash
199
+ npm install # install build tooling (tsup, typescript)
200
+ npm run build # bundle src/index.ts -> dist (ESM + CJS + .d.ts)
201
+ npm publish # prepublishOnly runs the build automatically
202
+ ```
203
+
204
+ - `src/index.ts` is an auto-generated barrel that re-exports every component from `components/`.
205
+ - `tsup` bundles the JSX to `dist/index.mjs` / `dist/index.cjs` and rolls the hand-written `.d.ts` props contracts into `dist/index.d.ts`.
206
+ - A post-build step (`scripts/add-use-client.mjs`) prepends the `"use client"` directive to the bundles (a tsup `banner` is stripped by esbuild), so the package imports cleanly into Next.js App Router Server Components.
207
+ - `react` / `react-dom` stay external (peer deps).
208
+
209
+ See [`DESIGN-SYSTEM.md`](./DESIGN-SYSTEM.md) for the full design guide (tokens, voice, visual foundations, iconography). Contributor/developer docs (architecture, releases, security, the docs site) live in [`docs/`](./docs/); the security policy is in [`SECURITY.md`](./SECURITY.md).
210
+
211
+ ### Versioning & releases
212
+
213
+ Releases are **fully automated** with [semantic-release](https://semantic-release.gitbook.io/) following **[semantic versioning](https://semver.org/)** — there are **no manual version bumps**.
214
+
215
+ - **`dev`** — the integration branch. Day-to-day work happens here or on `feat/*` / `fix/*` branches. Every push and PR runs **CI** (`.github/workflows/ci.yml`): type-check, build, and a check that the `"use client"` banner survived bundling.
216
+ - **`main`** — the release branch. **Every push to `main`** runs `.github/workflows/release.yml`, which computes the next version from the commit history and releases it.
217
+
218
+ Write [Conventional Commits](https://www.conventionalcommits.org/) and the version takes care of itself:
219
+
220
+ | Commit | Example | Release |
221
+ | --- | --- | --- |
222
+ | `fix:` | `fix: clamp datatable menu to viewport` | **patch** — `x.y.Z` |
223
+ | `feat:` | `feat: add Calendar component` | **minor** — `x.Y.0` |
224
+ | `feat!:` / `BREAKING CHANGE:` | `feat!: rename Datatable props` | **major** — `X.0.0` |
225
+ | `docs:` / `chore:` / `refactor:` / `test:` | — | no release |
226
+
227
+ On each push to `main`, semantic-release picks the next version, publishes to **npm** (with provenance), tags **`vX.Y.Z`**, writes **`CHANGELOG.md`**, bumps `package.json`, and opens a **GitHub Release**. A push with no release-worthy commits does nothing.
228
+
229
+ > **Version stays in sync automatically.** On every release the bot commits the bumped `package.json` (and `CHANGELOG.md`) back to `main`, so the `package.json` version on `main` always matches the latest version published to npm — they never drift. Requires an `NPM_TOKEN` repository secret (an npm automation token). If you enable branch protection on `main`, allow the release bot to push the changelog commit (or run semantic-release with a personal access token).
230
+
231
+ ## License
232
+
233
+ MIT © Twico UI. Free for any use — personal or commercial.
@@ -0,0 +1,98 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ // src/colors.ts
6
+ var indigo = {
7
+ 50: "#eef2ff",
8
+ 100: "#e0e7ff",
9
+ 200: "#c7d2fe",
10
+ 300: "#a5b4fc",
11
+ 400: "#818cf8",
12
+ 500: "#6366f1",
13
+ 600: "#4f46e5",
14
+ 700: "#4338ca",
15
+ 800: "#3730a3",
16
+ 900: "#312e81",
17
+ 950: "#1e1b4b"
18
+ };
19
+ var slate = {
20
+ 50: "#f8fafc",
21
+ 100: "#f1f5f9",
22
+ 200: "#e2e8f0",
23
+ 300: "#cbd5e1",
24
+ 400: "#94a3b8",
25
+ 500: "#64748b",
26
+ 600: "#475569",
27
+ 700: "#334155",
28
+ 800: "#1e293b",
29
+ 900: "#0f172a",
30
+ 950: "#020617"
31
+ };
32
+ var emerald = {
33
+ 50: "#ecfdf5",
34
+ 100: "#d1fae5",
35
+ 200: "#a7f3d0",
36
+ 300: "#6ee7b7",
37
+ 400: "#34d399",
38
+ 500: "#10b981",
39
+ 600: "#059669",
40
+ 700: "#047857",
41
+ 800: "#065f46",
42
+ 900: "#064e3b",
43
+ 950: "#022c22"
44
+ };
45
+ var amber = {
46
+ 50: "#fffbeb",
47
+ 100: "#fef3c7",
48
+ 200: "#fde68a",
49
+ 300: "#fcd34d",
50
+ 400: "#fbbf24",
51
+ 500: "#f59e0b",
52
+ 600: "#d97706",
53
+ 700: "#b45309",
54
+ 800: "#92400e",
55
+ 900: "#78350f",
56
+ 950: "#451a03"
57
+ };
58
+ var rose = {
59
+ 50: "#fff1f2",
60
+ 100: "#ffe4e6",
61
+ 200: "#fecdd3",
62
+ 300: "#fda4af",
63
+ 400: "#fb7185",
64
+ 500: "#f43f5e",
65
+ 600: "#e11d48",
66
+ 700: "#be123c",
67
+ 800: "#9f1239",
68
+ 900: "#881337",
69
+ 950: "#4c0519"
70
+ };
71
+ var sky = {
72
+ 50: "#f0f9ff",
73
+ 100: "#e0f2fe",
74
+ 200: "#bae6fd",
75
+ 300: "#7dd3fc",
76
+ 400: "#38bdf8",
77
+ 500: "#0ea5e9",
78
+ 600: "#0284c7",
79
+ 700: "#0369a1",
80
+ 800: "#075985",
81
+ 900: "#0c4a6e",
82
+ 950: "#082f49"
83
+ };
84
+ var brand = indigo;
85
+ var colors = { indigo, slate, emerald, amber, rose, sky };
86
+ var colors_default = colors;
87
+
88
+ exports.amber = amber;
89
+ exports.brand = brand;
90
+ exports.colors = colors;
91
+ exports.default = colors_default;
92
+ exports.emerald = emerald;
93
+ exports.indigo = indigo;
94
+ exports.rose = rose;
95
+ exports.sky = sky;
96
+ exports.slate = slate;
97
+ //# sourceMappingURL=colors.cjs.map
98
+ //# sourceMappingURL=colors.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/colors.ts"],"names":[],"mappings":";;;;;AAeO,IAAM,MAAA,GAAS;AAAA,EACpB,EAAA,EAAI,SAAA;AAAA,EACJ,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK;AACP;AAGO,IAAM,KAAA,GAAQ;AAAA,EACnB,EAAA,EAAI,SAAA;AAAA,EACJ,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK;AACP;AAGO,IAAM,OAAA,GAAU;AAAA,EACrB,EAAA,EAAI,SAAA;AAAA,EACJ,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK;AACP;AAGO,IAAM,KAAA,GAAQ;AAAA,EACnB,EAAA,EAAI,SAAA;AAAA,EACJ,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK;AACP;AAGO,IAAM,IAAA,GAAO;AAAA,EAClB,EAAA,EAAI,SAAA;AAAA,EACJ,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK;AACP;AAGO,IAAM,GAAA,GAAM;AAAA,EACjB,EAAA,EAAI,SAAA;AAAA,EACJ,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA,EACL,GAAA,EAAK;AACP;AAGO,IAAM,KAAA,GAAQ;AAGd,IAAM,SAAS,EAAE,MAAA,EAAQ,OAAO,OAAA,EAAS,KAAA,EAAO,MAAM,GAAA;AAE7D,IAAO,cAAA,GAAQ","file":"colors.cjs","sourcesContent":["// twico-ui/colors — the primitive color scales as plain JS objects.\n//\n// Mirrors Material UI's `@mui/material/colors`: given a HUE and a SHADE you can\n// import a hex string directly —\n//\n// import { indigo } from \"twico-ui/colors\";\n// const color = indigo[500]; // \"#6366f1\"\n//\n// These are the same raw values declared as `--indigo-*` / `--slate-*` / … in\n// tokens/colors.css; tests/colors.test.ts asserts the two never drift. Use these\n// when a CSS custom property is awkward (charts, canvas, inline style maths, JS\n// theme objects). For app theming prefer the SEMANTIC aliases (`var(--color-primary)`,\n// `var(--color-surface)`, …) which also flip under dark mode — JS primitives do not.\n\n/** Indigo — the brand scale. Remap `--brand-*` (CSS) to reskin the library. */\nexport const indigo = {\n 50: \"#eef2ff\",\n 100: \"#e0e7ff\",\n 200: \"#c7d2fe\",\n 300: \"#a5b4fc\",\n 400: \"#818cf8\",\n 500: \"#6366f1\",\n 600: \"#4f46e5\",\n 700: \"#4338ca\",\n 800: \"#3730a3\",\n 900: \"#312e81\",\n 950: \"#1e1b4b\",\n} as const;\n\n/** Slate — the neutral scale (surfaces, borders, text). */\nexport const slate = {\n 50: \"#f8fafc\",\n 100: \"#f1f5f9\",\n 200: \"#e2e8f0\",\n 300: \"#cbd5e1\",\n 400: \"#94a3b8\",\n 500: \"#64748b\",\n 600: \"#475569\",\n 700: \"#334155\",\n 800: \"#1e293b\",\n 900: \"#0f172a\",\n 950: \"#020617\",\n} as const;\n\n/** Emerald — the success hue. */\nexport const emerald = {\n 50: \"#ecfdf5\",\n 100: \"#d1fae5\",\n 200: \"#a7f3d0\",\n 300: \"#6ee7b7\",\n 400: \"#34d399\",\n 500: \"#10b981\",\n 600: \"#059669\",\n 700: \"#047857\",\n 800: \"#065f46\",\n 900: \"#064e3b\",\n 950: \"#022c22\",\n} as const;\n\n/** Amber — the warning hue. */\nexport const amber = {\n 50: \"#fffbeb\",\n 100: \"#fef3c7\",\n 200: \"#fde68a\",\n 300: \"#fcd34d\",\n 400: \"#fbbf24\",\n 500: \"#f59e0b\",\n 600: \"#d97706\",\n 700: \"#b45309\",\n 800: \"#92400e\",\n 900: \"#78350f\",\n 950: \"#451a03\",\n} as const;\n\n/** Rose — the danger hue. */\nexport const rose = {\n 50: \"#fff1f2\",\n 100: \"#ffe4e6\",\n 200: \"#fecdd3\",\n 300: \"#fda4af\",\n 400: \"#fb7185\",\n 500: \"#f43f5e\",\n 600: \"#e11d48\",\n 700: \"#be123c\",\n 800: \"#9f1239\",\n 900: \"#881337\",\n 950: \"#4c0519\",\n} as const;\n\n/** Sky — the info hue. */\nexport const sky = {\n 50: \"#f0f9ff\",\n 100: \"#e0f2fe\",\n 200: \"#bae6fd\",\n 300: \"#7dd3fc\",\n 400: \"#38bdf8\",\n 500: \"#0ea5e9\",\n 600: \"#0284c7\",\n 700: \"#0369a1\",\n 800: \"#075985\",\n 900: \"#0c4a6e\",\n 950: \"#082f49\",\n} as const;\n\n/** Alias of {@link indigo} — mirrors the CSS `--brand-*` → `--indigo-*` aliasing. */\nexport const brand = indigo;\n\n/** Every primitive scale, keyed by hue name. */\nexport const colors = { indigo, slate, emerald, amber, rose, sky } as const;\n\nexport default colors;\n"]}