This commit is contained in:
@@ -3,5 +3,5 @@
|
||||
"singleQuote": true,
|
||||
"semi": true,
|
||||
"printWidth": 100,
|
||||
"tabWidth": 2
|
||||
"tabWidth": 4
|
||||
}
|
||||
|
||||
@@ -27,7 +27,8 @@ const meta = {
|
||||
table: { type: { summary: 'string' } },
|
||||
},
|
||||
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,
|
||||
table: { type: { summary: 'ElementType' } },
|
||||
},
|
||||
|
||||
@@ -20,12 +20,14 @@ const meta = {
|
||||
control: 'select',
|
||||
table: {
|
||||
type: {
|
||||
summary: "'h1' | 'h2' | 'h3' | 'h4' | 'body' | 'body2' | 'caption' | 'error' | 'code'",
|
||||
summary:
|
||||
"'h1' | 'h2' | 'h3' | 'h4' | 'body' | 'body2' | 'caption' | 'error' | 'code'",
|
||||
},
|
||||
},
|
||||
},
|
||||
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,
|
||||
table: { type: { summary: 'ElementType' } },
|
||||
},
|
||||
|
||||
@@ -52,7 +52,8 @@ const meta = {
|
||||
table: { type: { summary: 'boolean' } },
|
||||
},
|
||||
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',
|
||||
table: { type: { summary: 'string' } },
|
||||
},
|
||||
@@ -138,7 +139,10 @@ export const ReadOnly: Story = {
|
||||
},
|
||||
render: (args) => (
|
||||
<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>
|
||||
),
|
||||
};
|
||||
@@ -150,7 +154,10 @@ export const DisabledWithError: Story = {
|
||||
},
|
||||
render: (args) => (
|
||||
<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>
|
||||
),
|
||||
};
|
||||
|
||||
@@ -153,7 +153,8 @@ const meta = {
|
||||
control: 'object',
|
||||
table: {
|
||||
type: {
|
||||
summary: '{ page; pageSize; total; totalPages; onPageChange; onPageSizeChange? }',
|
||||
summary:
|
||||
'{ page; pageSize; total; totalPages; onPageChange; onPageSizeChange? }',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -81,7 +81,9 @@ export function Table<T>({
|
||||
<button
|
||||
type="button"
|
||||
className="table-sort-button"
|
||||
onClick={() => onSortChange(header.sortField as string)}
|
||||
onClick={() =>
|
||||
onSortChange(header.sortField as string)
|
||||
}
|
||||
aria-label={`Sort by ${header.label}`}
|
||||
>
|
||||
<span>{header.label}</span>
|
||||
@@ -90,11 +92,15 @@ export function Table<T>({
|
||||
aria-hidden="true"
|
||||
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' ? (
|
||||
<ChevronDownIcon className="h-4 w-4" />
|
||||
) : null}
|
||||
{sortDirection == null ? <ArrowsUpDownIcon className="h-4 w-4" /> : null}
|
||||
{sortDirection == null ? (
|
||||
<ArrowsUpDownIcon className="h-4 w-4" />
|
||||
) : null}
|
||||
</span>
|
||||
</button>
|
||||
) : (
|
||||
@@ -114,7 +120,10 @@ export function Table<T>({
|
||||
variant="body2"
|
||||
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>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -8,14 +8,23 @@ export default defineConfig({
|
||||
lib: {
|
||||
entry: {
|
||||
index: resolve(__dirname, 'src/index.ts'),
|
||||
'components/MDXEditorField': resolve(__dirname, 'src/components/MDXEditorField.tsx'),
|
||||
'components/MDXEditorField': resolve(
|
||||
__dirname,
|
||||
'src/components/MDXEditorField.tsx',
|
||||
),
|
||||
},
|
||||
name: 'PanicWebUi',
|
||||
formats: ['es'],
|
||||
fileName: (_format, entryName) => `${entryName}.js`,
|
||||
},
|
||||
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