@arolariu/components 0.0.35 → 0.0.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/changelog.md +13 -0
- package/dist/cjs/components/ui/accordion.cjs +1 -1
- package/dist/cjs/components/ui/accordion.cjs.map +1 -1
- package/dist/cjs/components/ui/alert-dialog.cjs +1 -1
- package/dist/cjs/components/ui/alert-dialog.cjs.map +1 -1
- package/dist/cjs/components/ui/alert.cjs +1 -1
- package/dist/cjs/components/ui/alert.cjs.map +1 -1
- package/dist/cjs/components/ui/aspect-ratio.cjs.map +1 -1
- package/dist/cjs/components/ui/avatar.cjs.map +1 -1
- package/dist/cjs/components/ui/background-beams.cjs +210 -0
- package/dist/cjs/components/ui/background-beams.cjs.map +1 -0
- package/dist/cjs/components/ui/badge.cjs +1 -1
- package/dist/cjs/components/ui/badge.cjs.map +1 -1
- package/dist/cjs/components/ui/breadcrumb.cjs.map +1 -1
- package/dist/cjs/components/ui/bubble-background.cjs +214 -0
- package/dist/cjs/components/ui/bubble-background.cjs.map +1 -0
- package/dist/cjs/components/ui/button.cjs +6 -6
- package/dist/cjs/components/ui/button.cjs.map +1 -1
- package/dist/cjs/components/ui/card.cjs +13 -3
- package/dist/cjs/components/ui/card.cjs.map +1 -1
- package/dist/cjs/components/ui/carousel.cjs.map +1 -1
- package/dist/cjs/components/ui/chart.cjs.map +1 -1
- package/dist/cjs/components/ui/checkbox.cjs +1 -1
- package/dist/cjs/components/ui/checkbox.cjs.map +1 -1
- package/dist/cjs/components/ui/collapsible.cjs +1 -1
- package/dist/cjs/components/ui/collapsible.cjs.map +1 -1
- package/dist/cjs/components/ui/command.cjs +2 -2
- package/dist/cjs/components/ui/command.cjs.map +1 -1
- package/dist/cjs/components/ui/context-menu.cjs +7 -7
- package/dist/cjs/components/ui/context-menu.cjs.map +1 -1
- package/dist/cjs/components/ui/counting-number.cjs +95 -0
- package/dist/cjs/components/ui/counting-number.cjs.map +1 -0
- package/dist/cjs/components/ui/dialog.cjs +1 -1
- package/dist/cjs/components/ui/dialog.cjs.map +1 -1
- package/dist/cjs/components/ui/dot-background.cjs +131 -0
- package/dist/cjs/components/ui/dot-background.cjs.map +1 -0
- package/dist/cjs/components/ui/drawer.cjs +3 -3
- package/dist/cjs/components/ui/drawer.cjs.map +1 -1
- package/dist/cjs/components/ui/dropdown-menu.cjs +7 -7
- package/dist/cjs/components/ui/dropdown-menu.cjs.map +1 -1
- package/dist/cjs/components/ui/fireworks-background.cjs +259 -0
- package/dist/cjs/components/ui/fireworks-background.cjs.map +1 -0
- package/dist/cjs/components/ui/flip-button.cjs +100 -0
- package/dist/cjs/components/ui/flip-button.cjs.map +1 -0
- package/dist/cjs/components/ui/form.cjs +2 -2
- package/dist/cjs/components/ui/form.cjs.map +1 -1
- package/dist/cjs/components/ui/gradient-background.cjs +60 -0
- package/dist/cjs/components/ui/gradient-background.cjs.map +1 -0
- package/dist/cjs/components/ui/gradient-text.cjs +83 -0
- package/dist/cjs/components/ui/gradient-text.cjs.map +1 -0
- package/dist/cjs/components/ui/highlight-text.cjs +74 -0
- package/dist/cjs/components/ui/highlight-text.cjs.map +1 -0
- package/dist/cjs/components/ui/hole-background.cjs +361 -0
- package/dist/cjs/components/ui/hole-background.cjs.map +1 -0
- package/dist/cjs/components/ui/hover-card.cjs +9 -6
- package/dist/cjs/components/ui/hover-card.cjs.map +1 -1
- package/dist/cjs/components/ui/input-otp.cjs +2 -3
- package/dist/cjs/components/ui/input-otp.cjs.map +1 -1
- package/dist/cjs/components/ui/input.cjs +1 -1
- package/dist/cjs/components/ui/input.cjs.map +1 -1
- package/dist/cjs/components/ui/label.cjs.map +1 -1
- package/dist/cjs/components/ui/menubar.cjs +9 -9
- package/dist/cjs/components/ui/menubar.cjs.map +1 -1
- package/dist/cjs/components/ui/navigation-menu.cjs +5 -5
- package/dist/cjs/components/ui/navigation-menu.cjs.map +1 -1
- package/dist/cjs/components/ui/pagination.cjs.map +1 -1
- package/dist/cjs/components/ui/popover.cjs +1 -1
- package/dist/cjs/components/ui/popover.cjs.map +1 -1
- package/dist/cjs/components/ui/progress.cjs.map +1 -1
- package/dist/cjs/components/ui/radio-group.cjs +1 -1
- package/dist/cjs/components/ui/radio-group.cjs.map +1 -1
- package/dist/cjs/components/ui/resizable.cjs.map +1 -1
- package/dist/cjs/components/ui/ripple-button.cjs +108 -0
- package/dist/cjs/components/ui/ripple-button.cjs.map +1 -0
- package/dist/cjs/components/ui/scratcher.cjs +179 -0
- package/dist/cjs/components/ui/scratcher.cjs.map +1 -0
- package/dist/cjs/components/ui/scroll-area.cjs +1 -1
- package/dist/cjs/components/ui/scroll-area.cjs.map +1 -1
- package/dist/cjs/components/ui/select.cjs +6 -5
- package/dist/cjs/components/ui/select.cjs.map +1 -1
- package/dist/cjs/components/ui/separator.cjs.map +1 -1
- package/dist/cjs/components/ui/sheet.cjs +1 -1
- package/dist/cjs/components/ui/sheet.cjs.map +1 -1
- package/dist/cjs/components/ui/sidebar.cjs +14 -11
- package/dist/cjs/components/ui/sidebar.cjs.map +1 -1
- package/dist/cjs/components/ui/skeleton.cjs +2 -1
- package/dist/cjs/components/ui/skeleton.cjs.map +1 -1
- package/dist/cjs/components/ui/slider.cjs +2 -2
- package/dist/cjs/components/ui/slider.cjs.map +1 -1
- package/dist/cjs/components/ui/sonner.cjs +5 -7
- package/dist/cjs/components/ui/sonner.cjs.map +1 -1
- package/dist/cjs/components/ui/switch.cjs +2 -2
- package/dist/cjs/components/ui/switch.cjs.map +1 -1
- package/dist/cjs/components/ui/table.cjs +2 -2
- package/dist/cjs/components/ui/table.cjs.map +1 -1
- package/dist/cjs/components/ui/tabs.cjs +3 -3
- package/dist/cjs/components/ui/tabs.cjs.map +1 -1
- package/dist/cjs/components/ui/textarea.cjs +1 -1
- package/dist/cjs/components/ui/textarea.cjs.map +1 -1
- package/dist/cjs/components/ui/toggle-group.cjs +2 -2
- package/dist/cjs/components/ui/toggle-group.cjs.map +1 -1
- package/dist/cjs/components/ui/toggle.cjs +2 -2
- package/dist/cjs/components/ui/toggle.cjs.map +1 -1
- package/dist/cjs/components/ui/tooltip.cjs +1 -1
- package/dist/cjs/components/ui/tooltip.cjs.map +1 -1
- package/dist/cjs/index.cjs +55 -4
- package/dist/cjs/index.css +1013 -258
- package/dist/esm/components/ui/accordion.js +1 -1
- package/dist/esm/components/ui/accordion.js.map +1 -1
- package/dist/esm/components/ui/alert-dialog.js +1 -1
- package/dist/esm/components/ui/alert-dialog.js.map +1 -1
- package/dist/esm/components/ui/alert.js +1 -1
- package/dist/esm/components/ui/alert.js.map +1 -1
- package/dist/esm/components/ui/aspect-ratio.js.map +1 -1
- package/dist/esm/components/ui/avatar.js.map +1 -1
- package/dist/esm/components/ui/background-beams.js +166 -0
- package/dist/esm/components/ui/background-beams.js.map +1 -0
- package/dist/esm/components/ui/badge.js +1 -1
- package/dist/esm/components/ui/badge.js.map +1 -1
- package/dist/esm/components/ui/breadcrumb.js.map +1 -1
- package/dist/esm/components/ui/bubble-background.js +180 -0
- package/dist/esm/components/ui/bubble-background.js.map +1 -0
- package/dist/esm/components/ui/button.js +6 -6
- package/dist/esm/components/ui/button.js.map +1 -1
- package/dist/esm/components/ui/card.js +11 -4
- package/dist/esm/components/ui/card.js.map +1 -1
- package/dist/esm/components/ui/carousel.js.map +1 -1
- package/dist/esm/components/ui/chart.js.map +1 -1
- package/dist/esm/components/ui/checkbox.js +1 -1
- package/dist/esm/components/ui/checkbox.js.map +1 -1
- package/dist/esm/components/ui/collapsible.js +1 -1
- package/dist/esm/components/ui/collapsible.js.map +1 -1
- package/dist/esm/components/ui/command.js +2 -2
- package/dist/esm/components/ui/command.js.map +1 -1
- package/dist/esm/components/ui/context-menu.js +7 -7
- package/dist/esm/components/ui/context-menu.js.map +1 -1
- package/dist/esm/components/ui/counting-number.js +61 -0
- package/dist/esm/components/ui/counting-number.js.map +1 -0
- package/dist/esm/components/ui/dialog.js +1 -1
- package/dist/esm/components/ui/dialog.js.map +1 -1
- package/dist/esm/components/ui/dot-background.js +97 -0
- package/dist/esm/components/ui/dot-background.js.map +1 -0
- package/dist/esm/components/ui/drawer.js +3 -3
- package/dist/esm/components/ui/drawer.js.map +1 -1
- package/dist/esm/components/ui/dropdown-menu.js +7 -7
- package/dist/esm/components/ui/dropdown-menu.js.map +1 -1
- package/dist/esm/components/ui/fireworks-background.js +225 -0
- package/dist/esm/components/ui/fireworks-background.js.map +1 -0
- package/dist/esm/components/ui/flip-button.js +66 -0
- package/dist/esm/components/ui/flip-button.js.map +1 -0
- package/dist/esm/components/ui/form.js +2 -2
- package/dist/esm/components/ui/form.js.map +1 -1
- package/dist/esm/components/ui/gradient-background.js +26 -0
- package/dist/esm/components/ui/gradient-background.js.map +1 -0
- package/dist/esm/components/ui/gradient-text.js +49 -0
- package/dist/esm/components/ui/gradient-text.js.map +1 -0
- package/dist/esm/components/ui/highlight-text.js +40 -0
- package/dist/esm/components/ui/highlight-text.js.map +1 -0
- package/dist/esm/components/ui/hole-background.js +327 -0
- package/dist/esm/components/ui/hole-background.js.map +1 -0
- package/dist/esm/components/ui/hover-card.js +9 -6
- package/dist/esm/components/ui/hover-card.js.map +1 -1
- package/dist/esm/components/ui/input-otp.js +2 -3
- package/dist/esm/components/ui/input-otp.js.map +1 -1
- package/dist/esm/components/ui/input.js +1 -1
- package/dist/esm/components/ui/input.js.map +1 -1
- package/dist/esm/components/ui/label.js.map +1 -1
- package/dist/esm/components/ui/menubar.js +9 -9
- package/dist/esm/components/ui/menubar.js.map +1 -1
- package/dist/esm/components/ui/navigation-menu.js +5 -5
- package/dist/esm/components/ui/navigation-menu.js.map +1 -1
- package/dist/esm/components/ui/pagination.js.map +1 -1
- package/dist/esm/components/ui/popover.js +1 -1
- package/dist/esm/components/ui/popover.js.map +1 -1
- package/dist/esm/components/ui/progress.js.map +1 -1
- package/dist/esm/components/ui/radio-group.js +1 -1
- package/dist/esm/components/ui/radio-group.js.map +1 -1
- package/dist/esm/components/ui/resizable.js.map +1 -1
- package/dist/esm/components/ui/ripple-button.js +74 -0
- package/dist/esm/components/ui/ripple-button.js.map +1 -0
- package/dist/esm/components/ui/scratcher.js +145 -0
- package/dist/esm/components/ui/scratcher.js.map +1 -0
- package/dist/esm/components/ui/scroll-area.js +1 -1
- package/dist/esm/components/ui/scroll-area.js.map +1 -1
- package/dist/esm/components/ui/select.js +6 -5
- package/dist/esm/components/ui/select.js.map +1 -1
- package/dist/esm/components/ui/separator.js.map +1 -1
- package/dist/esm/components/ui/sheet.js +1 -1
- package/dist/esm/components/ui/sheet.js.map +1 -1
- package/dist/esm/components/ui/sidebar.js +14 -11
- package/dist/esm/components/ui/sidebar.js.map +1 -1
- package/dist/esm/components/ui/skeleton.js +2 -1
- package/dist/esm/components/ui/skeleton.js.map +1 -1
- package/dist/esm/components/ui/slider.js +2 -2
- package/dist/esm/components/ui/slider.js.map +1 -1
- package/dist/esm/components/ui/sonner.js +5 -7
- package/dist/esm/components/ui/sonner.js.map +1 -1
- package/dist/esm/components/ui/switch.js +2 -2
- package/dist/esm/components/ui/switch.js.map +1 -1
- package/dist/esm/components/ui/table.js +2 -2
- package/dist/esm/components/ui/table.js.map +1 -1
- package/dist/esm/components/ui/tabs.js +3 -3
- package/dist/esm/components/ui/tabs.js.map +1 -1
- package/dist/esm/components/ui/textarea.js +1 -1
- package/dist/esm/components/ui/textarea.js.map +1 -1
- package/dist/esm/components/ui/toggle-group.js +2 -2
- package/dist/esm/components/ui/toggle-group.js.map +1 -1
- package/dist/esm/components/ui/toggle.js +2 -2
- package/dist/esm/components/ui/toggle.js.map +1 -1
- package/dist/esm/components/ui/tooltip.js +1 -1
- package/dist/esm/components/ui/tooltip.js.map +1 -1
- package/dist/esm/index.css +1013 -258
- package/dist/esm/index.js +26 -1
- package/dist/index.css +1013 -258
- package/dist/index.js +26 -1
- package/dist/types/components/ui/background-beams.d.ts +4 -0
- package/dist/types/components/ui/bubble-background.d.ts +16 -0
- package/dist/types/components/ui/card.d.ts +2 -1
- package/dist/types/components/ui/counting-number.d.ts +15 -0
- package/dist/types/components/ui/dot-background.d.ts +57 -0
- package/dist/types/components/ui/fireworks-background.d.ts +24 -0
- package/dist/types/components/ui/flip-button.d.ts +13 -0
- package/dist/types/components/ui/form.d.ts +1 -1
- package/dist/types/components/ui/gradient-background.d.ts +7 -0
- package/dist/types/components/ui/gradient-text.d.ts +10 -0
- package/dist/types/components/ui/highlight-text.d.ts +11 -0
- package/dist/types/components/ui/hole-background.d.ts +9 -0
- package/dist/types/components/ui/ripple-button.d.ts +10 -0
- package/dist/types/components/ui/scratcher.d.ts +12 -0
- package/dist/types/components/ui/select.d.ts +3 -1
- package/dist/types/components/ui/sidebar.d.ts +5 -6
- package/dist/types/index.d.ts +13 -1
- package/package.json +536 -461
- package/readme.md +10 -6
- package/src/components/ui/accordion.tsx +3 -2
- package/src/components/ui/alert-dialog.tsx +160 -160
- package/src/components/ui/alert.tsx +3 -2
- package/src/components/ui/aspect-ratio.tsx +12 -12
- package/src/components/ui/avatar.tsx +53 -52
- package/src/components/ui/background-beams.tsx +142 -0
- package/src/components/ui/badge.tsx +48 -47
- package/src/components/ui/breadcrumb.tsx +117 -116
- package/src/components/ui/bubble-background.tsx +187 -0
- package/src/components/ui/button.tsx +61 -60
- package/src/components/ui/card.tsx +97 -79
- package/src/components/ui/carousel.tsx +241 -240
- package/src/components/ui/chart.tsx +353 -352
- package/src/components/ui/checkbox.tsx +32 -31
- package/src/components/ui/collapsible.tsx +34 -34
- package/src/components/ui/command.tsx +177 -176
- package/src/components/ui/context-menu.tsx +255 -254
- package/src/components/ui/counting-number.tsx +108 -0
- package/src/components/ui/dialog.tsx +3 -2
- package/src/components/ui/dot-background.tsx +158 -0
- package/src/components/ui/drawer.tsx +138 -137
- package/src/components/ui/dropdown-menu.tsx +260 -259
- package/src/components/ui/fireworks-background.tsx +378 -0
- package/src/components/ui/flip-button.tsx +110 -0
- package/src/components/ui/form.tsx +174 -173
- package/src/components/ui/gradient-background.tsx +43 -0
- package/src/components/ui/gradient-text.tsx +65 -0
- package/src/components/ui/highlight-text.tsx +71 -0
- package/src/components/ui/hole-background.tsx +361 -0
- package/src/components/ui/hover-card.tsx +44 -41
- package/src/components/ui/input-otp.tsx +77 -77
- package/src/components/ui/input.tsx +23 -22
- package/src/components/ui/label.tsx +24 -23
- package/src/components/ui/menubar.tsx +279 -278
- package/src/components/ui/navigation-menu.tsx +171 -170
- package/src/components/ui/pagination.tsx +129 -128
- package/src/components/ui/popover.tsx +48 -47
- package/src/components/ui/progress.tsx +31 -30
- package/src/components/ui/radio-group.tsx +45 -44
- package/src/components/ui/resizable.tsx +56 -55
- package/src/components/ui/ripple-button.tsx +111 -0
- package/src/components/ui/scratcher.tsx +171 -0
- package/src/components/ui/scroll-area.tsx +58 -57
- package/src/components/ui/select.tsx +191 -183
- package/src/components/ui/separator.tsx +28 -27
- package/src/components/ui/sheet.tsx +145 -144
- package/src/components/ui/sidebar.tsx +729 -725
- package/src/components/ui/skeleton.tsx +19 -17
- package/src/components/ui/slider.tsx +63 -62
- package/src/components/ui/sonner.tsx +8 -12
- package/src/components/ui/switch.tsx +31 -30
- package/src/components/ui/table.tsx +119 -118
- package/src/components/ui/tabs.tsx +66 -65
- package/src/components/ui/textarea.tsx +20 -19
- package/src/components/ui/toggle-group.tsx +73 -72
- package/src/components/ui/toggle.tsx +47 -46
- package/src/components/ui/tooltip.tsx +61 -60
- package/src/index.css +75 -42
- package/src/index.ts +385 -330
|
@@ -1,173 +1,174 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
5
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
6
|
-
import {
|
|
7
|
-
Controller,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
} from "react-hook-form";
|
|
15
|
-
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
> =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
const
|
|
48
|
-
const
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
{
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
data-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
{
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
{
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
const
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
{
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
5
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
6
|
+
import {
|
|
7
|
+
Controller,
|
|
8
|
+
FormProvider,
|
|
9
|
+
useFormContext,
|
|
10
|
+
useFormState,
|
|
11
|
+
type ControllerProps,
|
|
12
|
+
type FieldPath,
|
|
13
|
+
type FieldValues,
|
|
14
|
+
} from "react-hook-form";
|
|
15
|
+
|
|
16
|
+
import { cn } from "@/lib/utils";
|
|
17
|
+
import { Label } from "@/components/ui/label";
|
|
18
|
+
|
|
19
|
+
const Form = FormProvider;
|
|
20
|
+
|
|
21
|
+
type FormFieldContextValue<
|
|
22
|
+
TFieldValues extends FieldValues = FieldValues,
|
|
23
|
+
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>
|
|
24
|
+
> = {
|
|
25
|
+
name: TName;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const FormFieldContext = React.createContext<FormFieldContextValue>(
|
|
29
|
+
{} as FormFieldContextValue
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
const FormField = <
|
|
33
|
+
TFieldValues extends FieldValues = FieldValues,
|
|
34
|
+
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>
|
|
35
|
+
>({
|
|
36
|
+
...props
|
|
37
|
+
}: ControllerProps<TFieldValues, TName>) => {
|
|
38
|
+
return (
|
|
39
|
+
<FormFieldContext.Provider value={{ name: props.name }}>
|
|
40
|
+
<Controller {...props} />
|
|
41
|
+
</FormFieldContext.Provider>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const useFormField = () => {
|
|
46
|
+
const fieldContext = React.useContext(FormFieldContext);
|
|
47
|
+
const itemContext = React.useContext(FormItemContext);
|
|
48
|
+
const { getFieldState } = useFormContext();
|
|
49
|
+
const formState = useFormState({ name: fieldContext.name });
|
|
50
|
+
const fieldState = getFieldState(fieldContext.name, formState);
|
|
51
|
+
|
|
52
|
+
if (!fieldContext) {
|
|
53
|
+
throw new Error("useFormField should be used within <FormField>");
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const { id } = itemContext;
|
|
57
|
+
|
|
58
|
+
return {
|
|
59
|
+
id,
|
|
60
|
+
name: fieldContext.name,
|
|
61
|
+
formItemId: `${id}-form-item`,
|
|
62
|
+
formDescriptionId: `${id}-form-item-description`,
|
|
63
|
+
formMessageId: `${id}-form-item-message`,
|
|
64
|
+
...fieldState,
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
type FormItemContextValue = {
|
|
69
|
+
id: string;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const FormItemContext = React.createContext<FormItemContextValue>(
|
|
73
|
+
{} as FormItemContextValue
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
function FormItem({ className, ...props }: React.ComponentProps<"div">) {
|
|
77
|
+
const id = React.useId();
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<FormItemContext.Provider value={{ id }}>
|
|
81
|
+
<div
|
|
82
|
+
data-slot="form-item"
|
|
83
|
+
className={cn("grid gap-2", className)}
|
|
84
|
+
{...props}
|
|
85
|
+
/>
|
|
86
|
+
</FormItemContext.Provider>
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function FormLabel({
|
|
91
|
+
className,
|
|
92
|
+
...props
|
|
93
|
+
}: React.ComponentProps<typeof LabelPrimitive.Root>) {
|
|
94
|
+
const { error, formItemId } = useFormField();
|
|
95
|
+
|
|
96
|
+
return (
|
|
97
|
+
<Label
|
|
98
|
+
data-slot="form-label"
|
|
99
|
+
data-error={!!error}
|
|
100
|
+
className={cn(
|
|
101
|
+
"data-[error=true]:text-red-500 dark:data-[error=true]:text-red-900",
|
|
102
|
+
className
|
|
103
|
+
)}
|
|
104
|
+
htmlFor={formItemId}
|
|
105
|
+
{...props}
|
|
106
|
+
/>
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function FormControl({ ...props }: React.ComponentProps<typeof Slot>) {
|
|
111
|
+
const { error, formItemId, formDescriptionId, formMessageId } =
|
|
112
|
+
useFormField();
|
|
113
|
+
|
|
114
|
+
return (
|
|
115
|
+
<Slot
|
|
116
|
+
data-slot="form-control"
|
|
117
|
+
id={formItemId}
|
|
118
|
+
aria-describedby={
|
|
119
|
+
!error
|
|
120
|
+
? `${formDescriptionId}`
|
|
121
|
+
: `${formDescriptionId} ${formMessageId}`
|
|
122
|
+
}
|
|
123
|
+
aria-invalid={!!error}
|
|
124
|
+
{...props}
|
|
125
|
+
/>
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function FormDescription({ className, ...props }: React.ComponentProps<"p">) {
|
|
130
|
+
const { formDescriptionId } = useFormField();
|
|
131
|
+
|
|
132
|
+
return (
|
|
133
|
+
<p
|
|
134
|
+
data-slot="form-description"
|
|
135
|
+
id={formDescriptionId}
|
|
136
|
+
className={cn(
|
|
137
|
+
"text-neutral-500 text-sm dark:text-neutral-400",
|
|
138
|
+
className
|
|
139
|
+
)}
|
|
140
|
+
{...props}
|
|
141
|
+
/>
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function FormMessage({ className, ...props }: React.ComponentProps<"p">) {
|
|
146
|
+
const { error, formMessageId } = useFormField();
|
|
147
|
+
const body = error ? String(error?.message ?? "") : props.children;
|
|
148
|
+
|
|
149
|
+
if (!body) {
|
|
150
|
+
return null;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
return (
|
|
154
|
+
<p
|
|
155
|
+
data-slot="form-message"
|
|
156
|
+
id={formMessageId}
|
|
157
|
+
className={cn("text-red-500 text-sm dark:text-red-900", className)}
|
|
158
|
+
{...props}
|
|
159
|
+
>
|
|
160
|
+
{body}
|
|
161
|
+
</p>
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export {
|
|
166
|
+
useFormField,
|
|
167
|
+
Form,
|
|
168
|
+
FormItem,
|
|
169
|
+
FormLabel,
|
|
170
|
+
FormControl,
|
|
171
|
+
FormDescription,
|
|
172
|
+
FormMessage,
|
|
173
|
+
FormField,
|
|
174
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { HTMLMotionProps, motion, type Transition } from "motion/react";
|
|
5
|
+
|
|
6
|
+
import { cn } from "@/lib/utils";
|
|
7
|
+
|
|
8
|
+
interface GradientBackgroundProps extends HTMLMotionProps<"div"> {
|
|
9
|
+
transition?: Transition;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const GradientBackground = React.forwardRef<
|
|
13
|
+
HTMLDivElement,
|
|
14
|
+
GradientBackgroundProps
|
|
15
|
+
>(
|
|
16
|
+
(
|
|
17
|
+
{
|
|
18
|
+
className,
|
|
19
|
+
transition = { duration: 15, ease: "easeInOut", repeat: Infinity },
|
|
20
|
+
...props
|
|
21
|
+
},
|
|
22
|
+
ref
|
|
23
|
+
) => {
|
|
24
|
+
return (
|
|
25
|
+
<motion.div
|
|
26
|
+
ref={ref}
|
|
27
|
+
className={cn(
|
|
28
|
+
"size-full bg-gradient-to-br from-blue-500 via-purple-500 to-pink-500 bg-[length:400%_400%]",
|
|
29
|
+
className
|
|
30
|
+
)}
|
|
31
|
+
animate={{
|
|
32
|
+
backgroundPosition: ["0% 50%", "100% 50%", "0% 50%"],
|
|
33
|
+
}}
|
|
34
|
+
transition={transition}
|
|
35
|
+
{...props}
|
|
36
|
+
/>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
GradientBackground.displayName = "GradientBackground";
|
|
42
|
+
|
|
43
|
+
export { GradientBackground, type GradientBackgroundProps };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { motion, type Transition } from "motion/react";
|
|
5
|
+
|
|
6
|
+
import { cn } from "@/lib/utils";
|
|
7
|
+
|
|
8
|
+
interface GradientTextProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
9
|
+
text: string;
|
|
10
|
+
gradient?: string;
|
|
11
|
+
neon?: boolean;
|
|
12
|
+
transition?: Transition;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const GradientText = React.forwardRef<HTMLSpanElement, GradientTextProps>(
|
|
16
|
+
(
|
|
17
|
+
{
|
|
18
|
+
text,
|
|
19
|
+
className,
|
|
20
|
+
gradient = "linear-gradient(90deg, #3b82f6 0%, #a855f7 20%, #ec4899 50%, #a855f7 80%, #3b82f6 100%)",
|
|
21
|
+
neon = false,
|
|
22
|
+
transition = { duration: 50, repeat: Infinity, ease: "linear" },
|
|
23
|
+
...props
|
|
24
|
+
},
|
|
25
|
+
ref
|
|
26
|
+
) => {
|
|
27
|
+
const baseStyle: React.CSSProperties = {
|
|
28
|
+
backgroundImage: gradient,
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<span
|
|
33
|
+
ref={ref}
|
|
34
|
+
className={cn("relative inline-block", className)}
|
|
35
|
+
{...props}
|
|
36
|
+
>
|
|
37
|
+
<motion.span
|
|
38
|
+
className="m-0 text-transparent bg-clip-text bg-[length:700%_100%] bg-[position:0%_0%]"
|
|
39
|
+
style={baseStyle}
|
|
40
|
+
initial={{ backgroundPosition: "0% 0%" }}
|
|
41
|
+
animate={{ backgroundPosition: "500% 100%" }}
|
|
42
|
+
transition={transition}
|
|
43
|
+
>
|
|
44
|
+
{text}
|
|
45
|
+
</motion.span>
|
|
46
|
+
|
|
47
|
+
{neon && (
|
|
48
|
+
<motion.span
|
|
49
|
+
className="m-0 absolute top-0 left-0 text-transparent bg-clip-text blur-[8px] mix-blend-plus-lighter bg-[length:700%_100%] bg-[position:0%_0%]"
|
|
50
|
+
style={baseStyle}
|
|
51
|
+
initial={{ backgroundPosition: "0% 0%" }}
|
|
52
|
+
animate={{ backgroundPosition: "500% 100%" }}
|
|
53
|
+
transition={transition}
|
|
54
|
+
>
|
|
55
|
+
{text}
|
|
56
|
+
</motion.span>
|
|
57
|
+
)}
|
|
58
|
+
</span>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
GradientText.displayName = "GradientText";
|
|
64
|
+
|
|
65
|
+
export { GradientText, type GradientTextProps };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import {
|
|
5
|
+
motion,
|
|
6
|
+
useInView,
|
|
7
|
+
type HTMLMotionProps,
|
|
8
|
+
type Transition,
|
|
9
|
+
type UseInViewOptions,
|
|
10
|
+
} from "motion/react";
|
|
11
|
+
|
|
12
|
+
import { cn } from "@/lib/utils";
|
|
13
|
+
|
|
14
|
+
interface HighlightTextProps extends HTMLMotionProps<"span"> {
|
|
15
|
+
text: string;
|
|
16
|
+
inView?: boolean;
|
|
17
|
+
inViewMargin?: UseInViewOptions["margin"];
|
|
18
|
+
inViewOnce?: boolean;
|
|
19
|
+
transition?: Transition;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const animation = { backgroundSize: "100% 100%" };
|
|
23
|
+
|
|
24
|
+
const HighlightText = React.forwardRef<HTMLSpanElement, HighlightTextProps>(
|
|
25
|
+
(
|
|
26
|
+
{
|
|
27
|
+
text,
|
|
28
|
+
className,
|
|
29
|
+
inView = false,
|
|
30
|
+
inViewMargin = "0px",
|
|
31
|
+
transition = { duration: 2, ease: "easeInOut" },
|
|
32
|
+
...props
|
|
33
|
+
},
|
|
34
|
+
ref
|
|
35
|
+
) => {
|
|
36
|
+
const localRef = React.useRef<HTMLSpanElement>(null);
|
|
37
|
+
React.useImperativeHandle(ref, () => localRef.current as HTMLSpanElement);
|
|
38
|
+
|
|
39
|
+
const inViewResult = useInView(localRef, {
|
|
40
|
+
once: true,
|
|
41
|
+
margin: inViewMargin,
|
|
42
|
+
});
|
|
43
|
+
const isInView = !inView || inViewResult;
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<motion.span
|
|
47
|
+
ref={localRef}
|
|
48
|
+
initial={{
|
|
49
|
+
backgroundSize: "0% 100%",
|
|
50
|
+
}}
|
|
51
|
+
animate={isInView ? animation : undefined}
|
|
52
|
+
transition={transition}
|
|
53
|
+
style={{
|
|
54
|
+
backgroundRepeat: "no-repeat",
|
|
55
|
+
backgroundPosition: "left center",
|
|
56
|
+
display: "inline",
|
|
57
|
+
}}
|
|
58
|
+
className={cn(
|
|
59
|
+
`relative inline-block px-2 py-1 rounded-lg bg-gradient-to-r from-blue-100 to-purple-100 dark:from-blue-500 dark:to-purple-500`,
|
|
60
|
+
className
|
|
61
|
+
)}
|
|
62
|
+
{...props}
|
|
63
|
+
>
|
|
64
|
+
{text}
|
|
65
|
+
</motion.span>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
HighlightText.displayName = "HighlightText";
|
|
70
|
+
|
|
71
|
+
export { HighlightText, type HighlightTextProps };
|