@cryptlex/web-components 6.6.55 → 6.6.57
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/components/copy-button.d.ts +7 -0
- package/dist/components/copy-button.js +2 -0
- package/dist/components/copy-button.js.map +1 -0
- package/dist/components/progress-bar.d.ts +1 -2
- package/dist/components/progress-bar.js +1 -1
- package/dist/components/progress-bar.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ButtonProps } from './button';
|
|
3
|
+
export type CopyButtonProps = Omit<ButtonProps, 'children' | 'ref' | 'active' | 'variant'> & {
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
textToCopy: string | number | Record<string, unknown>;
|
|
6
|
+
};
|
|
7
|
+
export declare function CopyButton({ label, textToCopy, ...props }: CopyButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{jsxs as s,jsx as a}from"react/jsx-runtime";import{Button as p}from"./button.js";import{IcCopy as n}from"./icons.js";import{toast as r}from"./toast.js";import"class-variance-authority";import"react-aria-components";import"../utilities/theme.js";import"clsx";import"./loader.js";import"@icons-pack/react-simple-icons";import"react";import"react-dom";import"./alert.js";function x({label:i,textToCopy:t,...o}){return s(p,{...o,onPress:async()=>{if(t)try{const e=typeof t=="object"?JSON.stringify(t):String(t);await navigator.clipboard.writeText(e),r({title:"Copied to clipboard",variant:"success"})}catch{r({title:"Failed to copy to clipboard",variant:"destructive"})}},className:"gap-2",children:[a(n,{}),i]})}export{x as CopyButton};
|
|
2
|
+
//# sourceMappingURL=copy-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy-button.js","sources":["../../lib/components/copy-button.tsx"],"sourcesContent":["'use client';\n\nimport { type ReactNode } from 'react';\nimport { Button, type ButtonProps } from './button';\nimport { IcCopy } from './icons';\nimport { toast } from './toast';\n\nexport type CopyButtonProps = Omit<ButtonProps, 'children' | 'ref' | 'active' | 'variant'> & {\n label: ReactNode;\n textToCopy: string | number | Record<string, unknown>;\n};\n\nexport function CopyButton({ label, textToCopy, ...props }: CopyButtonProps) {\n const handlePress = async () => {\n if (!textToCopy) return;\n try {\n const text = typeof textToCopy === 'object' ? JSON.stringify(textToCopy) : String(textToCopy);\n await navigator.clipboard.writeText(text);\n toast({\n title: 'Copied to clipboard',\n variant: 'success',\n });\n } catch {\n toast({\n title: 'Failed to copy to clipboard',\n variant: 'destructive',\n });\n }\n };\n\n return (\n <Button {...props} onPress={handlePress} className=\"gap-2\">\n <IcCopy />\n {label}\n </Button>\n );\n}\n"],"names":["CopyButton","label","textToCopy","props","Button","text","toast","jsx","IcCopy"],"mappings":"mYAYO,SAASA,EAAW,CAAE,MAAAC,EAAO,WAAAC,EAAY,GAAGC,GAA0B,CAkBzE,SACKC,EAAA,CAAQ,GAAGD,EAAO,QAlBH,SAAY,CAC5B,GAAKD,EACL,GAAI,CACA,MAAMG,EAAO,OAAOH,GAAe,SAAW,KAAK,UAAUA,CAAU,EAAI,OAAOA,CAAU,EAC5F,MAAM,UAAU,UAAU,UAAUG,CAAI,EACxCC,EAAM,CACF,MAAO,sBACP,QAAS,SAAA,CACZ,CACL,MAAQ,CACJA,EAAM,CACF,MAAO,8BACP,QAAS,aAAA,CACZ,CACL,CACJ,EAG6C,UAAU,QAC/C,SAAA,CAAAC,EAACC,EAAA,EAAO,EACPP,CAAA,EACL,CAER"}
|
|
@@ -2,6 +2,5 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import { ProgressBarProps as AriaProgressBarProps } from 'react-aria-components';
|
|
3
3
|
export type ProgressBarProps = AriaProgressBarProps & {
|
|
4
4
|
label?: ReactNode;
|
|
5
|
-
showValueLabel?: boolean;
|
|
6
5
|
};
|
|
7
|
-
export declare function ProgressBar({ className, label,
|
|
6
|
+
export declare function ProgressBar({ className, label, ...props }: ProgressBarProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
1
|
+
"use client";import{jsx as e,jsxs as d,Fragment as l}from"react/jsx-runtime";import{useId as m}from"react";import{ProgressBar as n,composeRenderProps as c}from"react-aria-components";import{classNames as o}from"../utilities/theme.js";import"clsx";function v({className:t,label:r,...a}){const i=m();return e(n,{...a,"aria-labelledby":r?i:void 0,className:c(t,s=>o("w-96 flex items-center gap-2",s)),children:({percentage:s})=>d(l,{children:[r&&e("div",{className:"flex items-center justify-between body-sm",children:e("div",{id:i,className:"text-foreground",children:r})}),e("div",{className:"h-2 w-full overflow-hidden rounded-full bg-primary/15",children:e("div",{className:o("h-full bg-primary transition-[width] duration-300 ease-out"),style:{width:`${s}%`}})})]})})}export{v as ProgressBar};
|
|
2
2
|
//# sourceMappingURL=progress-bar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress-bar.js","sources":["../../lib/components/progress-bar.tsx"],"sourcesContent":["'use client';\nimport { useId, type ReactNode } from 'react';\nimport {\n ProgressBar as AriaProgressBar,\n composeRenderProps,\n type ProgressBarProps as AriaProgressBarProps,\n} from 'react-aria-components';\nimport { classNames } from '../utilities/theme';\n\nexport type ProgressBarProps = AriaProgressBarProps & {\n label?: ReactNode;\n
|
|
1
|
+
{"version":3,"file":"progress-bar.js","sources":["../../lib/components/progress-bar.tsx"],"sourcesContent":["'use client';\nimport { useId, type ReactNode } from 'react';\nimport {\n ProgressBar as AriaProgressBar,\n composeRenderProps,\n type ProgressBarProps as AriaProgressBarProps,\n} from 'react-aria-components';\nimport { classNames } from '../utilities/theme';\n\nexport type ProgressBarProps = AriaProgressBarProps & {\n label?: ReactNode;\n};\n\nexport function ProgressBar({ className, label, ...props }: ProgressBarProps) {\n const labelId = useId();\n return (\n <AriaProgressBar\n {...props}\n aria-labelledby={label ? labelId : undefined}\n className={composeRenderProps(className, className =>\n classNames('w-96 flex items-center gap-2', className)\n )}\n >\n {({ percentage }) => (\n <>\n {label && (\n <div className=\"flex items-center justify-between body-sm\">\n <div id={labelId} className=\"text-foreground\">\n {label}\n </div>\n </div>\n )}\n\n <div className=\"h-2 w-full overflow-hidden rounded-full bg-primary/15\">\n <div\n className={classNames('h-full bg-primary transition-[width] duration-300 ease-out')}\n style={{ width: `${percentage}%` }}\n />\n </div>\n </>\n )}\n </AriaProgressBar>\n );\n}\n"],"names":["ProgressBar","className","label","props","labelId","useId","jsx","AriaProgressBar","composeRenderProps","classNames","percentage","jsxs","Fragment"],"mappings":"uPAaO,SAASA,EAAY,CAAE,UAAAC,EAAW,MAAAC,EAAO,GAAGC,GAA2B,CAC1E,MAAMC,EAAUC,EAAA,EAChB,OACIC,EAACC,EAAA,CACI,GAAGJ,EACJ,kBAAiBD,EAAQE,EAAU,OACnC,UAAWI,EAAmBP,EAAWA,GACrCQ,EAAW,+BAAgCR,CAAS,CAAA,EAGvD,SAAA,CAAC,CAAE,WAAAS,CAAA,IACAC,EAAAC,EAAA,CACK,SAAA,CAAAV,GACGI,EAAC,MAAA,CAAI,UAAU,4CACX,SAAAA,EAAC,MAAA,CAAI,GAAIF,EAAS,UAAU,kBACvB,SAAAF,CAAA,CACL,EACJ,EAGJI,EAAC,MAAA,CAAI,UAAU,wDACX,SAAAA,EAAC,MAAA,CACG,UAAWG,EAAW,4DAA4D,EAClF,MAAO,CAAE,MAAO,GAAGC,CAAU,GAAA,CAAI,CAAA,CACrC,CACJ,CAAA,CAAA,CACJ,CAAA,CAAA,CAIhB"}
|