@butternutbox/pawprint-native 0.5.1 → 0.6.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 +11 -0
- package/dist/index.cjs +94 -44
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -4
- package/dist/index.d.ts +14 -4
- package/dist/index.js +94 -44
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/ButtonDock/ButtonDock.tsx +10 -4
- package/src/components/molecules/Notification/Notification.tsx +36 -10
- package/src/components/molecules/Radio/Radio.stories.tsx +46 -0
- package/src/components/molecules/Radio/Radio.test.tsx +18 -0
- package/src/components/molecules/Radio/Radio.tsx +19 -1
package/dist/index.d.cts
CHANGED
|
@@ -1346,6 +1346,7 @@ type RadioOwnProps = {
|
|
|
1346
1346
|
label?: React.ReactNode;
|
|
1347
1347
|
subText?: React.ReactNode;
|
|
1348
1348
|
asset?: IllustrationProps;
|
|
1349
|
+
tag?: TagProps;
|
|
1349
1350
|
disabled?: boolean;
|
|
1350
1351
|
selected?: boolean;
|
|
1351
1352
|
onSelect?: (value: string) => void;
|
|
@@ -1359,6 +1360,7 @@ type RadioProps = RadioOwnProps & Omit<PressableProps, keyof RadioOwnProps | "ch
|
|
|
1359
1360
|
* @param {React.ReactNode} [label] - Main label text or content.
|
|
1360
1361
|
* @param {React.ReactNode} [subText] - Optional descriptive subtext.
|
|
1361
1362
|
* @param {IllustrationProps} [asset] - Optional illustration asset for tile variant.
|
|
1363
|
+
* @param {TagProps} [tag] - Optional tag rendered below the label/subtext. Accepts the full Tag API (variant, icon, size). Hidden when omitted.
|
|
1362
1364
|
* @param {boolean} [disabled=false] - Whether the radio is disabled.
|
|
1363
1365
|
* @param {boolean} [selected=false] - Whether the radio is currently selected.
|
|
1364
1366
|
* @param {(value: string) => void} [onSelect] - Callback when radio is selected.
|
|
@@ -1614,7 +1616,11 @@ type InlineVariantProps = BaseProps & {
|
|
|
1614
1616
|
title?: string;
|
|
1615
1617
|
onClose?: () => void;
|
|
1616
1618
|
size?: never;
|
|
1617
|
-
link?:
|
|
1619
|
+
link?: {
|
|
1620
|
+
label: string;
|
|
1621
|
+
href?: string;
|
|
1622
|
+
onPress?: () => void;
|
|
1623
|
+
};
|
|
1618
1624
|
};
|
|
1619
1625
|
type ToastVariantProps = BaseProps & {
|
|
1620
1626
|
variant: "toast";
|
|
@@ -1632,7 +1638,11 @@ type SystemVariantProps = BaseProps & {
|
|
|
1632
1638
|
size?: NotificationSize;
|
|
1633
1639
|
title?: never;
|
|
1634
1640
|
onClose?: never;
|
|
1635
|
-
link?:
|
|
1641
|
+
link?: {
|
|
1642
|
+
label: string;
|
|
1643
|
+
href?: string;
|
|
1644
|
+
onPress?: () => void;
|
|
1645
|
+
};
|
|
1636
1646
|
};
|
|
1637
1647
|
type NotificationOwnProps = InlineVariantProps | ToastVariantProps | SystemVariantProps;
|
|
1638
1648
|
type NotificationProps = NotificationOwnProps & Omit<ViewProps, keyof NotificationOwnProps>;
|
|
@@ -1641,7 +1651,7 @@ type NotificationProps = NotificationOwnProps & Omit<ViewProps, keyof Notificati
|
|
|
1641
1651
|
* variants — inline (within content flow), toast (floating overlay), and
|
|
1642
1652
|
* system (full-width banner) — each with four severity types.
|
|
1643
1653
|
*
|
|
1644
|
-
* Note: Unlike the web version,
|
|
1654
|
+
* Note: Unlike the web version, links use `onPress` callback instead
|
|
1645
1655
|
* of `href` for navigation. The `href` prop is also available and opens
|
|
1646
1656
|
* the URL via `Linking`.
|
|
1647
1657
|
*
|
|
@@ -1650,7 +1660,7 @@ type NotificationProps = NotificationOwnProps & Omit<ViewProps, keyof Notificati
|
|
|
1650
1660
|
* @param {boolean} [showIcon=true] - Whether to show the status icon.
|
|
1651
1661
|
* @param {string} [title] - Optional headline (inline variant only).
|
|
1652
1662
|
* @param {() => void} [onClose] - Close callback (inline and toast variants).
|
|
1653
|
-
* @param {{ label: string; href?: string; onPress?: () => void }} [link] - Optional action link (
|
|
1663
|
+
* @param {{ label: string; href?: string; onPress?: () => void }} [link] - Optional action link (all variants).
|
|
1654
1664
|
* @param {"sm" | "lg"} [size="sm"] - Size variant (system variant only).
|
|
1655
1665
|
* @param {React.ReactNode} children - The notification body text.
|
|
1656
1666
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -1346,6 +1346,7 @@ type RadioOwnProps = {
|
|
|
1346
1346
|
label?: React.ReactNode;
|
|
1347
1347
|
subText?: React.ReactNode;
|
|
1348
1348
|
asset?: IllustrationProps;
|
|
1349
|
+
tag?: TagProps;
|
|
1349
1350
|
disabled?: boolean;
|
|
1350
1351
|
selected?: boolean;
|
|
1351
1352
|
onSelect?: (value: string) => void;
|
|
@@ -1359,6 +1360,7 @@ type RadioProps = RadioOwnProps & Omit<PressableProps, keyof RadioOwnProps | "ch
|
|
|
1359
1360
|
* @param {React.ReactNode} [label] - Main label text or content.
|
|
1360
1361
|
* @param {React.ReactNode} [subText] - Optional descriptive subtext.
|
|
1361
1362
|
* @param {IllustrationProps} [asset] - Optional illustration asset for tile variant.
|
|
1363
|
+
* @param {TagProps} [tag] - Optional tag rendered below the label/subtext. Accepts the full Tag API (variant, icon, size). Hidden when omitted.
|
|
1362
1364
|
* @param {boolean} [disabled=false] - Whether the radio is disabled.
|
|
1363
1365
|
* @param {boolean} [selected=false] - Whether the radio is currently selected.
|
|
1364
1366
|
* @param {(value: string) => void} [onSelect] - Callback when radio is selected.
|
|
@@ -1614,7 +1616,11 @@ type InlineVariantProps = BaseProps & {
|
|
|
1614
1616
|
title?: string;
|
|
1615
1617
|
onClose?: () => void;
|
|
1616
1618
|
size?: never;
|
|
1617
|
-
link?:
|
|
1619
|
+
link?: {
|
|
1620
|
+
label: string;
|
|
1621
|
+
href?: string;
|
|
1622
|
+
onPress?: () => void;
|
|
1623
|
+
};
|
|
1618
1624
|
};
|
|
1619
1625
|
type ToastVariantProps = BaseProps & {
|
|
1620
1626
|
variant: "toast";
|
|
@@ -1632,7 +1638,11 @@ type SystemVariantProps = BaseProps & {
|
|
|
1632
1638
|
size?: NotificationSize;
|
|
1633
1639
|
title?: never;
|
|
1634
1640
|
onClose?: never;
|
|
1635
|
-
link?:
|
|
1641
|
+
link?: {
|
|
1642
|
+
label: string;
|
|
1643
|
+
href?: string;
|
|
1644
|
+
onPress?: () => void;
|
|
1645
|
+
};
|
|
1636
1646
|
};
|
|
1637
1647
|
type NotificationOwnProps = InlineVariantProps | ToastVariantProps | SystemVariantProps;
|
|
1638
1648
|
type NotificationProps = NotificationOwnProps & Omit<ViewProps, keyof NotificationOwnProps>;
|
|
@@ -1641,7 +1651,7 @@ type NotificationProps = NotificationOwnProps & Omit<ViewProps, keyof Notificati
|
|
|
1641
1651
|
* variants — inline (within content flow), toast (floating overlay), and
|
|
1642
1652
|
* system (full-width banner) — each with four severity types.
|
|
1643
1653
|
*
|
|
1644
|
-
* Note: Unlike the web version,
|
|
1654
|
+
* Note: Unlike the web version, links use `onPress` callback instead
|
|
1645
1655
|
* of `href` for navigation. The `href` prop is also available and opens
|
|
1646
1656
|
* the URL via `Linking`.
|
|
1647
1657
|
*
|
|
@@ -1650,7 +1660,7 @@ type NotificationProps = NotificationOwnProps & Omit<ViewProps, keyof Notificati
|
|
|
1650
1660
|
* @param {boolean} [showIcon=true] - Whether to show the status icon.
|
|
1651
1661
|
* @param {string} [title] - Optional headline (inline variant only).
|
|
1652
1662
|
* @param {() => void} [onClose] - Close callback (inline and toast variants).
|
|
1653
|
-
* @param {{ label: string; href?: string; onPress?: () => void }} [link] - Optional action link (
|
|
1663
|
+
* @param {{ label: string; href?: string; onPress?: () => void }} [link] - Optional action link (all variants).
|
|
1654
1664
|
* @param {"sm" | "lg"} [size="sm"] - Size variant (system variant only).
|
|
1655
1665
|
* @param {React.ReactNode} children - The notification body text.
|
|
1656
1666
|
*
|
package/dist/index.js
CHANGED
|
@@ -9457,7 +9457,8 @@ var StyledDockRoot = styled60(View)(
|
|
|
9457
9457
|
dockBgColor,
|
|
9458
9458
|
dockBorderTopWidth,
|
|
9459
9459
|
dockBorderTopColor,
|
|
9460
|
-
dockPaddingVertical
|
|
9460
|
+
dockPaddingVertical,
|
|
9461
|
+
dockPaddingHorizontal
|
|
9461
9462
|
}) => ({
|
|
9462
9463
|
alignItems: "center",
|
|
9463
9464
|
justifyContent: "center",
|
|
@@ -9465,7 +9466,8 @@ var StyledDockRoot = styled60(View)(
|
|
|
9465
9466
|
backgroundColor: dockBgColor,
|
|
9466
9467
|
borderTopWidth: dockBorderTopWidth,
|
|
9467
9468
|
borderTopColor: dockBorderTopColor,
|
|
9468
|
-
paddingVertical: dockPaddingVertical
|
|
9469
|
+
paddingVertical: dockPaddingVertical,
|
|
9470
|
+
paddingHorizontal: dockPaddingHorizontal
|
|
9469
9471
|
})
|
|
9470
9472
|
);
|
|
9471
9473
|
var StyledStackedInner = styled60(View)(
|
|
@@ -9502,6 +9504,9 @@ var ButtonDock = React60.forwardRef(
|
|
|
9502
9504
|
dockBorderTopColor: buttonDock.colour.border,
|
|
9503
9505
|
dockPaddingVertical: parseTokenValue28(
|
|
9504
9506
|
buttonDock.spacing[variant].mobile.topPadding
|
|
9507
|
+
),
|
|
9508
|
+
dockPaddingHorizontal: parseTokenValue28(
|
|
9509
|
+
buttonDock.spacing[variant].mobile.horizontalPadding
|
|
9505
9510
|
)
|
|
9506
9511
|
}, rest), {
|
|
9507
9512
|
children: isStacked ? /* @__PURE__ */ jsxs(
|
|
@@ -9536,7 +9541,7 @@ var ButtonDock = React60.forwardRef(
|
|
|
9536
9541
|
{
|
|
9537
9542
|
groupDirection: "row",
|
|
9538
9543
|
groupAlign: "center",
|
|
9539
|
-
groupJustify: "space-
|
|
9544
|
+
groupJustify: "space-between",
|
|
9540
9545
|
groupGap,
|
|
9541
9546
|
children
|
|
9542
9547
|
}
|
|
@@ -10872,6 +10877,12 @@ var StyledTextContent = styled60(View)(({ textContentGap }) => ({
|
|
|
10872
10877
|
var StyledAssetWrapper = styled60(View)({
|
|
10873
10878
|
alignSelf: "center"
|
|
10874
10879
|
});
|
|
10880
|
+
var StyledTagWrapper = styled60(View)(
|
|
10881
|
+
({ tagTopPadding }) => ({
|
|
10882
|
+
alignItems: "flex-start",
|
|
10883
|
+
paddingTop: tagTopPadding
|
|
10884
|
+
})
|
|
10885
|
+
);
|
|
10875
10886
|
var Radio = React60.forwardRef(
|
|
10876
10887
|
(_a, ref) => {
|
|
10877
10888
|
var _b = _a, {
|
|
@@ -10879,6 +10890,7 @@ var Radio = React60.forwardRef(
|
|
|
10879
10890
|
label,
|
|
10880
10891
|
subText,
|
|
10881
10892
|
asset,
|
|
10893
|
+
tag,
|
|
10882
10894
|
disabled = false,
|
|
10883
10895
|
value,
|
|
10884
10896
|
selected = false,
|
|
@@ -10889,6 +10901,7 @@ var Radio = React60.forwardRef(
|
|
|
10889
10901
|
"label",
|
|
10890
10902
|
"subText",
|
|
10891
10903
|
"asset",
|
|
10904
|
+
"tag",
|
|
10892
10905
|
"disabled",
|
|
10893
10906
|
"value",
|
|
10894
10907
|
"selected",
|
|
@@ -10943,7 +10956,7 @@ var Radio = React60.forwardRef(
|
|
|
10943
10956
|
)
|
|
10944
10957
|
}
|
|
10945
10958
|
),
|
|
10946
|
-
(label || subText) && /* @__PURE__ */ jsxs(
|
|
10959
|
+
(label || subText || tag) && /* @__PURE__ */ jsxs(
|
|
10947
10960
|
StyledTextContent,
|
|
10948
10961
|
{
|
|
10949
10962
|
textContentGap: parseTokenValue40(spacing.content.gap),
|
|
@@ -10956,6 +10969,13 @@ var Radio = React60.forwardRef(
|
|
|
10956
10969
|
color: colour.text.subtext,
|
|
10957
10970
|
children: subText
|
|
10958
10971
|
}
|
|
10972
|
+
),
|
|
10973
|
+
tag && /* @__PURE__ */ jsx(
|
|
10974
|
+
StyledTagWrapper,
|
|
10975
|
+
{
|
|
10976
|
+
tagTopPadding: parseTokenValue40(spacing.content.tag.topPadding),
|
|
10977
|
+
children: /* @__PURE__ */ jsx(Tag, __spreadValues({}, tag))
|
|
10978
|
+
}
|
|
10959
10979
|
)
|
|
10960
10980
|
]
|
|
10961
10981
|
}
|
|
@@ -12406,14 +12426,26 @@ var Notification = React60.forwardRef(
|
|
|
12406
12426
|
"aria-label": type
|
|
12407
12427
|
}
|
|
12408
12428
|
),
|
|
12409
|
-
/* @__PURE__ */
|
|
12410
|
-
|
|
12411
|
-
|
|
12412
|
-
|
|
12413
|
-
|
|
12414
|
-
|
|
12415
|
-
|
|
12416
|
-
|
|
12429
|
+
/* @__PURE__ */ jsxs(View, { style: { flexDirection: "column", gap: 8, flex: 1 }, children: [
|
|
12430
|
+
/* @__PURE__ */ jsx(
|
|
12431
|
+
Typography,
|
|
12432
|
+
{
|
|
12433
|
+
token: systemNotifications.notifications.typography.default,
|
|
12434
|
+
color: systemNotifications.notification.colour.text.default,
|
|
12435
|
+
children
|
|
12436
|
+
}
|
|
12437
|
+
),
|
|
12438
|
+
link && /* @__PURE__ */ jsx(
|
|
12439
|
+
Link,
|
|
12440
|
+
{
|
|
12441
|
+
href: link.href,
|
|
12442
|
+
onPress: link.onPress,
|
|
12443
|
+
weight: "semiBold",
|
|
12444
|
+
size: "md",
|
|
12445
|
+
children: link.label
|
|
12446
|
+
}
|
|
12447
|
+
)
|
|
12448
|
+
] })
|
|
12417
12449
|
]
|
|
12418
12450
|
})
|
|
12419
12451
|
);
|
|
@@ -12507,41 +12539,59 @@ var Notification = React60.forwardRef(
|
|
|
12507
12539
|
rootBgColor: bgMap[type]
|
|
12508
12540
|
}, rest), {
|
|
12509
12541
|
children: [
|
|
12510
|
-
/* @__PURE__ */
|
|
12511
|
-
|
|
12512
|
-
|
|
12513
|
-
|
|
12514
|
-
|
|
12515
|
-
|
|
12516
|
-
|
|
12517
|
-
|
|
12518
|
-
|
|
12519
|
-
|
|
12520
|
-
|
|
12521
|
-
|
|
12542
|
+
/* @__PURE__ */ jsxs(StyledContents, { contentsGap: parseTokenValue49(content.spacing.gap), children: [
|
|
12543
|
+
/* @__PURE__ */ jsxs(StyledCopyRow, { copyGap: parseTokenValue49(content.spacing.gap), children: [
|
|
12544
|
+
showIcon && /* @__PURE__ */ jsx(
|
|
12545
|
+
Icon,
|
|
12546
|
+
{
|
|
12547
|
+
icon: IconComponent,
|
|
12548
|
+
size: "md",
|
|
12549
|
+
colour: type,
|
|
12550
|
+
"aria-label": type
|
|
12551
|
+
}
|
|
12552
|
+
),
|
|
12553
|
+
/* @__PURE__ */ jsxs(
|
|
12554
|
+
StyledInlineCopy,
|
|
12555
|
+
{
|
|
12556
|
+
copyGap: parseTokenValue49(content.copy.spacing.gap),
|
|
12557
|
+
children: [
|
|
12558
|
+
title && /* @__PURE__ */ jsx(
|
|
12559
|
+
Typography,
|
|
12560
|
+
{
|
|
12561
|
+
token: notifications.typography.title,
|
|
12562
|
+
color: colour.text.title,
|
|
12563
|
+
children: title
|
|
12564
|
+
}
|
|
12565
|
+
),
|
|
12566
|
+
/* @__PURE__ */ jsx(
|
|
12567
|
+
Typography,
|
|
12568
|
+
{
|
|
12569
|
+
token: notifications.typography.body,
|
|
12570
|
+
color: colour.text.body,
|
|
12571
|
+
children
|
|
12572
|
+
}
|
|
12573
|
+
)
|
|
12574
|
+
]
|
|
12575
|
+
}
|
|
12576
|
+
)
|
|
12577
|
+
] }),
|
|
12578
|
+
link && /* @__PURE__ */ jsx(
|
|
12579
|
+
StyledLinkWrapper,
|
|
12522
12580
|
{
|
|
12523
|
-
|
|
12524
|
-
children:
|
|
12525
|
-
|
|
12526
|
-
|
|
12527
|
-
|
|
12528
|
-
|
|
12529
|
-
|
|
12530
|
-
|
|
12531
|
-
|
|
12532
|
-
|
|
12533
|
-
|
|
12534
|
-
Typography,
|
|
12535
|
-
{
|
|
12536
|
-
token: notifications.typography.body,
|
|
12537
|
-
color: colour.text.body,
|
|
12538
|
-
children
|
|
12539
|
-
}
|
|
12540
|
-
)
|
|
12541
|
-
]
|
|
12581
|
+
linkPaddingLeft: parseTokenValue49(content.copy.spacing.gap),
|
|
12582
|
+
children: /* @__PURE__ */ jsx(
|
|
12583
|
+
Link,
|
|
12584
|
+
{
|
|
12585
|
+
href: link.href,
|
|
12586
|
+
onPress: link.onPress,
|
|
12587
|
+
weight: "semiBold",
|
|
12588
|
+
size: "md",
|
|
12589
|
+
children: link.label
|
|
12590
|
+
}
|
|
12591
|
+
)
|
|
12542
12592
|
}
|
|
12543
12593
|
)
|
|
12544
|
-
] })
|
|
12594
|
+
] }),
|
|
12545
12595
|
onClose && /* @__PURE__ */ jsx(
|
|
12546
12596
|
StyledCloseButton,
|
|
12547
12597
|
{
|