@xaui/native 0.9.1-alpha.4 → 0.9.1-alpha.41
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-2EGR4LWD.js +145 -0
- package/dist/chunk-2NRZKJG7.js +531 -0
- package/dist/chunk-2PMXMKS5.js +67 -0
- package/dist/chunk-2XPG2243.js +586 -0
- package/dist/chunk-36PRYGAM.js +13 -0
- package/dist/chunk-3E7CDKFO.cjs +696 -0
- package/dist/chunk-3GFRSZYR.js +54 -0
- package/dist/chunk-423RQBOX.js +21 -0
- package/dist/chunk-4CUZZWFW.js +92 -0
- package/dist/chunk-4GTAZM2C.js +174 -0
- package/dist/chunk-4KFKWBN5.cjs +89 -0
- package/dist/{chunk-3QBT3Q65.cjs → chunk-57SJ4LJF.cjs} +7 -2
- package/dist/chunk-5R26NM4M.cjs +402 -0
- package/dist/chunk-5VKYNBNA.js +607 -0
- package/dist/chunk-64MXEVT3.js +66 -0
- package/dist/chunk-6DOLGZVV.cjs +147 -0
- package/dist/chunk-6L2TS2R3.cjs +92 -0
- package/dist/chunk-6UEZJRVI.js +669 -0
- package/dist/chunk-734MFAX4.js +27 -0
- package/dist/chunk-73RKQC5X.js +104 -0
- package/dist/chunk-7DPL3ZDS.cjs +21 -0
- package/dist/chunk-7EIHHOHP.cjs +42 -0
- package/dist/chunk-7GHM4GKL.cjs +119 -0
- package/dist/chunk-7YF5NAHQ.cjs +74 -0
- package/dist/{chunk-X2K2FX3W.js → chunk-A3EGFI6T.js} +6 -1
- package/dist/chunk-ABAGZTXZ.cjs +736 -0
- package/dist/{chunk-AW63PTQ4.cjs → chunk-ACAPTWE3.cjs} +85 -81
- package/dist/chunk-AMCSSOJT.cjs +104 -0
- package/dist/chunk-BA2DBSAN.js +102 -0
- package/dist/chunk-BRRXFOBY.js +431 -0
- package/dist/chunk-C5YLPCFC.cjs +293 -0
- package/dist/chunk-DA3OKXHV.cjs +700 -0
- package/dist/chunk-DD4276RF.js +366 -0
- package/dist/chunk-DG2I4PJG.js +701 -0
- package/dist/chunk-DHGLGSH6.js +661 -0
- package/dist/chunk-DIBUQ46Y.js +346 -0
- package/dist/chunk-EGLLDKN6.js +9 -0
- package/dist/chunk-EJQCQPET.cjs +9 -0
- package/dist/chunk-EKS3W46M.cjs +66 -0
- package/dist/chunk-EZEYMLO3.js +402 -0
- package/dist/chunk-F6CQ6CBI.cjs +112 -0
- package/dist/chunk-F6W3JQ7K.js +42 -0
- package/dist/chunk-FHUYHV6J.js +89 -0
- package/dist/chunk-FNEUOBCV.cjs +174 -0
- package/dist/chunk-G3CCT4EY.js +518 -0
- package/dist/chunk-G7P3ERYF.cjs +478 -0
- package/dist/chunk-GA6PBWNT.js +147 -0
- package/dist/chunk-GFUZ3MUT.cjs +455 -0
- package/dist/chunk-GGW43Q37.cjs +1 -0
- package/dist/chunk-GTR5X65M.cjs +27 -0
- package/dist/chunk-H4E4HDEP.cjs +13 -0
- package/dist/chunk-H7DS4IO7.js +198 -0
- package/dist/chunk-HDVVZG4S.cjs +198 -0
- package/dist/chunk-IKJVLJKT.js +151 -0
- package/dist/chunk-J3MB4PI5.cjs +531 -0
- package/dist/chunk-K72UDPVN.js +119 -0
- package/dist/chunk-KCMYU7WF.js +86 -0
- package/dist/chunk-LRN3RNDO.js +940 -0
- package/dist/chunk-LTX6TB5I.js +124 -0
- package/dist/chunk-LUPCPLND.cjs +145 -0
- package/dist/chunk-M63GFNKV.js +194 -0
- package/dist/chunk-N3KTZMPG.js +293 -0
- package/dist/chunk-NCTOTTVW.js +13 -0
- package/dist/chunk-NWGLP6JX.cjs +410 -0
- package/dist/chunk-R73XQK7X.cjs +314 -0
- package/dist/chunk-RU7JCMWC.cjs +881 -0
- package/dist/chunk-SNIHUKDA.cjs +184 -0
- package/dist/chunk-T5FV5F7A.cjs +607 -0
- package/dist/chunk-TDTUAIFF.cjs +153 -0
- package/dist/chunk-TJ74XVZN.cjs +431 -0
- package/dist/chunk-TK44VBIE.cjs +194 -0
- package/dist/chunk-UAWBAD4E.cjs +346 -0
- package/dist/chunk-UFTCTTKK.js +381 -0
- package/dist/chunk-VLKBESEV.cjs +407 -0
- package/dist/chunk-WDDXU3OH.cjs +67 -0
- package/dist/chunk-WFEMJCXO.cjs +13 -0
- package/dist/chunk-WHJTBTYM.js +0 -0
- package/dist/{chunk-2KXQATVL.js → chunk-WKCQ6VGW.js} +59 -55
- package/dist/chunk-XFPQFCEK.js +455 -0
- package/dist/chunk-XSQPVDFH.cjs +60 -0
- package/dist/chunk-XTC2SLFT.js +153 -0
- package/dist/chunk-XV735BSA.cjs +366 -0
- package/dist/chunk-XWNG2U4K.cjs +124 -0
- package/dist/chunk-YGYYJ3LQ.js +314 -0
- package/dist/chunk-YVHT2UVW.js +74 -0
- package/dist/chunk-ZFOOJK37.cjs +86 -0
- package/dist/close-button.type-BUYuoSt2.d.ts +36 -0
- package/dist/close-button.type-CHsgZ3wO.d.cts +36 -0
- package/dist/components/accordion/index.cjs +35 -0
- package/dist/components/accordion/index.d.cts +299 -0
- package/dist/components/accordion/index.d.ts +299 -0
- package/dist/components/accordion/index.js +35 -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/avatar/index.cjs +16 -0
- package/dist/components/avatar/index.d.cts +131 -0
- package/dist/components/avatar/index.d.ts +131 -0
- package/dist/components/avatar/index.js +16 -0
- package/dist/components/badge/index.cjs +15 -0
- package/dist/components/badge/index.d.cts +157 -0
- package/dist/components/badge/index.d.ts +157 -0
- package/dist/components/badge/index.js +15 -0
- package/dist/components/button/index.cjs +22 -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 +22 -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/field-group/index.cjs +27 -0
- package/dist/components/field-group/index.d.cts +270 -0
- package/dist/components/field-group/index.d.ts +270 -0
- package/dist/components/field-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/menu/index.cjs +49 -0
- package/dist/components/menu/index.d.cts +351 -0
- package/dist/components/menu/index.d.ts +351 -0
- package/dist/components/menu/index.js +49 -0
- package/dist/components/popover/index.cjs +38 -0
- package/dist/components/popover/index.d.cts +254 -0
- package/dist/components/popover/index.d.ts +254 -0
- package/dist/components/popover/index.js +38 -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/select/index.cjs +50 -0
- package/dist/components/select/index.d.cts +498 -0
- package/dist/components/select/index.d.ts +498 -0
- package/dist/components/select/index.js +50 -0
- package/dist/components/skeleton/index.cjs +11 -0
- package/dist/components/skeleton/index.d.cts +111 -0
- package/dist/components/skeleton/index.d.ts +111 -0
- package/dist/components/skeleton/index.js +11 -0
- package/dist/components/spinner/index.cjs +17 -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 +17 -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/tabs/index.cjs +33 -0
- package/dist/components/tabs/index.d.cts +261 -0
- package/dist/components/tabs/index.d.ts +261 -0
- package/dist/components/tabs/index.js +33 -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/text-field/index.cjs +25 -0
- package/dist/components/text-field/index.d.cts +205 -0
- package/dist/components/text-field/index.d.ts +205 -0
- package/dist/components/text-field/index.js +25 -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 +423 -5
- package/dist/index.d.cts +119 -4
- package/dist/index.d.ts +119 -4
- package/dist/index.js +445 -27
- package/dist/placement-DHa0Rrh1.d.cts +38 -0
- package/dist/placement-DHa0Rrh1.d.ts +38 -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 +73 -4
- package/dist/system/index.d.cts +379 -193
- package/dist/system/index.d.ts +379 -193
- package/dist/system/index.js +87 -18
- package/dist/text-field.type-0l73acce.d.ts +167 -0
- package/dist/text-field.type-DBh06DU5.d.cts +167 -0
- package/dist/theme/index.cjs +5 -3
- package/dist/theme/index.d.cts +55 -24
- package/dist/theme/index.d.ts +55 -24
- package/dist/theme/index.js +4 -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 +264 -18
- package/dist/chunk-ECDWSSHJ.js +0 -688
- package/dist/chunk-IYFGO523.cjs +0 -688
|
@@ -0,0 +1,531 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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; }
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkFNEUOBCVcjs = require('./chunk-FNEUOBCV.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunk57SJ4LJFcjs = require('./chunk-57SJ4LJF.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
var _chunk7GHM4GKLcjs = require('./chunk-7GHM4GKL.cjs');
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
var _chunkTK44VBIEcjs = require('./chunk-TK44VBIE.cjs');
|
|
15
|
+
|
|
16
|
+
// src/components/text-field/text-field-description.tsx
|
|
17
|
+
var _react = require('react');
|
|
18
|
+
var _reactnative = require('react-native');
|
|
19
|
+
|
|
20
|
+
// src/components/text-field/text-field.context.ts
|
|
21
|
+
var [TextFieldProvider, useTextField] = _chunk7GHM4GKLcjs.createSlotContext.call(void 0, "TextField");
|
|
22
|
+
|
|
23
|
+
// src/components/text-field/text-field-description.tsx
|
|
24
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
25
|
+
var TextFieldDescription = _react.forwardRef.call(void 0,
|
|
26
|
+
function TextFieldDescription2({ children, style, nativeID, ...props }, ref) {
|
|
27
|
+
const { descriptionStyle, descriptionId } = useTextField();
|
|
28
|
+
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
29
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
30
|
+
_reactnative.Text,
|
|
31
|
+
{
|
|
32
|
+
ref,
|
|
33
|
+
nativeID: _nullishCoalesce(nativeID, () => ( descriptionId)),
|
|
34
|
+
style: [descriptionStyle, styleProps, style],
|
|
35
|
+
...rest,
|
|
36
|
+
children
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
TextFieldDescription.displayName = "XAUI.TextField.Description";
|
|
42
|
+
|
|
43
|
+
// src/components/text-field/text-field-error.tsx
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
var TextFieldError = _react.forwardRef.call(void 0,
|
|
48
|
+
function TextFieldError2({ children, style, ...props }, ref) {
|
|
49
|
+
const { errorStyle } = useTextField();
|
|
50
|
+
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
51
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { ref, style: [errorStyle, styleProps, style], ...rest, children });
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
TextFieldError.displayName = "XAUI.TextField.Error";
|
|
55
|
+
|
|
56
|
+
// src/components/text-field/text-field-field.tsx
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
var TextFieldField = _react.forwardRef.call(void 0,
|
|
61
|
+
function TextFieldField2({ style, onFocus, onBlur, placeholderTextColor, ...props }, ref) {
|
|
62
|
+
const {
|
|
63
|
+
fieldStyle,
|
|
64
|
+
placeholderTextColor: resolvedPlaceholder,
|
|
65
|
+
onFieldFocus,
|
|
66
|
+
onFieldBlur,
|
|
67
|
+
labelId,
|
|
68
|
+
descriptionId,
|
|
69
|
+
isDisabled,
|
|
70
|
+
isInvalid
|
|
71
|
+
} = useTextField();
|
|
72
|
+
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
73
|
+
const handleFocus = _react.useCallback.call(void 0,
|
|
74
|
+
(event) => {
|
|
75
|
+
onFieldFocus(event);
|
|
76
|
+
_optionalChain([onFocus, 'optionalCall', _ => _(event)]);
|
|
77
|
+
},
|
|
78
|
+
[onFieldFocus, onFocus]
|
|
79
|
+
);
|
|
80
|
+
const handleBlur = _react.useCallback.call(void 0,
|
|
81
|
+
(event) => {
|
|
82
|
+
onFieldBlur(event);
|
|
83
|
+
_optionalChain([onBlur, 'optionalCall', _2 => _2(event)]);
|
|
84
|
+
},
|
|
85
|
+
[onFieldBlur, onBlur]
|
|
86
|
+
);
|
|
87
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
88
|
+
_reactnative.TextInput,
|
|
89
|
+
{
|
|
90
|
+
ref,
|
|
91
|
+
"aria-labelledby": labelId,
|
|
92
|
+
"aria-describedby": descriptionId,
|
|
93
|
+
"aria-invalid": isInvalid,
|
|
94
|
+
editable: !isDisabled,
|
|
95
|
+
accessibilityState: { disabled: isDisabled },
|
|
96
|
+
placeholderTextColor: _nullishCoalesce(placeholderTextColor, () => ( resolvedPlaceholder)),
|
|
97
|
+
...rest,
|
|
98
|
+
style: [fieldStyle, styleProps, style],
|
|
99
|
+
onFocus: handleFocus,
|
|
100
|
+
onBlur: handleBlur
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
TextFieldField.displayName = "XAUI.TextField.Field";
|
|
106
|
+
|
|
107
|
+
// src/components/text-field/text-field-label.tsx
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
var TextFieldLabel = _react.forwardRef.call(void 0,
|
|
112
|
+
function TextFieldLabel2({ children, style, nativeID, ...props }, ref) {
|
|
113
|
+
const { labelStyle, labelId } = useTextField();
|
|
114
|
+
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
115
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
116
|
+
_reactnative.Text,
|
|
117
|
+
{
|
|
118
|
+
ref,
|
|
119
|
+
nativeID: _nullishCoalesce(nativeID, () => ( labelId)),
|
|
120
|
+
style: [labelStyle, styleProps, style],
|
|
121
|
+
...rest,
|
|
122
|
+
children
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
TextFieldLabel.displayName = "XAUI.TextField.Label";
|
|
128
|
+
|
|
129
|
+
// src/components/text-field/text-field.tsx
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
// src/components/text-field/text-field.recipe.ts
|
|
134
|
+
var SLOTS = [
|
|
135
|
+
"root",
|
|
136
|
+
"label",
|
|
137
|
+
"field",
|
|
138
|
+
"textArea",
|
|
139
|
+
"placeholder",
|
|
140
|
+
"description",
|
|
141
|
+
"error",
|
|
142
|
+
"prefix",
|
|
143
|
+
"suffix",
|
|
144
|
+
"icon"
|
|
145
|
+
];
|
|
146
|
+
var VARIANT_TOKENS = {
|
|
147
|
+
primary: {
|
|
148
|
+
bg: "fieldBackground",
|
|
149
|
+
border: "fieldBorder",
|
|
150
|
+
borderFocus: "fieldBorderFocus",
|
|
151
|
+
fg: "fieldForeground"
|
|
152
|
+
},
|
|
153
|
+
// `bg: 'default'` is the neutral *token*, not this variant's name — the two namespaces
|
|
154
|
+
// meet here and nowhere else. It is also what keeps a field visible on a card, where
|
|
155
|
+
// `fieldBackground` is the card's own colour.
|
|
156
|
+
secondary: {
|
|
157
|
+
bg: "default",
|
|
158
|
+
border: "fieldBorder",
|
|
159
|
+
borderFocus: "fieldBorderFocus",
|
|
160
|
+
fg: "fieldForeground"
|
|
161
|
+
},
|
|
162
|
+
tertiary: {
|
|
163
|
+
border: "fieldBorder",
|
|
164
|
+
borderFocus: "fieldBorderFocus",
|
|
165
|
+
fg: "fieldForeground"
|
|
166
|
+
},
|
|
167
|
+
ghost: { borderFocus: "fieldBorderFocus", fg: "fieldForeground" }
|
|
168
|
+
};
|
|
169
|
+
function sizeAxis(step) {
|
|
170
|
+
const { control, padding, gap, field, label, help, glyph, textAreaPadding } = step;
|
|
171
|
+
return (theme) => {
|
|
172
|
+
const inset = { paddingHorizontal: theme.spacing(LABEL_INSET) };
|
|
173
|
+
const helpType = {
|
|
174
|
+
fontSize: theme.fontSizes[help],
|
|
175
|
+
lineHeight: theme.lineHeights[help]
|
|
176
|
+
};
|
|
177
|
+
const decorator = {
|
|
178
|
+
paddingHorizontal: theme.spacing(padding),
|
|
179
|
+
gap: theme.spacing(padding)
|
|
180
|
+
};
|
|
181
|
+
return {
|
|
182
|
+
root: { gap: theme.spacing(gap) },
|
|
183
|
+
label: {
|
|
184
|
+
...inset,
|
|
185
|
+
fontSize: theme.fontSizes[label],
|
|
186
|
+
lineHeight: theme.lineHeights[label]
|
|
187
|
+
},
|
|
188
|
+
field: {
|
|
189
|
+
minHeight: theme.controlHeights[control],
|
|
190
|
+
paddingHorizontal: theme.spacing(padding),
|
|
191
|
+
fontSize: theme.fontSizes[field]
|
|
192
|
+
},
|
|
193
|
+
// Only what a multiline field *adds* — `TextField.TextArea` layers this over the field's
|
|
194
|
+
// own style rather than restating it, so the colours, the border and the radius are
|
|
195
|
+
// resolved once for both. The height is not here: `rows` is a raw value, and the
|
|
196
|
+
// slot computes it from the two numbers below.
|
|
197
|
+
textArea: {
|
|
198
|
+
lineHeight: theme.lineHeights[field],
|
|
199
|
+
paddingTop: theme.spacing(textAreaPadding),
|
|
200
|
+
paddingBottom: theme.spacing(textAreaPadding)
|
|
201
|
+
},
|
|
202
|
+
description: { ...inset, ...helpType },
|
|
203
|
+
error: { ...inset, ...helpType },
|
|
204
|
+
prefix: decorator,
|
|
205
|
+
suffix: decorator,
|
|
206
|
+
icon: { fontSize: theme.fontSizes[glyph] }
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
var LABEL_INSET = 1.5;
|
|
211
|
+
var DECORATOR = {
|
|
212
|
+
position: "absolute",
|
|
213
|
+
top: 0,
|
|
214
|
+
bottom: 0,
|
|
215
|
+
flexDirection: "row",
|
|
216
|
+
alignItems: "center",
|
|
217
|
+
justifyContent: "center",
|
|
218
|
+
zIndex: 10
|
|
219
|
+
};
|
|
220
|
+
var SIZES = {
|
|
221
|
+
xs: {
|
|
222
|
+
control: "xs",
|
|
223
|
+
padding: 2.5,
|
|
224
|
+
gap: 0.75,
|
|
225
|
+
field: "sm",
|
|
226
|
+
label: "sm",
|
|
227
|
+
help: "xs",
|
|
228
|
+
glyph: "md",
|
|
229
|
+
labelInside: "xs",
|
|
230
|
+
textAreaPadding: 1.5
|
|
231
|
+
},
|
|
232
|
+
sm: {
|
|
233
|
+
control: "sm",
|
|
234
|
+
padding: 3,
|
|
235
|
+
gap: 0.75,
|
|
236
|
+
field: "md",
|
|
237
|
+
label: "sm",
|
|
238
|
+
help: "xs",
|
|
239
|
+
glyph: "lg",
|
|
240
|
+
labelInside: "xs",
|
|
241
|
+
textAreaPadding: 2
|
|
242
|
+
},
|
|
243
|
+
md: {
|
|
244
|
+
control: "md",
|
|
245
|
+
padding: 3,
|
|
246
|
+
gap: 1.25,
|
|
247
|
+
field: "md",
|
|
248
|
+
label: "md",
|
|
249
|
+
help: "sm",
|
|
250
|
+
glyph: "lg",
|
|
251
|
+
labelInside: "xs",
|
|
252
|
+
textAreaPadding: 2
|
|
253
|
+
},
|
|
254
|
+
lg: {
|
|
255
|
+
control: "lg",
|
|
256
|
+
padding: 4,
|
|
257
|
+
gap: 1.75,
|
|
258
|
+
field: "lg",
|
|
259
|
+
label: "lg",
|
|
260
|
+
help: "md",
|
|
261
|
+
glyph: "xl",
|
|
262
|
+
labelInside: "sm",
|
|
263
|
+
textAreaPadding: 2.5
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
function insideLabel(step) {
|
|
267
|
+
const { control, padding, field, labelInside } = step;
|
|
268
|
+
return (theme) => {
|
|
269
|
+
const top = theme.spacing(LABEL_INSIDE_TOP);
|
|
270
|
+
const block = top + theme.lineHeights[labelInside];
|
|
271
|
+
return {
|
|
272
|
+
label: {
|
|
273
|
+
position: "absolute",
|
|
274
|
+
top,
|
|
275
|
+
// `start`, never `left` (R13): RTL mirrors the logical property and only it.
|
|
276
|
+
start: theme.spacing(padding),
|
|
277
|
+
paddingHorizontal: 0,
|
|
278
|
+
fontSize: theme.fontSizes[labelInside],
|
|
279
|
+
lineHeight: theme.lineHeights[labelInside]
|
|
280
|
+
},
|
|
281
|
+
// The height is built from the two lines it now holds rather than added to the
|
|
282
|
+
// control height: `controlHeights` already pays for centring one line, so adding
|
|
283
|
+
// the label's block to it would pay for that room twice. It is floored at the
|
|
284
|
+
// control height all the same, so a theme that raises `controlHeights` does not end
|
|
285
|
+
// up with an inside field shorter than the outside one beside it.
|
|
286
|
+
field: {
|
|
287
|
+
minHeight: Math.max(
|
|
288
|
+
block + theme.lineHeights[field] + top,
|
|
289
|
+
theme.controlHeights[control]
|
|
290
|
+
),
|
|
291
|
+
paddingTop: block,
|
|
292
|
+
paddingBottom: top
|
|
293
|
+
},
|
|
294
|
+
// The same room, because `TextField.TextArea` layers its own padding over the field's
|
|
295
|
+
// and would otherwise put the first line back under the label.
|
|
296
|
+
textArea: { paddingTop: block, paddingBottom: top }
|
|
297
|
+
};
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
var LABEL_INSIDE_TOP = 1.5;
|
|
301
|
+
var textFieldRecipe = _chunkFNEUOBCVcjs.createRecipe.call(void 0, {
|
|
302
|
+
slots: SLOTS,
|
|
303
|
+
base: (theme) => ({
|
|
304
|
+
root: { flexDirection: "column" },
|
|
305
|
+
label: {
|
|
306
|
+
fontFamily: theme.fontFamilies.body,
|
|
307
|
+
fontWeight: theme.fontWeights.medium
|
|
308
|
+
},
|
|
309
|
+
field: {
|
|
310
|
+
fontFamily: theme.fontFamilies.body,
|
|
311
|
+
// `regular`, not `medium`: what the user typed is content, not a control's label,
|
|
312
|
+
// and a heavier weight makes a filled field read as a button.
|
|
313
|
+
fontWeight: theme.fontWeights.regular,
|
|
314
|
+
borderWidth: theme.borderWidth.field,
|
|
315
|
+
// The theme has a radius named for this component, so every size uses it and the
|
|
316
|
+
// `radius` axis is what overrides it — the same shape a `Chip` takes from `full`.
|
|
317
|
+
// It is HeroUI's twelve points since the scale was aligned on theirs; it was 21,
|
|
318
|
+
// which put a 48-tall field at 87% of its geometric maximum.
|
|
319
|
+
borderRadius: theme.radius.field,
|
|
320
|
+
borderCurve: "continuous",
|
|
321
|
+
// RN centres a single line inside `minHeight` on iOS and pins it to the top on
|
|
322
|
+
// Android. Saying it removes a difference nobody chose.
|
|
323
|
+
textAlignVertical: "center"
|
|
324
|
+
},
|
|
325
|
+
// Several lines start at the top; only a single line is centred in its box.
|
|
326
|
+
textArea: { textAlignVertical: "top" },
|
|
327
|
+
// Not a node — the root flattens this one into `placeholderTextColor`, which is a
|
|
328
|
+
// `TextInput` prop rather than a style.
|
|
329
|
+
placeholder: { color: theme.colors.fieldPlaceholder },
|
|
330
|
+
description: {
|
|
331
|
+
fontFamily: theme.fontFamilies.body,
|
|
332
|
+
color: theme.colors.muted
|
|
333
|
+
},
|
|
334
|
+
error: {
|
|
335
|
+
fontFamily: theme.fontFamilies.body,
|
|
336
|
+
color: theme.colors.danger
|
|
337
|
+
},
|
|
338
|
+
prefix: { ...DECORATOR, start: 0 },
|
|
339
|
+
suffix: { ...DECORATOR, end: 0 },
|
|
340
|
+
// The glyph sits with the placeholder rather than with the value: a search mark or a
|
|
341
|
+
// lock is decoration for the text, not text. `paint` leaves it alone, so a tinted
|
|
342
|
+
// filled field is the one case where the caller names a colour on the icon itself.
|
|
343
|
+
icon: { color: theme.colors.fieldPlaceholder }
|
|
344
|
+
}),
|
|
345
|
+
variantTokens: VARIANT_TOKENS,
|
|
346
|
+
/**
|
|
347
|
+
* Where the variant's colours land. The border width follows the *presence* of the
|
|
348
|
+
* border role, so `ghost` needs no rule of its own to say it has no edge.
|
|
349
|
+
*
|
|
350
|
+
* The label is **not** painted from the variant: it sits outside the box, on the screen
|
|
351
|
+
* behind it, so it takes `foreground` and not the field's own text colour. That is also
|
|
352
|
+
* why a tinted input does not tint its label — the tint is the field's, not the form's.
|
|
353
|
+
*/
|
|
354
|
+
paint: (theme, colors) => ({
|
|
355
|
+
field: {
|
|
356
|
+
backgroundColor: colors.bg,
|
|
357
|
+
borderColor: colors.border,
|
|
358
|
+
borderWidth: colors.border ? theme.borderWidth.field : 0,
|
|
359
|
+
color: colors.fg
|
|
360
|
+
},
|
|
361
|
+
label: { color: theme.colors.foreground }
|
|
362
|
+
}),
|
|
363
|
+
/**
|
|
364
|
+
* Declaration order is application order, and it is load-bearing here: `isInvalid`
|
|
365
|
+
* comes after `size` so its border wins, and it must also outrank focus — which is why
|
|
366
|
+
* the root passes `focused` only when the field is *not* invalid, rather than relying
|
|
367
|
+
* on an order that states cannot express.
|
|
368
|
+
*/
|
|
369
|
+
variants: {
|
|
370
|
+
size: {
|
|
371
|
+
xs: sizeAxis(SIZES.xs),
|
|
372
|
+
sm: sizeAxis(SIZES.sm),
|
|
373
|
+
md: sizeAxis(SIZES.md),
|
|
374
|
+
lg: sizeAxis(SIZES.lg)
|
|
375
|
+
},
|
|
376
|
+
radius: _chunkFNEUOBCVcjs.radiusAxis.call(void 0, "field"),
|
|
377
|
+
/**
|
|
378
|
+
* `outside` is the base behaviour, so it adds nothing — it is declared because an
|
|
379
|
+
* axis needs both of its values for the selection to be typed, and because a reader
|
|
380
|
+
* looking for "what does outside do" should find the answer here rather than infer it
|
|
381
|
+
* from an absence. The size-dependent half of `inside` is in `compoundVariants`.
|
|
382
|
+
*/
|
|
383
|
+
labelPlacement: {
|
|
384
|
+
outside: () => ({}),
|
|
385
|
+
inside: () => ({})
|
|
386
|
+
},
|
|
387
|
+
isInvalid: {
|
|
388
|
+
true: (theme) => ({
|
|
389
|
+
field: { borderColor: theme.colors.danger },
|
|
390
|
+
// The label and the description turn with it: on a long form the field that is
|
|
391
|
+
// wrong has to be findable without reading every message.
|
|
392
|
+
label: { color: theme.colors.danger },
|
|
393
|
+
description: { color: theme.colors.danger }
|
|
394
|
+
})
|
|
395
|
+
}
|
|
396
|
+
},
|
|
397
|
+
/**
|
|
398
|
+
* The focus treatment is the border darkening towards the mode's ink — the theme's
|
|
399
|
+
* `fieldBorderFocus`, which is `fieldBorder` mixed 26% towards `fieldForeground`. No
|
|
400
|
+
* ring and no accent: a form where every focused field flashes the brand colour is a
|
|
401
|
+
* form where the accent has stopped meaning "the action".
|
|
402
|
+
*
|
|
403
|
+
* `borderFocus` is a role rather than a token named here, so a raw `color` follows the
|
|
404
|
+
* field into focus the same way it follows a `Button` into its pressed state.
|
|
405
|
+
*/
|
|
406
|
+
/**
|
|
407
|
+
* What `primary` adds to a filled field, and the four halves of the inside label that
|
|
408
|
+
* need to know the size — a compound is how the engine expresses a rule that depends on
|
|
409
|
+
* two axes at once.
|
|
410
|
+
*/
|
|
411
|
+
compoundVariants: [
|
|
412
|
+
{
|
|
413
|
+
when: { variant: "primary" },
|
|
414
|
+
style: (theme) => ({ field: theme.shadows.field })
|
|
415
|
+
},
|
|
416
|
+
{ when: { size: "xs", labelPlacement: "inside" }, style: insideLabel(SIZES.xs) },
|
|
417
|
+
{ when: { size: "sm", labelPlacement: "inside" }, style: insideLabel(SIZES.sm) },
|
|
418
|
+
{ when: { size: "md", labelPlacement: "inside" }, style: insideLabel(SIZES.md) },
|
|
419
|
+
{ when: { size: "lg", labelPlacement: "inside" }, style: insideLabel(SIZES.lg) }
|
|
420
|
+
],
|
|
421
|
+
states: {
|
|
422
|
+
focused: (_theme, colors) => ({ field: { borderColor: colors.borderFocus } }),
|
|
423
|
+
disabled: (theme) => ({ root: { opacity: theme.opacity.disabled } })
|
|
424
|
+
},
|
|
425
|
+
defaultVariants: { variant: "secondary", size: "md", labelPlacement: "outside" }
|
|
426
|
+
});
|
|
427
|
+
|
|
428
|
+
// src/components/text-field/text-field.tsx
|
|
429
|
+
|
|
430
|
+
var TextFieldRoot = _react.forwardRef.call(void 0, function TextField({
|
|
431
|
+
children,
|
|
432
|
+
variant,
|
|
433
|
+
size,
|
|
434
|
+
radius,
|
|
435
|
+
labelPlacement,
|
|
436
|
+
color,
|
|
437
|
+
isInvalid = false,
|
|
438
|
+
isDisabled = false,
|
|
439
|
+
asChild = false,
|
|
440
|
+
style,
|
|
441
|
+
...props
|
|
442
|
+
}, ref) {
|
|
443
|
+
const theme = _chunk57SJ4LJFcjs.useXAUITheme.call(void 0, );
|
|
444
|
+
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
445
|
+
const [isFocused, setIsFocused] = _react.useState.call(void 0, false);
|
|
446
|
+
const onFieldFocus = _react.useCallback.call(void 0, () => setIsFocused(true), []);
|
|
447
|
+
const onFieldBlur = _react.useCallback.call(void 0, () => setIsFocused(false), []);
|
|
448
|
+
const id = _react.useId.call(void 0, );
|
|
449
|
+
const labelId = `${id}-label`;
|
|
450
|
+
const descriptionId = `${id}-description`;
|
|
451
|
+
const selection = {
|
|
452
|
+
variant,
|
|
453
|
+
size,
|
|
454
|
+
radius,
|
|
455
|
+
labelPlacement,
|
|
456
|
+
isInvalid: isInvalid ? "true" : void 0
|
|
457
|
+
};
|
|
458
|
+
const states = { focused: isFocused && !isInvalid, disabled: isDisabled };
|
|
459
|
+
const styles = textFieldRecipe.resolve({ theme, selection, states });
|
|
460
|
+
const tint = color ? textFieldRecipe.tint({ theme, color, selection, states }) : void 0;
|
|
461
|
+
const context = _react.useMemo.call(void 0, () => {
|
|
462
|
+
const placeholder = _reactnative.StyleSheet.flatten(styles.placeholder);
|
|
463
|
+
const icon = _reactnative.StyleSheet.flatten(styles.icon);
|
|
464
|
+
const textArea = _reactnative.StyleSheet.flatten(styles.textArea);
|
|
465
|
+
return {
|
|
466
|
+
labelStyle: tint ? [styles.label, tint.label] : styles.label,
|
|
467
|
+
fieldStyle: tint ? [styles.field, tint.field] : styles.field,
|
|
468
|
+
textAreaStyle: styles.textArea,
|
|
469
|
+
textArea: {
|
|
470
|
+
lineHeight: _nullishCoalesce(textArea.lineHeight, () => ( 0)),
|
|
471
|
+
// `DimensionValue` also covers a percentage and `auto`, neither of which can be
|
|
472
|
+
// multiplied by a number of rows. The recipe only ever writes points here.
|
|
473
|
+
paddingVertical: typeof textArea.paddingBottom === "number" ? textArea.paddingBottom : 0
|
|
474
|
+
},
|
|
475
|
+
descriptionStyle: styles.description,
|
|
476
|
+
errorStyle: styles.error,
|
|
477
|
+
prefixStyle: styles.prefix,
|
|
478
|
+
suffixStyle: styles.suffix,
|
|
479
|
+
icon: {
|
|
480
|
+
size: icon.fontSize,
|
|
481
|
+
// `ColorValue` also covers the platform's opaque colours, which an icon component
|
|
482
|
+
// takes as a `string` and nothing else.
|
|
483
|
+
color: typeof icon.color === "string" ? icon.color : void 0
|
|
484
|
+
},
|
|
485
|
+
// `ColorValue` also covers the platform's opaque colours, which `TextInput` cannot
|
|
486
|
+
// take for a placeholder.
|
|
487
|
+
placeholderTextColor: typeof placeholder.color === "string" ? placeholder.color : void 0,
|
|
488
|
+
onFieldFocus,
|
|
489
|
+
onFieldBlur,
|
|
490
|
+
labelId,
|
|
491
|
+
descriptionId,
|
|
492
|
+
isDisabled,
|
|
493
|
+
isInvalid
|
|
494
|
+
};
|
|
495
|
+
}, [
|
|
496
|
+
styles,
|
|
497
|
+
tint,
|
|
498
|
+
onFieldFocus,
|
|
499
|
+
onFieldBlur,
|
|
500
|
+
labelId,
|
|
501
|
+
descriptionId,
|
|
502
|
+
isDisabled,
|
|
503
|
+
isInvalid
|
|
504
|
+
]);
|
|
505
|
+
const rootStyle = [styles.root, _optionalChain([tint, 'optionalAccess', _3 => _3.root]), styleProps, style];
|
|
506
|
+
const surface = asChild ? (
|
|
507
|
+
// R12 — the caller's element *is* the column.
|
|
508
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7GHM4GKLcjs.Slot, { ref, ...rest, style: rootStyle, children })
|
|
509
|
+
) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { ref, ...rest, style: rootStyle, children });
|
|
510
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TextFieldProvider, { value: context, children: surface });
|
|
511
|
+
});
|
|
512
|
+
TextFieldRoot.displayName = "XAUI.TextField.Root";
|
|
513
|
+
|
|
514
|
+
// src/components/text-field/index.ts
|
|
515
|
+
var TextField2 = Object.assign(TextFieldRoot, {
|
|
516
|
+
Label: TextFieldLabel,
|
|
517
|
+
Field: TextFieldField,
|
|
518
|
+
Description: TextFieldDescription,
|
|
519
|
+
Error: TextFieldError
|
|
520
|
+
});
|
|
521
|
+
|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
|
|
527
|
+
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
|
|
531
|
+
exports.useTextField = useTextField; exports.TextFieldDescription = TextFieldDescription; exports.TextFieldError = TextFieldError; exports.TextFieldField = TextFieldField; exports.TextFieldLabel = TextFieldLabel; exports.textFieldRecipe = textFieldRecipe; exports.TextFieldRoot = TextFieldRoot; exports.TextField = TextField2;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import {
|
|
2
|
+
mergeRefs
|
|
3
|
+
} from "./chunk-36PRYGAM.js";
|
|
4
|
+
|
|
5
|
+
// src/system/slot/children-to-string.ts
|
|
6
|
+
import { isValidElement } from "react";
|
|
7
|
+
function childrenToString(children) {
|
|
8
|
+
const text = stringify(children);
|
|
9
|
+
return text === null || text === "" ? null : text;
|
|
10
|
+
}
|
|
11
|
+
function stringify(node) {
|
|
12
|
+
if (node === null || node === void 0 || typeof node === "boolean") return "";
|
|
13
|
+
if (typeof node === "string") return node;
|
|
14
|
+
if (typeof node === "number") return String(node);
|
|
15
|
+
if (isValidElement(node)) return null;
|
|
16
|
+
if (Array.isArray(node)) {
|
|
17
|
+
let text = "";
|
|
18
|
+
for (const child of node) {
|
|
19
|
+
const part = stringify(child);
|
|
20
|
+
if (part === null) return null;
|
|
21
|
+
text += part;
|
|
22
|
+
}
|
|
23
|
+
return text;
|
|
24
|
+
}
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// src/system/slot/create-slot-context.ts
|
|
29
|
+
import { createContext, useContext } from "react";
|
|
30
|
+
function createSlotContext(name) {
|
|
31
|
+
const Context = createContext(null);
|
|
32
|
+
Context.displayName = `XAUI.${name}.Context`;
|
|
33
|
+
function useSlotContext() {
|
|
34
|
+
const value = useContext(Context);
|
|
35
|
+
if (value === null) {
|
|
36
|
+
const error = new Error(
|
|
37
|
+
`XAUI: use${name} must be called inside <${name}>. A slot reads the values its root resolved, so it can only be rendered as a child of one.`
|
|
38
|
+
);
|
|
39
|
+
Error.captureStackTrace?.(
|
|
40
|
+
error,
|
|
41
|
+
useSlotContext
|
|
42
|
+
);
|
|
43
|
+
throw error;
|
|
44
|
+
}
|
|
45
|
+
return value;
|
|
46
|
+
}
|
|
47
|
+
return [Context.Provider, useSlotContext];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// src/system/slot/merge-props.ts
|
|
51
|
+
var EVENT_HANDLER = /^on[A-Z]/;
|
|
52
|
+
function mergeProps(ours, theirs) {
|
|
53
|
+
const merged = { ...ours };
|
|
54
|
+
for (const key of Object.keys(theirs)) {
|
|
55
|
+
const ourValue = ours[key];
|
|
56
|
+
const theirValue = theirs[key];
|
|
57
|
+
if (EVENT_HANDLER.test(key)) {
|
|
58
|
+
merged[key] = composeHandlers(ourValue, theirValue);
|
|
59
|
+
} else if (key === "style") {
|
|
60
|
+
merged[key] = mergeStyles(ourValue, theirValue);
|
|
61
|
+
} else if (key === "ref") {
|
|
62
|
+
merged[key] = mergeRefs(
|
|
63
|
+
ourValue,
|
|
64
|
+
theirValue
|
|
65
|
+
);
|
|
66
|
+
} else {
|
|
67
|
+
merged[key] = theirValue;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return merged;
|
|
71
|
+
}
|
|
72
|
+
function composeHandlers(ours, theirs) {
|
|
73
|
+
if (typeof ours !== "function") return theirs;
|
|
74
|
+
if (typeof theirs !== "function") return ours;
|
|
75
|
+
return (...args) => {
|
|
76
|
+
;
|
|
77
|
+
ours(...args);
|
|
78
|
+
return theirs(...args);
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function mergeStyles(ours, theirs) {
|
|
82
|
+
if (typeof ours === "function" || typeof theirs === "function") {
|
|
83
|
+
return (state) => [
|
|
84
|
+
resolveStyle(ours, state),
|
|
85
|
+
resolveStyle(theirs, state)
|
|
86
|
+
];
|
|
87
|
+
}
|
|
88
|
+
return [ours, theirs];
|
|
89
|
+
}
|
|
90
|
+
function resolveStyle(style, state) {
|
|
91
|
+
return typeof style === "function" ? style(state) : style;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// src/system/slot/slot.tsx
|
|
95
|
+
import { cloneElement, forwardRef, isValidElement as isValidElement2 } from "react";
|
|
96
|
+
var Slot = forwardRef(function Slot2({ children, ...ours }, ref) {
|
|
97
|
+
if (!isValidElement2(children)) {
|
|
98
|
+
throw new Error(
|
|
99
|
+
"XAUI: asChild expects exactly one React element as its child, and merges the component's props into it. Text, a fragment, several children or none give it nothing to merge into \u2014 drop `asChild` to render the component itself."
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
const child = children;
|
|
103
|
+
const merged = mergeProps(ours, child.props);
|
|
104
|
+
merged.ref = mergeRefs(ref, refOf(child));
|
|
105
|
+
return cloneElement(child, merged);
|
|
106
|
+
});
|
|
107
|
+
Slot.displayName = "XAUI.Slot";
|
|
108
|
+
function refOf(element) {
|
|
109
|
+
const fromProps = element.props.ref;
|
|
110
|
+
const fromElement = element.ref;
|
|
111
|
+
return fromProps ?? fromElement;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export {
|
|
115
|
+
childrenToString,
|
|
116
|
+
createSlotContext,
|
|
117
|
+
mergeProps,
|
|
118
|
+
Slot
|
|
119
|
+
};
|