@shell-shock/plugin-theme 0.3.30 → 0.4.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.
@@ -1,6 +1,7 @@
1
1
  import { mergeThemes } from "../helpers/merge.mjs";
2
2
  import { isSetObject } from "@stryke/type-checks/is-set-object";
3
3
  import { isSetString } from "@stryke/type-checks/is-set-string";
4
+ import { camelCase } from "@stryke/string-format/camel-case";
4
5
 
5
6
  //#region src/style-dictionary/colors.ts
6
7
  /**
@@ -24,7 +25,8 @@ const colors = (context) => ({
24
25
  header: {},
25
26
  footer: {},
26
27
  description: {}
27
- }
28
+ },
29
+ tags: { $default: "#FFFFFF" }
28
30
  },
29
31
  border: {
30
32
  banner: {
@@ -187,7 +189,8 @@ const colors = (context) => ({
187
189
  info: colors,
188
190
  warning: colors
189
191
  }
190
- }
192
+ },
193
+ tags: { $default: colors }
191
194
  },
192
195
  border: {
193
196
  banner: {
@@ -393,7 +396,8 @@ const colors = (context) => ({
393
396
  info: text,
394
397
  warning: text
395
398
  }
396
- }
399
+ },
400
+ tags: { $default: text }
397
401
  };
398
402
  else if (isSetObject(text)) {
399
403
  resolvedConfig.colors.text.banner ??= {};
@@ -861,6 +865,12 @@ const colors = (context) => ({
861
865
  if (isSetString(spinner.message.warning)) resolvedConfig.colors.text.spinner.message.warning = spinner.message.warning;
862
866
  }
863
867
  }
868
+ resolvedConfig.colors.text.tags ??= { $default: "#FFFFFF" };
869
+ const tags = text.tags;
870
+ if (isSetString(tags)) resolvedConfig.colors.text.tags = { $default: tags };
871
+ else if (isSetObject(tags)) {
872
+ for (const [tag, value] of Object.entries(tags)) if (isSetString(value)) resolvedConfig.colors.text.tags[camelCase(tag)] = value;
873
+ }
864
874
  }
865
875
  resolvedConfig.colors.border ??= {
866
876
  banner: {