laif-ds 0.2.74 → 0.2.76

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 (155) hide show
  1. package/dist/CHANGELOG.md +446 -0
  2. package/dist/agent-docs/adoption-report.json +615 -0
  3. package/dist/agent-docs/components/Accordion.md +46 -16
  4. package/dist/agent-docs/components/Alert.md +90 -95
  5. package/dist/agent-docs/components/AlertDialog.md +132 -126
  6. package/dist/agent-docs/components/AppEditor.md +90 -90
  7. package/dist/agent-docs/components/AppRadioGroup.md +18 -18
  8. package/dist/agent-docs/components/AppSidebar.md +129 -122
  9. package/dist/agent-docs/components/AppStepper.md +81 -77
  10. package/dist/agent-docs/components/AspectRatio.md +70 -62
  11. package/dist/agent-docs/components/AudioVisualizer.md +5 -5
  12. package/dist/agent-docs/components/Avatar.md +112 -113
  13. package/dist/agent-docs/components/Badge.md +123 -118
  14. package/dist/agent-docs/components/Breadcrumb.md +8 -1
  15. package/dist/agent-docs/components/Button.md +131 -129
  16. package/dist/agent-docs/components/Card.md +172 -147
  17. package/dist/agent-docs/components/Carousel.md +148 -129
  18. package/dist/agent-docs/components/Chat.md +121 -109
  19. package/dist/agent-docs/components/ChatMessage.md +72 -61
  20. package/dist/agent-docs/components/Checkbox.md +150 -135
  21. package/dist/agent-docs/components/CircularProgress.md +53 -49
  22. package/dist/agent-docs/components/CodeHighlighter.md +4 -4
  23. package/dist/agent-docs/components/Collapsible.md +114 -95
  24. package/dist/agent-docs/components/Command.md +141 -142
  25. package/dist/agent-docs/components/Confirmer.md +182 -175
  26. package/dist/agent-docs/components/ContextMenu.md +196 -191
  27. package/dist/agent-docs/components/DataCrossTable.md +114 -94
  28. package/dist/agent-docs/components/DataTable.md +32 -24
  29. package/dist/agent-docs/components/Dialog.md +130 -125
  30. package/dist/agent-docs/components/Drawer.md +141 -127
  31. package/dist/agent-docs/components/FilePreviewer.md +138 -139
  32. package/dist/agent-docs/components/FileUploader.md +149 -129
  33. package/dist/agent-docs/components/Form.md +3 -1
  34. package/dist/agent-docs/components/FormComposer.md +163 -137
  35. package/dist/agent-docs/components/GanttChart.md +125 -122
  36. package/dist/agent-docs/components/HoverCard.md +1 -1
  37. package/dist/agent-docs/components/Icon.md +98 -99
  38. package/dist/agent-docs/components/Input.md +173 -138
  39. package/dist/agent-docs/components/InputOtp.md +6 -1
  40. package/dist/agent-docs/components/InputSelector.md +94 -97
  41. package/dist/agent-docs/components/InterruptPrompt.md +4 -4
  42. package/dist/agent-docs/components/MarkdownRenderer.md +5 -2
  43. package/dist/agent-docs/components/Menubar.md +60 -57
  44. package/dist/agent-docs/components/MessageInput.md +134 -131
  45. package/dist/agent-docs/components/MessageList.md +110 -96
  46. package/dist/agent-docs/components/MultipleSelector.md +147 -146
  47. package/dist/agent-docs/components/NavigationMenu.md +6 -2
  48. package/dist/agent-docs/components/Popover.md +112 -103
  49. package/dist/agent-docs/components/PromptSuggestions.md +5 -5
  50. package/dist/agent-docs/components/RadioGroup.md +97 -90
  51. package/dist/agent-docs/components/Resizable.md +4 -1
  52. package/dist/agent-docs/components/ResizePrompt.md +12 -13
  53. package/dist/agent-docs/components/ScrollArea.md +6 -2
  54. package/dist/agent-docs/components/SecurePdfViewer.md +10 -6
  55. package/dist/agent-docs/components/Select.md +131 -132
  56. package/dist/agent-docs/components/Sheet.md +8 -1
  57. package/dist/agent-docs/components/ShikiHighlighter.md +5 -5
  58. package/dist/agent-docs/components/Sidebar.md +94 -85
  59. package/dist/agent-docs/components/Slider.md +62 -58
  60. package/dist/agent-docs/components/Sonner.md +1 -0
  61. package/dist/agent-docs/components/Spinner.md +14 -14
  62. package/dist/agent-docs/components/Stepper.md +93 -67
  63. package/dist/agent-docs/components/Switch.md +41 -42
  64. package/dist/agent-docs/components/TableSkeleton.md +8 -8
  65. package/dist/agent-docs/components/Tabs.md +106 -86
  66. package/dist/agent-docs/components/TextArea.md +51 -52
  67. package/dist/agent-docs/components/ThemeSwitcher.md +72 -69
  68. package/dist/agent-docs/components/Toaster.md +1 -0
  69. package/dist/agent-docs/components/Tooltip.md +102 -91
  70. package/dist/agent-docs/components/Typo.md +68 -65
  71. package/dist/agent-docs/components/WeeklyCalendar.md +63 -64
  72. package/dist/agent-docs/components-list.md +1 -0
  73. package/dist/agent-docs/manifest.json +5981 -0
  74. package/dist/agent-docs/truncated-cell.md +342 -0
  75. package/dist/components/editor/editor-hooks/use-update-toolbar.js +6 -6
  76. package/dist/components/editor/plugins/actions/counter-character-plugin.js +6 -6
  77. package/dist/components/editor/plugins/toolbar/font-format-toolbar-plugin.js +18 -18
  78. package/dist/components/editor/plugins/toolbar/history-toolbar-plugin.js +10 -10
  79. package/dist/components/editor/plugins/toolbar/toolbar-plugin.js +9 -9
  80. package/dist/components/ui/app-checkbox.js +1 -1
  81. package/dist/components/ui/app-dialog.js +70 -64
  82. package/dist/components/ui/app-editor.js +51 -51
  83. package/dist/components/ui/app-form.js +81 -81
  84. package/dist/components/ui/app-multiple-select-dropdown.js +36 -36
  85. package/dist/components/ui/app-select.js +109 -104
  86. package/dist/components/ui/app-sidebar.js +41 -41
  87. package/dist/components/ui/app-stepper.js +1 -1
  88. package/dist/components/ui/app-time-picker.js +18 -18
  89. package/dist/components/ui/app-tooltip.js +1 -1
  90. package/dist/components/ui/async-select.js +5 -5
  91. package/dist/components/ui/audio-visualizer.js +61 -58
  92. package/dist/components/ui/card.js +1 -1
  93. package/dist/components/ui/carousel.js +2 -2
  94. package/dist/components/ui/chart.js +1 -1
  95. package/dist/components/ui/chat-message.js +8 -8
  96. package/dist/components/ui/chat.js +86 -88
  97. package/dist/components/ui/command.js +2 -2
  98. package/dist/components/ui/copy-button.js +4 -4
  99. package/dist/components/ui/date-picker.js +20 -20
  100. package/dist/components/ui/file-preview/index.js +13 -13
  101. package/dist/components/ui/file-previewer.js +12 -11
  102. package/dist/components/ui/file-uploader.js +86 -78
  103. package/dist/components/ui/form.js +2 -2
  104. package/dist/components/ui/gantt/components/Chart/Bars/Bars.js +56 -56
  105. package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarItem/BarItem.js +12 -12
  106. package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsItems/BarItems.js +1 -1
  107. package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsRow.js +4 -4
  108. package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/RepeteadBars/RepeteadBars.js +2 -2
  109. package/dist/components/ui/gantt/components/Chart/Chart.js +23 -23
  110. package/dist/components/ui/gantt/components/Chart/Scale/Scale.js +1 -1
  111. package/dist/components/ui/gantt/components/Chart/Tree/Tree.js +34 -34
  112. package/dist/components/ui/gantt/components/Controls/Controls.js +5 -5
  113. package/dist/components/ui/gantt/components/Gantt/Gantt.js +4 -4
  114. package/dist/components/ui/gantt/hooks/useGanttCalculate.js +25 -18
  115. package/dist/components/ui/input-selector.js +1 -1
  116. package/dist/components/ui/input.js +23 -23
  117. package/dist/components/ui/kanban.js +8 -9
  118. package/dist/components/ui/markdown-renderer.js +41 -35
  119. package/dist/components/ui/message-input.js +45 -44
  120. package/dist/components/ui/multiple-selector.js +91 -82
  121. package/dist/components/ui/secure-pdf-viewer.js +19 -7
  122. package/dist/components/ui/sidebar.js +1 -1
  123. package/dist/components/ui/slider.js +1 -1
  124. package/dist/components/ui/spinner.js +4 -4
  125. package/dist/components/ui/stepper.js +157 -138
  126. package/dist/components/ui/tables/data-cross-table/data-cross-table-buttons.js +29 -29
  127. package/dist/components/ui/tables/data-cross-table/data-cross-table.js +258 -246
  128. package/dist/components/ui/tables/data-table/components/data-table-advanced-filter.js +4 -1
  129. package/dist/components/ui/tables/data-table/components/data-table-body.js +211 -367
  130. package/dist/components/ui/tables/data-table/components/data-table-filter-inputs.js +114 -112
  131. package/dist/components/ui/tables/data-table/components/data-table-filters.js +116 -96
  132. package/dist/components/ui/tables/data-table/components/data-table-header.js +211 -0
  133. package/dist/components/ui/tables/data-table/components/data-table-searchbar.js +8 -8
  134. package/dist/components/ui/tables/data-table/components/data-table-skeleton-rows.js +33 -0
  135. package/dist/components/ui/tables/data-table/data-table.js +258 -250
  136. package/dist/components/ui/tables/data-table/data-table.service.js +112 -97
  137. package/dist/components/ui/tables/data-table/data-table.utils.js +25 -15
  138. package/dist/components/ui/textarea.js +2 -2
  139. package/dist/components/ui/theme-switcher.js +1 -1
  140. package/dist/components/ui/toggle-group.js +2 -2
  141. package/dist/components/ui/truncated-cell.js +100 -0
  142. package/dist/components/ui/weekly-calendar/appointment-card.js +16 -16
  143. package/dist/components/ui/weekly-calendar/calendar-context.js +6 -6
  144. package/dist/components/ui/weekly-calendar/calendar-header.js +12 -12
  145. package/dist/components/ui/weekly-calendar/day-column.js +16 -16
  146. package/dist/components/ui/weekly-calendar/time-column.js +4 -4
  147. package/dist/components/ui/weekly-calendar/weekly-calendar.js +4 -4
  148. package/dist/hooks/use-audio-recording.js +1 -1
  149. package/dist/hooks/use-auto-scroll.js +18 -18
  150. package/dist/hooks/use-autosize-textarea.js +12 -13
  151. package/dist/index.d.ts +100 -45
  152. package/dist/index.js +362 -360
  153. package/dist/lib/utils.js +6 -6
  154. package/dist/styles.v3.css +1 -1
  155. package/package.json +14 -4
@@ -0,0 +1,342 @@
1
+ # TruncatedCell
2
+
3
+ The TruncatedCell component is designed to display text that may be too long for its container. It automatically detects when text is truncated and provides a popover to show the full content.
4
+
5
+ ## Features
6
+
7
+ - **Flexible Content**: Accepts plain text or rich ReactNode content
8
+ - **Automatic Truncation Detection**: Uses scrollWidth vs clientWidth comparison to detect if content is truncated
9
+ - **Responsive**: Re-checks truncation on resize using ResizeObserver for better performance
10
+ - **Controlled Popover**: Manages popover state programmatically for better UX
11
+ - **Eye Icon Hint**: Displays an eye icon hint only when content is truncated, with smooth fade-in animation
12
+ - **Button Visibility Control**: Optional `showButton` prop to control eye button visibility
13
+ - **Custom Popover Styling**: `popoverClassName` prop for custom popover content styling
14
+ - **Keyboard Accessibility**: Full keyboard navigation support (Enter/Space to open popover)
15
+ - **Screen Reader Support**: Proper ARIA labels and roles for accessibility
16
+ - **Empty State**: Shows "-" with muted styling when no content is provided
17
+ - **Custom Empty Fallback**: Supports a custom placeholder for empty values
18
+ - **Customizable Styling**: Supports custom CSS classes for container, cell, and popover
19
+ - **Dialog Title**: Optional title for the popover header
20
+ - **Custom Content**: Full JSX support for custom popover content
21
+ - **Hover Effects**: Smooth underline on content hover and button appearance
22
+ - **Scrollable Content**: Long content in popover is scrollable with max height
23
+ - **DX-first API**: Rich children work out of the box, and `text` is only needed when you want explicit popover/accessibility text
24
+
25
+ ## Usage
26
+
27
+ ```tsx
28
+ import { TruncatedCell } from "laif-ds";
29
+
30
+ // Basic usage with string content
31
+ <TruncatedCell text="Short text" />
32
+
33
+ // Long text that will be truncated
34
+ <TruncatedCell
35
+ text="This is a very long text that will be truncated because it exceeds the container width"
36
+ wrapperClassName="w-56"
37
+ />
38
+
39
+ // String children also work without text
40
+ <TruncatedCell wrapperClassName="w-56">
41
+ This is a string content
42
+ </TruncatedCell>
43
+
44
+ // Rich content works without duplicating text
45
+ <TruncatedCell wrapperClassName="w-56">
46
+ <div className="flex items-center gap-2">
47
+ <Avatar src="/avatar.jpg" />
48
+ <div className="min-w-0">
49
+ <p className="font-semibold">John Doe</p>
50
+ <p className="text-sm text-gray-600">john@example.com</p>
51
+ </div>
52
+ </div>
53
+ </TruncatedCell>
54
+
55
+ // Provide text when you want explicit popover or accessibility content
56
+ <TruncatedCell
57
+ text="John Doe - john@example.com"
58
+ title="User details"
59
+ wrapperClassName="w-56"
60
+ >
61
+ <UserSummary />
62
+ </TruncatedCell>
63
+
64
+ // With custom styling and title
65
+ <TruncatedCell
66
+ text="Custom styled truncated text"
67
+ title="Full Content"
68
+ wrapperClassName="w-40"
69
+ className="max-w-40"
70
+ />
71
+
72
+ // With custom popover content and styling
73
+ <TruncatedCell
74
+ text="Text with custom popover content"
75
+ title="Custom Content"
76
+ popoverContent={
77
+ <div className="space-y-3">
78
+ <p>Custom JSX content here</p>
79
+ <button>Action Button</button>
80
+ </div>
81
+ }
82
+ popoverClassName="max-w-md"
83
+ showButton={true}
84
+ />
85
+
86
+ // Hide the eye hint
87
+ <TruncatedCell
88
+ text="Text without eye button"
89
+ showButton={false}
90
+ />
91
+
92
+ // Empty text
93
+ <TruncatedCell text="" />
94
+
95
+ // Custom empty fallback
96
+ <TruncatedCell text="" emptyFallback="No value" />
97
+ ```
98
+
99
+ ## Props
100
+
101
+ | Prop | Type | Default | Description |
102
+ | ------------------ | ----------- | ----------- | ---------------------------------------------------------------------------- |
103
+ | `children` | `ReactNode` | `undefined` | Content to display |
104
+ | `text` | `string` | `undefined` | Optional text used for truncation detection, accessibility, and popover copy |
105
+ | `title` | `string` | `undefined` | Optional title for the popover dialog |
106
+ | `popoverContent` | `ReactNode` | `undefined` | Custom popover content (JSX) |
107
+ | `wrapperClassName` | `string` | `""` | Preferred CSS classes for the wrapper container |
108
+ | `className` | `string` | `""` | CSS classes for the cell content |
109
+ | `popoverClassName` | `string` | `""` | CSS classes for the popover content |
110
+ | `showButton` | `boolean` | `true` | Flag used to show/hide the eye hint |
111
+ | `emptyFallback` | `ReactNode` | `"-"` | Custom placeholder rendered when no content is available |
112
+
113
+ ## Behavior
114
+
115
+ ### Truncation Detection
116
+
117
+ - Component monitors the text element's scrollWidth vs clientWidth
118
+ - If scrollWidth > clientWidth, the text is considered truncated
119
+ - Detection runs on mount and on resize
120
+ - When `text` is not provided, the component also extracts `textContent` from the rendered node to power the default popover content
121
+
122
+ ### Visual States
123
+
124
+ 1. **Normal State**: Text is displayed with truncation (CSS `truncate`)
125
+ 2. **Truncated State**: Text is truncated + eye icon hint appears
126
+ 3. **Empty State**: Shows "-" when text is empty/undefined
127
+ 4. **Popover State**: Opens when there is content to inspect, and the eye icon hint appears only when the rendered value is truncated
128
+
129
+ ### Styling
130
+
131
+ - Container: `flex max-w-60 gap-2` + custom classes
132
+ - Text container: `flex min-w-0 flex-1`
133
+ - Text element: `w-full min-w-0 truncate whitespace-nowrap`
134
+ - Popover: `w-96` with `whitespace-pre-wrap` for multiline support
135
+
136
+ ### Content Types
137
+
138
+ The TruncatedCell component supports two main usage patterns:
139
+
140
+ #### 1. String Content (Simple)
141
+
142
+ ```tsx
143
+ // Direct text prop
144
+ <TruncatedCell text="Simple text content" />
145
+
146
+ // String children (text prop optional)
147
+ <TruncatedCell wrapperClassName="w-56">
148
+ String content as children
149
+ </TruncatedCell>
150
+ ```
151
+
152
+ #### 2. ReactNode Content (Advanced)
153
+
154
+ ```tsx
155
+ // Rich children work without text
156
+ <TruncatedCell wrapperClassName="w-56">
157
+ <div className="flex items-center gap-2">
158
+ <Avatar src="/avatar.jpg" />
159
+ <div className="min-w-0">
160
+ <p className="font-semibold">John Doe</p>
161
+ <p className="text-sm text-gray-600">john@example.com</p>
162
+ </div>
163
+ </div>
164
+ </TruncatedCell>
165
+
166
+ // Add text when you want explicit popover content
167
+ <TruncatedCell text="User profile - John Doe" wrapperClassName="w-56">
168
+ <UserSummary />
169
+ </TruncatedCell>
170
+ ```
171
+
172
+ ### Choosing Between `children` and `text`
173
+
174
+ - Use `text` for the simplest plain-text case
175
+ - Use `children` when you need custom rendering inside the truncated area
176
+ - Add `text` together with `children` when the rendered content is visual or abbreviated and you want more descriptive text in the popover
177
+
178
+ ```tsx
179
+ // Plain text
180
+ <TruncatedCell text="Contract pending signature" />
181
+
182
+ // Rich UI with automatic text extraction
183
+ <TruncatedCell wrapperClassName="w-56">
184
+ <div>Complex content</div>
185
+ </TruncatedCell>
186
+
187
+ // Rich UI with explicit popover and a11y text
188
+ <TruncatedCell text="Complex content description" wrapperClassName="w-56">
189
+ <div>Complex content</div>
190
+ </TruncatedCell>
191
+ ```
192
+
193
+ ### Custom Popover Content
194
+
195
+ The `popoverContent` prop allows you to override the default text display with custom JSX content:
196
+
197
+ - **Full Flexibility**: Any React components can be used as popover content
198
+ - **Backward Compatible**: When not provided, defaults to displaying the text with Typo component
199
+ - **Title Support**: Works seamlessly with the `title` prop for popover headers
200
+ - **Custom Styling**: Use `popoverClassName` to style the popover container
201
+ - **Button Control**: Use `showButton` to control eye hint visibility
202
+ - **Open Behavior**: Custom popover content can open even when the displayed value itself is not truncated
203
+
204
+ ```tsx
205
+ <TruncatedCell
206
+ text="User profile"
207
+ title="User Details"
208
+ popoverContent={
209
+ <div className="space-y-2">
210
+ <div className="flex items-center gap-2">
211
+ <Avatar src="/avatar.jpg" />
212
+ <div>
213
+ <p className="font-semibold">John Doe</p>
214
+ <p className="text-sm text-gray-600">john@example.com</p>
215
+ </div>
216
+ </div>
217
+ <div className="flex gap-2">
218
+ <Button size="sm">Edit</Button>
219
+ <Button size="sm" variant="outline">
220
+ View Profile
221
+ </Button>
222
+ </div>
223
+ </div>
224
+ }
225
+ popoverClassName="max-w-md"
226
+ showButton={true}
227
+ />
228
+ ```
229
+
230
+ ### Button Visibility Control
231
+
232
+ The `showButton` prop gives you control over the eye hint visibility:
233
+
234
+ ```tsx
235
+ // Show eye hint (default)
236
+ <TruncatedCell text="Long text that will be truncated" showButton={true} />
237
+
238
+ // Hide eye hint
239
+ <TruncatedCell text="Long text without eye hint" showButton={false} />
240
+ ```
241
+
242
+ ### Empty Fallback
243
+
244
+ ```tsx
245
+ // Default placeholder
246
+ <TruncatedCell text="" />
247
+
248
+ // Custom placeholder
249
+ <TruncatedCell text="" emptyFallback="No value" />
250
+ ```
251
+
252
+ ### Popover Styling
253
+
254
+ The `popoverClassName` prop allows custom styling of the popover container:
255
+
256
+ ```tsx
257
+ <TruncatedCell
258
+ text="Custom styled popover"
259
+ popoverClassName="max-w-md bg-blue-50 border-blue-200"
260
+ />
261
+ ```
262
+
263
+ ## Technical Details
264
+
265
+ ### Dependencies
266
+
267
+ - React hooks: `useState`, `useEffect`, `useRef`, `useCallback`
268
+ - Laif-DS components: `Popover`, `PopoverContent`, `PopoverTrigger`, `Typo`, `Icon`
269
+ - Utility: `cn` for class merging
270
+
271
+ ### Performance Optimizations
272
+
273
+ - **ResizeObserver**: Uses modern ResizeObserver API for better performance than window resize events
274
+ - **useCallback**: Memoizes truncation check function to prevent unnecessary re-renders
275
+ - **Controlled State**: Manages popover state programmatically to avoid prop drilling
276
+ - **Cleanup**: Proper cleanup of observers and event listeners
277
+ - **Optimized Re-renders**: Only re-checks truncation when content changes
278
+
279
+ ### Event Handling
280
+
281
+ - ResizeObserver for element-specific resize detection
282
+ - Fallback window resize listener for older browsers
283
+ - Click on the cell trigger opens the popover when available
284
+ - Keyboard support (Enter/Space keys)
285
+ - Hover effects with smooth transitions
286
+
287
+ ### Accessibility Features
288
+
289
+ - **Semantic Trigger**: Uses a real `button` element as the interactive trigger
290
+ - **Keyboard Navigation**: Full support for Enter and Space keys
291
+ - **Screen Reader Labels**: Dynamic `aria-label` based on truncation state
292
+ - **Focus Management**: Native button focus behavior
293
+ - **Semantic HTML**: Popover content remains accessible even for multiline values
294
+
295
+ ## Accessibility
296
+
297
+ - Text container has cursor pointer to indicate interactivity
298
+ - Hover state provides visual feedback
299
+ - Popover provides full text access for screen readers
300
+ - Eye icon provides a clear visual hint that more content is available
301
+
302
+ ## Examples
303
+
304
+ ### In a Table Cell
305
+
306
+ ```tsx
307
+ const TableCell = ({ value }: { value: string }) => (
308
+ <TruncatedCell text={value} wrapperClassName="w-56" className="py-2" />
309
+ );
310
+ ```
311
+
312
+ ### With Maximum Width Constraint
313
+
314
+ ```tsx
315
+ <TruncatedCell
316
+ text="Constrained width text that will truncate"
317
+ wrapperClassName="w-32"
318
+ />
319
+ ```
320
+
321
+ ### Multiline Text Support
322
+
323
+ ```tsx
324
+ <TruncatedCell text="Line 1\nLine 2\nLine 3" className="max-w-48" />
325
+ ```
326
+
327
+ ## Comparison with Alternatives
328
+
329
+ ### vs Tooltip
330
+
331
+ - **TruncatedCell**: Supports click-to-inspect content, and visually hints with the eye icon when text is actually truncated
332
+ - **Tooltip**: Always shows on hover regardless of truncation
333
+
334
+ ### vs CSS text-overflow alone
335
+
336
+ - **TruncatedCell**: Provides access to full content
337
+ - **CSS only**: Content is inaccessible when truncated
338
+
339
+ ### vs Expandable Text
340
+
341
+ - **TruncatedCell**: Compact, popover-based approach
342
+ - **Expandable**: Takes more space, inline expansion
@@ -1,20 +1,20 @@
1
1
  "use client";
2
- import { useEffect as r } from "react";
3
2
  import { useLexicalComposerContext as n } from "../../../node_modules/@lexical/react/LexicalComposerContext.prod.js";
4
- import { SELECTION_CHANGE_COMMAND as m, $getSelection as i, COMMAND_PRIORITY_CRITICAL as f } from "../../../node_modules/lexical/Lexical.prod.js";
3
+ import { SELECTION_CHANGE_COMMAND as m, $getSelection as r, COMMAND_PRIORITY_CRITICAL as f } from "../../../node_modules/lexical/Lexical.prod.js";
4
+ import { useEffect as i } from "react";
5
5
  import { useToolbarContext as C } from "../context/toolbar-context.js";
6
6
  function c(t) {
7
7
  const [s] = n(), { activeEditor: o } = C();
8
- r(() => o.registerCommand(
8
+ i(() => o.registerCommand(
9
9
  m,
10
10
  () => {
11
- const e = i();
11
+ const e = r();
12
12
  return e && t(e), !1;
13
13
  },
14
14
  f
15
- ), [s, t]), r(() => {
15
+ ), [s, t, o]), i(() => {
16
16
  o.getEditorState().read(() => {
17
- const e = i();
17
+ const e = r();
18
18
  e && t(e);
19
19
  });
20
20
  }, [o, t]);
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { jsxs as o } from "react/jsx-runtime";
3
- import { useState as a, useEffect as u } from "react";
4
- import { useLexicalComposerContext as d } from "../../../../node_modules/@lexical/react/LexicalComposerContext.prod.js";
5
- import { $rootTextContent as f } from "../../../../node_modules/@lexical/text/LexicalText.prod.js";
3
+ import { useLexicalComposerContext as a } from "../../../../node_modules/@lexical/react/LexicalComposerContext.prod.js";
4
+ import { $rootTextContent as u } from "../../../../node_modules/@lexical/text/LexicalText.prod.js";
5
+ import { useState as d, useEffect as f } from "react";
6
6
  let s = null;
7
7
  function h() {
8
8
  return window.TextEncoder === void 0 ? null : (s === null && (s = new window.TextEncoder()), s);
@@ -24,14 +24,14 @@ const c = (t, e) => {
24
24
  function T({
25
25
  charset: t = "UTF-16"
26
26
  }) {
27
- const [e] = d(), [n, l] = a(() => {
28
- const r = e.getEditorState().read(f);
27
+ const [e] = a(), [n, l] = d(() => {
28
+ const r = e.getEditorState().read(u);
29
29
  return {
30
30
  characters: c(r, t),
31
31
  words: i(r)
32
32
  };
33
33
  });
34
- return u(() => e.registerTextContentListener((r) => {
34
+ return f(() => e.registerTextContentListener((r) => {
35
35
  l({
36
36
  characters: c(r, t),
37
37
  words: i(r)
@@ -1,44 +1,44 @@
1
1
  "use client";
2
2
  import { jsx as i } from "react/jsx-runtime";
3
- import { useState as m } from "react";
4
- import { $isTableSelection as l } from "../../../../node_modules/@lexical/table/LexicalTable.prod.js";
5
- import { FORMAT_TEXT_COMMAND as n, $isRangeSelection as d } from "../../../../node_modules/lexical/Lexical.prod.js";
3
+ import { $isTableSelection as m } from "../../../../node_modules/@lexical/table/LexicalTable.prod.js";
4
+ import { FORMAT_TEXT_COMMAND as l, $isRangeSelection as n } from "../../../../node_modules/lexical/Lexical.prod.js";
5
+ import { useState as d } from "react";
6
6
  import { useToolbarContext as c } from "../../context/toolbar-context.js";
7
7
  import { useUpdateToolbarHandler as p } from "../../editor-hooks/use-update-toolbar.js";
8
8
  import { Toggle as f } from "../../../ui/toggle.js";
9
9
  import u from "../../../../node_modules/lucide-react/dist/esm/icons/code.js";
10
10
  import T from "../../../../node_modules/lucide-react/dist/esm/icons/strikethrough.js";
11
- import b from "../../../../node_modules/lucide-react/dist/esm/icons/underline.js";
12
- import g from "../../../../node_modules/lucide-react/dist/esm/icons/italic.js";
13
- import h from "../../../../node_modules/lucide-react/dist/esm/icons/bold.js";
11
+ import h from "../../../../node_modules/lucide-react/dist/esm/icons/underline.js";
12
+ import b from "../../../../node_modules/lucide-react/dist/esm/icons/italic.js";
13
+ import g from "../../../../node_modules/lucide-react/dist/esm/icons/bold.js";
14
14
  const C = {
15
- bold: h,
16
- italic: g,
17
- underline: b,
15
+ bold: g,
16
+ italic: b,
17
+ underline: h,
18
18
  strikethrough: T,
19
19
  code: u
20
20
  };
21
21
  function R({
22
- format: o
22
+ format: r
23
23
  }) {
24
- const { activeEditor: a } = c(), [r, t] = m(!1);
25
- p((e) => {
26
- (d(e) || l(e)) && t(e.hasFormat(o));
24
+ const { activeEditor: a } = c(), [e, t] = d(!1);
25
+ p((o) => {
26
+ (n(o) || m(o)) && "hasFormat" in o && t(o.hasFormat(r));
27
27
  });
28
- const s = C[o];
28
+ const s = C[r];
29
29
  return /* @__PURE__ */ i(
30
30
  f,
31
31
  {
32
32
  "aria-label": "Toggle bold",
33
33
  variant: "outline",
34
34
  size: "sm",
35
- defaultPressed: r,
36
- pressed: r,
35
+ defaultPressed: e,
36
+ pressed: e,
37
37
  onPressedChange: t,
38
38
  onClick: () => {
39
39
  a.dispatchCommand(
40
- n,
41
- o
40
+ l,
41
+ r
42
42
  );
43
43
  },
44
44
  children: /* @__PURE__ */ i(s, { className: "h-4 w-4" })
@@ -1,16 +1,16 @@
1
1
  "use client";
2
2
  import { jsxs as f, jsx as o } from "react/jsx-runtime";
3
- import { useState as s, useEffect as u } from "react";
4
- import { useLexicalComposerContext as N } from "../../../../node_modules/@lexical/react/LexicalComposerContext.prod.js";
5
- import { mergeRegister as b } from "../../../../node_modules/@lexical/utils/LexicalUtils.prod.js";
6
- import { CAN_REDO_COMMAND as R, COMMAND_PRIORITY_CRITICAL as n, CAN_UNDO_COMMAND as M, UNDO_COMMAND as O, REDO_COMMAND as D } from "../../../../node_modules/lexical/Lexical.prod.js";
3
+ import { useLexicalComposerContext as u } from "../../../../node_modules/@lexical/react/LexicalComposerContext.prod.js";
4
+ import { mergeRegister as N } from "../../../../node_modules/@lexical/utils/LexicalUtils.prod.js";
5
+ import { CAN_REDO_COMMAND as b, COMMAND_PRIORITY_CRITICAL as n, CAN_UNDO_COMMAND as R, UNDO_COMMAND as M, REDO_COMMAND as O } from "../../../../node_modules/lexical/Lexical.prod.js";
6
+ import { useState as s, useEffect as D } from "react";
7
7
  import { useToolbarContext as g } from "../../context/toolbar-context.js";
8
8
  import { Button as d } from "../../../ui/button.js";
9
9
  import x from "../../../../node_modules/lucide-react/dist/esm/icons/undo.js";
10
10
  import A from "../../../../node_modules/lucide-react/dist/esm/icons/redo.js";
11
11
  function j() {
12
- const [i] = N(), { activeEditor: t, $updateToolbar: a } = g(), [r, l] = s(i.isEditable()), [m, c] = s(!1), [C, p] = s(!1);
13
- return u(() => b(
12
+ const [i] = u(), { activeEditor: t, $updateToolbar: a } = g(), [r, l] = s(i.isEditable()), [m, c] = s(!1), [C, p] = s(!1);
13
+ return D(() => N(
14
14
  i.registerEditableListener((e) => {
15
15
  l(e);
16
16
  }),
@@ -20,12 +20,12 @@ function j() {
20
20
  });
21
21
  }),
22
22
  t.registerCommand(
23
- M,
23
+ R,
24
24
  (e) => (c(e), !1),
25
25
  n
26
26
  ),
27
27
  t.registerCommand(
28
- R,
28
+ b,
29
29
  (e) => (p(e), !1),
30
30
  n
31
31
  )
@@ -35,7 +35,7 @@ function j() {
35
35
  {
36
36
  disabled: !m || !r,
37
37
  onClick: () => {
38
- t.dispatchCommand(O, void 0);
38
+ t.dispatchCommand(M, void 0);
39
39
  },
40
40
  title: "Undo (⌘Z)",
41
41
  type: "button",
@@ -51,7 +51,7 @@ function j() {
51
51
  {
52
52
  disabled: !C || !r,
53
53
  onClick: () => {
54
- t.dispatchCommand(D, void 0);
54
+ t.dispatchCommand(O, void 0);
55
55
  },
56
56
  title: "Redo (⇧⌘Z)",
57
57
  type: "button",
@@ -1,23 +1,23 @@
1
1
  "use client";
2
2
  import { jsxs as p } from "react/jsx-runtime";
3
- import { useState as e, useEffect as d } from "react";
4
- import { useLexicalComposerContext as u } from "../../../../node_modules/@lexical/react/LexicalComposerContext.prod.js";
5
- import { SELECTION_CHANGE_COMMAND as f, COMMAND_PRIORITY_CRITICAL as C } from "../../../../node_modules/lexical/Lexical.prod.js";
3
+ import { useLexicalComposerContext as d } from "../../../../node_modules/@lexical/react/LexicalComposerContext.prod.js";
4
+ import { SELECTION_CHANGE_COMMAND as u, COMMAND_PRIORITY_CRITICAL as f } from "../../../../node_modules/lexical/Lexical.prod.js";
5
+ import { useState as e, useEffect as C } from "react";
6
6
  import { ToolbarContext as T } from "../../context/toolbar-context.js";
7
7
  import { useEditorModal as E } from "../../editor-hooks/use-modal.js";
8
8
  function O({
9
9
  children: s
10
10
  }) {
11
- const [o] = u(), [t, a] = e(o), [r, i] = e("paragraph"), [m, n] = E(), l = () => {
11
+ const [t] = d(), [o, a] = e(t), [r, i] = e("paragraph"), [m, n] = E(), l = () => {
12
12
  };
13
- return d(() => t.registerCommand(
14
- f,
13
+ return C(() => o.registerCommand(
14
+ u,
15
15
  (M, c) => (a(c), !1),
16
- C
17
- ), [o]), /* @__PURE__ */ p(
16
+ f
17
+ ), [t, o]), /* @__PURE__ */ p(
18
18
  T,
19
19
  {
20
- activeEditor: t,
20
+ activeEditor: o,
21
21
  $updateToolbar: l,
22
22
  blockType: r,
23
23
  setBlockType: i,
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { jsxs as s, jsx as e, Fragment as $ } from "react/jsx-runtime";
3
+ import * as A from "react";
3
4
  import { designTokens as v } from "../design-tokens.js";
4
5
  import { cn as r } from "../../lib/utils.js";
5
- import * as A from "react";
6
6
  import { Checkbox as H } from "./checkbox.js";
7
7
  import { Icon as L } from "./icon.js";
8
8
  import { Label as R } from "./label.js";