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,11 @@
1
+ module Messaging
2
+ class TooltipPreview < Coco::Preview
3
+ def default
4
+ coco_tooltip("Tooltip text here") do
5
+ tag.div do
6
+ "Hover to show tooltip"
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,6 @@
1
+ <%= coco_modal_canvas show: true do |modal| %>
2
+ <div style="width: 90vw; padding: 40px;">
3
+ <p>The modal content.</p>
4
+ <p>Close using the `esc` key.</p>
5
+ </div>
6
+ <% end %>
@@ -0,0 +1,7 @@
1
+ module Modals
2
+ # @label Canvas
3
+ class ModalCanvasPreview < Coco::Preview
4
+ def basic
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,4 @@
1
+ <%= coco_modal_dialog title: "This is the title", show: true do |modal| %>
2
+ <p>The modal content.</p>
3
+ <p>Close using the `esc` key.</p>
4
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <%= coco_modal_dialog title: "This is the title" do |modal| %>
2
+ <p>An example of how modal content is displayed when it is rendered in the host page.</p>
3
+ <% end %>
@@ -0,0 +1,4 @@
1
+ <%= coco_modal_dialog title: "This is the title", size: :lg, show: true do |modal| %>
2
+ <p>The modal content.</p>
3
+ <p>Close using the `esc` key.</p>
4
+ <% end %>
@@ -0,0 +1,4 @@
1
+ <%= coco_modal_dialog title: "This is the title", size: :md, show: true do |modal| %>
2
+ <p>The modal content.</p>
3
+ <p>Close using the `esc` key.</p>
4
+ <% end %>
@@ -0,0 +1,5 @@
1
+ <%= coco_modal_dialog name: "example",
2
+ title: "This is the title",
3
+ show: true do |modal| %>
4
+ <p>A modal dialog with a name provided.</p>
5
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <%= coco_modal_dialog title: "This is the title", show: true do |modal| %>
2
+ <span id="nav-test-link" @click="modal.visit('/lookbook/preview/modals/modal_lightbox/basic')">click to load lightbox</span>
3
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <%= coco_modal_dialog title: "Cannot be dismissed", dismissable: false, show: true do |modal| %>
2
+ <p>Can't dismiss this using the `esc` key.</p>
3
+ <% end %>
@@ -0,0 +1,5 @@
1
+ <%= coco_modal_dialog title: "This is the title" do |modal| %>
2
+ <div>
3
+ <p>The modal content.</p>
4
+ </div>
5
+ <% end %>
@@ -0,0 +1,8 @@
1
+ <%= coco_modal_dialog title: "This is the title", show: true do |modal| %>
2
+ <% modal.with_notice(title: "This is a notice", theme: :warning) do %>
3
+ Notice message text goes here.
4
+ <% end %>
5
+
6
+ <p>The modal content.</p>
7
+ <p>Close using the `esc` key.</p>
8
+ <% end %>
@@ -0,0 +1,4 @@
1
+ <%= coco_modal_dialog title: "This is the title", size: :sm, show: true do |modal| %>
2
+ <p>The modal content.</p>
3
+ <p>Close using the `esc` key.</p>
4
+ <% end %>
@@ -0,0 +1,9 @@
1
+ <%= coco_link_to "Dialog trigger link", "/lookbook/preview/modals/modal_dialog/basic", modal: true %>
2
+
3
+ <br><br>
4
+
5
+ <%= coco_button "Dialog trigger button", "/lookbook/preview/modals/modal_dialog/basic", modal: true %>
6
+
7
+
8
+ <%# ignore the code below, for preview purposes only! %>
9
+ <%= turbo_frame_tag(coco_modal_frame_id, class: "modal-frame") %>
@@ -0,0 +1,45 @@
1
+ module Modals
2
+ # @label Dialog
3
+ class ModalDialogPreview < Coco::Preview
4
+ # @hidden
5
+ def basic
6
+ end
7
+
8
+ def small
9
+ end
10
+
11
+ # @label Medium (default)
12
+ def medium
13
+ end
14
+
15
+ def large
16
+ end
17
+
18
+ # @label With notice
19
+ def notice
20
+ end
21
+
22
+ # @label Not dismissable
23
+ def not_dismissable
24
+ end
25
+
26
+ # @label Triggers
27
+ def triggers
28
+ end
29
+
30
+ def named
31
+ end
32
+
33
+ # @hidden
34
+ # @label Not shown
35
+ def not_shown
36
+ end
37
+
38
+ # @hidden
39
+ def navigate
40
+ end
41
+
42
+ def in_page
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,5 @@
1
+ <%= coco_modal_lightbox show: true do |lightbox| %>
2
+ <% lightbox.with_image(
3
+ src: "https://cb-images-staging.imgix.net/screenshots/url_box/d7b15fed541541392ffdedef64522643/20230922082233-ipad-1112.png?fit=crop&fm=jpg&rect=0%2C0%2C16000%2C16000"
4
+ ) %>
5
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <%= coco_modal_lightbox name: "example",
2
+ show: true do |lightbox| %>
3
+ <% lightbox.with_image(
4
+ src: "https://cb-images-staging.imgix.net/screenshots/url_box/d7b15fed541541392ffdedef64522643/20230922082233-ipad-1112.png?fit=crop&fm=jpg&rect=0%2C0%2C16000%2C16000"
5
+ ) %>
6
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <%= coco_modal_lightbox show: true do |lightbox| %>
2
+ <% lightbox.with_image(
3
+ src: "https://cb-images-staging.imgix.net/screenshots/url_box/d7b15fed541541392ffdedef64522643/20230922082233-ipad-1112.png?fit=crop&fm=jpg&rect=0%2C0%2C16000%2C16000",
4
+ scroll_top: 1000
5
+ ) %>
6
+ <% end %>
@@ -0,0 +1,8 @@
1
+
2
+ <%= coco_link_to "Lightbox trigger link", "/lookbook/preview/modals/modal_lightbox/basic", modal: true %>
3
+
4
+ <br><br>
5
+
6
+ <%= coco_button "Lightbox trigger button", "/lookbook/preview/modals/modal_lightbox/basic", modal: true %>
7
+
8
+ <%= turbo_frame_tag(coco_modal_frame_id, class: "modal-frame") %>
@@ -0,0 +1,20 @@
1
+ module Modals
2
+ # @label Lightbox
3
+ class ModalLightboxPreview < Coco::Preview
4
+ # @label Basic
5
+ def basic
6
+ end
7
+
8
+ # @label Scroll to position
9
+ def scroll
10
+ end
11
+
12
+ # @label Triggers
13
+ def triggers
14
+ end
15
+
16
+ # @hidden
17
+ def named
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,6 @@
1
+ <%= coco_modal title: "This is the title", show: true do |modal| %>
2
+ <div>
3
+ <p>The modal content.</p>
4
+ <p>Not wrapped in a dialog.</p>
5
+ </div>
6
+ <% end %>
@@ -0,0 +1,8 @@
1
+ module Modals
2
+ # @hidden
3
+ class ModalPreview < Coco::Preview
4
+ # @label Basic
5
+ def basic
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,74 @@
1
+ module Navigation
2
+ # @hidden
3
+ class LinkPreview < Coco::Preview
4
+ # @!group Basic
5
+
6
+ def default
7
+ coco_link("this is a link", "http://example.com")
8
+ end
9
+
10
+ def block_content
11
+ coco_link("http://example.com") do
12
+ "this is a link"
13
+ end
14
+ end
15
+
16
+ # @!group Themes
17
+
18
+ def positive
19
+ coco_link("this is a positive link", "#", theme: :positive)
20
+ end
21
+
22
+ def warning
23
+ coco_link("this is a warning link", "#", theme: :warning)
24
+ end
25
+
26
+ def negative
27
+ coco_link("this is a negative link", "#", theme: :negative)
28
+ end
29
+
30
+ def info
31
+ coco_link("this is an info link", "#", theme: :info)
32
+ end
33
+
34
+ def neutral_dark
35
+ coco_link("this is a neutral dark link", "#", theme: :neutral_dark)
36
+ end
37
+
38
+ def neutral_light
39
+ coco_link("this is a neutral light link", "#", theme: :neutral_light)
40
+ end
41
+
42
+ # @!group With Icon
43
+
44
+ # Icon links
45
+ # ------------
46
+ #
47
+ # These are intentionally minimally styled to make it easier for them
48
+ # to be used within (and inherit styles from) other components.
49
+ #
50
+ # @label Icon at start
51
+ def icon_start
52
+ coco_link("http://example.com") do |link|
53
+ link.with_icon :smile
54
+ link.with_text "this is a link"
55
+ end
56
+ end
57
+
58
+ # @label Icon at end
59
+ def icon_end
60
+ coco_link("http://example.com") do |link|
61
+ link.with_icon :smile, position: :end
62
+ link.with_text "this is a link"
63
+ end
64
+ end
65
+
66
+ # @!endgroup
67
+
68
+ def icon_shorthand
69
+ coco_link("http://example.com", icon: :smile) do
70
+ "this is a link"
71
+ end
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,88 @@
1
+ module Navigation
2
+ # @label Link
3
+ class LinkToPreview < Coco::Preview
4
+ # @!group Basic
5
+
6
+ # @label Basic
7
+ def basic
8
+ coco_link_to("this is a link", "http://example.com")
9
+ end
10
+
11
+ # @label Basic (block content)
12
+ def basic_block_content
13
+ coco_link_to("http://example.com") do
14
+ "this is a link"
15
+ end
16
+ end
17
+
18
+ # @!group Themed
19
+
20
+ def positive
21
+ coco_link_to("this is a positive link", "#", theme: :positive)
22
+ end
23
+
24
+ def warning
25
+ coco_link_to("this is a warning link", "#", theme: :warning)
26
+ end
27
+
28
+ def negative
29
+ coco_link_to("this is a negative link", "#", theme: :negative)
30
+ end
31
+
32
+ def info
33
+ coco_link_to("this is an info link", "#", theme: :info)
34
+ end
35
+
36
+ def neutral_dark
37
+ coco_link_to("this is a neutral dark link", "#", theme: :neutral_dark)
38
+ end
39
+
40
+ def neutral_light
41
+ coco_link_to("this is a neutral light link", "#", theme: :neutral_light)
42
+ end
43
+
44
+ def underlined
45
+ coco_link_to("this is a positive link", "#", theme: :positive, underline: true)
46
+ end
47
+
48
+ # @!group With Icon
49
+
50
+ # Icon links
51
+ # ------------
52
+ #
53
+ # These are intentionally minimally styled to make it easier for them
54
+ # to be used within (and inherit styles from) other components.
55
+ #
56
+ # @label Icon at start
57
+ def icon_start
58
+ coco_link_to("http://example.com") do |link|
59
+ link.with_icon :smile
60
+ link.with_text "this is a link"
61
+ end
62
+ end
63
+
64
+ # @label Icon at end
65
+ def icon_end
66
+ coco_link_to("http://example.com") do |link|
67
+ link.with_icon :smile, position: :end
68
+ link.with_text "this is a link"
69
+ end
70
+ end
71
+
72
+ def icon_shorthand
73
+ coco_link_to("http://example.com", icon: :smile) do
74
+ "this is a link"
75
+ end
76
+ end
77
+
78
+ # @!group Turbo modal links
79
+
80
+ def default_modal
81
+ coco_link_to("this is a turbo modal link", "/page/with/modal", modal: true)
82
+ end
83
+
84
+ def specific_modal
85
+ coco_link_to("this is a turbo modal link", "/page/with/modal", modal: "example")
86
+ end
87
+ end
88
+ end
@@ -0,0 +1,12 @@
1
+ module Navigation
2
+ class PagerButtonPreview < Coco::Preview
3
+ # @!group
4
+ def previous
5
+ coco_pager_button(:previous, href: "#")
6
+ end
7
+
8
+ def next
9
+ coco_pager_button(:next, href: "#")
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,5 @@
1
+ <%= coco_tabs do |tabs| %>
2
+ <% tabs.with_tab("Tab one", "#", active: true) %>
3
+ <% tabs.with_tab("Tab two", "#") %>
4
+ <% tabs.with_tab("Tab three", "#") %>
5
+ <% end %>
@@ -0,0 +1,5 @@
1
+ <%= coco_tabs(fit: :full) do |tabs| %>
2
+ <% tabs.with_tab("Tab one", "#", active: true) %>
3
+ <% tabs.with_tab("Tab two", "#") %>
4
+ <% tabs.with_tab("Tab three", "#") %>
5
+ <% end %>
@@ -0,0 +1,5 @@
1
+ <%= coco_tabs do |tabs| %>
2
+ <% tabs.with_tab("Tab one", "#", icon: :atom, active: true) %>
3
+ <% tabs.with_tab("Tab two", "#", icon: :bar_chart) %>
4
+ <% tabs.with_tab("Tab three", "#", icon: :palette) %>
5
+ <% end %>
@@ -0,0 +1,15 @@
1
+ module Navigation
2
+ class TabsPreview < Coco::Preview
3
+ # @!group
4
+
5
+ def basic
6
+ end
7
+
8
+ def icons
9
+ end
10
+
11
+ # @label Fit: full
12
+ def full
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,27 @@
1
+ module Pickers
2
+ # @hidden
3
+ # @display centered true
4
+ class ColorPickerPreview < Coco::Preview
5
+ def default
6
+ render Coco::ColorPicker.new
7
+ end
8
+
9
+ def custom_swatches
10
+ render Coco::ColorPicker.new do |picker|
11
+ picker.with_swatch "#1F2226"
12
+ picker.with_swatch "#444B53"
13
+ picker.with_swatch "#ACB2B9"
14
+ picker.with_swatch "#EEEFF0"
15
+ picker.with_swatch "#FFFFFF"
16
+ picker.with_swatch "#C3291C"
17
+ picker.with_swatch "#EA672F"
18
+ picker.with_swatch "#F6CA84"
19
+ picker.with_swatch "#C6D9AE"
20
+ picker.with_swatch "#3B8672"
21
+ picker.with_swatch "#2863F6"
22
+ picker.with_swatch "#1A45AC"
23
+ picker.with_swatch "#382E81"
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,24 @@
1
+ module Pickers
2
+ # @hidden
3
+ # @display centered true
4
+ class ImagePickerPreview < Coco::Preview
5
+ def default
6
+ render Coco::ImagePicker.new(input_name: :bg_image) do |picker|
7
+ picker.with_blank_state_text do
8
+ "Drag and drop an image here or click to..."
9
+ end
10
+ end
11
+ end
12
+
13
+ def with_content
14
+ render Coco::ImagePicker.new(
15
+ input_name: :bg_image,
16
+ src: ActionController::Base.helpers.asset_path("coco/img/test/slides/slide-bg.jpg")
17
+ ) do |picker|
18
+ picker.with_blank_state_text do
19
+ "Drag and drop an image here or click to..."
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,24 @@
1
+ <div style="text-wrap: nowrap">
2
+ <h1 class="coco-display-1-branded">Display 1 branded</h1>
3
+ <br>
4
+ <h1 class="coco-display-2-branded">Display 2 branded</h1>
5
+ <br>
6
+ <h1 class="coco-display-3-branded">Display 3 branded</h1>
7
+ <br>
8
+ <h1 class="coco-display-4-branded">Display 4 branded</h1>
9
+
10
+ <br>
11
+ <br>
12
+
13
+ <h1 class="coco-heading-1-branded">Heading 1 branded</h1>
14
+ <br>
15
+ <h1 class="coco-heading-2-branded">Heading 2 branded</h1>
16
+ <br>
17
+ <h1 class="coco-heading-3-branded">Heading 3 branded</h1>
18
+ <br>
19
+ <h1 class="coco-heading-4-branded">Heading 4 branded</h1>
20
+ <br>
21
+ <h1 class="coco-heading-5-branded">Heading 5 branded</h1>
22
+ <br>
23
+ <h1 class="coco-heading-6-branded">Heading 6 branded</h1>
24
+ </div>
@@ -0,0 +1,7 @@
1
+ <div style="text-wrap: nowrap">
2
+ <h1 class="coco-display-3-branded" data-resize="false">Display 4</h1>
3
+ <br>
4
+ <h1 class="coco-heading-2" data-resize="false">Heading 2</h1>
5
+ <br>
6
+ <h2 class="coco-subheading-1" data-resize="false">Subheading 1</h2>
7
+ </div>
@@ -0,0 +1,35 @@
1
+ <div style="text-wrap: nowrap">
2
+ <h1 class="coco-display-1">Display 1</h1>
3
+ <br>
4
+ <h1 class="coco-display-2">Display 2</h1>
5
+ <br>
6
+ <h1 class="coco-display-3">Display 3</h1>
7
+ <br>
8
+ <h1 class="coco-display-4">Display 4</h1>
9
+
10
+ <br>
11
+ <br>
12
+
13
+ <h1 class="coco-heading-1">Heading 1</h1>
14
+ <br>
15
+ <h1 class="coco-heading-2">Heading 2</h1>
16
+ <br>
17
+ <h1 class="coco-heading-3">Heading 3</h1>
18
+ <br>
19
+ <h1 class="coco-heading-4">Heading 4</h1>
20
+ <br>
21
+ <h1 class="coco-heading-5">Heading 5</h1>
22
+ <br>
23
+ <h1 class="coco-heading-6">Heading 6</h1>
24
+
25
+ <br>
26
+ <br>
27
+
28
+ <h2 class="coco-subheading-1">Subheading 1</h2>
29
+ <br>
30
+ <h2 class="coco-subheading-2">Subheading 2</h2>
31
+ <br>
32
+ <h2 class="coco-subheading-3">Subheading 3</h2>
33
+ <br>
34
+ <h2 class="coco-subheading-4">Subheading 4</h2>
35
+ </div>
@@ -0,0 +1,16 @@
1
+ module Typography
2
+ # @display max_width 100%
3
+ # @label Utility classes
4
+ class UtilsPreview < Coco::Preview
5
+ def headings
6
+ end
7
+
8
+ def branded_headings
9
+ end
10
+
11
+ # Use `data-resize="false"` to prevent
12
+ # headings responding to screen size.
13
+ def fixed_size_headings
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,19 @@
1
+ module Utilities
2
+ # @hidden
3
+ # @display centered true
4
+ class DropdownPreview < Coco::Preview
5
+ def default
6
+ render coco_component("dropdown") do |dd|
7
+ dd.with_trigger { "dropdown trigger" }
8
+ dd.with_dropdown { "dropdown content" }
9
+ end
10
+ end
11
+
12
+ def custom_placement
13
+ render coco_component("dropdown") do |dd|
14
+ dd.with_trigger { "dropdown trigger" }
15
+ dd.with_dropdown(placement: "right") { "dropdown content" }
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,9 @@
1
+ <p style="line-height: 1.2">
2
+ <%= coco_seamless_textarea(
3
+ name: "text",
4
+ multiline: true,
5
+ focus: true
6
+ ) do %>
7
+ This has focus so you can type immediately
8
+ <% end %>
9
+ </p>
@@ -0,0 +1,9 @@
1
+ <p style="line-height: 1.2">
2
+ <%= coco_seamless_textarea(
3
+ name: "text",
4
+ multiline: true
5
+ ) do %>
6
+ This is some editable text
7
+ split across multiple lines
8
+ <% end %>
9
+ </p>
@@ -0,0 +1,8 @@
1
+ <h1 style="font-weight: bold; font-size: 50px;">
2
+ <%= coco_seamless_textarea(
3
+ name: "title",
4
+ multiline: false,
5
+ ) do %>
6
+ This is an editable single line title
7
+ <% end %>
8
+ </h1>
@@ -0,0 +1,29 @@
1
+ module Utilities
2
+ # @hidden
3
+ class SeamlessTextareaPreview < Coco::Preview
4
+ # @!group
5
+
6
+ def single_line
7
+ end
8
+
9
+ def multi_line
10
+ end
11
+
12
+ def focus
13
+ end
14
+
15
+ # @!endgroup
16
+
17
+ # Used for system tests only.
18
+ # @hidden
19
+ def system_test(multiline: "false")
20
+ coco_seamless_textarea(
21
+ name: :system_test,
22
+ multiline: multiline == "true",
23
+ textarea: {
24
+ id: "system-test"
25
+ }
26
+ )
27
+ end
28
+ end
29
+ end