@flamingo-stack/openframe-frontend-core 0.0.490 → 0.0.491-snapshot.20260729075221

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 (166) hide show
  1. package/dist/{chunk-BZMOEWWS.js → chunk-2PYQLIUO.js} +6 -6
  2. package/dist/{chunk-OQIMH2WQ.js → chunk-3K5DO443.js} +1513 -1213
  3. package/dist/{chunk-OQIMH2WQ.js.map → chunk-3K5DO443.js.map} +1 -1
  4. package/dist/{chunk-MPYDX5WX.js → chunk-4EP233AD.js} +4 -4
  5. package/dist/{chunk-2MKUHJ3O.cjs → chunk-5ACJ2R4W.cjs} +40 -40
  6. package/dist/{chunk-2MKUHJ3O.cjs.map → chunk-5ACJ2R4W.cjs.map} +1 -1
  7. package/dist/{chunk-AIRNG27G.js → chunk-5RG3EKF4.js} +6 -6
  8. package/dist/{chunk-D5LQMRPU.cjs → chunk-5SBZE42Q.cjs} +5 -5
  9. package/dist/{chunk-D5LQMRPU.cjs.map → chunk-5SBZE42Q.cjs.map} +1 -1
  10. package/dist/{chunk-RW2LPL72.js → chunk-6WTCJI5R.js} +2 -2
  11. package/dist/{chunk-AW63ET2A.cjs → chunk-7LSBFS2B.cjs} +19 -19
  12. package/dist/{chunk-AW63ET2A.cjs.map → chunk-7LSBFS2B.cjs.map} +1 -1
  13. package/dist/{chunk-EGXCWZYP.js → chunk-BNUVDEUB.js} +3 -3
  14. package/dist/{chunk-7I42V2OD.cjs → chunk-F3MAV5O5.cjs} +73 -73
  15. package/dist/{chunk-7I42V2OD.cjs.map → chunk-F3MAV5O5.cjs.map} +1 -1
  16. package/dist/{chunk-IEZ3YBAP.cjs → chunk-HQYWKCW6.cjs} +32 -32
  17. package/dist/{chunk-IEZ3YBAP.cjs.map → chunk-HQYWKCW6.cjs.map} +1 -1
  18. package/dist/{chunk-VDZO6IDR.js → chunk-IR4JBBC7.js} +5 -5
  19. package/dist/{chunk-WLM3F3WU.js → chunk-KGP2EFZX.js} +3 -3
  20. package/dist/{chunk-NGEFYPY7.js → chunk-LV4YLKDH.js} +4 -4
  21. package/dist/{chunk-GZK7FWJJ.js → chunk-QKWOBV55.js} +12 -12
  22. package/dist/chunk-QKWOBV55.js.map +1 -0
  23. package/dist/{chunk-6QK3ONDD.js → chunk-QUEY5MMS.js} +2 -2
  24. package/dist/{chunk-UZZT65PQ.cjs → chunk-RXSG3GEE.cjs} +40 -40
  25. package/dist/{chunk-UZZT65PQ.cjs.map → chunk-RXSG3GEE.cjs.map} +1 -1
  26. package/dist/{chunk-STYA77PH.cjs → chunk-SGL6URIJ.cjs} +12 -12
  27. package/dist/chunk-SGL6URIJ.cjs.map +1 -0
  28. package/dist/{chunk-6CJ2K7BD.js → chunk-SIOXS4F7.js} +3 -3
  29. package/dist/{chunk-EJQUYZXF.cjs → chunk-T4WSI43X.cjs} +12 -12
  30. package/dist/{chunk-EJQUYZXF.cjs.map → chunk-T4WSI43X.cjs.map} +1 -1
  31. package/dist/{chunk-KP5KRRD6.cjs → chunk-THC3K262.cjs} +3 -3
  32. package/dist/{chunk-KP5KRRD6.cjs.map → chunk-THC3K262.cjs.map} +1 -1
  33. package/dist/{chunk-BIKOJ4FH.cjs → chunk-TTYJAZ7P.cjs} +58 -32
  34. package/dist/chunk-TTYJAZ7P.cjs.map +1 -0
  35. package/dist/{chunk-6CFFISUC.js → chunk-TY35YWM3.js} +3 -3
  36. package/dist/{chunk-3IEVA5AO.cjs → chunk-UB2U2PZS.cjs} +93 -93
  37. package/dist/{chunk-3IEVA5AO.cjs.map → chunk-UB2U2PZS.cjs.map} +1 -1
  38. package/dist/{chunk-GUTYUMGV.cjs → chunk-UKATOUOR.cjs} +12 -12
  39. package/dist/{chunk-GUTYUMGV.cjs.map → chunk-UKATOUOR.cjs.map} +1 -1
  40. package/dist/{chunk-GMPYR3MX.cjs → chunk-VN7CHLAC.cjs} +33 -33
  41. package/dist/{chunk-GMPYR3MX.cjs.map → chunk-VN7CHLAC.cjs.map} +1 -1
  42. package/dist/{chunk-PB3BTZDU.js → chunk-WEUNPE3S.js} +139 -113
  43. package/dist/chunk-WEUNPE3S.js.map +1 -0
  44. package/dist/{chunk-VL2YMDPH.js → chunk-WMT6VNQM.js} +6 -6
  45. package/dist/{chunk-FY5XAW3H.cjs → chunk-WSU6TPGJ.cjs} +18 -18
  46. package/dist/{chunk-FY5XAW3H.cjs.map → chunk-WSU6TPGJ.cjs.map} +1 -1
  47. package/dist/{chunk-VUXNXWOQ.cjs → chunk-Y2Z7FIPR.cjs} +1899 -1599
  48. package/dist/chunk-Y2Z7FIPR.cjs.map +1 -0
  49. package/dist/components/case-studies/index.cjs +10 -10
  50. package/dist/components/case-studies/index.js +4 -4
  51. package/dist/components/chat/index.cjs +4 -4
  52. package/dist/components/chat/index.js +3 -3
  53. package/dist/components/contact/index.cjs +5 -5
  54. package/dist/components/contact/index.js +4 -4
  55. package/dist/components/docs/index.cjs +7 -7
  56. package/dist/components/docs/index.js +6 -6
  57. package/dist/components/embeds/index.cjs +5 -5
  58. package/dist/components/embeds/index.js +4 -4
  59. package/dist/components/faq/index.cjs +6 -6
  60. package/dist/components/faq/index.js +5 -5
  61. package/dist/components/features/index.cjs +4 -4
  62. package/dist/components/features/index.js +3 -3
  63. package/dist/components/features/select-button.d.ts.map +1 -1
  64. package/dist/components/help-center-pages/index.cjs +23 -23
  65. package/dist/components/help-center-pages/index.js +14 -14
  66. package/dist/components/index.cjs +161 -161
  67. package/dist/components/index.js +12 -12
  68. package/dist/components/layout/page-layout.d.ts +7 -1
  69. package/dist/components/layout/page-layout.d.ts.map +1 -1
  70. package/dist/components/layout/title-block.d.ts +23 -1
  71. package/dist/components/layout/title-block.d.ts.map +1 -1
  72. package/dist/components/navigation/index.cjs +4 -4
  73. package/dist/components/navigation/index.js +3 -3
  74. package/dist/components/navigation/navigation-sidebar-item.d.ts +23 -1
  75. package/dist/components/navigation/navigation-sidebar-item.d.ts.map +1 -1
  76. package/dist/components/navigation/navigation-sidebar.d.ts.map +1 -1
  77. package/dist/components/onboarding-guides/index.cjs +8 -8
  78. package/dist/components/onboarding-guides/index.js +7 -7
  79. package/dist/components/related-content/index.cjs +6 -6
  80. package/dist/components/related-content/index.js +5 -5
  81. package/dist/components/tickets/index.cjs +7 -7
  82. package/dist/components/tickets/index.js +6 -6
  83. package/dist/components/ui/autocomplete.d.ts.map +1 -1
  84. package/dist/components/ui/checkbox-block.d.ts.map +1 -1
  85. package/dist/components/ui/data-table/data-table-column-filter.d.ts.map +1 -1
  86. package/dist/components/ui/data-table/data-table-header.d.ts.map +1 -1
  87. package/dist/components/ui/data-table/data-table-skeleton.d.ts.map +1 -1
  88. package/dist/components/ui/date-picker.d.ts.map +1 -1
  89. package/dist/components/ui/field-wrapper.d.ts +10 -1
  90. package/dist/components/ui/field-wrapper.d.ts.map +1 -1
  91. package/dist/components/ui/file-manager/index.cjs +50 -50
  92. package/dist/components/ui/file-manager/index.js +1 -1
  93. package/dist/components/ui/floating-tooltip.d.ts +8 -1
  94. package/dist/components/ui/floating-tooltip.d.ts.map +1 -1
  95. package/dist/components/ui/index.cjs +4 -4
  96. package/dist/components/ui/index.js +3 -3
  97. package/dist/components/ui/input-trigger.d.ts.map +1 -1
  98. package/dist/components/ui/input.d.ts.map +1 -1
  99. package/dist/components/ui/page-actions.d.ts +7 -1
  100. package/dist/components/ui/page-actions.d.ts.map +1 -1
  101. package/dist/components/ui/radio-group.d.ts.map +1 -1
  102. package/dist/components/ui/search-input.d.ts.map +1 -1
  103. package/dist/components/ui/select.d.ts.map +1 -1
  104. package/dist/components/ui/tab-navigation.d.ts +10 -1
  105. package/dist/components/ui/tab-navigation.d.ts.map +1 -1
  106. package/dist/components/ui/tag-search-input.d.ts.map +1 -1
  107. package/dist/components/ui/textarea.d.ts.map +1 -1
  108. package/dist/components/ui/truncate-text.d.ts +2 -2
  109. package/dist/components/ui/truncate-text.d.ts.map +1 -1
  110. package/dist/hooks/index.cjs +4 -2
  111. package/dist/hooks/index.cjs.map +1 -1
  112. package/dist/hooks/index.js +3 -1
  113. package/dist/hooks/ui/index.d.ts +1 -0
  114. package/dist/hooks/ui/index.d.ts.map +1 -1
  115. package/dist/hooks/ui/use-is-truncated.d.ts +33 -0
  116. package/dist/hooks/ui/use-is-truncated.d.ts.map +1 -0
  117. package/dist/index.cjs +6 -4
  118. package/dist/index.cjs.map +1 -1
  119. package/dist/index.js +5 -3
  120. package/package.json +1 -1
  121. package/src/components/features/select-button.tsx +4 -1
  122. package/src/components/layout/page-layout.tsx +16 -0
  123. package/src/components/layout/title-block.tsx +106 -7
  124. package/src/components/navigation/navigation-sidebar-item.tsx +80 -30
  125. package/src/components/navigation/navigation-sidebar.tsx +106 -46
  126. package/src/components/ui/.field-wrapper.md +5 -4
  127. package/src/components/ui/.tab-navigation.md +14 -1
  128. package/src/components/ui/__tests__/tab-navigation.test.tsx +159 -0
  129. package/src/components/ui/autocomplete.tsx +13 -1
  130. package/src/components/ui/button/button.tsx +1 -1
  131. package/src/components/ui/checkbox-block.tsx +27 -3
  132. package/src/components/ui/data-table/data-table-column-filter.tsx +7 -1
  133. package/src/components/ui/data-table/data-table-header.tsx +4 -1
  134. package/src/components/ui/data-table/data-table-skeleton.tsx +7 -0
  135. package/src/components/ui/date-picker.tsx +15 -1
  136. package/src/components/ui/field-wrapper.tsx +12 -6
  137. package/src/components/ui/floating-tooltip.tsx +9 -1
  138. package/src/components/ui/input-trigger.tsx +8 -1
  139. package/src/components/ui/input.tsx +8 -1
  140. package/src/components/ui/page-actions.tsx +142 -30
  141. package/src/components/ui/radio-group.tsx +28 -3
  142. package/src/components/ui/search-input.tsx +2 -1
  143. package/src/components/ui/select.tsx +7 -0
  144. package/src/components/ui/tab-navigation.tsx +379 -158
  145. package/src/components/ui/tag-search-input.tsx +9 -2
  146. package/src/components/ui/textarea.tsx +8 -1
  147. package/src/components/ui/truncate-text.tsx +3 -18
  148. package/src/hooks/ui/index.ts +1 -0
  149. package/src/hooks/ui/use-is-truncated.ts +66 -0
  150. package/dist/chunk-BIKOJ4FH.cjs.map +0 -1
  151. package/dist/chunk-GZK7FWJJ.js.map +0 -1
  152. package/dist/chunk-PB3BTZDU.js.map +0 -1
  153. package/dist/chunk-STYA77PH.cjs.map +0 -1
  154. package/dist/chunk-VUXNXWOQ.cjs.map +0 -1
  155. /package/dist/{chunk-BZMOEWWS.js.map → chunk-2PYQLIUO.js.map} +0 -0
  156. /package/dist/{chunk-MPYDX5WX.js.map → chunk-4EP233AD.js.map} +0 -0
  157. /package/dist/{chunk-AIRNG27G.js.map → chunk-5RG3EKF4.js.map} +0 -0
  158. /package/dist/{chunk-RW2LPL72.js.map → chunk-6WTCJI5R.js.map} +0 -0
  159. /package/dist/{chunk-EGXCWZYP.js.map → chunk-BNUVDEUB.js.map} +0 -0
  160. /package/dist/{chunk-VDZO6IDR.js.map → chunk-IR4JBBC7.js.map} +0 -0
  161. /package/dist/{chunk-WLM3F3WU.js.map → chunk-KGP2EFZX.js.map} +0 -0
  162. /package/dist/{chunk-NGEFYPY7.js.map → chunk-LV4YLKDH.js.map} +0 -0
  163. /package/dist/{chunk-6QK3ONDD.js.map → chunk-QUEY5MMS.js.map} +0 -0
  164. /package/dist/{chunk-6CJ2K7BD.js.map → chunk-SIOXS4F7.js.map} +0 -0
  165. /package/dist/{chunk-6CFFISUC.js.map → chunk-TY35YWM3.js.map} +0 -0
  166. /package/dist/{chunk-VL2YMDPH.js.map → chunk-WMT6VNQM.js.map} +0 -0
@@ -1,6 +1,7 @@
1
1
  'use client'
2
2
 
3
- import React, { type ReactNode, useEffect, useRef, useState } from 'react'
3
+ import { type ReactNode } from 'react'
4
+ import { useIsTruncated } from '../../hooks/ui/use-is-truncated'
4
5
  import { cn } from '../../utils/cn'
5
6
  import { FloatingTooltip } from './floating-tooltip'
6
7
 
@@ -69,24 +70,8 @@ export function TruncateText({
69
70
  tone = 'primary',
70
71
  mono = false,
71
72
  }: TruncateTextProps) {
72
- const ref = useRef<HTMLSpanElement>(null)
73
- const [isTruncated, setIsTruncated] = useState(false)
74
73
  const isMultiLine = lines > 1
75
-
76
- useEffect(() => {
77
- const el = ref.current
78
- if (!el) return
79
- const check = () => {
80
- const overflows = isMultiLine
81
- ? el.scrollHeight > el.clientHeight + 1
82
- : el.scrollWidth > el.clientWidth + 1
83
- setIsTruncated(overflows)
84
- }
85
- check()
86
- const ro = new ResizeObserver(check)
87
- ro.observe(el)
88
- return () => ro.disconnect()
89
- }, [children, isMultiLine])
74
+ const { ref, isTruncated } = useIsTruncated<HTMLSpanElement>(children, { multiline: isMultiLine })
90
75
 
91
76
  const clampClass = isMultiLine
92
77
  ? LINE_CLAMP_CLASS[lines as Exclude<typeof lines, 1>]
@@ -6,6 +6,7 @@ export * from './use-focus-trap'
6
6
  export * from './use-header-height'
7
7
  export * from './use-horizontal-scrollbar'
8
8
  export * from './use-image-edge-color'
9
+ export * from './use-is-truncated'
9
10
  export * from './use-local-storage'
10
11
  export * from './use-marquee-engine'
11
12
  export * from './use-media-query'
@@ -0,0 +1,66 @@
1
+ 'use client'
2
+
3
+ import { useCallback, useEffect, useState } from 'react'
4
+
5
+ export interface UseIsTruncatedOptions {
6
+ /** Measure vertical clipping (`line-clamp-N`) instead of the single-line ellipsis. */
7
+ multiline?: boolean
8
+ }
9
+
10
+ /**
11
+ * Tracks whether an element's text is ACTUALLY clipped — the condition for
12
+ * offering a "full value" tooltip. Text that fits needs no tooltip, and showing
13
+ * one anyway just repeats what the user is already reading.
14
+ *
15
+ * Three things can change the answer, and all three are watched: the box
16
+ * resizing (`ResizeObserver`), the text itself changing, and the measured
17
+ * ELEMENT changing. None of them implies the others — new text inside a
18
+ * width-constrained box leaves the box exactly as it was, so the observer never
19
+ * fires; and a caller that swaps between render branches (adornment vs plain)
20
+ * mounts a different node under the same text, which a `useRef` would leave
21
+ * measured against the old, detached node. Pass the rendered value as `value`.
22
+ *
23
+ * `ref` is a CALLBACK ref, not a `RefObject` — that is what makes the element
24
+ * itself a dependency. Attach it exactly like a normal ref; there is no
25
+ * `.current` to read.
26
+ *
27
+ * ```tsx
28
+ * const { ref, isTruncated } = useIsTruncated<HTMLHeadingElement>(title)
29
+ * <FloatingTooltip content={title} disabled={!isTruncated}>
30
+ * <h1 ref={ref} className="truncate">{title}</h1>
31
+ * </FloatingTooltip>
32
+ * ```
33
+ */
34
+ export function useIsTruncated<T extends HTMLElement>(value: unknown, options?: UseIsTruncatedOptions) {
35
+ const multiline = options?.multiline ?? false
36
+ const [element, setElement] = useState<T | null>(null)
37
+ const [isTruncated, setIsTruncated] = useState(false)
38
+
39
+ // Wrapped so the identity stays stable across renders: passing the raw
40
+ // `useState` setter as a ref would be stable too, but this keeps the public
41
+ // shape a plain `RefCallback<T>` instead of a state dispatcher.
42
+ const ref = useCallback((node: T | null) => setElement(node), [])
43
+
44
+ useEffect(() => {
45
+ if (!element) {
46
+ setIsTruncated(false)
47
+ return
48
+ }
49
+ // The 1px tolerance absorbs sub-pixel layout rounding, which otherwise
50
+ // reports a permanent fractional "overflow" at some zoom levels / DPRs and
51
+ // leaves a tooltip armed on text that is fully visible.
52
+ const check = () => {
53
+ setIsTruncated(
54
+ multiline
55
+ ? element.scrollHeight > element.clientHeight + 1
56
+ : element.scrollWidth > element.clientWidth + 1,
57
+ )
58
+ }
59
+ check()
60
+ const observer = new ResizeObserver(check)
61
+ observer.observe(element)
62
+ return () => observer.disconnect()
63
+ }, [element, value, multiline])
64
+
65
+ return { ref, isTruncated }
66
+ }