bullet_train-themes-light 1.2.1 → 1.2.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b80b6b2ddd53d1ff6a785569d135e0523cc8bd9bfed4b9bf8bde948fc3629915
4
- data.tar.gz: 6604a740bb1a71b5cbdaa99533de60d542a9d12240aad20e4b7eee9207b071fe
3
+ metadata.gz: ab6e8139c9b2f4520b42c72a9b00178f88f9e87b19443eae4f149eced0a8874b
4
+ data.tar.gz: 16e7cac20e0c28e2ba0ed54fe88b8c7fe08bd2801cbadb14ec86574e16ecedee
5
5
  SHA512:
6
- metadata.gz: 348d2dfbea0da99121cfc4911bea2628bcfd8400fdaa8b249974f43570a00c588b778ee6ef9cf625f0fdc57efc3d09180739f0252ed458628e2e5b8edb54ef9a
7
- data.tar.gz: 608102771b2f50d2bc678a98826e1b3c2450f8e520fe889c2316a429ca0284f0396a6319288e743fa371a0da26330a56f7ead9cafcfe3e825edfa7b415443253
6
+ metadata.gz: 4f6b3c5ee9ba6c47c033e12d6b6630d2eda9f68b176f18263d782fbb20daea6fd9223492c8d0f94405b78f2cabc168ff2ee345683ae2cafdfa59fa4f94c4ee69
7
+ data.tar.gz: c41cc4850a18218a820b625e3a878b85fd169954b50a67f50f57ae6cd4d18105a6ea8d12aaae60df74df9b39775cc436926042da9a15dfb0a3ed29465b9ef10b
@@ -9,7 +9,7 @@
9
9
  @import './fields';
10
10
  @import './turn';
11
11
 
12
- /* TODO there is probably a better way to do this. */
12
+ /* TODO We should be able to do this in Tailwind CSS. */
13
13
  .hover-indent-child {
14
14
  .indent-child {
15
15
  transition: transform 0.2s ease;
@@ -27,14 +27,14 @@ html.turn-exit [data-turn-exit] {
27
27
 
28
28
  100% {
29
29
  opacity: 0;
30
- transform: translate3d(0, -4rem, 0)
30
+ transform: translate3d(0, -2rem, 0)
31
31
  }
32
32
  }
33
33
 
34
34
  @keyframes fade-in-up {
35
35
  0% {
36
36
  opacity: 0;
37
- transform: translate3d(0, 4rem, 0)
37
+ transform: translate3d(0, 2rem, 0)
38
38
  }
39
39
 
40
40
  100% {
@@ -6,111 +6,33 @@
6
6
  <body class="bg-light-gradient text-gray-700 text-sm font-normal dark:bg-dark-gradient dark:text-darkPrimary-300">
7
7
  <div class="p-4 bg-primary-900 electron-draggable electron-title-bar hidden electron-mobile-only"></div>
8
8
  <div class="md:p-5 main-container-padding">
9
- <div class="h-screen md:h-auto overflow-hidden md:rounded-lg flex shadow main-container"
9
+ <div class="h-screen md:h-auto md:rounded-lg flex shadow main-container"
10
10
  data-controller="mobile-menu"
11
11
  data-mobile-menu-hidden-class="hidden"
12
12
  >
13
+ <%= render "account/shared/menu/mobile" %>
13
14
 
14
- <% menu = capture do %>
15
- <div class="flex items-center flex-shrink-0 p-4 bg-primary-900 md:rounded-tl-lg electron-draggable electron-title-bar dark:bg-black dark:bg-opacity-10">
16
- <%= image_tag image_path("logo/logo.png"), class: 'theme-logo h-5 w-auto mx-auto' %>
17
-
18
- <div class="lg:hidden absolute right-0">
19
- <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"
20
- id="mobile-menu-close"
21
- data-action="mobile-menu#close"
22
- >
23
- <span class="sr-only">Close Application Menu</span>
24
- <svg class="h-6 w-6 text-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
25
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
26
- </svg>
27
- </button>
15
+ <% if BulletTrain::Themes::Light.navigation == :left %>
16
+ <div class="hidden lg:flex lg:flex-shrink-0 bg-gradient-to-b from-primary-700 to-primary-800 dark:from-darkPrimary-800 dark:to-darkPrimary-800 md:rounded-l-lg">
17
+ <div class="w-64">
18
+ <%= render "account/shared/menu/sidebar" %>
28
19
  </div>
29
20
  </div>
30
-
31
- <nav class="flex-1 space-y-1 overflow-y-auto select-none">
32
- <div class="flex-shrink-0 flex shadow px-5 py-4">
33
- <div class="flex-shrink-0 w-full group block no-underline">
34
- <div class="flex items-center">
35
- <div class="inline-block rounded-full border border-white p-1">
36
- <%= image_tag membership_profile_photo_url(current_membership), class: 'h-9 w-9 rounded-full', alt: current_user.name %>
37
- </div>
38
- <div class="ml-3">
39
- <div class="text-white">
40
- <%= current_user.name %>
41
- </div>
42
- <div class="text-2xs tracking-widest uppercase text-secondary-300 group-hover:text-white dark:text-gray-500">
43
- <%= current_team.name %>
44
- </div>
45
- </div>
46
- </div>
47
- </div>
48
- </div>
49
-
50
- <div class="px-5 py-4 menu">
51
- <%= render 'account/shared/menu' %>
52
- </div>
53
- </nav>
54
21
  <% end %>
55
22
 
56
- <div class="lg:hidden hidden"
57
- data-mobile-menu-target="wrapper"
58
- id="mobile-menu-backdrop"
59
- >
60
- <div class="fixed inset-0 flex z-40">
61
- <button
62
- data-mobile-menu-target="revealable"
63
- data-action="mobile-menu#close"
64
-
65
- data-transition-enter="transition-opacity ease-linear duration-200"
66
- data-transition-enter-start="opacity-0"
67
- data-transition-enter-end="opacity-100"
68
- data-transition-leave="transition-opacity ease-linear duration-200"
69
- data-transition-leave-start="opacity-100"
70
- data-transition-leave-end="opacity-0"
23
+ <div class="flex flex-col w-0 flex-1 bg-gray-100 dark:bg-darkPrimary-800 dark:border-gray-500 md:rounded-lg <%= BulletTrain::Themes::Light.navigation == :left ? "lg:border-l lg:rounded-l-none" : "" %>">
71
24
 
72
- class="hidden fixed inset-0" aria-hidden="true"
73
- >
74
- <div class="absolute inset-0 bg-light-gradient opacity-75"></div>
75
- </button>
76
- <div
77
- data-mobile-menu-target="revealable"
78
-
79
- data-transition-enter="transition ease-in-out duration-200 transform"
80
- data-transition-enter-start="-trandarkPrimary-x-full"
81
- data-transition-enter-end="trandarkPrimary-x-0"
82
- data-transition-leave="transition ease-in-out duration-200 transform"
83
- data-transition-leave-start="trandarkPrimary-x-0"
84
- data-transition-leave-end="-trandarkPrimary-x-full"
85
-
86
- class="hidden relative flex-1 flex flex-col max-w-xs w-full pb-4 bg-dark-gradient shadow-xl"
87
- >
88
- <%= menu %>
25
+ <% if BulletTrain::Themes::Light.navigation == :top %>
26
+ <div class="hidden lg:flex bg-gradient-to-b from-primary-700 to-primary-800 dark:from-darkPrimary-800 dark:to-darkPrimary-800 md:rounded-t-lg">
27
+ <%= render "account/shared/menu/top" %>
89
28
  </div>
90
- <div class="flex-shrink-0 w-14" aria-hidden="true"></div>
91
- </div>
92
- </div>
93
-
94
- <div class="hidden lg:flex lg:flex-shrink-0 overflow-y-auto bg-gradient-to-b from-primary-700 to-primary-800 dark:from-darkPrimary-800 dark:to-darkPrimary-800">
95
- <div class="w-64">
96
- <%= menu %>
97
- </div>
98
- </div>
29
+ <% end %>
99
30
 
100
- <div class="flex flex-col w-0 flex-1 overflow-y-auto bg-gray-100 dark:bg-darkPrimary-800 lg:border-l dark:border-gray-500">
101
31
  <main class="flex-1 relative z-0 focus:outline-none" tabindex="0">
102
32
  <div class="flex flex-row items-center shadow-sm electron-draggable">
103
- <button class="lg:hidden h-12 w-12 ml-1 flex-none inline-flex items-center justify-center rounded-md text-gray-500 hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-blue-500"
104
- id="mobile-menu-open"
105
- data-action="mobile-menu#open"
106
- >
107
- <span class="sr-only">Open Application Menu</span>
108
- <svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
109
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
110
- </svg>
111
- </button>
33
+ <%= render "account/shared/menu/open" %>
112
34
 
113
- <nav class="flex px-1 lg:px-4 py-2 overflow-x-auto select-none" aria-label="Breadcrumb">
35
+ <nav class="flex px-1 lg:px-4 py-2 select-none" aria-label="Breadcrumb">
114
36
  <ol class="breadcrumb whitespace-nowrap flex items-center space-x-3 py-0.5 pr-3">
115
37
  <%= render('breadcrumbs').strip.html_safe %>
116
38
  </ol>
@@ -0,0 +1,22 @@
1
+ <% expand ||= false %>
2
+ <% hide_shadow ||= false %>
3
+
4
+ <div class="relative <%= "group" unless expand %> <%= "shadow" unless hide_shadow %>">
5
+ <%= render "account/shared/menu/user" %>
6
+ <div class="invisible group-hover:visible">
7
+ <div class="absolute top-0 left-0 right-0 z-50">
8
+ <%= render "account/shared/menu/user" %>
9
+ </div>
10
+ <div class="absolute transition duration-150 scale-95 group-hover:scale-100 translate-y-1 group-hover:translate-y-0 bg-primary-700 -top-0 left-0 right-0 -m-2 p-2 rounded-lg z-40 shadow">
11
+ <div class="invisible">
12
+ <%= render "account/shared/menu/user", expand: expand %>
13
+ </div>
14
+ <div class="p-3 <% @menu_orientation == :top ? "" : "pt-0" %>">
15
+ <% @last_menu_orientation = @menu_orientation %>
16
+ <% @menu_orientation = :side %>
17
+ <%= render "account/shared/menu/user_items" %>
18
+ <% @menu_orientation = @last_menu_orientation%>
19
+ </div>
20
+ </div>
21
+ </div>
22
+ </div>
@@ -0,0 +1,11 @@
1
+ <div class="lg:hidden absolute right-0">
2
+ <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"
3
+ id="mobile-menu-close"
4
+ data-action="mobile-menu#close"
5
+ >
6
+ <span class="sr-only">Close Application Menu</span>
7
+ <svg class="h-6 w-6 text-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
8
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
9
+ </svg>
10
+ </button>
11
+ </div>
@@ -3,7 +3,7 @@
3
3
  <% method ||= nil %>
4
4
  <% active ||= request.path == url %>
5
5
 
6
- <%= send (method ? :button_to : :link_to), url, class: "block group hover:text-white hover:no-underline hover-indent-child #{'bg-primary-900 dark:bg-black dark:bg-opacity-10' if active} text-white px-2 py-2 rounded-md dark:text-white", method: method do %>
6
+ <%= send (method ? :button_to : :link_to), url, class: "block group hover:text-white hover:no-underline #{'bg-primary-900 dark:bg-black dark:bg-opacity-10' if active} text-white #{@menu_orientation == :top ? "px-5 py-5" : "px-2 py-2 rounded-md hover-indent-child"} #{"rounded-tl-lg" unless @not_first} dark:text-white", method: method do %>
7
7
  <div class="inline-block indent-child flex items-center">
8
8
  <!-- Heroicon name: home -->
9
9
  <% if p.content_for? :icon %>
@@ -14,3 +14,6 @@
14
14
  <%= label %>
15
15
  </div>
16
16
  <% end %>
17
+
18
+ <% # Ugly, but works. %>
19
+ <% @not_first = true %>
@@ -0,0 +1,6 @@
1
+ <% if BulletTrain::Themes::Light.show_logo_in_account %>
2
+ <div class="flex items-center flex-shrink-0 p-4 bg-primary-900 md:rounded-tl-lg electron-draggable electron-title-bar dark:bg-black dark:bg-opacity-10">
3
+ <%= image_tag image_path("logo/logo.png"), class: 'theme-logo h-5 w-auto mx-auto' %>
4
+ <%= render "account/shared/menu/close" %>
5
+ </div>
6
+ <% end %>
@@ -0,0 +1,40 @@
1
+ <% # Ugly, but works. %>
2
+ <% @menu_orientation = :side %>
3
+
4
+ <div class="lg:hidden hidden"
5
+ data-mobile-menu-target="wrapper"
6
+ id="mobile-menu-backdrop"
7
+ >
8
+ <div class="fixed inset-0 flex z-40">
9
+ <button
10
+ data-mobile-menu-target="revealable"
11
+ data-action="mobile-menu#close"
12
+
13
+ data-transition-enter="transition-opacity ease-linear duration-200"
14
+ data-transition-enter-start="opacity-0"
15
+ data-transition-enter-end="opacity-100"
16
+ data-transition-leave="transition-opacity ease-linear duration-200"
17
+ data-transition-leave-start="opacity-100"
18
+ data-transition-leave-end="opacity-0"
19
+
20
+ class="hidden fixed inset-0" aria-hidden="true"
21
+ >
22
+ <div class="absolute inset-0 bg-light-gradient opacity-75"></div>
23
+ </button>
24
+ <div
25
+ data-mobile-menu-target="revealable"
26
+
27
+ data-transition-enter="transition ease-in-out duration-200 transform"
28
+ data-transition-enter-start="-trandarkPrimary-x-full"
29
+ data-transition-enter-end="trandarkPrimary-x-0"
30
+ data-transition-leave="transition ease-in-out duration-200 transform"
31
+ data-transition-leave-start="trandarkPrimary-x-0"
32
+ data-transition-leave-end="-trandarkPrimary-x-full"
33
+
34
+ class="hidden relative flex-1 flex flex-col max-w-xs w-full pb-4 bg-dark-gradient shadow-xl"
35
+ >
36
+ <%= render "account/shared/menu/sidebar", expand: true %>
37
+ </div>
38
+ <div class="flex-shrink-0 w-14" aria-hidden="true"></div>
39
+ </div>
40
+ </div>
@@ -0,0 +1,9 @@
1
+ <button class="lg:hidden h-12 w-12 ml-1 flex-none inline-flex items-center justify-center rounded-md text-gray-500 hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-blue-500"
2
+ id="mobile-menu-open"
3
+ data-action="mobile-menu#open"
4
+ >
5
+ <span class="sr-only">Open Application Menu</span>
6
+ <svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
7
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
8
+ </svg>
9
+ </button>
@@ -1,6 +1,10 @@
1
- <div class="pb-3">
2
- <%= render 'account/shared/menu/heading' do %>
3
- <%= title %>
1
+ <% title ||= nil %>
2
+
3
+ <div class="<%= @menu_orientation == :top ? "grow flex flex-row" : "pb-3" %>">
4
+ <% if title %>
5
+ <%= render 'account/shared/menu/heading' do %>
6
+ <%= title %>
7
+ <% end %>
4
8
  <% end %>
5
9
 
6
10
  <%= yield %>
@@ -0,0 +1,13 @@
1
+ <% expand ||= false %>
2
+
3
+ <% # Ugly, but works. %>
4
+ <% @menu_orientation = :side %>
5
+
6
+ <%= render "account/shared/menu/logo" %>
7
+
8
+ <nav class="flex-1 space-y-1 select-none">
9
+ <%= render "account/shared/menu/account", expand: expand %>
10
+ <div class="px-5 py-4 menu">
11
+ <%= render 'account/shared/menu', expand: expand %>
12
+ </div>
13
+ </nav>
@@ -0,0 +1,34 @@
1
+ <% expand ||= false %>
2
+
3
+ <% if expand %>
4
+ <div class="mb-3">
5
+ <%= render 'account/shared/menu/heading' do %>
6
+ <%= title %>
7
+ <% end %>
8
+
9
+ <%= yield %>
10
+ </div>
11
+ <% else %>
12
+ <div>
13
+ <div class="inline-block relative group">
14
+ <%= render 'account/shared/menu/heading' do %>
15
+ <%= title %>
16
+
17
+ <svg class="inline-block flex-shrink-0 h-3 w-3" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
18
+ <path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" />
19
+ </svg>
20
+ <% end %>
21
+
22
+ <div class="invisible absolute group-hover:visible transition duration-200 scale-90 group-hover:scale-100 z-40
23
+ <%= @menu_orientation == :top ? "group-hover:translate-x-3 top-100 left-0 -ml-10 -mt-2 pt-4" : "group-hover:translate-x-3 top-0 left-full -mt-3 -ml-5 pl-4" %>
24
+ ">
25
+ <div class="bg-primary-700 rounded-lg py-3 px-4 w-56 shadow">
26
+ <% @last_menu_orientation = @menu_orientation %>
27
+ <% @menu_orientation = :side %>
28
+ <%= yield %>
29
+ <% @menu_orientation = @last_menu_orientation%>
30
+ </div>
31
+ </div>
32
+ </div>
33
+ </div>
34
+ <% end %>
@@ -0,0 +1,14 @@
1
+ <%= render "account/shared/menu/logo" %>
2
+
3
+ <% # Ugly, but works. %>
4
+ <% @menu_orientation = :top %>
5
+ <% @not_first = false %>
6
+
7
+ <nav class="w-full flex flex-row select-none items-center">
8
+ <div class="grow pr-5 menu flex flex-row items-center space-x-8">
9
+ <%= render 'account/shared/menu' %>
10
+ </div>
11
+ <div>
12
+ <%= render "account/shared/menu/account", hide_shadow: true %>
13
+ <div>
14
+ </nav>
@@ -0,0 +1,20 @@
1
+ <div class="flex-shrink-0 flex px-5 <%= @menu_orientation == :top ? "py-3" : "py-4" %>">
2
+ <div class="flex-shrink-0 w-full group block no-underline">
3
+ <div class="flex items-center">
4
+ <div class="inline-block rounded-full border border-white p-1">
5
+ <%= image_tag membership_profile_photo_url(current_membership), class: "#{@menu_orientation == :top ? "h-7 w-7" : "h-9 w-9"} rounded-full", alt: current_user.name %>
6
+ </div>
7
+ <div class="ml-3">
8
+ <div class="text-white">
9
+ <%= current_user.name %>
10
+ </div>
11
+ <div class="text-2xs tracking-widest uppercase text-secondary-300 group-hover:text-white dark:text-gray-500">
12
+ <%= current_team.name %>
13
+ </div>
14
+ </div>
15
+ <% unless BulletTrain::Themes::Light.show_logo_in_account %>
16
+ <%= render "account/shared/menu/close" %>
17
+ <% end %>
18
+ </div>
19
+ </div>
20
+ </div>
@@ -1,7 +1,7 @@
1
1
  module BulletTrain
2
2
  module Themes
3
3
  module Light
4
- VERSION = "1.2.1"
4
+ VERSION = "1.2.2"
5
5
  end
6
6
  end
7
7
  end
@@ -11,6 +11,8 @@ module BulletTrain
11
11
  mattr_accessor :color, default: :blue
12
12
  mattr_accessor :secondary_color, default: nil
13
13
  mattr_accessor :logo_color_shift, default: false
14
+ mattr_accessor :show_logo_in_account, default: false
15
+ mattr_accessor :navigation, default: :top
14
16
  mattr_accessor :original_devise_path
15
17
 
16
18
  class Theme < BulletTrain::Themes::TailwindCss::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.2.1
4
+ version: 1.2.2
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-12-15 00:00:00.000000000 Z
11
+ date: 2022-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard
@@ -118,9 +118,18 @@ files:
118
118
  - app/views/themes/light/layouts/_pricing.html.erb
119
119
  - app/views/themes/light/memberships/_photo.html.erb
120
120
  - app/views/themes/light/memberships/_photos.html.erb
121
+ - app/views/themes/light/menu/_account.html.erb
122
+ - app/views/themes/light/menu/_close.html.erb
121
123
  - app/views/themes/light/menu/_heading.html.erb
122
124
  - app/views/themes/light/menu/_item.html.erb
125
+ - app/views/themes/light/menu/_logo.html.erb
126
+ - app/views/themes/light/menu/_mobile.html.erb
127
+ - app/views/themes/light/menu/_open.html.erb
123
128
  - app/views/themes/light/menu/_section.html.erb
129
+ - app/views/themes/light/menu/_sidebar.html.erb
130
+ - app/views/themes/light/menu/_subsection.html.erb
131
+ - app/views/themes/light/menu/_top.html.erb
132
+ - app/views/themes/light/menu/_user.html.erb
124
133
  - app/views/themes/light/workflow/_box.html.erb
125
134
  - config/routes.rb
126
135
  - lib/bullet_train/themes/light.rb