@oxy.so/bloom 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/fab.mdx +5 -3
- package/docs/tab-bar.mdx +2 -2
- package/lib/commonjs/fab/Fab.js +15 -3
- package/lib/commonjs/fab/Fab.js.map +1 -1
- package/lib/commonjs/fab/Fab.web.js +38 -42
- package/lib/commonjs/fab/Fab.web.js.map +1 -1
- package/lib/commonjs/tab-bar/TabBarBase.js +11 -8
- package/lib/commonjs/tab-bar/TabBarBase.js.map +1 -1
- package/lib/commonjs/tab-bar/shared.js +3 -1
- package/lib/commonjs/tab-bar/shared.js.map +1 -1
- package/lib/module/fab/Fab.js +14 -2
- package/lib/module/fab/Fab.js.map +1 -1
- package/lib/module/fab/Fab.web.js +36 -40
- package/lib/module/fab/Fab.web.js.map +1 -1
- package/lib/module/tab-bar/TabBarBase.js +12 -9
- package/lib/module/tab-bar/TabBarBase.js.map +1 -1
- package/lib/module/tab-bar/shared.js +2 -0
- package/lib/module/tab-bar/shared.js.map +1 -1
- package/lib/typescript/commonjs/fab/Fab.d.ts.map +1 -1
- package/lib/typescript/commonjs/fab/Fab.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/fab/types.d.ts +5 -9
- package/lib/typescript/commonjs/fab/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/tab-bar/TabBarBase.d.ts.map +1 -1
- package/lib/typescript/commonjs/tab-bar/shared.d.ts +2 -0
- package/lib/typescript/commonjs/tab-bar/shared.d.ts.map +1 -1
- package/lib/typescript/commonjs/tab-bar/types.d.ts +6 -8
- package/lib/typescript/commonjs/tab-bar/types.d.ts.map +1 -1
- package/lib/typescript/module/fab/Fab.d.ts.map +1 -1
- package/lib/typescript/module/fab/Fab.web.d.ts.map +1 -1
- package/lib/typescript/module/fab/types.d.ts +5 -9
- package/lib/typescript/module/fab/types.d.ts.map +1 -1
- package/lib/typescript/module/tab-bar/TabBarBase.d.ts.map +1 -1
- package/lib/typescript/module/tab-bar/shared.d.ts +2 -0
- package/lib/typescript/module/tab-bar/shared.d.ts.map +1 -1
- package/lib/typescript/module/tab-bar/types.d.ts +6 -8
- package/lib/typescript/module/tab-bar/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/fab/Fab.tsx +14 -3
- package/src/fab/Fab.web.tsx +46 -37
- package/src/fab/types.ts +5 -9
- package/src/tab-bar/TabBarBase.tsx +12 -11
- package/src/tab-bar/shared.ts +2 -0
- package/src/tab-bar/types.ts +6 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/fab/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpE;;;;;;;;GAQG;AACH;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,SAAS,CAAC;AAE1E;;;;GAIG;AAEH;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEnD,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,CAAC;AAE/D
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/fab/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpE;;;;;;;;GAQG;AACH;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,SAAS,CAAC;AAE1E;;;;GAIG;AAEH;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEnD,MAAM,MAAM,mBAAmB,GAAG,MAAM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;IACtB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,6DAA6D;IAC7D,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;CACtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabBarBase.d.ts","sourceRoot":"","sources":["../../../../src/tab-bar/TabBarBase.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAOL,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;AA2Bf,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,
|
|
1
|
+
{"version":3,"file":"TabBarBase.d.ts","sourceRoot":"","sources":["../../../../src/tab-bar/TabBarBase.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAOL,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;AA2Bf,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,EAkBL,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACxB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAe,MAAM,SAAS,CAAC;AA4oB3E;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,aAAa,CAAC,kBAAkB,CAAC,EAC1C,IAAI,EAAE,aAAa,CAAC,oBAAoB,CAAC;YAElB,WAAW;;EAGnC;AAED,+EAA+E;AAC/E,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,aAAa,CAAC,gBAAgB,CAAC;YAC1C,iBAAiB;;EAG/C"}
|
|
@@ -10,6 +10,8 @@ export declare const MINIMIZED_INSET = 34;
|
|
|
10
10
|
export declare const BAR_MARGIN = 12;
|
|
11
11
|
/** Inner inset between the capsule wall and the tab items. */
|
|
12
12
|
export declare const ROW_PAD_H = 4;
|
|
13
|
+
/** Comfortable ceiling for one expanded tab; the bar grows with its item count. */
|
|
14
|
+
export declare const MAX_EXPANDED_ITEM_WIDTH = 88;
|
|
13
15
|
export declare const LABEL_HEIGHT = 13;
|
|
14
16
|
export declare const ICON_SIZE = 21;
|
|
15
17
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../src/tab-bar/shared.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAWvD,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,4EAA4E;AAC5E,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC,qEAAqE;AACrE,eAAO,MAAM,UAAU,KAAK,CAAC;AAC7B,8DAA8D;AAC9D,eAAO,MAAM,SAAS,IAAI,CAAC;AAC3B,eAAO,MAAM,YAAY,KAAK,CAAC;AAC/B,eAAO,MAAM,SAAS,KAAK,CAAC;AAC5B;;;GAGG;AACH,eAAO,MAAM,QAAQ,IAAI,CAAC;AAC1B,eAAO,MAAM,WAAW,QAA0B,CAAC;AACnD,eAAO,MAAM,UAAU,IAAI,CAAC;AAC5B,4EAA4E;AAC5E,eAAO,MAAM,kBAAkB,QAA2C,CAAC;AAC3E,eAAO,MAAM,mBAAmB,QAA6B,CAAC;AAC9D,iEAAiE;AACjE,eAAO,MAAM,UAAU,KAAK,CAAC;AAC7B,uEAAuE;AACvE,eAAO,MAAM,eAAe,MAAM,CAAC;AAGnC;;;;GAIG;AACH,eAAO,M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MAAM,CAAC;IACb,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;OAMG;IACH,MAAM,EAAE,OAAO,CAAC;CACjB"}
|
|
@@ -168,12 +168,11 @@ export type TabBarProps = ViewProps & {
|
|
|
168
168
|
intensity?: number;
|
|
169
169
|
};
|
|
170
170
|
/**
|
|
171
|
-
* Maximum width of the pill, in points.
|
|
172
|
-
*
|
|
171
|
+
* Maximum width of the pill, in points. By default the pill already grows
|
|
172
|
+
* with its tab count, up to a comfortable per-item width and the viewport.
|
|
173
173
|
*
|
|
174
|
-
* A CEILING, never a floor
|
|
175
|
-
*
|
|
176
|
-
* matter on a tablet. When it binds, the pill is constrained to this width and
|
|
174
|
+
* A CEILING, never a floor or a requested width: a larger value does not
|
|
175
|
+
* stretch a compact bar. When it binds, the pill is constrained to this width and
|
|
177
176
|
* CENTRED, and the ITEM geometry follows it — the item width, the sliding
|
|
178
177
|
* highlight's position and the tap/scrub hit-testing all derive from the same
|
|
179
178
|
* constrained width, so a tap still lands on the tab it is visibly over.
|
|
@@ -182,9 +181,8 @@ export type TabBarProps = ViewProps & {
|
|
|
182
181
|
* bar with a `style` override moves the pixels only: the highlight and the
|
|
183
182
|
* scrub worklet would still divide the WINDOW width by the tab count, leaving
|
|
184
183
|
* the highlight sized and positioned for a bar that is no longer there. On an
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
* hundreds of points wide.
|
|
184
|
+
* Use this when a product wants a tighter pill than Bloom's adaptive default,
|
|
185
|
+
* especially on tablet and desktop layouts.
|
|
188
186
|
*/
|
|
189
187
|
maxWidth?: number;
|
|
190
188
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/tab-bar/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,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,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,wEAAwE;IACxE,KAAK,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAC7B;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;;;;;;;;;;OAgBG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACxC;;;;;;;;;;;;;;;;OAgBG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,cAAc,GAAG;IAC/C,IAAI,EAAE,UAAU,CAAC;IACjB,gFAAgF;IAChF,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;;;;OASG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC"}
|
package/package.json
CHANGED
package/src/fab/Fab.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { memo, useMemo, type ComponentType } from 'react';
|
|
1
|
+
import React, { memo, useEffect, useMemo, useRef, type ComponentType } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
Animated,
|
|
4
4
|
Pressable,
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
import { styled } from 'react-native-css';
|
|
13
13
|
|
|
14
14
|
import { useBottomEdgeInset } from '../layout/bottom-edge';
|
|
15
|
+
import { EXPANDED_HEIGHT, MINIMIZED_HEIGHT } from '../tab-bar/shared';
|
|
15
16
|
import { useTheme } from '../theme/use-theme';
|
|
16
17
|
import { animation, borderRadius } from '../styles/tokens';
|
|
17
18
|
import { bloomShadowStyle } from '../design-tokens/shadows';
|
|
@@ -160,7 +161,7 @@ const FabComponent: React.FC<FabProps> = ({
|
|
|
160
161
|
testID,
|
|
161
162
|
zIndex = DEFAULT_Z_INDEX,
|
|
162
163
|
}) => {
|
|
163
|
-
const minimized = useFabMinimized(
|
|
164
|
+
const minimized = useFabMinimized(true);
|
|
164
165
|
const bottomEdgeInset = useBottomEdgeInset();
|
|
165
166
|
const theme = useTheme();
|
|
166
167
|
const sizeConfig = useMemo(() => resolveSize(size), [size]);
|
|
@@ -175,6 +176,16 @@ const FabComponent: React.FC<FabProps> = ({
|
|
|
175
176
|
|
|
176
177
|
const resolvedColors = useMemo(() => resolveVariant(variant, theme.colors), [variant, theme.colors]);
|
|
177
178
|
const content = applyIconColor(icon ?? children, resolvedColors.foreground);
|
|
179
|
+
const followsBottomEdge = placement === 'bottom-right' || placement === 'bottom-left';
|
|
180
|
+
const bottomFollow = useRef(new Animated.Value(0)).current;
|
|
181
|
+
|
|
182
|
+
useEffect(() => {
|
|
183
|
+
Animated.timing(bottomFollow, {
|
|
184
|
+
toValue: followsBottomEdge && minimized ? EXPANDED_HEIGHT - MINIMIZED_HEIGHT : 0,
|
|
185
|
+
duration: 200,
|
|
186
|
+
useNativeDriver: true,
|
|
187
|
+
}).start();
|
|
188
|
+
}, [bottomFollow, followsBottomEdge, minimized]);
|
|
178
189
|
|
|
179
190
|
// A FAB is always filled, so the held state is a state layer of its own label
|
|
180
191
|
// colour over its own fill — never a wash, and never an alpha'd fill: it
|
|
@@ -243,7 +254,7 @@ const FabComponent: React.FC<FabProps> = ({
|
|
|
243
254
|
// cost is that a caller who sets `transform` replaces the press scale
|
|
244
255
|
// instead of composing with it — when the transform sat on a separate
|
|
245
256
|
// wrapper node the two multiplied.
|
|
246
|
-
{ transform: [{ scale: scaleAnim }] },
|
|
257
|
+
{ transform: [{ translateY: bottomFollow }, { scale: scaleAnim }] },
|
|
247
258
|
style,
|
|
248
259
|
]}
|
|
249
260
|
onPress={disabled ? undefined : onPress}
|
package/src/fab/Fab.web.tsx
CHANGED
|
@@ -8,6 +8,7 @@ import React, {
|
|
|
8
8
|
} from 'react';
|
|
9
9
|
|
|
10
10
|
import { useBottomEdgeInset } from '../layout/bottom-edge';
|
|
11
|
+
import { EXPANDED_HEIGHT, MINIMIZED_HEIGHT } from '../tab-bar/shared';
|
|
11
12
|
import { useTheme } from '../theme/use-theme';
|
|
12
13
|
import { animation, borderRadius } from '../styles/tokens';
|
|
13
14
|
import { pressedSurface } from '../theme/press-colors';
|
|
@@ -79,14 +80,13 @@ const BLOOM_FAB_CSS = interactiveWebCss({
|
|
|
79
80
|
// Gate: `interactive-web-css.test.tsx`.
|
|
80
81
|
base: `
|
|
81
82
|
flex-direction: row;
|
|
82
|
-
gap: 8px;
|
|
83
83
|
border: none;
|
|
84
84
|
background-color: var(--bloom-fab-bg);
|
|
85
85
|
box-shadow: var(--bloom-fab-shadow);
|
|
86
86
|
font-family: inherit;
|
|
87
87
|
`,
|
|
88
88
|
transition:
|
|
89
|
-
'opacity 120ms ease, transform 120ms ease, box-shadow 160ms ease, background-color 120ms ease',
|
|
89
|
+
'opacity 120ms ease, transform 120ms ease, box-shadow 160ms ease, background-color 120ms ease, bottom 200ms ease, padding 200ms ease, gap 200ms ease',
|
|
90
90
|
// A FAB lifts on hover rather than dimming: it floats over the content, so a
|
|
91
91
|
// deeper shadow is the affordance an opacity dip cannot express.
|
|
92
92
|
hover: { declarations: 'box-shadow: var(--bloom-fab-shadow-hover);' },
|
|
@@ -103,28 +103,13 @@ const BLOOM_FAB_CSS = interactiveWebCss({
|
|
|
103
103
|
/**
|
|
104
104
|
* Positioning for a placement on web.
|
|
105
105
|
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
106
|
+
* Positioned placements are real overlays (`absolute`), matching native. They
|
|
107
|
+
* anchor to the nearest positioned ancestor and never reserve a FAB-sized strip
|
|
108
|
+
* in the consumer's layout. `fixed` would escape a constrained content column;
|
|
109
|
+
* `sticky` stays in flow and silently shortens a sibling list by the FAB height.
|
|
110
|
+
* The containing screen therefore owns containment and should fill the available
|
|
111
|
+
* height, which is the same contract on every platform.
|
|
111
112
|
*
|
|
112
|
-
* Pinning a FAB to the BOTTOM of a column needs TWO mechanisms working together,
|
|
113
|
-
* because sticky alone is not enough:
|
|
114
|
-
*
|
|
115
|
-
* 1. `margin-top: auto` — in a flex COLUMN this consumes all the free vertical
|
|
116
|
-
* space, pushing the FAB to the bottom of the container EVEN WHEN THE
|
|
117
|
-
* CONTENT IS SHORT (e.g. an empty feed / loading spinner). Without it, a
|
|
118
|
-
* short column leaves the FAB at its natural flow position (mid-column) —
|
|
119
|
-
* which is exactly the "floating in the middle / broken" bug.
|
|
120
|
-
* 2. `position: sticky; bottom` — when the content is TALL and the column
|
|
121
|
-
* scrolls, sticky keeps the FAB pinned to the bottom of the viewport as the
|
|
122
|
-
* user scrolls, instead of scrolling away with the content.
|
|
123
|
-
*
|
|
124
|
-
* Horizontal placement uses `align-self` (sticky elements can't be pushed by
|
|
125
|
-
* `left`/`right` the way absolute ones are) plus an inline-edge margin for the
|
|
126
|
-
* `offset`. The consumer column MUST be a flex column that fills the available
|
|
127
|
-
* height, and the FAB MUST be its last child — documented in the usage story. *
|
|
128
113
|
* `bottomEdgeInset` applies to the BOTTOM axis only. It is not a gap preference
|
|
129
114
|
* — `offset` is that — but the height of whatever floating surface has already
|
|
130
115
|
* claimed the bottom edge, so the FAB lands above a floating tab bar instead of
|
|
@@ -138,22 +123,17 @@ function placementStyle(
|
|
|
138
123
|
bottomEdgeInset: number,
|
|
139
124
|
): CSSProperties {
|
|
140
125
|
if (placement === 'static') return {};
|
|
141
|
-
const style: CSSProperties = { position: '
|
|
126
|
+
const style: CSSProperties = { position: 'absolute' };
|
|
142
127
|
const isBottom = placement === 'bottom-right' || placement === 'bottom-left';
|
|
143
128
|
if (isBottom) {
|
|
144
129
|
style.bottom = offset + bottomEdgeInset;
|
|
145
|
-
// Push the FAB to the bottom of a (flex-column) container even when the
|
|
146
|
-
// content is too short to scroll, so it never floats mid-column.
|
|
147
|
-
style.marginTop = 'auto';
|
|
148
130
|
} else {
|
|
149
131
|
style.top = offset;
|
|
150
132
|
}
|
|
151
133
|
if (placement === 'bottom-right' || placement === 'top-right') {
|
|
152
|
-
style.
|
|
153
|
-
style.marginRight = offset;
|
|
134
|
+
style.right = offset;
|
|
154
135
|
} else {
|
|
155
|
-
style.
|
|
156
|
-
style.marginLeft = offset;
|
|
136
|
+
style.left = offset;
|
|
157
137
|
}
|
|
158
138
|
return style;
|
|
159
139
|
}
|
|
@@ -200,7 +180,7 @@ const FabWebComponent: React.FC<FabProps> = ({
|
|
|
200
180
|
type = 'button',
|
|
201
181
|
}) => {
|
|
202
182
|
useInteractiveWebCss(STYLE_ID, BLOOM_FAB_CSS);
|
|
203
|
-
const minimized = useFabMinimized(
|
|
183
|
+
const minimized = useFabMinimized(true);
|
|
204
184
|
const bottomEdgeInset = useBottomEdgeInset();
|
|
205
185
|
const theme = useTheme();
|
|
206
186
|
const reactId = useId();
|
|
@@ -237,12 +217,18 @@ const FabWebComponent: React.FC<FabProps> = ({
|
|
|
237
217
|
variantColors.foreground,
|
|
238
218
|
),
|
|
239
219
|
['--bloom-fab-press-scale' as string]: animation.pressScale,
|
|
240
|
-
...placementStyle(
|
|
220
|
+
...placementStyle(
|
|
221
|
+
placement,
|
|
222
|
+
offset,
|
|
223
|
+
Math.max(0, bottomEdgeInset - (minimized ? EXPANDED_HEIGHT - MINIMIZED_HEIGHT : 0)),
|
|
224
|
+
),
|
|
241
225
|
};
|
|
242
|
-
if (
|
|
226
|
+
if (isExtended) {
|
|
243
227
|
const pad = sizeConfig.diameter <= 44 ? 14 : 20;
|
|
244
|
-
base.
|
|
245
|
-
base.
|
|
228
|
+
base.minWidth = sizeConfig.diameter;
|
|
229
|
+
base.paddingLeft = showLabel ? pad : 0;
|
|
230
|
+
base.paddingRight = showLabel ? pad : 0;
|
|
231
|
+
base.gap = showLabel ? 8 : 0;
|
|
246
232
|
} else {
|
|
247
233
|
base.width = sizeConfig.diameter;
|
|
248
234
|
}
|
|
@@ -258,6 +244,8 @@ const FabWebComponent: React.FC<FabProps> = ({
|
|
|
258
244
|
placement,
|
|
259
245
|
offset,
|
|
260
246
|
bottomEdgeInset,
|
|
247
|
+
minimized,
|
|
248
|
+
isExtended,
|
|
261
249
|
showLabel,
|
|
262
250
|
]);
|
|
263
251
|
|
|
@@ -313,7 +301,28 @@ const FabWebComponent: React.FC<FabProps> = ({
|
|
|
313
301
|
{content}
|
|
314
302
|
</span>
|
|
315
303
|
)}
|
|
316
|
-
{
|
|
304
|
+
{isExtended && (
|
|
305
|
+
<span
|
|
306
|
+
aria-hidden={!showLabel || undefined}
|
|
307
|
+
style={{
|
|
308
|
+
display: 'grid',
|
|
309
|
+
gridTemplateColumns: showLabel ? 'minmax(0, 1fr)' : 'minmax(0, 0fr)',
|
|
310
|
+
opacity: showLabel ? 1 : 0,
|
|
311
|
+
transition: 'grid-template-columns 200ms ease, opacity 140ms ease',
|
|
312
|
+
}}
|
|
313
|
+
>
|
|
314
|
+
<span
|
|
315
|
+
style={{
|
|
316
|
+
...resolvedLabelStyle,
|
|
317
|
+
minWidth: 0,
|
|
318
|
+
overflow: 'hidden',
|
|
319
|
+
whiteSpace: 'nowrap',
|
|
320
|
+
}}
|
|
321
|
+
>
|
|
322
|
+
{label}
|
|
323
|
+
</span>
|
|
324
|
+
</span>
|
|
325
|
+
)}
|
|
317
326
|
</button>
|
|
318
327
|
);
|
|
319
328
|
};
|
package/src/fab/types.ts
CHANGED
|
@@ -47,12 +47,9 @@ export type FabMinimizeBehavior = 'none' | 'hide' | 'collapse';
|
|
|
47
47
|
* - `bottom-right` (default) / `bottom-left` / `top-right` / `top-left` —
|
|
48
48
|
* the FAB pins itself to that corner of its CONTAINING block, never the
|
|
49
49
|
* viewport. On native it uses `position: absolute` within the nearest
|
|
50
|
-
* positioned ancestor.
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
* it visible while a tall column scrolls). The consumer column MUST be a
|
|
54
|
-
* flex column that fills the available height and the FAB MUST be its last
|
|
55
|
-
* child.
|
|
50
|
+
* positioned ancestor. Both web and native use an absolute overlay, so the
|
|
51
|
+
* FAB never reserves space in a sibling list. The containing screen must
|
|
52
|
+
* fill the available height and establish the containing block.
|
|
56
53
|
* - `static` — no positioning at all. The FAB is laid out inline and the
|
|
57
54
|
* consumer is fully responsible for placement (e.g. wrapping it in their
|
|
58
55
|
* own absolutely/sticky-positioned container). Use this when you need
|
|
@@ -60,8 +57,7 @@ export type FabMinimizeBehavior = 'none' | 'hide' | 'collapse';
|
|
|
60
57
|
*
|
|
61
58
|
* CRITICAL: the positioned placements DO NOT use web `position: fixed` and are
|
|
62
59
|
* never anchored to the viewport. They stay inside the containing column so the
|
|
63
|
-
* FAB never escapes a constrained
|
|
64
|
-
* and never float mid-column when the content is short.
|
|
60
|
+
* FAB never escapes a constrained multi-column layout or reserves list space.
|
|
65
61
|
*/
|
|
66
62
|
export type FabPlacement =
|
|
67
63
|
| 'bottom-right'
|
|
@@ -110,7 +106,7 @@ export interface FabProps {
|
|
|
110
106
|
/**
|
|
111
107
|
* Corner of the containing block to anchor to. Defaults to `'bottom-right'`.
|
|
112
108
|
* See {@link FabPlacement}. The DEFAULT never escapes the containing column
|
|
113
|
-
* (web
|
|
109
|
+
* (both web and native use `position: absolute`).
|
|
114
110
|
*/
|
|
115
111
|
placement?: FabPlacement;
|
|
116
112
|
|
|
@@ -57,6 +57,7 @@ import {
|
|
|
57
57
|
HIGHLIGHT_EXPANDED,
|
|
58
58
|
HIGHLIGHT_FADE,
|
|
59
59
|
HIGHLIGHT_MINIMIZED,
|
|
60
|
+
MAX_EXPANDED_ITEM_WIDTH,
|
|
60
61
|
ICON_SIZE,
|
|
61
62
|
ITEM_GAP,
|
|
62
63
|
ITEM_PAD_V,
|
|
@@ -170,14 +171,13 @@ function TabBarBody({
|
|
|
170
171
|
// the exact failure `maxWidth` exists to prevent, since narrowing the bar from
|
|
171
172
|
// the outside with a `style` override moves only the pixels.
|
|
172
173
|
//
|
|
173
|
-
//
|
|
174
|
-
//
|
|
175
|
-
//
|
|
176
|
-
//
|
|
177
|
-
const
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
: Math.min(windowWidth - BAR_MARGIN * 2, maxWidth);
|
|
174
|
+
// The bar grows with its tab count instead of stretching a few actions across
|
|
175
|
+
// the whole window. Each expanded slot gets at most a comfortable 88pt; more
|
|
176
|
+
// tabs naturally grow the pill until it reaches the available width. An
|
|
177
|
+
// explicit `maxWidth` remains an additional ceiling, never a width request.
|
|
178
|
+
const availableWidth = windowWidth - BAR_MARGIN * 2;
|
|
179
|
+
const contentWidth = tabCount * MAX_EXPANDED_ITEM_WIDTH + ROW_PAD_H * 2;
|
|
180
|
+
const barOuterWidth = Math.min(availableWidth, contentWidth, maxWidth ?? Infinity);
|
|
181
181
|
|
|
182
182
|
// Picker-style tick while the highlight crosses tab boundaries mid-drag.
|
|
183
183
|
// `useHaptics` already no-ops on web, when the optional `expo-haptics` peer
|
|
@@ -503,10 +503,11 @@ function TabBarBody({
|
|
|
503
503
|
// its own (its width comes from those margins), which Yoga then sizes from its
|
|
504
504
|
// CONTENT rather than from the constraint.
|
|
505
505
|
//
|
|
506
|
-
//
|
|
507
|
-
//
|
|
506
|
+
// A full-width bar can keep the stretch layout. A bar made narrower by its
|
|
507
|
+
// item count or by `maxWidth` gets one definite centred width so layout,
|
|
508
|
+
// highlight geometry and hit-testing all share the same coordinate space.
|
|
508
509
|
const constrainedWrapStyle: ViewStyle | null =
|
|
509
|
-
|
|
510
|
+
barOuterWidth === availableWidth ? null : { width: barOuterWidth, alignSelf: 'center' };
|
|
510
511
|
const barContext = useMemo(
|
|
511
512
|
() => ({ slideIndex, highlightOpacity, isDragging, theme, activeIndex, driven, selectIndex }),
|
|
512
513
|
[slideIndex, highlightOpacity, isDragging, theme, activeIndex, driven, selectIndex],
|
package/src/tab-bar/shared.ts
CHANGED
|
@@ -34,6 +34,8 @@ export const MINIMIZED_INSET = 34;
|
|
|
34
34
|
export const BAR_MARGIN = 12;
|
|
35
35
|
/** Inner inset between the capsule wall and the tab items. */
|
|
36
36
|
export const ROW_PAD_H = 4;
|
|
37
|
+
/** Comfortable ceiling for one expanded tab; the bar grows with its item count. */
|
|
38
|
+
export const MAX_EXPANDED_ITEM_WIDTH = 88;
|
|
37
39
|
export const LABEL_HEIGHT = 13;
|
|
38
40
|
export const ICON_SIZE = 21;
|
|
39
41
|
/**
|
package/src/tab-bar/types.ts
CHANGED
|
@@ -169,12 +169,11 @@ export type TabBarProps = ViewProps & {
|
|
|
169
169
|
*/
|
|
170
170
|
blur?: boolean | { intensity?: number };
|
|
171
171
|
/**
|
|
172
|
-
* Maximum width of the pill, in points.
|
|
173
|
-
*
|
|
172
|
+
* Maximum width of the pill, in points. By default the pill already grows
|
|
173
|
+
* with its tab count, up to a comfortable per-item width and the viewport.
|
|
174
174
|
*
|
|
175
|
-
* A CEILING, never a floor
|
|
176
|
-
*
|
|
177
|
-
* matter on a tablet. When it binds, the pill is constrained to this width and
|
|
175
|
+
* A CEILING, never a floor or a requested width: a larger value does not
|
|
176
|
+
* stretch a compact bar. When it binds, the pill is constrained to this width and
|
|
178
177
|
* CENTRED, and the ITEM geometry follows it — the item width, the sliding
|
|
179
178
|
* highlight's position and the tap/scrub hit-testing all derive from the same
|
|
180
179
|
* constrained width, so a tap still lands on the tab it is visibly over.
|
|
@@ -183,9 +182,8 @@ export type TabBarProps = ViewProps & {
|
|
|
183
182
|
* bar with a `style` override moves the pixels only: the highlight and the
|
|
184
183
|
* scrub worklet would still divide the WINDOW width by the tab count, leaving
|
|
185
184
|
* the highlight sized and positioned for a bar that is no longer there. On an
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
* hundreds of points wide.
|
|
185
|
+
* Use this when a product wants a tighter pill than Bloom's adaptive default,
|
|
186
|
+
* especially on tablet and desktop layouts.
|
|
189
187
|
*/
|
|
190
188
|
maxWidth?: number;
|
|
191
189
|
};
|