@xaui/native 0.9.1-alpha.24 → 0.9.1-alpha.26
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-3LKGVKQY.cjs +145 -0
- package/dist/chunk-5OXZIZRZ.cjs +72 -0
- package/dist/{chunk-LIQTGAI7.cjs → chunk-BULNTP5N.cjs} +6 -7
- package/dist/{chunk-J4QE34AU.js → chunk-I6UCYAO2.js} +20 -21
- package/dist/{chunk-P2XA4DV7.cjs → chunk-JCKVYYZO.cjs} +86 -14
- package/dist/{chunk-GBPWTFTU.cjs → chunk-OHEHPQLC.cjs} +10 -1
- package/dist/{chunk-MRYLLKML.js → chunk-PQHC65AG.js} +15 -15
- package/dist/chunk-TR2TGPDQ.js +72 -0
- package/dist/{chunk-GG2WWCBK.js → chunk-TZG3DERP.js} +10 -1
- package/dist/{chunk-6RO26ORT.js → chunk-V2FQN6ZK.js} +85 -13
- package/dist/chunk-WEMZ4VMC.js +145 -0
- package/dist/{chunk-EWBBDVTM.cjs → chunk-WVCAFORA.cjs} +15 -15
- package/dist/components/alert/index.cjs +1 -1
- package/dist/components/alert/index.js +1 -1
- package/dist/components/button/index.cjs +3 -3
- package/dist/components/button/index.js +2 -2
- package/dist/components/chip/index.cjs +3 -3
- package/dist/components/chip/index.js +2 -2
- package/dist/components/input/index.cjs +12 -2
- package/dist/components/input/index.d.cts +109 -117
- package/dist/components/input/index.d.ts +109 -117
- package/dist/components/input/index.js +11 -1
- package/dist/components/input-group/index.cjs +26 -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 +26 -0
- package/dist/components/input-otp/index.cjs +2 -2
- package/dist/components/input-otp/index.js +1 -1
- package/dist/components/text-area/index.cjs +13 -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 +13 -0
- package/dist/index.cjs +44 -10
- package/dist/index.d.cts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +49 -15
- package/dist/input.type-BUMDlzL9.d.cts +167 -0
- package/dist/input.type-D2qgi03E.d.ts +167 -0
- package/dist/system/index.cjs +2 -2
- package/dist/system/index.js +5 -5
- package/dist/theme/index.cjs +2 -2
- package/dist/theme/index.js +1 -1
- package/package.json +21 -1
- package/dist/{chunk-4J26FA6O.js → chunk-3WISQT22.js} +3 -3
- package/dist/{chunk-AV5LMFS3.cjs → chunk-I7G77Q65.cjs} +2 -2
|
@@ -0,0 +1,145 @@
|
|
|
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
|
+
var _chunkB4W2XNBPcjs = require('./chunk-B4W2XNBP.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunkJCKVYYZOcjs = require('./chunk-JCKVYYZO.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
var _chunkHUZ4AUM2cjs = require('./chunk-HUZ4AUM2.cjs');
|
|
13
|
+
|
|
14
|
+
// src/components/input-group/input-group-field.tsx
|
|
15
|
+
var _react = require('react');
|
|
16
|
+
|
|
17
|
+
// src/components/input-group/input-group.context.ts
|
|
18
|
+
var [InputGroupProvider, useInputGroup] = _chunkHUZ4AUM2cjs.createSlotContext.call(void 0, "InputGroup");
|
|
19
|
+
|
|
20
|
+
// src/components/input-group/input-group.utils.ts
|
|
21
|
+
function decoratorPadding(prefixWidth, suffixWidth) {
|
|
22
|
+
const paddingStart = prefixWidth > 0 ? prefixWidth : void 0;
|
|
23
|
+
const paddingEnd = suffixWidth > 0 ? suffixWidth : void 0;
|
|
24
|
+
if (paddingStart === void 0 && paddingEnd === void 0) return void 0;
|
|
25
|
+
return { paddingStart, paddingEnd };
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// src/components/input-group/input-group-field.tsx
|
|
29
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
30
|
+
var InputGroupField = _react.forwardRef.call(void 0,
|
|
31
|
+
function InputGroupField2({ style, ...props }, ref) {
|
|
32
|
+
const { prefixWidth, suffixWidth } = useInputGroup();
|
|
33
|
+
const padding = _react.useMemo.call(void 0,
|
|
34
|
+
() => decoratorPadding(prefixWidth, suffixWidth),
|
|
35
|
+
[prefixWidth, suffixWidth]
|
|
36
|
+
);
|
|
37
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJCKVYYZOcjs.InputField, { ref, ...props, style: [padding, style] });
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
InputGroupField.displayName = "XAUI.InputGroup.Field";
|
|
41
|
+
|
|
42
|
+
// src/components/input-group/input-group-icon.tsx
|
|
43
|
+
|
|
44
|
+
function InputGroupIcon({ size, color, ...rest }) {
|
|
45
|
+
const { icon } = _chunkJCKVYYZOcjs.useInput.call(void 0, );
|
|
46
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkB4W2XNBPcjs.Icon, { size: _nullishCoalesce(size, () => ( icon.size)), color: _nullishCoalesce(color, () => ( icon.color)), ...rest });
|
|
47
|
+
}
|
|
48
|
+
InputGroupIcon.displayName = "XAUI.InputGroup.Icon";
|
|
49
|
+
|
|
50
|
+
// src/components/input-group/input-group-prefix.tsx
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
// src/components/input-group/input-group-decorator.tsx
|
|
54
|
+
|
|
55
|
+
var _reactnative = require('react-native');
|
|
56
|
+
|
|
57
|
+
var InputGroupDecorator = _react.forwardRef.call(void 0,
|
|
58
|
+
function InputGroupDecorator2({ side, children, isDecorative = false, onLayout, style, ...props }, ref) {
|
|
59
|
+
const { prefixStyle, suffixStyle, isDisabled } = _chunkJCKVYYZOcjs.useInput.call(void 0, );
|
|
60
|
+
const { setPrefixWidth, setSuffixWidth } = useInputGroup();
|
|
61
|
+
const [styleProps, rest] = _chunkHUZ4AUM2cjs.useStyleProps.call(void 0, props);
|
|
62
|
+
const report = side === "prefix" ? setPrefixWidth : setSuffixWidth;
|
|
63
|
+
const handleLayout = _react.useCallback.call(void 0,
|
|
64
|
+
(event) => {
|
|
65
|
+
report(event.nativeEvent.layout.width);
|
|
66
|
+
_optionalChain([onLayout, 'optionalCall', _ => _(event)]);
|
|
67
|
+
},
|
|
68
|
+
[report, onLayout]
|
|
69
|
+
);
|
|
70
|
+
const isInert = isDecorative || isDisabled;
|
|
71
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
72
|
+
_reactnative.View,
|
|
73
|
+
{
|
|
74
|
+
ref,
|
|
75
|
+
accessibilityElementsHidden: isDecorative || void 0,
|
|
76
|
+
importantForAccessibility: isDecorative ? "no-hide-descendants" : void 0,
|
|
77
|
+
pointerEvents: isInert ? "none" : void 0,
|
|
78
|
+
...rest,
|
|
79
|
+
style: [side === "prefix" ? prefixStyle : suffixStyle, styleProps, style],
|
|
80
|
+
onLayout: handleLayout,
|
|
81
|
+
children
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
InputGroupDecorator.displayName = "XAUI.InputGroup.Decorator";
|
|
87
|
+
|
|
88
|
+
// src/components/input-group/input-group-prefix.tsx
|
|
89
|
+
|
|
90
|
+
var InputGroupPrefix = _react.forwardRef.call(void 0,
|
|
91
|
+
function InputGroupPrefix2(props, ref) {
|
|
92
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InputGroupDecorator, { ref, side: "prefix", ...props });
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
InputGroupPrefix.displayName = "XAUI.InputGroup.Prefix";
|
|
96
|
+
|
|
97
|
+
// src/components/input-group/input-group-suffix.tsx
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
var InputGroupSuffix = _react.forwardRef.call(void 0,
|
|
101
|
+
function InputGroupSuffix2(props, ref) {
|
|
102
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InputGroupDecorator, { ref, side: "suffix", ...props });
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
InputGroupSuffix.displayName = "XAUI.InputGroup.Suffix";
|
|
106
|
+
|
|
107
|
+
// src/components/input-group/input-group.tsx
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
var InputGroupRoot = _react.forwardRef.call(void 0, function InputGroup({ children, asChild = false, style, ...props }, ref) {
|
|
112
|
+
const [styleProps, rest] = _chunkHUZ4AUM2cjs.useStyleProps.call(void 0, props);
|
|
113
|
+
const [prefixWidth, setPrefixWidth] = _react.useState.call(void 0, 0);
|
|
114
|
+
const [suffixWidth, setSuffixWidth] = _react.useState.call(void 0, 0);
|
|
115
|
+
const context = _react.useMemo.call(void 0,
|
|
116
|
+
() => ({ prefixWidth, suffixWidth, setPrefixWidth, setSuffixWidth }),
|
|
117
|
+
[prefixWidth, suffixWidth]
|
|
118
|
+
);
|
|
119
|
+
const rootStyle = [styleProps, style];
|
|
120
|
+
const surface = asChild ? (
|
|
121
|
+
// R12 — the caller's element *is* the row.
|
|
122
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHUZ4AUM2cjs.Slot, { ref, ...rest, style: rootStyle, children })
|
|
123
|
+
) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { ref, ...rest, style: rootStyle, children });
|
|
124
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InputGroupProvider, { value: context, children: surface });
|
|
125
|
+
});
|
|
126
|
+
InputGroupRoot.displayName = "XAUI.InputGroup.Root";
|
|
127
|
+
|
|
128
|
+
// src/components/input-group/index.ts
|
|
129
|
+
var InputGroup2 = Object.assign(InputGroupRoot, {
|
|
130
|
+
Prefix: InputGroupPrefix,
|
|
131
|
+
Field: InputGroupField,
|
|
132
|
+
Suffix: InputGroupSuffix,
|
|
133
|
+
Icon: InputGroupIcon
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
exports.useInputGroup = useInputGroup; exports.decoratorPadding = decoratorPadding; exports.InputGroupField = InputGroupField; exports.InputGroupIcon = InputGroupIcon; exports.InputGroupPrefix = InputGroupPrefix; exports.InputGroupSuffix = InputGroupSuffix; exports.InputGroupRoot = InputGroupRoot; exports.InputGroup = InputGroup2;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
var _chunkJCKVYYZOcjs = require('./chunk-JCKVYYZO.cjs');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
var _chunkHUZ4AUM2cjs = require('./chunk-HUZ4AUM2.cjs');
|
|
13
|
+
|
|
14
|
+
// src/components/text-area/text-area-field.tsx
|
|
15
|
+
var _react = require('react');
|
|
16
|
+
|
|
17
|
+
// src/components/text-area/text-area.context.ts
|
|
18
|
+
var [TextAreaProvider, useTextArea] = _chunkHUZ4AUM2cjs.createSlotContext.call(void 0, "TextArea");
|
|
19
|
+
|
|
20
|
+
// src/components/text-area/text-area-field.tsx
|
|
21
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
22
|
+
var TextAreaField = _react.forwardRef.call(void 0,
|
|
23
|
+
function TextAreaField2({ style, scrollEnabled, ...props }, ref) {
|
|
24
|
+
const { textAreaStyle, textArea } = _chunkJCKVYYZOcjs.useInput.call(void 0, );
|
|
25
|
+
const { rows, maxRows } = useTextArea();
|
|
26
|
+
const [styleProps, rest] = _chunkHUZ4AUM2cjs.useStyleProps.call(void 0, props);
|
|
27
|
+
const height = _react.useMemo.call(void 0, () => {
|
|
28
|
+
const chrome = textArea.paddingVertical * 2;
|
|
29
|
+
return {
|
|
30
|
+
minHeight: rows * textArea.lineHeight + chrome,
|
|
31
|
+
// Unset, the field grows for as long as the text does. With a ceiling it stops
|
|
32
|
+
// there and scrolls, which is the only case that needs `scrollEnabled` — a
|
|
33
|
+
// multiline field that can grow has nothing to scroll.
|
|
34
|
+
maxHeight: maxRows ? maxRows * textArea.lineHeight + chrome : void 0
|
|
35
|
+
};
|
|
36
|
+
}, [rows, maxRows, textArea]);
|
|
37
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
38
|
+
_chunkJCKVYYZOcjs.InputField,
|
|
39
|
+
{
|
|
40
|
+
ref,
|
|
41
|
+
multiline: true,
|
|
42
|
+
scrollEnabled: _nullishCoalesce(scrollEnabled, () => ( maxRows !== void 0)),
|
|
43
|
+
...rest,
|
|
44
|
+
style: [textAreaStyle, height, styleProps, style]
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
TextAreaField.displayName = "XAUI.TextArea.Field";
|
|
50
|
+
|
|
51
|
+
// src/components/text-area/text-area.tsx
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
var DEFAULT_ROWS = 3;
|
|
55
|
+
var TextAreaRoot = _react.forwardRef.call(void 0, function TextArea({ rows = DEFAULT_ROWS, maxRows, children, ...props }, ref) {
|
|
56
|
+
const context = _react.useMemo.call(void 0, () => ({ rows, maxRows }), [rows, maxRows]);
|
|
57
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TextAreaProvider, { value: context, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJCKVYYZOcjs.InputRoot, { ref, ...props, children }) });
|
|
58
|
+
});
|
|
59
|
+
TextAreaRoot.displayName = "XAUI.TextArea.Root";
|
|
60
|
+
|
|
61
|
+
// src/components/text-area/index.ts
|
|
62
|
+
var TextArea2 = Object.assign(TextAreaRoot, {
|
|
63
|
+
Label: _chunkJCKVYYZOcjs.InputLabel,
|
|
64
|
+
Field: TextAreaField,
|
|
65
|
+
Description: _chunkJCKVYYZOcjs.InputDescription,
|
|
66
|
+
Error: _chunkJCKVYYZOcjs.InputError
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
exports.useTextArea = useTextArea; exports.TextArea = TextArea2;
|
|
@@ -372,13 +372,12 @@ var inputOTPRecipe = _chunkYXVKQMCKcjs.createRecipe.call(void 0, {
|
|
|
372
372
|
box: {
|
|
373
373
|
alignItems: "center",
|
|
374
374
|
justifyContent: "center",
|
|
375
|
-
// `lg` and not `field`,
|
|
376
|
-
//
|
|
377
|
-
//
|
|
378
|
-
//
|
|
379
|
-
//
|
|
380
|
-
//
|
|
381
|
-
// ours is 12.
|
|
375
|
+
// `lg` and not `field`, though the two are the same twelve points at the default
|
|
376
|
+
// base. The keys are kept apart on purpose: `field` is the corner a theme moves when
|
|
377
|
+
// it wants rounder *fields*, and a field is wide — a code box is very nearly square,
|
|
378
|
+
// 44 by 48 at `md`, where the geometric maximum is 22 and anything near it is a pill
|
|
379
|
+
// in all but name. Following `field` here would hand this component a shape that was
|
|
380
|
+
// never decided for it.
|
|
382
381
|
borderRadius: theme.radius.lg,
|
|
383
382
|
borderCurve: "continuous",
|
|
384
383
|
// The one root in the library that clips: the box has no shadow to lose and a
|
|
@@ -39,10 +39,10 @@ function InputOTPCaret({
|
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
InputOTPCaret.displayName = "XAUI.InputOTP.Caret";
|
|
42
|
-
const
|
|
43
|
-
code: "function
|
|
44
|
-
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-
|
|
45
|
-
sourceMap: "{\"version\":3,\"names\":[\"
|
|
42
|
+
const _worklet_4103709998384_init_data = {
|
|
43
|
+
code: "function chunkI6UCYAO2Js1(){const{opacity}=this.__closure;return{opacity:opacity.value};}",
|
|
44
|
+
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-I6UCYAO2.js",
|
|
45
|
+
sourceMap: "{\"version\":3,\"names\":[\"chunkI6UCYAO2Js1\",\"opacity\",\"__closure\",\"value\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-I6UCYAO2.js\"],\"mappings\":\"AA4DyC,SAAAA,iBAAA,QAAAC,OAAA,OAAAC,SAAA,OAAO,CAAED,OAAO,CAAEA,OAAO,CAACE,KAAM,CAAC\",\"ignoreList\":[]}"
|
|
46
46
|
};
|
|
47
47
|
function BlinkingCaret({
|
|
48
48
|
style
|
|
@@ -55,24 +55,24 @@ function BlinkingCaret({
|
|
|
55
55
|
}), -1, true);
|
|
56
56
|
return () => cancelAnimation(opacity);
|
|
57
57
|
}, [opacity]);
|
|
58
|
-
const animatedStyle = useAnimatedStyle(function
|
|
59
|
-
|
|
58
|
+
const animatedStyle = useAnimatedStyle(function chunkI6UCYAO2Js1Factory({
|
|
59
|
+
_worklet_4103709998384_init_data,
|
|
60
60
|
opacity
|
|
61
61
|
}) {
|
|
62
62
|
const _e = [new global.Error(), -2, -27];
|
|
63
|
-
const
|
|
63
|
+
const chunkI6UCYAO2Js1 = () => ({
|
|
64
64
|
opacity: opacity.value
|
|
65
65
|
});
|
|
66
|
-
|
|
66
|
+
chunkI6UCYAO2Js1.__closure = {
|
|
67
67
|
opacity
|
|
68
68
|
};
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
return
|
|
69
|
+
chunkI6UCYAO2Js1.__workletHash = 4103709998384;
|
|
70
|
+
chunkI6UCYAO2Js1.__pluginVersion = "0.7.4";
|
|
71
|
+
chunkI6UCYAO2Js1.__initData = _worklet_4103709998384_init_data;
|
|
72
|
+
chunkI6UCYAO2Js1.__stackDetails = _e;
|
|
73
|
+
return chunkI6UCYAO2Js1;
|
|
74
74
|
}({
|
|
75
|
-
|
|
75
|
+
_worklet_4103709998384_init_data,
|
|
76
76
|
opacity
|
|
77
77
|
}));
|
|
78
78
|
return /* @__PURE__ */jsx(Animated.View, {
|
|
@@ -474,13 +474,12 @@ var inputOTPRecipe = createRecipe({
|
|
|
474
474
|
box: {
|
|
475
475
|
alignItems: "center",
|
|
476
476
|
justifyContent: "center",
|
|
477
|
-
// `lg` and not `field`,
|
|
478
|
-
//
|
|
479
|
-
//
|
|
480
|
-
//
|
|
481
|
-
//
|
|
482
|
-
//
|
|
483
|
-
// ours is 12.
|
|
477
|
+
// `lg` and not `field`, though the two are the same twelve points at the default
|
|
478
|
+
// base. The keys are kept apart on purpose: `field` is the corner a theme moves when
|
|
479
|
+
// it wants rounder *fields*, and a field is wide — a code box is very nearly square,
|
|
480
|
+
// 44 by 48 at `md`, where the geometric maximum is 22 and anything near it is a pill
|
|
481
|
+
// in all but name. Following `field` here would hand this component a shape that was
|
|
482
|
+
// never decided for it.
|
|
484
483
|
borderRadius: theme.radius.lg,
|
|
485
484
|
borderCurve: "continuous",
|
|
486
485
|
// The one root in the library that clips: the box has no shadow to lose and a
|
|
@@ -127,9 +127,13 @@ var SLOTS = [
|
|
|
127
127
|
"root",
|
|
128
128
|
"label",
|
|
129
129
|
"field",
|
|
130
|
+
"textArea",
|
|
130
131
|
"placeholder",
|
|
131
132
|
"description",
|
|
132
|
-
"error"
|
|
133
|
+
"error",
|
|
134
|
+
"prefix",
|
|
135
|
+
"suffix",
|
|
136
|
+
"icon"
|
|
133
137
|
];
|
|
134
138
|
var VARIANT_TOKENS = {
|
|
135
139
|
primary: {
|
|
@@ -155,13 +159,17 @@ var VARIANT_TOKENS = {
|
|
|
155
159
|
ghost: { borderFocus: "fieldBorderFocus", fg: "fieldForeground" }
|
|
156
160
|
};
|
|
157
161
|
function sizeAxis(step) {
|
|
158
|
-
const { control, padding, gap, field, label, help } = step;
|
|
162
|
+
const { control, padding, gap, field, label, help, glyph, textAreaPadding } = step;
|
|
159
163
|
return (theme) => {
|
|
160
164
|
const inset = { paddingHorizontal: theme.spacing(LABEL_INSET) };
|
|
161
165
|
const helpType = {
|
|
162
166
|
fontSize: theme.fontSizes[help],
|
|
163
167
|
lineHeight: theme.lineHeights[help]
|
|
164
168
|
};
|
|
169
|
+
const decorator = {
|
|
170
|
+
paddingHorizontal: theme.spacing(padding),
|
|
171
|
+
gap: theme.spacing(padding)
|
|
172
|
+
};
|
|
165
173
|
return {
|
|
166
174
|
root: { gap: theme.spacing(gap) },
|
|
167
175
|
label: {
|
|
@@ -174,48 +182,77 @@ function sizeAxis(step) {
|
|
|
174
182
|
paddingHorizontal: theme.spacing(padding),
|
|
175
183
|
fontSize: theme.fontSizes[field]
|
|
176
184
|
},
|
|
185
|
+
// Only what a multiline field *adds* — `Input.TextArea` layers this over the field's
|
|
186
|
+
// own style rather than restating it, so the colours, the border and the radius are
|
|
187
|
+
// resolved once for both. The height is not here: `rows` is a raw value, and the
|
|
188
|
+
// slot computes it from the two numbers below.
|
|
189
|
+
textArea: {
|
|
190
|
+
lineHeight: theme.lineHeights[field],
|
|
191
|
+
paddingTop: theme.spacing(textAreaPadding),
|
|
192
|
+
paddingBottom: theme.spacing(textAreaPadding)
|
|
193
|
+
},
|
|
177
194
|
description: { ...inset, ...helpType },
|
|
178
|
-
error: { ...inset, ...helpType }
|
|
195
|
+
error: { ...inset, ...helpType },
|
|
196
|
+
prefix: decorator,
|
|
197
|
+
suffix: decorator,
|
|
198
|
+
icon: { fontSize: theme.fontSizes[glyph] }
|
|
179
199
|
};
|
|
180
200
|
};
|
|
181
201
|
}
|
|
182
202
|
var LABEL_INSET = 1.5;
|
|
203
|
+
var DECORATOR = {
|
|
204
|
+
position: "absolute",
|
|
205
|
+
top: 0,
|
|
206
|
+
bottom: 0,
|
|
207
|
+
flexDirection: "row",
|
|
208
|
+
alignItems: "center",
|
|
209
|
+
justifyContent: "center",
|
|
210
|
+
zIndex: 10
|
|
211
|
+
};
|
|
183
212
|
var SIZES = {
|
|
184
213
|
xs: {
|
|
185
214
|
control: "xs",
|
|
186
215
|
padding: 2.5,
|
|
187
|
-
gap:
|
|
216
|
+
gap: 0.75,
|
|
188
217
|
field: "sm",
|
|
189
218
|
label: "sm",
|
|
190
219
|
help: "xs",
|
|
191
|
-
|
|
220
|
+
glyph: "md",
|
|
221
|
+
labelInside: "xs",
|
|
222
|
+
textAreaPadding: 1.5
|
|
192
223
|
},
|
|
193
224
|
sm: {
|
|
194
225
|
control: "sm",
|
|
195
226
|
padding: 3,
|
|
196
|
-
gap:
|
|
227
|
+
gap: 0.75,
|
|
197
228
|
field: "md",
|
|
198
229
|
label: "sm",
|
|
199
230
|
help: "xs",
|
|
200
|
-
|
|
231
|
+
glyph: "lg",
|
|
232
|
+
labelInside: "xs",
|
|
233
|
+
textAreaPadding: 2
|
|
201
234
|
},
|
|
202
235
|
md: {
|
|
203
236
|
control: "md",
|
|
204
237
|
padding: 3,
|
|
205
|
-
gap: 1.
|
|
238
|
+
gap: 1.25,
|
|
206
239
|
field: "md",
|
|
207
240
|
label: "md",
|
|
208
241
|
help: "sm",
|
|
209
|
-
|
|
242
|
+
glyph: "lg",
|
|
243
|
+
labelInside: "xs",
|
|
244
|
+
textAreaPadding: 2
|
|
210
245
|
},
|
|
211
246
|
lg: {
|
|
212
247
|
control: "lg",
|
|
213
248
|
padding: 4,
|
|
214
|
-
gap:
|
|
249
|
+
gap: 1.75,
|
|
215
250
|
field: "lg",
|
|
216
251
|
label: "lg",
|
|
217
252
|
help: "md",
|
|
218
|
-
|
|
253
|
+
glyph: "xl",
|
|
254
|
+
labelInside: "sm",
|
|
255
|
+
textAreaPadding: 2.5
|
|
219
256
|
}
|
|
220
257
|
};
|
|
221
258
|
function insideLabel(step) {
|
|
@@ -245,7 +282,10 @@ function insideLabel(step) {
|
|
|
245
282
|
),
|
|
246
283
|
paddingTop: block,
|
|
247
284
|
paddingBottom: top
|
|
248
|
-
}
|
|
285
|
+
},
|
|
286
|
+
// The same room, because `Input.TextArea` layers its own padding over the field's
|
|
287
|
+
// and would otherwise put the first line back under the label.
|
|
288
|
+
textArea: { paddingTop: block, paddingBottom: top }
|
|
249
289
|
};
|
|
250
290
|
};
|
|
251
291
|
}
|
|
@@ -266,12 +306,16 @@ var inputRecipe = _chunkYXVKQMCKcjs.createRecipe.call(void 0, {
|
|
|
266
306
|
borderWidth: theme.borderWidth.field,
|
|
267
307
|
// The theme has a radius named for this component, so every size uses it and the
|
|
268
308
|
// `radius` axis is what overrides it — the same shape a `Chip` takes from `full`.
|
|
309
|
+
// It is HeroUI's twelve points since the scale was aligned on theirs; it was 21,
|
|
310
|
+
// which put a 48-tall field at 87% of its geometric maximum.
|
|
269
311
|
borderRadius: theme.radius.field,
|
|
270
312
|
borderCurve: "continuous",
|
|
271
313
|
// RN centres a single line inside `minHeight` on iOS and pins it to the top on
|
|
272
314
|
// Android. Saying it removes a difference nobody chose.
|
|
273
315
|
textAlignVertical: "center"
|
|
274
316
|
},
|
|
317
|
+
// Several lines start at the top; only a single line is centred in its box.
|
|
318
|
+
textArea: { textAlignVertical: "top" },
|
|
275
319
|
// Not a node — the root flattens this one into `placeholderTextColor`, which is a
|
|
276
320
|
// `TextInput` prop rather than a style.
|
|
277
321
|
placeholder: { color: theme.colors.fieldPlaceholder },
|
|
@@ -282,7 +326,13 @@ var inputRecipe = _chunkYXVKQMCKcjs.createRecipe.call(void 0, {
|
|
|
282
326
|
error: {
|
|
283
327
|
fontFamily: theme.fontFamilies.body,
|
|
284
328
|
color: theme.colors.danger
|
|
285
|
-
}
|
|
329
|
+
},
|
|
330
|
+
prefix: { ...DECORATOR, start: 0 },
|
|
331
|
+
suffix: { ...DECORATOR, end: 0 },
|
|
332
|
+
// The glyph sits with the placeholder rather than with the value: a search mark or a
|
|
333
|
+
// lock is decoration for the text, not text. `paint` leaves it alone, so a tinted
|
|
334
|
+
// filled field is the one case where the caller names a colour on the icon itself.
|
|
335
|
+
icon: { color: theme.colors.fieldPlaceholder }
|
|
286
336
|
}),
|
|
287
337
|
variantTokens: VARIANT_TOKENS,
|
|
288
338
|
/**
|
|
@@ -402,11 +452,28 @@ var InputRoot = _react.forwardRef.call(void 0, function Input({
|
|
|
402
452
|
const tint = color ? inputRecipe.tint({ theme, color, selection, states }) : void 0;
|
|
403
453
|
const context = _react.useMemo.call(void 0, () => {
|
|
404
454
|
const placeholder = _reactnative.StyleSheet.flatten(styles.placeholder);
|
|
455
|
+
const icon = _reactnative.StyleSheet.flatten(styles.icon);
|
|
456
|
+
const textArea = _reactnative.StyleSheet.flatten(styles.textArea);
|
|
405
457
|
return {
|
|
406
458
|
labelStyle: tint ? [styles.label, tint.label] : styles.label,
|
|
407
459
|
fieldStyle: tint ? [styles.field, tint.field] : styles.field,
|
|
460
|
+
textAreaStyle: styles.textArea,
|
|
461
|
+
textArea: {
|
|
462
|
+
lineHeight: _nullishCoalesce(textArea.lineHeight, () => ( 0)),
|
|
463
|
+
// `DimensionValue` also covers a percentage and `auto`, neither of which can be
|
|
464
|
+
// multiplied by a number of rows. The recipe only ever writes points here.
|
|
465
|
+
paddingVertical: typeof textArea.paddingBottom === "number" ? textArea.paddingBottom : 0
|
|
466
|
+
},
|
|
408
467
|
descriptionStyle: styles.description,
|
|
409
468
|
errorStyle: styles.error,
|
|
469
|
+
prefixStyle: styles.prefix,
|
|
470
|
+
suffixStyle: styles.suffix,
|
|
471
|
+
icon: {
|
|
472
|
+
size: icon.fontSize,
|
|
473
|
+
// `ColorValue` also covers the platform's opaque colours, which an icon component
|
|
474
|
+
// takes as a `string` and nothing else.
|
|
475
|
+
color: typeof icon.color === "string" ? icon.color : void 0
|
|
476
|
+
},
|
|
410
477
|
// `ColorValue` also covers the platform's opaque colours, which `TextInput` cannot
|
|
411
478
|
// take for a placeholder.
|
|
412
479
|
placeholderTextColor: typeof placeholder.color === "string" ? placeholder.color : void 0,
|
|
@@ -448,4 +515,9 @@ var Input2 = Object.assign(InputRoot, {
|
|
|
448
515
|
|
|
449
516
|
|
|
450
517
|
|
|
451
|
-
|
|
518
|
+
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
|
|
523
|
+
exports.useInput = useInput; exports.InputDescription = InputDescription; exports.InputError = InputError; exports.InputField = InputField; exports.InputLabel = InputLabel; exports.inputRecipe = inputRecipe; exports.InputRoot = InputRoot; exports.Input = Input2;
|
|
@@ -62,7 +62,16 @@ function buildRadius(base) {
|
|
|
62
62
|
"2xl": base * 2,
|
|
63
63
|
"3xl": base * 3,
|
|
64
64
|
"4xl": base * 4,
|
|
65
|
-
|
|
65
|
+
/**
|
|
66
|
+
* HeroUI's value, reached from the other side of the scale: their `--radius-field` is
|
|
67
|
+
* an alias of their `--radius-xl`, and their base is 8 where ours is 12 — so their
|
|
68
|
+
* field corner is 12 points and, at our default base, so is this.
|
|
69
|
+
*
|
|
70
|
+
* It coincides with `lg` today and is still its own key, because that is what lets a
|
|
71
|
+
* theme round its fields without rounding its cards. It was `base * 1.75`, which put a
|
|
72
|
+
* 48-tall field at 87% of its geometric maximum — a gélule rather than a rounded box.
|
|
73
|
+
*/
|
|
74
|
+
field: base,
|
|
66
75
|
full: 9999
|
|
67
76
|
};
|
|
68
77
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Icon } from "./chunk-ICR42HHG.js";
|
|
2
1
|
import { PressableFeedback, usePressState } from "./chunk-4HELPMAK.js";
|
|
2
|
+
import { Icon } from "./chunk-ICR42HHG.js";
|
|
3
3
|
import { warnDev } from "./chunk-EGLLDKN6.js";
|
|
4
4
|
import { createRecipe, radiusAxis } from "./chunk-3JATAB7S.js";
|
|
5
5
|
import { childrenToString, createSlotContext, useStyleProps } from "./chunk-PMO62QK4.js";
|
|
@@ -74,10 +74,10 @@ function ButtonSpinner({
|
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
76
|
ButtonSpinner.displayName = "XAUI.Button.Spinner";
|
|
77
|
-
const
|
|
78
|
-
code: "function
|
|
79
|
-
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-
|
|
80
|
-
sourceMap: "{\"version\":3,\"names\":[\"
|
|
77
|
+
const _worklet_146491499400_init_data = {
|
|
78
|
+
code: "function chunkPQHC65AGJs1(){const{angle}=this.__closure;return{transform:[{rotate:angle.value+\"deg\"}]};}",
|
|
79
|
+
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-PQHC65AG.js",
|
|
80
|
+
sourceMap: "{\"version\":3,\"names\":[\"chunkPQHC65AGJs1\",\"angle\",\"__closure\",\"transform\",\"rotate\",\"value\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-PQHC65AG.js\"],\"mappings\":\"AAqFyC,SAAAA,gBAAMA,CAAA,QAAAC,KAAA,OAAAC,SAAA,CAE3C,MAAO,CAAEC,SAAS,CAAE,CAAC,CAAEC,MAAM,CAAKH,KAAK,CAACI,KAAK,MAAM,CAAC,CAAE,CAAC,CACzD\",\"ignoreList\":[]}"
|
|
81
81
|
};
|
|
82
82
|
function SpinningRing({
|
|
83
83
|
style
|
|
@@ -90,28 +90,28 @@ function SpinningRing({
|
|
|
90
90
|
}), -1, false);
|
|
91
91
|
return () => cancelAnimation(angle);
|
|
92
92
|
}, [angle]);
|
|
93
|
-
const animatedStyle = useAnimatedStyle(function
|
|
94
|
-
|
|
93
|
+
const animatedStyle = useAnimatedStyle(function chunkPQHC65AGJs1Factory({
|
|
94
|
+
_worklet_146491499400_init_data,
|
|
95
95
|
angle
|
|
96
96
|
}) {
|
|
97
97
|
const _e = [new global.Error(), -2, -27];
|
|
98
|
-
const
|
|
98
|
+
const chunkPQHC65AGJs1 = function () {
|
|
99
99
|
return {
|
|
100
100
|
transform: [{
|
|
101
101
|
rotate: `${angle.value}deg`
|
|
102
102
|
}]
|
|
103
103
|
};
|
|
104
104
|
};
|
|
105
|
-
|
|
105
|
+
chunkPQHC65AGJs1.__closure = {
|
|
106
106
|
angle
|
|
107
107
|
};
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
return
|
|
108
|
+
chunkPQHC65AGJs1.__workletHash = 146491499400;
|
|
109
|
+
chunkPQHC65AGJs1.__pluginVersion = "0.7.4";
|
|
110
|
+
chunkPQHC65AGJs1.__initData = _worklet_146491499400_init_data;
|
|
111
|
+
chunkPQHC65AGJs1.__stackDetails = _e;
|
|
112
|
+
return chunkPQHC65AGJs1;
|
|
113
113
|
}({
|
|
114
|
-
|
|
114
|
+
_worklet_146491499400_init_data,
|
|
115
115
|
angle
|
|
116
116
|
}), [angle]);
|
|
117
117
|
return /* @__PURE__ */jsx3(Animated.View, {
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import {
|
|
2
|
+
InputDescription,
|
|
3
|
+
InputError,
|
|
4
|
+
InputField,
|
|
5
|
+
InputLabel,
|
|
6
|
+
InputRoot,
|
|
7
|
+
useInput
|
|
8
|
+
} from "./chunk-V2FQN6ZK.js";
|
|
9
|
+
import {
|
|
10
|
+
createSlotContext,
|
|
11
|
+
useStyleProps
|
|
12
|
+
} from "./chunk-PMO62QK4.js";
|
|
13
|
+
|
|
14
|
+
// src/components/text-area/text-area-field.tsx
|
|
15
|
+
import { forwardRef, useMemo } from "react";
|
|
16
|
+
|
|
17
|
+
// src/components/text-area/text-area.context.ts
|
|
18
|
+
var [TextAreaProvider, useTextArea] = createSlotContext("TextArea");
|
|
19
|
+
|
|
20
|
+
// src/components/text-area/text-area-field.tsx
|
|
21
|
+
import { jsx } from "react/jsx-runtime";
|
|
22
|
+
var TextAreaField = forwardRef(
|
|
23
|
+
function TextAreaField2({ style, scrollEnabled, ...props }, ref) {
|
|
24
|
+
const { textAreaStyle, textArea } = useInput();
|
|
25
|
+
const { rows, maxRows } = useTextArea();
|
|
26
|
+
const [styleProps, rest] = useStyleProps(props);
|
|
27
|
+
const height = useMemo(() => {
|
|
28
|
+
const chrome = textArea.paddingVertical * 2;
|
|
29
|
+
return {
|
|
30
|
+
minHeight: rows * textArea.lineHeight + chrome,
|
|
31
|
+
// Unset, the field grows for as long as the text does. With a ceiling it stops
|
|
32
|
+
// there and scrolls, which is the only case that needs `scrollEnabled` — a
|
|
33
|
+
// multiline field that can grow has nothing to scroll.
|
|
34
|
+
maxHeight: maxRows ? maxRows * textArea.lineHeight + chrome : void 0
|
|
35
|
+
};
|
|
36
|
+
}, [rows, maxRows, textArea]);
|
|
37
|
+
return /* @__PURE__ */ jsx(
|
|
38
|
+
InputField,
|
|
39
|
+
{
|
|
40
|
+
ref,
|
|
41
|
+
multiline: true,
|
|
42
|
+
scrollEnabled: scrollEnabled ?? maxRows !== void 0,
|
|
43
|
+
...rest,
|
|
44
|
+
style: [textAreaStyle, height, styleProps, style]
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
TextAreaField.displayName = "XAUI.TextArea.Field";
|
|
50
|
+
|
|
51
|
+
// src/components/text-area/text-area.tsx
|
|
52
|
+
import { forwardRef as forwardRef2, useMemo as useMemo2 } from "react";
|
|
53
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
54
|
+
var DEFAULT_ROWS = 3;
|
|
55
|
+
var TextAreaRoot = forwardRef2(function TextArea({ rows = DEFAULT_ROWS, maxRows, children, ...props }, ref) {
|
|
56
|
+
const context = useMemo2(() => ({ rows, maxRows }), [rows, maxRows]);
|
|
57
|
+
return /* @__PURE__ */ jsx2(TextAreaProvider, { value: context, children: /* @__PURE__ */ jsx2(InputRoot, { ref, ...props, children }) });
|
|
58
|
+
});
|
|
59
|
+
TextAreaRoot.displayName = "XAUI.TextArea.Root";
|
|
60
|
+
|
|
61
|
+
// src/components/text-area/index.ts
|
|
62
|
+
var TextArea2 = Object.assign(TextAreaRoot, {
|
|
63
|
+
Label: InputLabel,
|
|
64
|
+
Field: TextAreaField,
|
|
65
|
+
Description: InputDescription,
|
|
66
|
+
Error: InputError
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
export {
|
|
70
|
+
useTextArea,
|
|
71
|
+
TextArea2 as TextArea
|
|
72
|
+
};
|