@nori-ui/core 1.3.0 → 1.5.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.
Files changed (43) hide show
  1. package/dist/{chunk-V2AWSDDZ.js → chunk-76FZF4GM.js} +3 -3
  2. package/dist/{chunk-V2AWSDDZ.js.map → chunk-76FZF4GM.js.map} +1 -1
  3. package/dist/chunk-BNDUQNG7.js +443 -0
  4. package/dist/chunk-BNDUQNG7.js.map +1 -0
  5. package/dist/{chunk-XXBN6CIK.js → chunk-F7G6R373.js} +3 -3
  6. package/dist/{chunk-XXBN6CIK.js.map → chunk-F7G6R373.js.map} +1 -1
  7. package/dist/{chunk-HZKXPN6B.js → chunk-ND7MRYW7.js} +3 -3
  8. package/dist/{chunk-HZKXPN6B.js.map → chunk-ND7MRYW7.js.map} +1 -1
  9. package/dist/chunk-O4NMS3KB.js +11 -0
  10. package/dist/chunk-O4NMS3KB.js.map +1 -0
  11. package/dist/{chunk-SJZTETUT.js → chunk-VMAGFYHG.js} +3 -3
  12. package/dist/{chunk-SJZTETUT.js.map → chunk-VMAGFYHG.js.map} +1 -1
  13. package/dist/{chunk-OCHEPOOO.js → chunk-Y4ZRSW35.js} +3 -3
  14. package/dist/{chunk-OCHEPOOO.js.map → chunk-Y4ZRSW35.js.map} +1 -1
  15. package/dist/client.cjs +447 -3
  16. package/dist/client.cjs.map +1 -1
  17. package/dist/client.d.cts +2 -0
  18. package/dist/client.d.ts +2 -0
  19. package/dist/client.js +14 -12
  20. package/dist/client.js.map +1 -1
  21. package/dist/components/Accordion/index.js +2 -2
  22. package/dist/components/Calendar/index.js +2 -2
  23. package/dist/components/Combobox/index.cjs +1374 -0
  24. package/dist/components/Combobox/index.cjs.map +1 -0
  25. package/dist/components/Combobox/index.d.cts +17 -0
  26. package/dist/components/Combobox/index.d.ts +17 -0
  27. package/dist/components/Combobox/index.js +9 -0
  28. package/dist/components/Combobox/index.js.map +1 -0
  29. package/dist/components/DatePicker/index.js +3 -3
  30. package/dist/components/Pagination/index.js +2 -2
  31. package/dist/components/Sheet/index.cjs +855 -0
  32. package/dist/components/Sheet/index.cjs.map +1 -0
  33. package/dist/components/Sheet/index.d.cts +104 -0
  34. package/dist/components/Sheet/index.d.ts +104 -0
  35. package/dist/components/Sheet/index.js +8 -0
  36. package/dist/components/Sheet/index.js.map +1 -0
  37. package/dist/components/Switch/index.js +2 -2
  38. package/dist/index.cjs +447 -3
  39. package/dist/index.cjs.map +1 -1
  40. package/dist/index.d.cts +2 -0
  41. package/dist/index.d.ts +2 -0
  42. package/dist/index.js +13 -11
  43. package/package.json +1 -1
@@ -0,0 +1,11 @@
1
+ import { Select } from './chunk-UJ5KFRDE.js';
2
+ import { __name } from './chunk-WCQVDF3K.js';
3
+ import { jsx } from 'nativewind/jsx-runtime';
4
+
5
+ var Combobox = /* @__PURE__ */ __name((props) => {
6
+ return /* @__PURE__ */ jsx(Select, { searchable: true, ...props });
7
+ }, "Combobox");
8
+
9
+ export { Combobox };
10
+ //# sourceMappingURL=chunk-O4NMS3KB.js.map
11
+ //# sourceMappingURL=chunk-O4NMS3KB.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/Combobox/Combobox.tsx"],"names":[],"mappings":";;;;AAcO,IAAM,QAAA,2BAAyB,KAAA,KAA0B;AAC5D,EAAA,uBAAO,GAAA,CAAC,MAAA,EAAA,EAAO,UAAA,EAAU,IAAA,EAAE,GAAG,KAAA,EAAO,CAAA;AACzC,CAAA,EAFwB,UAAA","file":"chunk-O4NMS3KB.js","sourcesContent":["'use client';\n\nimport { Select, type SelectProps } from '../Select';\n\n/**\n * Combobox — a Select with search defaulted on.\n *\n * Use Combobox for long lists or async options where users benefit from\n * typeahead filtering. Use Select directly for short static lists where\n * clicking is enough.\n *\n * Every prop, behavior, and type is identical to Select; this is purely a\n * default + naming convenience.\n */\nexport const Combobox = <T = unknown>(props: SelectProps<T>) => {\n return <Select searchable {...props} />;\n};\n"]}
@@ -1,5 +1,5 @@
1
- import { AnimatedView } from './chunk-RGJ3NBKE.js';
2
1
  import { useAnimatedNumber } from './chunk-RB3YBWQ4.js';
2
+ import { AnimatedView } from './chunk-RGJ3NBKE.js';
3
3
  import { Slot } from './chunk-ZIBNLXIV.js';
4
4
  import { cn } from './chunk-CHXHRJNZ.js';
5
5
  import { px } from './chunk-5A2QOOVN.js';
@@ -179,5 +179,5 @@ var Switch = /* @__PURE__ */ __name(({
179
179
  }, "Switch");
180
180
 
181
181
  export { Switch };
182
- //# sourceMappingURL=chunk-SJZTETUT.js.map
183
- //# sourceMappingURL=chunk-SJZTETUT.js.map
182
+ //# sourceMappingURL=chunk-VMAGFYHG.js.map
183
+ //# sourceMappingURL=chunk-VMAGFYHG.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Switch/Switch.tsx"],"names":["RNText"],"mappings":";;;;;;;;;;;AA0CA,IAAM,eAAA,GAA6B,EAAE,aAAA,EAAe,KAAA,EAAO,YAAY,QAAA,EAAS;AAGhF,IAAM,UAAA,GAAwB;AAAA,EAC1B,KAAA,EAAO,EAAA;AAAA,EACP,MAAA,EAAQ,EAAA;AAAA,EACR,YAAA,EAAc,EAAA;AAAA;AAAA;AAAA;AAAA,EAId,QAAA,EAAU;AACd,CAAA;AACA,IAAM,gBAAA,GAA8B;AAAA,EAChC,KAAA,EAAO,EAAA;AAAA,EACP,MAAA,EAAQ,EAAA;AAAA,EACR,YAAA,EAAc,EAAA;AAAA;AAAA;AAAA;AAAA,EAId,GAAI,EAAE,SAAA,EAAW,+BAAA,EAAgC;AAAA,EACjD,SAAA,EAAW;AACf,CAAA;AAOO,IAAM,yBAAS,MAAA,CAAA,CAAC;AAAA,EACnB,OAAA;AAAA,EACA,cAAA,GAAiB,KAAA;AAAA,EACjB,QAAA;AAAA,EACA,QAAA;AAAA,EACA,KAAA;AAAA,EACA,SAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,EAAA;AAA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AK,GAAG,MAAA,CAAO,OAAA,CAAQ,GAAG,CAAC,CAAA,EAAE;AAE/E,EAAA,uBACI,IAAA;AAAA,IAAC,SAAA;AAAA,IAAA;AAAA,MACG,OAAA,EAAS,MAAA;AAAA,MACR,GAAG,WAAA;AAAA,MACJ,SAAA,EAAW,EAAA,CAAG,6BAAA,EAA+B,SAAS,CAAA;AAAA,MACtD,KAAA,EAAO,QAAA;AAAA,MAEP,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,IAAA,EAAA,EAAK,SAAA,EAAW,YAAA,EAAc,KAAA,EAAO,UAAA,EASlC,QAAA,kBAAA,GAAA,CAAC,YAAA,EAAA,EAAa,SAAA,EAAW,YAAA,EAAc,KAAA,EAAO,UAAA,EAAY,CAAA,EAC9D,CAAA;AAAA,QACC,KAAA,mBACG,GAAA;AAAA,UAACA,IAAA;AAAA,UAAA;AAAA,YACG,SAAA,EAAU,oCAAA;AAAA,YACV,KAAA,EAAO;AAAA,cACH,KAAA,EAAO,MAAA,CAAO,QAAA,CAAS,IAAA,CAAK,OAAA;AAAA,cAC5B,UAAA,EAAY,OAAO,UAAA,CAAW,IAAA;AAAA,cAC9B,QAAA,EAAU,EAAA,CAAG,MAAA,CAAO,QAAA,CAAS,EAAE;AAAA,aACnC;AAAA,YAEC,QAAA,EAAA;AAAA;AAAA,SACL,GACA,IAAA;AAAA,QACH;AAAA;AAAA;AAAA,GACL;AAER,CAAA,EApLsB,QAAA","file":"chunk-SJZTETUT.js","sourcesContent":["'use client';\n\nimport type { ReactNode } from 'react';\nimport { useCallback, useState } from 'react';\nimport type { ViewStyle } from 'react-native';\nimport { Pressable, Text as RNText, View } from 'react-native';\nimport { AnimatedView } from '../../animation/animated-view';\nimport { useAnimatedNumber } from '../../animation/use-animated-number';\nimport { Slot } from '../../slot';\nimport { px } from '../../theme/px';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\n\nexport type SwitchProps = {\n checked?: boolean;\n defaultChecked?: boolean;\n disabled?: boolean;\n onChange?: (next: boolean) => void;\n label?: string;\n className?: string;\n testID?: string;\n asChild?: boolean;\n children?: ReactNode;\n /** DOM id / nativeID forwarded to the Pressable — used by Field.Control */\n id?: string;\n /** HTML name attribute (web only) */\n name?: string;\n /** aria-labelledby forwarded to the Pressable */\n 'aria-labelledby'?: string;\n /** React Native accessibilityLabelledBy forwarded to the Pressable */\n accessibilityLabelledBy?: string;\n /** aria-describedby forwarded to the Pressable */\n 'aria-describedby'?: string;\n /** React Native accessibilityDescribedBy forwarded to the Pressable */\n accessibilityDescribedBy?: string;\n /** Marks the control as invalid — set by Field.Control when there is an error */\n 'aria-invalid'?: boolean;\n /** Marks the control as required — set by Field.Control */\n 'aria-required'?: boolean;\n};\n\n// Layout-only base; row gap is theme-driven inside the component.\nconst ROW_LAYOUT_BASE: ViewStyle = { flexDirection: 'row', alignItems: 'center' };\n// Switch track + thumb are tightly coupled — width 40, height 24, thumb\n// 20×20, travel 18px. Component-density literals — not from theme.\nconst TRACK_BASE: ViewStyle = {\n width: 40,\n height: 24,\n borderRadius: 12,\n // Relative so the absolutely-positioned thumb anchors against the\n // track (not the page). The thumb's `left` value transitions between\n // 2 (off) and 18 (on) — see thumb style below.\n position: 'relative',\n};\nconst THUMB_BASE_STYLE: ViewStyle = {\n width: 20,\n height: 20,\n borderRadius: 10,\n // Web: boxShadow (the modern CSS-style replacement for the legacy RN\n // `shadow*` props that react-native-web has deprecated).\n // Native: elevation (Android) — RN ignores boxShadow there.\n ...({ boxShadow: '0 1px 2px rgba(0, 0, 0, 0.15)' } as ViewStyle),\n elevation: 2,\n};\n\n/**\n * Switch — a toggle control with role=\"switch\". Supports controlled + uncontrolled,\n * disabled state, asChild (via Slot), and a visible label that doubles as the\n * accessibility label.\n */\nexport const Switch = ({\n checked,\n defaultChecked = false,\n disabled,\n onChange,\n label,\n className,\n testID,\n asChild,\n children,\n id,\n name,\n 'aria-labelledby': ariaLabelledBy,\n accessibilityLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n accessibilityDescribedBy,\n 'aria-invalid': ariaInvalid,\n 'aria-required': ariaRequired,\n}: SwitchProps) => {\n const colors = useThemeColors();\n const [inner, setInner] = useState<boolean>(defaultChecked);\n const isControlled = checked !== undefined;\n const value = isControlled ? Boolean(checked) : inner;\n // Pulled up here (above the asChild early-return) so the hook is\n // called on every render path, not conditionally. The slide isn't\n // used in the asChild branch, but the wasted work is tiny.\n const slide = useAnimatedNumber('left', value ? 18 : 2);\n\n const toggle = useCallback(() => {\n if (disabled) {\n return;\n }\n const next = !value;\n if (!isControlled) {\n setInner(next);\n }\n onChange?.(next);\n }, [disabled, value, isControlled, onChange]);\n\n const ariaChecked: 'true' | 'false' = value ? 'true' : 'false';\n\n const commonProps: Record<string, unknown> = {\n role: 'switch',\n 'aria-checked': ariaChecked,\n accessibilityRole: 'switch' as const,\n accessibilityState: { checked: value, disabled: Boolean(disabled) },\n testID,\n };\n if (id !== undefined) {\n commonProps.id = id;\n commonProps.nativeID = id;\n }\n if (name !== undefined) {\n commonProps.name = name;\n }\n if (disabled) {\n commonProps['aria-disabled'] = true;\n }\n if (label !== undefined) {\n commonProps['aria-label'] = label;\n commonProps.accessibilityLabel = label;\n }\n if (ariaLabelledBy !== undefined) {\n commonProps['aria-labelledby'] = ariaLabelledBy;\n commonProps.accessibilityLabelledBy = ariaLabelledBy;\n }\n if (accessibilityLabelledBy !== undefined) {\n commonProps.accessibilityLabelledBy = accessibilityLabelledBy;\n }\n if (ariaDescribedBy !== undefined) {\n commonProps['aria-describedby'] = ariaDescribedBy;\n commonProps.accessibilityDescribedBy = ariaDescribedBy;\n }\n if (accessibilityDescribedBy !== undefined) {\n commonProps.accessibilityDescribedBy = accessibilityDescribedBy;\n }\n if (ariaInvalid) {\n commonProps['aria-invalid'] = true;\n }\n if (ariaRequired) {\n commonProps['aria-required'] = true;\n }\n\n if (asChild) {\n const slotProps: Record<string, unknown> = {\n role: 'switch',\n 'aria-checked': ariaChecked,\n onClick: toggle,\n };\n if (disabled) {\n slotProps['aria-disabled'] = true;\n }\n if (label !== undefined) {\n slotProps['aria-label'] = label;\n }\n if (testID !== undefined) {\n slotProps['data-testid'] = testID;\n }\n if (className !== undefined) {\n slotProps.className = className;\n }\n return <Slot {...slotProps}>{children}</Slot>;\n }\n\n const trackClasses = cn(\n 'w-10 h-6 rounded-full justify-center px-0.5 transition-colors',\n value ? 'bg-semantic-interactive-primary' : 'bg-neutral-300 dark:bg-neutral-700',\n disabled ? 'opacity-60' : undefined\n );\n // Position is set inline below (absolute + animated `left`), so no\n // self-start/self-end classes here — they'd fight the inline position.\n const thumbClasses = cn('w-5 h-5 rounded-full bg-white dark:bg-neutral-100 shadow-sm');\n\n const trackStyle = [\n TRACK_BASE,\n {\n backgroundColor: value ? colors.semantic.interactive.primary : colors.color.neutral['600'],\n // Subtle 180ms color transition between off → on. Web only;\n // native has no equivalent for the track tint in v1.\n ...({ transitionProperty: 'background-color', transitionDuration: '180ms' } as ViewStyle),\n },\n disabled ? { opacity: 0.6 } : null,\n ];\n // Thumb stays a near-white disc — we deliberately don't go to a dark\n // grey on dark mode because the thumb needs to read as the \"moveable\n // puck\" against the track in both schemes.\n //\n // Animation: thumb slides between left:2 (off) and left:18 (on) —\n // track width 40 - padding 2 - thumb 20 = 18 px travel. The\n // useAnimatedNumber hook picks the right engine per platform (web\n // CSS transition / reanimated spring / RN Animated). The hook is\n // called once at the top of the function — see the `slide` above.\n const thumbStyle = [\n THUMB_BASE_STYLE,\n {\n backgroundColor: colors.color.neutral['50'],\n position: 'absolute' as const,\n top: 2,\n } as ViewStyle,\n slide as ViewStyle,\n ];\n\n // Whole-row Pressable so clicking the label toggles the switch. The\n // visible track is a non-interactive View — one role=\"switch\" per\n // logical control, not two competing hit-areas.\n const rowStyle: ViewStyle = { ...ROW_LAYOUT_BASE, gap: px(colors.spacing['2']) };\n\n return (\n <Pressable\n onPress={toggle}\n {...commonProps}\n className={cn('flex-row items-center gap-2', className)}\n style={rowStyle}\n >\n <View className={trackClasses} style={trackStyle}>\n {/*\n * Animated.View — the slide style fragment from\n * `useAnimatedNumber` contains an `Animated.Value` on\n * native; a plain `View` would render the value as 0\n * (no animation). On web, the same fragment is plain\n * CSS and `Animated.View` falls through to a regular\n * div via react-native-web.\n */}\n <AnimatedView className={thumbClasses} style={thumbStyle} />\n </View>\n {label ? (\n <RNText\n className=\"text-md text-semantic-text-default\"\n style={{\n color: colors.semantic.text.default,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.md),\n }}\n >\n {label}\n </RNText>\n ) : null}\n {children}\n </Pressable>\n );\n};\n"]}
1
+ {"version":3,"sources":["../src/components/Switch/Switch.tsx"],"names":["RNText"],"mappings":";;;;;;;;;;;AA0CA,IAAM,eAAA,GAA6B,EAAE,aAAA,EAAe,KAAA,EAAO,YAAY,QAAA,EAAS;AAGhF,IAAM,UAAA,GAAwB;AAAA,EAC1B,KAAA,EAAO,EAAA;AAAA,EACP,MAAA,EAAQ,EAAA;AAAA,EACR,YAAA,EAAc,EAAA;AAAA;AAAA;AAAA;AAAA,EAId,QAAA,EAAU;AACd,CAAA;AACA,IAAM,gBAAA,GAA8B;AAAA,EAChC,KAAA,EAAO,EAAA;AAAA,EACP,MAAA,EAAQ,EAAA;AAAA,EACR,YAAA,EAAc,EAAA;AAAA;AAAA;AAAA;AAAA,EAId,GAAI,EAAE,SAAA,EAAW,+BAAA,EAAgC;AAAA,EACjD,SAAA,EAAW;AACf,CAAA;AAOO,IAAM,yBAAS,MAAA,CAAA,CAAC;AAAA,EACnB,OAAA;AAAA,EACA,cAAA,GAAiB,KAAA;AAAA,EACjB,QAAA;AAAA,EACA,QAAA;AAAA,EACA,KAAA;AAAA,EACA,SAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,EAAA;AAAA,EACA,IAAA;AAAA,EACA,iBAAA,EAAmB,cAAA;AAAA,EACnB,uBAAA;AAAA,EACA,kBAAA,EAAoB,eAAA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C,SAAA;AAAA,IAAA;AAAA,MACG,OAAA,EAAS,MAAA;AAAA,MACR,GAAG,WAAA;AAAA,MACJ,SAAA,EAAW,EAAA,CAAG,6BAAA,EAA+B,SAAS,CAAA;AAAA,MACtD,KAAA,EAAO,QAAA;AAAA,MAEP,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,IAAA,EAAA,EAAK,SAAA,EAAW,YAAA,EAAc,KAAA,EAAO,UAAA,EASlC,QAAA,kBAAA,GAAA,CAAC,YAAA,EAAA,EAAa,SAAA,EAAW,YAAA,EAAc,KAAA,EAAO,UAAA,EAAY,CAAA,EAC9D,CAAA;AAAA,QACC,KAAA,mBACG,GAAA;AAAA,UAACA,IAAA;AAAA,UAAA;AAAA,YACG,SAAA,EAAU,oCAAA;AAAA,YACV,KAAA,EAAO;AAAA,cACH,KAAA,EAAO,MAAA,CAAO,QAAA,CAAS,IAAA,CAAK,OAAA;AAAA,cAC5B,UAAA,EAAY,OAAO,UAAA,CAAW,IAAA;AAAA,cAC9B,QAAA,EAAU,EAAA,CAAG,MAAA,CAAO,QAAA,CAAS,EAAE;AAAA,aACnC;AAAA,YAEC,QAAA,EAAA;AAAA;AAAA,SACL,GACA,IAAA;AAAA,QACH;AAAA;AAAA;AAAA,GACL;AAER,CAAA,EApLsB,QAAA","file":"chunk-VMAGFYHG.js","sourcesContent":["'use client';\n\nimport type { ReactNode } from 'react';\nimport { useCallback, useState } from 'react';\nimport type { ViewStyle } from 'react-native';\nimport { Pressable, Text as RNText, View } from 'react-native';\nimport { AnimatedView } from '../../animation/animated-view';\nimport { useAnimatedNumber } from '../../animation/use-animated-number';\nimport { Slot } from '../../slot';\nimport { px } from '../../theme/px';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\n\nexport type SwitchProps = {\n checked?: boolean;\n defaultChecked?: boolean;\n disabled?: boolean;\n onChange?: (next: boolean) => void;\n label?: string;\n className?: string;\n testID?: string;\n asChild?: boolean;\n children?: ReactNode;\n /** DOM id / nativeID forwarded to the Pressable — used by Field.Control */\n id?: string;\n /** HTML name attribute (web only) */\n name?: string;\n /** aria-labelledby forwarded to the Pressable */\n 'aria-labelledby'?: string;\n /** React Native accessibilityLabelledBy forwarded to the Pressable */\n accessibilityLabelledBy?: string;\n /** aria-describedby forwarded to the Pressable */\n 'aria-describedby'?: string;\n /** React Native accessibilityDescribedBy forwarded to the Pressable */\n accessibilityDescribedBy?: string;\n /** Marks the control as invalid — set by Field.Control when there is an error */\n 'aria-invalid'?: boolean;\n /** Marks the control as required — set by Field.Control */\n 'aria-required'?: boolean;\n};\n\n// Layout-only base; row gap is theme-driven inside the component.\nconst ROW_LAYOUT_BASE: ViewStyle = { flexDirection: 'row', alignItems: 'center' };\n// Switch track + thumb are tightly coupled — width 40, height 24, thumb\n// 20×20, travel 18px. Component-density literals — not from theme.\nconst TRACK_BASE: ViewStyle = {\n width: 40,\n height: 24,\n borderRadius: 12,\n // Relative so the absolutely-positioned thumb anchors against the\n // track (not the page). The thumb's `left` value transitions between\n // 2 (off) and 18 (on) — see thumb style below.\n position: 'relative',\n};\nconst THUMB_BASE_STYLE: ViewStyle = {\n width: 20,\n height: 20,\n borderRadius: 10,\n // Web: boxShadow (the modern CSS-style replacement for the legacy RN\n // `shadow*` props that react-native-web has deprecated).\n // Native: elevation (Android) — RN ignores boxShadow there.\n ...({ boxShadow: '0 1px 2px rgba(0, 0, 0, 0.15)' } as ViewStyle),\n elevation: 2,\n};\n\n/**\n * Switch — a toggle control with role=\"switch\". Supports controlled + uncontrolled,\n * disabled state, asChild (via Slot), and a visible label that doubles as the\n * accessibility label.\n */\nexport const Switch = ({\n checked,\n defaultChecked = false,\n disabled,\n onChange,\n label,\n className,\n testID,\n asChild,\n children,\n id,\n name,\n 'aria-labelledby': ariaLabelledBy,\n accessibilityLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n accessibilityDescribedBy,\n 'aria-invalid': ariaInvalid,\n 'aria-required': ariaRequired,\n}: SwitchProps) => {\n const colors = useThemeColors();\n const [inner, setInner] = useState<boolean>(defaultChecked);\n const isControlled = checked !== undefined;\n const value = isControlled ? Boolean(checked) : inner;\n // Pulled up here (above the asChild early-return) so the hook is\n // called on every render path, not conditionally. The slide isn't\n // used in the asChild branch, but the wasted work is tiny.\n const slide = useAnimatedNumber('left', value ? 18 : 2);\n\n const toggle = useCallback(() => {\n if (disabled) {\n return;\n }\n const next = !value;\n if (!isControlled) {\n setInner(next);\n }\n onChange?.(next);\n }, [disabled, value, isControlled, onChange]);\n\n const ariaChecked: 'true' | 'false' = value ? 'true' : 'false';\n\n const commonProps: Record<string, unknown> = {\n role: 'switch',\n 'aria-checked': ariaChecked,\n accessibilityRole: 'switch' as const,\n accessibilityState: { checked: value, disabled: Boolean(disabled) },\n testID,\n };\n if (id !== undefined) {\n commonProps.id = id;\n commonProps.nativeID = id;\n }\n if (name !== undefined) {\n commonProps.name = name;\n }\n if (disabled) {\n commonProps['aria-disabled'] = true;\n }\n if (label !== undefined) {\n commonProps['aria-label'] = label;\n commonProps.accessibilityLabel = label;\n }\n if (ariaLabelledBy !== undefined) {\n commonProps['aria-labelledby'] = ariaLabelledBy;\n commonProps.accessibilityLabelledBy = ariaLabelledBy;\n }\n if (accessibilityLabelledBy !== undefined) {\n commonProps.accessibilityLabelledBy = accessibilityLabelledBy;\n }\n if (ariaDescribedBy !== undefined) {\n commonProps['aria-describedby'] = ariaDescribedBy;\n commonProps.accessibilityDescribedBy = ariaDescribedBy;\n }\n if (accessibilityDescribedBy !== undefined) {\n commonProps.accessibilityDescribedBy = accessibilityDescribedBy;\n }\n if (ariaInvalid) {\n commonProps['aria-invalid'] = true;\n }\n if (ariaRequired) {\n commonProps['aria-required'] = true;\n }\n\n if (asChild) {\n const slotProps: Record<string, unknown> = {\n role: 'switch',\n 'aria-checked': ariaChecked,\n onClick: toggle,\n };\n if (disabled) {\n slotProps['aria-disabled'] = true;\n }\n if (label !== undefined) {\n slotProps['aria-label'] = label;\n }\n if (testID !== undefined) {\n slotProps['data-testid'] = testID;\n }\n if (className !== undefined) {\n slotProps.className = className;\n }\n return <Slot {...slotProps}>{children}</Slot>;\n }\n\n const trackClasses = cn(\n 'w-10 h-6 rounded-full justify-center px-0.5 transition-colors',\n value ? 'bg-semantic-interactive-primary' : 'bg-neutral-300 dark:bg-neutral-700',\n disabled ? 'opacity-60' : undefined\n );\n // Position is set inline below (absolute + animated `left`), so no\n // self-start/self-end classes here — they'd fight the inline position.\n const thumbClasses = cn('w-5 h-5 rounded-full bg-white dark:bg-neutral-100 shadow-sm');\n\n const trackStyle = [\n TRACK_BASE,\n {\n backgroundColor: value ? colors.semantic.interactive.primary : colors.color.neutral['600'],\n // Subtle 180ms color transition between off → on. Web only;\n // native has no equivalent for the track tint in v1.\n ...({ transitionProperty: 'background-color', transitionDuration: '180ms' } as ViewStyle),\n },\n disabled ? { opacity: 0.6 } : null,\n ];\n // Thumb stays a near-white disc — we deliberately don't go to a dark\n // grey on dark mode because the thumb needs to read as the \"moveable\n // puck\" against the track in both schemes.\n //\n // Animation: thumb slides between left:2 (off) and left:18 (on) —\n // track width 40 - padding 2 - thumb 20 = 18 px travel. The\n // useAnimatedNumber hook picks the right engine per platform (web\n // CSS transition / reanimated spring / RN Animated). The hook is\n // called once at the top of the function — see the `slide` above.\n const thumbStyle = [\n THUMB_BASE_STYLE,\n {\n backgroundColor: colors.color.neutral['50'],\n position: 'absolute' as const,\n top: 2,\n } as ViewStyle,\n slide as ViewStyle,\n ];\n\n // Whole-row Pressable so clicking the label toggles the switch. The\n // visible track is a non-interactive View — one role=\"switch\" per\n // logical control, not two competing hit-areas.\n const rowStyle: ViewStyle = { ...ROW_LAYOUT_BASE, gap: px(colors.spacing['2']) };\n\n return (\n <Pressable\n onPress={toggle}\n {...commonProps}\n className={cn('flex-row items-center gap-2', className)}\n style={rowStyle}\n >\n <View className={trackClasses} style={trackStyle}>\n {/*\n * Animated.View — the slide style fragment from\n * `useAnimatedNumber` contains an `Animated.Value` on\n * native; a plain `View` would render the value as 0\n * (no animation). On web, the same fragment is plain\n * CSS and `Animated.View` falls through to a regular\n * div via react-native-web.\n */}\n <AnimatedView className={thumbClasses} style={thumbStyle} />\n </View>\n {label ? (\n <RNText\n className=\"text-md text-semantic-text-default\"\n style={{\n color: colors.semantic.text.default,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.md),\n }}\n >\n {label}\n </RNText>\n ) : null}\n {children}\n </Pressable>\n );\n};\n"]}
@@ -1,5 +1,5 @@
1
- import { AnimatedView } from './chunk-RGJ3NBKE.js';
2
1
  import { useAnimatedNumber } from './chunk-RB3YBWQ4.js';
2
+ import { AnimatedView } from './chunk-RGJ3NBKE.js';
3
3
  import { defaultSemanticIcons } from './chunk-7Z4NMNX6.js';
4
4
  import { cn } from './chunk-CHXHRJNZ.js';
5
5
  import { px } from './chunk-5A2QOOVN.js';
@@ -446,5 +446,5 @@ var Accordion = Object.assign(AccordionRoot, {
446
446
  });
447
447
 
448
448
  export { Accordion };
449
- //# sourceMappingURL=chunk-OCHEPOOO.js.map
450
- //# sourceMappingURL=chunk-OCHEPOOO.js.map
449
+ //# sourceMappingURL=chunk-Y4ZRSW35.js.map
450
+ //# sourceMappingURL=chunk-Y4ZRSW35.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Accordion/Accordion.tsx"],"names":["RNText"],"mappings":";;;;;;;;;;;AAsEA,IAAM,gBAAA,GAAmB,cAA4C,IAAI,CAAA;AAEzE,IAAM,mBAAA,2BAAuB,KAAA,KAAyC;AAClE,EAAA,MAAM,GAAA,GAAM,WAAW,gBAAgB,CAAA;AACvC,EAAA,IAAI,CAAC,GAAA,EAAK;AACN,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,CAAA,EAAI,KAAK,CAAA,yCAAA,CAA2C,CAAA;AAAA,EACxE;AACA,EAAA,OAAO,GAAA;AACX,CAAA,EAN4B,qBAAA,CAAA;AAgB5B,IAAM,oBAAA,GAAuB,cAAgD,IAAI,CAAA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AAAA,MACtB,aAAA,EAAa,CAAC,IAAA,CAAK,IAAA;AAAA,MACnB,SAAA,EAAW,EAAA,CAAG,iBAAA,EAAmB,SAAS,CAAA;AAAA,MAE1C,QAAA,kBAAA,GAAA;AAAA,QAAC,IAAA;AAAA,QAAA;AAAA,UACG,GAAA,EAAK,CAAC,IAAA,KAAkB;AACpB,YAAA,QAAA,CAAS,OAAA,GAAU,IAAA;AAAA,UACvB,CAAA;AAAA,UACA,SAAA,EAAW,GAAG,gBAAgB,CAAA;AAAA,UAC9B,KAAA,EAAO,UAAA;AAAA,UAEN,QAAA,EAAA,OAAO,aAAa,QAAA,mBACjB,GAAA;AAAA,YAACA,IAAA;AAAA,YAAA;AAAA,cACG,KAAA,EAAO;AAAA,gBACH,KAAA,EAAO,MAAA,CAAO,QAAA,CAAS,IAAA,CAAK,KAAA;AAAA,gBAC5B,UAAA,EAAY,OAAO,UAAA,CAAW,IAAA;AAAA,gBAC9B,QAAA,EAAU,EAAA,CAAG,MAAA,CAAO,QAAA,CAAS,EAAE,CAAA;AAAA,gBAC/B,UAAA,EAAY,GAAG,MAAA,CAAO,QAAA,CAAS,EAAE,CAAA,GAAI,MAAA,CAAO,MAAA,CAAO,UAAA,CAAW,MAAM;AAAA,eACxE;AAAA,cAEC;AAAA;AAAA,WACL,GAEA;AAAA;AAAA;AAER;AAAA,GACJ;AAER,CAAA,EAjPgC,kBAAA,CAAA;AAyPzB,IAAM,SAAA,GAAY,MAAA,CAAO,MAAA,CAAO,aAAA,EAAe;AAAA,EAClD,IAAA,EAAM,aAAA;AAAA,EACN,OAAA,EAAS,gBAAA;AAAA,EACT,OAAA,EAAS;AACb,CAAC","file":"chunk-OCHEPOOO.js","sourcesContent":["'use client';\n\nimport {\n createContext,\n type KeyboardEvent,\n type ReactNode,\n type RefObject,\n useCallback,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport type { LayoutChangeEvent, ViewStyle } from 'react-native';\nimport { Platform, Pressable, Text as RNText, View } from 'react-native';\nimport { AnimatedView } from '../../animation/animated-view';\nimport { useAnimatedNumber } from '../../animation/use-animated-number';\nimport { defaultSemanticIcons } from '../../icons/default-semantic-icons';\nimport { px } from '../../theme/px';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\n\nexport type AccordionType = 'single' | 'multiple';\n\ntype SingleProps = {\n /** One-at-a-time mode. */\n type: 'single';\n /** Controlled open value. Pass `null` (with `collapsible`) for \"nothing open\". */\n value?: string | null;\n /** Uncontrolled initial open value. */\n defaultValue?: string;\n /** Fires when the open value changes. Receives the new value (string), or `null` if collapsed. */\n onChange?: (next: string | null) => void;\n /** Allow closing the open item by clicking it again. @defaultValue false */\n collapsible?: boolean;\n};\n\ntype MultipleProps = {\n /** Any combination open. */\n type: 'multiple';\n /** Controlled list of open values. */\n value?: string[];\n /** Uncontrolled initial list of open values. */\n defaultValue?: string[];\n /** Fires when the open list changes. Receives the new list. */\n onChange?: (next: string[]) => void;\n /** No-op in `multiple` mode (items are always individually collapsible). */\n collapsible?: never;\n};\n\ntype CommonProps = {\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\nexport type AccordionProps = (SingleProps | MultipleProps) & CommonProps;\n\ntype AccordionContextValue = {\n baseId: string;\n isOpen: (value: string) => boolean;\n toggle: (value: string) => void;\n register: (value: string, ref: RefObject<HTMLElement | null>) => void;\n unregister: (value: string) => void;\n moveFocus: (offset: 1 | -1, fromValue: string) => void;\n focusEdge: (edge: 'first' | 'last') => void;\n};\n\nconst AccordionContext = createContext<AccordionContextValue | null>(null);\n\nconst useAccordionContext = (label: string): AccordionContextValue => {\n const ctx = useContext(AccordionContext);\n if (!ctx) {\n throw new Error(`<${label}> must be rendered inside an <Accordion>.`);\n }\n return ctx;\n};\n\ntype AccordionItemContextValue = {\n value: string;\n open: boolean;\n disabled: boolean;\n triggerId: string;\n contentId: string;\n};\n\nconst AccordionItemContext = createContext<AccordionItemContextValue | null>(null);\n\nconst useAccordionItemContext = (label: string): AccordionItemContextValue => {\n const ctx = useContext(AccordionItemContext);\n if (!ctx) {\n throw new Error(`<${label}> must be rendered inside an <Accordion.Item>.`);\n }\n return ctx;\n};\n\n/**\n * Vertically stacked, individually expandable sections. Compose:\n *\n * <Accordion type=\"single\" defaultValue=\"overview\" collapsible>\n * <Accordion.Item value=\"overview\">\n * <Accordion.Trigger>Overview</Accordion.Trigger>\n * <Accordion.Content>...</Accordion.Content>\n * </Accordion.Item>\n * </Accordion>\n *\n * Modes:\n * - `single` — at most one item open. Pass `collapsible` to allow closing the\n * open item.\n * - `multiple` — any combination open. `value` / `defaultValue` are arrays.\n *\n * Controlled (`value` + `onChange`) and uncontrolled (`defaultValue`) both\n * supported. Triggers are real `<button>`s with full keyboard nav: ArrowDown /\n * ArrowUp move focus, Home / End jump to first / last, Enter / Space toggle.\n */\nconst AccordionRoot = (props: AccordionProps) => {\n const baseId = useId();\n const refs = useRef<Map<string, RefObject<HTMLElement | null>>>(new Map());\n const orderRef = useRef<string[]>([]);\n\n // Pull out the props we always need; the discriminated union handlers below\n // narrow on `type` for the actual state logic.\n const { type, children, className, testID } = props;\n\n // Single-mode internal state. We always allocate both state slots so the\n // hook order stays stable across re-renders regardless of `type`.\n const [singleInner, setSingleInner] = useState<string | null>(\n type === 'single' ? (props.defaultValue ?? null) : null\n );\n const [multipleInner, setMultipleInner] = useState<string[]>(type === 'multiple' ? (props.defaultValue ?? []) : []);\n\n const singleControlled = type === 'single' && props.value !== undefined;\n const multipleControlled = type === 'multiple' && props.value !== undefined;\n\n const singleCurrent = type === 'single' ? (singleControlled ? (props.value ?? null) : singleInner) : null;\n const multipleCurrent = type === 'multiple' ? (multipleControlled ? (props.value ?? []) : multipleInner) : [];\n\n const isOpen = useCallback(\n (v: string) => {\n if (type === 'single') {\n return singleCurrent === v;\n }\n return multipleCurrent.includes(v);\n },\n [type, singleCurrent, multipleCurrent]\n );\n\n const toggle = useCallback(\n (v: string) => {\n if (type === 'single') {\n const next = singleCurrent === v ? (props.collapsible ? null : singleCurrent) : v;\n if (next === singleCurrent) {\n return;\n }\n if (!singleControlled) {\n setSingleInner(next);\n }\n props.onChange?.(next);\n } else {\n const has = multipleCurrent.includes(v);\n const next = has ? multipleCurrent.filter((x) => x !== v) : [...multipleCurrent, v];\n if (!multipleControlled) {\n setMultipleInner(next);\n }\n props.onChange?.(next);\n }\n },\n // The handler needs the latest snapshot of every prop — `props` is a\n // discriminated union so spreading it into the deps is the cleanest\n // way to keep both branches honest.\n [type, singleCurrent, multipleCurrent, singleControlled, multipleControlled, props]\n );\n\n const register = useCallback((v: string, ref: RefObject<HTMLElement | null>) => {\n refs.current.set(v, ref);\n if (!orderRef.current.includes(v)) {\n orderRef.current.push(v);\n }\n }, []);\n\n const unregister = useCallback((v: string) => {\n refs.current.delete(v);\n orderRef.current = orderRef.current.filter((x) => x !== v);\n }, []);\n\n const moveFocus = useCallback((offset: 1 | -1, fromValue: string) => {\n const order = orderRef.current;\n if (order.length === 0) {\n return;\n }\n const idx = order.indexOf(fromValue);\n const start = idx === -1 ? 0 : idx;\n const len = order.length;\n const next = order[(start + offset + len) % len];\n if (!next) {\n return;\n }\n refs.current.get(next)?.current?.focus?.();\n }, []);\n\n const focusEdge = useCallback((edge: 'first' | 'last') => {\n const order = orderRef.current;\n if (order.length === 0) {\n return;\n }\n const target = edge === 'first' ? order[0] : order[order.length - 1];\n if (!target) {\n return;\n }\n refs.current.get(target)?.current?.focus?.();\n }, []);\n\n const ctxValue = useMemo<AccordionContextValue>(\n () => ({ baseId, isOpen, toggle, register, unregister, moveFocus, focusEdge }),\n [baseId, isOpen, toggle, register, unregister, moveFocus, focusEdge]\n );\n\n return (\n <AccordionContext.Provider value={ctxValue}>\n <View\n {...(testID !== undefined ? { testID } : {})}\n className={cn('flex-col w-full', className)}\n style={{ flexDirection: 'column', width: '100%' }}\n >\n {children}\n </View>\n </AccordionContext.Provider>\n );\n};\n\nexport type AccordionItemProps = {\n /** Stable identifier — links the item to `value` / `defaultValue` on the parent. */\n value: string;\n /** Disable expansion of this item. The trigger remains focusable for nav consistency. */\n disabled?: boolean;\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\nconst ITEM_BASE: ViewStyle = {\n borderBottomWidth: 1,\n flexDirection: 'column',\n};\n\n// Layout-only constants for the trigger / content; theme-driven sizes are\n// merged in inside the component below.\nconst TRIGGER_LAYOUT_BASE: ViewStyle = {\n minHeight: 44, // component-density literal — not from theme\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n};\n\nconst CONTENT_INNER_LAYOUT_BASE: ViewStyle = {\n // Padding values come from theme inside AccordionContent.\n};\n\n/** A single expandable section. Wraps an `Accordion.Trigger` and `Accordion.Content`. */\nexport const AccordionItem = ({ value, disabled = false, children, className, testID }: AccordionItemProps) => {\n const ctx = useAccordionContext('Accordion.Item');\n const colors = useThemeColors();\n const open = ctx.isOpen(value);\n\n const itemCtx = useMemo<AccordionItemContextValue>(\n () => ({\n value,\n open,\n disabled,\n triggerId: `${ctx.baseId}-trigger-${value}`,\n contentId: `${ctx.baseId}-content-${value}`,\n }),\n [value, open, disabled, ctx.baseId]\n );\n\n return (\n <AccordionItemContext.Provider value={itemCtx}>\n <View\n {...(testID !== undefined ? { testID } : {})}\n className={cn('flex-col border-b border-semantic-border-default', className)}\n style={[ITEM_BASE, { borderBottomColor: colors.semantic.border.default }]}\n >\n {children}\n </View>\n </AccordionItemContext.Provider>\n );\n};\n\nexport type AccordionTriggerProps = {\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\n/**\n * The clickable row that toggles its item open / closed. Renders a real\n * `<button>` (via Pressable) and wires `aria-expanded` + `aria-controls` to\n * the matching `Accordion.Content`.\n */\nexport const AccordionTrigger = ({ children, className, testID }: AccordionTriggerProps) => {\n const ctx = useAccordionContext('Accordion.Trigger');\n const item = useAccordionItemContext('Accordion.Trigger');\n const colors = useThemeColors();\n const ownRef = useRef<HTMLElement | null>(null);\n const triggerStyle: ViewStyle = {\n ...TRIGGER_LAYOUT_BASE,\n paddingHorizontal: px(colors.spacing['4']),\n paddingVertical: px(colors.spacing['3']),\n gap: px(colors.spacing['3']),\n };\n\n useEffect(() => {\n ctx.register(item.value, ownRef);\n return () => ctx.unregister(item.value);\n }, [ctx, item.value]);\n\n const onPress = useCallback(() => {\n if (item.disabled) {\n return;\n }\n ctx.toggle(item.value);\n }, [ctx, item.value, item.disabled]);\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLElement>) => {\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n ctx.moveFocus(1, item.value);\n return;\n case 'ArrowUp':\n event.preventDefault();\n ctx.moveFocus(-1, item.value);\n return;\n case 'Home':\n event.preventDefault();\n ctx.focusEdge('first');\n return;\n case 'End':\n event.preventDefault();\n ctx.focusEdge('last');\n return;\n case 'Enter':\n case ' ': {\n event.preventDefault();\n if (!item.disabled) {\n ctx.toggle(item.value);\n }\n return;\n }\n }\n },\n [ctx, item.value, item.disabled]\n );\n\n // CSS transition for the chevron rotation on web. On native, RN expects\n // an array of transform objects (`[{ rotate: '180deg' }]`), so we branch\n // by platform to keep both ends rendering correctly. The web branch also\n // adds a CSS transition for a smooth rotation; native snaps (consumers\n // who want a spring can compose their own).\n const chevronStyle =\n Platform.OS === 'web'\n ? ({\n transition: 'transform 200ms ease',\n transform: `rotate(${item.open ? 180 : 0}deg)`,\n } as unknown as ViewStyle)\n : ({ transform: [{ rotate: item.open ? '180deg' : '0deg' }] } as ViewStyle);\n\n const triggerProps: Record<string, unknown> = {\n ref: (node: HTMLElement | null) => {\n ownRef.current = node;\n },\n role: 'button',\n accessibilityRole: 'button',\n 'aria-expanded': item.open,\n 'aria-controls': item.contentId,\n 'aria-disabled': item.disabled || undefined,\n id: item.triggerId,\n // Every trigger sits in the tab order — pressing Tab moves through\n // the accordion sequentially, then arrow keys take over once focused.\n tabIndex: 0,\n onPress,\n onKeyDown: handleKeyDown,\n ...(item.disabled ? { disabled: true } : {}),\n ...(testID !== undefined ? { testID } : {}),\n };\n\n return (\n <Pressable\n {...triggerProps}\n className={cn(\n 'flex-row items-center justify-between gap-3 px-4 py-3 min-h-[44px] hover:bg-semantic-background-subtle',\n item.disabled ? 'opacity-50' : 'opacity-100',\n className\n )}\n style={[triggerStyle, item.disabled ? { opacity: 0.5 } : null]}\n >\n {typeof children === 'string' ? (\n <RNText\n style={{\n color: colors.semantic.text.default,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n fontWeight: colors.fontWeight.medium as '500',\n flexShrink: 1,\n }}\n >\n {children}\n </RNText>\n ) : (\n children\n )}\n <View aria-hidden={true} style={chevronStyle}>\n <defaultSemanticIcons.chevronDown size={18} color={colors.semantic.text.muted} />\n </View>\n </Pressable>\n );\n};\n\nexport type AccordionContentProps = {\n children?: ReactNode;\n className?: string;\n testID?: string;\n /**\n * Keep the content mounted even when collapsed. Useful for forms that\n * shouldn't lose state, or content that's expensive to mount.\n * @defaultValue false\n */\n forceMount?: boolean;\n};\n\n// Animation timing — mirrors the Switch slide and the web CSS\n// transition exactly so the accordion feels identical on web and native.\nconst ACCORDION_ANIM_DURATION_MS = 200;\n\n/**\n * The collapsible body. On web it always mounts but slides open / closed\n * via an animated max-height + opacity transition (200ms ease). On native\n * it mounts in a measure-pass on first render to capture the natural\n * content height, then animates `height` + `opacity` via the shared\n * `useAnimatedNumber` primitive (200ms, cubic-bezier(0.16, 1, 0.3, 1) —\n * matches the Switch thumb slide).\n *\n * Implementation note: the web-side height + transition styles are pushed\n * onto the outer wrapper's DOM node via a ref + useEffect rather than\n * through the View's `style` prop. Reason: rn-web's style filter drops\n * keys it doesn't recognise as RN style props (`transition`, `maxHeight`\n * shorthand, etc.), taking the whole fragment with them. Direct DOM\n * mutation bypasses that filter — same trick used by Dialog's backdrop\n * blur.\n */\nexport const AccordionContent = ({\n children,\n className,\n testID,\n forceMount: _forceMount = false,\n}: AccordionContentProps) => {\n const item = useAccordionItemContext('Accordion.Content');\n const colors = useThemeColors();\n const wrapperRef = useRef<HTMLElement | null>(null);\n const innerRef = useRef<HTMLElement | null>(null);\n // Natural (open-state) height of the content, captured on first\n // layout. Re-captured if the layout reports a different size while\n // open (e.g. dynamic content).\n const [measuredHeight, setMeasuredHeight] = useState<number | null>(null);\n const innerStyle: ViewStyle = {\n ...CONTENT_INNER_LAYOUT_BASE,\n paddingHorizontal: px(colors.spacing['4']),\n paddingTop: px(colors.spacing['1']),\n paddingBottom: px(colors.spacing['3']),\n };\n\n // Slide open/close on web. We measure the natural height of the inner\n // content each time the open state flips, then animate the wrapper's\n // maxHeight to/from 0. Setting maxHeight: 'none' after the transition\n // would let the content grow if it later changes — but for the v0\n // accordion we expect static content, so we leave maxHeight at the\n // measured value (good enough; resize observer can come later).\n useEffect(() => {\n if (Platform.OS !== 'web') {\n return;\n }\n const wrapper = wrapperRef.current;\n const inner = innerRef.current;\n if (!wrapper || !inner) {\n return;\n }\n\n // First-render shortcut: skip the animation when an item starts\n // already open (avoids the \"all items open then animate closed\"\n // flash on mount).\n const isFirstPaint = wrapper.dataset.noriPainted !== '1';\n wrapper.dataset.noriPainted = '1';\n\n wrapper.style.overflow = 'hidden';\n wrapper.style.transitionProperty = 'max-height, opacity';\n wrapper.style.transitionDuration = `${ACCORDION_ANIM_DURATION_MS}ms`;\n wrapper.style.transitionTimingFunction = 'cubic-bezier(0.16, 1, 0.3, 1)';\n\n if (item.open) {\n const target = inner.scrollHeight;\n if (isFirstPaint) {\n wrapper.style.maxHeight = `${target}px`;\n wrapper.style.opacity = '1';\n return;\n }\n // Animate from current measured 0px to the target height.\n wrapper.style.maxHeight = '0px';\n wrapper.style.opacity = '0';\n // Force a reflow so the start state actually applies before\n // we set the end state — otherwise the browser collapses\n // both into a single repaint and skips the animation.\n void wrapper.offsetHeight;\n requestAnimationFrame(() => {\n wrapper.style.maxHeight = `${target}px`;\n wrapper.style.opacity = '1';\n });\n } else {\n // Going from open → closed. Set the explicit current height\n // first so we have something to transition FROM (auto/none\n // doesn't transition).\n const current = inner.scrollHeight;\n wrapper.style.maxHeight = `${current}px`;\n wrapper.style.opacity = '1';\n void wrapper.offsetHeight;\n requestAnimationFrame(() => {\n wrapper.style.maxHeight = '0px';\n wrapper.style.opacity = '0';\n });\n }\n }, [item.open]);\n\n // Native height + opacity animation. Driven by `useAnimatedNumber`,\n // which dispatches per-property to a static-key reanimated worklet\n // (the plugin can't serialize closures over computed keys, so each\n // property gets its own static-key useAnimatedStyle inside the hook).\n //\n // Target values are derived from open + measured size. Before\n // measurement we still call the hooks (hook order must stay\n // stable); they animate to/from 0 which becomes a no-op until the\n // first onLayout fires.\n const targetHeight = item.open ? (measuredHeight ?? 0) : 0;\n const targetOpacity = item.open ? 1 : 0;\n const heightAnim = useAnimatedNumber('height', targetHeight, {\n duration: ACCORDION_ANIM_DURATION_MS,\n });\n const opacityAnim = useAnimatedNumber('opacity', targetOpacity, {\n duration: ACCORDION_ANIM_DURATION_MS,\n });\n\n const onInnerLayout = useCallback(\n (e: LayoutChangeEvent) => {\n if (Platform.OS === 'web') {\n return;\n }\n const next = e.nativeEvent.layout.height;\n if (next > 0 && next !== measuredHeight) {\n setMeasuredHeight(next);\n }\n },\n [measuredHeight]\n );\n\n // Native path: always mount the inner so we can measure its natural\n // height once. Before measurement, we render with `position:\n // absolute, opacity: 0` so the layout pass runs off-screen and\n // doesn't affect the surrounding flow (avoids the \"flash of fully-\n // open content\" on first paint of an initially-closed item).\n // After measurement, the outer Animated.View drives height +\n // opacity together.\n if (Platform.OS !== 'web') {\n const animatedWrapperStyle: ViewStyle = {\n overflow: 'hidden',\n };\n // Pre-measurement: render the inner off-screen for one layout\n // pass. The wrapper claims 0 height in the flow so the next\n // sibling is positioned correctly until we know the real size.\n if (measuredHeight === null) {\n return (\n <AnimatedView\n {...(testID !== undefined ? { testID } : {})}\n accessibilityRole=\"none\"\n aria-labelledby={item.triggerId}\n aria-hidden={!item.open}\n style={[animatedWrapperStyle, { height: 0 }]}\n className={cn('overflow-hidden', className)}\n >\n <View\n onLayout={onInnerLayout}\n className={cn('px-4 pt-1 pb-3')}\n // Absolute + left/right:0 stretches the measurement\n // pass to the parent's full width, so wrapping text\n // measures at its REAL natural height. Without\n // left/right, Yoga gives an absolute child width 0\n // and the measurement collapses to a few pixels.\n style={[innerStyle, { position: 'absolute', left: 0, right: 0, opacity: 0 }]}\n >\n {typeof children === 'string' ? (\n <RNText\n style={{\n color: colors.semantic.text.muted,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n lineHeight: px(colors.fontSize.sm) * Number(colors.lineHeight.normal),\n }}\n >\n {children}\n </RNText>\n ) : (\n children\n )}\n </View>\n </AnimatedView>\n );\n }\n return (\n <AnimatedView\n {...(testID !== undefined ? { testID } : {})}\n accessibilityRole=\"none\"\n aria-labelledby={item.triggerId}\n aria-hidden={!item.open}\n style={[animatedWrapperStyle, heightAnim as object]}\n className={cn('overflow-hidden', className)}\n >\n <AnimatedView style={opacityAnim as object}>\n {/* No `onLayout` on this inner — once we've captured\n the natural height in the measurement pass above,\n re-measuring here during the animation would see\n the CLIPPED height (the parent is mid-transition\n between 0 and the target) and clobber\n `measuredHeight` with that smaller value, freezing\n the open state at one line. Single-shot measurement\n is fine for static content; remeasuring on content\n change is a follow-up. */}\n <View className={cn('px-4 pt-1 pb-3')} style={innerStyle}>\n {typeof children === 'string' ? (\n <RNText\n style={{\n color: colors.semantic.text.muted,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n lineHeight: px(colors.fontSize.sm) * Number(colors.lineHeight.normal),\n }}\n >\n {children}\n </RNText>\n ) : (\n children\n )}\n </View>\n </AnimatedView>\n </AnimatedView>\n );\n }\n\n return (\n <View\n ref={(node: unknown) => {\n wrapperRef.current = node as HTMLElement | null;\n }}\n {...(testID !== undefined ? { testID } : {})}\n role=\"region\"\n accessibilityRole=\"none\"\n id={item.contentId}\n aria-labelledby={item.triggerId}\n aria-hidden={!item.open}\n className={cn('overflow-hidden', className)}\n >\n <View\n ref={(node: unknown) => {\n innerRef.current = node as HTMLElement | null;\n }}\n className={cn('px-4 pt-1 pb-3')}\n style={innerStyle}\n >\n {typeof children === 'string' ? (\n <RNText\n style={{\n color: colors.semantic.text.muted,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n lineHeight: px(colors.fontSize.sm) * Number(colors.lineHeight.normal),\n }}\n >\n {children}\n </RNText>\n ) : (\n children\n )}\n </View>\n </View>\n );\n};\n\n/**\n * Public `Accordion` value — the root function plus its `.Item`, `.Trigger`,\n * and `.Content` static members. `Object.assign` produces a value whose\n * inferred type carries the static properties, so `.d.ts` consumers can\n * write `<Accordion.Item>` without a separate import.\n */\nexport const Accordion = Object.assign(AccordionRoot, {\n Item: AccordionItem,\n Trigger: AccordionTrigger,\n Content: AccordionContent,\n});\n"]}
1
+ {"version":3,"sources":["../src/components/Accordion/Accordion.tsx"],"names":["RNText"],"mappings":";;;;;;;;;;;AAsEA,IAAM,gBAAA,GAAmB,cAA4C,IAAI,CAAA;AAEzE,IAAM,mBAAA,2BAAuB,KAAA,KAAyC;AAClE,EAAA,MAAM,GAAA,GAAM,WAAW,gBAAgB,CAAA;AACvC,EAAA,IAAI,CAAC,GAAA,EAAK;AACN,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,CAAA,EAAI,KAAK,CAAA,yCAAA,CAA2C,CAAA;AAAA,EACxE;AACA,EAAA,OAAO,GAAA;AACX,CAAA,EAN4B,qBAAA,CAAA;AAgB5B,IAAM,oBAAA,GAAuB,cAAgD,IAAI,CAAA;AAEjF,IAAM,uBAAA,2BAA2B,KAAA,KAA6C;AAC1E,EAAA,MAAM,GAAA,GAAM,WAAW,oBAAoB,CAAA;AAC3C,EAAA,IAAI,CAAC,GAAA,EAAK;AACN,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,CAAA,EAAI,KAAK,CAAA,8CAAA,CAAgD,CAAA;AAAA,EAC7E;AACA,EAAA,OAAO,GAAA;AACX,CAAA,EAN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B,CAAA;AAAA,UACA,SAAA,EAAW,GAAG,gBAAgB,CAAA;AAAA,UAC9B,KAAA,EAAO,UAAA;AAAA,UAEN,QAAA,EAAA,OAAO,aAAa,QAAA,mBACjB,GAAA;AAAA,YAACA,IAAA;AAAA,YAAA;AAAA,cACG,KAAA,EAAO;AAAA,gBACH,KAAA,EAAO,MAAA,CAAO,QAAA,CAAS,IAAA,CAAK,KAAA;AAAA,gBAC5B,UAAA,EAAY,OAAO,UAAA,CAAW,IAAA;AAAA,gBAC9B,QAAA,EAAU,EAAA,CAAG,MAAA,CAAO,QAAA,CAAS,EAAE,CAAA;AAAA,gBAC/B,UAAA,EAAY,GAAG,MAAA,CAAO,QAAA,CAAS,EAAE,CAAA,GAAI,MAAA,CAAO,MAAA,CAAO,UAAA,CAAW,MAAM;AAAA,eACxE;AAAA,cAEC;AAAA;AAAA,WACL,GAEA;AAAA;AAAA;AAER;AAAA,GACJ;AAER,CAAA,EAjPgC,kBAAA,CAAA;AAyPzB,IAAM,SAAA,GAAY,MAAA,CAAO,MAAA,CAAO,aAAA,EAAe;AAAA,EAClD,IAAA,EAAM,aAAA;AAAA,EACN,OAAA,EAAS,gBAAA;AAAA,EACT,OAAA,EAAS;AACb,CAAC","file":"chunk-Y4ZRSW35.js","sourcesContent":["'use client';\n\nimport {\n createContext,\n type KeyboardEvent,\n type ReactNode,\n type RefObject,\n useCallback,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport type { LayoutChangeEvent, ViewStyle } from 'react-native';\nimport { Platform, Pressable, Text as RNText, View } from 'react-native';\nimport { AnimatedView } from '../../animation/animated-view';\nimport { useAnimatedNumber } from '../../animation/use-animated-number';\nimport { defaultSemanticIcons } from '../../icons/default-semantic-icons';\nimport { px } from '../../theme/px';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\n\nexport type AccordionType = 'single' | 'multiple';\n\ntype SingleProps = {\n /** One-at-a-time mode. */\n type: 'single';\n /** Controlled open value. Pass `null` (with `collapsible`) for \"nothing open\". */\n value?: string | null;\n /** Uncontrolled initial open value. */\n defaultValue?: string;\n /** Fires when the open value changes. Receives the new value (string), or `null` if collapsed. */\n onChange?: (next: string | null) => void;\n /** Allow closing the open item by clicking it again. @defaultValue false */\n collapsible?: boolean;\n};\n\ntype MultipleProps = {\n /** Any combination open. */\n type: 'multiple';\n /** Controlled list of open values. */\n value?: string[];\n /** Uncontrolled initial list of open values. */\n defaultValue?: string[];\n /** Fires when the open list changes. Receives the new list. */\n onChange?: (next: string[]) => void;\n /** No-op in `multiple` mode (items are always individually collapsible). */\n collapsible?: never;\n};\n\ntype CommonProps = {\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\nexport type AccordionProps = (SingleProps | MultipleProps) & CommonProps;\n\ntype AccordionContextValue = {\n baseId: string;\n isOpen: (value: string) => boolean;\n toggle: (value: string) => void;\n register: (value: string, ref: RefObject<HTMLElement | null>) => void;\n unregister: (value: string) => void;\n moveFocus: (offset: 1 | -1, fromValue: string) => void;\n focusEdge: (edge: 'first' | 'last') => void;\n};\n\nconst AccordionContext = createContext<AccordionContextValue | null>(null);\n\nconst useAccordionContext = (label: string): AccordionContextValue => {\n const ctx = useContext(AccordionContext);\n if (!ctx) {\n throw new Error(`<${label}> must be rendered inside an <Accordion>.`);\n }\n return ctx;\n};\n\ntype AccordionItemContextValue = {\n value: string;\n open: boolean;\n disabled: boolean;\n triggerId: string;\n contentId: string;\n};\n\nconst AccordionItemContext = createContext<AccordionItemContextValue | null>(null);\n\nconst useAccordionItemContext = (label: string): AccordionItemContextValue => {\n const ctx = useContext(AccordionItemContext);\n if (!ctx) {\n throw new Error(`<${label}> must be rendered inside an <Accordion.Item>.`);\n }\n return ctx;\n};\n\n/**\n * Vertically stacked, individually expandable sections. Compose:\n *\n * <Accordion type=\"single\" defaultValue=\"overview\" collapsible>\n * <Accordion.Item value=\"overview\">\n * <Accordion.Trigger>Overview</Accordion.Trigger>\n * <Accordion.Content>...</Accordion.Content>\n * </Accordion.Item>\n * </Accordion>\n *\n * Modes:\n * - `single` — at most one item open. Pass `collapsible` to allow closing the\n * open item.\n * - `multiple` — any combination open. `value` / `defaultValue` are arrays.\n *\n * Controlled (`value` + `onChange`) and uncontrolled (`defaultValue`) both\n * supported. Triggers are real `<button>`s with full keyboard nav: ArrowDown /\n * ArrowUp move focus, Home / End jump to first / last, Enter / Space toggle.\n */\nconst AccordionRoot = (props: AccordionProps) => {\n const baseId = useId();\n const refs = useRef<Map<string, RefObject<HTMLElement | null>>>(new Map());\n const orderRef = useRef<string[]>([]);\n\n // Pull out the props we always need; the discriminated union handlers below\n // narrow on `type` for the actual state logic.\n const { type, children, className, testID } = props;\n\n // Single-mode internal state. We always allocate both state slots so the\n // hook order stays stable across re-renders regardless of `type`.\n const [singleInner, setSingleInner] = useState<string | null>(\n type === 'single' ? (props.defaultValue ?? null) : null\n );\n const [multipleInner, setMultipleInner] = useState<string[]>(type === 'multiple' ? (props.defaultValue ?? []) : []);\n\n const singleControlled = type === 'single' && props.value !== undefined;\n const multipleControlled = type === 'multiple' && props.value !== undefined;\n\n const singleCurrent = type === 'single' ? (singleControlled ? (props.value ?? null) : singleInner) : null;\n const multipleCurrent = type === 'multiple' ? (multipleControlled ? (props.value ?? []) : multipleInner) : [];\n\n const isOpen = useCallback(\n (v: string) => {\n if (type === 'single') {\n return singleCurrent === v;\n }\n return multipleCurrent.includes(v);\n },\n [type, singleCurrent, multipleCurrent]\n );\n\n const toggle = useCallback(\n (v: string) => {\n if (type === 'single') {\n const next = singleCurrent === v ? (props.collapsible ? null : singleCurrent) : v;\n if (next === singleCurrent) {\n return;\n }\n if (!singleControlled) {\n setSingleInner(next);\n }\n props.onChange?.(next);\n } else {\n const has = multipleCurrent.includes(v);\n const next = has ? multipleCurrent.filter((x) => x !== v) : [...multipleCurrent, v];\n if (!multipleControlled) {\n setMultipleInner(next);\n }\n props.onChange?.(next);\n }\n },\n // The handler needs the latest snapshot of every prop — `props` is a\n // discriminated union so spreading it into the deps is the cleanest\n // way to keep both branches honest.\n [type, singleCurrent, multipleCurrent, singleControlled, multipleControlled, props]\n );\n\n const register = useCallback((v: string, ref: RefObject<HTMLElement | null>) => {\n refs.current.set(v, ref);\n if (!orderRef.current.includes(v)) {\n orderRef.current.push(v);\n }\n }, []);\n\n const unregister = useCallback((v: string) => {\n refs.current.delete(v);\n orderRef.current = orderRef.current.filter((x) => x !== v);\n }, []);\n\n const moveFocus = useCallback((offset: 1 | -1, fromValue: string) => {\n const order = orderRef.current;\n if (order.length === 0) {\n return;\n }\n const idx = order.indexOf(fromValue);\n const start = idx === -1 ? 0 : idx;\n const len = order.length;\n const next = order[(start + offset + len) % len];\n if (!next) {\n return;\n }\n refs.current.get(next)?.current?.focus?.();\n }, []);\n\n const focusEdge = useCallback((edge: 'first' | 'last') => {\n const order = orderRef.current;\n if (order.length === 0) {\n return;\n }\n const target = edge === 'first' ? order[0] : order[order.length - 1];\n if (!target) {\n return;\n }\n refs.current.get(target)?.current?.focus?.();\n }, []);\n\n const ctxValue = useMemo<AccordionContextValue>(\n () => ({ baseId, isOpen, toggle, register, unregister, moveFocus, focusEdge }),\n [baseId, isOpen, toggle, register, unregister, moveFocus, focusEdge]\n );\n\n return (\n <AccordionContext.Provider value={ctxValue}>\n <View\n {...(testID !== undefined ? { testID } : {})}\n className={cn('flex-col w-full', className)}\n style={{ flexDirection: 'column', width: '100%' }}\n >\n {children}\n </View>\n </AccordionContext.Provider>\n );\n};\n\nexport type AccordionItemProps = {\n /** Stable identifier — links the item to `value` / `defaultValue` on the parent. */\n value: string;\n /** Disable expansion of this item. The trigger remains focusable for nav consistency. */\n disabled?: boolean;\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\nconst ITEM_BASE: ViewStyle = {\n borderBottomWidth: 1,\n flexDirection: 'column',\n};\n\n// Layout-only constants for the trigger / content; theme-driven sizes are\n// merged in inside the component below.\nconst TRIGGER_LAYOUT_BASE: ViewStyle = {\n minHeight: 44, // component-density literal — not from theme\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n};\n\nconst CONTENT_INNER_LAYOUT_BASE: ViewStyle = {\n // Padding values come from theme inside AccordionContent.\n};\n\n/** A single expandable section. Wraps an `Accordion.Trigger` and `Accordion.Content`. */\nexport const AccordionItem = ({ value, disabled = false, children, className, testID }: AccordionItemProps) => {\n const ctx = useAccordionContext('Accordion.Item');\n const colors = useThemeColors();\n const open = ctx.isOpen(value);\n\n const itemCtx = useMemo<AccordionItemContextValue>(\n () => ({\n value,\n open,\n disabled,\n triggerId: `${ctx.baseId}-trigger-${value}`,\n contentId: `${ctx.baseId}-content-${value}`,\n }),\n [value, open, disabled, ctx.baseId]\n );\n\n return (\n <AccordionItemContext.Provider value={itemCtx}>\n <View\n {...(testID !== undefined ? { testID } : {})}\n className={cn('flex-col border-b border-semantic-border-default', className)}\n style={[ITEM_BASE, { borderBottomColor: colors.semantic.border.default }]}\n >\n {children}\n </View>\n </AccordionItemContext.Provider>\n );\n};\n\nexport type AccordionTriggerProps = {\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\n/**\n * The clickable row that toggles its item open / closed. Renders a real\n * `<button>` (via Pressable) and wires `aria-expanded` + `aria-controls` to\n * the matching `Accordion.Content`.\n */\nexport const AccordionTrigger = ({ children, className, testID }: AccordionTriggerProps) => {\n const ctx = useAccordionContext('Accordion.Trigger');\n const item = useAccordionItemContext('Accordion.Trigger');\n const colors = useThemeColors();\n const ownRef = useRef<HTMLElement | null>(null);\n const triggerStyle: ViewStyle = {\n ...TRIGGER_LAYOUT_BASE,\n paddingHorizontal: px(colors.spacing['4']),\n paddingVertical: px(colors.spacing['3']),\n gap: px(colors.spacing['3']),\n };\n\n useEffect(() => {\n ctx.register(item.value, ownRef);\n return () => ctx.unregister(item.value);\n }, [ctx, item.value]);\n\n const onPress = useCallback(() => {\n if (item.disabled) {\n return;\n }\n ctx.toggle(item.value);\n }, [ctx, item.value, item.disabled]);\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLElement>) => {\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n ctx.moveFocus(1, item.value);\n return;\n case 'ArrowUp':\n event.preventDefault();\n ctx.moveFocus(-1, item.value);\n return;\n case 'Home':\n event.preventDefault();\n ctx.focusEdge('first');\n return;\n case 'End':\n event.preventDefault();\n ctx.focusEdge('last');\n return;\n case 'Enter':\n case ' ': {\n event.preventDefault();\n if (!item.disabled) {\n ctx.toggle(item.value);\n }\n return;\n }\n }\n },\n [ctx, item.value, item.disabled]\n );\n\n // CSS transition for the chevron rotation on web. On native, RN expects\n // an array of transform objects (`[{ rotate: '180deg' }]`), so we branch\n // by platform to keep both ends rendering correctly. The web branch also\n // adds a CSS transition for a smooth rotation; native snaps (consumers\n // who want a spring can compose their own).\n const chevronStyle =\n Platform.OS === 'web'\n ? ({\n transition: 'transform 200ms ease',\n transform: `rotate(${item.open ? 180 : 0}deg)`,\n } as unknown as ViewStyle)\n : ({ transform: [{ rotate: item.open ? '180deg' : '0deg' }] } as ViewStyle);\n\n const triggerProps: Record<string, unknown> = {\n ref: (node: HTMLElement | null) => {\n ownRef.current = node;\n },\n role: 'button',\n accessibilityRole: 'button',\n 'aria-expanded': item.open,\n 'aria-controls': item.contentId,\n 'aria-disabled': item.disabled || undefined,\n id: item.triggerId,\n // Every trigger sits in the tab order — pressing Tab moves through\n // the accordion sequentially, then arrow keys take over once focused.\n tabIndex: 0,\n onPress,\n onKeyDown: handleKeyDown,\n ...(item.disabled ? { disabled: true } : {}),\n ...(testID !== undefined ? { testID } : {}),\n };\n\n return (\n <Pressable\n {...triggerProps}\n className={cn(\n 'flex-row items-center justify-between gap-3 px-4 py-3 min-h-[44px] hover:bg-semantic-background-subtle',\n item.disabled ? 'opacity-50' : 'opacity-100',\n className\n )}\n style={[triggerStyle, item.disabled ? { opacity: 0.5 } : null]}\n >\n {typeof children === 'string' ? (\n <RNText\n style={{\n color: colors.semantic.text.default,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n fontWeight: colors.fontWeight.medium as '500',\n flexShrink: 1,\n }}\n >\n {children}\n </RNText>\n ) : (\n children\n )}\n <View aria-hidden={true} style={chevronStyle}>\n <defaultSemanticIcons.chevronDown size={18} color={colors.semantic.text.muted} />\n </View>\n </Pressable>\n );\n};\n\nexport type AccordionContentProps = {\n children?: ReactNode;\n className?: string;\n testID?: string;\n /**\n * Keep the content mounted even when collapsed. Useful for forms that\n * shouldn't lose state, or content that's expensive to mount.\n * @defaultValue false\n */\n forceMount?: boolean;\n};\n\n// Animation timing — mirrors the Switch slide and the web CSS\n// transition exactly so the accordion feels identical on web and native.\nconst ACCORDION_ANIM_DURATION_MS = 200;\n\n/**\n * The collapsible body. On web it always mounts but slides open / closed\n * via an animated max-height + opacity transition (200ms ease). On native\n * it mounts in a measure-pass on first render to capture the natural\n * content height, then animates `height` + `opacity` via the shared\n * `useAnimatedNumber` primitive (200ms, cubic-bezier(0.16, 1, 0.3, 1) —\n * matches the Switch thumb slide).\n *\n * Implementation note: the web-side height + transition styles are pushed\n * onto the outer wrapper's DOM node via a ref + useEffect rather than\n * through the View's `style` prop. Reason: rn-web's style filter drops\n * keys it doesn't recognise as RN style props (`transition`, `maxHeight`\n * shorthand, etc.), taking the whole fragment with them. Direct DOM\n * mutation bypasses that filter — same trick used by Dialog's backdrop\n * blur.\n */\nexport const AccordionContent = ({\n children,\n className,\n testID,\n forceMount: _forceMount = false,\n}: AccordionContentProps) => {\n const item = useAccordionItemContext('Accordion.Content');\n const colors = useThemeColors();\n const wrapperRef = useRef<HTMLElement | null>(null);\n const innerRef = useRef<HTMLElement | null>(null);\n // Natural (open-state) height of the content, captured on first\n // layout. Re-captured if the layout reports a different size while\n // open (e.g. dynamic content).\n const [measuredHeight, setMeasuredHeight] = useState<number | null>(null);\n const innerStyle: ViewStyle = {\n ...CONTENT_INNER_LAYOUT_BASE,\n paddingHorizontal: px(colors.spacing['4']),\n paddingTop: px(colors.spacing['1']),\n paddingBottom: px(colors.spacing['3']),\n };\n\n // Slide open/close on web. We measure the natural height of the inner\n // content each time the open state flips, then animate the wrapper's\n // maxHeight to/from 0. Setting maxHeight: 'none' after the transition\n // would let the content grow if it later changes — but for the v0\n // accordion we expect static content, so we leave maxHeight at the\n // measured value (good enough; resize observer can come later).\n useEffect(() => {\n if (Platform.OS !== 'web') {\n return;\n }\n const wrapper = wrapperRef.current;\n const inner = innerRef.current;\n if (!wrapper || !inner) {\n return;\n }\n\n // First-render shortcut: skip the animation when an item starts\n // already open (avoids the \"all items open then animate closed\"\n // flash on mount).\n const isFirstPaint = wrapper.dataset.noriPainted !== '1';\n wrapper.dataset.noriPainted = '1';\n\n wrapper.style.overflow = 'hidden';\n wrapper.style.transitionProperty = 'max-height, opacity';\n wrapper.style.transitionDuration = `${ACCORDION_ANIM_DURATION_MS}ms`;\n wrapper.style.transitionTimingFunction = 'cubic-bezier(0.16, 1, 0.3, 1)';\n\n if (item.open) {\n const target = inner.scrollHeight;\n if (isFirstPaint) {\n wrapper.style.maxHeight = `${target}px`;\n wrapper.style.opacity = '1';\n return;\n }\n // Animate from current measured 0px to the target height.\n wrapper.style.maxHeight = '0px';\n wrapper.style.opacity = '0';\n // Force a reflow so the start state actually applies before\n // we set the end state — otherwise the browser collapses\n // both into a single repaint and skips the animation.\n void wrapper.offsetHeight;\n requestAnimationFrame(() => {\n wrapper.style.maxHeight = `${target}px`;\n wrapper.style.opacity = '1';\n });\n } else {\n // Going from open → closed. Set the explicit current height\n // first so we have something to transition FROM (auto/none\n // doesn't transition).\n const current = inner.scrollHeight;\n wrapper.style.maxHeight = `${current}px`;\n wrapper.style.opacity = '1';\n void wrapper.offsetHeight;\n requestAnimationFrame(() => {\n wrapper.style.maxHeight = '0px';\n wrapper.style.opacity = '0';\n });\n }\n }, [item.open]);\n\n // Native height + opacity animation. Driven by `useAnimatedNumber`,\n // which dispatches per-property to a static-key reanimated worklet\n // (the plugin can't serialize closures over computed keys, so each\n // property gets its own static-key useAnimatedStyle inside the hook).\n //\n // Target values are derived from open + measured size. Before\n // measurement we still call the hooks (hook order must stay\n // stable); they animate to/from 0 which becomes a no-op until the\n // first onLayout fires.\n const targetHeight = item.open ? (measuredHeight ?? 0) : 0;\n const targetOpacity = item.open ? 1 : 0;\n const heightAnim = useAnimatedNumber('height', targetHeight, {\n duration: ACCORDION_ANIM_DURATION_MS,\n });\n const opacityAnim = useAnimatedNumber('opacity', targetOpacity, {\n duration: ACCORDION_ANIM_DURATION_MS,\n });\n\n const onInnerLayout = useCallback(\n (e: LayoutChangeEvent) => {\n if (Platform.OS === 'web') {\n return;\n }\n const next = e.nativeEvent.layout.height;\n if (next > 0 && next !== measuredHeight) {\n setMeasuredHeight(next);\n }\n },\n [measuredHeight]\n );\n\n // Native path: always mount the inner so we can measure its natural\n // height once. Before measurement, we render with `position:\n // absolute, opacity: 0` so the layout pass runs off-screen and\n // doesn't affect the surrounding flow (avoids the \"flash of fully-\n // open content\" on first paint of an initially-closed item).\n // After measurement, the outer Animated.View drives height +\n // opacity together.\n if (Platform.OS !== 'web') {\n const animatedWrapperStyle: ViewStyle = {\n overflow: 'hidden',\n };\n // Pre-measurement: render the inner off-screen for one layout\n // pass. The wrapper claims 0 height in the flow so the next\n // sibling is positioned correctly until we know the real size.\n if (measuredHeight === null) {\n return (\n <AnimatedView\n {...(testID !== undefined ? { testID } : {})}\n accessibilityRole=\"none\"\n aria-labelledby={item.triggerId}\n aria-hidden={!item.open}\n style={[animatedWrapperStyle, { height: 0 }]}\n className={cn('overflow-hidden', className)}\n >\n <View\n onLayout={onInnerLayout}\n className={cn('px-4 pt-1 pb-3')}\n // Absolute + left/right:0 stretches the measurement\n // pass to the parent's full width, so wrapping text\n // measures at its REAL natural height. Without\n // left/right, Yoga gives an absolute child width 0\n // and the measurement collapses to a few pixels.\n style={[innerStyle, { position: 'absolute', left: 0, right: 0, opacity: 0 }]}\n >\n {typeof children === 'string' ? (\n <RNText\n style={{\n color: colors.semantic.text.muted,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n lineHeight: px(colors.fontSize.sm) * Number(colors.lineHeight.normal),\n }}\n >\n {children}\n </RNText>\n ) : (\n children\n )}\n </View>\n </AnimatedView>\n );\n }\n return (\n <AnimatedView\n {...(testID !== undefined ? { testID } : {})}\n accessibilityRole=\"none\"\n aria-labelledby={item.triggerId}\n aria-hidden={!item.open}\n style={[animatedWrapperStyle, heightAnim as object]}\n className={cn('overflow-hidden', className)}\n >\n <AnimatedView style={opacityAnim as object}>\n {/* No `onLayout` on this inner — once we've captured\n the natural height in the measurement pass above,\n re-measuring here during the animation would see\n the CLIPPED height (the parent is mid-transition\n between 0 and the target) and clobber\n `measuredHeight` with that smaller value, freezing\n the open state at one line. Single-shot measurement\n is fine for static content; remeasuring on content\n change is a follow-up. */}\n <View className={cn('px-4 pt-1 pb-3')} style={innerStyle}>\n {typeof children === 'string' ? (\n <RNText\n style={{\n color: colors.semantic.text.muted,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n lineHeight: px(colors.fontSize.sm) * Number(colors.lineHeight.normal),\n }}\n >\n {children}\n </RNText>\n ) : (\n children\n )}\n </View>\n </AnimatedView>\n </AnimatedView>\n );\n }\n\n return (\n <View\n ref={(node: unknown) => {\n wrapperRef.current = node as HTMLElement | null;\n }}\n {...(testID !== undefined ? { testID } : {})}\n role=\"region\"\n accessibilityRole=\"none\"\n id={item.contentId}\n aria-labelledby={item.triggerId}\n aria-hidden={!item.open}\n className={cn('overflow-hidden', className)}\n >\n <View\n ref={(node: unknown) => {\n innerRef.current = node as HTMLElement | null;\n }}\n className={cn('px-4 pt-1 pb-3')}\n style={innerStyle}\n >\n {typeof children === 'string' ? (\n <RNText\n style={{\n color: colors.semantic.text.muted,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n lineHeight: px(colors.fontSize.sm) * Number(colors.lineHeight.normal),\n }}\n >\n {children}\n </RNText>\n ) : (\n children\n )}\n </View>\n </View>\n );\n};\n\n/**\n * Public `Accordion` value — the root function plus its `.Item`, `.Trigger`,\n * and `.Content` static members. `Object.assign` produces a value whose\n * inferred type carries the static properties, so `.d.ts` consumers can\n * write `<Accordion.Item>` without a separate import.\n */\nexport const Accordion = Object.assign(AccordionRoot, {\n Item: AccordionItem,\n Trigger: AccordionTrigger,\n Content: AccordionContent,\n});\n"]}