@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.js CHANGED
@@ -6749,6 +6749,7 @@ var ButtonComponent = React61__namespace.forwardRef(
6749
6749
  loading = false,
6750
6750
  loadingVariant = "loading-indicator",
6751
6751
  asChild = false,
6752
+ fullWidth = false,
6752
6753
  outlineWidth,
6753
6754
  children,
6754
6755
  onClick,
@@ -6771,6 +6772,7 @@ var ButtonComponent = React61__namespace.forwardRef(
6771
6772
  "loading",
6772
6773
  "loadingVariant",
6773
6774
  "asChild",
6775
+ "fullWidth",
6774
6776
  "outlineWidth",
6775
6777
  "children",
6776
6778
  "onClick",
@@ -6850,7 +6852,8 @@ var ButtonComponent = React61__namespace.forwardRef(
6850
6852
  [loading, onClick, onKeyDown]
6851
6853
  );
6852
6854
  const buttonClassName = cn(
6853
- "relative w-fit shrink-0 inline-flex flex-row items-center justify-center",
6855
+ "relative inline-flex flex-row items-center justify-center",
6856
+ fullWidth ? "w-full" : "w-fit shrink-0",
6854
6857
  "whitespace-nowrap select-none cursor-pointer",
6855
6858
  "transition-[background-color,color,border-color,box-shadow,opacity,filter] duration-200",
6856
6859
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-m3-primary focus-visible:ring-offset-2",
@@ -8036,7 +8039,9 @@ var FABComponent = React61__namespace.forwardRef(
8036
8039
  asChild = false,
8037
8040
  onClick,
8038
8041
  onKeyDown,
8039
- "aria-label": ariaLabel
8042
+ "aria-label": ariaLabel,
8043
+ layout,
8044
+ layoutId
8040
8045
  } = _b, restProps = __objRest(_b, [
8041
8046
  "className",
8042
8047
  "style",
@@ -8052,7 +8057,9 @@ var FABComponent = React61__namespace.forwardRef(
8052
8057
  "asChild",
8053
8058
  "onClick",
8054
8059
  "onKeyDown",
8055
- "aria-label"
8060
+ "aria-label",
8061
+ "layout",
8062
+ "layoutId"
8056
8063
  ]);
8057
8064
  var _a2, _b2, _c, _d;
8058
8065
  const colors = (_a2 = COLOR_CLASSES2[colorStyle]) != null ? _a2 : COLOR_CLASSES2.primary;
@@ -8093,7 +8100,9 @@ var FABComponent = React61__namespace.forwardRef(
8093
8100
  /* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
8094
8101
  /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "wait", initial: false, children: loading ? /* @__PURE__ */ jsxRuntime.jsx(
8095
8102
  react.m.span,
8096
- __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
8103
+ __spreadProps(__spreadValues({
8104
+ layout: "position"
8105
+ }, ICON_SPAN_VARIANTS), {
8097
8106
  transition: SPRING_TRANSITION,
8098
8107
  className: cn(
8099
8108
  "flex items-center justify-center shrink-0",
@@ -8120,7 +8129,9 @@ var FABComponent = React61__namespace.forwardRef(
8120
8129
  "loading"
8121
8130
  ) : /* @__PURE__ */ jsxRuntime.jsx(
8122
8131
  react.m.span,
8123
- __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
8132
+ __spreadProps(__spreadValues({
8133
+ layout: "position"
8134
+ }, ICON_SPAN_VARIANTS), {
8124
8135
  transition: SPRING_TRANSITION,
8125
8136
  "aria-hidden": "true",
8126
8137
  className: cn(
@@ -8134,10 +8145,15 @@ var FABComponent = React61__namespace.forwardRef(
8134
8145
  /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: extended && labelContent && /* @__PURE__ */ jsxRuntime.jsx(
8135
8146
  react.m.span,
8136
8147
  {
8148
+ layout: "position",
8137
8149
  initial: { width: 0, opacity: 0 },
8138
8150
  animate: { width: "auto", opacity: 1 },
8139
8151
  exit: { width: 0, opacity: 0 },
8140
- transition: SPRING_TRANSITION,
8152
+ transition: {
8153
+ opacity: { duration: 0.15, ease: "linear" },
8154
+ width: SPRING_TRANSITION,
8155
+ layout: SPRING_TRANSITION
8156
+ },
8141
8157
  className: "overflow-hidden whitespace-nowrap ml-3",
8142
8158
  children: labelContent
8143
8159
  },
@@ -8154,7 +8170,7 @@ var FABComponent = React61__namespace.forwardRef(
8154
8170
  colors.text,
8155
8171
  lowered ? "shadow-sm" : colors.shadow,
8156
8172
  (_d = SIZE_STYLES[size]) != null ? _d : "h-14 w-14",
8157
- extended && "w-auto px-6",
8173
+ extended && "w-auto pl-4 pr-6",
8158
8174
  SIZE_TEXT_CLASS[size],
8159
8175
  loading && "pointer-events-none opacity-75 cursor-not-allowed",
8160
8176
  className
@@ -8185,6 +8201,8 @@ var FABComponent = React61__namespace.forwardRef(
8185
8201
  __spreadProps(__spreadValues({
8186
8202
  ref,
8187
8203
  type: "button",
8204
+ layout: layout !== void 0 ? layout : true,
8205
+ layoutId,
8188
8206
  "aria-label": computedAriaLabel,
8189
8207
  "aria-busy": loading || void 0,
8190
8208
  "aria-disabled": loading || restProps.disabled,
@@ -8203,7 +8221,8 @@ var FABComponent = React61__namespace.forwardRef(
8203
8221
  transition: {
8204
8222
  borderRadius: SPRING_TRANSITION_FAST,
8205
8223
  scale: SPRING_TRANSITION,
8206
- opacity: { duration: 0.25, ease: "easeOut" }
8224
+ opacity: { duration: 0.25, ease: "easeOut" },
8225
+ layout: SPRING_TRANSITION
8207
8226
  },
8208
8227
  className: containerClassName
8209
8228
  }, restProps), {
@@ -15782,6 +15801,23 @@ var ListItemImpl = React61__namespace.forwardRef(
15782
15801
  );
15783
15802
  ListItemImpl.displayName = "ListItem";
15784
15803
  var ListItem = React61__namespace.memo(ListItemImpl);
15804
+
15805
+ // src/ui/navigation/navigation-shape-utils.ts
15806
+ function getNavigationShapeStyle(shape, width = 56, height = 56) {
15807
+ if (!shape || shape === "pill" || shape === "circle") {
15808
+ return void 0;
15809
+ }
15810
+ const polygon = MD3Shapes[shape];
15811
+ if (!polygon) {
15812
+ return void 0;
15813
+ }
15814
+ return {
15815
+ clipPath: toClipPath(polygon, width, height)
15816
+ };
15817
+ }
15818
+ function isSquareShape(shape) {
15819
+ return Boolean(shape && shape !== "pill");
15820
+ }
15785
15821
  var NavigationBarContext = React61__namespace.createContext({ variant: "flexible" });
15786
15822
  function cloneIconWithFill(icon, selected) {
15787
15823
  if (!React61__namespace.isValidElement(icon)) return icon;
@@ -15793,16 +15829,23 @@ function cloneIconWithFill(icon, selected) {
15793
15829
  }
15794
15830
  return icon;
15795
15831
  }
15796
- function ActivePill() {
15832
+ function ActivePill({
15833
+ shape = "pill",
15834
+ width = 56,
15835
+ height = 32
15836
+ }) {
15797
15837
  const { activeIndicatorTransition } = React61__namespace.useContext(NavigationBarContext);
15838
+ const shapeStyle = getNavigationShapeStyle(shape, width, height);
15798
15839
  return /* @__PURE__ */ jsxRuntime.jsx(
15799
15840
  react.m.div,
15800
15841
  {
15801
- className: "absolute inset-0 bg-m3-secondary-container pointer-events-none",
15802
- style: {
15803
- borderRadius: 9999,
15842
+ className: cn(
15843
+ "bg-m3-secondary-container pointer-events-none",
15844
+ 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"
15845
+ ),
15846
+ style: __spreadValues(__spreadValues({
15804
15847
  zIndex: 0
15805
- },
15848
+ }, shapeStyle ? { width, height } : {}), shapeStyle),
15806
15849
  initial: { opacity: 0, scale: 0.5 },
15807
15850
  animate: { opacity: 1, scale: 1 },
15808
15851
  exit: { opacity: 0, scale: 0.5 },
@@ -15810,11 +15853,42 @@ function ActivePill() {
15810
15853
  }
15811
15854
  );
15812
15855
  }
15813
- function HoverStateLayer() {
15814
- return /* @__PURE__ */ jsxRuntime.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" });
15856
+ function HoverStateLayer({
15857
+ shape = "pill",
15858
+ width = 56,
15859
+ height = 32
15860
+ }) {
15861
+ const shapeStyle = getNavigationShapeStyle(shape, width, height);
15862
+ return /* @__PURE__ */ jsxRuntime.jsx(
15863
+ "div",
15864
+ {
15865
+ className: cn(
15866
+ "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",
15867
+ 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]"
15868
+ ),
15869
+ style: __spreadValues(__spreadValues({}, shapeStyle ? { width, height } : {}), shapeStyle)
15870
+ }
15871
+ );
15815
15872
  }
15816
- function RippleLayer({ ripples, onRippleDone }) {
15817
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 rounded-full overflow-hidden pointer-events-none z-0", children: /* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone }) });
15873
+ function RippleLayer({
15874
+ ripples,
15875
+ onRippleDone,
15876
+ shape = "pill",
15877
+ width = 56,
15878
+ height = 32
15879
+ }) {
15880
+ const shapeStyle = getNavigationShapeStyle(shape, width, height);
15881
+ return /* @__PURE__ */ jsxRuntime.jsx(
15882
+ "div",
15883
+ {
15884
+ className: cn(
15885
+ "overflow-hidden pointer-events-none z-0",
15886
+ 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]"
15887
+ ),
15888
+ style: __spreadValues(__spreadValues({}, shapeStyle ? { width, height } : {}), shapeStyle),
15889
+ children: /* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone })
15890
+ }
15891
+ );
15818
15892
  }
15819
15893
  function IconContainer({ selected, badge, children }) {
15820
15894
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -15840,19 +15914,33 @@ var NavigationBarItemComponent = React61__namespace.forwardRef(
15840
15914
  onClick,
15841
15915
  disabled = false,
15842
15916
  badge,
15917
+ shape: shapeProp,
15918
+ shapeSize: shapeSizeProp,
15919
+ hideLabel = false,
15843
15920
  className,
15844
15921
  "aria-label": ariaLabelProp,
15845
15922
  asChild = false,
15846
15923
  children
15847
15924
  }, ref) => {
15848
- var _a;
15925
+ var _a, _b, _c;
15849
15926
  const {
15850
15927
  variant,
15851
15928
  itemLayout,
15929
+ shape: contextShape,
15930
+ labelVisibility: contextLabelVisibility,
15931
+ shapeSize: contextShapeSize,
15852
15932
  itemClassName: contextItemClassName
15853
15933
  } = React61__namespace.useContext(NavigationBarContext);
15934
+ const activeShape = (_a = shapeProp != null ? shapeProp : contextShape) != null ? _a : "pill";
15935
+ const isSquare = isSquareShape(activeShape);
15936
+ const resolvedShapeSize = (_b = shapeSizeProp != null ? shapeSizeProp : contextShapeSize) != null ? _b : 56;
15854
15937
  const isForcedHorizontal = itemLayout === "horizontal";
15855
15938
  const isResponsiveHorizontal = (variant === "flexible" || variant === "xr") && itemLayout === void 0;
15939
+ const shouldShowLabel = !hideLabel && (() => {
15940
+ if (contextLabelVisibility === "unlabeled") return false;
15941
+ if (contextLabelVisibility === "auto") return selected;
15942
+ return true;
15943
+ })();
15856
15944
  const { ripples, onPointerDown, removeRipple } = useRippleState({
15857
15945
  disabled
15858
15946
  });
@@ -15880,6 +15968,8 @@ var NavigationBarItemComponent = React61__namespace.forwardRef(
15880
15968
  contextItemClassName,
15881
15969
  className
15882
15970
  );
15971
+ const iconPillWidth = isSquare ? resolvedShapeSize : 56;
15972
+ const iconPillHeight = isSquare ? resolvedShapeSize : 32;
15883
15973
  if (asChild && children) {
15884
15974
  const child = React61__namespace.Children.only(children);
15885
15975
  const innerContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
@@ -15889,10 +15979,12 @@ var NavigationBarItemComponent = React61__namespace.forwardRef(
15889
15979
  className: cn(
15890
15980
  "relative flex items-center justify-center flex-col gap-y-1 w-full px-1 py-1.5",
15891
15981
  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",
15892
- isForcedHorizontal && "flex-row gap-y-0 gap-x-1.5 h-10 px-4 py-0 rounded-full w-auto"
15982
+ isForcedHorizontal && "flex-row gap-y-0 gap-x-1.5 h-10 px-4 py-0 rounded-full w-auto",
15983
+ // When label is hidden and not horizontal, remove bottom gap
15984
+ !shouldShowLabel && !isForcedHorizontal && "gap-y-0"
15893
15985
  ),
15894
15986
  children: [
15895
- /* @__PURE__ */ jsxRuntime.jsxs(
15987
+ !isSquare && /* @__PURE__ */ jsxRuntime.jsxs(
15896
15988
  "div",
15897
15989
  {
15898
15990
  className: cn(
@@ -15901,9 +15993,18 @@ var NavigationBarItemComponent = React61__namespace.forwardRef(
15901
15993
  isForcedHorizontal && "block!"
15902
15994
  ),
15903
15995
  children: [
15904
- /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsxRuntime.jsx(ActivePill, {}) }),
15905
- /* @__PURE__ */ jsxRuntime.jsx(HoverStateLayer, {}),
15906
- /* @__PURE__ */ jsxRuntime.jsx(RippleLayer, { ripples, onRippleDone: removeRipple })
15996
+ /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsxRuntime.jsx(ActivePill, { shape: activeShape, width: 56, height: 40 }) }),
15997
+ /* @__PURE__ */ jsxRuntime.jsx(HoverStateLayer, { shape: activeShape, width: 56, height: 40 }),
15998
+ /* @__PURE__ */ jsxRuntime.jsx(
15999
+ RippleLayer,
16000
+ {
16001
+ ripples,
16002
+ onRippleDone: removeRipple,
16003
+ shape: activeShape,
16004
+ width: 56,
16005
+ height: 40
16006
+ }
16007
+ )
15907
16008
  ]
15908
16009
  }
15909
16010
  ),
@@ -15912,23 +16013,47 @@ var NavigationBarItemComponent = React61__namespace.forwardRef(
15912
16013
  {
15913
16014
  className: cn(
15914
16015
  "relative flex items-center justify-center shrink-0 z-10",
15915
- "h-8 w-16 mx-auto rounded-full",
15916
- isResponsiveHorizontal && "min-[600px]:size-6 min-[600px]:w-auto min-[600px]:h-auto",
15917
- isForcedHorizontal && "size-6 w-auto h-auto"
16016
+ isSquare ? "mx-auto" : "h-8 w-14 mx-auto rounded-[16px]",
16017
+ !isSquare && isResponsiveHorizontal && "min-[600px]:size-6 min-[600px]:w-auto min-[600px]:h-auto",
16018
+ !isSquare && isForcedHorizontal && "size-6 w-auto h-auto"
15918
16019
  ),
16020
+ style: isSquare ? { width: resolvedShapeSize, height: resolvedShapeSize } : void 0,
15919
16021
  children: [
15920
16022
  /* @__PURE__ */ jsxRuntime.jsxs(
15921
16023
  "div",
15922
16024
  {
15923
16025
  className: cn(
15924
16026
  "absolute inset-0 z-0",
15925
- isResponsiveHorizontal && "min-[600px]:hidden",
15926
- isForcedHorizontal && "hidden"
16027
+ !isSquare && isResponsiveHorizontal && "min-[600px]:hidden",
16028
+ !isSquare && isForcedHorizontal && "hidden"
15927
16029
  ),
15928
16030
  children: [
15929
- /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsxRuntime.jsx(ActivePill, {}) }),
15930
- /* @__PURE__ */ jsxRuntime.jsx(HoverStateLayer, {}),
15931
- /* @__PURE__ */ jsxRuntime.jsx(RippleLayer, { ripples, onRippleDone: removeRipple })
16031
+ /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsxRuntime.jsx(
16032
+ ActivePill,
16033
+ {
16034
+ shape: activeShape,
16035
+ width: iconPillWidth,
16036
+ height: iconPillHeight
16037
+ }
16038
+ ) }),
16039
+ /* @__PURE__ */ jsxRuntime.jsx(
16040
+ HoverStateLayer,
16041
+ {
16042
+ shape: activeShape,
16043
+ width: iconPillWidth,
16044
+ height: iconPillHeight
16045
+ }
16046
+ ),
16047
+ /* @__PURE__ */ jsxRuntime.jsx(
16048
+ RippleLayer,
16049
+ {
16050
+ ripples,
16051
+ onRippleDone: removeRipple,
16052
+ shape: activeShape,
16053
+ width: iconPillWidth,
16054
+ height: iconPillHeight
16055
+ }
16056
+ )
15932
16057
  ]
15933
16058
  }
15934
16059
  ),
@@ -15936,15 +16061,19 @@ var NavigationBarItemComponent = React61__namespace.forwardRef(
15936
16061
  ]
15937
16062
  }
15938
16063
  ),
15939
- /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "popLayout", children: /* @__PURE__ */ jsxRuntime.jsx(
15940
- "span",
16064
+ label && /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "popLayout", initial: false, children: shouldShowLabel && /* @__PURE__ */ jsxRuntime.jsx(
16065
+ react.m.span,
15941
16066
  {
16067
+ initial: { opacity: 0, height: 0, scale: 0.85, y: -2 },
16068
+ animate: { opacity: 1, height: "auto", scale: 1, y: 0 },
16069
+ exit: { opacity: 0, height: 0, scale: 0.85, y: -2 },
16070
+ transition: SPRING_TRANSITION_EXPRESSIVE,
15942
16071
  className: cn(
15943
- "z-10 transition-all duration-200 truncate px-1",
15944
- selected ? "text-m3-on-surface" : "text-m3-on-surface-variant",
15945
- "font-medium text-[12px] leading-4 tracking-[0.5px]"
16072
+ "z-10 transition-colors duration-200 truncate px-1 inline-block overflow-hidden",
16073
+ selected ? "text-m3-on-surface font-medium" : "text-m3-on-surface-variant font-medium",
16074
+ "text-[12px] leading-4 tracking-[0.5px]"
15946
16075
  ),
15947
- children: (_a = child.props.children) != null ? _a : label
16076
+ children: (_c = child.props.children) != null ? _c : label
15948
16077
  },
15949
16078
  "nav-label"
15950
16079
  ) })
@@ -15960,7 +16089,10 @@ var NavigationBarItemComponent = React61__namespace.forwardRef(
15960
16089
  role: "menuitem",
15961
16090
  "aria-current": selected ? "page" : void 0,
15962
16091
  "aria-disabled": disabled ? true : void 0,
15963
- "aria-label": ariaLabelProp || (typeof label === "string" ? label : void 0),
16092
+ "aria-label": (
16093
+ // Always provide aria-label even when label is visually hidden
16094
+ ariaLabelProp || (typeof label === "string" ? label : void 0)
16095
+ ),
15964
16096
  onClick: handleClick,
15965
16097
  onPointerDown,
15966
16098
  className: itemClassName,
@@ -15976,7 +16108,10 @@ var NavigationBarItemComponent = React61__namespace.forwardRef(
15976
16108
  role: "menuitem",
15977
16109
  "aria-current": selected ? "page" : void 0,
15978
16110
  "aria-disabled": disabled ? true : void 0,
15979
- "aria-label": ariaLabelProp || (typeof label === "string" ? label : void 0),
16111
+ "aria-label": (
16112
+ // Always provide aria-label even when label is visually hidden
16113
+ ariaLabelProp || (typeof label === "string" ? label : void 0)
16114
+ ),
15980
16115
  onClick: handleClick,
15981
16116
  onPointerDown,
15982
16117
  className: itemClassName,
@@ -15987,10 +16122,12 @@ var NavigationBarItemComponent = React61__namespace.forwardRef(
15987
16122
  className: cn(
15988
16123
  "relative flex items-center justify-center flex-col gap-y-1 w-full px-1 py-1.5",
15989
16124
  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",
15990
- isForcedHorizontal && "flex-row gap-y-0 gap-x-1.5 h-10 px-4 py-0 rounded-full w-auto"
16125
+ isForcedHorizontal && "flex-row gap-y-0 gap-x-1.5 h-10 px-4 py-0 rounded-full w-auto",
16126
+ // When label is hidden and not horizontal, remove bottom gap
16127
+ !shouldShowLabel && !isForcedHorizontal && "gap-y-0"
15991
16128
  ),
15992
16129
  children: [
15993
- /* @__PURE__ */ jsxRuntime.jsxs(
16130
+ !isSquare && /* @__PURE__ */ jsxRuntime.jsxs(
15994
16131
  "div",
15995
16132
  {
15996
16133
  className: cn(
@@ -15999,9 +16136,18 @@ var NavigationBarItemComponent = React61__namespace.forwardRef(
15999
16136
  isForcedHorizontal && "block!"
16000
16137
  ),
16001
16138
  children: [
16002
- /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsxRuntime.jsx(ActivePill, {}) }),
16003
- /* @__PURE__ */ jsxRuntime.jsx(HoverStateLayer, {}),
16004
- /* @__PURE__ */ jsxRuntime.jsx(RippleLayer, { ripples, onRippleDone: removeRipple })
16139
+ /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsxRuntime.jsx(ActivePill, { shape: activeShape, width: 56, height: 40 }) }),
16140
+ /* @__PURE__ */ jsxRuntime.jsx(HoverStateLayer, { shape: activeShape, width: 56, height: 40 }),
16141
+ /* @__PURE__ */ jsxRuntime.jsx(
16142
+ RippleLayer,
16143
+ {
16144
+ ripples,
16145
+ onRippleDone: removeRipple,
16146
+ shape: activeShape,
16147
+ width: 56,
16148
+ height: 40
16149
+ }
16150
+ )
16005
16151
  ]
16006
16152
  }
16007
16153
  ),
@@ -16010,23 +16156,47 @@ var NavigationBarItemComponent = React61__namespace.forwardRef(
16010
16156
  {
16011
16157
  className: cn(
16012
16158
  "relative flex items-center justify-center shrink-0 z-10",
16013
- "h-8 w-16 mx-auto rounded-full",
16014
- isResponsiveHorizontal && "min-[600px]:size-6 min-[600px]:w-auto min-[600px]:h-auto",
16015
- isForcedHorizontal && "size-6 w-auto h-auto"
16159
+ isSquare ? "mx-auto" : "h-8 w-14 mx-auto rounded-[16px]",
16160
+ !isSquare && isResponsiveHorizontal && "min-[600px]:size-6 min-[600px]:w-auto min-[600px]:h-auto",
16161
+ !isSquare && isForcedHorizontal && "size-6 w-auto h-auto"
16016
16162
  ),
16163
+ style: isSquare ? { width: resolvedShapeSize, height: resolvedShapeSize } : void 0,
16017
16164
  children: [
16018
16165
  /* @__PURE__ */ jsxRuntime.jsxs(
16019
16166
  "div",
16020
16167
  {
16021
16168
  className: cn(
16022
16169
  "absolute inset-0 z-0",
16023
- isResponsiveHorizontal && "min-[600px]:hidden",
16024
- isForcedHorizontal && "hidden"
16170
+ !isSquare && isResponsiveHorizontal && "min-[600px]:hidden",
16171
+ !isSquare && isForcedHorizontal && "hidden"
16025
16172
  ),
16026
16173
  children: [
16027
- /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsxRuntime.jsx(ActivePill, {}) }),
16028
- /* @__PURE__ */ jsxRuntime.jsx(HoverStateLayer, {}),
16029
- /* @__PURE__ */ jsxRuntime.jsx(RippleLayer, { ripples, onRippleDone: removeRipple })
16174
+ /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsxRuntime.jsx(
16175
+ ActivePill,
16176
+ {
16177
+ shape: activeShape,
16178
+ width: iconPillWidth,
16179
+ height: iconPillHeight
16180
+ }
16181
+ ) }),
16182
+ /* @__PURE__ */ jsxRuntime.jsx(
16183
+ HoverStateLayer,
16184
+ {
16185
+ shape: activeShape,
16186
+ width: iconPillWidth,
16187
+ height: iconPillHeight
16188
+ }
16189
+ ),
16190
+ /* @__PURE__ */ jsxRuntime.jsx(
16191
+ RippleLayer,
16192
+ {
16193
+ ripples,
16194
+ onRippleDone: removeRipple,
16195
+ shape: activeShape,
16196
+ width: iconPillWidth,
16197
+ height: iconPillHeight
16198
+ }
16199
+ )
16030
16200
  ]
16031
16201
  }
16032
16202
  ),
@@ -16034,13 +16204,17 @@ var NavigationBarItemComponent = React61__namespace.forwardRef(
16034
16204
  ]
16035
16205
  }
16036
16206
  ),
16037
- /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "popLayout", children: /* @__PURE__ */ jsxRuntime.jsx(
16038
- "span",
16207
+ label && /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "popLayout", initial: false, children: shouldShowLabel && /* @__PURE__ */ jsxRuntime.jsx(
16208
+ react.m.span,
16039
16209
  {
16210
+ initial: { opacity: 0, height: 0, scale: 0.85, y: -2 },
16211
+ animate: { opacity: 1, height: "auto", scale: 1, y: 0 },
16212
+ exit: { opacity: 0, height: 0, scale: 0.85, y: -2 },
16213
+ transition: SPRING_TRANSITION_EXPRESSIVE,
16040
16214
  className: cn(
16041
- "z-10 transition-all duration-200 truncate px-1",
16042
- selected ? "text-m3-on-surface" : "text-m3-on-surface-variant",
16043
- "font-medium text-[12px] leading-4 tracking-[0.5px]"
16215
+ "z-10 transition-colors duration-200 truncate px-1 inline-block overflow-hidden",
16216
+ selected ? "text-m3-on-surface font-medium" : "text-m3-on-surface-variant font-medium",
16217
+ "text-[12px] leading-4 tracking-[0.5px]"
16044
16218
  ),
16045
16219
  children: label
16046
16220
  },
@@ -16062,9 +16236,9 @@ var navContainerVariants = classVarianceAuthority.cva(
16062
16236
  {
16063
16237
  variants: {
16064
16238
  variant: {
16065
- flexible: "bottom-0 left-0 right-0 w-full h-16 pb-safe",
16066
- baseline: "bottom-0 left-0 right-0 w-full h-20 pb-safe",
16067
- 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"
16239
+ flexible: "bottom-0 left-0 right-0 w-full min-h-16 py-1 pb-safe",
16240
+ baseline: "bottom-0 left-0 right-0 w-full min-h-20 py-1 pb-safe",
16241
+ 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"
16068
16242
  },
16069
16243
  position: {
16070
16244
  fixed: "fixed",
@@ -16086,6 +16260,9 @@ var NavigationBarComponent = React61__namespace.forwardRef(
16086
16260
  ({
16087
16261
  variant = "flexible",
16088
16262
  itemLayout,
16263
+ shape,
16264
+ labelVisibility,
16265
+ shapeSize,
16089
16266
  hideOnScroll = false,
16090
16267
  elevated = false,
16091
16268
  fixed = true,
@@ -16100,6 +16277,13 @@ var NavigationBarComponent = React61__namespace.forwardRef(
16100
16277
  const lastScrollY = React61__namespace.useRef(
16101
16278
  typeof window !== "undefined" ? window.scrollY : 0
16102
16279
  );
16280
+ const isSquare = isSquareShape(shape);
16281
+ const effectiveShapeSize = shapeSize != null ? shapeSize : isSquare ? 56 : 32;
16282
+ const computedMinHeight = React61__namespace.useMemo(() => {
16283
+ const baseHeight = variant === "baseline" ? 80 : 64;
16284
+ const requiredHeight = itemLayout === "horizontal" || labelVisibility === "unlabeled" ? effectiveShapeSize + 16 : effectiveShapeSize + 32;
16285
+ return Math.max(baseHeight, requiredHeight);
16286
+ }, [variant, itemLayout, labelVisibility, effectiveShapeSize]);
16103
16287
  React61__namespace.useEffect(() => {
16104
16288
  if (typeof window === "undefined" || !hideOnScroll) {
16105
16289
  setIsVisible(true);
@@ -16146,6 +16330,9 @@ var NavigationBarComponent = React61__namespace.forwardRef(
16146
16330
  value: {
16147
16331
  variant,
16148
16332
  itemLayout,
16333
+ shape,
16334
+ labelVisibility,
16335
+ shapeSize,
16149
16336
  activeIndicatorTransition,
16150
16337
  itemClassName
16151
16338
  },
@@ -16156,7 +16343,7 @@ var NavigationBarComponent = React61__namespace.forwardRef(
16156
16343
  role: "navigation",
16157
16344
  "aria-label": "Main navigation",
16158
16345
  className: navBaseClasses,
16159
- style,
16346
+ style: __spreadValues({ minHeight: computedMinHeight }, style),
16160
16347
  initial: false,
16161
16348
  animate: {
16162
16349
  y: isVisible ? "0%" : variant === "xr" ? "calc(100% + 40px)" : "100%"
@@ -16168,8 +16355,8 @@ var NavigationBarComponent = React61__namespace.forwardRef(
16168
16355
  role: "menubar",
16169
16356
  "aria-orientation": "horizontal",
16170
16357
  className: cn(
16171
- "flex w-full h-full mx-auto",
16172
- variant === "xr" ? "gap-0 min-[600px]:gap-1.5 items-center justify-center px-1" : "max-w-7xl gap-1.5"
16358
+ "flex w-full h-full mx-auto items-center justify-center",
16359
+ variant === "xr" ? "gap-0 min-[600px]:gap-1.5 px-1" : "max-w-7xl gap-1.5"
16173
16360
  ),
16174
16361
  children
16175
16362
  }
@@ -16182,7 +16369,11 @@ var NavigationBarComponent = React61__namespace.forwardRef(
16182
16369
  );
16183
16370
  NavigationBarComponent.displayName = "NavigationBar";
16184
16371
  var NavigationBar = React61__namespace.memo(NavigationBarComponent);
16185
- var NavigationRailContext = React61__namespace.createContext({ variant: "collapsed", labelVisibility: "labeled" });
16372
+ var NavigationRailContext = React61__namespace.createContext({
16373
+ variant: "collapsed",
16374
+ labelVisibility: "labeled",
16375
+ activeIndicatorWidth: "hug"
16376
+ });
16186
16377
  var MD3_MODAL_TRANSITION = {
16187
16378
  type: "tween",
16188
16379
  ease: [0.05, 0.7, 0.1, 1],
@@ -16193,9 +16384,9 @@ var railContainerVariants = classVarianceAuthority.cva(
16193
16384
  {
16194
16385
  variants: {
16195
16386
  variant: {
16196
- collapsed: "items-center h-full pt-11 pb-4 shadow-none bg-m3-surface rounded-none",
16197
- expanded: "items-start h-full pt-11 pb-4 shadow-none bg-m3-surface rounded-none",
16198
- modal: "bg-m3-surface shadow-lg rounded-r-[var(--m3-shape-corner-large)] h-full pt-11 pb-4",
16387
+ collapsed: "items-center h-full pt-11 pb-14 shadow-none bg-m3-surface rounded-none",
16388
+ expanded: "items-start h-full pt-11 pb-14 shadow-none bg-m3-surface rounded-none",
16389
+ modal: "bg-m3-surface shadow-lg rounded-r-[var(--m3-shape-corner-large)] h-full pt-11 pb-14",
16199
16390
  xr: "h-fit py-5 rounded-[48px] shadow-xl bg-m3-surface border border-white/5"
16200
16391
  },
16201
16392
  narrow: {
@@ -16238,14 +16429,28 @@ function setFocusedItem(items, index) {
16238
16429
  target.focus();
16239
16430
  }
16240
16431
  }
16241
- function ActivePill2({ layoutId, disableInitial = false }) {
16432
+ function ActivePill2({
16433
+ layoutId,
16434
+ disableInitial = false,
16435
+ shape = "pill",
16436
+ width = 56,
16437
+ height = 32
16438
+ }) {
16242
16439
  const { activeIndicatorTransition } = React61__namespace.useContext(NavigationRailContext);
16440
+ const shapeStyle = getNavigationShapeStyle(shape, width, height);
16243
16441
  return /* @__PURE__ */ jsxRuntime.jsx(
16244
16442
  react.m.div,
16245
16443
  {
16246
16444
  layoutId,
16247
- className: "absolute inset-0 bg-m3-secondary-container pointer-events-none",
16248
- style: { borderRadius: 9999, zIndex: 0, originX: 0.5, originY: 0.5 },
16445
+ className: cn(
16446
+ "bg-m3-secondary-container pointer-events-none",
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({
16450
+ zIndex: 0,
16451
+ originX: 0.5,
16452
+ originY: 0.5
16453
+ }, shapeStyle ? { width, height } : {}), shapeStyle),
16249
16454
  initial: disableInitial ? false : { opacity: 0, scale: 0.5 },
16250
16455
  animate: { opacity: 1, scale: 1 },
16251
16456
  exit: { opacity: 0, scale: 0.5, transition: { duration: 0.15 } },
@@ -16253,11 +16458,42 @@ function ActivePill2({ layoutId, disableInitial = false }) {
16253
16458
  }
16254
16459
  );
16255
16460
  }
16256
- function HoverStateLayer2() {
16257
- return /* @__PURE__ */ jsxRuntime.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" });
16461
+ function HoverStateLayer2({
16462
+ shape = "pill",
16463
+ width = 56,
16464
+ height = 32
16465
+ }) {
16466
+ const shapeStyle = getNavigationShapeStyle(shape, width, height);
16467
+ return /* @__PURE__ */ jsxRuntime.jsx(
16468
+ "div",
16469
+ {
16470
+ className: cn(
16471
+ "bg-m3-on-surface opacity-0 group-hover:opacity-[0.08] transition-opacity duration-200 pointer-events-none z-0",
16472
+ shapeStyle ? "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rounded-none" : "absolute inset-0 rounded-full"
16473
+ ),
16474
+ style: __spreadValues(__spreadValues({}, shapeStyle ? { width, height } : {}), shapeStyle)
16475
+ }
16476
+ );
16258
16477
  }
16259
- function RippleLayer2({ ripples, onRippleDone }) {
16260
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 rounded-full overflow-hidden pointer-events-none z-0", children: /* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone }) });
16478
+ function RippleLayer2({
16479
+ ripples,
16480
+ onRippleDone,
16481
+ shape = "pill",
16482
+ width = 56,
16483
+ height = 32
16484
+ }) {
16485
+ const shapeStyle = getNavigationShapeStyle(shape, width, height);
16486
+ return /* @__PURE__ */ jsxRuntime.jsx(
16487
+ "div",
16488
+ {
16489
+ className: cn(
16490
+ "overflow-hidden pointer-events-none z-0",
16491
+ shapeStyle ? "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rounded-none" : "absolute inset-0 rounded-full"
16492
+ ),
16493
+ style: __spreadValues(__spreadValues({}, shapeStyle ? { width, height } : {}), shapeStyle),
16494
+ children: /* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone })
16495
+ }
16496
+ );
16261
16497
  }
16262
16498
  function IconContainer2({ selected, badge, children }) {
16263
16499
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -16283,18 +16519,31 @@ var NavigationRailItemComponent = React61__namespace.forwardRef(
16283
16519
  onClick,
16284
16520
  disabled = false,
16285
16521
  badge,
16522
+ shape: shapeProp,
16523
+ shapeSize: shapeSizeProp,
16524
+ activeIndicatorWidth: activeIndicatorWidthProp,
16286
16525
  className,
16287
16526
  "aria-label": ariaLabelProp,
16288
16527
  asChild = false,
16289
16528
  children
16290
16529
  }, ref) => {
16291
- var _a;
16292
- const { variant, labelVisibility } = React61__namespace.useContext(
16293
- NavigationRailContext
16294
- );
16530
+ var _a, _b, _c, _d;
16531
+ const {
16532
+ variant,
16533
+ labelVisibility,
16534
+ shape: contextShape,
16535
+ shapeSize: contextShapeSize,
16536
+ activeIndicatorWidth: contextActiveIndicatorWidth
16537
+ } = React61__namespace.useContext(NavigationRailContext);
16538
+ const activeShape = (_a = shapeProp != null ? shapeProp : contextShape) != null ? _a : "pill";
16539
+ const isSquare = isSquareShape(activeShape);
16540
+ const resolvedShapeSize = (_b = shapeSizeProp != null ? shapeSizeProp : contextShapeSize) != null ? _b : 56;
16541
+ const activeIndicatorWidth = (_c = activeIndicatorWidthProp != null ? activeIndicatorWidthProp : contextActiveIndicatorWidth) != null ? _c : "hug";
16295
16542
  const isExpanded = variant === "expanded" || variant === "modal";
16296
16543
  const isModal = variant === "modal";
16297
16544
  const enableLayout = !isModal;
16545
+ const isExpandedPill = isExpanded && !isSquare;
16546
+ const expandedPillWidthClass = activeIndicatorWidth === "fill" ? "w-full" : "w-fit";
16298
16547
  const activePillId = `rail-pill-${React61__namespace.useId()}`;
16299
16548
  const { ripples, onPointerDown, removeRipple } = useRippleState({
16300
16549
  disabled
@@ -16319,6 +16568,8 @@ var NavigationRailItemComponent = React61__namespace.forwardRef(
16319
16568
  isExpanded ? "w-full flex-row items-center px-3 h-14" : "w-full flex-col justify-center h-14",
16320
16569
  className
16321
16570
  );
16571
+ const iconPillWidth = isSquare ? resolvedShapeSize : 56;
16572
+ const iconPillHeight = isSquare ? resolvedShapeSize : 32;
16322
16573
  if (asChild && children) {
16323
16574
  const child = React61__namespace.Children.only(children);
16324
16575
  const innerContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
@@ -16328,31 +16579,71 @@ var NavigationRailItemComponent = React61__namespace.forwardRef(
16328
16579
  layout: enableLayout,
16329
16580
  className: cn(
16330
16581
  "relative flex z-10",
16331
- 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"
16582
+ isExpanded ? cn(
16583
+ "flex-row items-center h-14 px-4 gap-x-3 rounded-full",
16584
+ expandedPillWidthClass
16585
+ ) : "flex-col items-center justify-center w-full gap-y-1 rounded-full"
16332
16586
  ),
16333
16587
  children: [
16334
- isExpanded && /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsxRuntime.jsx(
16335
- ActivePill2,
16336
- {
16337
- layoutId: activePillId,
16338
- disableInitial: isModal
16339
- }
16340
- ) }),
16341
- isExpanded && /* @__PURE__ */ jsxRuntime.jsx(HoverStateLayer2, {}),
16342
- isExpanded && /* @__PURE__ */ jsxRuntime.jsx(RippleLayer2, { ripples, onRippleDone: removeRipple }),
16588
+ isExpandedPill && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
16589
+ /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsxRuntime.jsx(
16590
+ ActivePill2,
16591
+ {
16592
+ layoutId: activePillId,
16593
+ disableInitial: isModal,
16594
+ shape: activeShape
16595
+ }
16596
+ ) }),
16597
+ /* @__PURE__ */ jsxRuntime.jsx(HoverStateLayer2, { shape: activeShape }),
16598
+ /* @__PURE__ */ jsxRuntime.jsx(
16599
+ RippleLayer2,
16600
+ {
16601
+ ripples,
16602
+ onRippleDone: removeRipple,
16603
+ shape: activeShape
16604
+ }
16605
+ )
16606
+ ] }),
16343
16607
  /* @__PURE__ */ jsxRuntime.jsxs(
16344
16608
  react.m.div,
16345
16609
  {
16346
16610
  layout: enableLayout,
16347
16611
  className: cn(
16348
16612
  "relative flex items-center justify-center shrink-0 z-10",
16349
- isExpanded ? "size-6" : "h-8 w-14 mx-auto"
16613
+ isSquare ? "mx-auto" : isExpandedPill ? "size-6" : "h-8 w-14 mx-auto rounded-full"
16350
16614
  ),
16351
- style: { borderRadius: 9999 },
16615
+ style: isSquare ? { width: resolvedShapeSize, height: resolvedShapeSize } : void 0,
16352
16616
  children: [
16353
- !isExpanded && /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsxRuntime.jsx(ActivePill2, { layoutId: activePillId }) }),
16354
- !isExpanded && /* @__PURE__ */ jsxRuntime.jsx(HoverStateLayer2, {}),
16355
- !isExpanded && /* @__PURE__ */ jsxRuntime.jsx(RippleLayer2, { ripples, onRippleDone: removeRipple }),
16617
+ !isExpandedPill && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
16618
+ /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsxRuntime.jsx(
16619
+ ActivePill2,
16620
+ {
16621
+ layoutId: activePillId,
16622
+ disableInitial: isModal,
16623
+ shape: activeShape,
16624
+ width: iconPillWidth,
16625
+ height: iconPillHeight
16626
+ }
16627
+ ) }),
16628
+ /* @__PURE__ */ jsxRuntime.jsx(
16629
+ HoverStateLayer2,
16630
+ {
16631
+ shape: activeShape,
16632
+ width: iconPillWidth,
16633
+ height: iconPillHeight
16634
+ }
16635
+ ),
16636
+ /* @__PURE__ */ jsxRuntime.jsx(
16637
+ RippleLayer2,
16638
+ {
16639
+ ripples,
16640
+ onRippleDone: removeRipple,
16641
+ shape: activeShape,
16642
+ width: iconPillWidth,
16643
+ height: iconPillHeight
16644
+ }
16645
+ )
16646
+ ] }),
16356
16647
  /* @__PURE__ */ jsxRuntime.jsx(
16357
16648
  react.m.div,
16358
16649
  {
@@ -16374,10 +16665,10 @@ var NavigationRailItemComponent = React61__namespace.forwardRef(
16374
16665
  transition: SPRING_TRANSITION,
16375
16666
  className: cn(
16376
16667
  "z-10 transition-colors duration-200 whitespace-nowrap",
16377
- selected ? "text-m3-on-surface" : "text-m3-on-surface-variant",
16378
- isExpanded ? "text-sm font-medium tracking-wide text-left" : "text-xs font-medium tracking-wide"
16668
+ selected ? isExpandedPill ? "text-m3-on-secondary-container font-medium" : "text-m3-on-surface font-medium" : "text-m3-on-surface-variant font-medium",
16669
+ isExpanded ? "text-sm tracking-wide text-left" : "text-xs tracking-wide"
16379
16670
  ),
16380
- children: (_a = child.props.children) != null ? _a : label
16671
+ children: (_d = child.props.children) != null ? _d : label
16381
16672
  },
16382
16673
  "rail-label"
16383
16674
  ) })
@@ -16423,31 +16714,71 @@ var NavigationRailItemComponent = React61__namespace.forwardRef(
16423
16714
  layout: enableLayout,
16424
16715
  className: cn(
16425
16716
  "relative flex z-10",
16426
- 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"
16717
+ isExpanded ? cn(
16718
+ "flex-row items-center h-14 px-4 gap-x-3 rounded-full",
16719
+ expandedPillWidthClass
16720
+ ) : "flex-col items-center justify-center w-full gap-y-1 rounded-full"
16427
16721
  ),
16428
16722
  children: [
16429
- isExpanded && /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsxRuntime.jsx(
16430
- ActivePill2,
16431
- {
16432
- layoutId: activePillId,
16433
- disableInitial: isModal
16434
- }
16435
- ) }),
16436
- isExpanded && /* @__PURE__ */ jsxRuntime.jsx(HoverStateLayer2, {}),
16437
- isExpanded && /* @__PURE__ */ jsxRuntime.jsx(RippleLayer2, { ripples, onRippleDone: removeRipple }),
16723
+ isExpandedPill && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
16724
+ /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsxRuntime.jsx(
16725
+ ActivePill2,
16726
+ {
16727
+ layoutId: activePillId,
16728
+ disableInitial: isModal,
16729
+ shape: activeShape
16730
+ }
16731
+ ) }),
16732
+ /* @__PURE__ */ jsxRuntime.jsx(HoverStateLayer2, { shape: activeShape }),
16733
+ /* @__PURE__ */ jsxRuntime.jsx(
16734
+ RippleLayer2,
16735
+ {
16736
+ ripples,
16737
+ onRippleDone: removeRipple,
16738
+ shape: activeShape
16739
+ }
16740
+ )
16741
+ ] }),
16438
16742
  /* @__PURE__ */ jsxRuntime.jsxs(
16439
16743
  react.m.div,
16440
16744
  {
16441
16745
  layout: enableLayout,
16442
16746
  className: cn(
16443
16747
  "relative flex items-center justify-center shrink-0 z-10",
16444
- isExpanded ? "size-6" : "h-8 w-14 mx-auto"
16748
+ isSquare ? "mx-auto" : isExpandedPill ? "size-6" : "h-8 w-14 mx-auto rounded-full"
16445
16749
  ),
16446
- style: { borderRadius: 9999 },
16750
+ style: isSquare ? { width: resolvedShapeSize, height: resolvedShapeSize } : void 0,
16447
16751
  children: [
16448
- !isExpanded && /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsxRuntime.jsx(ActivePill2, { layoutId: activePillId }) }),
16449
- !isExpanded && /* @__PURE__ */ jsxRuntime.jsx(HoverStateLayer2, {}),
16450
- !isExpanded && /* @__PURE__ */ jsxRuntime.jsx(RippleLayer2, { ripples, onRippleDone: removeRipple }),
16752
+ !isExpandedPill && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
16753
+ /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsxRuntime.jsx(
16754
+ ActivePill2,
16755
+ {
16756
+ layoutId: activePillId,
16757
+ disableInitial: isModal,
16758
+ shape: activeShape,
16759
+ width: iconPillWidth,
16760
+ height: iconPillHeight
16761
+ }
16762
+ ) }),
16763
+ /* @__PURE__ */ jsxRuntime.jsx(
16764
+ HoverStateLayer2,
16765
+ {
16766
+ shape: activeShape,
16767
+ width: iconPillWidth,
16768
+ height: iconPillHeight
16769
+ }
16770
+ ),
16771
+ /* @__PURE__ */ jsxRuntime.jsx(
16772
+ RippleLayer2,
16773
+ {
16774
+ ripples,
16775
+ onRippleDone: removeRipple,
16776
+ shape: activeShape,
16777
+ width: iconPillWidth,
16778
+ height: iconPillHeight
16779
+ }
16780
+ )
16781
+ ] }),
16451
16782
  /* @__PURE__ */ jsxRuntime.jsx(
16452
16783
  react.m.div,
16453
16784
  {
@@ -16469,8 +16800,8 @@ var NavigationRailItemComponent = React61__namespace.forwardRef(
16469
16800
  transition: SPRING_TRANSITION,
16470
16801
  className: cn(
16471
16802
  "z-10 transition-colors duration-200 whitespace-nowrap",
16472
- selected ? "text-m3-on-surface" : "text-m3-on-surface-variant",
16473
- isExpanded ? "text-sm font-medium tracking-wide text-left" : "text-xs font-medium tracking-wide"
16803
+ selected ? isExpandedPill ? "text-m3-on-secondary-container font-medium" : "text-m3-on-surface font-medium" : "text-m3-on-surface-variant font-medium",
16804
+ isExpanded ? "text-sm tracking-wide text-left" : "text-xs tracking-wide"
16474
16805
  ),
16475
16806
  children: label
16476
16807
  },
@@ -16530,6 +16861,9 @@ var NavigationRailComponent = React61__namespace.forwardRef(
16530
16861
  ({
16531
16862
  variant = "collapsed",
16532
16863
  labelVisibility = "labeled",
16864
+ shape,
16865
+ shapeSize,
16866
+ activeIndicatorWidth = "hug",
16533
16867
  header,
16534
16868
  fab,
16535
16869
  fabPlacement = "contained",
@@ -16543,6 +16877,7 @@ var NavigationRailComponent = React61__namespace.forwardRef(
16543
16877
  style
16544
16878
  }, ref) => {
16545
16879
  const isModal = variant === "modal";
16880
+ const isExpanded = variant === "expanded" || variant === "modal";
16546
16881
  const isXr = variant === "xr";
16547
16882
  const isSpatial = isXr && fabPlacement === "spatialized";
16548
16883
  const applyAnimation = !isXr || !isSpatial;
@@ -16584,10 +16919,12 @@ var NavigationRailComponent = React61__namespace.forwardRef(
16584
16919
  transition: isModal ? MD3_MODAL_TRANSITION : SPRING_TRANSITION,
16585
16920
  children: [
16586
16921
  (header || fab && !isSpatial) && /* @__PURE__ */ jsxRuntime.jsxs(
16587
- "div",
16922
+ react.m.div,
16588
16923
  {
16924
+ layout: true,
16589
16925
  className: cn(
16590
- "flex w-full flex-col items-center justify-start shrink-0 empty:hidden",
16926
+ "flex w-full flex-col justify-start shrink-0 empty:hidden",
16927
+ isExpanded ? "items-start px-3" : "items-center",
16591
16928
  navHeaderSpacing
16592
16929
  ),
16593
16930
  children: [
@@ -16653,6 +16990,9 @@ var NavigationRailComponent = React61__namespace.forwardRef(
16653
16990
  const contextValue = {
16654
16991
  variant,
16655
16992
  labelVisibility,
16993
+ shape,
16994
+ shapeSize,
16995
+ activeIndicatorWidth,
16656
16996
  activeIndicatorTransition
16657
16997
  };
16658
16998
  if (isModal) {
@@ -23425,6 +23765,10 @@ var ToolbarToggleButtonTokens = {
23425
23765
  PaddingX: 16,
23426
23766
  Gap: 8
23427
23767
  };
23768
+ var ToolbarToggleButtonRadiusTokens = {
23769
+ pillRadius: 24,
23770
+ pressedRadius: 12
23771
+ };
23428
23772
  var ALIGNMENT_CLASS = {
23429
23773
  start: "justify-start",
23430
23774
  center: "justify-center",
@@ -23971,29 +24315,34 @@ var ToolbarToggleButton = React61__namespace.forwardRef(
23971
24315
  selected = false,
23972
24316
  icon,
23973
24317
  children,
23974
- pressScale = 0.95,
23975
- pressBounceOffset = 6,
24318
+ pressExpand = true,
24319
+ pressExpandRatio = 0.06,
23976
24320
  ripple = true,
23977
24321
  asChild = false,
23978
24322
  className,
23979
24323
  type = "button",
23980
24324
  disabled,
23981
- onPointerDown: onPointerDownProp
24325
+ onPointerDown: onPointerDownProp,
24326
+ onPointerUp: onPointerUpProp,
24327
+ onPointerLeave: onPointerLeaveProp
23982
24328
  } = _b, props = __objRest(_b, [
23983
24329
  "emphasis",
23984
24330
  "selected",
23985
24331
  "icon",
23986
24332
  "children",
23987
- "pressScale",
23988
- "pressBounceOffset",
24333
+ "pressExpand",
24334
+ "pressExpandRatio",
23989
24335
  "ripple",
23990
24336
  "asChild",
23991
24337
  "className",
23992
24338
  "type",
23993
24339
  "disabled",
23994
- "onPointerDown"
24340
+ "onPointerDown",
24341
+ "onPointerUp",
24342
+ "onPointerLeave"
23995
24343
  ]);
23996
24344
  const context = useToolbarContext();
24345
+ const [isPressed, setIsPressed] = React61__namespace.useState(false);
23997
24346
  const {
23998
24347
  ripples,
23999
24348
  onPointerDown: handleRipplePointerDown,
@@ -24003,6 +24352,7 @@ var ToolbarToggleButton = React61__namespace.forwardRef(
24003
24352
  });
24004
24353
  const handlePointerDown = React61__namespace.useCallback(
24005
24354
  (e) => {
24355
+ setIsPressed(true);
24006
24356
  if (!disabled && ripple) {
24007
24357
  handleRipplePointerDown(e);
24008
24358
  }
@@ -24010,7 +24360,21 @@ var ToolbarToggleButton = React61__namespace.forwardRef(
24010
24360
  },
24011
24361
  [disabled, ripple, handleRipplePointerDown, onPointerDownProp]
24012
24362
  );
24013
- 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";
24363
+ const handlePointerUp = React61__namespace.useCallback(
24364
+ (e) => {
24365
+ setIsPressed(false);
24366
+ onPointerUpProp == null ? void 0 : onPointerUpProp(e);
24367
+ },
24368
+ [onPointerUpProp]
24369
+ );
24370
+ const handlePointerLeave = React61__namespace.useCallback(
24371
+ (e) => {
24372
+ setIsPressed(false);
24373
+ onPointerLeaveProp == null ? void 0 : onPointerLeaveProp(e);
24374
+ },
24375
+ [onPointerLeaveProp]
24376
+ );
24377
+ 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";
24014
24378
  const variantClasses = {
24015
24379
  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",
24016
24380
  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",
@@ -24022,27 +24386,17 @@ var ToolbarToggleButton = React61__namespace.forwardRef(
24022
24386
  context == null ? void 0 : context.itemClassName,
24023
24387
  className
24024
24388
  );
24025
- const whileTapConfig = React61__namespace.useMemo(
24389
+ const animateConfig = React61__namespace.useMemo(
24026
24390
  () => ({
24027
- scale: pressScale,
24028
- x: pressBounceOffset ? [
24029
- 0,
24030
- -pressBounceOffset,
24031
- pressBounceOffset,
24032
- -pressBounceOffset / 2,
24033
- pressBounceOffset / 2,
24034
- 0
24035
- ] : 0
24391
+ scaleX: pressExpand && isPressed ? 1 + pressExpandRatio : 1,
24392
+ borderRadius: isPressed ? ToolbarToggleButtonRadiusTokens.pressedRadius : ToolbarToggleButtonRadiusTokens.pillRadius
24036
24393
  }),
24037
- [pressScale, pressBounceOffset]
24394
+ [pressExpand, pressExpandRatio, isPressed]
24038
24395
  );
24039
24396
  const transitionConfig = React61__namespace.useMemo(
24040
- () => __spreadProps(__spreadValues({}, TOOLBAR_SPRING_TRANSITION), {
24041
- scale: TOOLBAR_SPRING_TRANSITION,
24042
- x: {
24043
- duration: 0.35,
24044
- ease: "easeInOut"
24045
- }
24397
+ () => ({
24398
+ scaleX: FAST_SPATIAL_SPRING,
24399
+ borderRadius: BUTTON_RADIUS_SPRING
24046
24400
  }),
24047
24401
  []
24048
24402
  );
@@ -24096,7 +24450,9 @@ var ToolbarToggleButton = React61__namespace.forwardRef(
24096
24450
  ref,
24097
24451
  "aria-pressed": selected,
24098
24452
  className: combinedClassName,
24099
- onPointerDown: handlePointerDown
24453
+ onPointerDown: handlePointerDown,
24454
+ onPointerUp: handlePointerUp,
24455
+ onPointerLeave: handlePointerLeave
24100
24456
  }, strippedProps), {
24101
24457
  children: React61__namespace.cloneElement(child, { children: innerChildContent })
24102
24458
  })
@@ -24109,9 +24465,13 @@ var ToolbarToggleButton = React61__namespace.forwardRef(
24109
24465
  type,
24110
24466
  "aria-pressed": selected,
24111
24467
  disabled,
24112
- whileTap: whileTapConfig,
24468
+ animate: animateConfig,
24113
24469
  transition: transitionConfig,
24470
+ initial: false,
24471
+ style: { transformOrigin: "center" },
24114
24472
  onPointerDown: handlePointerDown,
24473
+ onPointerUp: handlePointerUp,
24474
+ onPointerLeave: handlePointerLeave,
24115
24475
  className: combinedClassName
24116
24476
  }, props), {
24117
24477
  children: [