playbook_ui_docs 12.25.0.pre.alpha.play822bolddefaultfortitle3764 → 12.25.0.pre.alpha.play824786

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_avatar/docs/_avatar_swift.md +82 -1
  3. data/app/pb_kits/playbook/pb_detail/docs/_description.md +1 -0
  4. data/app/pb_kits/playbook/pb_detail/docs/_detail_bold.html.erb +34 -0
  5. data/app/pb_kits/playbook/pb_detail/docs/_detail_bold.jsx +49 -0
  6. data/app/pb_kits/playbook/pb_detail/docs/_detail_bold.md +1 -0
  7. data/app/pb_kits/playbook/pb_detail/docs/_detail_colors.html.erb +24 -0
  8. data/app/pb_kits/playbook/pb_detail/docs/_detail_colors.jsx +38 -0
  9. data/app/pb_kits/playbook/pb_detail/docs/_detail_colors.md +6 -0
  10. data/app/pb_kits/playbook/pb_detail/docs/_detail_default.html.erb +3 -0
  11. data/app/pb_kits/playbook/pb_detail/docs/_detail_default.jsx +13 -0
  12. data/app/pb_kits/playbook/pb_detail/docs/_detail_styled.html.erb +22 -0
  13. data/app/pb_kits/playbook/pb_detail/docs/_detail_styled.jsx +32 -0
  14. data/app/pb_kits/playbook/pb_detail/docs/example.yml +11 -0
  15. data/app/pb_kits/playbook/pb_detail/docs/index.js +4 -0
  16. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_default.md +1 -1
  17. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_return_all_selected.html.erb +1 -0
  18. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_validation.html.erb +14 -0
  19. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_validation.jsx +60 -0
  20. data/app/pb_kits/playbook/pb_phone_number_input/docs/example.yml +3 -1
  21. data/app/pb_kits/playbook/pb_phone_number_input/docs/index.js +1 -0
  22. data/app/pb_kits/playbook/pb_title/docs/_title_light_weight.html.erb +0 -1
  23. data/app/pb_kits/playbook/pb_title/docs/_title_light_weight.jsx +0 -6
  24. data/app/pb_kits/playbook/pb_title/docs/_title_light_weight.md +2 -1
  25. data/dist/app/components/playbook/pb_docs/kit_api.html.erb +1 -1
  26. data/dist/app/components/playbook/pb_docs/kit_example.html.erb +14 -8
  27. data/dist/app/components/playbook/pb_docs/kit_example.rb +9 -2
  28. data/dist/menu.yml +1 -0
  29. data/dist/pb_doc_helper.rb +4 -1
  30. data/dist/playbook-doc.js +61 -61
  31. metadata +17 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4f84f9245cf801f85ab5dfc3f0978e4c7145e3d6cfa842c6cda1f497a42df94f
4
- data.tar.gz: 69c8c7d46dea768b11f8e54e7d0a581ee450b5f730d7fdfbc157a07a6b4c3f58
3
+ metadata.gz: 55a134041f0bd091d00782a4574c401246c42c819da44aeab2ea54f3c81bbdaf
4
+ data.tar.gz: b6f5c0a997ba59e6a056abcf4089e3c2e8be28a02d52267c36f3de0d3fe9cbce
5
5
  SHA512:
6
- metadata.gz: 696ca3aa7566fed253f62ad0cddcc4216873f4bc08a54454fdf10eef6b5e694ede44bf7497245d854f1e9de1cf3277d71d8ffc1af0ccbcb10c230fa4420f3e84
7
- data.tar.gz: 70a5d5ea8fff0b2fcb967cfb9b6510d7ccfd5e10cfb719b46cd8d61e301c8f3575eaf4b2d736b772f1b6e55b1299b55d5f635166fe54ec1cf6f543b2a036d9d9
6
+ metadata.gz: 42c74c97bc51212b2f2a509dd60776f783abedfa775f5b5026e7f3445fa74366d07d5b5a3d272454d6afb3ad3c494aa5122ee9c93dbac5dda3be39874e84fc3c
7
+ data.tar.gz: 671afc3e799488d9b4965607f20f7442efd7c203265ad41d403db96738a89af685a97730a82dba91fb73864b7828b1e7ddc1a9b0d8cafdb1872d24b912ed7588
@@ -1 +1,82 @@
1
- ![image for avatar](https://images.unsplash.com/photo-1684237276530-a562fa8338b1?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=580&q=80)
1
+ In the world of design, consistency is key. Whether you're designing a website, app, or product, having a consistent visual language can make all the difference. That's where design systems come in.
2
+
3
+ A design system is a collection of reusable components, guidelines, and assets that help ensure consistency across all of your design work. It's a way to standardize your design language, making it easier for your team to work together and for your users to navigate your products.
4
+
5
+ In this article, we'll explore the various elements of a design system and how they can be used to create a cohesive and effective design language.
6
+
7
+ ### Headings
8
+ Headings are an essential component of any design system. They help organize content, provide visual hierarchy, and make it easier for users to scan and find what they're looking for. A good design system will have headings of various sizes, ranging from H1 (the largest) to H6 (the smallest). Here's an example:
9
+
10
+ # H1: Main Title Headings
11
+ ## H2: Headings
12
+ ### H3: Subheadings
13
+ #### H4: Sub-Subheadings
14
+
15
+ ![image for avatar](https://images.unsplash.com/photo-1684237276530-a562fa8338b1?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=580&q=80)
16
+
17
+ ### Lists
18
+ Lists are another important component of a design system. They help organize content into easily digestible chunks, making it easier for users to read and understand. There are two types of lists: ordered and unordered.
19
+
20
+ Ordered lists are numbered, and each item is listed in a specific order. For example:
21
+
22
+ 1. Headings
23
+ 2. Lists
24
+ 3. Blockquotes
25
+ 4. Links
26
+ 5. Bold
27
+ 6. Underline
28
+ 7. Code Blocks
29
+ 8. Inline Code
30
+ 9. Example Tables
31
+ 10. Horizontal Rules
32
+
33
+ Unordered lists, on the other hand, use bullet points to separate each item. For example:
34
+
35
+ * Headings
36
+ * Lists
37
+ * Blockquotes
38
+ * Links
39
+ * Bold
40
+ * Underline
41
+ * Code Blocks
42
+ * Inline Code
43
+ * Example Tables
44
+ * Horizontal Rules
45
+
46
+ ### Blockquotes
47
+ Blockquotes are used to highlight a particular section of text or quote. They’re often used to emphasize an important point or to provide context. Here’s an example:
48
+
49
+ > “Design systems are a collection of reusable components, guidelines, and assets that help ensure consistency across all of your design work.” - ChatGPT
50
+
51
+
52
+ ### Links
53
+ Links are an important part of any design system. They allow users to navigate between different pages and sections of your product. When using links in your design system, it’s important to make sure they’re consistent in color, size, and style. Here’s an example:
54
+ Click here to learn more about design systems.
55
+
56
+ ### Bold, Underline, & Italics
57
+ **Bold** and _underline_ are used to *highlight specific words* or phrases within ~~a block of~~ text. They help draw the user’s attention to important information. Here’s an example: *Design systems are* a collection of **reusable components**, **guidelines**, and **assets** that help ensure _consistency across all of your design work_.
58
+
59
+ ### Code Blocks and Inline Code
60
+ Code blocks and `inline code` are used to display and highlight code within a block of text. This is especially useful for developers who need to reference code snippets in their work.
61
+
62
+ Here’s an example:
63
+
64
+ ```js
65
+ function greet() {
66
+ console.log(“Hello, world!”);
67
+ }
68
+ ```
69
+
70
+ ### Example Tables
71
+ Example tables are used to display data in a clear and organized way. They help users compare and analyze information quickly. Here’s an example:
72
+
73
+ | Tables | Are | Cool |
74
+ |----------|:-------------:|------:|
75
+ | col 1 is | left-aligned | $1600 |
76
+ | col 2 is | centered | $12 |
77
+ | col 3 is | right-aligned | $1 |
78
+
79
+ ---
80
+
81
+ ### Horizontal Rules
82
+ Horizontal rules are used to separate sections of content visually. They help break up long blocks of text and make it easier for users
@@ -0,0 +1 @@
1
+ Used for tables or designs with large amounts of data or text.
@@ -0,0 +1,34 @@
1
+ <%= pb_rails("detail", props: {
2
+ bold: true,
3
+ text: "I am a bold detail kit"
4
+ }) %>
5
+
6
+ <%= pb_rails("detail", props: {
7
+ bold: true,
8
+ color: "default",
9
+ text: "I am a bold detail kit"
10
+ }) %>
11
+
12
+ <%= pb_rails("detail", props: {
13
+ bold: true,
14
+ color: "lighter",
15
+ text: "I am a bold detail kit"
16
+ }) %>
17
+
18
+ <%= pb_rails("detail", props: {
19
+ bold: true,
20
+ color: "link",
21
+ text: "I am a bold detail kit"
22
+ }) %>
23
+
24
+ <%= pb_rails("detail", props: {
25
+ bold: true,
26
+ color: "error",
27
+ text: "I am a bold detail kit"
28
+ }) %>
29
+
30
+ <%= pb_rails("detail", props: {
31
+ bold: true,
32
+ color: "success",
33
+ text: "I am a bold detail kit"
34
+ }) %>
@@ -0,0 +1,49 @@
1
+ import React from 'react'
2
+ import { Detail } from '../..'
3
+
4
+ const DetailBold = (props) => (
5
+ <div>
6
+ <Detail
7
+ bold
8
+ text="I am a bold detail kit"
9
+ {...props}
10
+ />
11
+
12
+ <Detail
13
+ bold
14
+ color="default"
15
+ text="I am a bold detail kit"
16
+ {...props}
17
+ />
18
+
19
+ <Detail
20
+ bold
21
+ color="lighter"
22
+ text="I am a bold detail kit"
23
+ {...props}
24
+ />
25
+
26
+ <Detail
27
+ bold
28
+ color="link"
29
+ text="I am a bold detail kit"
30
+ {...props}
31
+ />
32
+
33
+ <Detail
34
+ bold
35
+ color="error"
36
+ text="I am a bold detail kit"
37
+ {...props}
38
+ />
39
+
40
+ <Detail
41
+ bold
42
+ color="success"
43
+ text="I am a bold detail kit"
44
+ {...props}
45
+ />
46
+ </div>
47
+ )
48
+
49
+ export default DetailBold
@@ -0,0 +1 @@
1
+ Use the `bold` prop to strongly emphasis your text.
@@ -0,0 +1,24 @@
1
+ <%= pb_rails("detail", props: {
2
+ text: "I am a detail kit",
3
+ color: "default"
4
+ }) %>
5
+
6
+ <%= pb_rails("detail", props: {
7
+ text: "I am a detail kit",
8
+ color: "lighter"
9
+ }) %>
10
+
11
+ <%= pb_rails("detail", props: {
12
+ text: "I am a detail kit",
13
+ color: "link"
14
+ }) %>
15
+
16
+ <%= pb_rails("detail", props: {
17
+ text: "I am a detail kit",
18
+ color: "error"
19
+ }) %>
20
+
21
+ <%= pb_rails("detail", props: {
22
+ text: "I am a detail kit",
23
+ color: "success"
24
+ }) %>
@@ -0,0 +1,38 @@
1
+ import React from 'react'
2
+ import { Detail } from '../..'
3
+
4
+ const DetailColors = (props) => (
5
+ <div>
6
+ <Detail
7
+ color="default"
8
+ text="I am a detail kit"
9
+ {...props}
10
+ />
11
+
12
+ <Detail
13
+ color="lighter"
14
+ text="I am a detail kit"
15
+ {...props}
16
+ />
17
+
18
+ <Detail
19
+ color="link"
20
+ text="I am a detail kit"
21
+ {...props}
22
+ />
23
+
24
+ <Detail
25
+ color="error"
26
+ text="I am a detail kit"
27
+ {...props}
28
+ />
29
+
30
+ <Detail
31
+ color="success"
32
+ text="I am a detail kit"
33
+ {...props}
34
+ />
35
+ </div>
36
+ )
37
+
38
+ export default DetailColors
@@ -0,0 +1,6 @@
1
+ ##### Prop
2
+ This kit uses the `light` color by default, and can be replaced with colors below:
3
+
4
+ `default` `lighter` `link` `error` `success`
5
+
6
+ These colors are not for standard usage. You can use the `color` prop to make fixes if colors are not appearing properly, but consult your UX team members if you are deciding to implement it.
@@ -0,0 +1,3 @@
1
+ <%= pb_rails("detail", props: {
2
+ text: "I am a detail kit"
3
+ }) %>
@@ -0,0 +1,13 @@
1
+ import React from 'react'
2
+ import { Detail } from '../..'
3
+
4
+ const DetailDefault = (props) => (
5
+ <div>
6
+ <Detail
7
+ text="I am a detail kit"
8
+ {...props}
9
+ />
10
+ </div>
11
+ )
12
+
13
+ export default DetailDefault
@@ -0,0 +1,22 @@
1
+ <%= pb_rails("detail") do %>
2
+ <b>This text is using the <%="<b>"%> tag.</b>
3
+ <br />
4
+ <br />
5
+ <strong>This text is using the <%="<strong>"%> tag.</strong>
6
+ <br />
7
+ <br />
8
+ <a>This text is using the <%="<a>"%> tag.</a>
9
+ <br />
10
+ <br />
11
+ <i>This text is using the <%="<i>"%> tag.</i>
12
+ <br />
13
+ <br />
14
+ This <em>word</em> is using an <%="<em>"%> tag.
15
+ <br />
16
+ <br />
17
+ <small>This text is using the <%="<small>"%> tag.</small>
18
+ <br />
19
+ <br />
20
+ <u>This text is using the <%="<u>"%> tag.</u>
21
+ <br />
22
+ <% end %>
@@ -0,0 +1,32 @@
1
+ import React from 'react'
2
+ import { Detail } from '../..'
3
+
4
+ const DetailStyled = (props) => (
5
+ <>
6
+ <Detail {...props}>
7
+ <b>{"This text is using the <b> tag."}</b>
8
+ <br />
9
+ <br />
10
+ <strong>{"This text is using the <strong> tag."}</strong>
11
+ <br />
12
+ <br />
13
+ <a>{"This text is using the <a> tag."}</a>
14
+ <br />
15
+ <br />
16
+ <i>{"This text is using the <i> tag."}</i>
17
+ <br />
18
+ <br />
19
+ {"This "}<em>{"word"}</em>{" is using an <em> tag."}
20
+ <br />
21
+ <br />
22
+ <small>{"This text is using the <small> tag."}</small>
23
+ <br />
24
+ <br />
25
+ <u>{"This text is using the <u> tag."}</u>
26
+ <br />
27
+ <br />
28
+ </Detail>
29
+ </>
30
+ )
31
+
32
+ export default DetailStyled
@@ -0,0 +1,11 @@
1
+ examples:
2
+
3
+ rails:
4
+ - detail_default: Default
5
+ - detail_colors: Colors
6
+ - detail_bold: Bold
7
+
8
+ react:
9
+ - detail_default: Default
10
+ - detail_colors: Colors
11
+ - detail_bold: Bold
@@ -0,0 +1,4 @@
1
+ export { default as DetailDefault } from './_detail_default.jsx'
2
+ export { default as DetailColors } from './_detail_colors.jsx'
3
+ export { default as DetailStyled } from './_detail_styled.jsx'
4
+ export { default as DetailBold } from './_detail_bold.jsx'
@@ -2,4 +2,4 @@ The MultiLevelSelect kit renders a multi leveled select dropdown based on data f
2
2
 
3
3
  For the React version of the kit, the `onSelect` prop returns an array of all checked items, irrespective of whether it is a parent, child or grandchild. Open the console on this example and check and uncheck checkboxes to see this is action!
4
4
 
5
- For the Rails version, the array of checked items is attached to the DOM in a data attribute titled `data-tree` on the wrapping div around the MultiLevelSelect.
5
+ For the Rails version, the array of checked items is attached to the DOM in a data attribute titled `data-tree` on the wrapping div around the MultiLevelSelect.
@@ -3,6 +3,7 @@
3
3
  value: "Power Home Remodeling",
4
4
  id: "powerhome1",
5
5
  expanded: true,
6
+
6
7
  children: [
7
8
  {
8
9
  label: "People",
@@ -0,0 +1,14 @@
1
+ <form id="example-form-validation" action="" method="get">
2
+ <%= pb_rails("phone_number_input", props: { error: "Missing phone number.", id: "validation", initial_country: "af", value: "", required: true }) %>
3
+ <%= pb_rails("button", props: {html_type: "submit", text: "Save Phone Number"}) %>
4
+ </form>
5
+
6
+ <% content_for(:pb_js) do %>
7
+ <%= javascript_tag do %>
8
+ document.addEventListener('DOMContentLoaded', function () {
9
+ document.querySelector('#example-form-validation').addEventListener('submit', function (e) {
10
+ if (e.target.querySelectorAll('[error]:not([error=""])').length > 0) e.preventDefault();
11
+ })
12
+ })
13
+ <% end %>
14
+ <% end %>
@@ -0,0 +1,60 @@
1
+ import React, { useEffect, useState } from "react";
2
+ import { Button, FixedConfirmationToast, PhoneNumberInput } from "../../";
3
+
4
+ const PhoneNumberInputValidation = (props) => {
5
+ const [formErrors, setFormErrors] = useState("");
6
+ const [showFormErrors, setShowFormErrors] = useState(false);
7
+ const [phoneNumber, setPhoneNumber] = useState("");
8
+ const [countryCode, setCountryCode] = useState("af");
9
+
10
+ const handleOnValidate = (valid) => {
11
+ setFormErrors(
12
+ valid ? "" : "Please correct the fields below and try again."
13
+ );
14
+ };
15
+
16
+ const handleOnChange = ({ iso2, number }) => {
17
+ setCountryCode(iso2);
18
+ setPhoneNumber(number);
19
+ };
20
+
21
+ const handleOnSubmit = (e) => {
22
+ if (showFormErrors) e.preventDefault()
23
+ }
24
+
25
+ useEffect(() => {
26
+ setShowFormErrors(formErrors.length > 0);
27
+ }, [formErrors]);
28
+
29
+ return (
30
+ <form
31
+ action=""
32
+ method="get"
33
+ onSubmit={handleOnSubmit}
34
+ >
35
+ {showFormErrors && (
36
+ <FixedConfirmationToast
37
+ marginBottom="md"
38
+ status="error"
39
+ text={formErrors}
40
+ />
41
+ )}
42
+ <PhoneNumberInput
43
+ error="Missing phone number."
44
+ id="validation"
45
+ initialCountry={countryCode}
46
+ onChange={handleOnChange}
47
+ onValidate={handleOnValidate}
48
+ required
49
+ value={phoneNumber}
50
+ {...props}
51
+ />
52
+ <Button
53
+ htmlType="submit"
54
+ text="Save Phone Number"
55
+ />
56
+ </form>
57
+ );
58
+ };
59
+
60
+ export default PhoneNumberInputValidation;
@@ -5,9 +5,11 @@ examples:
5
5
  - phone_number_input_preferred_countries: Preferred Countries
6
6
  - phone_number_input_initial_country: Initial Country
7
7
  - phone_number_input_only_countries: Limited Countries
8
+ - phone_number_input_validation: Form Validation
8
9
 
9
10
  rails:
10
11
  - phone_number_input_default: Default
11
12
  - phone_number_input_preferred_countries: Preferred Countries
12
13
  - phone_number_input_initial_country: Initial Country
13
- - phone_number_input_only_countries: Limited Countries
14
+ - phone_number_input_only_countries: Limited Countries
15
+ - phone_number_input_validation: Form Validation
@@ -2,3 +2,4 @@ export { default as PhoneNumberInputDefault } from './_phone_number_input_defaul
2
2
  export { default as PhoneNumberInputPreferredCountries } from './_phone_number_input_preferred_countries'
3
3
  export { default as PhoneNumberInputInitialCountry } from './_phone_number_input_initial_country'
4
4
  export { default as PhoneNumberInputOnlyCountries } from './_phone_number_input_only_countries'
5
+ export { default as PhoneNumberInputValidation } from './_phone_number_input_validation'
@@ -1,3 +1,2 @@
1
1
  <%= pb_rails("title", props: { text: "Title 1", tag: "h1", size: 1, bold: false }) %>
2
2
  <%= pb_rails("title", props: { text: "Title 2", tag: "h2", size: 2, bold: false }) %>
3
- <%= pb_rails("title", props: { text: "Title 3", tag: "h3", size: 3, bold: false }) %>
@@ -17,12 +17,6 @@ const TitleLightWeight = (props) => {
17
17
  text='Title 2'
18
18
  {...props}
19
19
  />
20
- <Title bold={false}
21
- size={3}
22
- tag='h2'
23
- text='Title 3'
24
- {...props}
25
- />
26
20
  </div>
27
21
  )
28
22
  }
@@ -1,3 +1,4 @@
1
1
  ##### Prop
2
- Title `size 1`, `size 2`, & `size 3` will use `font-weight: 700` by default, if you want a lighter font weight, use the `bold` prop set to `false`.
2
+ Title `size 1` & `size 2` will use `font-weight: 700` by default, if you want a lighter font weight, use the `bold` prop set to `false`.
3
+ Title `size 3` uses a light font weight by default and will not accept a bold font weight.
3
4
  Title `size 4` uses a heavy font weight by default and will not accept a lighter font weight.
@@ -7,7 +7,7 @@
7
7
  <%= pb_rails("nav/item", props: { text: "Global Props", link: "#", active: true, dark: dark }) %>
8
8
  <% end %>
9
9
  <% end %>
10
- <%= pb_rails("section_separator", dark: dark) %>
10
+ <%= pb_rails("section_separator", props:{ dark: dark }) %>
11
11
  <%= pb_rails("card/card_body", props: {}) do %>
12
12
  <%= pb_rails("table", props: {container: false, disable_hover: true, dark: dark }) do %>
13
13
  <thead>
@@ -1,15 +1,21 @@
1
1
  <% example_html = ERB.new(example).result %>
2
2
 
3
3
  <%= pb_rails("card", props: { classname: "pb--doc", padding: "none", dark: dark }) do %>
4
- <div class="pb--kit-example">
5
- <%= pb_rails("caption", props: { text: example_title, dark: dark }) %>
6
- <br />
7
- <%= example %>
8
- <br>
9
- </div>
10
-
4
+ <% unless (action_name == "kit_show_swift") %>
5
+ <div class="pb--kit-example">
6
+ <%= pb_rails("caption", props: { text: example_title, dark: dark }) %>
7
+ <br />
8
+ <%= example %>
9
+ <br>
10
+ </div>
11
+ <% else %>
12
+ <div class="pb--kit-example-markdown pt_none markdown <%= dark ? "dark" : "" %>">
13
+ <%= pb_rails("caption", props: { text: example_title, dark: dark, margin_top: "md" }) %>
14
+ <%= render_markdown(description) %>
15
+ </div>
16
+ <% end %>
11
17
  <% if show_code %>
12
- <div class="markdown pb--kit-example-markdown <%= dark ? "dark" : "" %>">
18
+ <div class="markdown pb--kit-example-markdown markdown <%= dark ? "dark" : "" %>">
13
19
  <%= render_markdown(description) %>
14
20
  </div>
15
21
  <div id="code-wrapper">
@@ -8,7 +8,7 @@ module Playbook
8
8
  prop :example_title, type: Playbook::Props::String, required: true
9
9
  prop :example_key, type: Playbook::Props::String, required: true
10
10
  prop :show_code, type: Playbook::Props::Boolean, default: true
11
- prop :type, type: Playbook::Props::Enum, values: %w[rails react], default: "rails"
11
+ prop :type, type: Playbook::Props::Enum, values: %w[rails react swift], default: "rails"
12
12
  prop :dark, type: Playbook::Props::Boolean, default: false
13
13
 
14
14
  include PlaybookWebsite::Markdown::Helper
@@ -18,6 +18,9 @@ module Playbook
18
18
  render inline: source
19
19
  elsif type == "react"
20
20
  react_component example_key.camelize, { dark: dark }
21
+ elsif type == "swift"
22
+ ## render the markdown file
23
+ render inline: source
21
24
  end
22
25
  end
23
26
 
@@ -31,7 +34,11 @@ module Playbook
31
34
 
32
35
  def source
33
36
  @source ||= begin
34
- extension = type == "react" ? "jsx" : "html.erb"
37
+ extension = if type == "rails"
38
+ "html.erb"
39
+ else
40
+ type == "swift" ? "swift" : "jsx"
41
+ end
35
42
  stringified_code = read_kit_file("docs", "_#{example_key}.#{extension}")
36
43
  sanitize_code(stringified_code)
37
44
  end
data/dist/menu.yml CHANGED
@@ -90,6 +90,7 @@ kits:
90
90
  - typography:
91
91
  - body
92
92
  - caption
93
+ - detail
93
94
  - title
94
95
  - typography_patterns:
95
96
  - contact
@@ -84,8 +84,11 @@ module PlaybookWebsite
84
84
  def pb_doc_render_clickable_title(kit, type)
85
85
  url = "#"
86
86
  begin
87
- url = if type == "react"
87
+ url = case type
88
+ when "react"
88
89
  kit_show_reacts_path(kit)
90
+ when "swift"
91
+ kit_show_swift_path(kit)
89
92
  else
90
93
  kit_show_path(kit)
91
94
  end