@process.co/ui 0.0.6 → 0.0.8

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
@@ -23,6 +23,20 @@ function _define_property(obj, key, value) {
23
23
  }
24
24
  return obj;
25
25
  }
26
+ function _extends() {
27
+ _extends = Object.assign || function(target) {
28
+ for(var i = 1; i < arguments.length; i++){
29
+ var source = arguments[i];
30
+ for(var key in source){
31
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
32
+ target[key] = source[key];
33
+ }
34
+ }
35
+ }
36
+ return target;
37
+ };
38
+ return _extends.apply(this, arguments);
39
+ }
26
40
  function _iterable_to_array(iter) {
27
41
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
28
42
  }
@@ -56,6 +70,10 @@ function _non_iterable_rest() {
56
70
  function _non_iterable_spread() {
57
71
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
58
72
  }
73
+ function _object_destructuring_empty(o) {
74
+ if (o === null || o === void 0) throw new TypeError("Cannot destructure " + o);
75
+ return o;
76
+ }
59
77
  function _object_spread(target) {
60
78
  for(var i = 1; i < arguments.length; i++){
61
79
  var source = arguments[i] != null ? arguments[i] : {};
@@ -71,6 +89,30 @@ function _object_spread(target) {
71
89
  }
72
90
  return target;
73
91
  }
92
+ function ownKeys(object, enumerableOnly) {
93
+ var keys = Object.keys(object);
94
+ if (Object.getOwnPropertySymbols) {
95
+ var symbols = Object.getOwnPropertySymbols(object);
96
+ if (enumerableOnly) {
97
+ symbols = symbols.filter(function(sym) {
98
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
99
+ });
100
+ }
101
+ keys.push.apply(keys, symbols);
102
+ }
103
+ return keys;
104
+ }
105
+ function _object_spread_props(target, source) {
106
+ source = source != null ? source : {};
107
+ if (Object.getOwnPropertyDescriptors) {
108
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
109
+ } else {
110
+ ownKeys(Object(source)).forEach(function(key) {
111
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
112
+ });
113
+ }
114
+ return target;
115
+ }
74
116
  function _object_without_properties(source, excluded) {
75
117
  if (source == null) return {};
76
118
  var target = _object_without_properties_loose(source, excluded);
@@ -116,8 +158,10 @@ function _unsupported_iterable_to_array(o, minLen) {
116
158
  if (n === "Map" || n === "Set") return Array.from(n);
117
159
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
118
160
  }
119
- var React4 = require('react');
161
+ var React3 = require('react');
120
162
  var reactSlot = require('@radix-ui/react-slot');
163
+ var DropdownMenuPrimitive = require('@radix-ui/react-dropdown-menu');
164
+ var lucideReact = require('lucide-react');
121
165
  function _interopNamespace(e) {
122
166
  if (e && e.__esModule) return e;
123
167
  var n = Object.create(null);
@@ -137,7 +181,8 @@ function _interopNamespace(e) {
137
181
  n.default = e;
138
182
  return Object.freeze(n);
139
183
  }
140
- var React4__namespace = /*#__PURE__*/ _interopNamespace(React4);
184
+ var React3__namespace = /*#__PURE__*/ _interopNamespace(React3);
185
+ var DropdownMenuPrimitive__namespace = /*#__PURE__*/ _interopNamespace(DropdownMenuPrimitive);
141
186
  var __defProp = Object.defineProperty;
142
187
  var __export = function(target, all) {
143
188
  for(var name in all)__defProp(target, name, {
@@ -4863,7 +4908,7 @@ function Button(_param) {
4863
4908
  "asChild"
4864
4909
  ]);
4865
4910
  var Comp = asChild ? reactSlot.Slot : "button";
4866
- return /* @__PURE__ */ React4__namespace.createElement(Comp, _object_spread({
4911
+ return /* @__PURE__ */ React3__namespace.createElement(Comp, _object_spread({
4867
4912
  "data-slot": "button",
4868
4913
  className: cn(buttonVariants({
4869
4914
  variant: variant,
@@ -4872,24 +4917,223 @@ function Button(_param) {
4872
4917
  }))
4873
4918
  }, props));
4874
4919
  }
4920
+ function DropdownMenu(_param) {
4921
+ var props = _extends({}, _object_destructuring_empty(_param));
4922
+ return /* @__PURE__ */ React3__namespace.createElement(DropdownMenuPrimitive__namespace.Root, _object_spread({
4923
+ "data-slot": "dropdown-menu"
4924
+ }, props));
4925
+ }
4926
+ function DropdownMenuPortal(_param) {
4927
+ var props = _extends({}, _object_destructuring_empty(_param));
4928
+ return /* @__PURE__ */ React3__namespace.createElement(DropdownMenuPrimitive__namespace.Portal, _object_spread({
4929
+ "data-slot": "dropdown-menu-portal"
4930
+ }, props));
4931
+ }
4932
+ function DropdownMenuTrigger(_param) {
4933
+ var props = _extends({}, _object_destructuring_empty(_param));
4934
+ return /* @__PURE__ */ React3__namespace.createElement(DropdownMenuPrimitive__namespace.Trigger, _object_spread({
4935
+ "data-slot": "dropdown-menu-trigger"
4936
+ }, props));
4937
+ }
4938
+ function DropdownMenuContent(_param) {
4939
+ var className = _param.className, _param_sideOffset = _param.sideOffset, sideOffset = _param_sideOffset === void 0 ? 4 : _param_sideOffset, props = _object_without_properties(_param, [
4940
+ "className",
4941
+ "sideOffset"
4942
+ ]);
4943
+ return /* @__PURE__ */ React3__namespace.createElement(DropdownMenuPrimitive__namespace.Portal, null, /* @__PURE__ */ React3__namespace.createElement(DropdownMenuPrimitive__namespace.Content, _object_spread({
4944
+ "data-slot": "dropdown-menu-content",
4945
+ sideOffset: sideOffset,
4946
+ className: cn("uii:bg-popover uii:text-popover-foreground uii:data-[state=open]:animate-in uii:data-[state=closed]:animate-out uii:data-[state=closed]:fade-out-0 uii:data-[state=open]:fade-in-0 uii:data-[state=closed]:zoom-out-95 uii:data-[state=open]:zoom-in-95 uii:data-[side=bottom]:slide-in-from-top-2 uii:data-[side=left]:slide-in-from-right-2 uii:data-[side=right]:slide-in-from-left-2 uii:data-[side=top]:slide-in-from-bottom-2 uii:z-50 uii:min-w-[8rem] uii:overflow-hidden uii:rounded-md uii:border uii:p-1 uii:shadow-md", className)
4947
+ }, props)));
4948
+ }
4949
+ function DropdownMenuClose(_param) {
4950
+ var className = _param.className, props = _object_without_properties(_param, [
4951
+ "className"
4952
+ ]);
4953
+ return /* @__PURE__ */ React3__namespace.createElement(DropdownMenuPrimitive__namespace.Item, _object_spread({
4954
+ "data-slot": "dropdown-menu-close",
4955
+ className: "hidden"
4956
+ }, props));
4957
+ }
4958
+ function DropdownMenuGroup(_param) {
4959
+ var props = _extends({}, _object_destructuring_empty(_param));
4960
+ return /* @__PURE__ */ React3__namespace.createElement(DropdownMenuPrimitive__namespace.Group, _object_spread({
4961
+ "data-slot": "dropdown-menu-group"
4962
+ }, props));
4963
+ }
4964
+ function ConfirmationDropdownMenuItem(_param) {
4965
+ var props = _extends({}, _object_destructuring_empty(_param));
4966
+ var originalOnClick = props.onClick, rest = _object_without_properties(props, [
4967
+ "onClick"
4968
+ ]);
4969
+ var _React3__namespace_useState = _sliced_to_array(React3__namespace.useState(false), 2), isConfirming = _React3__namespace_useState[0], setIsConfirming = _React3__namespace_useState[1];
4970
+ return !isConfirming ? /* @__PURE__ */ React3__namespace.createElement(DropdownMenuItem, _object_spread_props(_object_spread({}, rest), {
4971
+ onClick: function(e) {
4972
+ setIsConfirming(true);
4973
+ e.preventDefault();
4974
+ e.stopPropagation();
4975
+ }
4976
+ })) : /* @__PURE__ */ React3__namespace.createElement(DropdownMenuItem, _object_spread_props(_object_spread({}, rest), {
4977
+ onClick: function(e) {
4978
+ if (originalOnClick) {
4979
+ setIsConfirming(false);
4980
+ originalOnClick(e);
4981
+ e.preventDefault();
4982
+ e.stopPropagation();
4983
+ }
4984
+ }
4985
+ }), /* @__PURE__ */ React3__namespace.createElement("div", {
4986
+ className: "flex flex-row gap-2 items-center"
4987
+ }, /* @__PURE__ */ React3__namespace.createElement("div", {
4988
+ className: "text-destructive"
4989
+ }, "Are you sure ?")));
4990
+ }
4991
+ function DropdownMenuItem(_param) {
4992
+ var className = _param.className, inset = _param.inset, _param_variant = _param.variant, variant = _param_variant === void 0 ? "default" : _param_variant, props = _object_without_properties(_param, [
4993
+ "className",
4994
+ "inset",
4995
+ "variant"
4996
+ ]);
4997
+ return /* @__PURE__ */ React3__namespace.createElement(DropdownMenuPrimitive__namespace.Item, _object_spread({
4998
+ "data-slot": "dropdown-menu-item",
4999
+ "data-inset": inset,
5000
+ "data-variant": variant,
5001
+ className: cn("uii:cursor-pointer uii:focus:bg-accent uii:focus:text-accent-foreground uii:data-[variant=destructive]:text-destructive-foreground uii:data-[variant=destructive]:focus:bg-destructive/10 uii:dark:data-[variant=destructive]:focus:bg-destructive/40 uii:data-[variant=destructive]:focus:text-destructive-foreground uii:data-[variant=destructive]:*:[svg]:!text-destructive-foreground uii:[&_svg:not([class*=text-])]:text-muted-foreground uii:relative uii:flex uii:cursor-default uii:items-center uii:gap-2 uii:rounded-sm uii:px-2 uii:py-1.5 uii:text-sm uii:outline-hidden uii:select-none uii:data-[disabled]:pointer-events-none uii:data-[disabled]:opacity-50 uii:data-[inset]:pl-8 uii:[&_svg]:pointer-events-none uii:[&_svg]:shrink-0 uii:[&_svg:not([class*=size-])]:size-4", className)
5002
+ }, props));
5003
+ }
5004
+ function DropdownMenuCheckboxItem(_param) {
5005
+ var className = _param.className, children = _param.children, checked = _param.checked, props = _object_without_properties(_param, [
5006
+ "className",
5007
+ "children",
5008
+ "checked"
5009
+ ]);
5010
+ return /* @__PURE__ */ React3__namespace.createElement(DropdownMenuPrimitive__namespace.CheckboxItem, _object_spread({
5011
+ "data-slot": "dropdown-menu-checkbox-item",
5012
+ className: cn("uii:focus:bg-accent uii:focus:text-accent-foreground uii:relative uii:flex uii:cursor-default uii:items-center uii:gap-2 uii:rounded-sm uii:py-1.5 uii:pr-2 uii:pl-8 uii:text-sm uii:outline-hidden uii:select-none uii:data-[disabled]:pointer-events-none uii:data-[disabled]:opacity-50 uii:[&_svg]:pointer-events-none uii:[&_svg]:shrink-0 uii:[&_svg:not([class*=size-])]:size-4", className),
5013
+ checked: checked
5014
+ }, props), /* @__PURE__ */ React3__namespace.createElement("span", {
5015
+ className: "uii:pointer-events-none uii:absolute uii:left-2 uii:flex uii:size-3.5 uii:items-center uii:justify-center"
5016
+ }, /* @__PURE__ */ React3__namespace.createElement(DropdownMenuPrimitive__namespace.ItemIndicator, null, /* @__PURE__ */ React3__namespace.createElement(lucideReact.CheckIcon, {
5017
+ className: "uii:size-4"
5018
+ }))), children);
5019
+ }
5020
+ function DropdownMenuRadioGroup(_param) {
5021
+ var props = _extends({}, _object_destructuring_empty(_param));
5022
+ return /* @__PURE__ */ React3__namespace.createElement(DropdownMenuPrimitive__namespace.RadioGroup, _object_spread({
5023
+ "data-slot": "dropdown-menu-radio-group"
5024
+ }, props));
5025
+ }
5026
+ function DropdownMenuRadioItem(_param) {
5027
+ var className = _param.className, children = _param.children, props = _object_without_properties(_param, [
5028
+ "className",
5029
+ "children"
5030
+ ]);
5031
+ return /* @__PURE__ */ React3__namespace.createElement(DropdownMenuPrimitive__namespace.RadioItem, _object_spread({
5032
+ "data-slot": "dropdown-menu-radio-item",
5033
+ className: cn("uii:focus:bg-accent uii:focus:text-accent-foreground uii:relative uii:flex uii:cursor-default uii:items-center uii:gap-2 uii:rounded-sm uii:py-1.5 uii:pr-2 uii:pl-8 uii:text-sm uii:outline-hidden uii:select-none uii:data-[disabled]:pointer-events-none uii:data-[disabled]:opacity-50 uii:[&_svg]:pointer-events-none uii:[&_svg]:shrink-0 uii:[&_svg:not([class*=size-])]:size-4", className)
5034
+ }, props), /* @__PURE__ */ React3__namespace.createElement("span", {
5035
+ className: "uii:pointer-events-none uii:absolute uii:left-2 uii:flex uii:size-3.5 uii:items-center uii:justify-center"
5036
+ }, /* @__PURE__ */ React3__namespace.createElement(DropdownMenuPrimitive__namespace.ItemIndicator, null, /* @__PURE__ */ React3__namespace.createElement(lucideReact.CircleIcon, {
5037
+ className: "uii:size-2 uii:fill-current"
5038
+ }))), children);
5039
+ }
5040
+ function DropdownMenuLabel(_param) {
5041
+ var className = _param.className, inset = _param.inset, props = _object_without_properties(_param, [
5042
+ "className",
5043
+ "inset"
5044
+ ]);
5045
+ return /* @__PURE__ */ React3__namespace.createElement(DropdownMenuPrimitive__namespace.Label, _object_spread({
5046
+ "data-slot": "dropdown-menu-label",
5047
+ "data-inset": inset,
5048
+ className: cn("uii:px-2 uii:py-1.5 uii:text-sm uii:font-medium uii:data-[inset]:pl-8", className)
5049
+ }, props));
5050
+ }
5051
+ function DropdownMenuSeparator(_param) {
5052
+ var className = _param.className, props = _object_without_properties(_param, [
5053
+ "className"
5054
+ ]);
5055
+ return /* @__PURE__ */ React3__namespace.createElement(DropdownMenuPrimitive__namespace.Separator, _object_spread({
5056
+ "data-slot": "dropdown-menu-separator",
5057
+ className: cn("uii:bg-border uii:-mx-1 uii:my-1 uii:h-px", className)
5058
+ }, props));
5059
+ }
5060
+ function DropdownMenuShortcut(_param) {
5061
+ var className = _param.className, props = _object_without_properties(_param, [
5062
+ "className"
5063
+ ]);
5064
+ return /* @__PURE__ */ React3__namespace.createElement("span", _object_spread({
5065
+ "data-slot": "dropdown-menu-shortcut",
5066
+ className: cn("uii:text-muted-foreground uii:ml-auto uii:text-xs uii:tracking-widest", className)
5067
+ }, props));
5068
+ }
5069
+ function DropdownMenuSub(_param) {
5070
+ var props = _extends({}, _object_destructuring_empty(_param));
5071
+ return /* @__PURE__ */ React3__namespace.createElement(DropdownMenuPrimitive__namespace.Sub, _object_spread({
5072
+ "data-slot": "dropdown-menu-sub"
5073
+ }, props));
5074
+ }
5075
+ function DropdownMenuSubTrigger(_param) {
5076
+ var className = _param.className, inset = _param.inset, children = _param.children, props = _object_without_properties(_param, [
5077
+ "className",
5078
+ "inset",
5079
+ "children"
5080
+ ]);
5081
+ return /* @__PURE__ */ React3__namespace.createElement(DropdownMenuPrimitive__namespace.SubTrigger, _object_spread({
5082
+ "data-slot": "dropdown-menu-sub-trigger",
5083
+ "data-inset": inset,
5084
+ className: cn("uii:focus:bg-accent uii:focus:text-accent-foreground uii:data-[state=open]:bg-accent uii:data-[state=open]:text-accent-foreground uii:flex uii:cursor-default uii:items-center uii:rounded-sm uii:px-2 uii:py-1.5 uii:text-sm uii:outline-hidden uii:select-none uii:data-[inset]:pl-8", className)
5085
+ }, props), children, /* @__PURE__ */ React3__namespace.createElement(lucideReact.ChevronRightIcon, {
5086
+ className: "uii:ml-auto uii:size-4"
5087
+ }));
5088
+ }
5089
+ function DropdownMenuSubContent(_param) {
5090
+ var className = _param.className, props = _object_without_properties(_param, [
5091
+ "className"
5092
+ ]);
5093
+ return /* @__PURE__ */ React3__namespace.createElement(DropdownMenuPrimitive__namespace.SubContent, _object_spread({
5094
+ "data-slot": "dropdown-menu-sub-content",
5095
+ className: cn("uii:bg-popover uii:text-popover-foreground uii:data-[state=open]:animate-in uii:data-[state=closed]:animate-out uii:data-[state=closed]:fade-out-0 uii:data-[state=open]:fade-in-0 uii:data-[state=closed]:zoom-out-95 uii:data-[state=open]:zoom-in-95 uii:data-[side=bottom]:slide-in-from-top-2 uii:data-[side=left]:slide-in-from-right-2 uii:data-[side=right]:slide-in-from-left-2 uii:data-[side=top]:slide-in-from-bottom-2 uii:z-50 uii:min-w-[8rem] uii:overflow-hidden uii:rounded-md uii:border uii:p-1 uii:shadow-lg", className)
5096
+ }, props));
5097
+ }
4875
5098
  // src/components/fields/index.tsx
4876
5099
  var fields_exports = {};
4877
5100
  __export(fields_exports, {
5101
+ InferredTypesContext: function() {
5102
+ return InferredTypesContext;
5103
+ },
5104
+ InferredTypesProvider: function() {
5105
+ return InferredTypesProvider;
5106
+ },
4878
5107
  Input: function() {
4879
5108
  return Input;
4880
5109
  },
4881
5110
  NestedFieldProvider: function() {
4882
5111
  return NestedFieldProvider;
4883
5112
  },
5113
+ OPERATORS_BY_TYPE: function() {
5114
+ return OPERATORS_BY_TYPE;
5115
+ },
4884
5116
  Select: function() {
4885
5117
  return Select;
4886
5118
  },
4887
5119
  TemplateFieldProvider: function() {
4888
5120
  return TemplateFieldProvider;
4889
5121
  },
5122
+ getOperatorsForType: function() {
5123
+ return getOperatorsForType;
5124
+ },
5125
+ intersectTypes: function() {
5126
+ return intersectTypes;
5127
+ },
5128
+ parseInferSyntax: function() {
5129
+ return parseInferSyntax;
5130
+ },
4890
5131
  useFieldPath: function() {
4891
5132
  return useFieldPath;
4892
5133
  },
5134
+ useInferredTypes: function() {
5135
+ return useInferredTypes;
5136
+ },
4893
5137
  useIsInTemplateFieldProvider: function() {
4894
5138
  return useIsInTemplateFieldProvider;
4895
5139
  },
@@ -4899,7 +5143,7 @@ __export(fields_exports, {
4899
5143
  });
4900
5144
  function Input(param) {
4901
5145
  var fieldName = param.fieldName, label = param.label, value = param.value, onChange = param.onChange, _param_disabled = param.disabled, disabled = _param_disabled === void 0 ? false : _param_disabled, placeholder = param.placeholder, _param_expectedType = param.expectedType, expectedType = _param_expectedType === void 0 ? "string" : _param_expectedType, _param_required = param.required, required = _param_required === void 0 ? false : _param_required, _param_hasRequiredError = param.hasRequiredError, hasRequiredError = _param_hasRequiredError === void 0 ? false : _param_hasRequiredError, className = param.className, editorClassName = param.editorClassName;
4902
- var displayValue = React4__namespace.useMemo(function() {
5146
+ var displayValue = React3__namespace.useMemo(function() {
4903
5147
  if (value && (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && "expression" in value) {
4904
5148
  return value.expression || "";
4905
5149
  }
@@ -4907,12 +5151,12 @@ function Input(param) {
4907
5151
  }, [
4908
5152
  value
4909
5153
  ]);
4910
- var isExpression = React4__namespace.useMemo(function() {
5154
+ var isExpression = React3__namespace.useMemo(function() {
4911
5155
  return value && (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && "expression" in value;
4912
5156
  }, [
4913
5157
  value
4914
5158
  ]);
4915
- var handleChange = React4__namespace.useCallback(function(e) {
5159
+ var handleChange = React3__namespace.useCallback(function(e) {
4916
5160
  var newValue = e.target.value;
4917
5161
  if (newValue.includes("{{")) {
4918
5162
  onChange({
@@ -4926,20 +5170,20 @@ function Input(param) {
4926
5170
  onChange
4927
5171
  ]);
4928
5172
  var showError = hasRequiredError || required && !displayValue;
4929
- return /* @__PURE__ */ React4__namespace.createElement("div", {
5173
+ return /* @__PURE__ */ React3__namespace.createElement("div", {
4930
5174
  className: cn("uii:mb-2", className)
4931
- }, /* @__PURE__ */ React4__namespace.createElement("div", {
5175
+ }, /* @__PURE__ */ React3__namespace.createElement("div", {
4932
5176
  className: "uii:flex uii:items-center uii:gap-2 uii:mt-2"
4933
- }, /* @__PURE__ */ React4__namespace.createElement("label", {
5177
+ }, /* @__PURE__ */ React3__namespace.createElement("label", {
4934
5178
  htmlFor: fieldName,
4935
5179
  className: "uii:text-xs uii:font-bold uii:text-muted-foreground"
4936
- }, label, ":"), expectedType !== "$.interface.timer" && /* @__PURE__ */ React4__namespace.createElement("span", {
5180
+ }, label, ":"), expectedType !== "$.interface.timer" && /* @__PURE__ */ React3__namespace.createElement("span", {
4937
5181
  className: "uii:-mt-2 uii:inline-flex uii:px-1 uii:py-0.5 uii:bg-gray-200 uii:rounded-sm uii:text-[10px] uii:font-mono uii:text-muted-foreground uii:font-light"
4938
- }, expectedType), showError && /* @__PURE__ */ React4__namespace.createElement("span", {
5182
+ }, expectedType), showError && /* @__PURE__ */ React3__namespace.createElement("span", {
4939
5183
  className: "uii:-mt-2 uii:inline-flex uii:px-1 uii:py-0.5 uii:bg-red-100 uii:text-red-600 uii:rounded-sm uii:text-[10px] uii:font-medium"
4940
- }, "Required")), /* @__PURE__ */ React4__namespace.createElement("div", {
5184
+ }, "Required")), /* @__PURE__ */ React3__namespace.createElement("div", {
4941
5185
  className: "uii:mt-0.5"
4942
- }, /* @__PURE__ */ React4__namespace.createElement("input", {
5186
+ }, /* @__PURE__ */ React3__namespace.createElement("input", {
4943
5187
  id: fieldName,
4944
5188
  name: fieldName,
4945
5189
  type: "text",
@@ -4952,9 +5196,9 @@ function Input(param) {
4952
5196
  }
4953
5197
  function Select(param) {
4954
5198
  var fieldName = param.fieldName, label = param.label, value = param.value, onChange = param.onChange, rawOptions = param.options, _param_disabled = param.disabled, disabled = _param_disabled === void 0 ? false : _param_disabled, placeholder = param.placeholder, _param_expectedType = param.expectedType, expectedType = _param_expectedType === void 0 ? "string" : _param_expectedType, _param_required = param.required, required = _param_required === void 0 ? false : _param_required, _param_hasRequiredError = param.hasRequiredError, hasRequiredError = _param_hasRequiredError === void 0 ? false : _param_hasRequiredError, className = param.className, children = param.children;
4955
- var _React4__namespace_useState = _sliced_to_array(React4__namespace.useState(false), 2), isExpressionMode = _React4__namespace_useState[0], setIsExpressionMode = _React4__namespace_useState[1];
4956
- var _React4__namespace_useState1 = _sliced_to_array(React4__namespace.useState(""), 2), expressionValue = _React4__namespace_useState1[0], setExpressionValue = _React4__namespace_useState1[1];
4957
- var options = React4__namespace.useMemo(function() {
5199
+ var _React3__namespace_useState = _sliced_to_array(React3__namespace.useState(false), 2), isExpressionMode = _React3__namespace_useState[0], setIsExpressionMode = _React3__namespace_useState[1];
5200
+ var _React3__namespace_useState1 = _sliced_to_array(React3__namespace.useState(""), 2), expressionValue = _React3__namespace_useState1[0], setExpressionValue = _React3__namespace_useState1[1];
5201
+ var options = React3__namespace.useMemo(function() {
4958
5202
  return rawOptions.map(function(opt) {
4959
5203
  return typeof opt === "string" ? {
4960
5204
  value: opt,
@@ -4964,7 +5208,7 @@ function Select(param) {
4964
5208
  }, [
4965
5209
  rawOptions
4966
5210
  ]);
4967
- var displayValue = React4__namespace.useMemo(function() {
5211
+ var displayValue = React3__namespace.useMemo(function() {
4968
5212
  if (value && (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && "expression" in value) {
4969
5213
  return value.expression || "";
4970
5214
  }
@@ -4972,12 +5216,12 @@ function Select(param) {
4972
5216
  }, [
4973
5217
  value
4974
5218
  ]);
4975
- var isExpression = React4__namespace.useMemo(function() {
5219
+ var isExpression = React3__namespace.useMemo(function() {
4976
5220
  return value && (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && "expression" in value;
4977
5221
  }, [
4978
5222
  value
4979
5223
  ]);
4980
- React4__namespace.useEffect(function() {
5224
+ React3__namespace.useEffect(function() {
4981
5225
  if (isExpression) {
4982
5226
  setIsExpressionMode(true);
4983
5227
  setExpressionValue(displayValue);
@@ -4986,7 +5230,7 @@ function Select(param) {
4986
5230
  isExpression,
4987
5231
  displayValue
4988
5232
  ]);
4989
- var handleSelectChange = React4__namespace.useCallback(function(newValue) {
5233
+ var handleSelectChange = React3__namespace.useCallback(function(newValue) {
4990
5234
  if (newValue === "__expression__") {
4991
5235
  setIsExpressionMode(true);
4992
5236
  return;
@@ -4995,7 +5239,7 @@ function Select(param) {
4995
5239
  }, [
4996
5240
  onChange
4997
5241
  ]);
4998
- var handleExpressionChange = React4__namespace.useCallback(function(e) {
5242
+ var handleExpressionChange = React3__namespace.useCallback(function(e) {
4999
5243
  var newValue = e.target.value;
5000
5244
  setExpressionValue(newValue);
5001
5245
  onChange({
@@ -5005,7 +5249,7 @@ function Select(param) {
5005
5249
  }, [
5006
5250
  onChange
5007
5251
  ]);
5008
- var handleSwitchToValue = React4__namespace.useCallback(function() {
5252
+ var handleSwitchToValue = React3__namespace.useCallback(function() {
5009
5253
  setIsExpressionMode(false);
5010
5254
  setExpressionValue("");
5011
5255
  onChange("");
@@ -5040,24 +5284,24 @@ function Select(param) {
5040
5284
  },
5041
5285
  hasError: showError
5042
5286
  };
5043
- return /* @__PURE__ */ React4__namespace.createElement("div", {
5287
+ return /* @__PURE__ */ React3__namespace.createElement("div", {
5044
5288
  className: cn("uii:mb-2", className)
5045
- }, /* @__PURE__ */ React4__namespace.createElement("div", {
5289
+ }, /* @__PURE__ */ React3__namespace.createElement("div", {
5046
5290
  className: "uii:flex uii:items-center uii:gap-2 uii:mt-2"
5047
- }, /* @__PURE__ */ React4__namespace.createElement("label", {
5291
+ }, /* @__PURE__ */ React3__namespace.createElement("label", {
5048
5292
  htmlFor: fieldName,
5049
5293
  className: "uii:text-xs uii:font-bold uii:text-muted-foreground"
5050
- }, label, ":"), expectedType !== "$.interface.timer" && /* @__PURE__ */ React4__namespace.createElement("span", {
5294
+ }, label, ":"), expectedType !== "$.interface.timer" && /* @__PURE__ */ React3__namespace.createElement("span", {
5051
5295
  className: "uii:-mt-2 uii:inline-flex uii:px-1 uii:py-0.5 uii:bg-gray-200 uii:rounded-sm uii:text-[10px] uii:font-mono uii:text-muted-foreground uii:font-light"
5052
- }, expectedType), showError && /* @__PURE__ */ React4__namespace.createElement("span", {
5296
+ }, expectedType), showError && /* @__PURE__ */ React3__namespace.createElement("span", {
5053
5297
  className: "uii:-mt-2 uii:inline-flex uii:px-1 uii:py-0.5 uii:bg-red-100 uii:text-red-600 uii:rounded-sm uii:text-[10px] uii:font-medium"
5054
- }, "Required")), /* @__PURE__ */ React4__namespace.createElement("div", {
5298
+ }, "Required")), /* @__PURE__ */ React3__namespace.createElement("div", {
5055
5299
  className: "uii:mt-0.5"
5056
5300
  }, children ? // Use custom render function
5057
5301
  children(renderProps) : isExpressionMode ? // Expression mode - show input with clear button
5058
- /* @__PURE__ */ React4__namespace.createElement("div", {
5302
+ /* @__PURE__ */ React3__namespace.createElement("div", {
5059
5303
  className: "uii:flex uii:items-center uii:h-9 uii:rounded-sm uii:border uii:border-amber-500/50 uii:bg-amber-500/5"
5060
- }, /* @__PURE__ */ React4__namespace.createElement("input", {
5304
+ }, /* @__PURE__ */ React3__namespace.createElement("input", {
5061
5305
  id: fieldName,
5062
5306
  name: fieldName,
5063
5307
  type: "text",
@@ -5066,13 +5310,13 @@ function Select(param) {
5066
5310
  disabled: disabled,
5067
5311
  placeholder: "Enter expression...",
5068
5312
  className: cn("uii:flex-1 uii:h-full uii:px-3 uii:bg-transparent uii:text-sm uii:font-mono uii:text-amber-600", "uii:outline-none uii:border-none", disabled && "uii:opacity-50 uii:cursor-not-allowed")
5069
- }), /* @__PURE__ */ React4__namespace.createElement("button", {
5313
+ }), /* @__PURE__ */ React3__namespace.createElement("button", {
5070
5314
  type: "button",
5071
5315
  onClick: handleSwitchToValue,
5072
5316
  className: "uii:flex uii:items-center uii:justify-center uii:h-full uii:px-2 uii:text-amber-600 hover:uii:text-red-600 uii:border-l uii:border-amber-500/30",
5073
5317
  title: "Clear and return to value mode"
5074
5318
  }, "\xD7")) : // Value mode - show select
5075
- /* @__PURE__ */ React4__namespace.createElement("select", {
5319
+ /* @__PURE__ */ React3__namespace.createElement("select", {
5076
5320
  id: fieldName,
5077
5321
  name: fieldName,
5078
5322
  value: displayValue,
@@ -5081,15 +5325,15 @@ function Select(param) {
5081
5325
  },
5082
5326
  disabled: disabled,
5083
5327
  className: cn("uii:w-full uii:h-9 uii:px-3 uii:rounded-sm uii:border uii:bg-background uii:text-sm", "uii:outline-none uii:transition-all uii:cursor-pointer", "focus:uii:border-ring focus:uii:ring-ring/50 focus:uii:ring-[3px]", showError ? "uii:border-red-500 hover:uii:border-red-600" : "uii:border-input hover:uii:border-ring/50", disabled && "uii:opacity-50 uii:cursor-not-allowed")
5084
- }, placeholder && /* @__PURE__ */ React4__namespace.createElement("option", {
5328
+ }, placeholder && /* @__PURE__ */ React3__namespace.createElement("option", {
5085
5329
  value: "",
5086
5330
  disabled: true
5087
5331
  }, placeholder), options.map(function(opt) {
5088
- return /* @__PURE__ */ React4__namespace.createElement("option", {
5332
+ return /* @__PURE__ */ React3__namespace.createElement("option", {
5089
5333
  key: opt.value,
5090
5334
  value: opt.value
5091
5335
  }, opt.label);
5092
- }), /* @__PURE__ */ React4__namespace.createElement("option", {
5336
+ }), /* @__PURE__ */ React3__namespace.createElement("option", {
5093
5337
  value: "__expression__"
5094
5338
  }, "\uD83D\uDCDD Custom Expression"))));
5095
5339
  }
@@ -5126,7 +5370,151 @@ function NestedFieldProvider(param) {
5126
5370
  var children = param.children;
5127
5371
  return /* @__PURE__ */ React.createElement(React.Fragment, null, children);
5128
5372
  }
5373
+ var InferredTypesContext = React3.createContext(null);
5374
+ function useInferredTypes() {
5375
+ return React3.useContext(InferredTypesContext);
5376
+ }
5377
+ function InferredTypesProvider(param) {
5378
+ var children = param.children;
5379
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, children);
5380
+ }
5381
+ function intersectTypes(types) {
5382
+ var validTypes = types.filter(function(t) {
5383
+ return !!t && t.length > 0;
5384
+ });
5385
+ if (validTypes.length === 0) return "any";
5386
+ if (validTypes.length === 1) return validTypes[0];
5387
+ return validTypes[0];
5388
+ }
5389
+ function parseInferSyntax(expectedType) {
5390
+ var _match_;
5391
+ if (!expectedType || !expectedType.startsWith("$infer<")) {
5392
+ return {
5393
+ mode: "normal"
5394
+ };
5395
+ }
5396
+ var match = expectedType.match(/^\$infer<(.+)>$/);
5397
+ if (!match) {
5398
+ return {
5399
+ mode: "normal"
5400
+ };
5401
+ }
5402
+ var content = ((_match_ = match[1]) === null || _match_ === void 0 ? void 0 : _match_.trim()) || "";
5403
+ if (!content.includes("|") && /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(content)) {
5404
+ return {
5405
+ mode: "subscribe",
5406
+ subscribeToField: content
5407
+ };
5408
+ }
5409
+ var allowedTypes = content.split("|").map(function(t) {
5410
+ return t.trim();
5411
+ }).filter(Boolean);
5412
+ return {
5413
+ mode: "publish",
5414
+ allowedTypes: allowedTypes
5415
+ };
5416
+ }
5417
+ var OPERATORS_BY_TYPE = {
5418
+ string: [
5419
+ {
5420
+ value: "==",
5421
+ label: "equals (==)"
5422
+ },
5423
+ {
5424
+ value: "!=",
5425
+ label: "not equals (!=)"
5426
+ },
5427
+ {
5428
+ value: "contains",
5429
+ label: "contains"
5430
+ },
5431
+ {
5432
+ value: "startsWith",
5433
+ label: "starts with"
5434
+ },
5435
+ {
5436
+ value: "endsWith",
5437
+ label: "ends with"
5438
+ }
5439
+ ],
5440
+ number: [
5441
+ {
5442
+ value: "==",
5443
+ label: "equals (==)"
5444
+ },
5445
+ {
5446
+ value: "!=",
5447
+ label: "not equals (!=)"
5448
+ },
5449
+ {
5450
+ value: "<",
5451
+ label: "less than (<)"
5452
+ },
5453
+ {
5454
+ value: ">",
5455
+ label: "greater than (>)"
5456
+ },
5457
+ {
5458
+ value: "<=",
5459
+ label: "less than or equal (<=)"
5460
+ },
5461
+ {
5462
+ value: ">=",
5463
+ label: "greater than or equal (>=)"
5464
+ }
5465
+ ],
5466
+ boolean: [
5467
+ {
5468
+ value: "==",
5469
+ label: "equals (==)"
5470
+ },
5471
+ {
5472
+ value: "!=",
5473
+ label: "not equals (!=)"
5474
+ }
5475
+ ],
5476
+ any: [
5477
+ {
5478
+ value: "==",
5479
+ label: "equals (==)"
5480
+ },
5481
+ {
5482
+ value: "!=",
5483
+ label: "not equals (!=)"
5484
+ }
5485
+ ]
5486
+ };
5487
+ function getOperatorsForType(type) {
5488
+ var _OPERATORS_BY_TYPE_type, _ref;
5489
+ return (_ref = (_OPERATORS_BY_TYPE_type = OPERATORS_BY_TYPE[type]) !== null && _OPERATORS_BY_TYPE_type !== void 0 ? _OPERATORS_BY_TYPE_type : OPERATORS_BY_TYPE.any) !== null && _ref !== void 0 ? _ref : [
5490
+ {
5491
+ value: "==",
5492
+ label: "equals (==)"
5493
+ },
5494
+ {
5495
+ value: "!=",
5496
+ label: "not equals (!=)"
5497
+ }
5498
+ ];
5499
+ }
5129
5500
  exports.Button = Button;
5501
+ exports.ConfirmationDropdownMenuItem = ConfirmationDropdownMenuItem;
5502
+ exports.DropdownMenu = DropdownMenu;
5503
+ exports.DropdownMenuCheckboxItem = DropdownMenuCheckboxItem;
5504
+ exports.DropdownMenuClose = DropdownMenuClose;
5505
+ exports.DropdownMenuContent = DropdownMenuContent;
5506
+ exports.DropdownMenuGroup = DropdownMenuGroup;
5507
+ exports.DropdownMenuItem = DropdownMenuItem;
5508
+ exports.DropdownMenuLabel = DropdownMenuLabel;
5509
+ exports.DropdownMenuPortal = DropdownMenuPortal;
5510
+ exports.DropdownMenuRadioGroup = DropdownMenuRadioGroup;
5511
+ exports.DropdownMenuRadioItem = DropdownMenuRadioItem;
5512
+ exports.DropdownMenuSeparator = DropdownMenuSeparator;
5513
+ exports.DropdownMenuShortcut = DropdownMenuShortcut;
5514
+ exports.DropdownMenuSub = DropdownMenuSub;
5515
+ exports.DropdownMenuSubContent = DropdownMenuSubContent;
5516
+ exports.DropdownMenuSubTrigger = DropdownMenuSubTrigger;
5517
+ exports.DropdownMenuTrigger = DropdownMenuTrigger;
5130
5518
  exports.buttonVariants = buttonVariants;
5131
5519
  exports.fields = fields_exports; //# sourceMappingURL=index.cjs.map
5132
5520
  //# sourceMappingURL=index.cjs.map