@nyaruka/temba-components 0.158.3 → 0.159.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.
@@ -16,8 +16,10 @@ export const designTokens = css`
16
16
  /* accent ramp — the primary color sits at 400 and the ramp is
17
17
  derived from it in both directions via sRGB mixing.
18
18
  The anchor reads from --primary-rgb so host pages can re-theme
19
- the entire ramp by setting e.g. --primary-rgb: 112, 0, 132. */
20
- --accent: rgb(var(--primary-rgb, 98, 147, 201));
19
+ the entire ramp by setting e.g. --primary-rgb: 112, 0, 132.
20
+ Fallback matches the design-system.css default so component-
21
+ only test harnesses pick up the same brand colour. */
22
+ --accent: rgb(var(--primary-rgb, 73, 127, 206));
21
23
  --accent-50: color-mix(in srgb, var(--accent) 6%, white);
22
24
  --accent-100: color-mix(in srgb, var(--accent) 16%, white);
23
25
  --accent-200: color-mix(in srgb, var(--accent) 32%, white);
@@ -68,6 +70,7 @@ export const designTokens = css`
68
70
  --flow: #16a34a;
69
71
  --channel: #6b21a8;
70
72
  --topic: #d97706;
73
+ --campaign: #0891b2;
71
74
  /* Field stays slightly darker than the bright yellow-500 anchor
72
75
  used for flow/channel — yellow-500 has too little contrast
73
76
  against white to read as a foreground / icon hue on its own.
@@ -42,7 +42,8 @@ export const PILL_TYPES: ReadonlySet<string> = new Set([
42
42
  'label',
43
43
  'keyword',
44
44
  'channel',
45
- 'topic'
45
+ 'topic',
46
+ 'campaign'
46
47
  ]);
47
48
 
48
49
  /** Default icon name for each pill variant. Used when a consumer
@@ -55,7 +56,8 @@ export const PILL_TYPE_ICONS: Readonly<Record<string, string>> = {
55
56
  field: 'fields',
56
57
  flow: 'flow',
57
58
  label: 'label',
58
- topic: 'topic'
59
+ topic: 'topic',
60
+ campaign: 'campaign'
59
61
  };
60
62
 
61
63
  /** Inverse mapping: icon name (alias or resolved SVG id) → pill type.
@@ -68,11 +70,13 @@ const ICON_TO_PILL_TYPE: Readonly<Record<string, string>> = {
68
70
  field: 'field',
69
71
  fields: 'field',
70
72
  label: 'label',
73
+ campaign: 'campaign',
71
74
  // resolved Icon enum SVG ids
72
75
  'users-01': 'group',
73
76
  'atom-01': 'group',
74
77
  'user-01': 'contact',
75
- 'tag-01': 'label'
78
+ 'tag-01': 'label',
79
+ 'clock-refresh': 'campaign'
76
80
  };
77
81
 
78
82
  export const iconToPillType = (icon?: string): string | undefined => {
@@ -84,10 +88,15 @@ export const iconToPillType = (icon?: string): string | undefined => {
84
88
  };
85
89
 
86
90
  export const pillVariants = css`
91
+ /* The grey variants border off --pill-border, falling back to
92
+ --border. The indirection lets a host context (e.g. a selected
93
+ list row) retint the border without redefining --border, which
94
+ each component re-declares in its own shadow DOM via the design
95
+ tokens and so can't be overridden from outside. */
87
96
  .pill-neutral {
88
97
  background: var(--sunken);
89
98
  color: var(--text-1);
90
- border-color: var(--border);
99
+ border-color: var(--pill-border, var(--border));
91
100
  --icon-color: var(--text-2);
92
101
  }
93
102
  .pill-flow {
@@ -118,6 +127,12 @@ export const pillVariants = css`
118
127
  border-color: color-mix(in srgb, var(--topic) 25%, white);
119
128
  --icon-color: var(--topic);
120
129
  }
130
+ .pill-campaign {
131
+ background: color-mix(in srgb, var(--campaign) 12%, white);
132
+ color: var(--campaign);
133
+ border-color: color-mix(in srgb, var(--campaign) 25%, white);
134
+ --icon-color: var(--campaign);
135
+ }
121
136
  .pill-field {
122
137
  /* Yellow has very low contrast against white, so the color-mix
123
138
  approach used by other variants washes out at any readable mix
@@ -133,7 +148,7 @@ export const pillVariants = css`
133
148
  .pill-keyword {
134
149
  background: var(--sunken);
135
150
  color: var(--text-1);
136
- border-color: var(--border);
151
+ border-color: var(--pill-border, var(--border));
137
152
  --icon-color: var(--text-2);
138
153
  font-family: var(--font-mono);
139
154
  font-size: 11.5px;
@@ -141,7 +156,7 @@ export const pillVariants = css`
141
156
  .pill-label {
142
157
  background: var(--sunken);
143
158
  color: var(--text-2);
144
- border-color: var(--border);
159
+ border-color: var(--pill-border, var(--border));
145
160
  --icon-color: var(--text-2);
146
161
  }
147
162
  `;