@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,17 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Text, type TextProps } from 'react-native';
|
|
3
|
-
|
|
4
|
-
// Wraps raw strings or numbers in a React Native <Text> component.
|
|
5
|
-
// Prevents "Unexpected text node" errors in React Native environments.
|
|
6
|
-
export function wrapTextChildren(
|
|
7
|
-
children: React.ReactNode,
|
|
8
|
-
TextComponent: React.ComponentType<TextProps> = Text,
|
|
9
|
-
textProps: TextProps = {},
|
|
10
|
-
): React.ReactNode {
|
|
11
|
-
return React.Children.map(children, (child) => {
|
|
12
|
-
if (typeof child === 'string' || typeof child === 'number') {
|
|
13
|
-
return <TextComponent {...textProps}>{child}</TextComponent>;
|
|
14
|
-
}
|
|
15
|
-
return child;
|
|
16
|
-
});
|
|
17
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/// <reference types="nativewind/types" />
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { fireEvent, render, screen } from '@testing-library/react';
|
|
2
|
-
import { describe, expect, it, vi } from 'vitest';
|
|
3
|
-
import { RadioGroup, RadioGroupItem } from './radio-group';
|
|
4
|
-
|
|
5
|
-
// Mock the primitive to avoid JSX parsing issues in node_modules
|
|
6
|
-
/* eslint-disable @typescript-eslint/no-require-imports, @typescript-eslint/no-explicit-any */
|
|
7
|
-
vi.mock('@rn-primitives/radio-group', () => {
|
|
8
|
-
const React = require('react');
|
|
9
|
-
return {
|
|
10
|
-
Root: React.forwardRef(({ children, className, value, onValueChange, ...props }: any, ref: any) =>
|
|
11
|
-
React.createElement(
|
|
12
|
-
'div',
|
|
13
|
-
{ ref, className, ...props },
|
|
14
|
-
React.Children.map(children, (child: any) => {
|
|
15
|
-
if (React.isValidElement(child)) {
|
|
16
|
-
return React.cloneElement(child as any, {
|
|
17
|
-
checked: (child.props as any).value === value,
|
|
18
|
-
onCheckedChange: () => onValueChange?.((child.props as any).value),
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
return child;
|
|
22
|
-
}),
|
|
23
|
-
),
|
|
24
|
-
),
|
|
25
|
-
Item: React.forwardRef(({ children, className, checked, onCheckedChange, ...props }: any, ref: any) =>
|
|
26
|
-
React.createElement(
|
|
27
|
-
'div',
|
|
28
|
-
{
|
|
29
|
-
ref,
|
|
30
|
-
role: 'radio',
|
|
31
|
-
'aria-checked': checked,
|
|
32
|
-
className,
|
|
33
|
-
onClick: onCheckedChange,
|
|
34
|
-
...props,
|
|
35
|
-
},
|
|
36
|
-
children,
|
|
37
|
-
),
|
|
38
|
-
),
|
|
39
|
-
Indicator: ({ children, className }: any) => React.createElement('div', { className }, children),
|
|
40
|
-
useRootContext: () => ({ value: 'option-one' }), // Basic mock
|
|
41
|
-
};
|
|
42
|
-
});
|
|
43
|
-
/* eslint-enable @typescript-eslint/no-require-imports, @typescript-eslint/no-explicit-any */
|
|
44
|
-
|
|
45
|
-
vi.mock('lucide-react-native', () => ({
|
|
46
|
-
Circle: () => null,
|
|
47
|
-
Check: () => null,
|
|
48
|
-
ChevronDown: () => null,
|
|
49
|
-
ChevronUp: () => null,
|
|
50
|
-
X: () => null,
|
|
51
|
-
}));
|
|
52
|
-
|
|
53
|
-
describe('RadioGroup (Native Implementation)', () => {
|
|
54
|
-
it('renders correctly', () => {
|
|
55
|
-
render(
|
|
56
|
-
<RadioGroup value="option-one" onValueChange={() => {}}>
|
|
57
|
-
<RadioGroupItem value="option-one" aria-label="Option One" />
|
|
58
|
-
<RadioGroupItem value="option-two" aria-label="Option Two" />
|
|
59
|
-
</RadioGroup>,
|
|
60
|
-
);
|
|
61
|
-
expect(screen.getByLabelText('Option One')).toBeDefined();
|
|
62
|
-
expect(screen.getByLabelText('Option Two')).toBeDefined();
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
it('handles value change', () => {
|
|
66
|
-
const onValueChange = vi.fn();
|
|
67
|
-
render(
|
|
68
|
-
<RadioGroup value="option-one" onValueChange={onValueChange}>
|
|
69
|
-
<RadioGroupItem value="option-one" aria-label="Option One" />
|
|
70
|
-
<RadioGroupItem value="option-two" aria-label="Option Two" />
|
|
71
|
-
</RadioGroup>,
|
|
72
|
-
);
|
|
73
|
-
|
|
74
|
-
fireEvent.click(screen.getByLabelText('Option Two'));
|
|
75
|
-
expect(onValueChange).toHaveBeenCalledWith('option-two');
|
|
76
|
-
});
|
|
77
|
-
});
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { RadioGroupBaseProps, RadioGroupItemBaseProps } from '@gv-tech/ui-core';
|
|
2
|
-
import * as RadioGroupPrimitive from '@rn-primitives/radio-group';
|
|
3
|
-
import { Circle } from 'lucide-react-native';
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
|
|
6
|
-
import { cn } from './lib/utils';
|
|
7
|
-
|
|
8
|
-
export interface RadioGroupProps
|
|
9
|
-
extends React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>, RadioGroupBaseProps {}
|
|
10
|
-
|
|
11
|
-
const RadioGroup = React.forwardRef<React.ElementRef<typeof RadioGroupPrimitive.Root>, RadioGroupProps>(
|
|
12
|
-
({ className, ...props }, ref) => {
|
|
13
|
-
return <RadioGroupPrimitive.Root className={cn('web:grid gap-2', className)} {...props} ref={ref} />;
|
|
14
|
-
},
|
|
15
|
-
);
|
|
16
|
-
RadioGroup.displayName = RadioGroupPrimitive.Root?.displayName || 'RadioGroup';
|
|
17
|
-
|
|
18
|
-
export interface RadioGroupItemProps
|
|
19
|
-
extends Omit<React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>, 'disabled'>, RadioGroupItemBaseProps {}
|
|
20
|
-
|
|
21
|
-
const RadioGroupItem = React.forwardRef<React.ElementRef<typeof RadioGroupPrimitive.Item>, RadioGroupItemProps>(
|
|
22
|
-
({ className, ...props }, ref) => {
|
|
23
|
-
return (
|
|
24
|
-
<RadioGroupPrimitive.Item
|
|
25
|
-
ref={ref}
|
|
26
|
-
className={cn(
|
|
27
|
-
'aspect-square h-4 w-4 native:h-5 native:w-5 rounded-full border border-primary text-primary web:ring-offset-background web:focus:outline-none web:focus-visible:ring-2 web:focus-visible:ring-ring web:focus-visible:ring-offset-2',
|
|
28
|
-
props.disabled && 'web:cursor-not-allowed opacity-50',
|
|
29
|
-
className,
|
|
30
|
-
)}
|
|
31
|
-
{...props}
|
|
32
|
-
>
|
|
33
|
-
<RadioGroupPrimitive.Indicator className="flex items-center justify-center">
|
|
34
|
-
<Circle className="h-2.5 w-2.5 fill-current text-current" />
|
|
35
|
-
</RadioGroupPrimitive.Indicator>
|
|
36
|
-
</RadioGroupPrimitive.Item>
|
|
37
|
-
);
|
|
38
|
-
},
|
|
39
|
-
);
|
|
40
|
-
RadioGroupItem.displayName = RadioGroupPrimitive.Item?.displayName || 'RadioGroupItem';
|
|
41
|
-
|
|
42
|
-
export { RadioGroup, RadioGroupItem };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Text, View } from 'react-native';
|
|
2
|
-
|
|
3
|
-
export const ResizablePanelGroup = () => {
|
|
4
|
-
return (
|
|
5
|
-
<View>
|
|
6
|
-
<Text>ResizablePanelGroup is not yet implemented for React Native</Text>
|
|
7
|
-
</View>
|
|
8
|
-
);
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export const ResizablePanel = () => {
|
|
12
|
-
return (
|
|
13
|
-
<View>
|
|
14
|
-
<Text>ResizablePanel is not yet implemented for React Native</Text>
|
|
15
|
-
</View>
|
|
16
|
-
);
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export const ResizableHandle = () => {
|
|
20
|
-
return (
|
|
21
|
-
<View>
|
|
22
|
-
<Text>ResizableHandle is not yet implemented for React Native</Text>
|
|
23
|
-
</View>
|
|
24
|
-
);
|
|
25
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Text, View } from 'react-native';
|
|
2
|
-
|
|
3
|
-
export const Search = () => {
|
|
4
|
-
return (
|
|
5
|
-
<View>
|
|
6
|
-
<Text>Search is not yet implemented for React Native</Text>
|
|
7
|
-
</View>
|
|
8
|
-
);
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export const SearchTrigger = () => {
|
|
12
|
-
return (
|
|
13
|
-
<View>
|
|
14
|
-
<Text>SearchTrigger is not yet implemented for React Native</Text>
|
|
15
|
-
</View>
|
|
16
|
-
);
|
|
17
|
-
};
|
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
SelectBaseProps,
|
|
3
|
-
SelectContentBaseProps,
|
|
4
|
-
SelectGroupBaseProps,
|
|
5
|
-
SelectItemBaseProps,
|
|
6
|
-
SelectLabelBaseProps,
|
|
7
|
-
SelectScrollDownButtonBaseProps,
|
|
8
|
-
SelectScrollUpButtonBaseProps,
|
|
9
|
-
SelectSeparatorBaseProps,
|
|
10
|
-
SelectTriggerBaseProps,
|
|
11
|
-
SelectValueBaseProps,
|
|
12
|
-
} from '@gv-tech/ui-core';
|
|
13
|
-
import * as SelectPrimitive from '@rn-primitives/select';
|
|
14
|
-
import { Check, ChevronDown, ChevronUp } from 'lucide-react-native';
|
|
15
|
-
import * as React from 'react';
|
|
16
|
-
import { Platform, StyleSheet, View, type ViewStyle } from 'react-native';
|
|
17
|
-
import Animated from 'react-native-reanimated';
|
|
18
|
-
|
|
19
|
-
import { cn } from './lib/utils';
|
|
20
|
-
|
|
21
|
-
export interface SelectProps
|
|
22
|
-
extends
|
|
23
|
-
Omit<
|
|
24
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Root>,
|
|
25
|
-
'value' | 'defaultValue' | 'onValueChange' | 'disabled'
|
|
26
|
-
>,
|
|
27
|
-
SelectBaseProps {}
|
|
28
|
-
|
|
29
|
-
const Select = SelectPrimitive.Root;
|
|
30
|
-
|
|
31
|
-
export interface SelectGroupProps
|
|
32
|
-
extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Group>, SelectGroupBaseProps {}
|
|
33
|
-
|
|
34
|
-
const SelectGroup = SelectPrimitive.Group;
|
|
35
|
-
|
|
36
|
-
export interface SelectValueProps
|
|
37
|
-
extends Omit<React.ComponentPropsWithoutRef<typeof SelectPrimitive.Value>, 'placeholder'>, SelectValueBaseProps {}
|
|
38
|
-
|
|
39
|
-
const SelectValue = SelectPrimitive.Value;
|
|
40
|
-
|
|
41
|
-
export interface SelectTriggerProps
|
|
42
|
-
extends
|
|
43
|
-
Omit<React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>, 'children' | 'disabled'>,
|
|
44
|
-
SelectTriggerBaseProps {}
|
|
45
|
-
|
|
46
|
-
const SelectTrigger = React.forwardRef<React.ElementRef<typeof SelectPrimitive.Trigger>, SelectTriggerProps>(
|
|
47
|
-
({ className, children, ...props }, ref) => (
|
|
48
|
-
<SelectPrimitive.Trigger
|
|
49
|
-
ref={ref}
|
|
50
|
-
className={cn(
|
|
51
|
-
'flex flex-row h-10 native:h-12 items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm text-muted-foreground web:ring-offset-background web:focus:outline-none web:focus:ring-2 web:focus:ring-ring web:focus:ring-offset-2 [&>span]:line-clamp-1',
|
|
52
|
-
props.disabled && 'web:cursor-not-allowed opacity-50',
|
|
53
|
-
className,
|
|
54
|
-
)}
|
|
55
|
-
{...props}
|
|
56
|
-
>
|
|
57
|
-
<>{children}</>
|
|
58
|
-
<ChevronDown size={16} aria-hidden={true} className="text-foreground opacity-50" />
|
|
59
|
-
</SelectPrimitive.Trigger>
|
|
60
|
-
),
|
|
61
|
-
);
|
|
62
|
-
SelectTrigger.displayName = SelectPrimitive.Trigger?.displayName || 'SelectTrigger';
|
|
63
|
-
|
|
64
|
-
export interface SelectScrollUpButtonProps
|
|
65
|
-
extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>, SelectScrollUpButtonBaseProps {}
|
|
66
|
-
|
|
67
|
-
const SelectScrollUpButton = React.forwardRef<
|
|
68
|
-
React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,
|
|
69
|
-
SelectScrollUpButtonProps
|
|
70
|
-
>(({ className, ...props }, ref) => (
|
|
71
|
-
<SelectPrimitive.ScrollUpButton
|
|
72
|
-
// @ts-expect-error TODO: fix type
|
|
73
|
-
ref={ref}
|
|
74
|
-
className={cn('flex cursor-default items-center justify-center py-1', className)}
|
|
75
|
-
{...props}
|
|
76
|
-
>
|
|
77
|
-
<ChevronUp size={14} className="text-foreground" />
|
|
78
|
-
</SelectPrimitive.ScrollUpButton>
|
|
79
|
-
));
|
|
80
|
-
SelectScrollUpButton.displayName =
|
|
81
|
-
((SelectPrimitive.ScrollUpButton as unknown as Record<string, unknown>)?.displayName as string | undefined) ||
|
|
82
|
-
'SelectScrollUpButton';
|
|
83
|
-
|
|
84
|
-
export interface SelectScrollDownButtonProps
|
|
85
|
-
extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>, SelectScrollDownButtonBaseProps {}
|
|
86
|
-
|
|
87
|
-
const SelectScrollDownButton = React.forwardRef<
|
|
88
|
-
React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,
|
|
89
|
-
SelectScrollDownButtonProps
|
|
90
|
-
>(({ className, ...props }, ref) => (
|
|
91
|
-
<SelectPrimitive.ScrollDownButton
|
|
92
|
-
// @ts-expect-error TODO: fix type
|
|
93
|
-
ref={ref}
|
|
94
|
-
className={cn('flex cursor-default items-center justify-center py-1', className)}
|
|
95
|
-
{...props}
|
|
96
|
-
>
|
|
97
|
-
<ChevronDown size={14} className="text-foreground" />
|
|
98
|
-
</SelectPrimitive.ScrollDownButton>
|
|
99
|
-
));
|
|
100
|
-
|
|
101
|
-
SelectScrollDownButton.displayName =
|
|
102
|
-
((SelectPrimitive.ScrollDownButton as unknown as Record<string, unknown>)?.displayName as string | undefined) ||
|
|
103
|
-
'SelectScrollDownButton';
|
|
104
|
-
|
|
105
|
-
export interface SelectContentProps
|
|
106
|
-
extends Omit<React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>, 'position'>, SelectContentBaseProps {
|
|
107
|
-
portalHost?: string;
|
|
108
|
-
overlayClassName?: string;
|
|
109
|
-
overlayStyle?: ViewStyle;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
const SelectContent = React.forwardRef<React.ElementRef<typeof SelectPrimitive.Content>, SelectContentProps>(
|
|
113
|
-
({ className, children, position = 'popper', portalHost, overlayClassName, overlayStyle, ...props }, ref) => {
|
|
114
|
-
const { open } = SelectPrimitive.useRootContext();
|
|
115
|
-
|
|
116
|
-
return (
|
|
117
|
-
<SelectPrimitive.Portal hostName={portalHost}>
|
|
118
|
-
<SelectPrimitive.Overlay style={Platform.OS !== 'web' ? StyleSheet.absoluteFill : undefined} asChild>
|
|
119
|
-
<Animated.View className={overlayClassName} style={overlayStyle} />
|
|
120
|
-
</SelectPrimitive.Overlay>
|
|
121
|
-
<SelectPrimitive.Content
|
|
122
|
-
ref={ref}
|
|
123
|
-
className={cn(
|
|
124
|
-
'relative z-50 max-h-96 min-w-[8rem] rounded-md border border-border bg-popover shadow-md 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',
|
|
125
|
-
position === 'popper' &&
|
|
126
|
-
'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',
|
|
127
|
-
open ? 'web:zoom-in-95 web:animate-in web:fade-in-0' : 'web:zoom-out-95 web:animate-out web:fade-out-0',
|
|
128
|
-
className,
|
|
129
|
-
)}
|
|
130
|
-
position={position}
|
|
131
|
-
{...props}
|
|
132
|
-
>
|
|
133
|
-
<SelectScrollUpButton />
|
|
134
|
-
<SelectPrimitive.Viewport
|
|
135
|
-
className={cn(
|
|
136
|
-
'p-1',
|
|
137
|
-
position === 'popper' &&
|
|
138
|
-
'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]',
|
|
139
|
-
)}
|
|
140
|
-
>
|
|
141
|
-
{children}
|
|
142
|
-
</SelectPrimitive.Viewport>
|
|
143
|
-
<SelectScrollDownButton />
|
|
144
|
-
</SelectPrimitive.Content>
|
|
145
|
-
</SelectPrimitive.Portal>
|
|
146
|
-
);
|
|
147
|
-
},
|
|
148
|
-
);
|
|
149
|
-
SelectContent.displayName = SelectPrimitive.Content?.displayName || 'SelectContent';
|
|
150
|
-
|
|
151
|
-
export interface SelectLabelProps
|
|
152
|
-
extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>, SelectLabelBaseProps {}
|
|
153
|
-
|
|
154
|
-
const SelectLabel = React.forwardRef<React.ElementRef<typeof SelectPrimitive.Label>, SelectLabelProps>(
|
|
155
|
-
({ className, ...props }, ref) => (
|
|
156
|
-
<SelectPrimitive.Label
|
|
157
|
-
ref={ref}
|
|
158
|
-
className={cn('py-1.5 pl-8 pr-2 text-sm font-semibold text-popover-foreground', className)}
|
|
159
|
-
{...props}
|
|
160
|
-
/>
|
|
161
|
-
),
|
|
162
|
-
);
|
|
163
|
-
SelectLabel.displayName = SelectPrimitive.Label?.displayName || 'SelectLabel';
|
|
164
|
-
|
|
165
|
-
export interface SelectItemProps
|
|
166
|
-
extends
|
|
167
|
-
Omit<React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>, 'children' | 'disabled' | 'label'>,
|
|
168
|
-
SelectItemBaseProps {
|
|
169
|
-
label?: string;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
const SelectItem = React.forwardRef<React.ElementRef<typeof SelectPrimitive.Item>, SelectItemProps>(
|
|
173
|
-
({ className, children, label, ...props }, ref) => {
|
|
174
|
-
const itemLabel = label || (typeof children === 'string' ? children : '');
|
|
175
|
-
return (
|
|
176
|
-
<SelectPrimitive.Item
|
|
177
|
-
ref={ref}
|
|
178
|
-
label={itemLabel}
|
|
179
|
-
className={cn(
|
|
180
|
-
'relative flex w-full cursor-default select-none flex-row items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none web:hover:bg-accent/50 web:focus:bg-accent web:focus:text-accent-foreground web:hover:text-accent-foreground data-[disabled]:opacity-50',
|
|
181
|
-
props.disabled && 'web:pointer-events-none',
|
|
182
|
-
className,
|
|
183
|
-
)}
|
|
184
|
-
{...props}
|
|
185
|
-
>
|
|
186
|
-
<View
|
|
187
|
-
className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center"
|
|
188
|
-
{...({} as Record<string, unknown>)}
|
|
189
|
-
>
|
|
190
|
-
<SelectPrimitive.ItemIndicator>
|
|
191
|
-
<Check size={14} strokeWidth={3} className="text-popover-foreground" {...({} as Record<string, unknown>)} />
|
|
192
|
-
</SelectPrimitive.ItemIndicator>
|
|
193
|
-
</View>
|
|
194
|
-
{/* @ts-expect-error TODO: fix type */}
|
|
195
|
-
<SelectPrimitive.ItemText className="text-sm text-popover-foreground native:text-base">
|
|
196
|
-
{children}
|
|
197
|
-
</SelectPrimitive.ItemText>
|
|
198
|
-
</SelectPrimitive.Item>
|
|
199
|
-
);
|
|
200
|
-
},
|
|
201
|
-
);
|
|
202
|
-
SelectItem.displayName = SelectPrimitive.Item?.displayName || 'SelectItem';
|
|
203
|
-
|
|
204
|
-
export interface SelectSeparatorProps
|
|
205
|
-
extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>, SelectSeparatorBaseProps {}
|
|
206
|
-
|
|
207
|
-
const SelectSeparator = React.forwardRef<React.ElementRef<typeof SelectPrimitive.Separator>, SelectSeparatorProps>(
|
|
208
|
-
({ className, ...props }, ref) => (
|
|
209
|
-
<SelectPrimitive.Separator
|
|
210
|
-
ref={ref}
|
|
211
|
-
className={cn('-mx-1 my-1 h-px bg-muted', className)}
|
|
212
|
-
{...(props as Record<string, unknown>)}
|
|
213
|
-
/>
|
|
214
|
-
),
|
|
215
|
-
);
|
|
216
|
-
SelectSeparator.displayName = SelectPrimitive.Separator?.displayName || 'SelectSeparator';
|
|
217
|
-
|
|
218
|
-
export {
|
|
219
|
-
Select,
|
|
220
|
-
SelectContent,
|
|
221
|
-
SelectGroup,
|
|
222
|
-
SelectItem,
|
|
223
|
-
SelectLabel,
|
|
224
|
-
SelectScrollDownButton,
|
|
225
|
-
SelectScrollUpButton,
|
|
226
|
-
SelectSeparator,
|
|
227
|
-
SelectTrigger,
|
|
228
|
-
SelectValue,
|
|
229
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import * as SeparatorPrimitive from '@rn-primitives/separator';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
|
|
4
|
-
import { cn } from './lib/utils';
|
|
5
|
-
|
|
6
|
-
const Separator = React.forwardRef<
|
|
7
|
-
React.ElementRef<typeof SeparatorPrimitive.Root>,
|
|
8
|
-
React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
|
|
9
|
-
>(({ className, orientation = 'horizontal', decorative = true, ...props }, ref) => (
|
|
10
|
-
<SeparatorPrimitive.Root
|
|
11
|
-
ref={ref}
|
|
12
|
-
decorative={decorative}
|
|
13
|
-
orientation={orientation}
|
|
14
|
-
className={cn('shrink-0 bg-border', orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]', className)}
|
|
15
|
-
{...props}
|
|
16
|
-
/>
|
|
17
|
-
));
|
|
18
|
-
Separator.displayName = SeparatorPrimitive.Root?.displayName || 'Separator';
|
|
19
|
-
|
|
20
|
-
export { Separator };
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { fireEvent, render, screen } from '@testing-library/react';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { describe, expect, it, vi } from 'vitest';
|
|
4
|
-
import { Sheet, SheetContent, SheetDescription, SheetTitle, SheetTrigger } from './sheet';
|
|
5
|
-
|
|
6
|
-
// Mock primitives
|
|
7
|
-
/* eslint-disable @typescript-eslint/no-require-imports, @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars */
|
|
8
|
-
vi.mock('@rn-primitives/dialog', () => {
|
|
9
|
-
const React = require('react');
|
|
10
|
-
const DialogContext = React.createContext({ open: false, onOpenChange: (_any: any) => {} });
|
|
11
|
-
|
|
12
|
-
return {
|
|
13
|
-
Root: ({ children, open, onOpenChange }: any) =>
|
|
14
|
-
React.createElement(DialogContext.Provider, { value: { open, onOpenChange } }, children),
|
|
15
|
-
Trigger: ({ children, ...props }: any) => {
|
|
16
|
-
const { open, onOpenChange } = React.useContext(DialogContext);
|
|
17
|
-
return React.createElement('button', { onClick: () => onOpenChange?.(!open), ...props }, children);
|
|
18
|
-
},
|
|
19
|
-
Portal: ({ children }: any) => {
|
|
20
|
-
const { open } = React.useContext(DialogContext);
|
|
21
|
-
return open ? React.createElement('div', { 'data-testid': 'portal' }, children) : null;
|
|
22
|
-
},
|
|
23
|
-
Overlay: React.forwardRef(({ children, ...props }: any, ref: any) => {
|
|
24
|
-
const { open } = React.useContext(DialogContext);
|
|
25
|
-
return open ? React.createElement('div', { ref, ...props }, children) : null;
|
|
26
|
-
}),
|
|
27
|
-
Content: React.forwardRef(({ children, ...props }: any, ref: any) => {
|
|
28
|
-
const { open } = React.useContext(DialogContext);
|
|
29
|
-
return open ? React.createElement('div', { ref, ...props }, children) : null;
|
|
30
|
-
}),
|
|
31
|
-
Title: React.forwardRef(({ children, ...props }: any, ref: any) =>
|
|
32
|
-
React.createElement('h2', { ref, ...props }, children),
|
|
33
|
-
),
|
|
34
|
-
Description: React.forwardRef(({ children, ...props }: any, ref: any) =>
|
|
35
|
-
React.createElement('p', { ref, ...props }, children),
|
|
36
|
-
),
|
|
37
|
-
Close: React.forwardRef(({ children, ...props }: any, ref: any) => {
|
|
38
|
-
const { onOpenChange } = React.useContext(DialogContext);
|
|
39
|
-
return React.createElement('button', { onClick: () => onOpenChange?.(false), ref, ...props }, children);
|
|
40
|
-
}),
|
|
41
|
-
useRootContext: () => React.useContext(DialogContext),
|
|
42
|
-
};
|
|
43
|
-
});
|
|
44
|
-
/* eslint-enable @typescript-eslint/no-require-imports, @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars */
|
|
45
|
-
|
|
46
|
-
// Mock reanimated
|
|
47
|
-
/* eslint-disable @typescript-eslint/no-require-imports, @typescript-eslint/no-explicit-any */
|
|
48
|
-
vi.mock('react-native-reanimated', () => {
|
|
49
|
-
const React = require('react');
|
|
50
|
-
return {
|
|
51
|
-
default: {
|
|
52
|
-
View: React.forwardRef(({ children, ...props }: any, ref: any) =>
|
|
53
|
-
React.createElement('div', { ref, ...props }, children),
|
|
54
|
-
),
|
|
55
|
-
},
|
|
56
|
-
FadeIn: { duration: () => ({}) },
|
|
57
|
-
FadeOut: { duration: () => ({}) },
|
|
58
|
-
SlideInRight: {},
|
|
59
|
-
SlideOutRight: {},
|
|
60
|
-
};
|
|
61
|
-
});
|
|
62
|
-
/* eslint-enable @typescript-eslint/no-require-imports, @typescript-eslint/no-explicit-any */
|
|
63
|
-
|
|
64
|
-
// Mock lucide
|
|
65
|
-
vi.mock('lucide-react-native', () => ({
|
|
66
|
-
X: () => null,
|
|
67
|
-
}));
|
|
68
|
-
|
|
69
|
-
describe('Sheet (Native Implementation)', () => {
|
|
70
|
-
it('opens and closes correctly', async () => {
|
|
71
|
-
const TestComponent = () => {
|
|
72
|
-
const [open, setOpen] = React.useState(false);
|
|
73
|
-
return (
|
|
74
|
-
<Sheet open={open} onOpenChange={setOpen}>
|
|
75
|
-
<SheetTrigger>Open</SheetTrigger>
|
|
76
|
-
<SheetContent side="right">
|
|
77
|
-
<SheetTitle>Sheet Title</SheetTitle>
|
|
78
|
-
<SheetDescription>Sheet Description</SheetDescription>
|
|
79
|
-
</SheetContent>
|
|
80
|
-
</Sheet>
|
|
81
|
-
);
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
render(<TestComponent />);
|
|
85
|
-
|
|
86
|
-
expect(screen.queryByText('Sheet Title')).toBeNull();
|
|
87
|
-
|
|
88
|
-
fireEvent.click(screen.getByText('Open'));
|
|
89
|
-
|
|
90
|
-
expect(await screen.findByText('Sheet Title')).toBeDefined();
|
|
91
|
-
expect(screen.getByText('Sheet Description')).toBeDefined();
|
|
92
|
-
});
|
|
93
|
-
});
|