kineto 0.1.0 → 0.2.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 CHANGED
@@ -1,279 +1,72 @@
1
1
  # Kineto
2
2
 
3
- A drop-in library of beautifully animated, copy-paste React components — in the spirit of
4
- [shadcn/ui](https://ui.shadcn.com), but with **motion as a first-class concern**, powered by
5
- [Motion](https://motion.dev) (package `motion`).
3
+ Kineto is a React component library with built-in motion. Buttons respond to a
4
+ press, dialogs animate open, and charts animate in. Use the same presets in your
5
+ own components to keep those interactions consistent.
6
6
 
7
- The defining idea is the same as shadcn: **components are source you own, not an installed
8
- black box.** Every component is self-contained, readable, themeable via CSS variables, and
9
- droppable into any React + Tailwind project with **zero custom runtime or provider required**.
7
+ [Browse components and live previews](https://kineto-theta.vercel.app/docs)
10
8
 
11
- ```
12
- . # repo root = the published `kineto` npm package
13
- src/
14
- lib/
15
- cn.ts # cn() = twMerge(clsx(...))
16
- gap.ts # spacing scale helper
17
- format-time.ts # relative/absolute time formatting
18
- motion-presets.ts # variants + transition tokens (single source of truth)
19
- use-reduced-motion.ts
20
- components/
21
- ui/ # primitives: button, badge, card, input, label, separator,
22
- # switch, tooltip, avatar, select, dropdown-menu, progress,
23
- # segmented-control, skeleton, dialog, tabs, accordion, …
24
- application/ # app surfaces: stat-card, data-table, sidebar, logo-cloud, …
25
- charts/ # data viz: area, bar, line, donut + chart-tooltip
26
- styles/
27
- theme.css # SHIPPED: tokens (:root + .dark) + Tailwind v4 @theme + @utility
28
- base.css # SHIPPED (optional): opinionated document styles
29
- kineto.css # docs-site aggregator — imports both; not published
30
- index.ts # public barrel for the npm package
31
- tsup.config.ts # library build → dist/ (ESM, per-component + barrel)
32
- site/ # the docs site (separate Next.js app; imports the library source)
33
- ```
34
-
35
- ## Installation — three ways to consume
36
-
37
- kineto is both a published library **and** a copy-the-source registry. Pick whichever fits.
9
+ ## Get started
38
10
 
39
- ### 1. shadcn CLI (copy the source into your project — the community default)
11
+ In a React app with Tailwind CSS v4, install Kineto and Motion.
40
12
 
41
- Every component is served as a [shadcn](https://ui.shadcn.com/docs/cli)-spec registry item, so
42
- the CLI writes the real source (plus its internal deps like `cn` and `motion-presets`) into your
43
- own `components/` and installs the npm deps it needs:
44
-
45
- ```bash
46
- # add the tokens once, then any component(s)
47
- npx shadcn@latest add https://<your-site>/r/kineto-theme.json
48
- npx shadcn@latest add https://<your-site>/r/button.json
13
+ ```sh
14
+ npm install kineto motion
49
15
  ```
50
16
 
51
- `registryDependencies` resolve automatically (e.g. `date-picker` pulls in `button`, `calendar`,
52
- and `popover`). Browse the index at `https://<your-site>/r/registry.json`. The theme item carries
53
- the color tokens; the utility layer it doesn't cover — `bg-dots`/`bg-grid`/`bg-grain`, the
54
- `bg-gradient-*` set, `shadow-soft`/`shadow-lift`, font mappings — comes from
55
- `@import "kineto/theme.css"`. `GradientText` and `GradientBorder` need that import specifically.
56
-
57
- ### 2. npm package (install the built library)
58
-
59
- ```bash
60
- npm i kineto
61
- ```
62
-
63
- Then wire it into your Tailwind entry. **Both lines are required** — the `@import` defines the
64
- tokens, and the `@source` is what makes Tailwind generate CSS for the classes inside our compiled
65
- components. Tailwind v4 never scans `node_modules` on its own, so without the `@source` you get a
66
- clean build and completely unstyled components:
17
+ Add the theme and register Kineto's compiled components in your Tailwind entry
18
+ file. Adjust both paths relative to that file.
67
19
 
68
20
  ```css
69
- /* index.css / globals.css */
70
21
  @import "tailwindcss";
71
-
72
22
  @import "../node_modules/kineto/theme.css";
73
- @source "../node_modules/kineto/**/*.js";
74
-
75
- /* Optional — opinionated document styles (body, selection, focus ring, scrollbars). */
76
- @import "../node_modules/kineto/base.css";
77
-
78
- /* Your customizations go after this: redefine any token on :root / .dark to re-skin. */
23
+ @source "../node_modules/kineto/dist";
79
24
  ```
80
25
 
81
26
  ```tsx
82
- import { Card } from "kineto/card"; // subpath — always tree-shakes, always server-safe
83
- import { Button } from "kineto"; // barrel — fine, but see the Next note below
84
- ```
27
+ import { Button } from "kineto/button";
85
28
 
86
- We ship **no pre-built CSS**. Every class resolves in your Tailwind build from your own config, so
87
- you get only the utilities you actually use and your overrides win normally.
88
-
89
- Both forms are tree-shakeable. `dist/index.js` is a re-export map over the per-component files, not
90
- a bundle, so each component stays its own module and keeps its own `"use client"` boundary — the 20
91
- directive-free primitives (`badge`, `input`, `container`, …) render on the server through the barrel
92
- too.
93
-
94
- **Next.js users: add one line.** Next turns every `"use client"` module reachable from a barrel into
95
- a client entry, and client entries are graph roots that webpack will not shake away. Next's own
96
- remedy rewrites barrel imports to subpath imports at compile time:
97
-
98
- ```js
99
- // next.config.mjs
100
- export default { experimental: { optimizePackageImports: ["kineto"] } };
29
+ <Button variant="brand">Save changes</Button>
101
30
  ```
102
31
 
103
- Measured, Next 14 App Router, page rendering one `<Button>` (First Load JS):
104
-
105
- | import | plain | with `optimizePackageImports` |
106
- | --- | --- | --- |
107
- | `from "kineto"` | 476 kB | **131 kB** |
108
- | `from "kineto/button"` | 131 kB | 131 kB |
109
-
110
- Bundlers that shake on the module graph directly — Vite, Rollup, plain webpack outside the RSC
111
- pipeline — need no configuration: there the barrel and the subpath emit byte-identical output
112
- (3,085 B for one `Button`, vendor external). If you would rather not touch `next.config.mjs`, use
113
- the subpath import; it is the one form that is optimal everywhere.
114
-
115
- All peers (`react`, `react-dom`, `motion`) are external; Radix/lucide/etc. ship as deps.
116
-
117
- ### 3. Manual copy
32
+ ## Use Kineto’s motion in your own components
118
33
 
119
- 1. Copy `src/lib/cn.ts`, `src/lib/motion-presets.ts`, and (optionally) `use-reduced-motion.ts`.
120
- 2. Copy any component file from `src/components/**`.
121
- 3. Copy the design tokens from `src/styles/theme.css` into your global stylesheet (and
122
- `src/styles/base.css` if you want the document-level styles too).
34
+ Kineto exports shared springs, reveal variants, stagger helpers, and press
35
+ feedback. For example, use the same press feedback as Kineto’s Button.
123
36
 
124
- Each component imports only from `react`, `motion/react`, `@/lib/cn`, `@/lib/motion-presets`,
125
- Radix (where applicable), and `lucide-react`. Drop it in and it renders and animates — no wiring.
126
-
127
- Tailwind CSS **v4** is used for styling (CSS-first config — see below).
128
-
129
- ## Theming with CSS variables
130
-
131
- All colors, radii, and shadows read from HSL CSS variables (like shadcn). Components never
132
- hardcode a hex value, so the entire library re-skins when you change the tokens or toggle
133
- the `.dark` class.
134
-
135
- ```css
136
- /* globals.css */
137
- :root {
138
- --background: 38 36% 97%; /* warm near-white */
139
- --foreground: 24 12% 12%; /* warm near-black */
140
- --primary: 24 14% 13%; /* ink — buttons & controls */
141
- --brand: 22 92% 52%; /* the one orange accent */
142
- --success: 142 58% 37%;
143
- --warning: 36 95% 46%;
144
- /* ...etc */
145
- --radius: 0.85rem;
146
- }
37
+ ```tsx
38
+ import { motion } from "motion/react";
39
+ import { interaction, spring } from "kineto/motion-presets";
147
40
 
148
- .dark { /* dark is the default theme */
149
- --background: 24 14% 7%; /* warm charcoal */
150
- --foreground: 40 18% 92%;
151
- --primary: 40 30% 96%; /* near-white ink */
152
- --brand: 22 95% 57%;
153
- /* ...etc */
154
- }
41
+ <motion.button whileTap={interaction.tap} transition={spring.snappy}>
42
+ Save changes
43
+ </motion.button>
155
44
  ```
156
45
 
157
- The identity keeps **ink** (near-black / near-white) as the primary for buttons and controls,
158
- and reserves a single **orange `--brand`** accent for emphasis, focus rings, and data. Beyond
159
- the shadcn base tokens it adds **status** colors (`--success`, `--warning`), a 5-stop
160
- **chart palette** (`--chart-1` … `--chart-5` — orange + warm greys) so data-display
161
- components stay on-theme in both modes, and a **gradient** layer (see below). Use the `brand`
162
- Button/Badge variants for orange CTAs.
163
-
164
- ### Gradients
46
+ For entrances, try `fadeUp` with `initial="hidden"` and `animate="visible"`.
47
+ Wrap your app in `<MotionConfig reducedMotion="user">` to respect the user's
48
+ reduced-motion preference for Motion animations.
165
49
 
166
- Gradients are part of the token system, not one-off `linear-gradient(...)` calls sprinkled through
167
- components. **Two stops and one angle** compose every gradient the library ships:
50
+ ## Change the theme with CSS
168
51
 
169
- | Token | Default | Notes |
170
- | --- | --- | --- |
171
- | `--gradient-from` | *unset* → `--brand` | Bare `H S% L%` triple, like every other color token. |
172
- | `--gradient-to` | *unset* → `--chart-3` | The accent's lighter sibling in every preset. |
173
- | `--gradient-angle` | `135deg` | Applies to the linear ramps. |
174
-
175
- Leaving the stops unset is the intended default: the utilities read them as
176
- `var(--gradient-from, var(--brand))`, so **the ramp follows whatever accent is in scope** — light,
177
- dark, a preset, or a subtree that re-colors `--brand`. That fallback is deliberate. Declaring
178
- `--gradient-from: var(--brand)` on `:root` would substitute *there* and keep serving the light
179
- accent to a nested `.dark` section. Pin the stops only when the ramp shouldn't track the accent:
52
+ Add your overrides after the theme import. Change `--brand` to update the accent
53
+ and `--radius` to adjust corner rounding across components. Color tokens use
54
+ plain HSL channels.
180
55
 
181
56
  ```css
182
57
  :root {
183
- --gradient-from: 265 85% 58%; /* violet → cyan, regardless of --brand */
184
- --gradient-to: 190 90% 55%;
185
- --gradient-angle: 100deg;
58
+ --brand: 260 70% 48%;
59
+ --radius: 0.5rem;
186
60
  }
187
- ```
188
-
189
- The utilities (all set `background-image` only, so they stack with `text-*` / `border-*`):
190
61
 
191
- | Utility | Use |
192
- | --- | --- |
193
- | `bg-gradient-brand` | The accent ramp at full strength. Pair with `text-brand-foreground`. |
194
- | `bg-gradient-brand-soft` | Same ramp at wash strength, under readable foreground text. |
195
- | `bg-gradient-brand-loop` | Seamless double-width ramp for panning animations. |
196
- | `bg-gradient-surface` | Neutral top-lit sheen for raised surfaces. |
197
- | `bg-gradient-hairline` | A 1px border that fades along its run. |
198
- | `bg-gradient-mesh` | Atmospheric multi-blob backdrop for heroes and empty states. |
199
- | `bg-gradient-fade` | Surface → transparent, for scroll edges. |
200
- | `text-gradient-brand` | Gradient-filled text (static). |
201
-
202
- For one-off directions the stops are also exposed as real colors, so Tailwind's own gradient
203
- utilities work off the themed ramp: `bg-linear-to-r from-gradient-from to-gradient-to`.
204
-
205
- Two components add motion on top of the same tokens — `GradientText` (pans the ramp across the
206
- glyphs) and `GradientBorder` (a masked gradient hairline with an optional rotating sweep) — and
207
- `Button`, `Badge`, and `FeaturedIcon` each gained a `gradient` variant.
208
-
209
- In Tailwind v4 the old `tailwind.config.ts` is replaced by a CSS-first `@theme` block that
210
- maps those tokens to utilities (`bg-background`, `text-primary`, `rounded-lg`,
211
- `font-display`, `shadow-lift`, …):
212
-
213
- ```css
214
- @theme inline {
215
- --color-background: hsl(var(--background));
216
- --color-primary: hsl(var(--primary));
217
- --radius-lg: var(--radius);
218
- /* ...etc */
62
+ .dark {
63
+ --brand: 260 80% 74%;
219
64
  }
220
65
  ```
221
66
 
222
- To re-theme: change the token values. To go dark: add `dark` to the `<html>` class. That's
223
- the whole story — no component edits.
224
-
225
- ## The animation system
226
-
227
- Motion is **systematic, not improvised.** Everything references
228
- [`lib/motion-presets.ts`](src/lib/motion-presets.ts):
229
-
230
- - **Transition tokens** — `spring.snappy`, `spring.soft`, `spring.bouncy`, `tween.smooth`,
231
- `tween.quick`.
232
- - **Reveal variants** — `fadeUp`, `fadeIn`, `scaleIn`, `slideInLeft/Right`, `blurIn`.
233
- - **Stagger helpers** — `staggerContainer(stagger, delay)` + `staggerItem`.
234
- - **Interaction presets** — `interaction.hover`, `interaction.tap`, `interaction.cardHover`.
235
- - **Viewport** — `viewportOnce` for scroll-triggered reveals.
236
-
237
- Principles baked in:
238
-
239
- - **Respects `prefers-reduced-motion`.** Wrap your app once in
240
- `<MotionConfig reducedMotion="user">` (see `src/components/site/providers.tsx`) and all
241
- declarative reveals collapse to instant/opacity-only. Imperative loops like the marquee
242
- branch on `useReducedMotion()` and stop entirely.
243
- - **Scroll reveals** use `whileInView` with `viewport={{ once: true, margin: "-15%" }}`.
244
- - **Transform & opacity only** (plus an occasional `filter: blur`) — never layout-thrashing
245
- properties.
246
- - **One engine.** No CSS keyframes for component motion; even the accordion height reveal
247
- runs through Motion.
248
-
249
- ## Repo scripts
250
-
251
- The library lives at the repo root; the Next.js (App Router) docs site is a workspace member in
252
- `site/` that imports the library *source* (via the `@/* → ["../src/*","./src/*"]` alias), so edits
253
- show up instantly with no rebuild.
254
-
255
- ```bash
256
- pnpm install # one hoisted install for the whole workspace
257
-
258
- # docs site
259
- pnpm dev # runs site/ (Next dev)
260
- pnpm site:build # production build of the docs site (also generates /r/*.json)
261
-
262
- # library
263
- pnpm build:lib # type-check (strict) + tsup → dist/ (what npm publishes)
264
- pnpm typecheck:lib
265
- ```
266
-
267
- - `/` — a live showcase built from the real blocks.
268
- - `/docs/<slug>` — each component with install tabs (shadcn CLI + npm), an interactive props
269
- **Playground**, a live preview, the prop table, and one-click copy of the exact source file
270
- (read straight from disk, so it never drifts).
271
- - `/r/<name>.json` — the shadcn registry endpoint (set `NEXT_PUBLIC_SITE_URL` in production so
272
- cross-item `registryDependencies` URLs point at your deployed origin).
273
-
274
- ## Stack
275
-
276
- React 18 · TypeScript (strict) · Tailwind CSS v4 · Motion · Radix UI · lucide-react ·
277
- Next.js (docs site). Fonts: **Fraunces** (editorial serif display) + **Inter** (body) + **JetBrains Mono**.
67
+ Add the `dark` class to `<html>` to switch the page to dark mode. For inline
68
+ styles and chart props, import `{ tokens }` from `kineto/tokens`. For example,
69
+ `tokens.color.brand` resolves to `hsl(var(--brand))` and follows the same theme
70
+ overrides.
278
71
 
279
- MIT licensed. The components are yours.
72
+ [MIT License](LICENSE)
package/dist/badge.d.ts CHANGED
@@ -3,7 +3,7 @@ import * as React from 'react';
3
3
  import { VariantProps } from 'class-variance-authority';
4
4
 
5
5
  declare const badgeVariants: (props?: ({
6
- variant?: "default" | "outline" | "solid" | "brand" | "success" | "warning" | "destructive" | "gradient" | "secondary" | null | undefined;
6
+ variant?: "default" | "brand" | "success" | "warning" | "destructive" | "outline" | "solid" | "gradient" | "secondary" | null | undefined;
7
7
  } & class_variance_authority_types.ClassProp) | undefined) => string;
8
8
  interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof badgeVariants> {
9
9
  /** Show a leading status dot in the current text color. */
package/dist/button.d.ts CHANGED
@@ -3,8 +3,8 @@ import * as React from 'react';
3
3
  import { VariantProps } from 'class-variance-authority';
4
4
 
5
5
  declare const buttonVariants: (props?: ({
6
- variant?: "link" | "default" | "outline" | "brand" | "destructive" | "gradient" | "secondary" | "ghost" | null | undefined;
7
- size?: "default" | "sm" | "lg" | "icon" | "pill" | null | undefined;
6
+ variant?: "default" | "brand" | "destructive" | "link" | "outline" | "gradient" | "secondary" | "ghost" | null | undefined;
7
+ size?: "default" | "icon" | "sm" | "lg" | "pill" | null | undefined;
8
8
  } & class_variance_authority_types.ClassProp) | undefined) => string;
9
9
  type NativeButtonProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onAnimationStart" | "onAnimationEnd" | "onAnimationIteration" | "onDrag" | "onDragStart" | "onDragEnd" | "onDragEnter" | "onDragLeave" | "onDragOver" | "onDrop">;
10
10
  interface ButtonProps extends NativeButtonProps, VariantProps<typeof buttonVariants> {
package/dist/command.d.ts CHANGED
@@ -7,7 +7,7 @@ declare const Command: React.ForwardRefExoticComponent<Omit<{
7
7
  ref?: React.Ref<HTMLDivElement>;
8
8
  } & {
9
9
  asChild?: boolean;
10
- }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & {
10
+ }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & {
11
11
  label?: string;
12
12
  shouldFilter?: boolean;
13
13
  filter?: (value: string, search: string, keywords?: string[]) => number;
@@ -29,7 +29,7 @@ declare const CommandInput: React.ForwardRefExoticComponent<Omit<Omit<Pick<Pick<
29
29
  ref?: React.Ref<HTMLInputElement>;
30
30
  } & {
31
31
  asChild?: boolean;
32
- }, "key" | "asChild" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "onChange" | "type" | "value"> & {
32
+ }, "key" | "asChild" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "type" | "onChange" | "value"> & {
33
33
  value?: string;
34
34
  onValueChange?: (search: string) => void;
35
35
  } & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
@@ -39,7 +39,7 @@ declare const CommandList: React.ForwardRefExoticComponent<Omit<{
39
39
  ref?: React.Ref<HTMLDivElement>;
40
40
  } & {
41
41
  asChild?: boolean;
42
- }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & {
42
+ }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & {
43
43
  label?: string;
44
44
  } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
45
45
  declare const CommandEmpty: React.ForwardRefExoticComponent<Omit<{
@@ -48,14 +48,14 @@ declare const CommandEmpty: React.ForwardRefExoticComponent<Omit<{
48
48
  ref?: React.Ref<HTMLDivElement>;
49
49
  } & {
50
50
  asChild?: boolean;
51
- }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
51
+ }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
52
52
  declare const CommandGroup: React.ForwardRefExoticComponent<Omit<{
53
53
  children?: React.ReactNode;
54
54
  } & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
55
55
  ref?: React.Ref<HTMLDivElement>;
56
56
  } & {
57
57
  asChild?: boolean;
58
- }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>>, "value" | "heading"> & {
58
+ }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild">, "heading" | "value"> & {
59
59
  heading?: React.ReactNode;
60
60
  value?: string;
61
61
  forceMount?: boolean;
@@ -66,7 +66,7 @@ declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
66
66
  ref?: React.Ref<HTMLDivElement>;
67
67
  } & {
68
68
  asChild?: boolean;
69
- }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>>, "onSelect" | "disabled" | "value"> & {
69
+ }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild">, "onSelect" | "disabled" | "value"> & {
70
70
  disabled?: boolean;
71
71
  onSelect?: (value: string) => void;
72
72
  value?: string;
@@ -77,7 +77,7 @@ declare const CommandSeparator: React.ForwardRefExoticComponent<Omit<Pick<Pick<R
77
77
  ref?: React.Ref<HTMLDivElement>;
78
78
  } & {
79
79
  asChild?: boolean;
80
- }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & {
80
+ }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & {
81
81
  alwaysRender?: boolean;
82
82
  } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
83
83
  declare const CommandShortcut: {
@@ -6,7 +6,7 @@ import { LucideIcon } from 'lucide-react';
6
6
  declare const featuredIconVariants: (props?: ({
7
7
  size?: "sm" | "md" | "lg" | null | undefined;
8
8
  shape?: "circle" | "square" | null | undefined;
9
- variant?: "outline" | "gray" | "brand" | "success" | "warning" | "destructive" | "gradient" | null | undefined;
9
+ variant?: "brand" | "success" | "warning" | "destructive" | "outline" | "gray" | "gradient" | null | undefined;
10
10
  } & class_variance_authority_types.ClassProp) | undefined) => string;
11
11
  interface FeaturedIconProps extends React.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof featuredIconVariants> {
12
12
  icon: LucideIcon;
@@ -0,0 +1,13 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+
4
+ type FieldControlProps = Pick<React.InputHTMLAttributes<HTMLInputElement>, "id" | "aria-describedby" | "aria-invalid">;
5
+ interface FieldProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
6
+ label: React.ReactNode;
7
+ description?: React.ReactNode;
8
+ error?: React.ReactNode;
9
+ children: React.ReactElement<FieldControlProps>;
10
+ }
11
+ declare function Field({ label, description, error, children, className, ...props }: FieldProps): react_jsx_runtime.JSX.Element;
12
+
13
+ export { Field, type FieldProps };
package/dist/field.js ADDED
@@ -0,0 +1,33 @@
1
+ // src/components/ui/field.tsx
2
+ import * as React from "react";
3
+
4
+ // src/lib/cn.ts
5
+ import { clsx } from "clsx";
6
+ import { twMerge } from "tailwind-merge";
7
+ function cn(...inputs) {
8
+ return twMerge(clsx(inputs));
9
+ }
10
+
11
+ // src/components/ui/field.tsx
12
+ import { jsx, jsxs } from "react/jsx-runtime";
13
+ function Field({ label, description, error, children, className, ...props }) {
14
+ const id = React.useId();
15
+ const controlId = children.props.id ?? id;
16
+ const descriptionId = description == null ? void 0 : `${id}-description`;
17
+ const errorId = error == null ? void 0 : `${id}-error`;
18
+ const describedBy = [children.props["aria-describedby"], descriptionId, errorId].filter(Boolean).join(" ");
19
+ return /* @__PURE__ */ jsxs("div", { className: cn("grid gap-2", className), ...props, children: [
20
+ /* @__PURE__ */ jsx("label", { htmlFor: controlId, className: "text-sm font-medium text-foreground", children: label }),
21
+ React.cloneElement(children, {
22
+ id: controlId,
23
+ "aria-describedby": describedBy || void 0,
24
+ "aria-invalid": errorId ? true : children.props["aria-invalid"]
25
+ }),
26
+ descriptionId && /* @__PURE__ */ jsx("p", { id: descriptionId, className: "text-sm text-muted-foreground", children: description }),
27
+ errorId && /* @__PURE__ */ jsx("p", { id: errorId, className: "text-sm text-destructive", children: error })
28
+ ] });
29
+ }
30
+ export {
31
+ Field
32
+ };
33
+ //# sourceMappingURL=field.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/ui/field.tsx","../src/lib/cn.ts"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@/lib/cn\";\n\ntype FieldControlProps = Pick<\n React.InputHTMLAttributes<HTMLInputElement>,\n \"id\" | \"aria-describedby\" | \"aria-invalid\"\n>;\n\nexport interface FieldProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"children\"> {\n label: React.ReactNode;\n description?: React.ReactNode;\n error?: React.ReactNode;\n children: React.ReactElement<FieldControlProps>;\n}\n\nexport function Field({ label, description, error, children, className, ...props }: FieldProps) {\n const id = React.useId();\n const controlId = children.props.id ?? id;\n const descriptionId = description == null ? undefined : `${id}-description`;\n const errorId = error == null ? undefined : `${id}-error`;\n const describedBy = [children.props[\"aria-describedby\"], descriptionId, errorId]\n .filter(Boolean)\n .join(\" \");\n\n return (\n <div className={cn(\"grid gap-2\", className)} {...props}>\n <label htmlFor={controlId} className=\"text-sm font-medium text-foreground\">{label}</label>\n {React.cloneElement(children, {\n id: controlId,\n \"aria-describedby\": describedBy || undefined,\n \"aria-invalid\": errorId ? true : children.props[\"aria-invalid\"],\n })}\n {descriptionId && <p id={descriptionId} className=\"text-sm text-muted-foreground\">{description}</p>}\n {errorId && <p id={errorId} className=\"text-sm text-destructive\">{error}</p>}\n </div>\n );\n}\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\n/**\n * Merge class names with Tailwind-aware conflict resolution.\n * Every Kineto component accepts `className` and merges it through `cn()`,\n * so consumer overrides always win over the component's defaults.\n */\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":";AAAA,YAAY,WAAW;;;ACAvB,SAAS,YAA6B;AACtC,SAAS,eAAe;AAOjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ADeI,SACE,KADF;AAVG,SAAS,MAAM,EAAE,OAAO,aAAa,OAAO,UAAU,WAAW,GAAG,MAAM,GAAe;AAC9F,QAAM,KAAW,YAAM;AACvB,QAAM,YAAY,SAAS,MAAM,MAAM;AACvC,QAAM,gBAAgB,eAAe,OAAO,SAAY,GAAG,EAAE;AAC7D,QAAM,UAAU,SAAS,OAAO,SAAY,GAAG,EAAE;AACjD,QAAM,cAAc,CAAC,SAAS,MAAM,kBAAkB,GAAG,eAAe,OAAO,EAC5E,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,SACE,qBAAC,SAAI,WAAW,GAAG,cAAc,SAAS,GAAI,GAAG,OAC/C;AAAA,wBAAC,WAAM,SAAS,WAAW,WAAU,uCAAuC,iBAAM;AAAA,IAC3E,mBAAa,UAAU;AAAA,MAC5B,IAAI;AAAA,MACJ,oBAAoB,eAAe;AAAA,MACnC,gBAAgB,UAAU,OAAO,SAAS,MAAM,cAAc;AAAA,IAChE,CAAC;AAAA,IACA,iBAAiB,oBAAC,OAAE,IAAI,eAAe,WAAU,iCAAiC,uBAAY;AAAA,IAC9F,WAAW,oBAAC,OAAE,IAAI,SAAS,WAAU,4BAA4B,iBAAM;AAAA,KAC1E;AAEJ;","names":[]}
package/dist/flex.d.ts CHANGED
@@ -5,8 +5,8 @@ import { Gap } from './gap.js';
5
5
 
6
6
  declare const flexVariants: (props?: ({
7
7
  direction?: "col" | "row" | "row-reverse" | "col-reverse" | null | undefined;
8
- align?: "center" | "end" | "start" | "baseline" | "stretch" | null | undefined;
9
- justify?: "center" | "end" | "start" | "between" | "around" | "evenly" | null | undefined;
8
+ align?: "end" | "center" | "baseline" | "start" | "stretch" | null | undefined;
9
+ justify?: "end" | "center" | "start" | "between" | "around" | "evenly" | null | undefined;
10
10
  wrap?: boolean | null | undefined;
11
11
  inline?: boolean | null | undefined;
12
12
  } & class_variance_authority_types.ClassProp) | undefined) => string;
package/dist/grid.d.ts CHANGED
@@ -4,9 +4,9 @@ import { VariantProps } from 'class-variance-authority';
4
4
  import { Gap } from './gap.js';
5
5
 
6
6
  declare const gridVariants: (props?: ({
7
- cols?: 1 | 2 | 6 | 4 | 3 | 12 | 5 | null | undefined;
8
- align?: "center" | "end" | "start" | "stretch" | null | undefined;
9
- justify?: "center" | "end" | "start" | "stretch" | null | undefined;
7
+ cols?: 1 | 2 | 4 | 6 | 3 | 12 | 5 | null | undefined;
8
+ align?: "end" | "center" | "start" | "stretch" | null | undefined;
9
+ justify?: "end" | "center" | "start" | "stretch" | null | undefined;
10
10
  flow?: "col" | "row" | "dense" | null | undefined;
11
11
  } & class_variance_authority_types.ClassProp) | undefined) => string;
12
12
  interface GridProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof gridVariants> {
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@
2
2
  /* Re-export barrel: keeps each component its own module so bundlers can tree-shake, and
3
3
  lets each file keep its own "use client" directive. See writeBarrel() for the numbers. */
4
4
  export * from "./cn.js";
5
+ export * from "./tokens.js";
5
6
  export * from "./use-reduced-motion.js";
6
7
  export * from "./gap.js";
7
8
  export * from "./format-time.js";
@@ -36,6 +37,7 @@ export * from "./drawer.js";
36
37
  export * from "./dropdown-menu.js";
37
38
  export * from "./empty-state.js";
38
39
  export * from "./featured-icon.js";
40
+ export * from "./field.js";
39
41
  export * from "./file-uploader.js";
40
42
  export * from "./flex.js";
41
43
  export * from "./form.js";
@@ -44,6 +46,7 @@ export * from "./gradient-text.js";
44
46
  export * from "./grid.js";
45
47
  export * from "./hover-card.js";
46
48
  export * from "./inline-edit.js";
49
+ export * from "./input-group.js";
47
50
  export * from "./input.js";
48
51
  export * from "./kbd.js";
49
52
  export * from "./label.js";
@@ -80,6 +83,7 @@ export * from "./toast.js";
80
83
  export * from "./tooltip.js";
81
84
  export * from "./tree-view.js";
82
85
  export * from "./truncate.js";
86
+ export * from "./typography.js";
83
87
  export * from "./verification-code-input.js";
84
88
  export * from "./logo-cloud.js";
85
89
  export * from "./area-chart.js";
package/dist/index.js CHANGED
@@ -2,6 +2,7 @@
2
2
  /* Re-export barrel: keeps each component its own module so bundlers can tree-shake, and
3
3
  lets each file keep its own "use client" directive. See writeBarrel() for the numbers. */
4
4
  export * from "./cn.js";
5
+ export * from "./tokens.js";
5
6
  export * from "./use-reduced-motion.js";
6
7
  export * from "./gap.js";
7
8
  export * from "./format-time.js";
@@ -36,6 +37,7 @@ export * from "./drawer.js";
36
37
  export * from "./dropdown-menu.js";
37
38
  export * from "./empty-state.js";
38
39
  export * from "./featured-icon.js";
40
+ export * from "./field.js";
39
41
  export * from "./file-uploader.js";
40
42
  export * from "./flex.js";
41
43
  export * from "./form.js";
@@ -44,6 +46,7 @@ export * from "./gradient-text.js";
44
46
  export * from "./grid.js";
45
47
  export * from "./hover-card.js";
46
48
  export * from "./inline-edit.js";
49
+ export * from "./input-group.js";
47
50
  export * from "./input.js";
48
51
  export * from "./kbd.js";
49
52
  export * from "./label.js";
@@ -80,6 +83,7 @@ export * from "./toast.js";
80
83
  export * from "./tooltip.js";
81
84
  export * from "./tree-view.js";
82
85
  export * from "./truncate.js";
86
+ export * from "./typography.js";
83
87
  export * from "./verification-code-input.js";
84
88
  export * from "./logo-cloud.js";
85
89
  export * from "./area-chart.js";
@@ -0,0 +1,11 @@
1
+ import * as React from 'react';
2
+ import { InputProps } from './input.js';
3
+
4
+ interface InputGroupProps extends InputProps {
5
+ startAdornment?: React.ReactNode;
6
+ endAdornment?: React.ReactNode;
7
+ containerClassName?: string;
8
+ }
9
+ declare const InputGroup: React.ForwardRefExoticComponent<InputGroupProps & React.RefAttributes<HTMLInputElement>>;
10
+
11
+ export { InputGroup, type InputGroupProps };
@@ -0,0 +1,65 @@
1
+ // src/components/ui/input-group.tsx
2
+ import * as React2 from "react";
3
+
4
+ // src/components/ui/input.tsx
5
+ import * as React from "react";
6
+
7
+ // src/lib/cn.ts
8
+ import { clsx } from "clsx";
9
+ import { twMerge } from "tailwind-merge";
10
+ function cn(...inputs) {
11
+ return twMerge(clsx(inputs));
12
+ }
13
+
14
+ // src/components/ui/input.tsx
15
+ import { jsx } from "react/jsx-runtime";
16
+ var Input = React.forwardRef(
17
+ ({ className, type = "text", ...props }, ref) => /* @__PURE__ */ jsx(
18
+ "input",
19
+ {
20
+ ref,
21
+ type,
22
+ className: cn(
23
+ "flex h-10 w-full rounded-lg border border-input bg-card px-3.5 py-2 text-sm text-foreground shadow-xs transition-colors placeholder:text-muted-foreground focus-visible:border-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 disabled:cursor-not-allowed disabled:opacity-50 file:border-0 file:bg-transparent file:text-sm file:font-medium",
24
+ className
25
+ ),
26
+ ...props
27
+ }
28
+ )
29
+ );
30
+ Input.displayName = "Input";
31
+
32
+ // src/components/ui/input-group.tsx
33
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
34
+ var InputGroup = React2.forwardRef(
35
+ ({ startAdornment, endAdornment, containerClassName, className, ...props }, ref) => /* @__PURE__ */ jsxs(
36
+ "div",
37
+ {
38
+ className: cn(
39
+ "flex min-h-10 items-center rounded-lg border border-input bg-card shadow-xs",
40
+ "has-[:focus-visible]:border-ring has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-ring/40",
41
+ containerClassName
42
+ ),
43
+ children: [
44
+ startAdornment != null && /* @__PURE__ */ jsx2("div", { className: "flex shrink-0 items-center ps-3 text-sm text-muted-foreground", children: startAdornment }),
45
+ /* @__PURE__ */ jsx2(
46
+ Input,
47
+ {
48
+ ...props,
49
+ ref,
50
+ className: cn(
51
+ "min-w-0 flex-1 border-0 bg-transparent shadow-none focus-visible:ring-0",
52
+ className
53
+ )
54
+ }
55
+ ),
56
+ endAdornment != null && /* @__PURE__ */ jsx2("div", { className: "flex shrink-0 items-center pe-3 text-sm text-muted-foreground", children: endAdornment })
57
+ ]
58
+ }
59
+ )
60
+ );
61
+ InputGroup.displayName = "InputGroup";
62
+ export {
63
+ InputGroup
64
+ };
65
+ //# sourceMappingURL=input-group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/ui/input-group.tsx","../src/components/ui/input.tsx","../src/lib/cn.ts"],"sourcesContent":["import * as React from \"react\";\nimport { Input, type InputProps } from \"@/components/ui/input\";\nimport { cn } from \"@/lib/cn\";\n\nexport interface InputGroupProps extends InputProps {\n startAdornment?: React.ReactNode;\n endAdornment?: React.ReactNode;\n containerClassName?: string;\n}\n\nconst InputGroup = React.forwardRef<HTMLInputElement, InputGroupProps>(\n ({ startAdornment, endAdornment, containerClassName, className, ...props }, ref) => (\n <div\n className={cn(\n \"flex min-h-10 items-center rounded-lg border border-input bg-card shadow-xs\",\n \"has-[:focus-visible]:border-ring has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-ring/40\",\n containerClassName,\n )}\n >\n {startAdornment != null && (\n <div className=\"flex shrink-0 items-center ps-3 text-sm text-muted-foreground\">{startAdornment}</div>\n )}\n <Input\n {...props}\n ref={ref}\n className={cn(\n \"min-w-0 flex-1 border-0 bg-transparent shadow-none focus-visible:ring-0\",\n className,\n )}\n />\n {endAdornment != null && (\n <div className=\"flex shrink-0 items-center pe-3 text-sm text-muted-foreground\">{endAdornment}</div>\n )}\n </div>\n ),\n);\nInputGroup.displayName = \"InputGroup\";\n\nexport { InputGroup };\n","import * as React from \"react\";\n\nimport { cn } from \"@/lib/cn\";\n\nexport type InputProps = React.InputHTMLAttributes<HTMLInputElement>;\n\nconst Input = React.forwardRef<HTMLInputElement, InputProps>(\n ({ className, type = \"text\", ...props }, ref) => (\n <input\n ref={ref}\n type={type}\n className={cn(\n \"flex h-10 w-full rounded-lg border border-input bg-card px-3.5 py-2 text-sm text-foreground shadow-xs transition-colors placeholder:text-muted-foreground focus-visible:border-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 disabled:cursor-not-allowed disabled:opacity-50 file:border-0 file:bg-transparent file:text-sm file:font-medium\",\n className\n )}\n {...props}\n />\n )\n);\nInput.displayName = \"Input\";\n\nexport { Input };\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\n/**\n * Merge class names with Tailwind-aware conflict resolution.\n * Every Kineto component accepts `className` and merges it through `cn()`,\n * so consumer overrides always win over the component's defaults.\n */\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":";AAAA,YAAYA,YAAW;;;ACAvB,YAAY,WAAW;;;ACAvB,SAAS,YAA6B;AACtC,SAAS,eAAe;AAOjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ADFI;AAFJ,IAAM,QAAc;AAAA,EAClB,CAAC,EAAE,WAAW,OAAO,QAAQ,GAAG,MAAM,GAAG,QACvC;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AACA,MAAM,cAAc;;;ADPhB,SAQI,OAAAC,MARJ;AAFJ,IAAM,aAAmB;AAAA,EACvB,CAAC,EAAE,gBAAgB,cAAc,oBAAoB,WAAW,GAAG,MAAM,GAAG,QAC1E;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MAEC;AAAA,0BAAkB,QACjB,gBAAAA,KAAC,SAAI,WAAU,iEAAiE,0BAAe;AAAA,QAEjG,gBAAAA;AAAA,UAAC;AAAA;AAAA,YACE,GAAG;AAAA,YACJ;AAAA,YACA,WAAW;AAAA,cACT;AAAA,cACA;AAAA,YACF;AAAA;AAAA,QACF;AAAA,QACC,gBAAgB,QACf,gBAAAA,KAAC,SAAI,WAAU,iEAAiE,wBAAa;AAAA;AAAA;AAAA,EAEjG;AAEJ;AACA,WAAW,cAAc;","names":["React","jsx"]}
@@ -3,7 +3,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
3
3
  import * as ResizablePrimitive from 'react-resizable-panels';
4
4
 
5
5
  declare const ResizablePanelGroup: ({ className, ...props }: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => react_jsx_runtime.JSX.Element;
6
- declare const ResizablePanel: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLSpanElement | HTMLElement | HTMLObjectElement | HTMLAnchorElement | HTMLButtonElement | HTMLDivElement | HTMLFormElement | HTMLHeadingElement | HTMLImageElement | HTMLInputElement | HTMLLabelElement | HTMLLIElement | HTMLOListElement | HTMLParagraphElement | HTMLSelectElement | HTMLUListElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLCanvasElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLLegendElement | HTMLLinkElement | HTMLMapElement | HTMLMetaElement | HTMLMeterElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLPreElement | HTMLProgressElement | HTMLSlotElement | HTMLScriptElement | HTMLSourceElement | HTMLStyleElement | HTMLTableElement | HTMLTemplateElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTitleElement | HTMLTableRowElement | HTMLTrackElement | HTMLVideoElement | HTMLTableCaptionElement | HTMLMenuElement | HTMLPictureElement>, "id" | "onResize"> & {
6
+ declare const ResizablePanel: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement | HTMLElement | HTMLButtonElement | HTMLParagraphElement | HTMLSpanElement | HTMLObjectElement | HTMLStyleElement | HTMLSlotElement | HTMLTitleElement | HTMLAnchorElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLCanvasElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLFormElement | HTMLHeadingElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLImageElement | HTMLInputElement | HTMLLabelElement | HTMLLegendElement | HTMLLIElement | HTMLLinkElement | HTMLMapElement | HTMLMetaElement | HTMLMeterElement | HTMLOListElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLPreElement | HTMLProgressElement | HTMLScriptElement | HTMLSelectElement | HTMLSourceElement | HTMLTableElement | HTMLTemplateElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTableRowElement | HTMLTrackElement | HTMLUListElement | HTMLVideoElement | HTMLTableCaptionElement | HTMLMenuElement | HTMLPictureElement>, "id" | "onResize"> & {
7
7
  className?: string | undefined;
8
8
  collapsedSize?: number | undefined;
9
9
  collapsible?: boolean | undefined;
package/dist/stack.d.ts CHANGED
@@ -5,8 +5,8 @@ import { Gap } from './gap.js';
5
5
 
6
6
  declare const stackVariants: (props?: ({
7
7
  direction?: "horizontal" | "vertical" | null | undefined;
8
- align?: "center" | "end" | "start" | "baseline" | "stretch" | null | undefined;
9
- justify?: "center" | "end" | "start" | "between" | "around" | "evenly" | null | undefined;
8
+ align?: "end" | "center" | "baseline" | "start" | "stretch" | null | undefined;
9
+ justify?: "end" | "center" | "start" | "between" | "around" | "evenly" | null | undefined;
10
10
  wrap?: boolean | null | undefined;
11
11
  } & class_variance_authority_types.ClassProp) | undefined) => string;
12
12
  interface StackProps extends React.HTMLAttributes<HTMLDivElement>, Omit<VariantProps<typeof stackVariants>, "wrap"> {
@@ -0,0 +1,48 @@
1
+ declare const tokens: {
2
+ readonly color: {
3
+ readonly background: "hsl(var(--background))";
4
+ readonly foreground: "hsl(var(--foreground))";
5
+ readonly card: "hsl(var(--card))";
6
+ readonly cardForeground: "hsl(var(--card-foreground))";
7
+ readonly popover: "hsl(var(--popover))";
8
+ readonly popoverForeground: "hsl(var(--popover-foreground))";
9
+ readonly primary: "hsl(var(--primary))";
10
+ readonly primaryForeground: "hsl(var(--primary-foreground))";
11
+ readonly secondary: "hsl(var(--secondary))";
12
+ readonly secondaryForeground: "hsl(var(--secondary-foreground))";
13
+ readonly muted: "hsl(var(--muted))";
14
+ readonly mutedForeground: "hsl(var(--muted-foreground))";
15
+ readonly accent: "hsl(var(--accent))";
16
+ readonly accentForeground: "hsl(var(--accent-foreground))";
17
+ readonly brand: "hsl(var(--brand))";
18
+ readonly brandForeground: "hsl(var(--brand-foreground))";
19
+ readonly destructive: "hsl(var(--destructive))";
20
+ readonly destructiveForeground: "hsl(var(--destructive-foreground))";
21
+ readonly success: "hsl(var(--success))";
22
+ readonly successForeground: "hsl(var(--success-foreground))";
23
+ readonly warning: "hsl(var(--warning))";
24
+ readonly warningForeground: "hsl(var(--warning-foreground))";
25
+ readonly info: "hsl(var(--info))";
26
+ readonly infoForeground: "hsl(var(--info-foreground))";
27
+ readonly link: "hsl(var(--link))";
28
+ readonly border: "hsl(var(--border))";
29
+ readonly input: "hsl(var(--input))";
30
+ readonly ring: "hsl(var(--ring))";
31
+ readonly shadow: "hsl(var(--shadow-color))";
32
+ readonly chart1: "hsl(var(--chart-1))";
33
+ readonly chart2: "hsl(var(--chart-2))";
34
+ readonly chart3: "hsl(var(--chart-3))";
35
+ readonly chart4: "hsl(var(--chart-4))";
36
+ readonly chart5: "hsl(var(--chart-5))";
37
+ readonly gradientFrom: "hsl(var(--gradient-from, var(--brand)))";
38
+ readonly gradientTo: "hsl(var(--gradient-to, var(--chart-3)))";
39
+ };
40
+ readonly radius: {
41
+ readonly base: "var(--radius)";
42
+ };
43
+ readonly gradient: {
44
+ readonly angle: "var(--gradient-angle)";
45
+ };
46
+ };
47
+
48
+ export { tokens };
package/dist/tokens.js ADDED
@@ -0,0 +1,50 @@
1
+ // src/lib/tokens.ts
2
+ function color(name) {
3
+ return `hsl(var(--${name}))`;
4
+ }
5
+ var tokens = {
6
+ color: {
7
+ background: color("background"),
8
+ foreground: color("foreground"),
9
+ card: color("card"),
10
+ cardForeground: color("card-foreground"),
11
+ popover: color("popover"),
12
+ popoverForeground: color("popover-foreground"),
13
+ primary: color("primary"),
14
+ primaryForeground: color("primary-foreground"),
15
+ secondary: color("secondary"),
16
+ secondaryForeground: color("secondary-foreground"),
17
+ muted: color("muted"),
18
+ mutedForeground: color("muted-foreground"),
19
+ accent: color("accent"),
20
+ accentForeground: color("accent-foreground"),
21
+ brand: color("brand"),
22
+ brandForeground: color("brand-foreground"),
23
+ destructive: color("destructive"),
24
+ destructiveForeground: color("destructive-foreground"),
25
+ success: color("success"),
26
+ successForeground: color("success-foreground"),
27
+ warning: color("warning"),
28
+ warningForeground: color("warning-foreground"),
29
+ info: color("info"),
30
+ infoForeground: color("info-foreground"),
31
+ link: color("link"),
32
+ border: color("border"),
33
+ input: color("input"),
34
+ ring: color("ring"),
35
+ shadow: color("shadow-color"),
36
+ chart1: color("chart-1"),
37
+ chart2: color("chart-2"),
38
+ chart3: color("chart-3"),
39
+ chart4: color("chart-4"),
40
+ chart5: color("chart-5"),
41
+ gradientFrom: "hsl(var(--gradient-from, var(--brand)))",
42
+ gradientTo: "hsl(var(--gradient-to, var(--chart-3)))"
43
+ },
44
+ radius: { base: "var(--radius)" },
45
+ gradient: { angle: "var(--gradient-angle)" }
46
+ };
47
+ export {
48
+ tokens
49
+ };
50
+ //# sourceMappingURL=tokens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lib/tokens.ts"],"sourcesContent":["function color<Name extends string>(name: Name): `hsl(var(--${Name}))` {\n return `hsl(var(--${name}))`;\n}\n\nexport const tokens = {\n color: {\n background: color(\"background\"),\n foreground: color(\"foreground\"),\n card: color(\"card\"),\n cardForeground: color(\"card-foreground\"),\n popover: color(\"popover\"),\n popoverForeground: color(\"popover-foreground\"),\n primary: color(\"primary\"),\n primaryForeground: color(\"primary-foreground\"),\n secondary: color(\"secondary\"),\n secondaryForeground: color(\"secondary-foreground\"),\n muted: color(\"muted\"),\n mutedForeground: color(\"muted-foreground\"),\n accent: color(\"accent\"),\n accentForeground: color(\"accent-foreground\"),\n brand: color(\"brand\"),\n brandForeground: color(\"brand-foreground\"),\n destructive: color(\"destructive\"),\n destructiveForeground: color(\"destructive-foreground\"),\n success: color(\"success\"),\n successForeground: color(\"success-foreground\"),\n warning: color(\"warning\"),\n warningForeground: color(\"warning-foreground\"),\n info: color(\"info\"),\n infoForeground: color(\"info-foreground\"),\n link: color(\"link\"),\n border: color(\"border\"),\n input: color(\"input\"),\n ring: color(\"ring\"),\n shadow: color(\"shadow-color\"),\n chart1: color(\"chart-1\"),\n chart2: color(\"chart-2\"),\n chart3: color(\"chart-3\"),\n chart4: color(\"chart-4\"),\n chart5: color(\"chart-5\"),\n gradientFrom: \"hsl(var(--gradient-from, var(--brand)))\",\n gradientTo: \"hsl(var(--gradient-to, var(--chart-3)))\",\n },\n radius: { base: \"var(--radius)\" },\n gradient: { angle: \"var(--gradient-angle)\" },\n} as const;\n"],"mappings":";AAAA,SAAS,MAA2B,MAAmC;AACrE,SAAO,aAAa,IAAI;AAC1B;AAEO,IAAM,SAAS;AAAA,EACpB,OAAO;AAAA,IACL,YAAY,MAAM,YAAY;AAAA,IAC9B,YAAY,MAAM,YAAY;AAAA,IAC9B,MAAM,MAAM,MAAM;AAAA,IAClB,gBAAgB,MAAM,iBAAiB;AAAA,IACvC,SAAS,MAAM,SAAS;AAAA,IACxB,mBAAmB,MAAM,oBAAoB;AAAA,IAC7C,SAAS,MAAM,SAAS;AAAA,IACxB,mBAAmB,MAAM,oBAAoB;AAAA,IAC7C,WAAW,MAAM,WAAW;AAAA,IAC5B,qBAAqB,MAAM,sBAAsB;AAAA,IACjD,OAAO,MAAM,OAAO;AAAA,IACpB,iBAAiB,MAAM,kBAAkB;AAAA,IACzC,QAAQ,MAAM,QAAQ;AAAA,IACtB,kBAAkB,MAAM,mBAAmB;AAAA,IAC3C,OAAO,MAAM,OAAO;AAAA,IACpB,iBAAiB,MAAM,kBAAkB;AAAA,IACzC,aAAa,MAAM,aAAa;AAAA,IAChC,uBAAuB,MAAM,wBAAwB;AAAA,IACrD,SAAS,MAAM,SAAS;AAAA,IACxB,mBAAmB,MAAM,oBAAoB;AAAA,IAC7C,SAAS,MAAM,SAAS;AAAA,IACxB,mBAAmB,MAAM,oBAAoB;AAAA,IAC7C,MAAM,MAAM,MAAM;AAAA,IAClB,gBAAgB,MAAM,iBAAiB;AAAA,IACvC,MAAM,MAAM,MAAM;AAAA,IAClB,QAAQ,MAAM,QAAQ;AAAA,IACtB,OAAO,MAAM,OAAO;AAAA,IACpB,MAAM,MAAM,MAAM;AAAA,IAClB,QAAQ,MAAM,cAAc;AAAA,IAC5B,QAAQ,MAAM,SAAS;AAAA,IACvB,QAAQ,MAAM,SAAS;AAAA,IACvB,QAAQ,MAAM,SAAS;AAAA,IACvB,QAAQ,MAAM,SAAS;AAAA,IACvB,QAAQ,MAAM,SAAS;AAAA,IACvB,cAAc;AAAA,IACd,YAAY;AAAA,EACd;AAAA,EACA,QAAQ,EAAE,MAAM,gBAAgB;AAAA,EAChC,UAAU,EAAE,OAAO,wBAAwB;AAC7C;","names":[]}
@@ -0,0 +1,30 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+
4
+ declare const textSizes: {
5
+ sm: string;
6
+ base: string;
7
+ lg: string;
8
+ };
9
+ declare const titleSizes: {
10
+ sm: string;
11
+ md: string;
12
+ lg: string;
13
+ };
14
+ declare const tones: {
15
+ default: string;
16
+ muted: string;
17
+ };
18
+ interface TextProps extends React.HTMLAttributes<HTMLElement> {
19
+ as?: "p" | "span" | "div";
20
+ size?: keyof typeof textSizes;
21
+ tone?: keyof typeof tones;
22
+ }
23
+ declare function Text({ as: Element, size, tone, className, ...props }: TextProps): react_jsx_runtime.JSX.Element;
24
+ interface TitleProps extends React.HTMLAttributes<HTMLHeadingElement> {
25
+ as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
26
+ size?: keyof typeof titleSizes;
27
+ }
28
+ declare function Title({ as: Heading, size, className, ...props }: TitleProps): react_jsx_runtime.JSX.Element;
29
+
30
+ export { Text, type TextProps, Title, type TitleProps };
@@ -0,0 +1,40 @@
1
+ // src/lib/cn.ts
2
+ import { clsx } from "clsx";
3
+ import { twMerge } from "tailwind-merge";
4
+ function cn(...inputs) {
5
+ return twMerge(clsx(inputs));
6
+ }
7
+
8
+ // src/components/ui/typography.tsx
9
+ import { jsx } from "react/jsx-runtime";
10
+ var textSizes = {
11
+ sm: "text-sm",
12
+ base: "text-base",
13
+ lg: "text-lg"
14
+ };
15
+ var titleSizes = {
16
+ sm: "text-lg",
17
+ md: "text-2xl",
18
+ lg: "text-3xl sm:text-4xl"
19
+ };
20
+ var tones = {
21
+ default: "text-foreground",
22
+ muted: "text-muted-foreground"
23
+ };
24
+ function Text({ as: Element = "p", size = "base", tone = "default", className, ...props }) {
25
+ return /* @__PURE__ */ jsx(Element, { className: cn("font-sans", textSizes[size], tones[tone], className), ...props });
26
+ }
27
+ function Title({ as: Heading = "h2", size = "md", className, ...props }) {
28
+ return /* @__PURE__ */ jsx(
29
+ Heading,
30
+ {
31
+ className: cn("font-display font-semibold tracking-tight text-foreground", titleSizes[size], className),
32
+ ...props
33
+ }
34
+ );
35
+ }
36
+ export {
37
+ Text,
38
+ Title
39
+ };
40
+ //# sourceMappingURL=typography.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lib/cn.ts","../src/components/ui/typography.tsx"],"sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\n/**\n * Merge class names with Tailwind-aware conflict resolution.\n * Every Kineto component accepts `className` and merges it through `cn()`,\n * so consumer overrides always win over the component's defaults.\n */\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import * as React from \"react\";\nimport { cn } from \"@/lib/cn\";\n\nconst textSizes = {\n sm: \"text-sm\",\n base: \"text-base\",\n lg: \"text-lg\",\n};\n\nconst titleSizes = {\n sm: \"text-lg\",\n md: \"text-2xl\",\n lg: \"text-3xl sm:text-4xl\",\n};\n\nconst tones = {\n default: \"text-foreground\",\n muted: \"text-muted-foreground\",\n};\n\nexport interface TextProps extends React.HTMLAttributes<HTMLElement> {\n as?: \"p\" | \"span\" | \"div\";\n size?: keyof typeof textSizes;\n tone?: keyof typeof tones;\n}\n\nexport function Text({ as: Element = \"p\", size = \"base\", tone = \"default\", className, ...props }: TextProps) {\n return <Element className={cn(\"font-sans\", textSizes[size], tones[tone], className)} {...props} />;\n}\n\nexport interface TitleProps extends React.HTMLAttributes<HTMLHeadingElement> {\n as?: \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\";\n size?: keyof typeof titleSizes;\n}\n\nexport function Title({ as: Heading = \"h2\", size = \"md\", className, ...props }: TitleProps) {\n return (\n <Heading\n className={cn(\"font-display font-semibold tracking-tight text-foreground\", titleSizes[size], className)}\n {...props}\n />\n );\n}\n"],"mappings":";AAAA,SAAS,YAA6B;AACtC,SAAS,eAAe;AAOjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACiBS;AAxBT,IAAM,YAAY;AAAA,EAChB,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,IAAI;AACN;AAEA,IAAM,aAAa;AAAA,EACjB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,IAAM,QAAQ;AAAA,EACZ,SAAS;AAAA,EACT,OAAO;AACT;AAQO,SAAS,KAAK,EAAE,IAAI,UAAU,KAAK,OAAO,QAAQ,OAAO,WAAW,WAAW,GAAG,MAAM,GAAc;AAC3G,SAAO,oBAAC,WAAQ,WAAW,GAAG,aAAa,UAAU,IAAI,GAAG,MAAM,IAAI,GAAG,SAAS,GAAI,GAAG,OAAO;AAClG;AAOO,SAAS,MAAM,EAAE,IAAI,UAAU,MAAM,OAAO,MAAM,WAAW,GAAG,MAAM,GAAe;AAC1F,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,6DAA6D,WAAW,IAAI,GAAG,SAAS;AAAA,MACrG,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kineto",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "A drop-in library of beautifully animated, copy-paste React components — shadcn DNA, motion-first.",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -125,6 +125,7 @@
125
125
  "motion": "^11.15.0",
126
126
  "react": "^18.3.1",
127
127
  "react-dom": "^18.3.1",
128
+ "semantic-release": "25.0.5",
128
129
  "tsup": "^8.5.1",
129
130
  "typescript": "^5.6.3"
130
131
  }
package/theme.css CHANGED
@@ -55,6 +55,10 @@
55
55
  --warning: 36 95% 46%;
56
56
  --warning-foreground: 24 30% 12%;
57
57
 
58
+ --info: 214 72% 37%;
59
+ --info-foreground: 0 0% 100%;
60
+ --link: 211 83% 35%;
61
+
58
62
  --border: 32 16% 87%;
59
63
  --input: 32 16% 85%;
60
64
  --ring: 22 92% 52%;
@@ -124,6 +128,10 @@
124
128
  --warning: 38 95% 58%;
125
129
  --warning-foreground: 36 90% 8%;
126
130
 
131
+ --info: 210 92% 68%;
132
+ --info-foreground: 216 60% 9%;
133
+ --link: 211 95% 75%;
134
+
127
135
  --border: 28 10% 20%;
128
136
  --input: 28 10% 22%;
129
137
  --ring: 22 95% 57%;
@@ -175,6 +183,10 @@
175
183
  --color-warning: hsl(var(--warning));
176
184
  --color-warning-foreground: hsl(var(--warning-foreground));
177
185
 
186
+ --color-info: hsl(var(--info));
187
+ --color-info-foreground: hsl(var(--info-foreground));
188
+ --color-link: hsl(var(--link));
189
+
178
190
  --color-border: hsl(var(--border));
179
191
  --color-input: hsl(var(--input));
180
192
  --color-ring: hsl(var(--ring));