@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.
Files changed (139) hide show
  1. package/dist/chunks/vendor-base-ui-efqwzv4oinwg1f0d.js.map +1 -1
  2. package/dist/index.js.map +1 -1
  3. package/package.json +26 -11
  4. package/changelog.md +0 -44
  5. package/components.json +0 -23
  6. package/eslint.config.js +0 -30
  7. package/plopfile.mjs +0 -49
  8. package/src/components/.gitkeep +0 -0
  9. package/src/components/accordion/accordion.mdx +0 -83
  10. package/src/components/accordion/accordion.tsx +0 -81
  11. package/src/components/accordion/index.ts +0 -1
  12. package/src/components/alert/alert.tsx +0 -76
  13. package/src/components/alert/index.ts +0 -1
  14. package/src/components/alert-dialog/alert-dialog.tsx +0 -187
  15. package/src/components/alert-dialog/index.ts +0 -1
  16. package/src/components/aspect-ratio/aspect-ratio.tsx +0 -22
  17. package/src/components/aspect-ratio/index.ts +0 -1
  18. package/src/components/avatar/avatar.tsx +0 -107
  19. package/src/components/avatar/index.ts +0 -1
  20. package/src/components/badge/badge.tsx +0 -52
  21. package/src/components/badge/index.ts +0 -1
  22. package/src/components/breadcrumb/breadcrumb.tsx +0 -122
  23. package/src/components/breadcrumb/index.ts +0 -1
  24. package/src/components/button/button.mdx +0 -255
  25. package/src/components/button/button.tsx +0 -59
  26. package/src/components/button/index.ts +0 -1
  27. package/src/components/button-group/button-group.tsx +0 -87
  28. package/src/components/button-group/index.ts +0 -1
  29. package/src/components/calendar/calendar.tsx +0 -228
  30. package/src/components/calendar/index.ts +0 -1
  31. package/src/components/card/card.tsx +0 -100
  32. package/src/components/card/index.ts +0 -1
  33. package/src/components/carousel/carousel.tsx +0 -243
  34. package/src/components/carousel/index.ts +0 -1
  35. package/src/components/chart/chart.tsx +0 -371
  36. package/src/components/chart/index.ts +0 -1
  37. package/src/components/checkbox/checkbox.tsx +0 -28
  38. package/src/components/checkbox/index.ts +0 -1
  39. package/src/components/collapsible/collapsible.tsx +0 -19
  40. package/src/components/collapsible/index.ts +0 -1
  41. package/src/components/combobox/combobox.tsx +0 -298
  42. package/src/components/combobox/index.ts +0 -1
  43. package/src/components/command/command.tsx +0 -193
  44. package/src/components/command/index.ts +0 -1
  45. package/src/components/context-menu/context-menu.tsx +0 -272
  46. package/src/components/context-menu/index.ts +0 -1
  47. package/src/components/dialog/dialog.tsx +0 -157
  48. package/src/components/dialog/index.ts +0 -1
  49. package/src/components/direction/direction.tsx +0 -4
  50. package/src/components/direction/index.ts +0 -1
  51. package/src/components/drawer/drawer.tsx +0 -134
  52. package/src/components/drawer/index.ts +0 -1
  53. package/src/components/dropdown-menu/dropdown-menu.tsx +0 -270
  54. package/src/components/dropdown-menu/index.ts +0 -1
  55. package/src/components/empty/empty.tsx +0 -104
  56. package/src/components/empty/index.ts +0 -1
  57. package/src/components/enya-logo/enya-logo.mdx +0 -174
  58. package/src/components/enya-logo/enya-logo.tsx +0 -383
  59. package/src/components/enya-logo/index.ts +0 -1
  60. package/src/components/field/field.tsx +0 -236
  61. package/src/components/field/index.ts +0 -1
  62. package/src/components/hover-card/hover-card.tsx +0 -51
  63. package/src/components/hover-card/index.ts +0 -1
  64. package/src/components/input/index.ts +0 -1
  65. package/src/components/input/input.tsx +0 -20
  66. package/src/components/input-group/index.ts +0 -1
  67. package/src/components/input-group/input-group.tsx +0 -157
  68. package/src/components/input-otp/index.ts +0 -1
  69. package/src/components/input-otp/input-otp.tsx +0 -84
  70. package/src/components/item/index.ts +0 -1
  71. package/src/components/item/item.tsx +0 -201
  72. package/src/components/kbd/index.ts +0 -1
  73. package/src/components/kbd/kbd.tsx +0 -26
  74. package/src/components/label/index.ts +0 -1
  75. package/src/components/label/label.tsx +0 -20
  76. package/src/components/menubar/index.ts +0 -1
  77. package/src/components/menubar/menubar.tsx +0 -281
  78. package/src/components/native-select/index.ts +0 -1
  79. package/src/components/native-select/native-select.tsx +0 -65
  80. package/src/components/navigation-menu/index.ts +0 -1
  81. package/src/components/navigation-menu/navigation-menu.tsx +0 -171
  82. package/src/components/pagination/index.ts +0 -1
  83. package/src/components/pagination/pagination.tsx +0 -133
  84. package/src/components/popover/index.ts +0 -1
  85. package/src/components/popover/popover.tsx +0 -88
  86. package/src/components/progress/index.ts +0 -1
  87. package/src/components/progress/progress.tsx +0 -83
  88. package/src/components/radio-group/index.ts +0 -1
  89. package/src/components/radio-group/radio-group.tsx +0 -36
  90. package/src/components/resizable/index.ts +0 -1
  91. package/src/components/resizable/resizable.tsx +0 -50
  92. package/src/components/scroll-area/index.ts +0 -1
  93. package/src/components/scroll-area/scroll-area.tsx +0 -53
  94. package/src/components/select/index.ts +0 -1
  95. package/src/components/select/select.tsx +0 -205
  96. package/src/components/separator/index.ts +0 -1
  97. package/src/components/separator/separator.tsx +0 -23
  98. package/src/components/sheet/index.ts +0 -1
  99. package/src/components/sheet/sheet.tsx +0 -137
  100. package/src/components/sidebar/index.ts +0 -1
  101. package/src/components/sidebar/sidebar.tsx +0 -722
  102. package/src/components/skeleton/index.ts +0 -1
  103. package/src/components/skeleton/skeleton.tsx +0 -13
  104. package/src/components/slider/index.ts +0 -1
  105. package/src/components/slider/slider.tsx +0 -52
  106. package/src/components/sonner/index.ts +0 -1
  107. package/src/components/sonner/sonner.tsx +0 -45
  108. package/src/components/spinner/index.ts +0 -1
  109. package/src/components/spinner/spinner.tsx +0 -15
  110. package/src/components/switch/index.ts +0 -1
  111. package/src/components/switch/switch.tsx +0 -30
  112. package/src/components/table/index.ts +0 -1
  113. package/src/components/table/table.tsx +0 -116
  114. package/src/components/tabs/index.ts +0 -1
  115. package/src/components/tabs/tabs.tsx +0 -80
  116. package/src/components/textarea/index.ts +0 -1
  117. package/src/components/textarea/textarea.tsx +0 -18
  118. package/src/components/toggle/index.ts +0 -1
  119. package/src/components/toggle/toggle.tsx +0 -45
  120. package/src/components/toggle-group/index.ts +0 -1
  121. package/src/components/toggle-group/toggle-group.tsx +0 -87
  122. package/src/components/tooltip/index.ts +0 -1
  123. package/src/components/tooltip/tooltip.tsx +0 -64
  124. package/src/hooks/use-mobile.ts +0 -21
  125. package/src/index.ts +0 -58
  126. package/src/lib/.gitkeep +0 -0
  127. package/src/lib/utils.ts +0 -6
  128. package/src/styles/nova-binding.css +0 -290
  129. package/src/styles/nova.css +0 -58
  130. package/src/styles/theme-nova.css +0 -201
  131. package/src/styles/typography.css +0 -215
  132. package/src/utils/index.ts +0 -1
  133. package/templates/component/component.tsx.hbs +0 -16
  134. package/templates/component/index.ts.hbs +0 -1
  135. package/templates/component/stories.tsx.hbs +0 -13
  136. package/tsconfig.json +0 -18
  137. package/tsconfig.lint.json +0 -14
  138. package/vite.config.ts +0 -101
  139. /package/{src → dist}/styles/globals.css +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enya-learning/nova",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -62,18 +62,33 @@
62
62
  "vitest": "^4.1.8"
63
63
  },
64
64
  "exports": {
65
- ".": "./src/index.ts",
66
- "./styles/tailwind": "./src/styles/nova.css",
67
- "./styles": "./src/styles/nova.css",
68
- "./globals.css": "./src/styles/globals.css",
69
- "./lib/*": "./src/lib/*.ts",
70
- "./components/*": "./src/components/*/index.ts",
71
- "./hooks/*": "./src/hooks/*.ts",
72
- "./utils": "./src/utils/index.ts",
65
+ ".": {
66
+ "types": "./dist/src/index.d.ts",
67
+ "default": "./dist/index.js"
68
+ },
69
+ "./styles/tailwind": "./dist/styles/nova.css",
70
+ "./styles": "./dist/styles/nova.css",
71
+ "./globals.css": "./dist/styles/globals.css",
72
+ "./components/button": {
73
+ "types": "./dist/src/components/button/index.d.ts",
74
+ "default": "./dist/components/button.js"
75
+ },
76
+ "./components/enya-logo": {
77
+ "types": "./dist/src/components/enya-logo/index.d.ts",
78
+ "default": "./dist/components/enya-logo.js"
79
+ },
80
+ "./utils": {
81
+ "types": "./dist/src/utils/index.d.ts",
82
+ "default": "./dist/utils.js"
83
+ },
73
84
  "./eslint": "./src/eslint/index.js"
74
85
  },
75
- "main": "./src/index.ts",
76
- "types": "./src/index.ts",
86
+ "main": "./dist/index.js",
87
+ "types": "./dist/src/index.d.ts",
88
+ "files": [
89
+ "dist",
90
+ "src/eslint"
91
+ ],
77
92
  "sideEffects": [
78
93
  "*.css"
79
94
  ],
package/changelog.md DELETED
@@ -1,44 +0,0 @@
1
- # @enya-learning/nova
2
-
3
- ## 0.4.0
4
-
5
- ### Minor Changes
6
-
7
- - Add EnyaLogo component, expand Button variants and sizes, add
8
- `nova/no-primitive-colors` ESLint rule, and introduce status color tokens.
9
- - **EnyaLogo**: new brand SVG component with `variant` (color/mono/white) and
10
- `size` props, full MDX docs and Storybook stories
11
- - **Button**: new `accent` variant; new `xl`, `icon-xs`, `icon-sm`, `icon-lg`,
12
- `icon-xl` sizes; updated default variant from `bg-primary` to
13
- `bg-foreground` (Nova brand style); full MDX docs and expanded stories
14
- - **ESLint**: new `nova/no-primitive-colors` rule prevents raw colour values —
15
- enforces semantic token usage
16
- - **Colours**: palette CSS variables single-sourced; status color tokens
17
- added; Colours story reworked
18
- - **Styles**: updated `nova-binding.css` and `theme-nova.css` with expanded
19
- token set
20
-
21
- ## 0.2.1
22
-
23
- ### Patch Changes
24
-
25
- - bb05c41: updated typography styling for nova
26
-
27
- ## 0.2.0
28
-
29
- ### Minor Changes
30
-
31
- - 5be8520: Updated all components to have storybook definitions (regressions
32
- still exist and not stable)
33
-
34
- ## 0.1.0
35
-
36
- ### Minor Changes
37
-
38
- - Initial release of Nova — Enya Learning's component library.
39
- - Full component set built on Base UI primitives and Tailwind CSS v4
40
- - Nova colour token system aligned with shadcn naming conventions, namespaced
41
- under `nova-*`
42
- - Design tokens generated from Style Dictionary with light/dark mode support
43
- - Corrected peer dependency classification: `react`, `react-dom`, and
44
- `lucide-react` are now peer dependencies rather than bundled dependencies
package/components.json DELETED
@@ -1,23 +0,0 @@
1
- {
2
- "$schema": "https://ui.shadcn.com/schema.json",
3
- "style": "base-maia",
4
- "rsc": false,
5
- "tsx": true,
6
- "tailwind": {
7
- "config": "",
8
- "css": "src/styles/nova.css",
9
- "baseColor": "neutral",
10
- "cssVariables": false
11
- },
12
- "iconLibrary": "lucide",
13
- "aliases": {
14
- "components": "@enya-learning/nova/components",
15
- "utils": "@enya-learning/nova/lib/utils",
16
- "hooks": "@enya-learning/nova/hooks",
17
- "lib": "@enya-learning/nova/lib",
18
- "ui": "@enya-learning/nova/components"
19
- },
20
- "rtl": true,
21
- "menuColor": "default",
22
- "menuAccent": "subtle"
23
- }
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"