@ngrok/mantle 0.52.2 → 0.52.4

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/alert.d.ts CHANGED
@@ -11,12 +11,22 @@ import './deep-non-nullable-SmpSvoSd.js';
11
11
 
12
12
  declare const priorities: readonly ["danger", "info", "success", "warning"];
13
13
  type Priority = (typeof priorities)[number];
14
+ declare const appearances: readonly ["banner", "default"];
15
+ type Appearance = (typeof appearances)[number];
14
16
  type AlertProps = ComponentProps<"div"> & {
15
17
  /**
16
18
  * Indicates the importance or impact level of the Alert, affecting its
17
19
  * color and styling to communicate its purpose to the user.
18
20
  */
19
21
  priority: Priority;
22
+ /**
23
+ * Controls the visual style of the Alert.
24
+ * - "default" provides standard rounded corners and borders.
25
+ * - "banner" creates a banner-style alert with no rounded corners, sticky positioning, and no left/right borders.
26
+ *
27
+ * @default "default"
28
+ */
29
+ appearance?: Appearance;
20
30
  };
21
31
  type AlertIconProps = Omit<SvgAttributes, "children"> & {
22
32
  /**
package/dist/alert.js CHANGED
@@ -1,2 +1,2 @@
1
- import{a as m}from"./chunk-E6VQ7CJN.js";import"./chunk-4LSFAAZW.js";import"./chunk-72TJUKMV.js";import"./chunk-3C5O3AQA.js";import"./chunk-I6T6YV2L.js";import{a as l}from"./chunk-NPTDRQT5.js";import{a as i}from"./chunk-AZ56JGNY.js";import{CheckCircleIcon as b}from"@phosphor-icons/react/CheckCircle";import{InfoIcon as P}from"@phosphor-icons/react/Info";import{WarningIcon as I}from"@phosphor-icons/react/Warning";import{WarningDiamondIcon as h}from"@phosphor-icons/react/WarningDiamond";import{XIcon as N}from"@phosphor-icons/react/X";import{Slot as d}from"@radix-ui/react-slot";import{cva as w}from"class-variance-authority";import{createContext as R,forwardRef as a,useContext as D,useMemo as T}from"react";import B from"tiny-invariant";import{jsx as o}from"react/jsx-runtime";var u=R(null);function f(){let t=D(u);return B(t,"useAlertContext hook used outside of Alert parent!"),t}var H=w("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"}}}),g=a(({className:t,priority:e,...r},n)=>{let s=T(()=>({priority:e}),[e]);return o(u.Provider,{value:s,children:o("div",{ref:n,className:i(H({priority:e}),t),...r})})});g.displayName="Alert";var M={danger:o(I,{}),info:o(P,{}),success:o(b,{}),warning:o(h,{})},x=a(({className:t,svg:e,...r},n)=>{let s=f(),p=M[s.priority];return o(l,{ref:n,className:i("size-5",t),svg:e??p,...r})});x.displayName="AlertIcon";var A=a(({className:t,...e},r)=>o("div",{ref:r,className:i("min-w-0 flex-1 has-[[data-alert-dismiss]]:pr-6",t),...e}));A.displayName="AlertContent";var y=a(({asChild:t=!1,className:e,...r},n)=>o(t?d:"h5",{ref:n,className:i("font-medium",e),...r}));y.displayName="AlertTitle";var v=a(({asChild:t=!1,className:e,...r},n)=>o(t?d:"div",{ref:n,className:i("text-sm",e),...r}));v.displayName="AlertDescription";var C=({size:t="sm",type:e="button",label:r="Dismiss Alert",appearance:n="ghost",className:s,...p})=>{let c=f();return o(m,{appearance:n,icon:o(N,{}),label:r,size:t,"data-alert-dismiss":!0,className:i("right-1.5 top-1.5 absolute",{"text-danger-700 not-disabled:hover:text-danger-800 not-disabled:active:text-danger-900":c.priority==="danger","text-accent-700 not-disabled:hover:text-accent-800 not-disabled:active:text-accent-900":c.priority==="info","text-success-700 not-disabled:hover:text-success-800 not-disabled:active:text-success-900":c.priority==="success","text-warning-700 not-disabled:hover:text-warning-800 not-disabled:active:text-warning-900":c.priority==="warning"},s),type:e,...p})};C.displayName="AlertDismissIconButton";var W={Root:g,Content:A,Description:v,DismissIconButton:C,Icon:x,Title:y};export{W as Alert};
1
+ import{a as d}from"./chunk-E6VQ7CJN.js";import"./chunk-4LSFAAZW.js";import"./chunk-72TJUKMV.js";import"./chunk-3C5O3AQA.js";import"./chunk-I6T6YV2L.js";import{a as l}from"./chunk-NPTDRQT5.js";import{a as i}from"./chunk-AZ56JGNY.js";import{CheckCircleIcon as C}from"@phosphor-icons/react/CheckCircle";import{InfoIcon as P}from"@phosphor-icons/react/Info";import{WarningIcon as I}from"@phosphor-icons/react/Warning";import{WarningDiamondIcon as N}from"@phosphor-icons/react/WarningDiamond";import{XIcon as h}from"@phosphor-icons/react/X";import{Slot as m}from"@radix-ui/react-slot";import{cva as w}from"class-variance-authority";import{createContext as R,forwardRef as c,useContext as D,useMemo as T}from"react";import B from"tiny-invariant";import{jsx as r}from"react/jsx-runtime";var u=R(null);function f(){let t=D(u);return B(t,"useAlertContext hook used outside of Alert parent!"),t}var H=w("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"},appearance:{banner:"border-x-0 rounded-none z-50 sticky",default:""}},compoundVariants:[{priority:"danger",appearance:"banner",className:""},{priority:"info",appearance:"banner",className:""},{priority:"success",appearance:"banner",className:""},{priority:"warning",appearance:"banner",className:""}]}),g=c(({appearance:t="default",className:o,priority:e,...n},s)=>{let a=T(()=>({priority:e}),[e]);return r(u.Provider,{value:a,children:r("div",{ref:s,className:i(H({appearance:t,priority:e}),o),...n})})});g.displayName="Alert";var M={danger:r(I,{}),info:r(P,{}),success:r(C,{}),warning:r(N,{})},y=c(({className:t,svg:o,...e},n)=>{let s=f(),a=M[s.priority];return r(l,{ref:n,className:i("size-5",t),svg:o??a,...e})});y.displayName="AlertIcon";var x=c(({className:t,...o},e)=>r("div",{ref:e,className:i("min-w-0 flex-1 has-[[data-alert-dismiss]]:pr-6",t),...o}));x.displayName="AlertContent";var A=c(({asChild:t=!1,className:o,...e},n)=>r(t?m:"h5",{ref:n,className:i("font-medium",o),...e}));A.displayName="AlertTitle";var b=c(({asChild:t=!1,className:o,...e},n)=>r(t?m:"div",{ref:n,className:i("text-sm",o),...e}));b.displayName="AlertDescription";var v=({size:t="sm",type:o="button",label:e="Dismiss Alert",appearance:n="ghost",className:s,...a})=>{let p=f();return r(d,{appearance:n,icon:r(h,{}),label:e,size:t,"data-alert-dismiss":!0,className:i("right-1.5 top-1.5 absolute",{"text-danger-700 not-disabled:hover:text-danger-800 not-disabled:active:text-danger-900":p.priority==="danger","text-accent-700 not-disabled:hover:text-accent-800 not-disabled:active:text-accent-900":p.priority==="info","text-success-700 not-disabled:hover:text-success-800 not-disabled:active:text-success-900":p.priority==="success","text-warning-700 not-disabled:hover:text-warning-800 not-disabled:active:text-warning-900":p.priority==="warning"},s),type:o,...a})};v.displayName="AlertDismissIconButton";var V={Root:g,Content:x,Description:b,DismissIconButton:v,Icon:y,Title:A};export{V as Alert};
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 { 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 { XIcon } from \"@phosphor-icons/react/X\";\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 { IconButton, type IconButtonProps } from \"../button/icon-button.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 * <AlertDismissIconButton />\n * <AlertDescription>\n * Alert description text.\n * </AlertDescription>\n * </AlertContent>\n * </Alert>\n *```\n */\nconst Root = 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);\nRoot.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 * <AlertDismissIconButton />\n * <AlertDescription>\n * Alert description text.\n * </AlertDescription>\n * </AlertContent>\n * </Alert>\n * ```\n */\nconst Icon = 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);\nIcon.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 * <AlertDismissIconButton />\n * <AlertDescription>\n * Alert description text.\n * </AlertDescription>\n * </AlertContent>\n * </Alert>\n *```\n */\nconst Content = forwardRef<ComponentRef<\"div\">, ComponentProps<\"div\">>(\n\t({ className, ...props }, ref) => (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tclassName={cx(\n\t\t\t\t\"min-w-0 flex-1 has-[[data-alert-dismiss]]:pr-6\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t),\n);\nContent.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 * <AlertDismissIconButton />\n * <AlertDescription>\n * Alert description text.\n * </AlertDescription>\n * </AlertContent>\n * </Alert>\n *```\n */\nconst Title = 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);\nTitle.displayName = \"AlertTitle\";\n\ntype AlertDescriptionProps = ComponentProps<\"div\"> & WithAsChild;\n\n/**\n * The optional description of an alert.\n * Renders as a `div` by default, but can be changed to any other element using\n * the `asChild` prop.\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 * <AlertDismissIconButton />\n * <AlertDescription>\n * Alert description text.\n * </AlertDescription>\n * </AlertContent>\n * </Alert>\n * ```\n */\nconst Description = forwardRef<ComponentRef<\"div\">, AlertDescriptionProps>(\n\t({ asChild = false, className, ...props }, ref) => {\n\t\tconst Component = asChild ? Slot : \"div\";\n\n\t\treturn (\n\t\t\t<Component ref={ref} className={cx(\"text-sm\", className)} {...props} />\n\t\t);\n\t},\n);\nDescription.displayName = \"AlertDescription\";\n\ntype AlertDismissIconButtonProps = Partial<Omit<IconButtonProps, \"icon\">>;\nconst DismissIconButton = ({\n\tsize = \"sm\",\n\ttype = \"button\",\n\tlabel = \"Dismiss Alert\",\n\tappearance = \"ghost\",\n\tclassName,\n\t...props\n}: AlertDismissIconButtonProps) => {\n\tconst ctx = useAlertContext();\n\treturn (\n\t\t<IconButton\n\t\t\tappearance={appearance}\n\t\t\ticon={<XIcon />}\n\t\t\tlabel={label}\n\t\t\tsize={size}\n\t\t\tdata-alert-dismiss\n\t\t\tclassName={cx(\n\t\t\t\t\"right-1.5 top-1.5 absolute\",\n\t\t\t\t{\n\t\t\t\t\t\"text-danger-700 not-disabled:hover:text-danger-800 not-disabled:active:text-danger-900\":\n\t\t\t\t\t\tctx.priority === \"danger\",\n\t\t\t\t\t\"text-accent-700 not-disabled:hover:text-accent-800 not-disabled:active:text-accent-900\":\n\t\t\t\t\t\tctx.priority === \"info\",\n\t\t\t\t\t\"text-success-700 not-disabled:hover:text-success-800 not-disabled:active:text-success-900\":\n\t\t\t\t\t\tctx.priority === \"success\",\n\t\t\t\t\t\"text-warning-700 not-disabled:hover:text-warning-800 not-disabled:active:text-warning-900\":\n\t\t\t\t\t\tctx.priority === \"warning\",\n\t\t\t\t},\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\ttype={type}\n\t\t\t{...props}\n\t\t/>\n\t);\n};\nDismissIconButton.displayName = \"AlertDismissIconButton\";\n\n/**\n * Displays a callout for user attention.\n *\n * @see https://mantle.ngrok.com/components/alert\n *\n * @example\n * ```tsx\n * <Alert priority=\"info\">\n * <AlertIcon />\n * <AlertContent>\n * <AlertTitle>Alert Title</AlertTitle>\n * <AlertDismissIconButton />\n * <AlertDescription>\n * Alert description text.\n * </AlertDescription>\n * </AlertContent>\n * </Alert>\n *```\n */\nconst Alert = {\n\t/**\n\t * The root container of the alert component.\n\t *\n\t * @see https://mantle.ngrok.com/components/alert#api-alert-root\n\t *\n\t * @example\n\t * ```tsx\n\t * <Alert.Root priority=\"info\">\n\t * <Alert.Icon />\n\t * <Alert.Content>\n\t * <Alert.Title>Alert Title</Alert.Title>\n\t * <Alert.Description>Alert description</Alert.Description>\n\t * </Alert.Content>\n\t * </Alert.Root>\n\t * ```\n\t */\n\tRoot,\n\t/**\n\t * The container for the content slot of an alert.\n\t *\n\t * @see https://mantle.ngrok.com/components/alert#api-alert-content\n\t *\n\t * @example\n\t * ```tsx\n\t * <Alert.Root priority=\"info\">\n\t * <Alert.Icon />\n\t * <Alert.Content>\n\t * <Alert.Title>Alert Title</Alert.Title>\n\t * <Alert.Description>Alert description text.</Alert.Description>\n\t * </Alert.Content>\n\t * </Alert.Root>\n\t * ```\n\t */\n\tContent,\n\t/**\n\t * The optional description of an alert.\n\t *\n\t * @see https://mantle.ngrok.com/components/alert#api-alert-description\n\t *\n\t * @example\n\t * ```tsx\n\t * <Alert.Root priority=\"info\">\n\t * <Alert.Icon />\n\t * <Alert.Content>\n\t * <Alert.Title>Alert Title</Alert.Title>\n\t * <Alert.Description>Alert description text.</Alert.Description>\n\t * </Alert.Content>\n\t * </Alert.Root>\n\t * ```\n\t */\n\tDescription,\n\t/**\n\t * An optional dismiss button that can be used to close the alert.\n\t *\n\t * @see https://mantle.ngrok.com/components/alert#api-alert-dismiss-icon-button\n\t *\n\t * @example\n\t * ```tsx\n\t * <Alert.Root priority=\"info\">\n\t * <Alert.Icon />\n\t * <Alert.Content>\n\t * <Alert.Title>Alert Title</Alert.Title>\n\t * <Alert.DismissIconButton />\n\t * <Alert.Description>Alert description text.</Alert.Description>\n\t * </Alert.Content>\n\t * </Alert.Root>\n\t * ```\n\t */\n\tDismissIconButton,\n\t/**\n\t * An optional icon that visually represents the priority of the Alert.\n\t *\n\t * @see https://mantle.ngrok.com/components/alert#api-alert-icon\n\t *\n\t * @example\n\t * ```tsx\n\t * <Alert.Root priority=\"info\">\n\t * <Alert.Icon />\n\t * <Alert.Content>\n\t * <Alert.Title>Alert Title</Alert.Title>\n\t * <Alert.Description>Alert description text.</Alert.Description>\n\t * </Alert.Content>\n\t * </Alert.Root>\n\t * ```\n\t */\n\tIcon,\n\t/**\n\t * The title of an alert.\n\t *\n\t * @see https://mantle.ngrok.com/components/alert#api-alert-title\n\t *\n\t * @example\n\t * ```tsx\n\t * <Alert.Root priority=\"info\">\n\t * <Alert.Icon />\n\t * <Alert.Content>\n\t * <Alert.Title>Alert Title</Alert.Title>\n\t * <Alert.Description>Alert description text.</Alert.Description>\n\t * </Alert.Content>\n\t * </Alert.Root>\n\t * ```\n\t */\n\tTitle,\n} as const;\n\nexport {\n\t//,\n\tAlert,\n};\n"],"mappings":"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","names":["CheckCircleIcon","InfoIcon","WarningIcon","WarningDiamondIcon","XIcon","Slot","cva","createContext","forwardRef","useContext","useMemo","invariant","jsx","AlertContext","createContext","useAlertContext","context","useContext","invariant","alertVariants","cva","Root","forwardRef","className","priority","props","ref","useMemo","jsx","cx","defaultIcons","WarningIcon","InfoIcon","CheckCircleIcon","WarningDiamondIcon","Icon","svg","ctx","defaultIcon","SvgOnly","Content","Title","asChild","Slot","Description","DismissIconButton","size","type","label","appearance","IconButton","XIcon","Alert"]}
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 { XIcon } from \"@phosphor-icons/react/X\";\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 { IconButton, type IconButtonProps } from \"../button/icon-button.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\nconst appearances = [\"banner\", \"default\"] as const;\ntype Appearance = (typeof appearances)[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\t/**\n\t\t\t * Controls the visual style of the Alert.\n\t\t\t * - \"default\" provides standard rounded corners and borders.\n\t\t\t * - \"banner\" creates a banner-style alert with no rounded corners, sticky positioning, and no left/right borders.\n\t\t\t *\n\t\t\t * @default \"default\"\n\t\t\t */\n\t\t\tappearance: {\n\t\t\t\tbanner: \"border-x-0 rounded-none z-50 sticky\",\n\t\t\t\tdefault: \"\",\n\t\t\t} as const satisfies Record<Appearance, string>,\n\t\t},\n\t\tcompoundVariants: [\n\t\t\t{\n\t\t\t\tpriority: \"danger\",\n\t\t\t\tappearance: \"banner\",\n\t\t\t\tclassName: \"\", // placeholder for different bg-color (color-mix w/ bg-popover)\n\t\t\t},\n\t\t\t{\n\t\t\t\tpriority: \"info\",\n\t\t\t\tappearance: \"banner\",\n\t\t\t\tclassName: \"\", // placeholder for different bg-color (color-mix w/ bg-popover)\n\t\t\t},\n\t\t\t{\n\t\t\t\tpriority: \"success\",\n\t\t\t\tappearance: \"banner\",\n\t\t\t\tclassName: \"\", // placeholder for different bg-color (color-mix w/ bg-popover)\n\t\t\t},\n\t\t\t{\n\t\t\t\tpriority: \"warning\",\n\t\t\t\tappearance: \"banner\",\n\t\t\t\tclassName: \"\", // placeholder for different bg-color (color-mix w/ bg-popover)\n\t\t\t},\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\t/**\n\t * Controls the visual style of the Alert.\n\t * - \"default\" provides standard rounded corners and borders.\n\t * - \"banner\" creates a banner-style alert with no rounded corners, sticky positioning, and no left/right borders.\n\t *\n\t * @default \"default\"\n\t */\n\tappearance?: Appearance;\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 * <AlertDismissIconButton />\n * <AlertDescription>\n * Alert description text.\n * </AlertDescription>\n * </AlertContent>\n * </Alert>\n *```\n */\nconst Root = forwardRef<ComponentRef<\"div\">, AlertProps>(\n\t({ appearance = \"default\", 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({ appearance, 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);\nRoot.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 * <AlertDismissIconButton />\n * <AlertDescription>\n * Alert description text.\n * </AlertDescription>\n * </AlertContent>\n * </Alert>\n * ```\n */\nconst Icon = 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);\nIcon.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 * <AlertDismissIconButton />\n * <AlertDescription>\n * Alert description text.\n * </AlertDescription>\n * </AlertContent>\n * </Alert>\n *```\n */\nconst Content = forwardRef<ComponentRef<\"div\">, ComponentProps<\"div\">>(\n\t({ className, ...props }, ref) => (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tclassName={cx(\n\t\t\t\t\"min-w-0 flex-1 has-[[data-alert-dismiss]]:pr-6\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t),\n);\nContent.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 * <AlertDismissIconButton />\n * <AlertDescription>\n * Alert description text.\n * </AlertDescription>\n * </AlertContent>\n * </Alert>\n *```\n */\nconst Title = 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);\nTitle.displayName = \"AlertTitle\";\n\ntype AlertDescriptionProps = ComponentProps<\"div\"> & WithAsChild;\n\n/**\n * The optional description of an alert.\n * Renders as a `div` by default, but can be changed to any other element using\n * the `asChild` prop.\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 * <AlertDismissIconButton />\n * <AlertDescription>\n * Alert description text.\n * </AlertDescription>\n * </AlertContent>\n * </Alert>\n * ```\n */\nconst Description = forwardRef<ComponentRef<\"div\">, AlertDescriptionProps>(\n\t({ asChild = false, className, ...props }, ref) => {\n\t\tconst Component = asChild ? Slot : \"div\";\n\n\t\treturn (\n\t\t\t<Component ref={ref} className={cx(\"text-sm\", className)} {...props} />\n\t\t);\n\t},\n);\nDescription.displayName = \"AlertDescription\";\n\ntype AlertDismissIconButtonProps = Partial<Omit<IconButtonProps, \"icon\">>;\nconst DismissIconButton = ({\n\tsize = \"sm\",\n\ttype = \"button\",\n\tlabel = \"Dismiss Alert\",\n\tappearance = \"ghost\",\n\tclassName,\n\t...props\n}: AlertDismissIconButtonProps) => {\n\tconst ctx = useAlertContext();\n\treturn (\n\t\t<IconButton\n\t\t\tappearance={appearance}\n\t\t\ticon={<XIcon />}\n\t\t\tlabel={label}\n\t\t\tsize={size}\n\t\t\tdata-alert-dismiss\n\t\t\tclassName={cx(\n\t\t\t\t\"right-1.5 top-1.5 absolute\",\n\t\t\t\t{\n\t\t\t\t\t\"text-danger-700 not-disabled:hover:text-danger-800 not-disabled:active:text-danger-900\":\n\t\t\t\t\t\tctx.priority === \"danger\",\n\t\t\t\t\t\"text-accent-700 not-disabled:hover:text-accent-800 not-disabled:active:text-accent-900\":\n\t\t\t\t\t\tctx.priority === \"info\",\n\t\t\t\t\t\"text-success-700 not-disabled:hover:text-success-800 not-disabled:active:text-success-900\":\n\t\t\t\t\t\tctx.priority === \"success\",\n\t\t\t\t\t\"text-warning-700 not-disabled:hover:text-warning-800 not-disabled:active:text-warning-900\":\n\t\t\t\t\t\tctx.priority === \"warning\",\n\t\t\t\t},\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\ttype={type}\n\t\t\t{...props}\n\t\t/>\n\t);\n};\nDismissIconButton.displayName = \"AlertDismissIconButton\";\n\n/**\n * Displays a callout for user attention.\n *\n * @see https://mantle.ngrok.com/components/alert\n *\n * @example\n * ```tsx\n * <Alert priority=\"info\">\n * <AlertIcon />\n * <AlertContent>\n * <AlertTitle>Alert Title</AlertTitle>\n * <AlertDismissIconButton />\n * <AlertDescription>\n * Alert description text.\n * </AlertDescription>\n * </AlertContent>\n * </Alert>\n *```\n */\nconst Alert = {\n\t/**\n\t * The root container of the alert component.\n\t *\n\t * @see https://mantle.ngrok.com/components/alert#api-alert-root\n\t *\n\t * @example\n\t * ```tsx\n\t * <Alert.Root priority=\"info\">\n\t * <Alert.Icon />\n\t * <Alert.Content>\n\t * <Alert.Title>Alert Title</Alert.Title>\n\t * <Alert.Description>Alert description</Alert.Description>\n\t * </Alert.Content>\n\t * </Alert.Root>\n\t * ```\n\t */\n\tRoot,\n\t/**\n\t * The container for the content slot of an alert.\n\t *\n\t * @see https://mantle.ngrok.com/components/alert#api-alert-content\n\t *\n\t * @example\n\t * ```tsx\n\t * <Alert.Root priority=\"info\">\n\t * <Alert.Icon />\n\t * <Alert.Content>\n\t * <Alert.Title>Alert Title</Alert.Title>\n\t * <Alert.Description>Alert description text.</Alert.Description>\n\t * </Alert.Content>\n\t * </Alert.Root>\n\t * ```\n\t */\n\tContent,\n\t/**\n\t * The optional description of an alert.\n\t *\n\t * @see https://mantle.ngrok.com/components/alert#api-alert-description\n\t *\n\t * @example\n\t * ```tsx\n\t * <Alert.Root priority=\"info\">\n\t * <Alert.Icon />\n\t * <Alert.Content>\n\t * <Alert.Title>Alert Title</Alert.Title>\n\t * <Alert.Description>Alert description text.</Alert.Description>\n\t * </Alert.Content>\n\t * </Alert.Root>\n\t * ```\n\t */\n\tDescription,\n\t/**\n\t * An optional dismiss button that can be used to close the alert.\n\t *\n\t * @see https://mantle.ngrok.com/components/alert#api-alert-dismiss-icon-button\n\t *\n\t * @example\n\t * ```tsx\n\t * <Alert.Root priority=\"info\">\n\t * <Alert.Icon />\n\t * <Alert.Content>\n\t * <Alert.Title>Alert Title</Alert.Title>\n\t * <Alert.DismissIconButton />\n\t * <Alert.Description>Alert description text.</Alert.Description>\n\t * </Alert.Content>\n\t * </Alert.Root>\n\t * ```\n\t */\n\tDismissIconButton,\n\t/**\n\t * An optional icon that visually represents the priority of the Alert.\n\t *\n\t * @see https://mantle.ngrok.com/components/alert#api-alert-icon\n\t *\n\t * @example\n\t * ```tsx\n\t * <Alert.Root priority=\"info\">\n\t * <Alert.Icon />\n\t * <Alert.Content>\n\t * <Alert.Title>Alert Title</Alert.Title>\n\t * <Alert.Description>Alert description text.</Alert.Description>\n\t * </Alert.Content>\n\t * </Alert.Root>\n\t * ```\n\t */\n\tIcon,\n\t/**\n\t * The title of an alert.\n\t *\n\t * @see https://mantle.ngrok.com/components/alert#api-alert-title\n\t *\n\t * @example\n\t * ```tsx\n\t * <Alert.Root priority=\"info\">\n\t * <Alert.Icon />\n\t * <Alert.Content>\n\t * <Alert.Title>Alert Title</Alert.Title>\n\t * <Alert.Description>Alert description text.</Alert.Description>\n\t * </Alert.Content>\n\t * </Alert.Root>\n\t * ```\n\t */\n\tTitle,\n} as const;\n\nexport {\n\t//,\n\tAlert,\n};\n"],"mappings":"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","names":["CheckCircleIcon","InfoIcon","WarningIcon","WarningDiamondIcon","XIcon","Slot","cva","createContext","forwardRef","useContext","useMemo","invariant","jsx","AlertContext","createContext","useAlertContext","context","useContext","invariant","alertVariants","cva","Root","forwardRef","appearance","className","priority","props","ref","useMemo","jsx","cx","defaultIcons","WarningIcon","InfoIcon","CheckCircleIcon","WarningDiamondIcon","Icon","svg","ctx","defaultIcon","SvgOnly","Content","Title","asChild","Slot","Description","DismissIconButton","size","type","label","IconButton","XIcon","Alert"]}
package/dist/card.js CHANGED
@@ -1,2 +1,2 @@
1
- import{a as p}from"./chunk-AZ56JGNY.js";import{Slot as d}from"@radix-ui/react-slot";import{forwardRef as a}from"react";import{jsx as s}from"react/jsx-runtime";var C=a(({asChild:o=!1,className:e,children:r,...t},n)=>s(o?d:"div",{ref:n,className:p("divide-card-muted border-card bg-card relative divide-y rounded-md border",e),...t,children:r}));C.displayName="Card";var i=a(({asChild:o=!1,className:e,children:r,...t},n)=>s(o?d:"div",{ref:n,className:p("p-6",e),...t,children:r}));i.displayName="CardBody";var l=a(({asChild:o=!1,className:e,children:r,...t},n)=>s(o?d:"div",{ref:n,className:p("px-6 py-3",e),...t,children:r}));l.displayName="CardFooter";var f=a(({asChild:o=!1,className:e,children:r,...t},n)=>s(o?d:"div",{ref:n,className:p("px-6 py-3",e),...t,children:r}));f.displayName="CardHeader";var c=a(({className:o,asChild:e,...r},t)=>s(e?d:"h3",{ref:t,className:p("text-strong text-base font-medium",o),...r}));c.displayName="CardTitle";var y={Root:C,Body:i,Footer:l,Header:f,Title:c};export{y as Card};
1
+ import{a as n}from"./chunk-AZ56JGNY.js";import{Slot as p}from"@radix-ui/react-slot";import{forwardRef as s}from"react";import{jsx as a}from"react/jsx-runtime";var C=s(({asChild:o=!1,className:r,children:e,...t},d)=>a(o?p:"div",{ref:d,className:n("border-card bg-card relative rounded-md border",r),...t,children:e}));C.displayName="Card";var i=s(({asChild:o=!1,className:r,children:e,...t},d)=>a(o?p:"div",{ref:d,className:n("p-6 border-t border-card-muted first:border-t-0",r),...t,children:e}));i.displayName="CardBody";var f=s(({asChild:o=!1,className:r,children:e,...t},d)=>a(o?p:"div",{ref:d,className:n("px-6 py-3 border-t border-card-muted first:border-t-0",r),...t,children:e}));f.displayName="CardFooter";var l=s(({asChild:o=!1,className:r,children:e,...t},d)=>a(o?p:"div",{ref:d,className:n("px-6 py-3 border-t border-card-muted first:border-t-0",r),...t,children:e}));l.displayName="CardHeader";var c=s(({className:o,asChild:r,...e},t)=>a(r?p:"h3",{ref:t,className:n("text-strong text-base font-medium",o),...e}));c.displayName="CardTitle";var y={Root:C,Body:i,Footer:f,Header:l,Title:c};export{y as Card};
2
2
  //# sourceMappingURL=card.js.map
package/dist/card.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/card/card.tsx"],"sourcesContent":["import { Slot } from \"@radix-ui/react-slot\";\nimport type { ComponentProps, ComponentRef, HTMLAttributes } from \"react\";\nimport { forwardRef } from \"react\";\nimport type { WithAsChild } from \"../../types/index.js\";\nimport { cx } from \"../../utils/cx/cx.js\";\n\ntype CardProps = ComponentProps<\"div\"> & WithAsChild;\n\n/**\n * A container that can be used to display content in a box resembling a\n * physical card. The root component of the all Card components.\n *\n * @see https://mantle.ngrok.com/components/card#api-card\n *\n * @example\n * ```tsx\n * <Card.Root>\n * <Card.Body>\n * <p>Laborum in aute officia adipisicing elit velit.</p>\n * </Card.Body>\n * </Card.Root>\n *\n * <Card.Root>\n * <Card.Header>\n * <Card.Title>Card Title Here</Card.Title>\n * </Card.Header>\n * <Card.Body>\n * <p>Laborum in aute officia adipisicing elit velit.</p>\n * </Card.Body>\n * <Card.Footer>\n * <p>Card footer</p>\n * </Card.Footer>\n * </Card.Root>\n * ```\n */\nconst Root = forwardRef<ComponentRef<\"div\">, CardProps>(\n\t({ asChild = false, className, children, ...rest }, ref) => {\n\t\tconst Component = asChild ? Slot : \"div\";\n\n\t\treturn (\n\t\t\t<Component\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cx(\n\t\t\t\t\t\"divide-card-muted border-card bg-card relative divide-y rounded-md border\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...rest}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</Component>\n\t\t);\n\t},\n);\nRoot.displayName = \"Card\";\n\n/**\n * The main content of a card. Usually composed as a direct child of a `Card` component.\n *\n * @see https://mantle.ngrok.com/components/card#api-card-body\n *\n * @example\n * ```tsx\n * <Card.Root>\n * <Card.Body>\n * <p>Laborum in aute officia adipisicing elit velit.</p>\n * </Card.Body>\n * </Card.Root>\n *\n * <Card.Root>\n * <Card.Header>\n * <Card.Title>Card Title Here</Card.Title>\n * </Card.Header>\n * <Card.Body>\n * <p>Laborum in aute officia adipisicing elit velit.</p>\n * </Card.Body>\n * <Card.Footer>\n * <p>Card footer</p>\n * </Card.Footer>\n * </Card.Root>\n * ```\n */\nconst Body = forwardRef<ComponentRef<\"div\">, CardProps>(\n\t({ asChild = false, className, children, ...rest }, ref) => {\n\t\tconst Component = asChild ? Slot : \"div\";\n\n\t\treturn (\n\t\t\t<Component ref={ref} className={cx(\"p-6\", className)} {...rest}>\n\t\t\t\t{children}\n\t\t\t</Component>\n\t\t);\n\t},\n);\nBody.displayName = \"CardBody\";\n\n/**\n * The footer container of a card. Usually composed as a direct child of a `Card` component.\n *\n * @see https://mantle.ngrok.com/components/card#api-card-footer\n *\n * @example\n * ```tsx\n * <Card.Root>\n * <Card.Header>\n * <Card.Title>Card Title Here</Card.Title>\n * </Card.Header>\n * <Card.Body>\n * <p>Laborum in aute officia adipisicing elit velit.</p>\n * </Card.Body>\n * <Card.Footer>\n * <p>Card footer</p>\n * </Card.Footer>\n * </Card.Root>\n * ```\n */\nconst Footer = forwardRef<ComponentRef<\"div\">, CardProps>(\n\t({ asChild = false, className, children, ...rest }, ref) => {\n\t\tconst Component = asChild ? Slot : \"div\";\n\n\t\treturn (\n\t\t\t<Component ref={ref} className={cx(\"px-6 py-3\", className)} {...rest}>\n\t\t\t\t{children}\n\t\t\t</Component>\n\t\t);\n\t},\n);\nFooter.displayName = \"CardFooter\";\n\n/**\n * The header container of a card. Usually composed as a direct child of a `Card` component.\n *\n * @see https://mantle.ngrok.com/components/card#api-card-header\n *\n * @example\n * ```tsx\n * <Card.Root>\n * <Card.Header>\n * <Card.Title>Card Title Here</Card.Title>\n * </Card.Header>\n * <Card.Body>\n * <p>Laborum in aute officia adipisicing elit velit.</p>\n * </Card.Body>\n * <Card.Footer>\n * <p>Card footer</p>\n * </Card.Footer>\n * </Card.Root>\n * ```\n */\nconst Header = forwardRef<ComponentRef<\"div\">, CardProps>(\n\t({ asChild = false, className, children, ...rest }, ref) => {\n\t\tconst Component = asChild ? Slot : \"div\";\n\n\t\treturn (\n\t\t\t<Component ref={ref} className={cx(\"px-6 py-3\", className)} {...rest}>\n\t\t\t\t{children}\n\t\t\t</Component>\n\t\t);\n\t},\n);\nHeader.displayName = \"CardHeader\";\n\ntype CardTitleProps = HTMLAttributes<HTMLHeadingElement> & WithAsChild;\n\n/**\n * The title of a card. Usually composed as a direct child of a `Card.Header`\n * component.\n * Renders as an `h3` element by default, but can be changed to any other\n * element by using the `asChild` prop. It is preferred to use a heading element\n * (h1-h6) for accessibility reasons.\n *\n * @see https://mantle.ngrok.com/components/card#api-card-title\n *\n * @example\n * ```tsx\n * <Card.Root>\n * <Card.Header>\n * <Card.Title>Card Title Here</Card.Title>\n * </Card.Header>\n * <Card.Body>\n * <p>Laborum in aute officia adipisicing elit velit.</p>\n * </Card.Body>\n * <Card.Footer>\n * <p>Card footer</p>\n * </Card.Footer>\n * </Card.Root>\n * ```\n */\nconst Title = forwardRef<HTMLHeadingElement, CardTitleProps>(\n\t({ className, asChild, ...props }, ref) => {\n\t\tconst Comp = asChild ? Slot : \"h3\";\n\t\treturn (\n\t\t\t<Comp\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cx(\"text-strong text-base font-medium\", className)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t},\n);\nTitle.displayName = \"CardTitle\";\n\n/**\n * A container that can be used to display content in a box resembling a\n * physical card.\n *\n * @see https://mantle.ngrok.com/components/card\n *\n * @example\n * ```tsx\n * <Card.Root>\n * <Card.Body>\n * <p>Laborum in aute officia adipisicing elit velit.</p>\n * </Card.Body>\n * </Card.Root>\n *\n * <Card.Root>\n * <Card.Header>\n * <Card.Title>Card Title Here</Card.Title>\n * </Card.Header>\n * <Card.Body>\n * <p>Laborum in aute officia adipisicing elit velit.</p>\n * </Card.Body>\n * <Card.Footer>\n * <p>Card footer</p>\n * </Card.Footer>\n * </Card.Root>\n * ```\n */\nconst Card = {\n\t/**\n\t * A container that can be used to display content in a box resembling a physical card.\n\t *\n\t * @see https://mantle.ngrok.com/components/card#api-card-root\n\t *\n\t * @example\n\t * ```tsx\n\t * <Card.Root>\n\t * <Card.Body>\n\t * <p>Laborum in aute officia adipisicing elit velit.</p>\n\t * </Card.Body>\n\t * </Card.Root>\n\t * ```\n\t */\n\tRoot,\n\t/**\n\t * The main content of a card.\n\t *\n\t * @see https://mantle.ngrok.com/components/card#api-card-body\n\t *\n\t * @example\n\t * ```tsx\n\t * <Card.Root>\n\t * <Card.Body>\n\t * <p>Laborum in aute officia adipisicing elit velit.</p>\n\t * </Card.Body>\n\t * </Card.Root>\n\t * ```\n\t */\n\tBody,\n\t/**\n\t * The footer container of a card.\n\t *\n\t * @see https://mantle.ngrok.com/components/card#api-card-footer\n\t *\n\t * @example\n\t * ```tsx\n\t * <Card.Root>\n\t * <Card.Header>\n\t * <Card.Title>Card Title Here</Card.Title>\n\t * </Card.Header>\n\t * <Card.Body>\n\t * <p>Laborum in aute officia adipisicing elit velit.</p>\n\t * </Card.Body>\n\t * <Card.Footer>\n\t * <p>Card footer</p>\n\t * </Card.Footer>\n\t * </Card.Root>\n\t * ```\n\t */\n\tFooter,\n\t/**\n\t * The header container of a card.\n\t *\n\t * @see https://mantle.ngrok.com/components/card#api-card-header\n\t *\n\t * @example\n\t * ```tsx\n\t * <Card.Root>\n\t * <Card.Header>\n\t * <Card.Title>Card Title Here</Card.Title>\n\t * </Card.Header>\n\t * <Card.Body>\n\t * <p>Laborum in aute officia adipisicing elit velit.</p>\n\t * </Card.Body>\n\t * <Card.Footer>\n\t * <p>Card footer</p>\n\t * </Card.Footer>\n\t * </Card.Root>\n\t * ```\n\t */\n\tHeader,\n\t/**\n\t * The title of a card.\n\t *\n\t * @see https://mantle.ngrok.com/components/card#api-card-title\n\t *\n\t * @example\n\t * ```tsx\n\t * <Card.Root>\n\t * <Card.Header>\n\t * <Card.Title>Card Title Here</Card.Title>\n\t * </Card.Header>\n\t * <Card.Body>\n\t * <p>Laborum in aute officia adipisicing elit velit.</p>\n\t * </Card.Body>\n\t * <Card.Footer>\n\t * <p>Card footer</p>\n\t * </Card.Footer>\n\t * </Card.Root>\n\t * ```\n\t */\n\tTitle,\n} as const;\n\nexport {\n\t//,\n\tCard,\n};\n\nexport type {\n\t//,\n\tCardProps,\n\tCardTitleProps,\n};\n"],"mappings":"wCAAA,OAAS,QAAAA,MAAY,uBAErB,OAAS,cAAAC,MAAkB,QAsCxB,cAAAC,MAAA,oBALH,IAAMC,EAAOC,EACZ,CAAC,CAAE,QAAAC,EAAU,GAAO,UAAAC,EAAW,SAAAC,EAAU,GAAGC,CAAK,EAAGC,IAIlDP,EAHiBG,EAAUK,EAAO,MAGjC,CACA,IAAKD,EACL,UAAWE,EACV,4EACAL,CACD,EACC,GAAGE,EAEH,SAAAD,EACF,CAGH,EACAJ,EAAK,YAAc,OA4BnB,IAAMS,EAAOR,EACZ,CAAC,CAAE,QAAAC,EAAU,GAAO,UAAAC,EAAW,SAAAC,EAAU,GAAGC,CAAK,EAAGC,IAIlDP,EAHiBG,EAAUK,EAAO,MAGjC,CAAU,IAAKD,EAAK,UAAWE,EAAG,MAAOL,CAAS,EAAI,GAAGE,EACxD,SAAAD,EACF,CAGH,EACAK,EAAK,YAAc,WAsBnB,IAAMC,EAAST,EACd,CAAC,CAAE,QAAAC,EAAU,GAAO,UAAAC,EAAW,SAAAC,EAAU,GAAGC,CAAK,EAAGC,IAIlDP,EAHiBG,EAAUK,EAAO,MAGjC,CAAU,IAAKD,EAAK,UAAWE,EAAG,YAAaL,CAAS,EAAI,GAAGE,EAC9D,SAAAD,EACF,CAGH,EACAM,EAAO,YAAc,aAsBrB,IAAMC,EAASV,EACd,CAAC,CAAE,QAAAC,EAAU,GAAO,UAAAC,EAAW,SAAAC,EAAU,GAAGC,CAAK,EAAGC,IAIlDP,EAHiBG,EAAUK,EAAO,MAGjC,CAAU,IAAKD,EAAK,UAAWE,EAAG,YAAaL,CAAS,EAAI,GAAGE,EAC9D,SAAAD,EACF,CAGH,EACAO,EAAO,YAAc,aA4BrB,IAAMC,EAAQX,EACb,CAAC,CAAE,UAAAE,EAAW,QAAAD,EAAS,GAAGW,CAAM,EAAGP,IAGjCP,EAFYG,EAAUK,EAAO,KAE5B,CACA,IAAKD,EACL,UAAWE,EAAG,oCAAqCL,CAAS,EAC3D,GAAGU,EACL,CAGH,EACAD,EAAM,YAAc,YA6BpB,IAAME,EAAO,CAeZ,KAAAd,EAeA,KAAAS,EAqBA,OAAAC,EAqBA,OAAAC,EAqBA,MAAAC,CACD","names":["Slot","forwardRef","jsx","Root","forwardRef","asChild","className","children","rest","ref","Slot","cx","Body","Footer","Header","Title","props","Card"]}
1
+ {"version":3,"sources":["../src/components/card/card.tsx"],"sourcesContent":["import { Slot } from \"@radix-ui/react-slot\";\nimport type { ComponentProps, ComponentRef, HTMLAttributes } from \"react\";\nimport { forwardRef } from \"react\";\nimport type { WithAsChild } from \"../../types/index.js\";\nimport { cx } from \"../../utils/cx/cx.js\";\n\ntype CardProps = ComponentProps<\"div\"> & WithAsChild;\n\n/**\n * A container that can be used to display content in a box resembling a\n * physical card. The root component of the all Card components.\n *\n * @see https://mantle.ngrok.com/components/card#api-card\n *\n * @example\n * ```tsx\n * <Card.Root>\n * <Card.Body>\n * <p>Laborum in aute officia adipisicing elit velit.</p>\n * </Card.Body>\n * </Card.Root>\n *\n * <Card.Root>\n * <Card.Header>\n * <Card.Title>Card Title Here</Card.Title>\n * </Card.Header>\n * <Card.Body>\n * <p>Laborum in aute officia adipisicing elit velit.</p>\n * </Card.Body>\n * <Card.Footer>\n * <p>Card footer</p>\n * </Card.Footer>\n * </Card.Root>\n * ```\n */\nconst Root = forwardRef<ComponentRef<\"div\">, CardProps>(\n\t({ asChild = false, className, children, ...rest }, ref) => {\n\t\tconst Component = asChild ? Slot : \"div\";\n\n\t\treturn (\n\t\t\t<Component\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cx(\n\t\t\t\t\t\"border-card bg-card relative rounded-md border\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...rest}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</Component>\n\t\t);\n\t},\n);\nRoot.displayName = \"Card\";\n\n/**\n * The main content of a card. Usually composed as a direct child of a `Card` component.\n *\n * @see https://mantle.ngrok.com/components/card#api-card-body\n *\n * @example\n * ```tsx\n * <Card.Root>\n * <Card.Body>\n * <p>Laborum in aute officia adipisicing elit velit.</p>\n * </Card.Body>\n * </Card.Root>\n *\n * <Card.Root>\n * <Card.Header>\n * <Card.Title>Card Title Here</Card.Title>\n * </Card.Header>\n * <Card.Body>\n * <p>Laborum in aute officia adipisicing elit velit.</p>\n * </Card.Body>\n * <Card.Footer>\n * <p>Card footer</p>\n * </Card.Footer>\n * </Card.Root>\n * ```\n */\nconst Body = forwardRef<ComponentRef<\"div\">, CardProps>(\n\t({ asChild = false, className, children, ...rest }, ref) => {\n\t\tconst Component = asChild ? Slot : \"div\";\n\n\t\treturn (\n\t\t\t<Component\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cx(\n\t\t\t\t\t\"p-6 border-t border-card-muted first:border-t-0\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...rest}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</Component>\n\t\t);\n\t},\n);\nBody.displayName = \"CardBody\";\n\n/**\n * The footer container of a card. Usually composed as a direct child of a `Card` component.\n *\n * @see https://mantle.ngrok.com/components/card#api-card-footer\n *\n * @example\n * ```tsx\n * <Card.Root>\n * <Card.Header>\n * <Card.Title>Card Title Here</Card.Title>\n * </Card.Header>\n * <Card.Body>\n * <p>Laborum in aute officia adipisicing elit velit.</p>\n * </Card.Body>\n * <Card.Footer>\n * <p>Card footer</p>\n * </Card.Footer>\n * </Card.Root>\n * ```\n */\nconst Footer = forwardRef<ComponentRef<\"div\">, CardProps>(\n\t({ asChild = false, className, children, ...rest }, ref) => {\n\t\tconst Component = asChild ? Slot : \"div\";\n\n\t\treturn (\n\t\t\t<Component\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cx(\n\t\t\t\t\t\"px-6 py-3 border-t border-card-muted first:border-t-0\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...rest}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</Component>\n\t\t);\n\t},\n);\nFooter.displayName = \"CardFooter\";\n\n/**\n * The header container of a card. Usually composed as a direct child of a `Card` component.\n *\n * @see https://mantle.ngrok.com/components/card#api-card-header\n *\n * @example\n * ```tsx\n * <Card.Root>\n * <Card.Header>\n * <Card.Title>Card Title Here</Card.Title>\n * </Card.Header>\n * <Card.Body>\n * <p>Laborum in aute officia adipisicing elit velit.</p>\n * </Card.Body>\n * <Card.Footer>\n * <p>Card footer</p>\n * </Card.Footer>\n * </Card.Root>\n * ```\n */\nconst Header = forwardRef<ComponentRef<\"div\">, CardProps>(\n\t({ asChild = false, className, children, ...rest }, ref) => {\n\t\tconst Component = asChild ? Slot : \"div\";\n\n\t\treturn (\n\t\t\t<Component\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cx(\n\t\t\t\t\t\"px-6 py-3 border-t border-card-muted first:border-t-0\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...rest}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</Component>\n\t\t);\n\t},\n);\nHeader.displayName = \"CardHeader\";\n\ntype CardTitleProps = HTMLAttributes<HTMLHeadingElement> & WithAsChild;\n\n/**\n * The title of a card. Usually composed as a direct child of a `Card.Header`\n * component.\n * Renders as an `h3` element by default, but can be changed to any other\n * element by using the `asChild` prop. It is preferred to use a heading element\n * (h1-h6) for accessibility reasons.\n *\n * @see https://mantle.ngrok.com/components/card#api-card-title\n *\n * @example\n * ```tsx\n * <Card.Root>\n * <Card.Header>\n * <Card.Title>Card Title Here</Card.Title>\n * </Card.Header>\n * <Card.Body>\n * <p>Laborum in aute officia adipisicing elit velit.</p>\n * </Card.Body>\n * <Card.Footer>\n * <p>Card footer</p>\n * </Card.Footer>\n * </Card.Root>\n * ```\n */\nconst Title = forwardRef<HTMLHeadingElement, CardTitleProps>(\n\t({ className, asChild, ...props }, ref) => {\n\t\tconst Comp = asChild ? Slot : \"h3\";\n\t\treturn (\n\t\t\t<Comp\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cx(\"text-strong text-base font-medium\", className)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t},\n);\nTitle.displayName = \"CardTitle\";\n\n/**\n * A container that can be used to display content in a box resembling a\n * physical card.\n *\n * @see https://mantle.ngrok.com/components/card\n *\n * @example\n * ```tsx\n * <Card.Root>\n * <Card.Body>\n * <p>Laborum in aute officia adipisicing elit velit.</p>\n * </Card.Body>\n * </Card.Root>\n *\n * <Card.Root>\n * <Card.Header>\n * <Card.Title>Card Title Here</Card.Title>\n * </Card.Header>\n * <Card.Body>\n * <p>Laborum in aute officia adipisicing elit velit.</p>\n * </Card.Body>\n * <Card.Footer>\n * <p>Card footer</p>\n * </Card.Footer>\n * </Card.Root>\n * ```\n */\nconst Card = {\n\t/**\n\t * A container that can be used to display content in a box resembling a physical card.\n\t *\n\t * @see https://mantle.ngrok.com/components/card#api-card-root\n\t *\n\t * @example\n\t * ```tsx\n\t * <Card.Root>\n\t * <Card.Body>\n\t * <p>Laborum in aute officia adipisicing elit velit.</p>\n\t * </Card.Body>\n\t * </Card.Root>\n\t * ```\n\t */\n\tRoot,\n\t/**\n\t * The main content of a card.\n\t *\n\t * @see https://mantle.ngrok.com/components/card#api-card-body\n\t *\n\t * @example\n\t * ```tsx\n\t * <Card.Root>\n\t * <Card.Body>\n\t * <p>Laborum in aute officia adipisicing elit velit.</p>\n\t * </Card.Body>\n\t * </Card.Root>\n\t * ```\n\t */\n\tBody,\n\t/**\n\t * The footer container of a card.\n\t *\n\t * @see https://mantle.ngrok.com/components/card#api-card-footer\n\t *\n\t * @example\n\t * ```tsx\n\t * <Card.Root>\n\t * <Card.Header>\n\t * <Card.Title>Card Title Here</Card.Title>\n\t * </Card.Header>\n\t * <Card.Body>\n\t * <p>Laborum in aute officia adipisicing elit velit.</p>\n\t * </Card.Body>\n\t * <Card.Footer>\n\t * <p>Card footer</p>\n\t * </Card.Footer>\n\t * </Card.Root>\n\t * ```\n\t */\n\tFooter,\n\t/**\n\t * The header container of a card.\n\t *\n\t * @see https://mantle.ngrok.com/components/card#api-card-header\n\t *\n\t * @example\n\t * ```tsx\n\t * <Card.Root>\n\t * <Card.Header>\n\t * <Card.Title>Card Title Here</Card.Title>\n\t * </Card.Header>\n\t * <Card.Body>\n\t * <p>Laborum in aute officia adipisicing elit velit.</p>\n\t * </Card.Body>\n\t * <Card.Footer>\n\t * <p>Card footer</p>\n\t * </Card.Footer>\n\t * </Card.Root>\n\t * ```\n\t */\n\tHeader,\n\t/**\n\t * The title of a card.\n\t *\n\t * @see https://mantle.ngrok.com/components/card#api-card-title\n\t *\n\t * @example\n\t * ```tsx\n\t * <Card.Root>\n\t * <Card.Header>\n\t * <Card.Title>Card Title Here</Card.Title>\n\t * </Card.Header>\n\t * <Card.Body>\n\t * <p>Laborum in aute officia adipisicing elit velit.</p>\n\t * </Card.Body>\n\t * <Card.Footer>\n\t * <p>Card footer</p>\n\t * </Card.Footer>\n\t * </Card.Root>\n\t * ```\n\t */\n\tTitle,\n} as const;\n\nexport {\n\t//,\n\tCard,\n};\n\nexport type {\n\t//,\n\tCardProps,\n\tCardTitleProps,\n};\n"],"mappings":"wCAAA,OAAS,QAAAA,MAAY,uBAErB,OAAS,cAAAC,MAAkB,QAsCxB,cAAAC,MAAA,oBALH,IAAMC,EAAOC,EACZ,CAAC,CAAE,QAAAC,EAAU,GAAO,UAAAC,EAAW,SAAAC,EAAU,GAAGC,CAAK,EAAGC,IAIlDP,EAHiBG,EAAUK,EAAO,MAGjC,CACA,IAAKD,EACL,UAAWE,EACV,iDACAL,CACD,EACC,GAAGE,EAEH,SAAAD,EACF,CAGH,EACAJ,EAAK,YAAc,OA4BnB,IAAMS,EAAOR,EACZ,CAAC,CAAE,QAAAC,EAAU,GAAO,UAAAC,EAAW,SAAAC,EAAU,GAAGC,CAAK,EAAGC,IAIlDP,EAHiBG,EAAUK,EAAO,MAGjC,CACA,IAAKD,EACL,UAAWE,EACV,kDACAL,CACD,EACC,GAAGE,EAEH,SAAAD,EACF,CAGH,EACAK,EAAK,YAAc,WAsBnB,IAAMC,EAAST,EACd,CAAC,CAAE,QAAAC,EAAU,GAAO,UAAAC,EAAW,SAAAC,EAAU,GAAGC,CAAK,EAAGC,IAIlDP,EAHiBG,EAAUK,EAAO,MAGjC,CACA,IAAKD,EACL,UAAWE,EACV,wDACAL,CACD,EACC,GAAGE,EAEH,SAAAD,EACF,CAGH,EACAM,EAAO,YAAc,aAsBrB,IAAMC,EAASV,EACd,CAAC,CAAE,QAAAC,EAAU,GAAO,UAAAC,EAAW,SAAAC,EAAU,GAAGC,CAAK,EAAGC,IAIlDP,EAHiBG,EAAUK,EAAO,MAGjC,CACA,IAAKD,EACL,UAAWE,EACV,wDACAL,CACD,EACC,GAAGE,EAEH,SAAAD,EACF,CAGH,EACAO,EAAO,YAAc,aA4BrB,IAAMC,EAAQX,EACb,CAAC,CAAE,UAAAE,EAAW,QAAAD,EAAS,GAAGW,CAAM,EAAGP,IAGjCP,EAFYG,EAAUK,EAAO,KAE5B,CACA,IAAKD,EACL,UAAWE,EAAG,oCAAqCL,CAAS,EAC3D,GAAGU,EACL,CAGH,EACAD,EAAM,YAAc,YA6BpB,IAAME,EAAO,CAeZ,KAAAd,EAeA,KAAAS,EAqBA,OAAAC,EAqBA,OAAAC,EAqBA,MAAAC,CACD","names":["Slot","forwardRef","jsx","Root","forwardRef","asChild","className","children","rest","ref","Slot","cx","Body","Footer","Header","Title","props","Card"]}
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.52.2",
6
+ "version": "0.52.4",
7
7
  "homepage": "https://mantle.ngrok.com",
8
8
  "repository": {
9
9
  "type": "git",
@@ -46,7 +46,7 @@
46
46
  "react-day-picker": "9.9.0",
47
47
  "sonner": "2.0.7",
48
48
  "tailwind-merge": "3.3.1",
49
- "tw-animate-css": "1.3.7",
49
+ "tw-animate-css": "1.3.8",
50
50
  "tiny-invariant": "1.3.3"
51
51
  },
52
52
  "devDependencies": {