@flamingo-stack/openframe-frontend-core 0.0.623 → 0.0.624-snapshot.20260914031520

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 (161) hide show
  1. package/dist/{chunk-DV7IBKJI.cjs → chunk-2MMEPNSX.cjs} +8 -8
  2. package/dist/{chunk-DV7IBKJI.cjs.map → chunk-2MMEPNSX.cjs.map} +1 -1
  3. package/dist/{chunk-V4OA6SVZ.js → chunk-2RTH6JR5.js} +4 -4
  4. package/dist/{chunk-KZ7AKNDM.js → chunk-35JUSLEJ.js} +181 -143
  5. package/dist/{chunk-KZ7AKNDM.js.map → chunk-35JUSLEJ.js.map} +1 -1
  6. package/dist/{chunk-DTCNLA67.js → chunk-627V5GNY.js} +3 -3
  7. package/dist/{chunk-EP2XHZ4Z.cjs → chunk-7H2H6HYE.cjs} +24 -24
  8. package/dist/{chunk-EP2XHZ4Z.cjs.map → chunk-7H2H6HYE.cjs.map} +1 -1
  9. package/dist/{chunk-6EHXQH7C.js → chunk-7LH2LC6N.js} +6 -6
  10. package/dist/{chunk-ORUOBIJT.cjs → chunk-7VOLW4WX.cjs} +3 -3
  11. package/dist/{chunk-ORUOBIJT.cjs.map → chunk-7VOLW4WX.cjs.map} +1 -1
  12. package/dist/{chunk-CKLQVCDP.cjs → chunk-AT44NN6G.cjs} +11 -11
  13. package/dist/{chunk-CKLQVCDP.cjs.map → chunk-AT44NN6G.cjs.map} +1 -1
  14. package/dist/{chunk-YXBY2MDO.cjs → chunk-BNH76PZH.cjs} +11 -11
  15. package/dist/{chunk-YXBY2MDO.cjs.map → chunk-BNH76PZH.cjs.map} +1 -1
  16. package/dist/{chunk-XAUPFCIJ.js → chunk-BXKM4GFD.js} +9 -2
  17. package/dist/chunk-BXKM4GFD.js.map +1 -0
  18. package/dist/{chunk-DUI764J2.js → chunk-C2E3TDRF.js} +4 -4
  19. package/dist/{chunk-XFYPKN2D.cjs → chunk-CP5QJZGS.cjs} +726 -688
  20. package/dist/chunk-CP5QJZGS.cjs.map +1 -0
  21. package/dist/{chunk-7CHG2DP2.cjs → chunk-CWK7BQTZ.cjs} +6 -6
  22. package/dist/{chunk-7CHG2DP2.cjs.map → chunk-CWK7BQTZ.cjs.map} +1 -1
  23. package/dist/{chunk-YW7GPBB2.cjs → chunk-CXTOKOMK.cjs} +94 -94
  24. package/dist/{chunk-YW7GPBB2.cjs.map → chunk-CXTOKOMK.cjs.map} +1 -1
  25. package/dist/{chunk-AOGRJ4FT.js → chunk-DKNDJNSW.js} +4 -4
  26. package/dist/{chunk-LWBLLL32.cjs → chunk-ELU7SGM6.cjs} +63 -63
  27. package/dist/{chunk-LWBLLL32.cjs.map → chunk-ELU7SGM6.cjs.map} +1 -1
  28. package/dist/{chunk-SEC6NRAV.cjs → chunk-ETH2WO6U.cjs} +5 -5
  29. package/dist/{chunk-SEC6NRAV.cjs.map → chunk-ETH2WO6U.cjs.map} +1 -1
  30. package/dist/{chunk-43JQ3SJS.js → chunk-EW6PYGB3.js} +2 -2
  31. package/dist/{chunk-NMCR5YGW.cjs → chunk-F7UZDBZZ.cjs} +42 -42
  32. package/dist/{chunk-NMCR5YGW.cjs.map → chunk-F7UZDBZZ.cjs.map} +1 -1
  33. package/dist/{chunk-PQZGMNJQ.js → chunk-FDE52ADN.js} +6 -6
  34. package/dist/{chunk-CIPIND3J.js → chunk-HOASBISN.js} +2 -2
  35. package/dist/{chunk-HC6FZJMM.cjs → chunk-ISXADEGT.cjs} +39 -39
  36. package/dist/{chunk-HC6FZJMM.cjs.map → chunk-ISXADEGT.cjs.map} +1 -1
  37. package/dist/{chunk-SNWPBMPV.js → chunk-IYQRUTJI.js} +5 -5
  38. package/dist/{chunk-CS7MVDUF.cjs → chunk-MP2K44EK.cjs} +8 -8
  39. package/dist/{chunk-CS7MVDUF.cjs.map → chunk-MP2K44EK.cjs.map} +1 -1
  40. package/dist/{chunk-VRUJPZ2C.js → chunk-NCY7J6YZ.js} +629 -565
  41. package/dist/chunk-NCY7J6YZ.js.map +1 -0
  42. package/dist/{chunk-XB7Z5ASO.cjs → chunk-NDUNUXS2.cjs} +18 -18
  43. package/dist/{chunk-XB7Z5ASO.cjs.map → chunk-NDUNUXS2.cjs.map} +1 -1
  44. package/dist/{chunk-VQCEWQFV.cjs → chunk-OFRCNA6N.cjs} +12 -12
  45. package/dist/{chunk-VQCEWQFV.cjs.map → chunk-OFRCNA6N.cjs.map} +1 -1
  46. package/dist/{chunk-VW57GX5O.js → chunk-P52MUJTG.js} +3 -3
  47. package/dist/{chunk-MJJIQJGQ.js → chunk-PSANPD64.js} +9 -9
  48. package/dist/{chunk-D4Q7BB3N.cjs → chunk-QAYRZTFU.cjs} +33 -33
  49. package/dist/{chunk-D4Q7BB3N.cjs.map → chunk-QAYRZTFU.cjs.map} +1 -1
  50. package/dist/{chunk-NIX7EG4G.js → chunk-RSJMF2YO.js} +4 -4
  51. package/dist/{chunk-5G3L6327.cjs → chunk-U7TTQV4N.cjs} +3 -3
  52. package/dist/{chunk-5G3L6327.cjs.map → chunk-U7TTQV4N.cjs.map} +1 -1
  53. package/dist/{chunk-C7AWXFDL.js → chunk-UQWJWIEK.js} +5 -5
  54. package/dist/{chunk-V6QYKYY2.js → chunk-VGZ7WZ7F.js} +4 -4
  55. package/dist/{chunk-RZPGGSSW.cjs → chunk-VOKLGRHX.cjs} +27 -27
  56. package/dist/{chunk-RZPGGSSW.cjs.map → chunk-VOKLGRHX.cjs.map} +1 -1
  57. package/dist/{chunk-CJBSU3XB.cjs → chunk-WRJVEB2J.cjs} +9 -2
  58. package/dist/chunk-WRJVEB2J.cjs.map +1 -0
  59. package/dist/{chunk-VBIFSOPQ.js → chunk-X3LC6R37.js} +3 -3
  60. package/dist/{chunk-5WGOAJ4B.js → chunk-X7LJRNMJ.js} +2 -2
  61. package/dist/{chunk-IP4OYYDY.cjs → chunk-XOREK735.cjs} +239 -175
  62. package/dist/chunk-XOREK735.cjs.map +1 -0
  63. package/dist/{chunk-EG4IKWY4.cjs → chunk-YB6RCW77.cjs} +7 -7
  64. package/dist/{chunk-EG4IKWY4.cjs.map → chunk-YB6RCW77.cjs.map} +1 -1
  65. package/dist/{chunk-YU5PQOEU.js → chunk-YCO4UA62.js} +8 -8
  66. package/dist/{chunk-FHR2JU2J.js → chunk-YQCA4ZEJ.js} +2 -2
  67. package/dist/{chunk-EVUDHIDB.cjs → chunk-YSCRM2AG.cjs} +28 -28
  68. package/dist/{chunk-EVUDHIDB.cjs.map → chunk-YSCRM2AG.cjs.map} +1 -1
  69. package/dist/{chunk-TMGTVVE2.js → chunk-YWFMYZ4G.js} +3 -3
  70. package/dist/components/calendar.cjs +4 -4
  71. package/dist/components/calendar.js +1 -1
  72. package/dist/components/case-studies/index.cjs +12 -12
  73. package/dist/components/case-studies/index.js +6 -6
  74. package/dist/components/chat/entity-cards/admin-content-card-grid.d.ts +45 -0
  75. package/dist/components/chat/entity-cards/admin-content-card-grid.d.ts.map +1 -0
  76. package/dist/components/chat/entity-cards/index.d.ts +1 -0
  77. package/dist/components/chat/entity-cards/index.d.ts.map +1 -1
  78. package/dist/components/chat/index.cjs +10 -4
  79. package/dist/components/chat/index.cjs.map +1 -1
  80. package/dist/components/chat/index.js +9 -3
  81. package/dist/components/contact/index.cjs +7 -7
  82. package/dist/components/contact/index.js +6 -6
  83. package/dist/components/docs/index.cjs +10 -10
  84. package/dist/components/docs/index.js +9 -9
  85. package/dist/components/embeds/index.cjs +7 -7
  86. package/dist/components/embeds/index.js +6 -6
  87. package/dist/components/faq/index.cjs +7 -7
  88. package/dist/components/faq/index.js +6 -6
  89. package/dist/components/features/command-box.d.ts +7 -5
  90. package/dist/components/features/command-box.d.ts.map +1 -1
  91. package/dist/components/features/index.cjs +6 -6
  92. package/dist/components/features/index.js +5 -5
  93. package/dist/components/help-center-pages/index.cjs +28 -28
  94. package/dist/components/help-center-pages/index.js +19 -19
  95. package/dist/components/index.cjs +76 -70
  96. package/dist/components/index.cjs.map +1 -1
  97. package/dist/components/index.js +25 -19
  98. package/dist/components/index.js.map +1 -1
  99. package/dist/components/meeting-scheduler/index.cjs +46 -46
  100. package/dist/components/meeting-scheduler/index.js +7 -7
  101. package/dist/components/navigation/index.cjs +9 -9
  102. package/dist/components/navigation/index.js +8 -8
  103. package/dist/components/onboarding-guides/index.cjs +9 -9
  104. package/dist/components/onboarding-guides/index.js +8 -8
  105. package/dist/components/related-content/index.cjs +5 -5
  106. package/dist/components/related-content/index.js +4 -4
  107. package/dist/components/tickets/index.cjs +11 -11
  108. package/dist/components/tickets/index.js +10 -10
  109. package/dist/components/ui/button/button-styles.d.ts +1 -0
  110. package/dist/components/ui/button/button-styles.d.ts.map +1 -1
  111. package/dist/components/ui/button/button.d.ts +1 -1
  112. package/dist/components/ui/button/button.d.ts.map +1 -1
  113. package/dist/components/ui/fade-preview.d.ts +25 -7
  114. package/dist/components/ui/fade-preview.d.ts.map +1 -1
  115. package/dist/components/ui/file-manager/index.cjs +11 -11
  116. package/dist/components/ui/file-manager/index.js +1 -1
  117. package/dist/components/ui/index.cjs +12 -6
  118. package/dist/components/ui/index.cjs.map +1 -1
  119. package/dist/components/ui/index.js +11 -5
  120. package/dist/components/ui/page-actions.d.ts +2 -2
  121. package/dist/components/ui/page-actions.d.ts.map +1 -1
  122. package/dist/index.cjs +16 -10
  123. package/dist/index.cjs.map +1 -1
  124. package/dist/index.js +15 -9
  125. package/dist/index.js.map +1 -1
  126. package/package.json +1 -1
  127. package/src/components/chat/entity-cards/__tests__/admin-content-card-grid.test.tsx +58 -0
  128. package/src/components/chat/entity-cards/admin-content-card-grid.tsx +127 -0
  129. package/src/components/chat/entity-cards/index.ts +6 -0
  130. package/src/components/features/.command-box.md +1 -1
  131. package/src/components/features/command-box.tsx +21 -13
  132. package/src/components/ui/.fade-preview.md +5 -1
  133. package/src/components/ui/button/button-styles.ts +6 -0
  134. package/src/components/ui/button/button.tsx +1 -0
  135. package/src/components/ui/fade-preview.tsx +92 -20
  136. package/src/components/ui/page-actions.tsx +2 -2
  137. package/src/stories/Button.stories.tsx +6 -1
  138. package/dist/chunk-CJBSU3XB.cjs.map +0 -1
  139. package/dist/chunk-IP4OYYDY.cjs.map +0 -1
  140. package/dist/chunk-VRUJPZ2C.js.map +0 -1
  141. package/dist/chunk-XAUPFCIJ.js.map +0 -1
  142. package/dist/chunk-XFYPKN2D.cjs.map +0 -1
  143. /package/dist/{chunk-V4OA6SVZ.js.map → chunk-2RTH6JR5.js.map} +0 -0
  144. /package/dist/{chunk-DTCNLA67.js.map → chunk-627V5GNY.js.map} +0 -0
  145. /package/dist/{chunk-6EHXQH7C.js.map → chunk-7LH2LC6N.js.map} +0 -0
  146. /package/dist/{chunk-DUI764J2.js.map → chunk-C2E3TDRF.js.map} +0 -0
  147. /package/dist/{chunk-AOGRJ4FT.js.map → chunk-DKNDJNSW.js.map} +0 -0
  148. /package/dist/{chunk-43JQ3SJS.js.map → chunk-EW6PYGB3.js.map} +0 -0
  149. /package/dist/{chunk-PQZGMNJQ.js.map → chunk-FDE52ADN.js.map} +0 -0
  150. /package/dist/{chunk-CIPIND3J.js.map → chunk-HOASBISN.js.map} +0 -0
  151. /package/dist/{chunk-SNWPBMPV.js.map → chunk-IYQRUTJI.js.map} +0 -0
  152. /package/dist/{chunk-VW57GX5O.js.map → chunk-P52MUJTG.js.map} +0 -0
  153. /package/dist/{chunk-MJJIQJGQ.js.map → chunk-PSANPD64.js.map} +0 -0
  154. /package/dist/{chunk-NIX7EG4G.js.map → chunk-RSJMF2YO.js.map} +0 -0
  155. /package/dist/{chunk-C7AWXFDL.js.map → chunk-UQWJWIEK.js.map} +0 -0
  156. /package/dist/{chunk-V6QYKYY2.js.map → chunk-VGZ7WZ7F.js.map} +0 -0
  157. /package/dist/{chunk-VBIFSOPQ.js.map → chunk-X3LC6R37.js.map} +0 -0
  158. /package/dist/{chunk-5WGOAJ4B.js.map → chunk-X7LJRNMJ.js.map} +0 -0
  159. /package/dist/{chunk-YU5PQOEU.js.map → chunk-YCO4UA62.js.map} +0 -0
  160. /package/dist/{chunk-FHR2JU2J.js.map → chunk-YQCA4ZEJ.js.map} +0 -0
  161. /package/dist/{chunk-TMGTVVE2.js.map → chunk-YWFMYZ4G.js.map} +0 -0
@@ -2,8 +2,10 @@
2
2
 
3
3
  import { ChevronDown } from 'lucide-react';
4
4
  import type React from 'react';
5
- import { useState, useRef } from 'react';
5
+ import { useEffect, useRef, useState } from 'react';
6
6
  import { useIsomorphicLayoutEffect } from '../../hooks/ui/use-isomorphic-layout-effect';
7
+ import { cn } from '../../utils/cn';
8
+ import { Button } from './button';
7
9
 
8
10
  /**
9
11
  * FadePreview — the single shared progressive-disclosure primitive for
@@ -18,26 +20,57 @@ import { useIsomorphicLayoutEffect } from '../../hooks/ui/use-isomorphic-layout-
18
20
  *
19
21
  * When `hiddenCount <= 0` the children render unclamped and no toggle
20
22
  * shows (single-entry sections need no disclosure).
23
+ *
24
+ * `fixedHeight` is the mode for a block whose height must not move (a list of
25
+ * command boxes, text filled in live): the collapsed height is held even when
26
+ * the content is shorter, overflow is MEASURED instead of counted, and the
27
+ * toggle row is always reserved. The block changes height only when the reader
28
+ * expands it. It never scrolls inside: the page stays the only scroll surface,
29
+ * so a wheel over the block always moves the page.
21
30
  */
22
31
  export interface FadePreviewProps {
23
32
  /** How many items are visually hidden while collapsed — drives the
24
33
  * "Show N more" label. Pass `total - visible`; `<= 0` disables the
25
- * clamp + fade + toggle entirely. */
26
- hiddenCount: number;
27
- /** Collapsed height in px. ~120 shows one changelog entry's title +
28
- * the start of its description before the mask kicks in. Callers with
29
- * taller rows (e.g. delivery tables) pass a larger value. */
30
- collapsedHeight?: number;
34
+ * clamp + fade + toggle entirely. Ignored under `fixedHeight`, which
35
+ * measures overflow itself. */
36
+ hiddenCount?: number;
37
+ /** Collapsed height: px, or any CSS length (e.g. a line-height token
38
+ * multiple). ~120px shows one changelog entry's title + the start of its
39
+ * description before the mask kicks in. Callers with taller rows (e.g.
40
+ * delivery tables) pass a larger value. */
41
+ collapsedHeight?: number | string;
31
42
  /** Reset the expanded state when this value changes — otherwise a
32
43
  * parent that refetches and shrinks the list would leave a stale
33
44
  * "expanded" state and a momentarily-wrong "Show 0 more" button.
34
45
  * Callers typically pass the item count. */
35
46
  resetKey?: unknown;
47
+ /** Hold the collapsed height for short content, measure overflow, reserve the toggle row. */
48
+ fixedHeight?: boolean;
49
+ /** Toggle wording. Defaults to "Show N more" / "Show less". */
50
+ labels?: { more: string; less: string };
51
+ /** Classes for the toggle button (e.g. its spacing inside a bordered box). */
52
+ toggleClassName?: string;
36
53
  children: React.ReactNode;
37
54
  }
38
55
 
39
- export function FadePreview({ hiddenCount, collapsedHeight = 120, resetKey, children }: FadePreviewProps) {
56
+ const cssLength = (value: number | string) => (typeof value === 'number' ? `${value}px` : value);
57
+
58
+ export function FadePreview({
59
+ hiddenCount = 0,
60
+ collapsedHeight = 120,
61
+ resetKey,
62
+ fixedHeight = false,
63
+ labels,
64
+ toggleClassName,
65
+ children,
66
+ }: FadePreviewProps) {
40
67
  const [expanded, setExpanded] = useState(false);
68
+ // Overflow is a MEASUREMENT (text wraps to the live width), so it is unknown
69
+ // until the first layout pass. Nothing about the block's HEIGHT depends on it:
70
+ // the collapsed height is in the markup and the toggle row is always
71
+ // reserved. Only the fade and the toggle's visibility wait for the measure,
72
+ // which on the client happens before paint.
73
+ const [overflows, setOverflows] = useState(false);
41
74
  const contentRef = useRef<HTMLDivElement>(null);
42
75
 
43
76
  // Collapse when the caller's `resetKey` changes. Adjusted while rendering —
@@ -63,26 +96,56 @@ export function FadePreview({ hiddenCount, collapsedHeight = 120, resetKey, chil
63
96
  useIsomorphicLayoutEffect(() => {
64
97
  const el = contentRef.current;
65
98
  if (!el) return;
66
- el.style.maxHeight = expanded ? `${el.scrollHeight}px` : `${collapsedHeight}px`;
99
+ if (!fixedHeight) {
100
+ el.style.maxHeight = expanded ? `${el.scrollHeight}px` : cssLength(collapsedHeight);
101
+ return;
102
+ }
103
+ // Fixed mode sets `height`, not `max-height`, so short content keeps the
104
+ // collapsed height too. Overflow is read while collapsed (content taller
105
+ // than the box), which is the only state the fade and the toggle depend on.
106
+ el.style.height = expanded ? `${el.scrollHeight}px` : cssLength(collapsedHeight);
107
+ if (!expanded) {
108
+ const next = el.scrollHeight > el.clientHeight + 1;
109
+ if (next !== overflows) setOverflows(next);
110
+ }
67
111
  });
68
112
 
69
- const needsFade = hiddenCount > 0;
113
+ // A width change re-wraps text without a React commit; re-measure then too.
114
+ useEffect(() => {
115
+ const el = contentRef.current;
116
+ if (!fixedHeight || !el || typeof ResizeObserver === 'undefined') return undefined;
117
+ const observer = new ResizeObserver(() => {
118
+ if (expanded) return;
119
+ setOverflows(el.scrollHeight > el.clientHeight + 1);
120
+ });
121
+ observer.observe(el);
122
+ return () => observer.disconnect();
123
+ }, [fixedHeight, expanded]);
124
+
125
+ const needsFade = fixedHeight ? overflows : hiddenCount > 0;
70
126
 
71
127
  // No disclosure needed → no clamp wrapper at all. (Keeping the wrapper
72
128
  // with a `scrollHeight ?? 2000` max-height would clip tall content on
73
129
  // the first render, before the ref measures.)
74
- if (!needsFade) return <>{children}</>;
130
+ if (!fixedHeight && !needsFade) return <>{children}</>;
131
+
132
+ const showToggle = needsFade || expanded;
133
+ const moreLabel = labels?.more ?? `Show ${hiddenCount} more`;
134
+ const lessLabel = labels?.less ?? 'Show less';
75
135
 
76
136
  return (
77
137
  <div className="relative">
78
138
  <div
79
139
  ref={contentRef}
80
- className="overflow-hidden transition-[max-height] duration-500"
140
+ className="overflow-hidden transition-[max-height,height] duration-500"
81
141
  style={{
82
142
  transitionTimingFunction: 'cubic-bezier(0.33, 1, 0.68, 1)',
83
- // `maxHeight` is intentionally absent — the layout effect above owns
84
- // it, because the expanded value is a live DOM measurement.
85
- ...(!expanded
143
+ // Fixed mode renders the collapsed height INTO the markup, so the
144
+ // server-rendered block is already clamped and hydration never shrinks
145
+ // it. The expanded value is a live DOM measurement, so the layout
146
+ // effect above owns it (and `maxHeight` in the counted mode).
147
+ ...(fixedHeight && !expanded ? { height: cssLength(collapsedHeight) } : {}),
148
+ ...(!expanded && needsFade
86
149
  ? {
87
150
  maskImage: 'linear-gradient(to bottom, black 30%, transparent 100%)',
88
151
  WebkitMaskImage: 'linear-gradient(to bottom, black 30%, transparent 100%)',
@@ -92,14 +155,23 @@ export function FadePreview({ hiddenCount, collapsedHeight = 120, resetKey, chil
92
155
  >
93
156
  {children}
94
157
  </div>
95
- <button
158
+ {/* The shared Button's quiet text-action variant. Fixed mode ALWAYS renders
159
+ the row so the block keeps its height; it is just not visible or
160
+ focusable while there is nothing to disclose. */}
161
+ <Button
96
162
  type="button"
163
+ variant="link"
164
+ size="compact"
165
+ noPaddingX
97
166
  onClick={() => setExpanded(!expanded)}
98
- className="mt-4 flex items-center gap-1.5 text-ods-text-secondary transition-colors duration-200 text-h6 hover:text-ods-accent"
167
+ aria-expanded={expanded}
168
+ aria-hidden={showToggle ? undefined : true}
169
+ tabIndex={showToggle ? undefined : -1}
170
+ rightIcon={<ChevronDown className={cn('transition-transform duration-300', expanded && 'rotate-180')} />}
171
+ className={cn('mt-[var(--spacing-system-mf)]', !showToggle && 'invisible', toggleClassName)}
99
172
  >
100
- <span>{expanded ? 'Show less' : `Show ${hiddenCount} more`}</span>
101
- <ChevronDown className={`h-3.5 w-3.5 transition-transform duration-300 ${expanded ? 'rotate-180' : ''}`} />
102
- </button>
173
+ {expanded ? lessLabel : moreLabel}
174
+ </Button>
103
175
  </div>
104
176
  );
105
177
  }
@@ -17,8 +17,8 @@ export type PageActionButton = {
17
17
  /** Click handler. Optional when `href` or `submenu` is provided. */
18
18
  onClick?: () => void;
19
19
  icon?: React.ReactNode;
20
- /** `overlay` is media chrome only — SplitButton has no divider colour for it. */
21
- variant?: Exclude<ButtonProps['variant'], 'overlay' | 'glyph'>;
20
+ /** `overlay` and `glyph` are media chrome and `link` an inline text action; none is a page action, and SplitButton has no divider colour for them. */
21
+ variant?: Exclude<ButtonProps['variant'], 'overlay' | 'glyph' | 'link'>;
22
22
  disabled?: boolean;
23
23
  /**
24
24
  * For SplitButton actions (when `iconAction` is set): disables only the main
@@ -24,7 +24,7 @@ const meta = {
24
24
  argTypes: {
25
25
  variant: {
26
26
  control: 'select',
27
- options: ['accent', 'outline', 'transparent', 'destructive', 'warning'],
27
+ options: ['accent', 'outline', 'transparent', 'destructive', 'warning', 'glyph', 'overlay', 'link'],
28
28
  },
29
29
  size: {
30
30
  control: 'select',
@@ -61,6 +61,11 @@ export const Warning: Story = {
61
61
  args: { children: 'Proceed with caution', variant: 'warning', leftIcon: <AlertTriangle /> },
62
62
  };
63
63
 
64
+ /** Quiet inline text action, e.g. the FadePreview "Show all" / "Show less" disclosure. */
65
+ export const Link: Story = {
66
+ args: { children: 'Show all', variant: 'link', size: 'compact', noPaddingX: true, rightIcon: <ChevronDown /> },
67
+ };
68
+
64
69
  // === Sizes ===
65
70
 
66
71
  export const SizeDefault: Story = {
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-CJBSU3XB.cjs","../src/components/ui/button/button.tsx","../src/components/ui/button/button-styles.ts","../src/components/ui/button/split-button.tsx"],"names":["cva","jsx","jsxs"],"mappings":"AAAA,yRAAY;AACZ;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACNA,iDAAqB;AACrB,kEAAuC;AACvC,4EAAkB;ADQlB;AACA;AERO,IAAM,qBAAA,EAAuB;AAAA,EAClC,MAAA,EACE,oJAAA;AAAA,EACF,OAAA,EACE,qMAAA;AAAA,EACF,WAAA,EACE,8MAAA;AAAA,EACF,WAAA,EACE,iJAAA;AAAA,EACF,OAAA,EACE,uJAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMF,KAAA,EACE,2MAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKF,OAAA,EACE;AACJ,CAAA;AAEO,IAAM,qBAAA,EACX,mJAAA;AAWK,IAAM,sB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AA;AACtE,QAAA;AACAD,wBAAAA;AAAC,UAAA;AAAA,UAAA;AACC,YAAA;AACA,YAAA;AACK,YAAA;AACL,YAAA;AACiB,YAAA;AACQ,YAAA;AACJ,YAAA;AACD,YAAA;AACa,YAAA;AACC,YAAA;AAE0B,YAAA;AAAA,UAAA;AAC9D,QAAA;AAAA,MAAA;AAAA,IAAA;AACF,EAAA;AAEH;AACyB;AHyT8F;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-CJBSU3XB.cjs","sourcesContent":[null,"'use client';\n\nimport { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport React from 'react';\nimport Link from '../../../embed-shims/next-link';\nimport { cn } from '../../../utils/cn';\nimport {\n buttonSurfaceClasses,\n outlineBorderClasses,\n splitDividerColorClasses,\n splitGlyphSizeBySize,\n} from './button-styles';\n\n// Default layout: centered single content area, padding/gap on the button itself.\nconst buttonVariants = cva(\n [\n 'relative inline-flex items-center justify-center gap-[var(--spacing-system-xsf)]',\n 'whitespace-nowrap rounded-md',\n 'transition-colors duration-200',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ods-focus',\n 'disabled:pointer-events-none',\n '[&_svg]:pointer-events-none [&_svg]:h-5 [&_svg]:w-5 [&_svg]:shrink-0',\n ],\n {\n variants: {\n variant: {\n accent: buttonSurfaceClasses.accent,\n outline: cn(buttonSurfaceClasses.outline, outlineBorderClasses),\n transparent: buttonSurfaceClasses.transparent,\n destructive: buttonSurfaceClasses.destructive,\n warning: buttonSurfaceClasses.warning,\n glyph: buttonSurfaceClasses.glyph,\n overlay: buttonSurfaceClasses.overlay,\n },\n size: {\n default: 'h-11 px-[var(--spacing-system-m)] py-[var(--spacing-system-sf)] text-h3 md:h-12',\n small: 'h-6 p-[var(--spacing-system-xs)] text-h5 md:h-8',\n // The CHILD is the affordance (a badge, a chip, a thumbnail): the button\n // contributes the hit target, the focus ring and the keyboard/ARIA\n // semantics, and NO box of its own. Without this, call sites reached for\n // a `className=\"h-auto p-0\"` override to cancel the default box.\n wrap: 'h-auto p-0',\n 'small-legacy': 'h-10 px-[var(--spacing-system-m)] py-[var(--spacing-system-xs)] text-[14px] font-bold', // Temporary alias for \"small\" — deprecated; grep size=\"small-legacy\" (lib + hub) and migrate the remaining consumers before removal\n // 24px pill for slim strips (announcement/promo bars, inline banner\n // actions — Primer banner / Polaris banner / Vercel-bar convention).\n // The label matches the strip's MESSAGE type ramp exactly (DM Sans\n // regular, 13px -> md:14px, snug leading — the announcement bar's\n // subtitle styling): in-strip CTAs must never read louder than the\n // message beside them, so this deliberately uses neither the\n // mono-uppercase control style of \"small\" nor a heavier weight.\n // Pinned h-6 across breakpoints (24px = the WCAG 2.5.8 target-size\n // floor) with horizontal-dominant padding and a 14px glyph.\n compact: 'h-6 px-[var(--spacing-system-sf)] py-0 font-normal text-h6 [&_svg]:h-3.5 [&_svg]:w-3.5',\n icon: 'h-11 w-11 p-[var(--spacing-system-sf)] md:h-12 md:w-12 [&_svg]:h-4 [&_svg]:w-4 md:[&_svg]:h-6 md:[&_svg]:w-6',\n // Quiet 32px icon target with a 16px glyph, fixed across breakpoints\n // (Carbon ghost sm / Primer medium / shadcn icon-sm all pin 32px;\n // ≥ the 24px WCAG 2.5.8 target floor). For icon actions that read as\n // metadata rather than CTAs — author-page social rows, share rows.\n // Pair with variant=\"transparent\" for the ghost treatment.\n 'icon-sm': 'h-8 w-8 p-[var(--spacing-system-xxs)] [&_svg]:h-4 [&_svg]:w-4',\n // 20px inline glyph for affordances that sit INSIDE a line of text —\n // an info hint beside a badge, a copy glyph after an id. `icon-sm`'s\n // 32px target is correct for a metadata row but visually swamps a\n // 10px badge or a 14px label, so hosts were reaching for className\n // overrides to shrink it. Below the WCAG 2.5.8 target floor on purpose:\n // this is only for glyphs whose information is ALSO available another\n // way (tooltip content mirrored into an aria-describedby node), never\n // for a sole means of performing an action.\n 'icon-inline': 'h-5 min-h-0 w-5 min-w-0 shrink-0 p-0 [&_svg]:h-3.5 [&_svg]:w-3.5',\n // Bare 56px media glyph (play / unmute over video). A size variant so\n // hosts stop re-implementing a <button> to escape the 20px svg cap.\n 'icon-glyph': 'h-14 w-14 p-0 [&_svg]:h-14 [&_svg]:w-14',\n },\n // Label typography axis (Figma 133-740). `bold` is the classic h3-bold\n // label; `regular` swaps the DEFAULT size's label to the h4 step\n // (DM Sans 500, neutral tracking) — added for navigation buttons.\n // `small` keeps its mono-uppercase h5 label on both fonts per the spec.\n font: {\n bold: '',\n regular: '',\n },\n fullWidth: {\n true: 'w-full',\n false: '',\n },\n noPaddingX: {\n true: 'px-0',\n false: '',\n },\n },\n compoundVariants: [\n { size: 'small', class: '[&_svg]:h-4 [&_svg]:w-4' },\n // Comes after the size classes, so cn()'s tailwind-merge resolves the\n // ods-typography group in favour of text-h4.\n { size: 'default', font: 'regular', class: 'text-h4' },\n ],\n defaultVariants: {\n variant: 'accent',\n size: 'default',\n font: 'bold',\n fullWidth: false,\n noPaddingX: false,\n },\n },\n);\n\n// Split layout (used when `splitIcon` is provided): outer button has no padding;\n// inner slots own padding/gap so the divider can span full button height.\nconst splitShellVariants = cva(\n [\n 'group relative inline-flex items-stretch overflow-hidden whitespace-nowrap rounded-md',\n 'transition-colors duration-200',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ods-focus',\n 'disabled:pointer-events-none',\n ],\n {\n variants: {\n variant: {\n accent: buttonSurfaceClasses.accent,\n outline: cn(buttonSurfaceClasses.outline, outlineBorderClasses),\n transparent: buttonSurfaceClasses.transparent,\n destructive: buttonSurfaceClasses.destructive,\n warning: buttonSurfaceClasses.warning,\n },\n size: {\n default: 'h-12',\n small: 'h-6 text-h5 md:h-8',\n },\n // Same label-typography axis as the normal layout — `regular` swaps the\n // default size's h3-bold label for the h4 (DM Sans 500) step.\n font: { bold: '', regular: '' },\n fullWidth: { true: 'w-full', false: '' },\n },\n compoundVariants: [\n { size: 'default', font: 'bold', class: 'text-h3' },\n { size: 'default', font: 'regular', class: 'text-h4' },\n ],\n defaultVariants: { variant: 'accent', size: 'default', font: 'bold', fullWidth: false },\n },\n);\n\nconst splitSlotVariants = cva(\n // Glyph size lives per-size, not in the base: cva concatenates base + variant\n // without tailwind-merge, so a base `[&_svg]:h-5` and a variant `[&_svg]:h-4`\n // would both ship and the winner would come down to stylesheet order.\n ['inline-flex items-center justify-center', '[&_svg]:shrink-0'],\n {\n variants: {\n slot: {\n main: 'gap-[var(--spacing-system-xsf)]',\n icon: 'border-l',\n },\n size: splitGlyphSizeBySize,\n variant: { accent: '', outline: '', transparent: '', destructive: '', warning: '' },\n fullWidth: { true: '', false: '' },\n },\n compoundVariants: [\n { slot: 'main', size: 'default', class: 'px-[var(--spacing-system-m)] py-[var(--spacing-system-sf)]' },\n { slot: 'main', size: 'small', class: 'px-[var(--spacing-system-xs)]' },\n // `fullWidth` stretches the SHELL, not its children, so without this the main\n // half stays content-sized and the icon half floats mid-button with dead space\n // after it instead of sitting flush against the trailing edge. Keyed on\n // `fullWidth` to match `SplitButton`, which grows its main half on exactly the\n // same condition (`grow={fullWidth}`) — the two split layouts render side by\n // side in the same rows and must not disagree. Callers that stretch the shell\n // some other way (a `flex-1` className, a grid cell) keep the old behaviour.\n { slot: 'main', fullWidth: true, class: 'flex-1' },\n { slot: 'icon', size: 'default', class: 'w-10' },\n { slot: 'icon', size: 'small', class: 'w-6 md:w-8' },\n {\n slot: 'icon',\n variant: 'accent',\n class: cn(\n splitDividerColorClasses.accent,\n 'group-disabled:border-ods-disabled group-aria-disabled:border-ods-disabled',\n ),\n },\n { slot: 'icon', variant: 'outline', class: splitDividerColorClasses.outline },\n { slot: 'icon', variant: 'transparent', class: splitDividerColorClasses.transparent },\n {\n slot: 'icon',\n variant: 'destructive',\n class: cn(\n splitDividerColorClasses.destructive,\n 'group-disabled:border-ods-disabled group-aria-disabled:border-ods-disabled',\n ),\n },\n {\n slot: 'icon',\n variant: 'warning',\n class: cn(\n splitDividerColorClasses.warning,\n 'group-disabled:border-ods-disabled group-aria-disabled:border-ods-disabled',\n ),\n },\n ],\n defaultVariants: { slot: 'main', size: 'default', variant: 'accent', fullWidth: false },\n },\n);\n\n/** @deprecated Use `size=\"small\"` instead. Temporary alias kept for backward compatibility; will be removed in the future. */\ntype DeprecatedButtonSize = 'small-legacy';\n\ntype ButtonSize =\n Exclude<VariantProps<typeof buttonVariants>['size'], 'small-legacy' | null | undefined> | DeprecatedButtonSize;\n\ninterface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>, Omit<VariantProps<typeof buttonVariants>, 'size'> {\n asChild?: boolean;\n href?: string;\n openInNewTab?: boolean;\n prefetch?: boolean;\n /**\n * Pre-resolved anchor bundle (from `useNavLink({ href, targetPlatform })`).\n * When set, renders the Button as `<Link>` with `href` / `target` / `rel`\n * / `onClick` spread from this object. Lets callers thread the unified\n * nav decision directly without `<Button asChild><a {...linkProps}/>`\n * gymnastics. Wins over the separate `href` / `openInNewTab` props.\n */\n /**\n * Render a plain `<a href download>` instead of a Next `<Link>`.\n * A download is a RESOURCE fetch, not a route change: `<Link>` would try to\n * prefetch/route it. Only meaningful together with `href`.\n */\n download?: boolean | string;\n linkProps?: {\n href: string;\n target?: '_blank';\n rel?: 'noopener noreferrer';\n onClick?: React.MouseEventHandler<HTMLAnchorElement>;\n } | null;\n leftIcon?: React.ReactNode;\n rightIcon?: React.ReactNode;\n /**\n * Renders a vertical divider and trailing icon area inside the button.\n * The whole button stays a single click target — the icon is decorative\n * (`aria-hidden`). For two independent click targets, use `<SplitButton>`.\n * Only honored when `size` is `\"default\"` or `\"small\"`.\n */\n splitIcon?: React.ReactNode;\n loading?: boolean;\n size?: ButtonSize;\n}\n\nconst Spinner = () => (\n <svg className=\"animate-spin\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <circle className=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" strokeWidth=\"4\" />\n <path\n className=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n />\n </svg>\n);\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(function ButtonImpl(\n {\n className,\n variant,\n size,\n font,\n fullWidth,\n noPaddingX,\n asChild,\n href,\n openInNewTab,\n prefetch,\n linkProps,\n download,\n leftIcon,\n rightIcon,\n splitIcon,\n loading,\n children,\n disabled,\n onClick,\n ...props\n },\n ref,\n) {\n const isDisabled = disabled || loading;\n\n // splitIcon is only supported for default/small sizes. With other sizes\n // (icon, small-legacy) we silently fall back to the normal layout.\n const useSplitLayout = !!splitIcon && (size === 'default' || size === 'small' || size === undefined);\n\n if (useSplitLayout) {\n const safeSize = size ?? 'default';\n const safeVariant = (variant ?? 'accent') as 'accent' | 'outline' | 'transparent' | 'destructive' | 'warning';\n const shellClasses = cn(splitShellVariants({ variant: safeVariant, size: safeSize, font, fullWidth }), className);\n const mainSlotClass = splitSlotVariants({ slot: 'main', size: safeSize, variant: safeVariant, fullWidth });\n const iconSlotClass = splitSlotVariants({ slot: 'icon', size: safeSize, variant: safeVariant });\n\n const splitContent = (\n <>\n <span className={cn('contents', loading && 'invisible')}>\n <span className={mainSlotClass}>\n {leftIcon && <span className=\"inline-flex items-center\">{leftIcon}</span>}\n {children}\n {rightIcon && <span className=\"inline-flex items-center\">{rightIcon}</span>}\n </span>\n <span aria-hidden=\"true\" className={iconSlotClass}>\n {splitIcon}\n </span>\n </span>\n {loading && (\n // Carries the glyph scale itself: this overlay is a SIBLING of the slots, so\n // it inherits neither their `[&_svg]` sizing nor a shell base rule (the shell\n // deliberately has none — see `splitSlotVariants`). Without it the spinner\n // renders unconstrained and fills the button. Reads the same per-size ramp the\n // slots do, so it matches the glyphs it covers at both breakpoints.\n <span\n className={cn(\n 'absolute inset-0 inline-flex items-center justify-center text-ods-text-primary',\n splitGlyphSizeBySize[safeSize],\n )}\n >\n <Spinner />\n </span>\n )}\n </>\n );\n\n // A download is a resource fetch, not a route change: same `Link` as every\n // other anchor branch (so a host that registered `next/link` keeps ONE\n // anchor implementation), with prefetch off — there is no route to warm,\n // and prefetching would fetch the file itself. Checked BEFORE the\n // linkProps/href resolution.\n if (download && href) {\n return (\n <Link\n href={href}\n download={download}\n prefetch={false}\n className={cn(shellClasses, isDisabled && 'pointer-events-none')}\n aria-label={props['aria-label']}\n >\n {splitContent}\n </Link>\n );\n }\n\n // `linkProps` (the pre-resolved bundle from `useNavLink({ href, targetPlatform })`)\n // wins over the legacy `href` + `openInNewTab` props so callers can thread\n // the unified nav decision directly. Either path produces the same `<Link>`.\n const splitAnchor =\n linkProps ??\n (href\n ? {\n href,\n target: openInNewTab ? ('_blank' as const) : undefined,\n rel: openInNewTab ? ('noopener noreferrer' as const) : undefined,\n onClick: onClick as unknown as React.MouseEventHandler<HTMLAnchorElement> | undefined,\n }\n : null);\n if (splitAnchor) {\n return (\n <Link\n href={splitAnchor.href}\n prefetch={prefetch}\n target={splitAnchor.target}\n rel={splitAnchor.rel}\n // The Link branches don't spread {...props} (button attrs don't\n // belong on an anchor), but the accessible name MUST survive —\n // icon-only link buttons have no text content.\n aria-label={props['aria-label']}\n aria-disabled={isDisabled || undefined}\n tabIndex={isDisabled ? -1 : undefined}\n className={cn(shellClasses, isDisabled && 'pointer-events-none')}\n onClick={splitAnchor.onClick}\n >\n {splitContent}\n </Link>\n );\n }\n\n return (\n <button ref={ref} className={shellClasses} disabled={isDisabled} onClick={onClick} {...props}>\n {splitContent}\n </button>\n );\n }\n\n const classes = cn(buttonVariants({ variant, size, font, fullWidth, noPaddingX }), className);\n\n // asChild: consumer fully controls the rendered element; we just stamp our classes.\n if (asChild) {\n return (\n <Slot ref={ref} className={classes} {...props}>\n {children}\n </Slot>\n );\n }\n\n // Real content stays in layout (preserving width) but goes invisible while loading.\n // The spinner is absolutely positioned so it never shifts the button's size.\n const content = (\n <>\n <span className={cn('contents', loading && 'invisible')}>\n {leftIcon && <span className=\"inline-flex items-center\">{leftIcon}</span>}\n {children}\n {rightIcon && <span className=\"inline-flex items-center\">{rightIcon}</span>}\n </span>\n {loading && (\n <span className=\"absolute inset-0 inline-flex items-center justify-center text-ods-text-primary\">\n <Spinner />\n </span>\n )}\n </>\n );\n\n // Same download short-circuit as the splitIcon branch.\n if (download && href) {\n return (\n <Link\n href={href}\n download={download}\n prefetch={false}\n className={cn(classes, isDisabled && 'pointer-events-none')}\n aria-label={props['aria-label']}\n >\n {content}\n </Link>\n );\n }\n\n // Same `linkProps`-wins-over-href resolution as the splitIcon branch.\n const anchor =\n linkProps ??\n (href\n ? {\n href,\n target: openInNewTab ? ('_blank' as const) : undefined,\n rel: openInNewTab ? ('noopener noreferrer' as const) : undefined,\n onClick: onClick as unknown as React.MouseEventHandler<HTMLAnchorElement> | undefined,\n }\n : null);\n if (anchor) {\n return (\n <Link\n href={anchor.href}\n prefetch={prefetch}\n target={anchor.target}\n rel={anchor.rel}\n // See the splitAnchor branch — keep the accessible name on the\n // anchor render (icon-only link buttons have no text content).\n aria-label={props['aria-label']}\n aria-disabled={isDisabled || undefined}\n tabIndex={isDisabled ? -1 : undefined}\n className={cn(classes, isDisabled && 'pointer-events-none')}\n onClick={anchor.onClick}\n >\n {content}\n </Link>\n );\n }\n\n return (\n <button ref={ref} className={classes} disabled={isDisabled} onClick={onClick} {...props}>\n {content}\n </button>\n );\n});\nButton.displayName = 'Button';\n\nexport { Button, buttonVariants, type ButtonProps };\n","// Shared style atoms for `Button` and `SplitButton`. Extracted to keep a single\n// source of truth for surface colors, outline borders, and split-divider colors.\n\n// Each variant pairs `disabled:` (real `<button disabled>`) with `aria-disabled:`\n// (used for `<Link aria-disabled>` since anchors don't support `:disabled`).\nexport const buttonSurfaceClasses = {\n accent:\n 'bg-ods-accent text-ods-text-on-accent hover:bg-ods-accent-hover active:bg-ods-accent-active disabled:bg-ods-disabled aria-disabled:bg-ods-disabled',\n outline:\n 'bg-ods-card text-ods-text-primary hover:bg-ods-bg-hover active:bg-ods-bg-active disabled:bg-ods-card disabled:text-ods-text-disabled aria-disabled:bg-ods-card aria-disabled:text-ods-text-disabled',\n transparent:\n 'bg-transparent text-ods-text-primary hover:bg-ods-bg-hover active:bg-ods-bg-active disabled:bg-transparent disabled:text-ods-text-disabled aria-disabled:bg-transparent aria-disabled:text-ods-text-disabled',\n destructive:\n 'bg-ods-error text-ods-text-on-accent hover:bg-ods-error-hover active:bg-ods-error-active disabled:bg-ods-disabled aria-disabled:bg-ods-disabled',\n warning:\n 'bg-ods-warning text-ods-text-on-accent hover:bg-ods-warning-hover active:bg-ods-warning-active disabled:bg-ods-disabled aria-disabled:bg-ods-disabled',\n // A self-contained glyph (play badge, unmute glyph) that already carries its\n // own scrim: no button surface at all, in any state. Distinct from\n // `transparent`, whose hover/active fills would paint a rectangle behind the\n // glyph — which is why call sites were undoing them with\n // `hover:bg-transparent active:bg-transparent`.\n glyph:\n 'bg-transparent text-ods-text-primary hover:bg-transparent active:bg-transparent disabled:bg-transparent disabled:text-ods-text-disabled aria-disabled:bg-transparent aria-disabled:text-ods-text-disabled',\n // Chrome that sits ON media (video cards, image lightboxes): a scrim disc so\n // the glyph stays legible over an arbitrary frame. Promoted to a variant\n // because the walkthrough card, its theater and the bite cards were each\n // stacking the same classes at the call site.\n overlay:\n 'rounded-full bg-ods-overlay text-ods-text-primary backdrop-blur-sm hover:text-ods-accent active:text-ods-accent-active disabled:text-ods-text-disabled aria-disabled:text-ods-text-disabled',\n} as const;\n\nexport const outlineBorderClasses =\n 'border border-ods-border hover:border-ods-border-hover active:border-ods-border-active disabled:border-ods-border aria-disabled:border-ods-border';\n\n// Glyph scale for the split-layout button family: 16px below md, 24px from md.\n//\n// Shared because the same page-header action renders through EITHER of the two\n// split layouts depending on its shape — `SplitButton` for two click targets, and\n// `Button` + `splitIcon` for one with a decorative trailing glyph — and the two sit\n// side by side in the same row. They used to disagree: `SplitButton` carried this\n// responsive scale while the `Button` split slots re-declared a flat 20px, so a\n// \"submenu\" action's icons rendered 4px smaller than its neighbour's on desktop.\n// `Button`'s own flat `[&_svg]:h-5` stays as it is for ordinary (non-split) buttons.\nexport const splitGlyphSizeClasses = '[&_svg]:h-4 [&_svg]:w-4 md:[&_svg]:h-6 md:[&_svg]:w-6';\n\n// Per-size glyph scale for `Button`'s split slots AND the loading overlay that\n// covers them, so those two read from ONE place — the overlay sits outside both\n// slots and inherits neither their sizing nor a shell base rule, so without this it\n// would have to restate a number, which is the divergence described above.\n//\n// Scoped to `Button` on purpose: `SplitButton` keeps its own `small` ramp\n// (12px → 16px, vs the flat 16px here) and only shares the `default` step through\n// `splitGlyphSizeClasses`. Aligning `small` too is a visible design change, so it is\n// not folded in here silently.\nexport const splitGlyphSizeBySize = {\n default: splitGlyphSizeClasses,\n small: '[&_svg]:h-4 [&_svg]:w-4',\n} as const;\n\n// Color of the vertical seam between the main and icon halves (split layouts).\nexport const splitDividerColorClasses = {\n accent: 'border-ods-accent-active',\n outline: 'border-ods-border',\n transparent: 'border-ods-border',\n destructive: 'border-ods-error-active',\n warning: 'border-ods-warning-active',\n} as const;\n\nexport type ButtonSurfaceVariant = keyof typeof buttonSurfaceClasses;\n","'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport React from 'react';\nimport Link from '../../../embed-shims/next-link';\nimport { cn } from '../../../utils/cn';\nimport { buttonSurfaceClasses, splitDividerColorClasses, splitGlyphSizeClasses } from './button-styles';\n\n// Two independent interactive halves: each a `<button>` or `<a>`. The seam is\n// a 1px border on the left edge of the icon half, colored per variant. For a\n// single-target variant (decorative trailing icon), use `<Button splitIcon>`.\n\nconst splitHalfBase = [\n 'relative inline-flex items-center justify-center gap-[var(--spacing-system-xsf)]',\n 'whitespace-nowrap transition-colors duration-200',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ods-focus focus-visible:z-10',\n 'disabled:pointer-events-none',\n '[&_svg]:pointer-events-none [&_svg]:shrink-0',\n];\n\nconst splitHalfVariants = cva(splitHalfBase, {\n variants: {\n variant: {\n accent: buttonSurfaceClasses.accent,\n outline: buttonSurfaceClasses.outline, // Outline border lives in compoundVariants so we can omit the seam edge.\n transparent: buttonSurfaceClasses.transparent,\n destructive: buttonSurfaceClasses.destructive,\n warning: buttonSurfaceClasses.warning,\n },\n size: {\n default: `h-10 px-[var(--spacing-system-m)] py-[var(--spacing-system-sf)] text-h3 md:h-12 ${splitGlyphSizeClasses}`,\n small: 'h-6 px-[var(--spacing-system-xs)] text-h5 md:h-8 [&_svg]:h-3 [&_svg]:w-3 md:[&_svg]:h-4 md:[&_svg]:w-4',\n },\n side: { main: '', icon: '' },\n soloOnMobile: { true: '', false: '' },\n },\n compoundVariants: [\n // Rounded corners + per-variant seam. The icon-side's left border is the divider.\n { variant: 'accent', side: 'main', class: 'rounded-l-md' },\n {\n variant: 'accent',\n side: 'icon',\n class: cn(\n 'rounded-r-md border-l',\n splitDividerColorClasses.accent,\n 'disabled:border-ods-disabled aria-disabled:border-ods-disabled',\n ),\n },\n { variant: 'destructive', side: 'main', class: 'rounded-l-md' },\n {\n variant: 'destructive',\n side: 'icon',\n class: cn(\n 'rounded-r-md border-l',\n splitDividerColorClasses.destructive,\n 'disabled:border-ods-disabled aria-disabled:border-ods-disabled',\n ),\n },\n { variant: 'warning', side: 'main', class: 'rounded-l-md' },\n {\n variant: 'warning',\n side: 'icon',\n class: cn(\n 'rounded-r-md border-l',\n splitDividerColorClasses.warning,\n 'disabled:border-ods-disabled aria-disabled:border-ods-disabled',\n ),\n },\n { variant: 'outline', side: 'main', class: 'rounded-l-md border-y border-l border-ods-border' },\n { variant: 'outline', side: 'icon', class: 'rounded-r-md border border-ods-border' },\n { variant: 'transparent', side: 'main', class: 'rounded-md' },\n { variant: 'transparent', side: 'icon', class: cn('rounded-md', splitDividerColorClasses.transparent) },\n\n // Icon half: per Figma, narrower than main height (default: 40×48; small: 32×32).\n { side: 'icon', size: 'default', class: 'w-10 px-0' },\n { side: 'icon', size: 'small', class: 'w-6 px-0 md:w-8' },\n\n { side: 'icon', soloOnMobile: true, class: 'max-md:hidden' },\n { side: 'main', soloOnMobile: true, class: 'max-md:rounded-r-md' },\n { variant: 'outline', side: 'main', soloOnMobile: true, class: 'max-md:border-r' },\n ],\n defaultVariants: { variant: 'accent', size: 'default', side: 'main', soloOnMobile: false },\n});\n\ntype SplitButtonVariant = NonNullable<VariantProps<typeof splitHalfVariants>['variant']>;\ntype SplitButtonSize = NonNullable<VariantProps<typeof splitHalfVariants>['size']>;\n\ninterface SplitButtonIconAction {\n icon: React.ReactNode;\n /** The icon half is interactive but has no visible text — needs an accessible name. */\n 'aria-label': string;\n onClick?: React.MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>;\n href?: string;\n /**\n * Opens `href` with `target=\"_blank\"`. Also marks the half as a new-tab\n * affordance, which hides it below `md` (set it for `onClick` handlers that\n * open a new tab/window themselves).\n */\n openInNewTab?: boolean;\n prefetch?: boolean;\n disabled?: boolean;\n}\n\ninterface SplitButtonProps {\n variant?: SplitButtonVariant;\n size?: SplitButtonSize;\n fullWidth?: boolean;\n className?: string;\n\n children: React.ReactNode;\n onClick?: React.MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>;\n href?: string;\n openInNewTab?: boolean;\n prefetch?: boolean;\n leftIcon?: React.ReactNode;\n rightIcon?: React.ReactNode;\n /** Disables both halves. Equivalent to `mainDisabled && iconAction.disabled`. */\n disabled?: boolean;\n /** Disables only the main half. Combine with `iconAction.disabled` for finer control. */\n mainDisabled?: boolean;\n type?: 'button' | 'submit' | 'reset';\n 'aria-label'?: string;\n groupAriaLabel?: string;\n\n iconAction: SplitButtonIconAction;\n}\n\ninterface HalfOptions {\n variant: SplitButtonVariant;\n size: SplitButtonSize;\n side: 'main' | 'icon';\n soloOnMobile?: boolean;\n href?: string;\n openInNewTab?: boolean;\n prefetch?: boolean;\n onClick?: React.MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>;\n disabled?: boolean;\n /** Stretch this half to fill the group's free space (the icon half stays fixed-width). */\n grow?: boolean;\n type?: 'button' | 'submit' | 'reset';\n ariaLabel?: string;\n children: React.ReactNode;\n}\n\nfunction Half({\n variant,\n size,\n side,\n soloOnMobile,\n href,\n openInNewTab,\n prefetch,\n onClick,\n disabled,\n grow,\n type = 'button',\n ariaLabel,\n children,\n}: HalfOptions) {\n const classes = cn(splitHalfVariants({ variant, size, side, soloOnMobile }), grow && 'flex-1');\n\n if (href) {\n return (\n <Link\n href={href}\n prefetch={prefetch}\n target={openInNewTab ? '_blank' : undefined}\n rel={openInNewTab ? 'noopener noreferrer' : undefined}\n aria-disabled={disabled || undefined}\n tabIndex={disabled ? -1 : undefined}\n aria-label={ariaLabel}\n className={cn(classes, disabled && 'pointer-events-none')}\n onClick={onClick}\n >\n {children}\n </Link>\n );\n }\n\n return (\n <button type={type} className={classes} disabled={disabled} aria-label={ariaLabel} onClick={onClick}>\n {children}\n </button>\n );\n}\n\nconst SplitButton = React.forwardRef<HTMLDivElement, SplitButtonProps>(function SplitButtonImpl(\n {\n variant = 'accent',\n size = 'default',\n fullWidth = false,\n className,\n children,\n onClick,\n href,\n openInNewTab,\n prefetch,\n leftIcon,\n rightIcon,\n disabled,\n mainDisabled,\n type,\n iconAction,\n 'aria-label': ariaLabel,\n groupAriaLabel,\n },\n ref,\n) {\n const soloOnMobile = !!iconAction.openInNewTab;\n\n return (\n <div\n ref={ref}\n role=\"group\"\n aria-label={groupAriaLabel}\n className={cn('inline-flex items-stretch', fullWidth && 'w-full', className)}\n >\n <Half\n variant={variant}\n size={size}\n side=\"main\"\n soloOnMobile={soloOnMobile}\n href={href}\n openInNewTab={openInNewTab}\n prefetch={prefetch}\n onClick={onClick}\n disabled={disabled || mainDisabled}\n grow={fullWidth}\n type={type}\n ariaLabel={ariaLabel}\n >\n {leftIcon && <span className=\"inline-flex items-center\">{leftIcon}</span>}\n <span>{children}</span>\n {rightIcon && <span className=\"inline-flex items-center\">{rightIcon}</span>}\n </Half>\n <Half\n variant={variant}\n size={size}\n side=\"icon\"\n soloOnMobile={soloOnMobile}\n href={iconAction.href}\n openInNewTab={iconAction.openInNewTab}\n prefetch={iconAction.prefetch}\n onClick={iconAction.onClick}\n disabled={disabled || iconAction.disabled}\n ariaLabel={iconAction['aria-label']}\n >\n <span className=\"inline-flex items-center\">{iconAction.icon}</span>\n </Half>\n </div>\n );\n});\nSplitButton.displayName = 'SplitButton';\n\nexport { SplitButton, type SplitButtonProps, type SplitButtonIconAction };\n"]}