@jsenv/navi 0.14.7 → 0.14.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.
@@ -5863,9 +5863,9 @@ const Box = props => {
5863
5863
  };
5864
5864
  let boxPseudoNamedStyles = PSEUDO_NAMED_STYLES_DEFAULT;
5865
5865
  const shouldForwardAllToChild = visualSelector && pseudoStateSelector;
5866
- const addStyle = (value, name, stylesTarget, context) => {
5866
+ const addStyle = (value, name, styleContext, stylesTarget, context) => {
5867
5867
  styleDeps.push(value); // impact box style -> add to deps
5868
- const cssVar = styleCSSVars[name];
5868
+ const cssVar = styleContext.styleCSSVars[name];
5869
5869
  const mergedValue = prepareStyleValue(stylesTarget[name], value, name, context);
5870
5870
  if (cssVar) {
5871
5871
  stylesTarget[cssVar] = mergedValue;
@@ -5874,20 +5874,20 @@ const Box = props => {
5874
5874
  stylesTarget[name] = mergedValue;
5875
5875
  return false;
5876
5876
  };
5877
- const addStyleMaybeForwarding = (value, name, stylesTarget, context, visualChildPropStrategy) => {
5877
+ const addStyleMaybeForwarding = (value, name, styleContext, stylesTarget, context, visualChildPropStrategy) => {
5878
5878
  if (!visualChildPropStrategy) {
5879
- addStyle(value, name, stylesTarget, context);
5879
+ addStyle(value, name, styleContext, stylesTarget, context);
5880
5880
  return false;
5881
5881
  }
5882
5882
  const cssVar = styleCSSVars[name];
5883
5883
  if (cssVar) {
5884
5884
  // css var wins over visual child handling
5885
- addStyle(value, name, stylesTarget, context);
5885
+ addStyle(value, name, styleContext, stylesTarget, context);
5886
5886
  return false;
5887
5887
  }
5888
5888
  if (visualChildPropStrategy === "copy") {
5889
5889
  // we stylyze ourself + forward prop to the child
5890
- addStyle(value, name, stylesTarget, context);
5890
+ addStyle(value, name, styleContext, stylesTarget, context);
5891
5891
  }
5892
5892
  return true;
5893
5893
  };
@@ -5895,7 +5895,7 @@ const Box = props => {
5895
5895
  const context = styleOrigin === "base_style" ? "js" : "css";
5896
5896
  const isCss = styleOrigin === "base_style" || styleOrigin === "style";
5897
5897
  if (isCss) {
5898
- addStyle(value, name, boxStylesTarget, context);
5898
+ addStyle(value, name, styleContext, boxStylesTarget, context);
5899
5899
  return;
5900
5900
  }
5901
5901
  const isPseudoStyle = styleOrigin === "pseudo_style";
@@ -5921,7 +5921,7 @@ const Box = props => {
5921
5921
  if (
5922
5922
  // prop name === css style name
5923
5923
  !getStyle) {
5924
- const needForwarding = addStyleMaybeForwarding(value, name, boxStylesTarget, context, visualChildPropStrategy);
5924
+ const needForwarding = addStyleMaybeForwarding(value, name, styleContext, boxStylesTarget, context, visualChildPropStrategy);
5925
5925
  if (needForwarding) {
5926
5926
  if (isPseudoStyle) ; else {
5927
5927
  childForwardedProps[name] = value;
@@ -5936,7 +5936,7 @@ const Box = props => {
5936
5936
  let needForwarding = false;
5937
5937
  for (const styleName of Object.keys(cssValues)) {
5938
5938
  const cssValue = cssValues[styleName];
5939
- needForwarding = addStyleMaybeForwarding(cssValue, styleName, boxStylesTarget, context, visualChildPropStrategy);
5939
+ needForwarding = addStyleMaybeForwarding(cssValue, styleName, styleContext, boxStylesTarget, context, visualChildPropStrategy);
5940
5940
  }
5941
5941
  if (needForwarding) {
5942
5942
  if (isPseudoStyle) ; else {
@@ -16782,14 +16782,14 @@ const RouteLink = ({
16782
16782
  };
16783
16783
 
16784
16784
  installImportMetaCss(import.meta);Object.assign(PSEUDO_CLASSES, {
16785
- ":-navi-selected": {
16786
- attribute: "data-selected"
16785
+ ":-navi-tab-selected": {
16786
+ attribute: "data-tab-selected"
16787
16787
  }
16788
16788
  });
16789
16789
  import.meta.css = /* css */`
16790
16790
  @layer navi {
16791
16791
  .navi_tablist {
16792
- --tablist-border-radius: 8px;
16792
+ --tablist-border-radius: 0px;
16793
16793
  --tablist-background: transparent;
16794
16794
  --tab-border-radius: calc(var(--tablist-border-radius) - 2px);
16795
16795
 
@@ -16800,7 +16800,7 @@ import.meta.css = /* css */`
16800
16800
  --tab-color-hover: #010409;
16801
16801
  --tab-color-selected: inherit;
16802
16802
  --tab-indicator-size: 2px;
16803
- --tab-indicator-spacing: 5px;
16803
+ --tab-indicator-spacing: 0;
16804
16804
  --tab-indicator-color: rgb(205, 52, 37);
16805
16805
  }
16806
16806
  }
@@ -16808,8 +16808,8 @@ import.meta.css = /* css */`
16808
16808
  .navi_tablist {
16809
16809
  display: flex;
16810
16810
  line-height: 2em;
16811
- overflow-x: auto;
16812
- overflow-y: hidden;
16811
+ /* overflow-x: auto; */
16812
+ /* overflow-y: hidden; */
16813
16813
 
16814
16814
  &[data-tab-indicator-position="start"] {
16815
16815
  .navi_tab {
@@ -16836,18 +16836,25 @@ import.meta.css = /* css */`
16836
16836
  > li {
16837
16837
  position: relative;
16838
16838
  display: inline-flex;
16839
+
16839
16840
  /* Space for eventual outline inside the tab (link) */
16840
- padding-top: 2px;
16841
- padding-bottom: 2px;
16842
- &:first-child {
16843
- padding-left: 2px;
16844
- }
16845
- &:last-child {
16846
- padding-right: 2px;
16841
+ .navi_tab {
16842
+ padding: 2px;
16847
16843
  }
16848
16844
 
16849
16845
  .navi_tab {
16850
- --x-tab-background: var(--tab-background);
16846
+ --x-tab-background: var(
16847
+ --tab-background-color,
16848
+ var(--tab-background)
16849
+ );
16850
+ --x-tab-background-hover: var(
16851
+ --tab-background-color-hover,
16852
+ var(--tab-background-color, var(--tab-background-hover))
16853
+ );
16854
+ --x-tab-background-selected: var(
16855
+ --tab-background-color-selected,
16856
+ var(--tab-background-selected)
16857
+ );
16851
16858
  --x-tab-color: var(--tab-color);
16852
16859
 
16853
16860
  display: flex;
@@ -16897,13 +16904,13 @@ import.meta.css = /* css */`
16897
16904
  cursor: pointer;
16898
16905
  }
16899
16906
  /* Hover */
16900
- &:hover {
16901
- --x-tab-background: var(--tab-background-hover);
16907
+ &[data-hover] {
16908
+ --x-tab-background: var(--x-tab-background-hover);
16902
16909
  --x-tab-color: var(--tab-color-hover);
16903
16910
  }
16904
16911
  /* Selected */
16905
- &[data-selected] {
16906
- --x-tab-background: var(--tab-background-selected);
16912
+ &[data-tab-selected] {
16913
+ --x-tab-background: var(--x-tab-background-selected);
16907
16914
  --x-tab-color: var(--tab-color-selected);
16908
16915
  font-weight: bold;
16909
16916
 
@@ -16917,8 +16924,8 @@ import.meta.css = /* css */`
16917
16924
 
16918
16925
  /* Vertical layout */
16919
16926
  &[data-vertical] {
16920
- overflow-x: hidden;
16921
- overflow-y: auto;
16927
+ /* overflow-x: hidden; */
16928
+ /* overflow-y: auto; */
16922
16929
 
16923
16930
  > ul {
16924
16931
  flex-direction: column;
@@ -16926,16 +16933,6 @@ import.meta.css = /* css */`
16926
16933
 
16927
16934
  > li {
16928
16935
  width: 100%;
16929
- padding-top: 0;
16930
- padding-right: 2px;
16931
- padding-bottom: 0;
16932
- padding-left: 2px;
16933
- &:first-child {
16934
- padding-top: 2px;
16935
- }
16936
- &:last-child {
16937
- padding-bottom: 2px;
16938
- }
16939
16936
 
16940
16937
  .navi_tab {
16941
16938
  flex-direction: row;
@@ -17059,17 +17056,20 @@ const TabList = ({
17059
17056
  };
17060
17057
  const TAB_STYLE_CSS_VARS = {
17061
17058
  "background": "--tab-background",
17059
+ "backgroundColor": "--tab-background-color",
17062
17060
  "color": "--tab-color",
17063
17061
  ":hover": {
17064
17062
  background: "--tab-background-hover",
17063
+ backgroundColor: "--tab-background-color-hover",
17065
17064
  color: "--tab-color-hover"
17066
17065
  },
17067
- ":-navi-selected": {
17068
- background: "--tab-color-selected",
17066
+ ":-navi-tab-selected": {
17067
+ background: "--tab-background-selected",
17068
+ backgroundColor: "--tab-background-color-selected",
17069
17069
  color: "--tab-color-selected"
17070
17070
  }
17071
17071
  };
17072
- const TAB_PSEUDO_CLASSES = [":hover", ":-navi-selected"];
17072
+ const TAB_PSEUDO_CLASSES = [":hover", ":-navi-tab-selected"];
17073
17073
  const TAB_PSEUDO_ELEMENTS = ["::-navi-indicator"];
17074
17074
  const Tab = props => {
17075
17075
  if (props.route) {
@@ -17086,8 +17086,8 @@ const TabRoute = ({
17086
17086
  route,
17087
17087
  routeParams,
17088
17088
  children,
17089
- paddingX = "s",
17090
17089
  padding,
17090
+ paddingX,
17091
17091
  paddingY,
17092
17092
  alignX,
17093
17093
  alignY,
@@ -17100,18 +17100,18 @@ const TabRoute = ({
17100
17100
  const selected = active && paramsAreMatching;
17101
17101
  return jsx(TabBasic, {
17102
17102
  selected: selected,
17103
- paddingX: undefined,
17103
+ ...props,
17104
17104
  alignX: alignX,
17105
17105
  alignY: alignY,
17106
- ...props,
17106
+ visualSelector: ".navi_link",
17107
17107
  children: jsx(RouteLink, {
17108
17108
  box: true,
17109
17109
  route: route,
17110
17110
  routeParams: routeParams,
17111
17111
  expand: true,
17112
17112
  discrete: true,
17113
- paddingX: paddingX,
17114
17113
  padding: padding,
17114
+ paddingX: paddingX,
17115
17115
  paddingY: paddingY,
17116
17116
  alignX: alignX,
17117
17117
  alignY: alignY,
@@ -17131,8 +17131,7 @@ const TabBasic = ({
17131
17131
  role: "tab",
17132
17132
  "aria-selected": selected ? "true" : "false",
17133
17133
  "data-interactive": onClick ? "" : undefined,
17134
- onClick: onClick,
17135
- paddingX: "s"
17134
+ onClick: onClick
17136
17135
  // Style system
17137
17136
  ,
17138
17137
  baseClassName: "navi_tab",
@@ -17140,7 +17139,7 @@ const TabBasic = ({
17140
17139
  pseudoClasses: TAB_PSEUDO_CLASSES,
17141
17140
  pseudoElements: TAB_PSEUDO_ELEMENTS,
17142
17141
  basePseudoState: {
17143
- ":-navi-selected": selected
17142
+ ":-navi-tab-selected": selected
17144
17143
  },
17145
17144
  selfAlignX: tabListAlignX,
17146
17145
  "data-align-x": tabListAlignX,