@yamada-ui/radio 1.2.16-next-20241126134247 → 1.3.0-next-20241126142838

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. package/dist/chunk-27VC2SJI.mjs +30 -0
  2. package/dist/chunk-27VC2SJI.mjs.map +1 -0
  3. package/dist/chunk-AOVCDCCW.mjs +88 -0
  4. package/dist/chunk-AOVCDCCW.mjs.map +1 -0
  5. package/dist/chunk-DO4JVJRM.mjs +103 -0
  6. package/dist/chunk-DO4JVJRM.mjs.map +1 -0
  7. package/dist/{chunk-PUPRIHYJ.mjs → chunk-HFS5TQ47.mjs} +8 -115
  8. package/dist/chunk-HFS5TQ47.mjs.map +1 -0
  9. package/dist/chunk-JLL7F3NY.mjs +120 -0
  10. package/dist/chunk-JLL7F3NY.mjs.map +1 -0
  11. package/dist/chunk-NP4GICPF.mjs +124 -0
  12. package/dist/chunk-NP4GICPF.mjs.map +1 -0
  13. package/dist/chunk-Q5GTUIUF.mjs +56 -0
  14. package/dist/chunk-Q5GTUIUF.mjs.map +1 -0
  15. package/dist/chunk-YDYOLCNG.mjs +94 -0
  16. package/dist/chunk-YDYOLCNG.mjs.map +1 -0
  17. package/dist/chunk-YRIADAI7.mjs +32 -0
  18. package/dist/chunk-YRIADAI7.mjs.map +1 -0
  19. package/dist/chunk-ZLJHOIFP.mjs +26 -0
  20. package/dist/chunk-ZLJHOIFP.mjs.map +1 -0
  21. package/dist/index.d.mts +11 -4
  22. package/dist/index.d.ts +11 -4
  23. package/dist/index.js +344 -37
  24. package/dist/index.js.map +1 -1
  25. package/dist/index.mjs +29 -5
  26. package/dist/radio-card-addon.d.mts +8 -0
  27. package/dist/radio-card-addon.d.ts +8 -0
  28. package/dist/radio-card-addon.js +69 -0
  29. package/dist/radio-card-addon.js.map +1 -0
  30. package/dist/radio-card-addon.mjs +9 -0
  31. package/dist/radio-card-addon.mjs.map +1 -0
  32. package/dist/radio-card-description.d.mts +8 -0
  33. package/dist/radio-card-description.d.ts +8 -0
  34. package/dist/radio-card-description.js +67 -0
  35. package/dist/radio-card-description.js.map +1 -0
  36. package/dist/radio-card-description.mjs +9 -0
  37. package/dist/radio-card-description.mjs.map +1 -0
  38. package/dist/radio-card-group.d.mts +33 -0
  39. package/dist/radio-card-group.d.ts +33 -0
  40. package/dist/radio-card-group.js +584 -0
  41. package/dist/radio-card-group.js.map +1 -0
  42. package/dist/radio-card-group.mjs +15 -0
  43. package/dist/radio-card-group.mjs.map +1 -0
  44. package/dist/radio-card-label.d.mts +22 -0
  45. package/dist/radio-card-label.d.ts +22 -0
  46. package/dist/radio-card-label.js +93 -0
  47. package/dist/radio-card-label.js.map +1 -0
  48. package/dist/radio-card-label.mjs +9 -0
  49. package/dist/radio-card-label.mjs.map +1 -0
  50. package/dist/radio-card.d.mts +61 -0
  51. package/dist/radio-card.d.ts +61 -0
  52. package/dist/radio-card.js +412 -0
  53. package/dist/radio-card.js.map +1 -0
  54. package/dist/radio-card.mjs +13 -0
  55. package/dist/radio-card.mjs.map +1 -0
  56. package/dist/radio-context.d.mts +25 -3
  57. package/dist/radio-context.d.ts +25 -3
  58. package/dist/radio-context.js +16 -0
  59. package/dist/radio-context.js.map +1 -1
  60. package/dist/radio-context.mjs +9 -1
  61. package/dist/radio-group.d.mts +15 -58
  62. package/dist/radio-group.d.ts +15 -58
  63. package/dist/radio-group.js +56 -39
  64. package/dist/radio-group.js.map +1 -1
  65. package/dist/radio-group.mjs +7 -7
  66. package/dist/radio.d.mts +14 -80
  67. package/dist/radio.d.ts +14 -80
  68. package/dist/radio.js +31 -17
  69. package/dist/radio.js.map +1 -1
  70. package/dist/radio.mjs +5 -6
  71. package/dist/use-radio-group.d.mts +56 -0
  72. package/dist/use-radio-group.d.ts +56 -0
  73. package/dist/use-radio-group.js +111 -0
  74. package/dist/use-radio-group.js.map +1 -0
  75. package/dist/use-radio-group.mjs +8 -0
  76. package/dist/use-radio-group.mjs.map +1 -0
  77. package/dist/use-radio.d.mts +87 -0
  78. package/dist/use-radio.d.ts +87 -0
  79. package/dist/use-radio.js +207 -0
  80. package/dist/use-radio.js.map +1 -0
  81. package/dist/use-radio.mjs +8 -0
  82. package/dist/use-radio.mjs.map +1 -0
  83. package/package.json +7 -7
  84. package/dist/chunk-6FMV6NX2.mjs +0 -14
  85. package/dist/chunk-6FMV6NX2.mjs.map +0 -1
  86. package/dist/chunk-PUPRIHYJ.mjs.map +0 -1
  87. package/dist/chunk-QAADRIFZ.mjs +0 -177
  88. package/dist/chunk-QAADRIFZ.mjs.map +0 -1
@@ -0,0 +1,22 @@
1
+ import * as _yamada_ui_core from '@yamada-ui/core';
2
+ import { HTMLUIProps } from '@yamada-ui/core';
3
+
4
+ interface RadioCardLabelProps extends HTMLUIProps {
5
+ /**
6
+ * If `true`, the icon will be displayed.
7
+ *
8
+ * @default true
9
+ */
10
+ withIcon?: boolean;
11
+ /**
12
+ * The props for the label content.
13
+ */
14
+ contentProps?: HTMLUIProps<"span">;
15
+ /**
16
+ * The props for the icon.
17
+ */
18
+ iconProps?: HTMLUIProps;
19
+ }
20
+ declare const RadioCardLabel: _yamada_ui_core.Component<"div", RadioCardLabelProps>;
21
+
22
+ export { RadioCardLabel, type RadioCardLabelProps };
@@ -0,0 +1,22 @@
1
+ import * as _yamada_ui_core from '@yamada-ui/core';
2
+ import { HTMLUIProps } from '@yamada-ui/core';
3
+
4
+ interface RadioCardLabelProps extends HTMLUIProps {
5
+ /**
6
+ * If `true`, the icon will be displayed.
7
+ *
8
+ * @default true
9
+ */
10
+ withIcon?: boolean;
11
+ /**
12
+ * The props for the label content.
13
+ */
14
+ contentProps?: HTMLUIProps<"span">;
15
+ /**
16
+ * The props for the icon.
17
+ */
18
+ iconProps?: HTMLUIProps;
19
+ }
20
+ declare const RadioCardLabel: _yamada_ui_core.Component<"div", RadioCardLabelProps>;
21
+
22
+ export { RadioCardLabel, type RadioCardLabelProps };
@@ -0,0 +1,93 @@
1
+ "use client"
2
+ "use strict";
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)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/radio-card-label.tsx
22
+ var radio_card_label_exports = {};
23
+ __export(radio_card_label_exports, {
24
+ RadioCardLabel: () => RadioCardLabel
25
+ });
26
+ module.exports = __toCommonJS(radio_card_label_exports);
27
+ var import_core = require("@yamada-ui/core");
28
+ var import_core2 = require("@yamada-ui/core");
29
+ var import_utils2 = require("@yamada-ui/utils");
30
+
31
+ // src/radio-context.ts
32
+ var import_utils = require("@yamada-ui/utils");
33
+ var [RadioGroupProvider, useRadioGroupContext] = (0, import_utils.createContext)({
34
+ name: "RadioGroupContext",
35
+ strict: false
36
+ });
37
+ var [RadioCardGroupProvider, useRadioCardGroupContext] = (0, import_utils.createContext)({
38
+ name: "RadioCardGroupContext",
39
+ strict: false
40
+ });
41
+ var [RadioCardProvider, useRadioCardContext] = (0, import_utils.createContext)({
42
+ name: "RadioCardContext",
43
+ errorMessage: `useRadioCardContext returned is 'undefined'. Seems you forgot to wrap the components in "<RadioCard />"`
44
+ });
45
+
46
+ // src/radio-card-label.tsx
47
+ var import_jsx_runtime = require("react/jsx-runtime");
48
+ var RadioCardLabel = (0, import_core.forwardRef)(
49
+ ({ className, children, withIcon, contentProps, iconProps, ...rest }, ref) => {
50
+ const {
51
+ styles,
52
+ withIcon: defaultWithIcon,
53
+ getIconProps,
54
+ iconProps: defaultIconProps
55
+ } = useRadioCardContext();
56
+ withIcon != null ? withIcon : withIcon = defaultWithIcon;
57
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
58
+ import_core2.ui.div,
59
+ {
60
+ ref,
61
+ className: (0, import_utils2.cx)("ui-radio-card__label", className),
62
+ __css: { ...styles.label },
63
+ ...rest,
64
+ children: [
65
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
66
+ import_core2.ui.span,
67
+ {
68
+ className: "ui-radio-card__label-content",
69
+ __css: { ...styles.labelContent },
70
+ ...contentProps,
71
+ children
72
+ }
73
+ ),
74
+ withIcon ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
75
+ import_core2.ui.div,
76
+ {
77
+ className: "ui-radio-card__icon",
78
+ __css: { ...styles.icon },
79
+ ...getIconProps({ ...defaultIconProps, ...iconProps })
80
+ }
81
+ ) : null
82
+ ]
83
+ }
84
+ );
85
+ }
86
+ );
87
+ RadioCardLabel.displayName = "RadioCardLabel";
88
+ RadioCardLabel.__ui__ = "RadioCardLabel";
89
+ // Annotate the CommonJS export names for ESM import in node:
90
+ 0 && (module.exports = {
91
+ RadioCardLabel
92
+ });
93
+ //# sourceMappingURL=radio-card-label.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/radio-card-label.tsx","../src/radio-context.ts"],"sourcesContent":["import type { HTMLUIProps } from \"@yamada-ui/core\"\nimport { forwardRef } from \"@yamada-ui/core\"\nimport { ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useRadioCardContext } from \"./radio-context\"\n\nexport interface RadioCardLabelProps extends HTMLUIProps {\n /**\n * If `true`, the icon will be displayed.\n *\n * @default true\n */\n withIcon?: boolean\n /**\n * The props for the label content.\n */\n contentProps?: HTMLUIProps<\"span\">\n /**\n * The props for the icon.\n */\n iconProps?: HTMLUIProps\n}\n\nexport const RadioCardLabel = forwardRef<RadioCardLabelProps, \"div\">(\n (\n { className, children, withIcon, contentProps, iconProps, ...rest },\n ref,\n ) => {\n const {\n styles,\n withIcon: defaultWithIcon,\n getIconProps,\n iconProps: defaultIconProps,\n } = useRadioCardContext()\n\n withIcon ??= defaultWithIcon\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-radio-card__label\", className)}\n __css={{ ...styles.label }}\n {...rest}\n >\n <ui.span\n className=\"ui-radio-card__label-content\"\n __css={{ ...styles.labelContent }}\n {...contentProps}\n >\n {children}\n </ui.span>\n\n {withIcon ? (\n <ui.div\n className=\"ui-radio-card__icon\"\n __css={{ ...styles.icon }}\n {...getIconProps({ ...defaultIconProps, ...iconProps })}\n />\n ) : null}\n </ui.div>\n )\n },\n)\n\nRadioCardLabel.displayName = \"RadioCardLabel\"\nRadioCardLabel.__ui__ = \"RadioCardLabel\"\n","import type {\n CSSUIObject,\n HTMLUIProps,\n PropGetter,\n ThemeProps,\n} from \"@yamada-ui/core\"\nimport type { FormControlOptions } from \"@yamada-ui/form-control\"\nimport type { ChangeEvent } from \"react\"\nimport type { RadioCardProps } from \"./radio-card\"\nimport { createContext } from \"@yamada-ui/utils\"\n\ninterface RadioGroupSharedContext extends FormControlOptions {\n name: string\n value: number | string\n onChange: (evOrValue: ChangeEvent<HTMLInputElement> | number | string) => void\n}\n\nexport interface RadioGroupContext\n extends RadioGroupSharedContext,\n ThemeProps<\"Radio\"> {}\n\nexport const [RadioGroupProvider, useRadioGroupContext] =\n createContext<RadioGroupContext>({\n name: \"RadioGroupContext\",\n strict: false,\n })\n\nexport interface RadioCardGroupContext\n extends RadioGroupSharedContext,\n Pick<\n RadioCardProps,\n \"addonProps\" | \"descriptionProps\" | \"labelProps\" | \"withIcon\"\n >,\n ThemeProps<\"RadioCard\"> {}\n\nexport const [RadioCardGroupProvider, useRadioCardGroupContext] =\n createContext<RadioCardGroupContext>({\n name: \"RadioCardGroupContext\",\n strict: false,\n })\n\nexport interface RadioCardContext {\n styles: { [key: string]: CSSUIObject | undefined }\n withIcon: boolean\n getIconProps: PropGetter\n iconProps?: HTMLUIProps\n}\n\nexport const [RadioCardProvider, useRadioCardContext] =\n createContext<RadioCardContext>({\n name: \"RadioCardContext\",\n errorMessage: `useRadioCardContext returned is 'undefined'. Seems you forgot to wrap the components in \"<RadioCard />\"`,\n })\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAA2B;AAC3B,IAAAA,eAAmB;AACnB,IAAAC,gBAAmB;;;ACMnB,mBAA8B;AAYvB,IAAM,CAAC,oBAAoB,oBAAoB,QACpD,4BAAiC;AAAA,EAC/B,MAAM;AAAA,EACN,QAAQ;AACV,CAAC;AAUI,IAAM,CAAC,wBAAwB,wBAAwB,QAC5D,4BAAqC;AAAA,EACnC,MAAM;AAAA,EACN,QAAQ;AACV,CAAC;AASI,IAAM,CAAC,mBAAmB,mBAAmB,QAClD,4BAAgC;AAAA,EAC9B,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;;;ADdG;AAfC,IAAM,qBAAiB;AAAA,EAC5B,CACE,EAAE,WAAW,UAAU,UAAU,cAAc,WAAW,GAAG,KAAK,GAClE,QACG;AACH,UAAM;AAAA,MACJ;AAAA,MACA,UAAU;AAAA,MACV;AAAA,MACA,WAAW;AAAA,IACb,IAAI,oBAAoB;AAExB,6CAAa;AAEb,WACE;AAAA,MAAC,gBAAG;AAAA,MAAH;AAAA,QACC;AAAA,QACA,eAAW,kBAAG,wBAAwB,SAAS;AAAA,QAC/C,OAAO,EAAE,GAAG,OAAO,MAAM;AAAA,QACxB,GAAG;AAAA,QAEJ;AAAA;AAAA,YAAC,gBAAG;AAAA,YAAH;AAAA,cACC,WAAU;AAAA,cACV,OAAO,EAAE,GAAG,OAAO,aAAa;AAAA,cAC/B,GAAG;AAAA,cAEH;AAAA;AAAA,UACH;AAAA,UAEC,WACC;AAAA,YAAC,gBAAG;AAAA,YAAH;AAAA,cACC,WAAU;AAAA,cACV,OAAO,EAAE,GAAG,OAAO,KAAK;AAAA,cACvB,GAAG,aAAa,EAAE,GAAG,kBAAkB,GAAG,UAAU,CAAC;AAAA;AAAA,UACxD,IACE;AAAA;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,eAAe,cAAc;AAC7B,eAAe,SAAS;","names":["import_core","import_utils"]}
@@ -0,0 +1,9 @@
1
+ "use client"
2
+ import {
3
+ RadioCardLabel
4
+ } from "./chunk-Q5GTUIUF.mjs";
5
+ import "./chunk-ZLJHOIFP.mjs";
6
+ export {
7
+ RadioCardLabel
8
+ };
9
+ //# sourceMappingURL=radio-card-label.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,61 @@
1
+ import { HTMLUIProps, ThemeProps, ComponentArgs } from '@yamada-ui/core';
2
+ import { RefAttributes, ReactElement, ReactNode, InputHTMLAttributes } from 'react';
3
+ import { RadioCardAddonProps } from './radio-card-addon.mjs';
4
+ import { RadioCardDescriptionProps } from './radio-card-description.mjs';
5
+ import { RadioCardLabelProps } from './radio-card-label.mjs';
6
+ import { UseRadioProps } from './use-radio.mjs';
7
+ import '@yamada-ui/form-control';
8
+ import '@yamada-ui/utils';
9
+
10
+ interface RadioCardOptions {
11
+ /**
12
+ * The addon of the radio card.
13
+ */
14
+ addon?: ReactNode;
15
+ /**
16
+ * The body of the radio card.
17
+ */
18
+ description?: ReactNode;
19
+ /**
20
+ * The label of the radio card.
21
+ */
22
+ label?: ReactNode;
23
+ /**
24
+ * If `true`, the icon will be displayed.
25
+ *
26
+ * @default true
27
+ */
28
+ withIcon?: boolean;
29
+ /**
30
+ * Props for the footer of the radio card.
31
+ */
32
+ addonProps?: RadioCardAddonProps;
33
+ /**
34
+ * Props for the description of the radio card.
35
+ */
36
+ descriptionProps?: RadioCardDescriptionProps;
37
+ /**
38
+ * Props for the icon of the radio card.
39
+ */
40
+ iconProps?: HTMLUIProps;
41
+ /**
42
+ * Props for input element.
43
+ */
44
+ inputProps?: InputHTMLAttributes<HTMLInputElement>;
45
+ /**
46
+ * Props for the label of the radio card.
47
+ */
48
+ labelProps?: RadioCardLabelProps;
49
+ }
50
+ interface RadioCardProps<Y extends number | string = string> extends Omit<HTMLUIProps<"label">, keyof UseRadioProps>, ThemeProps<"RadioCard">, UseRadioProps<Y>, RadioCardOptions {
51
+ }
52
+ /**
53
+ * `RadioCard` is a component used for allowing users to select one option from multiple choices.
54
+ *
55
+ * @see Docs https://yamada-ui.com/components/forms/radio-card
56
+ */
57
+ declare const RadioCard: {
58
+ <Y extends number | string = string>(props: RadioCardProps<Y> & RefAttributes<HTMLInputElement>): ReactElement;
59
+ } & ComponentArgs;
60
+
61
+ export { RadioCard, type RadioCardProps };
@@ -0,0 +1,61 @@
1
+ import { HTMLUIProps, ThemeProps, ComponentArgs } from '@yamada-ui/core';
2
+ import { RefAttributes, ReactElement, ReactNode, InputHTMLAttributes } from 'react';
3
+ import { RadioCardAddonProps } from './radio-card-addon.js';
4
+ import { RadioCardDescriptionProps } from './radio-card-description.js';
5
+ import { RadioCardLabelProps } from './radio-card-label.js';
6
+ import { UseRadioProps } from './use-radio.js';
7
+ import '@yamada-ui/form-control';
8
+ import '@yamada-ui/utils';
9
+
10
+ interface RadioCardOptions {
11
+ /**
12
+ * The addon of the radio card.
13
+ */
14
+ addon?: ReactNode;
15
+ /**
16
+ * The body of the radio card.
17
+ */
18
+ description?: ReactNode;
19
+ /**
20
+ * The label of the radio card.
21
+ */
22
+ label?: ReactNode;
23
+ /**
24
+ * If `true`, the icon will be displayed.
25
+ *
26
+ * @default true
27
+ */
28
+ withIcon?: boolean;
29
+ /**
30
+ * Props for the footer of the radio card.
31
+ */
32
+ addonProps?: RadioCardAddonProps;
33
+ /**
34
+ * Props for the description of the radio card.
35
+ */
36
+ descriptionProps?: RadioCardDescriptionProps;
37
+ /**
38
+ * Props for the icon of the radio card.
39
+ */
40
+ iconProps?: HTMLUIProps;
41
+ /**
42
+ * Props for input element.
43
+ */
44
+ inputProps?: InputHTMLAttributes<HTMLInputElement>;
45
+ /**
46
+ * Props for the label of the radio card.
47
+ */
48
+ labelProps?: RadioCardLabelProps;
49
+ }
50
+ interface RadioCardProps<Y extends number | string = string> extends Omit<HTMLUIProps<"label">, keyof UseRadioProps>, ThemeProps<"RadioCard">, UseRadioProps<Y>, RadioCardOptions {
51
+ }
52
+ /**
53
+ * `RadioCard` is a component used for allowing users to select one option from multiple choices.
54
+ *
55
+ * @see Docs https://yamada-ui.com/components/forms/radio-card
56
+ */
57
+ declare const RadioCard: {
58
+ <Y extends number | string = string>(props: RadioCardProps<Y> & RefAttributes<HTMLInputElement>): ReactElement;
59
+ } & ComponentArgs;
60
+
61
+ export { RadioCard, type RadioCardProps };