Skip to content

Commit

Permalink
Leftover
Browse files Browse the repository at this point in the history
  • Loading branch information
r100-stack committed Nov 18, 2024
1 parent d39bd4e commit acab7f6
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 71 deletions.
56 changes: 27 additions & 29 deletions apps/react-workshop/src/Panels.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const MultiPanelInformationPanel = () => {
>
<Panels.Panel id={initialActiveId}>
<Surface.Header as={Panels.Header}>Root</Surface.Header>
<Surface.Body as={List}>
<Surface.Body as={List} style={{ height: '100%' }}>
{panels.map((panel) => (
<ListItem key={panel.id}>
<ListItem.Content>
Expand Down Expand Up @@ -203,34 +203,32 @@ export const MultiLevelList = () => {
blockSize: 'min(250px, 50vh)',
}}
>
<Panels.Panel id={initialActiveId}>
<List>
<ListItem>
<ListItem.Content as='label' htmlFor={toggleSwitchId}>
Repeat
</ListItem.Content>
<ToggleSwitch
id={toggleSwitchId}
onChange={(e) => setRepeat(e.target.checked)}
checked={repeat}
/>
</ListItem>
<ListItem>
<Panels.Trigger for={qualityPanelId}>
<ListItem.Action>Quality</ListItem.Action>
</Panels.Trigger>
</ListItem>
<ListItem>
<Panels.Trigger for={speedPanelId}>
<ListItem.Action>Speed</ListItem.Action>
</Panels.Trigger>
</ListItem>
<ListItem>
<Panels.Trigger for={accessibilityPanelId}>
<ListItem.Action>Accessibility</ListItem.Action>
</Panels.Trigger>
</ListItem>
</List>
<Panels.Panel as={List} id={initialActiveId}>
<ListItem>
<ListItem.Content as='label' htmlFor={toggleSwitchId}>
Repeat
</ListItem.Content>
<ToggleSwitch
id={toggleSwitchId}
onChange={(e) => setRepeat(e.target.checked)}
checked={repeat}
/>
</ListItem>
<ListItem>
<Panels.Trigger for={qualityPanelId}>
<ListItem.Action>Quality</ListItem.Action>
</Panels.Trigger>
</ListItem>
<ListItem>
<Panels.Trigger for={speedPanelId}>
<ListItem.Action>Speed</ListItem.Action>
</Panels.Trigger>
</ListItem>
<ListItem>
<Panels.Trigger for={accessibilityPanelId}>
<ListItem.Action>Accessibility</ListItem.Action>
</Panels.Trigger>
</ListItem>
</Panels.Panel>

<Panels.Panel id={qualityPanelId}>
Expand Down
9 changes: 2 additions & 7 deletions examples/Panels.main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default () => {

return (
<Panels.Wrapper as={Surface} className='demo-panels-wrapper'>
<Panels.Panel id={panelIdRoot} as={Surface} border={false} elevation={0}>
<Panels.Panel id={panelIdRoot}>
<Surface.Header as={Panels.Header}>Root</Surface.Header>
<Surface.Body as={List}>
<ListItem>
Expand All @@ -27,12 +27,7 @@ export default () => {
</Surface.Body>
</Panels.Panel>

<Panels.Panel
id={panelIdMoreInfo}
as={Surface}
border={false}
elevation={0}
>
<Panels.Panel id={panelIdMoreInfo}>
<Surface.Header as={Panels.Header}>More details</Surface.Header>
<Surface.Body isPadded>
<Text>Content</Text>
Expand Down
21 changes: 3 additions & 18 deletions examples/Panels.multiLevelList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,7 @@ export default () => {
</ListItem>
</Panels.Panel>

<Panels.Panel
id={qualityPanelId}
as={Surface}
border={false}
elevation={0}
>
<Panels.Panel id={qualityPanelId}>
<Surface.Header as={Panels.Header}>Quality</Surface.Header>
<Surface.Body as={List}>
{qualities.map((quality) => (
Expand All @@ -138,12 +133,7 @@ export default () => {
</Surface.Body>
</Panels.Panel>

<Panels.Panel
id={speedPanelId}
as={Surface}
border={false}
elevation={0}
>
<Panels.Panel id={speedPanelId}>
<Surface.Header as={Panels.Header}>Speed</Surface.Header>
<Surface.Body as={List}>
{speeds.map((speed) => (
Expand All @@ -152,12 +142,7 @@ export default () => {
</Surface.Body>
</Panels.Panel>

<Panels.Panel
as={Surface}
id={accessibilityPanelId}
border={false}
elevation={0}
>
<Panels.Panel id={accessibilityPanelId}>
<Surface.Header as={Panels.Header}>Accessibility</Surface.Header>
<Surface.Body as={List}>
<_ItemAccessibility content='High contrast' />
Expand Down
4 changes: 4 additions & 0 deletions examples/Panels.multiPanelInformationPanel.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
inline-size: 200px;
block-size: 300px;
}

.demo-initial-panel-body {
height: 100%;
}
15 changes: 5 additions & 10 deletions examples/Panels.multiPanelInformationPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,9 @@ export default () => {

return (
<Panels.Wrapper as={Surface} className='demo-panels-wrapper'>
<Panels.Panel
id={initialActiveId}
as={Surface}
border={false}
elevation={0}
>
<Panels.Panel id={initialActiveId}>
<Surface.Header as={Panels.Header}>Root</Surface.Header>
<Surface.Body as={List}>
<Surface.Body as={List} className='demo-initial-panel-body'>
{panels.map((panel) => (
<ListItem key={panel.id}>
<ListItem.Content>
Expand All @@ -44,11 +39,11 @@ export default () => {

{panels.map((panel) => (
<Panels.Panel
as={Flex}
key={panel.id}
id={panel.id}
as={Surface}
border={false}
elevation={0}
flexDirection='column'
alignItems='stretch'
>
<Surface.Header as={Panels.Header}>{panel.label}</Surface.Header>
<Surface.Body as={Flex} flexDirection='column'>
Expand Down
8 changes: 1 addition & 7 deletions examples/Panels.nestedPanels.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,7 @@ export default () => {
className='demo-panels-wrapper'
>
{panelIds.map((id, index) => (
<Panels.Panel
key={id}
id={id}
as={Surface}
border={false}
elevation={0}
>
<Panels.Panel key={id} id={id}>
<Surface.Header as={Panels.Header}>{id}</Surface.Header>
<Surface.Body isPadded>
<Panels.Trigger for={panelIds[index + 1]}>
Expand Down

0 comments on commit acab7f6

Please sign in to comment.