@cryptlex/web-components 6.6.6-alpha29 → 6.6.6-alpha30

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.
@@ -1,8 +1,9 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
+ import { default as React } from 'react';
2
3
  import { CtxIcon } from './icons';
3
4
  export declare const alertVariants: (props?: ({
4
5
  variant?: "destructive" | "success" | "muted" | null | undefined;
5
6
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
6
- export declare function Alert({ children, className, variant, icon: Icon, ...props }: React.ComponentProps<'div'> & VariantProps<typeof alertVariants> & {
7
+ export declare function Alert({ children, className, variant, icon, ...props }: React.ComponentProps<'div'> & VariantProps<typeof alertVariants> & {
7
8
  icon?: CtxIcon;
8
9
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,2 @@
1
- import{jsxs as d,jsx as t}from"react/jsx-runtime";import{cva as i}from"class-variance-authority";import{classNames as c}from"../utilities/theme.js";import"clsx";const u=i("transition-colors border border-dotted p-2 text-foreground body inline-flex items-start gap-2",{variants:{variant:{destructive:"bg-destructive-foreground/20 text-destructive border-destructive",success:"bg-success-foreground/20 text-success border-success",muted:"bg-muted-foreground/20 text-muted border-muted"}},defaultVariants:{variant:"muted"}});function b({children:r,className:s,variant:o,icon:e,...a}){return d("div",{role:"alert",className:c(u({variant:o}),s),...a,children:[e&&t(e,{className:"size-icon mt-1"}),t("span",{className:"w-full",children:r})]})}export{b as Alert,u as alertVariants};
1
+ import{jsxs as u,jsx as s}from"react/jsx-runtime";import{cva as d}from"class-variance-authority";import{classNames as i}from"../utilities/theme.js";import{IcInfo as n,IcCheck as m,IcError as l}from"./icons.js";import"clsx";import"react";const f=d("transition-colors border border-dotted p-2 text-foreground body inline-flex items-start gap-2",{variants:{variant:{destructive:"bg-destructive-foreground/20 text-destructive border-destructive",success:"bg-success-foreground/20 text-success border-success",muted:"bg-muted-foreground/20 text-muted border-muted"}},defaultVariants:{variant:"muted"}}),p=e=>{switch(e){case"destructive":return l;case"success":return m;case"muted":case void 0:default:return n}};function h({children:e,className:o,variant:t,icon:c,...a}){const r=c??p(t);return u("div",{role:"alert",className:i(f({variant:t}),o),...a,children:[r&&s(r,{className:"size-icon mt-1"}),s("span",{className:"w-full",children:e})]})}export{h as Alert,f as alertVariants};
2
2
  //# sourceMappingURL=alert.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"alert.js","sources":["../../lib/components/alert.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { classNames } from '../utilities/theme';\nimport type { CtxIcon } from './icons';\n\nexport const alertVariants = cva(\n `transition-colors border border-dotted p-2 text-foreground body inline-flex items-start gap-2`,\n {\n variants: {\n variant: {\n destructive: 'bg-destructive-foreground/20 text-destructive border-destructive',\n success: 'bg-success-foreground/20 text-success border-success',\n muted: 'bg-muted-foreground/20 text-muted border-muted',\n },\n },\n defaultVariants: {\n variant: 'muted',\n },\n }\n);\n\nexport function Alert({\n children,\n className,\n variant,\n icon: Icon,\n ...props\n}: React.ComponentProps<'div'> &\n VariantProps<typeof alertVariants> & {\n icon?: CtxIcon;\n }) {\n return (\n <div role=\"alert\" className={classNames(alertVariants({ variant }), className)} {...props}>\n {Icon && <Icon className=\"size-icon mt-1\" />}\n <span className=\"w-full\">{children}</span>\n </div>\n );\n}\n"],"names":["alertVariants","cva","Alert","children","className","variant","Icon","props","jsxs","classNames","jsx"],"mappings":"iKAIO,MAAMA,EAAgBC,EACzB,gGACA,CACI,SAAU,CACN,QAAS,CACL,YAAa,mEACb,QAAS,uDACT,MAAO,gDAAA,CACX,EAEJ,gBAAiB,CACb,QAAS,OAAA,CACb,CAER,EAEO,SAASC,EAAM,CAClB,SAAAC,EACA,UAAAC,EACA,QAAAC,EACA,KAAMC,EACN,GAAGC,CACP,EAGO,CACH,OACIC,EAAC,MAAA,CAAI,KAAK,QAAQ,UAAWC,EAAWT,EAAc,CAAE,QAAAK,CAAA,CAAS,EAAGD,CAAS,EAAI,GAAGG,EAC/E,SAAA,CAAAD,GAAQI,EAACJ,EAAA,CAAK,UAAU,gBAAA,CAAiB,EAC1CI,EAAC,OAAA,CAAK,UAAU,SAAU,SAAAP,CAAA,CAAS,CAAA,EACvC,CAER"}
1
+ {"version":3,"file":"alert.js","sources":["../../lib/components/alert.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport React from 'react';\nimport { classNames } from '../utilities/theme';\nimport type { CtxIcon } from './icons';\nimport { IcCheck, IcError, IcInfo } from './icons';\n\nexport const alertVariants = cva(\n `transition-colors border border-dotted p-2 text-foreground body inline-flex items-start gap-2`,\n {\n variants: {\n variant: {\n destructive: 'bg-destructive-foreground/20 text-destructive border-destructive',\n success: 'bg-success-foreground/20 text-success border-success',\n muted: 'bg-muted-foreground/20 text-muted border-muted',\n },\n },\n defaultVariants: {\n variant: 'muted',\n },\n }\n);\n\n// Default icons for each variant\nconst getDefaultIcon = (variant: string | null | undefined): CtxIcon | null => {\n switch (variant) {\n case 'destructive':\n return IcError;\n case 'success':\n return IcCheck;\n case 'muted':\n case undefined:\n default:\n return IcInfo;\n }\n};\nexport function Alert({\n children,\n className,\n variant,\n icon,\n ...props\n}: React.ComponentProps<'div'> &\n VariantProps<typeof alertVariants> & {\n icon?: CtxIcon;\n }) {\n // Overrides the default icon with the provided icon\n const Icon = icon ?? getDefaultIcon(variant);\n\n return (\n <div role=\"alert\" className={classNames(alertVariants({ variant }), className)} {...props}>\n {Icon && <Icon className=\"size-icon mt-1\" />}\n <span className=\"w-full\">{children}</span>\n </div>\n );\n}\n"],"names":["alertVariants","cva","getDefaultIcon","variant","IcError","IcCheck","IcInfo","Alert","children","className","icon","props","Icon","jsxs","classNames","jsx"],"mappings":"6OAMO,MAAMA,EAAgBC,EACzB,gGACA,CACI,SAAU,CACN,QAAS,CACL,YAAa,mEACb,QAAS,uDACT,MAAO,gDAAA,CACX,EAEJ,gBAAiB,CACb,QAAS,OAAA,CACb,CAER,EAGMC,EAAkBC,GAAuD,CAC3E,OAAQA,EAAA,CACJ,IAAK,cACD,OAAOC,EACX,IAAK,UACD,OAAOC,EACX,IAAK,QACL,KAAK,OACL,QACI,OAAOC,CAAA,CAEnB,EACO,SAASC,EAAM,CAClB,SAAAC,EACA,UAAAC,EACA,QAAAN,EACA,KAAAO,EACA,GAAGC,CACP,EAGO,CAEH,MAAMC,EAAOF,GAAQR,EAAeC,CAAO,EAE3C,OACIU,EAAC,MAAA,CAAI,KAAK,QAAQ,UAAWC,EAAWd,EAAc,CAAE,QAAAG,CAAA,CAAS,EAAGM,CAAS,EAAI,GAAGE,EAC/E,SAAA,CAAAC,GAAQG,EAACH,EAAA,CAAK,UAAU,gBAAA,CAAiB,EAC1CG,EAAC,OAAA,CAAK,UAAU,SAAU,SAAAP,CAAA,CAAS,CAAA,EACvC,CAER"}
@@ -1,2 +1,2 @@
1
- import{jsx as t,jsxs as r}from"react/jsx-runtime";import{UNSTABLE_ToastQueue as a,UNSTABLE_ToastRegion as l,UNSTABLE_Toast as m,UNSTABLE_ToastContent as d}from"react-aria-components";import{flushSync as u}from"react-dom";import{classNames as p}from"../utilities/theme.js";import{alertVariants as f}from"./alert.js";import{Button as h}from"./button.js";import{IcInfo as i,IcCheck as T,IcError as v}from"./icons.js";import"clsx";import"class-variance-authority";import"./loader.js";import"react";const n=new a({wrapUpdate(e){"startViewTransition"in document?document.startViewTransition(()=>{u(e)}):e()}});function _(){return t(l,{queue:n,className:"fixed z-50 top-4 right-4 flex flex-col-reverse justify-end gap-2",children:({toast:e})=>t(m,{style:{viewTransitionName:e.key},toast:e,children:r(d,{className:p(f({variant:e.content.variant}),"flex flex-row items-center gap-2 w-full"),children:[t("div",{className:"shrink-0",children:N(e.content.variant)}),r("div",{className:"flex-1 min-w-0",children:[t("p",{slot:"title",children:e.content.title}),e.content.description&&t("p",{slot:"description",children:e.content.description})]}),t(h,{slot:"close",variant:"neutral",children:"Close"})]})})})}function N(e){switch(e){case"destructive":return t(v,{});case"success":return t(T,{});case"muted":return t(i,{});default:return t(i,{})}}function j({title:e,description:o,variant:s,timeout:c}){n.add({title:e,description:o,variant:s},{timeout:c??2e3})}export{_ as ToastProvider,j as toast};
1
+ import{jsx as t,jsxs as r}from"react/jsx-runtime";import{UNSTABLE_ToastQueue as a,UNSTABLE_ToastRegion as l,UNSTABLE_Toast as m,UNSTABLE_ToastContent as d}from"react-aria-components";import{flushSync as u}from"react-dom";import{classNames as p}from"../utilities/theme.js";import{alertVariants as f}from"./alert.js";import{Button as h}from"./button.js";import{IcInfo as i,IcCheck as T,IcError as v}from"./icons.js";import"clsx";import"class-variance-authority";import"react";import"./loader.js";const n=new a({wrapUpdate(e){"startViewTransition"in document?document.startViewTransition(()=>{u(e)}):e()}});function _(){return t(l,{queue:n,className:"fixed z-50 top-4 right-4 flex flex-col-reverse justify-end gap-2",children:({toast:e})=>t(m,{style:{viewTransitionName:e.key},toast:e,children:r(d,{className:p(f({variant:e.content.variant}),"flex flex-row items-center gap-2 w-full"),children:[t("div",{className:"shrink-0",children:N(e.content.variant)}),r("div",{className:"flex-1 min-w-0",children:[t("p",{slot:"title",children:e.content.title}),e.content.description&&t("p",{slot:"description",children:e.content.description})]}),t(h,{slot:"close",variant:"neutral",children:"Close"})]})})})}function N(e){switch(e){case"destructive":return t(v,{});case"success":return t(T,{});case"muted":return t(i,{});default:return t(i,{})}}function j({title:e,description:o,variant:s,timeout:c}){n.add({title:e,description:o,variant:s},{timeout:c??2e3})}export{_ as ToastProvider,j as toast};
2
2
  //# sourceMappingURL=toast.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cryptlex/web-components",
3
- "version": "6.6.6-alpha29",
3
+ "version": "6.6.6-alpha30",
4
4
  "description": "React component library for Cryptlex web applications",
5
5
  "author": "Cryptlex",
6
6
  "type": "module",