@butternutbox/pawprint-native 0.4.1 → 0.5.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/.turbo/turbo-build.log +6 -6
- package/CHANGELOG.md +12 -0
- package/dist/index.cjs +79 -40
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +34 -10
- package/dist/index.d.ts +34 -10
- package/dist/index.js +79 -40
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/Countdown/Countdown.stories.tsx +35 -0
- package/src/components/molecules/Countdown/Countdown.tsx +52 -10
- package/src/components/molecules/Countdown/index.ts +5 -1
- package/src/components/molecules/ProductDisplayCard/ProductDisplayCard.stories.tsx +25 -11
- package/src/components/molecules/ProductDisplayCard/ProductDisplayCard.test.tsx +1 -1
- package/src/components/molecules/ProductDisplayCard/ProductDisplayCard.tsx +53 -33
- package/src/components/molecules/ProductDisplayCard/index.ts +1 -4
package/dist/index.d.cts
CHANGED
|
@@ -1892,6 +1892,21 @@ type PictureSelectorProps = PictureSelectorOwnProps & Omit<ViewProps, keyof Pict
|
|
|
1892
1892
|
declare const PictureSelector: React.ForwardRefExoticComponent<PictureSelectorOwnProps & Omit<ViewProps, keyof PictureSelectorOwnProps> & React.RefAttributes<View>>;
|
|
1893
1893
|
|
|
1894
1894
|
type CountdownLayout = "stacked" | "inline";
|
|
1895
|
+
/**
|
|
1896
|
+
* A unit label. Pass a plain string to use it regardless of count, or a
|
|
1897
|
+
* `{ singular, plural }` pair to pluralise based on the unit's value
|
|
1898
|
+
* (`singular` when the value is exactly 1, `plural` otherwise).
|
|
1899
|
+
*/
|
|
1900
|
+
type CountdownUnitLabel = string | {
|
|
1901
|
+
singular: string;
|
|
1902
|
+
plural: string;
|
|
1903
|
+
};
|
|
1904
|
+
type CountdownLabels = {
|
|
1905
|
+
days?: CountdownUnitLabel;
|
|
1906
|
+
hours?: CountdownUnitLabel;
|
|
1907
|
+
minutes?: CountdownUnitLabel;
|
|
1908
|
+
seconds?: CountdownUnitLabel;
|
|
1909
|
+
};
|
|
1895
1910
|
type CountdownOwnProps = {
|
|
1896
1911
|
layout?: CountdownLayout;
|
|
1897
1912
|
days?: number;
|
|
@@ -1901,6 +1916,7 @@ type CountdownOwnProps = {
|
|
|
1901
1916
|
showDays?: boolean;
|
|
1902
1917
|
showSeconds?: boolean;
|
|
1903
1918
|
label?: React.ReactNode;
|
|
1919
|
+
labels?: CountdownLabels;
|
|
1904
1920
|
};
|
|
1905
1921
|
type CountdownProps = CountdownOwnProps & Omit<ViewProps, keyof CountdownOwnProps>;
|
|
1906
1922
|
/**
|
|
@@ -1932,6 +1948,7 @@ type CountdownProps = CountdownOwnProps & Omit<ViewProps, keyof CountdownOwnProp
|
|
|
1932
1948
|
* @param {boolean} [showDays=true] - Whether to render the days unit and its separator.
|
|
1933
1949
|
* @param {boolean} [showSeconds=true] - Whether to render the seconds unit and its separator.
|
|
1934
1950
|
* @param {React.ReactNode} [label] - Customizable prefix label, rendered in the `inline` layout only.
|
|
1951
|
+
* @param {CountdownLabels} [labels] - Overrides the per-unit labels (`days`/`hours`/`minutes`/`seconds`). Each label is either a plain string or a `{ singular, plural }` pair that resolves against the unit's value. Pass translated strings here; any omitted unit falls back to its English default.
|
|
1935
1952
|
*
|
|
1936
1953
|
* @example
|
|
1937
1954
|
* ```tsx
|
|
@@ -1939,6 +1956,14 @@ type CountdownProps = CountdownOwnProps & Omit<ViewProps, keyof CountdownOwnProp
|
|
|
1939
1956
|
*
|
|
1940
1957
|
* <Countdown layout="stacked" days={2} hours={9} minutes={48} seconds={38} />
|
|
1941
1958
|
* <Countdown layout="inline" label="Sale ends:" showDays={false} hours={3} minutes={49} seconds={38} />
|
|
1959
|
+
* <Countdown
|
|
1960
|
+
* labels={{
|
|
1961
|
+
* days: { singular: "jour", plural: "jours" },
|
|
1962
|
+
* hours: { singular: "heure", plural: "heures" }
|
|
1963
|
+
* }}
|
|
1964
|
+
* days={1}
|
|
1965
|
+
* hours={2}
|
|
1966
|
+
* />
|
|
1942
1967
|
* ```
|
|
1943
1968
|
*/
|
|
1944
1969
|
declare const Countdown: React.ForwardRefExoticComponent<CountdownOwnProps & Omit<ViewProps, keyof CountdownOwnProps> & React.RefAttributes<View>>;
|
|
@@ -1980,9 +2005,7 @@ declare const ProductListingCardWithBadgeAndGrid: typeof _ProductListingCard & {
|
|
|
1980
2005
|
Grid: typeof Grid;
|
|
1981
2006
|
};
|
|
1982
2007
|
|
|
1983
|
-
type ProductDisplayCardDevice = "desktop" | "mobile";
|
|
1984
2008
|
type ProductDisplayCardProps = ViewProps & {
|
|
1985
|
-
device?: ProductDisplayCardDevice;
|
|
1986
2009
|
title: string;
|
|
1987
2010
|
subtext?: string | React.ReactNode;
|
|
1988
2011
|
showSubtext?: boolean;
|
|
@@ -1997,7 +2020,10 @@ type ProductDisplayCardProps = ViewProps & {
|
|
|
1997
2020
|
decrementDisabled?: boolean;
|
|
1998
2021
|
image?: string | React.ReactNode;
|
|
1999
2022
|
imageBackgroundColor?: string;
|
|
2023
|
+
thumbnailWidth?: number;
|
|
2024
|
+
thumbnailBackgroundColor?: string;
|
|
2000
2025
|
showImageQuantityBadge?: boolean;
|
|
2026
|
+
borderless?: boolean;
|
|
2001
2027
|
banner?: React.ReactNode;
|
|
2002
2028
|
showBanner?: boolean;
|
|
2003
2029
|
bannerType?: "error" | "success" | "warning" | "info";
|
|
@@ -2011,7 +2037,6 @@ type ProductDisplayCardProps = ViewProps & {
|
|
|
2011
2037
|
* import { ProductDisplayCard } from "@butternutbox/pawprint-native"
|
|
2012
2038
|
*
|
|
2013
2039
|
* <ProductDisplayCard
|
|
2014
|
-
* device="mobile"
|
|
2015
2040
|
* title="Premium Recipe"
|
|
2016
2041
|
* subtext="+£0.00/pouch"
|
|
2017
2042
|
* quantity={1}
|
|
@@ -2019,23 +2044,19 @@ type ProductDisplayCardProps = ViewProps & {
|
|
|
2019
2044
|
* />
|
|
2020
2045
|
* ```
|
|
2021
2046
|
*
|
|
2022
|
-
* @param device - *(optional)* Device variant: "desktop" or "mobile" (default)
|
|
2023
2047
|
* @param title - Product title
|
|
2024
|
-
* @param subtext - *(optional)* Subtitle text
|
|
2048
|
+
* @param subtext - *(optional)* Subtitle text (e.g. price)
|
|
2025
2049
|
* @param showSubtext - *(optional)* Show/hide subtext
|
|
2026
2050
|
* @param quantity - *(optional)* Current quantity value
|
|
2027
2051
|
* @param onQuantityChange - *(optional)* Callback when quantity changes
|
|
2028
2052
|
* @param showQuantityPicker - *(optional)* Show/hide quantity picker
|
|
2029
|
-
* @param image - *(optional)* Image
|
|
2030
|
-
* @param imageBackgroundColor - *(optional)* Background color for image container (default: theme background.container.secondary)
|
|
2031
|
-
* @param showImageQuantityBadge - *(optional)* Show/hide quantity badge overlay on image
|
|
2053
|
+
* @param image - *(optional)* Image element or content
|
|
2032
2054
|
* @param banner - *(optional)* Banner content to show below card
|
|
2033
2055
|
* @param showBanner - *(optional)* Show/hide banner
|
|
2034
2056
|
* @param bannerType - *(optional)* Banner notification type: "error", "success", "warning", or "info" (default)
|
|
2035
2057
|
* @param showBannerIcon - *(optional)* Show/hide banner notification icon
|
|
2036
2058
|
*/
|
|
2037
2059
|
declare const ProductDisplayCard: React.ForwardRefExoticComponent<ViewProps & {
|
|
2038
|
-
device?: ProductDisplayCardDevice;
|
|
2039
2060
|
title: string;
|
|
2040
2061
|
subtext?: string | React.ReactNode;
|
|
2041
2062
|
showSubtext?: boolean;
|
|
@@ -2050,7 +2071,10 @@ declare const ProductDisplayCard: React.ForwardRefExoticComponent<ViewProps & {
|
|
|
2050
2071
|
decrementDisabled?: boolean;
|
|
2051
2072
|
image?: string | React.ReactNode;
|
|
2052
2073
|
imageBackgroundColor?: string;
|
|
2074
|
+
thumbnailWidth?: number;
|
|
2075
|
+
thumbnailBackgroundColor?: string;
|
|
2053
2076
|
showImageQuantityBadge?: boolean;
|
|
2077
|
+
borderless?: boolean;
|
|
2054
2078
|
banner?: React.ReactNode;
|
|
2055
2079
|
showBanner?: boolean;
|
|
2056
2080
|
bannerType?: "error" | "success" | "warning" | "info";
|
|
@@ -2122,4 +2146,4 @@ type TabNavigationComponent = React.ForwardRefExoticComponent<TabNavigationProps
|
|
|
2122
2146
|
};
|
|
2123
2147
|
declare const TabNavigation: TabNavigationComponent;
|
|
2124
2148
|
|
|
2125
|
-
export { Accordion, type AccordionItemProps, type AccordionProps, type AccordionSize, Animated, type AnimatedProps, type AnimatedVariant, Avatar, type AvatarFallbackType, type AvatarProps, type AvatarSize, BRAND_FONTS, Badge$1 as Badge, type BadgeProps, Button, type ButtonColour, ButtonDock, type ButtonDockProps, type ButtonDockVariant, ButtonGroup, type ButtonGroupLayout, type ButtonGroupProps, type ButtonProps, type ButtonSize, type ButtonVariant, CarouselControls, type CarouselControlsProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, type CheckboxVariant, CopyField, CopyFieldInput, type CopyFieldProps, Countdown, type CountdownProps, type DateItemState, DatePicker, type DatePickerProps, Drawer, type DrawerBodyProps, type DrawerCloseProps, type DrawerContentProps, type DrawerDescriptionProps, type DrawerFooterProps, type DrawerGrabberProps, type DrawerHeaderProps, type DrawerHeaderVariant, type DrawerOverlayProps, type DrawerProps, type DrawerTitleProps, type DrawerTriggerProps, FilterTab, type FilterTabItemProps, type FilterTabProps, Hint, type HintProps, Icon, IconButton, type IconButtonColour, type IconButtonProps, type IconButtonSize, type IconButtonVariant, type IconCategory, type IconColour, type IconProps, type IconSize, Illustration, type IllustrationProps, type IllustrationSize, Input, InputDescription, type InputDescriptionProps, InputError, type InputErrorProps, InputField, type InputFieldProps, InputLabel, type InputLabelProps, type InputProps, Link, type LinkProps, type LinkSize, type LinkWeight, Logo, type LogoBrand, type LogoProps, type LogoSvgComponent, type LogoVariant, MessageCard, MessageCardBanner, type MessageCardBannerMedia, type MessageCardBannerProps, MessageCardInsight, type MessageCardInsightProps, Notification, type NotificationProps, NumberField, type NumberFieldProps, NumberInput, NumberInputField, type NumberInputFieldProps, type NumberInputProps, PasswordField, PasswordFieldInput, type PasswordFieldProps, PasswordFieldRequirements, type PasswordFieldRequirementsProps, type PasswordRequirement, type PasswordValidationRule, type PawprintIcon, type PawprintIllustration$2 as PawprintIllustration, PawprintProvider, type PawprintProviderProps, PictureSelector, type PictureSelectorItem, type PictureSelectorProps, ProductDisplayCard, type
|
|
2149
|
+
export { Accordion, type AccordionItemProps, type AccordionProps, type AccordionSize, Animated, type AnimatedProps, type AnimatedVariant, Avatar, type AvatarFallbackType, type AvatarProps, type AvatarSize, BRAND_FONTS, Badge$1 as Badge, type BadgeProps, Button, type ButtonColour, ButtonDock, type ButtonDockProps, type ButtonDockVariant, ButtonGroup, type ButtonGroupLayout, type ButtonGroupProps, type ButtonProps, type ButtonSize, type ButtonVariant, CarouselControls, type CarouselControlsProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, type CheckboxVariant, CopyField, CopyFieldInput, type CopyFieldProps, Countdown, type CountdownLabels, type CountdownProps, type CountdownUnitLabel, type DateItemState, DatePicker, type DatePickerProps, Drawer, type DrawerBodyProps, type DrawerCloseProps, type DrawerContentProps, type DrawerDescriptionProps, type DrawerFooterProps, type DrawerGrabberProps, type DrawerHeaderProps, type DrawerHeaderVariant, type DrawerOverlayProps, type DrawerProps, type DrawerTitleProps, type DrawerTriggerProps, FilterTab, type FilterTabItemProps, type FilterTabProps, Hint, type HintProps, Icon, IconButton, type IconButtonColour, type IconButtonProps, type IconButtonSize, type IconButtonVariant, type IconCategory, type IconColour, type IconProps, type IconSize, Illustration, type IllustrationProps, type IllustrationSize, Input, InputDescription, type InputDescriptionProps, InputError, type InputErrorProps, InputField, type InputFieldProps, InputLabel, type InputLabelProps, type InputProps, Link, type LinkProps, type LinkSize, type LinkWeight, Logo, type LogoBrand, type LogoProps, type LogoSvgComponent, type LogoVariant, MessageCard, MessageCardBanner, type MessageCardBannerMedia, type MessageCardBannerProps, MessageCardInsight, type MessageCardInsightProps, Notification, type NotificationProps, NumberField, type NumberFieldProps, NumberInput, NumberInputField, type NumberInputFieldProps, type NumberInputProps, PasswordField, PasswordFieldInput, type PasswordFieldProps, PasswordFieldRequirements, type PasswordFieldRequirementsProps, type PasswordRequirement, type PasswordValidationRule, type PawprintIcon, type PawprintIllustration$2 as PawprintIllustration, PawprintProvider, type PawprintProviderProps, PictureSelector, type PictureSelectorItem, type PictureSelectorProps, ProductDisplayCard, type ProductDisplayCardProps, ProductListingCardWithBadgeAndGrid as ProductListingCard, type ProductListingCardProps, Progress, type ProgressProps, Radio, RadioGroup, type RadioGroupProps, type RadioOwnProps, type RadioProps, SearchField, SearchFieldInput, type SearchFieldProps, SegmentedControl, type SegmentedControlItemProps, type SegmentedControlProps, SelectField, SelectFieldContent, SelectFieldItem, type SelectFieldItemProps, type SelectFieldProps, SelectFieldTrigger, type SelectFieldTriggerProps, SelectFieldValue, type SelectValidationRule, Slider, type SliderProps, Spinner, type SpinnerProps, type SpinnerSize, type SpinnerVariant, Switch, type SwitchProps, TabNavigation, type TabNavigationListProps, type TabNavigationPanelProps, type TabNavigationProps, type TabNavigationTabProps, Tag, type TagProps, TextArea, TextAreaField, type TextAreaFieldProps, TextAreaLabel, type TextAreaLabelProps, type TextAreaProps, ThemeProvider, Tooltip, type TooltipProps, Typography, type TypographyProps, createPawprintTheme, fadeAnimation, fadeDownAnimation, fadeUpAnimation, registerLogo, resolveFont, resolveLogo, scaleAnimation, slideInAnimation, slideOutAnimation, theme, useCopyField, usePasswordField, usePawprint, useSearchField, useSelectField };
|
package/dist/index.d.ts
CHANGED
|
@@ -1892,6 +1892,21 @@ type PictureSelectorProps = PictureSelectorOwnProps & Omit<ViewProps, keyof Pict
|
|
|
1892
1892
|
declare const PictureSelector: React.ForwardRefExoticComponent<PictureSelectorOwnProps & Omit<ViewProps, keyof PictureSelectorOwnProps> & React.RefAttributes<View>>;
|
|
1893
1893
|
|
|
1894
1894
|
type CountdownLayout = "stacked" | "inline";
|
|
1895
|
+
/**
|
|
1896
|
+
* A unit label. Pass a plain string to use it regardless of count, or a
|
|
1897
|
+
* `{ singular, plural }` pair to pluralise based on the unit's value
|
|
1898
|
+
* (`singular` when the value is exactly 1, `plural` otherwise).
|
|
1899
|
+
*/
|
|
1900
|
+
type CountdownUnitLabel = string | {
|
|
1901
|
+
singular: string;
|
|
1902
|
+
plural: string;
|
|
1903
|
+
};
|
|
1904
|
+
type CountdownLabels = {
|
|
1905
|
+
days?: CountdownUnitLabel;
|
|
1906
|
+
hours?: CountdownUnitLabel;
|
|
1907
|
+
minutes?: CountdownUnitLabel;
|
|
1908
|
+
seconds?: CountdownUnitLabel;
|
|
1909
|
+
};
|
|
1895
1910
|
type CountdownOwnProps = {
|
|
1896
1911
|
layout?: CountdownLayout;
|
|
1897
1912
|
days?: number;
|
|
@@ -1901,6 +1916,7 @@ type CountdownOwnProps = {
|
|
|
1901
1916
|
showDays?: boolean;
|
|
1902
1917
|
showSeconds?: boolean;
|
|
1903
1918
|
label?: React.ReactNode;
|
|
1919
|
+
labels?: CountdownLabels;
|
|
1904
1920
|
};
|
|
1905
1921
|
type CountdownProps = CountdownOwnProps & Omit<ViewProps, keyof CountdownOwnProps>;
|
|
1906
1922
|
/**
|
|
@@ -1932,6 +1948,7 @@ type CountdownProps = CountdownOwnProps & Omit<ViewProps, keyof CountdownOwnProp
|
|
|
1932
1948
|
* @param {boolean} [showDays=true] - Whether to render the days unit and its separator.
|
|
1933
1949
|
* @param {boolean} [showSeconds=true] - Whether to render the seconds unit and its separator.
|
|
1934
1950
|
* @param {React.ReactNode} [label] - Customizable prefix label, rendered in the `inline` layout only.
|
|
1951
|
+
* @param {CountdownLabels} [labels] - Overrides the per-unit labels (`days`/`hours`/`minutes`/`seconds`). Each label is either a plain string or a `{ singular, plural }` pair that resolves against the unit's value. Pass translated strings here; any omitted unit falls back to its English default.
|
|
1935
1952
|
*
|
|
1936
1953
|
* @example
|
|
1937
1954
|
* ```tsx
|
|
@@ -1939,6 +1956,14 @@ type CountdownProps = CountdownOwnProps & Omit<ViewProps, keyof CountdownOwnProp
|
|
|
1939
1956
|
*
|
|
1940
1957
|
* <Countdown layout="stacked" days={2} hours={9} minutes={48} seconds={38} />
|
|
1941
1958
|
* <Countdown layout="inline" label="Sale ends:" showDays={false} hours={3} minutes={49} seconds={38} />
|
|
1959
|
+
* <Countdown
|
|
1960
|
+
* labels={{
|
|
1961
|
+
* days: { singular: "jour", plural: "jours" },
|
|
1962
|
+
* hours: { singular: "heure", plural: "heures" }
|
|
1963
|
+
* }}
|
|
1964
|
+
* days={1}
|
|
1965
|
+
* hours={2}
|
|
1966
|
+
* />
|
|
1942
1967
|
* ```
|
|
1943
1968
|
*/
|
|
1944
1969
|
declare const Countdown: React.ForwardRefExoticComponent<CountdownOwnProps & Omit<ViewProps, keyof CountdownOwnProps> & React.RefAttributes<View>>;
|
|
@@ -1980,9 +2005,7 @@ declare const ProductListingCardWithBadgeAndGrid: typeof _ProductListingCard & {
|
|
|
1980
2005
|
Grid: typeof Grid;
|
|
1981
2006
|
};
|
|
1982
2007
|
|
|
1983
|
-
type ProductDisplayCardDevice = "desktop" | "mobile";
|
|
1984
2008
|
type ProductDisplayCardProps = ViewProps & {
|
|
1985
|
-
device?: ProductDisplayCardDevice;
|
|
1986
2009
|
title: string;
|
|
1987
2010
|
subtext?: string | React.ReactNode;
|
|
1988
2011
|
showSubtext?: boolean;
|
|
@@ -1997,7 +2020,10 @@ type ProductDisplayCardProps = ViewProps & {
|
|
|
1997
2020
|
decrementDisabled?: boolean;
|
|
1998
2021
|
image?: string | React.ReactNode;
|
|
1999
2022
|
imageBackgroundColor?: string;
|
|
2023
|
+
thumbnailWidth?: number;
|
|
2024
|
+
thumbnailBackgroundColor?: string;
|
|
2000
2025
|
showImageQuantityBadge?: boolean;
|
|
2026
|
+
borderless?: boolean;
|
|
2001
2027
|
banner?: React.ReactNode;
|
|
2002
2028
|
showBanner?: boolean;
|
|
2003
2029
|
bannerType?: "error" | "success" | "warning" | "info";
|
|
@@ -2011,7 +2037,6 @@ type ProductDisplayCardProps = ViewProps & {
|
|
|
2011
2037
|
* import { ProductDisplayCard } from "@butternutbox/pawprint-native"
|
|
2012
2038
|
*
|
|
2013
2039
|
* <ProductDisplayCard
|
|
2014
|
-
* device="mobile"
|
|
2015
2040
|
* title="Premium Recipe"
|
|
2016
2041
|
* subtext="+£0.00/pouch"
|
|
2017
2042
|
* quantity={1}
|
|
@@ -2019,23 +2044,19 @@ type ProductDisplayCardProps = ViewProps & {
|
|
|
2019
2044
|
* />
|
|
2020
2045
|
* ```
|
|
2021
2046
|
*
|
|
2022
|
-
* @param device - *(optional)* Device variant: "desktop" or "mobile" (default)
|
|
2023
2047
|
* @param title - Product title
|
|
2024
|
-
* @param subtext - *(optional)* Subtitle text
|
|
2048
|
+
* @param subtext - *(optional)* Subtitle text (e.g. price)
|
|
2025
2049
|
* @param showSubtext - *(optional)* Show/hide subtext
|
|
2026
2050
|
* @param quantity - *(optional)* Current quantity value
|
|
2027
2051
|
* @param onQuantityChange - *(optional)* Callback when quantity changes
|
|
2028
2052
|
* @param showQuantityPicker - *(optional)* Show/hide quantity picker
|
|
2029
|
-
* @param image - *(optional)* Image
|
|
2030
|
-
* @param imageBackgroundColor - *(optional)* Background color for image container (default: theme background.container.secondary)
|
|
2031
|
-
* @param showImageQuantityBadge - *(optional)* Show/hide quantity badge overlay on image
|
|
2053
|
+
* @param image - *(optional)* Image element or content
|
|
2032
2054
|
* @param banner - *(optional)* Banner content to show below card
|
|
2033
2055
|
* @param showBanner - *(optional)* Show/hide banner
|
|
2034
2056
|
* @param bannerType - *(optional)* Banner notification type: "error", "success", "warning", or "info" (default)
|
|
2035
2057
|
* @param showBannerIcon - *(optional)* Show/hide banner notification icon
|
|
2036
2058
|
*/
|
|
2037
2059
|
declare const ProductDisplayCard: React.ForwardRefExoticComponent<ViewProps & {
|
|
2038
|
-
device?: ProductDisplayCardDevice;
|
|
2039
2060
|
title: string;
|
|
2040
2061
|
subtext?: string | React.ReactNode;
|
|
2041
2062
|
showSubtext?: boolean;
|
|
@@ -2050,7 +2071,10 @@ declare const ProductDisplayCard: React.ForwardRefExoticComponent<ViewProps & {
|
|
|
2050
2071
|
decrementDisabled?: boolean;
|
|
2051
2072
|
image?: string | React.ReactNode;
|
|
2052
2073
|
imageBackgroundColor?: string;
|
|
2074
|
+
thumbnailWidth?: number;
|
|
2075
|
+
thumbnailBackgroundColor?: string;
|
|
2053
2076
|
showImageQuantityBadge?: boolean;
|
|
2077
|
+
borderless?: boolean;
|
|
2054
2078
|
banner?: React.ReactNode;
|
|
2055
2079
|
showBanner?: boolean;
|
|
2056
2080
|
bannerType?: "error" | "success" | "warning" | "info";
|
|
@@ -2122,4 +2146,4 @@ type TabNavigationComponent = React.ForwardRefExoticComponent<TabNavigationProps
|
|
|
2122
2146
|
};
|
|
2123
2147
|
declare const TabNavigation: TabNavigationComponent;
|
|
2124
2148
|
|
|
2125
|
-
export { Accordion, type AccordionItemProps, type AccordionProps, type AccordionSize, Animated, type AnimatedProps, type AnimatedVariant, Avatar, type AvatarFallbackType, type AvatarProps, type AvatarSize, BRAND_FONTS, Badge$1 as Badge, type BadgeProps, Button, type ButtonColour, ButtonDock, type ButtonDockProps, type ButtonDockVariant, ButtonGroup, type ButtonGroupLayout, type ButtonGroupProps, type ButtonProps, type ButtonSize, type ButtonVariant, CarouselControls, type CarouselControlsProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, type CheckboxVariant, CopyField, CopyFieldInput, type CopyFieldProps, Countdown, type CountdownProps, type DateItemState, DatePicker, type DatePickerProps, Drawer, type DrawerBodyProps, type DrawerCloseProps, type DrawerContentProps, type DrawerDescriptionProps, type DrawerFooterProps, type DrawerGrabberProps, type DrawerHeaderProps, type DrawerHeaderVariant, type DrawerOverlayProps, type DrawerProps, type DrawerTitleProps, type DrawerTriggerProps, FilterTab, type FilterTabItemProps, type FilterTabProps, Hint, type HintProps, Icon, IconButton, type IconButtonColour, type IconButtonProps, type IconButtonSize, type IconButtonVariant, type IconCategory, type IconColour, type IconProps, type IconSize, Illustration, type IllustrationProps, type IllustrationSize, Input, InputDescription, type InputDescriptionProps, InputError, type InputErrorProps, InputField, type InputFieldProps, InputLabel, type InputLabelProps, type InputProps, Link, type LinkProps, type LinkSize, type LinkWeight, Logo, type LogoBrand, type LogoProps, type LogoSvgComponent, type LogoVariant, MessageCard, MessageCardBanner, type MessageCardBannerMedia, type MessageCardBannerProps, MessageCardInsight, type MessageCardInsightProps, Notification, type NotificationProps, NumberField, type NumberFieldProps, NumberInput, NumberInputField, type NumberInputFieldProps, type NumberInputProps, PasswordField, PasswordFieldInput, type PasswordFieldProps, PasswordFieldRequirements, type PasswordFieldRequirementsProps, type PasswordRequirement, type PasswordValidationRule, type PawprintIcon, type PawprintIllustration$2 as PawprintIllustration, PawprintProvider, type PawprintProviderProps, PictureSelector, type PictureSelectorItem, type PictureSelectorProps, ProductDisplayCard, type
|
|
2149
|
+
export { Accordion, type AccordionItemProps, type AccordionProps, type AccordionSize, Animated, type AnimatedProps, type AnimatedVariant, Avatar, type AvatarFallbackType, type AvatarProps, type AvatarSize, BRAND_FONTS, Badge$1 as Badge, type BadgeProps, Button, type ButtonColour, ButtonDock, type ButtonDockProps, type ButtonDockVariant, ButtonGroup, type ButtonGroupLayout, type ButtonGroupProps, type ButtonProps, type ButtonSize, type ButtonVariant, CarouselControls, type CarouselControlsProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, type CheckboxVariant, CopyField, CopyFieldInput, type CopyFieldProps, Countdown, type CountdownLabels, type CountdownProps, type CountdownUnitLabel, type DateItemState, DatePicker, type DatePickerProps, Drawer, type DrawerBodyProps, type DrawerCloseProps, type DrawerContentProps, type DrawerDescriptionProps, type DrawerFooterProps, type DrawerGrabberProps, type DrawerHeaderProps, type DrawerHeaderVariant, type DrawerOverlayProps, type DrawerProps, type DrawerTitleProps, type DrawerTriggerProps, FilterTab, type FilterTabItemProps, type FilterTabProps, Hint, type HintProps, Icon, IconButton, type IconButtonColour, type IconButtonProps, type IconButtonSize, type IconButtonVariant, type IconCategory, type IconColour, type IconProps, type IconSize, Illustration, type IllustrationProps, type IllustrationSize, Input, InputDescription, type InputDescriptionProps, InputError, type InputErrorProps, InputField, type InputFieldProps, InputLabel, type InputLabelProps, type InputProps, Link, type LinkProps, type LinkSize, type LinkWeight, Logo, type LogoBrand, type LogoProps, type LogoSvgComponent, type LogoVariant, MessageCard, MessageCardBanner, type MessageCardBannerMedia, type MessageCardBannerProps, MessageCardInsight, type MessageCardInsightProps, Notification, type NotificationProps, NumberField, type NumberFieldProps, NumberInput, NumberInputField, type NumberInputFieldProps, type NumberInputProps, PasswordField, PasswordFieldInput, type PasswordFieldProps, PasswordFieldRequirements, type PasswordFieldRequirementsProps, type PasswordRequirement, type PasswordValidationRule, type PawprintIcon, type PawprintIllustration$2 as PawprintIllustration, PawprintProvider, type PawprintProviderProps, PictureSelector, type PictureSelectorItem, type PictureSelectorProps, ProductDisplayCard, type ProductDisplayCardProps, ProductListingCardWithBadgeAndGrid as ProductListingCard, type ProductListingCardProps, Progress, type ProgressProps, Radio, RadioGroup, type RadioGroupProps, type RadioOwnProps, type RadioProps, SearchField, SearchFieldInput, type SearchFieldProps, SegmentedControl, type SegmentedControlItemProps, type SegmentedControlProps, SelectField, SelectFieldContent, SelectFieldItem, type SelectFieldItemProps, type SelectFieldProps, SelectFieldTrigger, type SelectFieldTriggerProps, SelectFieldValue, type SelectValidationRule, Slider, type SliderProps, Spinner, type SpinnerProps, type SpinnerSize, type SpinnerVariant, Switch, type SwitchProps, TabNavigation, type TabNavigationListProps, type TabNavigationPanelProps, type TabNavigationProps, type TabNavigationTabProps, Tag, type TagProps, TextArea, TextAreaField, type TextAreaFieldProps, TextAreaLabel, type TextAreaLabelProps, type TextAreaProps, ThemeProvider, Tooltip, type TooltipProps, Typography, type TypographyProps, createPawprintTheme, fadeAnimation, fadeDownAnimation, fadeUpAnimation, registerLogo, resolveFont, resolveLogo, scaleAnimation, slideInAnimation, slideOutAnimation, theme, useCopyField, usePasswordField, usePawprint, useSearchField, useSelectField };
|
package/dist/index.js
CHANGED
|
@@ -13650,12 +13650,13 @@ var PictureSelector = React60.forwardRef(
|
|
|
13650
13650
|
}
|
|
13651
13651
|
);
|
|
13652
13652
|
PictureSelector.displayName = "PictureSelector";
|
|
13653
|
-
var
|
|
13654
|
-
days: "days",
|
|
13655
|
-
hours: "hrs",
|
|
13656
|
-
minutes: "min",
|
|
13657
|
-
seconds: "secs"
|
|
13653
|
+
var DEFAULT_UNIT_LABELS = {
|
|
13654
|
+
days: { singular: "day", plural: "days" },
|
|
13655
|
+
hours: { singular: "hr", plural: "hrs" },
|
|
13656
|
+
minutes: { singular: "min", plural: "min" },
|
|
13657
|
+
seconds: { singular: "sec", plural: "secs" }
|
|
13658
13658
|
};
|
|
13659
|
+
var resolveLabel = (label, value) => typeof label === "string" ? label : value === 1 ? label.singular : label.plural;
|
|
13659
13660
|
var parseTokenValue54 = (value) => parseFloat(value);
|
|
13660
13661
|
var pad = (value) => String(Math.max(0, Math.floor(value))).padStart(2, "0");
|
|
13661
13662
|
var StackedRoot = styled60(View)(({ rootGap }) => ({
|
|
@@ -13733,7 +13734,8 @@ var Countdown = React60.forwardRef(
|
|
|
13733
13734
|
seconds = 0,
|
|
13734
13735
|
showDays = true,
|
|
13735
13736
|
showSeconds = true,
|
|
13736
|
-
label
|
|
13737
|
+
label,
|
|
13738
|
+
labels
|
|
13737
13739
|
} = _b, rest = __objRest(_b, [
|
|
13738
13740
|
"layout",
|
|
13739
13741
|
"days",
|
|
@@ -13742,23 +13744,33 @@ var Countdown = React60.forwardRef(
|
|
|
13742
13744
|
"seconds",
|
|
13743
13745
|
"showDays",
|
|
13744
13746
|
"showSeconds",
|
|
13745
|
-
"label"
|
|
13747
|
+
"label",
|
|
13748
|
+
"labels"
|
|
13746
13749
|
]);
|
|
13747
13750
|
const theme2 = useTheme();
|
|
13748
13751
|
const { countdown } = theme2.tokens.components;
|
|
13749
13752
|
const { countdownItem } = countdown;
|
|
13753
|
+
const unitLabels = __spreadValues(__spreadValues({}, DEFAULT_UNIT_LABELS), labels);
|
|
13750
13754
|
const units = [
|
|
13751
13755
|
showDays && {
|
|
13752
13756
|
key: "days",
|
|
13753
13757
|
value: days,
|
|
13754
|
-
label:
|
|
13758
|
+
label: resolveLabel(unitLabels.days, days)
|
|
13759
|
+
},
|
|
13760
|
+
{
|
|
13761
|
+
key: "hours",
|
|
13762
|
+
value: hours,
|
|
13763
|
+
label: resolveLabel(unitLabels.hours, hours)
|
|
13764
|
+
},
|
|
13765
|
+
{
|
|
13766
|
+
key: "minutes",
|
|
13767
|
+
value: minutes,
|
|
13768
|
+
label: resolveLabel(unitLabels.minutes, minutes)
|
|
13755
13769
|
},
|
|
13756
|
-
{ key: "hours", value: hours, label: UNIT_LABELS.hours },
|
|
13757
|
-
{ key: "minutes", value: minutes, label: UNIT_LABELS.minutes },
|
|
13758
13770
|
showSeconds && {
|
|
13759
13771
|
key: "seconds",
|
|
13760
13772
|
value: seconds,
|
|
13761
|
-
label:
|
|
13773
|
+
label: resolveLabel(unitLabels.seconds, seconds)
|
|
13762
13774
|
}
|
|
13763
13775
|
].filter(Boolean);
|
|
13764
13776
|
const colon = (key) => /* @__PURE__ */ jsx(
|
|
@@ -14132,36 +14144,47 @@ var ProductListingCardWithBadgeAndGrid = Object.assign(_ProductListingCard, {
|
|
|
14132
14144
|
Badge: Badge2,
|
|
14133
14145
|
Grid
|
|
14134
14146
|
});
|
|
14135
|
-
var StyledCardContainer = styled60(View)(({
|
|
14147
|
+
var StyledCardContainer = styled60(View)(({
|
|
14148
|
+
theme: theme2,
|
|
14149
|
+
borderless
|
|
14150
|
+
}) => {
|
|
14136
14151
|
const { spacing, borderRadius } = theme2.tokens.semantics.dimensions;
|
|
14137
14152
|
const { colour } = theme2.tokens.semantics;
|
|
14138
14153
|
const spacingMd = parseTokenValue8(spacing.md);
|
|
14139
14154
|
const spacingXl = parseTokenValue8(spacing.xl);
|
|
14140
|
-
return {
|
|
14155
|
+
return __spreadProps(__spreadValues({
|
|
14141
14156
|
flexDirection: "row",
|
|
14142
14157
|
width: "100%",
|
|
14143
|
-
height: "100%",
|
|
14158
|
+
height: borderless ? void 0 : "100%",
|
|
14144
14159
|
maxHeight: spacingXl * 6 + spacingMd,
|
|
14145
|
-
backgroundColor: colour.background.surface.default
|
|
14160
|
+
backgroundColor: colour.background.surface.default
|
|
14161
|
+
}, borderless ? {} : {
|
|
14146
14162
|
borderWidth: 1,
|
|
14147
14163
|
borderColor: colour.border.default,
|
|
14148
|
-
borderRadius: parseTokenValue8(borderRadius.md),
|
|
14149
|
-
overflow: "hidden",
|
|
14150
14164
|
shadowColor: "#522a10",
|
|
14151
14165
|
shadowOffset: { width: 0, height: spacingMd / 4 },
|
|
14152
14166
|
shadowOpacity: 0.05,
|
|
14153
14167
|
shadowRadius: spacingXl - 4,
|
|
14154
|
-
elevation: 5
|
|
14168
|
+
elevation: 5
|
|
14169
|
+
}), {
|
|
14170
|
+
borderRadius: parseTokenValue8(borderRadius.md),
|
|
14171
|
+
overflow: "hidden",
|
|
14155
14172
|
zIndex: 1
|
|
14156
|
-
};
|
|
14173
|
+
});
|
|
14157
14174
|
});
|
|
14158
14175
|
var StyledImage3 = styled60(View)(
|
|
14159
|
-
({
|
|
14176
|
+
({
|
|
14177
|
+
theme: theme2,
|
|
14178
|
+
imageBackgroundColor,
|
|
14179
|
+
thumbnailWidth = 100,
|
|
14180
|
+
thumbnailBackgroundColor
|
|
14181
|
+
}) => ({
|
|
14160
14182
|
flexShrink: 0,
|
|
14161
|
-
backgroundColor: imageBackgroundColor || theme2.tokens.semantics.colour.background.container.secondary,
|
|
14183
|
+
backgroundColor: thumbnailBackgroundColor || imageBackgroundColor || theme2.tokens.semantics.colour.background.container.secondary,
|
|
14162
14184
|
overflow: "hidden",
|
|
14163
14185
|
aspectRatio: "1 / 1",
|
|
14164
|
-
|
|
14186
|
+
width: thumbnailWidth,
|
|
14187
|
+
height: thumbnailWidth,
|
|
14165
14188
|
position: "relative"
|
|
14166
14189
|
})
|
|
14167
14190
|
);
|
|
@@ -14183,12 +14206,16 @@ var StyledQuantityBadge = styled60(View)(({ theme: theme2 }) => {
|
|
|
14183
14206
|
zIndex: 2
|
|
14184
14207
|
};
|
|
14185
14208
|
});
|
|
14186
|
-
var StyledContentArea = styled60(View)(({
|
|
14209
|
+
var StyledContentArea = styled60(View)(({
|
|
14210
|
+
theme: theme2,
|
|
14211
|
+
borderless
|
|
14212
|
+
}) => {
|
|
14187
14213
|
const { spacing } = theme2.tokens.semantics.dimensions;
|
|
14214
|
+
const paddingValue = parseTokenValue8(spacing.md);
|
|
14188
14215
|
return {
|
|
14189
14216
|
flex: 1,
|
|
14190
|
-
paddingHorizontal:
|
|
14191
|
-
paddingVertical:
|
|
14217
|
+
paddingHorizontal: paddingValue,
|
|
14218
|
+
paddingVertical: borderless ? 0 : paddingValue,
|
|
14192
14219
|
gap: parseTokenValue8(spacing.xs),
|
|
14193
14220
|
justifyContent: "space-between"
|
|
14194
14221
|
};
|
|
@@ -14220,7 +14247,6 @@ var StyledNotification = styled60(Notification)(({ theme: theme2 }) => {
|
|
|
14220
14247
|
var ProductDisplayCard = React60.forwardRef(
|
|
14221
14248
|
(_a, ref) => {
|
|
14222
14249
|
var _b = _a, {
|
|
14223
|
-
device = "mobile",
|
|
14224
14250
|
title,
|
|
14225
14251
|
subtext,
|
|
14226
14252
|
showSubtext = true,
|
|
@@ -14235,13 +14261,15 @@ var ProductDisplayCard = React60.forwardRef(
|
|
|
14235
14261
|
decrementDisabled = false,
|
|
14236
14262
|
image,
|
|
14237
14263
|
imageBackgroundColor,
|
|
14264
|
+
thumbnailWidth,
|
|
14265
|
+
thumbnailBackgroundColor,
|
|
14238
14266
|
showImageQuantityBadge = false,
|
|
14267
|
+
borderless = false,
|
|
14239
14268
|
banner,
|
|
14240
14269
|
showBanner = false,
|
|
14241
14270
|
bannerType = "info",
|
|
14242
14271
|
showBannerIcon = false
|
|
14243
14272
|
} = _b, rest = __objRest(_b, [
|
|
14244
|
-
"device",
|
|
14245
14273
|
"title",
|
|
14246
14274
|
"subtext",
|
|
14247
14275
|
"showSubtext",
|
|
@@ -14256,7 +14284,10 @@ var ProductDisplayCard = React60.forwardRef(
|
|
|
14256
14284
|
"decrementDisabled",
|
|
14257
14285
|
"image",
|
|
14258
14286
|
"imageBackgroundColor",
|
|
14287
|
+
"thumbnailWidth",
|
|
14288
|
+
"thumbnailBackgroundColor",
|
|
14259
14289
|
"showImageQuantityBadge",
|
|
14290
|
+
"borderless",
|
|
14260
14291
|
"banner",
|
|
14261
14292
|
"showBanner",
|
|
14262
14293
|
"bannerType",
|
|
@@ -14267,20 +14298,28 @@ var ProductDisplayCard = React60.forwardRef(
|
|
|
14267
14298
|
onQuantityChange == null ? void 0 : onQuantityChange(newQuantity);
|
|
14268
14299
|
}
|
|
14269
14300
|
};
|
|
14270
|
-
const cardContent = /* @__PURE__ */ jsxs(StyledCardContainer, __spreadProps(__spreadValues({ ref,
|
|
14271
|
-
image && /* @__PURE__ */ jsxs(
|
|
14272
|
-
|
|
14273
|
-
|
|
14274
|
-
|
|
14275
|
-
|
|
14276
|
-
|
|
14277
|
-
|
|
14278
|
-
|
|
14279
|
-
|
|
14280
|
-
|
|
14281
|
-
|
|
14301
|
+
const cardContent = /* @__PURE__ */ jsxs(StyledCardContainer, __spreadProps(__spreadValues({ ref, borderless }, rest), { children: [
|
|
14302
|
+
image && /* @__PURE__ */ jsxs(
|
|
14303
|
+
StyledImage3,
|
|
14304
|
+
{
|
|
14305
|
+
imageBackgroundColor,
|
|
14306
|
+
thumbnailWidth,
|
|
14307
|
+
thumbnailBackgroundColor,
|
|
14308
|
+
children: [
|
|
14309
|
+
typeof image === "string" ? /* @__PURE__ */ jsx(
|
|
14310
|
+
Image,
|
|
14311
|
+
{
|
|
14312
|
+
source: { uri: image },
|
|
14313
|
+
style: { width: "100%", height: "100%" }
|
|
14314
|
+
}
|
|
14315
|
+
) : image,
|
|
14316
|
+
showImageQuantityBadge && quantity && /* @__PURE__ */ jsx(StyledQuantityBadge, { children: /* @__PURE__ */ jsx(Typography, { variant: "body", size: "sm", weight: "bold", children: quantity }) })
|
|
14317
|
+
]
|
|
14318
|
+
}
|
|
14319
|
+
),
|
|
14320
|
+
/* @__PURE__ */ jsxs(StyledContentArea, { borderless, children: [
|
|
14282
14321
|
/* @__PURE__ */ jsxs(StyledTextContainer, { children: [
|
|
14283
|
-
/* @__PURE__ */ jsx(Typography, { variant: "heading", size: "
|
|
14322
|
+
/* @__PURE__ */ jsx(Typography, { variant: "heading", size: "2xs", color: "primary", children: title }),
|
|
14284
14323
|
showSubtext && subtext && /* @__PURE__ */ jsx(Typography, { variant: "body", size: "sm", color: "secondary", children: subtext })
|
|
14285
14324
|
] }),
|
|
14286
14325
|
showQuantityPicker && /* @__PURE__ */ jsx(View, { style: { marginLeft: "auto" }, children: /* @__PURE__ */ jsx(
|