@xaui/native 0.2.4 → 0.2.5
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/alert/index.d.cts +1 -1
- package/dist/alert/index.d.ts +1 -1
- package/dist/app-bar/index.d.cts +1 -1
- package/dist/app-bar/index.d.ts +1 -1
- package/dist/autocomplete/index.d.cts +1 -1
- package/dist/autocomplete/index.d.ts +1 -1
- package/dist/avatar/index.d.cts +1 -1
- package/dist/avatar/index.d.ts +1 -1
- package/dist/badge/index.d.cts +1 -1
- package/dist/badge/index.d.ts +1 -1
- package/dist/bottom-sheet/index.d.cts +1 -1
- package/dist/bottom-sheet/index.d.ts +1 -1
- package/dist/bottom-tab-bar/index.d.cts +1 -1
- package/dist/bottom-tab-bar/index.d.ts +1 -1
- package/dist/button/index.d.cts +1 -1
- package/dist/button/index.d.ts +1 -1
- package/dist/card/index.d.cts +1 -1
- package/dist/card/index.d.ts +1 -1
- package/dist/carousel/index.d.cts +1 -1
- package/dist/carousel/index.d.ts +1 -1
- package/dist/checkbox/index.d.cts +1 -1
- package/dist/checkbox/index.d.ts +1 -1
- package/dist/chip/index.d.cts +1 -1
- package/dist/chip/index.d.ts +1 -1
- package/dist/color-picker/index.d.cts +2 -2
- package/dist/color-picker/index.d.ts +2 -2
- package/dist/container/index.cjs +203 -0
- package/dist/container/index.d.cts +40 -0
- package/dist/container/index.d.ts +40 -0
- package/dist/container/index.js +203 -0
- package/dist/datepicker/index.d.cts +1 -1
- package/dist/datepicker/index.d.ts +1 -1
- package/dist/dialog/index.d.cts +1 -1
- package/dist/dialog/index.d.ts +1 -1
- package/dist/divider/index.d.cts +1 -1
- package/dist/divider/index.d.ts +1 -1
- package/dist/drawer/index.d.cts +1 -1
- package/dist/drawer/index.d.ts +1 -1
- package/dist/fab/index.d.cts +3 -3
- package/dist/fab/index.d.ts +3 -3
- package/dist/fab-menu/index.d.cts +2 -2
- package/dist/fab-menu/index.d.ts +2 -2
- package/dist/{fab.type-CgIYqQlT.d.ts → fab.type-CkUHmXU_.d.ts} +1 -1
- package/dist/{fab.type-l2vjG8-p.d.cts → fab.type-DN0vtAh6.d.cts} +1 -1
- package/dist/feature-discovery/index.d.cts +1 -1
- package/dist/feature-discovery/index.d.ts +1 -1
- package/dist/indicator/index.d.cts +1 -1
- package/dist/indicator/index.d.ts +1 -1
- package/dist/input/index.d.cts +10 -9
- package/dist/input/index.d.ts +10 -9
- package/dist/input-trigger/index.d.cts +3 -3
- package/dist/input-trigger/index.d.ts +3 -3
- package/dist/{input-trigger.type-DlSqg2eG.d.ts → input-trigger.type-Ba4bM3Qp.d.cts} +1 -1
- package/dist/{input-trigger.type-By_1ZjKd.d.cts → input-trigger.type-Ba4bM3Qp.d.ts} +1 -1
- package/dist/list/index.d.cts +1 -1
- package/dist/list/index.d.ts +1 -1
- package/dist/menubox/index.d.cts +1 -1
- package/dist/menubox/index.d.ts +1 -1
- package/dist/picker/index.d.cts +2 -2
- package/dist/picker/index.d.ts +2 -2
- package/dist/progress/index.d.cts +1 -1
- package/dist/progress/index.d.ts +1 -1
- package/dist/radio/index.d.cts +1 -1
- package/dist/radio/index.d.ts +1 -1
- package/dist/refresh-control/index.d.cts +1 -1
- package/dist/refresh-control/index.d.ts +1 -1
- package/dist/segment-button/index.d.cts +1 -1
- package/dist/segment-button/index.d.ts +1 -1
- package/dist/select/index.d.cts +1 -1
- package/dist/select/index.d.ts +1 -1
- package/dist/skeleton/index.d.cts +1 -1
- package/dist/skeleton/index.d.ts +1 -1
- package/dist/slider/index.d.cts +1 -1
- package/dist/slider/index.d.ts +1 -1
- package/dist/snackbar/index.d.cts +1 -1
- package/dist/snackbar/index.d.ts +1 -1
- package/dist/snippet/index.d.cts +1 -1
- package/dist/snippet/index.d.ts +1 -1
- package/dist/stepper/index.d.cts +1 -1
- package/dist/stepper/index.d.ts +1 -1
- package/dist/switch/index.d.cts +1 -1
- package/dist/switch/index.d.ts +1 -1
- package/dist/tabs/index.d.cts +1 -1
- package/dist/tabs/index.d.ts +1 -1
- package/dist/timepicker/index.d.cts +1 -1
- package/dist/timepicker/index.d.ts +1 -1
- package/dist/toolbar/index.d.cts +1 -1
- package/dist/toolbar/index.d.ts +1 -1
- package/dist/typography/index.d.cts +1 -1
- package/dist/typography/index.d.ts +1 -1
- package/dist/view/index.cjs +5 -15
- package/dist/view/index.d.cts +1 -1
- package/dist/view/index.d.ts +1 -1
- package/dist/view/index.js +5 -15
- package/package.json +9 -5
- package/dist/index-BOw6tbkc.d.cts +0 -5
- package/dist/index-BOw6tbkc.d.ts +0 -5
- package/dist/index-DyU3sW3_.d.cts +0 -4
- package/dist/index-DyU3sW3_.d.ts +0 -4
package/dist/alert/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { ViewStyle, TextStyle } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { ThemeColor } from '@xaui/core/types';
|
|
4
4
|
|
|
5
5
|
type AlertVariant = 'solid' | 'bordered' | 'flat' | 'faded';
|
|
6
6
|
type AlertRadius = 'none' | 'sm' | 'md' | 'lg' | 'full';
|
package/dist/alert/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { ViewStyle, TextStyle } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { ThemeColor } from '@xaui/core/types';
|
|
4
4
|
|
|
5
5
|
type AlertVariant = 'solid' | 'bordered' | 'flat' | 'faded';
|
|
6
6
|
type AlertRadius = 'none' | 'sm' | 'md' | 'lg' | 'full';
|
package/dist/app-bar/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { ThemeColor } from '@xaui/core/types';
|
|
4
4
|
|
|
5
5
|
type AppBarVariant = 'docked' | 'floating';
|
|
6
6
|
type AppBarProps = {
|
package/dist/app-bar/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { ThemeColor } from '@xaui/core/types';
|
|
4
4
|
|
|
5
5
|
type AppBarVariant = 'docked' | 'floating';
|
|
6
6
|
type AppBarProps = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { ViewStyle, TextStyle } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { ThemeColor, Size, Radius } from '@xaui/core/types';
|
|
4
4
|
|
|
5
5
|
type AutocompleteVariant = 'bordered' | 'colored' | 'light' | 'underlined';
|
|
6
6
|
type AutocompleteLabelPlacement = 'inside' | 'outside' | 'outside-left' | 'outside-top';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { ViewStyle, TextStyle } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { ThemeColor, Size, Radius } from '@xaui/core/types';
|
|
4
4
|
|
|
5
5
|
type AutocompleteVariant = 'bordered' | 'colored' | 'light' | 'underlined';
|
|
6
6
|
type AutocompleteLabelPlacement = 'inside' | 'outside' | 'outside-left' | 'outside-top';
|
package/dist/avatar/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { ViewStyle, ImageStyle, TextStyle } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { Size, Radius, ThemeColor } from '@xaui/core/types';
|
|
4
4
|
|
|
5
5
|
type AvatarSize = Size | number;
|
|
6
6
|
type AvatarCustomAppearance = {
|
package/dist/avatar/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { ViewStyle, ImageStyle, TextStyle } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { Size, Radius, ThemeColor } from '@xaui/core/types';
|
|
4
4
|
|
|
5
5
|
type AvatarSize = Size | number;
|
|
6
6
|
type AvatarCustomAppearance = {
|
package/dist/badge/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { ViewStyle, TextStyle } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { ThemeColor, Radius } from '@xaui/core/types';
|
|
4
4
|
|
|
5
5
|
type BadgeVariant = 'solid' | 'flat' | 'faded' | 'shadow';
|
|
6
6
|
type BadgeSize = 'sm' | 'md' | 'lg';
|
package/dist/badge/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { ViewStyle, TextStyle } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { ThemeColor, Radius } from '@xaui/core/types';
|
|
4
4
|
|
|
5
5
|
type BadgeVariant = 'solid' | 'flat' | 'faded' | 'shadow';
|
|
6
6
|
type BadgeSize = 'sm' | 'md' | 'lg';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { ViewStyle } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { ThemeColor, Radius } from '@xaui/core/types';
|
|
4
4
|
|
|
5
5
|
type BottomSheetSnapPoint = number | string;
|
|
6
6
|
type BottomSheetProps = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { ViewStyle } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { ThemeColor, Radius } from '@xaui/core/types';
|
|
4
4
|
|
|
5
5
|
type BottomSheetSnapPoint = number | string;
|
|
6
6
|
type BottomSheetProps = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { StyleProp, ViewStyle, Insets, TextStyle, GestureResponderEvent } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { ThemeColor } from '@xaui/core/types';
|
|
4
4
|
|
|
5
5
|
type BottomTabBarSize = 'sm' | 'md' | 'lg';
|
|
6
6
|
type BottomTabBarVariant = 'stacked' | 'inline' | 'icon-only';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { StyleProp, ViewStyle, Insets, TextStyle, GestureResponderEvent } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { ThemeColor } from '@xaui/core/types';
|
|
4
4
|
|
|
5
5
|
type BottomTabBarSize = 'sm' | 'md' | 'lg';
|
|
6
6
|
type BottomTabBarVariant = 'stacked' | 'inline' | 'icon-only';
|
package/dist/button/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { ViewStyle, TextStyle, GestureResponderEvent } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { ThemeColor, Size } from '@xaui/core/types';
|
|
4
4
|
|
|
5
5
|
type ButtonVariant = 'solid' | 'bordered' | 'flat' | 'light' | 'faded';
|
|
6
6
|
type ButtonRadius = 'none' | 'sm' | 'md' | 'lg' | 'full';
|
package/dist/button/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { ViewStyle, TextStyle, GestureResponderEvent } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { ThemeColor, Size } from '@xaui/core/types';
|
|
4
4
|
|
|
5
5
|
type ButtonVariant = 'solid' | 'bordered' | 'flat' | 'light' | 'faded';
|
|
6
6
|
type ButtonRadius = 'none' | 'sm' | 'md' | 'lg' | 'full';
|
package/dist/card/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { ViewStyle, TextStyle, GestureResponderEvent } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { ThemeColor, Radius } from '@xaui/core/types';
|
|
4
4
|
import { E as ElevationLevel } from '../button.type-j1ZdkkSl.cjs';
|
|
5
5
|
|
|
6
6
|
type CardCustomAppearance = {
|
package/dist/card/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { ViewStyle, TextStyle, GestureResponderEvent } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { ThemeColor, Radius } from '@xaui/core/types';
|
|
4
4
|
import { E as ElevationLevel } from '../button.type-j1ZdkkSl.js';
|
|
5
5
|
|
|
6
6
|
type CardCustomAppearance = {
|
package/dist/carousel/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TextStyle, ViewStyle } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { ThemeColor, Size, Radius } from '@xaui/core/types';
|
|
4
4
|
|
|
5
5
|
type CheckboxVariant = 'filled' | 'light';
|
|
6
6
|
type CheckboxLabelAlignment = 'left' | 'right' | 'justify-left' | 'justify-right';
|
package/dist/checkbox/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TextStyle, ViewStyle } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { ThemeColor, Size, Radius } from '@xaui/core/types';
|
|
4
4
|
|
|
5
5
|
type CheckboxVariant = 'filled' | 'light';
|
|
6
6
|
type CheckboxLabelAlignment = 'left' | 'right' | 'justify-left' | 'justify-right';
|
package/dist/chip/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { ViewStyle, TextStyle } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { ThemeColor } from '@xaui/core/types';
|
|
4
4
|
|
|
5
5
|
type ChipVariant = 'solid' | 'bordered' | 'light' | 'flat' | 'faded' | 'shadow' | 'dot';
|
|
6
6
|
type ChipSize = 'sm' | 'md' | 'lg';
|
package/dist/chip/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { ViewStyle, TextStyle } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { ThemeColor } from '@xaui/core/types';
|
|
4
4
|
|
|
5
5
|
type ChipVariant = 'solid' | 'bordered' | 'light' | 'flat' | 'faded' | 'shadow' | 'dot';
|
|
6
6
|
type ChipSize = 'sm' | 'md' | 'lg';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { ViewStyle } from 'react-native';
|
|
3
|
-
import {
|
|
4
|
-
import { d as InputTriggerLabelPlacement, b as InputTriggerVariant, c as InputTriggerSize } from '../input-trigger.type-
|
|
3
|
+
import { ThemeColor, Radius } from '@xaui/core/types';
|
|
4
|
+
import { d as InputTriggerLabelPlacement, b as InputTriggerVariant, c as InputTriggerSize } from '../input-trigger.type-Ba4bM3Qp.cjs';
|
|
5
5
|
|
|
6
6
|
type ColorGroup = {
|
|
7
7
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { ViewStyle } from 'react-native';
|
|
3
|
-
import {
|
|
4
|
-
import { d as InputTriggerLabelPlacement, b as InputTriggerVariant, c as InputTriggerSize } from '../input-trigger.type-
|
|
3
|
+
import { ThemeColor, Radius } from '@xaui/core/types';
|
|
4
|
+
import { d as InputTriggerLabelPlacement, b as InputTriggerVariant, c as InputTriggerSize } from '../input-trigger.type-Ba4bM3Qp.js';
|
|
5
5
|
|
|
6
6
|
type ColorGroup = {
|
|
7
7
|
/**
|
|
@@ -0,0 +1,203 @@
|
|
|
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; }// src/components/container/container.tsx
|
|
2
|
+
var _react = require('react'); var _react2 = _interopRequireDefault(_react);
|
|
3
|
+
var _reactnative = require('react-native');
|
|
4
|
+
|
|
5
|
+
// src/components/container/container.utils.ts
|
|
6
|
+
var resolveEdgeInsets = (value, prefix) => {
|
|
7
|
+
if (typeof value === "number") {
|
|
8
|
+
return prefix === "padding" ? { padding: value } : { margin: value };
|
|
9
|
+
}
|
|
10
|
+
const style = {};
|
|
11
|
+
if (prefix === "padding") {
|
|
12
|
+
if (value.horizontal !== void 0) style.paddingHorizontal = value.horizontal;
|
|
13
|
+
if (value.vertical !== void 0) style.paddingVertical = value.vertical;
|
|
14
|
+
if (value.top !== void 0) style.paddingTop = value.top;
|
|
15
|
+
if (value.bottom !== void 0) style.paddingBottom = value.bottom;
|
|
16
|
+
if (value.left !== void 0) style.paddingLeft = value.left;
|
|
17
|
+
if (value.right !== void 0) style.paddingRight = value.right;
|
|
18
|
+
} else {
|
|
19
|
+
if (value.horizontal !== void 0) style.marginHorizontal = value.horizontal;
|
|
20
|
+
if (value.vertical !== void 0) style.marginVertical = value.vertical;
|
|
21
|
+
if (value.top !== void 0) style.marginTop = value.top;
|
|
22
|
+
if (value.bottom !== void 0) style.marginBottom = value.bottom;
|
|
23
|
+
if (value.left !== void 0) style.marginLeft = value.left;
|
|
24
|
+
if (value.right !== void 0) style.marginRight = value.right;
|
|
25
|
+
}
|
|
26
|
+
return style;
|
|
27
|
+
};
|
|
28
|
+
var ALIGNMENT_MAP = {
|
|
29
|
+
topLeft: { justifyContent: "flex-start", alignItems: "flex-start" },
|
|
30
|
+
topCenter: { justifyContent: "flex-start", alignItems: "center" },
|
|
31
|
+
topRight: { justifyContent: "flex-start", alignItems: "flex-end" },
|
|
32
|
+
centerLeft: { justifyContent: "center", alignItems: "flex-start" },
|
|
33
|
+
center: { justifyContent: "center", alignItems: "center" },
|
|
34
|
+
centerRight: { justifyContent: "center", alignItems: "flex-end" },
|
|
35
|
+
bottomLeft: { justifyContent: "flex-end", alignItems: "flex-start" },
|
|
36
|
+
bottomCenter: { justifyContent: "flex-end", alignItems: "center" },
|
|
37
|
+
bottomRight: { justifyContent: "flex-end", alignItems: "flex-end" }
|
|
38
|
+
};
|
|
39
|
+
var toFlexPosition = (v) => {
|
|
40
|
+
if (v <= 0) return "flex-start";
|
|
41
|
+
if (v >= 1) return "flex-end";
|
|
42
|
+
return "center";
|
|
43
|
+
};
|
|
44
|
+
var resolveAlignment = (value) => {
|
|
45
|
+
if (typeof value === "object") {
|
|
46
|
+
return {
|
|
47
|
+
justifyContent: toFlexPosition(value.y),
|
|
48
|
+
alignItems: toFlexPosition(value.x)
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
return _nullishCoalesce(ALIGNMENT_MAP[value], () => ( {
|
|
52
|
+
justifyContent: "flex-start",
|
|
53
|
+
alignItems: "flex-start"
|
|
54
|
+
}));
|
|
55
|
+
};
|
|
56
|
+
var resolveBorderRadius = (value) => {
|
|
57
|
+
if (typeof value === "number") {
|
|
58
|
+
return { borderRadius: value };
|
|
59
|
+
}
|
|
60
|
+
const style = {};
|
|
61
|
+
if (value.topLeft !== void 0) style.borderTopLeftRadius = value.topLeft;
|
|
62
|
+
if (value.topRight !== void 0) style.borderTopRightRadius = value.topRight;
|
|
63
|
+
if (value.bottomLeft !== void 0) style.borderBottomLeftRadius = value.bottomLeft;
|
|
64
|
+
if (value.bottomRight !== void 0)
|
|
65
|
+
style.borderBottomRightRadius = value.bottomRight;
|
|
66
|
+
return style;
|
|
67
|
+
};
|
|
68
|
+
var resolveBorderSide = (side, position) => {
|
|
69
|
+
const style = {};
|
|
70
|
+
if (position === "") {
|
|
71
|
+
if (side.width !== void 0) style.borderWidth = side.width;
|
|
72
|
+
if (side.color !== void 0) style.borderColor = side.color;
|
|
73
|
+
if (side.style !== void 0) style.borderStyle = side.style;
|
|
74
|
+
return style;
|
|
75
|
+
}
|
|
76
|
+
if (position === "Top") {
|
|
77
|
+
if (side.width !== void 0) style.borderTopWidth = side.width;
|
|
78
|
+
if (side.color !== void 0) style.borderTopColor = side.color;
|
|
79
|
+
} else if (position === "Bottom") {
|
|
80
|
+
if (side.width !== void 0) style.borderBottomWidth = side.width;
|
|
81
|
+
if (side.color !== void 0) style.borderBottomColor = side.color;
|
|
82
|
+
} else if (position === "Left") {
|
|
83
|
+
if (side.width !== void 0) style.borderLeftWidth = side.width;
|
|
84
|
+
if (side.color !== void 0) style.borderLeftColor = side.color;
|
|
85
|
+
} else {
|
|
86
|
+
if (side.width !== void 0) style.borderRightWidth = side.width;
|
|
87
|
+
if (side.color !== void 0) style.borderRightColor = side.color;
|
|
88
|
+
}
|
|
89
|
+
return style;
|
|
90
|
+
};
|
|
91
|
+
var resolveBorder = (value) => {
|
|
92
|
+
const dir = value;
|
|
93
|
+
if (dir.top !== void 0 || dir.bottom !== void 0 || dir.left !== void 0 || dir.right !== void 0) {
|
|
94
|
+
return {
|
|
95
|
+
...dir.top ? resolveBorderSide(dir.top, "Top") : {},
|
|
96
|
+
...dir.bottom ? resolveBorderSide(dir.bottom, "Bottom") : {},
|
|
97
|
+
...dir.left ? resolveBorderSide(dir.left, "Left") : {},
|
|
98
|
+
...dir.right ? resolveBorderSide(dir.right, "Right") : {}
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
return resolveBorderSide(value, "");
|
|
102
|
+
};
|
|
103
|
+
var resolveShadow = (value) => ({
|
|
104
|
+
shadowColor: _nullishCoalesce(value.color, () => ( "#000000")),
|
|
105
|
+
shadowOffset: {
|
|
106
|
+
width: _nullishCoalesce(_optionalChain([value, 'access', _ => _.offset, 'optionalAccess', _2 => _2.x]), () => ( 0)),
|
|
107
|
+
height: _nullishCoalesce(_optionalChain([value, 'access', _3 => _3.offset, 'optionalAccess', _4 => _4.y]), () => ( 4))
|
|
108
|
+
},
|
|
109
|
+
shadowOpacity: _nullishCoalesce(value.opacity, () => ( 0.1)),
|
|
110
|
+
shadowRadius: _nullishCoalesce(value.blur, () => ( 4)),
|
|
111
|
+
elevation: _nullishCoalesce(value.elevation, () => ( 2))
|
|
112
|
+
});
|
|
113
|
+
var resolveTransform = (value) => {
|
|
114
|
+
const transforms = [];
|
|
115
|
+
if (value.rotate !== void 0) transforms.push({ rotate: value.rotate });
|
|
116
|
+
if (value.rotateX !== void 0) transforms.push({ rotateX: value.rotateX });
|
|
117
|
+
if (value.rotateY !== void 0) transforms.push({ rotateY: value.rotateY });
|
|
118
|
+
if (value.scale !== void 0) transforms.push({ scale: value.scale });
|
|
119
|
+
if (value.scaleX !== void 0) transforms.push({ scaleX: value.scaleX });
|
|
120
|
+
if (value.scaleY !== void 0) transforms.push({ scaleY: value.scaleY });
|
|
121
|
+
if (value.translateX !== void 0)
|
|
122
|
+
transforms.push({ translateX: value.translateX });
|
|
123
|
+
if (value.translateY !== void 0)
|
|
124
|
+
transforms.push({ translateY: value.translateY });
|
|
125
|
+
if (value.skewX !== void 0) transforms.push({ skewX: value.skewX });
|
|
126
|
+
if (value.skewY !== void 0) transforms.push({ skewY: value.skewY });
|
|
127
|
+
return transforms;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
// src/components/container/container.tsx
|
|
131
|
+
var buildStyle = (props) => ({
|
|
132
|
+
...props.width !== void 0 && { width: props.width },
|
|
133
|
+
...props.height !== void 0 && { height: props.height },
|
|
134
|
+
...props.minWidth !== void 0 && { minWidth: props.minWidth },
|
|
135
|
+
...props.maxWidth !== void 0 && { maxWidth: props.maxWidth },
|
|
136
|
+
...props.minHeight !== void 0 && { minHeight: props.minHeight },
|
|
137
|
+
...props.maxHeight !== void 0 && { maxHeight: props.maxHeight },
|
|
138
|
+
...props.aspectRatio !== void 0 && { aspectRatio: props.aspectRatio },
|
|
139
|
+
...props.flex !== void 0 && { flex: props.flex },
|
|
140
|
+
...props.color !== void 0 && { backgroundColor: props.color },
|
|
141
|
+
...props.clip && { overflow: "hidden" },
|
|
142
|
+
...props.opacity !== void 0 && { opacity: props.opacity },
|
|
143
|
+
...props.padding !== void 0 && resolveEdgeInsets(props.padding, "padding"),
|
|
144
|
+
...props.margin !== void 0 && resolveEdgeInsets(props.margin, "margin"),
|
|
145
|
+
...props.alignment !== void 0 && resolveAlignment(props.alignment),
|
|
146
|
+
...props.borderRadius !== void 0 && resolveBorderRadius(props.borderRadius),
|
|
147
|
+
...props.border !== void 0 && resolveBorder(props.border),
|
|
148
|
+
...props.shadow !== void 0 && resolveShadow(props.shadow),
|
|
149
|
+
...props.transform !== void 0 && { transform: resolveTransform(props.transform) }
|
|
150
|
+
});
|
|
151
|
+
var Container = (props) => {
|
|
152
|
+
const {
|
|
153
|
+
children,
|
|
154
|
+
onPress,
|
|
155
|
+
onLongPress,
|
|
156
|
+
onPressIn,
|
|
157
|
+
onPressOut,
|
|
158
|
+
disabled = false,
|
|
159
|
+
accessibilityLabel,
|
|
160
|
+
accessibilityRole,
|
|
161
|
+
accessibilityState,
|
|
162
|
+
accessible,
|
|
163
|
+
testID,
|
|
164
|
+
style
|
|
165
|
+
} = props;
|
|
166
|
+
const containerStyle = buildStyle(props);
|
|
167
|
+
const isInteractive = !!(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(onPress, () => ( onLongPress)), () => ( onPressIn)), () => ( onPressOut)));
|
|
168
|
+
if (isInteractive) {
|
|
169
|
+
return /* @__PURE__ */ _react2.default.createElement(
|
|
170
|
+
_reactnative.Pressable,
|
|
171
|
+
{
|
|
172
|
+
onPress: disabled ? void 0 : onPress,
|
|
173
|
+
onLongPress: disabled ? void 0 : onLongPress,
|
|
174
|
+
onPressIn: disabled ? void 0 : onPressIn,
|
|
175
|
+
onPressOut: disabled ? void 0 : onPressOut,
|
|
176
|
+
disabled,
|
|
177
|
+
accessibilityLabel,
|
|
178
|
+
accessibilityRole,
|
|
179
|
+
accessibilityState,
|
|
180
|
+
accessible,
|
|
181
|
+
testID,
|
|
182
|
+
style: [containerStyle, style]
|
|
183
|
+
},
|
|
184
|
+
children
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
return /* @__PURE__ */ _react2.default.createElement(
|
|
188
|
+
_reactnative.View,
|
|
189
|
+
{
|
|
190
|
+
accessibilityLabel,
|
|
191
|
+
accessibilityRole,
|
|
192
|
+
accessibilityState,
|
|
193
|
+
accessible,
|
|
194
|
+
testID,
|
|
195
|
+
style: [containerStyle, style]
|
|
196
|
+
},
|
|
197
|
+
children
|
|
198
|
+
);
|
|
199
|
+
};
|
|
200
|
+
Container.displayName = "Container";
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
exports.Container = Container;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { AccessibilityRole, AccessibilityState, StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import { EdgeInsets, Alignment, Border, BorderRadius, ShadowConfig, TransformConfig } from '@xaui/core';
|
|
4
|
+
|
|
5
|
+
type ContainerProps = {
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
width?: number | `${number}%`;
|
|
8
|
+
height?: number | `${number}%`;
|
|
9
|
+
minWidth?: number;
|
|
10
|
+
maxWidth?: number;
|
|
11
|
+
minHeight?: number;
|
|
12
|
+
maxHeight?: number;
|
|
13
|
+
aspectRatio?: number;
|
|
14
|
+
flex?: number;
|
|
15
|
+
padding?: EdgeInsets;
|
|
16
|
+
margin?: EdgeInsets;
|
|
17
|
+
alignment?: Alignment;
|
|
18
|
+
color?: string;
|
|
19
|
+
border?: Border;
|
|
20
|
+
borderRadius?: BorderRadius;
|
|
21
|
+
shadow?: ShadowConfig;
|
|
22
|
+
clip?: boolean;
|
|
23
|
+
transform?: TransformConfig;
|
|
24
|
+
opacity?: number;
|
|
25
|
+
onPress?: () => void;
|
|
26
|
+
onLongPress?: () => void;
|
|
27
|
+
onPressIn?: () => void;
|
|
28
|
+
onPressOut?: () => void;
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
accessibilityLabel?: string;
|
|
31
|
+
accessibilityRole?: AccessibilityRole;
|
|
32
|
+
accessibilityState?: AccessibilityState;
|
|
33
|
+
accessible?: boolean;
|
|
34
|
+
testID?: string;
|
|
35
|
+
style?: StyleProp<ViewStyle>;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
declare const Container: React.FC<ContainerProps>;
|
|
39
|
+
|
|
40
|
+
export { Container, type ContainerProps };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { AccessibilityRole, AccessibilityState, StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import { EdgeInsets, Alignment, Border, BorderRadius, ShadowConfig, TransformConfig } from '@xaui/core';
|
|
4
|
+
|
|
5
|
+
type ContainerProps = {
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
width?: number | `${number}%`;
|
|
8
|
+
height?: number | `${number}%`;
|
|
9
|
+
minWidth?: number;
|
|
10
|
+
maxWidth?: number;
|
|
11
|
+
minHeight?: number;
|
|
12
|
+
maxHeight?: number;
|
|
13
|
+
aspectRatio?: number;
|
|
14
|
+
flex?: number;
|
|
15
|
+
padding?: EdgeInsets;
|
|
16
|
+
margin?: EdgeInsets;
|
|
17
|
+
alignment?: Alignment;
|
|
18
|
+
color?: string;
|
|
19
|
+
border?: Border;
|
|
20
|
+
borderRadius?: BorderRadius;
|
|
21
|
+
shadow?: ShadowConfig;
|
|
22
|
+
clip?: boolean;
|
|
23
|
+
transform?: TransformConfig;
|
|
24
|
+
opacity?: number;
|
|
25
|
+
onPress?: () => void;
|
|
26
|
+
onLongPress?: () => void;
|
|
27
|
+
onPressIn?: () => void;
|
|
28
|
+
onPressOut?: () => void;
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
accessibilityLabel?: string;
|
|
31
|
+
accessibilityRole?: AccessibilityRole;
|
|
32
|
+
accessibilityState?: AccessibilityState;
|
|
33
|
+
accessible?: boolean;
|
|
34
|
+
testID?: string;
|
|
35
|
+
style?: StyleProp<ViewStyle>;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
declare const Container: React.FC<ContainerProps>;
|
|
39
|
+
|
|
40
|
+
export { Container, type ContainerProps };
|