@cgi-learning-hub/ui 1.3.2-dev.1731948416 → 1.3.2-dev.1732013713
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Backdrop-KAJqifAq.cjs +1 -0
- package/dist/{Backdrop-CV5zVFtT.js → Backdrop-RBPtVAPX.js} +220 -265
- package/dist/{Box-MG2tJmr8.js → Box-UE-zctbJ.js} +3 -3
- package/dist/{Button-Ba8IQCCs.js → Button-Bjy0iPNm.js} +4 -4
- package/dist/{ButtonBase-BdvHQ0Vd.js → ButtonBase-CFD7NVUc.js} +21 -21
- package/dist/Checkbox-Ct5E_6h7.js +241 -0
- package/dist/Checkbox-CuYTY0gd.cjs +1 -0
- package/dist/{CircularProgress-BAVvonKL.js → CircularProgress-By02Sdoh.js} +3 -3
- package/dist/{DatePicker-DCsrvr3a.cjs → DatePicker-rhgpaD-r.cjs} +14 -14
- package/dist/{DatePicker-DoB4WsQR.js → DatePicker-u4rtXGeo.js} +53 -48
- package/dist/{DefaultPropsProvider-BE624hnX.js → DefaultPropsProvider-CaRoy5OV.js} +24 -24
- package/dist/FormGroup-BBYEQB4C.cjs +1 -0
- package/dist/FormGroup-BVtE8Mrv.js +348 -0
- package/dist/FormLabel-B4QlkhhB.js +424 -0
- package/dist/FormLabel-D8jYibc1.cjs +2 -0
- package/dist/{IconButton-BM6tD2wP.js → IconButton-Av8eJ5IG.js} +4 -4
- package/dist/InputAdornment-BJfpEQAa.cjs +1 -0
- package/dist/{InputAdornment-DwegBPlu.js → InputAdornment-COPtZlSD.js} +5 -5
- package/dist/{InputBase-Ck6jdGdt.js → InputBase-Bbgoz8GV.js} +186 -210
- package/dist/InputBase-Ctmib7Br.cjs +3 -0
- package/dist/MenuItem-D7HWYhF3.js +277 -0
- package/dist/MenuItem-Els-vJZW.cjs +1 -0
- package/dist/{TextField-ptOYG3fA.js → Select-BlPQngVF.js} +1458 -2424
- package/dist/Select-ipcMZ4iK.cjs +11 -0
- package/dist/{Stack-vO5Ta57O.js → Stack-y1PjTHKX.js} +18 -18
- package/dist/SwitchBase-URM3X3YZ.cjs +1 -0
- package/dist/SwitchBase-yCuH0Tqk.js +261 -0
- package/dist/{Tabs-DSWPmVfN.js → Tabs-DK4Bc5xo.js} +10 -10
- package/dist/{Tabs-e8UBJZ5z.cjs → Tabs-Nvk94RTW.cjs} +1 -1
- package/dist/TextField-BVAkADOb.cjs +1 -0
- package/dist/TextField-C-B529_r.js +547 -0
- package/dist/{Tooltip-dMZ46-1F.js → Tooltip-DO9GIhWC.js} +1782 -2858
- package/dist/Tooltip-DvPL2M0E.cjs +100 -0
- package/dist/{Typography-HjpyrRz2.js → Typography-C_ESP41L.js} +4 -4
- package/dist/components/Button/Button.es.js +5 -5
- package/dist/components/DatePicker/DatePicker.cjs.js +1 -1
- package/dist/components/DatePicker/DatePicker.es.js +2 -2
- package/dist/components/DatePicker/index.cjs.js +1 -1
- package/dist/components/DatePicker/index.es.js +1 -1
- package/dist/components/Dropzone/Dropzone.es.js +4 -4
- package/dist/components/EmptyState/EmptyState.es.js +2 -2
- package/dist/components/FileList/FileList.es.js +1 -1
- package/dist/components/FileList/FileListItem.es.js +6 -6
- package/dist/components/Heading/Heading.es.js +2 -2
- package/dist/components/Loader/Loader.es.js +1 -1
- package/dist/components/LoaderBackdrop/LoaderBackdrop.cjs.js +1 -1
- package/dist/components/LoaderBackdrop/LoaderBackdrop.es.js +2 -2
- package/dist/components/PasswordInput/PasswordInput.cjs.js +1 -1
- package/dist/components/PasswordInput/PasswordInput.es.js +4 -4
- package/dist/components/SearchInput/SearchInput.cjs.js +1 -1
- package/dist/components/SearchInput/SearchInput.es.js +4 -4
- package/dist/components/TextInput/TextInput.cjs.js +1 -1
- package/dist/components/TextInput/TextInput.es.js +1 -1
- package/dist/components/index.cjs.js +1 -1
- package/dist/components/index.es.js +267 -262
- package/dist/components/stories/Alert.stories.cjs.js +1 -0
- package/dist/components/{Alert → stories}/Alert.stories.d.ts +1 -1
- package/dist/components/{Alert → stories}/Alert.stories.es.js +1 -1
- package/dist/components/stories/Button.stories.cjs.js +1 -0
- package/dist/components/{Button → stories}/Button.stories.d.ts +1 -1
- package/dist/components/{Button → stories}/Button.stories.es.js +2 -2
- package/dist/components/stories/Checkbox.stories.cjs.js +1 -0
- package/dist/components/stories/Checkbox.stories.d.ts +10 -0
- package/dist/components/stories/Checkbox.stories.es.js +28 -0
- package/dist/components/{DatePicker → stories}/DatePicker.stories.cjs.js +1 -1
- package/dist/components/{DatePicker → stories}/DatePicker.stories.d.ts +1 -1
- package/dist/components/{DatePicker → stories}/DatePicker.stories.es.js +1 -1
- package/dist/components/stories/Dropzone.stories.cjs.js +1 -0
- package/dist/components/{Dropzone → stories}/Dropzone.stories.d.ts +1 -1
- package/dist/components/{Dropzone → stories}/Dropzone.stories.es.js +1 -1
- package/dist/components/stories/EmptyState.stories.cjs.js +1 -0
- package/dist/components/{EmptyState → stories}/EmptyState.stories.d.ts +1 -1
- package/dist/components/{EmptyState → stories}/EmptyState.stories.es.js +1 -1
- package/dist/components/stories/FileList.stories.cjs.js +1 -0
- package/dist/components/{FileList → stories}/FileList.stories.d.ts +1 -1
- package/dist/components/{FileList → stories}/FileList.stories.es.js +6 -5
- package/dist/components/stories/Heading.stories.cjs.js +1 -0
- package/dist/components/{Heading → stories}/Heading.stories.d.ts +1 -1
- package/dist/components/{Heading → stories}/Heading.stories.es.js +3 -3
- package/dist/components/stories/IconButton.stories.es.js +2 -2
- package/dist/components/stories/Loader.stories.cjs.js +1 -0
- package/dist/components/{Loader → stories}/Loader.stories.d.ts +1 -1
- package/dist/components/{Loader → stories}/Loader.stories.es.js +1 -1
- package/dist/components/stories/LoaderBackdrop.stories.cjs.js +1 -0
- package/dist/components/{LoaderBackdrop → stories}/LoaderBackdrop.stories.d.ts +1 -1
- package/dist/components/{LoaderBackdrop → stories}/LoaderBackdrop.stories.es.js +1 -1
- package/dist/components/stories/PasswordInput.stories.cjs.js +1 -0
- package/dist/components/{PasswordInput → stories}/PasswordInput.stories.d.ts +1 -1
- package/dist/components/{PasswordInput → stories}/PasswordInput.stories.es.js +1 -1
- package/dist/components/stories/RadioGroup.stories.cjs.js +1 -0
- package/dist/components/stories/RadioGroup.stories.d.ts +8 -0
- package/dist/components/stories/RadioGroup.stories.es.js +434 -0
- package/dist/components/stories/SearchInput.stories.cjs.js +1 -0
- package/dist/components/{SearchInput → stories}/SearchInput.stories.d.ts +1 -1
- package/dist/components/{SearchInput → stories}/SearchInput.stories.es.js +1 -1
- package/dist/components/stories/Select.stories.cjs.js +1 -0
- package/dist/components/stories/Select.stories.d.ts +10 -0
- package/dist/components/stories/Select.stories.es.js +52 -0
- package/dist/components/stories/TabList.stories.cjs.js +1 -1
- package/dist/components/stories/TabList.stories.es.js +10 -10
- package/dist/components/stories/TextField.stories.cjs.js +1 -0
- package/dist/components/stories/TextField.stories.d.ts +10 -0
- package/dist/components/stories/TextField.stories.es.js +69 -0
- package/dist/{createSvgIcon-D8j2pi8H.js → createSvgIcon-DxbvMQd7.js} +3 -3
- package/dist/{extendSxProp-CrOV7ubJ.js → extendSxProp-XQwkK0m7.js} +1 -1
- package/dist/formControlState-DCkDUdfO.cjs +1 -0
- package/dist/formControlState-DdQP43Uo.js +21 -0
- package/dist/{fr-BbQGEyOf.js → fr-B8_MxRl5.js} +1 -1
- package/dist/{identifier-BspJ_uqC.js → identifier-BqadgaK7.js} +4 -4
- package/dist/{index-CUYeZpek.js → index-BUxqDIr9.js} +4 -4
- package/dist/{index-BD4CTHtk.js → index-CRT92bm7.js} +2 -2
- package/dist/index-D7nFYLYq.cjs +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +267 -262
- package/dist/{memoTheme-CwR5ZU7e.js → memoTheme-DfGVDRrB.js} +1 -1
- package/dist/{refType-B0086dcQ.js → refType-DlHf9HvO.js} +1 -1
- package/dist/{useTheme-DCeWFyuq.js → resolveComponentProps-CxJ2yAJn.js} +18 -26
- package/dist/resolveComponentProps-DTv6xPbb.cjs +1 -0
- package/dist/useControlled-BYdyS7Pn.js +31 -0
- package/dist/useControlled-Ysk4KqoX.cjs +3 -0
- package/dist/useFormControl-CatNKXAi.js +10 -0
- package/dist/useFormControl-haP0iPhl.cjs +1 -0
- package/dist/useSlot-42jgZftI.cjs +1 -0
- package/dist/useSlot-Co14PUn6.js +50 -0
- package/dist/useTheme-CtT7O-Wk.js +11 -0
- package/dist/{useTheme-B4Cg2FUT.js → useTheme-oM_SFWy4.js} +1 -1
- package/dist/useTheme-tZYpFplW.cjs +1 -0
- package/dist/{useThemeProps-B87e2Gmx.js → useThemeProps-BlQ3SLfB.js} +4 -4
- package/dist/{useThemeProps-kJZsUF6E.js → useThemeProps-FiA8ivG-.js} +3 -3
- package/dist/{useTimeout-BFZIFO63.js → useTimeout-D16vpBhn.js} +1 -1
- package/package.json +1 -1
- package/dist/Backdrop-D1g8gJ4S.cjs +0 -1
- package/dist/InputAdornment-CfXhmkcT.cjs +0 -1
- package/dist/InputBase-uv1-DNAg.cjs +0 -3
- package/dist/TextField-C2b1L1xj.cjs +0 -14
- package/dist/Tooltip-bKfA-tNR.cjs +0 -100
- package/dist/components/Alert/Alert.stories.cjs.js +0 -1
- package/dist/components/Button/Button.stories.cjs.js +0 -1
- package/dist/components/Dropzone/Dropzone.stories.cjs.js +0 -1
- package/dist/components/EmptyState/EmptyState.stories.cjs.js +0 -1
- package/dist/components/FileList/FileList.stories.cjs.js +0 -1
- package/dist/components/Heading/Heading.stories.cjs.js +0 -1
- package/dist/components/Loader/Loader.stories.cjs.js +0 -1
- package/dist/components/LoaderBackdrop/LoaderBackdrop.stories.cjs.js +0 -1
- package/dist/components/PasswordInput/PasswordInput.stories.cjs.js +0 -1
- package/dist/components/SearchInput/SearchInput.stories.cjs.js +0 -1
- package/dist/components/TextInput/TextInput.stories.cjs.js +0 -1
- package/dist/components/TextInput/TextInput.stories.d.ts +0 -7
- package/dist/components/TextInput/TextInput.stories.es.js +0 -43
- package/dist/index-1_dd0hY2.cjs +0 -1
- package/dist/useTheme-VRTfPKo-.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../Dropzone/Dropzone.cjs.js"),o={title:"Components/Dropzone",component:e},t={args:{information:"SVG, PNG, JPG or GIF (max. 3MB)",onDrop:n=>alert("dropped")}};exports.Default=t;exports.default=o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../EmptyState/EmptyState.cjs.js"),t={title:"Components/EmptyState",component:e},o={args:{svgName:"client-error",title:"Une erreur est survenue"}};exports.Default=o;exports.default=t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../FileList/FileList.cjs.js");require("react/jsx-runtime");const t={title:"Components/FileList",component:e},l={args:{files:[{name:"sample.csv",size:500,uploading:!1},{name:"components_lists_filelist.png",size:1780,uploading:!0}],onDelete:s=>alert("delete")}};exports.Default=l;exports.default=t;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
|
|
1
|
+
import e from "../FileList/FileList.es.js";
|
|
2
|
+
import "react/jsx-runtime";
|
|
3
|
+
const i = {
|
|
3
4
|
title: "Components/FileList",
|
|
4
5
|
component: e
|
|
5
|
-
},
|
|
6
|
+
}, o = {
|
|
6
7
|
args: {
|
|
7
8
|
files: [
|
|
8
9
|
{
|
|
@@ -20,6 +21,6 @@ const s = {
|
|
|
20
21
|
}
|
|
21
22
|
};
|
|
22
23
|
export {
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
o as Default,
|
|
25
|
+
i as default
|
|
25
26
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),o=require("../../createSvgIcon-GU7fqNnI.cjs"),t=require("../Heading/Heading.cjs.js"),n=require("../../identifier-BQH88SE0.cjs"),c=o.createSvgIcon(e.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8m3.5-9c.83 0 1.5-.67 1.5-1.5S16.33 8 15.5 8 14 8.67 14 9.5s.67 1.5 1.5 1.5m-7 0c.83 0 1.5-.67 1.5-1.5S9.33 8 8.5 8 7 8.67 7 9.5 7.67 11 8.5 11m3.5 6.5c2.33 0 4.31-1.46 5.11-3.5H6.89c.8 2.04 2.78 3.5 5.11 3.5"}),"Mood"),i={title:"Components/Heading",component:t},r={args:{title:"Heading",iconColor:n.red,IconComponent:c}};exports.Default=r;exports.default=i;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { c as t } from "../../createSvgIcon-
|
|
3
|
-
import n from "
|
|
4
|
-
import { r as c } from "../../identifier-
|
|
2
|
+
import { c as t } from "../../createSvgIcon-DxbvMQd7.js";
|
|
3
|
+
import n from "../Heading/Heading.es.js";
|
|
4
|
+
import { r as c } from "../../identifier-BqadgaK7.js";
|
|
5
5
|
const e = t(/* @__PURE__ */ o("path", {
|
|
6
6
|
d: "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8m3.5-9c.83 0 1.5-.67 1.5-1.5S16.33 8 15.5 8 14 8.67 14 9.5s.67 1.5 1.5 1.5m-7 0c.83 0 1.5-.67 1.5-1.5S9.33 8 8.5 8 7 8.67 7 9.5 7.67 11 8.5 11m3.5 6.5c2.33 0 4.31-1.46 5.11-3.5H6.89c.8 2.04 2.78 3.5 5.11 3.5"
|
|
7
7
|
}), "Mood"), i = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
-
import { c as t } from "../../createSvgIcon-
|
|
3
|
-
import { I as o } from "../../IconButton-
|
|
2
|
+
import { c as t } from "../../createSvgIcon-DxbvMQd7.js";
|
|
3
|
+
import { I as o } from "../../IconButton-Av8eJ5IG.js";
|
|
4
4
|
const s = t(/* @__PURE__ */ c("path", {
|
|
5
5
|
d: "M17.81 4.47c-.08 0-.16-.02-.23-.06C15.66 3.42 14 3 12.01 3c-1.98 0-3.86.47-5.57 1.41-.24.13-.54.04-.68-.2-.13-.24-.04-.55.2-.68C7.82 2.52 9.86 2 12.01 2c2.13 0 3.99.47 6.03 1.52.25.13.34.43.21.67-.09.18-.26.28-.44.28M3.5 9.72c-.1 0-.2-.03-.29-.09-.23-.16-.28-.47-.12-.7.99-1.4 2.25-2.5 3.75-3.27C9.98 4.04 14 4.03 17.15 5.65c1.5.77 2.76 1.86 3.75 3.25.16.22.11.54-.12.7s-.54.11-.7-.12c-.9-1.26-2.04-2.25-3.39-2.94-2.87-1.47-6.54-1.47-9.4.01-1.36.7-2.5 1.7-3.4 2.96-.08.14-.23.21-.39.21m6.25 12.07c-.13 0-.26-.05-.35-.15-.87-.87-1.34-1.43-2.01-2.64-.69-1.23-1.05-2.73-1.05-4.34 0-2.97 2.54-5.39 5.66-5.39s5.66 2.42 5.66 5.39c0 .28-.22.5-.5.5s-.5-.22-.5-.5c0-2.42-2.09-4.39-4.66-4.39s-4.66 1.97-4.66 4.39c0 1.44.32 2.77.93 3.85.64 1.15 1.08 1.64 1.85 2.42.19.2.19.51 0 .71-.11.1-.24.15-.37.15m7.17-1.85c-1.19 0-2.24-.3-3.1-.89-1.49-1.01-2.38-2.65-2.38-4.39 0-.28.22-.5.5-.5s.5.22.5.5c0 1.41.72 2.74 1.94 3.56.71.48 1.54.71 2.54.71.24 0 .64-.03 1.04-.1.27-.05.53.13.58.41.05.27-.13.53-.41.58-.57.11-1.07.12-1.21.12M14.91 22c-.04 0-.09-.01-.13-.02-1.59-.44-2.63-1.03-3.72-2.1-1.4-1.39-2.17-3.24-2.17-5.22 0-1.62 1.38-2.94 3.08-2.94s3.08 1.32 3.08 2.94c0 1.07.93 1.94 2.08 1.94s2.08-.87 2.08-1.94c0-3.77-3.25-6.83-7.25-6.83-2.84 0-5.44 1.58-6.61 4.03-.39.81-.59 1.76-.59 2.8 0 .78.07 2.01.67 3.61.1.26-.03.55-.29.64-.26.1-.55-.04-.64-.29-.49-1.31-.73-2.61-.73-3.96 0-1.2.23-2.29.68-3.24 1.33-2.79 4.28-4.6 7.51-4.6 4.55 0 8.25 3.51 8.25 7.83 0 1.62-1.38 2.94-3.08 2.94s-3.08-1.32-3.08-2.94c0-1.07-.93-1.94-2.08-1.94s-2.08.87-2.08 1.94c0 1.71.66 3.31 1.87 4.51.95.94 1.86 1.46 3.27 1.85.27.07.42.35.35.61-.05.23-.26.38-.47.38"
|
|
6
6
|
}), "Fingerprint"), a = {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../Loader/Loader.cjs.js"),t={title:"Components/Loader",component:e},o={args:{}};exports.Default=o;exports.default=t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../LoaderBackdrop/LoaderBackdrop.cjs.js"),o={title:"Components/LoaderBackdrop",component:e},t={args:{}};exports.Default=t;exports.default=o;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import {
|
|
2
|
+
import { LoaderBackdrop } from '../LoaderBackdrop';
|
|
3
3
|
declare const meta: Meta<typeof LoaderBackdrop>;
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof LoaderBackdrop>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../PasswordInput/PasswordInput.cjs.js"),t={title:"Components/PasswordInput",component:e},o={args:{label:"Password"}};exports.Default=o;exports.default=t;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import {
|
|
2
|
+
import { PasswordInput } from '../PasswordInput';
|
|
3
3
|
declare const meta: Meta<typeof PasswordInput>;
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof PasswordInput>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),O=require("../../FormLabel-D8jYibc1.cjs"),B=require("react"),o=require("../../identifier-BQH88SE0.cjs"),D=require("../../useControlled-Ysk4KqoX.cjs"),E=require("../../useForkRef-D81w5oMb.cjs"),U=require("../../useId-DNXtOFeX.cjs"),v=require("../../FormGroup-BBYEQB4C.cjs"),c=require("../../DefaultPropsProvider-BrX6iuA3.cjs"),_=require("../../SwitchBase-URM3X3YZ.cjs"),G=require("../../createSvgIcon-GU7fqNnI.cjs"),V=require("../../memoTheme-B6o2KVgJ.cjs"),L=require("../../useFormControl-haP0iPhl.cjs"),F=require("../../createSimplePaletteValueFilter-PTK3TAhW.cjs"),H=require("../../refType-Do7KaOvv.cjs");function Z(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const l=Z(B),A=G.createSvgIcon(s.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"RadioButtonUnchecked"),J=G.createSvgIcon(s.jsx("path",{d:"M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"}),"RadioButtonChecked"),K=c.styled("span",{shouldForwardProp:c.rootShouldForwardProp})({position:"relative",display:"flex"}),Q=c.styled(A)({transform:"scale(1)"}),W=c.styled(J)(V.memoTheme(({theme:e})=>({left:0,position:"absolute",transform:"scale(0)",transition:e.transitions.create("transform",{easing:e.transitions.easing.easeIn,duration:e.transitions.duration.shortest}),variants:[{props:{checked:!0},style:{transform:"scale(1)",transition:e.transitions.create("transform",{easing:e.transitions.easing.easeOut,duration:e.transitions.duration.shortest})}}]})));function w(e){const{checked:r=!1,classes:t={},fontSize:a}=e,n={...e,checked:r};return s.jsxs(K,{className:t.root,ownerState:n,children:[s.jsx(Q,{fontSize:a,className:t.background,ownerState:n}),s.jsx(W,{fontSize:a,className:t.dot,ownerState:n})]})}process.env.NODE_ENV!=="production"&&(w.propTypes={checked:o.PropTypes.bool,classes:o.PropTypes.object,fontSize:o.PropTypes.oneOf(["small","medium"])});const z=l.createContext(void 0);process.env.NODE_ENV!=="production"&&(z.displayName="RadioGroupContext");function X(){return l.useContext(z)}function Y(e){return o.generateUtilityClass("MuiRadio",e)}const q=o.generateUtilityClasses("MuiRadio",["root","checked","disabled","colorPrimary","colorSecondary","sizeSmall"]),ee=e=>{const{classes:r,color:t,size:a}=e,n={root:["root",`color${o.capitalize(t)}`,a!=="medium"&&`size${o.capitalize(a)}`]};return{...r,...c.composeClasses(n,Y,r)}},oe=c.styled(_.SwitchBase,{shouldForwardProp:e=>c.rootShouldForwardProp(e)||e==="classes",name:"MuiRadio",slot:"Root",overridesResolver:(e,r)=>{const{ownerState:t}=e;return[r.root,t.size!=="medium"&&r[`size${o.capitalize(t.size)}`],r[`color${o.capitalize(t.color)}`]]}})(V.memoTheme(({theme:e})=>({color:(e.vars||e).palette.text.secondary,[`&.${q.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:{color:"default",disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:o.alpha(e.palette.action.active,e.palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter(F.createSimplePaletteValueFilter()).map(([r])=>({props:{color:r,disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette[r].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:o.alpha(e.palette[r].main,e.palette.action.hoverOpacity)}}})),...Object.entries(e.palette).filter(F.createSimplePaletteValueFilter()).map(([r])=>({props:{color:r,disabled:!1},style:{[`&.${q.checked}`]:{color:(e.vars||e).palette[r].main}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]})));function re(e,r){return typeof r=="object"&&r!==null?e===r:String(e)===String(r)}const N=s.jsx(w,{checked:!0}),I=s.jsx(w,{}),T=l.forwardRef(function(r,t){const a=c.useDefaultProps({props:r,name:"MuiRadio"}),{checked:n,checkedIcon:C=N,color:R="primary",icon:h=I,name:u,onChange:S,size:d="medium",className:f,disabled:j,disableRipple:m=!1,...b}=a,P=L.useFormControl();let p=j;P&&typeof p>"u"&&(p=P.disabled),p??(p=!1);const g={...a,disabled:p,disableRipple:m,color:R,size:d},i=ee(g),y=X();let x=n;const $=O.createChainedFunction(S,y&&y.onChange);let k=u;return y&&(typeof x>"u"&&(x=re(y.value,a.value)),typeof k>"u"&&(k=y.name)),s.jsx(oe,{type:"radio",icon:l.cloneElement(h,{fontSize:I.props.fontSize??d}),checkedIcon:l.cloneElement(C,{fontSize:N.props.fontSize??d}),disabled:p,ownerState:g,classes:i,name:k,checked:x,onChange:$,ref:t,className:o.clsx(i.root,f),...b})});process.env.NODE_ENV!=="production"&&(T.propTypes={checked:o.PropTypes.bool,checkedIcon:o.PropTypes.node,classes:o.PropTypes.object,className:o.PropTypes.string,color:o.PropTypes.oneOfType([o.PropTypes.oneOf(["default","primary","secondary","error","info","success","warning"]),o.PropTypes.string]),disabled:o.PropTypes.bool,disableRipple:o.PropTypes.bool,icon:o.PropTypes.node,id:o.PropTypes.string,inputProps:o.PropTypes.object,inputRef:H.refType,name:o.PropTypes.string,onChange:o.PropTypes.func,required:o.PropTypes.bool,size:o.PropTypes.oneOfType([o.PropTypes.oneOf(["medium","small"]),o.PropTypes.string]),sx:o.PropTypes.oneOfType([o.PropTypes.arrayOf(o.PropTypes.oneOfType([o.PropTypes.func,o.PropTypes.object,o.PropTypes.bool])),o.PropTypes.func,o.PropTypes.object]),value:o.PropTypes.any});function te(e){return o.generateUtilityClass("MuiRadioGroup",e)}o.generateUtilityClasses("MuiRadioGroup",["root","row","error"]);const se=e=>{const{classes:r,row:t,error:a}=e,n={root:["root",t&&"row",a&&"error"]};return c.composeClasses(n,te,r)},M=l.forwardRef(function(r,t){const{actions:a,children:n,className:C,defaultValue:R,name:h,onChange:u,value:S,...d}=r,f=l.useRef(null),j=se(r),[m,b]=D.useControlled({controlled:S,default:R,name:"RadioGroup"});l.useImperativeHandle(a,()=>({focus:()=>{let i=f.current.querySelector("input:not(:disabled):checked");i||(i=f.current.querySelector("input:not(:disabled)")),i&&i.focus()}}),[]);const P=E.useForkRef(t,f),p=U.useId(h),g=l.useMemo(()=>({name:p,onChange(i){b(i.target.value),u&&u(i,i.target.value)},value:m}),[p,u,b,m]);return s.jsx(z.Provider,{value:g,children:s.jsx(v.FormGroup,{role:"radiogroup",ref:P,className:o.clsx(j.root,C),...d,children:n})})});process.env.NODE_ENV!=="production"&&(M.propTypes={children:o.PropTypes.node,className:o.PropTypes.string,defaultValue:o.PropTypes.any,name:o.PropTypes.string,onChange:o.PropTypes.func,value:o.PropTypes.any});const ae=e=>s.jsxs(O.FormControl,{children:[s.jsx(O.FormLabel,{id:"radio-buttons-group-label",children:"Label"}),s.jsxs(M,{"aria-labelledby":"radio-buttons-group-label",defaultValue:"first",name:"radio-buttons-group",...e,children:[s.jsx(v.FormControlLabel,{value:"first",control:s.jsx(T,{}),label:"First"}),s.jsx(v.FormControlLabel,{value:"second",control:s.jsx(T,{}),label:"Second"}),s.jsx(v.FormControlLabel,{value:"third",control:s.jsx(T,{}),label:"Third"})]})]}),ne={title:"Components/RadioGroup",component:ae},ie={args:{row:!1}},le={args:{row:!0}};exports.Default=ie;exports.Row=le;exports.default=ne;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RadioGroupProps } from '@mui/material/RadioGroup';
|
|
2
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
declare const RadioGroup: (props: RadioGroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare const meta: Meta<typeof RadioGroup>;
|
|
5
|
+
export default meta;
|
|
6
|
+
type Story = StoryObj<typeof RadioGroup>;
|
|
7
|
+
export declare const Default: Story;
|
|
8
|
+
export declare const Row: Story;
|
|
@@ -0,0 +1,434 @@
|
|
|
1
|
+
import { jsx as t, jsxs as P } from "react/jsx-runtime";
|
|
2
|
+
import { e as J, F as K, a as Z } from "../../FormLabel-B4QlkhhB.js";
|
|
3
|
+
import * as l from "react";
|
|
4
|
+
import { P as e, J as j, I as B, L as y, n as x, K as M } from "../../identifier-BqadgaK7.js";
|
|
5
|
+
import { u as A } from "../../useControlled-BYdyS7Pn.js";
|
|
6
|
+
import { u as Q } from "../../useForkRef-D-DyzOXj.js";
|
|
7
|
+
import { u as W } from "../../useId-CK6Kn3Tn.js";
|
|
8
|
+
import { a as X, F as I } from "../../FormGroup-BVtE8Mrv.js";
|
|
9
|
+
import { s as C, r as U, u as Y, c as D } from "../../DefaultPropsProvider-CaRoy5OV.js";
|
|
10
|
+
import { S as oo } from "../../SwitchBase-yCuH0Tqk.js";
|
|
11
|
+
import { c as q } from "../../createSvgIcon-DxbvMQd7.js";
|
|
12
|
+
import { m as L } from "../../memoTheme-DfGVDRrB.js";
|
|
13
|
+
import { u as eo } from "../../useFormControl-CatNKXAi.js";
|
|
14
|
+
import { c as $ } from "../../createSimplePaletteValueFilter-B7--0ryQ.js";
|
|
15
|
+
import { r as ao } from "../../refType-DlHf9HvO.js";
|
|
16
|
+
const to = q(/* @__PURE__ */ t("path", {
|
|
17
|
+
d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"
|
|
18
|
+
}), "RadioButtonUnchecked"), ro = q(/* @__PURE__ */ t("path", {
|
|
19
|
+
d: "M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"
|
|
20
|
+
}), "RadioButtonChecked"), so = C("span", {
|
|
21
|
+
shouldForwardProp: U
|
|
22
|
+
})({
|
|
23
|
+
position: "relative",
|
|
24
|
+
display: "flex"
|
|
25
|
+
}), no = C(to)({
|
|
26
|
+
// Scale applied to prevent dot misalignment in Safari
|
|
27
|
+
transform: "scale(1)"
|
|
28
|
+
}), io = C(ro)(L(({
|
|
29
|
+
theme: o
|
|
30
|
+
}) => ({
|
|
31
|
+
left: 0,
|
|
32
|
+
position: "absolute",
|
|
33
|
+
transform: "scale(0)",
|
|
34
|
+
transition: o.transitions.create("transform", {
|
|
35
|
+
easing: o.transitions.easing.easeIn,
|
|
36
|
+
duration: o.transitions.duration.shortest
|
|
37
|
+
}),
|
|
38
|
+
variants: [{
|
|
39
|
+
props: {
|
|
40
|
+
checked: !0
|
|
41
|
+
},
|
|
42
|
+
style: {
|
|
43
|
+
transform: "scale(1)",
|
|
44
|
+
transition: o.transitions.create("transform", {
|
|
45
|
+
easing: o.transitions.easing.easeOut,
|
|
46
|
+
duration: o.transitions.duration.shortest
|
|
47
|
+
})
|
|
48
|
+
}
|
|
49
|
+
}]
|
|
50
|
+
})));
|
|
51
|
+
function F(o) {
|
|
52
|
+
const {
|
|
53
|
+
checked: a = !1,
|
|
54
|
+
classes: r = {},
|
|
55
|
+
fontSize: s
|
|
56
|
+
} = o, i = {
|
|
57
|
+
...o,
|
|
58
|
+
checked: a
|
|
59
|
+
};
|
|
60
|
+
return /* @__PURE__ */ P(so, {
|
|
61
|
+
className: r.root,
|
|
62
|
+
ownerState: i,
|
|
63
|
+
children: [/* @__PURE__ */ t(no, {
|
|
64
|
+
fontSize: s,
|
|
65
|
+
className: r.background,
|
|
66
|
+
ownerState: i
|
|
67
|
+
}), /* @__PURE__ */ t(io, {
|
|
68
|
+
fontSize: s,
|
|
69
|
+
className: r.dot,
|
|
70
|
+
ownerState: i
|
|
71
|
+
})]
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
process.env.NODE_ENV !== "production" && (F.propTypes = {
|
|
75
|
+
/**
|
|
76
|
+
* If `true`, the component is checked.
|
|
77
|
+
*/
|
|
78
|
+
checked: e.bool,
|
|
79
|
+
/**
|
|
80
|
+
* Override or extend the styles applied to the component.
|
|
81
|
+
*/
|
|
82
|
+
classes: e.object,
|
|
83
|
+
/**
|
|
84
|
+
* The size of the component.
|
|
85
|
+
* `small` is equivalent to the dense radio styling.
|
|
86
|
+
*/
|
|
87
|
+
fontSize: e.oneOf(["small", "medium"])
|
|
88
|
+
});
|
|
89
|
+
const G = /* @__PURE__ */ l.createContext(void 0);
|
|
90
|
+
process.env.NODE_ENV !== "production" && (G.displayName = "RadioGroupContext");
|
|
91
|
+
function lo() {
|
|
92
|
+
return l.useContext(G);
|
|
93
|
+
}
|
|
94
|
+
function co(o) {
|
|
95
|
+
return B("MuiRadio", o);
|
|
96
|
+
}
|
|
97
|
+
const E = j("MuiRadio", ["root", "checked", "disabled", "colorPrimary", "colorSecondary", "sizeSmall"]), uo = (o) => {
|
|
98
|
+
const {
|
|
99
|
+
classes: a,
|
|
100
|
+
color: r,
|
|
101
|
+
size: s
|
|
102
|
+
} = o, i = {
|
|
103
|
+
root: ["root", `color${y(r)}`, s !== "medium" && `size${y(s)}`]
|
|
104
|
+
};
|
|
105
|
+
return {
|
|
106
|
+
...a,
|
|
107
|
+
...D(i, co, a)
|
|
108
|
+
};
|
|
109
|
+
}, po = C(oo, {
|
|
110
|
+
shouldForwardProp: (o) => U(o) || o === "classes",
|
|
111
|
+
name: "MuiRadio",
|
|
112
|
+
slot: "Root",
|
|
113
|
+
overridesResolver: (o, a) => {
|
|
114
|
+
const {
|
|
115
|
+
ownerState: r
|
|
116
|
+
} = o;
|
|
117
|
+
return [a.root, r.size !== "medium" && a[`size${y(r.size)}`], a[`color${y(r.color)}`]];
|
|
118
|
+
}
|
|
119
|
+
})(L(({
|
|
120
|
+
theme: o
|
|
121
|
+
}) => ({
|
|
122
|
+
color: (o.vars || o).palette.text.secondary,
|
|
123
|
+
[`&.${E.disabled}`]: {
|
|
124
|
+
color: (o.vars || o).palette.action.disabled
|
|
125
|
+
},
|
|
126
|
+
variants: [{
|
|
127
|
+
props: {
|
|
128
|
+
color: "default",
|
|
129
|
+
disabled: !1,
|
|
130
|
+
disableRipple: !1
|
|
131
|
+
},
|
|
132
|
+
style: {
|
|
133
|
+
"&:hover": {
|
|
134
|
+
backgroundColor: o.vars ? `rgba(${o.vars.palette.action.activeChannel} / ${o.vars.palette.action.hoverOpacity})` : x(o.palette.action.active, o.palette.action.hoverOpacity)
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}, ...Object.entries(o.palette).filter($()).map(([a]) => ({
|
|
138
|
+
props: {
|
|
139
|
+
color: a,
|
|
140
|
+
disabled: !1,
|
|
141
|
+
disableRipple: !1
|
|
142
|
+
},
|
|
143
|
+
style: {
|
|
144
|
+
"&:hover": {
|
|
145
|
+
backgroundColor: o.vars ? `rgba(${o.vars.palette[a].mainChannel} / ${o.vars.palette.action.hoverOpacity})` : x(o.palette[a].main, o.palette.action.hoverOpacity)
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
})), ...Object.entries(o.palette).filter($()).map(([a]) => ({
|
|
149
|
+
props: {
|
|
150
|
+
color: a,
|
|
151
|
+
disabled: !1
|
|
152
|
+
},
|
|
153
|
+
style: {
|
|
154
|
+
[`&.${E.checked}`]: {
|
|
155
|
+
color: (o.vars || o).palette[a].main
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
})), {
|
|
159
|
+
// Should be last to override other colors
|
|
160
|
+
props: {
|
|
161
|
+
disableRipple: !1
|
|
162
|
+
},
|
|
163
|
+
style: {
|
|
164
|
+
// Reset on touch devices, it doesn't add specificity
|
|
165
|
+
"&:hover": {
|
|
166
|
+
"@media (hover: none)": {
|
|
167
|
+
backgroundColor: "transparent"
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}]
|
|
172
|
+
})));
|
|
173
|
+
function fo(o, a) {
|
|
174
|
+
return typeof a == "object" && a !== null ? o === a : String(o) === String(a);
|
|
175
|
+
}
|
|
176
|
+
const T = /* @__PURE__ */ t(F, {
|
|
177
|
+
checked: !0
|
|
178
|
+
}), V = /* @__PURE__ */ t(F, {}), g = /* @__PURE__ */ l.forwardRef(function(a, r) {
|
|
179
|
+
const s = Y({
|
|
180
|
+
props: a,
|
|
181
|
+
name: "MuiRadio"
|
|
182
|
+
}), {
|
|
183
|
+
checked: i,
|
|
184
|
+
checkedIcon: h = T,
|
|
185
|
+
color: S = "primary",
|
|
186
|
+
icon: k = V,
|
|
187
|
+
name: d,
|
|
188
|
+
onChange: w,
|
|
189
|
+
size: u = "medium",
|
|
190
|
+
className: p,
|
|
191
|
+
disabled: z,
|
|
192
|
+
disableRipple: m = !1,
|
|
193
|
+
...b
|
|
194
|
+
} = s, v = eo();
|
|
195
|
+
let c = z;
|
|
196
|
+
v && typeof c > "u" && (c = v.disabled), c ?? (c = !1);
|
|
197
|
+
const R = {
|
|
198
|
+
...s,
|
|
199
|
+
disabled: c,
|
|
200
|
+
disableRipple: m,
|
|
201
|
+
color: S,
|
|
202
|
+
size: u
|
|
203
|
+
}, n = uo(R), f = lo();
|
|
204
|
+
let O = i;
|
|
205
|
+
const H = J(w, f && f.onChange);
|
|
206
|
+
let N = d;
|
|
207
|
+
return f && (typeof O > "u" && (O = fo(f.value, s.value)), typeof N > "u" && (N = f.name)), /* @__PURE__ */ t(po, {
|
|
208
|
+
type: "radio",
|
|
209
|
+
icon: /* @__PURE__ */ l.cloneElement(k, {
|
|
210
|
+
fontSize: V.props.fontSize ?? u
|
|
211
|
+
}),
|
|
212
|
+
checkedIcon: /* @__PURE__ */ l.cloneElement(h, {
|
|
213
|
+
fontSize: T.props.fontSize ?? u
|
|
214
|
+
}),
|
|
215
|
+
disabled: c,
|
|
216
|
+
ownerState: R,
|
|
217
|
+
classes: n,
|
|
218
|
+
name: N,
|
|
219
|
+
checked: O,
|
|
220
|
+
onChange: H,
|
|
221
|
+
ref: r,
|
|
222
|
+
className: M(n.root, p),
|
|
223
|
+
...b
|
|
224
|
+
});
|
|
225
|
+
});
|
|
226
|
+
process.env.NODE_ENV !== "production" && (g.propTypes = {
|
|
227
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
228
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
229
|
+
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
230
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
231
|
+
/**
|
|
232
|
+
* If `true`, the component is checked.
|
|
233
|
+
*/
|
|
234
|
+
checked: e.bool,
|
|
235
|
+
/**
|
|
236
|
+
* The icon to display when the component is checked.
|
|
237
|
+
* @default <RadioButtonIcon checked />
|
|
238
|
+
*/
|
|
239
|
+
checkedIcon: e.node,
|
|
240
|
+
/**
|
|
241
|
+
* Override or extend the styles applied to the component.
|
|
242
|
+
*/
|
|
243
|
+
classes: e.object,
|
|
244
|
+
/**
|
|
245
|
+
* @ignore
|
|
246
|
+
*/
|
|
247
|
+
className: e.string,
|
|
248
|
+
/**
|
|
249
|
+
* The color of the component.
|
|
250
|
+
* It supports both default and custom theme colors, which can be added as shown in the
|
|
251
|
+
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
|
252
|
+
* @default 'primary'
|
|
253
|
+
*/
|
|
254
|
+
color: e.oneOfType([e.oneOf(["default", "primary", "secondary", "error", "info", "success", "warning"]), e.string]),
|
|
255
|
+
/**
|
|
256
|
+
* If `true`, the component is disabled.
|
|
257
|
+
*/
|
|
258
|
+
disabled: e.bool,
|
|
259
|
+
/**
|
|
260
|
+
* If `true`, the ripple effect is disabled.
|
|
261
|
+
* @default false
|
|
262
|
+
*/
|
|
263
|
+
disableRipple: e.bool,
|
|
264
|
+
/**
|
|
265
|
+
* The icon to display when the component is unchecked.
|
|
266
|
+
* @default <RadioButtonIcon />
|
|
267
|
+
*/
|
|
268
|
+
icon: e.node,
|
|
269
|
+
/**
|
|
270
|
+
* The id of the `input` element.
|
|
271
|
+
*/
|
|
272
|
+
id: e.string,
|
|
273
|
+
/**
|
|
274
|
+
* [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.
|
|
275
|
+
*/
|
|
276
|
+
inputProps: e.object,
|
|
277
|
+
/**
|
|
278
|
+
* Pass a ref to the `input` element.
|
|
279
|
+
*/
|
|
280
|
+
inputRef: ao,
|
|
281
|
+
/**
|
|
282
|
+
* Name attribute of the `input` element.
|
|
283
|
+
*/
|
|
284
|
+
name: e.string,
|
|
285
|
+
/**
|
|
286
|
+
* Callback fired when the state is changed.
|
|
287
|
+
*
|
|
288
|
+
* @param {React.ChangeEvent<HTMLInputElement>} event The event source of the callback.
|
|
289
|
+
* You can pull out the new value by accessing `event.target.value` (string).
|
|
290
|
+
* You can pull out the new checked state by accessing `event.target.checked` (boolean).
|
|
291
|
+
*/
|
|
292
|
+
onChange: e.func,
|
|
293
|
+
/**
|
|
294
|
+
* If `true`, the `input` element is required.
|
|
295
|
+
* @default false
|
|
296
|
+
*/
|
|
297
|
+
required: e.bool,
|
|
298
|
+
/**
|
|
299
|
+
* The size of the component.
|
|
300
|
+
* `small` is equivalent to the dense radio styling.
|
|
301
|
+
* @default 'medium'
|
|
302
|
+
*/
|
|
303
|
+
size: e.oneOfType([e.oneOf(["medium", "small"]), e.string]),
|
|
304
|
+
/**
|
|
305
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
306
|
+
*/
|
|
307
|
+
sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
|
|
308
|
+
/**
|
|
309
|
+
* The value of the component. The DOM API casts this to a string.
|
|
310
|
+
*/
|
|
311
|
+
value: e.any
|
|
312
|
+
});
|
|
313
|
+
function mo(o) {
|
|
314
|
+
return B("MuiRadioGroup", o);
|
|
315
|
+
}
|
|
316
|
+
j("MuiRadioGroup", ["root", "row", "error"]);
|
|
317
|
+
const bo = (o) => {
|
|
318
|
+
const {
|
|
319
|
+
classes: a,
|
|
320
|
+
row: r,
|
|
321
|
+
error: s
|
|
322
|
+
} = o;
|
|
323
|
+
return D({
|
|
324
|
+
root: ["root", r && "row", s && "error"]
|
|
325
|
+
}, mo, a);
|
|
326
|
+
}, _ = /* @__PURE__ */ l.forwardRef(function(a, r) {
|
|
327
|
+
const {
|
|
328
|
+
// private
|
|
329
|
+
// eslint-disable-next-line react/prop-types
|
|
330
|
+
actions: s,
|
|
331
|
+
children: i,
|
|
332
|
+
className: h,
|
|
333
|
+
defaultValue: S,
|
|
334
|
+
name: k,
|
|
335
|
+
onChange: d,
|
|
336
|
+
value: w,
|
|
337
|
+
...u
|
|
338
|
+
} = a, p = l.useRef(null), z = bo(a), [m, b] = A({
|
|
339
|
+
controlled: w,
|
|
340
|
+
default: S,
|
|
341
|
+
name: "RadioGroup"
|
|
342
|
+
});
|
|
343
|
+
l.useImperativeHandle(s, () => ({
|
|
344
|
+
focus: () => {
|
|
345
|
+
let n = p.current.querySelector("input:not(:disabled):checked");
|
|
346
|
+
n || (n = p.current.querySelector("input:not(:disabled)")), n && n.focus();
|
|
347
|
+
}
|
|
348
|
+
}), []);
|
|
349
|
+
const v = Q(r, p), c = W(k), R = l.useMemo(() => ({
|
|
350
|
+
name: c,
|
|
351
|
+
onChange(n) {
|
|
352
|
+
b(n.target.value), d && d(n, n.target.value);
|
|
353
|
+
},
|
|
354
|
+
value: m
|
|
355
|
+
}), [c, d, b, m]);
|
|
356
|
+
return /* @__PURE__ */ t(G.Provider, {
|
|
357
|
+
value: R,
|
|
358
|
+
children: /* @__PURE__ */ t(X, {
|
|
359
|
+
role: "radiogroup",
|
|
360
|
+
ref: v,
|
|
361
|
+
className: M(z.root, h),
|
|
362
|
+
...u,
|
|
363
|
+
children: i
|
|
364
|
+
})
|
|
365
|
+
});
|
|
366
|
+
});
|
|
367
|
+
process.env.NODE_ENV !== "production" && (_.propTypes = {
|
|
368
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
369
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
370
|
+
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
371
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
372
|
+
/**
|
|
373
|
+
* The content of the component.
|
|
374
|
+
*/
|
|
375
|
+
children: e.node,
|
|
376
|
+
/**
|
|
377
|
+
* @ignore
|
|
378
|
+
*/
|
|
379
|
+
className: e.string,
|
|
380
|
+
/**
|
|
381
|
+
* The default value. Use when the component is not controlled.
|
|
382
|
+
*/
|
|
383
|
+
defaultValue: e.any,
|
|
384
|
+
/**
|
|
385
|
+
* The name used to reference the value of the control.
|
|
386
|
+
* If you don't provide this prop, it falls back to a randomly generated name.
|
|
387
|
+
*/
|
|
388
|
+
name: e.string,
|
|
389
|
+
/**
|
|
390
|
+
* Callback fired when a radio button is selected.
|
|
391
|
+
*
|
|
392
|
+
* @param {React.ChangeEvent<HTMLInputElement>} event The event source of the callback.
|
|
393
|
+
* @param {string} value The value of the selected radio button.
|
|
394
|
+
* You can pull out the new value by accessing `event.target.value` (string).
|
|
395
|
+
*/
|
|
396
|
+
onChange: e.func,
|
|
397
|
+
/**
|
|
398
|
+
* Value of the selected radio button. The DOM API casts this to a string.
|
|
399
|
+
*/
|
|
400
|
+
value: e.any
|
|
401
|
+
});
|
|
402
|
+
const vo = (o) => /* @__PURE__ */ P(K, { children: [
|
|
403
|
+
/* @__PURE__ */ t(Z, { id: "radio-buttons-group-label", children: "Label" }),
|
|
404
|
+
/* @__PURE__ */ P(
|
|
405
|
+
_,
|
|
406
|
+
{
|
|
407
|
+
"aria-labelledby": "radio-buttons-group-label",
|
|
408
|
+
defaultValue: "first",
|
|
409
|
+
name: "radio-buttons-group",
|
|
410
|
+
...o,
|
|
411
|
+
children: [
|
|
412
|
+
/* @__PURE__ */ t(I, { value: "first", control: /* @__PURE__ */ t(g, {}), label: "First" }),
|
|
413
|
+
/* @__PURE__ */ t(I, { value: "second", control: /* @__PURE__ */ t(g, {}), label: "Second" }),
|
|
414
|
+
/* @__PURE__ */ t(I, { value: "third", control: /* @__PURE__ */ t(g, {}), label: "Third" })
|
|
415
|
+
]
|
|
416
|
+
}
|
|
417
|
+
)
|
|
418
|
+
] }), Go = {
|
|
419
|
+
title: "Components/RadioGroup",
|
|
420
|
+
component: vo
|
|
421
|
+
}, xo = {
|
|
422
|
+
args: {
|
|
423
|
+
row: !1
|
|
424
|
+
}
|
|
425
|
+
}, $o = {
|
|
426
|
+
args: {
|
|
427
|
+
row: !0
|
|
428
|
+
}
|
|
429
|
+
};
|
|
430
|
+
export {
|
|
431
|
+
xo as Default,
|
|
432
|
+
$o as Row,
|
|
433
|
+
Go as default
|
|
434
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../SearchInput/SearchInput.cjs.js"),t={title:"Components/SearchInput",component:e},o={args:{placeholder:"Rechercher"}};exports.Default=o;exports.default=t;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import {
|
|
2
|
+
import { SearchInput } from '../SearchInput';
|
|
3
3
|
declare const meta: Meta<typeof SearchInput>;
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof SearchInput>;
|