@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
|
@@ -0,0 +1,82 @@
|
|
|
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/radio.tsx
|
|
21
|
+
var radio_exports = {};
|
|
22
|
+
__export(radio_exports, {
|
|
23
|
+
Radio: () => Radio
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(radio_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 RadioGroupItem(props) {
|
|
33
|
+
const styles = (0, import_recipes.radioGroup)();
|
|
34
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
35
|
+
import_radio_group.RadioGroup.Item,
|
|
36
|
+
{
|
|
37
|
+
...props,
|
|
38
|
+
className: (0, import_css.cx)(styles.item, props.className)
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
function RadioGroupItemText(props) {
|
|
43
|
+
const { size, orientation, ...itemTextProps } = props;
|
|
44
|
+
const styles = (0, import_recipes.radioGroup)({ size, orientation });
|
|
45
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
46
|
+
import_radio_group.RadioGroup.ItemText,
|
|
47
|
+
{
|
|
48
|
+
...itemTextProps,
|
|
49
|
+
className: (0, import_css.cx)(styles.itemText, itemTextProps.className)
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
function RadioGroupItemControl(props) {
|
|
54
|
+
const { size, orientation, ...itemControlProps } = props;
|
|
55
|
+
const styles = (0, import_recipes.radioGroup)({ size, orientation });
|
|
56
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
57
|
+
import_radio_group.RadioGroup.ItemControl,
|
|
58
|
+
{
|
|
59
|
+
...itemControlProps,
|
|
60
|
+
className: (0, import_css.cx)(styles.itemControl, itemControlProps.className)
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
function RadioGroupItemHiddenInput(props) {
|
|
65
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_radio_group.RadioGroup.ItemHiddenInput, { ...props });
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// src/components/radio/radio.tsx
|
|
69
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
70
|
+
function Radio(props) {
|
|
71
|
+
const { size, children, ...groupProps } = props;
|
|
72
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(RadioGroupItem, { ...groupProps, children: [
|
|
73
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(RadioGroupItemControl, { size }),
|
|
74
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(RadioGroupItemText, { size, children }),
|
|
75
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(RadioGroupItemHiddenInput, {})
|
|
76
|
+
] });
|
|
77
|
+
}
|
|
78
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
79
|
+
0 && (module.exports = {
|
|
80
|
+
Radio
|
|
81
|
+
});
|
|
82
|
+
//# sourceMappingURL=radio.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/radio/radio.tsx","../../../../src/components/radio/primitives.tsx"],"sourcesContent":["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","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;AAsCG,SAAS,eAAe,OAA4B;AACzD,QAAM,aAAS,2BAAW;AAC1B,SACE;AAAA,IAAC,mBAAAA,WAAc;AAAA,IAAd;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,MAAM,MAAM,SAAS;AAAA;AAAA,EAC5C;AAEJ;AAMO,SAAS,mBACd,OACA;AACA,QAAM,EAAE,MAAM,aAAa,GAAG,cAAc,IAAI;AAChD,QAAM,aAAS,2BAAW,EAAE,MAAM,YAAY,CAAC;AAC/C,SACE;AAAA,IAAC,mBAAAA,WAAc;AAAA,IAAd;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,UAAU,cAAc,SAAS;AAAA;AAAA,EACxD;AAEJ;AAMO,SAAS,sBACd,OACA;AACA,QAAM,EAAE,MAAM,aAAa,GAAG,iBAAiB,IAAI;AACnD,QAAM,aAAS,2BAAW,EAAE,MAAM,YAAY,CAAC;AAC/C,SACE;AAAA,IAAC,mBAAAA,WAAc;AAAA,IAAd;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,aAAa,iBAAiB,SAAS;AAAA;AAAA,EAC9D;AAEJ;AAMO,SAAS,0BACd,OACA;AACA,SAAO,4CAAC,mBAAAA,WAAc,iBAAd,EAA+B,GAAG,OAAO;AACnD;;;AD5FI,IAAAC,sBAAA;AAHG,SAAS,MAAM,OAAmB;AACvC,QAAM,EAAE,MAAM,UAAU,GAAG,WAAW,IAAI;AAC1C,SACE,8CAAC,kBAAgB,GAAG,YAClB;AAAA,iDAAC,yBAAsB,MAAY;AAAA,IACnC,6CAAC,sBAAmB,MAAa,UAAS;AAAA,IAC1C,6CAAC,6BAA0B;AAAA,KAC7B;AAEJ;","names":["ArkRadioGroup","import_jsx_runtime"]}
|