@tamagui/radio-group 1.135.4-1761749240853 → 1.135.4
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/cjs/RadioGroup.native.js +102 -115
- package/dist/cjs/RadioGroup.native.js.map +6 -1
- package/dist/cjs/RadioGroupStyledContext.native.js +18 -22
- package/dist/cjs/RadioGroupStyledContext.native.js.map +6 -1
- package/dist/cjs/createRadioGroup.cjs +1 -1
- package/dist/cjs/createRadioGroup.js +1 -1
- package/dist/cjs/createRadioGroup.js.map +1 -1
- package/dist/cjs/createRadioGroup.native.js +81 -130
- package/dist/cjs/createRadioGroup.native.js.map +6 -1
- package/dist/cjs/index.native.js +21 -23
- package/dist/cjs/index.native.js.map +6 -1
- package/dist/jsx/RadioGroup.native.js +95 -128
- package/dist/jsx/RadioGroup.native.js.map +6 -1
- package/dist/jsx/RadioGroupStyledContext.native.js +9 -33
- package/dist/jsx/RadioGroupStyledContext.native.js.map +6 -1
- package/dist/jsx/createRadioGroup.native.js +74 -146
- package/dist/jsx/createRadioGroup.native.js.map +6 -1
- package/dist/jsx/index.native.js +13 -38
- package/dist/jsx/index.native.js.map +6 -1
- package/package.json +15 -16
package/dist/cjs/index.native.js
CHANGED
|
@@ -1,39 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
6
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
});
|
|
18
|
-
return to;
|
|
19
|
-
},
|
|
20
|
-
__reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
21
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
22
|
-
value: !0
|
|
23
|
-
}), mod);
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
return to;
|
|
14
|
+
}, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
24
16
|
var index_exports = {};
|
|
25
17
|
__export(index_exports, {
|
|
26
18
|
RadioGroup: () => RadioGroup
|
|
27
19
|
});
|
|
28
20
|
module.exports = __toCommonJS(index_exports);
|
|
29
|
-
var import_RadioGroup = require("./RadioGroup
|
|
30
|
-
|
|
31
|
-
__reExport(index_exports, require("./
|
|
32
|
-
__reExport(index_exports, require("./
|
|
33
|
-
__reExport(index_exports, require("./RadioGroupStyledContext.native.js"), module.exports);
|
|
21
|
+
var import_RadioGroup = require("./RadioGroup"), import_createRadioGroup = require("./createRadioGroup");
|
|
22
|
+
__reExport(index_exports, require("./createRadioGroup"), module.exports);
|
|
23
|
+
__reExport(index_exports, require("./RadioGroup"), module.exports);
|
|
24
|
+
__reExport(index_exports, require("./RadioGroupStyledContext"), module.exports);
|
|
34
25
|
var RadioGroup = (0, import_createRadioGroup.createRadioGroup)({
|
|
35
26
|
Frame: import_RadioGroup.RadioGroupFrame,
|
|
36
27
|
Indicator: import_RadioGroup.RadioGroupIndicatorFrame,
|
|
37
28
|
Item: import_RadioGroup.RadioGroupItemFrame
|
|
38
29
|
});
|
|
39
|
-
|
|
30
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
31
|
+
0 && (module.exports = {
|
|
32
|
+
RadioGroup,
|
|
33
|
+
...require("./createRadioGroup"),
|
|
34
|
+
...require("./RadioGroup"),
|
|
35
|
+
...require("./RadioGroupStyledContext")
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.ts"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAA+E,yBAC/E,0BAAiC;AACjC,0BAAc,+BAFd;AAGA,0BAAc,yBAHd;AAIA,0BAAc,sCAJd;AAKO,IAAI,iBAAa,0CAAiB;AAAA,EACrC,OAAO;AAAA,EACP,WAAW;AAAA,EACX,MAAM;AACV,CAAC;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
|
@@ -1,137 +1,104 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
RadioGroupItemFrame = (0, import_core.styled)(import_stacks.ThemeableStack, {
|
|
35
|
-
name: RADIO_GROUP_ITEM_NAME,
|
|
36
|
-
tag: "button",
|
|
37
|
-
variants: {
|
|
38
|
-
unstyled: {
|
|
39
|
-
false: {
|
|
40
|
-
size: "$true",
|
|
41
|
-
borderRadius: 1e3,
|
|
42
|
-
backgroundColor: "$background",
|
|
43
|
-
alignItems: "center",
|
|
44
|
-
justifyContent: "center",
|
|
45
|
-
borderWidth: 1,
|
|
46
|
-
borderColor: "$borderColor",
|
|
47
|
-
padding: 0,
|
|
48
|
-
hoverStyle: {
|
|
49
|
-
borderColor: "$borderColorHover",
|
|
50
|
-
backgroundColor: "$backgroundHover"
|
|
51
|
-
},
|
|
52
|
-
focusStyle: {
|
|
53
|
-
borderColor: "$borderColorHover",
|
|
54
|
-
backgroundColor: "$backgroundHover"
|
|
55
|
-
},
|
|
56
|
-
focusVisibleStyle: {
|
|
57
|
-
outlineStyle: "solid",
|
|
58
|
-
outlineWidth: 2,
|
|
59
|
-
outlineColor: "$outlineColor"
|
|
60
|
-
},
|
|
61
|
-
pressStyle: {
|
|
62
|
-
borderColor: "$borderColorFocus",
|
|
63
|
-
backgroundColor: "$backgroundFocus"
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
disabled: {
|
|
68
|
-
true: {
|
|
69
|
-
pointerEvents: "none",
|
|
70
|
-
userSelect: "none",
|
|
71
|
-
cursor: "not-allowed",
|
|
72
|
-
hoverStyle: {
|
|
73
|
-
borderColor: "$borderColor",
|
|
74
|
-
backgroundColor: "$background"
|
|
75
|
-
},
|
|
76
|
-
pressStyle: {
|
|
77
|
-
borderColor: "$borderColor",
|
|
78
|
-
backgroundColor: "$background"
|
|
79
|
-
},
|
|
80
|
-
focusVisibleStyle: {
|
|
81
|
-
outlineWidth: 0
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
size: {
|
|
86
|
-
"...size": function (value, param) {
|
|
87
|
-
var {
|
|
88
|
-
props
|
|
89
|
-
} = param,
|
|
90
|
-
_props_scaleSize,
|
|
91
|
-
size = Math.floor((0, import_core.getVariableValue)((0, import_get_token.getSize)(value)) * ((_props_scaleSize = props.scaleSize) !== null && _props_scaleSize !== void 0 ? _props_scaleSize : 0.5));
|
|
92
|
-
return {
|
|
93
|
-
width: size,
|
|
94
|
-
height: size
|
|
95
|
-
};
|
|
1
|
+
import { getVariableValue, styled } from "@tamagui/core";
|
|
2
|
+
import { getSize } from "@tamagui/get-token";
|
|
3
|
+
import { ThemeableStack } from "@tamagui/stacks";
|
|
4
|
+
var RADIO_GROUP_ITEM_NAME = "RadioGroupItem", RadioGroupItemFrame = styled(ThemeableStack, {
|
|
5
|
+
name: RADIO_GROUP_ITEM_NAME,
|
|
6
|
+
tag: "button",
|
|
7
|
+
variants: {
|
|
8
|
+
unstyled: {
|
|
9
|
+
false: {
|
|
10
|
+
size: "$true",
|
|
11
|
+
borderRadius: 1e3,
|
|
12
|
+
backgroundColor: "$background",
|
|
13
|
+
alignItems: "center",
|
|
14
|
+
justifyContent: "center",
|
|
15
|
+
borderWidth: 1,
|
|
16
|
+
borderColor: "$borderColor",
|
|
17
|
+
padding: 0,
|
|
18
|
+
hoverStyle: {
|
|
19
|
+
borderColor: "$borderColorHover",
|
|
20
|
+
backgroundColor: "$backgroundHover"
|
|
21
|
+
},
|
|
22
|
+
focusStyle: {
|
|
23
|
+
borderColor: "$borderColorHover",
|
|
24
|
+
backgroundColor: "$backgroundHover"
|
|
25
|
+
},
|
|
26
|
+
focusVisibleStyle: {
|
|
27
|
+
outlineStyle: "solid",
|
|
28
|
+
outlineWidth: 2,
|
|
29
|
+
outlineColor: "$outlineColor"
|
|
30
|
+
},
|
|
31
|
+
pressStyle: {
|
|
32
|
+
borderColor: "$borderColorFocus",
|
|
33
|
+
backgroundColor: "$backgroundFocus"
|
|
96
34
|
}
|
|
97
35
|
}
|
|
98
36
|
},
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
37
|
+
disabled: {
|
|
38
|
+
true: {
|
|
39
|
+
pointerEvents: "none",
|
|
40
|
+
userSelect: "none",
|
|
41
|
+
cursor: "not-allowed",
|
|
42
|
+
hoverStyle: {
|
|
43
|
+
borderColor: "$borderColor",
|
|
44
|
+
backgroundColor: "$background"
|
|
45
|
+
},
|
|
46
|
+
pressStyle: {
|
|
47
|
+
borderColor: "$borderColor",
|
|
48
|
+
backgroundColor: "$background"
|
|
49
|
+
},
|
|
50
|
+
focusVisibleStyle: {
|
|
51
|
+
outlineWidth: 0
|
|
114
52
|
}
|
|
115
53
|
}
|
|
116
54
|
},
|
|
117
|
-
|
|
118
|
-
|
|
55
|
+
size: {
|
|
56
|
+
"...size": function(value, param) {
|
|
57
|
+
var { props } = param, _props_scaleSize, size = Math.floor(getVariableValue(getSize(value)) * ((_props_scaleSize = props.scaleSize) !== null && _props_scaleSize !== void 0 ? _props_scaleSize : 0.5));
|
|
58
|
+
return {
|
|
59
|
+
width: size,
|
|
60
|
+
height: size
|
|
61
|
+
};
|
|
62
|
+
}
|
|
119
63
|
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
64
|
+
},
|
|
65
|
+
defaultVariants: {
|
|
66
|
+
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
67
|
+
}
|
|
68
|
+
}), RADIO_GROUP_INDICATOR_NAME = "RadioGroupIndicator", RadioGroupIndicatorFrame = styled(ThemeableStack, {
|
|
69
|
+
name: RADIO_GROUP_INDICATOR_NAME,
|
|
70
|
+
variants: {
|
|
71
|
+
unstyled: {
|
|
72
|
+
false: {
|
|
73
|
+
width: "33%",
|
|
74
|
+
height: "33%",
|
|
75
|
+
borderRadius: 1e3,
|
|
76
|
+
backgroundColor: "$color",
|
|
77
|
+
pressTheme: !0
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
defaultVariants: {
|
|
82
|
+
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
83
|
+
}
|
|
84
|
+
}), RADIO_GROUP_NAME = "RadioGroup", RadioGroupFrame = styled(ThemeableStack, {
|
|
85
|
+
name: RADIO_GROUP_NAME,
|
|
86
|
+
variants: {
|
|
87
|
+
orientation: {
|
|
88
|
+
horizontal: {
|
|
89
|
+
flexDirection: "row",
|
|
90
|
+
spaceDirection: "horizontal"
|
|
91
|
+
},
|
|
92
|
+
vertical: {
|
|
93
|
+
flexDirection: "column",
|
|
94
|
+
spaceDirection: "vertical"
|
|
134
95
|
}
|
|
135
96
|
}
|
|
136
|
-
}
|
|
137
|
-
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
export {
|
|
100
|
+
RadioGroupFrame,
|
|
101
|
+
RadioGroupIndicatorFrame,
|
|
102
|
+
RadioGroupItemFrame
|
|
103
|
+
};
|
|
104
|
+
//# sourceMappingURL=RadioGroup.js.map
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/RadioGroup.tsx"],
|
|
4
|
+
"mappings": "AAAA,SAAS,kBAAkB,cAAc;AACzC,SAAS,eAAe;AACxB,SAAS,sBAAsB;AAC/B,IAAI,wBAAwB,kBACjB,sBAAsB,OAAO,gBAAgB;AAAA,EACpD,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU;AAAA,IACN,UAAU;AAAA,MACN,OAAO;AAAA,QACH,MAAM;AAAA,QACN,cAAc;AAAA,QACd,iBAAiB;AAAA,QACjB,YAAY;AAAA,QACZ,gBAAgB;AAAA,QAChB,aAAa;AAAA,QACb,aAAa;AAAA,QACb,SAAS;AAAA,QACT,YAAY;AAAA,UACR,aAAa;AAAA,UACb,iBAAiB;AAAA,QACrB;AA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AAmB,cACZ,kBAAkB,OAAO,gBAAgB;AAAA,EAChD,MAAM;AAAA,EACN,UAAU;AAAA,IACN,aAAa;AAAA,MACT,YAAY;AAAA,QACR,eAAe;AAAA,QACf,gBAAgB;AAAA,MACpB;AAAA,MACA,UAAU;AAAA,QACN,eAAe;AAAA,QACf,gBAAgB;AAAA,MACpB;AAAA,IACJ;AAAA,EACJ;AACJ,CAAC;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
|
@@ -1,33 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
enumerable: !0
|
|
11
|
-
});
|
|
12
|
-
},
|
|
13
|
-
__copyProps = (to, from, except, desc) => {
|
|
14
|
-
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
15
|
-
get: () => from[key],
|
|
16
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
-
});
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
-
value: !0
|
|
22
|
-
}), mod);
|
|
23
|
-
var RadioGroupStyledContext_exports = {};
|
|
24
|
-
__export(RadioGroupStyledContext_exports, {
|
|
25
|
-
RadioGroupStyledContext: () => RadioGroupStyledContext
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(RadioGroupStyledContext_exports);
|
|
28
|
-
var import_core = require("@tamagui/core"),
|
|
29
|
-
RadioGroupStyledContext = (0, import_core.createStyledContext)({
|
|
30
|
-
size: "$true",
|
|
31
|
-
scaleIcon: 1
|
|
32
|
-
}, "RadioGroup");
|
|
33
|
-
//# sourceMappingURL=RadioGroupStyledContext.native.js.map
|
|
1
|
+
import { createStyledContext } from "@tamagui/core";
|
|
2
|
+
var RadioGroupStyledContext = createStyledContext({
|
|
3
|
+
size: "$true",
|
|
4
|
+
scaleIcon: 1
|
|
5
|
+
}, "RadioGroup");
|
|
6
|
+
export {
|
|
7
|
+
RadioGroupStyledContext
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=RadioGroupStyledContext.js.map
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/RadioGroupStyledContext.tsx"],
|
|
4
|
+
"mappings": "AAAA,SAAS,2BAA2B;AAC7B,IAAI,0BAA0B,oBAAoB;AAAA,EACrD,MAAM;AAAA,EACN,WAAW;AACf,GAAG,YAAY;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
|
@@ -1,169 +1,97 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
enumerable: !0
|
|
13
|
-
});
|
|
14
|
-
},
|
|
15
|
-
__copyProps = (to, from, except, desc) => {
|
|
16
|
-
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
17
|
-
get: () => from[key],
|
|
18
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
-
});
|
|
20
|
-
return to;
|
|
21
|
-
};
|
|
22
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
28
|
-
value: mod,
|
|
29
|
-
enumerable: !0
|
|
30
|
-
}) : target, mod)),
|
|
31
|
-
__toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
32
|
-
value: !0
|
|
33
|
-
}), mod);
|
|
34
|
-
var createRadioGroup_exports = {};
|
|
35
|
-
__export(createRadioGroup_exports, {
|
|
36
|
-
createRadioGroup: () => createRadioGroup
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { isWeb, withStaticProperties } from "@tamagui/core";
|
|
4
|
+
import { RadioGroupFrame, RadioGroupIndicatorFrame, RadioGroupItemFrame } from "./RadioGroup";
|
|
5
|
+
import { useRadioGroup, useRadioGroupItem, useRadioGroupItemIndicator } from "@tamagui/radio-headless";
|
|
6
|
+
import { RovingFocusGroup } from "@tamagui/roving-focus";
|
|
7
|
+
var ensureContext = function(x) {
|
|
8
|
+
x.context || (x.context = RadioGroupContext);
|
|
9
|
+
}, RadioGroupContext = /* @__PURE__ */ React.createContext({}), RadioGroupItemContext = /* @__PURE__ */ React.createContext({
|
|
10
|
+
checked: !1,
|
|
11
|
+
disabled: !1
|
|
37
12
|
});
|
|
38
|
-
module.exports = __toCommonJS(createRadioGroup_exports);
|
|
39
|
-
var import_jsx_runtime = require("react/jsx-runtime"),
|
|
40
|
-
import_react = __toESM(require("react"), 1),
|
|
41
|
-
import_core = require("@tamagui/core"),
|
|
42
|
-
import_RadioGroup = require("./RadioGroup.native.js"),
|
|
43
|
-
import_radio_headless = require("@tamagui/radio-headless"),
|
|
44
|
-
import_roving_focus = require("@tamagui/roving-focus"),
|
|
45
|
-
ensureContext = function (x) {
|
|
46
|
-
x.context || (x.context = RadioGroupContext);
|
|
47
|
-
},
|
|
48
|
-
RadioGroupContext = /* @__PURE__ */import_react.default.createContext({}),
|
|
49
|
-
RadioGroupItemContext = /* @__PURE__ */import_react.default.createContext({
|
|
50
|
-
checked: !1,
|
|
51
|
-
disabled: !1
|
|
52
|
-
});
|
|
53
13
|
function createRadioGroup(createProps) {
|
|
54
|
-
var {
|
|
55
|
-
disableActiveTheme,
|
|
56
|
-
Frame = import_RadioGroup.RadioGroupFrame,
|
|
57
|
-
Indicator = import_RadioGroup.RadioGroupIndicatorFrame,
|
|
58
|
-
Item = import_RadioGroup.RadioGroupItemFrame
|
|
59
|
-
} = createProps;
|
|
14
|
+
var { disableActiveTheme, Frame = RadioGroupFrame, Indicator = RadioGroupIndicatorFrame, Item = RadioGroupItemFrame } = createProps;
|
|
60
15
|
ensureContext(Frame), ensureContext(Indicator), ensureContext(Item);
|
|
61
|
-
var RadioGroupImp = Frame.styleable(function
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
16
|
+
var RadioGroupImp = Frame.styleable(function(props, ref) {
|
|
17
|
+
var { value, defaultValue, onValueChange, required = !1, disabled = !1, name, native, accentColor, orientation = "vertical", ...rest } = props, { providerValue, frameAttrs, rovingFocusGroupAttrs } = useRadioGroup({
|
|
18
|
+
orientation,
|
|
19
|
+
name,
|
|
20
|
+
defaultValue,
|
|
21
|
+
value,
|
|
22
|
+
onValueChange,
|
|
23
|
+
required,
|
|
24
|
+
disabled,
|
|
25
|
+
native,
|
|
26
|
+
accentColor
|
|
27
|
+
});
|
|
28
|
+
return /* @__PURE__ */ _jsx(RadioGroupContext.Provider, {
|
|
29
|
+
value: providerValue,
|
|
30
|
+
children: /* @__PURE__ */ _jsx(RovingFocusGroup, {
|
|
31
|
+
...rovingFocusGroupAttrs,
|
|
32
|
+
children: /* @__PURE__ */ _jsx(RadioGroupFrame, {
|
|
33
|
+
...frameAttrs,
|
|
34
|
+
ref,
|
|
72
35
|
...rest
|
|
73
|
-
} = props,
|
|
74
|
-
{
|
|
75
|
-
providerValue,
|
|
76
|
-
frameAttrs,
|
|
77
|
-
rovingFocusGroupAttrs
|
|
78
|
-
} = (0, import_radio_headless.useRadioGroup)({
|
|
79
|
-
orientation,
|
|
80
|
-
name,
|
|
81
|
-
defaultValue,
|
|
82
|
-
value,
|
|
83
|
-
onValueChange,
|
|
84
|
-
required,
|
|
85
|
-
disabled,
|
|
86
|
-
native,
|
|
87
|
-
accentColor
|
|
88
|
-
});
|
|
89
|
-
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(RadioGroupContext.Provider, {
|
|
90
|
-
value: providerValue,
|
|
91
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_roving_focus.RovingFocusGroup, {
|
|
92
|
-
...rovingFocusGroupAttrs,
|
|
93
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_RadioGroup.RadioGroupFrame, {
|
|
94
|
-
...frameAttrs,
|
|
95
|
-
ref,
|
|
96
|
-
...rest
|
|
97
|
-
})
|
|
98
36
|
})
|
|
99
|
-
})
|
|
100
|
-
})
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
onPress,
|
|
126
|
-
onKeyDown
|
|
127
|
-
});
|
|
128
|
-
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(RadioGroupItemContext.Provider, {
|
|
129
|
-
value: providerValue,
|
|
130
|
-
children: import_core.isWeb && native ? bubbleInput : /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
131
|
-
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_roving_focus.RovingFocusGroup.Item, {
|
|
37
|
+
})
|
|
38
|
+
});
|
|
39
|
+
}), RadioGroupItemImp = Item.styleable(function(props, ref) {
|
|
40
|
+
var {
|
|
41
|
+
value,
|
|
42
|
+
labelledBy,
|
|
43
|
+
onPress,
|
|
44
|
+
//@ts-expect-error
|
|
45
|
+
onKeyDown,
|
|
46
|
+
disabled,
|
|
47
|
+
id,
|
|
48
|
+
...rest
|
|
49
|
+
} = props, { providerValue, bubbleInput, rovingFocusGroupAttrs, frameAttrs, isFormControl, native } = useRadioGroupItem({
|
|
50
|
+
radioGroupContext: RadioGroupContext,
|
|
51
|
+
value,
|
|
52
|
+
id,
|
|
53
|
+
labelledBy,
|
|
54
|
+
disabled,
|
|
55
|
+
onPress,
|
|
56
|
+
onKeyDown
|
|
57
|
+
});
|
|
58
|
+
return /* @__PURE__ */ _jsx(RadioGroupItemContext.Provider, {
|
|
59
|
+
value: providerValue,
|
|
60
|
+
children: isWeb && native ? bubbleInput : /* @__PURE__ */ _jsxs(_Fragment, {
|
|
61
|
+
children: [
|
|
62
|
+
/* @__PURE__ */ _jsx(RovingFocusGroup.Item, {
|
|
132
63
|
...rovingFocusGroupAttrs,
|
|
133
|
-
children: /* @__PURE__ */
|
|
64
|
+
children: /* @__PURE__ */ _jsx(RadioGroupItemFrame, {
|
|
134
65
|
...frameAttrs,
|
|
135
66
|
ref,
|
|
136
67
|
...rest
|
|
137
68
|
})
|
|
138
|
-
}),
|
|
139
|
-
|
|
140
|
-
|
|
69
|
+
}),
|
|
70
|
+
isFormControl && bubbleInput
|
|
71
|
+
]
|
|
72
|
+
})
|
|
141
73
|
});
|
|
74
|
+
});
|
|
142
75
|
RadioGroupItemImp.displayName = "RadioGroupItem";
|
|
143
|
-
var RadioIndicator = Indicator.styleable(function
|
|
144
|
-
var {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
{
|
|
150
|
-
checked,
|
|
151
|
-
...useIndicatorRest
|
|
152
|
-
} = (0, import_radio_headless.useRadioGroupItemIndicator)({
|
|
153
|
-
radioGroupItemContext: RadioGroupItemContext,
|
|
154
|
-
disabled
|
|
155
|
-
});
|
|
156
|
-
return forceMount || checked ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(Indicator, {
|
|
76
|
+
var RadioIndicator = Indicator.styleable(function(props, forwardedRef) {
|
|
77
|
+
var { forceMount, disabled, ...indicatorProps } = props, { checked, ...useIndicatorRest } = useRadioGroupItemIndicator({
|
|
78
|
+
radioGroupItemContext: RadioGroupItemContext,
|
|
79
|
+
disabled
|
|
80
|
+
});
|
|
81
|
+
return forceMount || checked ? /* @__PURE__ */ _jsx(Indicator, {
|
|
157
82
|
...useIndicatorRest,
|
|
158
83
|
ref: forwardedRef,
|
|
159
84
|
...indicatorProps
|
|
160
85
|
}) : null;
|
|
161
86
|
});
|
|
162
87
|
RadioIndicator.displayName = "RadioIndicator";
|
|
163
|
-
var RadioGroup =
|
|
88
|
+
var RadioGroup = withStaticProperties(RadioGroupImp, {
|
|
164
89
|
Item: RadioGroupItemImp,
|
|
165
90
|
Indicator: RadioIndicator
|
|
166
91
|
});
|
|
167
92
|
return RadioGroup.displayName = "RadioGroup", RadioGroup;
|
|
168
93
|
}
|
|
169
|
-
|
|
94
|
+
export {
|
|
95
|
+
createRadioGroup
|
|
96
|
+
};
|
|
97
|
+
//# sourceMappingURL=createRadioGroup.js.map
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/createRadioGroup.tsx"],
|
|
4
|
+
"mappings": "AAAA,SAAS,OAAO,MAAM,QAAQ,OAAO,YAAY,iBAAiB;AAClE,OAAO,WAAW;AAClB,SAAS,OAAO,4BAA4B;AAC5C,SAAS,iBAAiB,0BAA0B,2BAA2B;AAM/E,SAAS,eAAe,mBAAmB,kCAAkC;AAC7E,SAAS,wBAAwB;AANjC,IAAI,gBAAgB,SAAS,GAAG;AAC5B,EAAK,EAAE,YACH,EAAE,UAAU;AA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