@jsenv/navi 0.14.6 → 0.14.8

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,8 +16782,8 @@ 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 */`
@@ -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 {
@@ -16826,8 +16826,7 @@ import.meta.css = /* css */`
16826
16826
  display: flex;
16827
16827
  width: 100%;
16828
16828
  margin: 0;
16829
- padding-right: 2px; /* space for eventual outline overflow */
16830
- padding-left: 2px; /* space for eventual outline overflow */
16829
+ padding: 0;
16831
16830
  align-items: center;
16832
16831
  gap: 0.5rem;
16833
16832
  list-style: none;
@@ -16837,9 +16836,29 @@ import.meta.css = /* css */`
16837
16836
  > li {
16838
16837
  position: relative;
16839
16838
  display: inline-flex;
16839
+ /* 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;
16847
+ }
16840
16848
 
16841
16849
  .navi_tab {
16842
- --x-tab-background: var(--tab-background);
16850
+ --x-tab-background: var(
16851
+ --tab-background-color,
16852
+ var(--tab-background)
16853
+ );
16854
+ --x-tab-background-hover: var(
16855
+ --tab-background-color-hover,
16856
+ var(--tab-background-color, var(--tab-background-hover))
16857
+ );
16858
+ --x-tab-background-selected: var(
16859
+ --tab-background-color-selected,
16860
+ var(--tab-background-selected)
16861
+ );
16843
16862
  --x-tab-color: var(--tab-color);
16844
16863
 
16845
16864
  display: flex;
@@ -16890,12 +16909,12 @@ import.meta.css = /* css */`
16890
16909
  }
16891
16910
  /* Hover */
16892
16911
  &:hover {
16893
- --x-tab-background: var(--tab-background-hover);
16912
+ --x-tab-background: var(--x-tab-background-hover);
16894
16913
  --x-tab-color: var(--tab-color-hover);
16895
16914
  }
16896
16915
  /* Selected */
16897
- &[data-selected] {
16898
- --x-tab-background: var(--tab-background-selected);
16916
+ &[data-tab-selected] {
16917
+ --x-tab-background: var(--x-tab-background-selected);
16899
16918
  --x-tab-color: var(--tab-color-selected);
16900
16919
  font-weight: bold;
16901
16920
 
@@ -16909,17 +16928,25 @@ import.meta.css = /* css */`
16909
16928
 
16910
16929
  /* Vertical layout */
16911
16930
  &[data-vertical] {
16912
- overflow-x: hidden;
16913
- overflow-y: auto;
16931
+ /* overflow-x: hidden; */
16932
+ /* overflow-y: auto; */
16914
16933
 
16915
16934
  > ul {
16916
- padding-top: 2px; /* space for eventual outline overflow */
16917
- padding-bottom: 2px; /* space for eventual outline overflow */
16918
16935
  flex-direction: column;
16919
16936
  align-items: start;
16920
16937
 
16921
16938
  > li {
16922
16939
  width: 100%;
16940
+ padding-top: 0;
16941
+ padding-right: 2px;
16942
+ padding-bottom: 0;
16943
+ padding-left: 2px;
16944
+ &:first-child {
16945
+ padding-top: 2px;
16946
+ }
16947
+ &:last-child {
16948
+ padding-bottom: 2px;
16949
+ }
16923
16950
 
16924
16951
  .navi_tab {
16925
16952
  flex-direction: row;
@@ -17043,17 +17070,20 @@ const TabList = ({
17043
17070
  };
17044
17071
  const TAB_STYLE_CSS_VARS = {
17045
17072
  "background": "--tab-background",
17073
+ "backgroundColor": "--tab-background-color",
17046
17074
  "color": "--tab-color",
17047
17075
  ":hover": {
17048
17076
  background: "--tab-background-hover",
17077
+ backgroundColor: "--tab-background-color-hover",
17049
17078
  color: "--tab-color-hover"
17050
17079
  },
17051
- ":-navi-selected": {
17052
- background: "--tab-color-selected",
17080
+ ":-navi-tab-selected": {
17081
+ background: "--tab-background-selected",
17082
+ backgroundColor: "--tab-background-color-selected",
17053
17083
  color: "--tab-color-selected"
17054
17084
  }
17055
17085
  };
17056
- const TAB_PSEUDO_CLASSES = [":hover", ":-navi-selected"];
17086
+ const TAB_PSEUDO_CLASSES = [":hover", ":-navi-tab-selected"];
17057
17087
  const TAB_PSEUDO_ELEMENTS = ["::-navi-indicator"];
17058
17088
  const Tab = props => {
17059
17089
  if (props.route) {
@@ -17124,7 +17154,7 @@ const TabBasic = ({
17124
17154
  pseudoClasses: TAB_PSEUDO_CLASSES,
17125
17155
  pseudoElements: TAB_PSEUDO_ELEMENTS,
17126
17156
  basePseudoState: {
17127
- ":-navi-selected": selected
17157
+ ":-navi-tab-selected": selected
17128
17158
  },
17129
17159
  selfAlignX: tabListAlignX,
17130
17160
  "data-align-x": tabListAlignX,