@devalok/shilp-sutra 0.2.1 → 0.3.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 +239 -0
- package/dist/composed/content-card.d.ts +2 -2
- package/dist/composed/error-boundary.js +1 -1
- package/dist/shell/notification-preferences.js +14 -14
- package/dist/tailwind/index.cjs +15 -10
- package/dist/tailwind/preset.d.ts.map +1 -1
- package/dist/tailwind/preset.js +15 -10
- package/dist/tokens/index.css +1 -0
- package/dist/tokens/semantic.css +3 -3
- package/dist/tokens/typography.css +7 -7
- package/dist/ui/alert.d.ts +7 -7
- package/dist/ui/alert.js +10 -10
- package/dist/ui/autocomplete.d.ts +3 -3
- package/dist/ui/autocomplete.d.ts.map +1 -1
- package/dist/ui/autocomplete.js +1 -1
- package/dist/ui/badge.d.ts +10 -7
- package/dist/ui/badge.d.ts.map +1 -1
- package/dist/ui/badge.js +82 -30
- package/dist/ui/banner.d.ts +5 -5
- package/dist/ui/banner.js +17 -17
- package/dist/ui/button-group.d.ts +8 -5
- package/dist/ui/button-group.d.ts.map +1 -1
- package/dist/ui/button-group.js +17 -17
- package/dist/ui/button.d.ts +10 -8
- package/dist/ui/button.d.ts.map +1 -1
- package/dist/ui/button.js +65 -47
- package/dist/ui/chip.d.ts +5 -5
- package/dist/ui/chip.js +10 -10
- package/dist/ui/combobox.d.ts +6 -7
- package/dist/ui/combobox.d.ts.map +1 -1
- package/dist/ui/combobox.js +32 -31
- package/dist/ui/dialog.d.ts +5 -11
- package/dist/ui/dialog.d.ts.map +1 -1
- package/dist/ui/dialog.js +53 -53
- package/dist/ui/file-upload.js +34 -34
- package/dist/ui/form.d.ts +31 -28
- package/dist/ui/form.d.ts.map +1 -1
- package/dist/ui/form.js +34 -32
- package/dist/ui/icon-button.d.ts +4 -4
- package/dist/ui/index.d.ts +3 -3
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +69 -69
- package/dist/ui/number-input.d.ts +8 -10
- package/dist/ui/number-input.d.ts.map +1 -1
- package/dist/ui/number-input.js +48 -47
- package/dist/ui/progress.d.ts +1 -1
- package/dist/ui/search-input.js +8 -8
- package/dist/ui/sheet.d.ts +6 -12
- package/dist/ui/sheet.d.ts.map +1 -1
- package/dist/ui/sheet.js +49 -49
- package/dist/ui/sidebar.d.ts +1 -1
- package/dist/ui/slider.d.ts +1 -0
- package/dist/ui/slider.d.ts.map +1 -1
- package/dist/ui/spinner.js +7 -7
- package/dist/ui/switch.d.ts +4 -1
- package/dist/ui/switch.d.ts.map +1 -1
- package/dist/ui/switch.js +13 -12
- package/dist/ui/toast.d.ts +3 -3
- package/dist/ui/toast.js +22 -22
- package/dist/ui/toaster.d.ts +3 -3
- package/dist/ui/toggle-group.d.ts +2 -2
- package/dist/ui/toggle.d.ts +2 -2
- package/fonts/Inter-Italic-Variable.woff2 +0 -0
- package/fonts/Inter-Variable.woff2 +0 -0
- package/fonts/Ranade-Variable.woff2 +0 -0
- package/fonts/Ranade-VariableItalic.woff2 +0 -0
- package/package.json +57 -9
- package/fonts/GoogleSans-Italic-Variable.ttf +0 -0
- package/fonts/GoogleSans-Variable.ttf +0 -0
- package/fonts/Ranade-Variable.ttf +0 -0
- package/fonts/Ranade-VariableItalic.ttf +0 -0
package/README.md
ADDED
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
# @devalok/shilp-sutra
|
|
2
|
+
|
|
3
|
+
Devalok Design System -- tokens, components, and patterns for React & Next.js.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@devalok/shilp-sutra)
|
|
6
|
+
[](https://devalok-design.github.io/shilp-sutra/)
|
|
7
|
+
[](https://opensource.org/licenses/MIT)
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Quick Setup
|
|
12
|
+
|
|
13
|
+
### 1. Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pnpm add @devalok/shilp-sutra
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### 2. Add Tailwind Preset
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
// tailwind.config.ts
|
|
23
|
+
import shilpSutra from '@devalok/shilp-sutra/tailwind'
|
|
24
|
+
|
|
25
|
+
export default {
|
|
26
|
+
presets: [shilpSutra],
|
|
27
|
+
content: [
|
|
28
|
+
'./app/**/*.{ts,tsx}',
|
|
29
|
+
'./node_modules/@devalok/shilp-sutra/dist/**/*.js',
|
|
30
|
+
],
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### 3. Import Tokens
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
// app/layout.tsx (Next.js) or main entry point
|
|
38
|
+
import '@devalok/shilp-sutra/tokens'
|
|
39
|
+
import './globals.css'
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Done. Start using components.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Import Patterns
|
|
47
|
+
|
|
48
|
+
### Per-component import (recommended)
|
|
49
|
+
|
|
50
|
+
Best for tree-shaking, Server Components, and fast builds:
|
|
51
|
+
|
|
52
|
+
```tsx
|
|
53
|
+
import { Button } from '@devalok/shilp-sutra/ui/button'
|
|
54
|
+
import { Dialog } from '@devalok/shilp-sutra/ui/dialog'
|
|
55
|
+
import { DatePicker } from '@devalok/shilp-sutra/composed/date-picker'
|
|
56
|
+
import { TopBar } from '@devalok/shilp-sutra/shell/top-bar'
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Barrel import
|
|
60
|
+
|
|
61
|
+
Convenient for client components that use many primitives:
|
|
62
|
+
|
|
63
|
+
```tsx
|
|
64
|
+
import { Button, Dialog, Input, Badge } from '@devalok/shilp-sutra/ui'
|
|
65
|
+
import { PageHeader, DatePicker } from '@devalok/shilp-sutra/composed'
|
|
66
|
+
import { AppSidebar, TopBar } from '@devalok/shilp-sutra/shell'
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Root import
|
|
70
|
+
|
|
71
|
+
Shorthand for UI components only:
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
import { Button, Input } from '@devalok/shilp-sutra'
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Mental Model
|
|
80
|
+
|
|
81
|
+
The design system is organized into three tiers:
|
|
82
|
+
|
|
83
|
+
| Layer | Import | What it contains |
|
|
84
|
+
|-------|--------|------------------|
|
|
85
|
+
| **ui** | `@devalok/shilp-sutra/ui` | 60+ atomic primitives -- buttons, inputs, dialogs, cards, tables, badges, charts, navigation menus |
|
|
86
|
+
| **composed** | `@devalok/shilp-sutra/composed` | 14 multi-component patterns -- date picker, rich text editor, command palette, page header, skeletons |
|
|
87
|
+
| **shell** | `@devalok/shilp-sutra/shell` | 7 app-level layout components -- sidebar, top bar, bottom navbar, notification center, command palette |
|
|
88
|
+
|
|
89
|
+
Additional exports:
|
|
90
|
+
|
|
91
|
+
| Import | Contents |
|
|
92
|
+
|--------|----------|
|
|
93
|
+
| `@devalok/shilp-sutra/tokens` | CSS custom properties (primitives, semantic, typography) |
|
|
94
|
+
| `@devalok/shilp-sutra/tailwind` | Tailwind CSS preset with all design tokens |
|
|
95
|
+
| `@devalok/shilp-sutra/hooks` | `useToast`, `useColorMode`, `useIsMobile` |
|
|
96
|
+
| `@devalok/shilp-sutra/fonts/*` | Inter and Ranade variable fonts (WOFF2) |
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Peer Dependencies
|
|
101
|
+
|
|
102
|
+
### Required
|
|
103
|
+
|
|
104
|
+
| Package | Version |
|
|
105
|
+
|---------|---------|
|
|
106
|
+
| `react` | `^18 \|\| ^19` |
|
|
107
|
+
| `react-dom` | `^18 \|\| ^19` |
|
|
108
|
+
|
|
109
|
+
### Optional
|
|
110
|
+
|
|
111
|
+
Install only what you use:
|
|
112
|
+
|
|
113
|
+
| Feature | Packages |
|
|
114
|
+
|---------|----------|
|
|
115
|
+
| Charts (`./ui/charts`) | `d3-array`, `d3-axis`, `d3-format`, `d3-interpolate`, `d3-scale`, `d3-selection`, `d3-shape`, `d3-time-format`, `d3-transition` |
|
|
116
|
+
| Rich Text Editor (`./composed/rich-text-editor`) | `@tiptap/react`, `@tiptap/starter-kit`, `@tiptap/extension-placeholder` |
|
|
117
|
+
| DataTable (`./ui/data-table`) | `@tanstack/react-table`, `@tanstack/react-virtual` |
|
|
118
|
+
| Icons (various components) | `@tabler/icons-react` |
|
|
119
|
+
| Date components (`./composed/date-picker`) | `date-fns` |
|
|
120
|
+
| OTP Input (`./ui/input-otp`) | `input-otp` |
|
|
121
|
+
| Markdown rendering | `react-markdown` |
|
|
122
|
+
|
|
123
|
+
Example -- install only charts deps:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
pnpm add d3-array d3-axis d3-format d3-interpolate d3-scale d3-selection d3-shape d3-time-format d3-transition
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Server-Safe Components
|
|
132
|
+
|
|
133
|
+
These components work in React Server Components when imported via their per-component path. They do **not** include `"use client"` directives:
|
|
134
|
+
|
|
135
|
+
### ui
|
|
136
|
+
|
|
137
|
+
| Component | Import |
|
|
138
|
+
|-----------|--------|
|
|
139
|
+
| Text | `@devalok/shilp-sutra/ui/text` |
|
|
140
|
+
| Skeleton | `@devalok/shilp-sutra/ui/skeleton` |
|
|
141
|
+
| Spinner | `@devalok/shilp-sutra/ui/spinner` |
|
|
142
|
+
| Stack | `@devalok/shilp-sutra/ui/stack` |
|
|
143
|
+
| Container | `@devalok/shilp-sutra/ui/container` |
|
|
144
|
+
| Table | `@devalok/shilp-sutra/ui/table` |
|
|
145
|
+
| Code | `@devalok/shilp-sutra/ui/code` |
|
|
146
|
+
| VisuallyHidden | `@devalok/shilp-sutra/ui/visually-hidden` |
|
|
147
|
+
|
|
148
|
+
### composed
|
|
149
|
+
|
|
150
|
+
| Component | Import |
|
|
151
|
+
|-----------|--------|
|
|
152
|
+
| ContentCard | `@devalok/shilp-sutra/composed/content-card` |
|
|
153
|
+
| EmptyState | `@devalok/shilp-sutra/composed/empty-state` |
|
|
154
|
+
| PageHeader | `@devalok/shilp-sutra/composed/page-header` |
|
|
155
|
+
| LoadingSkeleton | `@devalok/shilp-sutra/composed/loading-skeleton` |
|
|
156
|
+
| PageSkeletons | `@devalok/shilp-sutra/composed/page-skeletons` |
|
|
157
|
+
| PriorityIndicator | `@devalok/shilp-sutra/composed/priority-indicator` |
|
|
158
|
+
| StatusBadge | `@devalok/shilp-sutra/composed/status-badge` |
|
|
159
|
+
|
|
160
|
+
All other components require client-side React and include `"use client"`.
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## Dark Mode
|
|
165
|
+
|
|
166
|
+
The design system uses CSS custom properties with a `.dark` class toggle. All semantic tokens have dark mode overrides built in.
|
|
167
|
+
|
|
168
|
+
### Setup
|
|
169
|
+
|
|
170
|
+
Add the `.dark` class to your `<html>` or a parent element:
|
|
171
|
+
|
|
172
|
+
```html
|
|
173
|
+
<html class="dark">
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### Next.js with next-themes
|
|
177
|
+
|
|
178
|
+
```tsx
|
|
179
|
+
// app/layout.tsx
|
|
180
|
+
import { ThemeProvider } from 'next-themes'
|
|
181
|
+
|
|
182
|
+
export default function RootLayout({ children }) {
|
|
183
|
+
return (
|
|
184
|
+
<html suppressHydrationWarning>
|
|
185
|
+
<body>
|
|
186
|
+
<ThemeProvider attribute="class" defaultTheme="system">
|
|
187
|
+
{children}
|
|
188
|
+
</ThemeProvider>
|
|
189
|
+
</body>
|
|
190
|
+
</html>
|
|
191
|
+
)
|
|
192
|
+
}
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### Programmatic toggle
|
|
196
|
+
|
|
197
|
+
```tsx
|
|
198
|
+
import { useColorMode } from '@devalok/shilp-sutra/hooks'
|
|
199
|
+
|
|
200
|
+
function ThemeToggle() {
|
|
201
|
+
const { mode, toggle } = useColorMode()
|
|
202
|
+
return <button onClick={toggle}>{mode === 'dark' ? 'Light' : 'Dark'}</button>
|
|
203
|
+
}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## TypeScript
|
|
209
|
+
|
|
210
|
+
Full TypeScript support works out of the box. No special `tsconfig.json` settings required.
|
|
211
|
+
|
|
212
|
+
All component props are exported as named types:
|
|
213
|
+
|
|
214
|
+
```tsx
|
|
215
|
+
import { type ButtonProps } from '@devalok/shilp-sutra/ui/button'
|
|
216
|
+
import { type DatePickerProps } from '@devalok/shilp-sutra/composed/date-picker'
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## Token Architecture
|
|
222
|
+
|
|
223
|
+
Three-tier CSS custom property system:
|
|
224
|
+
|
|
225
|
+
1. **Primitives** (`primitives.css`) -- Raw palette values (50-950 scales). Never used directly in components.
|
|
226
|
+
2. **Semantic** (`semantic.css`) -- Intent-based tokens (`--color-interactive`, `--color-text-primary`). Includes dark mode via `.dark` class.
|
|
227
|
+
3. **Typography** (`typography.css`) -- Font-face declarations, type scale (T1-T7, B1-B8, L1-L6, P1-P7).
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## Links
|
|
232
|
+
|
|
233
|
+
- [Storybook](https://devalok-design.github.io/shilp-sutra/) -- interactive component docs
|
|
234
|
+
- [GitHub](https://github.com/devalok-design/shilp-sutra)
|
|
235
|
+
- [Changelog](https://github.com/devalok-design/shilp-sutra/blob/main/CHANGELOG.md)
|
|
236
|
+
|
|
237
|
+
## License
|
|
238
|
+
|
|
239
|
+
MIT -- Copyright 2026 Devalok Design & Strategy Studios
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
declare const contentCardVariants: (props?: ({
|
|
4
|
-
variant?: "
|
|
5
|
-
padding?: "
|
|
4
|
+
variant?: "outline" | "ghost" | "default" | null | undefined;
|
|
5
|
+
padding?: "default" | "none" | "compact" | "spacious" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
export interface ContentCardProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof contentCardVariants> {
|
|
8
8
|
header?: React.ReactNode;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as t, Fragment as B, jsx as e } from "react/jsx-runtime";
|
|
3
|
-
import { useState as
|
|
3
|
+
import { useState as i } from "react";
|
|
4
4
|
import { Button as b } from "../ui/button.js";
|
|
5
|
-
import { Select as d, SelectTrigger as o, SelectValue as m, SelectContent as h, SelectItem as
|
|
5
|
+
import { Select as d, SelectTrigger as o, SelectValue as m, SelectContent as h, SelectItem as c } from "../ui/select.js";
|
|
6
6
|
import { Dialog as D, DialogContent as z, DialogHeader as q, DialogTitle as J, DialogDescription as K } from "../ui/dialog.js";
|
|
7
7
|
import { Switch as k } from "../ui/switch.js";
|
|
8
8
|
import { Card as Q, CardHeader as W, CardTitle as X, CardContent as Y } from "../ui/card.js";
|
|
@@ -21,12 +21,12 @@ function te({
|
|
|
21
21
|
projects: v = [],
|
|
22
22
|
isLoading: L = !1,
|
|
23
23
|
onSave: C,
|
|
24
|
-
onToggleMute:
|
|
25
|
-
onUpdateTier:
|
|
24
|
+
onToggleMute: u,
|
|
25
|
+
onUpdateTier: x,
|
|
26
26
|
onDelete: p,
|
|
27
27
|
className: T
|
|
28
28
|
}) {
|
|
29
|
-
const [E, s] =
|
|
29
|
+
const [E, s] = i(!1), [N, g] = i("global"), [I, w] = i("IN_APP"), [y, A] = i("INFO"), [P, j] = i(!1), [S, O] = i(!1), R = async () => {
|
|
30
30
|
if (C) {
|
|
31
31
|
O(!0);
|
|
32
32
|
try {
|
|
@@ -57,7 +57,7 @@ function te({
|
|
|
57
57
|
b,
|
|
58
58
|
{
|
|
59
59
|
size: "sm",
|
|
60
|
-
variant: "
|
|
60
|
+
variant: "outline",
|
|
61
61
|
onClick: () => s(!0),
|
|
62
62
|
children: [
|
|
63
63
|
/* @__PURE__ */ e(Z, { className: "mr-ds-02b h-ico-sm w-ico-sm" }),
|
|
@@ -85,10 +85,10 @@ function te({
|
|
|
85
85
|
d,
|
|
86
86
|
{
|
|
87
87
|
value: l.minTier,
|
|
88
|
-
onValueChange: (r) =>
|
|
88
|
+
onValueChange: (r) => x == null ? void 0 : x(l, r),
|
|
89
89
|
children: [
|
|
90
90
|
/* @__PURE__ */ e(o, { className: "h-ds-xs-plus w-[130px] text-ds-sm", children: /* @__PURE__ */ e(m, {}) }),
|
|
91
|
-
/* @__PURE__ */ e(h, { children: Object.entries(G).map(([r, V]) => /* @__PURE__ */ e(
|
|
91
|
+
/* @__PURE__ */ e(h, { children: Object.entries(G).map(([r, V]) => /* @__PURE__ */ e(c, { value: r, children: V }, r)) })
|
|
92
92
|
]
|
|
93
93
|
}
|
|
94
94
|
),
|
|
@@ -98,7 +98,7 @@ function te({
|
|
|
98
98
|
k,
|
|
99
99
|
{
|
|
100
100
|
checked: !l.muted,
|
|
101
|
-
onCheckedChange: () =>
|
|
101
|
+
onCheckedChange: () => u == null ? void 0 : u(l)
|
|
102
102
|
}
|
|
103
103
|
)
|
|
104
104
|
] }),
|
|
@@ -128,8 +128,8 @@ function te({
|
|
|
128
128
|
/* @__PURE__ */ t(d, { value: N, onValueChange: g, children: [
|
|
129
129
|
/* @__PURE__ */ e(o, { id: "pref-scope", children: /* @__PURE__ */ e(m, { placeholder: "Select scope" }) }),
|
|
130
130
|
/* @__PURE__ */ t(h, { children: [
|
|
131
|
-
/* @__PURE__ */ e(
|
|
132
|
-
v.map((l) => /* @__PURE__ */ e(
|
|
131
|
+
/* @__PURE__ */ e(c, { value: "global", children: "Global (all projects)" }),
|
|
132
|
+
v.map((l) => /* @__PURE__ */ e(c, { value: l.id, children: l.title }, l.id))
|
|
133
133
|
] })
|
|
134
134
|
] })
|
|
135
135
|
] }),
|
|
@@ -138,8 +138,8 @@ function te({
|
|
|
138
138
|
/* @__PURE__ */ t(d, { value: I, onValueChange: w, children: [
|
|
139
139
|
/* @__PURE__ */ e(o, { id: "pref-channel", children: /* @__PURE__ */ e(m, {}) }),
|
|
140
140
|
/* @__PURE__ */ t(h, { children: [
|
|
141
|
-
/* @__PURE__ */ e(
|
|
142
|
-
/* @__PURE__ */ e(
|
|
141
|
+
/* @__PURE__ */ e(c, { value: "IN_APP", children: "In-App" }),
|
|
142
|
+
/* @__PURE__ */ e(c, { value: "GOOGLE_CHAT", children: "Google Chat" })
|
|
143
143
|
] })
|
|
144
144
|
] })
|
|
145
145
|
] }),
|
|
@@ -147,7 +147,7 @@ function te({
|
|
|
147
147
|
/* @__PURE__ */ e("label", { htmlFor: "pref-min-tier", className: "text-ds-sm font-medium text-text-secondary", children: "Minimum Tier" }),
|
|
148
148
|
/* @__PURE__ */ t(d, { value: y, onValueChange: A, children: [
|
|
149
149
|
/* @__PURE__ */ e(o, { id: "pref-min-tier", children: /* @__PURE__ */ e(m, {}) }),
|
|
150
|
-
/* @__PURE__ */ e(h, { children: Object.entries(G).map(([l, n]) => /* @__PURE__ */ e(
|
|
150
|
+
/* @__PURE__ */ e(h, { children: Object.entries(G).map(([l, n]) => /* @__PURE__ */ e(c, { value: l, children: n }, l)) })
|
|
151
151
|
] })
|
|
152
152
|
] }),
|
|
153
153
|
/* @__PURE__ */ t("div", { className: "flex items-center justify-between", children: [
|
package/dist/tailwind/index.cjs
CHANGED
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
const r = {
|
|
2
|
+
/**
|
|
3
|
+
* Dark mode uses the `.dark` class strategy. If your app uses `darkMode: 'media'`,
|
|
4
|
+
* set it explicitly in your own tailwind.config — your config takes precedence.
|
|
5
|
+
*/
|
|
2
6
|
darkMode: "class",
|
|
3
7
|
theme: {
|
|
4
|
-
// Breakpoints must be static values — CSS custom properties cannot be used
|
|
5
|
-
// in @media queries (compiled at build time). These mirror the tokens in
|
|
6
|
-
// semantic.css (--breakpoint-sm … --breakpoint-2xl).
|
|
7
|
-
screens: {
|
|
8
|
-
sm: "640px",
|
|
9
|
-
md: "768px",
|
|
10
|
-
lg: "1024px",
|
|
11
|
-
xl: "1280px",
|
|
12
|
-
"2xl": "1536px"
|
|
13
|
-
},
|
|
14
8
|
extend: {
|
|
9
|
+
// Breakpoints must be static values — CSS custom properties cannot be used
|
|
10
|
+
// in @media queries (compiled at build time). These mirror the tokens in
|
|
11
|
+
// semantic.css (--breakpoint-sm … --breakpoint-2xl).
|
|
12
|
+
// Placed inside `extend` so deployer breakpoints are merged, not replaced.
|
|
13
|
+
screens: {
|
|
14
|
+
sm: "640px",
|
|
15
|
+
md: "768px",
|
|
16
|
+
lg: "1024px",
|
|
17
|
+
xl: "1280px",
|
|
18
|
+
"2xl": "1536px"
|
|
19
|
+
},
|
|
15
20
|
fontFamily: {
|
|
16
21
|
sans: ["var(--font-sans)", "system-ui", "sans-serif"],
|
|
17
22
|
display: ["var(--font-display)", "system-ui", "sans-serif"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preset.d.ts","sourceRoot":"","sources":["../../src/tailwind/preset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEzC,QAAA,MAAM,MAAM,EAAE,OAAO,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"preset.d.ts","sourceRoot":"","sources":["../../src/tailwind/preset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEzC,QAAA,MAAM,MAAM,EAAE,OAAO,CAAC,MAAM,CAuV3B,CAAA;AAED,eAAe,MAAM,CAAA"}
|
package/dist/tailwind/preset.js
CHANGED
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
const r = {
|
|
2
|
+
/**
|
|
3
|
+
* Dark mode uses the `.dark` class strategy. If your app uses `darkMode: 'media'`,
|
|
4
|
+
* set it explicitly in your own tailwind.config — your config takes precedence.
|
|
5
|
+
*/
|
|
2
6
|
darkMode: "class",
|
|
3
7
|
theme: {
|
|
4
|
-
// Breakpoints must be static values — CSS custom properties cannot be used
|
|
5
|
-
// in @media queries (compiled at build time). These mirror the tokens in
|
|
6
|
-
// semantic.css (--breakpoint-sm … --breakpoint-2xl).
|
|
7
|
-
screens: {
|
|
8
|
-
sm: "640px",
|
|
9
|
-
md: "768px",
|
|
10
|
-
lg: "1024px",
|
|
11
|
-
xl: "1280px",
|
|
12
|
-
"2xl": "1536px"
|
|
13
|
-
},
|
|
14
8
|
extend: {
|
|
9
|
+
// Breakpoints must be static values — CSS custom properties cannot be used
|
|
10
|
+
// in @media queries (compiled at build time). These mirror the tokens in
|
|
11
|
+
// semantic.css (--breakpoint-sm … --breakpoint-2xl).
|
|
12
|
+
// Placed inside `extend` so deployer breakpoints are merged, not replaced.
|
|
13
|
+
screens: {
|
|
14
|
+
sm: "640px",
|
|
15
|
+
md: "768px",
|
|
16
|
+
lg: "1024px",
|
|
17
|
+
xl: "1280px",
|
|
18
|
+
"2xl": "1536px"
|
|
19
|
+
},
|
|
15
20
|
fontFamily: {
|
|
16
21
|
sans: ["var(--font-sans)", "system-ui", "sans-serif"],
|
|
17
22
|
display: ["var(--font-display)", "system-ui", "sans-serif"],
|
package/dist/tokens/index.css
CHANGED
package/dist/tokens/semantic.css
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
color-scheme: light;
|
|
3
3
|
|
|
4
4
|
/* Font families — override these with next/font CSS variables */
|
|
5
|
-
--font-sans: "
|
|
6
|
-
--font-display: "
|
|
7
|
-
--font-body: "
|
|
5
|
+
--font-sans: "Inter", system-ui, sans-serif;
|
|
6
|
+
--font-display: "Inter", system-ui, sans-serif;
|
|
7
|
+
--font-body: "Inter", system-ui, sans-serif;
|
|
8
8
|
--font-accent: Ranade, sans-serif;
|
|
9
9
|
--font-mono: "SF Mono", "Fira Code", monospace;
|
|
10
10
|
|
|
@@ -8,17 +8,17 @@
|
|
|
8
8
|
|
|
9
9
|
/* ── Font Faces ─────────────────────────────────────────────────── */
|
|
10
10
|
|
|
11
|
-
/*
|
|
11
|
+
/* Inter (primary UI font) — Variable font: supports weights 100-900 */
|
|
12
12
|
@font-face {
|
|
13
|
-
font-family: '
|
|
14
|
-
src: url('../../fonts/
|
|
13
|
+
font-family: 'Inter';
|
|
14
|
+
src: url('../../fonts/Inter-Variable.woff2') format('woff2');
|
|
15
15
|
font-weight: 100 900;
|
|
16
16
|
font-style: normal;
|
|
17
17
|
font-display: swap;
|
|
18
18
|
}
|
|
19
19
|
@font-face {
|
|
20
|
-
font-family: '
|
|
21
|
-
src: url('../../fonts/
|
|
20
|
+
font-family: 'Inter';
|
|
21
|
+
src: url('../../fonts/Inter-Italic-Variable.woff2') format('woff2');
|
|
22
22
|
font-weight: 100 900;
|
|
23
23
|
font-style: italic;
|
|
24
24
|
font-display: swap;
|
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
/* Ranade (accent — brand moments, hero headings, special callouts) */
|
|
28
28
|
@font-face {
|
|
29
29
|
font-family: 'Ranade';
|
|
30
|
-
src: url('../../fonts/Ranade-Variable.
|
|
30
|
+
src: url('../../fonts/Ranade-Variable.woff2') format('woff2');
|
|
31
31
|
font-weight: 100 900;
|
|
32
32
|
font-display: swap;
|
|
33
33
|
}
|
|
34
34
|
@font-face {
|
|
35
35
|
font-family: 'Ranade';
|
|
36
|
-
src: url('../../fonts/Ranade-VariableItalic.
|
|
36
|
+
src: url('../../fonts/Ranade-VariableItalic.woff2') format('woff2');
|
|
37
37
|
font-weight: 100 900;
|
|
38
38
|
font-style: italic;
|
|
39
39
|
font-display: swap;
|
package/dist/ui/alert.d.ts
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
declare const alertVariants: (props?: ({
|
|
5
|
-
|
|
5
|
+
color?: "error" | "warning" | "success" | "info" | "neutral" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
/**
|
|
8
8
|
* Props for Alert — an inline message block with a colored icon, optional title, optional body,
|
|
9
9
|
* and an optional dismiss button. Renders with `role="alert"` for screen reader announcements.
|
|
10
10
|
*
|
|
11
|
-
* **
|
|
12
|
-
* The matching icon (info circle, checkmark, triangle, alert circle) is auto-selected by
|
|
11
|
+
* **Colors:** `info` (default, blue tones) | `success` | `warning` | `error` | `neutral`
|
|
12
|
+
* The matching icon (info circle, checkmark, triangle, alert circle) is auto-selected by color.
|
|
13
13
|
*
|
|
14
14
|
* **Alert vs Banner:** Alert is inline (inside page content). Banner is a full-width notification
|
|
15
15
|
* strip rendered at the top of a page/section (see `<Banner>`).
|
|
@@ -18,25 +18,25 @@ declare const alertVariants: (props?: ({
|
|
|
18
18
|
*
|
|
19
19
|
* @example
|
|
20
20
|
* // Informational tip inside a settings form:
|
|
21
|
-
* <Alert title="Tip"
|
|
21
|
+
* <Alert title="Tip" color="info">
|
|
22
22
|
* Changes take effect after you save and reload the page.
|
|
23
23
|
* </Alert>
|
|
24
24
|
*
|
|
25
25
|
* @example
|
|
26
26
|
* // Error feedback after a failed API call (dismissible):
|
|
27
|
-
* <Alert
|
|
27
|
+
* <Alert color="error" title="Save failed" onDismiss={() => setError(null)}>
|
|
28
28
|
* Your changes could not be saved. Please try again.
|
|
29
29
|
* </Alert>
|
|
30
30
|
*
|
|
31
31
|
* @example
|
|
32
32
|
* // Success confirmation after publishing:
|
|
33
|
-
* <Alert
|
|
33
|
+
* <Alert color="success" title="Published!">
|
|
34
34
|
* Your post is now live and visible to all subscribers.
|
|
35
35
|
* </Alert>
|
|
36
36
|
*
|
|
37
37
|
* @example
|
|
38
38
|
* // Neutral inline note (no colored intent):
|
|
39
|
-
* <Alert
|
|
39
|
+
* <Alert color="neutral">This field is auto-populated from your profile.</Alert>
|
|
40
40
|
* // These are just a few ways — feel free to combine props creatively!
|
|
41
41
|
*/
|
|
42
42
|
export interface AlertProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof alertVariants> {
|
package/dist/ui/alert.js
CHANGED
|
@@ -4,11 +4,11 @@ import { IconInfoCircle as i, IconAlertCircle as m, IconAlertTriangle as f, Icon
|
|
|
4
4
|
import * as x from "react";
|
|
5
5
|
import { cva as g } from "class-variance-authority";
|
|
6
6
|
import { cn as p } from "./lib/utils.js";
|
|
7
|
-
const
|
|
7
|
+
const h = g(
|
|
8
8
|
"relative flex gap-ds-04 rounded-ds-lg border p-ds-05",
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
|
-
|
|
11
|
+
color: {
|
|
12
12
|
info: "bg-info-surface border-info-border text-info-text",
|
|
13
13
|
success: "bg-success-surface border-success-border text-success-text",
|
|
14
14
|
warning: "bg-warning-surface border-warning-border text-warning-text",
|
|
@@ -16,29 +16,29 @@ const v = g(
|
|
|
16
16
|
neutral: "bg-layer-02 border-border text-text-primary [&>svg]:text-text-secondary"
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
|
-
defaultVariants: {
|
|
19
|
+
defaultVariants: { color: "info" }
|
|
20
20
|
}
|
|
21
|
-
),
|
|
21
|
+
), v = {
|
|
22
22
|
info: i,
|
|
23
23
|
success: b,
|
|
24
24
|
warning: f,
|
|
25
25
|
error: m,
|
|
26
26
|
neutral: i
|
|
27
27
|
}, w = x.forwardRef(
|
|
28
|
-
({ className: n,
|
|
29
|
-
const l =
|
|
30
|
-
return /* @__PURE__ */ t("div", { ref: d, className: p(
|
|
28
|
+
({ className: n, color: e = "info", title: o, onDismiss: s, children: c, ...a }, d) => {
|
|
29
|
+
const l = v[e ?? "info"];
|
|
30
|
+
return /* @__PURE__ */ t("div", { ref: d, className: p(h({ color: e }), n), role: "alert", ...a, children: [
|
|
31
31
|
/* @__PURE__ */ r(l, { className: "mt-ds-01 h-ico-md w-ico-md shrink-0", "aria-hidden": "true" }),
|
|
32
32
|
/* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: [
|
|
33
33
|
o && /* @__PURE__ */ r("p", { className: "text-ds-md font-semibold mb-ds-01", children: o }),
|
|
34
|
-
/* @__PURE__ */ r("div", { className: "text-ds-md opacity-[0.9]", children:
|
|
34
|
+
/* @__PURE__ */ r("div", { className: "text-ds-md opacity-[0.9]", children: c })
|
|
35
35
|
] }),
|
|
36
36
|
s && /* @__PURE__ */ r(
|
|
37
37
|
"button",
|
|
38
38
|
{
|
|
39
39
|
type: "button",
|
|
40
40
|
onClick: s,
|
|
41
|
-
className: "shrink-0 rounded-ds-sm text-icon-secondary transition-colors hover:text-icon-primary hover:bg-field focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus",
|
|
41
|
+
className: "shrink-0 min-h-6 min-w-6 flex items-center justify-center rounded-ds-sm text-icon-secondary transition-colors hover:text-icon-primary hover:bg-field focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus",
|
|
42
42
|
"aria-label": "Dismiss",
|
|
43
43
|
children: /* @__PURE__ */ r(u, { className: "h-ico-sm w-ico-sm" })
|
|
44
44
|
}
|
|
@@ -49,5 +49,5 @@ const v = g(
|
|
|
49
49
|
w.displayName = "Alert";
|
|
50
50
|
export {
|
|
51
51
|
w as Alert,
|
|
52
|
-
|
|
52
|
+
h as alertVariants
|
|
53
53
|
};
|
|
@@ -21,7 +21,7 @@ type AutocompleteOption = {
|
|
|
21
21
|
* <Autocomplete
|
|
22
22
|
* options={[{ value: 'mumbai', label: 'Mumbai' }, { value: 'delhi', label: 'Delhi' }]}
|
|
23
23
|
* value={selectedCity}
|
|
24
|
-
*
|
|
24
|
+
* onValueChange={(opt) => setSelectedCity(opt)}
|
|
25
25
|
* placeholder="Search cities..."
|
|
26
26
|
* />
|
|
27
27
|
*
|
|
@@ -29,7 +29,7 @@ type AutocompleteOption = {
|
|
|
29
29
|
* // Employee name lookup with custom empty text:
|
|
30
30
|
* <Autocomplete
|
|
31
31
|
* options={employees.map(e => ({ value: e.id, label: e.fullName }))}
|
|
32
|
-
*
|
|
32
|
+
* onValueChange={(opt) => setAssignee(opt.value)}
|
|
33
33
|
* emptyText="No employees found"
|
|
34
34
|
* placeholder="Search employees..."
|
|
35
35
|
* />
|
|
@@ -38,7 +38,7 @@ type AutocompleteOption = {
|
|
|
38
38
|
type AutocompleteProps = {
|
|
39
39
|
options: AutocompleteOption[];
|
|
40
40
|
value?: AutocompleteOption | null;
|
|
41
|
-
|
|
41
|
+
onValueChange?: (option: AutocompleteOption) => void;
|
|
42
42
|
placeholder?: string;
|
|
43
43
|
emptyText?: string;
|
|
44
44
|
disabled?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete.d.ts","sourceRoot":"","sources":["../../src/ui/autocomplete.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,KAAK,kBAAkB,GAAG;IACxB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,KAAK,iBAAiB,GAAG;IACvB,OAAO,EAAE,kBAAkB,EAAE,CAAA;IAC7B,KAAK,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAA;IACjC,
|
|
1
|
+
{"version":3,"file":"autocomplete.d.ts","sourceRoot":"","sources":["../../src/ui/autocomplete.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,KAAK,kBAAkB,GAAG;IACxB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,KAAK,iBAAiB,GAAG;IACvB,OAAO,EAAE,kBAAkB,EAAE,CAAA;IAC7B,KAAK,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAA;IACjC,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAA;IACpD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,EAAE,CAAC,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,QAAA,MAAM,YAAY,4FAyKjB,CAAA;AAGD,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,KAAK,kBAAkB,EAAE,CAAA"}
|