-
Notifications
You must be signed in to change notification settings - Fork 584
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1463 from jkranz-rk/master
Lightning styling for flows (#1)
- Loading branch information
Showing
8 changed files
with
442 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
**/jsconfig.json | ||
|
||
**/.eslintrc.json |
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,41 @@ | ||
# Lightning Styling For Flows | ||
|
||
A Repository of Custom Labels and Examples of using the technique described in the UnofficialSF blog post "[Build Lightning Styled Screen Flows that Users Will Love](https://unofficialsf.com/build-lightning-styled-screen-flows-that-users-will-love/)" | ||
|
||
Be mindful of the 5000 Custom Label per org limit. This shouldn't eat too much into that, but it is a limit to be aware of. | ||
|
||
## Included Custom Labels | ||
Each of the values in the CustomLabels file are prefixed with `FlowStyles` to make them easier to find when using them in the Flow resource picker. | ||
|
||
### Badges | ||
- `FlowStyles_Badge` | ||
- `FlowStyles_Badge_Dark` | ||
- `FlowStyles_Badge_Error` | ||
- `FlowStyles_Badge_Light` | ||
- `FlowStyles_Badge_Success` | ||
- `FlowStyles_Badge_Warning` | ||
|
||
### Box | ||
- `FlowStyles_Box` | ||
- `FlowStyles_Box_DarkBlue` | ||
- `FlowStyles_Box_DarkBlueAlt` | ||
- `FlowStyles_Box_Error` | ||
- `FlowStyles_Box_Info` | ||
- `FlowStyles_Box_Shaded` | ||
- `FlowStyles_Box_Success` | ||
- `FlowStyles_Box_Warning` | ||
|
||
### Scoped Notification | ||
- `FlowStyles_Notification_Dark` | ||
- `FlowStyles_Notification_Error` | ||
- `FlowStyles_Notification_Light` | ||
- `FlowStyles_Notification_Success` | ||
- `FlowStyles_Notification_Warning` | ||
|
||
### Section Header/Title | ||
- `FlowStyles_SectionTitle` | ||
|
||
## Example Flow | ||
There is an example flow that demonstrates how to use this technique called `Lightning_Styling_For_Flows` | ||
|
||
![Screenshot of Example Screen Flow that incorporates the Lightning Design System](images/example-flow.png) |
13 changes: 13 additions & 0 deletions
13
flow_apps/LightningStylingForFlows/config/project-scratch-def.json
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,13 @@ | ||
{ | ||
"orgName": "Lightning Styling for Flows", | ||
"edition": "Developer", | ||
"features": ["EnableSetPasswordInApi"], | ||
"settings": { | ||
"lightningExperienceSettings": { | ||
"enableS1DesktopEnabled": true | ||
}, | ||
"mobileSettings": { | ||
"enableS1EncryptedStoragePref2": false | ||
} | ||
} | ||
} |
213 changes: 213 additions & 0 deletions
213
...ingStylingForFlows/force-app/main/default/flows/Lightning_Styling_for_Flows.flow-meta.xml
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,213 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Flow xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<apiVersion>55.0</apiVersion> | ||
<environments>Default</environments> | ||
<formulas> | ||
<name>DarkBadge</name> | ||
<dataType>String</dataType> | ||
<expression>SUBSTITUTE({!$Label.FlowStyles_Badge_Dark},'_BADGE_LABEL_','Dark Badge')</expression> | ||
</formulas> | ||
<formulas> | ||
<name>DefaultBadge</name> | ||
<dataType>String</dataType> | ||
<expression>SUBSTITUTE({!$Label.FlowStyles_Badge},'_BADGE_LABEL_','Default')</expression> | ||
</formulas> | ||
<formulas> | ||
<name>ErrorBadge</name> | ||
<dataType>String</dataType> | ||
<expression>SUBSTITUTE({!$Label.FlowStyles_Badge_Error},'_BADGE_LABEL_','Error Badge')</expression> | ||
</formulas> | ||
<formulas> | ||
<name>htmlEncodedCode</name> | ||
<dataType>String</dataType> | ||
<expression>HTMLENCODE('<html>') & BR() & HTMLENCODE('<body></body>') & BR() & HTMLENCODE('</html>')</expression> | ||
</formulas> | ||
<formulas> | ||
<name>LightBadge</name> | ||
<dataType>String</dataType> | ||
<expression>SUBSTITUTE({!$Label.FlowStyles_Badge_Light},'_BADGE_LABEL_','Light Badge')</expression> | ||
</formulas> | ||
<formulas> | ||
<name>SuccessBadge</name> | ||
<dataType>String</dataType> | ||
<expression>SUBSTITUTE({!$Label.FlowStyles_Badge_Success},'_BADGE_LABEL_','Success Badge')</expression> | ||
</formulas> | ||
<formulas> | ||
<name>WarningBadge</name> | ||
<dataType>String</dataType> | ||
<expression>SUBSTITUTE({!$Label.FlowStyles_Badge_Warning},'_BADGE_LABEL_','Warning Badge')</expression> | ||
</formulas> | ||
<interviewLabel>Lightning Styling for Flows {!$Flow.CurrentDateTime}</interviewLabel> | ||
<label>Lightning Styling for Flows</label> | ||
<processMetadataValues> | ||
<name>BuilderType</name> | ||
<value> | ||
<stringValue>LightningFlowBuilder</stringValue> | ||
</value> | ||
</processMetadataValues> | ||
<processMetadataValues> | ||
<name>CanvasMode</name> | ||
<value> | ||
<stringValue>AUTO_LAYOUT_CANVAS</stringValue> | ||
</value> | ||
</processMetadataValues> | ||
<processMetadataValues> | ||
<name>OriginBuilderType</name> | ||
<value> | ||
<stringValue>LightningFlowBuilder</stringValue> | ||
</value> | ||
</processMetadataValues> | ||
<processType>Flow</processType> | ||
<screens> | ||
<name>Lightning_Styling_for_Flows_Example</name> | ||
<label>Lightning Styling for Flows Example</label> | ||
<locationX>176</locationX> | ||
<locationY>134</locationY> | ||
<allowBack>true</allowBack> | ||
<allowFinish>true</allowFinish> | ||
<allowPause>true</allowPause> | ||
<fields> | ||
<name>Lightning_Styling_for_Flows_Example_Section1</name> | ||
<fieldType>RegionContainer</fieldType> | ||
<fields> | ||
<name>Lightning_Styling_for_Flows_Example_Section1_Column1</name> | ||
<fieldType>Region</fieldType> | ||
<fields> | ||
<name>BoxSectionHeaderDisplay</name> | ||
<fieldText><p>{!$Label.FlowStyles_SectionTitle}</p><p>Box Styles</p></fieldText> | ||
<fieldType>DisplayText</fieldType> | ||
</fields> | ||
<fields> | ||
<name>PlainBoxDisplay</name> | ||
<fieldText><p>{!$Label.FlowStyles_Box}</p><p>Here is some content that is contained within a plain box!</p><ul><li>Good for visually separating help or guidance text</li><li>You can still control the content from the Display Text rich text editor</li><li>This means you can <strong>still</strong> <em>apply</em> <u>rich</u> text formatting! </li></ul></fieldText> | ||
<fieldType>DisplayText</fieldType> | ||
</fields> | ||
<fields> | ||
<name>ShadedBox_Display</name> | ||
<fieldText><p>{!$Label.FlowStyles_Box_Shaded}</p><p>Example of a box that uses a light shade theme</p></fieldText> | ||
<fieldType>DisplayText</fieldType> | ||
</fields> | ||
<fields> | ||
<name>InfoBoxDisplay</name> | ||
<fieldText><p>{!$Label.FlowStyles_Box_Info}</p><p>Example of a box that uses a darker "info" shade theme</p></fieldText> | ||
<fieldType>DisplayText</fieldType> | ||
</fields> | ||
<fields> | ||
<name>DarkBlueBoxDisplay</name> | ||
<fieldText><p><span style="background-color: rgb(255, 255, 255); color: rgb(68, 68, 68);">{!$Label.FlowStyles_Box_DarkBlue}</span></p><p>Example of a box that uses a dark blue "inverse" theme</p></fieldText> | ||
<fieldType>DisplayText</fieldType> | ||
</fields> | ||
<fields> | ||
<name>AlternateDarkBlueBoxDisplay</name> | ||
<fieldText><p>{!$Label.FlowStyles_Box_DarkBlueAlt}</p><p>Example of a box that uses an alternative blue "inverse" theme</p></fieldText> | ||
<fieldType>DisplayText</fieldType> | ||
</fields> | ||
<inputParameters> | ||
<name>width</name> | ||
<value> | ||
<stringValue>6</stringValue> | ||
</value> | ||
</inputParameters> | ||
<isRequired>false</isRequired> | ||
</fields> | ||
<fields> | ||
<name>Lightning_Styling_for_Flows_Example_Section1_Column2</name> | ||
<fieldType>Region</fieldType> | ||
<fields> | ||
<name>NotificationsSectionHeaderDisplay</name> | ||
<fieldText><p>{!$Label.FlowStyles_SectionTitle}</p><p>Notification Styles</p></fieldText> | ||
<fieldType>DisplayText</fieldType> | ||
</fields> | ||
<fields> | ||
<name>SuccessNotificationDisplay</name> | ||
<fieldText><p>{!$Label.FlowStyles_Notification_Success}</p><p style="text-align: center;"><strong>Success Notification!</strong> Draw attention to a successful action</p></fieldText> | ||
<fieldType>DisplayText</fieldType> | ||
</fields> | ||
<fields> | ||
<name>WarningNotificationDisplay</name> | ||
<fieldText><p>{!$Label.FlowStyles_Notification_Warning}</p><p style="text-align: center;"><strong>Warning Notification!</strong> Draw attention to a warning</p></fieldText> | ||
<fieldType>DisplayText</fieldType> | ||
</fields> | ||
<fields> | ||
<name>ErrorNotificationDisplay</name> | ||
<fieldText><p>{!$Label.FlowStyles_Notification_Error}</p><p style="text-align: center;"><strong>Error Notification!</strong> Draw attention to an error message</p></fieldText> | ||
<fieldType>DisplayText</fieldType> | ||
</fields> | ||
<fields> | ||
<name>AddSpaceDisplay</name> | ||
<fieldText><p><br></p><p><br></p></fieldText> | ||
<fieldType>DisplayText</fieldType> | ||
</fields> | ||
<fields> | ||
<name>BadgesSectionHeaderDisplay</name> | ||
<fieldText><p>{!$Label.FlowStyles_SectionTitle}</p><p>Badges</p></fieldText> | ||
<fieldType>DisplayText</fieldType> | ||
</fields> | ||
<fields> | ||
<name>HelloBadgeDisplay</name> | ||
<fieldText><p>{!$Label.FlowStyles_Box}</p><p>{!DefaultBadge}{!DarkBadge}{!LightBadge}{!SuccessBadge}{!WarningBadge}{!ErrorBadge}</p></fieldText> | ||
<fieldType>DisplayText</fieldType> | ||
</fields> | ||
<inputParameters> | ||
<name>width</name> | ||
<value> | ||
<stringValue>6</stringValue> | ||
</value> | ||
</inputParameters> | ||
<isRequired>false</isRequired> | ||
</fields> | ||
<isRequired>false</isRequired> | ||
<regionContainerType>SectionWithoutHeader</regionContainerType> | ||
</fields> | ||
<fields> | ||
<name>ButtonLinksSectionHeaderDisplay</name> | ||
<fieldText><p>{!$Label.FlowStyles_SectionTitle}</p><p>Links that look like Buttons</p></fieldText> | ||
<fieldType>DisplayText</fieldType> | ||
</fields> | ||
<fields> | ||
<name>ButtonsDisplay</name> | ||
<fieldText><p><br></p><p style="text-align: center;">{!NeutralButtonLink} {!BrandButtonLink} {!OutlineBrandButtonLink}</p></fieldText> | ||
<fieldType>DisplayText</fieldType> | ||
</fields> | ||
<showFooter>true</showFooter> | ||
<showHeader>true</showHeader> | ||
</screens> | ||
<start> | ||
<locationX>50</locationX> | ||
<locationY>0</locationY> | ||
<connector> | ||
<targetReference>Lightning_Styling_for_Flows_Example</targetReference> | ||
</connector> | ||
</start> | ||
<status>Active</status> | ||
<textTemplates> | ||
<name>blockQuote</name> | ||
<isViewedAsPlainText>true</isViewedAsPlainText> | ||
<text><blockquote>Hello my darling, hello my baby, hello my blockquote tag</blockquote></text> | ||
</textTemplates> | ||
<textTemplates> | ||
<name>BrandButtonLink</name> | ||
<isViewedAsPlainText>true</isViewedAsPlainText> | ||
<text><a class="slds-button slds-button_brand" href="#">Brand Button Link</a></text> | ||
</textTemplates> | ||
<textTemplates> | ||
<name>formattedCode</name> | ||
<isViewedAsPlainText>true</isViewedAsPlainText> | ||
<text><code>{!htmlEncodedCode}</code></text> | ||
</textTemplates> | ||
<textTemplates> | ||
<name>NeutralButtonLink</name> | ||
<isViewedAsPlainText>true</isViewedAsPlainText> | ||
<text><a class="slds-button slds-button_neutral" href="#">Neutral Button Link</a></text> | ||
</textTemplates> | ||
<textTemplates> | ||
<name>OutlineBrandButtonLink</name> | ||
<isViewedAsPlainText>true</isViewedAsPlainText> | ||
<text><a class="slds-button slds-button_outline-brand" href="#">Outline Brand Button Link</a></text> | ||
</textTemplates> | ||
<textTemplates> | ||
<name>SectionStyle</name> | ||
<isViewedAsPlainText>true</isViewedAsPlainText> | ||
<text><div class="slds-section slds-section__title slds-theme_shade slds-p-horizontal_small"></text> | ||
</textTemplates> | ||
</Flow> |
Oops, something went wrong.