@flamingo-stack/openframe-frontend-core 0.0.628 → 0.0.629-2171.6182.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.
Files changed (192) hide show
  1. package/dist/{chunk-QS2QCXBH.js → chunk-2J7EFH4V.js} +380 -30
  2. package/dist/chunk-2J7EFH4V.js.map +1 -0
  3. package/dist/{chunk-X3LC6R37.js → chunk-32P6KUZP.js} +2 -2
  4. package/dist/{chunk-EHAYNUOL.cjs → chunk-4E7XCEV3.cjs} +77 -2
  5. package/dist/chunk-4E7XCEV3.cjs.map +1 -0
  6. package/dist/{chunk-JONR3BDJ.cjs → chunk-53ARMJHM.cjs} +37 -37
  7. package/dist/{chunk-JONR3BDJ.cjs.map → chunk-53ARMJHM.cjs.map} +1 -1
  8. package/dist/{chunk-OQHFHKUG.cjs → chunk-55X46LKR.cjs} +450 -100
  9. package/dist/chunk-55X46LKR.cjs.map +1 -0
  10. package/dist/{chunk-U4UNC3RP.js → chunk-5BUEB2WQ.js} +12 -12
  11. package/dist/{chunk-6AFJQOT2.js → chunk-65IVNHBS.js} +4 -4
  12. package/dist/{chunk-U7TTQV4N.cjs → chunk-6I3KNDBF.cjs} +3 -3
  13. package/dist/{chunk-U7TTQV4N.cjs.map → chunk-6I3KNDBF.cjs.map} +1 -1
  14. package/dist/{chunk-S6WBBSII.js → chunk-76HB456V.js} +5 -5
  15. package/dist/{chunk-HLZKMYST.js → chunk-7ZDPJ6SW.js} +4 -4
  16. package/dist/{chunk-L6GJV7E7.cjs → chunk-BQ6QZUZ6.cjs} +83 -83
  17. package/dist/{chunk-L6GJV7E7.cjs.map → chunk-BQ6QZUZ6.cjs.map} +1 -1
  18. package/dist/{chunk-MB4IEWLH.js → chunk-BS6ASI3D.js} +3 -3
  19. package/dist/{chunk-Q544C4Z7.cjs → chunk-CHRPZ5PV.cjs} +25 -25
  20. package/dist/{chunk-Q544C4Z7.cjs.map → chunk-CHRPZ5PV.cjs.map} +1 -1
  21. package/dist/{chunk-LLSX5T7X.js → chunk-CIRD5P4U.js} +7 -7
  22. package/dist/{chunk-YQCA4ZEJ.js → chunk-CMUNJZWN.js} +2 -2
  23. package/dist/{chunk-UBX3ATG5.cjs → chunk-CP3R4GRA.cjs} +451 -436
  24. package/dist/chunk-CP3R4GRA.cjs.map +1 -0
  25. package/dist/{chunk-2E543KJD.js → chunk-D7VNHPJB.js} +10 -8
  26. package/dist/{chunk-2E543KJD.js.map → chunk-D7VNHPJB.js.map} +1 -1
  27. package/dist/{chunk-TDKOW2C5.cjs → chunk-DDUG42FK.cjs} +28 -26
  28. package/dist/chunk-DDUG42FK.cjs.map +1 -0
  29. package/dist/{chunk-SWJ6QLD7.cjs → chunk-ELKTBTGR.cjs} +105 -105
  30. package/dist/{chunk-SWJ6QLD7.cjs.map → chunk-ELKTBTGR.cjs.map} +1 -1
  31. package/dist/{chunk-6QLOSGE7.cjs → chunk-F4JGAGI3.cjs} +49 -47
  32. package/dist/chunk-F4JGAGI3.cjs.map +1 -0
  33. package/dist/{chunk-TUUSLED7.js → chunk-FENZRLVO.js} +10 -8
  34. package/dist/{chunk-TUUSLED7.js.map → chunk-FENZRLVO.js.map} +1 -1
  35. package/dist/{chunk-VCY2KHOE.cjs → chunk-FTWVYXNP.cjs} +34 -34
  36. package/dist/{chunk-VCY2KHOE.cjs.map → chunk-FTWVYXNP.cjs.map} +1 -1
  37. package/dist/{chunk-C3DDNRJG.cjs → chunk-FYC3W72E.cjs} +6 -6
  38. package/dist/{chunk-C3DDNRJG.cjs.map → chunk-FYC3W72E.cjs.map} +1 -1
  39. package/dist/{chunk-GH4WLDPS.cjs → chunk-G5FL4QTN.cjs} +18 -18
  40. package/dist/{chunk-GH4WLDPS.cjs.map → chunk-G5FL4QTN.cjs.map} +1 -1
  41. package/dist/{chunk-BND25SXU.cjs → chunk-GUCKPOPQ.cjs} +42 -42
  42. package/dist/{chunk-BND25SXU.cjs.map → chunk-GUCKPOPQ.cjs.map} +1 -1
  43. package/dist/{chunk-HNNR5CGX.js → chunk-HRRKZWFF.js} +10 -8
  44. package/dist/{chunk-HNNR5CGX.js.map → chunk-HRRKZWFF.js.map} +1 -1
  45. package/dist/{chunk-WBZ4HP7D.js → chunk-J6ATJUEE.js} +4 -4
  46. package/dist/{chunk-Y5QXDVPP.cjs → chunk-JQSN7D7X.cjs} +7 -7
  47. package/dist/{chunk-Y5QXDVPP.cjs.map → chunk-JQSN7D7X.cjs.map} +1 -1
  48. package/dist/{chunk-5LIDR7HL.js → chunk-JRYS4VMV.js} +4 -79
  49. package/dist/{chunk-5LIDR7HL.js.map → chunk-JRYS4VMV.js.map} +1 -1
  50. package/dist/{chunk-KTBZJP5J.cjs → chunk-KAG3SX3R.cjs} +22 -20
  51. package/dist/chunk-KAG3SX3R.cjs.map +1 -0
  52. package/dist/{chunk-ON7663OW.js → chunk-L5FEAOGJ.js} +8 -354
  53. package/dist/chunk-L5FEAOGJ.js.map +1 -0
  54. package/dist/{chunk-LCMXGM2P.js → chunk-LUBIWC3N.js} +8 -8
  55. package/dist/{chunk-ZRCWXJDW.js → chunk-LZB2UZJY.js} +4 -4
  56. package/dist/{chunk-JWXEEZKD.js → chunk-MIOE7FYN.js} +3 -3
  57. package/dist/{chunk-K43T7N7O.js → chunk-NBM7ZB6T.js} +12 -12
  58. package/dist/{chunk-YZJL6WGP.js → chunk-NDIPDU36.js} +49 -34
  59. package/dist/chunk-NDIPDU36.js.map +1 -0
  60. package/dist/{chunk-3IXDZI3R.cjs → chunk-P7UT2YSC.cjs} +3 -3
  61. package/dist/{chunk-3IXDZI3R.cjs.map → chunk-P7UT2YSC.cjs.map} +1 -1
  62. package/dist/{chunk-JJUV7Z4L.cjs → chunk-QIVX7F3N.cjs} +27 -27
  63. package/dist/{chunk-JJUV7Z4L.cjs.map → chunk-QIVX7F3N.cjs.map} +1 -1
  64. package/dist/{chunk-WIP5JO2O.cjs → chunk-R46TW4LX.cjs} +9 -9
  65. package/dist/{chunk-WIP5JO2O.cjs.map → chunk-R46TW4LX.cjs.map} +1 -1
  66. package/dist/{chunk-2MMEPNSX.cjs → chunk-RAPPN6MN.cjs} +3 -3
  67. package/dist/{chunk-2MMEPNSX.cjs.map → chunk-RAPPN6MN.cjs.map} +1 -1
  68. package/dist/{chunk-XQ4II4BK.js → chunk-SOUGXQJE.js} +4 -4
  69. package/dist/{chunk-E523WX5V.cjs → chunk-TV6NXNKO.cjs} +5 -5
  70. package/dist/{chunk-E523WX5V.cjs.map → chunk-TV6NXNKO.cjs.map} +1 -1
  71. package/dist/{chunk-FKBM6U43.js → chunk-USIRWQJ3.js} +76 -1
  72. package/dist/{chunk-FKBM6U43.js.map → chunk-USIRWQJ3.js.map} +1 -1
  73. package/dist/{chunk-CCWI3622.cjs → chunk-VOZZQ6HQ.cjs} +4 -4
  74. package/dist/{chunk-CCWI3622.cjs.map → chunk-VOZZQ6HQ.cjs.map} +1 -1
  75. package/dist/{chunk-JVLLA3Z7.js → chunk-WYELOUP4.js} +6 -6
  76. package/dist/{chunk-F2KBCLUG.js → chunk-X5NN4NJM.js} +2 -2
  77. package/dist/{chunk-KT47FRJC.cjs → chunk-Y2ZRUCYH.cjs} +15 -15
  78. package/dist/{chunk-KT47FRJC.cjs.map → chunk-Y2ZRUCYH.cjs.map} +1 -1
  79. package/dist/{chunk-YXWGSDK4.cjs → chunk-ZI27ALYX.cjs} +5 -80
  80. package/dist/chunk-ZI27ALYX.cjs.map +1 -0
  81. package/dist/{chunk-BVQEU5JB.js → chunk-ZOMGXH7C.js} +2 -2
  82. package/dist/{chunk-UNI3POHU.cjs → chunk-ZYDNPUSH.cjs} +279 -625
  83. package/dist/chunk-ZYDNPUSH.cjs.map +1 -0
  84. package/dist/components/case-studies/index.cjs +14 -14
  85. package/dist/components/case-studies/index.js +8 -8
  86. package/dist/components/chat/index.cjs +5 -5
  87. package/dist/components/chat/index.js +4 -4
  88. package/dist/components/contact/index.cjs +9 -9
  89. package/dist/components/contact/index.js +8 -8
  90. package/dist/components/docs/index.cjs +12 -12
  91. package/dist/components/docs/index.js +11 -11
  92. package/dist/components/embeds/index.cjs +9 -9
  93. package/dist/components/embeds/index.js +8 -8
  94. package/dist/components/faq/index.cjs +10 -10
  95. package/dist/components/faq/index.js +9 -9
  96. package/dist/components/features/changelog-manager.d.ts +17 -1
  97. package/dist/components/features/changelog-manager.d.ts.map +1 -1
  98. package/dist/components/features/index.cjs +8 -8
  99. package/dist/components/features/index.js +7 -7
  100. package/dist/components/help-center-pages/index.cjs +31 -31
  101. package/dist/components/help-center-pages/index.js +22 -22
  102. package/dist/components/index.cjs +71 -69
  103. package/dist/components/index.cjs.map +1 -1
  104. package/dist/components/index.js +26 -24
  105. package/dist/components/index.js.map +1 -1
  106. package/dist/components/meeting-scheduler/index.cjs +49 -49
  107. package/dist/components/meeting-scheduler/index.js +9 -9
  108. package/dist/components/navigation/index.cjs +11 -11
  109. package/dist/components/navigation/index.js +10 -10
  110. package/dist/components/onboarding-guides/index.cjs +12 -12
  111. package/dist/components/onboarding-guides/index.js +11 -11
  112. package/dist/components/related-content/index.cjs +6 -6
  113. package/dist/components/related-content/index.js +5 -5
  114. package/dist/components/tickets/index.cjs +13 -13
  115. package/dist/components/tickets/index.js +12 -12
  116. package/dist/components/ui/color-preset-select.d.ts +4 -5
  117. package/dist/components/ui/color-preset-select.d.ts.map +1 -1
  118. package/dist/components/ui/department-badge.d.ts +3 -3
  119. package/dist/components/ui/index.cjs +10 -8
  120. package/dist/components/ui/index.cjs.map +1 -1
  121. package/dist/components/ui/index.js +9 -7
  122. package/dist/components/ui/palette-badge.d.ts +8 -6
  123. package/dist/components/ui/palette-badge.d.ts.map +1 -1
  124. package/dist/components/ui/status-badge.d.ts +1 -1
  125. package/dist/components/ui/status-badge.d.ts.map +1 -1
  126. package/dist/hooks/index.cjs +5 -5
  127. package/dist/hooks/index.js +4 -4
  128. package/dist/index.cjs +18 -18
  129. package/dist/index.cjs.map +1 -1
  130. package/dist/index.js +46 -46
  131. package/dist/types/department.d.ts +1 -1
  132. package/dist/types/department.d.ts.map +1 -1
  133. package/dist/types/index.cjs.map +1 -1
  134. package/dist/types/index.js.map +1 -1
  135. package/dist/types/product-release.d.ts +5 -0
  136. package/dist/types/product-release.d.ts.map +1 -1
  137. package/dist/utils/color-presets.d.ts +24 -0
  138. package/dist/utils/color-presets.d.ts.map +1 -0
  139. package/dist/utils/index.cjs +24 -21
  140. package/dist/utils/index.cjs.map +1 -1
  141. package/dist/utils/index.d.ts +1 -1
  142. package/dist/utils/index.d.ts.map +1 -1
  143. package/dist/utils/index.js +22 -19
  144. package/dist/utils/index.js.map +1 -1
  145. package/package.json +1 -1
  146. package/src/components/features/__tests__/changelog-manager-tags.test.tsx +57 -0
  147. package/src/components/features/changelog-manager.tsx +69 -5
  148. package/src/components/ui/.department-badge.md +2 -2
  149. package/src/components/ui/.palette-badge.md +2 -2
  150. package/src/components/ui/.status-badge.md +2 -2
  151. package/src/components/ui/__tests__/department-badge.test.tsx +21 -23
  152. package/src/components/ui/color-preset-select.tsx +5 -21
  153. package/src/components/ui/department-badge.tsx +3 -3
  154. package/src/components/ui/palette-badge.tsx +13 -8
  155. package/src/components/ui/status-badge.tsx +0 -5
  156. package/src/types/department.ts +1 -1
  157. package/src/types/product-release.ts +5 -0
  158. package/src/utils/.color-presets.md +2 -0
  159. package/src/utils/color-presets.ts +48 -0
  160. package/src/utils/index.ts +1 -2
  161. package/dist/chunk-6QLOSGE7.cjs.map +0 -1
  162. package/dist/chunk-EHAYNUOL.cjs.map +0 -1
  163. package/dist/chunk-KTBZJP5J.cjs.map +0 -1
  164. package/dist/chunk-ON7663OW.js.map +0 -1
  165. package/dist/chunk-OQHFHKUG.cjs.map +0 -1
  166. package/dist/chunk-QS2QCXBH.js.map +0 -1
  167. package/dist/chunk-TDKOW2C5.cjs.map +0 -1
  168. package/dist/chunk-UBX3ATG5.cjs.map +0 -1
  169. package/dist/chunk-UNI3POHU.cjs.map +0 -1
  170. package/dist/chunk-YXWGSDK4.cjs.map +0 -1
  171. package/dist/chunk-YZJL6WGP.js.map +0 -1
  172. package/dist/utils/badge-palette.d.ts +0 -18
  173. package/dist/utils/badge-palette.d.ts.map +0 -1
  174. package/src/utils/.badge-palette.md +0 -2
  175. package/src/utils/badge-palette.ts +0 -38
  176. /package/dist/{chunk-X3LC6R37.js.map → chunk-32P6KUZP.js.map} +0 -0
  177. /package/dist/{chunk-U4UNC3RP.js.map → chunk-5BUEB2WQ.js.map} +0 -0
  178. /package/dist/{chunk-6AFJQOT2.js.map → chunk-65IVNHBS.js.map} +0 -0
  179. /package/dist/{chunk-S6WBBSII.js.map → chunk-76HB456V.js.map} +0 -0
  180. /package/dist/{chunk-HLZKMYST.js.map → chunk-7ZDPJ6SW.js.map} +0 -0
  181. /package/dist/{chunk-MB4IEWLH.js.map → chunk-BS6ASI3D.js.map} +0 -0
  182. /package/dist/{chunk-LLSX5T7X.js.map → chunk-CIRD5P4U.js.map} +0 -0
  183. /package/dist/{chunk-YQCA4ZEJ.js.map → chunk-CMUNJZWN.js.map} +0 -0
  184. /package/dist/{chunk-WBZ4HP7D.js.map → chunk-J6ATJUEE.js.map} +0 -0
  185. /package/dist/{chunk-LCMXGM2P.js.map → chunk-LUBIWC3N.js.map} +0 -0
  186. /package/dist/{chunk-ZRCWXJDW.js.map → chunk-LZB2UZJY.js.map} +0 -0
  187. /package/dist/{chunk-JWXEEZKD.js.map → chunk-MIOE7FYN.js.map} +0 -0
  188. /package/dist/{chunk-K43T7N7O.js.map → chunk-NBM7ZB6T.js.map} +0 -0
  189. /package/dist/{chunk-XQ4II4BK.js.map → chunk-SOUGXQJE.js.map} +0 -0
  190. /package/dist/{chunk-JVLLA3Z7.js.map → chunk-WYELOUP4.js.map} +0 -0
  191. /package/dist/{chunk-F2KBCLUG.js.map → chunk-X5NN4NJM.js.map} +0 -0
  192. /package/dist/{chunk-BVQEU5JB.js.map → chunk-ZOMGXH7C.js.map} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flamingo-stack/openframe-frontend-core",
3
- "version": "0.0.628",
3
+ "version": "0.0.629-2171.6182.1",
4
4
  "description": "Shared design system and components for all Flamingo platforms",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -0,0 +1,57 @@
1
+ /**
2
+ * `ChangelogManager` tags: with `tagOptions` each entry's header shows its tag's
3
+ * label as a badge, a new entry starts on the first option, and the field labels
4
+ * follow the caller's wording. Without `tagOptions` nothing changes.
5
+ */
6
+
7
+ import { fireEvent, render, screen } from '@testing-library/react';
8
+ import { describe, expect, it, vi } from 'vitest';
9
+ import { ChangelogManager } from '../changelog-manager';
10
+
11
+ const tagOptions = [
12
+ { value: 'us', label: 'Us' },
13
+ { value: 'prospect', label: 'Prospect' },
14
+ ];
15
+
16
+ describe('ChangelogManager tags', () => {
17
+ it('shows the tag label in the entry header', () => {
18
+ render(
19
+ <ChangelogManager
20
+ title="Next steps"
21
+ entries={[{ title: 'Send pricing', description: '', tag: 'prospect' }]}
22
+ onChange={() => {}}
23
+ tagOptions={tagOptions}
24
+ />,
25
+ );
26
+ expect(screen.getByText('Send pricing')).toBeTruthy();
27
+ expect(screen.getByText('Prospect')).toBeTruthy();
28
+ });
29
+
30
+ it('starts a new entry on the first tag option', () => {
31
+ const onChange = vi.fn();
32
+ render(<ChangelogManager title="Next steps" entries={[]} onChange={onChange} tagOptions={tagOptions} />);
33
+ fireEvent.click(screen.getByRole('button', { name: /Add Entry/ }));
34
+ expect(onChange).toHaveBeenCalledWith([{ title: '', description: '', tag: 'us' }]);
35
+ });
36
+
37
+ it('uses the caller field labels and adds no tag without options', () => {
38
+ const onChange = vi.fn();
39
+ render(
40
+ <ChangelogManager
41
+ title="Objections"
42
+ entries={[{ title: 'Too expensive', description: 'Offered annual pricing' }]}
43
+ onChange={onChange}
44
+ titleLabel="Objection"
45
+ descriptionLabel="Our response"
46
+ expandAll
47
+ />,
48
+ );
49
+ expect(screen.getByText('Objection *')).toBeTruthy();
50
+ expect(screen.getByText('Our response')).toBeTruthy();
51
+ fireEvent.click(screen.getByRole('button', { name: /Add Entry/ }));
52
+ expect(onChange).toHaveBeenCalledWith([
53
+ { title: 'Too expensive', description: 'Offered annual pricing' },
54
+ { title: '', description: '' },
55
+ ]);
56
+ });
57
+ });
@@ -3,7 +3,23 @@
3
3
  import { Trash2, Plus, ChevronDown, ChevronUp, Eye, EyeOff } from 'lucide-react';
4
4
  import { useState } from 'react';
5
5
  import type { ChangelogEntry } from '../../types/product-release';
6
- import { Button, Input, Textarea, Label } from '../ui';
6
+ import {
7
+ Button,
8
+ Input,
9
+ Label,
10
+ Select,
11
+ SelectContent,
12
+ SelectItem,
13
+ SelectTrigger,
14
+ SelectValue,
15
+ StatusBadge,
16
+ Textarea,
17
+ } from '../ui';
18
+
19
+ export interface ChangelogTagOption {
20
+ value: string;
21
+ label: string;
22
+ }
7
23
 
8
24
  interface ChangelogManagerProps {
9
25
  title: string;
@@ -18,6 +34,18 @@ interface ChangelogManagerProps {
18
34
  * — leave undefined for product releases so they keep their existing UX.
19
35
  */
20
36
  showVisibilityToggle?: boolean;
37
+ /**
38
+ * When given, each entry gets a tag select (stored as `entry.tag`) and its header
39
+ * shows the chosen tag as a badge. New entries start on the first option.
40
+ */
41
+ tagOptions?: readonly ChangelogTagOption[];
42
+ /** Label of the tag select. Default "Tag". */
43
+ tagLabel?: string;
44
+ /** Entry field labels and placeholders. Defaults are the product-release wording. */
45
+ titleLabel?: string;
46
+ titlePlaceholder?: string;
47
+ descriptionLabel?: string;
48
+ descriptionPlaceholder?: string;
21
49
  }
22
50
 
23
51
  export function ChangelogManager({
@@ -27,7 +55,14 @@ export function ChangelogManager({
27
55
  className = '',
28
56
  expandAll = false,
29
57
  showVisibilityToggle = false,
58
+ tagOptions,
59
+ tagLabel = 'Tag',
60
+ titleLabel = 'Title',
61
+ titlePlaceholder = 'e.g., New dark mode theme support',
62
+ descriptionLabel = 'Description',
63
+ descriptionPlaceholder = 'Detailed explanation of the change...',
30
64
  }: ChangelogManagerProps) {
65
+ const tagLabelOf = (value?: string) => tagOptions?.find(o => o.value === value)?.label;
31
66
  const entryCount = entries.length;
32
67
  const allExpanded = () => new Set(Array.from({ length: entryCount }, (_, i) => i));
33
68
 
@@ -55,6 +90,7 @@ export function ChangelogManager({
55
90
  title: '',
56
91
  description: '',
57
92
  ...(showVisibilityToggle && { visibility: 'public' as const }),
93
+ ...(tagOptions?.length && { tag: tagOptions[0].value }),
58
94
  };
59
95
  onChange([...entries, newEntry]);
60
96
  // Expand the newly added entry
@@ -141,6 +177,15 @@ export function ChangelogManager({
141
177
  )}
142
178
  </div>
143
179
 
180
+ {tagOptions && tagLabelOf(entry.tag) && (
181
+ <StatusBadge
182
+ variant="button"
183
+ singleLine
184
+ text={tagLabelOf(entry.tag) as string}
185
+ className="shrink-0 whitespace-nowrap"
186
+ />
187
+ )}
188
+
144
189
  {showVisibilityToggle && (
145
190
  <Button
146
191
  type="button"
@@ -174,9 +219,9 @@ export function ChangelogManager({
174
219
  <div className="space-y-3 border-t border-ods-border px-3 pb-3 pt-3">
175
220
  {/* Title */}
176
221
  <div className="space-y-1">
177
- <Label className="text-ods-text-secondary">Title *</Label>
222
+ <Label className="text-ods-text-secondary">{titleLabel} *</Label>
178
223
  <Input
179
- placeholder="e.g., New dark mode theme support"
224
+ placeholder={titlePlaceholder}
180
225
  value={entry.title}
181
226
  onChange={e => updateEntry(index, 'title', e.target.value)}
182
227
  onKeyDown={e => e.key === 'Enter' && e.preventDefault()}
@@ -186,15 +231,34 @@ export function ChangelogManager({
186
231
 
187
232
  {/* Description */}
188
233
  <div className="space-y-1">
189
- <Label className="text-ods-text-secondary">Description</Label>
234
+ <Label className="text-ods-text-secondary">{descriptionLabel}</Label>
190
235
  <Textarea
191
- placeholder="Detailed explanation of the change..."
236
+ placeholder={descriptionPlaceholder}
192
237
  value={entry.description || ''}
193
238
  onChange={e => updateEntry(index, 'description', e.target.value)}
194
239
  rows={2}
195
240
  className="bg-ods-bg"
196
241
  />
197
242
  </div>
243
+
244
+ {/* Tag */}
245
+ {tagOptions && (
246
+ <div className="space-y-1">
247
+ <Label className="text-ods-text-secondary">{tagLabel}</Label>
248
+ <Select value={entry.tag ?? ''} onValueChange={value => updateEntry(index, 'tag', value)}>
249
+ <SelectTrigger className="bg-ods-bg">
250
+ <SelectValue placeholder={tagLabel} />
251
+ </SelectTrigger>
252
+ <SelectContent>
253
+ {tagOptions.map(option => (
254
+ <SelectItem key={option.value} value={option.value}>
255
+ {option.label}
256
+ </SelectItem>
257
+ ))}
258
+ </SelectContent>
259
+ </Select>
260
+ </div>
261
+ )}
198
262
  </div>
199
263
  )}
200
264
  </div>
@@ -1,2 +1,2 @@
1
- <!-- source-hash: 7d5aadc1cc3d528b8ddb57fc63628042 -->
2
- THE department badge: PaletteBadge in the department's stored ODS palette colour (departments.color, a BADGE_PALETTE key picked with pickBadgePaletteColor on creation).
1
+ <!-- source-hash: dfe20cd7ef027c93962000f5d153468c -->
2
+ THE department badge: PaletteBadge in the department's stored palette colour (departments.color, picked at random with pickPresetColor on creation).
@@ -1,2 +1,2 @@
1
- <!-- source-hash: e631c25c4d08ffc91fe9f0ded1af8e52 -->
2
- PaletteBadge: the standard StatusBadge in a BADGE_PALETTE colour scheme (ODS tokens only). Anything outside the palette, a hex included, renders the unfilled default badge.
1
+ <!-- source-hash: 8197c1b05f1f83fd9acaa4ee9318ca11 -->
2
+ PaletteBadge: the standard StatusBadge stamp filled with a COLOR_PRESETS colour (or custom hex) and a contrast-picked label. The shared badge for any row whose colour is data. An unknown or missing colour renders the unfilled default badge; the neutral preset fills grey only when named.
@@ -1,4 +1,4 @@
1
- <!-- source-hash: fcab461ab76111f1dcac54b7b297775a -->
1
+ <!-- source-hash: 0935f3d6a806783b496a5b5cb096c40a -->
2
2
  Reusable status badge component implementing the OpenFrame Design System (ODS) badge specifications, with support for multiple color schemes, density variants, and a dedicated OpenFrame generation mode.
3
3
 
4
4
  ## Key Components
@@ -9,7 +9,7 @@ A polymorphic `<span>`-based badge component built with `class-variance-authorit
9
9
  ### `statusBadgeVariants`
10
10
  CVA variant configuration exposing two axes:
11
11
  - **`variant`**: `card` (standalone, full ODS caption composite) | `button` (dense inline stamp, 10px scale)
12
- - **`colorScheme`**: `cyan` | `pink` | `yellow` | `green` | `purple` | `cyanSoft` | `pinkSoft` | `openYellow` | `red` | `success` | `error` | `warning` | `default` | `accentBorder` | `errorBorder` | `whiteBorder`. Ten of them form `BADGE_PALETTE` (`utils/badge-palette`), the ODS colours a department badge picks from.
12
+ - **`colorScheme`**: `cyan` | `pink` | `yellow` | `green` | `purple` | `success` | `error` | `warning` | `default` | `accentBorder` | `errorBorder` | `whiteBorder`
13
13
 
14
14
  ### `genBadgeBgOpacity(gen: number): number`
15
15
  Returns the accent background opacity (%) for a given OpenFrame generation tier. Gen 1 is strongest (30%), fading progressively for later generations.
@@ -1,49 +1,47 @@
1
1
  import { render, screen } from '@testing-library/react';
2
2
  import { describe, expect, it } from 'vitest';
3
- import { BADGE_PALETTE, pickBadgePaletteColor } from '../../../utils/badge-palette';
3
+ import { COLOR_PRESETS, pickPresetColor } from '../../../utils/color-presets';
4
4
  import { DepartmentBadge } from '../department-badge';
5
5
  import { PaletteBadge } from '../palette-badge';
6
- import { statusBadgeVariants } from '../status-badge';
7
6
 
8
7
  describe('PaletteBadge', () => {
9
- it('renders a palette key as its ODS colour scheme, with no inline colour', () => {
10
- render(<PaletteBadge text="Teal" color="cyanSoft" />);
11
- const badge = screen.getByText('Teal');
12
- expect(badge).toHaveClass('bg-ods-flamingo-cyan-secondary', 'text-ods-flamingo-cyan');
13
- expect(badge).not.toHaveAttribute('style');
8
+ it('fills the badge with the palette colour a key names', () => {
9
+ render(<PaletteBadge text="Teal" color="teal" />);
10
+ expect(screen.getByText('Teal')).toHaveStyle({ backgroundColor: 'rgb(77, 182, 172)' });
14
11
  });
15
12
 
16
- it('renders the unfilled default badge for anything outside the palette, a hex included', () => {
17
- const { rerender } = render(<PaletteBadge text="Other" color="#ff0000" />);
18
- expect(screen.getByText('Other')).toHaveClass('bg-ods-bg-surface');
13
+ it('renders the unfilled default badge for an unknown or missing colour', () => {
14
+ const { rerender } = render(<PaletteBadge text="Other" color="not-a-colour" />);
15
+ expect(screen.getByText('Other')).not.toHaveAttribute('style');
19
16
  rerender(<PaletteBadge text="Other" color={null} />);
20
- expect(screen.getByText('Other')).toHaveClass('bg-ods-bg-surface');
21
17
  expect(screen.getByText('Other')).not.toHaveAttribute('style');
22
18
  });
23
19
 
24
- it('gives every palette key a distinct ODS colour scheme', () => {
25
- const classes = BADGE_PALETTE.map(key => statusBadgeVariants({ colorScheme: key, variant: 'button' }));
26
- expect(new Set(classes).size).toBe(BADGE_PALETTE.length);
27
- for (const c of classes) expect(c).not.toMatch(/#[0-9a-f]{3,6}/i);
20
+ it('fills the neutral preset like any other key', () => {
21
+ render(<PaletteBadge text="Grey" color="neutral" />);
22
+ expect(screen.getByText('Grey')).toHaveStyle({ backgroundColor: 'rgb(176, 176, 176)' });
28
23
  });
29
24
  });
30
25
 
31
26
  describe('DepartmentBadge', () => {
32
27
  it("uses the department's stored palette colour, and the empty label without a department", () => {
33
- const { rerender } = render(<DepartmentBadge department={{ name: 'Marketing', color: 'pink' }} />);
34
- expect(screen.getByText('Marketing')).toHaveClass('bg-ods-flamingo-pink');
28
+ const { rerender } = render(<DepartmentBadge department={{ name: 'Marketing', color: 'sky' }} />);
29
+ expect(screen.getByText('Marketing')).toHaveStyle({ backgroundColor: 'rgb(79, 195, 247)' });
35
30
  rerender(<DepartmentBadge department={null} emptyLabel="Unassigned" />);
36
- expect(screen.getByText('Unassigned')).toHaveClass('bg-ods-bg-surface');
31
+ expect(screen.getByText('Unassigned')).not.toHaveStyle({ backgroundColor: 'rgb(79, 195, 247)' });
37
32
  });
38
33
  });
39
34
 
40
- describe('pickBadgePaletteColor', () => {
41
- it('picks a palette key that is not taken', () => {
42
- const [free, ...taken] = BADGE_PALETTE;
43
- expect(pickBadgePaletteColor({ avoid: taken, random: () => 0.99 })).toBe(free);
35
+ describe('pickPresetColor', () => {
36
+ it('picks a palette key that is not taken, and never neutral', () => {
37
+ const keys = COLOR_PRESETS.map(preset => preset.key);
38
+ const taken = keys.filter(key => key !== 'teal' && key !== 'neutral');
39
+ for (let run = 0; run < 10; run++) expect(pickPresetColor({ avoid: taken })).toBe('teal');
44
40
  });
45
41
 
46
42
  it('repeats a colour only once every colour is taken', () => {
47
- expect(BADGE_PALETTE).toContain(pickBadgePaletteColor({ avoid: [...BADGE_PALETTE], random: () => 0.5 }));
43
+ const everything = COLOR_PRESETS.map(preset => preset.key);
44
+ expect(everything).toContain(pickPresetColor({ avoid: everything }));
45
+ expect(pickPresetColor({ avoid: everything })).not.toBe('neutral');
48
46
  });
49
47
  });
@@ -3,6 +3,7 @@
3
3
  import { useState } from 'react';
4
4
  import { HexColorPicker } from 'react-colorful';
5
5
  import { cn } from '../../utils/cn';
6
+ import { COLOR_PRESETS, type ColorPreset } from '../../utils/color-presets';
6
7
  import { HEX_PATTERN, hexToRgb, hslToRgb, rgbToHex, rgbToHsl } from '../../utils/ods-color-utils';
7
8
  import { Chevron02DownIcon } from '../icons-v2-generated/arrows/chevron-02-down-icon';
8
9
  import { Popover, PopoverContent, PopoverTrigger } from '../popover';
@@ -11,27 +12,10 @@ import { ColorSwatch } from './color-swatch';
11
12
  import { Input } from './input';
12
13
  import { InputTrigger } from './input-trigger';
13
14
 
14
- export interface ColorPreset {
15
- key: string;
16
- label: string;
17
- color: string;
18
- }
19
-
20
- // Ticket-status palette.
21
- export const TICKET_STATUS_COLOR_PRESETS: readonly ColorPreset[] = [
22
- { key: 'green', label: 'Green', color: '#5ea62e' },
23
- { key: 'lime', label: 'Lime', color: '#8bc34a' },
24
- { key: 'teal', label: 'Teal', color: '#4db6ac' },
25
- { key: 'sky', label: 'Sky', color: '#4fc3f7' },
26
- { key: 'periwinkle', label: 'Periwinkle', color: '#7e9cd8' },
27
- { key: 'lavender', label: 'Lavender', color: '#b39ddb' },
28
- { key: 'yellow', label: 'Yellow', color: '#e1b32f' },
29
- { key: 'sand', label: 'Sand', color: '#f0c674' },
30
- { key: 'peach', label: 'Peach', color: '#f39c7a' },
31
- { key: 'red', label: 'Red', color: '#f36666' },
32
- { key: 'pink', label: 'Pink', color: '#e988a8' },
33
- { key: 'neutral', label: 'Neutral', color: '#b0b0b0' },
34
- ];
15
+ export type { ColorPreset } from '../../utils/color-presets';
16
+ export { COLOR_PRESETS } from '../../utils/color-presets';
17
+ /** The palette ticket statuses pick from: the shared `COLOR_PRESETS`. */
18
+ export const TICKET_STATUS_COLOR_PRESETS = COLOR_PRESETS;
35
19
 
36
20
  export const CUSTOM_PRESET_KEY = 'custom';
37
21
  export const DEFAULT_CUSTOM_STATUS_COLOR = '#888888';
@@ -14,9 +14,9 @@ export interface DepartmentBadgeProps {
14
14
 
15
15
  /**
16
16
  * THE department badge: the shared `PaletteBadge` in the department's own colour.
17
- * The colour is data, `departments.color`, a `BADGE_PALETTE` key picked at random
18
- * (`pickBadgePaletteColor`) when the department is created, so no department or
19
- * colour is listed in code, and every colour is an ODS token.
17
+ * The colour is data, `departments.color`, a `COLOR_PRESETS` key picked at random
18
+ * (`pickPresetColor`) when the department is created, so no department or colour
19
+ * is listed in code.
20
20
  */
21
21
  export function DepartmentBadge({
22
22
  department,
@@ -1,13 +1,15 @@
1
1
  'use client';
2
2
 
3
- import { isBadgePaletteKey } from '../../utils/badge-palette';
3
+ import { colorPreset } from '../../utils/color-presets';
4
+ import { HEX_PATTERN, getReadableTextColor } from '../../utils/ods-color-utils';
4
5
  import { StatusBadge, type StatusBadgeProps } from './status-badge';
5
6
 
6
7
  export interface PaletteBadgeProps {
7
8
  text: string;
8
9
  /**
9
- * A `BADGE_PALETTE` key. Anything else (unknown, missing, a hex) renders the
10
- * standard unfilled `default` badge: colours come only from the ODS palette.
10
+ * A `COLOR_PRESETS` key (the `neutral` key included) or a `#rrggbb` custom colour.
11
+ * Unknown or missing renders the standard unfilled `default` badge, not the
12
+ * `neutral` preset's fill, so an uncoloured row looks like every other plain badge.
11
13
  */
12
14
  color?: string | null;
13
15
  className?: string;
@@ -16,19 +18,22 @@ export interface PaletteBadgeProps {
16
18
  }
17
19
 
18
20
  /**
19
- * THE badge for anything that carries its own colour as data (a department). It
20
- * is the standard `StatusBadge` in one of the ODS palette colour schemes, so it
21
- * matches the size, weight, casing and height of every other badge and uses ODS
22
- * tokens only.
21
+ * THE badge for anything that carries its own colour from the shared palette
22
+ * (`COLOR_PRESETS`): a department, a custom ticket status, any row whose colour
23
+ * is data. It is the standard `StatusBadge` stamp filled with the colour, with the
24
+ * label colour picked for contrast, so it matches the size, weight, casing and
25
+ * height of every other badge.
23
26
  */
24
27
  export function PaletteBadge({ text, color, className, variant = 'button' }: PaletteBadgeProps) {
28
+ const fill = colorPreset(color)?.color ?? (color && HEX_PATTERN.test(color) ? color : null);
25
29
  return (
26
30
  <StatusBadge
27
31
  text={text}
28
- colorScheme={isBadgePaletteKey(color) ? color : 'default'}
32
+ colorScheme="default"
29
33
  variant={variant}
30
34
  singleLine
31
35
  className={className}
36
+ style={fill ? { backgroundColor: fill, color: getReadableTextColor(fill) } : undefined}
32
37
  />
33
38
  );
34
39
  }
@@ -26,11 +26,6 @@ const statusBadgeVariants = cva('inline-flex items-center justify-center rounded
26
26
  yellow: 'border border-ods-border bg-ods-accent text-ods-text-on-accent',
27
27
  green: 'bg-ods-success text-ods-text-on-accent',
28
28
  purple: 'bg-ods-flamingo-pink text-ods-text-on-accent',
29
- // Solid and soft ODS palette fills (`BADGE_PALETTE`): tokens only, no hex.
30
- cyanSoft: 'bg-ods-flamingo-cyan-secondary text-ods-flamingo-cyan',
31
- pinkSoft: 'bg-ods-flamingo-pink-secondary text-ods-flamingo-pink',
32
- openYellow: 'bg-ods-open-yellow text-ods-text-on-accent',
33
- red: 'bg-ods-error text-ods-text-on-accent',
34
29
  success: 'bg-ods-success-secondary text-ods-success',
35
30
  error: 'bg-ods-error-secondary text-ods-error',
36
31
  warning: 'bg-ods-warning-secondary text-ods-warning',
@@ -20,7 +20,7 @@ export interface Department {
20
20
  parent_department_id?: string | null;
21
21
  display_order: number;
22
22
  is_active: boolean;
23
- /** The department's badge colour: a `BADGE_PALETTE` key (an ODS colour scheme) picked at random (`pickBadgePaletteColor`) when the row is created. */
23
+ /** The department's badge colour: a `COLOR_PRESETS` key picked at random (`pickPresetColor`) when the row is created. */
24
24
  color: string | null;
25
25
  }
26
26
 
@@ -15,6 +15,11 @@ export interface ChangelogEntry {
15
15
  * because each entry can be marked internal — see investor-update-utils.ts.
16
16
  */
17
17
  visibility?: 'public' | 'internal';
18
+ /**
19
+ * Optional per-entry classification chosen from the manager's `tagOptions`
20
+ * (e.g. an owner, a priority, a severity). Product releases never set it.
21
+ */
22
+ tag?: string;
18
23
  }
19
24
 
20
25
  export interface ReleaseMedia {
@@ -0,0 +1,2 @@
1
+ <!-- source-hash: 3fa846627eee39788d04ef9cf369c84b -->
2
+ THE shared colour palette (COLOR_PRESETS) for data that carries its own colour, colorPreset(key) lookup, and pickPresetColor({ avoid }) for a random unused palette key on row creation.
@@ -0,0 +1,48 @@
1
+ /**
2
+ * THE colour palette for data that carries its own colour: ticket statuses picked
3
+ * in `ColorPresetSelect`, a department's badge, any future row with an identity
4
+ * colour. One list, so every coloured badge in the product reads from the same
5
+ * design-system swatches.
6
+ */
7
+
8
+ export interface ColorPreset {
9
+ key: string;
10
+ label: string;
11
+ color: string;
12
+ }
13
+
14
+ export const COLOR_PRESETS: readonly ColorPreset[] = [
15
+ { key: 'green', label: 'Green', color: '#5ea62e' },
16
+ { key: 'lime', label: 'Lime', color: '#8bc34a' },
17
+ { key: 'teal', label: 'Teal', color: '#4db6ac' },
18
+ { key: 'sky', label: 'Sky', color: '#4fc3f7' },
19
+ { key: 'periwinkle', label: 'Periwinkle', color: '#7e9cd8' },
20
+ { key: 'lavender', label: 'Lavender', color: '#b39ddb' },
21
+ { key: 'yellow', label: 'Yellow', color: '#e1b32f' },
22
+ { key: 'sand', label: 'Sand', color: '#f0c674' },
23
+ { key: 'peach', label: 'Peach', color: '#f39c7a' },
24
+ { key: 'red', label: 'Red', color: '#f36666' },
25
+ { key: 'pink', label: 'Pink', color: '#e988a8' },
26
+ { key: 'neutral', label: 'Neutral', color: '#b0b0b0' },
27
+ ];
28
+
29
+ /** The preset a key names, or `undefined`. */
30
+ export function colorPreset(key: string | null | undefined): ColorPreset | undefined {
31
+ return key ? COLOR_PRESETS.find(preset => preset.key === key) : undefined;
32
+ }
33
+
34
+ /**
35
+ * A random preset key for a new row that needs an identity colour. Prefers a
36
+ * preset nobody in `avoid` uses yet (neutral is never picked: it reads as "no
37
+ * colour"); once every colour is taken, any colour may repeat.
38
+ */
39
+ export function pickPresetColor({
40
+ avoid = [],
41
+ random = Math.random,
42
+ }: { avoid?: ReadonlyArray<string | null | undefined>; random?: () => number } = {}): string {
43
+ const colours = COLOR_PRESETS.filter(preset => preset.key !== 'neutral');
44
+ const used = new Set(avoid);
45
+ const free = colours.filter(preset => !used.has(preset.key));
46
+ const pool = free.length > 0 ? free : colours;
47
+ return pool[Math.floor(random() * pool.length) % pool.length].key;
48
+ }
@@ -391,5 +391,4 @@ export * from './ods-spacing';
391
391
  export * from './csv';
392
392
  // Social platform vocabulary, host table, link type, picker.
393
393
  export * from './social-platforms';
394
- // The ODS badge palette a row whose colour is data picks from (departments).
395
- export { BADGE_PALETTE, isBadgePaletteKey, pickBadgePaletteColor, type BadgePaletteKey } from './badge-palette';
394
+ export { COLOR_PRESETS, colorPreset, pickPresetColor, type ColorPreset } from './color-presets';