refactor(q-2-scheme): 将neutral和surface类型改为Q2ColorSet并更新相关引用
更新Q2Baseline类型中的neutral、neutralVariant、surface和surfaceVariant字段类型为Q2ColorSet 调整Preview组件中相关属性的引用方式 修复SchemeDetail组件中Q2Scheme的props类型
This commit is contained in:
parent
5a1454e6c2
commit
58be84c499
@ -8,6 +8,7 @@ import { ScrollArea } from '../../../components/ScrollArea';
|
|||||||
import { VSegmentedControl } from '../../../components/VSegmentedControl';
|
import { VSegmentedControl } from '../../../components/VSegmentedControl';
|
||||||
import { SchemeContent } from '../../../models';
|
import { SchemeContent } from '../../../models';
|
||||||
import { Q2SchemeSource, Q2SchemeStorage } from '../../../q-2-scheme';
|
import { Q2SchemeSource, Q2SchemeStorage } from '../../../q-2-scheme';
|
||||||
|
import { QSchemeSetting } from '../../../q-scheme';
|
||||||
import { useUpdateScheme } from '../../../stores/schemes';
|
import { useUpdateScheme } from '../../../stores/schemes';
|
||||||
import { isNilOrEmpty, mapToObject } from '../../../utls';
|
import { isNilOrEmpty, mapToObject } from '../../../utls';
|
||||||
import { ColorEntry, IdenticalColorEntry } from '../ColorEntry';
|
import { ColorEntry, IdenticalColorEntry } from '../ColorEntry';
|
||||||
|
@ -134,16 +134,16 @@ const PreviewBlock: FC<PreviewBlockProps> = ({ baseline, title }) => {
|
|||||||
<PreviewLine name="Surface" unit={baseline.surface} />
|
<PreviewLine name="Surface" unit={baseline.surface} />
|
||||||
<PreviewLine name="Surface Variant" unit={baseline.surfaceVariant} />
|
<PreviewLine name="Surface Variant" unit={baseline.surfaceVariant} />
|
||||||
<div className={styles.preview_indi_block}>
|
<div className={styles.preview_indi_block}>
|
||||||
<PreviewCell bg={baseline.shadow} fg={baseline.surface.root.onRoot}>
|
<PreviewCell bg={baseline.shadow} fg={baseline.surface.onRoot}>
|
||||||
Shadow
|
Shadow
|
||||||
</PreviewCell>
|
</PreviewCell>
|
||||||
<PreviewCell bg={baseline.overlay} fg={baseline.surface.root.onRoot}>
|
<PreviewCell bg={baseline.overlay} fg={baseline.surface.onRoot}>
|
||||||
Overlay
|
Overlay
|
||||||
</PreviewCell>
|
</PreviewCell>
|
||||||
<PreviewCell bg={baseline.outline} fg={baseline.surface.root.onRoot}>
|
<PreviewCell bg={baseline.outline} fg={baseline.surface.onRoot}>
|
||||||
Outline
|
Outline
|
||||||
</PreviewCell>
|
</PreviewCell>
|
||||||
<PreviewCell bg={baseline.outlineVariant} fg={baseline.surface.root.onRoot}>
|
<PreviewCell bg={baseline.outlineVariant} fg={baseline.surface.onRoot}>
|
||||||
Outline Variant
|
Outline Variant
|
||||||
</PreviewCell>
|
</PreviewCell>
|
||||||
</div>
|
</div>
|
||||||
|
@ -18,7 +18,7 @@ import { M3Scheme } from '../page-components/scheme/M3Scheme';
|
|||||||
import { Q2Scheme } from '../page-components/scheme/Q2Scheme';
|
import { Q2Scheme } from '../page-components/scheme/Q2Scheme';
|
||||||
import { QScheme } from '../page-components/scheme/QScheme';
|
import { QScheme } from '../page-components/scheme/QScheme';
|
||||||
import { SwatchScheme } from '../page-components/scheme/SwatchScheme';
|
import { SwatchScheme } from '../page-components/scheme/SwatchScheme';
|
||||||
import { Q2SchemeSource } from '../q-2-scheme';
|
import { Q2SchemeStorage } from '../q-2-scheme';
|
||||||
import { QSchemeStorage } from '../q-scheme';
|
import { QSchemeStorage } from '../q-scheme';
|
||||||
import { useScheme, useUpdateScheme } from '../stores/schemes';
|
import { useScheme, useUpdateScheme } from '../stores/schemes';
|
||||||
import { SwatchSchemeStorage } from '../swatch_scheme';
|
import { SwatchSchemeStorage } from '../swatch_scheme';
|
||||||
@ -53,7 +53,7 @@ export function SchemeDetail() {
|
|||||||
case 'q_scheme':
|
case 'q_scheme':
|
||||||
return <QScheme scheme={scheme as SchemeContent<QSchemeStorage>} />;
|
return <QScheme scheme={scheme as SchemeContent<QSchemeStorage>} />;
|
||||||
case 'q_2_scheme':
|
case 'q_2_scheme':
|
||||||
return <Q2Scheme scheme={scheme as SchemeContent<Q2SchemeSource>} />;
|
return <Q2Scheme scheme={scheme as SchemeContent<Q2SchemeStorage>} />;
|
||||||
case 'swatch_scheme':
|
case 'swatch_scheme':
|
||||||
return <SwatchScheme scheme={scheme as SchemeContent<SwatchSchemeStorage>} />;
|
return <SwatchScheme scheme={scheme as SchemeContent<SwatchSchemeStorage>} />;
|
||||||
case 'material_2':
|
case 'material_2':
|
||||||
|
@ -21,10 +21,10 @@ export type Q2Baseline = {
|
|||||||
secondary: Q2ColorUnit | null;
|
secondary: Q2ColorUnit | null;
|
||||||
tertiary: Q2ColorUnit | null;
|
tertiary: Q2ColorUnit | null;
|
||||||
accent: Q2ColorUnit | null;
|
accent: Q2ColorUnit | null;
|
||||||
neutral: Q2ColorUnit;
|
neutral: Q2ColorSet;
|
||||||
neutralVariant: Q2ColorUnit;
|
neutralVariant: Q2ColorSet;
|
||||||
surface: Q2ColorUnit;
|
surface: Q2ColorSet;
|
||||||
surfaceVariant: Q2ColorUnit;
|
surfaceVariant: Q2ColorSet;
|
||||||
neutralSwatch: Record<string, string>;
|
neutralSwatch: Record<string, string>;
|
||||||
danger: Q2ColorUnit;
|
danger: Q2ColorUnit;
|
||||||
success: Q2ColorUnit;
|
success: Q2ColorUnit;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user