@jsenv/navi 0.26.13 → 0.26.15

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.
@@ -8199,6 +8199,19 @@ installImportMetaCssBuild(import.meta);/**
8199
8199
  * style can only be determined once the node is available.
8200
8200
  */
8201
8201
  import.meta.css = [/* css */`
8202
+ @layer navi {
8203
+ /*
8204
+ When using square/circle/aspectRatio prop we expect box to respect the aspect ratio.
8205
+ But within flex containers or stuff like that the min-width/min-height auto
8206
+ will prevent the item from shrinking to respect aspect-ratio
8207
+ We put that in a layer navi + a specific attribute so that it's very easy to override this
8208
+ */
8209
+ [navi-aspect-ratio] {
8210
+ min-width: 0;
8211
+ min-height: 0;
8212
+ }
8213
+ }
8214
+
8202
8215
  [navi-box-flow="inline"] {
8203
8216
  display: inline;
8204
8217
  }
@@ -8694,12 +8707,14 @@ const Box = props => {
8694
8707
  // Flatten nested arrays (e.g., from .map()) to treat each element as individual child
8695
8708
  innerChildren = applySeparatorOnChildren(innerChildren, separator);
8696
8709
  }
8710
+ const aspectRatio = rest.square || rest.circle ? "1/1" : rest.aspectRatio;
8697
8711
  return jsx(TagName, {
8698
8712
  ref: ref,
8699
8713
  className: innerClassName,
8700
8714
  "navi-box-flow": boxFlowIsDefault ? undefined : boxFlow,
8701
8715
  "navi-box-flow-row": row ? "" : undefined,
8702
8716
  "navi-box-flow-column": column ? "" : undefined,
8717
+ "navi-aspect-ratio": aspectRatio ? aspectRatio : undefined,
8703
8718
  "data-visual-selector": visualSelector,
8704
8719
  ...selfForwardedProps,
8705
8720
  children: jsx(BoxFlowContext.Provider, {
@@ -24971,9 +24986,13 @@ installImportMetaCssBuild(import.meta);const css$p = /* css */`
24971
24986
 
24972
24987
  /* Toggle appearance */
24973
24988
  &[data-appearance="toggle"] {
24989
+ --toggle-outer-width: calc(
24990
+ var(--toggle-width) + var(--toggle-padding) * 2
24991
+ );
24974
24992
  --margin: var(--toggle-margin);
24975
- --width: var(--toggle-width);
24993
+ --width: var(--toggle-outer-width);
24976
24994
  --height: unset;
24995
+ min-width: var(--toggle-outer-width);
24977
24996
  --border-radius: var(--toggle-border-radius);
24978
24997
  --background-color: var(--toggle-background-color);
24979
24998
  --background-color-hover: var(--toggle-background-color-hover);
@@ -24991,6 +25010,7 @@ installImportMetaCssBuild(import.meta);const css$p = /* css */`
24991
25010
  );
24992
25011
 
24993
25012
  position: relative;
25013
+ padding: var(--toggle-padding);
24994
25014
  background-color: var(--x-background-color);
24995
25015
  border-color: transparent;
24996
25016
  user-select: none;
@@ -25007,16 +25027,8 @@ installImportMetaCssBuild(import.meta);const css$p = /* css */`
25007
25027
 
25008
25028
  &[data-checked] {
25009
25029
  .navi_checkbox_toggle {
25010
- /* We remove padding 3 times */
25011
- /* - twice to get real width (box-sizing: border-box) */
25012
- /* - one more to apply right padding to the translation */
25013
25030
  transform: translateX(
25014
- calc(
25015
- var(--toggle-width) - var(--toggle-thumb-size) - var(
25016
- --toggle-padding
25017
- ) *
25018
- 3
25019
- )
25031
+ calc(var(--toggle-width) - var(--toggle-thumb-size))
25020
25032
  );
25021
25033
  }
25022
25034
  }