@ganpatiinfo/gids-core-web 0.0.2 → 0.0.4

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.
@@ -6,7 +6,24 @@
6
6
  "kind": "javascript-module",
7
7
  "path": "src/index.ts",
8
8
  "declarations": [],
9
- "exports": []
9
+ "exports": [
10
+ {
11
+ "kind": "js",
12
+ "name": "*",
13
+ "declaration": {
14
+ "name": "*",
15
+ "package": "./utils/constructedGidsStylesheet"
16
+ }
17
+ },
18
+ {
19
+ "kind": "js",
20
+ "name": "*",
21
+ "declaration": {
22
+ "name": "*",
23
+ "package": "./components.d.ts"
24
+ }
25
+ }
26
+ ]
10
27
  },
11
28
  {
12
29
  "kind": "javascript-module",
@@ -0,0 +1,39 @@
1
+ body {
2
+ margin: 0;
3
+ background-color: var(--gids-color-background-canvas);
4
+ color: var(--gids-color-text-default);
5
+ font-family: var(--gids-typography-paragraph-medium__font-family);
6
+ font-size: var(--gids-typography-paragraph-medium__font-size);
7
+ font-weight: var(--gids-typography-paragraph-medium__font-weight);
8
+ letter-spacing: var(--gids-typography-paragraph-medium__letter-spacing);
9
+ line-height: var(--gids-typography-paragraph-medium__line-height);
10
+ text-transform: var(--gids-typography-paragraph-medium__text-transform, inherit);
11
+ font-variant: var(--gids-typography-paragraph-medium__font-variant-caps, inherit);
12
+ }
13
+
14
+ h2 {
15
+ margin: 0;
16
+ }
17
+
18
+ a {
19
+ --gidsIcon-color: currentColor;
20
+ display: inline-flex;
21
+ align-items: center;
22
+ gap: var(--gids-gap-025);
23
+ color: var(--gids-color-link-default);
24
+ }
25
+ a:visited {
26
+ color: var(--gids-color-link-visited-default);
27
+ }
28
+ a:active {
29
+ color: var(--gids-color-link-pressed);
30
+ }
31
+ a::before {
32
+ display: inline;
33
+ content: "";
34
+ height: 1em;
35
+ height: 1cap;
36
+ line-height: 1;
37
+ }
38
+
39
+ /*# sourceMappingURL=elements.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sourceRoot":"","sources":["../src/styles/4-elements/body.scss","../src/styles/2-tools/typography.scss","../src/styles/4-elements/headings.scss","../src/styles/2-tools/links.scss"],"names":[],"mappings":"AAEA;EACC;EACA;EACA;ECFA;EACA;EACA;EACA;EACA;EAGC;EAGD;;;ACbD;EACC;;;ACDD;EACC;EAEA;EACA;EACA;EACA;;AAEA;EACC;;AAGD;EACC;;AAGD;EACC;EACA;EACA;EACA;EACA","file":"elements.css"}
package/dist/index.css CHANGED
@@ -1,7 +1,145 @@
1
+ /*
2
+ * Start styles - any styles need to be below this
3
+ */
1
4
  gids-global-styles-start {
2
5
  --x: 0;
3
6
  }
4
7
 
8
+ /*
9
+ * Custom styles
10
+ */
11
+ .gids-divider {
12
+ border: none;
13
+ border-top: var(--gids-border-width-thin) solid var(--gids-color-border-default);
14
+ margin: 0;
15
+ }
16
+ .gids-divider--vertical {
17
+ border: none;
18
+ border-left: var(--gids-border-width-thin) solid var(--gids-color-border-default);
19
+ display: inline-block;
20
+ height: 100%;
21
+ width: var(--gids-border-width-thin);
22
+ }
23
+
24
+ .gids-display-tag {
25
+ color: var(--gids-color-text-inverse);
26
+ display: inline-flex;
27
+ flex-shrink: 0;
28
+ justify-content: center;
29
+ align-content: center;
30
+ align-items: center;
31
+ border-style: solid;
32
+ border-radius: var(--gids-border-radius-sm);
33
+ border-width: var(--gids-border-width-thin);
34
+ padding: 0 calc(var(--gids-padding-horizontal-edge-to-element-100) - var(--gids-border-width-thin));
35
+ min-height: var(--gids-size-320);
36
+ gap: var(--gids-gap-100);
37
+ font-family: var(--gids-typography-label-medium__font-family);
38
+ font-size: var(--gids-typography-label-medium__font-size);
39
+ font-weight: var(--gids-typography-label-medium__font-weight);
40
+ letter-spacing: var(--gids-typography-label-medium__letter-spacing);
41
+ line-height: var(--gids-typography-label-medium__line-height);
42
+ text-transform: var(--gids-typography-label-medium__text-transform, inherit);
43
+ font-variant: var(--gids-typography-label-medium__font-variant-caps, inherit);
44
+ }
45
+ .gids-display-tag .gids-icon {
46
+ --gidsIcon-color: currentColor;
47
+ --gidsIcon-height: var(--gids-size-240);
48
+ }
49
+ .gids-display-tag--xsmall {
50
+ font-family: var(--gids-typography-label-x-small__font-family);
51
+ font-size: var(--gids-typography-label-x-small__font-size);
52
+ font-weight: var(--gids-typography-label-x-small__font-weight);
53
+ letter-spacing: var(--gids-typography-label-x-small__letter-spacing);
54
+ line-height: var(--gids-typography-label-x-small__line-height);
55
+ text-transform: var(--gids-typography-label-x-small__text-transform, inherit);
56
+ font-variant: var(--gids-typography-label-x-small__font-variant-caps, inherit);
57
+ padding: 0 calc(var(--gids-padding-horizontal-edge-to-element-050) - var(--gids-border-width-thin));
58
+ min-height: var(--gids-size-200);
59
+ gap: var(--gids-gap-050);
60
+ }
61
+ .gids-display-tag--xsmall .gids-icon {
62
+ --gidsIcon-height: var(--gids-size-120);
63
+ }
64
+ .gids-display-tag--small {
65
+ font-family: var(--gids-typography-label-small__font-family);
66
+ font-size: var(--gids-typography-label-small__font-size);
67
+ font-weight: var(--gids-typography-label-small__font-weight);
68
+ letter-spacing: var(--gids-typography-label-small__letter-spacing);
69
+ line-height: var(--gids-typography-label-small__line-height);
70
+ text-transform: var(--gids-typography-label-small__text-transform, inherit);
71
+ font-variant: var(--gids-typography-label-small__font-variant-caps, inherit);
72
+ padding: 0 calc(var(--gids-padding-horizontal-edge-to-element-100) - var(--gids-border-width-thin));
73
+ min-height: var(--gids-size-240);
74
+ gap: var(--gids-gap-100);
75
+ }
76
+ .gids-display-tag--small .gids-icon {
77
+ --gidsIcon-height: var(--gids-size-160);
78
+ }
79
+ .gids-display-tag--large {
80
+ font-family: var(--gids-typography-label-large__font-family);
81
+ font-size: var(--gids-typography-label-large__font-size);
82
+ font-weight: var(--gids-typography-label-large__font-weight);
83
+ letter-spacing: var(--gids-typography-label-large__letter-spacing);
84
+ line-height: var(--gids-typography-label-large__line-height);
85
+ text-transform: var(--gids-typography-label-large__text-transform, inherit);
86
+ font-variant: var(--gids-typography-label-large__font-variant-caps, inherit);
87
+ padding: 0 calc(var(--gids-padding-horizontal-edge-to-element-150) - var(--gids-border-width-thin));
88
+ min-height: var(--gids-size-400);
89
+ gap: var(--gids-gap-150);
90
+ }
91
+ .gids-display-tag--large .gids-icon {
92
+ --gidsIcon-height: var(--gids-size-240);
93
+ }
94
+ .gids-display-tag--accent-1 {
95
+ color: var(--gids-color-text-accent-1);
96
+ border-color: var(--gids-color-border-accent-1);
97
+ background-color: var(--gids-color-background-accent-1-subtlest-default);
98
+ }
99
+ .gids-display-tag--accent-2 {
100
+ color: var(--gids-color-text-accent-2);
101
+ border-color: var(--gids-color-border-accent-2);
102
+ background-color: var(--gids-color-background-accent-2-subtlest-default);
103
+ }
104
+ .gids-display-tag--accent-3 {
105
+ color: var(--gids-color-text-accent-3);
106
+ border-color: var(--gids-color-border-accent-3);
107
+ background-color: var(--gids-color-background-accent-3-subtlest-default);
108
+ }
109
+ .gids-display-tag--accent-4 {
110
+ color: var(--gids-color-text-accent-4);
111
+ border-color: var(--gids-color-border-accent-4);
112
+ background-color: var(--gids-color-background-accent-4-subtlest-default);
113
+ }
114
+ .gids-display-tag--accent-5 {
115
+ color: var(--gids-color-text-accent-5);
116
+ border-color: var(--gids-color-border-accent-5);
117
+ background-color: var(--gids-color-background-accent-5-subtlest-default);
118
+ }
119
+ .gids-display-tag--bold-accent-1 {
120
+ border-color: var(--gids-color-border-accent-1);
121
+ background-color: var(--gids-color-background-accent-1-bolder-default);
122
+ }
123
+ .gids-display-tag--bold-accent-2 {
124
+ border-color: var(--gids-color-border-accent-2);
125
+ background-color: var(--gids-color-background-accent-2-bolder-default);
126
+ }
127
+ .gids-display-tag--bold-accent-3 {
128
+ border-color: var(--gids-color-border-accent-3);
129
+ background-color: var(--gids-color-background-accent-3-bolder-default);
130
+ }
131
+ .gids-display-tag--bold-accent-4 {
132
+ border-color: var(--gids-color-border-accent-4);
133
+ background-color: var(--gids-color-background-accent-4-bolder-default);
134
+ }
135
+ .gids-display-tag--bold-accent-5 {
136
+ border-color: var(--gids-color-border-accent-5);
137
+ background-color: var(--gids-color-background-accent-5-bolder-default);
138
+ }
139
+
140
+ /*
141
+ * End styles - any styles need to be above this
142
+ */
5
143
  gids-global-styles-end {
6
144
  --x: 0;
7
145
  }
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["../src/styles/start.scss","../src/styles/end.scss"],"names":[],"mappings":"AAAA;EACC;;;ACDD;EACC","file":"index.css"}
1
+ {"version":3,"sourceRoot":"","sources":["../src/index.scss","../src/styles/start.scss","../src/components/html/GidsDivider/GidsDivider.scss","../src/components/html/GidsDisplayTag/GidsDisplayTag.scss","../src/styles/2-tools/tags.scss","../src/styles/2-tools/typography.scss","../src/styles/end.scss"],"names":[],"mappings":"AAAA;AAAA;AAAA;ACAA;EACC;;;ADID;AAAA;AAAA;AELA;EACC;EACA;EAEA;;AAEA;EACC;EACA;EAEA;EACA;EACA;;;ACTF;EACC;ECAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EAKA;EACA;EChBA;EACA;EACA;EACA;EACA;EAGC;EAGD;;ADUA;EACC;EACA;;AAGD;ECzBA;EACA;EACA;EACA;EACA;EAGC;EAGD;EDiBC;EAKA;EACA;;AACA;EACC;;AAIF;ECvCA;EACA;EACA;EACA;EACA;EAGC;EAGD;ED+BC;EAKA;EACA;;AACA;EACC;;AAIF;ECrDA;EACA;EACA;EACA;EACA;EAGC;EAGD;ED6CC;EAKA;EACA;;AACA;EACC;;AD3DF;EACC;EACA;EACA;;AAGD;EACC;EACA;EACA;;AAGD;EACC;EACA;EACA;;AAGD;EACC;EACA;EACA;;AAGD;EACC;EACA;EACA;;AAGD;EACC;EACA;;AAGD;EACC;EACA;;AAGD;EACC;EACA;;AAGD;EACC;EACA;;AAGD;EACC;EACA;;;AHhDF;AAAA;AAAA;AMXA;EACC","file":"index.css"}
package/dist/index.js CHANGED
@@ -224,7 +224,112 @@ function render(vnode, container) {
224
224
  renderVdom(ref, vnode);
225
225
  }
226
226
 
227
- export { getAssetPath, render, setAssetPath, setNonce, setPlatformOptions };
227
+ const constructedStylesheet = globalThis.CSSStyleSheet !== undefined ? new CSSStyleSheet() : undefined;
228
+ let hasInitialRefreshBeenDone = false;
229
+ if (constructedStylesheet && document.adoptedStyleSheets) {
230
+ document.adoptedStyleSheets.push(constructedStylesheet);
231
+ }
232
+ else {
233
+ console.warn('CSSStyleSheet is not defined. Omitting constructed stylesheet behaviour.');
234
+ }
235
+ let lastDocumentStylesheetOwnerNode = null;
236
+ const handleStyleElementUpdates = () => {
237
+ refreshConstructedGidsStylesheet();
238
+ };
239
+ const styleChangeObserver = globalThis.MutationObserver !== undefined
240
+ ? new MutationObserver(handleStyleElementUpdates)
241
+ : undefined;
242
+ const toCssText = (stylesInfo) => {
243
+ return stylesInfo.rules.map((rule) => rule.cssText).join('');
244
+ };
245
+ const deleteGidsStyles = (stylesInfo) => {
246
+ const { rulesStartIndex, originalRulesCount, styleSheet } = stylesInfo;
247
+ for (let index = 0; index < originalRulesCount; index++) {
248
+ styleSheet.deleteRule(rulesStartIndex);
249
+ }
250
+ };
251
+ const getDocumentGidsStylesheet = () => {
252
+ if (constructedStylesheet === undefined) {
253
+ return;
254
+ }
255
+ const gidsCssRules = [];
256
+ for (let indexI = 0; indexI < document.styleSheets.length; indexI++) {
257
+ const styleSheet = document.styleSheets.item(indexI);
258
+ if (styleSheet) {
259
+ try {
260
+ let gidsRulesStartIndex = -1;
261
+ let gidsRulesCount = 0;
262
+ for (let indexJ = 0; indexJ < styleSheet.cssRules.length; indexJ++) {
263
+ const rule = styleSheet.cssRules.item(indexJ);
264
+ if (rule?.cssText.startsWith('gids-global-styles-start')) {
265
+ gidsRulesStartIndex = indexJ;
266
+ continue;
267
+ }
268
+ if (gidsRulesStartIndex > -1) {
269
+ if (rule?.cssText.startsWith('gids-global-styles-end')) {
270
+ gidsRulesCount = indexJ - gidsRulesStartIndex + 1;
271
+ break;
272
+ }
273
+ else {
274
+ // @ts-ignore
275
+ gidsCssRules.push(rule);
276
+ }
277
+ }
278
+ }
279
+ if (gidsRulesStartIndex > -1) {
280
+ return {
281
+ rulesStartIndex: gidsRulesStartIndex,
282
+ originalRulesCount: gidsRulesCount,
283
+ rules: gidsCssRules,
284
+ styleSheet,
285
+ };
286
+ }
287
+ }
288
+ catch (error) {
289
+ if (!(error instanceof DOMException)) {
290
+ throw error;
291
+ }
292
+ }
293
+ }
294
+ }
295
+ return undefined;
296
+ };
297
+ const refreshConstructedGidsStylesheet = () => {
298
+ if (constructedStylesheet === undefined) {
299
+ return false;
300
+ }
301
+ const stylesInfo = getDocumentGidsStylesheet();
302
+ if (stylesInfo !== undefined) {
303
+ const newOwnerNode = stylesInfo.styleSheet.ownerNode;
304
+ if (styleChangeObserver !== undefined &&
305
+ newOwnerNode !== lastDocumentStylesheetOwnerNode) {
306
+ if (lastDocumentStylesheetOwnerNode) {
307
+ styleChangeObserver.disconnect();
308
+ }
309
+ if (newOwnerNode instanceof Element) {
310
+ styleChangeObserver.observe(newOwnerNode, {
311
+ childList: true,
312
+ characterData: true,
313
+ subtree: true,
314
+ });
315
+ }
316
+ lastDocumentStylesheetOwnerNode = newOwnerNode;
317
+ }
318
+ constructedStylesheet.replaceSync(toCssText(stylesInfo));
319
+ deleteGidsStyles(stylesInfo);
320
+ return true;
321
+ }
322
+ console.warn('refreshConstructedGidsStylesheet: Gids stylesheet is not found in document.');
323
+ return false;
324
+ };
325
+ const getConstructedGidsStylesheet = () => {
326
+ if (!hasInitialRefreshBeenDone) {
327
+ hasInitialRefreshBeenDone = refreshConstructedGidsStylesheet();
328
+ }
329
+ return constructedStylesheet;
330
+ };
331
+
332
+ export { getAssetPath, getConstructedGidsStylesheet, refreshConstructedGidsStylesheet, render, setAssetPath, setNonce, setPlatformOptions };
228
333
  //# sourceMappingURL=index.js.map
229
334
 
230
335
  //# sourceMappingURL=index.js.map