@flamingo-stack/openframe-frontend-core 0.0.540 → 0.0.541-snapshot.20260814184227

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 (105) hide show
  1. package/dist/{chunk-AQO2DWL2.js → chunk-2GRFWONP.js} +2 -2
  2. package/dist/{chunk-MXKY67SV.cjs → chunk-4IOPSFHF.cjs} +37 -37
  3. package/dist/{chunk-MXKY67SV.cjs.map → chunk-4IOPSFHF.cjs.map} +1 -1
  4. package/dist/{chunk-6PBD57IZ.cjs → chunk-4JDQXYFI.cjs} +14 -14
  5. package/dist/{chunk-6PBD57IZ.cjs.map → chunk-4JDQXYFI.cjs.map} +1 -1
  6. package/dist/{chunk-Y5TDZNWA.js → chunk-AKZY45LV.js} +2 -2
  7. package/dist/{chunk-IHGRWAUC.cjs → chunk-BETH6QZC.cjs} +61 -61
  8. package/dist/{chunk-IHGRWAUC.cjs.map → chunk-BETH6QZC.cjs.map} +1 -1
  9. package/dist/{chunk-75W6ETMW.cjs → chunk-CE2GROZZ.cjs} +96 -5
  10. package/dist/chunk-CE2GROZZ.cjs.map +1 -0
  11. package/dist/{chunk-TBMMC4GS.cjs → chunk-DMYAVVD7.cjs} +7 -7
  12. package/dist/{chunk-TBMMC4GS.cjs.map → chunk-DMYAVVD7.cjs.map} +1 -1
  13. package/dist/{chunk-4PZEGH6E.cjs → chunk-DVBUNH46.cjs} +5 -5
  14. package/dist/{chunk-4PZEGH6E.cjs.map → chunk-DVBUNH46.cjs.map} +1 -1
  15. package/dist/{chunk-PV6L6F3T.cjs → chunk-F3GGE6DI.cjs} +87 -87
  16. package/dist/{chunk-PV6L6F3T.cjs.map → chunk-F3GGE6DI.cjs.map} +1 -1
  17. package/dist/{chunk-IRTAZKWK.cjs → chunk-FLSI72M2.cjs} +3 -3
  18. package/dist/{chunk-IRTAZKWK.cjs.map → chunk-FLSI72M2.cjs.map} +1 -1
  19. package/dist/{chunk-2BKR65LQ.js → chunk-FMH3YY4H.js} +2 -2
  20. package/dist/{chunk-IP4IZ4PB.js → chunk-FT5PZQVK.js} +5 -5
  21. package/dist/{chunk-YPTOQDCY.cjs → chunk-IRZHAWRW.cjs} +4 -4
  22. package/dist/{chunk-YPTOQDCY.cjs.map → chunk-IRZHAWRW.cjs.map} +1 -1
  23. package/dist/{chunk-F5R4IMRF.js → chunk-J2Z53KRG.js} +2 -2
  24. package/dist/{chunk-4RXV54PY.cjs → chunk-JIAZRPQG.cjs} +11 -11
  25. package/dist/{chunk-4RXV54PY.cjs.map → chunk-JIAZRPQG.cjs.map} +1 -1
  26. package/dist/{chunk-5ZRO72K4.cjs → chunk-LOSJMXB7.cjs} +9 -9
  27. package/dist/{chunk-5ZRO72K4.cjs.map → chunk-LOSJMXB7.cjs.map} +1 -1
  28. package/dist/{chunk-N24ZUZZZ.cjs → chunk-OLUROGWG.cjs} +31 -31
  29. package/dist/{chunk-N24ZUZZZ.cjs.map → chunk-OLUROGWG.cjs.map} +1 -1
  30. package/dist/{chunk-5W4R3BUR.js → chunk-PZGOK2OC.js} +2 -2
  31. package/dist/{chunk-MKDOZF4C.js → chunk-QDO7Y54S.js} +2 -2
  32. package/dist/{chunk-WA3IEPEY.js → chunk-QEXFM2QX.js} +2 -2
  33. package/dist/{chunk-6WUUZ43M.js → chunk-QW36SYRQ.js} +2 -2
  34. package/dist/{chunk-X5VMEFIA.js → chunk-SEAKHM72.js} +2 -2
  35. package/dist/{chunk-DC23N4XW.cjs → chunk-T4O3AEKV.cjs} +26 -26
  36. package/dist/{chunk-DC23N4XW.cjs.map → chunk-T4O3AEKV.cjs.map} +1 -1
  37. package/dist/{chunk-VUVKZBDO.js → chunk-UL5EGPMV.js} +4 -4
  38. package/dist/{chunk-NQSGY5HW.js → chunk-VP4ZY2RA.js} +3034 -2943
  39. package/dist/chunk-VP4ZY2RA.js.map +1 -0
  40. package/dist/{chunk-GRU75FOX.cjs → chunk-WFG72MKN.cjs} +26 -26
  41. package/dist/{chunk-GRU75FOX.cjs.map → chunk-WFG72MKN.cjs.map} +1 -1
  42. package/dist/{chunk-VYQLCGFR.js → chunk-WNNZFBMS.js} +4 -4
  43. package/dist/{chunk-XPGB6J75.js → chunk-Y22S7NE3.js} +6 -6
  44. package/dist/components/case-studies/index.cjs +8 -8
  45. package/dist/components/case-studies/index.js +2 -2
  46. package/dist/components/chat/index.cjs +2 -2
  47. package/dist/components/chat/index.js +1 -1
  48. package/dist/components/contact/index.cjs +3 -3
  49. package/dist/components/contact/index.js +2 -2
  50. package/dist/components/docs/index.cjs +5 -5
  51. package/dist/components/docs/index.js +4 -4
  52. package/dist/components/embeds/index.cjs +3 -3
  53. package/dist/components/embeds/index.js +2 -2
  54. package/dist/components/faq/index.cjs +3 -3
  55. package/dist/components/faq/index.js +2 -2
  56. package/dist/components/features/index.cjs +2 -2
  57. package/dist/components/features/index.js +1 -1
  58. package/dist/components/help-center-pages/index.cjs +22 -22
  59. package/dist/components/help-center-pages/index.js +13 -13
  60. package/dist/components/index.cjs +136 -132
  61. package/dist/components/index.cjs.map +1 -1
  62. package/dist/components/index.js +15 -11
  63. package/dist/components/index.js.map +1 -1
  64. package/dist/components/meeting-scheduler/index.cjs +34 -34
  65. package/dist/components/meeting-scheduler/index.js +3 -3
  66. package/dist/components/navigation/index.cjs +2 -2
  67. package/dist/components/navigation/index.js +1 -1
  68. package/dist/components/onboarding-guides/index.cjs +5 -5
  69. package/dist/components/onboarding-guides/index.js +4 -4
  70. package/dist/components/related-content/index.cjs +3 -3
  71. package/dist/components/related-content/index.js +2 -2
  72. package/dist/components/tickets/index.cjs +6 -6
  73. package/dist/components/tickets/index.js +5 -5
  74. package/dist/components/ui/index.cjs +6 -2
  75. package/dist/components/ui/index.cjs.map +1 -1
  76. package/dist/components/ui/index.d.ts +2 -0
  77. package/dist/components/ui/index.d.ts.map +1 -1
  78. package/dist/components/ui/index.js +5 -1
  79. package/dist/components/ui/reopen-ticket-request-modal.d.ts +33 -0
  80. package/dist/components/ui/reopen-ticket-request-modal.d.ts.map +1 -0
  81. package/dist/components/ui/source-tooltip.d.ts +41 -0
  82. package/dist/components/ui/source-tooltip.d.ts.map +1 -0
  83. package/dist/index.cjs +6 -2
  84. package/dist/index.cjs.map +1 -1
  85. package/dist/index.js +5 -1
  86. package/package.json +1 -1
  87. package/src/components/ui/index.ts +2 -0
  88. package/src/components/ui/reopen-ticket-request-modal.tsx +112 -0
  89. package/src/components/ui/source-tooltip.tsx +72 -0
  90. package/src/stories/ReopenTicketRequestModal.stories.tsx +90 -0
  91. package/dist/chunk-75W6ETMW.cjs.map +0 -1
  92. package/dist/chunk-NQSGY5HW.js.map +0 -1
  93. /package/dist/{chunk-AQO2DWL2.js.map → chunk-2GRFWONP.js.map} +0 -0
  94. /package/dist/{chunk-Y5TDZNWA.js.map → chunk-AKZY45LV.js.map} +0 -0
  95. /package/dist/{chunk-2BKR65LQ.js.map → chunk-FMH3YY4H.js.map} +0 -0
  96. /package/dist/{chunk-IP4IZ4PB.js.map → chunk-FT5PZQVK.js.map} +0 -0
  97. /package/dist/{chunk-F5R4IMRF.js.map → chunk-J2Z53KRG.js.map} +0 -0
  98. /package/dist/{chunk-5W4R3BUR.js.map → chunk-PZGOK2OC.js.map} +0 -0
  99. /package/dist/{chunk-MKDOZF4C.js.map → chunk-QDO7Y54S.js.map} +0 -0
  100. /package/dist/{chunk-WA3IEPEY.js.map → chunk-QEXFM2QX.js.map} +0 -0
  101. /package/dist/{chunk-6WUUZ43M.js.map → chunk-QW36SYRQ.js.map} +0 -0
  102. /package/dist/{chunk-X5VMEFIA.js.map → chunk-SEAKHM72.js.map} +0 -0
  103. /package/dist/{chunk-VUVKZBDO.js.map → chunk-UL5EGPMV.js.map} +0 -0
  104. /package/dist/{chunk-VYQLCGFR.js.map → chunk-WNNZFBMS.js.map} +0 -0
  105. /package/dist/{chunk-XPGB6J75.js.map → chunk-Y22S7NE3.js.map} +0 -0
@@ -0,0 +1,112 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+ import { Button } from './button';
5
+ import { CheckboxBlock } from './checkbox-block';
6
+ import { ModalV2, ModalV2Footer, ModalV2Header, ModalV2Title } from './modal-v2';
7
+ import { Textarea } from './textarea';
8
+
9
+ /** Backend trims and caps the reason at 1000 chars; cap it client-side too. */
10
+ const REASON_MAX_LENGTH = 1000;
11
+
12
+ export interface ReopenTicketRequestSelection {
13
+ /** Trimmed; `null` when the field was left blank. */
14
+ reason: string | null;
15
+ /** Present ONLY when the handoff option was shown — the tech-closed
16
+ * variant omits the field entirely (mirrors `TicketReopenInput`). */
17
+ handoffToTechnician?: boolean;
18
+ }
19
+
20
+ export interface ReopenTicketRequestModalProps {
21
+ isOpen: boolean;
22
+ onClose: () => void;
23
+ /**
24
+ * Fae resolved the ticket (`Ticket.resolvedBy === END_USER`): reopening
25
+ * resumes the AI conversation, and the checkbox lets the user route to a
26
+ * technician instead. When a technician closed the ticket the option is
27
+ * hidden — reopening goes to a technician regardless, and the selection
28
+ * omits `handoffToTechnician`.
29
+ */
30
+ showHandoffOption?: boolean;
31
+ /** Confirm in-flight: buttons lock and the modal refuses to close. */
32
+ isPending?: boolean;
33
+ onConfirm: (selection: ReopenTicketRequestSelection) => void;
34
+ }
35
+
36
+ /**
37
+ * Client-side Reopen Ticket dialog (Figma openframe---fae-chat 346-10518):
38
+ * the end user reopening their own resolved ticket from the closed chat.
39
+ * Unlike the admin `ReopenTicketModal` there is no status/assignee pair —
40
+ * the backend picks the target via `requestTicketReopen`; the user only
41
+ * supplies an optional reason and (for Fae-closed tickets) the handoff
42
+ * choice. Presentational — the consumer performs the reopen in `onConfirm`.
43
+ */
44
+ export function ReopenTicketRequestModal({
45
+ isOpen,
46
+ onClose,
47
+ showHandoffOption = false,
48
+ isPending = false,
49
+ onConfirm,
50
+ }: ReopenTicketRequestModalProps) {
51
+ const [reason, setReason] = React.useState('');
52
+ const [handoff, setHandoff] = React.useState(false);
53
+
54
+ // Re-seed the inputs every time the modal opens.
55
+ React.useEffect(() => {
56
+ if (!isOpen) return;
57
+ setReason('');
58
+ setHandoff(false);
59
+ }, [isOpen]);
60
+
61
+ const handleConfirm = () => {
62
+ if (isPending) return;
63
+ const trimmedReason = reason.trim();
64
+ onConfirm({
65
+ reason: trimmedReason ? trimmedReason.slice(0, REASON_MAX_LENGTH) : null,
66
+ ...(showHandoffOption ? { handoffToTechnician: handoff } : {}),
67
+ });
68
+ };
69
+
70
+ return (
71
+ <ModalV2 isOpen={isOpen} onClose={isPending ? () => {} : onClose} className="text-left md:max-w-[600px]">
72
+ <ModalV2Header>
73
+ <ModalV2Title>Reopen Ticket</ModalV2Title>
74
+ </ModalV2Header>
75
+
76
+ <p className="text-h4 text-ods-text-primary">
77
+ This ticket will be reopened and the AI assistant will continue helping you.
78
+ </p>
79
+
80
+ <div className="w-full">
81
+ <Textarea
82
+ label="Reason"
83
+ value={reason}
84
+ onChange={event => setReason(event.target.value)}
85
+ placeholder="Describe what's still not working (optional)"
86
+ maxLength={REASON_MAX_LENGTH}
87
+ disabled={isPending}
88
+ />
89
+ </div>
90
+
91
+ {showHandoffOption && (
92
+ <CheckboxBlock
93
+ id="reopen-handoff-to-technician"
94
+ checked={handoff}
95
+ onCheckedChange={setHandoff}
96
+ label="Hand off to a Technician"
97
+ description="A technician will review the ticket and reply when available."
98
+ disabled={isPending}
99
+ />
100
+ )}
101
+
102
+ <ModalV2Footer>
103
+ <Button type="button" variant="outline" onClick={onClose} disabled={isPending} className="flex-1">
104
+ Cancel
105
+ </Button>
106
+ <Button type="button" variant="accent" onClick={handleConfirm} loading={isPending} className="flex-1">
107
+ Reopen Ticket
108
+ </Button>
109
+ </ModalV2Footer>
110
+ </ModalV2>
111
+ );
112
+ }
@@ -0,0 +1,72 @@
1
+ "use client"
2
+
3
+ import { ExternalLink, Info } from 'lucide-react'
4
+ import { Button } from './button'
5
+ import { FloatingTooltip } from './floating-tooltip'
6
+
7
+ /**
8
+ * Source-reference tooltip — a (i) info icon whose tooltip lists every source
9
+ * behind a cited figure as a Button link row (value · short label,
10
+ * external-link glyph) with an optional "where it lives in the research" line
11
+ * under it. Rows are clickable because the FloatingTooltip's safePolygon
12
+ * keeps it open while the pointer travels into the content; the (i) itself
13
+ * opens the first source so the click-the-icon habit still works.
14
+ *
15
+ * The trigger renders inline (`as="span"`) — a source (i) always sits inside
16
+ * a line of text (a statement's last line, a money tail, a value line).
17
+ * Hosts style the icon via `iconClassName`; the tooltip CONTENT is
18
+ * self-contained ODS styling (it portals to <body>, outside any host-scoped
19
+ * CSS variables).
20
+ */
21
+
22
+ export interface SourceRef {
23
+ /** The figure this source backs, e.g. "$121.2B" — leads the button label. */
24
+ value: string
25
+ /** Short source name after the value (buttons are nowrap — keep it tight). */
26
+ label: string
27
+ /** Exactly where the number lives in the research (report · table/figure ·
28
+ * column) — "click the link and can't find the number" is a credibility
29
+ * bug. Rendered as a fine-print line under the button. */
30
+ where?: string
31
+ href: string
32
+ }
33
+
34
+ export interface SourceTooltipProps {
35
+ /** One-line setup above the source rows (e.g. how the figures add up). */
36
+ intro?: React.ReactNode
37
+ sources: SourceRef[]
38
+ /** Fine print under the rows (e.g. what the cited segment covers). */
39
+ note?: React.ReactNode
40
+ /** Classes for the trigger's <Info> icon (size/color live with the host). */
41
+ iconClassName?: string
42
+ /** Extra attributes for the trigger anchor — e.g. a host's click-intercept
43
+ * opt-out vocabulary like the deck's `data-no-nav`. */
44
+ triggerAnchorProps?: React.AnchorHTMLAttributes<HTMLAnchorElement> & { [k: `data-${string}`]: string | boolean | undefined }
45
+ }
46
+
47
+ export function SourceTooltip({ intro, sources, note, iconClassName, triggerAnchorProps }: SourceTooltipProps) {
48
+ return (
49
+ <FloatingTooltip as="span" side="top" delayDuration={0} className="max-w-sm" content={
50
+ <span className="flex flex-col gap-2 py-0.5">
51
+ {intro && <span className="font-semibold text-ods-text-primary">{intro}</span>}
52
+ {sources.map((s) => (
53
+ <span key={s.href} className="flex flex-col gap-1">
54
+ <Button
55
+ variant="outline"
56
+ size="compact"
57
+ fullWidth
58
+ linkProps={{ href: s.href, target: '_blank', rel: 'noopener noreferrer' }}
59
+ rightIcon={<ExternalLink />}
60
+ >
61
+ {s.value} · {s.label}
62
+ </Button>
63
+ {s.where && <span className="text-ods-text-secondary">{s.where}</span>}
64
+ </span>
65
+ ))}
66
+ {note && <span className="text-ods-text-secondary">{note}</span>}
67
+ </span>
68
+ }>
69
+ <a href={sources[0].href} target="_blank" rel="noreferrer" aria-label="Source research" {...triggerAnchorProps}><Info className={iconClassName} /></a>
70
+ </FloatingTooltip>
71
+ )
72
+ }
@@ -0,0 +1,90 @@
1
+ import type { Meta, StoryObj } from '@storybook/nextjs-vite';
2
+ import { useState } from 'react';
3
+ import { fn } from 'storybook/test';
4
+ import { Button } from '../components/ui/button';
5
+ import {
6
+ ReopenTicketRequestModal,
7
+ type ReopenTicketRequestModalProps,
8
+ type ReopenTicketRequestSelection,
9
+ } from '../components/ui/reopen-ticket-request-modal';
10
+
11
+ const meta = {
12
+ title: 'UI/ReopenTicketRequestModal',
13
+ component: ReopenTicketRequestModal,
14
+ parameters: {
15
+ layout: 'centered',
16
+ docs: {
17
+ description: {
18
+ component:
19
+ 'Client-side Reopen Ticket dialog (Figma openframe---fae-chat 346-10518): the end user reopening their ' +
20
+ 'own resolved ticket from the closed chat. No status/assignee pair - the backend picks the target via ' +
21
+ 'requestTicketReopen; the user supplies an optional reason and, for Fae-closed tickets, the ' +
22
+ 'hand-off-to-a-technician choice. Tech-closed tickets hide the checkbox and omit the field entirely.',
23
+ },
24
+ },
25
+ },
26
+ argTypes: {
27
+ isPending: { control: 'boolean' },
28
+ showHandoffOption: { control: 'boolean' },
29
+ },
30
+ } satisfies Meta<typeof ReopenTicketRequestModal>;
31
+
32
+ export default meta;
33
+ type Story = StoryObj<typeof meta>;
34
+
35
+ function ControlledModal(props: Partial<ReopenTicketRequestModalProps> & { pendingOnConfirm?: boolean }) {
36
+ const [isOpen, setIsOpen] = useState(true);
37
+ const [isPending, setIsPending] = useState(false);
38
+
39
+ const handleConfirm = (selection: ReopenTicketRequestSelection) => {
40
+ props.onConfirm?.(selection);
41
+ if (!props.pendingOnConfirm) {
42
+ setIsOpen(false);
43
+ return;
44
+ }
45
+ // Simulate the requestTicketReopen round-trip.
46
+ setIsPending(true);
47
+ setTimeout(() => {
48
+ setIsPending(false);
49
+ setIsOpen(false);
50
+ }, 1500);
51
+ };
52
+
53
+ return (
54
+ <>
55
+ <Button variant="outline" onClick={() => setIsOpen(true)}>
56
+ Reopen Ticket
57
+ </Button>
58
+ <ReopenTicketRequestModal
59
+ isOpen={isOpen}
60
+ onClose={() => setIsOpen(false)}
61
+ {...props}
62
+ isPending={props.isPending ?? isPending}
63
+ onConfirm={handleConfirm}
64
+ />
65
+ </>
66
+ );
67
+ }
68
+
69
+ /** Fae-closed ticket (`resolvedBy === END_USER`) - the handoff checkbox is offered. */
70
+ export const FaeClosed: Story = {
71
+ args: {
72
+ isOpen: true,
73
+ onClose: fn(),
74
+ onConfirm: fn(),
75
+ showHandoffOption: true,
76
+ },
77
+ render: args => <ControlledModal {...args} />,
78
+ };
79
+
80
+ /** Technician-closed ticket - no checkbox; the selection omits `handoffToTechnician`. */
81
+ export const TechnicianClosed: Story = {
82
+ args: { ...FaeClosed.args, showHandoffOption: false },
83
+ render: args => <ControlledModal {...args} />,
84
+ };
85
+
86
+ /** Confirm shows the pending state (buttons lock, modal refuses to close). */
87
+ export const PendingOnConfirm: Story = {
88
+ args: { ...FaeClosed.args },
89
+ render: args => <ControlledModal {...args} pendingOnConfirm />,
90
+ };