-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added snowflake checklist widget and fixed the component struct…
…ure for better reusability (#2378) * add: snowflake checklist and fixed the component structure for reusability * fix: readme image for dev handoff checklist * fix: readme added image border for dev handoff checklist * fix: manifest version for snowflake handoff checklist widget * feat: added review list to snowflake and improved checkbox & listview components * fix: removed spell errors from snowflake handoff checklsit widget * fix: restructure * chore: lint errors --------- Co-authored-by: kamleshchandnani <[email protected]>
- Loading branch information
1 parent
ff1f383
commit a7b8302
Showing
19 changed files
with
371 additions
and
112 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,10 +1,14 @@ | ||
{ | ||
"api": "1.0.0", | ||
"editorType": ["figma"], | ||
"id": "", | ||
"editorType": [ | ||
"figma" | ||
], | ||
"id": "1258393250170675750", | ||
"name": "Blade Coverage", | ||
"main": "build/main.js", | ||
"ui": "build/ui.js", | ||
"permissions": ["currentuser"], | ||
"permissions": [ | ||
"currentuser" | ||
], | ||
"enablePrivatePluginApi": true | ||
} |
63 changes: 0 additions & 63 deletions
63
packages/widget-dev-handoff-checklist/components/ListView.tsx
This file was deleted.
Oops, something went wrong.
Binary file not shown.
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 |
---|---|---|
|
@@ -6,3 +6,4 @@ node_modules | |
out/ | ||
dist/ | ||
code.js | ||
.env |
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
87 changes: 87 additions & 0 deletions
87
packages/widget-figma-dev-handoff-checklist/components/ListView.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,87 @@ | ||
/* eslint-disable @typescript-eslint/explicit-function-return-type */ | ||
import React from 'react'; | ||
const { AutoLayout, Text, Input, useSyncedState } = figma.widget; | ||
|
||
interface ListViewProps { | ||
id: string; | ||
listText: string; | ||
helpText?: string; | ||
isEditable?: boolean; | ||
isEditablePlaceholderText?: string; | ||
isEditableHelpText?: boolean; | ||
isEditablePlaceholderHelpText?: string; | ||
} | ||
|
||
function ListView({ | ||
id, | ||
listText, | ||
helpText, | ||
isEditable = false, | ||
isEditableHelpText = false, | ||
isEditablePlaceholderText = "<Reviewer's Name>", | ||
isEditablePlaceholderHelpText = '<Review Date>', | ||
}: ListViewProps) { | ||
const [listTextInput, setListTextInput] = useSyncedState(`${id}_listInputText`, ''); | ||
const [dateTextInput, setDateTextInput] = useSyncedState(`${id}_dateInputText`, ''); | ||
|
||
return ( | ||
<AutoLayout | ||
padding={{ horizontal: 4, vertical: 2 }} | ||
cornerRadius={4} | ||
direction="horizontal" | ||
spacing={4} | ||
width="fill-parent" | ||
> | ||
<AutoLayout verticalAlignItems="center" horizontalAlignItems="center" width={20} height={20}> | ||
<Text fontSize={14} fontWeight={400} lineHeight={20} fill="#768EA7"> | ||
→ | ||
</Text> | ||
</AutoLayout> | ||
<AutoLayout direction="vertical" width="fill-parent"> | ||
<AutoLayout direction="horizontal" wrap={true} spacing={4} width="fill-parent"> | ||
<Text fontSize={14} fontWeight={400} lineHeight={20} fill="#40566D"> | ||
{listText} | ||
</Text> | ||
{isEditable ? ( | ||
<Input | ||
value={listTextInput} | ||
placeholder={`<${isEditablePlaceholderText}>`} | ||
onTextEditEnd={(e) => setListTextInput(e.characters)} | ||
fontSize={14} | ||
fontWeight={600} | ||
lineHeight={20} | ||
fill="#40566D" | ||
width="fill-parent" | ||
hoverStyle={{ fill: '#305EFF' }} | ||
/> | ||
) : null} | ||
</AutoLayout> | ||
{helpText ? ( | ||
<AutoLayout direction="horizontal" wrap={true} spacing={4} width="fill-parent"> | ||
<Text fontSize={11} fontWeight={400} lineHeight={16} fill={'#768EA7'} italic={true}> | ||
{helpText} | ||
</Text> | ||
</AutoLayout> | ||
) : null} | ||
{isEditableHelpText ? ( | ||
<AutoLayout direction="horizontal" wrap={true} spacing={4} width="fill-parent"> | ||
<Input | ||
value={dateTextInput} | ||
placeholder={`<${isEditablePlaceholderHelpText}>`} | ||
onTextEditEnd={(e) => setDateTextInput(e.characters)} | ||
fontSize={11} | ||
fontWeight={400} | ||
lineHeight={16} | ||
italic={true} | ||
fill="#768EA7" | ||
width="fill-parent" | ||
hoverStyle={{ fill: '#305EFF' }} | ||
/> | ||
</AutoLayout> | ||
) : null} | ||
</AutoLayout> | ||
</AutoLayout> | ||
); | ||
} | ||
|
||
export default ListView; |
45 changes: 45 additions & 0 deletions
45
packages/widget-figma-dev-handoff-checklist/components/ProgressBar.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,45 @@ | ||
/* eslint-disable @typescript-eslint/explicit-function-return-type */ | ||
/* eslint-disable @typescript-eslint/no-empty-function */ | ||
import React from 'react'; | ||
import SectionHeader from './SectionHeader'; | ||
const { AutoLayout, Text } = figma.widget; | ||
|
||
interface ProgressBarProps { | ||
cardWidgetWidth: number; | ||
numberOfCheckboxes: number; | ||
checkedItems: number; | ||
} | ||
|
||
function ProgressBar({ cardWidgetWidth, numberOfCheckboxes, checkedItems }: ProgressBarProps) { | ||
const isAllCheckboxesChecked = checkedItems === numberOfCheckboxes; | ||
|
||
return ( | ||
<AutoLayout | ||
direction="horizontal" | ||
spacing="auto" | ||
cornerRadius={4} | ||
padding={{ horizontal: 8, vertical: 4 }} | ||
width="fill-parent" | ||
height={20} | ||
fill="#ECF1FF" | ||
> | ||
<AutoLayout | ||
positioning="absolute" | ||
x={0} | ||
y={0} | ||
width={checkedItems === 0 ? 1 : checkedItems * (cardWidgetWidth / numberOfCheckboxes)} | ||
height={20} | ||
fill={isAllCheckboxesChecked ? '#00A251' : '#D0DBFF'} | ||
/> | ||
<Text fontSize={10} fontWeight={600} fill={isAllCheckboxesChecked ? '#ffffff' : '#768EA7'}> | ||
{isAllCheckboxesChecked ? '🎉 Ready for handoff!' : '😕 Not ready for handoff'} | ||
</Text> | ||
<SectionHeader | ||
title={`${checkedItems}/${numberOfCheckboxes}`} | ||
color={isAllCheckboxesChecked ? '#ffffff' : '#768EA7'} | ||
/> | ||
</AutoLayout> | ||
); | ||
} | ||
|
||
export default ProgressBar; |
1 change: 1 addition & 0 deletions
1
...ff-checklist/components/SectionHeader.tsx → ...ff-checklist/components/SectionHeader.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
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
Binary file added
BIN
+151 KB
...-figma-dev-handoff-checklist/dev-handoff-checklist/figma-dev-handoff-widget.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.