@hanzogui/radio-group 7.0.0 → 7.3.1
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/LICENSE +40 -19
- package/dist/cjs/RadioGroup.cjs +134 -0
- package/dist/cjs/RadioGroup.native.js +139 -0
- package/dist/cjs/RadioGroup.native.js.map +1 -0
- package/dist/cjs/RadioGroupStyledContext.cjs +32 -0
- package/dist/cjs/RadioGroupStyledContext.native.js +35 -0
- package/dist/cjs/RadioGroupStyledContext.native.js.map +1 -0
- package/dist/cjs/createRadioGroup.cjs +175 -0
- package/dist/cjs/createRadioGroup.native.js +178 -0
- package/dist/cjs/createRadioGroup.native.js.map +1 -0
- package/dist/cjs/index.cjs +38 -0
- package/dist/cjs/index.native.js +41 -0
- package/dist/cjs/index.native.js.map +1 -0
- package/dist/esm/RadioGroup.mjs +107 -0
- package/dist/esm/RadioGroup.mjs.map +1 -0
- package/dist/esm/RadioGroup.native.js +109 -0
- package/dist/esm/RadioGroup.native.js.map +1 -0
- package/dist/esm/RadioGroupStyledContext.mjs +7 -0
- package/dist/esm/RadioGroupStyledContext.mjs.map +1 -0
- package/dist/esm/RadioGroupStyledContext.native.js +7 -0
- package/dist/esm/RadioGroupStyledContext.native.js.map +1 -0
- package/dist/esm/createRadioGroup.mjs +139 -0
- package/dist/esm/createRadioGroup.mjs.map +1 -0
- package/dist/esm/createRadioGroup.native.js +139 -0
- package/dist/esm/createRadioGroup.native.js.map +1 -0
- package/dist/esm/index.js +12 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/index.mjs +12 -0
- package/dist/esm/index.mjs.map +1 -0
- package/dist/esm/index.native.js +12 -0
- package/dist/esm/index.native.js.map +1 -0
- package/dist/jsx/RadioGroup.mjs +107 -0
- package/dist/jsx/RadioGroup.mjs.map +1 -0
- package/dist/jsx/RadioGroup.native.js +139 -0
- package/dist/jsx/RadioGroup.native.js.map +1 -0
- package/dist/jsx/RadioGroupStyledContext.mjs +7 -0
- package/dist/jsx/RadioGroupStyledContext.mjs.map +1 -0
- package/dist/jsx/RadioGroupStyledContext.native.js +35 -0
- package/dist/jsx/RadioGroupStyledContext.native.js.map +1 -0
- package/dist/jsx/createRadioGroup.mjs +139 -0
- package/dist/jsx/createRadioGroup.mjs.map +1 -0
- package/dist/jsx/createRadioGroup.native.js +178 -0
- package/dist/jsx/createRadioGroup.native.js.map +1 -0
- package/dist/jsx/index.js +12 -0
- package/dist/jsx/index.js.map +1 -0
- package/dist/jsx/index.mjs +12 -0
- package/dist/jsx/index.mjs.map +1 -0
- package/dist/jsx/index.native.js +41 -0
- package/dist/jsx/index.native.js.map +1 -0
- package/package.json +23 -21
- package/src/RadioGroup.tsx +2 -2
- package/types/RadioGroup.d.ts +3 -3
- package/types/RadioGroup.d.ts.map +1 -0
- package/types/RadioGroupStyledContext.d.ts.map +1 -0
- package/types/createRadioGroup.d.ts +17 -17
- package/types/createRadioGroup.d.ts.map +1 -0
- package/types/index.d.ts +17 -17
- package/types/index.d.ts.map +1 -0
package/LICENSE
CHANGED
|
@@ -1,21 +1,42 @@
|
|
|
1
|
-
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026-present, Hanzo AI, Inc.
|
|
4
|
+
|
|
5
|
+
Portions of this software are derived from upstream code originally licensed under
|
|
6
|
+
the MIT License, with the following copyright notices retained per its terms:
|
|
2
7
|
|
|
3
8
|
Copyright (c) 2020 Nate Wienert
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
9
|
+
Copyright (c) 2015-present, Nicolas Gallagher.
|
|
10
|
+
Copyright (c) 2015-present, Facebook, Inc.
|
|
11
|
+
Copyright (c) 2021 Radix
|
|
12
|
+
Copyright (c) 2017 Carmelo Pullara
|
|
13
|
+
Copyright (c) 2018 Framer B.V.
|
|
14
|
+
Copyright (c) 2022 WorkOS
|
|
15
|
+
|
|
16
|
+
All rights reserved.
|
|
17
|
+
|
|
18
|
+
Redistribution and use in source and binary forms, with or without
|
|
19
|
+
modification, are permitted provided that the following conditions are met:
|
|
20
|
+
|
|
21
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
22
|
+
list of conditions and the following disclaimer.
|
|
23
|
+
|
|
24
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
25
|
+
this list of conditions and the following disclaimer in the documentation
|
|
26
|
+
and/or other materials provided with the distribution.
|
|
27
|
+
|
|
28
|
+
3. Neither the name of the copyright holder nor the names of its contributors
|
|
29
|
+
may be used to endorse or promote products derived from this software
|
|
30
|
+
without specific prior written permission.
|
|
31
|
+
|
|
32
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
33
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
34
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
35
|
+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
|
36
|
+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
37
|
+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
38
|
+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
39
|
+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
40
|
+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
41
|
+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
42
|
+
POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
14
|
+
get: () => from[key],
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
+
value: true
|
|
22
|
+
}), mod);
|
|
23
|
+
var RadioGroup_exports = {};
|
|
24
|
+
__export(RadioGroup_exports, {
|
|
25
|
+
RadioGroupFrame: () => RadioGroupFrame,
|
|
26
|
+
RadioGroupIndicatorFrame: () => RadioGroupIndicatorFrame,
|
|
27
|
+
RadioGroupItemFrame: () => RadioGroupItemFrame
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(RadioGroup_exports);
|
|
30
|
+
var import_core = require("@hanzogui/core");
|
|
31
|
+
var import_get_token = require("@hanzogui/get-token");
|
|
32
|
+
var import_stacks = require("@hanzogui/stacks");
|
|
33
|
+
const RADIO_GROUP_ITEM_NAME = "RadioGroupItem";
|
|
34
|
+
const RadioGroupItemFrame = (0, import_core.styled)(import_stacks.YStack, {
|
|
35
|
+
name: RADIO_GROUP_ITEM_NAME,
|
|
36
|
+
render: "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": (value, {
|
|
87
|
+
props
|
|
88
|
+
}) => {
|
|
89
|
+
const size = Math.floor((0, import_core.getVariableValue)((0, import_get_token.getSize)(value)) * (props["scaleSize"] ?? 0.5));
|
|
90
|
+
return {
|
|
91
|
+
width: size,
|
|
92
|
+
height: size
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
defaultVariants: {
|
|
98
|
+
unstyled: process.env.GUI_HEADLESS === "1"
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
const RADIO_GROUP_INDICATOR_NAME = "RadioGroupIndicator";
|
|
102
|
+
const RadioGroupIndicatorFrame = (0, import_core.styled)(import_stacks.YStack, {
|
|
103
|
+
name: RADIO_GROUP_INDICATOR_NAME,
|
|
104
|
+
variants: {
|
|
105
|
+
unstyled: {
|
|
106
|
+
false: {
|
|
107
|
+
width: "33%",
|
|
108
|
+
height: "33%",
|
|
109
|
+
borderRadius: 1e3,
|
|
110
|
+
backgroundColor: "$color",
|
|
111
|
+
pressTheme: true
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
defaultVariants: {
|
|
116
|
+
unstyled: process.env.GUI_HEADLESS === "1"
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
const RADIO_GROUP_NAME = "RadioGroup";
|
|
120
|
+
const RadioGroupFrame = (0, import_core.styled)(import_stacks.YStack, {
|
|
121
|
+
name: RADIO_GROUP_NAME,
|
|
122
|
+
variants: {
|
|
123
|
+
orientation: {
|
|
124
|
+
horizontal: {
|
|
125
|
+
flexDirection: "row",
|
|
126
|
+
spaceDirection: "horizontal"
|
|
127
|
+
},
|
|
128
|
+
vertical: {
|
|
129
|
+
flexDirection: "column",
|
|
130
|
+
spaceDirection: "vertical"
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
});
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
+
get: () => from[key],
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
23
|
+
value: true
|
|
24
|
+
}), mod);
|
|
25
|
+
var RadioGroup_exports = {};
|
|
26
|
+
__export(RadioGroup_exports, {
|
|
27
|
+
RadioGroupFrame: () => RadioGroupFrame,
|
|
28
|
+
RadioGroupIndicatorFrame: () => RadioGroupIndicatorFrame,
|
|
29
|
+
RadioGroupItemFrame: () => RadioGroupItemFrame
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(RadioGroup_exports);
|
|
32
|
+
var import_core = require("@hanzogui/core");
|
|
33
|
+
var import_get_token = require("@hanzogui/get-token");
|
|
34
|
+
var import_stacks = require("@hanzogui/stacks");
|
|
35
|
+
var RADIO_GROUP_ITEM_NAME = "RadioGroupItem";
|
|
36
|
+
var RadioGroupItemFrame = (0, import_core.styled)(import_stacks.YStack, {
|
|
37
|
+
name: RADIO_GROUP_ITEM_NAME,
|
|
38
|
+
render: "button",
|
|
39
|
+
variants: {
|
|
40
|
+
unstyled: {
|
|
41
|
+
false: {
|
|
42
|
+
size: "$true",
|
|
43
|
+
borderRadius: 1e3,
|
|
44
|
+
backgroundColor: "$background",
|
|
45
|
+
alignItems: "center",
|
|
46
|
+
justifyContent: "center",
|
|
47
|
+
borderWidth: 1,
|
|
48
|
+
borderColor: "$borderColor",
|
|
49
|
+
padding: 0,
|
|
50
|
+
hoverStyle: {
|
|
51
|
+
borderColor: "$borderColorHover",
|
|
52
|
+
backgroundColor: "$backgroundHover"
|
|
53
|
+
},
|
|
54
|
+
focusStyle: {
|
|
55
|
+
borderColor: "$borderColorHover",
|
|
56
|
+
backgroundColor: "$backgroundHover"
|
|
57
|
+
},
|
|
58
|
+
focusVisibleStyle: {
|
|
59
|
+
outlineStyle: "solid",
|
|
60
|
+
outlineWidth: 2,
|
|
61
|
+
outlineColor: "$outlineColor"
|
|
62
|
+
},
|
|
63
|
+
pressStyle: {
|
|
64
|
+
borderColor: "$borderColorFocus",
|
|
65
|
+
backgroundColor: "$backgroundFocus"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
disabled: {
|
|
70
|
+
true: {
|
|
71
|
+
pointerEvents: "none",
|
|
72
|
+
userSelect: "none",
|
|
73
|
+
cursor: "not-allowed",
|
|
74
|
+
hoverStyle: {
|
|
75
|
+
borderColor: "$borderColor",
|
|
76
|
+
backgroundColor: "$background"
|
|
77
|
+
},
|
|
78
|
+
pressStyle: {
|
|
79
|
+
borderColor: "$borderColor",
|
|
80
|
+
backgroundColor: "$background"
|
|
81
|
+
},
|
|
82
|
+
focusVisibleStyle: {
|
|
83
|
+
outlineWidth: 0
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
size: {
|
|
88
|
+
"...size": function (value, param) {
|
|
89
|
+
var {
|
|
90
|
+
props
|
|
91
|
+
} = param;
|
|
92
|
+
var _props_scaleSize;
|
|
93
|
+
var 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));
|
|
94
|
+
return {
|
|
95
|
+
width: size,
|
|
96
|
+
height: size
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
defaultVariants: {
|
|
102
|
+
unstyled: process.env.GUI_HEADLESS === "1"
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
var RADIO_GROUP_INDICATOR_NAME = "RadioGroupIndicator";
|
|
106
|
+
var RadioGroupIndicatorFrame = (0, import_core.styled)(import_stacks.YStack, {
|
|
107
|
+
name: RADIO_GROUP_INDICATOR_NAME,
|
|
108
|
+
variants: {
|
|
109
|
+
unstyled: {
|
|
110
|
+
false: {
|
|
111
|
+
width: "33%",
|
|
112
|
+
height: "33%",
|
|
113
|
+
borderRadius: 1e3,
|
|
114
|
+
backgroundColor: "$color",
|
|
115
|
+
pressTheme: true
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
defaultVariants: {
|
|
120
|
+
unstyled: process.env.GUI_HEADLESS === "1"
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
var RADIO_GROUP_NAME = "RadioGroup";
|
|
124
|
+
var RadioGroupFrame = (0, import_core.styled)(import_stacks.YStack, {
|
|
125
|
+
name: RADIO_GROUP_NAME,
|
|
126
|
+
variants: {
|
|
127
|
+
orientation: {
|
|
128
|
+
horizontal: {
|
|
129
|
+
flexDirection: "row",
|
|
130
|
+
spaceDirection: "horizontal"
|
|
131
|
+
},
|
|
132
|
+
vertical: {
|
|
133
|
+
flexDirection: "column",
|
|
134
|
+
spaceDirection: "vertical"
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
//# sourceMappingURL=RadioGroup.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","RadioGroup_exports","__export","RadioGroupFrame","RadioGroupIndicatorFrame","RadioGroupItemFrame","module","exports","import_core","require","import_get_token","import_stacks","RADIO_GROUP_ITEM_NAME","styled","YStack","name","render","variants","unstyled","false","size","borderRadius","backgroundColor","alignItems","justifyContent","borderWidth","borderColor","padding","hoverStyle","focusStyle","focusVisibleStyle","outlineStyle","outlineWidth","outlineColor","pressStyle","disabled","true","pointerEvents","userSelect","cursor","...size","param","props","_props_scaleSize","Math","floor","getVariableValue","getSize","width","height","defaultVariants","process","env","GUI_HEADLESS","RADIO_GROUP_INDICATOR_NAME","pressTheme","RADIO_GROUP_NAME","orientation","horizontal","flexDirection","spaceDirection","vertical"],"sources":["../../src/RadioGroup.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,kBAAA;AAAAC,QAAA,CAAAD,kBAAA;EAAAE,eAAA,EAAAA,CAAA,KAAAA,eAAA;EAAAC,wBAAA,EAAAA,CAAA,KAAAA,wBAAA;EAAAC,mBAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAX,YAAyC,CAAAK,kBAAA;AACzC,IAAAO,WAAA,GAAAC,OAAwB;AACxB,IAAAC,gBAAuB,GAAAD,OAAA;AAEvB,IAAAE,aAAM,GAAAF,OAAA,mBAAwB;AAEvB,IAAAG,qBAAM,mBAAsB;AAAe,IAChDP,mBAAM,OAAAG,WAAA,CAAAK,MAAA,EAAAF,aAAA,CAAAG,MAAA;EACNC,IAAA,EAAAH,qBAAQ;EAERI,MAAA,UAAU;EAAAC,QACR;IAAUC,QACR,EAAO;MAAAC,KACL;QACAC,IAAA;QACAC,YAAA,KAAiB;QACjBC,eAAY;QACZC,UAAA,UAAgB;QAChBC,cAAa;QACbC,WAAA,EAAa;QACbC,WAAS;QAETC,OAAA;QAAYC,UACV;UACAF,WAAA,qBAAiB;UACnBJ,eAAA;QAEA;QAAYO,UACV;UACAH,WAAA,qBAAiB;UACnBJ,eAAA;QAEA;QAAmBQ,iBACH;UACdC,YAAA,EAAc;UACdC,YAAA,EAAc;UAChBC,YAAA;QAEA;QAAYC,UACV;UACAR,WAAA,qBAAiB;UACnBJ,eAAA;QACF;MACF;IAEA;IAAUa,QACF;MAAAC,IACJ;QACAC,aAAY;QACZC,UAAQ;QAERC,MAAA,eAAY;QAAAX,UACV;UACAF,WAAA,gBAAiB;UACnBJ,eAAA;QAEA;QAAYY,UACV;UACAR,WAAA,gBAAiB;UACnBJ,eAAA;QAEA;QAAmBQ,iBACH;UAChBE,YAAA;QACF;MACF;IAEA;IAAMZ,IACJ;MACE,SAAM,WAAAoB,CAAYxC,KAAA,EAAAyC,KAAA;QAAA;UAChBC;QAAA,IAAAD,KAAA;QACF,IAAAE,gBAAA;QACA,IAAAvB,IAAO,GAAAwB,IAAA,CAAAC,KAAA,KAAArC,WAAA,CAAAsC,gBAAA,MAAApC,gBAAA,CAAAqC,OAAA,EAAA/C,KAAA,OAAA2C,gBAAA,GAAAD,KAAA,2BAAAC,gBAAA,cAAAA,gBAAA;QAAA,OACL;UACAK,KAAA,EAAA5B,IAAQ;UACV6B,MAAA,EAAA7B;QACF;MACF;IACF;EAEA;EAAiB8B,eACL;IACZhC,QAAA,EAAAiC,OAAA,CAAAC,GAAA,CAAAC,YAAA;EACD;AAED;AAEO,IAAAC,0BAAM,wBAA2B;AAAe,IACrDlD,wBAAM,OAAAI,WAAA,CAAAK,MAAA,EAAAF,aAAA,CAAAG,MAAA;EAENC,IAAA,EAAAuC,0BAAU;EAAArC,QACR;IAAUC,QACR,EAAO;MAAAC,KACL;QACA6B,KAAA,OAAQ;QACRC,MAAA;QACA5B,YAAA,KAAiB;QACjBC,eAAY;QACdiC,UAAA;MACF;IACF;EAEA;EAAiBL,eACL;IACZhC,QAAA,EAAAiC,OAAA,CAAAC,GAAA,CAAAC,YAAA;EACD;AAED;AAEO,IAAAG,gBAAM,eAAkB;AAAe,IAC5CrD,eAAM,OAAAK,WAAA,CAAAK,MAAA,EAAAF,aAAA,CAAAG,MAAA;EAENC,IAAA,EAAAyC,gBAAU;EAAAvC,QACR;IAAawC,WACX;MAAYC,UACV;QACAC,aAAA,OAAgB;QAClBC,cAAA;MACA;MAAUC,QACR;QACAF,aAAA,UAAgB;QAClBC,cAAA;MACF;IACF;EACD","ignoreList":[]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
14
|
+
get: () => from[key],
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
+
value: true
|
|
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("@hanzogui/core");
|
|
29
|
+
const RadioGroupStyledContext = (0, import_core.createStyledContext)({
|
|
30
|
+
size: "$true",
|
|
31
|
+
scaleIcon: 1
|
|
32
|
+
}, "RadioGroup");
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
+
get: () => from[key],
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
23
|
+
value: true
|
|
24
|
+
}), mod);
|
|
25
|
+
var RadioGroupStyledContext_exports = {};
|
|
26
|
+
__export(RadioGroupStyledContext_exports, {
|
|
27
|
+
RadioGroupStyledContext: () => RadioGroupStyledContext
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(RadioGroupStyledContext_exports);
|
|
30
|
+
var import_core = require("@hanzogui/core");
|
|
31
|
+
var RadioGroupStyledContext = (0, import_core.createStyledContext)({
|
|
32
|
+
size: "$true",
|
|
33
|
+
scaleIcon: 1
|
|
34
|
+
}, "RadioGroup");
|
|
35
|
+
//# sourceMappingURL=RadioGroupStyledContext.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","RadioGroupStyledContext_exports","__export","RadioGroupStyledContext","module","exports","import_core","require","createStyledContext","size","scaleIcon"],"sources":["../../src/RadioGroupStyledContext.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,+BAAA;AAAAC,QAAA,CAAAD,+BAAA;EAAAE,uBAAA,EAAAA,CAAA,KAAAA;AAAA;AACAC,MAAA,CAAAC,OAAA,GAAAT,YAAoC,CAAAK,+BAAA;AAE7B,IAAAK,WAAM,GAAAC,OAAA,iBAA0B;AAAA,IACrCJ,uBAAA,OAAAG,WAAA,CAAAE,mBAAA;EAAAC,IACE,SAAM;EAAAC,SACN;AAAW,GACb","ignoreList":[]}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
+
get: () => from[key],
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
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: true
|
|
30
|
+
}) : target, mod));
|
|
31
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
32
|
+
value: true
|
|
33
|
+
}), mod);
|
|
34
|
+
var createRadioGroup_exports = {};
|
|
35
|
+
__export(createRadioGroup_exports, {
|
|
36
|
+
createRadioGroup: () => createRadioGroup
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(createRadioGroup_exports);
|
|
39
|
+
var import_core = require("@hanzogui/core");
|
|
40
|
+
var import_radio_headless = require("@hanzogui/radio-headless");
|
|
41
|
+
var import_roving_focus = require("@hanzogui/roving-focus");
|
|
42
|
+
var import_react = __toESM(require("react"), 1);
|
|
43
|
+
var import_RadioGroup = require("./RadioGroup.cjs");
|
|
44
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
45
|
+
const ensureContext = x => {
|
|
46
|
+
if (!x.context) {
|
|
47
|
+
x.context = RadioGroupContext;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const RadioGroupContext = import_react.default.createContext({});
|
|
51
|
+
const RadioGroupItemContext = import_react.default.createContext({
|
|
52
|
+
checked: false,
|
|
53
|
+
disabled: false
|
|
54
|
+
});
|
|
55
|
+
function createRadioGroup(createProps) {
|
|
56
|
+
const {
|
|
57
|
+
disableActiveTheme,
|
|
58
|
+
Frame = import_RadioGroup.RadioGroupFrame,
|
|
59
|
+
Indicator = import_RadioGroup.RadioGroupIndicatorFrame,
|
|
60
|
+
Item = import_RadioGroup.RadioGroupItemFrame
|
|
61
|
+
} = createProps;
|
|
62
|
+
ensureContext(Frame);
|
|
63
|
+
ensureContext(Indicator);
|
|
64
|
+
ensureContext(Item);
|
|
65
|
+
const RadioGroupImp = Frame.styleable((props, ref) => {
|
|
66
|
+
const {
|
|
67
|
+
value,
|
|
68
|
+
defaultValue,
|
|
69
|
+
onValueChange,
|
|
70
|
+
required = false,
|
|
71
|
+
disabled = false,
|
|
72
|
+
name,
|
|
73
|
+
native,
|
|
74
|
+
accentColor,
|
|
75
|
+
orientation = "vertical",
|
|
76
|
+
...rest
|
|
77
|
+
} = props;
|
|
78
|
+
const {
|
|
79
|
+
providerValue,
|
|
80
|
+
frameAttrs,
|
|
81
|
+
rovingFocusGroupAttrs
|
|
82
|
+
} = (0, import_radio_headless.useRadioGroup)({
|
|
83
|
+
orientation,
|
|
84
|
+
name,
|
|
85
|
+
defaultValue,
|
|
86
|
+
value,
|
|
87
|
+
onValueChange,
|
|
88
|
+
required,
|
|
89
|
+
disabled,
|
|
90
|
+
native,
|
|
91
|
+
accentColor
|
|
92
|
+
});
|
|
93
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(RadioGroupContext.Provider, {
|
|
94
|
+
value: providerValue,
|
|
95
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_roving_focus.RovingFocusGroup, {
|
|
96
|
+
...rovingFocusGroupAttrs,
|
|
97
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_RadioGroup.RadioGroupFrame, {
|
|
98
|
+
...frameAttrs,
|
|
99
|
+
ref,
|
|
100
|
+
...rest
|
|
101
|
+
})
|
|
102
|
+
})
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
const RadioGroupItemImp = Item.styleable((props, ref) => {
|
|
106
|
+
const {
|
|
107
|
+
value,
|
|
108
|
+
labelledBy,
|
|
109
|
+
onPress,
|
|
110
|
+
onKeyDown,
|
|
111
|
+
disabled,
|
|
112
|
+
id,
|
|
113
|
+
...rest
|
|
114
|
+
} = props;
|
|
115
|
+
const {
|
|
116
|
+
providerValue,
|
|
117
|
+
bubbleInput,
|
|
118
|
+
rovingFocusGroupAttrs,
|
|
119
|
+
frameAttrs,
|
|
120
|
+
isFormControl,
|
|
121
|
+
native
|
|
122
|
+
} = (0, import_radio_headless.useRadioGroupItem)({
|
|
123
|
+
radioGroupContext: RadioGroupContext,
|
|
124
|
+
value,
|
|
125
|
+
id,
|
|
126
|
+
labelledBy,
|
|
127
|
+
disabled,
|
|
128
|
+
onPress,
|
|
129
|
+
onKeyDown
|
|
130
|
+
});
|
|
131
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(RadioGroupItemContext.Provider, {
|
|
132
|
+
value: providerValue,
|
|
133
|
+
children: import_core.isWeb && native ? bubbleInput : /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
134
|
+
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_roving_focus.RovingFocusGroup.Item, {
|
|
135
|
+
...rovingFocusGroupAttrs,
|
|
136
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_RadioGroup.RadioGroupItemFrame, {
|
|
137
|
+
...frameAttrs,
|
|
138
|
+
ref,
|
|
139
|
+
...rest
|
|
140
|
+
})
|
|
141
|
+
}), isFormControl && bubbleInput]
|
|
142
|
+
})
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
RadioGroupItemImp.displayName = "RadioGroupItem";
|
|
146
|
+
const RadioIndicator = Indicator.styleable((props, forwardedRef) => {
|
|
147
|
+
const {
|
|
148
|
+
forceMount,
|
|
149
|
+
disabled,
|
|
150
|
+
...indicatorProps
|
|
151
|
+
} = props;
|
|
152
|
+
const {
|
|
153
|
+
checked,
|
|
154
|
+
...useIndicatorRest
|
|
155
|
+
} = (0, import_radio_headless.useRadioGroupItemIndicator)({
|
|
156
|
+
radioGroupItemContext: RadioGroupItemContext,
|
|
157
|
+
disabled
|
|
158
|
+
});
|
|
159
|
+
if (forceMount || checked) {
|
|
160
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(Indicator, {
|
|
161
|
+
...useIndicatorRest,
|
|
162
|
+
ref: forwardedRef,
|
|
163
|
+
...indicatorProps
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
return null;
|
|
167
|
+
});
|
|
168
|
+
RadioIndicator.displayName = "RadioIndicator";
|
|
169
|
+
const RadioGroup = (0, import_core.withStaticProperties)(RadioGroupImp, {
|
|
170
|
+
Item: RadioGroupItemImp,
|
|
171
|
+
Indicator: RadioIndicator
|
|
172
|
+
});
|
|
173
|
+
RadioGroup.displayName = "RadioGroup";
|
|
174
|
+
return RadioGroup;
|
|
175
|
+
}
|