@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.
Files changed (71) hide show
  1. package/README.md +239 -0
  2. package/dist/composed/content-card.d.ts +2 -2
  3. package/dist/composed/error-boundary.js +1 -1
  4. package/dist/shell/notification-preferences.js +14 -14
  5. package/dist/tailwind/index.cjs +15 -10
  6. package/dist/tailwind/preset.d.ts.map +1 -1
  7. package/dist/tailwind/preset.js +15 -10
  8. package/dist/tokens/index.css +1 -0
  9. package/dist/tokens/semantic.css +3 -3
  10. package/dist/tokens/typography.css +7 -7
  11. package/dist/ui/alert.d.ts +7 -7
  12. package/dist/ui/alert.js +10 -10
  13. package/dist/ui/autocomplete.d.ts +3 -3
  14. package/dist/ui/autocomplete.d.ts.map +1 -1
  15. package/dist/ui/autocomplete.js +1 -1
  16. package/dist/ui/badge.d.ts +10 -7
  17. package/dist/ui/badge.d.ts.map +1 -1
  18. package/dist/ui/badge.js +82 -30
  19. package/dist/ui/banner.d.ts +5 -5
  20. package/dist/ui/banner.js +17 -17
  21. package/dist/ui/button-group.d.ts +8 -5
  22. package/dist/ui/button-group.d.ts.map +1 -1
  23. package/dist/ui/button-group.js +17 -17
  24. package/dist/ui/button.d.ts +10 -8
  25. package/dist/ui/button.d.ts.map +1 -1
  26. package/dist/ui/button.js +65 -47
  27. package/dist/ui/chip.d.ts +5 -5
  28. package/dist/ui/chip.js +10 -10
  29. package/dist/ui/combobox.d.ts +6 -7
  30. package/dist/ui/combobox.d.ts.map +1 -1
  31. package/dist/ui/combobox.js +32 -31
  32. package/dist/ui/dialog.d.ts +5 -11
  33. package/dist/ui/dialog.d.ts.map +1 -1
  34. package/dist/ui/dialog.js +53 -53
  35. package/dist/ui/file-upload.js +34 -34
  36. package/dist/ui/form.d.ts +31 -28
  37. package/dist/ui/form.d.ts.map +1 -1
  38. package/dist/ui/form.js +34 -32
  39. package/dist/ui/icon-button.d.ts +4 -4
  40. package/dist/ui/index.d.ts +3 -3
  41. package/dist/ui/index.d.ts.map +1 -1
  42. package/dist/ui/index.js +69 -69
  43. package/dist/ui/number-input.d.ts +8 -10
  44. package/dist/ui/number-input.d.ts.map +1 -1
  45. package/dist/ui/number-input.js +48 -47
  46. package/dist/ui/progress.d.ts +1 -1
  47. package/dist/ui/search-input.js +8 -8
  48. package/dist/ui/sheet.d.ts +6 -12
  49. package/dist/ui/sheet.d.ts.map +1 -1
  50. package/dist/ui/sheet.js +49 -49
  51. package/dist/ui/sidebar.d.ts +1 -1
  52. package/dist/ui/slider.d.ts +1 -0
  53. package/dist/ui/slider.d.ts.map +1 -1
  54. package/dist/ui/spinner.js +7 -7
  55. package/dist/ui/switch.d.ts +4 -1
  56. package/dist/ui/switch.d.ts.map +1 -1
  57. package/dist/ui/switch.js +13 -12
  58. package/dist/ui/toast.d.ts +3 -3
  59. package/dist/ui/toast.js +22 -22
  60. package/dist/ui/toaster.d.ts +3 -3
  61. package/dist/ui/toggle-group.d.ts +2 -2
  62. package/dist/ui/toggle.d.ts +2 -2
  63. package/fonts/Inter-Italic-Variable.woff2 +0 -0
  64. package/fonts/Inter-Variable.woff2 +0 -0
  65. package/fonts/Ranade-Variable.woff2 +0 -0
  66. package/fonts/Ranade-VariableItalic.woff2 +0 -0
  67. package/package.json +57 -9
  68. package/fonts/GoogleSans-Italic-Variable.ttf +0 -0
  69. package/fonts/GoogleSans-Variable.ttf +0 -0
  70. package/fonts/Ranade-Variable.ttf +0 -0
  71. 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
+ [![npm](https://img.shields.io/npm/v/@devalok/shilp-sutra)](https://www.npmjs.com/package/@devalok/shilp-sutra)
6
+ [![Storybook](https://img.shields.io/badge/Storybook-ff4785?logo=storybook&logoColor=white)](https://devalok-design.github.io/shilp-sutra/)
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](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?: "ghost" | "default" | "outline" | null | undefined;
5
- padding?: "none" | "default" | "compact" | "spacious" | null | undefined;
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;
@@ -94,7 +94,7 @@ const C = g.forwardRef(
94
94
  o && /* @__PURE__ */ s("div", { className: "flex items-center gap-ds-04", children: /* @__PURE__ */ s(
95
95
  b,
96
96
  {
97
- variant: "secondary",
97
+ variant: "outline",
98
98
  size: "md",
99
99
  onClick: o,
100
100
  children: "Try Again"
@@ -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 c } from "react";
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 i } from "../ui/select.js";
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: x,
25
- onUpdateTier: u,
24
+ onToggleMute: u,
25
+ onUpdateTier: x,
26
26
  onDelete: p,
27
27
  className: T
28
28
  }) {
29
- const [E, s] = c(!1), [N, g] = c("global"), [I, w] = c("IN_APP"), [y, A] = c("INFO"), [P, j] = c(!1), [S, O] = c(!1), R = async () => {
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: "secondary",
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) => u == null ? void 0 : u(l, 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(i, { value: r, children: V }, r)) })
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: () => x == null ? void 0 : x(l)
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(i, { value: "global", children: "Global (all projects)" }),
132
- v.map((l) => /* @__PURE__ */ e(i, { value: l.id, children: l.title }, l.id))
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(i, { value: "IN_APP", children: "In-App" }),
142
- /* @__PURE__ */ e(i, { value: "GOOGLE_CHAT", children: "Google Chat" })
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(i, { value: l, children: n }, l)) })
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: [
@@ -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,CAkV3B,CAAA;AAED,eAAe,MAAM,CAAA"}
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"}
@@ -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,3 +1,4 @@
1
1
  @import './primitives.css';
2
2
  @import './semantic.css';
3
+ @import './typography.css';
3
4
  @import './typography-semantic.css';
@@ -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: "Google Sans", system-ui, sans-serif;
6
- --font-display: "Google Sans", system-ui, sans-serif;
7
- --font-body: "Google Sans", system-ui, sans-serif;
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
- /* Google Sans (primary UI font) — Variable font: supports weights 100-900 */
11
+ /* Inter (primary UI font) — Variable font: supports weights 100-900 */
12
12
  @font-face {
13
- font-family: 'Google Sans';
14
- src: url('../../fonts/GoogleSans-Variable.ttf') format('truetype');
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: 'Google Sans';
21
- src: url('../../fonts/GoogleSans-Italic-Variable.ttf') format('truetype');
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.ttf') format('truetype');
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.ttf') format('truetype');
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;
@@ -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
- variant?: "error" | "warning" | "success" | "info" | "neutral" | null | undefined;
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
- * **Variants:** `info` (default, blue tones) | `success` | `warning` | `error` | `neutral`
12
- * The matching icon (info circle, checkmark, triangle, alert circle) is auto-selected by variant.
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" variant="info">
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 variant="error" title="Save failed" onDismiss={() => setError(null)}>
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 variant="success" title="Published!">
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 variant="neutral">This field is auto-populated from your profile.</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 v = g(
7
+ const h = g(
8
8
  "relative flex gap-ds-04 rounded-ds-lg border p-ds-05",
9
9
  {
10
10
  variants: {
11
- variant: {
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: { variant: "info" }
19
+ defaultVariants: { color: "info" }
20
20
  }
21
- ), h = {
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, variant: e = "info", title: o, onDismiss: s, children: a, ...c }, d) => {
29
- const l = h[e ?? "info"];
30
- return /* @__PURE__ */ t("div", { ref: d, className: p(v({ variant: e }), n), role: "alert", ...c, children: [
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: a })
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
- v as alertVariants
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
- * onChange={(opt) => setSelectedCity(opt)}
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
- * onChange={(opt) => setAssignee(opt.value)}
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
- onChange?: (option: AutocompleteOption) => void;
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,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAA;IAC/C,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"}
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"}
@@ -6,7 +6,7 @@ const T = t.forwardRef(
6
6
  ({
7
7
  options: x,
8
8
  value: o,
9
- onChange: u,
9
+ onValueChange: u,
10
10
  placeholder: D,
11
11
  emptyText: I = "No options",
12
12
  disabled: h,