@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,59 @@
|
|
|
1
|
+
import { ChevronRight } from '@hanzogui/lucide-icons-2'
|
|
2
|
+
import { ScrollView } from 'react-native'
|
|
3
|
+
import type { UseLinkProps } from 'solito/link'
|
|
4
|
+
import { useLink } from 'solito/link'
|
|
5
|
+
import type { ListItemProps } from '@hanzo/gui'
|
|
6
|
+
import { H2, ListItem, YGroup, YStack } from '@hanzo/gui'
|
|
7
|
+
|
|
8
|
+
import * as TestCases from '../../usecases'
|
|
9
|
+
|
|
10
|
+
export function TestCasesScreen() {
|
|
11
|
+
return (
|
|
12
|
+
<ScrollView testID="test-cases-scroll-view">
|
|
13
|
+
<YStack bg="$background" p="$3" pt="$6" pb="$8" flex={1} gap="$4">
|
|
14
|
+
<H2>All Test Cases</H2>
|
|
15
|
+
<YStack gap="$4" maxW={600}>
|
|
16
|
+
<YGroup size="$4">
|
|
17
|
+
{Object.keys(TestCases).map((page) => {
|
|
18
|
+
return (
|
|
19
|
+
<YGroup.Item key={page}>
|
|
20
|
+
<LinkListItem
|
|
21
|
+
href={`/test/${page}`}
|
|
22
|
+
size="$4"
|
|
23
|
+
testID={`test-case-${page}`}
|
|
24
|
+
>
|
|
25
|
+
{page}
|
|
26
|
+
</LinkListItem>
|
|
27
|
+
</YGroup.Item>
|
|
28
|
+
)
|
|
29
|
+
})}
|
|
30
|
+
</YGroup>
|
|
31
|
+
</YStack>
|
|
32
|
+
</YStack>
|
|
33
|
+
</ScrollView>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const LinkListItem = ({
|
|
38
|
+
children,
|
|
39
|
+
href,
|
|
40
|
+
as,
|
|
41
|
+
shallow,
|
|
42
|
+
...props
|
|
43
|
+
}: UseLinkProps & ListItemProps) => {
|
|
44
|
+
const linkProps = useLink({ href, as, shallow })
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<ListItem
|
|
48
|
+
{...linkProps}
|
|
49
|
+
backgroundColor="$color1"
|
|
50
|
+
onPress={(e) => {
|
|
51
|
+
linkProps.onPress(e)
|
|
52
|
+
}}
|
|
53
|
+
{...props}
|
|
54
|
+
iconAfter={ChevronRight}
|
|
55
|
+
>
|
|
56
|
+
{children}
|
|
57
|
+
</ListItem>
|
|
58
|
+
)
|
|
59
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ScrollView } from 'react-native'
|
|
2
|
+
import { createParam } from 'solito'
|
|
3
|
+
import { H1, YStack } from '@hanzo/gui'
|
|
4
|
+
|
|
5
|
+
import * as UseCases from '../../usecases'
|
|
6
|
+
|
|
7
|
+
const { useParam } = createParam<{ id: string }>()
|
|
8
|
+
|
|
9
|
+
const nameMap = {
|
|
10
|
+
Inputs: 'Inputs',
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function TestScreen() {
|
|
14
|
+
const [id] = useParam('id')
|
|
15
|
+
|
|
16
|
+
if (!id) {
|
|
17
|
+
return null
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const name = id
|
|
21
|
+
.split('-')
|
|
22
|
+
.map((segment) => {
|
|
23
|
+
return segment[0].toUpperCase() + segment.slice(1)
|
|
24
|
+
})
|
|
25
|
+
.join('')
|
|
26
|
+
|
|
27
|
+
const testName = `${nameMap[name] || name}`
|
|
28
|
+
const DemoComponent = UseCases[testName] ?? NotFound
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<ScrollView style={{ height: '100%' }}>
|
|
32
|
+
<YStack
|
|
33
|
+
outlineStyle="solid"
|
|
34
|
+
outlineColor="red"
|
|
35
|
+
outlineWidth="$2"
|
|
36
|
+
flex={1}
|
|
37
|
+
justify="center"
|
|
38
|
+
items="center"
|
|
39
|
+
bg="$background"
|
|
40
|
+
gap="$4"
|
|
41
|
+
>
|
|
42
|
+
<YStack minW={200} maxW={600} items="center" p="$4" rounded="$6">
|
|
43
|
+
<DemoComponent />
|
|
44
|
+
</YStack>
|
|
45
|
+
</YStack>
|
|
46
|
+
</ScrollView>
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const NotFound = () => <H1>Not found!</H1>
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was generated by the gui.hanzo.ai/theme builder.
|
|
3
|
+
* It tests that the v5 theme builder output works correctly.
|
|
4
|
+
*
|
|
5
|
+
* To test with your own theme:
|
|
6
|
+
* 1. Go to gui.hanzo.ai/theme and create your theme
|
|
7
|
+
* 2. Export the generated code and replace this file's contents
|
|
8
|
+
* 3. Run: yarn start:web and open http://localhost:9000/?test=V5ThemeBuilderOutput&generatedV5=true
|
|
9
|
+
*/
|
|
10
|
+
import { createV5Theme, defaultChildrenThemes } from '@hanzogui/config/v5'
|
|
11
|
+
import { v5ComponentThemes } from '@hanzogui/themes/v5'
|
|
12
|
+
import { yellow, yellowDark, red, redDark, green, greenDark } from '@hanzogui/colors'
|
|
13
|
+
|
|
14
|
+
const darkPalette = [
|
|
15
|
+
'hsla(0, 15%, 1%, 1)',
|
|
16
|
+
'hsla(0, 15%, 6%, 1)',
|
|
17
|
+
'hsla(0, 15%, 12%, 1)',
|
|
18
|
+
'hsla(0, 15%, 17%, 1)',
|
|
19
|
+
'hsla(0, 15%, 23%, 1)',
|
|
20
|
+
'hsla(0, 15%, 28%, 1)',
|
|
21
|
+
'hsla(0, 15%, 34%, 1)',
|
|
22
|
+
'hsla(0, 15%, 39%, 1)',
|
|
23
|
+
'hsla(0, 15%, 45%, 1)',
|
|
24
|
+
'hsla(0, 15%, 50%, 1)',
|
|
25
|
+
'hsla(0, 15%, 93%, 1)',
|
|
26
|
+
'hsla(0, 15%, 99%, 1)',
|
|
27
|
+
]
|
|
28
|
+
const lightPalette = [
|
|
29
|
+
'hsla(0, 15%, 99%, 1)',
|
|
30
|
+
'hsla(0, 15%, 94%, 1)',
|
|
31
|
+
'hsla(0, 15%, 88%, 1)',
|
|
32
|
+
'hsla(0, 15%, 83%, 1)',
|
|
33
|
+
'hsla(0, 15%, 77%, 1)',
|
|
34
|
+
'hsla(0, 15%, 72%, 1)',
|
|
35
|
+
'hsla(0, 15%, 66%, 1)',
|
|
36
|
+
'hsla(0, 15%, 61%, 1)',
|
|
37
|
+
'hsla(0, 15%, 55%, 1)',
|
|
38
|
+
'hsla(0, 15%, 50%, 1)',
|
|
39
|
+
'hsla(0, 15%, 15%, 1)',
|
|
40
|
+
'hsla(0, 15%, 1%, 1)',
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
// Your custom accent color theme
|
|
44
|
+
const accentLight = {
|
|
45
|
+
accent1: 'hsla(250, 50%, 40%, 1)',
|
|
46
|
+
accent2: 'hsla(250, 50%, 43%, 1)',
|
|
47
|
+
accent3: 'hsla(250, 50%, 46%, 1)',
|
|
48
|
+
accent4: 'hsla(250, 50%, 48%, 1)',
|
|
49
|
+
accent5: 'hsla(250, 50%, 51%, 1)',
|
|
50
|
+
accent6: 'hsla(250, 50%, 54%, 1)',
|
|
51
|
+
accent7: 'hsla(250, 50%, 57%, 1)',
|
|
52
|
+
accent8: 'hsla(250, 50%, 59%, 1)',
|
|
53
|
+
accent9: 'hsla(250, 50%, 62%, 1)',
|
|
54
|
+
accent10: 'hsla(250, 50%, 65%, 1)',
|
|
55
|
+
accent11: 'hsla(250, 50%, 95%, 1)',
|
|
56
|
+
accent12: 'hsla(250, 50%, 95%, 1)',
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const accentDark = {
|
|
60
|
+
accent1: 'hsla(250, 50%, 35%, 1)',
|
|
61
|
+
accent2: 'hsla(250, 50%, 38%, 1)',
|
|
62
|
+
accent3: 'hsla(250, 50%, 41%, 1)',
|
|
63
|
+
accent4: 'hsla(250, 50%, 43%, 1)',
|
|
64
|
+
accent5: 'hsla(250, 50%, 46%, 1)',
|
|
65
|
+
accent6: 'hsla(250, 50%, 49%, 1)',
|
|
66
|
+
accent7: 'hsla(250, 50%, 52%, 1)',
|
|
67
|
+
accent8: 'hsla(250, 50%, 54%, 1)',
|
|
68
|
+
accent9: 'hsla(250, 50%, 57%, 1)',
|
|
69
|
+
accent10: 'hsla(250, 50%, 60%, 1)',
|
|
70
|
+
accent11: 'hsla(250, 50%, 90%, 1)',
|
|
71
|
+
accent12: 'hsla(250, 50%, 95%, 1)',
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const builtThemes = createV5Theme({
|
|
75
|
+
darkPalette,
|
|
76
|
+
lightPalette,
|
|
77
|
+
componentThemes: v5ComponentThemes,
|
|
78
|
+
accent: {
|
|
79
|
+
light: accentLight,
|
|
80
|
+
dark: accentDark,
|
|
81
|
+
},
|
|
82
|
+
childrenThemes: {
|
|
83
|
+
// Include default color themes (blue, red, green, yellow, etc.)
|
|
84
|
+
...defaultChildrenThemes,
|
|
85
|
+
|
|
86
|
+
// Semantic color themes for warnings, errors, and success states
|
|
87
|
+
warning: {
|
|
88
|
+
light: yellow,
|
|
89
|
+
dark: yellowDark,
|
|
90
|
+
},
|
|
91
|
+
error: {
|
|
92
|
+
light: red,
|
|
93
|
+
dark: redDark,
|
|
94
|
+
},
|
|
95
|
+
success: {
|
|
96
|
+
light: green,
|
|
97
|
+
dark: greenDark,
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
})
|
|
101
|
+
|
|
102
|
+
export type Themes = typeof builtThemes
|
|
103
|
+
|
|
104
|
+
// the process.env conditional here is optional but saves web client-side bundle
|
|
105
|
+
// size by leaving out themes JS. hanzo-gui automatically hydrates themes from CSS
|
|
106
|
+
// back into JS for you, and the bundler plugins set HANZO_GUI_ENVIRONMENT. so
|
|
107
|
+
// long as you are using the Vite, Next, Webpack plugins this should just work,
|
|
108
|
+
// but if not you can just export builtThemes directly as themes:
|
|
109
|
+
export const themes: Themes =
|
|
110
|
+
process.env.HANZO_GUI_ENVIRONMENT === 'client' && process.env.NODE_ENV === 'production'
|
|
111
|
+
? ({} as any)
|
|
112
|
+
: (builtThemes as any)
|
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
import { createAnimations as createAnimationsCSS } from '@hanzogui/animations-css'
|
|
2
|
+
import { createAnimations as createAnimationsMotion } from '@hanzogui/animations-motion'
|
|
3
|
+
import { createAnimations as createAnimationsNative } from '@hanzogui/animations-react-native'
|
|
4
|
+
import { createAnimations as createAnimationsReanimated } from '@hanzogui/animations-reanimated'
|
|
5
|
+
import { config } from '@hanzogui/config/v3'
|
|
6
|
+
import { defaultConfig as configV4, shorthands } from '@hanzogui/config/v4'
|
|
7
|
+
import { defaultConfig } from '@hanzogui/config/v5'
|
|
8
|
+
import { guiThemes } from '@hanzogui/themes/v4'
|
|
9
|
+
import { createGui, type CreateGuiProps } from '@hanzo/gui'
|
|
10
|
+
// TODO just move this into this folder
|
|
11
|
+
import { config as guiDevConfig } from '../../packages/gui-dev-config/src/index'
|
|
12
|
+
import { themeDev } from '../../packages/gui-dev-config/src/theme.dev'
|
|
13
|
+
// Generated theme from v5 theme builder for testing
|
|
14
|
+
import { themes as generatedV5Themes } from './generatedV5Theme'
|
|
15
|
+
|
|
16
|
+
export const animationsCSS = createAnimationsCSS({
|
|
17
|
+
'0ms': '0ms linear',
|
|
18
|
+
'30ms': '30ms linear',
|
|
19
|
+
'50ms': '50ms linear',
|
|
20
|
+
'75ms': '75ms linear',
|
|
21
|
+
'100ms': '100ms ease-out',
|
|
22
|
+
'200ms': '200ms linear',
|
|
23
|
+
'250ms': '250ms ease-out',
|
|
24
|
+
'300ms': '300ms ease-out',
|
|
25
|
+
'400ms': '400ms ease-out',
|
|
26
|
+
'500ms': '500ms ease-out',
|
|
27
|
+
'1000ms': '1000ms linear',
|
|
28
|
+
bouncy: 'ease-in 200ms',
|
|
29
|
+
lazy: 'ease-in 600ms',
|
|
30
|
+
slow: 'ease-in 500ms',
|
|
31
|
+
quick: 'ease-in 100ms',
|
|
32
|
+
quicker: 'cubic-bezier(0.215, 0.610, 0.355, 1.000) 300ms',
|
|
33
|
+
quickest: 'ease-in 50ms',
|
|
34
|
+
tooltip: 'ease-in 400ms',
|
|
35
|
+
medium: 'ease-in 400ms',
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
export const animationsMotion = createAnimationsMotion({
|
|
39
|
+
'0ms': {
|
|
40
|
+
duration: 0,
|
|
41
|
+
},
|
|
42
|
+
'30ms': {
|
|
43
|
+
duration: 30,
|
|
44
|
+
},
|
|
45
|
+
'50ms': {
|
|
46
|
+
duration: 50,
|
|
47
|
+
},
|
|
48
|
+
'75ms': {
|
|
49
|
+
duration: 75,
|
|
50
|
+
},
|
|
51
|
+
'100ms': {
|
|
52
|
+
duration: 100,
|
|
53
|
+
},
|
|
54
|
+
'200ms': {
|
|
55
|
+
duration: 200,
|
|
56
|
+
},
|
|
57
|
+
'250ms': {
|
|
58
|
+
duration: 250,
|
|
59
|
+
},
|
|
60
|
+
'300ms': {
|
|
61
|
+
duration: 300,
|
|
62
|
+
},
|
|
63
|
+
'400ms': {
|
|
64
|
+
duration: 400,
|
|
65
|
+
},
|
|
66
|
+
'500ms': {
|
|
67
|
+
duration: 500,
|
|
68
|
+
},
|
|
69
|
+
'1000ms': {
|
|
70
|
+
duration: 1000,
|
|
71
|
+
},
|
|
72
|
+
bouncy: {
|
|
73
|
+
type: 'spring',
|
|
74
|
+
damping: 9,
|
|
75
|
+
mass: 0.9,
|
|
76
|
+
stiffness: 150,
|
|
77
|
+
},
|
|
78
|
+
lazy: {
|
|
79
|
+
type: 'spring',
|
|
80
|
+
damping: 18,
|
|
81
|
+
stiffness: 50,
|
|
82
|
+
},
|
|
83
|
+
slow: {
|
|
84
|
+
type: 'spring',
|
|
85
|
+
damping: 15,
|
|
86
|
+
stiffness: 40,
|
|
87
|
+
},
|
|
88
|
+
quick: {
|
|
89
|
+
type: 'spring',
|
|
90
|
+
damping: 20,
|
|
91
|
+
mass: 1.2,
|
|
92
|
+
stiffness: 250,
|
|
93
|
+
},
|
|
94
|
+
quicker: {
|
|
95
|
+
type: 'spring',
|
|
96
|
+
damping: 20,
|
|
97
|
+
mass: 1,
|
|
98
|
+
stiffness: 300,
|
|
99
|
+
},
|
|
100
|
+
quickest: {
|
|
101
|
+
type: 'spring',
|
|
102
|
+
damping: 14,
|
|
103
|
+
mass: 0.1,
|
|
104
|
+
stiffness: 380,
|
|
105
|
+
},
|
|
106
|
+
medium: {
|
|
107
|
+
damping: 15,
|
|
108
|
+
stiffness: 120,
|
|
109
|
+
mass: 1,
|
|
110
|
+
},
|
|
111
|
+
tooltip: {
|
|
112
|
+
type: 'spring',
|
|
113
|
+
damping: 10,
|
|
114
|
+
mass: 0.9,
|
|
115
|
+
stiffness: 100,
|
|
116
|
+
},
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
export const animationsNative = createAnimationsNative({
|
|
120
|
+
'0ms': {
|
|
121
|
+
type: 'timing',
|
|
122
|
+
duration: 0,
|
|
123
|
+
},
|
|
124
|
+
'30ms': {
|
|
125
|
+
type: 'timing',
|
|
126
|
+
duration: 30,
|
|
127
|
+
},
|
|
128
|
+
'50ms': {
|
|
129
|
+
type: 'timing',
|
|
130
|
+
duration: 50,
|
|
131
|
+
},
|
|
132
|
+
'75ms': {
|
|
133
|
+
type: 'timing',
|
|
134
|
+
duration: 75,
|
|
135
|
+
},
|
|
136
|
+
'100ms': {
|
|
137
|
+
type: 'timing',
|
|
138
|
+
duration: 100,
|
|
139
|
+
},
|
|
140
|
+
'200ms': {
|
|
141
|
+
type: 'timing',
|
|
142
|
+
duration: 200,
|
|
143
|
+
},
|
|
144
|
+
'250ms': {
|
|
145
|
+
type: 'timing',
|
|
146
|
+
duration: 250,
|
|
147
|
+
},
|
|
148
|
+
'300ms': {
|
|
149
|
+
type: 'timing',
|
|
150
|
+
duration: 300,
|
|
151
|
+
},
|
|
152
|
+
'400ms': {
|
|
153
|
+
type: 'timing',
|
|
154
|
+
duration: 400,
|
|
155
|
+
},
|
|
156
|
+
'500ms': {
|
|
157
|
+
type: 'timing',
|
|
158
|
+
duration: 500,
|
|
159
|
+
},
|
|
160
|
+
'1000ms': {
|
|
161
|
+
type: 'timing',
|
|
162
|
+
duration: 1000,
|
|
163
|
+
},
|
|
164
|
+
bouncy: {
|
|
165
|
+
type: 'spring',
|
|
166
|
+
damping: 9,
|
|
167
|
+
mass: 0.9,
|
|
168
|
+
stiffness: 150,
|
|
169
|
+
},
|
|
170
|
+
lazy: {
|
|
171
|
+
type: 'spring',
|
|
172
|
+
damping: 18,
|
|
173
|
+
stiffness: 50,
|
|
174
|
+
},
|
|
175
|
+
slow: {
|
|
176
|
+
type: 'spring',
|
|
177
|
+
damping: 15,
|
|
178
|
+
stiffness: 40,
|
|
179
|
+
},
|
|
180
|
+
quick: {
|
|
181
|
+
type: 'spring',
|
|
182
|
+
damping: 20,
|
|
183
|
+
mass: 1.2,
|
|
184
|
+
stiffness: 250,
|
|
185
|
+
},
|
|
186
|
+
quicker: {
|
|
187
|
+
type: 'spring',
|
|
188
|
+
damping: 20,
|
|
189
|
+
mass: 1,
|
|
190
|
+
stiffness: 300,
|
|
191
|
+
},
|
|
192
|
+
quickest: {
|
|
193
|
+
type: 'spring',
|
|
194
|
+
damping: 14,
|
|
195
|
+
mass: 0.1,
|
|
196
|
+
stiffness: 380,
|
|
197
|
+
},
|
|
198
|
+
medium: {
|
|
199
|
+
damping: 15,
|
|
200
|
+
stiffness: 120,
|
|
201
|
+
mass: 1,
|
|
202
|
+
},
|
|
203
|
+
tooltip: {
|
|
204
|
+
type: 'spring',
|
|
205
|
+
damping: 10,
|
|
206
|
+
mass: 0.9,
|
|
207
|
+
stiffness: 100,
|
|
208
|
+
},
|
|
209
|
+
})
|
|
210
|
+
|
|
211
|
+
export const animationsReanimated = createAnimationsReanimated({
|
|
212
|
+
'0ms': {
|
|
213
|
+
type: 'timing',
|
|
214
|
+
duration: 0,
|
|
215
|
+
},
|
|
216
|
+
'30ms': {
|
|
217
|
+
type: 'timing',
|
|
218
|
+
duration: 30,
|
|
219
|
+
},
|
|
220
|
+
'50ms': {
|
|
221
|
+
type: 'timing',
|
|
222
|
+
duration: 50,
|
|
223
|
+
},
|
|
224
|
+
'75ms': {
|
|
225
|
+
type: 'timing',
|
|
226
|
+
duration: 75,
|
|
227
|
+
},
|
|
228
|
+
'100ms': {
|
|
229
|
+
type: 'timing',
|
|
230
|
+
duration: 100,
|
|
231
|
+
},
|
|
232
|
+
'200ms': {
|
|
233
|
+
type: 'timing',
|
|
234
|
+
duration: 200,
|
|
235
|
+
},
|
|
236
|
+
'250ms': {
|
|
237
|
+
type: 'timing',
|
|
238
|
+
duration: 250,
|
|
239
|
+
},
|
|
240
|
+
'300ms': {
|
|
241
|
+
type: 'timing',
|
|
242
|
+
duration: 300,
|
|
243
|
+
},
|
|
244
|
+
'400ms': {
|
|
245
|
+
type: 'timing',
|
|
246
|
+
duration: 400,
|
|
247
|
+
},
|
|
248
|
+
'500ms': {
|
|
249
|
+
type: 'timing',
|
|
250
|
+
duration: 500,
|
|
251
|
+
},
|
|
252
|
+
'1000ms': {
|
|
253
|
+
type: 'timing',
|
|
254
|
+
duration: 1000,
|
|
255
|
+
},
|
|
256
|
+
bouncy: {
|
|
257
|
+
type: 'spring',
|
|
258
|
+
damping: 9,
|
|
259
|
+
mass: 0.9,
|
|
260
|
+
stiffness: 150,
|
|
261
|
+
},
|
|
262
|
+
lazy: {
|
|
263
|
+
type: 'spring',
|
|
264
|
+
damping: 18,
|
|
265
|
+
stiffness: 50,
|
|
266
|
+
},
|
|
267
|
+
slow: {
|
|
268
|
+
type: 'spring',
|
|
269
|
+
damping: 15,
|
|
270
|
+
stiffness: 40,
|
|
271
|
+
},
|
|
272
|
+
quick: {
|
|
273
|
+
type: 'spring',
|
|
274
|
+
damping: 20,
|
|
275
|
+
mass: 1.2,
|
|
276
|
+
stiffness: 250,
|
|
277
|
+
},
|
|
278
|
+
quicker: {
|
|
279
|
+
type: 'spring',
|
|
280
|
+
damping: 20,
|
|
281
|
+
mass: 1,
|
|
282
|
+
stiffness: 300,
|
|
283
|
+
},
|
|
284
|
+
quickest: {
|
|
285
|
+
type: 'spring',
|
|
286
|
+
damping: 14,
|
|
287
|
+
mass: 0.1,
|
|
288
|
+
stiffness: 380,
|
|
289
|
+
},
|
|
290
|
+
medium: {
|
|
291
|
+
damping: 15,
|
|
292
|
+
stiffness: 120,
|
|
293
|
+
mass: 1,
|
|
294
|
+
},
|
|
295
|
+
tooltip: {
|
|
296
|
+
type: 'spring',
|
|
297
|
+
damping: 10,
|
|
298
|
+
mass: 0.9,
|
|
299
|
+
stiffness: 100,
|
|
300
|
+
},
|
|
301
|
+
})
|
|
302
|
+
|
|
303
|
+
// this is used by the button test...
|
|
304
|
+
config.themes = {
|
|
305
|
+
...config.themes,
|
|
306
|
+
|
|
307
|
+
// @ts-ignore
|
|
308
|
+
light_green_Button: {
|
|
309
|
+
// @ts-ignore
|
|
310
|
+
...config.themes.light_green_Button,
|
|
311
|
+
background: 'green',
|
|
312
|
+
},
|
|
313
|
+
|
|
314
|
+
// @ts-ignore
|
|
315
|
+
light_MyLabel: {
|
|
316
|
+
color: 'red',
|
|
317
|
+
},
|
|
318
|
+
|
|
319
|
+
// Test theme for Issue #3620: color tokens should be fallbacks, not overrides
|
|
320
|
+
// This theme overrides customRed to be green, to verify theme values take precedence
|
|
321
|
+
// @ts-ignore
|
|
322
|
+
light_ColorTokenTest: {
|
|
323
|
+
background: '#ffffff',
|
|
324
|
+
customRed: '#00ff00', // Override the color token (which is #ff0000) with green
|
|
325
|
+
},
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
const search = (typeof window !== 'undefined' && globalThis.location?.search) || ''
|
|
329
|
+
|
|
330
|
+
const useV4Themes = search.includes('v4theme=true')
|
|
331
|
+
const v5config = search.includes('v5config')
|
|
332
|
+
const tamav5Config = search.includes('tamav5config')
|
|
333
|
+
const generatedV5 = search.includes('generatedV5')
|
|
334
|
+
|
|
335
|
+
const tokens = {
|
|
336
|
+
...config.tokens,
|
|
337
|
+
color: {
|
|
338
|
+
...config.tokens.color,
|
|
339
|
+
testsomethingdifferent: '#ff0000',
|
|
340
|
+
customRed: '#ff0000',
|
|
341
|
+
customBlue: '#0000ff',
|
|
342
|
+
customGreen: '#00ff00',
|
|
343
|
+
},
|
|
344
|
+
// size: {
|
|
345
|
+
// 0: 10,
|
|
346
|
+
// },
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
// multi-driver config for testing animatedBy prop and driver selection
|
|
350
|
+
const animationsMultiDriver = {
|
|
351
|
+
default: animationsMotion,
|
|
352
|
+
css: animationsCSS,
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
const animations = search.includes('animationDriver=css')
|
|
356
|
+
? animationsCSS
|
|
357
|
+
: search.includes('animationDriver=native')
|
|
358
|
+
? animationsNative
|
|
359
|
+
: search.includes('animationDriver=motion')
|
|
360
|
+
? animationsMotion
|
|
361
|
+
: search.includes('animationDriver=multi')
|
|
362
|
+
? animationsMultiDriver
|
|
363
|
+
: animationsReanimated
|
|
364
|
+
|
|
365
|
+
const tamaConf = createGui({
|
|
366
|
+
...config,
|
|
367
|
+
// Use v4 themes when ?v4theme=true is in the URL
|
|
368
|
+
themes: useV4Themes
|
|
369
|
+
? guiThemes
|
|
370
|
+
: {
|
|
371
|
+
...config.themes,
|
|
372
|
+
...themeDev,
|
|
373
|
+
},
|
|
374
|
+
shorthands: shorthands,
|
|
375
|
+
settings: {
|
|
376
|
+
defaultFont: '$body',
|
|
377
|
+
allowedStyleValues: 'somewhat-strict',
|
|
378
|
+
autocompleteSpecificTokens: 'except-special',
|
|
379
|
+
fastSchemeChange: true,
|
|
380
|
+
},
|
|
381
|
+
tokens,
|
|
382
|
+
media: {
|
|
383
|
+
...configV4.media, // adds max queries
|
|
384
|
+
...config.media,
|
|
385
|
+
},
|
|
386
|
+
animations, // default reanimated
|
|
387
|
+
|
|
388
|
+
defaultProps: {
|
|
389
|
+
Square: {
|
|
390
|
+
backgroundColor: 'violet',
|
|
391
|
+
},
|
|
392
|
+
},
|
|
393
|
+
})
|
|
394
|
+
|
|
395
|
+
export type Conf = typeof tamaConf
|
|
396
|
+
|
|
397
|
+
declare module '@hanzo/gui' {
|
|
398
|
+
interface GuiCustomConfig extends Conf {}
|
|
399
|
+
|
|
400
|
+
interface TypeOverride {
|
|
401
|
+
groupNames(): 'testy'
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
export default tamav5Config
|
|
406
|
+
? createGui(guiDevConfig)
|
|
407
|
+
: generatedV5
|
|
408
|
+
? createGui({ ...defaultConfig, themes: generatedV5Themes, animations })
|
|
409
|
+
: v5config
|
|
410
|
+
? createGui({ ...defaultConfig, animations })
|
|
411
|
+
: tamaConf
|
package/src/guy.png
ADDED
|
Binary file
|
package/src/index.tsx
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { GuiProviderProps } from '@hanzo/gui'
|
|
2
|
+
import { GuiProvider } from '@hanzo/gui'
|
|
3
|
+
import { ToastProvider } from '@hanzogui/toast'
|
|
4
|
+
|
|
5
|
+
import config from '../gui.config'
|
|
6
|
+
|
|
7
|
+
export function Provider({
|
|
8
|
+
children,
|
|
9
|
+
...rest
|
|
10
|
+
}: Omit<Partial<GuiProviderProps>, 'config'>) {
|
|
11
|
+
return (
|
|
12
|
+
<GuiProvider config={config} defaultTheme="light" {...rest}>
|
|
13
|
+
<ToastProvider swipeDirection="horizontal" duration={5000}>
|
|
14
|
+
{children}
|
|
15
|
+
</ToastProvider>
|
|
16
|
+
</GuiProvider>
|
|
17
|
+
)
|
|
18
|
+
}
|
package/src/test.tsx
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import type { ColorSchemeName } from 'react-native'
|
|
3
|
+
import { Appearance } from 'react-native'
|
|
4
|
+
|
|
5
|
+
export type ThemeMode = 'system' | 'light' | 'dark'
|
|
6
|
+
|
|
7
|
+
export const ThemeContext = React.createContext({
|
|
8
|
+
mode: 'system' as ThemeMode,
|
|
9
|
+
resolvedTheme: Appearance.getColorScheme() as ColorSchemeName,
|
|
10
|
+
set(next: ThemeMode) {},
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
export const useThemeControl = () => {
|
|
14
|
+
return React.useContext(ThemeContext)
|
|
15
|
+
}
|