@xaui/native 0.0.27 → 0.0.28
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/LICENSE +21 -0
- package/README.md +105 -228
- package/dist/alert/index.cjs +92 -166
- package/dist/alert/index.js +2 -1
- package/dist/app-bar/index.cjs +24 -98
- package/dist/app-bar/index.js +2 -1
- package/dist/autocomplete/index.cjs +192 -281
- package/dist/autocomplete/index.js +36 -48
- package/dist/avatar/index.cjs +59 -133
- package/dist/avatar/index.js +2 -1
- package/dist/badge/index.cjs +26 -99
- package/dist/badge/index.js +2 -1
- package/dist/bottom-sheet/index.cjs +5 -456
- package/dist/bottom-sheet/index.js +4 -363
- package/dist/bottom-tab-bar/index.cjs +93 -167
- package/dist/bottom-tab-bar/index.js +2 -2
- package/dist/button/index.cjs +73 -525
- package/dist/button/index.js +3 -2
- package/dist/card/index.cjs +76 -169
- package/dist/card/index.js +2 -2
- package/dist/carousel/index.cjs +68 -145
- package/dist/carousel/index.js +1 -1
- package/dist/chart/index.cjs +132 -173
- package/dist/checkbox/index.cjs +70 -143
- package/dist/checkbox/index.js +2 -1
- package/dist/chip/index.cjs +89 -164
- package/dist/chip/index.js +2 -1
- package/dist/chunk-BD72HIPR.cjs +75 -0
- package/dist/chunk-DHSTKO3K.cjs +19 -0
- package/dist/{chunk-CZFDZPAS.js → chunk-DXXNBF5P.js} +5 -0
- package/dist/{chunk-UI5L26KD.js → chunk-F7WH4DMG.js} +1 -1
- package/dist/chunk-GBHQCAKW.js +19 -0
- package/dist/chunk-HC2SSHNU.js +368 -0
- package/dist/chunk-HSPTLUFA.cjs +7 -0
- package/dist/chunk-JEGEPGVU.js +287 -0
- package/dist/chunk-KTLGDLCB.cjs +287 -0
- package/dist/{chunk-GHCVNQET.js → chunk-LTKYHG5V.js} +5 -12
- package/dist/{chunk-ULJSCNPE.js → chunk-LUBWRVI2.js} +1 -1
- package/dist/chunk-OQ2BLOOG.cjs +138 -0
- package/dist/chunk-QMYWIWSX.cjs +384 -0
- package/dist/chunk-XFPPR2VB.cjs +368 -0
- package/dist/core/index.cjs +22 -168
- package/dist/core/index.d.cts +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +5 -3
- package/dist/datepicker/index.cjs +239 -320
- package/dist/datepicker/index.js +2 -1
- package/dist/divider/index.cjs +5 -145
- package/dist/divider/index.js +3 -2
- package/dist/drawer/index.cjs +39 -112
- package/dist/drawer/index.js +2 -1
- package/dist/expansion-panel/index.cjs +91 -230
- package/dist/expansion-panel/index.js +3 -2
- package/dist/fab/index.cjs +6 -722
- package/dist/fab/index.js +4 -3
- package/dist/fab-menu/index.cjs +81 -814
- package/dist/fab-menu/index.js +4 -3
- package/dist/feature-discovery/index.cjs +72 -139
- package/dist/feature-discovery/index.js +2 -2
- package/dist/index.cjs +1 -18
- package/dist/indicator/index.cjs +5 -445
- package/dist/indicator/index.js +3 -2
- package/dist/input/index.cjs +214 -282
- package/dist/input/index.js +2 -2
- package/dist/list/index.cjs +71 -146
- package/dist/list/index.js +2 -1
- package/dist/menu/index.cjs +59 -127
- package/dist/menu/index.js +2 -2
- package/dist/menubox/index.cjs +60 -132
- package/dist/menubox/index.js +2 -1
- package/dist/pager/index.cjs +42 -80
- package/dist/progress/index.cjs +43 -114
- package/dist/progress/index.js +2 -1
- package/dist/radio/index.cjs +82 -154
- package/dist/radio/index.js +2 -1
- package/dist/segment-button/index.cjs +60 -147
- package/dist/segment-button/index.js +2 -2
- package/dist/select/index.cjs +149 -224
- package/dist/select/index.js +10 -22
- package/dist/skeleton/index.cjs +23 -94
- package/dist/skeleton/index.js +2 -2
- package/dist/slider/index.cjs +77 -156
- package/dist/slider/index.js +2 -1
- package/dist/snackbar/index.cjs +420 -0
- package/dist/snackbar/index.d.cts +175 -0
- package/dist/snackbar/index.d.ts +175 -0
- package/dist/snackbar/index.js +420 -0
- package/dist/stepper/index.cjs +121 -195
- package/dist/stepper/index.js +2 -1
- package/dist/switch/index.cjs +48 -121
- package/dist/switch/index.js +2 -1
- package/dist/tabs/index.cjs +67 -151
- package/dist/tabs/index.js +2 -1
- package/dist/timepicker/index.cjs +135 -593
- package/dist/timepicker/index.js +24 -383
- package/dist/toolbar/index.cjs +59 -128
- package/dist/toolbar/index.js +2 -1
- package/dist/typography/index.cjs +37 -92
- package/dist/typography/index.d.cts +1 -1
- package/dist/typography/index.d.ts +1 -1
- package/dist/typography/index.js +20 -1
- package/dist/view/index.cjs +178 -223
- package/package.json +6 -1
- package/dist/chunk-3XSXTM3G.js +0 -661
- package/dist/chunk-4KSZLONZ.js +0 -79
- package/dist/chunk-I4V5Y5GD.js +0 -76
- package/dist/chunk-URBEEDFX.js +0 -79
package/dist/toolbar/index.cjs
CHANGED
|
@@ -1,89 +1,21 @@
|
|
|
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);
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }require('../chunk-HSPTLUFA.cjs');
|
|
29
2
|
|
|
30
|
-
// src/components/toolbar/index.ts
|
|
31
|
-
var toolbar_exports = {};
|
|
32
|
-
__export(toolbar_exports, {
|
|
33
|
-
Toolbar: () => Toolbar,
|
|
34
|
-
ToolbarAction: () => ToolbarAction
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(toolbar_exports);
|
|
37
3
|
|
|
38
|
-
|
|
39
|
-
var import_react8 = __toESM(require("react"), 1);
|
|
40
|
-
var import_react_native5 = require("react-native");
|
|
41
|
-
var import_react_native_reanimated = __toESM(require("react-native-reanimated"), 1);
|
|
4
|
+
var _chunkOQ2BLOOGcjs = require('../chunk-OQ2BLOOG.cjs');
|
|
42
5
|
|
|
43
|
-
// src/components/toolbar/toolbar.
|
|
44
|
-
var
|
|
45
|
-
var
|
|
6
|
+
// src/components/toolbar/toolbar.tsx
|
|
7
|
+
var _react = require('react'); var _react2 = _interopRequireDefault(_react);
|
|
8
|
+
var _reactnative = require('react-native');
|
|
46
9
|
|
|
47
|
-
// src/core/theme-context.tsx
|
|
48
|
-
var import_react4 = __toESM(require("react"), 1);
|
|
49
|
-
var import_react_native2 = require("react-native");
|
|
50
|
-
var import_theme = require("@xaui/core/theme");
|
|
51
|
-
var import_palette = require("@xaui/core/palette");
|
|
52
10
|
|
|
53
|
-
// src/core/portal/portal.tsx
|
|
54
|
-
var import_react2 = require("react");
|
|
55
11
|
|
|
56
|
-
// src/core/portal/portal-context.ts
|
|
57
|
-
var import_react = require("react");
|
|
58
|
-
var PortalContext = (0, import_react.createContext)(null);
|
|
59
12
|
|
|
60
|
-
// src/core/portal/portal-host.tsx
|
|
61
|
-
var import_react3 = __toESM(require("react"), 1);
|
|
62
|
-
var import_react_native = require("react-native");
|
|
63
|
-
var hostStyles = import_react_native.StyleSheet.create({
|
|
64
|
-
container: {
|
|
65
|
-
flex: 1
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
13
|
|
|
69
|
-
|
|
70
|
-
var XUIThemeContext = (0, import_react4.createContext)(null);
|
|
71
|
-
|
|
72
|
-
// src/core/theme-hooks.ts
|
|
73
|
-
var import_react5 = require("react");
|
|
74
|
-
var import_react_native3 = require("react-native");
|
|
75
|
-
function useXUITheme() {
|
|
76
|
-
const theme = (0, import_react5.useContext)(XUIThemeContext);
|
|
77
|
-
if (!theme) {
|
|
78
|
-
throw new Error("useXUITheme must be used within XUIProvider");
|
|
79
|
-
}
|
|
80
|
-
return theme;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
// src/core/index.ts
|
|
84
|
-
var import_theme2 = require("@xaui/core/theme");
|
|
14
|
+
var _reactnativereanimated = require('react-native-reanimated'); var _reactnativereanimated2 = _interopRequireDefault(_reactnativereanimated);
|
|
85
15
|
|
|
86
16
|
// src/components/toolbar/toolbar.hook.ts
|
|
17
|
+
|
|
18
|
+
var _core = require('@xaui/core');
|
|
87
19
|
var variantMap = {
|
|
88
20
|
floating: {
|
|
89
21
|
containerHeight: 72,
|
|
@@ -120,7 +52,7 @@ var variantMap = {
|
|
|
120
52
|
}
|
|
121
53
|
};
|
|
122
54
|
var useToolbarVariantStyles = (variant, position) => {
|
|
123
|
-
return (0,
|
|
55
|
+
return _react.useMemo.call(void 0, () => {
|
|
124
56
|
const baseStyles = variantMap[variant];
|
|
125
57
|
const isVertical = variant === "vertical";
|
|
126
58
|
return {
|
|
@@ -131,24 +63,24 @@ var useToolbarVariantStyles = (variant, position) => {
|
|
|
131
63
|
}, [variant, position]);
|
|
132
64
|
};
|
|
133
65
|
var useToolbarColors = (themeColor) => {
|
|
134
|
-
const theme = useXUITheme();
|
|
135
|
-
const colorScheme = theme.colors[(0,
|
|
136
|
-
return (0,
|
|
66
|
+
const theme = _chunkOQ2BLOOGcjs.useXUITheme.call(void 0, );
|
|
67
|
+
const colorScheme = theme.colors[_core.getSafeThemeColor.call(void 0, themeColor)];
|
|
68
|
+
return _react.useMemo.call(void 0, () => {
|
|
137
69
|
return {
|
|
138
70
|
background: theme.mode === "dark" ? theme.colors.default.background : theme.colors.background,
|
|
139
|
-
divider: (0,
|
|
71
|
+
divider: _core.withOpacity.call(void 0, theme.colors.foreground, 0.1),
|
|
140
72
|
title: theme.colors.foreground,
|
|
141
|
-
subtitle: (0,
|
|
73
|
+
subtitle: _core.withOpacity.call(void 0, theme.colors.foreground, 0.72),
|
|
142
74
|
action: colorScheme.main,
|
|
143
|
-
pressed: (0,
|
|
144
|
-
shadow: (0,
|
|
75
|
+
pressed: _core.withOpacity.call(void 0, colorScheme.main, 0.16),
|
|
76
|
+
shadow: _core.withOpacity.call(void 0, theme.colors.foreground, 0.35)
|
|
145
77
|
};
|
|
146
78
|
}, [colorScheme.main, theme.colors, theme.mode]);
|
|
147
79
|
};
|
|
148
80
|
|
|
149
81
|
// src/components/toolbar/toolbar.style.ts
|
|
150
|
-
|
|
151
|
-
var styles =
|
|
82
|
+
|
|
83
|
+
var styles = _reactnative.StyleSheet.create({
|
|
152
84
|
container: {
|
|
153
85
|
position: "absolute",
|
|
154
86
|
zIndex: 40
|
|
@@ -220,10 +152,10 @@ var styles = import_react_native4.StyleSheet.create({
|
|
|
220
152
|
});
|
|
221
153
|
|
|
222
154
|
// src/components/toolbar/toolbar-context.ts
|
|
223
|
-
|
|
224
|
-
var ToolbarContext = (0,
|
|
155
|
+
|
|
156
|
+
var ToolbarContext = _react.createContext.call(void 0, null);
|
|
225
157
|
var useToolbarContext = () => {
|
|
226
|
-
return (0,
|
|
158
|
+
return _react.useContext.call(void 0, ToolbarContext);
|
|
227
159
|
};
|
|
228
160
|
|
|
229
161
|
// src/components/toolbar/toolbar.tsx
|
|
@@ -239,27 +171,27 @@ var Toolbar = ({
|
|
|
239
171
|
customAppearance
|
|
240
172
|
}) => {
|
|
241
173
|
const variantStyles = useToolbarVariantStyles(variant, position);
|
|
242
|
-
const
|
|
243
|
-
const translateValue = (0,
|
|
174
|
+
const colors = useToolbarColors(themeColor);
|
|
175
|
+
const translateValue = _reactnativereanimated.useSharedValue.call(void 0,
|
|
244
176
|
isVisible ? 0 : getInitialTranslate(position)
|
|
245
177
|
);
|
|
246
|
-
const opacityValue = (0,
|
|
247
|
-
(0,
|
|
178
|
+
const opacityValue = _reactnativereanimated.useSharedValue.call(void 0, isVisible ? 1 : 0);
|
|
179
|
+
_react.useEffect.call(void 0, () => {
|
|
248
180
|
if (isVisible) {
|
|
249
|
-
translateValue.value = (0,
|
|
181
|
+
translateValue.value = _reactnativereanimated.withSpring.call(void 0, 0, {
|
|
250
182
|
damping: 20,
|
|
251
183
|
stiffness: 300
|
|
252
184
|
});
|
|
253
|
-
opacityValue.value = (0,
|
|
185
|
+
opacityValue.value = _reactnativereanimated.withTiming.call(void 0, 1, { duration: 200 });
|
|
254
186
|
} else {
|
|
255
|
-
translateValue.value = (0,
|
|
187
|
+
translateValue.value = _reactnativereanimated.withSpring.call(void 0, getInitialTranslate(position), {
|
|
256
188
|
damping: 20,
|
|
257
189
|
stiffness: 300
|
|
258
190
|
});
|
|
259
|
-
opacityValue.value = (0,
|
|
191
|
+
opacityValue.value = _reactnativereanimated.withTiming.call(void 0, 0, { duration: 200 });
|
|
260
192
|
}
|
|
261
193
|
}, [isVisible, position, translateValue, opacityValue]);
|
|
262
|
-
const animatedStyle = (0,
|
|
194
|
+
const animatedStyle = _reactnativereanimated.useAnimatedStyle.call(void 0, () => {
|
|
263
195
|
const transform = position === "left" || position === "right" ? [{ translateX: translateValue.value }] : [{ translateY: translateValue.value }];
|
|
264
196
|
return {
|
|
265
197
|
opacity: opacityValue.value,
|
|
@@ -267,25 +199,25 @@ var Toolbar = ({
|
|
|
267
199
|
};
|
|
268
200
|
});
|
|
269
201
|
const isVertical = variantStyles.isVertical;
|
|
270
|
-
const shouldElevate = isElevated
|
|
202
|
+
const shouldElevate = _nullishCoalesce(isElevated, () => ( variantStyles.isElevated));
|
|
271
203
|
const positionStyle = position === "top" ? styles.top : position === "bottom" ? styles.bottom : position === "left" ? styles.left : styles.right;
|
|
272
204
|
const floatingStyle = variant === "floating" ? [
|
|
273
205
|
styles.floating,
|
|
274
206
|
position === "bottom" && styles.floatingBottom,
|
|
275
207
|
position === "top" && styles.floatingTop
|
|
276
208
|
] : null;
|
|
277
|
-
return /* @__PURE__ */
|
|
209
|
+
return /* @__PURE__ */ _react2.default.createElement(
|
|
278
210
|
ToolbarContext.Provider,
|
|
279
211
|
{
|
|
280
212
|
value: {
|
|
281
|
-
actionColor:
|
|
282
|
-
actionPressedColor:
|
|
213
|
+
actionColor: colors.action,
|
|
214
|
+
actionPressedColor: colors.pressed,
|
|
283
215
|
iconSize: variantStyles.iconSize,
|
|
284
216
|
actionButtonSize: variantStyles.actionSize
|
|
285
217
|
}
|
|
286
218
|
},
|
|
287
|
-
/* @__PURE__ */
|
|
288
|
-
|
|
219
|
+
/* @__PURE__ */ _react2.default.createElement(
|
|
220
|
+
_reactnativereanimated2.default.View,
|
|
289
221
|
{
|
|
290
222
|
style: [
|
|
291
223
|
styles.container,
|
|
@@ -297,35 +229,35 @@ var Toolbar = ({
|
|
|
297
229
|
width: variantStyles.containerWidth
|
|
298
230
|
},
|
|
299
231
|
style,
|
|
300
|
-
customAppearance
|
|
232
|
+
_optionalChain([customAppearance, 'optionalAccess', _ => _.container])
|
|
301
233
|
]
|
|
302
234
|
},
|
|
303
|
-
/* @__PURE__ */
|
|
304
|
-
|
|
235
|
+
/* @__PURE__ */ _react2.default.createElement(
|
|
236
|
+
_reactnative.View,
|
|
305
237
|
{
|
|
306
238
|
style: [
|
|
307
239
|
isVertical ? styles.contentVertical : styles.content,
|
|
308
240
|
{
|
|
309
|
-
backgroundColor:
|
|
241
|
+
backgroundColor: colors.background,
|
|
310
242
|
borderRadius: variantStyles.borderRadius,
|
|
311
243
|
paddingHorizontal: variantStyles.paddingHorizontal,
|
|
312
244
|
paddingVertical: variantStyles.paddingVertical,
|
|
313
245
|
borderBottomWidth: showDivider ? 1 : 0,
|
|
314
|
-
borderBottomColor: showDivider ?
|
|
246
|
+
borderBottomColor: showDivider ? colors.divider : "transparent",
|
|
315
247
|
height: "100%",
|
|
316
248
|
width: "100%"
|
|
317
249
|
},
|
|
318
|
-
shouldElevate && [styles.elevated, { shadowColor:
|
|
319
|
-
customAppearance
|
|
250
|
+
shouldElevate && [styles.elevated, { shadowColor: colors.shadow }],
|
|
251
|
+
_optionalChain([customAppearance, 'optionalAccess', _2 => _2.topRow])
|
|
320
252
|
]
|
|
321
253
|
},
|
|
322
|
-
/* @__PURE__ */
|
|
323
|
-
|
|
254
|
+
/* @__PURE__ */ _react2.default.createElement(
|
|
255
|
+
_reactnative.View,
|
|
324
256
|
{
|
|
325
257
|
style: [
|
|
326
258
|
isVertical ? styles.actionsVertical : styles.actions,
|
|
327
259
|
{ gap: variantStyles.gap },
|
|
328
|
-
customAppearance
|
|
260
|
+
_optionalChain([customAppearance, 'optionalAccess', _3 => _3.actionsContainer])
|
|
329
261
|
]
|
|
330
262
|
},
|
|
331
263
|
children
|
|
@@ -350,8 +282,8 @@ function getInitialTranslate(position) {
|
|
|
350
282
|
}
|
|
351
283
|
|
|
352
284
|
// src/components/toolbar/toolbar-action.tsx
|
|
353
|
-
|
|
354
|
-
|
|
285
|
+
|
|
286
|
+
|
|
355
287
|
var ToolbarAction = ({
|
|
356
288
|
icon,
|
|
357
289
|
isDisabled = false,
|
|
@@ -363,11 +295,11 @@ var ToolbarAction = ({
|
|
|
363
295
|
}) => {
|
|
364
296
|
const context = useToolbarContext();
|
|
365
297
|
const iconNode = typeof icon === "function" ? icon({
|
|
366
|
-
color: context
|
|
367
|
-
size: context
|
|
298
|
+
color: _nullishCoalesce(_optionalChain([context, 'optionalAccess', _4 => _4.actionColor]), () => ( "#000000")),
|
|
299
|
+
size: _nullishCoalesce(_optionalChain([context, 'optionalAccess', _5 => _5.iconSize]), () => ( 26))
|
|
368
300
|
}) : icon;
|
|
369
|
-
return /* @__PURE__ */
|
|
370
|
-
|
|
301
|
+
return /* @__PURE__ */ _react2.default.createElement(
|
|
302
|
+
_reactnative.Pressable,
|
|
371
303
|
{
|
|
372
304
|
onPress: isDisabled ? void 0 : onPress,
|
|
373
305
|
onLongPress: isDisabled ? void 0 : onLongPress,
|
|
@@ -377,9 +309,9 @@ var ToolbarAction = ({
|
|
|
377
309
|
style: ({ pressed }) => [
|
|
378
310
|
styles.actionButton,
|
|
379
311
|
{
|
|
380
|
-
width: context
|
|
381
|
-
height: context
|
|
382
|
-
backgroundColor: pressed ? context
|
|
312
|
+
width: _nullishCoalesce(_optionalChain([context, 'optionalAccess', _6 => _6.actionButtonSize]), () => ( 40)),
|
|
313
|
+
height: _nullishCoalesce(_optionalChain([context, 'optionalAccess', _7 => _7.actionButtonSize]), () => ( 40)),
|
|
314
|
+
backgroundColor: pressed ? _nullishCoalesce(_optionalChain([context, 'optionalAccess', _8 => _8.actionPressedColor]), () => ( "transparent")) : "transparent"
|
|
383
315
|
},
|
|
384
316
|
isDisabled && styles.disabledAction,
|
|
385
317
|
style
|
|
@@ -388,8 +320,7 @@ var ToolbarAction = ({
|
|
|
388
320
|
iconNode
|
|
389
321
|
);
|
|
390
322
|
};
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
});
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
exports.Toolbar = Toolbar; exports.ToolbarAction = ToolbarAction;
|
package/dist/toolbar/index.js
CHANGED
|
@@ -1,96 +1,27 @@
|
|
|
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);
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }require('../chunk-HSPTLUFA.cjs');
|
|
29
2
|
|
|
30
|
-
|
|
31
|
-
var
|
|
32
|
-
__export(typography_exports, {
|
|
33
|
-
Typography: () => Typography
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(typography_exports);
|
|
3
|
+
|
|
4
|
+
var _chunkOQ2BLOOGcjs = require('../chunk-OQ2BLOOG.cjs');
|
|
36
5
|
|
|
37
6
|
// src/components/typography/typography.tsx
|
|
38
|
-
var
|
|
39
|
-
var
|
|
7
|
+
var _react = require('react'); var _react2 = _interopRequireDefault(_react);
|
|
8
|
+
var _reactnative = require('react-native');
|
|
40
9
|
|
|
41
10
|
// src/components/typography/typography.style.ts
|
|
42
|
-
|
|
43
|
-
var styles =
|
|
11
|
+
|
|
12
|
+
var styles = _reactnative.StyleSheet.create({
|
|
44
13
|
text: {
|
|
45
14
|
includeFontPadding: false
|
|
46
15
|
}
|
|
47
16
|
});
|
|
48
17
|
|
|
49
18
|
// src/components/typography/typography.hook.ts
|
|
50
|
-
var import_react6 = require("react");
|
|
51
|
-
|
|
52
|
-
// src/core/theme-context.tsx
|
|
53
|
-
var import_react4 = __toESM(require("react"), 1);
|
|
54
|
-
var import_react_native3 = require("react-native");
|
|
55
|
-
var import_theme = require("@xaui/core/theme");
|
|
56
|
-
var import_palette = require("@xaui/core/palette");
|
|
57
|
-
|
|
58
|
-
// src/core/portal/portal.tsx
|
|
59
|
-
var import_react2 = require("react");
|
|
60
|
-
|
|
61
|
-
// src/core/portal/portal-context.ts
|
|
62
|
-
var import_react = require("react");
|
|
63
|
-
var PortalContext = (0, import_react.createContext)(null);
|
|
64
|
-
|
|
65
|
-
// src/core/portal/portal-host.tsx
|
|
66
|
-
var import_react3 = __toESM(require("react"), 1);
|
|
67
|
-
var import_react_native2 = require("react-native");
|
|
68
|
-
var hostStyles = import_react_native2.StyleSheet.create({
|
|
69
|
-
container: {
|
|
70
|
-
flex: 1
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
// src/core/theme-context.tsx
|
|
75
|
-
var XUIThemeContext = (0, import_react4.createContext)(null);
|
|
76
|
-
|
|
77
|
-
// src/core/theme-hooks.ts
|
|
78
|
-
var import_react5 = require("react");
|
|
79
|
-
var import_react_native4 = require("react-native");
|
|
80
|
-
function useXUITheme() {
|
|
81
|
-
const theme = (0, import_react5.useContext)(XUIThemeContext);
|
|
82
|
-
if (!theme) {
|
|
83
|
-
throw new Error("useXUITheme must be used within XUIProvider");
|
|
84
|
-
}
|
|
85
|
-
return theme;
|
|
86
|
-
}
|
|
87
19
|
|
|
88
|
-
|
|
89
|
-
var import_theme2 = require("@xaui/core/theme");
|
|
90
|
-
|
|
91
|
-
// src/components/typography/typography.hook.ts
|
|
92
|
-
var import_core2 = require("@xaui/core");
|
|
20
|
+
var _core = require('@xaui/core');
|
|
93
21
|
var knownVariants = {
|
|
22
|
+
displayLarge: true,
|
|
23
|
+
displayMedium: true,
|
|
24
|
+
displaySmall: true,
|
|
94
25
|
caption: true,
|
|
95
26
|
headlineLarge: true,
|
|
96
27
|
headlineMedium: true,
|
|
@@ -106,19 +37,19 @@ var isKnownVariant = (variant) => {
|
|
|
106
37
|
return Boolean(knownVariants[variant]);
|
|
107
38
|
};
|
|
108
39
|
var useTypographyColor = (themeColor) => {
|
|
109
|
-
const theme = useXUITheme();
|
|
110
|
-
const color = (0,
|
|
40
|
+
const theme = _chunkOQ2BLOOGcjs.useXUITheme.call(void 0, );
|
|
41
|
+
const color = _react.useMemo.call(void 0, () => {
|
|
111
42
|
if (themeColor === "default") {
|
|
112
43
|
return theme.colors.foreground;
|
|
113
44
|
}
|
|
114
|
-
const safeThemeColor = (0,
|
|
45
|
+
const safeThemeColor = _core.getSafeThemeColor.call(void 0, themeColor);
|
|
115
46
|
return theme.colors[safeThemeColor].main;
|
|
116
47
|
}, [theme, themeColor]);
|
|
117
48
|
return color;
|
|
118
49
|
};
|
|
119
50
|
var useTypographyVariantStyles = (variant) => {
|
|
120
|
-
const theme = useXUITheme();
|
|
121
|
-
const variantStyles = (0,
|
|
51
|
+
const theme = _chunkOQ2BLOOGcjs.useXUITheme.call(void 0, );
|
|
52
|
+
const variantStyles = _react.useMemo.call(void 0, () => {
|
|
122
53
|
if (!isKnownVariant(variant)) {
|
|
123
54
|
return {
|
|
124
55
|
fontFamily: theme.fontFamilies.body,
|
|
@@ -127,6 +58,21 @@ var useTypographyVariantStyles = (variant) => {
|
|
|
127
58
|
};
|
|
128
59
|
}
|
|
129
60
|
const styles2 = {
|
|
61
|
+
displayLarge: {
|
|
62
|
+
fontFamily: theme.fontFamilies.heading,
|
|
63
|
+
fontSize: 72,
|
|
64
|
+
fontWeight: theme.fontWeights.semibold
|
|
65
|
+
},
|
|
66
|
+
displayMedium: {
|
|
67
|
+
fontFamily: theme.fontFamilies.heading,
|
|
68
|
+
fontSize: 57,
|
|
69
|
+
fontWeight: theme.fontWeights.semibold
|
|
70
|
+
},
|
|
71
|
+
displaySmall: {
|
|
72
|
+
fontFamily: theme.fontFamilies.heading,
|
|
73
|
+
fontSize: 45,
|
|
74
|
+
fontWeight: theme.fontWeights.semibold
|
|
75
|
+
},
|
|
130
76
|
caption: {
|
|
131
77
|
fontFamily: theme.fontFamilies.body,
|
|
132
78
|
fontSize: theme.fontSizes.xs,
|
|
@@ -196,13 +142,13 @@ var Typography = ({
|
|
|
196
142
|
const color = useTypographyColor(themeColor);
|
|
197
143
|
const variantStyles = useTypographyVariantStyles(variant);
|
|
198
144
|
const colorStyle = { color };
|
|
199
|
-
const ellipsizeMode = (0,
|
|
145
|
+
const ellipsizeMode = _react.useMemo.call(void 0, () => {
|
|
200
146
|
if (!maxLines) return void 0;
|
|
201
147
|
if (overflow === "clip") return "clip";
|
|
202
148
|
return "tail";
|
|
203
149
|
}, [maxLines, overflow]);
|
|
204
|
-
return /* @__PURE__ */
|
|
205
|
-
|
|
150
|
+
return /* @__PURE__ */ _react2.default.createElement(
|
|
151
|
+
_reactnative.Text,
|
|
206
152
|
{
|
|
207
153
|
numberOfLines: maxLines,
|
|
208
154
|
ellipsizeMode,
|
|
@@ -217,7 +163,6 @@ var Typography = ({
|
|
|
217
163
|
children
|
|
218
164
|
);
|
|
219
165
|
};
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
});
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
exports.Typography = Typography;
|
|
@@ -3,7 +3,7 @@ import { StyleProp, TextStyle } from 'react-native';
|
|
|
3
3
|
import { T as ThemeColor } from '../index-BOw6tbkc.cjs';
|
|
4
4
|
|
|
5
5
|
type TypographyAlign = 'center' | 'justify' | 'left' | 'right';
|
|
6
|
-
type TypographyVariant = 'caption' | 'headlineLarge' | 'headlineMedium' | 'headlineSmall' | 'subtitleLarge' | 'subtitleMedium' | 'subtitleSmall' | 'bodyLarge' | 'bodyMedium' | 'bodySmall' | string;
|
|
6
|
+
type TypographyVariant = 'displayLarge' | 'displayMedium' | 'displaySmall' | 'caption' | 'headlineLarge' | 'headlineMedium' | 'headlineSmall' | 'subtitleLarge' | 'subtitleMedium' | 'subtitleSmall' | 'bodyLarge' | 'bodyMedium' | 'bodySmall' | string;
|
|
7
7
|
type TypographyProps = {
|
|
8
8
|
/**
|
|
9
9
|
* The content to display inside the typography component.
|
|
@@ -3,7 +3,7 @@ import { StyleProp, TextStyle } from 'react-native';
|
|
|
3
3
|
import { T as ThemeColor } from '../index-BOw6tbkc.js';
|
|
4
4
|
|
|
5
5
|
type TypographyAlign = 'center' | 'justify' | 'left' | 'right';
|
|
6
|
-
type TypographyVariant = 'caption' | 'headlineLarge' | 'headlineMedium' | 'headlineSmall' | 'subtitleLarge' | 'subtitleMedium' | 'subtitleSmall' | 'bodyLarge' | 'bodyMedium' | 'bodySmall' | string;
|
|
6
|
+
type TypographyVariant = 'displayLarge' | 'displayMedium' | 'displaySmall' | 'caption' | 'headlineLarge' | 'headlineMedium' | 'headlineSmall' | 'subtitleLarge' | 'subtitleMedium' | 'subtitleSmall' | 'bodyLarge' | 'bodyMedium' | 'bodySmall' | string;
|
|
7
7
|
type TypographyProps = {
|
|
8
8
|
/**
|
|
9
9
|
* The content to display inside the typography component.
|
package/dist/typography/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import "../chunk-DXXNBF5P.js";
|
|
1
2
|
import {
|
|
2
3
|
useXUITheme
|
|
3
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-LTKYHG5V.js";
|
|
4
5
|
|
|
5
6
|
// src/components/typography/typography.tsx
|
|
6
7
|
import React, { useMemo as useMemo2 } from "react";
|
|
@@ -18,6 +19,9 @@ var styles = StyleSheet.create({
|
|
|
18
19
|
import { useMemo } from "react";
|
|
19
20
|
import { getSafeThemeColor } from "@xaui/core";
|
|
20
21
|
var knownVariants = {
|
|
22
|
+
displayLarge: true,
|
|
23
|
+
displayMedium: true,
|
|
24
|
+
displaySmall: true,
|
|
21
25
|
caption: true,
|
|
22
26
|
headlineLarge: true,
|
|
23
27
|
headlineMedium: true,
|
|
@@ -54,6 +58,21 @@ var useTypographyVariantStyles = (variant) => {
|
|
|
54
58
|
};
|
|
55
59
|
}
|
|
56
60
|
const styles2 = {
|
|
61
|
+
displayLarge: {
|
|
62
|
+
fontFamily: theme.fontFamilies.heading,
|
|
63
|
+
fontSize: 72,
|
|
64
|
+
fontWeight: theme.fontWeights.semibold
|
|
65
|
+
},
|
|
66
|
+
displayMedium: {
|
|
67
|
+
fontFamily: theme.fontFamilies.heading,
|
|
68
|
+
fontSize: 57,
|
|
69
|
+
fontWeight: theme.fontWeights.semibold
|
|
70
|
+
},
|
|
71
|
+
displaySmall: {
|
|
72
|
+
fontFamily: theme.fontFamilies.heading,
|
|
73
|
+
fontSize: 45,
|
|
74
|
+
fontWeight: theme.fontWeights.semibold
|
|
75
|
+
},
|
|
57
76
|
caption: {
|
|
58
77
|
fontFamily: theme.fontFamilies.body,
|
|
59
78
|
fontSize: theme.fontSizes.xs,
|