@hanzogui/kitchen-sink 3.0.5
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/.detoxrc.js +130 -0
- package/.env.production +2 -0
- package/.maestro/config.yaml +4 -0
- package/.maestro/flows/shorthand-variables.yaml +23 -0
- package/.watchmanconfig +1 -0
- package/LICENSE +21 -0
- package/README.md +11 -0
- package/app.json +43 -0
- package/assets/adaptive-icon.png +0 -0
- package/assets/favicon.png +0 -0
- package/assets/icon.png +0 -0
- package/assets/splash.png +0 -0
- package/babel.config.js +25 -0
- package/e2e/CompilerExtraction.test.ts +147 -0
- package/e2e/GroupPressNative.test.ts +167 -0
- package/e2e/MediaQueryGtMd.test.ts +71 -0
- package/e2e/NativePortal.test.ts +113 -0
- package/e2e/PointerEvents.test.ts +116 -0
- package/e2e/PressStyleNative.noRngh.test.ts +191 -0
- package/e2e/PressStyleNative.test.ts +231 -0
- package/e2e/SafeArea.test.ts +57 -0
- package/e2e/SelectAndroidOnPress.test.ts +181 -0
- package/e2e/SelectRemount.test.ts +137 -0
- package/e2e/SheetDragResist.test.ts +370 -0
- package/e2e/SheetKeyboardDrag.test.ts +249 -0
- package/e2e/SheetScrollableDrag.test.ts +560 -0
- package/e2e/ShorthandVariables.test.ts +53 -0
- package/e2e/ThemeChangeBasic.test.ts +123 -0
- package/e2e/ThemeMutation.test.ts +80 -0
- package/e2e/check-rngh-status.test.ts +31 -0
- package/e2e/jest.config.js +19 -0
- package/e2e/utils/colors.ts +75 -0
- package/e2e/utils/navigation.ts +53 -0
- package/eas.json +22 -0
- package/flows/AlertDialog.yaml +17 -0
- package/flows/OpenApp.yaml +25 -0
- package/flows/Select.yaml +13 -0
- package/flows/Sheet.yaml +12 -0
- package/flows/Tabs.yaml +13 -0
- package/flows/Toast.yaml +14 -0
- package/flows/WarmUp.yaml +24 -0
- package/index.html +21 -0
- package/index.js +17 -0
- package/metro.config.js +64 -0
- package/next-router-shim.ts +9 -0
- package/package.json +118 -0
- package/plans/toast-2.md +471 -0
- package/playwright.config.ts +71 -0
- package/plugins/expo-modules-core-swift6.js +76 -0
- package/pod-install.sh +7 -0
- package/public/favicon.svg +70 -0
- package/public/fonts/inter.css +15 -0
- package/public/fonts/noto-cn.otf +0 -0
- package/public/gui-icon.svg +68 -0
- package/run-detox.sh +230 -0
- package/run-native-tests.sh +4 -0
- package/run-tests-parallel.ts +195 -0
- package/screenshots/Screenshotter.test.tsx +48 -0
- package/src/AnimationDemos.tsx +131 -0
- package/src/App.native.tsx +121 -0
- package/src/App.tsx +121 -0
- package/src/Navigation.tsx +98 -0
- package/src/Sandbox.tsx +87 -0
- package/src/TestDynamicEval.tsx +33 -0
- package/src/TestNativeSheet.tsx +100 -0
- package/src/components/TimedRender.tsx +18 -0
- package/src/constants/test-ids.ts +52 -0
- package/src/features/demos/demo-screen.tsx +72 -0
- package/src/features/home/ColorSchemeListItem.tsx +41 -0
- package/src/features/home/TestBuildAButton.tsx +102 -0
- package/src/features/home/TestSeparator.tsx +0 -0
- package/src/features/home/screen.tsx +285 -0
- package/src/features/testcases/screen.tsx +59 -0
- package/src/features/testcases/test-screen.tsx +50 -0
- package/src/generatedV5Theme.ts +112 -0
- package/src/gui.config.ts +411 -0
- package/src/guy.png +0 -0
- package/src/index.tsx +6 -0
- package/src/provider/index.tsx +18 -0
- package/src/test-gui-stack.tsx +11 -0
- package/src/test.tsx +3 -0
- package/src/useKitchenSinkTheme.tsx +15 -0
- package/src/usecases/ActionsSheetComparison.tsx +194 -0
- package/src/usecases/AnimatePresenceEnterExitCase.tsx +255 -0
- package/src/usecases/AnimatePresenceExitTest.tsx +69 -0
- package/src/usecases/AnimatedByProp.tsx +39 -0
- package/src/usecases/AnimationComprehensiveCase.tsx +2515 -0
- package/src/usecases/AnimationValueLoggingCase.tsx +526 -0
- package/src/usecases/AnimationsWithMediaQueriesCase.tsx +110 -0
- package/src/usecases/Benchmark.tsx +148 -0
- package/src/usecases/BenchmarkSelect.tsx +34 -0
- package/src/usecases/ButtonCircular.tsx +3 -0
- package/src/usecases/ButtonCustom.tsx +33 -0
- package/src/usecases/ButtonIconColor.tsx +18 -0
- package/src/usecases/ButtonInverse.tsx +30 -0
- package/src/usecases/ButtonUnstyled.tsx +31 -0
- package/src/usecases/CheckboxDisabledOnPress.tsx +62 -0
- package/src/usecases/ClickDuringEnterCase.tsx +59 -0
- package/src/usecases/CodeExamplesInput.tsx +9 -0
- package/src/usecases/ColorTokenFallback.tsx +52 -0
- package/src/usecases/CompilerExtraction.tsx +380 -0
- package/src/usecases/ComplexVariants.tsx +164 -0
- package/src/usecases/CrashAdaptSheet.tsx +98 -0
- package/src/usecases/CustomStyledAnimatedPopover.tsx +42 -0
- package/src/usecases/CustomStyledAnimatedTooltip.tsx +72 -0
- package/src/usecases/DOMNodeAPIs.tsx +154 -0
- package/src/usecases/DialogFocusScopeCase.tsx +277 -0
- package/src/usecases/DialogFocusScopeDebug.tsx +85 -0
- package/src/usecases/DialogNestedCase.tsx +121 -0
- package/src/usecases/DialogOpenControlled.tsx +49 -0
- package/src/usecases/DialogPointerEventsCase.tsx +58 -0
- package/src/usecases/DialogScopedCase.tsx +106 -0
- package/src/usecases/DialogSheetAdaptCase.tsx +178 -0
- package/src/usecases/DialogSheetAdaptResizeCase.tsx +98 -0
- package/src/usecases/DismissLayerStackingCase.tsx +223 -0
- package/src/usecases/DriverDisableAnimationPropsCase.tsx +44 -0
- package/src/usecases/Example.tsx +10 -0
- package/src/usecases/ExitCompletionCase.tsx +713 -0
- package/src/usecases/FocusVisibleButton.tsx +14 -0
- package/src/usecases/FocusVisibleButtonPointer.tsx +13 -0
- package/src/usecases/FocusVisibleButtonWithFocusStyle.tsx +16 -0
- package/src/usecases/FocusWithinCase.tsx +55 -0
- package/src/usecases/FontTokensInVariants.tsx +14 -0
- package/src/usecases/FormButtonTypeCase.tsx +34 -0
- package/src/usecases/GlobalScopedTriggerIsolationCase.tsx +178 -0
- package/src/usecases/GroupHoverMobile.tsx +39 -0
- package/src/usecases/GroupPressInVariant.tsx +92 -0
- package/src/usecases/GroupPressNative.tsx +200 -0
- package/src/usecases/GroupProp.tsx +96 -0
- package/src/usecases/GroupPseudoVariantOverride.tsx +56 -0
- package/src/usecases/GroupUseCases.tsx +94 -0
- package/src/usecases/HeightMediaQueryOverrideCase.tsx +183 -0
- package/src/usecases/InputAutoFocusAfterMenuCase.tsx +105 -0
- package/src/usecases/InputAutoFocusStyledCase.tsx +39 -0
- package/src/usecases/KeyboardControllerTest.tsx +146 -0
- package/src/usecases/ListItem.tsx +123 -0
- package/src/usecases/MediaQueriesV5.tsx +137 -0
- package/src/usecases/MediaQueryGtMd.tsx +73 -0
- package/src/usecases/MenuAboveDialogCase.tsx +75 -0
- package/src/usecases/MenuAccessibilityCase.tsx +133 -0
- package/src/usecases/MenuAnimatePositionCase.tsx +41 -0
- package/src/usecases/MenuArrowAnimatePresenceCase.tsx +98 -0
- package/src/usecases/MenuAsChildPositionCase.tsx +24 -0
- package/src/usecases/MenuAutoResizeCase.tsx +57 -0
- package/src/usecases/MenuBottomCase.tsx +55 -0
- package/src/usecases/MenuFocusLeaveCase.tsx +135 -0
- package/src/usecases/MenuHighlightCase.tsx +44 -0
- package/src/usecases/MenuItemFocusCase.tsx +79 -0
- package/src/usecases/MenuItemPseudoOverrideCase.tsx +270 -0
- package/src/usecases/MenuMultiTriggerCase.tsx +47 -0
- package/src/usecases/MenuOverflowCase.tsx +60 -0
- package/src/usecases/MenuSubCase.tsx +223 -0
- package/src/usecases/MenuSubLeftCase.tsx +178 -0
- package/src/usecases/MenuSubNestedPositionCase.tsx +171 -0
- package/src/usecases/MenuSubStyledCase.tsx +145 -0
- package/src/usecases/MenuThemeCase.tsx +50 -0
- package/src/usecases/MenuUnstyledCase.tsx +52 -0
- package/src/usecases/MultiDriverAnimation.tsx +118 -0
- package/src/usecases/NativePortalTest.tsx +179 -0
- package/src/usecases/NewInputBasic.tsx +16 -0
- package/src/usecases/NewInputEvents.tsx +29 -0
- package/src/usecases/NonGuiTextStyledType.tsx +23 -0
- package/src/usecases/OnLayoutCase.tsx +134 -0
- package/src/usecases/OnLayoutScaleCase.tsx +88 -0
- package/src/usecases/OnLayoutStressCase.tsx +353 -0
- package/src/usecases/OpacityModifierCase.tsx +113 -0
- package/src/usecases/OverlayStyled.tsx +66 -0
- package/src/usecases/ParagraphSpanFontInheritance.tsx +53 -0
- package/src/usecases/PlaceholderTextColor.tsx +20 -0
- package/src/usecases/PointerEventsCase.tsx +100 -0
- package/src/usecases/PopoverAndMenuMultiTriggerCase.tsx +138 -0
- package/src/usecases/PopoverCase.tsx +222 -0
- package/src/usecases/PopoverContentStyledPlusAnimations.tsx +44 -0
- package/src/usecases/PopoverFocusScopeCase.tsx +171 -0
- package/src/usecases/PopoverHoverableCase.tsx +167 -0
- package/src/usecases/PopoverHoverableDisableClickCase.tsx +118 -0
- package/src/usecases/PopoverHoverableRapidCase.tsx +103 -0
- package/src/usecases/PopoverHoverableScopedCase.tsx +135 -0
- package/src/usecases/PopoverScopedCase.tsx +76 -0
- package/src/usecases/PopoverTriggerIsolationCase.tsx +80 -0
- package/src/usecases/PressStyleNative.tsx +143 -0
- package/src/usecases/PseudoStyleMerge.tsx +25 -0
- package/src/usecases/PseudoTransitionCase.tsx +174 -0
- package/src/usecases/RawAnimatedValueCase.tsx +231 -0
- package/src/usecases/RemoveScrollCase.tsx +66 -0
- package/src/usecases/RenderPropCase.tsx +263 -0
- package/src/usecases/SafeAreaCase.tsx +236 -0
- package/src/usecases/ScrollViewRefCase.tsx +88 -0
- package/src/usecases/SecondPage.tsx +5 -0
- package/src/usecases/SelectAndroidOnPress.tsx +129 -0
- package/src/usecases/SelectFocusScopeCase.tsx +270 -0
- package/src/usecases/SelectRemount.tsx +136 -0
- package/src/usecases/Shadows.tsx +5 -0
- package/src/usecases/SheetAnimationCase.tsx +155 -0
- package/src/usecases/SheetDragCase.tsx +183 -0
- package/src/usecases/SheetDragResistCase.tsx +433 -0
- package/src/usecases/SheetDragResistCase.web.tsx +359 -0
- package/src/usecases/SheetKeyboardDragCase.tsx +328 -0
- package/src/usecases/SheetKeyboardFitContentCase.tsx +165 -0
- package/src/usecases/SheetOnAnimationCompleteCase.tsx +54 -0
- package/src/usecases/SheetScrollLockCase.tsx +166 -0
- package/src/usecases/SheetScrollableDrag.tsx +249 -0
- package/src/usecases/SheetSnapPointsFitCase.tsx +393 -0
- package/src/usecases/ShorthandVariables.tsx +49 -0
- package/src/usecases/SlowThemeReRender.tsx +48 -0
- package/src/usecases/SpinnerCustomColors.tsx +34 -0
- package/src/usecases/StackZIndex.tsx +82 -0
- package/src/usecases/StressPage.tsx +301 -0
- package/src/usecases/StylePlatform.tsx +30 -0
- package/src/usecases/StyleProp.tsx +29 -0
- package/src/usecases/StyledAnchor.tsx +27 -0
- package/src/usecases/StyledButtonAnimationAuto.tsx +99 -0
- package/src/usecases/StyledButtonTheme.tsx +63 -0
- package/src/usecases/StyledButtonVariantPseudo.tsx +25 -0
- package/src/usecases/StyledButtonVariantPseudoMerge.tsx +77 -0
- package/src/usecases/StyledCheckboxTheme.tsx +23 -0
- package/src/usecases/StyledContextColor.tsx +246 -0
- package/src/usecases/StyledContextTokens.tsx +147 -0
- package/src/usecases/StyledHOCNamed.tsx +20 -0
- package/src/usecases/StyledHtmlCase.tsx +144 -0
- package/src/usecases/StyledIconColor.tsx +19 -0
- package/src/usecases/StyledInputFocusStyle.tsx +21 -0
- package/src/usecases/StyledInputOnFocus.tsx +30 -0
- package/src/usecases/StyledMediaQueryMerge.tsx +95 -0
- package/src/usecases/StyledOverridePsuedo.tsx +26 -0
- package/src/usecases/StyledRNW.tsx +61 -0
- package/src/usecases/StyledStyleableInputOnFocus.tsx +34 -0
- package/src/usecases/StyledStyleableInputVariant.tsx +48 -0
- package/src/usecases/StyledStyledStyleableInputOnFocus.tsx +36 -0
- package/src/usecases/StyledVariantTextColor.tsx +25 -0
- package/src/usecases/StyledViewOnFocus.tsx +32 -0
- package/src/usecases/TabHoverAnimationCase.tsx +212 -0
- package/src/usecases/TextNestedInheritance.tsx +80 -0
- package/src/usecases/ThemeChange.tsx +100 -0
- package/src/usecases/ThemeChangeBasic.tsx +52 -0
- package/src/usecases/ThemeComponentResolution.tsx +119 -0
- package/src/usecases/ThemeConditionalName.tsx +31 -0
- package/src/usecases/ThemeMediaAnimationCase.tsx +39 -0
- package/src/usecases/ThemeMutation.tsx +86 -0
- package/src/usecases/ThemeNested.tsx +103 -0
- package/src/usecases/ThemeReset.tsx +62 -0
- package/src/usecases/ThemeShallowCase.tsx +83 -0
- package/src/usecases/ToastCase.tsx +46 -0
- package/src/usecases/ToggleGroupActiveProps.tsx +40 -0
- package/src/usecases/ToggleGroupXGroupCase.tsx +104 -0
- package/src/usecases/TooltipAnimationCase.tsx +99 -0
- package/src/usecases/TooltipCase.tsx +32 -0
- package/src/usecases/TooltipGlobalPatternCase.tsx +83 -0
- package/src/usecases/TooltipGroupCase.tsx +102 -0
- package/src/usecases/TooltipMultiTriggerCase.tsx +88 -0
- package/src/usecases/TooltipPositionJumpCase.tsx +91 -0
- package/src/usecases/TooltipTriggerInlineCase.tsx +60 -0
- package/src/usecases/TransformMediaQueryMerge.tsx +98 -0
- package/src/usecases/UseCases.tsx +409 -0
- package/src/usecases/UseTheme.tsx +41 -0
- package/src/usecases/V5ThemeBuilderOutput.tsx +231 -0
- package/src/usecases/VariantFontFamily.tsx +25 -0
- package/src/usecases/VariantsOrder.tsx +117 -0
- package/src/usecases/ZIndex.tsx +155 -0
- package/src/usecases/helpers.tsx +44 -0
- package/src/usecases/index.native.ts +122 -0
- package/src/usecases/index.ts +3 -0
- package/src/usecases/index.web.ts +177 -0
- package/tests/AnimatePresenceEnterExit.animated.test.tsx +176 -0
- package/tests/AnimatedByProp.animated.test.tsx +138 -0
- package/tests/AnimationBehavior.animated.test.tsx +543 -0
- package/tests/AnimationTiming.animated.test.tsx +195 -0
- package/tests/AnimationsWithMediaQueries.animated.test.tsx +154 -0
- package/tests/BuildAButton.test.tsx +87 -0
- package/tests/ButtonCircular.test.tsx +17 -0
- package/tests/ButtonCustom.test.tsx +17 -0
- package/tests/ButtonIconColor.test.tsx +23 -0
- package/tests/ButtonUnstyled.test.tsx +56 -0
- package/tests/ClickDuringEnter.animated.test.tsx +174 -0
- package/tests/ColorTokenFallback.test.tsx +45 -0
- package/tests/DOMNodeAPIs.test.tsx +161 -0
- package/tests/DialogFocusScope.animated.test.tsx +309 -0
- package/tests/DialogNested.test.tsx +128 -0
- package/tests/DialogOpenControlled.test.tsx +42 -0
- package/tests/DialogPointerEvents.animated.test.tsx +108 -0
- package/tests/DialogScoped.test.tsx +137 -0
- package/tests/DialogSheetAdapt.test.tsx +68 -0
- package/tests/DialogSheetAdaptResize.test.tsx +161 -0
- package/tests/DismissLayerStacking.test.tsx +292 -0
- package/tests/DriverDisableAnimationProps.animated.test.tsx +157 -0
- package/tests/ExitCompletion.animated.test.tsx +425 -0
- package/tests/ExitTimingCheck.animated.test.ts +34 -0
- package/tests/FocusVisibleButton.test.tsx +41 -0
- package/tests/FocusVisibleButtonPointerFocus.test.tsx +23 -0
- package/tests/FocusVisibleButtonPointerFocusWithFocusStyle.test.tsx +40 -0
- package/tests/FocusWithinStyle.animated.test.tsx +66 -0
- package/tests/FocusWithinStyle.test.tsx +60 -0
- package/tests/FormButtonType.test.tsx +42 -0
- package/tests/GlobalScopedTriggerIsolation.test.tsx +89 -0
- package/tests/GroupHoverMobile.test.tsx +52 -0
- package/tests/GroupPressInVariant.test.tsx +82 -0
- package/tests/GroupProp.test.tsx +30 -0
- package/tests/GroupPseudoVariantOverride.test.tsx +57 -0
- package/tests/GroupUseCases.test.tsx +111 -0
- package/tests/GuiSiteMotion.test.ts +481 -0
- package/tests/HeightMediaQueryOverride.test.tsx +112 -0
- package/tests/InputAutoFocusAfterMenu.test.tsx +55 -0
- package/tests/InputAutoFocusStyled.test.tsx +22 -0
- package/tests/ListItem.test.tsx +129 -0
- package/tests/MediaQueriesV5.test.tsx +113 -0
- package/tests/MediaQueryGtMd.test.tsx +84 -0
- package/tests/MenuAboveDialog.test.tsx +108 -0
- package/tests/MenuAccessibility.test.tsx +346 -0
- package/tests/MenuAnimatePosition.animated.test.tsx +57 -0
- package/tests/MenuArrowAnimatePresence.animated.test.tsx +71 -0
- package/tests/MenuAsChildPosition.test.tsx +16 -0
- package/tests/MenuAutoResize.test.tsx +54 -0
- package/tests/MenuFocusLeave.test.tsx +181 -0
- package/tests/MenuHighlight.test.tsx +165 -0
- package/tests/MenuHoverKeyboardBugs.test.tsx +252 -0
- package/tests/MenuItemFocus.test.tsx +59 -0
- package/tests/MenuItemPseudoOverride.test.tsx +231 -0
- package/tests/MenuMultiTrigger.test.tsx +101 -0
- package/tests/MenuOverflow.test.tsx +93 -0
- package/tests/MenuStayInFrame.test.tsx +102 -0
- package/tests/MenuSubKeyboardFocus.test.tsx +220 -0
- package/tests/MenuSubLeftSafePolygon.test.tsx +88 -0
- package/tests/MenuSubNestedPosition.test.tsx +48 -0
- package/tests/MenuSubSafePolygon.test.tsx +97 -0
- package/tests/MenuSubStyled.test.tsx +40 -0
- package/tests/MenuTheme.test.tsx +34 -0
- package/tests/MenuUnstyled.test.tsx +56 -0
- package/tests/MultiDriverAnimation.test.tsx +207 -0
- package/tests/NewInputBasic.test.tsx +50 -0
- package/tests/NewInputEvents.test.tsx +55 -0
- package/tests/OnLayout.test.tsx +163 -0
- package/tests/OnLayoutScale.test.tsx +100 -0
- package/tests/OnLayoutStress.test.tsx +304 -0
- package/tests/ParagraphSpanFontInheritance.test.tsx +73 -0
- package/tests/PointerEvents.test.tsx +123 -0
- package/tests/Popover.animated.test.tsx +234 -0
- package/tests/PopoverAndMenuMultiTrigger.test.tsx +184 -0
- package/tests/PopoverAnimatePosition.animated.test.tsx +51 -0
- package/tests/PopoverClickDuringEnter.animated.test.tsx +197 -0
- package/tests/PopoverFocusScope.test.tsx +242 -0
- package/tests/PopoverHoverable.test.tsx +383 -0
- package/tests/PopoverHoverableDisableClick.test.tsx +106 -0
- package/tests/PopoverHoverableRapid.test.tsx +129 -0
- package/tests/PopoverHoverableReposition.test.tsx +111 -0
- package/tests/PopoverHoverableScoped.animated.test.tsx +103 -0
- package/tests/PopoverHoverableStress.test.tsx +169 -0
- package/tests/PopoverInitialPosition.animated.test.tsx +82 -0
- package/tests/PopoverMiddlewareSkipRegression.animated.test.tsx +221 -0
- package/tests/PopoverScoped.test.tsx +128 -0
- package/tests/PopoverScopedPositionGlitch.animated.test.tsx +184 -0
- package/tests/PopoverTriggerIsolation.test.tsx +62 -0
- package/tests/PseudoTransition.animated.test.tsx +319 -0
- package/tests/RawAnimatedValue.test.tsx +147 -0
- package/tests/RemoveScroll.test.tsx +223 -0
- package/tests/RenderProp.test.tsx +293 -0
- package/tests/ScrollViewRef.test.tsx +39 -0
- package/tests/SelectClickHold.test.tsx +147 -0
- package/tests/SelectFocusScope.test.tsx +176 -0
- package/tests/SelectInnerPositioning.test.tsx +82 -0
- package/tests/SelectKeyboardNav.test.tsx +173 -0
- package/tests/SelectPositioning.test.tsx +56 -0
- package/tests/SelectTypeahead.test.tsx +63 -0
- package/tests/Shadows.test.tsx +14 -0
- package/tests/SheetAnimation.animated.test.tsx +413 -0
- package/tests/SheetDrag.animated.test.tsx +223 -0
- package/tests/SheetDragResist.animated.test.tsx +393 -0
- package/tests/SheetOnAnimationComplete.animated.test.tsx +62 -0
- package/tests/SheetScrollLock.animated.test.tsx +287 -0
- package/tests/SheetScrollableDrag.animated.test.tsx +1264 -0
- package/tests/SheetSnapPointsFit.animated.test.tsx +259 -0
- package/tests/ShorthandVariables.test.tsx +44 -0
- package/tests/SpinnerCustomColors.test.tsx +67 -0
- package/tests/StackZIndex.test.tsx +51 -0
- package/tests/StressPagePerf.test.tsx +76 -0
- package/tests/StylePlatform.test.tsx +38 -0
- package/tests/StyleProp.test.tsx +20 -0
- package/tests/StyledAnchor.test.tsx +17 -0
- package/tests/StyledButtonTheme.test.tsx +22 -0
- package/tests/StyledButtonVariantPseudo.test.tsx +20 -0
- package/tests/StyledButtonVariantPseudoMerge.animated.test.tsx +33 -0
- package/tests/StyledCheckboxTheme.test.tsx +16 -0
- package/tests/StyledContextColor.test.tsx +119 -0
- package/tests/StyledContextTokens.test.tsx +56 -0
- package/tests/StyledHOCNamed.test.tsx +16 -0
- package/tests/StyledHtml.test.tsx +161 -0
- package/tests/StyledIconColor.test.tsx +32 -0
- package/tests/StyledInputFocusStyle.test.tsx +19 -0
- package/tests/StyledInputOnFocus.test.tsx +27 -0
- package/tests/StyledMediaQueryMerge.test.tsx +66 -0
- package/tests/StyledRNW.test.tsx +17 -0
- package/tests/StyledStyleableInputOnFocus.test.tsx +27 -0
- package/tests/StyledStyleableInputVariant.test.tsx +22 -0
- package/tests/StyledStyledStyleableInputOnFocus.test.tsx +27 -0
- package/tests/StyledVariantTextColor.test.tsx +24 -0
- package/tests/StyledViewOnFocus.test.tsx +27 -0
- package/tests/TabHoverAnimation.animated.test.tsx +468 -0
- package/tests/TabHoverPositionSmooth.animated.test.tsx +129 -0
- package/tests/TextNestedInheritance.test.tsx +93 -0
- package/tests/ThemeChange.test.tsx +70 -0
- package/tests/ThemeComponentResolution.test.tsx +82 -0
- package/tests/ThemeConditionalName.test.tsx +34 -0
- package/tests/ThemeMediaAnimation.test.tsx +65 -0
- package/tests/ThemeNested.test.tsx +141 -0
- package/tests/ThemeReset.test.tsx +63 -0
- package/tests/ThemeShallow.test.tsx +95 -0
- package/tests/Toast.test.tsx +106 -0
- package/tests/ToggleGroup.test.tsx +61 -0
- package/tests/ToggleGroupActiveProps.test.tsx +38 -0
- package/tests/ToggleGroupXGroup.test.tsx +172 -0
- package/tests/TooltipAnimation.animated.test.tsx +260 -0
- package/tests/TooltipEnterInterrupt.animated.test.tsx +76 -0
- package/tests/TooltipGlobalPattern.animated.test.tsx +208 -0
- package/tests/TooltipGroup.animated.test.tsx +79 -0
- package/tests/TooltipMultiTrigger.test.tsx +116 -0
- package/tests/TooltipPositionJump.animated.test.tsx +229 -0
- package/tests/TooltipPositionJumpNotes.md +219 -0
- package/tests/TooltipRapidSwitch.animated.test.tsx +399 -0
- package/tests/TooltipTriggerInline.test.tsx +65 -0
- package/tests/TransformMediaQueryMerge.test.tsx +104 -0
- package/tests/TransitionEnterExit.animated.test.tsx +311 -0
- package/tests/UseTheme.test.tsx +16 -0
- package/tests/V5ThemeBuilderOutput.test.tsx +164 -0
- package/tests/VariantFontFamily.test.tsx +11 -0
- package/tests/VariantsOrder.test.tsx +53 -0
- package/tests/_debug_position.mjs +52 -0
- package/tests/test-utils.ts +106 -0
- package/tests/utils.tsx +54 -0
- package/tsconfig.json +45 -0
- package/vite-env.d.ts +1 -0
- package/vite.config.ts +14 -0
- package/webpack.config.js +139 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import {
|
|
2
|
+
View,
|
|
3
|
+
Tooltip as GuiTooltip,
|
|
4
|
+
Text,
|
|
5
|
+
Theme,
|
|
6
|
+
styled,
|
|
7
|
+
withStaticProperties,
|
|
8
|
+
} from '@hanzo/gui'
|
|
9
|
+
|
|
10
|
+
const StyledTooltip = styled(GuiTooltip, {
|
|
11
|
+
delay: 0,
|
|
12
|
+
restMs: 0,
|
|
13
|
+
allowFlip: true,
|
|
14
|
+
stayInFrame: {
|
|
15
|
+
mainAxis: true,
|
|
16
|
+
},
|
|
17
|
+
placement: 'top',
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
export const Tooltip = withStaticProperties(StyledTooltip, {
|
|
21
|
+
...GuiTooltip,
|
|
22
|
+
Content: styled(GuiTooltip.Content, {
|
|
23
|
+
padding: 0,
|
|
24
|
+
px: 8,
|
|
25
|
+
zIndex: 1_000_000,
|
|
26
|
+
rounded: 6,
|
|
27
|
+
bg: '$color1',
|
|
28
|
+
enterStyle: { x: 0, y: 5, opacity: 0, scale: 0.9 },
|
|
29
|
+
exitStyle: { x: 0, y: 5, opacity: 0, scale: 0.9 },
|
|
30
|
+
scale: 1,
|
|
31
|
+
x: 0,
|
|
32
|
+
y: 0,
|
|
33
|
+
opacity: 1,
|
|
34
|
+
transition: [
|
|
35
|
+
'quick',
|
|
36
|
+
{
|
|
37
|
+
opacity: {
|
|
38
|
+
overshootClamping: true,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
}),
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
const TriggerText = styled(Text, {
|
|
46
|
+
fontFamily: '$body',
|
|
47
|
+
bg: '$color3',
|
|
48
|
+
p: '$3',
|
|
49
|
+
color: '$color10',
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
export function CustomStyledAnimatedTooltip() {
|
|
53
|
+
return (
|
|
54
|
+
<View flex={1} items="center" justify="center" gap="$5">
|
|
55
|
+
<View theme="red">
|
|
56
|
+
<Tooltip>
|
|
57
|
+
<Tooltip.Trigger>
|
|
58
|
+
<TriggerText>No animation with styled()</TriggerText>
|
|
59
|
+
</Tooltip.Trigger>
|
|
60
|
+
|
|
61
|
+
<Theme name="accent">
|
|
62
|
+
<Tooltip.Content>
|
|
63
|
+
<Text theme="red" color="$color11">
|
|
64
|
+
Hey there!
|
|
65
|
+
</Text>
|
|
66
|
+
</Tooltip.Content>
|
|
67
|
+
</Theme>
|
|
68
|
+
</Tooltip>
|
|
69
|
+
</View>
|
|
70
|
+
</View>
|
|
71
|
+
)
|
|
72
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from 'react'
|
|
2
|
+
import { ScrollView, Text, View, YStack, XStack, Input } from '@hanzo/gui'
|
|
3
|
+
|
|
4
|
+
// exercises the RN 0.82 DOM Node APIs through hanzo-gui component refs
|
|
5
|
+
// on web these are native DOM APIs, on native they're the new DOM-compatible shim
|
|
6
|
+
|
|
7
|
+
type Results = Record<string, string>
|
|
8
|
+
|
|
9
|
+
export function DOMNodeAPIs() {
|
|
10
|
+
const parentRef = useRef<HTMLElement>(null)
|
|
11
|
+
const childARef = useRef<HTMLElement>(null)
|
|
12
|
+
const childBRef = useRef<HTMLElement>(null)
|
|
13
|
+
const textRef = useRef<HTMLElement>(null)
|
|
14
|
+
const scrollRef = useRef<HTMLElement>(null)
|
|
15
|
+
const inputRef = useRef<HTMLElement>(null)
|
|
16
|
+
const [results, setResults] = useState<Results>({})
|
|
17
|
+
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
// wait a frame so layout is settled
|
|
20
|
+
requestAnimationFrame(() => {
|
|
21
|
+
const parent = parentRef.current
|
|
22
|
+
const childA = childARef.current
|
|
23
|
+
const childB = childBRef.current
|
|
24
|
+
const textEl = textRef.current
|
|
25
|
+
const scrollEl = scrollRef.current
|
|
26
|
+
const inputEl = inputRef.current
|
|
27
|
+
|
|
28
|
+
if (!parent || !childA || !childB || !textEl || !scrollEl || !inputEl) {
|
|
29
|
+
setResults({ error: 'refs not attached' })
|
|
30
|
+
return
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const r: Results = {}
|
|
34
|
+
|
|
35
|
+
// tree traversal
|
|
36
|
+
r['parentNode-exists'] = String(!!childA.parentNode)
|
|
37
|
+
r['parentElement-exists'] = String(!!childA.parentElement)
|
|
38
|
+
r['parent-contains-childA'] = String(parent.contains(childA))
|
|
39
|
+
r['parent-contains-childB'] = String(parent.contains(childB))
|
|
40
|
+
r['childA-contains-parent'] = String(childA.contains(parent))
|
|
41
|
+
r['hasChildNodes'] = String(parent.hasChildNodes())
|
|
42
|
+
r['childNodes-length'] = String(parent.childNodes.length)
|
|
43
|
+
r['children-length'] = String(parent.children.length)
|
|
44
|
+
r['firstChild-exists'] = String(!!parent.firstChild)
|
|
45
|
+
r['lastChild-exists'] = String(!!parent.lastChild)
|
|
46
|
+
r['firstElementChild-exists'] = String(!!parent.firstElementChild)
|
|
47
|
+
r['lastElementChild-exists'] = String(!!parent.lastElementChild)
|
|
48
|
+
|
|
49
|
+
// sibling traversal
|
|
50
|
+
r['childA-nextSibling-exists'] = String(!!childA.nextSibling)
|
|
51
|
+
r['childB-previousSibling-exists'] = String(!!childB.previousSibling)
|
|
52
|
+
r['childA-nextElementSibling-exists'] = String(!!childA.nextElementSibling)
|
|
53
|
+
r['childB-previousElementSibling-exists'] = String(!!childB.previousElementSibling)
|
|
54
|
+
|
|
55
|
+
// getBoundingClientRect
|
|
56
|
+
const rect = parent.getBoundingClientRect()
|
|
57
|
+
r['rect-has-width'] = String(rect.width > 0)
|
|
58
|
+
r['rect-has-height'] = String(rect.height > 0)
|
|
59
|
+
r['rect-has-x'] = String(typeof rect.x === 'number')
|
|
60
|
+
r['rect-has-y'] = String(typeof rect.y === 'number')
|
|
61
|
+
r['rect-has-top'] = String(typeof rect.top === 'number')
|
|
62
|
+
r['rect-has-left'] = String(typeof rect.left === 'number')
|
|
63
|
+
r['rect-has-right'] = String(typeof rect.right === 'number')
|
|
64
|
+
r['rect-has-bottom'] = String(typeof rect.bottom === 'number')
|
|
65
|
+
|
|
66
|
+
// document access
|
|
67
|
+
r['ownerDocument-exists'] = String(!!parent.ownerDocument)
|
|
68
|
+
r['isConnected'] = String(parent.isConnected)
|
|
69
|
+
|
|
70
|
+
// getElementById via ownerDocument
|
|
71
|
+
r['getElementById-works'] = String(
|
|
72
|
+
!!parent.ownerDocument.getElementById('dom-node-childA')
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
// compareDocumentPosition
|
|
76
|
+
const pos = parent.compareDocumentPosition(childA)
|
|
77
|
+
// DOCUMENT_POSITION_CONTAINED_BY = 16, DOCUMENT_POSITION_FOLLOWING = 4
|
|
78
|
+
r['compareDocumentPosition-contained'] = String((pos & 16) !== 0)
|
|
79
|
+
|
|
80
|
+
// nodeType / nodeName
|
|
81
|
+
r['parent-nodeType'] = String(parent.nodeType)
|
|
82
|
+
r['parent-nodeName-exists'] = String(!!parent.nodeName)
|
|
83
|
+
|
|
84
|
+
// textContent
|
|
85
|
+
r['text-textContent'] = textEl.textContent || ''
|
|
86
|
+
|
|
87
|
+
// offset properties
|
|
88
|
+
r['offsetWidth-positive'] = String(parent.offsetWidth > 0)
|
|
89
|
+
r['offsetHeight-positive'] = String(parent.offsetHeight > 0)
|
|
90
|
+
r['offsetParent-exists'] = String(!!parent.offsetParent)
|
|
91
|
+
|
|
92
|
+
// client properties
|
|
93
|
+
r['clientWidth-positive'] = String(parent.clientWidth > 0)
|
|
94
|
+
r['clientHeight-positive'] = String(parent.clientHeight > 0)
|
|
95
|
+
|
|
96
|
+
// childElementCount
|
|
97
|
+
r['childElementCount'] = String(parent.childElementCount)
|
|
98
|
+
|
|
99
|
+
// getRootNode
|
|
100
|
+
r['getRootNode-exists'] = String(!!parent.getRootNode())
|
|
101
|
+
|
|
102
|
+
// focus/blur (just verify they exist and don't throw)
|
|
103
|
+
try {
|
|
104
|
+
inputEl.focus()
|
|
105
|
+
r['focus-works'] = String(document.activeElement === inputEl)
|
|
106
|
+
inputEl.blur()
|
|
107
|
+
r['blur-works'] = String(document.activeElement !== inputEl)
|
|
108
|
+
} catch {
|
|
109
|
+
r['focus-works'] = 'false'
|
|
110
|
+
r['blur-works'] = 'false'
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
setResults(r)
|
|
114
|
+
})
|
|
115
|
+
}, [])
|
|
116
|
+
|
|
117
|
+
return (
|
|
118
|
+
<YStack padding="$4" gap="$2">
|
|
119
|
+
<View ref={parentRef as any} id="dom-node-parent" gap="$2">
|
|
120
|
+
<View
|
|
121
|
+
ref={childARef as any}
|
|
122
|
+
id="dom-node-childA"
|
|
123
|
+
width={100}
|
|
124
|
+
height={50}
|
|
125
|
+
backgroundColor="$blue5"
|
|
126
|
+
/>
|
|
127
|
+
<View
|
|
128
|
+
ref={childBRef as any}
|
|
129
|
+
id="dom-node-childB"
|
|
130
|
+
width={100}
|
|
131
|
+
height={50}
|
|
132
|
+
backgroundColor="$red5"
|
|
133
|
+
/>
|
|
134
|
+
<Text ref={textRef as any} id="dom-node-text">
|
|
135
|
+
hello dom
|
|
136
|
+
</Text>
|
|
137
|
+
<ScrollView ref={scrollRef as any} id="dom-node-scroll" height={60}>
|
|
138
|
+
<View height={200} />
|
|
139
|
+
</ScrollView>
|
|
140
|
+
<Input ref={inputRef as any} id="dom-node-input" placeholder="focusable" />
|
|
141
|
+
</View>
|
|
142
|
+
|
|
143
|
+
<YStack id="dom-node-results" gap="$1" paddingTop="$4">
|
|
144
|
+
{Object.entries(results).map(([key, value]) => (
|
|
145
|
+
<XStack key={key} gap="$2">
|
|
146
|
+
<Text fontSize="$2" fontFamily="$mono" data-testid={`result-${key}`}>
|
|
147
|
+
{key}={value}
|
|
148
|
+
</Text>
|
|
149
|
+
</XStack>
|
|
150
|
+
))}
|
|
151
|
+
</YStack>
|
|
152
|
+
</YStack>
|
|
153
|
+
)
|
|
154
|
+
}
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import { Button, Dialog, Input, Label, XStack, YStack } from '@hanzo/gui'
|
|
2
|
+
|
|
3
|
+
export function DialogFocusScopeCase() {
|
|
4
|
+
return (
|
|
5
|
+
<YStack padding="$4" gap="$4">
|
|
6
|
+
{/* Modal Dialog - Should trap focus */}
|
|
7
|
+
<Dialog modal>
|
|
8
|
+
<Dialog.Trigger asChild>
|
|
9
|
+
<Button data-testid="modal-dialog-trigger">Open Modal Dialog</Button>
|
|
10
|
+
</Dialog.Trigger>
|
|
11
|
+
<DialogContent
|
|
12
|
+
testId="modal"
|
|
13
|
+
title="Modal Dialog (Focus Trapped)"
|
|
14
|
+
description="Focus should be trapped within this dialog. Tab key should cycle through elements."
|
|
15
|
+
/>
|
|
16
|
+
</Dialog>
|
|
17
|
+
|
|
18
|
+
{/* Non-Modal Dialog - Should NOT trap focus */}
|
|
19
|
+
<Dialog modal={false}>
|
|
20
|
+
<Dialog.Trigger asChild>
|
|
21
|
+
<Button data-testid="non-modal-dialog-trigger">Open Non-Modal Dialog</Button>
|
|
22
|
+
</Dialog.Trigger>
|
|
23
|
+
<DialogContent
|
|
24
|
+
testId="non-modal"
|
|
25
|
+
title="Non-Modal Dialog (Focus Not Trapped)"
|
|
26
|
+
description="Focus can leave this dialog. Click outside to close."
|
|
27
|
+
/>
|
|
28
|
+
</Dialog>
|
|
29
|
+
|
|
30
|
+
{/* Nested Dialogs */}
|
|
31
|
+
<Dialog modal>
|
|
32
|
+
<Dialog.Trigger asChild>
|
|
33
|
+
<Button data-testid="parent-dialog-trigger">
|
|
34
|
+
Open Dialog with Nested Dialog
|
|
35
|
+
</Button>
|
|
36
|
+
</Dialog.Trigger>
|
|
37
|
+
<Dialog.Portal>
|
|
38
|
+
<Dialog.Overlay
|
|
39
|
+
key="parent-overlay"
|
|
40
|
+
transition="quick"
|
|
41
|
+
opacity={0.5}
|
|
42
|
+
enterStyle={{ opacity: 0 }}
|
|
43
|
+
exitStyle={{ opacity: 0 }}
|
|
44
|
+
/>
|
|
45
|
+
<Dialog.Content
|
|
46
|
+
key="parent-content"
|
|
47
|
+
bordered
|
|
48
|
+
elevate
|
|
49
|
+
transition={[
|
|
50
|
+
'quick',
|
|
51
|
+
{
|
|
52
|
+
opacity: {
|
|
53
|
+
overshootClamping: true,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
]}
|
|
57
|
+
enterStyle={{ x: 0, y: -20, opacity: 0, scale: 0.9 }}
|
|
58
|
+
exitStyle={{ x: 0, y: 10, opacity: 0, scale: 0.95 }}
|
|
59
|
+
width={500}
|
|
60
|
+
padding="$6"
|
|
61
|
+
gap="$4"
|
|
62
|
+
>
|
|
63
|
+
<YStack data-testid="parent-dialog-content" gap="$4">
|
|
64
|
+
<Dialog.Title>Parent Dialog</Dialog.Title>
|
|
65
|
+
<Dialog.Description>
|
|
66
|
+
This dialog contains another dialog. Focus should be managed correctly.
|
|
67
|
+
</Dialog.Description>
|
|
68
|
+
|
|
69
|
+
<YStack gap="$3">
|
|
70
|
+
<Label htmlFor="parent-input">Parent Input</Label>
|
|
71
|
+
<Input id="parent-input" placeholder="Type here..." />
|
|
72
|
+
</YStack>
|
|
73
|
+
|
|
74
|
+
{/* Nested Dialog */}
|
|
75
|
+
<Dialog modal>
|
|
76
|
+
<Dialog.Trigger asChild>
|
|
77
|
+
<Button data-testid="nested-dialog-trigger">Open Nested Dialog</Button>
|
|
78
|
+
</Dialog.Trigger>
|
|
79
|
+
<Dialog.Portal>
|
|
80
|
+
<Dialog.Overlay
|
|
81
|
+
key="nested-overlay"
|
|
82
|
+
transition="quick"
|
|
83
|
+
opacity={0.5}
|
|
84
|
+
enterStyle={{ opacity: 0 }}
|
|
85
|
+
exitStyle={{ opacity: 0 }}
|
|
86
|
+
/>
|
|
87
|
+
<Dialog.Content
|
|
88
|
+
key="nested-content"
|
|
89
|
+
bordered
|
|
90
|
+
elevate
|
|
91
|
+
transition="quick"
|
|
92
|
+
enterStyle={{ x: 0, y: -20, opacity: 0, scale: 0.9 }}
|
|
93
|
+
exitStyle={{ x: 0, y: 10, opacity: 0, scale: 0.95 }}
|
|
94
|
+
width={400}
|
|
95
|
+
padding="$6"
|
|
96
|
+
gap="$4"
|
|
97
|
+
>
|
|
98
|
+
<YStack data-testid="nested-dialog-content" gap="$4">
|
|
99
|
+
<Dialog.Title>Nested Dialog</Dialog.Title>
|
|
100
|
+
<Dialog.Description>
|
|
101
|
+
Focus should be trapped in this nested dialog.
|
|
102
|
+
</Dialog.Description>
|
|
103
|
+
|
|
104
|
+
<YStack gap="$3">
|
|
105
|
+
<Label htmlFor="nested-input">Nested Input</Label>
|
|
106
|
+
<Input
|
|
107
|
+
id="nested-input"
|
|
108
|
+
data-testid="nested-input"
|
|
109
|
+
placeholder="Focus trapped here..."
|
|
110
|
+
/>
|
|
111
|
+
</YStack>
|
|
112
|
+
|
|
113
|
+
<XStack gap="$3" justifyContent="flex-end">
|
|
114
|
+
<Dialog.Close asChild>
|
|
115
|
+
<Button data-testid="nested-close-button">Close Nested</Button>
|
|
116
|
+
</Dialog.Close>
|
|
117
|
+
</XStack>
|
|
118
|
+
</YStack>
|
|
119
|
+
</Dialog.Content>
|
|
120
|
+
</Dialog.Portal>
|
|
121
|
+
</Dialog>
|
|
122
|
+
|
|
123
|
+
<XStack gap="$3" justifyContent="flex-end">
|
|
124
|
+
<Dialog.Close asChild>
|
|
125
|
+
<Button variant="outlined" data-testid="parent-close-button">
|
|
126
|
+
Close Parent
|
|
127
|
+
</Button>
|
|
128
|
+
</Dialog.Close>
|
|
129
|
+
</XStack>
|
|
130
|
+
</YStack>
|
|
131
|
+
</Dialog.Content>
|
|
132
|
+
</Dialog.Portal>
|
|
133
|
+
</Dialog>
|
|
134
|
+
</YStack>
|
|
135
|
+
)
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function DialogContent({
|
|
139
|
+
testId,
|
|
140
|
+
title,
|
|
141
|
+
description,
|
|
142
|
+
disableOutsidePointerEvents,
|
|
143
|
+
}: {
|
|
144
|
+
testId: string
|
|
145
|
+
title: string
|
|
146
|
+
description: string
|
|
147
|
+
disableOutsidePointerEvents?: boolean
|
|
148
|
+
}) {
|
|
149
|
+
return (
|
|
150
|
+
<Dialog.Portal>
|
|
151
|
+
<Dialog.Overlay
|
|
152
|
+
key="overlay"
|
|
153
|
+
transition="quick"
|
|
154
|
+
opacity={0.5}
|
|
155
|
+
enterStyle={{ opacity: 0 }}
|
|
156
|
+
exitStyle={{ opacity: 0 }}
|
|
157
|
+
/>
|
|
158
|
+
<Dialog.Content
|
|
159
|
+
key="content"
|
|
160
|
+
bordered
|
|
161
|
+
elevate
|
|
162
|
+
disableOutsidePointerEvents={disableOutsidePointerEvents}
|
|
163
|
+
transition={[
|
|
164
|
+
'quick',
|
|
165
|
+
{
|
|
166
|
+
opacity: {
|
|
167
|
+
overshootClamping: true,
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
]}
|
|
171
|
+
enterStyle={{ x: 0, y: -20, opacity: 0, scale: 0.9 }}
|
|
172
|
+
exitStyle={{ x: 0, y: 10, opacity: 0, scale: 0.95 }}
|
|
173
|
+
width={450}
|
|
174
|
+
maxHeight="$20"
|
|
175
|
+
padding="$6"
|
|
176
|
+
gap="$4"
|
|
177
|
+
>
|
|
178
|
+
<YStack data-testid={`${testId}-dialog-content`} gap="$4">
|
|
179
|
+
<Dialog.Title>{title}</Dialog.Title>
|
|
180
|
+
<Dialog.Description>{description}</Dialog.Description>
|
|
181
|
+
|
|
182
|
+
<YStack gap="$3" render="form">
|
|
183
|
+
<YStack gap="$3">
|
|
184
|
+
<Label htmlFor={`${testId}-first`}>First Name</Label>
|
|
185
|
+
<Input
|
|
186
|
+
id={`${testId}-first`}
|
|
187
|
+
data-testid={`first-input`}
|
|
188
|
+
placeholder="Enter your first name"
|
|
189
|
+
autoComplete="given-name"
|
|
190
|
+
/>
|
|
191
|
+
</YStack>
|
|
192
|
+
|
|
193
|
+
<YStack gap="$3">
|
|
194
|
+
<Label htmlFor={`${testId}-second`}>Last Name</Label>
|
|
195
|
+
<Input
|
|
196
|
+
id={`${testId}-second`}
|
|
197
|
+
data-testid={`second-input`}
|
|
198
|
+
placeholder="Enter your last name"
|
|
199
|
+
autoComplete="family-name"
|
|
200
|
+
/>
|
|
201
|
+
</YStack>
|
|
202
|
+
|
|
203
|
+
<YStack gap="$3">
|
|
204
|
+
<Label htmlFor={`${testId}-email`}>Email</Label>
|
|
205
|
+
<Input
|
|
206
|
+
id={`${testId}-email`}
|
|
207
|
+
data-testid={`email-input`}
|
|
208
|
+
placeholder="your@email.com"
|
|
209
|
+
autoComplete="email"
|
|
210
|
+
/>
|
|
211
|
+
</YStack>
|
|
212
|
+
|
|
213
|
+
<YStack gap="$3">
|
|
214
|
+
<Label htmlFor={`${testId}-select`}>Country</Label>
|
|
215
|
+
<select
|
|
216
|
+
id={`${testId}-select`}
|
|
217
|
+
data-testid={`country-select`}
|
|
218
|
+
style={{
|
|
219
|
+
padding: '8px',
|
|
220
|
+
borderRadius: '4px',
|
|
221
|
+
border: '1px solid #ccc',
|
|
222
|
+
backgroundColor: 'transparent',
|
|
223
|
+
fontSize: '14px',
|
|
224
|
+
}}
|
|
225
|
+
>
|
|
226
|
+
<option value="">Select a country</option>
|
|
227
|
+
<option value="us">United States</option>
|
|
228
|
+
<option value="uk">United Kingdom</option>
|
|
229
|
+
<option value="ca">Canada</option>
|
|
230
|
+
</select>
|
|
231
|
+
</YStack>
|
|
232
|
+
|
|
233
|
+
<YStack gap="$3">
|
|
234
|
+
<Label htmlFor={`${testId}-textarea`}>Comments</Label>
|
|
235
|
+
<textarea
|
|
236
|
+
id={`${testId}-textarea`}
|
|
237
|
+
data-testid={`comments-textarea`}
|
|
238
|
+
placeholder="Additional comments..."
|
|
239
|
+
rows={3}
|
|
240
|
+
style={{
|
|
241
|
+
padding: '8px',
|
|
242
|
+
borderRadius: '4px',
|
|
243
|
+
border: '1px solid #ccc',
|
|
244
|
+
backgroundColor: 'transparent',
|
|
245
|
+
fontSize: '14px',
|
|
246
|
+
resize: 'vertical',
|
|
247
|
+
}}
|
|
248
|
+
/>
|
|
249
|
+
</YStack>
|
|
250
|
+
|
|
251
|
+
<XStack gap="$3" alignItems="center">
|
|
252
|
+
<input
|
|
253
|
+
type="checkbox"
|
|
254
|
+
id={`${testId}-checkbox`}
|
|
255
|
+
data-testid={`terms-checkbox`}
|
|
256
|
+
/>
|
|
257
|
+
<Label htmlFor={`${testId}-checkbox`} size="$3">
|
|
258
|
+
I agree to the terms and conditions
|
|
259
|
+
</Label>
|
|
260
|
+
</XStack>
|
|
261
|
+
</YStack>
|
|
262
|
+
|
|
263
|
+
<XStack gap="$3" justifyContent="flex-end">
|
|
264
|
+
<Dialog.Close asChild>
|
|
265
|
+
<Button variant="outlined" data-testid={`cancel-button`}>
|
|
266
|
+
Cancel
|
|
267
|
+
</Button>
|
|
268
|
+
</Dialog.Close>
|
|
269
|
+
<Button theme="blue" data-testid={`save-button`}>
|
|
270
|
+
Save Changes
|
|
271
|
+
</Button>
|
|
272
|
+
</XStack>
|
|
273
|
+
</YStack>
|
|
274
|
+
</Dialog.Content>
|
|
275
|
+
</Dialog.Portal>
|
|
276
|
+
)
|
|
277
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { Button, Dialog, Input, YStack } from '@hanzo/gui'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
export function DialogFocusScopeDebug() {
|
|
5
|
+
const [open, setOpen] = React.useState(false)
|
|
6
|
+
|
|
7
|
+
React.useEffect(() => {
|
|
8
|
+
// Log focus changes
|
|
9
|
+
const handleFocus = (e: FocusEvent) => {
|
|
10
|
+
console.info(
|
|
11
|
+
'[DEBUG] Focus changed to:',
|
|
12
|
+
e.target,
|
|
13
|
+
(e.target as any)?.tagName,
|
|
14
|
+
(e.target as any)?.id
|
|
15
|
+
)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
document.addEventListener('focusin', handleFocus, true)
|
|
19
|
+
return () => document.removeEventListener('focusin', handleFocus, true)
|
|
20
|
+
}, [])
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<YStack padding="$4" gap="$4">
|
|
24
|
+
<Button
|
|
25
|
+
onPress={() => {
|
|
26
|
+
console.info('[DEBUG] Opening dialog')
|
|
27
|
+
setOpen(true)
|
|
28
|
+
}}
|
|
29
|
+
>
|
|
30
|
+
Open Dialog (Check Console)
|
|
31
|
+
</Button>
|
|
32
|
+
|
|
33
|
+
<Dialog open={open} onOpenChange={setOpen} modal>
|
|
34
|
+
<Dialog.Portal>
|
|
35
|
+
<Dialog.Overlay
|
|
36
|
+
key="overlay"
|
|
37
|
+
transition="quick"
|
|
38
|
+
opacity={0.5}
|
|
39
|
+
enterStyle={{ opacity: 0 }}
|
|
40
|
+
exitStyle={{ opacity: 0 }}
|
|
41
|
+
/>
|
|
42
|
+
<Dialog.Content
|
|
43
|
+
key="content"
|
|
44
|
+
bordered
|
|
45
|
+
elevate
|
|
46
|
+
transition={[
|
|
47
|
+
'quick',
|
|
48
|
+
{
|
|
49
|
+
opacity: {
|
|
50
|
+
overshootClamping: true,
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
]}
|
|
54
|
+
enterStyle={{ x: 0, y: -20, opacity: 0, scale: 0.9 }}
|
|
55
|
+
exitStyle={{ x: 0, y: 10, opacity: 0, scale: 0.95 }}
|
|
56
|
+
width={400}
|
|
57
|
+
padding="$6"
|
|
58
|
+
gap="$4"
|
|
59
|
+
>
|
|
60
|
+
<YStack gap="$4">
|
|
61
|
+
<Dialog.Title>Debug Dialog</Dialog.Title>
|
|
62
|
+
<Dialog.Description>Check console for focus logs</Dialog.Description>
|
|
63
|
+
|
|
64
|
+
<Input
|
|
65
|
+
id="test-input-1"
|
|
66
|
+
placeholder="First input - should auto-focus"
|
|
67
|
+
onFocus={() => console.info('[DEBUG] First input focused')}
|
|
68
|
+
/>
|
|
69
|
+
|
|
70
|
+
<Input
|
|
71
|
+
id="test-input-2"
|
|
72
|
+
placeholder="Second input"
|
|
73
|
+
onFocus={() => console.info('[DEBUG] Second input focused')}
|
|
74
|
+
/>
|
|
75
|
+
|
|
76
|
+
<Dialog.Close asChild>
|
|
77
|
+
<Button>Close</Button>
|
|
78
|
+
</Dialog.Close>
|
|
79
|
+
</YStack>
|
|
80
|
+
</Dialog.Content>
|
|
81
|
+
</Dialog.Portal>
|
|
82
|
+
</Dialog>
|
|
83
|
+
</YStack>
|
|
84
|
+
)
|
|
85
|
+
}
|