@genexus/mercury 0.8.11 → 0.9.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.
@@ -1,7 +1,7 @@
1
1
  import { GxImageMultiState, NavigationListItemModel, TreeViewImagePathCallback } from "@genexus/chameleon-controls-library";
2
2
  import { RegistryGetImagePathCallback } from "@genexus/chameleon-controls-library/dist/types/index";
3
3
  export { MercuryBundleBase, MercuryBundleComponent, MercuryBundleComponentForm, MercuryBundleFull, MercuryBundleOptimized, MercuryBundleReset, MercuryBundleUtil, MercuryBundleUtilFormFull, MercuryBundles } from "./bundles.js";
4
- export { getThemeBundles } from "./bundles.js";
4
+ export { getThemeBundles, getBundles } from "./bundles.js";
5
5
  export type AssetsMetadata = {
6
6
  category: string;
7
7
  name: string;
@@ -1,5 +1,5 @@
1
1
  import { MERCURY_ASSETS } from "./assets/MERCURY_ASSETS.js";
2
- export { getThemeBundles } from "./bundles.js";
2
+ export { getThemeBundles, getBundles } from "./bundles.js";
3
3
  const ASSETS_BY_VENDOR = {};
4
4
  const ALIAS_TO_VENDOR_NAME = {};
5
5
  const SEPARATOR = "/";
package/dist/bundles.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { ThemeModel } from "@genexus/chameleon-controls-library";
1
2
  export type MercuryBundles = [MercuryBundleReset, ...MercuryBundleOptimized[]] | [MercuryBundleReset, ...MercuryBundleFull[]];
2
3
  export type MercuryBundleOptimized = MercuryBundleComponent | MercuryBundleComponentForm | MercuryBundleUtil;
3
4
  export type MercuryBundleFull = MercuryBundleComponent | MercuryBundleUtil | MercuryBundleUtilFormFull;
@@ -257,4 +258,33 @@ export declare const getThemeBundles: (basePath: string) => [{
257
258
  readonly url: `${string}chameleon/scrollbar.css`;
258
259
  readonly attachStyleSheet: boolean;
259
260
  }];
261
+ /**
262
+ * Given the bundles array and the basePath (optional), returns the given
263
+ * bundles in the format of type `ThemeModel`.
264
+ *
265
+ * This is useful for defining the following in a dialog:
266
+ *
267
+ * ```tsx
268
+ * const CSS_BUNDLES: ThemeModel = getBundles(
269
+ * [
270
+ * "components/accordion",
271
+ * "components/button",
272
+ * "components/checkbox",
273
+ * "components/combo-box",
274
+ * "components/edit",
275
+ * "components/tree-view",
276
+ * "utils/form",
277
+ * "utils/layout",
278
+ * ],
279
+ * "./assets/css/"
280
+ * );
281
+ *
282
+ * HTML/render/template:
283
+ * <Host>
284
+ * <ch-theme model={CSS_BUNDLES}></ch-theme>
285
+ * ...
286
+ * </Host>
287
+ * ```
288
+ */
289
+ export declare const getBundles: (bundles: MercuryBundleOptimized[] | MercuryBundleFull[], basePath?: string) => ThemeModel;
260
290
  export {};
package/dist/bundles.js CHANGED
@@ -58,3 +58,34 @@ export const getThemeBundles = (basePath) => [
58
58
  getThemeModelItem(basePath, "utils/typography"),
59
59
  getThemeModelItem(basePath, "chameleon/scrollbar")
60
60
  ];
61
+ /**
62
+ * Given the bundles array and the basePath (optional), returns the given
63
+ * bundles in the format of type `ThemeModel`.
64
+ *
65
+ * This is useful for defining the following in a dialog:
66
+ *
67
+ * ```tsx
68
+ * const CSS_BUNDLES: ThemeModel = getBundles(
69
+ * [
70
+ * "components/accordion",
71
+ * "components/button",
72
+ * "components/checkbox",
73
+ * "components/combo-box",
74
+ * "components/edit",
75
+ * "components/tree-view",
76
+ * "utils/form",
77
+ * "utils/layout",
78
+ * ],
79
+ * "./assets/css/"
80
+ * );
81
+ *
82
+ * HTML/render/template:
83
+ * <Host>
84
+ * <ch-theme model={CSS_BUNDLES}></ch-theme>
85
+ * ...
86
+ * </Host>
87
+ * ```
88
+ */
89
+ export const getBundles = (bundles, basePath) => basePath
90
+ ? bundles.map(bundle => getThemeModelItem(basePath, bundle))
91
+ : bundles;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@genexus/mercury",
3
- "version": "0.8.11",
3
+ "version": "0.9.0",
4
4
  "description": "Mercury is the design system designed for GeneXus IDE Web and GeneXus Next",
5
5
  "main": "dist/mercury.scss",
6
6
  "module": "dist/assets-manager.js",