This commit is contained in:
@@ -3,5 +3,5 @@
|
|||||||
"singleQuote": true,
|
"singleQuote": true,
|
||||||
"semi": true,
|
"semi": true,
|
||||||
"printWidth": 100,
|
"printWidth": 100,
|
||||||
"tabWidth": 2
|
"tabWidth": 4
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,8 @@ const meta = {
|
|||||||
table: { type: { summary: 'string' } },
|
table: { type: { summary: 'string' } },
|
||||||
},
|
},
|
||||||
as: {
|
as: {
|
||||||
description: "Root tag or component to render (for example `'span'`, `'a'`, `'button'`).",
|
description:
|
||||||
|
"Root tag or component to render (for example `'span'`, `'a'`, `'button'`).",
|
||||||
control: false,
|
control: false,
|
||||||
table: { type: { summary: 'ElementType' } },
|
table: { type: { summary: 'ElementType' } },
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -20,12 +20,14 @@ const meta = {
|
|||||||
control: 'select',
|
control: 'select',
|
||||||
table: {
|
table: {
|
||||||
type: {
|
type: {
|
||||||
summary: "'h1' | 'h2' | 'h3' | 'h4' | 'body' | 'body2' | 'caption' | 'error' | 'code'",
|
summary:
|
||||||
|
"'h1' | 'h2' | 'h3' | 'h4' | 'body' | 'body2' | 'caption' | 'error' | 'code'",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
as: {
|
as: {
|
||||||
description: "Override rendered HTML tag or component (for example `'p'`, `'span'`, `'h2'`).",
|
description:
|
||||||
|
"Override rendered HTML tag or component (for example `'p'`, `'span'`, `'h2'`).",
|
||||||
control: false,
|
control: false,
|
||||||
table: { type: { summary: 'ElementType' } },
|
table: { type: { summary: 'ElementType' } },
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -52,7 +52,8 @@ const meta = {
|
|||||||
table: { type: { summary: 'boolean' } },
|
table: { type: { summary: 'boolean' } },
|
||||||
},
|
},
|
||||||
themeClassName: {
|
themeClassName: {
|
||||||
description: 'Theme class applied to MDXEditor (for example `light-theme` or `dark-theme`).',
|
description:
|
||||||
|
'Theme class applied to MDXEditor (for example `light-theme` or `dark-theme`).',
|
||||||
control: 'text',
|
control: 'text',
|
||||||
table: { type: { summary: 'string' } },
|
table: { type: { summary: 'string' } },
|
||||||
},
|
},
|
||||||
@@ -138,7 +139,10 @@ export const ReadOnly: Story = {
|
|||||||
},
|
},
|
||||||
render: (args) => (
|
render: (args) => (
|
||||||
<div className="w-full max-w-2xl">
|
<div className="w-full max-w-2xl">
|
||||||
<MDXEditorField {...args} editorWrapperClassName="mt-2 overflow-hidden rounded-xl border" />
|
<MDXEditorField
|
||||||
|
{...args}
|
||||||
|
editorWrapperClassName="mt-2 overflow-hidden rounded-xl border"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
@@ -150,7 +154,10 @@ export const DisabledWithError: Story = {
|
|||||||
},
|
},
|
||||||
render: (args) => (
|
render: (args) => (
|
||||||
<div className="w-full max-w-2xl">
|
<div className="w-full max-w-2xl">
|
||||||
<MDXEditorField {...args} editorWrapperClassName="mt-2 overflow-hidden rounded-xl border" />
|
<MDXEditorField
|
||||||
|
{...args}
|
||||||
|
editorWrapperClassName="mt-2 overflow-hidden rounded-xl border"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -153,7 +153,8 @@ const meta = {
|
|||||||
control: 'object',
|
control: 'object',
|
||||||
table: {
|
table: {
|
||||||
type: {
|
type: {
|
||||||
summary: '{ page; pageSize; total; totalPages; onPageChange; onPageSizeChange? }',
|
summary:
|
||||||
|
'{ page; pageSize; total; totalPages; onPageChange; onPageSizeChange? }',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -81,7 +81,9 @@ export function Table<T>({
|
|||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="table-sort-button"
|
className="table-sort-button"
|
||||||
onClick={() => onSortChange(header.sortField as string)}
|
onClick={() =>
|
||||||
|
onSortChange(header.sortField as string)
|
||||||
|
}
|
||||||
aria-label={`Sort by ${header.label}`}
|
aria-label={`Sort by ${header.label}`}
|
||||||
>
|
>
|
||||||
<span>{header.label}</span>
|
<span>{header.label}</span>
|
||||||
@@ -90,11 +92,15 @@ export function Table<T>({
|
|||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
data-sort-state={sortDirection ?? 'none'}
|
data-sort-state={sortDirection ?? 'none'}
|
||||||
>
|
>
|
||||||
{sortDirection === 'asc' ? <ChevronUpIcon className="h-4 w-4" /> : null}
|
{sortDirection === 'asc' ? (
|
||||||
|
<ChevronUpIcon className="h-4 w-4" />
|
||||||
|
) : null}
|
||||||
{sortDirection === 'desc' ? (
|
{sortDirection === 'desc' ? (
|
||||||
<ChevronDownIcon className="h-4 w-4" />
|
<ChevronDownIcon className="h-4 w-4" />
|
||||||
) : null}
|
) : null}
|
||||||
{sortDirection == null ? <ArrowsUpDownIcon className="h-4 w-4" /> : null}
|
{sortDirection == null ? (
|
||||||
|
<ArrowsUpDownIcon className="h-4 w-4" />
|
||||||
|
) : null}
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
) : (
|
) : (
|
||||||
@@ -114,7 +120,10 @@ export function Table<T>({
|
|||||||
variant="body2"
|
variant="body2"
|
||||||
className="inline-flex items-center justify-center ui-loading"
|
className="inline-flex items-center justify-center ui-loading"
|
||||||
>
|
>
|
||||||
<ArrowPathIcon className="h-5 w-5 animate-spin" aria-hidden="true" />
|
<ArrowPathIcon
|
||||||
|
className="h-5 w-5 animate-spin"
|
||||||
|
aria-hidden="true"
|
||||||
|
/>
|
||||||
</Label>
|
</Label>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -8,14 +8,23 @@ export default defineConfig({
|
|||||||
lib: {
|
lib: {
|
||||||
entry: {
|
entry: {
|
||||||
index: resolve(__dirname, 'src/index.ts'),
|
index: resolve(__dirname, 'src/index.ts'),
|
||||||
'components/MDXEditorField': resolve(__dirname, 'src/components/MDXEditorField.tsx'),
|
'components/MDXEditorField': resolve(
|
||||||
|
__dirname,
|
||||||
|
'src/components/MDXEditorField.tsx',
|
||||||
|
),
|
||||||
},
|
},
|
||||||
name: 'PanicWebUi',
|
name: 'PanicWebUi',
|
||||||
formats: ['es'],
|
formats: ['es'],
|
||||||
fileName: (_format, entryName) => `${entryName}.js`,
|
fileName: (_format, entryName) => `${entryName}.js`,
|
||||||
},
|
},
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
external: ['react', 'react-dom', 'react-router-dom', '@heroicons/react', '@mdxeditor/editor'],
|
external: [
|
||||||
|
'react',
|
||||||
|
'react-dom',
|
||||||
|
'react-router-dom',
|
||||||
|
'@heroicons/react',
|
||||||
|
'@mdxeditor/editor',
|
||||||
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user