@jsenv/navi 0.26.14 → 0.26.16

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.
@@ -8212,6 +8212,12 @@ import.meta.css = [/* css */`
8212
8212
  }
8213
8213
  }
8214
8214
 
8215
+ /* We force a given display style using html attribute instead of inline style */
8216
+ /* No particular reason for this, logic could be moved to inline style like the rest */
8217
+ /* It was an attempt to see if attributes where a good candidate to set style based on props */
8218
+ /* Actullay it's not that much as it make the attribute and CSS complexity explode */
8219
+ /* For now it's kept here and must be outside layer navi to be able to override any given display
8220
+ Set by navi itself on their default display */
8215
8221
  [navi-box-flow="inline"] {
8216
8222
  display: inline;
8217
8223
  }
@@ -22636,8 +22642,9 @@ installImportMetaCssBuild(import.meta);const css$x = /* css */`
22636
22642
 
22637
22643
  .navi_button {
22638
22644
  /* outline will draw the border when visible */
22639
- --x-button-outline-width: var(--button-outline-width) +
22640
- var(--button-border-width);
22645
+ --x-button-outline-width: calc(
22646
+ var(--button-outline-width) + var(--button-border-width)
22647
+ );
22641
22648
  --x-button-outline-offset: calc(-1 * var(--button-border-width));
22642
22649
  --x-button-border-color: var(--button-border-color);
22643
22650
  --x-button-background: var(--button-background);
@@ -24800,7 +24807,7 @@ installImportMetaCssBuild(import.meta);const css$p = /* css */`
24800
24807
  --background-color-disabled-checked: #d3d3d3;
24801
24808
 
24802
24809
  /* Toggle specific */
24803
- --toggle-margin: 2px;
24810
+ --toggle-margin: 2px; /* Useful to reserve space for outline */
24804
24811
  --toggle-width: 2.5em;
24805
24812
  --toggle-thumb-size: 1.2em;
24806
24813
  /* Padding uses px and not em otherwise it can be resolved to a float which does not play well */
@@ -24986,9 +24993,15 @@ installImportMetaCssBuild(import.meta);const css$p = /* css */`
24986
24993
 
24987
24994
  /* Toggle appearance */
24988
24995
  &[data-appearance="toggle"] {
24996
+ /* We compute ourselves the width + padding otherwise during
24997
+ translation subpixel rounding makes the thumb feels too much to the right by 1px */
24998
+ box-sizing: content-box;
24999
+ --toggle-outer-width: calc(var(--toggle-width) + var(--toggle-padding));
25000
+
24989
25001
  --margin: var(--toggle-margin);
24990
- --width: var(--toggle-width);
25002
+ --width: var(--toggle-outer-width);
24991
25003
  --height: unset;
25004
+ min-width: var(--toggle-outer-width);
24992
25005
  --border-radius: var(--toggle-border-radius);
24993
25006
  --background-color: var(--toggle-background-color);
24994
25007
  --background-color-hover: var(--toggle-background-color-hover);
@@ -25006,6 +25019,7 @@ installImportMetaCssBuild(import.meta);const css$p = /* css */`
25006
25019
  );
25007
25020
 
25008
25021
  position: relative;
25022
+ padding: var(--toggle-padding);
25009
25023
  background-color: var(--x-background-color);
25010
25024
  border-color: transparent;
25011
25025
  user-select: none;
@@ -25022,15 +25036,10 @@ installImportMetaCssBuild(import.meta);const css$p = /* css */`
25022
25036
 
25023
25037
  &[data-checked] {
25024
25038
  .navi_checkbox_toggle {
25025
- /* We remove padding 3 times */
25026
- /* - twice to get real width (box-sizing: border-box) */
25027
- /* - one more to apply right padding to the translation */
25028
25039
  transform: translateX(
25029
25040
  calc(
25030
- var(--toggle-width) - var(--toggle-thumb-size) - var(
25031
- --toggle-padding
25032
- ) *
25033
- 3
25041
+ var(--toggle-width) - var(--toggle-thumb-size) +
25042
+ var(--toggle-padding)
25034
25043
  )
25035
25044
  );
25036
25045
  }
@@ -27117,8 +27126,8 @@ const css$l = /* css */`
27117
27126
  --list-outline-width: 1px;
27118
27127
  --list-border-radius: 4px;
27119
27128
  --list-border-width: 1px;
27129
+ --list-outline-color: var(--navi-focus-outline-color);
27120
27130
  --list-border-color: light-dark(#ccc, #555);
27121
- --list-border-style: solid;
27122
27131
  --list-background-color: light-dark(#fff, #1e1e1e);
27123
27132
  --list-max-height: 220px;
27124
27133
  }
@@ -27169,10 +27178,13 @@ const css$l = /* css */`
27169
27178
  }
27170
27179
 
27171
27180
  .navi_list_container {
27181
+ --x-list-outline-width: calc(
27182
+ var(--list-outline-width) + var(--list-border-width)
27183
+ );
27184
+ --x-list-outline-offset: calc(-1 * var(--list-border-width));
27172
27185
  --x-list-border-radius: var(--list-border-radius);
27173
27186
  --x-list-border-width: var(--list-border-width);
27174
27187
  --x-list-border-color: var(--list-border-color);
27175
- --x-list-border-style: var(--list-border-style);
27176
27188
  --x-list-background-color: var(--list-background-color);
27177
27189
  /* When typing inside an input browser tries to keep caret visible */
27178
27190
  /* For input within a sticky element inside a scrollable container */
@@ -27193,14 +27205,11 @@ const css$l = /* css */`
27193
27205
  max-width: 100%;
27194
27206
  flex-direction: column;
27195
27207
  background-color: var(--x-list-background-color);
27196
- /* Use a transparent real border to reserve layout space, and draw the
27197
- visible border via outline (inset via negative offset). This way the
27198
- focus ring can simply widen the outline without shifting layout. */
27199
- border: var(--x-list-border-width) solid transparent;
27208
+ border: var(--x-list-border-width) solid var(--x-list-border-color);
27200
27209
  border-radius: var(--x-list-border-radius);
27201
- outline: var(--x-list-border-width) var(--x-list-border-style)
27202
- var(--x-list-border-color);
27203
- outline-offset: calc(-1 * var(--x-list-border-width));
27210
+ outline-width: var(--x-list-outline-width);
27211
+ outline-color: var(--x-list-outline-color);
27212
+ outline-offset: var(--x-list-outline-offset);
27204
27213
  transition: opacity 0.2s ease;
27205
27214
  /* overflow:hidden is required on the container (not the inner scroll element)
27206
27215
  so that border-radius clips the content correctly. Without it, items near
@@ -27246,14 +27255,7 @@ const css$l = /* css */`
27246
27255
  outline-offset: calc(-1 * var(--list-outline-width)); */
27247
27256
  }
27248
27257
  &[data-focus-visible] {
27249
- outline-width: calc(var(--list-border-width) + var(--list-outline-width));
27250
- outline-color: var(--navi-focus-outline-color);
27251
- outline-offset: calc(
27252
- -1 * (var(--list-border-width) + var(--list-outline-width))
27253
- );
27254
- .navi_list {
27255
- outline: none;
27256
- }
27258
+ outline-style: solid;
27257
27259
  }
27258
27260
 
27259
27261
  &[data-callout] {
@@ -27270,6 +27272,7 @@ const css$l = /* css */`
27270
27272
  padding: 0;
27271
27273
  flex-direction: column;
27272
27274
  list-style: none;
27275
+ outline: none; /* Focus is displayed on the container */
27273
27276
 
27274
27277
  /* Would create scrollbars, for now just hide the loader here */
27275
27278
  .navi_input {
@@ -29073,7 +29076,7 @@ const css$k = /* css */`
29073
29076
 
29074
29077
  .navi_input {
29075
29078
  /* outline will draw the border when visible */
29076
- --x-outline-width: var(--outline-width) + var(--border-width);
29079
+ --x-outline-width: calc(var(--outline-width) + var(--border-width));
29077
29080
  --x-outline-offset: calc(-1 * var(--border-width));
29078
29081
  --left-slot-size: 0px;
29079
29082
  --right-slot-size: 0px;
@@ -31020,13 +31023,13 @@ installImportMetaCssBuild(import.meta);const css$f = /* css */`
31020
31023
  }
31021
31024
 
31022
31025
  .navi_select {
31023
- --x-select-background-color: var(--select-background-color);
31024
- --x-select-border-color: var(--select-border-color);
31025
31026
  /* outline will draw the border when visible */
31026
31027
  --x-select-outline-width: calc(
31027
31028
  var(--select-outline-width) + var(--select-border-width)
31028
31029
  );
31029
31030
  --x-select-outline-offset: calc(-1 * var(--select-border-width));
31031
+ --x-select-background-color: var(--select-background-color);
31032
+ --x-select-border-color: var(--select-border-color);
31030
31033
  --x-select-padding-top: var(
31031
31034
  --select-padding-top,
31032
31035
  var(--select-padding-y, var(--select-padding-y-default))