@jsenv/navi 0.30.20 → 0.30.22

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.
@@ -35218,6 +35218,9 @@ const STYLE_CSS_VARS_DEFAULT = {};
35218
35218
  // An entry of styleCSSVars is the css variable the prop writes into, alone when
35219
35219
  // the prop is named after a css style — Box then already knows how to read its
35220
35220
  // value — or paired with the style whose values it borrows when it is not.
35221
+ // A prop Box expands (padding into its four sides, alignX into
35222
+ // justify-content…) is looked up by the styles it expands into, and by its own
35223
+ // name only when the component maps none of them.
35221
35224
  const readCSSVarEntry = entry => {
35222
35225
  if (Array.isArray(entry)) {
35223
35226
  return entry;
@@ -35822,6 +35825,15 @@ const computeBox = (props, parentBoxFlow) => {
35822
35825
  if (!cssValues) {
35823
35826
  return;
35824
35827
  }
35828
+ const ownCSSVarEntry = styleContext.styleCSSVars[name];
35829
+ if (ownCSSVarEntry && !Object.keys(cssValues).some(styleName => styleContext.styleCSSVars[styleName])) {
35830
+ // Written as the styles it expands into, the prop would land inline
35831
+ // and beat what the component's stylesheet does with its variable
35832
+ // (Switch sizes its thumb from its padding).
35833
+ const [cssVarName, valueStyleName] = readCSSVarEntry(ownCSSVarEntry);
35834
+ addCSSVar(stringifyStyleValue(value, valueStyleName || name, styleContext), cssVarName, boxStylesTarget);
35835
+ return;
35836
+ }
35825
35837
  let needForwarding = false;
35826
35838
  for (const styleName of Object.keys(cssValues)) {
35827
35839
  const cssValue = cssValues[styleName];
@@ -60520,8 +60532,8 @@ const BinderStyleCSSVars = {
60520
60532
  tabBackgroundHover: "--binder-tab-background-hover",
60521
60533
  tabBorderColor: "--binder-tab-border-color",
60522
60534
  tabColor: "--binder-tab-color",
60523
- paddingX: "--binder-padding-x",
60524
- paddingY: "--binder-padding-y",
60535
+ paddingX: ["--binder-padding-x", "padding"],
60536
+ paddingY: ["--binder-padding-y", "padding"],
60525
60537
  pagePadding: ["--binder-page-padding", "padding"]
60526
60538
  };
60527
60539
  const TABS_ALIGN_TO_JUSTIFY_CONTENT = {
@@ -61071,15 +61083,19 @@ const css$Y = /* css */`@layer navi {
61071
61083
  right: var(--navi-app-inset-right);
61072
61084
  left: var(--navi-app-inset-left);
61073
61085
  max-width: var(--navi-fixed-bar-max-width);
61074
- padding-right: calc(var(--navi-fixed-bar-padding) + env(safe-area-inset-right));
61075
- padding-left: calc(var(--navi-fixed-bar-padding) + env(safe-area-inset-left));
61086
+ padding-right: calc(var(--navi-fixed-bar-padding-right, var(--navi-fixed-bar-padding)) +
61087
+ env(safe-area-inset-right));
61088
+ padding-left: calc(var(--navi-fixed-bar-padding-left, var(--navi-fixed-bar-padding)) +
61089
+ env(safe-area-inset-left));
61076
61090
  }
61077
61091
 
61078
61092
  &[data-area="left"], &[data-area="right"] {
61079
61093
  top: var(--navi-app-inset-top);
61080
61094
  bottom: var(--navi-app-inset-bottom);
61081
- padding-top: calc(var(--navi-fixed-bar-padding) + env(safe-area-inset-top));
61082
- padding-bottom: calc(var(--navi-fixed-bar-padding) + env(safe-area-inset-bottom));
61095
+ padding-top: calc(var(--navi-fixed-bar-padding-top, var(--navi-fixed-bar-padding)) +
61096
+ env(safe-area-inset-top));
61097
+ padding-bottom: calc(var(--navi-fixed-bar-padding-bottom, var(--navi-fixed-bar-padding)) +
61098
+ env(safe-area-inset-bottom));
61083
61099
  flex-direction: column;
61084
61100
  }
61085
61101
 
@@ -61156,7 +61172,14 @@ const FixedBarStyleCSSVars = {
61156
61172
  width: "--navi-fixed-bar-width",
61157
61173
  height: "--navi-fixed-bar-height",
61158
61174
  maxWidth: "--navi-fixed-bar-max-width",
61175
+ // Every side goes through a variable too: written inline, it would replace
61176
+ // the safe-area inset the stylesheet adds to it. A side across the bar is
61177
+ // read by no rule — that direction is the width/height.
61159
61178
  padding: "--navi-fixed-bar-padding",
61179
+ paddingTop: "--navi-fixed-bar-padding-top",
61180
+ paddingRight: "--navi-fixed-bar-padding-right",
61181
+ paddingBottom: "--navi-fixed-bar-padding-bottom",
61182
+ paddingLeft: "--navi-fixed-bar-padding-left",
61160
61183
  background: "--navi-fixed-bar-background",
61161
61184
  borderWidth: "--navi-fixed-bar-border-width",
61162
61185
  borderColor: "--navi-fixed-bar-border-color",
@@ -61170,6 +61193,12 @@ const FixedBarStyleCSSVars = {
61170
61193
  * height?: string|number,
61171
61194
  * maxWidth?: string|number,
61172
61195
  * padding?: string|number,
61196
+ * paddingX?: string|number,
61197
+ * paddingY?: string|number,
61198
+ * paddingTop?: string|number,
61199
+ * paddingRight?: string|number,
61200
+ * paddingBottom?: string|number,
61201
+ * paddingLeft?: string|number,
61173
61202
  * background?: string,
61174
61203
  * border?: boolean,
61175
61204
  * borderWidth?: string|number,
@@ -61196,7 +61225,9 @@ const FixedBarStyleCSSVars = {
61196
61225
  * content column narrower than the window (it stays centered).
61197
61226
  * @param {string|number} [props.padding=0] - Along the bar only: left/right on
61198
61227
  * a top or bottom bar, top/bottom on a side one. Across it, the size is
61199
- * `height`/`width`.
61228
+ * `height`/`width`. The same holds for `paddingX`/`paddingY` and each side:
61229
+ * a side across the bar is ignored. Along the bar, the safe-area inset is
61230
+ * added to it.
61200
61231
  * @param {string} [props.shadow] - What the bar casts over the content, in
61201
61232
  * `box-shadow` syntax, cut at the bar's box on every side but the content's.
61202
61233
  * Takes no room.
@@ -64595,6 +64626,7 @@ const css$R = /* css */`.navi_control_swap {
64595
64626
  --x-control-swap-size: var(--navi-control-swap-size, calc(var(--navi-control-line-height) + 2 * var(--navi-s) + 2 *
64596
64627
  var(--navi-control-border-width)));
64597
64628
  --x-control-swap-gap: var(--navi-control-swap-gap, var(--navi-xs));
64629
+ --x-control-swap-seam-travel: calc(var(--x-control-swap-gap) + var(--navi-control-border-width));
64598
64630
  height: var(--x-control-swap-size);
64599
64631
  align-items: stretch;
64600
64632
  gap: var(--x-control-swap-gap);
@@ -64608,15 +64640,45 @@ const css$R = /* css */`.navi_control_swap {
64608
64640
  min-width: 0;
64609
64641
  height: 100%;
64610
64642
  position: relative;
64643
+
64644
+ &:has( ~ .navi_control_swap_stage)[aria-expanded="true"] {
64645
+ --x-corner-top-right-radius: 0;
64646
+ --x-corner-bottom-right-radius: 0;
64647
+ }
64648
+
64649
+ .navi_control_swap_stage ~ &[aria-expanded="true"] {
64650
+ --x-corner-top-left-radius: 0;
64651
+ --x-corner-bottom-left-radius: 0;
64652
+ }
64653
+
64654
+ &:focus-visible, &[data-focus-visible] {
64655
+ z-index: var(--navi-z-index-control-focused);
64656
+ }
64611
64657
  }
64612
64658
 
64613
64659
  & > .navi_control_swap_stage {
64660
+ min-width: 0;
64661
+ margin-left: calc(-1 * var(--x-control-swap-seam-travel));
64614
64662
  overflow-clip-margin: var(--navi-focus-outline-width);
64615
64663
  flex: 1 1 0;
64616
- min-width: 0;
64617
64664
  display: flex;
64618
64665
  overflow: clip;
64619
64666
  container-type: inline-size;
64667
+
64668
+ &:hover {
64669
+ z-index: var(--navi-z-index-control-hovered);
64670
+ position: relative;
64671
+ }
64672
+
64673
+ &:has(:focus-visible, [data-focus-visible]) {
64674
+ z-index: var(--navi-z-index-control-focused);
64675
+ position: relative;
64676
+ }
64677
+
64678
+ &:has([aria-expanded="true"]) {
64679
+ z-index: var(--navi-z-index-control-expanded);
64680
+ position: relative;
64681
+ }
64620
64682
  }
64621
64683
 
64622
64684
  & > .navi_control_swap_stage > .navi_control_swap_track {
@@ -64635,20 +64697,43 @@ const css$R = /* css */`.navi_control_swap {
64635
64697
  width: 100%;
64636
64698
  height: 100%;
64637
64699
  }
64700
+
64701
+ &:first-child > :not([navi-out-of-flow]) {
64702
+ --x-corner-top-left-radius: 0;
64703
+ --x-corner-bottom-left-radius: 0;
64704
+ border-top-left-radius: 0 !important;
64705
+ border-bottom-left-radius: 0 !important;
64706
+ }
64707
+
64708
+ &:last-child > :not([navi-out-of-flow]) {
64709
+ --x-corner-top-right-radius: 0;
64710
+ --x-corner-bottom-right-radius: 0;
64711
+ border-top-right-radius: 0 !important;
64712
+ border-bottom-right-radius: 0 !important;
64713
+ }
64638
64714
  }
64639
64715
  }
64640
64716
 
64717
+ &[data-active-index="1"] > .navi_control_swap_stage {
64718
+ transform: translateX(var(--x-control-swap-seam-travel));
64719
+ }
64720
+
64641
64721
  &[data-active-index="1"] > .navi_control_swap_stage > .navi_control_swap_track {
64642
64722
  transform: translateX(calc(-100cqw - var(--x-control-swap-gap)));
64643
64723
  }
64644
64724
 
64645
- &[data-animation] > .navi_control_swap_stage > .navi_control_swap_track {
64725
+ &[data-animation] > .navi_control_swap_stage, &[data-animation] > .navi_control_swap_stage > .navi_control_swap_track {
64646
64726
  transition: transform var(--navi-control-swap-animation-duration, .22s)
64647
64727
  ease;
64648
64728
  }
64649
64729
 
64730
+ &[data-animation] > .navi_control_swap_cap {
64731
+ transition: border-radius
64732
+ var(--navi-control-swap-animation-duration, .22s) ease;
64733
+ }
64734
+
64650
64735
  @media (prefers-reduced-motion: reduce) {
64651
- &[data-animation] > .navi_control_swap_stage > .navi_control_swap_track {
64736
+ &[data-animation] > .navi_control_swap_stage, &[data-animation] > .navi_control_swap_stage > .navi_control_swap_track, &[data-animation] > .navi_control_swap_cap {
64652
64737
  transition: none;
64653
64738
  }
64654
64739
  }
@@ -64679,8 +64764,9 @@ const css$R = /* css */`.navi_control_swap {
64679
64764
  *
64680
64765
  * The row is one length tall — `--navi-control-swap-size`, a line of text
64681
64766
  * between two `s` paddings — and everything in it is that tall: the caps are
64682
- * squares of it, the control holding the floor fills it. `--navi-control-swap-gap`
64683
- * is the space between the boxes.
64767
+ * squares of it, the control holding the floor fills it. The control is joined
64768
+ * to its cap by a shared border; `--navi-control-swap-gap` is the space between
64769
+ * it and the other cap.
64684
64770
  */
64685
64771
  const ControlSwap = props => {
64686
64772
  import.meta.css = [css$R, "@jsenv/navi/src/control/control_swap/control_swap.jsx"];
@@ -71821,6 +71907,12 @@ const SlideContainer = ({
71821
71907
  // names a slide, and the container standing on its first one is a fact only
71822
71908
  // the map knows (see the layout effect that paints it).
71823
71909
  const areaOnScreen = containerRef.current.getAttribute(SLIDE_CURRENT_ATTRIBUTE);
71910
+ // Standing on the first slide by default holds a rank, and the slide at
71911
+ // that rank changes with their order. Someone outside is naming slides, so
71912
+ // the one on screen is held by its name from this answer on.
71913
+ if (current !== areaOnScreen) {
71914
+ setCurrentAreaState(areaOnScreen);
71915
+ }
71824
71916
  if (areaAsked === areaOnScreen) {
71825
71917
  return;
71826
71918
  }
@@ -84047,10 +84139,9 @@ const Separator = ({
84047
84139
  import.meta.css = [css$y, "@jsenv/navi/src/layout/separator.jsx"];
84048
84140
 
84049
84141
  // Written straight into style rather than declared through Box's own
84050
- // styleCSSVars: `size`, `margin` and `spacing` are names Box already owns (a
84051
- // font size, real margins, a gap) and it resolves those before it ever looks
84052
- // at styleCSSVars — so size="4px" would set a font size and leave the line
84053
- // as thin as it was. Last, so a caller's own style still wins.
84142
+ // styleCSSVars: `spacing` is a name Box owns, and on a box that is neither
84143
+ // flex nor grid it writes nothing for it, variable included. Last, so a
84144
+ // caller's own style still wins.
84054
84145
  const innerStyle = {
84055
84146
  ...cssVars({
84056
84147
  "--size": lengthValue(size),