@algorithm-shift/design-system 1.2.75 → 1.2.76

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.d.mts CHANGED
@@ -305,6 +305,8 @@ interface MultiSelectProps {
305
305
  searchable?: boolean;
306
306
  className?: string;
307
307
  errorMessage?: string;
308
+ dataKey?: string;
309
+ dataLabel?: string;
308
310
  }
309
311
  declare const MultiSelect: React$1.FC<MultiSelectProps>;
310
312
 
package/dist/index.d.ts CHANGED
@@ -305,6 +305,8 @@ interface MultiSelectProps {
305
305
  searchable?: boolean;
306
306
  className?: string;
307
307
  errorMessage?: string;
308
+ dataKey?: string;
309
+ dataLabel?: string;
308
310
  }
309
311
  declare const MultiSelect: React$1.FC<MultiSelectProps>;
310
312
 
package/dist/index.js CHANGED
@@ -28599,6 +28599,8 @@ var MultiSelect = ({
28599
28599
  disabled,
28600
28600
  searchable = true,
28601
28601
  className = "",
28602
+ dataKey = "value",
28603
+ dataLabel = "label",
28602
28604
  ...props
28603
28605
  }) => {
28604
28606
  const [open, setOpen] = React7.useState(false);
@@ -28616,6 +28618,10 @@ var MultiSelect = ({
28616
28618
  () => data.filter((opt) => value.includes(opt.value)).map((opt) => opt.label),
28617
28619
  [data, value]
28618
28620
  );
28621
+ const options = data.map((item) => ({
28622
+ value: item[dataKey],
28623
+ label: item[dataLabel]
28624
+ }));
28619
28625
  return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Popover, { open, onOpenChange: setOpen, children: [
28620
28626
  /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
28621
28627
  Button,
@@ -28644,7 +28650,7 @@ var MultiSelect = ({
28644
28650
  searchable && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(CommandInput, { placeholder: "Search..." }),
28645
28651
  /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(CommandList, { children: [
28646
28652
  /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(CommandEmpty, { children: "No options found." }),
28647
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(CommandGroup, { children: data.map((opt) => {
28653
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(CommandGroup, { children: options.map((opt) => {
28648
28654
  const isSelected = value.includes(opt.value);
28649
28655
  return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
28650
28656
  "div",