@sustaina/shared-ui 1.62.3 → 1.64.0

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.
package/dist/index.mjs CHANGED
@@ -15676,7 +15676,8 @@ function MentionsTypeaheadMenuItem({
15676
15676
  function MentionsPlugin({
15677
15677
  mentions = [],
15678
15678
  mentionConfig,
15679
- trigger
15679
+ trigger,
15680
+ triggerOnly = false
15680
15681
  }) {
15681
15682
  const [editor] = useLexicalComposerContext();
15682
15683
  const [queryString, setQueryString] = useState(null);
@@ -15851,10 +15852,13 @@ function MentionsPlugin({
15851
15852
  if (triggerMatch) {
15852
15853
  return triggerMatch;
15853
15854
  }
15855
+ if (triggerOnly) {
15856
+ return null;
15857
+ }
15854
15858
  }
15855
15859
  return checkForTextMatch(text, mentions, mentionConfig);
15856
15860
  },
15857
- [trigger, mentions, mentionConfig]
15861
+ [trigger, triggerOnly, mentions, mentionConfig]
15858
15862
  );
15859
15863
  if (mentions.length === 0) {
15860
15864
  return null;
@@ -16047,6 +16051,7 @@ function RichTextInner({
16047
16051
  mentions,
16048
16052
  mentionConfig,
16049
16053
  mentionTrigger,
16054
+ mentionTriggerOnly,
16050
16055
  plainTextMentions = false,
16051
16056
  className,
16052
16057
  id,
@@ -16155,7 +16160,8 @@ function RichTextInner({
16155
16160
  {
16156
16161
  mentions,
16157
16162
  mentionConfig: finalMentionConfig,
16158
- trigger: mentionTrigger
16163
+ trigger: mentionTrigger,
16164
+ triggerOnly: mentionTriggerOnly
16159
16165
  }
16160
16166
  ),
16161
16167
  /* @__PURE__ */ jsx(MentionDeletePlugin, {}),
@@ -17575,6 +17581,11 @@ var alignClassMap = {
17575
17581
  center: "justify-center",
17576
17582
  end: "justify-end"
17577
17583
  };
17584
+ var outerAlignClassMap = {
17585
+ start: "self-start",
17586
+ center: "self-center",
17587
+ end: "self-end"
17588
+ };
17578
17589
  var ProgressBar = ({
17579
17590
  percent = 0,
17580
17591
  size = "md",
@@ -17597,7 +17608,11 @@ var ProgressBar = ({
17597
17608
  const linecapClass = linecapMap[strokeLinecap];
17598
17609
  const posType = percentPosition?.type ?? "outer";
17599
17610
  const posAlign = percentPosition?.align ?? "end";
17611
+ const posSide = percentPosition?.side;
17600
17612
  const isInner = posType === "inner";
17613
+ const isTopBottom = posSide === "top" || posSide === "bottom";
17614
+ const isLeftOuter = !isInner && !isTopBottom && (posSide === "left" || !posSide && posAlign === "start");
17615
+ const outerAlignClass = outerAlignClassMap[posAlign];
17601
17616
  const { className: sizeClass, style: sizeStyle } = resolveSize(size);
17602
17617
  const info = useMemo(() => {
17603
17618
  if (!showInfo) return null;
@@ -17608,11 +17623,13 @@ var ProgressBar = ({
17608
17623
  "div",
17609
17624
  {
17610
17625
  className: cn(
17611
- "flex w-full items-center gap-2 min-w-0",
17612
- posAlign === "start" && !isInner && "flex-row-reverse",
17626
+ "flex w-full min-w-0",
17627
+ isTopBottom ? "flex-col gap-1" : "items-center gap-2",
17628
+ isLeftOuter && "flex-row-reverse",
17613
17629
  className
17614
17630
  ),
17615
17631
  children: [
17632
+ posSide === "top" && info && /* @__PURE__ */ jsx("span", { className: cn("text-xs shrink-0 tabular-nums", outerAlignClass), children: info }),
17616
17633
  /* @__PURE__ */ jsxs(
17617
17634
  "div",
17618
17635
  {
@@ -17651,7 +17668,8 @@ var ProgressBar = ({
17651
17668
  ]
17652
17669
  }
17653
17670
  ),
17654
- !isInner && info && /* @__PURE__ */ jsx("span", { className: "text-xs shrink-0 tabular-nums", children: info })
17671
+ posSide === "bottom" && info && /* @__PURE__ */ jsx("span", { className: cn("text-xs shrink-0 tabular-nums", outerAlignClass), children: info }),
17672
+ !isInner && !isTopBottom && info && /* @__PURE__ */ jsx("span", { className: "text-xs shrink-0 tabular-nums", children: info })
17655
17673
  ]
17656
17674
  }
17657
17675
  );
@@ -18103,7 +18121,8 @@ function MentionsTypeaheadMenuItem2({
18103
18121
  function MentionsPlugin2({
18104
18122
  mentions = [],
18105
18123
  mentionConfig,
18106
- trigger
18124
+ trigger,
18125
+ triggerOnly = false
18107
18126
  }) {
18108
18127
  const [editor] = useLexicalComposerContext();
18109
18128
  const [queryString, setQueryString] = useState(null);
@@ -18281,10 +18300,13 @@ function MentionsPlugin2({
18281
18300
  if (triggerMatch) {
18282
18301
  return triggerMatch;
18283
18302
  }
18303
+ if (triggerOnly) {
18304
+ return null;
18305
+ }
18284
18306
  }
18285
18307
  return checkForTextMatch2(text, mentions, mentionConfig);
18286
18308
  },
18287
- [trigger, mentions, mentionConfig]
18309
+ [trigger, triggerOnly, mentions, mentionConfig]
18288
18310
  );
18289
18311
  if (mentions.length === 0) {
18290
18312
  return null;
@@ -18435,6 +18457,7 @@ function InputMentionInner({
18435
18457
  mentions,
18436
18458
  mentionConfig,
18437
18459
  mentionTrigger,
18460
+ mentionTriggerOnly,
18438
18461
  plainTextMentions = false,
18439
18462
  className,
18440
18463
  id,
@@ -18514,7 +18537,8 @@ function InputMentionInner({
18514
18537
  {
18515
18538
  mentions,
18516
18539
  mentionConfig: finalMentionConfig,
18517
- trigger: mentionTrigger
18540
+ trigger: mentionTrigger,
18541
+ triggerOnly: mentionTriggerOnly
18518
18542
  }
18519
18543
  ),
18520
18544
  /* @__PURE__ */ jsx(MentionDeletePlugin2, {}),