-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/custom-shaders
- Loading branch information
Showing
15 changed files
with
262 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,6 @@ | ||
{ | ||
"$schema": "https://docs.renovatebot.com/renovate-schema.json", | ||
"extends": [ | ||
"config:base", | ||
":semanticCommits", | ||
":semanticCommitScopeDisabled", | ||
":maintainLockFilesWeekly", | ||
":enableVulnerabilityAlertsWithLabel(security)" | ||
], | ||
"postUpdateOptions": [ | ||
"gomodTidy", | ||
"gomodUpdateImportPaths" | ||
], | ||
"packageRules": [ | ||
{ | ||
"enabledManagers": [ | ||
"gomod" | ||
], | ||
"matchPackagePatterns": [ | ||
"*" | ||
], | ||
"groupName": "dependencies", | ||
"groupSlug": "gomod", | ||
"semanticCommitType": "chore", | ||
"schedule": [ | ||
"before 3:00 am on the 4th day of the month" | ||
] | ||
}, | ||
{ | ||
"enabledManagers": [ | ||
"dockerfile", | ||
"docker-compose" | ||
], | ||
"matchPackagePatterns": [ | ||
"*" | ||
], | ||
"groupName": "docker dependencies", | ||
"groupSlug": "docker", | ||
"semanticCommitType": "chore", | ||
"schedule": [ | ||
"before 3:00 am on the 4th day of the month" | ||
] | ||
}, | ||
{ | ||
"enabledManagers": [ | ||
"github-actions" | ||
], | ||
"matchPackagePatterns": [ | ||
"*" | ||
], | ||
"groupName": "github actions dependencies", | ||
"groupSlug": "github-actions", | ||
"semanticCommitType": "ci", | ||
"schedule": [ | ||
"before 3:00 am on the 4th day of the month" | ||
] | ||
} | ||
"github>reearth/renovate-config" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
web/src/beta/components/SidePanelSectionField/index.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Meta, StoryObj } from "@storybook/react"; | ||
|
||
import Component from "."; | ||
|
||
const meta: Meta<typeof Component> = { | ||
component: Component, | ||
}; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof Component>; | ||
|
||
export const Default: Story = { | ||
args: { | ||
title: "Title", | ||
children: <p>Item</p>, | ||
}, | ||
}; | ||
|
||
export const Empty: Story = { | ||
args: { | ||
title: "Title", | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { useState, ReactNode } from "react"; | ||
|
||
import { styled, useTheme } from "@reearth/services/theme"; | ||
|
||
import Icon from "../Icon"; | ||
import Text from "../Text"; | ||
|
||
const SidePanelSectionField: React.FC<{ | ||
title: string; | ||
children?: ReactNode; | ||
}> = ({ title, children }) => { | ||
const theme = useTheme(); | ||
const [opened, setOpened] = useState(false); | ||
|
||
return ( | ||
<Field> | ||
<Header onClick={() => setOpened(!opened)}> | ||
<Text | ||
size="footnote" | ||
color={theme.general.content.strong} | ||
otherProperties={{ height: "16px" }}> | ||
{title} | ||
</Text> | ||
<ArrowIcon | ||
icon="arrowToggle" | ||
size={12} | ||
color={theme.general.content.main} | ||
opened={opened} | ||
/> | ||
</Header> | ||
{opened && children} | ||
</Field> | ||
); | ||
}; | ||
|
||
const Field = styled.div` | ||
box-sizing: border-box; | ||
border-bottom: 1px solid ${props => props.theme.general.bg.weak}; | ||
`; | ||
const Header = styled.div` | ||
box-sizing: border-box; | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
padding: 8px; | ||
height: 32px; | ||
cursor: pointer; | ||
`; | ||
const ArrowIcon = styled(Icon)<{ opened: boolean }>` | ||
transform: rotate(${props => (props.opened ? 90 : 180)}deg); | ||
`; | ||
|
||
export default SidePanelSectionField; |
28 changes: 28 additions & 0 deletions
28
web/src/beta/components/StorytellingPageSectionItem/index.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Meta, StoryObj } from "@storybook/react"; | ||
|
||
import StorytellingPageSectionItem from "."; | ||
|
||
export default { | ||
component: StorytellingPageSectionItem, | ||
} as Meta; | ||
|
||
type Story = StoryObj<typeof StorytellingPageSectionItem>; | ||
|
||
export const Default: Story = { | ||
args: { | ||
icon: "square", | ||
title: "New Page", | ||
index: 1, | ||
active: false, | ||
}, | ||
}; | ||
|
||
export const LongText: Story = { | ||
args: { | ||
icon: "square", | ||
title: | ||
"gashjdjahasdasdasdasdasdjjashdjkashdjkahdjkhaskjdhasdasdasdasddfggjsdhasjkdhjkashdkjahskjdhakjshdkahskjdakjshdkjahsdkjhajksdhakjhsdkjhaksjhdakjhsdkjhakjsdhakjhsdkjsadasdasdahskdjhasdasdasdasdasdasdakjsdhksadasd", | ||
index: 1, | ||
active: false, | ||
}, | ||
}; |
80 changes: 80 additions & 0 deletions
80
web/src/beta/components/StorytellingPageSectionItem/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import { FC } from "react"; | ||
|
||
import { styled, useTheme } from "@reearth/services/theme"; | ||
|
||
import Icon from "../Icon"; | ||
import Text from "../Text"; | ||
|
||
type Props = { | ||
icon: string; | ||
title: string; | ||
index: number; | ||
active?: boolean; | ||
onAction?: () => void; | ||
onClick?: () => void; | ||
}; | ||
|
||
const StorytellingPageSectionItem: FC<Props> = ({ | ||
icon, | ||
title, | ||
index, | ||
active, | ||
onAction, | ||
onClick, | ||
}) => { | ||
const theme = useTheme(); | ||
return ( | ||
<HorizontalBox> | ||
<VerticalBox> | ||
<Text size={"body"}>{index}</Text> | ||
<Icon icon={icon} /> | ||
</VerticalBox> | ||
<TitleArea active={active}> | ||
<Text | ||
onClick={onClick} | ||
size="footnote" | ||
color={theme.general.content.strong} | ||
otherProperties={{ wordBreak: "break-all" }}> | ||
{title} | ||
</Text> | ||
<Wrapper> | ||
<Icon icon="actionbutton" onClick={onAction} /> | ||
</Wrapper> | ||
</TitleArea> | ||
</HorizontalBox> | ||
); | ||
}; | ||
|
||
const HorizontalBox = styled.div` | ||
display: flex; | ||
min-height: 56px; | ||
gap: 4px; | ||
cursor: pointer; | ||
`; | ||
|
||
const VerticalBox = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
gap: 4px; | ||
`; | ||
|
||
const TitleArea = styled.div<{ active?: boolean }>` | ||
display: flex; | ||
justify-content: space-between; | ||
padding: 8px; | ||
gap: 4px; | ||
background: ${props => (props.active ? props.theme.general.select : props.theme.general.bg.main)}; | ||
border: 1px solid | ||
${props => (props.active ? props.theme.general.select : props.theme.general.bg.veryWeak)}; | ||
border-radius: 6px; | ||
width: 100%; | ||
`; | ||
|
||
const Wrapper = styled.div` | ||
height: 100%; | ||
`; | ||
|
||
export default StorytellingPageSectionItem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.