@panneau/protocol 5.0.0-alpha.1 → 5.0.0-alpha.2

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.
@@ -9,6 +9,7 @@ export * from './layout';
9
9
  export * from './list';
10
10
  export * from './action';
11
11
  export * from './resource';
12
+ export * from './theme';
12
13
  export * from './definition';
13
14
  export * from './api';
14
15
  export * from './boot';
@@ -790,6 +791,175 @@ export declare const namedSchemas: {
790
791
  endpoint: z.ZodOptional<z.ZodString>;
791
792
  maxSize: z.ZodOptional<z.ZodNumber>;
792
793
  }, z.core.$loose>;
794
+ ThemeTokens: z.ZodRecord<z.ZodString, z.ZodString>;
795
+ ToneValues: z.ZodObject<{
796
+ text: z.ZodString;
797
+ subtle: z.ZodString;
798
+ border: z.ZodString;
799
+ outline: z.ZodString;
800
+ solid: z.ZodString;
801
+ solidHover: z.ZodString;
802
+ solidText: z.ZodString;
803
+ }, z.core.$loose>;
804
+ ToneInput: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
805
+ text: z.ZodString;
806
+ subtle: z.ZodString;
807
+ border: z.ZodString;
808
+ outline: z.ZodString;
809
+ solid: z.ZodString;
810
+ solidHover: z.ZodString;
811
+ solidText: z.ZodString;
812
+ dark: z.ZodOptional<z.ZodObject<{
813
+ text: z.ZodOptional<z.ZodString>;
814
+ subtle: z.ZodOptional<z.ZodString>;
815
+ border: z.ZodOptional<z.ZodString>;
816
+ outline: z.ZodOptional<z.ZodString>;
817
+ solid: z.ZodOptional<z.ZodString>;
818
+ solidHover: z.ZodOptional<z.ZodString>;
819
+ solidText: z.ZodOptional<z.ZodString>;
820
+ }, z.core.$loose>>;
821
+ }, z.core.$loose>]>;
822
+ ThemeFontFace: z.ZodObject<{
823
+ family: z.ZodString;
824
+ src: z.ZodString;
825
+ weight: z.ZodOptional<z.ZodString>;
826
+ style: z.ZodOptional<z.ZodString>;
827
+ display: z.ZodOptional<z.ZodEnum<{
828
+ optional: "optional";
829
+ auto: "auto";
830
+ block: "block";
831
+ swap: "swap";
832
+ fallback: "fallback";
833
+ }>>;
834
+ unicodeRange: z.ZodOptional<z.ZodString>;
835
+ }, z.core.$loose>;
836
+ ThemeFontStylesheet: z.ZodObject<{
837
+ stylesheet: z.ZodString;
838
+ }, z.core.$loose>;
839
+ ThemeFont: z.ZodUnion<readonly [z.ZodObject<{
840
+ family: z.ZodString;
841
+ src: z.ZodString;
842
+ weight: z.ZodOptional<z.ZodString>;
843
+ style: z.ZodOptional<z.ZodString>;
844
+ display: z.ZodOptional<z.ZodEnum<{
845
+ optional: "optional";
846
+ auto: "auto";
847
+ block: "block";
848
+ swap: "swap";
849
+ fallback: "fallback";
850
+ }>>;
851
+ unicodeRange: z.ZodOptional<z.ZodString>;
852
+ }, z.core.$loose>, z.ZodObject<{
853
+ stylesheet: z.ZodString;
854
+ }, z.core.$loose>]>;
855
+ Theme: z.ZodObject<{
856
+ label: z.ZodOptional<z.ZodString>;
857
+ tokens: z.ZodRecord<z.ZodString, z.ZodString>;
858
+ dark: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
859
+ palette: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
860
+ tones: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
861
+ text: z.ZodString;
862
+ subtle: z.ZodString;
863
+ border: z.ZodString;
864
+ outline: z.ZodString;
865
+ solid: z.ZodString;
866
+ solidHover: z.ZodString;
867
+ solidText: z.ZodString;
868
+ dark: z.ZodOptional<z.ZodObject<{
869
+ text: z.ZodOptional<z.ZodString>;
870
+ subtle: z.ZodOptional<z.ZodString>;
871
+ border: z.ZodOptional<z.ZodString>;
872
+ outline: z.ZodOptional<z.ZodString>;
873
+ solid: z.ZodOptional<z.ZodString>;
874
+ solidHover: z.ZodOptional<z.ZodString>;
875
+ solidText: z.ZodOptional<z.ZodString>;
876
+ }, z.core.$loose>>;
877
+ }, z.core.$loose>]>>>;
878
+ components: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
879
+ variants: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>>;
880
+ }, z.core.$loose>>>;
881
+ densities: z.ZodOptional<z.ZodObject<{
882
+ compact: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
883
+ comfortable: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
884
+ touch: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
885
+ }, z.core.$loose>>;
886
+ fonts: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
887
+ family: z.ZodString;
888
+ src: z.ZodString;
889
+ weight: z.ZodOptional<z.ZodString>;
890
+ style: z.ZodOptional<z.ZodString>;
891
+ display: z.ZodOptional<z.ZodEnum<{
892
+ optional: "optional";
893
+ auto: "auto";
894
+ block: "block";
895
+ swap: "swap";
896
+ fallback: "fallback";
897
+ }>>;
898
+ unicodeRange: z.ZodOptional<z.ZodString>;
899
+ }, z.core.$loose>, z.ZodObject<{
900
+ stylesheet: z.ZodString;
901
+ }, z.core.$loose>]>>>;
902
+ }, z.core.$loose>;
903
+ DefinitionTheme: z.ZodObject<{
904
+ tokens: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
905
+ colorScheme: z.ZodOptional<z.ZodEnum<{
906
+ dark: "dark";
907
+ auto: "auto";
908
+ light: "light";
909
+ }>>;
910
+ density: z.ZodOptional<z.ZodEnum<{
911
+ auto: "auto";
912
+ compact: "compact";
913
+ comfortable: "comfortable";
914
+ touch: "touch";
915
+ }>>;
916
+ extends: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
917
+ label: z.ZodOptional<z.ZodString>;
918
+ dark: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
919
+ palette: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
920
+ tones: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
921
+ text: z.ZodString;
922
+ subtle: z.ZodString;
923
+ border: z.ZodString;
924
+ outline: z.ZodString;
925
+ solid: z.ZodString;
926
+ solidHover: z.ZodString;
927
+ solidText: z.ZodString;
928
+ dark: z.ZodOptional<z.ZodObject<{
929
+ text: z.ZodOptional<z.ZodString>;
930
+ subtle: z.ZodOptional<z.ZodString>;
931
+ border: z.ZodOptional<z.ZodString>;
932
+ outline: z.ZodOptional<z.ZodString>;
933
+ solid: z.ZodOptional<z.ZodString>;
934
+ solidHover: z.ZodOptional<z.ZodString>;
935
+ solidText: z.ZodOptional<z.ZodString>;
936
+ }, z.core.$loose>>;
937
+ }, z.core.$loose>]>>>;
938
+ components: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
939
+ variants: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>>;
940
+ }, z.core.$loose>>>;
941
+ densities: z.ZodOptional<z.ZodObject<{
942
+ compact: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
943
+ comfortable: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
944
+ touch: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
945
+ }, z.core.$loose>>;
946
+ fonts: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
947
+ family: z.ZodString;
948
+ src: z.ZodString;
949
+ weight: z.ZodOptional<z.ZodString>;
950
+ style: z.ZodOptional<z.ZodString>;
951
+ display: z.ZodOptional<z.ZodEnum<{
952
+ optional: "optional";
953
+ auto: "auto";
954
+ block: "block";
955
+ swap: "swap";
956
+ fallback: "fallback";
957
+ }>>;
958
+ unicodeRange: z.ZodOptional<z.ZodString>;
959
+ }, z.core.$loose>, z.ZodObject<{
960
+ stylesheet: z.ZodString;
961
+ }, z.core.$loose>]>>>;
962
+ }, z.core.$loose>;
793
963
  Definition: z.ZodObject<{
794
964
  protocol: z.ZodLiteral<1>;
795
965
  name: z.ZodString;
@@ -1163,11 +1333,64 @@ export declare const namedSchemas: {
1163
1333
  maxSize: z.ZodOptional<z.ZodNumber>;
1164
1334
  }, z.core.$loose>>;
1165
1335
  theme: z.ZodOptional<z.ZodObject<{
1336
+ tokens: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1166
1337
  colorScheme: z.ZodOptional<z.ZodEnum<{
1167
- light: "light";
1168
1338
  dark: "dark";
1169
1339
  auto: "auto";
1340
+ light: "light";
1170
1341
  }>>;
1342
+ density: z.ZodOptional<z.ZodEnum<{
1343
+ auto: "auto";
1344
+ compact: "compact";
1345
+ comfortable: "comfortable";
1346
+ touch: "touch";
1347
+ }>>;
1348
+ extends: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
1349
+ label: z.ZodOptional<z.ZodString>;
1350
+ dark: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1351
+ palette: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1352
+ tones: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1353
+ text: z.ZodString;
1354
+ subtle: z.ZodString;
1355
+ border: z.ZodString;
1356
+ outline: z.ZodString;
1357
+ solid: z.ZodString;
1358
+ solidHover: z.ZodString;
1359
+ solidText: z.ZodString;
1360
+ dark: z.ZodOptional<z.ZodObject<{
1361
+ text: z.ZodOptional<z.ZodString>;
1362
+ subtle: z.ZodOptional<z.ZodString>;
1363
+ border: z.ZodOptional<z.ZodString>;
1364
+ outline: z.ZodOptional<z.ZodString>;
1365
+ solid: z.ZodOptional<z.ZodString>;
1366
+ solidHover: z.ZodOptional<z.ZodString>;
1367
+ solidText: z.ZodOptional<z.ZodString>;
1368
+ }, z.core.$loose>>;
1369
+ }, z.core.$loose>]>>>;
1370
+ components: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1371
+ variants: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>>;
1372
+ }, z.core.$loose>>>;
1373
+ densities: z.ZodOptional<z.ZodObject<{
1374
+ compact: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1375
+ comfortable: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1376
+ touch: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1377
+ }, z.core.$loose>>;
1378
+ fonts: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
1379
+ family: z.ZodString;
1380
+ src: z.ZodString;
1381
+ weight: z.ZodOptional<z.ZodString>;
1382
+ style: z.ZodOptional<z.ZodString>;
1383
+ display: z.ZodOptional<z.ZodEnum<{
1384
+ optional: "optional";
1385
+ auto: "auto";
1386
+ block: "block";
1387
+ swap: "swap";
1388
+ fallback: "fallback";
1389
+ }>>;
1390
+ unicodeRange: z.ZodOptional<z.ZodString>;
1391
+ }, z.core.$loose>, z.ZodObject<{
1392
+ stylesheet: z.ZodString;
1393
+ }, z.core.$loose>]>>>;
1171
1394
  }, z.core.$loose>>;
1172
1395
  user: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1173
1396
  id: z.ZodString;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAuBxB,OAAO,EAAa,SAAS,EAA8B,MAAM,UAAU,CAAC;AAC5E,OAAO,EAIH,QAAQ,EAKX,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,SAAS,EAAE,KAAK,EAAQ,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAItC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;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
5
  import { Column, Filter, ListDefinition } from "./list.js";
6
6
  import { Resource, ResourceFeatures } from "./resource.js";
7
+ import { DefinitionTheme, Theme, ThemeFont, ThemeFontFace, ThemeFontStylesheet, ThemeTokens, ToneInput, ToneValues } from "./theme.js";
7
8
  import { Auth, AuthProvider, Definition, MenuItem, Page, Uploads, User, Widget } from "./definition.js";
8
9
  import { ActionItemResult, ActionRequest, ActionResult, ActionRun, ActionRunResponse, Item, ItemResponse, ListResponse, Media, MediaListResponse, MediaResponse, MediaTransform, Pagination, PreviewResponse, Problem, SearchResponse, Selection, Session } from "./api.js";
9
10
  import { BootConfig } from "./boot.js";
@@ -36,6 +37,14 @@ var namedSchemas = {
36
37
  Page,
37
38
  Widget,
38
39
  Uploads,
40
+ ThemeTokens,
41
+ ToneValues,
42
+ ToneInput,
43
+ ThemeFontFace,
44
+ ThemeFontStylesheet,
45
+ ThemeFont,
46
+ Theme,
47
+ DefinitionTheme,
39
48
  Definition,
40
49
  Item,
41
50
  Pagination,
@@ -63,6 +72,6 @@ function createSchemaRegistry() {
63
72
  return registry;
64
73
  }
65
74
  //#endregion
66
- export { Abilities, Action, ActionConfirm, ActionItemResult, ActionPlacement, ActionRequest, ActionResult, ActionRun, ActionRunResponse, ActionScope, Auth, AuthProvider, BlockType, BootConfig, Column, Condition, Definition, Field, Filter, Id, Item, ItemResponse, LayoutNode, ListDefinition, ListResponse, Media, MediaListResponse, MediaResponse, MediaTransform, MenuItem, Option, Page, Pagination, PreviewResponse, Problem, Resource, ResourceFeatures, RouteReference, Rule, SearchResponse, Selection, Session, Uploads, User, Widget, createSchemaRegistry, namedSchemas };
75
+ export { Abilities, Action, ActionConfirm, ActionItemResult, ActionPlacement, ActionRequest, ActionResult, ActionRun, ActionRunResponse, ActionScope, Auth, AuthProvider, BlockType, BootConfig, Column, Condition, Definition, DefinitionTheme, Field, Filter, Id, Item, ItemResponse, LayoutNode, ListDefinition, ListResponse, Media, MediaListResponse, MediaResponse, MediaTransform, MenuItem, Option, Page, Pagination, PreviewResponse, Problem, Resource, ResourceFeatures, RouteReference, Rule, SearchResponse, Selection, Session, Theme, ThemeFont, ThemeFontFace, ThemeFontStylesheet, ThemeTokens, ToneInput, ToneValues, Uploads, User, Widget, createSchemaRegistry, namedSchemas };
67
76
 
68
77
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/schemas/index.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { Action, ActionConfirm, ActionPlacement, ActionScope } from './action';\nimport {\n ActionItemResult,\n ActionRequest,\n ActionResult,\n ActionRun,\n ActionRunResponse,\n Item,\n ItemResponse,\n ListResponse,\n Media,\n MediaListResponse,\n MediaResponse,\n MediaTransform,\n Pagination,\n PreviewResponse,\n Problem,\n SearchResponse,\n Selection,\n Session,\n} from './api';\nimport { Abilities, Condition, Id, Option, RouteReference } from './common';\nimport {\n Auth,\n AuthProvider,\n Definition,\n MenuItem,\n Page,\n Uploads,\n User,\n Widget,\n} from './definition';\nimport { BlockType, Field, Rule } from './field';\nimport { LayoutNode } from './layout';\nimport { Column, Filter, ListDefinition } from './list';\nimport { Resource, ResourceFeatures } from './resource';\n\nexport * from './common';\nexport * from './field';\nexport * from './layout';\nexport * from './list';\nexport * from './action';\nexport * from './resource';\nexport * from './definition';\nexport * from './api';\nexport * from './boot';\n\n/** The named schemas of the protocol, as they appear in the generated JSON Schema and OpenAPI files. */\nexport const namedSchemas = {\n Id,\n Abilities,\n RouteReference,\n Condition,\n Option,\n Rule,\n BlockType,\n Field,\n LayoutNode,\n Column,\n Filter,\n ListDefinition,\n ActionScope,\n ActionPlacement,\n ActionConfirm,\n Action,\n ResourceFeatures,\n Resource,\n User,\n AuthProvider,\n Auth,\n MenuItem,\n Page,\n Widget,\n Uploads,\n Definition,\n Item,\n Pagination,\n ItemResponse,\n ListResponse,\n Problem,\n Selection,\n ActionRequest,\n ActionItemResult,\n ActionResult,\n ActionRun,\n ActionRunResponse,\n MediaTransform,\n Media,\n MediaResponse,\n MediaListResponse,\n Session,\n SearchResponse,\n PreviewResponse,\n} satisfies Record<string, z.ZodType>;\n\n/** A registry of the named schemas, used to reference them by name in generated files. */\nexport function createSchemaRegistry() {\n const registry = z.registry<{ id: string }>();\n Object.entries(namedSchemas).forEach(([id, schema]) => registry.add(schema, { id }));\n return registry;\n}\n"],"mappings":";;;;;;;;;;;;AAkDA,IAAa,eAAe;CACxB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACJ;;AAGA,SAAgB,uBAAuB;CACnC,MAAM,WAAW,EAAE,SAAyB;CAC5C,OAAO,QAAQ,YAAY,CAAC,CAAC,SAAS,CAAC,IAAI,YAAY,SAAS,IAAI,QAAQ,EAAE,GAAG,CAAC,CAAC;CACnF,OAAO;AACX"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/schemas/index.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { Action, ActionConfirm, ActionPlacement, ActionScope } from './action';\nimport {\n ActionItemResult,\n ActionRequest,\n ActionResult,\n ActionRun,\n ActionRunResponse,\n Item,\n ItemResponse,\n ListResponse,\n Media,\n MediaListResponse,\n MediaResponse,\n MediaTransform,\n Pagination,\n PreviewResponse,\n Problem,\n SearchResponse,\n Selection,\n Session,\n} from './api';\nimport { Abilities, Condition, Id, Option, RouteReference } from './common';\nimport {\n Auth,\n AuthProvider,\n Definition,\n MenuItem,\n Page,\n Uploads,\n User,\n Widget,\n} from './definition';\nimport { BlockType, Field, Rule } from './field';\nimport { LayoutNode } from './layout';\nimport { Column, Filter, ListDefinition } from './list';\nimport { Resource, ResourceFeatures } from './resource';\nimport {\n DefinitionTheme,\n Theme,\n ThemeFont,\n ThemeFontFace,\n ThemeFontStylesheet,\n ThemeTokens,\n ToneInput,\n ToneValues,\n} from './theme';\n\nexport * from './common';\nexport * from './field';\nexport * from './layout';\nexport * from './list';\nexport * from './action';\nexport * from './resource';\nexport * from './theme';\nexport * from './definition';\nexport * from './api';\nexport * from './boot';\n\n/** The named schemas of the protocol, as they appear in the generated JSON Schema and OpenAPI files. */\nexport const namedSchemas = {\n Id,\n Abilities,\n RouteReference,\n Condition,\n Option,\n Rule,\n BlockType,\n Field,\n LayoutNode,\n Column,\n Filter,\n ListDefinition,\n ActionScope,\n ActionPlacement,\n ActionConfirm,\n Action,\n ResourceFeatures,\n Resource,\n User,\n AuthProvider,\n Auth,\n MenuItem,\n Page,\n Widget,\n Uploads,\n ThemeTokens,\n ToneValues,\n ToneInput,\n ThemeFontFace,\n ThemeFontStylesheet,\n ThemeFont,\n Theme,\n DefinitionTheme,\n Definition,\n Item,\n Pagination,\n ItemResponse,\n ListResponse,\n Problem,\n Selection,\n ActionRequest,\n ActionItemResult,\n ActionResult,\n ActionRun,\n ActionRunResponse,\n MediaTransform,\n Media,\n MediaResponse,\n MediaListResponse,\n Session,\n SearchResponse,\n PreviewResponse,\n} satisfies Record<string, z.ZodType>;\n\n/** A registry of the named schemas, used to reference them by name in generated files. */\nexport function createSchemaRegistry() {\n const registry = z.registry<{ id: string }>();\n Object.entries(namedSchemas).forEach(([id, schema]) => registry.add(schema, { id }));\n return registry;\n}\n"],"mappings":";;;;;;;;;;;;;AA6DA,IAAa,eAAe;CACxB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACJ;;AAGA,SAAgB,uBAAuB;CACnC,MAAM,WAAW,EAAE,SAAyB;CAC5C,OAAO,QAAQ,YAAY,CAAC,CAAC,SAAS,CAAC,IAAI,YAAY,SAAS,IAAI,QAAQ,EAAE,GAAG,CAAC,CAAC;CACnF,OAAO;AACX"}
@@ -0,0 +1,179 @@
1
+ import { z } from 'zod';
2
+ export declare const ThemeTokens: z.ZodRecord<z.ZodString, z.ZodString>;
3
+ export declare const ToneValues: z.ZodObject<{
4
+ text: z.ZodString;
5
+ subtle: z.ZodString;
6
+ border: z.ZodString;
7
+ outline: z.ZodString;
8
+ solid: z.ZodString;
9
+ solidHover: z.ZodString;
10
+ solidText: z.ZodString;
11
+ }, z.core.$loose>;
12
+ export declare const ToneInput: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
13
+ text: z.ZodString;
14
+ subtle: z.ZodString;
15
+ border: z.ZodString;
16
+ outline: z.ZodString;
17
+ solid: z.ZodString;
18
+ solidHover: z.ZodString;
19
+ solidText: z.ZodString;
20
+ dark: z.ZodOptional<z.ZodObject<{
21
+ text: z.ZodOptional<z.ZodString>;
22
+ subtle: z.ZodOptional<z.ZodString>;
23
+ border: z.ZodOptional<z.ZodString>;
24
+ outline: z.ZodOptional<z.ZodString>;
25
+ solid: z.ZodOptional<z.ZodString>;
26
+ solidHover: z.ZodOptional<z.ZodString>;
27
+ solidText: z.ZodOptional<z.ZodString>;
28
+ }, z.core.$loose>>;
29
+ }, z.core.$loose>]>;
30
+ export declare const ThemeFontFace: z.ZodObject<{
31
+ family: z.ZodString;
32
+ src: z.ZodString;
33
+ weight: z.ZodOptional<z.ZodString>;
34
+ style: z.ZodOptional<z.ZodString>;
35
+ display: z.ZodOptional<z.ZodEnum<{
36
+ optional: "optional";
37
+ auto: "auto";
38
+ block: "block";
39
+ swap: "swap";
40
+ fallback: "fallback";
41
+ }>>;
42
+ unicodeRange: z.ZodOptional<z.ZodString>;
43
+ }, z.core.$loose>;
44
+ export declare const ThemeFontStylesheet: z.ZodObject<{
45
+ stylesheet: z.ZodString;
46
+ }, z.core.$loose>;
47
+ export declare const ThemeFont: z.ZodUnion<readonly [z.ZodObject<{
48
+ family: z.ZodString;
49
+ src: z.ZodString;
50
+ weight: z.ZodOptional<z.ZodString>;
51
+ style: z.ZodOptional<z.ZodString>;
52
+ display: z.ZodOptional<z.ZodEnum<{
53
+ optional: "optional";
54
+ auto: "auto";
55
+ block: "block";
56
+ swap: "swap";
57
+ fallback: "fallback";
58
+ }>>;
59
+ unicodeRange: z.ZodOptional<z.ZodString>;
60
+ }, z.core.$loose>, z.ZodObject<{
61
+ stylesheet: z.ZodString;
62
+ }, z.core.$loose>]>;
63
+ export declare const Theme: z.ZodObject<{
64
+ label: z.ZodOptional<z.ZodString>;
65
+ tokens: z.ZodRecord<z.ZodString, z.ZodString>;
66
+ dark: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
67
+ palette: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
68
+ tones: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
69
+ text: z.ZodString;
70
+ subtle: z.ZodString;
71
+ border: z.ZodString;
72
+ outline: z.ZodString;
73
+ solid: z.ZodString;
74
+ solidHover: z.ZodString;
75
+ solidText: z.ZodString;
76
+ dark: z.ZodOptional<z.ZodObject<{
77
+ text: z.ZodOptional<z.ZodString>;
78
+ subtle: z.ZodOptional<z.ZodString>;
79
+ border: z.ZodOptional<z.ZodString>;
80
+ outline: z.ZodOptional<z.ZodString>;
81
+ solid: z.ZodOptional<z.ZodString>;
82
+ solidHover: z.ZodOptional<z.ZodString>;
83
+ solidText: z.ZodOptional<z.ZodString>;
84
+ }, z.core.$loose>>;
85
+ }, z.core.$loose>]>>>;
86
+ components: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
87
+ variants: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>>;
88
+ }, z.core.$loose>>>;
89
+ densities: z.ZodOptional<z.ZodObject<{
90
+ compact: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
91
+ comfortable: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
92
+ touch: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
93
+ }, z.core.$loose>>;
94
+ fonts: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
95
+ family: z.ZodString;
96
+ src: z.ZodString;
97
+ weight: z.ZodOptional<z.ZodString>;
98
+ style: z.ZodOptional<z.ZodString>;
99
+ display: z.ZodOptional<z.ZodEnum<{
100
+ optional: "optional";
101
+ auto: "auto";
102
+ block: "block";
103
+ swap: "swap";
104
+ fallback: "fallback";
105
+ }>>;
106
+ unicodeRange: z.ZodOptional<z.ZodString>;
107
+ }, z.core.$loose>, z.ZodObject<{
108
+ stylesheet: z.ZodString;
109
+ }, z.core.$loose>]>>>;
110
+ }, z.core.$loose>;
111
+ export declare const DefinitionTheme: z.ZodObject<{
112
+ tokens: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
113
+ colorScheme: z.ZodOptional<z.ZodEnum<{
114
+ dark: "dark";
115
+ auto: "auto";
116
+ light: "light";
117
+ }>>;
118
+ density: z.ZodOptional<z.ZodEnum<{
119
+ auto: "auto";
120
+ compact: "compact";
121
+ comfortable: "comfortable";
122
+ touch: "touch";
123
+ }>>;
124
+ extends: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
125
+ label: z.ZodOptional<z.ZodString>;
126
+ dark: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
127
+ palette: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
128
+ tones: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
129
+ text: z.ZodString;
130
+ subtle: z.ZodString;
131
+ border: z.ZodString;
132
+ outline: z.ZodString;
133
+ solid: z.ZodString;
134
+ solidHover: z.ZodString;
135
+ solidText: z.ZodString;
136
+ dark: z.ZodOptional<z.ZodObject<{
137
+ text: z.ZodOptional<z.ZodString>;
138
+ subtle: z.ZodOptional<z.ZodString>;
139
+ border: z.ZodOptional<z.ZodString>;
140
+ outline: z.ZodOptional<z.ZodString>;
141
+ solid: z.ZodOptional<z.ZodString>;
142
+ solidHover: z.ZodOptional<z.ZodString>;
143
+ solidText: z.ZodOptional<z.ZodString>;
144
+ }, z.core.$loose>>;
145
+ }, z.core.$loose>]>>>;
146
+ components: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
147
+ variants: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>>;
148
+ }, z.core.$loose>>>;
149
+ densities: z.ZodOptional<z.ZodObject<{
150
+ compact: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
151
+ comfortable: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
152
+ touch: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
153
+ }, z.core.$loose>>;
154
+ fonts: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
155
+ family: z.ZodString;
156
+ src: z.ZodString;
157
+ weight: z.ZodOptional<z.ZodString>;
158
+ style: z.ZodOptional<z.ZodString>;
159
+ display: z.ZodOptional<z.ZodEnum<{
160
+ optional: "optional";
161
+ auto: "auto";
162
+ block: "block";
163
+ swap: "swap";
164
+ fallback: "fallback";
165
+ }>>;
166
+ unicodeRange: z.ZodOptional<z.ZodString>;
167
+ }, z.core.$loose>, z.ZodObject<{
168
+ stylesheet: z.ZodString;
169
+ }, z.core.$loose>]>>>;
170
+ }, z.core.$loose>;
171
+ export type ThemeTokens = z.infer<typeof ThemeTokens>;
172
+ export type ToneValues = z.infer<typeof ToneValues>;
173
+ export type ToneInput = z.infer<typeof ToneInput>;
174
+ export type Theme = z.infer<typeof Theme>;
175
+ export type DefinitionTheme = z.infer<typeof DefinitionTheme>;
176
+ export type ThemeFontFace = z.infer<typeof ThemeFontFace>;
177
+ export type ThemeFontStylesheet = z.infer<typeof ThemeFontStylesheet>;
178
+ export type ThemeFont = z.infer<typeof ThemeFont>;
179
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/schemas/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,WAAW,uCAKlB,CAAC;AAEP,eAAO,MAAM,UAAU;;;;;;;;iBAQrB,CAAC;AAEH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;mBAKqE,CAAC;AAE5F,eAAO,MAAM,aAAa;;;;;;;;;;;;;iBAuBiD,CAAC;AAE5E,eAAO,MAAM,mBAAmB;;iBAE2C,CAAC;AAE5E,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;mBAAgD,CAAC;AA0CvE,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAEoE,CAAC;AAEvF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAc8D,CAAC;AAE3F,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AACtD,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AACpD,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAClD,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,KAAK,CAAC,CAAC;AAC1C,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAC9D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAC1D,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACtE,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC"}
@@ -0,0 +1,66 @@
1
+ import { z } from "zod";
2
+ //#region src/schemas/theme.ts
3
+ /** Names of tones, palette colors, components and variants: they become CSS class names. */
4
+ var Name = z.string().regex(/^[a-z0-9-]+$/);
5
+ var ThemeTokens = z.record(z.string().regex(/^[a-zA-Z0-9_-]+$/), z.string().regex(/^[^{};<]*$/)).meta({ description: "CSS variables without the leading `--`, and their values: `{ \"panneau-color-accent\": \"#05f\" }`. Values cannot contain `{`, `}`, `;` or `<`." });
6
+ var ToneValues = z.looseObject({
7
+ text: z.string().meta({ description: "Text and icons on surfaces." }),
8
+ subtle: z.string().meta({ description: "Background of the subtle appearance." }),
9
+ border: z.string().meta({ description: "Border of the subtle appearance." }),
10
+ outline: z.string().meta({ description: "Border of the outline appearance." }),
11
+ solid: z.string().meta({ description: "Background of the solid appearance." }),
12
+ solidHover: z.string().meta({ description: "Background of the solid appearance on hover." }),
13
+ solidText: z.string().meta({ description: "Text on the solid appearance." })
14
+ });
15
+ var ToneInput = z.union([z.string().meta({ description: "One color, from which Panneau derives the others." }), ToneValues.extend({ dark: ToneValues.partial().optional() })]).meta({ description: "A tone: one color, or every value with dark scheme overrides." });
16
+ var ThemeFontFace = z.looseObject({
17
+ family: z.string().regex(/^[^{}<;"\\]+$/),
18
+ src: z.string().regex(/^[^{}<]+$/).meta({ description: "The `src` descriptor: `url(/fonts/geist.woff2) format('woff2')`." }),
19
+ weight: z.string().regex(/^[^{}<;]*$/).optional(),
20
+ style: z.string().regex(/^[^{}<;]*$/).optional(),
21
+ display: z.enum([
22
+ "auto",
23
+ "block",
24
+ "swap",
25
+ "fallback",
26
+ "optional"
27
+ ]).optional(),
28
+ unicodeRange: z.string().regex(/^[^{}<;]*$/).optional()
29
+ }).meta({ description: "A font face, written as an `@font-face` rule." });
30
+ var ThemeFontStylesheet = z.looseObject({ stylesheet: z.string().min(1) }).meta({ description: "A hosted stylesheet that declares font faces." });
31
+ var ThemeFont = z.union([ThemeFontFace, ThemeFontStylesheet]);
32
+ var themeShape = {
33
+ label: z.string().optional(),
34
+ tokens: ThemeTokens.meta({ description: "Tokens of the light scheme, or of both schemes when `dark` does not set them." }),
35
+ dark: ThemeTokens.optional().meta({ description: "Tokens that change in the dark scheme." }),
36
+ palette: z.record(Name, z.string().regex(/^[^{};<]*$/)).optional().meta({ description: "Raw colors, written as `--panneau-palette-<name>`: tokens and tones use them with `var(--panneau-palette-<name>)`." }),
37
+ tones: z.record(Name, ToneInput).optional().meta({ description: "Tones added or redefined by the theme, applied by `panneau-tone-<name>`." }),
38
+ components: z.record(Name, z.looseObject({ variants: z.record(Name, ThemeTokens).optional() })).optional().meta({ description: "Named variants of components: tokens applied by `panneau-<component>-variant-<name>`." }),
39
+ densities: z.looseObject({
40
+ compact: ThemeTokens.optional(),
41
+ comfortable: ThemeTokens.optional(),
42
+ touch: ThemeTokens.optional()
43
+ }).optional().meta({ description: "Tokens of each density (`panneau-control-height`…), which change with the density of the root." }),
44
+ fonts: z.array(ThemeFont).optional().meta({ description: "Font faces and font stylesheets, added to the page once." })
45
+ };
46
+ var Theme = z.looseObject(themeShape).meta({ description: "A theme of `@panneau/ui`, as plain data (decision 0024)." });
47
+ var DefinitionTheme = z.looseObject({
48
+ ...themeShape,
49
+ tokens: themeShape.tokens.optional(),
50
+ colorScheme: z.enum([
51
+ "light",
52
+ "dark",
53
+ "auto"
54
+ ]).optional(),
55
+ density: z.enum([
56
+ "compact",
57
+ "comfortable",
58
+ "touch",
59
+ "auto"
60
+ ]).optional(),
61
+ extends: z.union([z.string(), z.array(z.string())]).optional().meta({ description: "Themes registered by plugins, by id, that this theme builds on, in order: its own values override theirs." })
62
+ }).meta({ description: "The theme of the admin: a theme, built on themes of plugins." });
63
+ //#endregion
64
+ export { DefinitionTheme, Theme, ThemeFont, ThemeFontFace, ThemeFontStylesheet, ThemeTokens, ToneInput, ToneValues };
65
+
66
+ //# sourceMappingURL=theme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.js","names":[],"sources":["../../src/schemas/theme.ts"],"sourcesContent":["import { z } from 'zod';\n\n/** Names of tones, palette colors, components and variants: they become CSS class names. */\nconst Name = z.string().regex(/^[a-z0-9-]+$/);\n\nexport const ThemeTokens = z\n .record(z.string().regex(/^[a-zA-Z0-9_-]+$/), z.string().regex(/^[^{};<]*$/))\n .meta({\n description:\n 'CSS variables without the leading `--`, and their values: `{ \"panneau-color-accent\": \"#05f\" }`. Values cannot contain `{`, `}`, `;` or `<`.',\n });\n\nexport const ToneValues = z.looseObject({\n text: z.string().meta({ description: 'Text and icons on surfaces.' }),\n subtle: z.string().meta({ description: 'Background of the subtle appearance.' }),\n border: z.string().meta({ description: 'Border of the subtle appearance.' }),\n outline: z.string().meta({ description: 'Border of the outline appearance.' }),\n solid: z.string().meta({ description: 'Background of the solid appearance.' }),\n solidHover: z.string().meta({ description: 'Background of the solid appearance on hover.' }),\n solidText: z.string().meta({ description: 'Text on the solid appearance.' }),\n});\n\nexport const ToneInput = z\n .union([\n z.string().meta({ description: 'One color, from which Panneau derives the others.' }),\n ToneValues.extend({ dark: ToneValues.partial().optional() }),\n ])\n .meta({ description: 'A tone: one color, or every value with dark scheme overrides.' });\n\nexport const ThemeFontFace = z\n .looseObject({\n family: z.string().regex(/^[^{}<;\"\\\\]+$/),\n src: z\n .string()\n .regex(/^[^{}<]+$/)\n .meta({\n description: \"The `src` descriptor: `url(/fonts/geist.woff2) format('woff2')`.\",\n }),\n weight: z\n .string()\n .regex(/^[^{}<;]*$/)\n .optional(),\n style: z\n .string()\n .regex(/^[^{}<;]*$/)\n .optional(),\n display: z.enum(['auto', 'block', 'swap', 'fallback', 'optional']).optional(),\n unicodeRange: z\n .string()\n .regex(/^[^{}<;]*$/)\n .optional(),\n })\n .meta({ description: 'A font face, written as an `@font-face` rule.' });\n\nexport const ThemeFontStylesheet = z\n .looseObject({ stylesheet: z.string().min(1) })\n .meta({ description: 'A hosted stylesheet that declares font faces.' });\n\nexport const ThemeFont = z.union([ThemeFontFace, ThemeFontStylesheet]);\n\nconst themeShape = {\n label: z.string().optional(),\n tokens: ThemeTokens.meta({\n description:\n 'Tokens of the light scheme, or of both schemes when `dark` does not set them.',\n }),\n dark: ThemeTokens.optional().meta({ description: 'Tokens that change in the dark scheme.' }),\n palette: z\n .record(Name, z.string().regex(/^[^{};<]*$/))\n .optional()\n .meta({\n description:\n 'Raw colors, written as `--panneau-palette-<name>`: tokens and tones use them with `var(--panneau-palette-<name>)`.',\n }),\n tones: z.record(Name, ToneInput).optional().meta({\n description: 'Tones added or redefined by the theme, applied by `panneau-tone-<name>`.',\n }),\n components: z\n .record(Name, z.looseObject({ variants: z.record(Name, ThemeTokens).optional() }))\n .optional()\n .meta({\n description:\n 'Named variants of components: tokens applied by `panneau-<component>-variant-<name>`.',\n }),\n densities: z\n .looseObject({\n compact: ThemeTokens.optional(),\n comfortable: ThemeTokens.optional(),\n touch: ThemeTokens.optional(),\n })\n .optional()\n .meta({\n description:\n 'Tokens of each density (`panneau-control-height`…), which change with the density of the root.',\n }),\n fonts: z.array(ThemeFont).optional().meta({\n description: 'Font faces and font stylesheets, added to the page once.',\n }),\n};\n\nexport const Theme = z\n .looseObject(themeShape)\n .meta({ description: 'A theme of `@panneau/ui`, as plain data (decision 0024).' });\n\nexport const DefinitionTheme = z\n .looseObject({\n ...themeShape,\n tokens: themeShape.tokens.optional(),\n colorScheme: z.enum(['light', 'dark', 'auto']).optional(),\n density: z.enum(['compact', 'comfortable', 'touch', 'auto']).optional(),\n extends: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .meta({\n description:\n 'Themes registered by plugins, by id, that this theme builds on, in order: its own values override theirs.',\n }),\n })\n .meta({ description: 'The theme of the admin: a theme, built on themes of plugins.' });\n\nexport type ThemeTokens = z.infer<typeof ThemeTokens>;\nexport type ToneValues = z.infer<typeof ToneValues>;\nexport type ToneInput = z.infer<typeof ToneInput>;\nexport type Theme = z.infer<typeof Theme>;\nexport type DefinitionTheme = z.infer<typeof DefinitionTheme>;\nexport type ThemeFontFace = z.infer<typeof ThemeFontFace>;\nexport type ThemeFontStylesheet = z.infer<typeof ThemeFontStylesheet>;\nexport type ThemeFont = z.infer<typeof ThemeFont>;\n"],"mappings":";;;AAGA,IAAM,OAAO,EAAE,OAAO,CAAC,CAAC,MAAM,cAAc;AAE5C,IAAa,cAAc,EACtB,OAAO,EAAE,OAAO,CAAC,CAAC,MAAM,kBAAkB,GAAG,EAAE,OAAO,CAAC,CAAC,MAAM,YAAY,CAAC,CAAC,CAC5E,KAAK,EACF,aACI,kJACR,CAAC;AAEL,IAAa,aAAa,EAAE,YAAY;CACpC,MAAM,EAAE,OAAO,CAAC,CAAC,KAAK,EAAE,aAAa,8BAA8B,CAAC;CACpE,QAAQ,EAAE,OAAO,CAAC,CAAC,KAAK,EAAE,aAAa,uCAAuC,CAAC;CAC/E,QAAQ,EAAE,OAAO,CAAC,CAAC,KAAK,EAAE,aAAa,mCAAmC,CAAC;CAC3E,SAAS,EAAE,OAAO,CAAC,CAAC,KAAK,EAAE,aAAa,oCAAoC,CAAC;CAC7E,OAAO,EAAE,OAAO,CAAC,CAAC,KAAK,EAAE,aAAa,sCAAsC,CAAC;CAC7E,YAAY,EAAE,OAAO,CAAC,CAAC,KAAK,EAAE,aAAa,+CAA+C,CAAC;CAC3F,WAAW,EAAE,OAAO,CAAC,CAAC,KAAK,EAAE,aAAa,gCAAgC,CAAC;AAC/E,CAAC;AAED,IAAa,YAAY,EACpB,MAAM,CACH,EAAE,OAAO,CAAC,CAAC,KAAK,EAAE,aAAa,oDAAoD,CAAC,GACpF,WAAW,OAAO,EAAE,MAAM,WAAW,QAAQ,CAAC,CAAC,SAAS,EAAE,CAAC,CAC/D,CAAC,CAAC,CACD,KAA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,CAAC,CAAC,CAAC,CACjF,SAAS,CAAC,CACV,KAAK,EACF,aACI,wFACR,CAAC;CACL,WAAW,EACN,YAAY;EACT,SAAS,YAAY,SAAS;EAC9B,aAAa,YAAY,SAAS;EAClC,OAAO,YAAY,SAAS;CAChC,CAAC,CAAC,CACD,SAAS,CAAC,CACV,KAAK,EACF,aACI,iGACR,CAAC;CACL,OAAO,EAAE,MAAM,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EACtC,aAAa,2DACjB,CAAC;AACL;AAEA,IAAa,QAAQ,EAChB,YAAY,UAAU,CAAC,CACvB,KAAK,EAAE,aAAa,2DAA2D,CAAC;AAErF,IAAa,kBAAkB,EAC1B,YAAY;CACT,GAAG;CACH,QAAQ,WAAW,OAAO,SAAS;CACnC,aAAa,EAAE,KAAK;EAAC;EAAS;EAAQ;CAAM,CAAC,CAAC,CAAC,SAAS;CACxD,SAAS,EAAE,KAAK;EAAC;EAAW;EAAe;EAAS;CAAM,CAAC,CAAC,CAAC,SAAS;CACtE,SAAS,EACJ,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CACxC,SAAS,CAAC,CACV,KAAK,EACF,aACI,4GACR,CAAC;AACT,CAAC,CAAC,CACD,KAAK,EAAE,aAAa,+DAA+D,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { Theme } from './schemas/theme';
2
+ /** A theme to merge: `tokens` can be left out, as in the theme of a definition. */
3
+ export type PartialTheme = Partial<Theme>;
4
+ /**
5
+ * Merges themes, in order: each one overrides the tokens, palette colors, tones and variants of
6
+ * those before it. A token a theme sets in `tokens` but not in `dark` applies to both schemes, so it
7
+ * also replaces the dark value of earlier themes. Variants merge token by token; tones are replaced
8
+ * whole; densities merge token by token; fonts add up. The label is the last one set. `defineTheme()` of `@panneau/ui` merges the same way.
9
+ */
10
+ export declare function mergeThemes(...themes: readonly PartialTheme[]): Theme;
11
+ //# sourceMappingURL=themes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../src/themes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAE7C,mFAAmF;AACnF,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;AAmE1C;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,GAAG,MAAM,EAAE,SAAS,YAAY,EAAE,GAAG,KAAK,CAgCrE"}