@sustaina/shared-ui 1.59.2 → 1.61.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.js CHANGED
@@ -19,7 +19,7 @@ var LabelPrimitive = require('@radix-ui/react-label');
19
19
  var dateFns = require('date-fns');
20
20
  var PopoverPrimitive = require('@radix-ui/react-popover');
21
21
  var cmdk = require('cmdk');
22
- var SheetPrimitive = require('@radix-ui/react-dialog');
22
+ var DialogPrimitive2 = require('@radix-ui/react-dialog');
23
23
  var reactVirtual = require('@tanstack/react-virtual');
24
24
  var TooltipPrimitive = require('@radix-ui/react-tooltip');
25
25
  var CheckboxPrimitive = require('@radix-ui/react-checkbox');
@@ -96,7 +96,7 @@ var Autoplay__default = /*#__PURE__*/_interopDefault(Autoplay);
96
96
  var SelectPrimitive__namespace = /*#__PURE__*/_interopNamespace(SelectPrimitive);
97
97
  var LabelPrimitive__namespace = /*#__PURE__*/_interopNamespace(LabelPrimitive);
98
98
  var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespace(PopoverPrimitive);
99
- var SheetPrimitive__namespace = /*#__PURE__*/_interopNamespace(SheetPrimitive);
99
+ var DialogPrimitive2__namespace = /*#__PURE__*/_interopNamespace(DialogPrimitive2);
100
100
  var TooltipPrimitive__namespace = /*#__PURE__*/_interopNamespace(TooltipPrimitive);
101
101
  var CheckboxPrimitive__namespace = /*#__PURE__*/_interopNamespace(CheckboxPrimitive);
102
102
  var CollapsiblePrimitive__namespace = /*#__PURE__*/_interopNamespace(CollapsiblePrimitive);
@@ -4946,7 +4946,7 @@ var ConditionTextInput = ({ row, control, onClear }) => /* @__PURE__ */ jsxRunti
4946
4946
  }
4947
4947
  }
4948
4948
  );
4949
- var ConditionNumberInput = ({ row, control, onClear }) => /* @__PURE__ */ jsxRuntime.jsx(
4949
+ var ConditionNumberInput = ({ row, control, onClear, fieldSchema }) => /* @__PURE__ */ jsxRuntime.jsx(
4950
4950
  FormField,
4951
4951
  {
4952
4952
  control,
@@ -4966,6 +4966,17 @@ var ConditionNumberInput = ({ row, control, onClear }) => /* @__PURE__ */ jsxRun
4966
4966
  value: field.value ?? "",
4967
4967
  autoComplete: "off",
4968
4968
  inputMode: "numeric",
4969
+ min: fieldSchema?.min,
4970
+ max: fieldSchema?.max,
4971
+ onKeyDown: (e) => {
4972
+ const blocked = ["e", "E"];
4973
+ if (fieldSchema?.min !== void 0 && fieldSchema.min >= 0) {
4974
+ blocked.push("-");
4975
+ }
4976
+ if (blocked.includes(e.key)) {
4977
+ e.preventDefault();
4978
+ }
4979
+ },
4969
4980
  className: "w-full h-9 rounded-md bg-white pr-8 text-sm text-gray-700 shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 "
4970
4981
  }
4971
4982
  ) }),
@@ -5515,6 +5526,7 @@ var ConditionDateInput = ({
5515
5526
  onClear,
5516
5527
  shortDateFormat = fallbackShortDateFormat
5517
5528
  }) => {
5529
+ const dateFormat = /D/i.test(shortDateFormat) ? shortDateFormat : fallbackShortDateFormat;
5518
5530
  const isBetween = row.operator === "between";
5519
5531
  const buildAriaLabel = (isEnd) => {
5520
5532
  if (isEnd) return "Select end date";
@@ -5546,11 +5558,11 @@ var ConditionDateInput = ({
5546
5558
  ...field,
5547
5559
  value: field.value || void 0,
5548
5560
  onValueChange: handleValueChange,
5549
- placeholder: shortDateFormat,
5561
+ placeholder: dateFormat,
5550
5562
  ariaLabel: buildAriaLabel(options?.isEnd),
5551
5563
  clearAriaLabel: buildClearLabel(options?.isEnd),
5552
5564
  invalid: Boolean(fieldState.error),
5553
- displayFormatter: (d) => formatISODate(d, shortDateFormat),
5565
+ displayFormatter: (d) => formatISODate(d, dateFormat),
5554
5566
  wrapperClassName: "min-w-0",
5555
5567
  "data-testid": "advsearch-date-value"
5556
5568
  }
@@ -6094,14 +6106,14 @@ var ConditionMonthInput = ({ row, control, onClear }) => {
6094
6106
  return renderPicker(`value_${row.id}`, "value");
6095
6107
  };
6096
6108
  function Dialog({ ...props }) {
6097
- return /* @__PURE__ */ jsxRuntime.jsx(SheetPrimitive__namespace.Root, { "data-slot": "dialog", ...props });
6109
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive2__namespace.Root, { "data-slot": "dialog", ...props });
6098
6110
  }
6099
6111
  function DialogPortal({ ...props }) {
6100
- return /* @__PURE__ */ jsxRuntime.jsx(SheetPrimitive__namespace.Portal, { "data-slot": "dialog-portal", ...props });
6112
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive2__namespace.Portal, { "data-slot": "dialog-portal", ...props });
6101
6113
  }
6102
6114
  function DialogOverlay({ className, ...props }) {
6103
6115
  return /* @__PURE__ */ jsxRuntime.jsx(
6104
- SheetPrimitive__namespace.Overlay,
6116
+ DialogPrimitive2__namespace.Overlay,
6105
6117
  {
6106
6118
  "data-slot": "dialog-overlay",
6107
6119
  className: cn(
@@ -6121,7 +6133,7 @@ function DialogContent({
6121
6133
  return /* @__PURE__ */ jsxRuntime.jsxs(DialogPortal, { "data-slot": "dialog-portal", children: [
6122
6134
  /* @__PURE__ */ jsxRuntime.jsx(DialogOverlay, {}),
6123
6135
  /* @__PURE__ */ jsxRuntime.jsxs(
6124
- SheetPrimitive__namespace.Content,
6136
+ DialogPrimitive2__namespace.Content,
6125
6137
  {
6126
6138
  "data-slot": "dialog-content",
6127
6139
  className: cn(
@@ -6132,7 +6144,7 @@ function DialogContent({
6132
6144
  children: [
6133
6145
  children,
6134
6146
  showCloseButton && /* @__PURE__ */ jsxRuntime.jsxs(
6135
- SheetPrimitive__namespace.Close,
6147
+ DialogPrimitive2__namespace.Close,
6136
6148
  {
6137
6149
  "data-slot": "dialog-close",
6138
6150
  className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
@@ -6159,7 +6171,7 @@ function DialogHeader({ className, ...props }) {
6159
6171
  }
6160
6172
  function DialogTitle({ className, ...props }) {
6161
6173
  return /* @__PURE__ */ jsxRuntime.jsx(
6162
- SheetPrimitive__namespace.Title,
6174
+ DialogPrimitive2__namespace.Title,
6163
6175
  {
6164
6176
  "data-slot": "dialog-title",
6165
6177
  className: cn("text-lg leading-none font-semibold", className),
@@ -6172,7 +6184,7 @@ function DialogDescription({
6172
6184
  ...props
6173
6185
  }) {
6174
6186
  return /* @__PURE__ */ jsxRuntime.jsx(
6175
- SheetPrimitive__namespace.Description,
6187
+ DialogPrimitive2__namespace.Description,
6176
6188
  {
6177
6189
  "data-slot": "dialog-description",
6178
6190
  className: cn("text-muted-foreground text-sm", className),
@@ -7906,7 +7918,15 @@ var ConditionValue = ({
7906
7918
  }
7907
7919
  switch (fieldType) {
7908
7920
  case "number":
7909
- return /* @__PURE__ */ jsxRuntime.jsx(ConditionNumberInput, { row, control, onClear: onClearValue });
7921
+ return /* @__PURE__ */ jsxRuntime.jsx(
7922
+ ConditionNumberInput,
7923
+ {
7924
+ row,
7925
+ control,
7926
+ onClear: onClearValue,
7927
+ fieldSchema
7928
+ }
7929
+ );
7910
7930
  case "date":
7911
7931
  case "datetime":
7912
7932
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -8558,7 +8578,7 @@ var validateByFieldType = (value, fieldType) => {
8558
8578
  return { valid: true };
8559
8579
  }
8560
8580
  if (numericTypes.includes(fieldType)) {
8561
- if (!/^\d+(\.\d+)?$/.test(value)) {
8581
+ if (!/^-?\d+(\.\d+)?$/.test(value)) {
8562
8582
  return { valid: false, message: "Please enter a valid number." };
8563
8583
  }
8564
8584
  }
@@ -9918,17 +9938,17 @@ var DataTable = ({
9918
9938
  };
9919
9939
  var DataTable_default = DataTable;
9920
9940
  function Dialog2(props) {
9921
- return /* @__PURE__ */ jsxRuntime.jsx(SheetPrimitive__namespace.Root, { "data-slot": "dialog", ...props });
9941
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive2__namespace.Root, { "data-slot": "dialog", ...props });
9922
9942
  }
9923
9943
  function DialogTrigger(props) {
9924
- return /* @__PURE__ */ jsxRuntime.jsx(SheetPrimitive__namespace.Trigger, { "data-slot": "dialog-trigger", ...props });
9944
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive2__namespace.Trigger, { "data-slot": "dialog-trigger", ...props });
9925
9945
  }
9926
9946
  function DialogPortal2(props) {
9927
- return /* @__PURE__ */ jsxRuntime.jsx(SheetPrimitive__namespace.Portal, { "data-slot": "dialog-portal", ...props });
9947
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive2__namespace.Portal, { "data-slot": "dialog-portal", ...props });
9928
9948
  }
9929
9949
  function DialogOverlay2({ className, ...props }) {
9930
9950
  return /* @__PURE__ */ jsxRuntime.jsx(
9931
- SheetPrimitive__namespace.Overlay,
9951
+ DialogPrimitive2__namespace.Overlay,
9932
9952
  {
9933
9953
  "data-slot": "dialog-overlay",
9934
9954
  className: cn(
@@ -9939,7 +9959,7 @@ function DialogOverlay2({ className, ...props }) {
9939
9959
  }
9940
9960
  );
9941
9961
  }
9942
- function DialogHeader2({ className, children, ...props }) {
9962
+ function InternalDialogHeader({ className, children, ...props }) {
9943
9963
  return /* @__PURE__ */ jsxRuntime.jsxs(
9944
9964
  "div",
9945
9965
  {
@@ -9952,7 +9972,7 @@ function DialogHeader2({ className, children, ...props }) {
9952
9972
  children: [
9953
9973
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-lg font-semibold", children }),
9954
9974
  /* @__PURE__ */ jsxRuntime.jsxs(
9955
- SheetPrimitive__namespace.Close,
9975
+ DialogPrimitive2__namespace.Close,
9956
9976
  {
9957
9977
  "data-slot": "dialog-close",
9958
9978
  className: "absolute right-4 top-4 rounded-xs opacity-80 hover:opacity-100 transition-opacity focus:outline-hidden",
@@ -9976,7 +9996,7 @@ function DialogContent2({
9976
9996
  return /* @__PURE__ */ jsxRuntime.jsxs(DialogPortal2, { children: [
9977
9997
  showOverlay && /* @__PURE__ */ jsxRuntime.jsx(DialogOverlay2, {}),
9978
9998
  /* @__PURE__ */ jsxRuntime.jsxs(
9979
- SheetPrimitive__namespace.Content,
9999
+ DialogPrimitive2__namespace.Content,
9980
10000
  {
9981
10001
  "data-slot": "dialog-content",
9982
10002
  className: cn(
@@ -9985,7 +10005,7 @@ function DialogContent2({
9985
10005
  ),
9986
10006
  ...props,
9987
10007
  children: [
9988
- header && /* @__PURE__ */ jsxRuntime.jsx(DialogHeader2, { children: header }),
10008
+ header && /* @__PURE__ */ jsxRuntime.jsx(InternalDialogHeader, { children: header }),
9989
10009
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-auto", children })
9990
10010
  ]
9991
10011
  }
@@ -10007,7 +10027,7 @@ function DialogFooter({ className, ...props }) {
10007
10027
  }
10008
10028
  function DialogTitle2({ className, ...props }) {
10009
10029
  return /* @__PURE__ */ jsxRuntime.jsx(
10010
- SheetPrimitive__namespace.Title,
10030
+ DialogPrimitive2__namespace.Title,
10011
10031
  {
10012
10032
  "data-slot": "dialog-title",
10013
10033
  className: cn("text-lg font-semibold leading-none", className),
@@ -10020,7 +10040,7 @@ function DialogDescription2({
10020
10040
  ...props
10021
10041
  }) {
10022
10042
  return /* @__PURE__ */ jsxRuntime.jsx(
10023
- SheetPrimitive__namespace.Description,
10043
+ DialogPrimitive2__namespace.Description,
10024
10044
  {
10025
10045
  "data-slot": "dialog-description",
10026
10046
  className: cn("text-sm text-muted-foreground", className),
@@ -10028,18 +10048,50 @@ function DialogDescription2({
10028
10048
  }
10029
10049
  );
10030
10050
  }
10051
+ function DialogCloseButton(props) {
10052
+ return /* @__PURE__ */ jsxRuntime.jsx(
10053
+ "button",
10054
+ {
10055
+ ...props,
10056
+ type: "button",
10057
+ "aria-label": "Close",
10058
+ className: cn("absolute top-4 right-4", props.className),
10059
+ style: {
10060
+ background: "none",
10061
+ border: "none",
10062
+ padding: 0,
10063
+ cursor: "pointer",
10064
+ ...props?.style
10065
+ },
10066
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-6 h-6 text-white" })
10067
+ }
10068
+ );
10069
+ }
10070
+ function DialogClose({ ...props }) {
10071
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive2__namespace.Close, { "data-slot": "dialog-close", ...props });
10072
+ }
10073
+ function DialogHeader2({ className, ...props }) {
10074
+ return /* @__PURE__ */ jsxRuntime.jsx(
10075
+ "div",
10076
+ {
10077
+ "data-slot": "dialog-header",
10078
+ className: cn("flex flex-col gap-2 text-center sm:text-left", className),
10079
+ ...props
10080
+ }
10081
+ );
10082
+ }
10031
10083
  function cn2(...inputs) {
10032
10084
  return tailwindMerge.twMerge(clsx2.clsx(inputs));
10033
10085
  }
10034
10086
  function Dialog3({ ...props }) {
10035
- return /* @__PURE__ */ jsxRuntime.jsx(SheetPrimitive__namespace.Root, { "data-slot": "dialog", ...props });
10087
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive2__namespace.Root, { "data-slot": "dialog", ...props });
10036
10088
  }
10037
10089
  function DialogPortal3({ ...props }) {
10038
- return /* @__PURE__ */ jsxRuntime.jsx(SheetPrimitive__namespace.Portal, { "data-slot": "dialog-portal", ...props });
10090
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive2__namespace.Portal, { "data-slot": "dialog-portal", ...props });
10039
10091
  }
10040
10092
  function DialogOverlay3({ className, ...props }) {
10041
10093
  return /* @__PURE__ */ jsxRuntime.jsx(
10042
- SheetPrimitive__namespace.Overlay,
10094
+ DialogPrimitive2__namespace.Overlay,
10043
10095
  {
10044
10096
  "data-slot": "dialog-overlay",
10045
10097
  className: cn2(
@@ -10059,7 +10111,7 @@ function DialogContent3({
10059
10111
  return /* @__PURE__ */ jsxRuntime.jsxs(DialogPortal3, { "data-slot": "dialog-portal", children: [
10060
10112
  /* @__PURE__ */ jsxRuntime.jsx(DialogOverlay3, { className: "z-99" }),
10061
10113
  /* @__PURE__ */ jsxRuntime.jsxs(
10062
- SheetPrimitive__namespace.Content,
10114
+ DialogPrimitive2__namespace.Content,
10063
10115
  {
10064
10116
  "data-slot": "dialog-content",
10065
10117
  className: cn2(
@@ -10070,7 +10122,7 @@ function DialogContent3({
10070
10122
  children: [
10071
10123
  children,
10072
10124
  showCloseButton && /* @__PURE__ */ jsxRuntime.jsxs(
10073
- SheetPrimitive__namespace.Close,
10125
+ DialogPrimitive2__namespace.Close,
10074
10126
  {
10075
10127
  "data-slot": "dialog-close",
10076
10128
  className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
@@ -10097,7 +10149,7 @@ function DialogHeader3({ className, ...props }) {
10097
10149
  }
10098
10150
  function DialogTitle3({ className, ...props }) {
10099
10151
  return /* @__PURE__ */ jsxRuntime.jsx(
10100
- SheetPrimitive__namespace.Title,
10152
+ DialogPrimitive2__namespace.Title,
10101
10153
  {
10102
10154
  "data-slot": "dialog-title",
10103
10155
  className: cn2("text-lg leading-none font-semibold", className),
@@ -10110,7 +10162,7 @@ function DialogDescription3({
10110
10162
  ...props
10111
10163
  }) {
10112
10164
  return /* @__PURE__ */ jsxRuntime.jsx(
10113
- SheetPrimitive__namespace.Description,
10165
+ DialogPrimitive2__namespace.Description,
10114
10166
  {
10115
10167
  "data-slot": "dialog-description",
10116
10168
  className: cn2("text-muted-foreground text-sm", className),
@@ -11383,9 +11435,12 @@ __export(ui_exports, {
11383
11435
  CollapsibleTrigger: () => CollapsibleTrigger2,
11384
11436
  DatePicker: () => DatePicker,
11385
11437
  Dialog: () => Dialog2,
11438
+ DialogClose: () => DialogClose,
11439
+ DialogCloseButton: () => DialogCloseButton,
11386
11440
  DialogContent: () => DialogContent2,
11387
11441
  DialogDescription: () => DialogDescription2,
11388
11442
  DialogFooter: () => DialogFooter,
11443
+ DialogHeader: () => DialogHeader2,
11389
11444
  DialogTitle: () => DialogTitle2,
11390
11445
  DialogTrigger: () => DialogTrigger,
11391
11446
  DropdownMenu: () => DropdownMenu,
@@ -11832,20 +11887,20 @@ function Separator3({
11832
11887
  );
11833
11888
  }
11834
11889
  function Sheet({ ...props }) {
11835
- return /* @__PURE__ */ jsxRuntime.jsx(SheetPrimitive__namespace.Root, { "data-slot": "sheet", ...props });
11890
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive2__namespace.Root, { "data-slot": "sheet", ...props });
11836
11891
  }
11837
11892
  function SheetTrigger({ ...props }) {
11838
- return /* @__PURE__ */ jsxRuntime.jsx(SheetPrimitive__namespace.Trigger, { "data-slot": "sheet-trigger", ...props });
11893
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive2__namespace.Trigger, { "data-slot": "sheet-trigger", ...props });
11839
11894
  }
11840
11895
  function SheetClose({ ...props }) {
11841
- return /* @__PURE__ */ jsxRuntime.jsx(SheetPrimitive__namespace.Close, { "data-slot": "sheet-close", ...props });
11896
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive2__namespace.Close, { "data-slot": "sheet-close", ...props });
11842
11897
  }
11843
11898
  function SheetPortal({ ...props }) {
11844
- return /* @__PURE__ */ jsxRuntime.jsx(SheetPrimitive__namespace.Portal, { "data-slot": "sheet-portal", ...props });
11899
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive2__namespace.Portal, { "data-slot": "sheet-portal", ...props });
11845
11900
  }
11846
11901
  function SheetOverlay({ className, ...props }) {
11847
11902
  return /* @__PURE__ */ jsxRuntime.jsx(
11848
- SheetPrimitive__namespace.Overlay,
11903
+ DialogPrimitive2__namespace.Overlay,
11849
11904
  {
11850
11905
  "data-slot": "sheet-overlay",
11851
11906
  className: cn(
@@ -11865,7 +11920,7 @@ function SheetContent({
11865
11920
  return /* @__PURE__ */ jsxRuntime.jsxs(SheetPortal, { children: [
11866
11921
  /* @__PURE__ */ jsxRuntime.jsx(SheetOverlay, {}),
11867
11922
  /* @__PURE__ */ jsxRuntime.jsxs(
11868
- SheetPrimitive__namespace.Content,
11923
+ DialogPrimitive2__namespace.Content,
11869
11924
  {
11870
11925
  "data-slot": "sheet-content",
11871
11926
  className: cn(
@@ -11879,7 +11934,7 @@ function SheetContent({
11879
11934
  ...props,
11880
11935
  children: [
11881
11936
  children,
11882
- /* @__PURE__ */ jsxRuntime.jsxs(SheetPrimitive__namespace.Close, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none", children: [
11937
+ /* @__PURE__ */ jsxRuntime.jsxs(DialogPrimitive2__namespace.Close, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none", children: [
11883
11938
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, { className: "size-4" }),
11884
11939
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })
11885
11940
  ] })
@@ -11903,7 +11958,7 @@ function SheetFooter({ className, ...props }) {
11903
11958
  }
11904
11959
  function SheetTitle({ className, ...props }) {
11905
11960
  return /* @__PURE__ */ jsxRuntime.jsx(
11906
- SheetPrimitive__namespace.Title,
11961
+ DialogPrimitive2__namespace.Title,
11907
11962
  {
11908
11963
  "data-slot": "sheet-title",
11909
11964
  className: cn("text-foreground font-semibold", className),
@@ -11916,7 +11971,7 @@ function SheetDescription({
11916
11971
  ...props
11917
11972
  }) {
11918
11973
  return /* @__PURE__ */ jsxRuntime.jsx(
11919
- SheetPrimitive__namespace.Description,
11974
+ DialogPrimitive2__namespace.Description,
11920
11975
  {
11921
11976
  "data-slot": "sheet-description",
11922
11977
  className: cn("text-muted-foreground text-sm", className),
@@ -17570,6 +17625,104 @@ var ActionDropdown = ({
17570
17625
  ] });
17571
17626
  };
17572
17627
  var dropdownMenu_default = ActionDropdown;
17628
+ var sizeMap = {
17629
+ sm: "h-1",
17630
+ md: "h-2",
17631
+ lg: "h-3"
17632
+ };
17633
+ var resolveSize = (size) => typeof size === "number" ? { style: { height: size } } : { className: sizeMap[size] };
17634
+ var linecapMap = {
17635
+ round: "rounded-full",
17636
+ butt: "rounded-none",
17637
+ square: "rounded-none"
17638
+ };
17639
+ var alignClassMap = {
17640
+ start: "justify-start",
17641
+ center: "justify-center",
17642
+ end: "justify-end"
17643
+ };
17644
+ var ProgressBar = ({
17645
+ percent = 0,
17646
+ size = "md",
17647
+ showInfo = true,
17648
+ format: format6,
17649
+ precision = 0,
17650
+ success,
17651
+ strokeLinecap = "round",
17652
+ percentPosition = { align: "end", type: "outer" },
17653
+ barClassName,
17654
+ trailClassName,
17655
+ className
17656
+ }) => {
17657
+ const clamped = React.useMemo(() => Math.min(100, Math.max(0, percent)), [percent]);
17658
+ const displayValue = React.useMemo(() => parseFloat(clamped.toFixed(precision)), [clamped, precision]);
17659
+ const successClamped = React.useMemo(
17660
+ () => success ? Math.min(100, Math.max(0, success.percent)) : 0,
17661
+ [success]
17662
+ );
17663
+ const linecapClass = linecapMap[strokeLinecap];
17664
+ const posType = percentPosition?.type ?? "outer";
17665
+ const posAlign = percentPosition?.align ?? "end";
17666
+ const isInner = posType === "inner";
17667
+ const { className: sizeClass, style: sizeStyle } = resolveSize(size);
17668
+ const info = React.useMemo(() => {
17669
+ if (!showInfo) return null;
17670
+ if (format6) return format6(displayValue);
17671
+ return `${displayValue}%`;
17672
+ }, [showInfo, format6, displayValue]);
17673
+ return /* @__PURE__ */ jsxRuntime.jsxs(
17674
+ "div",
17675
+ {
17676
+ className: cn(
17677
+ "flex w-full items-center gap-2 min-w-0",
17678
+ posAlign === "start" && !isInner && "flex-row-reverse",
17679
+ className
17680
+ ),
17681
+ children: [
17682
+ /* @__PURE__ */ jsxRuntime.jsxs(
17683
+ "div",
17684
+ {
17685
+ className: cn(
17686
+ "relative flex-1 overflow-hidden",
17687
+ trailClassName ?? "bg-muted",
17688
+ linecapClass,
17689
+ isInner ? "min-h-4" : sizeClass
17690
+ ),
17691
+ style: isInner ? void 0 : sizeStyle,
17692
+ children: [
17693
+ success && /* @__PURE__ */ jsxRuntime.jsx(
17694
+ "div",
17695
+ {
17696
+ className: cn(
17697
+ "absolute left-0 top-0 h-full transition-all duration-300",
17698
+ success.className ?? "bg-sus-green-1",
17699
+ linecapClass
17700
+ ),
17701
+ style: { width: `${successClamped}%` }
17702
+ }
17703
+ ),
17704
+ /* @__PURE__ */ jsxRuntime.jsx(
17705
+ "div",
17706
+ {
17707
+ className: cn(
17708
+ "relative transition-all duration-300",
17709
+ barClassName ?? "bg-sus-primary-green-9",
17710
+ linecapClass,
17711
+ isInner ? cn("min-h-4 flex items-center px-1", alignClassMap[posAlign]) : cn("h-full", sizeClass)
17712
+ ),
17713
+ style: { width: `${clamped}%`, ...!isInner ? sizeStyle : void 0 },
17714
+ children: isInner && info && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] leading-none text-primary-foreground whitespace-nowrap tabular-nums", children: info })
17715
+ }
17716
+ )
17717
+ ]
17718
+ }
17719
+ ),
17720
+ !isInner && info && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs shrink-0 tabular-nums", children: info })
17721
+ ]
17722
+ }
17723
+ );
17724
+ };
17725
+ var ProgressBar_default = React.memo(ProgressBar);
17573
17726
  var TruncatedMouseEnterDiv = ({
17574
17727
  value,
17575
17728
  className,
@@ -18505,9 +18658,12 @@ exports.DecreaseIcon = DecreaseIcon;
18505
18658
  exports.Dialog = Dialog2;
18506
18659
  exports.DialogAlert = DialogAlert;
18507
18660
  exports.DialogAlertProvider = DialogAlertProvider;
18661
+ exports.DialogClose = DialogClose;
18662
+ exports.DialogCloseButton = DialogCloseButton;
18508
18663
  exports.DialogContent = DialogContent2;
18509
18664
  exports.DialogDescription = DialogDescription2;
18510
18665
  exports.DialogFooter = DialogFooter;
18666
+ exports.DialogHeader = DialogHeader2;
18511
18667
  exports.DialogTitle = DialogTitle2;
18512
18668
  exports.DialogTrigger = DialogTrigger;
18513
18669
  exports.DropdownMenu = DropdownMenu;
@@ -18583,6 +18739,7 @@ exports.PopoverContent = PopoverContent;
18583
18739
  exports.PopoverTrigger = PopoverTrigger;
18584
18740
  exports.PowerIcon = PowerIcon;
18585
18741
  exports.PreventPageLeave = PreventPageLeave_default;
18742
+ exports.ProgressBar = ProgressBar_default;
18586
18743
  exports.QuestionIcon = QuestionIcon;
18587
18744
  exports.RadioGroupItem = RadioGroupItem;
18588
18745
  exports.RadioGroupRoot = RadioGroupRoot;