@snacky/ui 0.9.1 → 0.11.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/CHANGELOG.md +94 -0
- package/README.md +4 -3
- package/dist/index.cjs +277 -248
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +89 -59
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +36 -8
- package/dist/index.d.ts +36 -8
- package/dist/index.js +242 -214
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAtt
|
|
|
25
25
|
type IconButtonVariant = 'primary' | 'secondary' | 'tertiary';
|
|
26
26
|
interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
27
27
|
variant?: IconButtonVariant;
|
|
28
|
-
/**
|
|
28
|
+
/** 32px circle with a 16px icon (default) or 24px circle with a full-size 24px icon (small), primary only. */
|
|
29
29
|
size?: 'default' | 'small';
|
|
30
30
|
icon: ReactNode;
|
|
31
31
|
/** Toggled/favorited state on the Secondary variant - tints the icon with icon-active, fill unchanged. */
|
|
@@ -40,7 +40,8 @@ interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
40
40
|
declare const IconButton: react.ForwardRefExoticComponent<IconButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
41
41
|
|
|
42
42
|
interface UploadButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
43
|
-
icon
|
|
43
|
+
/** Defaults to the camera glyph Figma draws in this button (its `picture` icon). */
|
|
44
|
+
icon?: ReactNode;
|
|
44
45
|
ariaLabel?: string;
|
|
45
46
|
}
|
|
46
47
|
/** Snacky Upload Button - circular dashed-border image drop zone. */
|
|
@@ -229,6 +230,29 @@ interface AlertBannerProps {
|
|
|
229
230
|
/** Snacky Alert Banner - inline info/warning strip, optionally with a countdown. */
|
|
230
231
|
declare function AlertBanner({ message, countdown, className }: AlertBannerProps): react.JSX.Element;
|
|
231
232
|
|
|
233
|
+
interface PageIndicatorProps {
|
|
234
|
+
/** How many pages the carousel has. */
|
|
235
|
+
count: number;
|
|
236
|
+
/** Zero-based index of the page currently shown. */
|
|
237
|
+
activeIndex: number;
|
|
238
|
+
/**
|
|
239
|
+
* Announced to screen readers, defaulting to "Page 2 of 3". Pass your own
|
|
240
|
+
* when the pages are not pages (a step counter, an onboarding sequence).
|
|
241
|
+
*/
|
|
242
|
+
ariaLabel?: string;
|
|
243
|
+
className?: string;
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Snacky Page Indicator - the dot row under a carousel. Figma draws the current
|
|
247
|
+
* page as a 28x8 pill and every other page as an 8x8 dot, 4 apart, and the Home
|
|
248
|
+
* hero carousel sits it 10 below the banner, centred.
|
|
249
|
+
*
|
|
250
|
+
* It reports position, it does not change it: the dots are decoration to a
|
|
251
|
+
* screen reader and the row carries the label instead. Make the carousel itself
|
|
252
|
+
* keyboard operable; do not wire clicks onto these.
|
|
253
|
+
*/
|
|
254
|
+
declare function PageIndicator({ count, activeIndex, ariaLabel, className }: PageIndicatorProps): react.JSX.Element;
|
|
255
|
+
|
|
232
256
|
interface NotificationBadgeProps {
|
|
233
257
|
count: number;
|
|
234
258
|
max?: number;
|
|
@@ -339,9 +363,11 @@ interface BottomSheetProps {
|
|
|
339
363
|
open: boolean;
|
|
340
364
|
onDismiss: () => void;
|
|
341
365
|
children: ReactNode;
|
|
342
|
-
/** Show the drag-handle bar.
|
|
343
|
-
*
|
|
344
|
-
*
|
|
366
|
+
/** Show the drag-handle bar. Defaults to false because 8 of Figma's 9
|
|
367
|
+
* Modal variants have no handle. The `driver` variant does: it draws a
|
|
368
|
+
* visible 40x4 `Driver Slider` (node 8693:6233). An earlier pass read
|
|
369
|
+
* that as "no variant shows one", which was wrong, so a Driver Tracking
|
|
370
|
+
* composition should pass showHandle. */
|
|
345
371
|
showHandle?: boolean;
|
|
346
372
|
className?: string;
|
|
347
373
|
}
|
|
@@ -357,7 +383,7 @@ declare function BottomSheet({ open, onDismiss, children, showHandle, className
|
|
|
357
383
|
|
|
358
384
|
interface SectionProps {
|
|
359
385
|
title: string;
|
|
360
|
-
/**
|
|
386
|
+
/** "See more" action, shown when provided: Figma's small Icon-Button (24px circle, full-size angle chevron). */
|
|
361
387
|
onAction?: () => void;
|
|
362
388
|
children: ReactNode;
|
|
363
389
|
className?: string;
|
|
@@ -639,6 +665,7 @@ declare namespace outline {
|
|
|
639
665
|
}
|
|
640
666
|
|
|
641
667
|
declare const account: ({ width, height, color, ...rest }: IconProps) => react.JSX.Element;
|
|
668
|
+
declare const angleSmallRight: ({ width, height, color, ...rest }: IconProps) => react.JSX.Element;
|
|
642
669
|
declare const balance: ({ width, height, color, ...rest }: IconProps) => react.JSX.Element;
|
|
643
670
|
declare const bell: ({ width, height, color, ...rest }: IconProps) => react.JSX.Element;
|
|
644
671
|
declare const cart: ({ width, height, color, ...rest }: IconProps) => react.JSX.Element;
|
|
@@ -651,6 +678,7 @@ declare const star: ({ width, height, color, ...rest }: IconProps) => react.JSX.
|
|
|
651
678
|
declare const truck: ({ width, height, color, ...rest }: IconProps) => react.JSX.Element;
|
|
652
679
|
|
|
653
680
|
declare const solid_account: typeof account;
|
|
681
|
+
declare const solid_angleSmallRight: typeof angleSmallRight;
|
|
654
682
|
declare const solid_balance: typeof balance;
|
|
655
683
|
declare const solid_bell: typeof bell;
|
|
656
684
|
declare const solid_cart: typeof cart;
|
|
@@ -662,7 +690,7 @@ declare const solid_points: typeof points;
|
|
|
662
690
|
declare const solid_star: typeof star;
|
|
663
691
|
declare const solid_truck: typeof truck;
|
|
664
692
|
declare namespace solid {
|
|
665
|
-
export { solid_account as account, solid_balance as balance, solid_bell as bell, solid_cart as cart, solid_category as category, solid_heart as heart, solid_history as history, solid_home as home, solid_points as points, solid_star as star, solid_truck as truck };
|
|
693
|
+
export { solid_account as account, solid_angleSmallRight as angleSmallRight, solid_balance as balance, solid_bell as bell, solid_cart as cart, solid_category as category, solid_heart as heart, solid_history as history, solid_home as home, solid_points as points, solid_star as star, solid_truck as truck };
|
|
666
694
|
}
|
|
667
695
|
|
|
668
696
|
/** Matches the `<SnackyIcons.outline.home />` / `<SnackyIcons.solid.home />` namespace used throughout the design system's documented code samples. */
|
|
@@ -671,4 +699,4 @@ declare const SnackyIcons: {
|
|
|
671
699
|
solid: typeof solid;
|
|
672
700
|
};
|
|
673
701
|
|
|
674
|
-
export { Accordion, type AccordionProps, AddressResult, type AddressResultProps, AlertBanner, type AlertBannerProps, Avatar, type AvatarProps, type AvatarSize, BottomSheet, type BottomSheetProps, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Calendar, type CalendarProps, Callout, type CalloutProps, type CalloutVariant, ChatInput, type ChatInputProps, Checkbox, type CheckboxProps, CopyField, type CopyFieldProps, DiscountTag, type DiscountTagProps, FilterChip, type FilterChipProps, FullWidthBanner, Header, type HeaderLeadingIcon, type HeaderProps, HeroBanner, IconButton, type IconButtonProps, type IconButtonVariant, type IconProps, Illustration, type IllustrationProps, type IllustrationVariant, type ImageBannerProps, ImagePlaceholder, type ImagePlaceholderProps, InfoBadge, type InfoBadgeProps, NavBar, type NavBarProps, type NavItem, NotificationBadge, type NotificationBadgeProps, NotificationListItem, type NotificationListItemProps, OrderListItem, type OrderListItemProps, type OrderStatus, OtpField, type OtpFieldProps, PointBalanceBanner, type PointBalanceBannerProps, ProductCard, type ProductCardDetailsProps, type ProductCardListProps, type ProductCardProps, ProductChip, type ProductChipProps, ProductImage, type ProductImageProps, type ProductImageUsage, RadioOption, type RadioOptionProps, SearchField, type SearchFieldProps, Section, type SectionProps, SnackyIcons, SoldOutBadge, type SoldOutBadgeProps, SquareBanner, type Step, type StepState, Stepper, type StepperProps, TabRow, type TabRowProps, TextField, type TextFieldProps, Toggle, type ToggleProps, UploadButton, type UploadButtonProps, VariantBadge, type VariantBadgeProps, typography };
|
|
702
|
+
export { Accordion, type AccordionProps, AddressResult, type AddressResultProps, AlertBanner, type AlertBannerProps, Avatar, type AvatarProps, type AvatarSize, BottomSheet, type BottomSheetProps, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Calendar, type CalendarProps, Callout, type CalloutProps, type CalloutVariant, ChatInput, type ChatInputProps, Checkbox, type CheckboxProps, CopyField, type CopyFieldProps, DiscountTag, type DiscountTagProps, FilterChip, type FilterChipProps, FullWidthBanner, Header, type HeaderLeadingIcon, type HeaderProps, HeroBanner, IconButton, type IconButtonProps, type IconButtonVariant, type IconProps, Illustration, type IllustrationProps, type IllustrationVariant, type ImageBannerProps, ImagePlaceholder, type ImagePlaceholderProps, InfoBadge, type InfoBadgeProps, NavBar, type NavBarProps, type NavItem, NotificationBadge, type NotificationBadgeProps, NotificationListItem, type NotificationListItemProps, OrderListItem, type OrderListItemProps, type OrderStatus, OtpField, type OtpFieldProps, PageIndicator, type PageIndicatorProps, PointBalanceBanner, type PointBalanceBannerProps, ProductCard, type ProductCardDetailsProps, type ProductCardListProps, type ProductCardProps, ProductChip, type ProductChipProps, ProductImage, type ProductImageProps, type ProductImageUsage, RadioOption, type RadioOptionProps, SearchField, type SearchFieldProps, Section, type SectionProps, SnackyIcons, SoldOutBadge, type SoldOutBadgeProps, SquareBanner, type Step, type StepState, Stepper, type StepperProps, TabRow, type TabRowProps, TextField, type TextFieldProps, Toggle, type ToggleProps, UploadButton, type UploadButtonProps, VariantBadge, type VariantBadgeProps, typography };
|