@bug-on/m3-expressive 1.2.3 → 1.2.4

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.mjs CHANGED
@@ -6724,6 +6724,7 @@ var ButtonComponent = React61.forwardRef(
6724
6724
  loading = false,
6725
6725
  loadingVariant = "loading-indicator",
6726
6726
  asChild = false,
6727
+ fullWidth = false,
6727
6728
  outlineWidth,
6728
6729
  children,
6729
6730
  onClick,
@@ -6746,6 +6747,7 @@ var ButtonComponent = React61.forwardRef(
6746
6747
  "loading",
6747
6748
  "loadingVariant",
6748
6749
  "asChild",
6750
+ "fullWidth",
6749
6751
  "outlineWidth",
6750
6752
  "children",
6751
6753
  "onClick",
@@ -6825,7 +6827,8 @@ var ButtonComponent = React61.forwardRef(
6825
6827
  [loading, onClick, onKeyDown]
6826
6828
  );
6827
6829
  const buttonClassName = cn(
6828
- "relative w-fit shrink-0 inline-flex flex-row items-center justify-center",
6830
+ "relative inline-flex flex-row items-center justify-center",
6831
+ fullWidth ? "w-full" : "w-fit shrink-0",
6829
6832
  "whitespace-nowrap select-none cursor-pointer",
6830
6833
  "transition-[background-color,color,border-color,box-shadow,opacity,filter] duration-200",
6831
6834
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-m3-primary focus-visible:ring-offset-2",
@@ -8011,7 +8014,9 @@ var FABComponent = React61.forwardRef(
8011
8014
  asChild = false,
8012
8015
  onClick,
8013
8016
  onKeyDown,
8014
- "aria-label": ariaLabel
8017
+ "aria-label": ariaLabel,
8018
+ layout,
8019
+ layoutId
8015
8020
  } = _b, restProps = __objRest(_b, [
8016
8021
  "className",
8017
8022
  "style",
@@ -8027,7 +8032,9 @@ var FABComponent = React61.forwardRef(
8027
8032
  "asChild",
8028
8033
  "onClick",
8029
8034
  "onKeyDown",
8030
- "aria-label"
8035
+ "aria-label",
8036
+ "layout",
8037
+ "layoutId"
8031
8038
  ]);
8032
8039
  var _a2, _b2, _c, _d;
8033
8040
  const colors = (_a2 = COLOR_CLASSES2[colorStyle]) != null ? _a2 : COLOR_CLASSES2.primary;
@@ -8068,7 +8075,9 @@ var FABComponent = React61.forwardRef(
8068
8075
  /* @__PURE__ */ jsx(Ripple, { ripples, onRippleDone: removeRipple }),
8069
8076
  /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", initial: false, children: loading ? /* @__PURE__ */ jsx(
8070
8077
  m.span,
8071
- __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
8078
+ __spreadProps(__spreadValues({
8079
+ layout: "position"
8080
+ }, ICON_SPAN_VARIANTS), {
8072
8081
  transition: SPRING_TRANSITION,
8073
8082
  className: cn(
8074
8083
  "flex items-center justify-center shrink-0",
@@ -8095,7 +8104,9 @@ var FABComponent = React61.forwardRef(
8095
8104
  "loading"
8096
8105
  ) : /* @__PURE__ */ jsx(
8097
8106
  m.span,
8098
- __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
8107
+ __spreadProps(__spreadValues({
8108
+ layout: "position"
8109
+ }, ICON_SPAN_VARIANTS), {
8099
8110
  transition: SPRING_TRANSITION,
8100
8111
  "aria-hidden": "true",
8101
8112
  className: cn(
@@ -8109,10 +8120,15 @@ var FABComponent = React61.forwardRef(
8109
8120
  /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: extended && labelContent && /* @__PURE__ */ jsx(
8110
8121
  m.span,
8111
8122
  {
8123
+ layout: "position",
8112
8124
  initial: { width: 0, opacity: 0 },
8113
8125
  animate: { width: "auto", opacity: 1 },
8114
8126
  exit: { width: 0, opacity: 0 },
8115
- transition: SPRING_TRANSITION,
8127
+ transition: {
8128
+ opacity: { duration: 0.15, ease: "linear" },
8129
+ width: SPRING_TRANSITION,
8130
+ layout: SPRING_TRANSITION
8131
+ },
8116
8132
  className: "overflow-hidden whitespace-nowrap ml-3",
8117
8133
  children: labelContent
8118
8134
  },
@@ -8129,7 +8145,7 @@ var FABComponent = React61.forwardRef(
8129
8145
  colors.text,
8130
8146
  lowered ? "shadow-sm" : colors.shadow,
8131
8147
  (_d = SIZE_STYLES[size]) != null ? _d : "h-14 w-14",
8132
- extended && "w-auto px-6",
8148
+ extended && "w-auto pl-4 pr-6",
8133
8149
  SIZE_TEXT_CLASS[size],
8134
8150
  loading && "pointer-events-none opacity-75 cursor-not-allowed",
8135
8151
  className
@@ -8160,6 +8176,8 @@ var FABComponent = React61.forwardRef(
8160
8176
  __spreadProps(__spreadValues({
8161
8177
  ref,
8162
8178
  type: "button",
8179
+ layout: layout !== void 0 ? layout : true,
8180
+ layoutId,
8163
8181
  "aria-label": computedAriaLabel,
8164
8182
  "aria-busy": loading || void 0,
8165
8183
  "aria-disabled": loading || restProps.disabled,
@@ -8178,7 +8196,8 @@ var FABComponent = React61.forwardRef(
8178
8196
  transition: {
8179
8197
  borderRadius: SPRING_TRANSITION_FAST,
8180
8198
  scale: SPRING_TRANSITION,
8181
- opacity: { duration: 0.25, ease: "easeOut" }
8199
+ opacity: { duration: 0.25, ease: "easeOut" },
8200
+ layout: SPRING_TRANSITION
8182
8201
  },
8183
8202
  className: containerClassName
8184
8203
  }, restProps), {
@@ -15757,6 +15776,23 @@ var ListItemImpl = React61.forwardRef(
15757
15776
  );
15758
15777
  ListItemImpl.displayName = "ListItem";
15759
15778
  var ListItem = React61.memo(ListItemImpl);
15779
+
15780
+ // src/ui/navigation/navigation-shape-utils.ts
15781
+ function getNavigationShapeStyle(shape, width = 56, height = 56) {
15782
+ if (!shape || shape === "pill" || shape === "circle") {
15783
+ return void 0;
15784
+ }
15785
+ const polygon = MD3Shapes[shape];
15786
+ if (!polygon) {
15787
+ return void 0;
15788
+ }
15789
+ return {
15790
+ clipPath: toClipPath(polygon, width, height)
15791
+ };
15792
+ }
15793
+ function isSquareShape(shape) {
15794
+ return Boolean(shape && shape !== "pill");
15795
+ }
15760
15796
  var NavigationBarContext = React61.createContext({ variant: "flexible" });
15761
15797
  function cloneIconWithFill(icon, selected) {
15762
15798
  if (!React61.isValidElement(icon)) return icon;
@@ -15768,16 +15804,23 @@ function cloneIconWithFill(icon, selected) {
15768
15804
  }
15769
15805
  return icon;
15770
15806
  }
15771
- function ActivePill() {
15807
+ function ActivePill({
15808
+ shape = "pill",
15809
+ width = 56,
15810
+ height = 32
15811
+ }) {
15772
15812
  const { activeIndicatorTransition } = React61.useContext(NavigationBarContext);
15813
+ const shapeStyle = getNavigationShapeStyle(shape, width, height);
15773
15814
  return /* @__PURE__ */ jsx(
15774
15815
  m.div,
15775
15816
  {
15776
- className: "absolute inset-0 bg-m3-secondary-container pointer-events-none",
15777
- style: {
15778
- borderRadius: 9999,
15817
+ className: cn(
15818
+ "bg-m3-secondary-container pointer-events-none",
15819
+ shapeStyle ? "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rounded-none" : shape === "circle" ? "absolute inset-0 rounded-full" : "absolute inset-0 rounded-full"
15820
+ ),
15821
+ style: __spreadValues(__spreadValues({
15779
15822
  zIndex: 0
15780
- },
15823
+ }, shapeStyle ? { width, height } : {}), shapeStyle),
15781
15824
  initial: { opacity: 0, scale: 0.5 },
15782
15825
  animate: { opacity: 1, scale: 1 },
15783
15826
  exit: { opacity: 0, scale: 0.5 },
@@ -15785,11 +15828,42 @@ function ActivePill() {
15785
15828
  }
15786
15829
  );
15787
15830
  }
15788
- function HoverStateLayer() {
15789
- return /* @__PURE__ */ jsx("div", { className: "absolute inset-0 rounded-full bg-m3-on-surface opacity-0 group-hover:opacity-[0.08] group-focus-visible:opacity-[0.10] active:opacity-[0.10] transition-opacity duration-200 pointer-events-none z-0" });
15831
+ function HoverStateLayer({
15832
+ shape = "pill",
15833
+ width = 56,
15834
+ height = 32
15835
+ }) {
15836
+ const shapeStyle = getNavigationShapeStyle(shape, width, height);
15837
+ return /* @__PURE__ */ jsx(
15838
+ "div",
15839
+ {
15840
+ className: cn(
15841
+ "bg-m3-on-surface opacity-0 group-hover:opacity-[0.08] group-focus-visible:opacity-[0.10] active:opacity-[0.10] transition-opacity duration-200 pointer-events-none z-0",
15842
+ shapeStyle ? "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rounded-none" : shape === "circle" ? "absolute inset-0 rounded-full" : "absolute inset-0 rounded-[16px]"
15843
+ ),
15844
+ style: __spreadValues(__spreadValues({}, shapeStyle ? { width, height } : {}), shapeStyle)
15845
+ }
15846
+ );
15790
15847
  }
15791
- function RippleLayer({ ripples, onRippleDone }) {
15792
- return /* @__PURE__ */ jsx("div", { className: "absolute inset-0 rounded-full overflow-hidden pointer-events-none z-0", children: /* @__PURE__ */ jsx(Ripple, { ripples, onRippleDone }) });
15848
+ function RippleLayer({
15849
+ ripples,
15850
+ onRippleDone,
15851
+ shape = "pill",
15852
+ width = 56,
15853
+ height = 32
15854
+ }) {
15855
+ const shapeStyle = getNavigationShapeStyle(shape, width, height);
15856
+ return /* @__PURE__ */ jsx(
15857
+ "div",
15858
+ {
15859
+ className: cn(
15860
+ "overflow-hidden pointer-events-none z-0",
15861
+ shapeStyle ? "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rounded-none" : shape === "circle" ? "absolute inset-0 rounded-full" : "absolute inset-0 rounded-[16px]"
15862
+ ),
15863
+ style: __spreadValues(__spreadValues({}, shapeStyle ? { width, height } : {}), shapeStyle),
15864
+ children: /* @__PURE__ */ jsx(Ripple, { ripples, onRippleDone })
15865
+ }
15866
+ );
15793
15867
  }
15794
15868
  function IconContainer({ selected, badge, children }) {
15795
15869
  return /* @__PURE__ */ jsxs(
@@ -15815,19 +15889,33 @@ var NavigationBarItemComponent = React61.forwardRef(
15815
15889
  onClick,
15816
15890
  disabled = false,
15817
15891
  badge,
15892
+ shape: shapeProp,
15893
+ shapeSize: shapeSizeProp,
15894
+ hideLabel = false,
15818
15895
  className,
15819
15896
  "aria-label": ariaLabelProp,
15820
15897
  asChild = false,
15821
15898
  children
15822
15899
  }, ref) => {
15823
- var _a;
15900
+ var _a, _b, _c;
15824
15901
  const {
15825
15902
  variant,
15826
15903
  itemLayout,
15904
+ shape: contextShape,
15905
+ labelVisibility: contextLabelVisibility,
15906
+ shapeSize: contextShapeSize,
15827
15907
  itemClassName: contextItemClassName
15828
15908
  } = React61.useContext(NavigationBarContext);
15909
+ const activeShape = (_a = shapeProp != null ? shapeProp : contextShape) != null ? _a : "pill";
15910
+ const isSquare = isSquareShape(activeShape);
15911
+ const resolvedShapeSize = (_b = shapeSizeProp != null ? shapeSizeProp : contextShapeSize) != null ? _b : 56;
15829
15912
  const isForcedHorizontal = itemLayout === "horizontal";
15830
15913
  const isResponsiveHorizontal = (variant === "flexible" || variant === "xr") && itemLayout === void 0;
15914
+ const shouldShowLabel = !hideLabel && (() => {
15915
+ if (contextLabelVisibility === "unlabeled") return false;
15916
+ if (contextLabelVisibility === "auto") return selected;
15917
+ return true;
15918
+ })();
15831
15919
  const { ripples, onPointerDown, removeRipple } = useRippleState({
15832
15920
  disabled
15833
15921
  });
@@ -15855,6 +15943,8 @@ var NavigationBarItemComponent = React61.forwardRef(
15855
15943
  contextItemClassName,
15856
15944
  className
15857
15945
  );
15946
+ const iconPillWidth = isSquare ? resolvedShapeSize : 56;
15947
+ const iconPillHeight = isSquare ? resolvedShapeSize : 32;
15858
15948
  if (asChild && children) {
15859
15949
  const child = React61.Children.only(children);
15860
15950
  const innerContent = /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -15864,10 +15954,12 @@ var NavigationBarItemComponent = React61.forwardRef(
15864
15954
  className: cn(
15865
15955
  "relative flex items-center justify-center flex-col gap-y-1 w-full px-1 py-1.5",
15866
15956
  isResponsiveHorizontal && "min-[600px]:flex-row min-[600px]:gap-y-0 min-[600px]:gap-x-1.5 min-[600px]:h-10 min-[600px]:px-4 min-[600px]:py-0 min-[600px]:rounded-full min-[600px]:w-auto",
15867
- isForcedHorizontal && "flex-row gap-y-0 gap-x-1.5 h-10 px-4 py-0 rounded-full w-auto"
15957
+ isForcedHorizontal && "flex-row gap-y-0 gap-x-1.5 h-10 px-4 py-0 rounded-full w-auto",
15958
+ // When label is hidden and not horizontal, remove bottom gap
15959
+ !shouldShowLabel && !isForcedHorizontal && "gap-y-0"
15868
15960
  ),
15869
15961
  children: [
15870
- /* @__PURE__ */ jsxs(
15962
+ !isSquare && /* @__PURE__ */ jsxs(
15871
15963
  "div",
15872
15964
  {
15873
15965
  className: cn(
@@ -15876,9 +15968,18 @@ var NavigationBarItemComponent = React61.forwardRef(
15876
15968
  isForcedHorizontal && "block!"
15877
15969
  ),
15878
15970
  children: [
15879
- /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsx(ActivePill, {}) }),
15880
- /* @__PURE__ */ jsx(HoverStateLayer, {}),
15881
- /* @__PURE__ */ jsx(RippleLayer, { ripples, onRippleDone: removeRipple })
15971
+ /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsx(ActivePill, { shape: activeShape, width: 56, height: 40 }) }),
15972
+ /* @__PURE__ */ jsx(HoverStateLayer, { shape: activeShape, width: 56, height: 40 }),
15973
+ /* @__PURE__ */ jsx(
15974
+ RippleLayer,
15975
+ {
15976
+ ripples,
15977
+ onRippleDone: removeRipple,
15978
+ shape: activeShape,
15979
+ width: 56,
15980
+ height: 40
15981
+ }
15982
+ )
15882
15983
  ]
15883
15984
  }
15884
15985
  ),
@@ -15887,23 +15988,47 @@ var NavigationBarItemComponent = React61.forwardRef(
15887
15988
  {
15888
15989
  className: cn(
15889
15990
  "relative flex items-center justify-center shrink-0 z-10",
15890
- "h-8 w-16 mx-auto rounded-full",
15891
- isResponsiveHorizontal && "min-[600px]:size-6 min-[600px]:w-auto min-[600px]:h-auto",
15892
- isForcedHorizontal && "size-6 w-auto h-auto"
15991
+ isSquare ? "mx-auto" : "h-8 w-14 mx-auto rounded-[16px]",
15992
+ !isSquare && isResponsiveHorizontal && "min-[600px]:size-6 min-[600px]:w-auto min-[600px]:h-auto",
15993
+ !isSquare && isForcedHorizontal && "size-6 w-auto h-auto"
15893
15994
  ),
15995
+ style: isSquare ? { width: resolvedShapeSize, height: resolvedShapeSize } : void 0,
15894
15996
  children: [
15895
15997
  /* @__PURE__ */ jsxs(
15896
15998
  "div",
15897
15999
  {
15898
16000
  className: cn(
15899
16001
  "absolute inset-0 z-0",
15900
- isResponsiveHorizontal && "min-[600px]:hidden",
15901
- isForcedHorizontal && "hidden"
16002
+ !isSquare && isResponsiveHorizontal && "min-[600px]:hidden",
16003
+ !isSquare && isForcedHorizontal && "hidden"
15902
16004
  ),
15903
16005
  children: [
15904
- /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsx(ActivePill, {}) }),
15905
- /* @__PURE__ */ jsx(HoverStateLayer, {}),
15906
- /* @__PURE__ */ jsx(RippleLayer, { ripples, onRippleDone: removeRipple })
16006
+ /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsx(
16007
+ ActivePill,
16008
+ {
16009
+ shape: activeShape,
16010
+ width: iconPillWidth,
16011
+ height: iconPillHeight
16012
+ }
16013
+ ) }),
16014
+ /* @__PURE__ */ jsx(
16015
+ HoverStateLayer,
16016
+ {
16017
+ shape: activeShape,
16018
+ width: iconPillWidth,
16019
+ height: iconPillHeight
16020
+ }
16021
+ ),
16022
+ /* @__PURE__ */ jsx(
16023
+ RippleLayer,
16024
+ {
16025
+ ripples,
16026
+ onRippleDone: removeRipple,
16027
+ shape: activeShape,
16028
+ width: iconPillWidth,
16029
+ height: iconPillHeight
16030
+ }
16031
+ )
15907
16032
  ]
15908
16033
  }
15909
16034
  ),
@@ -15911,15 +16036,19 @@ var NavigationBarItemComponent = React61.forwardRef(
15911
16036
  ]
15912
16037
  }
15913
16038
  ),
15914
- /* @__PURE__ */ jsx(AnimatePresence, { mode: "popLayout", children: /* @__PURE__ */ jsx(
15915
- "span",
16039
+ label && /* @__PURE__ */ jsx(AnimatePresence, { mode: "popLayout", initial: false, children: shouldShowLabel && /* @__PURE__ */ jsx(
16040
+ m.span,
15916
16041
  {
16042
+ initial: { opacity: 0, height: 0, scale: 0.85, y: -2 },
16043
+ animate: { opacity: 1, height: "auto", scale: 1, y: 0 },
16044
+ exit: { opacity: 0, height: 0, scale: 0.85, y: -2 },
16045
+ transition: SPRING_TRANSITION_EXPRESSIVE,
15917
16046
  className: cn(
15918
- "z-10 transition-all duration-200 truncate px-1",
15919
- selected ? "text-m3-on-surface" : "text-m3-on-surface-variant",
15920
- "font-medium text-[12px] leading-4 tracking-[0.5px]"
16047
+ "z-10 transition-colors duration-200 truncate px-1 inline-block overflow-hidden",
16048
+ selected ? "text-m3-on-surface font-medium" : "text-m3-on-surface-variant font-medium",
16049
+ "text-[12px] leading-4 tracking-[0.5px]"
15921
16050
  ),
15922
- children: (_a = child.props.children) != null ? _a : label
16051
+ children: (_c = child.props.children) != null ? _c : label
15923
16052
  },
15924
16053
  "nav-label"
15925
16054
  ) })
@@ -15935,7 +16064,10 @@ var NavigationBarItemComponent = React61.forwardRef(
15935
16064
  role: "menuitem",
15936
16065
  "aria-current": selected ? "page" : void 0,
15937
16066
  "aria-disabled": disabled ? true : void 0,
15938
- "aria-label": ariaLabelProp || (typeof label === "string" ? label : void 0),
16067
+ "aria-label": (
16068
+ // Always provide aria-label even when label is visually hidden
16069
+ ariaLabelProp || (typeof label === "string" ? label : void 0)
16070
+ ),
15939
16071
  onClick: handleClick,
15940
16072
  onPointerDown,
15941
16073
  className: itemClassName,
@@ -15951,7 +16083,10 @@ var NavigationBarItemComponent = React61.forwardRef(
15951
16083
  role: "menuitem",
15952
16084
  "aria-current": selected ? "page" : void 0,
15953
16085
  "aria-disabled": disabled ? true : void 0,
15954
- "aria-label": ariaLabelProp || (typeof label === "string" ? label : void 0),
16086
+ "aria-label": (
16087
+ // Always provide aria-label even when label is visually hidden
16088
+ ariaLabelProp || (typeof label === "string" ? label : void 0)
16089
+ ),
15955
16090
  onClick: handleClick,
15956
16091
  onPointerDown,
15957
16092
  className: itemClassName,
@@ -15962,10 +16097,12 @@ var NavigationBarItemComponent = React61.forwardRef(
15962
16097
  className: cn(
15963
16098
  "relative flex items-center justify-center flex-col gap-y-1 w-full px-1 py-1.5",
15964
16099
  isResponsiveHorizontal && "min-[600px]:flex-row min-[600px]:gap-y-0 min-[600px]:gap-x-1.5 min-[600px]:h-10 min-[600px]:px-4 min-[600px]:py-0 min-[600px]:rounded-full min-[600px]:w-auto",
15965
- isForcedHorizontal && "flex-row gap-y-0 gap-x-1.5 h-10 px-4 py-0 rounded-full w-auto"
16100
+ isForcedHorizontal && "flex-row gap-y-0 gap-x-1.5 h-10 px-4 py-0 rounded-full w-auto",
16101
+ // When label is hidden and not horizontal, remove bottom gap
16102
+ !shouldShowLabel && !isForcedHorizontal && "gap-y-0"
15966
16103
  ),
15967
16104
  children: [
15968
- /* @__PURE__ */ jsxs(
16105
+ !isSquare && /* @__PURE__ */ jsxs(
15969
16106
  "div",
15970
16107
  {
15971
16108
  className: cn(
@@ -15974,9 +16111,18 @@ var NavigationBarItemComponent = React61.forwardRef(
15974
16111
  isForcedHorizontal && "block!"
15975
16112
  ),
15976
16113
  children: [
15977
- /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsx(ActivePill, {}) }),
15978
- /* @__PURE__ */ jsx(HoverStateLayer, {}),
15979
- /* @__PURE__ */ jsx(RippleLayer, { ripples, onRippleDone: removeRipple })
16114
+ /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsx(ActivePill, { shape: activeShape, width: 56, height: 40 }) }),
16115
+ /* @__PURE__ */ jsx(HoverStateLayer, { shape: activeShape, width: 56, height: 40 }),
16116
+ /* @__PURE__ */ jsx(
16117
+ RippleLayer,
16118
+ {
16119
+ ripples,
16120
+ onRippleDone: removeRipple,
16121
+ shape: activeShape,
16122
+ width: 56,
16123
+ height: 40
16124
+ }
16125
+ )
15980
16126
  ]
15981
16127
  }
15982
16128
  ),
@@ -15985,23 +16131,47 @@ var NavigationBarItemComponent = React61.forwardRef(
15985
16131
  {
15986
16132
  className: cn(
15987
16133
  "relative flex items-center justify-center shrink-0 z-10",
15988
- "h-8 w-16 mx-auto rounded-full",
15989
- isResponsiveHorizontal && "min-[600px]:size-6 min-[600px]:w-auto min-[600px]:h-auto",
15990
- isForcedHorizontal && "size-6 w-auto h-auto"
16134
+ isSquare ? "mx-auto" : "h-8 w-14 mx-auto rounded-[16px]",
16135
+ !isSquare && isResponsiveHorizontal && "min-[600px]:size-6 min-[600px]:w-auto min-[600px]:h-auto",
16136
+ !isSquare && isForcedHorizontal && "size-6 w-auto h-auto"
15991
16137
  ),
16138
+ style: isSquare ? { width: resolvedShapeSize, height: resolvedShapeSize } : void 0,
15992
16139
  children: [
15993
16140
  /* @__PURE__ */ jsxs(
15994
16141
  "div",
15995
16142
  {
15996
16143
  className: cn(
15997
16144
  "absolute inset-0 z-0",
15998
- isResponsiveHorizontal && "min-[600px]:hidden",
15999
- isForcedHorizontal && "hidden"
16145
+ !isSquare && isResponsiveHorizontal && "min-[600px]:hidden",
16146
+ !isSquare && isForcedHorizontal && "hidden"
16000
16147
  ),
16001
16148
  children: [
16002
- /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsx(ActivePill, {}) }),
16003
- /* @__PURE__ */ jsx(HoverStateLayer, {}),
16004
- /* @__PURE__ */ jsx(RippleLayer, { ripples, onRippleDone: removeRipple })
16149
+ /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsx(
16150
+ ActivePill,
16151
+ {
16152
+ shape: activeShape,
16153
+ width: iconPillWidth,
16154
+ height: iconPillHeight
16155
+ }
16156
+ ) }),
16157
+ /* @__PURE__ */ jsx(
16158
+ HoverStateLayer,
16159
+ {
16160
+ shape: activeShape,
16161
+ width: iconPillWidth,
16162
+ height: iconPillHeight
16163
+ }
16164
+ ),
16165
+ /* @__PURE__ */ jsx(
16166
+ RippleLayer,
16167
+ {
16168
+ ripples,
16169
+ onRippleDone: removeRipple,
16170
+ shape: activeShape,
16171
+ width: iconPillWidth,
16172
+ height: iconPillHeight
16173
+ }
16174
+ )
16005
16175
  ]
16006
16176
  }
16007
16177
  ),
@@ -16009,13 +16179,17 @@ var NavigationBarItemComponent = React61.forwardRef(
16009
16179
  ]
16010
16180
  }
16011
16181
  ),
16012
- /* @__PURE__ */ jsx(AnimatePresence, { mode: "popLayout", children: /* @__PURE__ */ jsx(
16013
- "span",
16182
+ label && /* @__PURE__ */ jsx(AnimatePresence, { mode: "popLayout", initial: false, children: shouldShowLabel && /* @__PURE__ */ jsx(
16183
+ m.span,
16014
16184
  {
16185
+ initial: { opacity: 0, height: 0, scale: 0.85, y: -2 },
16186
+ animate: { opacity: 1, height: "auto", scale: 1, y: 0 },
16187
+ exit: { opacity: 0, height: 0, scale: 0.85, y: -2 },
16188
+ transition: SPRING_TRANSITION_EXPRESSIVE,
16015
16189
  className: cn(
16016
- "z-10 transition-all duration-200 truncate px-1",
16017
- selected ? "text-m3-on-surface" : "text-m3-on-surface-variant",
16018
- "font-medium text-[12px] leading-4 tracking-[0.5px]"
16190
+ "z-10 transition-colors duration-200 truncate px-1 inline-block overflow-hidden",
16191
+ selected ? "text-m3-on-surface font-medium" : "text-m3-on-surface-variant font-medium",
16192
+ "text-[12px] leading-4 tracking-[0.5px]"
16019
16193
  ),
16020
16194
  children: label
16021
16195
  },
@@ -16037,9 +16211,9 @@ var navContainerVariants = cva(
16037
16211
  {
16038
16212
  variants: {
16039
16213
  variant: {
16040
- flexible: "bottom-0 left-0 right-0 w-full h-16 pb-safe",
16041
- baseline: "bottom-0 left-0 right-0 w-full h-20 pb-safe",
16042
- xr: "bottom-6 left-1/2 -translate-x-1/2 w-auto max-w-[calc(100%-2rem)] min-[600px]:max-w-fit h-20 min-[600px]:h-16 rounded-[48px] px-2"
16214
+ flexible: "bottom-0 left-0 right-0 w-full min-h-16 py-1 pb-safe",
16215
+ baseline: "bottom-0 left-0 right-0 w-full min-h-20 py-1 pb-safe",
16216
+ xr: "bottom-6 left-1/2 -translate-x-1/2 w-auto max-w-[calc(100%-2rem)] min-[600px]:max-w-fit min-h-20 min-[600px]:min-h-16 rounded-[48px] px-2 py-1"
16043
16217
  },
16044
16218
  position: {
16045
16219
  fixed: "fixed",
@@ -16061,6 +16235,9 @@ var NavigationBarComponent = React61.forwardRef(
16061
16235
  ({
16062
16236
  variant = "flexible",
16063
16237
  itemLayout,
16238
+ shape,
16239
+ labelVisibility,
16240
+ shapeSize,
16064
16241
  hideOnScroll = false,
16065
16242
  elevated = false,
16066
16243
  fixed = true,
@@ -16075,6 +16252,13 @@ var NavigationBarComponent = React61.forwardRef(
16075
16252
  const lastScrollY = React61.useRef(
16076
16253
  typeof window !== "undefined" ? window.scrollY : 0
16077
16254
  );
16255
+ const isSquare = isSquareShape(shape);
16256
+ const effectiveShapeSize = shapeSize != null ? shapeSize : isSquare ? 56 : 32;
16257
+ const computedMinHeight = React61.useMemo(() => {
16258
+ const baseHeight = variant === "baseline" ? 80 : 64;
16259
+ const requiredHeight = itemLayout === "horizontal" || labelVisibility === "unlabeled" ? effectiveShapeSize + 16 : effectiveShapeSize + 32;
16260
+ return Math.max(baseHeight, requiredHeight);
16261
+ }, [variant, itemLayout, labelVisibility, effectiveShapeSize]);
16078
16262
  React61.useEffect(() => {
16079
16263
  if (typeof window === "undefined" || !hideOnScroll) {
16080
16264
  setIsVisible(true);
@@ -16121,6 +16305,9 @@ var NavigationBarComponent = React61.forwardRef(
16121
16305
  value: {
16122
16306
  variant,
16123
16307
  itemLayout,
16308
+ shape,
16309
+ labelVisibility,
16310
+ shapeSize,
16124
16311
  activeIndicatorTransition,
16125
16312
  itemClassName
16126
16313
  },
@@ -16131,7 +16318,7 @@ var NavigationBarComponent = React61.forwardRef(
16131
16318
  role: "navigation",
16132
16319
  "aria-label": "Main navigation",
16133
16320
  className: navBaseClasses,
16134
- style,
16321
+ style: __spreadValues({ minHeight: computedMinHeight }, style),
16135
16322
  initial: false,
16136
16323
  animate: {
16137
16324
  y: isVisible ? "0%" : variant === "xr" ? "calc(100% + 40px)" : "100%"
@@ -16143,8 +16330,8 @@ var NavigationBarComponent = React61.forwardRef(
16143
16330
  role: "menubar",
16144
16331
  "aria-orientation": "horizontal",
16145
16332
  className: cn(
16146
- "flex w-full h-full mx-auto",
16147
- variant === "xr" ? "gap-0 min-[600px]:gap-1.5 items-center justify-center px-1" : "max-w-7xl gap-1.5"
16333
+ "flex w-full h-full mx-auto items-center justify-center",
16334
+ variant === "xr" ? "gap-0 min-[600px]:gap-1.5 px-1" : "max-w-7xl gap-1.5"
16148
16335
  ),
16149
16336
  children
16150
16337
  }
@@ -16157,7 +16344,11 @@ var NavigationBarComponent = React61.forwardRef(
16157
16344
  );
16158
16345
  NavigationBarComponent.displayName = "NavigationBar";
16159
16346
  var NavigationBar = React61.memo(NavigationBarComponent);
16160
- var NavigationRailContext = React61.createContext({ variant: "collapsed", labelVisibility: "labeled" });
16347
+ var NavigationRailContext = React61.createContext({
16348
+ variant: "collapsed",
16349
+ labelVisibility: "labeled",
16350
+ activeIndicatorWidth: "hug"
16351
+ });
16161
16352
  var MD3_MODAL_TRANSITION = {
16162
16353
  type: "tween",
16163
16354
  ease: [0.05, 0.7, 0.1, 1],
@@ -16168,9 +16359,9 @@ var railContainerVariants = cva(
16168
16359
  {
16169
16360
  variants: {
16170
16361
  variant: {
16171
- collapsed: "items-center h-full pt-11 pb-4 shadow-none bg-m3-surface rounded-none",
16172
- expanded: "items-start h-full pt-11 pb-4 shadow-none bg-m3-surface rounded-none",
16173
- modal: "bg-m3-surface shadow-lg rounded-r-[var(--m3-shape-corner-large)] h-full pt-11 pb-4",
16362
+ collapsed: "items-center h-full pt-11 pb-14 shadow-none bg-m3-surface rounded-none",
16363
+ expanded: "items-start h-full pt-11 pb-14 shadow-none bg-m3-surface rounded-none",
16364
+ modal: "bg-m3-surface shadow-lg rounded-r-[var(--m3-shape-corner-large)] h-full pt-11 pb-14",
16174
16365
  xr: "h-fit py-5 rounded-[48px] shadow-xl bg-m3-surface border border-white/5"
16175
16366
  },
16176
16367
  narrow: {
@@ -16213,14 +16404,28 @@ function setFocusedItem(items, index) {
16213
16404
  target.focus();
16214
16405
  }
16215
16406
  }
16216
- function ActivePill2({ layoutId, disableInitial = false }) {
16407
+ function ActivePill2({
16408
+ layoutId,
16409
+ disableInitial = false,
16410
+ shape = "pill",
16411
+ width = 56,
16412
+ height = 32
16413
+ }) {
16217
16414
  const { activeIndicatorTransition } = React61.useContext(NavigationRailContext);
16415
+ const shapeStyle = getNavigationShapeStyle(shape, width, height);
16218
16416
  return /* @__PURE__ */ jsx(
16219
16417
  m.div,
16220
16418
  {
16221
16419
  layoutId,
16222
- className: "absolute inset-0 bg-m3-secondary-container pointer-events-none",
16223
- style: { borderRadius: 9999, zIndex: 0, originX: 0.5, originY: 0.5 },
16420
+ className: cn(
16421
+ "bg-m3-secondary-container pointer-events-none",
16422
+ shapeStyle ? "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rounded-none" : "absolute inset-0 rounded-full"
16423
+ ),
16424
+ style: __spreadValues(__spreadValues({
16425
+ zIndex: 0,
16426
+ originX: 0.5,
16427
+ originY: 0.5
16428
+ }, shapeStyle ? { width, height } : {}), shapeStyle),
16224
16429
  initial: disableInitial ? false : { opacity: 0, scale: 0.5 },
16225
16430
  animate: { opacity: 1, scale: 1 },
16226
16431
  exit: { opacity: 0, scale: 0.5, transition: { duration: 0.15 } },
@@ -16228,11 +16433,42 @@ function ActivePill2({ layoutId, disableInitial = false }) {
16228
16433
  }
16229
16434
  );
16230
16435
  }
16231
- function HoverStateLayer2() {
16232
- return /* @__PURE__ */ jsx("div", { className: "absolute inset-0 rounded-full bg-m3-on-surface opacity-0 group-hover:opacity-[0.08] transition-opacity duration-200 pointer-events-none z-0" });
16436
+ function HoverStateLayer2({
16437
+ shape = "pill",
16438
+ width = 56,
16439
+ height = 32
16440
+ }) {
16441
+ const shapeStyle = getNavigationShapeStyle(shape, width, height);
16442
+ return /* @__PURE__ */ jsx(
16443
+ "div",
16444
+ {
16445
+ className: cn(
16446
+ "bg-m3-on-surface opacity-0 group-hover:opacity-[0.08] transition-opacity duration-200 pointer-events-none z-0",
16447
+ shapeStyle ? "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rounded-none" : "absolute inset-0 rounded-full"
16448
+ ),
16449
+ style: __spreadValues(__spreadValues({}, shapeStyle ? { width, height } : {}), shapeStyle)
16450
+ }
16451
+ );
16233
16452
  }
16234
- function RippleLayer2({ ripples, onRippleDone }) {
16235
- return /* @__PURE__ */ jsx("div", { className: "absolute inset-0 rounded-full overflow-hidden pointer-events-none z-0", children: /* @__PURE__ */ jsx(Ripple, { ripples, onRippleDone }) });
16453
+ function RippleLayer2({
16454
+ ripples,
16455
+ onRippleDone,
16456
+ shape = "pill",
16457
+ width = 56,
16458
+ height = 32
16459
+ }) {
16460
+ const shapeStyle = getNavigationShapeStyle(shape, width, height);
16461
+ return /* @__PURE__ */ jsx(
16462
+ "div",
16463
+ {
16464
+ className: cn(
16465
+ "overflow-hidden pointer-events-none z-0",
16466
+ shapeStyle ? "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rounded-none" : "absolute inset-0 rounded-full"
16467
+ ),
16468
+ style: __spreadValues(__spreadValues({}, shapeStyle ? { width, height } : {}), shapeStyle),
16469
+ children: /* @__PURE__ */ jsx(Ripple, { ripples, onRippleDone })
16470
+ }
16471
+ );
16236
16472
  }
16237
16473
  function IconContainer2({ selected, badge, children }) {
16238
16474
  return /* @__PURE__ */ jsxs(
@@ -16258,18 +16494,31 @@ var NavigationRailItemComponent = React61.forwardRef(
16258
16494
  onClick,
16259
16495
  disabled = false,
16260
16496
  badge,
16497
+ shape: shapeProp,
16498
+ shapeSize: shapeSizeProp,
16499
+ activeIndicatorWidth: activeIndicatorWidthProp,
16261
16500
  className,
16262
16501
  "aria-label": ariaLabelProp,
16263
16502
  asChild = false,
16264
16503
  children
16265
16504
  }, ref) => {
16266
- var _a;
16267
- const { variant, labelVisibility } = React61.useContext(
16268
- NavigationRailContext
16269
- );
16505
+ var _a, _b, _c, _d;
16506
+ const {
16507
+ variant,
16508
+ labelVisibility,
16509
+ shape: contextShape,
16510
+ shapeSize: contextShapeSize,
16511
+ activeIndicatorWidth: contextActiveIndicatorWidth
16512
+ } = React61.useContext(NavigationRailContext);
16513
+ const activeShape = (_a = shapeProp != null ? shapeProp : contextShape) != null ? _a : "pill";
16514
+ const isSquare = isSquareShape(activeShape);
16515
+ const resolvedShapeSize = (_b = shapeSizeProp != null ? shapeSizeProp : contextShapeSize) != null ? _b : 56;
16516
+ const activeIndicatorWidth = (_c = activeIndicatorWidthProp != null ? activeIndicatorWidthProp : contextActiveIndicatorWidth) != null ? _c : "hug";
16270
16517
  const isExpanded = variant === "expanded" || variant === "modal";
16271
16518
  const isModal = variant === "modal";
16272
16519
  const enableLayout = !isModal;
16520
+ const isExpandedPill = isExpanded && !isSquare;
16521
+ const expandedPillWidthClass = activeIndicatorWidth === "fill" ? "w-full" : "w-fit";
16273
16522
  const activePillId = `rail-pill-${React61.useId()}`;
16274
16523
  const { ripples, onPointerDown, removeRipple } = useRippleState({
16275
16524
  disabled
@@ -16294,6 +16543,8 @@ var NavigationRailItemComponent = React61.forwardRef(
16294
16543
  isExpanded ? "w-full flex-row items-center px-3 h-14" : "w-full flex-col justify-center h-14",
16295
16544
  className
16296
16545
  );
16546
+ const iconPillWidth = isSquare ? resolvedShapeSize : 56;
16547
+ const iconPillHeight = isSquare ? resolvedShapeSize : 32;
16297
16548
  if (asChild && children) {
16298
16549
  const child = React61.Children.only(children);
16299
16550
  const innerContent = /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -16303,31 +16554,71 @@ var NavigationRailItemComponent = React61.forwardRef(
16303
16554
  layout: enableLayout,
16304
16555
  className: cn(
16305
16556
  "relative flex z-10",
16306
- isExpanded ? "flex-row items-center w-fit h-14 px-4 gap-x-3 rounded-full" : "flex-col items-center justify-center w-full gap-y-1 rounded-full"
16557
+ isExpanded ? cn(
16558
+ "flex-row items-center h-14 px-4 gap-x-3 rounded-full",
16559
+ expandedPillWidthClass
16560
+ ) : "flex-col items-center justify-center w-full gap-y-1 rounded-full"
16307
16561
  ),
16308
16562
  children: [
16309
- isExpanded && /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsx(
16310
- ActivePill2,
16311
- {
16312
- layoutId: activePillId,
16313
- disableInitial: isModal
16314
- }
16315
- ) }),
16316
- isExpanded && /* @__PURE__ */ jsx(HoverStateLayer2, {}),
16317
- isExpanded && /* @__PURE__ */ jsx(RippleLayer2, { ripples, onRippleDone: removeRipple }),
16563
+ isExpandedPill && /* @__PURE__ */ jsxs(Fragment, { children: [
16564
+ /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsx(
16565
+ ActivePill2,
16566
+ {
16567
+ layoutId: activePillId,
16568
+ disableInitial: isModal,
16569
+ shape: activeShape
16570
+ }
16571
+ ) }),
16572
+ /* @__PURE__ */ jsx(HoverStateLayer2, { shape: activeShape }),
16573
+ /* @__PURE__ */ jsx(
16574
+ RippleLayer2,
16575
+ {
16576
+ ripples,
16577
+ onRippleDone: removeRipple,
16578
+ shape: activeShape
16579
+ }
16580
+ )
16581
+ ] }),
16318
16582
  /* @__PURE__ */ jsxs(
16319
16583
  m.div,
16320
16584
  {
16321
16585
  layout: enableLayout,
16322
16586
  className: cn(
16323
16587
  "relative flex items-center justify-center shrink-0 z-10",
16324
- isExpanded ? "size-6" : "h-8 w-14 mx-auto"
16588
+ isSquare ? "mx-auto" : isExpandedPill ? "size-6" : "h-8 w-14 mx-auto rounded-full"
16325
16589
  ),
16326
- style: { borderRadius: 9999 },
16590
+ style: isSquare ? { width: resolvedShapeSize, height: resolvedShapeSize } : void 0,
16327
16591
  children: [
16328
- !isExpanded && /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsx(ActivePill2, { layoutId: activePillId }) }),
16329
- !isExpanded && /* @__PURE__ */ jsx(HoverStateLayer2, {}),
16330
- !isExpanded && /* @__PURE__ */ jsx(RippleLayer2, { ripples, onRippleDone: removeRipple }),
16592
+ !isExpandedPill && /* @__PURE__ */ jsxs(Fragment, { children: [
16593
+ /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsx(
16594
+ ActivePill2,
16595
+ {
16596
+ layoutId: activePillId,
16597
+ disableInitial: isModal,
16598
+ shape: activeShape,
16599
+ width: iconPillWidth,
16600
+ height: iconPillHeight
16601
+ }
16602
+ ) }),
16603
+ /* @__PURE__ */ jsx(
16604
+ HoverStateLayer2,
16605
+ {
16606
+ shape: activeShape,
16607
+ width: iconPillWidth,
16608
+ height: iconPillHeight
16609
+ }
16610
+ ),
16611
+ /* @__PURE__ */ jsx(
16612
+ RippleLayer2,
16613
+ {
16614
+ ripples,
16615
+ onRippleDone: removeRipple,
16616
+ shape: activeShape,
16617
+ width: iconPillWidth,
16618
+ height: iconPillHeight
16619
+ }
16620
+ )
16621
+ ] }),
16331
16622
  /* @__PURE__ */ jsx(
16332
16623
  m.div,
16333
16624
  {
@@ -16349,10 +16640,10 @@ var NavigationRailItemComponent = React61.forwardRef(
16349
16640
  transition: SPRING_TRANSITION,
16350
16641
  className: cn(
16351
16642
  "z-10 transition-colors duration-200 whitespace-nowrap",
16352
- selected ? "text-m3-on-surface" : "text-m3-on-surface-variant",
16353
- isExpanded ? "text-sm font-medium tracking-wide text-left" : "text-xs font-medium tracking-wide"
16643
+ selected ? isExpandedPill ? "text-m3-on-secondary-container font-medium" : "text-m3-on-surface font-medium" : "text-m3-on-surface-variant font-medium",
16644
+ isExpanded ? "text-sm tracking-wide text-left" : "text-xs tracking-wide"
16354
16645
  ),
16355
- children: (_a = child.props.children) != null ? _a : label
16646
+ children: (_d = child.props.children) != null ? _d : label
16356
16647
  },
16357
16648
  "rail-label"
16358
16649
  ) })
@@ -16398,31 +16689,71 @@ var NavigationRailItemComponent = React61.forwardRef(
16398
16689
  layout: enableLayout,
16399
16690
  className: cn(
16400
16691
  "relative flex z-10",
16401
- isExpanded ? "flex-row items-center w-fit h-14 px-4 gap-x-3 rounded-full" : "flex-col items-center justify-center w-full gap-y-1 rounded-full"
16692
+ isExpanded ? cn(
16693
+ "flex-row items-center h-14 px-4 gap-x-3 rounded-full",
16694
+ expandedPillWidthClass
16695
+ ) : "flex-col items-center justify-center w-full gap-y-1 rounded-full"
16402
16696
  ),
16403
16697
  children: [
16404
- isExpanded && /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsx(
16405
- ActivePill2,
16406
- {
16407
- layoutId: activePillId,
16408
- disableInitial: isModal
16409
- }
16410
- ) }),
16411
- isExpanded && /* @__PURE__ */ jsx(HoverStateLayer2, {}),
16412
- isExpanded && /* @__PURE__ */ jsx(RippleLayer2, { ripples, onRippleDone: removeRipple }),
16698
+ isExpandedPill && /* @__PURE__ */ jsxs(Fragment, { children: [
16699
+ /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsx(
16700
+ ActivePill2,
16701
+ {
16702
+ layoutId: activePillId,
16703
+ disableInitial: isModal,
16704
+ shape: activeShape
16705
+ }
16706
+ ) }),
16707
+ /* @__PURE__ */ jsx(HoverStateLayer2, { shape: activeShape }),
16708
+ /* @__PURE__ */ jsx(
16709
+ RippleLayer2,
16710
+ {
16711
+ ripples,
16712
+ onRippleDone: removeRipple,
16713
+ shape: activeShape
16714
+ }
16715
+ )
16716
+ ] }),
16413
16717
  /* @__PURE__ */ jsxs(
16414
16718
  m.div,
16415
16719
  {
16416
16720
  layout: enableLayout,
16417
16721
  className: cn(
16418
16722
  "relative flex items-center justify-center shrink-0 z-10",
16419
- isExpanded ? "size-6" : "h-8 w-14 mx-auto"
16723
+ isSquare ? "mx-auto" : isExpandedPill ? "size-6" : "h-8 w-14 mx-auto rounded-full"
16420
16724
  ),
16421
- style: { borderRadius: 9999 },
16725
+ style: isSquare ? { width: resolvedShapeSize, height: resolvedShapeSize } : void 0,
16422
16726
  children: [
16423
- !isExpanded && /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsx(ActivePill2, { layoutId: activePillId }) }),
16424
- !isExpanded && /* @__PURE__ */ jsx(HoverStateLayer2, {}),
16425
- !isExpanded && /* @__PURE__ */ jsx(RippleLayer2, { ripples, onRippleDone: removeRipple }),
16727
+ !isExpandedPill && /* @__PURE__ */ jsxs(Fragment, { children: [
16728
+ /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsx(
16729
+ ActivePill2,
16730
+ {
16731
+ layoutId: activePillId,
16732
+ disableInitial: isModal,
16733
+ shape: activeShape,
16734
+ width: iconPillWidth,
16735
+ height: iconPillHeight
16736
+ }
16737
+ ) }),
16738
+ /* @__PURE__ */ jsx(
16739
+ HoverStateLayer2,
16740
+ {
16741
+ shape: activeShape,
16742
+ width: iconPillWidth,
16743
+ height: iconPillHeight
16744
+ }
16745
+ ),
16746
+ /* @__PURE__ */ jsx(
16747
+ RippleLayer2,
16748
+ {
16749
+ ripples,
16750
+ onRippleDone: removeRipple,
16751
+ shape: activeShape,
16752
+ width: iconPillWidth,
16753
+ height: iconPillHeight
16754
+ }
16755
+ )
16756
+ ] }),
16426
16757
  /* @__PURE__ */ jsx(
16427
16758
  m.div,
16428
16759
  {
@@ -16444,8 +16775,8 @@ var NavigationRailItemComponent = React61.forwardRef(
16444
16775
  transition: SPRING_TRANSITION,
16445
16776
  className: cn(
16446
16777
  "z-10 transition-colors duration-200 whitespace-nowrap",
16447
- selected ? "text-m3-on-surface" : "text-m3-on-surface-variant",
16448
- isExpanded ? "text-sm font-medium tracking-wide text-left" : "text-xs font-medium tracking-wide"
16778
+ selected ? isExpandedPill ? "text-m3-on-secondary-container font-medium" : "text-m3-on-surface font-medium" : "text-m3-on-surface-variant font-medium",
16779
+ isExpanded ? "text-sm tracking-wide text-left" : "text-xs tracking-wide"
16449
16780
  ),
16450
16781
  children: label
16451
16782
  },
@@ -16505,6 +16836,9 @@ var NavigationRailComponent = React61.forwardRef(
16505
16836
  ({
16506
16837
  variant = "collapsed",
16507
16838
  labelVisibility = "labeled",
16839
+ shape,
16840
+ shapeSize,
16841
+ activeIndicatorWidth = "hug",
16508
16842
  header,
16509
16843
  fab,
16510
16844
  fabPlacement = "contained",
@@ -16518,6 +16852,7 @@ var NavigationRailComponent = React61.forwardRef(
16518
16852
  style
16519
16853
  }, ref) => {
16520
16854
  const isModal = variant === "modal";
16855
+ const isExpanded = variant === "expanded" || variant === "modal";
16521
16856
  const isXr = variant === "xr";
16522
16857
  const isSpatial = isXr && fabPlacement === "spatialized";
16523
16858
  const applyAnimation = !isXr || !isSpatial;
@@ -16559,10 +16894,12 @@ var NavigationRailComponent = React61.forwardRef(
16559
16894
  transition: isModal ? MD3_MODAL_TRANSITION : SPRING_TRANSITION,
16560
16895
  children: [
16561
16896
  (header || fab && !isSpatial) && /* @__PURE__ */ jsxs(
16562
- "div",
16897
+ m.div,
16563
16898
  {
16899
+ layout: true,
16564
16900
  className: cn(
16565
- "flex w-full flex-col items-center justify-start shrink-0 empty:hidden",
16901
+ "flex w-full flex-col justify-start shrink-0 empty:hidden",
16902
+ isExpanded ? "items-start px-3" : "items-center",
16566
16903
  navHeaderSpacing
16567
16904
  ),
16568
16905
  children: [
@@ -16628,6 +16965,9 @@ var NavigationRailComponent = React61.forwardRef(
16628
16965
  const contextValue = {
16629
16966
  variant,
16630
16967
  labelVisibility,
16968
+ shape,
16969
+ shapeSize,
16970
+ activeIndicatorWidth,
16631
16971
  activeIndicatorTransition
16632
16972
  };
16633
16973
  if (isModal) {
@@ -23400,6 +23740,10 @@ var ToolbarToggleButtonTokens = {
23400
23740
  PaddingX: 16,
23401
23741
  Gap: 8
23402
23742
  };
23743
+ var ToolbarToggleButtonRadiusTokens = {
23744
+ pillRadius: 24,
23745
+ pressedRadius: 12
23746
+ };
23403
23747
  var ALIGNMENT_CLASS = {
23404
23748
  start: "justify-start",
23405
23749
  center: "justify-center",
@@ -23946,29 +24290,34 @@ var ToolbarToggleButton = React61.forwardRef(
23946
24290
  selected = false,
23947
24291
  icon,
23948
24292
  children,
23949
- pressScale = 0.95,
23950
- pressBounceOffset = 6,
24293
+ pressExpand = true,
24294
+ pressExpandRatio = 0.06,
23951
24295
  ripple = true,
23952
24296
  asChild = false,
23953
24297
  className,
23954
24298
  type = "button",
23955
24299
  disabled,
23956
- onPointerDown: onPointerDownProp
24300
+ onPointerDown: onPointerDownProp,
24301
+ onPointerUp: onPointerUpProp,
24302
+ onPointerLeave: onPointerLeaveProp
23957
24303
  } = _b, props = __objRest(_b, [
23958
24304
  "emphasis",
23959
24305
  "selected",
23960
24306
  "icon",
23961
24307
  "children",
23962
- "pressScale",
23963
- "pressBounceOffset",
24308
+ "pressExpand",
24309
+ "pressExpandRatio",
23964
24310
  "ripple",
23965
24311
  "asChild",
23966
24312
  "className",
23967
24313
  "type",
23968
24314
  "disabled",
23969
- "onPointerDown"
24315
+ "onPointerDown",
24316
+ "onPointerUp",
24317
+ "onPointerLeave"
23970
24318
  ]);
23971
24319
  const context = useToolbarContext();
24320
+ const [isPressed, setIsPressed] = React61.useState(false);
23972
24321
  const {
23973
24322
  ripples,
23974
24323
  onPointerDown: handleRipplePointerDown,
@@ -23978,6 +24327,7 @@ var ToolbarToggleButton = React61.forwardRef(
23978
24327
  });
23979
24328
  const handlePointerDown = React61.useCallback(
23980
24329
  (e) => {
24330
+ setIsPressed(true);
23981
24331
  if (!disabled && ripple) {
23982
24332
  handleRipplePointerDown(e);
23983
24333
  }
@@ -23985,7 +24335,21 @@ var ToolbarToggleButton = React61.forwardRef(
23985
24335
  },
23986
24336
  [disabled, ripple, handleRipplePointerDown, onPointerDownProp]
23987
24337
  );
23988
- const baseClasses = "relative overflow-hidden inline-flex items-center justify-center min-w-[95px] h-[48px] px-4 rounded-full text-sm font-medium transition-colors select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-current/40 disabled:pointer-events-none disabled:opacity-38";
24338
+ const handlePointerUp = React61.useCallback(
24339
+ (e) => {
24340
+ setIsPressed(false);
24341
+ onPointerUpProp == null ? void 0 : onPointerUpProp(e);
24342
+ },
24343
+ [onPointerUpProp]
24344
+ );
24345
+ const handlePointerLeave = React61.useCallback(
24346
+ (e) => {
24347
+ setIsPressed(false);
24348
+ onPointerLeaveProp == null ? void 0 : onPointerLeaveProp(e);
24349
+ },
24350
+ [onPointerLeaveProp]
24351
+ );
24352
+ const baseClasses = "relative overflow-hidden inline-flex items-center justify-center min-w-[95px] h-[48px] px-4 text-sm font-medium select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-current/40 disabled:pointer-events-none disabled:opacity-38";
23989
24353
  const variantClasses = {
23990
24354
  standard: selected ? "bg-current/16 text-current hover:bg-current/20 active:bg-current/24" : "bg-transparent text-current hover:bg-current/8 active:bg-current/12",
23991
24355
  tonal: selected ? "bg-m3-secondary-container text-m3-on-secondary-container hover:shadow-sm" : "bg-m3-surface-container-high text-m3-on-surface hover:bg-m3-surface-container-highest",
@@ -23997,27 +24361,17 @@ var ToolbarToggleButton = React61.forwardRef(
23997
24361
  context == null ? void 0 : context.itemClassName,
23998
24362
  className
23999
24363
  );
24000
- const whileTapConfig = React61.useMemo(
24364
+ const animateConfig = React61.useMemo(
24001
24365
  () => ({
24002
- scale: pressScale,
24003
- x: pressBounceOffset ? [
24004
- 0,
24005
- -pressBounceOffset,
24006
- pressBounceOffset,
24007
- -pressBounceOffset / 2,
24008
- pressBounceOffset / 2,
24009
- 0
24010
- ] : 0
24366
+ scaleX: pressExpand && isPressed ? 1 + pressExpandRatio : 1,
24367
+ borderRadius: isPressed ? ToolbarToggleButtonRadiusTokens.pressedRadius : ToolbarToggleButtonRadiusTokens.pillRadius
24011
24368
  }),
24012
- [pressScale, pressBounceOffset]
24369
+ [pressExpand, pressExpandRatio, isPressed]
24013
24370
  );
24014
24371
  const transitionConfig = React61.useMemo(
24015
- () => __spreadProps(__spreadValues({}, TOOLBAR_SPRING_TRANSITION), {
24016
- scale: TOOLBAR_SPRING_TRANSITION,
24017
- x: {
24018
- duration: 0.35,
24019
- ease: "easeInOut"
24020
- }
24372
+ () => ({
24373
+ scaleX: FAST_SPATIAL_SPRING,
24374
+ borderRadius: BUTTON_RADIUS_SPRING
24021
24375
  }),
24022
24376
  []
24023
24377
  );
@@ -24071,7 +24425,9 @@ var ToolbarToggleButton = React61.forwardRef(
24071
24425
  ref,
24072
24426
  "aria-pressed": selected,
24073
24427
  className: combinedClassName,
24074
- onPointerDown: handlePointerDown
24428
+ onPointerDown: handlePointerDown,
24429
+ onPointerUp: handlePointerUp,
24430
+ onPointerLeave: handlePointerLeave
24075
24431
  }, strippedProps), {
24076
24432
  children: React61.cloneElement(child, { children: innerChildContent })
24077
24433
  })
@@ -24084,9 +24440,13 @@ var ToolbarToggleButton = React61.forwardRef(
24084
24440
  type,
24085
24441
  "aria-pressed": selected,
24086
24442
  disabled,
24087
- whileTap: whileTapConfig,
24443
+ animate: animateConfig,
24088
24444
  transition: transitionConfig,
24445
+ initial: false,
24446
+ style: { transformOrigin: "center" },
24089
24447
  onPointerDown: handlePointerDown,
24448
+ onPointerUp: handlePointerUp,
24449
+ onPointerLeave: handlePointerLeave,
24090
24450
  className: combinedClassName
24091
24451
  }, props), {
24092
24452
  children: [