origam 2.27.0 → 2.29.1

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.
Files changed (40) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/dist/src/assets/css/main.css +1 -1
  3. package/dist/src/assets/css/tokens/dark.css +2 -0
  4. package/dist/src/assets/css/tokens/light.css +1 -0
  5. package/dist/src/assets/scss/tokens/_dark.scss +2 -0
  6. package/dist/src/assets/scss/tokens/_light.scss +1 -0
  7. package/dist/src/components/Btn/OrigamBtn.vue +53 -14
  8. package/dist/src/components/Chart/OrigamChartCartesian.vue +1 -1
  9. package/dist/src/components/Chart/OrigamChartPolar.vue +1 -1
  10. package/dist/src/components/Chip/OrigamChip.vue +1 -1
  11. package/dist/src/components/Code/OrigamCode.vue +0 -2
  12. package/dist/src/composables/Commons/style.composable.cjs +14 -1
  13. package/dist/src/composables/Commons/style.composable.d.ts +0 -14
  14. package/dist/src/composables/Commons/style.composable.js +13 -2
  15. package/dist/src/composables/Commons/styleTag.composable.cjs +10 -4
  16. package/dist/src/composables/Commons/styleTag.composable.js +11 -5
  17. package/dist/src/consts/Commons/ssr-style.const.cjs +8 -0
  18. package/dist/src/consts/Commons/ssr-style.const.d.ts +19 -0
  19. package/dist/src/consts/Commons/ssr-style.const.js +2 -0
  20. package/dist/src/consts/index.cjs +11 -0
  21. package/dist/src/consts/index.d.ts +1 -0
  22. package/dist/src/consts/index.js +1 -0
  23. package/dist/src/directives/Contrast/contrast.directive.cjs +58 -6
  24. package/dist/src/directives/Contrast/contrast.directive.d.ts +10 -0
  25. package/dist/src/directives/Contrast/contrast.directive.js +61 -9
  26. package/dist/src/interfaces/Btn/btn.interface.d.ts +1 -0
  27. package/dist/src/interfaces/Commons/commons.interface.d.ts +14 -0
  28. package/dist/src/interfaces/Commons/style.interface.d.ts +21 -0
  29. package/dist/src/nuxt/plugin.server.cjs +18 -0
  30. package/dist/src/nuxt/plugin.server.js +9 -0
  31. package/dist/src/origam.cjs +3 -0
  32. package/dist/src/origam.js +5 -1
  33. package/dist/src/types/tokens.type.d.ts +1 -1
  34. package/dist/src/utils/Commons/ssr-styles.util.cjs +41 -0
  35. package/dist/src/utils/Commons/ssr-styles.util.d.ts +6 -0
  36. package/dist/src/utils/Commons/ssr-styles.util.js +26 -0
  37. package/dist/src/utils/index.cjs +11 -0
  38. package/dist/src/utils/index.d.ts +1 -0
  39. package/dist/src/utils/index.js +1 -0
  40. package/package.json +1 -1
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createSsrStyleCollector = createSsrStyleCollector;
7
+ exports.getSsrStyles = getSsrStyles;
8
+ exports.registerSsrStyleCollector = registerSsrStyleCollector;
9
+ exports.renderSsrStyles = renderSsrStyles;
10
+ const collectors = /* @__PURE__ */new WeakMap();
11
+ function escapeStyleText(css) {
12
+ return css.replace(/<\/(style)/gi, "<\\/$1");
13
+ }
14
+ function createSsrStyleCollector() {
15
+ const getters = /* @__PURE__ */new Map();
16
+ return {
17
+ add(id, css) {
18
+ getters.set(id, css);
19
+ },
20
+ entries() {
21
+ return [...getters].map(([id, css]) => ({
22
+ id,
23
+ css: escapeStyleText(css())
24
+ }));
25
+ }
26
+ };
27
+ }
28
+ function registerSsrStyleCollector(app) {
29
+ const collector = createSsrStyleCollector();
30
+ collectors.set(app, collector);
31
+ return collector;
32
+ }
33
+ function getSsrStyles(app) {
34
+ return collectors.get(app)?.entries() ?? [];
35
+ }
36
+ function renderSsrStyles(app) {
37
+ return getSsrStyles(app).map(({
38
+ id,
39
+ css
40
+ }) => `<style id="${id}">${css}</style>`).join("");
41
+ }
@@ -0,0 +1,6 @@
1
+ import type { App } from 'vue';
2
+ import type { ISsrStyleCollector, ISsrStyleEntry } from '../../interfaces/Commons/style.interface';
3
+ export declare function createSsrStyleCollector(): ISsrStyleCollector;
4
+ export declare function registerSsrStyleCollector(app: App): ISsrStyleCollector;
5
+ export declare function getSsrStyles(app: App): ISsrStyleEntry[];
6
+ export declare function renderSsrStyles(app: App): string;
@@ -0,0 +1,26 @@
1
+ const collectors = /* @__PURE__ */ new WeakMap();
2
+ function escapeStyleText(css) {
3
+ return css.replace(/<\/(style)/gi, "<\\/$1");
4
+ }
5
+ export function createSsrStyleCollector() {
6
+ const getters = /* @__PURE__ */ new Map();
7
+ return {
8
+ add(id, css) {
9
+ getters.set(id, css);
10
+ },
11
+ entries() {
12
+ return [...getters].map(([id, css]) => ({ id, css: escapeStyleText(css()) }));
13
+ }
14
+ };
15
+ }
16
+ export function registerSsrStyleCollector(app) {
17
+ const collector = createSsrStyleCollector();
18
+ collectors.set(app, collector);
19
+ return collector;
20
+ }
21
+ export function getSsrStyles(app) {
22
+ return collectors.get(app)?.entries() ?? [];
23
+ }
24
+ export function renderSsrStyles(app) {
25
+ return getSsrStyles(app).map(({ id, css }) => `<style id="${id}">${css}</style>`).join("");
26
+ }
@@ -157,6 +157,17 @@ Object.keys(_getCurrentInstance).forEach(function (key) {
157
157
  }
158
158
  });
159
159
  });
160
+ var _ssrStyles = require("./Commons/ssr-styles.util.cjs");
161
+ Object.keys(_ssrStyles).forEach(function (key) {
162
+ if (key === "default" || key === "__esModule") return;
163
+ if (key in exports && exports[key] === _ssrStyles[key]) return;
164
+ Object.defineProperty(exports, key, {
165
+ enumerable: true,
166
+ get: function () {
167
+ return _ssrStyles[key];
168
+ }
169
+ });
170
+ });
160
171
  var _layout = require("./Commons/layout.util.cjs");
161
172
  Object.keys(_layout).forEach(function (key) {
162
173
  if (key === "default" || key === "__esModule") return;
@@ -12,6 +12,7 @@ export * from './Commons/css-support.util';
12
12
  export * from './Commons/date.util';
13
13
  export * from './Commons/elevation.util';
14
14
  export * from './Commons/getCurrentInstance.util';
15
+ export * from './Commons/ssr-styles.util';
15
16
  export * from './Commons/layout.util';
16
17
  export * from './Commons/locale.util';
17
18
  export * from './Commons/nested.util';
@@ -12,6 +12,7 @@ export * from "./Commons/css-support.util.js";
12
12
  export * from "./Commons/date.util.js";
13
13
  export * from "./Commons/elevation.util.js";
14
14
  export * from "./Commons/getCurrentInstance.util.js";
15
+ export * from "./Commons/ssr-styles.util.js";
15
16
  export * from "./Commons/layout.util.js";
16
17
  export * from "./Commons/locale.util.js";
17
18
  export * from "./Commons/nested.util.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "origam",
3
- "version": "2.27.0",
3
+ "version": "2.29.1",
4
4
  "type": "module",
5
5
  "description": "origam — a Vue 3 design system with multi-theme design tokens, CSS-first components and TypeScript types.",
6
6
  "keywords": [