@cryptlex/web-components 6.6.6-alpha46 → 6.6.6-alpha48

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.
@@ -18,3 +18,8 @@ export declare function Barchart<T>({ className, data, config, ...props }: Omit<
18
18
  bars: (keyof T)[];
19
19
  };
20
20
  }): import("react/jsx-runtime").JSX.Element;
21
+ export declare function PieChart<T extends Record<string, number>>({ data, variant, showLabels, ...props }: Omit<React.ComponentProps<typeof ResponsiveContainer>, 'children'> & {
22
+ data: T;
23
+ variant?: 'full' | 'semi';
24
+ showLabels?: boolean;
25
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as r,jsxs as l}from"react/jsx-runtime";import{XAxis as p,YAxis as v,CartesianGrid as y,Legend as f,Tooltip as g,ResponsiveContainer as c,LineChart as x,Line as C,BarChart as k,Bar as S}from"recharts";function s({...o}){return r(p,{stroke:"var(--color-neutral-6)",...o})}function d({...o}){return r(v,{stroke:"var(--color-neutral-6)",...o})}function u({...o}){return r(y,{stroke:"var(--color-neutral-4)",...o})}function h({...o}){return r(f,{iconSize:12,formatter:t=>r("span",{className:"text-foreground",children:t}),wrapperStyle:{background:"var(--color-elevation-1)"},...o})}function m({...o}){return r(g,{contentStyle:{backgroundColor:"var(--color-elevation-2)",border:"var(--color-border)"},labelStyle:{color:"var(--color-muted-foreground)",fontWeight:"600",marginBottom:"0.5rem"},itemStyle:{color:"var(--color-foreground)",padding:"0"},...o})}function L({className:o,data:t,config:e,...n}){return r(c,{...n,children:l(x,{className:"body-sm",data:t,children:[r(u,{strokeDasharray:"3 3"}),r(s,{dataKey:e.xAxis.toString()}),r(d,{}),r(m,{}),r(h,{iconType:"plainline"}),e.lines.map((i,a)=>r(C,{strokeWidth:2,type:"monotone",dataKey:i.toString(),stroke:`var(--color-chart-${a%5+1}`}))]})})}function B({className:o,data:t,config:e,...n}){return r(c,{className:o,...n,children:l(k,{className:"body-sm",data:t,children:[r(u,{strokeDasharray:"3 3"}),r(s,{dataKey:e.xAxis.toString()}),r(d,{}),r(m,{}),r(h,{}),e.bars.map((i,a)=>r(S,{dataKey:i.toString(),fill:`var(--color-chart-${a%5+1}`,stroke:`var(--color-chart-${a%5+1}`}))]})})}export{B as Barchart,u as ChartCartesianGrid,h as ChartLegend,m as ChartTooltip,s as ChartXAxis,d as ChartYAxis,L as Linechart};
1
+ "use client";import{jsx as r,jsxs as l}from"react/jsx-runtime";import{XAxis as g,YAxis as x,CartesianGrid as C,Legend as b,Tooltip as k,ResponsiveContainer as c,LineChart as A,Line as S,BarChart as $,Bar as L,PieChart as K,Pie as B}from"recharts";function h({...e}){return r(g,{stroke:"var(--color-neutral-6)",...e})}function m({...e}){return r(x,{stroke:"var(--color-neutral-6)",...e})}function f({...e}){return r(C,{stroke:"var(--color-neutral-4)",...e})}function s({...e}){return r(b,{iconSize:12,formatter:t=>r("span",{className:"text-foreground",children:t}),wrapperStyle:{background:"var(--color-elevation-1)"},...e})}function u({...e}){return r(k,{contentStyle:{backgroundColor:"var(--color-elevation-2)",border:"var(--color-border)"},labelStyle:{color:"var(--color-muted-foreground)",fontWeight:"600",marginBottom:"0.5rem"},itemStyle:{color:"var(--color-foreground)",padding:"0"},...e})}function T({className:e,data:t,config:o,...n}){return r(c,{...n,children:l(A,{className:"body-sm",data:t,children:[r(f,{strokeDasharray:"3 3"}),r(h,{dataKey:o.xAxis.toString()}),r(m,{}),r(u,{}),r(s,{iconType:"plainline"}),o.lines.map((i,a)=>r(S,{strokeWidth:2,type:"monotone",dataKey:i.toString(),stroke:`var(--color-chart-${a%5+1}`}))]})})}function D({className:e,data:t,config:o,...n}){return r(c,{className:e,...n,children:l($,{className:"body-sm",data:t,children:[r(f,{strokeDasharray:"3 3"}),r(h,{dataKey:o.xAxis.toString()}),r(m,{}),r(u,{}),r(s,{}),o.bars.map((i,a)=>r(L,{dataKey:i.toString(),fill:`var(--color-chart-${a%5+1}`,stroke:`var(--color-chart-${a%5+1}`}))]})})}function N(e){const{name:t,percent:o}=e;return`${t}: ${((typeof o=="number"?o:0)*100).toFixed(0)}%`}function G({data:e,variant:t="full",showLabels:o=!0,...n}){const i=t==="semi"?180:0,a=t==="semi"?0:360,p=t==="semi"?"100%":"50%";return r(c,{...n,children:l(K,{children:[r(u,{}),r(s,{}),r(B,{data:Object.entries(e).map(([v,y],d)=>({fill:`var(--color-chart-${d%5+1})`,stroke:`var(--color-chart-${d%5+1})`,name:v,value:y})),dataKey:"value",nameKey:"name",cx:"50%",cy:p,startAngle:i,endAngle:a,label:o?N:void 0,labelLine:{stroke:"var(--color-neutral-6)"},isAnimationActive:!0})]})})}export{D as Barchart,f as ChartCartesianGrid,s as ChartLegend,u as ChartTooltip,h as ChartXAxis,m as ChartYAxis,T as Linechart,G as PieChart};
2
2
  //# sourceMappingURL=charts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"charts.js","sources":["../../lib/components/charts.tsx"],"sourcesContent":["'use client';\nimport {\n Bar,\n BarChart,\n Line,\n LineChart,\n CartesianGrid as RechartsCartesianGrid,\n Legend as RechartsLegend,\n Tooltip as RechartsTooltip,\n XAxis as RechartsXAxis,\n YAxis as RechartsYAxis,\n ResponsiveContainer,\n} from 'recharts';\n\nexport function ChartXAxis({ ...props }: React.ComponentProps<typeof RechartsXAxis>) {\n return <RechartsXAxis stroke=\"var(--color-neutral-6)\" {...props} />;\n}\n\nexport function ChartYAxis({ ...props }: React.ComponentProps<typeof RechartsYAxis>) {\n return <RechartsYAxis stroke=\"var(--color-neutral-6)\" {...props} />;\n}\n\nexport function ChartCartesianGrid({ ...props }: React.ComponentProps<typeof RechartsCartesianGrid>) {\n return <RechartsCartesianGrid stroke=\"var(--color-neutral-4)\" {...props} />;\n}\n\nexport function ChartLegend({ ...props }: React.ComponentProps<typeof RechartsLegend>) {\n return (\n <RechartsLegend\n iconSize={12}\n formatter={v => <span className=\"text-foreground\">{v}</span>}\n wrapperStyle={{ background: 'var(--color-elevation-1)' }}\n {...props}\n />\n );\n}\n\nexport function ChartTooltip({ ...props }: React.ComponentProps<typeof RechartsTooltip>) {\n return (\n <RechartsTooltip\n contentStyle={{\n backgroundColor: 'var(--color-elevation-2)',\n border: 'var(--color-border)',\n }}\n labelStyle={{\n color: 'var(--color-muted-foreground)',\n fontWeight: '600',\n marginBottom: '0.5rem',\n }}\n itemStyle={{\n color: 'var(--color-foreground)',\n padding: '0',\n }}\n {...props}\n />\n );\n}\nexport function Linechart<T extends object>({\n className,\n data,\n config,\n ...props\n}: Omit<React.ComponentProps<typeof ResponsiveContainer>, 'children'> & {\n data: T[];\n config: {\n xAxis: keyof T;\n lines: (keyof T)[];\n };\n}) {\n return (\n <ResponsiveContainer {...props}>\n <LineChart className=\"body-sm\" data={data}>\n <ChartCartesianGrid strokeDasharray=\"3 3\" />\n <ChartXAxis dataKey={config.xAxis.toString()} />\n <ChartYAxis />\n <ChartTooltip />\n <ChartLegend iconType=\"plainline\" />\n {config.lines.map((l, i) => (\n <Line\n strokeWidth={2}\n type=\"monotone\"\n dataKey={l.toString()}\n stroke={`var(--color-chart-${(i % 5) + 1}`}\n />\n ))}\n </LineChart>\n </ResponsiveContainer>\n );\n}\n\nexport function Barchart<T>({\n className,\n data,\n config,\n ...props\n}: Omit<React.ComponentProps<typeof ResponsiveContainer>, 'children'> & {\n data: T[];\n config: {\n xAxis: keyof T;\n bars: (keyof T)[];\n };\n}) {\n return (\n <ResponsiveContainer className={className} {...props}>\n <BarChart className=\"body-sm\" data={data}>\n <ChartCartesianGrid strokeDasharray=\"3 3\" />\n <ChartXAxis dataKey={config.xAxis.toString()} />\n <ChartYAxis />\n <ChartTooltip />\n <ChartLegend />\n {config.bars.map((b, i) => (\n <Bar\n dataKey={b.toString()}\n fill={`var(--color-chart-${(i % 5) + 1}`}\n stroke={`var(--color-chart-${(i % 5) + 1}`}\n />\n ))}\n </BarChart>\n </ResponsiveContainer>\n );\n}\n"],"names":["ChartXAxis","props","jsx","RechartsXAxis","ChartYAxis","RechartsYAxis","ChartCartesianGrid","RechartsCartesianGrid","ChartLegend","RechartsLegend","v","ChartTooltip","RechartsTooltip","Linechart","className","data","config","ResponsiveContainer","LineChart","l","i","Line","Barchart","jsxs","BarChart","b","Bar"],"mappings":"gOAcO,SAASA,EAAW,CAAE,GAAGC,GAAqD,CACjF,OAAOC,EAACC,EAAA,CAAc,OAAO,yBAA0B,GAAGF,EAAO,CACrE,CAEO,SAASG,EAAW,CAAE,GAAGH,GAAqD,CACjF,OAAOC,EAACG,EAAA,CAAc,OAAO,yBAA0B,GAAGJ,EAAO,CACrE,CAEO,SAASK,EAAmB,CAAE,GAAGL,GAA6D,CACjG,OAAOC,EAACK,EAAA,CAAsB,OAAO,yBAA0B,GAAGN,EAAO,CAC7E,CAEO,SAASO,EAAY,CAAE,GAAGP,GAAsD,CACnF,OACIC,EAACO,EAAA,CACG,SAAU,GACV,UAAWC,GAAKR,EAAC,OAAA,CAAK,UAAU,kBAAmB,SAAAQ,EAAE,EACrD,aAAc,CAAE,WAAY,0BAAA,EAC3B,GAAGT,CAAA,CAAA,CAGhB,CAEO,SAASU,EAAa,CAAE,GAAGV,GAAuD,CACrF,OACIC,EAACU,EAAA,CACG,aAAc,CACV,gBAAiB,2BACjB,OAAQ,qBAAA,EAEZ,WAAY,CACR,MAAO,gCACP,WAAY,MACZ,aAAc,QAAA,EAElB,UAAW,CACP,MAAO,0BACP,QAAS,GAAA,EAEZ,GAAGX,CAAA,CAAA,CAGhB,CACO,SAASY,EAA4B,CACxC,UAAAC,EACA,KAAAC,EACA,OAAAC,EACA,GAAGf,CACP,EAMG,CACC,OACIC,EAACe,GAAqB,GAAGhB,EACrB,WAACiB,EAAA,CAAU,UAAU,UAAU,KAAAH,EAC3B,SAAA,CAAAb,EAACI,EAAA,CAAmB,gBAAgB,KAAA,CAAM,IACzCN,EAAA,CAAW,QAASgB,EAAO,MAAM,WAAY,IAC7CZ,EAAA,EAAW,IACXO,EAAA,EAAa,EACdT,EAACM,EAAA,CAAY,SAAS,WAAA,CAAY,EACjCQ,EAAO,MAAM,IAAI,CAACG,EAAGC,IAClBlB,EAACmB,EAAA,CACG,YAAa,EACb,KAAK,WACL,QAASF,EAAE,SAAA,EACX,OAAQ,qBAAsBC,EAAI,EAAK,CAAC,EAAA,CAAA,CAE/C,CAAA,CAAA,CACL,CAAA,CACJ,CAER,CAEO,SAASE,EAAY,CACxB,UAAAR,EACA,KAAAC,EACA,OAAAC,EACA,GAAGf,CACP,EAMG,CACC,OACIC,EAACe,GAAoB,UAAAH,EAAuB,GAAGb,EAC3C,SAAAsB,EAACC,EAAA,CAAS,UAAU,UAAU,KAAAT,EAC1B,SAAA,CAAAb,EAACI,EAAA,CAAmB,gBAAgB,KAAA,CAAM,IACzCN,EAAA,CAAW,QAASgB,EAAO,MAAM,WAAY,IAC7CZ,EAAA,EAAW,IACXO,EAAA,EAAa,IACbH,EAAA,EAAY,EACZQ,EAAO,KAAK,IAAI,CAACS,EAAGL,IACjBlB,EAACwB,EAAA,CACG,QAASD,EAAE,SAAA,EACX,KAAM,qBAAsBL,EAAI,EAAK,CAAC,GACtC,OAAQ,qBAAsBA,EAAI,EAAK,CAAC,EAAA,CAAA,CAE/C,CAAA,CAAA,CACL,CAAA,CACJ,CAER"}
1
+ {"version":3,"file":"charts.js","sources":["../../lib/components/charts.tsx"],"sourcesContent":["'use client';\nimport {\n Bar,\n BarChart,\n Line,\n LineChart,\n Pie,\n CartesianGrid as RechartsCartesianGrid,\n Legend as RechartsLegend,\n PieChart as RechartsPieChart,\n Tooltip as RechartsTooltip,\n XAxis as RechartsXAxis,\n YAxis as RechartsYAxis,\n ResponsiveContainer,\n type PieLabelRenderProps,\n} from 'recharts';\n\nexport function ChartXAxis({ ...props }: React.ComponentProps<typeof RechartsXAxis>) {\n return <RechartsXAxis stroke=\"var(--color-neutral-6)\" {...props} />;\n}\n\nexport function ChartYAxis({ ...props }: React.ComponentProps<typeof RechartsYAxis>) {\n return <RechartsYAxis stroke=\"var(--color-neutral-6)\" {...props} />;\n}\n\nexport function ChartCartesianGrid({ ...props }: React.ComponentProps<typeof RechartsCartesianGrid>) {\n return <RechartsCartesianGrid stroke=\"var(--color-neutral-4)\" {...props} />;\n}\n\nexport function ChartLegend({ ...props }: React.ComponentProps<typeof RechartsLegend>) {\n return (\n <RechartsLegend\n iconSize={12}\n formatter={v => <span className=\"text-foreground\">{v}</span>}\n wrapperStyle={{ background: 'var(--color-elevation-1)' }}\n {...props}\n />\n );\n}\n\nexport function ChartTooltip({ ...props }: React.ComponentProps<typeof RechartsTooltip>) {\n return (\n <RechartsTooltip\n contentStyle={{\n backgroundColor: 'var(--color-elevation-2)',\n border: 'var(--color-border)',\n }}\n labelStyle={{\n color: 'var(--color-muted-foreground)',\n fontWeight: '600',\n marginBottom: '0.5rem',\n }}\n itemStyle={{\n color: 'var(--color-foreground)',\n padding: '0',\n }}\n {...props}\n />\n );\n}\nexport function Linechart<T extends object>({\n className,\n data,\n config,\n ...props\n}: Omit<React.ComponentProps<typeof ResponsiveContainer>, 'children'> & {\n data: T[];\n config: {\n xAxis: keyof T;\n lines: (keyof T)[];\n };\n}) {\n return (\n <ResponsiveContainer {...props}>\n <LineChart className=\"body-sm\" data={data}>\n <ChartCartesianGrid strokeDasharray=\"3 3\" />\n <ChartXAxis dataKey={config.xAxis.toString()} />\n <ChartYAxis />\n <ChartTooltip />\n <ChartLegend iconType=\"plainline\" />\n {config.lines.map((l, i) => (\n <Line\n strokeWidth={2}\n type=\"monotone\"\n dataKey={l.toString()}\n stroke={`var(--color-chart-${(i % 5) + 1}`}\n />\n ))}\n </LineChart>\n </ResponsiveContainer>\n );\n}\n\nexport function Barchart<T>({\n className,\n data,\n config,\n ...props\n}: Omit<React.ComponentProps<typeof ResponsiveContainer>, 'children'> & {\n data: T[];\n config: {\n xAxis: keyof T;\n bars: (keyof T)[];\n };\n}) {\n return (\n <ResponsiveContainer className={className} {...props}>\n <BarChart className=\"body-sm\" data={data}>\n <ChartCartesianGrid strokeDasharray=\"3 3\" />\n <ChartXAxis dataKey={config.xAxis.toString()} />\n <ChartYAxis />\n <ChartTooltip />\n <ChartLegend />\n {config.bars.map((b, i) => (\n <Bar\n dataKey={b.toString()}\n fill={`var(--color-chart-${(i % 5) + 1}`}\n stroke={`var(--color-chart-${(i % 5) + 1}`}\n />\n ))}\n </BarChart>\n </ResponsiveContainer>\n );\n}\n\nfunction getLabel(props: PieLabelRenderProps) {\n const { name, percent } = props;\n return `${name}: ${((typeof percent === 'number' ? percent : 0) * 100).toFixed(0)}%`;\n}\nexport function PieChart<T extends Record<string, number>>({\n data,\n variant = 'full',\n showLabels = true,\n ...props\n}: Omit<React.ComponentProps<typeof ResponsiveContainer>, 'children'> & {\n data: T;\n variant?: 'full' | 'semi';\n showLabels?: boolean;\n}) {\n const finalStartAngle = variant === 'semi' ? 180 : 0;\n const finalEndAngle = variant === 'semi' ? 0 : 360;\n const cy = variant === 'semi' ? '100%' : '50%';\n\n return (\n <ResponsiveContainer {...props}>\n <RechartsPieChart>\n <ChartTooltip />\n <ChartLegend />\n <Pie\n data={Object.entries(data).map(([name, value], i) => {\n return {\n fill: `var(--color-chart-${(i % 5) + 1})`,\n stroke: `var(--color-chart-${(i % 5) + 1})`,\n name,\n value,\n };\n })}\n dataKey=\"value\"\n nameKey=\"name\"\n cx=\"50%\"\n cy={cy}\n startAngle={finalStartAngle}\n endAngle={finalEndAngle}\n label={showLabels ? getLabel : undefined}\n labelLine={{ stroke: 'var(--color-neutral-6)' }}\n isAnimationActive={true}\n />\n </RechartsPieChart>\n </ResponsiveContainer>\n );\n}\n"],"names":["ChartXAxis","props","jsx","RechartsXAxis","ChartYAxis","RechartsYAxis","ChartCartesianGrid","RechartsCartesianGrid","ChartLegend","RechartsLegend","v","ChartTooltip","RechartsTooltip","Linechart","className","data","config","ResponsiveContainer","LineChart","l","i","Line","Barchart","jsxs","BarChart","b","Bar","getLabel","name","percent","PieChart","variant","showLabels","finalStartAngle","finalEndAngle","cy","RechartsPieChart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,KACpC,CACH,KAAM,qBAAsBA,EAAI,EAAK,CAAC,IACtC,OAAQ,qBAAsBA,EAAI,EAAK,CAAC,IACxC,KAAAQ,EACA,MAAAU,CAAA,EAEP,EACD,QAAQ,QACR,QAAQ,OACR,GAAG,MACH,GAAAH,EACA,WAAYF,EACZ,SAAUC,EACV,MAAOF,EAAaL,EAAW,OAC/B,UAAW,CAAE,OAAQ,wBAAA,EACrB,kBAAmB,EAAA,CAAA,CACvB,CAAA,CACJ,CAAA,CACJ,CAER"}
@@ -0,0 +1,33 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ /**
3
+ * Divider component - Visual separator between sections of content
4
+ *
5
+ * @example
6
+ * ```tsx
7
+ * <Divider />
8
+ * <Divider orientation="vertical" />
9
+ * <Divider label="OR" />
10
+ * <Divider spacing="lg" />
11
+ * ```
12
+ */
13
+ declare const dividerVariants: (props?: ({
14
+ orientation?: "horizontal" | "vertical" | null | undefined;
15
+ spacing?: "sm" | "md" | "lg" | null | undefined;
16
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
17
+ export interface DividerProps extends VariantProps<typeof dividerVariants> {
18
+ /**
19
+ * Optional label/text in the center (horizontal only)
20
+ */
21
+ label?: string;
22
+ /**
23
+ * Additional CSS classes
24
+ */
25
+ className?: string;
26
+ /**
27
+ * ARIA role
28
+ * @default 'separator'
29
+ */
30
+ role?: 'separator' | 'presentation' | 'none';
31
+ }
32
+ export declare function Divider({ orientation, label, spacing, className, role, }: DividerProps): import("react/jsx-runtime").JSX.Element;
33
+ export {};
@@ -0,0 +1,2 @@
1
+ "use client";import{jsxs as n,jsx as a}from"react/jsx-runtime";import{cva as l}from"class-variance-authority";import{classNames as s}from"../utilities/theme.js";import"clsx";const m=l("shrink-0",{variants:{orientation:{horizontal:"w-full h-[1px] border-t border-border",vertical:"self-stretch w-[1px] border-l border-border"},spacing:{sm:"",md:"",lg:""}},compoundVariants:[{orientation:"horizontal",spacing:"sm",class:"my-2"},{orientation:"horizontal",spacing:"md",class:"my-4"},{orientation:"horizontal",spacing:"lg",class:"my-6"},{orientation:"vertical",spacing:"sm",class:"mx-2"},{orientation:"vertical",spacing:"md",class:"mx-4"},{orientation:"vertical",spacing:"lg",class:"mx-6"}],defaultVariants:{orientation:"horizontal",spacing:"md"}});function h({orientation:r="horizontal",label:i,spacing:o="md",className:t,role:e="separator"}){return i&&r==="horizontal"?n("div",{className:s("flex items-center gap-2 w-full",o==="sm"&&"my-2",o==="md"&&"my-4",o==="lg"&&"my-6",t),role:e,"aria-orientation":r,children:[a("div",{className:"flex-1 h-[1px] border-t border-border"}),a("span",{className:"body-sm text-muted-foreground px-2 select-none",children:i}),a("div",{className:"flex-1 h-[1px] border-t border-border"})]}):a("div",{className:s(m({orientation:r,spacing:o}),t),role:e,"aria-orientation":r??void 0})}export{h as Divider};
2
+ //# sourceMappingURL=divider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"divider.js","sources":["../../lib/components/divider.tsx"],"sourcesContent":["'use client';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { classNames } from '../utilities/theme';\n\n/**\n * Divider component - Visual separator between sections of content\n *\n * @example\n * ```tsx\n * <Divider />\n * <Divider orientation=\"vertical\" />\n * <Divider label=\"OR\" />\n * <Divider spacing=\"lg\" />\n * ```\n */\n\nconst dividerVariants = cva('shrink-0', {\n variants: {\n orientation: {\n horizontal: 'w-full h-[1px] border-t border-border',\n vertical: 'self-stretch w-[1px] border-l border-border',\n },\n spacing: {\n sm: '',\n md: '',\n lg: '',\n },\n },\n compoundVariants: [\n // Horizontal spacing\n {\n orientation: 'horizontal',\n spacing: 'sm',\n class: 'my-2',\n },\n {\n orientation: 'horizontal',\n spacing: 'md',\n class: 'my-4',\n },\n {\n orientation: 'horizontal',\n spacing: 'lg',\n class: 'my-6',\n },\n // Vertical spacing\n {\n orientation: 'vertical',\n spacing: 'sm',\n class: 'mx-2',\n },\n {\n orientation: 'vertical',\n spacing: 'md',\n class: 'mx-4',\n },\n {\n orientation: 'vertical',\n spacing: 'lg',\n class: 'mx-6',\n },\n ],\n defaultVariants: {\n orientation: 'horizontal',\n spacing: 'md',\n },\n});\n\nexport interface DividerProps extends VariantProps<typeof dividerVariants> {\n /**\n * Optional label/text in the center (horizontal only)\n */\n label?: string;\n /**\n * Additional CSS classes\n */\n className?: string;\n /**\n * ARIA role\n * @default 'separator'\n */\n role?: 'separator' | 'presentation' | 'none';\n}\n\nexport function Divider({\n orientation = 'horizontal',\n label,\n spacing = 'md',\n className,\n role = 'separator',\n}: DividerProps) {\n // If label is provided and orientation is horizontal, use a different layout\n if (label && orientation === 'horizontal') {\n return (\n <div\n className={classNames(\n 'flex items-center gap-2 w-full',\n spacing === 'sm' && 'my-2',\n spacing === 'md' && 'my-4',\n spacing === 'lg' && 'my-6',\n className\n )}\n role={role}\n aria-orientation={orientation}\n >\n <div className=\"flex-1 h-[1px] border-t border-border\" />\n <span className=\"body-sm text-muted-foreground px-2 select-none\">{label}</span>\n <div className=\"flex-1 h-[1px] border-t border-border\" />\n </div>\n );\n }\n\n return (\n <div\n className={classNames(dividerVariants({ orientation, spacing }), className)}\n role={role}\n aria-orientation={orientation ?? undefined}\n />\n );\n}\n"],"names":["dividerVariants","cva","Divider","orientation","label","spacing","className","role","jsxs","classNames","jsx"],"mappings":"8KAgBA,MAAMA,EAAkBC,EAAI,WAAY,CACpC,SAAU,CACN,YAAa,CACT,WAAY,wCACZ,SAAU,6CAAA,EAEd,QAAS,CACL,GAAI,GACJ,GAAI,GACJ,GAAI,EAAA,CACR,EAEJ,iBAAkB,CAEd,CACI,YAAa,aACb,QAAS,KACT,MAAO,MAAA,EAEX,CACI,YAAa,aACb,QAAS,KACT,MAAO,MAAA,EAEX,CACI,YAAa,aACb,QAAS,KACT,MAAO,MAAA,EAGX,CACI,YAAa,WACb,QAAS,KACT,MAAO,MAAA,EAEX,CACI,YAAa,WACb,QAAS,KACT,MAAO,MAAA,EAEX,CACI,YAAa,WACb,QAAS,KACT,MAAO,MAAA,CACX,EAEJ,gBAAiB,CACb,YAAa,aACb,QAAS,IAAA,CAEjB,CAAC,EAkBM,SAASC,EAAQ,CACpB,YAAAC,EAAc,aACd,MAAAC,EACA,QAAAC,EAAU,KACV,UAAAC,EACA,KAAAC,EAAO,WACX,EAAiB,CAEb,OAAIH,GAASD,IAAgB,aAErBK,EAAC,MAAA,CACG,UAAWC,EACP,iCACAJ,IAAY,MAAQ,OACpBA,IAAY,MAAQ,OACpBA,IAAY,MAAQ,OACpBC,CAAA,EAEJ,KAAAC,EACA,mBAAkBJ,EAElB,SAAA,CAAAO,EAAC,MAAA,CAAI,UAAU,uCAAA,CAAwC,EACvDA,EAAC,OAAA,CAAK,UAAU,iDAAkD,SAAAN,EAAM,EACxEM,EAAC,MAAA,CAAI,UAAU,uCAAA,CAAwC,CAAA,CAAA,CAAA,EAM/DA,EAAC,MAAA,CACG,UAAWD,EAAWT,EAAgB,CAAE,YAAAG,EAAa,QAAAE,CAAA,CAAS,EAAGC,CAAS,EAC1E,KAAAC,EACA,mBAAkBJ,GAAe,MAAA,CAAA,CAG7C"}
@@ -3,6 +3,6 @@ import { default as createClient } from 'openapi-fetch';
3
3
  export type CtxClientType = ReturnType<typeof createClient<paths>>;
4
4
  export declare function CtxClientProvider({ client, children }: {
5
5
  client: CtxClientType;
6
- children: React.ReactNode;
6
+ children?: React.ReactNode;
7
7
  }): import("react/jsx-runtime").JSX.Element;
8
8
  export declare function useCtxClient(): CtxClientType;
@@ -1 +1 @@
1
- {"version":3,"file":"ctx-client.js","sources":["../../lib/utilities/ctx-client.tsx"],"sourcesContent":["import type { paths } from '@cryptlex/web-api-types/develop';\nimport createClient from 'openapi-fetch';\nimport { createContext, use } from 'react';\n\nexport type CtxClientType = ReturnType<typeof createClient<paths>>;\n\nconst CtxClientContext = createContext<CtxClientType | null>(null);\n\nexport function CtxClientProvider({ client, children }: { client: CtxClientType; children: React.ReactNode }) {\n return <CtxClientContext.Provider value={client}>{children}</CtxClientContext.Provider>;\n}\n\nexport function useCtxClient(): CtxClientType {\n const client = use(CtxClientContext);\n if (!client) {\n throw new Error('useCtxClient must be used within a CtxClientProvider.');\n }\n return client;\n}\n"],"names":["CtxClientContext","createContext","CtxClientProvider","client","children","useCtxClient","use"],"mappings":"uFAMA,MAAMA,EAAmBC,EAAoC,IAAI,EAE1D,SAASC,EAAkB,CAAE,OAAAC,EAAQ,SAAAC,GAAkE,CAC1G,SAAQJ,EAAiB,SAAjB,CAA0B,MAAOG,EAAS,SAAAC,EAAS,CAC/D,CAEO,SAASC,GAA8B,CAC1C,MAAMF,EAASG,EAAIN,CAAgB,EACnC,GAAI,CAACG,EACD,MAAM,IAAI,MAAM,uDAAuD,EAE3E,OAAOA,CACX"}
1
+ {"version":3,"file":"ctx-client.js","sources":["../../lib/utilities/ctx-client.tsx"],"sourcesContent":["import type { paths } from '@cryptlex/web-api-types/develop';\nimport createClient from 'openapi-fetch';\nimport { createContext, use } from 'react';\n\nexport type CtxClientType = ReturnType<typeof createClient<paths>>;\n\nconst CtxClientContext = createContext<CtxClientType | null>(null);\n\nexport function CtxClientProvider({ client, children }: { client: CtxClientType; children?: React.ReactNode }) {\n return <CtxClientContext.Provider value={client}>{children}</CtxClientContext.Provider>;\n}\n\nexport function useCtxClient(): CtxClientType {\n const client = use(CtxClientContext);\n if (!client) {\n throw new Error('useCtxClient must be used within a CtxClientProvider.');\n }\n return client;\n}\n"],"names":["CtxClientContext","createContext","CtxClientProvider","client","children","useCtxClient","use"],"mappings":"uFAMA,MAAMA,EAAmBC,EAAoC,IAAI,EAE1D,SAASC,EAAkB,CAAE,OAAAC,EAAQ,SAAAC,GAAmE,CAC3G,SAAQJ,EAAiB,SAAjB,CAA0B,MAAOG,EAAS,SAAAC,EAAS,CAC/D,CAEO,SAASC,GAA8B,CAC1C,MAAMF,EAASG,EAAIN,CAAgB,EACnC,GAAI,CAACG,EACD,MAAM,IAAI,MAAM,uDAAuD,EAE3E,OAAOA,CACX"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cryptlex/web-components",
3
- "version": "6.6.6-alpha46",
3
+ "version": "6.6.6-alpha48",
4
4
  "description": "React component library for Cryptlex web applications",
5
5
  "author": "Cryptlex",
6
6
  "type": "module",