@cerberus-design/react 0.15.0-next-5d7dc1e → 0.15.0-next-544221f
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/build/legacy/_tsup-dts-rollup.d.cts +131 -28
- package/build/legacy/components/radio/index.cjs +143 -0
- package/build/legacy/components/radio/index.cjs.map +1 -0
- package/build/legacy/components/radio/parts.cjs +113 -0
- package/build/legacy/components/radio/parts.cjs.map +1 -0
- package/build/legacy/components/radio/primitives.cjs +115 -0
- package/build/legacy/components/radio/primitives.cjs.map +1 -0
- package/build/legacy/components/radio/radio.cjs +82 -0
- package/build/legacy/components/radio/radio.cjs.map +1 -0
- package/build/legacy/index.cjs +250 -173
- package/build/legacy/index.cjs.map +1 -1
- package/build/modern/_tsup-dts-rollup.d.ts +131 -28
- package/build/modern/chunk-5RTNSVYU.js +88 -0
- package/build/modern/chunk-5RTNSVYU.js.map +1 -0
- package/build/modern/chunk-FUL2VRDU.js +25 -0
- package/build/modern/chunk-FUL2VRDU.js.map +1 -0
- package/build/modern/chunk-OGYMMATX.js +1 -0
- package/build/modern/{chunk-FK52US7K.js → chunk-RHCTPSKT.js} +7 -7
- package/build/modern/chunk-STLN7BMJ.js +22 -0
- package/build/modern/chunk-STLN7BMJ.js.map +1 -0
- package/build/modern/{chunk-CF3EHG42.js → chunk-ZFFW5ELD.js} +4 -4
- package/build/modern/components/AccordionItemGroup.js +1 -1
- package/build/modern/components/DatePicker.client.js +3 -3
- package/build/modern/components/FileStatus.js +2 -2
- package/build/modern/components/radio/index.js +30 -0
- package/build/modern/components/radio/index.js.map +1 -0
- package/build/modern/components/radio/parts.js +8 -0
- package/build/modern/components/radio/parts.js.map +1 -0
- package/build/modern/components/radio/primitives.js +21 -0
- package/build/modern/components/radio/primitives.js.map +1 -0
- package/build/modern/components/radio/radio.js +8 -0
- package/build/modern/components/radio/radio.js.map +1 -0
- package/build/modern/context/confirm-modal.js +1 -1
- package/build/modern/context/cta-modal.js +2 -2
- package/build/modern/context/notification-center.js +1 -1
- package/build/modern/context/prompt-modal.js +1 -1
- package/build/modern/index.js +83 -60
- package/build/modern/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/radio/index.ts +3 -0
- package/src/components/radio/parts.ts +65 -0
- package/src/components/radio/primitives.tsx +123 -0
- package/src/components/radio/radio.tsx +35 -0
- package/src/index.ts +1 -1
- package/build/legacy/components/Radio.cjs +0 -64
- package/build/legacy/components/Radio.cjs.map +0 -1
- package/build/modern/chunk-6WOJAMZV.js +0 -40
- package/build/modern/chunk-6WOJAMZV.js.map +0 -1
- package/build/modern/components/Radio.js +0 -7
- package/src/components/Radio.tsx +0 -68
- /package/build/modern/{components/Radio.js.map → chunk-OGYMMATX.js.map} +0 -0
- /package/build/modern/{chunk-FK52US7K.js.map → chunk-RHCTPSKT.js.map} +0 -0
- /package/build/modern/{chunk-CF3EHG42.js.map → chunk-ZFFW5ELD.js.map} +0 -0
|
@@ -131,9 +131,16 @@ import { PProps } from '@cerberus/styled-system/jsx';
|
|
|
131
131
|
import type { Pretty } from '@cerberus/styled-system/types';
|
|
132
132
|
import { ProgressBarVariantProps } from '@cerberus/styled-system/recipes';
|
|
133
133
|
import { PropsWithChildren } from 'react';
|
|
134
|
-
import {
|
|
134
|
+
import { RadioGroupIndicatorProps } from '@ark-ui/react/radio-group';
|
|
135
|
+
import { RadioGroupItemControlProps } from '@ark-ui/react/radio-group';
|
|
136
|
+
import { RadioGroupItemHiddenInputProps } from '@ark-ui/react/radio-group';
|
|
137
|
+
import { RadioGroupItemProps } from '@ark-ui/react/radio-group';
|
|
138
|
+
import type { RadioGroupItemProps as RadioGroupItemProps_2 } from '@ark-ui/react';
|
|
139
|
+
import { RadioGroupItemTextProps } from '@ark-ui/react/radio-group';
|
|
140
|
+
import { RadioGroupLabelProps } from '@ark-ui/react/radio-group';
|
|
141
|
+
import { RadioGroupRootProps } from '@ark-ui/react/radio-group';
|
|
142
|
+
import { RadioGroupVariantProps } from '@cerberus/styled-system/recipes';
|
|
135
143
|
import { ReactNode } from 'react';
|
|
136
|
-
import type { RecipeVariantProps } from '@cerberus/styled-system/types';
|
|
137
144
|
import { rectIntersection } from '@dnd-kit/core';
|
|
138
145
|
import { RefAttributes } from 'react';
|
|
139
146
|
import { RefObject } from 'react';
|
|
@@ -3207,45 +3214,141 @@ export { PromptShowResult as PromptShowResult_alias_1 }
|
|
|
3207
3214
|
* @memberof module:Field
|
|
3208
3215
|
* @example
|
|
3209
3216
|
* ```tsx
|
|
3210
|
-
* <
|
|
3211
|
-
* <fieldset name="fruit">
|
|
3212
|
-
* <Radio id="radio-1" name="fruit" value="1">
|
|
3213
|
-
* Option 1
|
|
3214
|
-
* </Radio>
|
|
3215
|
-
* <Radio id="radio-2" name="fruit" value="2">
|
|
3216
|
-
* Option 2
|
|
3217
|
-
* </Radio>
|
|
3218
|
-
* <Radio id="radio-3" name="fruit" value="3">
|
|
3219
|
-
* Option 3
|
|
3220
|
-
* </Radio>
|
|
3221
|
-
* </fieldset>
|
|
3222
|
-
* </Field>
|
|
3217
|
+
* <Radio value="option1">Option 1</Radio>
|
|
3223
3218
|
* ```
|
|
3224
3219
|
*/
|
|
3225
|
-
declare function Radio(props:
|
|
3220
|
+
declare function Radio(props: RadioProps): JSX_2.Element;
|
|
3226
3221
|
export { Radio }
|
|
3227
3222
|
export { Radio as Radio_alias_1 }
|
|
3223
|
+
export { Radio as Radio_alias_2 }
|
|
3224
|
+
|
|
3225
|
+
declare const RadioGroup: typeof RadioGroupRoot;
|
|
3226
|
+
export { RadioGroup }
|
|
3227
|
+
export { RadioGroup as RadioGroup_alias_1 }
|
|
3228
|
+
export { RadioGroup as RadioGroup_alias_2 }
|
|
3229
|
+
|
|
3230
|
+
/**
|
|
3231
|
+
* The RadioGroupIndicator component is used to indicate the selected radio
|
|
3232
|
+
* button in a group.
|
|
3233
|
+
*/
|
|
3234
|
+
declare function RadioGroupIndicator(props: RadioGroupIndicatorProps): JSX_2.Element;
|
|
3235
|
+
export { RadioGroupIndicator }
|
|
3236
|
+
export { RadioGroupIndicator as RadioGroupIndicator_alias_1 }
|
|
3237
|
+
export { RadioGroupIndicator as RadioGroupIndicator_alias_2 }
|
|
3238
|
+
|
|
3239
|
+
/**
|
|
3240
|
+
* The RadioGroupItem component is used to render a single radio button in a
|
|
3241
|
+
* group.
|
|
3242
|
+
*/
|
|
3243
|
+
declare function RadioGroupItem(props: RadioGroupItemProps): JSX_2.Element;
|
|
3244
|
+
export { RadioGroupItem }
|
|
3245
|
+
export { RadioGroupItem as RadioGroupItem_alias_1 }
|
|
3246
|
+
export { RadioGroupItem as RadioGroupItem_alias_2 }
|
|
3247
|
+
|
|
3248
|
+
/**
|
|
3249
|
+
* The RadioGroupItemControl component is used to render the control for a
|
|
3250
|
+
* single radio button in a group.
|
|
3251
|
+
*/
|
|
3252
|
+
declare function RadioGroupItemControl(props: RadioGroupItemControlProps & RadioGroupVariantProps): JSX_2.Element;
|
|
3253
|
+
export { RadioGroupItemControl }
|
|
3254
|
+
export { RadioGroupItemControl as RadioGroupItemControl_alias_1 }
|
|
3255
|
+
export { RadioGroupItemControl as RadioGroupItemControl_alias_2 }
|
|
3256
|
+
|
|
3257
|
+
/**
|
|
3258
|
+
* The RadioGroupItemHiddenInput component is used to render the hidden input
|
|
3259
|
+
* for a single radio button in a group.
|
|
3260
|
+
*/
|
|
3261
|
+
declare function RadioGroupItemHiddenInput(props: RadioGroupItemHiddenInputProps): JSX_2.Element;
|
|
3262
|
+
export { RadioGroupItemHiddenInput }
|
|
3263
|
+
export { RadioGroupItemHiddenInput as RadioGroupItemHiddenInput_alias_1 }
|
|
3264
|
+
export { RadioGroupItemHiddenInput as RadioGroupItemHiddenInput_alias_2 }
|
|
3228
3265
|
|
|
3229
|
-
|
|
3266
|
+
/**
|
|
3267
|
+
* The RadioGroupItemText component is used to render the text label for a
|
|
3268
|
+
* single radio button in a group.
|
|
3269
|
+
*/
|
|
3270
|
+
declare function RadioGroupItemText(props: RadioGroupItemTextProps & RadioGroupVariantProps): JSX_2.Element;
|
|
3271
|
+
export { RadioGroupItemText }
|
|
3272
|
+
export { RadioGroupItemText as RadioGroupItemText_alias_1 }
|
|
3273
|
+
export { RadioGroupItemText as RadioGroupItemText_alias_2 }
|
|
3274
|
+
|
|
3275
|
+
/**
|
|
3276
|
+
* The RadioGroupLabel component is used to label a group of radio buttons.
|
|
3277
|
+
*/
|
|
3278
|
+
declare function RadioGroupLabel(props: RadioGroupLabelProps): JSX_2.Element;
|
|
3279
|
+
export { RadioGroupLabel }
|
|
3280
|
+
export { RadioGroupLabel as RadioGroupLabel_alias_1 }
|
|
3281
|
+
export { RadioGroupLabel as RadioGroupLabel_alias_2 }
|
|
3282
|
+
|
|
3283
|
+
/**
|
|
3284
|
+
* This module contains the Radio primitives
|
|
3285
|
+
* @module 'react/radio'
|
|
3286
|
+
*/
|
|
3287
|
+
/**
|
|
3288
|
+
* The RadioGroupRoot component is used to group radio buttons together.
|
|
3289
|
+
*/
|
|
3290
|
+
declare function RadioGroupRoot(props: RadioGroupRootProps & RadioGroupVariantProps): JSX_2.Element;
|
|
3291
|
+
export { RadioGroupRoot }
|
|
3292
|
+
export { RadioGroupRoot as RadioGroupRoot_alias_1 }
|
|
3293
|
+
export { RadioGroupRoot as RadioGroupRoot_alias_2 }
|
|
3294
|
+
|
|
3295
|
+
/**
|
|
3296
|
+
* An Object containing the parts of the Radio component. For users that
|
|
3297
|
+
* prefer Object component syntax.
|
|
3298
|
+
*
|
|
3299
|
+
* @remarks
|
|
3300
|
+
*
|
|
3301
|
+
* When using object component syntax, you import the RadioParts object and
|
|
3302
|
+
* the entire family of components vs. only what you use.
|
|
3303
|
+
*/
|
|
3304
|
+
declare const RadioParts: RadioPartsValue;
|
|
3305
|
+
export { RadioParts }
|
|
3306
|
+
export { RadioParts as RadioParts_alias_1 }
|
|
3307
|
+
export { RadioParts as RadioParts_alias_2 }
|
|
3308
|
+
|
|
3309
|
+
/**
|
|
3310
|
+
* This module contains the parts of the Radio parts.
|
|
3311
|
+
* @module 'radio/parts'
|
|
3312
|
+
*/
|
|
3313
|
+
declare interface RadioPartsValue {
|
|
3230
3314
|
/**
|
|
3231
|
-
*
|
|
3315
|
+
* The container of the field.
|
|
3232
3316
|
*/
|
|
3233
|
-
|
|
3317
|
+
Root: ElementType;
|
|
3318
|
+
/**
|
|
3319
|
+
* The label of the field.
|
|
3320
|
+
*/
|
|
3321
|
+
Label: ElementType;
|
|
3322
|
+
/**
|
|
3323
|
+
* The indicator that appears when a radio is checked.
|
|
3324
|
+
*/
|
|
3325
|
+
Indicator: ElementType;
|
|
3326
|
+
/**
|
|
3327
|
+
* An individual radio item of the field.
|
|
3328
|
+
*/
|
|
3329
|
+
Item: ElementType;
|
|
3330
|
+
/**
|
|
3331
|
+
* The text that labels a single radio of the field.
|
|
3332
|
+
*/
|
|
3333
|
+
ItemText: ElementType;
|
|
3334
|
+
/**
|
|
3335
|
+
* The visual radio control of the field.
|
|
3336
|
+
*/
|
|
3337
|
+
ItemControl: ElementType;
|
|
3338
|
+
/**
|
|
3339
|
+
* The native input for a radio item in the field.
|
|
3340
|
+
*/
|
|
3341
|
+
ItemHiddenInput: ElementType;
|
|
3234
3342
|
}
|
|
3235
|
-
export { RadioBaseProps }
|
|
3236
|
-
export { RadioBaseProps as RadioBaseProps_alias_1 }
|
|
3237
|
-
|
|
3238
|
-
declare type RadioProps = RadioBaseProps & RadioRecipe;
|
|
3239
|
-
export { RadioProps }
|
|
3240
|
-
export { RadioProps as RadioProps_alias_1 }
|
|
3241
3343
|
|
|
3242
3344
|
/**
|
|
3243
3345
|
* This module contains the Radio component.
|
|
3244
3346
|
* @module
|
|
3245
3347
|
*/
|
|
3246
|
-
declare type
|
|
3247
|
-
export {
|
|
3248
|
-
export {
|
|
3348
|
+
declare type RadioProps = RadioGroupVariantProps & RadioGroupItemProps_2;
|
|
3349
|
+
export { RadioProps }
|
|
3350
|
+
export { RadioProps as RadioProps_alias_1 }
|
|
3351
|
+
export { RadioProps as RadioProps_alias_2 }
|
|
3249
3352
|
|
|
3250
3353
|
/**
|
|
3251
3354
|
* The input component for the DatePicker that uses ranges.
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/components/radio/index.ts
|
|
21
|
+
var radio_exports = {};
|
|
22
|
+
__export(radio_exports, {
|
|
23
|
+
Radio: () => Radio,
|
|
24
|
+
RadioGroup: () => RadioGroup,
|
|
25
|
+
RadioGroupIndicator: () => RadioGroupIndicator,
|
|
26
|
+
RadioGroupItem: () => RadioGroupItem,
|
|
27
|
+
RadioGroupItemControl: () => RadioGroupItemControl,
|
|
28
|
+
RadioGroupItemHiddenInput: () => RadioGroupItemHiddenInput,
|
|
29
|
+
RadioGroupItemText: () => RadioGroupItemText,
|
|
30
|
+
RadioGroupLabel: () => RadioGroupLabel,
|
|
31
|
+
RadioGroupRoot: () => RadioGroupRoot,
|
|
32
|
+
RadioParts: () => RadioParts
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(radio_exports);
|
|
35
|
+
|
|
36
|
+
// src/components/radio/primitives.tsx
|
|
37
|
+
var import_radio_group = require("@ark-ui/react/radio-group");
|
|
38
|
+
var import_css = require("@cerberus/styled-system/css");
|
|
39
|
+
var import_recipes = require("@cerberus/styled-system/recipes");
|
|
40
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
41
|
+
function RadioGroupRoot(props) {
|
|
42
|
+
const { size, orientation, ...rootProps } = props;
|
|
43
|
+
const styles = (0, import_recipes.radioGroup)({ size, orientation });
|
|
44
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
45
|
+
import_radio_group.RadioGroup.Root,
|
|
46
|
+
{
|
|
47
|
+
...rootProps,
|
|
48
|
+
className: (0, import_css.cx)(styles.root, rootProps.className)
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
function RadioGroupLabel(props) {
|
|
53
|
+
const styles = (0, import_recipes.radioGroup)();
|
|
54
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
55
|
+
import_radio_group.RadioGroup.Label,
|
|
56
|
+
{
|
|
57
|
+
...props,
|
|
58
|
+
className: (0, import_css.cx)(styles.label, props.className)
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
function RadioGroupIndicator(props) {
|
|
63
|
+
const styles = (0, import_recipes.radioGroup)();
|
|
64
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
65
|
+
import_radio_group.RadioGroup.Indicator,
|
|
66
|
+
{
|
|
67
|
+
...props,
|
|
68
|
+
className: (0, import_css.cx)(styles.indicator, props.className)
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
function RadioGroupItem(props) {
|
|
73
|
+
const styles = (0, import_recipes.radioGroup)();
|
|
74
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
75
|
+
import_radio_group.RadioGroup.Item,
|
|
76
|
+
{
|
|
77
|
+
...props,
|
|
78
|
+
className: (0, import_css.cx)(styles.item, props.className)
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
function RadioGroupItemText(props) {
|
|
83
|
+
const { size, orientation, ...itemTextProps } = props;
|
|
84
|
+
const styles = (0, import_recipes.radioGroup)({ size, orientation });
|
|
85
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
86
|
+
import_radio_group.RadioGroup.ItemText,
|
|
87
|
+
{
|
|
88
|
+
...itemTextProps,
|
|
89
|
+
className: (0, import_css.cx)(styles.itemText, itemTextProps.className)
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
function RadioGroupItemControl(props) {
|
|
94
|
+
const { size, orientation, ...itemControlProps } = props;
|
|
95
|
+
const styles = (0, import_recipes.radioGroup)({ size, orientation });
|
|
96
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
97
|
+
import_radio_group.RadioGroup.ItemControl,
|
|
98
|
+
{
|
|
99
|
+
...itemControlProps,
|
|
100
|
+
className: (0, import_css.cx)(styles.itemControl, itemControlProps.className)
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
function RadioGroupItemHiddenInput(props) {
|
|
105
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_radio_group.RadioGroup.ItemHiddenInput, { ...props });
|
|
106
|
+
}
|
|
107
|
+
var RadioGroup = RadioGroupRoot;
|
|
108
|
+
|
|
109
|
+
// src/components/radio/parts.ts
|
|
110
|
+
var RadioParts = {
|
|
111
|
+
Root: RadioGroupRoot,
|
|
112
|
+
Label: RadioGroupLabel,
|
|
113
|
+
Indicator: RadioGroupIndicator,
|
|
114
|
+
Item: RadioGroupItem,
|
|
115
|
+
ItemText: RadioGroupItemText,
|
|
116
|
+
ItemControl: RadioGroupItemControl,
|
|
117
|
+
ItemHiddenInput: RadioGroupItemHiddenInput
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
// src/components/radio/radio.tsx
|
|
121
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
122
|
+
function Radio(props) {
|
|
123
|
+
const { size, children, ...groupProps } = props;
|
|
124
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(RadioGroupItem, { ...groupProps, children: [
|
|
125
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(RadioGroupItemControl, { size }),
|
|
126
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(RadioGroupItemText, { size, children }),
|
|
127
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(RadioGroupItemHiddenInput, {})
|
|
128
|
+
] });
|
|
129
|
+
}
|
|
130
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
131
|
+
0 && (module.exports = {
|
|
132
|
+
Radio,
|
|
133
|
+
RadioGroup,
|
|
134
|
+
RadioGroupIndicator,
|
|
135
|
+
RadioGroupItem,
|
|
136
|
+
RadioGroupItemControl,
|
|
137
|
+
RadioGroupItemHiddenInput,
|
|
138
|
+
RadioGroupItemText,
|
|
139
|
+
RadioGroupLabel,
|
|
140
|
+
RadioGroupRoot,
|
|
141
|
+
RadioParts
|
|
142
|
+
});
|
|
143
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/radio/index.ts","../../../../src/components/radio/primitives.tsx","../../../../src/components/radio/parts.ts","../../../../src/components/radio/radio.tsx"],"sourcesContent":["export * from './parts'\nexport * from './primitives'\nexport * from './radio'\n","import {\n RadioGroup as ArkRadioGroup,\n type RadioGroupIndicatorProps,\n type RadioGroupItemControlProps,\n type RadioGroupItemHiddenInputProps,\n type RadioGroupItemProps,\n type RadioGroupItemTextProps,\n type RadioGroupLabelProps,\n type RadioGroupRootProps,\n} from '@ark-ui/react/radio-group'\nimport { cx } from '@cerberus/styled-system/css'\nimport {\n radioGroup,\n type RadioGroupVariantProps,\n} from '@cerberus/styled-system/recipes'\n\n/**\n * This module contains the Radio primitives\n * @module 'react/radio'\n */\n\n/**\n * The RadioGroupRoot component is used to group radio buttons together.\n */\nexport function RadioGroupRoot(\n props: RadioGroupRootProps & RadioGroupVariantProps,\n) {\n const { size, orientation, ...rootProps } = props\n const styles = radioGroup({ size, orientation })\n return (\n <ArkRadioGroup.Root\n {...rootProps}\n className={cx(styles.root, rootProps.className)}\n />\n )\n}\n\n/**\n * The RadioGroupLabel component is used to label a group of radio buttons.\n */\nexport function RadioGroupLabel(props: RadioGroupLabelProps) {\n const styles = radioGroup()\n return (\n <ArkRadioGroup.Label\n {...props}\n className={cx(styles.label, props.className)}\n />\n )\n}\n\n/**\n * The RadioGroupIndicator component is used to indicate the selected radio\n * button in a group.\n */\nexport function RadioGroupIndicator(props: RadioGroupIndicatorProps) {\n const styles = radioGroup()\n return (\n <ArkRadioGroup.Indicator\n {...props}\n className={cx(styles.indicator, props.className)}\n />\n )\n}\n\n/**\n * The RadioGroupItem component is used to render a single radio button in a\n * group.\n */\nexport function RadioGroupItem(props: RadioGroupItemProps) {\n const styles = radioGroup()\n return (\n <ArkRadioGroup.Item\n {...props}\n className={cx(styles.item, props.className)}\n />\n )\n}\n\n/**\n * The RadioGroupItemText component is used to render the text label for a\n * single radio button in a group.\n */\nexport function RadioGroupItemText(\n props: RadioGroupItemTextProps & RadioGroupVariantProps,\n) {\n const { size, orientation, ...itemTextProps } = props\n const styles = radioGroup({ size, orientation })\n return (\n <ArkRadioGroup.ItemText\n {...itemTextProps}\n className={cx(styles.itemText, itemTextProps.className)}\n />\n )\n}\n\n/**\n * The RadioGroupItemControl component is used to render the control for a\n * single radio button in a group.\n */\nexport function RadioGroupItemControl(\n props: RadioGroupItemControlProps & RadioGroupVariantProps,\n) {\n const { size, orientation, ...itemControlProps } = props\n const styles = radioGroup({ size, orientation })\n return (\n <ArkRadioGroup.ItemControl\n {...itemControlProps}\n className={cx(styles.itemControl, itemControlProps.className)}\n />\n )\n}\n\n/**\n * The RadioGroupItemHiddenInput component is used to render the hidden input\n * for a single radio button in a group.\n */\nexport function RadioGroupItemHiddenInput(\n props: RadioGroupItemHiddenInputProps,\n) {\n return <ArkRadioGroup.ItemHiddenInput {...props} />\n}\n\nexport const RadioGroup = RadioGroupRoot\n","import type { ElementType } from 'react'\nimport {\n RadioGroupRoot,\n RadioGroupLabel,\n RadioGroupIndicator,\n RadioGroupItem,\n RadioGroupItemText,\n RadioGroupItemControl,\n RadioGroupItemHiddenInput,\n} from './primitives'\n\n/**\n * This module contains the parts of the Radio parts.\n * @module 'radio/parts'\n */\n\ninterface RadioPartsValue {\n /**\n * The container of the field.\n */\n Root: ElementType\n /**\n * The label of the field.\n */\n Label: ElementType\n /**\n * The indicator that appears when a radio is checked.\n */\n Indicator: ElementType\n /**\n * An individual radio item of the field.\n */\n Item: ElementType\n /**\n * The text that labels a single radio of the field.\n */\n ItemText: ElementType\n /**\n * The visual radio control of the field.\n */\n ItemControl: ElementType\n /**\n * The native input for a radio item in the field.\n */\n ItemHiddenInput: ElementType\n}\n\n/**\n * An Object containing the parts of the Radio component. For users that\n * prefer Object component syntax.\n *\n * @remarks\n *\n * When using object component syntax, you import the RadioParts object and\n * the entire family of components vs. only what you use.\n */\nexport const RadioParts: RadioPartsValue = {\n Root: RadioGroupRoot,\n Label: RadioGroupLabel,\n Indicator: RadioGroupIndicator,\n Item: RadioGroupItem,\n ItemText: RadioGroupItemText,\n ItemControl: RadioGroupItemControl,\n ItemHiddenInput: RadioGroupItemHiddenInput,\n}\n","import type { RadioGroupItemProps } from '@ark-ui/react'\nimport { type RadioGroupVariantProps } from '@cerberus/styled-system/recipes'\nimport {\n RadioGroupItem,\n RadioGroupItemControl,\n RadioGroupItemHiddenInput,\n RadioGroupItemText,\n} from './primitives'\n\n/**\n * This module contains the Radio component.\n * @module\n */\n\nexport type RadioProps = RadioGroupVariantProps & RadioGroupItemProps\n\n/**\n * The Radio component is used to allow users to select a single option from a list of options.\n * @see https://cerberus.digitalu.design/react/radio\n * @memberof module:Field\n * @example\n * ```tsx\n * <Radio value=\"option1\">Option 1</Radio>\n * ```\n */\nexport function Radio(props: RadioProps) {\n const { size, children, ...groupProps } = props\n return (\n <RadioGroupItem {...groupProps}>\n <RadioGroupItemControl size={size} />\n <RadioGroupItemText size={size}>{children}</RadioGroupItemText>\n <RadioGroupItemHiddenInput />\n </RadioGroupItem>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,yBASO;AACP,iBAAmB;AACnB,qBAGO;AAgBH;AANG,SAAS,eACd,OACA;AACA,QAAM,EAAE,MAAM,aAAa,GAAG,UAAU,IAAI;AAC5C,QAAM,aAAS,2BAAW,EAAE,MAAM,YAAY,CAAC;AAC/C,SACE;AAAA,IAAC,mBAAAA,WAAc;AAAA,IAAd;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,MAAM,UAAU,SAAS;AAAA;AAAA,EAChD;AAEJ;AAKO,SAAS,gBAAgB,OAA6B;AAC3D,QAAM,aAAS,2BAAW;AAC1B,SACE;AAAA,IAAC,mBAAAA,WAAc;AAAA,IAAd;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,OAAO,MAAM,SAAS;AAAA;AAAA,EAC7C;AAEJ;AAMO,SAAS,oBAAoB,OAAiC;AACnE,QAAM,aAAS,2BAAW;AAC1B,SACE;AAAA,IAAC,mBAAAA,WAAc;AAAA,IAAd;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,WAAW,MAAM,SAAS;AAAA;AAAA,EACjD;AAEJ;AAMO,SAAS,eAAe,OAA4B;AACzD,QAAM,aAAS,2BAAW;AAC1B,SACE;AAAA,IAAC,mBAAAA,WAAc;AAAA,IAAd;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG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PropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/components/radio/parts.ts
|
|
21
|
+
var parts_exports = {};
|
|
22
|
+
__export(parts_exports, {
|
|
23
|
+
RadioParts: () => RadioParts
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(parts_exports);
|
|
26
|
+
|
|
27
|
+
// src/components/radio/primitives.tsx
|
|
28
|
+
var import_radio_group = require("@ark-ui/react/radio-group");
|
|
29
|
+
var import_css = require("@cerberus/styled-system/css");
|
|
30
|
+
var import_recipes = require("@cerberus/styled-system/recipes");
|
|
31
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
32
|
+
function RadioGroupRoot(props) {
|
|
33
|
+
const { size, orientation, ...rootProps } = props;
|
|
34
|
+
const styles = (0, import_recipes.radioGroup)({ size, orientation });
|
|
35
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
36
|
+
import_radio_group.RadioGroup.Root,
|
|
37
|
+
{
|
|
38
|
+
...rootProps,
|
|
39
|
+
className: (0, import_css.cx)(styles.root, rootProps.className)
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
function RadioGroupLabel(props) {
|
|
44
|
+
const styles = (0, import_recipes.radioGroup)();
|
|
45
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
46
|
+
import_radio_group.RadioGroup.Label,
|
|
47
|
+
{
|
|
48
|
+
...props,
|
|
49
|
+
className: (0, import_css.cx)(styles.label, props.className)
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
function RadioGroupIndicator(props) {
|
|
54
|
+
const styles = (0, import_recipes.radioGroup)();
|
|
55
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
56
|
+
import_radio_group.RadioGroup.Indicator,
|
|
57
|
+
{
|
|
58
|
+
...props,
|
|
59
|
+
className: (0, import_css.cx)(styles.indicator, props.className)
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
function RadioGroupItem(props) {
|
|
64
|
+
const styles = (0, import_recipes.radioGroup)();
|
|
65
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
66
|
+
import_radio_group.RadioGroup.Item,
|
|
67
|
+
{
|
|
68
|
+
...props,
|
|
69
|
+
className: (0, import_css.cx)(styles.item, props.className)
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
function RadioGroupItemText(props) {
|
|
74
|
+
const { size, orientation, ...itemTextProps } = props;
|
|
75
|
+
const styles = (0, import_recipes.radioGroup)({ size, orientation });
|
|
76
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
77
|
+
import_radio_group.RadioGroup.ItemText,
|
|
78
|
+
{
|
|
79
|
+
...itemTextProps,
|
|
80
|
+
className: (0, import_css.cx)(styles.itemText, itemTextProps.className)
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
function RadioGroupItemControl(props) {
|
|
85
|
+
const { size, orientation, ...itemControlProps } = props;
|
|
86
|
+
const styles = (0, import_recipes.radioGroup)({ size, orientation });
|
|
87
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
88
|
+
import_radio_group.RadioGroup.ItemControl,
|
|
89
|
+
{
|
|
90
|
+
...itemControlProps,
|
|
91
|
+
className: (0, import_css.cx)(styles.itemControl, itemControlProps.className)
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
function RadioGroupItemHiddenInput(props) {
|
|
96
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_radio_group.RadioGroup.ItemHiddenInput, { ...props });
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// src/components/radio/parts.ts
|
|
100
|
+
var RadioParts = {
|
|
101
|
+
Root: RadioGroupRoot,
|
|
102
|
+
Label: RadioGroupLabel,
|
|
103
|
+
Indicator: RadioGroupIndicator,
|
|
104
|
+
Item: RadioGroupItem,
|
|
105
|
+
ItemText: RadioGroupItemText,
|
|
106
|
+
ItemControl: RadioGroupItemControl,
|
|
107
|
+
ItemHiddenInput: RadioGroupItemHiddenInput
|
|
108
|
+
};
|
|
109
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
110
|
+
0 && (module.exports = {
|
|
111
|
+
RadioParts
|
|
112
|
+
});
|
|
113
|
+
//# sourceMappingURL=parts.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/radio/parts.ts","../../../../src/components/radio/primitives.tsx"],"sourcesContent":["import type { ElementType } from 'react'\nimport {\n RadioGroupRoot,\n RadioGroupLabel,\n RadioGroupIndicator,\n RadioGroupItem,\n RadioGroupItemText,\n RadioGroupItemControl,\n RadioGroupItemHiddenInput,\n} from './primitives'\n\n/**\n * This module contains the parts of the Radio parts.\n * @module 'radio/parts'\n */\n\ninterface RadioPartsValue {\n /**\n * The container of the field.\n */\n Root: ElementType\n /**\n * The label of the field.\n */\n Label: ElementType\n /**\n * The indicator that appears when a radio is checked.\n */\n Indicator: ElementType\n /**\n * An individual radio item of the field.\n */\n Item: ElementType\n /**\n * The text that labels a single radio of the field.\n */\n ItemText: ElementType\n /**\n * The visual radio control of the field.\n */\n ItemControl: ElementType\n /**\n * The native input for a radio item in the field.\n */\n ItemHiddenInput: ElementType\n}\n\n/**\n * An Object containing the parts of the Radio component. For users that\n * prefer Object component syntax.\n *\n * @remarks\n *\n * When using object component syntax, you import the RadioParts object and\n * the entire family of components vs. only what you use.\n */\nexport const RadioParts: RadioPartsValue = {\n Root: RadioGroupRoot,\n Label: RadioGroupLabel,\n Indicator: RadioGroupIndicator,\n Item: RadioGroupItem,\n ItemText: RadioGroupItemText,\n ItemControl: RadioGroupItemControl,\n ItemHiddenInput: RadioGroupItemHiddenInput,\n}\n","import {\n RadioGroup as ArkRadioGroup,\n type RadioGroupIndicatorProps,\n type RadioGroupItemControlProps,\n type RadioGroupItemHiddenInputProps,\n type RadioGroupItemProps,\n type RadioGroupItemTextProps,\n type RadioGroupLabelProps,\n type RadioGroupRootProps,\n} from '@ark-ui/react/radio-group'\nimport { cx } from '@cerberus/styled-system/css'\nimport {\n radioGroup,\n type RadioGroupVariantProps,\n} from '@cerberus/styled-system/recipes'\n\n/**\n * This module contains the Radio primitives\n * @module 'react/radio'\n */\n\n/**\n * The RadioGroupRoot component is used to group radio buttons together.\n */\nexport function RadioGroupRoot(\n props: RadioGroupRootProps & RadioGroupVariantProps,\n) {\n const { size, orientation, ...rootProps } = props\n const styles = radioGroup({ size, orientation })\n return (\n <ArkRadioGroup.Root\n {...rootProps}\n className={cx(styles.root, rootProps.className)}\n />\n )\n}\n\n/**\n * The RadioGroupLabel component is used to label a group of radio buttons.\n */\nexport function RadioGroupLabel(props: RadioGroupLabelProps) {\n const styles = radioGroup()\n return (\n <ArkRadioGroup.Label\n {...props}\n className={cx(styles.label, props.className)}\n />\n )\n}\n\n/**\n * The RadioGroupIndicator component is used to indicate the selected radio\n * button in a group.\n */\nexport function RadioGroupIndicator(props: RadioGroupIndicatorProps) {\n const styles = radioGroup()\n return (\n <ArkRadioGroup.Indicator\n {...props}\n className={cx(styles.indicator, props.className)}\n />\n )\n}\n\n/**\n * The RadioGroupItem component is used to render a single radio button in a\n * group.\n */\nexport function RadioGroupItem(props: RadioGroupItemProps) {\n const styles = radioGroup()\n return (\n <ArkRadioGroup.Item\n {...props}\n className={cx(styles.item, props.className)}\n />\n )\n}\n\n/**\n * The RadioGroupItemText component is used to render the text label for a\n * single radio button in a group.\n */\nexport function RadioGroupItemText(\n props: RadioGroupItemTextProps & RadioGroupVariantProps,\n) {\n const { size, orientation, ...itemTextProps } = props\n const styles = radioGroup({ size, orientation })\n return (\n <ArkRadioGroup.ItemText\n {...itemTextProps}\n className={cx(styles.itemText, itemTextProps.className)}\n />\n )\n}\n\n/**\n * The RadioGroupItemControl component is used to render the control for a\n * single radio button in a group.\n */\nexport function RadioGroupItemControl(\n props: RadioGroupItemControlProps & RadioGroupVariantProps,\n) {\n const { size, orientation, ...itemControlProps } = props\n const styles = radioGroup({ size, orientation })\n return (\n <ArkRadioGroup.ItemControl\n {...itemControlProps}\n className={cx(styles.itemControl, itemControlProps.className)}\n />\n )\n}\n\n/**\n * The RadioGroupItemHiddenInput component is used to render the hidden input\n * for a single radio button in a group.\n */\nexport function RadioGroupItemHiddenInput(\n props: RadioGroupItemHiddenInputProps,\n) {\n return <ArkRadioGroup.ItemHiddenInput {...props} />\n}\n\nexport const RadioGroup = RadioGroupRoot\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,yBASO;AACP,iBAAmB;AACnB,qBAGO;AAgBH;AANG,SAAS,eACd,OACA;AACA,QAAM,EAAE,MAAM,aAAa,GAAG,UAAU,IAAI;AAC5C,QAAM,aAAS,2BAAW,EAAE,MAAM,YAAY,CAAC;AAC/C,SACE;AAAA,IAAC,mBAAAA,WAAc;AAAA,IAAd;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,MAAM,UAAU,SAAS;AAAA;AAAA,EAChD;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EACzC,MAAM;AAAA,EACN,OAAO;AAAA,EACP,WAAW;AAAA,EACX,MAAM;AAAA,EACN,UAAU;AAAA,EACV,aAAa;AAAA,EACb,iBAAiB;AACnB;","names":["ArkRadioGroup"]}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/components/radio/primitives.tsx
|
|
21
|
+
var primitives_exports = {};
|
|
22
|
+
__export(primitives_exports, {
|
|
23
|
+
RadioGroup: () => RadioGroup,
|
|
24
|
+
RadioGroupIndicator: () => RadioGroupIndicator,
|
|
25
|
+
RadioGroupItem: () => RadioGroupItem,
|
|
26
|
+
RadioGroupItemControl: () => RadioGroupItemControl,
|
|
27
|
+
RadioGroupItemHiddenInput: () => RadioGroupItemHiddenInput,
|
|
28
|
+
RadioGroupItemText: () => RadioGroupItemText,
|
|
29
|
+
RadioGroupLabel: () => RadioGroupLabel,
|
|
30
|
+
RadioGroupRoot: () => RadioGroupRoot
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(primitives_exports);
|
|
33
|
+
var import_radio_group = require("@ark-ui/react/radio-group");
|
|
34
|
+
var import_css = require("@cerberus/styled-system/css");
|
|
35
|
+
var import_recipes = require("@cerberus/styled-system/recipes");
|
|
36
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
|
+
function RadioGroupRoot(props) {
|
|
38
|
+
const { size, orientation, ...rootProps } = props;
|
|
39
|
+
const styles = (0, import_recipes.radioGroup)({ size, orientation });
|
|
40
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
41
|
+
import_radio_group.RadioGroup.Root,
|
|
42
|
+
{
|
|
43
|
+
...rootProps,
|
|
44
|
+
className: (0, import_css.cx)(styles.root, rootProps.className)
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
function RadioGroupLabel(props) {
|
|
49
|
+
const styles = (0, import_recipes.radioGroup)();
|
|
50
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
51
|
+
import_radio_group.RadioGroup.Label,
|
|
52
|
+
{
|
|
53
|
+
...props,
|
|
54
|
+
className: (0, import_css.cx)(styles.label, props.className)
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
function RadioGroupIndicator(props) {
|
|
59
|
+
const styles = (0, import_recipes.radioGroup)();
|
|
60
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
61
|
+
import_radio_group.RadioGroup.Indicator,
|
|
62
|
+
{
|
|
63
|
+
...props,
|
|
64
|
+
className: (0, import_css.cx)(styles.indicator, props.className)
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
function RadioGroupItem(props) {
|
|
69
|
+
const styles = (0, import_recipes.radioGroup)();
|
|
70
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
71
|
+
import_radio_group.RadioGroup.Item,
|
|
72
|
+
{
|
|
73
|
+
...props,
|
|
74
|
+
className: (0, import_css.cx)(styles.item, props.className)
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
function RadioGroupItemText(props) {
|
|
79
|
+
const { size, orientation, ...itemTextProps } = props;
|
|
80
|
+
const styles = (0, import_recipes.radioGroup)({ size, orientation });
|
|
81
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
82
|
+
import_radio_group.RadioGroup.ItemText,
|
|
83
|
+
{
|
|
84
|
+
...itemTextProps,
|
|
85
|
+
className: (0, import_css.cx)(styles.itemText, itemTextProps.className)
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
function RadioGroupItemControl(props) {
|
|
90
|
+
const { size, orientation, ...itemControlProps } = props;
|
|
91
|
+
const styles = (0, import_recipes.radioGroup)({ size, orientation });
|
|
92
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
93
|
+
import_radio_group.RadioGroup.ItemControl,
|
|
94
|
+
{
|
|
95
|
+
...itemControlProps,
|
|
96
|
+
className: (0, import_css.cx)(styles.itemControl, itemControlProps.className)
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
function RadioGroupItemHiddenInput(props) {
|
|
101
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_radio_group.RadioGroup.ItemHiddenInput, { ...props });
|
|
102
|
+
}
|
|
103
|
+
var RadioGroup = RadioGroupRoot;
|
|
104
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
105
|
+
0 && (module.exports = {
|
|
106
|
+
RadioGroup,
|
|
107
|
+
RadioGroupIndicator,
|
|
108
|
+
RadioGroupItem,
|
|
109
|
+
RadioGroupItemControl,
|
|
110
|
+
RadioGroupItemHiddenInput,
|
|
111
|
+
RadioGroupItemText,
|
|
112
|
+
RadioGroupLabel,
|
|
113
|
+
RadioGroupRoot
|
|
114
|
+
});
|
|
115
|
+
//# sourceMappingURL=primitives.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/radio/primitives.tsx"],"sourcesContent":["import {\n RadioGroup as ArkRadioGroup,\n type RadioGroupIndicatorProps,\n type RadioGroupItemControlProps,\n type RadioGroupItemHiddenInputProps,\n type RadioGroupItemProps,\n type RadioGroupItemTextProps,\n type RadioGroupLabelProps,\n type RadioGroupRootProps,\n} from '@ark-ui/react/radio-group'\nimport { cx } from '@cerberus/styled-system/css'\nimport {\n radioGroup,\n type RadioGroupVariantProps,\n} from '@cerberus/styled-system/recipes'\n\n/**\n * This module contains the Radio primitives\n * @module 'react/radio'\n */\n\n/**\n * The RadioGroupRoot component is used to group radio buttons together.\n */\nexport function RadioGroupRoot(\n props: RadioGroupRootProps & RadioGroupVariantProps,\n) {\n const { size, orientation, ...rootProps } = props\n const styles = radioGroup({ size, orientation })\n return (\n <ArkRadioGroup.Root\n {...rootProps}\n className={cx(styles.root, rootProps.className)}\n />\n )\n}\n\n/**\n * The RadioGroupLabel component is used to label a group of radio buttons.\n */\nexport function RadioGroupLabel(props: RadioGroupLabelProps) {\n const styles = radioGroup()\n return (\n <ArkRadioGroup.Label\n {...props}\n className={cx(styles.label, props.className)}\n />\n )\n}\n\n/**\n * The RadioGroupIndicator component is used to indicate the selected radio\n * button in a group.\n */\nexport function RadioGroupIndicator(props: RadioGroupIndicatorProps) {\n const styles = radioGroup()\n return (\n <ArkRadioGroup.Indicator\n {...props}\n className={cx(styles.indicator, props.className)}\n />\n )\n}\n\n/**\n * The RadioGroupItem component is used to render a single radio button in a\n * group.\n */\nexport function RadioGroupItem(props: RadioGroupItemProps) {\n const styles = radioGroup()\n return (\n <ArkRadioGroup.Item\n {...props}\n className={cx(styles.item, props.className)}\n />\n )\n}\n\n/**\n * The RadioGroupItemText component is used to render the text label for a\n * single radio button in a group.\n */\nexport function RadioGroupItemText(\n props: RadioGroupItemTextProps & RadioGroupVariantProps,\n) {\n const { size, orientation, ...itemTextProps } = props\n const styles = radioGroup({ size, orientation })\n return (\n <ArkRadioGroup.ItemText\n {...itemTextProps}\n className={cx(styles.itemText, itemTextProps.className)}\n />\n )\n}\n\n/**\n * The RadioGroupItemControl component is used to render the control for a\n * single radio button in a group.\n */\nexport function RadioGroupItemControl(\n props: RadioGroupItemControlProps & RadioGroupVariantProps,\n) {\n const { size, orientation, ...itemControlProps } = props\n const styles = radioGroup({ size, orientation })\n return (\n <ArkRadioGroup.ItemControl\n {...itemControlProps}\n className={cx(styles.itemControl, itemControlProps.className)}\n />\n )\n}\n\n/**\n * The RadioGroupItemHiddenInput component is used to render the hidden input\n * for a single radio button in a group.\n */\nexport function RadioGroupItemHiddenInput(\n props: RadioGroupItemHiddenInputProps,\n) {\n return <ArkRadioGroup.ItemHiddenInput {...props} />\n}\n\nexport const RadioGroup = RadioGroupRoot\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBASO;AACP,iBAAmB;AACnB,qBAGO;AAgBH;AANG,SAAS,eACd,OACA;AACA,QAAM,EAAE,MAAM,aAAa,GAAG,UAAU,IAAI;AAC5C,QAAM,aAAS,2BAAW,EAAE,MAAM,YAAY,CAAC;AAC/C,SACE;AAAA,IAAC,mBAAAA,WAAc;AAAA,IAAd;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,MAAM,UAAU,SAAS;AAAA;AAAA,EAChD;AAEJ;AAKO,SAAS,gBAAgB,OAA6B;AAC3D,QAAM,aAAS,2BAAW;AAC1B,SACE;AAAA,IAAC,mBAAAA,WAAc;AAAA,IAAd;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,OAAO,MAAM,SAAS;AAAA;AAAA,EAC7C;AAEJ;AAMO,SAAS,oBAAoB,OAAiC;AACnE,QAAM,aAAS,2BAAW;AAC1B,SACE;AAAA,IAAC,mBAAAA,WAAc;AAAA,IAAd;AAAA,MACE,GAAG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