@enya-learning/nova 0.4.0 → 0.4.2

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.
Files changed (148) hide show
  1. package/dist/chunks/{button-npy7isi3nsvlhf86.js → button-kvgr8g13fe959ju0.js} +19 -19
  2. package/dist/chunks/{button-npy7isi3nsvlhf86.js.map → button-kvgr8g13fe959ju0.js.map} +1 -1
  3. package/dist/chunks/vendor-utils-egkaeebaqpft6cxj.js +473 -0
  4. package/dist/chunks/vendor-utils-egkaeebaqpft6cxj.js.map +1 -0
  5. package/dist/components/button.js +1 -1
  6. package/dist/components/enya-logo.js +1 -1
  7. package/dist/index.js +6782 -7036
  8. package/dist/index.js.map +1 -1
  9. package/package.json +26 -11
  10. package/changelog.md +0 -44
  11. package/components.json +0 -23
  12. package/dist/chunks/vendor-base-ui-efqwzv4oinwg1f0d.js +0 -16049
  13. package/dist/chunks/vendor-base-ui-efqwzv4oinwg1f0d.js.map +0 -1
  14. package/eslint.config.js +0 -30
  15. package/plopfile.mjs +0 -49
  16. package/src/components/.gitkeep +0 -0
  17. package/src/components/accordion/accordion.mdx +0 -83
  18. package/src/components/accordion/accordion.tsx +0 -81
  19. package/src/components/accordion/index.ts +0 -1
  20. package/src/components/alert/alert.tsx +0 -76
  21. package/src/components/alert/index.ts +0 -1
  22. package/src/components/alert-dialog/alert-dialog.tsx +0 -187
  23. package/src/components/alert-dialog/index.ts +0 -1
  24. package/src/components/aspect-ratio/aspect-ratio.tsx +0 -22
  25. package/src/components/aspect-ratio/index.ts +0 -1
  26. package/src/components/avatar/avatar.tsx +0 -107
  27. package/src/components/avatar/index.ts +0 -1
  28. package/src/components/badge/badge.tsx +0 -52
  29. package/src/components/badge/index.ts +0 -1
  30. package/src/components/breadcrumb/breadcrumb.tsx +0 -122
  31. package/src/components/breadcrumb/index.ts +0 -1
  32. package/src/components/button/button.mdx +0 -255
  33. package/src/components/button/button.tsx +0 -59
  34. package/src/components/button/index.ts +0 -1
  35. package/src/components/button-group/button-group.tsx +0 -87
  36. package/src/components/button-group/index.ts +0 -1
  37. package/src/components/calendar/calendar.tsx +0 -228
  38. package/src/components/calendar/index.ts +0 -1
  39. package/src/components/card/card.tsx +0 -100
  40. package/src/components/card/index.ts +0 -1
  41. package/src/components/carousel/carousel.tsx +0 -243
  42. package/src/components/carousel/index.ts +0 -1
  43. package/src/components/chart/chart.tsx +0 -371
  44. package/src/components/chart/index.ts +0 -1
  45. package/src/components/checkbox/checkbox.tsx +0 -28
  46. package/src/components/checkbox/index.ts +0 -1
  47. package/src/components/collapsible/collapsible.tsx +0 -19
  48. package/src/components/collapsible/index.ts +0 -1
  49. package/src/components/combobox/combobox.tsx +0 -298
  50. package/src/components/combobox/index.ts +0 -1
  51. package/src/components/command/command.tsx +0 -193
  52. package/src/components/command/index.ts +0 -1
  53. package/src/components/context-menu/context-menu.tsx +0 -272
  54. package/src/components/context-menu/index.ts +0 -1
  55. package/src/components/dialog/dialog.tsx +0 -157
  56. package/src/components/dialog/index.ts +0 -1
  57. package/src/components/direction/direction.tsx +0 -4
  58. package/src/components/direction/index.ts +0 -1
  59. package/src/components/drawer/drawer.tsx +0 -134
  60. package/src/components/drawer/index.ts +0 -1
  61. package/src/components/dropdown-menu/dropdown-menu.tsx +0 -270
  62. package/src/components/dropdown-menu/index.ts +0 -1
  63. package/src/components/empty/empty.tsx +0 -104
  64. package/src/components/empty/index.ts +0 -1
  65. package/src/components/enya-logo/enya-logo.mdx +0 -174
  66. package/src/components/enya-logo/enya-logo.tsx +0 -383
  67. package/src/components/enya-logo/index.ts +0 -1
  68. package/src/components/field/field.tsx +0 -236
  69. package/src/components/field/index.ts +0 -1
  70. package/src/components/hover-card/hover-card.tsx +0 -51
  71. package/src/components/hover-card/index.ts +0 -1
  72. package/src/components/input/index.ts +0 -1
  73. package/src/components/input/input.tsx +0 -20
  74. package/src/components/input-group/index.ts +0 -1
  75. package/src/components/input-group/input-group.tsx +0 -157
  76. package/src/components/input-otp/index.ts +0 -1
  77. package/src/components/input-otp/input-otp.tsx +0 -84
  78. package/src/components/item/index.ts +0 -1
  79. package/src/components/item/item.tsx +0 -201
  80. package/src/components/kbd/index.ts +0 -1
  81. package/src/components/kbd/kbd.tsx +0 -26
  82. package/src/components/label/index.ts +0 -1
  83. package/src/components/label/label.tsx +0 -20
  84. package/src/components/menubar/index.ts +0 -1
  85. package/src/components/menubar/menubar.tsx +0 -281
  86. package/src/components/native-select/index.ts +0 -1
  87. package/src/components/native-select/native-select.tsx +0 -65
  88. package/src/components/navigation-menu/index.ts +0 -1
  89. package/src/components/navigation-menu/navigation-menu.tsx +0 -171
  90. package/src/components/pagination/index.ts +0 -1
  91. package/src/components/pagination/pagination.tsx +0 -133
  92. package/src/components/popover/index.ts +0 -1
  93. package/src/components/popover/popover.tsx +0 -88
  94. package/src/components/progress/index.ts +0 -1
  95. package/src/components/progress/progress.tsx +0 -83
  96. package/src/components/radio-group/index.ts +0 -1
  97. package/src/components/radio-group/radio-group.tsx +0 -36
  98. package/src/components/resizable/index.ts +0 -1
  99. package/src/components/resizable/resizable.tsx +0 -50
  100. package/src/components/scroll-area/index.ts +0 -1
  101. package/src/components/scroll-area/scroll-area.tsx +0 -53
  102. package/src/components/select/index.ts +0 -1
  103. package/src/components/select/select.tsx +0 -205
  104. package/src/components/separator/index.ts +0 -1
  105. package/src/components/separator/separator.tsx +0 -23
  106. package/src/components/sheet/index.ts +0 -1
  107. package/src/components/sheet/sheet.tsx +0 -137
  108. package/src/components/sidebar/index.ts +0 -1
  109. package/src/components/sidebar/sidebar.tsx +0 -722
  110. package/src/components/skeleton/index.ts +0 -1
  111. package/src/components/skeleton/skeleton.tsx +0 -13
  112. package/src/components/slider/index.ts +0 -1
  113. package/src/components/slider/slider.tsx +0 -52
  114. package/src/components/sonner/index.ts +0 -1
  115. package/src/components/sonner/sonner.tsx +0 -45
  116. package/src/components/spinner/index.ts +0 -1
  117. package/src/components/spinner/spinner.tsx +0 -15
  118. package/src/components/switch/index.ts +0 -1
  119. package/src/components/switch/switch.tsx +0 -30
  120. package/src/components/table/index.ts +0 -1
  121. package/src/components/table/table.tsx +0 -116
  122. package/src/components/tabs/index.ts +0 -1
  123. package/src/components/tabs/tabs.tsx +0 -80
  124. package/src/components/textarea/index.ts +0 -1
  125. package/src/components/textarea/textarea.tsx +0 -18
  126. package/src/components/toggle/index.ts +0 -1
  127. package/src/components/toggle/toggle.tsx +0 -45
  128. package/src/components/toggle-group/index.ts +0 -1
  129. package/src/components/toggle-group/toggle-group.tsx +0 -87
  130. package/src/components/tooltip/index.ts +0 -1
  131. package/src/components/tooltip/tooltip.tsx +0 -64
  132. package/src/hooks/use-mobile.ts +0 -21
  133. package/src/index.ts +0 -58
  134. package/src/lib/.gitkeep +0 -0
  135. package/src/lib/utils.ts +0 -6
  136. package/src/styles/nova-binding.css +0 -290
  137. package/src/styles/nova.css +0 -58
  138. package/src/styles/theme-nova.css +0 -201
  139. package/src/styles/typography.css +0 -215
  140. package/src/utils/index.ts +0 -1
  141. package/templates/component/component.tsx.hbs +0 -16
  142. package/templates/component/index.ts.hbs +0 -1
  143. package/templates/component/stories.tsx.hbs +0 -13
  144. package/tsconfig.json +0 -18
  145. package/tsconfig.lint.json +0 -14
  146. package/vite.config.ts +0 -101
  147. /package/{Readme.md → README.md} +0 -0
  148. /package/{src → dist}/styles/globals.css +0 -0
package/eslint.config.js DELETED
@@ -1,30 +0,0 @@
1
- import js from "@eslint/js"
2
- import globals from "globals"
3
- import reactHooks from "eslint-plugin-react-hooks"
4
- import reactRefresh from "eslint-plugin-react-refresh"
5
- import tseslint from "typescript-eslint"
6
- import { defineConfig, globalIgnores } from "eslint/config"
7
- import eslintConfigPrettier from "eslint-config-prettier"
8
- import novaPlugin from "./src/eslint/index.js"
9
-
10
- export default defineConfig([
11
- globalIgnores(["dist"]),
12
- {
13
- files: ["**/*.{ts,tsx}"],
14
- extends: [
15
- js.configs.recommended,
16
- tseslint.configs.recommended,
17
- reactHooks.configs.flat.recommended,
18
- reactRefresh.configs.vite,
19
- eslintConfigPrettier,
20
- ],
21
- plugins: { nova: novaPlugin },
22
- languageOptions: {
23
- globals: globals.browser,
24
- },
25
- rules: {
26
- "react-refresh/only-export-components": "off",
27
- "nova/no-primitive-colors": "error",
28
- },
29
- },
30
- ])
package/plopfile.mjs DELETED
@@ -1,49 +0,0 @@
1
- export default function (plop) {
2
- plop.setGenerator("component", {
3
- description: "Scaffold a new Nova component",
4
- prompts: [
5
- {
6
- type: "input",
7
- name: "name",
8
- message: "Component name (e.g. Button, DatePicker):",
9
- validate: (value) =>
10
- value.trim().length > 0 ? true : "Component name is required",
11
- },
12
- ],
13
- actions: [
14
- {
15
- type: "add",
16
- path: "src/components/{{kebabCase name}}/{{kebabCase name}}.tsx",
17
- templateFile: "templates/component/component.tsx.hbs",
18
- },
19
- {
20
- type: "add",
21
- path: "src/components/{{kebabCase name}}/index.ts",
22
- templateFile: "templates/component/index.ts.hbs",
23
- },
24
- {
25
- type: "add",
26
- path: "src/components/{{kebabCase name}}/{{kebabCase name}}.stories.tsx",
27
- templateFile: "templates/component/stories.tsx.hbs",
28
- },
29
- {
30
- type: "modify",
31
- path: "src/index.ts",
32
- pattern: /(export \* from "\.\/utils")/,
33
- template: 'export * from "./components/{{kebabCase name}}"\n$1',
34
- },
35
- {
36
- type: "modify",
37
- path: "vite.config.ts",
38
- pattern: / \/\/ ADD_COMPONENT_ENTRY_HERE/,
39
- template: [
40
- ' "components/{{kebabCase name}}": resolve(',
41
- " __dirname,",
42
- ' "src/components/{{kebabCase name}}/index.ts"',
43
- " ),",
44
- " // ADD_COMPONENT_ENTRY_HERE",
45
- ].join("\n"),
46
- },
47
- ],
48
- })
49
- }
File without changes
@@ -1,83 +0,0 @@
1
- ---
2
- title: Accordion
3
- description: A vertically stacked set of interactive headings that each reveal a section of content.
4
- ---
5
-
6
- import { Meta, Canvas, Controls } from '@storybook/blocks';
7
- import * as AccordionStories from './accordion.stories';
8
-
9
- <Meta of={AccordionStories} />
10
-
11
- # Accordion
12
-
13
- A vertically stacked set of interactive headings that each reveal a section of content. Follows the WAI-ARIA Disclosure pattern.
14
-
15
- ## Usage
16
-
17
- ```tsx
18
- import {
19
- Accordion,
20
- AccordionContent,
21
- AccordionItem,
22
- AccordionTrigger,
23
- } from "@enya-learning/nova/components/accordion";
24
-
25
- export default function Example() {
26
- return (
27
- <Accordion className="w-80">
28
- <AccordionItem value="item-1">
29
- <AccordionTrigger>Is it accessible?</AccordionTrigger>
30
- <AccordionContent>Yes. It adheres to the WAI-ARIA design pattern.</AccordionContent>
31
- </AccordionItem>
32
- </Accordion>
33
- );
34
- }
35
- ```
36
-
37
- ## Examples
38
-
39
- ### Single (default)
40
-
41
- Only one item can be open at a time. Opening a new item collapses the previous one.
42
-
43
- ```tsx
44
- <Accordion className="w-80">
45
- <AccordionItem value="item-1">
46
- <AccordionTrigger>Is it accessible?</AccordionTrigger>
47
- <AccordionContent>Yes. It adheres to the WAI-ARIA design pattern.</AccordionContent>
48
- </AccordionItem>
49
- <AccordionItem value="item-2">
50
- <AccordionTrigger>Is it styled?</AccordionTrigger>
51
- <AccordionContent>Yes. It comes with default styles that match the other components.</AccordionContent>
52
- </AccordionItem>
53
- <AccordionItem value="item-3">
54
- <AccordionTrigger>Is it animated?</AccordionTrigger>
55
- <AccordionContent>Yes. It's animated by default, but you can disable it if you prefer.</AccordionContent>
56
- </AccordionItem>
57
- </Accordion>
58
- ```
59
-
60
- <Canvas of={AccordionStories.Single} />
61
-
62
- ### Multiple
63
-
64
- Add `multiple` to allow multiple items to be open simultaneously.
65
-
66
- ```tsx
67
- <Accordion multiple className="w-80">
68
- <AccordionItem value="item-1">
69
- <AccordionTrigger>Section one</AccordionTrigger>
70
- <AccordionContent>Content for the first section. Multiple can be open at once.</AccordionContent>
71
- </AccordionItem>
72
- <AccordionItem value="item-2">
73
- <AccordionTrigger>Section two</AccordionTrigger>
74
- <AccordionContent>Content for the second section.</AccordionContent>
75
- </AccordionItem>
76
- </Accordion>
77
- ```
78
-
79
- <Canvas of={AccordionStories.Multiple} />
80
-
81
- ## API Reference
82
-
83
- <Controls of={AccordionStories.Single} />
@@ -1,81 +0,0 @@
1
- import { Accordion as AccordionPrimitive } from "@base-ui/react/accordion"
2
-
3
- import { cn } from "../../lib/utils"
4
- import { ChevronDownIcon, ChevronUpIcon } from "lucide-react"
5
-
6
- function Accordion({ className, ...props }: AccordionPrimitive.Root.Props) {
7
- return (
8
- <AccordionPrimitive.Root
9
- data-slot="accordion"
10
- className={cn(
11
- "flex w-full flex-col overflow-hidden rounded-2xl border",
12
- className
13
- )}
14
- {...props}
15
- />
16
- )
17
- }
18
-
19
- function AccordionItem({ className, ...props }: AccordionPrimitive.Item.Props) {
20
- return (
21
- <AccordionPrimitive.Item
22
- data-slot="accordion-item"
23
- className={cn("not-last:border-b data-open:bg-muted/50", className)}
24
- {...props}
25
- />
26
- )
27
- }
28
-
29
- function AccordionTrigger({
30
- className,
31
- children,
32
- ...props
33
- }: AccordionPrimitive.Trigger.Props) {
34
- return (
35
- <AccordionPrimitive.Header className="flex">
36
- <AccordionPrimitive.Trigger
37
- data-slot="accordion-trigger"
38
- className={cn(
39
- "group/accordion-trigger relative flex flex-1 items-start justify-between gap-6 border border-transparent p-4 text-start text-sm font-medium transition-all outline-none hover:underline aria-disabled:pointer-events-none aria-disabled:opacity-50 **:data-[slot=accordion-trigger-icon]:ms-auto **:data-[slot=accordion-trigger-icon]:size-4 **:data-[slot=accordion-trigger-icon]:text-muted-foreground",
40
- className
41
- )}
42
- {...props}
43
- >
44
- {children}
45
- <ChevronDownIcon
46
- data-slot="accordion-trigger-icon"
47
- className="pointer-events-none shrink-0 group-aria-expanded/accordion-trigger:hidden"
48
- />
49
- <ChevronUpIcon
50
- data-slot="accordion-trigger-icon"
51
- className="pointer-events-none hidden shrink-0 group-aria-expanded/accordion-trigger:inline"
52
- />
53
- </AccordionPrimitive.Trigger>
54
- </AccordionPrimitive.Header>
55
- )
56
- }
57
-
58
- function AccordionContent({
59
- className,
60
- children,
61
- ...props
62
- }: AccordionPrimitive.Panel.Props) {
63
- return (
64
- <AccordionPrimitive.Panel
65
- data-slot="accordion-content"
66
- className="overflow-hidden px-4 text-sm data-open:animate-accordion-down data-closed:animate-accordion-up"
67
- {...props}
68
- >
69
- <div
70
- className={cn(
71
- "h-(--accordion-panel-height) pt-0 pb-4 data-ending-style:h-0 data-starting-style:h-0 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",
72
- className
73
- )}
74
- >
75
- {children}
76
- </div>
77
- </AccordionPrimitive.Panel>
78
- )
79
- }
80
-
81
- export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
@@ -1 +0,0 @@
1
- export * from "./accordion"
@@ -1,76 +0,0 @@
1
- import * as React from "react"
2
- import { cva, type VariantProps } from "class-variance-authority"
3
-
4
- import { cn } from "../../lib/utils"
5
-
6
- const alertVariants = cva(
7
- "group/alert relative grid w-full gap-0.5 rounded-lg border px-4 py-3 text-start text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pe-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2.5 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4",
8
- {
9
- variants: {
10
- variant: {
11
- default: "bg-card text-card-foreground",
12
- destructive:
13
- "bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current",
14
- },
15
- },
16
- defaultVariants: {
17
- variant: "default",
18
- },
19
- }
20
- )
21
-
22
- function Alert({
23
- className,
24
- variant,
25
- ...props
26
- }: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>) {
27
- return (
28
- <div
29
- data-slot="alert"
30
- role="alert"
31
- className={cn(alertVariants({ variant }), className)}
32
- {...props}
33
- />
34
- )
35
- }
36
-
37
- function AlertTitle({ className, ...props }: React.ComponentProps<"div">) {
38
- return (
39
- <div
40
- data-slot="alert-title"
41
- className={cn(
42
- "font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground",
43
- className
44
- )}
45
- {...props}
46
- />
47
- )
48
- }
49
-
50
- function AlertDescription({
51
- className,
52
- ...props
53
- }: React.ComponentProps<"div">) {
54
- return (
55
- <div
56
- data-slot="alert-description"
57
- className={cn(
58
- "text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",
59
- className
60
- )}
61
- {...props}
62
- />
63
- )
64
- }
65
-
66
- function AlertAction({ className, ...props }: React.ComponentProps<"div">) {
67
- return (
68
- <div
69
- data-slot="alert-action"
70
- className={cn("absolute end-3 top-2.5", className)}
71
- {...props}
72
- />
73
- )
74
- }
75
-
76
- export { Alert, AlertTitle, AlertDescription, AlertAction }
@@ -1 +0,0 @@
1
- export * from "./alert"
@@ -1,187 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import { AlertDialog as AlertDialogPrimitive } from "@base-ui/react/alert-dialog"
5
-
6
- import { cn } from "../../lib/utils"
7
- import { Button } from "../button"
8
-
9
- function AlertDialog({ ...props }: AlertDialogPrimitive.Root.Props) {
10
- return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />
11
- }
12
-
13
- function AlertDialogTrigger({ ...props }: AlertDialogPrimitive.Trigger.Props) {
14
- return (
15
- <AlertDialogPrimitive.Trigger data-slot="alert-dialog-trigger" {...props} />
16
- )
17
- }
18
-
19
- function AlertDialogPortal({ ...props }: AlertDialogPrimitive.Portal.Props) {
20
- return (
21
- <AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />
22
- )
23
- }
24
-
25
- function AlertDialogOverlay({
26
- className,
27
- ...props
28
- }: AlertDialogPrimitive.Backdrop.Props) {
29
- return (
30
- <AlertDialogPrimitive.Backdrop
31
- data-slot="alert-dialog-overlay"
32
- className={cn(
33
- "fixed inset-0 isolate z-50 bg-nova-black/80 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
34
- className
35
- )}
36
- {...props}
37
- />
38
- )
39
- }
40
-
41
- function AlertDialogContent({
42
- className,
43
- size = "default",
44
- ...props
45
- }: AlertDialogPrimitive.Popup.Props & {
46
- size?: "default" | "sm"
47
- }) {
48
- return (
49
- <AlertDialogPortal>
50
- <AlertDialogOverlay />
51
- <AlertDialogPrimitive.Popup
52
- data-slot="alert-dialog-content"
53
- data-size={size}
54
- className={cn(
55
- "group/alert-dialog-content fixed start-1/2 top-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-6 rounded-4xl bg-popover p-6 text-popover-foreground ring-1 ring-foreground/5 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-md rtl:translate-x-1/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",
56
- className
57
- )}
58
- {...props}
59
- />
60
- </AlertDialogPortal>
61
- )
62
- }
63
-
64
- function AlertDialogHeader({
65
- className,
66
- ...props
67
- }: React.ComponentProps<"div">) {
68
- return (
69
- <div
70
- data-slot="alert-dialog-header"
71
- className={cn(
72
- "grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-start sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",
73
- className
74
- )}
75
- {...props}
76
- />
77
- )
78
- }
79
-
80
- function AlertDialogFooter({
81
- className,
82
- ...props
83
- }: React.ComponentProps<"div">) {
84
- return (
85
- <div
86
- data-slot="alert-dialog-footer"
87
- className={cn(
88
- "flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",
89
- className
90
- )}
91
- {...props}
92
- />
93
- )
94
- }
95
-
96
- function AlertDialogMedia({
97
- className,
98
- ...props
99
- }: React.ComponentProps<"div">) {
100
- return (
101
- <div
102
- data-slot="alert-dialog-media"
103
- className={cn(
104
- "mb-2 inline-flex size-16 items-center justify-center rounded-full bg-muted sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-8",
105
- className
106
- )}
107
- {...props}
108
- />
109
- )
110
- }
111
-
112
- function AlertDialogTitle({
113
- className,
114
- ...props
115
- }: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {
116
- return (
117
- <AlertDialogPrimitive.Title
118
- data-slot="alert-dialog-title"
119
- className={cn(
120
- "font-heading text-lg font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",
121
- className
122
- )}
123
- {...props}
124
- />
125
- )
126
- }
127
-
128
- function AlertDialogDescription({
129
- className,
130
- ...props
131
- }: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {
132
- return (
133
- <AlertDialogPrimitive.Description
134
- data-slot="alert-dialog-description"
135
- className={cn(
136
- "text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",
137
- className
138
- )}
139
- {...props}
140
- />
141
- )
142
- }
143
-
144
- function AlertDialogAction({
145
- className,
146
- ...props
147
- }: React.ComponentProps<typeof Button>) {
148
- return (
149
- <Button
150
- data-slot="alert-dialog-action"
151
- className={cn(className)}
152
- {...props}
153
- />
154
- )
155
- }
156
-
157
- function AlertDialogCancel({
158
- className,
159
- variant = "outline",
160
- size = "default",
161
- ...props
162
- }: AlertDialogPrimitive.Close.Props &
163
- Pick<React.ComponentProps<typeof Button>, "variant" | "size">) {
164
- return (
165
- <AlertDialogPrimitive.Close
166
- data-slot="alert-dialog-cancel"
167
- className={cn(className)}
168
- render={<Button variant={variant} size={size} />}
169
- {...props}
170
- />
171
- )
172
- }
173
-
174
- export {
175
- AlertDialog,
176
- AlertDialogAction,
177
- AlertDialogCancel,
178
- AlertDialogContent,
179
- AlertDialogDescription,
180
- AlertDialogFooter,
181
- AlertDialogHeader,
182
- AlertDialogMedia,
183
- AlertDialogOverlay,
184
- AlertDialogPortal,
185
- AlertDialogTitle,
186
- AlertDialogTrigger,
187
- }
@@ -1 +0,0 @@
1
- export * from "./alert-dialog"
@@ -1,22 +0,0 @@
1
- import { cn } from "../../lib/utils"
2
-
3
- function AspectRatio({
4
- ratio,
5
- className,
6
- ...props
7
- }: React.ComponentProps<"div"> & { ratio: number }) {
8
- return (
9
- <div
10
- data-slot="aspect-ratio"
11
- style={
12
- {
13
- "--ratio": ratio,
14
- } as React.CSSProperties
15
- }
16
- className={cn("relative aspect-(--ratio)", className)}
17
- {...props}
18
- />
19
- )
20
- }
21
-
22
- export { AspectRatio }
@@ -1 +0,0 @@
1
- export * from "./aspect-ratio"
@@ -1,107 +0,0 @@
1
- import * as React from "react"
2
- import { Avatar as AvatarPrimitive } from "@base-ui/react/avatar"
3
-
4
- import { cn } from "../../lib/utils"
5
-
6
- function Avatar({
7
- className,
8
- size = "default",
9
- ...props
10
- }: AvatarPrimitive.Root.Props & {
11
- size?: "default" | "sm" | "lg"
12
- }) {
13
- return (
14
- <AvatarPrimitive.Root
15
- data-slot="avatar"
16
- data-size={size}
17
- className={cn(
18
- "group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",
19
- className
20
- )}
21
- {...props}
22
- />
23
- )
24
- }
25
-
26
- function AvatarImage({ className, ...props }: AvatarPrimitive.Image.Props) {
27
- return (
28
- <AvatarPrimitive.Image
29
- data-slot="avatar-image"
30
- className={cn(
31
- "aspect-square size-full rounded-full object-cover",
32
- className
33
- )}
34
- {...props}
35
- />
36
- )
37
- }
38
-
39
- function AvatarFallback({
40
- className,
41
- ...props
42
- }: AvatarPrimitive.Fallback.Props) {
43
- return (
44
- <AvatarPrimitive.Fallback
45
- data-slot="avatar-fallback"
46
- className={cn(
47
- "flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",
48
- className
49
- )}
50
- {...props}
51
- />
52
- )
53
- }
54
-
55
- function AvatarBadge({ className, ...props }: React.ComponentProps<"span">) {
56
- return (
57
- <span
58
- data-slot="avatar-badge"
59
- className={cn(
60
- "absolute end-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground bg-blend-color ring-2 ring-background select-none",
61
- "group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden",
62
- "group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2",
63
- "group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2",
64
- className
65
- )}
66
- {...props}
67
- />
68
- )
69
- }
70
-
71
- function AvatarGroup({ className, ...props }: React.ComponentProps<"div">) {
72
- return (
73
- <div
74
- data-slot="avatar-group"
75
- className={cn(
76
- "group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-background",
77
- className
78
- )}
79
- {...props}
80
- />
81
- )
82
- }
83
-
84
- function AvatarGroupCount({
85
- className,
86
- ...props
87
- }: React.ComponentProps<"div">) {
88
- return (
89
- <div
90
- data-slot="avatar-group-count"
91
- className={cn(
92
- "relative flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-sm text-muted-foreground ring-2 ring-background group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3",
93
- className
94
- )}
95
- {...props}
96
- />
97
- )
98
- }
99
-
100
- export {
101
- Avatar,
102
- AvatarImage,
103
- AvatarFallback,
104
- AvatarGroup,
105
- AvatarGroupCount,
106
- AvatarBadge,
107
- }
@@ -1 +0,0 @@
1
- export * from "./avatar"