-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into PLAY-1581
- Loading branch information
Showing
42 changed files
with
798 additions
and
131 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
49 changes: 49 additions & 0 deletions
49
playbook-website/app/javascript/components/VisualGuidelines/Examples/GroupHover.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,49 @@ | ||
/* eslint-disable flowtype/no-types-missing-file-annotation */ | ||
|
||
import React from 'react' | ||
|
||
import { | ||
Card, | ||
Title, | ||
} from 'playbook-ui' | ||
|
||
import Example from '../Templates/Example' | ||
|
||
const GroupHoverDescription = () => ( | ||
<> | ||
You can hover over a kit and its children's hover affects will be applied. Check out <a href="https://playbook.powerapp.cloud/visual_guidelines/hover">{"our hover affects here."}</a> | ||
</> | ||
) | ||
|
||
const GroupHover = ({ example }: {example: string}) => ( | ||
<Example | ||
backgroundClass='group-hover-class' | ||
description={<GroupHoverDescription />} | ||
example={example} | ||
title="Group Hover" | ||
> | ||
<Card | ||
cursor="pointer" | ||
groupHover | ||
> | ||
<Title | ||
alignSelf="center" | ||
groupHover | ||
hover={{ scale: "lg"}} | ||
text="If the card is hovered, I'm hovered too!" | ||
/> | ||
<Title | ||
alignSelf="center" | ||
paddingY="lg" | ||
text="I don't have any hover effect on me" | ||
/> | ||
<Title | ||
alignSelf="center" | ||
hover={{ scale: "lg"}} | ||
text="I need to be hovered over directly" | ||
/> | ||
</Card> | ||
</Example> | ||
) | ||
|
||
export default GroupHover |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,57 +17,111 @@ Integrating Font Awesome with Playbook ensures that you have access to these ben | |
|
||
![fontawesome](https://github.com/user-attachments/assets/638b63ad-56d3-4819-8e05-fcbb175bedc7) | ||
|
||
## Ruby on Rails Setup (default with asset pipeline) | ||
|
||
**Make sure you are on Rails 7 or higher.** | ||
|
||
**1.** Follow the [Ruby on Rails Setup getting started page](/guides/getting_started/ruby_on_rails_setup) to setup Playbook with your Rails project. | ||
|
||
**2.** Setup Pro or Free Font Awesome to use our Icon Component. | ||
### Ruby on Rails Setup | ||
|
||
<details class="mt_sm"> | ||
<summary class="mb_sm"><strong><img src="https://github.com/user-attachments/assets/781b1ec8-954c-4919-a79c-7009521849a6" alt="rails logo" class="pb_custom_icon svg-inline--fa svg_fw mr_xxs" style="margin: 0;" />Default with an Asset Pipeline</strong></summary> | ||
<strong>Make sure you are on Rails 7 or higher.</strong> | ||
<p> | ||
<strong>1.</strong> Follow the <a href="/guides/getting_started/ruby_on_rails_setup">Ruby on Rails Setup getting started page</a> to setup Playbook with your Rails project. | ||
</p> | ||
<p> | ||
<strong>2.</strong> Setup Pro or Free Font Awesome to use our Icon Component. | ||
</p> | ||
<p><strong>Pro:</strong></p> | ||
<pre><code class="rb"># app/assets/stylesheets/application.scss | ||
@import "font-awesome-pro"; | ||
@import "font-awesome-pro/solid"; | ||
@import "font-awesome-pro/regular"; | ||
@import "playbook";</code></pre> | ||
<pre><code class="rb"># app/Gemfile | ||
source "https://token:[email protected]/basic/fontawesome-pro/ruby/" do | ||
gem "font-awesome-pro-sass", "6.2.0" | ||
end</code></pre> | ||
<strong>Free:</strong> | ||
<p><em>Currently only <a href="https://fontawesome.com/search?o=r&m=free&s=regular">Free Regular</a> icons are supported in our icon component structure.</em></p> | ||
|
||
**Pro:** | ||
<pre><code class="rb"># app/assets/stylesheets/application.scss | ||
@import "font-awesome";</code></pre> | ||
|
||
```rb | ||
# app/assets/stylesheets/application.scss | ||
<pre><code class="rb"># app/Gemfile | ||
source "https://token:[email protected]/basic/fontawesome-pro/ruby/" do | ||
gem "font-awesome-pro-sass", "6.2.0" | ||
end</code></pre> | ||
|
||
<strong>3.</strong> Bundle all the things! | ||
|
||
<pre><code class="sh">bundle install</code></pre> | ||
|
||
<strong>4.</strong> <strong>Go build awesome stuff!</strong> | ||
|
||
<p>Refer to our <a href="/kits/icon">Icon kit</a> to get started with Font Awesome icons in Playbook.</p> | ||
|
||
<pre><code class="rb"><%= pb_rails("icon", props: { icon: "font-awesome", fixed_width: true }) %></code></pre> | ||
</details> | ||
|
||
<details class="mt_sm"> | ||
<summary class="mb_sm"><strong><img src="https://github.com/user-attachments/assets/781b1ec8-954c-4919-a79c-7009521849a6" alt="rails logo" class="pb_custom_icon svg-inline--fa svg_fw mr_xxs" style="margin: 0;" />With a JavaScript Bundler</strong></summary> | ||
<strong>Make sure you are on Rails 7 or higher.</strong> | ||
<p> | ||
<strong>1.</strong> Follow the <a href="/guides/getting_started/ruby_on_rails_setup">Ruby on Rails Setup getting started page</a> to setup Playbook with your Rails project. | ||
</p> | ||
<p> | ||
Use your desired bundler: | ||
<pre><code class="sh">rails new CoolNewApp -j webpack</code></pre> | ||
</p> | ||
<p> | ||
<strong>2.</strong> Follow the <a href="/guides/getting_started/rails_&_react_setup">Ruby & React page</a> if you want to use React with your project. | ||
</p> | ||
<p> | ||
<strong>3.</strong> Setup Pro or Free Font Awesome to use our Icon Component. | ||
</p> | ||
<p><strong>Pro:</strong></p> | ||
<pre><code class="rb"># app/assets/stylesheets/application.scss | ||
@import "font-awesome-pro"; | ||
@import "font-awesome-pro/solid"; | ||
@import "font-awesome-pro/regular"; | ||
@import "playbook"; | ||
``` | ||
@import "playbook";</code></pre> | ||
<pre><code class="rb"># app/Gemfile | ||
source "https://token:[email protected]/basic/fontawesome-pro/ruby/" do | ||
gem "font-awesome-pro-sass", "6.2.0" | ||
end</code></pre> | ||
<p>If you prefer, you can install with JavaScript:</p> | ||
<pre><code class="sh">FONTAWESOME_PACKAGE_TOKEN=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX yarn add @fortawesome/fontawesome-pro</code></pre> | ||
<strong>Free:</strong> | ||
<p><em>Currently only <a href="https://fontawesome.com/search?o=r&m=free&s=regular">Free Regular</a> icons are supported in our icon component structure.</em></p> | ||
|
||
<pre><code class="rb"># app/assets/stylesheets/application.scss | ||
@import "font-awesome";</code></pre> | ||
|
||
```rb | ||
# app/Gemfile | ||
<pre><code class="rb"># app/Gemfile | ||
source "https://token:[email protected]/basic/fontawesome-pro/ruby/" do | ||
gem "font-awesome-pro-sass", "6.2.0" | ||
end | ||
``` | ||
end</code></pre> | ||
|
||
**Free:** | ||
<p>If you prefer, you can install with JavaScript:</p> | ||
<pre><code class="sh">yarn add @fortawesome/fontawesome-free</code></pre> | ||
|
||
*Currently only [Free Regular](https://fontawesome.com/search?o=r&m=free&s=regular) icons are supported in our icon component structure.* | ||
<strong>4.</strong> Bundle all the things! | ||
|
||
```rb | ||
# app/assets/stylesheets/application.scss | ||
@import "font-awesome"; | ||
``` | ||
<pre><code class="sh">bundle install</code></pre> | ||
|
||
```rb | ||
# app/Gemfile | ||
source "https://token:[email protected]/basic/fontawesome-pro/ruby/" do | ||
gem "font-awesome-pro-sass", "6.2.0" | ||
end | ||
``` | ||
<pre><code class="sh">yarn</code></pre> | ||
|
||
<pre><code class="sh">npm install</code></pre> | ||
|
||
<strong>5.</strong> Build JavaScript for development | ||
<p>When using a bundling option, use <code>bin/dev</code> to start the Rails server and build JavaScript for development. Don't forget to add a build script in your package.json file:</p> | ||
|
||
**3.** Bundle all the things! | ||
<pre><code class="js">"scripts": { | ||
"build": "webpack" | ||
},</code></pre> | ||
|
||
```sh | ||
bundle install | ||
``` | ||
<strong>6.</strong> <strong>Go build awesome stuff!</strong> | ||
|
||
**4.** **Go build awesome stuff!** | ||
<p>Refer to our <a href="/kits/icon">Icon kit</a> to get started with Font Awesome icons in Playbook.</p> | ||
|
||
Refer to our [Icon kit](/kits/icon) to get started with Font Awesome icons in Playbook. | ||
<pre><code class="rb"><%= pb_rails("icon", props: { icon: "font-awesome", fixed_width: true }) %></code></pre> | ||
|
||
```rb | ||
<%= pb_rails("icon", props: { icon: "font-awesome", fixed_width: true }) %> | ||
``` | ||
<pre><code class="react"><Icon fixedWidth icon="font-awesome" /></code></pre> | ||
</details> |
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
21 changes: 21 additions & 0 deletions
21
playbook-website/app/views/pages/code_snippets/group_hover_jsx.txt
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,21 @@ | ||
<Card | ||
cursor="pointer" | ||
groupHover | ||
> | ||
<Title | ||
alignSelf="center" | ||
groupHover | ||
hover={{ scale: "lg"}} | ||
text="If the card is hovered, I'm hovered too!" | ||
/> | ||
<Title | ||
alignSelf="center" | ||
paddingY="lg" | ||
text="I don't have any hover effect on me" | ||
/> | ||
<Title | ||
alignSelf="center" | ||
hover={{ scale: "lg"}} | ||
text="I need to be hovered over directly" | ||
/> | ||
</Card> |
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
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
Oops, something went wrong.