@skyroc/scripts 2.5.1 → 2.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -3
- package/dist/cli.mjs +1 -1
- package/dist/{config-BKkdncJS.mjs → config-Cj9IzlRz.mjs} +105 -5
- package/dist/index.mjs +1 -1
- package/package.json +3 -3
- package/templates/admin/package.json +5 -1
- package/templates/admin/src/assets/svg-icon/logo.svg +1 -1
- package/templates/admin/uno.config.ts +1 -1
- package/templates/admin-root/.agents/skills/component-doc/SKILL.md +304 -0
- package/templates/admin-root/.agents/skills/component-refactoring/SKILL.md +483 -0
- package/templates/admin-root/.agents/skills/component-refactoring/references/complexity-patterns.md +493 -0
- package/templates/admin-root/.agents/skills/component-refactoring/references/component-splitting.md +477 -0
- package/templates/admin-root/.agents/skills/component-refactoring/references/hook-extraction.md +317 -0
- package/templates/admin-root/.agents/skills/doc-coauthoring/SKILL.md +375 -0
- package/templates/admin-root/.agents/skills/feature-dev/SKILL.md +78 -0
- package/templates/admin-root/.agents/skills/frontend-code-review/SKILL.md +73 -0
- package/templates/admin-root/.agents/skills/frontend-code-review/references/business-logic.md +15 -0
- package/templates/admin-root/.agents/skills/frontend-code-review/references/code-quality.md +44 -0
- package/templates/admin-root/.agents/skills/frontend-code-review/references/performance.md +45 -0
- package/templates/admin-root/.agents/skills/frontend-design/LICENSE.txt +177 -0
- package/templates/admin-root/.agents/skills/frontend-design/SKILL.md +42 -0
- package/templates/admin-root/.agents/skills/frontend-testing/SKILL.md +325 -0
- package/templates/admin-root/.agents/skills/frontend-testing/assets/component-test.template.tsx +293 -0
- package/templates/admin-root/.agents/skills/frontend-testing/assets/hook-test.template.ts +207 -0
- package/templates/admin-root/.agents/skills/frontend-testing/assets/utility-test.template.ts +154 -0
- package/templates/admin-root/.agents/skills/frontend-testing/references/async-testing.md +345 -0
- package/templates/admin-root/.agents/skills/frontend-testing/references/checklist.md +205 -0
- package/templates/admin-root/.agents/skills/frontend-testing/references/common-patterns.md +449 -0
- package/templates/admin-root/.agents/skills/frontend-testing/references/domain-components.md +523 -0
- package/templates/admin-root/.agents/skills/frontend-testing/references/mocking.md +512 -0
- package/templates/admin-root/.agents/skills/frontend-testing/references/workflow.md +269 -0
- package/templates/admin-root/.agents/skills/migrate-nativewind-to-uniwind/SKILL.md +734 -0
- package/templates/admin-root/.agents/skills/migrate-oxfmt/SKILL.md +202 -0
- package/templates/admin-root/.agents/skills/migrate-oxlint/SKILL.md +196 -0
- package/templates/admin-root/.agents/skills/native-component-doc/SKILL.md +245 -0
- package/templates/admin-root/.agents/skills/senior-frontend/SKILL.md +209 -0
- package/templates/admin-root/.agents/skills/senior-frontend/references/frontend_best_practices.md +103 -0
- package/templates/admin-root/.agents/skills/senior-frontend/references/nextjs_optimization_guide.md +103 -0
- package/templates/admin-root/.agents/skills/senior-frontend/references/react_patterns.md +103 -0
- package/templates/admin-root/.agents/skills/senior-frontend/scripts/bundle_analyzer.py +114 -0
- package/templates/admin-root/.agents/skills/senior-frontend/scripts/component_generator.py +114 -0
- package/templates/admin-root/.agents/skills/senior-frontend/scripts/frontend_scaffolder.py +114 -0
- package/templates/admin-root/.agents/skills/skill-creator/SKILL.md +355 -0
- package/templates/admin-root/.agents/skills/skill-creator/references/output-patterns.md +86 -0
- package/templates/admin-root/.agents/skills/skill-creator/references/workflows.md +28 -0
- package/templates/admin-root/.agents/skills/skill-creator/scripts/init_skill.py +300 -0
- package/templates/admin-root/.agents/skills/skill-creator/scripts/package_skill.py +110 -0
- package/templates/admin-root/.agents/skills/skill-creator/scripts/quick_validate.py +97 -0
- package/templates/admin-root/.agents/skills/skyroc-admin-prd-prototype/SKILL.md +163 -0
- package/templates/admin-root/.agents/skills/skyroc-admin-prd-prototype/references/acceptance-checklist.md +75 -0
- package/templates/admin-root/.agents/skills/skyroc-admin-prd-prototype/references/evidence-order.md +109 -0
- package/templates/admin-root/.agents/skills/skyroc-admin-prd-prototype/references/prd-rules.md +103 -0
- package/templates/admin-root/.agents/skills/skyroc-admin-prd-prototype/references/prototype-rules.md +85 -0
- package/templates/admin-root/.agents/skills/skyroc-admin-prd-prototype/scripts/verify-prototypes.mjs +144 -0
- package/templates/admin-root/.agents/skills/skyroc-admin-prd-prototype/templates/admin-page.html +771 -0
- package/templates/admin-root/.agents/skills/skyroc-admin-prd-prototype/templates/prd.md +182 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/SKILL.md +292 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/charts.csv +26 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/colors.csv +97 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/icons.csv +101 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/landing.csv +31 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/products.csv +97 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/styles.csv +68 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/typography.csv +58 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/scripts/core.py +253 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/scripts/search.py +114 -0
- package/templates/admin-root/.agents/skills/uniwind/SKILL.md +64 -0
- package/templates/admin-root/.agents/skills/uniwind/references/component-bindings.md +338 -0
- package/templates/admin-root/.agents/skills/uniwind/references/css-and-utilities.md +325 -0
- package/templates/admin-root/.agents/skills/uniwind/references/integrations.md +75 -0
- package/templates/admin-root/.agents/skills/uniwind/references/pro.md +354 -0
- package/templates/admin-root/.agents/skills/uniwind/references/setup.md +144 -0
- package/templates/admin-root/.agents/skills/uniwind/references/styling-patterns.md +237 -0
- package/templates/admin-root/.agents/skills/uniwind/references/theming.md +309 -0
- package/templates/admin-root/.agents/skills/uniwind/references/troubleshooting.md +179 -0
- package/templates/admin-root/.agents/skills/uniwind/references/variants-and-selectors.md +224 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/AGENTS.md +2934 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/SKILL.md +136 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md +55 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/advanced-init-once.md +42 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/advanced-use-latest.md +39 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/async-api-routes.md +38 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/async-defer-await.md +80 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/async-dependencies.md +51 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/async-parallel.md +28 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md +99 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md +59 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/bundle-conditional.md +31 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md +49 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md +35 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/bundle-preload.md +50 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/client-event-listeners.md +74 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/client-localstorage-schema.md +71 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md +48 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/client-swr-dedup.md +56 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/js-batch-dom-css.md +107 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/js-cache-function-results.md +80 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/js-cache-property-access.md +28 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/js-cache-storage.md +70 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/js-combine-iterations.md +32 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/js-early-exit.md +50 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/js-hoist-regexp.md +45 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/js-index-maps.md +37 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/js-length-check-first.md +49 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/js-min-max-loop.md +82 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/js-set-map-lookups.md +24 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md +57 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rendering-activity.md +26 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rendering-conditional-render.md +40 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rendering-content-visibility.md +38 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md +46 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md +30 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rendering-svg-precision.md +28 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rendering-usetransition-loading.md +75 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rerender-defer-reads.md +39 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rerender-dependencies.md +45 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md +40 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rerender-derived-state.md +29 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md +74 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md +58 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rerender-memo-with-default-value.md +38 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rerender-memo.md +44 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rerender-move-effect-to-event.md +45 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md +35 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rerender-transitions.md +40 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md +73 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/server-after-nonblocking.md +73 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/server-auth-actions.md +96 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/server-cache-lru.md +41 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/server-cache-react.md +76 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/server-dedup-props.md +65 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/server-parallel-fetching.md +83 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/server-serialization.md +38 -0
- package/templates/admin-root/.claude/settings.json +5 -0
- package/templates/admin-root/.claude/skills/component-doc/SKILL.md +304 -0
- package/templates/admin-root/.claude/skills/component-refactoring/SKILL.md +483 -0
- package/templates/admin-root/.claude/skills/component-refactoring/references/complexity-patterns.md +493 -0
- package/templates/admin-root/.claude/skills/component-refactoring/references/component-splitting.md +477 -0
- package/templates/admin-root/.claude/skills/component-refactoring/references/hook-extraction.md +317 -0
- package/templates/admin-root/.claude/skills/doc-coauthoring/SKILL.md +375 -0
- package/templates/admin-root/.claude/skills/feature-dev/SKILL.md +78 -0
- package/templates/admin-root/.claude/skills/frontend-code-review/SKILL.md +73 -0
- package/templates/admin-root/.claude/skills/frontend-code-review/references/business-logic.md +15 -0
- package/templates/admin-root/.claude/skills/frontend-code-review/references/code-quality.md +44 -0
- package/templates/admin-root/.claude/skills/frontend-code-review/references/performance.md +45 -0
- package/templates/admin-root/.claude/skills/frontend-design/LICENSE.txt +177 -0
- package/templates/admin-root/.claude/skills/frontend-design/SKILL.md +42 -0
- package/templates/admin-root/.claude/skills/frontend-testing/SKILL.md +325 -0
- package/templates/admin-root/.claude/skills/frontend-testing/assets/component-test.template.tsx +293 -0
- package/templates/admin-root/.claude/skills/frontend-testing/assets/hook-test.template.ts +207 -0
- package/templates/admin-root/.claude/skills/frontend-testing/assets/utility-test.template.ts +154 -0
- package/templates/admin-root/.claude/skills/frontend-testing/references/async-testing.md +345 -0
- package/templates/admin-root/.claude/skills/frontend-testing/references/checklist.md +205 -0
- package/templates/admin-root/.claude/skills/frontend-testing/references/common-patterns.md +449 -0
- package/templates/admin-root/.claude/skills/frontend-testing/references/domain-components.md +523 -0
- package/templates/admin-root/.claude/skills/frontend-testing/references/mocking.md +512 -0
- package/templates/admin-root/.claude/skills/frontend-testing/references/workflow.md +269 -0
- package/templates/admin-root/.claude/skills/migrate-nativewind-to-uniwind +1 -0
- package/templates/admin-root/.claude/skills/native-component-doc/SKILL.md +245 -0
- package/templates/admin-root/.claude/skills/senior-frontend/SKILL.md +209 -0
- package/templates/admin-root/.claude/skills/senior-frontend/references/frontend_best_practices.md +103 -0
- package/templates/admin-root/.claude/skills/senior-frontend/references/nextjs_optimization_guide.md +103 -0
- package/templates/admin-root/.claude/skills/senior-frontend/references/react_patterns.md +103 -0
- package/templates/admin-root/.claude/skills/senior-frontend/scripts/bundle_analyzer.py +114 -0
- package/templates/admin-root/.claude/skills/senior-frontend/scripts/component_generator.py +114 -0
- package/templates/admin-root/.claude/skills/senior-frontend/scripts/frontend_scaffolder.py +114 -0
- package/templates/admin-root/.claude/skills/skill-creator/SKILL.md +355 -0
- package/templates/admin-root/.claude/skills/skill-creator/references/output-patterns.md +86 -0
- package/templates/admin-root/.claude/skills/skill-creator/references/workflows.md +28 -0
- package/templates/admin-root/.claude/skills/skill-creator/scripts/init_skill.py +300 -0
- package/templates/admin-root/.claude/skills/skill-creator/scripts/package_skill.py +110 -0
- package/templates/admin-root/.claude/skills/skill-creator/scripts/quick_validate.py +97 -0
- package/templates/admin-root/.claude/skills/ui-ux-pro-max/SKILL.md +386 -0
- package/templates/admin-root/.claude/skills/ui-ux-pro-max/data +1 -0
- package/templates/admin-root/.claude/skills/ui-ux-pro-max/scripts +1 -0
- package/templates/admin-root/.claude/skills/uniwind +1 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/AGENTS.md +2934 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/SKILL.md +136 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md +55 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/advanced-init-once.md +42 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/advanced-use-latest.md +39 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/async-api-routes.md +38 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/async-defer-await.md +80 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/async-dependencies.md +51 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/async-parallel.md +28 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md +99 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md +59 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/bundle-conditional.md +31 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md +49 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md +35 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/bundle-preload.md +50 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/client-event-listeners.md +74 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/client-localstorage-schema.md +71 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md +48 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/client-swr-dedup.md +56 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/js-batch-dom-css.md +107 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/js-cache-function-results.md +80 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/js-cache-property-access.md +28 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/js-cache-storage.md +70 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/js-combine-iterations.md +32 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/js-early-exit.md +50 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/js-hoist-regexp.md +45 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/js-index-maps.md +37 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/js-length-check-first.md +49 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/js-min-max-loop.md +82 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/js-set-map-lookups.md +24 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md +57 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rendering-activity.md +26 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rendering-conditional-render.md +40 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rendering-content-visibility.md +38 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md +46 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md +30 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rendering-svg-precision.md +28 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rendering-usetransition-loading.md +75 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rerender-defer-reads.md +39 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rerender-dependencies.md +45 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md +40 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rerender-derived-state.md +29 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md +74 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md +58 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rerender-memo-with-default-value.md +38 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rerender-memo.md +44 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rerender-move-effect-to-event.md +45 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md +35 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rerender-transitions.md +40 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md +73 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/server-after-nonblocking.md +73 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/server-auth-actions.md +96 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/server-cache-lru.md +41 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/server-cache-react.md +76 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/server-dedup-props.md +65 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/server-parallel-fetching.md +83 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/server-serialization.md +38 -0
- package/templates/admin-root/.cursor/settings.json +10 -0
- package/templates/admin-root/.editorconfig +19 -0
- package/templates/admin-root/.gitattributes +16 -0
- package/templates/admin-root/.oxfmtrc.json +35 -0
- package/templates/admin-root/AGENTS.md +297 -0
- package/templates/admin-root/CLAUDE.md +1 -0
- package/templates/admin-root/skills-lock.json +27 -0
- package/templates/admin-root.manifest.json +1317 -0
- package/templates/admin.meta.json +9 -4
- package/LICENSE +0 -21
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
## Setup Diagnostics
|
|
2
|
+
|
|
3
|
+
When styles aren't working, check in this order:
|
|
4
|
+
|
|
5
|
+
### 1. package.json
|
|
6
|
+
- `"uniwind"` (or `"uniwind-pro"`) in dependencies
|
|
7
|
+
- `"tailwindcss"` at v4+ (`^4.0.0`)
|
|
8
|
+
- For Pro: `react-native-nitro-modules`, `react-native-reanimated`, `react-native-worklets`
|
|
9
|
+
|
|
10
|
+
### 2. metro.config.js
|
|
11
|
+
- `withUniwindConfig` imported from `'uniwind/metro'`
|
|
12
|
+
- `withUniwindConfig` is the **outermost** wrapper
|
|
13
|
+
- `cssEntryFile` is a **relative path string** (e.g., `'./global.css'`)
|
|
14
|
+
- No `path.resolve()` or absolute paths
|
|
15
|
+
- For Pro default styles: `experimental.defaultStyles: true` is set
|
|
16
|
+
|
|
17
|
+
### 3. global.css
|
|
18
|
+
- Contains `@import 'tailwindcss';` AND `@import 'uniwind';`
|
|
19
|
+
- Imported in `App.tsx` or root layout, **NOT** in `index.ts`/`index.js`
|
|
20
|
+
- Location determines app root for Tailwind scanning
|
|
21
|
+
|
|
22
|
+
### 4. babel.config.js (Pro only)
|
|
23
|
+
- `'react-native-worklets/plugin'` in plugins array
|
|
24
|
+
|
|
25
|
+
### 5. TypeScript
|
|
26
|
+
- `uniwind-types.d.ts` exists (generated after running Metro)
|
|
27
|
+
- Included in `tsconfig.json` or placed in `src/`/`app/` dir
|
|
28
|
+
|
|
29
|
+
### 6. Build
|
|
30
|
+
- Metro server restarted after config changes
|
|
31
|
+
- Metro cache cleared (`npx expo start --clear` or `npx react-native start --reset-cache`)
|
|
32
|
+
- Native rebuild done (if Pro or after dependency changes)
|
|
33
|
+
|
|
34
|
+
## Troubleshooting
|
|
35
|
+
|
|
36
|
+
| Symptom | Cause | Fix |
|
|
37
|
+
|---------|-------|-----|
|
|
38
|
+
| Styles not applying | Missing imports in global.css | Add `@import 'tailwindcss'; @import 'uniwind';` |
|
|
39
|
+
| Styles not applying | global.css imported in index.js | Move import to App.tsx or `_layout.tsx` |
|
|
40
|
+
| Classes not detected | global.css in nested dir, components elsewhere | Add `@source '../components'` in global.css |
|
|
41
|
+
| TypeScript errors on className | Missing types file | Run Metro to generate `uniwind-types.d.ts` |
|
|
42
|
+
| `withUniwindConfig is not a function` | Wrong import | Use `require('uniwind/metro')` not `require('uniwind')` |
|
|
43
|
+
| Hot reload full-reloads | global.css imported in wrong file | Move to App.tsx or root layout |
|
|
44
|
+
| `cssEntryFile` error / Metro crash | Absolute path used | Use relative: `'./global.css'` |
|
|
45
|
+
| `withUniwindConfig` not outermost | Another wrapper wraps Uniwind | Swap order so Uniwind is outermost |
|
|
46
|
+
| Dark theme not working | Missing `@variant dark` | Define dark variant in `@layer theme` |
|
|
47
|
+
| Custom theme not appearing | Not registered in metro config | Add to `extraThemes` array, restart Metro |
|
|
48
|
+
| Fonts not loading | Font name mismatch | CSS font name must match file name exactly (no extension) |
|
|
49
|
+
| `rem` values too large/small | Wrong base rem | Set `polyfills: { rem: 14 }` for NativeWind compat |
|
|
50
|
+
| Unsupported CSS warning | Web-specific CSS used | Enable `debug: true` to identify; remove unsupported properties |
|
|
51
|
+
| `Failed to serialize javascript object` | Complex CSS, circular refs, or stale cache | Clear caches: `watchman watch-del-all; rm -rf node_modules/.cache; npx expo start --clear`. Also check if docs/markdown files containing CSS classes are in the scan path (see below) |
|
|
52
|
+
| `Failed to serialize javascript object` from llms-full.txt or docs | Docs/markdown files with CSS classes in project dir get scanned by Tailwind | Move `.md` files with CSS examples outside the project root, or add to `.gitignore` so Tailwind's scanner skips them |
|
|
53
|
+
| `unstable_enablePackageExports` conflict | App disables package exports | Use selective resolver for Uniwind and culori |
|
|
54
|
+
| Classes from monorepo package missing | Not included in Tailwind scan | Add `@source '../../packages/ui'` in global.css |
|
|
55
|
+
| Classes from `node_modules` library missing in production (bun) | Bun uses symlinks; Tailwind's Oxide scanner can't follow them | Use resolved path: `@source "../../node_modules/heroui-native/lib"` and add `public-hoist-pattern[]=heroui-native` to `.npmrc` |
|
|
56
|
+
| `active:` not working with `withUniwind` | `withUniwind` does NOT support interactive state selectors | Only core RN `Pressable`/`TextInput`/`Switch` support `active:`/`focus:`/`disabled:`. Third-party pressables wrapped with `withUniwind` won't get states |
|
|
57
|
+
| `withUniwind` custom mapping overrides `className`+`style` merging | When manual mapping is provided, `style` prop is not merged | Use auto mapping (no second arg) for `className`+`style` merge. For manual mapping + `className`, double-wrap: `withUniwind(withUniwind(Comp), { mapping })` |
|
|
58
|
+
| `withUniwind` loses generic types on `ref` (e.g., `FlashList<T>`) | TypeScript limitation with HOCs | Cast the ref manually: `ref={scrollRef as any}` |
|
|
59
|
+
| Platform-specific fonts: `@theme` block error | `@media ios/android` inside `@theme {}` | Use `@layer theme { :root { @variant ios { ... } } }` instead — `@theme` only accepts custom properties, and platform selection uses `@variant` not `@media` |
|
|
60
|
+
| `Uniwind.setTheme('system')` crash on Android (RN 0.82+) | RN 0.82 changed Appearance API | Update to latest Uniwind (fixed). Avoid `setTheme('system')` on older Uniwind + RN 0.82+ |
|
|
61
|
+
| Styles flash/disappear on initial load (Android) | `SafeAreaListener` fires before component listeners mount | Fixed in recent versions. If persists, ensure Uniwind is latest |
|
|
62
|
+
| `useTVEventHandler` is undefined | Uniwind module replacement interferes with tvOS exports | Fixed in v1.2.1+. Update Uniwind |
|
|
63
|
+
| `@layer theme` variables not rendering on web | Bug with RNW + Expo SDK 55 | Fixed in v1.4.1+. Update Uniwind |
|
|
64
|
+
| `updateCSSVariables` wrong theme at app start | Calling for multiple themes back-to-back; last call wins on first render | Call `updateCSSVariables` for the current theme last. After initial load, order doesn't matter |
|
|
65
|
+
| Pro: animations not working | Missing Babel plugin | Add `react-native-worklets/plugin` to babel.config.js |
|
|
66
|
+
| Pro: module not found | No native rebuild | Run `npx expo prebuild --clean` then `npx expo run:ios` |
|
|
67
|
+
| Pro: postinstall failed | Package manager blocks scripts | Add to `trustedDependencies` (bun) or configure yarn/pnpm |
|
|
68
|
+
| Pro: auth expired | Login session expired (180-day lifetime) | Run `npx uniwind-pro`, re-login |
|
|
69
|
+
| Pro: download limit reached | Monthly download limit hit | Check Pro dashboard, limits reset monthly |
|
|
70
|
+
| Pro: `Uniwind.updateInsets` called unnecessarily | Pro injects insets natively | `Uniwind.updateInsets` is a no-op in Pro. Remove `SafeAreaListener` setup when using Pro |
|
|
71
|
+
| Pro: theme transition crash | Missing `ThemeTransitionPreset` import or calling before app is ready | Import from `'uniwind'`. Ensure the app has fully mounted before calling `setTheme` with a transition |
|
|
72
|
+
| Pro: default component styles not applying | Feature disabled or unsupported selector | Use Uniwind Pro 1.2.0+, enable `experimental.defaultStyles: true`, restart Metro, and use supported RN component selectors like `View` or `Text` |
|
|
73
|
+
|
|
74
|
+
### unstable_enablePackageExports Selective Resolver
|
|
75
|
+
|
|
76
|
+
If your app disables `unstable_enablePackageExports` (common in crypto apps), use a selective resolver:
|
|
77
|
+
|
|
78
|
+
```js
|
|
79
|
+
config.resolver.unstable_enablePackageExports = false;
|
|
80
|
+
config.resolver.resolveRequest = (context, moduleName, platform) => {
|
|
81
|
+
if (['uniwind', 'culori'].some((prefix) => moduleName.startsWith(prefix))) {
|
|
82
|
+
return context.resolveRequest(
|
|
83
|
+
{ ...context, unstable_enablePackageExports: true },
|
|
84
|
+
moduleName,
|
|
85
|
+
platform
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
return context.resolveRequest(context, moduleName, platform);
|
|
89
|
+
};
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## FAQ
|
|
93
|
+
|
|
94
|
+
**Where to put global.css in Expo Router?**
|
|
95
|
+
Project root. Import in `app/_layout.tsx`. If placed in `app/`, add `@source` for sibling dirs.
|
|
96
|
+
|
|
97
|
+
**Does Uniwind work with Expo Go?**
|
|
98
|
+
Free: Yes. Pro: No — requires native rebuild (development builds).
|
|
99
|
+
|
|
100
|
+
**Can I use tailwind.config.js?**
|
|
101
|
+
No. Uniwind uses Tailwind v4 — all config via `@theme` in `global.css`.
|
|
102
|
+
|
|
103
|
+
**How to access CSS variables in JS?**
|
|
104
|
+
Inside components: `useCSSVariable('--color-primary')` (reactive). Outside React: `Uniwind.getCSSVariable('--color-primary')` (one-shot, 1.6.4+). For variables not used in classNames, define with `@theme static`.
|
|
105
|
+
|
|
106
|
+
**Can I use Platform.select()?**
|
|
107
|
+
Yes, but prefer platform selectors (`ios:pt-12 android:pt-6`) — cleaner, no imports.
|
|
108
|
+
|
|
109
|
+
**Next.js support?**
|
|
110
|
+
Not officially supported. Community plugin: `uniwind-plugin-next`. For Next.js, use standard Tailwind CSS.
|
|
111
|
+
|
|
112
|
+
**Vite support?**
|
|
113
|
+
Yes, since v1.2.0. Use `uniwind/vite` plugin alongside `@tailwindcss/vite`.
|
|
114
|
+
|
|
115
|
+
**Full app reloads on CSS changes?**
|
|
116
|
+
Metro can't hot-reload files with many providers. Move `global.css` import deeper in the component tree.
|
|
117
|
+
|
|
118
|
+
**Style specificity?**
|
|
119
|
+
Important utilities like `bg-red-500!` override non-important utilities for the same property and work with variants (`active:bg-red-500!`, `ios:pt-12!`). Inline `style` always overrides `className`, even important utilities. Use `className` for static styles, inline only for truly dynamic values. Use `cn()` from tailwind-merge for component libraries where classNames may conflict.
|
|
120
|
+
|
|
121
|
+
**How do I include custom fonts?**
|
|
122
|
+
Load font files (Expo: `expo-font` plugin in `app.json`; Bare RN: `react-native-asset`), then map in CSS: `@theme { --font-sans: 'Roboto-Regular'; }`. Font name must exactly match the file name. See [Fonts](./css-and-utilities.md#fonts).
|
|
123
|
+
|
|
124
|
+
**How can I style based on prop values?**
|
|
125
|
+
Use data selectors: `data-[selected=true]:ring-2`. Only equality checks supported. See [Data Selectors](./variants-and-selectors.md#data-selectors).
|
|
126
|
+
|
|
127
|
+
**How can I use gradients?**
|
|
128
|
+
Built-in: `bg-gradient-to-r from-red-500 to-green-500`. Also supports angle-based (`bg-linear-90`) and arbitrary values (`bg-linear-[45deg,#f00_0%,#00f_100%]`). See [Gradients](./css-and-utilities.md#gradients).
|
|
129
|
+
|
|
130
|
+
**How does className deduplication work?**
|
|
131
|
+
Uniwind does NOT auto-deduplicate conflicting classNames. Use `tailwind-merge` with a `cn()` utility. See [cn Utility](./styling-patterns.md#cn-utility--class-deduplication).
|
|
132
|
+
|
|
133
|
+
**How to debug 'Failed to serialize javascript object'?**
|
|
134
|
+
Clear caches: `watchman watch-del-all; rm -rf node_modules/.cache; npx expo start --clear`. Enable `debug: true` in metro config to identify the problematic CSS pattern. See [Troubleshooting](#troubleshooting).
|
|
135
|
+
|
|
136
|
+
**How do I enable safe area classNames?**
|
|
137
|
+
Free: Install `react-native-safe-area-context`, wrap root with `SafeAreaListener`, call `Uniwind.updateInsets(insets)`. Pro: Automatic — no setup. Then use `pt-safe`, `pb-safe`, etc. See [Safe Area Utilities](./variants-and-selectors.md#safe-area-utilities).
|
|
138
|
+
|
|
139
|
+
**What UI kits work well with Uniwind?**
|
|
140
|
+
**React Native Reusables** (shadcn philosophy, copy-paste components) and **HeroUI Native** (complete library, optimized for Uniwind). Any library works via `withUniwind` wrapper. See [UI Kit Compatibility](./integrations.md#ui-kit-compatibility).
|
|
141
|
+
|
|
142
|
+
**Can I scope a theme to a single component?**
|
|
143
|
+
Yes, use `ScopedTheme`: `<ScopedTheme theme="dark"><Card /></ScopedTheme>`. It forces a theme for the subtree without changing the global theme. See [Theming](./theming.md#theming).
|
|
144
|
+
|
|
145
|
+
**Does `active:` work with `react-native-gesture-handler` Pressable?**
|
|
146
|
+
No. `withUniwind` does NOT support interactive state selectors (`active:`, `focus:`, `disabled:`). Only core RN `Pressable`, `TextInput`, and `Switch` support them. For RNGH components, use `onPressIn`/`onPressOut` with state.
|
|
147
|
+
|
|
148
|
+
**Can I customize the default `border` color?**
|
|
149
|
+
Yes — use `@utility border` to override the class entirely:
|
|
150
|
+
```css
|
|
151
|
+
@utility border {
|
|
152
|
+
border-width: 1px;
|
|
153
|
+
border-style: solid;
|
|
154
|
+
border-color: var(--color-primary);
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
This completely replaces the built-in `border` behavior, so re-declare any properties you still need. Alternatively, use `border border-gray-300` explicitly or define `--color-border` in `@theme` and use `border-border`.
|
|
158
|
+
|
|
159
|
+
**Can I use platform-specific fonts in `@theme {}`?**
|
|
160
|
+
No. `@theme {}` only accepts custom properties. Use `@layer theme { :root { @variant ios { --font-sans: '...'; } } }` instead. Note: use `@variant` (not `@media`) for platform selection in CSS.
|
|
161
|
+
|
|
162
|
+
**Does Uniwind work with ESM metro config (`metro.config.mjs` or `metro.config.ts`)?**
|
|
163
|
+
Yes since v1.3.0+. If you hit `Class extends value is not a constructor`, update Uniwind or use CommonJS `metro.config.js`.
|
|
164
|
+
|
|
165
|
+
**Classes from `node_modules` work in dev but not production (bun)?**
|
|
166
|
+
Bun symlinks packages. Tailwind's Oxide scanner can't follow them. Use resolved `@source` paths and hoist the package. See [UI Kit Compatibility](./integrations.md#ui-kit-compatibility) for details.
|
|
167
|
+
|
|
168
|
+
**How to clear all caches when debugging?**
|
|
169
|
+
`watchman watch-del-all 2>/dev/null; rm -rf node_modules/.cache && npx expo start --clear`. This clears Watchman, Babel/bundler caches, and Expo internal cache.
|
|
170
|
+
|
|
171
|
+
## MCP Server
|
|
172
|
+
|
|
173
|
+
Uniwind provides an official MCP server for AI-assisted development. If the user's environment supports MCP, recommend setting it up: [https://docs.uniwind.dev/mcp](https://docs.uniwind.dev/mcp)
|
|
174
|
+
|
|
175
|
+
## Related Skills
|
|
176
|
+
|
|
177
|
+
**NativeWind → Uniwind migration**: Use the `migrate-nativewind-to-uniwind` skill for migrating from NativeWind. It handles package removal, config migration, Tailwind v4 upgrade, `cssInterop` removal, theme conversion, and all breaking changes. It is tested and production-ready.
|
|
178
|
+
|
|
179
|
+
**IMPORTANT**: Do NOT guess Uniwind APIs. If you are unsure about any Uniwind API, hook, component, or configuration option, fetch and verify against the official docs: [https://docs.uniwind.dev/llms-full.txt](https://docs.uniwind.dev/llms-full.txt)
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
## Platform Selectors
|
|
2
|
+
|
|
3
|
+
Apply platform-specific styles directly in className:
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
// Individual platforms
|
|
7
|
+
<View className="ios:bg-red-500 android:bg-blue-500 web:bg-green-500" />
|
|
8
|
+
|
|
9
|
+
// native: shorthand (iOS + Android)
|
|
10
|
+
<View className="native:bg-blue-500 web:bg-gray-500" />
|
|
11
|
+
|
|
12
|
+
// TV platforms
|
|
13
|
+
<View className="tv:p-8 android-tv:bg-black apple-tv:bg-gray-900" />
|
|
14
|
+
|
|
15
|
+
// Combine with other utilities
|
|
16
|
+
<View className="p-4 ios:pt-12 android:pt-6 web:pt-4" />
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Platform variants in `@layer theme` for global values (use `@variant`, not `@media`):
|
|
20
|
+
|
|
21
|
+
```css
|
|
22
|
+
@layer theme {
|
|
23
|
+
:root {
|
|
24
|
+
@variant ios { --font-sans: 'SF Pro Text'; }
|
|
25
|
+
@variant android { --font-sans: 'Roboto-Regular'; }
|
|
26
|
+
@variant web { --font-sans: 'Inter'; }
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**Prefer platform selectors over `Platform.select()`** — cleaner syntax, no imports needed.
|
|
32
|
+
|
|
33
|
+
## Data Selectors
|
|
34
|
+
|
|
35
|
+
Style based on prop values using `data-[prop=value]:utility`:
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
// Boolean props
|
|
39
|
+
<Pressable
|
|
40
|
+
data-selected={isSelected}
|
|
41
|
+
className="border rounded px-3 py-2 data-[selected=true]:ring-2 data-[selected=true]:ring-primary"
|
|
42
|
+
/>
|
|
43
|
+
|
|
44
|
+
// String props
|
|
45
|
+
<View
|
|
46
|
+
data-state={isOpen ? 'open' : 'closed'}
|
|
47
|
+
className="p-4 data-[state=open]:bg-muted/50 data-[state=closed]:bg-transparent"
|
|
48
|
+
/>
|
|
49
|
+
|
|
50
|
+
// Tabs pattern
|
|
51
|
+
<Pressable
|
|
52
|
+
data-selected={route.key === current}
|
|
53
|
+
className="px-4 py-2 rounded-md text-foreground/60
|
|
54
|
+
data-[selected=true]:bg-primary data-[selected=true]:text-white"
|
|
55
|
+
>
|
|
56
|
+
<Text>{route.title}</Text>
|
|
57
|
+
</Pressable>
|
|
58
|
+
|
|
59
|
+
// Toggle pattern
|
|
60
|
+
<Pressable
|
|
61
|
+
data-checked={enabled}
|
|
62
|
+
className="h-6 w-10 rounded-full bg-muted data-[checked=true]:bg-primary"
|
|
63
|
+
>
|
|
64
|
+
<View className="h-5 w-5 rounded-full bg-background translate-x-0 data-[checked=true]:translate-x-4" />
|
|
65
|
+
</Pressable>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Rules**:
|
|
69
|
+
- Only equality selectors supported (`data-[prop=value]`)
|
|
70
|
+
- No presence-only selectors (`data-[prop]` — not supported)
|
|
71
|
+
- No `has-data-*` parent selectors (not supported in React Native)
|
|
72
|
+
- Booleans match both boolean and string forms
|
|
73
|
+
|
|
74
|
+
## Interactive States
|
|
75
|
+
|
|
76
|
+
```tsx
|
|
77
|
+
// active: — when pressed
|
|
78
|
+
<Pressable className="bg-primary active:bg-primary/80 active:opacity-90 active:scale-95">
|
|
79
|
+
<Text className="text-white">Press me</Text>
|
|
80
|
+
</Pressable>
|
|
81
|
+
|
|
82
|
+
// disabled: — when disabled prop is true
|
|
83
|
+
<Pressable
|
|
84
|
+
disabled={isLoading}
|
|
85
|
+
className="bg-primary disabled:bg-gray-300 disabled:opacity-50"
|
|
86
|
+
>
|
|
87
|
+
<Text className="text-white disabled:text-gray-500">Submit</Text>
|
|
88
|
+
</Pressable>
|
|
89
|
+
|
|
90
|
+
// focus: — keyboard/accessibility focus
|
|
91
|
+
<TextInput
|
|
92
|
+
className="border border-border rounded-lg px-4 py-2 focus:border-primary focus:ring-2 focus:ring-primary/20"
|
|
93
|
+
/>
|
|
94
|
+
|
|
95
|
+
<Pressable className="bg-card rounded-lg p-4 focus:ring-2 focus:ring-primary">
|
|
96
|
+
<Text className="text-foreground">Focusable</Text>
|
|
97
|
+
</Pressable>
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Components with state support:
|
|
101
|
+
- **Pressable**: `active:`, `disabled:`, `focus:`
|
|
102
|
+
- **TextInput**: `active:`, `disabled:`, `focus:`
|
|
103
|
+
- **Switch**: `disabled:`
|
|
104
|
+
- **Text**: `active:`, `disabled:`
|
|
105
|
+
- **TouchableOpacity / TouchableHighlight / TouchableNativeFeedback / TouchableWithoutFeedback**: `active:`, `disabled:`
|
|
106
|
+
|
|
107
|
+
## Responsive Breakpoints
|
|
108
|
+
|
|
109
|
+
Mobile-first — unprefixed styles apply to all sizes, prefixed styles apply at that breakpoint and above:
|
|
110
|
+
|
|
111
|
+
| Prefix | Min Width | Typical Device |
|
|
112
|
+
|--------|-----------|----------------|
|
|
113
|
+
| (none) | 0px | All (mobile) |
|
|
114
|
+
| `sm:` | 640px | Large phones |
|
|
115
|
+
| `md:` | 768px | Tablets |
|
|
116
|
+
| `lg:` | 1024px | Landscape tablets |
|
|
117
|
+
| `xl:` | 1280px | Desktops |
|
|
118
|
+
| `2xl:` | 1536px | Large desktops |
|
|
119
|
+
|
|
120
|
+
```tsx
|
|
121
|
+
// Responsive padding and typography
|
|
122
|
+
<View className="p-4 sm:p-6 lg:p-8">
|
|
123
|
+
<Text className="text-base sm:text-lg lg:text-xl font-bold">Responsive</Text>
|
|
124
|
+
</View>
|
|
125
|
+
|
|
126
|
+
// Responsive grid (1 col → 2 col → 3 col)
|
|
127
|
+
<View className="flex-row flex-wrap">
|
|
128
|
+
<View className="w-full sm:w-1/2 lg:w-1/3 p-2">
|
|
129
|
+
<View className="bg-card p-4 rounded"><Text>Item</Text></View>
|
|
130
|
+
</View>
|
|
131
|
+
</View>
|
|
132
|
+
|
|
133
|
+
// Responsive visibility
|
|
134
|
+
<View className="hidden sm:flex flex-row gap-4">
|
|
135
|
+
<Text>Visible on tablet+</Text>
|
|
136
|
+
</View>
|
|
137
|
+
<View className="flex sm:hidden">
|
|
138
|
+
<Text>Mobile only</Text>
|
|
139
|
+
</View>
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Custom breakpoints:
|
|
143
|
+
|
|
144
|
+
```css
|
|
145
|
+
@theme {
|
|
146
|
+
--breakpoint-xs: 480px;
|
|
147
|
+
--breakpoint-tablet: 820px;
|
|
148
|
+
--breakpoint-3xl: 1920px;
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Usage: `xs:p-2 tablet:p-4 3xl:p-8`
|
|
153
|
+
|
|
154
|
+
**Design mobile-first** — start with base styles (no prefix), enhance with breakpoints:
|
|
155
|
+
|
|
156
|
+
```tsx
|
|
157
|
+
// CORRECT — mobile-first
|
|
158
|
+
<View className="w-full sm:w-3/4 md:w-1/2 lg:w-1/3" />
|
|
159
|
+
|
|
160
|
+
// WRONG — desktop-first (reversed order is confusing and fragile)
|
|
161
|
+
<View className="w-full lg:w-1/2 md:w-3/4 sm:w-full" />
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## Safe Area Utilities
|
|
165
|
+
|
|
166
|
+
### Padding
|
|
167
|
+
|
|
168
|
+
| Class | Description |
|
|
169
|
+
|-------|-------------|
|
|
170
|
+
| `p-safe` | All sides |
|
|
171
|
+
| `pt-safe` / `pb-safe` / `pl-safe` / `pr-safe` | Individual sides |
|
|
172
|
+
| `ps-safe` / `pe-safe` | Logical start / end |
|
|
173
|
+
| `px-safe` / `py-safe` | Horizontal / vertical |
|
|
174
|
+
|
|
175
|
+
### Margin
|
|
176
|
+
|
|
177
|
+
| Class | Description |
|
|
178
|
+
|-------|-------------|
|
|
179
|
+
| `m-safe` | All sides |
|
|
180
|
+
| `mt-safe` / `mb-safe` / `ml-safe` / `mr-safe` | Individual sides |
|
|
181
|
+
| `ms-safe` / `me-safe` | Logical start / end |
|
|
182
|
+
| `mx-safe` / `my-safe` | Horizontal / vertical |
|
|
183
|
+
|
|
184
|
+
### Positioning
|
|
185
|
+
|
|
186
|
+
| Class | Description |
|
|
187
|
+
|-------|-------------|
|
|
188
|
+
| `inset-safe` | All sides |
|
|
189
|
+
| `top-safe` / `bottom-safe` / `left-safe` / `right-safe` | Individual sides |
|
|
190
|
+
| `start-safe` / `end-safe` | Logical start / end |
|
|
191
|
+
| `x-safe` / `y-safe` | Horizontal / vertical inset |
|
|
192
|
+
|
|
193
|
+
### Compound Variants
|
|
194
|
+
|
|
195
|
+
| Pattern | Behavior | Example |
|
|
196
|
+
|---------|----------|---------|
|
|
197
|
+
| `{prop}-safe-or-{value}` | `Math.max(inset, value)` — ensures minimum spacing | `pt-safe-or-4` |
|
|
198
|
+
| `{prop}-safe-offset-{value}` | `inset + value` — adds extra spacing on top of inset | `pb-safe-offset-4` |
|
|
199
|
+
|
|
200
|
+
### Setup
|
|
201
|
+
|
|
202
|
+
**Uniwind Free (default)** — requires `react-native-safe-area-context` to update insets.
|
|
203
|
+
Wrap your App component in `SafeAreaProvider` and `SafeAreaListener` and call `Uniwind.updateInsets(insets)` in the `onChange` callback:
|
|
204
|
+
|
|
205
|
+
```tsx
|
|
206
|
+
import { SafeAreaProvider, SafeAreaListener } from 'react-native-safe-area-context';
|
|
207
|
+
import { Uniwind } from 'uniwind';
|
|
208
|
+
|
|
209
|
+
export default function App() {
|
|
210
|
+
return (
|
|
211
|
+
<SafeAreaProvider>
|
|
212
|
+
<SafeAreaListener
|
|
213
|
+
onChange={({ insets }) => {
|
|
214
|
+
Uniwind.updateInsets(insets);
|
|
215
|
+
}}
|
|
216
|
+
>
|
|
217
|
+
<View className="pt-safe px-safe">{/* content */}</View>
|
|
218
|
+
</SafeAreaListener>
|
|
219
|
+
</SafeAreaProvider>
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
**Uniwind Pro** — automatic, no setup needed. Insets injected from native layer.
|