@xaui/native 0.2.5 → 0.2.7

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.
@@ -434,10 +434,7 @@ var ColorPicker = ({
434
434
  ), /* @__PURE__ */ _react2.default.createElement(
435
435
  _reactnative.Text,
436
436
  {
437
- style: [
438
- styles.hexLabel,
439
- { color: _core.withOpacity.call(void 0, foreground, 0.7) }
440
- ]
437
+ style: [styles.hexLabel, { color: _core.withOpacity.call(void 0, foreground, 0.7) }]
441
438
  },
442
439
  value.toUpperCase()
443
440
  ))), /* @__PURE__ */ _react2.default.createElement(_reactnative.ScrollView, { showsVerticalScrollIndicator: false }, colorGroups.map((group) => /* @__PURE__ */ _react2.default.createElement(
@@ -434,10 +434,7 @@ var ColorPicker = ({
434
434
  ), /* @__PURE__ */ React.createElement(
435
435
  Text,
436
436
  {
437
- style: [
438
- styles.hexLabel,
439
- { color: withOpacity(foreground, 0.7) }
440
- ]
437
+ style: [styles.hexLabel, { color: withOpacity(foreground, 0.7) }]
441
438
  },
442
439
  value.toUpperCase()
443
440
  ))), /* @__PURE__ */ React.createElement(ScrollView, { showsVerticalScrollIndicator: false }, colorGroups.map((group) => /* @__PURE__ */ React.createElement(
@@ -294,45 +294,36 @@ var Dialog = ({
294
294
  [customAppearance, requestClose]
295
295
  );
296
296
  if (!shouldRender) return null;
297
- return /* @__PURE__ */ _react2.default.createElement(
298
- _reactnative.Modal,
297
+ return /* @__PURE__ */ _react2.default.createElement(_reactnative.Modal, { visible: true, transparent: true, animationType: "none", onRequestClose: requestClose }, /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: styles.root }, !hideBackdrop && /* @__PURE__ */ _react2.default.createElement(
298
+ AnimatedPressable,
299
299
  {
300
- visible: true,
301
- transparent: true,
302
- animationType: "none",
303
- onRequestClose: requestClose
300
+ style: [
301
+ styles.backdrop,
302
+ backdropStyles[backdrop],
303
+ backdropAnimatedStyle,
304
+ _optionalChain([customAppearance, 'optionalAccess', _3 => _3.backdrop])
305
+ ],
306
+ onPress: handleBackdropPress
307
+ }
308
+ ), /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: [styles.placementBase, placementStyles[placement]] }, /* @__PURE__ */ _react2.default.createElement(DialogContext.Provider, { value: dialogContextValue }, /* @__PURE__ */ _react2.default.createElement(_reactnative.Pressable, { onPress: (event) => event.stopPropagation() }, /* @__PURE__ */ _react2.default.createElement(
309
+ _reactnativereanimated2.default.View,
310
+ {
311
+ style: [
312
+ styles.dialog,
313
+ sizeStyles[size],
314
+ radiusStyles,
315
+ dialogAnimatedStyle,
316
+ {
317
+ backgroundColor: theme.colors.background,
318
+ borderColor: _core.withOpacity.call(void 0, theme.colors.foreground, 0.14)
319
+ },
320
+ theme.shadows.lg,
321
+ _optionalChain([customAppearance, 'optionalAccess', _4 => _4.container]),
322
+ style
323
+ ]
304
324
  },
305
- /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: styles.root }, !hideBackdrop && /* @__PURE__ */ _react2.default.createElement(
306
- AnimatedPressable,
307
- {
308
- style: [
309
- styles.backdrop,
310
- backdropStyles[backdrop],
311
- backdropAnimatedStyle,
312
- _optionalChain([customAppearance, 'optionalAccess', _3 => _3.backdrop])
313
- ],
314
- onPress: handleBackdropPress
315
- }
316
- ), /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: [styles.placementBase, placementStyles[placement]] }, /* @__PURE__ */ _react2.default.createElement(DialogContext.Provider, { value: dialogContextValue }, /* @__PURE__ */ _react2.default.createElement(_reactnative.Pressable, { onPress: (event) => event.stopPropagation() }, /* @__PURE__ */ _react2.default.createElement(
317
- _reactnativereanimated2.default.View,
318
- {
319
- style: [
320
- styles.dialog,
321
- sizeStyles[size],
322
- radiusStyles,
323
- dialogAnimatedStyle,
324
- {
325
- backgroundColor: theme.colors.background,
326
- borderColor: _core.withOpacity.call(void 0, theme.colors.foreground, 0.14)
327
- },
328
- theme.shadows.lg,
329
- _optionalChain([customAppearance, 'optionalAccess', _4 => _4.container]),
330
- style
331
- ]
332
- },
333
- children
334
- )))))
335
- );
325
+ children
326
+ ))))));
336
327
  };
337
328
  var AnimatedPressable = _reactnativereanimated2.default.createAnimatedComponent(_reactnative.Pressable);
338
329
  var DialogHeader = ({
@@ -294,45 +294,36 @@ var Dialog = ({
294
294
  [customAppearance, requestClose]
295
295
  );
296
296
  if (!shouldRender) return null;
297
- return /* @__PURE__ */ React.createElement(
298
- Modal,
297
+ return /* @__PURE__ */ React.createElement(Modal, { visible: true, transparent: true, animationType: "none", onRequestClose: requestClose }, /* @__PURE__ */ React.createElement(View, { style: styles.root }, !hideBackdrop && /* @__PURE__ */ React.createElement(
298
+ AnimatedPressable,
299
299
  {
300
- visible: true,
301
- transparent: true,
302
- animationType: "none",
303
- onRequestClose: requestClose
300
+ style: [
301
+ styles.backdrop,
302
+ backdropStyles[backdrop],
303
+ backdropAnimatedStyle,
304
+ customAppearance?.backdrop
305
+ ],
306
+ onPress: handleBackdropPress
307
+ }
308
+ ), /* @__PURE__ */ React.createElement(View, { style: [styles.placementBase, placementStyles[placement]] }, /* @__PURE__ */ React.createElement(DialogContext.Provider, { value: dialogContextValue }, /* @__PURE__ */ React.createElement(Pressable, { onPress: (event) => event.stopPropagation() }, /* @__PURE__ */ React.createElement(
309
+ Animated.View,
310
+ {
311
+ style: [
312
+ styles.dialog,
313
+ sizeStyles[size],
314
+ radiusStyles,
315
+ dialogAnimatedStyle,
316
+ {
317
+ backgroundColor: theme.colors.background,
318
+ borderColor: withOpacity(theme.colors.foreground, 0.14)
319
+ },
320
+ theme.shadows.lg,
321
+ customAppearance?.container,
322
+ style
323
+ ]
304
324
  },
305
- /* @__PURE__ */ React.createElement(View, { style: styles.root }, !hideBackdrop && /* @__PURE__ */ React.createElement(
306
- AnimatedPressable,
307
- {
308
- style: [
309
- styles.backdrop,
310
- backdropStyles[backdrop],
311
- backdropAnimatedStyle,
312
- customAppearance?.backdrop
313
- ],
314
- onPress: handleBackdropPress
315
- }
316
- ), /* @__PURE__ */ React.createElement(View, { style: [styles.placementBase, placementStyles[placement]] }, /* @__PURE__ */ React.createElement(DialogContext.Provider, { value: dialogContextValue }, /* @__PURE__ */ React.createElement(Pressable, { onPress: (event) => event.stopPropagation() }, /* @__PURE__ */ React.createElement(
317
- Animated.View,
318
- {
319
- style: [
320
- styles.dialog,
321
- sizeStyles[size],
322
- radiusStyles,
323
- dialogAnimatedStyle,
324
- {
325
- backgroundColor: theme.colors.background,
326
- borderColor: withOpacity(theme.colors.foreground, 0.14)
327
- },
328
- theme.shadows.lg,
329
- customAppearance?.container,
330
- style
331
- ]
332
- },
333
- children
334
- )))))
335
- );
325
+ children
326
+ ))))));
336
327
  };
337
328
  var AnimatedPressable = Animated.createAnimatedComponent(Pressable);
338
329
  var DialogHeader = ({
@@ -84,20 +84,26 @@ var ChevronDownIcon = ({
84
84
  }
85
85
  )
86
86
  );
87
- var CheckIcon = ({ color }) => /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: { width: 20, height: 20, alignItems: "center", justifyContent: "center" } }, /* @__PURE__ */ _react2.default.createElement(
87
+ var CheckIcon = ({ color }) => /* @__PURE__ */ _react2.default.createElement(
88
88
  _reactnative.View,
89
89
  {
90
- style: {
91
- width: 6,
92
- height: 10,
93
- borderRightWidth: 2,
94
- borderBottomWidth: 2,
95
- borderColor: color,
96
- transform: [{ rotate: "45deg" }],
97
- marginTop: -3
90
+ style: { width: 20, height: 20, alignItems: "center", justifyContent: "center" }
91
+ },
92
+ /* @__PURE__ */ _react2.default.createElement(
93
+ _reactnative.View,
94
+ {
95
+ style: {
96
+ width: 6,
97
+ height: 10,
98
+ borderRightWidth: 2,
99
+ borderBottomWidth: 2,
100
+ borderColor: color,
101
+ transform: [{ rotate: "45deg" }],
102
+ marginTop: -3
103
+ }
98
104
  }
99
- }
100
- ));
105
+ )
106
+ );
101
107
  var OptionItem = ({
102
108
  option,
103
109
  isSelected,
@@ -120,10 +126,7 @@ var OptionItem = ({
120
126
  /* @__PURE__ */ _react2.default.createElement(
121
127
  _reactnative.Text,
122
128
  {
123
- style: [
124
- styles.optionLabel,
125
- { color: isSelected ? themeColor : foreground }
126
- ]
129
+ style: [styles.optionLabel, { color: isSelected ? themeColor : foreground }]
127
130
  },
128
131
  option.label
129
132
  ),
@@ -214,13 +217,7 @@ var Picker = ({
214
217
  onClose: handleSheetClose,
215
218
  style: { backgroundColor: sheetBackground, ...sheetStyle }
216
219
  },
217
- /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: styles.sheetContent }, sheetTitle ? /* @__PURE__ */ _react2.default.createElement(
218
- _reactnative.Text,
219
- {
220
- style: [styles.sheetTitle, { color: theme.colors.foreground }]
221
- },
222
- sheetTitle
223
- ) : null, /* @__PURE__ */ _react2.default.createElement(_reactnative.ScrollView, null, options.map((option, index) => /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { key: option.value }, /* @__PURE__ */ _react2.default.createElement(
220
+ /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: styles.sheetContent }, sheetTitle ? /* @__PURE__ */ _react2.default.createElement(_reactnative.Text, { style: [styles.sheetTitle, { color: theme.colors.foreground }] }, sheetTitle) : null, /* @__PURE__ */ _react2.default.createElement(_reactnative.ScrollView, null, options.map((option, index) => /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { key: option.value }, /* @__PURE__ */ _react2.default.createElement(
224
221
  OptionItem,
225
222
  {
226
223
  option,
@@ -235,10 +232,7 @@ var Picker = ({
235
232
  style: [
236
233
  styles.divider,
237
234
  {
238
- backgroundColor: _core.withOpacity.call(void 0,
239
- theme.colors.foreground,
240
- 0.06
241
- )
235
+ backgroundColor: _core.withOpacity.call(void 0, theme.colors.foreground, 0.06)
242
236
  }
243
237
  ]
244
238
  }
@@ -84,20 +84,26 @@ var ChevronDownIcon = ({
84
84
  }
85
85
  )
86
86
  );
87
- var CheckIcon = ({ color }) => /* @__PURE__ */ React.createElement(View, { style: { width: 20, height: 20, alignItems: "center", justifyContent: "center" } }, /* @__PURE__ */ React.createElement(
87
+ var CheckIcon = ({ color }) => /* @__PURE__ */ React.createElement(
88
88
  View,
89
89
  {
90
- style: {
91
- width: 6,
92
- height: 10,
93
- borderRightWidth: 2,
94
- borderBottomWidth: 2,
95
- borderColor: color,
96
- transform: [{ rotate: "45deg" }],
97
- marginTop: -3
90
+ style: { width: 20, height: 20, alignItems: "center", justifyContent: "center" }
91
+ },
92
+ /* @__PURE__ */ React.createElement(
93
+ View,
94
+ {
95
+ style: {
96
+ width: 6,
97
+ height: 10,
98
+ borderRightWidth: 2,
99
+ borderBottomWidth: 2,
100
+ borderColor: color,
101
+ transform: [{ rotate: "45deg" }],
102
+ marginTop: -3
103
+ }
98
104
  }
99
- }
100
- ));
105
+ )
106
+ );
101
107
  var OptionItem = ({
102
108
  option,
103
109
  isSelected,
@@ -120,10 +126,7 @@ var OptionItem = ({
120
126
  /* @__PURE__ */ React.createElement(
121
127
  Text,
122
128
  {
123
- style: [
124
- styles.optionLabel,
125
- { color: isSelected ? themeColor : foreground }
126
- ]
129
+ style: [styles.optionLabel, { color: isSelected ? themeColor : foreground }]
127
130
  },
128
131
  option.label
129
132
  ),
@@ -214,13 +217,7 @@ var Picker = ({
214
217
  onClose: handleSheetClose,
215
218
  style: { backgroundColor: sheetBackground, ...sheetStyle }
216
219
  },
217
- /* @__PURE__ */ React.createElement(View, { style: styles.sheetContent }, sheetTitle ? /* @__PURE__ */ React.createElement(
218
- Text,
219
- {
220
- style: [styles.sheetTitle, { color: theme.colors.foreground }]
221
- },
222
- sheetTitle
223
- ) : null, /* @__PURE__ */ React.createElement(ScrollView, null, options.map((option, index) => /* @__PURE__ */ React.createElement(View, { key: option.value }, /* @__PURE__ */ React.createElement(
220
+ /* @__PURE__ */ React.createElement(View, { style: styles.sheetContent }, sheetTitle ? /* @__PURE__ */ React.createElement(Text, { style: [styles.sheetTitle, { color: theme.colors.foreground }] }, sheetTitle) : null, /* @__PURE__ */ React.createElement(ScrollView, null, options.map((option, index) => /* @__PURE__ */ React.createElement(View, { key: option.value }, /* @__PURE__ */ React.createElement(
224
221
  OptionItem,
225
222
  {
226
223
  option,
@@ -235,10 +232,7 @@ var Picker = ({
235
232
  style: [
236
233
  styles.divider,
237
234
  {
238
- backgroundColor: withOpacity(
239
- theme.colors.foreground,
240
- 0.06
241
- )
235
+ backgroundColor: withOpacity(theme.colors.foreground, 0.06)
242
236
  }
243
237
  ]
244
238
  }
@@ -241,7 +241,11 @@ var SnackbarSurface = ({ item, duration, onDismiss }) => {
241
241
  return /* @__PURE__ */ _react2.default.createElement(
242
242
  _reactnative.Text,
243
243
  {
244
- style: [styles.messageText, { color: textColor }, _optionalChain([customAppearance, 'optionalAccess', _3 => _3.message])],
244
+ style: [
245
+ styles.messageText,
246
+ { color: textColor },
247
+ _optionalChain([customAppearance, 'optionalAccess', _3 => _3.message])
248
+ ],
245
249
  numberOfLines
246
250
  },
247
251
  message
@@ -252,7 +256,17 @@ var SnackbarSurface = ({ item, duration, onDismiss }) => {
252
256
  const actionNode = _react.useMemo.call(void 0, () => {
253
257
  if (actionLabel === null || actionLabel === void 0) return null;
254
258
  if (typeof actionLabel === "string" || typeof actionLabel === "number") {
255
- return /* @__PURE__ */ _react2.default.createElement(_reactnative.Text, { style: [styles.actionText, { color: actionColor }, _optionalChain([customAppearance, 'optionalAccess', _5 => _5.action])] }, actionLabel);
259
+ return /* @__PURE__ */ _react2.default.createElement(
260
+ _reactnative.Text,
261
+ {
262
+ style: [
263
+ styles.actionText,
264
+ { color: actionColor },
265
+ _optionalChain([customAppearance, 'optionalAccess', _5 => _5.action])
266
+ ]
267
+ },
268
+ actionLabel
269
+ );
256
270
  }
257
271
  if (_react.isValidElement.call(void 0, actionLabel)) {
258
272
  return actionLabel;
@@ -382,7 +396,9 @@ var Snackbar = ({
382
396
  const [internalVisible, setInternalVisible] = _react.useState.call(void 0, _nullishCoalesce(isVisible, () => ( true)));
383
397
  const isControlled = typeof isVisible === "boolean";
384
398
  const visible = isControlled ? isVisible : internalVisible;
385
- const idRef = _react.useRef.call(void 0, `snackbar-${Date.now()}-${Math.random().toString(16).slice(2)}`);
399
+ const idRef = _react.useRef.call(void 0,
400
+ `snackbar-${Date.now()}-${Math.random().toString(16).slice(2)}`
401
+ );
386
402
  const dismiss = _react.useCallback.call(void 0, () => {
387
403
  if (!isControlled) {
388
404
  setInternalVisible(false);
@@ -241,7 +241,11 @@ var SnackbarSurface = ({ item, duration, onDismiss }) => {
241
241
  return /* @__PURE__ */ React.createElement(
242
242
  Text,
243
243
  {
244
- style: [styles.messageText, { color: textColor }, customAppearance?.message],
244
+ style: [
245
+ styles.messageText,
246
+ { color: textColor },
247
+ customAppearance?.message
248
+ ],
245
249
  numberOfLines
246
250
  },
247
251
  message
@@ -252,7 +256,17 @@ var SnackbarSurface = ({ item, duration, onDismiss }) => {
252
256
  const actionNode = useMemo2(() => {
253
257
  if (actionLabel === null || actionLabel === void 0) return null;
254
258
  if (typeof actionLabel === "string" || typeof actionLabel === "number") {
255
- return /* @__PURE__ */ React.createElement(Text, { style: [styles.actionText, { color: actionColor }, customAppearance?.action] }, actionLabel);
259
+ return /* @__PURE__ */ React.createElement(
260
+ Text,
261
+ {
262
+ style: [
263
+ styles.actionText,
264
+ { color: actionColor },
265
+ customAppearance?.action
266
+ ]
267
+ },
268
+ actionLabel
269
+ );
256
270
  }
257
271
  if (isValidElement(actionLabel)) {
258
272
  return actionLabel;
@@ -382,7 +396,9 @@ var Snackbar = ({
382
396
  const [internalVisible, setInternalVisible] = useState(isVisible ?? true);
383
397
  const isControlled = typeof isVisible === "boolean";
384
398
  const visible = isControlled ? isVisible : internalVisible;
385
- const idRef = useRef(`snackbar-${Date.now()}-${Math.random().toString(16).slice(2)}`);
399
+ const idRef = useRef(
400
+ `snackbar-${Date.now()}-${Math.random().toString(16).slice(2)}`
401
+ );
386
402
  const dismiss = useCallback(() => {
387
403
  if (!isControlled) {
388
404
  setInternalVisible(false);
@@ -225,7 +225,12 @@ var Snippet = ({
225
225
  accessibilityRole: "button",
226
226
  accessibilityLabel: isCopied ? copiedLabel : copyLabel,
227
227
  disabled: isDisabled,
228
- style: isInline ? [styles.inlineCopyButton, radiusStyles, copyButtonColors, _optionalChain([customAppearance, 'optionalAccess', _9 => _9.copyButton])] : [
228
+ style: isInline ? [
229
+ styles.inlineCopyButton,
230
+ radiusStyles,
231
+ copyButtonColors,
232
+ _optionalChain([customAppearance, 'optionalAccess', _9 => _9.copyButton])
233
+ ] : [
229
234
  styles.copyButton,
230
235
  radiusStyles,
231
236
  isTop ? styles.top : styles.bottom,
@@ -225,7 +225,12 @@ var Snippet = ({
225
225
  accessibilityRole: "button",
226
226
  accessibilityLabel: isCopied ? copiedLabel : copyLabel,
227
227
  disabled: isDisabled,
228
- style: isInline ? [styles.inlineCopyButton, radiusStyles, copyButtonColors, customAppearance?.copyButton] : [
228
+ style: isInline ? [
229
+ styles.inlineCopyButton,
230
+ radiusStyles,
231
+ copyButtonColors,
232
+ customAppearance?.copyButton
233
+ ] : [
229
234
  styles.copyButton,
230
235
  radiusStyles,
231
236
  isTop ? styles.top : styles.bottom,