@jsenv/navi 0.16.59 → 0.16.60

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.
@@ -27495,63 +27495,73 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
27495
27495
  @layer navi {
27496
27496
  }
27497
27497
  .navi_badge_count {
27498
- --x-size: 1.5em;
27499
- --x-border-radius: var(--border-radius);
27500
- --x-number-font-size: var(--font-size);
27498
+ --x-background: var(--background);
27499
+ --x-background-color: var(--background-color);
27501
27500
  position: relative;
27502
27501
  display: inline-block;
27503
-
27504
27502
  color: var(--color, var(--x-color-contrasting));
27505
27503
  font-size: var(--font-size);
27506
27504
  vertical-align: middle;
27507
- border-radius: var(--x-border-radius);
27508
- }
27509
- .navi_count_badge_overflow {
27510
- position: relative;
27511
- top: -0.1em;
27512
- }
27513
- /* Ellipse */
27514
- .navi_badge_count[data-ellipse] {
27515
- padding-right: 0.4em;
27516
- padding-left: 0.4em;
27517
- background: var(--background);
27518
- background-color: var(--background-color, var(--background));
27519
- border-radius: 1em;
27520
- }
27521
- /* Circle */
27522
- .navi_badge_count[data-circle] {
27523
- width: var(--x-size);
27524
- height: var(--x-size);
27525
- }
27526
- .navi_badge_count_frame {
27527
- position: absolute;
27528
- top: 50%;
27529
- left: 0;
27530
- width: 100%;
27531
- height: 100%;
27532
- background: var(--background);
27533
- background-color: var(--background-color, var(--background));
27534
- border-radius: inherit;
27535
- transform: translateY(-50%);
27536
- }
27537
- .navi_badge_count_text {
27538
- position: absolute;
27539
- top: 50%;
27540
- left: 50%;
27541
- font-size: var(--x-number-font-size, inherit);
27542
- transform: translate(-50%, -50%);
27543
- }
27544
- .navi_badge_count[data-single-char] {
27545
- --x-border-radius: 100%;
27546
- --x-number-font-size: unset;
27547
- }
27548
- .navi_badge_count[data-two-chars] {
27549
- --x-border-radius: 100%;
27550
- --x-number-font-size: 0.8em;
27551
- }
27552
- .navi_badge_count[data-three-chars] {
27553
- --x-border-radius: 100%;
27554
- --x-number-font-size: 0.6em;
27505
+
27506
+ .navi_count_badge_overflow {
27507
+ position: relative;
27508
+ top: -0.1em;
27509
+ }
27510
+
27511
+ /* Ellipse */
27512
+ &[data-ellipse] {
27513
+ padding-right: 0.4em;
27514
+ padding-left: 0.4em;
27515
+ background: var(--x-background);
27516
+ background-color: var(--x-background-color, var(--x-background));
27517
+ border-radius: 1em;
27518
+ &[data-loading] {
27519
+ --x-background: transparent;
27520
+ }
27521
+ }
27522
+
27523
+ /* Circle */
27524
+ &[data-circle] {
27525
+ --x-size: 1.5em;
27526
+ --x-border-radius: var(--border-radius);
27527
+ --x-number-font-size: var(--font-size);
27528
+
27529
+ width: var(--x-size);
27530
+ height: var(--x-size);
27531
+ border-radius: var(--x-border-radius);
27532
+ &[data-single-char] {
27533
+ --x-border-radius: 100%;
27534
+ --x-number-font-size: unset;
27535
+ }
27536
+ &[data-two-chars] {
27537
+ --x-border-radius: 100%;
27538
+ --x-number-font-size: 0.8em;
27539
+ }
27540
+ &[data-three-chars] {
27541
+ --x-border-radius: 100%;
27542
+ --x-number-font-size: 0.6em;
27543
+ }
27544
+
27545
+ .navi_badge_count_frame {
27546
+ position: absolute;
27547
+ top: 50%;
27548
+ left: 0;
27549
+ width: 100%;
27550
+ height: 100%;
27551
+ background: var(--x-background);
27552
+ background-color: var(--x-background-color, var(--x-background));
27553
+ border-radius: inherit;
27554
+ transform: translateY(-50%);
27555
+ }
27556
+
27557
+ .navi_badge_count_text {
27558
+ position: absolute;
27559
+ top: 50%;
27560
+ left: 50%;
27561
+ font-size: var(--x-number-font-size, inherit);
27562
+ transform: translate(-50%, -50%);
27563
+ }
27564
+ }
27555
27565
  }
27556
27566
  `;
27557
27567
  const BadgeStyleCSSVars = {
@@ -27572,11 +27582,11 @@ const BadgeCountOverflow = () => jsx("span", {
27572
27582
  const MAX_CHAR_AS_CIRCLE = 3;
27573
27583
  const BadgeCount = ({
27574
27584
  children,
27575
- max = 99,
27576
27585
  maxElement = jsx(BadgeCountOverflow, {}),
27577
27586
  // When you use max="none" (or max > 99) it might be a good idea to force ellipse
27578
27587
  // so that visually the interface do not suddently switch from circle to ellipse depending on the count
27579
27588
  ellipse,
27589
+ max = ellipse ? Infinity : 99,
27580
27590
  ...props
27581
27591
  }) => {
27582
27592
  const defaultRef = useRef();
@@ -27660,26 +27670,32 @@ const BadgeCountCircle = ({
27660
27670
  };
27661
27671
  const BadgeCountEllipse = ({
27662
27672
  ref,
27673
+ loading,
27663
27674
  children,
27664
27675
  hasOverflow,
27665
27676
  ...props
27666
27677
  }) => {
27667
- return jsxs(Text, {
27678
+ return jsx(Text, {
27668
27679
  ref: ref,
27669
27680
  className: "navi_badge_count",
27670
27681
  bold: true,
27671
27682
  "data-ellipse": "",
27672
27683
  "data-value-overflow": hasOverflow ? "" : undefined,
27684
+ "data-loading": loading ? "" : undefined,
27673
27685
  ...props,
27674
27686
  styleCSSVars: BadgeStyleCSSVars,
27675
27687
  spacing: "pre",
27676
- children: [jsx("span", {
27677
- style: "user-select: none",
27678
- children: "\u200B"
27679
- }), children, jsx("span", {
27680
- style: "user-select: none",
27681
- children: "\u200B"
27682
- })]
27688
+ children: loading ? jsx(Icon, {
27689
+ children: jsx(LoadingDots, {})
27690
+ }) : jsxs(Fragment, {
27691
+ children: [jsx("span", {
27692
+ style: "user-select: none",
27693
+ children: "\u200B"
27694
+ }), children, jsx("span", {
27695
+ style: "user-select: none",
27696
+ children: "\u200B"
27697
+ })]
27698
+ })
27683
27699
  });
27684
27700
  };
27685
27701