@codefast/ui 0.0.19 → 0.0.21

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.
Files changed (57) hide show
  1. package/dist/accordion.js +1 -8
  2. package/dist/accordion.js.map +1 -1
  3. package/dist/accordion.mjs +1 -8
  4. package/dist/accordion.mjs.map +1 -1
  5. package/dist/button.d.mts +1 -1
  6. package/dist/button.d.ts +1 -1
  7. package/dist/command.d.mts +15 -15
  8. package/dist/command.d.ts +15 -15
  9. package/dist/command.js +2 -9
  10. package/dist/command.js.map +1 -1
  11. package/dist/command.mjs +2 -9
  12. package/dist/command.mjs.map +1 -1
  13. package/dist/data-table.js +5 -5
  14. package/dist/data-table.js.map +1 -1
  15. package/dist/data-table.mjs +5 -5
  16. package/dist/data-table.mjs.map +1 -1
  17. package/dist/drawer.js +2 -2
  18. package/dist/drawer.js.map +1 -1
  19. package/dist/drawer.mjs +2 -2
  20. package/dist/drawer.mjs.map +1 -1
  21. package/dist/form.js +2 -1
  22. package/dist/form.js.map +1 -1
  23. package/dist/form.mjs +1 -0
  24. package/dist/form.mjs.map +1 -1
  25. package/dist/navigation-menu.js +3 -3
  26. package/dist/navigation-menu.js.map +1 -1
  27. package/dist/navigation-menu.mjs +3 -3
  28. package/dist/navigation-menu.mjs.map +1 -1
  29. package/dist/progress.js +1 -1
  30. package/dist/progress.js.map +1 -1
  31. package/dist/progress.mjs +1 -1
  32. package/dist/progress.mjs.map +1 -1
  33. package/dist/radio-group.js +1 -1
  34. package/dist/radio-group.js.map +1 -1
  35. package/dist/radio-group.mjs +1 -1
  36. package/dist/radio-group.mjs.map +1 -1
  37. package/dist/resizable.js +1 -1
  38. package/dist/resizable.js.map +1 -1
  39. package/dist/resizable.mjs +1 -1
  40. package/dist/resizable.mjs.map +1 -1
  41. package/dist/sheet.js +1 -1
  42. package/dist/sheet.js.map +1 -1
  43. package/dist/sheet.mjs +1 -1
  44. package/dist/sheet.mjs.map +1 -1
  45. package/dist/styles.css +1 -1
  46. package/dist/styles.css.map +1 -1
  47. package/package.json +2 -2
  48. package/src/accordion.tsx +1 -5
  49. package/src/command.tsx +2 -6
  50. package/src/data-table.tsx +5 -5
  51. package/src/drawer.tsx +2 -2
  52. package/src/form.tsx +2 -0
  53. package/src/navigation-menu.tsx +3 -3
  54. package/src/progress.tsx +1 -1
  55. package/src/radio-group.tsx +1 -1
  56. package/src/resizable.tsx +1 -1
  57. package/src/sheet.tsx +1 -1
package/dist/accordion.js CHANGED
@@ -23,14 +23,7 @@ var AccordionTrigger = React.forwardRef(
23
23
  ...props,
24
24
  children: [
25
25
  children,
26
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
27
- _reacticons.ChevronDownIcon,
28
- {
29
- className: _chunkG3NP7M2Njs.cn.call(void 0,
30
- "text-muted-foreground size-4 shrink-0 transition-transform duration-200 group-data-[state=open]:rotate-180"
31
- )
32
- }
33
- )
26
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reacticons.ChevronDownIcon, { className: "text-muted-foreground size-4 shrink-0 transition-transform duration-200 group-data-[state=open]:rotate-180" })
34
27
  ]
35
28
  }
36
29
  ) })
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/accordion.tsx"],"names":[],"mappings":";;;;;;AAEA,YAAY,WAAW;AACvB,YAAY,wBAAwB;AACpC,SAAS,uBAAuB;AAkB9B,cAeI,YAfJ;AAVF,IAAM,YAA+B;AASrC,IAAM,gBAAsB,iBAAqD,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACzG,oBAAoB,yBAAnB,EAAwB,KAAU,WAAW,GAAG,YAAY,SAAS,GAAI,GAAG,OAAO,CACrF;AAED,cAAc,cAAiC,wBAAK;AASpD,IAAM,mBAAyB;AAAA,EAC7B,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,GAAG,QAClC,oBAAoB,2BAAnB,EAA0B,WAAU,QACnC;AAAA,IAAoB;AAAA,IAAnB;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,QACD;AAAA,UAAC;AAAA;AAAA,YACC,WAAW;AAAA,cACT;AAAA,YACF;AAAA;AAAA,QACF;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;AAEA,iBAAiB,cAAiC,2BAAQ;AAS1D,IAAM,mBAAyB;AAAA,EAC7B,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,GAAG,QAClC;AAAA,IAAoB;AAAA,IAAnB;AAAA,MACC;AAAA,MACA,WAAU;AAAA,MACT,GAAG;AAAA,MAEJ,8BAAC,SAAI,WAAW,GAAG,aAAa,SAAS,GAAI,UAAS;AAAA;AAAA,EACxD;AAEJ;AAEA,iBAAiB,cAAiC,2BAAQ","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as AccordionPrimitive from \"@radix-ui/react-accordion\";\nimport { ChevronDownIcon } from \"@radix-ui/react-icons\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: Accordion\n * -------------------------------------------------------------------------- */\n\ntype AccordionProps = React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Root>;\nconst Accordion = AccordionPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: AccordionItem\n * -------------------------------------------------------------------------- */\n\ntype AccordionItemElement = React.ElementRef<typeof AccordionPrimitive.Item>;\ntype AccordionItemProps = React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>;\n\nconst AccordionItem = React.forwardRef<AccordionItemElement, AccordionItemProps>(({ className, ...props }, ref) => (\n <AccordionPrimitive.Item ref={ref} className={cn(\"border-b\", className)} {...props} />\n));\n\nAccordionItem.displayName = AccordionPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: AccordionTrigger\n * -------------------------------------------------------------------------- */\n\ntype AccordionTriggerElement = React.ElementRef<typeof AccordionPrimitive.Trigger>;\ntype AccordionTriggerProps = React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>;\n\nconst AccordionTrigger = React.forwardRef<AccordionTriggerElement, AccordionTriggerProps>(\n ({ className, children, ...props }, ref) => (\n <AccordionPrimitive.Header className=\"flex\">\n <AccordionPrimitive.Trigger\n ref={ref}\n className={cn(\n \"group flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronDownIcon\n className={cn(\n \"text-muted-foreground size-4 shrink-0 transition-transform duration-200 group-data-[state=open]:rotate-180\",\n )}\n />\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n ),\n);\n\nAccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: AccordionContent\n * -------------------------------------------------------------------------- */\n\ntype AccordionContentElement = React.ElementRef<typeof AccordionPrimitive.Content>;\ntype AccordionContentProps = React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>;\n\nconst AccordionContent = React.forwardRef<AccordionContentElement, AccordionContentProps>(\n ({ className, children, ...props }, ref) => (\n <AccordionPrimitive.Content\n ref={ref}\n className=\"data-[state=open]:animate-accordion-down data-[state=closed]:animate-accordion-up overflow-hidden text-sm\"\n {...props}\n >\n <div className={cn(\"pb-4 pt-0\", className)}>{children}</div>\n </AccordionPrimitive.Content>\n ),\n);\n\nAccordionContent.displayName = AccordionPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Accordion,\n AccordionItem,\n AccordionTrigger,\n AccordionContent,\n type AccordionProps,\n type AccordionItemProps,\n type AccordionTriggerProps,\n type AccordionContentProps,\n};\n"]}
1
+ {"version":3,"sources":["../src/accordion.tsx"],"names":[],"mappings":";;;;;;AAEA,YAAY,WAAW;AACvB,YAAY,wBAAwB;AACpC,SAAS,uBAAuB;AAkB9B,cAeI,YAfJ;AAVF,IAAM,YAA+B;AASrC,IAAM,gBAAsB,iBAAqD,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACzG,oBAAoB,yBAAnB,EAAwB,KAAU,WAAW,GAAG,YAAY,SAAS,GAAI,GAAG,OAAO,CACrF;AAED,cAAc,cAAiC,wBAAK;AASpD,IAAM,mBAAyB;AAAA,EAC7B,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,GAAG,QAClC,oBAAoB,2BAAnB,EAA0B,WAAU,QACnC;AAAA,IAAoB;AAAA,IAAnB;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,QACD,oBAAC,mBAAgB,WAAU,8GAA6G;AAAA;AAAA;AAAA,EAC1I,GACF;AAEJ;AAEA,iBAAiB,cAAiC,2BAAQ;AAS1D,IAAM,mBAAyB;AAAA,EAC7B,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,GAAG,QAClC;AAAA,IAAoB;AAAA,IAAnB;AAAA,MACC;AAAA,MACA,WAAU;AAAA,MACT,GAAG;AAAA,MAEJ,8BAAC,SAAI,WAAW,GAAG,aAAa,SAAS,GAAI,UAAS;AAAA;AAAA,EACxD;AAEJ;AAEA,iBAAiB,cAAiC,2BAAQ","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as AccordionPrimitive from \"@radix-ui/react-accordion\";\nimport { ChevronDownIcon } from \"@radix-ui/react-icons\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: Accordion\n * -------------------------------------------------------------------------- */\n\ntype AccordionProps = React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Root>;\nconst Accordion = AccordionPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: AccordionItem\n * -------------------------------------------------------------------------- */\n\ntype AccordionItemElement = React.ElementRef<typeof AccordionPrimitive.Item>;\ntype AccordionItemProps = React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>;\n\nconst AccordionItem = React.forwardRef<AccordionItemElement, AccordionItemProps>(({ className, ...props }, ref) => (\n <AccordionPrimitive.Item ref={ref} className={cn(\"border-b\", className)} {...props} />\n));\n\nAccordionItem.displayName = AccordionPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: AccordionTrigger\n * -------------------------------------------------------------------------- */\n\ntype AccordionTriggerElement = React.ElementRef<typeof AccordionPrimitive.Trigger>;\ntype AccordionTriggerProps = React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>;\n\nconst AccordionTrigger = React.forwardRef<AccordionTriggerElement, AccordionTriggerProps>(\n ({ className, children, ...props }, ref) => (\n <AccordionPrimitive.Header className=\"flex\">\n <AccordionPrimitive.Trigger\n ref={ref}\n className={cn(\n \"group flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronDownIcon className=\"text-muted-foreground size-4 shrink-0 transition-transform duration-200 group-data-[state=open]:rotate-180\" />\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n ),\n);\n\nAccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: AccordionContent\n * -------------------------------------------------------------------------- */\n\ntype AccordionContentElement = React.ElementRef<typeof AccordionPrimitive.Content>;\ntype AccordionContentProps = React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>;\n\nconst AccordionContent = React.forwardRef<AccordionContentElement, AccordionContentProps>(\n ({ className, children, ...props }, ref) => (\n <AccordionPrimitive.Content\n ref={ref}\n className=\"data-[state=open]:animate-accordion-down data-[state=closed]:animate-accordion-up overflow-hidden text-sm\"\n {...props}\n >\n <div className={cn(\"pb-4 pt-0\", className)}>{children}</div>\n </AccordionPrimitive.Content>\n ),\n);\n\nAccordionContent.displayName = AccordionPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Accordion,\n AccordionItem,\n AccordionTrigger,\n AccordionContent,\n type AccordionProps,\n type AccordionItemProps,\n type AccordionTriggerProps,\n type AccordionContentProps,\n};\n"]}
@@ -23,14 +23,7 @@ var AccordionTrigger = React.forwardRef(
23
23
  ...props,
24
24
  children: [
25
25
  children,
26
- /* @__PURE__ */ jsx(
27
- ChevronDownIcon,
28
- {
29
- className: cn(
30
- "text-muted-foreground size-4 shrink-0 transition-transform duration-200 group-data-[state=open]:rotate-180"
31
- )
32
- }
33
- )
26
+ /* @__PURE__ */ jsx(ChevronDownIcon, { className: "text-muted-foreground size-4 shrink-0 transition-transform duration-200 group-data-[state=open]:rotate-180" })
34
27
  ]
35
28
  }
36
29
  ) })
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/accordion.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as AccordionPrimitive from \"@radix-ui/react-accordion\";\nimport { ChevronDownIcon } from \"@radix-ui/react-icons\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: Accordion\n * -------------------------------------------------------------------------- */\n\ntype AccordionProps = React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Root>;\nconst Accordion = AccordionPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: AccordionItem\n * -------------------------------------------------------------------------- */\n\ntype AccordionItemElement = React.ElementRef<typeof AccordionPrimitive.Item>;\ntype AccordionItemProps = React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>;\n\nconst AccordionItem = React.forwardRef<AccordionItemElement, AccordionItemProps>(({ className, ...props }, ref) => (\n <AccordionPrimitive.Item ref={ref} className={cn(\"border-b\", className)} {...props} />\n));\n\nAccordionItem.displayName = AccordionPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: AccordionTrigger\n * -------------------------------------------------------------------------- */\n\ntype AccordionTriggerElement = React.ElementRef<typeof AccordionPrimitive.Trigger>;\ntype AccordionTriggerProps = React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>;\n\nconst AccordionTrigger = React.forwardRef<AccordionTriggerElement, AccordionTriggerProps>(\n ({ className, children, ...props }, ref) => (\n <AccordionPrimitive.Header className=\"flex\">\n <AccordionPrimitive.Trigger\n ref={ref}\n className={cn(\n \"group flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronDownIcon\n className={cn(\n \"text-muted-foreground size-4 shrink-0 transition-transform duration-200 group-data-[state=open]:rotate-180\",\n )}\n />\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n ),\n);\n\nAccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: AccordionContent\n * -------------------------------------------------------------------------- */\n\ntype AccordionContentElement = React.ElementRef<typeof AccordionPrimitive.Content>;\ntype AccordionContentProps = React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>;\n\nconst AccordionContent = React.forwardRef<AccordionContentElement, AccordionContentProps>(\n ({ className, children, ...props }, ref) => (\n <AccordionPrimitive.Content\n ref={ref}\n className=\"data-[state=open]:animate-accordion-down data-[state=closed]:animate-accordion-up overflow-hidden text-sm\"\n {...props}\n >\n <div className={cn(\"pb-4 pt-0\", className)}>{children}</div>\n </AccordionPrimitive.Content>\n ),\n);\n\nAccordionContent.displayName = AccordionPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Accordion,\n AccordionItem,\n AccordionTrigger,\n AccordionContent,\n type AccordionProps,\n type AccordionItemProps,\n type AccordionTriggerProps,\n type AccordionContentProps,\n};\n"],"mappings":";;;;;;AAEA,YAAY,WAAW;AACvB,YAAY,wBAAwB;AACpC,SAAS,uBAAuB;AAkB9B,cAeI,YAfJ;AAVF,IAAM,YAA+B;AASrC,IAAM,gBAAsB,iBAAqD,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACzG,oBAAoB,yBAAnB,EAAwB,KAAU,WAAW,GAAG,YAAY,SAAS,GAAI,GAAG,OAAO,CACrF;AAED,cAAc,cAAiC,wBAAK;AASpD,IAAM,mBAAyB;AAAA,EAC7B,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,GAAG,QAClC,oBAAoB,2BAAnB,EAA0B,WAAU,QACnC;AAAA,IAAoB;AAAA,IAAnB;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,QACD;AAAA,UAAC;AAAA;AAAA,YACC,WAAW;AAAA,cACT;AAAA,YACF;AAAA;AAAA,QACF;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;AAEA,iBAAiB,cAAiC,2BAAQ;AAS1D,IAAM,mBAAyB;AAAA,EAC7B,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,GAAG,QAClC;AAAA,IAAoB;AAAA,IAAnB;AAAA,MACC;AAAA,MACA,WAAU;AAAA,MACT,GAAG;AAAA,MAEJ,8BAAC,SAAI,WAAW,GAAG,aAAa,SAAS,GAAI,UAAS;AAAA;AAAA,EACxD;AAEJ;AAEA,iBAAiB,cAAiC,2BAAQ;","names":[]}
1
+ {"version":3,"sources":["../src/accordion.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as AccordionPrimitive from \"@radix-ui/react-accordion\";\nimport { ChevronDownIcon } from \"@radix-ui/react-icons\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: Accordion\n * -------------------------------------------------------------------------- */\n\ntype AccordionProps = React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Root>;\nconst Accordion = AccordionPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: AccordionItem\n * -------------------------------------------------------------------------- */\n\ntype AccordionItemElement = React.ElementRef<typeof AccordionPrimitive.Item>;\ntype AccordionItemProps = React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>;\n\nconst AccordionItem = React.forwardRef<AccordionItemElement, AccordionItemProps>(({ className, ...props }, ref) => (\n <AccordionPrimitive.Item ref={ref} className={cn(\"border-b\", className)} {...props} />\n));\n\nAccordionItem.displayName = AccordionPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: AccordionTrigger\n * -------------------------------------------------------------------------- */\n\ntype AccordionTriggerElement = React.ElementRef<typeof AccordionPrimitive.Trigger>;\ntype AccordionTriggerProps = React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>;\n\nconst AccordionTrigger = React.forwardRef<AccordionTriggerElement, AccordionTriggerProps>(\n ({ className, children, ...props }, ref) => (\n <AccordionPrimitive.Header className=\"flex\">\n <AccordionPrimitive.Trigger\n ref={ref}\n className={cn(\n \"group flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronDownIcon className=\"text-muted-foreground size-4 shrink-0 transition-transform duration-200 group-data-[state=open]:rotate-180\" />\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n ),\n);\n\nAccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: AccordionContent\n * -------------------------------------------------------------------------- */\n\ntype AccordionContentElement = React.ElementRef<typeof AccordionPrimitive.Content>;\ntype AccordionContentProps = React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>;\n\nconst AccordionContent = React.forwardRef<AccordionContentElement, AccordionContentProps>(\n ({ className, children, ...props }, ref) => (\n <AccordionPrimitive.Content\n ref={ref}\n className=\"data-[state=open]:animate-accordion-down data-[state=closed]:animate-accordion-up overflow-hidden text-sm\"\n {...props}\n >\n <div className={cn(\"pb-4 pt-0\", className)}>{children}</div>\n </AccordionPrimitive.Content>\n ),\n);\n\nAccordionContent.displayName = AccordionPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Accordion,\n AccordionItem,\n AccordionTrigger,\n AccordionContent,\n type AccordionProps,\n type AccordionItemProps,\n type AccordionTriggerProps,\n type AccordionContentProps,\n};\n"],"mappings":";;;;;;AAEA,YAAY,WAAW;AACvB,YAAY,wBAAwB;AACpC,SAAS,uBAAuB;AAkB9B,cAeI,YAfJ;AAVF,IAAM,YAA+B;AASrC,IAAM,gBAAsB,iBAAqD,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACzG,oBAAoB,yBAAnB,EAAwB,KAAU,WAAW,GAAG,YAAY,SAAS,GAAI,GAAG,OAAO,CACrF;AAED,cAAc,cAAiC,wBAAK;AASpD,IAAM,mBAAyB;AAAA,EAC7B,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,GAAG,QAClC,oBAAoB,2BAAnB,EAA0B,WAAU,QACnC;AAAA,IAAoB;AAAA,IAAnB;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,QACD,oBAAC,mBAAgB,WAAU,8GAA6G;AAAA;AAAA;AAAA,EAC1I,GACF;AAEJ;AAEA,iBAAiB,cAAiC,2BAAQ;AAS1D,IAAM,mBAAyB;AAAA,EAC7B,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,GAAG,QAClC;AAAA,IAAoB;AAAA,IAAnB;AAAA,MACC;AAAA,MACA,WAAU;AAAA,MACT,GAAG;AAAA,MAEJ,8BAAC,SAAI,WAAW,GAAG,aAAa,SAAS,GAAI,UAAS;AAAA;AAAA,EACxD;AAEJ;AAEA,iBAAiB,cAAiC,2BAAQ;","names":[]}
package/dist/button.d.mts CHANGED
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { VariantProps } from 'cva';
3
3
 
4
4
  declare const buttonVariants: (props?: ({
5
- variant?: "link" | "default" | "destructive" | "ghost" | "outline" | "secondary" | undefined;
5
+ variant?: "default" | "destructive" | "link" | "ghost" | "outline" | "secondary" | undefined;
6
6
  size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | undefined;
7
7
  loading?: boolean | undefined;
8
8
  } & ({
package/dist/button.d.ts CHANGED
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { VariantProps } from 'cva';
3
3
 
4
4
  declare const buttonVariants: (props?: ({
5
- variant?: "link" | "default" | "destructive" | "ghost" | "outline" | "secondary" | undefined;
5
+ variant?: "default" | "destructive" | "link" | "ghost" | "outline" | "secondary" | undefined;
6
6
  size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | undefined;
7
7
  loading?: boolean | undefined;
8
8
  } & ({
@@ -6,11 +6,11 @@ import '@radix-ui/react-dialog';
6
6
  type CommandProps = React.ComponentPropsWithoutRef<typeof Command$1>;
7
7
  declare const Command: React.ForwardRefExoticComponent<Omit<{
8
8
  children?: React.ReactNode;
9
- } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
9
+ } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement> | "key"> & {
10
10
  ref?: React.Ref<HTMLDivElement> | undefined;
11
11
  } & {
12
12
  asChild?: boolean | undefined;
13
- }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & {
13
+ }, keyof React.HTMLAttributes<HTMLDivElement> | "key" | "asChild"> & {
14
14
  label?: string | undefined;
15
15
  shouldFilter?: boolean | undefined;
16
16
  filter?: ((value: string, search: string, keywords?: string[] | undefined) => number) | undefined;
@@ -28,56 +28,56 @@ declare const CommandInput: React.ForwardRefExoticComponent<Omit<Omit<Pick<Pick<
28
28
  ref?: React.Ref<HTMLInputElement> | undefined;
29
29
  } & {
30
30
  asChild?: boolean | undefined;
31
- }, "key" | "asChild" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "type" | "value" | "onChange"> & {
31
+ }, "key" | "asChild" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "onChange" | "type" | "value"> & {
32
32
  value?: string | undefined;
33
33
  onValueChange?: ((search: string) => void) | undefined;
34
34
  } & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
35
35
  type CommandListProps = React.ComponentPropsWithoutRef<typeof Command$1.List>;
36
36
  declare const CommandList: React.ForwardRefExoticComponent<Omit<{
37
37
  children?: React.ReactNode;
38
- } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
38
+ } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement> | "key"> & {
39
39
  ref?: React.Ref<HTMLDivElement> | undefined;
40
40
  } & {
41
41
  asChild?: boolean | undefined;
42
- }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & {
42
+ }, keyof React.HTMLAttributes<HTMLDivElement> | "key" | "asChild"> & {
43
43
  label?: string | undefined;
44
44
  } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
45
45
  type CommandEmptyProps = React.ComponentPropsWithoutRef<typeof Command$1.Empty>;
46
46
  declare const CommandEmpty: React.ForwardRefExoticComponent<Omit<{
47
47
  children?: React.ReactNode;
48
- } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
48
+ } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement> | "key"> & {
49
49
  ref?: React.Ref<HTMLDivElement> | undefined;
50
50
  } & {
51
51
  asChild?: boolean | undefined;
52
- }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
52
+ }, keyof React.HTMLAttributes<HTMLDivElement> | "key" | "asChild"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
53
53
  type CommandGroupProps = React.ComponentPropsWithoutRef<typeof Command$1.Group>;
54
54
  declare const CommandGroup: React.ForwardRefExoticComponent<Omit<{
55
55
  children?: React.ReactNode;
56
- } & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
56
+ } & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement> | "key"> & {
57
57
  ref?: React.Ref<HTMLDivElement> | undefined;
58
58
  } & {
59
59
  asChild?: boolean | undefined;
60
- }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>>, "value" | "heading"> & {
60
+ }, keyof React.HTMLAttributes<HTMLDivElement> | "key" | "asChild">, "heading" | "value"> & {
61
61
  heading?: React.ReactNode;
62
62
  value?: string | undefined;
63
63
  forceMount?: boolean | undefined;
64
64
  } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
65
65
  type CommandSeparatorProps = React.ComponentPropsWithoutRef<typeof Command$1.Separator>;
66
- declare const CommandSeparator: React.ForwardRefExoticComponent<Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
66
+ declare const CommandSeparator: React.ForwardRefExoticComponent<Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement> | "key"> & {
67
67
  ref?: React.Ref<HTMLDivElement> | undefined;
68
68
  } & {
69
69
  asChild?: boolean | undefined;
70
- }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & {
70
+ }, keyof React.HTMLAttributes<HTMLDivElement> | "key" | "asChild"> & {
71
71
  alwaysRender?: boolean | undefined;
72
72
  } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
73
73
  type CommandItemProps = React.ComponentPropsWithoutRef<typeof Command$1.Item>;
74
74
  declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
75
75
  children?: React.ReactNode;
76
- } & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
76
+ } & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement> | "key"> & {
77
77
  ref?: React.Ref<HTMLDivElement> | undefined;
78
78
  } & {
79
79
  asChild?: boolean | undefined;
80
- }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>>, "disabled" | "value" | "onSelect"> & {
80
+ }, keyof React.HTMLAttributes<HTMLDivElement> | "key" | "asChild">, "onSelect" | "disabled" | "value"> & {
81
81
  disabled?: boolean | undefined;
82
82
  onSelect?: ((value: string) => void) | undefined;
83
83
  value?: string | undefined;
@@ -87,11 +87,11 @@ declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
87
87
  type CommandLoadingProps = React.ComponentPropsWithoutRef<typeof Command$1.Loading>;
88
88
  declare const CommandLoading: React.ForwardRefExoticComponent<Omit<{
89
89
  children?: React.ReactNode;
90
- } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
90
+ } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement> | "key"> & {
91
91
  ref?: React.Ref<HTMLDivElement> | undefined;
92
92
  } & {
93
93
  asChild?: boolean | undefined;
94
- }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & {
94
+ }, keyof React.HTMLAttributes<HTMLDivElement> | "key" | "asChild"> & {
95
95
  progress?: number | undefined;
96
96
  label?: string | undefined;
97
97
  } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
package/dist/command.d.ts CHANGED
@@ -6,11 +6,11 @@ import '@radix-ui/react-dialog';
6
6
  type CommandProps = React.ComponentPropsWithoutRef<typeof Command$1>;
7
7
  declare const Command: React.ForwardRefExoticComponent<Omit<{
8
8
  children?: React.ReactNode;
9
- } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
9
+ } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement> | "key"> & {
10
10
  ref?: React.Ref<HTMLDivElement> | undefined;
11
11
  } & {
12
12
  asChild?: boolean | undefined;
13
- }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & {
13
+ }, keyof React.HTMLAttributes<HTMLDivElement> | "key" | "asChild"> & {
14
14
  label?: string | undefined;
15
15
  shouldFilter?: boolean | undefined;
16
16
  filter?: ((value: string, search: string, keywords?: string[] | undefined) => number) | undefined;
@@ -28,56 +28,56 @@ declare const CommandInput: React.ForwardRefExoticComponent<Omit<Omit<Pick<Pick<
28
28
  ref?: React.Ref<HTMLInputElement> | undefined;
29
29
  } & {
30
30
  asChild?: boolean | undefined;
31
- }, "key" | "asChild" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "type" | "value" | "onChange"> & {
31
+ }, "key" | "asChild" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "onChange" | "type" | "value"> & {
32
32
  value?: string | undefined;
33
33
  onValueChange?: ((search: string) => void) | undefined;
34
34
  } & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
35
35
  type CommandListProps = React.ComponentPropsWithoutRef<typeof Command$1.List>;
36
36
  declare const CommandList: React.ForwardRefExoticComponent<Omit<{
37
37
  children?: React.ReactNode;
38
- } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
38
+ } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement> | "key"> & {
39
39
  ref?: React.Ref<HTMLDivElement> | undefined;
40
40
  } & {
41
41
  asChild?: boolean | undefined;
42
- }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & {
42
+ }, keyof React.HTMLAttributes<HTMLDivElement> | "key" | "asChild"> & {
43
43
  label?: string | undefined;
44
44
  } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
45
45
  type CommandEmptyProps = React.ComponentPropsWithoutRef<typeof Command$1.Empty>;
46
46
  declare const CommandEmpty: React.ForwardRefExoticComponent<Omit<{
47
47
  children?: React.ReactNode;
48
- } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
48
+ } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement> | "key"> & {
49
49
  ref?: React.Ref<HTMLDivElement> | undefined;
50
50
  } & {
51
51
  asChild?: boolean | undefined;
52
- }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
52
+ }, keyof React.HTMLAttributes<HTMLDivElement> | "key" | "asChild"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
53
53
  type CommandGroupProps = React.ComponentPropsWithoutRef<typeof Command$1.Group>;
54
54
  declare const CommandGroup: React.ForwardRefExoticComponent<Omit<{
55
55
  children?: React.ReactNode;
56
- } & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
56
+ } & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement> | "key"> & {
57
57
  ref?: React.Ref<HTMLDivElement> | undefined;
58
58
  } & {
59
59
  asChild?: boolean | undefined;
60
- }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>>, "value" | "heading"> & {
60
+ }, keyof React.HTMLAttributes<HTMLDivElement> | "key" | "asChild">, "heading" | "value"> & {
61
61
  heading?: React.ReactNode;
62
62
  value?: string | undefined;
63
63
  forceMount?: boolean | undefined;
64
64
  } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
65
65
  type CommandSeparatorProps = React.ComponentPropsWithoutRef<typeof Command$1.Separator>;
66
- declare const CommandSeparator: React.ForwardRefExoticComponent<Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
66
+ declare const CommandSeparator: React.ForwardRefExoticComponent<Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement> | "key"> & {
67
67
  ref?: React.Ref<HTMLDivElement> | undefined;
68
68
  } & {
69
69
  asChild?: boolean | undefined;
70
- }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & {
70
+ }, keyof React.HTMLAttributes<HTMLDivElement> | "key" | "asChild"> & {
71
71
  alwaysRender?: boolean | undefined;
72
72
  } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
73
73
  type CommandItemProps = React.ComponentPropsWithoutRef<typeof Command$1.Item>;
74
74
  declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
75
75
  children?: React.ReactNode;
76
- } & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
76
+ } & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement> | "key"> & {
77
77
  ref?: React.Ref<HTMLDivElement> | undefined;
78
78
  } & {
79
79
  asChild?: boolean | undefined;
80
- }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>>, "disabled" | "value" | "onSelect"> & {
80
+ }, keyof React.HTMLAttributes<HTMLDivElement> | "key" | "asChild">, "onSelect" | "disabled" | "value"> & {
81
81
  disabled?: boolean | undefined;
82
82
  onSelect?: ((value: string) => void) | undefined;
83
83
  value?: string | undefined;
@@ -87,11 +87,11 @@ declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
87
87
  type CommandLoadingProps = React.ComponentPropsWithoutRef<typeof Command$1.Loading>;
88
88
  declare const CommandLoading: React.ForwardRefExoticComponent<Omit<{
89
89
  children?: React.ReactNode;
90
- } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
90
+ } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement> | "key"> & {
91
91
  ref?: React.Ref<HTMLDivElement> | undefined;
92
92
  } & {
93
93
  asChild?: boolean | undefined;
94
- }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & {
94
+ }, keyof React.HTMLAttributes<HTMLDivElement> | "key" | "asChild"> & {
95
95
  progress?: number | undefined;
96
96
  label?: string | undefined;
97
97
  } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
package/dist/command.js CHANGED
@@ -28,7 +28,7 @@ function CommandDialog({ children, ...props }) {
28
28
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkTH24V27Mjs.Dialog, { ...props, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkTH24V27Mjs.DialogContent, { className: "p-0", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Command, { className: "[&_[cmdk-group-heading]]:text-muted-foreground focus:outline-none [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:size-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:size-5", children }) }) });
29
29
  }
30
30
  var CommandInput = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2 border-b px-3", "cmdk-input-wrapper": "", children: [
31
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reacticons.MagnifyingGlassIcon, { className: "size-4 shrink-0 opacity-50" }),
31
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reacticons.MagnifyingGlassIcon, { className: "size-5 shrink-0 opacity-50" }),
32
32
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
33
33
  _cmdk.Command.Input,
34
34
  {
@@ -42,14 +42,7 @@ var CommandInput = React.forwardRef(({ className, ...props }, ref) => /* @__PURE
42
42
  )
43
43
  ] }));
44
44
  CommandInput.displayName = _cmdk.Command.Input.displayName;
45
- var CommandList = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
46
- _cmdk.Command.List,
47
- {
48
- ref,
49
- className: _chunkG3NP7M2Njs.cn.call(void 0, "max-h-[300px] overflow-y-auto overflow-x-hidden", className),
50
- ...props
51
- }
52
- ));
45
+ var CommandList = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _cmdk.Command.List, { ref, className: _chunkG3NP7M2Njs.cn.call(void 0, "max-h-72 overflow-y-auto overflow-x-hidden", className), ...props }));
53
46
  CommandList.displayName = _cmdk.Command.List.displayName;
54
47
  var CommandEmpty = React.forwardRef((props, ref) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _cmdk.Command.Empty, { ref, className: "py-6 text-center text-sm", ...props }));
55
48
  CommandEmpty.displayName = _cmdk.Command.Empty.displayName;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/command.tsx"],"names":[],"mappings":";;;;;;;;;;AAEA,YAAY,WAAW;AACvB,SAAS,2BAA2B;AACpC,SAAS,WAAW,wBAAwB;AAY1C,cAsCA,YAtCA;AADF,IAAM,UAAgB,iBAAyC,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACvF;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AAED,QAAQ,cAAc,iBAAiB;AAQvC,SAAS,cAAc,EAAE,UAAU,GAAG,MAAM,GAA0C;AACpF,SACE,oBAAC,UAAQ,GAAG,OACV,8BAAC,iBAAc,WAAU,OACvB,8BAAC,WAAQ,WAAU,+UAChB,UACH,GACF,GACF;AAEJ;AASA,IAAM,eAAqB,iBAAmD,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACtG,qBAAC,SAAI,WAAU,yCAAwC,sBAAmB,IACxE;AAAA,sBAAC,uBAAoB,WAAU,8BAA6B;AAAA,EAC5D;AAAA,IAAC,iBAAiB;AAAA,IAAjB;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAAA,GACF,CACD;AAED,aAAa,cAAc,iBAAiB,M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B,EAAE,WAAW,GAAG,MAAM,GAA4C;AACzF,SAAO,oBAAC,UAAK,WAAW,GAAG,yDAAyD,SAAS,GAAI,GAAG,OAAO;AAC7G","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { MagnifyingGlassIcon } from \"@radix-ui/react-icons\";\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport { cn } from \"./utils\";\nimport { Dialog, DialogContent } from \"./dialog\";\n\n/* -----------------------------------------------------------------------------\n * Component: Command\n * -------------------------------------------------------------------------- */\n\ntype CommandElement = React.ElementRef<typeof CommandPrimitive>;\ntype CommandProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive>;\n\nconst Command = React.forwardRef<CommandElement, CommandProps>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn(\n \"bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md\",\n className,\n )}\n {...props}\n />\n));\n\nCommand.displayName = CommandPrimitive.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: CommandDialog\n * -------------------------------------------------------------------------- */\n\ntype CommandDialogProps = React.ComponentProps<typeof Dialog>;\n\nfunction CommandDialog({ children, ...props }: CommandDialogProps): React.JSX.Element {\n return (\n <Dialog {...props}>\n <DialogContent className=\"p-0\">\n <Command className=\"[&_[cmdk-group-heading]]:text-muted-foreground focus:outline-none [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:size-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:size-5\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CommandInput\n * -------------------------------------------------------------------------- */\n\ntype CommandInputElement = React.ElementRef<typeof CommandPrimitive.Input>;\ntype CommandInputProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>;\n\nconst CommandInput = React.forwardRef<CommandInputElement, CommandInputProps>(({ className, ...props }, ref) => (\n <div className=\"flex items-center gap-2 border-b px-3\" cmdk-input-wrapper=\"\">\n <MagnifyingGlassIcon className=\"size-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n \"placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent text-sm focus:outline-none disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n {...props}\n />\n </div>\n));\n\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: CommandList\n * -------------------------------------------------------------------------- */\n\ntype CommandListElement = React.ElementRef<typeof CommandPrimitive.List>;\ntype CommandListProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>;\n\nconst CommandList = React.forwardRef<CommandListElement, CommandListProps>(({ className, ...props }, ref) => (\n <CommandPrimitive.List\n ref={ref}\n className={cn(\"max-h-[300px] overflow-y-auto overflow-x-hidden\", className)}\n {...props}\n />\n));\n\nCommandList.displayName = CommandPrimitive.List.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: CommandEmpty\n * -------------------------------------------------------------------------- */\n\ntype CommandEmptyElement = React.ElementRef<typeof CommandPrimitive.Empty>;\ntype CommandEmptyProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>;\n\nconst CommandEmpty = React.forwardRef<CommandEmptyElement, CommandEmptyProps>((props, ref) => (\n <CommandPrimitive.Empty ref={ref} className=\"py-6 text-center text-sm\" {...props} />\n));\n\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: CommandGroup\n * -------------------------------------------------------------------------- */\n\ntype CommandGroupElement = React.ElementRef<typeof CommandPrimitive.Group>;\ntype CommandGroupProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>;\n\nconst CommandGroup = React.forwardRef<CommandGroupElement, CommandGroupProps>(({ className, ...props }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n \"text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium\",\n className,\n )}\n {...props}\n />\n));\n\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: CommandSeparator\n * -------------------------------------------------------------------------- */\n\ntype CommandSeparatorElement = React.ElementRef<typeof CommandPrimitive.Separator>;\ntype CommandSeparatorProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>;\n\nconst CommandSeparator = React.forwardRef<CommandSeparatorElement, CommandSeparatorProps>(\n ({ className, ...props }, ref) => (\n <CommandPrimitive.Separator ref={ref} className={cn(\"bg-border -mx-1 h-px\", className)} {...props} />\n ),\n);\n\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: CommandItem\n * -------------------------------------------------------------------------- */\n\ntype CommandItemElement = React.ElementRef<typeof CommandPrimitive.Item>;\ntype CommandItemProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>;\n\nconst CommandItem = React.forwardRef<CommandItemElement, CommandItemProps>(({ className, ...props }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n \"aria-selected:bg-accent aria-selected:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50\",\n className,\n )}\n {...props}\n />\n));\n\nCommandItem.displayName = CommandPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: CommandLoading\n * -------------------------------------------------------------------------- */\n\ntype CommandLoadingElement = React.ElementRef<typeof CommandPrimitive.Loading>;\ntype CommandLoadingProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Loading>;\n\nconst CommandLoading = React.forwardRef<CommandLoadingElement, CommandLoadingProps>(({ className, ...props }, ref) => (\n <CommandPrimitive.Loading ref={ref} className={cn(\"flex justify-center p-2\", className)} {...props} />\n));\n\nCommandLoading.displayName = CommandPrimitive.Loading.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: CommandShortcut\n * -------------------------------------------------------------------------- */\n\ntype CommandShortcutProps = React.HTMLAttributes<HTMLSpanElement>;\n\nfunction CommandShortcut({ className, ...props }: CommandShortcutProps): React.JSX.Element {\n return <span className={cn(\"text-muted-foreground ml-auto text-xs tracking-widest\", className)} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandLoading,\n CommandShortcut,\n CommandSeparator,\n type CommandProps,\n type CommandDialogProps,\n type CommandInputProps,\n type CommandListProps,\n type CommandEmptyProps,\n type CommandGroupProps,\n type CommandItemProps,\n type CommandLoadingProps,\n type CommandShortcutProps,\n type CommandSeparatorProps,\n};\n"]}
1
+ {"version":3,"sources":["../src/command.tsx"],"names":[],"mappings":";;;;;;;;;;AAEA,YAAY,WAAW;AACvB,SAAS,2BAA2B;AACpC,SAAS,WAAW,wBAAwB;AAY1C,cAsCA,YAtCA;AADF,IAAM,UAAgB,iBAAyC,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACvF;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AAED,QAAQ,cAAc,iBAAiB;AAQvC,SAAS,cAAc,EAAE,UAAU,GAAG,MAAM,GAA0C;AACpF,SACE,oBAAC,UAAQ,GAAG,OACV,8BAAC,iBAAc,WAAU,OACvB,8BAAC,WAAQ,WAAU,+UAChB,UACH,GACF,GACF;AAEJ;AASA,IAAM,eAAqB,iBAAmD,CAAC,E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ACC,GAAG;AAAA;AACN,CACD;AAED,YAAY,cAAc,iBAAiB,KAAK;AAShD,IAAM,iBAAuB,iBAAuD,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC5G,oBAAC,iBAAiB,SAAjB,EAAyB,KAAU,WAAW,GAAG,2BAA2B,SAAS,GAAI,GAAG,OAAO,CACrG;AAED,eAAe,cAAc,iBAAiB,QAAQ;AAQtD,SAAS,gBAAgB,EAAE,WAAW,GAAG,MAAM,GAA4C;AACzF,SAAO,oBAAC,UAAK,WAAW,GAAG,yDAAyD,SAAS,GAAI,GAAG,OAAO;AAC7G","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { MagnifyingGlassIcon } from \"@radix-ui/react-icons\";\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport { cn } from \"./utils\";\nimport { Dialog, DialogContent } from \"./dialog\";\n\n/* -----------------------------------------------------------------------------\n * Component: Command\n * -------------------------------------------------------------------------- */\n\ntype CommandElement = React.ElementRef<typeof CommandPrimitive>;\ntype CommandProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive>;\n\nconst Command = React.forwardRef<CommandElement, CommandProps>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn(\n \"bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md\",\n className,\n )}\n {...props}\n />\n));\n\nCommand.displayName = CommandPrimitive.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: CommandDialog\n * -------------------------------------------------------------------------- */\n\ntype CommandDialogProps = React.ComponentProps<typeof Dialog>;\n\nfunction CommandDialog({ children, ...props }: CommandDialogProps): React.JSX.Element {\n return (\n <Dialog {...props}>\n <DialogContent className=\"p-0\">\n <Command className=\"[&_[cmdk-group-heading]]:text-muted-foreground focus:outline-none [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:size-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:size-5\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CommandInput\n * -------------------------------------------------------------------------- */\n\ntype CommandInputElement = React.ElementRef<typeof CommandPrimitive.Input>;\ntype CommandInputProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>;\n\nconst CommandInput = React.forwardRef<CommandInputElement, CommandInputProps>(({ className, ...props }, ref) => (\n <div className=\"flex items-center gap-2 border-b px-3\" cmdk-input-wrapper=\"\">\n <MagnifyingGlassIcon className=\"size-5 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n \"placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent text-sm focus:outline-none disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n {...props}\n />\n </div>\n));\n\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: CommandList\n * -------------------------------------------------------------------------- */\n\ntype CommandListElement = React.ElementRef<typeof CommandPrimitive.List>;\ntype CommandListProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>;\n\nconst CommandList = React.forwardRef<CommandListElement, CommandListProps>(({ className, ...props }, ref) => (\n <CommandPrimitive.List ref={ref} className={cn(\"max-h-72 overflow-y-auto overflow-x-hidden\", className)} {...props} />\n));\n\nCommandList.displayName = CommandPrimitive.List.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: CommandEmpty\n * -------------------------------------------------------------------------- */\n\ntype CommandEmptyElement = React.ElementRef<typeof CommandPrimitive.Empty>;\ntype CommandEmptyProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>;\n\nconst CommandEmpty = React.forwardRef<CommandEmptyElement, CommandEmptyProps>((props, ref) => (\n <CommandPrimitive.Empty ref={ref} className=\"py-6 text-center text-sm\" {...props} />\n));\n\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: CommandGroup\n * -------------------------------------------------------------------------- */\n\ntype CommandGroupElement = React.ElementRef<typeof CommandPrimitive.Group>;\ntype CommandGroupProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>;\n\nconst CommandGroup = React.forwardRef<CommandGroupElement, CommandGroupProps>(({ className, ...props }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n \"text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium\",\n className,\n )}\n {...props}\n />\n));\n\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: CommandSeparator\n * -------------------------------------------------------------------------- */\n\ntype CommandSeparatorElement = React.ElementRef<typeof CommandPrimitive.Separator>;\ntype CommandSeparatorProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>;\n\nconst CommandSeparator = React.forwardRef<CommandSeparatorElement, CommandSeparatorProps>(\n ({ className, ...props }, ref) => (\n <CommandPrimitive.Separator ref={ref} className={cn(\"bg-border -mx-1 h-px\", className)} {...props} />\n ),\n);\n\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: CommandItem\n * -------------------------------------------------------------------------- */\n\ntype CommandItemElement = React.ElementRef<typeof CommandPrimitive.Item>;\ntype CommandItemProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>;\n\nconst CommandItem = React.forwardRef<CommandItemElement, CommandItemProps>(({ className, ...props }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n \"aria-selected:bg-accent aria-selected:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50\",\n className,\n )}\n {...props}\n />\n));\n\nCommandItem.displayName = CommandPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: CommandLoading\n * -------------------------------------------------------------------------- */\n\ntype CommandLoadingElement = React.ElementRef<typeof CommandPrimitive.Loading>;\ntype CommandLoadingProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Loading>;\n\nconst CommandLoading = React.forwardRef<CommandLoadingElement, CommandLoadingProps>(({ className, ...props }, ref) => (\n <CommandPrimitive.Loading ref={ref} className={cn(\"flex justify-center p-2\", className)} {...props} />\n));\n\nCommandLoading.displayName = CommandPrimitive.Loading.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: CommandShortcut\n * -------------------------------------------------------------------------- */\n\ntype CommandShortcutProps = React.HTMLAttributes<HTMLSpanElement>;\n\nfunction CommandShortcut({ className, ...props }: CommandShortcutProps): React.JSX.Element {\n return <span className={cn(\"text-muted-foreground ml-auto text-xs tracking-widest\", className)} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandLoading,\n CommandShortcut,\n CommandSeparator,\n type CommandProps,\n type CommandDialogProps,\n type CommandInputProps,\n type CommandListProps,\n type CommandEmptyProps,\n type CommandGroupProps,\n type CommandItemProps,\n type CommandLoadingProps,\n type CommandShortcutProps,\n type CommandSeparatorProps,\n};\n"]}
package/dist/command.mjs CHANGED
@@ -28,7 +28,7 @@ function CommandDialog({ children, ...props }) {
28
28
  return /* @__PURE__ */ jsx(Dialog, { ...props, children: /* @__PURE__ */ jsx(DialogContent, { className: "p-0", children: /* @__PURE__ */ jsx(Command, { className: "[&_[cmdk-group-heading]]:text-muted-foreground focus:outline-none [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:size-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:size-5", children }) }) });
29
29
  }
30
30
  var CommandInput = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 border-b px-3", "cmdk-input-wrapper": "", children: [
31
- /* @__PURE__ */ jsx(MagnifyingGlassIcon, { className: "size-4 shrink-0 opacity-50" }),
31
+ /* @__PURE__ */ jsx(MagnifyingGlassIcon, { className: "size-5 shrink-0 opacity-50" }),
32
32
  /* @__PURE__ */ jsx(
33
33
  CommandPrimitive.Input,
34
34
  {
@@ -42,14 +42,7 @@ var CommandInput = React.forwardRef(({ className, ...props }, ref) => /* @__PURE
42
42
  )
43
43
  ] }));
44
44
  CommandInput.displayName = CommandPrimitive.Input.displayName;
45
- var CommandList = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
46
- CommandPrimitive.List,
47
- {
48
- ref,
49
- className: cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className),
50
- ...props
51
- }
52
- ));
45
+ var CommandList = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(CommandPrimitive.List, { ref, className: cn("max-h-72 overflow-y-auto overflow-x-hidden", className), ...props }));
53
46
  CommandList.displayName = CommandPrimitive.List.displayName;
54
47
  var CommandEmpty = React.forwardRef((props, ref) => /* @__PURE__ */ jsx(CommandPrimitive.Empty, { ref, className: "py-6 text-center text-sm", ...props }));
55
48
  CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/command.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { MagnifyingGlassIcon } from \"@radix-ui/react-icons\";\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport { cn } from \"./utils\";\nimport { Dialog, DialogContent } from \"./dialog\";\n\n/* -----------------------------------------------------------------------------\n * Component: Command\n * -------------------------------------------------------------------------- */\n\ntype CommandElement = React.ElementRef<typeof CommandPrimitive>;\ntype CommandProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive>;\n\nconst Command = React.forwardRef<CommandElement, CommandProps>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn(\n \"bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md\",\n className,\n )}\n {...props}\n />\n));\n\nCommand.displayName = CommandPrimitive.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: CommandDialog\n * -------------------------------------------------------------------------- */\n\ntype CommandDialogProps = React.ComponentProps<typeof Dialog>;\n\nfunction CommandDialog({ children, ...props }: CommandDialogProps): React.JSX.Element {\n return (\n <Dialog {...props}>\n <DialogContent className=\"p-0\">\n <Command className=\"[&_[cmdk-group-heading]]:text-muted-foreground focus:outline-none [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:size-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:size-5\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CommandInput\n * -------------------------------------------------------------------------- */\n\ntype CommandInputElement = React.ElementRef<typeof CommandPrimitive.Input>;\ntype CommandInputProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>;\n\nconst CommandInput = React.forwardRef<CommandInputElement, CommandInputProps>(({ className, ...props }, ref) => (\n <div className=\"flex items-center gap-2 border-b px-3\" cmdk-input-wrapper=\"\">\n <MagnifyingGlassIcon className=\"size-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n \"placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent text-sm focus:outline-none disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n {...props}\n />\n </div>\n));\n\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: CommandList\n * -------------------------------------------------------------------------- */\n\ntype CommandListElement = React.ElementRef<typeof CommandPrimitive.List>;\ntype CommandListProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>;\n\nconst CommandList = React.forwardRef<CommandListElement, CommandListProps>(({ className, ...props }, ref) => (\n <CommandPrimitive.List\n ref={ref}\n className={cn(\"max-h-[300px] overflow-y-auto overflow-x-hidden\", className)}\n {...props}\n />\n));\n\nCommandList.displayName = CommandPrimitive.List.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: CommandEmpty\n * -------------------------------------------------------------------------- */\n\ntype CommandEmptyElement = React.ElementRef<typeof CommandPrimitive.Empty>;\ntype CommandEmptyProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>;\n\nconst CommandEmpty = React.forwardRef<CommandEmptyElement, CommandEmptyProps>((props, ref) => (\n <CommandPrimitive.Empty ref={ref} className=\"py-6 text-center text-sm\" {...props} />\n));\n\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: CommandGroup\n * -------------------------------------------------------------------------- */\n\ntype CommandGroupElement = React.ElementRef<typeof CommandPrimitive.Group>;\ntype CommandGroupProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>;\n\nconst CommandGroup = React.forwardRef<CommandGroupElement, CommandGroupProps>(({ className, ...props }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n \"text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium\",\n className,\n )}\n {...props}\n />\n));\n\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: CommandSeparator\n * -------------------------------------------------------------------------- */\n\ntype CommandSeparatorElement = React.ElementRef<typeof CommandPrimitive.Separator>;\ntype CommandSeparatorProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>;\n\nconst CommandSeparator = React.forwardRef<CommandSeparatorElement, CommandSeparatorProps>(\n ({ className, ...props }, ref) => (\n <CommandPrimitive.Separator ref={ref} className={cn(\"bg-border -mx-1 h-px\", className)} {...props} />\n ),\n);\n\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: CommandItem\n * -------------------------------------------------------------------------- */\n\ntype CommandItemElement = React.ElementRef<typeof CommandPrimitive.Item>;\ntype CommandItemProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>;\n\nconst CommandItem = React.forwardRef<CommandItemElement, CommandItemProps>(({ className, ...props }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n \"aria-selected:bg-accent aria-selected:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50\",\n className,\n )}\n {...props}\n />\n));\n\nCommandItem.displayName = CommandPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: CommandLoading\n * -------------------------------------------------------------------------- */\n\ntype CommandLoadingElement = React.ElementRef<typeof CommandPrimitive.Loading>;\ntype CommandLoadingProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Loading>;\n\nconst CommandLoading = React.forwardRef<CommandLoadingElement, CommandLoadingProps>(({ className, ...props }, ref) => (\n <CommandPrimitive.Loading ref={ref} className={cn(\"flex justify-center p-2\", className)} {...props} />\n));\n\nCommandLoading.displayName = CommandPrimitive.Loading.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: CommandShortcut\n * -------------------------------------------------------------------------- */\n\ntype CommandShortcutProps = React.HTMLAttributes<HTMLSpanElement>;\n\nfunction CommandShortcut({ className, ...props }: CommandShortcutProps): React.JSX.Element {\n return <span className={cn(\"text-muted-foreground ml-auto text-xs tracking-widest\", className)} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandLoading,\n CommandShortcut,\n CommandSeparator,\n type CommandProps,\n type CommandDialogProps,\n type CommandInputProps,\n type CommandListProps,\n type CommandEmptyProps,\n type CommandGroupProps,\n type CommandItemProps,\n type CommandLoadingProps,\n type CommandShortcutProps,\n type CommandSeparatorProps,\n};\n"],"mappings":";;;;;;;;;;AAEA,YAAY,WAAW;AACvB,SAAS,2BAA2B;AACpC,SAAS,WAAW,wBAAwB;AAY1C,cAsCA,YAtCA;AADF,IAAM,UAAgB,iBAAyC,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACvF;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AAED,QAAQ,cAAc,iBAAiB;AAQvC,SAAS,cAAc,EAAE,UAAU,GAAG,MAAM,GAA0C;AACpF,SACE,oBAAC,UAAQ,GAAG,OACV,8BAAC,iBAAc,WAAU,OACvB,8BAAC,WAAQ,WAAU,+UAChB,UACH,GACF,GACF;AAEJ;AASA,IAAM,eAAqB,iBAAmD,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACtG,qBAAC,SAAI,WAAU,yCAAwC,sBAAmB,IACxE;AAAA,sBAAC,uBAAoB,WAAU,8BAA6B;AAAA,EAC5D;AAAA,IAAC,iBAAiB;AAAA,IAAjB;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAAA,GACF,CACD;AAED,aAAa,cAAc,iBAAiB,MAAM;AASlD,IAAM,cA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,MAAM,GAA4C;AACzF,SAAO,oBAAC,UAAK,WAAW,GAAG,yDAAyD,SAAS,GAAI,GAAG,OAAO;AAC7G;","names":[]}
1
+ {"version":3,"sources":["../src/command.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { MagnifyingGlassIcon } from \"@radix-ui/react-icons\";\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport { cn } from \"./utils\";\nimport { Dialog, DialogContent } from \"./dialog\";\n\n/* -----------------------------------------------------------------------------\n * Component: Command\n * -------------------------------------------------------------------------- */\n\ntype CommandElement = React.ElementRef<typeof CommandPrimitive>;\ntype CommandProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive>;\n\nconst Command = React.forwardRef<CommandElement, CommandProps>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn(\n \"bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md\",\n className,\n )}\n {...props}\n />\n));\n\nCommand.displayName = CommandPrimitive.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: CommandDialog\n * -------------------------------------------------------------------------- */\n\ntype CommandDialogProps = React.ComponentProps<typeof Dialog>;\n\nfunction CommandDialog({ children, ...props }: CommandDialogProps): React.JSX.Element {\n return (\n <Dialog {...props}>\n <DialogContent className=\"p-0\">\n <Command className=\"[&_[cmdk-group-heading]]:text-muted-foreground focus:outline-none [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:size-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:size-5\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CommandInput\n * -------------------------------------------------------------------------- */\n\ntype CommandInputElement = React.ElementRef<typeof CommandPrimitive.Input>;\ntype CommandInputProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>;\n\nconst CommandInput = React.forwardRef<CommandInputElement, CommandInputProps>(({ className, ...props }, ref) => (\n <div className=\"flex items-center gap-2 border-b px-3\" cmdk-input-wrapper=\"\">\n <MagnifyingGlassIcon className=\"size-5 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n \"placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent text-sm focus:outline-none disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n {...props}\n />\n </div>\n));\n\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: CommandList\n * -------------------------------------------------------------------------- */\n\ntype CommandListElement = React.ElementRef<typeof CommandPrimitive.List>;\ntype CommandListProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>;\n\nconst CommandList = React.forwardRef<CommandListElement, CommandListProps>(({ className, ...props }, ref) => (\n <CommandPrimitive.List ref={ref} className={cn(\"max-h-72 overflow-y-auto overflow-x-hidden\", className)} {...props} />\n));\n\nCommandList.displayName = CommandPrimitive.List.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: CommandEmpty\n * -------------------------------------------------------------------------- */\n\ntype CommandEmptyElement = React.ElementRef<typeof CommandPrimitive.Empty>;\ntype CommandEmptyProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>;\n\nconst CommandEmpty = React.forwardRef<CommandEmptyElement, CommandEmptyProps>((props, ref) => (\n <CommandPrimitive.Empty ref={ref} className=\"py-6 text-center text-sm\" {...props} />\n));\n\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: CommandGroup\n * -------------------------------------------------------------------------- */\n\ntype CommandGroupElement = React.ElementRef<typeof CommandPrimitive.Group>;\ntype CommandGroupProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>;\n\nconst CommandGroup = React.forwardRef<CommandGroupElement, CommandGroupProps>(({ className, ...props }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n \"text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium\",\n className,\n )}\n {...props}\n />\n));\n\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: CommandSeparator\n * -------------------------------------------------------------------------- */\n\ntype CommandSeparatorElement = React.ElementRef<typeof CommandPrimitive.Separator>;\ntype CommandSeparatorProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>;\n\nconst CommandSeparator = React.forwardRef<CommandSeparatorElement, CommandSeparatorProps>(\n ({ className, ...props }, ref) => (\n <CommandPrimitive.Separator ref={ref} className={cn(\"bg-border -mx-1 h-px\", className)} {...props} />\n ),\n);\n\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: CommandItem\n * -------------------------------------------------------------------------- */\n\ntype CommandItemElement = React.ElementRef<typeof CommandPrimitive.Item>;\ntype CommandItemProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>;\n\nconst CommandItem = React.forwardRef<CommandItemElement, CommandItemProps>(({ className, ...props }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n \"aria-selected:bg-accent aria-selected:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50\",\n className,\n )}\n {...props}\n />\n));\n\nCommandItem.displayName = CommandPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: CommandLoading\n * -------------------------------------------------------------------------- */\n\ntype CommandLoadingElement = React.ElementRef<typeof CommandPrimitive.Loading>;\ntype CommandLoadingProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Loading>;\n\nconst CommandLoading = React.forwardRef<CommandLoadingElement, CommandLoadingProps>(({ className, ...props }, ref) => (\n <CommandPrimitive.Loading ref={ref} className={cn(\"flex justify-center p-2\", className)} {...props} />\n));\n\nCommandLoading.displayName = CommandPrimitive.Loading.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: CommandShortcut\n * -------------------------------------------------------------------------- */\n\ntype CommandShortcutProps = React.HTMLAttributes<HTMLSpanElement>;\n\nfunction CommandShortcut({ className, ...props }: CommandShortcutProps): React.JSX.Element {\n return <span className={cn(\"text-muted-foreground ml-auto text-xs tracking-widest\", className)} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandLoading,\n CommandShortcut,\n CommandSeparator,\n type CommandProps,\n type CommandDialogProps,\n type CommandInputProps,\n type CommandListProps,\n type CommandEmptyProps,\n type CommandGroupProps,\n type CommandItemProps,\n type CommandLoadingProps,\n type CommandShortcutProps,\n type CommandSeparatorProps,\n};\n"],"mappings":";;;;;;;;;;AAEA,YAAY,WAAW;AACvB,SAAS,2BAA2B;AACpC,SAAS,WAAW,wBAAwB;AAY1C,cAsCA,YAtCA;AADF,IAAM,UAAgB,iBAAyC,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACvF;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AAED,QAAQ,cAAc,iBAAiB;AAQvC,SAAS,cAAc,EAAE,UAAU,GAAG,MAAM,GAA0C;AACpF,SACE,oBAAC,UAAQ,GAAG,OACV,8BAAC,iBAAc,WAAU,OACvB,8BAAC,WAAQ,WAAU,+UAChB,UACH,GACF,GACF;AAEJ;AASA,IAAM,eAAqB,iBAAmD,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,Q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YAAY,cAAc,iBAAiB,KAAK;AAShD,IAAM,iBAAuB,iBAAuD,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC5G,oBAAC,iBAAiB,SAAjB,EAAyB,KAAU,WAAW,GAAG,2BAA2B,SAAS,GAAI,GAAG,OAAO,CACrG;AAED,eAAe,cAAc,iBAAiB,QAAQ;AAQtD,SAAS,gBAAgB,EAAE,WAAW,GAAG,MAAM,GAA4C;AACzF,SAAO,oBAAC,UAAK,WAAW,GAAG,yDAAyD,SAAS,GAAI,GAAG,OAAO;AAC7G;","names":[]}
@@ -42,7 +42,7 @@ function DataTableViewOptions({ table }) {
42
42
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reacticons.MixerHorizontalIcon, { className: "mr-2 size-4" }),
43
43
  "View"
44
44
  ] }) }),
45
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3ZZ3SRTJjs.DropdownMenuContent, { align: "end", className: "w-[150px]", children: [
45
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3ZZ3SRTJjs.DropdownMenuContent, { align: "end", className: "w-36", children: [
46
46
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3ZZ3SRTJjs.DropdownMenuLabel, { children: "Toggle columns" }),
47
47
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3ZZ3SRTJjs.DropdownMenuSeparator, {}),
48
48
  table.getAllColumns().filter((column) => typeof column.accessorFn !== "undefined" && column.getCanHide()).map((column) => {
@@ -85,13 +85,13 @@ function DataTablePagination({
85
85
  table.setPageSize(Number(value));
86
86
  },
87
87
  children: [
88
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBA3XYBWRjs.SelectTrigger, { className: "h-8 w-[70px]", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBA3XYBWRjs.SelectValue, { placeholder: table.getState().pagination.pageSize }) }),
89
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBA3XYBWRjs.SelectContent, { side: "top", children: [10, 20, 30, 40, 50].map((pageSize) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBA3XYBWRjs.SelectItem, { value: `${pageSize}`, children: pageSize }, pageSize)) })
88
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBA3XYBWRjs.SelectTrigger, { className: "h-8 w-16", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBA3XYBWRjs.SelectValue, { placeholder: table.getState().pagination.pageSize }) }),
89
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBA3XYBWRjs.SelectContent, { side: "top", children: [10, 20, 30, 40, 50].map((pageSize) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBA3XYBWRjs.SelectItem, { value: String(pageSize), children: pageSize }, pageSize)) })
90
90
  ]
91
91
  }
92
92
  )
93
93
  ] }),
94
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-[100px] items-center justify-center text-sm font-medium", children: [
94
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-28 items-center justify-center text-sm font-medium", children: [
95
95
  "Page ",
96
96
  table.getState().pagination.pageIndex + 1,
97
97
  " of ",
@@ -170,7 +170,7 @@ function DataTableColumnHeader({
170
170
  className
171
171
  }) {
172
172
  if (!column.getCanSort()) {
173
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: _chunkG3NP7M2Njs.cn.call(void 0, className), children: title });
173
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className, children: title });
174
174
  }
175
175
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: _chunkG3NP7M2Njs.cn.call(void 0, "flex items-center space-x-2", className), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3ZZ3SRTJjs.DropdownMenu, { children: [
176
176
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3ZZ3SRTJjs.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkTFYKPLNVjs.Button, { variant: "ghost", size: "xs", className: "data-[state=open]:bg-accent -ml-3", children: [
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/data-table.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAKA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AA0BC,SACE,KADF;AAJR,SAAS,qBAA4B,EAAE,MAAM,GAAwD;AACnG,SACE,qBAAC,gBACC;AAAA,wBAAC,uBAAoB,SAAO,MAC1B,+BAAC,UAAO,SAAQ,WAAU,MAAK,MAAK,WAAU,8BAC5C;AAAA,0BAAC,uBAAoB,WAAU,eAAc;AAAA,MAAE;AAAA,OAEjD,GACF;AAAA,IACA,qBAAC,uBAAoB,OAAM,OAAM,WAAU,aACzC;AAAA,0BAAC,qBAAkB,4BAAc;AAAA,MACjC,oBAAC,yBAAsB;AAAA,MACtB,MACE,cAAc,EACd,OAAO,CAAC,WAAW,OAAO,OAAO,eAAe,eAAe,OAAO,WAAW,CAAC,EAClF,IAAI,CAAC,WAAW;AACf,eACE;AAAA,UAAC;AAAA;AAAA,YAEC,WAAU;AAAA,YACV,SAAS,OAAO,aAAa;AAAA,YAC7B,iBAAiB,CAAC,UAAU;AAC1B,qBAAO,iBAAiB,QAAQ,KAAK,CAAC;AAAA,YACxC;AAAA,YAEC,iBAAO;AAAA;AAAA,UAPH,OAAO;AAAA,QAQd;AAAA,MAEJ,CAAC;AAAA,OACL;AAAA,KACF;AAEJ;AAUA,SAAS,oBAA2B;AAAA,EAClC;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAuD;AACrD,SACE,qBAAC,SAAI,WAAW,GAAG,0CAA0C,SAAS,GAAI,GAAG,OAC3E;AAAA,yBAAC,SAAI,WAAU,wCACZ;AAAA,YAAM,4BAA4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AAM,SACzB;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,SAAS,MAAM;AACb,mBAAO,cAAc,KAAK;AAAA,UAC5B;AAAA,UAEA;AAAA,gCAAC,eAAY,WAAU,0CAAyC;AAAA,YAAE;AAAA;AAAA;AAAA,MAEpE;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,SAAS,MAAM;AACb,mBAAO,cAAc,IAAI;AAAA,UAC3B;AAAA,UAEA;AAAA,gCAAC,iBAAc,WAAU,0CAAyC;AAAA,YAAE;AAAA;AAAA;AAAA,MAEtE;AAAA,MACA,oBAAC,yBAAsB;AAAA,MACvB;AAAA,QAAC;AAAA;AAAA,UACC,SAAS,MAAM;AACb,mBAAO,iBAAiB,KAAK;AAAA,UAC/B;AAAA,UAEA;AAAA,gCAAC,eAAY,WAAU,0CAAyC;AAAA,YAAE;AAAA;AAAA;AAAA,MAEpE;AAAA,OACF;AAAA,KACF,GACF;AAEJ;AAEA,SAAS,SAAS,EAAE,OAAO,GAAyD;AAClF,UAAQ,QAAQ;AAAA,IACd,KAAK;AACH,aAAO,oBAAC,iBAAc,WAAU,eAAc;AAAA,IAChD,KAAK;AACH,aAAO,oBAAC,eAAY,WAAU,eAAc;AAAA,IAC9C;AACE,aAAO,oBAAC,iBAAc,WAAU,eAAc;AAAA,EAClD;AACF","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport type * as ReactTable from \"@tanstack/react-table\";\nimport { type SortDirection } from \"@tanstack/react-table\";\nimport {\n ArrowDownIcon,\n ArrowUpIcon,\n CaretSortIcon,\n ChevronLeftIcon,\n ChevronRightIcon,\n DoubleArrowLeftIcon,\n DoubleArrowRightIcon,\n EyeNoneIcon,\n MixerHorizontalIcon,\n} from \"@radix-ui/react-icons\";\nimport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from \"./dropdown-menu\";\nimport { Button } from \"./button\";\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from \"./select\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: DataTableViewOptions\n * -------------------------------------------------------------------------- */\n\ninterface DataTableViewOptionsProps<TData> {\n table: ReactTable.Table<TData>;\n}\n\nfunction DataTableViewOptions<TData>({ table }: DataTableViewOptionsProps<TData>): React.JSX.Element {\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button variant=\"outline\" size=\"sm\" className=\"ml-auto hidden h-8 lg:flex\">\n <MixerHorizontalIcon className=\"mr-2 size-4\" />\n View\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-[150px]\">\n <DropdownMenuLabel>Toggle columns</DropdownMenuLabel>\n <DropdownMenuSeparator />\n {table\n .getAllColumns()\n .filter((column) => typeof column.accessorFn !== \"undefined\" && column.getCanHide())\n .map((column) => {\n return (\n <DropdownMenuCheckboxItem\n key={column.id}\n className=\"capitalize\"\n checked={column.getIsVisible()}\n onCheckedChange={(value) => {\n column.toggleVisibility(Boolean(value));\n }}\n >\n {column.id}\n </DropdownMenuCheckboxItem>\n );\n })}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DataTablePagination\n * -------------------------------------------------------------------------- */\n\ninterface DataTablePaginationProps<TData> extends React.HTMLAttributes<HTMLDivElement> {\n table: ReactTable.Table<TData>;\n}\n\nfunction DataTablePagination<TData>({\n table,\n className,\n ...props\n}: DataTablePaginationProps<TData>): React.JSX.Element {\n return (\n <div className={cn(\"flex items-center justify-between px-2\", className)} {...props}>\n <div className=\"text-muted-foreground flex-1 text-sm\">\n {table.getFilteredSelectedRowModel().rows.length} of {table.getFilteredRowModel().rows.length} row(s) selected.\n </div>\n <div className=\"flex items-center space-x-6 lg:space-x-8\">\n <div className=\"flex items-center space-x-2\">\n <p className=\"text-sm font-medium\">Rows per page</p>\n <Select\n value={String(table.getState().pagination.pageSize)}\n onValueChange={(value) => {\n table.setPageSize(Number(value));\n }}\n >\n <SelectTrigger className=\"h-8 w-[70px]\">\n <SelectValue placeholder={table.getState().pagination.pageSize} />\n </SelectTrigger>\n <SelectContent side=\"top\">\n {[10, 20, 30, 40, 50].map((pageSize) => (\n <SelectItem key={pageSize} value={`${pageSize}`}>\n {pageSize}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div className=\"flex w-[100px] items-center justify-center text-sm font-medium\">\n Page {table.getState().pagination.pageIndex + 1} of {table.getPageCount()}\n </div>\n <div className=\"flex items-center space-x-2\">\n <Button\n variant=\"outline\"\n size=\"icon-xs\"\n className=\"hidden lg:flex\"\n onClick={() => {\n table.setPageIndex(0);\n }}\n disabled={!table.getCanPreviousPage()}\n >\n <span className=\"sr-only\">Go to first page</span>\n <DoubleArrowLeftIcon className=\"size-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"icon-xs\"\n onClick={() => {\n table.previousPage();\n }}\n disabled={!table.getCanPreviousPage()}\n >\n <span className=\"sr-only\">Go to previous page</span>\n <ChevronLeftIcon className=\"size-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"icon-xs\"\n onClick={() => {\n table.nextPage();\n }}\n disabled={!table.getCanNextPage()}\n >\n <span className=\"sr-only\">Go to next page</span>\n <ChevronRightIcon className=\"size-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"icon-xs\"\n className=\"hidden lg:flex\"\n onClick={() => {\n table.setPageIndex(table.getPageCount() - 1);\n }}\n disabled={!table.getCanNextPage()}\n >\n <span className=\"sr-only\">Go to last page</span>\n <DoubleArrowRightIcon className=\"size-4\" />\n </Button>\n </div>\n </div>\n </div>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DataTableColumnHeader\n * -------------------------------------------------------------------------- */\n\ninterface DataTableColumnHeaderProps<TData, TValue> extends React.HTMLAttributes<HTMLDivElement> {\n column: ReactTable.Column<TData, TValue>;\n title: string;\n}\n\nfunction DataTableColumnHeader<TData, TValue>({\n column,\n title,\n className,\n}: DataTableColumnHeaderProps<TData, TValue>): React.JSX.Element {\n if (!column.getCanSort()) {\n return <div className={cn(className)}>{title}</div>;\n }\n\n return (\n <div className={cn(\"flex items-center space-x-2\", className)}>\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button variant=\"ghost\" size=\"xs\" className=\"data-[state=open]:bg-accent -ml-3\">\n <span>{title}</span>\n <SortIcon sorted={column.getIsSorted()} />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"start\">\n <DropdownMenuItem\n onClick={() => {\n column.toggleSorting(false);\n }}\n >\n <ArrowUpIcon className=\"text-muted-foreground/70 mr-2 size-3.5\" />\n Asc\n </DropdownMenuItem>\n <DropdownMenuItem\n onClick={() => {\n column.toggleSorting(true);\n }}\n >\n <ArrowDownIcon className=\"text-muted-foreground/70 mr-2 size-3.5\" />\n Desc\n </DropdownMenuItem>\n <DropdownMenuSeparator />\n <DropdownMenuItem\n onClick={() => {\n column.toggleVisibility(false);\n }}\n >\n <EyeNoneIcon className=\"text-muted-foreground/70 mr-2 size-3.5\" />\n Hide\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </div>\n );\n}\n\nfunction SortIcon({ sorted }: { sorted: false | SortDirection }): React.JSX.Element {\n switch (sorted) {\n case \"desc\":\n return <ArrowDownIcon className=\"ml-2 size-4\" />;\n case \"asc\":\n return <ArrowUpIcon className=\"ml-2 size-4\" />;\n default:\n return <CaretSortIcon className=\"ml-2 size-4\" />;\n }\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n DataTableViewOptions,\n DataTablePagination,\n DataTableColumnHeader,\n type DataTableViewOptionsProps,\n type DataTablePaginationProps,\n type DataTableColumnHeaderProps,\n};\n"]}
1
+ {"version":3,"sources":["../src/data-table.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAKA;AAAA,EAC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,cAAc,IAAI;AAAA,UAC3B;AAAA,UAEA;AAAA,gCAAC,iBAAc,WAAU,0CAAyC;AAAA,YAAE;AAAA;AAAA;AAAA,MAEtE;AAAA,MACA,oBAAC,yBAAsB;AAAA,MACvB;AAAA,QAAC;AAAA;AAAA,UACC,SAAS,MAAM;AACb,mBAAO,iBAAiB,KAAK;AAAA,UAC/B;AAAA,UAEA;AAAA,gCAAC,eAAY,WAAU,0CAAyC;AAAA,YAAE;AAAA;AAAA;AAAA,MAEpE;AAAA,OACF;AAAA,KACF,GACF;AAEJ;AAEA,SAAS,SAAS,EAAE,OAAO,GAAyD;AAClF,UAAQ,QAAQ;AAAA,IACd,KAAK;AACH,aAAO,oBAAC,iBAAc,WAAU,eAAc;AAAA,IAChD,KAAK;AACH,aAAO,oBAAC,eAAY,WAAU,eAAc;AAAA,IAC9C;AACE,aAAO,oBAAC,iBAAc,WAAU,eAAc;AAAA,EAClD;AACF","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport type * as ReactTable from \"@tanstack/react-table\";\nimport { type SortDirection } from \"@tanstack/react-table\";\nimport {\n ArrowDownIcon,\n ArrowUpIcon,\n CaretSortIcon,\n ChevronLeftIcon,\n ChevronRightIcon,\n DoubleArrowLeftIcon,\n DoubleArrowRightIcon,\n EyeNoneIcon,\n MixerHorizontalIcon,\n} from \"@radix-ui/react-icons\";\nimport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from \"./dropdown-menu\";\nimport { Button } from \"./button\";\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from \"./select\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: DataTableViewOptions\n * -------------------------------------------------------------------------- */\n\ninterface DataTableViewOptionsProps<TData> {\n table: ReactTable.Table<TData>;\n}\n\nfunction DataTableViewOptions<TData>({ table }: DataTableViewOptionsProps<TData>): React.JSX.Element {\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button variant=\"outline\" size=\"sm\" className=\"ml-auto hidden h-8 lg:flex\">\n <MixerHorizontalIcon className=\"mr-2 size-4\" />\n View\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-36\">\n <DropdownMenuLabel>Toggle columns</DropdownMenuLabel>\n <DropdownMenuSeparator />\n {table\n .getAllColumns()\n .filter((column) => typeof column.accessorFn !== \"undefined\" && column.getCanHide())\n .map((column) => {\n return (\n <DropdownMenuCheckboxItem\n key={column.id}\n className=\"capitalize\"\n checked={column.getIsVisible()}\n onCheckedChange={(value) => {\n column.toggleVisibility(Boolean(value));\n }}\n >\n {column.id}\n </DropdownMenuCheckboxItem>\n );\n })}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DataTablePagination\n * -------------------------------------------------------------------------- */\n\ninterface DataTablePaginationProps<TData> extends React.HTMLAttributes<HTMLDivElement> {\n table: ReactTable.Table<TData>;\n}\n\nfunction DataTablePagination<TData>({\n table,\n className,\n ...props\n}: DataTablePaginationProps<TData>): React.JSX.Element {\n return (\n <div className={cn(\"flex items-center justify-between px-2\", className)} {...props}>\n <div className=\"text-muted-foreground flex-1 text-sm\">\n {table.getFilteredSelectedRowModel().rows.length} of {table.getFilteredRowModel().rows.length} row(s) selected.\n </div>\n <div className=\"flex items-center space-x-6 lg:space-x-8\">\n <div className=\"flex items-center space-x-2\">\n <p className=\"text-sm font-medium\">Rows per page</p>\n <Select\n value={String(table.getState().pagination.pageSize)}\n onValueChange={(value) => {\n table.setPageSize(Number(value));\n }}\n >\n <SelectTrigger className=\"h-8 w-16\">\n <SelectValue placeholder={table.getState().pagination.pageSize} />\n </SelectTrigger>\n <SelectContent side=\"top\">\n {[10, 20, 30, 40, 50].map((pageSize) => (\n <SelectItem key={pageSize} value={String(pageSize)}>\n {pageSize}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div className=\"flex w-28 items-center justify-center text-sm font-medium\">\n Page {table.getState().pagination.pageIndex + 1} of {table.getPageCount()}\n </div>\n <div className=\"flex items-center space-x-2\">\n <Button\n variant=\"outline\"\n size=\"icon-xs\"\n className=\"hidden lg:flex\"\n onClick={() => {\n table.setPageIndex(0);\n }}\n disabled={!table.getCanPreviousPage()}\n >\n <span className=\"sr-only\">Go to first page</span>\n <DoubleArrowLeftIcon className=\"size-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"icon-xs\"\n onClick={() => {\n table.previousPage();\n }}\n disabled={!table.getCanPreviousPage()}\n >\n <span className=\"sr-only\">Go to previous page</span>\n <ChevronLeftIcon className=\"size-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"icon-xs\"\n onClick={() => {\n table.nextPage();\n }}\n disabled={!table.getCanNextPage()}\n >\n <span className=\"sr-only\">Go to next page</span>\n <ChevronRightIcon className=\"size-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"icon-xs\"\n className=\"hidden lg:flex\"\n onClick={() => {\n table.setPageIndex(table.getPageCount() - 1);\n }}\n disabled={!table.getCanNextPage()}\n >\n <span className=\"sr-only\">Go to last page</span>\n <DoubleArrowRightIcon className=\"size-4\" />\n </Button>\n </div>\n </div>\n </div>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DataTableColumnHeader\n * -------------------------------------------------------------------------- */\n\ninterface DataTableColumnHeaderProps<TData, TValue> extends React.HTMLAttributes<HTMLDivElement> {\n column: ReactTable.Column<TData, TValue>;\n title: string;\n}\n\nfunction DataTableColumnHeader<TData, TValue>({\n column,\n title,\n className,\n}: DataTableColumnHeaderProps<TData, TValue>): React.JSX.Element {\n if (!column.getCanSort()) {\n return <div className={className}>{title}</div>;\n }\n\n return (\n <div className={cn(\"flex items-center space-x-2\", className)}>\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button variant=\"ghost\" size=\"xs\" className=\"data-[state=open]:bg-accent -ml-3\">\n <span>{title}</span>\n <SortIcon sorted={column.getIsSorted()} />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"start\">\n <DropdownMenuItem\n onClick={() => {\n column.toggleSorting(false);\n }}\n >\n <ArrowUpIcon className=\"text-muted-foreground/70 mr-2 size-3.5\" />\n Asc\n </DropdownMenuItem>\n <DropdownMenuItem\n onClick={() => {\n column.toggleSorting(true);\n }}\n >\n <ArrowDownIcon className=\"text-muted-foreground/70 mr-2 size-3.5\" />\n Desc\n </DropdownMenuItem>\n <DropdownMenuSeparator />\n <DropdownMenuItem\n onClick={() => {\n column.toggleVisibility(false);\n }}\n >\n <EyeNoneIcon className=\"text-muted-foreground/70 mr-2 size-3.5\" />\n Hide\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </div>\n );\n}\n\nfunction SortIcon({ sorted }: { sorted: false | SortDirection }): React.JSX.Element {\n switch (sorted) {\n case \"desc\":\n return <ArrowDownIcon className=\"ml-2 size-4\" />;\n case \"asc\":\n return <ArrowUpIcon className=\"ml-2 size-4\" />;\n default:\n return <CaretSortIcon className=\"ml-2 size-4\" />;\n }\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n DataTableViewOptions,\n DataTablePagination,\n DataTableColumnHeader,\n type DataTableViewOptionsProps,\n type DataTablePaginationProps,\n type DataTableColumnHeaderProps,\n};\n"]}