@xaui/native 0.2.8 → 0.9.1-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/dist/chunk-JDS6KGCM.cjs +791 -0
- package/dist/chunk-T3ZI2PZ6.js +791 -0
- package/dist/index.cjs +32 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +32 -0
- package/dist/theme/index.cjs +32 -0
- package/dist/theme/index.d.cts +669 -0
- package/dist/theme/index.d.ts +669 -0
- package/dist/theme/index.js +32 -0
- package/package.json +26 -249
- package/README.md +0 -178
- package/dist/alert/index.cjs +0 -340
- package/dist/alert/index.d.cts +0 -46
- package/dist/alert/index.d.ts +0 -46
- package/dist/alert/index.js +0 -340
- package/dist/app-bar/index.cjs +0 -148
- package/dist/app-bar/index.d.cts +0 -59
- package/dist/app-bar/index.d.ts +0 -59
- package/dist/app-bar/index.js +0 -148
- package/dist/autocomplete/index.cjs +0 -1122
- package/dist/autocomplete/index.d.cts +0 -88
- package/dist/autocomplete/index.d.ts +0 -88
- package/dist/autocomplete/index.js +0 -1122
- package/dist/avatar/index.cjs +0 -281
- package/dist/avatar/index.d.cts +0 -123
- package/dist/avatar/index.d.ts +0 -123
- package/dist/avatar/index.js +0 -281
- package/dist/badge/index.cjs +0 -197
- package/dist/badge/index.d.cts +0 -94
- package/dist/badge/index.d.ts +0 -94
- package/dist/badge/index.js +0 -197
- package/dist/bottom-sheet/index.cjs +0 -9
- package/dist/bottom-sheet/index.d.cts +0 -84
- package/dist/bottom-sheet/index.d.ts +0 -84
- package/dist/bottom-sheet/index.js +0 -9
- package/dist/bottom-tab-bar/index.cjs +0 -497
- package/dist/bottom-tab-bar/index.d.cts +0 -211
- package/dist/bottom-tab-bar/index.d.ts +0 -211
- package/dist/bottom-tab-bar/index.js +0 -497
- package/dist/button/index.cjs +0 -392
- package/dist/button/index.d.cts +0 -174
- package/dist/button/index.d.ts +0 -174
- package/dist/button/index.js +0 -392
- package/dist/button.type-j1ZdkkSl.d.cts +0 -4
- package/dist/button.type-j1ZdkkSl.d.ts +0 -4
- package/dist/card/index.cjs +0 -338
- package/dist/card/index.d.cts +0 -191
- package/dist/card/index.d.ts +0 -191
- package/dist/card/index.js +0 -338
- package/dist/carousel/index.cjs +0 -381
- package/dist/carousel/index.d.cts +0 -147
- package/dist/carousel/index.d.ts +0 -147
- package/dist/carousel/index.js +0 -381
- package/dist/chart/index.cjs +0 -1026
- package/dist/chart/index.d.cts +0 -218
- package/dist/chart/index.d.ts +0 -218
- package/dist/chart/index.js +0 -1026
- package/dist/checkbox/index.cjs +0 -443
- package/dist/checkbox/index.d.cts +0 -73
- package/dist/checkbox/index.d.ts +0 -73
- package/dist/checkbox/index.js +0 -443
- package/dist/chip/index.cjs +0 -503
- package/dist/chip/index.d.cts +0 -195
- package/dist/chip/index.d.ts +0 -195
- package/dist/chip/index.js +0 -503
- package/dist/chunk-4JFWQ5XT.js +0 -368
- package/dist/chunk-56RPWZD2.cjs +0 -9
- package/dist/chunk-7UFBLUMV.cjs +0 -136
- package/dist/chunk-A45TVXU5.js +0 -337
- package/dist/chunk-BYWUAPC4.cjs +0 -368
- package/dist/chunk-DECMUMCI.js +0 -0
- package/dist/chunk-DHSTKO3K.cjs +0 -19
- package/dist/chunk-DJ4Q37UT.cjs +0 -75
- package/dist/chunk-EUQDGTST.cjs +0 -1
- package/dist/chunk-GBHQCAKW.js +0 -19
- package/dist/chunk-RBSA4NH4.js +0 -136
- package/dist/chunk-SHBDANQN.js +0 -9
- package/dist/chunk-UGEINZM7.cjs +0 -290
- package/dist/chunk-UU4HHBDN.js +0 -290
- package/dist/chunk-VSZEXOUN.js +0 -384
- package/dist/chunk-YIEUN3G5.cjs +0 -384
- package/dist/chunk-ZH6ZSV2Q.cjs +0 -337
- package/dist/chunk-ZY7IUTAT.js +0 -75
- package/dist/color-picker/index.cjs +0 -457
- package/dist/color-picker/index.d.cts +0 -124
- package/dist/color-picker/index.d.ts +0 -124
- package/dist/color-picker/index.js +0 -457
- package/dist/core/index.cjs +0 -24
- package/dist/core/index.d.cts +0 -28
- package/dist/core/index.d.ts +0 -28
- package/dist/core/index.js +0 -24
- package/dist/datepicker/index.cjs +0 -1625
- package/dist/datepicker/index.d.cts +0 -45
- package/dist/datepicker/index.d.ts +0 -45
- package/dist/datepicker/index.js +0 -1625
- package/dist/dialog/index.cjs +0 -372
- package/dist/dialog/index.d.cts +0 -151
- package/dist/dialog/index.d.ts +0 -151
- package/dist/dialog/index.js +0 -372
- package/dist/divider/index.cjs +0 -8
- package/dist/divider/index.d.cts +0 -30
- package/dist/divider/index.d.ts +0 -30
- package/dist/divider/index.js +0 -8
- package/dist/drawer/index.cjs +0 -237
- package/dist/drawer/index.d.cts +0 -58
- package/dist/drawer/index.d.ts +0 -58
- package/dist/drawer/index.js +0 -237
- package/dist/expansion-panel/index.cjs +0 -441
- package/dist/expansion-panel/index.d.cts +0 -153
- package/dist/expansion-panel/index.d.ts +0 -153
- package/dist/expansion-panel/index.js +0 -441
- package/dist/fab/index.cjs +0 -9
- package/dist/fab/index.d.cts +0 -10
- package/dist/fab/index.d.ts +0 -10
- package/dist/fab/index.js +0 -9
- package/dist/fab-menu/index.cjs +0 -330
- package/dist/fab-menu/index.d.cts +0 -125
- package/dist/fab-menu/index.d.ts +0 -125
- package/dist/fab-menu/index.js +0 -330
- package/dist/fab.type-CkUHmXU_.d.ts +0 -86
- package/dist/fab.type-DN0vtAh6.d.cts +0 -86
- package/dist/feature-discovery/index.cjs +0 -464
- package/dist/feature-discovery/index.d.cts +0 -82
- package/dist/feature-discovery/index.d.ts +0 -82
- package/dist/feature-discovery/index.js +0 -464
- package/dist/indicator/index.cjs +0 -8
- package/dist/indicator/index.d.cts +0 -47
- package/dist/indicator/index.d.ts +0 -47
- package/dist/indicator/index.js +0 -8
- package/dist/input/index.cjs +0 -1462
- package/dist/input/index.d.cts +0 -522
- package/dist/input/index.d.ts +0 -522
- package/dist/input/index.js +0 -1462
- package/dist/input-trigger/index.cjs +0 -197
- package/dist/input-trigger/index.d.cts +0 -11
- package/dist/input-trigger/index.d.ts +0 -11
- package/dist/input-trigger/index.js +0 -197
- package/dist/input-trigger.type-Ba4bM3Qp.d.cts +0 -180
- package/dist/input-trigger.type-Ba4bM3Qp.d.ts +0 -180
- package/dist/list/index.cjs +0 -395
- package/dist/list/index.d.cts +0 -188
- package/dist/list/index.d.ts +0 -188
- package/dist/list/index.js +0 -395
- package/dist/menu/index.cjs +0 -316
- package/dist/menu/index.d.cts +0 -115
- package/dist/menu/index.d.ts +0 -115
- package/dist/menu/index.js +0 -316
- package/dist/menubox/index.cjs +0 -297
- package/dist/menubox/index.d.cts +0 -98
- package/dist/menubox/index.d.ts +0 -98
- package/dist/menubox/index.js +0 -297
- package/dist/pager/index.cjs +0 -205
- package/dist/pager/index.d.cts +0 -93
- package/dist/pager/index.d.ts +0 -93
- package/dist/pager/index.js +0 -205
- package/dist/picker/index.cjs +0 -244
- package/dist/picker/index.d.cts +0 -121
- package/dist/picker/index.d.ts +0 -121
- package/dist/picker/index.js +0 -244
- package/dist/progress/index.cjs +0 -219
- package/dist/progress/index.d.cts +0 -47
- package/dist/progress/index.d.ts +0 -47
- package/dist/progress/index.js +0 -219
- package/dist/radio/index.cjs +0 -465
- package/dist/radio/index.d.cts +0 -145
- package/dist/radio/index.d.ts +0 -145
- package/dist/radio/index.js +0 -465
- package/dist/refresh-control/index.cjs +0 -45
- package/dist/refresh-control/index.d.cts +0 -55
- package/dist/refresh-control/index.d.ts +0 -55
- package/dist/refresh-control/index.js +0 -45
- package/dist/segment-button/index.cjs +0 -405
- package/dist/segment-button/index.d.cts +0 -141
- package/dist/segment-button/index.d.ts +0 -141
- package/dist/segment-button/index.js +0 -405
- package/dist/select/index.cjs +0 -878
- package/dist/select/index.d.cts +0 -192
- package/dist/select/index.d.ts +0 -192
- package/dist/select/index.js +0 -878
- package/dist/skeleton/index.cjs +0 -89
- package/dist/skeleton/index.d.cts +0 -45
- package/dist/skeleton/index.d.ts +0 -45
- package/dist/skeleton/index.js +0 -89
- package/dist/slider/index.cjs +0 -576
- package/dist/slider/index.d.cts +0 -171
- package/dist/slider/index.d.ts +0 -171
- package/dist/slider/index.js +0 -576
- package/dist/snackbar/index.cjs +0 -436
- package/dist/snackbar/index.d.cts +0 -174
- package/dist/snackbar/index.d.ts +0 -174
- package/dist/snackbar/index.js +0 -436
- package/dist/snippet/index.cjs +0 -314
- package/dist/snippet/index.d.cts +0 -95
- package/dist/snippet/index.d.ts +0 -95
- package/dist/snippet/index.js +0 -314
- package/dist/stepper/index.cjs +0 -550
- package/dist/stepper/index.d.cts +0 -137
- package/dist/stepper/index.d.ts +0 -137
- package/dist/stepper/index.js +0 -550
- package/dist/switch/index.cjs +0 -358
- package/dist/switch/index.d.cts +0 -28
- package/dist/switch/index.d.ts +0 -28
- package/dist/switch/index.js +0 -358
- package/dist/tabs/index.cjs +0 -440
- package/dist/tabs/index.d.cts +0 -180
- package/dist/tabs/index.d.ts +0 -180
- package/dist/tabs/index.js +0 -440
- package/dist/timepicker/index.cjs +0 -823
- package/dist/timepicker/index.d.cts +0 -215
- package/dist/timepicker/index.d.ts +0 -215
- package/dist/timepicker/index.js +0 -823
- package/dist/toolbar/index.cjs +0 -333
- package/dist/toolbar/index.d.cts +0 -100
- package/dist/toolbar/index.d.ts +0 -100
- package/dist/toolbar/index.js +0 -333
- package/dist/typography/index.cjs +0 -238
- package/dist/typography/index.d.cts +0 -113
- package/dist/typography/index.d.ts +0 -113
- package/dist/typography/index.js +0 -238
- package/dist/view/index.cjs +0 -1361
- package/dist/view/index.d.cts +0 -833
- package/dist/view/index.d.ts +0 -833
- package/dist/view/index.js +0 -1361
package/dist/toolbar/index.cjs
DELETED
|
@@ -1,333 +0,0 @@
|
|
|
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-56RPWZD2.cjs');
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var _chunk7UFBLUMVcjs = require('../chunk-7UFBLUMV.cjs');
|
|
5
|
-
|
|
6
|
-
// src/components/toolbar/toolbar.tsx
|
|
7
|
-
var _react = require('react'); var _react2 = _interopRequireDefault(_react);
|
|
8
|
-
var _reactnative = require('react-native');
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var _reactnativereanimated = require('react-native-reanimated'); var _reactnativereanimated2 = _interopRequireDefault(_reactnativereanimated);
|
|
15
|
-
|
|
16
|
-
// src/components/toolbar/toolbar.hook.ts
|
|
17
|
-
|
|
18
|
-
var _core = require('@xaui/core');
|
|
19
|
-
var variantMap = {
|
|
20
|
-
floating: {
|
|
21
|
-
containerHeight: 68,
|
|
22
|
-
containerWidth: "auto",
|
|
23
|
-
iconSize: 26,
|
|
24
|
-
actionSize: 40,
|
|
25
|
-
borderRadius: 56,
|
|
26
|
-
paddingHorizontal: 16,
|
|
27
|
-
paddingVertical: 14,
|
|
28
|
-
gap: 0,
|
|
29
|
-
isElevated: true
|
|
30
|
-
},
|
|
31
|
-
docked: {
|
|
32
|
-
containerHeight: 68,
|
|
33
|
-
containerWidth: "auto",
|
|
34
|
-
iconSize: 26,
|
|
35
|
-
actionSize: 40,
|
|
36
|
-
borderRadius: 0,
|
|
37
|
-
paddingHorizontal: 16,
|
|
38
|
-
paddingVertical: 14,
|
|
39
|
-
gap: 0,
|
|
40
|
-
isElevated: false
|
|
41
|
-
},
|
|
42
|
-
vertical: {
|
|
43
|
-
containerHeight: "auto",
|
|
44
|
-
containerWidth: 80,
|
|
45
|
-
iconSize: 26,
|
|
46
|
-
actionSize: 40,
|
|
47
|
-
borderRadius: 0,
|
|
48
|
-
paddingHorizontal: 16,
|
|
49
|
-
paddingVertical: 14,
|
|
50
|
-
gap: 0,
|
|
51
|
-
isElevated: false
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
var useToolbarVariantStyles = (variant, position) => {
|
|
55
|
-
return _react.useMemo.call(void 0, () => {
|
|
56
|
-
const baseStyles = variantMap[variant];
|
|
57
|
-
const isVertical = variant === "vertical";
|
|
58
|
-
return {
|
|
59
|
-
...baseStyles,
|
|
60
|
-
isVertical,
|
|
61
|
-
position
|
|
62
|
-
};
|
|
63
|
-
}, [variant, position]);
|
|
64
|
-
};
|
|
65
|
-
var useToolbarColors = (themeColor) => {
|
|
66
|
-
const theme = _chunk7UFBLUMVcjs.useXUITheme.call(void 0, );
|
|
67
|
-
const colorScheme = theme.colors[_core.getSafeThemeColor.call(void 0, themeColor)];
|
|
68
|
-
return _react.useMemo.call(void 0, () => {
|
|
69
|
-
return {
|
|
70
|
-
background: theme.mode === "dark" ? theme.colors.default.container : theme.colors.background,
|
|
71
|
-
divider: _core.withOpacity.call(void 0, theme.colors.foreground, 0.1),
|
|
72
|
-
title: theme.colors.foreground,
|
|
73
|
-
subtitle: _core.withOpacity.call(void 0, theme.colors.foreground, 0.72),
|
|
74
|
-
action: colorScheme.main,
|
|
75
|
-
pressed: _core.withOpacity.call(void 0, colorScheme.main, 0.16),
|
|
76
|
-
shadow: _core.withOpacity.call(void 0, theme.colors.foreground, 0.35)
|
|
77
|
-
};
|
|
78
|
-
}, [colorScheme.main, theme.colors, theme.mode]);
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
// src/components/toolbar/toolbar.style.ts
|
|
82
|
-
|
|
83
|
-
var styles = _reactnative.StyleSheet.create({
|
|
84
|
-
container: {
|
|
85
|
-
position: "absolute",
|
|
86
|
-
zIndex: 40
|
|
87
|
-
},
|
|
88
|
-
top: {
|
|
89
|
-
top: 0,
|
|
90
|
-
left: 0,
|
|
91
|
-
right: 0
|
|
92
|
-
},
|
|
93
|
-
bottom: {
|
|
94
|
-
bottom: 0,
|
|
95
|
-
left: 0,
|
|
96
|
-
right: 0
|
|
97
|
-
},
|
|
98
|
-
left: {
|
|
99
|
-
left: 0,
|
|
100
|
-
top: 0,
|
|
101
|
-
bottom: 0
|
|
102
|
-
},
|
|
103
|
-
right: {
|
|
104
|
-
right: 0,
|
|
105
|
-
top: 0,
|
|
106
|
-
bottom: 0
|
|
107
|
-
},
|
|
108
|
-
floating: {
|
|
109
|
-
margin: 16
|
|
110
|
-
},
|
|
111
|
-
floatingBottom: {
|
|
112
|
-
marginBottom: 16
|
|
113
|
-
},
|
|
114
|
-
floatingTop: {
|
|
115
|
-
marginTop: 16
|
|
116
|
-
},
|
|
117
|
-
elevated: {
|
|
118
|
-
shadowOffset: { width: 0, height: 2 },
|
|
119
|
-
shadowOpacity: 0.15,
|
|
120
|
-
shadowRadius: 8,
|
|
121
|
-
elevation: 3
|
|
122
|
-
},
|
|
123
|
-
content: {
|
|
124
|
-
flexDirection: "row",
|
|
125
|
-
alignItems: "center"
|
|
126
|
-
},
|
|
127
|
-
contentVertical: {
|
|
128
|
-
flexDirection: "column",
|
|
129
|
-
alignItems: "center",
|
|
130
|
-
justifyContent: "center"
|
|
131
|
-
},
|
|
132
|
-
actions: {
|
|
133
|
-
flexDirection: "row",
|
|
134
|
-
alignItems: "center",
|
|
135
|
-
justifyContent: "space-between",
|
|
136
|
-
width: "100%"
|
|
137
|
-
},
|
|
138
|
-
actionsVertical: {
|
|
139
|
-
flexDirection: "column",
|
|
140
|
-
alignItems: "center",
|
|
141
|
-
justifyContent: "space-between",
|
|
142
|
-
height: "100%"
|
|
143
|
-
},
|
|
144
|
-
actionButton: {
|
|
145
|
-
alignItems: "center",
|
|
146
|
-
justifyContent: "center",
|
|
147
|
-
borderRadius: 999
|
|
148
|
-
},
|
|
149
|
-
disabledAction: {
|
|
150
|
-
opacity: 0.38
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
// src/components/toolbar/toolbar-context.ts
|
|
155
|
-
|
|
156
|
-
var ToolbarContext = _react.createContext.call(void 0, null);
|
|
157
|
-
var useToolbarContext = () => {
|
|
158
|
-
return _react.useContext.call(void 0, ToolbarContext);
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
// src/components/toolbar/toolbar.tsx
|
|
162
|
-
var Toolbar = ({
|
|
163
|
-
variant = "docked",
|
|
164
|
-
position = "top",
|
|
165
|
-
isVisible = true,
|
|
166
|
-
themeColor = "primary",
|
|
167
|
-
showDivider = false,
|
|
168
|
-
isElevated,
|
|
169
|
-
children,
|
|
170
|
-
style,
|
|
171
|
-
customAppearance
|
|
172
|
-
}) => {
|
|
173
|
-
const variantStyles = useToolbarVariantStyles(variant, position);
|
|
174
|
-
const colors = useToolbarColors(themeColor);
|
|
175
|
-
const translateValue = _reactnativereanimated.useSharedValue.call(void 0,
|
|
176
|
-
isVisible ? 0 : getInitialTranslate(position)
|
|
177
|
-
);
|
|
178
|
-
const opacityValue = _reactnativereanimated.useSharedValue.call(void 0, isVisible ? 1 : 0);
|
|
179
|
-
_react.useEffect.call(void 0, () => {
|
|
180
|
-
const nextTranslate = isVisible ? 0 : getInitialTranslate(position);
|
|
181
|
-
if (isVisible) {
|
|
182
|
-
translateValue.value = _reactnativereanimated.withTiming.call(void 0, nextTranslate, {
|
|
183
|
-
duration: 220,
|
|
184
|
-
easing: _reactnativereanimated.Easing.out(_reactnativereanimated.Easing.cubic)
|
|
185
|
-
});
|
|
186
|
-
opacityValue.value = _reactnativereanimated.withTiming.call(void 0, 1, {
|
|
187
|
-
duration: 200,
|
|
188
|
-
easing: _reactnativereanimated.Easing.out(_reactnativereanimated.Easing.quad)
|
|
189
|
-
});
|
|
190
|
-
} else {
|
|
191
|
-
translateValue.value = _reactnativereanimated.withTiming.call(void 0, nextTranslate, {
|
|
192
|
-
duration: 180,
|
|
193
|
-
easing: _reactnativereanimated.Easing.in(_reactnativereanimated.Easing.cubic)
|
|
194
|
-
});
|
|
195
|
-
opacityValue.value = _reactnativereanimated.withTiming.call(void 0, 0, {
|
|
196
|
-
duration: 150,
|
|
197
|
-
easing: _reactnativereanimated.Easing.in(_reactnativereanimated.Easing.quad)
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
}, [isVisible, position, translateValue, opacityValue]);
|
|
201
|
-
const animatedStyle = _reactnativereanimated.useAnimatedStyle.call(void 0, () => {
|
|
202
|
-
const transform = position === "left" || position === "right" ? [{ translateX: translateValue.value }] : [{ translateY: translateValue.value }];
|
|
203
|
-
return {
|
|
204
|
-
opacity: opacityValue.value,
|
|
205
|
-
transform
|
|
206
|
-
};
|
|
207
|
-
});
|
|
208
|
-
const isVertical = variantStyles.isVertical;
|
|
209
|
-
const shouldElevate = _nullishCoalesce(isElevated, () => ( variantStyles.isElevated));
|
|
210
|
-
const positionStyle = position === "top" ? styles.top : position === "bottom" ? styles.bottom : position === "left" ? styles.left : styles.right;
|
|
211
|
-
const floatingStyle = variant === "floating" ? [
|
|
212
|
-
styles.floating,
|
|
213
|
-
position === "bottom" && styles.floatingBottom,
|
|
214
|
-
position === "top" && styles.floatingTop
|
|
215
|
-
] : null;
|
|
216
|
-
return /* @__PURE__ */ _react2.default.createElement(
|
|
217
|
-
ToolbarContext.Provider,
|
|
218
|
-
{
|
|
219
|
-
value: {
|
|
220
|
-
actionColor: colors.action,
|
|
221
|
-
actionPressedColor: colors.pressed,
|
|
222
|
-
iconSize: variantStyles.iconSize,
|
|
223
|
-
actionButtonSize: variantStyles.actionSize
|
|
224
|
-
}
|
|
225
|
-
},
|
|
226
|
-
/* @__PURE__ */ _react2.default.createElement(
|
|
227
|
-
_reactnativereanimated2.default.View,
|
|
228
|
-
{
|
|
229
|
-
style: [
|
|
230
|
-
styles.container,
|
|
231
|
-
positionStyle,
|
|
232
|
-
floatingStyle,
|
|
233
|
-
animatedStyle,
|
|
234
|
-
{
|
|
235
|
-
height: variantStyles.containerHeight,
|
|
236
|
-
width: variantStyles.containerWidth
|
|
237
|
-
},
|
|
238
|
-
style,
|
|
239
|
-
_optionalChain([customAppearance, 'optionalAccess', _ => _.container])
|
|
240
|
-
]
|
|
241
|
-
},
|
|
242
|
-
/* @__PURE__ */ _react2.default.createElement(
|
|
243
|
-
_reactnative.View,
|
|
244
|
-
{
|
|
245
|
-
style: [
|
|
246
|
-
isVertical ? styles.contentVertical : styles.content,
|
|
247
|
-
{
|
|
248
|
-
backgroundColor: colors.background,
|
|
249
|
-
borderRadius: variantStyles.borderRadius,
|
|
250
|
-
paddingHorizontal: variantStyles.paddingHorizontal,
|
|
251
|
-
paddingVertical: variantStyles.paddingVertical,
|
|
252
|
-
borderBottomWidth: showDivider ? 1 : 0,
|
|
253
|
-
borderBottomColor: showDivider ? colors.divider : "transparent",
|
|
254
|
-
height: "100%",
|
|
255
|
-
width: "100%"
|
|
256
|
-
},
|
|
257
|
-
shouldElevate && [styles.elevated, { shadowColor: colors.shadow }],
|
|
258
|
-
_optionalChain([customAppearance, 'optionalAccess', _2 => _2.topRow])
|
|
259
|
-
]
|
|
260
|
-
},
|
|
261
|
-
/* @__PURE__ */ _react2.default.createElement(
|
|
262
|
-
_reactnative.View,
|
|
263
|
-
{
|
|
264
|
-
style: [
|
|
265
|
-
isVertical ? styles.actionsVertical : styles.actions,
|
|
266
|
-
{ gap: variantStyles.gap },
|
|
267
|
-
_optionalChain([customAppearance, 'optionalAccess', _3 => _3.actionsContainer])
|
|
268
|
-
]
|
|
269
|
-
},
|
|
270
|
-
children
|
|
271
|
-
)
|
|
272
|
-
)
|
|
273
|
-
)
|
|
274
|
-
);
|
|
275
|
-
};
|
|
276
|
-
function getInitialTranslate(position) {
|
|
277
|
-
switch (position) {
|
|
278
|
-
case "top":
|
|
279
|
-
return -24;
|
|
280
|
-
case "bottom":
|
|
281
|
-
return 24;
|
|
282
|
-
case "left":
|
|
283
|
-
return -24;
|
|
284
|
-
case "right":
|
|
285
|
-
return 24;
|
|
286
|
-
default:
|
|
287
|
-
return 0;
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
// src/components/toolbar/toolbar-action.tsx
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
var ToolbarAction = ({
|
|
295
|
-
icon,
|
|
296
|
-
isDisabled = false,
|
|
297
|
-
style,
|
|
298
|
-
onPress,
|
|
299
|
-
onLongPress,
|
|
300
|
-
accessibilityLabel,
|
|
301
|
-
testID
|
|
302
|
-
}) => {
|
|
303
|
-
const context = useToolbarContext();
|
|
304
|
-
const iconNode = typeof icon === "function" ? icon({
|
|
305
|
-
color: _nullishCoalesce(_optionalChain([context, 'optionalAccess', _4 => _4.actionColor]), () => ( "#000000")),
|
|
306
|
-
size: _nullishCoalesce(_optionalChain([context, 'optionalAccess', _5 => _5.iconSize]), () => ( 26))
|
|
307
|
-
}) : icon;
|
|
308
|
-
return /* @__PURE__ */ _react2.default.createElement(
|
|
309
|
-
_reactnative.Pressable,
|
|
310
|
-
{
|
|
311
|
-
onPress: isDisabled ? void 0 : onPress,
|
|
312
|
-
onLongPress: isDisabled ? void 0 : onLongPress,
|
|
313
|
-
accessibilityRole: "button",
|
|
314
|
-
accessibilityLabel,
|
|
315
|
-
testID,
|
|
316
|
-
style: ({ pressed }) => [
|
|
317
|
-
styles.actionButton,
|
|
318
|
-
{
|
|
319
|
-
width: _nullishCoalesce(_optionalChain([context, 'optionalAccess', _6 => _6.actionButtonSize]), () => ( 40)),
|
|
320
|
-
height: _nullishCoalesce(_optionalChain([context, 'optionalAccess', _7 => _7.actionButtonSize]), () => ( 40)),
|
|
321
|
-
backgroundColor: pressed ? _nullishCoalesce(_optionalChain([context, 'optionalAccess', _8 => _8.actionPressedColor]), () => ( "transparent")) : "transparent"
|
|
322
|
-
},
|
|
323
|
-
isDisabled && styles.disabledAction,
|
|
324
|
-
style
|
|
325
|
-
]
|
|
326
|
-
},
|
|
327
|
-
iconNode
|
|
328
|
-
);
|
|
329
|
-
};
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
exports.Toolbar = Toolbar; exports.ToolbarAction = ToolbarAction;
|
package/dist/toolbar/index.d.cts
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
2
|
-
import { StyleProp, ViewStyle, GestureResponderEvent } from 'react-native';
|
|
3
|
-
import { ThemeColor } from '@xaui/core/types';
|
|
4
|
-
|
|
5
|
-
type ToolbarVariant = 'floating' | 'docked' | 'vertical';
|
|
6
|
-
type ToolbarPosition = 'top' | 'bottom' | 'left' | 'right';
|
|
7
|
-
type ToolbarActionRenderParams = {
|
|
8
|
-
color: string;
|
|
9
|
-
size: number;
|
|
10
|
-
};
|
|
11
|
-
type ToolbarActionProps = {
|
|
12
|
-
/**
|
|
13
|
-
* Icon element or icon render function.
|
|
14
|
-
*/
|
|
15
|
-
icon: ReactNode | ((params: ToolbarActionRenderParams) => ReactNode);
|
|
16
|
-
/**
|
|
17
|
-
* Whether action is disabled.
|
|
18
|
-
* @default false
|
|
19
|
-
*/
|
|
20
|
-
isDisabled?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Custom action style.
|
|
23
|
-
*/
|
|
24
|
-
style?: StyleProp<ViewStyle>;
|
|
25
|
-
/**
|
|
26
|
-
* Callback fired when action is pressed.
|
|
27
|
-
*/
|
|
28
|
-
onPress?: (event: GestureResponderEvent) => void;
|
|
29
|
-
/**
|
|
30
|
-
* Callback fired when action is long-pressed.
|
|
31
|
-
*/
|
|
32
|
-
onLongPress?: (event: GestureResponderEvent) => void;
|
|
33
|
-
/**
|
|
34
|
-
* Accessibility label for action.
|
|
35
|
-
*/
|
|
36
|
-
accessibilityLabel?: string;
|
|
37
|
-
/**
|
|
38
|
-
* testID for e2e tests.
|
|
39
|
-
*/
|
|
40
|
-
testID?: string;
|
|
41
|
-
};
|
|
42
|
-
type ToolbarCustomAppearance = {
|
|
43
|
-
container?: StyleProp<ViewStyle>;
|
|
44
|
-
topRow?: StyleProp<ViewStyle>;
|
|
45
|
-
actionsContainer?: StyleProp<ViewStyle>;
|
|
46
|
-
};
|
|
47
|
-
type ToolbarProps = {
|
|
48
|
-
/**
|
|
49
|
-
* Toolbar variant.
|
|
50
|
-
* - floating: rounded floating bar
|
|
51
|
-
* - docked: fixed bar without rounding
|
|
52
|
-
* - vertical: vertical bar (always centered)
|
|
53
|
-
* @default 'docked'
|
|
54
|
-
*/
|
|
55
|
-
variant?: ToolbarVariant;
|
|
56
|
-
/**
|
|
57
|
-
* Toolbar position.
|
|
58
|
-
* - For floating/docked: 'top' | 'bottom'
|
|
59
|
-
* - For vertical: 'left' | 'right'
|
|
60
|
-
* @default 'top'
|
|
61
|
-
*/
|
|
62
|
-
position?: ToolbarPosition;
|
|
63
|
-
/**
|
|
64
|
-
* Whether toolbar is visible (with animation).
|
|
65
|
-
* @default true
|
|
66
|
-
*/
|
|
67
|
-
isVisible?: boolean;
|
|
68
|
-
/**
|
|
69
|
-
* Theme color used for accent and icon tint.
|
|
70
|
-
* @default 'primary'
|
|
71
|
-
*/
|
|
72
|
-
themeColor?: ThemeColor;
|
|
73
|
-
/**
|
|
74
|
-
* Whether to render a divider.
|
|
75
|
-
* @default false
|
|
76
|
-
*/
|
|
77
|
-
showDivider?: boolean;
|
|
78
|
-
/**
|
|
79
|
-
* Whether to show elevation shadow. If not provided, uses variant default.
|
|
80
|
-
*/
|
|
81
|
-
isElevated?: boolean;
|
|
82
|
-
/**
|
|
83
|
-
* Toolbar action items.
|
|
84
|
-
*/
|
|
85
|
-
children?: ReactNode;
|
|
86
|
-
/**
|
|
87
|
-
* Custom container style.
|
|
88
|
-
*/
|
|
89
|
-
style?: StyleProp<ViewStyle>;
|
|
90
|
-
/**
|
|
91
|
-
* Optional custom appearance styles.
|
|
92
|
-
*/
|
|
93
|
-
customAppearance?: ToolbarCustomAppearance;
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
declare const Toolbar: React.FC<ToolbarProps>;
|
|
97
|
-
|
|
98
|
-
declare const ToolbarAction: React.FC<ToolbarActionProps>;
|
|
99
|
-
|
|
100
|
-
export { Toolbar, ToolbarAction, type ToolbarActionProps, type ToolbarActionRenderParams, type ToolbarCustomAppearance, type ToolbarPosition, type ToolbarProps, type ToolbarVariant };
|
package/dist/toolbar/index.d.ts
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
2
|
-
import { StyleProp, ViewStyle, GestureResponderEvent } from 'react-native';
|
|
3
|
-
import { ThemeColor } from '@xaui/core/types';
|
|
4
|
-
|
|
5
|
-
type ToolbarVariant = 'floating' | 'docked' | 'vertical';
|
|
6
|
-
type ToolbarPosition = 'top' | 'bottom' | 'left' | 'right';
|
|
7
|
-
type ToolbarActionRenderParams = {
|
|
8
|
-
color: string;
|
|
9
|
-
size: number;
|
|
10
|
-
};
|
|
11
|
-
type ToolbarActionProps = {
|
|
12
|
-
/**
|
|
13
|
-
* Icon element or icon render function.
|
|
14
|
-
*/
|
|
15
|
-
icon: ReactNode | ((params: ToolbarActionRenderParams) => ReactNode);
|
|
16
|
-
/**
|
|
17
|
-
* Whether action is disabled.
|
|
18
|
-
* @default false
|
|
19
|
-
*/
|
|
20
|
-
isDisabled?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Custom action style.
|
|
23
|
-
*/
|
|
24
|
-
style?: StyleProp<ViewStyle>;
|
|
25
|
-
/**
|
|
26
|
-
* Callback fired when action is pressed.
|
|
27
|
-
*/
|
|
28
|
-
onPress?: (event: GestureResponderEvent) => void;
|
|
29
|
-
/**
|
|
30
|
-
* Callback fired when action is long-pressed.
|
|
31
|
-
*/
|
|
32
|
-
onLongPress?: (event: GestureResponderEvent) => void;
|
|
33
|
-
/**
|
|
34
|
-
* Accessibility label for action.
|
|
35
|
-
*/
|
|
36
|
-
accessibilityLabel?: string;
|
|
37
|
-
/**
|
|
38
|
-
* testID for e2e tests.
|
|
39
|
-
*/
|
|
40
|
-
testID?: string;
|
|
41
|
-
};
|
|
42
|
-
type ToolbarCustomAppearance = {
|
|
43
|
-
container?: StyleProp<ViewStyle>;
|
|
44
|
-
topRow?: StyleProp<ViewStyle>;
|
|
45
|
-
actionsContainer?: StyleProp<ViewStyle>;
|
|
46
|
-
};
|
|
47
|
-
type ToolbarProps = {
|
|
48
|
-
/**
|
|
49
|
-
* Toolbar variant.
|
|
50
|
-
* - floating: rounded floating bar
|
|
51
|
-
* - docked: fixed bar without rounding
|
|
52
|
-
* - vertical: vertical bar (always centered)
|
|
53
|
-
* @default 'docked'
|
|
54
|
-
*/
|
|
55
|
-
variant?: ToolbarVariant;
|
|
56
|
-
/**
|
|
57
|
-
* Toolbar position.
|
|
58
|
-
* - For floating/docked: 'top' | 'bottom'
|
|
59
|
-
* - For vertical: 'left' | 'right'
|
|
60
|
-
* @default 'top'
|
|
61
|
-
*/
|
|
62
|
-
position?: ToolbarPosition;
|
|
63
|
-
/**
|
|
64
|
-
* Whether toolbar is visible (with animation).
|
|
65
|
-
* @default true
|
|
66
|
-
*/
|
|
67
|
-
isVisible?: boolean;
|
|
68
|
-
/**
|
|
69
|
-
* Theme color used for accent and icon tint.
|
|
70
|
-
* @default 'primary'
|
|
71
|
-
*/
|
|
72
|
-
themeColor?: ThemeColor;
|
|
73
|
-
/**
|
|
74
|
-
* Whether to render a divider.
|
|
75
|
-
* @default false
|
|
76
|
-
*/
|
|
77
|
-
showDivider?: boolean;
|
|
78
|
-
/**
|
|
79
|
-
* Whether to show elevation shadow. If not provided, uses variant default.
|
|
80
|
-
*/
|
|
81
|
-
isElevated?: boolean;
|
|
82
|
-
/**
|
|
83
|
-
* Toolbar action items.
|
|
84
|
-
*/
|
|
85
|
-
children?: ReactNode;
|
|
86
|
-
/**
|
|
87
|
-
* Custom container style.
|
|
88
|
-
*/
|
|
89
|
-
style?: StyleProp<ViewStyle>;
|
|
90
|
-
/**
|
|
91
|
-
* Optional custom appearance styles.
|
|
92
|
-
*/
|
|
93
|
-
customAppearance?: ToolbarCustomAppearance;
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
declare const Toolbar: React.FC<ToolbarProps>;
|
|
97
|
-
|
|
98
|
-
declare const ToolbarAction: React.FC<ToolbarActionProps>;
|
|
99
|
-
|
|
100
|
-
export { Toolbar, ToolbarAction, type ToolbarActionProps, type ToolbarActionRenderParams, type ToolbarCustomAppearance, type ToolbarPosition, type ToolbarProps, type ToolbarVariant };
|