@ngrok/mantle 0.14.0 → 0.14.2

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.
@@ -4,12 +4,12 @@ import * as class_variance_authority_types from 'class-variance-authority/types'
4
4
  import * as react from 'react';
5
5
  import { ComponentProps, ReactNode } from 'react';
6
6
  import * as react_jsx_runtime from 'react/jsx-runtime';
7
- import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
7
+ import * as DialogPrimitive from '@radix-ui/react-dialog';
8
8
  import { S as SvgAttributes } from './types-BuKAGhC-.js';
9
9
 
10
10
  declare const priorities: readonly ["info", "danger"];
11
11
  type Priority = (typeof priorities)[number];
12
- type AlertDialogProps = ComponentProps<typeof AlertDialogPrimitive.Root> & {
12
+ type AlertDialogProps = ComponentProps<typeof DialogPrimitive.Root> & {
13
13
  /**
14
14
  * Indicates the importance or impact level of the AlertDialog, affecting its
15
15
  * color and styling to communicate its purpose to the user.
@@ -20,20 +20,26 @@ type AlertDialogProps = ComponentProps<typeof AlertDialogPrimitive.Root> & {
20
20
  * The root component for the Alert Dialog
21
21
  */
22
22
  declare function AlertDialog({ priority, ...props }: AlertDialogProps): react_jsx_runtime.JSX.Element;
23
+ declare namespace AlertDialog {
24
+ var displayName: string;
25
+ }
23
26
  /**
24
27
  * A button that opens the Alert Dialog.
25
28
  */
26
- declare const AlertDialogTrigger: react.ForwardRefExoticComponent<AlertDialogPrimitive.AlertDialogTriggerProps & react.RefAttributes<HTMLButtonElement>>;
29
+ declare const AlertDialogTrigger: react.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & react.RefAttributes<HTMLButtonElement>>;
27
30
  /**
28
31
  * The popover alert dialog container.
29
32
  *
30
33
  * Renders on top of the overlay and is centered in the viewport.
31
34
  */
32
- declare const AlertDialogContent: react.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
35
+ declare const AlertDialogContent: react.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
33
36
  /**
34
37
  * Contains the main content of the dialog.
35
38
  */
36
- declare const AlertDialogBody: ({ className, ...props }: ComponentProps<"div">) => react_jsx_runtime.JSX.Element;
39
+ declare const AlertDialogBody: {
40
+ ({ className, ...props }: ComponentProps<"div">): react_jsx_runtime.JSX.Element;
41
+ displayName: string;
42
+ };
37
43
  /**
38
44
  * Contains the header content of the dialog, including the title and description.
39
45
  */
@@ -54,17 +60,18 @@ declare const AlertDialogFooter: {
54
60
  * Alternatively, you can provide `aria-label` or `aria-labelledby` to
55
61
  * `AlertDialogContent` and exclude this component.
56
62
  */
57
- declare const AlertDialogTitle: react.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogTitleProps & react.RefAttributes<HTMLHeadingElement>, "ref"> & react.RefAttributes<HTMLHeadingElement>>;
63
+ declare const AlertDialogTitle: react.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & react.RefAttributes<HTMLHeadingElement>, "ref"> & react.RefAttributes<HTMLHeadingElement>>;
58
64
  /**
59
65
  * An accessible description to be announced when the dialog is opened.
60
66
  *
61
67
  * Alternatively, you can provide `aria-describedby` to `AlertDialogContent` and
62
68
  * exclude this component.
63
69
  */
64
- declare const AlertDialogDescription: react.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogDescriptionProps & react.RefAttributes<HTMLParagraphElement>, "ref"> & react.RefAttributes<HTMLParagraphElement>>;
70
+ declare const AlertDialogDescription: react.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & react.RefAttributes<HTMLParagraphElement>, "ref"> & react.RefAttributes<HTMLParagraphElement>>;
65
71
  /**
66
- * A button that closes the dialog and confirms the action.
72
+ * A button that confirms the Alert Dialog action.
67
73
  * Will default to appearance="filled", as well as the priority color from the `AlertDialog`.
74
+ * Does not close the alert dialog by default.
68
75
  *
69
76
  * These buttons should be distinguished visually from the AlertDialogCancel button.
70
77
  *
@@ -1,2 +1,2 @@
1
- import{b as m}from"./chunk-QJ76A4YV.js";import"./chunk-4LSFAAZW.js";import"./chunk-RDMTCZPT.js";import"./chunk-CZPUIRJG.js";import{a as p}from"./chunk-VJPVAY5J.js";import{a as l}from"./chunk-EW5CFGXT.js";import{Info as R}from"@phosphor-icons/react/Info";import{Warning as b}from"@phosphor-icons/react/Warning";import*as e from"@radix-ui/react-alert-dialog";import{createContext as h,forwardRef as n,useContext as T}from"react";import B from"tiny-invariant";import{jsx as o,jsxs as z}from"react/jsx-runtime";var g=h(null);function c(){let t=T(g);return B(t,"AlertDialog child component used outside of AlertDialog parent!"),t}function E({priority:t,...i}){return o(g.Provider,{value:{priority:t},children:o(e.Root,{...i})})}var w=e.Trigger,I=e.Portal,d=n(({className:t,...i},r)=>o(e.Overlay,{className:l("data-state-open:animate-in data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:fade-in-0 bg-overlay fixed inset-0 z-50 backdrop-blur-sm",t),...i,ref:r}));d.displayName=e.Overlay.displayName;var f=n(({className:t,...i},r)=>z(I,{children:[o(d,{}),o("div",{className:"fixed inset-4 z-50 flex items-center justify-center",children:o(e.Content,{ref:r,className:l("flex w-full max-w-md flex-1 flex-col items-center gap-4 sm:flex-row sm:items-start","outline-none focus-within:outline-none","p-6","border-dialog bg-dialog rounded-xl border shadow-lg transition-transform duration-200","data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95",t),...i})})]}));f.displayName=e.Content.displayName;var O=({className:t,...i})=>o("div",{className:l("flex-1 space-y-4",t),...i}),A=({className:t,...i})=>o("div",{className:l("flex flex-col space-y-2 text-center sm:text-start",t),...i});A.displayName="AlertDialogHeader";var D=({className:t,...i})=>o("div",{className:l("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...i});D.displayName="AlertDialogFooter";var y=n(({className:t,...i},r)=>o(e.Title,{ref:r,className:l("text-strong text-center text-xl font-medium sm:text-start sm:text-lg",t),...i}));y.displayName=e.Title.displayName;var P=n(({className:t,...i},r)=>o(e.Description,{ref:r,className:l("text-body text-center text-base font-normal sm:text-start sm:text-sm",t),...i}));P.displayName=e.Description.displayName;var u=n(({appearance:t="filled",...i},r)=>{let s=c(),a="default";return s.priority==="danger"&&(a="danger"),o(e.Action,{asChild:!0,children:o(m,{appearance:t,priority:a,ref:r,...i})})});u.displayName=e.Action.displayName;var v=n(({appearance:t="outlined",className:i,priority:r="neutral",...s},a)=>o(e.Cancel,{asChild:!0,children:o(m,{appearance:t,className:l("mt-2 sm:mt-0",i),priority:r,ref:a,...s})}));v.displayName=e.Cancel.displayName;var x=n(({className:t,svg:i,...r},s)=>{let a=c(),C=a.priority==="danger"?"text-danger-600":"text-accent-600",N=a.priority==="danger"?o(b,{}):o(R,{});return o(p,{ref:s,className:l("size-12 sm:size-7",C,t),svg:i??N,...r})});x.displayName="AlertDialogIcon";export{E as AlertDialog,u as AlertDialogAction,O as AlertDialogBody,v as AlertDialogCancel,f as AlertDialogContent,P as AlertDialogDescription,D as AlertDialogFooter,A as AlertDialogHeader,x as AlertDialogIcon,y as AlertDialogTitle,w as AlertDialogTrigger};
1
+ import{b as m}from"./chunk-25GJN3ZK.js";import"./chunk-4LSFAAZW.js";import"./chunk-RDMTCZPT.js";import"./chunk-PMSTRJK7.js";import{a as p}from"./chunk-VJPVAY5J.js";import{a as l}from"./chunk-EW5CFGXT.js";import{Info as h}from"@phosphor-icons/react/Info";import{Warning as B}from"@phosphor-icons/react/Warning";import*as i from"@radix-ui/react-dialog";import{createContext as T,forwardRef as n,useContext as E}from"react";import w from"tiny-invariant";import{jsx as o,jsxs as z}from"react/jsx-runtime";var g=T(null);function c(){let t=E(g);return w(t,"AlertDialog child component used outside of AlertDialog parent!"),t}function d({priority:t,...e}){return o(g.Provider,{value:{priority:t},children:o(i.Root,{...e})})}d.displayName="AlertDialog";var I=i.Trigger,O=i.Portal,f=n(({className:t,...e},r)=>o(i.Overlay,{className:l("data-state-open:animate-in data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:fade-in-0 bg-overlay fixed inset-0 z-50 backdrop-blur-sm",t),...e,ref:r}));f.displayName="AlertDialogOverlay";var D=n(({className:t,...e},r)=>z(O,{children:[o(f,{}),o("div",{className:"fixed inset-4 z-50 flex items-center justify-center",children:o(i.Content,{ref:r,className:l("flex w-full max-w-md flex-1 flex-col items-center gap-4 sm:flex-row sm:items-start","outline-none focus-within:outline-none","p-6","border-dialog bg-dialog rounded-xl border shadow-lg transition-transform duration-200","data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95",t),...e})})]}));D.displayName="AlertDialogContent";var A=({className:t,...e})=>o("div",{className:l("flex-1 space-y-4",t),...e});A.displayName="AlertDialogBody";var y=({className:t,...e})=>o("div",{className:l("flex flex-col space-y-2 text-center sm:text-start",t),...e});y.displayName="AlertDialogHeader";var u=({className:t,...e})=>o("div",{className:l("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});u.displayName="AlertDialogFooter";var P=n(({className:t,...e},r)=>o(i.Title,{ref:r,className:l("text-strong text-center text-xl font-medium sm:text-start sm:text-lg",t),...e}));P.displayName="AlertDialogTitle";var v=n(({className:t,...e},r)=>o(i.Description,{ref:r,className:l("text-body text-center text-base font-normal sm:text-start sm:text-sm",t),...e}));v.displayName="AlertDialogDescription";var x=n(({appearance:t="filled",...e},r)=>{let s=c(),a="default";return s.priority==="danger"&&(a="danger"),o(m,{appearance:t,priority:a,ref:r,...e})});x.displayName="AlertDialogAction";var C=n(({appearance:t="outlined",className:e,priority:r="neutral",...s},a)=>o(i.Close,{asChild:!0,children:o(m,{appearance:t,className:l("mt-2 sm:mt-0",e),priority:r,ref:a,...s})}));C.displayName="AlertDialogCancel";var N=n(({className:t,svg:e,...r},s)=>{let a=c(),R=a.priority==="danger"?"text-danger-600":"text-accent-600",b=a.priority==="danger"?o(B,{}):o(h,{});return o(p,{ref:s,className:l("size-12 sm:size-7",R,t),svg:e??b,...r})});N.displayName="AlertDialogIcon";export{d as AlertDialog,x as AlertDialogAction,A as AlertDialogBody,C as AlertDialogCancel,D as AlertDialogContent,v as AlertDialogDescription,u as AlertDialogFooter,y as AlertDialogHeader,N as AlertDialogIcon,P as AlertDialogTitle,I as AlertDialogTrigger};
2
2
  //# sourceMappingURL=alert-dialog.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/alert-dialog/alert-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { Info } from \"@phosphor-icons/react/Info\";\nimport { Warning } from \"@phosphor-icons/react/Warning\";\nimport * as AlertDialogPrimitive from \"@radix-ui/react-alert-dialog\";\nimport {\n\tcreateContext,\n\tforwardRef,\n\tuseContext,\n\ttype ComponentProps,\n\ttype ComponentPropsWithoutRef,\n\ttype ElementRef,\n\ttype ReactNode,\n} from \"react\";\nimport invariant from \"tiny-invariant\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport { Button, type ButtonPriority, type ButtonProps } from \"../button/button.js\";\nimport { SvgOnly } from \"../icon/svg-only.js\";\nimport type { SvgAttributes } from \"../icon/types.js\";\n\nconst priorities = [\"info\", \"danger\"] as const;\ntype Priority = (typeof priorities)[number];\n\ntype AlertDialogContextValue = {\n\tpriority: Priority;\n};\n\nconst AlertDialogContext = createContext<AlertDialogContextValue | null>(null);\n\nfunction useAlertDialogContext() {\n\tconst context = useContext(AlertDialogContext);\n\tinvariant(context, \"AlertDialog child component used outside of AlertDialog parent!\");\n\treturn context;\n}\n\ntype AlertDialogProps = ComponentProps<typeof AlertDialogPrimitive.Root> & {\n\t/**\n\t * Indicates the importance or impact level of the AlertDialog, affecting its\n\t * color and styling to communicate its purpose to the user.\n\t */\n\tpriority: Priority;\n};\n\n/**\n * The root component for the Alert Dialog\n */\nfunction AlertDialog({ priority, ...props }: AlertDialogProps) {\n\treturn (\n\t\t<AlertDialogContext.Provider value={{ priority }}>\n\t\t\t<AlertDialogPrimitive.Root {...props} />\n\t\t</AlertDialogContext.Provider>\n\t);\n}\n\n/**\n * A button that opens the Alert Dialog.\n */\nconst AlertDialogTrigger = AlertDialogPrimitive.Trigger;\n\nconst AlertDialogPortal = AlertDialogPrimitive.Portal;\n\n/**\n * A layer that covers the inert portion of the view when the dialog is open.\n */\nconst AlertDialogOverlay = forwardRef<\n\tElementRef<typeof AlertDialogPrimitive.Overlay>,\n\tComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n\t<AlertDialogPrimitive.Overlay\n\t\tclassName={cx(\n\t\t\t\"data-state-open:animate-in data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:fade-in-0 bg-overlay fixed inset-0 z-50 backdrop-blur-sm\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t\tref={ref}\n\t/>\n));\nAlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;\n\n/**\n * The popover alert dialog container.\n *\n * Renders on top of the overlay and is centered in the viewport.\n */\nconst AlertDialogContent = forwardRef<\n\tElementRef<typeof AlertDialogPrimitive.Content>,\n\tComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>\n>(({ className, ...props }, ref) => (\n\t<AlertDialogPortal>\n\t\t<AlertDialogOverlay />\n\t\t<div className=\"fixed inset-4 z-50 flex items-center justify-center\">\n\t\t\t<AlertDialogPrimitive.Content\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cx(\n\t\t\t\t\t\"flex w-full max-w-md flex-1 flex-col items-center gap-4 sm:flex-row sm:items-start\",\n\t\t\t\t\t\"outline-none focus-within:outline-none\",\n\t\t\t\t\t\"p-6\",\n\t\t\t\t\t\"border-dialog bg-dialog rounded-xl border shadow-lg transition-transform duration-200\",\n\t\t\t\t\t\"data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</div>\n\t</AlertDialogPortal>\n));\nAlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;\n\n/**\n * Contains the main content of the dialog.\n */\nconst AlertDialogBody = ({ className, ...props }: ComponentProps<\"div\">) => (\n\t<div className={cx(\"flex-1 space-y-4\", className)} {...props} />\n);\n\n/**\n * Contains the header content of the dialog, including the title and description.\n */\nconst AlertDialogHeader = ({ className, ...props }: ComponentProps<\"div\">) => (\n\t<div className={cx(\"flex flex-col space-y-2 text-center sm:text-start\", className)} {...props} />\n);\nAlertDialogHeader.displayName = \"AlertDialogHeader\";\n\n/**\n * Contains the footer content of the dialog, including the action and cancel buttons.\n */\nconst AlertDialogFooter = ({ className, ...props }: ComponentProps<\"div\">) => (\n\t<div className={cx(\"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\", className)} {...props} />\n);\nAlertDialogFooter.displayName = \"AlertDialogFooter\";\n\n/**\n * An accessible name to be announced when the dialog is opened.\n *\n * Alternatively, you can provide `aria-label` or `aria-labelledby` to\n * `AlertDialogContent` and exclude this component.\n */\nconst AlertDialogTitle = forwardRef<\n\tElementRef<typeof AlertDialogPrimitive.Title>,\n\tComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n\t<AlertDialogPrimitive.Title\n\t\tref={ref}\n\t\tclassName={cx(\"text-strong text-center text-xl font-medium sm:text-start sm:text-lg\", className)}\n\t\t{...props}\n\t/>\n));\nAlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;\n\n/**\n * An accessible description to be announced when the dialog is opened.\n *\n * Alternatively, you can provide `aria-describedby` to `AlertDialogContent` and\n * exclude this component.\n */\nconst AlertDialogDescription = forwardRef<\n\tElementRef<typeof AlertDialogPrimitive.Description>,\n\tComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n\t<AlertDialogPrimitive.Description\n\t\tref={ref}\n\t\tclassName={cx(\"text-body text-center text-base font-normal sm:text-start sm:text-sm\", className)}\n\t\t{...props}\n\t/>\n));\nAlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;\n\n/**\n * A button that closes the dialog and confirms the action.\n * Will default to appearance=\"filled\", as well as the priority color from the `AlertDialog`.\n *\n * These buttons should be distinguished visually from the AlertDialogCancel button.\n *\n * Composes around the mantle Button component.\n */\nconst AlertDialogAction = forwardRef<ElementRef<\"button\">, ButtonProps>(\n\t(\n\t\t{\n\t\t\t//,\n\t\t\tappearance = \"filled\",\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst ctx = useAlertDialogContext();\n\t\tlet buttonPriority: NonNullable<ButtonPriority> = \"default\";\n\t\tif (ctx.priority === \"danger\") {\n\t\t\tbuttonPriority = \"danger\";\n\t\t}\n\n\t\treturn (\n\t\t\t<AlertDialogPrimitive.Action asChild>\n\t\t\t\t<Button\n\t\t\t\t\t//\n\t\t\t\t\tappearance={appearance}\n\t\t\t\t\tpriority={buttonPriority}\n\t\t\t\t\tref={ref}\n\t\t\t\t\t{...props}\n\t\t\t\t/>\n\t\t\t</AlertDialogPrimitive.Action>\n\t\t);\n\t},\n);\nAlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;\n\n/**\n * A button that closes the dialog and cancels the action.\n * Will default to appearance=\"outlined\" and priority=\"neutral\".\n *\n * This button should be distinguished visually from AlertDialogAction buttons.\n *\n * Composes around the mantle Button component.\n */\nconst AlertDialogCancel = forwardRef<ElementRef<\"button\">, ButtonProps>(\n\t(\n\t\t{\n\t\t\t//,\n\t\t\tappearance = \"outlined\",\n\t\t\tclassName,\n\t\t\tpriority = \"neutral\",\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => (\n\t\t<AlertDialogPrimitive.Cancel 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.Cancel>\n\t),\n);\nAlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;\n\ntype AlertDialogIconProps = Omit<SvgAttributes, \"children\"> & {\n\tsvg?: ReactNode;\n};\n\n/**\n * An icon that visually represents the priority of the AlertDialog.\n *\n * Defaults to a warning icon for danger priority and an info icon for info\n * priority with the appropriate color.\n *\n * Can be overridden with a custom icon using the `svg` prop.\n */\nconst AlertDialogIcon = forwardRef<ElementRef<\"svg\">, AlertDialogIconProps>(({ className, svg, ...props }, ref) => {\n\tconst ctx = useAlertDialogContext();\n\tconst defaultColor = ctx.priority === \"danger\" ? \"text-danger-600\" : \"text-accent-600\";\n\tconst defaultIcon = ctx.priority === \"danger\" ? <Warning /> : <Info />;\n\n\treturn (\n\t\t<SvgOnly\n\t\t\tref={ref}\n\t\t\tclassName={cx(\"size-12 sm:size-7\", defaultColor, className)}\n\t\t\tsvg={svg ?? defaultIcon}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\nAlertDialogIcon.displayName = \"AlertDialogIcon\";\n\nexport {\n\t//,\n\tAlertDialog,\n\tAlertDialogAction,\n\tAlertDialogBody,\n\tAlertDialogCancel,\n\tAlertDialogContent,\n\tAlertDialogDescription,\n\tAlertDialogFooter,\n\tAlertDialogHeader,\n\tAlertDialogIcon,\n\tAlertDialogTitle,\n\tAlertDialogTrigger,\n};\n"],"mappings":"4MAEA,OAAS,QAAAA,MAAY,6BACrB,OAAS,WAAAC,MAAe,gCACxB,UAAYC,MAA0B,+BACtC,OACC,iBAAAC,EACA,cAAAC,EACA,cAAAC,MAKM,QACP,OAAOC,MAAe,iBAmCnB,cAAAC,EAuCF,QAAAC,MAvCE,oBAtBH,IAAMC,EAAqBC,EAA8C,IAAI,EAE7E,SAASC,GAAwB,CAChC,I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AC0B,EAAA,EAAK,EAEpE,OACC1B,EAAC2B,EAAA,CACA,IAAKrB,EACL,UAAWC,EAAG,oBAAqBgB,EAAclB,CAAS,EAC1D,IAAKiB,GAAOE,EACX,GAAGzB,EACL,CAEF,CAAC,EACDsB,EAAgB,YAAc","names":["Info","Warning","AlertDialogPrimitive","createContext","forwardRef","useContext","invariant","jsx","jsxs","AlertDialogContext","createContext","useAlertDialogContext","context","useContext","invariant","AlertDialog","priority","props","jsx","AlertDialogTrigger","AlertDialogPortal","AlertDialogOverlay","forwardRef","className","ref","cx","AlertDialogContent","jsxs","AlertDialogBody","AlertDialogHeader","AlertDialogFooter","AlertDialogTitle","AlertDialogDescription","AlertDialogAction","appearance","ctx","buttonPriority","Button","AlertDialogCancel","AlertDialogIcon","svg","defaultColor","defaultIcon","Warning","Info","SvgOnly"]}
1
+ {"version":3,"sources":["../src/components/alert-dialog/alert-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { Info } from \"@phosphor-icons/react/Info\";\nimport { Warning } from \"@phosphor-icons/react/Warning\";\nimport * as AlertDialogPrimitive from \"@radix-ui/react-dialog\";\nimport {\n\tcreateContext,\n\tforwardRef,\n\tuseContext,\n\ttype ComponentProps,\n\ttype ComponentPropsWithoutRef,\n\ttype ElementRef,\n\ttype ReactNode,\n} from \"react\";\nimport invariant from \"tiny-invariant\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport { Button, type ButtonPriority, type ButtonProps } from \"../button/button.js\";\nimport { SvgOnly } from \"../icon/svg-only.js\";\nimport type { SvgAttributes } from \"../icon/types.js\";\n\nconst priorities = [\"info\", \"danger\"] as const;\ntype Priority = (typeof priorities)[number];\n\ntype AlertDialogContextValue = {\n\tpriority: Priority;\n};\n\nconst AlertDialogContext = createContext<AlertDialogContextValue | null>(null);\n\nfunction useAlertDialogContext() {\n\tconst context = useContext(AlertDialogContext);\n\tinvariant(context, \"AlertDialog child component used outside of AlertDialog parent!\");\n\treturn context;\n}\n\ntype AlertDialogProps = ComponentProps<typeof AlertDialogPrimitive.Root> & {\n\t/**\n\t * Indicates the importance or impact level of the AlertDialog, affecting its\n\t * color and styling to communicate its purpose to the user.\n\t */\n\tpriority: Priority;\n};\n\n/**\n * The root component for the Alert Dialog\n */\nfunction AlertDialog({ priority, ...props }: AlertDialogProps) {\n\treturn (\n\t\t<AlertDialogContext.Provider value={{ priority }}>\n\t\t\t<AlertDialogPrimitive.Root {...props} />\n\t\t</AlertDialogContext.Provider>\n\t);\n}\nAlertDialog.displayName = \"AlertDialog\";\n\n/**\n * A button that opens the Alert Dialog.\n */\nconst AlertDialogTrigger = AlertDialogPrimitive.Trigger;\n\nconst AlertDialogPortal = AlertDialogPrimitive.Portal;\n\n/**\n * A layer that covers the inert portion of the view when the dialog is open.\n */\nconst AlertDialogOverlay = forwardRef<\n\tElementRef<typeof AlertDialogPrimitive.Overlay>,\n\tComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n\t<AlertDialogPrimitive.Overlay\n\t\tclassName={cx(\n\t\t\t\"data-state-open:animate-in data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:fade-in-0 bg-overlay fixed inset-0 z-50 backdrop-blur-sm\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t\tref={ref}\n\t/>\n));\nAlertDialogOverlay.displayName = \"AlertDialogOverlay\";\n\n/**\n * The popover alert dialog container.\n *\n * Renders on top of the overlay and is centered in the viewport.\n */\nconst AlertDialogContent = forwardRef<\n\tElementRef<typeof AlertDialogPrimitive.Content>,\n\tComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>\n>(({ className, ...props }, ref) => (\n\t<AlertDialogPortal>\n\t\t<AlertDialogOverlay />\n\t\t<div className=\"fixed inset-4 z-50 flex items-center justify-center\">\n\t\t\t<AlertDialogPrimitive.Content\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cx(\n\t\t\t\t\t\"flex w-full max-w-md flex-1 flex-col items-center gap-4 sm:flex-row sm:items-start\",\n\t\t\t\t\t\"outline-none focus-within:outline-none\",\n\t\t\t\t\t\"p-6\",\n\t\t\t\t\t\"border-dialog bg-dialog rounded-xl border shadow-lg transition-transform duration-200\",\n\t\t\t\t\t\"data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</div>\n\t</AlertDialogPortal>\n));\nAlertDialogContent.displayName = \"AlertDialogContent\";\n\n/**\n * Contains the main content of the dialog.\n */\nconst AlertDialogBody = ({ className, ...props }: ComponentProps<\"div\">) => (\n\t<div className={cx(\"flex-1 space-y-4\", className)} {...props} />\n);\nAlertDialogBody.displayName = \"AlertDialogBody\";\n\n/**\n * Contains the header content of the dialog, including the title and description.\n */\nconst AlertDialogHeader = ({ className, ...props }: ComponentProps<\"div\">) => (\n\t<div className={cx(\"flex flex-col space-y-2 text-center sm:text-start\", className)} {...props} />\n);\nAlertDialogHeader.displayName = \"AlertDialogHeader\";\n\n/**\n * Contains the footer content of the dialog, including the action and cancel buttons.\n */\nconst AlertDialogFooter = ({ className, ...props }: ComponentProps<\"div\">) => (\n\t<div className={cx(\"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\", className)} {...props} />\n);\nAlertDialogFooter.displayName = \"AlertDialogFooter\";\n\n/**\n * An accessible name to be announced when the dialog is opened.\n *\n * Alternatively, you can provide `aria-label` or `aria-labelledby` to\n * `AlertDialogContent` and exclude this component.\n */\nconst AlertDialogTitle = forwardRef<\n\tElementRef<typeof AlertDialogPrimitive.Title>,\n\tComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n\t<AlertDialogPrimitive.Title\n\t\tref={ref}\n\t\tclassName={cx(\"text-strong text-center text-xl font-medium sm:text-start sm:text-lg\", className)}\n\t\t{...props}\n\t/>\n));\nAlertDialogTitle.displayName = \"AlertDialogTitle\";\n\n/**\n * An accessible description to be announced when the dialog is opened.\n *\n * Alternatively, you can provide `aria-describedby` to `AlertDialogContent` and\n * exclude this component.\n */\nconst AlertDialogDescription = forwardRef<\n\tElementRef<typeof AlertDialogPrimitive.Description>,\n\tComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n\t<AlertDialogPrimitive.Description\n\t\tref={ref}\n\t\tclassName={cx(\"text-body text-center text-base font-normal sm:text-start sm:text-sm\", className)}\n\t\t{...props}\n\t/>\n));\nAlertDialogDescription.displayName = \"AlertDialogDescription\";\n\n/**\n * A button that confirms the Alert Dialog action.\n * Will default to appearance=\"filled\", as well as the priority color from the `AlertDialog`.\n * Does not close the alert dialog by default.\n *\n * These buttons should be distinguished visually from the AlertDialogCancel button.\n *\n * Composes around the mantle Button component.\n */\nconst AlertDialogAction = forwardRef<ElementRef<\"button\">, ButtonProps>(\n\t(\n\t\t{\n\t\t\t//,\n\t\t\tappearance = \"filled\",\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst ctx = useAlertDialogContext();\n\t\tlet buttonPriority: NonNullable<ButtonPriority> = \"default\";\n\t\tif (ctx.priority === \"danger\") {\n\t\t\tbuttonPriority = \"danger\";\n\t\t}\n\n\t\treturn (\n\t\t\t<Button\n\t\t\t\t//\n\t\t\t\tappearance={appearance}\n\t\t\t\tpriority={buttonPriority}\n\t\t\t\tref={ref}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t},\n);\nAlertDialogAction.displayName = \"AlertDialogAction\";\n\n/**\n * A button that closes the dialog and cancels the action.\n * Will default to appearance=\"outlined\" and priority=\"neutral\".\n *\n * This button should be distinguished visually from AlertDialogAction buttons.\n *\n * Composes around the mantle Button component.\n */\nconst AlertDialogCancel = forwardRef<ElementRef<\"button\">, ButtonProps>(\n\t(\n\t\t{\n\t\t\t//,\n\t\t\tappearance = \"outlined\",\n\t\t\tclassName,\n\t\t\tpriority = \"neutral\",\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => (\n\t\t<AlertDialogPrimitive.Close asChild>\n\t\t\t<Button\n\t\t\t\tappearance={appearance}\n\t\t\t\tclassName={cx(\"mt-2 sm:mt-0\", className)}\n\t\t\t\tpriority={priority}\n\t\t\t\tref={ref}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</AlertDialogPrimitive.Close>\n\t),\n);\nAlertDialogCancel.displayName = \"AlertDialogCancel\";\n\ntype AlertDialogIconProps = Omit<SvgAttributes, \"children\"> & {\n\tsvg?: ReactNode;\n};\n\n/**\n * An icon that visually represents the priority of the AlertDialog.\n *\n * Defaults to a warning icon for danger priority and an info icon for info\n * priority with the appropriate color.\n *\n * Can be overridden with a custom icon using the `svg` prop.\n */\nconst AlertDialogIcon = forwardRef<ElementRef<\"svg\">, AlertDialogIconProps>(({ className, svg, ...props }, ref) => {\n\tconst ctx = useAlertDialogContext();\n\tconst defaultColor = ctx.priority === \"danger\" ? \"text-danger-600\" : \"text-accent-600\";\n\tconst defaultIcon = ctx.priority === \"danger\" ? <Warning /> : <Info />;\n\n\treturn (\n\t\t<SvgOnly\n\t\t\tref={ref}\n\t\t\tclassName={cx(\"size-12 sm:size-7\", defaultColor, className)}\n\t\t\tsvg={svg ?? defaultIcon}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\nAlertDialogIcon.displayName = \"AlertDialogIcon\";\n\nexport {\n\t//,\n\tAlertDialog,\n\tAlertDialogAction,\n\tAlertDialogBody,\n\tAlertDialogCancel,\n\tAlertDialogContent,\n\tAlertDialogDescription,\n\tAlertDialogFooter,\n\tAlertDialogHeader,\n\tAlertDialogIcon,\n\tAlertDialogTitle,\n\tAlertDialogTrigger,\n};\n"],"mappings":"4MAEA,OAAS,QAAAA,MAAY,6BACrB,OAAS,WAAAC,MAAe,gCACxB,UAAYC,MAA0B,yBACtC,OACC,iBAAAC,EACA,cAAAC,EACA,cAAAC,MAKM,QACP,OAAOC,MAAe,i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BAC/DO,EAAcP,EAAI,WAAa,SAAWjB,EAACyB,EAAA,EAAQ,EAAKzB,EAAC0B,EAAA,EAAK,EAEpE,OACC1B,EAAC2B,EAAA,CACA,IAAKrB,EACL,UAAWC,EAAG,oBAAqBgB,EAAclB,CAAS,EAC1D,IAAKiB,GAAOE,EACX,GAAGzB,EACL,CAEF,CAAC,EACDsB,EAAgB,YAAc","names":["Info","Warning","AlertDialogPrimitive","createContext","forwardRef","useContext","invariant","jsx","jsxs","AlertDialogContext","createContext","useAlertDialogContext","context","useContext","invariant","AlertDialog","priority","props","jsx","AlertDialogTrigger","AlertDialogPortal","AlertDialogOverlay","forwardRef","className","ref","cx","AlertDialogContent","jsxs","AlertDialogBody","AlertDialogHeader","AlertDialogFooter","AlertDialogTitle","AlertDialogDescription","AlertDialogAction","appearance","ctx","buttonPriority","Button","AlertDialogCancel","AlertDialogIcon","svg","defaultColor","defaultIcon","Warning","Info","SvgOnly"]}
package/dist/button.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { D as DeepNonNullable } from './deep-non-nullable-SmpSvoSd.js';
2
2
  import * as class_variance_authority from 'class-variance-authority';
3
3
  import * as react from 'react';
4
- import { ButtonHTMLAttributes, ReactNode, ComponentProps } from 'react';
4
+ import { ComponentProps, ReactNode, ButtonHTMLAttributes } from 'react';
5
5
  import * as class_variance_authority_types from 'class-variance-authority/types';
6
6
  import { V as VariantProps } from './variant-props-oDo2u-We.js';
7
7
  export { I as IconButton, a as IconButtonProps } from './icon-button-CZzW1XWB.js';
package/dist/button.js CHANGED
@@ -1,2 +1,2 @@
1
- import{a as c}from"./chunk-VTEPKCRP.js";import{a as b}from"./chunk-SELMU6YK.js";import{b as a}from"./chunk-QJ76A4YV.js";import"./chunk-4LSFAAZW.js";import"./chunk-RDMTCZPT.js";import"./chunk-CZPUIRJG.js";import"./chunk-VJPVAY5J.js";import"./chunk-EW5CFGXT.js";export{a as Button,c as ButtonGroup,b as IconButton};
1
+ import{a as c}from"./chunk-VTEPKCRP.js";import{a as b}from"./chunk-XLFJLMPU.js";import{b as a}from"./chunk-25GJN3ZK.js";import"./chunk-4LSFAAZW.js";import"./chunk-RDMTCZPT.js";import"./chunk-PMSTRJK7.js";import"./chunk-VJPVAY5J.js";import"./chunk-EW5CFGXT.js";export{a as Button,c as ButtonGroup,b as IconButton};
2
2
  //# sourceMappingURL=button.js.map
package/dist/calendar.js CHANGED
@@ -1,2 +1,2 @@
1
- import{a as d}from"./chunk-QJ76A4YV.js";import"./chunk-4LSFAAZW.js";import"./chunk-RDMTCZPT.js";import"./chunk-CZPUIRJG.js";import"./chunk-VJPVAY5J.js";import{a as e}from"./chunk-EW5CFGXT.js";import{CaretLeft as s}from"@phosphor-icons/react/dist/icons/CaretLeft";import{CaretRight as i}from"@phosphor-icons/react/dist/icons/CaretRight";import{DayPicker as c}from"react-day-picker";import{jsx as t}from"react/jsx-runtime";function r({className:o,classNames:n,showOutsideDays:l=!1,...a}){return t(c,{showOutsideDays:l,className:e("",o),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"flex items-center",nav_button:e(d({appearance:"ghost",priority:"neutral"}),"sm:h-7 sm:w-7 h-7 w-7"),nav_button_previous:"absolute left-0",nav_button_next:"absolute right-0",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-body w-7 text-[0.8rem] text-center font-normal",row:"flex w-full mt-1",cell:e("overflow-hidden text-center text-sm p-0 relative focus-within:relative focus-within:z-20 sm:h-7 sm:w-7 h-7 w-7 ",a.mode==="range"?"first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":""),day:"day size-full rounded-md [&:not([aria-selected],_[disabled])]:hover:bg-filled-accent/15",day_range_start:"day-range-start [&:not(.day-range-end)]:rounded-r-none",day_range_end:"day-range-end [&:not(.day-range-start)]:rounded-l-none",day_selected:"[&:not([disabled])]:bg-filled-accent text-on-filled [&:not([disabled])]:hover:bg-filled-accent",day_today:"[&:not([aria-selected],_[disabled])]:text-accent-600 font-medium [&:not([aria-selected],_[disabled])]:bg-filled-accent/10",day_outside:"day-outside aria-selected:text-on-filled opacity-50 text-muted",day_disabled:"text-muted opacity-50",day_range_middle:"day-range-middle [&:not([disabled])]:aria-selected:bg-filled-accent/15 aria-selected:text-strong rounded-none [&:not([disabled])]:aria-selected:hover:bg-filled-accent/25",day_hidden:"invisible",...n},components:{IconLeft:()=>t(s,{className:"h-4 w-4 shrink-0",weight:"bold"}),IconRight:()=>t(i,{className:"h-4 w-4 shrink-0",weight:"bold"})},...a})}r.displayName="Calendar";export{r as Calendar};
1
+ import{a as d}from"./chunk-25GJN3ZK.js";import"./chunk-4LSFAAZW.js";import"./chunk-RDMTCZPT.js";import"./chunk-PMSTRJK7.js";import"./chunk-VJPVAY5J.js";import{a as e}from"./chunk-EW5CFGXT.js";import{CaretLeft as s}from"@phosphor-icons/react/dist/icons/CaretLeft";import{CaretRight as i}from"@phosphor-icons/react/dist/icons/CaretRight";import{DayPicker as c}from"react-day-picker";import{jsx as t}from"react/jsx-runtime";function r({className:o,classNames:n,showOutsideDays:l=!1,...a}){return t(c,{showOutsideDays:l,className:e("",o),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"flex items-center",nav_button:e(d({appearance:"ghost",priority:"neutral"}),"sm:h-7 sm:w-7 h-7 w-7"),nav_button_previous:"absolute left-0",nav_button_next:"absolute right-0",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-body w-7 text-[0.8rem] text-center font-normal",row:"flex w-full mt-1",cell:e("overflow-hidden text-center text-sm p-0 relative focus-within:relative focus-within:z-20 sm:h-7 sm:w-7 h-7 w-7 ",a.mode==="range"?"first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":""),day:"day size-full rounded-md [&:not([aria-selected],_[disabled])]:hover:bg-filled-accent/15",day_range_start:"day-range-start [&:not(.day-range-end)]:rounded-r-none",day_range_end:"day-range-end [&:not(.day-range-start)]:rounded-l-none",day_selected:"[&:not([disabled])]:bg-filled-accent text-on-filled [&:not([disabled])]:hover:bg-filled-accent",day_today:"[&:not([aria-selected],_[disabled])]:text-accent-600 font-medium [&:not([aria-selected],_[disabled])]:bg-filled-accent/10",day_outside:"day-outside aria-selected:text-on-filled opacity-50 text-muted",day_disabled:"text-muted opacity-50",day_range_middle:"day-range-middle [&:not([disabled])]:aria-selected:bg-filled-accent/15 aria-selected:text-strong rounded-none [&:not([disabled])]:aria-selected:hover:bg-filled-accent/25",day_hidden:"invisible",...n},components:{IconLeft:()=>t(s,{className:"h-4 w-4 shrink-0",weight:"bold"}),IconRight:()=>t(i,{className:"h-4 w-4 shrink-0",weight:"bold"})},...a})}r.displayName="Calendar";export{r as Calendar};
2
2
  //# sourceMappingURL=calendar.js.map
@@ -1,2 +1,2 @@
1
- import{a as u}from"./chunk-RDMTCZPT.js";import{a as g}from"./chunk-CZPUIRJG.js";import{a as p}from"./chunk-EW5CFGXT.js";import{CircleNotch as k}from"@phosphor-icons/react/CircleNotch";import{Slot as N}from"@radix-ui/react-slot";import{cva as I}from"class-variance-authority";import f from"clsx";import{Children as w,cloneElement as E,forwardRef as H,isValidElement as M}from"react";import T from"tiny-invariant";import{jsx as t,jsxs as S}from"react/jsx-runtime";var A=I("inline-flex cursor-pointer items-center justify-center gap-1.5 whitespace-nowrap rounded-md text-base focus-within:outline-none focus-visible:ring-4 disabled:cursor-default disabled:opacity-50 sm:text-sm [&>*]:focus-within:outline-none",{variants:{appearance:{filled:"bg-filled-accent text-on-filled focus-visible:border-accent-600 focus-visible:ring-focus-accent not-disabled:hover:bg-filled-accent-hover not-disabled:active:bg-filled-accent-active h-11 border border-transparent px-3 font-medium sm:h-9",ghost:"text-accent-600 focus-visible:ring-focus-accent not-disabled:hover:bg-accent-500/10 not-disabled:hover:text-accent-700 not-disabled:active:bg-accent-500/15 not-disabled:active:text-accent-700 h-11 border border-transparent px-3 font-medium sm:h-9",outlined:"border-accent-600 bg-form text-accent-600 focus-visible:ring-focus-accent not-disabled:hover:border-accent-700 not-disabled:hover:bg-accent-500/10 not-disabled:hover:text-accent-700 not-disabled:active:border-accent-700 not-disabled:active:bg-accent-500/15 not-disabled:active:text-accent-700 h-11 border px-3 font-medium sm:h-9",link:"text-accent-600 focus-visible:ring-focus-accent not-disabled:hover:underline group border-transparent"},isLoading:{false:"",true:"opacity-50"},priority:{danger:"",default:"",neutral:""}},defaultVariants:{appearance:"outlined",isLoading:!1,priority:"default"},compoundVariants:[{appearance:"ghost",priority:"danger",class:"text-danger-600 focus-visible:ring-focus-danger not-disabled:hover:bg-danger-500/10 not-disabled:hover:text-danger-700 not-disabled:active:bg-danger-500/15 not-disabled:active:text-danger-700 border-transparent"},{appearance:"outlined",priority:"danger",class:"border-danger-600 bg-form text-danger-600 focus-visible:ring-focus-danger not-disabled:hover:border-danger-700 not-disabled:hover:bg-danger-500/10 not-disabled:hover:text-danger-700 not-disabled:active:border-danger-700 not-disabled:active:bg-danger-500/15 not-disabled:active:text-danger-700"},{appearance:"filled",priority:"danger",class:"bg-filled-danger focus-visible:border-danger-600 focus-visible:ring-focus-danger not-disabled:hover:bg-filled-danger-hover not-disabled:active:bg-filled-danger-active border-transparent"},{appearance:"link",priority:"danger",class:"text-danger-600 focus-visible:ring-focus-danger"},{appearance:"ghost",priority:"neutral",class:"text-strong focus-visible:ring-focus-accent not-disabled:hover:bg-neutral-500/10 not-disabled:hover:text-strong not-disabled:active:bg-neutral-500/15 not-disabled:active:text-strong border-transparent"},{appearance:"outlined",priority:"neutral",class:"border-form bg-form text-strong focus-visible:border-accent-600 focus-visible:ring-focus-accent not-disabled:hover:border-neutral-400 not-disabled:hover:bg-form-hover not-disabled:hover:text-strong not-disabled:active:border-neutral-400 not-disabled:active:bg-neutral-500/10 not-disabled:active:text-strong focus-visible:not-disabled:active:border-accent-600"},{appearance:"filled",priority:"neutral",class:"bg-filled-neutral focus-visible:ring-focus-neutral not-disabled:hover:bg-filled-neutral-hover not-disabled:active:bg-filled-neutral-active border-transparent focus-visible:border-neutral-600"},{appearance:"link",priority:"neutral",class:"text-strong focus-visible:ring-focus-accent"}]}),L=H(({"aria-disabled":i,appearance:e="outlined",asChild:n,children:r,className:m,disabled:h,icon:y,iconPlacement:a="start",isLoading:o=!1,priority:x="default",type:B,...P},C)=>{let c=u(i??h??o),s=o?t(k,{className:"animate-spin"}):y,l=s&&e!=="link",b={"aria-disabled":c,className:p(A({appearance:e,priority:x,isLoading:o}),l&&a==="start"&&"ps-2.5",l&&a==="end"&&"pe-2.5",m),"data-loading":o,disabled:c,ref:C,...P};if(n){let d=w.only(r);T(M(d),"When using `asChild`, Button must be passed a single child as a JSX tag.");let V=d.props?.children;return t(N,{...b,children:E(d,{},t(v,{appearance:e,icon:s,iconPlacement:a,children:V}))})}return t("button",{...b,type:B,children:t(v,{appearance:e,icon:s,iconPlacement:a,children:r})})});L.displayName="Button";var v=({appearance:i,children:e,icon:n,iconPlacement:r})=>S("span",{className:f("inline-flex items-center gap-1.5 focus-within:outline-none focus-visible:outline-none",i==="link"&&"not-disabled:group-hover:underline"),children:[n&&t(g,{svg:n,className:f(r==="end"&&"order-last")}),e]});export{A as a,L as b};
2
- //# sourceMappingURL=chunk-QJ76A4YV.js.map
1
+ import{a as u}from"./chunk-RDMTCZPT.js";import{a as g}from"./chunk-PMSTRJK7.js";import{a as p}from"./chunk-EW5CFGXT.js";import{CircleNotch as k}from"@phosphor-icons/react/CircleNotch";import{Slot as N}from"@radix-ui/react-slot";import{cva as I}from"class-variance-authority";import f from"clsx";import{Children as w,cloneElement as E,forwardRef as H,isValidElement as M}from"react";import T from"tiny-invariant";import{jsx as t,jsxs as S}from"react/jsx-runtime";var A=I("inline-flex cursor-pointer items-center justify-center gap-1.5 whitespace-nowrap rounded-md text-base focus-within:outline-none focus-visible:ring-4 disabled:cursor-default disabled:opacity-50 sm:text-sm [&>*]:focus-within:outline-none",{variants:{appearance:{filled:"bg-filled-accent text-on-filled focus-visible:border-accent-600 focus-visible:ring-focus-accent not-disabled:hover:bg-filled-accent-hover not-disabled:active:bg-filled-accent-active h-11 border border-transparent px-3 font-medium sm:h-9",ghost:"text-accent-600 focus-visible:ring-focus-accent not-disabled:hover:bg-accent-500/10 not-disabled:hover:text-accent-700 not-disabled:active:bg-accent-500/15 not-disabled:active:text-accent-700 h-11 border border-transparent px-3 font-medium sm:h-9",outlined:"border-accent-600 bg-form text-accent-600 focus-visible:ring-focus-accent not-disabled:hover:border-accent-700 not-disabled:hover:bg-accent-500/10 not-disabled:hover:text-accent-700 not-disabled:active:border-accent-700 not-disabled:active:bg-accent-500/15 not-disabled:active:text-accent-700 h-11 border px-3 font-medium sm:h-9",link:"text-accent-600 focus-visible:ring-focus-accent not-disabled:hover:underline group border-transparent"},isLoading:{false:"",true:"opacity-50"},priority:{danger:"",default:"",neutral:""}},defaultVariants:{appearance:"outlined",isLoading:!1,priority:"default"},compoundVariants:[{appearance:"ghost",priority:"danger",class:"text-danger-600 focus-visible:ring-focus-danger not-disabled:hover:bg-danger-500/10 not-disabled:hover:text-danger-700 not-disabled:active:bg-danger-500/15 not-disabled:active:text-danger-700 border-transparent"},{appearance:"outlined",priority:"danger",class:"border-danger-600 bg-form text-danger-600 focus-visible:ring-focus-danger not-disabled:hover:border-danger-700 not-disabled:hover:bg-danger-500/10 not-disabled:hover:text-danger-700 not-disabled:active:border-danger-700 not-disabled:active:bg-danger-500/15 not-disabled:active:text-danger-700"},{appearance:"filled",priority:"danger",class:"bg-filled-danger focus-visible:border-danger-600 focus-visible:ring-focus-danger not-disabled:hover:bg-filled-danger-hover not-disabled:active:bg-filled-danger-active border-transparent"},{appearance:"link",priority:"danger",class:"text-danger-600 focus-visible:ring-focus-danger"},{appearance:"ghost",priority:"neutral",class:"text-strong focus-visible:ring-focus-accent not-disabled:hover:bg-neutral-500/10 not-disabled:hover:text-strong not-disabled:active:bg-neutral-500/15 not-disabled:active:text-strong border-transparent"},{appearance:"outlined",priority:"neutral",class:"border-form bg-form text-strong focus-visible:border-accent-600 focus-visible:ring-focus-accent not-disabled:hover:border-neutral-400 not-disabled:hover:bg-form-hover not-disabled:hover:text-strong not-disabled:active:border-neutral-400 not-disabled:active:bg-neutral-500/10 not-disabled:active:text-strong focus-visible:not-disabled:active:border-accent-600"},{appearance:"filled",priority:"neutral",class:"bg-filled-neutral focus-visible:ring-focus-neutral not-disabled:hover:bg-filled-neutral-hover not-disabled:active:bg-filled-neutral-active border-transparent focus-visible:border-neutral-600"},{appearance:"link",priority:"neutral",class:"text-strong focus-visible:ring-focus-accent"}]}),L=H(({"aria-disabled":i,appearance:e="outlined",asChild:n,children:r,className:m,disabled:h,icon:y,iconPlacement:a="start",isLoading:o=!1,priority:x="default",type:B,...P},C)=>{let c=u(i??h??o),s=o?t(k,{className:"animate-spin"}):y,l=s&&e!=="link",b={"aria-disabled":c,className:p(A({appearance:e,priority:x,isLoading:o}),l&&a==="start"&&"ps-2.5",l&&a==="end"&&"pe-2.5",m),"data-loading":o,disabled:c,ref:C,...P};if(n){let d=w.only(r);T(M(d),"When using `asChild`, Button must be passed a single child as a JSX tag.");let V=d.props?.children;return t(N,{...b,children:E(d,{},t(v,{appearance:e,icon:s,iconPlacement:a,children:V}))})}return t("button",{...b,type:B,children:t(v,{appearance:e,icon:s,iconPlacement:a,children:r})})});L.displayName="Button";var v=({appearance:i,children:e,icon:n,iconPlacement:r})=>S("span",{className:f("inline-flex items-center gap-1.5 focus-within:outline-none focus-visible:outline-none",i==="link"&&"not-disabled:group-hover:underline"),children:[n&&t(g,{svg:n,className:f(r==="end"&&"order-last")}),e]});export{A as a,L as b};
2
+ //# sourceMappingURL=chunk-25GJN3ZK.js.map
@@ -0,0 +1,2 @@
1
+ import{a as o}from"./chunk-VJPVAY5J.js";import{a as e}from"./chunk-EW5CFGXT.js";import{forwardRef as y}from"react";import{jsx as n}from"react/jsx-runtime";var f=y(({className:t,style:r,svg:p,...s},m)=>n(o,{ref:m,className:e("size-6 sm:size-5",t),style:r,svg:p,...s}));export{f as a};
2
+ //# sourceMappingURL=chunk-PMSTRJK7.js.map
@@ -1,2 +1,2 @@
1
- import{a as l}from"./chunk-RDMTCZPT.js";import{a as o}from"./chunk-CZPUIRJG.js";import{a as d}from"./chunk-EW5CFGXT.js";import{CircleNotch as V}from"@phosphor-icons/react/CircleNotch";import{Slot as z}from"@radix-ui/react-slot";import{cva as C}from"class-variance-authority";import{Children as H,cloneElement as I,forwardRef as M,isValidElement as T}from"react";import{jsx as t,jsxs as A}from"react/jsx-runtime";var E=C("inline-flex shrink-0 cursor-pointer items-center justify-center rounded-[var(--icon-button-border-radius,0.375rem)] border focus-within:outline-none focus-visible:ring-4 disabled:cursor-default disabled:opacity-50",{variants:{appearance:{ghost:"text-strong focus-visible:ring-focus-accent not-disabled:hover:bg-neutral-500/10 not-disabled:hover:text-strong not-disabled:active:bg-neutral-500/15 not-disabled:active:text-strong border-transparent",outlined:"border-form bg-form text-strong focus-visible:border-accent-600 focus-visible:ring-focus-accent not-disabled:hover:border-neutral-400 not-disabled:hover:bg-form-hover not-disabled:hover:text-strong not-disabled:active:border-neutral-400 not-disabled:active:bg-neutral-500/10 not-disabled:active:text-strong focus-visible:not-disabled:active:border-accent-600"},isLoading:{false:"",true:"opacity-50"},size:{xs:"size-7 sm:size-6",sm:"size-9 sm:size-7",md:"size-11 sm:size-9"}},defaultVariants:{appearance:"outlined",size:"md"}}),N=M(({"aria-disabled":c,appearance:u,asChild:b=!1,children:p,className:m,disabled:f,icon:v,isLoading:e=!1,label:h,size:n,type:g,...y},B)=>{let i=l(c??f??e),r=e?t(V,{className:"animate-spin"}):v,s={"aria-disabled":i,className:d("icon-button",E({appearance:u,isLoading:e,size:n}),m),"data-loading":e,"data-size":n,disabled:i,ref:B,...y};if(b){let a=H.only(p),x=T(a);return t(z,{...s,children:x&&I(a,{},t(o,{svg:r}))})}return A("button",{...s,type:g,children:[t("span",{className:"sr-only",children:h}),t(o,{svg:r})]})});N.displayName="IconButton";export{N as a};
2
- //# sourceMappingURL=chunk-SELMU6YK.js.map
1
+ import{a as l}from"./chunk-RDMTCZPT.js";import{a as o}from"./chunk-PMSTRJK7.js";import{a as d}from"./chunk-EW5CFGXT.js";import{CircleNotch as V}from"@phosphor-icons/react/CircleNotch";import{Slot as z}from"@radix-ui/react-slot";import{cva as C}from"class-variance-authority";import{Children as H,cloneElement as I,forwardRef as M,isValidElement as T}from"react";import{jsx as t,jsxs as A}from"react/jsx-runtime";var E=C("inline-flex shrink-0 cursor-pointer items-center justify-center rounded-[var(--icon-button-border-radius,0.375rem)] border focus-within:outline-none focus-visible:ring-4 disabled:cursor-default disabled:opacity-50",{variants:{appearance:{ghost:"text-strong focus-visible:ring-focus-accent not-disabled:hover:bg-neutral-500/10 not-disabled:hover:text-strong not-disabled:active:bg-neutral-500/15 not-disabled:active:text-strong border-transparent",outlined:"border-form bg-form text-strong focus-visible:border-accent-600 focus-visible:ring-focus-accent not-disabled:hover:border-neutral-400 not-disabled:hover:bg-form-hover not-disabled:hover:text-strong not-disabled:active:border-neutral-400 not-disabled:active:bg-neutral-500/10 not-disabled:active:text-strong focus-visible:not-disabled:active:border-accent-600"},isLoading:{false:"",true:"opacity-50"},size:{xs:"size-7 sm:size-6",sm:"size-9 sm:size-7",md:"size-11 sm:size-9"}},defaultVariants:{appearance:"outlined",size:"md"}}),N=M(({"aria-disabled":c,appearance:u,asChild:b=!1,children:p,className:m,disabled:f,icon:v,isLoading:e=!1,label:h,size:n,type:g,...y},B)=>{let i=l(c??f??e),r=e?t(V,{className:"animate-spin"}):v,s={"aria-disabled":i,className:d("icon-button",E({appearance:u,isLoading:e,size:n}),m),"data-loading":e,"data-size":n,disabled:i,ref:B,...y};if(b){let a=H.only(p),x=T(a);return t(z,{...s,children:x&&I(a,{},t(o,{svg:r}))})}return A("button",{...s,type:g,children:[t("span",{className:"sr-only",children:h}),t(o,{svg:r})]})});N.displayName="IconButton";export{N as a};
2
+ //# sourceMappingURL=chunk-XLFJLMPU.js.map
package/dist/dialog.js CHANGED
@@ -1,2 +1,2 @@
1
- import{a as m}from"./chunk-SELMU6YK.js";import"./chunk-4LSFAAZW.js";import"./chunk-RDMTCZPT.js";import"./chunk-CZPUIRJG.js";import"./chunk-VJPVAY5J.js";import{a as l}from"./chunk-EW5CFGXT.js";import{X as u}from"@phosphor-icons/react/X";import*as e from"@radix-ui/react-dialog";import{forwardRef as r}from"react";import{jsx as i,jsxs as N}from"react/jsx-runtime";var P=e.Root,x=e.Trigger,g=e.Portal,C=e.Close,s=r(({className:o,...t},a)=>i(e.Overlay,{ref:a,className:l("bg-overlay data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:animate-in data-state-open:fade-in-0 fixed inset-0 z-50 backdrop-blur-sm",o),...t}));s.displayName=e.Overlay.displayName;var d=r(({className:o,children:t,...a},n)=>N(g,{children:[i(s,{}),i("div",{className:"fixed inset-4 z-50 flex items-center justify-center",children:i(e.Content,{className:l("flex max-h-full w-full max-w-lg flex-1 flex-col","outline-none focus-within:outline-none","border-dialog bg-dialog rounded-xl border shadow-lg transition-transform duration-200","data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95",o),ref:n,...a,children:t})})]}));d.displayName=e.Content.displayName;var p=({className:o,children:t,...a})=>i("div",{className:l("border-dialog-muted text-strong relative flex shrink-0 items-center justify-between gap-2 border-b px-6 py-4","has-[.icon-button]:pr-4",o),...a,children:t});p.displayName="DialogHeader";var b=({size:o="md",type:t="button",label:a="Close Dialog",appearance:n="ghost",...y})=>i(e.Close,{asChild:!0,children:i(m,{appearance:n,icon:i(u,{}),label:a,size:o,type:t,...y})}),D=({className:o,...t})=>i("div",{className:l("scrollbar text-body flex-1 overflow-y-auto p-6",o),...t});D.displayName="DialogBody";var c=({className:o,...t})=>i("div",{className:l("border-dialog-muted flex shrink-0 flex-row-reverse gap-2 border-t px-6 py-4",o),...t});c.displayName="DialogFooter";var f=r(({className:o,...t},a)=>i(e.Title,{ref:a,className:l("text-strong truncate text-lg font-medium",o),...t}));f.displayName=e.Title.displayName;var v=r(({className:o,...t},a)=>i(e.Description,{ref:a,className:l("text-muted",o),...t}));v.displayName=e.Description.displayName;export{P as Dialog,D as DialogBody,C as DialogClose,b as DialogCloseIconButton,d as DialogContent,v as DialogDescription,c as DialogFooter,p as DialogHeader,s as DialogOverlay,g as DialogPortal,f as DialogTitle,x as DialogTrigger};
1
+ import{a as m}from"./chunk-XLFJLMPU.js";import"./chunk-4LSFAAZW.js";import"./chunk-RDMTCZPT.js";import"./chunk-PMSTRJK7.js";import"./chunk-VJPVAY5J.js";import{a as l}from"./chunk-EW5CFGXT.js";import{X as u}from"@phosphor-icons/react/X";import*as e from"@radix-ui/react-dialog";import{forwardRef as r}from"react";import{jsx as i,jsxs as N}from"react/jsx-runtime";var P=e.Root,x=e.Trigger,g=e.Portal,C=e.Close,s=r(({className:o,...t},a)=>i(e.Overlay,{ref:a,className:l("bg-overlay data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:animate-in data-state-open:fade-in-0 fixed inset-0 z-50 backdrop-blur-sm",o),...t}));s.displayName=e.Overlay.displayName;var d=r(({className:o,children:t,...a},n)=>N(g,{children:[i(s,{}),i("div",{className:"fixed inset-4 z-50 flex items-center justify-center",children:i(e.Content,{className:l("flex max-h-full w-full max-w-lg flex-1 flex-col","outline-none focus-within:outline-none","border-dialog bg-dialog rounded-xl border shadow-lg transition-transform duration-200","data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95",o),ref:n,...a,children:t})})]}));d.displayName=e.Content.displayName;var p=({className:o,children:t,...a})=>i("div",{className:l("border-dialog-muted text-strong relative flex shrink-0 items-center justify-between gap-2 border-b px-6 py-4","has-[.icon-button]:pr-4",o),...a,children:t});p.displayName="DialogHeader";var b=({size:o="md",type:t="button",label:a="Close Dialog",appearance:n="ghost",...y})=>i(e.Close,{asChild:!0,children:i(m,{appearance:n,icon:i(u,{}),label:a,size:o,type:t,...y})}),D=({className:o,...t})=>i("div",{className:l("scrollbar text-body flex-1 overflow-y-auto p-6",o),...t});D.displayName="DialogBody";var c=({className:o,...t})=>i("div",{className:l("border-dialog-muted flex shrink-0 flex-row-reverse gap-2 border-t px-6 py-4",o),...t});c.displayName="DialogFooter";var f=r(({className:o,...t},a)=>i(e.Title,{ref:a,className:l("text-strong truncate text-lg font-medium",o),...t}));f.displayName=e.Title.displayName;var v=r(({className:o,...t},a)=>i(e.Description,{ref:a,className:l("text-muted",o),...t}));v.displayName=e.Description.displayName;export{P as Dialog,D as DialogBody,C as DialogClose,b as DialogCloseIconButton,d as DialogContent,v as DialogDescription,c as DialogFooter,p as DialogHeader,s as DialogOverlay,g as DialogPortal,f as DialogTitle,x as DialogTrigger};
2
2
  //# sourceMappingURL=dialog.js.map
package/dist/icon.d.ts CHANGED
@@ -40,4 +40,4 @@ type SvgOnlyProps = Omit<SvgAttributes, "children"> & {
40
40
  */
41
41
  declare const SvgOnly: react.ForwardRefExoticComponent<Omit<SvgOnlyProps, "ref"> & react.RefAttributes<SVGSVGElement>>;
42
42
 
43
- export { Icon, type IconProps, SvgAttributes, SvgOnly };
43
+ export { Icon, type IconProps, SvgAttributes, SvgOnly, type SvgOnlyProps };
package/dist/icon.js CHANGED
@@ -1,2 +1,2 @@
1
- import{a as b}from"./chunk-CZPUIRJG.js";import{a}from"./chunk-VJPVAY5J.js";import"./chunk-EW5CFGXT.js";export{b as Icon,a as SvgOnly};
1
+ import{a as b}from"./chunk-PMSTRJK7.js";import{a}from"./chunk-VJPVAY5J.js";import"./chunk-EW5CFGXT.js";export{b as Icon,a as SvgOnly};
2
2
  //# sourceMappingURL=icon.js.map
@@ -1,2 +1,2 @@
1
- import{a as b,c as v,d as x,e as y,g as h}from"./chunk-6ZEJCZAD.js";import{b as z}from"./chunk-CXQLUXDJ.js";import{a as d}from"./chunk-VTEPKCRP.js";import{a as l}from"./chunk-SELMU6YK.js";import"./chunk-QJ76A4YV.js";import"./chunk-4LSFAAZW.js";import"./chunk-RDMTCZPT.js";import"./chunk-CZPUIRJG.js";import"./chunk-VJPVAY5J.js";import{a as p}from"./chunk-EW5CFGXT.js";import"./chunk-5E73VWJX.js";import{CaretLeft as j}from"@phosphor-icons/react/dist/icons/CaretLeft";import{CaretRight as k}from"@phosphor-icons/react/dist/icons/CaretRight";import{Slot as A}from"@radix-ui/react-slot";import{createContext as F,forwardRef as m,useContext as N,useState as W}from"react";import P from"tiny-invariant";import{jsx as s,jsxs as f}from"react/jsx-runtime";var c=F(void 0),O=m(({className:n,children:e,defaultPageSize:a,...t},i)=>{let[o,r]=W(a);return s(c.Provider,{value:{defaultPageSize:a,pageSize:o,setPageSize:r},children:s("div",{className:p("inline-flex items-center justify-between gap-2",n),ref:i,...t,children:e})})});O.displayName="CursorPagination";var T=m(({hasNextPage:n,hasPreviousPage:e,onNextPage:a,onPreviousPage:t,...i},o)=>f(d,{appearance:"panel",ref:o,...i,children:[s(l,{appearance:"ghost",disabled:!e,icon:s(j,{}),label:"Previous page",onClick:t,size:"sm",type:"button"}),s(z,{orientation:"vertical",className:"min-h-5"}),s(l,{appearance:"ghost",disabled:!n,icon:s(k,{}),label:"Next page",onClick:a,size:"sm",type:"button"})]}));T.displayName="CursorButtons";var $=[5,10,20,50,100],B=m(({className:n,pageSizes:e=$,onChangePageSize:a,...t},i)=>{let o=N(c);return P(o,"CursorPageSizeSelect must be used as a child of a CursorPagination component"),P(e.includes(o.defaultPageSize),"CursorPagination.defaultPageSize must be included in CursorPageSizeSelect.pageSizes"),P(e.includes(o.pageSize),"CursorPagination.pageSize must be included in CursorPageSizeSelect.pageSizes"),f(b,{defaultValue:`${o.pageSize}`,onChange:r=>{let g=Number.parseInt(r,10);Number.isNaN(g)&&(g=o.defaultPageSize),o.setPageSize(g),a?.(g)},children:[s(x,{ref:i,className:p("w-auto min-w-36",n),value:o.pageSize,...t,children:s(v,{})}),s(y,{width:"trigger",children:e.map(r=>f(h,{value:`${r}`,children:[r," per page"]},r))})]})});B.displayName="CursorPageSizeSelect";function D({asChild:n=!1,className:e,...a}){let t=N(c);return P(t,"CursorPageSizeValue must be used as a child of a CursorPagination component"),f(n?A:"span",{className:p("text-muted text-sm font-normal",e),...a,children:[t.pageSize," per page"]})}import{useEffect as V,useState as w}from"react";function H({listSize:n,pageSize:e}){let[a,t]=w(1),[i,o]=w(e);V(()=>{o(e),t(1)},[e]),V(()=>{t(1)},[n]);let r=Math.ceil(n/i),g=(a-1)*i,S=a>1,C=a<r;function M(u){let U=Math.max(1,Math.min(u,r));t(U)}function E(){C&&t(u=>Math.min(u+1,r))}function R(){S&&t(u=>Math.max(u-1,1))}function G(u){o(u),t(1)}function I(){t(r)}function L(){t(1)}return{currentPage:a,goToFirstPage:L,goToLastPage:I,goToPage:M,hasNextPage:C,hasPreviousPage:S,nextPage:E,offset:g,pageSize:i,previousPage:R,setPageSize:G,totalPages:r}}function q(n,e){return n.slice(e.offset,e.offset+e.pageSize)}export{T as CursorButtons,B as CursorPageSizeSelect,D as CursorPageSizeValue,O as CursorPagination,q as getOffsetPaginatedSlice,H as useOffsetPagination};
1
+ import{a as b,c as v,d as x,e as y,g as h}from"./chunk-6ZEJCZAD.js";import{b as z}from"./chunk-CXQLUXDJ.js";import{a as d}from"./chunk-VTEPKCRP.js";import{a as l}from"./chunk-XLFJLMPU.js";import"./chunk-25GJN3ZK.js";import"./chunk-4LSFAAZW.js";import"./chunk-RDMTCZPT.js";import"./chunk-PMSTRJK7.js";import"./chunk-VJPVAY5J.js";import{a as p}from"./chunk-EW5CFGXT.js";import"./chunk-5E73VWJX.js";import{CaretLeft as j}from"@phosphor-icons/react/dist/icons/CaretLeft";import{CaretRight as k}from"@phosphor-icons/react/dist/icons/CaretRight";import{Slot as A}from"@radix-ui/react-slot";import{createContext as F,forwardRef as m,useContext as N,useState as W}from"react";import P from"tiny-invariant";import{jsx as s,jsxs as f}from"react/jsx-runtime";var c=F(void 0),O=m(({className:n,children:e,defaultPageSize:a,...t},i)=>{let[o,r]=W(a);return s(c.Provider,{value:{defaultPageSize:a,pageSize:o,setPageSize:r},children:s("div",{className:p("inline-flex items-center justify-between gap-2",n),ref:i,...t,children:e})})});O.displayName="CursorPagination";var T=m(({hasNextPage:n,hasPreviousPage:e,onNextPage:a,onPreviousPage:t,...i},o)=>f(d,{appearance:"panel",ref:o,...i,children:[s(l,{appearance:"ghost",disabled:!e,icon:s(j,{}),label:"Previous page",onClick:t,size:"sm",type:"button"}),s(z,{orientation:"vertical",className:"min-h-5"}),s(l,{appearance:"ghost",disabled:!n,icon:s(k,{}),label:"Next page",onClick:a,size:"sm",type:"button"})]}));T.displayName="CursorButtons";var $=[5,10,20,50,100],B=m(({className:n,pageSizes:e=$,onChangePageSize:a,...t},i)=>{let o=N(c);return P(o,"CursorPageSizeSelect must be used as a child of a CursorPagination component"),P(e.includes(o.defaultPageSize),"CursorPagination.defaultPageSize must be included in CursorPageSizeSelect.pageSizes"),P(e.includes(o.pageSize),"CursorPagination.pageSize must be included in CursorPageSizeSelect.pageSizes"),f(b,{defaultValue:`${o.pageSize}`,onChange:r=>{let g=Number.parseInt(r,10);Number.isNaN(g)&&(g=o.defaultPageSize),o.setPageSize(g),a?.(g)},children:[s(x,{ref:i,className:p("w-auto min-w-36",n),value:o.pageSize,...t,children:s(v,{})}),s(y,{width:"trigger",children:e.map(r=>f(h,{value:`${r}`,children:[r," per page"]},r))})]})});B.displayName="CursorPageSizeSelect";function D({asChild:n=!1,className:e,...a}){let t=N(c);return P(t,"CursorPageSizeValue must be used as a child of a CursorPagination component"),f(n?A:"span",{className:p("text-muted text-sm font-normal",e),...a,children:[t.pageSize," per page"]})}import{useEffect as V,useState as w}from"react";function H({listSize:n,pageSize:e}){let[a,t]=w(1),[i,o]=w(e);V(()=>{o(e),t(1)},[e]),V(()=>{t(1)},[n]);let r=Math.ceil(n/i),g=(a-1)*i,S=a>1,C=a<r;function M(u){let U=Math.max(1,Math.min(u,r));t(U)}function E(){C&&t(u=>Math.min(u+1,r))}function R(){S&&t(u=>Math.max(u-1,1))}function G(u){o(u),t(1)}function I(){t(r)}function L(){t(1)}return{currentPage:a,goToFirstPage:L,goToLastPage:I,goToPage:M,hasNextPage:C,hasPreviousPage:S,nextPage:E,offset:g,pageSize:i,previousPage:R,setPageSize:G,totalPages:r}}function q(n,e){return n.slice(e.offset,e.offset+e.pageSize)}export{T as CursorButtons,B as CursorPageSizeSelect,D as CursorPageSizeValue,O as CursorPagination,q as getOffsetPaginatedSlice,H as useOffsetPagination};
2
2
  //# sourceMappingURL=pagination.js.map
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { HTMLAttributes, ComponentProps } from 'react';
2
+ import { ComponentProps, HTMLAttributes } from 'react';
3
3
 
4
4
  type RemValue = `${number}rem`;
5
5
  type StrokeWidth = number | RemValue;
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
3
  import { ReactNode, HTMLAttributes } from 'react';
4
- import { RadioProps, RadioGroupProps } from '@headlessui/react';
4
+ import { RadioGroupProps, RadioProps } from '@headlessui/react';
5
5
  import { W as WithAsChild } from './as-child-Cvu56SuO.js';
6
6
 
7
7
  /**
package/dist/select.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as _radix_ui_react_separator from '@radix-ui/react-separator';
2
2
  import * as react from 'react';
3
- import { SelectHTMLAttributes, FocusEvent } from 'react';
3
+ import { FocusEvent, SelectHTMLAttributes } from 'react';
4
4
  import * as SelectPrimitive from '@radix-ui/react-select';
5
5
  import { W as WithValidation } from './types-Cs5ck3Vt.js';
6
6
 
package/dist/sheet.js CHANGED
@@ -1,2 +1,2 @@
1
- import{a as d}from"./chunk-SELMU6YK.js";import"./chunk-4LSFAAZW.js";import"./chunk-RDMTCZPT.js";import"./chunk-CZPUIRJG.js";import"./chunk-VJPVAY5J.js";import{a}from"./chunk-EW5CFGXT.js";import{X as v}from"@phosphor-icons/react/X";import*as e from"@radix-ui/react-dialog";import{cva as y}from"class-variance-authority";import{forwardRef as n}from"react";import{jsx as r,jsxs as H}from"react/jsx-runtime";var P=e.Root,b=e.Trigger,g=e.Close,p=e.Portal,m=n(({className:t,...o},i)=>r(e.Overlay,{className:a("bg-overlay data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:animate-in data-state-open:fade-in-0 fixed inset-0 z-40 backdrop-blur-sm",t),...o,ref:i}));m.displayName=e.Overlay.displayName;var C=y("bg-dialog data-state-closed:duration-100 data-state-closed:animate-out data-state-open:duration-100 data-state-open:animate-in fixed z-40 flex flex-col shadow-lg outline-none transition ease-in-out focus-within:outline-none",{variants:{side:{top:"border-dialog data-state-closed:slide-out-to-top data-state-open:slide-in-from-top inset-x-0 top-0 border-b",bottom:"border-dialog data-state-closed:slide-out-to-bottom data-state-open:slide-in-from-bottom inset-x-0 bottom-0 border-t",left:"border-dialog data-state-closed:slide-out-to-left data-state-open:slide-in-from-left inset-y-0 left-0 h-full w-full border-r sm:max-w-[30rem]",right:"border-dialog data-state-closed:slide-out-to-right data-state-open:slide-in-from-right inset-y-0 right-0 h-full w-full border-l sm:max-w-[30rem]"}},defaultVariants:{side:"right"}}),h=n(({side:t="right",className:o,children:i,...s},l)=>H(p,{children:[r(m,{}),r(e.Content,{ref:l,className:a(C({side:t}),o),...s,children:i})]}));h.displayName=e.Content.displayName;var x=({size:t="md",type:o="button",label:i="Close Sheet",appearance:s="ghost",...l})=>r(e.Close,{asChild:!0,children:r(d,{appearance:s,icon:r(v,{}),label:i,size:t,type:o,...l})}),T=({className:t,...o})=>r("div",{className:a("scrollbar text-body flex-1 overflow-y-auto p-6",t),...o}),N=({className:t,...o})=>r("div",{className:a("border-dialog-muted flex shrink-0 flex-col gap-2 border-b py-4 pl-6 pr-4","has-[.icon-button]:pr-4",t),...o}),R=({className:t,...o})=>r("div",{className:a("border-dialog-muted flex shrink-0 justify-end gap-2 border-t px-6 py-2.5",t),...o}),f=n(({className:t,...o},i)=>r(e.Title,{ref:i,className:a("text-strong flex-1 truncate text-lg font-medium",t),...o}));f.displayName=e.Title.displayName;var c=n(({children:t,className:o,...i},s)=>r("div",{className:a("flex items-center justify-between gap-2",o),...i,ref:s,children:t}));c.displayName="SheetTitleGroup";var S=n(({className:t,...o},i)=>r(e.Description,{ref:i,className:a("text-body text-sm",t),...o}));S.displayName=e.Description.displayName;var u=n(({children:t,className:o,...i},s)=>r("div",{className:a("flex h-full items-center gap-2",o),...i,ref:s,children:t}));u.displayName="SheetActions";export{P as Sheet,u as SheetActions,T as SheetBody,g as SheetClose,x as SheetCloseIconButton,h as SheetContent,S as SheetDescription,R as SheetFooter,N as SheetHeader,m as SheetOverlay,p as SheetPortal,f as SheetTitle,c as SheetTitleGroup,b as SheetTrigger};
1
+ import{a as d}from"./chunk-XLFJLMPU.js";import"./chunk-4LSFAAZW.js";import"./chunk-RDMTCZPT.js";import"./chunk-PMSTRJK7.js";import"./chunk-VJPVAY5J.js";import{a}from"./chunk-EW5CFGXT.js";import{X as v}from"@phosphor-icons/react/X";import*as e from"@radix-ui/react-dialog";import{cva as y}from"class-variance-authority";import{forwardRef as n}from"react";import{jsx as r,jsxs as H}from"react/jsx-runtime";var P=e.Root,b=e.Trigger,g=e.Close,p=e.Portal,m=n(({className:t,...o},i)=>r(e.Overlay,{className:a("bg-overlay data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:animate-in data-state-open:fade-in-0 fixed inset-0 z-40 backdrop-blur-sm",t),...o,ref:i}));m.displayName=e.Overlay.displayName;var C=y("bg-dialog data-state-closed:duration-100 data-state-closed:animate-out data-state-open:duration-100 data-state-open:animate-in fixed z-40 flex flex-col shadow-lg outline-none transition ease-in-out focus-within:outline-none",{variants:{side:{top:"border-dialog data-state-closed:slide-out-to-top data-state-open:slide-in-from-top inset-x-0 top-0 border-b",bottom:"border-dialog data-state-closed:slide-out-to-bottom data-state-open:slide-in-from-bottom inset-x-0 bottom-0 border-t",left:"border-dialog data-state-closed:slide-out-to-left data-state-open:slide-in-from-left inset-y-0 left-0 h-full w-full border-r sm:max-w-[30rem]",right:"border-dialog data-state-closed:slide-out-to-right data-state-open:slide-in-from-right inset-y-0 right-0 h-full w-full border-l sm:max-w-[30rem]"}},defaultVariants:{side:"right"}}),h=n(({side:t="right",className:o,children:i,...s},l)=>H(p,{children:[r(m,{}),r(e.Content,{ref:l,className:a(C({side:t}),o),...s,children:i})]}));h.displayName=e.Content.displayName;var x=({size:t="md",type:o="button",label:i="Close Sheet",appearance:s="ghost",...l})=>r(e.Close,{asChild:!0,children:r(d,{appearance:s,icon:r(v,{}),label:i,size:t,type:o,...l})}),T=({className:t,...o})=>r("div",{className:a("scrollbar text-body flex-1 overflow-y-auto p-6",t),...o}),N=({className:t,...o})=>r("div",{className:a("border-dialog-muted flex shrink-0 flex-col gap-2 border-b py-4 pl-6 pr-4","has-[.icon-button]:pr-4",t),...o}),R=({className:t,...o})=>r("div",{className:a("border-dialog-muted flex shrink-0 justify-end gap-2 border-t px-6 py-2.5",t),...o}),f=n(({className:t,...o},i)=>r(e.Title,{ref:i,className:a("text-strong flex-1 truncate text-lg font-medium",t),...o}));f.displayName=e.Title.displayName;var c=n(({children:t,className:o,...i},s)=>r("div",{className:a("flex items-center justify-between gap-2",o),...i,ref:s,children:t}));c.displayName="SheetTitleGroup";var S=n(({className:t,...o},i)=>r(e.Description,{ref:i,className:a("text-body text-sm",t),...o}));S.displayName=e.Description.displayName;var u=n(({children:t,className:o,...i},s)=>r("div",{className:a("flex h-full items-center gap-2",o),...i,ref:s,children:t}));u.displayName="SheetActions";export{P as Sheet,u as SheetActions,T as SheetBody,g as SheetClose,x as SheetCloseIconButton,h as SheetContent,S as SheetDescription,R as SheetFooter,N as SheetHeader,m as SheetOverlay,p as SheetPortal,f as SheetTitle,c as SheetTitleGroup,b as SheetTrigger};
2
2
  //# sourceMappingURL=sheet.js.map
package/dist/table.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { HTMLAttributes, TdHTMLAttributes, ThHTMLAttributes } from 'react';
2
+ import { HTMLAttributes, ThHTMLAttributes, TdHTMLAttributes } from 'react';
3
3
 
4
4
  declare const Table: react.ForwardRefExoticComponent<HTMLAttributes<HTMLTableElement> & react.RefAttributes<HTMLTableElement>>;
5
5
  declare const TableHeader: react.ForwardRefExoticComponent<HTMLAttributes<HTMLTableSectionElement> & react.RefAttributes<HTMLTableSectionElement>>;
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ComponentProps, PropsWithChildren } from 'react';
2
+ import { PropsWithChildren, ComponentProps } from 'react';
3
3
 
4
4
  type Props = {
5
5
  /**
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "mantle is ngrok's UI library and design system.",
4
4
  "author": "ngrok",
5
5
  "license": "MIT",
6
- "version": "0.14.0",
6
+ "version": "0.14.2",
7
7
  "homepage": "https://mantle.ngrok.com",
8
8
  "repository": {
9
9
  "type": "git",
@@ -26,7 +26,6 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "@headlessui/react": "2.2.0",
29
- "@radix-ui/react-alert-dialog": "1.1.2",
30
29
  "@radix-ui/react-dialog": "1.1.2",
31
30
  "@radix-ui/react-dropdown-menu": "2.1.2",
32
31
  "@radix-ui/react-popover": "1.1.2",
@@ -1,2 +0,0 @@
1
- import{a as e}from"./chunk-VJPVAY5J.js";import{a as o}from"./chunk-EW5CFGXT.js";import{forwardRef as f}from"react";import{jsx as n}from"react/jsx-runtime";var c=f(({className:t,style:r,svg:p,...s},m)=>n(e,{ref:m,className:o("size-6 sm:size-5",t),style:r,svg:p,...s}));export{c as a};
2
- //# sourceMappingURL=chunk-CZPUIRJG.js.map