@tangible/ui 0.0.19 β 0.0.21
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/README.md +1 -0
- package/components/Accordion/Accordion.js +1 -1
- package/components/Avatar/Avatar.d.ts +3 -1
- package/components/Avatar/Avatar.js +6 -25
- package/components/Avatar/index.d.ts +2 -2
- package/components/Avatar/index.js +1 -1
- package/components/Avatar/types.d.ts +8 -8
- package/components/Avatar/types.js +0 -12
- package/components/Combobox/Combobox.js +2 -2
- package/components/Icon/Icon.d.ts +10 -1
- package/components/Icon/Icon.js +5 -1
- package/components/Modal/Modal.js +1 -1
- package/components/MultiSelect/MultiSelect.js +1 -1
- package/components/Notice/Notice.d.ts +2 -2
- package/components/OverlapStack/OverlapStack.js +4 -2
- package/components/Pager/Pager.js +9 -3
- package/components/Pager/types.d.ts +9 -0
- package/components/Pager/types.js +2 -0
- package/components/Progress/Progress.js +3 -3
- package/components/Rating/Rating.js +4 -2
- package/components/Rating/types.d.ts +5 -1
- package/components/Rating/types.js +1 -0
- package/components/Select/Select.d.ts +1 -1
- package/components/Select/Select.js +6 -4
- package/components/Select/types.d.ts +5 -0
- package/components/StepIndicator/StepIndicator.js +6 -2
- package/components/StepIndicator/types.d.ts +3 -0
- package/components/StepIndicator/types.js +1 -0
- package/components/Table/BulkActionsBar.js +4 -1
- package/components/Table/DataTable.js +8 -5
- package/components/Tabs/Tabs.js +1 -1
- package/components/index.d.ts +3 -2
- package/components/index.js +2 -1
- package/icons/icons.svg +6 -2
- package/icons/lms/index.js +1 -1
- package/icons/manifest.json +32 -0
- package/icons/registry.d.ts +8 -0
- package/icons/registry.js +4 -0
- package/icons/system/index.d.ts +8 -0
- package/icons/system/index.js +45 -1
- package/package.json +1 -1
- package/styles/all.css +1 -1
- package/styles/all.expanded.css +266 -106
- package/styles/all.expanded.unlayered.css +266 -106
- package/styles/all.unlayered.css +1 -1
- package/styles/components/accordion.scss +5 -2
- package/styles/components/avatar.scss +15 -63
- package/styles/components/button.scss +9 -2
- package/styles/components/chip.scss +9 -1
- package/styles/components/combobox.scss +4 -2
- package/styles/components/dropdown.scss +2 -2
- package/styles/components/icon.scss +14 -3
- package/styles/components/input/index.scss +6 -1
- package/styles/components/move-handle.scss +1 -1
- package/styles/components/multi-select.scss +6 -3
- package/styles/components/notice.scss +30 -6
- package/styles/components/overlap-stack.scss +4 -3
- package/styles/components/pager.scss +6 -3
- package/styles/components/progress.scss +17 -5
- package/styles/components/rating.scss +2 -2
- package/styles/components/segmented-control.scss +2 -2
- package/styles/components/select.scss +13 -4
- package/styles/components/step-indicator.scss +8 -8
- package/styles/components/step-list.scss +1 -1
- package/styles/components/table.scss +2 -1
- package/styles/components/tabs.scss +2 -2
- package/styles/components/text-input.scss +5 -1
- package/styles/core.css +1 -1
- package/styles/core.unlayered.css +1 -1
- package/styles/index.scss +5 -2
- package/styles/system/_constants.scss +2 -2
- package/styles/system/_motion.scss +20 -18
- package/styles/system/_tokens.scss +89 -10
- package/tui-manifest.json +19 -6
- package/utils/generative.d.ts +16 -0
- package/utils/generative.js +45 -0
|
@@ -18,7 +18,14 @@ $brand: 'blue';
|
|
|
18
18
|
// ----------------------
|
|
19
19
|
// Helpers
|
|
20
20
|
// ----------------------
|
|
21
|
-
@
|
|
21
|
+
// @if statement instead of the if() function (deprecated in favor of CSS
|
|
22
|
+
// if(); sass 1.100+ warns) β and math.div instead of slash division.
|
|
23
|
+
@function _step($v) {
|
|
24
|
+
@if math.is-unitless($v) {
|
|
25
|
+
@return $v;
|
|
26
|
+
}
|
|
27
|
+
@return math.div($v, 1px);
|
|
28
|
+
}
|
|
22
29
|
|
|
23
30
|
@function _px-var($prefix, $ns, $px) {
|
|
24
31
|
$n: _step($px);
|
|
@@ -46,10 +53,6 @@ $brand: 'blue';
|
|
|
46
53
|
--#{$prefix}focus-ring-offset: 2px;
|
|
47
54
|
--#{$prefix}focus-ring-color: #2563eb;
|
|
48
55
|
|
|
49
|
-
/* Font Weight */
|
|
50
|
-
--#{$prefix}font-weight-medium: 500;
|
|
51
|
-
--#{$prefix}font-weight-semibold: 600;
|
|
52
|
-
|
|
53
56
|
/* Border */
|
|
54
57
|
--#{$prefix}border-width: 1px;
|
|
55
58
|
|
|
@@ -137,17 +140,91 @@ $brand: 'blue';
|
|
|
137
140
|
--#{$prefix}theme-danger-subtle: #{pf.tone('red', 50)};
|
|
138
141
|
--#{$prefix}theme-danger-subtlest: #{pf.tone('red', 25)};
|
|
139
142
|
|
|
143
|
+
/* Input chrome: the select chevron. An image, not a color β selects
|
|
144
|
+
can't be masked without masking their text, so light/dark swap the
|
|
145
|
+
URI. Fill tracks color-fg (gray 900 / gray 50). */
|
|
146
|
+
--#{$prefix}input-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 11 10'%3E%3Cpath fill='%23111928' d='M5.511 7.5a.939.939 0 0 1-.636-.244l-3.6-3.326a.833.833 0 0 1-.202-.27.778.778 0 0 1-.006-.643.83.83 0 0 1 .197-.273.909.909 0 0 1 .295-.182.965.965 0 0 1 .696.006c.11.043.21.106.292.186l2.964 2.738 2.964-2.738a.94.94 0 0 1 .633-.234c.236.002.462.09.628.244a.801.801 0 0 1 .264.58.8.8 0 0 1-.253.586l-3.6 3.326a.939.939 0 0 1-.636.244Z'/%3E%3C/svg%3E");
|
|
147
|
+
|
|
140
148
|
/* A11y (legacy alias - prefer --focus-ring-color) */
|
|
141
149
|
--#{$prefix}color-focus-ring: var(--#{$prefix}focus-ring-color);
|
|
142
150
|
}
|
|
143
151
|
}
|
|
144
152
|
|
|
153
|
+
// ----------------------
|
|
154
|
+
// Generative colors (The Jellybean Bag)
|
|
155
|
+
// ----------------------
|
|
156
|
+
// Deterministic pseudo-random identity colors β avatar initials, tags,
|
|
157
|
+
// category accents. Explicitly NOT semantic: nothing here should read as a
|
|
158
|
+
// status. Hues are evenly spaced in OKLCH so every bean has the same
|
|
159
|
+
// perceived weight; the whole bag derives from the tier constants below.
|
|
160
|
+
//
|
|
161
|
+
// Two tiers: `dark` beans carry white content, `light` beans (the warm/bright
|
|
162
|
+
// hues that go muddy at low lightness) carry dark content. `base`, `-interact`
|
|
163
|
+
// and `-fg` are mode-independent β a bean is the surface, so the mode of the
|
|
164
|
+
// page behind it doesn't matter. `-subtle`, `-subtle-interact` and `-strong`
|
|
165
|
+
// are tints/shades of the page surface, so they flip in dark mode.
|
|
166
|
+
|
|
167
|
+
$generative: (
|
|
168
|
+
"coral": (hue: 25, tier: dark),
|
|
169
|
+
"orange": (hue: 60, tier: light),
|
|
170
|
+
"amber": (hue: 88, tier: light),
|
|
171
|
+
"lime": (hue: 125, tier: light),
|
|
172
|
+
"emerald": (hue: 162, tier: dark),
|
|
173
|
+
"teal": (hue: 192, tier: dark),
|
|
174
|
+
"cyan": (hue: 218, tier: light),
|
|
175
|
+
"blue": (hue: 262, tier: dark),
|
|
176
|
+
"violet": (hue: 300, tier: dark),
|
|
177
|
+
"pink": (hue: 350, tier: dark),
|
|
178
|
+
) !default;
|
|
179
|
+
|
|
180
|
+
// Tuning surface β the whole bag responds to these.
|
|
181
|
+
$generative-l-dark: 0.52 !default; // base lightness, dark tier
|
|
182
|
+
$generative-c-dark: 0.13 !default; // base chroma, dark tier
|
|
183
|
+
$generative-l-light: 0.78 !default; // base lightness, light tier
|
|
184
|
+
$generative-c-light: 0.14 !default; // base chroma, light tier
|
|
185
|
+
$generative-interact-shift: 0.05 !default; // hover/active darkens by this
|
|
186
|
+
|
|
187
|
+
@function -oklch($l, $c, $h) {
|
|
188
|
+
@return string.unquote('oklch(#{$l} #{$c} #{$h})');
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// Emitted at :where() zero specificity, like emit-color-roles β the dark
|
|
192
|
+
// override blocks rely on winning the tie.
|
|
193
|
+
@mixin emit-generative($prefix, $beans: $generative) {
|
|
194
|
+
:where(.#{$prefix}interface) {
|
|
195
|
+
@each $name, $def in $beans {
|
|
196
|
+
$h: map.get($def, hue);
|
|
197
|
+
$light: map.get($def, tier) == light;
|
|
198
|
+
$l: if($light, $generative-l-light, $generative-l-dark);
|
|
199
|
+
$c: if($light, $generative-c-light, $generative-c-dark);
|
|
200
|
+
--#{$prefix}generative-#{$name}: #{-oklch($l, $c, $h)};
|
|
201
|
+
--#{$prefix}generative-#{$name}-interact: #{-oklch($l - $generative-interact-shift, $c, $h)};
|
|
202
|
+
--#{$prefix}generative-#{$name}-fg: #{if($light, pf.tone('gray', 900), #fff)};
|
|
203
|
+
--#{$prefix}generative-#{$name}-subtle: #{-oklch(0.94, 0.045, $h)};
|
|
204
|
+
--#{$prefix}generative-#{$name}-subtle-interact: #{-oklch(0.90, 0.06, $h)};
|
|
205
|
+
--#{$prefix}generative-#{$name}-strong: #{-oklch(0.40, 0.11, $h)};
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// Dark-mode flips for the surface-relative variants only.
|
|
211
|
+
@mixin -generative-dark($prefix, $beans: $generative) {
|
|
212
|
+
@each $name, $def in $beans {
|
|
213
|
+
$h: map.get($def, hue);
|
|
214
|
+
--#{$prefix}generative-#{$name}-subtle: #{-oklch(0.30, 0.055, $h)};
|
|
215
|
+
--#{$prefix}generative-#{$name}-subtle-interact: #{-oklch(0.34, 0.065, $h)};
|
|
216
|
+
--#{$prefix}generative-#{$name}-strong: #{-oklch(0.82, 0.10, $h)};
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
145
220
|
// ----------------------
|
|
146
221
|
// Dark Mode
|
|
147
222
|
// ----------------------
|
|
148
223
|
|
|
149
224
|
// Private: actual dark override declarations
|
|
150
225
|
@mixin _dark-overrides($prefix:'tui-', $brand:'blue', $neutral:'gray') {
|
|
226
|
+
@include -generative-dark($prefix);
|
|
227
|
+
|
|
151
228
|
/* UA chrome: native controls, scrollbars render in dark mode */
|
|
152
229
|
color-scheme: dark;
|
|
153
230
|
|
|
@@ -170,6 +247,9 @@ $brand: 'blue';
|
|
|
170
247
|
--#{$prefix}color-border: #{pf.tone($neutral, 700)};
|
|
171
248
|
--#{$prefix}color-divider: #{pf.tone($neutral, 800)};
|
|
172
249
|
|
|
250
|
+
/* Input chrome */
|
|
251
|
+
--#{$prefix}input-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 11 10'%3E%3Cpath fill='%23F9FAFB' d='M5.511 7.5a.939.939 0 0 1-.636-.244l-3.6-3.326a.833.833 0 0 1-.202-.27.778.778 0 0 1-.006-.643.83.83 0 0 1 .197-.273.909.909 0 0 1 .295-.182.965.965 0 0 1 .696.006c.11.043.21.106.292.186l2.964 2.738 2.964-2.738a.94.94 0 0 1 .633-.234c.236.002.462.09.628.244a.801.801 0 0 1 .264.58.8.8 0 0 1-.253.586l-3.6 3.326a.939.939 0 0 1-.636.244Z'/%3E%3C/svg%3E");
|
|
252
|
+
|
|
173
253
|
/* Theme colors - adjust for dark mode contrast */
|
|
174
254
|
--#{$prefix}theme-primary-base: #{pf.tone($brand, 400)};
|
|
175
255
|
--#{$prefix}theme-primary-soft: #{pf.tone($brand, 500)};
|
|
@@ -349,12 +429,12 @@ $brand: 'blue';
|
|
|
349
429
|
}
|
|
350
430
|
|
|
351
431
|
// ----------------------
|
|
352
|
-
//
|
|
353
|
-
// --<prefix>
|
|
432
|
+
// Typography size aliases
|
|
433
|
+
// --<prefix>typography-size-md: calc(16 * multiplier)
|
|
354
434
|
// ----------------------
|
|
355
435
|
@mixin emit-fontsize-aliases($prefix, $aliases: $font-aliases) {
|
|
356
436
|
@each $name, $px in $aliases {
|
|
357
|
-
--#{$prefix}typography-size-#{$name}: calc(#{$px} * var(--#{$prefix}
|
|
437
|
+
--#{$prefix}typography-size-#{$name}: calc(#{$px} * var(--#{$prefix}typography-size-multiplier, calc(1rem / #{$font-multiplier-default})));
|
|
358
438
|
}
|
|
359
439
|
}
|
|
360
440
|
|
|
@@ -363,6 +443,5 @@ $brand: 'blue';
|
|
|
363
443
|
// ----------------------
|
|
364
444
|
@mixin emit-scale-vars($prefix, $radius, $font) {
|
|
365
445
|
@each $k, $v in $radius { --#{$prefix}radius-#{$k}: #{$v}; }
|
|
366
|
-
--#{$prefix}
|
|
367
|
-
--#{$prefix}line: #{map.get($font, line)};
|
|
446
|
+
--#{$prefix}typography-size: #{map.get($font, base-size)};
|
|
368
447
|
}
|
package/tui-manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.0.
|
|
3
|
-
"generated": "2026-07-
|
|
2
|
+
"version": "0.0.21",
|
|
3
|
+
"generated": "2026-07-27T16:54:04.911Z",
|
|
4
4
|
"components": {
|
|
5
5
|
"Accordion": {
|
|
6
6
|
"props": {
|
|
@@ -319,6 +319,7 @@
|
|
|
319
319
|
"--tui-button-fg-interact",
|
|
320
320
|
"--tui-button-border-interact",
|
|
321
321
|
"--tui-button-fg-active",
|
|
322
|
+
"--tui-button-icon-scale",
|
|
322
323
|
"--tui-control-height-sm",
|
|
323
324
|
"--tui-control-height-md",
|
|
324
325
|
"--tui-control-height-lg"
|
|
@@ -652,6 +653,7 @@
|
|
|
652
653
|
"--tui-chip-fg",
|
|
653
654
|
"--tui-chip-border",
|
|
654
655
|
"--tui-chip-icon",
|
|
656
|
+
"--tui-chip-icon-scale",
|
|
655
657
|
"--tui-chip-radius",
|
|
656
658
|
"--tui-chip-selected-ring",
|
|
657
659
|
"--tui-chip-icon-slot-bg",
|
|
@@ -866,6 +868,7 @@
|
|
|
866
868
|
}
|
|
867
869
|
},
|
|
868
870
|
"cssTokens": [
|
|
871
|
+
"--tui-combobox-min-width",
|
|
869
872
|
"--tui-combobox-input-bg",
|
|
870
873
|
"--tui-combobox-input-fg",
|
|
871
874
|
"--tui-combobox-input-border",
|
|
@@ -1024,7 +1027,7 @@
|
|
|
1024
1027
|
"emoji": {
|
|
1025
1028
|
"type": "string",
|
|
1026
1029
|
"required": false,
|
|
1027
|
-
"description": "Emoji or unicode character (alternative to name)"
|
|
1030
|
+
"description": "Emoji or unicode character (alternative to name). The same labelling\ncontract as `name` applies: pass `label` when the emoji conveys meaning\nnot available from surrounding text (π for locked, β οΈ for a warning);\nomit it only for decoration.\n@remarks Emoji render with the platform's native emoji font β size and\nbaseline alignment differ across macOS/Windows/Android, so avoid mixing\nemoji with SVG icons in sets that must align (e.g. status columns)."
|
|
1028
1031
|
},
|
|
1029
1032
|
"label": {
|
|
1030
1033
|
"type": "string",
|
|
@@ -1439,6 +1442,7 @@
|
|
|
1439
1442
|
}
|
|
1440
1443
|
},
|
|
1441
1444
|
"cssTokens": [
|
|
1445
|
+
"--tui-multiselect-min-width",
|
|
1442
1446
|
"--tui-multiselect-trigger-bg",
|
|
1443
1447
|
"--tui-multiselect-trigger-fg",
|
|
1444
1448
|
"--tui-multiselect-trigger-border",
|
|
@@ -1515,7 +1519,7 @@
|
|
|
1515
1519
|
"required": false
|
|
1516
1520
|
},
|
|
1517
1521
|
"theme": {
|
|
1518
|
-
"type": "\"info\" | \"success\" | \"warning\" | \"danger\"",
|
|
1522
|
+
"type": "\"info\" | \"success\" | \"warning\" | \"danger\" | \"neutral\"",
|
|
1519
1523
|
"required": false,
|
|
1520
1524
|
"description": "Visual intent"
|
|
1521
1525
|
},
|
|
@@ -1576,6 +1580,7 @@
|
|
|
1576
1580
|
"--tui-notice-fg",
|
|
1577
1581
|
"--tui-notice-radius",
|
|
1578
1582
|
"--tui-notice-padding",
|
|
1583
|
+
"--tui-notice-title-size",
|
|
1579
1584
|
"--tui-notice-foot-basis"
|
|
1580
1585
|
],
|
|
1581
1586
|
"story": {
|
|
@@ -1890,6 +1895,7 @@
|
|
|
1890
1895
|
"--tui-progress-fill",
|
|
1891
1896
|
"--tui-progress-label",
|
|
1892
1897
|
"--tui-progress-radius",
|
|
1898
|
+
"--tui-progress-block-size",
|
|
1893
1899
|
"--tui-progress-z1-fill",
|
|
1894
1900
|
"--tui-progress-z2-fill",
|
|
1895
1901
|
"--tui-progress-z3-fill",
|
|
@@ -2209,6 +2215,12 @@
|
|
|
2209
2215
|
"defaultValue": "false",
|
|
2210
2216
|
"description": "Whether the selection can be cleared with a clear button."
|
|
2211
2217
|
},
|
|
2218
|
+
"clearLabel": {
|
|
2219
|
+
"type": "string",
|
|
2220
|
+
"required": false,
|
|
2221
|
+
"defaultValue": "\"Clear selection\"",
|
|
2222
|
+
"description": "Accessible label for the clear button (i18n)."
|
|
2223
|
+
},
|
|
2212
2224
|
"id": {
|
|
2213
2225
|
"type": "string",
|
|
2214
2226
|
"required": false,
|
|
@@ -2216,6 +2228,7 @@
|
|
|
2216
2228
|
}
|
|
2217
2229
|
},
|
|
2218
2230
|
"cssTokens": [
|
|
2231
|
+
"--tui-select-min-width",
|
|
2219
2232
|
"--tui-select-trigger-bg",
|
|
2220
2233
|
"--tui-select-trigger-fg",
|
|
2221
2234
|
"--tui-select-trigger-border",
|
|
@@ -3014,9 +3027,9 @@
|
|
|
3014
3027
|
"membersync": 22,
|
|
3015
3028
|
"player": 24,
|
|
3016
3029
|
"reaction": 36,
|
|
3017
|
-
"system":
|
|
3030
|
+
"system": 94
|
|
3018
3031
|
},
|
|
3019
|
-
"total":
|
|
3032
|
+
"total": 226,
|
|
3020
3033
|
"manifest": "./icons/manifest.json"
|
|
3021
3034
|
}
|
|
3022
3035
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generative colors (The Jellybean Bag) β deterministic pseudo-random
|
|
3
|
+
* identity colors for avatar initials, tags, and category accents.
|
|
4
|
+
*
|
|
5
|
+
* Names MUST match the `$generative` Sass map in
|
|
6
|
+
* `styles/system/_tokens.scss` β the SCSS emits the tokens
|
|
7
|
+
* (`--tui-generative-{name}` and friends), this module picks names.
|
|
8
|
+
*/
|
|
9
|
+
export type GenerativeColor = 'coral' | 'orange' | 'amber' | 'lime' | 'emerald' | 'teal' | 'cyan' | 'blue' | 'violet' | 'pink';
|
|
10
|
+
/** Bag order matters: `stringToGenerativeColor` indexes into it by hash. */
|
|
11
|
+
export declare const GENERATIVE_COLORS: GenerativeColor[];
|
|
12
|
+
/**
|
|
13
|
+
* Deterministically pick a bag color for a string (name, tag, id).
|
|
14
|
+
* Case-insensitive: "Ada" and "ada" get the same bean.
|
|
15
|
+
*/
|
|
16
|
+
export declare function stringToGenerativeColor(str: string): GenerativeColor;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generative colors (The Jellybean Bag) β deterministic pseudo-random
|
|
3
|
+
* identity colors for avatar initials, tags, and category accents.
|
|
4
|
+
*
|
|
5
|
+
* Names MUST match the `$generative` Sass map in
|
|
6
|
+
* `styles/system/_tokens.scss` β the SCSS emits the tokens
|
|
7
|
+
* (`--tui-generative-{name}` and friends), this module picks names.
|
|
8
|
+
*/
|
|
9
|
+
/** Bag order matters: `stringToGenerativeColor` indexes into it by hash. */
|
|
10
|
+
export const GENERATIVE_COLORS = [
|
|
11
|
+
'coral',
|
|
12
|
+
'orange',
|
|
13
|
+
'amber',
|
|
14
|
+
'lime',
|
|
15
|
+
'emerald',
|
|
16
|
+
'teal',
|
|
17
|
+
'cyan',
|
|
18
|
+
'blue',
|
|
19
|
+
'violet',
|
|
20
|
+
'pink',
|
|
21
|
+
];
|
|
22
|
+
/**
|
|
23
|
+
* Avatar's original string hash, moved here verbatim β same input, same
|
|
24
|
+
* color, forever. Changing this algorithm (or the bag order above) would
|
|
25
|
+
* silently reshuffle every existing nameβcolor assignment.
|
|
26
|
+
*/
|
|
27
|
+
function hashString(str) {
|
|
28
|
+
if (!str)
|
|
29
|
+
return 0;
|
|
30
|
+
let hash = 0;
|
|
31
|
+
for (let i = 0; i < str.length; i++) {
|
|
32
|
+
const char = str.charCodeAt(i);
|
|
33
|
+
hash = ((hash << 5) - hash) + char;
|
|
34
|
+
hash = hash & hash; // Convert to 32-bit integer
|
|
35
|
+
}
|
|
36
|
+
return Math.abs(hash);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Deterministically pick a bag color for a string (name, tag, id).
|
|
40
|
+
* Case-insensitive: "Ada" and "ada" get the same bean.
|
|
41
|
+
*/
|
|
42
|
+
export function stringToGenerativeColor(str) {
|
|
43
|
+
const hash = hashString(str.toLowerCase());
|
|
44
|
+
return GENERATIVE_COLORS[hash % GENERATIVE_COLORS.length];
|
|
45
|
+
}
|