@ngrok/mantle 0.27.4 → 0.28.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.
- package/dist/accordion.d.ts +1 -1
- package/dist/accordion.js +1 -1
- package/dist/accordion.js.map +1 -1
- package/dist/alert-dialog.js +1 -1
- package/dist/alert-dialog.js.map +1 -1
- package/dist/alert.js +1 -1
- package/dist/alert.js.map +1 -1
- package/dist/anchor.js +1 -1
- package/dist/button.js +1 -1
- package/dist/calendar.js +1 -1
- package/dist/calendar.js.map +1 -1
- package/dist/chunk-2PHWBRBD.js +2 -0
- package/dist/chunk-2PHWBRBD.js.map +1 -0
- package/dist/chunk-3DXMGSDU.js +2 -0
- package/dist/chunk-3DXMGSDU.js.map +1 -0
- package/dist/{chunk-GOXG4BVJ.js → chunk-3MDQ3LC2.js} +1 -1
- package/dist/chunk-3MDQ3LC2.js.map +1 -0
- package/dist/chunk-BK4P33ZH.js +2 -0
- package/dist/chunk-BK4P33ZH.js.map +1 -0
- package/dist/chunk-VTCWSFFJ.js +2 -0
- package/dist/chunk-VTCWSFFJ.js.map +1 -0
- package/dist/chunk-WVHMNFQD.js +2 -0
- package/dist/chunk-WVHMNFQD.js.map +1 -0
- package/dist/{chunk-7O36LG52.js → chunk-XQVVOOLT.js} +1 -1
- package/dist/chunk-XQVVOOLT.js.map +1 -0
- package/dist/code-block.js +2 -2
- package/dist/code-block.js.map +1 -1
- package/dist/data-table.js +1 -1
- package/dist/data-table.js.map +1 -1
- package/dist/dialog.js +1 -1
- package/dist/dialog.js.map +1 -1
- package/dist/dropdown-menu.js +1 -1
- package/dist/dropdown-menu.js.map +1 -1
- package/dist/{icon-CS9xptlK.d.ts → icon-Cu-iYUjr.d.ts} +2 -2
- package/dist/icon.d.ts +1 -1
- package/dist/icon.js +1 -1
- package/dist/icons.d.ts +3 -3
- package/dist/icons.js +1 -1
- package/dist/input.d.ts +3 -3
- package/dist/input.js +1 -1
- package/dist/input.js.map +1 -1
- package/dist/pagination.js +1 -1
- package/dist/pagination.js.map +1 -1
- package/dist/select.js +1 -1
- package/dist/sheet.js +1 -1
- package/dist/sheet.js.map +1 -1
- package/dist/toast.js +1 -1
- package/package.json +3 -3
- package/dist/chunk-7O36LG52.js.map +0 -1
- package/dist/chunk-GOXG4BVJ.js.map +0 -1
- package/dist/chunk-J3NVDJIE.js +0 -2
- package/dist/chunk-J3NVDJIE.js.map +0 -1
- package/dist/chunk-PLUW72NW.js +0 -2
- package/dist/chunk-PLUW72NW.js.map +0 -1
- package/dist/chunk-UBD43AUE.js +0 -2
- package/dist/chunk-UBD43AUE.js.map +0 -1
- package/dist/chunk-WGF5NYWL.js +0 -2
- package/dist/chunk-WGF5NYWL.js.map +0 -1
- package/dist/chunk-XBVAQ3DV.js +0 -2
- package/dist/chunk-XBVAQ3DV.js.map +0 -1
package/dist/accordion.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import * as react from 'react';
|
|
3
3
|
import { ComponentPropsWithoutRef } from 'react';
|
|
4
4
|
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
5
|
-
import { a as IconProps } from './icon-
|
|
5
|
+
import { a as IconProps } from './icon-Cu-iYUjr.js';
|
|
6
6
|
import './types-BuKAGhC-.js';
|
|
7
7
|
|
|
8
8
|
declare const Accordion: react.ForwardRefExoticComponent<ComponentPropsWithoutRef<react.ForwardRefExoticComponent<(AccordionPrimitive.AccordionSingleProps | AccordionPrimitive.AccordionMultipleProps) & react.RefAttributes<HTMLDivElement>>> & react.RefAttributes<HTMLDivElement>>;
|
package/dist/accordion.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as m}from"./chunk-
|
|
1
|
+
import{a as m}from"./chunk-XQVVOOLT.js";import"./chunk-HDPLH5HC.js";import{a as r}from"./chunk-AZ56JGNY.js";import{CaretDownIcon as g}from"@phosphor-icons/react/CaretDown";import*as o from"@radix-ui/react-accordion";import{forwardRef as c}from"react";import{jsx as n}from"react/jsx-runtime";var a=c(({className:e,...i},t)=>n(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=c(({className:e,...i},t)=>n(o.Header,{ref:t,className:r("flex items-center gap-2",e),...i}));s.displayName="AccordionHeading";var f=c(({className:e,children:i,...t},d)=>n(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})=>n(m,{...i,svg:n(g,{weight:"fill"}),className:r("group-data-state-open:rotate-0 -rotate-90",e)}),A=c(({className:e,children:i,...t},d)=>n(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
2
|
//# sourceMappingURL=accordion.js.map
|
package/dist/accordion.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/accordion/accordion.tsx"],"sourcesContent":["\"use client\";\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../src/components/accordion/accordion.tsx"],"sourcesContent":["\"use client\";\n\nimport { CaretDownIcon } from \"@phosphor-icons/react/CaretDown\";\nimport * as AccordionPrimitive from \"@radix-ui/react-accordion\";\nimport {\n\ttype ComponentPropsWithoutRef,\n\ttype ComponentRef,\n\tforwardRef,\n} from \"react\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport { Icon, type IconProps } from \"../icon/icon.js\";\n\nconst Accordion = forwardRef<\n\tComponentRef<\"div\">,\n\tComponentPropsWithoutRef<typeof AccordionPrimitive.Root>\n>(({ className, ...props }, ref) => (\n\t<AccordionPrimitive.Root\n\t\tref={ref}\n\t\tclassName={cx(\"w-full space-y-2.5\", className)}\n\t\t{...props}\n\t/>\n));\nAccordion.displayName = \"Accordion\";\n\nconst AccordionItem = AccordionPrimitive.Item;\nAccordionItem.displayName = \"AccordionItem\";\n\nconst AccordionHeading = forwardRef<\n\tComponentRef<\"div\">,\n\tComponentPropsWithoutRef<typeof AccordionPrimitive.Header>\n>(({ className, ...props }, ref) => (\n\t<AccordionPrimitive.Header\n\t\tref={ref}\n\t\tclassName={cx(\"flex items-center gap-2\", className)}\n\t\t{...props}\n\t/>\n));\nAccordionHeading.displayName = \"AccordionHeading\";\n\nconst AccordionTrigger = forwardRef<\n\tComponentRef<\"button\">,\n\tComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n\t<AccordionPrimitive.Trigger\n\t\tref={ref}\n\t\tclassName={cx(\"group flex items-center gap-1.5\", className)}\n\t\t{...props}\n\t>\n\t\t{children}\n\t</AccordionPrimitive.Trigger>\n));\nAccordionTrigger.displayName = \"AccordionTrigger\";\n\nconst AccordionTriggerIcon = ({\n\tclassName,\n\t...props\n}: Omit<IconProps, \"svg\">) => (\n\t<Icon\n\t\t{...props}\n\t\tsvg={<CaretDownIcon weight=\"fill\" />}\n\t\tclassName={cx(\"group-data-state-open:rotate-0 -rotate-90\", className)}\n\t/>\n);\n\nconst AccordionContent = forwardRef<\n\tComponentRef<\"div\">,\n\tComponentPropsWithoutRef<typeof AccordionPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n\t<AccordionPrimitive.Content\n\t\tref={ref}\n\t\tclassName={cx(\n\t\t\t\"data-state-closed:animate-accordion-up data-state-open:animate-accordion-down overflow-hidden pt-4\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t>\n\t\t{children}\n\t</AccordionPrimitive.Content>\n));\nAccordionContent.displayName = \"AccordionContent\";\n\nexport {\n\t//,\n\tAccordion,\n\tAccordionContent,\n\tAccordionHeading,\n\tAccordionItem,\n\tAccordionTrigger,\n\tAccordionTriggerIcon,\n};\n"],"mappings":"4GAEA,OAAS,iBAAAA,MAAqB,kCAC9B,UAAYC,MAAwB,4BACpC,OAGC,cAAAC,MACM,QAQN,cAAAC,MAAA,oBAJD,IAAMC,EAAYC,EAGhB,CAAC,CAAE,UAAAC,EAAW,GAAGC,CAAM,EAAGC,IAC3BL,EAAoB,OAAnB,CACA,IAAKK,EACL,UAAWC,EAAG,qBAAsBH,CAAS,EAC5C,GAAGC,EACL,CACA,EACDH,EAAU,YAAc,YAExB,IAAMM,EAAmC,OACzCA,EAAc,YAAc,gBAE5B,IAAMC,EAAmBN,EAGvB,CAAC,CAAE,UAAAC,EAAW,GAAGC,CAAM,EAAGC,IAC3BL,EAAoB,SAAnB,CACA,IAAKK,EACL,UAAWC,EAAG,0BAA2BH,CAAS,EACjD,GAAGC,EACL,CACA,EACDI,EAAiB,YAAc,mBAE/B,IAAMC,EAAmBP,EAGvB,CAAC,CAAE,UAAAC,EAAW,SAAAO,EAAU,GAAGN,CAAM,EAAGC,IACrCL,EAAoB,UAAnB,CACA,IAAKK,EACL,UAAWC,EAAG,kCAAmCH,CAAS,EACzD,GAAGC,EAEH,SAAAM,EACF,CACA,EACDD,EAAiB,YAAc,mBAE/B,IAAME,EAAuB,CAAC,CAC7B,UAAAR,EACA,GAAGC,CACJ,IACCJ,EAACY,EAAA,CACC,GAAGR,EACJ,IAAKJ,EAACa,EAAA,CAAc,OAAO,OAAO,EAClC,UAAWP,EAAG,4CAA6CH,CAAS,EACrE,EAGKW,EAAmBZ,EAGvB,CAAC,CAAE,UAAAC,EAAW,SAAAO,EAAU,GAAGN,CAAM,EAAGC,IACrCL,EAAoB,UAAnB,CACA,IAAKK,EACL,UAAWC,EACV,qGACAH,CACD,EACC,GAAGC,EAEH,SAAAM,EACF,CACA,EACDI,EAAiB,YAAc","names":["CaretDownIcon","AccordionPrimitive","forwardRef","jsx","Accordion","forwardRef","className","props","ref","cx","AccordionItem","AccordionHeading","AccordionTrigger","children","AccordionTriggerIcon","Icon","CaretDownIcon","AccordionContent"]}
|
package/dist/alert-dialog.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as A,b as D,c as y,d as g,e as u,f as C,g as P,h as v}from"./chunk-PBARMKNJ.js";import{g as c}from"./chunk-
|
|
1
|
+
import{a as A,b as D,c as y,d as g,e as u,f as C,g as P,h as v}from"./chunk-PBARMKNJ.js";import{g as c}from"./chunk-3DXMGSDU.js";import"./chunk-XN5RN6JW.js";import"./chunk-D3XF6J5A.js";import{b as m}from"./chunk-VTCWSFFJ.js";import"./chunk-4LSFAAZW.js";import"./chunk-3C5O3AQA.js";import"./chunk-72TJUKMV.js";import"./chunk-XQVVOOLT.js";import{a as f}from"./chunk-HDPLH5HC.js";import{a}from"./chunk-AZ56JGNY.js";import{InfoIcon as j}from"@phosphor-icons/react/Info";import{WarningIcon as F}from"@phosphor-icons/react/Warning";import{Slot as d}from"@radix-ui/react-slot";import{createContext as H,forwardRef as n,useContext as V,useMemo as k}from"react";import M from"tiny-invariant";import{jsx as i,jsxs as G}from"react/jsx-runtime";var x=H(null);function N(){let t=V(x);return M(t,"AlertDialog child component used outside of AlertDialog parent!"),t}function R({priority:t,...e}){let o=k(()=>({priority:t}),[t]);return i(x.Provider,{value:o,children:i(A,{...e})})}R.displayName="AlertDialog";var $=D,q=y,h=n(({className:t,...e},o)=>i(u,{className:a("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:o}));h.displayName="AlertDialogOverlay";var b=n(({className:t,onInteractOutside:e,onPointerDownOutside:o,preferredWidth:l="max-w-md",...r},p)=>G(q,{children:[i(h,{}),i("div",{className:"fixed inset-4 z-50 flex items-center justify-center",children:i(C,{ref:p,className:a("flex w-full 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",l,t),onInteractOutside:s=>{c(s),e?.(s)},onPointerDownOutside:s=>{c(s),o?.(s)},...r})})]}));b.displayName="AlertDialogContent";var I=n(({asChild:t=!1,className:e,...o},l)=>i(t?d:"div",{className:a("flex-1 space-y-4",e),ref:l,...o}));I.displayName="AlertDialogBody";var W=n(({asChild:t=!1,className:e,...o},l)=>i(t?d:"div",{className:a("flex flex-col space-y-2 text-center sm:text-start",e),...o}));W.displayName="AlertDialogHeader";var O=n(({asChild:t=!1,className:e,...o},l)=>i(t?d:"div",{className:a("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...o}));O.displayName="AlertDialogFooter";var w=n(({className:t,...e},o)=>i(P,{ref:o,className:a("text-strong text-center text-lg font-medium sm:text-start",t),...e}));w.displayName="AlertDialogTitle";var B=n(({className:t,...e},o)=>i(v,{ref:o,className:a("text-body text-center text-sm font-normal sm:text-start",t),...e}));B.displayName="AlertDialogDescription";var T=n(({appearance:t="filled",...e},o)=>{let l=N(),r="default";return l.priority==="danger"&&(r="danger"),i(m,{appearance:t,priority:r,ref:o,...e})});T.displayName="AlertDialogAction";var z=n(({appearance:t="outlined",className:e,priority:o="neutral",...l},r)=>i(g,{asChild:!0,children:i(m,{appearance:t,className:a("mt-2 sm:mt-0",e),priority:o,ref:r,...l})}));z.displayName="AlertDialogCancel";var S=n(({className:t,svg:e,...o},l)=>{let r=N(),p=r.priority==="danger"?"text-danger-600":"text-accent-600",s=r.priority==="danger"?i(F,{}):i(j,{});return i(f,{ref:l,className:a("size-12 sm:size-7",p,t),svg:e??s,...o})});S.displayName="AlertDialogIcon";var E=g;export{R as AlertDialog,T as AlertDialogAction,I as AlertDialogBody,z as AlertDialogCancel,E as AlertDialogClose,b as AlertDialogContent,B as AlertDialogDescription,O as AlertDialogFooter,W as AlertDialogHeader,S as AlertDialogIcon,w as AlertDialogTitle,$ as AlertDialogTrigger};
|
|
2
2
|
//# sourceMappingURL=alert-dialog.js.map
|
package/dist/alert-dialog.js.map
CHANGED
|
@@ -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 { Slot } from \"@radix-ui/react-slot\";\nimport {\n\ttype ComponentProps,\n\ttype ComponentPropsWithoutRef,\n\ttype ComponentRef,\n\ttype ReactNode,\n\tcreateContext,\n\tforwardRef,\n\tuseContext,\n\tuseMemo,\n} from \"react\";\nimport invariant from \"tiny-invariant\";\nimport type { WithAsChild } from \"../../types/as-child.js\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport {\n\tButton,\n\ttype ButtonPriority,\n\ttype ButtonProps,\n} from \"../button/button.js\";\nimport * as AlertDialogPrimitive from \"../dialog/primitive.js\";\nimport { SvgOnly } from \"../icon/svg-only.js\";\nimport type { SvgAttributes } from \"../icon/types.js\";\nimport { preventCloseOnPromptInteraction } from \"../toast/toast.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(\n\t\tcontext,\n\t\t\"AlertDialog child component used outside of AlertDialog parent!\",\n\t);\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 * A modal dialog that interrupts the user with important content and expects a\n * response.\n * The root stateful component for the Alert Dialog.\n *\n * @see https://mantle.ngrok.com/components/alert-dialog#api-alert-dialog\n *\n * @example\n * ```tsx\n * <AlertDialog priority=\"danger\">\n * <AlertDialogTrigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Show Danger Alert Dialog\n * </Button>\n * </AlertDialogTrigger>\n * <AlertDialogContent>\n * <AlertDialogIcon />\n * <AlertDialogBody>\n * <AlertDialogHeader>\n * <AlertDialogTitle>\n * Are you absolutely sure?\n * </AlertDialogTitle>\n * <AlertDialogDescription>\n * Proident quis nisi tempor irure sunt ut minim occaecat mollit sunt.\n * </AlertDialogDescription>\n * </AlertDialogHeader>\n * <AlertDialogFooter>\n * <AlertDialogCancel type=\"button\">Cancel</AlertDialogCancel>\n * <AlertDialogAction type=\"button\">\n * Continue\n * </AlertDialogAction>\n * </AlertDialogFooter>\n * \t</AlertDialogBody>\n * </AlertDialogContent>\n * </AlertDialog>\n * ```\n */\nfunction AlertDialog({ priority, ...props }: AlertDialogProps) {\n\tconst context: AlertDialogContextValue = useMemo(\n\t\t() => ({ priority }),\n\t\t[priority],\n\t);\n\n\treturn (\n\t\t<AlertDialogContext.Provider value={context}>\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 *\n * @see https://mantle.ngrok.com/components/alert-dialog#api-alert-dialog-trigger\n *\n * @example\n * ```tsx\n * <AlertDialog priority=\"danger\">\n * <AlertDialogTrigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Show Danger Alert Dialog\n * </Button>\n * </AlertDialogTrigger>\n * <AlertDialogContent>\n * <AlertDialogIcon />\n * <AlertDialogBody>\n * <AlertDialogHeader>\n * <AlertDialogTitle>\n * Are you absolutely sure?\n * </AlertDialogTitle>\n * <AlertDialogDescription>\n * Proident quis nisi tempor irure sunt ut minim occaecat mollit sunt.\n * </AlertDialogDescription>\n * </AlertDialogHeader>\n * <AlertDialogFooter>\n * <AlertDialogCancel type=\"button\">Cancel</AlertDialogCancel>\n * <AlertDialogAction type=\"button\">\n * Continue\n * </AlertDialogAction>\n * </AlertDialogFooter>\n * \t</AlertDialogBody>\n * </AlertDialogContent>\n * </AlertDialog>\n * ```\n */\nconst AlertDialogTrigger = AlertDialogPrimitive.Trigger;\n\n/**\n * The portal for the Alert Dialog.\n *\n * @private\n */\nconst AlertDialogPortal = AlertDialogPrimitive.Portal;\n\n/**\n * A layer that covers the inert portion of the view when the dialog is open.\n *\n * @private\n */\nconst AlertDialogOverlay = forwardRef<\n\tComponentRef<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\ntype AlertDialogContentProps = ComponentPropsWithoutRef<\n\ttypeof AlertDialogPrimitive.Content\n> & {\n\t/**\n\t * The preferred width of the `AlertDialogContent` as a tailwind `max-w-` class.\n\t *\n\t * By default, a `AlertDialog`'s content width is responsive with a default\n\t * preferred width: the maximum width of the `AlertDialogContent`\n\t *\n\t * @default `max-w-md`\n\t */\n\tpreferredWidth?: `max-w-${string}`;\n};\n\n/**\n * The popover alert dialog container.\n *\n * Renders on top of the overlay and is centered in the viewport.\n *\n * @see https://mantle.ngrok.com/components/alert-dialog#api-alert-dialog-content\n *\n * @example\n * ```tsx\n * <AlertDialog priority=\"danger\">\n * <AlertDialogTrigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Show Danger Alert Dialog\n * </Button>\n * </AlertDialogTrigger>\n * <AlertDialogContent>\n * <AlertDialogIcon />\n * <AlertDialogBody>\n * <AlertDialogHeader>\n * <AlertDialogTitle>\n * Are you absolutely sure?\n * </AlertDialogTitle>\n * <AlertDialogDescription>\n * Proident quis nisi tempor irure sunt ut minim occaecat mollit sunt.\n * </AlertDialogDescription>\n * </AlertDialogHeader>\n * <AlertDialogFooter>\n * <AlertDialogCancel type=\"button\">Cancel</AlertDialogCancel>\n * <AlertDialogAction type=\"button\">\n * Continue\n * </AlertDialogAction>\n * </AlertDialogFooter>\n * \t</AlertDialogBody>\n * </AlertDialogContent>\n * </AlertDialog>\n * ```\n */\nconst AlertDialogContent = forwardRef<\n\tComponentRef<typeof AlertDialogPrimitive.Content>,\n\tAlertDialogContentProps\n>(\n\t(\n\t\t{\n\t\t\tclassName,\n\t\t\tonInteractOutside,\n\t\t\tonPointerDownOutside,\n\t\t\tpreferredWidth = \"max-w-md\",\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => (\n\t\t<AlertDialogPortal>\n\t\t\t<AlertDialogOverlay />\n\t\t\t<div className=\"fixed inset-4 z-50 flex items-center justify-center\">\n\t\t\t\t<AlertDialogPrimitive.Content\n\t\t\t\t\tref={ref}\n\t\t\t\t\tclassName={cx(\n\t\t\t\t\t\t\"flex w-full flex-1 flex-col items-center gap-4 sm:flex-row sm:items-start\",\n\t\t\t\t\t\t\"outline-none focus-within:outline-none\",\n\t\t\t\t\t\t\"p-6\",\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\tpreferredWidth,\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\tonInteractOutside={(event) => {\n\t\t\t\t\t\tpreventCloseOnPromptInteraction(event);\n\t\t\t\t\t\tonInteractOutside?.(event);\n\t\t\t\t\t}}\n\t\t\t\t\tonPointerDownOutside={(event) => {\n\t\t\t\t\t\tpreventCloseOnPromptInteraction(event);\n\t\t\t\t\t\tonPointerDownOutside?.(event);\n\t\t\t\t\t}}\n\t\t\t\t\t{...props}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</AlertDialogPortal>\n\t),\n);\nAlertDialogContent.displayName = \"AlertDialogContent\";\n\n/**\n * Contains the main content of the alert dialog.\n *\n * @see https://mantle.ngrok.com/components/alert-dialog#api-alert-dialog-body\n *\n * @example\n * ```tsx\n * <AlertDialog priority=\"danger\">\n * <AlertDialogTrigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Show Danger Alert Dialog\n * </Button>\n * </AlertDialogTrigger>\n * <AlertDialogContent>\n * <AlertDialogIcon />\n * <AlertDialogBody>\n * <AlertDialogHeader>\n * <AlertDialogTitle>\n * Are you absolutely sure?\n * </AlertDialogTitle>\n * <AlertDialogDescription>\n * Proident quis nisi tempor irure sunt ut minim occaecat mollit sunt.\n * </AlertDialogDescription>\n * </AlertDialogHeader>\n * <AlertDialogFooter>\n * <AlertDialogCancel type=\"button\">Cancel</AlertDialogCancel>\n * <AlertDialogAction type=\"button\">\n * Continue\n * </AlertDialogAction>\n * </AlertDialogFooter>\n * \t</AlertDialogBody>\n * </AlertDialogContent>\n * </AlertDialog>\n * ```\n */\nconst AlertDialogBody = forwardRef<\n\tComponentRef<\"div\">,\n\tComponentProps<\"div\"> & WithAsChild\n>(({ asChild = false, className, ...props }, ref) => {\n\tconst Component = asChild ? Slot : \"div\";\n\n\treturn (\n\t\t<Component\n\t\t\tclassName={cx(\"flex-1 space-y-4\", className)}\n\t\t\tref={ref}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\nAlertDialogBody.displayName = \"AlertDialogBody\";\n\n/**\n * Contains the header content of the dialog, including the title and description.\n *\n * @see https://mantle.ngrok.com/components/alert-dialog#api-alert-dialog-header\n *\n * @example\n * ```tsx\n * <AlertDialog priority=\"danger\">\n * <AlertDialogTrigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Show Danger Alert Dialog\n * </Button>\n * </AlertDialogTrigger>\n * <AlertDialogContent>\n * <AlertDialogIcon />\n * <AlertDialogBody>\n * <AlertDialogHeader>\n * <AlertDialogTitle>\n * Are you absolutely sure?\n * </AlertDialogTitle>\n * <AlertDialogDescription>\n * Proident quis nisi tempor irure sunt ut minim occaecat mollit sunt.\n * </AlertDialogDescription>\n * </AlertDialogHeader>\n * <AlertDialogFooter>\n * <AlertDialogCancel type=\"button\">Cancel</AlertDialogCancel>\n * <AlertDialogAction type=\"button\">\n * Continue\n * </AlertDialogAction>\n * </AlertDialogFooter>\n * \t</AlertDialogBody>\n * </AlertDialogContent>\n * </AlertDialog>\n * ```\n */\nconst AlertDialogHeader = forwardRef<\n\tComponentRef<\"div\">,\n\tComponentProps<\"div\"> & WithAsChild\n>(({ asChild = false, className, ...props }, ref) => {\n\tconst Component = asChild ? Slot : \"div\";\n\n\treturn (\n\t\t<Component\n\t\t\tclassName={cx(\n\t\t\t\t\"flex flex-col space-y-2 text-center sm:text-start\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\nAlertDialogHeader.displayName = \"AlertDialogHeader\";\n\n/**\n * Contains the footer content of the dialog, including the action and cancel buttons.\n *\n * @see https://mantle.ngrok.com/components/alert-dialog#api-alert-dialog-footer\n *\n * @example\n * ```tsx\n * <AlertDialog priority=\"danger\">\n * <AlertDialogTrigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Show Danger Alert Dialog\n * </Button>\n * </AlertDialogTrigger>\n * <AlertDialogContent>\n * <AlertDialogIcon />\n * <AlertDialogBody>\n * <AlertDialogHeader>\n * <AlertDialogTitle>\n * Are you absolutely sure?\n * </AlertDialogTitle>\n * <AlertDialogDescription>\n * Proident quis nisi tempor irure sunt ut minim occaecat mollit sunt.\n * </AlertDialogDescription>\n * </AlertDialogHeader>\n * <AlertDialogFooter>\n * <AlertDialogCancel type=\"button\">Cancel</AlertDialogCancel>\n * <AlertDialogAction type=\"button\">\n * Continue\n * </AlertDialogAction>\n * </AlertDialogFooter>\n * \t</AlertDialogBody>\n * </AlertDialogContent>\n * </AlertDialog>\n * ```\n */\nconst AlertDialogFooter = forwardRef<\n\tComponentRef<\"div\">,\n\tComponentProps<\"div\"> & WithAsChild\n>(({ asChild = false, className, ...props }, ref) => {\n\tconst Component = asChild ? Slot : \"div\";\n\n\treturn (\n\t\t<Component\n\t\t\tclassName={cx(\n\t\t\t\t\"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\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 *\n * @see https://mantle.ngrok.com/components/alert-dialog#api-alert-dialog-title\n *\n * @example\n * ```tsx\n * <AlertDialog priority=\"danger\">\n * <AlertDialogTrigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Show Danger Alert Dialog\n * </Button>\n * </AlertDialogTrigger>\n * <AlertDialogContent>\n * <AlertDialogIcon />\n * <AlertDialogBody>\n * <AlertDialogHeader>\n * <AlertDialogTitle>\n * Are you absolutely sure?\n * </AlertDialogTitle>\n * <AlertDialogDescription>\n * Proident quis nisi tempor irure sunt ut minim occaecat mollit sunt.\n * </AlertDialogDescription>\n * </AlertDialogHeader>\n * <AlertDialogFooter>\n * <AlertDialogCancel type=\"button\">Cancel</AlertDialogCancel>\n * <AlertDialogAction type=\"button\">\n * Continue\n * </AlertDialogAction>\n * </AlertDialogFooter>\n * \t</AlertDialogBody>\n * </AlertDialogContent>\n * </AlertDialog>\n * ```\n */\nconst AlertDialogTitle = forwardRef<\n\tComponentRef<typeof AlertDialogPrimitive.Title>,\n\tComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n\t<AlertDialogPrimitive.Title\n\t\tref={ref}\n\t\tclassName={cx(\n\t\t\t\"text-strong text-center text-lg font-medium sm:text-start\",\n\t\t\tclassName,\n\t\t)}\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 *\n * @see https://mantle.ngrok.com/components/alert-dialog#api-alert-dialog-description\n *\n * @example\n * ```tsx\n * <AlertDialog priority=\"danger\">\n * <AlertDialogTrigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Show Danger Alert Dialog\n * </Button>\n * </AlertDialogTrigger>\n * <AlertDialogContent>\n * <AlertDialogIcon />\n * <AlertDialogBody>\n * <AlertDialogHeader>\n * <AlertDialogTitle>\n * Are you absolutely sure?\n * </AlertDialogTitle>\n * <AlertDialogDescription>\n * Proident quis nisi tempor irure sunt ut minim occaecat mollit sunt.\n * </AlertDialogDescription>\n * </AlertDialogHeader>\n * <AlertDialogFooter>\n * <AlertDialogCancel type=\"button\">Cancel</AlertDialogCancel>\n * <AlertDialogAction type=\"button\">\n * Continue\n * </AlertDialogAction>\n * </AlertDialogFooter>\n * \t</AlertDialogBody>\n * </AlertDialogContent>\n * </AlertDialog>\n * ```\n */\nconst AlertDialogDescription = forwardRef<\n\tComponentRef<typeof AlertDialogPrimitive.Description>,\n\tComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n\t<AlertDialogPrimitive.Description\n\t\tref={ref}\n\t\tclassName={cx(\n\t\t\t\"text-body text-center text-sm font-normal sm:text-start\",\n\t\t\tclassName,\n\t\t)}\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 *\n * @see https://mantle.ngrok.com/components/alert-dialog#api-alert-dialog-action\n *\n * @example\n * ```tsx\n * <AlertDialog priority=\"danger\">\n * <AlertDialogTrigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Show Danger Alert Dialog\n * </Button>\n * </AlertDialogTrigger>\n * <AlertDialogContent>\n * <AlertDialogIcon />\n * <AlertDialogBody>\n * <AlertDialogHeader>\n * <AlertDialogTitle>\n * Are you absolutely sure?\n * </AlertDialogTitle>\n * <AlertDialogDescription>\n * Proident quis nisi tempor irure sunt ut minim occaecat mollit sunt.\n * </AlertDialogDescription>\n * </AlertDialogHeader>\n * <AlertDialogFooter>\n * <AlertDialogCancel type=\"button\">Cancel</AlertDialogCancel>\n * <AlertDialogAction type=\"button\">\n * Continue\n * </AlertDialogAction>\n * </AlertDialogFooter>\n * \t</AlertDialogBody>\n * </AlertDialogContent>\n * </AlertDialog>\n * ```\n */\nconst AlertDialogAction = forwardRef<ComponentRef<\"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 *\n * @see https://mantle.ngrok.com/components/alert-dialog#api-alert-dialog-cancel\n *\n * @example\n * ```tsx\n * <AlertDialog priority=\"danger\">\n * <AlertDialogTrigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Show Danger Alert Dialog\n * </Button>\n * </AlertDialogTrigger>\n * <AlertDialogContent>\n * <AlertDialogIcon />\n * <AlertDialogBody>\n * <AlertDialogHeader>\n * <AlertDialogTitle>\n * Are you absolutely sure?\n * </AlertDialogTitle>\n * <AlertDialogDescription>\n * Proident quis nisi tempor irure sunt ut minim occaecat mollit sunt.\n * </AlertDialogDescription>\n * </AlertDialogHeader>\n * <AlertDialogFooter>\n * <AlertDialogCancel type=\"button\">Cancel</AlertDialogCancel>\n * <AlertDialogAction type=\"button\">\n * Continue\n * </AlertDialogAction>\n * </AlertDialogFooter>\n * \t</AlertDialogBody>\n * </AlertDialogContent>\n * </AlertDialog>\n * ```\n */\nconst AlertDialogCancel = forwardRef<ComponentRef<\"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 *\n * @see https://mantle.ngrok.com/components/alert-dialog#api-alert-dialog-icon\n *\n * @example\n * ```tsx\n * <AlertDialog priority=\"danger\">\n * <AlertDialogTrigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Show Danger Alert Dialog\n * </Button>\n * </AlertDialogTrigger>\n * <AlertDialogContent>\n * <AlertDialogIcon />\n * <AlertDialogBody>\n * <AlertDialogHeader>\n * <AlertDialogTitle>\n * Are you absolutely sure?\n * </AlertDialogTitle>\n * <AlertDialogDescription>\n * Proident quis nisi tempor irure sunt ut minim occaecat mollit sunt.\n * </AlertDialogDescription>\n * </AlertDialogHeader>\n * <AlertDialogFooter>\n * <AlertDialogCancel type=\"button\">Cancel</AlertDialogCancel>\n * <AlertDialogAction type=\"button\">\n * Continue\n * </AlertDialogAction>\n * </AlertDialogFooter>\n * \t</AlertDialogBody>\n * </AlertDialogContent>\n * </AlertDialog>\n * ```\n */\nconst AlertDialogIcon = forwardRef<ComponentRef<\"svg\">, AlertDialogIconProps>(\n\t({ className, svg, ...props }, ref) => {\n\t\tconst ctx = useAlertDialogContext();\n\t\tconst defaultColor =\n\t\t\tctx.priority === \"danger\" ? \"text-danger-600\" : \"text-accent-600\";\n\t\tconst defaultIcon = ctx.priority === \"danger\" ? <Warning /> : <Info />;\n\n\t\treturn (\n\t\t\t<SvgOnly\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cx(\"size-12 sm:size-7\", defaultColor, className)}\n\t\t\t\tsvg={svg ?? defaultIcon}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t},\n);\nAlertDialogIcon.displayName = \"AlertDialogIcon\";\n\n/**\n * A button that closes the Alert Dialog. (Unstyled)\n *\n * @see https://mantle.ngrok.com/components/alert-dialog#api-alert-dialog-close\n *\n * @example\n * ```tsx\n * <AlertDialogClose asChild>\n * <AlertDialogAction\n * \ttype=\"button\"\n * \tonClick={() => doThing()}\n * >\n * \tDo thing and close\n * </AlertDialogAction>\n * </AlertDialogClose>\n */\nconst AlertDialogClose = AlertDialogPrimitive.Close;\n\nexport {\n\t//,\n\tAlertDialog,\n\tAlertDialogAction,\n\tAlertDialogBody,\n\tAlertDialogCancel,\n\tAlertDialogClose,\n\tAlertDialogContent,\n\tAlertDialogDescription,\n\tAlertDialogFooter,\n\tAlertDialogHeader,\n\tAlertDialogIcon,\n\tAlertDialogTitle,\n\tAlertDialogTrigger,\n};\n"],"mappings":"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","names":["Info","Warning","Slot","createContext","forwardRef","useContext","useMemo","invariant","jsx","jsxs","AlertDialogContext","createContext","useAlertDialogContext","context","useContext","invariant","AlertDialog","priority","props","useMemo","jsx","Root","AlertDialogTrigger","Trigger","AlertDialogPortal","Portal","AlertDialogOverlay","forwardRef","className","ref","Overlay","cx","AlertDialogContent","onInteractOutside","onPointerDownOutside","preferredWidth","jsxs","Content","event","preventCloseOnPromptInteraction","AlertDialogBody","asChild","Slot","AlertDialogHeader","AlertDialogFooter","AlertDialogTitle","Title","AlertDialogDescription","Description","AlertDialogAction","appearance","ctx","buttonPriority","Button","AlertDialogCancel","Close","AlertDialogIcon","svg","defaultColor","defaultIcon","Warning","Info","SvgOnly","AlertDialogClose"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/alert-dialog/alert-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { InfoIcon } from \"@phosphor-icons/react/Info\";\nimport { WarningIcon } from \"@phosphor-icons/react/Warning\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport {\n\ttype ComponentProps,\n\ttype ComponentPropsWithoutRef,\n\ttype ComponentRef,\n\ttype ReactNode,\n\tcreateContext,\n\tforwardRef,\n\tuseContext,\n\tuseMemo,\n} from \"react\";\nimport invariant from \"tiny-invariant\";\nimport type { WithAsChild } from \"../../types/as-child.js\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport {\n\tButton,\n\ttype ButtonPriority,\n\ttype ButtonProps,\n} from \"../button/button.js\";\nimport * as AlertDialogPrimitive from \"../dialog/primitive.js\";\nimport { SvgOnly } from \"../icon/svg-only.js\";\nimport type { SvgAttributes } from \"../icon/types.js\";\nimport { preventCloseOnPromptInteraction } from \"../toast/toast.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(\n\t\tcontext,\n\t\t\"AlertDialog child component used outside of AlertDialog parent!\",\n\t);\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 * A modal dialog that interrupts the user with important content and expects a\n * response.\n * The root stateful component for the Alert Dialog.\n *\n * @see https://mantle.ngrok.com/components/alert-dialog#api-alert-dialog\n *\n * @example\n * ```tsx\n * <AlertDialog priority=\"danger\">\n * <AlertDialogTrigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Show Danger Alert Dialog\n * </Button>\n * </AlertDialogTrigger>\n * <AlertDialogContent>\n * <AlertDialogIcon />\n * <AlertDialogBody>\n * <AlertDialogHeader>\n * <AlertDialogTitle>\n * Are you absolutely sure?\n * </AlertDialogTitle>\n * <AlertDialogDescription>\n * Proident quis nisi tempor irure sunt ut minim occaecat mollit sunt.\n * </AlertDialogDescription>\n * </AlertDialogHeader>\n * <AlertDialogFooter>\n * <AlertDialogCancel type=\"button\">Cancel</AlertDialogCancel>\n * <AlertDialogAction type=\"button\">\n * Continue\n * </AlertDialogAction>\n * </AlertDialogFooter>\n * \t</AlertDialogBody>\n * </AlertDialogContent>\n * </AlertDialog>\n * ```\n */\nfunction AlertDialog({ priority, ...props }: AlertDialogProps) {\n\tconst context: AlertDialogContextValue = useMemo(\n\t\t() => ({ priority }),\n\t\t[priority],\n\t);\n\n\treturn (\n\t\t<AlertDialogContext.Provider value={context}>\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 *\n * @see https://mantle.ngrok.com/components/alert-dialog#api-alert-dialog-trigger\n *\n * @example\n * ```tsx\n * <AlertDialog priority=\"danger\">\n * <AlertDialogTrigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Show Danger Alert Dialog\n * </Button>\n * </AlertDialogTrigger>\n * <AlertDialogContent>\n * <AlertDialogIcon />\n * <AlertDialogBody>\n * <AlertDialogHeader>\n * <AlertDialogTitle>\n * Are you absolutely sure?\n * </AlertDialogTitle>\n * <AlertDialogDescription>\n * Proident quis nisi tempor irure sunt ut minim occaecat mollit sunt.\n * </AlertDialogDescription>\n * </AlertDialogHeader>\n * <AlertDialogFooter>\n * <AlertDialogCancel type=\"button\">Cancel</AlertDialogCancel>\n * <AlertDialogAction type=\"button\">\n * Continue\n * </AlertDialogAction>\n * </AlertDialogFooter>\n * \t</AlertDialogBody>\n * </AlertDialogContent>\n * </AlertDialog>\n * ```\n */\nconst AlertDialogTrigger = AlertDialogPrimitive.Trigger;\n\n/**\n * The portal for the Alert Dialog.\n *\n * @private\n */\nconst AlertDialogPortal = AlertDialogPrimitive.Portal;\n\n/**\n * A layer that covers the inert portion of the view when the dialog is open.\n *\n * @private\n */\nconst AlertDialogOverlay = forwardRef<\n\tComponentRef<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\ntype AlertDialogContentProps = ComponentPropsWithoutRef<\n\ttypeof AlertDialogPrimitive.Content\n> & {\n\t/**\n\t * The preferred width of the `AlertDialogContent` as a tailwind `max-w-` class.\n\t *\n\t * By default, a `AlertDialog`'s content width is responsive with a default\n\t * preferred width: the maximum width of the `AlertDialogContent`\n\t *\n\t * @default `max-w-md`\n\t */\n\tpreferredWidth?: `max-w-${string}`;\n};\n\n/**\n * The popover alert dialog container.\n *\n * Renders on top of the overlay and is centered in the viewport.\n *\n * @see https://mantle.ngrok.com/components/alert-dialog#api-alert-dialog-content\n *\n * @example\n * ```tsx\n * <AlertDialog priority=\"danger\">\n * <AlertDialogTrigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Show Danger Alert Dialog\n * </Button>\n * </AlertDialogTrigger>\n * <AlertDialogContent>\n * <AlertDialogIcon />\n * <AlertDialogBody>\n * <AlertDialogHeader>\n * <AlertDialogTitle>\n * Are you absolutely sure?\n * </AlertDialogTitle>\n * <AlertDialogDescription>\n * Proident quis nisi tempor irure sunt ut minim occaecat mollit sunt.\n * </AlertDialogDescription>\n * </AlertDialogHeader>\n * <AlertDialogFooter>\n * <AlertDialogCancel type=\"button\">Cancel</AlertDialogCancel>\n * <AlertDialogAction type=\"button\">\n * Continue\n * </AlertDialogAction>\n * </AlertDialogFooter>\n * \t</AlertDialogBody>\n * </AlertDialogContent>\n * </AlertDialog>\n * ```\n */\nconst AlertDialogContent = forwardRef<\n\tComponentRef<typeof AlertDialogPrimitive.Content>,\n\tAlertDialogContentProps\n>(\n\t(\n\t\t{\n\t\t\tclassName,\n\t\t\tonInteractOutside,\n\t\t\tonPointerDownOutside,\n\t\t\tpreferredWidth = \"max-w-md\",\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => (\n\t\t<AlertDialogPortal>\n\t\t\t<AlertDialogOverlay />\n\t\t\t<div className=\"fixed inset-4 z-50 flex items-center justify-center\">\n\t\t\t\t<AlertDialogPrimitive.Content\n\t\t\t\t\tref={ref}\n\t\t\t\t\tclassName={cx(\n\t\t\t\t\t\t\"flex w-full flex-1 flex-col items-center gap-4 sm:flex-row sm:items-start\",\n\t\t\t\t\t\t\"outline-none focus-within:outline-none\",\n\t\t\t\t\t\t\"p-6\",\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\tpreferredWidth,\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\tonInteractOutside={(event) => {\n\t\t\t\t\t\tpreventCloseOnPromptInteraction(event);\n\t\t\t\t\t\tonInteractOutside?.(event);\n\t\t\t\t\t}}\n\t\t\t\t\tonPointerDownOutside={(event) => {\n\t\t\t\t\t\tpreventCloseOnPromptInteraction(event);\n\t\t\t\t\t\tonPointerDownOutside?.(event);\n\t\t\t\t\t}}\n\t\t\t\t\t{...props}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</AlertDialogPortal>\n\t),\n);\nAlertDialogContent.displayName = \"AlertDialogContent\";\n\n/**\n * Contains the main content of the alert dialog.\n *\n * @see https://mantle.ngrok.com/components/alert-dialog#api-alert-dialog-body\n *\n * @example\n * ```tsx\n * <AlertDialog priority=\"danger\">\n * <AlertDialogTrigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Show Danger Alert Dialog\n * </Button>\n * </AlertDialogTrigger>\n * <AlertDialogContent>\n * <AlertDialogIcon />\n * <AlertDialogBody>\n * <AlertDialogHeader>\n * <AlertDialogTitle>\n * Are you absolutely sure?\n * </AlertDialogTitle>\n * <AlertDialogDescription>\n * Proident quis nisi tempor irure sunt ut minim occaecat mollit sunt.\n * </AlertDialogDescription>\n * </AlertDialogHeader>\n * <AlertDialogFooter>\n * <AlertDialogCancel type=\"button\">Cancel</AlertDialogCancel>\n * <AlertDialogAction type=\"button\">\n * Continue\n * </AlertDialogAction>\n * </AlertDialogFooter>\n * \t</AlertDialogBody>\n * </AlertDialogContent>\n * </AlertDialog>\n * ```\n */\nconst AlertDialogBody = forwardRef<\n\tComponentRef<\"div\">,\n\tComponentProps<\"div\"> & WithAsChild\n>(({ asChild = false, className, ...props }, ref) => {\n\tconst Component = asChild ? Slot : \"div\";\n\n\treturn (\n\t\t<Component\n\t\t\tclassName={cx(\"flex-1 space-y-4\", className)}\n\t\t\tref={ref}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\nAlertDialogBody.displayName = \"AlertDialogBody\";\n\n/**\n * Contains the header content of the dialog, including the title and description.\n *\n * @see https://mantle.ngrok.com/components/alert-dialog#api-alert-dialog-header\n *\n * @example\n * ```tsx\n * <AlertDialog priority=\"danger\">\n * <AlertDialogTrigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Show Danger Alert Dialog\n * </Button>\n * </AlertDialogTrigger>\n * <AlertDialogContent>\n * <AlertDialogIcon />\n * <AlertDialogBody>\n * <AlertDialogHeader>\n * <AlertDialogTitle>\n * Are you absolutely sure?\n * </AlertDialogTitle>\n * <AlertDialogDescription>\n * Proident quis nisi tempor irure sunt ut minim occaecat mollit sunt.\n * </AlertDialogDescription>\n * </AlertDialogHeader>\n * <AlertDialogFooter>\n * <AlertDialogCancel type=\"button\">Cancel</AlertDialogCancel>\n * <AlertDialogAction type=\"button\">\n * Continue\n * </AlertDialogAction>\n * </AlertDialogFooter>\n * \t</AlertDialogBody>\n * </AlertDialogContent>\n * </AlertDialog>\n * ```\n */\nconst AlertDialogHeader = forwardRef<\n\tComponentRef<\"div\">,\n\tComponentProps<\"div\"> & WithAsChild\n>(({ asChild = false, className, ...props }, ref) => {\n\tconst Component = asChild ? Slot : \"div\";\n\n\treturn (\n\t\t<Component\n\t\t\tclassName={cx(\n\t\t\t\t\"flex flex-col space-y-2 text-center sm:text-start\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\nAlertDialogHeader.displayName = \"AlertDialogHeader\";\n\n/**\n * Contains the footer content of the dialog, including the action and cancel buttons.\n *\n * @see https://mantle.ngrok.com/components/alert-dialog#api-alert-dialog-footer\n *\n * @example\n * ```tsx\n * <AlertDialog priority=\"danger\">\n * <AlertDialogTrigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Show Danger Alert Dialog\n * </Button>\n * </AlertDialogTrigger>\n * <AlertDialogContent>\n * <AlertDialogIcon />\n * <AlertDialogBody>\n * <AlertDialogHeader>\n * <AlertDialogTitle>\n * Are you absolutely sure?\n * </AlertDialogTitle>\n * <AlertDialogDescription>\n * Proident quis nisi tempor irure sunt ut minim occaecat mollit sunt.\n * </AlertDialogDescription>\n * </AlertDialogHeader>\n * <AlertDialogFooter>\n * <AlertDialogCancel type=\"button\">Cancel</AlertDialogCancel>\n * <AlertDialogAction type=\"button\">\n * Continue\n * </AlertDialogAction>\n * </AlertDialogFooter>\n * \t</AlertDialogBody>\n * </AlertDialogContent>\n * </AlertDialog>\n * ```\n */\nconst AlertDialogFooter = forwardRef<\n\tComponentRef<\"div\">,\n\tComponentProps<\"div\"> & WithAsChild\n>(({ asChild = false, className, ...props }, ref) => {\n\tconst Component = asChild ? Slot : \"div\";\n\n\treturn (\n\t\t<Component\n\t\t\tclassName={cx(\n\t\t\t\t\"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\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 *\n * @see https://mantle.ngrok.com/components/alert-dialog#api-alert-dialog-title\n *\n * @example\n * ```tsx\n * <AlertDialog priority=\"danger\">\n * <AlertDialogTrigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Show Danger Alert Dialog\n * </Button>\n * </AlertDialogTrigger>\n * <AlertDialogContent>\n * <AlertDialogIcon />\n * <AlertDialogBody>\n * <AlertDialogHeader>\n * <AlertDialogTitle>\n * Are you absolutely sure?\n * </AlertDialogTitle>\n * <AlertDialogDescription>\n * Proident quis nisi tempor irure sunt ut minim occaecat mollit sunt.\n * </AlertDialogDescription>\n * </AlertDialogHeader>\n * <AlertDialogFooter>\n * <AlertDialogCancel type=\"button\">Cancel</AlertDialogCancel>\n * <AlertDialogAction type=\"button\">\n * Continue\n * </AlertDialogAction>\n * </AlertDialogFooter>\n * \t</AlertDialogBody>\n * </AlertDialogContent>\n * </AlertDialog>\n * ```\n */\nconst AlertDialogTitle = forwardRef<\n\tComponentRef<typeof AlertDialogPrimitive.Title>,\n\tComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n\t<AlertDialogPrimitive.Title\n\t\tref={ref}\n\t\tclassName={cx(\n\t\t\t\"text-strong text-center text-lg font-medium sm:text-start\",\n\t\t\tclassName,\n\t\t)}\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 *\n * @see https://mantle.ngrok.com/components/alert-dialog#api-alert-dialog-description\n *\n * @example\n * ```tsx\n * <AlertDialog priority=\"danger\">\n * <AlertDialogTrigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Show Danger Alert Dialog\n * </Button>\n * </AlertDialogTrigger>\n * <AlertDialogContent>\n * <AlertDialogIcon />\n * <AlertDialogBody>\n * <AlertDialogHeader>\n * <AlertDialogTitle>\n * Are you absolutely sure?\n * </AlertDialogTitle>\n * <AlertDialogDescription>\n * Proident quis nisi tempor irure sunt ut minim occaecat mollit sunt.\n * </AlertDialogDescription>\n * </AlertDialogHeader>\n * <AlertDialogFooter>\n * <AlertDialogCancel type=\"button\">Cancel</AlertDialogCancel>\n * <AlertDialogAction type=\"button\">\n * Continue\n * </AlertDialogAction>\n * </AlertDialogFooter>\n * \t</AlertDialogBody>\n * </AlertDialogContent>\n * </AlertDialog>\n * ```\n */\nconst AlertDialogDescription = forwardRef<\n\tComponentRef<typeof AlertDialogPrimitive.Description>,\n\tComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n\t<AlertDialogPrimitive.Description\n\t\tref={ref}\n\t\tclassName={cx(\n\t\t\t\"text-body text-center text-sm font-normal sm:text-start\",\n\t\t\tclassName,\n\t\t)}\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 *\n * @see https://mantle.ngrok.com/components/alert-dialog#api-alert-dialog-action\n *\n * @example\n * ```tsx\n * <AlertDialog priority=\"danger\">\n * <AlertDialogTrigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Show Danger Alert Dialog\n * </Button>\n * </AlertDialogTrigger>\n * <AlertDialogContent>\n * <AlertDialogIcon />\n * <AlertDialogBody>\n * <AlertDialogHeader>\n * <AlertDialogTitle>\n * Are you absolutely sure?\n * </AlertDialogTitle>\n * <AlertDialogDescription>\n * Proident quis nisi tempor irure sunt ut minim occaecat mollit sunt.\n * </AlertDialogDescription>\n * </AlertDialogHeader>\n * <AlertDialogFooter>\n * <AlertDialogCancel type=\"button\">Cancel</AlertDialogCancel>\n * <AlertDialogAction type=\"button\">\n * Continue\n * </AlertDialogAction>\n * </AlertDialogFooter>\n * \t</AlertDialogBody>\n * </AlertDialogContent>\n * </AlertDialog>\n * ```\n */\nconst AlertDialogAction = forwardRef<ComponentRef<\"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 *\n * @see https://mantle.ngrok.com/components/alert-dialog#api-alert-dialog-cancel\n *\n * @example\n * ```tsx\n * <AlertDialog priority=\"danger\">\n * <AlertDialogTrigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Show Danger Alert Dialog\n * </Button>\n * </AlertDialogTrigger>\n * <AlertDialogContent>\n * <AlertDialogIcon />\n * <AlertDialogBody>\n * <AlertDialogHeader>\n * <AlertDialogTitle>\n * Are you absolutely sure?\n * </AlertDialogTitle>\n * <AlertDialogDescription>\n * Proident quis nisi tempor irure sunt ut minim occaecat mollit sunt.\n * </AlertDialogDescription>\n * </AlertDialogHeader>\n * <AlertDialogFooter>\n * <AlertDialogCancel type=\"button\">Cancel</AlertDialogCancel>\n * <AlertDialogAction type=\"button\">\n * Continue\n * </AlertDialogAction>\n * </AlertDialogFooter>\n * \t</AlertDialogBody>\n * </AlertDialogContent>\n * </AlertDialog>\n * ```\n */\nconst AlertDialogCancel = forwardRef<ComponentRef<\"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 *\n * @see https://mantle.ngrok.com/components/alert-dialog#api-alert-dialog-icon\n *\n * @example\n * ```tsx\n * <AlertDialog priority=\"danger\">\n * <AlertDialogTrigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Show Danger Alert Dialog\n * </Button>\n * </AlertDialogTrigger>\n * <AlertDialogContent>\n * <AlertDialogIcon />\n * <AlertDialogBody>\n * <AlertDialogHeader>\n * <AlertDialogTitle>\n * Are you absolutely sure?\n * </AlertDialogTitle>\n * <AlertDialogDescription>\n * Proident quis nisi tempor irure sunt ut minim occaecat mollit sunt.\n * </AlertDialogDescription>\n * </AlertDialogHeader>\n * <AlertDialogFooter>\n * <AlertDialogCancel type=\"button\">Cancel</AlertDialogCancel>\n * <AlertDialogAction type=\"button\">\n * Continue\n * </AlertDialogAction>\n * </AlertDialogFooter>\n * \t</AlertDialogBody>\n * </AlertDialogContent>\n * </AlertDialog>\n * ```\n */\nconst AlertDialogIcon = forwardRef<ComponentRef<\"svg\">, AlertDialogIconProps>(\n\t({ className, svg, ...props }, ref) => {\n\t\tconst ctx = useAlertDialogContext();\n\t\tconst defaultColor =\n\t\t\tctx.priority === \"danger\" ? \"text-danger-600\" : \"text-accent-600\";\n\t\tconst defaultIcon =\n\t\t\tctx.priority === \"danger\" ? <WarningIcon /> : <InfoIcon />;\n\n\t\treturn (\n\t\t\t<SvgOnly\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cx(\"size-12 sm:size-7\", defaultColor, className)}\n\t\t\t\tsvg={svg ?? defaultIcon}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t},\n);\nAlertDialogIcon.displayName = \"AlertDialogIcon\";\n\n/**\n * A button that closes the Alert Dialog. (Unstyled)\n *\n * @see https://mantle.ngrok.com/components/alert-dialog#api-alert-dialog-close\n *\n * @example\n * ```tsx\n * <AlertDialogClose asChild>\n * <AlertDialogAction\n * \ttype=\"button\"\n * \tonClick={() => doThing()}\n * >\n * \tDo thing and close\n * </AlertDialogAction>\n * </AlertDialogClose>\n */\nconst AlertDialogClose = AlertDialogPrimitive.Close;\n\nexport {\n\t//,\n\tAlertDialog,\n\tAlertDialogAction,\n\tAlertDialogBody,\n\tAlertDialogCancel,\n\tAlertDialogClose,\n\tAlertDialogContent,\n\tAlertDialogDescription,\n\tAlertDialogFooter,\n\tAlertDialogHeader,\n\tAlertDialogIcon,\n\tAlertDialogTitle,\n\tAlertDialogTrigger,\n};\n"],"mappings":"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","names":["InfoIcon","WarningIcon","Slot","createContext","forwardRef","useContext","useMemo","invariant","jsx","jsxs","AlertDialogContext","createContext","useAlertDialogContext","context","useContext","invariant","AlertDialog","priority","props","useMemo","jsx","Root","AlertDialogTrigger","Trigger","AlertDialogPortal","Portal","AlertDialogOverlay","forwardRef","className","ref","Overlay","cx","AlertDialogContent","onInteractOutside","onPointerDownOutside","preferredWidth","jsxs","Content","event","preventCloseOnPromptInteraction","AlertDialogBody","asChild","Slot","AlertDialogHeader","AlertDialogFooter","AlertDialogTitle","Title","AlertDialogDescription","Description","AlertDialogAction","appearance","ctx","buttonPriority","Button","AlertDialogCancel","Close","AlertDialogIcon","svg","defaultColor","defaultIcon","WarningIcon","InfoIcon","SvgOnly","AlertDialogClose"]}
|
package/dist/alert.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as l}from"./chunk-HDPLH5HC.js";import{a as s}from"./chunk-AZ56JGNY.js";import{CheckCircleIcon as g}from"@phosphor-icons/react/CheckCircle";import{InfoIcon as y}from"@phosphor-icons/react/Info";import{WarningIcon as x}from"@phosphor-icons/react/Warning";import{WarningDiamondIcon as v}from"@phosphor-icons/react/WarningDiamond";import{Slot as p}from"@radix-ui/react-slot";import{cva as P}from"class-variance-authority";import{createContext as b,forwardRef as c,useContext as N,useMemo as I}from"react";import R from"tiny-invariant";import{jsx as r}from"react/jsx-runtime";var a=b(null);function h(){let t=N(a);return R(t,"useAlertContext hook used outside of Alert parent!"),t}var w=P("relative flex w-full gap-1.5 rounded-md border p-2.5 text-sm",{variants:{priority:{danger:"border-danger-500/50 bg-danger-500/10 text-danger-700",info:"border-accent-500/50 bg-accent-500/10 text-accent-700",success:"border-success-500/50 bg-success-500/10 text-success-700",warning:"border-warning-500/50 bg-warning-500/10 text-warning-700"}}}),m=c(({className:t,priority:e,...o},n)=>{let i=I(()=>({priority:e}),[e]);return r(a.Provider,{value:i,children:r("div",{ref:n,className:s(w({priority:e}),t),...o})})});m.displayName="Alert";var T={danger:r(x,{}),info:r(y,{}),success:r(g,{}),warning:r(v,{})},d=c(({className:t,svg:e,...o},n)=>{let i=h(),C=T[i.priority];return r(l,{ref:n,className:s("size-5",t),svg:e??C,...o})});d.displayName="AlertIcon";var f=c(({className:t,...e},o)=>r("div",{ref:o,className:s("min-w-0 flex-1",t),...e}));f.displayName="AlertContent";var A=c(({asChild:t=!1,className:e,...o},n)=>r(t?p:"h5",{ref:n,className:s("font-medium",e),...o}));A.displayName="AlertTitle";var u=c(({asChild:t=!1,className:e,...o},n)=>r(t?p:"p",{ref:n,className:s("text-sm",e),...o}));u.displayName="AlertDescription";export{m as Alert,f as AlertContent,u as AlertDescription,d as AlertIcon,A as AlertTitle};
|
|
2
2
|
//# sourceMappingURL=alert.js.map
|
package/dist/alert.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/alert/alert.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../src/components/alert/alert.tsx"],"sourcesContent":["import { CheckCircleIcon } from \"@phosphor-icons/react/CheckCircle\";\nimport { InfoIcon } from \"@phosphor-icons/react/Info\";\nimport { WarningIcon } from \"@phosphor-icons/react/Warning\";\nimport { WarningDiamondIcon } from \"@phosphor-icons/react/WarningDiamond\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva } from \"class-variance-authority\";\nimport type {\n\tComponentProps,\n\tComponentRef,\n\tHTMLAttributes,\n\tReactNode,\n} from \"react\";\nimport { createContext, forwardRef, useContext, useMemo } from \"react\";\nimport invariant from \"tiny-invariant\";\nimport type { WithAsChild } from \"../../types/index.js\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport { SvgOnly } from \"../icon/svg-only.js\";\nimport type { SvgAttributes } from \"../icon/types.js\";\n\nconst priorities = [\n\t//,\n\t\"danger\",\n\t\"info\",\n\t// \"neutral\",\n\t\"success\",\n\t\"warning\",\n] as const;\ntype Priority = (typeof priorities)[number];\n\ntype AlertContextValue = {\n\tpriority: Priority;\n};\n\nconst AlertContext = createContext<AlertContextValue | null>(null);\n\nfunction useAlertContext() {\n\tconst context = useContext(AlertContext);\n\tinvariant(context, \"useAlertContext hook used outside of Alert parent!\");\n\treturn context;\n}\n\nconst alertVariants = cva(\n\t\"relative flex w-full gap-1.5 rounded-md border p-2.5 text-sm\",\n\t{\n\t\tvariants: {\n\t\t\t/**\n\t\t\t * The priority of the Alert. Indicates the importance or impact level of the Alert,\n\t\t\t * affecting its color and styling to communicate its purpose to the user.\n\t\t\t */\n\t\t\tpriority: {\n\t\t\t\tdanger: \"border-danger-500/50 bg-danger-500/10 text-danger-700\",\n\t\t\t\tinfo: \"border-accent-500/50 bg-accent-500/10 text-accent-700\",\n\t\t\t\t// neutral: \"border-neutral-500/50 bg-neutral-500/10 text-neutral-700\",\n\t\t\t\tsuccess: \"border-success-500/50 bg-success-500/10 text-success-700\",\n\t\t\t\twarning: \"border-warning-500/50 bg-warning-500/10 text-warning-700\",\n\t\t\t} as const satisfies Record<Priority, string>,\n\t\t},\n\t},\n);\n\ntype AlertProps = ComponentProps<\"div\"> & {\n\t/**\n\t * Indicates the importance or impact level of the Alert, affecting its\n\t * color and styling to communicate its purpose to the user.\n\t */\n\tpriority: Priority;\n};\n\n/**\n * Displays a callout for user attention. Root container for all Alert sub-components.\n *\n * @see https://mantle.ngrok.com/components/alert#api-alert\n *\n * @example\n * ```tsx\n * <Alert priority=\"info\">\n * <AlertIcon />\n * <AlertContent>\n * <AlertTitle>Alert Title</AlertTitle>\n * <AlertDescription>\n * Alert description text.\n * </AlertDescription>\n * </AlertContent>\n * </Alert>\n *```\n */\nconst Alert = forwardRef<ComponentRef<\"div\">, AlertProps>(\n\t({ className, priority, ...props }, ref) => {\n\t\tconst context: AlertContextValue = useMemo(\n\t\t\t() => ({ priority }),\n\t\t\t[priority],\n\t\t);\n\n\t\treturn (\n\t\t\t<AlertContext.Provider value={context}>\n\t\t\t\t<div\n\t\t\t\t\tref={ref}\n\t\t\t\t\tclassName={cx(alertVariants({ priority }), className)}\n\t\t\t\t\t{...props}\n\t\t\t\t/>\n\t\t\t</AlertContext.Provider>\n\t\t);\n\t},\n);\nAlert.displayName = \"Alert\";\n\ntype AlertIconProps = Omit<SvgAttributes, \"children\"> & {\n\t/**\n\t * An optional icon that renders in place of the default icon for the Alert priority.\n\t */\n\tsvg?: ReactNode;\n};\n\n/**\n * Default `<AlertIcon>` icons for each priority.\n */\nconst defaultIcons = {\n\tdanger: <WarningIcon />,\n\tinfo: <InfoIcon />,\n\t// neutral: <BellRinging />,\n\tsuccess: <CheckCircleIcon />,\n\twarning: <WarningDiamondIcon />,\n} as const satisfies Record<Priority, ReactNode>;\n\n/**\n * An optional icon that visually represents the priority of the Alert.\n *\n * The default rendered icon be overridden with a custom icon using the `svg` prop.\n *\n * @see https://mantle.ngrok.com/components/alert#api-alert-icon\n *\n * @example\n * ```tsx\n * <Alert priority=\"info\">\n * <AlertIcon />\n * <AlertContent>\n * <AlertTitle>Alert Title</AlertTitle>\n * <AlertDescription>\n * Alert description text.\n * </AlertDescription>\n * </AlertContent>\n * </Alert>\n * ```\n */\nconst AlertIcon = forwardRef<ComponentRef<\"svg\">, AlertIconProps>(\n\t({ className, svg, ...props }, ref) => {\n\t\tconst ctx = useAlertContext();\n\t\tconst defaultIcon = defaultIcons[ctx.priority];\n\n\t\treturn (\n\t\t\t<SvgOnly\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cx(\"size-5\", className)}\n\t\t\t\tsvg={svg ?? defaultIcon}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t},\n);\nAlertIcon.displayName = \"AlertIcon\";\n\n/**\n * The container for the content slot of an alert. Place the title and description as direct children.\n *\n * @see https://mantle.ngrok.com/components/alert#api-alert-content\n *\n * @example\n * ```tsx\n * <Alert priority=\"info\">\n * <AlertIcon />\n * <AlertContent>\n * <AlertTitle>Alert Title</AlertTitle>\n * <AlertDescription>\n * Alert description text.\n * </AlertDescription>\n * </AlertContent>\n * </Alert>\n *```\n */\nconst AlertContent = forwardRef<ComponentRef<\"div\">, ComponentProps<\"div\">>(\n\t({ className, ...props }, ref) => (\n\t\t<div ref={ref} className={cx(\"min-w-0 flex-1\", className)} {...props} />\n\t),\n);\nAlertContent.displayName = \"AlertContent\";\n\ntype AlertTitleProps = HTMLAttributes<HTMLHeadingElement> & WithAsChild;\n\n/**\n * The title of an alert. Default renders as an h5 element, use asChild to render something else.\n *\n * @see https://mantle.ngrok.com/components/alert#api-alert-title\n *\n * @example\n * ```tsx\n * <Alert priority=\"info\">\n * <AlertIcon />\n * <AlertContent>\n * <AlertTitle>Alert Title</AlertTitle>\n * <AlertDescription>\n * Alert description text.\n * </AlertDescription>\n * </AlertContent>\n * </Alert>\n *```\n */\nconst AlertTitle = forwardRef<HTMLHeadingElement, AlertTitleProps>(\n\t({ asChild = false, className, ...props }, ref) => {\n\t\tconst Component = asChild ? Slot : \"h5\";\n\n\t\treturn (\n\t\t\t<Component\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cx(\"font-medium\", className)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t},\n);\nAlertTitle.displayName = \"AlertTitle\";\n\ntype AlertDescriptionProps = ComponentProps<\"p\"> & WithAsChild;\n\n/**\n * The optional description of an alert. Default renders as an p element, use asChild to render something else.\n *\n * @see https://mantle.ngrok.com/components/alert#api-alert-description\n *\n * @example\n * ```tsx\n * <Alert priority=\"info\">\n * <AlertIcon />\n * <AlertContent>\n * <AlertTitle>Alert Title</AlertTitle>\n * <AlertDescription>\n * Alert description text.\n * </AlertDescription>\n * </AlertContent>\n * </Alert>\n * ```\n */\nconst AlertDescription = forwardRef<ComponentRef<\"p\">, AlertDescriptionProps>(\n\t({ asChild = false, className, ...props }, ref) => {\n\t\tconst Component = asChild ? Slot : \"p\";\n\n\t\treturn (\n\t\t\t<Component ref={ref} className={cx(\"text-sm\", className)} {...props} />\n\t\t);\n\t},\n);\nAlertDescription.displayName = \"AlertDescription\";\n\nexport {\n\t//,\n\tAlert,\n\tAlertContent,\n\tAlertDescription,\n\tAlertIcon,\n\tAlertTitle,\n};\n"],"mappings":"gFAAA,OAAS,mBAAAA,MAAuB,oCAChC,OAAS,YAAAC,MAAgB,6BACzB,OAAS,eAAAC,MAAmB,gCAC5B,OAAS,sBAAAC,MAA0B,uCACnC,OAAS,QAAAC,MAAY,uBACrB,OAAS,OAAAC,MAAW,2BAOpB,OAAS,iBAAAC,EAAe,cAAAC,EAAY,cAAAC,EAAY,WAAAC,MAAe,QAC/D,OAAOC,MAAe,iBAkFlB,cAAAC,MAAA,oBA9DJ,IAAMC,EAAeC,EAAwC,IAAI,EAEjE,SAASC,GAAkB,CAC1B,IAAMC,EAAUC,EAAWJ,CAAY,EACvC,OAAAK,EAAUF,EAAS,oDAAoD,EAChEA,CACR,CAEA,IAAMG,EAAgBC,EACrB,+DACA,CACC,SAAU,CAKT,SAAU,CACT,OAAQ,wDACR,KAAM,wDAEN,QAAS,2DACT,QAAS,0DACV,CACD,CACD,CACD,EA4BMC,EAAQC,EACb,CAAC,CAAE,UAAAC,EAAW,SAAAC,EAAU,GAAGC,CAAM,EAAGC,IAAQ,CAC3C,IAAMV,EAA6BW,EAClC,KAAO,CAAE,SAAAH,CAAS,GAClB,CAACA,CAAQ,CACV,EAEA,OACCI,EAACf,EAAa,SAAb,CAAsB,MAAOG,EAC7B,SAAAY,EAAC,OACA,IAAKF,EACL,UAAWG,EAAGV,EAAc,CAAE,SAAAK,CAAS,CAAC,EAAGD,CAAS,EACnD,GAAGE,EACL,EACD,CAEF,CACD,EACAJ,EAAM,YAAc,QAYpB,IAAMS,EAAe,CACpB,OAAQF,EAACG,EAAA,EAAY,EACrB,KAAMH,EAACI,EAAA,EAAS,EAEhB,QAASJ,EAACK,EAAA,EAAgB,EAC1B,QAASL,EAACM,EAAA,EAAmB,CAC9B,EAsBMC,EAAYb,EACjB,CAAC,CAAE,UAAAC,EAAW,IAAAa,EAAK,GAAGX,CAAM,EAAGC,IAAQ,CACtC,IAAMW,EAAMtB,EAAgB,EACtBuB,EAAcR,EAAaO,EAAI,QAAQ,EAE7C,OACCT,EAACW,EAAA,CACA,IAAKb,EACL,UAAWG,EAAG,SAAUN,CAAS,EACjC,IAAKa,GAAOE,EACX,GAAGb,EACL,CAEF,CACD,EACAU,EAAU,YAAc,YAoBxB,IAAMK,EAAelB,EACpB,CAAC,CAAE,UAAAC,EAAW,GAAGE,CAAM,EAAGC,IACzBE,EAAC,OAAI,IAAKF,EAAK,UAAWG,EAAG,iBAAkBN,CAAS,EAAI,GAAGE,EAAO,CAExE,EACAe,EAAa,YAAc,eAsB3B,IAAMC,EAAanB,EAClB,CAAC,CAAE,QAAAoB,EAAU,GAAO,UAAAnB,EAAW,GAAGE,CAAM,EAAGC,IAIzCE,EAHiBc,EAAUC,EAAO,KAGjC,CACA,IAAKjB,EACL,UAAWG,EAAG,cAAeN,CAAS,EACrC,GAAGE,EACL,CAGH,EACAgB,EAAW,YAAc,aAsBzB,IAAMG,EAAmBtB,EACxB,CAAC,CAAE,QAAAoB,EAAU,GAAO,UAAAnB,EAAW,GAAGE,CAAM,EAAGC,IAIzCE,EAHiBc,EAAUC,EAAO,IAGjC,CAAU,IAAKjB,EAAK,UAAWG,EAAG,UAAWN,CAAS,EAAI,GAAGE,EAAO,CAGxE,EACAmB,EAAiB,YAAc","names":["CheckCircleIcon","InfoIcon","WarningIcon","WarningDiamondIcon","Slot","cva","createContext","forwardRef","useContext","useMemo","invariant","jsx","AlertContext","createContext","useAlertContext","context","useContext","invariant","alertVariants","cva","Alert","forwardRef","className","priority","props","ref","useMemo","jsx","cx","defaultIcons","WarningIcon","InfoIcon","CheckCircleIcon","WarningDiamondIcon","AlertIcon","svg","ctx","defaultIcon","SvgOnly","AlertContent","AlertTitle","asChild","Slot","AlertDescription"]}
|
package/dist/anchor.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as n}from"./chunk-
|
|
1
|
+
import{a as n}from"./chunk-XQVVOOLT.js";import"./chunk-HDPLH5HC.js";import{a as m}from"./chunk-AZ56JGNY.js";import{Slot as y}from"@radix-ui/react-slot";import{Children as b,cloneElement as v,forwardRef as N,isValidElement as C}from"react";import x from"tiny-invariant";import{Fragment as T,jsx as t,jsxs as p}from"react/jsx-runtime";var d=r=>m("cursor-pointer rounded bg-transparent text-accent-600 hover:underline focus:outline-none focus-visible:ring focus-visible:ring-focus-accent",r),u=N(({asChild:r,children:s,className:a,rel:l,icon:e,iconPlacement:o="start",...h},g)=>{let A=f(l),c={className:d(a),ref:g,rel:A,...h};if(r){let i=b.only(s);x(C(i),"When using `asChild`, Anchor must be passed a single child as a JSX tag.");let R=i.props?.children;return t(y,{...c,children:v(i,{},p(T,{children:[e&&o==="start"&&t(n,{className:"inline-block mr-1.5",svg:e}),R,e&&o==="end"&&t(n,{className:"inline-block ml-1.5",svg:e})]}))})}return p("a",{...c,children:[e&&o==="start"&&t(n,{className:"inline-block mr-1.5",svg:e}),s,e&&o==="end"&&t(n,{className:"inline-block ml-1.5",svg:e})]})});u.displayName="Anchor";function f(r){return Array.isArray(r)?[...new Set(r)].map(l=>l?.trim()).filter(Boolean).sort().join(" ")||void 0:r?.trim()||void 0}export{u as Anchor,d as anchorClassNames,f as resolveRel};
|
|
2
2
|
//# sourceMappingURL=anchor.js.map
|
package/dist/button.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as c}from"./chunk-7XIZZ4HQ.js";import{a as b}from"./chunk-
|
|
1
|
+
import{a as c}from"./chunk-7XIZZ4HQ.js";import{a as b}from"./chunk-BK4P33ZH.js";import{b as a}from"./chunk-VTCWSFFJ.js";import"./chunk-4LSFAAZW.js";import"./chunk-3C5O3AQA.js";import"./chunk-72TJUKMV.js";import"./chunk-XQVVOOLT.js";import"./chunk-HDPLH5HC.js";import"./chunk-AZ56JGNY.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}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-VTCWSFFJ.js";import"./chunk-4LSFAAZW.js";import"./chunk-3C5O3AQA.js";import"./chunk-72TJUKMV.js";import{a as r}from"./chunk-XQVVOOLT.js";import"./chunk-HDPLH5HC.js";import{a as e}from"./chunk-AZ56JGNY.js";import{CaretLeftIcon as m}from"@phosphor-icons/react/CaretLeft";import{CaretRightIcon as p}from"@phosphor-icons/react/CaretRight";import{DayPicker as f}from"react-day-picker";import{jsx as t}from"react/jsx-runtime";function n({className:d,classNames:i,showOutsideDays:l=!1,...o}){return t(f,{animate:!1,components:{Chevron:s=>{let c=s.orientation==="left"?t(m,{}):t(p,{});return t(r,{svg:c,className:"size-4"})}},classNames:{root:e("isolate",d),button_next:e(a({appearance:"ghost",priority:"neutral"}),"size-7 absolute right-0"),button_previous:e(a({appearance:"ghost",priority:"neutral"}),"size-7 absolute left-0"),caption_label:"text-sm font-medium",day:e("overflow-hidden text-center text-sm p-0 relative focus-within:relative focus-within:z-20 size-7 rounded-md",o.mode==="range"?"first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":""),day_button:"day size-full rounded-md [&:not([aria-selected],[disabled])]:hover:bg-filled-accent/15",disabled:"text-muted opacity-50",hidden:"invisible",month:"space-y-4",month_caption:"flex justify-center pt-1 relative items-center",month_grid:"w-full border-collapse space-y-1",months:"flex flex-col sm:flex-row gap-y-4 sm:gap-x-4 sm:gap-y-0 relative max-w-min",nav:"flex items-center absolute inset-x-0 top-1 h-5 justify-between z-10",outside:"day-outside aria-selected:text-on-filled opacity-50 text-muted",range_end:"day-range-end [&:not(.day-range-start)]:rounded-l-none",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",range_start:"day-range-start [&:not(.day-range-end)]:rounded-r-none",selected:"[&:not([disabled])]:bg-filled-accent text-on-filled [&:not([disabled])]:hover:bg-filled-accent",today:"[&:not([aria-selected],_[disabled])]:text-accent-600 font-medium [&:not([aria-selected],_[disabled])]:bg-filled-accent/10 rounded-md",week:"flex w-full mt-1",weekday:"text-body w-7 text-[0.8rem] text-center font-normal",weekdays:"flex",...i},showOutsideDays:l,...o})}n.displayName="Calendar";export{n as Calendar};
|
|
2
2
|
//# sourceMappingURL=calendar.js.map
|
package/dist/calendar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/calendar/calendar.tsx"],"sourcesContent":["\"use client\";\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../src/components/calendar/calendar.tsx"],"sourcesContent":["\"use client\";\n\nimport { CaretLeftIcon } from \"@phosphor-icons/react/CaretLeft\";\nimport { CaretRightIcon } from \"@phosphor-icons/react/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\";\nimport { Icon } from \"../icon/icon.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({\n\tclassName,\n\tclassNames,\n\tshowOutsideDays = false,\n\t...props\n}: CalendarProps) {\n\treturn (\n\t\t<DayPicker\n\t\t\tanimate={false}\n\t\t\tcomponents={{\n\t\t\t\tChevron: (iconProps) => {\n\t\t\t\t\tconst icon =\n\t\t\t\t\t\ticonProps.orientation === \"left\" ? (\n\t\t\t\t\t\t\t<CaretLeftIcon />\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<CaretRightIcon />\n\t\t\t\t\t\t);\n\n\t\t\t\t\treturn <Icon svg={icon} className=\"size-4\" />;\n\t\t\t\t},\n\t\t\t}}\n\t\t\tclassNames={{\n\t\t\t\troot: cx(\"isolate\", className),\n\t\t\t\tbutton_next: cx(\n\t\t\t\t\tbuttonVariants({ appearance: \"ghost\", priority: \"neutral\" }),\n\t\t\t\t\t\"size-7 absolute right-0\",\n\t\t\t\t),\n\t\t\t\tbutton_previous: cx(\n\t\t\t\t\tbuttonVariants({ appearance: \"ghost\", priority: \"neutral\" }),\n\t\t\t\t\t\"size-7 absolute left-0\",\n\t\t\t\t),\n\t\t\t\tcaption_label: \"text-sm font-medium\",\n\t\t\t\tday: cx(\n\t\t\t\t\t\"overflow-hidden text-center text-sm p-0 relative focus-within:relative focus-within:z-20 size-7 rounded-md\",\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_button:\n\t\t\t\t\t\"day size-full rounded-md [&:not([aria-selected],[disabled])]:hover:bg-filled-accent/15\",\n\t\t\t\tdisabled: \"text-muted opacity-50\",\n\t\t\t\thidden: \"invisible\",\n\t\t\t\tmonth: \"space-y-4\",\n\t\t\t\tmonth_caption: \"flex justify-center pt-1 relative items-center\",\n\t\t\t\tmonth_grid: \"w-full border-collapse space-y-1\",\n\t\t\t\tmonths:\n\t\t\t\t\t\"flex flex-col sm:flex-row gap-y-4 sm:gap-x-4 sm:gap-y-0 relative max-w-min\",\n\t\t\t\tnav: \"flex items-center absolute inset-x-0 top-1 h-5 justify-between z-10\",\n\t\t\t\toutside:\n\t\t\t\t\t\"day-outside aria-selected:text-on-filled opacity-50 text-muted\",\n\t\t\t\trange_end: \"day-range-end [&:not(.day-range-start)]:rounded-l-none\",\n\t\t\t\trange_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\trange_start: \"day-range-start [&:not(.day-range-end)]:rounded-r-none\",\n\t\t\t\tselected:\n\t\t\t\t\t\"[&:not([disabled])]:bg-filled-accent text-on-filled [&:not([disabled])]:hover:bg-filled-accent\",\n\t\t\t\ttoday:\n\t\t\t\t\t\"[&:not([aria-selected],_[disabled])]:text-accent-600 font-medium [&:not([aria-selected],_[disabled])]:bg-filled-accent/10 rounded-md\",\n\t\t\t\tweek: \"flex w-full mt-1\",\n\t\t\t\tweekday: \"text-body w-7 text-[0.8rem] text-center font-normal\",\n\t\t\t\tweekdays: \"flex\",\n\t\t\t\t...classNames,\n\t\t\t}}\n\t\t\tshowOutsideDays={showOutsideDays}\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\nexport type {\n\t//,\n\tDateRange,\n} from \"react-day-picker\";\n"],"mappings":"mOAEA,OAAS,iBAAAA,MAAqB,kCAC9B,OAAS,kBAAAC,MAAsB,mCAE/B,OAAS,aAAAC,MAAiB,mBA4BnB,cAAAC,MAAA,oBAbP,SAASC,EAAS,CACjB,UAAAC,EACA,WAAAC,EACA,gBAAAC,EAAkB,GAClB,GAAGC,CACJ,EAAkB,CACjB,OACCL,EAACM,EAAA,CACA,QAAS,GACT,WAAY,CACX,QAAUC,GAAc,CACvB,IAAMC,EACLD,EAAU,cAAgB,OACzBP,EAACS,EAAA,EAAc,EAEfT,EAACU,EAAA,EAAe,EAGlB,OAAOV,EAACW,EAAA,CAAK,IAAKH,EAAM,UAAU,SAAS,CAC5C,CACD,EACA,WAAY,CACX,KAAMI,EAAG,UAAWV,CAAS,EAC7B,YAAaU,EACZC,EAAe,CAAE,WAAY,QAAS,SAAU,SAAU,CAAC,EAC3D,yBACD,EACA,gBAAiBD,EAChBC,EAAe,CAAE,WAAY,QAAS,SAAU,SAAU,CAAC,EAC3D,wBACD,EACA,cAAe,sBACf,IAAKD,EACJ,6GACAP,EAAM,OAAS,QACZ,yFACA,EACJ,EACA,WACC,yFACD,SAAU,wBACV,OAAQ,YACR,MAAO,YACP,cAAe,iDACf,WAAY,mCACZ,OACC,6EACD,IAAK,sEACL,QACC,iEACD,UAAW,yDACX,aACC,4KACD,YAAa,yDACb,SACC,iGACD,MACC,uIACD,KAAM,mBACN,QAAS,sDACT,SAAU,OACV,GAAGF,CACJ,EACA,gBAAiBC,EAChB,GAAGC,EACL,CAEF,CACAJ,EAAS,YAAc","names":["CaretLeftIcon","CaretRightIcon","DayPicker","jsx","Calendar","className","classNames","showOutsideDays","props","DayPicker","iconProps","icon","CaretLeftIcon","CaretRightIcon","Icon","cx","buttonVariants"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{m as r}from"./chunk-GYPSB3OK.js";import{SortAscendingIcon as o}from"@phosphor-icons/react/SortAscending";import{SortDescendingIcon as n}from"@phosphor-icons/react/SortDescending";import{jsx as i}from"react/jsx-runtime";var s=({mode:c,direction:t,...e})=>{switch(c){case"alphanumeric":switch(t){case"asc":return i(o,{...e});case"desc":return i(n,{...e});default:throw new Error(`Invalid alphanumeric sorting direction given: "${t}"`)}case"time":switch(r(t)){case"oldest-to-newest":return i(n,{...e});case"newest-to-oldest":return i(o,{...e});default:throw new Error(`Invalid time sorting direction given: "${t}"`)}}};s.displayName="SortIcon";export{s as a};
|
|
2
|
+
//# sourceMappingURL=chunk-2PHWBRBD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/icons/sort.tsx"],"sourcesContent":["import { SortAscendingIcon } from \"@phosphor-icons/react/SortAscending\";\nimport { SortDescendingIcon } from \"@phosphor-icons/react/SortDescending\";\nimport {\n\t$timeSortingDirection,\n\ttype AlphanumericSortingDirection,\n\ttype SortingDirection,\n\ttype SortingMode,\n\ttype TimeSortingDirection,\n} from \"../../utils/sorting/direction.js\";\nimport type { SvgAttributes } from \"../icon/types.js\";\n\ntype Props = SvgAttributes &\n\t(\n\t\t| {\n\t\t\t\tmode: Extract<SortingMode, \"alphanumeric\">;\n\t\t\t\t/**\n\t\t\t\t * Sort by alphanumeric order in \"ascending\" (asc) or \"descending\" (desc) order.\n\t\t\t\t * @example \"asc\" for A-Z, 0-9\n\t\t\t\t * @example \"desc\" for Z-A, 0-9\n\t\t\t\t */\n\t\t\t\tdirection: AlphanumericSortingDirection;\n\t\t }\n\t\t| {\n\t\t\t\tmode: Extract<SortingMode, \"time\">;\n\t\t\t\t/**\n\t\t\t\t * Sort by time in \"newest-to-oldest\" (descending, desc) or \"oldest-to-newest\" (ascending, asc) order.\n\t\t\t\t * @example \"newest-to-oldest\" for newest first (aka descending, desc)\n\t\t\t\t * @example \"oldest-to-newest\" for oldest first (aka ascending, asc)\n\t\t\t\t */\n\t\t\t\tdirection: TimeSortingDirection | SortingDirection;\n\t\t }\n\t);\n\n/**\n * A sorting icon that can be used to indicate the sorting direction of a table column or list.\n * It is aware of the sorting mode (alphanumeric or time) and the sorting direction (ascending or descending).\n */\nconst SortIcon = ({ mode, direction, ...props }: Props) => {\n\tswitch (mode) {\n\t\tcase \"alphanumeric\": {\n\t\t\tswitch (direction) {\n\t\t\t\tcase \"asc\":\n\t\t\t\t\treturn <SortAscendingIcon {...props} />;\n\t\t\t\tcase \"desc\":\n\t\t\t\t\treturn <SortDescendingIcon {...props} />;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Invalid alphanumeric sorting direction given: \"${direction}\"`,\n\t\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tcase \"time\": {\n\t\t\tconst timeSortingDirection = $timeSortingDirection(direction);\n\n\t\t\tswitch (timeSortingDirection) {\n\t\t\t\tcase \"oldest-to-newest\":\n\t\t\t\t\treturn <SortDescendingIcon {...props} />;\n\t\t\t\tcase \"newest-to-oldest\":\n\t\t\t\t\treturn <SortAscendingIcon {...props} />;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Invalid time sorting direction given: \"${direction}\"`,\n\t\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n};\nSortIcon.displayName = \"SortIcon\";\n\nexport {\n\t//,\n\tSortIcon,\n};\n"],"mappings":"wCAAA,OAAS,qBAAAA,MAAyB,sCAClC,OAAS,sBAAAC,MAA0B,uCAyCvB,cAAAC,MAAA,oBALZ,IAAMC,EAAW,CAAC,CAAE,KAAAC,EAAM,UAAAC,EAAW,GAAGC,CAAM,IAAa,CAC1D,OAAQF,EAAM,CACb,IAAK,eACJ,OAAQC,EAAW,CAClB,IAAK,MACJ,OAAOH,EAACK,EAAA,CAAmB,GAAGD,EAAO,EACtC,IAAK,OACJ,OAAOJ,EAACM,EAAA,CAAoB,GAAGF,EAAO,EACvC,QACC,MAAM,IAAI,MACT,kDAAkDD,CAAS,GAC5D,CACF,CAED,IAAK,OAGJ,OAF6BI,EAAsBJ,CAAS,EAE9B,CAC7B,IAAK,mBACJ,OAAOH,EAACM,EAAA,CAAoB,GAAGF,EAAO,EACvC,IAAK,mBACJ,OAAOJ,EAACK,EAAA,CAAmB,GAAGD,EAAO,EACtC,QACC,MAAM,IAAI,MACT,0CAA0CD,CAAS,GACpD,CACF,CAEF,CACD,EACAF,EAAS,YAAc","names":["SortAscendingIcon","SortDescendingIcon","jsx","SortIcon","mode","direction","props","SortAscendingIcon","SortDescendingIcon","$timeSortingDirection"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{l as P}from"./chunk-XN5RN6JW.js";import{a as p}from"./chunk-XQVVOOLT.js";import{a as s}from"./chunk-AZ56JGNY.js";import{CheckCircleIcon as v}from"@phosphor-icons/react/CheckCircle";import{InfoIcon as h}from"@phosphor-icons/react/Info";import{WarningIcon as C}from"@phosphor-icons/react/Warning";import{WarningDiamondIcon as b}from"@phosphor-icons/react/WarningDiamond";import{Slot as u}from"@radix-ui/react-slot";import{createContext as y,forwardRef as d,useContext as f}from"react";import*as c from"sonner";import{jsx as r,jsxs as A}from"react/jsx-runtime";var B=({className:t,containerAriaLabel:o,dir:e,duration_ms:n=4e3,position:i="top-center",style:a})=>{let m=P();return r(c.Toaster,{className:s("toaster overlay-prompt pointer-events-auto font-sans *:duration-200",t),containerAriaLabel:o,dir:e,duration:n,gap:12,position:i??"top-center",style:a,theme:m,toastOptions:{unstyled:!0}})},g=y("");function _(t,o){return c.toast.custom(e=>r(g.Provider,{value:e,children:t}),{duration:o?.duration_ms,...o?.id?{id:o.id}:{},unstyled:!0})}var T=y({priority:"info"}),j=d(({asChild:t,children:o,className:e,priority:n,...i},a)=>{let m=t?u:"div";return r(T.Provider,{value:{priority:n},children:A(m,{className:s("relative flex items-start gap-2 text-sm","p-3 pl-[0.9375rem]","bg-popover high-contrast:border-popover rounded rounded-r-[0.3125rem] border border-gray-500/35 shadow-lg",e),ref:a,...i,children:[r(w,{priority:n}),o]})})}),D=d(({className:t,svg:o,...e},n)=>{let i=f(T);switch(i.priority){case"danger":return r(p,{className:s("text-danger-600",t),ref:n,svg:o??r(C,{weight:"fill"}),...e});case"warning":return r(p,{className:s("text-warning-600",t),ref:n,svg:o??r(b,{weight:"fill"}),...e});case"success":return r(p,{className:s("text-success-600",t),ref:n,svg:o??r(v,{weight:"fill"}),...e});case"info":return r(p,{className:s("text-accent-600",t),ref:n,svg:r(h,{weight:"fill"}),...e});default:throw new Error(`Unreachable Case: ${i.priority}`)}}),L=d(({asChild:t,className:o,onClick:e,...n},i)=>{let a=f(g);return r(t?u:"button",{className:s("shrink-0","data-[icon-button]:-mr-0.5 data-[icon-button]:-mt-0.5 data-[icon-button]:rounded-sm",o),onClick:l=>{e?.(l),!l.defaultPrevented&&c.toast.dismiss(a)},ref:i,...n})}),z=d(({asChild:t,className:o,...e},n)=>r(t?u:"p",{className:s("text-strong flex-1 text-sm",o),ref:n,...e}));function F(t){t.target instanceof Element&&t.target.closest(".overlay-prompt")&&t.preventDefault()}var x={info:"bg-accent-600",warning:"bg-warning-600",success:"bg-success-600",danger:"bg-danger-600"};function w({className:t,priority:o,...e}){return r("div",{"aria-hidden":!0,className:s("z-1 absolute -inset-px right-auto w-1.5 rounded-l",x[o],t),...e})}export{B as a,_ as b,j as c,D as d,L as e,z as f,F as g};
|
|
2
|
+
//# sourceMappingURL=chunk-3DXMGSDU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/toast/toast.tsx"],"sourcesContent":["\"use client\";\n\nimport { CheckCircleIcon } from \"@phosphor-icons/react/CheckCircle\";\nimport { InfoIcon } from \"@phosphor-icons/react/Info\";\nimport { WarningIcon } from \"@phosphor-icons/react/Warning\";\nimport { WarningDiamondIcon } from \"@phosphor-icons/react/WarningDiamond\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport {\n\ttype ComponentProps,\n\ttype ComponentRef,\n\ttype ReactNode,\n\tcreateContext,\n\tforwardRef,\n\tuseContext,\n} from \"react\";\nimport * as ToastPrimitive from \"sonner\";\nimport type { WithAsChild } from \"../../types/as-child.js\";\nimport type { WithStyleProps } from \"../../types/with-style-props.js\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport { Icon } from \"../icon/icon.js\";\nimport type { SvgOnlyProps } from \"../icon/svg-only.js\";\nimport { useAppliedTheme } from \"../theme-provider/theme-provider.js\";\n\ntype ToasterPrimitiveProps = ComponentProps<typeof ToastPrimitive.Toaster>;\ntype ToasterPrimitiveTheme = ToasterPrimitiveProps[\"theme\"];\n\ntype ToasterProps = WithStyleProps &\n\tPick<ToasterPrimitiveProps, \"containerAriaLabel\" | \"dir\" | \"position\"> & {\n\t\t/**\n\t\t * Time in milliseconds that should elapse before automatically dismissing toasts.\n\t\t * When set here, this will be the default duration for all toasts.\n\t\t * @default 4000\n\t\t */\n\t\tduration_ms?: number;\n\t};\n\n/**\n * A container for displaying all toasts.\n *\n * Only one `<Toaster />` should be rendered in an app a time, preferably at the\n * root level of the app.\n */\nconst Toaster = ({\n\t//,\n\tclassName,\n\tcontainerAriaLabel,\n\tdir,\n\tduration_ms = 4000,\n\tposition = \"top-center\",\n\tstyle,\n}: ToasterProps) => {\n\tconst theme = useAppliedTheme();\n\n\treturn (\n\t\t<ToastPrimitive.Toaster\n\t\t\tclassName={cx(\n\t\t\t\t\"toaster overlay-prompt pointer-events-auto font-sans *:duration-200\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tcontainerAriaLabel={containerAriaLabel}\n\t\t\tdir={dir}\n\t\t\tduration={duration_ms}\n\t\t\tgap={12}\n\t\t\tposition={position ?? \"top-center\"}\n\t\t\tstyle={style}\n\t\t\ttheme={theme as ToasterPrimitiveTheme} // we have additional themes that are not in the sonner types, so we need to cast for now\n\t\t\ttoastOptions={{\n\t\t\t\tunstyled: true,\n\t\t\t}}\n\t\t/>\n\t);\n};\n\nconst ToastIdContext = createContext<string | number>(\"\");\n\ntype MakeToastOptions = {\n\t/**\n\t * Time in milliseconds that should elapse before automatically closing the toast.\n\t * Will default to the `<Toaster />`'s `duration_ms` if not provided.\n\t */\n\tduration_ms?: number;\n\t/**\n\t * An optional custom ID for this toast. If not given, a unique ID is provided for you.\n\t */\n\tid?: string;\n};\n\n/**\n * Create a toast. Provide a `<Toast>` component as the `children` to be rendered\n * inside the `<Toaster />` section.\n */\nfunction makeToast(children: ReactNode, options?: MakeToastOptions) {\n\treturn ToastPrimitive.toast.custom(\n\t\t(toastId) => (\n\t\t\t<ToastIdContext.Provider value={toastId}>\n\t\t\t\t{children}\n\t\t\t</ToastIdContext.Provider>\n\t\t),\n\t\t{\n\t\t\t//\n\t\t\tduration: options?.duration_ms,\n\t\t\t// If a custom ID is provided, use it, else use the toastId provided by the sonner library\n\t\t\t// don't set an ID to `undefined` as it breaks the sonner library\n\t\t\t...(options?.id ? { id: options.id } : {}),\n\t\t\tunstyled: true,\n\t\t},\n\t);\n}\n\nconst priorities = [\n\t//,\n\t\"danger\",\n\t\"info\",\n\t\"success\",\n\t\"warning\",\n] as const;\ntype Priority = (typeof priorities)[number];\n\ntype ToastState = {\n\tpriority: Priority;\n};\n\nconst ToastStateContext = createContext<ToastState>({\n\tpriority: \"info\",\n});\n\ntype ToastProps = ComponentProps<\"div\"> &\n\tWithAsChild & {\n\t\tpriority: Priority;\n\t};\n\n/**\n * A succinct message with a priority that is displayed temporarily.\n * Toasts are used to provide feedback to the user without interrupting their workflow.\n */\nconst Toast = forwardRef<ComponentRef<\"div\">, ToastProps>(\n\t({ asChild, children, className, priority, ...props }, ref) => {\n\t\tconst Component = asChild ? Slot : \"div\";\n\n\t\treturn (\n\t\t\t<ToastStateContext.Provider value={{ priority }}>\n\t\t\t\t<Component\n\t\t\t\t\tclassName={cx(\n\t\t\t\t\t\t\"relative flex items-start gap-2 text-sm\",\n\t\t\t\t\t\t\"p-3 pl-[0.9375rem]\",\n\t\t\t\t\t\t\"bg-popover high-contrast:border-popover rounded rounded-r-[0.3125rem] border border-gray-500/35 shadow-lg\",\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Do not apply overflow-hidden because we want the priority bar accent\n\t\t\t\t\t\t * to overlap the toast border, else the border flows over the\n\t\t\t\t\t\t * priority bar.\n\t\t\t\t\t\t */\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<PriorityBarAccent priority={priority} />\n\t\t\t\t\t{children}\n\t\t\t\t</Component>\n\t\t\t</ToastStateContext.Provider>\n\t\t);\n\t},\n);\n\ntype ToastIconProps = Partial<SvgOnlyProps>;\n\n/**\n * An icon that visually represents the priority of the toast.\n * If you do not provide an icon, the default icon and color for the priority is used.\n */\nconst ToastIcon = forwardRef<ComponentRef<\"svg\">, ToastIconProps>(\n\t({ className, svg, ...props }, ref) => {\n\t\tconst ctx = useContext(ToastStateContext);\n\n\t\tswitch (ctx.priority) {\n\t\t\tcase \"danger\":\n\t\t\t\treturn (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tclassName={cx(\"text-danger-600\", className)}\n\t\t\t\t\t\tref={ref}\n\t\t\t\t\t\tsvg={svg ?? <WarningIcon weight=\"fill\" />}\n\t\t\t\t\t\t{...props}\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\tcase \"warning\":\n\t\t\t\treturn (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tclassName={cx(\"text-warning-600\", className)}\n\t\t\t\t\t\tref={ref}\n\t\t\t\t\t\tsvg={svg ?? <WarningDiamondIcon weight=\"fill\" />}\n\t\t\t\t\t\t{...props}\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\tcase \"success\":\n\t\t\t\treturn (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tclassName={cx(\"text-success-600\", className)}\n\t\t\t\t\t\tref={ref}\n\t\t\t\t\t\tsvg={svg ?? <CheckCircleIcon weight=\"fill\" />}\n\t\t\t\t\t\t{...props}\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\tcase \"info\":\n\t\t\t\treturn (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\t//\n\t\t\t\t\t\tclassName={cx(\"text-accent-600\", className)}\n\t\t\t\t\t\tref={ref}\n\t\t\t\t\t\tsvg={<InfoIcon weight=\"fill\" />}\n\t\t\t\t\t\t{...props}\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`Unreachable Case: ${ctx.priority}`);\n\t\t}\n\t},\n);\n\ntype ToastActionProps = ComponentProps<\"button\"> & WithAsChild;\n\n/**\n * A button that dismisses the toast when clicked.\n * You can prevent the toast from being dismissed `onClick` by calling `event.preventDefault()`\n */\nconst ToastAction = forwardRef<ComponentRef<\"button\">, ToastActionProps>(\n\t({ asChild, className, onClick, ...props }, ref) => {\n\t\tconst ctx = useContext(ToastIdContext);\n\n\t\tconst Component = asChild ? Slot : \"button\";\n\n\t\treturn (\n\t\t\t<Component\n\t\t\t\tclassName={cx(\n\t\t\t\t\t//,\n\t\t\t\t\t\"shrink-0\",\n\t\t\t\t\t// 👇 wiggle the bits so that icon buttons toast actions are aligned with the toast icon\n\t\t\t\t\t\"data-[icon-button]:-mr-0.5 data-[icon-button]:-mt-0.5 data-[icon-button]:rounded-sm\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tonClick={(event) => {\n\t\t\t\t\tonClick?.(event);\n\t\t\t\t\tif (event.defaultPrevented) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tToastPrimitive.toast.dismiss(ctx);\n\t\t\t\t}}\n\t\t\t\tref={ref}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t},\n);\n\ntype ToastMessageProps = ComponentProps<\"p\"> & WithAsChild;\n\n/**\n * The message content of the toast.\n */\nconst ToastMessage = forwardRef<ComponentRef<\"p\">, ToastMessageProps>(\n\t({ asChild, className, ...props }, ref) => {\n\t\tconst Component = asChild ? Slot : \"p\";\n\n\t\treturn (\n\t\t\t<Component\n\t\t\t\t//\n\t\t\t\tclassName={cx(\"text-strong flex-1 text-sm\", className)}\n\t\t\t\tref={ref}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t},\n);\n\nexport {\n\t//,\n\tmakeToast,\n\tToast,\n\tToastAction,\n\tToaster,\n\tToastIcon,\n\tToastMessage,\n};\n\nexport type {\n\t//,\n\tPriority,\n};\n\n/**\n * @private\n *\n * Allows any mantle floating prompt (e.g. toasts and notifications) to be interacted with\n * even when a modaled view (e.g. dialog, sheet, etc) is open and a focus trap is active.\n *\n * Without this, interacting with the prompt would close the modaled view.\n */\nexport function preventCloseOnPromptInteraction(\n\tevent: CustomEvent | PointerEvent | MouseEvent | TouchEvent | FocusEvent,\n) {\n\tif (!(event.target instanceof Element)) {\n\t\treturn;\n\t}\n\n\tif (event.target.closest(\".overlay-prompt\")) {\n\t\tevent.preventDefault();\n\t}\n}\n\nconst priorityBackgroundColor = {\n\tinfo: \"bg-accent-600\",\n\twarning: \"bg-warning-600\",\n\tsuccess: \"bg-success-600\",\n\tdanger: \"bg-danger-600\",\n} as const satisfies Record<Priority, string>;\n\ntype PriorityBarAccentProps = Omit<ComponentProps<\"div\">, \"children\"> & {\n\tpriority: Priority;\n};\n\n/**\n * @private\n *\n * A colored bar that visually represents the priority of the toast.\n */\nfunction PriorityBarAccent({\n\tclassName,\n\tpriority,\n\t...props\n}: PriorityBarAccentProps) {\n\treturn (\n\t\t<div\n\t\t\taria-hidden\n\t\t\tclassName={cx(\n\t\t\t\t//\n\t\t\t\t\"z-1 absolute -inset-px right-auto w-1.5 rounded-l\",\n\t\t\t\tpriorityBackgroundColor[priority],\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n"],"mappings":"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","names":["CheckCircleIcon","InfoIcon","WarningIcon","WarningDiamondIcon","Slot","createContext","forwardRef","useContext","ToastPrimitive","jsx","jsxs","Toaster","className","containerAriaLabel","dir","duration_ms","position","style","theme","useAppliedTheme","cx","ToastIdContext","createContext","makeToast","children","options","toastId","ToastStateContext","createContext","Toast","forwardRef","asChild","children","className","priority","props","ref","Component","Slot","jsx","jsxs","cx","PriorityBarAccent","ToastIcon","svg","ctx","useContext","Icon","WarningIcon","WarningDiamondIcon","CheckCircleIcon","InfoIcon","ToastAction","onClick","ToastIdContext","event","ToastMessage","preventCloseOnPromptInteraction","event","priorityBackgroundColor","PriorityBarAccent","className","priority","props","jsx","cx"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{jsx as c,jsxs as t}from"react/jsx-runtime";function s(h){return t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...h,children:[c("path",{fill:"none",d:"M0 0h256v256H0z"}),c("path",{d:"m213.7 82.3-56-56c-1.5-1.5-3.5-2.3-5.7-2.3H56c-8.8 0-16 7.2-16 16v88c0 4.4 3.6 8 8 8s8-3.6 8-8V40h88v48c0 4.4 3.6 8 8 8h48v120h-40c-4.4 0-8 3.6-8 8s3.6 8 8 8h40c8.8 0 16-7.2 16-16V88c0-2.1-.8-4.2-2.3-5.7zm-53.7-31L188.7 80H160V51.3z"}),c("path",{d:"M124.6 194.5h-6.8v-27.3h6.8c1.9 0 3.4-1.5 3.4-3.4s-1.5-3.4-3.4-3.4h-6.8v-10.2c0-3.8-3.1-6.8-6.8-6.8H63.3c-3.8 0-6.8 3.1-6.8 6.8v10.2h-6.8c-1.9 0-3.4 1.5-3.4 3.4s1.5 3.4 3.4 3.4h6.8v27.3h-6.8c-1.9 0-3.4 1.5-3.4 3.4s1.5 3.4 3.4 3.4h6.8v23.9c0 3.8 3.1 6.8 6.8 6.8H111c3.8 0 6.8-3.1 6.8-6.8v-23.9h6.8c1.9 0 3.4-1.5 3.4-3.4s-1.5-3.4-3.4-3.4zm-37.5-11.9c-6.6 0-11.9-5.3-11.9-11.9s5.3-11.9 11.9-11.9S99 164.1 99 170.7s-5.3 11.9-11.9 11.9zm0 10.2c6.6 0 11.9 5.3 11.9 11.9s-5.3 11.9-11.9 11.9-11.9-5.3-11.9-11.9 5.3-11.9 11.9-11.9z"})]})}export{s as a};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
//# sourceMappingURL=chunk-3MDQ3LC2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/icons/traffic-policy-file.tsx"],"sourcesContent":["import type { SvgAttributes } from \"../icon/types.js\";\n\n/**\n * An icon representing a traffic policy file.\n */\nfunction TrafficPolicyFileIcon(props: SvgAttributes) {\n\treturn (\n\t\t<svg\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\twidth=\"1em\"\n\t\t\theight=\"1em\"\n\t\t\tfill=\"currentColor\"\n\t\t\tviewBox=\"0 0 256 256\"\n\t\t\t{...props}\n\t\t>\n\t\t\t<path fill=\"none\" d=\"M0 0h256v256H0z\" />\n\t\t\t<path d=\"m213.7 82.3-56-56c-1.5-1.5-3.5-2.3-5.7-2.3H56c-8.8 0-16 7.2-16 16v88c0 4.4 3.6 8 8 8s8-3.6 8-8V40h88v48c0 4.4 3.6 8 8 8h48v120h-40c-4.4 0-8 3.6-8 8s3.6 8 8 8h40c8.8 0 16-7.2 16-16V88c0-2.1-.8-4.2-2.3-5.7zm-53.7-31L188.7 80H160V51.3z\" />\n\t\t\t<path d=\"M124.6 194.5h-6.8v-27.3h6.8c1.9 0 3.4-1.5 3.4-3.4s-1.5-3.4-3.4-3.4h-6.8v-10.2c0-3.8-3.1-6.8-6.8-6.8H63.3c-3.8 0-6.8 3.1-6.8 6.8v10.2h-6.8c-1.9 0-3.4 1.5-3.4 3.4s1.5 3.4 3.4 3.4h6.8v27.3h-6.8c-1.9 0-3.4 1.5-3.4 3.4s1.5 3.4 3.4 3.4h6.8v23.9c0 3.8 3.1 6.8 6.8 6.8H111c3.8 0 6.8-3.1 6.8-6.8v-23.9h6.8c1.9 0 3.4-1.5 3.4-3.4s-1.5-3.4-3.4-3.4zm-37.5-11.9c-6.6 0-11.9-5.3-11.9-11.9s5.3-11.9 11.9-11.9S99 164.1 99 170.7s-5.3 11.9-11.9 11.9zm0 10.2c6.6 0 11.9 5.3 11.9 11.9s-5.3 11.9-11.9 11.9-11.9-5.3-11.9-11.9 5.3-11.9 11.9-11.9z\" />\n\t\t</svg>\n\t);\n}\n\nexport {\n\t//,\n\tTrafficPolicyFileIcon,\n};\n"],"mappings":"AAOE,OAQC,OAAAA,EARD,QAAAC,MAAA,oBAFF,SAASC,EAAsBC,EAAsB,CACpD,OACCF,EAAC,OACA,MAAM,6BACN,MAAM,MACN,OAAO,MACP,KAAK,eACL,QAAQ,cACP,GAAGE,EAEJ,UAAAH,EAAC,QAAK,KAAK,OAAO,EAAE,kBAAkB,EACtCA,EAAC,QAAK,EAAE,2OAA2O,EACnPA,EAAC,QAAK,EAAE,6gBAA6gB,GACthB,CAEF","names":["jsx","jsxs","TrafficPolicyFileIcon","props"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as l}from"./chunk-3C5O3AQA.js";import{a as o}from"./chunk-XQVVOOLT.js";import{a as d}from"./chunk-AZ56JGNY.js";import{CircleNotchIcon as I}from"@phosphor-icons/react/CircleNotch";import{Slot as V}from"@radix-ui/react-slot";import{cva as C}from"class-variance-authority";import{Children as H,cloneElement as M,forwardRef as T,isValidElement as E}from"react";import{jsx as t,jsxs as L}from"react/jsx-runtime";var N=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-6",sm:"size-7",md:"size-9"}},defaultVariants:{appearance:"outlined",size:"md"}}),A=T(({"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 r=l(c??f??e),i=e?t(I,{className:"animate-spin"}):v,s={"aria-disabled":r,"data-icon-button":!0,"data-loading":e,"data-size":n,className:d("icon-button",N({appearance:u,isLoading:e,size:n}),m),disabled:r,ref:B,...y};if(b){let a=H.only(p),x=E(a);return t(V,{...s,children:x&&M(a,{},t(o,{svg:i}))})}return L("button",{...s,type:g,children:[t("span",{className:"sr-only",children:h}),t(o,{svg:i})]})});A.displayName="IconButton";export{A as a};
|
|
2
|
+
//# sourceMappingURL=chunk-BK4P33ZH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/button/icon-button.tsx"],"sourcesContent":["import { CircleNotchIcon } from \"@phosphor-icons/react/CircleNotch\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva } from \"class-variance-authority\";\nimport { Children, cloneElement, forwardRef, isValidElement } from \"react\";\nimport type { ButtonHTMLAttributes, ReactNode } from \"react\";\nimport type { VariantProps, WithAsChild } from \"../../types/index.js\";\nimport { parseBooleanish } from \"../../types/index.js\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport { Icon } from \"../icon/index.js\";\n\nconst iconButtonVariants = cva(\n\t\"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\",\n\t{\n\t\tvariants: {\n\t\t\t/**\n\t\t\t * Defines the visual style of the Button.\n\t\t\t */\n\t\t\tappearance: {\n\t\t\t\tghost:\n\t\t\t\t\t\"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\",\n\t\t\t\toutlined:\n\t\t\t\t\t\"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\",\n\t\t\t},\n\t\t\t/**\n\t\t\t * Whether or not the button is in a loading state, default `false`. Setting `isLoading` will\n\t\t\t * replace the `icon` with a spinner.\n\t\t\t * It will also disable user interaction with the button and set `aria-disabled`.\n\t\t\t */\n\t\t\tisLoading: {\n\t\t\t\tfalse: \"\",\n\t\t\t\ttrue: \"opacity-50\",\n\t\t\t},\n\t\t\t/**\n\t\t\t * The size of the IconButton.\n\t\t\t */\n\t\t\tsize: {\n\t\t\t\txs: \"size-6\",\n\t\t\t\tsm: \"size-7\",\n\t\t\t\tmd: \"size-9\",\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tappearance: \"outlined\",\n\t\t\tsize: \"md\",\n\t\t},\n\t},\n);\n\ntype IconButtonVariants = VariantProps<typeof iconButtonVariants>;\n\n/**\n * The props for the `Button` component.\n */\ntype IconButtonProps = ButtonHTMLAttributes<HTMLButtonElement> &\n\tWithAsChild &\n\tIconButtonVariants & {\n\t\t/**\n\t\t * The accessible label for the icon. This label will be visually hidden but announced to screen reader users, similar to alt text for img tags.\n\t\t */\n\t\tlabel: string;\n\t\t/**\n\t\t * An icon to render inside the button. If the `state` is `\"pending\"`, then\n\t\t * the icon will automatically be replaced with a spinner.\n\t\t */\n\t\ticon: ReactNode;\n\t} & (\n\t\t| {\n\t\t\t\t/**\n\t\t\t\t * Use the `asChild` prop to compose Radix's functionality onto alternative\n\t\t\t\t * element types or your own React components.\n\t\t\t\t *\n\t\t\t\t * When `asChild` is set to `true`, mantle will not render a default DOM\n\t\t\t\t * element, instead cloning the component's child and passing it the props and\n\t\t\t\t * behavior required to make it functional.\n\t\t\t\t *\n\t\t\t\t * asChild can be used as deeply as you need to. This means it is a great way\n\t\t\t\t * to compose multiple primitive's behavior together.\n\t\t\t\t *\n\t\t\t\t * @see https://www.radix-ui.com/docs/primitives/guides/composition#composition\n\t\t\t\t */\n\t\t\t\tasChild: true;\n\t\t\t\t/**\n\t\t\t\t * The default behavior of the button. Possible values are: `\"button\"`, `\"submit\"`, and `\"reset\"`.\n\t\t\t\t *\n\t\t\t\t * if `asChild` is NOT used: Unlike the native `<button>` element, this prop is required and has no default value.\n\t\t\t\t *\n\t\t\t\t * If `asChild` IS used: This prop HAS NO EFFECT, is REMOVED, and has no default value. This is because we do not want the `button` `type` to automatically merge with any child anchor `type` attribute because the `anchor` `type` is _strictly different_ than the `button` type, see: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#type\n\t\t\t\t *\n\t\t\t\t * @enum\n\t\t\t\t * - `\"button\"`: The button has no default behavior, and does nothing when pressed by default. It can have client-side scripts listen to the element's events, which are triggered when the events occur.\n\t\t\t\t * - `\"reset\"`: The button resets all the controls to their initial values.\n\t\t\t\t * - `\"submit\"`: The button submits the form data to the server.\n\t\t\t\t *\n\t\t\t\t * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#type\n\t\t\t\t */\n\t\t\t\ttype?: ButtonHTMLAttributes<HTMLButtonElement>[\"type\"];\n\t\t }\n\t\t| {\n\t\t\t\tasChild?: false | undefined;\n\t\t\t\t/**\n\t\t\t\t * The default behavior of the button. Possible values are: `\"button\"`, `\"submit\"`, and `\"reset\"`.\n\t\t\t\t *\n\t\t\t\t * if `asChild` is NOT used: Unlike the native `<button>` element, this prop is required and has no default value.\n\t\t\t\t *\n\t\t\t\t * If `asChild` IS used: This prop HAS NO EFFECT, is REMOVED, and has no default value. This is because we do not want the `button` `type` to automatically merge with any child anchor `type` attribute because the `anchor` `type` is _strictly different_ than the `button` type, see: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#type\n\t\t\t\t *\n\t\t\t\t * @enum\n\t\t\t\t * - `\"button\"`: The button has no default behavior, and does nothing when pressed by default. It can have client-side scripts listen to the element's events, which are triggered when the events occur.\n\t\t\t\t * - `\"reset\"`: The button resets all the controls to their initial values.\n\t\t\t\t * - `\"submit\"`: The button submits the form data to the server.\n\t\t\t\t *\n\t\t\t\t * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#type\n\t\t\t\t */\n\t\t\t\ttype: Exclude<\n\t\t\t\t\tButtonHTMLAttributes<HTMLButtonElement>[\"type\"],\n\t\t\t\t\tundefined\n\t\t\t\t>;\n\t\t }\n\t);\n\n/**\n * Renders a button or a component that looks like a button, an interactive\n * element activated by a user with a mouse, keyboard, finger, voice command, or\n * other assistive technology. Once activated, it then performs an action, such\n * as submitting a form or opening a dialog.\n * Renders only a single icon as children with an accessible, screen-reader-only label.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button\n */\nconst IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(\n\t(\n\t\t{\n\t\t\t\"aria-disabled\": _ariaDisabled,\n\t\t\tappearance,\n\t\t\tasChild = false,\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\tdisabled: _disabled,\n\t\t\ticon: propIcon,\n\t\t\tisLoading = false,\n\t\t\tlabel,\n\t\t\tsize,\n\t\t\ttype,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst disabled = parseBooleanish(_ariaDisabled ?? _disabled ?? isLoading);\n\t\tconst icon = isLoading ? (\n\t\t\t<CircleNotchIcon className=\"animate-spin\" />\n\t\t) : (\n\t\t\tpropIcon\n\t\t);\n\n\t\tconst buttonProps = {\n\t\t\t\"aria-disabled\": disabled,\n\t\t\t\"data-icon-button\": true,\n\t\t\t\"data-loading\": isLoading,\n\t\t\t\"data-size\": size,\n\t\t\tclassName: cx(\n\t\t\t\t\"icon-button\",\n\t\t\t\ticonButtonVariants({ appearance, isLoading, size }),\n\t\t\t\tclassName,\n\t\t\t),\n\t\t\tdisabled,\n\t\t\tref,\n\t\t\t...props,\n\t\t};\n\n\t\tif (asChild) {\n\t\t\tconst singleChild = Children.only(children);\n\t\t\tconst isValidChild = isValidElement(singleChild);\n\n\t\t\treturn (\n\t\t\t\t<Slot {...buttonProps}>\n\t\t\t\t\t{isValidChild && cloneElement(singleChild, {}, <Icon svg={icon} />)}\n\t\t\t\t</Slot>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<button {...buttonProps} type={type}>\n\t\t\t\t<span className=\"sr-only\">{label}</span>\n\t\t\t\t<Icon svg={icon} />\n\t\t\t</button>\n\t\t);\n\t},\n);\nIconButton.displayName = \"IconButton\";\n\nexport { IconButton, iconButtonVariants };\nexport type { IconButtonProps };\n"],"mappings":"wHAAA,OAAS,mBAAAA,MAAuB,oCAChC,OAAS,QAAAC,MAAY,uBACrB,OAAS,OAAAC,MAAW,2BACpB,OAAS,YAAAC,EAAU,gBAAAC,EAAc,cAAAC,EAAY,kBAAAC,MAAsB,QAkJhE,cAAAC,EAgCA,QAAAC,MAhCA,oBA3IH,IAAMC,EAAqBC,EAC1B,wNACA,CACC,SAAU,CAIT,WAAY,CACX,MACC,2MACD,SACC,wWACF,EAMA,UAAW,CACV,MAAO,GACP,KAAM,YACP,EAIA,KAAM,CACL,GAAI,SACJ,GAAI,SACJ,GAAI,QACL,CACD,EACA,gBAAiB,CAChB,WAAY,WACZ,KAAM,IACP,CACD,CACD,EAmFMC,EAAaC,EAClB,CACC,CACC,gBAAiBC,EACjB,WAAAC,EACA,QAAAC,EAAU,GACV,SAAAC,EACA,UAAAC,EACA,SAAUC,EACV,KAAMC,EACN,UAAAC,EAAY,GACZ,MAAAC,EACA,KAAAC,EACA,KAAAC,EACA,GAAGC,CACJ,EACAC,IACI,CACJ,IAAMC,EAAWC,EAAgBd,GAAiBK,GAAaE,CAAS,EAClEQ,EAAOR,EACZb,EAACsB,EAAA,CAAgB,UAAU,eAAe,EAE1CV,EAGKW,EAAc,CACnB,gBAAiBJ,EACjB,mBAAoB,GACpB,eAAgBN,EAChB,YAAaE,EACb,UAAWS,EACV,cACAtB,EAAmB,CAAE,WAAAK,EAAY,UAAAM,EAAW,KAAAE,CAAK,CAAC,EAClDL,CACD,EACA,SAAAS,EACA,IAAAD,EACA,GAAGD,CACJ,EAEA,GAAIT,EAAS,CACZ,IAAMiB,EAAcC,EAAS,KAAKjB,CAAQ,EACpCkB,EAAeC,EAAeH,CAAW,EAE/C,OACCzB,EAAC6B,EAAA,CAAM,GAAGN,EACR,SAAAI,GAAgBG,EAAaL,EAAa,CAAC,EAAGzB,EAAC+B,EAAA,CAAK,IAAKV,EAAM,CAAE,EACnE,CAEF,CAEA,OACCpB,EAAC,UAAQ,GAAGsB,EAAa,KAAMP,EAC9B,UAAAhB,EAAC,QAAK,UAAU,UAAW,SAAAc,EAAM,EACjCd,EAAC+B,EAAA,CAAK,IAAKV,EAAM,GAClB,CAEF,CACD,EACAjB,EAAW,YAAc","names":["CircleNotchIcon","Slot","cva","Children","cloneElement","forwardRef","isValidElement","jsx","jsxs","iconButtonVariants","cva","IconButton","forwardRef","_ariaDisabled","appearance","asChild","children","className","_disabled","propIcon","isLoading","label","size","type","props","ref","disabled","parseBooleanish","icon","CircleNotchIcon","buttonProps","cx","singleChild","Children","isValidChild","isValidElement","Slot","cloneElement","Icon"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as g}from"./chunk-3C5O3AQA.js";import{a as u}from"./chunk-XQVVOOLT.js";import{a as p}from"./chunk-AZ56JGNY.js";import{CircleNotchIcon as k}from"@phosphor-icons/react/CircleNotch";import{Slot as I}from"@radix-ui/react-slot";import{cva as N}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=N("inline-flex cursor-pointer items-center justify-center gap-1.5 whitespace-nowrap rounded-md focus-within:outline-none focus-visible:ring-4 disabled:cursor-default disabled:opacity-50 [&>*]: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-9 border border-transparent px-3 text-sm font-medium",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-9 border border-transparent px-3 text-sm font-medium",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-9 border px-3 text-sm font-medium",link:"text-accent-600 focus-visible:ring-focus-accent not-disabled:hover:underline group/button-link 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:x,iconPlacement:o="start",isLoading:a=!1,priority:y="default",type:B,...P},C)=>{let c=g(i??h??a),s=a?t(k,{className:"animate-spin"}):x,l=s&&e!=="link",b={"aria-disabled":c,className:p(A({appearance:e,priority:y,isLoading:a}),l&&o==="start"&&"ps-2.5",l&&o==="end"&&"pe-2.5",m),"data-loading":a,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(I,{...b,children:E(d,{},t(v,{appearance:e,icon:s,iconPlacement:o,children:V}))})}return t("button",{...b,type:B,children:t(v,{appearance:e,icon:s,iconPlacement:o,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"&&"hover:underline group-disabled/button-link:no-underline"),children:[n&&t(u,{svg:n,className:f(r==="end"&&"order-last")}),e]});export{A as a,L as b};
|
|
2
|
+
//# sourceMappingURL=chunk-VTCWSFFJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/button/button.tsx"],"sourcesContent":["import { CircleNotchIcon } from \"@phosphor-icons/react/CircleNotch\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva } from \"class-variance-authority\";\nimport clsx from \"clsx\";\nimport { Children, cloneElement, forwardRef, isValidElement } from \"react\";\nimport type {\n\tButtonHTMLAttributes,\n\tComponentProps,\n\tPropsWithChildren,\n\tReactNode,\n} from \"react\";\nimport invariant from \"tiny-invariant\";\nimport { parseBooleanish } from \"../../types/index.js\";\nimport type { VariantProps } from \"../../types/variant-props.js\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport { Icon } from \"../icon/index.js\";\n\nconst buttonVariants = cva(\n\t\"inline-flex cursor-pointer items-center justify-center gap-1.5 whitespace-nowrap rounded-md focus-within:outline-none focus-visible:ring-4 disabled:cursor-default disabled:opacity-50 [&>*]:focus-within:outline-none\",\n\t{\n\t\tvariants: {\n\t\t\t/**\n\t\t\t * Defines the visual style of the Button.\n\t\t\t */\n\t\t\tappearance: {\n\t\t\t\tfilled:\n\t\t\t\t\t\"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-9 border border-transparent px-3 text-sm font-medium\",\n\t\t\t\tghost:\n\t\t\t\t\t\"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-9 border border-transparent px-3 text-sm font-medium\",\n\t\t\t\toutlined:\n\t\t\t\t\t\"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-9 border px-3 text-sm font-medium\",\n\t\t\t\tlink: \"text-accent-600 focus-visible:ring-focus-accent not-disabled:hover:underline group/button-link border-transparent\",\n\t\t\t},\n\t\t\t/**\n\t\t\t * Whether or not the button is in a loading state, default `false`. Setting `isLoading` will\n\t\t\t * replace any `icon` with a spinner, or add one if an icon wasn't given.\n\t\t\t * It will also disable user interaction with the button and set `disabled`.\n\t\t\t */\n\t\t\tisLoading: {\n\t\t\t\tfalse: \"\",\n\t\t\t\ttrue: \"opacity-50\",\n\t\t\t},\n\t\t\t/**\n\t\t\t * Indicates the importance or impact level of the button, affecting its\n\t\t\t * color and styling to communicate its purpose to the user\n\t\t\t */\n\t\t\tpriority: {\n\t\t\t\tdanger: \"\",\n\t\t\t\tdefault: \"\",\n\t\t\t\tneutral: \"\",\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tappearance: \"outlined\",\n\t\t\tisLoading: false,\n\t\t\tpriority: \"default\",\n\t\t},\n\t\tcompoundVariants: [\n\t\t\t{\n\t\t\t\tappearance: \"ghost\",\n\t\t\t\tpriority: \"danger\",\n\t\t\t\tclass:\n\t\t\t\t\t\"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\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tappearance: \"outlined\",\n\t\t\t\tpriority: \"danger\",\n\t\t\t\tclass:\n\t\t\t\t\t\"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\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tappearance: \"filled\",\n\t\t\t\tpriority: \"danger\",\n\t\t\t\tclass:\n\t\t\t\t\t\"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\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tappearance: \"link\",\n\t\t\t\tpriority: \"danger\",\n\t\t\t\tclass: \"text-danger-600 focus-visible:ring-focus-danger\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tappearance: \"ghost\",\n\t\t\t\tpriority: \"neutral\",\n\t\t\t\tclass:\n\t\t\t\t\t\"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\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tappearance: \"outlined\",\n\t\t\t\tpriority: \"neutral\",\n\t\t\t\tclass:\n\t\t\t\t\t\"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\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tappearance: \"filled\",\n\t\t\t\tpriority: \"neutral\",\n\t\t\t\tclass:\n\t\t\t\t\t\"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\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tappearance: \"link\",\n\t\t\t\tpriority: \"neutral\",\n\t\t\t\tclass: \"text-strong focus-visible:ring-focus-accent\",\n\t\t\t},\n\t\t],\n\t},\n);\n\ntype ButtonVariants = VariantProps<typeof buttonVariants>;\n\ntype ButtonAppearance = Pick<ButtonVariants, \"appearance\">[\"appearance\"];\ntype ButtonPriority = Pick<ButtonVariants, \"priority\">[\"priority\"];\n\n/**\n * The props for the `Button` component.\n */\ntype ButtonProps = ComponentProps<\"button\"> &\n\tButtonVariants & {\n\t\t/**\n\t\t * An icon to render inside the button. If the `state` is `\"pending\"`, then\n\t\t * the icon will automatically be replaced with a spinner.\n\t\t */\n\t\ticon?: ReactNode;\n\t\t/**\n\t\t * The side that the icon will render on, if one is present. If `state=\"pending\"`,\n\t\t * then the loading icon will also render on this side.\n\t\t * @default \"start\"\n\t\t */\n\t\ticonPlacement?: \"start\" | \"end\";\n\t} & (\n\t\t| {\n\t\t\t\t/**\n\t\t\t\t * Use the `asChild` prop to compose Radix's functionality onto alternative\n\t\t\t\t * element types or your own React components.\n\t\t\t\t *\n\t\t\t\t * When `asChild` is set to `true`, mantle will not render a default DOM\n\t\t\t\t * element, instead cloning the component's child and passing it the props and\n\t\t\t\t * behavior required to make it functional.\n\t\t\t\t *\n\t\t\t\t * asChild can be used as deeply as you need to. This means it is a great way\n\t\t\t\t * to compose multiple primitive's behavior together.\n\t\t\t\t *\n\t\t\t\t * @see https://www.radix-ui.com/docs/primitives/guides/composition#composition\n\t\t\t\t */\n\t\t\t\tasChild: true;\n\t\t\t\t/**\n\t\t\t\t * The default behavior of the button. Possible values are: `\"button\"`, `\"submit\"`, and `\"reset\"`.\n\t\t\t\t *\n\t\t\t\t * if `asChild` is NOT used: Unlike the native `<button>` element, this prop is required and has no default value.\n\t\t\t\t *\n\t\t\t\t * If `asChild` IS used: This prop HAS NO EFFECT, is REMOVED, and has no default value. This is because we do not want the `button` `type` to automatically merge with any child anchor `type` attribute because the `anchor` `type` is _strictly different_ than the `button` type, see: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#type\n\t\t\t\t *\n\t\t\t\t * @enum\n\t\t\t\t * - `\"button\"`: The button has no default behavior, and does nothing when pressed by default. It can have client-side scripts listen to the element's events, which are triggered when the events occur.\n\t\t\t\t * - `\"reset\"`: The button resets all the controls to their initial values.\n\t\t\t\t * - `\"submit\"`: The button submits the form data to the server.\n\t\t\t\t *\n\t\t\t\t * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#type\n\t\t\t\t */\n\t\t\t\ttype?: ButtonHTMLAttributes<HTMLButtonElement>[\"type\"];\n\t\t }\n\t\t| {\n\t\t\t\tasChild?: false | undefined;\n\t\t\t\t/**\n\t\t\t\t * The default behavior of the button. Possible values are: `\"button\"`, `\"submit\"`, and `\"reset\"`.\n\t\t\t\t *\n\t\t\t\t * if `asChild` is NOT used: Unlike the native `<button>` element, this prop is required and has no default value.\n\t\t\t\t *\n\t\t\t\t * If `asChild` IS used: This prop HAS NO EFFECT, is REMOVED, and has no default value. This is because we do not want the `button` `type` to automatically merge with any child anchor `type` attribute because the `anchor` `type` is _strictly different_ than the `button` type, see: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#type\n\t\t\t\t *\n\t\t\t\t * @enum\n\t\t\t\t * - `\"button\"`: The button has no default behavior, and does nothing when pressed by default. It can have client-side scripts listen to the element's events, which are triggered when the events occur.\n\t\t\t\t * - `\"reset\"`: The button resets all the controls to their initial values.\n\t\t\t\t * - `\"submit\"`: The button submits the form data to the server.\n\t\t\t\t *\n\t\t\t\t * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#type\n\t\t\t\t */\n\t\t\t\ttype: Exclude<\n\t\t\t\t\tButtonHTMLAttributes<HTMLButtonElement>[\"type\"],\n\t\t\t\t\tundefined\n\t\t\t\t>;\n\t\t }\n\t);\n\n/**\n * Renders a button or a component that looks like a button, an interactive\n * element activated by a user with a mouse, keyboard, finger, voice command, or\n * other assistive technology. Once activated, it then performs an action, such\n * as submitting a form or opening a dialog.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button\n */\nconst Button = forwardRef<HTMLButtonElement, ButtonProps>(\n\t(\n\t\t{\n\t\t\t\"aria-disabled\": _ariaDisabled,\n\t\t\tappearance = \"outlined\",\n\t\t\tasChild,\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\tdisabled: _disabled,\n\t\t\ticon: propIcon,\n\t\t\ticonPlacement = \"start\",\n\t\t\tisLoading = false,\n\t\t\tpriority = \"default\",\n\t\t\ttype,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst disabled = parseBooleanish(_ariaDisabled ?? _disabled ?? isLoading);\n\t\tconst icon = isLoading ? (\n\t\t\t<CircleNotchIcon className=\"animate-spin\" />\n\t\t) : (\n\t\t\tpropIcon\n\t\t);\n\n\t\t/**\n\t\t * If the button has an icon and is not a link, add padding-start or padding-end to the button depending on the icon placement.\n\t\t */\n\t\tconst hasSpecialIconPadding = icon && appearance !== \"link\";\n\n\t\tconst buttonProps = {\n\t\t\t\"aria-disabled\": disabled,\n\t\t\tclassName: cx(\n\t\t\t\tbuttonVariants({ appearance, priority, isLoading }),\n\t\t\t\thasSpecialIconPadding && iconPlacement === \"start\" && \"ps-2.5\",\n\t\t\t\thasSpecialIconPadding && iconPlacement === \"end\" && \"pe-2.5\",\n\t\t\t\tclassName,\n\t\t\t),\n\t\t\t\"data-loading\": isLoading,\n\t\t\tdisabled,\n\t\t\tref,\n\t\t\t...props,\n\t\t};\n\n\t\tif (asChild) {\n\t\t\tconst singleChild = Children.only(children);\n\t\t\tinvariant(\n\t\t\t\tisValidElement<ButtonProps>(singleChild),\n\t\t\t\t\"When using `asChild`, Button must be passed a single child as a JSX tag.\",\n\t\t\t);\n\t\t\tconst grandchildren = singleChild.props?.children;\n\n\t\t\treturn (\n\t\t\t\t<Slot {...buttonProps}>\n\t\t\t\t\t{cloneElement(\n\t\t\t\t\t\tsingleChild,\n\t\t\t\t\t\t{},\n\t\t\t\t\t\t<InnerContent\n\t\t\t\t\t\t\tappearance={appearance}\n\t\t\t\t\t\t\ticon={icon}\n\t\t\t\t\t\t\ticonPlacement={iconPlacement}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{grandchildren}\n\t\t\t\t\t\t</InnerContent>,\n\t\t\t\t\t)}\n\t\t\t\t</Slot>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<button {...buttonProps} type={type}>\n\t\t\t\t<InnerContent\n\t\t\t\t\tappearance={appearance}\n\t\t\t\t\ticon={icon}\n\t\t\t\t\ticonPlacement={iconPlacement}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</InnerContent>\n\t\t\t</button>\n\t\t);\n\t},\n);\nButton.displayName = \"Button\";\n\nexport {\n\t//,\n\tButton,\n\tbuttonVariants,\n};\n\nexport type {\n\t//,\n\tButtonProps,\n\tButtonAppearance,\n\tButtonPriority,\n};\n\ntype InnerContentProps = PropsWithChildren &\n\tPick<ButtonProps, \"appearance\" | \"icon\" | \"iconPlacement\">;\n\nconst InnerContent = ({\n\tappearance,\n\tchildren,\n\ticon,\n\ticonPlacement,\n}: InnerContentProps) => (\n\t<span\n\t\tclassName={clsx(\n\t\t\t\"inline-flex items-center gap-1.5 focus-within:outline-none focus-visible:outline-none\",\n\t\t\tappearance === \"link\" &&\n\t\t\t\t\"hover:underline group-disabled/button-link:no-underline\",\n\t\t)}\n\t>\n\t\t{icon && (\n\t\t\t<Icon\n\t\t\t\tsvg={icon}\n\t\t\t\tclassName={clsx(iconPlacement === \"end\" && \"order-last\")}\n\t\t\t/>\n\t\t)}\n\t\t{children}\n\t</span>\n);\n"],"mappings":"wHAAA,OAAS,mBAAAA,MAAuB,oCAChC,OAAS,QAAAC,MAAY,uBACrB,OAAS,OAAAC,MAAW,2BACpB,OAAOC,MAAU,OACjB,OAAS,YAAAC,EAAU,gBAAAC,EAAc,cAAAC,EAAY,kBAAAC,MAAsB,QAOnE,OAAOC,MAAe,iBAyMnB,cAAAC,EAsFF,QAAAC,MAtFE,oBAnMH,IAAMC,EAAiBC,EACtB,yNACA,CACC,SAAU,CAIT,WAAY,CACX,OACC,+OACD,MACC,yPACD,SACC,2UACD,KAAM,mHACP,EAMA,UAAW,CACV,MAAO,GACP,KAAM,YACP,EAKA,SAAU,CACT,OAAQ,GACR,QAAS,GACT,QAAS,EACV,CACD,EACA,gBAAiB,CAChB,WAAY,WACZ,UAAW,GACX,SAAU,SACX,EACA,iBAAkB,CACjB,CACC,WAAY,QACZ,SAAU,SACV,MACC,oNACF,EACA,CACC,WAAY,WACZ,SAAU,SACV,MACC,sSACF,EACA,CACC,WAAY,SACZ,SAAU,SACV,MACC,2LACF,EACA,CACC,WAAY,OACZ,SAAU,SACV,MAAO,iDACR,EACA,CACC,WAAY,QACZ,SAAU,UACV,MACC,0MACF,EACA,CACC,WAAY,WACZ,SAAU,UACV,MACC,wWACF,EACA,CACC,WAAY,SACZ,SAAU,UACV,MACC,gMACF,EACA,CACC,WAAY,OACZ,SAAU,UACV,MAAO,6CACR,CACD,CACD,CACD,EAsFMC,EAASC,EACd,CACC,CACC,gBAAiBC,EACjB,WAAAC,EAAa,WACb,QAAAC,EACA,SAAAC,EACA,UAAAC,EACA,SAAUC,EACV,KAAMC,EACN,cAAAC,EAAgB,QAChB,UAAAC,EAAY,GACZ,SAAAC,EAAW,UACX,KAAAC,EACA,GAAGC,CACJ,EACAC,IACI,CACJ,IAAMC,EAAWC,EAAgBd,GAAiBK,GAAaG,CAAS,EAClEO,EAAOP,EACZd,EAACsB,EAAA,CAAgB,UAAU,eAAe,EAE1CV,EAMKW,EAAwBF,GAAQd,IAAe,OAE/CiB,EAAc,CACnB,gBAAiBL,EACjB,UAAWM,EACVvB,EAAe,CAAE,WAAAK,EAAY,SAAAQ,EAAU,UAAAD,CAAU,CAAC,EAClDS,GAAyBV,IAAkB,SAAW,SACtDU,GAAyBV,IAAkB,OAAS,SACpDH,CACD,EACA,eAAgBI,EAChB,SAAAK,EACA,IAAAD,EACA,GAAGD,CACJ,EAEA,GAAIT,EAAS,CACZ,IAAMkB,EAAcC,EAAS,KAAKlB,CAAQ,EAC1CmB,EACCC,EAA4BH,CAAW,EACvC,0EACD,EACA,IAAMI,EAAgBJ,EAAY,OAAO,SAEzC,OACC1B,EAAC+B,EAAA,CAAM,GAAGP,EACR,SAAAQ,EACAN,EACA,CAAC,EACD1B,EAACiC,EAAA,CACA,WAAY1B,EACZ,KAAMc,EACN,cAAeR,EAEd,SAAAiB,EACF,CACD,EACD,CAEF,CAEA,OACC9B,EAAC,UAAQ,GAAGwB,EAAa,KAAMR,EAC9B,SAAAhB,EAACiC,EAAA,CACA,WAAY1B,EACZ,KAAMc,EACN,cAAeR,EAEd,SAAAJ,EACF,EACD,CAEF,CACD,EACAL,EAAO,YAAc,SAkBrB,IAAM8B,EAAe,CAAC,CACrB,WAAAC,EACA,SAAAC,EACA,KAAAC,EACA,cAAAC,CACD,IACCC,EAAC,QACA,UAAWC,EACV,wFACAL,IAAe,QACd,yDACF,EAEC,UAAAE,GACAI,EAACC,EAAA,CACA,IAAKL,EACL,UAAWG,EAAKF,IAAkB,OAAS,YAAY,EACxD,EAEAF,GACF","names":["CircleNotchIcon","Slot","cva","clsx","Children","cloneElement","forwardRef","isValidElement","invariant","jsx","jsxs","buttonVariants","cva","Button","forwardRef","_ariaDisabled","appearance","asChild","children","className","_disabled","propIcon","iconPlacement","isLoading","priority","type","props","ref","disabled","parseBooleanish","icon","CircleNotchIcon","hasSpecialIconPadding","buttonProps","cx","singleChild","Children","invariant","isValidElement","grandchildren","Slot","cloneElement","InnerContent","InnerContent","appearance","children","icon","iconPlacement","jsxs","clsx","jsx","Icon"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as P}from"./chunk-MF2QITTY.js";import{b as h}from"./chunk-UXH22BMO.js";import{a as m}from"./chunk-XQVVOOLT.js";import{a as r}from"./chunk-AZ56JGNY.js";import{CaretDownIcon as b}from"@phosphor-icons/react/CaretDown";import{CaretUpIcon as R}from"@phosphor-icons/react/CaretUp";import{CheckIcon as N}from"@phosphor-icons/react/Check";import*as e from"@radix-ui/react-select";import{createContext as T,forwardRef as n,useContext as B}from"react";import{jsx as t,jsxs as g}from"react/jsx-runtime";var y=T({}),W=n(({"aria-invalid":o,children:a,id:i,validation:l,onBlur:s,onValueChange:d,onChange:v,...c},p)=>t(e.Root,{...c,onValueChange:f=>{v?.(f),d?.(f)},children:t(y.Provider,{value:{"aria-invalid":o,id:i,validation:l,onBlur:s,ref:p},children:a})}));W.displayName="Select";var O=e.Group,_=e.Value,L=n(({"aria-invalid":o,className:a,children:i,id:l,validation:s,...d},v)=>{let c=B(y),p=c["aria-invalid"]??o,f=p!=null&&p!=="false",u=c.validation??s,S=f?"error":typeof u=="function"?u():u,w=p??S==="error",I=c.id??l;return g(e.Trigger,{"aria-invalid":w,className:r("h-9 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 disabled:pointer-events-none disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:text-left","hover:border-neutral-400","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),"data-validation":S||void 0,id:I,ref:P(v,c.ref),...d,children:[i,t(e.Icon,{asChild:!0,children:t(m,{svg:t(b,{weight:"bold"}),className:"size-4"})})]})});L.displayName="SelectTrigger";var x=n(({className:o,...a},i)=>t(e.ScrollUpButton,{ref:i,className:r("flex cursor-default items-center justify-center py-1",o),...a,children:t(m,{svg:t(R,{weight:"bold"}),className:"size-4"})}));x.displayName="SelectScrollUpButton";var C=n(({className:o,...a},i)=>t(e.ScrollDownButton,{ref:i,className:r("flex cursor-default items-center justify-center py-1",o),...a,children:t(m,{svg:t(b,{weight:"bold"}),className:"size-4"})}));C.displayName="SelectScrollDownButton";var V=n(({className:o,children:a,position:i="popper",width:l="trigger",...s},d)=>t(e.Portal,{children:g(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",i==="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:i,...s,children:[t(x,{}),t(e.Viewport,{className:r("p-1",i==="popper"&&"h-[var(--radix-select-trigger-height)] w-full"),children:a}),t(C,{})]})}));V.displayName="SelectContent";var E=n(({className:o,...a},i)=>t(e.Label,{ref:i,className:r("px-2 py-1.5 text-sm font-semibold",o),...a}));E.displayName="SelectLabel";var z=n(({className:o,children:a,...i},l)=>g(e.Item,{ref:l,className:r("relative flex w-full cursor-pointer select-none items-center rounded py-1.5 pl-2 pr-8 text-sm outline-none","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","focus:data-state-checked:bg-filled-accent",o),...i,children:[t(e.ItemText,{children:a}),t(e.ItemIndicator,{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:t(m,{svg:t(N,{weight:"bold"}),className:"size-4"})})]}));z.displayName="SelectItem";var D=n(({className:o,...a},i)=>t(h,{ref:i,className:r("-mx-1 my-1 h-px w-auto",o),...a}));D.displayName="SelectSeparator";export{W as a,O as b,_ as c,L as d,V as e,E as f,z as g,D as h};
|
|
2
|
+
//# sourceMappingURL=chunk-WVHMNFQD.js.map
|