bullet_train-themes-light 1.2.27 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/light/actiontext.css +10 -0
  3. data/app/assets/stylesheets/light/application.css +6 -12
  4. data/app/assets/stylesheets/light/fields/super_select.css +5 -1
  5. data/app/assets/stylesheets/light/fields/trix_editor.css +61 -11
  6. data/app/assets/stylesheets/light/tailwind/utilities/billing.css +4 -4
  7. data/app/views/showcase/engine/_head.html.erb +10 -0
  8. data/app/views/showcase/previews/field_partials/_about_field_partials.erb +23 -0
  9. data/app/views/showcase/previews/field_partials/_buttons.html.erb +13 -0
  10. data/app/views/showcase/previews/field_partials/_cloudinary_image.html.erb +6 -0
  11. data/app/views/showcase/previews/field_partials/_color_picker.html.erb +7 -0
  12. data/app/views/showcase/previews/field_partials/_date_and_time_field.html.erb +5 -0
  13. data/app/views/showcase/previews/field_partials/_date_field.html.erb +5 -0
  14. data/app/views/showcase/previews/field_partials/_email_field.html.erb +5 -0
  15. data/app/views/showcase/previews/field_partials/_emoji_field.html.erb +5 -0
  16. data/app/views/showcase/previews/field_partials/_file_field.html.erb +5 -0
  17. data/app/views/showcase/previews/field_partials/_number_field.html.erb +5 -0
  18. data/app/views/showcase/previews/field_partials/_options.html.erb +13 -0
  19. data/app/views/showcase/previews/field_partials/_password_field.html.erb +5 -0
  20. data/app/views/showcase/previews/field_partials/_phone_field.html.erb +5 -0
  21. data/app/views/showcase/previews/field_partials/_super_select.html.erb +9 -0
  22. data/app/views/showcase/previews/field_partials/_text_area.html.erb +5 -0
  23. data/app/views/showcase/previews/field_partials/_text_field.html.erb +10 -0
  24. data/app/views/showcase/previews/field_partials/_trix_editor.html.erb +5 -0
  25. data/app/views/showcase/previews/partials/_breadcrumb.html.erb +3 -4
  26. data/app/views/showcase/previews/tailwind/utilities/_spacing.html.erb +17 -1
  27. data/app/views/themes/light/_alert.html.erb +2 -2
  28. data/app/views/themes/light/actions/_action.html.erb +7 -7
  29. data/app/views/themes/light/attributes/_block.html.erb +2 -2
  30. data/app/views/themes/light/attributes/_progress_bar.html.erb +1 -1
  31. data/app/views/themes/light/conversations/_card.html.erb +1 -1
  32. data/app/views/themes/light/conversations/_comment.html.erb +2 -1
  33. data/app/views/themes/light/conversations/_message.html.erb +2 -2
  34. data/app/views/themes/light/fields/_field.html.erb +17 -17
  35. data/app/views/themes/light/layouts/_pricing.html.erb +2 -2
  36. data/app/views/themes/light/menu/_close.html.erb +1 -1
  37. data/app/views/themes/light/menu/_item.html.erb +2 -2
  38. data/app/views/themes/light/menu/_open.html.erb +2 -2
  39. data/app/views/themes/light/menu/_subsection.html.erb +1 -1
  40. data/config/locales/en/action_models.en.yml +9 -0
  41. data/config/locales/en/conversations.en.yml +4 -0
  42. data/config/locales/en/navigation.en.yml +5 -0
  43. data/lib/bullet_train/themes/light/version.rb +1 -1
  44. data/lib/bullet_train/themes/light.rb +0 -1
  45. data/lib/tasks/application.rb +74 -7
  46. metadata +29 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5a083a7c098f321b2edeb7d6594ec8bc9a748d2f510fedccf60603beb1919224
4
- data.tar.gz: 37fed326476d1e72d9d409ba635d3d7d09ce95b467cf72bf3ed7fc1f9b338504
3
+ metadata.gz: b04caae6cc2431e82ef3bea27ae888c28d48e7d21aa69ea5b6b1603712ecd114
4
+ data.tar.gz: b430318a48804afbe617461bf564b34900264bb8b9d444e583d30b86e220ef3d
5
5
  SHA512:
6
- metadata.gz: c9f16adf9ec4868c423158cbf2f89bec8de229fd19b644e066d64707b15848403deaf35fa63e7ee3c9138689305ce0733eea8cb6b3a4156dbb55a432662844b9
7
- data.tar.gz: '0299b5a2f41d6f64e73a1b73bb80b05e59694432288f96815f8becfe2dc163938da4eb45e034c8ee664b80c2c690dc79f46c42056c15190c5fad442bede6fcc9'
6
+ metadata.gz: 872483416e8ec76b973a4bab6b8ef44347e13a24914d2aa1285713d3dc67783d4ad5879ece18b8e619ba62ce82314731d1f24c8b7cc0b1d69e8f2d06f7f2249e
7
+ data.tar.gz: 2b7cc406e885fd8ad976a316a140467fb5d19c75570cc5a310812fc0f92fd144fc8d2e3069c30465421d372b615c65e22ee762cbe93377f4749274c296d93706
@@ -17,6 +17,16 @@
17
17
  }
18
18
  }
19
19
 
20
+ /* Override Tailwind's preflight styles */
21
+ /* https://github.com/tailwindlabs/tailwindcss/issues/989#issuecomment-506555308 */
22
+ ul {
23
+ list-style-type: disc;
24
+ }
25
+
26
+ ol {
27
+ list-style-type: decimal;
28
+ }
29
+
20
30
  action-text-attachment {
21
31
  .attachment {
22
32
  padding: 0 !important;
@@ -9,18 +9,6 @@
9
9
  @import './fields';
10
10
  @import './turn';
11
11
 
12
- /* TODO We should be able to do this in Tailwind CSS. */
13
- .hover-indent-child {
14
- .indent-child {
15
- transition: transform 0.2s ease;
16
- }
17
- &:hover {
18
- .indent-child {
19
- transform:translateX(8px);
20
- }
21
- }
22
- }
23
-
24
12
  form.button_to {
25
13
  @apply inline-block;
26
14
  input[type=submit] {
@@ -33,3 +21,9 @@ form.button_to {
33
21
 
34
22
  /* hide the first breadcrumb chevron */
35
23
  ol.breadcrumb li:first-child svg { display: none; }
24
+
25
+ /* Override Turbo's progress bar color with the application's theme. */
26
+ .turbo-progress-bar {
27
+ height: 5px;
28
+ @apply bg-primary-500;
29
+ }
@@ -39,6 +39,10 @@
39
39
  }
40
40
  }
41
41
 
42
+ .select2-results__option--highlighted {
43
+ @apply bg-primary-400 !important;
44
+ }
45
+
42
46
  @layer components {
43
47
  .select2-container {
44
48
  @apply w-full;
@@ -89,7 +93,7 @@
89
93
 
90
94
  .select2-container .select2-dropdown {
91
95
  @apply border-2 border-slate-300 shadow-sm overflow-hidden !important;
92
- border-color: #5897fb !important;
96
+ @apply border-primary-500 !important;
93
97
  }
94
98
 
95
99
  .select2-container--default .select2-results__option[aria-selected=true] {
@@ -11,18 +11,8 @@ trix-toolbar {
11
11
 
12
12
  /* Override Tailwind's preflight styles */
13
13
  /* https://github.com/tailwindlabs/tailwindcss/issues/989#issuecomment-506555308 */
14
- trix-editor ul {
15
- list-style-type: disc;
16
- padding-left: 2.5rem;
17
- }
18
-
19
- trix-editor ol {
20
- list-style-type: decimal;
21
- padding-left: 2.5rem;
22
- }
23
-
24
14
  .trix-button {
25
- @apply dark:bg-slate-300 !important;
15
+ @apply dark:bg-slate-800 !important;
26
16
  }
27
17
 
28
18
  /* Prevent red ring on Trix Editor */
@@ -113,3 +103,63 @@ trix-editor {
113
103
  .trix-content {
114
104
  @apply text-base md:text-sm;
115
105
  }
106
+
107
+ /* The Trix Editor uses SVGs for its buttons, so we manually override them here for dark mode */
108
+ /* Icons taken from https://react-icons.github.io/react-icons/icons?name=md */
109
+ @media (prefers-color-scheme: dark) {
110
+ .trix-button--icon-bold::before {
111
+ background-image: url('data:image/svg+xml;utf-8,<svg stroke="currentColor" fill="%23FFFFFF" stroke-width="0" viewBox="0 0 24 24" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M0 0h24v24H0z"></path><path d="M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79 0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79 0-1.52-.86-2.82-2.15-3.42zM10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3v-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z"></path></svg>') !important;
112
+ }
113
+
114
+ .trix-button--icon-italic::before {
115
+ background-image: url('data:image/svg+xml;utf-8,<svg stroke="currentColor" fill="%23FFFFFF" stroke-width="0" viewBox="0 0 24 24" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M0 0h24v24H0z"></path><path d="M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4z"></path></svg>') !important;
116
+ }
117
+
118
+ .trix-button--icon-strike::before {
119
+ background-image: url('data:image/svg+xml;utf8,<svg stroke="currentColor" fill="%23FFFFFF" stroke-width="0" viewBox="0 0 24 24" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M0 0h24v24H0z"></path><path d="M6.85 7.08C6.85 4.37 9.45 3 12.24 3c1.64 0 3 .49 3.9 1.28.77.65 1.46 1.73 1.46 3.24h-3.01c0-.31-.05-.59-.15-.85-.29-.86-1.2-1.28-2.25-1.28-1.86 0-2.34 1.02-2.34 1.7 0 .48.25.88.74 1.21.38.25.77.48 1.41.7H7.39c-.21-.34-.54-.89-.54-1.92zM21 12v-2H3v2h9.62c1.15.45 1.96.75 1.96 1.97 0 1-.81 1.67-2.28 1.67-1.54 0-2.93-.54-2.93-2.51H6.4c0 .55.08 1.13.24 1.58.81 2.29 3.29 3.3 5.67 3.3 2.27 0 5.3-.89 5.3-4.05 0-.3-.01-1.16-.48-1.94H21V12z"></path></svg>') !important;
120
+ }
121
+
122
+ .trix-button--icon-link::before {
123
+ background-image: url('data:image/svg+xml;utf8,<svg stroke="currentColor" fill="%23FFFFFF" stroke-width="0" viewBox="0 0 24 24" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M0 0h24v24H0z"></path><path d="M8 11h8v2H8v-2zm12.1 1H22c0-2.76-2.24-5-5-5h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1zM3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM19 12h-2v3h-3v2h3v3h2v-3h3v-2h-3v-3z"></path></svg>') !important;
124
+ }
125
+
126
+ .trix-button--icon-heading-1::before {
127
+ background-image: url('data:image/svg+xml;utf8,<svg stroke="currentColor" fill="%23FFFFFF" stroke-width="0" viewBox="0 0 24 24" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M0 0h24v24H0z"></path><path d="M9 4v3h5v12h3V7h5V4H9zm-6 8h3v7h3v-7h3V9H3v3z"></path></svg>') !important;
128
+ }
129
+
130
+ .trix-button--icon-quote::before {
131
+ background-image: url('data:image/svg+xml;utf8,<svg stroke="currentColor" fill="%23FFFFFF" stroke-width="0" viewBox="0 0 24 24" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M0 0h24v24H0z"></path><path d="M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z"></path></svg>') !important;
132
+ }
133
+
134
+ .trix-button--icon-code::before {
135
+ background-image: url('data:image/svg+xml;utf8,<svg stroke="currentColor" fill="%23FFFFFF" stroke-width="0" viewBox="0 0 24 24" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M0 0h24v24H0V0z"></path><path d="M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"></path></svg>') !important;
136
+ }
137
+
138
+ .trix-button--icon-bullet-list::before {
139
+ background-image: url('data:image/svg+xml;utf8,<svg stroke="currentColor" fill="%23FFFFFF" stroke-width="0" viewBox="0 0 24 24" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M0 0h24v24H0V0z"></path><path d="M4 10.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5zm0-6c-.83 0-1.5.67-1.5 1.5S3.17 7.5 4 7.5 5.5 6.83 5.5 6 4.83 4.5 4 4.5zm0 12c-.83 0-1.5.68-1.5 1.5s.68 1.5 1.5 1.5 1.5-.68 1.5-1.5-.67-1.5-1.5-1.5zM7 19h14v-2H7v2zm0-6h14v-2H7v2zm0-8v2h14V5H7z"></path></svg>') !important;
140
+ }
141
+
142
+ .trix-button--icon-number-list::before {
143
+ background-image: url('data:image/svg+xml;utf8,<svg stroke="currentColor" fill="%23FFFFFF" stroke-width="0" viewBox="0 0 24 24" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M0 0h24v24H0z"></path><path d="M2 17h2v.5H3v1h1v.5H2v1h3v-4H2v1zm1-9h1V4H2v1h1v3zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2v1zm5-6v2h14V5H7zm0 14h14v-2H7v2zm0-6h14v-2H7v2z"></path></svg>') !important;
144
+ }
145
+
146
+ .trix-button--icon-decrease-nesting-level::before {
147
+ background-image: url('data:image/svg+xml;utf8,<svg stroke="currentColor" fill="%23FFFFFF" stroke-width="0" viewBox="0 0 24 24" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M0 0h24v24H0z"></path><path d="M11 17h10v-2H11v2zm-8-5l4 4V8l-4 4zm0 9h18v-2H3v2zM3 3v2h18V3H3zm8 6h10V7H11v2zm0 4h10v-2H11v2z"></path></svg>') !important;
148
+ }
149
+
150
+ .trix-button--icon-increase-nesting-level::before {
151
+ background-image: url('data:image/svg+xml;utf8,<svg stroke="currentColor" fill="%23FFFFFF" stroke-width="0" viewBox="0 0 24 24" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M0 0h24v24H0z"></path><path d="M3 21h18v-2H3v2zM3 8v8l4-4-4-4zm8 9h10v-2H11v2zM3 3v2h18V3H3zm8 6h10V7H11v2zm0 4h10v-2H11v2z"></path></svg>') !important;
152
+ }
153
+
154
+ .trix-button--icon-attach::before {
155
+ background-image: url('data:image/svg+xml;utf8,<svg stroke="currentColor" fill="%23FFFFFF" stroke-width="0" viewBox="0 0 24 24" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M0 0h24v24H0z"></path><path d="M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5a2.5 2.5 0 015 0v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5a2.5 2.5 0 005 0V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6h-1.5z"></path></svg>') !important;
156
+ }
157
+
158
+ .trix-button--icon-undo::before {
159
+ background-image: url('data:image/svg+xml;utf8,<svg stroke="currentColor" fill="%23FFFFFF" stroke-width="0" viewBox="0 0 24 24" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M0 0h24v24H0V0z"></path><path d="M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"></path></svg>') !important;
160
+ }
161
+
162
+ .trix-button--icon-redo::before {
163
+ background-image: url('data:image/svg+xml;utf8,<svg stroke="currentColor" fill="%23FFFFFF" stroke-width="0" viewBox="0 0 24 24" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M0 0h24v24H0z"></path><path d="M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"></path></svg>') !important;
164
+ }
165
+ }
@@ -26,8 +26,8 @@
26
26
  top: -200px;
27
27
  width: 1000px;
28
28
  height: 600px;
29
- background-image: linear-gradient(90deg, rgba(227,231,248,0) 0%, #E8F2FC 100%);
30
29
  z-index: -1;
30
+ @apply bg-primary-200 bg-gradient-to-r from-white
31
31
  }
32
32
 
33
33
  position: absolute;
@@ -35,9 +35,9 @@
35
35
  top: 0px;
36
36
  width: 800px;
37
37
  height: 600px;
38
- background-image: linear-gradient(90deg, rgba(227,231,248,0) 0%, #8BBAF5 100%);
39
38
  transform: translate(-360px, 0px) rotate(-45deg);
40
39
  z-index: -1;
40
+ @apply bg-primary-400 bg-gradient-to-r from-white
41
41
  }
42
42
 
43
43
  .brand-title {
@@ -66,6 +66,6 @@
66
66
  background-attachment: scroll;
67
67
  background-clip: text;
68
68
  background-color: rgba(0,0,0,0);
69
- background-image: -webkit-linear-gradient(-75deg, #c094de 10%, #65A8F1 50%, #006EF4 95%);
69
+ @apply bg-slate-800 bg-gradient-to-r from-primary-500
70
70
  }
71
- }
71
+ }
@@ -0,0 +1,10 @@
1
+ <%= stylesheet_link_tag "application" %>
2
+ <%= javascript_include_tag "application" %>
3
+
4
+ <script>
5
+ const color = "<%= BulletTrain::Themes::Light.color %>"
6
+ const secondaryColor = "<%= BulletTrain::Themes::Light.secondary_color %>"
7
+
8
+ if (color) document.documentElement.classList.add(`theme-${color}`)
9
+ if (secondaryColor) document.documentElement.classList.add(`theme-secondary-${secondaryColor}`)
10
+ </script>
@@ -0,0 +1,23 @@
1
+ <% showcase.description do %>
2
+ When you're building forms, use Bullet Train's Field Partials for your form fields. They DRY-up all the presentation logic without needing a third-party dependency like Formtastic.
3
+ <br/>
4
+ <br/>
5
+ Read much more about them in the extensive <a href="https://bullettrain.co/docs/field-partials" target="_blank">developer documentation</a>.
6
+ <% end %>
7
+
8
+ <% form_with model: Scaffolding::CompletelyConcrete::TangibleThing.new, url: "#" do |form| %>
9
+ <% yield form %>
10
+ <% end %>
11
+
12
+ <%# To display further options use `showcase.options.x` as options with a block will clear the old options. See `_options.html.erb` for an example. %>
13
+ <% showcase.options do |o| %>
14
+ <% o.required :form, "Reference to the form object", type: "ActionView::Helpers::FormBuilder" %>
15
+ <% o.required :method, "Attribute of the model" %>
16
+ <% o.optional :options, "Options passed directly to the underlying Rails form field helper.", default: {} %>
17
+ <% o.optional :other_options, "Additional options for things like hiding labels, displaying specific error messages, etc.", default: {} %>
18
+ <% o.optional "other_options[:icon]", "Display an icon." %>
19
+ <% o.optional "other_options[:label]", "Display a specific field label." %>
20
+ <% o.optional "other_options[:hide_label]", "Hide the field label.", default: false %>
21
+ <% o.optional "other_options[:help]", "Display a specific help string." %>
22
+ <% o.optional "other_options[:error]", "Display a specific error string." %>
23
+ <% end %>
@@ -0,0 +1,13 @@
1
+ <%= render "showcase/previews/field_partials/about_field_partials", showcase: showcase do |form| %>
2
+ <% showcase.sample "Single Basic Button" do %>
3
+ <%= render "shared/fields/buttons", form: form, method: :button_value %>
4
+ <% end %>
5
+
6
+ <% showcase.sample "Multiple Buttons" do %>
7
+ <%= render "shared/fields/buttons", form: form, method: :multiple_button_values, multiple: true %>
8
+ <% end %>
9
+
10
+ <% showcase.sample "Boolean Button" do %>
11
+ <%= render "shared/fields/buttons", form: form, method: :boolean_button_value %>
12
+ <% end %>
13
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <%= render "showcase/previews/field_partials/about_field_partials", showcase: showcase do |form| %>
2
+ <% showcase.sample "Basic", description: "Requires an `ENV['CLOUDINARY_URL']` is set to render anything." do %>
3
+ <%= "ENV['CLOUDINARY_URL'] hasn't been set." unless cloudinary_enabled? %>
4
+ <%= render 'shared/fields/cloudinary_image', form: form, method: :cloudinary_image_value %>
5
+ <% end %>
6
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <%= render "showcase/previews/field_partials/about_field_partials", showcase: showcase do |form| %>
2
+ <% showcase.sample "Basic" do %>
3
+ <%= render 'shared/fields/color_picker', form: form,
4
+ method: :color_picker_value,
5
+ options: {color_picker_options: t('scaffolding/completely_concrete/tangible_things.fields.color_picker_value.options')} %>
6
+ <% end %>
7
+ <% end %>
@@ -0,0 +1,5 @@
1
+ <%= render "showcase/previews/field_partials/about_field_partials", showcase: showcase do |form| %>
2
+ <% showcase.sample "Basic" do %>
3
+ <%= render 'shared/fields/date_and_time_field', form: form, method: :created_at %>
4
+ <% end %>
5
+ <% end %>
@@ -0,0 +1,5 @@
1
+ <%= render "showcase/previews/field_partials/about_field_partials", showcase: showcase do |form| %>
2
+ <% showcase.sample "Basic" do %>
3
+ <%= render 'shared/fields/date_field', form: form, method: :created_at %>
4
+ <% end %>
5
+ <% end %>
@@ -0,0 +1,5 @@
1
+ <%= render "showcase/previews/field_partials/about_field_partials", showcase: showcase do |form| %>
2
+ <% showcase.sample "Basic" do %>
3
+ <%= render 'shared/fields/email_field', form: form, method: :email_field_value %>
4
+ <% end %>
5
+ <% end %>
@@ -0,0 +1,5 @@
1
+ <%= render "showcase/previews/field_partials/about_field_partials", showcase: showcase do |form| %>
2
+ <% showcase.sample "Basic" do %>
3
+ <%= render 'shared/fields/emoji_field', form: form, method: :text_field_value %>
4
+ <% end %>
5
+ <% end %>
@@ -0,0 +1,5 @@
1
+ <%= render "showcase/previews/field_partials/about_field_partials", showcase: showcase do |form| %>
2
+ <% showcase.sample "Basic" do %>
3
+ <%= render 'shared/fields/file_field', form: form, method: :file_field_value %>
4
+ <% end %>
5
+ <% end %>
@@ -0,0 +1,5 @@
1
+ <%= render "showcase/previews/field_partials/about_field_partials", showcase: showcase do |form| %>
2
+ <% showcase.sample "Basic" do %>
3
+ <%= render 'shared/fields/number_field', form: form, method: :number_field_value %>
4
+ <% end %>
5
+ <% end %>
@@ -0,0 +1,13 @@
1
+ <%= render "showcase/previews/field_partials/about_field_partials", showcase: showcase do |form| %>
2
+ <% showcase.sample "Single Option" do %>
3
+ <%= render 'shared/fields/options', form: form, method: :option_value %>
4
+ <% end %>
5
+
6
+ <% showcase.sample "Multiple Option" do %>
7
+ <%= render 'shared/fields/options', form: form, method: :multiple_option_values, multiple: true, show_select_all_top: true %>
8
+ <% end %>
9
+ <% end %>
10
+
11
+ <% showcase.options.optional :multiple, "Whether to select single or multiple values", default: false %>
12
+ <% showcase.options.optional :show_select_all_top, "Whether to put the select all toggle before the options", default: false %>
13
+ <% showcase.options.optional :show_select_all_bottom, "Whether to put the select all toggle after the options", default: false %>
@@ -0,0 +1,5 @@
1
+ <%= render "showcase/previews/field_partials/about_field_partials", showcase: showcase do |form| %>
2
+ <% showcase.sample "Basic" do %>
3
+ <%= render 'shared/fields/password_field', form: form, method: :password_field_value %>
4
+ <% end %>
5
+ <% end %>
@@ -0,0 +1,5 @@
1
+ <%= render "showcase/previews/field_partials/about_field_partials", showcase: showcase do |form| %>
2
+ <% showcase.sample "Basic" do %>
3
+ <%= render 'shared/fields/phone_field', form: form, method: :phone_field_value %>
4
+ <% end %>
5
+ <% end %>
@@ -0,0 +1,9 @@
1
+ <%= render "showcase/previews/field_partials/about_field_partials", showcase: showcase do |form| %>
2
+ <% showcase.sample "Single Select" do %>
3
+ <%= render 'shared/fields/super_select', form: form, method: :super_select_value, other_options: {search: true} %>
4
+ <% end %>
5
+
6
+ <% showcase.sample "Multiple Select" do %>
7
+ <%= render 'shared/fields/super_select', form: form, method: :multiple_super_select_values, other_options: {search: true}, html_options: {multiple: true} %>
8
+ <% end %>
9
+ <% end %>
@@ -0,0 +1,5 @@
1
+ <%= render "showcase/previews/field_partials/about_field_partials", showcase: showcase do |form| %>
2
+ <% showcase.sample "Basic" do %>
3
+ <%= render 'shared/fields/text_area', form: form, method: :text_area_value %>
4
+ <% end %>
5
+ <% end %>
@@ -0,0 +1,10 @@
1
+ <%= render "showcase/previews/field_partials/about_field_partials", showcase: showcase do |form| %>
2
+ <% showcase.sample "Basic" do %>
3
+ <%= render 'shared/fields/text_field', form: form, method: :text_field_value %>
4
+ <% end %>
5
+
6
+ <% showcase.sample "With Icon" do %>
7
+ <%= render 'shared/fields/text_field', form: form, icon: 'Test', method: :text_field_value,
8
+ other_options: { label: 'New Label', hide_label: true, help: 'I am help text', error: "Error Text", icon: 'fal fa-sign-out ti ti-close' } %>
9
+ <% end %>
10
+ <% end %>
@@ -0,0 +1,5 @@
1
+ <%= render "showcase/previews/field_partials/about_field_partials", showcase: showcase do |form| %>
2
+ <% showcase.sample "Basic" do %>
3
+ <%= render 'shared/fields/trix_editor', form: form, method: :trix_editor_value %>
4
+ <% end %>
5
+ <% end %>
@@ -5,10 +5,9 @@
5
5
  </ul>
6
6
  <% end %>
7
7
 
8
- <%# TODO: Find a suitable url_for GET route here that every BulletTrain app would have. %>
9
- <%# showcase.sample "With model url_for" do %>
10
- <%#= render "shared/breadcrumb", url: [:account, Scaffolding::CompletelyConcrete::TangibleThing.new(id: 1)], label: "Concept" %>
11
- <%# end %>
8
+ <% showcase.sample "With model url_for" do %>
9
+ <%= render 'account/shared/breadcrumb', label: t('memberships.label'), url: [:account, current_team, :memberships] %>
10
+ <% end %>
12
11
 
13
12
  <% showcase.options do |o| %>
14
13
  <% o.required :label, "The breadcrumb text, either shown in the link or the plain label" %>
@@ -18,4 +18,20 @@
18
18
  </div>
19
19
  <% end %>
20
20
 
21
- <% # TODO Add `gap-y` and `gap-x`. %>
21
+ <% showcase.sample "Vertical Gaps" do %>
22
+ <div class="grid gap-y">
23
+ <div class="button block">Item</div>
24
+ <div class="button block">Item</div>
25
+ <div class="button block">Item</div>
26
+ <div class="button block">Item</div>
27
+ </div>
28
+ <% end %>
29
+
30
+ <% showcase.sample "Horizontal Gaps" do %>
31
+ <div class="flex gap-x">
32
+ <div class="flex-1 button">Item</div>
33
+ <div class="flex-1 button">Item</div>
34
+ <div class="flex-1 button">Item</div>
35
+ <div class="flex-1 button">Item</div>
36
+ </div>
37
+ <% end %>
@@ -7,8 +7,8 @@ when :yellow
7
7
  div_classes = "bg-amber-100 border-amber-200"
8
8
  header_classes = "text-amber-800"
9
9
  when :red
10
- div_classes = "bg-red-300 border-red-400"
11
- header_classes = "text-red-700"
10
+ div_classes = "bg-red-100 dark:bg-red-900 border-red-200 dark:border-red-700"
11
+ header_classes = "text-red-900 dark:text-red-100"
12
12
  end
13
13
  %>
14
14
 
@@ -34,22 +34,22 @@
34
34
  <% if action.completed? %>
35
35
  <% if action.is_a?(Actions::HasProgress) %>
36
36
  <div class="uppercase text-xs text-slate-400">
37
- Processed <%= action.performed_count %> of <%= action.target_count %> <%= display_date_and_time(action.completed_at) %>
37
+ <%= t('action_models.processed_of', performed_count: action.performed_count, target_count: action.target_count, at: display_date_and_time(action.completed_at)) %>
38
38
  </div>
39
39
  <% else %>
40
40
  <div class="uppercase text-xs text-slate-400">
41
- Processed <%= display_date_and_time(action.completed_at) %>
41
+ <%= t('action_models.processed', at: display_date_and_time(action.completed_at)) %>
42
42
  </div>
43
43
  <% end %>
44
44
 
45
45
  <% elsif action.is_a?(Actions::RequiresApproval) && !action.approved? %>
46
46
  <div class="uppercase text-xs text-slate-400">
47
- Awaiting approval
47
+ <%= t('action_models.awaiting') %>
48
48
  </div>
49
49
 
50
50
  <% elsif action.is_a?(Actions::SupportsScheduling) && action.scheduled_for && !action.started? %>
51
51
  <div class="uppercase text-xs text-slate-400">
52
- Scheduled for <%= display_date_and_time(action.scheduled_for) %>
52
+ <%= t('action_models.scheduled_for', at: display_date_and_time(action.scheduled_for)) %>
53
53
  </div>
54
54
 
55
55
  <% elsif action.is_a?(Actions::HasProgress) && action.started? %>
@@ -58,17 +58,17 @@
58
58
  </div>
59
59
 
60
60
  <div class="mt-2 uppercase text-xs text-slate-400">
61
- Processing <%= action.performed_count %> of <%= action.target_count %>
61
+ <%= t('action_models.processing_of', performed_count: action.performed_count, target_count: action.target_count) %>
62
62
  </div>
63
63
 
64
64
  <% elsif action.is_a?(Actions::HasProgress) %>
65
65
  <div class="uppercase text-xs text-slate-400">
66
- Preparing to process <%= action.performed_count %> of <%= action.target_count %>
66
+ <%= t('action_models.preparing_to_process_of', performed_count: action.performed_count, target_count: action.target_count) %>
67
67
  </div>
68
68
 
69
69
  <% else %>
70
70
  <div class="uppercase text-xs text-slate-400">
71
- Preparing to process
71
+ <%= t('action_models.preparing_to_process') %>
72
72
  </div>
73
73
 
74
74
  <% end %>
@@ -2,8 +2,8 @@
2
2
  <% strategy ||= current_attributes_strategy || :none %>
3
3
  <% url ||= nil %>
4
4
 
5
- <% if object.send(attribute).present? %>
5
+ <% if object.public_send(attribute).present? %>
6
6
  <%= render 'shared/attributes/attribute', object: object, attribute: attribute, strategy: strategy, url: url do %>
7
- <pre><%= object.send(attribute) %></pre>
7
+ <pre><%= object.public_send(attribute) %></pre>
8
8
  <% end %>
9
9
  <% end %>
@@ -4,7 +4,7 @@
4
4
  <% hide_completed ||= false %>
5
5
 
6
6
  <% if object.send(total).present? %>
7
- <% completion_percent = (object.send(attribute).to_f / object.send(total).to_f) * 100.0 %>
7
+ <% completion_percent = (object.public_send(attribute).to_f / object.send(total).to_f) * 100.0 %>
8
8
 
9
9
  <% unless completion_percent == 100 && hide_completed %>
10
10
  <%= render 'shared/attributes/attribute', object: object, attribute: "#{attribute}_over_#{total}".to_sym, strategy: strategy, url: url do %>
@@ -7,7 +7,7 @@
7
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
8
  </div>
9
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-slate-300 text-right hover:no-underline"><%= "#{time_ago_in_words conversation.last_message.created_at} ago" unless conversation.last_message.nil? %></p>
10
+ <p class="text-xs text-slate-300 text-right hover:no-underline"><%= "#{t('global.time_ago', time: time_ago_in_words(conversation.last_message.created_at))}" if conversation.last_message.present? %></p>
11
11
  <h2 class="<%= subscription.unread? ? 'font-bold text-slate-800' : 'font-semibold text-slate-600' %> "><%= conversation.subject&.label_string %></h2>
12
12
  <div class="text-slate-300">
13
13
  <%= conversation.last_message&.user&.label_string %>
@@ -7,7 +7,8 @@
7
7
  <div class="flex py-3 px-2 text-slate-700 <%= message.reply? ? 'border w-full bg-slate-50 rounded-md' : 'border-b' %> <%= 'opacity-30' if new_message %>">
8
8
  <div class="mr-3 min-w-max"><%= avatar %></div>
9
9
  <div class="flex flex-col w-full">
10
- <div class=""><span class="uppercase font-bold text-slate-500"><%= message.user.name %></span><span class="font-extralight text-xs text-slate-400"> &bull; <%= time_ago_in_words message.created_at %> ago</span></div>
10
+ <div class=""><span class="uppercase font-bold text-slate-500"><%= message.user.name %></span><span class="font-extralight text-xs text-slate-400"> &bull; <%= t("global.time_ago", time: time_ago_in_words(message.created_at)) %>
11
+ </span></div>
11
12
  <div class="py-2"><%= trix_sanitize message.body %></div>
12
13
  <% if message.replies.any? %>
13
14
  <div class="space-y-2 mt-2 mb-2">
@@ -34,7 +34,7 @@
34
34
 
35
35
  <% rounding_modifier = message_corner_class(next_message_in_series, current_user_message) %>
36
36
 
37
- <% timestamp = next_message_in_series || show_as_thread ? '' : time_ago_in_words(message.created_at) + " ago" %>
37
+ <% timestamp = next_message_in_series || show_as_thread ? '' : t("global.time_ago", time: time_ago_in_words(message.created_at)) %>
38
38
 
39
39
  <% threaded_message = message.threaded? %>
40
40
  <% thread_started_by_current_user = message.thread_origin_user == current_author %>
@@ -126,7 +126,7 @@
126
126
  <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"/>
127
127
  </svg>
128
128
  <div class="flex flex-col mr-10 min-w-max">
129
- <div class="pt-0 mr-2 ml-4 text-xxs"><%= reply.membership.label_string %> reply: </div>
129
+ <div class="pt-0 mr-2 ml-4 text-xxs"><%= reply.membership.label_string %> <%= t('conversations.message.reply') %></div>
130
130
  <div class="bg-slate-100 rounded py-2 px-4 mt-0 text-slate-400 max-w-md"><%= reply.body.html_safe %></div>
131
131
  </div>
132
132
  </div>
@@ -1,4 +1,11 @@
1
- <% yield %>
1
+ <%
2
+ %i[label field error help after_help].each do |key|
3
+ if (content = content_for(key).presence)
4
+ flush_content_for key
5
+ partial.section key, content
6
+ end
7
+ end
8
+ %>
2
9
 
3
10
  <%
4
11
  form ||= current_fields_form
@@ -12,7 +19,7 @@ other_options ||= {}
12
19
  other_options[:help] = [other_options[:help], labels.help].compact.join(" ")
13
20
 
14
21
  errors = [method, method.to_s.gsub(/_id$/, '').to_sym].uniq.map { |attribute| form.object.errors.full_messages_for(attribute) }.flatten
15
- has_errors = errors.any? || content_for(:error).present? || other_options[:error].present?
22
+ has_errors = errors.any? || partial.error? || other_options[:error].present?
16
23
 
17
24
  options[:class] = "#{options[:class]} block w-full rounded-md shadow-sm font-light text-sm dark:bg-slate-800 dark:text-slate-300"
18
25
 
@@ -28,9 +35,8 @@ end
28
35
 
29
36
  <% # the label. %>
30
37
  <% unless other_options[:hide_label] == true %>
31
- <% if content_for? :label %>
32
- <%= yield :label %>
33
- <% flush_content_for :label %>
38
+ <% if partial.label? %>
39
+ <%= partial.label %>
34
40
  <% else %>
35
41
  <% # allow the label to be defined via an inline option or else one of the locale yaml definitions. %>
36
42
  <% label = (other_options[:label].presence || labels.label || legacy_label_for(form, method)) %>
@@ -39,24 +45,20 @@ end
39
45
  <% end %>
40
46
 
41
47
  <div class="mt-1.5">
42
-
43
48
  <% # the actual field. %>
44
- <% if content_for? :field %>
45
- <%= yield :field %>
46
- <% flush_content_for :field %>
49
+ <% if partial.field? %>
50
+ <%= partial.field %>
47
51
  <% else %>
48
52
  <% # e.g. form.text_field(method, options) %>
49
53
  <%= form.send(helper, method, options) %>
50
54
  <% end %>
51
-
52
55
  </div>
53
56
 
54
57
  <% # any error messages. %>
55
58
  <% if has_errors %>
56
59
  <p class="mt-1.5 text-xs text-red-500">
57
60
  <%= errors.map { |error| error + ". " }.join %>
58
- <%= yield :error %>
59
- <% flush_content_for :error %>
61
+ <%= partial.error %>
60
62
  <% if other_options[:hide_custom_error].blank? %>
61
63
  <%= other_options[:error]&.html_safe %>
62
64
  <% end %>
@@ -64,13 +66,11 @@ end
64
66
  <% end %>
65
67
 
66
68
  <% # any help text. %>
67
- <% if content_for?(:help) || other_options[:help].present? || content_for?(:after_help) %>
69
+ <% if partial.help? || other_options[:help].present? || partial.after_help? %>
68
70
  <p class="mt-1.5 text-xs text-slate-500 dark:text-slate-400">
69
- <%= yield :help %>
70
- <% flush_content_for :help %>
71
+ <%= partial.help %>
71
72
  <%= other_options[:help]&.html_safe %>
72
- <%= yield :after_help %>
73
- <% flush_content_for :after_help %>
73
+ <%= partial.after_help %>
74
74
  </p>
75
75
  <% end %>
76
76
 
@@ -1,5 +1,5 @@
1
1
  <!DOCTYPE html>
2
- <html>
2
+ <html class="theme-<%= BulletTrain::Themes::Light.color %> <%= "theme-secondary-#{BulletTrain::Themes::Light.secondary_color}" if BulletTrain::Themes::Light.secondary_color %>">
3
3
  <head>
4
4
  <%= render 'shared/layouts/head' %>
5
5
  </head>
@@ -13,7 +13,7 @@
13
13
  <div class="m-5 -mb-5">
14
14
  <%= link_to @back, class: 'button-secondary hover:no-underline group' do %>
15
15
  <i class="ti ti-angle-left text-lg group-hover:no-underline"></i>
16
- <span class="text-base ml-3 group-hover:underline">Back</span>
16
+ <span class="text-base ml-3 group-hover:underline"><%= t('navigation.back') %></span>
17
17
  <% end %>
18
18
  </div>
19
19
  <% end %>
@@ -3,7 +3,7 @@
3
3
  id="mobile-menu-close"
4
4
  data-action="mobile-menu#close"
5
5
  >
6
- <span class="sr-only">Close Application Menu</span>
6
+ <span class="sr-only"><%= t('navigation.close_app_menu') %></span>
7
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
8
  <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
9
9
  </svg>
@@ -1,8 +1,8 @@
1
1
  <% method ||= nil %>
2
2
  <% active ||= request.path == url %>
3
3
 
4
- <%= 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 || BulletTrain::Themes::Light.show_logo_in_account} dark:text-white", data: {"desktop-menu-target": "menuItemLink"}, tabIndex: 0, method: method do %>
5
- <div class="inline-block indent-child flex items-center">
4
+ <%= send (method ? :button_to : :link_to), url, class: "block group/item 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-3 py-2 rounded-md"} #{"rounded-tl-lg" unless @not_first || BulletTrain::Themes::Light.show_logo_in_account} dark:text-white", data: {"desktop-menu-target": "menuItemLink"}, tabIndex: 0, method: method do %>
5
+ <div class="inline-block <%= "transition group-hover/item:translate-x-3 duration-200" if @menu_orientation == :side %> flex items-center">
6
6
  <!-- Heroicon name: home -->
7
7
  <% if partial.icon? %>
8
8
  <span class="mr-3 h-6 w-6 text-center text-secondary-300 text-xl leading-6 dark:text-slate-400">
@@ -2,8 +2,8 @@
2
2
  id="mobile-menu-open"
3
3
  data-action="mobile-menu#open"
4
4
  >
5
- <span class="sr-only">Open Application Menu</span>
5
+ <span class="sr-only"><%= t('navigation.open_app_menu') %></span>
6
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
7
  <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
8
8
  </svg>
9
- </button>
9
+ </button>
@@ -10,7 +10,7 @@
10
10
  </div>
11
11
  <% else %>
12
12
  <div>
13
- <div class="inline-block relative group" data-controller="desktop-menu" data-action="keydown->desktop-menu#hideSubmenu" id="<%= title.underscore %>">
13
+ <div class="inline-block relative group" data-controller="desktop-menu" data-action="keydown->desktop-menu#hideSubmenu" id="<%= title.parameterize(separator: '_') %>">
14
14
  <%= render 'account/shared/menu/heading' do %>
15
15
  <%= title %>
16
16
 
@@ -0,0 +1,9 @@
1
+ en:
2
+ action_models:
3
+ processed: Processed %{at}
4
+ processed_of: Processed %{performed_count} of %{target_count} %{at}
5
+ awaiting: Awaiting approval
6
+ scheduled_for: Scheduled for %{for}
7
+ processing_of: Processing %{performed_count} of %{target_count}
8
+ preparing_to_process: Preparing to process
9
+ preparing_to_process_of: Preparing to process %{performed_count} of %{target_count}
@@ -0,0 +1,4 @@
1
+ en:
2
+ conversations:
3
+ message:
4
+ reply: "reply:"
@@ -0,0 +1,5 @@
1
+ en:
2
+ navigation:
3
+ close_app_menu: Close Application Menu
4
+ open_app_menu: Open Application Menu
5
+ back: Back
@@ -1,7 +1,7 @@
1
1
  module BulletTrain
2
2
  module Themes
3
3
  module Light
4
- VERSION = "1.2.27"
4
+ VERSION = "1.3.1"
5
5
  end
6
6
  end
7
7
  end
@@ -14,7 +14,6 @@ module BulletTrain
14
14
  mattr_accessor :logo_color_shift, default: false
15
15
  mattr_accessor :show_logo_in_account, default: false
16
16
  mattr_accessor :navigation, default: :top
17
- mattr_accessor :original_devise_path # TODO: Obsolete: remove after shipping a new BulletTrain version with usage removed.
18
17
 
19
18
  class Theme < BulletTrain::Themes::TailwindCss::Theme
20
19
  def directory_order
@@ -180,14 +180,81 @@ module BulletTrain
180
180
  end
181
181
 
182
182
  def self.clean_theme(theme_name, args)
183
- theme_base_path = `bundle show --paths bullet_train-themes-#{theme_name}`.chomp
184
- `find app/views/themes/#{args[:theme]} | grep html.erb`.lines.map(&:chomp).each do |path|
185
- _, file = path.split("app/views/themes/#{args[:theme]}/")
186
- original_theme_path = "#{theme_base_path}/app/views/themes/#{theme_name}/#{file}"
187
- if File.read(path) == File.read(original_theme_path)
188
- puts "No changes in `#{path}` since being ejected. Removing."
189
- `rm #{path}`
183
+ light_base_path = `bundle show --paths bullet_train-themes-light`.chomp
184
+ tailwind_base_path = `bundle show --paths bullet_train-themes-tailwind_css`.chomp
185
+ theme_base_path = `bundle show --paths bullet_train-themes`.chomp
186
+
187
+ directory_content = `find . | grep 'app/.*#{args[:theme]}'`.lines.map(&:chomp)
188
+ directory_content = directory_content.reject { |content| content.match?("app/assets/builds/") }
189
+ files = directory_content.select { |file| file.match?(/(\.erb)|(\.rb)|(\.css)|(\.js)$/) }
190
+
191
+ # Files that exist outside of "./app/" that we need to check.
192
+ files += [
193
+ "tailwind.#{args[:theme]}.config.js",
194
+ "tailwind.mailer.#{args[:theme]}.config.js",
195
+ ]
196
+
197
+ # This file doesn't exist under "app/" in its original gem, so we handle it differently.
198
+ # Also, don't remove this file from the starter repository in case
199
+ # the developer has any ejected files that have been customized.
200
+ files.delete("./app/lib/bullet_train/themes/#{args[:theme]}.rb")
201
+
202
+ files.each do |file|
203
+ original_theme_path = nil
204
+
205
+ # Remove the current directory syntax for concatenation with the gem base path.
206
+ file.gsub!("./", "")
207
+
208
+ [light_base_path, tailwind_base_path, theme_base_path].each do |theme_path|
209
+ # Views exist under "base" when the gem is "bullet_train-themes".
210
+ theme_gem_name = theme_path.scan(/(.*themes-)(.*$)/).flatten.pop || "base"
211
+ original_theme_path = file.gsub(args[:theme], theme_gem_name)
212
+
213
+ if File.exist?("#{theme_path}/#{original_theme_path}")
214
+ original_theme_path = "#{theme_path}/#{original_theme_path}"
215
+ break
216
+ end
190
217
  end
218
+
219
+ ejected_file_content = File.read(file)
220
+
221
+ # These are the only files where we replace the theme name inside of them when ejecting,
222
+ # so we revert the contents and check if the file has been changed or not.
223
+ transformed_files = [
224
+ "app/views/themes/foo/layouts/_head.html.erb",
225
+ "app/assets/stylesheets/foo.tailwind.css",
226
+ "tailwind.mailer.#{args[:theme]}.config.js"
227
+ ]
228
+ ejected_file_content.gsub!(/#{args[:theme]}/i, theme_name) if transformed_files.include?(file)
229
+
230
+ if ejected_file_content == File.read(original_theme_path)
231
+ puts "No changes in `#{file}` since being ejected. Removing."
232
+ `rm #{file}`
233
+ end
234
+ end
235
+
236
+ # Delete all leftover directories with empty content.
237
+ [
238
+ "./app/assets/stylesheets/",
239
+ "./app/views/themes/"
240
+ ].each do |remaining_directory|
241
+ puts "Cleaning out directory: #{remaining_directory}"
242
+ remaining_directory_content = Dir.glob(remaining_directory + "**/*")
243
+ remaining_directories = remaining_directory_content.select { |content| File.directory?(content) }
244
+ remaining_directories.reverse_each { |dir| Dir.rmdir dir if Dir.empty?(dir) }
245
+ FileUtils.rmdir(remaining_directory) if Dir.empty?(remaining_directory)
246
+ end
247
+
248
+ # These are files from the starter repository that need to be set back to the original theme.
249
+ [
250
+ "Procfile.dev",
251
+ "app/helpers/application_helper.rb",
252
+ "package.json",
253
+ "test/system/resolver_system_test.rb"
254
+ ].each do |file|
255
+ puts "Reverting changes in #{file}."
256
+ new_lines = File.open(file).readlines.join.gsub(/#{args[:theme]}/i, theme_name)
257
+ File.write(file, new_lines)
191
258
  end
192
259
  end
193
260
 
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.27
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-27 00:00:00.000000000 Z
11
+ date: 2023-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard
@@ -130,6 +130,24 @@ files:
130
130
  - app/assets/stylesheets/tailwindcss/components.css
131
131
  - app/assets/stylesheets/tailwindcss/utilities.css
132
132
  - app/javascript/application.light.js
133
+ - app/views/showcase/engine/_head.html.erb
134
+ - app/views/showcase/previews/field_partials/_about_field_partials.erb
135
+ - app/views/showcase/previews/field_partials/_buttons.html.erb
136
+ - app/views/showcase/previews/field_partials/_cloudinary_image.html.erb
137
+ - app/views/showcase/previews/field_partials/_color_picker.html.erb
138
+ - app/views/showcase/previews/field_partials/_date_and_time_field.html.erb
139
+ - app/views/showcase/previews/field_partials/_date_field.html.erb
140
+ - app/views/showcase/previews/field_partials/_email_field.html.erb
141
+ - app/views/showcase/previews/field_partials/_emoji_field.html.erb
142
+ - app/views/showcase/previews/field_partials/_file_field.html.erb
143
+ - app/views/showcase/previews/field_partials/_number_field.html.erb
144
+ - app/views/showcase/previews/field_partials/_options.html.erb
145
+ - app/views/showcase/previews/field_partials/_password_field.html.erb
146
+ - app/views/showcase/previews/field_partials/_phone_field.html.erb
147
+ - app/views/showcase/previews/field_partials/_super_select.html.erb
148
+ - app/views/showcase/previews/field_partials/_text_area.html.erb
149
+ - app/views/showcase/previews/field_partials/_text_field.html.erb
150
+ - app/views/showcase/previews/field_partials/_trix_editor.html.erb
133
151
  - app/views/showcase/previews/partials/_alert.html.erb
134
152
  - app/views/showcase/previews/partials/_box.html.erb
135
153
  - app/views/showcase/previews/partials/_breadcrumb.html.erb
@@ -195,6 +213,9 @@ files:
195
213
  - app/views/themes/light/menu/_top.html.erb
196
214
  - app/views/themes/light/menu/_user.html.erb
197
215
  - app/views/themes/light/workflow/_box.html.erb
216
+ - config/locales/en/action_models.en.yml
217
+ - config/locales/en/conversations.en.yml
218
+ - config/locales/en/navigation.en.yml
198
219
  - config/routes.rb
199
220
  - lib/bullet_train/themes/light.rb
200
221
  - lib/bullet_train/themes/light/custom_theme_file_replacer.rb
@@ -204,13 +225,13 @@ files:
204
225
  - lib/tasks/application.rb
205
226
  - lib/tasks/bullet_train/themes/light_tasks.rake
206
227
  - tailwind.light.config.js
207
- homepage: https://github.com/bullet-train-co/bullet_train-themes-light
228
+ homepage: https://github.com/bullet-train-co/bullet_train-core/tree/main/bullet_train-themes-light
208
229
  licenses:
209
230
  - MIT
210
231
  metadata:
211
- homepage_uri: https://github.com/bullet-train-co/bullet_train-themes-light
212
- source_code_uri: https://github.com/bullet-train-co/bullet_train-themes-light
213
- post_install_message:
232
+ homepage_uri: https://github.com/bullet-train-co/bullet_train-core/tree/main/bullet_train-themes-light
233
+ source_code_uri: https://github.com/bullet-train-co/bullet_train-core/tree/main/bullet_train-themes-light
234
+ post_install_message:
214
235
  rdoc_options: []
215
236
  require_paths:
216
237
  - lib
@@ -226,7 +247,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
226
247
  version: '0'
227
248
  requirements: []
228
249
  rubygems_version: 3.4.10
229
- signing_key:
250
+ signing_key:
230
251
  specification_version: 4
231
252
  summary: 'Bullet Train Themes: Light'
232
253
  test_files: []