coveragebook_components 0.19.12 → 0.19.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/build/coco/coco.js +2 -2
  3. data/lib/coco.rb +1 -1
  4. data/lookbook/app/helpers/application_helper.rb +28 -0
  5. data/lookbook/app/previews/buttons/button_group_preview.rb +148 -0
  6. data/lookbook/app/previews/buttons/button_preview.rb +729 -0
  7. data/lookbook/app/previews/buttons/button_to_preview.rb +18 -0
  8. data/lookbook/app/previews/buttons/color_picker_button_preview.rb +42 -0
  9. data/lookbook/app/previews/buttons/image_picker_button_preview.rb +46 -0
  10. data/lookbook/app/previews/buttons/layout_picker_button_preview/default.html.erb +12 -0
  11. data/lookbook/app/previews/buttons/layout_picker_button_preview.rb +6 -0
  12. data/lookbook/app/previews/buttons/option_bar_preview.rb +29 -0
  13. data/lookbook/app/previews/buttons/toolbar_preview.rb +115 -0
  14. data/lookbook/app/previews/embeds/youtube_embed_preview.rb +7 -0
  15. data/lookbook/app/previews/forms/fields_preview/button.html.erb +3 -0
  16. data/lookbook/app/previews/forms/fields_preview/check_box.html.erb +3 -0
  17. data/lookbook/app/previews/forms/fields_preview/color_field.html.erb +3 -0
  18. data/lookbook/app/previews/forms/fields_preview/date_field.html.erb +3 -0
  19. data/lookbook/app/previews/forms/fields_preview/date_select.html.erb +3 -0
  20. data/lookbook/app/previews/forms/fields_preview/datetime_local_field.html.erb +3 -0
  21. data/lookbook/app/previews/forms/fields_preview/datetime_select.html.erb +3 -0
  22. data/lookbook/app/previews/forms/fields_preview/email_field.html.erb +3 -0
  23. data/lookbook/app/previews/forms/fields_preview/error_message.html.erb +3 -0
  24. data/lookbook/app/previews/forms/fields_preview/file_field.html.erb +3 -0
  25. data/lookbook/app/previews/forms/fields_preview/hint.html.erb +3 -0
  26. data/lookbook/app/previews/forms/fields_preview/label.html.erb +3 -0
  27. data/lookbook/app/previews/forms/fields_preview/month_field.html.erb +3 -0
  28. data/lookbook/app/previews/forms/fields_preview/number_field.html.erb +3 -0
  29. data/lookbook/app/previews/forms/fields_preview/password_field.html.erb +3 -0
  30. data/lookbook/app/previews/forms/fields_preview/radio_button.html.erb +3 -0
  31. data/lookbook/app/previews/forms/fields_preview/range_field.html.erb +3 -0
  32. data/lookbook/app/previews/forms/fields_preview/search_field.html.erb +3 -0
  33. data/lookbook/app/previews/forms/fields_preview/select.html.erb +3 -0
  34. data/lookbook/app/previews/forms/fields_preview/submit.html.erb +3 -0
  35. data/lookbook/app/previews/forms/fields_preview/telephone_field.html.erb +3 -0
  36. data/lookbook/app/previews/forms/fields_preview/text_area.html.erb +3 -0
  37. data/lookbook/app/previews/forms/fields_preview/text_field.html.erb +3 -0
  38. data/lookbook/app/previews/forms/fields_preview/time_field.html.erb +3 -0
  39. data/lookbook/app/previews/forms/fields_preview/time_select.html.erb +3 -0
  40. data/lookbook/app/previews/forms/fields_preview/time_zone_select.html.erb +3 -0
  41. data/lookbook/app/previews/forms/fields_preview/url_field.html.erb +3 -0
  42. data/lookbook/app/previews/forms/fields_preview/week_field.html.erb +3 -0
  43. data/lookbook/app/previews/forms/fields_preview/weekday_select.html.erb +3 -0
  44. data/lookbook/app/previews/forms/fields_preview.rb +111 -0
  45. data/lookbook/app/previews/images/avatar_preview.rb +24 -0
  46. data/lookbook/app/previews/images/icon_preview.rb +141 -0
  47. data/lookbook/app/previews/images/image_preview.rb +15 -0
  48. data/lookbook/app/previews/images/svg_preview.rb +8 -0
  49. data/lookbook/app/previews/indicators/badge_preview.rb +68 -0
  50. data/lookbook/app/previews/indicators/stamp_preview.rb +108 -0
  51. data/lookbook/app/previews/layout/page_layout_preview/block_content.html.erb +13 -0
  52. data/lookbook/app/previews/layout/page_layout_preview/default.html.erb +19 -0
  53. data/lookbook/app/previews/layout/page_layout_preview/full_width.html.erb +12 -0
  54. data/lookbook/app/previews/layout/page_layout_preview/hidden_content.html.erb +18 -0
  55. data/lookbook/app/previews/layout/page_layout_preview/mixed.html.erb +15 -0
  56. data/lookbook/app/previews/layout/page_layout_preview/pagination.html.erb +12 -0
  57. data/lookbook/app/previews/layout/page_layout_preview/polling.html.erb +12 -0
  58. data/lookbook/app/previews/layout/page_layout_preview/sections.html.erb +13 -0
  59. data/lookbook/app/previews/layout/page_layout_preview/spacing.html.erb +33 -0
  60. data/lookbook/app/previews/layout/page_layout_preview.rb +38 -0
  61. data/lookbook/app/previews/layout/panel_preview/basic.html.erb +5 -0
  62. data/lookbook/app/previews/layout/panel_preview.rb +6 -0
  63. data/lookbook/app/previews/layout/spacer_preview/default.html.erb +5 -0
  64. data/lookbook/app/previews/layout/spacer_preview/responsive.html.erb +12 -0
  65. data/lookbook/app/previews/layout/spacer_preview/sizes.html.erb +7 -0
  66. data/lookbook/app/previews/layout/spacer_preview.rb +19 -0
  67. data/lookbook/app/previews/layout/stack_preview/default.html.erb +13 -0
  68. data/lookbook/app/previews/layout/stack_preview/item_properties.html.erb +13 -0
  69. data/lookbook/app/previews/layout/stack_preview/item_spacing.html.erb +23 -0
  70. data/lookbook/app/previews/layout/stack_preview/nested.html.erb +19 -0
  71. data/lookbook/app/previews/layout/stack_preview/stack_spacing.html.erb +13 -0
  72. data/lookbook/app/previews/layout/stack_preview.rb +21 -0
  73. data/lookbook/app/previews/messaging/notice_preview.rb +196 -0
  74. data/lookbook/app/previews/messaging/popover_preview/placement.html.erb +7 -0
  75. data/lookbook/app/previews/messaging/popover_preview/targets.html.erb +17 -0
  76. data/lookbook/app/previews/messaging/popover_preview/themes.html.erb +19 -0
  77. data/lookbook/app/previews/messaging/popover_preview/triggers.html.erb +19 -0
  78. data/lookbook/app/previews/messaging/popover_preview.rb +15 -0
  79. data/lookbook/app/previews/messaging/snackbar_preview/manual_show.html.erb +5 -0
  80. data/lookbook/app/previews/messaging/snackbar_preview/queue.html.erb +20 -0
  81. data/lookbook/app/previews/messaging/snackbar_preview/system_test_manual_show.html.erb +5 -0
  82. data/lookbook/app/previews/messaging/snackbar_preview.rb +128 -0
  83. data/lookbook/app/previews/messaging/system_banner_preview.rb +85 -0
  84. data/lookbook/app/previews/messaging/toast_preview.rb +132 -0
  85. data/lookbook/app/previews/messaging/tooltip_preview.rb +11 -0
  86. data/lookbook/app/previews/modals/modal_canvas_preview/basic.html.erb +6 -0
  87. data/lookbook/app/previews/modals/modal_canvas_preview.rb +7 -0
  88. data/lookbook/app/previews/modals/modal_dialog_preview/basic.html.erb +4 -0
  89. data/lookbook/app/previews/modals/modal_dialog_preview/in_page.html.erb +3 -0
  90. data/lookbook/app/previews/modals/modal_dialog_preview/large.html.erb +4 -0
  91. data/lookbook/app/previews/modals/modal_dialog_preview/medium.html.erb +4 -0
  92. data/lookbook/app/previews/modals/modal_dialog_preview/named.html.erb +5 -0
  93. data/lookbook/app/previews/modals/modal_dialog_preview/navigate.html.erb +3 -0
  94. data/lookbook/app/previews/modals/modal_dialog_preview/not_dismissable.html.erb +3 -0
  95. data/lookbook/app/previews/modals/modal_dialog_preview/not_shown.html.erb +5 -0
  96. data/lookbook/app/previews/modals/modal_dialog_preview/notice.html.erb +8 -0
  97. data/lookbook/app/previews/modals/modal_dialog_preview/small.html.erb +4 -0
  98. data/lookbook/app/previews/modals/modal_dialog_preview/triggers.html.erb +9 -0
  99. data/lookbook/app/previews/modals/modal_dialog_preview.rb +45 -0
  100. data/lookbook/app/previews/modals/modal_lightbox_preview/basic.html.erb +5 -0
  101. data/lookbook/app/previews/modals/modal_lightbox_preview/named.html.erb +6 -0
  102. data/lookbook/app/previews/modals/modal_lightbox_preview/scroll.html.erb +6 -0
  103. data/lookbook/app/previews/modals/modal_lightbox_preview/triggers.html.erb +8 -0
  104. data/lookbook/app/previews/modals/modal_lightbox_preview.rb +20 -0
  105. data/lookbook/app/previews/modals/modal_preview/basic.html.erb +6 -0
  106. data/lookbook/app/previews/modals/modal_preview.rb +8 -0
  107. data/lookbook/app/previews/navigation/link_preview.rb +74 -0
  108. data/lookbook/app/previews/navigation/link_to_preview.rb +88 -0
  109. data/lookbook/app/previews/navigation/pager_button_preview.rb +12 -0
  110. data/lookbook/app/previews/navigation/tabs_preview/basic.html.erb +5 -0
  111. data/lookbook/app/previews/navigation/tabs_preview/full.html.erb +5 -0
  112. data/lookbook/app/previews/navigation/tabs_preview/icons.html.erb +5 -0
  113. data/lookbook/app/previews/navigation/tabs_preview.rb +15 -0
  114. data/lookbook/app/previews/pickers/color_picker_preview.rb +27 -0
  115. data/lookbook/app/previews/pickers/image_picker_preview.rb +24 -0
  116. data/lookbook/app/previews/typography/utils_preview/branded_headings.html.erb +24 -0
  117. data/lookbook/app/previews/typography/utils_preview/fixed_size_headings.html.erb +7 -0
  118. data/lookbook/app/previews/typography/utils_preview/headings.html.erb +35 -0
  119. data/lookbook/app/previews/typography/utils_preview.rb +16 -0
  120. data/lookbook/app/previews/utilities/dropdown_preview.rb +19 -0
  121. data/lookbook/app/previews/utilities/seamless_textarea_preview/focus.html.erb +9 -0
  122. data/lookbook/app/previews/utilities/seamless_textarea_preview/multi_line.html.erb +9 -0
  123. data/lookbook/app/previews/utilities/seamless_textarea_preview/single_line.html.erb +8 -0
  124. data/lookbook/app/previews/utilities/seamless_textarea_preview.rb +29 -0
  125. data/lookbook/app/views/layouts/application.html.erb +24 -0
  126. data/lookbook/app/views/layouts/blank.html.erb +12 -0
  127. data/lookbook/app/views/lookbook/previews/group.html.erb +37 -0
  128. data/lookbook/app/views/pages/plans.html.erb +21 -0
  129. data/lookbook/app/views/panels/_design.html.erb +85 -0
  130. data/lookbook/app/views/request/success.html.erb +1 -0
  131. data/lookbook/app/views/turbo_request/done.html.erb +3 -0
  132. data/lookbook/app/views/turbo_request/success.html.erb +1 -0
  133. metadata +130 -1
@@ -0,0 +1,141 @@
1
+ module Images
2
+ class IconPreview < Coco::Preview
3
+ # @!group Styles
4
+
5
+ def line
6
+ coco_icon(:star)
7
+ end
8
+
9
+ def fill
10
+ coco_icon(:star, style: :fill)
11
+ end
12
+
13
+ def colored
14
+ coco_icon(:star, class: "!text-red-500")
15
+ end
16
+
17
+ def colored_fill
18
+ coco_icon(:star, style: :fill, class: "!text-red-500")
19
+ end
20
+
21
+ # @!group Sizes
22
+
23
+ def extra_small
24
+ coco_icon(:smile, size: :xs)
25
+ end
26
+
27
+ def small
28
+ coco_icon(:smile, size: :sm)
29
+ end
30
+
31
+ # @label Medium (default)
32
+ def medium
33
+ coco_icon(:smile, size: :md)
34
+ end
35
+
36
+ def large
37
+ coco_icon(:smile, size: :lg)
38
+ end
39
+
40
+ def extra_large
41
+ coco_icon(:smile, size: :xl)
42
+ end
43
+
44
+ def extra_extra_large
45
+ coco_icon(:smile, size: :xxl)
46
+ end
47
+
48
+ def custom_size
49
+ coco_icon(:smile, html: {style: "width: 100px; height: 100px"})
50
+ end
51
+
52
+ # @!group Custom
53
+
54
+ def microsoft_sso
55
+ coco_icon(:microsoft_sso)
56
+ end
57
+
58
+ # @label X (Twitter)
59
+ def x
60
+ coco_icon(:x_logo)
61
+ end
62
+
63
+ def spotify
64
+ coco_icon(:spotify)
65
+ end
66
+
67
+ # @!group With interactions
68
+
69
+ # @label Click to toggle spin
70
+ def toggle_spin
71
+ coco_icon(:loader, x: {"on:click": "spin = !spin"})
72
+ end
73
+
74
+ # @label Click to toggle fill
75
+ def toggle_fill
76
+ coco_icon(:heart, x: {"on:click": "fill = !fill"})
77
+ end
78
+
79
+ # @hidden
80
+ def aliased_icon
81
+ coco_icon(:edit_3)
82
+ end
83
+
84
+ # @!endgroup
85
+
86
+ # Icon playground
87
+ # ---------------
88
+ #
89
+ # Use the param controls to experiment with the available options.
90
+ #
91
+ # @display centered true
92
+ #
93
+ # @param icon select :icon_names
94
+ # @param size select :icon_sizes
95
+ # @param color select :icon_colors
96
+ # @param fill
97
+ # @param spin
98
+ def playground(icon: :star, fill: false, size: :md, spin: false, color: "text-red-500")
99
+ coco_icon(icon,
100
+ style: fill ? :fill : :line,
101
+ size: size,
102
+ spin: spin,
103
+ class: "!" + color)
104
+ end
105
+
106
+ # @param icon select :icon_names
107
+ # @param size select :icon_sizes
108
+ # @param color select :icon_colors
109
+ # @param fill
110
+ # @param spin
111
+ # @hidden
112
+ def system_test(icon: :star, fill: false, size: :md, spin: false, color: "text-red-500")
113
+ coco_icon(icon,
114
+ style: fill ? :fill : :line,
115
+ size: size,
116
+ spin: spin,
117
+ class: "!" + color)
118
+ end
119
+
120
+ # @hidden
121
+ def system_test_toggle_spin
122
+ coco_icon(:loader, x: {"on:click": "spin = !spin"})
123
+ end
124
+
125
+ # @label Click to toggle fill
126
+ # @hidden
127
+ def system_test_toggle_fill
128
+ coco_icon(:heart, x: {"on:click": "fill = !fill"})
129
+ end
130
+
131
+ private
132
+
133
+ def icon_sizes
134
+ %w[sm md lg xl xxl]
135
+ end
136
+
137
+ def icon_colors
138
+ %w[text-red-500 text-teal-500 text-amber-500]
139
+ end
140
+ end
141
+ end
@@ -0,0 +1,15 @@
1
+ module Images
2
+ class ImagePreview < Coco::Preview
3
+ def default
4
+ coco_image("http://placekitten.com/500/500")
5
+ end
6
+
7
+ def with_alt_text
8
+ coco_image("http://placekitten.com/500/500", alt: "A cute kitten")
9
+ end
10
+
11
+ def lazy_loading
12
+ coco_image("http://placekitten.com/500/500", lazy: true)
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,8 @@
1
+ module Images
2
+ # @hidden
3
+ class SvgPreview < Coco::Preview
4
+ def default
5
+ coco_svg("test/cb-logo")
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,68 @@
1
+ module Indicators
2
+ class BadgePreview < Coco::Preview
3
+ # @group Basic
4
+
5
+ def default
6
+ coco_badge("Recommended")
7
+ end
8
+
9
+ def with_icon
10
+ coco_badge("Recommended", icon: :check)
11
+ end
12
+
13
+ # @group Themes
14
+
15
+ # @label Dark (default)
16
+ def dark
17
+ coco_badge("Dark", theme: :neutral_dark, icon: :check)
18
+ end
19
+
20
+ def light
21
+ coco_badge("Light", theme: :neutral_light, icon: :check)
22
+ end
23
+
24
+ def muted
25
+ coco_badge("Muted", theme: :neutral_muted, icon: :check)
26
+ end
27
+
28
+ def primary
29
+ coco_badge("Primary", theme: :primary, icon: :check)
30
+ end
31
+
32
+ def positive
33
+ coco_badge("Positive", theme: :positive, icon: :check)
34
+ end
35
+
36
+ def negative
37
+ coco_badge("Negative", theme: :negative, icon: :check)
38
+ end
39
+
40
+ def warning
41
+ coco_badge("Warning", theme: :warning, icon: :check)
42
+ end
43
+
44
+ def info
45
+ coco_badge("Info", theme: :info, icon: :check)
46
+ end
47
+
48
+ def primary_light
49
+ coco_badge("Primary", theme: :primary_light, icon: :check)
50
+ end
51
+
52
+ def positive_light
53
+ coco_badge("Positive", theme: :positive_light, icon: :check)
54
+ end
55
+
56
+ def negative_light
57
+ coco_badge("Negative", theme: :negative_light, icon: :check)
58
+ end
59
+
60
+ def warning_light
61
+ coco_badge("Warning", theme: :warning_light, icon: :check)
62
+ end
63
+
64
+ def info_light
65
+ coco_badge("Info", theme: :info_light, icon: :check)
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,108 @@
1
+ module Indicators
2
+ class StampPreview < Coco::Preview
3
+ # @!group Subtle
4
+
5
+ def success
6
+ coco_stamp(:success)
7
+ end
8
+
9
+ def error
10
+ coco_stamp(:error)
11
+ end
12
+
13
+ def warning
14
+ coco_stamp(:warning)
15
+ end
16
+
17
+ def info
18
+ coco_stamp(:info)
19
+ end
20
+
21
+ # @!group Vivid
22
+
23
+ def success_vivid
24
+ coco_stamp(:success, style: :vivid)
25
+ end
26
+
27
+ def error_vivid
28
+ coco_stamp(:error, style: :vivid)
29
+ end
30
+
31
+ def warning_vivid
32
+ coco_stamp(:warning, style: :vivid)
33
+ end
34
+
35
+ def info_vivid
36
+ coco_stamp(:info, style: :vivid)
37
+ end
38
+
39
+ # @!group Inverse
40
+
41
+ def success_inverse
42
+ coco_stamp(:success, style: :inverse)
43
+ end
44
+
45
+ def error_inverse
46
+ coco_stamp(:error, style: :inverse)
47
+ end
48
+
49
+ def warning_inverse
50
+ coco_stamp(:warning, style: :inverse)
51
+ end
52
+
53
+ def info_inverse
54
+ coco_stamp(:info, style: :inverse)
55
+ end
56
+
57
+ # @!group Compact
58
+
59
+ def success_compact
60
+ coco_stamp(:success, style: :compact)
61
+ end
62
+
63
+ def error_compact
64
+ coco_stamp(:error, style: :compact)
65
+ end
66
+
67
+ def warning_compact
68
+ coco_stamp(:warning, style: :compact)
69
+ end
70
+
71
+ def info_compact
72
+ coco_stamp(:info, style: :compact)
73
+ end
74
+
75
+ # @!group Sizes
76
+
77
+ def success_xs
78
+ coco_stamp(:success, size: :xs)
79
+ end
80
+
81
+ def success_sm
82
+ coco_stamp(:success, size: :sm)
83
+ end
84
+
85
+ def success_md
86
+ coco_stamp(:success, size: :md)
87
+ end
88
+
89
+ def success_lg
90
+ coco_stamp(:success, size: :lg)
91
+ end
92
+
93
+ # @!group Custom
94
+
95
+ def custom_positive
96
+ coco_stamp(icon: :smile, style: :vivid, theme: :positive)
97
+ end
98
+
99
+ def custom_negative
100
+ coco_stamp(icon: :frown, style: :inverse, theme: :negative)
101
+ end
102
+
103
+ # @param theme [Symbol] select {choices: [positive, negative, warning, info]}
104
+ # def playground(icon: theme: :positive, style: :subtle)
105
+ # coco_stamp(theme:, style:)
106
+ # end
107
+ end
108
+ end
@@ -0,0 +1,13 @@
1
+ <%= coco_page(:page_id_here) do |page| %>
2
+ <% page.with_header do %>
3
+ <%= coco_placeholder do %>
4
+ <strong>Header</strong>
5
+ <% end %>
6
+ <% end %>
7
+
8
+ <%= coco_placeholder(id: "block-content", prose: true) do %>
9
+ <p><em>Legacy-style</em> pages just have a single content block, rather than making use of page sections.</p>
10
+ <p>New pages should use individual `section` slots to assemble components to ensure elements on the page are all spaced correctly.</p>
11
+ <p>See the 'Page Construction' documentation for more details.</p>
12
+ <% end %>
13
+ <% end %>
@@ -0,0 +1,19 @@
1
+ <%= coco_page(:page_id_here) do |page| %>
2
+ <% page.with_header do %>
3
+ <%= coco_placeholder do %>
4
+ <strong>Header</strong>
5
+ <% end %>
6
+ <% end %>
7
+
8
+ <% page.with_section do %>
9
+ <%= coco_placeholder(prose: true) do %>
10
+ <%= placeholder_prose_html(paragraphs: 2) %>
11
+ <% end %>
12
+ <% end %>
13
+
14
+ <% page.with_section do %>
15
+ <%= coco_placeholder(prose: true) do %>
16
+ <%= placeholder_prose_html(paragraphs: 3) %>
17
+ <% end %>
18
+ <% end %>
19
+ <% end %>
@@ -0,0 +1,12 @@
1
+ <%= coco_page(:page_id_here, width: :full) do |page| %>
2
+ <% page.with_header do %>
3
+ <%= coco_placeholder do %>
4
+ <strong>Header</strong>
5
+ <% end %>
6
+ <% end %>
7
+
8
+ <%= coco_placeholder(prose: true) do %>
9
+ <p><strong>Content here</strong></p>
10
+ <%= placeholder_prose_html(paragraphs: 20) %>
11
+ <% end %>
12
+ <% end %>
@@ -0,0 +1,18 @@
1
+ <%= coco_page(:page_id_here) do |page| %>
2
+ <% page.with_header do %>
3
+ <%= coco_placeholder do %>
4
+ <strong>Header</strong>
5
+ <% end %>
6
+ <% end %>
7
+
8
+ <% page.with_hidden_section do %>
9
+ <div>
10
+ Any content that should not be visible to the user (modal content etc)
11
+ should be added in the `hidden_section` slot like this.
12
+ </div>
13
+ <% end %>
14
+
15
+ <%= coco_placeholder do %>
16
+ <div><p>See source tab for hidden content explaination</p></div>
17
+ <% end %>
18
+ <% end %>
@@ -0,0 +1,15 @@
1
+ <%= coco_page(:page_id_here) do |page| %>
2
+ <% page.with_section(id: "section-1") do %>
3
+ <%= coco_placeholder("Section one") %>
4
+ <% end %>
5
+
6
+ <% page.with_section(id: "section-2") do %>
7
+ <%= coco_placeholder("Section two") %>
8
+ <% end %>
9
+
10
+ <% page.with_section(id: "section-3") do %>
11
+ <%= coco_placeholder("Section three") %>
12
+ <% end %>
13
+
14
+ <%= coco_placeholder("Block content") %>
15
+ <% end %>
@@ -0,0 +1,12 @@
1
+ <%= coco_page(:page_id_here, previous: "/path/to/previous/page", next: "/path/to/next/page") do |page| %>
2
+ <% page.with_header do %>
3
+ <%= coco_placeholder do %>
4
+ <strong>Header</strong>
5
+ <% end %>
6
+ <% end %>
7
+
8
+ <%= coco_placeholder(prose: true) do %>
9
+ <p><strong>Content here</strong></p>
10
+ <%= placeholder_prose_html(paragraphs: 20) %>
11
+ <% end %>
12
+ <% end %>
@@ -0,0 +1,12 @@
1
+ <%= coco_page(:page_id_here, poll: 4000) do |page| %>
2
+ <% page.with_header do %>
3
+ <%= coco_placeholder do %>
4
+ <strong>Header</strong>
5
+ <% end %>
6
+ <% end %>
7
+
8
+ <%= coco_placeholder(prose: true) do %>
9
+ <p><strong>Content here</strong></p>
10
+ <%= placeholder_prose_html(paragraphs: 20) %>
11
+ <% end %>
12
+ <% end %>
@@ -0,0 +1,13 @@
1
+ <%= coco_page(:page_id_here) do |page| %>
2
+ <% page.with_section(id: "section-1") do %>
3
+ <%= coco_placeholder("Section one") %>
4
+ <% end %>
5
+
6
+ <% page.with_section(id: "section-2") do %>
7
+ <%= coco_placeholder("Section two") %>
8
+ <% end %>
9
+
10
+ <% page.with_section(id: "section-3") do %>
11
+ <%= coco_placeholder("Section three") %>
12
+ <% end %>
13
+ <% end %>
@@ -0,0 +1,33 @@
1
+ <%= coco_page(:page_id_here) do |page| %>
2
+ <% page.with_space 8 %>
3
+
4
+ <% page.with_section(id: "section-1") do %>
5
+ <%= coco_placeholder("Section one") %>
6
+ <% end %>
7
+
8
+ <% page.with_space 0 %>
9
+
10
+ <% page.with_section(id: "section-2") do %>
11
+ <%= coco_placeholder("Section two") %>
12
+ <% end %>
13
+
14
+ <% page.with_space 2 %>
15
+
16
+ <% page.with_section(id: "section-3") do %>
17
+ <%= coco_placeholder("Section three") %>
18
+ <% end %>
19
+
20
+ <% page.with_space 4 %>
21
+
22
+ <% page.with_section(id: "section-4") do %>
23
+ <%= coco_placeholder("Section four") %>
24
+ <% end %>
25
+
26
+ <% page.with_space 6 %>
27
+
28
+ <% page.with_section(id: "section-5") do %>
29
+ <%= coco_placeholder("Section five") %>
30
+ <% end %>
31
+
32
+ <% page.with_space 8 %>
33
+ <% end %>
@@ -0,0 +1,38 @@
1
+ module Layout
2
+ # @label Page
3
+ # @display max_width 100%
4
+ # @display padding 0
5
+ class PageLayoutPreview < Coco::Preview
6
+ def default
7
+ end
8
+
9
+ def full_width
10
+ end
11
+
12
+ # @label Sections content
13
+ def sections
14
+ end
15
+
16
+ # @label Block content
17
+ def block_content
18
+ end
19
+
20
+ # @label Mixed content
21
+ def mixed
22
+ end
23
+
24
+ # @label Section spacing
25
+ def spacing
26
+ end
27
+
28
+ # @label With prev/next
29
+ def pagination
30
+ end
31
+
32
+ def polling
33
+ end
34
+
35
+ def hidden_content
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,5 @@
1
+ <%= coco_panel do %>
2
+ <div>
3
+ The panel content
4
+ </div>
5
+ <% end %>
@@ -0,0 +1,6 @@
1
+ module Layout
2
+ class PanelPreview < Coco::Preview
3
+ def basic
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ <div class="spacer-preview">
2
+
3
+ <%= coco_spacer %>
4
+
5
+ </div>
@@ -0,0 +1,12 @@
1
+ <div class="spacer-preview">
2
+
3
+ <%= coco_spacer(4) %>
4
+
5
+ <%= coco_spacer(4, scale_from: :sm) %>
6
+
7
+ <%= coco_spacer(4, scale_from: :md) %>
8
+
9
+ <%= coco_spacer(4, scale_from: :lg) %>
10
+
11
+ <%= coco_spacer(4, responsive: false) %>
12
+ </div>
@@ -0,0 +1,7 @@
1
+ <div class="spacer-preview">
2
+
3
+ <% Coco::Spacer::SIZES.each do |size| %>
4
+ <%= coco_spacer(size) %>
5
+ <% end %>
6
+
7
+ </div>
@@ -0,0 +1,19 @@
1
+ module Layout
2
+ # @display max_width 100%
3
+ class SpacerPreview < Coco::Preview
4
+ def default
5
+ end
6
+
7
+ def sizes
8
+ end
9
+
10
+ # @label Responsive behaviours
11
+ def responsive
12
+ end
13
+
14
+ # @hidden
15
+ def fixed_size
16
+ coco_spacer(responsive: false)
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,13 @@
1
+ <%= coco_stack do |stack| %>
2
+ <% stack.with_item do %>
3
+ <%= coco_placeholder("item one") %>
4
+ <% end %>
5
+
6
+ <% stack.with_item do %>
7
+ <%= coco_placeholder("item two") %>
8
+ <% end %>
9
+
10
+ <% stack.with_item do %>
11
+ <%= coco_placeholder("item three") %>
12
+ <% end %>
13
+ <% end %>
@@ -0,0 +1,13 @@
1
+ <%= coco_stack do |stack| %>
2
+ <% stack.with_item(:header, id: "page-header") do %>
3
+ <%= coco_placeholder("a header") %>
4
+ <% end %>
5
+
6
+ <% stack.with_item(:section, class: "page-section") do %>
7
+ <%= coco_placeholder("a section") %>
8
+ <% end %>
9
+
10
+ <% stack.with_item(:p) do %>
11
+ <%= coco_placeholder("a paragraph") %>
12
+ <% end %>
13
+ <% end %>
@@ -0,0 +1,23 @@
1
+ <%= coco_stack do |stack| %>
2
+ <% stack.with_item do %>
3
+ <%= coco_placeholder("item one - space 8 below") %>
4
+ <% end %>
5
+
6
+ <% stack.with_space 8 %>
7
+
8
+ <% stack.with_item do %>
9
+ <%= coco_placeholder("item two - space 2 below") %>
10
+ <% end %>
11
+
12
+ <% stack.with_space 2 %>
13
+
14
+ <% stack.with_item do %>
15
+ <%= coco_placeholder("item three - no space below") %>
16
+ <% end %>
17
+
18
+ <% stack.with_space 0 %>
19
+
20
+ <% stack.with_item do %>
21
+ <%= coco_placeholder("item four") %>
22
+ <% end %>
23
+ <% end %>
@@ -0,0 +1,19 @@
1
+ <%= coco_stack(spacing: 6) do |stack| %>
2
+ <% stack.with_item do %>
3
+ <%= coco_placeholder("item one") %>
4
+ <% end %>
5
+
6
+ <% stack.with_substack(spacing: 2) do |stack| %>
7
+ <% stack.with_item do %>
8
+ <%= coco_placeholder("item two") %>
9
+ <% end %>
10
+
11
+ <% stack.with_item do %>
12
+ <%= coco_placeholder("item three") %>
13
+ <% end %>
14
+ <% end %>
15
+
16
+ <% stack.with_item do %>
17
+ <%= coco_placeholder("item four") %>
18
+ <% end %>
19
+ <% end %>