@kirill.konshin/mui 0.0.2 → 0.0.4
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/README.md +87 -0
- package/dist/admin/appProvider.d.ts +18 -0
- package/dist/admin/appProvider.d.ts.map +1 -0
- package/dist/admin/appProvider.js +32 -0
- package/dist/admin/appProvider.js.map +1 -0
- package/dist/admin/dashboardLayout.d.ts +8 -0
- package/dist/admin/dashboardLayout.d.ts.map +1 -0
- package/dist/admin/dashboardLayout.js +17 -0
- package/dist/admin/dashboardLayout.js.map +1 -0
- package/dist/admin/index.d.ts +4 -0
- package/dist/admin/index.d.ts.map +1 -0
- package/dist/admin/index.js +4 -0
- package/dist/admin/signInPage.d.ts +22 -0
- package/dist/admin/signInPage.d.ts.map +1 -0
- package/dist/admin/signInPage.js +60 -0
- package/dist/admin/signInPage.js.map +1 -0
- package/dist/appBarOffset.d.ts.map +1 -1
- package/dist/appBarOffset.js +11 -7
- package/dist/appBarOffset.js.map +1 -1
- package/dist/formControlFieldset.d.ts +1 -1
- package/dist/formControlFieldset.d.ts.map +1 -1
- package/dist/formControlFieldset.js +17 -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.map +1 -1
- package/dist/formLabelLegend.js +13 -10
- package/dist/formLabelLegend.js.map +1 -1
- package/dist/formLabelLegend.stories.d.ts +2 -2
- package/dist/formLabelLegend.stories.d.ts.map +1 -1
- package/dist/genericControl.d.ts.map +1 -1
- package/dist/genericControl.js +17 -21
- package/dist/genericControl.js.map +1 -1
- package/dist/genericControl.stories.d.ts +2 -2
- package/dist/genericControl.stories.d.ts.map +1 -1
- package/dist/index.d.ts +6 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -9
- package/dist/readOnly.d.ts.map +1 -1
- package/dist/readOnly.js +15 -7
- package/dist/readOnly.js.map +1 -1
- package/dist/readOnly.stories.d.ts +2 -2
- package/dist/readOnly.stories.d.ts.map +1 -1
- package/package.json +38 -5
- package/.ctirc +0 -20
- package/.storybook/main.ts +0 -2
- package/.storybook/preview.ts +0 -2
- package/.turbo/turbo-build.log +0 -24
- package/AGENTS.md +0 -19
- package/CHANGELOG.md +0 -8
- package/dist/index.js.map +0 -1
- package/src/README.md +0 -3
- package/src/appBarOffset.tsx +0 -8
- package/src/formControlFieldset.stories.tsx +0 -71
- package/src/formControlFieldset.tsx +0 -26
- package/src/formLabelLegend.stories.tsx +0 -139
- package/src/formLabelLegend.tsx +0 -13
- package/src/genericControl.stories.tsx +0 -111
- package/src/genericControl.tsx +0 -22
- package/src/index.ts +0 -5
- package/src/readOnly.stories.tsx +0 -118
- package/src/readOnly.tsx +0 -8
- package/tsconfig.json +0 -10
- package/turbo.json +0 -10
- package/vite.config.ts +0 -2
package/src/readOnly.stories.tsx
DELETED
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
-
|
|
4
|
-
import { InputLabel, Stack, TextField, Box } from '@mui/material';
|
|
5
|
-
|
|
6
|
-
import { ReadOnly } from './readOnly';
|
|
7
|
-
import { GenericControl } from './genericControl';
|
|
8
|
-
|
|
9
|
-
const meta: Meta<typeof ReadOnly> = {
|
|
10
|
-
title: 'MUI / ReadOnly',
|
|
11
|
-
component: ReadOnly,
|
|
12
|
-
parameters: {
|
|
13
|
-
layout: 'centered',
|
|
14
|
-
},
|
|
15
|
-
tags: ['autodocs'],
|
|
16
|
-
argTypes: {
|
|
17
|
-
children: { control: 'text' },
|
|
18
|
-
disabled: { control: 'boolean' },
|
|
19
|
-
fullWidth: { control: 'boolean' },
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export default meta;
|
|
24
|
-
|
|
25
|
-
type Story = StoryObj<typeof meta>;
|
|
26
|
-
|
|
27
|
-
export const Default: Story = {
|
|
28
|
-
args: {
|
|
29
|
-
children: 'This is read-only content',
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export const WithLabel: Story = {
|
|
34
|
-
render: () => (
|
|
35
|
-
<GenericControl>
|
|
36
|
-
<InputLabel shrink>Read Only Field</InputLabel>
|
|
37
|
-
<ReadOnly>This content cannot be edited</ReadOnly>
|
|
38
|
-
</GenericControl>
|
|
39
|
-
),
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export const WithHTMLContent: Story = {
|
|
43
|
-
render: () => (
|
|
44
|
-
<GenericControl>
|
|
45
|
-
<InputLabel shrink>HTML Content</InputLabel>
|
|
46
|
-
<ReadOnly>
|
|
47
|
-
This is a <code>div</code>, not an input with <code>readOnly</code> attribute
|
|
48
|
-
</ReadOnly>
|
|
49
|
-
</GenericControl>
|
|
50
|
-
),
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export const MultipleFields: Story = {
|
|
54
|
-
render: () => (
|
|
55
|
-
<Stack spacing={2}>
|
|
56
|
-
<GenericControl>
|
|
57
|
-
<InputLabel shrink>Name</InputLabel>
|
|
58
|
-
<ReadOnly>John Doe</ReadOnly>
|
|
59
|
-
</GenericControl>
|
|
60
|
-
|
|
61
|
-
<GenericControl>
|
|
62
|
-
<InputLabel shrink>Email</InputLabel>
|
|
63
|
-
<ReadOnly>john.doe@example.com</ReadOnly>
|
|
64
|
-
</GenericControl>
|
|
65
|
-
|
|
66
|
-
<GenericControl>
|
|
67
|
-
<InputLabel shrink>Status</InputLabel>
|
|
68
|
-
<ReadOnly>
|
|
69
|
-
<span style={{ color: 'green' }}>● Active</span>
|
|
70
|
-
</ReadOnly>
|
|
71
|
-
</GenericControl>
|
|
72
|
-
</Stack>
|
|
73
|
-
),
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
export const ComparisonWithTextField: Story = {
|
|
77
|
-
parameters: {
|
|
78
|
-
docs: {
|
|
79
|
-
description: {
|
|
80
|
-
story: 'ReadOnly renders content as a div instead of an input, which is useful for displaying non-editable data that may contain HTML.',
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
render: () => (
|
|
85
|
-
<Stack direction="row" spacing={3} alignItems="flex-start">
|
|
86
|
-
<GenericControl>
|
|
87
|
-
<InputLabel shrink>ReadOnly Component</InputLabel>
|
|
88
|
-
<ReadOnly>
|
|
89
|
-
Content with <strong>HTML</strong>
|
|
90
|
-
</ReadOnly>
|
|
91
|
-
</GenericControl>
|
|
92
|
-
|
|
93
|
-
<TextField
|
|
94
|
-
label="TextField (readOnly)"
|
|
95
|
-
defaultValue="Plain text only"
|
|
96
|
-
variant="standard"
|
|
97
|
-
slotProps={{ input: { readOnly: true } }}
|
|
98
|
-
/>
|
|
99
|
-
</Stack>
|
|
100
|
-
),
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
export const FullWidth: Story = {
|
|
104
|
-
args: {
|
|
105
|
-
fullWidth: true,
|
|
106
|
-
children: 'Full width read-only content',
|
|
107
|
-
},
|
|
108
|
-
decorators: [
|
|
109
|
-
(Story) => (
|
|
110
|
-
<Box sx={{ width: 400 }}>
|
|
111
|
-
<GenericControl fullWidth>
|
|
112
|
-
<InputLabel shrink>Full Width</InputLabel>
|
|
113
|
-
<Story />
|
|
114
|
-
</GenericControl>
|
|
115
|
-
</Box>
|
|
116
|
-
),
|
|
117
|
-
],
|
|
118
|
-
};
|
package/src/readOnly.tsx
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React, { FC, memo } from 'react';
|
|
2
|
-
import { default as Input, InputProps } from '@mui/material/Input';
|
|
3
|
-
|
|
4
|
-
export type ReadOnlyProps = InputProps & { children: any };
|
|
5
|
-
|
|
6
|
-
export const ReadOnly: FC<ReadOnlyProps> = memo(function ReadOnly({ children, inputProps, ...props }) {
|
|
7
|
-
return <Input {...props} inputComponent={'div' as any} inputProps={{ ...inputProps, children }}></Input>;
|
|
8
|
-
});
|
package/tsconfig.json
DELETED
package/turbo.json
DELETED
package/vite.config.ts
DELETED