@gv-tech/design-system 2.5.0 → 2.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/package.json +5 -2
- 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/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,296 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as RechartsPrimitive from 'recharts';
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
ChartConfig,
|
|
6
|
-
ChartContainerBaseProps,
|
|
7
|
-
ChartLegendContentBaseProps,
|
|
8
|
-
ChartTooltipContentBaseProps,
|
|
9
|
-
} from '@gv-tech/ui-core';
|
|
10
|
-
import { cn } from './lib/utils';
|
|
11
|
-
|
|
12
|
-
// Format: { THEME_NAME: CSS_SELECTOR }
|
|
13
|
-
const THEMES = { light: '', dark: '.dark' } as const;
|
|
14
|
-
|
|
15
|
-
type ChartContextProps = {
|
|
16
|
-
config: ChartConfig;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const ChartContext = React.createContext<ChartContextProps | null>(null);
|
|
20
|
-
|
|
21
|
-
function useChart() {
|
|
22
|
-
const context = React.useContext(ChartContext);
|
|
23
|
-
|
|
24
|
-
if (!context) {
|
|
25
|
-
throw new Error('useChart must be used within a <ChartContainer />');
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return context;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const ChartContainer = React.forwardRef<
|
|
32
|
-
HTMLDivElement,
|
|
33
|
-
React.ComponentProps<'div'> &
|
|
34
|
-
ChartContainerBaseProps & {
|
|
35
|
-
children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children'];
|
|
36
|
-
}
|
|
37
|
-
>(({ id, className, children, config, ...props }, ref) => {
|
|
38
|
-
const uniqueId = React.useId();
|
|
39
|
-
const chartId = `chart-${id || uniqueId.replace(/:/g, '')}`;
|
|
40
|
-
|
|
41
|
-
return (
|
|
42
|
-
<ChartContext.Provider value={{ config }}>
|
|
43
|
-
<div
|
|
44
|
-
data-chart={chartId}
|
|
45
|
-
ref={ref}
|
|
46
|
-
className={cn(
|
|
47
|
-
"flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",
|
|
48
|
-
className,
|
|
49
|
-
)}
|
|
50
|
-
{...props}
|
|
51
|
-
>
|
|
52
|
-
<ChartStyle id={chartId} config={config} />
|
|
53
|
-
<RechartsPrimitive.ResponsiveContainer>{children}</RechartsPrimitive.ResponsiveContainer>
|
|
54
|
-
</div>
|
|
55
|
-
</ChartContext.Provider>
|
|
56
|
-
);
|
|
57
|
-
});
|
|
58
|
-
ChartContainer.displayName = 'Chart';
|
|
59
|
-
|
|
60
|
-
const ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {
|
|
61
|
-
const colorConfig = Object.entries(config).filter(([, itemConfig]) => itemConfig.theme || itemConfig.color);
|
|
62
|
-
|
|
63
|
-
if (!colorConfig.length) {
|
|
64
|
-
return null;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return (
|
|
68
|
-
<style
|
|
69
|
-
dangerouslySetInnerHTML={{
|
|
70
|
-
__html: Object.entries(THEMES)
|
|
71
|
-
.map(
|
|
72
|
-
([theme, prefix]) => `
|
|
73
|
-
${prefix} [data-chart=${id}] {
|
|
74
|
-
${colorConfig
|
|
75
|
-
.map(([key, itemConfig]) => {
|
|
76
|
-
const color = itemConfig.theme?.[theme as keyof typeof THEMES] || itemConfig.color;
|
|
77
|
-
return color ? ` --color-${key}: ${color};` : null;
|
|
78
|
-
})
|
|
79
|
-
.join('\n')}
|
|
80
|
-
}
|
|
81
|
-
`,
|
|
82
|
-
)
|
|
83
|
-
.join('\n'),
|
|
84
|
-
}}
|
|
85
|
-
/>
|
|
86
|
-
);
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
const ChartTooltip = RechartsPrimitive.Tooltip;
|
|
90
|
-
|
|
91
|
-
const ChartTooltipContent = React.forwardRef<
|
|
92
|
-
HTMLDivElement,
|
|
93
|
-
React.ComponentProps<typeof RechartsPrimitive.Tooltip> & React.ComponentProps<'div'> & ChartTooltipContentBaseProps
|
|
94
|
-
>(
|
|
95
|
-
(
|
|
96
|
-
{
|
|
97
|
-
active,
|
|
98
|
-
payload,
|
|
99
|
-
className,
|
|
100
|
-
indicator = 'dot',
|
|
101
|
-
hideLabel = false,
|
|
102
|
-
hideIndicator = false,
|
|
103
|
-
label,
|
|
104
|
-
labelFormatter,
|
|
105
|
-
labelClassName,
|
|
106
|
-
formatter,
|
|
107
|
-
color,
|
|
108
|
-
nameKey,
|
|
109
|
-
labelKey,
|
|
110
|
-
},
|
|
111
|
-
ref,
|
|
112
|
-
) => {
|
|
113
|
-
const { config } = useChart();
|
|
114
|
-
|
|
115
|
-
const tooltipLabel = React.useMemo(() => {
|
|
116
|
-
if (hideLabel || !payload?.length) {
|
|
117
|
-
return null;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
const [item] = payload;
|
|
121
|
-
const key = `${labelKey || item?.dataKey || item?.name || 'value'}`;
|
|
122
|
-
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
123
|
-
const value =
|
|
124
|
-
!labelKey && typeof label === 'string'
|
|
125
|
-
? config[label as keyof typeof config]?.label || label
|
|
126
|
-
: itemConfig?.label;
|
|
127
|
-
|
|
128
|
-
if (labelFormatter) {
|
|
129
|
-
return <div className={cn('font-medium', labelClassName)}>{labelFormatter(value, payload)}</div>;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
if (!value) {
|
|
133
|
-
return null;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
return <div className={cn('font-medium', labelClassName)}>{value}</div>;
|
|
137
|
-
}, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey]);
|
|
138
|
-
|
|
139
|
-
if (!active || !payload?.length) {
|
|
140
|
-
return null;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
const nestLabel = payload.length === 1 && indicator !== 'dot';
|
|
144
|
-
|
|
145
|
-
return (
|
|
146
|
-
<div
|
|
147
|
-
ref={ref}
|
|
148
|
-
className={cn(
|
|
149
|
-
'grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl',
|
|
150
|
-
className,
|
|
151
|
-
)}
|
|
152
|
-
>
|
|
153
|
-
{!nestLabel ? tooltipLabel : null}
|
|
154
|
-
<div className="grid gap-1.5">
|
|
155
|
-
{payload
|
|
156
|
-
.filter((item) => item.type !== 'none')
|
|
157
|
-
.map((item, index) => {
|
|
158
|
-
const key = `${nameKey || item.name || item.dataKey || 'value'}`;
|
|
159
|
-
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
160
|
-
const indicatorColor = color || ((item.payload as Record<string, unknown>).fill as string) || item.color;
|
|
161
|
-
|
|
162
|
-
return (
|
|
163
|
-
<div
|
|
164
|
-
key={item.dataKey}
|
|
165
|
-
className={cn(
|
|
166
|
-
'flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground',
|
|
167
|
-
indicator === 'dot' && 'items-center',
|
|
168
|
-
)}
|
|
169
|
-
>
|
|
170
|
-
{formatter && item?.value !== undefined && item.name ? (
|
|
171
|
-
formatter(item.value, item.name, item, index, item.payload)
|
|
172
|
-
) : (
|
|
173
|
-
<>
|
|
174
|
-
{itemConfig?.icon ? (
|
|
175
|
-
<itemConfig.icon />
|
|
176
|
-
) : (
|
|
177
|
-
!hideIndicator && (
|
|
178
|
-
<div
|
|
179
|
-
className={cn('shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]', {
|
|
180
|
-
'h-2.5 w-2.5': indicator === 'dot',
|
|
181
|
-
'w-1': indicator === 'line',
|
|
182
|
-
'w-0 border-[1.5px] border-dashed bg-transparent': indicator === 'dashed',
|
|
183
|
-
'my-0.5': nestLabel && indicator === 'dashed',
|
|
184
|
-
})}
|
|
185
|
-
style={
|
|
186
|
-
{
|
|
187
|
-
'--color-bg': indicatorColor,
|
|
188
|
-
'--color-border': indicatorColor,
|
|
189
|
-
} as React.CSSProperties
|
|
190
|
-
}
|
|
191
|
-
/>
|
|
192
|
-
)
|
|
193
|
-
)}
|
|
194
|
-
<div
|
|
195
|
-
className={cn(
|
|
196
|
-
'flex flex-1 justify-between leading-none',
|
|
197
|
-
nestLabel ? 'items-end' : 'items-center',
|
|
198
|
-
)}
|
|
199
|
-
>
|
|
200
|
-
<div className="grid gap-1.5">
|
|
201
|
-
{nestLabel ? tooltipLabel : null}
|
|
202
|
-
<span className="text-muted-foreground">{itemConfig?.label || item.name}</span>
|
|
203
|
-
</div>
|
|
204
|
-
{item.value && (
|
|
205
|
-
<span className="font-mono font-medium tabular-nums text-foreground">
|
|
206
|
-
{item.value.toLocaleString()}
|
|
207
|
-
</span>
|
|
208
|
-
)}
|
|
209
|
-
</div>
|
|
210
|
-
</>
|
|
211
|
-
)}
|
|
212
|
-
</div>
|
|
213
|
-
);
|
|
214
|
-
})}
|
|
215
|
-
</div>
|
|
216
|
-
</div>
|
|
217
|
-
);
|
|
218
|
-
},
|
|
219
|
-
);
|
|
220
|
-
ChartTooltipContent.displayName = 'ChartTooltip';
|
|
221
|
-
|
|
222
|
-
const ChartLegend = RechartsPrimitive.Legend;
|
|
223
|
-
|
|
224
|
-
const ChartLegendContent = React.forwardRef<
|
|
225
|
-
HTMLDivElement,
|
|
226
|
-
React.ComponentProps<'div'> &
|
|
227
|
-
Pick<RechartsPrimitive.LegendProps, 'payload' | 'verticalAlign'> &
|
|
228
|
-
ChartLegendContentBaseProps
|
|
229
|
-
>(({ className, hideIcon = false, payload, verticalAlign = 'bottom', nameKey }, ref) => {
|
|
230
|
-
const { config } = useChart();
|
|
231
|
-
|
|
232
|
-
if (!payload?.length) {
|
|
233
|
-
return null;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
return (
|
|
237
|
-
<div
|
|
238
|
-
ref={ref}
|
|
239
|
-
className={cn('flex items-center justify-center gap-4', verticalAlign === 'top' ? 'pb-3' : 'pt-3', className)}
|
|
240
|
-
>
|
|
241
|
-
{payload
|
|
242
|
-
.filter((item) => item.type !== 'none')
|
|
243
|
-
.map((item) => {
|
|
244
|
-
const key = `${nameKey || item.dataKey || 'value'}`;
|
|
245
|
-
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
246
|
-
|
|
247
|
-
return (
|
|
248
|
-
<div
|
|
249
|
-
key={item.value}
|
|
250
|
-
className={cn('flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground')}
|
|
251
|
-
>
|
|
252
|
-
{itemConfig?.icon && !hideIcon ? (
|
|
253
|
-
<itemConfig.icon />
|
|
254
|
-
) : (
|
|
255
|
-
<div
|
|
256
|
-
className="h-2 w-2 shrink-0 rounded-[2px]"
|
|
257
|
-
style={{
|
|
258
|
-
backgroundColor: item.color,
|
|
259
|
-
}}
|
|
260
|
-
/>
|
|
261
|
-
)}
|
|
262
|
-
{itemConfig?.label}
|
|
263
|
-
</div>
|
|
264
|
-
);
|
|
265
|
-
})}
|
|
266
|
-
</div>
|
|
267
|
-
);
|
|
268
|
-
});
|
|
269
|
-
ChartLegendContent.displayName = 'ChartLegend';
|
|
270
|
-
|
|
271
|
-
// Helper to extract item config from a payload.
|
|
272
|
-
function getPayloadConfigFromPayload(config: ChartConfig, payload: unknown, key: string) {
|
|
273
|
-
if (typeof payload !== 'object' || payload === null) {
|
|
274
|
-
return undefined;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
const payloadPayload =
|
|
278
|
-
'payload' in payload &&
|
|
279
|
-
typeof (payload as { payload: unknown }).payload === 'object' &&
|
|
280
|
-
(payload as { payload: unknown }).payload !== null
|
|
281
|
-
? ((payload as { payload: unknown }).payload as Record<string, unknown>)
|
|
282
|
-
: undefined;
|
|
283
|
-
|
|
284
|
-
let configLabelKey: string = key;
|
|
285
|
-
|
|
286
|
-
if (key in payload && typeof (payload as Record<string, unknown>)[key] === 'string') {
|
|
287
|
-
configLabelKey = (payload as Record<string, unknown>)[key] as string;
|
|
288
|
-
} else if (payloadPayload && key in payloadPayload && typeof payloadPayload[key] === 'string') {
|
|
289
|
-
configLabelKey = payloadPayload[key] as string;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
return configLabelKey in config ? config[configLabelKey] : config[key as keyof typeof config];
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
export { ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent };
|
|
296
|
-
export type { ChartConfig };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Checkbox } from '@gv-tech/ui-web';
|
|
2
|
-
import { render, screen } from '@testing-library/react';
|
|
3
|
-
import userEvent from '@testing-library/user-event';
|
|
4
|
-
import { describe, expect, it } from 'vitest';
|
|
5
|
-
|
|
6
|
-
describe('Checkbox', () => {
|
|
7
|
-
it('renders correctly', () => {
|
|
8
|
-
render(<Checkbox />);
|
|
9
|
-
expect(screen.getByRole('checkbox')).toBeInTheDocument();
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
it('toggles checked state on click', async () => {
|
|
13
|
-
const user = userEvent.setup();
|
|
14
|
-
render(<Checkbox />);
|
|
15
|
-
|
|
16
|
-
const checkbox = screen.getByRole('checkbox');
|
|
17
|
-
expect(checkbox).not.toBeChecked();
|
|
18
|
-
|
|
19
|
-
await user.click(checkbox);
|
|
20
|
-
expect(checkbox).toBeChecked();
|
|
21
|
-
|
|
22
|
-
await user.click(checkbox);
|
|
23
|
-
expect(checkbox).not.toBeChecked();
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
it('renders disabled state', () => {
|
|
27
|
-
render(<Checkbox disabled />);
|
|
28
|
-
expect(screen.getByRole('checkbox')).toBeDisabled();
|
|
29
|
-
});
|
|
30
|
-
});
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
2
|
-
import { Check } from 'lucide-react';
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
|
|
5
|
-
import type { CheckboxBaseProps } from '@gv-tech/ui-core';
|
|
6
|
-
import { cn } from './lib/utils';
|
|
7
|
-
|
|
8
|
-
export interface CheckboxProps
|
|
9
|
-
extends
|
|
10
|
-
Omit<React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>, keyof CheckboxBaseProps>,
|
|
11
|
-
CheckboxBaseProps {}
|
|
12
|
-
|
|
13
|
-
const Checkbox = React.forwardRef<React.ElementRef<typeof CheckboxPrimitive.Root>, CheckboxProps>(
|
|
14
|
-
({ className, ...props }, ref) => (
|
|
15
|
-
<CheckboxPrimitive.Root
|
|
16
|
-
ref={ref}
|
|
17
|
-
className={cn(
|
|
18
|
-
'grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground',
|
|
19
|
-
className,
|
|
20
|
-
)}
|
|
21
|
-
{...props}
|
|
22
|
-
>
|
|
23
|
-
<CheckboxPrimitive.Indicator className={cn('grid place-content-center text-current')}>
|
|
24
|
-
<Check className="h-4 w-4" />
|
|
25
|
-
</CheckboxPrimitive.Indicator>
|
|
26
|
-
</CheckboxPrimitive.Root>
|
|
27
|
-
),
|
|
28
|
-
);
|
|
29
|
-
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
30
|
-
|
|
31
|
-
export { Checkbox };
|
|
@@ -1,51 +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 { Collapsible, CollapsibleContent, CollapsibleTrigger } from '.';
|
|
5
|
-
|
|
6
|
-
describe('Collapsible', () => {
|
|
7
|
-
it('renders correctly', () => {
|
|
8
|
-
render(
|
|
9
|
-
<Collapsible>
|
|
10
|
-
<CollapsibleTrigger>Toggle</CollapsibleTrigger>
|
|
11
|
-
<CollapsibleContent>Content</CollapsibleContent>
|
|
12
|
-
</Collapsible>,
|
|
13
|
-
);
|
|
14
|
-
|
|
15
|
-
expect(screen.getByRole('button', { name: 'Toggle' })).toBeInTheDocument();
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('toggles content visibility', async () => {
|
|
19
|
-
const user = userEvent.setup();
|
|
20
|
-
render(
|
|
21
|
-
<Collapsible>
|
|
22
|
-
<CollapsibleTrigger>Toggle</CollapsibleTrigger>
|
|
23
|
-
<CollapsibleContent>Content</CollapsibleContent>
|
|
24
|
-
</Collapsible>,
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
const trigger = screen.getByRole('button', { name: 'Toggle' });
|
|
28
|
-
|
|
29
|
-
// Initial state: Content might be hidden or not present depending on implementation details of Radix
|
|
30
|
-
// But Radix Collapsible adds data-state attribute
|
|
31
|
-
expect(trigger).toHaveAttribute('data-state', 'closed');
|
|
32
|
-
|
|
33
|
-
await user.click(trigger);
|
|
34
|
-
expect(trigger).toHaveAttribute('data-state', 'open');
|
|
35
|
-
expect(screen.getByText('Content')).toBeVisible();
|
|
36
|
-
|
|
37
|
-
await user.click(trigger);
|
|
38
|
-
expect(trigger).toHaveAttribute('data-state', 'closed');
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
it('renders open by default', () => {
|
|
42
|
-
render(
|
|
43
|
-
<Collapsible defaultOpen>
|
|
44
|
-
<CollapsibleTrigger>Toggle</CollapsibleTrigger>
|
|
45
|
-
<CollapsibleContent>Content</CollapsibleContent>
|
|
46
|
-
</Collapsible>,
|
|
47
|
-
);
|
|
48
|
-
expect(screen.getByRole('button', { name: 'Toggle' })).toHaveAttribute('data-state', 'open');
|
|
49
|
-
expect(screen.getByText('Content')).toBeVisible();
|
|
50
|
-
});
|
|
51
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { CollapsibleBaseProps, CollapsibleContentBaseProps, CollapsibleTriggerBaseProps } from '@gv-tech/ui-core';
|
|
2
|
-
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
3
|
-
|
|
4
|
-
const Collapsible = CollapsiblePrimitive.Root;
|
|
5
|
-
|
|
6
|
-
const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;
|
|
7
|
-
|
|
8
|
-
const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent;
|
|
9
|
-
|
|
10
|
-
export { Collapsible, CollapsibleContent, CollapsibleTrigger };
|
|
11
|
-
export type {
|
|
12
|
-
CollapsibleContentBaseProps as CollapsibleContentProps,
|
|
13
|
-
CollapsibleBaseProps as CollapsibleProps,
|
|
14
|
-
CollapsibleTriggerBaseProps as CollapsibleTriggerProps,
|
|
15
|
-
};
|
|
@@ -1,79 +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 { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from '.';
|
|
5
|
-
|
|
6
|
-
describe('Command', () => {
|
|
7
|
-
it('renders correctly', () => {
|
|
8
|
-
render(
|
|
9
|
-
<Command>
|
|
10
|
-
<CommandInput placeholder="Search..." />
|
|
11
|
-
<CommandList>
|
|
12
|
-
<CommandEmpty>No results found.</CommandEmpty>
|
|
13
|
-
<CommandGroup heading="Suggestions">
|
|
14
|
-
<CommandItem>Calendar</CommandItem>
|
|
15
|
-
<CommandItem>Search Emoji</CommandItem>
|
|
16
|
-
<CommandItem>Calculator</CommandItem>
|
|
17
|
-
</CommandGroup>
|
|
18
|
-
</CommandList>
|
|
19
|
-
</Command>,
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
expect(screen.getByPlaceholderText('Search...')).toBeInTheDocument();
|
|
23
|
-
expect(screen.getByText('Suggestions')).toBeInTheDocument();
|
|
24
|
-
expect(screen.getByText('Calendar')).toBeInTheDocument();
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
it('filters items based on input', async () => {
|
|
28
|
-
const user = userEvent.setup();
|
|
29
|
-
render(
|
|
30
|
-
<Command>
|
|
31
|
-
<CommandInput placeholder="Search..." />
|
|
32
|
-
<CommandList>
|
|
33
|
-
<CommandGroup heading="Suggestions">
|
|
34
|
-
<CommandItem>Calendar</CommandItem>
|
|
35
|
-
<CommandItem>Search Emoji</CommandItem>
|
|
36
|
-
<CommandItem>Calculator</CommandItem>
|
|
37
|
-
</CommandGroup>
|
|
38
|
-
</CommandList>
|
|
39
|
-
</Command>,
|
|
40
|
-
);
|
|
41
|
-
|
|
42
|
-
const input = screen.getByPlaceholderText('Search...');
|
|
43
|
-
await user.type(input, 'Cal');
|
|
44
|
-
|
|
45
|
-
expect(screen.getByText('Calendar')).toBeVisible();
|
|
46
|
-
expect(screen.getByText('Calculator')).toBeVisible();
|
|
47
|
-
// search emoji should be filtered out
|
|
48
|
-
// Note: cmdk might just hide items, so we check if they are visible or not
|
|
49
|
-
// or checks class names.
|
|
50
|
-
// Let's check if Search Emoji is not visible or removed
|
|
51
|
-
const emoji = screen.queryByText('Search Emoji');
|
|
52
|
-
// If it's still in document but hidden, we check visibility
|
|
53
|
-
if (emoji) {
|
|
54
|
-
expect(emoji).not.toBeVisible();
|
|
55
|
-
} else {
|
|
56
|
-
expect(emoji).not.toBeInTheDocument();
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
it('shows empty state when no results', async () => {
|
|
61
|
-
const user = userEvent.setup();
|
|
62
|
-
render(
|
|
63
|
-
<Command>
|
|
64
|
-
<CommandInput placeholder="Search..." />
|
|
65
|
-
<CommandList>
|
|
66
|
-
<CommandEmpty>No results found.</CommandEmpty>
|
|
67
|
-
<CommandGroup heading="Suggestions">
|
|
68
|
-
<CommandItem>Calendar</CommandItem>
|
|
69
|
-
</CommandGroup>
|
|
70
|
-
</CommandList>
|
|
71
|
-
</Command>,
|
|
72
|
-
);
|
|
73
|
-
|
|
74
|
-
const input = screen.getByPlaceholderText('Search...');
|
|
75
|
-
await user.type(input, 'XYZ');
|
|
76
|
-
|
|
77
|
-
expect(screen.getByText('No results found.')).toBeVisible();
|
|
78
|
-
});
|
|
79
|
-
});
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { type DialogProps } from '@radix-ui/react-dialog';
|
|
4
|
-
import { Command as CommandPrimitive } from 'cmdk';
|
|
5
|
-
import { Search } from 'lucide-react';
|
|
6
|
-
import * as React from 'react';
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
CommandBaseProps,
|
|
10
|
-
CommandEmptyBaseProps,
|
|
11
|
-
CommandGroupBaseProps,
|
|
12
|
-
CommandInputBaseProps,
|
|
13
|
-
CommandItemBaseProps,
|
|
14
|
-
CommandListBaseProps,
|
|
15
|
-
CommandSeparatorBaseProps,
|
|
16
|
-
CommandShortcutBaseProps,
|
|
17
|
-
} from '@gv-tech/ui-core';
|
|
18
|
-
import { Dialog, DialogContent, DialogDescription, DialogTitle } from './dialog';
|
|
19
|
-
import { cn } from './lib/utils';
|
|
20
|
-
|
|
21
|
-
const Command = React.forwardRef<
|
|
22
|
-
React.ElementRef<typeof CommandPrimitive>,
|
|
23
|
-
React.ComponentPropsWithoutRef<typeof CommandPrimitive> & CommandBaseProps
|
|
24
|
-
>(({ className, ...props }, ref) => (
|
|
25
|
-
<CommandPrimitive
|
|
26
|
-
ref={ref}
|
|
27
|
-
className={cn(
|
|
28
|
-
'flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground',
|
|
29
|
-
className,
|
|
30
|
-
)}
|
|
31
|
-
{...props}
|
|
32
|
-
/>
|
|
33
|
-
));
|
|
34
|
-
Command.displayName = CommandPrimitive.displayName;
|
|
35
|
-
|
|
36
|
-
const CommandDialog = ({ children, ...props }: DialogProps) => {
|
|
37
|
-
return (
|
|
38
|
-
<Dialog {...props}>
|
|
39
|
-
<DialogContent className="overflow-hidden p-0">
|
|
40
|
-
<DialogTitle className="sr-only">Search</DialogTitle>
|
|
41
|
-
<DialogDescription className="sr-only">Search for documentation and components.</DialogDescription>
|
|
42
|
-
<Command className="[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5">
|
|
43
|
-
{children}
|
|
44
|
-
</Command>
|
|
45
|
-
</DialogContent>
|
|
46
|
-
</Dialog>
|
|
47
|
-
);
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
const CommandInput = React.forwardRef<
|
|
51
|
-
React.ElementRef<typeof CommandPrimitive.Input>,
|
|
52
|
-
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input> & CommandInputBaseProps
|
|
53
|
-
>(({ className, ...props }, ref) => (
|
|
54
|
-
<div className="flex items-center border-b px-3" cmdk-input-wrapper="">
|
|
55
|
-
<Search className="mr-2 h-4 w-4 shrink-0 opacity-50" />
|
|
56
|
-
<CommandPrimitive.Input
|
|
57
|
-
ref={ref}
|
|
58
|
-
className={cn(
|
|
59
|
-
'flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50',
|
|
60
|
-
className,
|
|
61
|
-
)}
|
|
62
|
-
{...props}
|
|
63
|
-
/>
|
|
64
|
-
</div>
|
|
65
|
-
));
|
|
66
|
-
|
|
67
|
-
CommandInput.displayName = CommandPrimitive.Input.displayName;
|
|
68
|
-
|
|
69
|
-
const CommandList = React.forwardRef<
|
|
70
|
-
React.ElementRef<typeof CommandPrimitive.List>,
|
|
71
|
-
React.ComponentPropsWithoutRef<typeof CommandPrimitive.List> & CommandListBaseProps
|
|
72
|
-
>(({ className, ...props }, ref) => (
|
|
73
|
-
<CommandPrimitive.List
|
|
74
|
-
ref={ref}
|
|
75
|
-
className={cn('max-h-[300px] overflow-y-auto overflow-x-hidden', className)}
|
|
76
|
-
{...props}
|
|
77
|
-
/>
|
|
78
|
-
));
|
|
79
|
-
|
|
80
|
-
CommandList.displayName = CommandPrimitive.List.displayName;
|
|
81
|
-
|
|
82
|
-
const CommandEmpty = React.forwardRef<
|
|
83
|
-
React.ElementRef<typeof CommandPrimitive.Empty>,
|
|
84
|
-
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty> & CommandEmptyBaseProps
|
|
85
|
-
>((props, ref) => <CommandPrimitive.Empty ref={ref} className="py-6 text-center text-sm" {...props} />);
|
|
86
|
-
|
|
87
|
-
CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
|
|
88
|
-
|
|
89
|
-
const CommandGroup = React.forwardRef<
|
|
90
|
-
React.ElementRef<typeof CommandPrimitive.Group>,
|
|
91
|
-
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group> & CommandGroupBaseProps
|
|
92
|
-
>(({ className, ...props }, ref) => (
|
|
93
|
-
<CommandPrimitive.Group
|
|
94
|
-
ref={ref}
|
|
95
|
-
className={cn(
|
|
96
|
-
'overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground',
|
|
97
|
-
className,
|
|
98
|
-
)}
|
|
99
|
-
{...props}
|
|
100
|
-
/>
|
|
101
|
-
));
|
|
102
|
-
|
|
103
|
-
CommandGroup.displayName = CommandPrimitive.Group.displayName;
|
|
104
|
-
|
|
105
|
-
const CommandSeparator = React.forwardRef<
|
|
106
|
-
React.ElementRef<typeof CommandPrimitive.Separator>,
|
|
107
|
-
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator> & CommandSeparatorBaseProps
|
|
108
|
-
>(({ className, ...props }, ref) => (
|
|
109
|
-
<CommandPrimitive.Separator ref={ref} className={cn('-mx-1 h-px bg-border', className)} {...props} />
|
|
110
|
-
));
|
|
111
|
-
CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
|
|
112
|
-
|
|
113
|
-
const CommandItem = React.forwardRef<
|
|
114
|
-
React.ElementRef<typeof CommandPrimitive.Item>,
|
|
115
|
-
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item> & CommandItemBaseProps
|
|
116
|
-
>(({ className, ...props }, ref) => (
|
|
117
|
-
<CommandPrimitive.Item
|
|
118
|
-
ref={ref}
|
|
119
|
-
className={cn(
|
|
120
|
-
'relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',
|
|
121
|
-
className,
|
|
122
|
-
)}
|
|
123
|
-
{...props}
|
|
124
|
-
/>
|
|
125
|
-
));
|
|
126
|
-
|
|
127
|
-
CommandItem.displayName = CommandPrimitive.Item.displayName;
|
|
128
|
-
|
|
129
|
-
const CommandShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement> & CommandShortcutBaseProps) => {
|
|
130
|
-
return <span className={cn('ml-auto text-xs tracking-widest text-muted-foreground', className)} {...props} />;
|
|
131
|
-
};
|
|
132
|
-
CommandShortcut.displayName = 'CommandShortcut';
|
|
133
|
-
|
|
134
|
-
export {
|
|
135
|
-
Command,
|
|
136
|
-
CommandDialog,
|
|
137
|
-
CommandEmpty,
|
|
138
|
-
CommandGroup,
|
|
139
|
-
CommandInput,
|
|
140
|
-
CommandItem,
|
|
141
|
-
CommandList,
|
|
142
|
-
CommandSeparator,
|
|
143
|
-
CommandShortcut,
|
|
144
|
-
};
|
|
145
|
-
export type {
|
|
146
|
-
CommandEmptyBaseProps as CommandEmptyProps,
|
|
147
|
-
CommandGroupBaseProps as CommandGroupProps,
|
|
148
|
-
CommandInputBaseProps as CommandInputProps,
|
|
149
|
-
CommandItemBaseProps as CommandItemProps,
|
|
150
|
-
CommandListBaseProps as CommandListProps,
|
|
151
|
-
CommandBaseProps as CommandProps,
|
|
152
|
-
CommandSeparatorBaseProps as CommandSeparatorProps,
|
|
153
|
-
CommandShortcutBaseProps as CommandShortcutProps,
|
|
154
|
-
};
|