@mieweb/ui 0.7.1-dev.10 → 0.7.1-dev.11

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.cjs CHANGED
@@ -22,7 +22,7 @@ var chunkVTKXM7IE_cjs = require('./chunk-VTKXM7IE.cjs');
22
22
  var chunkNGPEXCC7_cjs = require('./chunk-NGPEXCC7.cjs');
23
23
  var chunkYGA35Z2P_cjs = require('./chunk-YGA35Z2P.cjs');
24
24
  var chunkXXVUHLQN_cjs = require('./chunk-XXVUHLQN.cjs');
25
- var chunkHEV52I7A_cjs = require('./chunk-HEV52I7A.cjs');
25
+ var chunkV3S7QNFF_cjs = require('./chunk-V3S7QNFF.cjs');
26
26
  var chunkYXHX2DAK_cjs = require('./chunk-YXHX2DAK.cjs');
27
27
  var chunkXCVBCY7L_cjs = require('./chunk-XCVBCY7L.cjs');
28
28
  var chunkFKLUSYFP_cjs = require('./chunk-FKLUSYFP.cjs');
@@ -90,7 +90,7 @@ var chunkC7RVKV25_cjs = require('./chunk-C7RVKV25.cjs');
90
90
  var chunkCW75IKA6_cjs = require('./chunk-CW75IKA6.cjs');
91
91
  var chunkS5RVSXDV_cjs = require('./chunk-S5RVSXDV.cjs');
92
92
  var chunkSCV7C55E_cjs = require('./chunk-SCV7C55E.cjs');
93
- var chunkJSSBZOE7_cjs = require('./chunk-JSSBZOE7.cjs');
93
+ var chunk6ED4RUGM_cjs = require('./chunk-6ED4RUGM.cjs');
94
94
  var React10 = require('react');
95
95
  var jsxRuntime = require('react/jsx-runtime');
96
96
  var classVarianceAuthority = require('class-variance-authority');
@@ -1388,7 +1388,7 @@ function AIEmptyState({
1388
1388
  {
1389
1389
  "data-slot": "ai-empty-state-icon",
1390
1390
  className: "bg-primary-800 dark:bg-primary-800 flex h-16 w-16 items-center justify-center rounded-full text-white",
1391
- children: /* @__PURE__ */ jsxRuntime.jsx(chunkHEV52I7A_cjs.SparklesIcon, { size: "lg", className: "h-8 w-8" })
1391
+ children: /* @__PURE__ */ jsxRuntime.jsx(chunkV3S7QNFF_cjs.SparklesIcon, { size: "lg", className: "h-8 w-8" })
1392
1392
  }
1393
1393
  );
1394
1394
  const suggestionsAction = suggestions && suggestions.length > 0 && onSuggestionSelect ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-6", children: [
@@ -1499,7 +1499,7 @@ function AIChat({
1499
1499
  {
1500
1500
  "data-slot": "ai-chat-header-icon",
1501
1501
  className: "bg-primary-800 dark:bg-primary-800 flex h-8 w-8 items-center justify-center rounded-full text-white",
1502
- children: /* @__PURE__ */ jsxRuntime.jsx(chunkHEV52I7A_cjs.SparklesIcon, { size: "sm" })
1502
+ children: /* @__PURE__ */ jsxRuntime.jsx(chunkV3S7QNFF_cjs.SparklesIcon, { size: "sm" })
1503
1503
  }
1504
1504
  ),
1505
1505
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
@@ -1529,7 +1529,7 @@ function AIChat({
1529
1529
  className: "rounded-lg p-2 text-neutral-500 hover:bg-neutral-100 hover:text-neutral-700 dark:hover:bg-neutral-800 dark:hover:text-neutral-300",
1530
1530
  title: "Clear chat",
1531
1531
  "aria-label": "Clear chat",
1532
- children: /* @__PURE__ */ jsxRuntime.jsx(chunkHEV52I7A_cjs.RefreshIcon, {})
1532
+ children: /* @__PURE__ */ jsxRuntime.jsx(chunkV3S7QNFF_cjs.RefreshIcon, {})
1533
1533
  }
1534
1534
  ),
1535
1535
  onClose && /* @__PURE__ */ jsxRuntime.jsx(
@@ -1540,7 +1540,7 @@ function AIChat({
1540
1540
  className: "rounded-lg p-2 text-neutral-500 hover:bg-neutral-100 hover:text-neutral-700 dark:hover:bg-neutral-800 dark:hover:text-neutral-300",
1541
1541
  title: "Close chat",
1542
1542
  "aria-label": "Close chat",
1543
- children: /* @__PURE__ */ jsxRuntime.jsx(chunkHEV52I7A_cjs.CloseIcon, {})
1543
+ children: /* @__PURE__ */ jsxRuntime.jsx(chunkV3S7QNFF_cjs.CloseIcon, {})
1544
1544
  }
1545
1545
  )
1546
1546
  ] })
@@ -1560,7 +1560,7 @@ function AIChat({
1560
1560
  }
1561
1561
  ) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
1562
1562
  messages.map((message) => /* @__PURE__ */ jsxRuntime.jsx(
1563
- chunkHEV52I7A_cjs.AIMessageDisplay,
1563
+ chunkV3S7QNFF_cjs.AIMessageDisplay,
1564
1564
  {
1565
1565
  message,
1566
1566
  userName,
@@ -4194,7 +4194,7 @@ function AIChatTrigger({
4194
4194
  children: badge > 9 ? "9+" : badge
4195
4195
  }
4196
4196
  ),
4197
- /* @__PURE__ */ jsxRuntime.jsx(chunkHEV52I7A_cjs.SparklesIcon, { size: "lg" })
4197
+ /* @__PURE__ */ jsxRuntime.jsx(chunkV3S7QNFF_cjs.SparklesIcon, { size: "lg" })
4198
4198
  ]
4199
4199
  }
4200
4200
  );
@@ -5768,7 +5768,7 @@ function ReconciliationProposalRow({
5768
5768
  children: [
5769
5769
  /* @__PURE__ */ jsxRuntime.jsxs("dt", { className: "text-muted-foreground flex items-center gap-1 text-[11px] tracking-wide uppercase", children: [
5770
5770
  /* @__PURE__ */ jsxRuntime.jsx(
5771
- chunkHEV52I7A_cjs.SparklesIcon,
5771
+ chunkV3S7QNFF_cjs.SparklesIcon,
5772
5772
  {
5773
5773
  size: "sm",
5774
5774
  className: "text-primary-700 dark:text-primary-400"
@@ -5824,7 +5824,7 @@ function SourcePill({ source }) {
5824
5824
  "text-muted-foreground"
5825
5825
  ),
5826
5826
  children: [
5827
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary-700 dark:text-primary-400 flex items-center", children: source.icon ?? /* @__PURE__ */ jsxRuntime.jsx(chunkHEV52I7A_cjs.SparklesIcon, { size: "sm" }) }),
5827
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary-700 dark:text-primary-400 flex items-center", children: source.icon ?? /* @__PURE__ */ jsxRuntime.jsx(chunkV3S7QNFF_cjs.SparklesIcon, { size: "sm" }) }),
5828
5828
  source.thumbnailUrl && /* @__PURE__ */ jsxRuntime.jsx(
5829
5829
  "img",
5830
5830
  {
@@ -35658,6 +35658,156 @@ function ScheduleCalendar({
35658
35658
  }
35659
35659
  );
35660
35660
  }
35661
+ function PillSelect({
35662
+ options,
35663
+ value: controlledValue,
35664
+ defaultValue,
35665
+ onValueChange,
35666
+ label,
35667
+ disabled = false,
35668
+ className
35669
+ }) {
35670
+ const [internalValue, setInternalValue] = React10__namespace.useState(
35671
+ defaultValue ?? options[0]?.value ?? ""
35672
+ );
35673
+ const [expanded, setExpanded] = React10__namespace.useState(false);
35674
+ const triggerRef = React10__namespace.useRef(null);
35675
+ const menuRef = React10__namespace.useRef(null);
35676
+ const selectedOptionRef = React10__namespace.useRef(null);
35677
+ const firstEnabledOptionRef = React10__namespace.useRef(null);
35678
+ const listboxId = React10__namespace.useId();
35679
+ const [menuStyle, setMenuStyle] = React10__namespace.useState({});
35680
+ const value = controlledValue !== void 0 ? controlledValue : internalValue;
35681
+ const selectedOption = options.find((o) => o.value === value);
35682
+ const close = React10__namespace.useCallback((restoreFocus = false) => {
35683
+ setExpanded(false);
35684
+ if (restoreFocus) {
35685
+ requestAnimationFrame(
35686
+ () => triggerRef.current?.focus({ preventScroll: true })
35687
+ );
35688
+ }
35689
+ }, []);
35690
+ const updateMenuPosition = React10__namespace.useCallback(() => {
35691
+ const trigger = triggerRef.current;
35692
+ if (!trigger) return;
35693
+ const rect = trigger.getBoundingClientRect();
35694
+ const viewportPadding = 8;
35695
+ const menuWidth = Math.max(rect.width, 160);
35696
+ const maxWidth = Math.max(window.innerWidth - viewportPadding * 2, 0);
35697
+ const left = Math.min(
35698
+ Math.max(rect.left, viewportPadding),
35699
+ window.innerWidth - menuWidth - viewportPadding
35700
+ );
35701
+ setMenuStyle({
35702
+ position: "fixed",
35703
+ top: rect.bottom + 4,
35704
+ left,
35705
+ minWidth: rect.width,
35706
+ width: menuWidth,
35707
+ maxWidth,
35708
+ zIndex: 9999
35709
+ });
35710
+ }, []);
35711
+ React10__namespace.useEffect(() => {
35712
+ if (!expanded) return;
35713
+ updateMenuPosition();
35714
+ window.addEventListener("scroll", updateMenuPosition, true);
35715
+ window.addEventListener("resize", updateMenuPosition);
35716
+ return () => {
35717
+ window.removeEventListener("scroll", updateMenuPosition, true);
35718
+ window.removeEventListener("resize", updateMenuPosition);
35719
+ };
35720
+ }, [expanded, updateMenuPosition]);
35721
+ React10__namespace.useEffect(() => {
35722
+ if (!expanded) return;
35723
+ const handleClickOutside = (event) => {
35724
+ const target = event.target;
35725
+ if (triggerRef.current?.contains(target) || menuRef.current?.contains(target)) {
35726
+ return;
35727
+ }
35728
+ close();
35729
+ };
35730
+ document.addEventListener("mousedown", handleClickOutside);
35731
+ return () => document.removeEventListener("mousedown", handleClickOutside);
35732
+ }, [close, expanded]);
35733
+ React10__namespace.useEffect(() => {
35734
+ if (!expanded) return;
35735
+ requestAnimationFrame(() => {
35736
+ (selectedOptionRef.current ?? firstEnabledOptionRef.current)?.focus({
35737
+ preventScroll: true
35738
+ });
35739
+ });
35740
+ }, [expanded, value]);
35741
+ chunkFHY3K6PL_cjs.useEscapeKey(() => close(true), expanded);
35742
+ function handleSelect(option) {
35743
+ if (disabled || option.disabled) return;
35744
+ if (controlledValue === void 0) setInternalValue(option.value);
35745
+ onValueChange?.(option.value);
35746
+ close(true);
35747
+ }
35748
+ const hasOptions = options.length > 0;
35749
+ const valuePart = selectedOption?.label ?? value;
35750
+ const collapsedLabel = label && valuePart ? `${label}: ${valuePart}` : label || valuePart || "No options";
35751
+ let firstEnabledOptionRefAssigned = false;
35752
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkS5RVSXDV_cjs.cn("inline-flex", className), children: [
35753
+ /* @__PURE__ */ jsxRuntime.jsx(
35754
+ "button",
35755
+ {
35756
+ ref: triggerRef,
35757
+ type: "button",
35758
+ disabled: disabled || !hasOptions,
35759
+ onClick: () => setExpanded((open) => !open),
35760
+ "aria-haspopup": "listbox",
35761
+ "aria-expanded": expanded,
35762
+ "aria-controls": expanded ? listboxId : void 0,
35763
+ className: chunkS5RVSXDV_cjs.cn(
35764
+ "border-border bg-muted text-foreground inline-flex items-center rounded-full border px-3 py-0.5 text-sm transition-colors",
35765
+ "hover:bg-muted/80 focus-visible:ring-ring focus:outline-none focus-visible:ring-2",
35766
+ (disabled || !hasOptions) && "cursor-not-allowed opacity-50"
35767
+ ),
35768
+ children: collapsedLabel
35769
+ }
35770
+ ),
35771
+ expanded && ReactDOM.createPortal(
35772
+ /* @__PURE__ */ jsxRuntime.jsx(
35773
+ "div",
35774
+ {
35775
+ ref: menuRef,
35776
+ id: listboxId,
35777
+ role: "listbox",
35778
+ "aria-label": label ? `${label} options` : "Options",
35779
+ style: menuStyle,
35780
+ className: "border-border bg-card animate-in fade-in zoom-in-95 flex flex-col rounded-lg border p-1 shadow-lg duration-100",
35781
+ children: options.map((option) => {
35782
+ const selected = option.value === value;
35783
+ const optionDisabled = disabled || option.disabled;
35784
+ const isFirstEnabled = !optionDisabled && !firstEnabledOptionRefAssigned;
35785
+ if (isFirstEnabled) firstEnabledOptionRefAssigned = true;
35786
+ return /* @__PURE__ */ jsxRuntime.jsx(
35787
+ "button",
35788
+ {
35789
+ ref: selected && !optionDisabled ? selectedOptionRef : isFirstEnabled ? firstEnabledOptionRef : void 0,
35790
+ type: "button",
35791
+ role: "option",
35792
+ disabled: optionDisabled,
35793
+ onClick: () => handleSelect(option),
35794
+ "aria-selected": selected,
35795
+ className: chunkS5RVSXDV_cjs.cn(
35796
+ "focus-visible:ring-ring flex w-full items-center rounded-md px-3 py-1.5 text-start text-sm transition-colors focus:outline-none focus-visible:ring-2",
35797
+ selected ? "bg-muted text-foreground font-semibold" : "text-muted-foreground hover:bg-muted hover:text-foreground font-normal",
35798
+ optionDisabled && "cursor-not-allowed opacity-40"
35799
+ ),
35800
+ children: option.label
35801
+ },
35802
+ option.value
35803
+ );
35804
+ })
35805
+ }
35806
+ ),
35807
+ document.body
35808
+ )
35809
+ ] });
35810
+ }
35661
35811
  var accordionVariants = classVarianceAuthority.cva(
35662
35812
  "service-accordion divide-y divide-neutral-200 dark:divide-neutral-700",
35663
35813
  {
@@ -42850,63 +43000,67 @@ Object.defineProperty(exports, "spinnerVariants", {
42850
43000
  });
42851
43001
  Object.defineProperty(exports, "AILogoIcon", {
42852
43002
  enumerable: true,
42853
- get: function () { return chunkHEV52I7A_cjs.AILogoIcon; }
43003
+ get: function () { return chunkV3S7QNFF_cjs.AILogoIcon; }
42854
43004
  });
42855
43005
  Object.defineProperty(exports, "AIMessageDisplay", {
42856
43006
  enumerable: true,
42857
- get: function () { return chunkHEV52I7A_cjs.AIMessageDisplay; }
43007
+ get: function () { return chunkV3S7QNFF_cjs.AIMessageDisplay; }
42858
43008
  });
42859
43009
  Object.defineProperty(exports, "AITypingIndicator", {
42860
43010
  enumerable: true,
42861
- get: function () { return chunkHEV52I7A_cjs.AITypingIndicator; }
43011
+ get: function () { return chunkV3S7QNFF_cjs.AITypingIndicator; }
42862
43012
  });
42863
43013
  Object.defineProperty(exports, "ChatBubble", {
42864
43014
  enumerable: true,
42865
- get: function () { return chunkHEV52I7A_cjs.ChatBubble; }
43015
+ get: function () { return chunkV3S7QNFF_cjs.ChatBubble; }
42866
43016
  });
42867
43017
  Object.defineProperty(exports, "ChevronIcon", {
42868
43018
  enumerable: true,
42869
- get: function () { return chunkHEV52I7A_cjs.ChevronIcon; }
43019
+ get: function () { return chunkV3S7QNFF_cjs.ChevronIcon; }
42870
43020
  });
42871
43021
  Object.defineProperty(exports, "CloseIcon", {
42872
43022
  enumerable: true,
42873
- get: function () { return chunkHEV52I7A_cjs.CloseIcon; }
43023
+ get: function () { return chunkV3S7QNFF_cjs.CloseIcon; }
43024
+ });
43025
+ Object.defineProperty(exports, "CollapsiblePill", {
43026
+ enumerable: true,
43027
+ get: function () { return chunkV3S7QNFF_cjs.CollapsiblePill; }
42874
43028
  });
42875
43029
  Object.defineProperty(exports, "MCPToolCallDisplay", {
42876
43030
  enumerable: true,
42877
- get: function () { return chunkHEV52I7A_cjs.MCPToolCallDisplay; }
43031
+ get: function () { return chunkV3S7QNFF_cjs.MCPToolCallDisplay; }
42878
43032
  });
42879
43033
  Object.defineProperty(exports, "MessageAvatar", {
42880
43034
  enumerable: true,
42881
- get: function () { return chunkHEV52I7A_cjs.MessageAvatar; }
43035
+ get: function () { return chunkV3S7QNFF_cjs.MessageAvatar; }
42882
43036
  });
42883
43037
  Object.defineProperty(exports, "RefreshIcon", {
42884
43038
  enumerable: true,
42885
- get: function () { return chunkHEV52I7A_cjs.RefreshIcon; }
43039
+ get: function () { return chunkV3S7QNFF_cjs.RefreshIcon; }
42886
43040
  });
42887
43041
  Object.defineProperty(exports, "ResourceLink", {
42888
43042
  enumerable: true,
42889
- get: function () { return chunkHEV52I7A_cjs.ResourceLink; }
43043
+ get: function () { return chunkV3S7QNFF_cjs.ResourceLink; }
42890
43044
  });
42891
43045
  Object.defineProperty(exports, "SendIcon", {
42892
43046
  enumerable: true,
42893
- get: function () { return chunkHEV52I7A_cjs.SendIcon; }
43047
+ get: function () { return chunkV3S7QNFF_cjs.SendIcon; }
42894
43048
  });
42895
43049
  Object.defineProperty(exports, "SparklesIcon", {
42896
43050
  enumerable: true,
42897
- get: function () { return chunkHEV52I7A_cjs.SparklesIcon; }
43051
+ get: function () { return chunkV3S7QNFF_cjs.SparklesIcon; }
42898
43052
  });
42899
43053
  Object.defineProperty(exports, "SpinnerIcon", {
42900
43054
  enumerable: true,
42901
- get: function () { return chunkHEV52I7A_cjs.SpinnerIcon; }
43055
+ get: function () { return chunkV3S7QNFF_cjs.SpinnerIcon; }
42902
43056
  });
42903
43057
  Object.defineProperty(exports, "ToolStatusIcon", {
42904
43058
  enumerable: true,
42905
- get: function () { return chunkHEV52I7A_cjs.ToolStatusIcon; }
43059
+ get: function () { return chunkV3S7QNFF_cjs.ToolStatusIcon; }
42906
43060
  });
42907
43061
  Object.defineProperty(exports, "getToolIcon", {
42908
43062
  enumerable: true,
42909
- get: function () { return chunkHEV52I7A_cjs.getToolIcon; }
43063
+ get: function () { return chunkV3S7QNFF_cjs.getToolIcon; }
42910
43064
  });
42911
43065
  Object.defineProperty(exports, "AttachmentPreview", {
42912
43066
  enumerable: true,
@@ -43910,11 +44064,11 @@ Object.defineProperty(exports, "isStorybookDocsMode", {
43910
44064
  });
43911
44065
  Object.defineProperty(exports, "miewebUIPreset", {
43912
44066
  enumerable: true,
43913
- get: function () { return chunkJSSBZOE7_cjs.miewebUIPreset; }
44067
+ get: function () { return chunk6ED4RUGM_cjs.miewebUIPreset; }
43914
44068
  });
43915
44069
  Object.defineProperty(exports, "miewebUISafelist", {
43916
44070
  enumerable: true,
43917
- get: function () { return chunkJSSBZOE7_cjs.miewebUISafelist; }
44071
+ get: function () { return chunk6ED4RUGM_cjs.miewebUISafelist; }
43918
44072
  });
43919
44073
  exports.AIChat = AIChat;
43920
44074
  exports.AIChatModal = AIChatModal;
@@ -44069,6 +44223,7 @@ exports.PaymentMethodCard = PaymentMethodCard;
44069
44223
  exports.PaymentMethodList = PaymentMethodList;
44070
44224
  exports.PendingClaimsTable = PendingClaimsTable;
44071
44225
  exports.PermissionsEditor = PermissionsEditor;
44226
+ exports.PillSelect = PillSelect;
44072
44227
  exports.PresentingProblems = PresentingProblems;
44073
44228
  exports.ProblemList = ProblemList;
44074
44229
  exports.ProcedureOrderEditor = ProcedureOrderEditor;