@jsenv/navi 0.12.1 → 0.12.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.
@@ -2199,121 +2199,122 @@ const ARROW_SPACING = 8;
2199
2199
 
2200
2200
  import.meta.css = /* css */ `
2201
2201
  @layer navi {
2202
- :root {
2203
- --navi-callout-background-color: white;
2204
- --navi-callout-padding: 8px;
2205
- }
2206
-
2207
2202
  .navi_callout {
2208
- position: absolute;
2209
- top: 0;
2210
- left: 0;
2211
- z-index: 1;
2212
- display: block;
2213
- height: auto;
2214
- opacity: 0;
2215
- /* will be positioned with transform: translate */
2216
- transition: opacity 0.2s ease-in-out;
2217
- overflow: visible;
2203
+ --background-color: white;
2204
+ --padding: 8px;
2218
2205
  }
2206
+ }
2219
2207
 
2220
- .navi_callout_frame {
2221
- position: absolute;
2222
- filter: drop-shadow(4px 4px 3px rgba(0, 0, 0, 0.2));
2223
- pointer-events: none;
2224
- }
2225
- .navi_callout[data-level="info"] .navi_callout_border {
2226
- fill: var(--navi-info-color);
2227
- }
2228
- .navi_callout[data-level="warning"] .navi_callout_border {
2229
- fill: var(--navi-warning-color);
2230
- }
2231
- .navi_callout[data-level="error"] .navi_callout_border {
2232
- fill: var(--navi-error-color);
2233
- }
2234
- .navi_callout_frame svg {
2235
- position: absolute;
2236
- inset: 0;
2237
- overflow: visible;
2238
- }
2239
- .navi_callout_background {
2240
- fill: var(--navi-callout-background-color);
2241
- }
2208
+ .navi_callout {
2209
+ position: absolute;
2210
+ top: 0;
2211
+ left: 0;
2212
+ z-index: 1;
2213
+ display: block;
2214
+ height: auto;
2215
+ opacity: 0;
2216
+ /* will be positioned with transform: translate */
2217
+ transition: opacity 0.2s ease-in-out;
2218
+ overflow: visible;
2242
2219
 
2243
- .navi_callout_box {
2244
- position: relative;
2245
- border-style: solid;
2246
- border-color: transparent;
2247
- }
2248
- .navi_callout_body {
2249
- position: relative;
2250
- display: flex;
2251
- max-width: 47vw;
2252
- padding: var(--navi-callout-padding);
2253
- flex-direction: row;
2254
- gap: 10px;
2255
- }
2256
- .navi_callout_icon {
2257
- display: flex;
2258
- width: 22px;
2259
- height: 22px;
2260
- flex-shrink: 0;
2261
- align-items: center;
2262
- align-self: flex-start;
2263
- justify-content: center;
2264
- border-radius: 2px;
2265
- }
2266
- .navi_callout_icon_svg {
2267
- width: 16px;
2268
- height: 12px;
2269
- color: white;
2270
- }
2271
- .navi_callout[data-level="info"] .navi_callout_icon {
2272
- background-color: var(--navi-info-color);
2273
- }
2274
- .navi_callout[data-level="warning"] .navi_callout_icon {
2275
- background-color: var(--navi-warning-color);
2276
- }
2277
- .navi_callout[data-level="error"] .navi_callout_icon {
2278
- background-color: var(--navi-error-color);
2279
- }
2280
- .navi_callout_message {
2281
- min-width: 0;
2282
- align-self: center;
2283
- word-break: break-word;
2284
- overflow-wrap: anywhere;
2285
- }
2286
- .navi_callout_message iframe {
2287
- display: block;
2288
- margin: 0;
2289
- }
2290
- .navi_callout_close_button_column {
2291
- display: flex;
2292
- height: 22px;
2293
- }
2294
- .navi_callout_close_button {
2295
- width: 1em;
2296
- height: 1em;
2297
- padding: 0;
2298
- align-self: center;
2299
- color: currentColor;
2300
- font-size: inherit;
2301
- background: none;
2302
- border: none;
2303
- border-radius: 0.2em;
2304
- cursor: pointer;
2305
- }
2306
- .navi_callout_close_button:hover {
2307
- background: rgba(0, 0, 0, 0.1);
2308
- }
2309
- .navi_callout_close_button_svg {
2310
- width: 100%;
2311
- height: 100%;
2312
- }
2313
- .navi_callout_error_stack {
2314
- max-height: 200px;
2315
- overflow: auto;
2316
- }
2220
+ --x-border-color: var(--x-level-color);
2221
+ --x-icon-color: var(--x-level-color);
2222
+ --x-background-color: var(--background-color);
2223
+ }
2224
+
2225
+ .navi_callout_frame {
2226
+ position: absolute;
2227
+ filter: drop-shadow(4px 4px 3px rgba(0, 0, 0, 0.2));
2228
+ pointer-events: none;
2229
+ }
2230
+ .navi_callout .navi_callout_border {
2231
+ fill: var(--x-border-color);
2232
+ }
2233
+ .navi_callout[data-level="info"] {
2234
+ --x-level-color: var(--navi-info-color);
2235
+ }
2236
+ .navi_callout[data-level="warning"] {
2237
+ --x-level-color: var(--navi-warning-color);
2238
+ }
2239
+ .navi_callout[data-level="error"] {
2240
+ --x-level-color: var(--navi-error-color);
2241
+ }
2242
+
2243
+ .navi_callout_frame svg {
2244
+ position: absolute;
2245
+ inset: 0;
2246
+ overflow: visible;
2247
+ }
2248
+ .navi_callout_background {
2249
+ fill: var(--x-background-color);
2250
+ }
2251
+
2252
+ .navi_callout_box {
2253
+ position: relative;
2254
+ border-style: solid;
2255
+ border-color: transparent;
2256
+ }
2257
+ .navi_callout_body {
2258
+ position: relative;
2259
+ display: flex;
2260
+ max-width: 47vw;
2261
+ padding: var(--padding);
2262
+ flex-direction: row;
2263
+ gap: 10px;
2264
+ }
2265
+ .navi_callout_icon {
2266
+ display: flex;
2267
+ width: 22px;
2268
+ height: 22px;
2269
+ flex-shrink: 0;
2270
+ align-items: center;
2271
+ align-self: flex-start;
2272
+ justify-content: center;
2273
+ background-color: var(--x-icon-color);
2274
+ border-radius: 2px;
2275
+ }
2276
+ .navi_callout_icon_svg {
2277
+ width: 16px;
2278
+ height: 12px;
2279
+ color: white;
2280
+ }
2281
+
2282
+ .navi_callout_message {
2283
+ min-width: 0;
2284
+ align-self: center;
2285
+ word-break: break-word;
2286
+ overflow-wrap: anywhere;
2287
+ }
2288
+ .navi_callout_message iframe {
2289
+ display: block;
2290
+ margin: 0;
2291
+ }
2292
+ .navi_callout_close_button_column {
2293
+ display: flex;
2294
+ height: 22px;
2295
+ }
2296
+ .navi_callout_close_button {
2297
+ width: 1em;
2298
+ height: 1em;
2299
+ padding: 0;
2300
+ align-self: center;
2301
+ color: currentColor;
2302
+ font-size: inherit;
2303
+ background: none;
2304
+ border: none;
2305
+ border-radius: 0.2em;
2306
+ cursor: pointer;
2307
+ }
2308
+ .navi_callout_close_button:hover {
2309
+ background: rgba(0, 0, 0, 0.1);
2310
+ }
2311
+ .navi_callout_close_button_svg {
2312
+ width: 100%;
2313
+ height: 100%;
2314
+ }
2315
+ .navi_callout_error_stack {
2316
+ max-height: 200px;
2317
+ overflow: auto;
2317
2318
  }
2318
2319
  `;
2319
2320
 
@@ -12510,9 +12511,18 @@ const CharSlot = ({
12510
12511
  });
12511
12512
  };
12512
12513
  const Icon = ({
12514
+ box,
12513
12515
  children,
12514
12516
  ...props
12515
12517
  }) => {
12518
+ if (box) {
12519
+ return jsx(Box, {
12520
+ layoutInline: true,
12521
+ layoutColumn: true,
12522
+ ...props,
12523
+ children: children
12524
+ });
12525
+ }
12516
12526
  return jsx(CharSlot, {
12517
12527
  decorative: true,
12518
12528
  ...props,
@@ -13002,7 +13012,6 @@ const LinkWithAction = props => {
13002
13012
  const RouteLink = ({
13003
13013
  route,
13004
13014
  routeParams,
13005
- active,
13006
13015
  children,
13007
13016
  ...rest
13008
13017
  }) => {
@@ -13011,11 +13020,13 @@ const RouteLink = ({
13011
13020
  }
13012
13021
  const routeStatus = useRouteStatus(route);
13013
13022
  const url = route.buildUrl(routeParams);
13014
- const innerActive = active || routeStatus.active;
13023
+ const routeIsActive = routeStatus.active;
13015
13024
  return jsx(Link, {
13016
13025
  ...rest,
13017
13026
  href: url,
13018
- active: innerActive,
13027
+ pseudoState: {
13028
+ ":-navi-current-link": routeIsActive
13029
+ },
13019
13030
  children: children
13020
13031
  });
13021
13032
  };
@@ -14027,12 +14038,6 @@ const useUIState = (uiStateController) => {
14027
14038
 
14028
14039
  installImportMetaCss(import.meta);import.meta.css = /* css */`
14029
14040
  @layer navi {
14030
- :root {
14031
- --navi-checkbox-color: light-dark(#4476ff, #3b82f6);
14032
- --navi-checkmark-color-light: white;
14033
- --navi-checkmark-color-dark: rgb(55, 55, 55);
14034
- }
14035
-
14036
14041
  .navi_checkbox {
14037
14042
  --outline-offset: 1px;
14038
14043
  --outline-width: 2px;
@@ -14044,8 +14049,10 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
14044
14049
  --outline-color: light-dark(#4476ff, #3b82f6);
14045
14050
  --border-color: light-dark(#767676, #8e8e93);
14046
14051
  --background-color: white;
14047
- --color: var(--navi-checkbox-color);
14048
- --checkmark-color: var(--navi-checkmark-color-light);
14052
+ --color: light-dark(#4476ff, #3b82f6);
14053
+ --checkmark-color-light: white;
14054
+ --checkmark-color-dark: rgb(55, 55, 55);
14055
+ --checkmark-color: var(--checkmark-color-light);
14049
14056
 
14050
14057
  --color-mix-light: black;
14051
14058
  --color-mix-dark: white;
@@ -14309,8 +14316,8 @@ const InputCheckboxBasic = props => {
14309
14316
  const renderCheckboxMemoized = useCallback(renderCheckbox, [innerName, checked, innerRequired]);
14310
14317
  useLayoutEffect(() => {
14311
14318
  const naviCheckbox = ref.current;
14312
- const lightColor = "var(--navi-checkmark-color-light)";
14313
- const darkColor = "var(--navi-checkmark-color-dark)";
14319
+ const lightColor = "var(--checkmark-color-light)";
14320
+ const darkColor = "var(--checkmark-color-dark)";
14314
14321
  const colorPicked = pickLightOrDark("var(--color)", lightColor, darkColor, naviCheckbox);
14315
14322
  if (colorPicked === lightColor) {
14316
14323
  naviCheckbox.removeAttribute("data-dark");
@@ -14422,10 +14429,6 @@ const InputCheckboxInsideForm = InputCheckboxBasic;
14422
14429
 
14423
14430
  installImportMetaCss(import.meta);import.meta.css = /* css */`
14424
14431
  @layer navi {
14425
- :root {
14426
- --navi-radiomark-color: light-dark(#4476ff, #3b82f6);
14427
- }
14428
-
14429
14432
  .navi_radio {
14430
14433
  --outline-offset: 1px;
14431
14434
  --outline-width: 2px;
@@ -14435,7 +14438,7 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
14435
14438
  --outline-color: light-dark(#4476ff, #3b82f6);
14436
14439
  --border-color: light-dark(#767676, #8e8e93);
14437
14440
  --background-color: white;
14438
- --color: var(--navi-radiomark-color);
14441
+ --color: light-dark(#4476ff, #3b82f6);
14439
14442
  --radiomark-color: var(--color);
14440
14443
  --border-color-checked: var(--color);
14441
14444
 
@@ -17575,9 +17578,11 @@ const ROW_MAX_HEIGHT = 100;
17575
17578
  const COLUMN_MIN_WIDTH = 50;
17576
17579
  const COLUMN_MAX_WIDTH = 500;
17577
17580
  import.meta.css = /* css */`
17578
- body {
17579
- --table-resizer-handle-color: #063b7c;
17580
- --table-resizer-color: #387ec9;
17581
+ @layer navi {
17582
+ .navi_table {
17583
+ --table-resizer-handle-color: #063b7c;
17584
+ --table-resizer-color: #387ec9;
17585
+ }
17581
17586
  }
17582
17587
 
17583
17588
  .navi_table_cell {
@@ -17593,10 +17598,10 @@ import.meta.css = /* css */`
17593
17598
  }
17594
17599
  .navi_table_cell_resize_handle[data-left],
17595
17600
  .navi_table_cell_resize_handle[data-right] {
17596
- cursor: ew-resize;
17597
17601
  top: 0;
17598
17602
  bottom: 0;
17599
17603
  width: 8px;
17604
+ cursor: ew-resize;
17600
17605
  }
17601
17606
  .navi_table_cell_resize_handle[data-left] {
17602
17607
  left: 0;
@@ -17607,10 +17612,10 @@ import.meta.css = /* css */`
17607
17612
 
17608
17613
  .navi_table_cell_resize_handle[data-top],
17609
17614
  .navi_table_cell_resize_handle[data-bottom] {
17610
- cursor: ns-resize;
17611
- left: 0;
17612
17615
  right: 0;
17616
+ left: 0;
17613
17617
  height: 8px;
17618
+ cursor: ns-resize;
17614
17619
  }
17615
17620
  .navi_table_cell_resize_handle[data-top] {
17616
17621
  top: 0;
@@ -17620,25 +17625,25 @@ import.meta.css = /* css */`
17620
17625
  }
17621
17626
 
17622
17627
  .navi_table_column_resizer {
17623
- pointer-events: none;
17624
17628
  position: absolute;
17629
+ top: var(--table-visual-top);
17625
17630
  left: var(--table-column-resizer-left);
17626
17631
  width: 10px;
17627
- top: var(--table-visual-top);
17628
17632
  height: var(--table-visual-height);
17629
17633
  opacity: 0;
17634
+ pointer-events: none;
17630
17635
  }
17631
17636
  .navi_table_column_resize_handle {
17632
17637
  position: absolute;
17633
- height: 100%;
17634
17638
  top: 50%;
17635
- transform: translateY(-50%);
17636
- border-radius: 15px;
17637
- background: var(--table-resizer-handle-color);
17638
17639
  /* opacity: 0.5; */
17639
17640
  width: 5px;
17641
+ height: 100%;
17640
17642
  height: 26px;
17641
17643
  max-height: 80%;
17644
+ background: var(--table-resizer-handle-color);
17645
+ border-radius: 15px;
17646
+ transform: translateY(-50%);
17642
17647
  }
17643
17648
  .navi_table_column_resize_handle[data-left] {
17644
17649
  left: 2px;
@@ -17649,16 +17654,16 @@ import.meta.css = /* css */`
17649
17654
  .navi_table_column_resize_handle_container {
17650
17655
  position: absolute;
17651
17656
  top: 0;
17652
- left: -10px;
17653
17657
  right: 0;
17658
+ left: -10px;
17654
17659
  height: var(--table-cell-height);
17655
17660
  }
17656
17661
  .navi_table_column_resizer_line {
17657
17662
  position: absolute;
17658
17663
  top: 0;
17659
17664
  bottom: 0;
17660
- width: 5px;
17661
17665
  left: -3px;
17666
+ width: 5px;
17662
17667
  background: var(--table-resizer-color);
17663
17668
  opacity: 0;
17664
17669
  transition: opacity 0.1s ease;
@@ -17675,25 +17680,25 @@ import.meta.css = /* css */`
17675
17680
  }
17676
17681
 
17677
17682
  .navi_table_row_resizer {
17678
- pointer-events: none;
17679
17683
  position: absolute;
17684
+ top: var(--table-row-resizer-top);
17680
17685
  left: var(--table-visual-left);
17681
17686
  width: var(--table-visual-width);
17682
- top: var(--table-row-resizer-top);
17683
17687
  height: 10px;
17684
17688
  opacity: 0;
17689
+ pointer-events: none;
17685
17690
  }
17686
17691
  .navi_table_row_resize_handle {
17687
17692
  position: absolute;
17688
- width: 100%;
17689
17693
  left: 50%;
17690
- transform: translateX(-50%);
17691
- border-radius: 15px;
17692
- background: var(--table-resizer-handle-color);
17694
+ width: 100%;
17693
17695
  /* opacity: 0.5; */
17694
17696
  width: 26px;
17695
- height: 5px;
17696
17697
  max-width: 80%;
17698
+ height: 5px;
17699
+ background: var(--table-resizer-handle-color);
17700
+ border-radius: 15px;
17701
+ transform: translateX(-50%);
17697
17702
  }
17698
17703
  .navi_table_row_resize_handle[data-top] {
17699
17704
  top: 2px;
@@ -17703,17 +17708,17 @@ import.meta.css = /* css */`
17703
17708
  }
17704
17709
  .navi_table_row_resize_handle_container {
17705
17710
  position: absolute;
17706
- left: 0;
17707
17711
  top: -10px;
17708
17712
  bottom: 0;
17713
+ left: 0;
17709
17714
  width: var(--table-cell-width);
17710
17715
  }
17711
17716
  .navi_table_row_resizer_line {
17712
17717
  position: absolute;
17713
- left: 0;
17718
+ top: -3px;
17714
17719
  right: 0;
17720
+ left: 0;
17715
17721
  height: 5px;
17716
- top: -3px;
17717
17722
  background: var(--table-resizer-color);
17718
17723
  opacity: 0;
17719
17724
  transition: opacity 0.1s ease;
@@ -18195,9 +18200,14 @@ const findPreviousTableRow = currentRow => {
18195
18200
  };
18196
18201
 
18197
18202
  installImportMetaCss(import.meta);import.meta.css = /* css */`
18198
- body {
18199
- --selection-border-color: #0078d4;
18200
- --selection-background-color: #eaf1fd;
18203
+ @layer navi {
18204
+ .navi_table {
18205
+ --selection-border-color: var(--navi-selection-border-color, #0078d4);
18206
+ --selection-background-color: var(
18207
+ --navi-selection-background-color,
18208
+ #eaf1fd
18209
+ );
18210
+ }
18201
18211
  }
18202
18212
 
18203
18213
  .navi_table_cell[aria-selected="true"] {
@@ -18761,10 +18771,12 @@ const useTableStickyContextValue = ({
18761
18771
  };
18762
18772
 
18763
18773
  installImportMetaCss(import.meta);import.meta.css = /* css */`
18764
- body {
18765
- --sticky-frontier-color: #c0c0c0;
18766
- --sticky-frontier-size: 12px;
18767
- --sticky-frontier-ghost-size: 8px;
18774
+ @layer navi {
18775
+ .navi_table {
18776
+ --sticky-frontier-color: #c0c0c0;
18777
+ --sticky-frontier-size: 12px;
18778
+ --sticky-frontier-ghost-size: 8px;
18779
+ }
18768
18780
  }
18769
18781
 
18770
18782
  .navi_table_cell[data-sticky-top] {
@@ -18799,9 +18811,9 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
18799
18811
  }
18800
18812
 
18801
18813
  .navi_table_sticky_frontier[data-left] {
18814
+ top: calc(var(--table-visual-top) + var(--sticky-group-top));
18802
18815
  left: calc(var(--table-visual-left) + var(--sticky-group-left));
18803
18816
  width: var(--sticky-frontier-size);
18804
- top: calc(var(--table-visual-top) + var(--sticky-group-top));
18805
18817
  height: calc(var(--table-visual-height) - var(--sticky-group-top));
18806
18818
  background: linear-gradient(
18807
18819
  to right,
@@ -18811,9 +18823,9 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
18811
18823
  }
18812
18824
 
18813
18825
  .navi_table_sticky_frontier[data-top] {
18826
+ top: calc(var(--table-visual-top) + var(--sticky-group-top));
18814
18827
  left: calc(var(--table-visual-left) + var(--sticky-group-left));
18815
18828
  width: calc(var(--table-visual-width) - var(--sticky-group-left));
18816
- top: calc(var(--table-visual-top) + var(--sticky-group-top));
18817
18829
  height: var(--sticky-frontier-size);
18818
18830
  background: linear-gradient(
18819
18831
  to bottom,
@@ -18825,8 +18837,8 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
18825
18837
  .navi_table_sticky_frontier_ghost,
18826
18838
  .navi_table_sticky_frontier_preview {
18827
18839
  position: absolute;
18828
- pointer-events: none;
18829
18840
  opacity: 0;
18841
+ pointer-events: none;
18830
18842
  }
18831
18843
  .navi_table_sticky_frontier_ghost {
18832
18844
  z-index: ${Z_INDEX_STICKY_FRONTIER_GHOST};
@@ -20139,8 +20151,6 @@ const useSignalSync = (value, initialValue = value) => {
20139
20151
  return signal;
20140
20152
  };
20141
20153
 
20142
- const withPropsStyle = () => {};
20143
-
20144
20154
  installImportMetaCss(import.meta);import.meta.css = /* css */`
20145
20155
  .navi_font_sized_svg {
20146
20156
  display: flex;
@@ -20153,16 +20163,13 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
20153
20163
  }
20154
20164
  `;
20155
20165
  const FontSizedSvg = ({
20156
- width = "1em",
20157
- height = "1em",
20158
20166
  children,
20159
20167
  ...rest
20160
20168
  }) => {
20161
- const [remainingProps, innerStyle] = withPropsStyle();
20162
- return jsx("span", {
20163
- ...remainingProps,
20164
- className: "navi_font_sized_svg",
20165
- style: innerStyle,
20169
+ return jsx(Box, {
20170
+ ...rest,
20171
+ as: "span",
20172
+ baseClassName: "navi_font_sized_svg",
20166
20173
  children: children
20167
20174
  });
20168
20175
  };