Skip to content

Commit db45267

Browse files
committed
move tailwind styling to inline styling
1 parent 87a62c8 commit db45267

4 files changed

Lines changed: 38 additions & 19 deletions

File tree

dist/components/treeview/RichTreeView.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/components/treeview/TracesDialog.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/treeview/RichTreeView.tsx

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const ChevronRightIcon = () => (
4040
stroke-width="2"
4141
stroke-linecap="round"
4242
stroke-linejoin="round"
43-
class="transition-transform duration-200"
43+
style={{ transition: 'transform 0.2s' }}
4444
>
4545
<path d="m9 18 6-6-6-6" />
4646
</svg>
@@ -57,7 +57,7 @@ const ChevronDownIcon = () => (
5757
stroke-width="2"
5858
stroke-linecap="round"
5959
stroke-linejoin="round"
60-
class="transition-transform duration-200"
60+
style={{ transition: 'transform 0.2s' }}
6161
>
6262
<path d="m6 9 6 6 6-6" />
6363
</svg>
@@ -198,9 +198,23 @@ export const RichTreeView = (props: RichTreeViewProps) => {
198198
padding-left: ${mergedProps.indentationLevel}px !important;
199199
}
200200
.tree-item-content {
201+
display: flex;
202+
align-items: center;
203+
padding: 0.5rem 0.25rem;
204+
border-radius: 0.25rem;
205+
cursor: pointer;
201206
border-left: 3px solid transparent;
202207
transition: background-color 0.15s ease, border-color 0.15s ease;
203208
}
209+
.tree-item-icon-container {
210+
margin-right: 0.25rem;
211+
}
212+
.tree-item-icon {
213+
margin-right: 0.5rem;
214+
}
215+
.tree-item-label {
216+
flex-grow: 1;
217+
}
204218
.tree-item-content:hover {
205219
background-color: rgba(0, 0, 0, 0.06);
206220
}
@@ -282,20 +296,18 @@ export const TreeItem = (props: TreeItemProps) => {
282296
return (
283297
<div class="tree-item-root">
284298
<div
285-
class={`tree-item-content flex items-center py-2 px-1 rounded cursor-pointer ${context.isSelected(props.itemId) ? 'selected' : ''} ${
286-
context.isHighlighted(props.itemId) ? 'highlighted' : ''
287-
}`}
299+
class={`tree-item-content ${context.isSelected(props.itemId) ? 'selected' : ''} ${context.isHighlighted(props.itemId) ? 'highlighted' : ''}`}
288300
onClick={handleClick}
289301
>
290-
<div class="tree-item-icon-container mr-1">
302+
<div class="tree-item-icon-container">
291303
{!isLeaf && <Dynamic component={context.isExpanded(props.itemId) ? ChevronDownIcon : ChevronRightIcon} />}
292304
</div>
293305

294-
<div class="tree-item-icon mr-2">
306+
<div class="tree-item-icon">
295307
{props.icon ? props.icon : props.expandedIcon && context.isExpanded(props.itemId) ? props.expandedIcon : getDefaultIcon()}
296308
</div>
297309

298-
<div class="tree-item-label flex-grow">{props.label}</div>
310+
<div class="tree-item-label">{props.label}</div>
299311

300312
<Show when={props.endIcon}>
301313
<div class="tree-item-end-icon">{props.endIcon}</div>

src/components/treeview/TracesDialog.tsx

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const ChevronDownIcon = () => (
3131
stroke-width="2"
3232
stroke-linecap="round"
3333
stroke-linejoin="round"
34-
class="transition-transform duration-200"
34+
style={{ transition: 'transform 0.2s' }}
3535
>
3636
<path d="m6 9 6 6 6-6" />
3737
</svg>
@@ -48,7 +48,7 @@ const ChevronRightIcon = () => (
4848
stroke-width="2"
4949
stroke-linecap="round"
5050
stroke-linejoin="round"
51-
class="transition-transform duration-200"
51+
style={{ transition: 'transform 0.2s' }}
5252
>
5353
<path d="m9 18 6-6-6-6" />
5454
</svg>
@@ -206,6 +206,7 @@ export const TracesDialog = (props: TracesDialogProps) => {
206206
const DialogContent = () => (
207207
<>
208208
<style>{nddStyles}</style>
209+
<style>{`.tree-panel-header:hover { background-color: rgba(0,0,0,0.06); }`}</style>
209210
{/* Backdrop */}
210211
<div
211212
style={{ position: 'fixed', inset: '0', 'z-index': 1001, 'background-color': 'rgba(0,0,0,0.25)', 'pointer-events': 'auto' }}
@@ -298,19 +299,25 @@ export const TracesDialog = (props: TracesDialogProps) => {
298299
>
299300
{/* Collapsible tree header */}
300301
<div
301-
class="flex items-center p-2 cursor-pointer hover:bg-gray-100 transition-colors duration-150"
302+
class="tree-panel-header"
302303
onClick={togglePanel}
303-
style={{ 'background-color': 'rgba(0,0,0,0.03)', gap: '4px' }}
304+
style={{
305+
display: 'flex',
306+
'align-items': 'center',
307+
padding: '0.5rem',
308+
cursor: 'pointer',
309+
'background-color': 'rgba(0,0,0,0.03)',
310+
gap: '4px',
311+
transition: 'background-color 0.15s ease',
312+
}}
304313
>
305-
<div class="flex-shrink-0">{isPanelExpanded() ? <ChevronDownIcon /> : <ChevronRightIcon />}</div>
314+
<div style={{ 'flex-shrink': '0' }}>{isPanelExpanded() ? <ChevronDownIcon /> : <ChevronRightIcon />}</div>
306315
<Show when={isPanelExpanded()}>
307-
<span class="font-semibold text-xs" style={{ 'white-space': 'nowrap' }}>
308-
Process Flow
309-
</span>
316+
<span style={{ 'font-weight': '600', 'font-size': '0.75rem', 'line-height': '1rem', 'white-space': 'nowrap' }}>Process Flow</span>
310317
</Show>
311318
</div>
312319
<Show when={isPanelExpanded()}>
313-
<div class="p-2" style={{ 'font-size': '0.85rem' }}>
320+
<div style={{ padding: '0.5rem', 'font-size': '0.85rem' }}>
314321
<RichTreeView
315322
defaultExpanded={expandedNodes()}
316323
defaultSelected={selectedNodeId()}

0 commit comments

Comments
 (0)