@jsenv/navi 0.29.1 → 0.29.3

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.
@@ -47001,8 +47001,41 @@ installImportMetaCssBuild(import.meta);const css$t = /* css */`
47001
47001
  }
47002
47002
  .navi_badge {
47003
47003
  --font-size: 0.7em;
47004
- --padding-x: 0.8em;
47005
- --padding-y: 0.4em;
47004
+ --badge-padding-x-default: 0.8em;
47005
+ --badge-padding-y-default: 0.4em;
47006
+
47007
+ /* Each side resolves the most specific value it was given, from the side
47008
+ itself down to the axis, the shorthand, then the default. Resolved once
47009
+ here because the close button below reuses these to cancel the badge
47010
+ padding on the edge it sits on. */
47011
+ --x-badge-padding-top: var(
47012
+ --badge-padding-top,
47013
+ var(
47014
+ --badge-padding-y,
47015
+ var(--badge-padding, var(--badge-padding-y-default))
47016
+ )
47017
+ );
47018
+ --x-badge-padding-right: var(
47019
+ --badge-padding-right,
47020
+ var(
47021
+ --badge-padding-x,
47022
+ var(--badge-padding, var(--badge-padding-x-default))
47023
+ )
47024
+ );
47025
+ --x-badge-padding-bottom: var(
47026
+ --badge-padding-bottom,
47027
+ var(
47028
+ --badge-padding-y,
47029
+ var(--badge-padding, var(--badge-padding-y-default))
47030
+ )
47031
+ );
47032
+ --x-badge-padding-left: var(
47033
+ --badge-padding-left,
47034
+ var(
47035
+ --badge-padding-x,
47036
+ var(--badge-padding, var(--badge-padding-x-default))
47037
+ )
47038
+ );
47006
47039
 
47007
47040
  --x-background: var(--background, light-dark(#e0e0e0, #3a3a3a));
47008
47041
  --x-background-color: var(--background-color, var(--x-background));
@@ -47014,10 +47047,10 @@ installImportMetaCssBuild(import.meta);const css$t = /* css */`
47014
47047
  position: relative;
47015
47048
  display: inline;
47016
47049
  max-width: 200px;
47017
- padding-top: var(--padding-y);
47018
- padding-right: var(--padding-x);
47019
- padding-bottom: var(--padding-y);
47020
- padding-left: var(--padding-x);
47050
+ padding-top: var(--x-badge-padding-top);
47051
+ padding-right: var(--x-badge-padding-right);
47052
+ padding-bottom: var(--x-badge-padding-bottom);
47053
+ padding-left: var(--x-badge-padding-left);
47021
47054
  align-items: stretch;
47022
47055
  color: var(--x-color);
47023
47056
  font-size: var(--font-size);
@@ -47041,25 +47074,25 @@ installImportMetaCssBuild(import.meta);const css$t = /* css */`
47041
47074
 
47042
47075
  [role="button"] {
47043
47076
  display: inline-flex;
47044
- margin-top: calc(-1 * var(--padding-y));
47045
- margin-bottom: calc(-1 * var(--padding-y));
47046
- padding-top: var(--padding-y);
47047
- padding-right: calc(var(--padding-x) / 2);
47048
- padding-bottom: var(--padding-y);
47049
- padding-left: calc(var(--padding-x) / 2);
47077
+ margin-top: calc(-1 * var(--x-badge-padding-top));
47078
+ margin-bottom: calc(-1 * var(--x-badge-padding-bottom));
47079
+ padding-top: var(--x-badge-padding-top);
47080
+ padding-right: calc(var(--x-badge-padding-right) / 2);
47081
+ padding-bottom: var(--x-badge-padding-bottom);
47082
+ padding-left: calc(var(--x-badge-padding-left) / 2);
47050
47083
  align-items: center;
47051
47084
  cursor: pointer;
47052
47085
  pointer-events: auto;
47053
47086
  user-select: none;
47054
47087
 
47055
47088
  &:first-child {
47056
- margin-left: calc(-1 * var(--padding-x));
47089
+ margin-left: calc(-1 * var(--x-badge-padding-left));
47057
47090
  border-top-left-radius: inherit;
47058
47091
  border-bottom-left-radius: inherit;
47059
47092
  }
47060
47093
 
47061
47094
  &:last-child {
47062
- margin-right: calc(-1 * var(--padding-x));
47095
+ margin-right: calc(-1 * var(--x-badge-padding-right));
47063
47096
  border-top-right-radius: inherit;
47064
47097
  border-bottom-right-radius: inherit;
47065
47098
  }
@@ -47087,16 +47120,21 @@ const Badge = ({
47087
47120
  bold: true,
47088
47121
  maxLines: 1,
47089
47122
  ...props,
47090
- styleCSSVars: BadgeStyleCSSVars$1,
47123
+ styleCSSVars: BadgeStyleCSSVars,
47091
47124
  spacing: jsx("span", {}),
47092
47125
  children: children
47093
47126
  });
47094
47127
  };
47095
- const BadgeStyleCSSVars$1 = {
47128
+ const BadgeStyleCSSVars = {
47096
47129
  borderWidth: "--border-width",
47097
47130
  borderRadius: "--border-radius",
47098
- paddingRight: "--padding-right",
47099
- paddingLeft: "--padding-left",
47131
+ padding: "--badge-padding",
47132
+ paddingX: "--badge-padding-x",
47133
+ paddingY: "--badge-padding-y",
47134
+ paddingTop: "--badge-padding-top",
47135
+ paddingRight: "--badge-padding-right",
47136
+ paddingBottom: "--badge-padding-bottom",
47137
+ paddingLeft: "--badge-padding-left",
47100
47138
  backgroundColor: "--background-color",
47101
47139
  background: "--background",
47102
47140
  borderColor: "--border-color",
@@ -49063,6 +49101,13 @@ const WayOut = ({
49063
49101
  "aria-label": label,
49064
49102
  "aria-disabled": unavailableMessage ? "true" : undefined,
49065
49103
  "data-unavailable": unavailableMessage ? "" : undefined
49104
+ // At the chevron, not beside it: a callout aims its arrow at where the
49105
+ // anchor's text starts, and there is no text here — only a glyph in the
49106
+ // middle of the box, which is what one pressed and what the answer is
49107
+ // about.
49108
+ ,
49109
+
49110
+ "data-callout-arrow-x": "center"
49066
49111
  // Read by triggerNaviCommand below the same way it reads a button's own.
49067
49112
  ,
49068
49113
 
@@ -56708,8 +56753,40 @@ installImportMetaCssBuild(import.meta);const css$b = /* css */`
56708
56753
  --x-background-color: var(--background-color, var(--x-background));
56709
56754
  --x-color-contrasting: var(--navi-color-white);
56710
56755
  --x-color: var(--color, var(--x-color-contrasting));
56711
- --padding-x: 0.5em;
56712
- --padding-y: 0.2em;
56756
+ --badge-count-padding-x-default: 0.5em;
56757
+ --badge-count-padding-y-default: 0.2em;
56758
+
56759
+ /* Each side resolves the most specific value it was given, from the side
56760
+ itself down to the axis, the shorthand, then the default. */
56761
+ --x-badge-count-padding-top: var(
56762
+ --badge-count-padding-top,
56763
+ var(
56764
+ --badge-count-padding-y,
56765
+ var(--badge-count-padding, var(--badge-count-padding-y-default))
56766
+ )
56767
+ );
56768
+ --x-badge-count-padding-right: var(
56769
+ --badge-count-padding-right,
56770
+ var(
56771
+ --badge-count-padding-x,
56772
+ var(--badge-count-padding, var(--badge-count-padding-x-default))
56773
+ )
56774
+ );
56775
+ --x-badge-count-padding-bottom: var(
56776
+ --badge-count-padding-bottom,
56777
+ var(
56778
+ --badge-count-padding-y,
56779
+ var(--badge-count-padding, var(--badge-count-padding-y-default))
56780
+ )
56781
+ );
56782
+ --x-badge-count-padding-left: var(
56783
+ --badge-count-padding-left,
56784
+ var(
56785
+ --badge-count-padding-x,
56786
+ var(--badge-count-padding, var(--badge-count-padding-x-default))
56787
+ )
56788
+ );
56789
+
56713
56790
  position: relative;
56714
56791
  color: var(--x-color);
56715
56792
  font-size: var(--font-size);
@@ -56733,10 +56810,10 @@ installImportMetaCssBuild(import.meta);const css$b = /* css */`
56733
56810
 
56734
56811
  /* Ellipse */
56735
56812
  &[data-ellipse] {
56736
- padding-top: var(--padding-y);
56737
- padding-right: var(--padding-x);
56738
- padding-bottom: var(--padding-y);
56739
- padding-left: var(--padding-x);
56813
+ padding-top: var(--x-badge-count-padding-top);
56814
+ padding-right: var(--x-badge-count-padding-right);
56815
+ padding-bottom: var(--x-badge-count-padding-bottom);
56816
+ padding-left: var(--x-badge-count-padding-left);
56740
56817
  line-height: normal;
56741
56818
  background: var(--x-background);
56742
56819
  background-color: var(--x-background-color);
@@ -56744,29 +56821,48 @@ installImportMetaCssBuild(import.meta);const css$b = /* css */`
56744
56821
 
56745
56822
  /* For ellipse + single char force the circle aspect as it's prettier */
56746
56823
  &[data-single-char] {
56824
+ /* The digit sits in a square content box that the radius rounds into a
56825
+ circle, so no padding is needed to obtain the shape. Sizing is
56826
+ content-box: a padding prop then grows the square from the outside —
56827
+ a bigger circle, or a pill on one axis — instead of eating into it
56828
+ and pushing the digit out. */
56829
+ --badge-count-padding-x-default: 0;
56830
+ --badge-count-padding-y-default: 0;
56831
+
56747
56832
  display: inline-block;
56748
- aspect-ratio: 1/1;
56833
+ box-sizing: content-box;
56834
+ width: 1.6em;
56749
56835
  height: 1.6em;
56750
- padding: 0;
56751
56836
  text-align: center;
56752
56837
  line-height: 1.6em;
56838
+ /* Larger than any half-height it can reach, so the shape stays fully
56839
+ round whatever the padding adds. */
56840
+ border-radius: 100em;
56753
56841
  }
56754
56842
  }
56755
56843
 
56756
56844
  /* Circle */
56757
56845
  &[data-circle] {
56758
56846
  --x-number-font-size: var(--font-size);
56847
+ /* Same as the single char ellipse: the radius comes from the number of
56848
+ characters, padding grows it from the outside. */
56849
+ --badge-count-padding-x-default: 0;
56850
+ --badge-count-padding-y-default: 0;
56759
56851
 
56760
56852
  display: inline-flex;
56761
56853
  box-sizing: content-box;
56762
56854
  aspect-ratio: 1/1;
56763
56855
  width: var(--x-radius);
56764
56856
  height: var(--x-radius);
56857
+ padding-top: var(--x-badge-count-padding-top);
56858
+ padding-right: var(--x-badge-count-padding-right);
56859
+ padding-bottom: var(--x-badge-count-padding-bottom);
56860
+ padding-left: var(--x-badge-count-padding-left);
56765
56861
  align-items: center;
56766
56862
  justify-content: center;
56767
56863
  background: var(--x-background);
56768
56864
  background-color: var(--x-background-color);
56769
- border-radius: 50%;
56865
+ border-radius: 100em;
56770
56866
 
56771
56867
  &[data-single-char] {
56772
56868
  --x-radius: 1.6em;
@@ -56868,11 +56964,16 @@ const BadgeCount = ({
56868
56964
  })
56869
56965
  });
56870
56966
  };
56871
- const BadgeStyleCSSVars = {
56967
+ const BadgeCountStyleCSSVars = {
56872
56968
  borderWidth: "--border-width",
56873
56969
  borderRadius: "--border-radius",
56874
- paddingRight: "--padding-right",
56875
- paddingLeft: "--padding-left",
56970
+ padding: "--badge-count-padding",
56971
+ paddingX: "--badge-count-padding-x",
56972
+ paddingY: "--badge-count-padding-y",
56973
+ paddingTop: "--badge-count-padding-top",
56974
+ paddingRight: "--badge-count-padding-right",
56975
+ paddingBottom: "--badge-count-padding-bottom",
56976
+ paddingLeft: "--badge-count-padding-left",
56876
56977
  backgroundColor: "--background-color",
56877
56978
  background: "--background",
56878
56979
  borderColor: "--border-color",
@@ -56911,7 +57012,7 @@ const BadgeCountEllipse = ({
56911
57012
  "data-loading": loading ? "" : undefined,
56912
57013
  "data-single-char": charCount === 1 ? "" : undefined,
56913
57014
  ...props,
56914
- styleCSSVars: BadgeStyleCSSVars,
57015
+ styleCSSVars: BadgeCountStyleCSSVars,
56915
57016
  spacing: "pre",
56916
57017
  children: loading ? jsx(Icon, {
56917
57018
  children: jsx(LoadingDotsSvg, {})
@@ -56937,7 +57038,7 @@ const BadgeCountCircle = ({
56937
57038
  "data-four-chars": charCount === 4 ? "" : undefined,
56938
57039
  "data-value-overflow": hasOverflow ? "" : undefined,
56939
57040
  ...props,
56940
- styleCSSVars: BadgeStyleCSSVars,
57041
+ styleCSSVars: BadgeCountStyleCSSVars,
56941
57042
  spacing: "pre",
56942
57043
  children: loading ? jsx(Icon, {
56943
57044
  children: jsx(LoadingDotsSvg, {})