@pure-ds/core 0.3.0
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.
- package/CSS-INTELLISENSE-LIMITATION.md +98 -0
- package/CSS-INTELLISENSE-QUICK-REF.md +238 -0
- package/INTELLISENSE.md +384 -0
- package/LICENSE +15 -0
- package/custom-elements-manifest.config.js +30 -0
- package/custom-elements.json +2003 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/packages/pds-configurator/src/figma-export.d.ts +13 -0
- package/dist/types/packages/pds-configurator/src/figma-export.d.ts.map +1 -0
- package/dist/types/packages/pds-configurator/src/pds-config-form.d.ts +2 -0
- package/dist/types/packages/pds-configurator/src/pds-config-form.d.ts.map +1 -0
- package/dist/types/packages/pds-configurator/src/pds-configurator.d.ts +2 -0
- package/dist/types/packages/pds-configurator/src/pds-configurator.d.ts.map +1 -0
- package/dist/types/packages/pds-configurator/src/pds-demo.d.ts +2 -0
- package/dist/types/packages/pds-configurator/src/pds-demo.d.ts.map +1 -0
- package/dist/types/pds.config.d.ts +13 -0
- package/dist/types/pds.config.d.ts.map +1 -0
- package/dist/types/pds.d.ts +408 -0
- package/dist/types/public/assets/js/app.d.ts +2 -0
- package/dist/types/public/assets/js/app.d.ts.map +1 -0
- package/dist/types/public/assets/js/pds.d.ts +23 -0
- package/dist/types/public/assets/js/pds.d.ts.map +1 -0
- package/dist/types/public/assets/pds/components/pds-calendar.d.ts +23 -0
- package/dist/types/public/assets/pds/components/pds-calendar.d.ts.map +1 -0
- package/dist/types/public/assets/pds/components/pds-drawer.d.ts +2 -0
- package/dist/types/public/assets/pds/components/pds-drawer.d.ts.map +1 -0
- package/dist/types/public/assets/pds/components/pds-icon.d.ts +53 -0
- package/dist/types/public/assets/pds/components/pds-icon.d.ts.map +1 -0
- package/dist/types/public/assets/pds/components/pds-jsonform.d.ts +104 -0
- package/dist/types/public/assets/pds/components/pds-jsonform.d.ts.map +1 -0
- package/dist/types/public/assets/pds/components/pds-richtext.d.ts +121 -0
- package/dist/types/public/assets/pds/components/pds-richtext.d.ts.map +1 -0
- package/dist/types/public/assets/pds/components/pds-scrollrow.d.ts +61 -0
- package/dist/types/public/assets/pds/components/pds-scrollrow.d.ts.map +1 -0
- package/dist/types/public/assets/pds/components/pds-splitpanel.d.ts +1 -0
- package/dist/types/public/assets/pds/components/pds-splitpanel.d.ts.map +1 -0
- package/dist/types/public/assets/pds/components/pds-tabstrip.d.ts +39 -0
- package/dist/types/public/assets/pds/components/pds-tabstrip.d.ts.map +1 -0
- package/dist/types/public/assets/pds/components/pds-toaster.d.ts +111 -0
- package/dist/types/public/assets/pds/components/pds-toaster.d.ts.map +1 -0
- package/dist/types/public/assets/pds/components/pds-upload.d.ts +83 -0
- package/dist/types/public/assets/pds/components/pds-upload.d.ts.map +1 -0
- package/dist/types/src/js/app.d.ts +2 -0
- package/dist/types/src/js/app.d.ts.map +1 -0
- package/dist/types/src/js/common/ask.d.ts +22 -0
- package/dist/types/src/js/common/ask.d.ts.map +1 -0
- package/dist/types/src/js/common/common.d.ts +3 -0
- package/dist/types/src/js/common/common.d.ts.map +1 -0
- package/dist/types/src/js/common/font-loader.d.ts +24 -0
- package/dist/types/src/js/common/font-loader.d.ts.map +1 -0
- package/dist/types/src/js/common/msg.d.ts +3 -0
- package/dist/types/src/js/common/msg.d.ts.map +1 -0
- package/dist/types/src/js/lit.d.ts +25 -0
- package/dist/types/src/js/lit.d.ts.map +1 -0
- package/dist/types/src/js/pds-configurator/figma-export.d.ts +13 -0
- package/dist/types/src/js/pds-configurator/figma-export.d.ts.map +1 -0
- package/dist/types/src/js/pds-configurator/pds-config-form.d.ts +2 -0
- package/dist/types/src/js/pds-configurator/pds-config-form.d.ts.map +1 -0
- package/dist/types/src/js/pds-configurator/pds-configurator.d.ts +2 -0
- package/dist/types/src/js/pds-configurator/pds-configurator.d.ts.map +1 -0
- package/dist/types/src/js/pds-configurator/pds-demo.d.ts +2 -0
- package/dist/types/src/js/pds-configurator/pds-demo.d.ts.map +1 -0
- package/dist/types/src/js/pds-core/pds-config.d.ts +758 -0
- package/dist/types/src/js/pds-core/pds-config.d.ts.map +1 -0
- package/dist/types/src/js/pds-core/pds-enhancer-metadata.d.ts +6 -0
- package/dist/types/src/js/pds-core/pds-enhancer-metadata.d.ts.map +1 -0
- package/dist/types/src/js/pds-core/pds-enhancers.d.ts +14 -0
- package/dist/types/src/js/pds-core/pds-enhancers.d.ts.map +1 -0
- package/dist/types/src/js/pds-core/pds-enums.d.ts +87 -0
- package/dist/types/src/js/pds-core/pds-enums.d.ts.map +1 -0
- package/dist/types/src/js/pds-core/pds-generator.d.ts +741 -0
- package/dist/types/src/js/pds-core/pds-generator.d.ts.map +1 -0
- package/dist/types/src/js/pds-core/pds-ontology.d.ts +48 -0
- package/dist/types/src/js/pds-core/pds-ontology.d.ts.map +1 -0
- package/dist/types/src/js/pds-core/pds-paths.d.ts +37 -0
- package/dist/types/src/js/pds-core/pds-paths.d.ts.map +1 -0
- package/dist/types/src/js/pds-core/pds-query.d.ts +102 -0
- package/dist/types/src/js/pds-core/pds-query.d.ts.map +1 -0
- package/dist/types/src/js/pds-core/pds-registry.d.ts +40 -0
- package/dist/types/src/js/pds-core/pds-registry.d.ts.map +1 -0
- package/dist/types/src/js/pds.d.ts +109 -0
- package/dist/types/src/js/pds.d.ts.map +1 -0
- package/dist/types/src/pds-core/pds-api.d.ts +31 -0
- package/dist/types/src/pds-core/pds-api.d.ts.map +1 -0
- package/package.json +104 -0
- package/packages/pds-cli/README.md +15 -0
- package/packages/pds-cli/bin/generate-css-data.js +565 -0
- package/packages/pds-cli/bin/generate-manifest.js +352 -0
- package/packages/pds-cli/bin/pds-build-icons.js +152 -0
- package/packages/pds-cli/bin/pds-dx.js +114 -0
- package/packages/pds-cli/bin/pds-static.js +556 -0
- package/packages/pds-cli/bin/pds.js +127 -0
- package/packages/pds-cli/bin/postinstall.js +380 -0
- package/packages/pds-cli/bin/sync-assets.js +252 -0
- package/packages/pds-cli/lib/asset-roots.js +47 -0
- package/packages/pds-cli/lib/fs-writer.js +75 -0
- package/pds.css-data.json +5 -0
- package/pds.html-data.json +5 -0
- package/public/assets/js/app.js +5719 -0
- package/public/assets/js/lit.js +131 -0
- package/public/assets/js/pds.js +3423 -0
- package/public/assets/pds/components/pds-calendar.js +837 -0
- package/public/assets/pds/components/pds-drawer.js +857 -0
- package/public/assets/pds/components/pds-icon.js +338 -0
- package/public/assets/pds/components/pds-jsonform.js +1775 -0
- package/public/assets/pds/components/pds-richtext.js +1035 -0
- package/public/assets/pds/components/pds-scrollrow.js +331 -0
- package/public/assets/pds/components/pds-splitpanel.js +401 -0
- package/public/assets/pds/components/pds-tabstrip.js +251 -0
- package/public/assets/pds/components/pds-toaster.js +446 -0
- package/public/assets/pds/components/pds-upload.js +657 -0
- package/public/assets/pds/custom-elements.json +2003 -0
- package/public/assets/pds/icons/pds-icons.svg +498 -0
- package/public/assets/pds/pds-css-complete.json +1861 -0
- package/public/assets/pds/pds.css-data.json +2152 -0
- package/public/assets/pds/vscode-custom-data.json +824 -0
- package/readme.md +1870 -0
- package/src/js/pds-core/pds-config.js +1162 -0
- package/src/js/pds-core/pds-enhancer-metadata.js +75 -0
- package/src/js/pds-core/pds-enhancers.js +357 -0
- package/src/js/pds-core/pds-enums.js +86 -0
- package/src/js/pds-core/pds-generator.js +5317 -0
- package/src/js/pds-core/pds-ontology.js +256 -0
- package/src/js/pds-core/pds-paths.js +109 -0
- package/src/js/pds-core/pds-query.js +571 -0
- package/src/js/pds-core/pds-registry.js +129 -0
- package/src/js/pds-core/pds.d.ts +129 -0
- package/src/js/pds.d.ts +408 -0
- package/src/js/pds.js +1579 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pds-generator.d.ts","sourceRoot":"","sources":["../../../../../src/js/pds-core/pds-generator.js"],"names":[],"mappings":"AAslKA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,4CAjBW,UAAU,qBACV,aAAa,EAAE,GACb,OAAO,CAAC,IAAI,CAAC,CAqCzB;AAED;;;;;;;;GAQG;AACH,wCALW,UAAU,WACV,MAAM,EAAE,qBACR,aAAa,EAAE,GACb,OAAO,CAAC,IAAI,CAAC,CAiCzB;AAED;;;;;;GAMG;AACH,sCAHW,MAAM,GACJ,aAAa,CAMzB;AAED;;;;;GAKG;AACH,8BAFa,OAAO,CAInB;AAlsKD;;;GAGG;AACH;IAo/JE;;;;OAIG;IACH,8BAFW,SAAS,QAgCnB;IAED;;;;OAIG;IACH,gDA6CC;IArkKD,0BAyCC;IAxCC;;MAIC;IASD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAmC;IA6BrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAgBC;IAycD;;;;OAIG;IACH,kDAyBC;IA0ED;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA6DC;IAw4GD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAEC;IAGD,oBAEC;IAkrBD,qBAEC;IACD,yBAEC;IACD,yBAEC;IACD,wBAEC;IACD,yBAMC;IAED;;;;;;OAMG;IACH,oBA6JC;IAGD,4BAEC;IACD,gCAEC;IACD,gCAEC;IACD,+BAEC;IAmBD;;;OAGG;IACH;;;;;;MAoBC;;CA2GF"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export function findComponentForElement(startEl: any, { maxDepth }?: {
|
|
2
|
+
maxDepth?: number;
|
|
3
|
+
}): {
|
|
4
|
+
element: any;
|
|
5
|
+
componentType: string;
|
|
6
|
+
displayName: any;
|
|
7
|
+
};
|
|
8
|
+
export function getAllSelectors(): any[];
|
|
9
|
+
export namespace ontology {
|
|
10
|
+
namespace meta {
|
|
11
|
+
let name: string;
|
|
12
|
+
let version: string;
|
|
13
|
+
}
|
|
14
|
+
namespace tokens {
|
|
15
|
+
let colors: string[];
|
|
16
|
+
let spacing: string[];
|
|
17
|
+
let typography: string[];
|
|
18
|
+
let themes: string[];
|
|
19
|
+
}
|
|
20
|
+
let primitives: {
|
|
21
|
+
id: string;
|
|
22
|
+
name: string;
|
|
23
|
+
selectors: string[];
|
|
24
|
+
}[];
|
|
25
|
+
let components: {
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
selectors: string[];
|
|
29
|
+
}[];
|
|
30
|
+
let layoutPatterns: {
|
|
31
|
+
id: string;
|
|
32
|
+
name: string;
|
|
33
|
+
selectors: string[];
|
|
34
|
+
description: string;
|
|
35
|
+
}[];
|
|
36
|
+
let utilities: string[];
|
|
37
|
+
namespace styles {
|
|
38
|
+
let typography_1: string[];
|
|
39
|
+
export { typography_1 as typography };
|
|
40
|
+
export namespace icons {
|
|
41
|
+
let source: string;
|
|
42
|
+
let sets: string[];
|
|
43
|
+
}
|
|
44
|
+
export let interactive: string[];
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export default ontology;
|
|
48
|
+
//# sourceMappingURL=pds-ontology.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pds-ontology.d.ts","sourceRoot":"","sources":["../../../../../src/js/pds-core/pds-ontology.js"],"names":[],"mappings":"AA8FA;;;;;;EAwJC;AAED,yCAKC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve the public asset root URL for PDS static assets based on the consumer config.
|
|
3
|
+
* Falls back to "/assets/pds/" when no root is provided. Automatically appends the
|
|
4
|
+
* "pds" segment when the provided root omits it.
|
|
5
|
+
*
|
|
6
|
+
* @param {object} config - Unified PDS configuration.
|
|
7
|
+
* @param {{ defaultRoot?: string, segment?: string }} [options]
|
|
8
|
+
* @returns {string} Normalized URL (always ends with a trailing slash).
|
|
9
|
+
*/
|
|
10
|
+
export function resolvePublicAssetURL(config: object, options?: {
|
|
11
|
+
defaultRoot?: string;
|
|
12
|
+
segment?: string;
|
|
13
|
+
}): string;
|
|
14
|
+
/**
|
|
15
|
+
* Extract the raw public root candidate from config for reuse in Node-side helpers.
|
|
16
|
+
* @param {object} config
|
|
17
|
+
* @returns {string|null}
|
|
18
|
+
*/
|
|
19
|
+
export function getPublicRootCandidate(config: object): string | null;
|
|
20
|
+
export namespace __internal {
|
|
21
|
+
export { ensureTrailingSlash };
|
|
22
|
+
export { appendSegmentIfMissing };
|
|
23
|
+
export { stripLeadingDotSlash };
|
|
24
|
+
export { stripDriveLetter };
|
|
25
|
+
export { stripPublicPrefix };
|
|
26
|
+
export { URL_PATTERN };
|
|
27
|
+
export { DEFAULT_SEGMENT };
|
|
28
|
+
}
|
|
29
|
+
declare function ensureTrailingSlash(value?: string): string;
|
|
30
|
+
declare function appendSegmentIfMissing(input?: string, segment?: string): string;
|
|
31
|
+
declare function stripLeadingDotSlash(value: any): any;
|
|
32
|
+
declare function stripDriveLetter(value: any): any;
|
|
33
|
+
declare function stripPublicPrefix(value: any): any;
|
|
34
|
+
declare const URL_PATTERN: RegExp;
|
|
35
|
+
declare const DEFAULT_SEGMENT: "pds";
|
|
36
|
+
export {};
|
|
37
|
+
//# sourceMappingURL=pds-paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pds-paths.d.ts","sourceRoot":"","sources":["../../../../../src/js/pds-core/pds-paths.js"],"names":[],"mappings":"AAmCA;;;;;;;;GAQG;AACH,8CAJW,MAAM,YACN;IAAE,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GACxC,MAAM,CA6ClB;AAED;;;;GAIG;AACH,+CAHW,MAAM,GACJ,MAAM,GAAC,IAAI,CAMvB;;;;;;;;;;AA9FD,6DAEC;AAED,kFAOC;AAED,uDAEC;AAED,mDAKC;AAED,oDAKC;AAhCD,kCAAmD;AADnD,+BAAwB,KAAK,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PDSQuery - Smart query engine for the Pure Design System
|
|
3
|
+
*
|
|
4
|
+
* Interprets natural language questions and maps them to PDS runtime data
|
|
5
|
+
* structures (tokens, components, utilities, patterns) using keyword matching,
|
|
6
|
+
* intent detection, and semantic scoring.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* const query = new PDSQuery(PDS);
|
|
10
|
+
* const results = await query.search("what is the focus border color on inputs?");
|
|
11
|
+
* // Returns array of scored results with text, value, icon, category
|
|
12
|
+
*/
|
|
13
|
+
export class PDSQuery {
|
|
14
|
+
constructor(pds: any);
|
|
15
|
+
pds: any;
|
|
16
|
+
intents: {
|
|
17
|
+
color: string[];
|
|
18
|
+
spacing: string[];
|
|
19
|
+
typography: string[];
|
|
20
|
+
border: string[];
|
|
21
|
+
radius: string[];
|
|
22
|
+
shadow: string[];
|
|
23
|
+
component: string[];
|
|
24
|
+
utility: string[];
|
|
25
|
+
layout: string[];
|
|
26
|
+
pattern: string[];
|
|
27
|
+
interaction: string[];
|
|
28
|
+
};
|
|
29
|
+
entities: {
|
|
30
|
+
button: string[];
|
|
31
|
+
input: string[];
|
|
32
|
+
card: string[];
|
|
33
|
+
badge: string[];
|
|
34
|
+
surface: string[];
|
|
35
|
+
icon: string[];
|
|
36
|
+
link: string[];
|
|
37
|
+
nav: string[];
|
|
38
|
+
modal: string[];
|
|
39
|
+
drawer: string[];
|
|
40
|
+
tab: string[];
|
|
41
|
+
toast: string[];
|
|
42
|
+
};
|
|
43
|
+
questionWords: string[];
|
|
44
|
+
/**
|
|
45
|
+
* Main search entry point
|
|
46
|
+
* @param {string} query - Natural language question
|
|
47
|
+
* @returns {Promise<Array>} Array of results with text, value, icon, category, score
|
|
48
|
+
*/
|
|
49
|
+
search(query: string): Promise<any[]>;
|
|
50
|
+
/**
|
|
51
|
+
* Tokenize and normalize query string
|
|
52
|
+
*/
|
|
53
|
+
tokenize(text: any): any;
|
|
54
|
+
/**
|
|
55
|
+
* Analyze query to extract intents and entities
|
|
56
|
+
*/
|
|
57
|
+
analyzeQuery(tokens: any, fullText: any): {
|
|
58
|
+
intents: Set<any>;
|
|
59
|
+
entities: Set<any>;
|
|
60
|
+
modifiers: Set<any>;
|
|
61
|
+
isQuestion: boolean;
|
|
62
|
+
tokens: any;
|
|
63
|
+
fullText: any;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Query color tokens and surfaces
|
|
67
|
+
*/
|
|
68
|
+
queryColors(context: any, query: any): any[];
|
|
69
|
+
/**
|
|
70
|
+
* Query utility classes
|
|
71
|
+
*/
|
|
72
|
+
queryUtilities(context: any, query: any): any[];
|
|
73
|
+
/**
|
|
74
|
+
* Query components
|
|
75
|
+
*/
|
|
76
|
+
queryComponents(context: any, query: any): any[];
|
|
77
|
+
/**
|
|
78
|
+
* Query layout patterns
|
|
79
|
+
*/
|
|
80
|
+
queryPatterns(context: any, query: any): any[];
|
|
81
|
+
/**
|
|
82
|
+
* Query typography tokens
|
|
83
|
+
*/
|
|
84
|
+
queryTypography(context: any, query: any): any[];
|
|
85
|
+
/**
|
|
86
|
+
* Query spacing tokens
|
|
87
|
+
*/
|
|
88
|
+
querySpacing(context: any, query: any): any[];
|
|
89
|
+
/**
|
|
90
|
+
* Calculate match score between query and target text
|
|
91
|
+
*/
|
|
92
|
+
scoreMatch(query: any, target: any): number;
|
|
93
|
+
/**
|
|
94
|
+
* Generate example code for a primitive
|
|
95
|
+
*/
|
|
96
|
+
generatePrimitiveExample(primitive: any): string;
|
|
97
|
+
/**
|
|
98
|
+
* Describe utility class purpose
|
|
99
|
+
*/
|
|
100
|
+
describeUtility(utilClass: any): "Apply animated gradient border effect" | "Apply glowing border effect" | "Flexbox container utility" | "Grid container utility" | "Set gap between flex/grid children" | "Align items in flex container" | "Justify content in flex container" | "Group buttons with connected styling" | "Utility class for styling";
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=pds-query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pds-query.d.ts","sourceRoot":"","sources":["../../../../../src/js/pds-core/pds-query.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;IACE,sBAoCC;IAnCC,SAAc;IAGd;;;;;;;;;;;;MAYC;IAGD;;;;;;;;;;;;;MAaC;IAGD,wBAAqG;IAGvG;;;;OAIG;IACH,cAHW,MAAM,GACJ,OAAO,OAAO,CA0D1B;IAED;;OAEG;IACH,yBAKC;IAED;;OAEG;IACH;;;;;;;MAkCC;IAED;;OAEG;IACH,6CA0FC;IAED;;OAEG;IACH,gDAiEC;IAED;;OAEG;IACH,iDAyDC;IAED;;OAEG;IACH,+CA8CC;IAED;;OAEG;IACH,iDAiCC;IAED;;OAEG;IACH,8CAwBC;IAED;;OAEG;IACH,4CAsBC;IAED;;OAEG;IACH,iDAcC;IAED;;OAEG;IACH,wVAWC;CACF"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export const registry: PDSRegistry;
|
|
2
|
+
declare class PDSRegistry {
|
|
3
|
+
_mode: string;
|
|
4
|
+
_designer: any;
|
|
5
|
+
_staticPaths: {
|
|
6
|
+
tokens: string;
|
|
7
|
+
primitives: string;
|
|
8
|
+
components: string;
|
|
9
|
+
utilities: string;
|
|
10
|
+
styles: string;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Set the designer instance and switch to live mode
|
|
14
|
+
*/
|
|
15
|
+
setDesigner(designer: any, meta?: {}): void;
|
|
16
|
+
/**
|
|
17
|
+
* Switch to static mode with custom paths
|
|
18
|
+
* Called by consumers who want to use static CSS files
|
|
19
|
+
*/
|
|
20
|
+
setStaticMode(paths?: {}): void;
|
|
21
|
+
/**
|
|
22
|
+
* Get stylesheet for adoption in shadow DOM
|
|
23
|
+
* Returns CSSStyleSheet object (constructable stylesheet)
|
|
24
|
+
*/
|
|
25
|
+
getStylesheet(layer: any): Promise<any>;
|
|
26
|
+
/**
|
|
27
|
+
* Get current mode
|
|
28
|
+
*/
|
|
29
|
+
get mode(): string;
|
|
30
|
+
/**
|
|
31
|
+
* Check if in live mode
|
|
32
|
+
*/
|
|
33
|
+
get isLive(): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Check if designer is available
|
|
36
|
+
*/
|
|
37
|
+
get hasDesigner(): boolean;
|
|
38
|
+
}
|
|
39
|
+
export {};
|
|
40
|
+
//# sourceMappingURL=pds-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pds-registry.d.ts","sourceRoot":"","sources":["../../../../../src/js/pds-core/pds-registry.js"],"names":[],"mappings":"AAgIA,mCAA0C;AA3H1C;IAEI,cAAqB;IACrB,eAAqB;IACrB;;;;;;MAMC;IAGH;;OAEG;IACH,4CASC;IAED;;;OAGG;IACH,gCAKC;IAED;;;OAGG;IACH,wCAgCC;IA0BD;;OAEG;IACH,mBAEC;IAED;;OAEG;IACH,sBAEC;IAED;;OAEG;IACH,2BAEC;CACF"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public PDS runtime object exported to consumers.
|
|
3
|
+
*
|
|
4
|
+
* This object exposes the core runtime building blocks for the Pure Design System.
|
|
5
|
+
* It intentionally provides a small, stable surface area so consuming apps can:
|
|
6
|
+
* - programmatically generate design system artifacts (via `Generator`),
|
|
7
|
+
* - adopt styles into Shadow DOM (via `adoptLayers` / `adoptPrimitives`),
|
|
8
|
+
* - query runtime mode and obtain constructable stylesheets (via `registry`).
|
|
9
|
+
*
|
|
10
|
+
* Common events in the PDS ecosystem (emitted by other packages/components):
|
|
11
|
+
* - `design-updated` — emitted by the designer component when the in-memory design changes (detail: { config }).
|
|
12
|
+
* - `pds-generated` — emitted by the PDS configurator when generation completes (detail: { modules, meta }).
|
|
13
|
+
* - `pds-error` — emitted by the PDS configurator when generation fails (detail: Error).
|
|
14
|
+
*
|
|
15
|
+
* Error handling notes:
|
|
16
|
+
* - Methods that perform dynamic imports (e.g. `adoptLayers` via the registry) may log and return fallbacks
|
|
17
|
+
* rather than throwing; consumers should check return values (e.g. null) and listen for `pds-error` in UI flows.
|
|
18
|
+
* - `createStylesheet(css)` will throw synchronously if the provided CSS cannot be parsed by the browser's
|
|
19
|
+
* `CSSStyleSheet.replaceSync()` — callers should guard invalid input or wrap calls in try/catch.
|
|
20
|
+
*/
|
|
21
|
+
export type PDSAPI = {
|
|
22
|
+
/**
|
|
23
|
+
* - Generator class to produce design system assets
|
|
24
|
+
*/
|
|
25
|
+
Generator: typeof import("./pds-core/pds-generator.js").Generator;
|
|
26
|
+
/**
|
|
27
|
+
* - Singleton runtime registry for live/static mode
|
|
28
|
+
*/
|
|
29
|
+
registry: import("./pds-core/pds-registry.js").PDSRegistry;
|
|
30
|
+
/**
|
|
31
|
+
* - Ontology helpers and metadata for components
|
|
32
|
+
*/
|
|
33
|
+
ontology: any;
|
|
34
|
+
/**
|
|
35
|
+
* - Adopt multiple layers into a ShadowRoot. May log errors and fallback to additionalSheets when static imports fail.
|
|
36
|
+
*/
|
|
37
|
+
adoptLayers: (shadowRoot: ShadowRoot, layers?: string[], additionalSheets?: CSSStyleSheet[]) => Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* - Adopt primitives layer into a ShadowRoot. Designed as a convenience for components.
|
|
40
|
+
*/
|
|
41
|
+
adoptPrimitives: (shadowRoot: ShadowRoot, additionalSheets?: CSSStyleSheet[]) => Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* - Create a constructable stylesheet from CSS text.
|
|
44
|
+
*/
|
|
45
|
+
createStylesheet: (css: string) => CSSStyleSheet;
|
|
46
|
+
};
|
|
47
|
+
/** @type {PDSAPI & PDSBase} */
|
|
48
|
+
export const PDS: PDSAPI & PDSBase;
|
|
49
|
+
/**
|
|
50
|
+
* Validate a design configuration for accessibility sanity checks.
|
|
51
|
+
* Currently validates color contrast for primary buttons and base surface text
|
|
52
|
+
* in both light and dark themes.
|
|
53
|
+
*
|
|
54
|
+
* @param {object} designConfig - A full or partial PDS config object
|
|
55
|
+
* @param {object} [options]
|
|
56
|
+
* @param {number} [options.minContrast=4.5] - Minimum contrast ratio for normal text
|
|
57
|
+
* @returns {{ ok: boolean, issues: Array<{path:string, message:string, ratio:number, min:number, context?:string}> }}
|
|
58
|
+
*/
|
|
59
|
+
export function validateDesign(designConfig?: object, options?: {
|
|
60
|
+
minContrast?: number;
|
|
61
|
+
}): {
|
|
62
|
+
ok: boolean;
|
|
63
|
+
issues: Array<{
|
|
64
|
+
path: string;
|
|
65
|
+
message: string;
|
|
66
|
+
ratio: number;
|
|
67
|
+
min: number;
|
|
68
|
+
context?: string;
|
|
69
|
+
}>;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Public PDS runtime object exported to consumers.
|
|
73
|
+
*
|
|
74
|
+
* This object exposes the core runtime building blocks for the Pure Design System.
|
|
75
|
+
* It intentionally provides a small, stable surface area so consuming apps can:
|
|
76
|
+
* - programmatically generate design system artifacts (via `Generator`),
|
|
77
|
+
* - adopt styles into Shadow DOM (via `adoptLayers` / `adoptPrimitives`),
|
|
78
|
+
* - query runtime mode and obtain constructable stylesheets (via `registry`).
|
|
79
|
+
*
|
|
80
|
+
* Common events in the PDS ecosystem (emitted by other packages/components):
|
|
81
|
+
* - `design-updated` — emitted by the designer component when the in-memory design changes (detail: { config }).
|
|
82
|
+
* - `pds-generated` — emitted by the PDS configurator when generation completes (detail: { modules, meta }).
|
|
83
|
+
* - `pds-error` — emitted by the PDS configurator when generation fails (detail: Error).
|
|
84
|
+
*
|
|
85
|
+
* Error handling notes:
|
|
86
|
+
* - Methods that perform dynamic imports (e.g. `adoptLayers` via the registry) may log and return fallbacks
|
|
87
|
+
* rather than throwing; consumers should check return values (e.g. null) and listen for `pds-error` in UI flows.
|
|
88
|
+
* - `createStylesheet(css)` will throw synchronously if the provided CSS cannot be parsed by the browser's
|
|
89
|
+
* `CSSStyleSheet.replaceSync()` — callers should guard invalid input or wrap calls in try/catch.
|
|
90
|
+
*
|
|
91
|
+
* @typedef {Object} PDSAPI
|
|
92
|
+
* @property {typeof import("./pds-core/pds-generator.js").Generator} Generator - Generator class to produce design system assets
|
|
93
|
+
* @property {import("./pds-core/pds-registry.js").PDSRegistry} registry - Singleton runtime registry for live/static mode
|
|
94
|
+
* @property {any} ontology - Ontology helpers and metadata for components
|
|
95
|
+
* @property {(shadowRoot: ShadowRoot, layers?: string[], additionalSheets?: CSSStyleSheet[]) => Promise<void>} adoptLayers - Adopt multiple layers into a ShadowRoot. May log errors and fallback to additionalSheets when static imports fail.
|
|
96
|
+
* @property {(shadowRoot: ShadowRoot, additionalSheets?: CSSStyleSheet[]) => Promise<void>} adoptPrimitives - Adopt primitives layer into a ShadowRoot. Designed as a convenience for components.
|
|
97
|
+
* @property {(css:string) => CSSStyleSheet} createStylesheet - Create a constructable stylesheet from CSS text. @throws {DOMException} on invalid CSS in some browsers.
|
|
98
|
+
* @property {() => boolean} isLiveMode - Returns true when running in live/designer-backed mode
|
|
99
|
+
* @property {(el: Element) => import("./pds-core/pds-ontology.js").ComponentDef | null} findComponentForElement - Helper to find a component definition for a DOM element
|
|
100
|
+
*/
|
|
101
|
+
/**
|
|
102
|
+
* Workspace for the Pure Design System runtime API
|
|
103
|
+
* PDS is now an EventTarget so consumers can subscribe to a single, consistent
|
|
104
|
+
* event bus instead of listening on window/document or individual elements.
|
|
105
|
+
*/
|
|
106
|
+
declare class PDSBase extends EventTarget {
|
|
107
|
+
}
|
|
108
|
+
export {};
|
|
109
|
+
//# sourceMappingURL=pds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pds.d.ts","sourceRoot":"","sources":["../../../../src/js/pds.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;eAuBc,cAAc,6BAA6B,EAAE,SAAS;;;;cACtD,OAAO,4BAA4B,EAAE,WAAW;;;;cAChD,GAAG;;;;iBACH,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE,gBAAgB,CAAC,EAAE,aAAa,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC;;;;qBAChG,CAAC,UAAU,EAAE,UAAU,EAAE,gBAAgB,CAAC,EAAE,aAAa,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC;;;;sBAC7E,CAAC,GAAG,EAAC,MAAM,KAAK,aAAa;;AAW3C,+BAA+B;AAC/B,kBADW,MAAM,GAAG,OAAO,CACD;AAyR1B;;;;;;;;;GASG;AACH,8CALW,MAAM,YAEd;IAAyB,WAAW,GAA5B,MAAM;CACd,GAAU;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,KAAK,CAAC;QAAC,IAAI,EAAC,MAAM,CAAC;QAAC,OAAO,EAAC,MAAM,CAAC;QAAC,KAAK,EAAC,MAAM,CAAC;QAAC,GAAG,EAAC,MAAM,CAAC;QAAC,OAAO,CAAC,EAAC,MAAM,CAAA;KAAC,CAAC,CAAA;CAAE,CAyIpH;AAhdD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH;;;;GAIG;AACH;CAAoC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generate modules map and metadata from a config object.
|
|
3
|
+
* @param {object} config
|
|
4
|
+
* @param {object} [opts]
|
|
5
|
+
* @returns {Promise<{modules: Record<string,string>, meta: object}>}
|
|
6
|
+
*/
|
|
7
|
+
export function generate(config: object, opts?: object): Promise<{
|
|
8
|
+
modules: Record<string, string>;
|
|
9
|
+
meta: object;
|
|
10
|
+
}>;
|
|
11
|
+
/**
|
|
12
|
+
* Read config from file and generate modules.
|
|
13
|
+
* @param {string} configPath
|
|
14
|
+
* @param {object} [opts]
|
|
15
|
+
*/
|
|
16
|
+
export function generateFromFile(configPath: string, opts?: object): Promise<{
|
|
17
|
+
modules: Record<string, string>;
|
|
18
|
+
meta: object;
|
|
19
|
+
}>;
|
|
20
|
+
/**
|
|
21
|
+
* Watch a config file and call the writer on changes.
|
|
22
|
+
* @param {string} configPath
|
|
23
|
+
* @param {string} outDir
|
|
24
|
+
* @param {{onWrite?:Function}} opts
|
|
25
|
+
*/
|
|
26
|
+
export function watch(configPath: string, outDir: string, opts?: {
|
|
27
|
+
onWrite?: Function;
|
|
28
|
+
}): {
|
|
29
|
+
close(): void;
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=pds-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pds-api.d.ts","sourceRoot":"","sources":["../../../../src/pds-core/pds-api.js"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,iCAJW,MAAM,SACN,MAAM,GACJ,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAC,MAAM,CAAC,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,CAAC,CAgCnE;AAiBD;;;;GAIG;AACH,6CAHW,MAAM,SACN,MAAM;aApDc,MAAM,CAAC,MAAM,EAAC,MAAM,CAAC;UAAQ,MAAM;GA+DjE;AAED;;;;;GAKG;AACH,kCAJW,MAAM,UACN,MAAM,SACN;IAAC,OAAO,CAAC,WAAS;CAAC;;EA0B7B"}
|
package/package.json
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pure-ds/core",
|
|
3
|
+
"shortname": "pds",
|
|
4
|
+
"version": "0.3.0",
|
|
5
|
+
"description": "Pure Design System - Why develop a Design System when you can generate one?",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/Pure-Web-Foundation/pure-ds.git"
|
|
9
|
+
},
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/Pure-Web-Foundation/pure-ds/issues"
|
|
12
|
+
},
|
|
13
|
+
"homepage": "https://puredesignsystem.z6.web.core.windows.net/",
|
|
14
|
+
"keywords": [
|
|
15
|
+
"design-system",
|
|
16
|
+
"css",
|
|
17
|
+
"web-components",
|
|
18
|
+
"lit",
|
|
19
|
+
"constructable-stylesheets",
|
|
20
|
+
"tokens",
|
|
21
|
+
"utilities",
|
|
22
|
+
"a11y"
|
|
23
|
+
],
|
|
24
|
+
"type": "module",
|
|
25
|
+
"main": "./public/assets/js/pds.js",
|
|
26
|
+
"module": "./public/assets/js/pds.js",
|
|
27
|
+
"types": "./dist/types/pds.d.ts",
|
|
28
|
+
"bin": {
|
|
29
|
+
"pds-export": "packages/pds-cli/bin/pds-static.js",
|
|
30
|
+
"pds-sync-assets": "packages/pds-cli/bin/sync-assets.js",
|
|
31
|
+
"pds-build-icons": "packages/pds-cli/bin/pds-build-icons.js"
|
|
32
|
+
},
|
|
33
|
+
"exports": {
|
|
34
|
+
".": {
|
|
35
|
+
"types": "./src/js/pds.d.ts",
|
|
36
|
+
"import": "./public/assets/js/pds.js"
|
|
37
|
+
},
|
|
38
|
+
"./pds-core": "./src/js/pds.js",
|
|
39
|
+
"./pds-configurator": "./src/js/pds-configurator/pds-configurator.js",
|
|
40
|
+
"./auto-define/*": "./public/auto-define/*"
|
|
41
|
+
},
|
|
42
|
+
"files": [
|
|
43
|
+
"dist/types/",
|
|
44
|
+
"public/assets/js/",
|
|
45
|
+
"public/assets/pds/components/",
|
|
46
|
+
"public/assets/pds/vscode-custom-data.json",
|
|
47
|
+
"public/assets/pds/pds.css-data.json",
|
|
48
|
+
"public/assets/pds/pds-css-complete.json",
|
|
49
|
+
"public/auto-define/",
|
|
50
|
+
"public/pds/components/",
|
|
51
|
+
"public/assets/pds/icons/pds-icons.svg",
|
|
52
|
+
"packages/pds-cli/bin/",
|
|
53
|
+
"packages/pds-cli/lib/",
|
|
54
|
+
"src/js/pds.d.ts",
|
|
55
|
+
"src/js/pds.js",
|
|
56
|
+
"src/js/pds-core/",
|
|
57
|
+
"src/js/pds-configurator/",
|
|
58
|
+
"custom-elements.json",
|
|
59
|
+
"custom-elements-manifest.config.js",
|
|
60
|
+
"pds.html-data.json",
|
|
61
|
+
"pds.css-data.json",
|
|
62
|
+
"readme.md",
|
|
63
|
+
"INTELLISENSE.md",
|
|
64
|
+
"CSS-INTELLISENSE-LIMITATION.md",
|
|
65
|
+
"CSS-INTELLISENSE-QUICK-REF.md"
|
|
66
|
+
],
|
|
67
|
+
"scripts": {
|
|
68
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
69
|
+
"dev": "node esbuild-dev.js",
|
|
70
|
+
"prebuild": "npm run types",
|
|
71
|
+
"build": "node esbuild-build.js",
|
|
72
|
+
"types": "tsc -p tsconfig.json && node scripts/sync-types.mjs",
|
|
73
|
+
"postinstall": "node packages/pds-cli/bin/postinstall.js",
|
|
74
|
+
"prepds:export": "npm run types",
|
|
75
|
+
"pds:export": "node packages/pds-cli/bin/pds-static.js",
|
|
76
|
+
"pds:build-icons": "node packages/pds-cli/bin/pds-build-icons.js",
|
|
77
|
+
"pds:manifest": "node packages/pds-cli/bin/generate-manifest.js",
|
|
78
|
+
"pds:css-data": "node packages/pds-cli/bin/generate-css-data.js",
|
|
79
|
+
"pds:dx": "node packages/pds-cli/bin/pds-dx.js",
|
|
80
|
+
"storybook:generate": "cd packages/pds-storybook && npm run generate-stories",
|
|
81
|
+
"storybook:dev": "cd packages/pds-storybook && npm run storybook:dev",
|
|
82
|
+
"storybook:build": "cd packages/pds-storybook && npm run storybook:build"
|
|
83
|
+
},
|
|
84
|
+
"author": "Marc van Neerven",
|
|
85
|
+
"license": "ISC",
|
|
86
|
+
"engines": {
|
|
87
|
+
"node": ">=18"
|
|
88
|
+
},
|
|
89
|
+
"publishConfig": {
|
|
90
|
+
"access": "public"
|
|
91
|
+
},
|
|
92
|
+
"devDependencies": {
|
|
93
|
+
"@custom-elements-manifest/analyzer": "^0.9.9",
|
|
94
|
+
"esbuild": "^0.19.0",
|
|
95
|
+
"fs-extra": "^11.1.1",
|
|
96
|
+
"typescript": "^5.6.3",
|
|
97
|
+
"@types/node": "^22.10.2"
|
|
98
|
+
},
|
|
99
|
+
"dependencies": {
|
|
100
|
+
"lit": "^3.3.1",
|
|
101
|
+
"pure-web": "1.1.30"
|
|
102
|
+
},
|
|
103
|
+
"customElements": "custom-elements.json"
|
|
104
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# PDS CLI
|
|
2
|
+
|
|
3
|
+
Minimal CLI to generate PDS artifacts and optionally watch a config file.
|
|
4
|
+
|
|
5
|
+
Commands:
|
|
6
|
+
|
|
7
|
+
- `pds-cli generate --config ./pds.config.js --out ./public/pds`
|
|
8
|
+
- `pds-cli watch --config ./pds.config.js --out ./public/pds`
|
|
9
|
+
|
|
10
|
+
Notes:
|
|
11
|
+
|
|
12
|
+
- The `--config` can be a JS/JSON file resolving to your PDS configuration.
|
|
13
|
+
- Output includes constructable stylesheet modules (pds-*.css.js) and plain CSS files.
|
|
14
|
+
|
|
15
|
+
This CLI is intentionally tiny and uses the repository's `pds-api` and `fs-writer` utilities.
|