@gv-tech/design-system 2.5.0 → 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -1
- package/.agent/skills/dogfood-components/SKILL.md +0 -34
- package/.agent/skills/maintain-component/SKILL.md +0 -77
- package/.agent/workflows/native-playground.md +0 -93
- package/.github/CODEOWNERS +0 -2
- package/.github/CONTRIBUTING.md +0 -42
- package/.github/FUNDING.yml +0 -4
- package/.github/PULL_REQUEST_TEMPLATE/build.md +0 -5
- package/.github/PULL_REQUEST_TEMPLATE/standard.md +0 -3
- package/.github/RELEASING.md +0 -37
- package/.github/copilot-instructions.md +0 -61
- package/.github/workflows/ci.yml +0 -91
- package/.github/workflows/codeql-analysis.yml +0 -34
- package/.github/workflows/release-please.yml +0 -79
- package/.husky/pre-commit +0 -1
- package/.prettierignore +0 -3
- package/.release-please-manifest.json +0 -9
- package/.tool-versions +0 -1
- package/.vscode/launch.json +0 -22
- package/.vscode/mcp.json +0 -8
- package/.vscode/settings.json +0 -30
- package/.yarnrc.yml +0 -7
- package/CHANGELOG.md +0 -679
- package/SECURITY.md +0 -9
- package/apps/.gitkeep +0 -0
- package/apps/native-playground/CHANGELOG.md +0 -8
- package/apps/native-playground/app.json +0 -37
- package/apps/native-playground/assets/fonts/.gitkeep +0 -0
- package/apps/native-playground/assets/images/adaptive-icon.png +0 -0
- package/apps/native-playground/assets/images/favicon.png +0 -0
- package/apps/native-playground/assets/images/icon.png +0 -0
- package/apps/native-playground/assets/images/splash-icon.png +0 -0
- package/apps/native-playground/babel.config.js +0 -6
- package/apps/native-playground/eas.json +0 -25
- package/apps/native-playground/index.js +0 -8
- package/apps/native-playground/metro.config.js +0 -26
- package/apps/native-playground/nativewind-env.d.ts +0 -1
- package/apps/native-playground/package.json +0 -23
- package/apps/native-playground/project.json +0 -15
- package/apps/native-playground/src/app/App.tsx +0 -842
- package/apps/native-playground/src/global.css +0 -49
- package/apps/native-playground/tailwind.config.js +0 -49
- package/apps/native-playground/tsconfig.app.json +0 -24
- package/apps/native-playground/tsconfig.json +0 -23
- package/apps/native-playground/tsconfig.spec.json +0 -24
- package/apps/playground-web/CHANGELOG.md +0 -8
- package/apps/playground-web/index.html +0 -13
- package/apps/playground-web/package.json +0 -31
- package/apps/playground-web/public/favicon.png +0 -0
- package/apps/playground-web/public/index.demo.html +0 -40
- package/apps/playground-web/public/logo192.png +0 -0
- package/apps/playground-web/public/logo512.png +0 -0
- package/apps/playground-web/public/manifest.json +0 -25
- package/apps/playground-web/public/robots.txt +0 -2
- package/apps/playground-web/src/App.tsx +0 -179
- package/apps/playground-web/src/components/docs/CodeBlock.tsx +0 -34
- package/apps/playground-web/src/components/docs/CombinedDocsLayout.tsx +0 -103
- package/apps/playground-web/src/components/docs/ComponentShowcase.tsx +0 -96
- package/apps/playground-web/src/components/docs/ErrorBoundary.tsx +0 -55
- package/apps/playground-web/src/components/docs/Footer.tsx +0 -146
- package/apps/playground-web/src/components/docs/PropsTable.tsx +0 -43
- package/apps/playground-web/src/components/docs/Search.tsx +0 -75
- package/apps/playground-web/src/components/docs/Sidebar.tsx +0 -77
- package/apps/playground-web/src/components/docs/ThemeToggle.tsx +0 -19
- package/apps/playground-web/src/components/docs/index.ts +0 -9
- package/apps/playground-web/src/config/docs.ts +0 -293
- package/apps/playground-web/src/globals.css +0 -148
- package/apps/playground-web/src/hooks/useDocMetadata.ts +0 -34
- package/apps/playground-web/src/hooks/usePackageManager.tsx +0 -42
- package/apps/playground-web/src/lib/react-native-shim.js +0 -34
- package/apps/playground-web/src/main.tsx +0 -11
- package/apps/playground-web/src/pages/index.ts +0 -4
- package/apps/playground-web/src/pages/native/AccordionDocs.tsx +0 -85
- package/apps/playground-web/src/pages/native/AlertDialogDocs.tsx +0 -128
- package/apps/playground-web/src/pages/native/AlertDocs.tsx +0 -89
- package/apps/playground-web/src/pages/native/AspectRatioDocs.tsx +0 -52
- package/apps/playground-web/src/pages/native/AvatarDocs.tsx +0 -92
- package/apps/playground-web/src/pages/native/BadgeDocs.tsx +0 -63
- package/apps/playground-web/src/pages/native/BreadcrumbDocs.tsx +0 -71
- package/apps/playground-web/src/pages/native/ButtonDocs.tsx +0 -103
- package/apps/playground-web/src/pages/native/CalendarDocs.tsx +0 -74
- package/apps/playground-web/src/pages/native/CardDocs.tsx +0 -75
- package/apps/playground-web/src/pages/native/CarouselDocs.tsx +0 -113
- package/apps/playground-web/src/pages/native/ChartDocs.tsx +0 -115
- package/apps/playground-web/src/pages/native/CheckboxDocs.tsx +0 -38
- package/apps/playground-web/src/pages/native/CollapsibleDocs.tsx +0 -89
- package/apps/playground-web/src/pages/native/CommandDocs.tsx +0 -170
- package/apps/playground-web/src/pages/native/ContextMenuDocs.tsx +0 -121
- package/apps/playground-web/src/pages/native/DialogDocs.tsx +0 -132
- package/apps/playground-web/src/pages/native/DrawerDocs.tsx +0 -158
- package/apps/playground-web/src/pages/native/DropdownMenuDocs.tsx +0 -168
- package/apps/playground-web/src/pages/native/HoverCardDocs.tsx +0 -119
- package/apps/playground-web/src/pages/native/InputDocs.tsx +0 -86
- package/apps/playground-web/src/pages/native/LabelDocs.tsx +0 -55
- package/apps/playground-web/src/pages/native/MenubarDocs.tsx +0 -197
- package/apps/playground-web/src/pages/native/NavigationMenuDocs.tsx +0 -190
- package/apps/playground-web/src/pages/native/PaginationDocs.tsx +0 -70
- package/apps/playground-web/src/pages/native/PopoverDocs.tsx +0 -156
- package/apps/playground-web/src/pages/native/ProgressDocs.tsx +0 -61
- package/apps/playground-web/src/pages/native/RadioGroupDocs.tsx +0 -125
- package/apps/playground-web/src/pages/native/ResizableDocs.tsx +0 -118
- package/apps/playground-web/src/pages/native/ScrollAreaDocs.tsx +0 -92
- package/apps/playground-web/src/pages/native/SearchDocs.tsx +0 -150
- package/apps/playground-web/src/pages/native/SelectDocs.tsx +0 -141
- package/apps/playground-web/src/pages/native/SeparatorDocs.tsx +0 -72
- package/apps/playground-web/src/pages/native/SheetDocs.tsx +0 -140
- package/apps/playground-web/src/pages/native/SkeletonDocs.tsx +0 -44
- package/apps/playground-web/src/pages/native/SliderDocs.tsx +0 -118
- package/apps/playground-web/src/pages/native/SonnerDocs.tsx +0 -111
- package/apps/playground-web/src/pages/native/SwitchDocs.tsx +0 -87
- package/apps/playground-web/src/pages/native/TableDocs.tsx +0 -67
- package/apps/playground-web/src/pages/native/TabsDocs.tsx +0 -175
- package/apps/playground-web/src/pages/native/TextareaDocs.tsx +0 -61
- package/apps/playground-web/src/pages/native/ThemeToggleDocs.tsx +0 -288
- package/apps/playground-web/src/pages/native/ToastDocs.tsx +0 -124
- package/apps/playground-web/src/pages/native/ToggleDocs.tsx +0 -81
- package/apps/playground-web/src/pages/native/ToggleGroupDocs.tsx +0 -128
- package/apps/playground-web/src/pages/native/TooltipDocs.tsx +0 -140
- package/apps/playground-web/src/pages/native/index.ts +0 -47
- package/apps/playground-web/src/pages/shared/ColorTokensDocs.tsx +0 -234
- package/apps/playground-web/src/pages/shared/GettingStarted.tsx +0 -413
- package/apps/playground-web/src/pages/web/AccordionDocs.tsx +0 -194
- package/apps/playground-web/src/pages/web/AlertDialogDocs.tsx +0 -157
- package/apps/playground-web/src/pages/web/AlertDocs.tsx +0 -110
- package/apps/playground-web/src/pages/web/AspectRatioDocs.tsx +0 -94
- package/apps/playground-web/src/pages/web/AvatarDocs.tsx +0 -81
- package/apps/playground-web/src/pages/web/BadgeDocs.tsx +0 -66
- package/apps/playground-web/src/pages/web/BreadcrumbDocs.tsx +0 -93
- package/apps/playground-web/src/pages/web/ButtonDocs.tsx +0 -129
- package/apps/playground-web/src/pages/web/CalendarDocs.tsx +0 -78
- package/apps/playground-web/src/pages/web/CardDocs.tsx +0 -115
- package/apps/playground-web/src/pages/web/CarouselDocs.tsx +0 -176
- package/apps/playground-web/src/pages/web/ChartDocs.tsx +0 -151
- package/apps/playground-web/src/pages/web/CheckboxDocs.tsx +0 -95
- package/apps/playground-web/src/pages/web/CollapsibleDocs.tsx +0 -111
- package/apps/playground-web/src/pages/web/CommandDocs.tsx +0 -219
- package/apps/playground-web/src/pages/web/ContextMenuDocs.tsx +0 -164
- package/apps/playground-web/src/pages/web/DialogDocs.tsx +0 -175
- package/apps/playground-web/src/pages/web/DrawerDocs.tsx +0 -283
- package/apps/playground-web/src/pages/web/DropdownMenuDocs.tsx +0 -319
- package/apps/playground-web/src/pages/web/FormDocs.tsx +0 -175
- package/apps/playground-web/src/pages/web/HoverCardDocs.tsx +0 -151
- package/apps/playground-web/src/pages/web/InputDocs.tsx +0 -118
- package/apps/playground-web/src/pages/web/LabelDocs.tsx +0 -59
- package/apps/playground-web/src/pages/web/MenubarDocs.tsx +0 -296
- package/apps/playground-web/src/pages/web/NavigationMenuDocs.tsx +0 -263
- package/apps/playground-web/src/pages/web/PaginationDocs.tsx +0 -102
- package/apps/playground-web/src/pages/web/PopoverDocs.tsx +0 -189
- package/apps/playground-web/src/pages/web/ProgressDocs.tsx +0 -70
- package/apps/playground-web/src/pages/web/RadioGroupDocs.tsx +0 -137
- package/apps/playground-web/src/pages/web/ResizableDocs.tsx +0 -143
- package/apps/playground-web/src/pages/web/ScrollAreaDocs.tsx +0 -107
- package/apps/playground-web/src/pages/web/SearchDocs.tsx +0 -203
- package/apps/playground-web/src/pages/web/SelectDocs.tsx +0 -164
- package/apps/playground-web/src/pages/web/SeparatorDocs.tsx +0 -88
- package/apps/playground-web/src/pages/web/SheetDocs.tsx +0 -186
- package/apps/playground-web/src/pages/web/SkeletonDocs.tsx +0 -53
- package/apps/playground-web/src/pages/web/SliderDocs.tsx +0 -119
- package/apps/playground-web/src/pages/web/SonnerDocs.tsx +0 -126
- package/apps/playground-web/src/pages/web/SwitchDocs.tsx +0 -91
- package/apps/playground-web/src/pages/web/TableDocs.tsx +0 -148
- package/apps/playground-web/src/pages/web/TabsDocs.tsx +0 -241
- package/apps/playground-web/src/pages/web/TextareaDocs.tsx +0 -65
- package/apps/playground-web/src/pages/web/ThemeToggleDocs.tsx +0 -303
- package/apps/playground-web/src/pages/web/ToastDocs.tsx +0 -149
- package/apps/playground-web/src/pages/web/ToggleDocs.tsx +0 -85
- package/apps/playground-web/src/pages/web/ToggleGroupDocs.tsx +0 -140
- package/apps/playground-web/src/pages/web/TooltipDocs.tsx +0 -150
- package/apps/playground-web/src/pages/web/index.ts +0 -47
- package/apps/playground-web/src/routes/doc-routes.tsx +0 -363
- package/apps/playground-web/tailwind.config.js +0 -47
- package/apps/playground-web/tsconfig.app.json +0 -16
- package/apps/playground-web/tsconfig.json +0 -4
- package/apps/playground-web/tsconfig.node.json +0 -13
- package/apps/playground-web/vite.config.ts +0 -41
- package/components.json +0 -20
- package/docs/architecture-pivot.md +0 -165
- package/docs/native-setup-decision.md +0 -57
- package/docs/phase-1-tracker.md +0 -144
- package/docs/release-tooling-evaluation.md +0 -67
- package/docs/universal-implementation.md +0 -195
- package/docs/update-plan.md +0 -268
- package/eslint.config.mjs +0 -13
- package/nx.json +0 -50
- package/packages/.gitkeep +0 -0
- package/packages/design-tokens/CHANGELOG.md +0 -8
- package/packages/design-tokens/package.json +0 -20
- package/packages/design-tokens/src/index.ts +0 -35
- package/packages/design-tokens/src/palette.ts +0 -36
- package/packages/design-tokens/src/radii.ts +0 -26
- package/packages/design-tokens/src/shadows.ts +0 -16
- package/packages/design-tokens/src/spacing.ts +0 -33
- package/packages/design-tokens/src/theme.ts +0 -54
- package/packages/design-tokens/src/typography.ts +0 -36
- package/packages/design-tokens/tsconfig.json +0 -17
- package/packages/ui-core/CHANGELOG.md +0 -8
- package/packages/ui-core/package.json +0 -40
- package/packages/ui-core/src/contracts/accordion.ts +0 -23
- package/packages/ui-core/src/contracts/alert-dialog.ts +0 -48
- package/packages/ui-core/src/contracts/alert.ts +0 -17
- package/packages/ui-core/src/contracts/aspect-ratio.ts +0 -7
- package/packages/ui-core/src/contracts/avatar.ts +0 -17
- package/packages/ui-core/src/contracts/badge.ts +0 -7
- package/packages/ui-core/src/contracts/breadcrumb.ts +0 -37
- package/packages/ui-core/src/contracts/button.ts +0 -17
- package/packages/ui-core/src/contracts/calendar.ts +0 -4
- package/packages/ui-core/src/contracts/card.ts +0 -11
- package/packages/ui-core/src/contracts/carousel.ts +0 -29
- package/packages/ui-core/src/contracts/chart.ts +0 -31
- package/packages/ui-core/src/contracts/checkbox.ts +0 -11
- package/packages/ui-core/src/contracts/collapsible.ts +0 -21
- package/packages/ui-core/src/contracts/command.ts +0 -43
- package/packages/ui-core/src/contracts/context-menu.ts +0 -78
- package/packages/ui-core/src/contracts/dialog.ts +0 -29
- package/packages/ui-core/src/contracts/drawer.ts +0 -39
- package/packages/ui-core/src/contracts/dropdown-menu.ts +0 -87
- package/packages/ui-core/src/contracts/form.ts +0 -29
- package/packages/ui-core/src/contracts/hover-card.ts +0 -21
- package/packages/ui-core/src/contracts/input.ts +0 -11
- package/packages/ui-core/src/contracts/label.ts +0 -7
- package/packages/ui-core/src/contracts/menubar.ts +0 -86
- package/packages/ui-core/src/contracts/navigation-menu.ts +0 -55
- package/packages/ui-core/src/contracts/pagination.ts +0 -38
- package/packages/ui-core/src/contracts/popover.ts +0 -28
- package/packages/ui-core/src/contracts/progress.ts +0 -4
- package/packages/ui-core/src/contracts/radio.ts +0 -16
- package/packages/ui-core/src/contracts/resizable.ts +0 -36
- package/packages/ui-core/src/contracts/scroll-area.ts +0 -15
- package/packages/ui-core/src/contracts/search.ts +0 -13
- package/packages/ui-core/src/contracts/select.ts +0 -64
- package/packages/ui-core/src/contracts/separator.ts +0 -5
- package/packages/ui-core/src/contracts/sheet.ts +0 -58
- package/packages/ui-core/src/contracts/skeleton.ts +0 -6
- package/packages/ui-core/src/contracts/slider.ts +0 -15
- package/packages/ui-core/src/contracts/sonner.ts +0 -15
- package/packages/ui-core/src/contracts/switch.ts +0 -11
- package/packages/ui-core/src/contracts/table.ts +0 -41
- package/packages/ui-core/src/contracts/tabs.ts +0 -31
- package/packages/ui-core/src/contracts/text.ts +0 -12
- package/packages/ui-core/src/contracts/textarea.ts +0 -7
- package/packages/ui-core/src/contracts/theme-provider.ts +0 -14
- package/packages/ui-core/src/contracts/theme-toggle.ts +0 -15
- package/packages/ui-core/src/contracts/toast.ts +0 -15
- package/packages/ui-core/src/contracts/toaster.ts +0 -3
- package/packages/ui-core/src/contracts/toggle-group.ts +0 -23
- package/packages/ui-core/src/contracts/toggle.ts +0 -49
- package/packages/ui-core/src/contracts/tooltip.ts +0 -28
- package/packages/ui-core/src/index.ts +0 -327
- package/packages/ui-core/tsconfig.json +0 -18
- package/packages/ui-native/CHANGELOG.md +0 -8
- package/packages/ui-native/package.json +0 -76
- package/packages/ui-native/src/accordion.tsx +0 -93
- package/packages/ui-native/src/alert-dialog.tsx +0 -123
- package/packages/ui-native/src/alert.tsx +0 -50
- package/packages/ui-native/src/aspect-ratio.tsx +0 -9
- package/packages/ui-native/src/avatar.tsx +0 -38
- package/packages/ui-native/src/badge.tsx +0 -51
- package/packages/ui-native/src/breadcrumb.tsx +0 -9
- package/packages/ui-native/src/button.test.tsx +0 -27
- package/packages/ui-native/src/button.tsx +0 -75
- package/packages/ui-native/src/calendar.tsx +0 -9
- package/packages/ui-native/src/card.test.tsx +0 -33
- package/packages/ui-native/src/card.tsx +0 -56
- package/packages/ui-native/src/carousel.tsx +0 -9
- package/packages/ui-native/src/chart.tsx +0 -9
- package/packages/ui-native/src/checkbox.test.tsx +0 -58
- package/packages/ui-native/src/checkbox.tsx +0 -31
- package/packages/ui-native/src/collapsible.test.tsx +0 -50
- package/packages/ui-native/src/collapsible.tsx +0 -15
- package/packages/ui-native/src/command.tsx +0 -9
- package/packages/ui-native/src/context-menu.tsx +0 -9
- package/packages/ui-native/src/dialog.test.tsx +0 -91
- package/packages/ui-native/src/dialog.tsx +0 -121
- package/packages/ui-native/src/drawer.tsx +0 -9
- package/packages/ui-native/src/dropdown-menu.tsx +0 -9
- package/packages/ui-native/src/form.tsx +0 -9
- package/packages/ui-native/src/hover-card.tsx +0 -9
- package/packages/ui-native/src/index.ts +0 -209
- package/packages/ui-native/src/input.test.tsx +0 -27
- package/packages/ui-native/src/input.tsx +0 -27
- package/packages/ui-native/src/label.tsx +0 -29
- package/packages/ui-native/src/lib/render-native.tsx +0 -17
- package/packages/ui-native/src/lib/utils.ts +0 -6
- package/packages/ui-native/src/menubar.tsx +0 -9
- package/packages/ui-native/src/nativewind-env.d.ts +0 -1
- package/packages/ui-native/src/navigation-menu.tsx +0 -9
- package/packages/ui-native/src/pagination.tsx +0 -9
- package/packages/ui-native/src/popover.tsx +0 -9
- package/packages/ui-native/src/progress.tsx +0 -9
- package/packages/ui-native/src/radio-group.test.tsx +0 -77
- package/packages/ui-native/src/radio-group.tsx +0 -42
- package/packages/ui-native/src/resizable.tsx +0 -25
- package/packages/ui-native/src/scroll-area.tsx +0 -9
- package/packages/ui-native/src/search.tsx +0 -17
- package/packages/ui-native/src/select.tsx +0 -229
- package/packages/ui-native/src/separator.tsx +0 -20
- package/packages/ui-native/src/sheet.test.tsx +0 -93
- package/packages/ui-native/src/sheet.tsx +0 -127
- package/packages/ui-native/src/skeleton.test.tsx +0 -29
- package/packages/ui-native/src/skeleton.tsx +0 -31
- package/packages/ui-native/src/slider.tsx +0 -9
- package/packages/ui-native/src/sonner.tsx +0 -9
- package/packages/ui-native/src/switch.tsx +0 -34
- package/packages/ui-native/src/table.tsx +0 -73
- package/packages/ui-native/src/tabs.tsx +0 -74
- package/packages/ui-native/src/text.test.tsx +0 -24
- package/packages/ui-native/src/text.tsx +0 -43
- package/packages/ui-native/src/textarea.test.tsx +0 -27
- package/packages/ui-native/src/textarea.tsx +0 -29
- package/packages/ui-native/src/theme-provider.tsx +0 -6
- package/packages/ui-native/src/theme-toggle.tsx +0 -11
- package/packages/ui-native/src/toast.test.tsx +0 -61
- package/packages/ui-native/src/toast.tsx +0 -88
- package/packages/ui-native/src/toaster.tsx +0 -9
- package/packages/ui-native/src/toggle-group.tsx +0 -78
- package/packages/ui-native/src/toggle.tsx +0 -35
- package/packages/ui-native/src/tooltip.tsx +0 -44
- package/packages/ui-native/tsconfig.json +0 -23
- package/packages/ui-native/vite.config.ts +0 -17
- package/packages/ui-web/CHANGELOG.md +0 -8
- package/packages/ui-web/package.json +0 -84
- package/packages/ui-web/src/accordion.test.tsx +0 -86
- package/packages/ui-web/src/accordion.tsx +0 -58
- package/packages/ui-web/src/alert-dialog.test.tsx +0 -91
- package/packages/ui-web/src/alert-dialog.tsx +0 -121
- package/packages/ui-web/src/alert.test.tsx +0 -47
- package/packages/ui-web/src/alert.tsx +0 -49
- package/packages/ui-web/src/aspect-ratio.test.tsx +0 -34
- package/packages/ui-web/src/aspect-ratio.tsx +0 -7
- package/packages/ui-web/src/avatar.test.tsx +0 -33
- package/packages/ui-web/src/avatar.tsx +0 -40
- package/packages/ui-web/src/badge.test.tsx +0 -24
- package/packages/ui-web/src/badge.tsx +0 -34
- package/packages/ui-web/src/breadcrumb.tsx +0 -105
- package/packages/ui-web/src/button.test.tsx +0 -62
- package/packages/ui-web/src/button.tsx +0 -47
- package/packages/ui-web/src/calendar.test.tsx +0 -23
- package/packages/ui-web/src/calendar.tsx +0 -163
- package/packages/ui-web/src/card.test.tsx +0 -35
- package/packages/ui-web/src/card.tsx +0 -46
- package/packages/ui-web/src/carousel.test.tsx +0 -37
- package/packages/ui-web/src/carousel.tsx +0 -234
- package/packages/ui-web/src/chart.test.tsx +0 -62
- package/packages/ui-web/src/chart.tsx +0 -296
- package/packages/ui-web/src/checkbox.test.tsx +0 -30
- package/packages/ui-web/src/checkbox.tsx +0 -31
- package/packages/ui-web/src/collapsible.test.tsx +0 -51
- package/packages/ui-web/src/collapsible.tsx +0 -15
- package/packages/ui-web/src/command.test.tsx +0 -79
- package/packages/ui-web/src/command.tsx +0 -154
- package/packages/ui-web/src/context-menu.test.tsx +0 -37
- package/packages/ui-web/src/context-menu.tsx +0 -208
- package/packages/ui-web/src/dialog.test.tsx +0 -66
- package/packages/ui-web/src/dialog.tsx +0 -95
- package/packages/ui-web/src/drawer.test.tsx +0 -68
- package/packages/ui-web/src/drawer.tsx +0 -110
- package/packages/ui-web/src/dropdown-menu.test.tsx +0 -93
- package/packages/ui-web/src/dropdown-menu.tsx +0 -212
- package/packages/ui-web/src/form.test.tsx +0 -84
- package/packages/ui-web/src/form.tsx +0 -160
- package/packages/ui-web/src/hooks/use-theme.ts +0 -15
- package/packages/ui-web/src/hooks/use-toast.ts +0 -189
- package/packages/ui-web/src/hover-card.test.tsx +0 -48
- package/packages/ui-web/src/hover-card.tsx +0 -35
- package/packages/ui-web/src/index.ts +0 -474
- package/packages/ui-web/src/input.test.tsx +0 -33
- package/packages/ui-web/src/input.tsx +0 -23
- package/packages/ui-web/src/label.test.tsx +0 -27
- package/packages/ui-web/src/label.tsx +0 -21
- package/packages/ui-web/src/lib/utils.ts +0 -6
- package/packages/ui-web/src/menubar.test.tsx +0 -92
- package/packages/ui-web/src/menubar.tsx +0 -244
- package/packages/ui-web/src/navigation-menu.test.tsx +0 -53
- package/packages/ui-web/src/navigation-menu.tsx +0 -143
- package/packages/ui-web/src/pagination.test.tsx +0 -57
- package/packages/ui-web/src/pagination.tsx +0 -107
- package/packages/ui-web/src/popover.test.tsx +0 -31
- package/packages/ui-web/src/popover.tsx +0 -45
- package/packages/ui-web/src/progress.test.tsx +0 -18
- package/packages/ui-web/src/progress.tsx +0 -28
- package/packages/ui-web/src/radio-group.test.tsx +0 -39
- package/packages/ui-web/src/radio-group.tsx +0 -41
- package/packages/ui-web/src/resizable.test.tsx +0 -23
- package/packages/ui-web/src/resizable.tsx +0 -59
- package/packages/ui-web/src/scroll-area.test.tsx +0 -15
- package/packages/ui-web/src/scroll-area.tsx +0 -42
- package/packages/ui-web/src/search.test.tsx +0 -81
- package/packages/ui-web/src/search.tsx +0 -87
- package/packages/ui-web/src/select.test.tsx +0 -42
- package/packages/ui-web/src/select.tsx +0 -169
- package/packages/ui-web/src/separator.test.tsx +0 -16
- package/packages/ui-web/src/separator.tsx +0 -24
- package/packages/ui-web/src/setupTests.ts +0 -114
- package/packages/ui-web/src/sheet.test.tsx +0 -48
- package/packages/ui-web/src/sheet.tsx +0 -136
- package/packages/ui-web/src/skeleton.test.tsx +0 -13
- package/packages/ui-web/src/skeleton.tsx +0 -10
- package/packages/ui-web/src/slider.test.tsx +0 -18
- package/packages/ui-web/src/slider.tsx +0 -27
- package/packages/ui-web/src/sonner.test.tsx +0 -13
- package/packages/ui-web/src/sonner.tsx +0 -32
- package/packages/ui-web/src/switch.test.tsx +0 -22
- package/packages/ui-web/src/switch.tsx +0 -31
- package/packages/ui-web/src/table.test.tsx +0 -29
- package/packages/ui-web/src/table.tsx +0 -104
- package/packages/ui-web/src/tabs.test.tsx +0 -43
- package/packages/ui-web/src/tabs.tsx +0 -62
- package/packages/ui-web/src/text.test.tsx +0 -34
- package/packages/ui-web/src/text.tsx +0 -55
- package/packages/ui-web/src/textarea.test.tsx +0 -21
- package/packages/ui-web/src/textarea.tsx +0 -25
- package/packages/ui-web/src/theme-provider.tsx +0 -15
- package/packages/ui-web/src/theme-toggle.test.tsx +0 -49
- package/packages/ui-web/src/theme-toggle.tsx +0 -92
- package/packages/ui-web/src/toast.test.tsx +0 -42
- package/packages/ui-web/src/toast.tsx +0 -111
- package/packages/ui-web/src/toaster.tsx +0 -27
- package/packages/ui-web/src/toggle-group.test.tsx +0 -40
- package/packages/ui-web/src/toggle-group.tsx +0 -55
- package/packages/ui-web/src/toggle.test.tsx +0 -21
- package/packages/ui-web/src/toggle.tsx +0 -24
- package/packages/ui-web/src/tooltip.tsx +0 -51
- package/packages/ui-web/tsconfig.json +0 -24
- package/packages/ui-web/vite.config.ts +0 -21
- package/postcss.config.mjs +0 -5
- package/release-please-config.json +0 -60
- package/scripts/build-registry.ts +0 -80
- package/scripts/sync-tokens.ts +0 -86
- package/scripts/validate.ts +0 -74
- package/src/globals.css +0 -146
- package/src/index.ts +0 -4
- package/src/setupTests.ts +0 -47
- package/src/types/nativewind.d.ts +0 -19
- package/tailwind.config.js +0 -48
- package/tsconfig.build.json +0 -22
- package/tsconfig.json +0 -30
- package/tsconfig.node.json +0 -11
- package/vite.config.ts +0 -106
- package/vitest.config.ts +0 -23
- package/wrangler.toml +0 -22
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { render, screen } from '@testing-library/react';
|
|
2
|
-
import userEvent from '@testing-library/user-event';
|
|
3
|
-
import { describe, expect, it } from 'vitest';
|
|
4
|
-
import { ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuTrigger } from '.';
|
|
5
|
-
|
|
6
|
-
describe('ContextMenu', () => {
|
|
7
|
-
it('renders trigger', () => {
|
|
8
|
-
render(
|
|
9
|
-
<ContextMenu>
|
|
10
|
-
<ContextMenuTrigger>Right click here</ContextMenuTrigger>
|
|
11
|
-
<ContextMenuContent>
|
|
12
|
-
<ContextMenuItem>Item 1</ContextMenuItem>
|
|
13
|
-
</ContextMenuContent>
|
|
14
|
-
</ContextMenu>,
|
|
15
|
-
);
|
|
16
|
-
|
|
17
|
-
expect(screen.getByText('Right click here')).toBeInTheDocument();
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it('shows menu on right click', async () => {
|
|
21
|
-
const user = userEvent.setup();
|
|
22
|
-
render(
|
|
23
|
-
<ContextMenu>
|
|
24
|
-
<ContextMenuTrigger>Right click here</ContextMenuTrigger>
|
|
25
|
-
<ContextMenuContent>
|
|
26
|
-
<ContextMenuItem>Item 1</ContextMenuItem>
|
|
27
|
-
</ContextMenuContent>
|
|
28
|
-
</ContextMenu>,
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
const trigger = screen.getByText('Right click here');
|
|
32
|
-
await user.pointer({ keys: '[MouseRight]', target: trigger });
|
|
33
|
-
|
|
34
|
-
// Ensure item is visible. Radix UI ContextMenu might render it in a portal.
|
|
35
|
-
expect(screen.getByText('Item 1')).toBeVisible();
|
|
36
|
-
});
|
|
37
|
-
});
|
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
|
|
2
|
-
import { Check, ChevronRight, Circle } from 'lucide-react';
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
ContextMenuBaseProps,
|
|
7
|
-
ContextMenuCheckboxItemBaseProps,
|
|
8
|
-
ContextMenuContentBaseProps,
|
|
9
|
-
ContextMenuGroupBaseProps,
|
|
10
|
-
ContextMenuItemBaseProps,
|
|
11
|
-
ContextMenuLabelBaseProps,
|
|
12
|
-
ContextMenuRadioGroupBaseProps,
|
|
13
|
-
ContextMenuRadioItemBaseProps,
|
|
14
|
-
ContextMenuSeparatorBaseProps,
|
|
15
|
-
ContextMenuShortcutBaseProps,
|
|
16
|
-
ContextMenuSubBaseProps,
|
|
17
|
-
ContextMenuSubContentBaseProps,
|
|
18
|
-
ContextMenuSubTriggerBaseProps,
|
|
19
|
-
ContextMenuTriggerBaseProps,
|
|
20
|
-
} from '@gv-tech/ui-core';
|
|
21
|
-
import { cn } from './lib/utils';
|
|
22
|
-
|
|
23
|
-
const ContextMenu = ContextMenuPrimitive.Root;
|
|
24
|
-
|
|
25
|
-
const ContextMenuTrigger = ContextMenuPrimitive.Trigger;
|
|
26
|
-
|
|
27
|
-
const ContextMenuGroup = ContextMenuPrimitive.Group;
|
|
28
|
-
|
|
29
|
-
const ContextMenuPortal = ContextMenuPrimitive.Portal;
|
|
30
|
-
|
|
31
|
-
const ContextMenuSub = ContextMenuPrimitive.Sub;
|
|
32
|
-
|
|
33
|
-
const ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
|
|
34
|
-
|
|
35
|
-
const ContextMenuSubTrigger = React.forwardRef<
|
|
36
|
-
React.ElementRef<typeof ContextMenuPrimitive.SubTrigger>,
|
|
37
|
-
React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> & ContextMenuSubTriggerBaseProps
|
|
38
|
-
>(({ className, inset, children, ...props }, ref) => (
|
|
39
|
-
<ContextMenuPrimitive.SubTrigger
|
|
40
|
-
ref={ref}
|
|
41
|
-
className={cn(
|
|
42
|
-
'flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground',
|
|
43
|
-
inset && 'pl-8',
|
|
44
|
-
className,
|
|
45
|
-
)}
|
|
46
|
-
{...props}
|
|
47
|
-
>
|
|
48
|
-
{children}
|
|
49
|
-
<ChevronRight className="ml-auto h-4 w-4" />
|
|
50
|
-
</ContextMenuPrimitive.SubTrigger>
|
|
51
|
-
));
|
|
52
|
-
ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
|
|
53
|
-
|
|
54
|
-
const ContextMenuSubContent = React.forwardRef<
|
|
55
|
-
React.ElementRef<typeof ContextMenuPrimitive.SubContent>,
|
|
56
|
-
React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent> & ContextMenuSubContentBaseProps
|
|
57
|
-
>(({ className, ...props }, ref) => (
|
|
58
|
-
<ContextMenuPrimitive.SubContent
|
|
59
|
-
ref={ref}
|
|
60
|
-
className={cn(
|
|
61
|
-
'z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-context-menu-content-transform-origin]',
|
|
62
|
-
className,
|
|
63
|
-
)}
|
|
64
|
-
{...props}
|
|
65
|
-
/>
|
|
66
|
-
));
|
|
67
|
-
ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;
|
|
68
|
-
|
|
69
|
-
const ContextMenuContent = React.forwardRef<
|
|
70
|
-
React.ElementRef<typeof ContextMenuPrimitive.Content>,
|
|
71
|
-
React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content> & ContextMenuContentBaseProps
|
|
72
|
-
>(({ className, ...props }, ref) => (
|
|
73
|
-
<ContextMenuPrimitive.Portal>
|
|
74
|
-
<ContextMenuPrimitive.Content
|
|
75
|
-
ref={ref}
|
|
76
|
-
className={cn(
|
|
77
|
-
'z-50 max-h-[--radix-context-menu-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-context-menu-content-transform-origin]',
|
|
78
|
-
className,
|
|
79
|
-
)}
|
|
80
|
-
{...props}
|
|
81
|
-
/>
|
|
82
|
-
</ContextMenuPrimitive.Portal>
|
|
83
|
-
));
|
|
84
|
-
ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
|
|
85
|
-
|
|
86
|
-
const ContextMenuItem = React.forwardRef<
|
|
87
|
-
React.ElementRef<typeof ContextMenuPrimitive.Item>,
|
|
88
|
-
React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> & ContextMenuItemBaseProps
|
|
89
|
-
>(({ className, inset, ...props }, ref) => (
|
|
90
|
-
<ContextMenuPrimitive.Item
|
|
91
|
-
ref={ref}
|
|
92
|
-
className={cn(
|
|
93
|
-
'relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
|
|
94
|
-
inset && 'pl-8',
|
|
95
|
-
className,
|
|
96
|
-
)}
|
|
97
|
-
{...props}
|
|
98
|
-
/>
|
|
99
|
-
));
|
|
100
|
-
ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
|
|
101
|
-
|
|
102
|
-
const ContextMenuCheckboxItem = React.forwardRef<
|
|
103
|
-
React.ElementRef<typeof ContextMenuPrimitive.CheckboxItem>,
|
|
104
|
-
React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.CheckboxItem> & ContextMenuCheckboxItemBaseProps
|
|
105
|
-
>(({ className, children, checked, ...props }, ref) => (
|
|
106
|
-
<ContextMenuPrimitive.CheckboxItem
|
|
107
|
-
ref={ref}
|
|
108
|
-
className={cn(
|
|
109
|
-
'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
|
|
110
|
-
className,
|
|
111
|
-
)}
|
|
112
|
-
checked={checked}
|
|
113
|
-
{...props}
|
|
114
|
-
>
|
|
115
|
-
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
116
|
-
<ContextMenuPrimitive.ItemIndicator>
|
|
117
|
-
<Check className="h-4 w-4" />
|
|
118
|
-
</ContextMenuPrimitive.ItemIndicator>
|
|
119
|
-
</span>
|
|
120
|
-
{children}
|
|
121
|
-
</ContextMenuPrimitive.CheckboxItem>
|
|
122
|
-
));
|
|
123
|
-
ContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;
|
|
124
|
-
|
|
125
|
-
const ContextMenuRadioItem = React.forwardRef<
|
|
126
|
-
React.ElementRef<typeof ContextMenuPrimitive.RadioItem>,
|
|
127
|
-
React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioItem> & ContextMenuRadioItemBaseProps
|
|
128
|
-
>(({ className, children, ...props }, ref) => (
|
|
129
|
-
<ContextMenuPrimitive.RadioItem
|
|
130
|
-
ref={ref}
|
|
131
|
-
className={cn(
|
|
132
|
-
'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
|
|
133
|
-
className,
|
|
134
|
-
)}
|
|
135
|
-
{...props}
|
|
136
|
-
>
|
|
137
|
-
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
138
|
-
<ContextMenuPrimitive.ItemIndicator>
|
|
139
|
-
<Circle className="h-4 w-4 fill-current" />
|
|
140
|
-
</ContextMenuPrimitive.ItemIndicator>
|
|
141
|
-
</span>
|
|
142
|
-
{children}
|
|
143
|
-
</ContextMenuPrimitive.RadioItem>
|
|
144
|
-
));
|
|
145
|
-
ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;
|
|
146
|
-
|
|
147
|
-
const ContextMenuLabel = React.forwardRef<
|
|
148
|
-
React.ElementRef<typeof ContextMenuPrimitive.Label>,
|
|
149
|
-
React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Label> & ContextMenuLabelBaseProps
|
|
150
|
-
>(({ className, inset, ...props }, ref) => (
|
|
151
|
-
<ContextMenuPrimitive.Label
|
|
152
|
-
ref={ref}
|
|
153
|
-
className={cn('px-2 py-1.5 text-sm font-semibold text-foreground', inset && 'pl-8', className)}
|
|
154
|
-
{...props}
|
|
155
|
-
/>
|
|
156
|
-
));
|
|
157
|
-
ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;
|
|
158
|
-
|
|
159
|
-
const ContextMenuSeparator = React.forwardRef<
|
|
160
|
-
React.ElementRef<typeof ContextMenuPrimitive.Separator>,
|
|
161
|
-
React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator> & ContextMenuSeparatorBaseProps
|
|
162
|
-
>(({ className, ...props }, ref) => (
|
|
163
|
-
<ContextMenuPrimitive.Separator ref={ref} className={cn('-mx-1 my-1 h-px bg-border', className)} {...props} />
|
|
164
|
-
));
|
|
165
|
-
ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;
|
|
166
|
-
|
|
167
|
-
const ContextMenuShortcut = ({
|
|
168
|
-
className,
|
|
169
|
-
...props
|
|
170
|
-
}: React.HTMLAttributes<HTMLSpanElement> & ContextMenuShortcutBaseProps) => {
|
|
171
|
-
return <span className={cn('ml-auto text-xs tracking-widest text-muted-foreground', className)} {...props} />;
|
|
172
|
-
};
|
|
173
|
-
ContextMenuShortcut.displayName = 'ContextMenuShortcut';
|
|
174
|
-
|
|
175
|
-
export {
|
|
176
|
-
ContextMenu,
|
|
177
|
-
ContextMenuCheckboxItem,
|
|
178
|
-
ContextMenuContent,
|
|
179
|
-
ContextMenuGroup,
|
|
180
|
-
ContextMenuItem,
|
|
181
|
-
ContextMenuLabel,
|
|
182
|
-
ContextMenuPortal,
|
|
183
|
-
ContextMenuRadioGroup,
|
|
184
|
-
ContextMenuRadioItem,
|
|
185
|
-
ContextMenuSeparator,
|
|
186
|
-
ContextMenuShortcut,
|
|
187
|
-
ContextMenuSub,
|
|
188
|
-
ContextMenuSubContent,
|
|
189
|
-
ContextMenuSubTrigger,
|
|
190
|
-
ContextMenuTrigger,
|
|
191
|
-
};
|
|
192
|
-
|
|
193
|
-
export type {
|
|
194
|
-
ContextMenuCheckboxItemBaseProps as ContextMenuCheckboxItemProps,
|
|
195
|
-
ContextMenuContentBaseProps as ContextMenuContentProps,
|
|
196
|
-
ContextMenuGroupBaseProps as ContextMenuGroupProps,
|
|
197
|
-
ContextMenuItemBaseProps as ContextMenuItemProps,
|
|
198
|
-
ContextMenuLabelBaseProps as ContextMenuLabelProps,
|
|
199
|
-
ContextMenuBaseProps as ContextMenuProps,
|
|
200
|
-
ContextMenuRadioGroupBaseProps as ContextMenuRadioGroupProps,
|
|
201
|
-
ContextMenuRadioItemBaseProps as ContextMenuRadioItemProps,
|
|
202
|
-
ContextMenuSeparatorBaseProps as ContextMenuSeparatorProps,
|
|
203
|
-
ContextMenuShortcutBaseProps as ContextMenuShortcutProps,
|
|
204
|
-
ContextMenuSubContentBaseProps as ContextMenuSubContentProps,
|
|
205
|
-
ContextMenuSubBaseProps as ContextMenuSubProps,
|
|
206
|
-
ContextMenuSubTriggerBaseProps as ContextMenuSubTriggerProps,
|
|
207
|
-
ContextMenuTriggerBaseProps as ContextMenuTriggerProps,
|
|
208
|
-
};
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Dialog,
|
|
3
|
-
DialogClose,
|
|
4
|
-
DialogContent,
|
|
5
|
-
DialogDescription,
|
|
6
|
-
DialogFooter,
|
|
7
|
-
DialogHeader,
|
|
8
|
-
DialogTitle,
|
|
9
|
-
DialogTrigger,
|
|
10
|
-
} from '@gv-tech/ui-web';
|
|
11
|
-
import { render, screen } from '@testing-library/react';
|
|
12
|
-
import userEvent from '@testing-library/user-event';
|
|
13
|
-
import { describe, expect, it } from 'vitest';
|
|
14
|
-
|
|
15
|
-
describe('Dialog', () => {
|
|
16
|
-
it('renders trigger correctly', () => {
|
|
17
|
-
render(
|
|
18
|
-
<Dialog>
|
|
19
|
-
<DialogTrigger>Open Dialog</DialogTrigger>
|
|
20
|
-
<DialogContent>
|
|
21
|
-
<DialogHeader>
|
|
22
|
-
<DialogTitle>Title</DialogTitle>
|
|
23
|
-
<DialogDescription>Description</DialogDescription>
|
|
24
|
-
</DialogHeader>
|
|
25
|
-
</DialogContent>
|
|
26
|
-
</Dialog>,
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
expect(screen.getByText('Open Dialog')).toBeInTheDocument();
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
it('opens and closes the dialog', async () => {
|
|
33
|
-
const user = userEvent.setup();
|
|
34
|
-
render(
|
|
35
|
-
<Dialog>
|
|
36
|
-
<DialogTrigger>Open Dialog</DialogTrigger>
|
|
37
|
-
<DialogContent>
|
|
38
|
-
<DialogHeader>
|
|
39
|
-
<DialogTitle>Are you sure absolutely sure?</DialogTitle>
|
|
40
|
-
<DialogDescription>This action cannot be undone.</DialogDescription>
|
|
41
|
-
</DialogHeader>
|
|
42
|
-
<DialogFooter>
|
|
43
|
-
<DialogClose>Close Dialog</DialogClose>
|
|
44
|
-
</DialogFooter>
|
|
45
|
-
</DialogContent>
|
|
46
|
-
</Dialog>,
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
// Dialog content should not be visible initially (or not in document)
|
|
50
|
-
expect(screen.queryByText('Are you sure absolutely sure?')).not.toBeInTheDocument();
|
|
51
|
-
|
|
52
|
-
// Open dialog
|
|
53
|
-
await user.click(screen.getByText('Open Dialog'));
|
|
54
|
-
|
|
55
|
-
expect(screen.getByRole('dialog')).toBeInTheDocument();
|
|
56
|
-
expect(screen.getByText('Are you sure absolutely sure?')).toBeVisible();
|
|
57
|
-
|
|
58
|
-
// Close dialog
|
|
59
|
-
// We can use the close button we added
|
|
60
|
-
await user.click(screen.getByText('Close Dialog'));
|
|
61
|
-
|
|
62
|
-
// Should be closed
|
|
63
|
-
// Radix UI Dialog unmounts content when closed
|
|
64
|
-
expect(screen.queryByText('Are you sure absolutely sure?')).not.toBeInTheDocument();
|
|
65
|
-
});
|
|
66
|
-
});
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
2
|
-
import { X } from 'lucide-react';
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
|
|
5
|
-
import { cn } from './lib/utils';
|
|
6
|
-
|
|
7
|
-
const Dialog = DialogPrimitive.Root;
|
|
8
|
-
|
|
9
|
-
const DialogTrigger = DialogPrimitive.Trigger;
|
|
10
|
-
|
|
11
|
-
const DialogPortal = DialogPrimitive.Portal;
|
|
12
|
-
|
|
13
|
-
const DialogClose = DialogPrimitive.Close;
|
|
14
|
-
|
|
15
|
-
const DialogOverlay = React.forwardRef<
|
|
16
|
-
React.ElementRef<typeof DialogPrimitive.Overlay>,
|
|
17
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
|
|
18
|
-
>(({ className, ...props }, ref) => (
|
|
19
|
-
<DialogPrimitive.Overlay
|
|
20
|
-
ref={ref}
|
|
21
|
-
className={cn(
|
|
22
|
-
'fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
|
|
23
|
-
className,
|
|
24
|
-
)}
|
|
25
|
-
{...props}
|
|
26
|
-
/>
|
|
27
|
-
));
|
|
28
|
-
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
29
|
-
|
|
30
|
-
const DialogContent = React.forwardRef<
|
|
31
|
-
React.ElementRef<typeof DialogPrimitive.Content>,
|
|
32
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>
|
|
33
|
-
>(({ className, children, ...props }, ref) => (
|
|
34
|
-
<DialogPortal>
|
|
35
|
-
<DialogOverlay />
|
|
36
|
-
<DialogPrimitive.Content
|
|
37
|
-
ref={ref}
|
|
38
|
-
className={cn(
|
|
39
|
-
'fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg',
|
|
40
|
-
className,
|
|
41
|
-
)}
|
|
42
|
-
{...props}
|
|
43
|
-
>
|
|
44
|
-
{children}
|
|
45
|
-
<DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">
|
|
46
|
-
<X className="h-4 w-4" />
|
|
47
|
-
<span className="sr-only">Close</span>
|
|
48
|
-
</DialogPrimitive.Close>
|
|
49
|
-
</DialogPrimitive.Content>
|
|
50
|
-
</DialogPortal>
|
|
51
|
-
));
|
|
52
|
-
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
53
|
-
|
|
54
|
-
const DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
|
|
55
|
-
<div className={cn('flex flex-col space-y-1.5 text-center sm:text-left', className)} {...props} />
|
|
56
|
-
);
|
|
57
|
-
DialogHeader.displayName = 'DialogHeader';
|
|
58
|
-
|
|
59
|
-
const DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
|
|
60
|
-
<div className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)} {...props} />
|
|
61
|
-
);
|
|
62
|
-
DialogFooter.displayName = 'DialogFooter';
|
|
63
|
-
|
|
64
|
-
const DialogTitle = React.forwardRef<
|
|
65
|
-
React.ElementRef<typeof DialogPrimitive.Title>,
|
|
66
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
|
|
67
|
-
>(({ className, ...props }, ref) => (
|
|
68
|
-
<DialogPrimitive.Title
|
|
69
|
-
ref={ref}
|
|
70
|
-
className={cn('text-lg font-semibold leading-none tracking-tight', className)}
|
|
71
|
-
{...props}
|
|
72
|
-
/>
|
|
73
|
-
));
|
|
74
|
-
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
75
|
-
|
|
76
|
-
const DialogDescription = React.forwardRef<
|
|
77
|
-
React.ElementRef<typeof DialogPrimitive.Description>,
|
|
78
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
|
|
79
|
-
>(({ className, ...props }, ref) => (
|
|
80
|
-
<DialogPrimitive.Description ref={ref} className={cn('text-sm text-muted-foreground', className)} {...props} />
|
|
81
|
-
));
|
|
82
|
-
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
83
|
-
|
|
84
|
-
export {
|
|
85
|
-
Dialog,
|
|
86
|
-
DialogClose,
|
|
87
|
-
DialogContent,
|
|
88
|
-
DialogDescription,
|
|
89
|
-
DialogFooter,
|
|
90
|
-
DialogHeader,
|
|
91
|
-
DialogOverlay,
|
|
92
|
-
DialogPortal,
|
|
93
|
-
DialogTitle,
|
|
94
|
-
DialogTrigger,
|
|
95
|
-
};
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { render, screen } from '@testing-library/react';
|
|
2
|
-
import { describe, expect, it, vi } from 'vitest';
|
|
3
|
-
import {
|
|
4
|
-
Drawer,
|
|
5
|
-
DrawerClose,
|
|
6
|
-
DrawerContent,
|
|
7
|
-
DrawerDescription,
|
|
8
|
-
DrawerFooter,
|
|
9
|
-
DrawerHeader,
|
|
10
|
-
DrawerTitle,
|
|
11
|
-
DrawerTrigger,
|
|
12
|
-
} from '.';
|
|
13
|
-
|
|
14
|
-
// Mock drawer components to avoid jsdom issues with vaul
|
|
15
|
-
vi.mock('./drawer', () => {
|
|
16
|
-
return {
|
|
17
|
-
Drawer: ({ children }: { children: React.ReactNode }) => <div>{children}</div>,
|
|
18
|
-
DrawerTrigger: ({ children }: { children: React.ReactNode }) => <button>{children}</button>,
|
|
19
|
-
DrawerContent: ({ children }: { children: React.ReactNode }) => <div>{children}</div>,
|
|
20
|
-
DrawerHeader: ({ children }: { children: React.ReactNode }) => <div>{children}</div>,
|
|
21
|
-
DrawerTitle: ({ children }: { children: React.ReactNode }) => <h1>{children}</h1>,
|
|
22
|
-
DrawerDescription: ({ children }: { children: React.ReactNode }) => <p>{children}</p>,
|
|
23
|
-
DrawerFooter: ({ children }: { children: React.ReactNode }) => <footer>{children}</footer>,
|
|
24
|
-
DrawerClose: ({ children }: { children: React.ReactNode }) => <button>{children}</button>,
|
|
25
|
-
};
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
describe('Drawer', () => {
|
|
29
|
-
it('renders correctly', () => {
|
|
30
|
-
render(
|
|
31
|
-
<Drawer>
|
|
32
|
-
<DrawerTrigger>Open Drawer</DrawerTrigger>
|
|
33
|
-
<DrawerContent>
|
|
34
|
-
<DrawerHeader>
|
|
35
|
-
<DrawerTitle>Title</DrawerTitle>
|
|
36
|
-
<DrawerDescription>Description</DrawerDescription>
|
|
37
|
-
</DrawerHeader>
|
|
38
|
-
</DrawerContent>
|
|
39
|
-
</Drawer>,
|
|
40
|
-
);
|
|
41
|
-
|
|
42
|
-
expect(screen.getByText('Open Drawer')).toBeInTheDocument();
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
it('opens and closes the drawer', async () => {
|
|
46
|
-
// With mocked components, we just verify they render their children.
|
|
47
|
-
// Real interaction testing for vaul is best done in e2e tests.
|
|
48
|
-
render(
|
|
49
|
-
<Drawer>
|
|
50
|
-
<DrawerTrigger>Open Drawer</DrawerTrigger>
|
|
51
|
-
<DrawerContent>
|
|
52
|
-
<DrawerHeader>
|
|
53
|
-
<DrawerTitle>Drawer Title</DrawerTitle>
|
|
54
|
-
<DrawerDescription>Drawer Description</DrawerDescription>
|
|
55
|
-
</DrawerHeader>
|
|
56
|
-
<DrawerFooter>
|
|
57
|
-
<DrawerClose>Close</DrawerClose>
|
|
58
|
-
</DrawerFooter>
|
|
59
|
-
</DrawerContent>
|
|
60
|
-
</Drawer>,
|
|
61
|
-
);
|
|
62
|
-
|
|
63
|
-
expect(screen.getByText('Open Drawer')).toBeInTheDocument();
|
|
64
|
-
expect(screen.getByText('Drawer Title')).toBeInTheDocument();
|
|
65
|
-
expect(screen.getByText('Drawer Description')).toBeInTheDocument();
|
|
66
|
-
expect(screen.getByText('Close')).toBeInTheDocument();
|
|
67
|
-
});
|
|
68
|
-
});
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { Drawer as DrawerPrimitive } from 'vaul';
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
DrawerBaseProps,
|
|
8
|
-
DrawerCloseBaseProps,
|
|
9
|
-
DrawerContentBaseProps,
|
|
10
|
-
DrawerDescriptionBaseProps,
|
|
11
|
-
DrawerFooterBaseProps,
|
|
12
|
-
DrawerHeaderBaseProps,
|
|
13
|
-
DrawerTitleBaseProps,
|
|
14
|
-
DrawerTriggerBaseProps,
|
|
15
|
-
} from '@gv-tech/ui-core';
|
|
16
|
-
import { cn } from './lib/utils';
|
|
17
|
-
|
|
18
|
-
const Drawer = ({ shouldScaleBackground = true, ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>) => (
|
|
19
|
-
<DrawerPrimitive.Root shouldScaleBackground={shouldScaleBackground} {...props} />
|
|
20
|
-
);
|
|
21
|
-
Drawer.displayName = 'Drawer';
|
|
22
|
-
|
|
23
|
-
const DrawerTrigger = DrawerPrimitive.Trigger;
|
|
24
|
-
|
|
25
|
-
const DrawerPortal = DrawerPrimitive.Portal;
|
|
26
|
-
|
|
27
|
-
const DrawerClose = DrawerPrimitive.Close;
|
|
28
|
-
|
|
29
|
-
const DrawerOverlay = React.forwardRef<
|
|
30
|
-
React.ElementRef<typeof DrawerPrimitive.Overlay>,
|
|
31
|
-
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>
|
|
32
|
-
>(({ className, ...props }, ref) => (
|
|
33
|
-
<DrawerPrimitive.Overlay ref={ref} className={cn('fixed inset-0 z-50 bg-black/80', className)} {...props} />
|
|
34
|
-
));
|
|
35
|
-
DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;
|
|
36
|
-
|
|
37
|
-
const DrawerContent = React.forwardRef<
|
|
38
|
-
React.ElementRef<typeof DrawerPrimitive.Content>,
|
|
39
|
-
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content> & DrawerContentBaseProps
|
|
40
|
-
>(({ className, children, ...props }, ref) => (
|
|
41
|
-
<DrawerPortal>
|
|
42
|
-
<DrawerOverlay />
|
|
43
|
-
<DrawerPrimitive.Content
|
|
44
|
-
ref={ref}
|
|
45
|
-
className={cn(
|
|
46
|
-
'fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background',
|
|
47
|
-
className,
|
|
48
|
-
)}
|
|
49
|
-
{...props}
|
|
50
|
-
>
|
|
51
|
-
<div className="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" />
|
|
52
|
-
{children}
|
|
53
|
-
</DrawerPrimitive.Content>
|
|
54
|
-
</DrawerPortal>
|
|
55
|
-
));
|
|
56
|
-
DrawerContent.displayName = 'DrawerContent';
|
|
57
|
-
|
|
58
|
-
const DrawerHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement> & DrawerHeaderBaseProps) => (
|
|
59
|
-
<div className={cn('grid gap-1.5 p-4 text-center sm:text-left', className)} {...props} />
|
|
60
|
-
);
|
|
61
|
-
DrawerHeader.displayName = 'DrawerHeader';
|
|
62
|
-
|
|
63
|
-
const DrawerFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement> & DrawerFooterBaseProps) => (
|
|
64
|
-
<div className={cn('mt-auto flex flex-col gap-2 p-4', className)} {...props} />
|
|
65
|
-
);
|
|
66
|
-
DrawerFooter.displayName = 'DrawerFooter';
|
|
67
|
-
|
|
68
|
-
const DrawerTitle = React.forwardRef<
|
|
69
|
-
React.ElementRef<typeof DrawerPrimitive.Title>,
|
|
70
|
-
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title> & DrawerTitleBaseProps
|
|
71
|
-
>(({ className, ...props }, ref) => (
|
|
72
|
-
<DrawerPrimitive.Title
|
|
73
|
-
ref={ref}
|
|
74
|
-
className={cn('text-lg font-semibold leading-none tracking-tight', className)}
|
|
75
|
-
{...props}
|
|
76
|
-
/>
|
|
77
|
-
));
|
|
78
|
-
DrawerTitle.displayName = DrawerPrimitive.Title.displayName;
|
|
79
|
-
|
|
80
|
-
const DrawerDescription = React.forwardRef<
|
|
81
|
-
React.ElementRef<typeof DrawerPrimitive.Description>,
|
|
82
|
-
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description> & DrawerDescriptionBaseProps
|
|
83
|
-
>(({ className, ...props }, ref) => (
|
|
84
|
-
<DrawerPrimitive.Description ref={ref} className={cn('text-sm text-muted-foreground', className)} {...props} />
|
|
85
|
-
));
|
|
86
|
-
DrawerDescription.displayName = DrawerPrimitive.Description.displayName;
|
|
87
|
-
|
|
88
|
-
export {
|
|
89
|
-
Drawer,
|
|
90
|
-
DrawerClose,
|
|
91
|
-
DrawerContent,
|
|
92
|
-
DrawerDescription,
|
|
93
|
-
DrawerFooter,
|
|
94
|
-
DrawerHeader,
|
|
95
|
-
DrawerOverlay,
|
|
96
|
-
DrawerPortal,
|
|
97
|
-
DrawerTitle,
|
|
98
|
-
DrawerTrigger,
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
export type {
|
|
102
|
-
DrawerCloseBaseProps as DrawerCloseProps,
|
|
103
|
-
DrawerContentBaseProps as DrawerContentProps,
|
|
104
|
-
DrawerDescriptionBaseProps as DrawerDescriptionProps,
|
|
105
|
-
DrawerFooterBaseProps as DrawerFooterProps,
|
|
106
|
-
DrawerHeaderBaseProps as DrawerHeaderProps,
|
|
107
|
-
DrawerBaseProps as DrawerProps,
|
|
108
|
-
DrawerTitleBaseProps as DrawerTitleProps,
|
|
109
|
-
DrawerTriggerBaseProps as DrawerTriggerProps,
|
|
110
|
-
};
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { render, screen } from '@testing-library/react';
|
|
2
|
-
import userEvent from '@testing-library/user-event';
|
|
3
|
-
import { describe, expect, it } from 'vitest';
|
|
4
|
-
import {
|
|
5
|
-
DropdownMenu,
|
|
6
|
-
DropdownMenuCheckboxItem,
|
|
7
|
-
DropdownMenuContent,
|
|
8
|
-
DropdownMenuItem,
|
|
9
|
-
DropdownMenuLabel,
|
|
10
|
-
DropdownMenuRadioGroup,
|
|
11
|
-
DropdownMenuRadioItem,
|
|
12
|
-
DropdownMenuSeparator,
|
|
13
|
-
DropdownMenuTrigger,
|
|
14
|
-
} from '.';
|
|
15
|
-
|
|
16
|
-
describe('DropdownMenu', () => {
|
|
17
|
-
it('renders trigger correctly', () => {
|
|
18
|
-
render(
|
|
19
|
-
<DropdownMenu>
|
|
20
|
-
<DropdownMenuTrigger>Open Menu</DropdownMenuTrigger>
|
|
21
|
-
<DropdownMenuContent>
|
|
22
|
-
<DropdownMenuItem>Item 1</DropdownMenuItem>
|
|
23
|
-
</DropdownMenuContent>
|
|
24
|
-
</DropdownMenu>,
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
expect(screen.getByText('Open Menu')).toBeInTheDocument();
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
it('opens menu on click', async () => {
|
|
31
|
-
const user = userEvent.setup();
|
|
32
|
-
render(
|
|
33
|
-
<DropdownMenu>
|
|
34
|
-
<DropdownMenuTrigger>Open Menu</DropdownMenuTrigger>
|
|
35
|
-
<DropdownMenuContent>
|
|
36
|
-
<DropdownMenuLabel>My Account</DropdownMenuLabel>
|
|
37
|
-
<DropdownMenuSeparator />
|
|
38
|
-
<DropdownMenuItem>Profile</DropdownMenuItem>
|
|
39
|
-
<DropdownMenuItem>Billing</DropdownMenuItem>
|
|
40
|
-
</DropdownMenuContent>
|
|
41
|
-
</DropdownMenu>,
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
await user.click(screen.getByText('Open Menu'));
|
|
45
|
-
|
|
46
|
-
expect(screen.getByText('My Account')).toBeVisible();
|
|
47
|
-
expect(screen.getByText('Profile')).toBeVisible();
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
it('handles checkbox items', async () => {
|
|
51
|
-
const user = userEvent.setup();
|
|
52
|
-
render(
|
|
53
|
-
<DropdownMenu>
|
|
54
|
-
<DropdownMenuTrigger>Open</DropdownMenuTrigger>
|
|
55
|
-
<DropdownMenuContent>
|
|
56
|
-
<DropdownMenuCheckboxItem checked>Checked Item</DropdownMenuCheckboxItem>
|
|
57
|
-
<DropdownMenuCheckboxItem checked={false}>Unchecked Item</DropdownMenuCheckboxItem>
|
|
58
|
-
</DropdownMenuContent>
|
|
59
|
-
</DropdownMenu>,
|
|
60
|
-
);
|
|
61
|
-
|
|
62
|
-
await user.click(screen.getByText('Open'));
|
|
63
|
-
|
|
64
|
-
const checkedItem = screen.getByText('Checked Item');
|
|
65
|
-
// const uncheckedItem = screen.getByText('Unchecked Item');
|
|
66
|
-
|
|
67
|
-
expect(checkedItem).toBeVisible();
|
|
68
|
-
// Radix UI adds data-state="checked" or similar.
|
|
69
|
-
// But testing-library's toBeChecked() works on roles like 'checkbox' or 'menuitemcheckbox'
|
|
70
|
-
expect(screen.getByRole('menuitemcheckbox', { name: 'Checked Item' })).toBeChecked();
|
|
71
|
-
expect(screen.getByRole('menuitemcheckbox', { name: 'Unchecked Item' })).not.toBeChecked();
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
it('handles radio items', async () => {
|
|
75
|
-
const user = userEvent.setup();
|
|
76
|
-
render(
|
|
77
|
-
<DropdownMenu>
|
|
78
|
-
<DropdownMenuTrigger>Open</DropdownMenuTrigger>
|
|
79
|
-
<DropdownMenuContent>
|
|
80
|
-
<DropdownMenuRadioGroup value="top">
|
|
81
|
-
<DropdownMenuRadioItem value="top">Top</DropdownMenuRadioItem>
|
|
82
|
-
<DropdownMenuRadioItem value="bottom">Bottom</DropdownMenuRadioItem>
|
|
83
|
-
</DropdownMenuRadioGroup>
|
|
84
|
-
</DropdownMenuContent>
|
|
85
|
-
</DropdownMenu>,
|
|
86
|
-
);
|
|
87
|
-
|
|
88
|
-
await user.click(screen.getByText('Open'));
|
|
89
|
-
|
|
90
|
-
expect(screen.getByRole('menuitemradio', { name: 'Top' })).toBeChecked();
|
|
91
|
-
expect(screen.getByRole('menuitemradio', { name: 'Bottom' })).not.toBeChecked();
|
|
92
|
-
});
|
|
93
|
-
});
|