@tryghost/shade 0.1.0-alpha.36 → 0.1.0-alpha.37
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/es/components/patterns/kpi-tabs.js +4 -1
- package/es/components/patterns/kpi-tabs.js.map +1 -1
- package/es/components/ui/trend-badge.js +46 -12
- package/es/components/ui/trend-badge.js.map +1 -1
- package/package.json +1 -1
- package/types/components/patterns/kpi-tabs.d.ts +3 -0
- package/types/components/patterns/kpi-tabs.d.ts.map +1 -1
- package/types/components/ui/trend-badge.d.ts +1 -0
- package/types/components/ui/trend-badge.d.ts.map +1 -1
|
@@ -14,7 +14,7 @@ var KpiTabTrigger = ({ children, ...props }) => {
|
|
|
14
14
|
children
|
|
15
15
|
});
|
|
16
16
|
};
|
|
17
|
-
var KpiTabValue = ({ color, icon: iconName, label, value, diffDirection, diffValue, className, "data-testid": testId }) => {
|
|
17
|
+
var KpiTabValue = ({ color, icon: iconName, label, value, diffDirection, diffValue, diffInverted, diffTooltip, className, "data-testid": testId }) => {
|
|
18
18
|
const IconComponent = iconName ? LucideIcons[iconName] : null;
|
|
19
19
|
const labelNode = /* @__PURE__ */ jsxs("span", {
|
|
20
20
|
className: "flex items-center gap-1.5 transition-all group-hover:text-foreground",
|
|
@@ -35,6 +35,9 @@ var KpiTabValue = ({ color, icon: iconName, label, value, diffDirection, diffVal
|
|
|
35
35
|
className: "mt-0.5",
|
|
36
36
|
"data-testid": testId ? `${testId}-diff` : void 0,
|
|
37
37
|
direction: diffDirection,
|
|
38
|
+
inverted: diffInverted,
|
|
39
|
+
tabIndex: diffTooltip ? -1 : void 0,
|
|
40
|
+
tooltip: diffTooltip,
|
|
38
41
|
value: diffValue ?? ""
|
|
39
42
|
}) : null;
|
|
40
43
|
return /* @__PURE__ */ jsx(MetricValue, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kpi-tabs.js","names":[],"sources":["../../../src/components/patterns/kpi-tabs.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as LucideIcons from 'lucide-react';\nimport { type LucideIcon } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\nimport { Button, ButtonProps } from '@/components/ui/button';\nimport { MetricValue } from '@/components/ui/metric-value';\nimport { TabsTrigger } from '@/components/ui/tabs';\nimport { TrendBadge } from '@/components/ui/trend-badge';\n\ninterface KpiTabTriggerProps extends React.ComponentProps<typeof TabsTrigger> {\n children: React.ReactNode;\n}\n\nconst KpiTabTrigger: React.FC<KpiTabTriggerProps> = ({ children, ...props }) => {\n return (\n <TabsTrigger className=\"h-auto\" {...props}>\n {children}\n </TabsTrigger>\n );\n};\n\ninterface KpiTabValueProps {\n color?: string;\n icon?: keyof typeof LucideIcons;\n label: string;\n value: string | number;\n diffDirection?: 'up' | 'down' | 'same' | 'hidden';\n diffValue?: string | number;\n className?: string;\n 'data-testid'?: string;\n}\n\nconst KpiTabValue: React.FC<KpiTabValueProps> = ({\n color,\n icon: iconName,\n label,\n value,\n diffDirection,\n diffValue,\n className,\n 'data-testid': testId,\n}) => {\n const IconComponent = iconName ? (LucideIcons[iconName] as LucideIcon) : null;\n\n const labelNode = (\n <span\n className=\"flex items-center gap-1.5 transition-all group-hover:text-foreground\"\n data-type=\"value\"\n >\n {color && (\n <div\n className=\"ml-1 size-2 rounded-full opacity-50\"\n style={{ backgroundColor: color }}\n ></div>\n )}\n {IconComponent && <IconComponent size={16} strokeWidth={1.5} />}\n {label}\n </span>\n );\n\n const trailing =\n diffDirection && diffDirection !== 'hidden' ? (\n <TrendBadge\n className=\"mt-0.5\"\n data-testid={testId ? `${testId}-diff` : undefined}\n direction={diffDirection}\n value={diffValue ?? ''}\n />\n ) : null;\n\n return (\n <MetricValue\n className={cn('group', className)}\n label={labelNode}\n size=\"lg\"\n trailing={trailing}\n value={value}\n valueTestId={testId}\n />\n );\n};\n\ninterface KpiDropdownButtonProps extends ButtonProps {\n className?: string;\n children: React.ReactNode;\n}\n\nconst KpiDropdownButton = React.forwardRef<HTMLButtonElement, KpiDropdownButtonProps>(\n ({ variant = 'dropdown', className, ...props }, ref) => {\n return (\n <Button\n ref={ref}\n className={cn(\n 'h-auto w-full rounded-none border-x-0 border-t-0 bg-transparent py-5 focus-visible:ring-0',\n className,\n )}\n variant={variant}\n {...props}\n />\n );\n },\n);\nKpiDropdownButton.displayName = 'KpiDropdownButton';\n\nexport { KpiTabTrigger, KpiTabValue, KpiDropdownButton };\n"],"mappings":";;;;;;;;;AAcA,IAAM,iBAA+C,EAAE,UAAU,GAAG,YAAY;CAC9E,OACE,oBAAC,aAAD;EAAa,WAAU;EAAS,GAAI;EACjC;CACU,CAAA;AAEjB;
|
|
1
|
+
{"version":3,"file":"kpi-tabs.js","names":[],"sources":["../../../src/components/patterns/kpi-tabs.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as LucideIcons from 'lucide-react';\nimport { type LucideIcon } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\nimport { Button, ButtonProps } from '@/components/ui/button';\nimport { MetricValue } from '@/components/ui/metric-value';\nimport { TabsTrigger } from '@/components/ui/tabs';\nimport { TrendBadge } from '@/components/ui/trend-badge';\n\ninterface KpiTabTriggerProps extends React.ComponentProps<typeof TabsTrigger> {\n children: React.ReactNode;\n}\n\nconst KpiTabTrigger: React.FC<KpiTabTriggerProps> = ({ children, ...props }) => {\n return (\n <TabsTrigger className=\"h-auto\" {...props}>\n {children}\n </TabsTrigger>\n );\n};\n\ninterface KpiTabValueProps {\n color?: string;\n icon?: keyof typeof LucideIcons;\n label: string;\n value: string | number;\n diffDirection?: 'up' | 'down' | 'same' | 'hidden';\n diffValue?: string | number;\n /** A rise is bad for this metric, so up reads as danger */\n diffInverted?: boolean;\n diffTooltip?: React.ReactNode;\n className?: string;\n 'data-testid'?: string;\n}\n\nconst KpiTabValue: React.FC<KpiTabValueProps> = ({\n color,\n icon: iconName,\n label,\n value,\n diffDirection,\n diffValue,\n diffInverted,\n diffTooltip,\n className,\n 'data-testid': testId,\n}) => {\n const IconComponent = iconName ? (LucideIcons[iconName] as LucideIcon) : null;\n\n const labelNode = (\n <span\n className=\"flex items-center gap-1.5 transition-all group-hover:text-foreground\"\n data-type=\"value\"\n >\n {color && (\n <div\n className=\"ml-1 size-2 rounded-full opacity-50\"\n style={{ backgroundColor: color }}\n ></div>\n )}\n {IconComponent && <IconComponent size={16} strokeWidth={1.5} />}\n {label}\n </span>\n );\n\n const trailing =\n diffDirection && diffDirection !== 'hidden' ? (\n <TrendBadge\n className=\"mt-0.5\"\n data-testid={testId ? `${testId}-diff` : undefined}\n direction={diffDirection}\n inverted={diffInverted}\n // Rendered inside the tab button, so it must not be a tab stop of its own\n tabIndex={diffTooltip ? -1 : undefined}\n tooltip={diffTooltip}\n value={diffValue ?? ''}\n />\n ) : null;\n\n return (\n <MetricValue\n className={cn('group', className)}\n label={labelNode}\n size=\"lg\"\n trailing={trailing}\n value={value}\n valueTestId={testId}\n />\n );\n};\n\ninterface KpiDropdownButtonProps extends ButtonProps {\n className?: string;\n children: React.ReactNode;\n}\n\nconst KpiDropdownButton = React.forwardRef<HTMLButtonElement, KpiDropdownButtonProps>(\n ({ variant = 'dropdown', className, ...props }, ref) => {\n return (\n <Button\n ref={ref}\n className={cn(\n 'h-auto w-full rounded-none border-x-0 border-t-0 bg-transparent py-5 focus-visible:ring-0',\n className,\n )}\n variant={variant}\n {...props}\n />\n );\n },\n);\nKpiDropdownButton.displayName = 'KpiDropdownButton';\n\nexport { KpiTabTrigger, KpiTabValue, KpiDropdownButton };\n"],"mappings":";;;;;;;;;AAcA,IAAM,iBAA+C,EAAE,UAAU,GAAG,YAAY;CAC9E,OACE,oBAAC,aAAD;EAAa,WAAU;EAAS,GAAI;EACjC;CACU,CAAA;AAEjB;AAgBA,IAAM,eAA2C,EAC/C,OACA,MAAM,UACN,OACA,OACA,eACA,WACA,cACA,aACA,WACA,eAAe,aACX;CACJ,MAAM,gBAAgB,WAAY,YAAY,YAA2B;CAEzE,MAAM,YACJ,qBAAC,QAAD;EACE,WAAU;EACV,aAAU;YAFZ;GAIG,SACC,oBAAC,OAAD;IACE,WAAU;IACV,OAAO,EAAE,iBAAiB,MAAM;GAC5B,CAAA;GAEP,iBAAiB,oBAAC,eAAD;IAAe,MAAM;IAAI,aAAa;GAAM,CAAA;GAC7D;EACG;;CAGR,MAAM,WACJ,iBAAiB,kBAAkB,WACjC,oBAAC,YAAD;EACE,WAAU;EACV,eAAa,SAAS,GAAG,OAAO,SAAS,KAAA;EACzC,WAAW;EACX,UAAU;EAEV,UAAU,cAAc,KAAK,KAAA;EAC7B,SAAS;EACT,OAAO,aAAa;CACrB,CAAA,IACC;CAEN,OACE,oBAAC,aAAD;EACE,WAAW,GAAG,SAAS,SAAS;EAChC,OAAO;EACP,MAAK;EACK;EACH;EACP,aAAa;CACd,CAAA;AAEL;AAOA,IAAM,oBAAoB,QAAM,YAC7B,EAAE,UAAU,YAAY,WAAW,GAAG,SAAS,QAAQ;CACtD,OACE,oBAAC,QAAD;EACO;EACL,WAAW,GACT,6FACA,SACF;EACS;EACT,GAAI;CACL,CAAA;AAEL,CACF;AACA,kBAAkB,cAAc"}
|
|
@@ -16,37 +16,71 @@ var trendBadgeVariants = cva("group/trend-badge inline-flex h-[22px] cursor-defa
|
|
|
16
16
|
interactive: {
|
|
17
17
|
true: "focus-visible:ring-2 focus-visible:ring-focus-ring/25 focus-visible:outline-hidden",
|
|
18
18
|
false: ""
|
|
19
|
+
},
|
|
20
|
+
inverted: {
|
|
21
|
+
true: "",
|
|
22
|
+
false: ""
|
|
19
23
|
}
|
|
20
24
|
},
|
|
21
|
-
compoundVariants: [
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
compoundVariants: [
|
|
26
|
+
{
|
|
27
|
+
direction: "up",
|
|
28
|
+
interactive: true,
|
|
29
|
+
className: "hover:bg-state-success/20"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
direction: "down",
|
|
33
|
+
interactive: true,
|
|
34
|
+
className: "hover:bg-state-danger/20"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
direction: "up",
|
|
38
|
+
inverted: true,
|
|
39
|
+
className: "bg-state-danger/10 text-state-danger"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
direction: "down",
|
|
43
|
+
inverted: true,
|
|
44
|
+
className: "bg-state-success/10 text-state-success"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
direction: "up",
|
|
48
|
+
inverted: true,
|
|
49
|
+
interactive: true,
|
|
50
|
+
className: "hover:bg-state-danger/20"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
direction: "down",
|
|
54
|
+
inverted: true,
|
|
55
|
+
interactive: true,
|
|
56
|
+
className: "hover:bg-state-success/20"
|
|
57
|
+
}
|
|
58
|
+
],
|
|
30
59
|
defaultVariants: {
|
|
31
60
|
direction: "same",
|
|
32
|
-
interactive: false
|
|
61
|
+
interactive: false,
|
|
62
|
+
inverted: false
|
|
33
63
|
}
|
|
34
64
|
});
|
|
35
|
-
var TrendBadge = React$1.forwardRef(({ className, direction = "same", value, tooltip, ...props }, ref) => {
|
|
65
|
+
var TrendBadge = React$1.forwardRef(({ className, direction = "same", inverted, value, tooltip, ...props }, ref) => {
|
|
36
66
|
if (direction === "hidden") return null;
|
|
37
67
|
const interactive = Boolean(tooltip);
|
|
38
68
|
const badge = /* @__PURE__ */ jsxs("div", {
|
|
39
69
|
ref,
|
|
40
70
|
className: cn(trendBadgeVariants({
|
|
41
71
|
direction,
|
|
72
|
+
inverted,
|
|
42
73
|
interactive
|
|
43
74
|
}), className),
|
|
44
75
|
tabIndex: interactive ? 0 : void 0,
|
|
45
76
|
...props,
|
|
46
77
|
children: [
|
|
47
|
-
/* @__PURE__ */ jsx("span", {
|
|
78
|
+
value !== "" ? /* @__PURE__ */ jsx("span", {
|
|
48
79
|
className: "leading-none font-medium",
|
|
49
80
|
children: value
|
|
81
|
+
}) : tooltip && /* @__PURE__ */ jsx("span", {
|
|
82
|
+
className: "sr-only",
|
|
83
|
+
children: tooltip
|
|
50
84
|
}),
|
|
51
85
|
direction === "up" && /* @__PURE__ */ jsx(TrendingUp, {
|
|
52
86
|
className: "size-3!",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trend-badge.js","names":[],"sources":["../../../src/components/ui/trend-badge.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { TrendingDown, TrendingUp } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip';\n\nconst trendBadgeVariants = cva(\n 'group/trend-badge inline-flex h-[22px] cursor-default items-center gap-1 rounded-trend-badge px-1.5 text-xs',\n {\n variants: {\n direction: {\n up: 'bg-state-success/10 text-state-success',\n down: 'bg-state-danger/10 text-state-danger',\n same: 'bg-muted text-text-secondary',\n hidden: 'hidden',\n },\n interactive: {\n true: 'focus-visible:ring-2 focus-visible:ring-focus-ring/25 focus-visible:outline-hidden',\n false: '',\n },\n },\n compoundVariants: [\n { direction: 'up', interactive: true, className: 'hover:bg-state-success/20' },\n { direction: 'down', interactive: true, className: 'hover:bg-state-danger/20' },\n ],\n defaultVariants: {\n direction: 'same',\n interactive: false,\n },\n },\n);\n\nexport interface TrendBadgeProps\n extends\n Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>,\n VariantProps<typeof trendBadgeVariants> {\n value: string | number;\n tooltip?: React.ReactNode;\n}\n\nconst TrendBadge = React.forwardRef<HTMLDivElement, TrendBadgeProps>(\n ({ className, direction = 'same', value, tooltip, ...props }, ref) => {\n if (direction === 'hidden') {\n return null;\n }\n\n const interactive = Boolean(tooltip);\n\n const badge = (\n <div\n ref={ref}\n className={cn(trendBadgeVariants({ direction, interactive }), className)}\n tabIndex={interactive ? 0 : undefined}\n {...props}\n >\n <span className=\"leading-none font-medium\">{value}</span>\n {direction === 'up' && <TrendingUp className=\"size-3!\" strokeWidth={2} />}\n {direction === 'down' && <TrendingDown className=\"size-3!\" strokeWidth={2} />}\n </div>\n );\n\n if (!tooltip) {\n return badge;\n }\n\n return (\n <TooltipProvider delayDuration={0}>\n <Tooltip>\n <TooltipTrigger asChild>{badge}</TooltipTrigger>\n <TooltipContent className=\"max-w-[240px] bg-background text-sm text-pretty text-foreground shadow-md dark:bg-popover\">\n {tooltip}\n </TooltipContent>\n </Tooltip>\n </TooltipProvider>\n );\n },\n);\nTrendBadge.displayName = 'TrendBadge';\n\nexport { TrendBadge };\n"],"mappings":";;;;;;;AAOA,IAAM,qBAAqB,IACzB,+GACA;CACE,UAAU;EACR,WAAW;GACT,IAAI;GACJ,MAAM;GACN,MAAM;GACN,QAAQ;EACV;EACA,aAAa;GACX,MAAM;GACN,OAAO;EACT;CACF;CACA,kBAAkB,
|
|
1
|
+
{"version":3,"file":"trend-badge.js","names":[],"sources":["../../../src/components/ui/trend-badge.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { TrendingDown, TrendingUp } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip';\n\nconst trendBadgeVariants = cva(\n 'group/trend-badge inline-flex h-[22px] cursor-default items-center gap-1 rounded-trend-badge px-1.5 text-xs',\n {\n variants: {\n direction: {\n up: 'bg-state-success/10 text-state-success',\n down: 'bg-state-danger/10 text-state-danger',\n same: 'bg-muted text-text-secondary',\n hidden: 'hidden',\n },\n interactive: {\n true: 'focus-visible:ring-2 focus-visible:ring-focus-ring/25 focus-visible:outline-hidden',\n false: '',\n },\n // For metrics where a rise is bad, such as reports: up reads as danger\n inverted: {\n true: '',\n false: '',\n },\n },\n compoundVariants: [\n { direction: 'up', interactive: true, className: 'hover:bg-state-success/20' },\n { direction: 'down', interactive: true, className: 'hover:bg-state-danger/20' },\n { direction: 'up', inverted: true, className: 'bg-state-danger/10 text-state-danger' },\n { direction: 'down', inverted: true, className: 'bg-state-success/10 text-state-success' },\n {\n direction: 'up',\n inverted: true,\n interactive: true,\n className: 'hover:bg-state-danger/20',\n },\n {\n direction: 'down',\n inverted: true,\n interactive: true,\n className: 'hover:bg-state-success/20',\n },\n ],\n defaultVariants: {\n direction: 'same',\n interactive: false,\n inverted: false,\n },\n },\n);\n\nexport interface TrendBadgeProps\n extends\n Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>,\n VariantProps<typeof trendBadgeVariants> {\n value: string | number;\n tooltip?: React.ReactNode;\n}\n\nconst TrendBadge = React.forwardRef<HTMLDivElement, TrendBadgeProps>(\n ({ className, direction = 'same', inverted, value, tooltip, ...props }, ref) => {\n if (direction === 'hidden') {\n return null;\n }\n\n const interactive = Boolean(tooltip);\n\n const badge = (\n <div\n ref={ref}\n className={cn(trendBadgeVariants({ direction, inverted, interactive }), className)}\n tabIndex={interactive ? 0 : undefined}\n {...props}\n >\n {value !== '' ? (\n <span className=\"leading-none font-medium\">{value}</span>\n ) : (\n tooltip && <span className=\"sr-only\">{tooltip}</span>\n )}\n {direction === 'up' && <TrendingUp className=\"size-3!\" strokeWidth={2} />}\n {direction === 'down' && <TrendingDown className=\"size-3!\" strokeWidth={2} />}\n </div>\n );\n\n if (!tooltip) {\n return badge;\n }\n\n return (\n <TooltipProvider delayDuration={0}>\n <Tooltip>\n <TooltipTrigger asChild>{badge}</TooltipTrigger>\n <TooltipContent className=\"max-w-[240px] bg-background text-sm text-pretty text-foreground shadow-md dark:bg-popover\">\n {tooltip}\n </TooltipContent>\n </Tooltip>\n </TooltipProvider>\n );\n },\n);\nTrendBadge.displayName = 'TrendBadge';\n\nexport { TrendBadge };\n"],"mappings":";;;;;;;AAOA,IAAM,qBAAqB,IACzB,+GACA;CACE,UAAU;EACR,WAAW;GACT,IAAI;GACJ,MAAM;GACN,MAAM;GACN,QAAQ;EACV;EACA,a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AA,CACT,EAAA,CAAA;CACM,CAAA;AAErB,CACF;AACA,WAAW,cAAc"}
|
package/package.json
CHANGED
|
@@ -13,6 +13,9 @@ interface KpiTabValueProps {
|
|
|
13
13
|
value: string | number;
|
|
14
14
|
diffDirection?: 'up' | 'down' | 'same' | 'hidden';
|
|
15
15
|
diffValue?: string | number;
|
|
16
|
+
/** A rise is bad for this metric, so up reads as danger */
|
|
17
|
+
diffInverted?: boolean;
|
|
18
|
+
diffTooltip?: React.ReactNode;
|
|
16
19
|
className?: string;
|
|
17
20
|
'data-testid'?: string;
|
|
18
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kpi-tabs.d.ts","sourceRoot":"","sources":["../../../src/components/patterns/kpi-tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,WAAW,MAAM,cAAc,CAAC;AAI5C,OAAO,EAAU,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGnD,UAAU,kBAAmB,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,WAAW,CAAC;IAC3E,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAM/C,CAAC;AAEF,UAAU,gBAAgB;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,OAAO,WAAW,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;IAClD,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MA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B;AAED,QAAA,MAAM,iBAAiB,kGActB,CAAC;AAGF,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { type VariantProps } from 'class-variance-authority';
|
|
|
3
3
|
declare const trendBadgeVariants: (props?: ({
|
|
4
4
|
direction?: "down" | "hidden" | "same" | "up" | null | undefined;
|
|
5
5
|
interactive?: boolean | null | undefined;
|
|
6
|
+
inverted?: boolean | null | undefined;
|
|
6
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
8
|
export interface TrendBadgeProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>, VariantProps<typeof trendBadgeVariants> {
|
|
8
9
|
value: string | number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trend-badge.d.ts","sourceRoot":"","sources":["../../../src/components/ui/trend-badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAMlE,QAAA,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"trend-badge.d.ts","sourceRoot":"","sources":["../../../src/components/ui/trend-badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAMlE,QAAA,MAAM,kBAAkB;;;;8EA4CvB,CAAC;AAEF,MAAM,WAAW,eACf,SACE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,EACtD,YAAY,CAAC,OAAO,kBAAkB,CAAC;IACzC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,QAAA,MAAM,UAAU,wFAwCf,CAAC;AAGF,OAAO,EAAE,UAAU,EAAE,CAAC"}
|