@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,147 @@
|
|
|
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 _chunkJ3MB4PI5cjs = require('./chunk-J3MB4PI5.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunk4KFKWBN5cjs = require('./chunk-4KFKWBN5.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
var _chunk7GHM4GKLcjs = require('./chunk-7GHM4GKL.cjs');
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
var _chunkTK44VBIEcjs = require('./chunk-TK44VBIE.cjs');
|
|
15
|
+
|
|
16
|
+
// src/components/field-group/field-group-field.tsx
|
|
17
|
+
var _react = require('react');
|
|
18
|
+
|
|
19
|
+
// src/components/field-group/field-group.context.ts
|
|
20
|
+
var [FieldGroupProvider, useFieldGroup] = _chunk7GHM4GKLcjs.createSlotContext.call(void 0, "FieldGroup");
|
|
21
|
+
|
|
22
|
+
// src/components/field-group/field-group.utils.ts
|
|
23
|
+
function decoratorPadding(prefixWidth, suffixWidth) {
|
|
24
|
+
const paddingStart = prefixWidth > 0 ? prefixWidth : void 0;
|
|
25
|
+
const paddingEnd = suffixWidth > 0 ? suffixWidth : void 0;
|
|
26
|
+
if (paddingStart === void 0 && paddingEnd === void 0) return void 0;
|
|
27
|
+
return { paddingStart, paddingEnd };
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// src/components/field-group/field-group-field.tsx
|
|
31
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
32
|
+
var FieldGroupField = _react.forwardRef.call(void 0,
|
|
33
|
+
function FieldGroupField2({ style, ...props }, ref) {
|
|
34
|
+
const { prefixWidth, suffixWidth } = useFieldGroup();
|
|
35
|
+
const padding = _react.useMemo.call(void 0,
|
|
36
|
+
() => decoratorPadding(prefixWidth, suffixWidth),
|
|
37
|
+
[prefixWidth, suffixWidth]
|
|
38
|
+
);
|
|
39
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJ3MB4PI5cjs.TextFieldField, { ref, ...props, style: [padding, style] });
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
FieldGroupField.displayName = "XAUI.FieldGroup.Field";
|
|
43
|
+
|
|
44
|
+
// src/components/field-group/field-group-icon.tsx
|
|
45
|
+
|
|
46
|
+
function FieldGroupIcon({ size, color, ...rest }) {
|
|
47
|
+
const { icon } = _chunkJ3MB4PI5cjs.useTextField.call(void 0, );
|
|
48
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4KFKWBN5cjs.Icon, { size: _nullishCoalesce(size, () => ( icon.size)), color: _nullishCoalesce(color, () => ( icon.color)), ...rest });
|
|
49
|
+
}
|
|
50
|
+
FieldGroupIcon.displayName = "XAUI.FieldGroup.Icon";
|
|
51
|
+
|
|
52
|
+
// src/components/field-group/field-group-prefix.tsx
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
// src/components/field-group/field-group-decorator.tsx
|
|
56
|
+
|
|
57
|
+
var _reactnative = require('react-native');
|
|
58
|
+
|
|
59
|
+
var FieldGroupDecorator = _react.forwardRef.call(void 0,
|
|
60
|
+
function FieldGroupDecorator2({ side, children, isDecorative = false, onLayout, style, ...props }, ref) {
|
|
61
|
+
const { prefixStyle, suffixStyle, isDisabled } = _chunkJ3MB4PI5cjs.useTextField.call(void 0, );
|
|
62
|
+
const { setPrefixWidth, setSuffixWidth } = useFieldGroup();
|
|
63
|
+
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
64
|
+
const report = side === "prefix" ? setPrefixWidth : setSuffixWidth;
|
|
65
|
+
const handleLayout = _react.useCallback.call(void 0,
|
|
66
|
+
(event) => {
|
|
67
|
+
report(event.nativeEvent.layout.width);
|
|
68
|
+
_optionalChain([onLayout, 'optionalCall', _ => _(event)]);
|
|
69
|
+
},
|
|
70
|
+
[report, onLayout]
|
|
71
|
+
);
|
|
72
|
+
const isInert = isDecorative || isDisabled;
|
|
73
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
74
|
+
_reactnative.View,
|
|
75
|
+
{
|
|
76
|
+
ref,
|
|
77
|
+
accessibilityElementsHidden: isDecorative || void 0,
|
|
78
|
+
importantForAccessibility: isDecorative ? "no-hide-descendants" : void 0,
|
|
79
|
+
pointerEvents: isInert ? "none" : void 0,
|
|
80
|
+
...rest,
|
|
81
|
+
style: [side === "prefix" ? prefixStyle : suffixStyle, styleProps, style],
|
|
82
|
+
onLayout: handleLayout,
|
|
83
|
+
children
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
FieldGroupDecorator.displayName = "XAUI.FieldGroup.Decorator";
|
|
89
|
+
|
|
90
|
+
// src/components/field-group/field-group-prefix.tsx
|
|
91
|
+
|
|
92
|
+
var FieldGroupPrefix = _react.forwardRef.call(void 0,
|
|
93
|
+
function FieldGroupPrefix2(props, ref) {
|
|
94
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FieldGroupDecorator, { ref, side: "prefix", ...props });
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
FieldGroupPrefix.displayName = "XAUI.FieldGroup.Prefix";
|
|
98
|
+
|
|
99
|
+
// src/components/field-group/field-group-suffix.tsx
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
var FieldGroupSuffix = _react.forwardRef.call(void 0,
|
|
103
|
+
function FieldGroupSuffix2(props, ref) {
|
|
104
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FieldGroupDecorator, { ref, side: "suffix", ...props });
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
FieldGroupSuffix.displayName = "XAUI.FieldGroup.Suffix";
|
|
108
|
+
|
|
109
|
+
// src/components/field-group/field-group.tsx
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
var FieldGroupRoot = _react.forwardRef.call(void 0, function FieldGroup({ children, asChild = false, style, ...props }, ref) {
|
|
114
|
+
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
115
|
+
const [prefixWidth, setPrefixWidth] = _react.useState.call(void 0, 0);
|
|
116
|
+
const [suffixWidth, setSuffixWidth] = _react.useState.call(void 0, 0);
|
|
117
|
+
const context = _react.useMemo.call(void 0,
|
|
118
|
+
() => ({ prefixWidth, suffixWidth, setPrefixWidth, setSuffixWidth }),
|
|
119
|
+
[prefixWidth, suffixWidth]
|
|
120
|
+
);
|
|
121
|
+
const rootStyle = [styleProps, style];
|
|
122
|
+
const surface = asChild ? (
|
|
123
|
+
// R12 — the caller's element *is* the row.
|
|
124
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7GHM4GKLcjs.Slot, { ref, ...rest, style: rootStyle, children })
|
|
125
|
+
) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { ref, ...rest, style: rootStyle, children });
|
|
126
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FieldGroupProvider, { value: context, children: surface });
|
|
127
|
+
});
|
|
128
|
+
FieldGroupRoot.displayName = "XAUI.FieldGroup.Root";
|
|
129
|
+
|
|
130
|
+
// src/components/field-group/index.ts
|
|
131
|
+
var FieldGroup2 = Object.assign(FieldGroupRoot, {
|
|
132
|
+
Prefix: FieldGroupPrefix,
|
|
133
|
+
Field: FieldGroupField,
|
|
134
|
+
Suffix: FieldGroupSuffix,
|
|
135
|
+
Icon: FieldGroupIcon
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
exports.useFieldGroup = useFieldGroup; exports.decoratorPadding = decoratorPadding; exports.FieldGroupField = FieldGroupField; exports.FieldGroupIcon = FieldGroupIcon; exports.FieldGroupPrefix = FieldGroupPrefix; exports.FieldGroupSuffix = FieldGroupSuffix; exports.FieldGroupRoot = FieldGroupRoot; exports.FieldGroup = FieldGroup2;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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 _chunkFNEUOBCVcjs = require('./chunk-FNEUOBCV.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunk57SJ4LJFcjs = require('./chunk-57SJ4LJF.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
var _chunk7GHM4GKLcjs = require('./chunk-7GHM4GKL.cjs');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
var _chunkTK44VBIEcjs = require('./chunk-TK44VBIE.cjs');
|
|
13
|
+
|
|
14
|
+
// src/components/divider/divider.tsx
|
|
15
|
+
var _react = require('react');
|
|
16
|
+
var _reactnative = require('react-native');
|
|
17
|
+
|
|
18
|
+
// src/components/divider/divider.recipe.ts
|
|
19
|
+
|
|
20
|
+
var SLOTS = ["root"];
|
|
21
|
+
var VARIANT_TOKENS = { default: { bg: "separator" } };
|
|
22
|
+
var HAIRLINE = _reactnative.StyleSheet.hairlineWidth;
|
|
23
|
+
function thickness(of) {
|
|
24
|
+
return (theme) => {
|
|
25
|
+
const value = of(theme);
|
|
26
|
+
return { root: { height: value, width: value } };
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
var dividerRecipe = _chunkFNEUOBCVcjs.createRecipe.call(void 0, {
|
|
30
|
+
slots: SLOTS,
|
|
31
|
+
base: () => ({
|
|
32
|
+
// One line for both orientations. In a column the cross axis is horizontal, so a
|
|
33
|
+
// stretched child is full width; in a row it is vertical, so the same word makes a
|
|
34
|
+
// vertical rule full height. `stretch` is ignored on the axis the thickness fixes,
|
|
35
|
+
// which is what lets one declaration serve both.
|
|
36
|
+
root: { alignSelf: "stretch" }
|
|
37
|
+
}),
|
|
38
|
+
variantTokens: VARIANT_TOKENS,
|
|
39
|
+
paint: (_theme, colors) => ({ root: { backgroundColor: colors.bg } }),
|
|
40
|
+
variants: {
|
|
41
|
+
// Multiples of `borderWidth.default`, so a theme that thickens its edges thickens
|
|
42
|
+
// these with it. Only the hairline stands outside the scale, being a device pixel.
|
|
43
|
+
size: {
|
|
44
|
+
xs: thickness(() => HAIRLINE),
|
|
45
|
+
sm: thickness((theme) => theme.borderWidth.default),
|
|
46
|
+
md: thickness((theme) => theme.borderWidth.default * 2),
|
|
47
|
+
lg: thickness((theme) => theme.borderWidth.default * 6)
|
|
48
|
+
},
|
|
49
|
+
/** Second, so it releases the axis `size` had to write blind. */
|
|
50
|
+
orientation: {
|
|
51
|
+
horizontal: () => ({ root: { width: "auto" } }),
|
|
52
|
+
vertical: () => ({ root: { height: "auto" } })
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
/**
|
|
56
|
+
* `xs` where every other component defaults to `md`, and it is the one place in the
|
|
57
|
+
* library that departs from that: a rule you notice is a rule that is too thick, and
|
|
58
|
+
* the hairline is what a separator is at rest.
|
|
59
|
+
*
|
|
60
|
+
* `variant` is named here and nowhere else — there is one, the caller cannot choose it,
|
|
61
|
+
* and the recipe still needs it selected for `paint` and the tint to resolve.
|
|
62
|
+
*/
|
|
63
|
+
defaultVariants: { variant: "default", size: "xs", orientation: "horizontal" }
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
// src/components/divider/divider.tsx
|
|
67
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
68
|
+
var Divider = _react.forwardRef.call(void 0, function Divider2({ children, orientation, size, color, asChild = false, style, ...props }, ref) {
|
|
69
|
+
const theme = _chunk57SJ4LJFcjs.useXAUITheme.call(void 0, );
|
|
70
|
+
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
71
|
+
const selection = { orientation, size };
|
|
72
|
+
const styles = dividerRecipe.resolve({ theme, selection });
|
|
73
|
+
const tint = color ? dividerRecipe.tint({ theme, color, selection }) : void 0;
|
|
74
|
+
const Root = asChild ? _chunk7GHM4GKLcjs.Slot : _reactnative.View;
|
|
75
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
76
|
+
Root,
|
|
77
|
+
{
|
|
78
|
+
ref,
|
|
79
|
+
accessibilityElementsHidden: true,
|
|
80
|
+
importantForAccessibility: "no",
|
|
81
|
+
...rest,
|
|
82
|
+
style: [styles.root, _optionalChain([tint, 'optionalAccess', _ => _.root]), styleProps, style],
|
|
83
|
+
children: asChild ? children : null
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
});
|
|
87
|
+
Divider.displayName = "XAUI.Divider";
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
exports.dividerRecipe = dividerRecipe; exports.Divider = Divider;
|