@qoretechnologies/reqraft 0.10.13-pr.74.gccefa54 → 0.10.13

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 (125) hide show
  1. package/.claude/CLAUDE.md +8 -11
  2. package/dist/components/form/engine/FormEngine.d.ts +1 -1
  3. package/dist/helpers/common.d.ts +0 -5
  4. package/dist/helpers/common.d.ts.map +1 -1
  5. package/dist/helpers/common.js +1 -20
  6. package/dist/helpers/common.js.map +1 -1
  7. package/dist/index.d.ts +0 -5
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +1 -7
  10. package/dist/index.js.map +1 -1
  11. package/dist/providers/StorageProvider.d.ts +13 -0
  12. package/dist/providers/StorageProvider.d.ts.map +1 -1
  13. package/dist/providers/StorageProvider.js +29 -5
  14. package/dist/providers/StorageProvider.js.map +1 -1
  15. package/package.json +3 -3
  16. package/src/helpers/common.ts +0 -19
  17. package/src/hooks/useStorage/useStorage.stories.tsx +52 -0
  18. package/src/index.tsx +0 -5
  19. package/src/providers/StorageProvider.tsx +30 -4
  20. package/dist/components/composer/Composer.d.ts +0 -108
  21. package/dist/components/composer/Composer.d.ts.map +0 -1
  22. package/dist/components/composer/Composer.js +0 -238
  23. package/dist/components/composer/Composer.js.map +0 -1
  24. package/dist/components/composer/helpers.d.ts +0 -21
  25. package/dist/components/composer/helpers.d.ts.map +0 -1
  26. package/dist/components/composer/helpers.js +0 -75
  27. package/dist/components/composer/helpers.js.map +0 -1
  28. package/dist/components/composer/index.d.ts +0 -3
  29. package/dist/components/composer/index.d.ts.map +0 -1
  30. package/dist/components/composer/index.js +0 -19
  31. package/dist/components/composer/index.js.map +0 -1
  32. package/dist/components/imageLightbox/ImageLightbox.d.ts +0 -17
  33. package/dist/components/imageLightbox/ImageLightbox.d.ts.map +0 -1
  34. package/dist/components/imageLightbox/ImageLightbox.js +0 -129
  35. package/dist/components/imageLightbox/ImageLightbox.js.map +0 -1
  36. package/dist/components/imageLightbox/index.d.ts +0 -2
  37. package/dist/components/imageLightbox/index.d.ts.map +0 -1
  38. package/dist/components/imageLightbox/index.js +0 -18
  39. package/dist/components/imageLightbox/index.js.map +0 -1
  40. package/dist/components/supportTicket/AttachmentChips.d.ts +0 -10
  41. package/dist/components/supportTicket/AttachmentChips.d.ts.map +0 -1
  42. package/dist/components/supportTicket/AttachmentChips.js +0 -119
  43. package/dist/components/supportTicket/AttachmentChips.js.map +0 -1
  44. package/dist/components/supportTicket/InterfaceReferenceTags.d.ts +0 -35
  45. package/dist/components/supportTicket/InterfaceReferenceTags.d.ts.map +0 -1
  46. package/dist/components/supportTicket/InterfaceReferenceTags.js +0 -31
  47. package/dist/components/supportTicket/InterfaceReferenceTags.js.map +0 -1
  48. package/dist/components/supportTicket/ReferencePicker.d.ts +0 -41
  49. package/dist/components/supportTicket/ReferencePicker.d.ts.map +0 -1
  50. package/dist/components/supportTicket/ReferencePicker.js +0 -86
  51. package/dist/components/supportTicket/ReferencePicker.js.map +0 -1
  52. package/dist/components/supportTicket/TicketHeader.d.ts +0 -86
  53. package/dist/components/supportTicket/TicketHeader.d.ts.map +0 -1
  54. package/dist/components/supportTicket/TicketHeader.js +0 -149
  55. package/dist/components/supportTicket/TicketHeader.js.map +0 -1
  56. package/dist/components/supportTicket/TicketMetaTags.d.ts +0 -32
  57. package/dist/components/supportTicket/TicketMetaTags.d.ts.map +0 -1
  58. package/dist/components/supportTicket/TicketMetaTags.js +0 -21
  59. package/dist/components/supportTicket/TicketMetaTags.js.map +0 -1
  60. package/dist/components/supportTicket/TicketReplyBox.d.ts +0 -63
  61. package/dist/components/supportTicket/TicketReplyBox.d.ts.map +0 -1
  62. package/dist/components/supportTicket/TicketReplyBox.js +0 -115
  63. package/dist/components/supportTicket/TicketReplyBox.js.map +0 -1
  64. package/dist/components/supportTicket/fileToAttachment.d.ts +0 -9
  65. package/dist/components/supportTicket/fileToAttachment.d.ts.map +0 -1
  66. package/dist/components/supportTicket/fileToAttachment.js +0 -28
  67. package/dist/components/supportTicket/fileToAttachment.js.map +0 -1
  68. package/dist/components/supportTicket/index.d.ts +0 -9
  69. package/dist/components/supportTicket/index.d.ts.map +0 -1
  70. package/dist/components/supportTicket/index.js +0 -25
  71. package/dist/components/supportTicket/index.js.map +0 -1
  72. package/dist/components/supportTicket/meta.d.ts +0 -63
  73. package/dist/components/supportTicket/meta.d.ts.map +0 -1
  74. package/dist/components/supportTicket/meta.js +0 -79
  75. package/dist/components/supportTicket/meta.js.map +0 -1
  76. package/dist/components/ticketReferences/TicketReferences.d.ts +0 -52
  77. package/dist/components/ticketReferences/TicketReferences.d.ts.map +0 -1
  78. package/dist/components/ticketReferences/TicketReferences.js +0 -453
  79. package/dist/components/ticketReferences/TicketReferences.js.map +0 -1
  80. package/dist/components/ticketReferences/index.d.ts +0 -3
  81. package/dist/components/ticketReferences/index.d.ts.map +0 -1
  82. package/dist/components/ticketReferences/index.js +0 -6
  83. package/dist/components/ticketReferences/index.js.map +0 -1
  84. package/dist/components/ticketThread/TicketThread.d.ts +0 -52
  85. package/dist/components/ticketThread/TicketThread.d.ts.map +0 -1
  86. package/dist/components/ticketThread/TicketThread.js +0 -248
  87. package/dist/components/ticketThread/TicketThread.js.map +0 -1
  88. package/dist/components/ticketThread/index.d.ts +0 -3
  89. package/dist/components/ticketThread/index.d.ts.map +0 -1
  90. package/dist/components/ticketThread/index.js +0 -7
  91. package/dist/components/ticketThread/index.js.map +0 -1
  92. package/dist/helpers/scrollbar.d.ts +0 -2
  93. package/dist/helpers/scrollbar.d.ts.map +0 -1
  94. package/dist/helpers/scrollbar.js +0 -25
  95. package/dist/helpers/scrollbar.js.map +0 -1
  96. package/src/components/composer/Composer.stories.tsx +0 -238
  97. package/src/components/composer/Composer.tsx +0 -545
  98. package/src/components/composer/helpers.ts +0 -74
  99. package/src/components/composer/index.ts +0 -2
  100. package/src/components/imageLightbox/ImageLightbox.stories.tsx +0 -156
  101. package/src/components/imageLightbox/ImageLightbox.tsx +0 -169
  102. package/src/components/imageLightbox/index.ts +0 -1
  103. package/src/components/supportTicket/AttachmentChips.stories.tsx +0 -122
  104. package/src/components/supportTicket/AttachmentChips.tsx +0 -142
  105. package/src/components/supportTicket/InterfaceReferenceTags.stories.tsx +0 -134
  106. package/src/components/supportTicket/InterfaceReferenceTags.tsx +0 -85
  107. package/src/components/supportTicket/ReferencePicker.stories.tsx +0 -296
  108. package/src/components/supportTicket/ReferencePicker.tsx +0 -237
  109. package/src/components/supportTicket/TicketConversation.stories.tsx +0 -122
  110. package/src/components/supportTicket/TicketHeader.stories.tsx +0 -183
  111. package/src/components/supportTicket/TicketHeader.tsx +0 -247
  112. package/src/components/supportTicket/TicketMetaTags.stories.tsx +0 -103
  113. package/src/components/supportTicket/TicketMetaTags.tsx +0 -85
  114. package/src/components/supportTicket/TicketReplyBox.stories.tsx +0 -355
  115. package/src/components/supportTicket/TicketReplyBox.tsx +0 -146
  116. package/src/components/supportTicket/fileToAttachment.ts +0 -24
  117. package/src/components/supportTicket/index.ts +0 -8
  118. package/src/components/supportTicket/meta.ts +0 -145
  119. package/src/components/ticketReferences/TicketReferences.stories.tsx +0 -301
  120. package/src/components/ticketReferences/TicketReferences.tsx +0 -899
  121. package/src/components/ticketReferences/index.ts +0 -2
  122. package/src/components/ticketThread/TicketThread.stories.tsx +0 -751
  123. package/src/components/ticketThread/TicketThread.tsx +0 -650
  124. package/src/components/ticketThread/index.ts +0 -6
  125. package/src/helpers/scrollbar.ts +0 -32
@@ -1,247 +0,0 @@
1
- import {
2
- ReqoreControlGroup,
3
- ReqoreDescriptionList,
4
- ReqoreSpan,
5
- } from '@qoretechnologies/reqore';
6
- import { TReqoreBadge } from '@qoretechnologies/reqore/dist/components/Button';
7
- import { TReqoreEffectColor } from '@qoretechnologies/reqore/dist/components/Effect';
8
- import { SIZE_TO_PX } from '@qoretechnologies/reqore/dist/constants/sizes';
9
- import { ReactNode } from 'react';
10
- import styled from 'styled-components';
11
-
12
- /*
13
- * The header every ticket surface puts above its tabs: the subject, the ticket's
14
- * number, and a rail of labelled properties.
15
- *
16
- * Shared because it had already drifted. The staff drawer's header was redesigned
17
- * into this definition-list rail while the customer's kept a heading, a tag row and
18
- * a muted meta line — the same information, two layouts, and no way to change one
19
- * without hand-copying it into the other. What each surface shows differs (staff
20
- * edit the assignee; a customer reads who opened the ticket), so the rows are the
21
- * caller's; the frame, the rhythm and the alignment rules are not.
22
- */
23
-
24
- /** How wide the label column is. Fits "References" — the longest label in use. */
25
- const LABEL_WIDTH = '84px';
26
- /** Everything in the rail runs at one scale. */
27
- const RAIL_SIZE = 'small' as const;
28
- /** Breathing room above and below each row's control — the rail's vertical rhythm. */
29
- const ROW_PADDING = 4;
30
-
31
- /**
32
- * The height a tab item needs to sit on the rail's rhythm.
33
- *
34
- * Exported because the tab strip below the header has to match it and there is no
35
- * Reqore prop for a tab's height: `size` sets it, and `padded` governs the items'
36
- * horizontal edges, not the strip's. The height must go on the ITEM, never on the
37
- * list — both of a tab's own surfaces are keyed to the item's box (the active marker
38
- * is an inset shadow on its bottom edge, the hover wash fills it), so padding the
39
- * list leaves the item floating in a taller strip: the marker lifts off the hairline
40
- * and reads as a doubled line, and the wash reads as a floating box.
41
- *
42
- * This belongs in Reqore as a tab-height option rather than as a CSS rule each
43
- * consumer re-applies. Until it exists, `TicketTabsFrame` is the single copy.
44
- */
45
- export const TICKET_RAIL_ROW_HEIGHT = SIZE_TO_PX[RAIL_SIZE] + ROW_PADDING * 2;
46
-
47
- /** The ticket number, set in mono so it reads as an identifier, not a heading. Exported
48
- * so the staff drawer (which puts the number in the drawer's own title, not the rail)
49
- * renders it identically rather than re-declaring the same span. */
50
- export const TicketMonoId = styled.span`
51
- font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
52
- font-size: 11.5px;
53
- color: rgba(255, 255, 255, 0.45);
54
- `;
55
-
56
- /**
57
- * A person: initials disc, then the name, on one baseline.
58
- *
59
- * One wrapper for every person in the rail — the assignee, the customer, the author.
60
- * They were visibly different before: one went through a nested control group inside
61
- * a button (its own gap and alignment) while another used a plain flex row, so the
62
- * two drifted apart every time either was touched. The only difference left is that
63
- * some of them are pressable.
64
- */
65
- export const TicketPersonValue = styled.span`
66
- display: inline-flex;
67
- align-items: center;
68
- gap: 6px;
69
- min-width: 0;
70
-
71
- /* the name yields before the disc does */
72
- > span:last-child {
73
- overflow: hidden;
74
- text-overflow: ellipsis;
75
- white-space: nowrap;
76
- }
77
- `;
78
-
79
- /** Initials disc for a person. */
80
- export const TicketAvatar = styled.span`
81
- width: 18px;
82
- height: 18px;
83
- border-radius: 999px;
84
- flex: none;
85
- display: inline-flex;
86
- align-items: center;
87
- justify-content: center;
88
- font-size: 8px;
89
- font-weight: 650;
90
- color: #fff;
91
- background: linear-gradient(150deg, #8a4fe6, #2c1140);
92
- border: 1px solid rgba(255, 255, 255, 0.14);
93
- `;
94
-
95
- /**
96
- * Up to two initials from a handle ("nick.m@acme.io" → "NM"). Falls back to "?" so a
97
- * handle made entirely of separators still renders a disc rather than an empty circle.
98
- */
99
- export const ticketInitials = (name: string): string =>
100
- name
101
- .split(/[\s._@-]+/)
102
- .filter(Boolean)
103
- .slice(0, 2)
104
- .map((part) => part[0]?.toUpperCase() ?? '')
105
- .join('') || '?';
106
-
107
- /**
108
- * Wraps a ticket surface's tab strip so it joins the header rail's rhythm.
109
- *
110
- * See `TICKET_RAIL_ROW_HEIGHT` for why the height goes on the item and not the list.
111
- */
112
- export const TicketTabsFrame = styled.div`
113
- display: flex;
114
- flex-direction: column;
115
- flex: 1;
116
- min-height: 0;
117
-
118
- .reqore-tabs-list {
119
- padding-top: 0;
120
- padding-bottom: 0;
121
- }
122
-
123
- .reqore-tabs-list-item {
124
- min-height: ${TICKET_RAIL_ROW_HEIGHT}px;
125
- }
126
- `;
127
-
128
- /*
129
- * Centre each tab's icon + label + count.
130
- *
131
- * With `fill`, every tab is far wider than its content, and ReqoreButton defaults
132
- * `textAlign` to 'left' for non-square buttons — which also hands the leading icon a
133
- * `margin-right: auto`, pinning the group against the left edge of its tab. Setting
134
- * both alignments centres the group as a unit, so the strip reads as evenly spaced
135
- * segments rather than left-huddled labels.
136
- */
137
- export const TICKET_TAB_ALIGN = {
138
- textAlign: 'center',
139
- iconsAlign: 'center',
140
- } as const;
141
-
142
- /**
143
- * A tab's count pill. The active tab's carries the accent; the rest stay neutral, so
144
- * the strip reads as one selected item rather than several competing chips. Returns
145
- * `undefined` for an empty count — a tab with nothing in it shows no badge at all.
146
- */
147
- export const ticketTabBadge = (
148
- count: number,
149
- isActive: boolean,
150
- accent?: { color: TReqoreEffectColor; glow: TReqoreEffectColor }
151
- ): TReqoreBadge | undefined => {
152
- if (!count) {
153
- return undefined;
154
- }
155
- if (!isActive || !accent) {
156
- return count;
157
- }
158
- return { label: count, color: accent.glow, effect: { color: accent.color } };
159
- };
160
-
161
- export interface ITicketHeaderProperty {
162
- label: string;
163
- /** plain text, a chip row, or a control — the row aligns all three the same way */
164
- value: ReactNode;
165
- /** Drop the row. Lets a caller keep one list and vary it by viewer role, rather
166
- * than building a different array per branch. Defaults to shown. */
167
- when?: boolean;
168
- }
169
-
170
- export interface ITicketHeaderProps {
171
- /** Omit when the surrounding dialog already carries the subject — the staff drawer
172
- * puts it in the drawer's own label, the customer's modal puts it here. */
173
- subject?: string;
174
- /** the ticket's number, e.g. `#1001` */
175
- reference?: string;
176
- properties: ITicketHeaderProperty[];
177
- /** padding around the rail, matching the surface's own pane padding */
178
- padding?: number;
179
- className?: string;
180
- }
181
-
182
- export const TicketHeader = ({
183
- subject,
184
- reference,
185
- properties,
186
- padding = 14,
187
- className,
188
- }: ITicketHeaderProps) => (
189
- <ReqoreDescriptionList
190
- /* The rail IS a description list — Reqore's, not a private copy. `contentSize`
191
- is what makes it tabular with controls in it: it reserves a control's height on
192
- every row and insets the values that aren't controls, so a dropdown row and a
193
- plain-text row share both a height and a left edge. */
194
- contentSize={RAIL_SIZE}
195
- size={RAIL_SIZE}
196
- /* Labels are reference furniture, quieter and smaller than the values they name —
197
- and "References" has to fit LABEL_WIDTH on one line at this scale. */
198
- labelTextSize='tiny'
199
- /* The rail's rhythm, which the tab strip below is measured against — see
200
- TICKET_RAIL_ROW_HEIGHT. Reqore's comfortable default would make the rows 52px
201
- and the strip would no longer line up with them. */
202
- rowPadding='tiny'
203
- labelWidth={LABEL_WIDTH}
204
- uppercaseLabels
205
- flat
206
- transparent
207
- padded={false}
208
- contentStyle={{ padding: `${padding - 4}px ${padding}px ${padding - 6}px` }}
209
- className={`${className || ''} ticket-header`}
210
- label={
211
- subject ? (
212
- /* The label is the panel's heading, which `padded={false}` leaves flush against
213
- the edge — `contentStyle` only pads the rows. Pad the subject here so it lines
214
- up with the values below it, using the same horizontal `padding` as the rows. */
215
- <div style={{ padding: `${padding}px ${padding}px ${padding - 8}px`, minWidth: 0 }}>
216
- <ReqoreControlGroup verticalAlign='center' gapSize='small'>
217
- <span>{subject}</span>
218
- {reference ? <TicketMonoId>{reference}</TicketMonoId> : null}
219
- </ReqoreControlGroup>
220
- </div>
221
- ) : undefined
222
- }
223
- items={properties
224
- .filter((property) => property.when !== false)
225
- .map((property) => ({
226
- key: property.label,
227
- label: property.label,
228
- content: property.value,
229
- }))}
230
- />
231
- );
232
-
233
- /** A rail value that is plain text rather than a control — sized to match the rest. */
234
- export const TicketHeaderText = ({
235
- children,
236
- muted,
237
- tooltip,
238
- }: {
239
- children: ReactNode;
240
- /** for an absent value ("Unassigned", "None") */
241
- muted?: boolean;
242
- tooltip?: string;
243
- }) => (
244
- <ReqoreSpan size={RAIL_SIZE} tooltip={tooltip} effect={muted ? { opacity: 0.5 } : undefined}>
245
- {children}
246
- </ReqoreSpan>
247
- );
@@ -1,103 +0,0 @@
1
- import { StoryObj } from '@storybook/react-vite';
2
- import { expect, within } from 'storybook/test';
3
- import { StoryMeta } from '../../types';
4
- import { TTicketCategory, TTicketPriority, TTicketStatus } from './meta';
5
- import { TicketMetaTags } from './TicketMetaTags';
6
-
7
- const ticket = (
8
- status: TTicketStatus,
9
- priority: TTicketPriority,
10
- category: TTicketCategory
11
- ): { status: TTicketStatus; priority: TTicketPriority; category: TTicketCategory } => ({
12
- status,
13
- priority,
14
- category,
15
- });
16
-
17
- const meta = {
18
- component: TicketMetaTags,
19
- title: 'Components/TicketMetaTags',
20
- args: {
21
- ticket: ticket('open', 'high', 'bug'),
22
- },
23
- } as StoryMeta<typeof TicketMetaTags>;
24
-
25
- export default meta;
26
- type Story = StoryObj<typeof meta>;
27
-
28
- /** The status / priority / category badge row — each value's label, intent and
29
- * icon come from the shared `supportTicket/meta` vocabularies. */
30
- export const Default: Story = {
31
- parameters: {
32
- docs: {
33
- description: {
34
- story:
35
- "Renders the status, priority, and category badge row, each tag's label, intent, and icon drawn from the shared supportTicket/meta vocabularies.",
36
- },
37
- },
38
- },
39
- async play({ canvasElement }) {
40
- const canvas = within(canvasElement);
41
- await expect(canvas.getByText('Open')).toBeInTheDocument();
42
- await expect(canvas.getByText('High')).toBeInTheDocument();
43
- await expect(canvas.getByText('Bug')).toBeInTheDocument();
44
- },
45
- };
46
-
47
- /**
48
- * The `awaiting_customer` status is the one value whose label is audience-specific.
49
- * With no `viewerRole` (the staff / neutral default) it reads "Awaiting customer".
50
- */
51
- export const StaffAwaitingLabel: Story = {
52
- parameters: {
53
- docs: {
54
- description: {
55
- story:
56
- "Renders the awaiting_customer status with no viewerRole (the staff / neutral default), where it reads 'Awaiting customer'.",
57
- },
58
- },
59
- },
60
- args: { ticket: ticket('awaiting_customer', 'normal', 'question') },
61
- async play({ canvasElement }) {
62
- const canvas = within(canvasElement);
63
- await expect(canvas.getByText('Awaiting customer')).toBeInTheDocument();
64
- await expect(canvas.queryByText('Awaiting your reply')).not.toBeInTheDocument();
65
- },
66
- };
67
-
68
- /** The customer viewpoint re-labels the same status as "Awaiting your reply". */
69
- export const CustomerAwaitingLabel: Story = {
70
- parameters: {
71
- docs: {
72
- description: {
73
- story:
74
- "Renders the same awaiting_customer status from the customer viewpoint, where it is re-labelled 'Awaiting your reply'.",
75
- },
76
- },
77
- },
78
- args: { viewerRole: 'customer', ticket: ticket('awaiting_customer', 'normal', 'question') },
79
- async play({ canvasElement }) {
80
- const canvas = within(canvasElement);
81
- await expect(canvas.getByText('Awaiting your reply')).toBeInTheDocument();
82
- await expect(canvas.queryByText('Awaiting customer')).not.toBeInTheDocument();
83
- },
84
- };
85
-
86
- /** `hideCategory` drops the category tag — for dense list rows. */
87
- export const HideCategory: Story = {
88
- parameters: {
89
- docs: {
90
- description: {
91
- story:
92
- 'Renders the badge row with hideCategory set, dropping the category tag for dense list rows while status and priority remain.',
93
- },
94
- },
95
- },
96
- args: { hideCategory: true },
97
- async play({ canvasElement }) {
98
- const canvas = within(canvasElement);
99
- await expect(canvas.getByText('Open')).toBeInTheDocument();
100
- await expect(canvas.getByText('High')).toBeInTheDocument();
101
- await expect(canvas.queryByText('Bug')).not.toBeInTheDocument();
102
- },
103
- };
@@ -1,85 +0,0 @@
1
- import { ReqoreControlGroup, ReqoreTag } from '@qoretechnologies/reqore';
2
- import { TSizes } from '@qoretechnologies/reqore/dist/constants/sizes';
3
- import {
4
- TICKET_CATEGORY_META,
5
- TICKET_PRIORITY_META,
6
- TICKET_STATUS_META,
7
- ticketStatusLabel,
8
- TTicketCategory,
9
- TTicketPriority,
10
- TTicketStatus,
11
- TTicketViewerRole,
12
- } from './meta';
13
-
14
- export interface ITicketMetaTagsProps {
15
- /** The three enum values to badge — a full ticket satisfies this structurally. */
16
- ticket: {
17
- status: TTicketStatus;
18
- priority: TTicketPriority;
19
- category: TTicketCategory;
20
- };
21
- /** Picks audience-specific labels (e.g. "Awaiting your reply" vs "Awaiting
22
- * customer"). Omit for the staff / neutral wording. */
23
- viewerRole?: TTicketViewerRole;
24
- size?: TSizes;
25
- /** Hide the category tag (e.g. in a dense list row). */
26
- hideCategory?: boolean;
27
- /** Reqore's subtle tag style — the intent colour as text on a faint wash,
28
- * instead of a solid intent fill. Defaults to `true`; pass `false` for the
29
- * old solid chips. */
30
- minimal?: boolean;
31
- /** Whether the tags are borderless (Reqore's `flat`). Defaults to `false` here,
32
- * so tags carry a border — a shade lighter than the fill — which keeps the
33
- * `minimal` tags legible. Pass `true` for no border. */
34
- flat?: boolean;
35
- }
36
-
37
- /**
38
- * The status / priority / category badge row for a ticket — the single place the
39
- * three enum vocabularies (`../supportTicket/meta`) turn into Reqore tags, so the
40
- * customer list, the staff queue, the detail header and the Qonsole card all read
41
- * identically. Each tag's label, intent and icon come from the shared meta maps.
42
- */
43
- export const TicketMetaTags = ({
44
- ticket,
45
- viewerRole,
46
- size = 'small',
47
- hideCategory,
48
- minimal = true,
49
- flat = false,
50
- }: ITicketMetaTagsProps) => {
51
- const status = TICKET_STATUS_META[ticket.status];
52
- const priority = TICKET_PRIORITY_META[ticket.priority];
53
- const category = TICKET_CATEGORY_META[ticket.category];
54
-
55
- return (
56
- <ReqoreControlGroup size={size} wrap>
57
- <ReqoreTag
58
- icon={status.icon}
59
- intent={status.intent}
60
- label={ticketStatusLabel(ticket.status, viewerRole)}
61
- size={size}
62
- minimal={minimal}
63
- flat={flat}
64
- effect={{ weight: 'bold' }}
65
- />
66
- <ReqoreTag
67
- icon={priority.icon}
68
- intent={priority.intent}
69
- label={priority.label}
70
- size={size}
71
- minimal={minimal}
72
- flat={flat}
73
- />
74
- {!hideCategory && (
75
- <ReqoreTag
76
- icon={category.icon}
77
- label={category.label}
78
- size={size}
79
- minimal={minimal}
80
- flat={flat}
81
- />
82
- )}
83
- </ReqoreControlGroup>
84
- );
85
- };