@ngrok/mantle 0.14.2 → 0.15.0

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 (37) hide show
  1. package/dist/accordion.d.ts +15 -0
  2. package/dist/accordion.js +2 -0
  3. package/dist/accordion.js.map +1 -0
  4. package/dist/alert-dialog.js +1 -1
  5. package/dist/alert-dialog.js.map +1 -1
  6. package/dist/button.js +1 -1
  7. package/dist/calendar.js +1 -1
  8. package/dist/calendar.js.map +1 -1
  9. package/dist/chunk-72TJUKMV.js +1 -0
  10. package/dist/chunk-72TJUKMV.js.map +1 -0
  11. package/dist/{chunk-XLFJLMPU.js → chunk-7AUDKKSM.js} +2 -2
  12. package/dist/{chunk-6ZEJCZAD.js → chunk-E6LNHWJ3.js} +2 -2
  13. package/dist/{chunk-25GJN3ZK.js → chunk-L2JX4GJ6.js} +2 -2
  14. package/dist/chunk-SMCZZUU4.js +2 -0
  15. package/dist/dialog.js +1 -1
  16. package/dist/dialog.js.map +1 -1
  17. package/dist/icon-uC5dwP06.d.ts +22 -0
  18. package/dist/icon.d.ts +2 -18
  19. package/dist/icon.js +1 -1
  20. package/dist/input.js +1 -1
  21. package/dist/pagination.js +1 -1
  22. package/dist/pagination.js.map +1 -1
  23. package/dist/radio-group.js +1 -1
  24. package/dist/radio-group.js.map +1 -1
  25. package/dist/select.js +1 -1
  26. package/dist/sheet.js +1 -1
  27. package/dist/sheet.js.map +1 -1
  28. package/dist/tailwind-preset.cjs +1 -1
  29. package/dist/tailwind-preset.cjs.map +1 -1
  30. package/dist/tailwind-preset.js +1 -1
  31. package/dist/tailwind-preset.js.map +1 -1
  32. package/package.json +10 -4
  33. package/dist/chunk-PMSTRJK7.js +0 -2
  34. /package/dist/{chunk-XLFJLMPU.js.map → chunk-7AUDKKSM.js.map} +0 -0
  35. /package/dist/{chunk-6ZEJCZAD.js.map → chunk-E6LNHWJ3.js.map} +0 -0
  36. /package/dist/{chunk-25GJN3ZK.js.map → chunk-L2JX4GJ6.js.map} +0 -0
  37. /package/dist/{chunk-PMSTRJK7.js.map → chunk-SMCZZUU4.js.map} +0 -0
@@ -0,0 +1,15 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as react from 'react';
3
+ import { ComponentPropsWithoutRef } from 'react';
4
+ import * as AccordionPrimitive from '@radix-ui/react-accordion';
5
+ import { I as IconProps } from './icon-uC5dwP06.js';
6
+ import './types-BuKAGhC-.js';
7
+
8
+ declare const Accordion: react.ForwardRefExoticComponent<ComponentPropsWithoutRef<react.ForwardRefExoticComponent<(AccordionPrimitive.AccordionSingleProps | AccordionPrimitive.AccordionMultipleProps) & react.RefAttributes<HTMLDivElement>>> & react.RefAttributes<HTMLDivElement>>;
9
+ declare const AccordionItem: react.ForwardRefExoticComponent<AccordionPrimitive.AccordionItemProps & react.RefAttributes<HTMLDivElement>>;
10
+ declare const AccordionHeading: react.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionHeaderProps & react.RefAttributes<HTMLHeadingElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
11
+ declare const AccordionTrigger: react.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionTriggerProps & react.RefAttributes<HTMLButtonElement>, "ref"> & react.RefAttributes<HTMLButtonElement>>;
12
+ declare const AccordionTriggerIcon: ({ className, ...props }: Omit<IconProps, "svg">) => react_jsx_runtime.JSX.Element;
13
+ declare const AccordionContent: react.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
14
+
15
+ export { Accordion, AccordionContent, AccordionHeading, AccordionItem, AccordionTrigger, AccordionTriggerIcon };
@@ -0,0 +1,2 @@
1
+ import{a as m}from"./chunk-SMCZZUU4.js";import"./chunk-VJPVAY5J.js";import{a as r}from"./chunk-EW5CFGXT.js";import{CaretDown as g}from"@phosphor-icons/react/CaretDown";import*as o from"@radix-ui/react-accordion";import{forwardRef as n}from"react";import{jsx as c}from"react/jsx-runtime";var a=n(({className:e,...i},t)=>c(o.Root,{ref:t,className:r("w-full space-y-2.5",e),...i}));a.displayName="Accordion";var p=o.Item;p.displayName="AccordionItem";var s=n(({className:e,...i},t)=>c(o.Header,{ref:t,className:r("flex items-center gap-2",e),...i}));s.displayName="AccordionHeading";var f=n(({className:e,children:i,...t},d)=>c(o.Trigger,{ref:d,className:r("group flex items-center gap-1.5",e),...t,children:i}));f.displayName="AccordionTrigger";var l=({className:e,...i})=>c(m,{...i,svg:c(g,{weight:"fill"}),className:r("group-data-state-open:rotate-0 -rotate-90",e)}),A=n(({className:e,children:i,...t},d)=>c(o.Content,{ref:d,className:r("data-state-closed:animate-accordion-up data-state-open:animate-accordion-down overflow-hidden pt-4",e),...t,children:i}));A.displayName="AccordionContent";export{a as Accordion,A as AccordionContent,s as AccordionHeading,p as AccordionItem,f as AccordionTrigger,l as AccordionTriggerIcon};
2
+ //# sourceMappingURL=accordion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/accordion/accordion.tsx"],"sourcesContent":["\"use client\";\n\nimport { CaretDown } from \"@phosphor-icons/react/CaretDown\";\nimport * as AccordionPrimitive from \"@radix-ui/react-accordion\";\nimport { forwardRef, type ComponentPropsWithoutRef, type ElementRef } from \"react\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport { Icon, type IconProps } from \"../icon/icon.js\";\n\nconst Accordion = forwardRef<ElementRef<\"div\">, ComponentPropsWithoutRef<typeof AccordionPrimitive.Root>>(\n\t({ className, ...props }, ref) => (\n\t\t<AccordionPrimitive.Root ref={ref} className={cx(\"w-full space-y-2.5\", className)} {...props} />\n\t),\n);\nAccordion.displayName = \"Accordion\";\n\nconst AccordionItem = AccordionPrimitive.Item;\nAccordionItem.displayName = \"AccordionItem\";\n\nconst AccordionHeading = forwardRef<ElementRef<\"div\">, ComponentPropsWithoutRef<typeof AccordionPrimitive.Header>>(\n\t({ className, ...props }, ref) => (\n\t\t<AccordionPrimitive.Header ref={ref} className={cx(\"flex items-center gap-2\", className)} {...props} />\n\t),\n);\nAccordionHeading.displayName = \"AccordionHeading\";\n\nconst AccordionTrigger = forwardRef<ElementRef<\"button\">, ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>>(\n\t({ className, children, ...props }, ref) => (\n\t\t<AccordionPrimitive.Trigger ref={ref} className={cx(\"group flex items-center gap-1.5\", className)} {...props}>\n\t\t\t{children}\n\t\t</AccordionPrimitive.Trigger>\n\t),\n);\nAccordionTrigger.displayName = \"AccordionTrigger\";\n\nconst AccordionTriggerIcon = ({ className, ...props }: Omit<IconProps, \"svg\">) => (\n\t<Icon\n\t\t{...props}\n\t\tsvg={<CaretDown weight=\"fill\" />}\n\t\tclassName={cx(\"group-data-state-open:rotate-0 -rotate-90\", className)}\n\t/>\n);\n\nconst AccordionContent = forwardRef<ElementRef<\"div\">, ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>>(\n\t({ className, children, ...props }, ref) => (\n\t\t<AccordionPrimitive.Content\n\t\t\tref={ref}\n\t\t\tclassName={cx(\n\t\t\t\t\"data-state-closed:animate-accordion-up data-state-open:animate-accordion-down overflow-hidden pt-4\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</AccordionPrimitive.Content>\n\t),\n);\nAccordionContent.displayName = \"AccordionContent\";\n\nexport {\n\t//,\n\tAccordion,\n\tAccordionItem,\n\tAccordionTrigger,\n\tAccordionContent,\n\tAccordionHeading,\n\tAccordionTriggerIcon,\n};\n"],"mappings":"4GAEA,OAAS,aAAAA,MAAiB,kCAC1B,UAAYC,MAAwB,4BACpC,OAAS,cAAAC,MAAkE,QAMzE,cAAAC,MAAA,oBAFF,IAAMC,EAAYC,EACjB,CAAC,CAAE,UAAAC,EAAW,GAAGC,CAAM,EAAGC,IACzBL,EAAoB,OAAnB,CAAwB,IAAKK,EAAK,UAAWC,EAAG,qBAAsBH,CAAS,EAAI,GAAGC,EAAO,CAEhG,EACAH,EAAU,YAAc,YAExB,IAAMM,EAAmC,OACzCA,EAAc,YAAc,gBAE5B,IAAMC,EAAmBN,EACxB,CAAC,CAAE,UAAAC,EAAW,GAAGC,CAAM,EAAGC,IACzBL,EAAoB,SAAnB,CAA0B,IAAKK,EAAK,UAAWC,EAAG,0BAA2BH,CAAS,EAAI,GAAGC,EAAO,CAEvG,EACAI,EAAiB,YAAc,mBAE/B,IAAMC,EAAmBP,EACxB,CAAC,CAAE,UAAAC,EAAW,SAAAO,EAAU,GAAGN,CAAM,EAAGC,IACnCL,EAAoB,UAAnB,CAA2B,IAAKK,EAAK,UAAWC,EAAG,kCAAmCH,CAAS,EAAI,GAAGC,EACrG,SAAAM,EACF,CAEF,EACAD,EAAiB,YAAc,mBAE/B,IAAME,EAAuB,CAAC,CAAE,UAAAR,EAAW,GAAGC,CAAM,IACnDJ,EAACY,EAAA,CACC,GAAGR,EACJ,IAAKJ,EAACa,EAAA,CAAU,OAAO,OAAO,EAC9B,UAAWP,EAAG,4CAA6CH,CAAS,EACrE,EAGKW,EAAmBZ,EACxB,CAAC,CAAE,UAAAC,EAAW,SAAAO,EAAU,GAAGN,CAAM,EAAGC,IACnCL,EAAoB,UAAnB,CACA,IAAKK,EACL,UAAWC,EACV,qGACAH,CACD,EACC,GAAGC,EAEH,SAAAM,EACF,CAEF,EACAI,EAAiB,YAAc","names":["CaretDown","AccordionPrimitive","forwardRef","jsx","Accordion","forwardRef","className","props","ref","cx","AccordionItem","AccordionHeading","AccordionTrigger","children","AccordionTriggerIcon","Icon","CaretDown","AccordionContent"]}
@@ -1,2 +1,2 @@
1
- import{b as m}from"./chunk-25GJN3ZK.js";import"./chunk-4LSFAAZW.js";import"./chunk-RDMTCZPT.js";import"./chunk-PMSTRJK7.js";import{a as p}from"./chunk-VJPVAY5J.js";import{a as l}from"./chunk-EW5CFGXT.js";import{Info as h}from"@phosphor-icons/react/Info";import{Warning as B}from"@phosphor-icons/react/Warning";import*as i from"@radix-ui/react-dialog";import{createContext as T,forwardRef as n,useContext as E}from"react";import w from"tiny-invariant";import{jsx as o,jsxs as z}from"react/jsx-runtime";var g=T(null);function c(){let t=E(g);return w(t,"AlertDialog child component used outside of AlertDialog parent!"),t}function d({priority:t,...e}){return o(g.Provider,{value:{priority:t},children:o(i.Root,{...e})})}d.displayName="AlertDialog";var I=i.Trigger,O=i.Portal,f=n(({className:t,...e},r)=>o(i.Overlay,{className:l("data-state-open:animate-in data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:fade-in-0 bg-overlay fixed inset-0 z-50 backdrop-blur-sm",t),...e,ref:r}));f.displayName="AlertDialogOverlay";var D=n(({className:t,...e},r)=>z(O,{children:[o(f,{}),o("div",{className:"fixed inset-4 z-50 flex items-center justify-center",children:o(i.Content,{ref:r,className:l("flex w-full max-w-md flex-1 flex-col items-center gap-4 sm:flex-row sm:items-start","outline-none focus-within:outline-none","p-6","border-dialog bg-dialog rounded-xl border shadow-lg transition-transform duration-200","data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95",t),...e})})]}));D.displayName="AlertDialogContent";var A=({className:t,...e})=>o("div",{className:l("flex-1 space-y-4",t),...e});A.displayName="AlertDialogBody";var y=({className:t,...e})=>o("div",{className:l("flex flex-col space-y-2 text-center sm:text-start",t),...e});y.displayName="AlertDialogHeader";var u=({className:t,...e})=>o("div",{className:l("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});u.displayName="AlertDialogFooter";var P=n(({className:t,...e},r)=>o(i.Title,{ref:r,className:l("text-strong text-center text-xl font-medium sm:text-start sm:text-lg",t),...e}));P.displayName="AlertDialogTitle";var v=n(({className:t,...e},r)=>o(i.Description,{ref:r,className:l("text-body text-center text-base font-normal sm:text-start sm:text-sm",t),...e}));v.displayName="AlertDialogDescription";var x=n(({appearance:t="filled",...e},r)=>{let s=c(),a="default";return s.priority==="danger"&&(a="danger"),o(m,{appearance:t,priority:a,ref:r,...e})});x.displayName="AlertDialogAction";var C=n(({appearance:t="outlined",className:e,priority:r="neutral",...s},a)=>o(i.Close,{asChild:!0,children:o(m,{appearance:t,className:l("mt-2 sm:mt-0",e),priority:r,ref:a,...s})}));C.displayName="AlertDialogCancel";var N=n(({className:t,svg:e,...r},s)=>{let a=c(),R=a.priority==="danger"?"text-danger-600":"text-accent-600",b=a.priority==="danger"?o(B,{}):o(h,{});return o(p,{ref:s,className:l("size-12 sm:size-7",R,t),svg:e??b,...r})});N.displayName="AlertDialogIcon";export{d as AlertDialog,x as AlertDialogAction,A as AlertDialogBody,C as AlertDialogCancel,D as AlertDialogContent,v as AlertDialogDescription,u as AlertDialogFooter,y as AlertDialogHeader,N as AlertDialogIcon,P as AlertDialogTitle,I as AlertDialogTrigger};
1
+ import{b as m}from"./chunk-L2JX4GJ6.js";import"./chunk-4LSFAAZW.js";import"./chunk-RDMTCZPT.js";import"./chunk-72TJUKMV.js";import"./chunk-SMCZZUU4.js";import{a as p}from"./chunk-VJPVAY5J.js";import{a as l}from"./chunk-EW5CFGXT.js";import{Info as h}from"@phosphor-icons/react/Info";import{Warning as B}from"@phosphor-icons/react/Warning";import*as i from"@radix-ui/react-dialog";import{createContext as T,forwardRef as n,useContext as E}from"react";import w from"tiny-invariant";import{jsx as o,jsxs as z}from"react/jsx-runtime";var g=T(null);function c(){let t=E(g);return w(t,"AlertDialog child component used outside of AlertDialog parent!"),t}function d({priority:t,...e}){return o(g.Provider,{value:{priority:t},children:o(i.Root,{...e})})}d.displayName="AlertDialog";var I=i.Trigger,O=i.Portal,f=n(({className:t,...e},r)=>o(i.Overlay,{className:l("data-state-open:animate-in data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:fade-in-0 bg-overlay fixed inset-0 z-50 backdrop-blur-sm",t),...e,ref:r}));f.displayName="AlertDialogOverlay";var D=n(({className:t,...e},r)=>z(O,{children:[o(f,{}),o("div",{className:"fixed inset-4 z-50 flex items-center justify-center",children:o(i.Content,{ref:r,className:l("flex w-full max-w-md flex-1 flex-col items-center gap-4 sm:flex-row sm:items-start","outline-none focus-within:outline-none","p-6","border-dialog bg-dialog rounded-xl border shadow-lg transition-transform duration-200","data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95",t),...e})})]}));D.displayName="AlertDialogContent";var A=({className:t,...e})=>o("div",{className:l("flex-1 space-y-4",t),...e});A.displayName="AlertDialogBody";var y=({className:t,...e})=>o("div",{className:l("flex flex-col space-y-2 text-center sm:text-start",t),...e});y.displayName="AlertDialogHeader";var u=({className:t,...e})=>o("div",{className:l("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});u.displayName="AlertDialogFooter";var P=n(({className:t,...e},r)=>o(i.Title,{ref:r,className:l("text-strong text-center text-xl font-medium sm:text-start sm:text-lg",t),...e}));P.displayName="AlertDialogTitle";var v=n(({className:t,...e},r)=>o(i.Description,{ref:r,className:l("text-body text-center text-base font-normal sm:text-start sm:text-sm",t),...e}));v.displayName="AlertDialogDescription";var x=n(({appearance:t="filled",...e},r)=>{let s=c(),a="default";return s.priority==="danger"&&(a="danger"),o(m,{appearance:t,priority:a,ref:r,...e})});x.displayName="AlertDialogAction";var C=n(({appearance:t="outlined",className:e,priority:r="neutral",...s},a)=>o(i.Close,{asChild:!0,children:o(m,{appearance:t,className:l("mt-2 sm:mt-0",e),priority:r,ref:a,...s})}));C.displayName="AlertDialogCancel";var N=n(({className:t,svg:e,...r},s)=>{let a=c(),R=a.priority==="danger"?"text-danger-600":"text-accent-600",b=a.priority==="danger"?o(B,{}):o(h,{});return o(p,{ref:s,className:l("size-12 sm:size-7",R,t),svg:e??b,...r})});N.displayName="AlertDialogIcon";export{d as AlertDialog,x as AlertDialogAction,A as AlertDialogBody,C as AlertDialogCancel,D as AlertDialogContent,v as AlertDialogDescription,u as AlertDialogFooter,y as AlertDialogHeader,N as AlertDialogIcon,P as AlertDialogTitle,I as AlertDialogTrigger};
2
2
  //# sourceMappingURL=alert-dialog.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/alert-dialog/alert-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { Info } from \"@phosphor-icons/react/Info\";\nimport { Warning } from \"@phosphor-icons/react/Warning\";\nimport * as AlertDialogPrimitive from \"@radix-ui/react-dialog\";\nimport {\n\tcreateContext,\n\tforwardRef,\n\tuseContext,\n\ttype ComponentProps,\n\ttype ComponentPropsWithoutRef,\n\ttype ElementRef,\n\ttype ReactNode,\n} from \"react\";\nimport invariant from \"tiny-invariant\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport { Button, type ButtonPriority, type ButtonProps } from \"../button/button.js\";\nimport { SvgOnly } from \"../icon/svg-only.js\";\nimport type { SvgAttributes } from \"../icon/types.js\";\n\nconst priorities = [\"info\", \"danger\"] as const;\ntype Priority = (typeof priorities)[number];\n\ntype AlertDialogContextValue = {\n\tpriority: Priority;\n};\n\nconst AlertDialogContext = createContext<AlertDialogContextValue | null>(null);\n\nfunction useAlertDialogContext() {\n\tconst context = useContext(AlertDialogContext);\n\tinvariant(context, \"AlertDialog child component used outside of AlertDialog parent!\");\n\treturn context;\n}\n\ntype AlertDialogProps = ComponentProps<typeof AlertDialogPrimitive.Root> & {\n\t/**\n\t * Indicates the importance or impact level of the AlertDialog, affecting its\n\t * color and styling to communicate its purpose to the user.\n\t */\n\tpriority: Priority;\n};\n\n/**\n * The root component for the Alert Dialog\n */\nfunction AlertDialog({ priority, ...props }: AlertDialogProps) {\n\treturn (\n\t\t<AlertDialogContext.Provider value={{ priority }}>\n\t\t\t<AlertDialogPrimitive.Root {...props} />\n\t\t</AlertDialogContext.Provider>\n\t);\n}\nAlertDialog.displayName = \"AlertDialog\";\n\n/**\n * A button that opens the Alert Dialog.\n */\nconst AlertDialogTrigger = AlertDialogPrimitive.Trigger;\n\nconst AlertDialogPortal = AlertDialogPrimitive.Portal;\n\n/**\n * A layer that covers the inert portion of the view when the dialog is open.\n */\nconst AlertDialogOverlay = forwardRef<\n\tElementRef<typeof AlertDialogPrimitive.Overlay>,\n\tComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n\t<AlertDialogPrimitive.Overlay\n\t\tclassName={cx(\n\t\t\t\"data-state-open:animate-in data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:fade-in-0 bg-overlay fixed inset-0 z-50 backdrop-blur-sm\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t\tref={ref}\n\t/>\n));\nAlertDialogOverlay.displayName = \"AlertDialogOverlay\";\n\n/**\n * The popover alert dialog container.\n *\n * Renders on top of the overlay and is centered in the viewport.\n */\nconst AlertDialogContent = forwardRef<\n\tElementRef<typeof AlertDialogPrimitive.Content>,\n\tComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>\n>(({ className, ...props }, ref) => (\n\t<AlertDialogPortal>\n\t\t<AlertDialogOverlay />\n\t\t<div className=\"fixed inset-4 z-50 flex items-center justify-center\">\n\t\t\t<AlertDialogPrimitive.Content\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cx(\n\t\t\t\t\t\"flex w-full max-w-md flex-1 flex-col items-center gap-4 sm:flex-row sm:items-start\",\n\t\t\t\t\t\"outline-none focus-within:outline-none\",\n\t\t\t\t\t\"p-6\",\n\t\t\t\t\t\"border-dialog bg-dialog rounded-xl border shadow-lg transition-transform duration-200\",\n\t\t\t\t\t\"data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</div>\n\t</AlertDialogPortal>\n));\nAlertDialogContent.displayName = \"AlertDialogContent\";\n\n/**\n * Contains the main content of the dialog.\n */\nconst AlertDialogBody = ({ className, ...props }: ComponentProps<\"div\">) => (\n\t<div className={cx(\"flex-1 space-y-4\", className)} {...props} />\n);\nAlertDialogBody.displayName = \"AlertDialogBody\";\n\n/**\n * Contains the header content of the dialog, including the title and description.\n */\nconst AlertDialogHeader = ({ className, ...props }: ComponentProps<\"div\">) => (\n\t<div className={cx(\"flex flex-col space-y-2 text-center sm:text-start\", className)} {...props} />\n);\nAlertDialogHeader.displayName = \"AlertDialogHeader\";\n\n/**\n * Contains the footer content of the dialog, including the action and cancel buttons.\n */\nconst AlertDialogFooter = ({ className, ...props }: ComponentProps<\"div\">) => (\n\t<div className={cx(\"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\", className)} {...props} />\n);\nAlertDialogFooter.displayName = \"AlertDialogFooter\";\n\n/**\n * An accessible name to be announced when the dialog is opened.\n *\n * Alternatively, you can provide `aria-label` or `aria-labelledby` to\n * `AlertDialogContent` and exclude this component.\n */\nconst AlertDialogTitle = forwardRef<\n\tElementRef<typeof AlertDialogPrimitive.Title>,\n\tComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n\t<AlertDialogPrimitive.Title\n\t\tref={ref}\n\t\tclassName={cx(\"text-strong text-center text-xl font-medium sm:text-start sm:text-lg\", className)}\n\t\t{...props}\n\t/>\n));\nAlertDialogTitle.displayName = \"AlertDialogTitle\";\n\n/**\n * An accessible description to be announced when the dialog is opened.\n *\n * Alternatively, you can provide `aria-describedby` to `AlertDialogContent` and\n * exclude this component.\n */\nconst AlertDialogDescription = forwardRef<\n\tElementRef<typeof AlertDialogPrimitive.Description>,\n\tComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n\t<AlertDialogPrimitive.Description\n\t\tref={ref}\n\t\tclassName={cx(\"text-body text-center text-base font-normal sm:text-start sm:text-sm\", className)}\n\t\t{...props}\n\t/>\n));\nAlertDialogDescription.displayName = \"AlertDialogDescription\";\n\n/**\n * A button that confirms the Alert Dialog action.\n * Will default to appearance=\"filled\", as well as the priority color from the `AlertDialog`.\n * Does not close the alert dialog by default.\n *\n * These buttons should be distinguished visually from the AlertDialogCancel button.\n *\n * Composes around the mantle Button component.\n */\nconst AlertDialogAction = forwardRef<ElementRef<\"button\">, ButtonProps>(\n\t(\n\t\t{\n\t\t\t//,\n\t\t\tappearance = \"filled\",\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst ctx = useAlertDialogContext();\n\t\tlet buttonPriority: NonNullable<ButtonPriority> = \"default\";\n\t\tif (ctx.priority === \"danger\") {\n\t\t\tbuttonPriority = \"danger\";\n\t\t}\n\n\t\treturn (\n\t\t\t<Button\n\t\t\t\t//\n\t\t\t\tappearance={appearance}\n\t\t\t\tpriority={buttonPriority}\n\t\t\t\tref={ref}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t},\n);\nAlertDialogAction.displayName = \"AlertDialogAction\";\n\n/**\n * A button that closes the dialog and cancels the action.\n * Will default to appearance=\"outlined\" and priority=\"neutral\".\n *\n * This button should be distinguished visually from AlertDialogAction buttons.\n *\n * Composes around the mantle Button component.\n */\nconst AlertDialogCancel = forwardRef<ElementRef<\"button\">, ButtonProps>(\n\t(\n\t\t{\n\t\t\t//,\n\t\t\tappearance = \"outlined\",\n\t\t\tclassName,\n\t\t\tpriority = \"neutral\",\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => (\n\t\t<AlertDialogPrimitive.Close asChild>\n\t\t\t<Button\n\t\t\t\tappearance={appearance}\n\t\t\t\tclassName={cx(\"mt-2 sm:mt-0\", className)}\n\t\t\t\tpriority={priority}\n\t\t\t\tref={ref}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</AlertDialogPrimitive.Close>\n\t),\n);\nAlertDialogCancel.displayName = \"AlertDialogCancel\";\n\ntype AlertDialogIconProps = Omit<SvgAttributes, \"children\"> & {\n\tsvg?: ReactNode;\n};\n\n/**\n * An icon that visually represents the priority of the AlertDialog.\n *\n * Defaults to a warning icon for danger priority and an info icon for info\n * priority with the appropriate color.\n *\n * Can be overridden with a custom icon using the `svg` prop.\n */\nconst AlertDialogIcon = forwardRef<ElementRef<\"svg\">, AlertDialogIconProps>(({ className, svg, ...props }, ref) => {\n\tconst ctx = useAlertDialogContext();\n\tconst defaultColor = ctx.priority === \"danger\" ? \"text-danger-600\" : \"text-accent-600\";\n\tconst defaultIcon = ctx.priority === \"danger\" ? <Warning /> : <Info />;\n\n\treturn (\n\t\t<SvgOnly\n\t\t\tref={ref}\n\t\t\tclassName={cx(\"size-12 sm:size-7\", defaultColor, className)}\n\t\t\tsvg={svg ?? defaultIcon}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\nAlertDialogIcon.displayName = \"AlertDialogIcon\";\n\nexport {\n\t//,\n\tAlertDialog,\n\tAlertDialogAction,\n\tAlertDialogBody,\n\tAlertDialogCancel,\n\tAlertDialogContent,\n\tAlertDialogDescription,\n\tAlertDialogFooter,\n\tAlertDialogHeader,\n\tAlertDialogIcon,\n\tAlertDialogTitle,\n\tAlertDialogTrigger,\n};\n"],"mappings":"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","names":["Info","Warning","AlertDialogPrimitive","createContext","forwardRef","useContext","invariant","jsx","jsxs","AlertDialogContext","createContext","useAlertDialogContext","context","useContext","invariant","AlertDialog","priority","props","jsx","AlertDialogTrigger","AlertDialogPortal","AlertDialogOverlay","forwardRef","className","ref","cx","AlertDialogContent","jsxs","AlertDialogBody","AlertDialogHeader","AlertDialogFooter","AlertDialogTitle","AlertDialogDescription","AlertDialogAction","appearance","ctx","buttonPriority","Button","AlertDialogCancel","AlertDialogIcon","svg","defaultColor","defaultIcon","Warning","Info","SvgOnly"]}
1
+ {"version":3,"sources":["../src/components/alert-dialog/alert-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { Info } from \"@phosphor-icons/react/Info\";\nimport { Warning } from \"@phosphor-icons/react/Warning\";\nimport * as AlertDialogPrimitive from \"@radix-ui/react-dialog\";\nimport {\n\tcreateContext,\n\tforwardRef,\n\tuseContext,\n\ttype ComponentProps,\n\ttype ComponentPropsWithoutRef,\n\ttype ElementRef,\n\ttype ReactNode,\n} from \"react\";\nimport invariant from \"tiny-invariant\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport { Button, type ButtonPriority, type ButtonProps } from \"../button/button.js\";\nimport { SvgOnly } from \"../icon/svg-only.js\";\nimport type { SvgAttributes } from \"../icon/types.js\";\n\nconst priorities = [\"info\", \"danger\"] as const;\ntype Priority = (typeof priorities)[number];\n\ntype AlertDialogContextValue = {\n\tpriority: Priority;\n};\n\nconst AlertDialogContext = createContext<AlertDialogContextValue | null>(null);\n\nfunction useAlertDialogContext() {\n\tconst context = useContext(AlertDialogContext);\n\tinvariant(context, \"AlertDialog child component used outside of AlertDialog parent!\");\n\treturn context;\n}\n\ntype AlertDialogProps = ComponentProps<typeof AlertDialogPrimitive.Root> & {\n\t/**\n\t * Indicates the importance or impact level of the AlertDialog, affecting its\n\t * color and styling to communicate its purpose to the user.\n\t */\n\tpriority: Priority;\n};\n\n/**\n * The root component for the Alert Dialog\n */\nfunction AlertDialog({ priority, ...props }: AlertDialogProps) {\n\treturn (\n\t\t<AlertDialogContext.Provider value={{ priority }}>\n\t\t\t<AlertDialogPrimitive.Root {...props} />\n\t\t</AlertDialogContext.Provider>\n\t);\n}\nAlertDialog.displayName = \"AlertDialog\";\n\n/**\n * A button that opens the Alert Dialog.\n */\nconst AlertDialogTrigger = AlertDialogPrimitive.Trigger;\n\nconst AlertDialogPortal = AlertDialogPrimitive.Portal;\n\n/**\n * A layer that covers the inert portion of the view when the dialog is open.\n */\nconst AlertDialogOverlay = forwardRef<\n\tElementRef<typeof AlertDialogPrimitive.Overlay>,\n\tComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n\t<AlertDialogPrimitive.Overlay\n\t\tclassName={cx(\n\t\t\t\"data-state-open:animate-in data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:fade-in-0 bg-overlay fixed inset-0 z-50 backdrop-blur-sm\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t\tref={ref}\n\t/>\n));\nAlertDialogOverlay.displayName = \"AlertDialogOverlay\";\n\n/**\n * The popover alert dialog container.\n *\n * Renders on top of the overlay and is centered in the viewport.\n */\nconst AlertDialogContent = forwardRef<\n\tElementRef<typeof AlertDialogPrimitive.Content>,\n\tComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>\n>(({ className, ...props }, ref) => (\n\t<AlertDialogPortal>\n\t\t<AlertDialogOverlay />\n\t\t<div className=\"fixed inset-4 z-50 flex items-center justify-center\">\n\t\t\t<AlertDialogPrimitive.Content\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cx(\n\t\t\t\t\t\"flex w-full max-w-md flex-1 flex-col items-center gap-4 sm:flex-row sm:items-start\",\n\t\t\t\t\t\"outline-none focus-within:outline-none\",\n\t\t\t\t\t\"p-6\",\n\t\t\t\t\t\"border-dialog bg-dialog rounded-xl border shadow-lg transition-transform duration-200\",\n\t\t\t\t\t\"data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</div>\n\t</AlertDialogPortal>\n));\nAlertDialogContent.displayName = \"AlertDialogContent\";\n\n/**\n * Contains the main content of the dialog.\n */\nconst AlertDialogBody = ({ className, ...props }: ComponentProps<\"div\">) => (\n\t<div className={cx(\"flex-1 space-y-4\", className)} {...props} />\n);\nAlertDialogBody.displayName = \"AlertDialogBody\";\n\n/**\n * Contains the header content of the dialog, including the title and description.\n */\nconst AlertDialogHeader = ({ className, ...props }: ComponentProps<\"div\">) => (\n\t<div className={cx(\"flex flex-col space-y-2 text-center sm:text-start\", className)} {...props} />\n);\nAlertDialogHeader.displayName = \"AlertDialogHeader\";\n\n/**\n * Contains the footer content of the dialog, including the action and cancel buttons.\n */\nconst AlertDialogFooter = ({ className, ...props }: ComponentProps<\"div\">) => (\n\t<div className={cx(\"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\", className)} {...props} />\n);\nAlertDialogFooter.displayName = \"AlertDialogFooter\";\n\n/**\n * An accessible name to be announced when the dialog is opened.\n *\n * Alternatively, you can provide `aria-label` or `aria-labelledby` to\n * `AlertDialogContent` and exclude this component.\n */\nconst AlertDialogTitle = forwardRef<\n\tElementRef<typeof AlertDialogPrimitive.Title>,\n\tComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n\t<AlertDialogPrimitive.Title\n\t\tref={ref}\n\t\tclassName={cx(\"text-strong text-center text-xl font-medium sm:text-start sm:text-lg\", className)}\n\t\t{...props}\n\t/>\n));\nAlertDialogTitle.displayName = \"AlertDialogTitle\";\n\n/**\n * An accessible description to be announced when the dialog is opened.\n *\n * Alternatively, you can provide `aria-describedby` to `AlertDialogContent` and\n * exclude this component.\n */\nconst AlertDialogDescription = forwardRef<\n\tElementRef<typeof AlertDialogPrimitive.Description>,\n\tComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n\t<AlertDialogPrimitive.Description\n\t\tref={ref}\n\t\tclassName={cx(\"text-body text-center text-base font-normal sm:text-start sm:text-sm\", className)}\n\t\t{...props}\n\t/>\n));\nAlertDialogDescription.displayName = \"AlertDialogDescription\";\n\n/**\n * A button that confirms the Alert Dialog action.\n * Will default to appearance=\"filled\", as well as the priority color from the `AlertDialog`.\n * Does not close the alert dialog by default.\n *\n * These buttons should be distinguished visually from the AlertDialogCancel button.\n *\n * Composes around the mantle Button component.\n */\nconst AlertDialogAction = forwardRef<ElementRef<\"button\">, ButtonProps>(\n\t(\n\t\t{\n\t\t\t//,\n\t\t\tappearance = \"filled\",\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst ctx = useAlertDialogContext();\n\t\tlet buttonPriority: NonNullable<ButtonPriority> = \"default\";\n\t\tif (ctx.priority === \"danger\") {\n\t\t\tbuttonPriority = \"danger\";\n\t\t}\n\n\t\treturn (\n\t\t\t<Button\n\t\t\t\t//\n\t\t\t\tappearance={appearance}\n\t\t\t\tpriority={buttonPriority}\n\t\t\t\tref={ref}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t},\n);\nAlertDialogAction.displayName = \"AlertDialogAction\";\n\n/**\n * A button that closes the dialog and cancels the action.\n * Will default to appearance=\"outlined\" and priority=\"neutral\".\n *\n * This button should be distinguished visually from AlertDialogAction buttons.\n *\n * Composes around the mantle Button component.\n */\nconst AlertDialogCancel = forwardRef<ElementRef<\"button\">, ButtonProps>(\n\t(\n\t\t{\n\t\t\t//,\n\t\t\tappearance = \"outlined\",\n\t\t\tclassName,\n\t\t\tpriority = \"neutral\",\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => (\n\t\t<AlertDialogPrimitive.Close asChild>\n\t\t\t<Button\n\t\t\t\tappearance={appearance}\n\t\t\t\tclassName={cx(\"mt-2 sm:mt-0\", className)}\n\t\t\t\tpriority={priority}\n\t\t\t\tref={ref}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</AlertDialogPrimitive.Close>\n\t),\n);\nAlertDialogCancel.displayName = \"AlertDialogCancel\";\n\ntype AlertDialogIconProps = Omit<SvgAttributes, \"children\"> & {\n\tsvg?: ReactNode;\n};\n\n/**\n * An icon that visually represents the priority of the AlertDialog.\n *\n * Defaults to a warning icon for danger priority and an info icon for info\n * priority with the appropriate color.\n *\n * Can be overridden with a custom icon using the `svg` prop.\n */\nconst AlertDialogIcon = forwardRef<ElementRef<\"svg\">, AlertDialogIconProps>(({ className, svg, ...props }, ref) => {\n\tconst ctx = useAlertDialogContext();\n\tconst defaultColor = ctx.priority === \"danger\" ? \"text-danger-600\" : \"text-accent-600\";\n\tconst defaultIcon = ctx.priority === \"danger\" ? <Warning /> : <Info />;\n\n\treturn (\n\t\t<SvgOnly\n\t\t\tref={ref}\n\t\t\tclassName={cx(\"size-12 sm:size-7\", defaultColor, className)}\n\t\t\tsvg={svg ?? defaultIcon}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\nAlertDialogIcon.displayName = \"AlertDialogIcon\";\n\nexport {\n\t//,\n\tAlertDialog,\n\tAlertDialogAction,\n\tAlertDialogBody,\n\tAlertDialogCancel,\n\tAlertDialogContent,\n\tAlertDialogDescription,\n\tAlertDialogFooter,\n\tAlertDialogHeader,\n\tAlertDialogIcon,\n\tAlertDialogTitle,\n\tAlertDialogTrigger,\n};\n"],"mappings":"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","names":["Info","Warning","AlertDialogPrimitive","createContext","forwardRef","useContext","invariant","jsx","jsxs","AlertDialogContext","createContext","useAlertDialogContext","context","useContext","invariant","AlertDialog","priority","props","jsx","AlertDialogTrigger","AlertDialogPortal","AlertDialogOverlay","forwardRef","className","ref","cx","AlertDialogContent","jsxs","AlertDialogBody","AlertDialogHeader","AlertDialogFooter","AlertDialogTitle","AlertDialogDescription","AlertDialogAction","appearance","ctx","buttonPriority","Button","AlertDialogCancel","AlertDialogIcon","svg","defaultColor","defaultIcon","Warning","Info","SvgOnly"]}
package/dist/button.js CHANGED
@@ -1,2 +1,2 @@
1
- import{a as c}from"./chunk-VTEPKCRP.js";import{a as b}from"./chunk-XLFJLMPU.js";import{b as a}from"./chunk-25GJN3ZK.js";import"./chunk-4LSFAAZW.js";import"./chunk-RDMTCZPT.js";import"./chunk-PMSTRJK7.js";import"./chunk-VJPVAY5J.js";import"./chunk-EW5CFGXT.js";export{a as Button,c as ButtonGroup,b as IconButton};
1
+ import{a as c}from"./chunk-VTEPKCRP.js";import{a as b}from"./chunk-7AUDKKSM.js";import{b as a}from"./chunk-L2JX4GJ6.js";import"./chunk-4LSFAAZW.js";import"./chunk-RDMTCZPT.js";import"./chunk-72TJUKMV.js";import"./chunk-SMCZZUU4.js";import"./chunk-VJPVAY5J.js";import"./chunk-EW5CFGXT.js";export{a as Button,c as ButtonGroup,b as IconButton};
2
2
  //# sourceMappingURL=button.js.map
package/dist/calendar.js CHANGED
@@ -1,2 +1,2 @@
1
- import{a as d}from"./chunk-25GJN3ZK.js";import"./chunk-4LSFAAZW.js";import"./chunk-RDMTCZPT.js";import"./chunk-PMSTRJK7.js";import"./chunk-VJPVAY5J.js";import{a as e}from"./chunk-EW5CFGXT.js";import{CaretLeft as s}from"@phosphor-icons/react/dist/icons/CaretLeft";import{CaretRight as i}from"@phosphor-icons/react/dist/icons/CaretRight";import{DayPicker as c}from"react-day-picker";import{jsx as t}from"react/jsx-runtime";function r({className:o,classNames:n,showOutsideDays:l=!1,...a}){return t(c,{showOutsideDays:l,className:e("",o),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"flex items-center",nav_button:e(d({appearance:"ghost",priority:"neutral"}),"sm:h-7 sm:w-7 h-7 w-7"),nav_button_previous:"absolute left-0",nav_button_next:"absolute right-0",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-body w-7 text-[0.8rem] text-center font-normal",row:"flex w-full mt-1",cell:e("overflow-hidden text-center text-sm p-0 relative focus-within:relative focus-within:z-20 sm:h-7 sm:w-7 h-7 w-7 ",a.mode==="range"?"first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":""),day:"day size-full rounded-md [&:not([aria-selected],_[disabled])]:hover:bg-filled-accent/15",day_range_start:"day-range-start [&:not(.day-range-end)]:rounded-r-none",day_range_end:"day-range-end [&:not(.day-range-start)]:rounded-l-none",day_selected:"[&:not([disabled])]:bg-filled-accent text-on-filled [&:not([disabled])]:hover:bg-filled-accent",day_today:"[&:not([aria-selected],_[disabled])]:text-accent-600 font-medium [&:not([aria-selected],_[disabled])]:bg-filled-accent/10",day_outside:"day-outside aria-selected:text-on-filled opacity-50 text-muted",day_disabled:"text-muted opacity-50",day_range_middle:"day-range-middle [&:not([disabled])]:aria-selected:bg-filled-accent/15 aria-selected:text-strong rounded-none [&:not([disabled])]:aria-selected:hover:bg-filled-accent/25",day_hidden:"invisible",...n},components:{IconLeft:()=>t(s,{className:"h-4 w-4 shrink-0",weight:"bold"}),IconRight:()=>t(i,{className:"h-4 w-4 shrink-0",weight:"bold"})},...a})}r.displayName="Calendar";export{r as Calendar};
1
+ import{a as d}from"./chunk-L2JX4GJ6.js";import"./chunk-4LSFAAZW.js";import"./chunk-RDMTCZPT.js";import"./chunk-72TJUKMV.js";import"./chunk-SMCZZUU4.js";import"./chunk-VJPVAY5J.js";import{a as e}from"./chunk-EW5CFGXT.js";import{CaretLeft as s}from"@phosphor-icons/react/dist/icons/CaretLeft";import{CaretRight as i}from"@phosphor-icons/react/dist/icons/CaretRight";import{DayPicker as c}from"react-day-picker";import{jsx as t}from"react/jsx-runtime";function r({className:o,classNames:n,showOutsideDays:l=!1,...a}){return t(c,{showOutsideDays:l,className:e("",o),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"flex items-center",nav_button:e(d({appearance:"ghost",priority:"neutral"}),"sm:h-7 sm:w-7 h-7 w-7"),nav_button_previous:"absolute left-0",nav_button_next:"absolute right-0",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-body w-7 text-[0.8rem] text-center font-normal",row:"flex w-full mt-1",cell:e("overflow-hidden text-center text-sm p-0 relative focus-within:relative focus-within:z-20 sm:h-7 sm:w-7 h-7 w-7 ",a.mode==="range"?"first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":""),day:"day size-full rounded-md [&:not([aria-selected],_[disabled])]:hover:bg-filled-accent/15",day_range_start:"day-range-start [&:not(.day-range-end)]:rounded-r-none",day_range_end:"day-range-end [&:not(.day-range-start)]:rounded-l-none",day_selected:"[&:not([disabled])]:bg-filled-accent text-on-filled [&:not([disabled])]:hover:bg-filled-accent",day_today:"[&:not([aria-selected],_[disabled])]:text-accent-600 font-medium [&:not([aria-selected],_[disabled])]:bg-filled-accent/10",day_outside:"day-outside aria-selected:text-on-filled opacity-50 text-muted",day_disabled:"text-muted opacity-50",day_range_middle:"day-range-middle [&:not([disabled])]:aria-selected:bg-filled-accent/15 aria-selected:text-strong rounded-none [&:not([disabled])]:aria-selected:hover:bg-filled-accent/25",day_hidden:"invisible",...n},components:{IconLeft:()=>t(s,{className:"h-4 w-4 shrink-0",weight:"bold"}),IconRight:()=>t(i,{className:"h-4 w-4 shrink-0",weight:"bold"})},...a})}r.displayName="Calendar";export{r as Calendar};
2
2
  //# sourceMappingURL=calendar.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/calendar/calendar.tsx"],"sourcesContent":["import { CaretLeft } from \"@phosphor-icons/react/dist/icons/CaretLeft\";\nimport { CaretRight } from \"@phosphor-icons/react/dist/icons/CaretRight\";\nimport type { ComponentProps } from \"react\";\nimport { DayPicker } from \"react-day-picker\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport { buttonVariants } from \"../button/button.js\";\n\ntype CalendarProps = ComponentProps<typeof DayPicker>;\n\n/**\n * A calendar component that allows users to select a date or a range of dates.\n *\n * @preview This component is in `preview` mode which means the API is not stable and may change.\n * There may also be bugs! Please file an issue if you find any! <3\n *\n * https://github.com/ngrok-oss/mantle/issues\n */\nfunction Calendar({ className, classNames, showOutsideDays = false, ...props }: CalendarProps) {\n\treturn (\n\t\t<DayPicker\n\t\t\tshowOutsideDays={showOutsideDays}\n\t\t\tclassName={cx(\"\", className)}\n\t\t\tclassNames={{\n\t\t\t\tmonths: \"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0\",\n\t\t\t\tmonth: \"space-y-4\",\n\t\t\t\tcaption: \"flex justify-center pt-1 relative items-center\",\n\t\t\t\tcaption_label: \"text-sm font-medium\",\n\t\t\t\tnav: \"flex items-center\",\n\t\t\t\tnav_button: cx(buttonVariants({ appearance: \"ghost\", priority: \"neutral\" }), \"sm:h-7 sm:w-7 h-7 w-7\"),\n\t\t\t\tnav_button_previous: \"absolute left-0\",\n\t\t\t\tnav_button_next: \"absolute right-0\",\n\t\t\t\ttable: \"w-full border-collapse space-y-1\",\n\t\t\t\thead_row: \"flex\",\n\t\t\t\thead_cell: \"text-body w-7 text-[0.8rem] text-center font-normal\",\n\t\t\t\trow: \"flex w-full mt-1\",\n\t\t\t\tcell: cx(\n\t\t\t\t\t\"overflow-hidden text-center text-sm p-0 relative focus-within:relative focus-within:z-20 sm:h-7 sm:w-7 h-7 w-7 \",\n\t\t\t\t\tprops.mode === \"range\"\n\t\t\t\t\t\t? \"first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md\"\n\t\t\t\t\t\t: \"\",\n\t\t\t\t),\n\t\t\t\tday: \"day size-full rounded-md [&:not([aria-selected],_[disabled])]:hover:bg-filled-accent/15\",\n\t\t\t\tday_range_start: \"day-range-start [&:not(.day-range-end)]:rounded-r-none\",\n\t\t\t\tday_range_end: \"day-range-end [&:not(.day-range-start)]:rounded-l-none\",\n\t\t\t\tday_selected: \"[&:not([disabled])]:bg-filled-accent text-on-filled [&:not([disabled])]:hover:bg-filled-accent\",\n\t\t\t\tday_today:\n\t\t\t\t\t\"[&:not([aria-selected],_[disabled])]:text-accent-600 font-medium [&:not([aria-selected],_[disabled])]:bg-filled-accent/10\",\n\t\t\t\tday_outside: \"day-outside aria-selected:text-on-filled opacity-50 text-muted\",\n\t\t\t\tday_disabled: \"text-muted opacity-50\",\n\t\t\t\tday_range_middle:\n\t\t\t\t\t\"day-range-middle [&:not([disabled])]:aria-selected:bg-filled-accent/15 aria-selected:text-strong rounded-none [&:not([disabled])]:aria-selected:hover:bg-filled-accent/25\",\n\t\t\t\tday_hidden: \"invisible\",\n\t\t\t\t...classNames,\n\t\t\t}}\n\t\t\tcomponents={{\n\t\t\t\tIconLeft: () => <CaretLeft className=\"h-4 w-4 shrink-0\" weight=\"bold\" />,\n\t\t\t\tIconRight: () => <CaretRight className=\"h-4 w-4 shrink-0\" weight=\"bold\" />,\n\t\t\t}}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\nCalendar.displayName = \"Calendar\";\n\nexport {\n\t//,\n\tCalendar,\n};\n\nexport type {\n\t//,\n\tCalendarProps,\n};\n"],"mappings":"gMAAA,OAAS,aAAAA,MAAiB,6CAC1B,OAAS,cAAAC,MAAkB,8CAE3B,OAAS,aAAAC,MAAiB,mBAoDN,cAAAC,MAAA,oBAtCpB,SAASC,EAAS,CAAE,UAAAC,EAAW,WAAAC,EAAY,gBAAAC,EAAkB,GAAO,GAAGC,CAAM,EAAkB,CAC9F,OACCL,EAACM,EAAA,CACA,gBAAiBF,EACjB,UAAWG,EAAG,GAAIL,CAAS,EAC3B,WAAY,CACX,OAAQ,gEACR,MAAO,YACP,QAAS,iDACT,cAAe,sBACf,IAAK,oBACL,WAAYK,EAAGC,EAAe,CAAE,WAAY,QAAS,SAAU,SAAU,CAAC,EAAG,uBAAuB,EACpG,oBAAqB,kBACrB,gBAAiB,mBACjB,MAAO,mCACP,SAAU,OACV,UAAW,sDACX,IAAK,mBACL,KAAMD,EACL,kHACAF,EAAM,OAAS,QACZ,yFACA,EACJ,EACA,IAAK,0FACL,gBAAiB,yDACjB,cAAe,yDACf,aAAc,iGACd,UACC,4HACD,YAAa,iEACb,aAAc,wBACd,iBACC,4KACD,WAAY,YACZ,GAAGF,CACJ,EACA,WAAY,CACX,SAAU,IAAMH,EAACS,EAAA,CAAU,UAAU,mBAAmB,OAAO,OAAO,EACtE,UAAW,IAAMT,EAACU,EAAA,CAAW,UAAU,mBAAmB,OAAO,OAAO,CACzE,EACC,GAAGL,EACL,CAEF,CACAJ,EAAS,YAAc","names":["CaretLeft","CaretRight","DayPicker","jsx","Calendar","className","classNames","showOutsideDays","props","DayPicker","cx","buttonVariants","CaretLeft","CaretRight"]}
1
+ {"version":3,"sources":["../src/components/calendar/calendar.tsx"],"sourcesContent":["import { CaretLeft } from \"@phosphor-icons/react/dist/icons/CaretLeft\";\nimport { CaretRight } from \"@phosphor-icons/react/dist/icons/CaretRight\";\nimport type { ComponentProps } from \"react\";\nimport { DayPicker } from \"react-day-picker\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport { buttonVariants } from \"../button/button.js\";\n\ntype CalendarProps = ComponentProps<typeof DayPicker>;\n\n/**\n * A calendar component that allows users to select a date or a range of dates.\n *\n * @preview This component is in `preview` mode which means the API is not stable and may change.\n * There may also be bugs! Please file an issue if you find any! <3\n *\n * https://github.com/ngrok-oss/mantle/issues\n */\nfunction Calendar({ className, classNames, showOutsideDays = false, ...props }: CalendarProps) {\n\treturn (\n\t\t<DayPicker\n\t\t\tshowOutsideDays={showOutsideDays}\n\t\t\tclassName={cx(\"\", className)}\n\t\t\tclassNames={{\n\t\t\t\tmonths: \"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0\",\n\t\t\t\tmonth: \"space-y-4\",\n\t\t\t\tcaption: \"flex justify-center pt-1 relative items-center\",\n\t\t\t\tcaption_label: \"text-sm font-medium\",\n\t\t\t\tnav: \"flex items-center\",\n\t\t\t\tnav_button: cx(buttonVariants({ appearance: \"ghost\", priority: \"neutral\" }), \"sm:h-7 sm:w-7 h-7 w-7\"),\n\t\t\t\tnav_button_previous: \"absolute left-0\",\n\t\t\t\tnav_button_next: \"absolute right-0\",\n\t\t\t\ttable: \"w-full border-collapse space-y-1\",\n\t\t\t\thead_row: \"flex\",\n\t\t\t\thead_cell: \"text-body w-7 text-[0.8rem] text-center font-normal\",\n\t\t\t\trow: \"flex w-full mt-1\",\n\t\t\t\tcell: cx(\n\t\t\t\t\t\"overflow-hidden text-center text-sm p-0 relative focus-within:relative focus-within:z-20 sm:h-7 sm:w-7 h-7 w-7 \",\n\t\t\t\t\tprops.mode === \"range\"\n\t\t\t\t\t\t? \"first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md\"\n\t\t\t\t\t\t: \"\",\n\t\t\t\t),\n\t\t\t\tday: \"day size-full rounded-md [&:not([aria-selected],_[disabled])]:hover:bg-filled-accent/15\",\n\t\t\t\tday_range_start: \"day-range-start [&:not(.day-range-end)]:rounded-r-none\",\n\t\t\t\tday_range_end: \"day-range-end [&:not(.day-range-start)]:rounded-l-none\",\n\t\t\t\tday_selected: \"[&:not([disabled])]:bg-filled-accent text-on-filled [&:not([disabled])]:hover:bg-filled-accent\",\n\t\t\t\tday_today:\n\t\t\t\t\t\"[&:not([aria-selected],_[disabled])]:text-accent-600 font-medium [&:not([aria-selected],_[disabled])]:bg-filled-accent/10\",\n\t\t\t\tday_outside: \"day-outside aria-selected:text-on-filled opacity-50 text-muted\",\n\t\t\t\tday_disabled: \"text-muted opacity-50\",\n\t\t\t\tday_range_middle:\n\t\t\t\t\t\"day-range-middle [&:not([disabled])]:aria-selected:bg-filled-accent/15 aria-selected:text-strong rounded-none [&:not([disabled])]:aria-selected:hover:bg-filled-accent/25\",\n\t\t\t\tday_hidden: \"invisible\",\n\t\t\t\t...classNames,\n\t\t\t}}\n\t\t\tcomponents={{\n\t\t\t\tIconLeft: () => <CaretLeft className=\"h-4 w-4 shrink-0\" weight=\"bold\" />,\n\t\t\t\tIconRight: () => <CaretRight className=\"h-4 w-4 shrink-0\" weight=\"bold\" />,\n\t\t\t}}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\nCalendar.displayName = \"Calendar\";\n\nexport {\n\t//,\n\tCalendar,\n};\n\nexport type {\n\t//,\n\tCalendarProps,\n};\n"],"mappings":"4NAAA,OAAS,aAAAA,MAAiB,6CAC1B,OAAS,cAAAC,MAAkB,8CAE3B,OAAS,aAAAC,MAAiB,mBAoDN,cAAAC,MAAA,oBAtCpB,SAASC,EAAS,CAAE,UAAAC,EAAW,WAAAC,EAAY,gBAAAC,EAAkB,GAAO,GAAGC,CAAM,EAAkB,CAC9F,OACCL,EAACM,EAAA,CACA,gBAAiBF,EACjB,UAAWG,EAAG,GAAIL,CAAS,EAC3B,WAAY,CACX,OAAQ,gEACR,MAAO,YACP,QAAS,iDACT,cAAe,sBACf,IAAK,oBACL,WAAYK,EAAGC,EAAe,CAAE,WAAY,QAAS,SAAU,SAAU,CAAC,EAAG,uBAAuB,EACpG,oBAAqB,kBACrB,gBAAiB,mBACjB,MAAO,mCACP,SAAU,OACV,UAAW,sDACX,IAAK,mBACL,KAAMD,EACL,kHACAF,EAAM,OAAS,QACZ,yFACA,EACJ,EACA,IAAK,0FACL,gBAAiB,yDACjB,cAAe,yDACf,aAAc,iGACd,UACC,4HACD,YAAa,iEACb,aAAc,wBACd,iBACC,4KACD,WAAY,YACZ,GAAGF,CACJ,EACA,WAAY,CACX,SAAU,IAAMH,EAACS,EAAA,CAAU,UAAU,mBAAmB,OAAO,OAAO,EACtE,UAAW,IAAMT,EAACU,EAAA,CAAW,UAAU,mBAAmB,OAAO,OAAO,CACzE,EACC,GAAGL,EACL,CAEF,CACAJ,EAAS,YAAc","names":["CaretLeft","CaretRight","DayPicker","jsx","Calendar","className","classNames","showOutsideDays","props","DayPicker","cx","buttonVariants","CaretLeft","CaretRight"]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=chunk-72TJUKMV.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,2 +1,2 @@
1
- import{a as l}from"./chunk-RDMTCZPT.js";import{a as o}from"./chunk-PMSTRJK7.js";import{a as d}from"./chunk-EW5CFGXT.js";import{CircleNotch as V}from"@phosphor-icons/react/CircleNotch";import{Slot as z}from"@radix-ui/react-slot";import{cva as C}from"class-variance-authority";import{Children as H,cloneElement as I,forwardRef as M,isValidElement as T}from"react";import{jsx as t,jsxs as A}from"react/jsx-runtime";var E=C("inline-flex shrink-0 cursor-pointer items-center justify-center rounded-[var(--icon-button-border-radius,0.375rem)] border focus-within:outline-none focus-visible:ring-4 disabled:cursor-default disabled:opacity-50",{variants:{appearance:{ghost:"text-strong focus-visible:ring-focus-accent not-disabled:hover:bg-neutral-500/10 not-disabled:hover:text-strong not-disabled:active:bg-neutral-500/15 not-disabled:active:text-strong border-transparent",outlined:"border-form bg-form text-strong focus-visible:border-accent-600 focus-visible:ring-focus-accent not-disabled:hover:border-neutral-400 not-disabled:hover:bg-form-hover not-disabled:hover:text-strong not-disabled:active:border-neutral-400 not-disabled:active:bg-neutral-500/10 not-disabled:active:text-strong focus-visible:not-disabled:active:border-accent-600"},isLoading:{false:"",true:"opacity-50"},size:{xs:"size-7 sm:size-6",sm:"size-9 sm:size-7",md:"size-11 sm:size-9"}},defaultVariants:{appearance:"outlined",size:"md"}}),N=M(({"aria-disabled":c,appearance:u,asChild:b=!1,children:p,className:m,disabled:f,icon:v,isLoading:e=!1,label:h,size:n,type:g,...y},B)=>{let i=l(c??f??e),r=e?t(V,{className:"animate-spin"}):v,s={"aria-disabled":i,className:d("icon-button",E({appearance:u,isLoading:e,size:n}),m),"data-loading":e,"data-size":n,disabled:i,ref:B,...y};if(b){let a=H.only(p),x=T(a);return t(z,{...s,children:x&&I(a,{},t(o,{svg:r}))})}return A("button",{...s,type:g,children:[t("span",{className:"sr-only",children:h}),t(o,{svg:r})]})});N.displayName="IconButton";export{N as a};
2
- //# sourceMappingURL=chunk-XLFJLMPU.js.map
1
+ import{a as l}from"./chunk-RDMTCZPT.js";import{a as o}from"./chunk-SMCZZUU4.js";import{a as d}from"./chunk-EW5CFGXT.js";import{CircleNotch as V}from"@phosphor-icons/react/CircleNotch";import{Slot as z}from"@radix-ui/react-slot";import{cva as C}from"class-variance-authority";import{Children as H,cloneElement as I,forwardRef as M,isValidElement as T}from"react";import{jsx as t,jsxs as A}from"react/jsx-runtime";var E=C("inline-flex shrink-0 cursor-pointer items-center justify-center rounded-[var(--icon-button-border-radius,0.375rem)] border focus-within:outline-none focus-visible:ring-4 disabled:cursor-default disabled:opacity-50",{variants:{appearance:{ghost:"text-strong focus-visible:ring-focus-accent not-disabled:hover:bg-neutral-500/10 not-disabled:hover:text-strong not-disabled:active:bg-neutral-500/15 not-disabled:active:text-strong border-transparent",outlined:"border-form bg-form text-strong focus-visible:border-accent-600 focus-visible:ring-focus-accent not-disabled:hover:border-neutral-400 not-disabled:hover:bg-form-hover not-disabled:hover:text-strong not-disabled:active:border-neutral-400 not-disabled:active:bg-neutral-500/10 not-disabled:active:text-strong focus-visible:not-disabled:active:border-accent-600"},isLoading:{false:"",true:"opacity-50"},size:{xs:"size-7 sm:size-6",sm:"size-9 sm:size-7",md:"size-11 sm:size-9"}},defaultVariants:{appearance:"outlined",size:"md"}}),N=M(({"aria-disabled":c,appearance:u,asChild:b=!1,children:p,className:m,disabled:f,icon:v,isLoading:e=!1,label:h,size:n,type:g,...y},B)=>{let i=l(c??f??e),r=e?t(V,{className:"animate-spin"}):v,s={"aria-disabled":i,className:d("icon-button",E({appearance:u,isLoading:e,size:n}),m),"data-loading":e,"data-size":n,disabled:i,ref:B,...y};if(b){let a=H.only(p),x=T(a);return t(z,{...s,children:x&&I(a,{},t(o,{svg:r}))})}return A("button",{...s,type:g,children:[t("span",{className:"sr-only",children:h}),t(o,{svg:r})]})});N.displayName="IconButton";export{N as a};
2
+ //# sourceMappingURL=chunk-7AUDKKSM.js.map
@@ -1,2 +1,2 @@
1
- import{b as g}from"./chunk-CXQLUXDJ.js";import{a as r}from"./chunk-EW5CFGXT.js";import{a as S}from"./chunk-5E73VWJX.js";import{CaretDown as P}from"@phosphor-icons/react/CaretDown";import{CaretUp as R}from"@phosphor-icons/react/CaretUp";import{Check as I}from"@phosphor-icons/react/Check";import*as e from"@radix-ui/react-select";import{createContext as N,forwardRef as n,useContext as T}from"react";import{jsx as i,jsxs as v}from"react/jsx-runtime";var h=N({}),B=n(({"aria-invalid":o,children:a,id:t,validation:l,onBlur:s,onChange:d,...m},c)=>i(e.Root,{...m,onValueChange:d,children:i(h.Provider,{value:{"aria-invalid":o,id:t,validation:l,onBlur:s,ref:c},children:a})}));B.displayName="Select";var F=e.Group,G=e.Value,W=n(({"aria-invalid":o,className:a,children:t,id:l,validation:s,...d},m)=>{let c=T(h),p=c["aria-invalid"]??o,x=p!=null&&p!=="false",f=c.validation??s,u=x?"error":typeof f=="function"?f():f,w=p??u==="error",C=c.id??l;return v(e.Trigger,{"aria-invalid":w,"data-validation":u||void 0,className:r("h-11 text-base sm:h-9 sm:text-sm","border-form bg-form text-strong placeholder:text-placeholder hover:bg-form-hover hover:text-strong flex w-full items-center justify-between gap-1.5 rounded-md border px-3 py-2 hover:border-neutral-400 disabled:pointer-events-none disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:text-left","focus:outline-none focus:ring-4 aria-expanded:ring-4","focus:border-accent-600 focus:ring-focus-accent aria-expanded:border-accent-600 aria-expanded:ring-focus-accent","data-validation-success:border-success-600 data-validation-success:focus:border-success-600 data-validation-success:focus:ring-focus-success data-validation-success:aria-expanded:border-success-600 data-validation-success:aria-expanded:ring-focus-success","data-validation-warning:border-warning-600 data-validation-warning:focus:border-warning-600 data-validation-warning:focus:ring-focus-warning data-validation-warning:aria-expanded:border-warning-600 data-validation-warning:aria-expanded:ring-focus-warning","data-validation-error:border-danger-600 data-validation-error:focus:border-danger-600 data-validation-error:focus:ring-focus-danger data-validation-error:aria-expanded:border-danger-600 data-validation-error:aria-expanded:ring-focus-danger",a),id:C,ref:S(m,c.ref),...d,children:[t,i(e.Icon,{asChild:!0,children:i(P,{className:"size-4 shrink-0",weight:"bold"})})]})});W.displayName="SelectTrigger";var y=n(({className:o,...a},t)=>i(e.ScrollUpButton,{ref:t,className:r("flex cursor-default items-center justify-center py-1",o),...a,children:i(R,{className:"size-4 shrink-0",weight:"bold"})}));y.displayName="SelectScrollUpButton";var b=n(({className:o,...a},t)=>i(e.ScrollDownButton,{ref:t,className:r("flex cursor-default items-center justify-center py-1",o),...a,children:i(P,{className:"size-4 shrink-0",weight:"bold"})}));b.displayName="SelectScrollDownButton";var E=n(({className:o,children:a,position:t="popper",width:l,...s},d)=>i(e.Portal,{children:v(e.Content,{ref:d,className:r("border-popover data-side-bottom:slide-in-from-top-2 data-side-left:slide-in-from-right-2 data-side-right:slide-in-from-left-2 data-side-top:slide-in-from-bottom-2 data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md","bg-popover",t==="popper"&&"data-side-bottom:translate-y-2 data-side-left:-translate-x-2 data-side-right:translate-x-2 data-side-top:-translate-y-2 max-h-[var(--radix-select-content-available-height)]",l==="trigger"&&"w-[var(--radix-select-trigger-width)]",o),position:t,...s,children:[i(y,{}),i(e.Viewport,{className:r("p-1",t==="popper"&&"h-[var(--radix-select-trigger-height)] w-full"),children:a}),i(b,{})]})}));E.displayName="SelectContent";var L=n(({className:o,...a},t)=>i(e.Label,{ref:t,className:r("px-2 py-1.5 text-sm font-semibold",o),...a}));L.displayName="SelectLabel";var k=n(({className:o,children:a,...t},l)=>v(e.Item,{ref:l,className:r("focus:bg-popover-hover data-disabled:pointer-events-none data-disabled:opacity-50 data-state-checked:bg-filled-accent data-state-checked:text-on-filled relative flex w-full cursor-pointer select-none items-center rounded py-1.5 pl-2 pr-8 text-sm outline-none",o),...t,children:[i(e.ItemText,{children:a}),i(e.ItemIndicator,{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:i(I,{className:"size-4 shrink-0",weight:"bold"})})]}));k.displayName="SelectItem";var V=n(({className:o,...a},t)=>i(g,{ref:t,className:r("-mx-1 my-1 h-px w-auto",o),...a}));V.displayName="SelectSeparator";export{B as a,F as b,G as c,W as d,E as e,L as f,k as g,V as h};
2
- //# sourceMappingURL=chunk-6ZEJCZAD.js.map
1
+ import{b as g}from"./chunk-CXQLUXDJ.js";import{a as S}from"./chunk-5E73VWJX.js";import{a as r}from"./chunk-EW5CFGXT.js";import{CaretDown as P}from"@phosphor-icons/react/CaretDown";import{CaretUp as R}from"@phosphor-icons/react/CaretUp";import{Check as I}from"@phosphor-icons/react/Check";import*as e from"@radix-ui/react-select";import{createContext as N,forwardRef as n,useContext as T}from"react";import{jsx as i,jsxs as v}from"react/jsx-runtime";var h=N({}),B=n(({"aria-invalid":o,children:a,id:t,validation:l,onBlur:s,onChange:d,...m},c)=>i(e.Root,{...m,onValueChange:d,children:i(h.Provider,{value:{"aria-invalid":o,id:t,validation:l,onBlur:s,ref:c},children:a})}));B.displayName="Select";var F=e.Group,G=e.Value,W=n(({"aria-invalid":o,className:a,children:t,id:l,validation:s,...d},m)=>{let c=T(h),p=c["aria-invalid"]??o,x=p!=null&&p!=="false",f=c.validation??s,u=x?"error":typeof f=="function"?f():f,w=p??u==="error",C=c.id??l;return v(e.Trigger,{"aria-invalid":w,"data-validation":u||void 0,className:r("h-11 text-base sm:h-9 sm:text-sm","border-form bg-form text-strong placeholder:text-placeholder hover:bg-form-hover hover:text-strong flex w-full items-center justify-between gap-1.5 rounded-md border px-3 py-2 hover:border-neutral-400 disabled:pointer-events-none disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:text-left","focus:outline-none focus:ring-4 aria-expanded:ring-4","focus:border-accent-600 focus:ring-focus-accent aria-expanded:border-accent-600 aria-expanded:ring-focus-accent","data-validation-success:border-success-600 data-validation-success:focus:border-success-600 data-validation-success:focus:ring-focus-success data-validation-success:aria-expanded:border-success-600 data-validation-success:aria-expanded:ring-focus-success","data-validation-warning:border-warning-600 data-validation-warning:focus:border-warning-600 data-validation-warning:focus:ring-focus-warning data-validation-warning:aria-expanded:border-warning-600 data-validation-warning:aria-expanded:ring-focus-warning","data-validation-error:border-danger-600 data-validation-error:focus:border-danger-600 data-validation-error:focus:ring-focus-danger data-validation-error:aria-expanded:border-danger-600 data-validation-error:aria-expanded:ring-focus-danger",a),id:C,ref:S(m,c.ref),...d,children:[t,i(e.Icon,{asChild:!0,children:i(P,{className:"size-4 shrink-0",weight:"bold"})})]})});W.displayName="SelectTrigger";var y=n(({className:o,...a},t)=>i(e.ScrollUpButton,{ref:t,className:r("flex cursor-default items-center justify-center py-1",o),...a,children:i(R,{className:"size-4 shrink-0",weight:"bold"})}));y.displayName="SelectScrollUpButton";var b=n(({className:o,...a},t)=>i(e.ScrollDownButton,{ref:t,className:r("flex cursor-default items-center justify-center py-1",o),...a,children:i(P,{className:"size-4 shrink-0",weight:"bold"})}));b.displayName="SelectScrollDownButton";var E=n(({className:o,children:a,position:t="popper",width:l,...s},d)=>i(e.Portal,{children:v(e.Content,{ref:d,className:r("border-popover data-side-bottom:slide-in-from-top-2 data-side-left:slide-in-from-right-2 data-side-right:slide-in-from-left-2 data-side-top:slide-in-from-bottom-2 data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md","bg-popover",t==="popper"&&"data-side-bottom:translate-y-2 data-side-left:-translate-x-2 data-side-right:translate-x-2 data-side-top:-translate-y-2 max-h-[var(--radix-select-content-available-height)]",l==="trigger"&&"w-[var(--radix-select-trigger-width)]",o),position:t,...s,children:[i(y,{}),i(e.Viewport,{className:r("p-1",t==="popper"&&"h-[var(--radix-select-trigger-height)] w-full"),children:a}),i(b,{})]})}));E.displayName="SelectContent";var L=n(({className:o,...a},t)=>i(e.Label,{ref:t,className:r("px-2 py-1.5 text-sm font-semibold",o),...a}));L.displayName="SelectLabel";var k=n(({className:o,children:a,...t},l)=>v(e.Item,{ref:l,className:r("focus:bg-popover-hover data-disabled:pointer-events-none data-disabled:opacity-50 data-state-checked:bg-filled-accent data-state-checked:text-on-filled relative flex w-full cursor-pointer select-none items-center rounded py-1.5 pl-2 pr-8 text-sm outline-none",o),...t,children:[i(e.ItemText,{children:a}),i(e.ItemIndicator,{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:i(I,{className:"size-4 shrink-0",weight:"bold"})})]}));k.displayName="SelectItem";var V=n(({className:o,...a},t)=>i(g,{ref:t,className:r("-mx-1 my-1 h-px w-auto",o),...a}));V.displayName="SelectSeparator";export{B as a,F as b,G as c,W as d,E as e,L as f,k as g,V as h};
2
+ //# sourceMappingURL=chunk-E6LNHWJ3.js.map
@@ -1,2 +1,2 @@
1
- import{a as u}from"./chunk-RDMTCZPT.js";import{a as g}from"./chunk-PMSTRJK7.js";import{a as p}from"./chunk-EW5CFGXT.js";import{CircleNotch as k}from"@phosphor-icons/react/CircleNotch";import{Slot as N}from"@radix-ui/react-slot";import{cva as I}from"class-variance-authority";import f from"clsx";import{Children as w,cloneElement as E,forwardRef as H,isValidElement as M}from"react";import T from"tiny-invariant";import{jsx as t,jsxs as S}from"react/jsx-runtime";var A=I("inline-flex cursor-pointer items-center justify-center gap-1.5 whitespace-nowrap rounded-md text-base focus-within:outline-none focus-visible:ring-4 disabled:cursor-default disabled:opacity-50 sm:text-sm [&>*]:focus-within:outline-none",{variants:{appearance:{filled:"bg-filled-accent text-on-filled focus-visible:border-accent-600 focus-visible:ring-focus-accent not-disabled:hover:bg-filled-accent-hover not-disabled:active:bg-filled-accent-active h-11 border border-transparent px-3 font-medium sm:h-9",ghost:"text-accent-600 focus-visible:ring-focus-accent not-disabled:hover:bg-accent-500/10 not-disabled:hover:text-accent-700 not-disabled:active:bg-accent-500/15 not-disabled:active:text-accent-700 h-11 border border-transparent px-3 font-medium sm:h-9",outlined:"border-accent-600 bg-form text-accent-600 focus-visible:ring-focus-accent not-disabled:hover:border-accent-700 not-disabled:hover:bg-accent-500/10 not-disabled:hover:text-accent-700 not-disabled:active:border-accent-700 not-disabled:active:bg-accent-500/15 not-disabled:active:text-accent-700 h-11 border px-3 font-medium sm:h-9",link:"text-accent-600 focus-visible:ring-focus-accent not-disabled:hover:underline group border-transparent"},isLoading:{false:"",true:"opacity-50"},priority:{danger:"",default:"",neutral:""}},defaultVariants:{appearance:"outlined",isLoading:!1,priority:"default"},compoundVariants:[{appearance:"ghost",priority:"danger",class:"text-danger-600 focus-visible:ring-focus-danger not-disabled:hover:bg-danger-500/10 not-disabled:hover:text-danger-700 not-disabled:active:bg-danger-500/15 not-disabled:active:text-danger-700 border-transparent"},{appearance:"outlined",priority:"danger",class:"border-danger-600 bg-form text-danger-600 focus-visible:ring-focus-danger not-disabled:hover:border-danger-700 not-disabled:hover:bg-danger-500/10 not-disabled:hover:text-danger-700 not-disabled:active:border-danger-700 not-disabled:active:bg-danger-500/15 not-disabled:active:text-danger-700"},{appearance:"filled",priority:"danger",class:"bg-filled-danger focus-visible:border-danger-600 focus-visible:ring-focus-danger not-disabled:hover:bg-filled-danger-hover not-disabled:active:bg-filled-danger-active border-transparent"},{appearance:"link",priority:"danger",class:"text-danger-600 focus-visible:ring-focus-danger"},{appearance:"ghost",priority:"neutral",class:"text-strong focus-visible:ring-focus-accent not-disabled:hover:bg-neutral-500/10 not-disabled:hover:text-strong not-disabled:active:bg-neutral-500/15 not-disabled:active:text-strong border-transparent"},{appearance:"outlined",priority:"neutral",class:"border-form bg-form text-strong focus-visible:border-accent-600 focus-visible:ring-focus-accent not-disabled:hover:border-neutral-400 not-disabled:hover:bg-form-hover not-disabled:hover:text-strong not-disabled:active:border-neutral-400 not-disabled:active:bg-neutral-500/10 not-disabled:active:text-strong focus-visible:not-disabled:active:border-accent-600"},{appearance:"filled",priority:"neutral",class:"bg-filled-neutral focus-visible:ring-focus-neutral not-disabled:hover:bg-filled-neutral-hover not-disabled:active:bg-filled-neutral-active border-transparent focus-visible:border-neutral-600"},{appearance:"link",priority:"neutral",class:"text-strong focus-visible:ring-focus-accent"}]}),L=H(({"aria-disabled":i,appearance:e="outlined",asChild:n,children:r,className:m,disabled:h,icon:y,iconPlacement:a="start",isLoading:o=!1,priority:x="default",type:B,...P},C)=>{let c=u(i??h??o),s=o?t(k,{className:"animate-spin"}):y,l=s&&e!=="link",b={"aria-disabled":c,className:p(A({appearance:e,priority:x,isLoading:o}),l&&a==="start"&&"ps-2.5",l&&a==="end"&&"pe-2.5",m),"data-loading":o,disabled:c,ref:C,...P};if(n){let d=w.only(r);T(M(d),"When using `asChild`, Button must be passed a single child as a JSX tag.");let V=d.props?.children;return t(N,{...b,children:E(d,{},t(v,{appearance:e,icon:s,iconPlacement:a,children:V}))})}return t("button",{...b,type:B,children:t(v,{appearance:e,icon:s,iconPlacement:a,children:r})})});L.displayName="Button";var v=({appearance:i,children:e,icon:n,iconPlacement:r})=>S("span",{className:f("inline-flex items-center gap-1.5 focus-within:outline-none focus-visible:outline-none",i==="link"&&"not-disabled:group-hover:underline"),children:[n&&t(g,{svg:n,className:f(r==="end"&&"order-last")}),e]});export{A as a,L as b};
2
- //# sourceMappingURL=chunk-25GJN3ZK.js.map
1
+ import{a as g}from"./chunk-RDMTCZPT.js";import{a as u}from"./chunk-SMCZZUU4.js";import{a as p}from"./chunk-EW5CFGXT.js";import{CircleNotch as k}from"@phosphor-icons/react/CircleNotch";import{Slot as N}from"@radix-ui/react-slot";import{cva as I}from"class-variance-authority";import f from"clsx";import{Children as w,cloneElement as E,forwardRef as H,isValidElement as M}from"react";import T from"tiny-invariant";import{jsx as t,jsxs as S}from"react/jsx-runtime";var A=I("inline-flex cursor-pointer items-center justify-center gap-1.5 whitespace-nowrap rounded-md text-base focus-within:outline-none focus-visible:ring-4 disabled:cursor-default disabled:opacity-50 sm:text-sm [&>*]:focus-within:outline-none",{variants:{appearance:{filled:"bg-filled-accent text-on-filled focus-visible:border-accent-600 focus-visible:ring-focus-accent not-disabled:hover:bg-filled-accent-hover not-disabled:active:bg-filled-accent-active h-11 border border-transparent px-3 font-medium sm:h-9",ghost:"text-accent-600 focus-visible:ring-focus-accent not-disabled:hover:bg-accent-500/10 not-disabled:hover:text-accent-700 not-disabled:active:bg-accent-500/15 not-disabled:active:text-accent-700 h-11 border border-transparent px-3 font-medium sm:h-9",outlined:"border-accent-600 bg-form text-accent-600 focus-visible:ring-focus-accent not-disabled:hover:border-accent-700 not-disabled:hover:bg-accent-500/10 not-disabled:hover:text-accent-700 not-disabled:active:border-accent-700 not-disabled:active:bg-accent-500/15 not-disabled:active:text-accent-700 h-11 border px-3 font-medium sm:h-9",link:"text-accent-600 focus-visible:ring-focus-accent not-disabled:hover:underline group border-transparent"},isLoading:{false:"",true:"opacity-50"},priority:{danger:"",default:"",neutral:""}},defaultVariants:{appearance:"outlined",isLoading:!1,priority:"default"},compoundVariants:[{appearance:"ghost",priority:"danger",class:"text-danger-600 focus-visible:ring-focus-danger not-disabled:hover:bg-danger-500/10 not-disabled:hover:text-danger-700 not-disabled:active:bg-danger-500/15 not-disabled:active:text-danger-700 border-transparent"},{appearance:"outlined",priority:"danger",class:"border-danger-600 bg-form text-danger-600 focus-visible:ring-focus-danger not-disabled:hover:border-danger-700 not-disabled:hover:bg-danger-500/10 not-disabled:hover:text-danger-700 not-disabled:active:border-danger-700 not-disabled:active:bg-danger-500/15 not-disabled:active:text-danger-700"},{appearance:"filled",priority:"danger",class:"bg-filled-danger focus-visible:border-danger-600 focus-visible:ring-focus-danger not-disabled:hover:bg-filled-danger-hover not-disabled:active:bg-filled-danger-active border-transparent"},{appearance:"link",priority:"danger",class:"text-danger-600 focus-visible:ring-focus-danger"},{appearance:"ghost",priority:"neutral",class:"text-strong focus-visible:ring-focus-accent not-disabled:hover:bg-neutral-500/10 not-disabled:hover:text-strong not-disabled:active:bg-neutral-500/15 not-disabled:active:text-strong border-transparent"},{appearance:"outlined",priority:"neutral",class:"border-form bg-form text-strong focus-visible:border-accent-600 focus-visible:ring-focus-accent not-disabled:hover:border-neutral-400 not-disabled:hover:bg-form-hover not-disabled:hover:text-strong not-disabled:active:border-neutral-400 not-disabled:active:bg-neutral-500/10 not-disabled:active:text-strong focus-visible:not-disabled:active:border-accent-600"},{appearance:"filled",priority:"neutral",class:"bg-filled-neutral focus-visible:ring-focus-neutral not-disabled:hover:bg-filled-neutral-hover not-disabled:active:bg-filled-neutral-active border-transparent focus-visible:border-neutral-600"},{appearance:"link",priority:"neutral",class:"text-strong focus-visible:ring-focus-accent"}]}),L=H(({"aria-disabled":i,appearance:e="outlined",asChild:n,children:r,className:m,disabled:h,icon:y,iconPlacement:a="start",isLoading:o=!1,priority:x="default",type:B,...P},C)=>{let c=g(i??h??o),s=o?t(k,{className:"animate-spin"}):y,l=s&&e!=="link",b={"aria-disabled":c,className:p(A({appearance:e,priority:x,isLoading:o}),l&&a==="start"&&"ps-2.5",l&&a==="end"&&"pe-2.5",m),"data-loading":o,disabled:c,ref:C,...P};if(n){let d=w.only(r);T(M(d),"When using `asChild`, Button must be passed a single child as a JSX tag.");let V=d.props?.children;return t(N,{...b,children:E(d,{},t(v,{appearance:e,icon:s,iconPlacement:a,children:V}))})}return t("button",{...b,type:B,children:t(v,{appearance:e,icon:s,iconPlacement:a,children:r})})});L.displayName="Button";var v=({appearance:i,children:e,icon:n,iconPlacement:r})=>S("span",{className:f("inline-flex items-center gap-1.5 focus-within:outline-none focus-visible:outline-none",i==="link"&&"not-disabled:group-hover:underline"),children:[n&&t(u,{svg:n,className:f(r==="end"&&"order-last")}),e]});export{A as a,L as b};
2
+ //# sourceMappingURL=chunk-L2JX4GJ6.js.map
@@ -0,0 +1,2 @@
1
+ import{a as t}from"./chunk-VJPVAY5J.js";import{a as e}from"./chunk-EW5CFGXT.js";import{forwardRef as c}from"react";import{jsx as f}from"react/jsx-runtime";var g=c(({className:o,style:r,svg:s,...p},m)=>f(t,{ref:m,className:e("size-6 sm:size-5",o),style:r,svg:s,...p}));export{g as a};
2
+ //# sourceMappingURL=chunk-SMCZZUU4.js.map
package/dist/dialog.js CHANGED
@@ -1,2 +1,2 @@
1
- import{a as m}from"./chunk-XLFJLMPU.js";import"./chunk-4LSFAAZW.js";import"./chunk-RDMTCZPT.js";import"./chunk-PMSTRJK7.js";import"./chunk-VJPVAY5J.js";import{a as l}from"./chunk-EW5CFGXT.js";import{X as u}from"@phosphor-icons/react/X";import*as e from"@radix-ui/react-dialog";import{forwardRef as r}from"react";import{jsx as i,jsxs as N}from"react/jsx-runtime";var P=e.Root,x=e.Trigger,g=e.Portal,C=e.Close,s=r(({className:o,...t},a)=>i(e.Overlay,{ref:a,className:l("bg-overlay data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:animate-in data-state-open:fade-in-0 fixed inset-0 z-50 backdrop-blur-sm",o),...t}));s.displayName=e.Overlay.displayName;var d=r(({className:o,children:t,...a},n)=>N(g,{children:[i(s,{}),i("div",{className:"fixed inset-4 z-50 flex items-center justify-center",children:i(e.Content,{className:l("flex max-h-full w-full max-w-lg flex-1 flex-col","outline-none focus-within:outline-none","border-dialog bg-dialog rounded-xl border shadow-lg transition-transform duration-200","data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95",o),ref:n,...a,children:t})})]}));d.displayName=e.Content.displayName;var p=({className:o,children:t,...a})=>i("div",{className:l("border-dialog-muted text-strong relative flex shrink-0 items-center justify-between gap-2 border-b px-6 py-4","has-[.icon-button]:pr-4",o),...a,children:t});p.displayName="DialogHeader";var b=({size:o="md",type:t="button",label:a="Close Dialog",appearance:n="ghost",...y})=>i(e.Close,{asChild:!0,children:i(m,{appearance:n,icon:i(u,{}),label:a,size:o,type:t,...y})}),D=({className:o,...t})=>i("div",{className:l("scrollbar text-body flex-1 overflow-y-auto p-6",o),...t});D.displayName="DialogBody";var c=({className:o,...t})=>i("div",{className:l("border-dialog-muted flex shrink-0 flex-row-reverse gap-2 border-t px-6 py-4",o),...t});c.displayName="DialogFooter";var f=r(({className:o,...t},a)=>i(e.Title,{ref:a,className:l("text-strong truncate text-lg font-medium",o),...t}));f.displayName=e.Title.displayName;var v=r(({className:o,...t},a)=>i(e.Description,{ref:a,className:l("text-muted",o),...t}));v.displayName=e.Description.displayName;export{P as Dialog,D as DialogBody,C as DialogClose,b as DialogCloseIconButton,d as DialogContent,v as DialogDescription,c as DialogFooter,p as DialogHeader,s as DialogOverlay,g as DialogPortal,f as DialogTitle,x as DialogTrigger};
1
+ import{a as m}from"./chunk-7AUDKKSM.js";import"./chunk-4LSFAAZW.js";import"./chunk-RDMTCZPT.js";import"./chunk-72TJUKMV.js";import"./chunk-SMCZZUU4.js";import"./chunk-VJPVAY5J.js";import{a as l}from"./chunk-EW5CFGXT.js";import{X as u}from"@phosphor-icons/react/X";import*as e from"@radix-ui/react-dialog";import{forwardRef as r}from"react";import{jsx as i,jsxs as N}from"react/jsx-runtime";var P=e.Root,x=e.Trigger,g=e.Portal,C=e.Close,s=r(({className:o,...t},a)=>i(e.Overlay,{ref:a,className:l("bg-overlay data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:animate-in data-state-open:fade-in-0 fixed inset-0 z-50 backdrop-blur-sm",o),...t}));s.displayName=e.Overlay.displayName;var d=r(({className:o,children:t,...a},n)=>N(g,{children:[i(s,{}),i("div",{className:"fixed inset-4 z-50 flex items-center justify-center",children:i(e.Content,{className:l("flex max-h-full w-full max-w-lg flex-1 flex-col","outline-none focus-within:outline-none","border-dialog bg-dialog rounded-xl border shadow-lg transition-transform duration-200","data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95",o),ref:n,...a,children:t})})]}));d.displayName=e.Content.displayName;var p=({className:o,children:t,...a})=>i("div",{className:l("border-dialog-muted text-strong relative flex shrink-0 items-center justify-between gap-2 border-b px-6 py-4","has-[.icon-button]:pr-4",o),...a,children:t});p.displayName="DialogHeader";var b=({size:o="md",type:t="button",label:a="Close Dialog",appearance:n="ghost",...y})=>i(e.Close,{asChild:!0,children:i(m,{appearance:n,icon:i(u,{}),label:a,size:o,type:t,...y})}),D=({className:o,...t})=>i("div",{className:l("scrollbar text-body flex-1 overflow-y-auto p-6",o),...t});D.displayName="DialogBody";var c=({className:o,...t})=>i("div",{className:l("border-dialog-muted flex shrink-0 flex-row-reverse gap-2 border-t px-6 py-4",o),...t});c.displayName="DialogFooter";var f=r(({className:o,...t},a)=>i(e.Title,{ref:a,className:l("text-strong truncate text-lg font-medium",o),...t}));f.displayName=e.Title.displayName;var v=r(({className:o,...t},a)=>i(e.Description,{ref:a,className:l("text-muted",o),...t}));v.displayName=e.Description.displayName;export{P as Dialog,D as DialogBody,C as DialogClose,b as DialogCloseIconButton,d as DialogContent,v as DialogDescription,c as DialogFooter,p as DialogHeader,s as DialogOverlay,g as DialogPortal,f as DialogTitle,x as DialogTrigger};
2
2
  //# sourceMappingURL=dialog.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/dialog/dialog.tsx"],"sourcesContent":["import { X } from \"@phosphor-icons/react/X\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ElementRef } from \"react\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport { IconButton, type IconButtonProps } from \"../button/icon-button.js\";\n\nconst Dialog = DialogPrimitive.Root;\n\nconst DialogTrigger = DialogPrimitive.Trigger;\n\nconst DialogPortal = DialogPrimitive.Portal;\n\nconst DialogClose = DialogPrimitive.Close;\n\nconst DialogOverlay = forwardRef<\n\tElementRef<typeof DialogPrimitive.Overlay>,\n\tComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n\t<DialogPrimitive.Overlay\n\t\tref={ref}\n\t\tclassName={cx(\n\t\t\t\"bg-overlay data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:animate-in data-state-open:fade-in-0 fixed inset-0 z-50 backdrop-blur-sm\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\nconst DialogContent = forwardRef<ElementRef<\"div\">, ComponentPropsWithoutRef<typeof DialogPrimitive.Content>>(\n\t({ className, children, ...props }, ref) => (\n\t\t<DialogPortal>\n\t\t\t<DialogOverlay />\n\t\t\t<div className=\"fixed inset-4 z-50 flex items-center justify-center\">\n\t\t\t\t<DialogPrimitive.Content\n\t\t\t\t\tclassName={cx(\n\t\t\t\t\t\t\"flex max-h-full w-full max-w-lg flex-1 flex-col\",\n\t\t\t\t\t\t\"outline-none focus-within:outline-none\",\n\t\t\t\t\t\t\"border-dialog bg-dialog rounded-xl border shadow-lg transition-transform duration-200\",\n\t\t\t\t\t\t\"data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95\",\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\tref={ref}\n\t\t\t\t\t{...props}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</DialogPrimitive.Content>\n\t\t\t</div>\n\t\t</DialogPortal>\n\t),\n);\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({ className, children, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n\t<div\n\t\tclassName={cx(\n\t\t\t\"border-dialog-muted text-strong relative flex shrink-0 items-center justify-between gap-2 border-b px-6 py-4\",\n\t\t\t\"has-[.icon-button]:pr-4\", // when there are actions in the header, shorten the padding\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t>\n\t\t{children}\n\t</div>\n);\nDialogHeader.displayName = \"DialogHeader\";\n\ntype DialogCloseIconButtonProps = Partial<Omit<IconButtonProps, \"icon\">>;\nconst DialogCloseIconButton = ({\n\tsize = \"md\",\n\ttype = \"button\",\n\tlabel = \"Close Dialog\",\n\tappearance = \"ghost\",\n\t...props\n}: DialogCloseIconButtonProps) => (\n\t<DialogPrimitive.Close asChild>\n\t\t<IconButton appearance={appearance} icon={<X />} label={label} size={size} type={type} {...props} />\n\t</DialogPrimitive.Close>\n);\n\nconst DialogBody = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n\t<div className={cx(\"scrollbar text-body flex-1 overflow-y-auto p-6\", className)} {...props} />\n);\nDialogBody.displayName = \"DialogBody\";\n\nconst DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n\t<div\n\t\tclassName={cx(\"border-dialog-muted flex shrink-0 flex-row-reverse gap-2 border-t px-6 py-4\", className)}\n\t\t{...props}\n\t/>\n);\nDialogFooter.displayName = \"DialogFooter\";\n\nconst DialogTitle = forwardRef<\n\tElementRef<typeof DialogPrimitive.Title>,\n\tComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n\t<DialogPrimitive.Title ref={ref} className={cx(\"text-strong truncate text-lg font-medium\", className)} {...props} />\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\nconst DialogDescription = forwardRef<\n\tElementRef<typeof DialogPrimitive.Description>,\n\tComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n\t<DialogPrimitive.Description ref={ref} className={cx(\"text-muted\", className)} {...props} />\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n\tDialog,\n\tDialogBody,\n\tDialogClose,\n\tDialogCloseIconButton,\n\tDialogContent,\n\tDialogDescription,\n\tDialogFooter,\n\tDialogHeader,\n\tDialogOverlay,\n\tDialogPortal,\n\tDialogTitle,\n\tDialogTrigger,\n};\n"],"mappings":"gMAAA,OAAS,KAAAA,MAAS,0BAClB,UAAYC,MAAqB,yBACjC,OAAS,cAAAC,MAAkB,QAiB1B,cAAAC,EAaC,QAAAC,MAbD,oBAZD,IAAMC,EAAyB,OAEzBC,EAAgC,UAEhCC,EAA+B,SAE/BC,EAA8B,QAE9BC,EAAgBC,EAGpB,CAAC,CAAE,UAAAC,EAAW,GAAGC,CAAM,EAAGC,IAC3BV,EAAiB,UAAhB,CACA,IAAKU,EACL,UAAWC,EACV,iKACAH,CACD,EACC,GAAGC,EACL,CACA,EACDH,EAAc,YAA8B,UAAQ,YAEpD,IAAMM,EAAgBL,EACrB,CAAC,CAAE,UAAAC,EAAW,SAAAK,EAAU,GAAGJ,CAAM,EAAGC,IACnCT,EAACG,EAAA,CACA,UAAAJ,EAACM,EAAA,EAAc,EACfN,EAAC,OAAI,UAAU,sDACd,SAAAA,EAAiB,UAAhB,CACA,UAAWW,EACV,kDACA,yCACA,wFACA,2KACAH,CACD,EACA,IAAKE,EACJ,GAAGD,EAEH,SAAAI,EACF,EACD,GACD,CAEF,EACAD,EAAc,YAA8B,UAAQ,YAEpD,IAAME,EAAe,CAAC,CAAE,UAAAN,EAAW,SAAAK,EAAU,GAAGJ,CAAM,IACrDT,EAAC,OACA,UAAWW,EACV,+GACA,0BACAH,CACD,EACC,GAAGC,EAEH,SAAAI,EACF,EAEDC,EAAa,YAAc,eAG3B,IAAMC,EAAwB,CAAC,CAC9B,KAAAC,EAAO,KACP,KAAAC,EAAO,SACP,MAAAC,EAAQ,eACR,WAAAC,EAAa,QACb,GAAGV,CACJ,IACCT,EAAiB,QAAhB,CAAsB,QAAO,GAC7B,SAAAA,EAACoB,EAAA,CAAW,WAAYD,EAAY,KAAMnB,EAACqB,EAAA,EAAE,EAAI,MAAOH,EAAO,KAAMF,EAAM,KAAMC,EAAO,GAAGR,EAAO,EACnG,EAGKa,EAAa,CAAC,CAAE,UAAAd,EAAW,GAAGC,CAAM,IACzCT,EAAC,OAAI,UAAWW,EAAG,iDAAkDH,CAAS,EAAI,GAAGC,EAAO,EAE7Fa,EAAW,YAAc,aAEzB,IAAMC,EAAe,CAAC,CAAE,UAAAf,EAAW,GAAGC,CAAM,IAC3CT,EAAC,OACA,UAAWW,EAAG,8EAA+EH,CAAS,EACrG,GAAGC,EACL,EAEDc,EAAa,YAAc,eAE3B,IAAMC,EAAcjB,EAGlB,CAAC,CAAE,UAAAC,EAAW,GAAGC,CAAM,EAAGC,IAC3BV,EAAiB,QAAhB,CAAsB,IAAKU,EAAK,UAAWC,EAAG,2CAA4CH,CAAS,EAAI,GAAGC,EAAO,CAClH,EACDe,EAAY,YAA8B,QAAM,YAEhD,IAAMC,EAAoBlB,EAGxB,CAAC,CAAE,UAAAC,EAAW,GAAGC,CAAM,EAAGC,IAC3BV,EAAiB,cAAhB,CAA4B,IAAKU,EAAK,UAAWC,EAAG,aAAcH,CAAS,EAAI,GAAGC,EAAO,CAC1F,EACDgB,EAAkB,YAA8B,cAAY","names":["X","DialogPrimitive","forwardRef","jsx","jsxs","Dialog","DialogTrigger","DialogPortal","DialogClose","DialogOverlay","forwardRef","className","props","ref","cx","DialogContent","children","DialogHeader","DialogCloseIconButton","size","type","label","appearance","IconButton","X","DialogBody","DialogFooter","DialogTitle","DialogDescription"]}
1
+ {"version":3,"sources":["../src/components/dialog/dialog.tsx"],"sourcesContent":["import { X } from \"@phosphor-icons/react/X\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ElementRef } from \"react\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport { IconButton, type IconButtonProps } from \"../button/icon-button.js\";\n\nconst Dialog = DialogPrimitive.Root;\n\nconst DialogTrigger = DialogPrimitive.Trigger;\n\nconst DialogPortal = DialogPrimitive.Portal;\n\nconst DialogClose = DialogPrimitive.Close;\n\nconst DialogOverlay = forwardRef<\n\tElementRef<typeof DialogPrimitive.Overlay>,\n\tComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n\t<DialogPrimitive.Overlay\n\t\tref={ref}\n\t\tclassName={cx(\n\t\t\t\"bg-overlay data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:animate-in data-state-open:fade-in-0 fixed inset-0 z-50 backdrop-blur-sm\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\nconst DialogContent = forwardRef<ElementRef<\"div\">, ComponentPropsWithoutRef<typeof DialogPrimitive.Content>>(\n\t({ className, children, ...props }, ref) => (\n\t\t<DialogPortal>\n\t\t\t<DialogOverlay />\n\t\t\t<div className=\"fixed inset-4 z-50 flex items-center justify-center\">\n\t\t\t\t<DialogPrimitive.Content\n\t\t\t\t\tclassName={cx(\n\t\t\t\t\t\t\"flex max-h-full w-full max-w-lg flex-1 flex-col\",\n\t\t\t\t\t\t\"outline-none focus-within:outline-none\",\n\t\t\t\t\t\t\"border-dialog bg-dialog rounded-xl border shadow-lg transition-transform duration-200\",\n\t\t\t\t\t\t\"data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95\",\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\tref={ref}\n\t\t\t\t\t{...props}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</DialogPrimitive.Content>\n\t\t\t</div>\n\t\t</DialogPortal>\n\t),\n);\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({ className, children, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n\t<div\n\t\tclassName={cx(\n\t\t\t\"border-dialog-muted text-strong relative flex shrink-0 items-center justify-between gap-2 border-b px-6 py-4\",\n\t\t\t\"has-[.icon-button]:pr-4\", // when there are actions in the header, shorten the padding\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t>\n\t\t{children}\n\t</div>\n);\nDialogHeader.displayName = \"DialogHeader\";\n\ntype DialogCloseIconButtonProps = Partial<Omit<IconButtonProps, \"icon\">>;\nconst DialogCloseIconButton = ({\n\tsize = \"md\",\n\ttype = \"button\",\n\tlabel = \"Close Dialog\",\n\tappearance = \"ghost\",\n\t...props\n}: DialogCloseIconButtonProps) => (\n\t<DialogPrimitive.Close asChild>\n\t\t<IconButton appearance={appearance} icon={<X />} label={label} size={size} type={type} {...props} />\n\t</DialogPrimitive.Close>\n);\n\nconst DialogBody = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n\t<div className={cx(\"scrollbar text-body flex-1 overflow-y-auto p-6\", className)} {...props} />\n);\nDialogBody.displayName = \"DialogBody\";\n\nconst DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n\t<div\n\t\tclassName={cx(\"border-dialog-muted flex shrink-0 flex-row-reverse gap-2 border-t px-6 py-4\", className)}\n\t\t{...props}\n\t/>\n);\nDialogFooter.displayName = \"DialogFooter\";\n\nconst DialogTitle = forwardRef<\n\tElementRef<typeof DialogPrimitive.Title>,\n\tComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n\t<DialogPrimitive.Title ref={ref} className={cx(\"text-strong truncate text-lg font-medium\", className)} {...props} />\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\nconst DialogDescription = forwardRef<\n\tElementRef<typeof DialogPrimitive.Description>,\n\tComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n\t<DialogPrimitive.Description ref={ref} className={cx(\"text-muted\", className)} {...props} />\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n\tDialog,\n\tDialogBody,\n\tDialogClose,\n\tDialogCloseIconButton,\n\tDialogContent,\n\tDialogDescription,\n\tDialogFooter,\n\tDialogHeader,\n\tDialogOverlay,\n\tDialogPortal,\n\tDialogTitle,\n\tDialogTrigger,\n};\n"],"mappings":"4NAAA,OAAS,KAAAA,MAAS,0BAClB,UAAYC,MAAqB,yBACjC,OAAS,cAAAC,MAAkB,QAiB1B,cAAAC,EAaC,QAAAC,MAbD,oBAZD,IAAMC,EAAyB,OAEzBC,EAAgC,UAEhCC,EAA+B,SAE/BC,EAA8B,QAE9BC,EAAgBC,EAGpB,CAAC,CAAE,UAAAC,EAAW,GAAGC,CAAM,EAAGC,IAC3BV,EAAiB,UAAhB,CACA,IAAKU,EACL,UAAWC,EACV,iKACAH,CACD,EACC,GAAGC,EACL,CACA,EACDH,EAAc,YAA8B,UAAQ,YAEpD,IAAMM,EAAgBL,EACrB,CAAC,CAAE,UAAAC,EAAW,SAAAK,EAAU,GAAGJ,CAAM,EAAGC,IACnCT,EAACG,EAAA,CACA,UAAAJ,EAACM,EAAA,EAAc,EACfN,EAAC,OAAI,UAAU,sDACd,SAAAA,EAAiB,UAAhB,CACA,UAAWW,EACV,kDACA,yCACA,wFACA,2KACAH,CACD,EACA,IAAKE,EACJ,GAAGD,EAEH,SAAAI,EACF,EACD,GACD,CAEF,EACAD,EAAc,YAA8B,UAAQ,YAEpD,IAAME,EAAe,CAAC,CAAE,UAAAN,EAAW,SAAAK,EAAU,GAAGJ,CAAM,IACrDT,EAAC,OACA,UAAWW,EACV,+GACA,0BACAH,CACD,EACC,GAAGC,EAEH,SAAAI,EACF,EAEDC,EAAa,YAAc,eAG3B,IAAMC,EAAwB,CAAC,CAC9B,KAAAC,EAAO,KACP,KAAAC,EAAO,SACP,MAAAC,EAAQ,eACR,WAAAC,EAAa,QACb,GAAGV,CACJ,IACCT,EAAiB,QAAhB,CAAsB,QAAO,GAC7B,SAAAA,EAACoB,EAAA,CAAW,WAAYD,EAAY,KAAMnB,EAACqB,EAAA,EAAE,EAAI,MAAOH,EAAO,KAAMF,EAAM,KAAMC,EAAO,GAAGR,EAAO,EACnG,EAGKa,EAAa,CAAC,CAAE,UAAAd,EAAW,GAAGC,CAAM,IACzCT,EAAC,OAAI,UAAWW,EAAG,iDAAkDH,CAAS,EAAI,GAAGC,EAAO,EAE7Fa,EAAW,YAAc,aAEzB,IAAMC,EAAe,CAAC,CAAE,UAAAf,EAAW,GAAGC,CAAM,IAC3CT,EAAC,OACA,UAAWW,EAAG,8EAA+EH,CAAS,EACrG,GAAGC,EACL,EAEDc,EAAa,YAAc,eAE3B,IAAMC,EAAcjB,EAGlB,CAAC,CAAE,UAAAC,EAAW,GAAGC,CAAM,EAAGC,IAC3BV,EAAiB,QAAhB,CAAsB,IAAKU,EAAK,UAAWC,EAAG,2CAA4CH,CAAS,EAAI,GAAGC,EAAO,CAClH,EACDe,EAAY,YAA8B,QAAM,YAEhD,IAAMC,EAAoBlB,EAGxB,CAAC,CAAE,UAAAC,EAAW,GAAGC,CAAM,EAAGC,IAC3BV,EAAiB,cAAhB,CAA4B,IAAKU,EAAK,UAAWC,EAAG,aAAcH,CAAS,EAAI,GAAGC,EAAO,CAC1F,EACDgB,EAAkB,YAA8B,cAAY","names":["X","DialogPrimitive","forwardRef","jsx","jsxs","Dialog","DialogTrigger","DialogPortal","DialogClose","DialogOverlay","forwardRef","className","props","ref","cx","DialogContent","children","DialogHeader","DialogCloseIconButton","size","type","label","appearance","IconButton","X","DialogBody","DialogFooter","DialogTitle","DialogDescription"]}
@@ -0,0 +1,22 @@
1
+ import * as react from 'react';
2
+ import { ReactNode } from 'react';
3
+ import { S as SvgAttributes } from './types-BuKAGhC-.js';
4
+
5
+ type IconProps = Omit<SvgAttributes, "children"> & {
6
+ /**
7
+ * A single SVG icon element.
8
+ */
9
+ svg: ReactNode;
10
+ };
11
+ /**
12
+ * Decorates an svg icon with automatic sizing styles and a `shrink-0` class.
13
+ *
14
+ * Merges `className` selectors with the following order of precedence (last one wins):
15
+ * 1. SvgOnly base classes
16
+ * 2. Icon base classes
17
+ * 3. Icon className
18
+ * 4. svg className
19
+ */
20
+ declare const Icon: react.ForwardRefExoticComponent<Omit<IconProps, "ref"> & react.RefAttributes<SVGSVGElement>>;
21
+
22
+ export { type IconProps as I, Icon as a };
package/dist/icon.d.ts CHANGED
@@ -1,24 +1,8 @@
1
+ export { a as Icon, I as IconProps } from './icon-uC5dwP06.js';
1
2
  import * as react from 'react';
2
3
  import { ReactNode } from 'react';
3
4
  import { S as SvgAttributes } from './types-BuKAGhC-.js';
4
5
 
5
- type IconProps = Omit<SvgAttributes, "children"> & {
6
- /**
7
- * A single SVG icon element.
8
- */
9
- svg: ReactNode;
10
- };
11
- /**
12
- * Decorates an svg icon with automatic sizing styles and a `shrink-0` class.
13
- *
14
- * Merges `className` selectors with the following order of precedence (last one wins):
15
- * 1. SvgOnly base classes
16
- * 2. Icon base classes
17
- * 3. Icon className
18
- * 4. svg className
19
- */
20
- declare const Icon: react.ForwardRefExoticComponent<Omit<IconProps, "ref"> & react.RefAttributes<SVGSVGElement>>;
21
-
22
6
  type SvgOnlyProps = Omit<SvgAttributes, "children"> & {
23
7
  /**
24
8
  * A single SVG icon element.
@@ -40,4 +24,4 @@ type SvgOnlyProps = Omit<SvgAttributes, "children"> & {
40
24
  */
41
25
  declare const SvgOnly: react.ForwardRefExoticComponent<Omit<SvgOnlyProps, "ref"> & react.RefAttributes<SVGSVGElement>>;
42
26
 
43
- export { Icon, type IconProps, SvgAttributes, SvgOnly, type SvgOnlyProps };
27
+ export { SvgAttributes, SvgOnly, type SvgOnlyProps };
package/dist/icon.js CHANGED
@@ -1,2 +1,2 @@
1
- import{a as b}from"./chunk-PMSTRJK7.js";import{a}from"./chunk-VJPVAY5J.js";import"./chunk-EW5CFGXT.js";export{b as Icon,a as SvgOnly};
1
+ import"./chunk-72TJUKMV.js";import{a as b}from"./chunk-SMCZZUU4.js";import{a}from"./chunk-VJPVAY5J.js";import"./chunk-EW5CFGXT.js";export{b as Icon,a as SvgOnly};
2
2
  //# sourceMappingURL=icon.js.map
package/dist/input.js CHANGED
@@ -1,2 +1,2 @@
1
- import{a as R}from"./chunk-ERBZR6SY.js";import{a as v}from"./chunk-EW5CFGXT.js";import{a as h}from"./chunk-5E73VWJX.js";import{CheckCircle as M}from"@phosphor-icons/react/CheckCircle";import{Warning as E}from"@phosphor-icons/react/Warning";import{WarningDiamond as H}from"@phosphor-icons/react/WarningDiamond";import L from"clsx";import{createContext as W,forwardRef as x,useContext as A,useRef as N}from"react";import{jsx as o,jsxs as g}from"react/jsx-runtime";var c=x(({children:t,className:e,...r},i)=>{let n=!!t,a=N(null);return n?o(w,{className:e,forwardedRef:i,innerRef:a,...r,children:t}):o(w,{...r,className:e,forwardedRef:i,innerRef:a,children:o(f,{...r})})});c.displayName="Input";var f=x(({"aria-invalid":t,className:e,validation:r,...i},n)=>{let{"aria-invalid":a,forwardedRef:p,innerRef:d,validation:m,...u}=A(C),s=m??r,b=(typeof s=="function"?s():s)||void 0,l=a??t??s==="error",I={...u,...i,type:i.type??u.type??"text"};return o("input",{"aria-invalid":l,"data-validation":b,className:v("placeholder:text-placeholder min-w-0 flex-1 bg-transparent text-left focus:outline-none",e),ref:h(n,p,d),...I})});f.displayName="InputCapture";var C=W({validation:void 0,innerRef:{current:null}}),w=({"aria-invalid":t,"aria-disabled":e,children:r,className:i,disabled:n,forwardedRef:a,innerRef:p,style:d,type:m,validation:u,...s})=>{let l=t!=null&&t!=="false"?"error":typeof u=="function"?u():u,I=t??l==="error";return o(C.Provider,{value:{"aria-invalid":t,"aria-disabled":e,disabled:n,type:m,validation:l,...s,forwardedRef:a,innerRef:p},children:g("div",{"aria-invalid":I,"aria-disabled":n??e,"data-validation":l||void 0,className:v("h-11 text-base sm:h-9 sm:text-sm","bg-form relative flex w-full items-center gap-1.5 rounded-md border px-3 py-2 file:border-0 file:bg-transparent file:text-sm file:font-medium focus-within:outline-none focus-within:ring-4 focus-visible:outline-none focus-visible:ring-4","aria-disabled:opacity-50","has-[input:not(:first-child)]:ps-2.5 has-[input:not(:last-child)]:pe-2.5 [&>:not(input)]:shrink-0 [&_svg]:size-6 sm:[&_svg]:size-5","border-form text-strong has-[:focus-visible]:border-accent-600 has-[:focus-visible]:ring-focus-accent","data-validation-success:border-success-600 has-[:focus-visible]:data-validation-success:border-success-600 has-[:focus-visible]:data-validation-success:ring-focus-success","data-validation-warning:border-warning-600 has-[:focus-visible]:data-validation-warning:border-warning-600 has-[:focus-visible]:data-validation-warning:ring-focus-warning","data-validation-error:border-danger-600 has-[:focus-visible]:data-validation-error:border-danger-600 has-[:focus-visible]:data-validation-error:ring-focus-danger",i),onClick:()=>{p?.current?.focus()},style:d,children:[r,o(V,{name:s.name,validation:l})]})})};var V=({name:t,validation:e})=>{switch(e){case"error":return g("div",{className:"text-danger-600 pointer-events-none order-last select-none",children:[o("span",{className:"sr-only",children:L("The value entered for the",t,"input has failed validation.")}),o(E,{"aria-hidden":!0,weight:"fill"})]});case"success":return o("div",{className:"text-success-600 pointer-events-none order-last select-none",children:o(M,{weight:"fill"})});case"warning":return o("div",{className:"text-warning-600 pointer-events-none order-last select-none",children:o(H,{weight:"fill"})});default:return null}};import{Eye as O}from"@phosphor-icons/react/Eye";import{EyeClosed as j}from"@phosphor-icons/react/EyeClosed";import{forwardRef as B,useEffect as k,useState as F}from"react";import{jsx as P,jsxs as y}from"react/jsx-runtime";var T=B(({onValueVisibilityChange:t,showValue:e=!1,...r},i)=>{let[n,a]=F(e),p=n?"text":"password",d=n?O:j;return k(()=>{a(e)},[e]),y(c,{type:p,ref:i,...r,children:[P(f,{}),y("button",{type:"button",tabIndex:-1,className:"text-body hover:text-strong ml-1 cursor-pointer bg-inherit p-0",onClick:()=>{a(!n),t?.(!n)},children:[y("span",{className:"sr-only",children:["Turn password visibility ",n?"off":"on"]}),P(d,{"aria-hidden":!0})]})]})});T.displayName="PasswordInput";export{c as Input,f as InputCapture,T as PasswordInput,R as isInput};
1
+ import{a as R}from"./chunk-ERBZR6SY.js";import{a as h}from"./chunk-5E73VWJX.js";import{a as v}from"./chunk-EW5CFGXT.js";import{CheckCircle as M}from"@phosphor-icons/react/CheckCircle";import{Warning as E}from"@phosphor-icons/react/Warning";import{WarningDiamond as H}from"@phosphor-icons/react/WarningDiamond";import L from"clsx";import{createContext as W,forwardRef as x,useContext as A,useRef as N}from"react";import{jsx as o,jsxs as g}from"react/jsx-runtime";var c=x(({children:t,className:e,...r},i)=>{let n=!!t,a=N(null);return n?o(w,{className:e,forwardedRef:i,innerRef:a,...r,children:t}):o(w,{...r,className:e,forwardedRef:i,innerRef:a,children:o(f,{...r})})});c.displayName="Input";var f=x(({"aria-invalid":t,className:e,validation:r,...i},n)=>{let{"aria-invalid":a,forwardedRef:p,innerRef:d,validation:m,...u}=A(C),s=m??r,b=(typeof s=="function"?s():s)||void 0,l=a??t??s==="error",I={...u,...i,type:i.type??u.type??"text"};return o("input",{"aria-invalid":l,"data-validation":b,className:v("placeholder:text-placeholder min-w-0 flex-1 bg-transparent text-left focus:outline-none",e),ref:h(n,p,d),...I})});f.displayName="InputCapture";var C=W({validation:void 0,innerRef:{current:null}}),w=({"aria-invalid":t,"aria-disabled":e,children:r,className:i,disabled:n,forwardedRef:a,innerRef:p,style:d,type:m,validation:u,...s})=>{let l=t!=null&&t!=="false"?"error":typeof u=="function"?u():u,I=t??l==="error";return o(C.Provider,{value:{"aria-invalid":t,"aria-disabled":e,disabled:n,type:m,validation:l,...s,forwardedRef:a,innerRef:p},children:g("div",{"aria-invalid":I,"aria-disabled":n??e,"data-validation":l||void 0,className:v("h-11 text-base sm:h-9 sm:text-sm","bg-form relative flex w-full items-center gap-1.5 rounded-md border px-3 py-2 file:border-0 file:bg-transparent file:text-sm file:font-medium focus-within:outline-none focus-within:ring-4 focus-visible:outline-none focus-visible:ring-4","aria-disabled:opacity-50","has-[input:not(:first-child)]:ps-2.5 has-[input:not(:last-child)]:pe-2.5 [&>:not(input)]:shrink-0 [&_svg]:size-6 sm:[&_svg]:size-5","border-form text-strong has-[:focus-visible]:border-accent-600 has-[:focus-visible]:ring-focus-accent","data-validation-success:border-success-600 has-[:focus-visible]:data-validation-success:border-success-600 has-[:focus-visible]:data-validation-success:ring-focus-success","data-validation-warning:border-warning-600 has-[:focus-visible]:data-validation-warning:border-warning-600 has-[:focus-visible]:data-validation-warning:ring-focus-warning","data-validation-error:border-danger-600 has-[:focus-visible]:data-validation-error:border-danger-600 has-[:focus-visible]:data-validation-error:ring-focus-danger",i),onClick:()=>{p?.current?.focus()},style:d,children:[r,o(V,{name:s.name,validation:l})]})})};var V=({name:t,validation:e})=>{switch(e){case"error":return g("div",{className:"text-danger-600 pointer-events-none order-last select-none",children:[o("span",{className:"sr-only",children:L("The value entered for the",t,"input has failed validation.")}),o(E,{"aria-hidden":!0,weight:"fill"})]});case"success":return o("div",{className:"text-success-600 pointer-events-none order-last select-none",children:o(M,{weight:"fill"})});case"warning":return o("div",{className:"text-warning-600 pointer-events-none order-last select-none",children:o(H,{weight:"fill"})});default:return null}};import{Eye as O}from"@phosphor-icons/react/Eye";import{EyeClosed as j}from"@phosphor-icons/react/EyeClosed";import{forwardRef as B,useEffect as k,useState as F}from"react";import{jsx as P,jsxs as y}from"react/jsx-runtime";var T=B(({onValueVisibilityChange:t,showValue:e=!1,...r},i)=>{let[n,a]=F(e),p=n?"text":"password",d=n?O:j;return k(()=>{a(e)},[e]),y(c,{type:p,ref:i,...r,children:[P(f,{}),y("button",{type:"button",tabIndex:-1,className:"text-body hover:text-strong ml-1 cursor-pointer bg-inherit p-0",onClick:()=>{a(!n),t?.(!n)},children:[y("span",{className:"sr-only",children:["Turn password visibility ",n?"off":"on"]}),P(d,{"aria-hidden":!0})]})]})});T.displayName="PasswordInput";export{c as Input,f as InputCapture,T as PasswordInput,R as isInput};
2
2
  //# sourceMappingURL=input.js.map
@@ -1,2 +1,2 @@
1
- import{a as b,c as v,d as x,e as y,g as h}from"./chunk-6ZEJCZAD.js";import{b as z}from"./chunk-CXQLUXDJ.js";import{a as d}from"./chunk-VTEPKCRP.js";import{a as l}from"./chunk-XLFJLMPU.js";import"./chunk-25GJN3ZK.js";import"./chunk-4LSFAAZW.js";import"./chunk-RDMTCZPT.js";import"./chunk-PMSTRJK7.js";import"./chunk-VJPVAY5J.js";import{a as p}from"./chunk-EW5CFGXT.js";import"./chunk-5E73VWJX.js";import{CaretLeft as j}from"@phosphor-icons/react/dist/icons/CaretLeft";import{CaretRight as k}from"@phosphor-icons/react/dist/icons/CaretRight";import{Slot as A}from"@radix-ui/react-slot";import{createContext as F,forwardRef as m,useContext as N,useState as W}from"react";import P from"tiny-invariant";import{jsx as s,jsxs as f}from"react/jsx-runtime";var c=F(void 0),O=m(({className:n,children:e,defaultPageSize:a,...t},i)=>{let[o,r]=W(a);return s(c.Provider,{value:{defaultPageSize:a,pageSize:o,setPageSize:r},children:s("div",{className:p("inline-flex items-center justify-between gap-2",n),ref:i,...t,children:e})})});O.displayName="CursorPagination";var T=m(({hasNextPage:n,hasPreviousPage:e,onNextPage:a,onPreviousPage:t,...i},o)=>f(d,{appearance:"panel",ref:o,...i,children:[s(l,{appearance:"ghost",disabled:!e,icon:s(j,{}),label:"Previous page",onClick:t,size:"sm",type:"button"}),s(z,{orientation:"vertical",className:"min-h-5"}),s(l,{appearance:"ghost",disabled:!n,icon:s(k,{}),label:"Next page",onClick:a,size:"sm",type:"button"})]}));T.displayName="CursorButtons";var $=[5,10,20,50,100],B=m(({className:n,pageSizes:e=$,onChangePageSize:a,...t},i)=>{let o=N(c);return P(o,"CursorPageSizeSelect must be used as a child of a CursorPagination component"),P(e.includes(o.defaultPageSize),"CursorPagination.defaultPageSize must be included in CursorPageSizeSelect.pageSizes"),P(e.includes(o.pageSize),"CursorPagination.pageSize must be included in CursorPageSizeSelect.pageSizes"),f(b,{defaultValue:`${o.pageSize}`,onChange:r=>{let g=Number.parseInt(r,10);Number.isNaN(g)&&(g=o.defaultPageSize),o.setPageSize(g),a?.(g)},children:[s(x,{ref:i,className:p("w-auto min-w-36",n),value:o.pageSize,...t,children:s(v,{})}),s(y,{width:"trigger",children:e.map(r=>f(h,{value:`${r}`,children:[r," per page"]},r))})]})});B.displayName="CursorPageSizeSelect";function D({asChild:n=!1,className:e,...a}){let t=N(c);return P(t,"CursorPageSizeValue must be used as a child of a CursorPagination component"),f(n?A:"span",{className:p("text-muted text-sm font-normal",e),...a,children:[t.pageSize," per page"]})}import{useEffect as V,useState as w}from"react";function H({listSize:n,pageSize:e}){let[a,t]=w(1),[i,o]=w(e);V(()=>{o(e),t(1)},[e]),V(()=>{t(1)},[n]);let r=Math.ceil(n/i),g=(a-1)*i,S=a>1,C=a<r;function M(u){let U=Math.max(1,Math.min(u,r));t(U)}function E(){C&&t(u=>Math.min(u+1,r))}function R(){S&&t(u=>Math.max(u-1,1))}function G(u){o(u),t(1)}function I(){t(r)}function L(){t(1)}return{currentPage:a,goToFirstPage:L,goToLastPage:I,goToPage:M,hasNextPage:C,hasPreviousPage:S,nextPage:E,offset:g,pageSize:i,previousPage:R,setPageSize:G,totalPages:r}}function q(n,e){return n.slice(e.offset,e.offset+e.pageSize)}export{T as CursorButtons,B as CursorPageSizeSelect,D as CursorPageSizeValue,O as CursorPagination,q as getOffsetPaginatedSlice,H as useOffsetPagination};
1
+ import{a as b,c as v,d as x,e as y,g as h}from"./chunk-E6LNHWJ3.js";import{b as z}from"./chunk-CXQLUXDJ.js";import"./chunk-5E73VWJX.js";import{a as d}from"./chunk-VTEPKCRP.js";import{a as l}from"./chunk-7AUDKKSM.js";import"./chunk-L2JX4GJ6.js";import"./chunk-4LSFAAZW.js";import"./chunk-RDMTCZPT.js";import"./chunk-72TJUKMV.js";import"./chunk-SMCZZUU4.js";import"./chunk-VJPVAY5J.js";import{a as p}from"./chunk-EW5CFGXT.js";import{CaretLeft as j}from"@phosphor-icons/react/dist/icons/CaretLeft";import{CaretRight as k}from"@phosphor-icons/react/dist/icons/CaretRight";import{Slot as A}from"@radix-ui/react-slot";import{createContext as F,forwardRef as m,useContext as N,useState as W}from"react";import P from"tiny-invariant";import{jsx as s,jsxs as f}from"react/jsx-runtime";var c=F(void 0),O=m(({className:n,children:e,defaultPageSize:a,...t},i)=>{let[o,r]=W(a);return s(c.Provider,{value:{defaultPageSize:a,pageSize:o,setPageSize:r},children:s("div",{className:p("inline-flex items-center justify-between gap-2",n),ref:i,...t,children:e})})});O.displayName="CursorPagination";var T=m(({hasNextPage:n,hasPreviousPage:e,onNextPage:a,onPreviousPage:t,...i},o)=>f(d,{appearance:"panel",ref:o,...i,children:[s(l,{appearance:"ghost",disabled:!e,icon:s(j,{}),label:"Previous page",onClick:t,size:"sm",type:"button"}),s(z,{orientation:"vertical",className:"min-h-5"}),s(l,{appearance:"ghost",disabled:!n,icon:s(k,{}),label:"Next page",onClick:a,size:"sm",type:"button"})]}));T.displayName="CursorButtons";var $=[5,10,20,50,100],B=m(({className:n,pageSizes:e=$,onChangePageSize:a,...t},i)=>{let o=N(c);return P(o,"CursorPageSizeSelect must be used as a child of a CursorPagination component"),P(e.includes(o.defaultPageSize),"CursorPagination.defaultPageSize must be included in CursorPageSizeSelect.pageSizes"),P(e.includes(o.pageSize),"CursorPagination.pageSize must be included in CursorPageSizeSelect.pageSizes"),f(b,{defaultValue:`${o.pageSize}`,onChange:r=>{let g=Number.parseInt(r,10);Number.isNaN(g)&&(g=o.defaultPageSize),o.setPageSize(g),a?.(g)},children:[s(x,{ref:i,className:p("w-auto min-w-36",n),value:o.pageSize,...t,children:s(v,{})}),s(y,{width:"trigger",children:e.map(r=>f(h,{value:`${r}`,children:[r," per page"]},r))})]})});B.displayName="CursorPageSizeSelect";function D({asChild:n=!1,className:e,...a}){let t=N(c);return P(t,"CursorPageSizeValue must be used as a child of a CursorPagination component"),f(n?A:"span",{className:p("text-muted text-sm font-normal",e),...a,children:[t.pageSize," per page"]})}import{useEffect as V,useState as w}from"react";function H({listSize:n,pageSize:e}){let[a,t]=w(1),[i,o]=w(e);V(()=>{o(e),t(1)},[e]),V(()=>{t(1)},[n]);let r=Math.ceil(n/i),g=(a-1)*i,S=a>1,C=a<r;function M(u){let U=Math.max(1,Math.min(u,r));t(U)}function E(){C&&t(u=>Math.min(u+1,r))}function R(){S&&t(u=>Math.max(u-1,1))}function G(u){o(u),t(1)}function I(){t(r)}function L(){t(1)}return{currentPage:a,goToFirstPage:L,goToLastPage:I,goToPage:M,hasNextPage:C,hasPreviousPage:S,nextPage:E,offset:g,pageSize:i,previousPage:R,setPageSize:G,totalPages:r}}function q(n,e){return n.slice(e.offset,e.offset+e.pageSize)}export{T as CursorButtons,B as CursorPageSizeSelect,D as CursorPageSizeValue,O as CursorPagination,q as getOffsetPaginatedSlice,H as useOffsetPagination};
2
2
  //# sourceMappingURL=pagination.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/pagination/cursor-pagination.tsx","../src/components/pagination/use-offset-pagination.tsx"],"sourcesContent":["import { CaretLeft } from \"@phosphor-icons/react/dist/icons/CaretLeft\";\nimport { CaretRight } from \"@phosphor-icons/react/dist/icons/CaretRight\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { createContext, forwardRef, useContext, useState, type ComponentProps, type ElementRef } from \"react\";\nimport invariant from \"tiny-invariant\";\nimport type { WithAsChild } from \"../../types/as-child.js\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport { ButtonGroup, IconButton } from \"../button/index.js\";\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from \"../select/select.js\";\nimport { Separator } from \"../separator/separator.js\";\n\ntype CursorPaginationContextValue = {\n\t/**\n\t * The default number of items per page.\n\t */\n\tdefaultPageSize: number;\n\t/**\n\t * The current number of items per page.\n\t */\n\tpageSize: number;\n\t/**\n\t * A function to set the number of items per page.\n\t */\n\tsetPageSize: (value: number) => void;\n};\n\nconst CursorPaginationContext = createContext<CursorPaginationContextValue | undefined>(undefined);\n\ntype CursorPaginationProps = ComponentProps<\"div\"> & {\n\t/**\n\t * The default number of items per page.\n\t */\n\tdefaultPageSize: number;\n};\n\n/**\n * A pagination component for use with cursor-based pagination.\n *\n * Cursor-based pagination is a way of loading data in chunks by using a cursor\n * from the last item on the current page to know where to start the next set,\n * making sure nothing is missed or repeated. Like a linked list, but for chunks\n * of data. It doesn't let you jump to a specific page or know how many total pages\n * there are, but it's more efficient for large or real-time data sets.\n */\nconst CursorPagination = forwardRef<HTMLDivElement, CursorPaginationProps>(\n\t({ className, children, defaultPageSize, ...props }, ref) => {\n\t\tconst [pageSize, setPageSize] = useState<number>(defaultPageSize);\n\n\t\treturn (\n\t\t\t<CursorPaginationContext.Provider value={{ defaultPageSize, pageSize, setPageSize }}>\n\t\t\t\t<div className={cx(\"inline-flex items-center justify-between gap-2\", className)} ref={ref} {...props}>\n\t\t\t\t\t{children}\n\t\t\t\t</div>\n\t\t\t</CursorPaginationContext.Provider>\n\t\t);\n\t},\n);\nCursorPagination.displayName = \"CursorPagination\";\n\ntype CursorButtonsProps = Omit<ComponentProps<typeof ButtonGroup>, \"appearance\"> & {\n\t/**\n\t * Whether there is a next page of data to load.\n\t */\n\thasNextPage: boolean;\n\t/**\n\t * Whether there is a previous page of data to load.\n\t */\n\thasPreviousPage: boolean;\n\t/**\n\t * A callback that is called when the next page button is clicked.\n\t */\n\tonNextPage?: () => void;\n\t/**\n\t * A callback that is called when the previous page button is clicked.\n\t */\n\tonPreviousPage?: () => void;\n};\n\n/**\n * A pair of buttons for navigating between pages of data when using cursor-based pagination.\n */\nconst CursorButtons = forwardRef<ElementRef<typeof ButtonGroup>, CursorButtonsProps>(\n\t({ hasNextPage, hasPreviousPage, onNextPage, onPreviousPage, ...props }, ref) => {\n\t\t// TODO(cody): this _feels_ like a good spot for left and right arrow keys to navigate between pages when focused on the buttons\n\n\t\treturn (\n\t\t\t<ButtonGroup appearance=\"panel\" ref={ref} {...props}>\n\t\t\t\t<IconButton\n\t\t\t\t\tappearance=\"ghost\"\n\t\t\t\t\tdisabled={!hasPreviousPage}\n\t\t\t\t\ticon={<CaretLeft />}\n\t\t\t\t\tlabel=\"Previous page\"\n\t\t\t\t\tonClick={onPreviousPage}\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t/>\n\t\t\t\t<Separator orientation=\"vertical\" className=\"min-h-5\" />\n\t\t\t\t<IconButton\n\t\t\t\t\tappearance=\"ghost\"\n\t\t\t\t\tdisabled={!hasNextPage}\n\t\t\t\t\ticon={<CaretRight />}\n\t\t\t\t\tlabel=\"Next page\"\n\t\t\t\t\tonClick={onNextPage}\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t/>\n\t\t\t</ButtonGroup>\n\t\t);\n\t},\n);\nCursorButtons.displayName = \"CursorButtons\";\n\nconst defaultPageSizes = [5, 10, 20, 50, 100] as const;\n\ntype CursorPageSizeSelectProps = Omit<ComponentProps<typeof SelectTrigger>, \"children\"> & {\n\t/**\n\t * A list of page sizes to choose from. The default page size must be included in this list.\n\t */\n\tpageSizes?: typeof defaultPageSizes | readonly number[];\n\t/**\n\t * A callback that is called when the page size is changed.\n\t */\n\tonChangePageSize?: (value: number) => void;\n};\n\n/**\n * A select input for changing the number of items per page when using cursor-based pagination.\n */\nconst CursorPageSizeSelect = forwardRef<ElementRef<typeof SelectTrigger>, CursorPageSizeSelectProps>(\n\t({ className, pageSizes = defaultPageSizes, onChangePageSize, ...rest }, ref) => {\n\t\tconst ctx = useContext(CursorPaginationContext);\n\n\t\tinvariant(ctx, \"CursorPageSizeSelect must be used as a child of a CursorPagination component\");\n\n\t\tinvariant(\n\t\t\tpageSizes.includes(ctx.defaultPageSize),\n\t\t\t\"CursorPagination.defaultPageSize must be included in CursorPageSizeSelect.pageSizes\",\n\t\t);\n\n\t\tinvariant(\n\t\t\tpageSizes.includes(ctx.pageSize),\n\t\t\t\"CursorPagination.pageSize must be included in CursorPageSizeSelect.pageSizes\",\n\t\t);\n\n\t\treturn (\n\t\t\t<Select\n\t\t\t\tdefaultValue={`${ctx.pageSize}`}\n\t\t\t\tonChange={(value) => {\n\t\t\t\t\tlet newPageSize = Number.parseInt(value, 10);\n\t\t\t\t\tif (Number.isNaN(newPageSize)) {\n\t\t\t\t\t\tnewPageSize = ctx.defaultPageSize;\n\t\t\t\t\t}\n\t\t\t\t\tctx.setPageSize(newPageSize);\n\t\t\t\t\tonChangePageSize?.(newPageSize);\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<SelectTrigger ref={ref} className={cx(\"w-auto min-w-36\", className)} value={ctx.pageSize} {...rest}>\n\t\t\t\t\t<SelectValue />\n\t\t\t\t</SelectTrigger>\n\t\t\t\t<SelectContent width=\"trigger\">\n\t\t\t\t\t{pageSizes.map((size) => (\n\t\t\t\t\t\t<SelectItem key={size} value={`${size}`}>\n\t\t\t\t\t\t\t{size} per page\n\t\t\t\t\t\t</SelectItem>\n\t\t\t\t\t))}\n\t\t\t\t</SelectContent>\n\t\t\t</Select>\n\t\t);\n\t},\n);\nCursorPageSizeSelect.displayName = \"CursorPageSizeSelect\";\n\ntype CursorPageSizeValueProps = Omit<ComponentProps<\"span\">, \"children\"> & WithAsChild;\n\n/**\n * Displays the current page size when using cursor-based pagination as a read-only value.\n */\nfunction CursorPageSizeValue({ asChild = false, className, ...props }: CursorPageSizeValueProps) {\n\tconst ctx = useContext(CursorPaginationContext);\n\n\tinvariant(ctx, \"CursorPageSizeValue must be used as a child of a CursorPagination component\");\n\n\tconst Component = asChild ? Slot : \"span\";\n\n\treturn (\n\t\t<Component className={cx(\"text-muted text-sm font-normal\", className)} {...props}>\n\t\t\t{ctx.pageSize} per page\n\t\t</Component>\n\t);\n}\n\nexport {\n\t//,\n\tCursorButtons,\n\tCursorPageSizeSelect,\n\tCursorPageSizeValue,\n\tCursorPagination,\n};\n\nexport type {\n\t//,\n\tCursorButtonsProps,\n\tCursorPageSizeSelectProps,\n\tCursorPageSizeValueProps,\n\tCursorPaginationProps,\n};\n","import { useEffect, useState } from \"react\";\n\ntype UseOffsetPaginationProps = {\n\t/**\n\t * The total number of items in the list to be paginated.\n\t */\n\tlistSize: number;\n\t/**\n\t * The number of items per page.\n\t */\n\tpageSize: number;\n};\n\ntype OffsetPaginationState = {\n\t/**\n\t * The current page number, 1-indexed (starting at 1).\n\t */\n\tcurrentPage: number;\n\t/**\n\t * Whether there is a previous page.\n\t */\n\thasPreviousPage: boolean;\n\t/**\n\t * Whether there is a next page.\n\t */\n\thasNextPage: boolean;\n\t/**\n\t * Go to a specific page.\n\t */\n\tgoToPage: (page: number) => void;\n\t/**\n\t * Go to the first page.\n\t */\n\tgoToFirstPage: () => void;\n\t/**\n\t * Go to the last page.\n\t */\n\tgoToLastPage: () => void;\n\t/**\n\t * Go to the next page.\n\t */\n\tnextPage: () => void;\n\t/**\n\t * The offset of the current page in the list.\n\t */\n\toffset: number;\n\t/**\n\t * The number of items per page.\n\t */\n\tpageSize: number;\n\t/**\n\t * Go to the previous page.\n\t */\n\tpreviousPage: () => void;\n\t/**\n\t * Set the number of items per page. This will reset the current page to the first page.\n\t */\n\tsetPageSize: (size: number) => void;\n\t/**\n\t * The total number of pages.\n\t */\n\ttotalPages: number;\n};\n\n/**\n * A headless hook for managing offset-based pagination state\n */\nfunction useOffsetPagination({ listSize, pageSize }: UseOffsetPaginationProps): OffsetPaginationState {\n\tconst [currentPage, setCurrentPage] = useState(1);\n\tconst [currentPageSize, setCurrentPageSize] = useState(pageSize);\n\n\t// Reset the current page to 1 when the page size prop changes\n\tuseEffect(() => {\n\t\tsetCurrentPageSize(pageSize);\n\t\tsetCurrentPage(1);\n\t}, [pageSize]);\n\n\t// Reset the current page to 1 when the list size prop changes\n\tuseEffect(() => {\n\t\tsetCurrentPage(1);\n\t}, [listSize]);\n\n\tconst totalPages = Math.ceil(listSize / currentPageSize);\n\tconst offset = (currentPage - 1) * currentPageSize;\n\n\tconst hasPreviousPage = currentPage > 1;\n\tconst hasNextPage = currentPage < totalPages;\n\n\tfunction goToPage(page: number) {\n\t\tconst nextPage = Math.max(1, Math.min(page, totalPages));\n\t\tsetCurrentPage(nextPage);\n\t}\n\n\tfunction nextPage() {\n\t\tif (hasNextPage) {\n\t\t\tsetCurrentPage((prev) => Math.min(prev + 1, totalPages));\n\t\t}\n\t}\n\n\tfunction previousPage() {\n\t\tif (hasPreviousPage) {\n\t\t\tsetCurrentPage((prev) => Math.max(prev - 1, 1));\n\t\t}\n\t}\n\n\tfunction setPageSize(size: number) {\n\t\tsetCurrentPageSize(size);\n\t\tsetCurrentPage(1); // reset to the first page when page size changes\n\t}\n\n\tfunction goToLastPage() {\n\t\tsetCurrentPage(totalPages);\n\t}\n\n\tfunction goToFirstPage() {\n\t\tsetCurrentPage(1);\n\t}\n\n\treturn {\n\t\tcurrentPage,\n\t\tgoToFirstPage,\n\t\tgoToLastPage,\n\t\tgoToPage,\n\t\thasNextPage,\n\t\thasPreviousPage,\n\t\tnextPage,\n\t\toffset,\n\t\tpageSize: currentPageSize,\n\t\tpreviousPage,\n\t\tsetPageSize,\n\t\ttotalPages,\n\t};\n}\n\n/**\n * Get a paginated slice of a list based on the current offset pagination state.\n */\nfunction getOffsetPaginatedSlice<T>(list: readonly T[], pagination: OffsetPaginationState): T[] {\n\treturn list.slice(pagination.offset, pagination.offset + pagination.pageSize);\n}\n\nexport {\n\t//,\n\tgetOffsetPaginatedSlice,\n\tuseOffsetPagination,\n};\n\nexport type {\n\t//,\n\tOffsetPaginationState,\n\tUseOffsetPaginationProps,\n};\n"],"mappings":"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","names":["CaretLeft","CaretRight","Slot","createContext","forwardRef","useContext","useState","invariant","jsx","jsxs","CursorPaginationContext","createContext","CursorPagination","forwardRef","className","children","defaultPageSize","props","ref","pageSize","setPageSize","useState","cx","CursorButtons","hasNextPage","hasPreviousPage","onNextPage","onPreviousPage","ButtonGroup","IconButton","CaretLeft","Separator","CaretRight","defaultPageSizes","CursorPageSizeSelect","pageSizes","onChangePageSize","rest","ctx","useContext","invariant","Select","value","newPageSize","SelectTrigger","SelectValue","SelectContent","size","SelectItem","CursorPageSizeValue","asChild","Slot","useEffect","useState","useOffsetPagination","listSize","pageSize","currentPage","setCurrentPage","currentPageSize","setCurrentPageSize","totalPages","offset","hasPreviousPage","hasNextPage","goToPage","page","nextPage","prev","previousPage","setPageSize","size","goToLastPage","goToFirstPage","getOffsetPaginatedSlice","list","pagination"]}
1
+ {"version":3,"sources":["../src/components/pagination/cursor-pagination.tsx","../src/components/pagination/use-offset-pagination.tsx"],"sourcesContent":["import { CaretLeft } from \"@phosphor-icons/react/dist/icons/CaretLeft\";\nimport { CaretRight } from \"@phosphor-icons/react/dist/icons/CaretRight\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { createContext, forwardRef, useContext, useState, type ComponentProps, type ElementRef } from \"react\";\nimport invariant from \"tiny-invariant\";\nimport type { WithAsChild } from \"../../types/as-child.js\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport { ButtonGroup, IconButton } from \"../button/index.js\";\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from \"../select/select.js\";\nimport { Separator } from \"../separator/separator.js\";\n\ntype CursorPaginationContextValue = {\n\t/**\n\t * The default number of items per page.\n\t */\n\tdefaultPageSize: number;\n\t/**\n\t * The current number of items per page.\n\t */\n\tpageSize: number;\n\t/**\n\t * A function to set the number of items per page.\n\t */\n\tsetPageSize: (value: number) => void;\n};\n\nconst CursorPaginationContext = createContext<CursorPaginationContextValue | undefined>(undefined);\n\ntype CursorPaginationProps = ComponentProps<\"div\"> & {\n\t/**\n\t * The default number of items per page.\n\t */\n\tdefaultPageSize: number;\n};\n\n/**\n * A pagination component for use with cursor-based pagination.\n *\n * Cursor-based pagination is a way of loading data in chunks by using a cursor\n * from the last item on the current page to know where to start the next set,\n * making sure nothing is missed or repeated. Like a linked list, but for chunks\n * of data. It doesn't let you jump to a specific page or know how many total pages\n * there are, but it's more efficient for large or real-time data sets.\n */\nconst CursorPagination = forwardRef<HTMLDivElement, CursorPaginationProps>(\n\t({ className, children, defaultPageSize, ...props }, ref) => {\n\t\tconst [pageSize, setPageSize] = useState<number>(defaultPageSize);\n\n\t\treturn (\n\t\t\t<CursorPaginationContext.Provider value={{ defaultPageSize, pageSize, setPageSize }}>\n\t\t\t\t<div className={cx(\"inline-flex items-center justify-between gap-2\", className)} ref={ref} {...props}>\n\t\t\t\t\t{children}\n\t\t\t\t</div>\n\t\t\t</CursorPaginationContext.Provider>\n\t\t);\n\t},\n);\nCursorPagination.displayName = \"CursorPagination\";\n\ntype CursorButtonsProps = Omit<ComponentProps<typeof ButtonGroup>, \"appearance\"> & {\n\t/**\n\t * Whether there is a next page of data to load.\n\t */\n\thasNextPage: boolean;\n\t/**\n\t * Whether there is a previous page of data to load.\n\t */\n\thasPreviousPage: boolean;\n\t/**\n\t * A callback that is called when the next page button is clicked.\n\t */\n\tonNextPage?: () => void;\n\t/**\n\t * A callback that is called when the previous page button is clicked.\n\t */\n\tonPreviousPage?: () => void;\n};\n\n/**\n * A pair of buttons for navigating between pages of data when using cursor-based pagination.\n */\nconst CursorButtons = forwardRef<ElementRef<typeof ButtonGroup>, CursorButtonsProps>(\n\t({ hasNextPage, hasPreviousPage, onNextPage, onPreviousPage, ...props }, ref) => {\n\t\t// TODO(cody): this _feels_ like a good spot for left and right arrow keys to navigate between pages when focused on the buttons\n\n\t\treturn (\n\t\t\t<ButtonGroup appearance=\"panel\" ref={ref} {...props}>\n\t\t\t\t<IconButton\n\t\t\t\t\tappearance=\"ghost\"\n\t\t\t\t\tdisabled={!hasPreviousPage}\n\t\t\t\t\ticon={<CaretLeft />}\n\t\t\t\t\tlabel=\"Previous page\"\n\t\t\t\t\tonClick={onPreviousPage}\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t/>\n\t\t\t\t<Separator orientation=\"vertical\" className=\"min-h-5\" />\n\t\t\t\t<IconButton\n\t\t\t\t\tappearance=\"ghost\"\n\t\t\t\t\tdisabled={!hasNextPage}\n\t\t\t\t\ticon={<CaretRight />}\n\t\t\t\t\tlabel=\"Next page\"\n\t\t\t\t\tonClick={onNextPage}\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t/>\n\t\t\t</ButtonGroup>\n\t\t);\n\t},\n);\nCursorButtons.displayName = \"CursorButtons\";\n\nconst defaultPageSizes = [5, 10, 20, 50, 100] as const;\n\ntype CursorPageSizeSelectProps = Omit<ComponentProps<typeof SelectTrigger>, \"children\"> & {\n\t/**\n\t * A list of page sizes to choose from. The default page size must be included in this list.\n\t */\n\tpageSizes?: typeof defaultPageSizes | readonly number[];\n\t/**\n\t * A callback that is called when the page size is changed.\n\t */\n\tonChangePageSize?: (value: number) => void;\n};\n\n/**\n * A select input for changing the number of items per page when using cursor-based pagination.\n */\nconst CursorPageSizeSelect = forwardRef<ElementRef<typeof SelectTrigger>, CursorPageSizeSelectProps>(\n\t({ className, pageSizes = defaultPageSizes, onChangePageSize, ...rest }, ref) => {\n\t\tconst ctx = useContext(CursorPaginationContext);\n\n\t\tinvariant(ctx, \"CursorPageSizeSelect must be used as a child of a CursorPagination component\");\n\n\t\tinvariant(\n\t\t\tpageSizes.includes(ctx.defaultPageSize),\n\t\t\t\"CursorPagination.defaultPageSize must be included in CursorPageSizeSelect.pageSizes\",\n\t\t);\n\n\t\tinvariant(\n\t\t\tpageSizes.includes(ctx.pageSize),\n\t\t\t\"CursorPagination.pageSize must be included in CursorPageSizeSelect.pageSizes\",\n\t\t);\n\n\t\treturn (\n\t\t\t<Select\n\t\t\t\tdefaultValue={`${ctx.pageSize}`}\n\t\t\t\tonChange={(value) => {\n\t\t\t\t\tlet newPageSize = Number.parseInt(value, 10);\n\t\t\t\t\tif (Number.isNaN(newPageSize)) {\n\t\t\t\t\t\tnewPageSize = ctx.defaultPageSize;\n\t\t\t\t\t}\n\t\t\t\t\tctx.setPageSize(newPageSize);\n\t\t\t\t\tonChangePageSize?.(newPageSize);\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<SelectTrigger ref={ref} className={cx(\"w-auto min-w-36\", className)} value={ctx.pageSize} {...rest}>\n\t\t\t\t\t<SelectValue />\n\t\t\t\t</SelectTrigger>\n\t\t\t\t<SelectContent width=\"trigger\">\n\t\t\t\t\t{pageSizes.map((size) => (\n\t\t\t\t\t\t<SelectItem key={size} value={`${size}`}>\n\t\t\t\t\t\t\t{size} per page\n\t\t\t\t\t\t</SelectItem>\n\t\t\t\t\t))}\n\t\t\t\t</SelectContent>\n\t\t\t</Select>\n\t\t);\n\t},\n);\nCursorPageSizeSelect.displayName = \"CursorPageSizeSelect\";\n\ntype CursorPageSizeValueProps = Omit<ComponentProps<\"span\">, \"children\"> & WithAsChild;\n\n/**\n * Displays the current page size when using cursor-based pagination as a read-only value.\n */\nfunction CursorPageSizeValue({ asChild = false, className, ...props }: CursorPageSizeValueProps) {\n\tconst ctx = useContext(CursorPaginationContext);\n\n\tinvariant(ctx, \"CursorPageSizeValue must be used as a child of a CursorPagination component\");\n\n\tconst Component = asChild ? Slot : \"span\";\n\n\treturn (\n\t\t<Component className={cx(\"text-muted text-sm font-normal\", className)} {...props}>\n\t\t\t{ctx.pageSize} per page\n\t\t</Component>\n\t);\n}\n\nexport {\n\t//,\n\tCursorButtons,\n\tCursorPageSizeSelect,\n\tCursorPageSizeValue,\n\tCursorPagination,\n};\n\nexport type {\n\t//,\n\tCursorButtonsProps,\n\tCursorPageSizeSelectProps,\n\tCursorPageSizeValueProps,\n\tCursorPaginationProps,\n};\n","import { useEffect, useState } from \"react\";\n\ntype UseOffsetPaginationProps = {\n\t/**\n\t * The total number of items in the list to be paginated.\n\t */\n\tlistSize: number;\n\t/**\n\t * The number of items per page.\n\t */\n\tpageSize: number;\n};\n\ntype OffsetPaginationState = {\n\t/**\n\t * The current page number, 1-indexed (starting at 1).\n\t */\n\tcurrentPage: number;\n\t/**\n\t * Whether there is a previous page.\n\t */\n\thasPreviousPage: boolean;\n\t/**\n\t * Whether there is a next page.\n\t */\n\thasNextPage: boolean;\n\t/**\n\t * Go to a specific page.\n\t */\n\tgoToPage: (page: number) => void;\n\t/**\n\t * Go to the first page.\n\t */\n\tgoToFirstPage: () => void;\n\t/**\n\t * Go to the last page.\n\t */\n\tgoToLastPage: () => void;\n\t/**\n\t * Go to the next page.\n\t */\n\tnextPage: () => void;\n\t/**\n\t * The offset of the current page in the list.\n\t */\n\toffset: number;\n\t/**\n\t * The number of items per page.\n\t */\n\tpageSize: number;\n\t/**\n\t * Go to the previous page.\n\t */\n\tpreviousPage: () => void;\n\t/**\n\t * Set the number of items per page. This will reset the current page to the first page.\n\t */\n\tsetPageSize: (size: number) => void;\n\t/**\n\t * The total number of pages.\n\t */\n\ttotalPages: number;\n};\n\n/**\n * A headless hook for managing offset-based pagination state\n */\nfunction useOffsetPagination({ listSize, pageSize }: UseOffsetPaginationProps): OffsetPaginationState {\n\tconst [currentPage, setCurrentPage] = useState(1);\n\tconst [currentPageSize, setCurrentPageSize] = useState(pageSize);\n\n\t// Reset the current page to 1 when the page size prop changes\n\tuseEffect(() => {\n\t\tsetCurrentPageSize(pageSize);\n\t\tsetCurrentPage(1);\n\t}, [pageSize]);\n\n\t// Reset the current page to 1 when the list size prop changes\n\tuseEffect(() => {\n\t\tsetCurrentPage(1);\n\t}, [listSize]);\n\n\tconst totalPages = Math.ceil(listSize / currentPageSize);\n\tconst offset = (currentPage - 1) * currentPageSize;\n\n\tconst hasPreviousPage = currentPage > 1;\n\tconst hasNextPage = currentPage < totalPages;\n\n\tfunction goToPage(page: number) {\n\t\tconst nextPage = Math.max(1, Math.min(page, totalPages));\n\t\tsetCurrentPage(nextPage);\n\t}\n\n\tfunction nextPage() {\n\t\tif (hasNextPage) {\n\t\t\tsetCurrentPage((prev) => Math.min(prev + 1, totalPages));\n\t\t}\n\t}\n\n\tfunction previousPage() {\n\t\tif (hasPreviousPage) {\n\t\t\tsetCurrentPage((prev) => Math.max(prev - 1, 1));\n\t\t}\n\t}\n\n\tfunction setPageSize(size: number) {\n\t\tsetCurrentPageSize(size);\n\t\tsetCurrentPage(1); // reset to the first page when page size changes\n\t}\n\n\tfunction goToLastPage() {\n\t\tsetCurrentPage(totalPages);\n\t}\n\n\tfunction goToFirstPage() {\n\t\tsetCurrentPage(1);\n\t}\n\n\treturn {\n\t\tcurrentPage,\n\t\tgoToFirstPage,\n\t\tgoToLastPage,\n\t\tgoToPage,\n\t\thasNextPage,\n\t\thasPreviousPage,\n\t\tnextPage,\n\t\toffset,\n\t\tpageSize: currentPageSize,\n\t\tpreviousPage,\n\t\tsetPageSize,\n\t\ttotalPages,\n\t};\n}\n\n/**\n * Get a paginated slice of a list based on the current offset pagination state.\n */\nfunction getOffsetPaginatedSlice<T>(list: readonly T[], pagination: OffsetPaginationState): T[] {\n\treturn list.slice(pagination.offset, pagination.offset + pagination.pageSize);\n}\n\nexport {\n\t//,\n\tgetOffsetPaginatedSlice,\n\tuseOffsetPagination,\n};\n\nexport type {\n\t//,\n\tOffsetPaginationState,\n\tUseOffsetPaginationProps,\n};\n"],"mappings":"waAAA,OAAS,aAAAA,MAAiB,6CAC1B,OAAS,cAAAC,MAAkB,8CAC3B,OAAS,QAAAC,MAAY,uBACrB,OAAS,iBAAAC,EAAe,cAAAC,EAAY,cAAAC,EAAY,YAAAC,MAAsD,QACtG,OAAOC,MAAe,iBA8ClB,cAAAC,EAoCD,QAAAC,MApCC,oBAxBJ,IAAMC,EAA0BC,EAAwD,MAAS,EAkB3FC,EAAmBC,EACxB,CAAC,CAAE,UAAAC,EAAW,SAAAC,EAAU,gBAAAC,EAAiB,GAAGC,CAAM,EAAGC,IAAQ,CAC5D,GAAM,CAACC,EAAUC,CAAW,EAAIC,EAAiBL,CAAe,EAEhE,OACCR,EAACE,EAAwB,SAAxB,CAAiC,MAAO,CAAE,gBAAAM,EAAiB,SAAAG,EAAU,YAAAC,CAAY,EACjF,SAAAZ,EAAC,OAAI,UAAWc,EAAG,iDAAkDR,CAAS,EAAG,IAAKI,EAAM,GAAGD,EAC7F,SAAAF,EACF,EACD,CAEF,CACD,EACAH,EAAiB,YAAc,mBAwB/B,IAAMW,EAAgBV,EACrB,CAAC,CAAE,YAAAW,EAAa,gBAAAC,EAAiB,WAAAC,EAAY,eAAAC,EAAgB,GAAGV,CAAM,EAAGC,IAIvET,EAACmB,EAAA,CAAY,WAAW,QAAQ,IAAKV,EAAM,GAAGD,EAC7C,UAAAT,EAACqB,EAAA,CACA,WAAW,QACX,SAAU,CAACJ,EACX,KAAMjB,EAACsB,EAAA,EAAU,EACjB,MAAM,gBACN,QAASH,EACT,KAAK,KACL,KAAK,SACN,EACAnB,EAACuB,EAAA,CAAU,YAAY,WAAW,UAAU,UAAU,EACtDvB,EAACqB,EAAA,CACA,WAAW,QACX,SAAU,CAACL,EACX,KAAMhB,EAACwB,EAAA,EAAW,EAClB,MAAM,YACN,QAASN,EACT,KAAK,KACL,KAAK,SACN,GACD,CAGH,EACAH,EAAc,YAAc,gBAE5B,IAAMU,EAAmB,CAAC,EAAG,GAAI,GAAI,GAAI,GAAG,EAgBtCC,EAAuBrB,EAC5B,CAAC,CAAE,UAAAC,EAAW,UAAAqB,EAAYF,EAAkB,iBAAAG,EAAkB,GAAGC,CAAK,EAAGnB,IAAQ,CAChF,IAAMoB,EAAMC,EAAW7B,CAAuB,EAE9C,OAAA8B,EAAUF,EAAK,8EAA8E,EAE7FE,EACCL,EAAU,SAASG,EAAI,eAAe,EACtC,qFACD,EAEAE,EACCL,EAAU,SAASG,EAAI,QAAQ,EAC/B,8EACD,EAGC7B,EAACgC,EAAA,CACA,aAAc,GAAGH,EAAI,QAAQ,GAC7B,SAAWI,GAAU,CACpB,IAAIC,EAAc,OAAO,SAASD,EAAO,EAAE,EACvC,OAAO,MAAMC,CAAW,IAC3BA,EAAcL,EAAI,iBAEnBA,EAAI,YAAYK,CAAW,EAC3BP,IAAmBO,CAAW,CAC/B,EAEA,UAAAnC,EAACoC,EAAA,CAAc,IAAK1B,EAAK,UAAWI,EAAG,kBAAmBR,CAAS,EAAG,MAAOwB,EAAI,SAAW,GAAGD,EAC9F,SAAA7B,EAACqC,EAAA,EAAY,EACd,EACArC,EAACsC,EAAA,CAAc,MAAM,UACnB,SAAAX,EAAU,IAAKY,GACftC,EAACuC,EAAA,CAAsB,MAAO,GAAGD,CAAI,GACnC,UAAAA,EAAK,cADUA,CAEjB,CACA,EACF,GACD,CAEF,CACD,EACAb,EAAqB,YAAc,uBAOnC,SAASe,EAAoB,CAAE,QAAAC,EAAU,GAAO,UAAApC,EAAW,GAAGG,CAAM,EAA6B,CAChG,IAAMqB,EAAMC,EAAW7B,CAAuB,EAE9C,OAAA8B,EAAUF,EAAK,6EAA6E,EAK3F7B,EAHiByC,EAAUC,EAAO,OAGjC,CAAU,UAAW7B,EAAG,iCAAkCR,CAAS,EAAI,GAAGG,EACzE,UAAAqB,EAAI,SAAS,aACf,CAEF,CC7LA,OAAS,aAAAc,EAAW,YAAAC,MAAgB,QAmEpC,SAASC,EAAoB,CAAE,SAAAC,EAAU,SAAAC,CAAS,EAAoD,CACrG,GAAM,CAACC,EAAaC,CAAc,EAAIL,EAAS,CAAC,EAC1C,CAACM,EAAiBC,CAAkB,EAAIP,EAASG,CAAQ,EAG/DJ,EAAU,IAAM,CACfQ,EAAmBJ,CAAQ,EAC3BE,EAAe,CAAC,CACjB,EAAG,CAACF,CAAQ,CAAC,EAGbJ,EAAU,IAAM,CACfM,EAAe,CAAC,CACjB,EAAG,CAACH,CAAQ,CAAC,EAEb,IAAMM,EAAa,KAAK,KAAKN,EAAWI,CAAe,EACjDG,GAAUL,EAAc,GAAKE,EAE7BI,EAAkBN,EAAc,EAChCO,EAAcP,EAAcI,EAElC,SAASI,EAASC,EAAc,CAC/B,IAAMC,EAAW,KAAK,IAAI,EAAG,KAAK,IAAID,EAAML,CAAU,CAAC,EACvDH,EAAeS,CAAQ,CACxB,CAEA,SAASA,GAAW,CACfH,GACHN,EAAgBU,GAAS,KAAK,IAAIA,EAAO,EAAGP,CAAU,CAAC,CAEzD,CAEA,SAASQ,GAAe,CACnBN,GACHL,EAAgBU,GAAS,KAAK,IAAIA,EAAO,EAAG,CAAC,CAAC,CAEhD,CAEA,SAASE,EAAYC,EAAc,CAClCX,EAAmBW,CAAI,EACvBb,EAAe,CAAC,CACjB,CAEA,SAASc,GAAe,CACvBd,EAAeG,CAAU,CAC1B,CAEA,SAASY,GAAgB,CACxBf,EAAe,CAAC,CACjB,CAEA,MAAO,CACN,YAAAD,EACA,cAAAgB,EACA,aAAAD,EACA,SAAAP,EACA,YAAAD,EACA,gBAAAD,EACA,SAAAI,EACA,OAAAL,EACA,SAAUH,EACV,aAAAU,EACA,YAAAC,EACA,WAAAT,CACD,CACD,CAKA,SAASa,EAA2BC,EAAoBC,EAAwC,CAC/F,OAAOD,EAAK,MAAMC,EAAW,OAAQA,EAAW,OAASA,EAAW,QAAQ,CAC7E","names":["CaretLeft","CaretRight","Slot","createContext","forwardRef","useContext","useState","invariant","jsx","jsxs","CursorPaginationContext","createContext","CursorPagination","forwardRef","className","children","defaultPageSize","props","ref","pageSize","setPageSize","useState","cx","CursorButtons","hasNextPage","hasPreviousPage","onNextPage","onPreviousPage","ButtonGroup","IconButton","CaretLeft","Separator","CaretRight","defaultPageSizes","CursorPageSizeSelect","pageSizes","onChangePageSize","rest","ctx","useContext","invariant","Select","value","newPageSize","SelectTrigger","SelectValue","SelectContent","size","SelectItem","CursorPageSizeValue","asChild","Slot","useEffect","useState","useOffsetPagination","listSize","pageSize","currentPage","setCurrentPage","currentPageSize","setCurrentPageSize","totalPages","offset","hasPreviousPage","hasNextPage","goToPage","page","nextPage","prev","previousPage","setPageSize","size","goToLastPage","goToFirstPage","getOffsetPaginatedSlice","list","pagination"]}
@@ -1,2 +1,2 @@
1
- import{a as y}from"./chunk-ERBZR6SY.js";import{a as l}from"./chunk-EW5CFGXT.js";import{Radio as u,RadioGroup as G}from"@headlessui/react";import{Slot as H}from"@radix-ui/react-slot";import f from"clsx";import{Children as N,cloneElement as L,createContext as E,forwardRef as n,isValidElement as S,useContext as b,useRef as T}from"react";import{Fragment as R,jsx as a}from"react/jsx-runtime";var m=n((e,o)=>a(G,{...e,ref:o}));m.displayName="RadioGroup";var c=E({autofocus:!1,checked:!1,disabled:!1,focus:!1,hover:!1}),v=n(({children:e,className:o,...r},t)=>a(u,{className:l("group/radio aria-enabled:cursor-pointer [&_label]:cursor-inherit flex cursor-default gap-2 py-1 text-base focus:outline-none sm:text-sm",o),as:"div",...r,ref:t,children:i=>a(c.Provider,{value:i,children:e})}));v.displayName="RadioItem";var z=({checked:e,disabled:o,focus:r,hover:t})=>a("span",{className:l("border-form flex size-4 items-center justify-center rounded-full border",o&&"cursor-default opacity-50",e&&"border-accent-500 bg-accent-500",r&&!o&&"border-accent-600 ring-focus-accent ring-4",t&&"border-accent-600"),children:e&&a("span",{className:"size-2 rounded-full bg-[#fff]"})}),M=({children:e,className:o,...r})=>{let t=b(c);return a("div",{className:l("radio-indicator inline-flex size-6 select-none items-center justify-center sm:size-5",o),...r,children:e==null?a(z,{...t}):typeof e=="function"?e(t):e})},x=n(({className:e,...o},r)=>a(m,{className:f("-space-y-px",e),...o,ref:r}));x.displayName="RadioGroupList";var P=n(({children:e,className:o,...r},t)=>a(u,{as:"div",className:l("group/radio border-form [&_label]:cursor-inherit relative flex select-none gap-2 border px-3 py-2 text-base sm:text-sm","aria-enabled:cursor-pointer focus:outline-none","focus-visible:ring-focus-accent aria-enabled:focus-visible:border-accent-600 focus-visible:ring-4","first-of-type:rounded-tl-md first-of-type:rounded-tr-md last-of-type:rounded-bl-md last-of-type:rounded-br-md","aria-disabled:border-form/50 aria-enabled:hover:z-1 aria-enabled:hover:border-accent-600","aria-checked:z-1 aria-checked:border-accent-500/40 aria-checked:bg-accent-500/10 dark-high-contrast:aria-checked:border-accent-400 high-contrast:aria-checked:border-accent-400 not-disabled:hover:aria-checked:border-accent-600","has-[.radio-indicator:first-child]:pl-2 has-[.radio-indicator:last-child]:pr-2",o),ref:t,...r,children:i=>a(R,{children:a(c.Provider,{value:i,children:e})})}));P.displayName="RadioListItem";var g=n(({children:e,className:o,...r},t)=>a(u,{as:"div",className:f("group/radio border-card bg-card [&_label]:cursor-inherit relative rounded-md border p-4 text-base sm:text-sm","aria-enabled:cursor-pointer focus:outline-none","focus-visible:ring-focus-accent aria-enabled:focus-visible:border-accent-600 focus-visible:ring-4","first-of-type:rounded-tl-md first-of-type:rounded-tr-md last-of-type:rounded-bl-md last-of-type:rounded-br-md","aria-disabled:border-form/50 aria-enabled:hover:z-1 aria-enabled:hover:border-accent-600","aria-checked:z-1 aria-checked:border-accent-500/40 aria-checked:bg-accent-500/10 aria-enabled:hover:aria-checked:border-accent-600 dark-high-contrast:aria-checked:border-accent-400 high-contrast:aria-checked:border-accent-400",o),...r,ref:t,children:i=>a(R,{children:a(c.Provider,{value:i,children:e})})}));g.displayName="RadioCard";var w=({asChild:e=!1,children:o,className:r,...t})=>{let i=b(c);return a(e?H:"div",{className:f("min-w-0 flex-1",i.disabled&&"opacity-50",r),...t,children:o})},C=n(({className:e,...o},r)=>a(m,{className:f("flex flex-row flex-nowrap -space-x-px",e),...o,ref:r}));C.displayName="RadioButtonGroup";var I=n(({children:e,className:o,...r},t)=>a(u,{as:"div",className:l("group/radio border-form [&_label]:cursor-inherit relative flex flex-1 select-none items-center justify-center gap-2 border px-3 py-2 text-base sm:text-sm","focus-visible:ring-focus-accent aria-enabled:focus-visible:border-accent-600 focus-visible:ring-4","aria-enabled:cursor-pointer focus:outline-none","first-of-type:rounded-bl-md first-of-type:rounded-tl-md last-of-type:rounded-br-md last-of-type:rounded-tr-md","aria-enabled:hover:z-1 aria-enabled:hover:border-accent-600 aria-disabled:opacity-50","aria-checked:z-1 aria-checked:border-accent-500/40 aria-checked:bg-accent-500/10 not-disabled:hover:aria-checked:border-accent-600","has-[.radio-indicator:first-child]:pl-2 has-[.radio-indicator:last-child]:pr-2",o),ref:t,...r,children:i=>a(R,{children:a(c.Provider,{value:i,children:e})})}));I.displayName="RadioButton";var B=({children:e,onClick:o,onKeyDown:r,...t})=>{let i=T(null),s=b(c),p=N.only(e),k=s.disabled||!s.checked;return a("div",{ref:i,"aria-disabled":s.disabled,onKeyDown:d=>{if(s.disabled){d.stopPropagation(),d.preventDefault();return}switch(d.key){case"Enter":case"Tab":break;default:d.stopPropagation()}r?.(d)},onClick:d=>{if(s.disabled){d.stopPropagation(),d.preventDefault();return}let h=d.target;y(h)&&window.requestAnimationFrame(()=>{h.focus()}),o?.(d)},...t,children:S(p)?L(p,{disabled:s.disabled||p.props.disabled,tabIndex:k?-1:p.props.tabIndex}):null})};export{I as RadioButton,C as RadioButtonGroup,g as RadioCard,m as RadioGroup,x as RadioGroupList,M as RadioIndicator,B as RadioInputSandbox,v as RadioItem,w as RadioItemContent,P as RadioListItem};
1
+ import{a as v}from"./chunk-ERBZR6SY.js";import{a as l}from"./chunk-EW5CFGXT.js";import{Radio as u,RadioGroup as G}from"@headlessui/react";import{Slot as H}from"@radix-ui/react-slot";import f from"clsx";import{Children as N,cloneElement as L,createContext as E,forwardRef as n,isValidElement as S,useContext as b,useRef as T}from"react";import{Fragment as R,jsx as a}from"react/jsx-runtime";var m=n((e,o)=>a(G,{...e,ref:o}));m.displayName="RadioGroup";var c=E({autofocus:!1,checked:!1,disabled:!1,focus:!1,hover:!1}),x=n(({children:e,className:o,...r},t)=>a(u,{className:l("group/radio aria-enabled:cursor-pointer [&_label]:cursor-inherit flex cursor-default gap-2 py-1 text-base focus:outline-none sm:text-sm",o),as:"div",...r,ref:t,children:i=>a(c.Provider,{value:i,children:e})}));x.displayName="RadioItem";var z=({checked:e,disabled:o,focus:r,hover:t})=>a("span",{className:l("border-form flex size-4 items-center justify-center rounded-full border",o&&"cursor-default opacity-50",e&&"border-accent-500 bg-accent-500",r&&!o&&"border-accent-600 ring-focus-accent ring-4",t&&"border-accent-600"),children:e&&a("span",{className:"size-2 rounded-full bg-[#fff]"})}),M=({children:e,className:o,...r})=>{let t=b(c);return a("div",{className:l("radio-indicator inline-flex size-6 select-none items-center justify-center sm:size-5",o),...r,children:e==null?a(z,{...t}):typeof e=="function"?e(t):e})},y=n(({className:e,...o},r)=>a(m,{className:f("-space-y-px",e),...o,ref:r}));y.displayName="RadioGroupList";var P=n(({children:e,className:o,...r},t)=>a(u,{as:"div",className:l("group/radio border-form [&_label]:cursor-inherit relative flex select-none gap-2 border px-3 py-2 text-base sm:text-sm","aria-enabled:cursor-pointer focus:outline-none","focus-visible:ring-focus-accent aria-enabled:focus-visible:border-accent-600 focus-visible:ring-4","first-of-type:rounded-tl-md first-of-type:rounded-tr-md last-of-type:rounded-bl-md last-of-type:rounded-br-md","aria-disabled:border-form/50 aria-enabled:hover:z-1 aria-enabled:hover:border-accent-600","aria-checked:z-1 aria-checked:border-accent-500/40 aria-checked:bg-accent-500/10 dark-high-contrast:aria-checked:border-accent-400 high-contrast:aria-checked:border-accent-400 not-aria-disabled:hover:aria-checked:border-accent-600","has-[.radio-indicator:first-child]:pl-2 has-[.radio-indicator:last-child]:pr-2",o),ref:t,...r,children:i=>a(R,{children:a(c.Provider,{value:i,children:e})})}));P.displayName="RadioListItem";var g=n(({children:e,className:o,...r},t)=>a(u,{as:"div",className:f("group/radio border-card bg-card [&_label]:cursor-inherit relative rounded-md border p-4 text-base sm:text-sm","aria-enabled:cursor-pointer focus:outline-none","focus-visible:ring-focus-accent aria-enabled:focus-visible:border-accent-600 focus-visible:ring-4","first-of-type:rounded-tl-md first-of-type:rounded-tr-md last-of-type:rounded-bl-md last-of-type:rounded-br-md","aria-disabled:border-form/50 aria-enabled:hover:z-1 aria-enabled:hover:border-accent-600","aria-checked:z-1 aria-checked:border-accent-500/40 aria-checked:bg-accent-500/10 aria-enabled:hover:aria-checked:border-accent-600 dark-high-contrast:aria-checked:border-accent-400 high-contrast:aria-checked:border-accent-400",o),...r,ref:t,children:i=>a(R,{children:a(c.Provider,{value:i,children:e})})}));g.displayName="RadioCard";var w=({asChild:e=!1,children:o,className:r,...t})=>{let i=b(c);return a(e?H:"div",{className:f("min-w-0 flex-1",i.disabled&&"opacity-50",r),...t,children:o})},C=n(({className:e,...o},r)=>a(m,{className:f("flex flex-row flex-nowrap -space-x-px",e),...o,ref:r}));C.displayName="RadioButtonGroup";var I=n(({children:e,className:o,...r},t)=>a(u,{as:"div",className:l("group/radio border-form [&_label]:cursor-inherit relative flex flex-1 select-none items-center justify-center gap-2 border px-3 text-base sm:text-sm","h-11 sm:h-9","focus-visible:ring-focus-accent aria-enabled:focus-visible:border-accent-600 focus-visible:ring-4","aria-enabled:cursor-pointer focus:outline-none","first-of-type:rounded-bl-md first-of-type:rounded-tl-md last-of-type:rounded-br-md last-of-type:rounded-tr-md","aria-enabled:hover:z-1 aria-enabled:hover:border-accent-600 aria-disabled:opacity-50","aria-checked:z-1 aria-checked:border-accent-500/40 aria-checked:bg-accent-500/10 not-disabled:hover:aria-checked:border-accent-600","has-[.radio-indicator:first-child]:pl-2 has-[.radio-indicator:last-child]:pr-2",o),ref:t,...r,children:i=>a(R,{children:a(c.Provider,{value:i,children:e})})}));I.displayName="RadioButton";var B=({children:e,onClick:o,onKeyDown:r,...t})=>{let i=T(null),s=b(c),p=N.only(e),k=s.disabled||!s.checked;return a("div",{ref:i,"aria-disabled":s.disabled,onKeyDown:d=>{if(s.disabled){d.stopPropagation(),d.preventDefault();return}switch(d.key){case"Enter":case"Tab":break;default:d.stopPropagation()}r?.(d)},onClick:d=>{if(s.disabled){d.stopPropagation(),d.preventDefault();return}let h=d.target;v(h)&&window.requestAnimationFrame(()=>{h.focus()}),o?.(d)},...t,children:S(p)?L(p,{disabled:s.disabled||p.props.disabled,tabIndex:k?-1:p.props.tabIndex}):null})};export{I as RadioButton,C as RadioButtonGroup,g as RadioCard,m as RadioGroup,y as RadioGroupList,M as RadioIndicator,B as RadioInputSandbox,x as RadioItem,w as RadioItemContent,P as RadioListItem};
2
2
  //# sourceMappingURL=radio-group.js.map