Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update panel style #91

Merged
merged 1 commit into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/storybook/src/ui/var-tree.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { VariableTree } from '@music163/tango-designer';
import { VariableTree } from '@music163/tango-designer/lib/cjs/components';
import { Box } from 'coral-system';

export default {
Expand Down
6 changes: 4 additions & 2 deletions packages/setting-form/src/form-ui.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,11 @@ export function FormControlGroup({
{extra}
</Box>
}
borderTop="solid"
borderBottom="solid"
border="solid"
borderColor="line.normal"
headerProps={{
bg: 'fill1',
}}
>
<Box
p="m"
Expand Down
3 changes: 2 additions & 1 deletion packages/setting-form/src/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
margin-top: var(--tango-space-m);
}

> .SettingFormMain > .FormControl {
> .SettingFormMain > .FormControl,
.FormObject {
margin-left: var(--tango-space-m);
margin-right: var(--tango-space-m);
}
Expand Down Expand Up @@ -142,7 +143,7 @@

const renderProps = useCallback(
(props: ComponentPropType[]) =>
props.map((item) => {

Check warning on line 146 in packages/setting-form/src/form.tsx

View workflow job for this annotation

GitHub Actions / CI

'map' is missing in props validation
const { getProp, ...rest } = item;
const childProto = {
...rest,
Expand All @@ -159,7 +160,7 @@
if (modelProp && modelProp !== model) {
setModel(modelProp);
}
}, [modelProp]);

Check warning on line 163 in packages/setting-form/src/form.tsx

View workflow job for this annotation

GitHub Actions / CI

React Hook useEffect has a missing dependency: 'model'. Either include it or remove the dependency array

return (
<FormVariableProvider value={{ disableSwitchExpressionSetter }}>
Expand Down
7 changes: 6 additions & 1 deletion packages/ui/src/collapse-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ export interface CollapsePanelProps extends Omit<HTMLCoralProps<'div'>, 'title'>
* 是否显示底部边框线
*/
showBottomBorder?: boolean;
headerProps?: HTMLCoralProps<'div'>;
bodyProps?: HTMLCoralProps<'div'>;
}

const headerStyle = css`
Expand All @@ -54,6 +56,8 @@ export function CollapsePanel(props: CollapsePanelProps) {
onCollapse,
stickyHeader,
showBottomBorder = true,
headerProps,
bodyProps,
...rest
} = props;
const [collapsed, setCollapsed] = useControllableState({
Expand Down Expand Up @@ -92,6 +96,7 @@ export function CollapsePanel(props: CollapsePanelProps) {
onClick={() => setCollapsed(!collapsed)}
p="m"
{...stickHeaderProps}
{...headerProps}
css={headerStyle}
>
<Box display="flex" alignItems="center" fontSize="14px" fontWeight="500">
Expand All @@ -100,7 +105,7 @@ export function CollapsePanel(props: CollapsePanelProps) {
</Box>
<Box>{extra}</Box>
</Box>
<Box className="CollapsePanelBody" display={collapsed ? 'none' : 'block'}>
<Box className="CollapsePanelBody" display={collapsed ? 'none' : 'block'} {...bodyProps}>
{children}
</Box>
</Box>
Expand Down
Loading