@flamingo-stack/openframe-frontend-core 0.0.651 → 0.0.652-2252.6520.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.
- package/dist/{chunk-RRIJPDW2.cjs → chunk-27OZEE3E.cjs} +3 -3
- package/dist/{chunk-RRIJPDW2.cjs.map → chunk-27OZEE3E.cjs.map} +1 -1
- package/dist/{chunk-W6XVMTJX.js → chunk-2FWS52HR.js} +3 -3
- package/dist/{chunk-765P644V.cjs → chunk-4T7E2SWL.cjs} +13 -13
- package/dist/{chunk-765P644V.cjs.map → chunk-4T7E2SWL.cjs.map} +1 -1
- package/dist/{chunk-K4HT2U2O.js → chunk-74EGKPX3.js} +2 -2
- package/dist/{chunk-RRKQL65P.cjs → chunk-AAITIXRL.cjs} +17 -17
- package/dist/{chunk-RRKQL65P.cjs.map → chunk-AAITIXRL.cjs.map} +1 -1
- package/dist/{chunk-7G6SBEX5.js → chunk-ADXTLFG7.js} +5 -5
- package/dist/{chunk-JTBLAQPZ.js → chunk-AGQZRNYV.js} +4 -4
- package/dist/{chunk-S7NRYXGG.js → chunk-BRIJIC6E.js} +4 -4
- package/dist/{chunk-YWAZDKPP.cjs → chunk-BXE3DLIC.cjs} +17 -17
- package/dist/{chunk-YWAZDKPP.cjs.map → chunk-BXE3DLIC.cjs.map} +1 -1
- package/dist/{chunk-ITQCUJW7.cjs → chunk-DVT5JCLD.cjs} +3 -3
- package/dist/{chunk-ITQCUJW7.cjs.map → chunk-DVT5JCLD.cjs.map} +1 -1
- package/dist/{chunk-TD3K7HLZ.cjs → chunk-ERFHLMWM.cjs} +182 -146
- package/dist/chunk-ERFHLMWM.cjs.map +1 -0
- package/dist/{chunk-TVUKPILJ.cjs → chunk-EY2OVL3Z.cjs} +10 -10
- package/dist/{chunk-TVUKPILJ.cjs.map → chunk-EY2OVL3Z.cjs.map} +1 -1
- package/dist/{chunk-VSE47UQ4.cjs → chunk-FBKB4HCZ.cjs} +3 -3
- package/dist/{chunk-VSE47UQ4.cjs.map → chunk-FBKB4HCZ.cjs.map} +1 -1
- package/dist/{chunk-KXKRR6GZ.js → chunk-HM6D2YHS.js} +2 -2
- package/dist/{chunk-OL7PTXX5.js → chunk-HSPLCV56.js} +2 -2
- package/dist/{chunk-P2BO5XWB.cjs → chunk-I3KD7T6K.cjs} +36 -36
- package/dist/{chunk-P2BO5XWB.cjs.map → chunk-I3KD7T6K.cjs.map} +1 -1
- package/dist/{chunk-SIYE64HI.cjs → chunk-I5Y6ZALR.cjs} +51 -51
- package/dist/{chunk-SIYE64HI.cjs.map → chunk-I5Y6ZALR.cjs.map} +1 -1
- package/dist/{chunk-WYF5TVYX.cjs → chunk-JCVGQDQV.cjs} +33 -33
- package/dist/{chunk-WYF5TVYX.cjs.map → chunk-JCVGQDQV.cjs.map} +1 -1
- package/dist/{chunk-OU6VI2QH.cjs → chunk-JWY5ES3H.cjs} +4 -4
- package/dist/{chunk-OU6VI2QH.cjs.map → chunk-JWY5ES3H.cjs.map} +1 -1
- package/dist/{chunk-R54B74M4.js → chunk-LDC37FG4.js} +2 -2
- package/dist/{chunk-PAY4RZPD.js → chunk-LECSFMGM.js} +183 -147
- package/dist/{chunk-PAY4RZPD.js.map → chunk-LECSFMGM.js.map} +1 -1
- package/dist/{chunk-RDNO3KCF.js → chunk-LUEURQOY.js} +5 -5
- package/dist/{chunk-DAOL4ZRO.js → chunk-N4RVPWPM.js} +2 -2
- package/dist/{chunk-O4J4V5YL.js → chunk-NTJUFHX2.js} +2 -2
- package/dist/{chunk-JAMRFKAS.js → chunk-QUNY6URW.js} +2 -2
- package/dist/{chunk-XRMFLKI5.js → chunk-QZJ4K7SG.js} +2 -2
- package/dist/{chunk-QWCWFAGZ.js → chunk-TGHSQUTD.js} +2 -2
- package/dist/{chunk-PQZH3476.cjs → chunk-UEFHMMJX.cjs} +18 -18
- package/dist/{chunk-PQZH3476.cjs.map → chunk-UEFHMMJX.cjs.map} +1 -1
- package/dist/{chunk-GKSPWGB2.cjs → chunk-VIHX7ADQ.cjs} +3 -3
- package/dist/{chunk-GKSPWGB2.cjs.map → chunk-VIHX7ADQ.cjs.map} +1 -1
- package/dist/{chunk-SH7SZZC4.cjs → chunk-ZVLOG2AV.cjs} +4 -4
- package/dist/{chunk-SH7SZZC4.cjs.map → chunk-ZVLOG2AV.cjs.map} +1 -1
- package/dist/components/case-studies/index.cjs +11 -11
- package/dist/components/case-studies/index.js +2 -2
- package/dist/components/contact/index.cjs +3 -3
- package/dist/components/contact/index.js +2 -2
- package/dist/components/docs/index.cjs +6 -6
- package/dist/components/docs/index.js +5 -5
- package/dist/components/embeds/index.cjs +3 -3
- package/dist/components/embeds/index.js +2 -2
- package/dist/components/faq/index.cjs +3 -3
- package/dist/components/faq/index.js +2 -2
- package/dist/components/features/index.cjs +2 -2
- package/dist/components/features/index.js +1 -1
- package/dist/components/features/section-selector.d.ts +13 -0
- package/dist/components/features/section-selector.d.ts.map +1 -1
- package/dist/components/help-center-pages/index.cjs +22 -22
- package/dist/components/help-center-pages/index.js +13 -13
- package/dist/components/index.cjs +31 -31
- package/dist/components/index.js +12 -12
- package/dist/components/meeting-scheduler/index.cjs +21 -21
- package/dist/components/meeting-scheduler/index.js +1 -1
- package/dist/components/navigation/index.cjs +5 -5
- package/dist/components/navigation/index.js +4 -4
- package/dist/components/onboarding-guides/index.cjs +5 -5
- package/dist/components/onboarding-guides/index.js +4 -4
- package/dist/components/tickets/index.cjs +6 -6
- package/dist/components/tickets/index.js +5 -5
- package/dist/components/ui/index.cjs +2 -2
- package/dist/components/ui/index.js +1 -1
- package/dist/index.cjs +6 -6
- package/dist/index.js +5 -5
- package/package.json +1 -1
- package/src/components/features/section-selector.tsx +79 -6
- package/dist/chunk-TD3K7HLZ.cjs.map +0 -1
- /package/dist/{chunk-W6XVMTJX.js.map → chunk-2FWS52HR.js.map} +0 -0
- /package/dist/{chunk-K4HT2U2O.js.map → chunk-74EGKPX3.js.map} +0 -0
- /package/dist/{chunk-7G6SBEX5.js.map → chunk-ADXTLFG7.js.map} +0 -0
- /package/dist/{chunk-JTBLAQPZ.js.map → chunk-AGQZRNYV.js.map} +0 -0
- /package/dist/{chunk-S7NRYXGG.js.map → chunk-BRIJIC6E.js.map} +0 -0
- /package/dist/{chunk-KXKRR6GZ.js.map → chunk-HM6D2YHS.js.map} +0 -0
- /package/dist/{chunk-OL7PTXX5.js.map → chunk-HSPLCV56.js.map} +0 -0
- /package/dist/{chunk-R54B74M4.js.map → chunk-LDC37FG4.js.map} +0 -0
- /package/dist/{chunk-RDNO3KCF.js.map → chunk-LUEURQOY.js.map} +0 -0
- /package/dist/{chunk-DAOL4ZRO.js.map → chunk-N4RVPWPM.js.map} +0 -0
- /package/dist/{chunk-O4J4V5YL.js.map → chunk-NTJUFHX2.js.map} +0 -0
- /package/dist/{chunk-JAMRFKAS.js.map → chunk-QUNY6URW.js.map} +0 -0
- /package/dist/{chunk-XRMFLKI5.js.map → chunk-QZJ4K7SG.js.map} +0 -0
- /package/dist/{chunk-QWCWFAGZ.js.map → chunk-TGHSQUTD.js.map} +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import type React from 'react';
|
|
4
|
+
import { useEffect, useRef } from 'react';
|
|
4
5
|
import { cn } from '../../utils/cn';
|
|
5
6
|
import { Button } from '../ui/button';
|
|
6
7
|
import { StatusBadge } from '../ui/status-badge';
|
|
@@ -25,6 +26,19 @@ export interface SectionItem {
|
|
|
25
26
|
}[];
|
|
26
27
|
}
|
|
27
28
|
|
|
29
|
+
/**
|
|
30
|
+
* A section picker: ONE active section, the rest a click away.
|
|
31
|
+
*
|
|
32
|
+
* `vertical` is a side list on wide screens and, below `lg`, a single horizontally
|
|
33
|
+
* SCROLLABLE strip. A side list stacked above its content on a phone is a screen
|
|
34
|
+
* of navigation before the first pixel of content, and a consumer that made it
|
|
35
|
+
* `sticky` had it cover the content it navigates. When a tab set does not fit,
|
|
36
|
+
* Material's guidance is scrollable tabs, which is what the strip is: no wrapping,
|
|
37
|
+
* no description, the active tab kept in view.
|
|
38
|
+
*
|
|
39
|
+
* Both layouts are a WAI-ARIA `tablist`: `aria-selected`, roving tabindex (Tab
|
|
40
|
+
* lands on the active section, then leaves the list), arrow keys / Home / End.
|
|
41
|
+
*/
|
|
28
42
|
export interface SectionSelectorProps {
|
|
29
43
|
sections: SectionItem[];
|
|
30
44
|
activeSection: string;
|
|
@@ -51,11 +65,14 @@ const SectionButton: React.FC<{
|
|
|
51
65
|
activeButtonClassName?: string;
|
|
52
66
|
minHeight?: string;
|
|
53
67
|
showDescription?: boolean;
|
|
68
|
+
/** Roving tabindex: the one section Tab lands on. */
|
|
69
|
+
isTabStop: boolean;
|
|
54
70
|
}> = ({
|
|
55
71
|
section,
|
|
56
72
|
isActive,
|
|
57
73
|
disabled,
|
|
58
74
|
onClick,
|
|
75
|
+
isTabStop,
|
|
59
76
|
layout,
|
|
60
77
|
widthClasses,
|
|
61
78
|
buttonClassName,
|
|
@@ -74,6 +91,9 @@ const SectionButton: React.FC<{
|
|
|
74
91
|
onClick={onClick}
|
|
75
92
|
disabled={isDisabled}
|
|
76
93
|
variant="outline"
|
|
94
|
+
role="tab"
|
|
95
|
+
aria-selected={isActive}
|
|
96
|
+
tabIndex={isTabStop ? 0 : -1}
|
|
77
97
|
className={cn(
|
|
78
98
|
'!items-start !justify-start bg-ods-card !text-left shadow-ods-card hover:bg-ods-card-hover',
|
|
79
99
|
isActive && 'border-ods-accent',
|
|
@@ -81,11 +101,14 @@ const SectionButton: React.FC<{
|
|
|
81
101
|
buttonClassName,
|
|
82
102
|
isActive && activeButtonClassName,
|
|
83
103
|
layout === 'vertical'
|
|
84
|
-
?
|
|
104
|
+
? // Strip below lg: a compact, non-shrinking tab. Side list from lg: the full card.
|
|
105
|
+
'!h-auto !min-h-12 shrink-0 !px-[var(--spacing-system-mf)] !py-[var(--spacing-system-sf)] lg:!min-h-[var(--section-min-height)] lg:shrink lg:!py-[var(--spacing-system-mf)]'
|
|
85
106
|
: '!h-auto !min-h-[76px] !whitespace-normal !text-left',
|
|
86
107
|
)}
|
|
87
108
|
style={{
|
|
88
|
-
|
|
109
|
+
// The side list's height is a CSS variable so the strip can ignore it; an
|
|
110
|
+
// inline `minHeight` would make every strip tab as tall as a side card.
|
|
111
|
+
...(layout === 'vertical' ? ({ '--section-min-height': minHeight } as React.CSSProperties) : { minHeight }),
|
|
89
112
|
touchAction: 'manipulation',
|
|
90
113
|
WebkitTapHighlightColor: 'transparent',
|
|
91
114
|
textAlign: 'left',
|
|
@@ -102,7 +125,9 @@ const SectionButton: React.FC<{
|
|
|
102
125
|
{section.number && <span className={cn(numberClasses, 'shrink-0 text-h3')}>{section.number}</span>}
|
|
103
126
|
<div className="min-w-0 flex-1 text-left">
|
|
104
127
|
<div className="flex flex-wrap items-center gap-2">
|
|
105
|
-
<p className={cn(titleClasses, 'whitespace-normal break-words
|
|
128
|
+
<p className={cn(titleClasses, 'whitespace-nowrap text-h4 lg:whitespace-normal lg:break-words')}>
|
|
129
|
+
{section.title}
|
|
130
|
+
</p>
|
|
106
131
|
{section.badge && (
|
|
107
132
|
<StatusBadge
|
|
108
133
|
text={section.badge.text}
|
|
@@ -112,7 +137,9 @@ const SectionButton: React.FC<{
|
|
|
112
137
|
)}
|
|
113
138
|
</div>
|
|
114
139
|
{section.description && showDescription && (
|
|
115
|
-
<p className={cn(subtitleClasses, 'mt-1 whitespace-normal break-words text-h6')}>
|
|
140
|
+
<p className={cn(subtitleClasses, 'mt-1 hidden whitespace-normal break-words text-h6 lg:block')}>
|
|
141
|
+
{section.description}
|
|
142
|
+
</p>
|
|
116
143
|
)}
|
|
117
144
|
</div>
|
|
118
145
|
</div>
|
|
@@ -161,10 +188,55 @@ export const SectionSelector: React.FC<SectionSelectorProps> = ({
|
|
|
161
188
|
showDescription = true,
|
|
162
189
|
}) => {
|
|
163
190
|
const containerClasses = cn(
|
|
164
|
-
layout === 'wrap'
|
|
191
|
+
layout === 'wrap'
|
|
192
|
+
? 'flex flex-wrap gap-2 md:gap-4 lg:gap-6'
|
|
193
|
+
: 'flex flex-row gap-[var(--spacing-system-xsf)] overflow-x-auto [scrollbar-width:none] lg:flex-col lg:overflow-visible [&::-webkit-scrollbar]:hidden',
|
|
165
194
|
className,
|
|
166
195
|
);
|
|
167
196
|
|
|
197
|
+
const listRef = useRef<HTMLDivElement>(null);
|
|
198
|
+
|
|
199
|
+
// Keep the active tab in view in the strip. Scrolls the LIST only, never the
|
|
200
|
+
// page: `scrollIntoView` would also move every scrollable ancestor.
|
|
201
|
+
useEffect(() => {
|
|
202
|
+
const list = listRef.current;
|
|
203
|
+
const active = list?.querySelector<HTMLElement>('[role="tab"][aria-selected="true"]');
|
|
204
|
+
if (!list || !active || list.scrollWidth <= list.clientWidth) return;
|
|
205
|
+
const offset = active.getBoundingClientRect().left - list.getBoundingClientRect().left;
|
|
206
|
+
// Instant on purpose: a smooth scroll is driven by animation frames, which a
|
|
207
|
+
// background tab or an embedded preview does not run, so it never arrived.
|
|
208
|
+
list.scrollLeft += offset - (list.clientWidth - active.clientWidth) / 2;
|
|
209
|
+
}, [activeSection]);
|
|
210
|
+
|
|
211
|
+
const enabled = sections.filter(section => !section.disabled && !disabled);
|
|
212
|
+
const tabStopId = enabled.some(section => section.id === activeSection) ? activeSection : enabled[0]?.id;
|
|
213
|
+
|
|
214
|
+
const onKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {
|
|
215
|
+
const step =
|
|
216
|
+
event.key === 'ArrowRight' || event.key === 'ArrowDown'
|
|
217
|
+
? 1
|
|
218
|
+
: event.key === 'ArrowLeft' || event.key === 'ArrowUp'
|
|
219
|
+
? -1
|
|
220
|
+
: 0;
|
|
221
|
+
if (!step && event.key !== 'Home' && event.key !== 'End') return;
|
|
222
|
+
if (enabled.length === 0) return;
|
|
223
|
+
event.preventDefault();
|
|
224
|
+
const at = Math.max(
|
|
225
|
+
0,
|
|
226
|
+
enabled.findIndex(section => section.id === activeSection),
|
|
227
|
+
);
|
|
228
|
+
const next =
|
|
229
|
+
event.key === 'Home'
|
|
230
|
+
? enabled[0]
|
|
231
|
+
: event.key === 'End'
|
|
232
|
+
? enabled[enabled.length - 1]
|
|
233
|
+
: enabled[(at + step + enabled.length) % enabled.length];
|
|
234
|
+
onSectionChange(next.id);
|
|
235
|
+
requestAnimationFrame(() =>
|
|
236
|
+
listRef.current?.querySelector<HTMLElement>('[role="tab"][aria-selected="true"]')?.focus(),
|
|
237
|
+
);
|
|
238
|
+
};
|
|
239
|
+
|
|
168
240
|
const getButtonWidthClasses = () => {
|
|
169
241
|
switch (buttonWidth) {
|
|
170
242
|
case 'full':
|
|
@@ -179,7 +251,7 @@ export const SectionSelector: React.FC<SectionSelectorProps> = ({
|
|
|
179
251
|
const widthClasses = getButtonWidthClasses();
|
|
180
252
|
|
|
181
253
|
return (
|
|
182
|
-
<div className={containerClasses}>
|
|
254
|
+
<div ref={listRef} role="tablist" onKeyDown={onKeyDown} className={containerClasses}>
|
|
183
255
|
{sections.map(section => (
|
|
184
256
|
<SectionButton
|
|
185
257
|
key={section.id}
|
|
@@ -193,6 +265,7 @@ export const SectionSelector: React.FC<SectionSelectorProps> = ({
|
|
|
193
265
|
activeButtonClassName={activeButtonClassName}
|
|
194
266
|
minHeight={minHeight}
|
|
195
267
|
showDescription={showDescription}
|
|
268
|
+
isTabStop={section.id === tabStopId}
|
|
196
269
|
/>
|
|
197
270
|
))}
|
|
198
271
|
</div>
|