@timeax/form-palette 0.2.0 → 0.2.1

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
@@ -8,10 +8,10 @@ var reactSlot = require('@radix-ui/react-slot');
8
8
  var SwitchPrimitive = require('@radix-ui/react-switch');
9
9
  var RadioGroupPrimitive = require('@radix-ui/react-radio-group');
10
10
  var CheckboxPrimitive = require('@radix-ui/react-checkbox');
11
+ var ScrollAreaPrimitive = require('@radix-ui/react-scroll-area');
11
12
  var reactVirtuoso = require('react-virtuoso');
12
13
  var SliderPrimitive = require('@radix-ui/react-slider');
13
14
  var DialogPrimitive = require('@radix-ui/react-dialog');
14
- var ScrollAreaPrimitive = require('@radix-ui/react-scroll-area');
15
15
  var ToggleGroupPrimitive = require('@radix-ui/react-toggle-group');
16
16
  require('@radix-ui/react-toggle');
17
17
  var TooltipPrimitive = require('@radix-ui/react-tooltip');
@@ -50,9 +50,9 @@ var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespace(PopoverPrimitiv
50
50
  var SwitchPrimitive__namespace = /*#__PURE__*/_interopNamespace(SwitchPrimitive);
51
51
  var RadioGroupPrimitive__namespace = /*#__PURE__*/_interopNamespace(RadioGroupPrimitive);
52
52
  var CheckboxPrimitive__namespace = /*#__PURE__*/_interopNamespace(CheckboxPrimitive);
53
+ var ScrollAreaPrimitive__namespace = /*#__PURE__*/_interopNamespace(ScrollAreaPrimitive);
53
54
  var SliderPrimitive__namespace = /*#__PURE__*/_interopNamespace(SliderPrimitive);
54
55
  var DialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(DialogPrimitive);
55
- var ScrollAreaPrimitive__namespace = /*#__PURE__*/_interopNamespace(ScrollAreaPrimitive);
56
56
  var ToggleGroupPrimitive__namespace = /*#__PURE__*/_interopNamespace(ToggleGroupPrimitive);
57
57
  var TooltipPrimitive__namespace = /*#__PURE__*/_interopNamespace(TooltipPrimitive);
58
58
  var Editor__default = /*#__PURE__*/_interopDefault(Editor);
@@ -21732,6 +21732,59 @@ var checkboxModule = {
21732
21732
  tags: ["checkbox", "group", "boolean", "tri-state"]
21733
21733
  }
21734
21734
  };
21735
+ function ScrollArea({
21736
+ className,
21737
+ children,
21738
+ ...props
21739
+ }) {
21740
+ return /* @__PURE__ */ jsxRuntime.jsxs(
21741
+ ScrollAreaPrimitive__namespace.Root,
21742
+ {
21743
+ "data-slot": "scroll-area",
21744
+ className: cn("relative", className),
21745
+ ...props,
21746
+ children: [
21747
+ /* @__PURE__ */ jsxRuntime.jsx(
21748
+ ScrollAreaPrimitive__namespace.Viewport,
21749
+ {
21750
+ "data-slot": "scroll-area-viewport",
21751
+ className: "focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",
21752
+ children
21753
+ }
21754
+ ),
21755
+ /* @__PURE__ */ jsxRuntime.jsx(ScrollBar, {}),
21756
+ /* @__PURE__ */ jsxRuntime.jsx(ScrollAreaPrimitive__namespace.Corner, {})
21757
+ ]
21758
+ }
21759
+ );
21760
+ }
21761
+ function ScrollBar({
21762
+ className,
21763
+ orientation = "vertical",
21764
+ ...props
21765
+ }) {
21766
+ return /* @__PURE__ */ jsxRuntime.jsx(
21767
+ ScrollAreaPrimitive__namespace.ScrollAreaScrollbar,
21768
+ {
21769
+ "data-slot": "scroll-area-scrollbar",
21770
+ orientation,
21771
+ className: cn(
21772
+ "flex touch-none p-px transition-colors select-none",
21773
+ orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent",
21774
+ orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent",
21775
+ className
21776
+ ),
21777
+ ...props,
21778
+ children: /* @__PURE__ */ jsxRuntime.jsx(
21779
+ ScrollAreaPrimitive__namespace.ScrollAreaThumb,
21780
+ {
21781
+ "data-slot": "scroll-area-thumb",
21782
+ className: "bg-border relative flex-1 rounded-full"
21783
+ }
21784
+ )
21785
+ }
21786
+ );
21787
+ }
21735
21788
  function normalizeOptions(opts, config) {
21736
21789
  return globalNormalizeOptions(opts, config);
21737
21790
  }
@@ -22145,7 +22198,7 @@ var ShadcnSelectVariant = React66__namespace.forwardRef(function ShadcnSelectVar
22145
22198
  }
22146
22199
  }
22147
22200
  )
22148
- ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-h-60 overflow-auto", children: filteredItems.map((item, index) => {
22201
+ ) : /* @__PURE__ */ jsxRuntime.jsx(ScrollArea, { className: "max-h-60", children: /* @__PURE__ */ jsxRuntime.jsx("div", { children: filteredItems.map((item, index) => {
22149
22202
  var _a2, _b2;
22150
22203
  const optionNode = /* @__PURE__ */ jsxRuntime.jsx(
22151
22204
  SelectItem,
@@ -22200,7 +22253,7 @@ var ShadcnSelectVariant = React66__namespace.forwardRef(function ShadcnSelectVar
22200
22253
  setQuery("");
22201
22254
  }
22202
22255
  });
22203
- }) })
22256
+ }) }) })
22204
22257
  )
22205
22258
  ] })
22206
22259
  ]
@@ -24204,7 +24257,7 @@ var ShadcnKeyValueVariant = React66__namespace.forwardRef(function ShadcnKeyValu
24204
24257
  }
24205
24258
  )
24206
24259
  ] }),
24207
- items.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-md border border-border/50 px-3 py-6 text-center text-sm text-muted-foreground", children: emptyLabel }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-h-64 overflow-auto rounded-md border border-border/50", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "divide-y divide-border/50", children: items.map((pair, index) => /* @__PURE__ */ jsxRuntime.jsxs(
24260
+ items.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-md border border-border/50 px-3 py-6 text-center text-sm text-muted-foreground", children: emptyLabel }) : /* @__PURE__ */ jsxRuntime.jsx(ScrollArea, { className: "max-h-64 rounded-md border border-border/50", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "divide-y divide-border/50", children: items.map((pair, index) => /* @__PURE__ */ jsxRuntime.jsxs(
24208
24261
  "div",
24209
24262
  {
24210
24263
  className: "flex items-center justify-between gap-2 px-2 py-1.5",
@@ -25143,59 +25196,6 @@ var treeselectModule = {
25143
25196
  Variant: treeselect_default
25144
25197
  };
25145
25198
  var treeselect_default2 = treeselectModule;
25146
- function ScrollArea({
25147
- className,
25148
- children,
25149
- ...props
25150
- }) {
25151
- return /* @__PURE__ */ jsxRuntime.jsxs(
25152
- ScrollAreaPrimitive__namespace.Root,
25153
- {
25154
- "data-slot": "scroll-area",
25155
- className: cn("relative", className),
25156
- ...props,
25157
- children: [
25158
- /* @__PURE__ */ jsxRuntime.jsx(
25159
- ScrollAreaPrimitive__namespace.Viewport,
25160
- {
25161
- "data-slot": "scroll-area-viewport",
25162
- className: "focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",
25163
- children
25164
- }
25165
- ),
25166
- /* @__PURE__ */ jsxRuntime.jsx(ScrollBar, {}),
25167
- /* @__PURE__ */ jsxRuntime.jsx(ScrollAreaPrimitive__namespace.Corner, {})
25168
- ]
25169
- }
25170
- );
25171
- }
25172
- function ScrollBar({
25173
- className,
25174
- orientation = "vertical",
25175
- ...props
25176
- }) {
25177
- return /* @__PURE__ */ jsxRuntime.jsx(
25178
- ScrollAreaPrimitive__namespace.ScrollAreaScrollbar,
25179
- {
25180
- "data-slot": "scroll-area-scrollbar",
25181
- orientation,
25182
- className: cn(
25183
- "flex touch-none p-px transition-colors select-none",
25184
- orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent",
25185
- orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent",
25186
- className
25187
- ),
25188
- ...props,
25189
- children: /* @__PURE__ */ jsxRuntime.jsx(
25190
- ScrollAreaPrimitive__namespace.ScrollAreaThumb,
25191
- {
25192
- "data-slot": "scroll-area-thumb",
25193
- className: "bg-border relative flex-1 rounded-full"
25194
- }
25195
- )
25196
- }
25197
- );
25198
- }
25199
25199
  function fileId() {
25200
25200
  return `file_${Math.random().toString(36).slice(2)}`;
25201
25201
  }
@@ -31270,16 +31270,16 @@ function OptionList(props) {
31270
31270
  [draft, isMulti]
31271
31271
  );
31272
31272
  if (s3 == null ? void 0 : s3.errorCode) {
31273
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("h-full min-h-0 overflow-y-auto", className), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-3 py-4 text-sm opacity-70", children: [
31273
+ return /* @__PURE__ */ jsxRuntime.jsx(ScrollArea, { className: cn("h-full min-h-0", className), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-3 py-4 text-sm opacity-70", children: [
31274
31274
  "Error: ",
31275
31275
  String(s3.errorCode)
31276
31276
  ] }) });
31277
31277
  }
31278
31278
  if ((s3 == null ? void 0 : s3.loading) && !((_b = s3 == null ? void 0 : s3.optionsList) == null ? void 0 : _b.length)) {
31279
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("h-full min-h-0 overflow-y-auto", className), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-4 text-sm opacity-70", children: "Loading\u2026" }) });
31279
+ return /* @__PURE__ */ jsxRuntime.jsx(ScrollArea, { className: cn("h-full min-h-0", className), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-4 text-sm opacity-70", children: "Loading\u2026" }) });
31280
31280
  }
31281
31281
  if (!options.length) {
31282
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("h-full min-h-0 overflow-y-auto", className), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-4 text-sm opacity-70", children: "No results" }) });
31282
+ return /* @__PURE__ */ jsxRuntime.jsx(ScrollArea, { className: cn("h-full min-h-0", className), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-4 text-sm opacity-70", children: "No results" }) });
31283
31283
  }
31284
31284
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("h-full min-h-0 overflow-hidden", className), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-full min-h-0 p-1", children: /* @__PURE__ */ jsxRuntime.jsx(
31285
31285
  reactVirtuoso.Virtuoso,