@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.mjs CHANGED
@@ -7,10 +7,10 @@ import { Slot } from '@radix-ui/react-slot';
7
7
  import * as SwitchPrimitive from '@radix-ui/react-switch';
8
8
  import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
9
9
  import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
10
+ import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
10
11
  import { Virtuoso, VirtuosoGrid } from 'react-virtuoso';
11
12
  import * as SliderPrimitive from '@radix-ui/react-slider';
12
13
  import * as DialogPrimitive from '@radix-ui/react-dialog';
13
- import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
14
14
  import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
15
15
  import '@radix-ui/react-toggle';
16
16
  import * as TooltipPrimitive from '@radix-ui/react-tooltip';
@@ -21694,6 +21694,59 @@ var checkboxModule = {
21694
21694
  tags: ["checkbox", "group", "boolean", "tri-state"]
21695
21695
  }
21696
21696
  };
21697
+ function ScrollArea({
21698
+ className,
21699
+ children,
21700
+ ...props
21701
+ }) {
21702
+ return /* @__PURE__ */ jsxs(
21703
+ ScrollAreaPrimitive.Root,
21704
+ {
21705
+ "data-slot": "scroll-area",
21706
+ className: cn("relative", className),
21707
+ ...props,
21708
+ children: [
21709
+ /* @__PURE__ */ jsx(
21710
+ ScrollAreaPrimitive.Viewport,
21711
+ {
21712
+ "data-slot": "scroll-area-viewport",
21713
+ className: "focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",
21714
+ children
21715
+ }
21716
+ ),
21717
+ /* @__PURE__ */ jsx(ScrollBar, {}),
21718
+ /* @__PURE__ */ jsx(ScrollAreaPrimitive.Corner, {})
21719
+ ]
21720
+ }
21721
+ );
21722
+ }
21723
+ function ScrollBar({
21724
+ className,
21725
+ orientation = "vertical",
21726
+ ...props
21727
+ }) {
21728
+ return /* @__PURE__ */ jsx(
21729
+ ScrollAreaPrimitive.ScrollAreaScrollbar,
21730
+ {
21731
+ "data-slot": "scroll-area-scrollbar",
21732
+ orientation,
21733
+ className: cn(
21734
+ "flex touch-none p-px transition-colors select-none",
21735
+ orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent",
21736
+ orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent",
21737
+ className
21738
+ ),
21739
+ ...props,
21740
+ children: /* @__PURE__ */ jsx(
21741
+ ScrollAreaPrimitive.ScrollAreaThumb,
21742
+ {
21743
+ "data-slot": "scroll-area-thumb",
21744
+ className: "bg-border relative flex-1 rounded-full"
21745
+ }
21746
+ )
21747
+ }
21748
+ );
21749
+ }
21697
21750
  function normalizeOptions(opts, config) {
21698
21751
  return globalNormalizeOptions(opts, config);
21699
21752
  }
@@ -22107,7 +22160,7 @@ var ShadcnSelectVariant = React66.forwardRef(function ShadcnSelectVariant2(props
22107
22160
  }
22108
22161
  }
22109
22162
  )
22110
- ) : /* @__PURE__ */ jsx("div", { className: "max-h-60 overflow-auto", children: filteredItems.map((item, index) => {
22163
+ ) : /* @__PURE__ */ jsx(ScrollArea, { className: "max-h-60", children: /* @__PURE__ */ jsx("div", { children: filteredItems.map((item, index) => {
22111
22164
  var _a2, _b2;
22112
22165
  const optionNode = /* @__PURE__ */ jsx(
22113
22166
  SelectItem,
@@ -22162,7 +22215,7 @@ var ShadcnSelectVariant = React66.forwardRef(function ShadcnSelectVariant2(props
22162
22215
  setQuery("");
22163
22216
  }
22164
22217
  });
22165
- }) })
22218
+ }) }) })
22166
22219
  )
22167
22220
  ] })
22168
22221
  ]
@@ -24166,7 +24219,7 @@ var ShadcnKeyValueVariant = React66.forwardRef(function ShadcnKeyValueVariant2(p
24166
24219
  }
24167
24220
  )
24168
24221
  ] }),
24169
- items.length === 0 ? /* @__PURE__ */ jsx("div", { className: "rounded-md border border-border/50 px-3 py-6 text-center text-sm text-muted-foreground", children: emptyLabel }) : /* @__PURE__ */ jsx("div", { className: "max-h-64 overflow-auto rounded-md border border-border/50", children: /* @__PURE__ */ jsx("div", { className: "divide-y divide-border/50", children: items.map((pair, index) => /* @__PURE__ */ jsxs(
24222
+ items.length === 0 ? /* @__PURE__ */ jsx("div", { className: "rounded-md border border-border/50 px-3 py-6 text-center text-sm text-muted-foreground", children: emptyLabel }) : /* @__PURE__ */ jsx(ScrollArea, { className: "max-h-64 rounded-md border border-border/50", children: /* @__PURE__ */ jsx("div", { className: "divide-y divide-border/50", children: items.map((pair, index) => /* @__PURE__ */ jsxs(
24170
24223
  "div",
24171
24224
  {
24172
24225
  className: "flex items-center justify-between gap-2 px-2 py-1.5",
@@ -25105,59 +25158,6 @@ var treeselectModule = {
25105
25158
  Variant: treeselect_default
25106
25159
  };
25107
25160
  var treeselect_default2 = treeselectModule;
25108
- function ScrollArea({
25109
- className,
25110
- children,
25111
- ...props
25112
- }) {
25113
- return /* @__PURE__ */ jsxs(
25114
- ScrollAreaPrimitive.Root,
25115
- {
25116
- "data-slot": "scroll-area",
25117
- className: cn("relative", className),
25118
- ...props,
25119
- children: [
25120
- /* @__PURE__ */ jsx(
25121
- ScrollAreaPrimitive.Viewport,
25122
- {
25123
- "data-slot": "scroll-area-viewport",
25124
- className: "focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",
25125
- children
25126
- }
25127
- ),
25128
- /* @__PURE__ */ jsx(ScrollBar, {}),
25129
- /* @__PURE__ */ jsx(ScrollAreaPrimitive.Corner, {})
25130
- ]
25131
- }
25132
- );
25133
- }
25134
- function ScrollBar({
25135
- className,
25136
- orientation = "vertical",
25137
- ...props
25138
- }) {
25139
- return /* @__PURE__ */ jsx(
25140
- ScrollAreaPrimitive.ScrollAreaScrollbar,
25141
- {
25142
- "data-slot": "scroll-area-scrollbar",
25143
- orientation,
25144
- className: cn(
25145
- "flex touch-none p-px transition-colors select-none",
25146
- orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent",
25147
- orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent",
25148
- className
25149
- ),
25150
- ...props,
25151
- children: /* @__PURE__ */ jsx(
25152
- ScrollAreaPrimitive.ScrollAreaThumb,
25153
- {
25154
- "data-slot": "scroll-area-thumb",
25155
- className: "bg-border relative flex-1 rounded-full"
25156
- }
25157
- )
25158
- }
25159
- );
25160
- }
25161
25161
  function fileId() {
25162
25162
  return `file_${Math.random().toString(36).slice(2)}`;
25163
25163
  }
@@ -31232,16 +31232,16 @@ function OptionList(props) {
31232
31232
  [draft, isMulti]
31233
31233
  );
31234
31234
  if (s3 == null ? void 0 : s3.errorCode) {
31235
- return /* @__PURE__ */ jsx("div", { className: cn("h-full min-h-0 overflow-y-auto", className), children: /* @__PURE__ */ jsxs("div", { className: "px-3 py-4 text-sm opacity-70", children: [
31235
+ return /* @__PURE__ */ jsx(ScrollArea, { className: cn("h-full min-h-0", className), children: /* @__PURE__ */ jsxs("div", { className: "px-3 py-4 text-sm opacity-70", children: [
31236
31236
  "Error: ",
31237
31237
  String(s3.errorCode)
31238
31238
  ] }) });
31239
31239
  }
31240
31240
  if ((s3 == null ? void 0 : s3.loading) && !((_b = s3 == null ? void 0 : s3.optionsList) == null ? void 0 : _b.length)) {
31241
- return /* @__PURE__ */ jsx("div", { className: cn("h-full min-h-0 overflow-y-auto", className), children: /* @__PURE__ */ jsx("div", { className: "px-3 py-4 text-sm opacity-70", children: "Loading\u2026" }) });
31241
+ return /* @__PURE__ */ jsx(ScrollArea, { className: cn("h-full min-h-0", className), children: /* @__PURE__ */ jsx("div", { className: "px-3 py-4 text-sm opacity-70", children: "Loading\u2026" }) });
31242
31242
  }
31243
31243
  if (!options.length) {
31244
- return /* @__PURE__ */ jsx("div", { className: cn("h-full min-h-0 overflow-y-auto", className), children: /* @__PURE__ */ jsx("div", { className: "px-3 py-4 text-sm opacity-70", children: "No results" }) });
31244
+ return /* @__PURE__ */ jsx(ScrollArea, { className: cn("h-full min-h-0", className), children: /* @__PURE__ */ jsx("div", { className: "px-3 py-4 text-sm opacity-70", children: "No results" }) });
31245
31245
  }
31246
31246
  return /* @__PURE__ */ jsx("div", { className: cn("h-full min-h-0 overflow-hidden", className), children: /* @__PURE__ */ jsx("div", { className: "h-full min-h-0 p-1", children: /* @__PURE__ */ jsx(
31247
31247
  Virtuoso,