@onlynative/components 0.1.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +99 -0
- package/dist/appbar/index.d.ts +71 -0
- package/dist/appbar/index.js +952 -0
- package/dist/button/index.d.ts +41 -0
- package/dist/button/index.js +454 -0
- package/dist/card/index.d.ts +31 -0
- package/dist/card/index.js +264 -0
- package/dist/checkbox/index.d.ts +25 -0
- package/dist/checkbox/index.js +291 -0
- package/dist/chip/index.d.ts +62 -0
- package/dist/chip/index.js +452 -0
- package/dist/icon-button/index.d.ts +10 -0
- package/dist/icon-button/index.js +575 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +3374 -0
- package/dist/layout/index.d.ts +98 -0
- package/dist/layout/index.js +282 -0
- package/dist/list/index.d.ts +60 -0
- package/dist/list/index.js +300 -0
- package/dist/radio/index.d.ts +25 -0
- package/dist/radio/index.js +250 -0
- package/dist/switch/index.d.ts +37 -0
- package/dist/switch/index.js +315 -0
- package/dist/text-field/index.d.ts +52 -0
- package/dist/text-field/index.js +496 -0
- package/dist/types-D3hlyvz-.d.ts +51 -0
- package/dist/typography/index.d.ts +28 -0
- package/dist/typography/index.js +69 -0
- package/package.json +166 -0
- package/src/appbar/AppBar.tsx +302 -0
- package/src/appbar/index.ts +2 -0
- package/src/appbar/styles.ts +92 -0
- package/src/appbar/types.ts +67 -0
- package/src/button/Button.tsx +130 -0
- package/src/button/index.ts +2 -0
- package/src/button/styles.ts +288 -0
- package/src/button/types.ts +42 -0
- package/src/card/Card.tsx +69 -0
- package/src/card/index.ts +2 -0
- package/src/card/styles.ts +151 -0
- package/src/card/types.ts +27 -0
- package/src/checkbox/Checkbox.tsx +109 -0
- package/src/checkbox/index.ts +2 -0
- package/src/checkbox/styles.ts +155 -0
- package/src/checkbox/types.ts +20 -0
- package/src/chip/Chip.tsx +182 -0
- package/src/chip/index.ts +2 -0
- package/src/chip/styles.ts +240 -0
- package/src/chip/types.ts +58 -0
- package/src/icon-button/IconButton.tsx +358 -0
- package/src/icon-button/index.ts +6 -0
- package/src/icon-button/styles.ts +259 -0
- package/src/icon-button/types.ts +55 -0
- package/src/index.ts +51 -0
- package/src/layout/Box.tsx +99 -0
- package/src/layout/Column.tsx +16 -0
- package/src/layout/Grid.tsx +49 -0
- package/src/layout/Layout.tsx +81 -0
- package/src/layout/Row.tsx +22 -0
- package/src/layout/index.ts +13 -0
- package/src/layout/resolveSpacing.ts +11 -0
- package/src/layout/types.ts +82 -0
- package/src/list/List.tsx +17 -0
- package/src/list/ListDivider.tsx +20 -0
- package/src/list/ListItem.tsx +128 -0
- package/src/list/index.ts +9 -0
- package/src/list/styles.ts +132 -0
- package/src/list/types.ts +54 -0
- package/src/radio/Radio.tsx +103 -0
- package/src/radio/index.ts +2 -0
- package/src/radio/styles.ts +139 -0
- package/src/radio/types.ts +20 -0
- package/src/switch/Switch.tsx +118 -0
- package/src/switch/index.ts +2 -0
- package/src/switch/styles.ts +172 -0
- package/src/switch/types.ts +32 -0
- package/src/test-utils/render-with-theme.tsx +13 -0
- package/src/text-field/TextField.tsx +298 -0
- package/src/text-field/index.ts +2 -0
- package/src/text-field/styles.ts +240 -0
- package/src/text-field/types.ts +49 -0
- package/src/typography/Typography.tsx +65 -0
- package/src/typography/index.ts +3 -0
- package/src/typography/types.ts +17 -0
- package/src/utils/color.ts +64 -0
- package/src/utils/elevation.ts +33 -0
- package/src/utils/rtl.ts +19 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
3
|
+
import { StyleProp, ViewStyle, ViewProps, FlexAlignType } from 'react-native';
|
|
4
|
+
import { Edge } from 'react-native-safe-area-context';
|
|
5
|
+
import { Theme } from '@onlynative/core';
|
|
6
|
+
|
|
7
|
+
interface LayoutProps extends PropsWithChildren {
|
|
8
|
+
/**
|
|
9
|
+
* When `true`, removes all safe area insets for full-screen layout.
|
|
10
|
+
* @default false
|
|
11
|
+
*/
|
|
12
|
+
immersive?: boolean;
|
|
13
|
+
/** Explicit set of safe-area edges to apply. Overrides `immersive` when provided. */
|
|
14
|
+
edges?: Edge[];
|
|
15
|
+
/** Additional styles applied to the SafeAreaView container. */
|
|
16
|
+
style?: StyleProp<ViewStyle>;
|
|
17
|
+
}
|
|
18
|
+
declare function Layout({ immersive, edges, children, style }: LayoutProps): react_jsx_runtime.JSX.Element;
|
|
19
|
+
|
|
20
|
+
/** A theme spacing token name or a raw numeric value in dp. */
|
|
21
|
+
type SpacingValue = keyof Theme['spacing'] | number;
|
|
22
|
+
interface BoxProps extends ViewProps {
|
|
23
|
+
/** Padding on all sides */
|
|
24
|
+
p?: SpacingValue;
|
|
25
|
+
/** Horizontal padding (paddingStart + paddingEnd) */
|
|
26
|
+
px?: SpacingValue;
|
|
27
|
+
/** Vertical padding (paddingTop + paddingBottom) */
|
|
28
|
+
py?: SpacingValue;
|
|
29
|
+
/** Padding top */
|
|
30
|
+
pt?: SpacingValue;
|
|
31
|
+
/** Padding bottom */
|
|
32
|
+
pb?: SpacingValue;
|
|
33
|
+
/** Padding start (left in LTR, right in RTL) */
|
|
34
|
+
ps?: SpacingValue;
|
|
35
|
+
/** Padding end (right in LTR, left in RTL) */
|
|
36
|
+
pe?: SpacingValue;
|
|
37
|
+
/** Margin on all sides */
|
|
38
|
+
m?: SpacingValue;
|
|
39
|
+
/** Horizontal margin (marginStart + marginEnd) */
|
|
40
|
+
mx?: SpacingValue;
|
|
41
|
+
/** Vertical margin (marginTop + marginBottom) */
|
|
42
|
+
my?: SpacingValue;
|
|
43
|
+
/** Margin top */
|
|
44
|
+
mt?: SpacingValue;
|
|
45
|
+
/** Margin bottom */
|
|
46
|
+
mb?: SpacingValue;
|
|
47
|
+
/** Margin start */
|
|
48
|
+
ms?: SpacingValue;
|
|
49
|
+
/** Margin end */
|
|
50
|
+
me?: SpacingValue;
|
|
51
|
+
/** Gap between children */
|
|
52
|
+
gap?: SpacingValue;
|
|
53
|
+
/** Row gap between children */
|
|
54
|
+
rowGap?: SpacingValue;
|
|
55
|
+
/** Column gap between children */
|
|
56
|
+
columnGap?: SpacingValue;
|
|
57
|
+
/** Flex value */
|
|
58
|
+
flex?: number;
|
|
59
|
+
/** Align items along the cross axis */
|
|
60
|
+
align?: FlexAlignType;
|
|
61
|
+
/** Justify content along the main axis */
|
|
62
|
+
justify?: 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly';
|
|
63
|
+
/** Background color */
|
|
64
|
+
bg?: string;
|
|
65
|
+
}
|
|
66
|
+
interface RowProps extends BoxProps {
|
|
67
|
+
/**
|
|
68
|
+
* Whether children should wrap to the next line when they overflow.
|
|
69
|
+
* @default false
|
|
70
|
+
*/
|
|
71
|
+
wrap?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Reverses the layout direction (`row-reverse`).
|
|
74
|
+
* @default false
|
|
75
|
+
*/
|
|
76
|
+
inverted?: boolean;
|
|
77
|
+
}
|
|
78
|
+
interface ColumnProps extends BoxProps {
|
|
79
|
+
/**
|
|
80
|
+
* Reverses the layout direction (`column-reverse`).
|
|
81
|
+
* @default false
|
|
82
|
+
*/
|
|
83
|
+
inverted?: boolean;
|
|
84
|
+
}
|
|
85
|
+
interface GridProps extends RowProps {
|
|
86
|
+
/** Number of equal-width columns. */
|
|
87
|
+
columns: number;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
declare function Box({ p, px, py, pt, pb, ps, pe, m, mx, my, mt, mb, ms, me, gap, rowGap, columnGap, flex, align, justify, bg, style, ...viewProps }: BoxProps): react_jsx_runtime.JSX.Element;
|
|
91
|
+
|
|
92
|
+
declare function Column({ inverted, style, ...boxProps }: ColumnProps): react_jsx_runtime.JSX.Element;
|
|
93
|
+
|
|
94
|
+
declare function Grid({ columns, gap, columnGap, rowGap, children, style, ...rowProps }: GridProps): react_jsx_runtime.JSX.Element;
|
|
95
|
+
|
|
96
|
+
declare function Row({ wrap, inverted, style, ...boxProps }: RowProps): react_jsx_runtime.JSX.Element;
|
|
97
|
+
|
|
98
|
+
export { Box, type BoxProps, Column, type ColumnProps, Grid, type GridProps, Layout, type LayoutProps, Row, type RowProps, type SpacingValue };
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/layout/index.ts
|
|
31
|
+
var layout_exports = {};
|
|
32
|
+
__export(layout_exports, {
|
|
33
|
+
Box: () => Box,
|
|
34
|
+
Column: () => Column,
|
|
35
|
+
Grid: () => Grid,
|
|
36
|
+
Layout: () => Layout,
|
|
37
|
+
Row: () => Row
|
|
38
|
+
});
|
|
39
|
+
module.exports = __toCommonJS(layout_exports);
|
|
40
|
+
|
|
41
|
+
// src/layout/Layout.tsx
|
|
42
|
+
var import_react = require("react");
|
|
43
|
+
var import_react_native = require("react-native");
|
|
44
|
+
var import_react_native_safe_area_context = require("react-native-safe-area-context");
|
|
45
|
+
var import_core = require("@onlynative/core");
|
|
46
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
47
|
+
var defaultEdges = ["bottom"];
|
|
48
|
+
function resolveEdges(immersive, edges) {
|
|
49
|
+
if (edges) {
|
|
50
|
+
return edges;
|
|
51
|
+
}
|
|
52
|
+
if (immersive) {
|
|
53
|
+
return [];
|
|
54
|
+
}
|
|
55
|
+
return defaultEdges;
|
|
56
|
+
}
|
|
57
|
+
var styles = import_react_native.StyleSheet.create({
|
|
58
|
+
root: {
|
|
59
|
+
flex: 1
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
function removeBackgroundColor(style) {
|
|
63
|
+
if (!style) {
|
|
64
|
+
return void 0;
|
|
65
|
+
}
|
|
66
|
+
const flattenedStyle = import_react_native.StyleSheet.flatten(style);
|
|
67
|
+
if (!flattenedStyle || flattenedStyle.backgroundColor === void 0) {
|
|
68
|
+
return style;
|
|
69
|
+
}
|
|
70
|
+
const styleWithoutBackground = { ...flattenedStyle };
|
|
71
|
+
delete styleWithoutBackground.backgroundColor;
|
|
72
|
+
return styleWithoutBackground;
|
|
73
|
+
}
|
|
74
|
+
function Layout({ immersive, edges, children, style }) {
|
|
75
|
+
const theme = (0, import_core.useTheme)();
|
|
76
|
+
const themeBackgroundStyle = (0, import_react.useMemo)(
|
|
77
|
+
() => ({ backgroundColor: theme.colors.background }),
|
|
78
|
+
[theme.colors.background]
|
|
79
|
+
);
|
|
80
|
+
const styleWithoutBackground = (0, import_react.useMemo)(
|
|
81
|
+
() => removeBackgroundColor(style),
|
|
82
|
+
[style]
|
|
83
|
+
);
|
|
84
|
+
const safeAreaEdges = (0, import_react.useMemo)(
|
|
85
|
+
() => resolveEdges(immersive, edges),
|
|
86
|
+
[immersive, edges]
|
|
87
|
+
);
|
|
88
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
89
|
+
import_react_native_safe_area_context.SafeAreaView,
|
|
90
|
+
{
|
|
91
|
+
style: [styles.root, themeBackgroundStyle, styleWithoutBackground],
|
|
92
|
+
edges: safeAreaEdges,
|
|
93
|
+
children
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// src/layout/Box.tsx
|
|
99
|
+
var import_react2 = require("react");
|
|
100
|
+
var import_react_native2 = require("react-native");
|
|
101
|
+
var import_core2 = require("@onlynative/core");
|
|
102
|
+
|
|
103
|
+
// src/layout/resolveSpacing.ts
|
|
104
|
+
function resolveSpacing(spacing, value) {
|
|
105
|
+
if (value === void 0) return void 0;
|
|
106
|
+
if (typeof value === "number") return value;
|
|
107
|
+
return spacing[value];
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// src/layout/Box.tsx
|
|
111
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
112
|
+
function Box({
|
|
113
|
+
p,
|
|
114
|
+
px,
|
|
115
|
+
py,
|
|
116
|
+
pt,
|
|
117
|
+
pb,
|
|
118
|
+
ps,
|
|
119
|
+
pe,
|
|
120
|
+
m,
|
|
121
|
+
mx,
|
|
122
|
+
my,
|
|
123
|
+
mt,
|
|
124
|
+
mb,
|
|
125
|
+
ms,
|
|
126
|
+
me,
|
|
127
|
+
gap,
|
|
128
|
+
rowGap,
|
|
129
|
+
columnGap,
|
|
130
|
+
flex,
|
|
131
|
+
align,
|
|
132
|
+
justify,
|
|
133
|
+
bg,
|
|
134
|
+
style,
|
|
135
|
+
...viewProps
|
|
136
|
+
}) {
|
|
137
|
+
const { spacing } = (0, import_core2.useTheme)();
|
|
138
|
+
const layoutStyle = (0, import_react2.useMemo)(() => {
|
|
139
|
+
const s = (v) => resolveSpacing(spacing, v);
|
|
140
|
+
return {
|
|
141
|
+
...p !== void 0 && { padding: s(p) },
|
|
142
|
+
...px !== void 0 && {
|
|
143
|
+
paddingStart: s(px),
|
|
144
|
+
paddingEnd: s(px)
|
|
145
|
+
},
|
|
146
|
+
...py !== void 0 && {
|
|
147
|
+
paddingTop: s(py),
|
|
148
|
+
paddingBottom: s(py)
|
|
149
|
+
},
|
|
150
|
+
...pt !== void 0 && { paddingTop: s(pt) },
|
|
151
|
+
...pb !== void 0 && { paddingBottom: s(pb) },
|
|
152
|
+
...ps !== void 0 && { paddingStart: s(ps) },
|
|
153
|
+
...pe !== void 0 && { paddingEnd: s(pe) },
|
|
154
|
+
...m !== void 0 && { margin: s(m) },
|
|
155
|
+
...mx !== void 0 && {
|
|
156
|
+
marginStart: s(mx),
|
|
157
|
+
marginEnd: s(mx)
|
|
158
|
+
},
|
|
159
|
+
...my !== void 0 && {
|
|
160
|
+
marginTop: s(my),
|
|
161
|
+
marginBottom: s(my)
|
|
162
|
+
},
|
|
163
|
+
...mt !== void 0 && { marginTop: s(mt) },
|
|
164
|
+
...mb !== void 0 && { marginBottom: s(mb) },
|
|
165
|
+
...ms !== void 0 && { marginStart: s(ms) },
|
|
166
|
+
...me !== void 0 && { marginEnd: s(me) },
|
|
167
|
+
...gap !== void 0 && { gap: s(gap) },
|
|
168
|
+
...rowGap !== void 0 && { rowGap: s(rowGap) },
|
|
169
|
+
...columnGap !== void 0 && { columnGap: s(columnGap) },
|
|
170
|
+
...flex !== void 0 && { flex },
|
|
171
|
+
...align !== void 0 && { alignItems: align },
|
|
172
|
+
...justify !== void 0 && { justifyContent: justify },
|
|
173
|
+
...bg !== void 0 && { backgroundColor: bg }
|
|
174
|
+
};
|
|
175
|
+
}, [
|
|
176
|
+
spacing,
|
|
177
|
+
p,
|
|
178
|
+
px,
|
|
179
|
+
py,
|
|
180
|
+
pt,
|
|
181
|
+
pb,
|
|
182
|
+
ps,
|
|
183
|
+
pe,
|
|
184
|
+
m,
|
|
185
|
+
mx,
|
|
186
|
+
my,
|
|
187
|
+
mt,
|
|
188
|
+
mb,
|
|
189
|
+
ms,
|
|
190
|
+
me,
|
|
191
|
+
gap,
|
|
192
|
+
rowGap,
|
|
193
|
+
columnGap,
|
|
194
|
+
flex,
|
|
195
|
+
align,
|
|
196
|
+
justify,
|
|
197
|
+
bg
|
|
198
|
+
]);
|
|
199
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_native2.View, { ...viewProps, style: [layoutStyle, style] });
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// src/layout/Column.tsx
|
|
203
|
+
var import_react3 = require("react");
|
|
204
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
205
|
+
function Column({ inverted = false, style, ...boxProps }) {
|
|
206
|
+
const directionStyle = (0, import_react3.useMemo)(
|
|
207
|
+
() => ({
|
|
208
|
+
flexDirection: inverted ? "column-reverse" : "column"
|
|
209
|
+
}),
|
|
210
|
+
[inverted]
|
|
211
|
+
);
|
|
212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Box, { ...boxProps, style: [directionStyle, style] });
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// src/layout/Grid.tsx
|
|
216
|
+
var import_react5 = __toESM(require("react"));
|
|
217
|
+
var import_react_native3 = require("react-native");
|
|
218
|
+
var import_core3 = require("@onlynative/core");
|
|
219
|
+
|
|
220
|
+
// src/layout/Row.tsx
|
|
221
|
+
var import_react4 = require("react");
|
|
222
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
223
|
+
function Row({
|
|
224
|
+
wrap = false,
|
|
225
|
+
inverted = false,
|
|
226
|
+
style,
|
|
227
|
+
...boxProps
|
|
228
|
+
}) {
|
|
229
|
+
const directionStyle = (0, import_react4.useMemo)(
|
|
230
|
+
() => ({
|
|
231
|
+
flexDirection: inverted ? "row-reverse" : "row",
|
|
232
|
+
...wrap && { flexWrap: "wrap" }
|
|
233
|
+
}),
|
|
234
|
+
[wrap, inverted]
|
|
235
|
+
);
|
|
236
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Box, { ...boxProps, style: [directionStyle, style] });
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// src/layout/Grid.tsx
|
|
240
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
241
|
+
function Grid({
|
|
242
|
+
columns,
|
|
243
|
+
gap,
|
|
244
|
+
columnGap,
|
|
245
|
+
rowGap,
|
|
246
|
+
children,
|
|
247
|
+
style,
|
|
248
|
+
...rowProps
|
|
249
|
+
}) {
|
|
250
|
+
const { spacing } = (0, import_core3.useTheme)();
|
|
251
|
+
const resolvedColumnGap = resolveSpacing(spacing, columnGap != null ? columnGap : gap);
|
|
252
|
+
const resolvedRowGap = resolveSpacing(spacing, rowGap != null ? rowGap : gap);
|
|
253
|
+
const halfGap = resolvedColumnGap ? resolvedColumnGap / 2 : 0;
|
|
254
|
+
const cellStyle = (0, import_react5.useMemo)(
|
|
255
|
+
() => ({
|
|
256
|
+
flexBasis: `${100 / columns}%`,
|
|
257
|
+
flexShrink: 1,
|
|
258
|
+
paddingLeft: halfGap,
|
|
259
|
+
paddingRight: halfGap
|
|
260
|
+
}),
|
|
261
|
+
[columns, halfGap]
|
|
262
|
+
);
|
|
263
|
+
const rowStyle = (0, import_react5.useMemo)(
|
|
264
|
+
() => ({
|
|
265
|
+
marginLeft: -halfGap,
|
|
266
|
+
marginRight: -halfGap
|
|
267
|
+
}),
|
|
268
|
+
[halfGap]
|
|
269
|
+
);
|
|
270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Row, { wrap: true, rowGap: resolvedRowGap, ...rowProps, style: [rowStyle, style], children: import_react5.default.Children.map(
|
|
271
|
+
children,
|
|
272
|
+
(child) => child != null ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_native3.View, { style: cellStyle, children: child }) : null
|
|
273
|
+
) });
|
|
274
|
+
}
|
|
275
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
276
|
+
0 && (module.exports = {
|
|
277
|
+
Box,
|
|
278
|
+
Column,
|
|
279
|
+
Grid,
|
|
280
|
+
Layout,
|
|
281
|
+
Row
|
|
282
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { ViewProps, StyleProp, ViewStyle } from 'react-native';
|
|
4
|
+
|
|
5
|
+
interface ListProps extends ViewProps {
|
|
6
|
+
/** Content rendered inside the list container. */
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
style?: StyleProp<ViewStyle>;
|
|
9
|
+
}
|
|
10
|
+
/** Number of text lines the item displays, used to determine minimum height. */
|
|
11
|
+
type ListItemLines = 1 | 2 | 3;
|
|
12
|
+
interface ListItemProps extends ViewProps {
|
|
13
|
+
/** Primary text displayed on the list item. */
|
|
14
|
+
headlineText: string;
|
|
15
|
+
/** Secondary text displayed below the headline. */
|
|
16
|
+
supportingText?: string;
|
|
17
|
+
/** Text displayed above the headline (e.g. category label). */
|
|
18
|
+
overlineText?: string;
|
|
19
|
+
/** Short text displayed at the trailing edge (e.g. "100+", timestamp). */
|
|
20
|
+
trailingSupportingText?: string;
|
|
21
|
+
/** Content rendered before the text block (icon, avatar, image, checkbox). */
|
|
22
|
+
leadingContent?: ReactNode;
|
|
23
|
+
/** Content rendered after the text block (icon, switch, checkbox). */
|
|
24
|
+
trailingContent?: ReactNode;
|
|
25
|
+
/** When provided, the item becomes interactive (Pressable). Omit to render as a plain View. */
|
|
26
|
+
onPress?: () => void;
|
|
27
|
+
/**
|
|
28
|
+
* Disables the press interaction and reduces opacity. Only effective when `onPress` is provided.
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Override the container (background) color.
|
|
34
|
+
* State-layer colors (hover, press) are derived automatically.
|
|
35
|
+
*/
|
|
36
|
+
containerColor?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Maximum number of lines for supportingText before truncating.
|
|
39
|
+
* @default 1
|
|
40
|
+
*/
|
|
41
|
+
supportingTextNumberOfLines?: number;
|
|
42
|
+
style?: StyleProp<ViewStyle>;
|
|
43
|
+
}
|
|
44
|
+
interface ListDividerProps extends ViewProps {
|
|
45
|
+
/**
|
|
46
|
+
* When true, adds a leading inset so the divider aligns with text
|
|
47
|
+
* that follows a leading icon (56dp from the start edge).
|
|
48
|
+
* @default false
|
|
49
|
+
*/
|
|
50
|
+
inset?: boolean;
|
|
51
|
+
style?: StyleProp<ViewStyle>;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
declare function List({ children, style, ...props }: ListProps): react_jsx_runtime.JSX.Element;
|
|
55
|
+
|
|
56
|
+
declare function ListItem({ headlineText, supportingText, overlineText, trailingSupportingText, leadingContent, trailingContent, onPress, disabled, containerColor, supportingTextNumberOfLines, style, ...props }: ListItemProps): react_jsx_runtime.JSX.Element;
|
|
57
|
+
|
|
58
|
+
declare function ListDivider({ inset, style, ...props }: ListDividerProps): react_jsx_runtime.JSX.Element;
|
|
59
|
+
|
|
60
|
+
export { List, ListDivider, type ListDividerProps, ListItem, type ListItemLines, type ListItemProps, type ListProps };
|