@kirill.konshin/mui 0.0.1 → 0.0.3
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/appBarOffset.d.ts +5 -0
- package/dist/appBarOffset.d.ts.map +1 -0
- package/dist/appBarOffset.js +14 -0
- package/dist/appBarOffset.js.map +1 -0
- package/dist/formControlFieldset.d.ts +1 -1
- package/dist/formControlFieldset.d.ts.map +1 -1
- package/dist/formControlFieldset.js +18 -26
- package/dist/formControlFieldset.js.map +1 -1
- package/dist/formControlFieldset.stories.d.ts +2 -2
- package/dist/formControlFieldset.stories.d.ts.map +1 -1
- package/dist/formLabelLegend.d.ts +2 -1
- package/dist/formLabelLegend.d.ts.map +1 -1
- package/dist/formLabelLegend.js +14 -10
- package/dist/formLabelLegend.js.map +1 -1
- package/dist/formLabelLegend.stories.d.ts +13 -0
- package/dist/formLabelLegend.stories.d.ts.map +1 -0
- package/dist/genericControl.d.ts.map +1 -1
- package/dist/genericControl.js +17 -18
- package/dist/genericControl.js.map +1 -1
- package/dist/genericControl.stories.d.ts +12 -0
- package/dist/genericControl.stories.d.ts.map +1 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -8
- package/dist/readOnly.d.ts +3 -2
- package/dist/readOnly.d.ts.map +1 -1
- package/dist/readOnly.js +16 -5
- package/dist/readOnly.js.map +1 -1
- package/dist/readOnly.stories.d.ts +12 -0
- package/dist/readOnly.stories.d.ts.map +1 -0
- package/package.json +17 -5
- package/.ctirc +0 -11
- package/.storybook/main.ts +0 -2
- package/.storybook/preview.ts +0 -2
- package/.turbo/turbo-build.log +0 -16
- package/dist/index.js.map +0 -1
- package/src/README.md +0 -3
- package/src/formControlFieldset.stories.tsx +0 -71
- package/src/formControlFieldset.tsx +0 -26
- package/src/formLabelLegend.tsx +0 -11
- package/src/genericControl.tsx +0 -20
- package/src/index.ts +0 -4
- package/src/readOnly.tsx +0 -6
- package/tsconfig.json +0 -10
- package/turbo.json +0 -10
- package/vite.config.ts +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appBarOffset.d.ts","sourceRoot":"","sources":["../src/appBarOffset.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,EAAE,EAAQ,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElE,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC;AAEzC,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAE7C,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { memo } from "react";
|
|
2
|
+
import Box from "@mui/material/Box";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
//#region src/appBarOffset.tsx
|
|
5
|
+
var AppBarOffset = memo(function AppBarOffset({ sx, ...props }) {
|
|
6
|
+
return /* @__PURE__ */ jsx(Box, {
|
|
7
|
+
...props,
|
|
8
|
+
sx: [({ mixins }) => mixins.toolbar, ...Array.isArray(sx) ? sx : [sx]]
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
//#endregion
|
|
12
|
+
export { AppBarOffset };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=appBarOffset.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appBarOffset.js","names":[],"sources":["../src/appBarOffset.tsx"],"sourcesContent":["import React, { type FC, memo } from 'react';\nimport { default as Box, type BoxProps } from '@mui/material/Box';\n\nexport type AppBarOffsetProps = BoxProps;\n\nexport const AppBarOffset: FC<AppBarOffsetProps> = memo(function AppBarOffset({ sx, ...props }) {\n return <Box {...props} sx={[({ mixins }) => mixins.toolbar, ...(Array.isArray(sx) ? sx : [sx])]} />;\n});\n"],"mappings":";;;;AAKA,IAAa,eAAsC,KAAK,SAAS,aAAa,EAAE,IAAI,GAAG,SAAS;CAC5F,OAAO,oBAAC,KAAD;EAAK,GAAI;EAAO,IAAI,EAAE,EAAE,aAAa,OAAO,SAAS,GAAI,MAAM,QAAQ,EAAE,IAAI,KAAK,CAAC,EAAE,CAAE;CAAI,CAAA;AACtG,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { GenericControlProps } from './genericControl';
|
|
2
|
+
import { GenericControlProps } from './genericControl.js';
|
|
3
3
|
export type FormControlFieldsetProps = GenericControlProps;
|
|
4
4
|
export declare const FormControlFieldset: FC<FormControlFieldsetProps>;
|
|
5
5
|
//# sourceMappingURL=formControlFieldset.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formControlFieldset.d.ts","sourceRoot":"","sources":["../src/formControlFieldset.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"formControlFieldset.d.ts","sourceRoot":"","sources":["../src/formControlFieldset.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,EAAE,EAAQ,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAkB,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAG5E,MAAM,MAAM,wBAAwB,GAAG,mBAAmB,CAAC;AAE3D,eAAO,MAAM,mBAAmB,EAAE,EAAE,CAAC,wBAAwB,CAmB3D,CAAC"}
|
|
@@ -1,28 +1,20 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
1
|
import { GenericControl } from "./genericControl.js";
|
|
2
|
+
import { memo } from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
4
|
import { inputClasses } from "@mui/material/Input";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
},
|
|
21
|
-
children
|
|
22
|
-
}
|
|
23
|
-
);
|
|
24
|
-
};
|
|
25
|
-
export {
|
|
26
|
-
FormControlFieldset
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=formControlFieldset.js.map
|
|
5
|
+
//#region src/formControlFieldset.tsx
|
|
6
|
+
var FormControlFieldset = memo(function FormControlFieldset({ children, sx, ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsx(GenericControl, {
|
|
8
|
+
...props,
|
|
9
|
+
component: "fieldset",
|
|
10
|
+
sx: {
|
|
11
|
+
...sx,
|
|
12
|
+
[`legend + .${inputClasses.root}`]: { marginTop: 2 }
|
|
13
|
+
},
|
|
14
|
+
children
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
//#endregion
|
|
18
|
+
export { FormControlFieldset };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=formControlFieldset.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formControlFieldset.js","sources":["../src/formControlFieldset.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport { GenericControl, GenericControlProps } from './genericControl';\nimport { inputClasses } from '@mui/material/Input';\n\nexport type FormControlFieldsetProps = GenericControlProps;\n\nexport const FormControlFieldset: FC<FormControlFieldsetProps> = function FormControlFieldset({\n children,\n sx,\n ...props\n}) {\n return (\n <GenericControl\n {...props}\n component=\"fieldset\"\n sx={{\n ...sx,\n [`legend + .${inputClasses.root}`]: {\n marginTop: 2, //FIXME 16px, hardcoded from @mui/material/Input/Input.js @ 59\n },\n }}\n >\n {children}\n </GenericControl>\n );\n};\n"],"
|
|
1
|
+
{"version":3,"file":"formControlFieldset.js","names":[],"sources":["../src/formControlFieldset.tsx"],"sourcesContent":["import React, { type FC, memo } from 'react';\nimport { GenericControl, type GenericControlProps } from './genericControl';\nimport { inputClasses } from '@mui/material/Input';\n\nexport type FormControlFieldsetProps = GenericControlProps;\n\nexport const FormControlFieldset: FC<FormControlFieldsetProps> = memo(function FormControlFieldset({\n children,\n sx,\n ...props\n}) {\n return (\n <GenericControl\n {...props}\n component=\"fieldset\"\n sx={{\n ...sx,\n [`legend + .${inputClasses.root}`]: {\n marginTop: 2, //FIXME 16px, hardcoded from @mui/material/Input/Input.js @ 59\n },\n }}\n >\n {children}\n </GenericControl>\n );\n});\n"],"mappings":";;;;;AAMA,IAAa,sBAAoD,KAAK,SAAS,oBAAoB,EAC/F,UACA,IACA,GAAG,SACJ;CACC,OACI,oBAAC,gBAAD;EACI,GAAI;EACJ,WAAU;EACV,IAAI;GACA,GAAG;IACF,aAAa,aAAa,SAAS,EAChC,WAAW,EACf;EACJ;EAEC;CACW,CAAA;AAExB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { GenericControl } from './genericControl';
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { GenericControl } from './genericControl.js';
|
|
3
3
|
declare const meta: Meta<typeof GenericControl>;
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof meta>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formControlFieldset.stories.d.ts","sourceRoot":"","sources":["../src/formControlFieldset.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"formControlFieldset.stories.d.ts","sourceRoot":"","sources":["../src/formControlFieldset.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAI5D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAMlD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,cAAc,CA6CC,CAAC;AAExC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAQnC,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { InputLabelProps } from '@mui/material/InputLabel';
|
|
3
|
-
export
|
|
3
|
+
export type FormLabelLegendProps = InputLabelProps;
|
|
4
|
+
export declare const FormLabelLegend: FC<FormLabelLegendProps>;
|
|
4
5
|
//# sourceMappingURL=formLabelLegend.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formLabelLegend.d.ts","sourceRoot":"","sources":["../src/formLabelLegend.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"formLabelLegend.d.ts","sourceRoot":"","sources":["../src/formLabelLegend.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,EAAE,EAAQ,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEvF,MAAM,MAAM,oBAAoB,GAAG,eAAe,CAAC;AAEnD,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAOnD,CAAC"}
|
package/dist/formLabelLegend.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
|
+
import { memo } from "react";
|
|
1
2
|
import { jsx } from "react/jsx-runtime";
|
|
2
3
|
import InputLabel from "@mui/material/InputLabel";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
//#
|
|
4
|
+
//#region src/formLabelLegend.tsx
|
|
5
|
+
var FormLabelLegend = memo(function FormLabelLegend({ children, ...props }) {
|
|
6
|
+
return /* @__PURE__ */ jsx(InputLabel, {
|
|
7
|
+
...props,
|
|
8
|
+
shrink: true,
|
|
9
|
+
component: "legend",
|
|
10
|
+
children
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
//#endregion
|
|
14
|
+
export { FormLabelLegend };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=formLabelLegend.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formLabelLegend.js","sources":["../src/formLabelLegend.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport { default as InputLabel, InputLabelProps } from '@mui/material/InputLabel';\n\nexport const FormLabelLegend: FC<
|
|
1
|
+
{"version":3,"file":"formLabelLegend.js","names":[],"sources":["../src/formLabelLegend.tsx"],"sourcesContent":["import React, { type FC, memo } from 'react';\nimport { default as InputLabel, type InputLabelProps } from '@mui/material/InputLabel';\n\nexport type FormLabelLegendProps = InputLabelProps;\n\nexport const FormLabelLegend: FC<FormLabelLegendProps> = memo(function FormLabelLegend({ children, ...props }) {\n return (\n // sx={(theme) => theme.typography.caption}\n <InputLabel {...props} shrink={true} component={'legend' as any}>\n {children}\n </InputLabel>\n );\n});\n"],"mappings":";;;;AAKA,IAAa,kBAA4C,KAAK,SAAS,gBAAgB,EAAE,UAAU,GAAG,SAAS;CAC3G,OAEI,oBAAC,YAAD;EAAY,GAAI;EAAO,QAAQ;EAAM,WAAW;EAC3C;CACO,CAAA;AAEpB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { FormLabelLegend } from './formLabelLegend.js';
|
|
3
|
+
declare const meta: Meta<typeof FormLabelLegend>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithRadioGroup: Story;
|
|
8
|
+
export declare const Required: Story;
|
|
9
|
+
export declare const WithError: Story;
|
|
10
|
+
export declare const Disabled: Story;
|
|
11
|
+
export declare const ComparisonWithInputLabel: Story;
|
|
12
|
+
export declare const MultipleFieldsets: Story;
|
|
13
|
+
//# sourceMappingURL=formLabelLegend.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formLabelLegend.stories.d.ts","sourceRoot":"","sources":["../src/formLabelLegend.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAI5D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAKpD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,eAAe,CAatC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAUrB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAa5B,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAWtB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAWvB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAWtB,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,KAqBtC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KAoB/B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"genericControl.d.ts","sourceRoot":"","sources":["../src/genericControl.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"genericControl.d.ts","sourceRoot":"","sources":["../src/genericControl.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,EAAE,EAAQ,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,KAAK,gBAAgB,EAA0B,MAAM,2BAA2B,CAAC;AAG1F,MAAM,MAAM,mBAAmB,GAAG,gBAAgB,GAAG;IAAE,QAAQ,EAAE,GAAG,CAAA;CAAE,CAAC;AAEvE,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAejD,CAAC"}
|
package/dist/genericControl.js
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
|
+
import { memo } from "react";
|
|
1
2
|
import { jsx } from "react/jsx-runtime";
|
|
2
3
|
import FormControl from "@mui/material/FormControl";
|
|
3
4
|
import { inputClasses } from "@mui/material/Input";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=genericControl.js.map
|
|
5
|
+
//#region src/genericControl.tsx
|
|
6
|
+
var GenericControl = memo(function GenericControl({ children, sx, ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsx(FormControl, {
|
|
8
|
+
variant: "standard",
|
|
9
|
+
sx: {
|
|
10
|
+
...sx,
|
|
11
|
+
[`& .${inputClasses.root}`]: { "&:before, &:after": { display: "none" } }
|
|
12
|
+
},
|
|
13
|
+
...props,
|
|
14
|
+
children
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
//#endregion
|
|
18
|
+
export { GenericControl };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=genericControl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"genericControl.js","sources":["../src/genericControl.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport { FormControlProps, default as FormControl } from '@mui/material/FormControl';\nimport { inputClasses } from '@mui/material/Input';\n\nexport type GenericControlProps = FormControlProps & { children: any };\n\nexport const GenericControl: FC<GenericControlProps> = ({ children, sx, ...props })
|
|
1
|
+
{"version":3,"file":"genericControl.js","names":[],"sources":["../src/genericControl.tsx"],"sourcesContent":["import React, { type FC, memo } from 'react';\nimport { type FormControlProps, default as FormControl } from '@mui/material/FormControl';\nimport { inputClasses } from '@mui/material/Input';\n\nexport type GenericControlProps = FormControlProps & { children: any };\n\nexport const GenericControl: FC<GenericControlProps> = memo(function GenericControl({ children, sx, ...props }) {\n return (\n <FormControl\n variant=\"standard\"\n sx={{\n ...sx,\n [`& .${inputClasses.root}`]: {\n '&:before, &:after': { display: 'none' },\n },\n }}\n {...props}\n >\n {children}\n </FormControl>\n );\n});\n"],"mappings":";;;;;AAMA,IAAa,iBAA0C,KAAK,SAAS,eAAe,EAAE,UAAU,IAAI,GAAG,SAAS;CAC5G,OACI,oBAAC,aAAD;EACI,SAAQ;EACR,IAAI;GACA,GAAG;IACF,MAAM,aAAa,SAAS,EACzB,qBAAqB,EAAE,SAAS,OAAO,EAC3C;EACJ;EACA,GAAI;EAEH;CACQ,CAAA;AAErB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { GenericControl } from './genericControl.js';
|
|
3
|
+
declare const meta: Meta<typeof GenericControl>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithCustomContent: Story;
|
|
8
|
+
export declare const Disabled: Story;
|
|
9
|
+
export declare const WithError: Story;
|
|
10
|
+
export declare const FullWidth: Story;
|
|
11
|
+
export declare const ComparisonWithTextField: Story;
|
|
12
|
+
//# sourceMappingURL=genericControl.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genericControl.stories.d.ts","sourceRoot":"","sources":["../src/genericControl.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAI5D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,cAAc,CAarC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KASrB,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KAS/B,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAUtB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAUvB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAiBvB,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,KAkBrC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
1
|
+
export * from './appBarOffset.js';
|
|
2
|
+
export * from './formControlFieldset.js';
|
|
3
|
+
export * from './formLabelLegend.js';
|
|
4
|
+
export * from './genericControl.js';
|
|
5
|
+
export * from './readOnly.js';
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
|
+
import { AppBarOffset } from "./appBarOffset.js";
|
|
2
|
+
import { GenericControl } from "./genericControl.js";
|
|
1
3
|
import { FormControlFieldset } from "./formControlFieldset.js";
|
|
2
4
|
import { FormLabelLegend } from "./formLabelLegend.js";
|
|
3
|
-
import { GenericControl } from "./genericControl.js";
|
|
4
5
|
import { ReadOnly } from "./readOnly.js";
|
|
5
|
-
export {
|
|
6
|
-
FormControlFieldset,
|
|
7
|
-
FormLabelLegend,
|
|
8
|
-
GenericControl,
|
|
9
|
-
ReadOnly
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=index.js.map
|
|
6
|
+
export { AppBarOffset, FormControlFieldset, FormLabelLegend, GenericControl, ReadOnly };
|
package/dist/readOnly.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { InputProps } from '@mui/material/Input';
|
|
3
|
-
export
|
|
3
|
+
export type ReadOnlyProps = InputProps & {
|
|
4
4
|
children: any;
|
|
5
|
-
}
|
|
5
|
+
};
|
|
6
|
+
export declare const ReadOnly: FC<ReadOnlyProps>;
|
|
6
7
|
//# sourceMappingURL=readOnly.d.ts.map
|
package/dist/readOnly.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readOnly.d.ts","sourceRoot":"","sources":["../src/readOnly.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"readOnly.d.ts","sourceRoot":"","sources":["../src/readOnly.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,EAAE,EAAQ,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAExE,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG;IAAE,QAAQ,EAAE,GAAG,CAAA;CAAE,CAAC;AAE3D,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CAErC,CAAC"}
|
package/dist/readOnly.js
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
|
+
import { memo } from "react";
|
|
1
2
|
import { jsx } from "react/jsx-runtime";
|
|
2
3
|
import Input from "@mui/material/Input";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
//#region src/readOnly.tsx
|
|
5
|
+
var ReadOnly = memo(function ReadOnly({ children, inputProps, ...props }) {
|
|
6
|
+
return /* @__PURE__ */ jsx(Input, {
|
|
7
|
+
...props,
|
|
8
|
+
inputComponent: "div",
|
|
9
|
+
inputProps: {
|
|
10
|
+
...inputProps,
|
|
11
|
+
children
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
//#endregion
|
|
16
|
+
export { ReadOnly };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=readOnly.js.map
|
package/dist/readOnly.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readOnly.js","sources":["../src/readOnly.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport { default as Input, InputProps } from '@mui/material/Input';\n\nexport
|
|
1
|
+
{"version":3,"file":"readOnly.js","names":[],"sources":["../src/readOnly.tsx"],"sourcesContent":["import React, { type FC, memo } from 'react';\nimport { default as Input, type InputProps } from '@mui/material/Input';\n\nexport type ReadOnlyProps = InputProps & { children: any };\n\nexport const ReadOnly: FC<ReadOnlyProps> = memo(function ReadOnly({ children, inputProps, ...props }) {\n return <Input {...props} inputComponent={'div' as any} inputProps={{ ...inputProps, children }}></Input>;\n});\n"],"mappings":";;;;AAKA,IAAa,WAA8B,KAAK,SAAS,SAAS,EAAE,UAAU,YAAY,GAAG,SAAS;CAClG,OAAO,oBAAC,OAAD;EAAO,GAAI;EAAO,gBAAgB;EAAc,YAAY;GAAE,GAAG;GAAY;EAAS;CAAU,CAAA;AAC3G,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { ReadOnly } from './readOnly.js';
|
|
3
|
+
declare const meta: Meta<typeof ReadOnly>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithLabel: Story;
|
|
8
|
+
export declare const WithHTMLContent: Story;
|
|
9
|
+
export declare const MultipleFields: Story;
|
|
10
|
+
export declare const ComparisonWithTextField: Story;
|
|
11
|
+
export declare const FullWidth: Story;
|
|
12
|
+
//# sourceMappingURL=readOnly.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readOnly.stories.d.ts","sourceRoot":"","sources":["../src/readOnly.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAI5D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,QAAQ,CAY/B,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAIrB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAOvB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAS7B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAqB5B,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,KAyBrC,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAevB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kirill.konshin/mui",
|
|
3
3
|
"description": "Utilities",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.3",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"hasStorybook": true,
|
|
6
7
|
"scripts": {
|
|
7
8
|
"----- BUILD -----": "",
|
|
8
9
|
"clean": "rm -rf dist .tscache tsconfig.tsbuildinfo",
|
|
9
10
|
"build": "vite build",
|
|
10
|
-
"build:index": "cti create ./src",
|
|
11
|
-
"build:check-types": "attw --pack .",
|
|
12
11
|
"start": "yarn build --watch",
|
|
13
12
|
"wait": "wait-on ./dist/index.js",
|
|
14
13
|
"----- TEST -----": "",
|
|
15
|
-
"test
|
|
14
|
+
"test": "vitest run --coverage",
|
|
16
15
|
"test:watch": "vitest watch --coverage",
|
|
17
16
|
"----- STORYBOOK -----": "",
|
|
18
17
|
"storybook:start": "storybook dev -p 6006",
|
|
@@ -52,5 +51,18 @@
|
|
|
52
51
|
},
|
|
53
52
|
"main": "./dist/index.js",
|
|
54
53
|
"module": "./dist/index.js",
|
|
55
|
-
"types": "./dist/index.d.ts"
|
|
54
|
+
"types": "./dist/index.d.ts",
|
|
55
|
+
"repository": {
|
|
56
|
+
"type": "git",
|
|
57
|
+
"url": "https://github.com/kirill-konshin/utils.git",
|
|
58
|
+
"directory": "packages/mui"
|
|
59
|
+
},
|
|
60
|
+
"nx": {
|
|
61
|
+
"tags": [
|
|
62
|
+
"platform:react"
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
"files": [
|
|
66
|
+
"dist"
|
|
67
|
+
]
|
|
56
68
|
}
|
package/.ctirc
DELETED
package/.storybook/main.ts
DELETED
package/.storybook/preview.ts
DELETED
package/.turbo/turbo-build.log
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
[36mvite v7.0.6 [32mbuilding SSR bundle for production...[36m[39m
|
|
2
|
-
create succeeded: /home/runner/work/utils/utils/packages/mui/src
|
|
3
|
-
transforming...
|
|
4
|
-
[32m✓[39m 5 modules transformed.
|
|
5
|
-
rendering chunks...
|
|
6
|
-
|
|
7
|
-
[vite:dts] Start generate declaration files...
|
|
8
|
-
[2mdist/[22m[36mreadOnly.js [39m[1m[2m0.31 kB[22m[1m[22m[2m │ map: 0.54 kB[22m
|
|
9
|
-
[2mdist/[22m[36mindex.js [39m[1m[2m0.33 kB[22m[1m[22m[2m │ map: 0.09 kB[22m
|
|
10
|
-
[2mdist/[22m[36mformLabelLegend.js [39m[1m[2m0.38 kB[22m[1m[22m[2m │ map: 0.66 kB[22m
|
|
11
|
-
[2mdist/[22m[36mgenericControl.js [39m[1m[2m0.50 kB[22m[1m[22m[2m │ map: 1.01 kB[22m
|
|
12
|
-
[2mdist/[22m[36mformControlFieldset.js [39m[1m[2m0.64 kB[22m[1m[22m[2m │ map: 1.22 kB[22m
|
|
13
|
-
[vite:dts] Declaration files built in 2888ms.
|
|
14
|
-
|
|
15
|
-
[32m✓ built in 3.55s[39m
|
|
16
|
-
Updated package.json with exports
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
package/src/README.md
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
-
|
|
4
|
-
import { TextField, Stack, InputLabel, RadioGroup, Radio, FormControlLabel, Box } from '@mui/material';
|
|
5
|
-
|
|
6
|
-
import { GenericControl } from './genericControl';
|
|
7
|
-
import { ReadOnly } from './readOnly';
|
|
8
|
-
import { FormControlFieldset } from './formControlFieldset';
|
|
9
|
-
import { FormLabelLegend } from './formLabelLegend';
|
|
10
|
-
|
|
11
|
-
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
|
12
|
-
const meta: Meta<typeof GenericControl> = {
|
|
13
|
-
title: 'MUI / FormControlFieldset',
|
|
14
|
-
parameters: {
|
|
15
|
-
layout: 'centered',
|
|
16
|
-
},
|
|
17
|
-
tags: ['autodocs'],
|
|
18
|
-
argTypes: {},
|
|
19
|
-
render: function Render() {
|
|
20
|
-
return (
|
|
21
|
-
<Box sx={{ position: 'relative' }}>
|
|
22
|
-
<Rule top={12} />
|
|
23
|
-
<Rule top={37} />
|
|
24
|
-
<Rule top={48} />
|
|
25
|
-
<Stack direction="row" gap={3} sx={{ alignItems: 'flex-start' }}>
|
|
26
|
-
<FormControlFieldset>
|
|
27
|
-
<FormLabelLegend>Radios</FormLabelLegend>
|
|
28
|
-
<ReadOnly>
|
|
29
|
-
{/* TODO The size of the component. small is equivalent to the dense radio styling. */}
|
|
30
|
-
<RadioGroup row defaultValue="female" name="radio-buttons-group" sx={{ mt: -1 }}>
|
|
31
|
-
<FormControlLabel value="female" label="Female" control={<Radio size="small" />} />
|
|
32
|
-
<FormControlLabel value="male" label="Male" control={<Radio size="small" />} />
|
|
33
|
-
<FormControlLabel value="other" label="Other" control={<Radio size="small" />} />
|
|
34
|
-
</RadioGroup>
|
|
35
|
-
</ReadOnly>
|
|
36
|
-
</FormControlFieldset>
|
|
37
|
-
|
|
38
|
-
<GenericControl>
|
|
39
|
-
<InputLabel shrink>GenericControl</InputLabel>
|
|
40
|
-
<ReadOnly>
|
|
41
|
-
This is a <code>div</code>, not an input with <code>readOnly</code>
|
|
42
|
-
</ReadOnly>
|
|
43
|
-
</GenericControl>
|
|
44
|
-
|
|
45
|
-
<FormControlFieldset>
|
|
46
|
-
<FormLabelLegend>FormLabelLegend</FormLabelLegend>
|
|
47
|
-
<ReadOnly>
|
|
48
|
-
This is a <code>div</code>, not an input with <code>readOnly</code>
|
|
49
|
-
</ReadOnly>
|
|
50
|
-
</FormControlFieldset>
|
|
51
|
-
|
|
52
|
-
<TextField label="TextField" defaultValue="Bar" variant="standard" />
|
|
53
|
-
</Stack>
|
|
54
|
-
</Box>
|
|
55
|
-
);
|
|
56
|
-
},
|
|
57
|
-
} satisfies Meta<typeof GenericControl>;
|
|
58
|
-
|
|
59
|
-
export default meta;
|
|
60
|
-
|
|
61
|
-
type Story = StoryObj<typeof meta>;
|
|
62
|
-
|
|
63
|
-
function Rule({ top }) {
|
|
64
|
-
return (
|
|
65
|
-
<Box sx={{ background: 'red', position: 'absolute', left: 0, top: `${top}px`, width: '100%', height: '1px' }} />
|
|
66
|
-
);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export const Default: Story = {
|
|
70
|
-
args: {},
|
|
71
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React, { FC } from 'react';
|
|
2
|
-
import { GenericControl, GenericControlProps } from './genericControl';
|
|
3
|
-
import { inputClasses } from '@mui/material/Input';
|
|
4
|
-
|
|
5
|
-
export type FormControlFieldsetProps = GenericControlProps;
|
|
6
|
-
|
|
7
|
-
export const FormControlFieldset: FC<FormControlFieldsetProps> = function FormControlFieldset({
|
|
8
|
-
children,
|
|
9
|
-
sx,
|
|
10
|
-
...props
|
|
11
|
-
}) {
|
|
12
|
-
return (
|
|
13
|
-
<GenericControl
|
|
14
|
-
{...props}
|
|
15
|
-
component="fieldset"
|
|
16
|
-
sx={{
|
|
17
|
-
...sx,
|
|
18
|
-
[`legend + .${inputClasses.root}`]: {
|
|
19
|
-
marginTop: 2, //FIXME 16px, hardcoded from @mui/material/Input/Input.js @ 59
|
|
20
|
-
},
|
|
21
|
-
}}
|
|
22
|
-
>
|
|
23
|
-
{children}
|
|
24
|
-
</GenericControl>
|
|
25
|
-
);
|
|
26
|
-
};
|
package/src/formLabelLegend.tsx
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React, { FC } from 'react';
|
|
2
|
-
import { default as InputLabel, InputLabelProps } from '@mui/material/InputLabel';
|
|
3
|
-
|
|
4
|
-
export const FormLabelLegend: FC<InputLabelProps> = ({ children, ...props }) => {
|
|
5
|
-
return (
|
|
6
|
-
// sx={(theme) => theme.typography.caption}
|
|
7
|
-
<InputLabel {...props} shrink={true} component={'legend' as any}>
|
|
8
|
-
{children}
|
|
9
|
-
</InputLabel>
|
|
10
|
-
);
|
|
11
|
-
};
|
package/src/genericControl.tsx
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React, { FC } from 'react';
|
|
2
|
-
import { FormControlProps, default as FormControl } from '@mui/material/FormControl';
|
|
3
|
-
import { inputClasses } from '@mui/material/Input';
|
|
4
|
-
|
|
5
|
-
export type GenericControlProps = FormControlProps & { children: any };
|
|
6
|
-
|
|
7
|
-
export const GenericControl: FC<GenericControlProps> = ({ children, sx, ...props }) => (
|
|
8
|
-
<FormControl
|
|
9
|
-
variant="standard"
|
|
10
|
-
sx={{
|
|
11
|
-
...sx,
|
|
12
|
-
[`& .${inputClasses.root}`]: {
|
|
13
|
-
'&:before, &:after': { display: 'none' },
|
|
14
|
-
},
|
|
15
|
-
}}
|
|
16
|
-
{...props}
|
|
17
|
-
>
|
|
18
|
-
{children}
|
|
19
|
-
</FormControl>
|
|
20
|
-
);
|
package/src/index.ts
DELETED
package/src/readOnly.tsx
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React, { FC } from 'react';
|
|
2
|
-
import { default as Input, InputProps } from '@mui/material/Input';
|
|
3
|
-
|
|
4
|
-
export const ReadOnly: FC<InputProps & { children: any }> = ({ children, inputProps, ...props }) => (
|
|
5
|
-
<Input {...props} inputComponent={'div' as any} inputProps={{ ...inputProps, children }}></Input>
|
|
6
|
-
);
|
package/tsconfig.json
DELETED
package/turbo.json
DELETED
package/vite.config.ts
DELETED