@marwes-ui/core 1.2.0 → 1.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/dist/index.d.ts CHANGED
@@ -31,6 +31,13 @@ declare function resolveTone(tone: ToneName): ToneDefinition;
31
31
  type Density = "compact" | "comfortable" | "spacious";
32
32
  type HeadingSize = "h1" | "h2" | "h3";
33
33
  type ParagraphSize = "sm" | "md" | "lg";
34
+ type StatusColorTokens = {
35
+ background: string;
36
+ text: string;
37
+ icon: string;
38
+ border: string;
39
+ borderStrong: string;
40
+ };
34
41
  /**
35
42
  * Theme mode determines which default color palette is used.
36
43
  * - 'light': Uses light mode color defaults (dark text on light backgrounds)
@@ -62,10 +69,12 @@ type Theme = {
62
69
  textSubtle: string;
63
70
  textDisabled: string;
64
71
  textInverted: string;
72
+ textBrand: string;
65
73
  border: string;
66
74
  borderSubtle: string;
67
75
  borderStrong: string;
68
76
  borderDisabled: string;
77
+ borderBrand: string;
69
78
  /**
70
79
  * Focus color used for focus-visible outlines on interactive elements.
71
80
  * Defaults to the source focus ring token from docs/marwes-colors.json.
@@ -74,6 +83,12 @@ type Theme = {
74
83
  danger: string;
75
84
  success: string;
76
85
  warning: string;
86
+ status: {
87
+ success: StatusColorTokens;
88
+ warning: StatusColorTokens;
89
+ error: StatusColorTokens;
90
+ info: StatusColorTokens;
91
+ };
77
92
  };
78
93
  font: {
79
94
  primary: string;
@@ -194,11 +209,19 @@ interface ResolvedTheme {
194
209
  textSubtle: string;
195
210
  textDisabled: string;
196
211
  textInverted: string;
212
+ textBrand: string;
197
213
  border: string;
198
214
  borderSubtle: string;
199
215
  borderStrong: string;
200
216
  borderDisabled: string;
217
+ borderBrand: string;
201
218
  focus: string;
219
+ status: {
220
+ success: StatusColorTokens;
221
+ warning: StatusColorTokens;
222
+ error: StatusColorTokens;
223
+ info: StatusColorTokens;
224
+ };
202
225
  };
203
226
  font: {
204
227
  primary: string;
@@ -246,7 +269,7 @@ interface ResolvedTheme {
246
269
  }
247
270
  /**
248
271
  * Maps every field of a resolved theme to its CSS custom property name.
249
- * Returns 86 entries total. `variant` is excluded — it is deprecated.
272
+ * Returns 108 entries total. `variant` is excluded — it is deprecated.
250
273
  * Density is emitted as 10 `--mw-density-*` vars via densityToCSSVars.
251
274
  *
252
275
  * Variable naming follows D11: --mw-color-{role}-{state}, --mw-font-*, etc.
@@ -384,11 +407,43 @@ declare const mwThemeVarNames: {
384
407
  readonly textSubtle: "--mw-color-text-subtle";
385
408
  readonly textDisabled: "--mw-color-text-disabled";
386
409
  readonly textInverted: "--mw-color-text-inverted";
410
+ readonly textBrand: "--mw-color-text-brand";
387
411
  readonly border: "--mw-color-border";
388
412
  readonly borderSubtle: "--mw-color-border-subtle";
389
413
  readonly borderStrong: "--mw-color-border-strong";
390
414
  readonly borderDisabled: "--mw-color-border-disabled";
415
+ readonly borderBrand: "--mw-color-border-brand";
391
416
  readonly focus: "--mw-color-focus";
417
+ readonly status: {
418
+ readonly success: {
419
+ readonly background: "--mw-color-status-success-background";
420
+ readonly text: "--mw-color-status-success-text";
421
+ readonly icon: "--mw-color-status-success-icon";
422
+ readonly border: "--mw-color-status-success-border";
423
+ readonly borderStrong: "--mw-color-status-success-border-strong";
424
+ };
425
+ readonly warning: {
426
+ readonly background: "--mw-color-status-warning-background";
427
+ readonly text: "--mw-color-status-warning-text";
428
+ readonly icon: "--mw-color-status-warning-icon";
429
+ readonly border: "--mw-color-status-warning-border";
430
+ readonly borderStrong: "--mw-color-status-warning-border-strong";
431
+ };
432
+ readonly error: {
433
+ readonly background: "--mw-color-status-error-background";
434
+ readonly text: "--mw-color-status-error-text";
435
+ readonly icon: "--mw-color-status-error-icon";
436
+ readonly border: "--mw-color-status-error-border";
437
+ readonly borderStrong: "--mw-color-status-error-border-strong";
438
+ };
439
+ readonly info: {
440
+ readonly background: "--mw-color-status-info-background";
441
+ readonly text: "--mw-color-status-info-text";
442
+ readonly icon: "--mw-color-status-info-icon";
443
+ readonly border: "--mw-color-status-info-border";
444
+ readonly borderStrong: "--mw-color-status-info-border-strong";
445
+ };
446
+ };
392
447
  };
393
448
  readonly spacing: {
394
449
  readonly sp0: "--mw-spacing-sp-0";
@@ -532,11 +587,43 @@ declare const mwThemeVars: {
532
587
  readonly textSubtle: "var(--mw-color-text-subtle)";
533
588
  readonly textDisabled: "var(--mw-color-text-disabled)";
534
589
  readonly textInverted: "var(--mw-color-text-inverted)";
590
+ readonly textBrand: "var(--mw-color-text-brand)";
535
591
  readonly border: "var(--mw-color-border)";
536
592
  readonly borderSubtle: "var(--mw-color-border-subtle)";
537
593
  readonly borderStrong: "var(--mw-color-border-strong)";
538
594
  readonly borderDisabled: "var(--mw-color-border-disabled)";
595
+ readonly borderBrand: "var(--mw-color-border-brand)";
539
596
  readonly focus: "var(--mw-color-focus)";
597
+ readonly status: {
598
+ readonly success: {
599
+ readonly background: "var(--mw-color-status-success-background)";
600
+ readonly text: "var(--mw-color-status-success-text)";
601
+ readonly icon: "var(--mw-color-status-success-icon)";
602
+ readonly border: "var(--mw-color-status-success-border)";
603
+ readonly borderStrong: "var(--mw-color-status-success-border-strong)";
604
+ };
605
+ readonly warning: {
606
+ readonly background: "var(--mw-color-status-warning-background)";
607
+ readonly text: "var(--mw-color-status-warning-text)";
608
+ readonly icon: "var(--mw-color-status-warning-icon)";
609
+ readonly border: "var(--mw-color-status-warning-border)";
610
+ readonly borderStrong: "var(--mw-color-status-warning-border-strong)";
611
+ };
612
+ readonly error: {
613
+ readonly background: "var(--mw-color-status-error-background)";
614
+ readonly text: "var(--mw-color-status-error-text)";
615
+ readonly icon: "var(--mw-color-status-error-icon)";
616
+ readonly border: "var(--mw-color-status-error-border)";
617
+ readonly borderStrong: "var(--mw-color-status-error-border-strong)";
618
+ };
619
+ readonly info: {
620
+ readonly background: "var(--mw-color-status-info-background)";
621
+ readonly text: "var(--mw-color-status-info-text)";
622
+ readonly icon: "var(--mw-color-status-info-icon)";
623
+ readonly border: "var(--mw-color-status-info-border)";
624
+ readonly borderStrong: "var(--mw-color-status-info-border-strong)";
625
+ };
626
+ };
540
627
  };
541
628
  readonly spacing: {
542
629
  readonly sp0: "var(--mw-spacing-sp-0)";
@@ -680,11 +767,43 @@ declare const mwStyledTheme: {
680
767
  readonly textSubtle: "var(--mw-color-text-subtle)";
681
768
  readonly textDisabled: "var(--mw-color-text-disabled)";
682
769
  readonly textInverted: "var(--mw-color-text-inverted)";
770
+ readonly textBrand: "var(--mw-color-text-brand)";
683
771
  readonly border: "var(--mw-color-border)";
684
772
  readonly borderSubtle: "var(--mw-color-border-subtle)";
685
773
  readonly borderStrong: "var(--mw-color-border-strong)";
686
774
  readonly borderDisabled: "var(--mw-color-border-disabled)";
775
+ readonly borderBrand: "var(--mw-color-border-brand)";
687
776
  readonly focus: "var(--mw-color-focus)";
777
+ readonly status: {
778
+ readonly success: {
779
+ readonly background: "var(--mw-color-status-success-background)";
780
+ readonly text: "var(--mw-color-status-success-text)";
781
+ readonly icon: "var(--mw-color-status-success-icon)";
782
+ readonly border: "var(--mw-color-status-success-border)";
783
+ readonly borderStrong: "var(--mw-color-status-success-border-strong)";
784
+ };
785
+ readonly warning: {
786
+ readonly background: "var(--mw-color-status-warning-background)";
787
+ readonly text: "var(--mw-color-status-warning-text)";
788
+ readonly icon: "var(--mw-color-status-warning-icon)";
789
+ readonly border: "var(--mw-color-status-warning-border)";
790
+ readonly borderStrong: "var(--mw-color-status-warning-border-strong)";
791
+ };
792
+ readonly error: {
793
+ readonly background: "var(--mw-color-status-error-background)";
794
+ readonly text: "var(--mw-color-status-error-text)";
795
+ readonly icon: "var(--mw-color-status-error-icon)";
796
+ readonly border: "var(--mw-color-status-error-border)";
797
+ readonly borderStrong: "var(--mw-color-status-error-border-strong)";
798
+ };
799
+ readonly info: {
800
+ readonly background: "var(--mw-color-status-info-background)";
801
+ readonly text: "var(--mw-color-status-info-text)";
802
+ readonly icon: "var(--mw-color-status-info-icon)";
803
+ readonly border: "var(--mw-color-status-info-border)";
804
+ readonly borderStrong: "var(--mw-color-status-info-border-strong)";
805
+ };
806
+ };
688
807
  };
689
808
  readonly spacing: {
690
809
  readonly sp0: "var(--mw-spacing-sp-0)";
package/dist/index.js CHANGED
@@ -84,6 +84,15 @@ function colorRoleVars(role, cr) {
84
84
  [`--mw-color-${role}-label-disabled`]: cr.labelDisabled
85
85
  };
86
86
  }
87
+ function statusColorVars(role, tokens) {
88
+ return {
89
+ [`--mw-color-status-${role}-background`]: tokens.background,
90
+ [`--mw-color-status-${role}-text`]: tokens.text,
91
+ [`--mw-color-status-${role}-icon`]: tokens.icon,
92
+ [`--mw-color-status-${role}-border`]: tokens.border,
93
+ [`--mw-color-status-${role}-border-strong`]: tokens.borderStrong
94
+ };
95
+ }
87
96
  function themeToCSSVars(theme) {
88
97
  const { color, font, ui, typography } = theme;
89
98
  return {
@@ -109,11 +118,18 @@ function themeToCSSVars(theme) {
109
118
  "--mw-color-text-subtle": color.textSubtle,
110
119
  "--mw-color-text-disabled": color.textDisabled,
111
120
  "--mw-color-text-inverted": color.textInverted,
121
+ "--mw-color-text-brand": color.textBrand,
112
122
  "--mw-color-border": color.border,
113
123
  "--mw-color-border-subtle": color.borderSubtle,
114
124
  "--mw-color-border-strong": color.borderStrong,
115
125
  "--mw-color-border-disabled": color.borderDisabled,
126
+ "--mw-color-border-brand": color.borderBrand,
116
127
  "--mw-color-focus": color.focus,
128
+ // Status role tokens (4 × 5 = 20)
129
+ ...statusColorVars("success", color.status.success),
130
+ ...statusColorVars("warning", color.status.warning),
131
+ ...statusColorVars("error", color.status.error),
132
+ ...statusColorVars("info", color.status.info),
117
133
  // Font (3)
118
134
  "--mw-font-primary": font.primary,
119
135
  "--mw-font-secondary": font.secondary,
@@ -359,17 +375,49 @@ var lightThemeDefaults = {
359
375
  textSubtle: "#737373",
360
376
  textDisabled: "#737373",
361
377
  textInverted: "#FFFFFF",
378
+ textBrand: "#2F31FC",
362
379
  // Borders
363
380
  border: "#D8D8D8",
364
381
  borderSubtle: "#D8D8D8",
365
382
  borderStrong: "#A3A3A3",
366
383
  borderDisabled: "#D8D8D8",
384
+ borderBrand: "#2F31FC",
367
385
  // Focus
368
386
  focus: "#2F31FC",
369
387
  // Semantic colors
370
388
  danger: "#D90429",
371
389
  success: "#006633",
372
- warning: "#B45309"
390
+ warning: "#B45309",
391
+ status: {
392
+ success: {
393
+ background: "#E6F4ED",
394
+ text: "#006633",
395
+ icon: "#006D48",
396
+ border: "#90CAAD",
397
+ borderStrong: "#2E9970"
398
+ },
399
+ warning: {
400
+ background: "#FFF8E6",
401
+ text: "#B45309",
402
+ icon: "#D97706",
403
+ border: "#FDE08A",
404
+ borderStrong: "#E46F00"
405
+ },
406
+ error: {
407
+ background: "#FFE8EB",
408
+ text: "#A8031F",
409
+ icon: "#D90429",
410
+ border: "#FF8A95",
411
+ borderStrong: "#FF2847"
412
+ },
413
+ info: {
414
+ background: "#EEEEFF",
415
+ text: "#1B1D97",
416
+ icon: "#2F31FC",
417
+ border: "#ABABFD",
418
+ borderStrong: "#5859FC"
419
+ }
420
+ }
373
421
  },
374
422
  font: {
375
423
  primary: "'Instrument Sans', Inter, system-ui, sans-serif",
@@ -433,17 +481,49 @@ var darkThemeDefaults = {
433
481
  textSubtle: "#595959",
434
482
  textDisabled: "#595959",
435
483
  textInverted: "#141414",
484
+ textBrand: "#8182FC",
436
485
  // Borders
437
486
  border: "#474747",
438
487
  borderSubtle: "#474747",
439
488
  borderStrong: "#A3A3A3",
440
489
  borderDisabled: "#474747",
490
+ borderBrand: "#5859FC",
441
491
  // Focus
442
492
  focus: "#8182FC",
443
493
  // Semantic colors
444
494
  danger: "#FF002C",
445
495
  success: "#90CAAD",
446
- warning: "#FCC94A"
496
+ warning: "#FCC94A",
497
+ status: {
498
+ success: {
499
+ background: "#001A0C",
500
+ text: "#90CAAD",
501
+ icon: "#5DB189",
502
+ border: "#5DB189",
503
+ borderStrong: "#006D48"
504
+ },
505
+ warning: {
506
+ background: "#221004",
507
+ text: "#FCC94A",
508
+ icon: "#F9B21A",
509
+ border: "#E46F00",
510
+ borderStrong: "#B45308"
511
+ },
512
+ error: {
513
+ background: "#240006",
514
+ text: "#FF5566",
515
+ icon: "#FF2847",
516
+ border: "#FF2847",
517
+ borderStrong: "#FF2847"
518
+ },
519
+ info: {
520
+ background: "#040519",
521
+ text: "#ABABFD",
522
+ icon: "#8182FC",
523
+ border: "#8182FC",
524
+ borderStrong: "#252599"
525
+ }
526
+ }
447
527
  },
448
528
  font: {
449
529
  primary: "'Instrument Sans', Inter, system-ui, sans-serif",
@@ -655,11 +735,14 @@ function resolveThemeInput(input) {
655
735
  textSubtle: input.color?.textSubtle ?? colorBase.textSubtle,
656
736
  textDisabled: input.color?.textDisabled ?? colorBase.textDisabled,
657
737
  textInverted: input.color?.textInverted ?? colorBase.textInverted,
738
+ textBrand: colorBase.textBrand,
658
739
  border: input.color?.border ?? colorBase.border,
659
740
  borderSubtle: input.color?.borderSubtle ?? colorBase.borderSubtle,
660
741
  borderStrong: input.color?.borderStrong ?? colorBase.borderStrong,
661
742
  borderDisabled: input.color?.borderDisabled ?? colorBase.borderDisabled,
662
- focus: input.color?.focus ?? colorBase.focus
743
+ borderBrand: colorBase.borderBrand,
744
+ focus: input.color?.focus ?? colorBase.focus,
745
+ status: colorBase.status
663
746
  },
664
747
  font: { ...base.font, ...tone.font, ...input.font },
665
748
  ui: { ...base.ui, ...tone.ui, ...input.ui },
@@ -802,11 +885,43 @@ var mwThemeVarNames = {
802
885
  textSubtle: "--mw-color-text-subtle",
803
886
  textDisabled: "--mw-color-text-disabled",
804
887
  textInverted: "--mw-color-text-inverted",
888
+ textBrand: "--mw-color-text-brand",
805
889
  border: "--mw-color-border",
806
890
  borderSubtle: "--mw-color-border-subtle",
807
891
  borderStrong: "--mw-color-border-strong",
808
892
  borderDisabled: "--mw-color-border-disabled",
809
- focus: "--mw-color-focus"
893
+ borderBrand: "--mw-color-border-brand",
894
+ focus: "--mw-color-focus",
895
+ status: {
896
+ success: {
897
+ background: "--mw-color-status-success-background",
898
+ text: "--mw-color-status-success-text",
899
+ icon: "--mw-color-status-success-icon",
900
+ border: "--mw-color-status-success-border",
901
+ borderStrong: "--mw-color-status-success-border-strong"
902
+ },
903
+ warning: {
904
+ background: "--mw-color-status-warning-background",
905
+ text: "--mw-color-status-warning-text",
906
+ icon: "--mw-color-status-warning-icon",
907
+ border: "--mw-color-status-warning-border",
908
+ borderStrong: "--mw-color-status-warning-border-strong"
909
+ },
910
+ error: {
911
+ background: "--mw-color-status-error-background",
912
+ text: "--mw-color-status-error-text",
913
+ icon: "--mw-color-status-error-icon",
914
+ border: "--mw-color-status-error-border",
915
+ borderStrong: "--mw-color-status-error-border-strong"
916
+ },
917
+ info: {
918
+ background: "--mw-color-status-info-background",
919
+ text: "--mw-color-status-info-text",
920
+ icon: "--mw-color-status-info-icon",
921
+ border: "--mw-color-status-info-border",
922
+ borderStrong: "--mw-color-status-info-border-strong"
923
+ }
924
+ }
810
925
  },
811
926
  spacing: {
812
927
  sp0: "--mw-spacing-sp-0",
@@ -946,11 +1061,43 @@ var mwThemeVars = {
946
1061
  textSubtle: "var(--mw-color-text-subtle)",
947
1062
  textDisabled: "var(--mw-color-text-disabled)",
948
1063
  textInverted: "var(--mw-color-text-inverted)",
1064
+ textBrand: "var(--mw-color-text-brand)",
949
1065
  border: "var(--mw-color-border)",
950
1066
  borderSubtle: "var(--mw-color-border-subtle)",
951
1067
  borderStrong: "var(--mw-color-border-strong)",
952
1068
  borderDisabled: "var(--mw-color-border-disabled)",
953
- focus: "var(--mw-color-focus)"
1069
+ borderBrand: "var(--mw-color-border-brand)",
1070
+ focus: "var(--mw-color-focus)",
1071
+ status: {
1072
+ success: {
1073
+ background: "var(--mw-color-status-success-background)",
1074
+ text: "var(--mw-color-status-success-text)",
1075
+ icon: "var(--mw-color-status-success-icon)",
1076
+ border: "var(--mw-color-status-success-border)",
1077
+ borderStrong: "var(--mw-color-status-success-border-strong)"
1078
+ },
1079
+ warning: {
1080
+ background: "var(--mw-color-status-warning-background)",
1081
+ text: "var(--mw-color-status-warning-text)",
1082
+ icon: "var(--mw-color-status-warning-icon)",
1083
+ border: "var(--mw-color-status-warning-border)",
1084
+ borderStrong: "var(--mw-color-status-warning-border-strong)"
1085
+ },
1086
+ error: {
1087
+ background: "var(--mw-color-status-error-background)",
1088
+ text: "var(--mw-color-status-error-text)",
1089
+ icon: "var(--mw-color-status-error-icon)",
1090
+ border: "var(--mw-color-status-error-border)",
1091
+ borderStrong: "var(--mw-color-status-error-border-strong)"
1092
+ },
1093
+ info: {
1094
+ background: "var(--mw-color-status-info-background)",
1095
+ text: "var(--mw-color-status-info-text)",
1096
+ icon: "var(--mw-color-status-info-icon)",
1097
+ border: "var(--mw-color-status-info-border)",
1098
+ borderStrong: "var(--mw-color-status-info-border-strong)"
1099
+ }
1100
+ }
954
1101
  },
955
1102
  spacing: {
956
1103
  sp0: "var(--mw-spacing-sp-0)",
@@ -5018,7 +5165,7 @@ function createDotsSquareNodes() {
5018
5165
  y: "1.5",
5019
5166
  width: "4",
5020
5167
  height: "5",
5021
- rx: "1.5",
5168
+ rx: "999",
5022
5169
  fill: INDICATOR_COLOR,
5023
5170
  opacity: "0.89375"
5024
5171
  }),
@@ -5027,7 +5174,7 @@ function createDotsSquareNodes() {
5027
5174
  y: "4.4",
5028
5175
  width: "4.8",
5029
5176
  height: "4.8",
5030
- rx: "1.5",
5177
+ rx: "999",
5031
5178
  fill: INDICATOR_COLOR,
5032
5179
  opacity: "0.46875"
5033
5180
  }),
@@ -5036,7 +5183,7 @@ function createDotsSquareNodes() {
5036
5183
  y: "10",
5037
5184
  width: "5",
5038
5185
  height: "4",
5039
- rx: "1.5",
5186
+ rx: "999",
5040
5187
  fill: INDICATOR_COLOR,
5041
5188
  opacity: "0.3625"
5042
5189
  }),
@@ -5045,7 +5192,7 @@ function createDotsSquareNodes() {
5045
5192
  y: "14.8",
5046
5193
  width: "4.8",
5047
5194
  height: "4.8",
5048
- rx: "1.5",
5195
+ rx: "999",
5049
5196
  fill: INDICATOR_COLOR,
5050
5197
  opacity: "0.15"
5051
5198
  }),
@@ -5054,7 +5201,7 @@ function createDotsSquareNodes() {
5054
5201
  y: "17.5",
5055
5202
  width: "4",
5056
5203
  height: "5",
5057
- rx: "1.5",
5204
+ rx: "999",
5058
5205
  fill: INDICATOR_COLOR,
5059
5206
  opacity: "0.575"
5060
5207
  }),
@@ -5063,7 +5210,7 @@ function createDotsSquareNodes() {
5063
5210
  y: "14.8",
5064
5211
  width: "4.8",
5065
5212
  height: "4.8",
5066
- rx: "1.5",
5213
+ rx: "999",
5067
5214
  fill: INDICATOR_COLOR,
5068
5215
  opacity: "0.7875"
5069
5216
  }),
@@ -5072,7 +5219,7 @@ function createDotsSquareNodes() {
5072
5219
  y: "10",
5073
5220
  width: "5",
5074
5221
  height: "4",
5075
- rx: "1.5",
5222
+ rx: "999",
5076
5223
  fill: INDICATOR_COLOR,
5077
5224
  opacity: "0.68125"
5078
5225
  }),
@@ -5081,7 +5228,7 @@ function createDotsSquareNodes() {
5081
5228
  y: "4.4",
5082
5229
  width: "4.8",
5083
5230
  height: "4.8",
5084
- rx: "1.5",
5231
+ rx: "999",
5085
5232
  fill: INDICATOR_COLOR,
5086
5233
  opacity: "0.25625"
5087
5234
  })