@butternutbox/pawprint-native 0.0.1 → 0.1.0
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/.turbo/turbo-build.log +15 -15
- package/CHANGELOG.md +16 -0
- package/COMPONENT_GUIDELINES.md +111 -4
- package/dist/index.cjs +12370 -1455
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1110 -11
- package/dist/index.d.ts +1110 -11
- package/dist/index.js +12324 -1455
- package/dist/index.js.map +1 -1
- package/package.json +28 -9
- package/src/__mocks__/asset-stub.ts +1 -0
- package/src/__mocks__/emotion-native.tsx +18 -0
- package/src/__mocks__/react-native-gesture-handler.tsx +41 -0
- package/src/__mocks__/react-native-reanimated.tsx +79 -0
- package/src/__mocks__/react-native-safe-area-context.tsx +6 -0
- package/src/__mocks__/react-native-svg.tsx +27 -0
- package/src/__mocks__/react-native-worklets.tsx +11 -0
- package/src/__mocks__/react-native.tsx +338 -0
- package/src/__mocks__/rn-primitives/avatar.tsx +24 -0
- package/src/__mocks__/rn-primitives/checkbox.tsx +19 -0
- package/src/__mocks__/rn-primitives/select.tsx +116 -0
- package/src/__mocks__/rn-primitives/slider.tsx +40 -0
- package/src/__mocks__/rn-primitives/slot.tsx +30 -0
- package/src/__mocks__/rn-primitives/switch.tsx +24 -0
- package/src/__mocks__/rn-primitives/toggle.tsx +16 -0
- package/src/components/atoms/Avatar/Avatar.stories.tsx +57 -49
- package/src/components/atoms/Avatar/Avatar.test.tsx +269 -0
- package/src/components/atoms/Avatar/Avatar.tsx +68 -22
- package/src/components/atoms/Avatar/index.ts +1 -6
- package/src/components/atoms/Badge/Badge.stories.tsx +5 -29
- package/src/components/atoms/Badge/Badge.test.tsx +90 -0
- package/src/components/atoms/Button/Button.test.tsx +123 -0
- package/src/components/atoms/Button/Button.tsx +1 -1
- package/src/components/atoms/CarouselControls/CarouselControls.stories.tsx +217 -0
- package/src/components/atoms/CarouselControls/CarouselControls.tsx +127 -0
- package/src/components/atoms/CarouselControls/index.ts +2 -0
- package/src/components/atoms/Hint/Hint.test.tsx +36 -0
- package/src/components/atoms/Icon/Icon.test.tsx +98 -0
- package/src/components/atoms/Icon/Icon.tsx +5 -1
- package/src/components/atoms/IconButton/IconButton.test.tsx +101 -0
- package/src/components/atoms/Illustration/Illustration.test.tsx +55 -0
- package/src/components/atoms/Input/Input.stories.tsx +129 -86
- package/src/components/atoms/Input/Input.test.tsx +306 -0
- package/src/components/atoms/Input/Input.tsx +9 -1
- package/src/components/atoms/Input/InputField.tsx +226 -74
- package/src/components/atoms/Link/Link.test.tsx +89 -0
- package/src/components/atoms/Logo/Logo.registry.ts +30 -5
- package/src/components/atoms/Logo/Logo.stories.tsx +108 -0
- package/src/components/atoms/Logo/Logo.test.tsx +56 -0
- package/src/components/atoms/Logo/assets/BCorp.tsx +113 -0
- package/src/components/atoms/Logo/assets/ButternutFavicon.tsx +33 -0
- package/src/components/atoms/Logo/assets/ButternutPrimary.tsx +294 -0
- package/src/components/atoms/Logo/assets/ButternutTabbedBottom.tsx +294 -0
- package/src/components/atoms/Logo/assets/ButternutTabbedTop.tsx +294 -0
- package/src/components/atoms/Logo/assets/ButternutWordmark.tsx +274 -0
- package/src/components/atoms/Logo/assets/PsiBufetFavicon.tsx +45 -0
- package/src/components/atoms/Logo/assets/PsiBufetPrimary.tsx +218 -0
- package/src/components/atoms/Logo/assets/PsiBufetTabbedBottom.tsx +218 -0
- package/src/components/atoms/Logo/assets/PsiBufetTabbedTop.tsx +218 -0
- package/src/components/atoms/Logo/assets/PsiBufetWordmark.tsx +195 -0
- package/src/components/atoms/Logo/assets/index.ts +11 -0
- package/src/components/atoms/NumberInput/NumberInput.stories.tsx +183 -0
- package/src/components/atoms/NumberInput/NumberInput.test.tsx +261 -0
- package/src/components/atoms/NumberInput/NumberInput.tsx +129 -0
- package/src/components/atoms/NumberInput/NumberInputField.tsx +77 -0
- package/src/components/atoms/NumberInput/index.ts +4 -0
- package/src/components/atoms/Spinner/Spinner.test.tsx +46 -0
- package/src/components/atoms/Spinner/Spinner.tsx +14 -5
- package/src/components/atoms/Switch/Switch.test.tsx +92 -0
- package/src/components/atoms/Switch/Switch.tsx +16 -13
- package/src/components/atoms/Tag/Tag.test.tsx +70 -0
- package/src/components/atoms/TextArea/TextArea.stories.tsx +303 -0
- package/src/components/atoms/TextArea/TextArea.test.tsx +416 -0
- package/src/components/atoms/TextArea/TextArea.tsx +171 -0
- package/src/components/atoms/TextArea/TextAreaField.tsx +304 -0
- package/src/components/atoms/TextArea/TextAreaLabel.tsx +103 -0
- package/src/components/atoms/TextArea/index.ts +6 -0
- package/src/components/atoms/Typography/Typography.test.tsx +94 -0
- package/src/components/atoms/index.ts +3 -0
- package/src/components/molecules/Accordion/Accordion.stories.tsx +177 -0
- package/src/components/molecules/Accordion/Accordion.test.tsx +185 -0
- package/src/components/molecules/Accordion/Accordion.tsx +284 -0
- package/src/components/molecules/Accordion/index.ts +6 -0
- package/src/components/molecules/Animated/Animated.stories.tsx +254 -0
- package/src/components/molecules/Animated/Animated.tsx +283 -0
- package/src/components/molecules/Animated/index.ts +10 -0
- package/src/components/molecules/ButtonDock/ButtonDock.test.tsx +83 -0
- package/src/components/molecules/ButtonGroup/ButtonGroup.stories.tsx +8 -14
- package/src/components/molecules/ButtonGroup/ButtonGroup.test.tsx +73 -0
- package/src/components/molecules/ButtonGroup/ButtonGroup.tsx +25 -3
- package/src/components/molecules/Checkbox/Checkbox.stories.tsx +72 -0
- package/src/components/molecules/Checkbox/Checkbox.test.tsx +117 -0
- package/src/components/molecules/Checkbox/Checkbox.tsx +101 -95
- package/src/components/molecules/CopyField/CopyField.stories.tsx +313 -0
- package/src/components/molecules/CopyField/CopyField.test.tsx +431 -0
- package/src/components/molecules/CopyField/CopyField.tsx +156 -0
- package/src/components/molecules/CopyField/CopyFieldInput.tsx +127 -0
- package/src/components/molecules/CopyField/hooks/index.ts +1 -0
- package/src/components/molecules/CopyField/hooks/useCopyField.ts +25 -0
- package/src/components/molecules/CopyField/index.ts +4 -0
- package/src/components/molecules/DatePicker/DatePicker.stories.tsx +298 -0
- package/src/components/molecules/DatePicker/DatePicker.test.tsx +201 -0
- package/src/components/molecules/DatePicker/DatePicker.tsx +590 -0
- package/src/components/molecules/DatePicker/index.ts +2 -0
- package/src/components/molecules/Drawer/Drawer.stories.tsx +285 -0
- package/src/components/molecules/Drawer/Drawer.test.tsx +180 -0
- package/src/components/molecules/Drawer/Drawer.tsx +187 -0
- package/src/components/molecules/Drawer/DrawerBody.tsx +80 -0
- package/src/components/molecules/Drawer/DrawerClose.tsx +76 -0
- package/src/components/molecules/Drawer/DrawerContent.tsx +339 -0
- package/src/components/molecules/Drawer/DrawerContext.ts +19 -0
- package/src/components/molecules/Drawer/DrawerDescription.tsx +31 -0
- package/src/components/molecules/Drawer/DrawerDragContext.ts +11 -0
- package/src/components/molecules/Drawer/DrawerFooter.tsx +49 -0
- package/src/components/molecules/Drawer/DrawerFooterContext.ts +6 -0
- package/src/components/molecules/Drawer/DrawerGrabber.tsx +62 -0
- package/src/components/molecules/Drawer/DrawerHeader.tsx +244 -0
- package/src/components/molecules/Drawer/DrawerHeaderContext.ts +13 -0
- package/src/components/molecules/Drawer/DrawerOverlay.tsx +53 -0
- package/src/components/molecules/Drawer/DrawerTitle.tsx +32 -0
- package/src/components/molecules/Drawer/index.ts +12 -0
- package/src/components/molecules/FilterTab/FilterTab.stories.tsx +210 -0
- package/src/components/molecules/FilterTab/FilterTab.tsx +310 -0
- package/src/components/molecules/FilterTab/index.ts +2 -0
- package/src/components/molecules/MessageCard/MessageCard.stories.tsx +169 -0
- package/src/components/molecules/MessageCard/MessageCard.tsx +362 -0
- package/src/components/molecules/MessageCard/index.ts +10 -0
- package/src/components/molecules/Notification/Notification.stories.tsx +219 -0
- package/src/components/molecules/Notification/Notification.tsx +426 -0
- package/src/components/molecules/Notification/index.ts +2 -0
- package/src/components/molecules/NumberField/NumberField.stories.tsx +231 -0
- package/src/components/molecules/NumberField/NumberField.tsx +186 -0
- package/src/components/molecules/NumberField/NumberFieldInput.tsx +287 -0
- package/src/components/molecules/NumberField/index.ts +2 -0
- package/src/components/molecules/PasswordField/PasswordField.stories.tsx +362 -0
- package/src/components/molecules/PasswordField/PasswordField.test.tsx +369 -0
- package/src/components/molecules/PasswordField/PasswordField.tsx +194 -0
- package/src/components/molecules/PasswordField/PasswordFieldError.tsx +52 -0
- package/src/components/molecules/PasswordField/PasswordFieldInput.tsx +73 -0
- package/src/components/molecules/PasswordField/PasswordFieldRequirements.tsx +92 -0
- package/src/components/molecules/PasswordField/hooks/index.ts +2 -0
- package/src/components/molecules/PasswordField/hooks/usePasswordField.ts +113 -0
- package/src/components/molecules/PasswordField/index.ts +10 -0
- package/src/components/molecules/PictureSelector/PictureSelector.stories.tsx +243 -0
- package/src/components/molecules/PictureSelector/PictureSelector.tsx +313 -0
- package/src/components/molecules/PictureSelector/index.ts +5 -0
- package/src/components/molecules/Progress/Progress.stories.tsx +145 -0
- package/src/components/molecules/Progress/Progress.tsx +184 -0
- package/src/components/molecules/Progress/index.ts +2 -0
- package/src/components/molecules/Radio/Radio.test.tsx +104 -0
- package/src/components/molecules/Radio/Radio.tsx +1 -2
- package/src/components/molecules/SearchField/SearchField.stories.tsx +242 -0
- package/src/components/molecules/SearchField/SearchField.test.tsx +318 -0
- package/src/components/molecules/SearchField/SearchField.tsx +143 -0
- package/src/components/molecules/SearchField/SearchFieldInput.tsx +63 -0
- package/src/components/molecules/SearchField/hooks/index.ts +1 -0
- package/src/components/molecules/SearchField/hooks/useSearchField.ts +56 -0
- package/src/components/molecules/SearchField/index.ts +4 -0
- package/src/components/molecules/SegmentedControl/SegmentedControl.stories.tsx +31 -8
- package/src/components/molecules/SegmentedControl/SegmentedControl.test.tsx +141 -0
- package/src/components/molecules/SegmentedControl/SegmentedControl.tsx +237 -23
- package/src/components/molecules/SelectField/SelectField.stories.tsx +320 -0
- package/src/components/molecules/SelectField/SelectField.test.tsx +254 -0
- package/src/components/molecules/SelectField/SelectField.tsx +236 -0
- package/src/components/molecules/SelectField/SelectFieldContent.tsx +85 -0
- package/src/components/molecules/SelectField/SelectFieldItem.tsx +133 -0
- package/src/components/molecules/SelectField/SelectFieldTrigger.tsx +170 -0
- package/src/components/molecules/SelectField/SelectFieldValue.tsx +31 -0
- package/src/components/molecules/SelectField/hooks/index.ts +2 -0
- package/src/components/molecules/SelectField/hooks/useSelectField.ts +84 -0
- package/src/components/molecules/SelectField/index.ts +10 -0
- package/src/components/molecules/Slider/Slider.test.tsx +102 -0
- package/src/components/molecules/Slider/Slider.tsx +293 -180
- package/src/components/molecules/Tooltip/Tooltip.stories.tsx +168 -0
- package/src/components/molecules/Tooltip/Tooltip.tsx +326 -0
- package/src/components/molecules/Tooltip/index.ts +2 -0
- package/src/components/molecules/index.ts +15 -0
- package/src/test-utils.tsx +20 -0
- package/tsconfig.json +1 -1
- package/tsup.config.ts +16 -2
- package/vitest.config.ts +114 -0
- package/vitest.setup.ts +16 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -7,24 +7,24 @@
|
|
|
7
7
|
[34mCJS[39m Build start
|
|
8
8
|
[34mESM[39m Build start
|
|
9
9
|
[34mDTS[39m Build start
|
|
10
|
-
[32mCJS[39m [1mdist/ida-narrow-500-normal-C6I2PK4T.woff2 [22m[32m47.41 KB[39m
|
|
11
|
-
[32mCJS[39m [1mdist/ida-narrow-700-normal-UPHPRIN6.woff2 [22m[32m49.90 KB[39m
|
|
12
|
-
[32mCJS[39m [1mdist/ibm-plex-sans-condensed-400-normal-I2XLJNNB.woff2 [22m[32m19.33 KB[39m
|
|
13
|
-
[32mCJS[39m [1mdist/ibm-plex-sans-condensed-500-normal-IEQBNVGX.woff2 [22m[32m19.48 KB[39m
|
|
14
|
-
[32mCJS[39m [1mdist/ibm-plex-sans-condensed-600-normal-UX5ZU5T6.woff2 [22m[32m19.35 KB[39m
|
|
15
|
-
[32mCJS[39m [1mdist/ibm-plex-sans-condensed-700-normal-4PFYFTSO.woff2 [22m[32m18.90 KB[39m
|
|
16
|
-
[32mCJS[39m [1mdist/index.cjs [22m[32m120.33 KB[39m
|
|
17
|
-
[32mCJS[39m [1mdist/index.cjs.map [22m[32m266.09 KB[39m
|
|
18
|
-
[32mCJS[39m ⚡️ Build success in 2528ms
|
|
19
10
|
[32mESM[39m [1mdist/ida-narrow-500-normal-C6I2PK4T.woff2 [22m[32m47.41 KB[39m
|
|
20
11
|
[32mESM[39m [1mdist/ida-narrow-700-normal-UPHPRIN6.woff2 [22m[32m49.90 KB[39m
|
|
21
12
|
[32mESM[39m [1mdist/ibm-plex-sans-condensed-400-normal-I2XLJNNB.woff2 [22m[32m19.33 KB[39m
|
|
22
13
|
[32mESM[39m [1mdist/ibm-plex-sans-condensed-500-normal-IEQBNVGX.woff2 [22m[32m19.48 KB[39m
|
|
23
14
|
[32mESM[39m [1mdist/ibm-plex-sans-condensed-600-normal-UX5ZU5T6.woff2 [22m[32m19.35 KB[39m
|
|
24
15
|
[32mESM[39m [1mdist/ibm-plex-sans-condensed-700-normal-4PFYFTSO.woff2 [22m[32m18.90 KB[39m
|
|
25
|
-
[32mESM[39m [1mdist/index.js [22m[
|
|
26
|
-
[32mESM[39m [1mdist/index.js.map [22m[
|
|
27
|
-
[32mESM[39m ⚡️ Build success in
|
|
28
|
-
[
|
|
29
|
-
[
|
|
30
|
-
[
|
|
16
|
+
[32mESM[39m [1mdist/index.js [22m[32m1.61 MB[39m
|
|
17
|
+
[32mESM[39m [1mdist/index.js.map [22m[32m2.44 MB[39m
|
|
18
|
+
[32mESM[39m ⚡️ Build success in 10371ms
|
|
19
|
+
[32mCJS[39m [1mdist/ida-narrow-500-normal-C6I2PK4T.woff2 [22m[32m47.41 KB[39m
|
|
20
|
+
[32mCJS[39m [1mdist/ida-narrow-700-normal-UPHPRIN6.woff2 [22m[32m49.90 KB[39m
|
|
21
|
+
[32mCJS[39m [1mdist/ibm-plex-sans-condensed-400-normal-I2XLJNNB.woff2 [22m[32m19.33 KB[39m
|
|
22
|
+
[32mCJS[39m [1mdist/ibm-plex-sans-condensed-500-normal-IEQBNVGX.woff2 [22m[32m19.48 KB[39m
|
|
23
|
+
[32mCJS[39m [1mdist/ibm-plex-sans-condensed-600-normal-UX5ZU5T6.woff2 [22m[32m19.35 KB[39m
|
|
24
|
+
[32mCJS[39m [1mdist/ibm-plex-sans-condensed-700-normal-4PFYFTSO.woff2 [22m[32m18.90 KB[39m
|
|
25
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m1.67 MB[39m
|
|
26
|
+
[32mCJS[39m [1mdist/index.cjs.map [22m[32m2.44 MB[39m
|
|
27
|
+
[32mCJS[39m ⚡️ Build success in 10375ms
|
|
28
|
+
[32mDTS[39m ⚡️ Build success in 21699ms
|
|
29
|
+
[32mDTS[39m [1mdist/index.d.cts [22m[32m76.92 KB[39m
|
|
30
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m76.92 KB[39m
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# @butternutbox/pawprint-native
|
|
2
|
+
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 44da3ae: creates new components for web and app
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 0c6ed0c: regenerates release with missing yarn install immutable tag
|
|
12
|
+
- 8461dee: Updated UI after QA
|
|
13
|
+
- Updated dependencies [0c6ed0c]
|
|
14
|
+
- Updated dependencies [44da3ae]
|
|
15
|
+
- Updated dependencies [8461dee]
|
|
16
|
+
- @butternutbox/pawprint-tokens@0.1.0
|
package/COMPONENT_GUIDELINES.md
CHANGED
|
@@ -485,7 +485,114 @@ import type { PawprintIllustration } from "../Illustration"
|
|
|
485
485
|
- Import paths are the same: `@butternutbox/pawprint-icons/core` — Metro resolves the `.native.js` build automatically
|
|
486
486
|
- No `fill="currentColor"` — native icons receive `color` as a prop
|
|
487
487
|
|
|
488
|
-
### **14.
|
|
488
|
+
### **14. Animations with Reanimated**
|
|
489
|
+
|
|
490
|
+
Use `react-native-reanimated` (v4+) for all animations — never React Native's legacy `Animated` API.
|
|
491
|
+
|
|
492
|
+
**The `Animated` molecule** covers the common case: enter/exit animations driven by conditional rendering.
|
|
493
|
+
|
|
494
|
+
```tsx
|
|
495
|
+
import { Animated } from "@butternutbox/pawprint-native"
|
|
496
|
+
|
|
497
|
+
// Enter on mount — Reanimated handles exit automatically on unmount
|
|
498
|
+
{
|
|
499
|
+
visible && (
|
|
500
|
+
<Animated variant="fadeUp">
|
|
501
|
+
<Card />
|
|
502
|
+
</Animated>
|
|
503
|
+
)
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
// Sequenced elements with delay
|
|
507
|
+
{
|
|
508
|
+
items.map((item, i) => (
|
|
509
|
+
<Animated key={item.id} variant="fadeUp" delay={i * 0.08}>
|
|
510
|
+
<Row {...item} />
|
|
511
|
+
</Animated>
|
|
512
|
+
))
|
|
513
|
+
}
|
|
514
|
+
```
|
|
515
|
+
|
|
516
|
+
Available variants: `fade`, `fadeUp`, `fadeDown`, `scale`, `slideIn`, `slideOut`, `drawerSlide`.
|
|
517
|
+
|
|
518
|
+
**No `AnimatePresence` needed** — Reanimated intercepts unmounts and runs the `exiting` animation before the component is removed. Conditionally render directly.
|
|
519
|
+
|
|
520
|
+
**Custom / imperative animations** — use `useSharedValue`, `useAnimatedStyle`, `withTiming`, `withSpring` directly. This is the right pattern when a headless library controls mounting internally (e.g. the Drawer), or when the animation must compose with a gesture in real time.
|
|
521
|
+
|
|
522
|
+
```tsx
|
|
523
|
+
import Reanimated, {
|
|
524
|
+
useSharedValue,
|
|
525
|
+
useAnimatedStyle,
|
|
526
|
+
withTiming,
|
|
527
|
+
Easing
|
|
528
|
+
} from "react-native-reanimated"
|
|
529
|
+
|
|
530
|
+
const opacity = useSharedValue(0)
|
|
531
|
+
const animatedStyle = useAnimatedStyle(() => ({ opacity: opacity.value }))
|
|
532
|
+
|
|
533
|
+
// Drive the animation imperatively
|
|
534
|
+
opacity.value = withTiming(1, {
|
|
535
|
+
duration: 200,
|
|
536
|
+
easing: Easing.out(Easing.ease)
|
|
537
|
+
})
|
|
538
|
+
```
|
|
539
|
+
|
|
540
|
+
**Stagger without a container** — pass incremental `delay` to `Animated`. For direct `Reanimated.View` usage, use the exported animation preset objects:
|
|
541
|
+
|
|
542
|
+
```tsx
|
|
543
|
+
import { fadeUpAnimation } from "@butternutbox/pawprint-native"
|
|
544
|
+
|
|
545
|
+
// Each call to .duration() creates a fresh builder instance — safe to chain
|
|
546
|
+
<Reanimated.View entering={fadeUpAnimation.entering.duration(200).delay(80)}>
|
|
547
|
+
```
|
|
548
|
+
|
|
549
|
+
**Custom builders** — extend `ComplexAnimationBuilder` and override `build` as a property (arrow function):
|
|
550
|
+
|
|
551
|
+
```tsx
|
|
552
|
+
import {
|
|
553
|
+
ComplexAnimationBuilder,
|
|
554
|
+
BaseAnimationBuilder,
|
|
555
|
+
withTiming,
|
|
556
|
+
type EntryExitAnimationFunction
|
|
557
|
+
} from "react-native-reanimated"
|
|
558
|
+
|
|
559
|
+
class MyEnter extends ComplexAnimationBuilder {
|
|
560
|
+
static override createInstance<T extends typeof BaseAnimationBuilder>(
|
|
561
|
+
this: T
|
|
562
|
+
): InstanceType<T> {
|
|
563
|
+
return new (this as unknown as new () => InstanceType<T>)()
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
override build = (): EntryExitAnimationFunction => {
|
|
567
|
+
const delay = this.getDelay()
|
|
568
|
+
const duration = this.getDuration()
|
|
569
|
+
const delayFn = this.getDelayFunction()
|
|
570
|
+
const callback = this.callbackV
|
|
571
|
+
|
|
572
|
+
return () => {
|
|
573
|
+
"worklet"
|
|
574
|
+
return {
|
|
575
|
+
initialValues: { opacity: 0 },
|
|
576
|
+
animations: { opacity: delayFn(delay, withTiming(1, { duration })) },
|
|
577
|
+
callback
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
```
|
|
583
|
+
|
|
584
|
+
**Reduced motion** — `useReducedMotion()` from Reanimated returns `true` when the OS accessibility setting is on. Set `duration: 0` to skip animations:
|
|
585
|
+
|
|
586
|
+
```tsx
|
|
587
|
+
import { useReducedMotion } from "react-native-reanimated"
|
|
588
|
+
|
|
589
|
+
const reducedMotion = useReducedMotion()
|
|
590
|
+
const duration = reducedMotion ? 0 : 200
|
|
591
|
+
```
|
|
592
|
+
|
|
593
|
+
The `Animated` molecule handles this automatically.
|
|
594
|
+
|
|
595
|
+
### **15. Performance Considerations**
|
|
489
596
|
|
|
490
597
|
```tsx
|
|
491
598
|
// ✅ GOOD: Stable style references
|
|
@@ -513,7 +620,7 @@ const opacity = useRef(new Animated.Value(0)).current
|
|
|
513
620
|
- Use `React.memo` sparingly — only for expensive renders with stable props
|
|
514
621
|
- Use `Animated` or `Reanimated` for animations, not `setState`
|
|
515
622
|
|
|
516
|
-
### **
|
|
623
|
+
### **16. Error Handling & Validation**
|
|
517
624
|
|
|
518
625
|
```tsx
|
|
519
626
|
export const Icon = React.forwardRef<View, IconProps>(
|
|
@@ -541,7 +648,7 @@ export const Icon = React.forwardRef<View, IconProps>(
|
|
|
541
648
|
)
|
|
542
649
|
```
|
|
543
650
|
|
|
544
|
-
### **
|
|
651
|
+
### **17. Parity with pawprint-web**
|
|
545
652
|
|
|
546
653
|
Native components should mirror the web API where possible:
|
|
547
654
|
|
|
@@ -557,7 +664,7 @@ Native components should mirror the web API where possible:
|
|
|
557
664
|
- Web uses `styled()` from `@mui/system` — native uses `styled()` from `@emotion/native`
|
|
558
665
|
- Web has `shouldForwardProp` — native relies on prop name prefixing
|
|
559
666
|
|
|
560
|
-
### **
|
|
667
|
+
### **18. Documentation Standards**
|
|
561
668
|
|
|
562
669
|
**Add JSDoc comments for all exported components:**
|
|
563
670
|
|