@kpf_/kiso 1.1.0 β 1.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/AI_USAGE.md +99 -0
- package/README.md +64 -147
- package/dist/components/motion/Magnetic.d.ts +19 -1
- package/dist/kiso.js +390 -372
- package/dist/kiso.umd.cjs +8 -8
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/AI_USAGE.md
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Kiso AI Consumption Protocol (v1.0.2+)
|
|
2
|
+
|
|
3
|
+
> **IDENTITY:** You are an AI Agent tasked with building high-end interfaces using the **Kiso Design System**.
|
|
4
|
+
> **PHILOSOPHY:** Kiso is built on **Tactile Intelligence**βinterfaces should feel physical, weighted, and responsive to interaction through physics-based motion.
|
|
5
|
+
> **SOURCE:** This document is your technical master reference for consuming `@kpf_/kiso`.
|
|
6
|
+
|
|
7
|
+
## π¦ Installation & Setup
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @kpf_/kiso
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
**CRITICAL:** You MUST import global styles in your root layout (e.g., `layout.tsx`, `App.tsx`):
|
|
14
|
+
```tsx
|
|
15
|
+
import '@kpf_/kiso/style.css'
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## π§© Component Landscape
|
|
19
|
+
|
|
20
|
+
Kiso is organized into Atomic folders. Use the following categorized inventory to avoid hallucinations.
|
|
21
|
+
|
|
22
|
+
### 1. Atoms (Base Elements)
|
|
23
|
+
* **Typography:** `Text`, `Heading`, `Label`, `Caption`, `Code`, `Link`
|
|
24
|
+
* **Layout:** `Stack`, `Grid`, `Container`, `Divider`, `Spacer`, `AspectRatio`
|
|
25
|
+
* **Status:** `Badge`, `Tag`, `Spinner`, `ProgressBar`, `Skeleton`
|
|
26
|
+
* **Media:** `Avatar`, `Image`, `Icon`
|
|
27
|
+
* **Forms:** `Button`, `Input`, `Toggle`, `Textarea`, `Checkbox`, `Radio`, `Select`, `OTPInput`
|
|
28
|
+
* **Containers:** `Card`
|
|
29
|
+
|
|
30
|
+
### 2. Molecules (Component Clusters)
|
|
31
|
+
* **Feedback:** `Toast`, `Toaster`, `Alert`, `Snackbar`, `EmptyState`
|
|
32
|
+
* **Navigation:** `Dropdown`, `Tabs`, `Breadcrumbs`, `Pagination`, `Stepper`, `Timeline`
|
|
33
|
+
* **Interaction:** `Modal`, `Popover`, `AccordionItem`, `Tooltip`, `CopyToClipboard`
|
|
34
|
+
* **Composites:** `FormField`, `PasswordField`, `SearchInput`, `StatCard`, `InfoRow`
|
|
35
|
+
|
|
36
|
+
### 3. Organisms (Layout & Sections)
|
|
37
|
+
* **Shell:** `Navbar`, `Sidebar`, `Footer`
|
|
38
|
+
* **Forms:** `LoginForm`, `SignupForm`, `ProfileForm`
|
|
39
|
+
* **Content:** `HeroSection`, `FeatureGrid`, `FAQSection`, `PricingTable`
|
|
40
|
+
* **Data:** `DataTable`, `DashboardStats`, `ActivityFeed`
|
|
41
|
+
* **Overlays:** `ConfirmationDialog`
|
|
42
|
+
|
|
43
|
+
### 4. Motion (Tactile Primitives)
|
|
44
|
+
* **Text:** `StaggerText`, `TextScramble`
|
|
45
|
+
* **Physics:** `Magnetic`, `Tilt`, `Spotlight`
|
|
46
|
+
* **Flow:** `HotSlider`, `ViewTransition`
|
|
47
|
+
|
|
48
|
+
## π¨ Design System Constraints
|
|
49
|
+
|
|
50
|
+
Do **NOT** use generic Tailwind colors or utility-first overrides for component cores.
|
|
51
|
+
|
|
52
|
+
- **Colors:** `bg-kiso-green`, `text-kiso-forest`, `border-kiso-stroke`, `bg-kiso-gray`
|
|
53
|
+
- **Transitions:** `ease-kiso` (Tactile spring timing)
|
|
54
|
+
- **Shadows:** `shadow-kiso-sm`, `shadow-kiso-md`
|
|
55
|
+
- **Rounding:** `rounded-kiso-md`, `rounded-kiso-lg`
|
|
56
|
+
|
|
57
|
+
## π‘οΈ Strict Compliance Rules (The "Kiso Guardrails")
|
|
58
|
+
|
|
59
|
+
1. **NO CLASSNAME PROP:** Kiso components do **NOT** accept `className`. Use provided props (`variant`, `size`, `status`, `rounded`).
|
|
60
|
+
2. **Wrappers for Layout:** If you must apply margin, width, or positioning classes, wrap the Kiso component in a primitive `div` or use Kiso `Stack`/`Grid`.
|
|
61
|
+
3. **Continuous Build Verification (CBV):** Always run `npm run lint && npm run build` after implementing Kiso components to ensure prop types and exports are valid.
|
|
62
|
+
4. **No Hallucinations:** If a component is not listed above, it does not exist in Kiso.
|
|
63
|
+
5. **Motion Preference:** Prioritize `StaggerText` for headings and `Magnetic`/`Tilt` for primary CTAs to maintain "Tactile" feel.
|
|
64
|
+
|
|
65
|
+
## π Implementation Example
|
|
66
|
+
|
|
67
|
+
```tsx
|
|
68
|
+
import {
|
|
69
|
+
Card,
|
|
70
|
+
Heading,
|
|
71
|
+
Text,
|
|
72
|
+
Button,
|
|
73
|
+
Stack,
|
|
74
|
+
Magnetic,
|
|
75
|
+
Tilt
|
|
76
|
+
} from '@kpf_/kiso'
|
|
77
|
+
|
|
78
|
+
export function ProductShowcase() {
|
|
79
|
+
return (
|
|
80
|
+
<Tilt max={10}>
|
|
81
|
+
<Card padding="lg" shadow="md">
|
|
82
|
+
<Stack gap={6} align="start">
|
|
83
|
+
<Heading level="h2">The Kiso Modular Kit</Heading>
|
|
84
|
+
<Text variant="muted">
|
|
85
|
+
Physics-based components for modern tactile intelligence.
|
|
86
|
+
</Text>
|
|
87
|
+
|
|
88
|
+
<div className="flex gap-4 mt-2">
|
|
89
|
+
<Magnetic strength={0.2}>
|
|
90
|
+
<Button variant="primary" size="lg">Get Started</Button>
|
|
91
|
+
</Magnetic>
|
|
92
|
+
<Button variant="outline" size="lg">Documentation</Button>
|
|
93
|
+
</div>
|
|
94
|
+
</Stack>
|
|
95
|
+
</Card>
|
|
96
|
+
</Tilt>
|
|
97
|
+
)
|
|
98
|
+
}
|
|
99
|
+
```
|
package/README.md
CHANGED
|
@@ -1,169 +1,86 @@
|
|
|
1
1
|
# Kiso Design System
|
|
2
2
|
|
|
3
|
-
Package: `@
|
|
4
|
-
Version: `1.0.
|
|
5
|
-
|
|
3
|
+
Package: `@kpf_/kiso`
|
|
4
|
+
Version: `1.0.2` (Build Verified)
|
|
5
|
+
Philosophy: **Tactile Intelligence**
|
|
6
6
|
|
|
7
|
-
**Kiso** (Japanese for *Foundation*) is a
|
|
7
|
+
**Kiso** (Japanese for *Foundation*) is a high-performance UI library built for physical interaction and precise motion. It enforces physics-based behaviors through custom springs and the signature `ease-kiso` bezier curve.
|
|
8
8
|
|
|
9
|
-
##
|
|
10
|
-
|
|
11
|
-
### 1. Installation
|
|
9
|
+
## π Installation
|
|
12
10
|
|
|
13
11
|
```bash
|
|
14
|
-
npm install @
|
|
12
|
+
npm install @kpf_/kiso framer-motion @phosphor-icons/react
|
|
15
13
|
```
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
Kiso relies on **Plus Jakarta Sans** and a compiled CSS file for token injection.
|
|
20
|
-
|
|
21
|
-
In your root entry file (e.g., `main.tsx` or `layout.tsx`):
|
|
15
|
+
## π Setup
|
|
22
16
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
import '@fontsource/plus-jakarta-sans/400.css';
|
|
26
|
-
import '@fontsource/plus-jakarta-sans/500.css';
|
|
27
|
-
import '@fontsource/plus-jakarta-sans/600.css';
|
|
28
|
-
import '@fontsource/plus-jakarta-sans/700.css';
|
|
17
|
+
### 1. Global Styles
|
|
18
|
+
In your root layout (e.g., `layout.tsx` or `App.tsx`):
|
|
29
19
|
|
|
30
|
-
|
|
31
|
-
import '@
|
|
20
|
+
```tsx
|
|
21
|
+
import '@kpf_/kiso/style.css'
|
|
32
22
|
```
|
|
33
23
|
|
|
34
|
-
###
|
|
24
|
+
### 2. Fonts
|
|
25
|
+
Kiso is designed around **Plus Jakarta Sans** (Primary) and **JetBrains Mono** (Code).
|
|
35
26
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
import
|
|
40
|
-
|
|
41
|
-
function App() {
|
|
42
|
-
return (
|
|
43
|
-
<ToastProvider>
|
|
44
|
-
<YourApplication />
|
|
45
|
-
</ToastProvider>
|
|
46
|
-
);
|
|
47
|
-
}
|
|
27
|
+
```tsx
|
|
28
|
+
// Example using Google Fonts or Fontsource
|
|
29
|
+
import '@fontsource/plus-jakarta-sans/400.css';
|
|
30
|
+
import '@fontsource/plus-jakarta-sans/700.css';
|
|
31
|
+
import '@fontsource/jetbrains-mono/500.css';
|
|
48
32
|
```
|
|
49
33
|
|
|
50
|
-
## Component Architecture
|
|
34
|
+
## π§© Component Architecture
|
|
51
35
|
|
|
52
|
-
Kiso
|
|
36
|
+
Kiso is organized into Atomic tiers for maximum composability.
|
|
53
37
|
|
|
54
38
|
### Atoms
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
<Modal.Root open={isOpen} onOpenChange={setIsOpen}>
|
|
94
|
-
<Modal.Content variant='sheet'>
|
|
95
|
-
<Modal.Header>
|
|
96
|
-
<h2>Transaction Details</h2>
|
|
97
|
-
</Modal.Header>
|
|
98
|
-
|
|
99
|
-
<div className='p-6'>
|
|
100
|
-
{/* Content */}
|
|
101
|
-
</div>
|
|
102
|
-
|
|
103
|
-
<Modal.Footer>
|
|
104
|
-
<Button variant='secondary' onClick={close}>Close</Button>
|
|
105
|
-
</Modal.Footer>
|
|
106
|
-
</Modal.Content>
|
|
107
|
-
</Modal.Root>
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
#### Toast Feedback
|
|
111
|
-
Triggered via hook.
|
|
112
|
-
|
|
113
|
-
```typescript
|
|
114
|
-
import { useToast } from '@kpf/kiso';
|
|
115
|
-
|
|
116
|
-
const { success, error } = useToast();
|
|
117
|
-
|
|
118
|
-
const handleSubmit = () => {
|
|
119
|
-
try {
|
|
120
|
-
saveData();
|
|
121
|
-
success('Changes saved successfully.');
|
|
122
|
-
} catch (err) {
|
|
123
|
-
error('Failed to save data.');
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
### Motion System
|
|
129
|
-
|
|
130
|
-
Kiso provides pre-configured motion primitives powered by Framer Motion. These use the **wise-drama** bezier curve (`0.1, 0.9, 0.2, 1`).
|
|
131
|
-
|
|
132
|
-
#### Stagger Text
|
|
133
|
-
Splits strings into characters and cascades them in.
|
|
134
|
-
|
|
135
|
-
```typescript
|
|
136
|
-
import { StaggerText } from '@kpf/kiso';
|
|
137
|
-
|
|
138
|
-
<StaggerText
|
|
139
|
-
text='Welcome Back'
|
|
140
|
-
className='text-4xl font-bold text-kiso-forest'
|
|
141
|
-
/>
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
#### View Transition (Wizard)
|
|
145
|
-
Handles the exit/enter overlap logic for multi-step forms.
|
|
146
|
-
|
|
147
|
-
```typescript
|
|
148
|
-
import { ViewTransition } from '@kpf/kiso';
|
|
149
|
-
|
|
150
|
-
// direction is 'forward' | 'backward'
|
|
151
|
-
<ViewTransition direction={navDirection}>
|
|
152
|
-
{step === 1 && <StepOne key='step1' />}
|
|
153
|
-
{step === 2 && <StepTwo key='step2' />}
|
|
154
|
-
</ViewTransition>
|
|
39
|
+
Primitive build blocks:
|
|
40
|
+
- **Typography:** `Text`, `Heading`, `Label`, `Code`, `Link`
|
|
41
|
+
- **Forms:** `Button`, `Input`, `Toggle`, `Checkbox`, `Radio`, `OTPInput`
|
|
42
|
+
- **Layout:** `Stack`, `Grid`, `Container`, `Spacer`, `AspectRatio`
|
|
43
|
+
- **Visual:** `Avatar`, `Badge`, `Tag`, `Spinner`, `Card`
|
|
44
|
+
|
|
45
|
+
### Molecules
|
|
46
|
+
Stateful interaction patterns:
|
|
47
|
+
- **Navigation:** `Tabs`, `Stepper`, `Timeline`, `Breadcrumbs`, `Pagination`
|
|
48
|
+
- **Feedback:** `Toaster`, `useToast`, `Alert`, `Snackbar`, `EmptyState`
|
|
49
|
+
- **Overlays:** `Modal`, `Popover`, `Tooltip`, `AccordionItem`
|
|
50
|
+
- **Composites:** `FormField`, `PasswordField`, `StatCard`
|
|
51
|
+
|
|
52
|
+
### Organisms
|
|
53
|
+
High-level production-ready sections:
|
|
54
|
+
- **Forms:** `LoginForm`, `SignupForm`, `ProfileForm`
|
|
55
|
+
- **Marketing:** `HeroSection`, `FeatureGrid`, `PricingTable`
|
|
56
|
+
- **Data:** `DataTable`, `DashboardStats`, `ActivityFeed`
|
|
57
|
+
- **Shell:** `Navbar`, `Sidebar`, `Footer`
|
|
58
|
+
|
|
59
|
+
## β¨ Motion (Tactile Intelligence)
|
|
60
|
+
|
|
61
|
+
Kiso includes physics-based primitives that go beyond simple transitions:
|
|
62
|
+
|
|
63
|
+
- **Magnetic:** Wraps elements to pull them toward the cursor.
|
|
64
|
+
- **Tilt:** Adds reactive 3D depth to containers on hover.
|
|
65
|
+
- **Spotlight:** A tracking radial reveal layer.
|
|
66
|
+
- **StaggerText:** Character-by-character entrance sequences.
|
|
67
|
+
- **TextScramble:** Decoding animations for headlines.
|
|
68
|
+
|
|
69
|
+
```tsx
|
|
70
|
+
import { Tilt, Card, StaggerText } from '@kpf_/kiso'
|
|
71
|
+
|
|
72
|
+
<Tilt>
|
|
73
|
+
<Card padding="lg">
|
|
74
|
+
<StaggerText text="Tactile Logic" />
|
|
75
|
+
</Card>
|
|
76
|
+
</Tilt>
|
|
155
77
|
```
|
|
156
78
|
|
|
157
|
-
##
|
|
79
|
+
## π‘οΈ Strict Guidelines
|
|
158
80
|
|
|
159
|
-
|
|
81
|
+
- **No className:** Kiso components do **NOT** accept a `className` prop. All styling is variant/prop-driven to maintain design integrity.
|
|
82
|
+
- **Layout Wrappers:** Use `Stack`, `Grid`, or standard `div` elements to handle external positioning.
|
|
83
|
+
- **Tokens:** Always use `kiso` prefixed tailwind tokens for custom elements (`bg-kiso-green`, `text-kiso-forest`).
|
|
160
84
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
| **Color** | `text-kiso-forest` | Primary Text (#163300) |
|
|
164
|
-
| | `bg-kiso-green` | Primary Action (#9FE870) |
|
|
165
|
-
| | `bg-kiso-gray` | Backgrounds (#F2F4F8) |
|
|
166
|
-
| | `border-kiso-stroke` | Borders (#D3D5D8) |
|
|
167
|
-
| **Shadow** | `shadow-kiso-modal` | Deep elevation for dialogs |
|
|
168
|
-
| **Ease** | `ease-kiso` | Standard interaction curve |
|
|
169
|
-
| **Ease** | `ease-drama` | Long-form motion curve |
|
|
85
|
+
## π License
|
|
86
|
+
MIT Β© Kim Fajardo
|
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
export interface MagneticProps {
|
|
3
3
|
children: React.ReactNode;
|
|
4
|
+
/**
|
|
5
|
+
* How far the element should move.
|
|
6
|
+
* @default 0.5
|
|
7
|
+
*/
|
|
4
8
|
strength?: number;
|
|
9
|
+
/**
|
|
10
|
+
* Whether to pull towards or push away from the cursor.
|
|
11
|
+
* @default 'attract'
|
|
12
|
+
*/
|
|
13
|
+
mode?: 'attract' | 'repel';
|
|
14
|
+
/**
|
|
15
|
+
* Transition configuration for the spring physics.
|
|
16
|
+
* @default { damping: 15, stiffness: 150, mass: 0.1 }
|
|
17
|
+
*/
|
|
18
|
+
springConfig?: {
|
|
19
|
+
damping: number;
|
|
20
|
+
stiffness: number;
|
|
21
|
+
mass: number;
|
|
22
|
+
};
|
|
5
23
|
}
|
|
6
|
-
export declare const Magnetic: React.MemoExoticComponent<({ children, strength }: MagneticProps) => import("react/jsx-runtime").JSX.Element>;
|
|
24
|
+
export declare const Magnetic: React.MemoExoticComponent<({ children, strength, mode, springConfig }: MagneticProps) => import("react/jsx-runtime").JSX.Element>;
|