sangam-ui 0.1.5
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 +603 -0
- package/assets/ESDS logo.png +0 -0
- package/dist/index.d.ts +1434 -0
- package/dist/index.js +2890 -0
- package/package.json +78 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1434 @@
|
|
|
1
|
+
import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
6
|
+
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
7
|
+
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
8
|
+
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
9
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
10
|
+
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Sangam Button Component
|
|
14
|
+
*
|
|
15
|
+
* Production-grade button following Figma design specs:
|
|
16
|
+
* - Colors: From updated color palette (no purple/pink)
|
|
17
|
+
* - Spacing: Token-based padding (spacing/sm, spacing/lg)
|
|
18
|
+
* - Radius: radius/sm
|
|
19
|
+
* - Typography: font-medium, sizes from tokens
|
|
20
|
+
* - Transitions: 200ms ease-out (smart animate)
|
|
21
|
+
*
|
|
22
|
+
* CVA (Class Variance Authority) manages all variants
|
|
23
|
+
*/
|
|
24
|
+
declare const buttonVariants: (props?: ({
|
|
25
|
+
variant?: "link" | "primary" | "secondary" | "danger" | null | undefined;
|
|
26
|
+
size?: "big" | "small" | null | undefined;
|
|
27
|
+
iconOnly?: boolean | null | undefined;
|
|
28
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
29
|
+
/**
|
|
30
|
+
* Button Props
|
|
31
|
+
*
|
|
32
|
+
* Extends native HTML button attributes
|
|
33
|
+
* Adds variant and size from CVA
|
|
34
|
+
* Supports asChild for Radix composition pattern
|
|
35
|
+
* Supports leading/trailing/icon-only layouts controlled by booleans
|
|
36
|
+
*/
|
|
37
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
38
|
+
/**
|
|
39
|
+
* If true, renders as a Slot (for composition with other components)
|
|
40
|
+
* @example
|
|
41
|
+
* <Button asChild>
|
|
42
|
+
* <Link to="/home">Go Home</Link>
|
|
43
|
+
* </Button>
|
|
44
|
+
*/
|
|
45
|
+
asChild?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Icon element to render.
|
|
48
|
+
* Used together with `leadingIcon`, `trailingIcon`, or `iconOnly` booleans.
|
|
49
|
+
* @example
|
|
50
|
+
* <Button leadingIcon icon={<PlusIcon />}>Add Item</Button>
|
|
51
|
+
*/
|
|
52
|
+
icon?: React.ReactNode;
|
|
53
|
+
/**
|
|
54
|
+
* When true, shows the icon before the button label.
|
|
55
|
+
*/
|
|
56
|
+
leadingIcon?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* When true, shows the icon after the button label.
|
|
59
|
+
*/
|
|
60
|
+
trailingIcon?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Loading state: shows spinner, disables interaction, sets aria-busy.
|
|
63
|
+
* Big/icon buttons use 24×24 loader; small uses 16×16. White spinner on dark variants.
|
|
64
|
+
* @example
|
|
65
|
+
* <Button loading>Submit</Button>
|
|
66
|
+
*/
|
|
67
|
+
loading?: boolean;
|
|
68
|
+
}
|
|
69
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Sangam Toggle (Switch) Component
|
|
73
|
+
*
|
|
74
|
+
* Production-grade toggle following Figma design specs:
|
|
75
|
+
* - Colors: Neutral palette from colors.json
|
|
76
|
+
* - Sizes: Big (56×28px), Small (44×24px)
|
|
77
|
+
* - States: Default, Hover, Disabled
|
|
78
|
+
* - Smooth transitions: 200ms ease-out
|
|
79
|
+
*
|
|
80
|
+
* Built on Radix UI Switch for accessibility
|
|
81
|
+
*/
|
|
82
|
+
declare const toggleVariants: (props?: ({
|
|
83
|
+
size?: "big" | "small" | null | undefined;
|
|
84
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
85
|
+
/**
|
|
86
|
+
* Toggle Props
|
|
87
|
+
*
|
|
88
|
+
* Extends Radix Switch props. Adds size variants and optional label variants:
|
|
89
|
+
* - Only toggle: no title/subtext
|
|
90
|
+
* - Toggle + Title: title only (14px, #111111, weight 500, line-height 24px)
|
|
91
|
+
* - Toggle + Title & Subtext: title + subtext (subtext: 12px, #7C7C7C, weight 400, line-height 16px)
|
|
92
|
+
*/
|
|
93
|
+
interface ToggleProps extends React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>, VariantProps<typeof toggleVariants> {
|
|
94
|
+
/**
|
|
95
|
+
* Size of the toggle
|
|
96
|
+
* @default "big"
|
|
97
|
+
*/
|
|
98
|
+
size?: "big" | "small";
|
|
99
|
+
/**
|
|
100
|
+
* Title shown to the right of the toggle. 14px, neutral-1100, font-medium, leading-6.
|
|
101
|
+
*/
|
|
102
|
+
title?: string;
|
|
103
|
+
/**
|
|
104
|
+
* Subtext shown below title. 12px, neutral-600, font-normal, leading-4.
|
|
105
|
+
*/
|
|
106
|
+
subtext?: string;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Sangam Toggle Component
|
|
110
|
+
*
|
|
111
|
+
* Production-grade toggle switch built on:
|
|
112
|
+
* - Radix UI Switch (for accessibility)
|
|
113
|
+
* - CVA (for type-safe size variants)
|
|
114
|
+
* - Sangam tokens (for consistent styling)
|
|
115
|
+
* - 200ms ease-out transitions
|
|
116
|
+
*
|
|
117
|
+
* @example Basic usage
|
|
118
|
+
* <Toggle />
|
|
119
|
+
*
|
|
120
|
+
* @example Controlled
|
|
121
|
+
* <Toggle checked={isOn} onCheckedChange={setIsOn} />
|
|
122
|
+
*
|
|
123
|
+
* @example Small size
|
|
124
|
+
* <Toggle size="small" />
|
|
125
|
+
*
|
|
126
|
+
* @example Disabled
|
|
127
|
+
* <Toggle disabled />
|
|
128
|
+
*
|
|
129
|
+
* @example With label
|
|
130
|
+
* <label className="flex items-center gap-2">
|
|
131
|
+
* <Toggle />
|
|
132
|
+
* <span>Enable notifications</span>
|
|
133
|
+
* </label>
|
|
134
|
+
*
|
|
135
|
+
* @example Toggle + Title
|
|
136
|
+
* <Toggle title="Write label text here" />
|
|
137
|
+
*
|
|
138
|
+
* @example Toggle + Title & Subtext
|
|
139
|
+
* <Toggle title="Write label text here" subtext="Some helper text here" />
|
|
140
|
+
*/
|
|
141
|
+
declare const Toggle: React.ForwardRefExoticComponent<ToggleProps & React.RefAttributes<HTMLButtonElement>>;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Sangam Checkbox Component
|
|
145
|
+
*
|
|
146
|
+
* Production-grade checkbox following Figma design specs:
|
|
147
|
+
* - Colors: Neutral palette from colors.json
|
|
148
|
+
* - Sizes: Big (24×24px), Small (20×20px)
|
|
149
|
+
* - States: Default, Hover, Disabled
|
|
150
|
+
* - Smooth transitions: 200ms ease-out
|
|
151
|
+
*
|
|
152
|
+
* Built on Radix UI Checkbox for accessibility
|
|
153
|
+
*/
|
|
154
|
+
/** Outer container: hit area only. Big 24×24, small 20×20. No border/bg here. */
|
|
155
|
+
declare const checkboxRootVariants: (props?: ({
|
|
156
|
+
size?: "big" | "small" | null | undefined;
|
|
157
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
158
|
+
/**
|
|
159
|
+
* Checkbox Props
|
|
160
|
+
*
|
|
161
|
+
* Extends Radix Checkbox props. Adds size variants and optional label variants:
|
|
162
|
+
* - Only checkbox: no title/subtext
|
|
163
|
+
* - Checkbox + Title: title only (14px, #111111, weight 500, line-height 24px)
|
|
164
|
+
* - Checkbox + Title & Subtext: title + subtext (subtext: 12px, #7C7C7C, weight 400, line-height 16px)
|
|
165
|
+
*/
|
|
166
|
+
interface CheckboxProps extends React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>, VariantProps<typeof checkboxRootVariants> {
|
|
167
|
+
/**
|
|
168
|
+
* Size of the checkbox
|
|
169
|
+
* @default "big"
|
|
170
|
+
*/
|
|
171
|
+
size?: "big" | "small";
|
|
172
|
+
/**
|
|
173
|
+
* Title shown to the right of the checkbox. 14px, neutral-1100, font-medium, leading-6.
|
|
174
|
+
*/
|
|
175
|
+
title?: string;
|
|
176
|
+
/**
|
|
177
|
+
* Subtext shown below title. 12px, neutral-600, font-normal, leading-4.
|
|
178
|
+
*/
|
|
179
|
+
subtext?: string;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Sangam Checkbox Component
|
|
183
|
+
*
|
|
184
|
+
* Production-grade checkbox built on:
|
|
185
|
+
* - Radix UI Checkbox (for accessibility)
|
|
186
|
+
* - CVA (for type-safe size variants)
|
|
187
|
+
* - Sangam tokens (for consistent styling)
|
|
188
|
+
* - 200ms ease-out transitions
|
|
189
|
+
* - Lucide React icons for checkmark
|
|
190
|
+
*
|
|
191
|
+
* @example Basic usage
|
|
192
|
+
* <Checkbox />
|
|
193
|
+
*
|
|
194
|
+
* @example Controlled
|
|
195
|
+
* <Checkbox checked={isChecked} onCheckedChange={setIsChecked} />
|
|
196
|
+
*
|
|
197
|
+
* @example Small size
|
|
198
|
+
* <Checkbox size="small" />
|
|
199
|
+
*
|
|
200
|
+
* @example Disabled
|
|
201
|
+
* <Checkbox disabled />
|
|
202
|
+
*
|
|
203
|
+
* @example With label
|
|
204
|
+
* <div className="flex items-center gap-2">
|
|
205
|
+
* <Checkbox id="terms" />
|
|
206
|
+
* <label htmlFor="terms">Accept terms and conditions</label>
|
|
207
|
+
* </div>
|
|
208
|
+
*
|
|
209
|
+
* @example Checkbox + Title
|
|
210
|
+
* <Checkbox title="Write label text here" />
|
|
211
|
+
*
|
|
212
|
+
* @example Checkbox + Title & Subtext
|
|
213
|
+
* <Checkbox title="Write label text here" subtext="Some helper text here" />
|
|
214
|
+
*/
|
|
215
|
+
declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLButtonElement>>;
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Sangam Radio Component
|
|
219
|
+
*
|
|
220
|
+
* Production-grade radio button following Figma design specs:
|
|
221
|
+
* - Colors: Neutral palette from colors.json
|
|
222
|
+
* - Sizes: Big (24×24px), Small (20×20px)
|
|
223
|
+
* - States: Default, Hover, Disabled
|
|
224
|
+
* - Smooth transitions: 200ms ease-out
|
|
225
|
+
* - Circular shape (rounded-full)
|
|
226
|
+
*
|
|
227
|
+
* Built on Radix UI Radio Group for accessibility
|
|
228
|
+
*/
|
|
229
|
+
declare const radioVariants: (props?: ({
|
|
230
|
+
size?: "big" | "small" | null | undefined;
|
|
231
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
232
|
+
/**
|
|
233
|
+
* Radio Group Props
|
|
234
|
+
*/
|
|
235
|
+
interface RadioGroupProps extends React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root> {
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Radio Group Item Props
|
|
239
|
+
*
|
|
240
|
+
* Extends Radix Radio props. Adds size variants and optional label variants:
|
|
241
|
+
* - Only radio button: no title/subtext
|
|
242
|
+
* - Radio + Title: title only (14px, #111111, weight 500, line-height 24px)
|
|
243
|
+
* - Radio + Title & Subtext: title + subtext (subtext: 12px, #7C7C7C, weight 400, line-height 16px)
|
|
244
|
+
*/
|
|
245
|
+
interface RadioProps extends React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>, VariantProps<typeof radioVariants> {
|
|
246
|
+
/**
|
|
247
|
+
* Size of the radio button
|
|
248
|
+
* @default "big"
|
|
249
|
+
*/
|
|
250
|
+
size?: "big" | "small";
|
|
251
|
+
/**
|
|
252
|
+
* Title shown to the right of the radio. 14px, neutral-1100, font-medium, leading-6.
|
|
253
|
+
*/
|
|
254
|
+
title?: string;
|
|
255
|
+
/**
|
|
256
|
+
* Subtext shown below title. 12px, neutral-600, font-normal, leading-4.
|
|
257
|
+
*/
|
|
258
|
+
subtext?: string;
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Sangam Radio Group Component
|
|
262
|
+
*
|
|
263
|
+
* Container for radio buttons - ensures only one can be selected at a time
|
|
264
|
+
*
|
|
265
|
+
* @example Basic usage
|
|
266
|
+
* <RadioGroup defaultValue="option1">
|
|
267
|
+
* <Radio value="option1" />
|
|
268
|
+
* <Radio value="option2" />
|
|
269
|
+
* </RadioGroup>
|
|
270
|
+
*/
|
|
271
|
+
declare const RadioGroup: React.ForwardRefExoticComponent<RadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
272
|
+
/**
|
|
273
|
+
* Sangam Radio Component
|
|
274
|
+
*
|
|
275
|
+
* Production-grade radio button built on:
|
|
276
|
+
* - Radix UI Radio Group (for accessibility and mutual exclusivity)
|
|
277
|
+
* - CVA (for type-safe size variants)
|
|
278
|
+
* - Sangam tokens (for consistent styling)
|
|
279
|
+
* - 200ms ease-out transitions
|
|
280
|
+
*
|
|
281
|
+
* @example Basic usage
|
|
282
|
+
* <RadioGroup defaultValue="option1">
|
|
283
|
+
* <Radio value="option1" id="r1" />
|
|
284
|
+
* <label htmlFor="r1">Option 1</label>
|
|
285
|
+
* </RadioGroup>
|
|
286
|
+
*
|
|
287
|
+
* @example Controlled
|
|
288
|
+
* <RadioGroup value={selected} onValueChange={setSelected}>
|
|
289
|
+
* <Radio value="option1" />
|
|
290
|
+
* <Radio value="option2" />
|
|
291
|
+
* </RadioGroup>
|
|
292
|
+
*
|
|
293
|
+
* @example Small size
|
|
294
|
+
* <RadioGroup defaultValue="option1">
|
|
295
|
+
* <Radio value="option1" size="small" />
|
|
296
|
+
* </RadioGroup>
|
|
297
|
+
*
|
|
298
|
+
* @example Disabled
|
|
299
|
+
* <Radio value="option1" disabled />
|
|
300
|
+
*
|
|
301
|
+
* @example With label
|
|
302
|
+
* <RadioGroup defaultValue="option1">
|
|
303
|
+
* <div className="flex items-center gap-2">
|
|
304
|
+
* <Radio value="option1" id="option1" />
|
|
305
|
+
* <label htmlFor="option1">Option 1</label>
|
|
306
|
+
* </div>
|
|
307
|
+
* </RadioGroup>
|
|
308
|
+
*
|
|
309
|
+
* @example Radio + Title
|
|
310
|
+
* <RadioGroup defaultValue="a">
|
|
311
|
+
* <Radio value="a" title="Write label text here" />
|
|
312
|
+
* </RadioGroup>
|
|
313
|
+
*
|
|
314
|
+
* @example Radio + Title & Subtext
|
|
315
|
+
* <RadioGroup defaultValue="a">
|
|
316
|
+
* <Radio value="a" title="Write label text here" subtext="Some helper text here" />
|
|
317
|
+
* </RadioGroup>
|
|
318
|
+
*/
|
|
319
|
+
declare const Radio: React.ForwardRefExoticComponent<RadioProps & React.RefAttributes<HTMLButtonElement>>;
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* Sangam Input Component
|
|
323
|
+
*
|
|
324
|
+
* Production-grade text input following Figma design specs:
|
|
325
|
+
* - Colors: Neutral, Red, Green from colors.json
|
|
326
|
+
* - Multiple states: Default, Hover, Active, Typing, Filled, Error, Success, Disabled
|
|
327
|
+
* - Consistent padding: 4px 12px
|
|
328
|
+
* - Smooth transitions: 200ms ease-out
|
|
329
|
+
*
|
|
330
|
+
* Built with compound component pattern (Input + Label)
|
|
331
|
+
*/
|
|
332
|
+
declare const inputVariants: (props?: ({
|
|
333
|
+
variant?: "default" | "error" | "success" | null | undefined;
|
|
334
|
+
filled?: boolean | null | undefined;
|
|
335
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
336
|
+
/**
|
|
337
|
+
* Input Props
|
|
338
|
+
*/
|
|
339
|
+
interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size">, VariantProps<typeof inputVariants> {
|
|
340
|
+
/**
|
|
341
|
+
* Error state - shows red border
|
|
342
|
+
*/
|
|
343
|
+
error?: boolean;
|
|
344
|
+
/**
|
|
345
|
+
* Success state - shows green border
|
|
346
|
+
*/
|
|
347
|
+
success?: boolean;
|
|
348
|
+
/**
|
|
349
|
+
* Label text
|
|
350
|
+
*/
|
|
351
|
+
label?: string;
|
|
352
|
+
/**
|
|
353
|
+
* Whether the label is required (shows red asterisk)
|
|
354
|
+
*/
|
|
355
|
+
required?: boolean;
|
|
356
|
+
/**
|
|
357
|
+
* Helper text below input (for errors, hints, etc.)
|
|
358
|
+
*/
|
|
359
|
+
helperText?: string;
|
|
360
|
+
/**
|
|
361
|
+
* Whether helper text is an error message
|
|
362
|
+
*/
|
|
363
|
+
helperError?: boolean;
|
|
364
|
+
/**
|
|
365
|
+
* Show info icon next to label (after required asterisk)
|
|
366
|
+
* @default false
|
|
367
|
+
*/
|
|
368
|
+
showLabelIcon?: boolean;
|
|
369
|
+
/**
|
|
370
|
+
* Show icon with supporting/helper text
|
|
371
|
+
* @default false
|
|
372
|
+
*/
|
|
373
|
+
showHelperIcon?: boolean;
|
|
374
|
+
/**
|
|
375
|
+
* Trailing icon (e.g. dropdown chevron) - renders inside input wrapper on the right with border
|
|
376
|
+
*/
|
|
377
|
+
trailingIcon?: React.ReactNode;
|
|
378
|
+
/**
|
|
379
|
+
* CTA label (e.g. "Button") - renders as link at end of input
|
|
380
|
+
*/
|
|
381
|
+
ctaLabel?: string;
|
|
382
|
+
/**
|
|
383
|
+
* Callback when CTA is clicked
|
|
384
|
+
*/
|
|
385
|
+
onCtaClick?: () => void;
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* Label Component
|
|
389
|
+
*
|
|
390
|
+
* Displays label with optional required asterisk
|
|
391
|
+
*/
|
|
392
|
+
interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
|
|
393
|
+
/**
|
|
394
|
+
* Shows red asterisk for required fields
|
|
395
|
+
*/
|
|
396
|
+
required?: boolean;
|
|
397
|
+
/**
|
|
398
|
+
* Optional content after the asterisk (e.g. info icon)
|
|
399
|
+
*/
|
|
400
|
+
endAdornment?: React.ReactNode;
|
|
401
|
+
}
|
|
402
|
+
declare const Label: React.ForwardRefExoticComponent<LabelProps & React.RefAttributes<HTMLLabelElement>>;
|
|
403
|
+
/**
|
|
404
|
+
* Sangam Input Component
|
|
405
|
+
*
|
|
406
|
+
* Production-grade text input built with:
|
|
407
|
+
* - CVA (for type-safe variants)
|
|
408
|
+
* - Sangam tokens (for consistent styling)
|
|
409
|
+
* - 200ms ease-out transitions
|
|
410
|
+
* - Accessible label and helper text
|
|
411
|
+
*
|
|
412
|
+
* @example Basic usage
|
|
413
|
+
* <Input label="Email" placeholder="Enter your email" />
|
|
414
|
+
*
|
|
415
|
+
* @example Required field
|
|
416
|
+
* <Input label="Username" required />
|
|
417
|
+
*
|
|
418
|
+
* @example Error state
|
|
419
|
+
* <Input
|
|
420
|
+
* label="Password"
|
|
421
|
+
* error
|
|
422
|
+
* helperText="Password must be at least 8 characters"
|
|
423
|
+
* />
|
|
424
|
+
*
|
|
425
|
+
* @example Success state
|
|
426
|
+
* <Input
|
|
427
|
+
* label="Email"
|
|
428
|
+
* success
|
|
429
|
+
* value="user@example.com"
|
|
430
|
+
* />
|
|
431
|
+
*
|
|
432
|
+
* @example Disabled
|
|
433
|
+
* <Input label="Username" disabled value="john.doe" />
|
|
434
|
+
*
|
|
435
|
+
* @example With helper text
|
|
436
|
+
* <Input
|
|
437
|
+
* label="Email"
|
|
438
|
+
* helperText="We'll never share your email"
|
|
439
|
+
* />
|
|
440
|
+
*/
|
|
441
|
+
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
442
|
+
|
|
443
|
+
declare const dropdownTriggerVariants: (props?: ({
|
|
444
|
+
error?: boolean | null | undefined;
|
|
445
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
446
|
+
declare const dropdownContentVariants: (props?: class_variance_authority_dist_types.ClassProp | undefined) => string;
|
|
447
|
+
declare const dropdownItemVariants: (props?: class_variance_authority_dist_types.ClassProp | undefined) => string;
|
|
448
|
+
interface DropdownOption {
|
|
449
|
+
value: string;
|
|
450
|
+
label: string;
|
|
451
|
+
disabled?: boolean;
|
|
452
|
+
}
|
|
453
|
+
interface DropdownProps extends Omit<React.ComponentPropsWithoutRef<typeof SelectPrimitive.Root>, "children">, VariantProps<typeof dropdownTriggerVariants> {
|
|
454
|
+
/**
|
|
455
|
+
* Label text (same as Input)
|
|
456
|
+
*/
|
|
457
|
+
label?: string;
|
|
458
|
+
/**
|
|
459
|
+
* Required field (red asterisk)
|
|
460
|
+
*/
|
|
461
|
+
required?: boolean;
|
|
462
|
+
/**
|
|
463
|
+
* Placeholder when no value selected
|
|
464
|
+
*/
|
|
465
|
+
placeholder?: string;
|
|
466
|
+
/**
|
|
467
|
+
* Options for the dropdown
|
|
468
|
+
*/
|
|
469
|
+
options: DropdownOption[];
|
|
470
|
+
/**
|
|
471
|
+
* Trigger width (in pixels). If not provided, the trigger will stretch to 100% width of its container.
|
|
472
|
+
* @default 100%
|
|
473
|
+
*/
|
|
474
|
+
width?: number;
|
|
475
|
+
/**
|
|
476
|
+
* Error state (red border, red-800)
|
|
477
|
+
*/
|
|
478
|
+
error?: boolean;
|
|
479
|
+
/**
|
|
480
|
+
* Filled disabled state (bg/border neutral-200, text neutral-1100, not editable)
|
|
481
|
+
*/
|
|
482
|
+
/**
|
|
483
|
+
* Show info icon next to label (after required asterisk)
|
|
484
|
+
* @default false
|
|
485
|
+
*/
|
|
486
|
+
showLabelIcon?: boolean;
|
|
487
|
+
/**
|
|
488
|
+
* Helper/supporting text below dropdown
|
|
489
|
+
*/
|
|
490
|
+
helperText?: string;
|
|
491
|
+
/**
|
|
492
|
+
* Show icon with helper text (Info when neutral, InfoFilled when error)
|
|
493
|
+
* @default false
|
|
494
|
+
*/
|
|
495
|
+
showHelperIcon?: boolean;
|
|
496
|
+
/**
|
|
497
|
+
* Label for "Select all" option; set to empty to hide
|
|
498
|
+
*/
|
|
499
|
+
selectAllLabel?: string;
|
|
500
|
+
}
|
|
501
|
+
/**
|
|
502
|
+
* Dropdown (single select) — Input-style trigger with chevron, Radix Select content.
|
|
503
|
+
*/
|
|
504
|
+
declare const Dropdown: React.ForwardRefExoticComponent<DropdownProps & React.RefAttributes<HTMLButtonElement>>;
|
|
505
|
+
/** Multi-select dropdown: trigger bg white, border neutral-400; menu border neutral-200, divider neutral-200; padding 8, gap 8 */
|
|
506
|
+
interface DropdownMultiProps {
|
|
507
|
+
label?: string;
|
|
508
|
+
required?: boolean;
|
|
509
|
+
placeholder?: string;
|
|
510
|
+
options: DropdownOption[];
|
|
511
|
+
value: string[];
|
|
512
|
+
onValueChange: (value: string[]) => void;
|
|
513
|
+
/**
|
|
514
|
+
* Trigger width (in pixels). If not provided, the trigger will stretch to 100% width of its container.
|
|
515
|
+
* @default 100%
|
|
516
|
+
*/
|
|
517
|
+
width?: number;
|
|
518
|
+
/**
|
|
519
|
+
* Error state (red border and red helper text)
|
|
520
|
+
*/
|
|
521
|
+
error?: boolean;
|
|
522
|
+
disabled?: boolean;
|
|
523
|
+
/** Label for "Select all" option; set to empty to hide */
|
|
524
|
+
selectAllLabel?: string;
|
|
525
|
+
/** Show info icon next to label (after required asterisk) */
|
|
526
|
+
showLabelIcon?: boolean;
|
|
527
|
+
/** Helper/supporting text below dropdown */
|
|
528
|
+
helperText?: string;
|
|
529
|
+
/** Show icon with helper text */
|
|
530
|
+
showHelperIcon?: boolean;
|
|
531
|
+
}
|
|
532
|
+
declare const DropdownMulti: React.ForwardRefExoticComponent<DropdownMultiProps & React.RefAttributes<HTMLButtonElement>>;
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* Sangam SearchField Component
|
|
536
|
+
*
|
|
537
|
+
* Production-grade search input following Figma design specs:
|
|
538
|
+
* - Width: Fixed 400px
|
|
539
|
+
* - Colors: Neutral palette from colors.json
|
|
540
|
+
* - Multiple states: Default, Hover, Active, Typing, Filled, Disabled
|
|
541
|
+
* - Border radius: 8px
|
|
542
|
+
* - Padding: 4px 12px
|
|
543
|
+
* - Gap: 8px
|
|
544
|
+
* - Icon size: 16×16px
|
|
545
|
+
* - Close icon: 16×16px (same as search icon)
|
|
546
|
+
* - Smooth transitions: 200ms ease-out
|
|
547
|
+
*/
|
|
548
|
+
declare const searchFieldVariants: (props?: ({} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
549
|
+
/**
|
|
550
|
+
* SearchField Props
|
|
551
|
+
*/
|
|
552
|
+
interface SearchFieldProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> {
|
|
553
|
+
/**
|
|
554
|
+
* Width in pixels. If not provided, the search field will stretch to 100% width with a minimum of 296px.
|
|
555
|
+
* @default 100%
|
|
556
|
+
*/
|
|
557
|
+
width?: number | string;
|
|
558
|
+
/**
|
|
559
|
+
* Callback when clear button is clicked
|
|
560
|
+
*/
|
|
561
|
+
onClear?: () => void;
|
|
562
|
+
/**
|
|
563
|
+
* Whether to show the clear button when input has value
|
|
564
|
+
* @default true
|
|
565
|
+
*/
|
|
566
|
+
showClearButton?: boolean;
|
|
567
|
+
}
|
|
568
|
+
declare const SearchField: React.ForwardRefExoticComponent<SearchFieldProps & React.RefAttributes<HTMLInputElement>>;
|
|
569
|
+
|
|
570
|
+
/**
|
|
571
|
+
* Sangam Textarea Component
|
|
572
|
+
*
|
|
573
|
+
* Production-grade textarea following Figma design specs:
|
|
574
|
+
* - Width: Fixed 450px
|
|
575
|
+
* - Height: Fixed 96px
|
|
576
|
+
* - Colors: Neutral, Red, Green from colors.json
|
|
577
|
+
* - Multiple states: Default, Hover, Active, Typing, Filled, Error, Success, Disabled
|
|
578
|
+
* - Padding: 4px 12px
|
|
579
|
+
* - Border radius: 8px (sm)
|
|
580
|
+
* - Character counter: X/250 format
|
|
581
|
+
* - Smooth transitions: 200ms ease-out
|
|
582
|
+
*
|
|
583
|
+
* Built with compound component pattern (Textarea + Label)
|
|
584
|
+
*/
|
|
585
|
+
declare const textareaVariants: (props?: ({
|
|
586
|
+
variant?: "default" | "error" | "success" | null | undefined;
|
|
587
|
+
filled?: boolean | null | undefined;
|
|
588
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
589
|
+
/**
|
|
590
|
+
* Textarea Props
|
|
591
|
+
*/
|
|
592
|
+
interface TextareaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "size">, VariantProps<typeof textareaVariants> {
|
|
593
|
+
/**
|
|
594
|
+
* Error state - shows red border
|
|
595
|
+
*/
|
|
596
|
+
error?: boolean;
|
|
597
|
+
/**
|
|
598
|
+
* Success state - shows green border
|
|
599
|
+
*/
|
|
600
|
+
success?: boolean;
|
|
601
|
+
/**
|
|
602
|
+
* Label text
|
|
603
|
+
*/
|
|
604
|
+
label?: string;
|
|
605
|
+
/**
|
|
606
|
+
* Whether the label is required (shows red asterisk)
|
|
607
|
+
*/
|
|
608
|
+
required?: boolean;
|
|
609
|
+
/**
|
|
610
|
+
* Helper text below textarea (for errors, hints, etc.)
|
|
611
|
+
*/
|
|
612
|
+
helperText?: string;
|
|
613
|
+
/**
|
|
614
|
+
* Whether helper text is an error message
|
|
615
|
+
*/
|
|
616
|
+
helperError?: boolean;
|
|
617
|
+
/**
|
|
618
|
+
* Maximum character length
|
|
619
|
+
* @default 250
|
|
620
|
+
*/
|
|
621
|
+
maxLength?: number;
|
|
622
|
+
/**
|
|
623
|
+
* Show character counter
|
|
624
|
+
* @default true
|
|
625
|
+
*/
|
|
626
|
+
showCounter?: boolean;
|
|
627
|
+
/**
|
|
628
|
+
* Show info icon next to label
|
|
629
|
+
* @default false
|
|
630
|
+
*/
|
|
631
|
+
showLabelIcon?: boolean;
|
|
632
|
+
/**
|
|
633
|
+
* Show icon with supporting text
|
|
634
|
+
* @default false
|
|
635
|
+
*/
|
|
636
|
+
showHelperIcon?: boolean;
|
|
637
|
+
}
|
|
638
|
+
/**
|
|
639
|
+
* Sangam Textarea Component
|
|
640
|
+
*
|
|
641
|
+
* Production-grade textarea built with:
|
|
642
|
+
* - CVA (for type-safe variants)
|
|
643
|
+
* - Sangam tokens (for consistent styling)
|
|
644
|
+
* - 200ms ease-out transitions
|
|
645
|
+
* - Accessible label and helper text
|
|
646
|
+
* - Fixed height (96px)
|
|
647
|
+
*
|
|
648
|
+
* @example Basic usage
|
|
649
|
+
* <Textarea label="Description" placeholder="Enter description..." />
|
|
650
|
+
*
|
|
651
|
+
* @example Required field
|
|
652
|
+
* <Textarea label="Comments" required />
|
|
653
|
+
*
|
|
654
|
+
* @example Error state
|
|
655
|
+
* <Textarea
|
|
656
|
+
* label="Message"
|
|
657
|
+
* error
|
|
658
|
+
* helperText="Message must be at least 10 characters"
|
|
659
|
+
* />
|
|
660
|
+
*
|
|
661
|
+
* @example Success state
|
|
662
|
+
* <Textarea
|
|
663
|
+
* label="Feedback"
|
|
664
|
+
* success
|
|
665
|
+
* value="Great product!"
|
|
666
|
+
* />
|
|
667
|
+
*
|
|
668
|
+
* @example Disabled
|
|
669
|
+
* <Textarea label="Notes" disabled value="Read-only notes" />
|
|
670
|
+
*
|
|
671
|
+
* @example With helper text
|
|
672
|
+
* <Textarea
|
|
673
|
+
* label="Bio"
|
|
674
|
+
* helperText="Tell us about yourself (max 500 characters)"
|
|
675
|
+
* />
|
|
676
|
+
*
|
|
677
|
+
* @example Label with info icon
|
|
678
|
+
* <Textarea label="Description" showLabelIcon required />
|
|
679
|
+
*
|
|
680
|
+
* @example With supporting text and icon
|
|
681
|
+
* <Textarea
|
|
682
|
+
* label="Comments"
|
|
683
|
+
* helperText="Supporting text"
|
|
684
|
+
* showHelperIcon
|
|
685
|
+
* />
|
|
686
|
+
*
|
|
687
|
+
* @example Success with icon
|
|
688
|
+
* <Textarea
|
|
689
|
+
* label="Feedback"
|
|
690
|
+
* success
|
|
691
|
+
* helperText="Supporting text"
|
|
692
|
+
* value="Great product!"
|
|
693
|
+
* />
|
|
694
|
+
*
|
|
695
|
+
* @example Error with icon
|
|
696
|
+
* <Textarea
|
|
697
|
+
* label="Message"
|
|
698
|
+
* error
|
|
699
|
+
* helperText="Supporting text"
|
|
700
|
+
* />
|
|
701
|
+
*/
|
|
702
|
+
declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
703
|
+
|
|
704
|
+
/**
|
|
705
|
+
* Sangam Tooltip Component
|
|
706
|
+
*
|
|
707
|
+
* Production-grade tooltip following Figma design specs:
|
|
708
|
+
* - Colors: Background #111111, Text #FFFFFF
|
|
709
|
+
* - Fixed width: 7.5rem (120px at default)
|
|
710
|
+
* - Fixed height: 2rem (32px at default), 3.25rem (52px with description)
|
|
711
|
+
* - Border radius: 4px
|
|
712
|
+
* - Padding: 16px
|
|
713
|
+
* - Gap: 4px
|
|
714
|
+
* - Title: 12px, 500 weight, 16px line-height
|
|
715
|
+
* - Arrow: 12×8px (all directions)
|
|
716
|
+
*
|
|
717
|
+
* Uses rem for dimensions to respect user font size preferences (accessibility)
|
|
718
|
+
*
|
|
719
|
+
* Three variants:
|
|
720
|
+
* 1. Default - Just title (32px height)
|
|
721
|
+
* 2. With Description - Title + description (52px height)
|
|
722
|
+
* 3. With Close Icon - Title + description + close icon (52px height)
|
|
723
|
+
*
|
|
724
|
+
* Built on Radix UI Tooltip for accessibility
|
|
725
|
+
*
|
|
726
|
+
* @example Basic usage (Default)
|
|
727
|
+
* <TooltipProvider>
|
|
728
|
+
* <Tooltip>
|
|
729
|
+
* <TooltipTrigger>Hover me</TooltipTrigger>
|
|
730
|
+
* <TooltipContent title="Title" />
|
|
731
|
+
* </Tooltip>
|
|
732
|
+
* </TooltipProvider>
|
|
733
|
+
*
|
|
734
|
+
* @example With Description
|
|
735
|
+
* <TooltipContent title="Title" description="Description" />
|
|
736
|
+
*
|
|
737
|
+
* @example With Close Icon
|
|
738
|
+
* <TooltipContent title="Title" description="Description" showCloseIcon />
|
|
739
|
+
*/
|
|
740
|
+
declare const tooltipContentVariants: (props?: ({
|
|
741
|
+
variant?: "default" | "withDescription" | null | undefined;
|
|
742
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
743
|
+
interface TooltipContentProps extends Omit<React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>, "title">, VariantProps<typeof tooltipContentVariants> {
|
|
744
|
+
/**
|
|
745
|
+
* Title text (required)
|
|
746
|
+
*/
|
|
747
|
+
title: string;
|
|
748
|
+
/**
|
|
749
|
+
* Description text (optional)
|
|
750
|
+
* When provided, tooltip height becomes 52px
|
|
751
|
+
*/
|
|
752
|
+
description?: string;
|
|
753
|
+
/**
|
|
754
|
+
* Whether to show close icon in top-right
|
|
755
|
+
* @default false
|
|
756
|
+
*/
|
|
757
|
+
showCloseIcon?: boolean;
|
|
758
|
+
/**
|
|
759
|
+
* Callback when close icon is clicked
|
|
760
|
+
*/
|
|
761
|
+
onClose?: () => void;
|
|
762
|
+
/**
|
|
763
|
+
* Whether to show the arrow
|
|
764
|
+
* @default true
|
|
765
|
+
*/
|
|
766
|
+
showArrow?: boolean;
|
|
767
|
+
/**
|
|
768
|
+
* Offset from the trigger element (gap between trigger and arrow)
|
|
769
|
+
* @default 12
|
|
770
|
+
*/
|
|
771
|
+
sideOffset?: number;
|
|
772
|
+
}
|
|
773
|
+
declare const TooltipProvider: React.FC<TooltipPrimitive.TooltipProviderProps>;
|
|
774
|
+
declare const Tooltip: React.FC<TooltipPrimitive.TooltipProps>;
|
|
775
|
+
declare const TooltipTrigger: React.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
776
|
+
/**
|
|
777
|
+
* TooltipContent component with caret
|
|
778
|
+
*
|
|
779
|
+
* Renders tooltip content with appropriate caret based on side and alignment
|
|
780
|
+
* Supports three variants: default, with description, with close icon
|
|
781
|
+
*/
|
|
782
|
+
declare const TooltipContent: React.ForwardRefExoticComponent<TooltipContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
783
|
+
|
|
784
|
+
interface ProgressBarProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
|
|
785
|
+
/**
|
|
786
|
+
* Current progress value (0–100).
|
|
787
|
+
*/
|
|
788
|
+
value: number;
|
|
789
|
+
/**
|
|
790
|
+
* Maximum value (default 100).
|
|
791
|
+
*/
|
|
792
|
+
max?: number;
|
|
793
|
+
/**
|
|
794
|
+
* Show percentage label: "left" | "right" | "both" | "none".
|
|
795
|
+
* @default "both"
|
|
796
|
+
*/
|
|
797
|
+
showLabel?: "left" | "right" | "both" | "none";
|
|
798
|
+
/**
|
|
799
|
+
* Track width in pixels. Ignored when fluid is true.
|
|
800
|
+
* @default 476
|
|
801
|
+
*/
|
|
802
|
+
width?: number;
|
|
803
|
+
/**
|
|
804
|
+
* When true, track uses full width of container (responsive).
|
|
805
|
+
* @default false
|
|
806
|
+
*/
|
|
807
|
+
fluid?: boolean;
|
|
808
|
+
/**
|
|
809
|
+
* Track height in pixels.
|
|
810
|
+
* @default 6
|
|
811
|
+
*/
|
|
812
|
+
height?: number;
|
|
813
|
+
/**
|
|
814
|
+
* Accessible label for the progress bar.
|
|
815
|
+
*/
|
|
816
|
+
"aria-label"?: string;
|
|
817
|
+
}
|
|
818
|
+
/**
|
|
819
|
+
* ProgressBar for completion or loading states.
|
|
820
|
+
*
|
|
821
|
+
* @example With labels
|
|
822
|
+
* <ProgressBar value={50} showLabel="both" />
|
|
823
|
+
*
|
|
824
|
+
* @example Bar only
|
|
825
|
+
* <ProgressBar value={75} showLabel="none" />
|
|
826
|
+
*/
|
|
827
|
+
declare const ProgressBar: React.ForwardRefExoticComponent<ProgressBarProps & React.RefAttributes<HTMLDivElement>>;
|
|
828
|
+
|
|
829
|
+
declare const loaderVariants: (props?: ({
|
|
830
|
+
size?: "big" | "medium" | "small" | "extraSmall" | null | undefined;
|
|
831
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
832
|
+
interface LoaderProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children">, VariantProps<typeof loaderVariants> {
|
|
833
|
+
/**
|
|
834
|
+
* Accessible label for screen readers.
|
|
835
|
+
* @default "Loading"
|
|
836
|
+
*/
|
|
837
|
+
"aria-label"?: string;
|
|
838
|
+
/**
|
|
839
|
+
* Gradient color (e.g. #FFFFFF for white on dark backgrounds).
|
|
840
|
+
* @default blue-600 from tokens
|
|
841
|
+
*/
|
|
842
|
+
color?: string;
|
|
843
|
+
/**
|
|
844
|
+
* Transparent end of gradient (e.g. #FFFFFF00). Defaults to `${color}00` when color is set.
|
|
845
|
+
*/
|
|
846
|
+
colorTransparent?: string;
|
|
847
|
+
}
|
|
848
|
+
/**
|
|
849
|
+
* Loader component for loading or processing states.
|
|
850
|
+
*
|
|
851
|
+
* @example
|
|
852
|
+
* <Loader size="big" />
|
|
853
|
+
* <Loader size="small" aria-label="Loading results" />
|
|
854
|
+
*/
|
|
855
|
+
declare const Loader: React.ForwardRefExoticComponent<LoaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
856
|
+
|
|
857
|
+
/**
|
|
858
|
+
* Skeleton Loader
|
|
859
|
+
*
|
|
860
|
+
* Lightweight, token-friendly loading placeholder.
|
|
861
|
+
* Uses tokens from @esds-sangam/tokens:
|
|
862
|
+
* - Base bg: neutral-200 (colors.json)
|
|
863
|
+
* - Border radius: rounded-sm = tokens radius.sm (0.5rem / 8px)
|
|
864
|
+
* - Shimmer: gradient neutral-200 → neutral-100 → neutral-50 → neutral-200
|
|
865
|
+
* - Animation: ease-out, 1s duration, 800ms delay, loops infinitely.
|
|
866
|
+
*
|
|
867
|
+
* By default the component is layout-flexible — width/height
|
|
868
|
+
* are controlled by the parent (via className or style).
|
|
869
|
+
* In stories we showcase 113×17px as per Figma.
|
|
870
|
+
*/
|
|
871
|
+
declare const skeletonVariants: (props?: ({
|
|
872
|
+
variant?: "rectangular" | null | undefined;
|
|
873
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
874
|
+
interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof skeletonVariants> {
|
|
875
|
+
/**
|
|
876
|
+
* Accessible label for screen readers.
|
|
877
|
+
* If omitted, skeleton is aria-hidden.
|
|
878
|
+
*/
|
|
879
|
+
"aria-label"?: string;
|
|
880
|
+
}
|
|
881
|
+
declare const Skeleton: React.ForwardRefExoticComponent<SkeletonProps & React.RefAttributes<HTMLDivElement>>;
|
|
882
|
+
|
|
883
|
+
/**
|
|
884
|
+
* Sangam Tabs Component
|
|
885
|
+
*
|
|
886
|
+
* Types: Container, Underline, Icon only.
|
|
887
|
+
* States: Default, Hover, Selected, Disabled.
|
|
888
|
+
* Typography: 14px, weight 500, line-height 24px.
|
|
889
|
+
* Spec: Container selected box 178×32, shadow 0 2px 6px; Underline selected 2px blue-600; Icon only 24×24 box, radius 4, padding 4, gap 8.
|
|
890
|
+
*/
|
|
891
|
+
declare const tabsListVariants: (props?: ({
|
|
892
|
+
type?: "underline" | "iconOnly" | "container" | null | undefined;
|
|
893
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
894
|
+
declare const tabsTriggerVariants: (props?: ({
|
|
895
|
+
type?: "underline" | "iconOnly" | "container" | null | undefined;
|
|
896
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
897
|
+
interface TabsProps extends React.ComponentPropsWithoutRef<typeof TabsPrimitive.Root> {
|
|
898
|
+
/**
|
|
899
|
+
* Visual type: container (boxed), underline, or icon only.
|
|
900
|
+
*/
|
|
901
|
+
type?: "container" | "underline" | "iconOnly";
|
|
902
|
+
}
|
|
903
|
+
declare const TabsRoot: React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<HTMLDivElement>>;
|
|
904
|
+
declare const TabsList: React.ForwardRefExoticComponent<Omit<Omit<TabsPrimitive.TabsListProps & React.RefAttributes<HTMLDivElement>, "ref">, "type"> & VariantProps<(props?: ({
|
|
905
|
+
type?: "underline" | "iconOnly" | "container" | null | undefined;
|
|
906
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string> & {
|
|
907
|
+
type?: "container" | "underline" | "iconOnly";
|
|
908
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
909
|
+
interface TabsTriggerOption {
|
|
910
|
+
value: string;
|
|
911
|
+
label: string;
|
|
912
|
+
icon?: React.ReactNode;
|
|
913
|
+
disabled?: boolean;
|
|
914
|
+
}
|
|
915
|
+
interface TabsTriggerProps extends Omit<React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>, "children" | "type"> {
|
|
916
|
+
/** Visual tab type (inherited from Tabs if not set). */
|
|
917
|
+
type?: "container" | "underline" | "iconOnly";
|
|
918
|
+
/**
|
|
919
|
+
* For iconOnly type, render this icon (e.g. tickmark). If omitted, tickmark is used.
|
|
920
|
+
*/
|
|
921
|
+
icon?: React.ReactNode;
|
|
922
|
+
children?: React.ReactNode;
|
|
923
|
+
}
|
|
924
|
+
declare const TabsTrigger: React.ForwardRefExoticComponent<TabsTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
925
|
+
declare const TabsContent: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
926
|
+
declare const Tabs: React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<HTMLDivElement>> & {
|
|
927
|
+
List: React.ForwardRefExoticComponent<Omit<Omit<TabsPrimitive.TabsListProps & React.RefAttributes<HTMLDivElement>, "ref">, "type"> & VariantProps<(props?: ({
|
|
928
|
+
type?: "underline" | "iconOnly" | "container" | null | undefined;
|
|
929
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string> & {
|
|
930
|
+
type?: "container" | "underline" | "iconOnly";
|
|
931
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
932
|
+
Trigger: React.ForwardRefExoticComponent<TabsTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
933
|
+
Content: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
934
|
+
};
|
|
935
|
+
|
|
936
|
+
/**
|
|
937
|
+
* Sangam Avatar Component
|
|
938
|
+
*
|
|
939
|
+
* Two variants: Image (photo or placeholder silhouette) and Letter (initials).
|
|
940
|
+
* Sizes: large (32×32), medium (24×24), small (20×20).
|
|
941
|
+
* Letter: bg neutral-200, text neutral-600 (tokens); weight 500.
|
|
942
|
+
* Letter typography: large tokens base (16px)/leading-6; medium/small tokens 3xs (10px).
|
|
943
|
+
* Token-based, circular (rounded-full).
|
|
944
|
+
*/
|
|
945
|
+
declare const avatarVariants: (props?: ({
|
|
946
|
+
size?: "medium" | "small" | "large" | null | undefined;
|
|
947
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
948
|
+
interface AvatarProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, "children">, VariantProps<typeof avatarVariants> {
|
|
949
|
+
/**
|
|
950
|
+
* Variant: "image" (photo or placeholder silhouette) or "letter" (initials).
|
|
951
|
+
* Letter uses bg neutral-200, text neutral-600 (tokens); typography per size (Big: tokens base, Medium/Small: tokens 3xs = 10px).
|
|
952
|
+
*/
|
|
953
|
+
variant?: "image" | "letter";
|
|
954
|
+
/**
|
|
955
|
+
* Image URL for the avatar. When not provided or on error, placeholder is shown (image variant only).
|
|
956
|
+
*/
|
|
957
|
+
src?: string | null;
|
|
958
|
+
/**
|
|
959
|
+
* Alt text for the image.
|
|
960
|
+
*/
|
|
961
|
+
alt?: string;
|
|
962
|
+
/**
|
|
963
|
+
* For letter variant: initials (e.g. "AB"). For image variant: optional fallback when src fails.
|
|
964
|
+
*/
|
|
965
|
+
children?: React.ReactNode;
|
|
966
|
+
}
|
|
967
|
+
declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLSpanElement>>;
|
|
968
|
+
|
|
969
|
+
/**
|
|
970
|
+
* Sangam Badge Component
|
|
971
|
+
*
|
|
972
|
+
* Token-based badges with two sizes (big/small), three shapes (rounded/pill/notification),
|
|
973
|
+
* semantic states (info/success/warning/error/neutral/process/action), and outlined/solid styles.
|
|
974
|
+
* Content variants (Only Label, Icon+Label, Dismissal, Dropdown) are controlled via boolean
|
|
975
|
+
* props for leading icons, dropdown chevron, and close icon.
|
|
976
|
+
* Colors from @esds-sangam/tokens colors.json.
|
|
977
|
+
*
|
|
978
|
+
* Border radius: rounded variant uses 8px (tokens radius.sm = 0.5rem).
|
|
979
|
+
*
|
|
980
|
+
* Sizes:
|
|
981
|
+
* - Big: Rounded/Pill 48×24px; Notification 24×24px (circular)
|
|
982
|
+
* - Small: Rounded/Pill 48×20px; Notification 20×20px (circular)
|
|
983
|
+
*
|
|
984
|
+
* Label typography (both sizes): weight 500, size 12px, line-height 16px.
|
|
985
|
+
* Padding (rounded/pill): Big top=4 bottom=4 left=8 right=8; Small top=2 bottom=2 left=8 right=8.
|
|
986
|
+
*/
|
|
987
|
+
declare const badgeVariants: (props?: ({
|
|
988
|
+
size?: "big" | "small" | null | undefined;
|
|
989
|
+
variant?: "rounded" | "pill" | "notification" | null | undefined;
|
|
990
|
+
state?: "action" | "error" | "success" | "info" | "warning" | "neutral" | "process" | null | undefined;
|
|
991
|
+
appearance?: "solid" | "outlined" | null | undefined;
|
|
992
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
993
|
+
interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof badgeVariants> {
|
|
994
|
+
/**
|
|
995
|
+
* Badge content. Use text for rounded/pill, number for notification.
|
|
996
|
+
* For Icon+Label or Dismissal, compose icon/close as children in the consuming layer.
|
|
997
|
+
*/
|
|
998
|
+
children?: React.ReactNode;
|
|
999
|
+
/**
|
|
1000
|
+
* When true, Badge uses solid styling tokens for the given state.
|
|
1001
|
+
* This takes precedence over the `appearance` prop.
|
|
1002
|
+
* @default false
|
|
1003
|
+
*/
|
|
1004
|
+
isSolid?: boolean;
|
|
1005
|
+
/**
|
|
1006
|
+
* When true, renders a fixed leading status icon chosen by `state`.
|
|
1007
|
+
* @default false
|
|
1008
|
+
*/
|
|
1009
|
+
leadingIcon?: boolean;
|
|
1010
|
+
/**
|
|
1011
|
+
* When true, renders a fixed dropdown chevron icon on the trailing edge.
|
|
1012
|
+
* @default false
|
|
1013
|
+
*/
|
|
1014
|
+
dropdownIcon?: boolean;
|
|
1015
|
+
/**
|
|
1016
|
+
* When true, renders a fixed close icon on the trailing edge.
|
|
1017
|
+
* @default false
|
|
1018
|
+
*/
|
|
1019
|
+
closable?: boolean;
|
|
1020
|
+
/**
|
|
1021
|
+
* Optional callback invoked when the close icon is clicked.
|
|
1022
|
+
*/
|
|
1023
|
+
onClose?: () => void;
|
|
1024
|
+
}
|
|
1025
|
+
/**
|
|
1026
|
+
* Badge component for status and count indicators.
|
|
1027
|
+
* For Icon+Label, Dismissal, or Dropdown variants, compose icons/controls as children
|
|
1028
|
+
* (see Badge stories for recommended patterns).
|
|
1029
|
+
*
|
|
1030
|
+
* @example Only Label
|
|
1031
|
+
* <Badge size="big" variant="rounded" state="info" appearance="outlined">Label</Badge>
|
|
1032
|
+
*/
|
|
1033
|
+
declare const Badge: React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<HTMLSpanElement>>;
|
|
1034
|
+
|
|
1035
|
+
/**
|
|
1036
|
+
* Sangam Chip Component
|
|
1037
|
+
*
|
|
1038
|
+
* Structural variants: 1) Only label, 2) Label + close icon, 3) Tick icon + label + close icon.
|
|
1039
|
+
* Token-based chip: Default, Hover, Selected, Disabled, Focused.
|
|
1040
|
+
* Sizes: Large (75×32, close 16×16), Small (67×24, close 12×12).
|
|
1041
|
+
* Radius 999 (pill). Colors from @esds-sangam/tokens.
|
|
1042
|
+
*
|
|
1043
|
+
* States:
|
|
1044
|
+
* - Default: bg white, text neutral-1100, border neutral-400
|
|
1045
|
+
* - Hover: bg neutral-200, text neutral-1100
|
|
1046
|
+
* - Selected: bg neutral-1100, text white
|
|
1047
|
+
* - Disabled: bg neutral-200, text neutral-500
|
|
1048
|
+
* - Focused: bg white, text neutral-1100, border 2px neutral-700
|
|
1049
|
+
*/
|
|
1050
|
+
declare const chipVariants: (props?: ({
|
|
1051
|
+
size?: "small" | "large" | null | undefined;
|
|
1052
|
+
selected?: boolean | null | undefined;
|
|
1053
|
+
disabled?: boolean | null | undefined;
|
|
1054
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
1055
|
+
interface ChipProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
|
|
1056
|
+
/**
|
|
1057
|
+
* Chip label (e.g. "Chip").
|
|
1058
|
+
*/
|
|
1059
|
+
children?: React.ReactNode;
|
|
1060
|
+
/**
|
|
1061
|
+
* Size: large (75×32, close 16×16) or small (67×24, close 12×12).
|
|
1062
|
+
*/
|
|
1063
|
+
size?: "large" | "small";
|
|
1064
|
+
/**
|
|
1065
|
+
* Selected state: filled black, white text.
|
|
1066
|
+
*/
|
|
1067
|
+
selected?: boolean;
|
|
1068
|
+
/**
|
|
1069
|
+
* Disabled state: muted background and text.
|
|
1070
|
+
*/
|
|
1071
|
+
disabled?: boolean;
|
|
1072
|
+
/**
|
|
1073
|
+
* Callback when close icon is clicked. When provided, close icon is shown (variant: Label + close).
|
|
1074
|
+
*/
|
|
1075
|
+
onDismiss?: () => void;
|
|
1076
|
+
/**
|
|
1077
|
+
* When true, show tick icon before the label. Use with onDismiss for variant: Tick + label + close.
|
|
1078
|
+
*/
|
|
1079
|
+
showLeadingIcon?: boolean;
|
|
1080
|
+
}
|
|
1081
|
+
/**
|
|
1082
|
+
* Chip for tags, filters, or removable items.
|
|
1083
|
+
*
|
|
1084
|
+
* @example Default
|
|
1085
|
+
* <Chip size="large">Chip</Chip>
|
|
1086
|
+
*
|
|
1087
|
+
* @example With dismiss (Label + close)
|
|
1088
|
+
* <Chip size="large" onDismiss={() => {}}>Chip</Chip>
|
|
1089
|
+
*
|
|
1090
|
+
* @example Tick + label + close
|
|
1091
|
+
* <Chip size="large" onDismiss={() => {}} showLeadingIcon>Chip</Chip>
|
|
1092
|
+
*
|
|
1093
|
+
* @example Selected
|
|
1094
|
+
* <Chip size="large" selected>Chip</Chip>
|
|
1095
|
+
*/
|
|
1096
|
+
declare const Chip: React.ForwardRefExoticComponent<ChipProps & React.RefAttributes<HTMLDivElement>>;
|
|
1097
|
+
|
|
1098
|
+
/**
|
|
1099
|
+
* Sangam Toast Component
|
|
1100
|
+
*
|
|
1101
|
+
* Production-grade toast notification following Figma design specs:
|
|
1102
|
+
* - Fixed width: 384px
|
|
1103
|
+
* - Height: 56px (default), 84px (with description or CTA)
|
|
1104
|
+
* - Border radius: 8px
|
|
1105
|
+
* - Left border width: 3px
|
|
1106
|
+
* - Padding: 16px
|
|
1107
|
+
* - Background: white (neutral-50)
|
|
1108
|
+
* - Title: 16px, 500 weight, 24px line-height, neutral-1100 color
|
|
1109
|
+
* - Description: 14px, 400 weight, 24px line-height, neutral-600 color
|
|
1110
|
+
* - Shadow: 0px 4px 10px 0px
|
|
1111
|
+
* - Close icon: 16x16
|
|
1112
|
+
* - Status icon: 20x20
|
|
1113
|
+
* - CTA Button: radius 8px, padding 4px 16px
|
|
1114
|
+
*
|
|
1115
|
+
* Four color variants (token-based):
|
|
1116
|
+
* 1. Info - blue-600 border/icon
|
|
1117
|
+
* 2. Success - green-800 border/icon
|
|
1118
|
+
* 3. Warning - orange-700 border/icon
|
|
1119
|
+
* 4. Error - red-800 border/icon
|
|
1120
|
+
*
|
|
1121
|
+
* Three layout variants:
|
|
1122
|
+
* 1. Default - Title only (56px height)
|
|
1123
|
+
* 2. With Description - Title + description + close (84px height)
|
|
1124
|
+
* 3. With CTA - Title + button (84px height, no description)
|
|
1125
|
+
*
|
|
1126
|
+
* @example Basic usage
|
|
1127
|
+
* <Toast variant="info" title="Info message" />
|
|
1128
|
+
*
|
|
1129
|
+
* @example With description
|
|
1130
|
+
* <Toast variant="success" title="Success!" description="Your changes have been saved" />
|
|
1131
|
+
*
|
|
1132
|
+
* @example With CTA button
|
|
1133
|
+
* <Toast variant="info" title="New update" ctaText="Update" onCtaClick={() => {}} />
|
|
1134
|
+
*/
|
|
1135
|
+
declare const toastVariants: (props?: ({
|
|
1136
|
+
variant?: "error" | "success" | "info" | "warning" | null | undefined;
|
|
1137
|
+
layout?: "default" | "withDescription" | null | undefined;
|
|
1138
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
1139
|
+
interface ToastProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title">, VariantProps<typeof toastVariants> {
|
|
1140
|
+
/**
|
|
1141
|
+
* Toast variant type
|
|
1142
|
+
* @default "info"
|
|
1143
|
+
*/
|
|
1144
|
+
variant?: "info" | "success" | "warning" | "error";
|
|
1145
|
+
/**
|
|
1146
|
+
* Title text (required)
|
|
1147
|
+
*/
|
|
1148
|
+
title: string;
|
|
1149
|
+
/**
|
|
1150
|
+
* Description text (optional)
|
|
1151
|
+
* When provided, toast height becomes 84px
|
|
1152
|
+
*/
|
|
1153
|
+
description?: string;
|
|
1154
|
+
/**
|
|
1155
|
+
* Whether to show close button
|
|
1156
|
+
* @default true (false when CTA is provided)
|
|
1157
|
+
*/
|
|
1158
|
+
showClose?: boolean;
|
|
1159
|
+
/**
|
|
1160
|
+
* Callback when close button is clicked
|
|
1161
|
+
*/
|
|
1162
|
+
onClose?: () => void;
|
|
1163
|
+
/**
|
|
1164
|
+
* CTA button text (optional)
|
|
1165
|
+
* When provided, replaces close button and height becomes 84px
|
|
1166
|
+
*/
|
|
1167
|
+
ctaText?: string;
|
|
1168
|
+
/**
|
|
1169
|
+
* Callback when CTA button is clicked
|
|
1170
|
+
*/
|
|
1171
|
+
onCtaClick?: () => void;
|
|
1172
|
+
}
|
|
1173
|
+
/**
|
|
1174
|
+
* Toast component with icon, title, optional description, and close/CTA
|
|
1175
|
+
*
|
|
1176
|
+
* Displays status-based notification with appropriate icon and border color
|
|
1177
|
+
* Supports three layouts: default (56px), with description (84px), with CTA (84px)
|
|
1178
|
+
*/
|
|
1179
|
+
declare const Toast: React.ForwardRefExoticComponent<ToastProps & React.RefAttributes<HTMLDivElement>>;
|
|
1180
|
+
|
|
1181
|
+
/**
|
|
1182
|
+
* PageHeader Pattern
|
|
1183
|
+
*
|
|
1184
|
+
* Composes primitives (Tabs) for page top layout.
|
|
1185
|
+
* Variants: With Title, With Tabs, Title+Tabs.
|
|
1186
|
+
*
|
|
1187
|
+
* From the Figma Page Header component:
|
|
1188
|
+
* - Title: 20px, weight 600, line-height 28px, color neutral-1100
|
|
1189
|
+
* - Optional back icon (ArrowLeft) before the title
|
|
1190
|
+
* - Optional badge after the title (Planning / status label)
|
|
1191
|
+
* - Optional subtext line below the title
|
|
1192
|
+
* - Optional up to three CTA buttons on the right
|
|
1193
|
+
* - Optional close icon button on the right
|
|
1194
|
+
* - Tabs: underline style, 14px/500/24px, active blue-600, border neutral-200
|
|
1195
|
+
*/
|
|
1196
|
+
interface PageHeaderTab {
|
|
1197
|
+
value: string;
|
|
1198
|
+
label: string;
|
|
1199
|
+
}
|
|
1200
|
+
type PageHeaderAction = {
|
|
1201
|
+
/**
|
|
1202
|
+
* Visible label for the CTA button.
|
|
1203
|
+
*/
|
|
1204
|
+
label: string;
|
|
1205
|
+
/**
|
|
1206
|
+
* Click handler for the CTA button.
|
|
1207
|
+
*/
|
|
1208
|
+
onClick?: () => void;
|
|
1209
|
+
/**
|
|
1210
|
+
* Visual style of the CTA. Defaults to primary.
|
|
1211
|
+
*/
|
|
1212
|
+
variant?: "primary" | "secondary";
|
|
1213
|
+
/**
|
|
1214
|
+
* Optional icon to render alongside the label.
|
|
1215
|
+
*/
|
|
1216
|
+
icon?: React.ReactNode;
|
|
1217
|
+
/**
|
|
1218
|
+
* Position of the icon relative to the label.
|
|
1219
|
+
* Defaults to leading.
|
|
1220
|
+
*/
|
|
1221
|
+
iconPosition?: "leading" | "trailing";
|
|
1222
|
+
};
|
|
1223
|
+
declare const pageHeaderVariants: (props?: ({
|
|
1224
|
+
variant?: "withTitle" | "withTabs" | "titleTabs" | null | undefined;
|
|
1225
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
1226
|
+
interface PageHeaderProps extends Omit<React.HTMLAttributes<HTMLElement>, "title">, VariantProps<typeof pageHeaderVariants> {
|
|
1227
|
+
/**
|
|
1228
|
+
* Page title. Required for withTitle and titleTabs variants.
|
|
1229
|
+
*/
|
|
1230
|
+
title?: string;
|
|
1231
|
+
/**
|
|
1232
|
+
* Tab items for withTabs and titleTabs. Each has value and label.
|
|
1233
|
+
*/
|
|
1234
|
+
tabs?: PageHeaderTab[];
|
|
1235
|
+
/**
|
|
1236
|
+
* Default/initial selected tab value (uncontrolled).
|
|
1237
|
+
*/
|
|
1238
|
+
defaultTab?: string;
|
|
1239
|
+
/**
|
|
1240
|
+
* Controlled selected tab value.
|
|
1241
|
+
*/
|
|
1242
|
+
tab?: string;
|
|
1243
|
+
/**
|
|
1244
|
+
* Callback when tab selection changes.
|
|
1245
|
+
*/
|
|
1246
|
+
onTabChange?: (value: string) => void;
|
|
1247
|
+
/**
|
|
1248
|
+
* Optional class name for the title element.
|
|
1249
|
+
*/
|
|
1250
|
+
titleClassName?: string;
|
|
1251
|
+
/**
|
|
1252
|
+
* Optional class name for the tabs wrapper.
|
|
1253
|
+
*/
|
|
1254
|
+
tabsClassName?: string;
|
|
1255
|
+
/**
|
|
1256
|
+
* When true, shows a back icon button before the title.
|
|
1257
|
+
*/
|
|
1258
|
+
backIcon?: boolean;
|
|
1259
|
+
/**
|
|
1260
|
+
* Callback when the back icon is clicked.
|
|
1261
|
+
*/
|
|
1262
|
+
onBackClick?: () => void;
|
|
1263
|
+
/**
|
|
1264
|
+
* When true, hides the title even if provided.
|
|
1265
|
+
* Defaults to true (title shown).
|
|
1266
|
+
*/
|
|
1267
|
+
showTitle?: boolean;
|
|
1268
|
+
/**
|
|
1269
|
+
* Optional badge label rendered after the title.
|
|
1270
|
+
* When provided, a neutral/info badge is shown.
|
|
1271
|
+
*/
|
|
1272
|
+
badgeLabel?: string;
|
|
1273
|
+
/**
|
|
1274
|
+
* When true, shows a second line of descriptive text below the title.
|
|
1275
|
+
*/
|
|
1276
|
+
showSubtext?: boolean;
|
|
1277
|
+
/**
|
|
1278
|
+
* Subtext content shown below the title when showSubtext is true.
|
|
1279
|
+
*/
|
|
1280
|
+
subtext?: string;
|
|
1281
|
+
/**
|
|
1282
|
+
* Primary CTA button (right side).
|
|
1283
|
+
*/
|
|
1284
|
+
primaryAction?: PageHeaderAction;
|
|
1285
|
+
/**
|
|
1286
|
+
* Secondary CTA button (right side, before primary).
|
|
1287
|
+
*/
|
|
1288
|
+
secondaryAction?: PageHeaderAction;
|
|
1289
|
+
/**
|
|
1290
|
+
* Optional third CTA button (rightmost or leftmost depending on usage).
|
|
1291
|
+
*/
|
|
1292
|
+
tertiaryAction?: PageHeaderAction;
|
|
1293
|
+
/**
|
|
1294
|
+
* When true, shows a close icon button on the right.
|
|
1295
|
+
*/
|
|
1296
|
+
closeIcon?: boolean;
|
|
1297
|
+
/**
|
|
1298
|
+
* Callback when the close icon is clicked.
|
|
1299
|
+
*/
|
|
1300
|
+
onCloseClick?: () => void;
|
|
1301
|
+
}
|
|
1302
|
+
declare const PageHeader: React.ForwardRefExoticComponent<PageHeaderProps & React.RefAttributes<HTMLElement>>;
|
|
1303
|
+
|
|
1304
|
+
interface PageFooterProps extends React.HTMLAttributes<HTMLElement> {
|
|
1305
|
+
/**
|
|
1306
|
+
* Action buttons or content. Defaults to primary small "Convert" button when omitted.
|
|
1307
|
+
*/
|
|
1308
|
+
children?: React.ReactNode;
|
|
1309
|
+
/**
|
|
1310
|
+
* Footer width in pixels.
|
|
1311
|
+
* @default 532
|
|
1312
|
+
*/
|
|
1313
|
+
width?: number;
|
|
1314
|
+
/**
|
|
1315
|
+
* Optional class name for the inner content wrapper (flex container).
|
|
1316
|
+
*/
|
|
1317
|
+
contentClassName?: string;
|
|
1318
|
+
}
|
|
1319
|
+
declare const PageFooter: React.ForwardRefExoticComponent<PageFooterProps & React.RefAttributes<HTMLElement>>;
|
|
1320
|
+
|
|
1321
|
+
/**
|
|
1322
|
+
* SideMenu Pattern
|
|
1323
|
+
*
|
|
1324
|
+
* Collapsible side navigation. Default state shows icons only; hovering expands
|
|
1325
|
+
* to show labels (hover state). Selected items show a box highlight.
|
|
1326
|
+
*
|
|
1327
|
+
* - Default: collapsed 48×1024px, sticky left; hover expands to the right only.
|
|
1328
|
+
* - Hover/Selected: expanded 132×1024px, white bg, shadow-elevation-right-sm. Logo and items left-aligned.
|
|
1329
|
+
* - Selected item: 36×36 (collapsed) or 120×36 (expanded) box, radius 8px (rounded-sm), shadow-elevation-bottom-sm.
|
|
1330
|
+
*
|
|
1331
|
+
* Logo 36×28. Text: 12px, weight 500, line-height 16px.
|
|
1332
|
+
*/
|
|
1333
|
+
interface SideMenuItem {
|
|
1334
|
+
id: string;
|
|
1335
|
+
label: string;
|
|
1336
|
+
/** Icon for collapsed state (and expanded when iconExpanded not provided) */
|
|
1337
|
+
icon: React.ReactNode;
|
|
1338
|
+
/** Icon for expanded state. Use when icon needs different styling on white bg (e.g. Profile/avtarimg). */
|
|
1339
|
+
iconExpanded?: React.ReactNode;
|
|
1340
|
+
}
|
|
1341
|
+
interface SideMenuProps extends Omit<React.HTMLAttributes<HTMLElement>, "children">, VariantProps<typeof sideMenuVariants> {
|
|
1342
|
+
/** Logo element (e.g. img 36×28) */
|
|
1343
|
+
logo: React.ReactNode;
|
|
1344
|
+
/** Top nav items: Dashboard, Orders, Projects */
|
|
1345
|
+
topItems: SideMenuItem[];
|
|
1346
|
+
/** Bottom nav items: Search, Settings, Profile */
|
|
1347
|
+
bottomItems: SideMenuItem[];
|
|
1348
|
+
/** ID of currently selected item (controlled). Omit for uncontrolled; use defaultSelectedId for initial. */
|
|
1349
|
+
selectedId?: string;
|
|
1350
|
+
/** Initial selected ID when uncontrolled. Ignored if selectedId is provided. */
|
|
1351
|
+
defaultSelectedId?: string;
|
|
1352
|
+
/** Controlled expanded state. When undefined and variant is default, expands on hover. */
|
|
1353
|
+
expanded?: boolean;
|
|
1354
|
+
/** Callback when an item is clicked */
|
|
1355
|
+
onItemClick?: (id: string) => void;
|
|
1356
|
+
}
|
|
1357
|
+
declare const sideMenuVariants: (props?: ({
|
|
1358
|
+
variant?: "default" | "selected" | "hover" | null | undefined;
|
|
1359
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
1360
|
+
declare const SideMenu: React.ForwardRefExoticComponent<SideMenuProps & React.RefAttributes<HTMLElement>>;
|
|
1361
|
+
|
|
1362
|
+
/**
|
|
1363
|
+
* Upload Pattern – Stage 1: File uploader
|
|
1364
|
+
*
|
|
1365
|
+
* Token-based, accessible file uploader pattern with:
|
|
1366
|
+
* - Label (12px, weight 500, line-height 16)
|
|
1367
|
+
* - Dashed dropzone with hover state
|
|
1368
|
+
* - Cloud upload icon, primary/secondary text, and helper text
|
|
1369
|
+
*
|
|
1370
|
+
* Drag & drop support is basic; consumers should wire onFilesSelected for uploads.
|
|
1371
|
+
*/
|
|
1372
|
+
declare const uploadBoxVariants: (props?: class_variance_authority_dist_types.ClassProp | undefined) => string;
|
|
1373
|
+
interface UploadProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
|
|
1374
|
+
/** Field label shown above the uploader (12/500/16). */
|
|
1375
|
+
label: string;
|
|
1376
|
+
/** Whether to show the red asterisk after the label. */
|
|
1377
|
+
required?: boolean;
|
|
1378
|
+
/** Accept string for underlying file input, e.g. \"image/*,.pdf\". */
|
|
1379
|
+
accept?: string;
|
|
1380
|
+
/** Allow selecting multiple files. */
|
|
1381
|
+
multiple?: boolean;
|
|
1382
|
+
/** Callback when user selects or drops files. */
|
|
1383
|
+
onFilesSelected?: (files: File[]) => void;
|
|
1384
|
+
/** Helper text under the primary line (defaults to PNG/JPG/PDF/EXCEL). */
|
|
1385
|
+
helperText?: string;
|
|
1386
|
+
}
|
|
1387
|
+
declare const Upload: React.ForwardRefExoticComponent<UploadProps & React.RefAttributes<HTMLDivElement>>;
|
|
1388
|
+
declare const uploadFileItemBoxVariants: (props?: ({
|
|
1389
|
+
status?: "uploading" | "complete" | "failed" | null | undefined;
|
|
1390
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
1391
|
+
type UploadFileItemStatus = "uploading" | "complete" | "failed";
|
|
1392
|
+
interface UploadFileItemProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children">, VariantProps<typeof uploadFileItemBoxVariants> {
|
|
1393
|
+
/** File name (e.g. "File name.pdf"). 14px, weight 500, line-height 24, neutral-1100. */
|
|
1394
|
+
fileName: string;
|
|
1395
|
+
/** File size or status line (e.g. "5.5MB"). 12px, weight 400, line-height 16, neutral-600. When failed, show "Upload failed" in red-800. */
|
|
1396
|
+
fileSize?: string;
|
|
1397
|
+
/** Current progress 0–100 (for uploading/complete). Hidden when status is "failed". */
|
|
1398
|
+
progress?: number;
|
|
1399
|
+
/** Callback when user cancels (close icon during uploading). */
|
|
1400
|
+
onCancel?: () => void;
|
|
1401
|
+
/** Callback when user retries (failed state). */
|
|
1402
|
+
onRetry?: () => void;
|
|
1403
|
+
/** Callback when user deletes (complete or failed). */
|
|
1404
|
+
onDelete?: () => void;
|
|
1405
|
+
}
|
|
1406
|
+
/**
|
|
1407
|
+
* UploadFileItem – single file row in the upload pattern.
|
|
1408
|
+
* Box: 536×100 (min), border neutral-300 (red-800 when failed), radius 12px (tokens rounded-md), padding 16, gap 8.
|
|
1409
|
+
* Left: DocumentPdf 24×24, fileName (14/500/24 neutral-1100), fileSize or "Upload failed" (12/400/16).
|
|
1410
|
+
* Right: uploading = Close + %; complete = tickmarkFilled + Delete + 100%; failed = Retry + Delete.
|
|
1411
|
+
* Progress bar below when not failed (ProgressBar primitive, 10% / 50% / 100%).
|
|
1412
|
+
*/
|
|
1413
|
+
declare const UploadFileItem: React.ForwardRefExoticComponent<UploadFileItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
1414
|
+
|
|
1415
|
+
/**
|
|
1416
|
+
* Types Layer
|
|
1417
|
+
*
|
|
1418
|
+
* Shared TypeScript types and interfaces for:
|
|
1419
|
+
* - Component props
|
|
1420
|
+
* - Variant definitions
|
|
1421
|
+
* - Public contracts
|
|
1422
|
+
*
|
|
1423
|
+
* This prevents breaking changes and ensures consistency
|
|
1424
|
+
*/
|
|
1425
|
+
|
|
1426
|
+
interface BaseComponentProps {
|
|
1427
|
+
children?: ReactNode;
|
|
1428
|
+
className?: string;
|
|
1429
|
+
}
|
|
1430
|
+
type Size = "sm" | "md" | "lg";
|
|
1431
|
+
type Variant = "primary" | "secondary" | "outline" | "ghost";
|
|
1432
|
+
type ColorScheme = "primary" | "secondary" | "success" | "error" | "warning" | "info";
|
|
1433
|
+
|
|
1434
|
+
export { Avatar, Badge, type BaseComponentProps, Button, Checkbox, Chip, type ColorScheme, Dropdown, DropdownMulti, type DropdownMultiProps, type DropdownOption, type DropdownProps, Input, Label, Loader, PageFooter, type PageFooterProps, PageHeader, type PageHeaderAction, type PageHeaderProps, type PageHeaderTab, ProgressBar, Radio, RadioGroup, SearchField, SideMenu, type SideMenuItem, type SideMenuProps, type Size, Skeleton, Tabs, TabsContent, TabsList, TabsRoot, TabsTrigger, type TabsTriggerOption, type TabsTriggerProps, Textarea, Toast, Toggle, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Upload, UploadFileItem, type UploadFileItemProps, type UploadFileItemStatus, type UploadProps, type Variant, avatarVariants, badgeVariants, buttonVariants, checkboxRootVariants as checkboxVariants, chipVariants, dropdownContentVariants, dropdownItemVariants, dropdownTriggerVariants, inputVariants, loaderVariants, pageHeaderVariants, radioVariants, searchFieldVariants, sideMenuVariants, skeletonVariants, tabsListVariants, tabsTriggerVariants, textareaVariants, toastVariants, toggleVariants, tooltipContentVariants, uploadBoxVariants, uploadFileItemBoxVariants };
|