@enya-learning/nova 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Readme.md +418 -0
- package/changelog.md +44 -0
- package/components.json +23 -0
- package/dist/chunks/button-npy7isi3nsvlhf86.js +81 -0
- package/dist/chunks/button-npy7isi3nsvlhf86.js.map +1 -0
- package/dist/chunks/rolldown-runtime-fifbipqm1abz4ydz.js +30 -0
- package/dist/chunks/utils-kyb5nny4y41y7hd8.js +10 -0
- package/dist/chunks/utils-kyb5nny4y41y7hd8.js.map +1 -0
- package/dist/chunks/vendor-base-ui-efqwzv4oinwg1f0d.js +16049 -0
- package/dist/chunks/vendor-base-ui-efqwzv4oinwg1f0d.js.map +1 -0
- package/dist/chunks/vendor-styling-eeiy57tyznmxsfky.js +1744 -0
- package/dist/chunks/vendor-styling-eeiy57tyznmxsfky.js.map +1 -0
- package/dist/components/button.js +6 -0
- package/dist/components/enya-logo.js +191 -0
- package/dist/components/enya-logo.js.map +1 -0
- package/dist/index.js +23499 -0
- package/dist/index.js.map +1 -0
- package/dist/src/components/accordion/accordion.d.ts +6 -0
- package/dist/src/components/accordion/index.d.ts +1 -0
- package/dist/src/components/alert/alert.d.ts +10 -0
- package/dist/src/components/alert/index.d.ts +1 -0
- package/dist/src/components/alert-dialog/alert-dialog.d.ts +18 -0
- package/dist/src/components/alert-dialog/index.d.ts +1 -0
- package/dist/src/components/aspect-ratio/aspect-ratio.d.ts +4 -0
- package/dist/src/components/aspect-ratio/index.d.ts +1 -0
- package/dist/src/components/avatar/avatar.d.ts +11 -0
- package/dist/src/components/avatar/index.d.ts +1 -0
- package/dist/src/components/badge/badge.d.ts +7 -0
- package/dist/src/components/badge/index.d.ts +1 -0
- package/dist/src/components/breadcrumb/breadcrumb.d.ts +10 -0
- package/dist/src/components/breadcrumb/index.d.ts +1 -0
- package/dist/src/components/button/button.d.ts +8 -0
- package/dist/src/components/button/index.d.ts +1 -0
- package/dist/src/components/button-group/button-group.d.ts +10 -0
- package/dist/src/components/button-group/index.d.ts +1 -0
- package/dist/src/components/calendar/calendar.d.ts +10 -0
- package/dist/src/components/calendar/index.d.ts +1 -0
- package/dist/src/components/card/card.d.ts +11 -0
- package/dist/src/components/card/index.d.ts +1 -0
- package/dist/src/components/carousel/carousel.d.ts +28 -0
- package/dist/src/components/carousel/index.d.ts +1 -0
- package/dist/src/components/chart/chart.d.ts +44 -0
- package/dist/src/components/chart/index.d.ts +1 -0
- package/dist/src/components/checkbox/checkbox.d.ts +3 -0
- package/dist/src/components/checkbox/index.d.ts +1 -0
- package/dist/src/components/collapsible/collapsible.d.ts +5 -0
- package/dist/src/components/collapsible/index.d.ts +1 -0
- package/dist/src/components/combobox/combobox.d.ts +24 -0
- package/dist/src/components/combobox/index.d.ts +1 -0
- package/dist/src/components/command/command.d.ts +19 -0
- package/dist/src/components/command/index.d.ts +1 -0
- package/dist/src/components/context-menu/context-menu.d.ts +29 -0
- package/dist/src/components/context-menu/index.d.ts +1 -0
- package/dist/src/components/dialog/dialog.d.ts +17 -0
- package/dist/src/components/dialog/index.d.ts +1 -0
- package/dist/src/components/direction/direction.d.ts +1 -0
- package/dist/src/components/direction/index.d.ts +1 -0
- package/dist/src/components/drawer/drawer.d.ts +13 -0
- package/dist/src/components/drawer/index.d.ts +1 -0
- package/dist/src/components/dropdown-menu/dropdown-menu.d.ts +29 -0
- package/dist/src/components/dropdown-menu/index.d.ts +1 -0
- package/dist/src/components/empty/empty.d.ts +11 -0
- package/dist/src/components/empty/index.d.ts +1 -0
- package/dist/src/components/enya-logo/enya-logo.d.ts +121 -0
- package/dist/src/components/enya-logo/index.d.ts +1 -0
- package/dist/src/components/field/field.d.ts +24 -0
- package/dist/src/components/field/index.d.ts +1 -0
- package/dist/src/components/hover-card/hover-card.d.ts +5 -0
- package/dist/src/components/hover-card/index.d.ts +1 -0
- package/dist/src/components/input/index.d.ts +1 -0
- package/dist/src/components/input/input.d.ts +3 -0
- package/dist/src/components/input-group/index.d.ts +1 -0
- package/dist/src/components/input-group/input-group.d.ts +18 -0
- package/dist/src/components/input-otp/index.d.ts +1 -0
- package/dist/src/components/input-otp/input-otp.d.ts +11 -0
- package/dist/src/components/item/index.d.ts +1 -0
- package/dist/src/components/item/item.d.ts +22 -0
- package/dist/src/components/kbd/index.d.ts +1 -0
- package/dist/src/components/kbd/kbd.d.ts +3 -0
- package/dist/src/components/label/index.d.ts +1 -0
- package/dist/src/components/label/label.d.ts +3 -0
- package/dist/src/components/menubar/index.d.ts +1 -0
- package/dist/src/components/menubar/menubar.d.ts +29 -0
- package/dist/src/components/native-select/index.d.ts +1 -0
- package/dist/src/components/native-select/native-select.d.ts +8 -0
- package/dist/src/components/navigation-menu/index.d.ts +1 -0
- package/dist/src/components/navigation-menu/navigation-menu.d.ts +11 -0
- package/dist/src/components/pagination/index.d.ts +1 -0
- package/dist/src/components/pagination/pagination.d.ts +17 -0
- package/dist/src/components/popover/index.d.ts +1 -0
- package/dist/src/components/popover/popover.d.ts +9 -0
- package/dist/src/components/progress/index.d.ts +1 -0
- package/dist/src/components/progress/progress.d.ts +7 -0
- package/dist/src/components/radio-group/index.d.ts +1 -0
- package/dist/src/components/radio-group/radio-group.d.ts +5 -0
- package/dist/src/components/resizable/index.d.ts +1 -0
- package/dist/src/components/resizable/resizable.d.ts +7 -0
- package/dist/src/components/scroll-area/index.d.ts +1 -0
- package/dist/src/components/scroll-area/scroll-area.d.ts +4 -0
- package/dist/src/components/select/index.d.ts +1 -0
- package/dist/src/components/select/select.d.ts +15 -0
- package/dist/src/components/separator/index.d.ts +1 -0
- package/dist/src/components/separator/separator.d.ts +3 -0
- package/dist/src/components/sheet/index.d.ts +1 -0
- package/dist/src/components/sheet/sheet.d.ts +14 -0
- package/dist/src/components/sidebar/index.d.ts +1 -0
- package/dist/src/components/sidebar/sidebar.d.ts +63 -0
- package/dist/src/components/skeleton/index.d.ts +1 -0
- package/dist/src/components/skeleton/skeleton.d.ts +2 -0
- package/dist/src/components/slider/index.d.ts +1 -0
- package/dist/src/components/slider/slider.d.ts +3 -0
- package/dist/src/components/sonner/index.d.ts +1 -0
- package/dist/src/components/sonner/sonner.d.ts +3 -0
- package/dist/src/components/spinner/index.d.ts +1 -0
- package/dist/src/components/spinner/spinner.d.ts +2 -0
- package/dist/src/components/switch/index.d.ts +1 -0
- package/dist/src/components/switch/switch.d.ts +5 -0
- package/dist/src/components/table/index.d.ts +1 -0
- package/dist/src/components/table/table.d.ts +10 -0
- package/dist/src/components/tabs/index.d.ts +1 -0
- package/dist/src/components/tabs/tabs.d.ts +10 -0
- package/dist/src/components/textarea/index.d.ts +1 -0
- package/dist/src/components/textarea/textarea.d.ts +3 -0
- package/dist/src/components/toggle/index.d.ts +1 -0
- package/dist/src/components/toggle/toggle.d.ts +8 -0
- package/dist/src/components/toggle-group/index.d.ts +1 -0
- package/dist/src/components/toggle-group/toggle-group.d.ts +10 -0
- package/dist/src/components/tooltip/index.d.ts +1 -0
- package/dist/src/components/tooltip/tooltip.d.ts +6 -0
- package/dist/src/hooks/use-mobile.d.ts +1 -0
- package/dist/src/index.d.ts +57 -0
- package/dist/src/lib/utils.d.ts +2 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/styles/nova-binding.css +290 -0
- package/dist/styles/nova.css +58 -0
- package/dist/styles/theme-nova.css +201 -0
- package/dist/styles/typography.css +215 -0
- package/dist/utils.js +5 -0
- package/eslint.config.js +30 -0
- package/package.json +94 -0
- package/plopfile.mjs +49 -0
- package/src/components/.gitkeep +0 -0
- package/src/components/accordion/accordion.mdx +83 -0
- package/src/components/accordion/accordion.tsx +81 -0
- package/src/components/accordion/index.ts +1 -0
- package/src/components/alert/alert.tsx +76 -0
- package/src/components/alert/index.ts +1 -0
- package/src/components/alert-dialog/alert-dialog.tsx +187 -0
- package/src/components/alert-dialog/index.ts +1 -0
- package/src/components/aspect-ratio/aspect-ratio.tsx +22 -0
- package/src/components/aspect-ratio/index.ts +1 -0
- package/src/components/avatar/avatar.tsx +107 -0
- package/src/components/avatar/index.ts +1 -0
- package/src/components/badge/badge.tsx +52 -0
- package/src/components/badge/index.ts +1 -0
- package/src/components/breadcrumb/breadcrumb.tsx +122 -0
- package/src/components/breadcrumb/index.ts +1 -0
- package/src/components/button/button.mdx +255 -0
- package/src/components/button/button.tsx +59 -0
- package/src/components/button/index.ts +1 -0
- package/src/components/button-group/button-group.tsx +87 -0
- package/src/components/button-group/index.ts +1 -0
- package/src/components/calendar/calendar.tsx +228 -0
- package/src/components/calendar/index.ts +1 -0
- package/src/components/card/card.tsx +100 -0
- package/src/components/card/index.ts +1 -0
- package/src/components/carousel/carousel.tsx +243 -0
- package/src/components/carousel/index.ts +1 -0
- package/src/components/chart/chart.tsx +371 -0
- package/src/components/chart/index.ts +1 -0
- package/src/components/checkbox/checkbox.tsx +28 -0
- package/src/components/checkbox/index.ts +1 -0
- package/src/components/collapsible/collapsible.tsx +19 -0
- package/src/components/collapsible/index.ts +1 -0
- package/src/components/combobox/combobox.tsx +298 -0
- package/src/components/combobox/index.ts +1 -0
- package/src/components/command/command.tsx +193 -0
- package/src/components/command/index.ts +1 -0
- package/src/components/context-menu/context-menu.tsx +272 -0
- package/src/components/context-menu/index.ts +1 -0
- package/src/components/dialog/dialog.tsx +157 -0
- package/src/components/dialog/index.ts +1 -0
- package/src/components/direction/direction.tsx +4 -0
- package/src/components/direction/index.ts +1 -0
- package/src/components/drawer/drawer.tsx +134 -0
- package/src/components/drawer/index.ts +1 -0
- package/src/components/dropdown-menu/dropdown-menu.tsx +270 -0
- package/src/components/dropdown-menu/index.ts +1 -0
- package/src/components/empty/empty.tsx +104 -0
- package/src/components/empty/index.ts +1 -0
- package/src/components/enya-logo/enya-logo.mdx +174 -0
- package/src/components/enya-logo/enya-logo.tsx +383 -0
- package/src/components/enya-logo/index.ts +1 -0
- package/src/components/field/field.tsx +236 -0
- package/src/components/field/index.ts +1 -0
- package/src/components/hover-card/hover-card.tsx +51 -0
- package/src/components/hover-card/index.ts +1 -0
- package/src/components/input/index.ts +1 -0
- package/src/components/input/input.tsx +20 -0
- package/src/components/input-group/index.ts +1 -0
- package/src/components/input-group/input-group.tsx +157 -0
- package/src/components/input-otp/index.ts +1 -0
- package/src/components/input-otp/input-otp.tsx +84 -0
- package/src/components/item/index.ts +1 -0
- package/src/components/item/item.tsx +201 -0
- package/src/components/kbd/index.ts +1 -0
- package/src/components/kbd/kbd.tsx +26 -0
- package/src/components/label/index.ts +1 -0
- package/src/components/label/label.tsx +20 -0
- package/src/components/menubar/index.ts +1 -0
- package/src/components/menubar/menubar.tsx +281 -0
- package/src/components/native-select/index.ts +1 -0
- package/src/components/native-select/native-select.tsx +65 -0
- package/src/components/navigation-menu/index.ts +1 -0
- package/src/components/navigation-menu/navigation-menu.tsx +171 -0
- package/src/components/pagination/index.ts +1 -0
- package/src/components/pagination/pagination.tsx +133 -0
- package/src/components/popover/index.ts +1 -0
- package/src/components/popover/popover.tsx +88 -0
- package/src/components/progress/index.ts +1 -0
- package/src/components/progress/progress.tsx +83 -0
- package/src/components/radio-group/index.ts +1 -0
- package/src/components/radio-group/radio-group.tsx +36 -0
- package/src/components/resizable/index.ts +1 -0
- package/src/components/resizable/resizable.tsx +50 -0
- package/src/components/scroll-area/index.ts +1 -0
- package/src/components/scroll-area/scroll-area.tsx +53 -0
- package/src/components/select/index.ts +1 -0
- package/src/components/select/select.tsx +205 -0
- package/src/components/separator/index.ts +1 -0
- package/src/components/separator/separator.tsx +23 -0
- package/src/components/sheet/index.ts +1 -0
- package/src/components/sheet/sheet.tsx +137 -0
- package/src/components/sidebar/index.ts +1 -0
- package/src/components/sidebar/sidebar.tsx +722 -0
- package/src/components/skeleton/index.ts +1 -0
- package/src/components/skeleton/skeleton.tsx +13 -0
- package/src/components/slider/index.ts +1 -0
- package/src/components/slider/slider.tsx +52 -0
- package/src/components/sonner/index.ts +1 -0
- package/src/components/sonner/sonner.tsx +45 -0
- package/src/components/spinner/index.ts +1 -0
- package/src/components/spinner/spinner.tsx +15 -0
- package/src/components/switch/index.ts +1 -0
- package/src/components/switch/switch.tsx +30 -0
- package/src/components/table/index.ts +1 -0
- package/src/components/table/table.tsx +116 -0
- package/src/components/tabs/index.ts +1 -0
- package/src/components/tabs/tabs.tsx +80 -0
- package/src/components/textarea/index.ts +1 -0
- package/src/components/textarea/textarea.tsx +18 -0
- package/src/components/toggle/index.ts +1 -0
- package/src/components/toggle/toggle.tsx +45 -0
- package/src/components/toggle-group/index.ts +1 -0
- package/src/components/toggle-group/toggle-group.tsx +87 -0
- package/src/components/tooltip/index.ts +1 -0
- package/src/components/tooltip/tooltip.tsx +64 -0
- package/src/eslint/index.js +13 -0
- package/src/eslint/no-primitive-colors.js +158 -0
- package/src/hooks/use-mobile.ts +21 -0
- package/src/index.ts +58 -0
- package/src/lib/.gitkeep +0 -0
- package/src/lib/utils.ts +6 -0
- package/src/styles/globals.css +77 -0
- package/src/styles/nova-binding.css +290 -0
- package/src/styles/nova.css +58 -0
- package/src/styles/theme-nova.css +201 -0
- package/src/styles/typography.css +215 -0
- package/src/utils/index.ts +1 -0
- package/templates/component/component.tsx.hbs +16 -0
- package/templates/component/index.ts.hbs +1 -0
- package/templates/component/stories.tsx.hbs +13 -0
- package/tsconfig.json +18 -0
- package/tsconfig.lint.json +14 -0
- package/vite.config.ts +101 -0
package/Readme.md
ADDED
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
# @enya-learning/nova
|
|
2
|
+
|
|
3
|
+
Enya Learning's component library for building modern web applications.
|
|
4
|
+
|
|
5
|
+
Nova provides accessible, themeable UI components built on
|
|
6
|
+
[Base UI](https://base-ui.com) primitives and styled with Tailwind CSS v4. It
|
|
7
|
+
handles keyboard navigation, focus management, and ARIA attributes so you can
|
|
8
|
+
build accessible applications without thinking through every detail.
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pnpm add @enya-learning/nova
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Peer Dependencies
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
pnpm add react react-dom
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Import Components
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
// Main package import
|
|
26
|
+
import { Button, Input, Dialog } from "@enya-learning/nova"
|
|
27
|
+
|
|
28
|
+
// Granular imports (recommended for tree-shaking)
|
|
29
|
+
import { Button } from "@enya-learning/nova/components/button"
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Import Styles
|
|
33
|
+
|
|
34
|
+
### For Tailwind CSS v4 Users
|
|
35
|
+
|
|
36
|
+
Tailwind CSS v4 does not scan `node_modules/` by default. Add a `@source`
|
|
37
|
+
directive so Tailwind discovers the utility classes Nova uses — without this,
|
|
38
|
+
components may render with missing styles.
|
|
39
|
+
|
|
40
|
+
In your main CSS file:
|
|
41
|
+
|
|
42
|
+
```css
|
|
43
|
+
@source "../node_modules/@enya-learning/nova/dist/**/*.{js,jsx,ts,tsx}";
|
|
44
|
+
@import "@enya-learning/nova/styles";
|
|
45
|
+
@import "tailwindcss";
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Import order matters — `@enya-learning/nova/styles` must come before
|
|
49
|
+
`@import "tailwindcss"` so Nova's `@theme` tokens are registered first.
|
|
50
|
+
|
|
51
|
+
> **Note:** The `@source` path is relative to your CSS file. Adjust it based on
|
|
52
|
+
> your project structure.
|
|
53
|
+
|
|
54
|
+
### Global CSS (optional)
|
|
55
|
+
|
|
56
|
+
Nova ships a `globals.css` for base resets and font loading:
|
|
57
|
+
|
|
58
|
+
```css
|
|
59
|
+
@import "@enya-learning/nova/globals.css";
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Styles architecture
|
|
63
|
+
|
|
64
|
+
Nova's CSS is split across four files with distinct responsibilities:
|
|
65
|
+
|
|
66
|
+
| File | Role |
|
|
67
|
+
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
68
|
+
| `nova-binding.css` | Registers the raw palette into Tailwind's `@theme` — every `nova-*` colour stop and utilities like `--ease-bounce`. This is what makes `bg-nova-sky-500` work as a class. |
|
|
69
|
+
| `theme-nova.css` | Semantic tokens — maps palette stops to _meaning_ (`--color-nova-brand`, `--color-nova-success`, `--text-color-nova-subtle`, etc.) with `light-dark()` for automatic light/dark switching. |
|
|
70
|
+
| `nova.css` | The bridge to shadcn — remaps shadcn's generic variables (`--primary`, `--background`, `--destructive`, etc.) onto nova semantic tokens so shadcn components pick up nova colours without modification. |
|
|
71
|
+
| `globals.css` | App entry point — imports Tailwind, fonts, shadcn base, and `nova.css`. Also sets `@theme inline` to wire shadcn colour vars into Tailwind's class system, defines the `dark` variant, and applies base body/border styles. |
|
|
72
|
+
|
|
73
|
+
**Import chain:**
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
globals.css → nova.css → nova-binding.css → theme-nova.css
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**Where to make changes:**
|
|
80
|
+
|
|
81
|
+
- Adding a new colour stop → `nova-binding.css`
|
|
82
|
+
- Adding or changing what a colour _means_ (e.g. a new `nova-brand-subtle`
|
|
83
|
+
surface) → `theme-nova.css`
|
|
84
|
+
- Swapping which palette scale powers a semantic role (e.g. changing the brand
|
|
85
|
+
variant) → `nova-binding.css` brand alias block
|
|
86
|
+
- Mapping a new shadcn variable to nova → `nova.css`
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Base UI Primitives
|
|
91
|
+
|
|
92
|
+
Nova is built on [Base UI](https://base-ui.com). For advanced use cases
|
|
93
|
+
requiring fine-grained control, reach into your own `@base-ui/react` dependency
|
|
94
|
+
directly:
|
|
95
|
+
|
|
96
|
+
```tsx
|
|
97
|
+
import { Popover } from "@base-ui/react"
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Prefer styled Nova components when available — use Base UI primitives only for
|
|
101
|
+
custom components not yet in Nova.
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## Table of contents
|
|
106
|
+
|
|
107
|
+
- [Overview](#overview)
|
|
108
|
+
- [Prerequisites](#prerequisites)
|
|
109
|
+
- [Development workflows](#development-workflows)
|
|
110
|
+
- [Adding a new component](#adding-a-new-component)
|
|
111
|
+
- [Writing stories](#writing-stories)
|
|
112
|
+
- [Generating docs](#generating-docs)
|
|
113
|
+
- [Testing and quality](#testing-and-quality)
|
|
114
|
+
- [Publishing](#publishing)
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Overview
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
nova/
|
|
122
|
+
├── apps/
|
|
123
|
+
│ └── web/ Astro documentation site (localhost:4321)
|
|
124
|
+
└── packages/
|
|
125
|
+
└── nova/ This package — the component library
|
|
126
|
+
├── src/
|
|
127
|
+
│ ├── components/ One folder per component
|
|
128
|
+
│ ├── styles/ Design tokens and global CSS
|
|
129
|
+
│ ├── lib/ Utilities (cn, etc.)
|
|
130
|
+
│ └── index.ts Library barrel export
|
|
131
|
+
└── .storybook/ Storybook configuration
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
**Three moving parts:**
|
|
135
|
+
|
|
136
|
+
| Tool | Purpose | Port |
|
|
137
|
+
| ---------------------------- | ------------------------------------------------- | ---- |
|
|
138
|
+
| Storybook | Isolated component development & interactive docs | 6006 |
|
|
139
|
+
| `pnpm dev` | Vite watch build — feeds the Astro docs site | — |
|
|
140
|
+
| Astro docs site (`apps/web`) | Static documentation website | 4321 |
|
|
141
|
+
|
|
142
|
+
Storybook is the primary development environment. The Astro docs site is for
|
|
143
|
+
publishing static reference documentation.
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## Prerequisites
|
|
148
|
+
|
|
149
|
+
- **Node** ≥ 22.12
|
|
150
|
+
- **pnpm** 10
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
# From the monorepo root — installs all workspaces
|
|
154
|
+
pnpm install
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## Development workflows
|
|
160
|
+
|
|
161
|
+
### Option A — Storybook (recommended for component work)
|
|
162
|
+
|
|
163
|
+
The fastest way to build and test components in isolation.
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
# From packages/nova
|
|
167
|
+
pnpm storybook
|
|
168
|
+
# → http://localhost:6006
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
What you get:
|
|
172
|
+
|
|
173
|
+
- Full HMR with React Fast Refresh
|
|
174
|
+
- Interactive controls for every prop
|
|
175
|
+
- Auto-generated prop tables from TypeScript types (`autodocs` tag)
|
|
176
|
+
- Light/dark mode toggle (sets `data-mode="dark"` on the root element)
|
|
177
|
+
- Accessibility panel
|
|
178
|
+
|
|
179
|
+
### Option B — Watch build + Astro docs site
|
|
180
|
+
|
|
181
|
+
Use this when you need to see your changes reflected in the actual documentation
|
|
182
|
+
website.
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
# Terminal 1 — rebuild nova on every save (~400ms)
|
|
186
|
+
cd packages/nova
|
|
187
|
+
pnpm dev
|
|
188
|
+
|
|
189
|
+
# Terminal 2 — Astro dev server
|
|
190
|
+
cd apps/web
|
|
191
|
+
pnpm dev
|
|
192
|
+
# → http://localhost:4321
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Refresh the browser after a nova rebuild to see changes.
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## Adding a new component
|
|
200
|
+
|
|
201
|
+
Use the generator to scaffold the files and wire up the exports in one step:
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
pnpm --filter @enya-learning/nova new-component
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
The generator creates the component file, barrel index, and story, then
|
|
208
|
+
automatically adds the barrel export to `src/index.ts` and the build entry to
|
|
209
|
+
`vite.config.ts`. The `package.json` exports use a wildcard (`"./components/*"`)
|
|
210
|
+
— no manual edit needed.
|
|
211
|
+
|
|
212
|
+
After running the generator, complete these final steps manually:
|
|
213
|
+
|
|
214
|
+
### 1. Implement the component
|
|
215
|
+
|
|
216
|
+
Fill in `src/components/{name}/{name}.tsx` — the generator creates a minimal
|
|
217
|
+
`<div>` shell.
|
|
218
|
+
|
|
219
|
+
### 2. Write a story
|
|
220
|
+
|
|
221
|
+
The generator creates a stub story with a single `Default` export. Add variant
|
|
222
|
+
and state stories. See [Writing stories](#writing-stories) below.
|
|
223
|
+
|
|
224
|
+
### 3. Generate the docs page
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
pnpm generate-docs
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
This creates `apps/web/src/content/components/{name}.mdx` from your story file.
|
|
231
|
+
Commit it.
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
### Reference: what the generator does
|
|
236
|
+
|
|
237
|
+
For manual setups or debugging, here is what `pnpm new-component` automates:
|
|
238
|
+
|
|
239
|
+
**Creates:**
|
|
240
|
+
|
|
241
|
+
```
|
|
242
|
+
src/components/{name}/
|
|
243
|
+
├── {name}.tsx component shell
|
|
244
|
+
├── {name}.stories.tsx Storybook story stub
|
|
245
|
+
└── index.ts barrel re-export (export * from "./{name}")
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
**Modifies `src/index.ts`** — appends before the utils export:
|
|
249
|
+
|
|
250
|
+
```ts
|
|
251
|
+
export * from "./components/{name}"
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
**Modifies `vite.config.ts`** — inserts before `// ADD_COMPONENT_ENTRY_HERE`:
|
|
255
|
+
|
|
256
|
+
```ts
|
|
257
|
+
"components/{name}": resolve(__dirname, "src/components/{name}/index.ts"),
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
## Writing stories
|
|
263
|
+
|
|
264
|
+
Stories live alongside their component:
|
|
265
|
+
|
|
266
|
+
```
|
|
267
|
+
src/components/button/
|
|
268
|
+
├── button.tsx
|
|
269
|
+
├── button.stories.tsx ← story file
|
|
270
|
+
└── index.ts
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
### Canonical pattern
|
|
274
|
+
|
|
275
|
+
```tsx
|
|
276
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
277
|
+
import { Button } from "./button"
|
|
278
|
+
|
|
279
|
+
// Meta: describes the component and sets defaults shared across all stories
|
|
280
|
+
const meta: Meta<typeof Button> = {
|
|
281
|
+
title: "Components/Button",
|
|
282
|
+
component: Button,
|
|
283
|
+
tags: ["autodocs"], // enables the auto-generated Docs tab
|
|
284
|
+
args: { children: "Click me" }, // default prop values for all stories
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
export default meta
|
|
288
|
+
type Story = StoryObj<typeof meta>
|
|
289
|
+
|
|
290
|
+
// Each named export is one story (one state of the component)
|
|
291
|
+
export const Default: Story = {}
|
|
292
|
+
|
|
293
|
+
export const Outline: Story = {
|
|
294
|
+
args: { variant: "outline" }, // overrides meta.args
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
export const Disabled: Story = {
|
|
298
|
+
args: { disabled: true },
|
|
299
|
+
}
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
**Rules of thumb:**
|
|
303
|
+
|
|
304
|
+
- Set shared defaults in `meta.args` (e.g. `children`, `placeholder`). Per-story
|
|
305
|
+
`args` merge on top.
|
|
306
|
+
- Add `tags: ["autodocs"]` to every meta object — this activates the
|
|
307
|
+
auto-generated props table.
|
|
308
|
+
- Give every variant and state its own named export so it appears in the
|
|
309
|
+
sidebar.
|
|
310
|
+
- For components that render void HTML elements (e.g. `Input`, `Checkbox`), do
|
|
311
|
+
not set `children` in `args` — the generator produces self-closing JSX.
|
|
312
|
+
- Use a `render:` function for multi-component showcase stories (AllVariants,
|
|
313
|
+
AllSizes). The doc generator skips these.
|
|
314
|
+
|
|
315
|
+
### Dark mode
|
|
316
|
+
|
|
317
|
+
The Storybook toolbar has a light/dark toggle. It sets `data-mode="dark"` on the
|
|
318
|
+
HTML root, activating Nova's `dark:` Tailwind variant. All components respond
|
|
319
|
+
automatically — no extra work needed in stories.
|
|
320
|
+
|
|
321
|
+
---
|
|
322
|
+
|
|
323
|
+
## Generating docs
|
|
324
|
+
|
|
325
|
+
The generate-docs script reads every `*.stories.tsx` file, extracts prop types
|
|
326
|
+
and story examples, and writes a `.mdx` file to the Astro docs site.
|
|
327
|
+
|
|
328
|
+
```bash
|
|
329
|
+
# From packages/nova
|
|
330
|
+
pnpm generate-docs
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
Output: `apps/web/src/content/components/{name}.mdx`
|
|
334
|
+
|
|
335
|
+
Re-run this whenever you:
|
|
336
|
+
|
|
337
|
+
- Add a new component story
|
|
338
|
+
- Add or rename stories
|
|
339
|
+
- Update `meta.args`
|
|
340
|
+
|
|
341
|
+
The generated MDX files are committed to the repo so the Astro site can build
|
|
342
|
+
without running the script in CI.
|
|
343
|
+
|
|
344
|
+
---
|
|
345
|
+
|
|
346
|
+
## Testing and quality
|
|
347
|
+
|
|
348
|
+
```bash
|
|
349
|
+
# Unit tests (vitest)
|
|
350
|
+
pnpm test # single run
|
|
351
|
+
pnpm test:watch # watch mode
|
|
352
|
+
|
|
353
|
+
# TypeScript
|
|
354
|
+
pnpm typecheck
|
|
355
|
+
|
|
356
|
+
# Lint
|
|
357
|
+
pnpm lint
|
|
358
|
+
|
|
359
|
+
# Format
|
|
360
|
+
pnpm format
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
Run all checks from the monorepo root:
|
|
364
|
+
|
|
365
|
+
```bash
|
|
366
|
+
pnpm --filter @enya-learning/nova test
|
|
367
|
+
pnpm typecheck # runs across all workspaces via turbo
|
|
368
|
+
pnpm lint
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
---
|
|
372
|
+
|
|
373
|
+
## Publishing
|
|
374
|
+
|
|
375
|
+
Nova is published to the GitHub npm registry (`npm.pkg.github.com`). Publishing
|
|
376
|
+
requires a GitHub Personal Access Token with `packages:write` scope in your
|
|
377
|
+
`~/.npmrc`:
|
|
378
|
+
|
|
379
|
+
```
|
|
380
|
+
//npm.pkg.github.com/:_authToken=YOUR_TOKEN
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
### Release flow
|
|
384
|
+
|
|
385
|
+
**1. Create a changeset** — describe what changed and choose a semver bump:
|
|
386
|
+
|
|
387
|
+
```bash
|
|
388
|
+
# From the monorepo root
|
|
389
|
+
pnpm changeset
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
Select `@enya-learning/nova`, choose `patch / minor / major`, write a one-line
|
|
393
|
+
description. This creates a `.changeset/*.md` file — commit it with your feature
|
|
394
|
+
branch.
|
|
395
|
+
|
|
396
|
+
**Semver guide:** | Change type | Bump | |-------------|------| | Bug fix, style
|
|
397
|
+
tweak | `patch` | | New component, new prop, new variant | `minor` | | Removed
|
|
398
|
+
export, renamed prop, breaking API change | `major` |
|
|
399
|
+
|
|
400
|
+
**2. Bump the version** — consumes all pending changesets and updates
|
|
401
|
+
`CHANGELOG.md`:
|
|
402
|
+
|
|
403
|
+
```bash
|
|
404
|
+
pnpm version
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
**3. Build and publish**:
|
|
408
|
+
|
|
409
|
+
```bash
|
|
410
|
+
pnpm release
|
|
411
|
+
# → builds packages/nova, then runs changeset publish
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
**4. Push the version commit and tags**:
|
|
415
|
+
|
|
416
|
+
```bash
|
|
417
|
+
git push && git push --tags
|
|
418
|
+
```
|
package/changelog.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { pn as m } from "./vendor-base-ui-efqwzv4oinwg1f0d.js";
|
|
3
|
+
import { n as p } from "./vendor-styling-eeiy57tyznmxsfky.js";
|
|
4
|
+
import { t as y } from "./utils-kyb5nny4y41y7hd8.js";
|
|
5
|
+
import { jsx as k } from "react/jsx-runtime";
|
|
6
|
+
var g = (i) => typeof i == "boolean" ? `${i}` : i === 0 ? "0" : i, b = p, z = (i, t) => (e) => {
|
|
7
|
+
var s;
|
|
8
|
+
if (t?.variants == null) return b(i, e?.class, e?.className);
|
|
9
|
+
const { variants: u, defaultVariants: d } = t, x = Object.keys(u).map((n) => {
|
|
10
|
+
const a = e?.[n], o = d?.[n];
|
|
11
|
+
if (a === null) return null;
|
|
12
|
+
const r = g(a) || g(o);
|
|
13
|
+
return u[n][r];
|
|
14
|
+
}), c = e && Object.entries(e).reduce((n, a) => {
|
|
15
|
+
let [o, r] = a;
|
|
16
|
+
return r === void 0 || (n[o] = r), n;
|
|
17
|
+
}, {});
|
|
18
|
+
return b(i, x, t == null || (s = t.compoundVariants) === null || s === void 0 ? void 0 : s.reduce((n, a) => {
|
|
19
|
+
let { class: o, className: r, ...f } = a;
|
|
20
|
+
return Object.entries(f).every((h) => {
|
|
21
|
+
let [v, l] = h;
|
|
22
|
+
return Array.isArray(l) ? l.includes({
|
|
23
|
+
...d,
|
|
24
|
+
...c
|
|
25
|
+
}[v]) : {
|
|
26
|
+
...d,
|
|
27
|
+
...c
|
|
28
|
+
}[v] === l;
|
|
29
|
+
}) ? [
|
|
30
|
+
...n,
|
|
31
|
+
o,
|
|
32
|
+
r
|
|
33
|
+
] : n;
|
|
34
|
+
}, []), e?.class, e?.className);
|
|
35
|
+
}, _ = z("group/button inline-flex shrink-0 items-center justify-center rounded-4xl border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all duration-150 outline-none select-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 active:not-aria-[haspopup]:scale-[0.97] disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
36
|
+
variants: {
|
|
37
|
+
variant: {
|
|
38
|
+
accent: "bg-accent text-primary-foreground hover:bg-accent/80",
|
|
39
|
+
default: "bg-foreground text-primary-foreground hover:bg-foreground/80",
|
|
40
|
+
outline: "border-border bg-nova-white hover:bg-input/30 hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground",
|
|
41
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
|
|
42
|
+
ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
|
|
43
|
+
destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
|
|
44
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
45
|
+
},
|
|
46
|
+
size: {
|
|
47
|
+
default: "h-9 gap-1.5 px-3 has-data-[icon=inline-end]:pe-2.5 has-data-[icon=inline-start]:ps-2.5",
|
|
48
|
+
xs: "h-6 gap-1 px-2.5 text-xs has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2 [&_svg:not([class*='size-'])]:size-3",
|
|
49
|
+
sm: "h-8 gap-1 px-3 has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2",
|
|
50
|
+
lg: "h-10 gap-1.5 px-4 has-data-[icon=inline-end]:pe-3 has-data-[icon=inline-start]:ps-3",
|
|
51
|
+
xl: "h-15 gap-2 rounded-full px-5 text-2xl has-data-[icon=inline-end]:pe-4 has-data-[icon=inline-start]:ps-4",
|
|
52
|
+
icon: "size-9",
|
|
53
|
+
"icon-xs": "size-6 [&_svg:not([class*='size-'])]:size-3",
|
|
54
|
+
"icon-sm": "size-8",
|
|
55
|
+
"icon-lg": "size-10",
|
|
56
|
+
"icon-xl": "size-12"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
defaultVariants: {
|
|
60
|
+
variant: "default",
|
|
61
|
+
size: "default"
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
function w({ className: i, variant: t = "default", size: e = "default", ...s }) {
|
|
65
|
+
return /* @__PURE__ */ k(m, {
|
|
66
|
+
"data-slot": "button",
|
|
67
|
+
className: y(_({
|
|
68
|
+
variant: t,
|
|
69
|
+
size: e,
|
|
70
|
+
className: i
|
|
71
|
+
})),
|
|
72
|
+
...s
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
export {
|
|
76
|
+
_ as n,
|
|
77
|
+
z as r,
|
|
78
|
+
w as t
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
//# sourceMappingURL=button-npy7isi3nsvlhf86.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button-npy7isi3nsvlhf86.js","names":[],"sources":["../../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs","../../src/components/button/button.tsx"],"sourcesContent":["/**\n * Copyright 2022 Joe Bell. All rights reserved.\n *\n * This file is licensed to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with the\n * License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR REPRESENTATIONS OF ANY KIND, either express or implied. See the\n * License for the specific language governing permissions and limitations under\n * the License.\n */ import { clsx } from \"clsx\";\nconst falsyToString = (value)=>typeof value === \"boolean\" ? `${value}` : value === 0 ? \"0\" : value;\nexport const cx = clsx;\nexport const cva = (base, config)=>(props)=>{\n var _config_compoundVariants;\n if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n const { variants, defaultVariants } = config;\n const getVariantClassNames = Object.keys(variants).map((variant)=>{\n const variantProp = props === null || props === void 0 ? void 0 : props[variant];\n const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];\n if (variantProp === null) return null;\n const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);\n return variants[variant][variantKey];\n });\n const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>{\n let [key, value] = param;\n if (value === undefined) {\n return acc;\n }\n acc[key] = value;\n return acc;\n }, {});\n const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param)=>{\n let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;\n return Object.entries(compoundVariantOptions).every((param)=>{\n let [key, value] = param;\n return Array.isArray(value) ? value.includes({\n ...defaultVariants,\n ...propsWithoutUndefined\n }[key]) : ({\n ...defaultVariants,\n ...propsWithoutUndefined\n })[key] === value;\n }) ? [\n ...acc,\n cvClass,\n cvClassName\n ] : acc;\n }, []);\n return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n };\n\n","import { Button as ButtonPrimitive } from \"@base-ui/react/button\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"../../lib/utils\"\n\nconst buttonVariants = cva(\n \"group/button inline-flex shrink-0 items-center justify-center rounded-4xl border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all duration-150 outline-none select-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 active:not-aria-[haspopup]:scale-[0.97] disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n {\n variants: {\n variant: {\n accent: \"bg-accent text-primary-foreground hover:bg-accent/80\",\n default: \"bg-foreground text-primary-foreground hover:bg-foreground/80\",\n outline:\n \"border-border bg-nova-white hover:bg-input/30 hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground\",\n ghost:\n \"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50\",\n destructive:\n \"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default:\n \"h-9 gap-1.5 px-3 has-data-[icon=inline-end]:pe-2.5 has-data-[icon=inline-start]:ps-2.5\",\n xs: \"h-6 gap-1 px-2.5 text-xs has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2 [&_svg:not([class*='size-'])]:size-3\",\n sm: \"h-8 gap-1 px-3 has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2\",\n lg: \"h-10 gap-1.5 px-4 has-data-[icon=inline-end]:pe-3 has-data-[icon=inline-start]:ps-3\",\n xl: \"h-15 gap-2 rounded-full px-5 text-2xl has-data-[icon=inline-end]:pe-4 has-data-[icon=inline-start]:ps-4\",\n icon: \"size-9\",\n \"icon-xs\": \"size-6 [&_svg:not([class*='size-'])]:size-3\",\n \"icon-sm\": \"size-8\",\n \"icon-lg\": \"size-10\",\n \"icon-xl\": \"size-12\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nfunction Button({\n className,\n variant = \"default\",\n size = \"default\",\n ...props\n}: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>) {\n return (\n <ButtonPrimitive\n data-slot=\"button\"\n className={cn(buttonVariants({ variant, size, className }))}\n {...props}\n />\n )\n}\n\nexport { Button, buttonVariants }\n"],"x_google_ignoreList":[0],"mappings":";;;;;AAeA,IAAM,IAAA,CAAiB,MAAQ,OAAO,KAAU,YAAY,GAAG,CAAA,KAAU,MAAU,IAAI,MAAM,GAChF,IAAK,GACL,IAAA,CAAO,GAAM,MAAA,CAAU,MAAQ;AACpC,MAAI;AACJ,MAAqD,GAAO,YAAa,KAAM,QAAO,EAAG,GAAoD,GAAM,OAAqD,GAAM,SAAS;AACvN,QAAM,EAAE,UAAA,GAAU,iBAAA,EAAA,IAAoB,GAChC,IAAuB,OAAO,KAAK,CAAQ,EAAE,IAAA,CAAK,MAAU;AAC9D,UAAM,IAA4D,IAAM,CAAA,GAClE,IAAuF,IAAgB,CAAA;AAC7G,QAAI,MAAgB,KAAM,QAAO;AACjC,UAAM,IAAa,EAAc,CAAW,KAAK,EAAc,CAAkB;AACjF,WAAO,EAAS,CAAA,EAAS,CAAA;AAAA,EAC7B,CAAC,GACK,IAAwB,KAAS,OAAO,QAAQ,CAAK,EAAE,OAAA,CAAQ,GAAK,MAAQ;AAC9E,QAAI,CAAC,GAAK,CAAA,IAAS;AACnB,WAAI,MAAU,WAGd,EAAI,CAAA,IAAO,IACJ;AAAA,EACX,GAAG,CAAC,CAAC;AAkBL,SAAO,EAAG,GAAM,GAjBqB,KAAW,SAAsC,IAA2B,EAAO,sBAAsB,QAAQ,MAA6B,SAAvG,SAAyH,EAAyB,OAAA,CAAQ,GAAK,MAAQ;AAC/O,QAAI,EAAE,OAAO,GAAS,WAAW,GAAa,GAAG,EAAA,IAA2B;AAC5E,WAAO,OAAO,QAAQ,CAAsB,EAAE,MAAA,CAAO,MAAQ;AACzD,UAAI,CAAC,GAAK,CAAA,IAAS;AACnB,aAAO,MAAM,QAAQ,CAAK,IAAI,EAAM,SAAS;AAAA,QACzC,GAAG;AAAA,QACH,GAAG;AAAA,MACP,EAAE,CAAA,CAAI,IAAK;AAAA,QACP,GAAG;AAAA,QACH,GAAG;AAAA,MACP,EAAG,CAAA,MAAS;AAAA,IAChB,CAAC,IAAI;AAAA,MACD,GAAG;AAAA,MACH;AAAA,MACA;AAAA,IACJ,IAAI;AAAA,EACR,GAAG,CAAC,CAAC,GAC6G,GAAM,OAAqD,GAAM,SAAS;AAChM,GCjDE,IAAiB,EACrB,knBACA;AAAA,EACE,UAAU;AAAA,IACR,SAAS;AAAA,MACP,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,SACE;AAAA,MACF,WACE;AAAA,MACF,OACE;AAAA,MACF,aACE;AAAA,MACF,MAAM;AAAA,IACR;AAAA,IACA,MAAM;AAAA,MACJ,SACE;AAAA,MACF,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,MAAM;AAAA,MACN,WAAW;AAAA,MACX,WAAW;AAAA,MACX,WAAW;AAAA,MACX,WAAW;AAAA,IACb;AAAA,EACF;AAAA,EACA,iBAAiB;AAAA,IACf,SAAS;AAAA,IACT,MAAM;AAAA,EACR;AACF,CACF;AAEA,SAAS,EAAO,EACd,WAAA,GACA,SAAA,IAAU,WACV,MAAA,IAAO,WACP,GAAG,EAAA,GAC2D;AAC9D,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,aAAU;AAAA,IACV,WAAW,EAAG,EAAe;AAAA,MAAE,SAAA;AAAA,MAAS,MAAA;AAAA,MAAM,WAAA;AAAA,IAAU,CAAC,CAAC;AAAA,IAC1D,GAAI;AAAA,EACL,CAAA;AAEL"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var _ = Object.create, u = Object.defineProperty, s = Object.getOwnPropertyDescriptor, f = Object.getOwnPropertyNames, c = Object.getPrototypeOf, v = Object.prototype.hasOwnProperty, O = (e, r) => () => (r || (e((r = { exports: {} }).exports, r), e = null), r.exports), b = (e, r) => {
|
|
3
|
+
let t = {};
|
|
4
|
+
for (var o in e)
|
|
5
|
+
u(t, o, {
|
|
6
|
+
get: e[o],
|
|
7
|
+
enumerable: !0
|
|
8
|
+
});
|
|
9
|
+
return r || u(t, Symbol.toStringTag, { value: "Module" }), t;
|
|
10
|
+
}, g = (e, r, t, o) => {
|
|
11
|
+
if (r && typeof r == "object" || typeof r == "function")
|
|
12
|
+
for (var i = f(r), a = 0, l = i.length, n; a < l; a++)
|
|
13
|
+
n = i[a], !v.call(e, n) && n !== t && u(e, n, {
|
|
14
|
+
get: ((p) => r[p]).bind(null, n),
|
|
15
|
+
enumerable: !(o = s(r, n)) || o.enumerable
|
|
16
|
+
});
|
|
17
|
+
return e;
|
|
18
|
+
}, P = (e, r, t) => (t = e != null ? _(c(e)) : {}, g(r || !e || !e.__esModule ? u(t, "default", {
|
|
19
|
+
value: e,
|
|
20
|
+
enumerable: !0
|
|
21
|
+
}) : t, e)), d = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (r, t) => (typeof require < "u" ? require : r)[t] }) : e)(function(e) {
|
|
22
|
+
if (typeof require < "u") return require.apply(this, arguments);
|
|
23
|
+
throw Error('Calling `require` for "' + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
24
|
+
});
|
|
25
|
+
export {
|
|
26
|
+
P as i,
|
|
27
|
+
b as n,
|
|
28
|
+
d as r,
|
|
29
|
+
O as t
|
|
30
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils-kyb5nny4y41y7hd8.js","names":[],"sources":["../../src/lib/utils.ts"],"sourcesContent":["import { clsx, type ClassValue } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n"],"mappings":";;AAGA,SAAgB,KAAM,GAAsB;AAC1C,SAAO,EAAQ,EAAK,CAAM,CAAC;AAC7B"}
|