bullet_train-themes-light 1.0.7 → 1.0.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/light/actiontext.css +26 -0
  3. data/app/assets/stylesheets/light/application.css +31 -0
  4. data/app/assets/stylesheets/light/electron.css +46 -0
  5. data/app/assets/stylesheets/light/fields/cloudinary_image.css +58 -0
  6. data/app/assets/stylesheets/light/fields/date_field.css +19 -0
  7. data/app/assets/stylesheets/light/fields/index.css +5 -0
  8. data/app/assets/stylesheets/light/fields/phone_field.css +7 -0
  9. data/app/assets/stylesheets/light/fields/super_select.css +96 -0
  10. data/app/assets/stylesheets/light/fields/trix_editor.css +88 -0
  11. data/app/assets/stylesheets/light/mailer.scss +359 -0
  12. data/app/assets/stylesheets/light/tailwind/components.css +136 -0
  13. data/app/assets/stylesheets/light/tailwind/dark-mode.css +205 -0
  14. data/app/assets/stylesheets/light/tailwind/utilities.css +49 -0
  15. data/app/assets/stylesheets/light.tailwind.css +5 -3
  16. data/app/assets/stylesheets/tailwindcss/base.css +1 -0
  17. data/app/assets/stylesheets/tailwindcss/components.css +1 -0
  18. data/app/assets/stylesheets/tailwindcss/utilities.css +1 -0
  19. data/app/{assets/javascript → javascript}/application.light.js +0 -0
  20. data/app/views/themes/light/conversations/_card.html.erb +21 -0
  21. data/app/views/themes/light/conversations/_comment.html.erb +26 -0
  22. data/app/views/themes/light/conversations/_message.html.erb +127 -0
  23. data/app/views/themes/light/conversations/_thread_border.html.erb +3 -0
  24. data/app/views/themes/light/layouts/_account.html.erb +1 -1
  25. data/app/views/themes/light/layouts/_head.html.erb +6 -4
  26. data/app/views/themes/light/workflow/_box.html.erb +1 -1
  27. data/lib/bullet_train/themes/light/engine.rb +1 -0
  28. data/lib/bullet_train/themes/light/version.rb +1 -1
  29. data/tailwind.light.config.js +5 -1
  30. metadata +23 -3
@@ -0,0 +1,49 @@
1
+ @layer utilities {
2
+ .text-2xs {
3
+ @apply uppercase;
4
+ font-size: 0.65rem;
5
+ line-height: 0.9rem;
6
+ letter-spacing: 1px;
7
+ }
8
+
9
+ .space-y {
10
+ @apply space-y-5;
11
+ }
12
+
13
+ .space-x {
14
+ @apply space-x-3;
15
+ }
16
+
17
+ .gap-y {
18
+ @apply gap-y-5;
19
+ }
20
+
21
+ .gap-x {
22
+ @apply gap-x-4;
23
+ }
24
+
25
+ .bg-dark-blue-gradient {
26
+ background-image: linear-gradient(to bottom, #1c4cc3 0%, #0e369a 100%);
27
+ }
28
+
29
+ .bg-dark-awesome-gradient {
30
+ background-image: linear-gradient(to bottom right, darken(#D7BBEA, 45%) 10%, #0e369a 100%);
31
+ }
32
+
33
+ .bg-light-blue-gradient {
34
+ &:before {
35
+ content: "";
36
+ position: fixed;
37
+ z-index: -1;
38
+ background: linear-gradient(to bottom right, #D7BBEA, #65A8F1);
39
+ top: 0px;
40
+ left: 0px;
41
+ bottom: 0px;
42
+ right: 0px;
43
+ }
44
+ }
45
+
46
+ [hidden] {
47
+ display: none !important;
48
+ }
49
+ }
@@ -1,3 +1,5 @@
1
- @tailwind base;
2
- @tailwind components;
3
- @tailwind utilities;
1
+ @import "tailwindcss/base";
2
+ @import "tailwindcss/components";
3
+ @import "tailwindcss/utilities";
4
+
5
+ @import "light/application";
@@ -0,0 +1 @@
1
+ @tailwind base;
@@ -0,0 +1 @@
1
+ @tailwind components;
@@ -0,0 +1 @@
1
+ @tailwind utilities;
@@ -0,0 +1,21 @@
1
+ <% conversation ||= subscription.conversation %>
2
+
3
+ <div class="<%= 'border-l-blue border-l-4 border-blue-700' if subscription.unread? %>">
4
+
5
+ <%= link_to [:account, current_user, :conversations, :subscriptions, conversation_id: subscription.conversation.id], class: "#{current_conversation ? 'bg-gray-100 border-l ' : 'bg-white'} h-28 p-1 flex border-b-2 cursor-pointer hover:no-underline hover:bg-gray-50 relative items-center" do %>
6
+ <div class="md:w-1/4 w-1/5 lg:inline-block md:hidden flex-shrink-0">
7
+ <img src="<%= membership_profile_photo_url(conversation.last_message&.membership || current_membership) %>" title="<%= current_membership.name %>" alt="<%= current_membership.name %>" class="md:w-14 md:h-14 w-12 h-12 rounded-full mx-auto border-1 border-white border-2 flex-none">
8
+ </div>
9
+ <div class="w-4/5 md:w-full lg:w-4/5 pl-4 pr-1 flex-initial truncate">
10
+ <p class="text-xs text-gray-300 text-right hover:no-underline"><%= "#{time_ago_in_words conversation.last_message.created_at} ago" unless conversation.last_message.nil? %></p>
11
+ <h2 class="<%= subscription.unread? ? 'font-bold text-gray-800' : 'font-semibold text-gray-600' %> "><%= conversation.subject&.label_string %></h2>
12
+ <div class="text-gray-300">
13
+ <%= conversation.last_message&.user&.label_string %>
14
+ </div>
15
+ <div class="h-8 text-gray-400 text-sm pt-1 hover:no-underline truncate">
16
+ <%= Nokogiri::HTML.fragment(conversation.last_message.body).text unless conversation.last_message.nil? %>
17
+ </div>
18
+ </div>
19
+
20
+ <% end %>
21
+ </div>
@@ -0,0 +1,26 @@
1
+ <% new_message ||= false %>
2
+ <% current_user_message = message.membership.user == current_user %>
3
+ <% avatar = capture do %>
4
+ <img src="<%= membership_profile_photo_url(message.membership) %>" title="<%= message.membership.name %>" alt="<%= message.membership.name %>" class="w-10 h-10 rounded-full <%= current_user_message ? 'order-2' : 'order-1' %>">
5
+ <% end %>
6
+
7
+ <div class="flex py-3 px-2 text-gray-700 <%= message.reply? ? 'border w-full bg-gray-50 rounded-md' : 'border-b' %> <%= 'opacity-30' if new_message %>">
8
+ <div class="mr-3 min-w-max"><%= avatar %></div>
9
+ <div class="flex flex-col w-full">
10
+ <div class=""><span class="uppercase font-bold text-gray-500"><%= message.user.name %></span><span class="font-extralight text-xs text-gray-400"> &bull; <%= time_ago_in_words message.created_at %> ago</span></div>
11
+ <div class="py-2"><%= trix_sanitize message.body %></div>
12
+ <% if message.replies.any? %>
13
+ <div class="space-y-2 mt-2 mb-2">
14
+ <% message.replies.oldest.each do |reply| %>
15
+ <%= render 'account/shared/comment', message: reply %>
16
+ <% end %>
17
+ </div>
18
+ <% end %>
19
+ <% unless message.reply? %>
20
+ <%= turbo_frame_tag "reply_#{message.id}" do %>
21
+ <%= link_to "Reply", [:reply, :account, message], class: "font-light text-sm text-gray-400 hover:text-gray-500 pt-2" %>
22
+ <% end %>
23
+ <% end %>
24
+ </div>
25
+
26
+ </div>
@@ -0,0 +1,127 @@
1
+ <% new_message ||= false %>
2
+ <% current_user_message = message.membership.user == current_user %>
3
+ <% avatar = capture do %>
4
+ <img src="<%= membership_profile_photo_url(message.membership) %>" title="<%= message.membership.name %>" alt="<%= message.membership.name %>" class="w-6 h-6 rounded-full <%= current_user_message ? 'order-2' : 'order-1' %>">
5
+ <% end %>
6
+ <% next_message ||= message.next_message %>
7
+
8
+ <%# A message series is a series of messages by the same user, each message within 5 minutes of the previous message. It has nothing to do with replies and message threads %>
9
+ <% next_message_in_series = (message.user == next_message&.user) && (message.created_at > next_message.created_at - 5.minutes) && (message.parent_message_id == next_message&.parent_message_id || message.id == next_message.parent_message_id)%>
10
+ <% if next_message_in_series %>
11
+ <% avatar = nil %>
12
+ <% end %>
13
+
14
+ <%# We set this to true when rendering the messages for the reply view. All messages in the thread are shown in order without any other messages from the conversation %>
15
+ <% show_as_thread ||= false %>
16
+
17
+ <%# placeholder messages are used when displaying a reply to a message that we need to show out of order with the rest %>
18
+ <% placeholder_message ||= false %>
19
+
20
+ <% if avatar.nil? %>
21
+ <% avatar = capture do %>
22
+ <div style="height: 24px; width: 24px;" class="<%= current_user_message ? 'order-2' : 'order-1' %>"></div>
23
+ <% end %>
24
+ <% end %>
25
+
26
+ <% rounding_modifier = message_corner_class(next_message_in_series, current_user_message) %>
27
+
28
+ <% timestamp = next_message_in_series || show_as_thread ? '' : time_ago_in_words(message.created_at) + " ago" %>
29
+
30
+ <% threaded_message = message.threaded? %>
31
+ <% thread_started_by_current_user = message.thread_origin_user == current_user %>
32
+ <% last_message_in_thread = !placeholder_message && threaded_message && (message.next_message.nil? || message.next_message.thread_id != message.thread_id)%>
33
+ <% out_of_thread_message = !show_as_thread && threaded_message && message.reply? && message.previous_message != message.previous_message_in_thread %>
34
+ <% has_replies = message.replies.any? && message.next_message == message.next_message_in_thread %>
35
+ <% border_side = thread_started_by_current_user ? :left : :right %>
36
+ <% show_borders = !show_as_thread && threaded_message %>
37
+
38
+ <% if out_of_thread_message %>
39
+ <%= render 'account/shared/message', message: message.thread_origin_message, next_message: message, placeholder_message: true, show_as_thread: show_as_thread %>
40
+ <% end %>
41
+
42
+
43
+ <div class="chat-message"
44
+ <% unless show_as_thread %>
45
+ data-reply-target="message"
46
+ data-user="<%= message.membership.label_string %>"
47
+ data-message-id="<%= message.parent_message_id || message.id %>"
48
+ data-action="mouseleave->reply#hideReplyButton"
49
+ <% end %>
50
+ >
51
+ <div class="group flex <%= 'justify-end' if current_user_message %> <%= 'opacity-20' if new_message %> items-stretch">
52
+ <% if show_borders %>
53
+ <% if (has_replies || placeholder_message) %>
54
+ <%= message_thread_border(side: border_side, position: :start) unless show_as_thread %>
55
+ <% end %>
56
+ <% if message.reply? && ((current_user_message && thread_started_by_current_user) || (!current_user_message && !thread_started_by_current_user) ) %>
57
+ <%= message_thread_border(side: border_side, position: (last_message_in_thread ? :end : :middle)) %>
58
+ <% end %>
59
+ <% end %>
60
+
61
+
62
+ <div class="flex flex-col <%= 'mb-0.5' if next_message_in_series %>">
63
+ <div class="flex items-end relative <%= 'justify-end' if current_user_message %>" data-action="<%= 'click->reply#preventDefault' if show_as_thread %>">
64
+ <div class="flex flex-col space-y-2 text-xs max-w-xs mx-2 <%= current_user_message ? 'order-1 items-end' : 'order-3 items-start' %> z-10 transition-all duration-300"
65
+ data-action="<%= 'mouseenter->reply#showReplyButton click->reply#showReplyButton' unless placeholder_message || show_as_thread %>" data-show-class="<%= current_user_message ? 'mr-10' : 'ml-10' %>"
66
+ >
67
+ <% if placeholder_message %>
68
+ <div class="cursor-pointer" data-thread-url="<%= url_for([:thread, :account, message.thread_origin_message || message]) %>" data-action="click->reply#reply"><span class="px-2 py-1 text-xs text-gray-300 rounded-lg inline-block <%= rounding_modifier %> border-blue-300 border break-words sm:max-w-sm max-w-tiny"><%= Nokogiri::HTML.fragment(trix_sanitize(message.body)).text.truncate(80) %></span></div>
69
+ <% else %>
70
+ <div><span class="px-4 py-2 rounded-lg inline-block <%= rounding_modifier %> <%= current_user_message ? ' bg-blue-600 text-white' : ' bg-gray-300 text-gray-600' %> "><%= trix_sanitize(message.body) %></span></div>
71
+ <% end %>
72
+ </div>
73
+ <%= avatar %>
74
+ <% unless placeholder_message || show_as_thread %>
75
+ <div class="order-2 absolute text-gray-400 bottom-1 hover:text-gray-500 <%= current_user_message ? 'right-10' : 'left-10' %> z-0">
76
+ <button
77
+ data-action="click->reply#reply"
78
+ data-thread-url="<%= url_for([:thread, :account, message.thread_origin_message || message]) %>"
79
+ >
80
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 stroke-current" fill="none" viewBox="0 0 24 24">
81
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 10h10a8 8 0 018 8v2M3 10l6 6m-6-6l6-6" />
82
+ </svg>
83
+ </button>
84
+ </div>
85
+ <% end %>
86
+ </div>
87
+ <% if message.replies.any? && !show_as_thread %>
88
+ <div class="<%= 'text-right' if current_user_message %>">
89
+ <button class="text-xs text-blue-400 text-right mr-12 ml-12" data-thread-url="<%= url_for([:thread, :account, message.thread_origin_message || message]) %>" data-action="reply#reply"><%= message.replies.size %> <%= t("conversations/messages.navigation.reply").pluralize(message.replies.size) %></button>
90
+ </div>
91
+ <% end %>
92
+
93
+ </div>
94
+ </div>
95
+ <% unless next_message_in_series || placeholder_message %>
96
+ <div class="flex">
97
+ <% if show_borders && !last_message_in_thread %>
98
+ <% if (thread_started_by_current_user && current_user_message) || (!thread_started_by_current_user && !current_user_message) %>
99
+ <%= message_thread_border(side: border_side, position: :middle) %>
100
+ <% end %>
101
+ <% end %>
102
+
103
+ <div class="flex flex-grow order-1 <%= current_user_message ? 'justify-end items-end pr-8' : 'justify-start items-start pl-8' %> <%= 'mb-3' unless next_message_in_series %>">
104
+ <div class="<%= show_as_thread ? 'text-gray-400' : 'text-gray-300' %> text-sm">
105
+ <strong><%= message.user.name %></strong>
106
+ <%= timestamp %>
107
+ </div>
108
+ </div>
109
+ </div>
110
+ <% end %>
111
+ <% if message.replies.any? && false %>
112
+ <div class="mb-4">
113
+ <% message.replies.each do |reply| %>
114
+ <div class="flex text-xs font-extralight text-gray-300 ml-12">
115
+ <div class="<%= 'w-full' if current_user_message %>"></div>
116
+ <svg version="1.0" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 682" class="w-5 h-5 stroke-current mt-4 text-gray-50 fill-current">
117
+ <path d="M0 57.7c.1 145.1 4.1 224 14.5 281.1 19.4 106.3 65.2 156.4 166.3 181.7 48.7 12.1 111.4 18.8 211.7 22.5 23.8.9 196.6 2.8 268.2 3H683l.2 67.8.3 67.8 170.3-102.1L1024 477.3l-170.2-102-170.3-102-.3 67.8-.2 67.9h-75.8c-184.7 0-266.9-4.8-327.2-19-34.2-8.1-62.8-21.1-81.2-37-36.1-31.3-52.3-76.8-58.8-165.5-2-28-3-69.2-3-127.8V0H0v57.7z"/>
118
+ </svg>
119
+ <div class="flex flex-col mr-10 min-w-max">
120
+ <div class="pt-0 mr-2 ml-4 text-xxs"><%= reply.membership.label_string %> reply: </div>
121
+ <div class="bg-gray-100 rounded py-2 px-4 mt-0 text-gray-400 max-w-md"><%= reply.body.html_safe %></div>
122
+ </div>
123
+ </div>
124
+ <% end %>
125
+ </div>
126
+ <% end %>
127
+ </div>
@@ -0,0 +1,3 @@
1
+ <div class="flex-grow flex <%= side == :left ? 'justify-start' : 'justify-end order-2' %>">
2
+ <div class=" border-solid border-gray-300 <%= border_classes %> text-white <%= side == :left ? 'ml-12 mr-0' : 'ml-0 mr-12' %> w-6"></div>
3
+ </div>
@@ -15,7 +15,7 @@
15
15
 
16
16
  <% menu = capture do %>
17
17
  <div class="flex items-center flex-shrink-0 p-4 bg-blue-darker md:rounded-tl-lg electron-draggable electron-title-bar dark:bg-black dark:bg-opacity-10">
18
- <%= image_tag asset_pack_path('media/images/light/logo/logo.png'), class: 'h-5 w-auto mx-auto' %>
18
+ <%= image_tag image_path('light/logo/logo.png'), class: 'h-5 w-auto mx-auto' %>
19
19
 
20
20
  <div class="lg:hidden absolute right-0">
21
21
  <button class="ml-1 flex items-center justify-center h-10 w-10 rounded-full focus:outline-none focus:ring-2 focus:ring-inset focus:ring-white dark:ring-transparent"
@@ -1,6 +1,8 @@
1
1
  <%= stylesheet_link_tag 'https://rsms.me/inter/inter.css', media: 'all', 'data-turbo-track': 'reload' %>
2
- <link href="<%= asset_pack_path('media/images/light/logo/favicon.png') %>" rel="shortcut icon" />
3
- <link href="<%= asset_pack_path('media/images/light/logo/logo-square-bg.png') %>" rel="apple-touch-icon" />
4
- <%= stylesheet_pack_tag 'light', media: 'all', 'data-turbo-track': 'reload' %>
5
- <%= javascript_pack_tag 'light', 'data-turbo-track': 'reload' %>
2
+ <link href="<%= image_path('light/logo/favicon.png') %>" rel="shortcut icon" />
3
+ <link href="<%= image_path('light/logo/logo-square-bg.png') %>" rel="apple-touch-icon" />
4
+ <%= javascript_include_tag 'application', 'data-turbo-track': 'reload' %>
5
+ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbo-track': 'reload' %>
6
+ <%= javascript_include_tag 'application.light', 'data-turbo-track': 'reload' %>
7
+ <%= stylesheet_link_tag 'application.light', media: 'all', 'data-turbo-track': 'reload' %>
6
8
  <%= render 'layouts/head' %>
@@ -7,7 +7,7 @@
7
7
  <div class="bg-white py-8 px-10 shadow rounded-lg dark:bg-sealBlue-400">
8
8
  <div class="sm:mx-auto sm:w-full sm:max-w-md py-5">
9
9
  <a href="<%= main_app.root_path %>" class="block py-3">
10
- <img alt="" src="<%= asset_pack_path("media/images/light/logo/logo.png") %>" width="<%= image_width_for_height('light/logo/logo.png', 54) %>" height="54" class="mx-auto h-12 w-auto" />
10
+ <img alt="" src="<%= image_path("light/logo/logo.png") %>" width="<%= image_width_for_height('light/logo/logo.png', 54) %>" height="54" class="mx-auto h-12 w-auto" />
11
11
  </a>
12
12
 
13
13
  <h1 class="mt-6 text-center text-3xl font-semibold tracking-tight dark:text-white">
@@ -4,6 +4,7 @@ module BulletTrain
4
4
  class Engine < ::Rails::Engine
5
5
  initializer "bullet_train.themes.light.register" do |app|
6
6
  BulletTrain::Themes.themes[:light] = BulletTrain::Themes::Light::Theme.new
7
+ BulletTrain.linked_gems << "bullet_train-themes-light"
7
8
  end
8
9
  end
9
10
  end
@@ -1,7 +1,7 @@
1
1
  module BulletTrain
2
2
  module Themes
3
3
  module Light
4
- VERSION = "1.0.7"
4
+ VERSION = "1.0.10"
5
5
  end
6
6
  end
7
7
  end
@@ -6,7 +6,11 @@ module.exports = {
6
6
  './app/views/**/*.html.erb',
7
7
  './app/helpers/**/*.rb',
8
8
  './app/assets/stylesheets/**/*.css',
9
- './app/javascript/**/*.js'
9
+ './app/javascript/**/*.js',
10
+ './tmp/gems/*/app/views/**/*.html.erb',
11
+ './tmp/gems/*/app/helpers/**/*.rb',
12
+ './tmp/gems/*/app/assets/stylesheets/**/*.css',
13
+ './tmp/gems/*/app/javascript/**/*.js',
10
14
  ],
11
15
  darkMode: 'media',
12
16
  theme: {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet_train-themes-light
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-24 00:00:00.000000000 Z
11
+ date: 2022-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -49,8 +49,24 @@ files:
49
49
  - README.md
50
50
  - Rakefile
51
51
  - app/assets/config/bullet_train_themes_light_manifest.js
52
- - app/assets/javascript/application.light.js
53
52
  - app/assets/stylesheets/light.tailwind.css
53
+ - app/assets/stylesheets/light/actiontext.css
54
+ - app/assets/stylesheets/light/application.css
55
+ - app/assets/stylesheets/light/electron.css
56
+ - app/assets/stylesheets/light/fields/cloudinary_image.css
57
+ - app/assets/stylesheets/light/fields/date_field.css
58
+ - app/assets/stylesheets/light/fields/index.css
59
+ - app/assets/stylesheets/light/fields/phone_field.css
60
+ - app/assets/stylesheets/light/fields/super_select.css
61
+ - app/assets/stylesheets/light/fields/trix_editor.css
62
+ - app/assets/stylesheets/light/mailer.scss
63
+ - app/assets/stylesheets/light/tailwind/components.css
64
+ - app/assets/stylesheets/light/tailwind/dark-mode.css
65
+ - app/assets/stylesheets/light/tailwind/utilities.css
66
+ - app/assets/stylesheets/tailwindcss/base.css
67
+ - app/assets/stylesheets/tailwindcss/components.css
68
+ - app/assets/stylesheets/tailwindcss/utilities.css
69
+ - app/javascript/application.light.js
54
70
  - app/views/themes/light/_alert.html.erb
55
71
  - app/views/themes/light/_box.html.erb
56
72
  - app/views/themes/light/_breadcrumb.html.erb
@@ -64,6 +80,10 @@ files:
64
80
  - app/views/themes/light/attributes/_block.html.erb
65
81
  - app/views/themes/light/breadcrumbs/_actions.html.erb
66
82
  - app/views/themes/light/commentary/_box.html.erb
83
+ - app/views/themes/light/conversations/_card.html.erb
84
+ - app/views/themes/light/conversations/_comment.html.erb
85
+ - app/views/themes/light/conversations/_message.html.erb
86
+ - app/views/themes/light/conversations/_thread_border.html.erb
67
87
  - app/views/themes/light/fields/_field.html.erb
68
88
  - app/views/themes/light/forms/_errors.html.erb
69
89
  - app/views/themes/light/layouts/_account.html.erb