@stagewise/ui 0.1.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 +135 -0
- package/package.json +80 -0
- package/src/components/ui/accordion.tsx +66 -0
- package/src/components/ui/alert-dialog.tsx +185 -0
- package/src/components/ui/alert.tsx +76 -0
- package/src/components/ui/aspect-ratio.tsx +22 -0
- package/src/components/ui/avatar.tsx +107 -0
- package/src/components/ui/badge.tsx +52 -0
- package/src/components/ui/breadcrumb.tsx +125 -0
- package/src/components/ui/bubble.tsx +128 -0
- package/src/components/ui/button-group.tsx +87 -0
- package/src/components/ui/button.tsx +58 -0
- package/src/components/ui/calendar.tsx +221 -0
- package/src/components/ui/card.tsx +103 -0
- package/src/components/ui/carousel.tsx +240 -0
- package/src/components/ui/chart.tsx +371 -0
- package/src/components/ui/checkbox.tsx +30 -0
- package/src/components/ui/collapsible.tsx +19 -0
- package/src/components/ui/combobox.tsx +295 -0
- package/src/components/ui/command.tsx +348 -0
- package/src/components/ui/context-menu.tsx +271 -0
- package/src/components/ui/dialog.tsx +160 -0
- package/src/components/ui/direction.tsx +4 -0
- package/src/components/ui/drawer.tsx +228 -0
- package/src/components/ui/dropdown-menu.tsx +266 -0
- package/src/components/ui/empty.tsx +104 -0
- package/src/components/ui/field.tsx +236 -0
- package/src/components/ui/hover-card.tsx +51 -0
- package/src/components/ui/input-group.tsx +158 -0
- package/src/components/ui/input-otp.tsx +85 -0
- package/src/components/ui/input.tsx +20 -0
- package/src/components/ui/item.tsx +201 -0
- package/src/components/ui/kbd.tsx +26 -0
- package/src/components/ui/label.tsx +20 -0
- package/src/components/ui/marker.tsx +71 -0
- package/src/components/ui/menubar.tsx +280 -0
- package/src/components/ui/message.tsx +92 -0
- package/src/components/ui/native-select.tsx +61 -0
- package/src/components/ui/navigation-menu.tsx +168 -0
- package/src/components/ui/pagination.tsx +130 -0
- package/src/components/ui/popover.tsx +88 -0
- package/src/components/ui/progress.tsx +83 -0
- package/src/components/ui/questionnaire.tsx +324 -0
- package/src/components/ui/radio-group.tsx +36 -0
- package/src/components/ui/resizable.tsx +50 -0
- package/src/components/ui/scroll-area.tsx +53 -0
- package/src/components/ui/select.tsx +201 -0
- package/src/components/ui/separator.tsx +23 -0
- package/src/components/ui/sheet.tsx +136 -0
- package/src/components/ui/sidebar.tsx +723 -0
- package/src/components/ui/skeleton.tsx +13 -0
- package/src/components/ui/slider.tsx +52 -0
- package/src/components/ui/spinner.tsx +10 -0
- package/src/components/ui/switch.tsx +32 -0
- package/src/components/ui/table.tsx +114 -0
- package/src/components/ui/tabs.tsx +82 -0
- package/src/components/ui/textarea.tsx +18 -0
- package/src/components/ui/toast.tsx +234 -0
- package/src/components/ui/toggle-group.tsx +87 -0
- package/src/components/ui/toggle.tsx +43 -0
- package/src/components/ui/tooltip.tsx +66 -0
- package/src/fonts/OFL.txt +92 -0
- package/src/fonts/geist-variable-italic.woff2 +0 -0
- package/src/fonts/geist-variable.woff2 +0 -0
- package/src/hooks/use-mobile.ts +19 -0
- package/src/icons/custom/index.ts +1 -0
- package/src/icons/custom/ui-outline-18/Icon.tsx +28 -0
- package/src/icons/custom/ui-outline-18/IconBrowserTab.tsx +40 -0
- package/src/icons/custom/ui-outline-18/IconNewTerminal.tsx +77 -0
- package/src/icons/custom/ui-outline-18/index.ts +3 -0
- package/src/icons/index.ts +52 -0
- package/src/icons/nucleo/LICENSE.md +29 -0
- package/src/icons/nucleo/core-outline-24/Icon.tsx +27 -0
- package/src/icons/nucleo/core-outline-24/IconArrowUpOutline24.tsx +36 -0
- package/src/icons/nucleo/core-outline-24/IconBluetoothOutline24.tsx +26 -0
- package/src/icons/nucleo/core-outline-24/IconTrash2Outline24.tsx +76 -0
- package/src/icons/nucleo/core-outline-24/IconUsbOutline24.tsx +64 -0
- package/src/icons/nucleo/core-outline-24/index.ts +5 -0
- package/src/icons/nucleo/index.ts +48 -0
- package/src/icons/nucleo/micro-bold/Icon.tsx +27 -0
- package/src/icons/nucleo/micro-bold/IconArrowLeft.tsx +28 -0
- package/src/icons/nucleo/micro-bold/IconArrowRight.tsx +28 -0
- package/src/icons/nucleo/micro-bold/IconArrowRotateAnticlockwise.tsx +27 -0
- package/src/icons/nucleo/micro-bold/IconChevronLeft.tsx +16 -0
- package/src/icons/nucleo/micro-bold/IconChevronRight.tsx +16 -0
- package/src/icons/nucleo/micro-bold/IconClipboardContent.tsx +59 -0
- package/src/icons/nucleo/micro-bold/IconMagicWandSparkle.tsx +44 -0
- package/src/icons/nucleo/micro-bold/IconTriangleWarning.tsx +30 -0
- package/src/icons/nucleo/micro-bold/IconXmark.tsx +31 -0
- package/src/icons/nucleo/micro-bold/index.ts +10 -0
- package/src/icons/nucleo/social-media/Icon.tsx +27 -0
- package/src/icons/nucleo/social-media/IconApple.tsx +12 -0
- package/src/icons/nucleo/social-media/IconGithub.tsx +11 -0
- package/src/icons/nucleo/social-media/IconGoogle.tsx +20 -0
- package/src/icons/nucleo/social-media/index.ts +4 -0
- package/src/icons/nucleo/ui-fill-18/Icon.tsx +27 -0
- package/src/icons/nucleo/ui-fill-18/IconArrowLeftFill18.tsx +17 -0
- package/src/icons/nucleo/ui-fill-18/IconArrowRightFill18.tsx +17 -0
- package/src/icons/nucleo/ui-fill-18/IconCheckFill18.tsx +12 -0
- package/src/icons/nucleo/ui-fill-18/IconChevronDownFill18.tsx +12 -0
- package/src/icons/nucleo/ui-fill-18/IconGlobe2Fill18.tsx +17 -0
- package/src/icons/nucleo/ui-fill-18/IconLinkFill18.tsx +21 -0
- package/src/icons/nucleo/ui-fill-18/IconMediaStopFill18.tsx +17 -0
- package/src/icons/nucleo/ui-fill-18/IconPinTackFill18.tsx +17 -0
- package/src/icons/nucleo/ui-fill-18/IconPlusFill18.tsx +17 -0
- package/src/icons/nucleo/ui-fill-18/IconVolumeUpFill18.tsx +22 -0
- package/src/icons/nucleo/ui-fill-18/IconVolumeXmarkFill18.tsx +17 -0
- package/src/icons/nucleo/ui-fill-18/IconXmarkFill18.tsx +17 -0
- package/src/icons/nucleo/ui-fill-18/index.ts +13 -0
- package/src/icons/nucleo/ui-fill-duo-18/Icon.tsx +27 -0
- package/src/icons/nucleo/ui-fill-duo-18/IconBrainNodesFillDuo18.tsx +32 -0
- package/src/icons/nucleo/ui-fill-duo-18/IconCloudeCodeFillDuo18.tsx +25 -0
- package/src/icons/nucleo/ui-fill-duo-18/IconDatabaseFillDuo18.tsx +24 -0
- package/src/icons/nucleo/ui-fill-duo-18/IconDownload4FillDuo18.tsx +18 -0
- package/src/icons/nucleo/ui-fill-duo-18/IconEarthFillDuo18.tsx +20 -0
- package/src/icons/nucleo/ui-fill-duo-18/IconFinderFillDuo18.tsx +36 -0
- package/src/icons/nucleo/ui-fill-duo-18/IconFolderContent2FillDuo18.tsx +22 -0
- package/src/icons/nucleo/ui-fill-duo-18/IconGear3FillDuo18.tsx +18 -0
- package/src/icons/nucleo/ui-fill-duo-18/IconHistoryFillDuo18.tsx +20 -0
- package/src/icons/nucleo/ui-fill-duo-18/IconLockKeyFillDuo18.tsx +24 -0
- package/src/icons/nucleo/ui-fill-duo-18/IconNoteFillDuo18.tsx +34 -0
- package/src/icons/nucleo/ui-fill-duo-18/IconPenDrawSparkleFillDuo18.tsx +34 -0
- package/src/icons/nucleo/ui-fill-duo-18/IconServerFillDuo18.tsx +22 -0
- package/src/icons/nucleo/ui-fill-duo-18/IconSpace3dFillDuo18.tsx +24 -0
- package/src/icons/nucleo/ui-fill-duo-18/IconTriangleWarningFillDuo18.tsx +24 -0
- package/src/icons/nucleo/ui-fill-duo-18/index.ts +16 -0
- package/src/icons/nucleo/ui-outline-18/Icon.tsx +27 -0
- package/src/icons/nucleo/ui-outline-18/IconArrowDownOutline18.tsx +33 -0
- package/src/icons/nucleo/ui-outline-18/IconArrowRightOutline18.tsx +34 -0
- package/src/icons/nucleo/ui-outline-18/IconArrowUpRightOutline18.tsx +34 -0
- package/src/icons/nucleo/ui-outline-18/IconArrowsOppositeDirectionXOutline18.tsx +54 -0
- package/src/icons/nucleo/ui-outline-18/IconArrowsToCenterOutline18.tsx +101 -0
- package/src/icons/nucleo/ui-outline-18/IconBanOutline18.tsx +37 -0
- package/src/icons/nucleo/ui-outline-18/IconBellDotOutline18.tsx +43 -0
- package/src/icons/nucleo/ui-outline-18/IconBookOpen5Outline18.tsx +40 -0
- package/src/icons/nucleo/ui-outline-18/IconBookOpenOutline18.tsx +32 -0
- package/src/icons/nucleo/ui-outline-18/IconBooks2Outline18.tsx +100 -0
- package/src/icons/nucleo/ui-outline-18/IconBoxSparkleOutline18.tsx +75 -0
- package/src/icons/nucleo/ui-outline-18/IconBrainOutline18.tsx +57 -0
- package/src/icons/nucleo/ui-outline-18/IconBranchOutOutline18.tsx +52 -0
- package/src/icons/nucleo/ui-outline-18/IconBugOutline18.tsx +98 -0
- package/src/icons/nucleo/ui-outline-18/IconCameraOutline18.tsx +42 -0
- package/src/icons/nucleo/ui-outline-18/IconChartPieOutline18.tsx +30 -0
- package/src/icons/nucleo/ui-outline-18/IconCheck2Outline18.tsx +23 -0
- package/src/icons/nucleo/ui-outline-18/IconCheckOutline18.tsx +23 -0
- package/src/icons/nucleo/ui-outline-18/IconChevronDownOutline18.tsx +22 -0
- package/src/icons/nucleo/ui-outline-18/IconChevronExpandYOutline18.tsx +31 -0
- package/src/icons/nucleo/ui-outline-18/IconChevronLeftOutline18.tsx +22 -0
- package/src/icons/nucleo/ui-outline-18/IconChevronReduceYOutline18.tsx +31 -0
- package/src/icons/nucleo/ui-outline-18/IconChevronRightOutline18.tsx +22 -0
- package/src/icons/nucleo/ui-outline-18/IconChevronUpOutline18.tsx +22 -0
- package/src/icons/nucleo/ui-outline-18/IconCircleCheckOutline18.tsx +32 -0
- package/src/icons/nucleo/ui-outline-18/IconCircleInfoOutline18.tsx +37 -0
- package/src/icons/nucleo/ui-outline-18/IconCircleQuestionOutline18.tsx +39 -0
- package/src/icons/nucleo/ui-outline-18/IconClipboardContentOutline18.tsx +60 -0
- package/src/icons/nucleo/ui-outline-18/IconClipboardOutline18.tsx +37 -0
- package/src/icons/nucleo/ui-outline-18/IconClone2Outline18.tsx +32 -0
- package/src/icons/nucleo/ui-outline-18/IconCloneDashed2Outline18.tsx +49 -0
- package/src/icons/nucleo/ui-outline-18/IconCodeBranchOutline18.tsx +65 -0
- package/src/icons/nucleo/ui-outline-18/IconCodeCommitOutline18.tsx +48 -0
- package/src/icons/nucleo/ui-outline-18/IconColorPaletteOutline18.tsx +56 -0
- package/src/icons/nucleo/ui-outline-18/IconConnection2Outline18.tsx +43 -0
- package/src/icons/nucleo/ui-outline-18/IconCopyIdOutline18.tsx +52 -0
- package/src/icons/nucleo/ui-outline-18/IconCopyOutline18.tsx +32 -0
- package/src/icons/nucleo/ui-outline-18/IconCreditCardOutline18.tsx +61 -0
- package/src/icons/nucleo/ui-outline-18/IconDatabaseSearchOutline18.tsx +64 -0
- package/src/icons/nucleo/ui-outline-18/IconDotsOutline18.tsx +46 -0
- package/src/icons/nucleo/ui-outline-18/IconDownload4Outline18.tsx +43 -0
- package/src/icons/nucleo/ui-outline-18/IconEarthOutline18.tsx +47 -0
- package/src/icons/nucleo/ui-outline-18/IconEarthSearchOutline18.tsx +61 -0
- package/src/icons/nucleo/ui-outline-18/IconEnvelopeOutline18.tsx +38 -0
- package/src/icons/nucleo/ui-outline-18/IconEye2Outline18.tsx +34 -0
- package/src/icons/nucleo/ui-outline-18/IconEyeOutline18.tsx +32 -0
- package/src/icons/nucleo/ui-outline-18/IconFilePenOutline18.tsx +56 -0
- package/src/icons/nucleo/ui-outline-18/IconFileSearchOutline18.tsx +64 -0
- package/src/icons/nucleo/ui-outline-18/IconFloppyDiskOutline18.tsx +40 -0
- package/src/icons/nucleo/ui-outline-18/IconFolder5Outline18.tsx +37 -0
- package/src/icons/nucleo/ui-outline-18/IconFolderCloudOutline18.tsx +39 -0
- package/src/icons/nucleo/ui-outline-18/IconFolderOpenOutline18.tsx +31 -0
- package/src/icons/nucleo/ui-outline-18/IconFolderOutline18.tsx +32 -0
- package/src/icons/nucleo/ui-outline-18/IconFolderPenOutline18.tsx +40 -0
- package/src/icons/nucleo/ui-outline-18/IconFolderPlusOutline18.tsx +48 -0
- package/src/icons/nucleo/ui-outline-18/IconFolderSearchOutline18.tsx +48 -0
- package/src/icons/nucleo/ui-outline-18/IconGear2Outline18.tsx +193 -0
- package/src/icons/nucleo/ui-outline-18/IconGear3Outline18.tsx +32 -0
- package/src/icons/nucleo/ui-outline-18/IconGlobe3Outline18.tsx +61 -0
- package/src/icons/nucleo/ui-outline-18/IconGripDotsVerticalOutline18.tsx +74 -0
- package/src/icons/nucleo/ui-outline-18/IconHardDriveOutline18.tsx +40 -0
- package/src/icons/nucleo/ui-outline-18/IconHelpChatOutline18.tsx +47 -0
- package/src/icons/nucleo/ui-outline-18/IconHotDrinkOutline18.tsx +60 -0
- package/src/icons/nucleo/ui-outline-18/IconImageSparkle3Outline18.tsx +41 -0
- package/src/icons/nucleo/ui-outline-18/IconKey2Outline18.tsx +61 -0
- package/src/icons/nucleo/ui-outline-18/IconLoader6Outline18.tsx +23 -0
- package/src/icons/nucleo/ui-outline-18/IconLocation2Outline18.tsx +45 -0
- package/src/icons/nucleo/ui-outline-18/IconLockKeyOutline18.tsx +58 -0
- package/src/icons/nucleo/ui-outline-18/IconMagicWandOutline18.tsx +32 -0
- package/src/icons/nucleo/ui-outline-18/IconMagnifierMinusOutline18.tsx +39 -0
- package/src/icons/nucleo/ui-outline-18/IconMagnifierOutline18.tsx +32 -0
- package/src/icons/nucleo/ui-outline-18/IconMagnifierPlusOutline18.tsx +48 -0
- package/src/icons/nucleo/ui-outline-18/IconMicrophone3Outline18.tsx +57 -0
- package/src/icons/nucleo/ui-outline-18/IconMinusOutline18.tsx +25 -0
- package/src/icons/nucleo/ui-outline-18/IconMoonOutline18.tsx +23 -0
- package/src/icons/nucleo/ui-outline-18/IconMsgSleepOutline18.tsx +41 -0
- package/src/icons/nucleo/ui-outline-18/IconMsgWritingOutline18.tsx +42 -0
- package/src/icons/nucleo/ui-outline-18/IconMusicOutline18.tsx +67 -0
- package/src/icons/nucleo/ui-outline-18/IconOctagonWarningOutline18.tsx +35 -0
- package/src/icons/nucleo/ui-outline-18/IconOpenExternalOutline18.tsx +51 -0
- package/src/icons/nucleo/ui-outline-18/IconOpenRectArrowInOutline18.tsx +43 -0
- package/src/icons/nucleo/ui-outline-18/IconPanelLeftOutline18.tsx +39 -0
- package/src/icons/nucleo/ui-outline-18/IconPaperclip2Outline18.tsx +22 -0
- package/src/icons/nucleo/ui-outline-18/IconPen2Outline18.tsx +35 -0
- package/src/icons/nucleo/ui-outline-18/IconPenDrawSparkleOutline18.tsx +46 -0
- package/src/icons/nucleo/ui-outline-18/IconPenOutline18.tsx +23 -0
- package/src/icons/nucleo/ui-outline-18/IconPenPlusOutline18.tsx +47 -0
- package/src/icons/nucleo/ui-outline-18/IconPenWriting3Outline18.tsx +31 -0
- package/src/icons/nucleo/ui-outline-18/IconPhoneOutline18.tsx +23 -0
- package/src/icons/nucleo/ui-outline-18/IconPinTackOutline18.tsx +35 -0
- package/src/icons/nucleo/ui-outline-18/IconPinTackSlashOutline18.tsx +47 -0
- package/src/icons/nucleo/ui-outline-18/IconPlusOutline18.tsx +38 -0
- package/src/icons/nucleo/ui-outline-18/IconPowerOffOutline18.tsx +36 -0
- package/src/icons/nucleo/ui-outline-18/IconPresentationScreenVideoOutline18.tsx +55 -0
- package/src/icons/nucleo/ui-outline-18/IconPuzzlePieceOutline18.tsx +22 -0
- package/src/icons/nucleo/ui-outline-18/IconRedoOutline18.tsx +32 -0
- package/src/icons/nucleo/ui-outline-18/IconRefreshAnticlockwiseOutline18.tsx +48 -0
- package/src/icons/nucleo/ui-outline-18/IconReuseOutline18.tsx +50 -0
- package/src/icons/nucleo/ui-outline-18/IconSearchContentOutline18.tsx +81 -0
- package/src/icons/nucleo/ui-outline-18/IconServerOutline18.tsx +73 -0
- package/src/icons/nucleo/ui-outline-18/IconSideProfileSparkleOutline18.tsx +28 -0
- package/src/icons/nucleo/ui-outline-18/IconSidebarLeftHideOutline18.tsx +49 -0
- package/src/icons/nucleo/ui-outline-18/IconSidebarLeftShowOutline18.tsx +49 -0
- package/src/icons/nucleo/ui-outline-18/IconSidebarRightHideOutline18.tsx +48 -0
- package/src/icons/nucleo/ui-outline-18/IconSidebarRightShowOutline18.tsx +48 -0
- package/src/icons/nucleo/ui-outline-18/IconSparkleOutline18.tsx +43 -0
- package/src/icons/nucleo/ui-outline-18/IconSpeakerOutline18.tsx +47 -0
- package/src/icons/nucleo/ui-outline-18/IconSplitViewOutline18.tsx +32 -0
- package/src/icons/nucleo/ui-outline-18/IconSquareCodeOutline18.tsx +40 -0
- package/src/icons/nucleo/ui-outline-18/IconSquareDashedOutline18.tsx +94 -0
- package/src/icons/nucleo/ui-outline-18/IconSquareTerminalOutline18.tsx +48 -0
- package/src/icons/nucleo/ui-outline-18/IconSunOutline18.tsx +121 -0
- package/src/icons/nucleo/ui-outline-18/IconTerminalOutline18.tsx +35 -0
- package/src/icons/nucleo/ui-outline-18/IconTextAlignLeft2Outline18.tsx +60 -0
- package/src/icons/nucleo/ui-outline-18/IconTextBgColorOutline18.tsx +48 -0
- package/src/icons/nucleo/ui-outline-18/IconTextColorOutline18.tsx +48 -0
- package/src/icons/nucleo/ui-outline-18/IconThumbsDownOutline18.tsx +36 -0
- package/src/icons/nucleo/ui-outline-18/IconThumbsUpOutline18.tsx +37 -0
- package/src/icons/nucleo/ui-outline-18/IconTrashOutline18.tsx +41 -0
- package/src/icons/nucleo/ui-outline-18/IconTriangleWarningOutline18.tsx +37 -0
- package/src/icons/nucleo/ui-outline-18/IconUndoOutline18.tsx +32 -0
- package/src/icons/nucleo/ui-outline-18/IconVersionsOutline18.tsx +46 -0
- package/src/icons/nucleo/ui-outline-18/IconVideoOutline18.tsx +45 -0
- package/src/icons/nucleo/ui-outline-18/IconWaveformLinesOutline18.tsx +80 -0
- package/src/icons/nucleo/ui-outline-18/IconWindowCodeOutline18.tsx +62 -0
- package/src/icons/nucleo/ui-outline-18/IconWindowPointerOutline18.tsx +51 -0
- package/src/icons/nucleo/ui-outline-18/IconXmarkOutline18.tsx +38 -0
- package/src/icons/nucleo/ui-outline-18/index.ts +128 -0
- package/src/index.ts +66 -0
- package/src/lib/utils.ts +6 -0
- package/src/plugin/index.ts +611 -0
- package/src/styles/animations.css +59 -0
- package/src/styles/bridge.css +117 -0
- package/src/styles/derived-utilities.css +179 -0
- package/src/styles/fonts.css +23 -0
- package/src/styles/index.css +72 -0
- package/src/styles/palette.css +189 -0
- package/src/styles/tailwind-tokens.css +56 -0
- package/src/styles/theme.css +103 -0
package/README.md
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# @stagewise/ui
|
|
2
|
+
|
|
3
|
+
Customized [shadcn/ui](https://ui.shadcn.com) components built on [Base UI](https://base-ui.com) primitives, with a dynamic OKLCH color system and derived color utilities.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @stagewise/ui
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Peer dependencies
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pnpm add react react-dom tailwindcss@^4
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Setup
|
|
18
|
+
|
|
19
|
+
### 1. Import the stylesheet
|
|
20
|
+
|
|
21
|
+
In your app's main CSS file (the one that imports `tailwindcss`):
|
|
22
|
+
|
|
23
|
+
```css
|
|
24
|
+
@import "tailwindcss";
|
|
25
|
+
@import "@stagewise/ui/style.css";
|
|
26
|
+
|
|
27
|
+
/* Required: tells Tailwind to scan component source files for class names */
|
|
28
|
+
@source "@stagewise/ui/src";
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
That single `@import` loads everything:
|
|
32
|
+
|
|
33
|
+
- The OKLCH color palette and theme tokens (light/dark)
|
|
34
|
+
- Bundled Geist Variable font (woff2, weights 100–900, upright + italic)
|
|
35
|
+
- The shadcn bridge layer (semantic token mappings)
|
|
36
|
+
- Derived color utilities (`border-derived`, `bg-hover-derived`, etc.)
|
|
37
|
+
- The `tailwindcss-color-modifiers` plugin (auto-loaded via `@plugin`)
|
|
38
|
+
- `tw-animate-css` animation utilities (`animate-in`, `fade-in-0`, `zoom-in-95`, etc.)
|
|
39
|
+
|
|
40
|
+
No separate `@config` file or plugin configuration is needed.
|
|
41
|
+
|
|
42
|
+
### Fonts
|
|
43
|
+
|
|
44
|
+
Geist Variable is bundled directly in the package — no `@fontsource` packages or `<link>` tags needed. The `@font-face` declarations are included in `style.css` and the woff2 files are served from the package.
|
|
45
|
+
|
|
46
|
+
The following Tailwind font tokens are set by default:
|
|
47
|
+
|
|
48
|
+
| Token | Value |
|
|
49
|
+
|-------|-------|
|
|
50
|
+
| `font-sans` | `"Geist Variable", ui-sans-serif, system-ui, sans-serif` |
|
|
51
|
+
| `font-heading` | `"Geist Variable", ui-sans-serif, system-ui, sans-serif` |
|
|
52
|
+
| `font-mono` | `ui-monospace, "SF Mono", "Cascadia Code", monospace` |
|
|
53
|
+
|
|
54
|
+
To use a different typeface, override the tokens after the import:
|
|
55
|
+
|
|
56
|
+
```css
|
|
57
|
+
@import "@stagewise/ui/style.css";
|
|
58
|
+
|
|
59
|
+
@theme inline {
|
|
60
|
+
--font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
|
|
61
|
+
--font-heading: "Inter", ui-sans-serif, system-ui, sans-serif;
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### 2. Dark mode
|
|
66
|
+
|
|
67
|
+
The package uses `.dark` class on a root element (typically `<html>`) for dark mode. A no-FOUC script is recommended:
|
|
68
|
+
|
|
69
|
+
```html
|
|
70
|
+
<script>
|
|
71
|
+
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
|
72
|
+
document.documentElement.classList.add('dark')
|
|
73
|
+
}
|
|
74
|
+
</script>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### 3. Optional: Custom hue and chroma
|
|
78
|
+
|
|
79
|
+
The color system is driven by CSS custom properties. Override them at `:root`:
|
|
80
|
+
|
|
81
|
+
```css
|
|
82
|
+
:root {
|
|
83
|
+
--H: 265; /* primary hue (0-360) */
|
|
84
|
+
--H-base: 85; /* neutral/base hue */
|
|
85
|
+
--primary-chroma-scale: 1; /* 0-2, scale primary chroma */
|
|
86
|
+
--base-chroma-scale: 1; /* 0-2, scale neutral chroma */
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Usage
|
|
91
|
+
|
|
92
|
+
```tsx
|
|
93
|
+
import { Button, Dialog, DialogTrigger, DialogContent } from "@stagewise/ui"
|
|
94
|
+
|
|
95
|
+
export function Example() {
|
|
96
|
+
return (
|
|
97
|
+
<Dialog>
|
|
98
|
+
<DialogTrigger asChild>
|
|
99
|
+
<Button variant="outline">Open</Button>
|
|
100
|
+
</DialogTrigger>
|
|
101
|
+
<DialogContent>Content</DialogContent>
|
|
102
|
+
</Dialog>
|
|
103
|
+
)
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Icons
|
|
108
|
+
|
|
109
|
+
Icons are available via the `@stagewise/ui/icons` subpath export:
|
|
110
|
+
|
|
111
|
+
```tsx
|
|
112
|
+
import { IconChevronDownFill18, IconXmarkFill18 } from "@stagewise/ui/icons"
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Components
|
|
116
|
+
|
|
117
|
+
All shadcn/ui components from the `base-nova` style are re-exported, including: accordion, alert, alert-dialog, aspect-ratio, avatar, badge, breadcrumb, bubble, button, button-group, calendar, card, carousel, chart, checkbox, collapsible, combobox, command, context-menu, dialog, direction, drawer, dropdown-menu, empty, field, hover-card, input, input-group, input-otp, item, kbd, label, marker, menubar, message, native-select, navigation-menu, pagination, popover, progress, questionnaire, radio-group, resizable, scroll-area, select, separator, sheet, sidebar, skeleton, slider, spinner, switch, table, tabs, textarea, toast, toggle, toggle-group, tooltip.
|
|
118
|
+
|
|
119
|
+
Also exports the `cn` utility and `useIsMobile` hook.
|
|
120
|
+
|
|
121
|
+
## License
|
|
122
|
+
|
|
123
|
+
The package code (components, plugin, styles, utilities) is licensed under
|
|
124
|
+
**MIT**.
|
|
125
|
+
|
|
126
|
+
This package bundles third-party assets under separate licenses:
|
|
127
|
+
|
|
128
|
+
| Asset | Directory | License |
|
|
129
|
+
|-------|-----------|---------|
|
|
130
|
+
| Geist Variable font | `src/fonts/` | SIL Open Font License 1.1 (`src/fonts/OFL.txt`) |
|
|
131
|
+
| Nucleo icons | `src/icons/nucleo/` | Proprietary — restricted to stagewise GmbH products (`src/icons/nucleo/LICENSE.md`) |
|
|
132
|
+
|
|
133
|
+
The Nucleo icons are **not open source**. They may only be used in products
|
|
134
|
+
owned by stagewise GmbH. If you are not building a stagewise product, you
|
|
135
|
+
must remove or replace the Nucleo icons before redistributing this package.
|
package/package.json
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@stagewise/ui",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Customized shadcn/ui components built on Base UI primitives, for use across stagewise projects.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT AND OFL-1.1",
|
|
7
|
+
"sideEffects": [
|
|
8
|
+
"**/*.css"
|
|
9
|
+
],
|
|
10
|
+
"files": [
|
|
11
|
+
"src",
|
|
12
|
+
"README.md"
|
|
13
|
+
],
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./src/index.ts",
|
|
17
|
+
"import": "./src/index.ts"
|
|
18
|
+
},
|
|
19
|
+
"./style.css": "./src/styles/index.css",
|
|
20
|
+
"./styles/*": "./src/styles/*",
|
|
21
|
+
"./fonts/*": "./src/fonts/*",
|
|
22
|
+
"./plugin": "./src/plugin/index.ts",
|
|
23
|
+
"./src": "./src",
|
|
24
|
+
"./src/*": "./src/*",
|
|
25
|
+
"./icons": "./src/icons/index.ts",
|
|
26
|
+
"./icons/*": "./src/icons/*"
|
|
27
|
+
},
|
|
28
|
+
"main": "./src/index.ts",
|
|
29
|
+
"module": "./src/index.ts",
|
|
30
|
+
"types": "./src/index.ts",
|
|
31
|
+
"scripts": {
|
|
32
|
+
"typecheck": "tsc --noEmit",
|
|
33
|
+
"clean": "rm -rf dist .turbo"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@base-ui/react": "^1.7.0",
|
|
37
|
+
"@shadcn/react": "^0.3.0",
|
|
38
|
+
"class-variance-authority": "^0.7.1",
|
|
39
|
+
"clsx": "^2.1.1",
|
|
40
|
+
"cmdk": "^1.1.1",
|
|
41
|
+
"embla-carousel-react": "^8.6.0",
|
|
42
|
+
"input-otp": "^1.4.2",
|
|
43
|
+
"react-day-picker": "^10.0.1",
|
|
44
|
+
"react-resizable-panels": "^4.12.2",
|
|
45
|
+
"recharts": "^3.8.0",
|
|
46
|
+
"tailwind-merge": "^3.6.0",
|
|
47
|
+
"tw-animate-css": "^1.3.0"
|
|
48
|
+
},
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
51
|
+
"react-dom": "^18.0.0 || ^19.0.0",
|
|
52
|
+
"tailwindcss": "^4.0.0"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@types/react": "^19.0.0",
|
|
56
|
+
"@types/react-dom": "^19.0.0",
|
|
57
|
+
"typescript": "^5.9.0"
|
|
58
|
+
},
|
|
59
|
+
"keywords": [
|
|
60
|
+
"react",
|
|
61
|
+
"components",
|
|
62
|
+
"ui",
|
|
63
|
+
"design-system"
|
|
64
|
+
],
|
|
65
|
+
"engines": {
|
|
66
|
+
"node": ">=22"
|
|
67
|
+
},
|
|
68
|
+
"publishConfig": {
|
|
69
|
+
"access": "public"
|
|
70
|
+
},
|
|
71
|
+
"repository": {
|
|
72
|
+
"type": "git",
|
|
73
|
+
"url": "https://github.com/stagewise-io/ui.git",
|
|
74
|
+
"directory": "packages/ui"
|
|
75
|
+
},
|
|
76
|
+
"bugs": {
|
|
77
|
+
"url": "https://github.com/stagewise-io/ui/issues"
|
|
78
|
+
},
|
|
79
|
+
"homepage": "https://github.com/stagewise-io/ui/tree/main/packages/ui"
|
|
80
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Accordion as AccordionPrimitive } from "@base-ui/react/accordion"
|
|
2
|
+
|
|
3
|
+
import { cn } from "../../lib/utils"
|
|
4
|
+
import { IconChevronDownOutline18 } from "../../icons"
|
|
5
|
+
|
|
6
|
+
function Accordion({ className, ...props }: AccordionPrimitive.Root.Props) {
|
|
7
|
+
return (
|
|
8
|
+
<AccordionPrimitive.Root
|
|
9
|
+
data-slot="accordion"
|
|
10
|
+
className={cn("flex w-full flex-col", className)}
|
|
11
|
+
{...props}
|
|
12
|
+
/>
|
|
13
|
+
)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function AccordionItem({ className, ...props }: AccordionPrimitive.Item.Props) {
|
|
17
|
+
return (
|
|
18
|
+
<AccordionPrimitive.Item
|
|
19
|
+
data-slot="accordion-item"
|
|
20
|
+
className={cn("not-last:border-b", className)}
|
|
21
|
+
{...props}
|
|
22
|
+
/>
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function AccordionTrigger({
|
|
27
|
+
className,
|
|
28
|
+
children,
|
|
29
|
+
...props
|
|
30
|
+
}: AccordionPrimitive.Trigger.Props) {
|
|
31
|
+
return (
|
|
32
|
+
<AccordionPrimitive.Header className="flex">
|
|
33
|
+
<AccordionPrimitive.Trigger
|
|
34
|
+
data-slot="accordion-trigger"
|
|
35
|
+
className={cn(
|
|
36
|
+
"flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&[aria-expanded=true]>svg]:rotate-180",
|
|
37
|
+
className
|
|
38
|
+
)}
|
|
39
|
+
{...props}
|
|
40
|
+
>
|
|
41
|
+
{children}
|
|
42
|
+
<IconChevronDownOutline18 className="pointer-events-none size-4 shrink-0 translate-y-0.5 text-muted-foreground transition-transform duration-200" />
|
|
43
|
+
</AccordionPrimitive.Trigger>
|
|
44
|
+
</AccordionPrimitive.Header>
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function AccordionContent({
|
|
49
|
+
className,
|
|
50
|
+
children,
|
|
51
|
+
...props
|
|
52
|
+
}: AccordionPrimitive.Panel.Props) {
|
|
53
|
+
return (
|
|
54
|
+
<AccordionPrimitive.Panel
|
|
55
|
+
data-slot="accordion-content"
|
|
56
|
+
className="overflow-hidden text-sm h-(--accordion-panel-height) transition-[height] duration-200 ease-out data-starting-style:h-0 data-ending-style:h-0"
|
|
57
|
+
{...props}
|
|
58
|
+
>
|
|
59
|
+
<div className={cn("pt-0 pb-4", className)}>
|
|
60
|
+
{children}
|
|
61
|
+
</div>
|
|
62
|
+
</AccordionPrimitive.Panel>
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { AlertDialog as AlertDialogPrimitive } from "@base-ui/react/alert-dialog"
|
|
3
|
+
|
|
4
|
+
import { cn } from "../../lib/utils"
|
|
5
|
+
import { Button } from "./button"
|
|
6
|
+
|
|
7
|
+
function AlertDialog({ ...props }: AlertDialogPrimitive.Root.Props) {
|
|
8
|
+
return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function AlertDialogTrigger({ ...props }: AlertDialogPrimitive.Trigger.Props) {
|
|
12
|
+
return (
|
|
13
|
+
<AlertDialogPrimitive.Trigger data-slot="alert-dialog-trigger" {...props} />
|
|
14
|
+
)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function AlertDialogPortal({ ...props }: AlertDialogPrimitive.Portal.Props) {
|
|
18
|
+
return (
|
|
19
|
+
<AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function AlertDialogOverlay({
|
|
24
|
+
className,
|
|
25
|
+
...props
|
|
26
|
+
}: AlertDialogPrimitive.Backdrop.Props) {
|
|
27
|
+
return (
|
|
28
|
+
<AlertDialogPrimitive.Backdrop
|
|
29
|
+
data-slot="alert-dialog-overlay"
|
|
30
|
+
className={cn(
|
|
31
|
+
"fixed inset-0 isolate z-50 bg-black/10 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",
|
|
32
|
+
className
|
|
33
|
+
)}
|
|
34
|
+
{...props}
|
|
35
|
+
/>
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function AlertDialogContent({
|
|
40
|
+
className,
|
|
41
|
+
size = "default",
|
|
42
|
+
...props
|
|
43
|
+
}: AlertDialogPrimitive.Popup.Props & {
|
|
44
|
+
size?: "default" | "sm"
|
|
45
|
+
}) {
|
|
46
|
+
return (
|
|
47
|
+
<AlertDialogPortal>
|
|
48
|
+
<AlertDialogOverlay />
|
|
49
|
+
<AlertDialogPrimitive.Popup
|
|
50
|
+
data-slot="alert-dialog-content"
|
|
51
|
+
data-size={size}
|
|
52
|
+
className={cn(
|
|
53
|
+
"group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm 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",
|
|
54
|
+
className
|
|
55
|
+
)}
|
|
56
|
+
{...props}
|
|
57
|
+
/>
|
|
58
|
+
</AlertDialogPortal>
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function AlertDialogHeader({
|
|
63
|
+
className,
|
|
64
|
+
...props
|
|
65
|
+
}: React.ComponentProps<"div">) {
|
|
66
|
+
return (
|
|
67
|
+
<div
|
|
68
|
+
data-slot="alert-dialog-header"
|
|
69
|
+
className={cn(
|
|
70
|
+
"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-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",
|
|
71
|
+
className
|
|
72
|
+
)}
|
|
73
|
+
{...props}
|
|
74
|
+
/>
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function AlertDialogFooter({
|
|
79
|
+
className,
|
|
80
|
+
...props
|
|
81
|
+
}: React.ComponentProps<"div">) {
|
|
82
|
+
return (
|
|
83
|
+
<div
|
|
84
|
+
data-slot="alert-dialog-footer"
|
|
85
|
+
className={cn(
|
|
86
|
+
"-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",
|
|
87
|
+
className
|
|
88
|
+
)}
|
|
89
|
+
{...props}
|
|
90
|
+
/>
|
|
91
|
+
)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function AlertDialogMedia({
|
|
95
|
+
className,
|
|
96
|
+
...props
|
|
97
|
+
}: React.ComponentProps<"div">) {
|
|
98
|
+
return (
|
|
99
|
+
<div
|
|
100
|
+
data-slot="alert-dialog-media"
|
|
101
|
+
className={cn(
|
|
102
|
+
"mb-2 inline-flex size-10 items-center justify-center rounded-md bg-muted sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-6",
|
|
103
|
+
className
|
|
104
|
+
)}
|
|
105
|
+
{...props}
|
|
106
|
+
/>
|
|
107
|
+
)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function AlertDialogTitle({
|
|
111
|
+
className,
|
|
112
|
+
...props
|
|
113
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {
|
|
114
|
+
return (
|
|
115
|
+
<AlertDialogPrimitive.Title
|
|
116
|
+
data-slot="alert-dialog-title"
|
|
117
|
+
className={cn(
|
|
118
|
+
"font-heading text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",
|
|
119
|
+
className
|
|
120
|
+
)}
|
|
121
|
+
{...props}
|
|
122
|
+
/>
|
|
123
|
+
)
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function AlertDialogDescription({
|
|
127
|
+
className,
|
|
128
|
+
...props
|
|
129
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {
|
|
130
|
+
return (
|
|
131
|
+
<AlertDialogPrimitive.Description
|
|
132
|
+
data-slot="alert-dialog-description"
|
|
133
|
+
className={cn(
|
|
134
|
+
"text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",
|
|
135
|
+
className
|
|
136
|
+
)}
|
|
137
|
+
{...props}
|
|
138
|
+
/>
|
|
139
|
+
)
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function AlertDialogAction({
|
|
143
|
+
className,
|
|
144
|
+
...props
|
|
145
|
+
}: React.ComponentProps<typeof Button>) {
|
|
146
|
+
return (
|
|
147
|
+
<Button
|
|
148
|
+
data-slot="alert-dialog-action"
|
|
149
|
+
className={cn(className)}
|
|
150
|
+
{...props}
|
|
151
|
+
/>
|
|
152
|
+
)
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function AlertDialogCancel({
|
|
156
|
+
className,
|
|
157
|
+
variant = "outline",
|
|
158
|
+
size = "default",
|
|
159
|
+
...props
|
|
160
|
+
}: AlertDialogPrimitive.Close.Props &
|
|
161
|
+
Pick<React.ComponentProps<typeof Button>, "variant" | "size">) {
|
|
162
|
+
return (
|
|
163
|
+
<AlertDialogPrimitive.Close
|
|
164
|
+
data-slot="alert-dialog-cancel"
|
|
165
|
+
className={cn(className)}
|
|
166
|
+
render={<Button variant={variant} size={size} />}
|
|
167
|
+
{...props}
|
|
168
|
+
/>
|
|
169
|
+
)
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export {
|
|
173
|
+
AlertDialog,
|
|
174
|
+
AlertDialogAction,
|
|
175
|
+
AlertDialogCancel,
|
|
176
|
+
AlertDialogContent,
|
|
177
|
+
AlertDialogDescription,
|
|
178
|
+
AlertDialogFooter,
|
|
179
|
+
AlertDialogHeader,
|
|
180
|
+
AlertDialogMedia,
|
|
181
|
+
AlertDialogOverlay,
|
|
182
|
+
AlertDialogPortal,
|
|
183
|
+
AlertDialogTitle,
|
|
184
|
+
AlertDialogTrigger,
|
|
185
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
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 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[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 top-2 right-2", className)}
|
|
71
|
+
{...props}
|
|
72
|
+
/>
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export { Alert, AlertTitle, AlertDescription, AlertAction }
|
|
@@ -0,0 +1,22 @@
|
|
|
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 }
|
|
@@ -0,0 +1,107 @@
|
|
|
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-derived-subtle 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 right-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
|
+
}
|