@flamingo-stack/openframe-frontend-core 0.0.627 → 0.0.628-snapshot.20260914045040
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/{chunk-RAPPN6MN.cjs → chunk-2MMEPNSX.cjs} +3 -3
- package/dist/{chunk-RAPPN6MN.cjs.map → chunk-2MMEPNSX.cjs.map} +1 -1
- package/dist/{chunk-HIZAMJPT.js → chunk-2MXKO5BN.js} +12 -12
- package/dist/{chunk-QCSWM3VU.cjs → chunk-2ZSGDKZI.cjs} +9 -9
- package/dist/{chunk-QCSWM3VU.cjs.map → chunk-2ZSGDKZI.cjs.map} +1 -1
- package/dist/{chunk-P7UT2YSC.cjs → chunk-3IXDZI3R.cjs} +3 -3
- package/dist/{chunk-P7UT2YSC.cjs.map → chunk-3IXDZI3R.cjs.map} +1 -1
- package/dist/{chunk-VUAEDAUN.cjs → chunk-3ZY4CE7N.cjs} +6 -6
- package/dist/{chunk-VUAEDAUN.cjs.map → chunk-3ZY4CE7N.cjs.map} +1 -1
- package/dist/{chunk-PKSH6PAK.js → chunk-4NMVDTHA.js} +8 -10
- package/dist/{chunk-PKSH6PAK.js.map → chunk-4NMVDTHA.js.map} +1 -1
- package/dist/{chunk-CAQ5MNLJ.js → chunk-4VPCIREO.js} +3 -3
- package/dist/{chunk-4E3UZZ2J.cjs → chunk-5JAB5LVO.cjs} +34 -34
- package/dist/{chunk-4E3UZZ2J.cjs.map → chunk-5JAB5LVO.cjs.map} +1 -1
- package/dist/{chunk-JRYS4VMV.js → chunk-5LIDR7HL.js} +79 -4
- package/dist/{chunk-JRYS4VMV.js.map → chunk-5LIDR7HL.js.map} +1 -1
- package/dist/{chunk-G46NJNTL.cjs → chunk-5OMBSMRI.cjs} +26 -28
- package/dist/chunk-5OMBSMRI.cjs.map +1 -0
- package/dist/{chunk-SLT5C3PQ.cjs → chunk-7P6M5G3W.cjs} +25 -25
- package/dist/{chunk-SLT5C3PQ.cjs.map → chunk-7P6M5G3W.cjs.map} +1 -1
- package/dist/{chunk-ZOMGXH7C.js → chunk-BVQEU5JB.js} +2 -2
- package/dist/{chunk-VOZZQ6HQ.cjs → chunk-CCWI3622.cjs} +4 -4
- package/dist/{chunk-VOZZQ6HQ.cjs.map → chunk-CCWI3622.cjs.map} +1 -1
- package/dist/{chunk-BJGAFPG5.cjs → chunk-CKMJQ46H.cjs} +42 -42
- package/dist/{chunk-BJGAFPG5.cjs.map → chunk-CKMJQ46H.cjs.map} +1 -1
- package/dist/{chunk-OAXASIVG.cjs → chunk-CV2SESZT.cjs} +7 -7
- package/dist/{chunk-OAXASIVG.cjs.map → chunk-CV2SESZT.cjs.map} +1 -1
- package/dist/{chunk-Y3MIFC5M.js → chunk-D5CKXMMC.js} +4 -4
- package/dist/{chunk-ZGZ7YAJH.js → chunk-DGY4NVIB.js} +8 -10
- package/dist/{chunk-ZGZ7YAJH.js.map → chunk-DGY4NVIB.js.map} +1 -1
- package/dist/{chunk-4SXZT7JP.cjs → chunk-DLHGJYYA.cjs} +83 -83
- package/dist/{chunk-4SXZT7JP.cjs.map → chunk-DLHGJYYA.cjs.map} +1 -1
- package/dist/{chunk-4E7XCEV3.cjs → chunk-EHAYNUOL.cjs} +2 -77
- package/dist/chunk-EHAYNUOL.cjs.map +1 -0
- package/dist/{chunk-X5NN4NJM.js → chunk-F2KBCLUG.js} +2 -2
- package/dist/{chunk-USIRWQJ3.js → chunk-FKBM6U43.js} +1 -76
- package/dist/{chunk-USIRWQJ3.js.map → chunk-FKBM6U43.js.map} +1 -1
- package/dist/{chunk-CK2CPZXB.js → chunk-GR3WOOM7.js} +12 -12
- package/dist/{chunk-GQ7267OV.cjs → chunk-HVWNOPDV.cjs} +5 -5
- package/dist/{chunk-GQ7267OV.cjs.map → chunk-HVWNOPDV.cjs.map} +1 -1
- package/dist/{chunk-QIVX7F3N.cjs → chunk-JJUV7Z4L.cjs} +27 -27
- package/dist/{chunk-QIVX7F3N.cjs.map → chunk-JJUV7Z4L.cjs.map} +1 -1
- package/dist/{chunk-53ARMJHM.cjs → chunk-JONR3BDJ.cjs} +37 -37
- package/dist/{chunk-53ARMJHM.cjs.map → chunk-JONR3BDJ.cjs.map} +1 -1
- package/dist/{chunk-ZCQVUIPH.cjs → chunk-K7EJ7HYJ.cjs} +18 -18
- package/dist/{chunk-ZCQVUIPH.cjs.map → chunk-K7EJ7HYJ.cjs.map} +1 -1
- package/dist/{chunk-VZQ3VVFH.cjs → chunk-KO52PXL4.cjs} +20 -22
- package/dist/chunk-KO52PXL4.cjs.map +1 -0
- package/dist/{chunk-BC726XIQ.cjs → chunk-LHYRLL64.cjs} +47 -49
- package/dist/chunk-LHYRLL64.cjs.map +1 -0
- package/dist/{chunk-4PIHIFJM.js → chunk-LQLL4S4V.js} +4 -4
- package/dist/{chunk-KXDYBRRR.js → chunk-MOB5AA3X.js} +7 -7
- package/dist/{chunk-DH3YH3TV.js → chunk-MTLDYBXK.js} +8 -8
- package/dist/{chunk-L5FEAOGJ.js → chunk-ON7663OW.js} +354 -8
- package/dist/chunk-ON7663OW.js.map +1 -0
- package/dist/{chunk-55X46LKR.cjs → chunk-OQHFHKUG.cjs} +100 -450
- package/dist/chunk-OQHFHKUG.cjs.map +1 -0
- package/dist/{chunk-WZ6CUZMM.js → chunk-OXTV63QO.js} +4 -4
- package/dist/{chunk-NLADJ4IX.js → chunk-PFBMVQ5R.js} +6 -6
- package/dist/{chunk-5E55S5SI.js → chunk-PJZYJDR7.js} +4 -4
- package/dist/{chunk-PTP5LSYM.js → chunk-QGWBMPQY.js} +61 -22
- package/dist/chunk-QGWBMPQY.js.map +1 -0
- package/dist/{chunk-2J7EFH4V.js → chunk-QS2QCXBH.js} +30 -380
- package/dist/chunk-QS2QCXBH.js.map +1 -0
- package/dist/{chunk-76HB456V.js → chunk-S6WBBSII.js} +5 -5
- package/dist/{chunk-G47XRVZA.js → chunk-SCPJ53CM.js} +3 -3
- package/dist/{chunk-25UWKNII.js → chunk-T46STYS2.js} +8 -10
- package/dist/{chunk-25UWKNII.js.map → chunk-T46STYS2.js.map} +1 -1
- package/dist/{chunk-6I3KNDBF.cjs → chunk-U7TTQV4N.cjs} +3 -3
- package/dist/{chunk-6I3KNDBF.cjs.map → chunk-U7TTQV4N.cjs.map} +1 -1
- package/dist/{chunk-ZYDNPUSH.cjs → chunk-UNI3POHU.cjs} +625 -279
- package/dist/chunk-UNI3POHU.cjs.map +1 -0
- package/dist/{chunk-N6XNJX25.cjs → chunk-W523NIJ6.cjs} +15 -15
- package/dist/{chunk-N6XNJX25.cjs.map → chunk-W523NIJ6.cjs.map} +1 -1
- package/dist/{chunk-J6ATJUEE.js → chunk-WBZ4HP7D.js} +4 -4
- package/dist/{chunk-R3SJ6PMI.cjs → chunk-WR67VM2J.cjs} +463 -424
- package/dist/chunk-WR67VM2J.cjs.map +1 -0
- package/dist/{chunk-32P6KUZP.js → chunk-X3LC6R37.js} +2 -2
- package/dist/{chunk-FR6EDA3P.cjs → chunk-XNC37UQP.cjs} +105 -105
- package/dist/{chunk-FR6EDA3P.cjs.map → chunk-XNC37UQP.cjs.map} +1 -1
- package/dist/{chunk-CMUNJZWN.js → chunk-YQCA4ZEJ.js} +2 -2
- package/dist/{chunk-ZI27ALYX.cjs → chunk-YXWGSDK4.cjs} +80 -5
- package/dist/chunk-YXWGSDK4.cjs.map +1 -0
- package/dist/components/case-studies/index.cjs +14 -14
- package/dist/components/case-studies/index.js +8 -8
- package/dist/components/chat/index.cjs +5 -5
- package/dist/components/chat/index.js +4 -4
- package/dist/components/contact/index.cjs +9 -9
- package/dist/components/contact/index.js +8 -8
- package/dist/components/docs/index.cjs +12 -12
- package/dist/components/docs/index.js +11 -11
- package/dist/components/embeds/index.cjs +9 -9
- package/dist/components/embeds/index.js +8 -8
- package/dist/components/faq/index.cjs +10 -10
- package/dist/components/faq/index.js +9 -9
- package/dist/components/features/changelog-manager.d.ts +17 -1
- package/dist/components/features/changelog-manager.d.ts.map +1 -1
- package/dist/components/features/index.cjs +8 -8
- package/dist/components/features/index.js +7 -7
- package/dist/components/help-center-pages/index.cjs +31 -31
- package/dist/components/help-center-pages/index.js +22 -22
- package/dist/components/index.cjs +69 -71
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +24 -26
- package/dist/components/index.js.map +1 -1
- package/dist/components/meeting-scheduler/index.cjs +49 -49
- package/dist/components/meeting-scheduler/index.js +9 -9
- package/dist/components/navigation/index.cjs +11 -11
- package/dist/components/navigation/index.js +10 -10
- package/dist/components/onboarding-guides/index.cjs +12 -12
- package/dist/components/onboarding-guides/index.js +11 -11
- package/dist/components/related-content/index.cjs +6 -6
- package/dist/components/related-content/index.js +5 -5
- package/dist/components/tickets/index.cjs +13 -13
- package/dist/components/tickets/index.js +12 -12
- package/dist/components/ui/color-preset-select.d.ts +5 -4
- package/dist/components/ui/color-preset-select.d.ts.map +1 -1
- package/dist/components/ui/department-badge.d.ts +3 -3
- package/dist/components/ui/index.cjs +8 -10
- package/dist/components/ui/index.cjs.map +1 -1
- package/dist/components/ui/index.js +7 -9
- package/dist/components/ui/palette-badge.d.ts +6 -8
- package/dist/components/ui/palette-badge.d.ts.map +1 -1
- package/dist/components/ui/status-badge.d.ts +1 -1
- package/dist/components/ui/status-badge.d.ts.map +1 -1
- package/dist/hooks/index.cjs +5 -5
- package/dist/hooks/index.js +4 -4
- package/dist/index.cjs +18 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +46 -46
- package/dist/types/department.d.ts +1 -1
- package/dist/types/department.d.ts.map +1 -1
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/product-release.d.ts +5 -0
- package/dist/types/product-release.d.ts.map +1 -1
- package/dist/utils/badge-palette.d.ts +18 -0
- package/dist/utils/badge-palette.d.ts.map +1 -0
- package/dist/utils/index.cjs +21 -24
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +19 -22
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/features/__tests__/changelog-manager-tags.test.tsx +57 -0
- package/src/components/features/changelog-manager.tsx +69 -5
- package/src/components/ui/.department-badge.md +2 -2
- package/src/components/ui/.palette-badge.md +2 -2
- package/src/components/ui/.status-badge.md +2 -2
- package/src/components/ui/__tests__/department-badge.test.tsx +23 -21
- package/src/components/ui/color-preset-select.tsx +21 -5
- package/src/components/ui/department-badge.tsx +3 -3
- package/src/components/ui/palette-badge.tsx +8 -13
- package/src/components/ui/status-badge.tsx +5 -0
- package/src/types/department.ts +1 -1
- package/src/types/product-release.ts +5 -0
- package/src/utils/.badge-palette.md +2 -0
- package/src/utils/badge-palette.ts +38 -0
- package/src/utils/index.ts +2 -1
- package/dist/chunk-2J7EFH4V.js.map +0 -1
- package/dist/chunk-4E7XCEV3.cjs.map +0 -1
- package/dist/chunk-55X46LKR.cjs.map +0 -1
- package/dist/chunk-BC726XIQ.cjs.map +0 -1
- package/dist/chunk-G46NJNTL.cjs.map +0 -1
- package/dist/chunk-L5FEAOGJ.js.map +0 -1
- package/dist/chunk-PTP5LSYM.js.map +0 -1
- package/dist/chunk-R3SJ6PMI.cjs.map +0 -1
- package/dist/chunk-VZQ3VVFH.cjs.map +0 -1
- package/dist/chunk-ZI27ALYX.cjs.map +0 -1
- package/dist/chunk-ZYDNPUSH.cjs.map +0 -1
- package/dist/utils/color-presets.d.ts +0 -24
- package/dist/utils/color-presets.d.ts.map +0 -1
- package/src/utils/.color-presets.md +0 -2
- package/src/utils/color-presets.ts +0 -48
- /package/dist/{chunk-HIZAMJPT.js.map → chunk-2MXKO5BN.js.map} +0 -0
- /package/dist/{chunk-CAQ5MNLJ.js.map → chunk-4VPCIREO.js.map} +0 -0
- /package/dist/{chunk-ZOMGXH7C.js.map → chunk-BVQEU5JB.js.map} +0 -0
- /package/dist/{chunk-Y3MIFC5M.js.map → chunk-D5CKXMMC.js.map} +0 -0
- /package/dist/{chunk-X5NN4NJM.js.map → chunk-F2KBCLUG.js.map} +0 -0
- /package/dist/{chunk-CK2CPZXB.js.map → chunk-GR3WOOM7.js.map} +0 -0
- /package/dist/{chunk-4PIHIFJM.js.map → chunk-LQLL4S4V.js.map} +0 -0
- /package/dist/{chunk-KXDYBRRR.js.map → chunk-MOB5AA3X.js.map} +0 -0
- /package/dist/{chunk-DH3YH3TV.js.map → chunk-MTLDYBXK.js.map} +0 -0
- /package/dist/{chunk-WZ6CUZMM.js.map → chunk-OXTV63QO.js.map} +0 -0
- /package/dist/{chunk-NLADJ4IX.js.map → chunk-PFBMVQ5R.js.map} +0 -0
- /package/dist/{chunk-5E55S5SI.js.map → chunk-PJZYJDR7.js.map} +0 -0
- /package/dist/{chunk-76HB456V.js.map → chunk-S6WBBSII.js.map} +0 -0
- /package/dist/{chunk-G47XRVZA.js.map → chunk-SCPJ53CM.js.map} +0 -0
- /package/dist/{chunk-J6ATJUEE.js.map → chunk-WBZ4HP7D.js.map} +0 -0
- /package/dist/{chunk-32P6KUZP.js.map → chunk-X3LC6R37.js.map} +0 -0
- /package/dist/{chunk-CMUNJZWN.js.map → chunk-YQCA4ZEJ.js.map} +0 -0
package/package.json
CHANGED
|
@@ -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 {
|
|
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">
|
|
222
|
+
<Label className="text-ods-text-secondary">{titleLabel} *</Label>
|
|
178
223
|
<Input
|
|
179
|
-
placeholder=
|
|
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">
|
|
234
|
+
<Label className="text-ods-text-secondary">{descriptionLabel}</Label>
|
|
190
235
|
<Textarea
|
|
191
|
-
placeholder=
|
|
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:
|
|
2
|
-
THE department badge: PaletteBadge in the department's stored palette colour (departments.color,
|
|
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,2 +1,2 @@
|
|
|
1
|
-
<!-- source-hash:
|
|
2
|
-
PaletteBadge: the standard StatusBadge
|
|
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,4 +1,4 @@
|
|
|
1
|
-
<!-- source-hash:
|
|
1
|
+
<!-- source-hash: fcab461ab76111f1dcac54b7b297775a -->
|
|
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` | `success` | `error` | `warning` | `default` | `accentBorder` | `errorBorder` | `whiteBorder`
|
|
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.
|
|
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,47 +1,49 @@
|
|
|
1
1
|
import { render, screen } from '@testing-library/react';
|
|
2
2
|
import { describe, expect, it } from 'vitest';
|
|
3
|
-
import {
|
|
3
|
+
import { BADGE_PALETTE, pickBadgePaletteColor } from '../../../utils/badge-palette';
|
|
4
4
|
import { DepartmentBadge } from '../department-badge';
|
|
5
5
|
import { PaletteBadge } from '../palette-badge';
|
|
6
|
+
import { statusBadgeVariants } from '../status-badge';
|
|
6
7
|
|
|
7
8
|
describe('PaletteBadge', () => {
|
|
8
|
-
it('
|
|
9
|
-
render(<PaletteBadge text="Teal" color="
|
|
10
|
-
|
|
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');
|
|
11
14
|
});
|
|
12
15
|
|
|
13
|
-
it('renders the unfilled default badge for
|
|
14
|
-
const { rerender } = render(<PaletteBadge text="Other" color="
|
|
15
|
-
expect(screen.getByText('Other')).
|
|
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');
|
|
16
19
|
rerender(<PaletteBadge text="Other" color={null} />);
|
|
20
|
+
expect(screen.getByText('Other')).toHaveClass('bg-ods-bg-surface');
|
|
17
21
|
expect(screen.getByText('Other')).not.toHaveAttribute('style');
|
|
18
22
|
});
|
|
19
23
|
|
|
20
|
-
it('
|
|
21
|
-
|
|
22
|
-
expect(
|
|
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);
|
|
23
28
|
});
|
|
24
29
|
});
|
|
25
30
|
|
|
26
31
|
describe('DepartmentBadge', () => {
|
|
27
32
|
it("uses the department's stored palette colour, and the empty label without a department", () => {
|
|
28
|
-
const { rerender } = render(<DepartmentBadge department={{ name: 'Marketing', color: '
|
|
29
|
-
expect(screen.getByText('Marketing')).
|
|
33
|
+
const { rerender } = render(<DepartmentBadge department={{ name: 'Marketing', color: 'pink' }} />);
|
|
34
|
+
expect(screen.getByText('Marketing')).toHaveClass('bg-ods-flamingo-pink');
|
|
30
35
|
rerender(<DepartmentBadge department={null} emptyLabel="Unassigned" />);
|
|
31
|
-
expect(screen.getByText('Unassigned')).
|
|
36
|
+
expect(screen.getByText('Unassigned')).toHaveClass('bg-ods-bg-surface');
|
|
32
37
|
});
|
|
33
38
|
});
|
|
34
39
|
|
|
35
|
-
describe('
|
|
36
|
-
it('picks a palette key that is not taken
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
for (let run = 0; run < 10; run++) expect(pickPresetColor({ avoid: taken })).toBe('teal');
|
|
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);
|
|
40
44
|
});
|
|
41
45
|
|
|
42
46
|
it('repeats a colour only once every colour is taken', () => {
|
|
43
|
-
|
|
44
|
-
expect(everything).toContain(pickPresetColor({ avoid: everything }));
|
|
45
|
-
expect(pickPresetColor({ avoid: everything })).not.toBe('neutral');
|
|
47
|
+
expect(BADGE_PALETTE).toContain(pickBadgePaletteColor({ avoid: [...BADGE_PALETTE], random: () => 0.5 }));
|
|
46
48
|
});
|
|
47
49
|
});
|
|
@@ -3,7 +3,6 @@
|
|
|
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';
|
|
7
6
|
import { HEX_PATTERN, hexToRgb, hslToRgb, rgbToHex, rgbToHsl } from '../../utils/ods-color-utils';
|
|
8
7
|
import { Chevron02DownIcon } from '../icons-v2-generated/arrows/chevron-02-down-icon';
|
|
9
8
|
import { Popover, PopoverContent, PopoverTrigger } from '../popover';
|
|
@@ -12,10 +11,27 @@ import { ColorSwatch } from './color-swatch';
|
|
|
12
11
|
import { Input } from './input';
|
|
13
12
|
import { InputTrigger } from './input-trigger';
|
|
14
13
|
|
|
15
|
-
export
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
+
];
|
|
19
35
|
|
|
20
36
|
export const CUSTOM_PRESET_KEY = 'custom';
|
|
21
37
|
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 `
|
|
18
|
-
* (`
|
|
19
|
-
* is listed in code.
|
|
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.
|
|
20
20
|
*/
|
|
21
21
|
export function DepartmentBadge({
|
|
22
22
|
department,
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { HEX_PATTERN, getReadableTextColor } from '../../utils/ods-color-utils';
|
|
3
|
+
import { isBadgePaletteKey } from '../../utils/badge-palette';
|
|
5
4
|
import { StatusBadge, type StatusBadgeProps } from './status-badge';
|
|
6
5
|
|
|
7
6
|
export interface PaletteBadgeProps {
|
|
8
7
|
text: string;
|
|
9
8
|
/**
|
|
10
|
-
* A `
|
|
11
|
-
*
|
|
12
|
-
* `neutral` preset's fill, so an uncoloured row looks like every other plain badge.
|
|
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.
|
|
13
11
|
*/
|
|
14
12
|
color?: string | null;
|
|
15
13
|
className?: string;
|
|
@@ -18,22 +16,19 @@ export interface PaletteBadgeProps {
|
|
|
18
16
|
}
|
|
19
17
|
|
|
20
18
|
/**
|
|
21
|
-
* THE badge for anything that carries its own colour
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* height of every other badge.
|
|
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.
|
|
26
23
|
*/
|
|
27
24
|
export function PaletteBadge({ text, color, className, variant = 'button' }: PaletteBadgeProps) {
|
|
28
|
-
const fill = colorPreset(color)?.color ?? (color && HEX_PATTERN.test(color) ? color : null);
|
|
29
25
|
return (
|
|
30
26
|
<StatusBadge
|
|
31
27
|
text={text}
|
|
32
|
-
colorScheme=
|
|
28
|
+
colorScheme={isBadgePaletteKey(color) ? color : 'default'}
|
|
33
29
|
variant={variant}
|
|
34
30
|
singleLine
|
|
35
31
|
className={className}
|
|
36
|
-
style={fill ? { backgroundColor: fill, color: getReadableTextColor(fill) } : undefined}
|
|
37
32
|
/>
|
|
38
33
|
);
|
|
39
34
|
}
|
|
@@ -26,6 +26,11 @@ 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',
|
|
29
34
|
success: 'bg-ods-success-secondary text-ods-success',
|
|
30
35
|
error: 'bg-ods-error-secondary text-ods-error',
|
|
31
36
|
warning: 'bg-ods-warning-secondary text-ods-warning',
|
package/src/types/department.ts
CHANGED
|
@@ -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 `
|
|
23
|
+
/** The department's badge colour: a `BADGE_PALETTE` key (an ODS colour scheme) picked at random (`pickBadgePaletteColor`) 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,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ODS badge palette: the `StatusBadge` colour schemes a row whose colour is
|
|
3
|
+
* DATA picks from (a department today). Every entry is built from ODS tokens
|
|
4
|
+
* only, five brand and attention hues, each as a solid and a soft fill, so no
|
|
5
|
+
* two entries look alike. A stored colour is one of these KEYS, never a hex.
|
|
6
|
+
*/
|
|
7
|
+
export const BADGE_PALETTE = [
|
|
8
|
+
'cyan',
|
|
9
|
+
'cyanSoft',
|
|
10
|
+
'pink',
|
|
11
|
+
'pinkSoft',
|
|
12
|
+
'openYellow',
|
|
13
|
+
'warning',
|
|
14
|
+
'green',
|
|
15
|
+
'success',
|
|
16
|
+
'red',
|
|
17
|
+
'error',
|
|
18
|
+
] as const;
|
|
19
|
+
|
|
20
|
+
export type BadgePaletteKey = (typeof BADGE_PALETTE)[number];
|
|
21
|
+
|
|
22
|
+
export function isBadgePaletteKey(value: unknown): value is BadgePaletteKey {
|
|
23
|
+
return typeof value === 'string' && (BADGE_PALETTE as readonly string[]).includes(value);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* A random palette key for a new row, preferring one no row in `avoid` uses yet.
|
|
28
|
+
* Repeats a colour only once every colour is taken. `random` is injectable for tests.
|
|
29
|
+
*/
|
|
30
|
+
export function pickBadgePaletteColor({
|
|
31
|
+
avoid = [],
|
|
32
|
+
random = Math.random,
|
|
33
|
+
}: { avoid?: ReadonlyArray<string | null | undefined>; random?: () => number } = {}): BadgePaletteKey {
|
|
34
|
+
const used = new Set(avoid);
|
|
35
|
+
const free = BADGE_PALETTE.filter(key => !used.has(key));
|
|
36
|
+
const pool = free.length > 0 ? free : BADGE_PALETTE;
|
|
37
|
+
return pool[Math.floor(random() * pool.length) % pool.length];
|
|
38
|
+
}
|
package/src/utils/index.ts
CHANGED
|
@@ -391,4 +391,5 @@ 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
|
-
|
|
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';
|