@butternutbox/pawprint-native 0.1.0 → 0.2.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.
@@ -15,7 +15,7 @@
15
15
  ESM dist/ibm-plex-sans-condensed-700-normal-4PFYFTSO.woff2 18.90 KB
16
16
  ESM dist/index.js 1.61 MB
17
17
  ESM dist/index.js.map 2.44 MB
18
- ESM ⚡️ Build success in 10371ms
18
+ ESM ⚡️ Build success in 11141ms
19
19
  CJS dist/ida-narrow-500-normal-C6I2PK4T.woff2 47.41 KB
20
20
  CJS dist/ida-narrow-700-normal-UPHPRIN6.woff2 49.90 KB
21
21
  CJS dist/ibm-plex-sans-condensed-400-normal-I2XLJNNB.woff2 19.33 KB
@@ -24,7 +24,7 @@
24
24
  CJS dist/ibm-plex-sans-condensed-700-normal-4PFYFTSO.woff2 18.90 KB
25
25
  CJS dist/index.cjs 1.67 MB
26
26
  CJS dist/index.cjs.map 2.44 MB
27
- CJS ⚡️ Build success in 10375ms
28
- DTS ⚡️ Build success in 21699ms
29
- DTS dist/index.d.cts 76.92 KB
30
- DTS dist/index.d.ts 76.92 KB
27
+ CJS ⚡️ Build success in 11143ms
28
+ DTS ⚡️ Build success in 21900ms
29
+ DTS dist/index.d.cts 76.91 KB
30
+ DTS dist/index.d.ts 76.91 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @butternutbox/pawprint-native
2
2
 
3
+ ## 0.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - ecc629f: updates to illustraions, icons and tokens
8
+ - b237a0d: Bump versions to all be inline
9
+
10
+ ### Patch Changes
11
+
12
+ - 30f896c: add rn-primitives/select to dependencies
13
+ - Updated dependencies [ecc629f]
14
+ - Updated dependencies [b237a0d]
15
+ - @butternutbox/pawprint-tokens@0.2.0
16
+
3
17
  ## 0.1.0
4
18
 
5
19
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -4456,7 +4456,7 @@ var Illustration = React60__default.default.forwardRef(
4456
4456
  accessibilityLabel: ariaLabel,
4457
4457
  accessible: !!ariaLabel
4458
4458
  }, rest), {
4459
- children: /* @__PURE__ */ jsxRuntime.jsx(IllustrationComponent, { height: dimension })
4459
+ children: /* @__PURE__ */ jsxRuntime.jsx(IllustrationComponent, { width: dimension, height: dimension })
4460
4460
  })
4461
4461
  );
4462
4462
  }
@@ -4522,6 +4522,7 @@ ForwardRef710.category = "core";
4522
4522
  var ArrowForward = (props, ref) => /* @__PURE__ */ jsxRuntime.jsx("svg", __spreadProps2(__spreadValues2({ xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, fill: "currentColor", viewBox: "0 0 24 24", ref }, props), { children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M5 13h11.17l-4.88 4.88c-.39.39-.39 1.03 0 1.42s1.02.39 1.41 0l6.59-6.59a.996.996 0 0 0 0-1.41l-6.58-6.6a.996.996 0 1 0-1.41 1.41L16.17 11H5c-.55 0-1 .45-1 1s.45 1 1 1" }) }));
4523
4523
  var ForwardRef810 = React60.forwardRef(ArrowForward);
4524
4524
  ForwardRef810.category = "core";
4525
+ var ArrowForward_default = ForwardRef810;
4525
4526
  var ArrowLeft = (props, ref) => /* @__PURE__ */ jsxRuntime.jsx("svg", __spreadProps2(__spreadValues2({ xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, fill: "currentColor", viewBox: "0 0 24 24", ref }, props), { children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12.29 8.71 9.7 11.3a.996.996 0 0 0 0 1.41l2.59 2.59c.63.63 1.71.18 1.71-.71V9.41c0-.89-1.08-1.33-1.71-.7" }) }));
4526
4527
  var ForwardRef910 = React60.forwardRef(ArrowLeft);
4527
4528
  ForwardRef910.category = "core";
@@ -5030,11 +5031,11 @@ var Link = React60__default.default.forwardRef(
5030
5031
  }
5031
5032
  ),
5032
5033
  standalone && /* @__PURE__ */ jsxRuntime.jsx(
5033
- Typography,
5034
+ Icon,
5034
5035
  {
5035
- token: typography.link[weight][size],
5036
- color: pressed ? linkColour.hover : linkColour.default,
5037
- children: " \u2192"
5036
+ icon: ArrowForward_default,
5037
+ size: "xs",
5038
+ customColour: pressed ? linkColour.hover : linkColour.default
5038
5039
  }
5039
5040
  )
5040
5041
  ] })
@@ -7710,9 +7711,13 @@ var StyledControlTrack = styled52__default.default(reactNative.View)(
7710
7711
  minWidth: controlWidth,
7711
7712
  minHeight: controlHeight,
7712
7713
  borderRadius: controlHeight,
7713
- borderWidth: switchChecked ? 0 : controlBorderWidth,
7714
+ // Keep the border width constant and only toggle the colour. Animating
7715
+ // the width between 0 and 2 was causing a momentary background bleed on
7716
+ // Android when transitioning back to the off state.
7717
+ borderWidth: controlBorderWidth,
7714
7718
  borderColor: switchChecked ? "transparent" : controlBorderColor,
7715
7719
  backgroundColor: switchChecked ? controlBgChecked : controlBgDefault,
7720
+ overflow: "hidden",
7716
7721
  justifyContent: "center"
7717
7722
  })
7718
7723
  );
@@ -7752,9 +7757,9 @@ var Switch = React60__default.default.forwardRef(
7752
7757
  const controlHeight = parseTokenValue16(size.control.height);
7753
7758
  const thumbSize = parseTokenValue16(size.thumb.default);
7754
7759
  const borderWidthValue = parseTokenValue16(borderWidth.control.default);
7755
- const outerInset = 5;
7756
- const inset = outerInset - borderWidthValue;
7757
- const translateX = controlWidth - thumbSize - outerInset * 2;
7760
+ const inset = 2;
7761
+ const offTranslateX = inset;
7762
+ const onTranslateX = controlWidth - borderWidthValue * 2 - thumbSize - inset;
7758
7763
  const animValue = React60.useRef(new reactNative.Animated.Value(isChecked ? 1 : 0)).current;
7759
7764
  React60.useEffect(() => {
7760
7765
  reactNative.Animated.timing(animValue, {
@@ -7765,7 +7770,7 @@ var Switch = React60__default.default.forwardRef(
7765
7770
  }, [isChecked, animValue]);
7766
7771
  const thumbTranslateX = animValue.interpolate({
7767
7772
  inputRange: [0, 1],
7768
- outputRange: [inset, inset + translateX + 3]
7773
+ outputRange: [offTranslateX, onTranslateX]
7769
7774
  });
7770
7775
  const handleCheckedChange = (checked) => {
7771
7776
  if (!isControlled) {
@@ -9338,12 +9343,14 @@ var StyledDockRoot = styled52__default.default(reactNative.View)(
9338
9343
  paddingVertical: dockPaddingVertical
9339
9344
  })
9340
9345
  );
9341
- var StyledStackedInner = styled52__default.default(reactNative.View)({
9342
- alignItems: "center",
9343
- gap: 16,
9344
- width: "100%",
9345
- maxWidth: 520
9346
- });
9346
+ var StyledStackedInner = styled52__default.default(reactNative.View)(
9347
+ ({ innerGap }) => ({
9348
+ alignItems: "center",
9349
+ gap: innerGap,
9350
+ width: "100%",
9351
+ maxWidth: 520
9352
+ })
9353
+ );
9347
9354
  var StyledButtonGroup = styled52__default.default(reactNative.View)(({ groupDirection, groupAlign, groupJustify, groupGap }) => __spreadValues({
9348
9355
  flexDirection: groupDirection,
9349
9356
  alignItems: groupAlign,
@@ -9356,7 +9363,7 @@ var ButtonDock = React60__default.default.forwardRef(
9356
9363
  var _b = _a, { variant = "stacked", leadingContent, description, children } = _b, rest = __objRest(_b, ["variant", "leadingContent", "description", "children"]);
9357
9364
  const theme2 = react.useTheme();
9358
9365
  const { buttonDock, buttonGroup } = theme2.tokens.components;
9359
- const { dimensions } = theme2.tokens.semantics;
9366
+ const { dimensions, typography } = theme2.tokens.semantics;
9360
9367
  const isStacked = variant === "stacked";
9361
9368
  const groupGap = parseTokenValue28(
9362
9369
  isStacked ? buttonGroup.spacing.stacked.gap : buttonGroup.spacing.sideBySide.gap
@@ -9369,32 +9376,37 @@ var ButtonDock = React60__default.default.forwardRef(
9369
9376
  dockBorderTopWidth: parseTokenValue28(dimensions.borderWidth.sm),
9370
9377
  dockBorderTopColor: buttonDock.colour.border,
9371
9378
  dockPaddingVertical: parseTokenValue28(
9372
- buttonDock.spacing[variant].desktop.verticalPadding
9379
+ buttonDock.spacing[variant].mobile.topPadding
9373
9380
  )
9374
9381
  }, rest), {
9375
- children: isStacked ? /* @__PURE__ */ jsxRuntime.jsxs(StyledStackedInner, { children: [
9376
- leadingContent,
9377
- /* @__PURE__ */ jsxRuntime.jsx(
9378
- StyledButtonGroup,
9379
- {
9380
- groupDirection: "column",
9381
- groupAlign: "stretch",
9382
- groupJustify: "center",
9383
- groupGap,
9384
- children
9385
- }
9386
- ),
9387
- description && /* @__PURE__ */ jsxRuntime.jsx(
9388
- Typography,
9389
- {
9390
- variant: "body",
9391
- size: "md",
9392
- weight: "medium",
9393
- align: "center",
9394
- children: typeof description === "string" ? description : description
9395
- }
9396
- )
9397
- ] }) : /* @__PURE__ */ jsxRuntime.jsx(
9382
+ children: isStacked ? /* @__PURE__ */ jsxRuntime.jsxs(
9383
+ StyledStackedInner,
9384
+ {
9385
+ innerGap: parseTokenValue28(buttonGroup.spacing.gap),
9386
+ children: [
9387
+ leadingContent,
9388
+ /* @__PURE__ */ jsxRuntime.jsx(
9389
+ StyledButtonGroup,
9390
+ {
9391
+ groupDirection: "column",
9392
+ groupAlign: "stretch",
9393
+ groupJustify: "center",
9394
+ groupGap,
9395
+ children
9396
+ }
9397
+ ),
9398
+ description && /* @__PURE__ */ jsxRuntime.jsx(
9399
+ Typography,
9400
+ {
9401
+ token: typography.body.medium.md,
9402
+ color: buttonGroup.colour.text,
9403
+ align: "center",
9404
+ children: description
9405
+ }
9406
+ )
9407
+ ]
9408
+ }
9409
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
9398
9410
  StyledButtonGroup,
9399
9411
  {
9400
9412
  groupDirection: "row",
@@ -9846,7 +9858,6 @@ var StyledItem2 = styled52__default.default(reactNative.Pressable)(
9846
9858
  itemHeight,
9847
9859
  itemMinWidth,
9848
9860
  itemPaddingH,
9849
- itemPaddingV,
9850
9861
  itemBorderRadius,
9851
9862
  itemBgColor,
9852
9863
  itemOpacity,
@@ -9858,7 +9869,10 @@ var StyledItem2 = styled52__default.default(reactNative.Pressable)(
9858
9869
  height: itemHeight
9859
9870
  }, isIconOnly ? { width: itemHeight, maxWidth: itemHeight } : { minWidth: itemMinWidth }), {
9860
9871
  paddingHorizontal: itemPaddingH,
9861
- paddingVertical: itemPaddingV,
9872
+ // Vertical padding is intentionally omitted: with a fixed `height` and
9873
+ // flex centering, the label sits in the middle of the box. Applying
9874
+ // `verticalPadding: 12px` on top of the 36px small height would leave a
9875
+ // 12px inner area, clipping the 18px line-height text on Android.
9862
9876
  borderRadius: itemBorderRadius,
9863
9877
  backgroundColor: itemBgColor,
9864
9878
  opacity: itemOpacity,
@@ -9911,7 +9925,6 @@ var FilterTabItem = React60__default.default.forwardRef(
9911
9925
  itemHeight: height,
9912
9926
  itemMinWidth: minWidth,
9913
9927
  itemPaddingH: parseTokenValue33(tabItem.spacing.horizontalPadding),
9914
- itemPaddingV: parseTokenValue33(tabItem.spacing.verticalPadding),
9915
9928
  itemBorderRadius: parseTokenValue33(tabItem.borderRadius.default),
9916
9929
  itemBgColor: isActive ? tabItem.colour.background.selected : tabItem.colour.background.default,
9917
9930
  itemOpacity: disabled ? parseFloat(tabItem.opacity.disabled.default) : 1,
@@ -10382,20 +10395,21 @@ var StyledErrorRow2 = styled52__default.default(reactNative.View)(({ gap }) => (
10382
10395
  var PasswordFieldError = React60__default.default.forwardRef((_a, ref) => {
10383
10396
  var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
10384
10397
  const theme2 = react.useTheme();
10385
- const { colour, description, spacing } = theme2.tokens.components.inputs;
10398
+ const { listItem } = theme2.tokens.components.validationList;
10399
+ const { typography } = theme2.tokens.semantics;
10386
10400
  return /* @__PURE__ */ jsxRuntime.jsxs(
10387
10401
  StyledErrorRow2,
10388
10402
  __spreadProps(__spreadValues({
10389
10403
  ref,
10390
- gap: parseTokenValue36(spacing.description.leftPadding)
10404
+ gap: parseTokenValue36(listItem.spacing.gap)
10391
10405
  }, rest), {
10392
10406
  children: [
10393
- /* @__PURE__ */ jsxRuntime.jsx(Icon, { icon: Cancel_default, size: "sm", colour: "error" }),
10407
+ /* @__PURE__ */ jsxRuntime.jsx(Icon, { icon: Cancel_default, size: "xs", customColour: listItem.colour.icon.error }),
10394
10408
  /* @__PURE__ */ jsxRuntime.jsx(
10395
10409
  Typography,
10396
10410
  {
10397
- token: description.text.default,
10398
- color: colour.description.error,
10411
+ token: typography.body.medium.md,
10412
+ color: listItem.colour.text.default,
10399
10413
  children
10400
10414
  }
10401
10415
  )
@@ -10420,7 +10434,8 @@ var StyledRequirementItem = styled52__default.default(reactNative.View)(
10420
10434
  var PasswordFieldRequirements = React60__default.default.forwardRef((_a, ref) => {
10421
10435
  var _b = _a, { requirements } = _b, rest = __objRest(_b, ["requirements"]);
10422
10436
  const theme2 = react.useTheme();
10423
- const { colour, description, spacing } = theme2.tokens.components.inputs;
10437
+ const { listItem, list } = theme2.tokens.components.validationList;
10438
+ const { typography } = theme2.tokens.semantics;
10424
10439
  if (!requirements || requirements.length === 0) {
10425
10440
  return null;
10426
10441
  }
@@ -10431,28 +10446,28 @@ var PasswordFieldRequirements = React60__default.default.forwardRef((_a, ref) =>
10431
10446
  StyledRequirementsList,
10432
10447
  __spreadProps(__spreadValues({
10433
10448
  ref,
10434
- listGap: parseTokenValue37(spacing.description.leftPadding)
10449
+ listGap: parseTokenValue37(list.spacing.gap)
10435
10450
  }, rest), {
10436
10451
  children: normalizedRequirements.map((requirement, index) => {
10437
- const iconColour = requirement.satisfied ? "success" : "error";
10452
+ const iconColour = requirement.satisfied ? listItem.colour.icon.success : listItem.colour.icon.error;
10438
10453
  return /* @__PURE__ */ jsxRuntime.jsxs(
10439
10454
  StyledRequirementItem,
10440
10455
  {
10441
- itemGap: parseTokenValue37(spacing.description.leftPadding),
10456
+ itemGap: parseTokenValue37(listItem.spacing.gap),
10442
10457
  children: [
10443
10458
  /* @__PURE__ */ jsxRuntime.jsx(
10444
10459
  Icon,
10445
10460
  {
10446
10461
  icon: requirement.satisfied ? CheckCircle_default : Cancel_default,
10447
- size: "sm",
10448
- colour: iconColour
10462
+ size: "xs",
10463
+ customColour: iconColour
10449
10464
  }
10450
10465
  ),
10451
10466
  /* @__PURE__ */ jsxRuntime.jsx(
10452
10467
  Typography,
10453
10468
  {
10454
- token: description.text.default,
10455
- color: colour.label.default,
10469
+ token: typography.body.medium.md,
10470
+ color: listItem.colour.text.default,
10456
10471
  children: requirement.text
10457
10472
  }
10458
10473
  )
@@ -13317,8 +13332,35 @@ var DatePicker = React60__default.default.forwardRef(
13317
13332
  }
13318
13333
  );
13319
13334
  DatePicker.displayName = "DatePicker";
13320
- var POINTER_HALF_WIDTH = 12;
13335
+ var POINTER_WIDTH = 24;
13321
13336
  var POINTER_HEIGHT = 12;
13337
+ var buildPointerPath = (r) => {
13338
+ const w = POINTER_WIDTH;
13339
+ const h = POINTER_HEIGHT;
13340
+ const apexInset = r;
13341
+ const botInset = r * (Math.SQRT2 + 1);
13342
+ const sin45 = Math.SQRT1_2;
13343
+ const apexAxis = apexInset * sin45;
13344
+ const botAxis = botInset * sin45;
13345
+ const apexLeftX = w / 2 - apexAxis;
13346
+ const apexRightX = w / 2 + apexAxis;
13347
+ const apexY = apexAxis;
13348
+ const blEdgeX = botAxis;
13349
+ const blEdgeY = h - botAxis;
13350
+ const blBottomX = botInset;
13351
+ const brBottomX = w - botInset;
13352
+ const brEdgeX = w - botAxis;
13353
+ return [
13354
+ `M ${blEdgeX} ${blEdgeY}`,
13355
+ `L ${apexLeftX} ${apexY}`,
13356
+ `A ${r} ${r} 0 0 1 ${apexRightX} ${apexY}`,
13357
+ `L ${brEdgeX} ${blEdgeY}`,
13358
+ `A ${r} ${r} 0 0 1 ${brBottomX} ${h}`,
13359
+ `L ${blBottomX} ${h}`,
13360
+ `A ${r} ${r} 0 0 1 ${blEdgeX} ${blEdgeY}`,
13361
+ "Z"
13362
+ ].join(" ");
13363
+ };
13322
13364
  var parseTokenValue53 = (value) => parseFloat(value);
13323
13365
  var StyledRoot15 = styled52__default.default(reactNative.View)(({ rootGap }) => ({
13324
13366
  flexDirection: "column",
@@ -13365,27 +13407,13 @@ var StyledPictureButton = styled52__default.default(reactNative.Pressable)(
13365
13407
  overflow: "hidden"
13366
13408
  })
13367
13409
  );
13368
- var StyledPointerTriangle = styled52__default.default(reactNative.View)(({ pointerColor, pointerVisible }) => ({
13369
- // 0×0 is part of the RN triangle-via-borders trick, not a layout
13370
- // dimension. Borders compose into a down-pointing triangle (apex at
13371
- // bottom) on RN; the `rotate 180deg` transform flips it to apex-up so
13372
- // the pointer visually connects the selected button to the insight
13373
- // card below. Using rotate instead of `borderBottom` because RN's
13374
- // triangle-via-borders rendering is inconsistent when the coloured
13375
- // border is on the bottom with transparent left/right on certain
13376
- // platforms.
13377
- width: 0,
13378
- height: 0,
13379
- borderLeftWidth: POINTER_HALF_WIDTH,
13380
- borderRightWidth: POINTER_HALF_WIDTH,
13381
- borderTopWidth: POINTER_HEIGHT,
13382
- borderLeftColor: "transparent",
13383
- borderRightColor: "transparent",
13384
- borderTopColor: pointerColor,
13385
- borderStyle: "solid",
13386
- transform: [{ rotate: "180deg" }],
13387
- opacity: pointerVisible ? 1 : 0
13388
- }));
13410
+ var StyledPointer = styled52__default.default(Svg__default.default)(
13411
+ ({ pointerVisible }) => ({
13412
+ width: POINTER_WIDTH,
13413
+ height: POINTER_HEIGHT,
13414
+ opacity: pointerVisible ? 1 : 0
13415
+ })
13416
+ );
13389
13417
  var PictureSelector = React60__default.default.forwardRef(
13390
13418
  (_a, ref) => {
13391
13419
  var _b = _a, {
@@ -13434,6 +13462,9 @@ var PictureSelector = React60__default.default.forwardRef(
13434
13462
  pictureButton.borderWidth.default
13435
13463
  );
13436
13464
  const borderWidthActive = parseTokenValue53(pictureButton.borderWidth.active);
13465
+ const pointerPath = buildPointerPath(
13466
+ parseTokenValue53(pictureButton.pointer.borderRadius.default)
13467
+ );
13437
13468
  const resolvedMinWidth = itemMinWidth != null ? itemMinWidth : parseTokenValue53(pictureButton.size.minWidth);
13438
13469
  const resolvedMinHeight = itemMinHeight != null ? itemMinHeight : resolvedMinWidth;
13439
13470
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -13457,7 +13488,6 @@ var PictureSelector = React60__default.default.forwardRef(
13457
13488
  /* @__PURE__ */ jsxRuntime.jsx(StyledRow2, { rowGap, children: items.map((item) => {
13458
13489
  const isSelected = item.value === selectedValue;
13459
13490
  const Visual = item.illustration;
13460
- const IconComp = item.icon;
13461
13491
  const buttonProps = {
13462
13492
  buttonBorderRadius,
13463
13493
  buttonBorderWidth: isSelected ? borderWidthActive : borderWidthDefault,
@@ -13486,14 +13516,23 @@ var PictureSelector = React60__default.default.forwardRef(
13486
13516
  if (!item.disabled) handleSelect(item.value);
13487
13517
  }
13488
13518
  }, buttonProps), {
13489
- children: Visual ? /* @__PURE__ */ jsxRuntime.jsx(Illustration, { illustration: Visual, size: "sm" }) : IconComp ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { icon: IconComp, size: "2xl" }) : null
13519
+ children: Visual ? /* @__PURE__ */ jsxRuntime.jsx(Illustration, { illustration: Visual, size: "xl" }) : null
13490
13520
  })
13491
13521
  ),
13492
13522
  /* @__PURE__ */ jsxRuntime.jsx(
13493
- StyledPointerTriangle,
13523
+ StyledPointer,
13494
13524
  {
13495
- pointerColor: pictureButton.colour.pointer.default,
13496
- pointerVisible: isSelected && hasInsight
13525
+ pointerVisible: isSelected && hasInsight,
13526
+ width: POINTER_WIDTH,
13527
+ height: POINTER_HEIGHT,
13528
+ viewBox: `0 0 ${POINTER_WIDTH} ${POINTER_HEIGHT}`,
13529
+ children: /* @__PURE__ */ jsxRuntime.jsx(
13530
+ Svg.Path,
13531
+ {
13532
+ d: pointerPath,
13533
+ fill: pictureButton.colour.pointer.default
13534
+ }
13535
+ )
13497
13536
  }
13498
13537
  )
13499
13538
  ] }, item.value);