-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: wip DynamicZoneBlock opened icon, state, FormDynamicZone onToggle
- Loading branch information
Quentin Le Caignec
committed
Aug 21, 2024
1 parent
ddb325b
commit 617f8e0
Showing
10 changed files
with
262 additions
and
74 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
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
85 changes: 85 additions & 0 deletions
85
packages/haring-react/src/Form/DynamicZone/DynamicZone.mock.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,85 @@ | ||
import type { IDynamicZoneBlockReference } from './DynamicZoneBlock/DynamicZoneBlock'; | ||
import type { IActionListAction } from '../../Components/ActionList/ActionList'; | ||
import type { IBaseBlock, IBaseBlockButton } from '../../types'; | ||
|
||
import { | ||
Alien, | ||
ArrowDown, | ||
ArrowUp, | ||
Leaf, | ||
Trash, | ||
TreasureChest, | ||
} from '@phosphor-icons/react'; | ||
import { action } from '@storybook/addon-actions'; | ||
|
||
const dynamicZoneBlockActionsMock: IActionListAction<IDynamicZoneBlockReference>[] = | ||
[ | ||
{ | ||
color: 'white', | ||
icon: <ArrowUp size={16} />, | ||
id: 'move-up', | ||
label: 'Move Up', | ||
onAction: action('Move block up'), | ||
}, | ||
{ | ||
color: 'white', | ||
icon: <ArrowDown size={16} />, | ||
id: 'move-down', | ||
label: 'Move Down', | ||
onAction: action('Move block down'), | ||
}, | ||
{ | ||
color: 'white', | ||
icon: <Trash size={16} />, | ||
id: 'delete', | ||
label: 'Delete', | ||
onAction: action('Delete block'), | ||
}, | ||
]; | ||
|
||
export const dynamicZoneBlocks: IBaseBlock[] = [ | ||
{ | ||
blockActions: dynamicZoneBlockActionsMock, | ||
blockHeader: ( | ||
<> | ||
<Alien /> | ||
First | ||
</> | ||
), | ||
id: '1', | ||
opened: false, | ||
value: 'initial', | ||
}, | ||
{ | ||
blockActions: dynamicZoneBlockActionsMock, | ||
blockFooter: 'footer', | ||
blockHeader: ( | ||
<> | ||
<Leaf /> | ||
Second | ||
</> | ||
), | ||
id: '2', | ||
opened: true, | ||
value: 'initial', | ||
}, | ||
{ | ||
blockActions: dynamicZoneBlockActionsMock, | ||
blockFooter: 'footer', | ||
blockHeader: ( | ||
<> | ||
<TreasureChest /> | ||
Third | ||
</> | ||
), | ||
id: '3', | ||
opened: false, | ||
value: 'initial', | ||
}, | ||
]; | ||
|
||
export const dynamicZoneButtons: IBaseBlockButton[] = [ | ||
{ id: 'default', label: 'Default', leftSection: <Alien /> }, | ||
{ id: 'other', label: 'Other', leftSection: <Leaf /> }, | ||
{ id: 'stuff', label: 'Stuff', leftSection: <TreasureChest /> }, | ||
]; |
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 |
---|---|---|
|
@@ -7,4 +7,6 @@ | |
} | ||
|
||
.buttonsContainer { | ||
/* WIP */ | ||
border: 1px dashed red; | ||
} |
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
7 changes: 0 additions & 7 deletions
7
packages/haring-react/src/Form/DynamicZone/DynamicZoneBlock/DynamicZoneBlock.module.css
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,11 +1,4 @@ | ||
.container { | ||
} | ||
|
||
.header { | ||
cursor: pointer; | ||
user-select: none; | ||
|
||
&:hover { | ||
filter: contrast(40%); | ||
} | ||
} |
Oops, something went wrong.