@enya-learning/nova 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/vendor-base-ui-efqwzv4oinwg1f0d.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +26 -11
- package/changelog.md +0 -44
- package/components.json +0 -23
- package/eslint.config.js +0 -30
- package/plopfile.mjs +0 -49
- package/src/components/.gitkeep +0 -0
- package/src/components/accordion/accordion.mdx +0 -83
- package/src/components/accordion/accordion.tsx +0 -81
- package/src/components/accordion/index.ts +0 -1
- package/src/components/alert/alert.tsx +0 -76
- package/src/components/alert/index.ts +0 -1
- package/src/components/alert-dialog/alert-dialog.tsx +0 -187
- package/src/components/alert-dialog/index.ts +0 -1
- package/src/components/aspect-ratio/aspect-ratio.tsx +0 -22
- package/src/components/aspect-ratio/index.ts +0 -1
- package/src/components/avatar/avatar.tsx +0 -107
- package/src/components/avatar/index.ts +0 -1
- package/src/components/badge/badge.tsx +0 -52
- package/src/components/badge/index.ts +0 -1
- package/src/components/breadcrumb/breadcrumb.tsx +0 -122
- package/src/components/breadcrumb/index.ts +0 -1
- package/src/components/button/button.mdx +0 -255
- package/src/components/button/button.tsx +0 -59
- package/src/components/button/index.ts +0 -1
- package/src/components/button-group/button-group.tsx +0 -87
- package/src/components/button-group/index.ts +0 -1
- package/src/components/calendar/calendar.tsx +0 -228
- package/src/components/calendar/index.ts +0 -1
- package/src/components/card/card.tsx +0 -100
- package/src/components/card/index.ts +0 -1
- package/src/components/carousel/carousel.tsx +0 -243
- package/src/components/carousel/index.ts +0 -1
- package/src/components/chart/chart.tsx +0 -371
- package/src/components/chart/index.ts +0 -1
- package/src/components/checkbox/checkbox.tsx +0 -28
- package/src/components/checkbox/index.ts +0 -1
- package/src/components/collapsible/collapsible.tsx +0 -19
- package/src/components/collapsible/index.ts +0 -1
- package/src/components/combobox/combobox.tsx +0 -298
- package/src/components/combobox/index.ts +0 -1
- package/src/components/command/command.tsx +0 -193
- package/src/components/command/index.ts +0 -1
- package/src/components/context-menu/context-menu.tsx +0 -272
- package/src/components/context-menu/index.ts +0 -1
- package/src/components/dialog/dialog.tsx +0 -157
- package/src/components/dialog/index.ts +0 -1
- package/src/components/direction/direction.tsx +0 -4
- package/src/components/direction/index.ts +0 -1
- package/src/components/drawer/drawer.tsx +0 -134
- package/src/components/drawer/index.ts +0 -1
- package/src/components/dropdown-menu/dropdown-menu.tsx +0 -270
- package/src/components/dropdown-menu/index.ts +0 -1
- package/src/components/empty/empty.tsx +0 -104
- package/src/components/empty/index.ts +0 -1
- package/src/components/enya-logo/enya-logo.mdx +0 -174
- package/src/components/enya-logo/enya-logo.tsx +0 -383
- package/src/components/enya-logo/index.ts +0 -1
- package/src/components/field/field.tsx +0 -236
- package/src/components/field/index.ts +0 -1
- package/src/components/hover-card/hover-card.tsx +0 -51
- package/src/components/hover-card/index.ts +0 -1
- package/src/components/input/index.ts +0 -1
- package/src/components/input/input.tsx +0 -20
- package/src/components/input-group/index.ts +0 -1
- package/src/components/input-group/input-group.tsx +0 -157
- package/src/components/input-otp/index.ts +0 -1
- package/src/components/input-otp/input-otp.tsx +0 -84
- package/src/components/item/index.ts +0 -1
- package/src/components/item/item.tsx +0 -201
- package/src/components/kbd/index.ts +0 -1
- package/src/components/kbd/kbd.tsx +0 -26
- package/src/components/label/index.ts +0 -1
- package/src/components/label/label.tsx +0 -20
- package/src/components/menubar/index.ts +0 -1
- package/src/components/menubar/menubar.tsx +0 -281
- package/src/components/native-select/index.ts +0 -1
- package/src/components/native-select/native-select.tsx +0 -65
- package/src/components/navigation-menu/index.ts +0 -1
- package/src/components/navigation-menu/navigation-menu.tsx +0 -171
- package/src/components/pagination/index.ts +0 -1
- package/src/components/pagination/pagination.tsx +0 -133
- package/src/components/popover/index.ts +0 -1
- package/src/components/popover/popover.tsx +0 -88
- package/src/components/progress/index.ts +0 -1
- package/src/components/progress/progress.tsx +0 -83
- package/src/components/radio-group/index.ts +0 -1
- package/src/components/radio-group/radio-group.tsx +0 -36
- package/src/components/resizable/index.ts +0 -1
- package/src/components/resizable/resizable.tsx +0 -50
- package/src/components/scroll-area/index.ts +0 -1
- package/src/components/scroll-area/scroll-area.tsx +0 -53
- package/src/components/select/index.ts +0 -1
- package/src/components/select/select.tsx +0 -205
- package/src/components/separator/index.ts +0 -1
- package/src/components/separator/separator.tsx +0 -23
- package/src/components/sheet/index.ts +0 -1
- package/src/components/sheet/sheet.tsx +0 -137
- package/src/components/sidebar/index.ts +0 -1
- package/src/components/sidebar/sidebar.tsx +0 -722
- package/src/components/skeleton/index.ts +0 -1
- package/src/components/skeleton/skeleton.tsx +0 -13
- package/src/components/slider/index.ts +0 -1
- package/src/components/slider/slider.tsx +0 -52
- package/src/components/sonner/index.ts +0 -1
- package/src/components/sonner/sonner.tsx +0 -45
- package/src/components/spinner/index.ts +0 -1
- package/src/components/spinner/spinner.tsx +0 -15
- package/src/components/switch/index.ts +0 -1
- package/src/components/switch/switch.tsx +0 -30
- package/src/components/table/index.ts +0 -1
- package/src/components/table/table.tsx +0 -116
- package/src/components/tabs/index.ts +0 -1
- package/src/components/tabs/tabs.tsx +0 -80
- package/src/components/textarea/index.ts +0 -1
- package/src/components/textarea/textarea.tsx +0 -18
- package/src/components/toggle/index.ts +0 -1
- package/src/components/toggle/toggle.tsx +0 -45
- package/src/components/toggle-group/index.ts +0 -1
- package/src/components/toggle-group/toggle-group.tsx +0 -87
- package/src/components/tooltip/index.ts +0 -1
- package/src/components/tooltip/tooltip.tsx +0 -64
- package/src/hooks/use-mobile.ts +0 -21
- package/src/index.ts +0 -58
- package/src/lib/.gitkeep +0 -0
- package/src/lib/utils.ts +0 -6
- package/src/styles/nova-binding.css +0 -290
- package/src/styles/nova.css +0 -58
- package/src/styles/theme-nova.css +0 -201
- package/src/styles/typography.css +0 -215
- package/src/utils/index.ts +0 -1
- package/templates/component/component.tsx.hbs +0 -16
- package/templates/component/index.ts.hbs +0 -1
- package/templates/component/stories.tsx.hbs +0 -13
- package/tsconfig.json +0 -18
- package/tsconfig.lint.json +0 -14
- package/vite.config.ts +0 -101
- /package/{src → dist}/styles/globals.css +0 -0
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import { Menu as MenuPrimitive } from "@base-ui/react/menu"
|
|
3
|
-
|
|
4
|
-
import { cn } from "../../lib/utils"
|
|
5
|
-
import { ChevronRightIcon, CheckIcon } from "lucide-react"
|
|
6
|
-
|
|
7
|
-
function DropdownMenu({ ...props }: MenuPrimitive.Root.Props) {
|
|
8
|
-
return <MenuPrimitive.Root data-slot="dropdown-menu" {...props} />
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
function DropdownMenuPortal({ ...props }: MenuPrimitive.Portal.Props) {
|
|
12
|
-
return <MenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function DropdownMenuTrigger({ ...props }: MenuPrimitive.Trigger.Props) {
|
|
16
|
-
return <MenuPrimitive.Trigger data-slot="dropdown-menu-trigger" {...props} />
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function DropdownMenuContent({
|
|
20
|
-
align = "start",
|
|
21
|
-
alignOffset = 0,
|
|
22
|
-
side = "bottom",
|
|
23
|
-
sideOffset = 4,
|
|
24
|
-
className,
|
|
25
|
-
...props
|
|
26
|
-
}: MenuPrimitive.Popup.Props &
|
|
27
|
-
Pick<
|
|
28
|
-
MenuPrimitive.Positioner.Props,
|
|
29
|
-
"align" | "alignOffset" | "side" | "sideOffset"
|
|
30
|
-
>) {
|
|
31
|
-
return (
|
|
32
|
-
<MenuPrimitive.Portal>
|
|
33
|
-
<MenuPrimitive.Positioner
|
|
34
|
-
className="isolate z-50 outline-none"
|
|
35
|
-
align={align}
|
|
36
|
-
alignOffset={alignOffset}
|
|
37
|
-
side={side}
|
|
38
|
-
sideOffset={sideOffset}
|
|
39
|
-
>
|
|
40
|
-
<MenuPrimitive.Popup
|
|
41
|
-
data-slot="dropdown-menu-content"
|
|
42
|
-
className={cn(
|
|
43
|
-
"z-50 max-h-(--available-height) w-(--anchor-width) min-w-48 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-2xl bg-popover p-1 text-popover-foreground shadow-2xl ring-1 ring-foreground/5 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:ring-foreground/10 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
44
|
-
className
|
|
45
|
-
)}
|
|
46
|
-
{...props}
|
|
47
|
-
/>
|
|
48
|
-
</MenuPrimitive.Positioner>
|
|
49
|
-
</MenuPrimitive.Portal>
|
|
50
|
-
)
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function DropdownMenuGroup({ ...props }: MenuPrimitive.Group.Props) {
|
|
54
|
-
return <MenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function DropdownMenuLabel({
|
|
58
|
-
className,
|
|
59
|
-
inset,
|
|
60
|
-
...props
|
|
61
|
-
}: MenuPrimitive.GroupLabel.Props & {
|
|
62
|
-
inset?: boolean
|
|
63
|
-
}) {
|
|
64
|
-
return (
|
|
65
|
-
<MenuPrimitive.GroupLabel
|
|
66
|
-
data-slot="dropdown-menu-label"
|
|
67
|
-
data-inset={inset}
|
|
68
|
-
className={cn(
|
|
69
|
-
"px-3 py-2.5 text-xs text-muted-foreground data-inset:ps-9.5",
|
|
70
|
-
className
|
|
71
|
-
)}
|
|
72
|
-
{...props}
|
|
73
|
-
/>
|
|
74
|
-
)
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function DropdownMenuItem({
|
|
78
|
-
className,
|
|
79
|
-
inset,
|
|
80
|
-
variant = "default",
|
|
81
|
-
...props
|
|
82
|
-
}: MenuPrimitive.Item.Props & {
|
|
83
|
-
inset?: boolean
|
|
84
|
-
variant?: "default" | "destructive"
|
|
85
|
-
}) {
|
|
86
|
-
return (
|
|
87
|
-
<MenuPrimitive.Item
|
|
88
|
-
data-slot="dropdown-menu-item"
|
|
89
|
-
data-inset={inset}
|
|
90
|
-
data-variant={variant}
|
|
91
|
-
className={cn(
|
|
92
|
-
"group/dropdown-menu-item relative flex cursor-default items-center gap-2.5 rounded-xl px-3 py-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:ps-9.5 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",
|
|
93
|
-
className
|
|
94
|
-
)}
|
|
95
|
-
{...props}
|
|
96
|
-
/>
|
|
97
|
-
)
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
function DropdownMenuSub({ ...props }: MenuPrimitive.SubmenuRoot.Props) {
|
|
101
|
-
return <MenuPrimitive.SubmenuRoot data-slot="dropdown-menu-sub" {...props} />
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
function DropdownMenuSubTrigger({
|
|
105
|
-
className,
|
|
106
|
-
inset,
|
|
107
|
-
children,
|
|
108
|
-
...props
|
|
109
|
-
}: MenuPrimitive.SubmenuTrigger.Props & {
|
|
110
|
-
inset?: boolean
|
|
111
|
-
}) {
|
|
112
|
-
return (
|
|
113
|
-
<MenuPrimitive.SubmenuTrigger
|
|
114
|
-
data-slot="dropdown-menu-sub-trigger"
|
|
115
|
-
data-inset={inset}
|
|
116
|
-
className={cn(
|
|
117
|
-
"flex cursor-default items-center gap-2 rounded-xl px-3 py-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:ps-9.5 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
118
|
-
className
|
|
119
|
-
)}
|
|
120
|
-
{...props}
|
|
121
|
-
>
|
|
122
|
-
{children}
|
|
123
|
-
<ChevronRightIcon className="ms-auto rtl:rotate-180" />
|
|
124
|
-
</MenuPrimitive.SubmenuTrigger>
|
|
125
|
-
)
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
function DropdownMenuSubContent({
|
|
129
|
-
align = "start",
|
|
130
|
-
alignOffset = -3,
|
|
131
|
-
side = "inline-end",
|
|
132
|
-
sideOffset = 0,
|
|
133
|
-
className,
|
|
134
|
-
...props
|
|
135
|
-
}: React.ComponentProps<typeof DropdownMenuContent>) {
|
|
136
|
-
return (
|
|
137
|
-
<DropdownMenuContent
|
|
138
|
-
data-slot="dropdown-menu-sub-content"
|
|
139
|
-
className={cn(
|
|
140
|
-
"w-auto min-w-36 rounded-2xl bg-popover p-1 text-popover-foreground shadow-2xl ring-1 ring-foreground/5 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
141
|
-
className
|
|
142
|
-
)}
|
|
143
|
-
align={align}
|
|
144
|
-
alignOffset={alignOffset}
|
|
145
|
-
side={side}
|
|
146
|
-
sideOffset={sideOffset}
|
|
147
|
-
{...props}
|
|
148
|
-
/>
|
|
149
|
-
)
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
function DropdownMenuCheckboxItem({
|
|
153
|
-
className,
|
|
154
|
-
children,
|
|
155
|
-
checked,
|
|
156
|
-
inset,
|
|
157
|
-
...props
|
|
158
|
-
}: MenuPrimitive.CheckboxItem.Props & {
|
|
159
|
-
inset?: boolean
|
|
160
|
-
}) {
|
|
161
|
-
return (
|
|
162
|
-
<MenuPrimitive.CheckboxItem
|
|
163
|
-
data-slot="dropdown-menu-checkbox-item"
|
|
164
|
-
data-inset={inset}
|
|
165
|
-
className={cn(
|
|
166
|
-
"relative flex cursor-default items-center gap-2.5 rounded-xl py-2 ps-3 pe-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:ps-9.5 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
167
|
-
className
|
|
168
|
-
)}
|
|
169
|
-
checked={checked}
|
|
170
|
-
{...props}
|
|
171
|
-
>
|
|
172
|
-
<span
|
|
173
|
-
className="pointer-events-none absolute end-2 flex items-center justify-center"
|
|
174
|
-
data-slot="dropdown-menu-checkbox-item-indicator"
|
|
175
|
-
>
|
|
176
|
-
<MenuPrimitive.CheckboxItemIndicator>
|
|
177
|
-
<CheckIcon />
|
|
178
|
-
</MenuPrimitive.CheckboxItemIndicator>
|
|
179
|
-
</span>
|
|
180
|
-
{children}
|
|
181
|
-
</MenuPrimitive.CheckboxItem>
|
|
182
|
-
)
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
function DropdownMenuRadioGroup({ ...props }: MenuPrimitive.RadioGroup.Props) {
|
|
186
|
-
return (
|
|
187
|
-
<MenuPrimitive.RadioGroup
|
|
188
|
-
data-slot="dropdown-menu-radio-group"
|
|
189
|
-
{...props}
|
|
190
|
-
/>
|
|
191
|
-
)
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
function DropdownMenuRadioItem({
|
|
195
|
-
className,
|
|
196
|
-
children,
|
|
197
|
-
inset,
|
|
198
|
-
...props
|
|
199
|
-
}: MenuPrimitive.RadioItem.Props & {
|
|
200
|
-
inset?: boolean
|
|
201
|
-
}) {
|
|
202
|
-
return (
|
|
203
|
-
<MenuPrimitive.RadioItem
|
|
204
|
-
data-slot="dropdown-menu-radio-item"
|
|
205
|
-
data-inset={inset}
|
|
206
|
-
className={cn(
|
|
207
|
-
"relative flex cursor-default items-center gap-2.5 rounded-xl py-2 ps-3 pe-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:ps-9.5 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
208
|
-
className
|
|
209
|
-
)}
|
|
210
|
-
{...props}
|
|
211
|
-
>
|
|
212
|
-
<span
|
|
213
|
-
className="pointer-events-none absolute end-2 flex items-center justify-center"
|
|
214
|
-
data-slot="dropdown-menu-radio-item-indicator"
|
|
215
|
-
>
|
|
216
|
-
<MenuPrimitive.RadioItemIndicator>
|
|
217
|
-
<CheckIcon />
|
|
218
|
-
</MenuPrimitive.RadioItemIndicator>
|
|
219
|
-
</span>
|
|
220
|
-
{children}
|
|
221
|
-
</MenuPrimitive.RadioItem>
|
|
222
|
-
)
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
function DropdownMenuSeparator({
|
|
226
|
-
className,
|
|
227
|
-
...props
|
|
228
|
-
}: MenuPrimitive.Separator.Props) {
|
|
229
|
-
return (
|
|
230
|
-
<MenuPrimitive.Separator
|
|
231
|
-
data-slot="dropdown-menu-separator"
|
|
232
|
-
className={cn("-mx-1 my-1 h-px bg-border/50", className)}
|
|
233
|
-
{...props}
|
|
234
|
-
/>
|
|
235
|
-
)
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
function DropdownMenuShortcut({
|
|
239
|
-
className,
|
|
240
|
-
...props
|
|
241
|
-
}: React.ComponentProps<"span">) {
|
|
242
|
-
return (
|
|
243
|
-
<span
|
|
244
|
-
data-slot="dropdown-menu-shortcut"
|
|
245
|
-
className={cn(
|
|
246
|
-
"ms-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground",
|
|
247
|
-
className
|
|
248
|
-
)}
|
|
249
|
-
{...props}
|
|
250
|
-
/>
|
|
251
|
-
)
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
export {
|
|
255
|
-
DropdownMenu,
|
|
256
|
-
DropdownMenuPortal,
|
|
257
|
-
DropdownMenuTrigger,
|
|
258
|
-
DropdownMenuContent,
|
|
259
|
-
DropdownMenuGroup,
|
|
260
|
-
DropdownMenuLabel,
|
|
261
|
-
DropdownMenuItem,
|
|
262
|
-
DropdownMenuCheckboxItem,
|
|
263
|
-
DropdownMenuRadioGroup,
|
|
264
|
-
DropdownMenuRadioItem,
|
|
265
|
-
DropdownMenuSeparator,
|
|
266
|
-
DropdownMenuShortcut,
|
|
267
|
-
DropdownMenuSub,
|
|
268
|
-
DropdownMenuSubTrigger,
|
|
269
|
-
DropdownMenuSubContent,
|
|
270
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./dropdown-menu"
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { cva, type VariantProps } from "class-variance-authority"
|
|
2
|
-
|
|
3
|
-
import { cn } from "../../lib/utils"
|
|
4
|
-
|
|
5
|
-
function Empty({ className, ...props }: React.ComponentProps<"div">) {
|
|
6
|
-
return (
|
|
7
|
-
<div
|
|
8
|
-
data-slot="empty"
|
|
9
|
-
className={cn(
|
|
10
|
-
"flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-lg border-dashed p-12 text-center text-balance",
|
|
11
|
-
className
|
|
12
|
-
)}
|
|
13
|
-
{...props}
|
|
14
|
-
/>
|
|
15
|
-
)
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function EmptyHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
19
|
-
return (
|
|
20
|
-
<div
|
|
21
|
-
data-slot="empty-header"
|
|
22
|
-
className={cn("flex max-w-sm flex-col items-center gap-2", className)}
|
|
23
|
-
{...props}
|
|
24
|
-
/>
|
|
25
|
-
)
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const emptyMediaVariants = cva(
|
|
29
|
-
"mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
30
|
-
{
|
|
31
|
-
variants: {
|
|
32
|
-
variant: {
|
|
33
|
-
default: "bg-transparent",
|
|
34
|
-
icon: "flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-6",
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
defaultVariants: {
|
|
38
|
-
variant: "default",
|
|
39
|
-
},
|
|
40
|
-
}
|
|
41
|
-
)
|
|
42
|
-
|
|
43
|
-
function EmptyMedia({
|
|
44
|
-
className,
|
|
45
|
-
variant = "default",
|
|
46
|
-
...props
|
|
47
|
-
}: React.ComponentProps<"div"> & VariantProps<typeof emptyMediaVariants>) {
|
|
48
|
-
return (
|
|
49
|
-
<div
|
|
50
|
-
data-slot="empty-icon"
|
|
51
|
-
data-variant={variant}
|
|
52
|
-
className={cn(emptyMediaVariants({ variant, className }))}
|
|
53
|
-
{...props}
|
|
54
|
-
/>
|
|
55
|
-
)
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function EmptyTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
59
|
-
return (
|
|
60
|
-
<div
|
|
61
|
-
data-slot="empty-title"
|
|
62
|
-
className={cn(
|
|
63
|
-
"font-heading text-lg font-medium tracking-tight",
|
|
64
|
-
className
|
|
65
|
-
)}
|
|
66
|
-
{...props}
|
|
67
|
-
/>
|
|
68
|
-
)
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
function EmptyDescription({ className, ...props }: React.ComponentProps<"p">) {
|
|
72
|
-
return (
|
|
73
|
-
<div
|
|
74
|
-
data-slot="empty-description"
|
|
75
|
-
className={cn(
|
|
76
|
-
"text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",
|
|
77
|
-
className
|
|
78
|
-
)}
|
|
79
|
-
{...props}
|
|
80
|
-
/>
|
|
81
|
-
)
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
function EmptyContent({ className, ...props }: React.ComponentProps<"div">) {
|
|
85
|
-
return (
|
|
86
|
-
<div
|
|
87
|
-
data-slot="empty-content"
|
|
88
|
-
className={cn(
|
|
89
|
-
"flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance",
|
|
90
|
-
className
|
|
91
|
-
)}
|
|
92
|
-
{...props}
|
|
93
|
-
/>
|
|
94
|
-
)
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export {
|
|
98
|
-
Empty,
|
|
99
|
-
EmptyHeader,
|
|
100
|
-
EmptyTitle,
|
|
101
|
-
EmptyDescription,
|
|
102
|
-
EmptyContent,
|
|
103
|
-
EmptyMedia,
|
|
104
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./empty"
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Enya Logo
|
|
3
|
-
description: Enya Learning brand logo component with icon, wordmark, and full logo variants.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
import { Meta, Canvas, Controls } from '@storybook/blocks';
|
|
7
|
-
import * as EnyaLogoStories from './enya-logo.stories';
|
|
8
|
-
import { EnyaLogo, generateEnyaLogoSvg } from './enya-logo';
|
|
9
|
-
|
|
10
|
-
<Meta of={EnyaLogoStories} />
|
|
11
|
-
|
|
12
|
-
# Enya Logo
|
|
13
|
-
|
|
14
|
-
The `EnyaLogo` component renders the Enya Learning brand identity as an inline SVG. It supports three variants (icon, wordmark, full), two orientations for the full logo (horizontal, vertical), and three color schemes (primary, black, white).
|
|
15
|
-
|
|
16
|
-
## Usage
|
|
17
|
-
|
|
18
|
-
```tsx
|
|
19
|
-
import { EnyaLogo } from "@enya-learning/nova/components/enya-logo";
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
```tsx
|
|
23
|
-
<EnyaLogo className="w-40" />
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
<div className="my-4 flex items-center justify-center rounded-xl border border-border bg-muted/30 p-8">
|
|
27
|
-
<EnyaLogo className="w-40" />
|
|
28
|
-
</div>
|
|
29
|
-
|
|
30
|
-
<Canvas of={EnyaLogoStories.Default} />
|
|
31
|
-
|
|
32
|
-
## Examples
|
|
33
|
-
|
|
34
|
-
### Full Logo — Horizontal
|
|
35
|
-
|
|
36
|
-
The default layout places the icon to the left and the wordmark to the right.
|
|
37
|
-
|
|
38
|
-
```tsx
|
|
39
|
-
<EnyaLogo variant="full" orientation="horizontal" className="w-56" />
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
<div className="my-4 flex items-center justify-center rounded-xl border border-border bg-muted/30 p-8">
|
|
43
|
-
<EnyaLogo variant="full" orientation="horizontal" className="w-56" />
|
|
44
|
-
</div>
|
|
45
|
-
|
|
46
|
-
<Canvas of={EnyaLogoStories.HorizontalPrimary} />
|
|
47
|
-
|
|
48
|
-
### Full Logo — Vertical
|
|
49
|
-
|
|
50
|
-
Use `orientation="vertical"` to stack the icon above the wordmark.
|
|
51
|
-
|
|
52
|
-
```tsx
|
|
53
|
-
<EnyaLogo variant="full" orientation="vertical" className="w-36" />
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
<div className="my-4 flex items-center justify-center rounded-xl border border-border bg-muted/30 p-8">
|
|
57
|
-
<EnyaLogo variant="full" orientation="vertical" className="w-36" />
|
|
58
|
-
</div>
|
|
59
|
-
|
|
60
|
-
<Canvas of={EnyaLogoStories.VerticalPrimary} />
|
|
61
|
-
|
|
62
|
-
### Icon Only
|
|
63
|
-
|
|
64
|
-
Use `variant="icon"` to display just the brand mark with its colored background square.
|
|
65
|
-
|
|
66
|
-
```tsx
|
|
67
|
-
<EnyaLogo variant="icon" className="w-16" />
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
<div className="my-4 flex items-center justify-center rounded-xl border border-border bg-muted/30 p-8">
|
|
71
|
-
<EnyaLogo variant="icon" className="w-16" />
|
|
72
|
-
</div>
|
|
73
|
-
|
|
74
|
-
<Canvas of={EnyaLogoStories.IconPrimary} />
|
|
75
|
-
|
|
76
|
-
### Wordmark Only
|
|
77
|
-
|
|
78
|
-
Use `variant="wordmark"` to display the "Enya learning" text without the icon.
|
|
79
|
-
|
|
80
|
-
```tsx
|
|
81
|
-
<EnyaLogo variant="wordmark" className="w-64" />
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
<div className="my-4 flex items-center justify-center rounded-xl border border-border bg-muted/30 p-8">
|
|
85
|
-
<EnyaLogo variant="wordmark" className="w-64" />
|
|
86
|
-
</div>
|
|
87
|
-
|
|
88
|
-
<Canvas of={EnyaLogoStories.WordmarkDark} />
|
|
89
|
-
|
|
90
|
-
### Color Variants
|
|
91
|
-
|
|
92
|
-
Three color schemes are available for every variant. Use `primary` on light or neutral backgrounds, `black` on dark backgrounds.
|
|
93
|
-
|
|
94
|
-
```tsx
|
|
95
|
-
<EnyaLogo color="primary" className="w-40" />
|
|
96
|
-
<EnyaLogo color="white" className="w-40" />
|
|
97
|
-
<EnyaLogo color="black" className="w-40" />
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
<div className="my-4 flex flex-wrap items-center gap-8 rounded-xl border border-border bg-muted/30 p-8">
|
|
101
|
-
<EnyaLogo color="primary" className="w-40" />
|
|
102
|
-
<EnyaLogo color="white" className="w-40" />
|
|
103
|
-
<div className="rounded-lg bg-[#151515] p-4">
|
|
104
|
-
<EnyaLogo color="black" className="w-40" />
|
|
105
|
-
</div>
|
|
106
|
-
</div>
|
|
107
|
-
|
|
108
|
-
<Canvas of={EnyaLogoStories.HorizontalPrimary} />
|
|
109
|
-
<Canvas of={EnyaLogoStories.HorizontalWhite} />
|
|
110
|
-
<Canvas of={EnyaLogoStories.HorizontalBlack} />
|
|
111
|
-
|
|
112
|
-
### Sizing
|
|
113
|
-
|
|
114
|
-
Size the logo with a Tailwind width class. The height scales automatically to maintain aspect ratio.
|
|
115
|
-
|
|
116
|
-
```tsx
|
|
117
|
-
<EnyaLogo className="w-24" />
|
|
118
|
-
<EnyaLogo className="w-40" />
|
|
119
|
-
<EnyaLogo className="w-56" />
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
<div className="my-4 flex flex-wrap items-end gap-6 rounded-xl border border-border bg-muted/30 p-8">
|
|
123
|
-
<EnyaLogo className="w-24" />
|
|
124
|
-
<EnyaLogo className="w-40" />
|
|
125
|
-
<EnyaLogo className="w-56" />
|
|
126
|
-
</div>
|
|
127
|
-
|
|
128
|
-
## SVG Generation
|
|
129
|
-
|
|
130
|
-
Use `generateEnyaLogoSvg()` to get copy-paste ready SVG markup for non-React contexts such as emails, PDFs, or design tools.
|
|
131
|
-
|
|
132
|
-
```ts
|
|
133
|
-
import { generateEnyaLogoSvg } from "@enya-learning/nova/components/enya-logo";
|
|
134
|
-
|
|
135
|
-
// Icon SVG
|
|
136
|
-
const iconSvg = generateEnyaLogoSvg({ variant: "icon" });
|
|
137
|
-
|
|
138
|
-
// Full horizontal logo, primary color
|
|
139
|
-
const fullSvg = generateEnyaLogoSvg({ variant: "full", orientation: "horizontal", color: "primary" });
|
|
140
|
-
|
|
141
|
-
// Copy to clipboard
|
|
142
|
-
await navigator.clipboard.writeText(
|
|
143
|
-
generateEnyaLogoSvg({ variant: "icon", color: "primary" }),
|
|
144
|
-
);
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
## API Reference
|
|
148
|
-
|
|
149
|
-
### EnyaLogo
|
|
150
|
-
|
|
151
|
-
`EnyaLogo` extends `SVGSVGElement` and forwards all standard SVG attributes to the root `<svg>` element.
|
|
152
|
-
|
|
153
|
-
| Prop | Type | Default |
|
|
154
|
-
|------|------|---------|
|
|
155
|
-
| `variant` | `"full" \| "icon" \| "wordmark"` | `"full"` |
|
|
156
|
-
| `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` |
|
|
157
|
-
| `color` | `"primary" \| "black" \| "white"` | `"primary"` |
|
|
158
|
-
| `className` | `string` | — |
|
|
159
|
-
|
|
160
|
-
`orientation` only applies when `variant="full"`. All other `SVGSVGElement` props (`aria-label`, `style`, `data-*`, etc.) are forwarded directly.
|
|
161
|
-
|
|
162
|
-
### generateEnyaLogoSvg
|
|
163
|
-
|
|
164
|
-
```ts
|
|
165
|
-
generateEnyaLogoSvg(options?: {
|
|
166
|
-
variant?: "full" | "icon" | "wordmark";
|
|
167
|
-
orientation?: "horizontal" | "vertical";
|
|
168
|
-
color?: "primary" | "black" | "white";
|
|
169
|
-
}): string
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
Returns a raw SVG string. All options default to the same values as `EnyaLogo`.
|
|
173
|
-
|
|
174
|
-
<Controls of={EnyaLogoStories.Default} />
|