@xaui/native 0.9.1-alpha.3 → 0.9.1-alpha.31
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-3FV4COTM.js +68 -0
- package/dist/chunk-423RQBOX.js +21 -0
- package/dist/chunk-42FMGB5M.js +661 -0
- package/dist/chunk-4GTAZM2C.js +174 -0
- package/dist/chunk-4XPLPQLM.cjs +147 -0
- package/dist/{chunk-3QBT3Q65.cjs → chunk-57SJ4LJF.cjs} +7 -2
- package/dist/chunk-5GO7MAVY.cjs +74 -0
- package/dist/chunk-5PTBRJM7.cjs +346 -0
- package/dist/chunk-5RQ7AZPN.cjs +455 -0
- package/dist/chunk-5Z4P6WHR.cjs +525 -0
- package/dist/chunk-7DPL3ZDS.cjs +21 -0
- package/dist/chunk-7EIHHOHP.cjs +42 -0
- package/dist/chunk-7SEZGVTY.js +62 -0
- package/dist/chunk-7XKQJQF2.cjs +70 -0
- package/dist/{chunk-X2K2FX3W.js → chunk-A3EGFI6T.js} +6 -1
- package/dist/chunk-A5OCK3C2.js +525 -0
- package/dist/chunk-AETWQQWU.cjs +92 -0
- package/dist/chunk-ANNUYP55.cjs +431 -0
- package/dist/chunk-BA2DBSAN.js +102 -0
- package/dist/chunk-BFMTUMTU.js +669 -0
- package/dist/chunk-BVJQ3UPZ.js +62 -0
- package/dist/chunk-DFME724B.js +147 -0
- package/dist/chunk-E2CWBQTV.js +119 -0
- package/dist/chunk-EGLLDKN6.js +9 -0
- package/dist/chunk-EJQCQPET.cjs +9 -0
- package/dist/chunk-F6CQ6CBI.cjs +112 -0
- package/dist/chunk-F6W3JQ7K.js +42 -0
- package/dist/chunk-FNEUOBCV.cjs +174 -0
- package/dist/chunk-G7K652GC.js +145 -0
- package/dist/chunk-GGW42MY4.js +20 -0
- package/dist/chunk-GLGU2WFL.cjs +190 -0
- package/dist/chunk-GPVNCJ3Z.cjs +696 -0
- package/dist/chunk-GVQOD3VW.js +74 -0
- package/dist/chunk-IHOCANCQ.js +293 -0
- package/dist/chunk-JDFV4W6N.cjs +700 -0
- package/dist/chunk-KOC3KQIT.js +124 -0
- package/dist/chunk-KPWZLUES.cjs +124 -0
- package/dist/chunk-L7JN6OBQ.cjs +314 -0
- package/dist/chunk-MC7SY2QH.cjs +20 -0
- package/dist/chunk-MDVSCWJI.js +314 -0
- package/dist/chunk-N527BTY4.cjs +366 -0
- package/dist/chunk-NYRXUGVL.js +104 -0
- package/dist/{chunk-AW63PTQ4.cjs → chunk-OHEHPQLC.cjs} +72 -72
- package/dist/chunk-Q3WFY5N3.js +366 -0
- package/dist/chunk-QGN2BBJO.cjs +104 -0
- package/dist/chunk-RDTKAAHX.js +346 -0
- package/dist/chunk-TGZZ3RZU.cjs +86 -0
- package/dist/{chunk-2KXQATVL.js → chunk-TZG3DERP.js} +46 -46
- package/dist/chunk-URSKA2VR.js +190 -0
- package/dist/chunk-V4WDMM6Z.js +86 -0
- package/dist/chunk-VJEER76X.js +455 -0
- package/dist/chunk-VZBWYWEI.cjs +736 -0
- package/dist/chunk-WR7YLDVV.cjs +68 -0
- package/dist/chunk-X4HQ4H2V.js +701 -0
- package/dist/chunk-XFSW3ZNI.cjs +145 -0
- package/dist/chunk-XQFAUDR2.cjs +62 -0
- package/dist/chunk-ZH5XVNHG.js +92 -0
- package/dist/chunk-ZH6BHLQR.js +431 -0
- package/dist/chunk-ZP2E2H2G.cjs +119 -0
- package/dist/chunk-ZVWXM3UK.cjs +293 -0
- package/dist/close-button.type-BUYuoSt2.d.ts +36 -0
- package/dist/close-button.type-CHsgZ3wO.d.cts +36 -0
- package/dist/components/alert/index.cjs +20 -0
- package/dist/components/alert/index.d.cts +169 -0
- package/dist/components/alert/index.d.ts +169 -0
- package/dist/components/alert/index.js +20 -0
- package/dist/components/button/index.cjs +21 -0
- package/dist/components/button/index.d.cts +613 -0
- package/dist/components/button/index.d.ts +613 -0
- package/dist/components/button/index.js +21 -0
- package/dist/components/card/index.cjs +22 -0
- package/dist/components/card/index.d.cts +620 -0
- package/dist/components/card/index.d.ts +620 -0
- package/dist/components/card/index.js +22 -0
- package/dist/components/checkbox/index.cjs +26 -0
- package/dist/components/checkbox/index.d.cts +1136 -0
- package/dist/components/checkbox/index.d.ts +1136 -0
- package/dist/components/checkbox/index.js +26 -0
- package/dist/components/chip/index.cjs +20 -0
- package/dist/components/chip/index.d.cts +608 -0
- package/dist/components/chip/index.d.ts +608 -0
- package/dist/components/chip/index.js +20 -0
- package/dist/components/divider/index.cjs +13 -0
- package/dist/components/divider/index.d.cts +117 -0
- package/dist/components/divider/index.d.ts +117 -0
- package/dist/components/divider/index.js +13 -0
- package/dist/components/input/index.cjs +25 -0
- package/dist/components/input/index.d.cts +205 -0
- package/dist/components/input/index.d.ts +205 -0
- package/dist/components/input/index.js +25 -0
- package/dist/components/input-group/index.cjs +27 -0
- package/dist/components/input-group/index.d.cts +270 -0
- package/dist/components/input-group/index.d.ts +270 -0
- package/dist/components/input-group/index.js +27 -0
- package/dist/components/input-otp/index.cjs +29 -0
- package/dist/components/input-otp/index.d.cts +325 -0
- package/dist/components/input-otp/index.d.ts +325 -0
- package/dist/components/input-otp/index.js +29 -0
- package/dist/components/radio/index.cjs +26 -0
- package/dist/components/radio/index.d.cts +1102 -0
- package/dist/components/radio/index.d.ts +1102 -0
- package/dist/components/radio/index.js +26 -0
- package/dist/components/spinner/index.cjs +16 -0
- package/dist/components/spinner/index.d.cts +104 -0
- package/dist/components/spinner/index.d.ts +104 -0
- package/dist/components/spinner/index.js +16 -0
- package/dist/components/switch/index.cjs +27 -0
- package/dist/components/switch/index.d.cts +1154 -0
- package/dist/components/switch/index.d.ts +1154 -0
- package/dist/components/switch/index.js +27 -0
- package/dist/components/text-area/index.cjs +14 -0
- package/dist/components/text-area/index.d.cts +73 -0
- package/dist/components/text-area/index.d.ts +73 -0
- package/dist/components/text-area/index.js +14 -0
- package/dist/components/typography/index.cjs +15 -0
- package/dist/components/typography/index.d.cts +116 -0
- package/dist/components/typography/index.d.ts +116 -0
- package/dist/components/typography/index.js +15 -0
- package/dist/components/view/index.cjs +17 -0
- package/dist/components/view/index.d.cts +152 -0
- package/dist/components/view/index.d.ts +152 -0
- package/dist/components/view/index.js +17 -0
- package/dist/create-recipe-BdVd2ffi.d.ts +114 -0
- package/dist/create-recipe-dC7wMfnj.d.cts +114 -0
- package/dist/icon.type-Kml72iSz.d.ts +73 -0
- package/dist/icon.type-d_i9ma-i.d.cts +73 -0
- package/dist/index.cjs +252 -4
- package/dist/index.d.cts +110 -4
- package/dist/index.d.ts +110 -4
- package/dist/index.js +271 -23
- package/dist/input.type-BUMDlzL9.d.cts +167 -0
- package/dist/input.type-D2qgi03E.d.ts +167 -0
- package/dist/pressable-feedback.type-BA2C9sSz.d.cts +127 -0
- package/dist/pressable-feedback.type-Bs4dQlGj.d.ts +127 -0
- package/dist/style-props.type-CfnoGEP7.d.cts +31 -0
- package/dist/style-props.type-CfnoGEP7.d.ts +31 -0
- package/dist/system/index.cjs +60 -3
- package/dist/system/index.d.cts +347 -181
- package/dist/system/index.d.ts +347 -181
- package/dist/system/index.js +71 -14
- package/dist/theme/index.cjs +4 -3
- package/dist/theme/index.d.cts +34 -23
- package/dist/theme/index.d.ts +34 -23
- package/dist/theme/index.js +3 -2
- package/dist/{theme.type-C9bFJKFm.d.cts → theme.type-C2gNHpEx.d.cts} +1 -1
- package/dist/{theme.type-C9bFJKFm.d.ts → theme.type-C2gNHpEx.d.ts} +1 -1
- package/package.json +184 -18
- package/dist/chunk-QAMNNTGM.js +0 -637
- package/dist/chunk-V63JO65F.cjs +0 -637
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Slot
|
|
3
|
+
} from "./chunk-E2CWBQTV.js";
|
|
4
|
+
import {
|
|
5
|
+
useStyleProps
|
|
6
|
+
} from "./chunk-URSKA2VR.js";
|
|
7
|
+
|
|
8
|
+
// src/components/view/grid.tsx
|
|
9
|
+
import { Children, forwardRef, useMemo, useState } from "react";
|
|
10
|
+
import { View } from "react-native";
|
|
11
|
+
|
|
12
|
+
// src/components/view/grid.context.ts
|
|
13
|
+
import { createContext, useContext } from "react";
|
|
14
|
+
var GridContext = createContext(null);
|
|
15
|
+
var GridProvider = GridContext.Provider;
|
|
16
|
+
function useGrid() {
|
|
17
|
+
const value = useContext(GridContext);
|
|
18
|
+
if (value === null) {
|
|
19
|
+
throw new Error(
|
|
20
|
+
"XAUI: Grid.Item must be rendered inside a Grid \u2014 it spans that grid\u2019s columns, and outside one there is nothing to span."
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
return value;
|
|
24
|
+
}
|
|
25
|
+
function spanWidth({ cellWidth, columns, gap }, span) {
|
|
26
|
+
const clamped = Math.min(Math.max(Math.floor(span), 1), columns);
|
|
27
|
+
if (cellWidth === void 0) return `${100 / columns * clamped}%`;
|
|
28
|
+
return cellWidth * clamped + gap * (clamped - 1);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// src/components/view/grid.tsx
|
|
32
|
+
import { jsx } from "react/jsx-runtime";
|
|
33
|
+
var GridRoot = forwardRef(function Grid({ children, columns = 2, gap = 0, style, onLayout, ...props }, ref) {
|
|
34
|
+
const [width, setWidth] = useState();
|
|
35
|
+
const [styleProps, rest] = useStyleProps(props);
|
|
36
|
+
const safeColumns = Math.max(Math.floor(columns), 1);
|
|
37
|
+
const cellWidth = width === void 0 ? void 0 : (width - gap * (safeColumns - 1)) / safeColumns;
|
|
38
|
+
const context = useMemo(
|
|
39
|
+
() => ({ cellWidth, columns: safeColumns, gap }),
|
|
40
|
+
[cellWidth, safeColumns, gap]
|
|
41
|
+
);
|
|
42
|
+
const handleLayout = (event) => {
|
|
43
|
+
const next = event.nativeEvent.layout.width;
|
|
44
|
+
if (next > 0 && next !== width) setWidth(next);
|
|
45
|
+
onLayout?.(event);
|
|
46
|
+
};
|
|
47
|
+
return /* @__PURE__ */ jsx(GridProvider, { value: context, children: /* @__PURE__ */ jsx(
|
|
48
|
+
View,
|
|
49
|
+
{
|
|
50
|
+
ref,
|
|
51
|
+
onLayout: handleLayout,
|
|
52
|
+
style: [
|
|
53
|
+
{ flexDirection: "row", flexWrap: "wrap", rowGap: gap, columnGap: gap },
|
|
54
|
+
styleProps,
|
|
55
|
+
style
|
|
56
|
+
],
|
|
57
|
+
...rest,
|
|
58
|
+
children: Children.map(
|
|
59
|
+
children,
|
|
60
|
+
(child) => isGridItem(child) ? child : /* @__PURE__ */ jsx(View, { style: { width: spanWidth(context, 1) }, children: child })
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
) });
|
|
64
|
+
});
|
|
65
|
+
GridRoot.displayName = "XAUI.Grid";
|
|
66
|
+
function isGridItem(child) {
|
|
67
|
+
if (child === null || typeof child !== "object") return false;
|
|
68
|
+
const type = child.type;
|
|
69
|
+
return type?.displayName === "XAUI.Grid.Item";
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// src/components/view/grid-item.tsx
|
|
73
|
+
import { forwardRef as forwardRef2 } from "react";
|
|
74
|
+
import { View as View2 } from "react-native";
|
|
75
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
76
|
+
var GridItem = forwardRef2(function GridItem2({ children, span = 1, style, ...props }, ref) {
|
|
77
|
+
const grid = useGrid();
|
|
78
|
+
const [styleProps, rest] = useStyleProps(props);
|
|
79
|
+
return /* @__PURE__ */ jsx2(
|
|
80
|
+
View2,
|
|
81
|
+
{
|
|
82
|
+
ref,
|
|
83
|
+
style: [{ width: spanWidth(grid, span) }, styleProps, style],
|
|
84
|
+
...rest,
|
|
85
|
+
children
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
});
|
|
89
|
+
GridItem.displayName = "XAUI.Grid.Item";
|
|
90
|
+
|
|
91
|
+
// src/components/view/stack.tsx
|
|
92
|
+
import { forwardRef as forwardRef3 } from "react";
|
|
93
|
+
import { View as View3 } from "react-native";
|
|
94
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
95
|
+
var StackRoot = forwardRef3(function Stack({ children, asChild = false, style, ...props }, ref) {
|
|
96
|
+
const [styleProps, rest] = useStyleProps(props);
|
|
97
|
+
const Root = asChild ? Slot : View3;
|
|
98
|
+
return /* @__PURE__ */ jsx3(Root, { ref, style: [{ position: "relative" }, styleProps, style], ...rest, children });
|
|
99
|
+
});
|
|
100
|
+
StackRoot.displayName = "XAUI.Stack";
|
|
101
|
+
|
|
102
|
+
// src/components/view/stack-item.tsx
|
|
103
|
+
import { forwardRef as forwardRef4 } from "react";
|
|
104
|
+
import { View as View4 } from "react-native";
|
|
105
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
106
|
+
var StackItem = forwardRef4(function StackItem2({ children, asChild = false, style, ...props }, ref) {
|
|
107
|
+
const [styleProps, rest] = useStyleProps(props);
|
|
108
|
+
const Root = asChild ? Slot : View4;
|
|
109
|
+
return /* @__PURE__ */ jsx4(Root, { ref, style: [{ position: "absolute" }, styleProps, style], ...rest, children });
|
|
110
|
+
});
|
|
111
|
+
StackItem.displayName = "XAUI.Stack.Item";
|
|
112
|
+
|
|
113
|
+
// src/components/view/row.tsx
|
|
114
|
+
import { forwardRef as forwardRef5 } from "react";
|
|
115
|
+
import { View as View5 } from "react-native";
|
|
116
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
117
|
+
var Row = forwardRef5(function Row2({ children, asChild = false, style, ...props }, ref) {
|
|
118
|
+
const [styleProps, rest] = useStyleProps(props);
|
|
119
|
+
const Root = asChild ? Slot : View5;
|
|
120
|
+
return /* @__PURE__ */ jsx5(Root, { ref, style: [{ flexDirection: "row" }, styleProps, style], ...rest, children });
|
|
121
|
+
});
|
|
122
|
+
Row.displayName = "XAUI.Row";
|
|
123
|
+
|
|
124
|
+
// src/components/view/column.tsx
|
|
125
|
+
import { forwardRef as forwardRef6 } from "react";
|
|
126
|
+
import { View as View6 } from "react-native";
|
|
127
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
128
|
+
var Column = forwardRef6(function Column2({ children, asChild = false, style, ...props }, ref) {
|
|
129
|
+
const [styleProps, rest] = useStyleProps(props);
|
|
130
|
+
const Root = asChild ? Slot : View6;
|
|
131
|
+
return /* @__PURE__ */ jsx6(Root, { ref, style: [{ flexDirection: "column" }, styleProps, style], ...rest, children });
|
|
132
|
+
});
|
|
133
|
+
Column.displayName = "XAUI.Column";
|
|
134
|
+
|
|
135
|
+
// src/components/view/index.ts
|
|
136
|
+
var Stack2 = Object.assign(StackRoot, { Item: StackItem });
|
|
137
|
+
var Grid2 = Object.assign(GridRoot, { Item: GridItem });
|
|
138
|
+
|
|
139
|
+
export {
|
|
140
|
+
useGrid,
|
|
141
|
+
Row,
|
|
142
|
+
Column,
|
|
143
|
+
Stack2 as Stack,
|
|
144
|
+
Grid2 as Grid
|
|
145
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// src/utils/stable-hash.ts
|
|
2
|
+
function canonical(value) {
|
|
3
|
+
if (value === null || typeof value !== "object") return JSON.stringify(value) ?? "null";
|
|
4
|
+
if (Array.isArray(value)) return `[${value.map(canonical).join(",")}]`;
|
|
5
|
+
const entries = Object.entries(value).filter(([, v]) => typeof v !== "function").sort(([a], [b]) => a < b ? -1 : 1).map(([k, v]) => `${JSON.stringify(k)}:${canonical(v)}`);
|
|
6
|
+
return `{${entries.join(",")}}`;
|
|
7
|
+
}
|
|
8
|
+
function stableHash(value) {
|
|
9
|
+
const input = canonical(value);
|
|
10
|
+
let hash = 2166136261;
|
|
11
|
+
for (let i = 0; i < input.length; i++) {
|
|
12
|
+
hash ^= input.charCodeAt(i);
|
|
13
|
+
hash = Math.imul(hash, 16777619) >>> 0;
|
|
14
|
+
}
|
|
15
|
+
return hash.toString(36);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
stableHash
|
|
20
|
+
};
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkMC7SY2QHcjs = require('./chunk-MC7SY2QH.cjs');
|
|
4
|
+
|
|
5
|
+
// src/system/slot/merge-refs.ts
|
|
6
|
+
function mergeRefs(...refs) {
|
|
7
|
+
return (value) => {
|
|
8
|
+
for (const ref of refs) {
|
|
9
|
+
if (typeof ref === "function") ref(value);
|
|
10
|
+
else if (ref) ref.current = value;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// src/system/style-props/use-style-props.ts
|
|
16
|
+
var _react = require('react');
|
|
17
|
+
|
|
18
|
+
// src/utils/style-props.ts
|
|
19
|
+
var STYLE_PROP_KEYS = [
|
|
20
|
+
// Flex and layout
|
|
21
|
+
"alignContent",
|
|
22
|
+
"alignItems",
|
|
23
|
+
"alignSelf",
|
|
24
|
+
"aspectRatio",
|
|
25
|
+
"boxSizing",
|
|
26
|
+
"columnGap",
|
|
27
|
+
"direction",
|
|
28
|
+
"display",
|
|
29
|
+
"flex",
|
|
30
|
+
"flexBasis",
|
|
31
|
+
"flexDirection",
|
|
32
|
+
"flexGrow",
|
|
33
|
+
"flexShrink",
|
|
34
|
+
"flexWrap",
|
|
35
|
+
"gap",
|
|
36
|
+
"justifyContent",
|
|
37
|
+
"overflow",
|
|
38
|
+
"rowGap",
|
|
39
|
+
// Position
|
|
40
|
+
"bottom",
|
|
41
|
+
"end",
|
|
42
|
+
"inset",
|
|
43
|
+
"insetBlock",
|
|
44
|
+
"insetBlockEnd",
|
|
45
|
+
"insetBlockStart",
|
|
46
|
+
"insetInline",
|
|
47
|
+
"insetInlineEnd",
|
|
48
|
+
"insetInlineStart",
|
|
49
|
+
"position",
|
|
50
|
+
"start",
|
|
51
|
+
"top",
|
|
52
|
+
"zIndex",
|
|
53
|
+
// Margin
|
|
54
|
+
"margin",
|
|
55
|
+
"marginBlock",
|
|
56
|
+
"marginBlockEnd",
|
|
57
|
+
"marginBlockStart",
|
|
58
|
+
"marginBottom",
|
|
59
|
+
"marginEnd",
|
|
60
|
+
"marginHorizontal",
|
|
61
|
+
"marginInline",
|
|
62
|
+
"marginInlineEnd",
|
|
63
|
+
"marginInlineStart",
|
|
64
|
+
"marginStart",
|
|
65
|
+
"marginTop",
|
|
66
|
+
"marginVertical",
|
|
67
|
+
// Padding
|
|
68
|
+
"padding",
|
|
69
|
+
"paddingBlock",
|
|
70
|
+
"paddingBlockEnd",
|
|
71
|
+
"paddingBlockStart",
|
|
72
|
+
"paddingBottom",
|
|
73
|
+
"paddingEnd",
|
|
74
|
+
"paddingHorizontal",
|
|
75
|
+
"paddingInline",
|
|
76
|
+
"paddingInlineEnd",
|
|
77
|
+
"paddingInlineStart",
|
|
78
|
+
"paddingStart",
|
|
79
|
+
"paddingTop",
|
|
80
|
+
"paddingVertical",
|
|
81
|
+
// Size
|
|
82
|
+
"height",
|
|
83
|
+
"maxHeight",
|
|
84
|
+
"maxWidth",
|
|
85
|
+
"minHeight",
|
|
86
|
+
"minWidth",
|
|
87
|
+
"width",
|
|
88
|
+
// Border
|
|
89
|
+
"borderBlockColor",
|
|
90
|
+
"borderBlockEndColor",
|
|
91
|
+
"borderBlockStartColor",
|
|
92
|
+
"borderBottomColor",
|
|
93
|
+
"borderBottomEndRadius",
|
|
94
|
+
"borderBottomStartRadius",
|
|
95
|
+
"borderBottomWidth",
|
|
96
|
+
"borderColor",
|
|
97
|
+
"borderCurve",
|
|
98
|
+
"borderEndColor",
|
|
99
|
+
"borderEndEndRadius",
|
|
100
|
+
"borderEndStartRadius",
|
|
101
|
+
"borderEndWidth",
|
|
102
|
+
"borderRadius",
|
|
103
|
+
"borderStartColor",
|
|
104
|
+
"borderStartEndRadius",
|
|
105
|
+
"borderStartStartRadius",
|
|
106
|
+
"borderStartWidth",
|
|
107
|
+
"borderStyle",
|
|
108
|
+
"borderTopColor",
|
|
109
|
+
"borderTopEndRadius",
|
|
110
|
+
"borderTopStartRadius",
|
|
111
|
+
"borderTopWidth",
|
|
112
|
+
"borderWidth",
|
|
113
|
+
// Fill, shadow, and the rest of a box's paint
|
|
114
|
+
"backfaceVisibility",
|
|
115
|
+
"backgroundColor",
|
|
116
|
+
"boxShadow",
|
|
117
|
+
"cursor",
|
|
118
|
+
"elevation",
|
|
119
|
+
"experimental_backgroundImage",
|
|
120
|
+
"filter",
|
|
121
|
+
"isolation",
|
|
122
|
+
"mixBlendMode",
|
|
123
|
+
"opacity",
|
|
124
|
+
"outlineColor",
|
|
125
|
+
"outlineOffset",
|
|
126
|
+
"outlineStyle",
|
|
127
|
+
"outlineWidth",
|
|
128
|
+
"shadowColor",
|
|
129
|
+
"shadowOffset",
|
|
130
|
+
"shadowOpacity",
|
|
131
|
+
"shadowRadius",
|
|
132
|
+
// Transform
|
|
133
|
+
"rotation",
|
|
134
|
+
"scaleX",
|
|
135
|
+
"scaleY",
|
|
136
|
+
"transform",
|
|
137
|
+
"transformMatrix",
|
|
138
|
+
"transformOrigin",
|
|
139
|
+
"translateX",
|
|
140
|
+
"translateY",
|
|
141
|
+
// Text — a text slot only
|
|
142
|
+
"color",
|
|
143
|
+
"fontFamily",
|
|
144
|
+
"fontSize",
|
|
145
|
+
"fontStyle",
|
|
146
|
+
"fontVariant",
|
|
147
|
+
"fontWeight",
|
|
148
|
+
"includeFontPadding",
|
|
149
|
+
"letterSpacing",
|
|
150
|
+
"lineHeight",
|
|
151
|
+
"textAlign",
|
|
152
|
+
"textAlignVertical",
|
|
153
|
+
"textDecorationColor",
|
|
154
|
+
"textDecorationLine",
|
|
155
|
+
"textDecorationStyle",
|
|
156
|
+
"textShadowColor",
|
|
157
|
+
"textShadowOffset",
|
|
158
|
+
"textShadowRadius",
|
|
159
|
+
"textTransform",
|
|
160
|
+
"userSelect",
|
|
161
|
+
"verticalAlign",
|
|
162
|
+
"writingDirection",
|
|
163
|
+
// Image — an image slot only
|
|
164
|
+
"objectFit",
|
|
165
|
+
"overlayColor",
|
|
166
|
+
"resizeMode",
|
|
167
|
+
"tintColor"
|
|
168
|
+
];
|
|
169
|
+
var STYLE_PROP_KEY_SET = new Set(STYLE_PROP_KEYS);
|
|
170
|
+
function splitStyleProps(props) {
|
|
171
|
+
const styleProps = {};
|
|
172
|
+
const rest = {};
|
|
173
|
+
for (const [key, value] of Object.entries(props)) {
|
|
174
|
+
if (STYLE_PROP_KEY_SET.has(key)) styleProps[key] = value;
|
|
175
|
+
else rest[key] = value;
|
|
176
|
+
}
|
|
177
|
+
return [styleProps, rest];
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// src/system/style-props/use-style-props.ts
|
|
181
|
+
function useStyleProps(props) {
|
|
182
|
+
const [styleProps, rest] = splitStyleProps(props);
|
|
183
|
+
const key = _chunkMC7SY2QHcjs.stableHash.call(void 0, styleProps);
|
|
184
|
+
return [_react.useMemo.call(void 0, () => styleProps, [key]), rest];
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
exports.mergeRefs = mergeRefs; exports.useStyleProps = useStyleProps;
|