@oxy.so/bloom 2.12.4 → 3.0.1
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 +4 -4
- package/docs/button-group.mdx +46 -4
- package/docs/composition.mdx +159 -0
- package/docs/field.mdx +39 -1
- package/docs/glass.mdx +61 -0
- package/docs/layout.mdx +72 -4
- package/docs/migrating-to-3.0.mdx +169 -0
- package/docs/page-header.mdx +237 -36
- package/lib/commonjs/button/Button.js +2 -0
- package/lib/commonjs/button/Button.js.map +1 -1
- package/lib/commonjs/button-group/ButtonGroup.js +124 -19
- package/lib/commonjs/button-group/ButtonGroup.js.map +1 -1
- package/lib/commonjs/control-surface/ControlSurface.js +46 -0
- package/lib/commonjs/control-surface/ControlSurface.js.map +1 -0
- package/lib/commonjs/control-surface/context.js +84 -0
- package/lib/commonjs/control-surface/context.js.map +1 -0
- package/lib/commonjs/control-surface/index.js +26 -0
- package/lib/commonjs/control-surface/index.js.map +1 -0
- package/lib/commonjs/control-surface/types.js +6 -0
- package/lib/commonjs/control-surface/types.js.map +1 -0
- package/lib/commonjs/field/Field.js +71 -26
- package/lib/commonjs/field/Field.js.map +1 -1
- package/lib/commonjs/field/context.js +80 -0
- package/lib/commonjs/field/context.js.map +1 -0
- package/lib/commonjs/field/index.js +7 -0
- package/lib/commonjs/field/index.js.map +1 -1
- package/lib/commonjs/floating/TriggerSlot.js +32 -0
- package/lib/commonjs/floating/TriggerSlot.js.map +1 -1
- package/lib/commonjs/glass/GlassIsland.js +107 -0
- package/lib/commonjs/glass/GlassIsland.js.map +1 -0
- package/lib/commonjs/glass/GlassSurface.js +4 -1
- package/lib/commonjs/glass/GlassSurface.js.map +1 -1
- package/lib/commonjs/glass/index.js +7 -0
- package/lib/commonjs/glass/index.js.map +1 -1
- package/lib/commonjs/index.js +564 -517
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js +564 -517
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/commonjs/label/Label.js +4 -1
- package/lib/commonjs/label/Label.js.map +1 -1
- package/lib/commonjs/layout/bottom-edge.js +3 -42
- package/lib/commonjs/layout/bottom-edge.js.map +1 -1
- package/lib/commonjs/layout/edge-store.js +65 -0
- package/lib/commonjs/layout/edge-store.js.map +1 -0
- package/lib/commonjs/layout/index.js +32 -0
- package/lib/commonjs/layout/index.js.map +1 -1
- package/lib/commonjs/layout/scroll-offset.js +83 -0
- package/lib/commonjs/layout/scroll-offset.js.map +1 -0
- package/lib/commonjs/layout/top-edge.js +109 -0
- package/lib/commonjs/layout/top-edge.js.map +1 -0
- package/lib/commonjs/page-header/EdgeScrim.js +136 -0
- package/lib/commonjs/page-header/EdgeScrim.js.map +1 -0
- package/lib/commonjs/page-header/PageHeader.js +236 -61
- package/lib/commonjs/page-header/PageHeader.js.map +1 -1
- package/lib/commonjs/provider/BloomProvider.js +5 -2
- package/lib/commonjs/provider/BloomProvider.js.map +1 -1
- package/lib/commonjs/social-button/OxyMark.js +2 -2
- package/lib/commonjs/social-button/OxyMark.js.map +1 -1
- package/lib/commonjs/social-button/SocialButton.js +2 -2
- package/lib/commonjs/social-button/SocialButton.js.map +1 -1
- package/lib/commonjs/styles/svg-id.js +29 -0
- package/lib/commonjs/styles/svg-id.js.map +1 -0
- package/lib/commonjs/text-field/TextField.js +39 -6
- package/lib/commonjs/text-field/TextField.js.map +1 -1
- package/lib/commonjs/theme/glass-colors.js +81 -1
- package/lib/commonjs/theme/glass-colors.js.map +1 -1
- package/lib/module/button/Button.js +2 -0
- package/lib/module/button/Button.js.map +1 -1
- package/lib/module/button-group/ButtonGroup.js +124 -19
- package/lib/module/button-group/ButtonGroup.js.map +1 -1
- package/lib/module/control-surface/ControlSurface.js +41 -0
- package/lib/module/control-surface/ControlSurface.js.map +1 -0
- package/lib/module/control-surface/context.js +77 -0
- package/lib/module/control-surface/context.js.map +1 -0
- package/lib/module/control-surface/index.js +5 -0
- package/lib/module/control-surface/index.js.map +1 -0
- package/lib/module/control-surface/types.js +4 -0
- package/lib/module/control-surface/types.js.map +1 -0
- package/lib/module/field/Field.js +72 -27
- package/lib/module/field/Field.js.map +1 -1
- package/lib/module/field/context.js +74 -0
- package/lib/module/field/context.js.map +1 -0
- package/lib/module/field/index.js +1 -0
- package/lib/module/field/index.js.map +1 -1
- package/lib/module/floating/TriggerSlot.js +33 -1
- package/lib/module/floating/TriggerSlot.js.map +1 -1
- package/lib/module/glass/GlassIsland.js +102 -0
- package/lib/module/glass/GlassIsland.js.map +1 -0
- package/lib/module/glass/GlassSurface.js +5 -2
- package/lib/module/glass/GlassSurface.js.map +1 -1
- package/lib/module/glass/index.js +1 -0
- package/lib/module/glass/index.js.map +1 -1
- package/lib/module/index.js +2 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +2 -1
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/label/Label.js +4 -1
- package/lib/module/label/Label.js.map +1 -1
- package/lib/module/layout/bottom-edge.js +2 -41
- package/lib/module/layout/bottom-edge.js.map +1 -1
- package/lib/module/layout/edge-store.js +58 -0
- package/lib/module/layout/edge-store.js.map +1 -0
- package/lib/module/layout/index.js +8 -3
- package/lib/module/layout/index.js.map +1 -1
- package/lib/module/layout/scroll-offset.js +77 -0
- package/lib/module/layout/scroll-offset.js.map +1 -0
- package/lib/module/layout/top-edge.js +102 -0
- package/lib/module/layout/top-edge.js.map +1 -0
- package/lib/module/page-header/EdgeScrim.js +132 -0
- package/lib/module/page-header/EdgeScrim.js.map +1 -0
- package/lib/module/page-header/PageHeader.js +233 -58
- package/lib/module/page-header/PageHeader.js.map +1 -1
- package/lib/module/provider/BloomProvider.js +5 -2
- package/lib/module/provider/BloomProvider.js.map +1 -1
- package/lib/module/social-button/OxyMark.js +1 -1
- package/lib/module/social-button/OxyMark.js.map +1 -1
- package/lib/module/social-button/SocialButton.js +1 -1
- package/lib/module/social-button/SocialButton.js.map +1 -1
- package/lib/module/styles/svg-id.js +26 -0
- package/lib/module/styles/svg-id.js.map +1 -0
- package/lib/module/text-field/TextField.js +39 -6
- package/lib/module/text-field/TextField.js.map +1 -1
- package/lib/module/theme/glass-colors.js +79 -0
- package/lib/module/theme/glass-colors.js.map +1 -1
- package/lib/typescript/commonjs/button/Button.d.ts.map +1 -1
- package/lib/typescript/commonjs/button-group/ButtonGroup.d.ts.map +1 -1
- package/lib/typescript/commonjs/button-group/types.d.ts +61 -5
- package/lib/typescript/commonjs/button-group/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/control-surface/ControlSurface.d.ts +4 -0
- package/lib/typescript/commonjs/control-surface/ControlSurface.d.ts.map +1 -0
- package/lib/typescript/commonjs/control-surface/context.d.ts +21 -0
- package/lib/typescript/commonjs/control-surface/context.d.ts.map +1 -0
- package/lib/typescript/commonjs/control-surface/index.d.ts +4 -0
- package/lib/typescript/commonjs/control-surface/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/control-surface/types.d.ts +37 -0
- package/lib/typescript/commonjs/control-surface/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/field/Field.d.ts +1 -1
- package/lib/typescript/commonjs/field/Field.d.ts.map +1 -1
- package/lib/typescript/commonjs/field/context.d.ts +55 -0
- package/lib/typescript/commonjs/field/context.d.ts.map +1 -0
- 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/types.d.ts +22 -3
- package/lib/typescript/commonjs/field/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/floating/TriggerSlot.d.ts.map +1 -1
- package/lib/typescript/commonjs/glass/GlassIsland.d.ts +4 -0
- package/lib/typescript/commonjs/glass/GlassIsland.d.ts.map +1 -0
- package/lib/typescript/commonjs/glass/GlassSurface.d.ts.map +1 -1
- package/lib/typescript/commonjs/glass/index.d.ts +2 -1
- package/lib/typescript/commonjs/glass/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/glass/types.d.ts +43 -0
- package/lib/typescript/commonjs/glass/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +2 -1
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.web.d.ts +2 -1
- package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/label/Label.d.ts.map +1 -1
- package/lib/typescript/commonjs/label/types.d.ts +7 -1
- package/lib/typescript/commonjs/label/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/layout/bottom-edge.d.ts.map +1 -1
- package/lib/typescript/commonjs/layout/edge-store.d.ts +31 -0
- package/lib/typescript/commonjs/layout/edge-store.d.ts.map +1 -0
- package/lib/typescript/commonjs/layout/index.d.ts +8 -3
- package/lib/typescript/commonjs/layout/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/layout/scroll-offset.d.ts +16 -0
- package/lib/typescript/commonjs/layout/scroll-offset.d.ts.map +1 -0
- package/lib/typescript/commonjs/layout/top-edge.d.ts +77 -0
- package/lib/typescript/commonjs/layout/top-edge.d.ts.map +1 -0
- package/lib/typescript/commonjs/page-header/EdgeScrim.d.ts +95 -0
- package/lib/typescript/commonjs/page-header/EdgeScrim.d.ts.map +1 -0
- package/lib/typescript/commonjs/page-header/PageHeader.d.ts +1 -1
- package/lib/typescript/commonjs/page-header/PageHeader.d.ts.map +1 -1
- package/lib/typescript/commonjs/page-header/index.d.ts +1 -1
- package/lib/typescript/commonjs/page-header/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/page-header/types.d.ts +97 -10
- package/lib/typescript/commonjs/page-header/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/provider/BloomProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/styles/svg-id.d.ts +20 -0
- package/lib/typescript/commonjs/styles/svg-id.d.ts.map +1 -0
- package/lib/typescript/commonjs/text-field/TextField.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/glass-colors.d.ts +67 -0
- package/lib/typescript/commonjs/theme/glass-colors.d.ts.map +1 -1
- package/lib/typescript/module/button/Button.d.ts.map +1 -1
- package/lib/typescript/module/button-group/ButtonGroup.d.ts.map +1 -1
- package/lib/typescript/module/button-group/types.d.ts +61 -5
- package/lib/typescript/module/button-group/types.d.ts.map +1 -1
- package/lib/typescript/module/control-surface/ControlSurface.d.ts +4 -0
- package/lib/typescript/module/control-surface/ControlSurface.d.ts.map +1 -0
- package/lib/typescript/module/control-surface/context.d.ts +21 -0
- package/lib/typescript/module/control-surface/context.d.ts.map +1 -0
- package/lib/typescript/module/control-surface/index.d.ts +4 -0
- package/lib/typescript/module/control-surface/index.d.ts.map +1 -0
- package/lib/typescript/module/control-surface/types.d.ts +37 -0
- package/lib/typescript/module/control-surface/types.d.ts.map +1 -0
- package/lib/typescript/module/field/Field.d.ts +1 -1
- package/lib/typescript/module/field/Field.d.ts.map +1 -1
- package/lib/typescript/module/field/context.d.ts +55 -0
- package/lib/typescript/module/field/context.d.ts.map +1 -0
- 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/types.d.ts +22 -3
- package/lib/typescript/module/field/types.d.ts.map +1 -1
- package/lib/typescript/module/floating/TriggerSlot.d.ts.map +1 -1
- package/lib/typescript/module/glass/GlassIsland.d.ts +4 -0
- package/lib/typescript/module/glass/GlassIsland.d.ts.map +1 -0
- package/lib/typescript/module/glass/GlassSurface.d.ts.map +1 -1
- package/lib/typescript/module/glass/index.d.ts +2 -1
- package/lib/typescript/module/glass/index.d.ts.map +1 -1
- package/lib/typescript/module/glass/types.d.ts +43 -0
- package/lib/typescript/module/glass/types.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +2 -1
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/index.web.d.ts +2 -1
- package/lib/typescript/module/index.web.d.ts.map +1 -1
- package/lib/typescript/module/label/Label.d.ts.map +1 -1
- package/lib/typescript/module/label/types.d.ts +7 -1
- package/lib/typescript/module/label/types.d.ts.map +1 -1
- package/lib/typescript/module/layout/bottom-edge.d.ts.map +1 -1
- package/lib/typescript/module/layout/edge-store.d.ts +31 -0
- package/lib/typescript/module/layout/edge-store.d.ts.map +1 -0
- package/lib/typescript/module/layout/index.d.ts +8 -3
- package/lib/typescript/module/layout/index.d.ts.map +1 -1
- package/lib/typescript/module/layout/scroll-offset.d.ts +16 -0
- package/lib/typescript/module/layout/scroll-offset.d.ts.map +1 -0
- package/lib/typescript/module/layout/top-edge.d.ts +77 -0
- package/lib/typescript/module/layout/top-edge.d.ts.map +1 -0
- package/lib/typescript/module/page-header/EdgeScrim.d.ts +95 -0
- package/lib/typescript/module/page-header/EdgeScrim.d.ts.map +1 -0
- package/lib/typescript/module/page-header/PageHeader.d.ts +1 -1
- package/lib/typescript/module/page-header/PageHeader.d.ts.map +1 -1
- package/lib/typescript/module/page-header/index.d.ts +1 -1
- package/lib/typescript/module/page-header/index.d.ts.map +1 -1
- package/lib/typescript/module/page-header/types.d.ts +97 -10
- package/lib/typescript/module/page-header/types.d.ts.map +1 -1
- package/lib/typescript/module/provider/BloomProvider.d.ts.map +1 -1
- package/lib/typescript/module/styles/svg-id.d.ts +20 -0
- package/lib/typescript/module/styles/svg-id.d.ts.map +1 -0
- package/lib/typescript/module/text-field/TextField.d.ts.map +1 -1
- package/lib/typescript/module/theme/glass-colors.d.ts +67 -0
- package/lib/typescript/module/theme/glass-colors.d.ts.map +1 -1
- package/package.json +15 -1
- package/src/button/Button.tsx +10 -1
- package/src/button-group/ButtonGroup.tsx +146 -19
- package/src/button-group/types.ts +68 -5
- package/src/control-surface/ControlSurface.tsx +41 -0
- package/src/control-surface/context.ts +81 -0
- package/src/control-surface/index.ts +4 -0
- package/src/control-surface/types.ts +40 -0
- package/src/field/Field.tsx +84 -27
- package/src/field/context.ts +110 -0
- package/src/field/index.ts +3 -0
- package/src/field/types.ts +22 -3
- package/src/floating/TriggerSlot.tsx +35 -1
- package/src/glass/GlassIsland.tsx +109 -0
- package/src/glass/GlassSurface.tsx +26 -2
- package/src/glass/index.ts +3 -0
- package/src/glass/types.ts +45 -0
- package/src/index.ts +6 -0
- package/src/index.web.ts +6 -0
- package/src/label/Label.tsx +3 -1
- package/src/label/types.ts +7 -1
- package/src/layout/bottom-edge.tsx +3 -56
- package/src/layout/edge-store.ts +69 -0
- package/src/layout/index.ts +8 -3
- package/src/layout/scroll-offset.ts +76 -0
- package/src/layout/top-edge.tsx +109 -0
- package/src/page-header/EdgeScrim.tsx +118 -0
- package/src/page-header/PageHeader.tsx +253 -61
- package/src/page-header/index.ts +9 -1
- package/src/page-header/types.ts +103 -10
- package/src/provider/BloomProvider.tsx +12 -1
- package/src/social-button/OxyMark.tsx +1 -1
- package/src/social-button/SocialButton.tsx +1 -1
- package/src/styles/svg-id.ts +23 -0
- package/src/text-field/TextField.tsx +44 -5
- package/src/theme/glass-colors.ts +80 -0
- package/lib/commonjs/social-button/use-svg-id.js +0 -16
- package/lib/commonjs/social-button/use-svg-id.js.map +0 -1
- package/lib/module/social-button/use-svg-id.js +0 -13
- package/lib/module/social-button/use-svg-id.js.map +0 -1
- package/lib/typescript/commonjs/social-button/use-svg-id.d.ts +0 -7
- package/lib/typescript/commonjs/social-button/use-svg-id.d.ts.map +0 -1
- package/lib/typescript/module/social-button/use-svg-id.d.ts +0 -7
- package/lib/typescript/module/social-button/use-svg-id.d.ts.map +0 -1
- package/src/social-button/use-svg-id.ts +0 -10
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The floating header's EDGE EFFECT: the page colour at the top, fading to
|
|
4
|
+
* nothing below the islands.
|
|
5
|
+
*
|
|
6
|
+
* ── WHY IT IS A GRADIENT AND NOT A BLUR ─────────────────────────────────────
|
|
7
|
+
*
|
|
8
|
+
* It is the thing that lets a title sit on a photograph and still be read, and
|
|
9
|
+
* it has exactly one job: no horizontal line anywhere. A translucent rectangle
|
|
10
|
+
* — even a blurred one — ends at its own bottom edge, and that edge is a line
|
|
11
|
+
* across the screen whether or not it is drawn. Apple's scroll edge effect is
|
|
12
|
+
* described the same way: it protects legibility at the edge and must not read
|
|
13
|
+
* as a slab over the content.
|
|
14
|
+
*
|
|
15
|
+
* It is NOT a blur of varying intensity, and saying so matters because the two
|
|
16
|
+
* are easy to conflate and only one of them is here. `backdrop-filter` and
|
|
17
|
+
* `expo-blur` both take a single radius for the whole surface; a falloff would
|
|
18
|
+
* need the ten stacked layers `progressive-blur` uses, which is a real cost for
|
|
19
|
+
* a strip this size. This is an opacity ramp of one flat colour, and that is
|
|
20
|
+
* all it claims to be.
|
|
21
|
+
*
|
|
22
|
+
* ── THE STOPS ───────────────────────────────────────────────────────────────
|
|
23
|
+
*
|
|
24
|
+
* Four of them, shaped as an ease-out rather than a straight line. A LINEAR
|
|
25
|
+
* ramp of opacity is perceptually not linear: it holds too much colour through
|
|
26
|
+
* the middle and then falls off visibly in the last fifth, which puts a soft
|
|
27
|
+
* but findable band across the content. Weighting the fall earlier spends the
|
|
28
|
+
* gradient's height where the eye is looking — the region behind the title —
|
|
29
|
+
* and arrives at zero gently.
|
|
30
|
+
*
|
|
31
|
+
* `TAIL_RATIO` extends the ramp BELOW the header's own box. The header is as
|
|
32
|
+
* tall as its islands plus its padding; the fade needs room after that, or it
|
|
33
|
+
* finishes at the same place the layout does, which is the line again.
|
|
34
|
+
*
|
|
35
|
+
* ── `stopOpacity`, NOT AN `rgba()` STOP ─────────────────────────────────────
|
|
36
|
+
*
|
|
37
|
+
* `react-native-svg` parses `stopColor` for its RGB and DISCARDS the alpha
|
|
38
|
+
* channel, so an `rgba(…, 0.4)` stop renders at FULL strength on native and
|
|
39
|
+
* correctly on web. That is the exact defect documented on `GLASS_SHEEN` in
|
|
40
|
+
* `theme/glass-colors.ts`, where it painted an Android pane as an achromatic
|
|
41
|
+
* white-to-black wipe while every gate stayed green. The colour and the opacity
|
|
42
|
+
* travel here in separate props for the same reason.
|
|
43
|
+
*
|
|
44
|
+
* ── `width="100%"` IS NOT REDUNDANT ─────────────────────────────────────────
|
|
45
|
+
*
|
|
46
|
+
* An `<svg>` is a REPLACED element. With `width: auto` its used width is its
|
|
47
|
+
* INTRINSIC width, and an SVG with no intrinsic size falls back to CSS's
|
|
48
|
+
* default 300 x 150 — so `position: absolute; left: 0; right: 0` does NOT
|
|
49
|
+
* stretch it: `right` is over-constrained and dropped. Measured in Chrome
|
|
50
|
+
* before this prop existed: a 760px-wide header painted a 300 x 150 block of
|
|
51
|
+
* scrim with a hard vertical edge down the middle of the screen, over content
|
|
52
|
+
* that was otherwise untouched.
|
|
53
|
+
*
|
|
54
|
+
* Native is unaffected — react-native-svg lays its host view out with flexbox
|
|
55
|
+
* there — which is exactly why the omission survives review: it is correct on
|
|
56
|
+
* the platform most of this library is tested on. Gate:
|
|
57
|
+
* `src/__tests__/svg-absolute-fill-size.test.ts`.
|
|
58
|
+
*
|
|
59
|
+
* ── THE GRADIENT ID ─────────────────────────────────────────────────────────
|
|
60
|
+
*
|
|
61
|
+
* From `useSvgIdPrefix`, which is `useId` with React's punctuation stripped.
|
|
62
|
+
* Two headers on one page (a split view) must not resolve each other's
|
|
63
|
+
* `url(#…)`, and a module-scope counter — which is what `GlassSurface` uses,
|
|
64
|
+
* and which is right for a native-only surface — increments in a different
|
|
65
|
+
* order on the server than during hydration, so an SSR'd page would reference a
|
|
66
|
+
* gradient that is not there.
|
|
67
|
+
*/
|
|
68
|
+
/** How far past the header's own height the fade continues, as a ratio of it. */
|
|
69
|
+
export declare const SCRIM_TAIL_RATIO = 0.55;
|
|
70
|
+
/**
|
|
71
|
+
* Offset down the ramp -> how much of the page colour survives there.
|
|
72
|
+
*
|
|
73
|
+
* Read as: solid behind the title, nine tenths gone by three quarters of the
|
|
74
|
+
* way down, nothing at the bottom.
|
|
75
|
+
*/
|
|
76
|
+
export declare const SCRIM_STOPS: readonly [{
|
|
77
|
+
readonly offset: 0;
|
|
78
|
+
readonly opacity: 1;
|
|
79
|
+
}, {
|
|
80
|
+
readonly offset: 0.42;
|
|
81
|
+
readonly opacity: 0.86;
|
|
82
|
+
}, {
|
|
83
|
+
readonly offset: 0.72;
|
|
84
|
+
readonly opacity: 0.38;
|
|
85
|
+
}, {
|
|
86
|
+
readonly offset: 1;
|
|
87
|
+
readonly opacity: 0;
|
|
88
|
+
}];
|
|
89
|
+
export interface EdgeScrimProps {
|
|
90
|
+
/** The page colour the ramp starts from — opaque, alpha travels separately. */
|
|
91
|
+
color: string;
|
|
92
|
+
testID?: string;
|
|
93
|
+
}
|
|
94
|
+
export declare const EdgeScrim: React.NamedExoticComponent<EdgeScrimProps>;
|
|
95
|
+
//# sourceMappingURL=EdgeScrim.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EdgeScrim.d.ts","sourceRoot":"","sources":["../../../../src/page-header/EdgeScrim.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAe,MAAM,OAAO,CAAC;AAMpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AAEH,iFAAiF;AACjF,eAAO,MAAM,gBAAgB,OAAO,CAAC;AAErC;;;;;GAKG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;EAKd,CAAC;AAEX,MAAM,WAAW,cAAc;IAC7B,+EAA+E;IAC/E,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAuBD,eAAO,MAAM,SAAS,4CAA2B,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { PageHeaderProps } from './types';
|
|
3
|
-
declare function PageHeaderComponent({ title, subtitle, titleAlign, headingLevel, onBack, backLabel, leading, actions, border, transparent, scrollY: externalScrollY, scrollThreshold, sticky, safeArea, style, testID, }: PageHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare function PageHeaderComponent({ title, subtitle, titleAlign, headingLevel, titleReveal, presentation, placement, onBack, backLabel, leading, actions, border, transparent, scrim, scrimColor, scrollY: externalScrollY, scrollThreshold, sticky, safeArea, style, testID, }: PageHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export declare const PageHeader: React.MemoExoticComponent<typeof PageHeaderComponent>;
|
|
5
5
|
export {};
|
|
6
6
|
//# sourceMappingURL=PageHeader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageHeader.d.ts","sourceRoot":"","sources":["../../../../src/page-header/PageHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyD,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"PageHeader.d.ts","sourceRoot":"","sources":["../../../../src/page-header/PageHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyD,MAAM,OAAO,CAAC;AA6B9E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AA8E/C,iBAAS,mBAAmB,CAAC,EAC3B,KAAK,EACL,QAAQ,EACR,UAAoB,EACpB,YAAgB,EAChB,WAAsB,EACtB,YAAyB,EACzB,SAAoB,EACpB,MAAM,EACN,SAAkB,EAClB,OAAO,EACP,OAAO,EACP,MAAe,EACf,WAAmB,EACnB,KAAc,EACd,UAAU,EACV,OAAO,EAAE,eAAe,EACxB,eAAmC,EACnC,MAAa,EACb,QAAQ,EACR,KAAK,EACL,MAAM,GACP,EAAE,eAAe,2CAqTjB;AAuED,eAAO,MAAM,UAAU,uDAA4B,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { PageHeader } from './PageHeader';
|
|
2
|
-
export type { PageHeaderBorder, PageHeaderProps, PageHeaderTitleAlign } from './types';
|
|
2
|
+
export type { PageHeaderBorder, PageHeaderPlacement, PageHeaderPresentation, PageHeaderProps, PageHeaderScrim, PageHeaderTitleAlign, PageHeaderTitleReveal, } from './types';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/page-header/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/page-header/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,YAAY,EACV,gBAAgB,EAChB,mBAAmB,EACnB,sBAAsB,EACtB,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,SAAS,CAAC"}
|
|
@@ -3,11 +3,64 @@ import type { StyleProp, ViewStyle } from 'react-native';
|
|
|
3
3
|
import type { SharedValue } from 'react-native-reanimated';
|
|
4
4
|
/** Where the title sits: after the back button, or centred on the bar. */
|
|
5
5
|
export type PageHeaderTitleAlign = 'start' | 'center';
|
|
6
|
+
/**
|
|
7
|
+
* How the header presents itself.
|
|
8
|
+
*
|
|
9
|
+
* `floating` is the default: no bar at all. The back button sits in its own
|
|
10
|
+
* translucent capsule, related actions share one island, the title floats
|
|
11
|
+
* between them, and the whole thing ends in a soft vertical gradient instead of
|
|
12
|
+
* a horizontal edge. Content passes UNDER it.
|
|
13
|
+
*
|
|
14
|
+
* `bar` is Bloom's original flat header — an opaque full-width strip with a
|
|
15
|
+
* hairline separator and a scroll-linked shadow. It is still the right shape
|
|
16
|
+
* for a dense tool screen, a split-pane sidebar header or anywhere the chrome
|
|
17
|
+
* must not be mistaken for content; it is no longer the default.
|
|
18
|
+
*/
|
|
19
|
+
export type PageHeaderPresentation = 'floating' | 'bar';
|
|
20
|
+
/**
|
|
21
|
+
* Who reserves the space the header occupies.
|
|
22
|
+
*
|
|
23
|
+
* `inline` (default): the header is a sibling ABOVE the content, in a column.
|
|
24
|
+
* It occupies layout, so nothing passes under it and nothing needs padding.
|
|
25
|
+
*
|
|
26
|
+
* `overlay`: the header is absolutely positioned over the content, which starts
|
|
27
|
+
* at the top of the container and scrolls under the islands. The header then
|
|
28
|
+
* CLAIMS its measured height on `layout/top-edge`, and the content reads it
|
|
29
|
+
* with `useTopEdgeInset()` so its first item is not born underneath. This is
|
|
30
|
+
* the placement the floating presentation was designed for; the two are
|
|
31
|
+
* separate props because a floating header above a fixed panel is also a real
|
|
32
|
+
* arrangement.
|
|
33
|
+
*/
|
|
34
|
+
export type PageHeaderPlacement = 'inline' | 'overlay';
|
|
6
35
|
/**
|
|
7
36
|
* The bottom separator: `auto` fades it in once the page has scrolled past
|
|
8
37
|
* `scrollThreshold`, `always` draws it at rest, `none` never draws it.
|
|
38
|
+
*
|
|
39
|
+
* `presentation="bar"` only. A floating header has no edge to separate.
|
|
9
40
|
*/
|
|
10
41
|
export type PageHeaderBorder = 'auto' | 'always' | 'none';
|
|
42
|
+
/**
|
|
43
|
+
* The floating header's edge effect: a vertical gradient from the page colour
|
|
44
|
+
* to full transparency, behind the title and the islands.
|
|
45
|
+
*
|
|
46
|
+
* `auto` (default) fades it in over `[0, scrollThreshold]` of the scroll
|
|
47
|
+
* offset, so it appears exactly when content starts passing under it. `always`
|
|
48
|
+
* paints it at rest — for a header that is born over a photograph. `none`
|
|
49
|
+
* removes it, which leaves the islands to carry legibility on their own.
|
|
50
|
+
*/
|
|
51
|
+
export type PageHeaderScrim = 'auto' | 'always' | 'none';
|
|
52
|
+
/**
|
|
53
|
+
* When the title is visible.
|
|
54
|
+
*
|
|
55
|
+
* `always` (default) is the ordinary screen header. `onScroll` holds the title
|
|
56
|
+
* back and fades it in with the scrim — the shape a header over a hero photo
|
|
57
|
+
* wants, where the photo already names the screen.
|
|
58
|
+
*
|
|
59
|
+
* It is a prop of its own rather than a side effect of the background, because
|
|
60
|
+
* the two are different questions and conflating them is how every header that
|
|
61
|
+
* turned transparent also lost its title.
|
|
62
|
+
*/
|
|
63
|
+
export type PageHeaderTitleReveal = 'always' | 'onScroll';
|
|
11
64
|
export interface PageHeaderProps {
|
|
12
65
|
/** A string renders as the heading; a node renders as-is (and owns its own semantics). */
|
|
13
66
|
title?: ReactNode;
|
|
@@ -17,6 +70,12 @@ export interface PageHeaderProps {
|
|
|
17
70
|
titleAlign?: PageHeaderTitleAlign;
|
|
18
71
|
/** The title's heading level. Default 1. */
|
|
19
72
|
headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
73
|
+
/** Default `always`. */
|
|
74
|
+
titleReveal?: PageHeaderTitleReveal;
|
|
75
|
+
/** Default `floating`. */
|
|
76
|
+
presentation?: PageHeaderPresentation;
|
|
77
|
+
/** Default `inline`. */
|
|
78
|
+
placement?: PageHeaderPlacement;
|
|
20
79
|
/**
|
|
21
80
|
* Renders the back button and is called when it is pressed. The header is
|
|
22
81
|
* router-agnostic: pass `router.back`, or your app's safe-back helper.
|
|
@@ -26,24 +85,52 @@ export interface PageHeaderProps {
|
|
|
26
85
|
backLabel?: string;
|
|
27
86
|
/** Rendered after the back button, before the title (an avatar, a logo). */
|
|
28
87
|
leading?: ReactNode;
|
|
29
|
-
/**
|
|
88
|
+
/**
|
|
89
|
+
* Rendered at the end of the bar. In the floating presentation this slot is
|
|
90
|
+
* wrapped in a `ControlSurface` with `material: 'glass'`, so a `ButtonGroup`
|
|
91
|
+
* inside it becomes one island with no prop written on it. Declare the
|
|
92
|
+
* grouping yourself — the header never infers it by reading children.
|
|
93
|
+
*/
|
|
30
94
|
actions?: ReactNode;
|
|
31
|
-
/** Default `auto`. */
|
|
95
|
+
/** `presentation="bar"` only. Default `auto`. */
|
|
32
96
|
border?: PageHeaderBorder;
|
|
33
97
|
/**
|
|
34
|
-
*
|
|
35
|
-
* showing at rest
|
|
36
|
-
*
|
|
98
|
+
* `presentation="bar"` only: the bar's background and shadow fade in with
|
|
99
|
+
* scroll instead of showing at rest.
|
|
100
|
+
*
|
|
101
|
+
* It no longer hides the title — that is `titleReveal="onScroll"`, and the
|
|
102
|
+
* two are set independently. A `bar` header that wants the old combined
|
|
103
|
+
* behaviour asks for both.
|
|
37
104
|
*/
|
|
38
105
|
transparent?: boolean;
|
|
106
|
+
/** `presentation="floating"` only. Default `auto`. */
|
|
107
|
+
scrim?: PageHeaderScrim;
|
|
108
|
+
/**
|
|
109
|
+
* The colour the edge effect fades FROM. Defaults to `theme.colors.background`
|
|
110
|
+
* — the page colour, which is what the content scrolling under the header is
|
|
111
|
+
* disappearing into.
|
|
112
|
+
*
|
|
113
|
+
* Pass it when the screen paints a background the theme does not know about:
|
|
114
|
+
* a tinted section, a brand panel, a dark surface inside a light app. The
|
|
115
|
+
* header cannot read the colour behind it, and a scrim in the theme's
|
|
116
|
+
* background over a page in some other colour is a wash of the wrong hue
|
|
117
|
+
* rather than a fade.
|
|
118
|
+
*
|
|
119
|
+
* It must be OPAQUE. The alpha is the ramp's, and a colour that brings its
|
|
120
|
+
* own would multiply with it — `rgba(0,0,0,0.5)` at the ramp's 0.86 paints
|
|
121
|
+
* 0.43 and reads as a weak, dirty veil rather than the colour you asked for.
|
|
122
|
+
*/
|
|
123
|
+
scrimColor?: string;
|
|
39
124
|
/**
|
|
40
|
-
* The scroll offset driving
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
125
|
+
* The scroll offset driving the scrim, the separator and the shadow.
|
|
126
|
+
*
|
|
127
|
+
* Resolution order: this prop, then the nearest `ScrollOffsetProvider`
|
|
128
|
+
* (`@oxy.so/bloom/layout`) — which is how a header inside a Bloom scroll
|
|
129
|
+
* composition gets it with no wiring — then, on web only, `window.scrollY`.
|
|
130
|
+
* On native with none of the three, the header stays at rest.
|
|
44
131
|
*/
|
|
45
132
|
scrollY?: SharedValue<number>;
|
|
46
|
-
/** The offset (px) over which
|
|
133
|
+
/** The offset (px) over which the scrim, separator and shadow fade in. Default 20. */
|
|
47
134
|
scrollThreshold?: number;
|
|
48
135
|
/** Web only: pin the bar to the top of its scroll container. Default true. */
|
|
49
136
|
sticky?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/page-header/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,0EAA0E;AAC1E,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEtD
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/page-header/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,0EAA0E;AAC1E,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEtD;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,sBAAsB,GAAG,UAAU,GAAG,KAAK,CAAC;AAExD;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE1D;;;;;;;;GAQG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEzD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,qBAAqB,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE1D,MAAM,WAAW,eAAe;IAC9B,0FAA0F;IAC1F,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,kFAAkF;IAClF,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,uBAAuB;IACvB,UAAU,CAAC,EAAE,oBAAoB,CAAC;IAClC,4CAA4C;IAC5C,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACrC,wBAAwB;IACxB,WAAW,CAAC,EAAE,qBAAqB,CAAC;IAEpC,0BAA0B;IAC1B,YAAY,CAAC,EAAE,sBAAsB,CAAC;IACtC,wBAAwB;IACxB,SAAS,CAAC,EAAE,mBAAmB,CAAC;IAEhC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,4EAA4E;IAC5E,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IAEpB,iDAAiD;IACjD,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,sDAAsD;IACtD,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB;;;;;;;;;;;;;;OAcG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC9B,sFAAsF;IACtF,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,8EAA8E;IAC9E,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,gFAAgF;IAChF,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BloomProvider.d.ts","sourceRoot":"","sources":["../../../../src/provider/BloomProvider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BloomProvider.d.ts","sourceRoot":"","sources":["../../../../src/provider/BloomProvider.tsx"],"names":[],"mappings":"AA4CA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,aAAa,EACb,OAAc,EACd,GAAG,UAAU,EACd,EAAE,kBAAkB,2CA8CpB;yBAnDe,aAAa"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A DOM-safe id prefix, per component instance.
|
|
3
|
+
*
|
|
4
|
+
* Two SVGs of one shape on a page must not resolve each other's `url(#…)`, and
|
|
5
|
+
* React's `useId` carries characters an SVG id cannot (`:r0:`). Stripping them
|
|
6
|
+
* keeps the id UNIQUE — `useId` is unique per instance before the strip and the
|
|
7
|
+
* strip is injective over React's own alphabet — while staying a legal XML name.
|
|
8
|
+
*
|
|
9
|
+
* It is `useId` rather than a module-scope counter for one reason a counter
|
|
10
|
+
* cannot give: SSR. A counter increments in a different order on the server than
|
|
11
|
+
* during hydration, so the markup React sends and the markup it re-renders
|
|
12
|
+
* reference different gradients and one of them is not there. `useId` is the
|
|
13
|
+
* hook React added for exactly this and is stable across the two passes.
|
|
14
|
+
*
|
|
15
|
+
* Lives in `styles/` rather than beside its first caller because it now has
|
|
16
|
+
* three (`social-button`'s mark and button, `page-header`'s edge gradient) —
|
|
17
|
+
* the second real need is the bar for extracting it, and this cleared it.
|
|
18
|
+
*/
|
|
19
|
+
export declare function useSvgIdPrefix(prefix: string): string;
|
|
20
|
+
//# sourceMappingURL=svg-id.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg-id.d.ts","sourceRoot":"","sources":["../../../../src/styles/svg-id.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAErD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../../../src/text-field/TextField.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,kBAAkB,EAQxB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../../../src/text-field/TextField.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,kBAAkB,EAQxB,MAAM,cAAc,CAAC;AAOtB,OAAO,EAML,KAAK,aAAa,EACnB,MAAM,WAAW,CAAC;AAGnB,OAAO,EAmBL,KAAK,aAAa,EACnB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EACV,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,cAAc,EACf,MAAM,SAAS,CAAC;AAkCjB;;;;;;;;GAQG;AACH,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,aAAa,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;CACnB;AACD,eAAO,MAAM,qBAAqB,4DAAyD,CAAC;AAiD5F,wBAAgB,SAAS,CAAC,EACxB,QAAQ,EACR,SAAS,EAAE,aAAqB,EAChC,QAAQ,EAAE,YAAoB,EAC9B,IAAI,EAAE,QAAmB,EACzB,MAA0B,EAC1B,YAAY,EACZ,KAAK,GACN,EAAE,cAAc,2CA6EhB;AAsFD,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,WAAW,EACX,KAAK,EACL,YAAY,EACZ,OAAO,EACP,MAAM,EACN,SAAS,EACT,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,aAAqB,EACrB,GAAG,IAAI,EACR,EAAE,mBAAmB,2CA8LrB;AAmKD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,QAAQ,EACR,QAAgB,EAChB,OAAe,EACf,KAAK,GACN,EAAE,mBAAmB,2CA6BrB;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,SAAiB,EACjB,QAAQ,EACR,KAAK,GACN,EAAE,kBAAkB,2CAkBpB;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,QAAoB,EAAE,EAAE,kBAAkB,2CA4BrF;AAED,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,KAAK,EACL,iBAAiB,EACjB,KAAK,GACN,EAAE,KAAK,CAAC,iBAAiB,CACxB,aAAa,GAAG;IACd,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,CAAC,EAAE,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;CAC7D,CACF,2CAyBA;AAED,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf,2CAqCA"}
|
|
@@ -192,4 +192,71 @@ export interface GlassColors {
|
|
|
192
192
|
* and pins both on every alpha or surface change.
|
|
193
193
|
*/
|
|
194
194
|
export declare function resolveGlassColors(fill: string): GlassColors;
|
|
195
|
+
/**
|
|
196
|
+
* The CHROME alpha — the neutral counterpart of {@link GLASS_FILL_ALPHA}.
|
|
197
|
+
*
|
|
198
|
+
* ── WHY A SECOND ALPHA AND NOT THE SAME ONE ─────────────────────────────────
|
|
199
|
+
*
|
|
200
|
+
* {@link GLASS_FILL_ALPHA} prices a BRAND fill: a `primary` button whose label
|
|
201
|
+
* is that fill's own on-colour, sitting on one of Bloom's five neutral
|
|
202
|
+
* surfaces. A page header's island is neither of those things. It is a NEUTRAL
|
|
203
|
+
* surface off the existing ladder (`styles/surface-levels`, rung 1 — the same
|
|
204
|
+
* fill a card and a menu panel paint) and it floats over content Bloom does not
|
|
205
|
+
* own: a photograph, a video still, a map, a list that scrolls under it. Its
|
|
206
|
+
* label is the theme's own `text`, not an on-fill token.
|
|
207
|
+
*
|
|
208
|
+
* So the two materials are priced against different backdrops, and the number
|
|
209
|
+
* that is right for one is wrong for the other in a measurable direction:
|
|
210
|
+
*
|
|
211
|
+
* brand fill backdrop ∈ Bloom's own five surfaces worst case: light mode,
|
|
212
|
+
* a white-ish page LIFTS
|
|
213
|
+
* the pane under a white
|
|
214
|
+
* label
|
|
215
|
+
* chrome fill backdrop ∈ [black, white] — anything worst case: DARK mode
|
|
216
|
+
* over a WHITE backdrop,
|
|
217
|
+
* which lifts a dark pane
|
|
218
|
+
* under a white label
|
|
219
|
+
*
|
|
220
|
+
* That is why dark carries the HIGHER alpha here and light the lower one, which
|
|
221
|
+
* is the opposite of the intuition that a dark UI can afford more transparency.
|
|
222
|
+
* A dark island has the whole luminance range above it to be washed out INTO; a
|
|
223
|
+
* light island over the same white backdrop barely moves, because it is already
|
|
224
|
+
* near white.
|
|
225
|
+
*
|
|
226
|
+
* ── WHAT THESE TWO VALUES BUY ───────────────────────────────────────────────
|
|
227
|
+
*
|
|
228
|
+
* Measured over 64 presets x the two extremes of the backdrop range, with the
|
|
229
|
+
* theme's own `text` as the label, in `theme/__tests__/glass-colors.test.ts`.
|
|
230
|
+
* The gate pins the floors EXACTLY, in both directions, so a hundredth in
|
|
231
|
+
* either direction has to be a decision:
|
|
232
|
+
*
|
|
233
|
+
* light 0.72 worst AA ratio over the range …pinned by the gate
|
|
234
|
+
* dark 0.80 worst AA ratio over the range …pinned by the gate
|
|
235
|
+
*
|
|
236
|
+
* and both remain genuinely translucent: the gate also measures how far the
|
|
237
|
+
* PAINTED pane moves between a black and a white backdrop, asserts that
|
|
238
|
+
* movement is non-zero, and asserts it is monotonic in the alpha — so an alpha
|
|
239
|
+
* quietly raised to 1.0 to buy contrast fails on the translucency side rather
|
|
240
|
+
* than passing on the legibility side.
|
|
241
|
+
*/
|
|
242
|
+
export declare const GLASS_CHROME_ALPHA: {
|
|
243
|
+
readonly light: 0.72;
|
|
244
|
+
readonly dark: 0.8;
|
|
245
|
+
};
|
|
246
|
+
/**
|
|
247
|
+
* Resolve the pane around a NEUTRAL chrome fill — an island of controls
|
|
248
|
+
* floating over content.
|
|
249
|
+
*
|
|
250
|
+
* Both arguments are resolved colour strings the caller already holds, for the
|
|
251
|
+
* same reason {@link resolveGlassColors} takes one: the caller is the only one
|
|
252
|
+
* who knows which rung of the surface ladder its container sits on. In practice
|
|
253
|
+
* that is `resolveSurfaceLevel(theme, 1)` — `.background` for `fill`, `.border`
|
|
254
|
+
* for `hairline` — which is the fill a card and a menu panel already paint, so
|
|
255
|
+
* an island reads as Bloom chrome rather than as a fourth material.
|
|
256
|
+
*
|
|
257
|
+
* The LABEL is not returned, exactly as in `resolveGlassColors`: a neutral pane
|
|
258
|
+
* carries the theme's own `text`, and the rungs under it come from
|
|
259
|
+
* `surfaceTextOn(theme, fill)` — the caller is already holding both.
|
|
260
|
+
*/
|
|
261
|
+
export declare function resolveChromeGlassColors(fill: string, hairline: string, isDark: boolean): GlassColors;
|
|
195
262
|
//# sourceMappingURL=glass-colors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glass-colors.d.ts","sourceRoot":"","sources":["../../../../src/theme/glass-colors.ts"],"names":[],"mappings":"AAyEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,eAAO,MAAM,gBAAgB,OAAO,CAAC;AAErC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;IAItB,0EAA0E;;CAElE,CAAC;AAEX,wFAAwF;AACxF,MAAM,MAAM,cAAc,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAElF,iEAAiE;AACjE,wBAAgB,aAAa,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAE1D;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,mBAAmB,6CAA6C,CAAC;AAE9E,oFAAoF;AACpF,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,eAAoC,CAAC;AAEnE;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,QAA4K,CAAC;AAE9M;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,oBAAoB,QAA6B,CAAC;AAE/D,MAAM,WAAW,WAAW;IAC1B,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAC;IACb,mFAAmF;IACnF,QAAQ,EAAE,MAAM,CAAC;IACjB,oFAAoF;IACpF,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAM5D"}
|
|
1
|
+
{"version":3,"file":"glass-colors.d.ts","sourceRoot":"","sources":["../../../../src/theme/glass-colors.ts"],"names":[],"mappings":"AAyEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,eAAO,MAAM,gBAAgB,OAAO,CAAC;AAErC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;IAItB,0EAA0E;;CAElE,CAAC;AAEX,wFAAwF;AACxF,MAAM,MAAM,cAAc,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAElF,iEAAiE;AACjE,wBAAgB,aAAa,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAE1D;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,mBAAmB,6CAA6C,CAAC;AAE9E,oFAAoF;AACpF,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,eAAoC,CAAC;AAEnE;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,QAA4K,CAAC;AAE9M;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,oBAAoB,QAA6B,CAAC;AAE/D,MAAM,WAAW,WAAW;IAC1B,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAC;IACb,mFAAmF;IACnF,QAAQ,EAAE,MAAM,CAAC;IACjB,oFAAoF;IACpF,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAM5D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,eAAO,MAAM,kBAAkB;;;CAAsC,CAAC;AAEtE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,OAAO,GACd,WAAW,CAUb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4C,MAAM,OAAO,CAAC;AAgCjE,OAAO,KAAK,EAAE,WAAW,EAAiB,eAAe,EAAE,MAAM,SAAS,CAAC;AAE3E,YAAY,EACV,WAAW,EACX,aAAa,EACb,UAAU,EACV,mBAAmB,EACnB,cAAc,EACd,eAAe,GAChB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4C,MAAM,OAAO,CAAC;AAgCjE,OAAO,KAAK,EAAE,WAAW,EAAiB,eAAe,EAAE,MAAM,SAAS,CAAC;AAE3E,YAAY,EACV,WAAW,EACX,aAAa,EACb,UAAU,EACV,mBAAmB,EACnB,cAAc,EACd,eAAe,GAChB,MAAM,SAAS,CAAC;AA6VjB,eAAO,MAAM,MAAM,yCAAwB,CAAC;AAG5C,eAAO,MAAM,aAAa,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEpE,CAAC;AAGH,eAAO,MAAM,eAAe,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEtE,CAAC;AAGH,eAAO,MAAM,UAAU,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEjE,CAAC;AAGH,eAAO,MAAM,WAAW,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAElE,CAAC;AAGH,eAAO,MAAM,aAAa,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEpE,CAAC;AAGH,eAAO,MAAM,UAAU,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEjE,CAAC;AAMH,eAAO,MAAM,aAAa,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEpE,CAAC;AAGH;;;;GAIG;AACH,eAAO,MAAM,UAAU,oDAA4C,eAAe,6CAEhF,CAAC;AAGH,eAAO,MAAM,iBAAiB,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAExE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonGroup.d.ts","sourceRoot":"","sources":["../../../../src/button-group/ButtonGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuF,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ButtonGroup.d.ts","sourceRoot":"","sources":["../../../../src/button-group/ButtonGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuF,MAAM,OAAO,CAAC;AAqB5G,OAAO,KAAK,EAAE,oBAAoB,EAAE,gBAAgB,EAAmB,MAAM,SAAS,CAAC;AA4VvF,eAAO,MAAM,WAAW,8CAA6B,CAAC;AAGtD,eAAO,MAAM,eAAe,kDAAiC,CAAC"}
|
|
@@ -1,23 +1,55 @@
|
|
|
1
|
-
import type { StyleProp, ViewStyle } from 'react-native';
|
|
1
|
+
import type { GestureResponderEvent, StyleProp, ViewStyle } from 'react-native';
|
|
2
|
+
import type { ControlMaterial } from '../control-surface/types';
|
|
2
3
|
import type { ButtonIconComponent } from '../button/types';
|
|
4
|
+
import type { WebAriaProps } from '../styles/styled-primitives';
|
|
3
5
|
/** The two group sizes: 34px (`medium`) and 30px (`small`) items. */
|
|
4
6
|
export type ButtonGroupSize = 'medium' | 'small';
|
|
5
7
|
export interface ButtonGroupProps {
|
|
6
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* The material the group paints: `solid` (an opaque bordered pill, Bloom's
|
|
10
|
+
* default chrome) or `glass` (one translucent island the items sit flush on).
|
|
11
|
+
*
|
|
12
|
+
* Omitted, it is INHERITED from the nearest `ControlSurface` — which is what a
|
|
13
|
+
* `PageHeader`'s action slot mounts — and falls back to `solid`. So a group in
|
|
14
|
+
* a floating header needs no variant written on it, and the same group in a
|
|
15
|
+
* card is solid without one either. Precedence and its limits:
|
|
16
|
+
* `docs/composition.mdx`.
|
|
17
|
+
*/
|
|
18
|
+
variant?: ControlMaterial;
|
|
19
|
+
/**
|
|
20
|
+
* Size for every item that does not set its own. Inherited from the nearest
|
|
21
|
+
* `ControlSurface` when omitted, then `medium`.
|
|
22
|
+
*/
|
|
7
23
|
size?: ButtonGroupSize;
|
|
8
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* Whether to draw the 1px hairlines BETWEEN items.
|
|
26
|
+
*
|
|
27
|
+
* Defaults to `true` for `solid` and `false` for `glass`. A divider is how a
|
|
28
|
+
* solid pill says "these are separate controls, fused"; on a translucent
|
|
29
|
+
* island the press highlight already says it, and a hairline over a moving
|
|
30
|
+
* backdrop reads as an artifact of the material.
|
|
31
|
+
*/
|
|
32
|
+
dividers?: boolean;
|
|
33
|
+
/** `ButtonGroupItem` children. */
|
|
9
34
|
children: React.ReactNode;
|
|
10
|
-
/** Names the group
|
|
35
|
+
/** Names the group. */
|
|
11
36
|
accessibilityLabel?: string;
|
|
12
37
|
style?: StyleProp<ViewStyle>;
|
|
13
38
|
testID?: string;
|
|
14
39
|
}
|
|
15
40
|
export interface ButtonGroupItemProps {
|
|
16
|
-
|
|
41
|
+
/**
|
|
42
|
+
* Press handler. Receives the event, so a handler composed onto this item by
|
|
43
|
+
* an anchored family's `asChild` trigger can `preventDefault()` it — see
|
|
44
|
+
* `floating/TriggerSlot.tsx`.
|
|
45
|
+
*/
|
|
46
|
+
onPress?: (event: GestureResponderEvent) => void;
|
|
17
47
|
/** Label. Ignored when `iconOnly`. */
|
|
18
48
|
children?: React.ReactNode;
|
|
19
49
|
/** Overrides the group's size. */
|
|
20
50
|
size?: ButtonGroupSize;
|
|
51
|
+
/** Overrides the group's material. Rarely needed; the group owns it. */
|
|
52
|
+
variant?: ControlMaterial;
|
|
21
53
|
/** Highlights the item like its hover state and announces it as pressed. */
|
|
22
54
|
selected?: boolean;
|
|
23
55
|
disabled?: boolean;
|
|
@@ -28,6 +60,30 @@ export interface ButtonGroupItemProps {
|
|
|
28
60
|
/** Icon component after the label. */
|
|
29
61
|
trailingIcon?: ButtonIconComponent;
|
|
30
62
|
accessibilityLabel?: string;
|
|
63
|
+
/** Long-press handler, composed by a `ContextMenu` trigger. */
|
|
64
|
+
onLongPress?: (event: GestureResponderEvent) => void;
|
|
65
|
+
/** Set by an anchored family: whether the surface this opens is showing. */
|
|
66
|
+
'aria-expanded'?: boolean;
|
|
67
|
+
/** Set by an anchored family: what kind of surface this opens. */
|
|
68
|
+
'aria-haspopup'?: WebAriaProps['aria-haspopup'];
|
|
69
|
+
/** Set by an anchored family. The item is a `button` either way. */
|
|
70
|
+
accessibilityRole?: 'button';
|
|
71
|
+
/**
|
|
72
|
+
* Extra touch area around the item, in px.
|
|
73
|
+
*
|
|
74
|
+
* NOT set by the group, and deliberately not defaulted: items in a group are
|
|
75
|
+
* adjacent, so slop on one overlaps its neighbour and the press lands on
|
|
76
|
+
* whichever the platform happens to hit-test first. It is for an item that
|
|
77
|
+
* stands ALONE in its own island — a page header's back capsule, where 4px on
|
|
78
|
+
* each side turns the 36pt capsule into a 44pt target with nothing beside it
|
|
79
|
+
* to steal from.
|
|
80
|
+
*/
|
|
81
|
+
hitSlop?: number | {
|
|
82
|
+
top?: number;
|
|
83
|
+
bottom?: number;
|
|
84
|
+
left?: number;
|
|
85
|
+
right?: number;
|
|
86
|
+
};
|
|
31
87
|
style?: StyleProp<ViewStyle>;
|
|
32
88
|
testID?: string;
|
|
33
89
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/button-group/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/button-group/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEhF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,qEAAqE;AACrE,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEjD,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B;;;OAGG;IACH,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kCAAkC;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,uBAAuB;IACvB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACjD,sCAAsC;IACtC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,kCAAkC;IAClC,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,wEAAwE;IACxE,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kFAAkF;IAClF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uEAAuE;IACvE,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAClC,sCAAsC;IACtC,YAAY,CAAC,EAAE,mBAAmB,CAAC;IACnC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAW5B,+DAA+D;IAC/D,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACrD,4EAA4E;IAC5E,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kEAAkE;IAClE,eAAe,CAAC,EAAE,YAAY,CAAC,eAAe,CAAC,CAAC;IAChD,oEAAoE;IACpE,iBAAiB,CAAC,EAAE,QAAQ,CAAC;IAE7B;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAEpF,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ControlSurface.d.ts","sourceRoot":"","sources":["../../../../src/control-surface/ControlSurface.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAG7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAoCnD,eAAO,MAAM,cAAc,iDAAgC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ControlSurfaceValue } from './types';
|
|
2
|
+
/** @internal The provider `ControlSurface` renders. */
|
|
3
|
+
export declare const ControlSurfaceProvider: import("react").Provider<ControlSurfaceValue | null>;
|
|
4
|
+
/**
|
|
5
|
+
* The nearest container's presentation, or `null` when there is none.
|
|
6
|
+
*
|
|
7
|
+
* `null` rather than a default object on purpose: a control's own default is
|
|
8
|
+
* the control's to choose (`ButtonGroup` defaults to `solid`, a media overlay's
|
|
9
|
+
* toolbar could default to `glass`), and a context that invented one here would
|
|
10
|
+
* take that choice away by looking like an answer.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useControlSurface(): ControlSurfaceValue | null;
|
|
13
|
+
/**
|
|
14
|
+
* Resolve one field by the precedence rule: `explicit` → container → `fallback`.
|
|
15
|
+
*
|
|
16
|
+
* ```ts
|
|
17
|
+
* const material = useInheritedControl('material', variant, 'solid');
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare function useInheritedControl<K extends keyof ControlSurfaceValue>(key: K, explicit: ControlSurfaceValue[K] | undefined, fallback: ControlSurfaceValue[K]): ControlSurfaceValue[K];
|
|
21
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/control-surface/context.ts"],"names":[],"mappings":"AA8CA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAKnD,uDAAuD;AACvD,eAAO,MAAM,sBAAsB,sDAAiC,CAAC;AAErE;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,IAAI,mBAAmB,GAAG,IAAI,CAE9D;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,MAAM,mBAAmB,EACrE,GAAG,EAAE,CAAC,EACN,QAAQ,EAAE,mBAAmB,CAAC,CAAC,CAAC,GAAG,SAAS,EAC5C,QAAQ,EAAE,mBAAmB,CAAC,CAAC,CAAC,GAC/B,mBAAmB,CAAC,CAAC,CAAC,CAGxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/control-surface/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEnE,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The MATERIAL a control container paints itself in.
|
|
4
|
+
*
|
|
5
|
+
* `solid` is Bloom's default chrome: an opaque fill off the surface ladder, a
|
|
6
|
+
* hairline and a shadow. `glass` is the translucent chrome a container paints
|
|
7
|
+
* when it floats over content the container does not own — a page header's
|
|
8
|
+
* islands, a media overlay's toolbar.
|
|
9
|
+
*
|
|
10
|
+
* It names the container's SURFACE, never the action's meaning. A destructive
|
|
11
|
+
* action stays destructive in either material; see `docs/composition.mdx`.
|
|
12
|
+
*/
|
|
13
|
+
export type ControlMaterial = 'solid' | 'glass';
|
|
14
|
+
/** The size a container asks the controls inside it for. */
|
|
15
|
+
export type ControlDensity = 'medium' | 'small';
|
|
16
|
+
/**
|
|
17
|
+
* What a container tells the controls inside it about presentation — and
|
|
18
|
+
* nothing else.
|
|
19
|
+
*
|
|
20
|
+
* Both fields are VISUAL CONFIGURATION: a descendant may override either with
|
|
21
|
+
* an explicit prop. Restrictions do not travel here, deliberately. `disabled`,
|
|
22
|
+
* a modal's inertness and the effective accessibility preferences are
|
|
23
|
+
* constraints rather than defaults, and a descendant must not be able to
|
|
24
|
+
* re-enable itself by passing a prop — so they stay on their own channels.
|
|
25
|
+
*/
|
|
26
|
+
export interface ControlSurfaceValue {
|
|
27
|
+
material: ControlMaterial;
|
|
28
|
+
density: ControlDensity;
|
|
29
|
+
}
|
|
30
|
+
export interface ControlSurfaceProps {
|
|
31
|
+
/** The material controls inside should default to. Inherited when omitted. */
|
|
32
|
+
material?: ControlMaterial;
|
|
33
|
+
/** The density controls inside should default to. Inherited when omitted. */
|
|
34
|
+
density?: ControlDensity;
|
|
35
|
+
children?: ReactNode;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/control-surface/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;;;;;;;;;GAUG;AACH,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,OAAO,CAAC;AAEhD,4DAA4D;AAC5D,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEhD;;;;;;;;;GASG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,eAAe,CAAC;IAC1B,OAAO,EAAE,cAAc,CAAC;CACzB;AAED,MAAM,WAAW,mBAAmB;IAClC,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,6EAA6E;IAC7E,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { FieldProps } from './types';
|
|
3
|
-
export declare const Field: React.MemoExoticComponent<({ children, label, description, error, required, disabled, nativeID, style, testID, }: FieldProps) => import("react/jsx-runtime").JSX.Element>;
|
|
3
|
+
export declare const Field: React.MemoExoticComponent<({ children, label, description, error, required, disabled, multiple, nativeID, style, testID, }: FieldProps) => import("react/jsx-runtime").JSX.Element>;
|
|
4
4
|
//# sourceMappingURL=Field.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../../../src/field/Field.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../../../src/field/Field.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAQpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAoH1C,eAAO,MAAM,KAAK,8HA7Ef,UAAU,6CA6E4B,CAAC"}
|