@butternutbox/pawprint-native 0.7.0 → 0.8.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.cts CHANGED
@@ -2154,6 +2154,8 @@ type TabNavigationListProps = TabNavigationListOwnProps & Omit<ViewProps, keyof
2154
2154
  type TabNavigationTabOwnProps = {
2155
2155
  value: string;
2156
2156
  disabled?: boolean;
2157
+ icon?: PawprintIcon;
2158
+ avatar?: AvatarProps;
2157
2159
  children: React.ReactNode;
2158
2160
  };
2159
2161
  type TabNavigationTabProps = TabNavigationTabOwnProps & Omit<ViewProps, keyof TabNavigationTabOwnProps>;
@@ -2179,8 +2181,14 @@ declare const TabNavigationList: React.ForwardRefExoticComponent<TabNavigationLi
2179
2181
  * disabled state). Unlike the web version there are no hover or focus-visible
2180
2182
  * states (not applicable on mobile).
2181
2183
  *
2184
+ * Optionally renders a leading `Avatar` and/or `Icon` before the label, matching
2185
+ * the Figma design. The icon colour tracks the tab's label colour (brand when
2186
+ * active/idle, muted when disabled); the avatar is rendered as-is from its props.
2187
+ *
2182
2188
  * @param {string} value - Unique identifier; matches the `value` of a `TabNavigation.Panel`.
2183
2189
  * @param {boolean} [disabled=false] - Whether this tab is disabled.
2190
+ * @param {PawprintIcon} [icon] - Optional leading icon from `@butternutbox/pawprint-icons`.
2191
+ * @param {AvatarProps} [avatar] - Optional leading `Avatar`; props are forwarded to the `Avatar` atom.
2184
2192
  * @param {React.ReactNode} children - Tab label (and optional leading content).
2185
2193
  */
2186
2194
  declare const TabNavigationTab: React.ForwardRefExoticComponent<TabNavigationTabOwnProps & Omit<ViewProps, keyof TabNavigationTabOwnProps> & React.RefAttributes<View>>;
package/dist/index.d.ts CHANGED
@@ -2154,6 +2154,8 @@ type TabNavigationListProps = TabNavigationListOwnProps & Omit<ViewProps, keyof
2154
2154
  type TabNavigationTabOwnProps = {
2155
2155
  value: string;
2156
2156
  disabled?: boolean;
2157
+ icon?: PawprintIcon;
2158
+ avatar?: AvatarProps;
2157
2159
  children: React.ReactNode;
2158
2160
  };
2159
2161
  type TabNavigationTabProps = TabNavigationTabOwnProps & Omit<ViewProps, keyof TabNavigationTabOwnProps>;
@@ -2179,8 +2181,14 @@ declare const TabNavigationList: React.ForwardRefExoticComponent<TabNavigationLi
2179
2181
  * disabled state). Unlike the web version there are no hover or focus-visible
2180
2182
  * states (not applicable on mobile).
2181
2183
  *
2184
+ * Optionally renders a leading `Avatar` and/or `Icon` before the label, matching
2185
+ * the Figma design. The icon colour tracks the tab's label colour (brand when
2186
+ * active/idle, muted when disabled); the avatar is rendered as-is from its props.
2187
+ *
2182
2188
  * @param {string} value - Unique identifier; matches the `value` of a `TabNavigation.Panel`.
2183
2189
  * @param {boolean} [disabled=false] - Whether this tab is disabled.
2190
+ * @param {PawprintIcon} [icon] - Optional leading icon from `@butternutbox/pawprint-icons`.
2191
+ * @param {AvatarProps} [avatar] - Optional leading `Avatar`; props are forwarded to the `Avatar` atom.
2184
2192
  * @param {React.ReactNode} children - Tab label (and optional leading content).
2185
2193
  */
2186
2194
  declare const TabNavigationTab: React.ForwardRefExoticComponent<TabNavigationTabOwnProps & Omit<ViewProps, keyof TabNavigationTabOwnProps> & React.RefAttributes<View>>;
package/dist/index.js CHANGED
@@ -7847,7 +7847,9 @@ var StyledThumb = styled51(Animated.View)(({ thumbSize, thumbBgColor }) => ({
7847
7847
  position: "absolute"
7848
7848
  }));
7849
7849
  var StyledContent = styled51(View)(({ contentGap }) => ({
7850
- gap: contentGap
7850
+ gap: contentGap,
7851
+ flex: 1,
7852
+ minWidth: 0
7851
7853
  }));
7852
7854
  var Switch = React60.forwardRef(
7853
7855
  (_a, ref) => {
@@ -12659,7 +12661,7 @@ var Notification = React60.forwardRef(
12659
12661
  if (variant === "system") {
12660
12662
  const isLarge = size === "lg";
12661
12663
  const sizeTokens = isLarge ? systemNotifications.notification.spacing.large : systemNotifications.notification.spacing.small;
12662
- return /* @__PURE__ */ jsxs(
12664
+ return /* @__PURE__ */ jsx(
12663
12665
  StyledSystemRoot,
12664
12666
  __spreadProps(__spreadValues({
12665
12667
  ref,
@@ -12672,7 +12674,7 @@ var Notification = React60.forwardRef(
12672
12674
  rootBgColor: bgMap[type],
12673
12675
  rootAlignCenter: isLarge
12674
12676
  }, rest), {
12675
- children: [
12677
+ children: /* @__PURE__ */ jsxs(View, { style: { flexDirection: "column", flex: 1 }, children: [
12676
12678
  showIcon && /* @__PURE__ */ jsx(
12677
12679
  Icon,
12678
12680
  {
@@ -12682,27 +12684,31 @@ var Notification = React60.forwardRef(
12682
12684
  "aria-label": type
12683
12685
  }
12684
12686
  ),
12685
- /* @__PURE__ */ jsxs(View, { style: { flexDirection: "column", gap: 8, flex: 1 }, children: [
12686
- /* @__PURE__ */ jsx(
12687
- Typography,
12688
- {
12689
- token: systemNotifications.notifications.typography.default,
12690
- color: systemNotifications.notification.colour.text.default,
12691
- children
12692
- }
12693
- ),
12694
- link && /* @__PURE__ */ jsx(
12695
- Link,
12696
- {
12697
- href: link.href,
12698
- onPress: link.onPress,
12699
- weight: "semiBold",
12700
- size: "md",
12701
- children: link.label
12702
- }
12703
- )
12704
- ] })
12705
- ]
12687
+ /* @__PURE__ */ jsx(View, { style: { flexDirection: "column", gap: 8, flex: 1 }, children: /* @__PURE__ */ jsx(
12688
+ Typography,
12689
+ {
12690
+ token: systemNotifications.notifications.typography.default,
12691
+ color: systemNotifications.notification.colour.text.default,
12692
+ children
12693
+ }
12694
+ ) }),
12695
+ link && /* @__PURE__ */ jsx(
12696
+ StyledLinkWrapper,
12697
+ {
12698
+ linkPaddingLeft: parseTokenValue49(sizeTokens.content.gap),
12699
+ children: /* @__PURE__ */ jsx(
12700
+ Link,
12701
+ {
12702
+ href: link.href,
12703
+ onPress: link.onPress,
12704
+ weight: "semiBold",
12705
+ size: "md",
12706
+ children: link.label
12707
+ }
12708
+ )
12709
+ }
12710
+ )
12711
+ ] })
12706
12712
  })
12707
12713
  );
12708
12714
  }
@@ -12795,59 +12801,57 @@ var Notification = React60.forwardRef(
12795
12801
  rootBgColor: bgMap[type]
12796
12802
  }, rest), {
12797
12803
  children: [
12798
- /* @__PURE__ */ jsxs(StyledContents, { contentsGap: parseTokenValue49(content.spacing.gap), children: [
12799
- /* @__PURE__ */ jsxs(StyledCopyRow, { copyGap: parseTokenValue49(content.spacing.gap), children: [
12800
- showIcon && /* @__PURE__ */ jsx(
12801
- Icon,
12802
- {
12803
- icon: IconComponent,
12804
- size: "md",
12805
- colour: type,
12806
- "aria-label": type
12807
- }
12808
- ),
12809
- /* @__PURE__ */ jsxs(
12810
- StyledInlineCopy,
12811
- {
12812
- copyGap: parseTokenValue49(content.copy.spacing.gap),
12813
- children: [
12814
- title && /* @__PURE__ */ jsx(
12815
- Typography,
12816
- {
12817
- token: notifications.typography.title,
12818
- color: colour.text.title,
12819
- children: title
12820
- }
12821
- ),
12822
- /* @__PURE__ */ jsx(
12823
- Typography,
12824
- {
12825
- token: notifications.typography.body,
12826
- color: colour.text.body,
12827
- children
12828
- }
12829
- )
12830
- ]
12831
- }
12832
- )
12833
- ] }),
12834
- link && /* @__PURE__ */ jsx(
12835
- StyledLinkWrapper,
12804
+ /* @__PURE__ */ jsx(StyledContents, { contentsGap: parseTokenValue49(content.spacing.gap), children: /* @__PURE__ */ jsxs(StyledCopyRow, { copyGap: parseTokenValue49(content.spacing.gap), children: [
12805
+ showIcon && /* @__PURE__ */ jsx(
12806
+ Icon,
12836
12807
  {
12837
- linkPaddingLeft: parseTokenValue49(content.copy.spacing.gap),
12838
- children: /* @__PURE__ */ jsx(
12839
- Link,
12840
- {
12841
- href: link.href,
12842
- onPress: link.onPress,
12843
- weight: "semiBold",
12844
- size: "md",
12845
- children: link.label
12846
- }
12847
- )
12808
+ icon: IconComponent,
12809
+ size: "md",
12810
+ colour: type,
12811
+ "aria-label": type
12812
+ }
12813
+ ),
12814
+ /* @__PURE__ */ jsxs(
12815
+ StyledInlineCopy,
12816
+ {
12817
+ copyGap: parseTokenValue49(content.copy.spacing.gap),
12818
+ children: [
12819
+ title && /* @__PURE__ */ jsx(
12820
+ Typography,
12821
+ {
12822
+ token: notifications.typography.title,
12823
+ color: colour.text.title,
12824
+ children: title
12825
+ }
12826
+ ),
12827
+ /* @__PURE__ */ jsx(
12828
+ Typography,
12829
+ {
12830
+ token: notifications.typography.body,
12831
+ color: colour.text.body,
12832
+ children
12833
+ }
12834
+ ),
12835
+ link && /* @__PURE__ */ jsx(
12836
+ StyledLinkWrapper,
12837
+ {
12838
+ linkPaddingLeft: parseTokenValue49(content.copy.spacing.gap),
12839
+ children: /* @__PURE__ */ jsx(
12840
+ Link,
12841
+ {
12842
+ href: link.href,
12843
+ onPress: link.onPress,
12844
+ weight: "semiBold",
12845
+ size: "md",
12846
+ children: link.label
12847
+ }
12848
+ )
12849
+ }
12850
+ )
12851
+ ]
12848
12852
  }
12849
12853
  )
12850
- ] }),
12854
+ ] }) }),
12851
12855
  onClose && /* @__PURE__ */ jsx(
12852
12856
  StyledCloseButton,
12853
12857
  {
@@ -14749,7 +14753,7 @@ var TabNavigationList = React60.forwardRef(
14749
14753
  TabNavigationList.displayName = "TabNavigation.List";
14750
14754
  var TabNavigationTab = React60.forwardRef(
14751
14755
  (_a, ref) => {
14752
- var _b = _a, { value, disabled = false, children } = _b, rest = __objRest(_b, ["value", "disabled", "children"]);
14756
+ var _b = _a, { value, disabled = false, icon, avatar, children } = _b, rest = __objRest(_b, ["value", "disabled", "icon", "avatar", "children"]);
14753
14757
  const { layout } = useTabNavigationContext();
14754
14758
  const { value: selectedValue } = TabsPrimitive.useRootContext();
14755
14759
  const theme2 = useTheme();
@@ -14759,7 +14763,7 @@ var TabNavigationTab = React60.forwardRef(
14759
14763
  const token = selected ? typography.selected : typography.default;
14760
14764
  const borderColour = selected ? colour.border.default : colour.border.disabled;
14761
14765
  const textColour = disabled ? theme2.tokens.primitives.colour.brand.brown["5"] : colour.text.default;
14762
- return /* @__PURE__ */ jsx(TabsPrimitive.Trigger, { value, disabled, asChild: true, children: /* @__PURE__ */ jsx(
14766
+ return /* @__PURE__ */ jsx(TabsPrimitive.Trigger, { value, disabled, asChild: true, children: /* @__PURE__ */ jsxs(
14763
14767
  StyledTab,
14764
14768
  __spreadProps(__spreadValues({
14765
14769
  ref,
@@ -14773,7 +14777,11 @@ var TabNavigationTab = React60.forwardRef(
14773
14777
  tabBorderColor: borderColour,
14774
14778
  tabFlex: layout === "fixed" ? 1 : void 0
14775
14779
  }, rest), {
14776
- children: /* @__PURE__ */ jsx(Typography, { token, color: textColour, children })
14780
+ children: [
14781
+ avatar && /* @__PURE__ */ jsx(Avatar, __spreadValues({}, avatar)),
14782
+ icon && /* @__PURE__ */ jsx(Icon, { icon, customColour: textColour, "aria-hidden": true }),
14783
+ /* @__PURE__ */ jsx(Typography, { token, color: textColour, children })
14784
+ ]
14777
14785
  })
14778
14786
  ) });
14779
14787
  }