@turtleclub/ui 0.3.0-beta.8 → 0.3.0
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/.prettierrc.json +4 -0
- package/.turbo/turbo-build.log +152 -26
- package/CHANGELOG.md +338 -0
- package/dist/index.cjs +178 -36
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +25526 -4757
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/components/features/data-table.d.ts +9 -0
- package/dist/types/components/features/data-table.d.ts.map +1 -0
- package/dist/types/components/features/index.d.ts +5 -0
- package/dist/types/components/features/index.d.ts.map +1 -0
- package/dist/types/components/features/page-heading.d.ts +10 -0
- package/dist/types/components/features/page-heading.d.ts.map +1 -0
- package/dist/types/components/features/search-bar.d.ts +10 -0
- package/dist/types/components/features/search-bar.d.ts.map +1 -0
- package/dist/types/components/features/segmented-navigation.d.ts +7 -0
- package/dist/types/components/features/segmented-navigation.d.ts.map +1 -0
- package/dist/types/components/features/sidebar-layout.d.ts +36 -0
- package/dist/types/components/features/sidebar-layout.d.ts.map +1 -0
- package/dist/types/components/icons/arrow.d.ts +4 -0
- package/dist/types/components/icons/arrow.d.ts.map +1 -0
- package/dist/types/components/icons/beta.d.ts +4 -0
- package/dist/types/components/icons/beta.d.ts.map +1 -0
- package/dist/types/components/icons/dot.d.ts +4 -0
- package/dist/types/components/icons/dot.d.ts.map +1 -0
- package/dist/types/components/icons/index.d.ts +8 -0
- package/dist/types/components/icons/index.d.ts.map +1 -0
- package/dist/types/components/icons/issue.d.ts +4 -0
- package/dist/types/components/icons/issue.d.ts.map +1 -0
- package/dist/types/components/icons/turtle.d.ts +4 -0
- package/dist/types/components/icons/turtle.d.ts.map +1 -0
- package/dist/types/components/icons/update.d.ts +4 -0
- package/dist/types/components/icons/update.d.ts.map +1 -0
- package/dist/types/components/icons/warning.d.ts +4 -0
- package/dist/types/components/icons/warning.d.ts.map +1 -0
- package/dist/types/components/molecules/index.d.ts +2 -0
- package/dist/types/components/molecules/index.d.ts.map +1 -1
- package/dist/types/components/molecules/opportunity/index.d.ts +3 -1
- package/dist/types/components/molecules/opportunity/index.d.ts.map +1 -1
- package/dist/types/components/molecules/opportunity/opportunity-apr.d.ts +8 -3
- package/dist/types/components/molecules/opportunity/opportunity-apr.d.ts.map +1 -1
- package/dist/types/components/molecules/opportunity/opportunity-disclaimer.d.ts +1 -2
- package/dist/types/components/molecules/opportunity/opportunity-disclaimer.d.ts.map +1 -1
- package/dist/types/components/molecules/opportunity/opportunity-list/hooks/index.d.ts +3 -0
- package/dist/types/components/molecules/opportunity/opportunity-list/hooks/index.d.ts.map +1 -0
- package/dist/types/components/molecules/opportunity/opportunity-list/hooks/use-opportunity-filtering.d.ts +11 -0
- package/dist/types/components/molecules/opportunity/opportunity-list/hooks/use-opportunity-filtering.d.ts.map +1 -0
- package/dist/types/components/molecules/opportunity/opportunity-list/hooks/use-opportunity-grouping.d.ts +9 -0
- package/dist/types/components/molecules/opportunity/opportunity-list/hooks/use-opportunity-grouping.d.ts.map +1 -0
- package/dist/types/components/molecules/opportunity/opportunity-list/index.d.ts +2 -0
- package/dist/types/components/molecules/opportunity/opportunity-list/index.d.ts.map +1 -0
- package/dist/types/components/molecules/opportunity/opportunity-list/opportunity-list.d.ts +22 -0
- package/dist/types/components/molecules/opportunity/opportunity-list/opportunity-list.d.ts.map +1 -0
- package/dist/types/components/molecules/opportunity/opportunity-rate-estimator.d.ts +1 -2
- package/dist/types/components/molecules/opportunity/opportunity-rate-estimator.d.ts.map +1 -1
- package/dist/types/components/molecules/opportunity/opportunity-section.d.ts +4 -0
- package/dist/types/components/molecules/opportunity/opportunity-section.d.ts.map +1 -1
- package/dist/types/components/molecules/opportunity/opportunity-selector.d.ts +1 -2
- package/dist/types/components/molecules/opportunity/opportunity-selector.d.ts.map +1 -1
- package/dist/types/components/molecules/opportunity/opportunity-type.d.ts +1 -2
- package/dist/types/components/molecules/opportunity/opportunity-type.d.ts.map +1 -1
- package/dist/types/components/molecules/route-details.d.ts +1 -1
- package/dist/types/components/molecules/route-details.d.ts.map +1 -1
- package/dist/types/components/molecules/slippage-selector.d.ts +1 -2
- package/dist/types/components/molecules/slippage-selector.d.ts.map +1 -1
- package/dist/types/components/molecules/swap-details.d.ts.map +1 -1
- package/dist/types/components/molecules/swap-input.d.ts +5 -1
- package/dist/types/components/molecules/swap-input.d.ts.map +1 -1
- package/dist/types/components/molecules/tabs.d.ts +18 -0
- package/dist/types/components/molecules/tabs.d.ts.map +1 -0
- package/dist/types/components/molecules/token-selector.d.ts +1 -1
- package/dist/types/components/molecules/token-selector.d.ts.map +1 -1
- package/dist/types/components/molecules/tx-status.d.ts.map +1 -1
- package/dist/types/components/molecules/widget/asset-list/asset-filters.d.ts +20 -0
- package/dist/types/components/molecules/widget/asset-list/asset-filters.d.ts.map +1 -0
- package/dist/types/components/molecules/widget/asset-list/asset-list.d.ts +35 -0
- package/dist/types/components/molecules/widget/asset-list/asset-list.d.ts.map +1 -0
- package/dist/types/components/molecules/widget/asset-list/asset-row.d.ts +12 -0
- package/dist/types/components/molecules/widget/asset-list/asset-row.d.ts.map +1 -0
- package/dist/types/components/molecules/widget/asset-list/hooks/index.d.ts +3 -0
- package/dist/types/components/molecules/widget/asset-list/hooks/index.d.ts.map +1 -0
- package/dist/types/components/molecules/widget/asset-list/hooks/use-asset-filtering.d.ts +10 -0
- package/dist/types/components/molecules/widget/asset-list/hooks/use-asset-filtering.d.ts.map +1 -0
- package/dist/types/components/molecules/widget/asset-list/hooks/use-asset-grouping.d.ts +9 -0
- package/dist/types/components/molecules/widget/asset-list/hooks/use-asset-grouping.d.ts.map +1 -0
- package/dist/types/components/molecules/widget/asset-list/index.d.ts +4 -0
- package/dist/types/components/molecules/widget/asset-list/index.d.ts.map +1 -0
- package/dist/types/components/molecules/widget/base-selector.d.ts +17 -0
- package/dist/types/components/molecules/widget/base-selector.d.ts.map +1 -0
- package/dist/types/components/molecules/widget/campaign-item.d.ts +20 -0
- package/dist/types/components/molecules/widget/campaign-item.d.ts.map +1 -0
- package/dist/types/components/molecules/widget/deal-item.d.ts +20 -0
- package/dist/types/components/molecules/widget/deal-item.d.ts.map +1 -0
- package/dist/types/components/molecules/widget/index.d.ts +14 -0
- package/dist/types/components/molecules/widget/index.d.ts.map +1 -0
- package/dist/types/components/molecules/widget/opportunity-item.d.ts +33 -0
- package/dist/types/components/molecules/widget/opportunity-item.d.ts.map +1 -0
- package/dist/types/components/molecules/widget/widget-item-stats.d.ts +14 -0
- package/dist/types/components/molecules/widget/widget-item-stats.d.ts.map +1 -0
- package/dist/types/components/molecules/widget/widget-item.d.ts +26 -0
- package/dist/types/components/molecules/widget/widget-item.d.ts.map +1 -0
- package/dist/types/components/molecules/widget/widget-list-items.d.ts +20 -0
- package/dist/types/components/molecules/widget/widget-list-items.d.ts.map +1 -0
- package/dist/types/components/ui/alert-dialog.d.ts +15 -0
- package/dist/types/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/types/components/ui/animated-background/animated-background.d.ts +9 -0
- package/dist/types/components/ui/animated-background/animated-background.d.ts.map +1 -0
- package/dist/types/components/ui/animated-background/index.d.ts +2 -0
- package/dist/types/components/ui/animated-background/index.d.ts.map +1 -0
- package/dist/types/components/ui/avatar.d.ts +18 -4
- package/dist/types/components/ui/avatar.d.ts.map +1 -1
- package/dist/types/components/ui/badge.d.ts +5 -4
- package/dist/types/components/ui/badge.d.ts.map +1 -1
- package/dist/types/components/ui/banner.d.ts +7 -0
- package/dist/types/components/ui/banner.d.ts.map +1 -0
- package/dist/types/components/ui/button.d.ts +8 -6
- package/dist/types/components/ui/button.d.ts.map +1 -1
- package/dist/types/components/ui/card.d.ts +10 -11
- package/dist/types/components/ui/card.d.ts.map +1 -1
- package/dist/types/components/ui/checkbox.d.ts +5 -0
- package/dist/types/components/ui/checkbox.d.ts.map +1 -0
- package/dist/types/components/ui/chip.d.ts +1 -1
- package/dist/types/components/ui/chip.d.ts.map +1 -1
- package/dist/types/components/ui/collapsible.d.ts +7 -0
- package/dist/types/components/ui/collapsible.d.ts.map +1 -0
- package/dist/types/components/ui/combobox.d.ts +148 -0
- package/dist/types/components/ui/combobox.d.ts.map +1 -0
- package/dist/types/components/ui/command.d.ts +19 -0
- package/dist/types/components/ui/command.d.ts.map +1 -0
- package/dist/types/components/ui/dialog.d.ts +10 -10
- package/dist/types/components/ui/dialog.d.ts.map +1 -1
- package/dist/types/components/ui/dropdown.d.ts +30 -0
- package/dist/types/components/ui/dropdown.d.ts.map +1 -0
- package/dist/types/components/ui/field.d.ts +26 -0
- package/dist/types/components/ui/field.d.ts.map +1 -0
- package/dist/types/components/ui/heading.d.ts +12 -0
- package/dist/types/components/ui/heading.d.ts.map +1 -0
- package/dist/types/components/ui/hover-card.d.ts +7 -7
- package/dist/types/components/ui/hover-card.d.ts.map +1 -1
- package/dist/types/components/ui/icon-animation.d.ts +1 -1
- package/dist/types/components/ui/icon-animation.d.ts.map +1 -1
- package/dist/types/components/ui/icon-list.d.ts +17 -0
- package/dist/types/components/ui/icon-list.d.ts.map +1 -0
- package/dist/types/components/ui/index.d.ts +28 -8
- package/dist/types/components/ui/index.d.ts.map +1 -1
- package/dist/types/components/ui/info-card.d.ts +4 -4
- package/dist/types/components/ui/info-card.d.ts.map +1 -1
- package/dist/types/components/ui/input-group.d.ts +17 -0
- package/dist/types/components/ui/input-group.d.ts.map +1 -0
- package/dist/types/components/ui/input.d.ts +1 -3
- package/dist/types/components/ui/input.d.ts.map +1 -1
- package/dist/types/components/ui/label-with-icon.d.ts +3 -3
- package/dist/types/components/ui/label-with-icon.d.ts.map +1 -1
- package/dist/types/components/ui/label.d.ts +1 -1
- package/dist/types/components/ui/label.d.ts.map +1 -1
- package/dist/types/components/ui/multi-select.d.ts +192 -0
- package/dist/types/components/ui/multi-select.d.ts.map +1 -0
- package/dist/types/components/ui/navigation-bar.d.ts +2 -2
- package/dist/types/components/ui/navigation-bar.d.ts.map +1 -1
- package/dist/types/components/ui/navigation-menu.d.ts +15 -0
- package/dist/types/components/ui/navigation-menu.d.ts.map +1 -0
- package/dist/types/components/ui/opportunity-details-v1.d.ts +1 -1
- package/dist/types/components/ui/opportunity-details-v1.d.ts.map +1 -1
- package/dist/types/components/ui/popover.d.ts +8 -0
- package/dist/types/components/ui/popover.d.ts.map +1 -0
- package/dist/types/components/ui/scroll-area.d.ts +2 -2
- package/dist/types/components/ui/scroll-area.d.ts.map +1 -1
- package/dist/types/components/ui/segment-control.d.ts +19 -0
- package/dist/types/components/ui/segment-control.d.ts.map +1 -0
- package/dist/types/components/ui/select.d.ts +14 -13
- package/dist/types/components/ui/select.d.ts.map +1 -1
- package/dist/types/components/ui/separator.d.ts +1 -1
- package/dist/types/components/ui/separator.d.ts.map +1 -1
- package/dist/types/components/ui/sheet.d.ts +14 -0
- package/dist/types/components/ui/sheet.d.ts.map +1 -0
- package/dist/types/components/ui/sidebar.d.ts +69 -0
- package/dist/types/components/ui/sidebar.d.ts.map +1 -0
- package/dist/types/components/ui/skeleton.d.ts +4 -0
- package/dist/types/components/ui/skeleton.d.ts.map +1 -0
- package/dist/types/components/ui/slider.d.ts +5 -0
- package/dist/types/components/ui/slider.d.ts.map +1 -0
- package/dist/types/components/ui/sonner.d.ts +1 -2
- package/dist/types/components/ui/sonner.d.ts.map +1 -1
- package/dist/types/components/ui/switch.d.ts +1 -1
- package/dist/types/components/ui/switch.d.ts.map +1 -1
- package/dist/types/components/ui/table-shadcn.d.ts +11 -0
- package/dist/types/components/ui/table-shadcn.d.ts.map +1 -0
- package/dist/types/components/ui/table.d.ts +2 -2
- package/dist/types/components/ui/table.d.ts.map +1 -1
- package/dist/types/components/ui/textarea.d.ts +4 -0
- package/dist/types/components/ui/textarea.d.ts.map +1 -0
- package/dist/types/components/ui/toggle-group.d.ts +2 -2
- package/dist/types/components/ui/toggle-group.d.ts.map +1 -1
- package/dist/types/components/ui/toggle.d.ts +2 -2
- package/dist/types/components/ui/toggle.d.ts.map +1 -1
- package/dist/types/components/ui/tooltip.d.ts +7 -4
- package/dist/types/components/ui/tooltip.d.ts.map +1 -1
- package/dist/types/hooks/useIsMobile.d.ts +7 -0
- package/dist/types/hooks/useIsMobile.d.ts.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +39 -28
- package/src/components/features/data-table.tsx +96 -0
- package/src/components/features/index.ts +4 -0
- package/src/components/features/page-heading.tsx +22 -0
- package/src/components/features/search-bar.tsx +50 -0
- package/src/components/features/segmented-navigation.tsx +18 -0
- package/src/components/features/sidebar-layout.tsx +190 -0
- package/src/components/icons/arrow.tsx +23 -0
- package/src/components/icons/beta.tsx +86 -0
- package/src/components/icons/dot.tsx +89 -0
- package/src/components/icons/index.ts +7 -0
- package/src/components/icons/issue.tsx +97 -0
- package/src/components/icons/turtle.tsx +143 -0
- package/src/components/icons/update.tsx +108 -0
- package/src/components/icons/warning.tsx +86 -0
- package/src/components/molecules/index.ts +2 -1
- package/src/components/molecules/opportunity/index.ts +5 -1
- package/src/components/molecules/opportunity/opportunity-apr.tsx +99 -16
- package/src/components/molecules/opportunity/opportunity-list/hooks/index.ts +2 -0
- package/src/components/molecules/opportunity/opportunity-list/hooks/use-opportunity-filtering.ts +45 -0
- package/src/components/molecules/opportunity/opportunity-list/hooks/use-opportunity-grouping.ts +81 -0
- package/src/components/molecules/opportunity/opportunity-list/index.ts +1 -0
- package/src/components/molecules/opportunity/opportunity-list/opportunity-list.tsx +136 -0
- package/src/components/molecules/opportunity/opportunity-rate-estimator.tsx +4 -1
- package/src/components/molecules/opportunity/opportunity-section.tsx +37 -19
- package/src/components/molecules/opportunity/opportunity-selector.tsx +2 -3
- package/src/components/molecules/route-details.tsx +48 -37
- package/src/components/molecules/swap-details.tsx +2 -4
- package/src/components/molecules/swap-input.tsx +56 -21
- package/src/components/molecules/tabs.tsx +67 -0
- package/src/components/molecules/token-selector.tsx +2 -2
- package/src/components/molecules/tx-status.tsx +1 -5
- package/src/components/molecules/widget/asset-list/asset-filters.tsx +111 -0
- package/src/components/molecules/widget/asset-list/asset-list.tsx +171 -0
- package/src/components/molecules/widget/asset-list/asset-row.tsx +45 -0
- package/src/components/molecules/widget/asset-list/hooks/index.ts +2 -0
- package/src/components/molecules/widget/asset-list/hooks/use-asset-filtering.ts +42 -0
- package/src/components/molecules/widget/asset-list/hooks/use-asset-grouping.ts +78 -0
- package/src/components/molecules/widget/asset-list/index.ts +3 -0
- package/src/components/molecules/widget/base-selector.tsx +104 -0
- package/src/components/molecules/widget/campaign-item.tsx +76 -0
- package/src/components/molecules/widget/deal-item.tsx +80 -0
- package/src/components/molecules/widget/index.ts +33 -0
- package/src/components/molecules/widget/opportunity-item.tsx +91 -0
- package/src/components/molecules/widget/widget-item-stats.tsx +50 -0
- package/src/components/molecules/widget/widget-item.tsx +138 -0
- package/src/components/molecules/widget/widget-list-items.tsx +86 -0
- package/src/components/ui/alert-dialog.tsx +146 -0
- package/src/components/ui/animated-background/animated-background.tsx +174 -0
- package/src/components/ui/animated-background/index.ts +1 -0
- package/src/components/ui/avatar.tsx +34 -19
- package/src/components/ui/badge.tsx +18 -8
- package/src/components/ui/banner.tsx +78 -0
- package/src/components/ui/button.tsx +51 -21
- package/src/components/ui/card.tsx +21 -61
- package/src/components/ui/checkbox.tsx +29 -0
- package/src/components/ui/collapsible.tsx +22 -0
- package/src/components/ui/combobox.tsx +617 -0
- package/src/components/ui/command.tsx +164 -0
- package/src/components/ui/dialog.tsx +5 -9
- package/src/components/ui/dropdown.tsx +263 -0
- package/src/components/ui/field.tsx +232 -0
- package/src/components/ui/heading.tsx +49 -0
- package/src/components/ui/hover-card.tsx +10 -10
- package/src/components/ui/icon-list.tsx +141 -0
- package/src/components/ui/index.ts +29 -9
- package/src/components/ui/info-card.tsx +1 -1
- package/src/components/ui/input-group.tsx +158 -0
- package/src/components/ui/input.tsx +17 -25
- package/src/components/ui/label-with-icon.tsx +40 -30
- package/src/components/ui/label.tsx +8 -9
- package/src/components/ui/multi-select.tsx +1000 -0
- package/src/components/ui/navigation-menu.tsx +181 -0
- package/src/components/ui/opportunity-details-v1.tsx +2 -2
- package/src/components/ui/popover.tsx +42 -0
- package/src/components/ui/scroll-area.tsx +11 -11
- package/src/components/ui/segment-control.tsx +140 -0
- package/src/components/ui/select.tsx +26 -31
- package/src/components/ui/sheet.tsx +130 -0
- package/src/components/ui/sidebar.tsx +693 -0
- package/src/components/ui/skeleton.tsx +14 -0
- package/src/components/ui/slider.tsx +58 -0
- package/src/components/ui/switch.tsx +8 -11
- package/src/components/ui/{table-shad.tsx → table-shadcn.tsx} +25 -39
- package/src/components/ui/table.tsx +3 -2
- package/src/components/ui/textarea.tsx +22 -0
- package/src/components/ui/tooltip.tsx +11 -7
- package/src/hooks/useIsMobile.ts +74 -0
- package/src/index.ts +2 -0
- package/src/styles/globals.css +87 -20
- package/src/styles/themes/semantic.css +11 -5
- package/src/styles/tokens/colors.css +64 -53
- package/src/styles/tokens/radius.css +3 -34
- package/tsconfig.json +11 -15
- package/vite.config.js +41 -57
- package/dist/types/components/molecules/opportunity/opportunity-item.d.ts +0 -15
- package/dist/types/components/molecules/opportunity/opportunity-item.d.ts.map +0 -1
- package/dist/types/components/ui/table-shad.d.ts +0 -11
- package/dist/types/components/ui/table-shad.d.ts.map +0 -1
- package/src/components/molecules/opportunity/opportunity-item.tsx +0 -93
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { cn } from "@/lib/utils";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
export type TypographyProps = { children: React.ReactNode; className?: string };
|
|
5
|
+
|
|
6
|
+
export function HeadingH1({ children, className }: TypographyProps) {
|
|
7
|
+
return (
|
|
8
|
+
<h1 className={cn("scroll-m-20 text-4xl font-semibold tracking-tight text-balance", className)}>
|
|
9
|
+
{children}
|
|
10
|
+
</h1>
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function HeadingH2({ children, className }: TypographyProps) {
|
|
15
|
+
return (
|
|
16
|
+
<h2 className={cn("scroll-m-20 text-3xl font-normal tracking-tight first:mt-0", className)}>
|
|
17
|
+
{children}
|
|
18
|
+
</h2>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function HeadingH3({ children, className }: TypographyProps) {
|
|
23
|
+
return (
|
|
24
|
+
<h3 className={cn("scroll-m-20 text-xl font-normal tracking-tight", className)}>{children}</h3>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function HeadingH4({ children, className }: TypographyProps) {
|
|
29
|
+
return (
|
|
30
|
+
<h4 className={cn("scroll-m-20 text-lg font-light tracking-tight", className)}>{children}</h4>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function HeadingH5({ children, className }: TypographyProps) {
|
|
35
|
+
return <h5 className={cn("scroll-m-20 font-light tracking-tight", className)}>{children}</h5>;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function HeadingH6({ children, className }: TypographyProps) {
|
|
39
|
+
return (
|
|
40
|
+
<h6
|
|
41
|
+
className={cn(
|
|
42
|
+
"text-muted-foreground scroll-m-20 text-sm font-light tracking-tight",
|
|
43
|
+
className
|
|
44
|
+
)}
|
|
45
|
+
>
|
|
46
|
+
{children}
|
|
47
|
+
</h6>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
@@ -9,33 +9,33 @@ const hoverCardContentVariants = cva(
|
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
12
|
-
container: "
|
|
12
|
+
container: "bg-background relative drop-shadow-lg",
|
|
13
13
|
simple: "bg-muted",
|
|
14
14
|
item: "bg-muted drop-shadow-lg",
|
|
15
15
|
},
|
|
16
16
|
gradientBorder: {
|
|
17
17
|
none: "",
|
|
18
18
|
white:
|
|
19
|
-
"relative before:
|
|
19
|
+
"relative before:pointer-events-none before:absolute before:inset-0 before:rounded-[inherit] before:bg-gradient-to-br before:from-white/40 before:via-transparent before:to-white/10 before:[mask-composite:exclude] before:p-px before:content-[''] before:[mask:linear-gradient(#fff_0_0)_content-box,linear-gradient(#fff_0_0)]",
|
|
20
20
|
green:
|
|
21
|
-
"relative before:
|
|
22
|
-
auto: "relative before:
|
|
21
|
+
"relative before:pointer-events-none before:absolute before:inset-0 before:rounded-[inherit] before:bg-gradient-to-br before:from-[#73F36C]/60 before:via-transparent before:to-[#73F36C]/20 before:[mask-composite:exclude] before:p-px before:content-[''] before:[mask:linear-gradient(#fff_0_0)_content-box,linear-gradient(#fff_0_0)]",
|
|
22
|
+
auto: "light:before:from-black/20 light:before:to-black/5 relative before:pointer-events-none before:absolute before:inset-0 before:rounded-[inherit] before:bg-gradient-to-br before:from-white/40 before:via-transparent before:to-white/10 before:[mask-composite:exclude] before:p-px before:content-[''] before:[mask:linear-gradient(#fff_0_0)_content-box,linear-gradient(#fff_0_0)] dark:before:from-white/40 dark:before:to-white/10",
|
|
23
23
|
},
|
|
24
24
|
padding: {
|
|
25
25
|
none: "p-0",
|
|
26
|
-
sm: "
|
|
27
|
-
default: "
|
|
28
|
-
md: "py-6.5
|
|
29
|
-
lg: "py-8.5
|
|
26
|
+
sm: "px-3.5 py-3.5",
|
|
27
|
+
default: "px-4.5 py-4.5",
|
|
28
|
+
md: "px-6 py-6.5",
|
|
29
|
+
lg: "px-8 py-8.5",
|
|
30
30
|
},
|
|
31
31
|
rounded: {
|
|
32
|
-
default: "rounded-
|
|
32
|
+
default: "rounded-lg",
|
|
33
33
|
infoCard: "rounded-info-card",
|
|
34
34
|
none: "rounded-none",
|
|
35
35
|
sm: "rounded-sm",
|
|
36
36
|
md: "rounded-md",
|
|
37
37
|
lg: "rounded-lg",
|
|
38
|
-
xl: "rounded-
|
|
38
|
+
xl: "rounded-lg",
|
|
39
39
|
full: "rounded-full",
|
|
40
40
|
},
|
|
41
41
|
},
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { cn } from "@/lib/utils";
|
|
3
|
+
import { Avatar, AvatarImage, AvatarFallback } from "@/components/ui/avatar";
|
|
4
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";
|
|
5
|
+
import { useMemo } from "react";
|
|
6
|
+
|
|
7
|
+
interface IconListItem {
|
|
8
|
+
icon: string;
|
|
9
|
+
name: string;
|
|
10
|
+
id?: string; // Optional unique identifier
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface IconListProps extends React.ComponentProps<"div"> {
|
|
14
|
+
items: IconListItem[] | string[];
|
|
15
|
+
label?: string;
|
|
16
|
+
size?: "xs" | "sm" | "md" | "lg";
|
|
17
|
+
maxVisible?: number;
|
|
18
|
+
showTooltip?: boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const sizeClasses = {
|
|
22
|
+
xs: "w-3 h-3 text-[8px]",
|
|
23
|
+
sm: "w-4 h-4 text-[10px]",
|
|
24
|
+
md: "w-5 h-5 text-xs",
|
|
25
|
+
lg: "w-6 h-6 text-sm",
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const IconList = React.forwardRef<HTMLDivElement, IconListProps>(
|
|
29
|
+
(
|
|
30
|
+
{ className, items, label, size = "sm", maxVisible = 6, showTooltip = false, ...props },
|
|
31
|
+
ref
|
|
32
|
+
) => {
|
|
33
|
+
const [loadedImages, setLoadedImages] = React.useState<Set<string>>(new Set());
|
|
34
|
+
|
|
35
|
+
if (!items || items.length === 0) return null;
|
|
36
|
+
|
|
37
|
+
const uniqueItems = useMemo(() => {
|
|
38
|
+
const normalized: IconListItem[] = items.map((item: IconListItem | string, index: number) =>
|
|
39
|
+
typeof item === "string"
|
|
40
|
+
? { icon: item, name: "", id: `item-${index}` }
|
|
41
|
+
: { ...item, id: item.id || `item-${index}` }
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
const unique = normalized.filter(
|
|
45
|
+
(item, index, self) => index === self.findIndex((t) => t.icon === item.icon)
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
return unique;
|
|
49
|
+
}, [items]);
|
|
50
|
+
|
|
51
|
+
const visibleItems = uniqueItems.slice(0, maxVisible);
|
|
52
|
+
const remainingCount = uniqueItems.length - maxVisible;
|
|
53
|
+
const hiddenItems = uniqueItems.slice(maxVisible);
|
|
54
|
+
|
|
55
|
+
const handleImageLoad = (icon: string) => {
|
|
56
|
+
setLoadedImages((prev) => new Set(prev).add(icon));
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const renderAvatar = (item: IconListItem, index: number) => (
|
|
60
|
+
<Avatar
|
|
61
|
+
key={item.id || index}
|
|
62
|
+
className={cn(
|
|
63
|
+
sizeClasses[size],
|
|
64
|
+
"border border-background transition-all hover:z-10 hover:scale-110",
|
|
65
|
+
!loadedImages.has(item.icon) && "animate-pulse"
|
|
66
|
+
)}
|
|
67
|
+
>
|
|
68
|
+
<AvatarImage
|
|
69
|
+
src={item.icon}
|
|
70
|
+
alt={item.name || "Icon"}
|
|
71
|
+
onLoad={() => handleImageLoad(item.icon)}
|
|
72
|
+
/>
|
|
73
|
+
<AvatarFallback className={cn("font-medium", sizeClasses[size].split(" ").pop())}>
|
|
74
|
+
{item.name ? item.name.slice(0, 2).toUpperCase() : "?"}
|
|
75
|
+
</AvatarFallback>
|
|
76
|
+
</Avatar>
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
const renderWithTooltip = (content: React.ReactNode, tooltipText: string) => {
|
|
80
|
+
if (!showTooltip || !tooltipText) return content;
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
<Tooltip>
|
|
84
|
+
<TooltipTrigger asChild>{content}</TooltipTrigger>
|
|
85
|
+
<TooltipContent side="top" className="text-xs">
|
|
86
|
+
{tooltipText}
|
|
87
|
+
</TooltipContent>
|
|
88
|
+
</Tooltip>
|
|
89
|
+
);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
return (
|
|
93
|
+
<TooltipProvider>
|
|
94
|
+
<div
|
|
95
|
+
ref={ref}
|
|
96
|
+
className={cn("flex items-center gap-1", className)}
|
|
97
|
+
role="list"
|
|
98
|
+
aria-label={label || "Icon list"}
|
|
99
|
+
{...props}
|
|
100
|
+
>
|
|
101
|
+
{label && <span className="text-xs text-muted-foreground mr-1">{label}:</span>}
|
|
102
|
+
<div className="flex -space-x-1">
|
|
103
|
+
{visibleItems.map((item, index) => (
|
|
104
|
+
<div key={item.id || index} role="listitem">
|
|
105
|
+
{renderWithTooltip(renderAvatar(item, index), item.name)}
|
|
106
|
+
</div>
|
|
107
|
+
))}
|
|
108
|
+
{remainingCount > 0 && (
|
|
109
|
+
<div role="listitem">
|
|
110
|
+
{renderWithTooltip(
|
|
111
|
+
<Avatar
|
|
112
|
+
className={cn(
|
|
113
|
+
sizeClasses[size],
|
|
114
|
+
"border border-background bg-muted hover:bg-muted/80 transition-all"
|
|
115
|
+
)}
|
|
116
|
+
aria-label={`${remainingCount} more items`}
|
|
117
|
+
>
|
|
118
|
+
<AvatarFallback
|
|
119
|
+
className={cn("font-semibold", sizeClasses[size].split(" ").pop())}
|
|
120
|
+
>
|
|
121
|
+
+{remainingCount}
|
|
122
|
+
</AvatarFallback>
|
|
123
|
+
</Avatar>,
|
|
124
|
+
hiddenItems
|
|
125
|
+
.map((item) => item.name)
|
|
126
|
+
.filter(Boolean)
|
|
127
|
+
.join(", ") || `${remainingCount} more items`
|
|
128
|
+
)}
|
|
129
|
+
</div>
|
|
130
|
+
)}
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
133
|
+
</TooltipProvider>
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
);
|
|
137
|
+
|
|
138
|
+
IconList.displayName = "IconList";
|
|
139
|
+
|
|
140
|
+
export { IconList };
|
|
141
|
+
export type { IconListProps, IconListItem };
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
export * from "./input";
|
|
2
|
-
export * from "./label";
|
|
3
|
-
export * from "./scroll-area";
|
|
4
|
-
export * from "./select";
|
|
5
|
-
export * from "./separator";
|
|
6
1
|
export * from "./sonner";
|
|
7
2
|
export * from "./switch";
|
|
8
3
|
export * from "./toggle-group";
|
|
9
4
|
export * from "./toggle";
|
|
10
|
-
export * from "./tooltip";
|
|
11
|
-
export * from "./button";
|
|
12
|
-
export * from "./card";
|
|
13
5
|
export * from "./chip";
|
|
14
6
|
export * from "./icon-animation";
|
|
15
7
|
export * from "./label-with-icon";
|
|
@@ -18,7 +10,35 @@ export * from "./info-card";
|
|
|
18
10
|
export * from "./opportunity-details-v1";
|
|
19
11
|
export * from "./table";
|
|
20
12
|
export * from "./hover-card";
|
|
13
|
+
export * from "./icon-list";
|
|
14
|
+
export * from "./animated-background";
|
|
15
|
+
// What Mati created / touched / reviewed goes below this line.
|
|
16
|
+
export * from "./separator";
|
|
17
|
+
export * from "./select";
|
|
18
|
+
export * from "./button";
|
|
19
|
+
export * from "./card";
|
|
21
20
|
export * from "./dialog";
|
|
22
21
|
export * from "./avatar";
|
|
23
22
|
export * from "./badge";
|
|
24
|
-
|
|
23
|
+
export * from "./table-shadcn";
|
|
24
|
+
export * from "./checkbox";
|
|
25
|
+
export * from "./dropdown";
|
|
26
|
+
export * from "./segment-control";
|
|
27
|
+
export * from "./input";
|
|
28
|
+
export * from "./input-group";
|
|
29
|
+
export * from "./tooltip";
|
|
30
|
+
export * from "./navigation-menu";
|
|
31
|
+
export * from "./slider";
|
|
32
|
+
export * from "./alert-dialog";
|
|
33
|
+
export * from "./heading";
|
|
34
|
+
export * from "./textarea";
|
|
35
|
+
export * from "./field";
|
|
36
|
+
export * from "./label";
|
|
37
|
+
export * from "./popover";
|
|
38
|
+
export * from "./command";
|
|
39
|
+
export * from "./multi-select";
|
|
40
|
+
export * from "./combobox";
|
|
41
|
+
export * from "./scroll-area";
|
|
42
|
+
export * from "./sidebar";
|
|
43
|
+
export * from "./collapsible";
|
|
44
|
+
export * from "./banner";
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
5
|
+
|
|
6
|
+
import { cn } from "@/lib/utils";
|
|
7
|
+
import { Button } from "@/components/ui/button";
|
|
8
|
+
import { Input } from "@/components/ui/input";
|
|
9
|
+
import { Textarea } from "@/components/ui/textarea";
|
|
10
|
+
|
|
11
|
+
function InputGroup({ className, ...props }: React.ComponentProps<"div">) {
|
|
12
|
+
return (
|
|
13
|
+
<div
|
|
14
|
+
data-slot="input-group"
|
|
15
|
+
role="group"
|
|
16
|
+
className={cn(
|
|
17
|
+
"group/input-group border-input dark:bg-input/30 relative flex w-full items-center rounded-md border shadow-xs transition-[color,box-shadow] outline-none",
|
|
18
|
+
"h-9 min-w-0 has-[>textarea]:h-auto",
|
|
19
|
+
|
|
20
|
+
// Variants based on alignment.
|
|
21
|
+
"has-[>[data-align=inline-start]]:[&>input]:pl-2",
|
|
22
|
+
"has-[>[data-align=inline-end]]:[&>input]:pr-2",
|
|
23
|
+
"has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3",
|
|
24
|
+
"has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3",
|
|
25
|
+
|
|
26
|
+
// Focus state.
|
|
27
|
+
"has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot=input-group-control]:focus-visible]:ring-[3px]",
|
|
28
|
+
|
|
29
|
+
// Error state.
|
|
30
|
+
"has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",
|
|
31
|
+
|
|
32
|
+
className
|
|
33
|
+
)}
|
|
34
|
+
{...props}
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const inputGroupAddonVariants = cva(
|
|
40
|
+
"text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",
|
|
41
|
+
{
|
|
42
|
+
variants: {
|
|
43
|
+
align: {
|
|
44
|
+
"inline-start": "order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]",
|
|
45
|
+
"inline-end": "order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]",
|
|
46
|
+
"block-start":
|
|
47
|
+
"order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5 [.border-b]:pb-3",
|
|
48
|
+
"block-end":
|
|
49
|
+
"order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5 [.border-t]:pt-3",
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
defaultVariants: {
|
|
53
|
+
align: "inline-start",
|
|
54
|
+
},
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
function InputGroupAddon({
|
|
59
|
+
className,
|
|
60
|
+
align = "inline-start",
|
|
61
|
+
...props
|
|
62
|
+
}: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>) {
|
|
63
|
+
return (
|
|
64
|
+
<div
|
|
65
|
+
role="group"
|
|
66
|
+
data-slot="input-group-addon"
|
|
67
|
+
data-align={align}
|
|
68
|
+
className={cn(inputGroupAddonVariants({ align }), className)}
|
|
69
|
+
onClick={(e) => {
|
|
70
|
+
if ((e.target as HTMLElement).closest("button")) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
e.currentTarget.parentElement?.querySelector("input")?.focus();
|
|
74
|
+
}}
|
|
75
|
+
{...props}
|
|
76
|
+
/>
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const inputGroupButtonVariants = cva("flex items-center gap-2 text-sm shadow-none", {
|
|
81
|
+
variants: {
|
|
82
|
+
size: {
|
|
83
|
+
xs: "h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5",
|
|
84
|
+
sm: "h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5",
|
|
85
|
+
"icon-xs": "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",
|
|
86
|
+
"icon-sm": "size-8 p-0 has-[>svg]:p-0",
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
defaultVariants: {
|
|
90
|
+
size: "xs",
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
function InputGroupButton({
|
|
95
|
+
className,
|
|
96
|
+
type = "button",
|
|
97
|
+
variant = "default",
|
|
98
|
+
size = "xs",
|
|
99
|
+
...props
|
|
100
|
+
}: Omit<React.ComponentProps<typeof Button>, "size"> &
|
|
101
|
+
VariantProps<typeof inputGroupButtonVariants>) {
|
|
102
|
+
return (
|
|
103
|
+
<Button
|
|
104
|
+
type={type}
|
|
105
|
+
data-size={size}
|
|
106
|
+
variant={variant}
|
|
107
|
+
className={cn(inputGroupButtonVariants({ size }), className)}
|
|
108
|
+
{...props}
|
|
109
|
+
/>
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function InputGroupText({ className, ...props }: React.ComponentProps<"span">) {
|
|
114
|
+
return (
|
|
115
|
+
<span
|
|
116
|
+
className={cn(
|
|
117
|
+
"text-muted-foreground flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
|
|
118
|
+
className
|
|
119
|
+
)}
|
|
120
|
+
{...props}
|
|
121
|
+
/>
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function InputGroupInput({ className, ...props }: React.ComponentProps<"input">) {
|
|
126
|
+
return (
|
|
127
|
+
<Input
|
|
128
|
+
data-slot="input-group-control"
|
|
129
|
+
className={cn(
|
|
130
|
+
"flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent",
|
|
131
|
+
className
|
|
132
|
+
)}
|
|
133
|
+
{...props}
|
|
134
|
+
/>
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function InputGroupTextarea({ className, ...props }: React.ComponentProps<"textarea">) {
|
|
139
|
+
return (
|
|
140
|
+
<Textarea
|
|
141
|
+
data-slot="input-group-control"
|
|
142
|
+
className={cn(
|
|
143
|
+
"flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent",
|
|
144
|
+
className
|
|
145
|
+
)}
|
|
146
|
+
{...props}
|
|
147
|
+
/>
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export {
|
|
152
|
+
InputGroup,
|
|
153
|
+
InputGroupAddon,
|
|
154
|
+
InputGroupButton,
|
|
155
|
+
InputGroupText,
|
|
156
|
+
InputGroupInput,
|
|
157
|
+
InputGroupTextarea,
|
|
158
|
+
};
|
|
@@ -1,36 +1,30 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
|
-
|
|
4
3
|
import { cn } from "@/lib/utils";
|
|
5
4
|
|
|
6
5
|
const inputVariants = cva(
|
|
7
|
-
|
|
6
|
+
[
|
|
7
|
+
"placeholder:text-muted-foreground flex w-full px-4 py-2.5 text-base md:text-sm",
|
|
8
|
+
"data-invalid:ring-destructive/80 data-invalid:border-destructive",
|
|
9
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
10
|
+
"caret-primary shadow transition-[color,box-shadow]",
|
|
11
|
+
],
|
|
8
12
|
{
|
|
9
13
|
variants: {
|
|
10
14
|
variant: {
|
|
11
15
|
// Turtle Design System - transparent input with no borders
|
|
12
|
-
default:
|
|
16
|
+
default:
|
|
17
|
+
"bg-neutral-alpha-2 focus-visible:border-ring focus-visible:ring-ring/50 rounded-lg border border-none outline-none focus-visible:ring-2",
|
|
13
18
|
// Optional bordered version for other use cases
|
|
14
|
-
bordered:
|
|
19
|
+
bordered:
|
|
20
|
+
"bg-neutral-alpha-2 border-border focus:border-primary focus:ring-primary/20 caret-primary rounded-lg border focus:ring-2",
|
|
15
21
|
// No focus variant - cursor color only, no focus styles
|
|
16
|
-
nofocus:
|
|
17
|
-
|
|
18
|
-
size: {
|
|
19
|
-
default: "h-10 px-3 py-2 text-sm",
|
|
20
|
-
sm: "h-8 px-2 py-1 text-xs",
|
|
21
|
-
lg: "h-12 px-4 py-3 text-base",
|
|
22
|
-
},
|
|
23
|
-
cursor: {
|
|
24
|
-
primary: "caret-primary",
|
|
25
|
-
foreground: "caret-foreground",
|
|
26
|
-
white: "caret-white",
|
|
27
|
-
green: "caret-green-500",
|
|
22
|
+
nofocus:
|
|
23
|
+
"rounded-none border-none bg-transparent focus:border-none focus:ring-0 focus:outline-none",
|
|
28
24
|
},
|
|
29
25
|
},
|
|
30
26
|
defaultVariants: {
|
|
31
27
|
variant: "default",
|
|
32
|
-
size: "default",
|
|
33
|
-
cursor: "primary",
|
|
34
28
|
},
|
|
35
29
|
}
|
|
36
30
|
);
|
|
@@ -43,17 +37,15 @@ export interface InputProps
|
|
|
43
37
|
}
|
|
44
38
|
|
|
45
39
|
const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
|
46
|
-
({ className, variant,
|
|
40
|
+
({ className, variant, type, prompt, ...props }, ref) => {
|
|
47
41
|
if (prompt) {
|
|
48
42
|
return (
|
|
49
43
|
<div className="flex items-center gap-2">
|
|
50
|
-
<span className="text-primary text-sm font-medium
|
|
51
|
-
{prompt}
|
|
52
|
-
</span>
|
|
44
|
+
<span className="text-primary shrink-0 text-sm font-medium">{prompt}</span>
|
|
53
45
|
<input
|
|
54
46
|
type={type}
|
|
55
47
|
data-slot="input"
|
|
56
|
-
className={cn(inputVariants({ variant,
|
|
48
|
+
className={cn(inputVariants({ variant, className }))}
|
|
57
49
|
ref={ref}
|
|
58
50
|
{...props}
|
|
59
51
|
/>
|
|
@@ -64,8 +56,8 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
|
|
64
56
|
return (
|
|
65
57
|
<input
|
|
66
58
|
type={type}
|
|
67
|
-
data-slot="
|
|
68
|
-
className={cn(inputVariants({ variant,
|
|
59
|
+
data-slot="control"
|
|
60
|
+
className={cn(inputVariants({ variant, className }))}
|
|
69
61
|
ref={ref}
|
|
70
62
|
{...props}
|
|
71
63
|
/>
|
|
@@ -3,34 +3,37 @@ import { cva, type VariantProps } from "class-variance-authority";
|
|
|
3
3
|
|
|
4
4
|
import { cn } from "@/lib/utils";
|
|
5
5
|
|
|
6
|
-
const labelWithIconVariants = cva(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
const labelWithIconVariants = cva(
|
|
7
|
+
"inline-flex items-center gap-2 font-medium",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default: "text-foreground",
|
|
12
|
+
muted: "text-muted-foreground",
|
|
13
|
+
primary: "text-primary",
|
|
14
|
+
secondary: "text-secondary-foreground",
|
|
15
|
+
},
|
|
16
|
+
textSize: {
|
|
17
|
+
xs: "text-xs",
|
|
18
|
+
sm: "text-sm",
|
|
19
|
+
base: "text-base",
|
|
20
|
+
lg: "text-lg",
|
|
21
|
+
xl: "text-xl",
|
|
22
|
+
"2xl": "text-2xl",
|
|
23
|
+
"3xl": "text-3xl",
|
|
24
|
+
"4xl": "text-4xl",
|
|
25
|
+
"5xl": "text-5xl",
|
|
26
|
+
"6xl": "text-6xl",
|
|
27
|
+
"7xl": "text-7xl",
|
|
28
|
+
"8xl": "text-8xl",
|
|
29
|
+
},
|
|
13
30
|
},
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
base: "text-base",
|
|
18
|
-
lg: "text-lg",
|
|
19
|
-
xl: "text-xl",
|
|
20
|
-
"2xl": "text-2xl",
|
|
21
|
-
"3xl": "text-3xl",
|
|
22
|
-
"4xl": "text-4xl",
|
|
23
|
-
"5xl": "text-5xl",
|
|
24
|
-
"6xl": "text-6xl",
|
|
25
|
-
"7xl": "text-7xl",
|
|
26
|
-
"8xl": "text-8xl",
|
|
31
|
+
defaultVariants: {
|
|
32
|
+
variant: "default",
|
|
33
|
+
textSize: "sm",
|
|
27
34
|
},
|
|
28
35
|
},
|
|
29
|
-
|
|
30
|
-
variant: "default",
|
|
31
|
-
textSize: "sm",
|
|
32
|
-
},
|
|
33
|
-
});
|
|
36
|
+
);
|
|
34
37
|
|
|
35
38
|
const iconSizeClasses = {
|
|
36
39
|
xs: "w-3 h-3",
|
|
@@ -63,7 +66,7 @@ const LabelWithIcon = React.forwardRef<HTMLDivElement, LabelWithIconProps>(
|
|
|
63
66
|
iconClassName,
|
|
64
67
|
...props
|
|
65
68
|
},
|
|
66
|
-
ref
|
|
69
|
+
ref,
|
|
67
70
|
) => {
|
|
68
71
|
const renderIcon = () => {
|
|
69
72
|
// If icon is a string (URL), render as img
|
|
@@ -72,7 +75,11 @@ const LabelWithIcon = React.forwardRef<HTMLDivElement, LabelWithIconProps>(
|
|
|
72
75
|
<img
|
|
73
76
|
src={icon}
|
|
74
77
|
alt=""
|
|
75
|
-
className={cn(
|
|
78
|
+
className={cn(
|
|
79
|
+
iconSizeClasses[iconSize],
|
|
80
|
+
"rounded-full object-contain",
|
|
81
|
+
iconClassName,
|
|
82
|
+
)}
|
|
76
83
|
/>
|
|
77
84
|
);
|
|
78
85
|
}
|
|
@@ -83,7 +90,10 @@ const LabelWithIcon = React.forwardRef<HTMLDivElement, LabelWithIconProps>(
|
|
|
83
90
|
<span className={cn("shrink-0", iconClassName)}>
|
|
84
91
|
{React.isValidElement(icon)
|
|
85
92
|
? React.cloneElement(icon as React.ReactElement<any>, {
|
|
86
|
-
className: cn(
|
|
93
|
+
className: cn(
|
|
94
|
+
iconSizeClasses[iconSize],
|
|
95
|
+
(icon as any).props?.className,
|
|
96
|
+
),
|
|
87
97
|
})
|
|
88
98
|
: icon}
|
|
89
99
|
</span>
|
|
@@ -96,7 +106,7 @@ const LabelWithIcon = React.forwardRef<HTMLDivElement, LabelWithIconProps>(
|
|
|
96
106
|
className={cn(
|
|
97
107
|
labelWithIconVariants({ variant, textSize }),
|
|
98
108
|
iconPosition === "right" && "flex-row-reverse",
|
|
99
|
-
className
|
|
109
|
+
className,
|
|
100
110
|
)}
|
|
101
111
|
{...props}
|
|
102
112
|
>
|
|
@@ -104,7 +114,7 @@ const LabelWithIcon = React.forwardRef<HTMLDivElement, LabelWithIconProps>(
|
|
|
104
114
|
<span>{children}</span>
|
|
105
115
|
</div>
|
|
106
116
|
);
|
|
107
|
-
}
|
|
117
|
+
},
|
|
108
118
|
);
|
|
109
119
|
|
|
110
120
|
LabelWithIcon.displayName = "LabelWithIcon";
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
import * as LabelPrimitive from "@radix-ui/react-label"
|
|
1
|
+
"use client";
|
|
3
2
|
|
|
4
|
-
import
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}: React.ComponentProps<typeof LabelPrimitive.Root>) {
|
|
6
|
+
import { cn } from "@/lib/utils";
|
|
7
|
+
|
|
8
|
+
function Label({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>) {
|
|
10
9
|
return (
|
|
11
10
|
<LabelPrimitive.Root
|
|
12
11
|
data-slot="label"
|
|
@@ -16,7 +15,7 @@ function Label({
|
|
|
16
15
|
)}
|
|
17
16
|
{...props}
|
|
18
17
|
/>
|
|
19
|
-
)
|
|
18
|
+
);
|
|
20
19
|
}
|
|
21
20
|
|
|
22
|
-
export { Label }
|
|
21
|
+
export { Label };
|