@stoovles/gap-kit 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +637 -0
- package/package.json +3 -2
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,637 @@
|
|
|
1
|
+
import { default as default_2 } from 'react';
|
|
2
|
+
import { JSX } from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
export declare function Accordion({ children, className }: AccordionProps): JSX.Element;
|
|
5
|
+
|
|
6
|
+
export declare function AccordionItem({ title, count, subtitle, attributes, defaultExpanded, children, className, }: AccordionItemProps): JSX.Element;
|
|
7
|
+
|
|
8
|
+
export declare interface AccordionItemProps {
|
|
9
|
+
title: string;
|
|
10
|
+
count?: string | number;
|
|
11
|
+
subtitle?: string;
|
|
12
|
+
/** Text shown in expanded header instead of subtitle (e.g. selected filter values) */
|
|
13
|
+
attributes?: string;
|
|
14
|
+
defaultExpanded?: boolean;
|
|
15
|
+
children?: default_2.ReactNode;
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export declare interface AccordionProps {
|
|
20
|
+
children: default_2.ReactNode;
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export declare interface ActiveFilter {
|
|
25
|
+
label: string;
|
|
26
|
+
value: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export declare function BopisSwitch({ checked, onChange, storeName, storeHref, description, className, }: BopisSwitchProps): JSX.Element;
|
|
30
|
+
|
|
31
|
+
export declare interface BopisSwitchProps {
|
|
32
|
+
checked?: boolean;
|
|
33
|
+
onChange?: (checked: boolean) => void;
|
|
34
|
+
storeName?: string;
|
|
35
|
+
storeHref?: string;
|
|
36
|
+
description?: string;
|
|
37
|
+
className?: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export declare interface BrandLink {
|
|
41
|
+
label: string;
|
|
42
|
+
href: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export declare function Breadcrumb({ items, className }: BreadcrumbProps): JSX.Element | null;
|
|
46
|
+
|
|
47
|
+
export declare interface BreadcrumbItem {
|
|
48
|
+
label: string;
|
|
49
|
+
href: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export declare interface BreadcrumbProps {
|
|
53
|
+
items: BreadcrumbItem[];
|
|
54
|
+
className?: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export declare function Button({ variant, loading, fullWidth, disabled, children, className, ...rest }: ButtonProps): JSX.Element;
|
|
58
|
+
|
|
59
|
+
export declare interface ButtonProps extends default_2.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
60
|
+
variant?: ButtonVariant;
|
|
61
|
+
loading?: boolean;
|
|
62
|
+
fullWidth?: boolean;
|
|
63
|
+
children: default_2.ReactNode;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export declare type ButtonVariant = "critical" | "primary" | "secondary";
|
|
67
|
+
|
|
68
|
+
export declare function Checkbox({ label, error, disabled, className, id: idProp, ...rest }: CheckboxProps): JSX.Element;
|
|
69
|
+
|
|
70
|
+
export declare function CheckboxGroup({ children, label, error, className, }: CheckboxGroupProps): JSX.Element;
|
|
71
|
+
|
|
72
|
+
export declare interface CheckboxGroupProps {
|
|
73
|
+
children: default_2.ReactNode;
|
|
74
|
+
label?: string;
|
|
75
|
+
error?: boolean;
|
|
76
|
+
className?: string;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export declare interface CheckboxProps extends Omit<default_2.InputHTMLAttributes<HTMLInputElement>, "type"> {
|
|
80
|
+
label?: default_2.ReactNode;
|
|
81
|
+
error?: boolean;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export declare function Chip({ label, onDismiss, swatch, className }: ChipProps): JSX.Element;
|
|
85
|
+
|
|
86
|
+
export declare function ChipGroup({ children, onClearAll, clearAllLabel, className, }: ChipGroupProps): JSX.Element;
|
|
87
|
+
|
|
88
|
+
export declare interface ChipGroupProps {
|
|
89
|
+
children: default_2.ReactNode;
|
|
90
|
+
onClearAll?: () => void;
|
|
91
|
+
clearAllLabel?: string;
|
|
92
|
+
className?: string;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export declare interface ChipProps {
|
|
96
|
+
label: string;
|
|
97
|
+
onDismiss?: () => void;
|
|
98
|
+
swatch?: string;
|
|
99
|
+
className?: string;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export declare function Divider({ variant, className }: DividerProps): JSX.Element;
|
|
103
|
+
|
|
104
|
+
export declare interface DividerProps {
|
|
105
|
+
variant?: "default" | "subtle";
|
|
106
|
+
className?: string;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export declare function Dropdown({ label, options, value, defaultValue, onChange, error, disabled, className, id: idProp, }: DropdownProps): JSX.Element;
|
|
110
|
+
|
|
111
|
+
export declare interface DropdownOption {
|
|
112
|
+
label: string;
|
|
113
|
+
value: string;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export declare interface DropdownProps {
|
|
117
|
+
label: string;
|
|
118
|
+
options: DropdownOption[];
|
|
119
|
+
value?: string;
|
|
120
|
+
defaultValue?: string;
|
|
121
|
+
onChange?: (value: string) => void;
|
|
122
|
+
error?: boolean;
|
|
123
|
+
disabled?: boolean;
|
|
124
|
+
className?: string;
|
|
125
|
+
id?: string;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export declare interface FilterChip {
|
|
129
|
+
label: string;
|
|
130
|
+
value: string;
|
|
131
|
+
/** If true, chip has a dropdown chevron */
|
|
132
|
+
hasDropdown?: boolean;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export declare function FilterControls({ chips, activeChip, onChipClick, activeFilters, onRemoveFilter, onClearAll, resultCount, className, }: FilterControlsProps): JSX.Element;
|
|
136
|
+
|
|
137
|
+
export declare interface FilterControlsProps {
|
|
138
|
+
/** Available filter chips (e.g. Category, Size, Color) */
|
|
139
|
+
chips?: FilterChip[];
|
|
140
|
+
/** Currently active chip value */
|
|
141
|
+
activeChip?: string;
|
|
142
|
+
/** Called when a chip is clicked */
|
|
143
|
+
onChipClick?: (value: string) => void;
|
|
144
|
+
/** Active filter tags */
|
|
145
|
+
activeFilters?: ActiveFilter[];
|
|
146
|
+
/** Called when an active filter's X is clicked */
|
|
147
|
+
onRemoveFilter?: (value: string) => void;
|
|
148
|
+
/** Called when "Clear all" is clicked */
|
|
149
|
+
onClearAll?: () => void;
|
|
150
|
+
/** Result count text, e.g. "128 Results" */
|
|
151
|
+
resultCount?: string;
|
|
152
|
+
className?: string;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export declare function FilterDrawer({ open, title, onClose, sections, applyLabel, onApply, className, }: FilterDrawerProps): JSX.Element | null;
|
|
156
|
+
|
|
157
|
+
export declare interface FilterDrawerProps {
|
|
158
|
+
/** Whether the drawer is open */
|
|
159
|
+
open: boolean;
|
|
160
|
+
/** Drawer header title */
|
|
161
|
+
title?: string;
|
|
162
|
+
/** Called when the drawer should close */
|
|
163
|
+
onClose: () => void;
|
|
164
|
+
/** Filter sections displayed as accordion rows */
|
|
165
|
+
sections?: FilterSection[];
|
|
166
|
+
/** Label for the apply button */
|
|
167
|
+
applyLabel?: string;
|
|
168
|
+
/** Called when the apply button is clicked */
|
|
169
|
+
onApply?: () => void;
|
|
170
|
+
className?: string;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export declare interface FilterSection {
|
|
174
|
+
title: string;
|
|
175
|
+
count?: number;
|
|
176
|
+
subtitle?: string;
|
|
177
|
+
children?: default_2.ReactNode;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export declare interface FooterBlock {
|
|
181
|
+
title: string;
|
|
182
|
+
content: default_2.ReactNode;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export declare interface FooterNavColumn {
|
|
186
|
+
title: string;
|
|
187
|
+
links: {
|
|
188
|
+
label: string;
|
|
189
|
+
href: string;
|
|
190
|
+
}[];
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export declare function Fulfillment({ children, className }: FulfillmentProps): JSX.Element;
|
|
194
|
+
|
|
195
|
+
export declare interface FulfillmentProps {
|
|
196
|
+
children: default_2.ReactNode;
|
|
197
|
+
className?: string;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export declare function FulfillmentTile({ title, selected, availability, children, onClick, className, }: FulfillmentTileProps): JSX.Element;
|
|
201
|
+
|
|
202
|
+
export declare interface FulfillmentTileProps {
|
|
203
|
+
/** Tile heading text */
|
|
204
|
+
title: string;
|
|
205
|
+
/** Whether this tile is selected */
|
|
206
|
+
selected?: boolean;
|
|
207
|
+
/** Availability text, e.g. "In Stock" */
|
|
208
|
+
availability?: string;
|
|
209
|
+
children?: default_2.ReactNode;
|
|
210
|
+
onClick?: () => void;
|
|
211
|
+
className?: string;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export declare function GapLogo({ color, height, className, "aria-label": ariaLabel, }: GapLogoProps): JSX.Element;
|
|
215
|
+
|
|
216
|
+
export declare interface GapLogoProps {
|
|
217
|
+
color?: "dark" | "light";
|
|
218
|
+
height?: number;
|
|
219
|
+
className?: string;
|
|
220
|
+
"aria-label"?: string;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export declare function GlobalFooter({ blocks, navColumns, socialLinks, legalLines, className, }: GlobalFooterProps): JSX.Element;
|
|
224
|
+
|
|
225
|
+
export declare interface GlobalFooterProps {
|
|
226
|
+
/** Top promotional blocks (email signup, credit card, app) */
|
|
227
|
+
blocks?: FooterBlock[];
|
|
228
|
+
/** Navigation columns (Customer Support, Rewards, About, Find Us) */
|
|
229
|
+
navColumns?: FooterNavColumn[];
|
|
230
|
+
/** Social media icons shown below the last nav column */
|
|
231
|
+
socialLinks?: SocialLink[];
|
|
232
|
+
/** Legal text lines rendered at the bottom */
|
|
233
|
+
legalLines?: (string | default_2.ReactNode)[];
|
|
234
|
+
className?: string;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export declare function GlobalHeader({ brands, promoText, promoLinks, bagCount, onBagClick, onAccountClick, onLogoClick, className, }: GlobalHeaderProps): JSX.Element;
|
|
238
|
+
|
|
239
|
+
export declare interface GlobalHeaderProps {
|
|
240
|
+
/** Sister brand links (e.g. Gap, Old Navy, etc.) */
|
|
241
|
+
brands?: BrandLink[];
|
|
242
|
+
/** Promotional banner text */
|
|
243
|
+
promoText?: string;
|
|
244
|
+
/** Links shown after the promo text */
|
|
245
|
+
promoLinks?: {
|
|
246
|
+
label: string;
|
|
247
|
+
href: string;
|
|
248
|
+
}[];
|
|
249
|
+
/** Number of items in the shopping bag */
|
|
250
|
+
bagCount?: number;
|
|
251
|
+
/** Callback when bag icon is clicked */
|
|
252
|
+
onBagClick?: () => void;
|
|
253
|
+
/** Callback when account icon is clicked */
|
|
254
|
+
onAccountClick?: () => void;
|
|
255
|
+
/** Callback when the logo is clicked */
|
|
256
|
+
onLogoClick?: () => void;
|
|
257
|
+
className?: string;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
export declare function HamburgerNav({ open, onClose, sections, headerSlot, searchPlaceholder, onSearch, className, }: HamburgerNavProps): JSX.Element | null;
|
|
261
|
+
|
|
262
|
+
export declare interface HamburgerNavItem {
|
|
263
|
+
label: string;
|
|
264
|
+
href?: string;
|
|
265
|
+
/** Whether to show a right chevron indicating sub-navigation */
|
|
266
|
+
hasChildren?: boolean;
|
|
267
|
+
onClick?: () => void;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
export declare interface HamburgerNavProps {
|
|
271
|
+
/** Whether the drawer is open */
|
|
272
|
+
open: boolean;
|
|
273
|
+
/** Called when the drawer should close */
|
|
274
|
+
onClose: () => void;
|
|
275
|
+
/** Primary navigation sections */
|
|
276
|
+
sections: HamburgerNavSection[];
|
|
277
|
+
/** Content rendered above the primary nav (e.g. promo banners) */
|
|
278
|
+
headerSlot?: default_2.ReactNode;
|
|
279
|
+
/** Search placeholder text */
|
|
280
|
+
searchPlaceholder?: string;
|
|
281
|
+
/** Called when a search is submitted */
|
|
282
|
+
onSearch?: (value: string) => void;
|
|
283
|
+
className?: string;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
export declare interface HamburgerNavSection {
|
|
287
|
+
items: HamburgerNavItem[];
|
|
288
|
+
/** If true, section renders on a subtle gray background */
|
|
289
|
+
secondary?: boolean;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
export declare function Handle({ size, className }: HandleProps): JSX.Element;
|
|
293
|
+
|
|
294
|
+
export declare interface HandleProps {
|
|
295
|
+
size?: HandleSize;
|
|
296
|
+
className?: string;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
export declare type HandleSize = "large" | "small";
|
|
300
|
+
|
|
301
|
+
export declare function Icon({ name, size, color, className, "aria-label": ariaLabel, }: IconProps): JSX.Element;
|
|
302
|
+
|
|
303
|
+
export declare type IconName = "alert-circle" | "bag" | "checkmark-filled" | "checkmark-outlined" | "chevron-left" | "chevron-right" | "chevron-down" | "chevron-up" | "email-outlined" | "filter" | "fire" | "info" | "info-circle" | "loader" | "location-filled" | "location-outlined" | "menu" | "pause" | "phone" | "play" | "profile" | "quickadd" | "search" | "show" | "star-empty" | "star-filled" | "star-half" | "swatch" | "volume-off" | "volume-on" | "x";
|
|
304
|
+
|
|
305
|
+
export declare interface IconProps {
|
|
306
|
+
name: IconName;
|
|
307
|
+
size?: IconSize;
|
|
308
|
+
color?: "dark" | "light";
|
|
309
|
+
className?: string;
|
|
310
|
+
"aria-label"?: string;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
export declare type IconSize = 12 | 16 | 24 | 32;
|
|
314
|
+
|
|
315
|
+
export declare function Link({ variant, children, className, ...rest }: LinkProps): JSX.Element;
|
|
316
|
+
|
|
317
|
+
export declare interface LinkProps extends default_2.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
318
|
+
variant?: "inline" | "subtle";
|
|
319
|
+
children: default_2.ReactNode;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
export declare function MegaNav({ logo, onLogoClick, departments, utilityLinks, searchSlot, className, }: MegaNavProps): JSX.Element;
|
|
323
|
+
|
|
324
|
+
export declare interface MegaNavCategory {
|
|
325
|
+
title: string;
|
|
326
|
+
links: {
|
|
327
|
+
label: string;
|
|
328
|
+
href: string;
|
|
329
|
+
}[];
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
export declare interface MegaNavDepartment {
|
|
333
|
+
label: string;
|
|
334
|
+
href?: string;
|
|
335
|
+
/** If true, label renders in sale/red color */
|
|
336
|
+
sale?: boolean;
|
|
337
|
+
/** Category columns shown in the dropdown when hovered */
|
|
338
|
+
categories?: MegaNavCategory[];
|
|
339
|
+
/** Marketing images shown alongside the categories */
|
|
340
|
+
marketingImages?: MegaNavMarketingImage[];
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
export declare interface MegaNavMarketingImage {
|
|
344
|
+
imageUrl: string;
|
|
345
|
+
alt?: string;
|
|
346
|
+
label: string;
|
|
347
|
+
href: string;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
export declare interface MegaNavProps {
|
|
351
|
+
/** Logo node (can be GapLogo or any ReactNode) */
|
|
352
|
+
logo?: default_2.ReactNode;
|
|
353
|
+
/** Callback when logo is clicked */
|
|
354
|
+
onLogoClick?: () => void;
|
|
355
|
+
/** Department links */
|
|
356
|
+
departments: MegaNavDepartment[];
|
|
357
|
+
/** Utility links (top-right: Find a Store, Rewards, etc.) */
|
|
358
|
+
utilityLinks?: {
|
|
359
|
+
label: string;
|
|
360
|
+
href: string;
|
|
361
|
+
}[];
|
|
362
|
+
/** Slot for the search input on the far right */
|
|
363
|
+
searchSlot?: default_2.ReactNode;
|
|
364
|
+
className?: string;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
declare function Notification_2({ type, variant, children, showIcon, onDismiss, className, }: NotificationProps): JSX.Element;
|
|
368
|
+
export { Notification_2 as Notification }
|
|
369
|
+
|
|
370
|
+
export declare interface NotificationProps {
|
|
371
|
+
type?: NotificationType;
|
|
372
|
+
variant?: NotificationVariant;
|
|
373
|
+
children: default_2.ReactNode;
|
|
374
|
+
showIcon?: boolean;
|
|
375
|
+
onDismiss?: () => void;
|
|
376
|
+
className?: string;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
export declare type NotificationType = "info" | "warning" | "success" | "error";
|
|
380
|
+
|
|
381
|
+
export declare type NotificationVariant = "banner" | "inline" | "bare";
|
|
382
|
+
|
|
383
|
+
export declare function Pagination({ shown, total, moreCount, loading, onLoadMore, showBackToTop, onBackToTop, className, }: PaginationProps): JSX.Element;
|
|
384
|
+
|
|
385
|
+
export declare interface PaginationProps {
|
|
386
|
+
/** Number of items currently shown */
|
|
387
|
+
shown: number;
|
|
388
|
+
/** Total number of items */
|
|
389
|
+
total: number;
|
|
390
|
+
/** Number of additional items to load — renders "View N more" button */
|
|
391
|
+
moreCount?: number;
|
|
392
|
+
/** Whether more items are currently loading */
|
|
393
|
+
loading?: boolean;
|
|
394
|
+
/** Callback when "View more" is clicked */
|
|
395
|
+
onLoadMore?: () => void;
|
|
396
|
+
/** Whether to show a "Back to Top" button instead of "View more" */
|
|
397
|
+
showBackToTop?: boolean;
|
|
398
|
+
/** Callback when "Back to Top" is clicked */
|
|
399
|
+
onBackToTop?: () => void;
|
|
400
|
+
className?: string;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
export declare function Popover({ position, align, children, className, }: PopoverProps): JSX.Element;
|
|
404
|
+
|
|
405
|
+
export declare type PopoverAlign = "start" | "center" | "end";
|
|
406
|
+
|
|
407
|
+
export declare type PopoverPosition = "top" | "bottom" | "left" | "right";
|
|
408
|
+
|
|
409
|
+
export declare interface PopoverProps {
|
|
410
|
+
/** Which side the popover appears on (arrow points opposite) */
|
|
411
|
+
position?: PopoverPosition;
|
|
412
|
+
/** Where the arrow sits along the edge */
|
|
413
|
+
align?: PopoverAlign;
|
|
414
|
+
children: default_2.ReactNode;
|
|
415
|
+
className?: string;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
export declare function Price({ amount, originalAmount, discount, rangeEnd, layout, className, }: PriceProps): JSX.Element;
|
|
419
|
+
|
|
420
|
+
export declare function PriceFilter({ min, max, low, high, defaultLow, defaultHigh, step, onChange, onReset, className, }: PriceFilterProps): JSX.Element;
|
|
421
|
+
|
|
422
|
+
export declare interface PriceFilterProps {
|
|
423
|
+
min: number;
|
|
424
|
+
max: number;
|
|
425
|
+
low?: number;
|
|
426
|
+
high?: number;
|
|
427
|
+
defaultLow?: number;
|
|
428
|
+
defaultHigh?: number;
|
|
429
|
+
step?: number;
|
|
430
|
+
onChange?: (low: number, high: number) => void;
|
|
431
|
+
onReset?: () => void;
|
|
432
|
+
className?: string;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
export declare interface PriceProps {
|
|
436
|
+
amount: string;
|
|
437
|
+
originalAmount?: string;
|
|
438
|
+
discount?: string;
|
|
439
|
+
rangeEnd?: string;
|
|
440
|
+
layout?: "inline" | "stacked";
|
|
441
|
+
className?: string;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
export declare function ProductCard({ imageUrl, imageAlt, name, badge, originalPrice, salePrice, discount, marketingFlag, rating, reviewCount, swatches, moreSwatches, variant, onClick, className, }: ProductCardProps): JSX.Element;
|
|
445
|
+
|
|
446
|
+
export declare interface ProductCardProps {
|
|
447
|
+
/** Product image URL */
|
|
448
|
+
imageUrl?: string;
|
|
449
|
+
/** Alt text for the product image */
|
|
450
|
+
imageAlt?: string;
|
|
451
|
+
/** Product name */
|
|
452
|
+
name: string;
|
|
453
|
+
/** Badge text (e.g. "New", "Sale") */
|
|
454
|
+
badge?: string;
|
|
455
|
+
/** Original/strikethrough price */
|
|
456
|
+
originalPrice?: string;
|
|
457
|
+
/** Sale price */
|
|
458
|
+
salePrice?: string;
|
|
459
|
+
/** Discount percentage text (e.g. "30% off") */
|
|
460
|
+
discount?: string;
|
|
461
|
+
/** Marketing flag text */
|
|
462
|
+
marketingFlag?: string;
|
|
463
|
+
/** Star rating 0–5 */
|
|
464
|
+
rating?: number;
|
|
465
|
+
/** Number of reviews */
|
|
466
|
+
reviewCount?: number;
|
|
467
|
+
/** Color swatches to display */
|
|
468
|
+
swatches?: ProductCardSwatch[];
|
|
469
|
+
/** Overflow swatch count (e.g. "+6") */
|
|
470
|
+
moreSwatches?: number;
|
|
471
|
+
/** Card variant */
|
|
472
|
+
variant?: "default" | "mini";
|
|
473
|
+
/** Click handler for the entire card */
|
|
474
|
+
onClick?: () => void;
|
|
475
|
+
className?: string;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
export declare interface ProductCardSwatch {
|
|
479
|
+
color: string;
|
|
480
|
+
label: string;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
export declare function Radio({ label, error, disabled, className, id: idProp, ...rest }: RadioProps): JSX.Element;
|
|
484
|
+
|
|
485
|
+
export declare function RadioGroup({ children, label, name, error, className, }: RadioGroupProps): JSX.Element;
|
|
486
|
+
|
|
487
|
+
export declare interface RadioGroupProps {
|
|
488
|
+
children: default_2.ReactNode;
|
|
489
|
+
label?: string;
|
|
490
|
+
name: string;
|
|
491
|
+
error?: boolean;
|
|
492
|
+
className?: string;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
export declare interface RadioProps extends Omit<default_2.InputHTMLAttributes<HTMLInputElement>, "type"> {
|
|
496
|
+
label?: default_2.ReactNode;
|
|
497
|
+
error?: boolean;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
export declare function RangeSlider({ min, max, low, high, defaultLow, defaultHigh, step, onChange, "aria-label": ariaLabel, className, }: RangeSliderProps): JSX.Element;
|
|
501
|
+
|
|
502
|
+
export declare interface RangeSliderProps {
|
|
503
|
+
min: number;
|
|
504
|
+
max: number;
|
|
505
|
+
low?: number;
|
|
506
|
+
high?: number;
|
|
507
|
+
defaultLow?: number;
|
|
508
|
+
defaultHigh?: number;
|
|
509
|
+
step?: number;
|
|
510
|
+
onChange?: (low: number, high: number) => void;
|
|
511
|
+
"aria-label"?: string;
|
|
512
|
+
className?: string;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
export declare function SearchInput({ value, defaultValue, placeholder, onChange, onSubmit, onClear, className, }: SearchInputProps): JSX.Element;
|
|
516
|
+
|
|
517
|
+
export declare interface SearchInputProps {
|
|
518
|
+
/** Current search value (controlled) */
|
|
519
|
+
value?: string;
|
|
520
|
+
/** Default value (uncontrolled) */
|
|
521
|
+
defaultValue?: string;
|
|
522
|
+
/** Placeholder text */
|
|
523
|
+
placeholder?: string;
|
|
524
|
+
/** Called when value changes */
|
|
525
|
+
onChange?: (value: string) => void;
|
|
526
|
+
/** Called when user submits (Enter key or search icon click) */
|
|
527
|
+
onSubmit?: (value: string) => void;
|
|
528
|
+
/** Called when Clear is clicked */
|
|
529
|
+
onClear?: () => void;
|
|
530
|
+
className?: string;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
export declare function Selector({ options, value, defaultValue, onChange, className, }: SelectorProps): JSX.Element;
|
|
534
|
+
|
|
535
|
+
export declare function SelectorGroup({ label, selectedLabel, children, className, }: SelectorGroupProps): JSX.Element;
|
|
536
|
+
|
|
537
|
+
export declare interface SelectorGroupProps {
|
|
538
|
+
label: string;
|
|
539
|
+
/** Currently selected value label shown after the header */
|
|
540
|
+
selectedLabel?: string;
|
|
541
|
+
children: default_2.ReactNode;
|
|
542
|
+
className?: string;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
export declare interface SelectorOption {
|
|
546
|
+
label: string;
|
|
547
|
+
value: string;
|
|
548
|
+
unavailable?: boolean;
|
|
549
|
+
disabled?: boolean;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
export declare interface SelectorProps {
|
|
553
|
+
options: SelectorOption[];
|
|
554
|
+
value?: string;
|
|
555
|
+
defaultValue?: string;
|
|
556
|
+
onChange?: (value: string) => void;
|
|
557
|
+
className?: string;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
export declare function SelectorSwatch({ color, active, focused, unavailable, label, size, "aria-label": ariaLabel, onClick, className, }: SelectorSwatchProps): JSX.Element;
|
|
561
|
+
|
|
562
|
+
export declare interface SelectorSwatchProps {
|
|
563
|
+
/** CSS color value displayed inside the swatch circle */
|
|
564
|
+
color: string;
|
|
565
|
+
/** Whether this swatch is the active/selected one */
|
|
566
|
+
active?: boolean;
|
|
567
|
+
/** Whether the swatch is keyboard-focused */
|
|
568
|
+
focused?: boolean;
|
|
569
|
+
/** Whether the color is unavailable (shows diagonal strikethrough) */
|
|
570
|
+
unavailable?: boolean;
|
|
571
|
+
/** Optional text label below the swatch */
|
|
572
|
+
label?: string;
|
|
573
|
+
/** Swatch diameter */
|
|
574
|
+
size?: SwatchSize;
|
|
575
|
+
/** Accessible name for the color */
|
|
576
|
+
"aria-label"?: string;
|
|
577
|
+
onClick?: () => void;
|
|
578
|
+
className?: string;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
export declare interface SocialLink {
|
|
582
|
+
label: string;
|
|
583
|
+
href: string;
|
|
584
|
+
icon: default_2.ReactNode;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
export declare function SwatchGrid({ children, className }: SwatchGridProps): JSX.Element;
|
|
588
|
+
|
|
589
|
+
export declare interface SwatchGridProps {
|
|
590
|
+
children: default_2.ReactNode;
|
|
591
|
+
showLabels?: boolean;
|
|
592
|
+
className?: string;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
export declare type SwatchSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
596
|
+
|
|
597
|
+
export declare function Switch({ checked, defaultChecked, onChange, showLabel, disabled, className, "aria-label": ariaLabel, }: SwitchProps): JSX.Element;
|
|
598
|
+
|
|
599
|
+
export declare interface SwitchProps {
|
|
600
|
+
checked?: boolean;
|
|
601
|
+
defaultChecked?: boolean;
|
|
602
|
+
onChange?: (checked: boolean) => void;
|
|
603
|
+
showLabel?: boolean;
|
|
604
|
+
disabled?: boolean;
|
|
605
|
+
className?: string;
|
|
606
|
+
"aria-label"?: string;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
export declare interface Tab {
|
|
610
|
+
label: string;
|
|
611
|
+
value: string;
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
export declare function Tabs({ title, tabs, value, defaultValue, onChange, className, }: TabsProps): JSX.Element;
|
|
615
|
+
|
|
616
|
+
export declare interface TabsProps {
|
|
617
|
+
/** Header text above the tab bar */
|
|
618
|
+
title?: string;
|
|
619
|
+
tabs: Tab[];
|
|
620
|
+
value?: string;
|
|
621
|
+
defaultValue?: string;
|
|
622
|
+
onChange?: (value: string) => void;
|
|
623
|
+
className?: string;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
export declare function TextInput({ label, error, helperText, errorText, maxLength, className, id: idProp, disabled, value, defaultValue, onFocus, onBlur, onChange, ...rest }: TextInputProps): JSX.Element;
|
|
627
|
+
|
|
628
|
+
export declare interface TextInputProps extends Omit<default_2.InputHTMLAttributes<HTMLInputElement>, "size"> {
|
|
629
|
+
label: string;
|
|
630
|
+
error?: boolean;
|
|
631
|
+
helperText?: string;
|
|
632
|
+
errorText?: string;
|
|
633
|
+
maxLength?: number;
|
|
634
|
+
className?: string;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
export { }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stoovles/gap-kit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Gap 1.0.0 MakeKit for Figma Make",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"react": "^19.0.0",
|
|
34
34
|
"react-dom": "^19.0.0",
|
|
35
35
|
"typescript": "^5.7.0",
|
|
36
|
-
"vite": "^6.0.0"
|
|
36
|
+
"vite": "^6.0.0",
|
|
37
|
+
"vite-plugin-dts": "^4.5.4"
|
|
37
38
|
}
|
|
38
39
|
}
|