@jsenv/navi 0.20.7 → 0.20.9

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.
@@ -19143,6 +19143,7 @@ const TextOverflow = ({
19143
19143
  const [OverflowPinnedElement, setOverflowPinnedElement] = useState(null);
19144
19144
  return jsx(Text, {
19145
19145
  flex: true,
19146
+ block: true,
19146
19147
  as: "div",
19147
19148
  nowWrap: noWrap,
19148
19149
  pre: !noWrap
@@ -19722,6 +19723,9 @@ const RectangleLoadingSvg = ({
19722
19723
 
19723
19724
  // ✅ Check if this should be a circle - only if width and height are nearly equal
19724
19725
  const maxPossibleRadius = Math.min(drawableWidth, drawableHeight) / 2;
19726
+ radius = resolveCSSSize(radius, {
19727
+ availableSize: Math.min(width, height)
19728
+ });
19725
19729
  const actualRadius = Math.min(radius || Math.min(drawableWidth, drawableHeight) * 0.05, maxPossibleRadius // ✅ Limité au radius maximum possible
19726
19730
  );
19727
19731
  const aspectRatio = Math.max(drawableWidth, drawableHeight) / Math.min(drawableWidth, drawableHeight);
@@ -19841,9 +19845,10 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
19841
19845
  z-index: 1;
19842
19846
  opacity: 0;
19843
19847
  pointer-events: none;
19844
- }
19845
- .navi_loading_rectangle_wrapper[data-visible] {
19846
- opacity: 1;
19848
+
19849
+ &[data-visible] {
19850
+ opacity: 1;
19851
+ }
19847
19852
  }
19848
19853
  `;
19849
19854
  const LoaderBackground = ({
@@ -19852,6 +19857,7 @@ const LoaderBackground = ({
19852
19857
  targetSelector,
19853
19858
  color,
19854
19859
  inset = 0,
19860
+ borderRadius = 0,
19855
19861
  spacingTop = 0,
19856
19862
  spacingLeft = 0,
19857
19863
  spacingBottom = 0,
@@ -19880,6 +19886,7 @@ const LoaderBackground = ({
19880
19886
  loading: loading,
19881
19887
  color: color,
19882
19888
  inset: inset,
19889
+ borderRadius: borderRadius,
19883
19890
  spacingTop: spacingTop,
19884
19891
  spacingLeft: spacingLeft,
19885
19892
  spacingBottom: spacingBottom,
@@ -19892,6 +19899,7 @@ const LoaderBackgroundWithPortal = ({
19892
19899
  loading,
19893
19900
  color,
19894
19901
  inset,
19902
+ borderRadius,
19895
19903
  spacingTop,
19896
19904
  spacingLeft,
19897
19905
  spacingBottom,
@@ -19917,7 +19925,8 @@ const LoaderBackgroundWithPortal = ({
19917
19925
  right: `${inset + spacingRight}px`
19918
19926
  },
19919
19927
  children: shouldShowSpinner && jsx(RectangleLoading, {
19920
- color: color
19928
+ color: color,
19929
+ radius: borderRadius
19921
19930
  })
19922
19931
  }), children]
19923
19932
  });
@@ -19926,100 +19935,25 @@ const LoaderBackgroundBasic = ({
19926
19935
  loading,
19927
19936
  targetSelector,
19928
19937
  color,
19938
+ borderWidth = 0,
19939
+ borderRadius = 0,
19929
19940
  spacingTop,
19930
19941
  spacingLeft,
19931
19942
  spacingBottom,
19932
19943
  spacingRight,
19944
+ marginTop = 0,
19945
+ marginLeft = 0,
19946
+ marginBottom = 0,
19947
+ marginRight = 0,
19948
+ paddingTop = 0,
19949
+ paddingLeft = 0,
19950
+ paddingBottom = 0,
19951
+ paddingRight = 0,
19933
19952
  inset,
19934
19953
  children
19935
19954
  }) => {
19936
19955
  const shouldShowSpinner = useDebounceTrue(loading, 300);
19937
19956
  const rectangleRef = useRef(null);
19938
- const [, setOutlineOffset] = useState(0);
19939
- const [borderRadius, setBorderRadius] = useState(0);
19940
- const [borderTopWidth, setBorderTopWidth] = useState(0);
19941
- const [borderLeftWidth, setBorderLeftWidth] = useState(0);
19942
- const [borderRightWidth, setBorderRightWidth] = useState(0);
19943
- const [borderBottomWidth, setBorderBottomWidth] = useState(0);
19944
- const [marginTop, setMarginTop] = useState(0);
19945
- const [marginBottom, setMarginBottom] = useState(0);
19946
- const [marginLeft, setMarginLeft] = useState(0);
19947
- const [marginRight, setMarginRight] = useState(0);
19948
- const [paddingTop, setPaddingTop] = useState(0);
19949
- const [paddingLeft, setPaddingLeft] = useState(0);
19950
- const [paddingRight, setPaddingRight] = useState(0);
19951
- const [paddingBottom, setPaddingBottom] = useState(0);
19952
- const [currentColor, setCurrentColor] = useState(color);
19953
- useLayoutEffect(() => {
19954
- let animationFrame;
19955
- const updateStyles = () => {
19956
- const rectangle = rectangleRef.current;
19957
- if (!rectangle) {
19958
- return;
19959
- }
19960
- const container = rectangle.parentElement;
19961
- const containedElement = rectangle.nextElementSibling;
19962
- const target = targetSelector ? container.querySelector(targetSelector) : containedElement;
19963
- if (target) {
19964
- const {
19965
- width,
19966
- height
19967
- } = target.getBoundingClientRect();
19968
- const containedComputedStyle = window.getComputedStyle(containedElement);
19969
- const targetComputedStyle = window.getComputedStyle(target);
19970
- const newBorderTopWidth = resolveCSSSize(targetComputedStyle.borderTopWidth);
19971
- const newBorderLeftWidth = resolveCSSSize(targetComputedStyle.borderLeftWidth);
19972
- const newBorderRightWidth = resolveCSSSize(targetComputedStyle.borderRightWidth);
19973
- const newBorderBottomWidth = resolveCSSSize(targetComputedStyle.borderBottomWidth);
19974
- const newBorderRadius = resolveCSSSize(targetComputedStyle.borderRadius, {
19975
- availableSize: Math.min(width, height)
19976
- });
19977
- const newOutlineColor = targetComputedStyle.outlineColor;
19978
- const newBorderColor = targetComputedStyle.borderColor;
19979
- const newDetectedColor = targetComputedStyle.color;
19980
- const newOutlineOffset = resolveCSSSize(targetComputedStyle.outlineOffset);
19981
- const newMarginTop = resolveCSSSize(targetComputedStyle.marginTop);
19982
- const newMarginBottom = resolveCSSSize(targetComputedStyle.marginBottom);
19983
- const newMarginLeft = resolveCSSSize(targetComputedStyle.marginLeft);
19984
- const newMarginRight = resolveCSSSize(targetComputedStyle.marginRight);
19985
- const paddingTop = resolveCSSSize(containedComputedStyle.paddingTop);
19986
- const paddingLeft = resolveCSSSize(containedComputedStyle.paddingLeft);
19987
- const paddingRight = resolveCSSSize(containedComputedStyle.paddingRight);
19988
- const paddingBottom = resolveCSSSize(containedComputedStyle.paddingBottom);
19989
- setBorderTopWidth(newBorderTopWidth);
19990
- setBorderLeftWidth(newBorderLeftWidth);
19991
- setBorderRightWidth(newBorderRightWidth);
19992
- setBorderBottomWidth(newBorderBottomWidth);
19993
- setBorderRadius(newBorderRadius);
19994
- setOutlineOffset(newOutlineOffset);
19995
- setMarginTop(newMarginTop);
19996
- setMarginBottom(newMarginBottom);
19997
- setMarginLeft(newMarginLeft);
19998
- setMarginRight(newMarginRight);
19999
- setPaddingTop(paddingTop);
20000
- setPaddingLeft(paddingLeft);
20001
- setPaddingRight(paddingRight);
20002
- setPaddingBottom(paddingBottom);
20003
- if (color) {
20004
- // const resolvedColor = resolveCSSColor(color, rectangle, "css");
20005
- // console.log(resolvedColor);
20006
- setCurrentColor(color);
20007
- } else if (newOutlineColor && newOutlineColor !== "rgba(0, 0, 0, 0)" && (document.activeElement === containedElement || newBorderColor === "rgba(0, 0, 0, 0)")) {
20008
- setCurrentColor(newOutlineColor);
20009
- } else if (newBorderColor && newBorderColor !== "rgba(0, 0, 0, 0)") {
20010
- setCurrentColor(newBorderColor);
20011
- } else {
20012
- setCurrentColor(newDetectedColor);
20013
- }
20014
- }
20015
- // updateStyles is very cheap so we run it every frame
20016
- animationFrame = requestAnimationFrame(updateStyles);
20017
- };
20018
- updateStyles();
20019
- return () => {
20020
- cancelAnimationFrame(animationFrame);
20021
- };
20022
- }, [color, targetSelector]);
20023
19957
  spacingTop += inset;
20024
19958
  // spacingTop += outlineOffset;
20025
19959
  // spacingTop -= borderTopWidth;
@@ -20044,7 +19978,7 @@ const LoaderBackgroundBasic = ({
20044
19978
  spacingRight += paddingRight;
20045
19979
  spacingBottom += paddingBottom;
20046
19980
  }
20047
- const maxBorderWidth = Math.max(borderTopWidth, borderLeftWidth, borderRightWidth, borderBottomWidth);
19981
+ const maxBorderWidth = Math.max(borderWidth);
20048
19982
  const halfMaxBorderSize = maxBorderWidth / 2;
20049
19983
  const size = halfMaxBorderSize < 2 ? 2 : halfMaxBorderSize;
20050
19984
  const lineHalfSize = size / 2;
@@ -20065,7 +19999,7 @@ const LoaderBackgroundBasic = ({
20065
19999
  },
20066
20000
  children: loading && jsx(RectangleLoading, {
20067
20001
  shouldShowSpinner: shouldShowSpinner,
20068
- color: currentColor,
20002
+ color: color,
20069
20003
  radius: borderRadius,
20070
20004
  size: size
20071
20005
  })
@@ -24635,7 +24569,8 @@ const InputRadioBasic = props => {
24635
24569
  loading: innerLoading,
24636
24570
  inset: -1,
24637
24571
  targetSelector: ".navi_radio_field",
24638
- color: "var(--loader-color)"
24572
+ color: "var(--loader-color)",
24573
+ borderRadius: "50%"
24639
24574
  }), renderRadioMemoized, jsx("span", {
24640
24575
  className: "navi_radio_field",
24641
24576
  children: appearance === "radio" ? jsxs("svg", {