@tamagui/list-item 2.7.7 → 3.0.0-beta.1091.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/cjs/ListItem.cjs +116 -228
- package/dist/cjs/ListItem.native.cjs +149 -0
- package/dist/cjs/ListItem.native.js +120 -230
- package/dist/cjs/ListItem.native.js.map +1 -1
- package/dist/cjs/index.cjs +9 -11
- package/dist/cjs/index.native.cjs +20 -0
- package/dist/cjs/index.native.js +9 -10
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/esm/ListItem.mjs +102 -217
- package/dist/esm/ListItem.mjs.map +1 -1
- package/dist/esm/ListItem.native.js +106 -220
- package/dist/esm/ListItem.native.js.map +1 -1
- package/dist/esm/index.js +1 -2
- package/dist/esm/index.mjs +1 -2
- package/dist/esm/index.native.js +1 -2
- package/dist/jsx/ListItem.mjs +102 -217
- package/dist/jsx/ListItem.mjs.map +1 -1
- package/dist/jsx/ListItem.native.cjs +149 -0
- package/dist/jsx/ListItem.native.js +120 -230
- package/dist/jsx/ListItem.native.js.map +1 -1
- package/dist/jsx/index.js +1 -2
- package/dist/jsx/index.mjs +1 -2
- package/dist/jsx/index.native.cjs +20 -0
- package/dist/jsx/index.native.js +9 -10
- package/dist/jsx/index.native.js.map +1 -1
- package/package.json +13 -11
- package/src/ListItem.tsx +173 -248
- package/types/ListItem.d.ts +105 -78
- package/types/ListItem.d.ts.map +1 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/index.native.js.map +0 -1
- package/dist/jsx/index.js.map +0 -1
- package/dist/jsx/index.mjs.map +0 -1
|
@@ -5,257 +5,147 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
12
|
};
|
|
13
13
|
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
+
get: () => from[key],
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
21
|
};
|
|
22
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
23
|
-
value: true
|
|
24
|
-
}), mod);
|
|
22
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
23
|
var ListItem_exports = {};
|
|
26
24
|
__export(ListItem_exports, {
|
|
27
|
-
|
|
25
|
+
ListItemContext: () => ListItemContext,
|
|
26
|
+
ListItemFrame: () => ListItemFrame,
|
|
27
|
+
ListItemIcon: () => ListItemIcon,
|
|
28
|
+
ListItemSubtitle: () => ListItemSubtitle,
|
|
29
|
+
ListItemText: () => ListItemText,
|
|
30
|
+
ListItemTitle: () => ListItemTitle,
|
|
31
|
+
listItemSizeVariant: () => listItemSizeVariant,
|
|
32
|
+
useListItem: () => useListItem
|
|
28
33
|
});
|
|
29
34
|
module.exports = __toCommonJS(ListItem_exports);
|
|
30
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
31
|
-
var import_font_size = require("@tamagui/font-size");
|
|
32
36
|
var import_get_font_sized = require("@tamagui/get-font-sized");
|
|
33
|
-
var import_get_token = require("@tamagui/get-token");
|
|
34
|
-
var import_helpers = require("@tamagui/helpers");
|
|
35
37
|
var import_helpers_tamagui = require("@tamagui/helpers-tamagui");
|
|
38
|
+
var import_size = require("@tamagui/size");
|
|
36
39
|
var import_stacks = require("@tamagui/stacks");
|
|
37
40
|
var import_text = require("@tamagui/text");
|
|
38
41
|
var import_web = require("@tamagui/web");
|
|
39
|
-
var
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
var ListItemContext = (0, import_web.createStyledContext)({
|
|
43
|
+
size: void 0,
|
|
44
|
+
variant: void 0,
|
|
45
|
+
color: void 0
|
|
46
|
+
});
|
|
47
|
+
var listItemSizeVariant = import_web.styled.dynamic(function(val, env) {
|
|
48
|
+
var { frame } = (0, import_size.resolveSize)(val, env);
|
|
49
|
+
return {
|
|
50
|
+
minHeight: frame.minHeight,
|
|
51
|
+
paddingHorizontal: frame.paddingHorizontal,
|
|
52
|
+
paddingVertical: frame.paddingVertical,
|
|
53
|
+
gap: frame.gap
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
var listItemSubtitleSizeVariant = import_web.styled.dynamic(function(val, env) {
|
|
57
|
+
return (0, import_get_font_sized.getFontSized)((0, import_size.oneSizeSmaller)(val, env.sizes), env);
|
|
44
58
|
});
|
|
45
59
|
var ListItemFrame = (0, import_web.styled)(import_web.View, {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
backgroundColor: "$background",
|
|
63
|
-
cursor: "default",
|
|
64
|
-
hoverStyle: {
|
|
65
|
-
backgroundColor: "$backgroundHover",
|
|
66
|
-
borderColor: "$borderColorHover"
|
|
67
|
-
},
|
|
68
|
-
pressStyle: {
|
|
69
|
-
backgroundColor: "$backgroundPress",
|
|
70
|
-
borderColor: "$borderColorPress"
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
variant: {
|
|
75
|
-
outlined: process.env.TAMAGUI_HEADLESS === "1" ? {} : {
|
|
76
|
-
backgroundColor: "transparent",
|
|
77
|
-
borderWidth: 1,
|
|
78
|
-
borderColor: "$borderColor",
|
|
79
|
-
hoverStyle: {
|
|
80
|
-
backgroundColor: "transparent",
|
|
81
|
-
borderColor: "$borderColorHover"
|
|
82
|
-
},
|
|
83
|
-
pressStyle: {
|
|
84
|
-
backgroundColor: "transparent",
|
|
85
|
-
borderColor: "$borderColorPress"
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
size: {
|
|
90
|
-
"...size": function (val, param) {
|
|
91
|
-
var {
|
|
92
|
-
tokens
|
|
93
|
-
} = param;
|
|
94
|
-
return {
|
|
95
|
-
minHeight: tokens.size[val],
|
|
96
|
-
paddingHorizontal: tokens.space[val],
|
|
97
|
-
paddingVertical: (0, import_get_token.getSpace)(tokens.space[val], {
|
|
98
|
-
shift: -4
|
|
99
|
-
})
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
active: {
|
|
104
|
-
true: {
|
|
105
|
-
hoverStyle: {
|
|
106
|
-
backgroundColor: "$background"
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
|
-
disabled: {
|
|
111
|
-
true: {
|
|
112
|
-
opacity: 0.5,
|
|
113
|
-
pointerEvents: "none"
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
defaultVariants: {
|
|
118
|
-
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
119
|
-
}
|
|
60
|
+
context: ListItemContext,
|
|
61
|
+
displayName: "ListItemFrame",
|
|
62
|
+
role: "listitem",
|
|
63
|
+
render: "li",
|
|
64
|
+
size: true,
|
|
65
|
+
alignItems: "center",
|
|
66
|
+
justifyContent: "space-between",
|
|
67
|
+
flexWrap: "nowrap",
|
|
68
|
+
width: "100%",
|
|
69
|
+
maxWidth: "100%",
|
|
70
|
+
overflow: "hidden",
|
|
71
|
+
flexDirection: "row",
|
|
72
|
+
variants: {
|
|
73
|
+
size: listItemSizeVariant,
|
|
74
|
+
disabled: { true: { pointerEvents: "none" } }
|
|
75
|
+
}
|
|
120
76
|
});
|
|
121
77
|
var ListItemText = (0, import_web.styled)(import_text.SizableText, {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
flexGrow: 1,
|
|
130
|
-
flexShrink: 1,
|
|
131
|
-
ellipsis: true,
|
|
132
|
-
cursor: "inherit"
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
|
-
defaultVariants: {
|
|
137
|
-
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
138
|
-
}
|
|
78
|
+
context: ListItemContext,
|
|
79
|
+
displayName: "ListItemText",
|
|
80
|
+
size: true,
|
|
81
|
+
flexGrow: 1,
|
|
82
|
+
flexShrink: 1,
|
|
83
|
+
ellipsis: true,
|
|
84
|
+
cursor: "inherit"
|
|
139
85
|
});
|
|
140
86
|
var ListItemSubtitle = (0, import_web.styled)(ListItemText, {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
opacity: 0.6,
|
|
147
|
-
maxWidth: "100%",
|
|
148
|
-
color: "$color"
|
|
149
|
-
}
|
|
150
|
-
},
|
|
151
|
-
size: {
|
|
152
|
-
"...size": function (val, extras) {
|
|
153
|
-
var oneSmaller = (0, import_get_token.getSize)(val, {
|
|
154
|
-
shift: -1,
|
|
155
|
-
excludeHalfSteps: true
|
|
156
|
-
});
|
|
157
|
-
var fontStyle = (0, import_get_font_sized.getFontSized)(oneSmaller.key, extras);
|
|
158
|
-
return fontStyle;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
},
|
|
162
|
-
defaultVariants: {
|
|
163
|
-
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
164
|
-
}
|
|
87
|
+
context: ListItemContext,
|
|
88
|
+
displayName: "ListItemSubtitle",
|
|
89
|
+
opacity: .6,
|
|
90
|
+
maxWidth: "100%",
|
|
91
|
+
variants: { size: listItemSubtitleSizeVariant }
|
|
165
92
|
});
|
|
166
93
|
var ListItemTitle = (0, import_web.styled)(ListItemText, {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
variants: {
|
|
170
|
-
unstyled: {
|
|
171
|
-
false: {}
|
|
172
|
-
}
|
|
173
|
-
},
|
|
174
|
-
defaultVariants: {
|
|
175
|
-
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
176
|
-
}
|
|
94
|
+
context: ListItemContext,
|
|
95
|
+
displayName: "ListItemTitle"
|
|
177
96
|
});
|
|
178
|
-
var ListItemIcon = function
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}
|
|
188
|
-
var _ref;
|
|
189
|
-
var sizeToken = (_ref = size !== null && size !== void 0 ? size : styledContext.size) !== null && _ref !== void 0 ? _ref : "$true";
|
|
190
|
-
var iconColor = (0, import_helpers_tamagui.useCurrentColor)(styledContext.color);
|
|
191
|
-
var iconSize = (0, import_font_size.getFontSize)(sizeToken) * scaleIcon;
|
|
192
|
-
return (0, import_helpers_tamagui.getIcon)(children, {
|
|
193
|
-
size: iconSize,
|
|
194
|
-
color: iconColor
|
|
195
|
-
});
|
|
97
|
+
var ListItemIcon = function(param) {
|
|
98
|
+
var { children, size, scaleIcon = 1 } = param;
|
|
99
|
+
var context = ListItemContext.useStyledContext();
|
|
100
|
+
var _ref;
|
|
101
|
+
var getThemedIcon = (0, import_helpers_tamagui.useGetThemedIcon)({
|
|
102
|
+
size: (0, import_helpers_tamagui.getThemedIconSize)((_ref = size !== null && size !== void 0 ? size : context.size) !== null && _ref !== void 0 ? _ref : true, scaleIcon),
|
|
103
|
+
color: context.color
|
|
104
|
+
});
|
|
105
|
+
return getThemedIcon(children);
|
|
196
106
|
};
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
size,
|
|
242
|
-
children: title
|
|
243
|
-
}) : title : null, subTitle ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
|
|
244
|
-
children: typeof subTitle === "string" ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(ListItemSubtitle, {
|
|
245
|
-
unstyled,
|
|
246
|
-
size,
|
|
247
|
-
children: subTitle
|
|
248
|
-
}) : subTitle
|
|
249
|
-
}) : null, wrappedChildren]
|
|
250
|
-
}) : wrappedChildren, themedIconAfter]
|
|
251
|
-
});
|
|
252
|
-
});
|
|
253
|
-
var ListItem2 = (0, import_helpers.withStaticProperties)(ListItemComponent, {
|
|
254
|
-
Apply: context.Provider,
|
|
255
|
-
Frame: ListItemFrame,
|
|
256
|
-
Text: ListItemText,
|
|
257
|
-
Subtitle: ListItemSubtitle,
|
|
258
|
-
Icon: ListItemIcon,
|
|
259
|
-
Title: ListItemTitle
|
|
260
|
-
});
|
|
107
|
+
function useListItem(propsIn) {
|
|
108
|
+
var [wrappedTextProps, listItemProps] = (0, import_web.splitStyleProps)(propsIn, {
|
|
109
|
+
expandShorthands: true,
|
|
110
|
+
filter: import_text.textParentProps
|
|
111
|
+
});
|
|
112
|
+
var { children, icon, iconAfter, iconSize, scaleIcon = 1, subTitle, title, ...frameProps } = listItemProps;
|
|
113
|
+
var { noTextWrap, textProps, ...textStyleProps } = wrappedTextProps;
|
|
114
|
+
var context = ListItemContext.useStyledContext();
|
|
115
|
+
var _ref, _ref1, _propsIn_color;
|
|
116
|
+
var getThemedIcon = (0, import_helpers_tamagui.useGetThemedIcon)({
|
|
117
|
+
size: (0, import_helpers_tamagui.getThemedIconSize)((_ref1 = (_ref = iconSize !== null && iconSize !== void 0 ? iconSize : propsIn.size) !== null && _ref !== void 0 ? _ref : context.size) !== null && _ref1 !== void 0 ? _ref1 : true, scaleIcon),
|
|
118
|
+
color: (_propsIn_color = propsIn.color) !== null && _propsIn_color !== void 0 ? _propsIn_color : context.color
|
|
119
|
+
});
|
|
120
|
+
var wrappedChildren = (0, import_text.wrapChildrenInText)(ListItemText, {
|
|
121
|
+
children,
|
|
122
|
+
noTextWrap,
|
|
123
|
+
textProps
|
|
124
|
+
}, textStyleProps);
|
|
125
|
+
return { props: {
|
|
126
|
+
...frameProps,
|
|
127
|
+
color: propsIn.color,
|
|
128
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
129
|
+
icon ? getThemedIcon(icon) : null,
|
|
130
|
+
title || subTitle ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_stacks.YStack, {
|
|
131
|
+
flex: 1,
|
|
132
|
+
children: [
|
|
133
|
+
typeof title === "string" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ListItemTitle, {
|
|
134
|
+
...textStyleProps,
|
|
135
|
+
...textProps,
|
|
136
|
+
children: title
|
|
137
|
+
}) : title,
|
|
138
|
+
typeof subTitle === "string" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ListItemSubtitle, {
|
|
139
|
+
...textStyleProps,
|
|
140
|
+
...textProps,
|
|
141
|
+
children: subTitle
|
|
142
|
+
}) : subTitle,
|
|
143
|
+
wrappedChildren
|
|
144
|
+
]
|
|
145
|
+
}) : wrappedChildren,
|
|
146
|
+
iconAfter ? getThemedIcon(iconAfter) : null
|
|
147
|
+
] })
|
|
148
|
+
} };
|
|
149
|
+
}
|
|
150
|
+
|
|
261
151
|
//# sourceMappingURL=ListItem.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"ListItem.native.js","names":[],"sources":["cjs/ListItem.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar ListItem_exports = {};\n__export(ListItem_exports, {\n ListItemContext: () => ListItemContext,\n ListItemFrame: () => ListItemFrame,\n ListItemIcon: () => ListItemIcon,\n ListItemSubtitle: () => ListItemSubtitle,\n ListItemText: () => ListItemText,\n ListItemTitle: () => ListItemTitle,\n listItemSizeVariant: () => listItemSizeVariant,\n useListItem: () => useListItem\n});\nmodule.exports = __toCommonJS(ListItem_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_get_font_sized = require(\"@tamagui/get-font-sized\");\nvar import_helpers_tamagui = require(\"@tamagui/helpers-tamagui\");\nvar import_size = require(\"@tamagui/size\");\nvar import_stacks = require(\"@tamagui/stacks\");\nvar import_text = require(\"@tamagui/text\");\nvar import_web = require(\"@tamagui/web\");\nvar ListItemContext = (0, import_web.createStyledContext)({\n size: void 0,\n variant: void 0,\n color: void 0\n});\nvar listItemSizeVariant = import_web.styled.dynamic(function(val, env) {\n var { frame } = (0, import_size.resolveSize)(val, env);\n return {\n minHeight: frame.minHeight,\n paddingHorizontal: frame.paddingHorizontal,\n paddingVertical: frame.paddingVertical,\n gap: frame.gap\n };\n});\nvar listItemSubtitleSizeVariant = import_web.styled.dynamic(function(val, env) {\n return (0, import_get_font_sized.getFontSized)((0, import_size.oneSizeSmaller)(val, env.sizes), env);\n});\nvar ListItemFrame = (0, import_web.styled)(import_web.View, {\n context: ListItemContext,\n displayName: \"ListItemFrame\",\n // role is the cross-platform one; render only lands on web\n role: \"listitem\",\n render: \"li\",\n size: true,\n alignItems: \"center\",\n justifyContent: \"space-between\",\n flexWrap: \"nowrap\",\n width: \"100%\",\n maxWidth: \"100%\",\n overflow: \"hidden\",\n flexDirection: \"row\",\n variants: {\n size: listItemSizeVariant,\n disabled: {\n true: {\n pointerEvents: \"none\"\n }\n }\n }\n});\nvar ListItemText = (0, import_web.styled)(import_text.SizableText, {\n context: ListItemContext,\n displayName: \"ListItemText\",\n size: true,\n flexGrow: 1,\n flexShrink: 1,\n ellipsis: true,\n cursor: \"inherit\"\n});\nvar ListItemSubtitle = (0, import_web.styled)(ListItemText, {\n context: ListItemContext,\n displayName: \"ListItemSubtitle\",\n opacity: 0.6,\n maxWidth: \"100%\",\n variants: {\n size: listItemSubtitleSizeVariant\n }\n});\nvar ListItemTitle = (0, import_web.styled)(ListItemText, {\n context: ListItemContext,\n displayName: \"ListItemTitle\"\n});\nvar ListItemIcon = function(param) {\n var { children, size, scaleIcon = 1 } = param;\n var context = ListItemContext.useStyledContext();\n var _ref;\n var getThemedIcon = (0, import_helpers_tamagui.useGetThemedIcon)({\n size: (0, import_helpers_tamagui.getThemedIconSize)((_ref = size !== null && size !== void 0 ? size : context.size) !== null && _ref !== void 0 ? _ref : true, scaleIcon),\n color: context.color\n });\n return getThemedIcon(children);\n};\nfunction useListItem(propsIn) {\n var [wrappedTextProps, listItemProps] = (0, import_web.splitStyleProps)(propsIn, {\n expandShorthands: true,\n filter: import_text.textParentProps\n });\n var { children, icon, iconAfter, iconSize, scaleIcon = 1, subTitle, title, ...frameProps } = listItemProps;\n var { noTextWrap, textProps, ...textStyleProps } = wrappedTextProps;\n var context = ListItemContext.useStyledContext();\n var _ref, _ref1, _propsIn_color;\n var getThemedIcon = (0, import_helpers_tamagui.useGetThemedIcon)({\n size: (0, import_helpers_tamagui.getThemedIconSize)((_ref1 = (_ref = iconSize !== null && iconSize !== void 0 ? iconSize : propsIn.size) !== null && _ref !== void 0 ? _ref : context.size) !== null && _ref1 !== void 0 ? _ref1 : true, scaleIcon),\n color: (_propsIn_color = propsIn.color) !== null && _propsIn_color !== void 0 ? _propsIn_color : context.color\n });\n var wrappedChildren = (0, import_text.wrapChildrenInText)(ListItemText, {\n children,\n noTextWrap,\n textProps\n }, textStyleProps);\n return {\n props: {\n ...frameProps,\n color: propsIn.color,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {\n children: [\n icon ? getThemedIcon(icon) : null,\n title || subTitle ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_stacks.YStack, {\n flex: 1,\n children: [\n typeof title === \"string\" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ListItemTitle, {\n ...textStyleProps,\n ...textProps,\n children: title\n }) : title,\n typeof subTitle === \"string\" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ListItemSubtitle, {\n ...textStyleProps,\n ...textProps,\n children: subTitle\n }) : subTitle,\n wrappedChildren\n ]\n }) : wrappedChildren,\n iconAfter ? getThemedIcon(iconAfter) : null\n ]\n })\n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AE,eAAe;MACrF,GAAG;MACH,GAAG;MACH,UAAU;KACZ,CAAC,IAAI;KACL,OAAO,aAAa,WAA2B,iBAAC,GAAG,mBAAmB,IAAG,CAAE,kBAAkB;MAC3F,GAAG;MACH,GAAG;MACH,UAAU;KACZ,CAAC,IAAI;KACL;IACF;GACF,CAAC,IAAI;GACL,YAAY,cAAc,SAAS,IAAI;EACzC,EACF,CAAC;CACH,EACF;AACF"}
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -3,18 +3,16 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
5
|
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
8
|
+
get: () => from[key],
|
|
9
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
13
|
};
|
|
14
14
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
16
|
-
value: true
|
|
17
|
-
}), mod);
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
16
|
var index_exports = {};
|
|
19
17
|
module.exports = __toCommonJS(index_exports);
|
|
20
|
-
__reExport(index_exports, require("./ListItem.cjs"), module.exports);
|
|
18
|
+
__reExport(index_exports, require("./ListItem.cjs"), module.exports);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
9
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
10
|
+
get: () => from[key],
|
|
11
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var index_exports = {};
|
|
19
|
+
module.exports = __toCommonJS(index_exports);
|
|
20
|
+
__reExport(index_exports, require("./ListItem.native.js"), module.exports);
|
package/dist/cjs/index.native.js
CHANGED
|
@@ -5,19 +5,18 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __copyProps = (to, from, except, desc) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
9
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
10
|
+
get: () => from[key],
|
|
11
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
15
|
};
|
|
16
16
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
17
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
18
|
-
value: true
|
|
19
|
-
}), mod);
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
18
|
var index_exports = {};
|
|
21
19
|
module.exports = __toCommonJS(index_exports);
|
|
22
20
|
__reExport(index_exports, require("./ListItem.native.js"), module.exports);
|
|
21
|
+
|
|
23
22
|
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.native.js","names":[],"sources":["cjs/index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, \"default\"), secondTarget && __copyProps(secondTarget, mod, \"default\"));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_exports = {};\nmodule.exports = __toCommonJS(index_exports);\n__reExport(index_exports, require(\"./ListItem\"), module.exports);\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,cAAc,QAAQ,KAAK,kBAAkB,YAAY,QAAQ,KAAK,SAAS,GAAG,gBAAgB,YAAY,cAAc,KAAK,SAAS;AAC9I,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,gBAAgB,CAAC;AACrB,OAAO,UAAU,aAAa,aAAa;AAC3C,WAAW,eAAe,QAAQ,sBAAY,GAAG,OAAO,OAAO"}
|