@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,231 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Button,
|
|
3
|
+
Card,
|
|
4
|
+
H2,
|
|
5
|
+
H3,
|
|
6
|
+
H4,
|
|
7
|
+
Paragraph,
|
|
8
|
+
Text,
|
|
9
|
+
Theme,
|
|
10
|
+
XStack,
|
|
11
|
+
YStack,
|
|
12
|
+
} from '@hanzo/gui'
|
|
13
|
+
|
|
14
|
+
import { TEST_IDS } from '../constants/test-ids'
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Visual test for v5 theme builder output.
|
|
18
|
+
*
|
|
19
|
+
* Tests the documented usage patterns from the docs:
|
|
20
|
+
* 1. <Theme name="accent"> wrapping components (docs: theme-builder.mdx)
|
|
21
|
+
* 2. <Button theme="accent"> component prop (docs: config-v5.mdx)
|
|
22
|
+
* 3. $accentBackground / $accentColor tokens (docs: config-v5.mdx)
|
|
23
|
+
* 4. $accent1-$accent12 raw tokens
|
|
24
|
+
*
|
|
25
|
+
* Open in browser: http://localhost:9000/?test=V5ThemeBuilderOutput&generatedV5=true
|
|
26
|
+
*/
|
|
27
|
+
export function V5ThemeBuilderOutput() {
|
|
28
|
+
return (
|
|
29
|
+
<YStack gap="$6" padding="$6" backgroundColor="$background">
|
|
30
|
+
<YStack gap="$2">
|
|
31
|
+
<H2>V5 Theme Builder - Accent Theme Tests</H2>
|
|
32
|
+
<Paragraph color="$color11">
|
|
33
|
+
Tests documented accent usage patterns from gui.hanzo.ai docs.
|
|
34
|
+
</Paragraph>
|
|
35
|
+
</YStack>
|
|
36
|
+
|
|
37
|
+
{/* === SECTION 1: <Theme name="accent"> === */}
|
|
38
|
+
<YStack
|
|
39
|
+
gap="$3"
|
|
40
|
+
padding="$4"
|
|
41
|
+
backgroundColor="$background"
|
|
42
|
+
borderRadius="$4"
|
|
43
|
+
borderWidth={2}
|
|
44
|
+
borderColor="$color7"
|
|
45
|
+
>
|
|
46
|
+
<H3 color="$color11">{'<Theme name="accent">'}</H3>
|
|
47
|
+
<Paragraph size="$2" color="$color11">
|
|
48
|
+
Expected: first square is the base gray background. Second square should be DARK
|
|
49
|
+
PURPLE (the accent palette inverted). Text below it should be light/readable
|
|
50
|
+
against the accent background.
|
|
51
|
+
</Paragraph>
|
|
52
|
+
|
|
53
|
+
<XStack gap="$3" alignItems="flex-start">
|
|
54
|
+
{/* Baseline: base theme background for comparison */}
|
|
55
|
+
<YStack gap="$1" alignItems="center">
|
|
56
|
+
<YStack
|
|
57
|
+
testID={TEST_IDS.baseBackground}
|
|
58
|
+
width={100}
|
|
59
|
+
height={100}
|
|
60
|
+
backgroundColor="$background"
|
|
61
|
+
borderRadius="$4"
|
|
62
|
+
/>
|
|
63
|
+
<Text color="$color11">Base $background</Text>
|
|
64
|
+
</YStack>
|
|
65
|
+
|
|
66
|
+
{/* Accent theme: $background should differ from base */}
|
|
67
|
+
<Theme name="accent">
|
|
68
|
+
<YStack gap="$1" alignItems="center">
|
|
69
|
+
<YStack
|
|
70
|
+
testID={TEST_IDS.accentThemeBackground}
|
|
71
|
+
width={100}
|
|
72
|
+
height={100}
|
|
73
|
+
backgroundColor="$background"
|
|
74
|
+
borderRadius="$4"
|
|
75
|
+
/>
|
|
76
|
+
<Text color="$color11">Accent $background</Text>
|
|
77
|
+
<Text testID={TEST_IDS.accentThemeColor} color="$color" marginTop="$2">
|
|
78
|
+
Accent $color text
|
|
79
|
+
</Text>
|
|
80
|
+
</YStack>
|
|
81
|
+
</Theme>
|
|
82
|
+
</XStack>
|
|
83
|
+
</YStack>
|
|
84
|
+
|
|
85
|
+
{/* === SECTION 2: <Button theme="accent"> === */}
|
|
86
|
+
<YStack
|
|
87
|
+
gap="$3"
|
|
88
|
+
padding="$4"
|
|
89
|
+
backgroundColor="$background"
|
|
90
|
+
borderRadius="$4"
|
|
91
|
+
borderWidth={2}
|
|
92
|
+
borderColor="$color7"
|
|
93
|
+
>
|
|
94
|
+
<H3 color="$color11">{'<Button theme="accent">'}</H3>
|
|
95
|
+
<Paragraph size="$2" color="$color11">
|
|
96
|
+
Expected: first button is the default gray surface. Second button should have a
|
|
97
|
+
PURPLE background with light text — visually distinct from the base button.
|
|
98
|
+
</Paragraph>
|
|
99
|
+
|
|
100
|
+
<XStack gap="$3">
|
|
101
|
+
<Button testID={TEST_IDS.baseButton} size="$4">
|
|
102
|
+
Base Button
|
|
103
|
+
</Button>
|
|
104
|
+
|
|
105
|
+
<Button testID={TEST_IDS.accentPropButton} theme="accent" size="$4">
|
|
106
|
+
Accent Button
|
|
107
|
+
</Button>
|
|
108
|
+
</XStack>
|
|
109
|
+
</YStack>
|
|
110
|
+
|
|
111
|
+
{/* === SECTION 3: $accentBackground / $accentColor tokens === */}
|
|
112
|
+
<YStack
|
|
113
|
+
gap="$3"
|
|
114
|
+
padding="$4"
|
|
115
|
+
backgroundColor="$background"
|
|
116
|
+
borderRadius="$4"
|
|
117
|
+
borderWidth={2}
|
|
118
|
+
borderColor="$color7"
|
|
119
|
+
>
|
|
120
|
+
<H3 color="$color11">$accentBackground / $accentColor</H3>
|
|
121
|
+
<Paragraph size="$2" color="$color11">
|
|
122
|
+
Expected: square should be a DARK PURPLE — same hue as the accent palette. This
|
|
123
|
+
is the raw token, not a theme wrapper.
|
|
124
|
+
</Paragraph>
|
|
125
|
+
|
|
126
|
+
<YStack
|
|
127
|
+
testID={TEST_IDS.accentBgToken}
|
|
128
|
+
width={100}
|
|
129
|
+
height={100}
|
|
130
|
+
backgroundColor="$accentBackground"
|
|
131
|
+
borderRadius="$4"
|
|
132
|
+
/>
|
|
133
|
+
</YStack>
|
|
134
|
+
|
|
135
|
+
{/* === SECTION 4: $accent1-12 raw palette tokens === */}
|
|
136
|
+
<YStack
|
|
137
|
+
gap="$3"
|
|
138
|
+
padding="$4"
|
|
139
|
+
backgroundColor="$background"
|
|
140
|
+
borderRadius="$4"
|
|
141
|
+
borderWidth={1}
|
|
142
|
+
borderColor="$borderColor"
|
|
143
|
+
>
|
|
144
|
+
<H4>Accent Palette (accent1-12)</H4>
|
|
145
|
+
<Paragraph size="$2" color="$color11">
|
|
146
|
+
Expected: a gradient of 12 swatches going from dark purple to light purple. If
|
|
147
|
+
these are all gray, the accent palette is broken.
|
|
148
|
+
</Paragraph>
|
|
149
|
+
<XStack gap="$1">
|
|
150
|
+
{[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map((i) => (
|
|
151
|
+
<YStack
|
|
152
|
+
key={i}
|
|
153
|
+
testID={`palette-accent-${i}`}
|
|
154
|
+
width={40}
|
|
155
|
+
height={40}
|
|
156
|
+
backgroundColor={`$accent${i}` as any}
|
|
157
|
+
borderRadius="$2"
|
|
158
|
+
alignItems="center"
|
|
159
|
+
justifyContent="center"
|
|
160
|
+
>
|
|
161
|
+
<Text fontSize={10} color={i > 6 ? '$accent1' : '$accent12'}>
|
|
162
|
+
{i}
|
|
163
|
+
</Text>
|
|
164
|
+
</YStack>
|
|
165
|
+
))}
|
|
166
|
+
</XStack>
|
|
167
|
+
</YStack>
|
|
168
|
+
|
|
169
|
+
{/* === SECTION 5: Color child themes === */}
|
|
170
|
+
<YStack
|
|
171
|
+
gap="$3"
|
|
172
|
+
padding="$4"
|
|
173
|
+
backgroundColor="$background"
|
|
174
|
+
borderRadius="$4"
|
|
175
|
+
borderWidth={1}
|
|
176
|
+
borderColor="$borderColor"
|
|
177
|
+
>
|
|
178
|
+
<H4>Color Themes</H4>
|
|
179
|
+
<Paragraph size="$2" color="$color11">
|
|
180
|
+
Expected: each card and button should have a distinct tint matching its color
|
|
181
|
+
name. Yellow should look warm, red should look red, etc.
|
|
182
|
+
</Paragraph>
|
|
183
|
+
<XStack gap="$3" flexWrap="wrap">
|
|
184
|
+
<Theme name="yellow">
|
|
185
|
+
<Card padding="$3" backgroundColor="$background" minWidth={140}>
|
|
186
|
+
<Button testID="button-yellow" size="$3">
|
|
187
|
+
Yellow
|
|
188
|
+
</Button>
|
|
189
|
+
</Card>
|
|
190
|
+
</Theme>
|
|
191
|
+
<Theme name="red">
|
|
192
|
+
<Card
|
|
193
|
+
testID="card-red"
|
|
194
|
+
padding="$3"
|
|
195
|
+
backgroundColor="$background"
|
|
196
|
+
minWidth={140}
|
|
197
|
+
>
|
|
198
|
+
<Button testID="button-red" size="$3">
|
|
199
|
+
Red
|
|
200
|
+
</Button>
|
|
201
|
+
</Card>
|
|
202
|
+
</Theme>
|
|
203
|
+
<Theme name="green">
|
|
204
|
+
<Card
|
|
205
|
+
testID="card-green"
|
|
206
|
+
padding="$3"
|
|
207
|
+
backgroundColor="$background"
|
|
208
|
+
minWidth={140}
|
|
209
|
+
>
|
|
210
|
+
<Button testID="button-green" size="$3">
|
|
211
|
+
Green
|
|
212
|
+
</Button>
|
|
213
|
+
</Card>
|
|
214
|
+
</Theme>
|
|
215
|
+
<Theme name="blue">
|
|
216
|
+
<Card
|
|
217
|
+
testID="card-blue"
|
|
218
|
+
padding="$3"
|
|
219
|
+
backgroundColor="$background"
|
|
220
|
+
minWidth={140}
|
|
221
|
+
>
|
|
222
|
+
<Button testID="button-blue" size="$3">
|
|
223
|
+
Blue
|
|
224
|
+
</Button>
|
|
225
|
+
</Card>
|
|
226
|
+
</Theme>
|
|
227
|
+
</XStack>
|
|
228
|
+
</YStack>
|
|
229
|
+
</YStack>
|
|
230
|
+
)
|
|
231
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Text, styled } from '@hanzo/gui'
|
|
2
|
+
|
|
3
|
+
export const Heading = styled(Text, {
|
|
4
|
+
name: 'Heading',
|
|
5
|
+
color: '$color',
|
|
6
|
+
|
|
7
|
+
variants: {
|
|
8
|
+
type: {
|
|
9
|
+
myVariant: {
|
|
10
|
+
fontFamily: '$body',
|
|
11
|
+
fontSize: 20,
|
|
12
|
+
lh: '$10',
|
|
13
|
+
fow: '$2',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
} as const,
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
export function VariantFontFamily() {
|
|
20
|
+
return (
|
|
21
|
+
<Heading data-testid="heading" type="myVariant" fontSize="$1">
|
|
22
|
+
H1
|
|
23
|
+
</Heading>
|
|
24
|
+
)
|
|
25
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { Button, Text, View, styled, createStyledContext } from '@hanzo/gui'
|
|
2
|
+
|
|
3
|
+
export function VariantsOrder() {
|
|
4
|
+
return (
|
|
5
|
+
<>
|
|
6
|
+
<Button testID="button">
|
|
7
|
+
<Text testID="text1">default</Text>
|
|
8
|
+
<Text2 testID="text2">20px</Text2>
|
|
9
|
+
<P testID="text3">30px</P>
|
|
10
|
+
<P2 testID="text4">40px</P2>
|
|
11
|
+
</Button>
|
|
12
|
+
|
|
13
|
+
{/* Issue #3669: Variant chaining */}
|
|
14
|
+
<ButtonFrame testID="frame-test-direct" test>
|
|
15
|
+
<ButtonText testID="text-test-direct">direct test</ButtonText>
|
|
16
|
+
</ButtonFrame>
|
|
17
|
+
|
|
18
|
+
<ButtonFrame2 testID="frame-test2-chained" test2>
|
|
19
|
+
<ButtonText testID="text-test2-chained">chained test2</ButtonText>
|
|
20
|
+
</ButtonFrame2>
|
|
21
|
+
</>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const Text2 = styled(Text, {
|
|
26
|
+
fontFamily: '$body',
|
|
27
|
+
fontSize: 20,
|
|
28
|
+
userSelect: 'auto',
|
|
29
|
+
|
|
30
|
+
variants: {
|
|
31
|
+
bold: {
|
|
32
|
+
true: {
|
|
33
|
+
fontWeight: '600',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
center: {
|
|
37
|
+
true: {
|
|
38
|
+
textAlign: 'center',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
inherit: {
|
|
42
|
+
false: {
|
|
43
|
+
fontSize: 15,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
} as const,
|
|
47
|
+
|
|
48
|
+
defaultVariants: {
|
|
49
|
+
inherit: false,
|
|
50
|
+
},
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
const P = styled(Text2, {
|
|
54
|
+
fontSize: 30,
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
const P2 = styled(Text2, {
|
|
58
|
+
fontSize: 30,
|
|
59
|
+
|
|
60
|
+
variants: {
|
|
61
|
+
parentVariant: {
|
|
62
|
+
true: {
|
|
63
|
+
fontSize: 40,
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
} as const,
|
|
67
|
+
|
|
68
|
+
defaultVariants: {
|
|
69
|
+
parentVariant: true,
|
|
70
|
+
},
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
// --- Issue #3669: Variant chaining with context ---
|
|
74
|
+
const TestContext = createStyledContext({
|
|
75
|
+
test: false,
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
const ButtonFrame = styled(View, {
|
|
79
|
+
name: 'ButtonFrame',
|
|
80
|
+
context: TestContext,
|
|
81
|
+
backgroundColor: 'gray',
|
|
82
|
+
padding: 10,
|
|
83
|
+
|
|
84
|
+
variants: {
|
|
85
|
+
test: {
|
|
86
|
+
true: {
|
|
87
|
+
backgroundColor: 'red',
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
} as const,
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
const ButtonFrame2 = styled(ButtonFrame, {
|
|
94
|
+
name: 'ButtonFrame2',
|
|
95
|
+
|
|
96
|
+
variants: {
|
|
97
|
+
test2: {
|
|
98
|
+
true: {
|
|
99
|
+
test: true, // maps test2 → test
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
} as const,
|
|
103
|
+
})
|
|
104
|
+
|
|
105
|
+
const ButtonText = styled(Text, {
|
|
106
|
+
name: 'ButtonText',
|
|
107
|
+
context: TestContext,
|
|
108
|
+
color: 'black',
|
|
109
|
+
|
|
110
|
+
variants: {
|
|
111
|
+
test: {
|
|
112
|
+
true: {
|
|
113
|
+
color: 'white',
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
} as const,
|
|
117
|
+
})
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Modal, StyleSheet, Text, View } from 'react-native'
|
|
3
|
+
import { Button, TooltipSimple } from '@hanzo/gui'
|
|
4
|
+
|
|
5
|
+
export function ZIndex() {
|
|
6
|
+
return <TooltipInModal />
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function TooltipInModal() {
|
|
10
|
+
return (
|
|
11
|
+
<>
|
|
12
|
+
<Gap />
|
|
13
|
+
<SimpleModal />
|
|
14
|
+
<Gap />
|
|
15
|
+
<TransparentModal />
|
|
16
|
+
<Gap />
|
|
17
|
+
<AnimatedModalStack />
|
|
18
|
+
<Gap />
|
|
19
|
+
<Modalception />
|
|
20
|
+
</>
|
|
21
|
+
)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function Gap() {
|
|
25
|
+
return <View style={styles.gap} />
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function AnimatedModal({ animationType }) {
|
|
29
|
+
const [isVisible, setIsVisible] = React.useState(false)
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<>
|
|
33
|
+
<Button onPress={() => setIsVisible(true)}>Animation {animationType}</Button>
|
|
34
|
+
<Modal
|
|
35
|
+
animationType={animationType}
|
|
36
|
+
onRequestClose={() => setIsVisible(false)}
|
|
37
|
+
visible={isVisible}
|
|
38
|
+
>
|
|
39
|
+
<View style={styles.container}>
|
|
40
|
+
<Text>Modal with "animationType" of "{animationType}"</Text>
|
|
41
|
+
<Gap />
|
|
42
|
+
<TooltipSimple label="test tooltip">
|
|
43
|
+
<Button onPress={() => setIsVisible(false)}>Close</Button>
|
|
44
|
+
</TooltipSimple>
|
|
45
|
+
</View>
|
|
46
|
+
</Modal>
|
|
47
|
+
</>
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function AnimatedModalStack() {
|
|
52
|
+
return (
|
|
53
|
+
<>
|
|
54
|
+
<AnimatedModal animationType={'none'} />
|
|
55
|
+
<Gap />
|
|
56
|
+
<AnimatedModal animationType={'slide'} />
|
|
57
|
+
<Gap />
|
|
58
|
+
<AnimatedModal animationType={'fade'} />
|
|
59
|
+
</>
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const WIGGLE_ROOM = 128
|
|
64
|
+
|
|
65
|
+
function Modalception({ depth = 1 }) {
|
|
66
|
+
const [isVisible, setIsVisible] = React.useState(false)
|
|
67
|
+
|
|
68
|
+
const offset = React.useMemo(() => {
|
|
69
|
+
return {
|
|
70
|
+
top: Math.random() * WIGGLE_ROOM - WIGGLE_ROOM / 2,
|
|
71
|
+
left: Math.random() * WIGGLE_ROOM - WIGGLE_ROOM / 2,
|
|
72
|
+
}
|
|
73
|
+
}, [])
|
|
74
|
+
|
|
75
|
+
return (
|
|
76
|
+
<>
|
|
77
|
+
<Button onPress={() => setIsVisible(true)}>Open modal</Button>
|
|
78
|
+
<Modal onRequestClose={() => setIsVisible(false)} transparent visible={isVisible}>
|
|
79
|
+
<View style={[styles.containeralt, offset]}>
|
|
80
|
+
<Text>This is in Modal {depth}</Text>
|
|
81
|
+
<Gap />
|
|
82
|
+
{isVisible ? <Modalception depth={depth + 1} /> : null}
|
|
83
|
+
<Gap />
|
|
84
|
+
<TooltipSimple label="test tooltip">
|
|
85
|
+
<Button onPress={() => setIsVisible(false)}>
|
|
86
|
+
<Button.Text color="red">Close</Button.Text>
|
|
87
|
+
</Button>
|
|
88
|
+
</TooltipSimple>
|
|
89
|
+
</View>
|
|
90
|
+
</Modal>
|
|
91
|
+
</>
|
|
92
|
+
)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function SimpleModal() {
|
|
96
|
+
const [isVisible, setIsVisible] = React.useState(false)
|
|
97
|
+
|
|
98
|
+
return (
|
|
99
|
+
<>
|
|
100
|
+
<Button onPress={() => setIsVisible(true)}>Simple modal</Button>
|
|
101
|
+
<Modal onRequestClose={() => setIsVisible(false)} visible={isVisible}>
|
|
102
|
+
<View style={styles.container}>
|
|
103
|
+
<Text>Hello, World!</Text>
|
|
104
|
+
<Gap />
|
|
105
|
+
<TooltipSimple label="test tooltip">
|
|
106
|
+
<Button onPress={() => setIsVisible(false)}>Close</Button>
|
|
107
|
+
</TooltipSimple>
|
|
108
|
+
</View>
|
|
109
|
+
</Modal>
|
|
110
|
+
</>
|
|
111
|
+
)
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function TransparentModal() {
|
|
115
|
+
const [isVisible, setIsVisible] = React.useState(false)
|
|
116
|
+
|
|
117
|
+
return (
|
|
118
|
+
<>
|
|
119
|
+
<Button onPress={() => setIsVisible(true)}>Transparent modal</Button>
|
|
120
|
+
<Modal onRequestClose={() => setIsVisible(false)} transparent visible={isVisible}>
|
|
121
|
+
<View style={styles.containeralt}>
|
|
122
|
+
<Text style={{ textAlign: 'center' }}>Modal with "transparent" value</Text>
|
|
123
|
+
<Gap />
|
|
124
|
+
|
|
125
|
+
<TooltipSimple label="test tooltip">
|
|
126
|
+
<Button onPress={() => setIsVisible(false)}>Close</Button>
|
|
127
|
+
</TooltipSimple>
|
|
128
|
+
</View>
|
|
129
|
+
</Modal>
|
|
130
|
+
</>
|
|
131
|
+
)
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const styles = StyleSheet.create({
|
|
135
|
+
container: {
|
|
136
|
+
alignItems: 'center',
|
|
137
|
+
flex: 1,
|
|
138
|
+
justifyContent: 'center',
|
|
139
|
+
},
|
|
140
|
+
containeralt: {
|
|
141
|
+
alignItems: 'center',
|
|
142
|
+
backgroundColor: 'white',
|
|
143
|
+
borderColor: '#eee',
|
|
144
|
+
borderRadius: 10,
|
|
145
|
+
borderWidth: 1,
|
|
146
|
+
justifyContent: 'center',
|
|
147
|
+
height: 300,
|
|
148
|
+
margin: 'auto',
|
|
149
|
+
padding: 30,
|
|
150
|
+
width: 300,
|
|
151
|
+
},
|
|
152
|
+
gap: {
|
|
153
|
+
height: 10,
|
|
154
|
+
},
|
|
155
|
+
})
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
type ObjectType = Record<PropertyKey, unknown>
|
|
2
|
+
|
|
3
|
+
type PickByValue<OBJ_T, VALUE_T> = // From https://stackoverflow.com/a/55153000
|
|
4
|
+
Pick<OBJ_T, { [K in keyof OBJ_T]: OBJ_T[K] extends VALUE_T ? K : never }[keyof OBJ_T]>
|
|
5
|
+
|
|
6
|
+
type ObjectEntries<OBJ_T> = // From https://stackoverflow.com/a/60142095
|
|
7
|
+
{ [K in keyof OBJ_T]: [keyof PickByValue<OBJ_T, OBJ_T[K]>, OBJ_T[K]] }[keyof OBJ_T][]
|
|
8
|
+
|
|
9
|
+
export const objectKeys = <O extends object>(obj: O) => Object.keys(obj) as Array<keyof O>
|
|
10
|
+
|
|
11
|
+
export function objectEntries<OBJ_T extends ObjectType>(
|
|
12
|
+
obj: OBJ_T
|
|
13
|
+
): ObjectEntries<OBJ_T> {
|
|
14
|
+
return Object.entries(obj) as ObjectEntries<OBJ_T>
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
type EntriesType =
|
|
18
|
+
| [PropertyKey, unknown][]
|
|
19
|
+
| ReadonlyArray<readonly [PropertyKey, unknown]>
|
|
20
|
+
|
|
21
|
+
// Existing Utils
|
|
22
|
+
type DeepWritable<OBJ_T> = { -readonly [P in keyof OBJ_T]: DeepWritable<OBJ_T[P]> }
|
|
23
|
+
type UnionToIntersection<UNION_T> = // From https://stackoverflow.com/a/50375286
|
|
24
|
+
(UNION_T extends any ? (k: UNION_T) => void : never) extends (k: infer I) => void
|
|
25
|
+
? I
|
|
26
|
+
: never
|
|
27
|
+
|
|
28
|
+
// New Utils
|
|
29
|
+
type UnionObjectFromArrayOfPairs<ARR_T extends EntriesType> =
|
|
30
|
+
DeepWritable<ARR_T> extends (infer R)[]
|
|
31
|
+
? R extends [infer key, infer val]
|
|
32
|
+
? { [prop in key & PropertyKey]: val }
|
|
33
|
+
: never
|
|
34
|
+
: never
|
|
35
|
+
type MergeIntersectingObjects<ObjT> = { [key in keyof ObjT]: ObjT[key] }
|
|
36
|
+
type EntriesToObject<ARR_T extends EntriesType> = MergeIntersectingObjects<
|
|
37
|
+
UnionToIntersection<UnionObjectFromArrayOfPairs<ARR_T>>
|
|
38
|
+
>
|
|
39
|
+
|
|
40
|
+
export function objectFromEntries<ARR_T extends EntriesType>(
|
|
41
|
+
arr: ARR_T
|
|
42
|
+
): EntriesToObject<ARR_T> {
|
|
43
|
+
return Object.fromEntries(arr) as EntriesToObject<ARR_T>
|
|
44
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
export { ActionsSheetComparison } from './ActionsSheetComparison'
|
|
2
|
+
export { AnimatedByProp } from './AnimatedByProp'
|
|
3
|
+
export { AnimatePresenceExitTest } from './AnimatePresenceExitTest'
|
|
4
|
+
export { AnimationComprehensiveCase } from './AnimationComprehensiveCase'
|
|
5
|
+
export { Benchmark } from './Benchmark'
|
|
6
|
+
export { ButtonCircular } from './ButtonCircular'
|
|
7
|
+
export { ButtonCustom } from './ButtonCustom'
|
|
8
|
+
export { ButtonInverse } from './ButtonInverse'
|
|
9
|
+
export { ButtonUnstyled } from './ButtonUnstyled'
|
|
10
|
+
export { CheckboxDisabledOnPress } from './CheckboxDisabledOnPress'
|
|
11
|
+
export { CodeExamplesInput } from './CodeExamplesInput'
|
|
12
|
+
export { ColorTokenFallback } from './ColorTokenFallback'
|
|
13
|
+
export { CompilerExtraction } from './CompilerExtraction'
|
|
14
|
+
export { ComplexVariants } from './ComplexVariants'
|
|
15
|
+
export { CrashAdaptSheet } from './CrashAdaptSheet'
|
|
16
|
+
export { CustomStyledAnimatedPopover } from './CustomStyledAnimatedPopover'
|
|
17
|
+
export { CustomStyledAnimatedTooltip } from './CustomStyledAnimatedTooltip'
|
|
18
|
+
export { DialogFocusScopeCase } from './DialogFocusScopeCase'
|
|
19
|
+
export { DialogFocusScopeDebug } from './DialogFocusScopeDebug'
|
|
20
|
+
export { DialogNestedCase } from './DialogNestedCase'
|
|
21
|
+
export { DialogOpenControlled } from './DialogOpenControlled'
|
|
22
|
+
export { DialogPointerEventsCase } from './DialogPointerEventsCase'
|
|
23
|
+
export { DialogScopedCase } from './DialogScopedCase'
|
|
24
|
+
export { DialogSheetAdaptCase } from './DialogSheetAdaptCase'
|
|
25
|
+
export { Example } from './Example'
|
|
26
|
+
export { ExitCompletionCase } from './ExitCompletionCase'
|
|
27
|
+
export { FocusVisibleButton } from './FocusVisibleButton'
|
|
28
|
+
export { FocusVisibleButtonPointer } from './FocusVisibleButtonPointer'
|
|
29
|
+
export { FocusVisibleButtonWithFocusStyle } from './FocusVisibleButtonWithFocusStyle'
|
|
30
|
+
export { FontTokensInVariants } from './FontTokensInVariants'
|
|
31
|
+
export { GroupHoverMobile } from './GroupHoverMobile'
|
|
32
|
+
export { GroupPressInVariant } from './GroupPressInVariant'
|
|
33
|
+
export { GroupPseudoVariantOverride } from './GroupPseudoVariantOverride'
|
|
34
|
+
export { GroupPressNative } from './GroupPressNative'
|
|
35
|
+
export { GroupProp } from './GroupProp'
|
|
36
|
+
export { MediaQueryGtMd } from './MediaQueryGtMd'
|
|
37
|
+
export { MediaQueriesV5 } from './MediaQueriesV5'
|
|
38
|
+
export { MenuAccessibilityCase } from './MenuAccessibilityCase'
|
|
39
|
+
export { MenuAsChildPositionCase } from './MenuAsChildPositionCase'
|
|
40
|
+
export { MenuHighlightCase } from './MenuHighlightCase'
|
|
41
|
+
export { MenuSubCase } from './MenuSubCase'
|
|
42
|
+
export { MenuSubLeftCase } from './MenuSubLeftCase'
|
|
43
|
+
export { NativePortalTest } from './NativePortalTest'
|
|
44
|
+
export { GroupUseCases } from './GroupUseCases'
|
|
45
|
+
export { ThemedListItem } from './ListItem'
|
|
46
|
+
export { NewInputBasic } from './NewInputBasic'
|
|
47
|
+
export { NewInputEvents } from './NewInputEvents'
|
|
48
|
+
export { OverlayStyled } from './OverlayStyled'
|
|
49
|
+
export { PlaceholderTextColor } from './PlaceholderTextColor'
|
|
50
|
+
export { PointerEventsCase } from './PointerEventsCase'
|
|
51
|
+
export { PopoverCase } from './PopoverCase'
|
|
52
|
+
export { PopoverContentStyledPlusAnimations } from './PopoverContentStyledPlusAnimations'
|
|
53
|
+
export { PopoverFocusScopeCase } from './PopoverFocusScopeCase'
|
|
54
|
+
export { PopoverScopedCase } from './PopoverScopedCase'
|
|
55
|
+
export { PopoverTriggerIsolationCase } from './PopoverTriggerIsolationCase'
|
|
56
|
+
export { PressStyleNative } from './PressStyleNative'
|
|
57
|
+
export { PseudoStyleMerge } from './PseudoStyleMerge'
|
|
58
|
+
export { PseudoTransitionCase } from './PseudoTransitionCase'
|
|
59
|
+
export { RenderPropCase } from './RenderPropCase'
|
|
60
|
+
// export { SafeAreaCase } from './SafeAreaCase'
|
|
61
|
+
export { ScrollViewRefCase } from './ScrollViewRefCase'
|
|
62
|
+
export { SecondPage } from './SecondPage'
|
|
63
|
+
export { SelectAndroidOnPress } from './SelectAndroidOnPress'
|
|
64
|
+
export { SelectFocusScopeCase } from './SelectFocusScopeCase'
|
|
65
|
+
export { SelectRemount } from './SelectRemount'
|
|
66
|
+
export { Shadows } from './Shadows'
|
|
67
|
+
export { ShorthandVariables } from './ShorthandVariables'
|
|
68
|
+
export { SheetAnimationCase } from './SheetAnimationCase'
|
|
69
|
+
export { SheetDragCase } from './SheetDragCase'
|
|
70
|
+
export { SheetDragResistCase } from './SheetDragResistCase'
|
|
71
|
+
export { SheetKeyboardDragCase } from './SheetKeyboardDragCase'
|
|
72
|
+
export { KeyboardControllerTest } from './KeyboardControllerTest'
|
|
73
|
+
export { SheetScrollableDrag } from './SheetScrollableDrag'
|
|
74
|
+
export { SheetScrollLockCase } from './SheetScrollLockCase'
|
|
75
|
+
export { SheetSnapPointsFitCase } from './SheetSnapPointsFitCase'
|
|
76
|
+
export { SlowThemeReRender } from './SlowThemeReRender'
|
|
77
|
+
export { SpinnerCustomColors } from './SpinnerCustomColors'
|
|
78
|
+
export { StackZIndex } from './StackZIndex'
|
|
79
|
+
export { StyledAnchor } from './StyledAnchor'
|
|
80
|
+
export { StyledButtonAnimationAuto } from './StyledButtonAnimationAuto'
|
|
81
|
+
export { StyledButtonTheme } from './StyledButtonTheme'
|
|
82
|
+
export { StyledButtonVariantPseudo } from './StyledButtonVariantPseudo'
|
|
83
|
+
export { StyledButtonVariantPseudoMerge } from './StyledButtonVariantPseudoMerge'
|
|
84
|
+
export { StyledCheckboxTheme } from './StyledCheckboxTheme'
|
|
85
|
+
export { StyledContextColor } from './StyledContextColor'
|
|
86
|
+
export { StyledContextTokens } from './StyledContextTokens'
|
|
87
|
+
export { StyledHOCNamed } from './StyledHOCNamed'
|
|
88
|
+
export { StyledIconColor } from './StyledIconColor'
|
|
89
|
+
export { StyledInputFocusStyle } from './StyledInputFocusStyle'
|
|
90
|
+
export { StyledInputOnFocus } from './StyledInputOnFocus'
|
|
91
|
+
export { StyledMediaQueryMerge } from './StyledMediaQueryMerge'
|
|
92
|
+
export { StyledOverridePsuedo } from './StyledOverridePsuedo'
|
|
93
|
+
export { StyledRNW } from './StyledRNW'
|
|
94
|
+
export { StyledStyleableInputOnFocus } from './StyledStyleableInputOnFocus'
|
|
95
|
+
export { StyledStyleableInputVariant } from './StyledStyleableInputVariant'
|
|
96
|
+
export { StyledStyledStyleableInputOnFocus } from './StyledStyledStyleableInputOnFocus'
|
|
97
|
+
export { StyledVariantTextColor } from './StyledVariantTextColor'
|
|
98
|
+
export { StyledViewOnFocus } from './StyledViewOnFocus'
|
|
99
|
+
export { StylePlatform } from './StylePlatform'
|
|
100
|
+
export { StyleProp } from './StyleProp'
|
|
101
|
+
export { TextNestedInheritance } from './TextNestedInheritance'
|
|
102
|
+
export { ThemeChange } from './ThemeChange'
|
|
103
|
+
export { ThemeChangeBasic } from './ThemeChangeBasic'
|
|
104
|
+
export { ThemeComponentResolution } from './ThemeComponentResolution'
|
|
105
|
+
export { ThemeMutation } from './ThemeMutation'
|
|
106
|
+
export { ThemeNested } from './ThemeNested'
|
|
107
|
+
export { ThemeReset } from './ThemeReset'
|
|
108
|
+
export { ThemeShallowCase } from './ThemeShallowCase'
|
|
109
|
+
export { ToastCase } from './ToastCase'
|
|
110
|
+
export { ToggleGroupActiveProps } from './ToggleGroupActiveProps'
|
|
111
|
+
export { TooltipAnimationCase } from './TooltipAnimationCase'
|
|
112
|
+
export { TooltipCase } from './TooltipCase'
|
|
113
|
+
export { TooltipGroupCase } from './TooltipGroupCase'
|
|
114
|
+
export { TooltipPositionJumpCase } from './TooltipPositionJumpCase'
|
|
115
|
+
export { TooltipTriggerInlineCase } from './TooltipTriggerInlineCase'
|
|
116
|
+
export { TransformMediaQueryMerge } from './TransformMediaQueryMerge'
|
|
117
|
+
export { UseCases } from './UseCases'
|
|
118
|
+
export { UseTheme } from './UseTheme'
|
|
119
|
+
export { V5ThemeBuilderOutput } from './V5ThemeBuilderOutput'
|
|
120
|
+
export { VariantFontFamily } from './VariantFontFamily'
|
|
121
|
+
export { VariantsOrder } from './VariantsOrder'
|
|
122
|
+
export { ZIndex } from './ZIndex'
|