@snacky/ui 0.7.3 → 0.8.1
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 +79 -0
- package/dist/index.cjs +9 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +20 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +20 -4
- package/dist/index.d.ts +20 -4
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -248,12 +248,28 @@ interface SoldOutBadgeProps {
|
|
|
248
248
|
}
|
|
249
249
|
/** Snacky Sold Out Badge - absolute overlay on a product image. Position it with your own layout. */
|
|
250
250
|
declare function SoldOutBadge({ className }: SoldOutBadgeProps): react.JSX.Element;
|
|
251
|
-
interface
|
|
251
|
+
interface InfoBadgeProps {
|
|
252
|
+
/** The whole string, including its own prefix if it has one - Figma draws this as a single text node ("Variant: 75 Grams", "Points: 20,000"). */
|
|
252
253
|
label: string;
|
|
254
|
+
/** Optional 12x12 leading icon. Its presence is the only structural difference between Figma's `Property 2=variant` and `Property 2=points`. */
|
|
255
|
+
icon?: ReactNode;
|
|
253
256
|
className?: string;
|
|
254
257
|
}
|
|
255
|
-
/**
|
|
256
|
-
|
|
258
|
+
/**
|
|
259
|
+
* Snacky Info Badge - static, non-interactive `Label: Value` chip on the
|
|
260
|
+
* accent-highlighted style, for a single attribute of something: the selected
|
|
261
|
+
* product variant, a loyalty points total, and so on.
|
|
262
|
+
*
|
|
263
|
+
* Named for the shape of the information, not one use of it. It was
|
|
264
|
+
* `VariantBadge` until Figma grew a second use (`Points: 20,000` in the Home
|
|
265
|
+
* header), which was identical apart from the icon - so the icon became a slot
|
|
266
|
+
* rather than the pattern becoming a second component.
|
|
267
|
+
*/
|
|
268
|
+
declare function InfoBadge({ label, icon, className }: InfoBadgeProps): react.JSX.Element;
|
|
269
|
+
/** @deprecated Renamed to {@link InfoBadge} in 0.8.0 - the same component, now with an optional `icon`. This alias will be removed in a future release. */
|
|
270
|
+
declare const VariantBadge: typeof InfoBadge;
|
|
271
|
+
/** @deprecated Renamed to {@link InfoBadgeProps} in 0.8.0. */
|
|
272
|
+
type VariantBadgeProps = InfoBadgeProps;
|
|
257
273
|
|
|
258
274
|
type CalloutVariant = 'received' | 'sent' | 'pending';
|
|
259
275
|
interface CalloutProps {
|
|
@@ -655,4 +671,4 @@ declare const SnackyIcons: {
|
|
|
655
671
|
solid: typeof solid;
|
|
656
672
|
};
|
|
657
673
|
|
|
658
|
-
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, 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 };
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -53,6 +53,7 @@ var Button = forwardRef(function Button2({ variant = "primary", danger = false,
|
|
|
53
53
|
`snacky-btn--${variant}`,
|
|
54
54
|
size === "small" && "snacky-btn--small",
|
|
55
55
|
danger && "snacky-btn--danger",
|
|
56
|
+
icon3 != null && "snacky-btn--with-icon",
|
|
56
57
|
className
|
|
57
58
|
),
|
|
58
59
|
...rest,
|
|
@@ -784,9 +785,13 @@ function DiscountTag({ label, className }) {
|
|
|
784
785
|
function SoldOutBadge({ className }) {
|
|
785
786
|
return /* @__PURE__ */ jsx21("span", { className: cx("snacky-soldout-badge", className), children: "Sold Out" });
|
|
786
787
|
}
|
|
787
|
-
function
|
|
788
|
-
return /* @__PURE__ */
|
|
788
|
+
function InfoBadge({ label, icon: icon3, className }) {
|
|
789
|
+
return /* @__PURE__ */ jsxs14("span", { className: cx("snacky-info-badge", className), children: [
|
|
790
|
+
icon3 && /* @__PURE__ */ jsx21("span", { className: "snacky-info-badge__icon", children: icon3 }),
|
|
791
|
+
label
|
|
792
|
+
] });
|
|
789
793
|
}
|
|
794
|
+
var VariantBadge = InfoBadge;
|
|
790
795
|
|
|
791
796
|
// src/components/Callout/Callout.tsx
|
|
792
797
|
import { jsx as jsx22, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
@@ -1251,6 +1256,7 @@ export {
|
|
|
1251
1256
|
IconButton,
|
|
1252
1257
|
Illustration,
|
|
1253
1258
|
ImagePlaceholder,
|
|
1259
|
+
InfoBadge,
|
|
1254
1260
|
NavBar,
|
|
1255
1261
|
NotificationBadge,
|
|
1256
1262
|
NotificationListItem,
|