Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

chg(core): update clipped panel to take div props for inner div (#1479)

Seamus784ebd9ef788
diff --git a/js/app/packages/app/component/split-layout/components/SplitContainer.tsx b/js/app/packages/app/component/split-layout/components/SplitContainer.tsx
index 166ac05e7b..45de987ea7 100644
--- a/js/app/packages/app/component/split-layout/components/SplitContainer.tsx
+++ b/js/app/packages/app/component/split-layout/components/SplitContainer.tsx
@@ -99,7 +99,7 @@ export function SplitContainer(
multipleSplits() &&
!panel.handle.isSpotLight()
}
- edgeMutedColor="transparent"
+ edgeColor="transparent"
>
<div class="flex flex-col min-h-0 size-full bg-panel">
<SplitHeader ref={setHeaderRef} />
diff --git a/js/app/packages/core/component/ClippedPanel.tsx b/js/app/packages/core/component/ClippedPanel.tsx
index 59be461154..ddb9f22c8c 100644
--- a/js/app/packages/core/component/ClippedPanel.tsx
+++ b/js/app/packages/core/component/ClippedPanel.tsx
@@ -1,37 +1,46 @@
import { cornerClip } from '@core/util/clipPath';
-import type { JSX, JSXElement, Ref } from 'solid-js';
+import { splitProps, type JSX } from 'solid-js';
import { beveledCorners } from '../../block-theme/signals/themeSignals';
+import { cn } from '@ui/utils/classname';
-interface PanelProps {
- children?: JSXElement;
+type PanelProps = JSX.HTMLAttributes<HTMLDivElement> & {
active?: boolean;
- edgeMutedColor?: JSX.CSSProperties['color'];
+ edgeColor?: JSX.CSSProperties['color'];
tr?: boolean;
tl?: boolean;
bl?: boolean;
br?: boolean;
- ref?: Ref<HTMLDivElement>;
-}
+};
export function ClippedPanel(props: PanelProps) {
+ const [local, rest] = splitProps(props, [
+ 'active',
+ 'edgeColor',
+ 'tr',
+ 'tl',
+ 'br',
+ 'bl',
+ 'children',
+ 'class',
+ ]);
return (
<div
style={{
- 'background-image': `linear-gradient(${props.active ? `var(--color-accent), ${props.edgeMutedColor || 'var(--color-edge-muted)'} 80%` : `${props.edgeMutedColor || 'var(--color-edge-muted)'}`} )`,
+ 'background-image': `linear-gradient(${local.active ? `var(--color-accent), ${local.edgeColor || 'var(--color-edge-muted)'} 80%` : `${local.edgeColor || 'var(--color-edge-muted)'}`} )`,
'clip-path': !beveledCorners()
? cornerClip(
- props.tl ? '0.5rem' : 0,
- props.tr ? '0.5rem' : 0,
- props.br ? '0.5rem' : 0,
- props.bl ? '0.5rem' : 0
+ local.tl ? '0.5rem' : 0,
+ local.tr ? '0.5rem' : 0,
+ local.br ? '0.5rem' : 0,
+ local.bl ? '0.5rem' : 0
)
: '',
'border-radius': beveledCorners()
? `
- ${props.tl ? '16px' : '4px'}
- ${props.tr ? '16px' : '4px'}
- ${props.br ? '16px' : '4px'}
- ${props.bl ? '16px' : '4px'}
+ ${local.tl ? '16px' : '4px'}
+ ${local.tr ? '16px' : '4px'}
+ ${local.br ? '16px' : '4px'}
+ ${local.bl ? '16px' : '4px'}
`
: '0',
}}
@@ -41,25 +50,28 @@ export function ClippedPanel(props: PanelProps) {
style={{
'clip-path': !beveledCorners()
? cornerClip(
- props.tl ? 'calc(0.5rem - 0.5px)' : 0,
- props.tr ? 'calc(0.5rem - 0.5px)' : 0,
- props.br ? 'calc(0.5rem - 0.5px)' : 0,
- props.bl ? 'calc(0.5rem - 0.5px)' : 0
+ local.tl ? 'calc(0.5rem - 0.5px)' : 0,
+ local.tr ? 'calc(0.5rem - 0.5px)' : 0,
+ local.br ? 'calc(0.5rem - 0.5px)' : 0,
+ local.bl ? 'calc(0.5rem - 0.5px)' : 0
)
: '',
'border-radius': beveledCorners()
? `
- ${props.tl ? '15.5px' : '3.3px'}
- ${props.tr ? '15.5px' : '3.3px'}
- ${props.br ? '15.5px' : '3.3px'}
- ${props.bl ? '15.5px' : '3.3px'}
+ ${local.tl ? '15.5px' : '3.3px'}
+ ${local.tr ? '15.5px' : '3.3px'}
+ ${local.br ? '15.5px' : '3.3px'}
+ ${local.bl ? '15.5px' : '3.3px'}
`
: '0',
}}
- class="h-full w-full box-border overflow-hidden bg-panel"
- ref={props.ref}
+ class={cn(
+ 'h-full w-full box-border overflow-hidden bg-panel',
+ local.class
+ )}
+ {...rest}
>
- {props.children}
+ {local.children}
</div>
</div>
);