@jsenv/navi 0.30.19 → 0.30.21

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.
@@ -84047,10 +84078,9 @@ const Separator = ({
84047
84078
  import.meta.css = [css$y, "@jsenv/navi/src/layout/separator.jsx"];
84048
84079
 
84049
84080
  // 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.
84081
+ // styleCSSVars: `spacing` is a name Box owns, and on a box that is neither
84082
+ // flex nor grid it writes nothing for it, variable included. Last, so a
84083
+ // caller's own style still wins.
84054
84084
  const innerStyle = {
84055
84085
  ...cssVars({
84056
84086
  "--size": lengthValue(size),
@@ -95495,7 +95525,13 @@ const pickerHasSomethingToClear = ({
95495
95525
  if (!interactive) {
95496
95526
  return false;
95497
95527
  }
95498
- return value !== undefined && value !== "";
95528
+ // Holding what a clear leaves behind — "" for a scalar, the [] or {} of a
95529
+ // list or a group (resolveClearedUIState) — there is nothing to take out.
95530
+ // The same reading as the placeholder on the face.
95531
+ if (value === "") {
95532
+ return false;
95533
+ }
95534
+ return !uiStateHoldsNothing(value);
95499
95535
  };
95500
95536
  let clearOutsidePickerWarned = false;
95501
95537
  const warnOnClearOutsidePicker = () => {