torch-glare 2.4.0 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (264) hide show
  1. package/README.md +8 -0
  2. package/apps/lib/components/ActionButton.tsx +7 -12
  3. package/apps/lib/components/ActionsGroup.tsx +4 -15
  4. package/apps/lib/components/AlertDialog.tsx +173 -191
  5. package/apps/lib/components/Avatar.tsx +13 -16
  6. package/apps/lib/components/Badge.tsx +1 -3
  7. package/apps/lib/components/BadgeField.tsx +76 -71
  8. package/apps/lib/components/Breadcrumb.tsx +49 -85
  9. package/apps/lib/components/Button.tsx +20 -19
  10. package/apps/lib/components/ButtonGroup.tsx +31 -41
  11. package/apps/lib/components/Calendar.tsx +51 -29
  12. package/apps/lib/components/Card.tsx +2 -13
  13. package/apps/lib/components/ChartBlockTool.ts +17 -52
  14. package/apps/lib/components/Checkbox.tsx +9 -16
  15. package/apps/lib/components/ContextMenu.tsx +97 -96
  16. package/apps/lib/components/CountBadge.tsx +4 -6
  17. package/apps/lib/components/DataTable.tsx +196 -216
  18. package/apps/lib/components/DataViews/DataViewRadio.tsx +1 -6
  19. package/apps/lib/components/DataViews/DataViewsConfigPanel.tsx +13 -47
  20. package/apps/lib/components/DataViews/DataViewsHeader.tsx +1 -3
  21. package/apps/lib/components/DataViews/DataViewsLayout.tsx +5 -12
  22. package/apps/lib/components/DataViews/FilterPanel.tsx +155 -149
  23. package/apps/lib/components/DataViews/HeaderSearch.tsx +1 -5
  24. package/apps/lib/components/DataViews/InboxView.tsx +22 -68
  25. package/apps/lib/components/DataViews/InboxViewCard.tsx +68 -77
  26. package/apps/lib/components/DataViews/KanbanView.tsx +8 -25
  27. package/apps/lib/components/DataViews/PanelControls.tsx +3 -13
  28. package/apps/lib/components/DataViews/SettingsPanel.tsx +83 -89
  29. package/apps/lib/components/DataViews/TableView.tsx +8 -28
  30. package/apps/lib/components/DataViews/TreeView.tsx +12 -40
  31. package/apps/lib/components/DataViews/badgeAdapter.ts +32 -28
  32. package/apps/lib/components/DataViews/fieldRenderers.tsx +106 -141
  33. package/apps/lib/components/DataViews/filters/DatePickerRangeFilter.tsx +30 -23
  34. package/apps/lib/components/DataViews/filters/DateRangePopover.tsx +39 -32
  35. package/apps/lib/components/DataViews/filters/PresetChips.tsx +15 -15
  36. package/apps/lib/components/DataViews/filters/RangeSliderWithInputs.tsx +69 -58
  37. package/apps/lib/components/DataViews/index.ts +26 -26
  38. package/apps/lib/components/DataViews/tree/TreeDrawer.tsx +12 -16
  39. package/apps/lib/components/DataViews/tree/TreeSidebar.tsx +28 -31
  40. package/apps/lib/components/DataViews/types.ts +104 -115
  41. package/apps/lib/components/DatePicker.tsx +198 -196
  42. package/apps/lib/components/Dialog.tsx +92 -105
  43. package/apps/lib/components/Divider.tsx +21 -24
  44. package/apps/lib/components/Drawer.tsx +79 -139
  45. package/apps/lib/components/DropdownMenu.tsx +131 -171
  46. package/apps/lib/components/FieldHint.tsx +4 -11
  47. package/apps/lib/components/Form.tsx +146 -155
  48. package/apps/lib/components/FormStepper.tsx +9 -39
  49. package/apps/lib/components/HeaderBar.tsx +1 -9
  50. package/apps/lib/components/ImageAttachment.tsx +111 -73
  51. package/apps/lib/components/InnerLabelField.tsx +20 -16
  52. package/apps/lib/components/Input.tsx +171 -172
  53. package/apps/lib/components/InputField.tsx +44 -45
  54. package/apps/lib/components/InputOTP.tsx +68 -69
  55. package/apps/lib/components/Label.tsx +31 -35
  56. package/apps/lib/components/LabelField.tsx +4 -5
  57. package/apps/lib/components/LabeledCheckBox.tsx +8 -12
  58. package/apps/lib/components/LabeledRadio.tsx +7 -5
  59. package/apps/lib/components/LinkButton.tsx +2 -9
  60. package/apps/lib/components/LoginButton.tsx +4 -9
  61. package/apps/lib/components/PasswordLevel.tsx +5 -5
  62. package/apps/lib/components/Popover.tsx +15 -33
  63. package/apps/lib/components/ProfileMenu.tsx +67 -72
  64. package/apps/lib/components/Radio.tsx +1 -5
  65. package/apps/lib/components/RadioCard.tsx +9 -28
  66. package/apps/lib/components/ScrollArea.tsx +45 -43
  67. package/apps/lib/components/SearchField.tsx +49 -39
  68. package/apps/lib/components/SearchableSelect.tsx +8 -14
  69. package/apps/lib/components/SearchableTable.tsx +108 -118
  70. package/apps/lib/components/SearchableTree.tsx +469 -0
  71. package/apps/lib/components/SearchableTreeDialog.tsx +493 -0
  72. package/apps/lib/components/SectionBlock.tsx +4 -16
  73. package/apps/lib/components/Select.tsx +53 -80
  74. package/apps/lib/components/SimpleSelect.tsx +196 -187
  75. package/apps/lib/components/Skeleton.tsx +9 -12
  76. package/apps/lib/components/SlideDatePicker.tsx +215 -166
  77. package/apps/lib/components/SpinLoading.tsx +33 -49
  78. package/apps/lib/components/Stepper.tsx +13 -56
  79. package/apps/lib/components/Switch.tsx +8 -10
  80. package/apps/lib/components/TabFormItem.tsx +3 -12
  81. package/apps/lib/components/TabSwitch.tsx +7 -34
  82. package/apps/lib/components/Table.tsx +60 -75
  83. package/apps/lib/components/TableDnDWrapper.ts +15 -48
  84. package/apps/lib/components/TextEditor.tsx +93 -104
  85. package/apps/lib/components/Textarea.tsx +8 -12
  86. package/apps/lib/components/Timeline.tsx +21 -41
  87. package/apps/lib/components/Toast.tsx +83 -83
  88. package/apps/lib/components/Toggle.tsx +112 -114
  89. package/apps/lib/components/ToggleButton.tsx +1 -1
  90. package/apps/lib/components/Tooltip.tsx +24 -19
  91. package/apps/lib/components/TransparentLabel.tsx +61 -62
  92. package/apps/lib/components/TreeDropDown.tsx +86 -52
  93. package/apps/lib/components/TreeFolder/TreeFolder.tsx +15 -48
  94. package/apps/lib/components/TreeFolder/TreeFolderBreadcrumb.tsx +16 -21
  95. package/apps/lib/components/TreeFolder/TreeFolderRow.tsx +9 -20
  96. package/apps/lib/components/TreeFolder/TreeFolderStyles.tsx +3 -3
  97. package/apps/lib/components/TreeFolder/icons.tsx +14 -17
  98. package/apps/lib/components/TreeFolder/index.ts +15 -8
  99. package/apps/lib/components/TreeFolder/treeFolderUtils.ts +47 -52
  100. package/apps/lib/components/TreeFolder/types.ts +32 -32
  101. package/apps/lib/components/TreeFolder/useTreeFolderDnD.ts +117 -123
  102. package/apps/lib/hooks/useActiveTreeItem.ts +52 -55
  103. package/apps/lib/hooks/useClickOutside.ts +21 -20
  104. package/apps/lib/hooks/useDataViewsState.ts +86 -80
  105. package/apps/lib/hooks/useIsMobile.ts +12 -12
  106. package/apps/lib/hooks/useResize.ts +54 -65
  107. package/apps/lib/hooks/useTagSelection.ts +201 -201
  108. package/apps/lib/layouts/CNLayout.tsx +181 -140
  109. package/apps/lib/layouts/DataViewCard.tsx +4 -18
  110. package/apps/lib/layouts/FieldSection.tsx +2 -6
  111. package/apps/lib/layouts/TreeSubLayout.tsx +24 -38
  112. package/apps/lib/providers/ThemeProvider.tsx +8 -23
  113. package/apps/lib/registry.json +1004 -0
  114. package/apps/lib/tsconfig.json +9 -0
  115. package/apps/lib/utils/cn.ts +1 -1
  116. package/apps/lib/utils/dataViews/columnUtils.ts +46 -44
  117. package/apps/lib/utils/dataViews/fieldUtils.ts +70 -71
  118. package/apps/lib/utils/dataViews/nestedDataUtils.tsx +129 -122
  119. package/apps/lib/utils/dataViews/pathUtils.ts +74 -67
  120. package/apps/lib/utils/dataViews/rangeUtils.ts +121 -112
  121. package/apps/lib/utils/dataViews/treeUtils.ts +204 -211
  122. package/apps/lib/utils/dateFormat.ts +64 -54
  123. package/apps/lib/utils/markdownParser.ts +2 -7
  124. package/apps/lib/utils/resize.ts +21 -25
  125. package/apps/lib/utils/types.ts +13 -13
  126. package/dist/bin/index.js +8 -2
  127. package/dist/bin/index.js.map +1 -1
  128. package/dist/src/shared/getAvailableFiles.d.ts.map +1 -1
  129. package/dist/src/shared/getAvailableFiles.js +6 -1
  130. package/dist/src/shared/getAvailableFiles.js.map +1 -1
  131. package/dist/src/shared/loadRegistry.d.ts +7 -0
  132. package/dist/src/shared/loadRegistry.d.ts.map +1 -0
  133. package/dist/src/shared/loadRegistry.js +31 -0
  134. package/dist/src/shared/loadRegistry.js.map +1 -0
  135. package/dist/src/shared/resolveInstallPlan.d.ts +12 -0
  136. package/dist/src/shared/resolveInstallPlan.d.ts.map +1 -0
  137. package/dist/src/shared/resolveInstallPlan.js +39 -0
  138. package/dist/src/shared/resolveInstallPlan.js.map +1 -0
  139. package/dist/src/types/main.d.ts +24 -0
  140. package/dist/src/types/main.d.ts.map +1 -1
  141. package/docs/README.md +10 -2
  142. package/docs/components/action-button.md +30 -24
  143. package/docs/components/actions-group.md +26 -20
  144. package/docs/components/alert-dialog.md +45 -45
  145. package/docs/components/avatar.md +6 -2
  146. package/docs/components/badge-field.md +6 -2
  147. package/docs/components/badge.md +7 -1
  148. package/docs/components/breadcrumb.md +15 -40
  149. package/docs/components/button-group.md +13 -10
  150. package/docs/components/button.md +58 -33
  151. package/docs/components/calendar.md +26 -19
  152. package/docs/components/card.md +19 -16
  153. package/docs/components/chart-block-tool.md +128 -0
  154. package/docs/components/checkbox.md +16 -8
  155. package/docs/components/cn-layout.md +7 -1
  156. package/docs/components/context-menu.md +18 -25
  157. package/docs/components/count-badge.md +7 -1
  158. package/docs/components/data-table.md +45 -33
  159. package/docs/components/data-views-config-panel.md +15 -11
  160. package/docs/components/data-views-layout.md +13 -16
  161. package/docs/components/date-picker.md +30 -23
  162. package/docs/components/dialog.md +43 -42
  163. package/docs/components/divider.md +10 -4
  164. package/docs/components/drawer.md +8 -33
  165. package/docs/components/dropdown-menu.md +25 -34
  166. package/docs/components/field-hint.md +37 -25
  167. package/docs/components/field-section.md +9 -3
  168. package/docs/components/form-stepper.md +6 -0
  169. package/docs/components/form.md +17 -20
  170. package/docs/components/header-bar.md +6 -0
  171. package/docs/components/image-attachment.md +33 -41
  172. package/docs/components/inbox-view.md +16 -5
  173. package/docs/components/inner-label-field.md +34 -24
  174. package/docs/components/input-field.md +18 -10
  175. package/docs/components/input-otp.md +14 -11
  176. package/docs/components/input.md +22 -16
  177. package/docs/components/kanban-view.md +15 -5
  178. package/docs/components/label-field.md +32 -22
  179. package/docs/components/label.md +43 -32
  180. package/docs/components/labeled-check-box.md +16 -8
  181. package/docs/components/labeled-radio.md +18 -11
  182. package/docs/components/link-button.md +7 -1
  183. package/docs/components/login-button.md +8 -2
  184. package/docs/components/password-level.md +37 -24
  185. package/docs/components/popover.md +26 -23
  186. package/docs/components/profile-menu.md +38 -27
  187. package/docs/components/radio-card.md +16 -9
  188. package/docs/components/radio.md +16 -8
  189. package/docs/components/scroll-area.md +6 -2
  190. package/docs/components/search-field.md +14 -6
  191. package/docs/components/searchable-select.md +19 -14
  192. package/docs/components/searchable-table.md +18 -13
  193. package/docs/components/searchable-tree-dialog.md +190 -0
  194. package/docs/components/searchable-tree.md +200 -0
  195. package/docs/components/section-block.md +12 -4
  196. package/docs/components/select.md +23 -18
  197. package/docs/components/simple-select.md +14 -10
  198. package/docs/components/skeleton.md +43 -33
  199. package/docs/components/slide-date-picker.md +37 -29
  200. package/docs/components/spin-loading.md +32 -23
  201. package/docs/components/stepper.md +6 -0
  202. package/docs/components/switch.md +14 -6
  203. package/docs/components/tab-form-item.md +7 -1
  204. package/docs/components/tab-switch.md +13 -6
  205. package/docs/components/table-dnd-wrapper.md +105 -0
  206. package/docs/components/table-view.md +15 -5
  207. package/docs/components/table.md +28 -28
  208. package/docs/components/text-editor.md +19 -13
  209. package/docs/components/textarea.md +15 -7
  210. package/docs/components/timeline.md +6 -0
  211. package/docs/components/toast.md +35 -26
  212. package/docs/components/toggle-button.md +24 -21
  213. package/docs/components/toggle.md +23 -15
  214. package/docs/components/tooltip.md +42 -30
  215. package/docs/components/transparent-label.md +29 -20
  216. package/docs/components/tree-drop-down.md +31 -23
  217. package/docs/components/tree-sub-layout.md +6 -2
  218. package/docs/components/tree-view.md +16 -5
  219. package/docs/explanation/architecture.md +54 -0
  220. package/docs/explanation/design-system.md +52 -0
  221. package/docs/how-to/data-views-from-backend-response.md +6 -4
  222. package/docs/how-to/guides.md +24 -18
  223. package/docs/migration/changelog.md +38 -0
  224. package/docs/reference/cli.md +87 -0
  225. package/docs/reference/components.md +11 -12
  226. package/docs/reference/hooks.md +8 -8
  227. package/docs/reference/providers.md +22 -22
  228. package/docs/reference/tailwind-plugins.md +2 -2
  229. package/docs/reference/theme.md +85 -0
  230. package/docs/reference/types.md +4 -4
  231. package/docs/reference/utilities.md +19 -26
  232. package/docs/tutorials/building-first-form.md +20 -13
  233. package/docs/tutorials/component-composition.md +34 -50
  234. package/docs/tutorials/getting-started.md +2 -2
  235. package/docs/tutorials/theming-basics.md +13 -10
  236. package/package.json +31 -3
  237. package/dist/src/commands/block.d.ts +0 -5
  238. package/dist/src/commands/block.d.ts.map +0 -1
  239. package/dist/src/commands/block.js +0 -255
  240. package/dist/src/commands/block.js.map +0 -1
  241. package/dist/src/shared/configureFonts.d.ts +0 -6
  242. package/dist/src/shared/configureFonts.d.ts.map +0 -1
  243. package/dist/src/shared/configureFonts.js +0 -106
  244. package/dist/src/shared/configureFonts.js.map +0 -1
  245. package/dist/src/shared/configureGlobalCss.d.ts +0 -6
  246. package/dist/src/shared/configureGlobalCss.d.ts.map +0 -1
  247. package/dist/src/shared/configureGlobalCss.js +0 -154
  248. package/dist/src/shared/configureGlobalCss.js.map +0 -1
  249. package/dist/src/shared/configureTailwind.d.ts +0 -7
  250. package/dist/src/shared/configureTailwind.d.ts.map +0 -1
  251. package/dist/src/shared/configureTailwind.js +0 -163
  252. package/dist/src/shared/configureTailwind.js.map +0 -1
  253. package/dist/src/shared/detectFramework.d.ts +0 -23
  254. package/dist/src/shared/detectFramework.d.ts.map +0 -1
  255. package/dist/src/shared/detectFramework.js +0 -119
  256. package/dist/src/shared/detectFramework.js.map +0 -1
  257. package/dist/src/shared/installBaseUtils.d.ts +0 -5
  258. package/dist/src/shared/installBaseUtils.d.ts.map +0 -1
  259. package/dist/src/shared/installBaseUtils.js +0 -79
  260. package/dist/src/shared/installBaseUtils.js.map +0 -1
  261. package/dist/src/shared/resolveAliases.d.ts +0 -24
  262. package/dist/src/shared/resolveAliases.d.ts.map +0 -1
  263. package/dist/src/shared/resolveAliases.js +0 -98
  264. package/dist/src/shared/resolveAliases.js.map +0 -1
@@ -1,25 +1,21 @@
1
- "use client"
1
+ "use client";
2
2
 
3
- import { useMemo, useState } from "react"
4
- import { X, GripVertical, ArrowUp, ArrowDown, Minus } from "lucide-react"
5
- import type {
6
- ViewConfig,
7
- ViewType,
8
- FieldConfig,
9
- } from "./types"
10
- import { Button } from "../Button"
11
- import { Switch } from "../Switch"
12
- import { Divider } from "../Divider"
13
- import { Label } from "../Label"
14
- import { RadioGroup, Radio } from "../Radio"
3
+ import { useMemo, useState } from "react";
4
+ import { X, GripVertical, ArrowUp, ArrowDown, Minus } from "lucide-react";
5
+ import type { ViewConfig, ViewType, FieldConfig } from "./types";
6
+ import { Button } from "../Button";
7
+ import { Switch } from "../Switch";
8
+ import { Divider } from "../Divider";
9
+ import { Label } from "../Label";
10
+ import { RadioGroup, Radio } from "../Radio";
15
11
 
16
12
  type SettingsPanelProps = {
17
- config: ViewConfig
18
- onConfigChange: (config: Partial<ViewConfig>) => void
19
- onClose: () => void
20
- currentView: ViewType
21
- fields: FieldConfig[]
22
- }
13
+ config: ViewConfig;
14
+ onConfigChange: (config: Partial<ViewConfig>) => void;
15
+ onClose: () => void;
16
+ currentView: ViewType;
17
+ fields: FieldConfig[];
18
+ };
23
19
 
24
20
  export function SettingsPanel({
25
21
  config,
@@ -28,58 +24,49 @@ export function SettingsPanel({
28
24
  currentView,
29
25
  fields,
30
26
  }: SettingsPanelProps) {
31
- const visibleFields = useMemo(
32
- () => fields.filter((f) => f.type !== "hidden"),
33
- [fields],
34
- )
27
+ const visibleFields = useMemo(() => fields.filter((f) => f.type !== "hidden"), [fields]);
35
28
 
36
- const groupableFields = useMemo(
37
- () => fields.filter((f) => f.type === "enum-badge"),
38
- [fields],
39
- )
29
+ const groupableFields = useMemo(() => fields.filter((f) => f.type === "enum-badge"), [fields]);
40
30
 
41
- const visiblePaths = useMemo(
42
- () => new Set(visibleFields.map((f) => f.path)),
43
- [visibleFields],
44
- )
31
+ const visiblePaths = useMemo(() => new Set(visibleFields.map((f) => f.path)), [visibleFields]);
45
32
  const fieldByPath = useMemo(
46
33
  () => new Map(visibleFields.map((f) => [f.path, f])),
47
34
  [visibleFields],
48
- )
35
+ );
49
36
  const orderedColumns = useMemo(
50
37
  () =>
51
38
  [...config.tableColumns]
52
39
  .filter((c) => visiblePaths.has(c.id))
53
40
  .sort((a, b) => a.order - b.order),
54
41
  [config.tableColumns, visiblePaths],
55
- )
42
+ );
56
43
 
57
44
  const toggleColumnVisibility = (path: string) => {
58
45
  const next = config.tableColumns.map((c) =>
59
46
  c.id === path ? { ...c, visible: !c.visible } : c,
60
- )
61
- onConfigChange({ tableColumns: next })
62
- }
47
+ );
48
+ onConfigChange({ tableColumns: next });
49
+ };
63
50
 
64
- const [dragPath, setDragPath] = useState<string | null>(null)
65
- const [dragOverPath, setDragOverPath] = useState<string | null>(null)
51
+ const [dragPath, setDragPath] = useState<string | null>(null);
52
+ const [dragOverPath, setDragOverPath] = useState<string | null>(null);
66
53
 
67
54
  const reorderColumn = (sourcePath: string, targetPath: string) => {
68
- if (sourcePath === targetPath) return
69
- const ids = orderedColumns.map((c) => c.id)
70
- const from = ids.indexOf(sourcePath)
71
- const to = ids.indexOf(targetPath)
72
- if (from === -1 || to === -1) return
73
- const reordered = [...ids]
74
- const [moved] = reordered.splice(from, 1)
75
- reordered.splice(to, 0, moved)
76
- const orderByPath = new Map(reordered.map((id, i) => [id, i]))
55
+ if (sourcePath === targetPath) return;
56
+ const ids = orderedColumns.map((c) => c.id);
57
+ const from = ids.indexOf(sourcePath);
58
+ const to = ids.indexOf(targetPath);
59
+ if (from === -1 || to === -1) return;
60
+ const reordered = [...ids];
61
+ const [moved] = reordered.splice(from, 1);
62
+ reordered.splice(to, 0, moved);
63
+ const orderByPath = new Map(reordered.map((id, i) => [id, i]));
77
64
  const next = config.tableColumns.map((c) => {
78
- const newOrder = orderByPath.get(c.id)
79
- return newOrder == null ? c : { ...c, order: newOrder }
80
- })
81
- onConfigChange({ tableColumns: next })
82
- }
65
+ const newOrder = orderByPath.get(c.id);
66
+ return newOrder == null ? c : { ...c, order: newOrder };
67
+ });
68
+ onConfigChange({ tableColumns: next });
69
+ };
83
70
 
84
71
  return (
85
72
  <div className="w-80 border-l border-border-presentation-global-primary bg-background-presentation-body-overlay-primary overflow-y-auto">
@@ -110,44 +97,48 @@ export function SettingsPanel({
110
97
  {currentView === "table" && (
111
98
  <>
112
99
  <div className="space-y-3">
113
- <h3 className="text-sm font-medium text-content-presentation-global-primary">Table Columns</h3>
100
+ <h3 className="text-sm font-medium text-content-presentation-global-primary">
101
+ Table Columns
102
+ </h3>
114
103
  <p className="text-xs text-content-presentation-global-tertiary">
115
104
  Show or hide columns in table view
116
105
  </p>
117
106
  {orderedColumns.length === 0 ? (
118
- <p className="text-xs text-content-presentation-global-tertiary">No fields detected.</p>
107
+ <p className="text-xs text-content-presentation-global-tertiary">
108
+ No fields detected.
109
+ </p>
119
110
  ) : (
120
111
  <div className="space-y-2">
121
112
  {orderedColumns.map((col) => {
122
- const field = fieldByPath.get(col.id)
123
- const isDragging = dragPath === col.id
124
- const isDropTarget = dragOverPath === col.id && dragPath !== col.id
113
+ const field = fieldByPath.get(col.id);
114
+ const isDragging = dragPath === col.id;
115
+ const isDropTarget = dragOverPath === col.id && dragPath !== col.id;
125
116
  return (
126
117
  <div
127
118
  key={col.id}
128
119
  draggable
129
120
  onDragStart={(e) => {
130
- setDragPath(col.id)
131
- e.dataTransfer.effectAllowed = "move"
132
- e.dataTransfer.setData("text/plain", col.id)
121
+ setDragPath(col.id);
122
+ e.dataTransfer.effectAllowed = "move";
123
+ e.dataTransfer.setData("text/plain", col.id);
133
124
  }}
134
125
  onDragOver={(e) => {
135
- e.preventDefault()
136
- e.dataTransfer.dropEffect = "move"
137
- if (dragOverPath !== col.id) setDragOverPath(col.id)
126
+ e.preventDefault();
127
+ e.dataTransfer.dropEffect = "move";
128
+ if (dragOverPath !== col.id) setDragOverPath(col.id);
138
129
  }}
139
130
  onDragLeave={() => {
140
- if (dragOverPath === col.id) setDragOverPath(null)
131
+ if (dragOverPath === col.id) setDragOverPath(null);
141
132
  }}
142
133
  onDrop={(e) => {
143
- e.preventDefault()
144
- if (dragPath) reorderColumn(dragPath, col.id)
145
- setDragPath(null)
146
- setDragOverPath(null)
134
+ e.preventDefault();
135
+ if (dragPath) reorderColumn(dragPath, col.id);
136
+ setDragPath(null);
137
+ setDragOverPath(null);
147
138
  }}
148
139
  onDragEnd={() => {
149
- setDragPath(null)
150
- setDragOverPath(null)
140
+ setDragPath(null);
141
+ setDragOverPath(null);
151
142
  }}
152
143
  className={
153
144
  "flex items-center gap-2 rounded-lg border p-2 cursor-grab active:cursor-grabbing transition-colors " +
@@ -167,7 +158,7 @@ export function SettingsPanel({
167
158
  onCheckedChange={() => toggleColumnVisibility(col.id)}
168
159
  />
169
160
  </div>
170
- )
161
+ );
171
162
  })}
172
163
  </div>
173
164
  )}
@@ -179,11 +170,16 @@ export function SettingsPanel({
179
170
  {currentView === "kanban" && (
180
171
  <>
181
172
  <div className="space-y-3">
182
- <h3 className="text-sm font-medium text-content-presentation-global-primary">Kanban Grouping</h3>
183
- <p className="text-xs text-content-presentation-global-tertiary">Group cards by field</p>
173
+ <h3 className="text-sm font-medium text-content-presentation-global-primary">
174
+ Kanban Grouping
175
+ </h3>
176
+ <p className="text-xs text-content-presentation-global-tertiary">
177
+ Group cards by field
178
+ </p>
184
179
  {groupableFields.length === 0 ? (
185
180
  <p className="text-xs text-content-presentation-global-tertiary">
186
- No groupable fields detected. Declare a field with type "enum-badge" to enable grouping.
181
+ No groupable fields detected. Declare a field with type &quot;enum-badge&quot; to
182
+ enable grouping.
187
183
  </p>
188
184
  ) : (
189
185
  <RadioGroup
@@ -206,7 +202,9 @@ export function SettingsPanel({
206
202
  {currentView === "inbox" && (
207
203
  <>
208
204
  <div className="space-y-3">
209
- <h3 className="text-sm font-medium text-content-presentation-global-primary">Inbox Layout</h3>
205
+ <h3 className="text-sm font-medium text-content-presentation-global-primary">
206
+ Inbox Layout
207
+ </h3>
210
208
  <div className="flex items-center justify-between">
211
209
  <Label htmlFor="preview-pane" className="text-sm">
212
210
  Show Preview Pane
@@ -230,21 +228,17 @@ export function SettingsPanel({
230
228
  </p>
231
229
  <div className="space-y-2">
232
230
  {orderedColumns.map((col) => {
233
- const field = fieldByPath.get(col.id)
234
- const isActive = config.sortBy === col.id
235
- const dir: "asc" | "desc" | "none" = isActive ? config.sortOrder : "none"
231
+ const field = fieldByPath.get(col.id);
232
+ const isActive = config.sortBy === col.id;
233
+ const dir: "asc" | "desc" | "none" = isActive ? config.sortOrder : "none";
236
234
  const setDir = (next: "asc" | "desc" | "none") => {
237
235
  if (next === "none") {
238
- onConfigChange({ sortBy: "" })
236
+ onConfigChange({ sortBy: "" });
239
237
  } else {
240
- onConfigChange({ sortBy: col.id, sortOrder: next })
238
+ onConfigChange({ sortBy: col.id, sortOrder: next });
241
239
  }
242
- }
243
- const btn = (
244
- mode: "none" | "asc" | "desc",
245
- Icon: typeof Minus,
246
- label: string,
247
- ) => (
240
+ };
241
+ const btn = (mode: "none" | "asc" | "desc", Icon: typeof Minus, label: string) => (
248
242
  <button
249
243
  type="button"
250
244
  aria-label={`${label} ${col.label || col.id}`}
@@ -259,7 +253,7 @@ export function SettingsPanel({
259
253
  >
260
254
  <Icon className="h-3.5 w-3.5" />
261
255
  </button>
262
- )
256
+ );
263
257
  return (
264
258
  <div
265
259
  key={col.id}
@@ -274,12 +268,12 @@ export function SettingsPanel({
274
268
  {btn("desc", ArrowDown, "Sort descending")}
275
269
  </div>
276
270
  </div>
277
- )
271
+ );
278
272
  })}
279
273
  </div>
280
274
  </div>
281
275
  )}
282
276
  </div>
283
277
  </div>
284
- )
278
+ );
285
279
  }
@@ -22,10 +22,7 @@ import {
22
22
  TableCell,
23
23
  TableCheckbox,
24
24
  } from "../Table";
25
- import {
26
- getByPath,
27
- matchesFilterValues,
28
- } from "../../utils/dataViews/pathUtils";
25
+ import { getByPath, matchesFilterValues } from "../../utils/dataViews/pathUtils";
29
26
  import { renderField } from "./fieldRenderers";
30
27
  import { visibleFields } from "../../utils/dataViews/fieldUtils";
31
28
  import { useIsMobile } from "../../hooks/useIsMobile";
@@ -144,9 +141,7 @@ export function TableView({
144
141
  <TableHead
145
142
  key={field.path}
146
143
  size="M"
147
- sortType={
148
- sortPath === field.path ? sortDirection : undefined
149
- }
144
+ sortType={sortPath === field.path ? sortDirection : undefined}
150
145
  onSort={() => handleSort(field.path)}
151
146
  >
152
147
  {field.label}
@@ -156,7 +151,7 @@ export function TableView({
156
151
  </TableHeader>
157
152
  <TableBody>
158
153
  {filteredAndSortedData.map((item, idx) => (
159
- <TableRow key={item.id ?? idx}>
154
+ <TableRow key={(item.id ?? idx) as string | number}>
160
155
  <TableCell isDummy className="w-12">
161
156
  <TableCheckbox id={`row-${item.id ?? idx}`} />
162
157
  </TableCell>
@@ -168,11 +163,7 @@ export function TableView({
168
163
  post-mount column reflow repaints cleanly instead
169
164
  of leaving a ghosted/doubled badge frame. */}
170
165
  <span className="isolate inline-flex transform-gpu">
171
- {renderField(
172
- getByPath(item, field.path),
173
- field,
174
- item,
175
- )}
166
+ {renderField(getByPath(item, field.path), field, item)}
176
167
  </span>
177
168
  </TableCell>
178
169
  ))}
@@ -185,7 +176,7 @@ export function TableView({
185
176
  <div className="flex-1 overflow-auto">
186
177
  <div className="grid gap-3">
187
178
  {filteredAndSortedData.map((item, idx) => (
188
- <Card key={item.id ?? idx} className="overflow-hidden">
179
+ <Card key={(item.id ?? idx) as string | number} className="overflow-hidden">
189
180
  <CardHeader className="pb-3">
190
181
  <div className="flex items-start justify-between gap-3">
191
182
  <div className="flex items-start gap-3 flex-1">
@@ -193,9 +184,7 @@ export function TableView({
193
184
  <div className="flex-1">
194
185
  {displayFields[0] && (
195
186
  <p className="font-medium">
196
- {String(
197
- getByPath(item, displayFields[0].path) ?? "",
198
- )}
187
+ {String(getByPath(item, displayFields[0].path) ?? "")}
199
188
  </p>
200
189
  )}
201
190
  </div>
@@ -204,20 +193,11 @@ export function TableView({
204
193
  </CardHeader>
205
194
  <CardContent className="space-y-2 pt-0">
206
195
  {displayFields.slice(1).map((field) => (
207
- <div
208
- key={field.path}
209
- className="flex items-center justify-between text-sm"
210
- >
196
+ <div key={field.path} className="flex items-center justify-between text-sm">
211
197
  <span className="text-content-presentation-global-tertiary">
212
198
  {field.label}:
213
199
  </span>
214
- <span>
215
- {renderField(
216
- getByPath(item, field.path),
217
- field,
218
- item,
219
- )}
220
- </span>
200
+ <span>{renderField(getByPath(item, field.path), field, item)}</span>
221
201
  </div>
222
202
  ))}
223
203
  </CardContent>
@@ -21,10 +21,7 @@ import {
21
21
  pruneTree,
22
22
  type TreeNode,
23
23
  } from "../../utils/dataViews/treeUtils";
24
- import {
25
- getByPath,
26
- matchesFilterValues,
27
- } from "../../utils/dataViews/pathUtils";
24
+ import { getByPath, matchesFilterValues } from "../../utils/dataViews/pathUtils";
28
25
  import { visibleFields } from "../../utils/dataViews/fieldUtils";
29
26
  import { renderField } from "./fieldRenderers";
30
27
  import { useIsMobile } from "../../hooks/useIsMobile";
@@ -85,22 +82,14 @@ export function TreeView({
85
82
  return display[0] ?? { path: resolvedTree.idField, type: "text" };
86
83
  }, [resolvedTree, fields, display]);
87
84
 
88
- const fullForest = useMemo(
89
- () => buildTree(data, resolvedTree),
90
- [data, resolvedTree],
91
- );
85
+ const fullForest = useMemo(() => buildTree(data, resolvedTree), [data, resolvedTree]);
92
86
 
93
- const filterEntries = useMemo(
94
- () => Object.entries(activeFilters),
95
- [activeFilters],
96
- );
87
+ const filterEntries = useMemo(() => Object.entries(activeFilters), [activeFilters]);
97
88
 
98
89
  const visibleForest: TreeNode[] = useMemo(() => {
99
90
  if (filterEntries.length === 0) return fullForest;
100
91
  return pruneTree(fullForest, (record) =>
101
- filterEntries.every(([path, value]) =>
102
- matchesFilterValues(record, path, value),
103
- ),
92
+ filterEntries.every(([path, value]) => matchesFilterValues(record, path, value)),
104
93
  );
105
94
  }, [fullForest, filterEntries]);
106
95
 
@@ -112,9 +101,7 @@ export function TreeView({
112
101
  setExpanded(initialExpansion(fullForest, resolvedTree.defaultExpanded));
113
102
  }, [fullForest, resolvedTree.defaultExpanded]);
114
103
 
115
- const [selectedId, setSelectedId] = useState<string | null>(
116
- () => fullForest[0]?.id ?? null,
117
- );
104
+ const [selectedId, setSelectedId] = useState<string | null>(() => fullForest[0]?.id ?? null);
118
105
 
119
106
  useEffect(() => {
120
107
  if (selectedId && !findNodeById(visibleForest, selectedId)) {
@@ -122,9 +109,7 @@ export function TreeView({
122
109
  }
123
110
  }, [visibleForest, selectedId]);
124
111
 
125
- const selectedNode = selectedId
126
- ? findNodeById(visibleForest, selectedId)
127
- : null;
112
+ const selectedNode = selectedId ? findNodeById(visibleForest, selectedId) : null;
128
113
  const recordsForRightPane = useMemo(
129
114
  () => (selectedNode ? flatten(selectedNode) : []),
130
115
  [selectedNode],
@@ -153,9 +138,7 @@ export function TreeView({
153
138
  type RightPaneMode = "table" | "card";
154
139
  const [rightPaneMode, setRightPaneMode] = useState<RightPaneMode>(
155
140
  // "details" is a deprecated alias of "card".
156
- treeConfig?.defaultRightPane === "details"
157
- ? "card"
158
- : (treeConfig?.defaultRightPane ?? "table"),
141
+ treeConfig?.defaultRightPane === "details" ? "card" : (treeConfig?.defaultRightPane ?? "table"),
159
142
  );
160
143
 
161
144
  const dndEnabled = treeConfig?.dndEnabled !== false && !!onDataUpdate;
@@ -222,9 +205,7 @@ export function TreeView({
222
205
  <div className="flex-1 flex flex-col overflow-hidden rounded-[16px] border border-border-presentation-global-primary bg-background-presentation-form-base">
223
206
  <div className="flex items-center justify-between gap-2 px-3 py-2 border-b border-border-presentation-global-primary bg-background-presentation-form-base">
224
207
  <div className="flex items-center gap-2 min-w-0">
225
- {isMobile && (
226
- <TreeDrawerTrigger onClick={() => setDrawerOpen(true)} />
227
- )}
208
+ {isMobile && <TreeDrawerTrigger onClick={() => setDrawerOpen(true)} />}
228
209
  <span
229
210
  style={{ fontFeatureSettings: "'cv05' on" }}
230
211
  className="typography-display-medium-medium uppercase text-content-presentation-global-primary truncate"
@@ -256,9 +237,7 @@ export function TreeView({
256
237
  const showDivider = idx > 0 && !active && !prevActive;
257
238
  return (
258
239
  <div key={tab.id} className="flex items-center">
259
- {showDivider && (
260
- <div className="mx-[3px] h-3 w-px bg-[#434446]" />
261
- )}
240
+ {showDivider && <div className="mx-[3px] h-3 w-px bg-[#434446]" />}
262
241
  <button
263
242
  type="button"
264
243
  aria-label={`${tab.label} mode`}
@@ -300,11 +279,7 @@ export function TreeView({
300
279
  showFilters={false}
301
280
  />
302
281
  ) : (
303
- <CardGrid
304
- records={recordsForRightPane}
305
- fields={fields}
306
- labelField={labelField}
307
- />
282
+ <CardGrid records={recordsForRightPane} fields={fields} labelField={labelField} />
308
283
  )
309
284
  ) : (
310
285
  <div className="h-full flex items-center justify-center text-sm text-content-presentation-global-tertiary">
@@ -355,7 +330,7 @@ function CardGrid({
355
330
  {records.map((record, idx) => {
356
331
  const labelValue = getByPath(record, labelField.path);
357
332
  return (
358
- <Card key={record.id ?? idx} className="overflow-hidden">
333
+ <Card key={(record.id ?? idx) as string | number} className="overflow-hidden">
359
334
  <CardHeader className="pb-2">
360
335
  <div className="text-xs uppercase tracking-wide text-content-presentation-global-tertiary">
361
336
  {labelField.label ?? labelField.path}
@@ -369,10 +344,7 @@ function CardGrid({
369
344
  const value = getByPath(record, f.path);
370
345
  if (value == null) return null;
371
346
  return (
372
- <div
373
- key={f.path}
374
- className="flex items-center justify-between gap-3 text-sm"
375
- >
347
+ <div key={f.path} className="flex items-center justify-between gap-3 text-sm">
376
348
  <span className="text-content-presentation-global-tertiary">
377
349
  {f.label ?? f.path}
378
350
  </span>
@@ -1,23 +1,14 @@
1
- import type { BadgeVariant } from "./types"
1
+ import type { BadgeVariant } from "./types";
2
2
 
3
3
  type TorchBadgeColor =
4
- | "gray"
5
- | "slate"
6
- | "red"
7
- | "orange"
8
- | "yellow"
9
- | "green"
10
- | "ocean"
11
- | "blue"
12
- | "purple"
13
- | "rose"
4
+ "gray" | "slate" | "red" | "orange" | "yellow" | "green" | "ocean" | "blue" | "purple" | "rose";
14
5
 
15
- type TorchBadgeStyle = "solid" | "subtle"
6
+ type TorchBadgeStyle = "solid" | "subtle";
16
7
 
17
8
  export type ResolvedBadgeProps = {
18
- color: TorchBadgeColor
19
- badgeStyle: TorchBadgeStyle
20
- }
9
+ color: TorchBadgeColor;
10
+ badgeStyle: TorchBadgeStyle;
11
+ };
21
12
 
22
13
  /**
23
14
  * Map the dataviews BadgeVariant set to torch-glare Badge props.
@@ -27,19 +18,32 @@ export type ResolvedBadgeProps = {
27
18
  */
28
19
  export function resolveBadgeVariant(variant?: BadgeVariant): ResolvedBadgeProps {
29
20
  switch (variant) {
30
- case "green": return { color: "green", badgeStyle: "subtle" }
31
- case "greenLight": return { color: "green", badgeStyle: "subtle" }
32
- case "cocktailGreen": return { color: "green", badgeStyle: "solid" }
33
- case "yellow": return { color: "yellow", badgeStyle: "subtle" }
34
- case "redOrange": return { color: "orange", badgeStyle: "subtle" }
35
- case "redLight": return { color: "red", badgeStyle: "subtle" }
36
- case "rose": return { color: "rose", badgeStyle: "subtle" }
37
- case "purple": return { color: "purple", badgeStyle: "subtle" }
38
- case "bluePurple": return { color: "purple", badgeStyle: "solid" }
39
- case "blue": return { color: "blue", badgeStyle: "subtle" }
40
- case "navy": return { color: "blue", badgeStyle: "solid" }
41
- case "highlight": return { color: "yellow", badgeStyle: "subtle" }
21
+ case "green":
22
+ return { color: "green", badgeStyle: "subtle" };
23
+ case "greenLight":
24
+ return { color: "green", badgeStyle: "subtle" };
25
+ case "cocktailGreen":
26
+ return { color: "green", badgeStyle: "solid" };
27
+ case "yellow":
28
+ return { color: "yellow", badgeStyle: "subtle" };
29
+ case "redOrange":
30
+ return { color: "orange", badgeStyle: "subtle" };
31
+ case "redLight":
32
+ return { color: "red", badgeStyle: "subtle" };
33
+ case "rose":
34
+ return { color: "rose", badgeStyle: "subtle" };
35
+ case "purple":
36
+ return { color: "purple", badgeStyle: "subtle" };
37
+ case "bluePurple":
38
+ return { color: "purple", badgeStyle: "solid" };
39
+ case "blue":
40
+ return { color: "blue", badgeStyle: "subtle" };
41
+ case "navy":
42
+ return { color: "blue", badgeStyle: "solid" };
43
+ case "highlight":
44
+ return { color: "yellow", badgeStyle: "subtle" };
42
45
  case "gray":
43
- default: return { color: "gray", badgeStyle: "subtle" }
46
+ default:
47
+ return { color: "gray", badgeStyle: "subtle" };
44
48
  }
45
49
  }