refine Semi UI platform shell and states
This commit is contained in:
@@ -5,6 +5,9 @@ import type { ReactNode } from 'react';
|
||||
type StateScope = 'page' | 'panel' | 'inline';
|
||||
type StateKind = 'loading' | 'empty' | 'error';
|
||||
|
||||
const PAGE_LOADING_SKELETON = <div className="v2-state-skeleton v2-page-skeleton" aria-hidden="true"><i /><i /><i /><i /></div>;
|
||||
const PANEL_LOADING_SKELETON = <div className="v2-state-skeleton" aria-hidden="true"><i /><i /><i /></div>;
|
||||
|
||||
function stateRole(kind: StateKind) {
|
||||
return kind === 'error' ? 'alert' : 'status';
|
||||
}
|
||||
@@ -36,7 +39,7 @@ function StateSurface({
|
||||
<div className="v2-state-copy"><Typography.Text strong>{title}</Typography.Text>{description ? <Typography.Text type={kind === 'error' ? 'danger' : 'tertiary'} size="small">{description}</Typography.Text> : null}</div>
|
||||
{action ? <div className="v2-state-action">{action}</div> : null}
|
||||
</div>}
|
||||
{kind === 'loading' ? <div className="v2-state-skeleton" aria-hidden="true"><i /><i /><i /></div> : null}
|
||||
{kind === 'loading' ? (scope === 'page' ? PAGE_LOADING_SKELETON : PANEL_LOADING_SKELETON) : null}
|
||||
</section>;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user