@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.
Files changed (46) hide show
  1. package/dist/appBarOffset.d.ts +5 -0
  2. package/dist/appBarOffset.d.ts.map +1 -0
  3. package/dist/appBarOffset.js +14 -0
  4. package/dist/appBarOffset.js.map +1 -0
  5. package/dist/formControlFieldset.d.ts +1 -1
  6. package/dist/formControlFieldset.d.ts.map +1 -1
  7. package/dist/formControlFieldset.js +18 -26
  8. package/dist/formControlFieldset.js.map +1 -1
  9. package/dist/formControlFieldset.stories.d.ts +2 -2
  10. package/dist/formControlFieldset.stories.d.ts.map +1 -1
  11. package/dist/formLabelLegend.d.ts +2 -1
  12. package/dist/formLabelLegend.d.ts.map +1 -1
  13. package/dist/formLabelLegend.js +14 -10
  14. package/dist/formLabelLegend.js.map +1 -1
  15. package/dist/formLabelLegend.stories.d.ts +13 -0
  16. package/dist/formLabelLegend.stories.d.ts.map +1 -0
  17. package/dist/genericControl.d.ts.map +1 -1
  18. package/dist/genericControl.js +17 -18
  19. package/dist/genericControl.js.map +1 -1
  20. package/dist/genericControl.stories.d.ts +12 -0
  21. package/dist/genericControl.stories.d.ts.map +1 -0
  22. package/dist/index.d.ts +5 -4
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +3 -8
  25. package/dist/readOnly.d.ts +3 -2
  26. package/dist/readOnly.d.ts.map +1 -1
  27. package/dist/readOnly.js +16 -5
  28. package/dist/readOnly.js.map +1 -1
  29. package/dist/readOnly.stories.d.ts +12 -0
  30. package/dist/readOnly.stories.d.ts.map +1 -0
  31. package/package.json +17 -5
  32. package/.ctirc +0 -11
  33. package/.storybook/main.ts +0 -2
  34. package/.storybook/preview.ts +0 -2
  35. package/.turbo/turbo-build.log +0 -16
  36. package/dist/index.js.map +0 -1
  37. package/src/README.md +0 -3
  38. package/src/formControlFieldset.stories.tsx +0 -71
  39. package/src/formControlFieldset.tsx +0 -26
  40. package/src/formLabelLegend.tsx +0 -11
  41. package/src/genericControl.tsx +0 -20
  42. package/src/index.ts +0 -4
  43. package/src/readOnly.tsx +0 -6
  44. package/tsconfig.json +0 -10
  45. package/turbo.json +0 -10
  46. package/vite.config.ts +0 -2
@@ -0,0 +1,5 @@
1
+ import { FC } from 'react';
2
+ import { BoxProps } from '@mui/material/Box';
3
+ export type AppBarOffsetProps = BoxProps;
4
+ export declare const AppBarOffset: FC<AppBarOffsetProps>;
5
+ //# sourceMappingURL=appBarOffset.d.ts.map
@@ -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,EAAE,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAkB,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAGvE,MAAM,MAAM,wBAAwB,GAAG,mBAAmB,CAAC;AAE3D,eAAO,MAAM,mBAAmB,EAAE,EAAE,CAAC,wBAAwB,CAmB5D,CAAC"}
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
- const FormControlFieldset = function FormControlFieldset2({
5
- children,
6
- sx,
7
- ...props
8
- }) {
9
- return /* @__PURE__ */ jsx(
10
- GenericControl,
11
- {
12
- ...props,
13
- component: "fieldset",
14
- sx: {
15
- ...sx,
16
- [`legend + .${inputClasses.root}`]: {
17
- marginTop: 2
18
- //FIXME 16px, hardcoded from @mui/material/Input/Input.js @ 59
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"],"names":["FormControlFieldset"],"mappings":";;;AAMO,MAAM,sBAAoD,SAASA,qBAAoB;AAAA,EAC1F;AAAA,EACA;AAAA,EACA,GAAG;AACP,GAAG;AACC,SACI;AAAA,IAAC;AAAA,IAAA;AAAA,MACI,GAAG;AAAA,MACJ,WAAU;AAAA,MACV,IAAI;AAAA,QACA,GAAG;AAAA,QACH,CAAC,aAAa,aAAa,IAAI,EAAE,GAAG;AAAA,UAChC,WAAW;AAAA;AAAA,QAAA;AAAA,MACf;AAAA,MAGH;AAAA,IAAA;AAAA,EAAA;AAGb;"}
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,kBAAkB,CAAC;AAIvD,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
+ {"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 declare const FormLabelLegend: FC<InputLabelProps>;
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,EAAE,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAyB,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAElF,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,eAAe,CAO/C,CAAC"}
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"}
@@ -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
- const FormLabelLegend = ({ children, ...props }) => {
4
- return (
5
- // sx={(theme) => theme.typography.caption}
6
- /* @__PURE__ */ jsx(InputLabel, { ...props, shrink: true, component: "legend", children })
7
- );
8
- };
9
- export {
10
- FormLabelLegend
11
- };
12
- //# sourceMappingURL=formLabelLegend.js.map
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<InputLabelProps> = ({ 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"],"names":[],"mappings":";;AAGO,MAAM,kBAAuC,CAAC,EAAE,UAAU,GAAG,YAAY;AAC5E;AAAA;AAAA,IAEI,oBAAC,cAAY,GAAG,OAAO,QAAQ,MAAM,WAAW,UAC3C,SAAA,CACL;AAAA;AAER;"}
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,EAAE,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAA0B,MAAM,2BAA2B,CAAC;AAGrF,MAAM,MAAM,mBAAmB,GAAG,gBAAgB,GAAG;IAAE,QAAQ,EAAE,GAAG,CAAA;CAAE,CAAC;AAEvE,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAalD,CAAC"}
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"}
@@ -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
- const GenericControl = ({ children, sx, ...props }) => /* @__PURE__ */ jsx(
5
- FormControl,
6
- {
7
- variant: "standard",
8
- sx: {
9
- ...sx,
10
- [`& .${inputClasses.root}`]: {
11
- "&:before, &:after": { display: "none" }
12
- }
13
- },
14
- ...props,
15
- children
16
- }
17
- );
18
- export {
19
- GenericControl
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 }) => (\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"],"names":[],"mappings":";;;AAMO,MAAM,iBAA0C,CAAC,EAAE,UAAU,IAAI,GAAG,YACvE;AAAA,EAAC;AAAA,EAAA;AAAA,IACG,SAAQ;AAAA,IACR,IAAI;AAAA,MACA,GAAG;AAAA,MACH,CAAC,MAAM,aAAa,IAAI,EAAE,GAAG;AAAA,QACzB,qBAAqB,EAAE,SAAS,OAAA;AAAA,MAAO;AAAA,IAC3C;AAAA,IAEH,GAAG;AAAA,IAEH;AAAA,EAAA;AACL;"}
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 './formControlFieldset';
2
- export * from './formLabelLegend';
3
- export * from './genericControl';
4
- export * from './readOnly';
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
@@ -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 };
@@ -1,6 +1,7 @@
1
1
  import { FC } from 'react';
2
2
  import { InputProps } from '@mui/material/Input';
3
- export declare const ReadOnly: FC<InputProps & {
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
@@ -1 +1 @@
1
- {"version":3,"file":"readOnly.d.ts","sourceRoot":"","sources":["../src/readOnly.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAoB,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEnE,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,UAAU,GAAG;IAAE,QAAQ,EAAE,GAAG,CAAA;CAAE,CAEvD,CAAC"}
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
- const ReadOnly = ({ children, inputProps, ...props }) => /* @__PURE__ */ jsx(Input, { ...props, inputComponent: "div", inputProps: { ...inputProps, children } });
4
- export {
5
- ReadOnly
6
- };
7
- //# sourceMappingURL=readOnly.js.map
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
@@ -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 const ReadOnly: FC<InputProps & { children: any }> = ({ children, inputProps, ...props }) => (\n <Input {...props} inputComponent={'div' as any} inputProps={{ ...inputProps, children }}></Input>\n);\n"],"names":[],"mappings":";;AAGO,MAAM,WAA+C,CAAC,EAAE,UAAU,YAAY,GAAG,YACpF,oBAAC,SAAO,GAAG,OAAO,gBAAgB,OAAc,YAAY,EAAE,GAAG,YAAY,WAAS,CAAG;"}
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.1",
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:disabled": "vitest run --coverage",
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
@@ -1,11 +0,0 @@
1
- {
2
- "addNewline": true,
3
- "fileExcludePatterns": [
4
- "*.stories.*",
5
- "*.test.*",
6
- "*.fixture.*"
7
- ],
8
- "verbose": false,
9
- "withoutBackupFile": true,
10
- "withoutComment": true
11
- }
@@ -1,2 +0,0 @@
1
- import config from '../../utils-private/.storybook/main';
2
- export default config;
@@ -1,2 +0,0 @@
1
- import preview from '../../utils-private/.storybook/preview';
2
- export default preview;
@@ -1,16 +0,0 @@
1
- vite v7.0.6 building SSR bundle for production...
2
- create succeeded: /home/runner/work/utils/utils/packages/mui/src
3
- transforming...
4
- ✓ 5 modules transformed.
5
- rendering chunks...
6
-
7
- [vite:dts] Start generate declaration files...
8
- dist/readOnly.js 0.31 kB │ map: 0.54 kB
9
- dist/index.js 0.33 kB │ map: 0.09 kB
10
- dist/formLabelLegend.js 0.38 kB │ map: 0.66 kB
11
- dist/genericControl.js 0.50 kB │ map: 1.01 kB
12
- dist/formControlFieldset.js 0.64 kB │ map: 1.22 kB
13
- [vite:dts] Declaration files built in 2888ms.
14
-
15
- ✓ built in 3.55s
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,3 +0,0 @@
1
- ## Prior Art
2
-
3
- https://codesandbox.io/p/sandbox/l7vykxl57q MUI v4
@@ -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
- };
@@ -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
- };
@@ -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
@@ -1,4 +0,0 @@
1
- export * from './formControlFieldset';
2
- export * from './formLabelLegend';
3
- export * from './genericControl';
4
- export * from './readOnly';
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
@@ -1,10 +0,0 @@
1
- {
2
- "extends": "../utils-private/tsconfig.json",
3
- "compilerOptions": {
4
- "rootDir": "src",
5
- "outDir": "dist",
6
- "declarationDir": "dist"
7
- },
8
- "include": ["src"],
9
- "exclude": []
10
- }
package/turbo.json DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "$schema": "https://turbo.build/schema.json",
3
- "extends": ["//"],
4
- "tasks": {
5
- "build": {
6
- "dependsOn": ["^build"],
7
- "outputs": ["src/**/*/index.ts", "package.json", "dist/**/*"]
8
- }
9
- }
10
- }
package/vite.config.ts DELETED
@@ -1,2 +0,0 @@
1
- import config from '../utils-private/vite.config';
2
- export default config;