@onlynative/components 0.1.1-alpha.0 → 0.1.1-alpha.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/dist/appbar/index.js +133 -62
- package/dist/button/index.js +125 -33
- package/dist/card/index.js +88 -20
- package/dist/checkbox/index.js +88 -17
- package/dist/chip/index.js +122 -30
- package/dist/icon-button/index.js +107 -36
- package/dist/index.js +335 -251
- package/dist/list/index.js +71 -24
- package/dist/radio/index.js +43 -14
- package/dist/switch/index.js +90 -19
- package/dist/text-field/index.js +82 -26
- package/package.json +4 -23
- package/src/appbar/AppBar.tsx +0 -302
- package/src/appbar/index.ts +0 -2
- package/src/appbar/styles.ts +0 -92
- package/src/appbar/types.ts +0 -67
- package/src/button/Button.tsx +0 -133
- package/src/button/index.ts +0 -2
- package/src/button/styles.ts +0 -287
- package/src/button/types.ts +0 -42
- package/src/card/Card.tsx +0 -69
- package/src/card/index.ts +0 -2
- package/src/card/styles.ts +0 -150
- package/src/card/types.ts +0 -27
- package/src/checkbox/Checkbox.tsx +0 -113
- package/src/checkbox/index.ts +0 -2
- package/src/checkbox/styles.ts +0 -155
- package/src/checkbox/types.ts +0 -20
- package/src/chip/Chip.tsx +0 -188
- package/src/chip/index.ts +0 -2
- package/src/chip/styles.ts +0 -239
- package/src/chip/types.ts +0 -58
- package/src/icon-button/IconButton.tsx +0 -362
- package/src/icon-button/index.ts +0 -6
- package/src/icon-button/styles.ts +0 -259
- package/src/icon-button/types.ts +0 -55
- package/src/index.ts +0 -54
- package/src/keyboard-avoiding-wrapper/KeyboardAvoidingWrapper.tsx +0 -69
- package/src/keyboard-avoiding-wrapper/index.ts +0 -2
- package/src/keyboard-avoiding-wrapper/styles.ts +0 -10
- package/src/keyboard-avoiding-wrapper/types.ts +0 -37
- package/src/layout/Box.tsx +0 -99
- package/src/layout/Column.tsx +0 -16
- package/src/layout/Grid.tsx +0 -49
- package/src/layout/Layout.tsx +0 -81
- package/src/layout/Row.tsx +0 -22
- package/src/layout/index.ts +0 -13
- package/src/layout/resolveSpacing.ts +0 -11
- package/src/layout/types.ts +0 -82
- package/src/list/List.tsx +0 -17
- package/src/list/ListDivider.tsx +0 -20
- package/src/list/ListItem.tsx +0 -128
- package/src/list/index.ts +0 -9
- package/src/list/styles.ts +0 -132
- package/src/list/types.ts +0 -54
- package/src/radio/Radio.tsx +0 -103
- package/src/radio/index.ts +0 -2
- package/src/radio/styles.ts +0 -139
- package/src/radio/types.ts +0 -20
- package/src/switch/Switch.tsx +0 -121
- package/src/switch/index.ts +0 -2
- package/src/switch/styles.ts +0 -172
- package/src/switch/types.ts +0 -32
- package/src/text-field/TextField.tsx +0 -301
- package/src/text-field/index.ts +0 -2
- package/src/text-field/styles.ts +0 -239
- package/src/text-field/types.ts +0 -49
- package/src/typography/Typography.tsx +0 -79
- package/src/typography/index.ts +0 -3
- package/src/typography/types.ts +0 -17
package/dist/appbar/index.js
CHANGED
|
@@ -26,24 +26,98 @@ module.exports = __toCommonJS(appbar_exports);
|
|
|
26
26
|
|
|
27
27
|
// src/appbar/AppBar.tsx
|
|
28
28
|
var import_react3 = require("react");
|
|
29
|
-
var
|
|
29
|
+
var import_react_native7 = require("react-native");
|
|
30
30
|
var import_react_native_safe_area_context = require("react-native-safe-area-context");
|
|
31
31
|
var import_core4 = require("@onlynative/core");
|
|
32
32
|
|
|
33
33
|
// src/icon-button/IconButton.tsx
|
|
34
34
|
var import_react = require("react");
|
|
35
|
-
var
|
|
35
|
+
var import_react_native4 = require("react-native");
|
|
36
36
|
var import_core = require("@onlynative/core");
|
|
37
|
-
var import_utils2 = require("@onlynative/utils");
|
|
38
37
|
|
|
39
|
-
//
|
|
38
|
+
// ../utils/dist/chunk-OQRDRRQA.mjs
|
|
39
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
40
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
41
|
+
}) : x)(function(x) {
|
|
42
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
43
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
// ../utils/dist/index.mjs
|
|
40
47
|
var import_react_native = require("react-native");
|
|
41
|
-
var
|
|
48
|
+
var import_react_native2 = require("react-native");
|
|
49
|
+
function parseHexColor(color) {
|
|
50
|
+
const normalized = color.replace("#", "");
|
|
51
|
+
if (normalized.length !== 6 && normalized.length !== 8) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
const r = Number.parseInt(normalized.slice(0, 2), 16);
|
|
55
|
+
const g = Number.parseInt(normalized.slice(2, 4), 16);
|
|
56
|
+
const b = Number.parseInt(normalized.slice(4, 6), 16);
|
|
57
|
+
if (Number.isNaN(r) || Number.isNaN(g) || Number.isNaN(b)) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
return { r, g, b };
|
|
61
|
+
}
|
|
62
|
+
function clampAlpha(alpha) {
|
|
63
|
+
return Math.max(0, Math.min(1, alpha));
|
|
64
|
+
}
|
|
65
|
+
function alphaColor(color, alpha) {
|
|
66
|
+
const channels = parseHexColor(color);
|
|
67
|
+
const boundedAlpha = clampAlpha(alpha);
|
|
68
|
+
if (!channels) {
|
|
69
|
+
return color;
|
|
70
|
+
}
|
|
71
|
+
return `rgba(${channels.r}, ${channels.g}, ${channels.b}, ${boundedAlpha})`;
|
|
72
|
+
}
|
|
73
|
+
function blendColor(base, overlay, overlayAlpha) {
|
|
74
|
+
const baseChannels = parseHexColor(base);
|
|
75
|
+
const overlayChannels = parseHexColor(overlay);
|
|
76
|
+
const boundedAlpha = clampAlpha(overlayAlpha);
|
|
77
|
+
if (!baseChannels || !overlayChannels) {
|
|
78
|
+
return alphaColor(overlay, boundedAlpha);
|
|
79
|
+
}
|
|
80
|
+
const r = Math.round(
|
|
81
|
+
(1 - boundedAlpha) * baseChannels.r + boundedAlpha * overlayChannels.r
|
|
82
|
+
);
|
|
83
|
+
const g = Math.round(
|
|
84
|
+
(1 - boundedAlpha) * baseChannels.g + boundedAlpha * overlayChannels.g
|
|
85
|
+
);
|
|
86
|
+
const b = Math.round(
|
|
87
|
+
(1 - boundedAlpha) * baseChannels.b + boundedAlpha * overlayChannels.b
|
|
88
|
+
);
|
|
89
|
+
return `rgb(${r}, ${g}, ${b})`;
|
|
90
|
+
}
|
|
91
|
+
var _MCIcons = null;
|
|
92
|
+
var _resolved = false;
|
|
93
|
+
function getMaterialCommunityIcons() {
|
|
94
|
+
if (!_resolved) {
|
|
95
|
+
_resolved = true;
|
|
96
|
+
try {
|
|
97
|
+
const mod = __require("@expo/vector-icons/MaterialCommunityIcons");
|
|
98
|
+
_MCIcons = mod.default || mod;
|
|
99
|
+
} catch {
|
|
100
|
+
_MCIcons = null;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (!_MCIcons) {
|
|
104
|
+
throw new Error(
|
|
105
|
+
"@expo/vector-icons is required for icon support. Install it with: npx expo install @expo/vector-icons"
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
return _MCIcons;
|
|
109
|
+
}
|
|
110
|
+
function selectRTL(ltr, rtl) {
|
|
111
|
+
return import_react_native2.I18nManager.isRTL ? rtl : ltr;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// src/icon-button/styles.ts
|
|
115
|
+
var import_react_native3 = require("react-native");
|
|
42
116
|
function createStyles(theme) {
|
|
43
|
-
const disabledContainerColor =
|
|
44
|
-
const disabledOutlineColor =
|
|
117
|
+
const disabledContainerColor = alphaColor(theme.colors.onSurface, 0.12);
|
|
118
|
+
const disabledOutlineColor = alphaColor(theme.colors.onSurface, 0.12);
|
|
45
119
|
const toggleUnselectedContainerColor = theme.colors.surfaceContainerHighest;
|
|
46
|
-
return
|
|
120
|
+
return import_react_native3.StyleSheet.create({
|
|
47
121
|
container: {
|
|
48
122
|
borderRadius: theme.shape.cornerFull,
|
|
49
123
|
alignItems: "center",
|
|
@@ -109,160 +183,160 @@ function createStyles(theme) {
|
|
|
109
183
|
},
|
|
110
184
|
// Hover states (M3: 8% state layer)
|
|
111
185
|
hoveredFilled: {
|
|
112
|
-
backgroundColor:
|
|
186
|
+
backgroundColor: blendColor(
|
|
113
187
|
theme.colors.primary,
|
|
114
188
|
theme.colors.onPrimary,
|
|
115
189
|
theme.stateLayer.hoveredOpacity
|
|
116
190
|
)
|
|
117
191
|
},
|
|
118
192
|
hoveredFilledToggleUnselected: {
|
|
119
|
-
backgroundColor:
|
|
193
|
+
backgroundColor: blendColor(
|
|
120
194
|
toggleUnselectedContainerColor,
|
|
121
195
|
theme.colors.primary,
|
|
122
196
|
theme.stateLayer.hoveredOpacity
|
|
123
197
|
)
|
|
124
198
|
},
|
|
125
199
|
hoveredFilledToggleSelected: {
|
|
126
|
-
backgroundColor:
|
|
200
|
+
backgroundColor: blendColor(
|
|
127
201
|
theme.colors.primary,
|
|
128
202
|
theme.colors.onPrimary,
|
|
129
203
|
theme.stateLayer.hoveredOpacity
|
|
130
204
|
)
|
|
131
205
|
},
|
|
132
206
|
hoveredTonal: {
|
|
133
|
-
backgroundColor:
|
|
207
|
+
backgroundColor: blendColor(
|
|
134
208
|
theme.colors.secondaryContainer,
|
|
135
209
|
theme.colors.onSecondaryContainer,
|
|
136
210
|
theme.stateLayer.hoveredOpacity
|
|
137
211
|
)
|
|
138
212
|
},
|
|
139
213
|
hoveredTonalToggleUnselected: {
|
|
140
|
-
backgroundColor:
|
|
214
|
+
backgroundColor: blendColor(
|
|
141
215
|
toggleUnselectedContainerColor,
|
|
142
216
|
theme.colors.onSurfaceVariant,
|
|
143
217
|
theme.stateLayer.hoveredOpacity
|
|
144
218
|
)
|
|
145
219
|
},
|
|
146
220
|
hoveredTonalToggleSelected: {
|
|
147
|
-
backgroundColor:
|
|
221
|
+
backgroundColor: blendColor(
|
|
148
222
|
theme.colors.secondaryContainer,
|
|
149
223
|
theme.colors.onSecondaryContainer,
|
|
150
224
|
theme.stateLayer.hoveredOpacity
|
|
151
225
|
)
|
|
152
226
|
},
|
|
153
227
|
hoveredOutlined: {
|
|
154
|
-
backgroundColor:
|
|
228
|
+
backgroundColor: alphaColor(
|
|
155
229
|
theme.colors.onSurfaceVariant,
|
|
156
230
|
theme.stateLayer.hoveredOpacity
|
|
157
231
|
)
|
|
158
232
|
},
|
|
159
233
|
hoveredOutlinedToggleUnselected: {
|
|
160
|
-
backgroundColor:
|
|
234
|
+
backgroundColor: alphaColor(
|
|
161
235
|
theme.colors.onSurfaceVariant,
|
|
162
236
|
theme.stateLayer.hoveredOpacity
|
|
163
237
|
)
|
|
164
238
|
},
|
|
165
239
|
hoveredOutlinedToggleSelected: {
|
|
166
|
-
backgroundColor:
|
|
240
|
+
backgroundColor: blendColor(
|
|
167
241
|
theme.colors.inverseSurface,
|
|
168
242
|
theme.colors.inverseOnSurface,
|
|
169
243
|
theme.stateLayer.hoveredOpacity
|
|
170
244
|
)
|
|
171
245
|
},
|
|
172
246
|
hoveredStandard: {
|
|
173
|
-
backgroundColor:
|
|
247
|
+
backgroundColor: alphaColor(
|
|
174
248
|
theme.colors.onSurfaceVariant,
|
|
175
249
|
theme.stateLayer.hoveredOpacity
|
|
176
250
|
)
|
|
177
251
|
},
|
|
178
252
|
hoveredStandardToggleUnselected: {
|
|
179
|
-
backgroundColor:
|
|
253
|
+
backgroundColor: alphaColor(
|
|
180
254
|
theme.colors.onSurfaceVariant,
|
|
181
255
|
theme.stateLayer.hoveredOpacity
|
|
182
256
|
)
|
|
183
257
|
},
|
|
184
258
|
hoveredStandardToggleSelected: {
|
|
185
|
-
backgroundColor:
|
|
259
|
+
backgroundColor: alphaColor(
|
|
186
260
|
theme.colors.primary,
|
|
187
261
|
theme.stateLayer.hoveredOpacity
|
|
188
262
|
)
|
|
189
263
|
},
|
|
190
264
|
// Pressed states (M3: 12% state layer)
|
|
191
265
|
pressedFilled: {
|
|
192
|
-
backgroundColor:
|
|
266
|
+
backgroundColor: blendColor(
|
|
193
267
|
theme.colors.primary,
|
|
194
268
|
theme.colors.onPrimary,
|
|
195
269
|
theme.stateLayer.pressedOpacity
|
|
196
270
|
)
|
|
197
271
|
},
|
|
198
272
|
pressedFilledToggleUnselected: {
|
|
199
|
-
backgroundColor:
|
|
273
|
+
backgroundColor: blendColor(
|
|
200
274
|
toggleUnselectedContainerColor,
|
|
201
275
|
theme.colors.primary,
|
|
202
276
|
theme.stateLayer.pressedOpacity
|
|
203
277
|
)
|
|
204
278
|
},
|
|
205
279
|
pressedFilledToggleSelected: {
|
|
206
|
-
backgroundColor:
|
|
280
|
+
backgroundColor: blendColor(
|
|
207
281
|
theme.colors.primary,
|
|
208
282
|
theme.colors.onPrimary,
|
|
209
283
|
theme.stateLayer.pressedOpacity
|
|
210
284
|
)
|
|
211
285
|
},
|
|
212
286
|
pressedTonal: {
|
|
213
|
-
backgroundColor:
|
|
287
|
+
backgroundColor: blendColor(
|
|
214
288
|
theme.colors.secondaryContainer,
|
|
215
289
|
theme.colors.onSecondaryContainer,
|
|
216
290
|
theme.stateLayer.pressedOpacity
|
|
217
291
|
)
|
|
218
292
|
},
|
|
219
293
|
pressedTonalToggleUnselected: {
|
|
220
|
-
backgroundColor:
|
|
294
|
+
backgroundColor: blendColor(
|
|
221
295
|
toggleUnselectedContainerColor,
|
|
222
296
|
theme.colors.onSurfaceVariant,
|
|
223
297
|
theme.stateLayer.pressedOpacity
|
|
224
298
|
)
|
|
225
299
|
},
|
|
226
300
|
pressedTonalToggleSelected: {
|
|
227
|
-
backgroundColor:
|
|
301
|
+
backgroundColor: blendColor(
|
|
228
302
|
theme.colors.secondaryContainer,
|
|
229
303
|
theme.colors.onSecondaryContainer,
|
|
230
304
|
theme.stateLayer.pressedOpacity
|
|
231
305
|
)
|
|
232
306
|
},
|
|
233
307
|
pressedOutlined: {
|
|
234
|
-
backgroundColor:
|
|
308
|
+
backgroundColor: alphaColor(
|
|
235
309
|
theme.colors.onSurfaceVariant,
|
|
236
310
|
theme.stateLayer.pressedOpacity
|
|
237
311
|
)
|
|
238
312
|
},
|
|
239
313
|
pressedOutlinedToggleUnselected: {
|
|
240
|
-
backgroundColor:
|
|
314
|
+
backgroundColor: alphaColor(
|
|
241
315
|
theme.colors.onSurfaceVariant,
|
|
242
316
|
theme.stateLayer.pressedOpacity
|
|
243
317
|
)
|
|
244
318
|
},
|
|
245
319
|
pressedOutlinedToggleSelected: {
|
|
246
|
-
backgroundColor:
|
|
320
|
+
backgroundColor: blendColor(
|
|
247
321
|
theme.colors.inverseSurface,
|
|
248
322
|
theme.colors.inverseOnSurface,
|
|
249
323
|
theme.stateLayer.pressedOpacity
|
|
250
324
|
)
|
|
251
325
|
},
|
|
252
326
|
pressedStandard: {
|
|
253
|
-
backgroundColor:
|
|
327
|
+
backgroundColor: alphaColor(
|
|
254
328
|
theme.colors.onSurfaceVariant,
|
|
255
329
|
theme.stateLayer.pressedOpacity
|
|
256
330
|
)
|
|
257
331
|
},
|
|
258
332
|
pressedStandardToggleUnselected: {
|
|
259
|
-
backgroundColor:
|
|
333
|
+
backgroundColor: alphaColor(
|
|
260
334
|
theme.colors.onSurfaceVariant,
|
|
261
335
|
theme.stateLayer.pressedOpacity
|
|
262
336
|
)
|
|
263
337
|
},
|
|
264
338
|
pressedStandardToggleSelected: {
|
|
265
|
-
backgroundColor:
|
|
339
|
+
backgroundColor: alphaColor(
|
|
266
340
|
theme.colors.primary,
|
|
267
341
|
theme.stateLayer.pressedOpacity
|
|
268
342
|
)
|
|
@@ -295,7 +369,7 @@ function createStyles(theme) {
|
|
|
295
369
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
296
370
|
function getIconColor(variant, theme, disabled, isToggle, selected) {
|
|
297
371
|
if (disabled) {
|
|
298
|
-
return
|
|
372
|
+
return alphaColor(theme.colors.onSurface, 0.38);
|
|
299
373
|
}
|
|
300
374
|
if (isToggle) {
|
|
301
375
|
if (variant === "filled") {
|
|
@@ -445,7 +519,7 @@ function IconButton({
|
|
|
445
519
|
...props
|
|
446
520
|
}) {
|
|
447
521
|
var _a;
|
|
448
|
-
const MaterialCommunityIcons =
|
|
522
|
+
const MaterialCommunityIcons = getMaterialCommunityIcons();
|
|
449
523
|
const theme = (0, import_core.useTheme)();
|
|
450
524
|
const styles = (0, import_react.useMemo)(() => createStyles(theme), [theme]);
|
|
451
525
|
const isDisabled = Boolean(disabled);
|
|
@@ -465,14 +539,14 @@ function IconButton({
|
|
|
465
539
|
borderWidth: 0
|
|
466
540
|
},
|
|
467
541
|
hovered: {
|
|
468
|
-
backgroundColor:
|
|
542
|
+
backgroundColor: blendColor(
|
|
469
543
|
containerColor,
|
|
470
544
|
overlay,
|
|
471
545
|
theme.stateLayer.hoveredOpacity
|
|
472
546
|
)
|
|
473
547
|
},
|
|
474
548
|
pressed: {
|
|
475
|
-
backgroundColor:
|
|
549
|
+
backgroundColor: blendColor(
|
|
476
550
|
containerColor,
|
|
477
551
|
overlay,
|
|
478
552
|
theme.stateLayer.pressedOpacity
|
|
@@ -481,7 +555,7 @@ function IconButton({
|
|
|
481
555
|
};
|
|
482
556
|
}, [containerColor, resolvedIconColor, theme.stateLayer]);
|
|
483
557
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
484
|
-
|
|
558
|
+
import_react_native4.Pressable,
|
|
485
559
|
{
|
|
486
560
|
...props,
|
|
487
561
|
accessibilityRole: "button",
|
|
@@ -524,7 +598,7 @@ function IconButton({
|
|
|
524
598
|
|
|
525
599
|
// src/typography/Typography.tsx
|
|
526
600
|
var import_react2 = require("react");
|
|
527
|
-
var
|
|
601
|
+
var import_react_native5 = require("react-native");
|
|
528
602
|
var import_core2 = require("@onlynative/core");
|
|
529
603
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
530
604
|
var HEADING_VARIANTS = /* @__PURE__ */ new Set([
|
|
@@ -540,7 +614,7 @@ function Typography({
|
|
|
540
614
|
variant = "bodyMedium",
|
|
541
615
|
color,
|
|
542
616
|
style,
|
|
543
|
-
as: Component =
|
|
617
|
+
as: Component = import_react_native5.Text,
|
|
544
618
|
accessibilityRole,
|
|
545
619
|
...textProps
|
|
546
620
|
}) {
|
|
@@ -549,7 +623,7 @@ function Typography({
|
|
|
549
623
|
const resolvedRole = accessibilityRole != null ? accessibilityRole : HEADING_VARIANTS.has(variant) ? "header" : void 0;
|
|
550
624
|
const lineHeightFix = (0, import_react2.useMemo)(() => {
|
|
551
625
|
if (!style) return void 0;
|
|
552
|
-
const flat =
|
|
626
|
+
const flat = import_react_native5.StyleSheet.flatten(style);
|
|
553
627
|
if (!(flat == null ? void 0 : flat.fontSize) || flat.lineHeight) return void 0;
|
|
554
628
|
const ratio = typographyStyle.lineHeight / typographyStyle.fontSize;
|
|
555
629
|
return { lineHeight: Math.ceil(flat.fontSize * ratio) };
|
|
@@ -571,16 +645,13 @@ function Typography({
|
|
|
571
645
|
);
|
|
572
646
|
}
|
|
573
647
|
|
|
574
|
-
// src/appbar/AppBar.tsx
|
|
575
|
-
var import_utils3 = require("@onlynative/utils");
|
|
576
|
-
|
|
577
648
|
// src/appbar/styles.ts
|
|
578
|
-
var
|
|
649
|
+
var import_react_native6 = require("react-native");
|
|
579
650
|
var import_core3 = require("@onlynative/core");
|
|
580
651
|
function createStyles2(theme) {
|
|
581
652
|
var _a;
|
|
582
653
|
const topAppBar = (_a = theme.topAppBar) != null ? _a : import_core3.defaultTopAppBarTokens;
|
|
583
|
-
return
|
|
654
|
+
return import_react_native6.StyleSheet.create({
|
|
584
655
|
root: {
|
|
585
656
|
backgroundColor: theme.colors.surface
|
|
586
657
|
},
|
|
@@ -669,10 +740,10 @@ function createStyles2(theme) {
|
|
|
669
740
|
// src/appbar/AppBar.tsx
|
|
670
741
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
671
742
|
function getBackIcon() {
|
|
672
|
-
if (
|
|
673
|
-
return
|
|
743
|
+
if (import_react_native7.Platform.OS === "ios") {
|
|
744
|
+
return selectRTL("chevron-left", "chevron-right");
|
|
674
745
|
}
|
|
675
|
-
return
|
|
746
|
+
return selectRTL("arrow-left", "arrow-right");
|
|
676
747
|
}
|
|
677
748
|
var titleVariantBySize = {
|
|
678
749
|
small: "titleLarge",
|
|
@@ -700,7 +771,7 @@ function withTopInset(enabled, content, style) {
|
|
|
700
771
|
if (enabled) {
|
|
701
772
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native_safe_area_context.SafeAreaView, { edges: ["top"], style, children: content });
|
|
702
773
|
}
|
|
703
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
774
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native7.View, { style, children: content });
|
|
704
775
|
}
|
|
705
776
|
function measureWidth(event) {
|
|
706
777
|
return Math.round(event.nativeEvent.layout.width);
|
|
@@ -752,7 +823,7 @@ function AppBar({
|
|
|
752
823
|
if (!canGoBack) {
|
|
753
824
|
return null;
|
|
754
825
|
}
|
|
755
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
826
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native7.View, { style: styles.iconFrame, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
756
827
|
IconButton,
|
|
757
828
|
{
|
|
758
829
|
icon: getBackIcon(),
|
|
@@ -778,8 +849,8 @@ function AppBar({
|
|
|
778
849
|
if (!actions || actions.length === 0) {
|
|
779
850
|
return null;
|
|
780
851
|
}
|
|
781
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
782
|
-
|
|
852
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native7.View, { style: styles.actionsRow, children: actions.map((action, index) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
853
|
+
import_react_native7.View,
|
|
783
854
|
{
|
|
784
855
|
style: styles.iconFrame,
|
|
785
856
|
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
@@ -816,9 +887,9 @@ function AppBar({
|
|
|
816
887
|
return nextWidth;
|
|
817
888
|
});
|
|
818
889
|
}, []);
|
|
819
|
-
const topRow = /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
890
|
+
const topRow = /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react_native7.View, { style: styles.topRow, children: [
|
|
820
891
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
821
|
-
|
|
892
|
+
import_react_native7.View,
|
|
822
893
|
{
|
|
823
894
|
collapsable: false,
|
|
824
895
|
onLayout: onLeadingLayout,
|
|
@@ -826,9 +897,9 @@ function AppBar({
|
|
|
826
897
|
children: leadingContent
|
|
827
898
|
}
|
|
828
899
|
),
|
|
829
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
900
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native7.View, { style: styles.topRowSpacer }),
|
|
830
901
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
831
|
-
|
|
902
|
+
import_react_native7.View,
|
|
832
903
|
{
|
|
833
904
|
collapsable: false,
|
|
834
905
|
onLayout: onActionsLayout,
|
|
@@ -850,10 +921,10 @@ function AppBar({
|
|
|
850
921
|
containerOverride
|
|
851
922
|
];
|
|
852
923
|
if (isExpanded) {
|
|
853
|
-
const content2 = /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
924
|
+
const content2 = /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react_native7.View, { style: [styles.expandedContainer, getSizeStyle2(styles, size)], children: [
|
|
854
925
|
topRow,
|
|
855
926
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
856
|
-
|
|
927
|
+
import_react_native7.View,
|
|
857
928
|
{
|
|
858
929
|
style: [
|
|
859
930
|
styles.expandedTitleContainer,
|
|
@@ -877,11 +948,11 @@ function AppBar({
|
|
|
877
948
|
}
|
|
878
949
|
)
|
|
879
950
|
] });
|
|
880
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
951
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native7.View, { style: rootStyle, children: withTopInset(insetTop, content2, safeAreaStyle) });
|
|
881
952
|
}
|
|
882
|
-
const content = /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
953
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react_native7.View, { style: styles.smallContainer, children: [
|
|
883
954
|
topRow,
|
|
884
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
955
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native7.View, { style: [styles.overlayTitleContainer, overlayTitleInsetStyle], children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
885
956
|
Typography,
|
|
886
957
|
{
|
|
887
958
|
...APP_BAR_TITLE_TEXT_PROPS,
|
|
@@ -896,7 +967,7 @@ function AppBar({
|
|
|
896
967
|
}
|
|
897
968
|
) })
|
|
898
969
|
] });
|
|
899
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
970
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native7.View, { style: rootStyle, children: withTopInset(insetTop, content, safeAreaStyle) });
|
|
900
971
|
}
|
|
901
972
|
// Annotate the CommonJS export names for ESM import in node:
|
|
902
973
|
0 && (module.exports = {
|