@oxy.so/bloom 3.0.1 → 3.2.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/README.md +2 -0
- package/docs/adoption-matrix.mdx +266 -0
- package/docs/checkbox.mdx +16 -0
- package/docs/composition.mdx +88 -16
- package/docs/date-picker.mdx +11 -0
- package/docs/field.mdx +35 -4
- package/docs/file-upload.mdx +13 -0
- package/docs/icons.mdx +58 -3
- package/docs/input-group.mdx +22 -0
- package/docs/input-otp.mdx +14 -0
- package/docs/layout.mdx +34 -0
- package/docs/migrating-to-3.0.mdx +43 -4
- package/docs/phone-input.mdx +17 -0
- package/docs/radio.mdx +16 -0
- package/docs/rating.mdx +14 -0
- package/docs/segmented-control.mdx +16 -4
- package/docs/select.mdx +22 -0
- package/docs/slider.mdx +14 -0
- package/docs/stepper.mdx +3 -1
- package/docs/switch.mdx +14 -0
- package/docs/text-field.mdx +14 -0
- package/docs/textarea.mdx +20 -0
- package/lib/commonjs/bottom-sheet/BottomSheetBase.js +11 -4
- package/lib/commonjs/bottom-sheet/BottomSheetBase.js.map +1 -1
- package/lib/commonjs/checkbox/Checkbox.js +24 -8
- package/lib/commonjs/checkbox/Checkbox.js.map +1 -1
- package/lib/commonjs/date-picker/TimeField.js +18 -6
- package/lib/commonjs/date-picker/TimeField.js.map +1 -1
- package/lib/commonjs/dialog/DialogContent.js +36 -29
- package/lib/commonjs/dialog/DialogContent.js.map +1 -1
- package/lib/commonjs/field/index.js +7 -0
- package/lib/commonjs/field/index.js.map +1 -1
- package/lib/commonjs/field/membership.js +105 -0
- package/lib/commonjs/field/membership.js.map +1 -0
- package/lib/commonjs/file-upload/FileUpload.js +17 -3
- package/lib/commonjs/file-upload/FileUpload.js.map +1 -1
- package/lib/commonjs/index.js +21 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js +21 -0
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/commonjs/input-group/InputGroup.js +18 -5
- package/lib/commonjs/input-group/InputGroup.js.map +1 -1
- package/lib/commonjs/input-otp/InputOtp.js +20 -8
- package/lib/commonjs/input-otp/InputOtp.js.map +1 -1
- package/lib/commonjs/layout/index.js +7 -0
- package/lib/commonjs/layout/index.js.map +1 -1
- package/lib/commonjs/layout/screen-scope.js +61 -0
- package/lib/commonjs/layout/screen-scope.js.map +1 -0
- package/lib/commonjs/phone-input/PhoneInput.js +20 -8
- package/lib/commonjs/phone-input/PhoneInput.js.map +1 -1
- package/lib/commonjs/radio/Radio.js +35 -9
- package/lib/commonjs/radio/Radio.js.map +1 -1
- package/lib/commonjs/rating/RatingInput.js +14 -6
- package/lib/commonjs/rating/RatingInput.js.map +1 -1
- package/lib/commonjs/segmented-control/SegmentedControl.js +38 -8
- package/lib/commonjs/segmented-control/SegmentedControl.js.map +1 -1
- package/lib/commonjs/select/Select.js +15 -3
- package/lib/commonjs/select/Select.js.map +1 -1
- package/lib/commonjs/select/Select.web.js +13 -5
- package/lib/commonjs/select/Select.web.js.map +1 -1
- package/lib/commonjs/slider/Slider.js +17 -3
- package/lib/commonjs/slider/Slider.js.map +1 -1
- package/lib/commonjs/stepper/Stepper.js +16 -7
- package/lib/commonjs/stepper/Stepper.js.map +1 -1
- package/lib/commonjs/styles/styled-primitives.js.map +1 -1
- package/lib/commonjs/switch/Switch.js +23 -8
- package/lib/commonjs/switch/Switch.js.map +1 -1
- package/lib/commonjs/text-field/TextField.js +19 -4
- package/lib/commonjs/text-field/TextField.js.map +1 -1
- package/lib/commonjs/textarea/Textarea.js +39 -15
- package/lib/commonjs/textarea/Textarea.js.map +1 -1
- package/lib/module/bottom-sheet/BottomSheetBase.js +8 -1
- package/lib/module/bottom-sheet/BottomSheetBase.js.map +1 -1
- package/lib/module/checkbox/Checkbox.js +24 -8
- package/lib/module/checkbox/Checkbox.js.map +1 -1
- package/lib/module/date-picker/TimeField.js +19 -5
- package/lib/module/date-picker/TimeField.js.map +1 -1
- package/lib/module/dialog/DialogContent.js +37 -30
- package/lib/module/dialog/DialogContent.js.map +1 -1
- package/lib/module/field/index.js +1 -0
- package/lib/module/field/index.js.map +1 -1
- package/lib/module/field/membership.js +101 -0
- package/lib/module/field/membership.js.map +1 -0
- package/lib/module/file-upload/FileUpload.js +17 -3
- package/lib/module/file-upload/FileUpload.js.map +1 -1
- package/lib/module/index.js +2 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +2 -2
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/input-group/InputGroup.js +19 -4
- package/lib/module/input-group/InputGroup.js.map +1 -1
- package/lib/module/input-otp/InputOtp.js +21 -7
- package/lib/module/input-otp/InputOtp.js.map +1 -1
- package/lib/module/layout/index.js +4 -1
- package/lib/module/layout/index.js.map +1 -1
- package/lib/module/layout/screen-scope.js +57 -0
- package/lib/module/layout/screen-scope.js.map +1 -0
- package/lib/module/phone-input/PhoneInput.js +22 -9
- package/lib/module/phone-input/PhoneInput.js.map +1 -1
- package/lib/module/radio/Radio.js +35 -9
- package/lib/module/radio/Radio.js.map +1 -1
- package/lib/module/rating/RatingInput.js +15 -5
- package/lib/module/rating/RatingInput.js.map +1 -1
- package/lib/module/segmented-control/SegmentedControl.js +38 -8
- package/lib/module/segmented-control/SegmentedControl.js.map +1 -1
- package/lib/module/select/Select.js +15 -3
- package/lib/module/select/Select.js.map +1 -1
- package/lib/module/select/Select.web.js +14 -4
- package/lib/module/select/Select.web.js.map +1 -1
- package/lib/module/slider/Slider.js +17 -3
- package/lib/module/slider/Slider.js.map +1 -1
- package/lib/module/stepper/Stepper.js +17 -6
- package/lib/module/stepper/Stepper.js.map +1 -1
- package/lib/module/styles/styled-primitives.js.map +1 -1
- package/lib/module/switch/Switch.js +23 -8
- package/lib/module/switch/Switch.js.map +1 -1
- package/lib/module/text-field/TextField.js +19 -4
- package/lib/module/text-field/TextField.js.map +1 -1
- package/lib/module/textarea/Textarea.js +39 -15
- package/lib/module/textarea/Textarea.js.map +1 -1
- package/lib/typescript/commonjs/bottom-sheet/BottomSheetBase.d.ts.map +1 -1
- package/lib/typescript/commonjs/checkbox/Checkbox.d.ts.map +1 -1
- package/lib/typescript/commonjs/checkbox/types.d.ts +5 -0
- package/lib/typescript/commonjs/checkbox/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/date-picker/TimeField.d.ts +1 -1
- package/lib/typescript/commonjs/date-picker/TimeField.d.ts.map +1 -1
- package/lib/typescript/commonjs/date-picker/types.d.ts +6 -3
- package/lib/typescript/commonjs/date-picker/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/DialogContent.d.ts.map +1 -1
- package/lib/typescript/commonjs/field/index.d.ts +2 -0
- package/lib/typescript/commonjs/field/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/field/membership.d.ts +60 -0
- package/lib/typescript/commonjs/field/membership.d.ts.map +1 -0
- package/lib/typescript/commonjs/file-upload/FileUpload.d.ts +1 -1
- package/lib/typescript/commonjs/file-upload/FileUpload.d.ts.map +1 -1
- package/lib/typescript/commonjs/floating/types.d.ts +13 -0
- package/lib/typescript/commonjs/floating/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +3 -3
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.web.d.ts +3 -3
- package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/input-group/InputGroup.d.ts +1 -1
- package/lib/typescript/commonjs/input-group/InputGroup.d.ts.map +1 -1
- package/lib/typescript/commonjs/input-otp/InputOtp.d.ts.map +1 -1
- package/lib/typescript/commonjs/input-otp/types.d.ts +7 -1
- package/lib/typescript/commonjs/input-otp/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/layout/index.d.ts +4 -1
- package/lib/typescript/commonjs/layout/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/layout/screen-scope.d.ts +40 -0
- package/lib/typescript/commonjs/layout/screen-scope.d.ts.map +1 -0
- package/lib/typescript/commonjs/phone-input/PhoneInput.d.ts.map +1 -1
- package/lib/typescript/commonjs/radio/Radio.d.ts +1 -1
- package/lib/typescript/commonjs/radio/Radio.d.ts.map +1 -1
- package/lib/typescript/commonjs/radio/types.d.ts +11 -3
- package/lib/typescript/commonjs/radio/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/rating/RatingInput.d.ts +1 -1
- package/lib/typescript/commonjs/rating/RatingInput.d.ts.map +1 -1
- package/lib/typescript/commonjs/rating/types.d.ts +6 -3
- package/lib/typescript/commonjs/rating/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/segmented-control/SegmentedControl.d.ts +18 -2
- package/lib/typescript/commonjs/segmented-control/SegmentedControl.d.ts.map +1 -1
- package/lib/typescript/commonjs/select/Select.d.ts.map +1 -1
- package/lib/typescript/commonjs/select/Select.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/select/types.d.ts +8 -1
- package/lib/typescript/commonjs/select/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/slider/Slider.d.ts.map +1 -1
- package/lib/typescript/commonjs/stepper/Stepper.d.ts +1 -1
- package/lib/typescript/commonjs/stepper/Stepper.d.ts.map +1 -1
- package/lib/typescript/commonjs/stepper/types.d.ts +8 -1
- package/lib/typescript/commonjs/stepper/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/styles/styled-primitives.d.ts +16 -0
- package/lib/typescript/commonjs/styles/styled-primitives.d.ts.map +1 -1
- package/lib/typescript/commonjs/switch/Switch.d.ts.map +1 -1
- package/lib/typescript/commonjs/switch/types.d.ts +7 -0
- package/lib/typescript/commonjs/switch/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/text-field/TextField.d.ts.map +1 -1
- package/lib/typescript/commonjs/textarea/Textarea.d.ts +1 -1
- package/lib/typescript/commonjs/textarea/Textarea.d.ts.map +1 -1
- package/lib/typescript/module/bottom-sheet/BottomSheetBase.d.ts.map +1 -1
- package/lib/typescript/module/checkbox/Checkbox.d.ts.map +1 -1
- package/lib/typescript/module/checkbox/types.d.ts +5 -0
- package/lib/typescript/module/checkbox/types.d.ts.map +1 -1
- package/lib/typescript/module/date-picker/TimeField.d.ts +1 -1
- package/lib/typescript/module/date-picker/TimeField.d.ts.map +1 -1
- package/lib/typescript/module/date-picker/types.d.ts +6 -3
- package/lib/typescript/module/date-picker/types.d.ts.map +1 -1
- package/lib/typescript/module/dialog/DialogContent.d.ts.map +1 -1
- package/lib/typescript/module/field/index.d.ts +2 -0
- package/lib/typescript/module/field/index.d.ts.map +1 -1
- package/lib/typescript/module/field/membership.d.ts +60 -0
- package/lib/typescript/module/field/membership.d.ts.map +1 -0
- package/lib/typescript/module/file-upload/FileUpload.d.ts +1 -1
- package/lib/typescript/module/file-upload/FileUpload.d.ts.map +1 -1
- package/lib/typescript/module/floating/types.d.ts +13 -0
- package/lib/typescript/module/floating/types.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +3 -3
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/index.web.d.ts +3 -3
- package/lib/typescript/module/index.web.d.ts.map +1 -1
- package/lib/typescript/module/input-group/InputGroup.d.ts +1 -1
- package/lib/typescript/module/input-group/InputGroup.d.ts.map +1 -1
- package/lib/typescript/module/input-otp/InputOtp.d.ts.map +1 -1
- package/lib/typescript/module/input-otp/types.d.ts +7 -1
- package/lib/typescript/module/input-otp/types.d.ts.map +1 -1
- package/lib/typescript/module/layout/index.d.ts +4 -1
- package/lib/typescript/module/layout/index.d.ts.map +1 -1
- package/lib/typescript/module/layout/screen-scope.d.ts +40 -0
- package/lib/typescript/module/layout/screen-scope.d.ts.map +1 -0
- package/lib/typescript/module/phone-input/PhoneInput.d.ts.map +1 -1
- package/lib/typescript/module/radio/Radio.d.ts +1 -1
- package/lib/typescript/module/radio/Radio.d.ts.map +1 -1
- package/lib/typescript/module/radio/types.d.ts +11 -3
- package/lib/typescript/module/radio/types.d.ts.map +1 -1
- package/lib/typescript/module/rating/RatingInput.d.ts +1 -1
- package/lib/typescript/module/rating/RatingInput.d.ts.map +1 -1
- package/lib/typescript/module/rating/types.d.ts +6 -3
- package/lib/typescript/module/rating/types.d.ts.map +1 -1
- package/lib/typescript/module/segmented-control/SegmentedControl.d.ts +18 -2
- package/lib/typescript/module/segmented-control/SegmentedControl.d.ts.map +1 -1
- package/lib/typescript/module/select/Select.d.ts.map +1 -1
- package/lib/typescript/module/select/Select.web.d.ts.map +1 -1
- package/lib/typescript/module/select/types.d.ts +8 -1
- package/lib/typescript/module/select/types.d.ts.map +1 -1
- package/lib/typescript/module/slider/Slider.d.ts.map +1 -1
- package/lib/typescript/module/stepper/Stepper.d.ts +1 -1
- package/lib/typescript/module/stepper/Stepper.d.ts.map +1 -1
- package/lib/typescript/module/stepper/types.d.ts +8 -1
- package/lib/typescript/module/stepper/types.d.ts.map +1 -1
- package/lib/typescript/module/styles/styled-primitives.d.ts +16 -0
- package/lib/typescript/module/styles/styled-primitives.d.ts.map +1 -1
- package/lib/typescript/module/switch/Switch.d.ts.map +1 -1
- package/lib/typescript/module/switch/types.d.ts +7 -0
- package/lib/typescript/module/switch/types.d.ts.map +1 -1
- package/lib/typescript/module/text-field/TextField.d.ts.map +1 -1
- package/lib/typescript/module/textarea/Textarea.d.ts +1 -1
- package/lib/typescript/module/textarea/Textarea.d.ts.map +1 -1
- package/package.json +521 -1
- package/src/bottom-sheet/BottomSheetBase.tsx +6 -1
- package/src/checkbox/Checkbox.tsx +24 -8
- package/src/checkbox/types.ts +5 -0
- package/src/date-picker/TimeField.tsx +14 -3
- package/src/date-picker/types.ts +6 -3
- package/src/dialog/DialogContent.tsx +6 -2
- package/src/field/index.ts +2 -0
- package/src/field/membership.ts +164 -0
- package/src/file-upload/FileUpload.tsx +14 -3
- package/src/floating/types.ts +13 -0
- package/src/index.ts +9 -2
- package/src/index.web.ts +9 -2
- package/src/input-group/InputGroup.tsx +13 -2
- package/src/input-otp/InputOtp.tsx +19 -5
- package/src/input-otp/types.ts +7 -1
- package/src/layout/index.ts +4 -1
- package/src/layout/screen-scope.tsx +54 -0
- package/src/phone-input/PhoneInput.tsx +20 -8
- package/src/radio/Radio.tsx +32 -9
- package/src/radio/types.ts +11 -3
- package/src/rating/RatingInput.tsx +10 -3
- package/src/rating/types.ts +6 -3
- package/src/segmented-control/SegmentedControl.tsx +51 -8
- package/src/select/Select.tsx +14 -2
- package/src/select/Select.web.tsx +11 -2
- package/src/select/types.ts +8 -1
- package/src/slider/Slider.tsx +13 -3
- package/src/stepper/Stepper.tsx +12 -4
- package/src/stepper/types.ts +8 -1
- package/src/styles/styled-primitives.ts +16 -0
- package/src/switch/Switch.tsx +22 -9
- package/src/switch/types.ts +7 -0
- package/src/text-field/TextField.tsx +16 -4
- package/src/textarea/Textarea.tsx +38 -15
package/docs/icons.mdx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Icons
|
|
3
|
-
description: Remix Icon, one component per glyph — how to import
|
|
3
|
+
description: Remix Icon, one component per glyph — how to import one glyph instead of all 461, how apps migrate off the retired Bloom set, and why a wrong name is invisible to the compiler.
|
|
4
4
|
order: 66
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -17,6 +17,59 @@ import { RiNotification3Line as BellIcon } from '@oxy.so/bloom/icons';
|
|
|
17
17
|
<BellIcon size="lg" fill={colors.text} />
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
+
## Import one glyph, ship one glyph
|
|
21
|
+
|
|
22
|
+
**Metro does not tree-shake.** `@oxy.so/bloom/icons` is a flat barrel over all
|
|
23
|
+
461 glyphs, so an app that names one icon through it bundles all 461 — the
|
|
24
|
+
import is a static graph edge to every one of them, and nothing downstream
|
|
25
|
+
removes what the app never renders.
|
|
26
|
+
|
|
27
|
+
Every glyph is therefore *also* its own subpath. The module name is the export
|
|
28
|
+
name, so there is nothing new to look up:
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
import { RiNotification3Line as BellIcon } from '@oxy.so/bloom/icons/RiNotification3Line';
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Measured on a Metro bundle (`--platform ios --dev false --minify true`) built
|
|
35
|
+
from two entry points that name the same 12 `Ri*` icons — the set CrowdSource's
|
|
36
|
+
apps import — and differ in nothing else:
|
|
37
|
+
|
|
38
|
+
| | from the barrel | by subpath |
|
|
39
|
+
|---|---|---|
|
|
40
|
+
| glyph modules in the bundle | 461 | 12 |
|
|
41
|
+
| bytes in those modules | 318,869 | 7,406 |
|
|
42
|
+
| whole bundle | 3,324,898 | 2,959,073 |
|
|
43
|
+
|
|
44
|
+
**365,825 bytes, 11.0% of the bundle.** 311,463 of those are the 449 glyphs the
|
|
45
|
+
app never draws; the remaining 54,362 are the two barrel modules themselves
|
|
46
|
+
(`icons/index.ts`, and the 461-line `icons/remix/index.ts`) and Metro's
|
|
47
|
+
per-module dependency arrays. The same shape was what pushed one app's
|
|
48
|
+
JavaScript budget over by 119 KiB between Bloom 2.0.0 (338 icons) and 3.1.0
|
|
49
|
+
(463): the barrel grows with the icon set whether or not an app uses any of it.
|
|
50
|
+
|
|
51
|
+
### The barrel still works, and stays supported
|
|
52
|
+
|
|
53
|
+
`@oxy.so/bloom/icons` is an **exact** `exports` key and the per-glyph entry is a
|
|
54
|
+
**pattern** (`./icons/Ri*`); an exact key beats a pattern in every resolver that
|
|
55
|
+
implements `exports`, so no existing import moves and nothing needs migrating.
|
|
56
|
+
Reach for the barrel when a file genuinely wants many glyphs — a `Foundations`
|
|
57
|
+
story, or the icon picker — and for the subpath everywhere else.
|
|
58
|
+
|
|
59
|
+
Both shapes resolve the same four ways Bloom is consumed, verified against a
|
|
60
|
+
fixture rather than assumed: Metro (the `react-native` condition, which takes
|
|
61
|
+
`src/`), an ESM bundler, Node's `require`, and `tsc` under `node16`, `bundler`
|
|
62
|
+
**and** the legacy `node` resolution. That last one reads `typesVersions`
|
|
63
|
+
instead of `exports`, which is why the package now ships one; before it did,
|
|
64
|
+
*no* Bloom subpath typechecked under `moduleResolution: "node"`.
|
|
65
|
+
|
|
66
|
+
One thing the pattern deliberately cannot express: `@oxy.so/bloom/icons/index`.
|
|
67
|
+
The `Ri` sits in the pattern rather than in the `*`, because a bare `./icons/*`
|
|
68
|
+
would also match `index` — and the built `icons/remix/index.js` exists while
|
|
69
|
+
`src/icons/remix/` holds an `index.ts` and no `index.tsx`, so that specifier
|
|
70
|
+
would resolve for every consumer *except* Metro, the one that reads `src/`.
|
|
71
|
+
Use `@oxy.so/bloom/icons` for the barrel.
|
|
72
|
+
|
|
20
73
|
## The naming is `Ri<Subject><Line|Fill>`
|
|
21
74
|
|
|
22
75
|
The name on remixicon.com is the import: `arrow-right-s-line` is
|
|
@@ -145,14 +198,16 @@ release blocker once got filed against the tab bar.
|
|
|
145
198
|
It is the only gate on this class of bug, and it deliberately does **not** strip
|
|
146
199
|
comments, because the comments are the surface under test.
|
|
147
200
|
|
|
148
|
-
##
|
|
201
|
+
## Three import shapes are correct, one is not
|
|
149
202
|
|
|
150
203
|
```tsx
|
|
204
|
+
import { RiHome5Line } from '@oxy.so/bloom/icons/RiHome5Line'; // ✅ one glyph, one module
|
|
151
205
|
import * as Icons from '@oxy.so/bloom/icons'; // ✅ the subpath, as a namespace
|
|
152
206
|
import { Icons } from '@oxy.so/bloom'; // ✅ the root barrel's namespace
|
|
153
207
|
```
|
|
154
208
|
|
|
155
|
-
The
|
|
209
|
+
The first is the one to reach for; the other two pull the whole set in (above).
|
|
210
|
+
The fourth shape — importing `Icons` as a *named* export from the **subpath** —
|
|
156
211
|
is `undefined` at runtime. The subpath exports the components flat; the `Icons`
|
|
157
212
|
name is assembled by the root barrel (`export * as Icons from './icons'`), so
|
|
158
213
|
there is no such named export to destructure.
|
package/docs/input-group.mdx
CHANGED
|
@@ -71,6 +71,28 @@ field, which belongs to [`Field`](/docs/bloom/main/field) or
|
|
|
71
71
|
`InputGroup` goes *inside* a `Field` — the group is the control, the field is
|
|
72
72
|
its label, hint and error.
|
|
73
73
|
|
|
74
|
+
## In a `Field`
|
|
75
|
+
|
|
76
|
+
A group holding a control and its addons is one control as far as a `Field` is
|
|
77
|
+
concerned: the field's `disabled` and invalid state reach every member through the
|
|
78
|
+
group — **including an addon's `Button`**, which reads neither the field nor the
|
|
79
|
+
text-field group itself.
|
|
80
|
+
|
|
81
|
+
```tsx
|
|
82
|
+
<Field label="Domain" error={errors.domain} disabled={locked}>
|
|
83
|
+
<InputGroup>
|
|
84
|
+
<InputGroupAddon>https://</InputGroupAddon>
|
|
85
|
+
<TextFieldInput value={domain} onChangeText={setDomain} />
|
|
86
|
+
<InputGroupAddon divider>
|
|
87
|
+
<Button size="small" variant="ghost" onPress={check}>Check</Button>
|
|
88
|
+
</InputGroupAddon>
|
|
89
|
+
</InputGroup>
|
|
90
|
+
</Field>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
The group publishes no NAME: it does not know which of its children is the control
|
|
94
|
+
the label points at, so the id stays the field's and the input's to apply.
|
|
95
|
+
|
|
74
96
|
## `divider`
|
|
75
97
|
|
|
76
98
|
Use it when the addon is a distinct target — a button, a dropdown. Skip it for
|
package/docs/input-otp.mdx
CHANGED
|
@@ -59,3 +59,17 @@ Clearing a box removes its digit from the value, so later digits move left.
|
|
|
59
59
|
- The row is a `group` named by `accessibilityLabel`; each box is named `Digit 1 of 6` and so on.
|
|
60
60
|
- `aria-invalid` sits on each box, not the group — `group` does not support it.
|
|
61
61
|
- Say why the code is invalid in text next to the field; the red border is not an announcement.
|
|
62
|
+
|
|
63
|
+
Inside a `Field` it is the several-controls case: use `multiple`, so the field
|
|
64
|
+
becomes a labelled `group`, names the box group and describes it — while each box
|
|
65
|
+
keeps its own name ("Digit 3 of 6") and its own `aria-invalid`. The field's
|
|
66
|
+
`disabled` freezes every box.
|
|
67
|
+
|
|
68
|
+
```tsx
|
|
69
|
+
<Field label="Verification code" multiple error={errors.code}>
|
|
70
|
+
<InputOtp length={6} onComplete={verify} />
|
|
71
|
+
</Field>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
`accessibilityLabel` still wins when written; `"One-time code"` is the last resort
|
|
75
|
+
rather than a default, because a default would outrank the label on screen.
|
package/docs/layout.mdx
CHANGED
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
useClaimTopEdge,
|
|
20
20
|
ScrollOffsetProvider,
|
|
21
21
|
useScrollOffset,
|
|
22
|
+
ScreenScope,
|
|
22
23
|
} from '@oxy.so/bloom/layout';
|
|
23
24
|
```
|
|
24
25
|
|
|
@@ -127,6 +128,39 @@ native. That default is right for exactly one layout — a web page whose docume
|
|
|
127
128
|
*is* the scroller — and silently wrong for a desktop panel and for every native
|
|
128
129
|
screen, with no error: the header simply never reacts.
|
|
129
130
|
|
|
131
|
+
## `ScreenScope` — a surface that is its own screen
|
|
132
|
+
|
|
133
|
+
The top edge and the scroll offset are per-SCREEN, and a modal, a sheet or a
|
|
134
|
+
detail panel is a second screen drawn over the first. Without a boundary both
|
|
135
|
+
contracts cross it, and neither failure has an error in it:
|
|
136
|
+
|
|
137
|
+
- A header inside a full-screen dialog claims the top edge of the page
|
|
138
|
+
UNDERNEATH it. Claims combine with `max`, so the page behind is padded for
|
|
139
|
+
chrome it does not have — and the padding appears and disappears with the
|
|
140
|
+
modal, because the claim unregisters on unmount.
|
|
141
|
+
- Chrome inside the sheet reads the page's scroll offset and follows a scroller
|
|
142
|
+
the user is not touching.
|
|
143
|
+
|
|
144
|
+
```tsx
|
|
145
|
+
<ScreenScope>
|
|
146
|
+
<PageHeader title="Edit listing" onBack={close} />
|
|
147
|
+
<ScrollView contentContainerStyle={{ paddingTop: useTopEdgeInset() }}>…</ScrollView>
|
|
148
|
+
</ScreenScope>
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
A fresh top-edge registry, a fresh bottom-edge registry and a `null` scroll
|
|
152
|
+
offset — the honest value, because nothing inside has said which scroller it owns
|
|
153
|
+
yet. A scroll owner INSIDE publishes in the ordinary way and wins, being nearer.
|
|
154
|
+
|
|
155
|
+
The bottom edge is scoped for the mirror reason, and it is the same point the
|
|
156
|
+
"modal surface should not read the registry" note below makes: a sheet is drawn
|
|
157
|
+
OVER the tab bar and the FAB, so a form inside it that cleared the tab bar would
|
|
158
|
+
end in a band of empty space.
|
|
159
|
+
|
|
160
|
+
**`DialogBody` and `BottomSheetBase` mount it**, so every Bloom dialog placement
|
|
161
|
+
and every bottom sheet is already a scope. Mount it yourself only around a
|
|
162
|
+
surface Bloom does not own.
|
|
163
|
+
|
|
130
164
|
## The collapse is not here, on purpose
|
|
131
165
|
|
|
132
166
|
The tab bar minimizes 58 → 44 on scroll. This registry twice tried to publish
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Migrating to 3.0
|
|
3
|
-
description: Every breaking change between @oxy.so/bloom 2.12.4 and 3.0.0 — PageHeader's floating default, the split of `transparent` into two props, and what is additive.
|
|
3
|
+
description: Every breaking change between @oxy.so/bloom 2.12.4 and 3.0.0 — PageHeader's floating default, the split of `transparent` into two props, and what is additive — plus the behaviour changes each 3.x minor adds.
|
|
4
4
|
order: 2
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -131,9 +131,10 @@ Nothing below removes or renames anything.
|
|
|
131
131
|
wires `aria-describedby`, `aria-invalid`, `aria-required` and the control's
|
|
132
132
|
accessible name, and gains `multiple` for a field holding several controls.
|
|
133
133
|
One behaviour change worth naming: **`Field disabled` now disables a control
|
|
134
|
-
that reads the field context**
|
|
135
|
-
|
|
136
|
-
input, that combination no
|
|
134
|
+
that reads the field context** — `TextFieldInput` in 3.0, and fifteen more
|
|
135
|
+
controls in 3.1 (see below). It previously only dimmed the label. If you were
|
|
136
|
+
relying on a disabled-looking field with a live input, that combination no
|
|
137
|
+
longer exists.
|
|
137
138
|
- **`Label.htmlFor` accepts `null`**, meaning "this label names a group, not a
|
|
138
139
|
control". Omitting it still falls back to `nativeID`.
|
|
139
140
|
- **`asChild` triggers can be cancelled.** `event.preventDefault()` in the
|
|
@@ -167,3 +168,41 @@ paint. Gate: `src/__tests__/svg-absolute-fill-size.test.ts`.
|
|
|
167
168
|
The theme, the tokens, the icon set, the typography, every other family's API,
|
|
168
169
|
and the license. If your app does not render a `PageHeader`, 3.0.0 is a drop-in
|
|
169
170
|
upgrade from 2.12.x.
|
|
171
|
+
|
|
172
|
+
## 3.1 — the contracts reach the rest of the catalogue
|
|
173
|
+
|
|
174
|
+
3.1 is additive at the type level: `tsc` will not flag anything. Two behaviour
|
|
175
|
+
changes are worth reading before you upgrade a form.
|
|
176
|
+
|
|
177
|
+
**1. `Field disabled` now reaches fifteen more controls.** `Checkbox`,
|
|
178
|
+
`FileUpload`, `InputGroup` (including an addon's `Button`), `InputOtp`,
|
|
179
|
+
`PhoneInput` (including its country picker), `Radio`, `RadioGroup`,
|
|
180
|
+
`RatingInput`, `SegmentedControl`, `SelectTrigger`, `Slider`, `Stepper`,
|
|
181
|
+
`Switch`, `Textarea` and `TimeField` read the field's `disabled` and combine it
|
|
182
|
+
with their own using `||` — so a control inside a disabled field is inert and
|
|
183
|
+
cannot opt out with `disabled={false}`. If a screen relied on a disabled-LOOKING
|
|
184
|
+
field with live controls inside it, move `disabled` off the `Field` and onto the
|
|
185
|
+
controls that should actually be off.
|
|
186
|
+
|
|
187
|
+
**2. A control inside a labelled `Field` takes the field's label as its accessible
|
|
188
|
+
name.** Previously it announced whatever its own prop said, or nothing. Two
|
|
189
|
+
consequences:
|
|
190
|
+
|
|
191
|
+
- A `Switch`, `Slider`, `Stepper`, `RatingInput` or `TimeField` inside a `Field`
|
|
192
|
+
no longer needs a name prop, and no longer warns without one. The name props
|
|
193
|
+
that were REQUIRED on `Stepper`, `RatingInput`, `TimeField`, `RadioGroup`,
|
|
194
|
+
`SegmentedControl` and `SelectTrigger` are optional now — passing them still
|
|
195
|
+
works and still wins.
|
|
196
|
+
- If you were passing BOTH a `Field label` and a stacked control label
|
|
197
|
+
(`TextFieldInput label`, `Textarea label`), the field's is the announced one.
|
|
198
|
+
A label drawn BESIDE the control — a checkbox's caption, a radio's option text
|
|
199
|
+
— still names that control, so the announced name matches what the eye reads.
|
|
200
|
+
|
|
201
|
+
**Also additive:** `useFieldMembership()` from `@oxy.so/bloom/field` for an app's
|
|
202
|
+
own control; `ScreenScope` from `@oxy.so/bloom/layout` (mounted for you by every
|
|
203
|
+
dialog and sheet, so a modal's chrome no longer claims the page's top edge);
|
|
204
|
+
`density` inheritance in `TextField`, `Textarea` and `TimeField`; `nativeID` on
|
|
205
|
+
`Switch`, `Checkbox` and `Radio`; `disabled`, `nativeID` and `testID` on
|
|
206
|
+
`SegmentedControl`; `aria-describedby`/`aria-invalid` on an anchored family's
|
|
207
|
+
trigger handle. Where every family stands, family by family:
|
|
208
|
+
[Adoption matrix](/docs/adoption-matrix).
|
package/docs/phone-input.mdx
CHANGED
|
@@ -94,3 +94,20 @@ node scripts/generate-country-flags.mjs
|
|
|
94
94
|
|
|
95
95
|
- Names follow `countries-list` 3.4.1 (`Czechia`, `Cabo Verde`, `Myanmar`).
|
|
96
96
|
- A flag is stored as shape tuples (`flag-art.ts`), with `<g>` presentation attributes pushed down onto the shapes, so rendering parses no XML. `UM` and `US` share artwork upstream.
|
|
97
|
+
|
|
98
|
+
### In a `Field`
|
|
99
|
+
|
|
100
|
+
`PhoneInput` hands the field's state to BOTH halves — the number input and the
|
|
101
|
+
country picker. That second half is the one that used to be missed: the input read
|
|
102
|
+
the field context itself, the picker did not, so a disabled field left the country
|
|
103
|
+
list operable.
|
|
104
|
+
|
|
105
|
+
```tsx
|
|
106
|
+
<Field label="Phone number" error={errors.phone} disabled={locked}>
|
|
107
|
+
<PhoneInput countrySelectLabel="Country" onChangeText={setPhone} />
|
|
108
|
+
</Field>
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
`size` is passed straight to the `TextField` inside, which inherits density from a
|
|
112
|
+
`ControlSurface` — so a small filter row makes the phone field small without a
|
|
113
|
+
prop here. See [Composition](/docs/composition).
|
package/docs/radio.mdx
CHANGED
|
@@ -77,6 +77,22 @@ that is [`RadioIndicator`](/docs/bloom/main/radio-indicator), which is
|
|
|
77
77
|
presentational and takes `selected`. Using the indicator where you meant the
|
|
78
78
|
control is how a "radio group" ends up announcing as decoration.
|
|
79
79
|
|
|
80
|
+
## In a `Field`
|
|
81
|
+
|
|
82
|
+
A radio set is the several-controls case, so the field is a `multiple` one: it
|
|
83
|
+
becomes a labelled `group`, names the `RadioGroup` (whose own `label` is optional
|
|
84
|
+
for that reason), and disables every option without any of them being able to opt
|
|
85
|
+
out.
|
|
86
|
+
|
|
87
|
+
```tsx
|
|
88
|
+
<Field label="Billing period" multiple error={errors.period} disabled={locked}>
|
|
89
|
+
<RadioGroup value={period} onValueChange={setPeriod} options={PERIODS} />
|
|
90
|
+
</Field>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Each radio keeps its OWN name — the option's text, which is what the user reads
|
|
94
|
+
beside the dot. See [Field](/docs/field).
|
|
95
|
+
|
|
80
96
|
## Radio, Switch or Checkbox
|
|
81
97
|
|
|
82
98
|
- **Radio** — one of several named options, all visible, mutually exclusive.
|
package/docs/rating.mdx
CHANGED
|
@@ -103,3 +103,17 @@ values (`4.92`): a display has no target and no keyboard.
|
|
|
103
103
|
Clearing is left out for the reason re-choosing a [`Radio`](/docs/radio) is a
|
|
104
104
|
no-op — a radio has no "off". A form that has no rating yet holds `null`; it
|
|
105
105
|
does not need the group to express a state it cannot draw.
|
|
106
|
+
|
|
107
|
+
## `RatingInput` in a `Field`
|
|
108
|
+
|
|
109
|
+
The stars are a `radiogroup` that draws no words, so `accessibilityLabel` is the
|
|
110
|
+
name — or, inside a [`Field`](/docs/field), the field's label, which is why the
|
|
111
|
+
prop is optional:
|
|
112
|
+
|
|
113
|
+
```tsx
|
|
114
|
+
<Field label="Cleanliness" error={errors.cleanliness}>
|
|
115
|
+
<RatingInput value={stars} onChange={setStars} />
|
|
116
|
+
</Field>
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
The field's `disabled` freezes the whole row, including the hover preview.
|
|
@@ -50,11 +50,23 @@ emits `aria-selected` for tabs and `aria-checked` for radios, and neither uses
|
|
|
50
50
|
`accessibilityState` — react-native-web drops that entirely, so a control
|
|
51
51
|
relying on it would announce no state at all on web.
|
|
52
52
|
|
|
53
|
-
## `label`
|
|
53
|
+
## `label` names the group, and something has to
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
"Light / Dark / System" without a group name announces as three unrelated radios;
|
|
56
|
+
with `label="Appearance"` it announces as a choice about appearance.
|
|
57
|
+
|
|
58
|
+
The prop is optional only because an enclosing [`Field`](/docs/field) can supply
|
|
59
|
+
the name instead — and the field's `disabled` then reaches every segment, which a
|
|
60
|
+
segment cannot opt out of by passing `disabled={false}`. With neither the prop nor
|
|
61
|
+
a field the group announces nothing.
|
|
62
|
+
|
|
63
|
+
```tsx
|
|
64
|
+
<Field label="Appearance" disabled={!canChange}>
|
|
65
|
+
<SegmentedControl type="radio" value={mode} onChange={setMode}>
|
|
66
|
+
…
|
|
67
|
+
</SegmentedControl>
|
|
68
|
+
</Field>
|
|
69
|
+
```
|
|
58
70
|
|
|
59
71
|
## Which prop decides what
|
|
60
72
|
|
package/docs/select.mdx
CHANGED
|
@@ -144,6 +144,28 @@ It used to take a render prop instead, which handed its child a `state` object w
|
|
|
144
144
|
|
|
145
145
|
The web dropdown grows to `maxHeight` (default 240, `max-h-[240px]`) and then scrolls with the native scrollbar. Opening it scrolls the selected option into view. There are no scroll buttons by default: they appeared and disappeared as the list moved and made the panel jump in height. `SelectScrollUpButton` and `SelectScrollDownButton` stay exported for a caller composing their own content inside a `SelectScrollProvider`; on native they render nothing, since the sheet's list scrolls under the finger.
|
|
146
146
|
|
|
147
|
+
## In a `Field`
|
|
148
|
+
|
|
149
|
+
The trigger IS the select's control, so it takes the field's id, name, described-by
|
|
150
|
+
and invalid state, and the field's `disabled` on top of the root's and its own:
|
|
151
|
+
|
|
152
|
+
```tsx
|
|
153
|
+
<Field label="Visibility" error={errors.visibility} disabled={locked}>
|
|
154
|
+
<Select value={visibility} onValueChange={setVisibility}>
|
|
155
|
+
<SelectTrigger>
|
|
156
|
+
<SelectValue placeholder="Choose" />
|
|
157
|
+
</SelectTrigger>
|
|
158
|
+
<SelectContent>…</SelectContent>
|
|
159
|
+
</Select>
|
|
160
|
+
</Field>
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
`SelectTrigger`'s `label` is optional for that reason — the chosen value is not a
|
|
164
|
+
name ("Medium" says nothing about what is medium), so either the prop or a field
|
|
165
|
+
has to supply one. A `Popover` or a `DropdownMenu` inside a field deliberately
|
|
166
|
+
does NOT take the field's id: it is not the field's control. See
|
|
167
|
+
[Composition](/docs/composition).
|
|
168
|
+
|
|
147
169
|
## Selection state
|
|
148
170
|
|
|
149
171
|
Both forks render each option as `role="radio"` with `aria-checked` — the only spelling react-native-web reads, and one React Native folds back into `accessibilityState`. `SelectItemIndicator` draws the mark — a `text-secondary` check in the row's right-hand gutter on both platforms — and the chosen row also takes the highlight wash.
|
package/docs/slider.mdx
CHANGED
|
@@ -80,6 +80,20 @@ and never what it is. Omitting it warns once in development, dev-only and never
|
|
|
80
80
|
throwing; an empty or whitespace-only string counts as missing, because
|
|
81
81
|
`aria-label=""` is not a name.
|
|
82
82
|
|
|
83
|
+
## In a `Field`
|
|
84
|
+
|
|
85
|
+
`Slider` draws a track and a knob and hides its own `label` from assistive
|
|
86
|
+
technology, so the name is a prop — or the enclosing field's label:
|
|
87
|
+
|
|
88
|
+
```tsx
|
|
89
|
+
<Field label="Maximum price" description="Per night" disabled={!hasDates}>
|
|
90
|
+
<Slider value={price} onValueChange={setPrice} min={0} max={500} />
|
|
91
|
+
</Field>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
The field also supplies the id, `aria-describedby` and `aria-invalid`, and its
|
|
95
|
+
`disabled` stops the pan responder as well as dimming the track.
|
|
96
|
+
|
|
83
97
|
## When a slider is the wrong control
|
|
84
98
|
|
|
85
99
|
- **The exact value matters.** Use a number input; a slider cannot be typed
|
package/docs/stepper.mdx
CHANGED
|
@@ -55,7 +55,9 @@ import { Stepper, StepperRow } from '@oxy.so/bloom/stepper';
|
|
|
55
55
|
|
|
56
56
|
## Accessibility
|
|
57
57
|
|
|
58
|
-
The stepper is a `group` named by `accessibilityLabel
|
|
58
|
+
The stepper is a `group` named by `accessibilityLabel` — or, inside a
|
|
59
|
+
[`Field`](/docs/field), by the field's label, which is why the prop is optional.
|
|
60
|
+
With neither it announces nothing and warns once in development. Inside it the value is
|
|
59
61
|
the `adjustable` element (`role="slider"` on web) carrying `aria-valuenow`,
|
|
60
62
|
`aria-valuemin`, `aria-valuemax` (omitted when unbounded) and `aria-valuetext`
|
|
61
63
|
(the `formatValue` output).
|
package/docs/switch.mdx
CHANGED
|
@@ -70,6 +70,20 @@ Omitting it warns once per component in development. The warning is dev-only
|
|
|
70
70
|
unnamed switch still renders and still toggles. An empty or whitespace-only
|
|
71
71
|
label counts as missing, because `aria-label=""` names nothing.
|
|
72
72
|
|
|
73
|
+
**Inside a `Field` the field's label is that name**, so the prop is not needed
|
|
74
|
+
there:
|
|
75
|
+
|
|
76
|
+
```tsx
|
|
77
|
+
<Field label="Push notifications">
|
|
78
|
+
<Switch value={push} onValueChange={setPush} />
|
|
79
|
+
</Field>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
The switch takes the field's label as its accessible name, its id (so a click on
|
|
83
|
+
the label focuses it on web) and the field's `disabled` — which it cannot opt out
|
|
84
|
+
of. The dev-only warning reads the RESOLVED name, so a switch named by its field
|
|
85
|
+
does not warn. See [Field](/docs/field).
|
|
86
|
+
|
|
73
87
|
## The accessibility rule this component is the reference for
|
|
74
88
|
|
|
75
89
|
`Switch` sets `role="switch"` and **`aria-checked`**, not
|
package/docs/text-field.mdx
CHANGED
|
@@ -93,6 +93,20 @@ TextField parts must be rendered inside a <TextField>.
|
|
|
93
93
|
<TextFieldHint isInvalid={isInvalid}>We never share it.</TextFieldHint>
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
+
`size` is `'medium' | 'small'`, which is exactly the `density` vocabulary of the
|
|
97
|
+
[control-presentation contract](/docs/composition) — so a filter row can ask once
|
|
98
|
+
and every field in it draws small:
|
|
99
|
+
|
|
100
|
+
```tsx
|
|
101
|
+
<ControlSurface density="small">
|
|
102
|
+
<TextField>…</TextField>
|
|
103
|
+
<TextField>…</TextField>
|
|
104
|
+
</ControlSurface>
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
An explicit `size` still wins, and an `InputGroup` outranks both — its members
|
|
108
|
+
have to be one height.
|
|
109
|
+
|
|
96
110
|
## Leading addon (phone input)
|
|
97
111
|
|
|
98
112
|
```tsx
|
package/docs/textarea.mdx
CHANGED
|
@@ -89,6 +89,26 @@ Accepts React Native's `TextInputProps` (except `multiline`, which is always on)
|
|
|
89
89
|
- Invalid and disabled reach the input as `aria-invalid` / `aria-disabled`, the spellings react-native-web reads.
|
|
90
90
|
- Invalid is also shown as text when you pass a `hint`; colour alone is not an announcement.
|
|
91
91
|
|
|
92
|
+
## It reads two contracts
|
|
93
|
+
|
|
94
|
+
`Textarea` takes its density from the nearest `ControlSurface` and its
|
|
95
|
+
association from the nearest `Field`:
|
|
96
|
+
|
|
97
|
+
```tsx
|
|
98
|
+
<ControlSurface density="small">
|
|
99
|
+
<Field label="Notes" error={errors.notes} disabled={locked}>
|
|
100
|
+
<Textarea rows={4} value={notes} onChangeText={setNotes} />
|
|
101
|
+
</Field>
|
|
102
|
+
</ControlSurface>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
`size` still wins when written, because a caller always outranks a container.
|
|
106
|
+
The field supplies the id, the accessible name, `aria-describedby` for whichever
|
|
107
|
+
of description/error is showing, `aria-invalid` and `disabled` — and a textarea
|
|
108
|
+
inside a disabled field cannot re-enable itself. Its own `label` prop is the
|
|
109
|
+
STACKED kind, so it defers to the field's; do not pass both.
|
|
110
|
+
See [Composition](/docs/composition) and [Field](/docs/field).
|
|
111
|
+
|
|
92
112
|
## The fill is a step off the surface
|
|
93
113
|
|
|
94
114
|
`Textarea` shares `text-field`'s palette, so its shell steps off whatever surface
|
|
@@ -9,11 +9,12 @@ var _reactNative = require("react-native");
|
|
|
9
9
|
var _reactNativeGestureHandler = require("react-native-gesture-handler");
|
|
10
10
|
var _adoptStyleSheet = require("../styles/adopt-style-sheet.js");
|
|
11
11
|
var _surfaceLevels = require("../styles/surface-levels.js");
|
|
12
|
+
var _index = require("../layout/index.js");
|
|
12
13
|
var _zIndex = require("../styles/z-index.js");
|
|
13
14
|
var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
|
|
14
15
|
var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
|
|
15
16
|
var _edge = require("../layout/edge.js");
|
|
16
|
-
var
|
|
17
|
+
var _index2 = require("../overlay/index.js");
|
|
17
18
|
var _useTheme = require("../theme/use-theme.js");
|
|
18
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
20
|
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); }
|
|
@@ -49,7 +50,7 @@ const BottomSheetBase = exports.BottomSheetBase = /*#__PURE__*/(0, _react.forwar
|
|
|
49
50
|
onDismissAttempt,
|
|
50
51
|
detached = false,
|
|
51
52
|
showHandle = true,
|
|
52
|
-
backdropOpacity =
|
|
53
|
+
backdropOpacity = _index2.BACKDROP_DIM_OPACITY,
|
|
53
54
|
scrollable = true,
|
|
54
55
|
manualActivation = false,
|
|
55
56
|
dynamicBackdrop = false,
|
|
@@ -603,10 +604,16 @@ const BottomSheetBase = exports.BottomSheetBase = /*#__PURE__*/(0, _react.forwar
|
|
|
603
604
|
// — web keeps React context across a portal — would tell its content it is
|
|
604
605
|
// sitting on the panel's card, and in-sheet chrome would paint the column's
|
|
605
606
|
// colour on top of the sheet's.
|
|
607
|
+
// ...and it is its own SCREEN for the same reason: a header inside the sheet
|
|
608
|
+
// must claim the sheet's top edge rather than the page's, and chrome inside
|
|
609
|
+
// it must follow the sheet's scroller rather than `window.scrollY`
|
|
610
|
+
// (`layout/screen-scope.tsx`).
|
|
606
611
|
const surfaceChildren = /*#__PURE__*/(0, _jsxRuntime.jsx)(_surfaceLevels.SurfaceLevelProvider, {
|
|
607
612
|
level: 0,
|
|
608
613
|
fill: colors.background,
|
|
609
|
-
children:
|
|
614
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ScreenScope, {
|
|
615
|
+
children: children
|
|
616
|
+
})
|
|
610
617
|
});
|
|
611
618
|
|
|
612
619
|
// Inner content: scrollable wraps in Animated.ScrollView, non-scrollable
|
|
@@ -660,7 +667,7 @@ const BottomSheetBase = exports.BottomSheetBase = /*#__PURE__*/(0, _react.forwar
|
|
|
660
667
|
// `backdropStyle` drives the fade; the dim level rides on
|
|
661
668
|
// `backdropOpacity`, so the shared component's own dim is
|
|
662
669
|
// switched off here to keep a single source of dimming.
|
|
663
|
-
(0, _jsxRuntime.jsx)(
|
|
670
|
+
(0, _jsxRuntime.jsx)(_index2.Backdrop, {
|
|
664
671
|
onPress: handleBackdropPress
|
|
665
672
|
// `progress` is the FADE (0 → 1, folding the drag);
|
|
666
673
|
// how dark the backdrop gets is `backdropOpacity`,
|