@oxy.so/bloom 7.14.3 → 7.16.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/docs/accordion.mdx +38 -1
- package/docs/adoption-matrix.mdx +7 -7
- package/docs/button.mdx +28 -0
- package/docs/rating.mdx +18 -0
- package/docs/stat-bar.mdx +1 -0
- package/lib/commonjs/accordion/Accordion.js +60 -78
- package/lib/commonjs/accordion/Accordion.js.map +1 -1
- package/lib/commonjs/accordion/Accordion.web.js +193 -0
- package/lib/commonjs/accordion/Accordion.web.js.map +1 -0
- package/lib/commonjs/accordion/context.js +21 -0
- package/lib/commonjs/accordion/context.js.map +1 -0
- package/lib/commonjs/accordion/index.js +1 -1
- package/lib/commonjs/accordion/index.web.js +31 -0
- package/lib/commonjs/accordion/index.web.js.map +1 -0
- package/lib/commonjs/accordion/use-accordion.js +82 -0
- package/lib/commonjs/accordion/use-accordion.js.map +1 -0
- package/lib/commonjs/booking/BookingCard.js +2 -2
- package/lib/commonjs/booking/BookingCard.js.map +1 -1
- package/lib/commonjs/button/Button.js +14 -2
- package/lib/commonjs/button/Button.js.map +1 -1
- package/lib/commonjs/button/Button.web.js +50 -12
- package/lib/commonjs/button/Button.web.js.map +1 -1
- package/lib/commonjs/carrier-quote/CarrierQuoteCard.js +11 -11
- package/lib/commonjs/carrier-quote/CarrierQuoteCard.js.map +1 -1
- package/lib/commonjs/cart-panel/CartPanel.js +5 -5
- package/lib/commonjs/cart-panel/CartPanel.js.map +1 -1
- package/lib/commonjs/creator-studio/TrackUploadRow.js +10 -10
- package/lib/commonjs/creator-studio/TrackUploadRow.js.map +1 -1
- package/lib/commonjs/index.js +839 -839
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js +906 -906
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/commonjs/lead-score/LeadScoreCard.js +10 -10
- package/lib/commonjs/lead-score/LeadScoreCard.js.map +1 -1
- package/lib/commonjs/listing-actions/ApplicationChecklist.js +7 -7
- package/lib/commonjs/listing-actions/ApplicationChecklist.js.map +1 -1
- package/lib/commonjs/listing-card/ListingCard.js +25 -25
- package/lib/commonjs/listing-card/ListingCard.js.map +1 -1
- package/lib/commonjs/listing-details/ListingHeader.js +8 -8
- package/lib/commonjs/listing-details/ListingHeader.js.map +1 -1
- package/lib/commonjs/listing-details/ReviewSummary.js +8 -8
- package/lib/commonjs/listing-details/ReviewSummary.js.map +1 -1
- package/lib/commonjs/listing-editor/ListingQualityMeter.js +10 -10
- package/lib/commonjs/listing-editor/ListingQualityMeter.js.map +1 -1
- package/lib/commonjs/map-marker/MapListingPreview.js +9 -9
- package/lib/commonjs/map-marker/MapListingPreview.js.map +1 -1
- package/lib/commonjs/media-card/parts.js +2 -2
- package/lib/commonjs/media-card/parts.js.map +1 -1
- package/lib/commonjs/media-header/AudiobookHeader.js +6 -6
- package/lib/commonjs/media-header/AudiobookHeader.js.map +1 -1
- package/lib/commonjs/media-header/PodcastShowHeader.js +8 -8
- package/lib/commonjs/media-header/PodcastShowHeader.js.map +1 -1
- package/lib/commonjs/media-header/parts.js +11 -11
- package/lib/commonjs/media-header/parts.js.map +1 -1
- package/lib/commonjs/order-status/OrderStatusBar.js +6 -6
- package/lib/commonjs/order-status/OrderStatusBar.js.map +1 -1
- package/lib/commonjs/outline-nav/OutlineNav.js +5 -5
- package/lib/commonjs/outline-nav/OutlineNav.js.map +1 -1
- package/lib/commonjs/place-card/PlaceCard.js +21 -21
- package/lib/commonjs/place-card/PlaceCard.js.map +1 -1
- package/lib/commonjs/place-details/PlaceHours.js +12 -12
- package/lib/commonjs/place-details/PlaceHours.js.map +1 -1
- package/lib/commonjs/place-reviews/PlaceReviewCard.js +9 -9
- package/lib/commonjs/place-reviews/PlaceReviewCard.js.map +1 -1
- package/lib/commonjs/property-insights/NeighbourhoodScores.js +10 -10
- package/lib/commonjs/property-insights/NeighbourhoodScores.js.map +1 -1
- package/lib/commonjs/property-insights/PricePerAreaComparison.js +5 -5
- package/lib/commonjs/property-insights/PricePerAreaComparison.js.map +1 -1
- package/lib/commonjs/rating/Rating.js +7 -4
- package/lib/commonjs/rating/Rating.js.map +1 -1
- package/lib/commonjs/rating/RatingBar.js +23 -12
- package/lib/commonjs/rating/RatingBar.js.map +1 -1
- package/lib/commonjs/rating/RatingBar.web.js +74 -0
- package/lib/commonjs/rating/RatingBar.web.js.map +1 -0
- package/lib/commonjs/rating/index.js +1 -1
- package/lib/commonjs/rating/index.web.js +27 -0
- package/lib/commonjs/rating/index.web.js.map +1 -0
- package/lib/commonjs/stat-bar/Meter.js +9 -2
- package/lib/commonjs/stat-bar/Meter.js.map +1 -1
- package/lib/commonjs/stat-bar/Meter.web.js +79 -0
- package/lib/commonjs/stat-bar/Meter.web.js.map +1 -0
- package/lib/commonjs/stat-bar/StatBar.js +1 -1
- package/lib/commonjs/stat-bar/index.js +1 -1
- package/lib/commonjs/stat-bar/index.web.js +46 -0
- package/lib/commonjs/stat-bar/index.web.js.map +1 -0
- package/lib/commonjs/styles/resolve-native-web-style.js +50 -0
- package/lib/commonjs/styles/resolve-native-web-style.js.map +1 -0
- package/lib/commonjs/tenancy/parts.js +5 -5
- package/lib/commonjs/tenancy/parts.js.map +1 -1
- package/lib/commonjs/track-list/EpisodeRow.js +9 -9
- package/lib/commonjs/track-list/EpisodeRow.js.map +1 -1
- package/lib/commonjs/vendor-card/VendorCard.js +11 -11
- package/lib/commonjs/vendor-card/VendorCard.js.map +1 -1
- package/lib/commonjs/wizard/WizardProgress.js +6 -6
- package/lib/commonjs/wizard/WizardProgress.js.map +1 -1
- package/lib/module/accordion/Accordion.js +58 -76
- package/lib/module/accordion/Accordion.js.map +1 -1
- package/lib/module/accordion/Accordion.web.js +188 -0
- package/lib/module/accordion/Accordion.web.js.map +1 -0
- package/lib/module/accordion/context.js +17 -0
- package/lib/module/accordion/context.js.map +1 -0
- package/lib/module/accordion/index.js +1 -1
- package/lib/module/accordion/index.js.map +1 -1
- package/lib/module/accordion/index.web.js +9 -0
- package/lib/module/accordion/index.web.js.map +1 -0
- package/lib/module/accordion/use-accordion.js +76 -0
- package/lib/module/accordion/use-accordion.js.map +1 -0
- package/lib/module/booking/BookingCard.js +1 -1
- package/lib/module/booking/BookingCard.js.map +1 -1
- package/lib/module/button/Button.js +14 -2
- package/lib/module/button/Button.js.map +1 -1
- package/lib/module/button/Button.web.js +50 -12
- package/lib/module/button/Button.web.js.map +1 -1
- package/lib/module/carrier-quote/CarrierQuoteCard.js +1 -1
- package/lib/module/carrier-quote/CarrierQuoteCard.js.map +1 -1
- package/lib/module/cart-panel/CartPanel.js +1 -1
- package/lib/module/cart-panel/CartPanel.js.map +1 -1
- package/lib/module/creator-studio/TrackUploadRow.js +1 -1
- package/lib/module/creator-studio/TrackUploadRow.js.map +1 -1
- package/lib/module/index.js +3 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +3 -3
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/lead-score/LeadScoreCard.js +1 -1
- package/lib/module/lead-score/LeadScoreCard.js.map +1 -1
- package/lib/module/listing-actions/ApplicationChecklist.js +1 -1
- package/lib/module/listing-actions/ApplicationChecklist.js.map +1 -1
- package/lib/module/listing-card/ListingCard.js +1 -1
- package/lib/module/listing-card/ListingCard.js.map +1 -1
- package/lib/module/listing-details/ListingHeader.js +1 -1
- package/lib/module/listing-details/ListingHeader.js.map +1 -1
- package/lib/module/listing-details/ReviewSummary.js +1 -1
- package/lib/module/listing-details/ReviewSummary.js.map +1 -1
- package/lib/module/listing-editor/ListingQualityMeter.js +1 -1
- package/lib/module/listing-editor/ListingQualityMeter.js.map +1 -1
- package/lib/module/map-marker/MapListingPreview.js +1 -1
- package/lib/module/map-marker/MapListingPreview.js.map +1 -1
- package/lib/module/media-card/parts.js +1 -1
- package/lib/module/media-card/parts.js.map +1 -1
- package/lib/module/media-header/AudiobookHeader.js +1 -1
- package/lib/module/media-header/AudiobookHeader.js.map +1 -1
- package/lib/module/media-header/PodcastShowHeader.js +1 -1
- package/lib/module/media-header/PodcastShowHeader.js.map +1 -1
- package/lib/module/media-header/parts.js +1 -1
- package/lib/module/media-header/parts.js.map +1 -1
- package/lib/module/order-status/OrderStatusBar.js +1 -1
- package/lib/module/order-status/OrderStatusBar.js.map +1 -1
- package/lib/module/outline-nav/OutlineNav.js +1 -1
- package/lib/module/outline-nav/OutlineNav.js.map +1 -1
- package/lib/module/place-card/PlaceCard.js +1 -1
- package/lib/module/place-card/PlaceCard.js.map +1 -1
- package/lib/module/place-details/PlaceHours.js +1 -1
- package/lib/module/place-details/PlaceHours.js.map +1 -1
- package/lib/module/place-reviews/PlaceReviewCard.js +1 -1
- package/lib/module/place-reviews/PlaceReviewCard.js.map +1 -1
- package/lib/module/property-insights/NeighbourhoodScores.js +1 -1
- package/lib/module/property-insights/NeighbourhoodScores.js.map +1 -1
- package/lib/module/property-insights/PricePerAreaComparison.js +1 -1
- package/lib/module/property-insights/PricePerAreaComparison.js.map +1 -1
- package/lib/module/rating/Rating.js +7 -4
- package/lib/module/rating/Rating.js.map +1 -1
- package/lib/module/rating/RatingBar.js +19 -8
- package/lib/module/rating/RatingBar.js.map +1 -1
- package/lib/module/rating/RatingBar.web.js +69 -0
- package/lib/module/rating/RatingBar.web.js.map +1 -0
- package/lib/module/rating/index.js +1 -1
- package/lib/module/rating/index.js.map +1 -1
- package/lib/module/rating/index.web.js +11 -0
- package/lib/module/rating/index.web.js.map +1 -0
- package/lib/module/stat-bar/Meter.js +9 -2
- package/lib/module/stat-bar/Meter.js.map +1 -1
- package/lib/module/stat-bar/Meter.web.js +74 -0
- package/lib/module/stat-bar/Meter.web.js.map +1 -0
- package/lib/module/stat-bar/StatBar.js +1 -1
- package/lib/module/stat-bar/StatBar.js.map +1 -1
- package/lib/module/stat-bar/index.js +1 -1
- package/lib/module/stat-bar/index.js.map +1 -1
- package/lib/module/stat-bar/index.web.js +12 -0
- package/lib/module/stat-bar/index.web.js.map +1 -0
- package/lib/module/styles/resolve-native-web-style.js +47 -0
- package/lib/module/styles/resolve-native-web-style.js.map +1 -0
- package/lib/module/tenancy/parts.js +1 -1
- package/lib/module/tenancy/parts.js.map +1 -1
- package/lib/module/track-list/EpisodeRow.js +1 -1
- package/lib/module/track-list/EpisodeRow.js.map +1 -1
- package/lib/module/vendor-card/VendorCard.js +1 -1
- package/lib/module/vendor-card/VendorCard.js.map +1 -1
- package/lib/module/wizard/WizardProgress.js +1 -1
- package/lib/module/wizard/WizardProgress.js.map +1 -1
- package/lib/typescript/commonjs/accordion/Accordion.d.ts +15 -4
- package/lib/typescript/commonjs/accordion/Accordion.d.ts.map +1 -1
- package/lib/typescript/commonjs/accordion/Accordion.web.d.ts +7 -0
- package/lib/typescript/commonjs/accordion/Accordion.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/accordion/context.d.ts +16 -0
- package/lib/typescript/commonjs/accordion/context.d.ts.map +1 -0
- package/lib/typescript/commonjs/accordion/index.d.ts +1 -1
- package/lib/typescript/commonjs/accordion/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/accordion/index.web.d.ts +3 -0
- package/lib/typescript/commonjs/accordion/index.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/accordion/types.d.ts +15 -0
- package/lib/typescript/commonjs/accordion/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/accordion/use-accordion.d.ts +18 -0
- package/lib/typescript/commonjs/accordion/use-accordion.d.ts.map +1 -0
- package/lib/typescript/commonjs/button/Button.d.ts +1 -1
- package/lib/typescript/commonjs/button/Button.d.ts.map +1 -1
- package/lib/typescript/commonjs/button/Button.web.d.ts +1 -1
- package/lib/typescript/commonjs/button/Button.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/button/index.d.ts +1 -1
- package/lib/typescript/commonjs/button/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/button/index.web.d.ts +1 -1
- package/lib/typescript/commonjs/button/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/button/types.d.ts +14 -1
- package/lib/typescript/commonjs/button/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.web.d.ts +5 -5
- package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/rating/Rating.d.ts +1 -1
- package/lib/typescript/commonjs/rating/Rating.d.ts.map +1 -1
- package/lib/typescript/commonjs/rating/RatingBar.d.ts +11 -3
- package/lib/typescript/commonjs/rating/RatingBar.d.ts.map +1 -1
- package/lib/typescript/commonjs/rating/RatingBar.web.d.ts +4 -0
- package/lib/typescript/commonjs/rating/RatingBar.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/rating/index.web.d.ts +5 -0
- package/lib/typescript/commonjs/rating/index.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/rating/types.d.ts +11 -0
- package/lib/typescript/commonjs/rating/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/stat-bar/Meter.d.ts +7 -25
- package/lib/typescript/commonjs/stat-bar/Meter.d.ts.map +1 -1
- package/lib/typescript/commonjs/stat-bar/Meter.web.d.ts +4 -0
- package/lib/typescript/commonjs/stat-bar/Meter.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/stat-bar/index.web.d.ts +7 -0
- package/lib/typescript/commonjs/stat-bar/index.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/stat-bar/types.d.ts +4 -0
- package/lib/typescript/commonjs/stat-bar/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/styles/resolve-native-web-style.d.ts +5 -0
- package/lib/typescript/commonjs/styles/resolve-native-web-style.d.ts.map +1 -0
- package/lib/typescript/module/accordion/Accordion.d.ts +15 -4
- package/lib/typescript/module/accordion/Accordion.d.ts.map +1 -1
- package/lib/typescript/module/accordion/Accordion.web.d.ts +7 -0
- package/lib/typescript/module/accordion/Accordion.web.d.ts.map +1 -0
- package/lib/typescript/module/accordion/context.d.ts +16 -0
- package/lib/typescript/module/accordion/context.d.ts.map +1 -0
- package/lib/typescript/module/accordion/index.d.ts +1 -1
- package/lib/typescript/module/accordion/index.d.ts.map +1 -1
- package/lib/typescript/module/accordion/index.web.d.ts +3 -0
- package/lib/typescript/module/accordion/index.web.d.ts.map +1 -0
- package/lib/typescript/module/accordion/types.d.ts +15 -0
- package/lib/typescript/module/accordion/types.d.ts.map +1 -1
- package/lib/typescript/module/accordion/use-accordion.d.ts +18 -0
- package/lib/typescript/module/accordion/use-accordion.d.ts.map +1 -0
- package/lib/typescript/module/button/Button.d.ts +1 -1
- package/lib/typescript/module/button/Button.d.ts.map +1 -1
- package/lib/typescript/module/button/Button.web.d.ts +1 -1
- package/lib/typescript/module/button/Button.web.d.ts.map +1 -1
- package/lib/typescript/module/button/index.d.ts +1 -1
- package/lib/typescript/module/button/index.d.ts.map +1 -1
- package/lib/typescript/module/button/index.web.d.ts +1 -1
- package/lib/typescript/module/button/index.web.d.ts.map +1 -1
- package/lib/typescript/module/button/types.d.ts +14 -1
- package/lib/typescript/module/button/types.d.ts.map +1 -1
- package/lib/typescript/module/index.web.d.ts +5 -5
- package/lib/typescript/module/index.web.d.ts.map +1 -1
- package/lib/typescript/module/rating/Rating.d.ts +1 -1
- package/lib/typescript/module/rating/Rating.d.ts.map +1 -1
- package/lib/typescript/module/rating/RatingBar.d.ts +11 -3
- package/lib/typescript/module/rating/RatingBar.d.ts.map +1 -1
- package/lib/typescript/module/rating/RatingBar.web.d.ts +4 -0
- package/lib/typescript/module/rating/RatingBar.web.d.ts.map +1 -0
- package/lib/typescript/module/rating/index.web.d.ts +5 -0
- package/lib/typescript/module/rating/index.web.d.ts.map +1 -0
- package/lib/typescript/module/rating/types.d.ts +11 -0
- package/lib/typescript/module/rating/types.d.ts.map +1 -1
- package/lib/typescript/module/stat-bar/Meter.d.ts +7 -25
- package/lib/typescript/module/stat-bar/Meter.d.ts.map +1 -1
- package/lib/typescript/module/stat-bar/Meter.web.d.ts +4 -0
- package/lib/typescript/module/stat-bar/Meter.web.d.ts.map +1 -0
- package/lib/typescript/module/stat-bar/index.web.d.ts +7 -0
- package/lib/typescript/module/stat-bar/index.web.d.ts.map +1 -0
- package/lib/typescript/module/stat-bar/types.d.ts +4 -0
- package/lib/typescript/module/stat-bar/types.d.ts.map +1 -1
- package/lib/typescript/module/styles/resolve-native-web-style.d.ts +5 -0
- package/lib/typescript/module/styles/resolve-native-web-style.d.ts.map +1 -0
- package/package.json +16 -1
- package/src/accordion/Accordion.tsx +34 -94
- package/src/accordion/Accordion.web.tsx +91 -0
- package/src/accordion/context.ts +15 -0
- package/src/accordion/index.ts +1 -0
- package/src/accordion/index.web.ts +14 -0
- package/src/accordion/types.ts +15 -0
- package/src/accordion/use-accordion.ts +47 -0
- package/src/button/Button.tsx +12 -2
- package/src/button/Button.web.tsx +48 -12
- package/src/button/index.ts +2 -0
- package/src/button/index.web.ts +2 -0
- package/src/button/types.ts +15 -1
- package/src/index.web.ts +5 -5
- package/src/rating/Rating.tsx +7 -4
- package/src/rating/RatingBar.tsx +10 -5
- package/src/rating/RatingBar.web.tsx +29 -0
- package/src/rating/index.web.ts +17 -0
- package/src/rating/types.ts +11 -0
- package/src/stat-bar/Meter.tsx +6 -4
- package/src/stat-bar/Meter.web.tsx +32 -0
- package/src/stat-bar/index.web.ts +20 -0
- package/src/stat-bar/types.ts +4 -0
- package/src/styles/resolve-native-web-style.ts +41 -0
package/docs/accordion.mdx
CHANGED
|
@@ -35,7 +35,10 @@ const [open, setOpen] = useState<string | string[] | undefined>('shipping');
|
|
|
35
35
|
| `value` | which section(s) are open: a string for `single`, an array for `multiple` |
|
|
36
36
|
| `onValueChange` | receives the next value, or `undefined` when everything closes |
|
|
37
37
|
| `disabled` | per `AccordionItem`, a section that cannot be opened |
|
|
38
|
-
| `icon` | per `AccordionTrigger`,
|
|
38
|
+
| `icon` | per `AccordionTrigger`, appears before the label |
|
|
39
|
+
| `className` | on Root, Item, Trigger and Content: styles that component’s actual host |
|
|
40
|
+
| `contentClassName` | on Content: styles its measured inner body, including padding |
|
|
41
|
+
| `transition` | default `"spring"`, or `{ duration, easing? }` for a timed reveal and chevron |
|
|
39
42
|
|
|
40
43
|
**It is fully controlled — `value` and `onValueChange` are required.** There is
|
|
41
44
|
no uncontrolled mode and no `collapsible` flag: closing the last open section
|
|
@@ -67,3 +70,37 @@ rather than by a layout animation. On web that distinction is load-bearing:
|
|
|
67
70
|
an animation started from a Reanimated mapper never ticks, so the obvious
|
|
68
71
|
"animate the content in" silently does nothing. If you nest something that
|
|
69
72
|
animates its own height, let one of the two own the measurement.
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
### Authored surfaces and motion
|
|
76
|
+
|
|
77
|
+
Defaults remain in the base CSS layer on web; component and utility classes
|
|
78
|
+
can override geometry, typography and paint. On native the same class props
|
|
79
|
+
resolve after default styles. `contentClassName` belongs to the measured inner
|
|
80
|
+
body, so changing its padding also changes the reveal's measured height.
|
|
81
|
+
`style` remains available; a string trigger label inherits trigger typography,
|
|
82
|
+
and `textStyle` overrides the label explicitly.
|
|
83
|
+
|
|
84
|
+
```tsx
|
|
85
|
+
<Accordion value={open} onValueChange={setOpen}
|
|
86
|
+
transition={{ duration: 250, easing: [0.23, 1, 0.32, 1] }}>
|
|
87
|
+
<AccordionItem value="details" className="border-border">
|
|
88
|
+
<AccordionTrigger className="px-0 py-4">Details</AccordionTrigger>
|
|
89
|
+
<AccordionContent contentClassName="px-0 pb-4">
|
|
90
|
+
<Text>Details stay mounted while the section is closed.</Text>
|
|
91
|
+
</AccordionContent>
|
|
92
|
+
</AccordionItem>
|
|
93
|
+
</Accordion>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
`duration` is milliseconds; zero settles immediately. `easing` is a cubic Bézier
|
|
97
|
+
with x control points in `0..1`, defaulting to CSS ease. Omitting `transition`
|
|
98
|
+
keeps the existing spring recipes. The operating system's reduced-motion
|
|
99
|
+
preference takes priority, including changes while an animation is running.
|
|
100
|
+
|
|
101
|
+
Each trigger controls a uniquely identified, labelled region on web. A closed
|
|
102
|
+
region is inert and hidden from accessibility, while remaining mounted and
|
|
103
|
+
measurable. If a controlled collapse hides the focused field, focus returns to
|
|
104
|
+
its trigger. Native uses the corresponding hidden-descendant accessibility
|
|
105
|
+
properties. Input values therefore survive a close/open cycle without leaving
|
|
106
|
+
closed fields in keyboard navigation.
|
package/docs/adoption-matrix.mdx
CHANGED
|
@@ -32,7 +32,7 @@ The classification is an EQUALITY in `src/__tests__/adoption-matrix.test.ts`, no
|
|
|
32
32
|
|
|
33
33
|
## Totals
|
|
34
34
|
|
|
35
|
-
- **212 families** in `src/`, **210** published (a subpath, the root barrel, or both). **
|
|
35
|
+
- **212 families** in `src/`, **210** published (a subpath, the root barrel, or both). **47** carry a web fork.
|
|
36
36
|
- Docs, stories and suites are gated as a standard by `src/__tests__/family-coverage.test.ts`; the per-family counts are in the table below.
|
|
37
37
|
|
|
38
38
|
| contract | applies to | reads | delegated | n/a¹ | adaptation |
|
|
@@ -108,7 +108,7 @@ The classification is an EQUALITY in `src/__tests__/adoption-matrix.test.ts`, no
|
|
|
108
108
|
|
|
109
109
|
| family | import | platform | doc | story | suites | Field membership | Control presentation | Trigger composition | Controlled / uncontrolled state |
|
|
110
110
|
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
|
111
|
-
| `accordion` | `@oxy.so/bloom/accordion` + barrel |
|
|
111
|
+
| `accordion` | `@oxy.so/bloom/accordion` + barrel | web fork | `accordion.mdx` | yes | 4 | | | | |
|
|
112
112
|
| `activity-feed` | `@oxy.so/bloom/activity-feed` + barrel | universal | `activity-feed.mdx` | yes | 1 | | | | |
|
|
113
113
|
| `activity-heatmap` | `@oxy.so/bloom/activity-heatmap` + barrel | universal | `activity-heatmap.mdx` | yes | 1 | | | | |
|
|
114
114
|
| `address` | `@oxy.so/bloom/address` + barrel | universal | `address.mdx` | yes | 2 | n/a¹ | | | |
|
|
@@ -189,7 +189,7 @@ The classification is an EQUALITY in `src/__tests__/adoption-matrix.test.ts`, no
|
|
|
189
189
|
| `glass` | internal | universal | `glass.mdx` | — | 2 | | | | |
|
|
190
190
|
| `grid` | `@oxy.so/bloom/grid` + barrel | universal | `grid.mdx` | yes | 1 | | | | |
|
|
191
191
|
| `home-search` | `@oxy.so/bloom/home-search` + barrel | universal | `home-search.mdx` | yes | 2 | n/a¹ | | | |
|
|
192
|
-
| `hooks` | `@oxy.so/bloom/hooks` + barrel | universal | `hooks.mdx` | yes |
|
|
192
|
+
| `hooks` | `@oxy.so/bloom/hooks` + barrel | universal | `hooks.mdx` | yes | 14 | | | | reads |
|
|
193
193
|
| `hover-card` | `@oxy.so/bloom/hover-card` + barrel | web fork | `hover-card.mdx` | yes | 4 | | | reads | reads |
|
|
194
194
|
| `icon-circle` | `@oxy.so/bloom/icon-circle` + barrel | universal | `icon-circle.mdx` | yes | 1 | | | | |
|
|
195
195
|
| `icons` | `@oxy.so/bloom/icons` + barrel | universal | `icons.mdx` | yes | 61 | | | | |
|
|
@@ -270,7 +270,7 @@ The classification is an EQUALITY in `src/__tests__/adoption-matrix.test.ts`, no
|
|
|
270
270
|
| `radio` | `@oxy.so/bloom/radio` + barrel | universal | `radio.mdx` | yes | 4 | reads | reads | | reads |
|
|
271
271
|
| `radio-indicator` | `@oxy.so/bloom/radio-indicator` + barrel | universal | `radio-indicator.mdx` | yes | 1 | | | | |
|
|
272
272
|
| `rail` | `@oxy.so/bloom/rail` + barrel | universal | `rail.mdx` | yes | 1 | | | | |
|
|
273
|
-
| `rating` | `@oxy.so/bloom/rating` + barrel |
|
|
273
|
+
| `rating` | `@oxy.so/bloom/rating` + barrel | web fork | `rating.mdx` | yes | 5 | reads | reads | | |
|
|
274
274
|
| `recent-hires-card` | `@oxy.so/bloom/recent-hires-card` + barrel | universal | `recent-hires-card.mdx` | yes | 1 | | | | |
|
|
275
275
|
| `route-stops` | `@oxy.so/bloom/route-stops` + barrel | universal | `route-stops.mdx` | yes | 2 | | | | |
|
|
276
276
|
| `screen` | `@oxy.so/bloom/screen` + barrel | universal | `screen.mdx` | yes | 5 | | | | |
|
|
@@ -287,13 +287,13 @@ The classification is an EQUALITY in `src/__tests__/adoption-matrix.test.ts`, no
|
|
|
287
287
|
| `slider` | `@oxy.so/bloom/slider` + barrel | universal | `slider.mdx` | yes | 5 | reads | reads | | |
|
|
288
288
|
| `social-button` | `@oxy.so/bloom/social-button` + barrel | web fork | `social-button.mdx` | yes | 2 | | reads | | |
|
|
289
289
|
| `sortable-media` | `@oxy.so/bloom/sortable-media` + barrel | universal | `sortable-media.mdx` | yes | 2 | | | | |
|
|
290
|
-
| `stat-bar` | `@oxy.so/bloom/stat-bar` + barrel |
|
|
290
|
+
| `stat-bar` | `@oxy.so/bloom/stat-bar` + barrel | web fork | `stat-bar.mdx` | yes | 6 | | | | |
|
|
291
291
|
| `stat-cards` | `@oxy.so/bloom/stat-cards` + barrel | universal | `stat-cards.mdx` | yes | 4 | | | | |
|
|
292
292
|
| `stay-filters` | `@oxy.so/bloom/stay-filters` + barrel | universal | `stay-filters.mdx` | yes | 5 | n/a¹ | reads | | |
|
|
293
293
|
| `stay-search` | `@oxy.so/bloom/stay-search` + barrel | universal | `stay-search.mdx` | yes | 5 | | | | |
|
|
294
294
|
| `stepper` | `@oxy.so/bloom/stepper` + barrel | universal | `stepper.mdx` | yes | 5 | reads | reads | | |
|
|
295
295
|
| `sticker` | `@oxy.so/bloom/sticker` + barrel | web fork | `sticker.mdx` | yes | 1 | | | | |
|
|
296
|
-
| `styles` | `@oxy.so/bloom/styles` + barrel | universal | `styles.mdx` | yes |
|
|
296
|
+
| `styles` | `@oxy.so/bloom/styles` + barrel | universal | `styles.mdx` | yes | 89 | n/a¹ | reads | | |
|
|
297
297
|
| `subtle-hover` | `@oxy.so/bloom/subtle-hover` + barrel | universal | `subtle-hover.mdx` | yes | 1 | | | | |
|
|
298
298
|
| `surface` | `@oxy.so/bloom/surface` + barrel | web fork | `surface.mdx` | yes | 41 | | | | |
|
|
299
299
|
| `surfaces` | `@oxy.so/bloom/surfaces` + barrel | web fork | `alert.mdx` | yes | 3 | | | | |
|
|
@@ -308,7 +308,7 @@ The classification is an EQUALITY in `src/__tests__/adoption-matrix.test.ts`, no
|
|
|
308
308
|
| `tenancy` | `@oxy.so/bloom/tenancy` + barrel | universal | `tenancy.mdx` | yes | 5 | | reads | | |
|
|
309
309
|
| `text-field` | `@oxy.so/bloom/text-field` + barrel | universal | `text-field.mdx` | yes | 17 | reads | reads | | |
|
|
310
310
|
| `textarea` | `@oxy.so/bloom/textarea` + barrel | universal | `textarea.mdx` | yes | 4 | reads | reads | | n/a¹ |
|
|
311
|
-
| `theme` | `@oxy.so/bloom/theme` + barrel | web fork | `theme.mdx` | yes |
|
|
311
|
+
| `theme` | `@oxy.so/bloom/theme` + barrel | web fork | `theme.mdx` | yes | 366 | | | n/a¹ | reads |
|
|
312
312
|
| `theme-toggle` | `@oxy.so/bloom/theme-toggle` + barrel | universal | `theme-toggle.mdx` | yes | 2 | n/a¹ | | | |
|
|
313
313
|
| `toast` | `@oxy.so/bloom/toast` + barrel | universal | `toast.mdx` | yes | 17 | | | | |
|
|
314
314
|
| `tooltip` | `@oxy.so/bloom/tooltip` + barrel | web fork | `tooltip.mdx` | yes | 1 | | | | |
|
package/docs/button.mdx
CHANGED
|
@@ -77,6 +77,34 @@ Accent/status/brand colours keep their semantic foreground pairs. Neutral, seman
|
|
|
77
77
|
|
|
78
78
|
Button forwards its ref to the interactive node (the native View handle or the actual web button/anchor), so menus can anchor to it without a layout wrapper. Optional `onLayout` reports React Native's layout shape on both platforms; web installs a resize observer only when that callback is supplied. Press-in/out, cancellation and long press share the base gesture lifecycle. String labels keep the typography defaults; custom content can supply icons, animated glyphs or a composed row. Accessibility visibility props support controls that fade out without leaving an invisible focus target.
|
|
79
79
|
|
|
80
|
+
`onFocus` / `onBlur` receive the original platform focus event; `onHoverIn` /
|
|
81
|
+
`onHoverOut` expose Pressable hover on native and non-touch pointer entry/exit on
|
|
82
|
+
web. Hover entry is suppressed while disabled or loading; exit still clears a
|
|
83
|
+
consumer's preview. `onKeyDown` / `onKeyUp` receive DOM keyboard events on web
|
|
84
|
+
and are ignored on native. Focusing a choice can select its preview without
|
|
85
|
+
activating it; activation remains `onPress`.
|
|
86
|
+
|
|
87
|
+
```tsx
|
|
88
|
+
<Button ref={choiceRef} onFocus={() => select(index)}
|
|
89
|
+
onHoverIn={() => preview(index)} onHoverOut={() => preview(null)}
|
|
90
|
+
onKeyDown={event => {
|
|
91
|
+
if (event.key === 'ArrowDown') {
|
|
92
|
+
event.preventDefault();
|
|
93
|
+
nextChoiceRef.current?.focus();
|
|
94
|
+
}
|
|
95
|
+
}}>
|
|
96
|
+
Choice
|
|
97
|
+
</Button>
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
The same handlers work on `href` and `asChild` buttons. Slotted child handlers
|
|
101
|
+
run first, followed by the Button caller and internal lifecycle. Preventing a
|
|
102
|
+
keyboard default also prevents a new press preview; key-up and blur still end
|
|
103
|
+
an active preview. Existing child handlers, refs and long-press cancellation
|
|
104
|
+
remain composed. `ButtonFocusEvent` and `ButtonHoverEvent` expose the shared
|
|
105
|
+
platform-event unions for reusable callback types.
|
|
106
|
+
|
|
107
|
+
|
|
80
108
|
Native text children are wrapped individually when mixed with custom layout nodes or fragments, including icon-only buttons. Custom layout nodes retain their own layout.
|
|
81
109
|
|
|
82
110
|
### Loading and child state
|
package/docs/rating.mdx
CHANGED
|
@@ -32,6 +32,8 @@ const [stars, setStars] = useState<number | null>(null);
|
|
|
32
32
|
| `reviewsLabel` | the word after the count, English `"reviews"`, pluralised and localised via `BloomProvider locale` |
|
|
33
33
|
| `newLabel` | drawn instead of the value when there is no rating yet, English `"New"`, localised via `BloomProvider locale` |
|
|
34
34
|
| `size` | `'small'` (14px star, body-2 text) or `'medium'` (default, 16px star, body text) |
|
|
35
|
+
| `showValue` | default `true`; `false` hides the numeric label while retaining its accessible name; the unrated fallback remains visible |
|
|
36
|
+
| `starSize` | positive glyph size independent of text size; defaults to the selected size scale |
|
|
35
37
|
| `variant` | `'compact'` (default, one star) or `'stars'` (five stars, filled fractionally, before the value) |
|
|
36
38
|
| `color` | paints the star(s), the value and the count — e.g. white over a brand-coloured hero |
|
|
37
39
|
| `starColor` | the filled star(s) only (a gold star beside neutral text); default `color` |
|
|
@@ -98,6 +100,22 @@ different categories by colour, they all say "how good is this, out of 5". It is
|
|
|
98
100
|
a `progressbar` carrying `aria-valuemin`, `aria-valuemax`, `aria-valuenow` and
|
|
99
101
|
`aria-valuetext` (from `display`).
|
|
100
102
|
|
|
103
|
+
### Authored summary and bar slots
|
|
104
|
+
|
|
105
|
+
```tsx
|
|
106
|
+
<Rating value={4.5} variant="stars" showValue={false} starSize={20} />
|
|
107
|
+
<RatingBar label="5" value={0.75} max={1} display="75%" labelWidth={16}
|
|
108
|
+
className="gap-2" labelClassName="text-xs font-semibold"
|
|
109
|
+
displayClassName="text-xs" trackClassName="h-2 rounded-full"
|
|
110
|
+
fillClassName="bg-foreground" />
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
`className` styles the row; `labelClassName` and `displayClassName` style the two
|
|
114
|
+
labels. `trackClassName` and `fillClassName` are owned and resolved by `Meter`.
|
|
115
|
+
Their defaults remain unchanged when classes are absent. Classes may customize
|
|
116
|
+
paint and geometry, but the filled fraction stays derived from `value / max`.
|
|
117
|
+
The bar remains one named progressbar; its visual labels are not announced twice.
|
|
118
|
+
|
|
101
119
|
## `RatingInput`
|
|
102
120
|
|
|
103
121
|
The picker for a review form. Fully controlled: `value` is `1..max` or `null`
|
package/docs/stat-bar.mdx
CHANGED
|
@@ -34,6 +34,7 @@ with a label is `StatBar`; a bar inside a card is that card's business.
|
|
|
34
34
|
| `accessibilityLabel` | what the bar measures — REQUIRED |
|
|
35
35
|
| `valueText` | `aria-valuetext`, the reading ("4 of 5" rather than "80%") |
|
|
36
36
|
| `decorative` | no role at all, for one segment of a larger progressbar |
|
|
37
|
+
| `className` / `fillClassName` | actual track and fill hosts; classes override default geometry and paint, while fill width remains data-owned |
|
|
37
38
|
| `fillTestID` | the fill's own `testID`; defaults to `` `${testID}-fill` `` |
|
|
38
39
|
|
|
39
40
|
`MeterRing` takes `size` (56) and `thickness` (5) instead of `height`/`width`,
|
|
@@ -11,56 +11,30 @@ var _useTheme = require("../theme/use-theme.js");
|
|
|
11
11
|
var _useInteractionState = require("../hooks/use-interaction-state.js");
|
|
12
12
|
var _tokens = require("../styles/tokens.js");
|
|
13
13
|
var _nativeDriver = require("../styles/native-driver.js");
|
|
14
|
+
var _reactNativeCss = require("react-native-css");
|
|
15
|
+
var _context = require("./context.js");
|
|
16
|
+
var _useAccordion = require("./use-accordion.js");
|
|
14
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
18
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
16
|
-
// ---- Context ----
|
|
17
|
-
|
|
18
|
-
const AccordionContext = /*#__PURE__*/(0, _react.createContext)({
|
|
19
|
-
expandedValues: new Set(),
|
|
20
|
-
toggle: () => {},
|
|
21
|
-
type: 'single'
|
|
22
|
-
});
|
|
23
|
-
const AccordionItemContext = /*#__PURE__*/(0, _react.createContext)({
|
|
24
|
-
value: '',
|
|
25
|
-
isExpanded: false,
|
|
26
|
-
disabled: false
|
|
27
|
-
});
|
|
28
|
-
|
|
29
19
|
// ---- Accordion Root ----
|
|
30
20
|
|
|
31
21
|
const AccordionComponent = ({
|
|
32
22
|
value,
|
|
33
23
|
onValueChange,
|
|
34
24
|
type = 'single',
|
|
25
|
+
transition,
|
|
35
26
|
children,
|
|
36
27
|
style,
|
|
37
28
|
testID
|
|
38
29
|
}) => {
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
onValueChange(next);
|
|
48
|
-
} else {
|
|
49
|
-
const next = new Set(expandedValues);
|
|
50
|
-
if (next.has(itemValue)) {
|
|
51
|
-
next.delete(itemValue);
|
|
52
|
-
} else {
|
|
53
|
-
next.add(itemValue);
|
|
54
|
-
}
|
|
55
|
-
onValueChange(Array.from(next));
|
|
56
|
-
}
|
|
57
|
-
}, [type, expandedValues, onValueChange]);
|
|
58
|
-
const contextValue = (0, _react.useMemo)(() => ({
|
|
59
|
-
expandedValues,
|
|
60
|
-
toggle,
|
|
61
|
-
type
|
|
62
|
-
}), [expandedValues, toggle, type]);
|
|
63
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(AccordionContext.Provider, {
|
|
30
|
+
const contextValue = (0, _useAccordion.useAccordionState)({
|
|
31
|
+
value,
|
|
32
|
+
onValueChange,
|
|
33
|
+
type,
|
|
34
|
+
transition,
|
|
35
|
+
children
|
|
36
|
+
});
|
|
37
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_context.AccordionContext.Provider, {
|
|
64
38
|
value: contextValue,
|
|
65
39
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
66
40
|
style: style,
|
|
@@ -78,17 +52,9 @@ const AccordionItemComponent = ({
|
|
|
78
52
|
disabled = false,
|
|
79
53
|
style
|
|
80
54
|
}) => {
|
|
81
|
-
const
|
|
82
|
-
expandedValues
|
|
83
|
-
} = (0, _react.useContext)(AccordionContext);
|
|
84
|
-
const isExpanded = expandedValues.has(value);
|
|
55
|
+
const itemContext = (0, _useAccordion.useAccordionItem)(value, disabled);
|
|
85
56
|
const theme = (0, _useTheme.useTheme)();
|
|
86
|
-
|
|
87
|
-
value,
|
|
88
|
-
isExpanded,
|
|
89
|
-
disabled
|
|
90
|
-
}), [value, isExpanded, disabled]);
|
|
91
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(AccordionItemContext.Provider, {
|
|
57
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_context.AccordionItemContext.Provider, {
|
|
92
58
|
value: itemContext,
|
|
93
59
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
94
60
|
style: [{
|
|
@@ -116,13 +82,22 @@ const AccordionTriggerComponent = ({
|
|
|
116
82
|
const theme = (0, _useTheme.useTheme)();
|
|
117
83
|
const {
|
|
118
84
|
toggle
|
|
119
|
-
} = (0, _react.useContext)(AccordionContext);
|
|
85
|
+
} = (0, _react.useContext)(_context.AccordionContext);
|
|
120
86
|
const {
|
|
121
87
|
value,
|
|
122
88
|
isExpanded,
|
|
123
|
-
disabled
|
|
124
|
-
|
|
125
|
-
|
|
89
|
+
disabled,
|
|
90
|
+
triggerId,
|
|
91
|
+
contentId
|
|
92
|
+
} = (0, _react.useContext)(_context.AccordionItemContext);
|
|
93
|
+
const rotateAnim = (0, _useAccordion.useAccordionMotion)(isExpanded, 'trigger', _nativeDriver.SUPPORTS_NATIVE_DRIVER);
|
|
94
|
+
const resolved = _reactNative.StyleSheet.flatten(style);
|
|
95
|
+
const callerText = {};
|
|
96
|
+
for (const key of ['color', 'fontSize', 'fontWeight', 'fontFamily', 'lineHeight', 'letterSpacing']) {
|
|
97
|
+
if (resolved?.[key] !== undefined) Object.assign(callerText, {
|
|
98
|
+
[key]: resolved[key]
|
|
99
|
+
});
|
|
100
|
+
}
|
|
126
101
|
// Drive press-opacity via state, not Pressable's function-form `style`,
|
|
127
102
|
// which NativeWind v4's css-interop swallows (dropping the trigger's base
|
|
128
103
|
// layout: flexDirection, padding, gap).
|
|
@@ -131,13 +106,6 @@ const AccordionTriggerComponent = ({
|
|
|
131
106
|
onIn: onPressIn,
|
|
132
107
|
onOut: onPressOut
|
|
133
108
|
} = (0, _useInteractionState.useInteractionState)();
|
|
134
|
-
(0, _react.useEffect)(() => {
|
|
135
|
-
_reactNative.Animated.spring(rotateAnim, {
|
|
136
|
-
toValue: isExpanded ? 1 : 0,
|
|
137
|
-
useNativeDriver: _nativeDriver.SUPPORTS_NATIVE_DRIVER,
|
|
138
|
-
..._tokens.animation.spring.snappy
|
|
139
|
-
}).start();
|
|
140
|
-
}, [isExpanded, rotateAnim]);
|
|
141
109
|
const handlePress = (0, _react.useCallback)(() => {
|
|
142
110
|
if (!disabled) {
|
|
143
111
|
toggle(value);
|
|
@@ -148,6 +116,8 @@ const AccordionTriggerComponent = ({
|
|
|
148
116
|
outputRange: ['0deg', '180deg']
|
|
149
117
|
});
|
|
150
118
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
|
|
119
|
+
nativeID: triggerId,
|
|
120
|
+
'aria-controls': contentId,
|
|
151
121
|
style: [{
|
|
152
122
|
flexDirection: 'row',
|
|
153
123
|
alignItems: 'center',
|
|
@@ -175,7 +145,7 @@ const AccordionTriggerComponent = ({
|
|
|
175
145
|
fontSize: 15,
|
|
176
146
|
fontWeight: '600',
|
|
177
147
|
color: theme.colors.text
|
|
178
|
-
}, textStyle],
|
|
148
|
+
}, callerText, textStyle],
|
|
179
149
|
children: children
|
|
180
150
|
}) : children
|
|
181
151
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
|
|
@@ -196,12 +166,15 @@ const AccordionTriggerComponent = ({
|
|
|
196
166
|
|
|
197
167
|
const AccordionContentComponent = ({
|
|
198
168
|
children,
|
|
199
|
-
style
|
|
169
|
+
style,
|
|
170
|
+
contentStyle
|
|
200
171
|
}) => {
|
|
201
172
|
const {
|
|
202
|
-
isExpanded
|
|
203
|
-
|
|
204
|
-
|
|
173
|
+
isExpanded,
|
|
174
|
+
contentId,
|
|
175
|
+
triggerId
|
|
176
|
+
} = (0, _react.useContext)(_context.AccordionItemContext);
|
|
177
|
+
const heightAnim = (0, _useAccordion.useAccordionMotion)(isExpanded, 'content', false);
|
|
205
178
|
// The content's own height, measured. The reveal used to interpolate to a
|
|
206
179
|
// hardcoded 500 ("reasonable max"), which is not a max at all: `overflow:
|
|
207
180
|
// hidden` above it meant anything taller was CLIPPED, silently, with no error
|
|
@@ -214,13 +187,6 @@ const AccordionContentComponent = ({
|
|
|
214
187
|
// Sub-pixel churn would re-render on every frame of the spring.
|
|
215
188
|
setContentHeight(prev => Math.abs(prev - next) > 0.5 ? next : prev);
|
|
216
189
|
}, []);
|
|
217
|
-
(0, _react.useEffect)(() => {
|
|
218
|
-
_reactNative.Animated.spring(heightAnim, {
|
|
219
|
-
toValue: isExpanded ? 1 : 0,
|
|
220
|
-
useNativeDriver: false,
|
|
221
|
-
..._tokens.animation.spring.gentle
|
|
222
|
-
}).start();
|
|
223
|
-
}, [isExpanded, heightAnim]);
|
|
224
190
|
const opacity = heightAnim.interpolate({
|
|
225
191
|
inputRange: [0, 1],
|
|
226
192
|
outputRange: [0, 1]
|
|
@@ -230,6 +196,12 @@ const AccordionContentComponent = ({
|
|
|
230
196
|
outputRange: [0, contentHeight]
|
|
231
197
|
});
|
|
232
198
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
|
|
199
|
+
nativeID: contentId,
|
|
200
|
+
'aria-labelledby': triggerId,
|
|
201
|
+
"aria-hidden": !isExpanded,
|
|
202
|
+
pointerEvents: isExpanded ? 'auto' : 'none',
|
|
203
|
+
accessibilityElementsHidden: !isExpanded,
|
|
204
|
+
importantForAccessibility: isExpanded ? 'auto' : 'no-hide-descendants',
|
|
233
205
|
style: [{
|
|
234
206
|
overflow: 'hidden',
|
|
235
207
|
opacity,
|
|
@@ -241,20 +213,30 @@ const AccordionContentComponent = ({
|
|
|
241
213
|
}, style],
|
|
242
214
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
243
215
|
onLayout: handleContentLayout,
|
|
244
|
-
style: {
|
|
216
|
+
style: [{
|
|
245
217
|
paddingBottom: _tokens.space.md,
|
|
246
|
-
|
|
247
|
-
|
|
218
|
+
paddingLeft: _tokens.space.xs,
|
|
219
|
+
paddingRight: _tokens.space.xs
|
|
220
|
+
}, contentStyle],
|
|
248
221
|
children: children
|
|
249
222
|
})
|
|
250
223
|
});
|
|
251
224
|
};
|
|
252
|
-
const Accordion = exports.Accordion = /*#__PURE__*/(0, _react.memo)(AccordionComponent
|
|
225
|
+
const Accordion = exports.Accordion = /*#__PURE__*/(0, _react.memo)((0, _reactNativeCss.styled)(AccordionComponent, {
|
|
226
|
+
className: 'style'
|
|
227
|
+
}));
|
|
253
228
|
Accordion.displayName = 'Accordion';
|
|
254
|
-
const AccordionItem = exports.AccordionItem = /*#__PURE__*/(0, _react.memo)(AccordionItemComponent
|
|
229
|
+
const AccordionItem = exports.AccordionItem = /*#__PURE__*/(0, _react.memo)((0, _reactNativeCss.styled)(AccordionItemComponent, {
|
|
230
|
+
className: 'style'
|
|
231
|
+
}));
|
|
255
232
|
AccordionItem.displayName = 'AccordionItem';
|
|
256
|
-
const AccordionTrigger = exports.AccordionTrigger = /*#__PURE__*/(0, _react.memo)(AccordionTriggerComponent
|
|
233
|
+
const AccordionTrigger = exports.AccordionTrigger = /*#__PURE__*/(0, _react.memo)((0, _reactNativeCss.styled)(AccordionTriggerComponent, {
|
|
234
|
+
className: 'style'
|
|
235
|
+
}));
|
|
257
236
|
AccordionTrigger.displayName = 'AccordionTrigger';
|
|
258
|
-
const AccordionContent = exports.AccordionContent = /*#__PURE__*/(0, _react.memo)(AccordionContentComponent
|
|
237
|
+
const AccordionContent = exports.AccordionContent = /*#__PURE__*/(0, _react.memo)((0, _reactNativeCss.styled)(AccordionContentComponent, {
|
|
238
|
+
className: 'style',
|
|
239
|
+
contentClassName: 'contentStyle'
|
|
240
|
+
}));
|
|
259
241
|
AccordionContent.displayName = 'AccordionContent';
|
|
260
242
|
//# sourceMappingURL=Accordion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_RiArrowDownSLine","_useTheme","_useInteractionState","_tokens","_nativeDriver","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_RiArrowDownSLine","_useTheme","_useInteractionState","_tokens","_nativeDriver","_reactNativeCss","_context","_useAccordion","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","AccordionComponent","value","onValueChange","type","transition","children","style","testID","contextValue","useAccordionState","jsx","AccordionContext","Provider","View","AccordionItemComponent","disabled","itemContext","useAccordionItem","theme","useTheme","AccordionItemContext","borderBottomWidth","borderBottomColor","colors","borderLight","TRIGGER_LABEL_STYLE","flexGrow","flexShrink","AccordionTriggerComponent","icon","textStyle","toggle","useContext","isExpanded","triggerId","contentId","rotateAnim","useAccordionMotion","SUPPORTS_NATIVE_DRIVER","resolved","StyleSheet","flatten","callerText","key","undefined","assign","state","pressed","onIn","onPressIn","onOut","onPressOut","useInteractionState","handlePress","useCallback","rotation","interpolate","inputRange","outputRange","jsxs","Pressable","nativeID","flexDirection","alignItems","paddingVertical","space","md","paddingHorizontal","xs","gap","sm","opacity","DISABLED_OPACITY","onPress","accessibilityRole","Text","fontSize","fontWeight","color","text","Animated","transform","rotate","RiArrowDownSLine","size","fill","textSecondary","AccordionContentComponent","contentStyle","heightAnim","contentHeight","setContentHeight","useState","handleContentLayout","event","next","nativeEvent","layout","height","prev","Math","abs","maxHeight","pointerEvents","accessibilityElementsHidden","importantForAccessibility","overflow","onLayout","paddingBottom","paddingLeft","paddingRight","Accordion","exports","memo","styled","className","displayName","AccordionItem","AccordionTrigger","AccordionContent","contentClassName"],"sourceRoot":"../../../src","sources":["accordion/Accordion.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,O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