solidus_admin 0.0.2 → 0.2.0
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 +4 -4
- data/.eslintrc.json +7 -0
- data/README.md +2 -2
- data/Rakefile +26 -0
- data/app/assets/builds/.keep +0 -0
- data/app/assets/builds/solidus_admin/tailwind.css +2799 -0
- data/app/assets/config/solidus_admin_manifest.js +1 -0
- data/app/assets/stylesheets/solidus_admin/application.tailwind.css +4 -0
- data/app/assets/stylesheets/solidus_admin/dark.css +12 -0
- data/app/assets/stylesheets/solidus_admin/dimmed.css +11 -0
- data/app/components/solidus_admin/adjustment_reasons/index/component.rb +43 -0
- data/app/components/solidus_admin/base_component.rb +29 -1
- data/app/components/solidus_admin/layout/feedback/component.html.erb +15 -0
- data/app/components/solidus_admin/layout/feedback/component.rb +4 -0
- data/app/components/solidus_admin/layout/feedback/component.yml +3 -0
- data/app/components/solidus_admin/layout/navigation/account/component.html.erb +74 -0
- data/app/components/solidus_admin/layout/navigation/account/component.js +16 -0
- data/app/components/solidus_admin/layout/navigation/account/component.rb +36 -0
- data/app/components/solidus_admin/{sidebar → layout/navigation}/component.html.erb +9 -9
- data/app/components/solidus_admin/layout/navigation/component.rb +26 -0
- data/app/components/solidus_admin/{sidebar → layout/navigation}/item/component.html.erb +5 -5
- data/app/components/solidus_admin/{sidebar → layout/navigation}/item/component.rb +2 -2
- data/app/components/solidus_admin/layout/page_helpers.rb +55 -0
- data/app/components/solidus_admin/{skip_link → layout/skip_link}/component.rb +2 -4
- data/app/components/solidus_admin/option_types/index/component.rb +71 -0
- data/app/components/solidus_admin/orders/cart/component.html.erb +77 -0
- data/app/components/solidus_admin/orders/cart/component.js +37 -0
- data/app/components/solidus_admin/orders/cart/component.rb +7 -0
- data/app/components/solidus_admin/orders/cart/component.yml +3 -0
- data/app/components/solidus_admin/orders/cart/result/component.html.erb +26 -0
- data/app/components/solidus_admin/orders/cart/result/component.rb +11 -0
- data/app/components/solidus_admin/orders/index/component.rb +92 -23
- data/app/components/solidus_admin/orders/index/component.yml +10 -4
- data/app/components/solidus_admin/orders/show/address/component.html.erb +67 -0
- data/app/components/solidus_admin/orders/show/address/component.js +9 -0
- data/app/components/solidus_admin/orders/show/address/component.rb +53 -0
- data/app/components/solidus_admin/orders/show/address/component.yml +14 -0
- data/app/components/solidus_admin/orders/show/component.html.erb +76 -0
- data/app/components/solidus_admin/orders/show/component.js +7 -0
- data/app/components/solidus_admin/orders/show/component.rb +40 -0
- data/app/components/solidus_admin/orders/show/component.yml +21 -0
- data/app/components/solidus_admin/orders/show/customer_search/component.html.erb +14 -0
- data/app/components/solidus_admin/orders/show/customer_search/component.js +14 -0
- data/app/components/solidus_admin/orders/show/customer_search/component.rb +7 -0
- data/app/components/solidus_admin/orders/show/customer_search/component.yml +2 -0
- data/app/components/solidus_admin/orders/show/customer_search/result/component.html.erb +17 -0
- data/app/components/solidus_admin/orders/show/customer_search/result/component.rb +11 -0
- data/app/components/solidus_admin/orders/show/email/component.html.erb +18 -0
- data/app/components/solidus_admin/orders/show/email/component.rb +15 -0
- data/app/components/solidus_admin/orders/show/email/component.yml +8 -0
- data/app/components/solidus_admin/orders/show/summary/component.html.erb +14 -0
- data/app/components/solidus_admin/orders/show/summary/component.rb +7 -0
- data/app/components/solidus_admin/orders/show/summary/component.yml +8 -0
- data/app/components/solidus_admin/payment_methods/index/component.rb +103 -0
- data/app/components/solidus_admin/payment_methods/index/component.yml +10 -0
- data/app/components/solidus_admin/products/index/component.rb +48 -41
- data/app/components/solidus_admin/products/index/component.yml +8 -7
- data/app/components/solidus_admin/products/show/component.html.erb +32 -38
- data/app/components/solidus_admin/products/show/component.rb +2 -0
- data/app/components/solidus_admin/products/show/component.yml +5 -5
- data/app/components/solidus_admin/products/status/component.rb +20 -18
- data/app/components/solidus_admin/products/status/component.yml +1 -0
- data/app/components/solidus_admin/products/stock/component.rb +38 -0
- data/app/components/solidus_admin/products/stock/component.yml +5 -0
- data/app/components/solidus_admin/promotion_categories/index/component.rb +56 -0
- data/app/components/solidus_admin/promotions/index/component.rb +104 -0
- data/app/components/solidus_admin/promotions/index/component.yml +10 -0
- data/app/components/solidus_admin/properties/index/component.rb +64 -0
- data/app/components/solidus_admin/refund_reasons/index/component.rb +53 -0
- data/app/components/solidus_admin/refunds_and_returns/component.rb +40 -0
- data/app/components/solidus_admin/refunds_and_returns/component.yml +3 -0
- data/app/components/solidus_admin/reimbursement_types/index/component.rb +27 -0
- data/app/components/solidus_admin/return_reasons/index/component.rb +42 -0
- data/app/components/solidus_admin/shipping/component.rb +30 -0
- data/app/components/solidus_admin/shipping/component.yml +3 -0
- data/app/components/solidus_admin/shipping_categories/index/component.rb +46 -0
- data/app/components/solidus_admin/shipping_methods/index/component.rb +61 -0
- data/app/components/solidus_admin/stock_items/edit/component.html.erb +89 -0
- data/app/components/solidus_admin/stock_items/edit/component.js +17 -0
- data/app/components/solidus_admin/stock_items/edit/component.rb +23 -0
- data/app/components/solidus_admin/stock_items/edit/component.yml +10 -0
- data/app/components/solidus_admin/stock_items/index/component.rb +174 -0
- data/app/components/solidus_admin/stock_items/index/component.yml +10 -0
- data/app/components/solidus_admin/stock_locations/index/component.rb +89 -0
- data/app/components/solidus_admin/stock_locations/index/component.yml +3 -0
- data/app/components/solidus_admin/store_credit_reasons/index/component.rb +52 -0
- data/app/components/solidus_admin/stores/index/component.rb +58 -0
- data/app/components/solidus_admin/tax_categories/index/component.rb +58 -0
- data/app/components/solidus_admin/tax_rates/index/component.rb +88 -0
- data/app/components/solidus_admin/taxes/component.rb +25 -0
- data/app/components/solidus_admin/taxes/component.yml +3 -0
- data/app/components/solidus_admin/taxonomies/index/component.rb +53 -0
- data/app/components/solidus_admin/ui/badge/component.rb +18 -8
- data/app/components/solidus_admin/ui/badge/component.yml +3 -0
- data/app/components/solidus_admin/ui/button/component.rb +32 -32
- data/app/components/solidus_admin/ui/details_list/component.html.erb +10 -0
- data/app/components/solidus_admin/ui/details_list/component.rb +7 -0
- data/app/components/solidus_admin/ui/dropdown/component.html.erb +50 -0
- data/app/components/solidus_admin/ui/dropdown/component.js +16 -0
- data/app/components/solidus_admin/ui/dropdown/component.rb +28 -0
- data/app/components/solidus_admin/ui/dropdown/component.yml +2 -0
- data/app/components/solidus_admin/ui/forms/address/component.html.erb +36 -0
- data/app/components/solidus_admin/ui/forms/address/component.js +34 -0
- data/app/components/solidus_admin/ui/forms/address/component.rb +14 -0
- data/app/components/solidus_admin/ui/forms/field/component.html.erb +5 -4
- data/app/components/solidus_admin/ui/forms/field/component.rb +53 -15
- data/app/components/solidus_admin/ui/forms/input/component.rb +11 -5
- data/app/components/solidus_admin/ui/forms/search/component.html.erb +52 -0
- data/app/components/solidus_admin/ui/forms/search/component.js +116 -0
- data/app/components/solidus_admin/ui/forms/search/component.rb +8 -0
- data/app/components/solidus_admin/ui/forms/search/component.yml +4 -0
- data/app/components/solidus_admin/ui/forms/search/result/component.rb +12 -0
- data/app/components/solidus_admin/ui/forms/search_field/component.html.erb +20 -0
- data/app/{javascript/solidus_admin/controllers/hello_controller.js → components/solidus_admin/ui/forms/search_field/component.js} +4 -2
- data/app/components/solidus_admin/ui/forms/search_field/component.rb +10 -0
- data/app/components/solidus_admin/ui/forms/search_field/component.yml +2 -0
- data/app/components/solidus_admin/ui/forms/switch/component.rb +27 -31
- data/app/components/solidus_admin/ui/forms/switch_field/component.html.erb +20 -0
- data/app/components/solidus_admin/ui/forms/switch_field/component.rb +11 -0
- data/app/components/solidus_admin/ui/icon/component.rb +4 -0
- data/app/components/solidus_admin/ui/modal/component.html.erb +37 -0
- data/app/components/solidus_admin/ui/modal/component.rb +12 -0
- data/app/components/solidus_admin/ui/modal/component.yml +2 -0
- data/app/components/solidus_admin/ui/pages/index/component.html.erb +30 -0
- data/app/components/solidus_admin/ui/pages/index/component.rb +119 -0
- data/app/components/solidus_admin/ui/pages/index/component.yml +4 -0
- data/app/components/solidus_admin/ui/panel/component.html.erb +26 -12
- data/app/components/solidus_admin/ui/panel/component.rb +17 -0
- data/app/components/solidus_admin/ui/panel/component.yml +1 -3
- data/app/components/solidus_admin/ui/resource_item/component.html.erb +10 -0
- data/app/components/solidus_admin/ui/resource_item/component.rb +9 -0
- data/app/components/solidus_admin/ui/tab/component.rb +9 -8
- data/app/components/solidus_admin/ui/table/component.html.erb +147 -135
- data/app/components/solidus_admin/ui/table/component.js +56 -17
- data/app/components/solidus_admin/ui/table/component.rb +94 -70
- data/app/components/solidus_admin/ui/table/component.yml +0 -1
- data/app/components/solidus_admin/ui/table/ransack_filter/component.html.erb +72 -0
- data/app/components/solidus_admin/ui/table/ransack_filter/component.js +73 -0
- data/app/components/solidus_admin/ui/table/ransack_filter/component.rb +68 -0
- data/app/components/solidus_admin/ui/table/ransack_filter/component.yml +3 -0
- data/app/components/solidus_admin/ui/table/toolbar/component.rb +21 -0
- data/app/components/solidus_admin/ui/thumbnail/component.rb +46 -0
- data/app/components/solidus_admin/ui/toast/component.html.erb +9 -5
- data/app/components/solidus_admin/ui/toast/component.js +9 -6
- data/app/components/solidus_admin/ui/toast/component.rb +2 -2
- data/app/components/solidus_admin/ui/toggletip/component.html.erb +14 -10
- data/app/components/solidus_admin/ui/toggletip/component.js +22 -4
- data/app/components/solidus_admin/ui/toggletip/component.rb +8 -85
- data/app/components/solidus_admin/users/index/component.rb +96 -0
- data/app/components/solidus_admin/users/index/component.yml +15 -0
- data/app/components/solidus_admin/zones/index/component.rb +63 -0
- data/app/controllers/solidus_admin/addresses_controller.rb +92 -0
- data/app/controllers/solidus_admin/adjustment_reasons_controller.rb +40 -0
- data/app/controllers/solidus_admin/base_controller.rb +1 -0
- data/app/controllers/solidus_admin/controller_helpers/authorization.rb +5 -1
- data/app/controllers/solidus_admin/controller_helpers/locale.rb +2 -2
- data/app/controllers/solidus_admin/controller_helpers/search.rb +48 -0
- data/app/controllers/solidus_admin/controller_helpers/theme.rb +30 -0
- data/app/controllers/solidus_admin/countries_controller.rb +12 -0
- data/app/controllers/solidus_admin/customers_controller.rb +29 -0
- data/app/controllers/solidus_admin/line_items_controller.rb +45 -0
- data/app/controllers/solidus_admin/option_types_controller.rb +46 -0
- data/app/controllers/solidus_admin/orders_controller.rb +104 -7
- data/app/controllers/solidus_admin/payment_methods_controller.rb +52 -0
- data/app/controllers/solidus_admin/products_controller.rb +26 -17
- data/app/controllers/solidus_admin/promotion_categories_controller.rb +29 -0
- data/app/controllers/solidus_admin/promotions_controller.rb +46 -0
- data/app/controllers/solidus_admin/properties_controller.rb +33 -0
- data/app/controllers/solidus_admin/refund_reasons_controller.rb +40 -0
- data/app/controllers/solidus_admin/reimbursement_types_controller.rb +31 -0
- data/app/controllers/solidus_admin/return_reasons_controller.rb +40 -0
- data/app/controllers/solidus_admin/shipping_categories_controller.rb +40 -0
- data/app/controllers/solidus_admin/shipping_methods_controller.rb +40 -0
- data/app/controllers/solidus_admin/stock_items_controller.rb +67 -0
- data/app/controllers/solidus_admin/stock_locations_controller.rb +40 -0
- data/app/controllers/solidus_admin/store_credit_reasons_controller.rb +40 -0
- data/app/controllers/solidus_admin/stores_controller.rb +40 -0
- data/app/controllers/solidus_admin/tax_categories_controller.rb +40 -0
- data/app/controllers/solidus_admin/tax_rates_controller.rb +40 -0
- data/app/controllers/solidus_admin/taxonomies_controller.rb +46 -0
- data/app/controllers/solidus_admin/users_controller.rb +50 -0
- data/app/controllers/solidus_admin/zones_controller.rb +40 -0
- data/app/javascript/solidus_admin/controllers/components.js +3 -1
- data/app/javascript/solidus_admin/controllers/confirm_controller.js +21 -0
- data/app/javascript/solidus_admin/controllers/details_click_outside_controller.js +12 -0
- data/app/javascript/solidus_admin/controllers/readonly_when_submitting_controller.js +17 -0
- data/app/javascript/solidus_admin/controllers/sortable_controller.js +33 -0
- data/app/views/layouts/solidus_admin/application.html.erb +16 -10
- data/app/views/layouts/solidus_admin/preview.html.erb +2 -1
- data/app/views/solidus_admin/base/unauthorized.html.erb +4 -0
- data/config/importmap.rb +2 -0
- data/config/initializers/view_component.rb +20 -0
- data/config/locales/adjustment_reasons.en.yml +6 -0
- data/config/locales/customers.en.yml +7 -0
- data/config/locales/errors.en.yml +7 -0
- data/config/locales/line_items.en.yml +9 -0
- data/config/locales/{main_nav.en.yml → menu_item.en.yml} +8 -2
- data/config/locales/option_types.en.yml +6 -0
- data/config/locales/orders.en.yml +9 -0
- data/config/locales/payment_methods.en.yml +6 -0
- data/config/locales/promotion_categories.en.yml +6 -0
- data/config/locales/promotions.en.yml +6 -0
- data/config/locales/properties.en.yml +6 -0
- data/config/locales/refund_reasons_.en.yml +6 -0
- data/config/locales/reimbursement_types.en.yml +4 -0
- data/config/locales/return_reasons.en.yml +6 -0
- data/config/locales/shipping_categories.en.yml +6 -0
- data/config/locales/shipping_methods.en.yml +6 -0
- data/config/locales/stock_items.en.yml +4 -0
- data/config/locales/stock_locations.en.yml +6 -0
- data/config/locales/store_credit_reasons.en.yml +6 -0
- data/config/locales/stores.en.yml +6 -0
- data/config/locales/tax_categories.en.yml +6 -0
- data/config/locales/tax_rates.en.yml +6 -0
- data/config/locales/taxonomies.en.yml +6 -0
- data/config/locales/users.en.yml +6 -0
- data/config/locales/zones.en.yml +6 -0
- data/config/routes.rb +50 -3
- data/config/tailwind.config.js +119 -0
- data/docs/{customizing_main_navigation.md → customizing_menu_items.md} +2 -2
- data/docs/customizing_tailwindcss.md +57 -0
- data/docs/customizing_view_components.md +17 -38
- data/lib/generators/solidus_admin/install/install_generator.rb +13 -4
- data/lib/generators/solidus_admin/install/templates/config/initializers/{solidus_admin.rb → solidus_admin.rb.tt} +10 -14
- data/lib/solidus_admin/admin_resources.rb +23 -0
- data/lib/solidus_admin/configuration.rb +95 -67
- data/lib/solidus_admin/install_tailwindcss.rb +102 -0
- data/lib/solidus_admin/{main_nav_item.rb → menu_item.rb} +2 -2
- data/lib/solidus_admin/version.rb +1 -1
- data/lib/solidus_admin.rb +1 -2
- data/lib/tasks/tailwind.rake +10 -0
- data/solidus_admin.gemspec +3 -4
- metadata +193 -50
- data/app/assets/stylesheets/solidus_admin/application.tailwind.css.erb +0 -35
- data/app/components/solidus_admin/feedback/component.html.erb +0 -11
- data/app/components/solidus_admin/feedback/component.rb +0 -4
- data/app/components/solidus_admin/feedback/component.yml +0 -5
- data/app/components/solidus_admin/orders/index/component.html.erb +0 -31
- data/app/components/solidus_admin/products/index/component.html.erb +0 -30
- data/app/components/solidus_admin/sidebar/account_nav/component.html.erb +0 -67
- data/app/components/solidus_admin/sidebar/account_nav/component.rb +0 -15
- data/app/components/solidus_admin/sidebar/component.rb +0 -21
- data/app/components/solidus_admin/ui/panel/component.js +0 -14
- data/config/solidus_admin/tailwind.config.js.erb +0 -95
- data/docs/customizing_tailwind.md +0 -78
- data/lib/solidus_admin/tailwindcss.rb +0 -58
- data/lib/tasks/tailwindcss.rake +0 -55
- /data/app/components/solidus_admin/{sidebar/account_nav → layout/navigation/account}/component.yml +0 -0
- /data/app/components/solidus_admin/{sidebar → layout/navigation}/component.js +0 -0
- /data/app/components/solidus_admin/{sidebar → layout/navigation}/component.yml +0 -0
- /data/app/components/solidus_admin/{skip_link → layout/skip_link}/component.yml +0 -0
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<div class="<%= stimulus_id %> px-4">
|
|
2
|
-
<header class="py-6 flex items-center">
|
|
3
|
-
<h1 class="body-title">
|
|
4
|
-
<%= title %>
|
|
5
|
-
</h1>
|
|
6
|
-
|
|
7
|
-
<div class="ml-auto flex gap-2 items-center">
|
|
8
|
-
<%= render component("feedback").new %>
|
|
9
|
-
<%= render component("ui/button").new(
|
|
10
|
-
tag: :a,
|
|
11
|
-
text: t('.add_product'),
|
|
12
|
-
href: spree.new_admin_product_path,
|
|
13
|
-
icon: "add-line",
|
|
14
|
-
) %>
|
|
15
|
-
</div>
|
|
16
|
-
</header>
|
|
17
|
-
|
|
18
|
-
<%= render component('ui/table').new(
|
|
19
|
-
id: 'products-list',
|
|
20
|
-
model_class: Spree::Product,
|
|
21
|
-
rows: @page.records,
|
|
22
|
-
search_key: SolidusAdmin::Config[:product_search_key],
|
|
23
|
-
search_url: solidus_admin.products_path,
|
|
24
|
-
batch_actions: batch_actions,
|
|
25
|
-
filters: filters,
|
|
26
|
-
columns: columns,
|
|
27
|
-
prev_page_link: prev_page_link,
|
|
28
|
-
next_page_link: next_page_link,
|
|
29
|
-
) %>
|
|
30
|
-
</div>
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
<details class="relative w-full" aria-label="<%= t('.account') %>">
|
|
2
|
-
<summary
|
|
3
|
-
class="
|
|
4
|
-
flex gap-1.5
|
|
5
|
-
p-3 mt-2 rounded
|
|
6
|
-
body-small-bold text-gray-500
|
|
7
|
-
hover:bg-gray-25 [[open]_>_&]:bg-gray-25
|
|
8
|
-
cursor-pointer
|
|
9
|
-
[&::marker]:hidden
|
|
10
|
-
[&::-webkit-details-marker]:hidden
|
|
11
|
-
">
|
|
12
|
-
<%= icon_tag("user-smile-fill", class: "inline-block align-text-bottom shrink-0 w-6 h-6 rounded-[4.81rem] body-small fill-yellow bg-black") %>
|
|
13
|
-
<span class="overflow-hidden whitespace-nowrap text-ellipsis">
|
|
14
|
-
<%= @user_label %>
|
|
15
|
-
</span>
|
|
16
|
-
</summary>
|
|
17
|
-
|
|
18
|
-
<ul
|
|
19
|
-
class="
|
|
20
|
-
p-2 mb-1 absolute bottom-full left-0 w-full
|
|
21
|
-
body-small text-black bg-white
|
|
22
|
-
border border-gray-100 rounded-lg
|
|
23
|
-
shadow-base
|
|
24
|
-
">
|
|
25
|
-
|
|
26
|
-
<% if (available_locales = Spree.i18n_available_locales).any? %>
|
|
27
|
-
<li class="h-8 flex items-center hover:bg-gray-25 rounded">
|
|
28
|
-
<%= form_tag request.fullpath, method: :get do %>
|
|
29
|
-
<label class="flex gap-2 items-center px-2">
|
|
30
|
-
<%= icon_tag("global-line", class: "w-full max-w-[20px] h-5 fill-current shrink") %>
|
|
31
|
-
<select class="w-full appearance-none grow bg-transparent outline-none" onchange="this.form.requestSubmit()" name="switch_to_locale">
|
|
32
|
-
<%= options_for_select(
|
|
33
|
-
available_locales
|
|
34
|
-
.map do |locale|
|
|
35
|
-
[
|
|
36
|
-
t(
|
|
37
|
-
"spree.i18n.this_file_language",
|
|
38
|
-
locale: locale,
|
|
39
|
-
default: locale.to_s,
|
|
40
|
-
fallback: false
|
|
41
|
-
),
|
|
42
|
-
locale
|
|
43
|
-
]
|
|
44
|
-
end
|
|
45
|
-
.sort,
|
|
46
|
-
selected: I18n.locale,
|
|
47
|
-
) %>
|
|
48
|
-
</select>
|
|
49
|
-
<%= icon_tag("expand-up-down-line", class: "w-full max-w-[20px] h-5 fill-current shrink") %>
|
|
50
|
-
</label>
|
|
51
|
-
<% end %>
|
|
52
|
-
</li>
|
|
53
|
-
<% end %>
|
|
54
|
-
<li class="h-8 flex items-center hover:bg-gray-25 rounded">
|
|
55
|
-
<%= link_to @account_path, class: 'flex gap-2 items-center px-2' do %>
|
|
56
|
-
<%= icon_tag("user-3-line", class: "w-5 h-5 fill-current shrink") %>
|
|
57
|
-
<span><%= t('.account') %></span>
|
|
58
|
-
<% end %>
|
|
59
|
-
</li>
|
|
60
|
-
<li class="h-8 flex items-center hover:bg-gray-25 rounded">
|
|
61
|
-
<%= button_to @logout_path, method: @logout_method, class: 'flex gap-2 items-center px-2' do %>
|
|
62
|
-
<%= icon_tag("logout-box-line", class: "w-5 h-5 fill-current shrink") %>
|
|
63
|
-
<span><%= t('.logout') %></span>
|
|
64
|
-
<% end %>
|
|
65
|
-
</li>
|
|
66
|
-
</ul>
|
|
67
|
-
</details>
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# Account navigation
|
|
4
|
-
class SolidusAdmin::Sidebar::AccountNav::Component < SolidusAdmin::BaseComponent
|
|
5
|
-
# @param user_label [String]
|
|
6
|
-
# @param account_path [String]
|
|
7
|
-
# @param logout_path [String]
|
|
8
|
-
# @param logout_method [Symbol]
|
|
9
|
-
def initialize(user_label:, account_path:, logout_path:, logout_method:)
|
|
10
|
-
@user_label = user_label
|
|
11
|
-
@account_path = account_path
|
|
12
|
-
@logout_path = logout_path
|
|
13
|
-
@logout_method = logout_method
|
|
14
|
-
end
|
|
15
|
-
end
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# Renders the sidebar
|
|
4
|
-
class SolidusAdmin::Sidebar::Component < SolidusAdmin::BaseComponent
|
|
5
|
-
def initialize(
|
|
6
|
-
store:,
|
|
7
|
-
logo_path: SolidusAdmin::Config.logo_path,
|
|
8
|
-
items: SolidusAdmin::Config.menu_items
|
|
9
|
-
)
|
|
10
|
-
@logo_path = logo_path
|
|
11
|
-
@items = items.map do |attrs|
|
|
12
|
-
children = attrs[:children].to_a.map { SolidusAdmin::MainNavItem.new(**_1, top_level: false) }
|
|
13
|
-
SolidusAdmin::MainNavItem.new(**attrs, children: children, top_level: true)
|
|
14
|
-
end
|
|
15
|
-
@store = store
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def items
|
|
19
|
-
@items.sort_by(&:position)
|
|
20
|
-
end
|
|
21
|
-
end
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Controller } from '@hotwired/stimulus'
|
|
2
|
-
|
|
3
|
-
export default class extends Controller {
|
|
4
|
-
static targets = ['output']
|
|
5
|
-
|
|
6
|
-
typed(event) {
|
|
7
|
-
this.text = event.currentTarget.value
|
|
8
|
-
this.render()
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
render() {
|
|
12
|
-
this.outputTarget.innerText = this.text
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
const defaultTheme = require('tailwindcss/defaultTheme')
|
|
2
|
-
const plugin = require('tailwindcss/plugin')
|
|
3
|
-
|
|
4
|
-
module.exports = {
|
|
5
|
-
content: [
|
|
6
|
-
<%= SolidusAdmin::Config.tailwind_content.map { "'#{_1}'" }.join(",\n ") %>
|
|
7
|
-
],
|
|
8
|
-
theme: {
|
|
9
|
-
extend: {
|
|
10
|
-
aria: {
|
|
11
|
-
'current': 'current="true"',
|
|
12
|
-
},
|
|
13
|
-
fontFamily: {
|
|
14
|
-
sans: ['Inter var', ...defaultTheme.fontFamily.sans],
|
|
15
|
-
},
|
|
16
|
-
colors: {
|
|
17
|
-
transparent: "transparent",
|
|
18
|
-
current: "currentColor",
|
|
19
|
-
|
|
20
|
-
// Primary palette
|
|
21
|
-
solidusRed: "#ef3023",
|
|
22
|
-
black: "#222222",
|
|
23
|
-
graphite: "#c7ccc7",
|
|
24
|
-
graphiteLight: "#d8dad8",
|
|
25
|
-
sand: "#f5f3f0",
|
|
26
|
-
white: "#ffffff",
|
|
27
|
-
|
|
28
|
-
// Secondary palette
|
|
29
|
-
yellow: "#fdc071",
|
|
30
|
-
orange: "#f68050",
|
|
31
|
-
blue: "#2554b1",
|
|
32
|
-
moss: "#2d3925",
|
|
33
|
-
forest: "#096756",
|
|
34
|
-
midnight: "#163449",
|
|
35
|
-
pink: "#f6d7e2",
|
|
36
|
-
plum: "#3a0e31",
|
|
37
|
-
sky: "#cbdff1",
|
|
38
|
-
seafoam: "#c1e0de",
|
|
39
|
-
dune: "#e6bf9b",
|
|
40
|
-
|
|
41
|
-
// Extra colors (not part of the original palette)
|
|
42
|
-
papayaWhip: "#f9e3d9",
|
|
43
|
-
|
|
44
|
-
// UI Red
|
|
45
|
-
red: {
|
|
46
|
-
100: "#f8d6d3",
|
|
47
|
-
200: "#f1ada7",
|
|
48
|
-
300: "#ea8980",
|
|
49
|
-
400: "#e36054",
|
|
50
|
-
500: "#dc3728",
|
|
51
|
-
600: "#b12c20",
|
|
52
|
-
700: "#862219",
|
|
53
|
-
800: "#561610",
|
|
54
|
-
900: "#2b0b08",
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
// Grayscale
|
|
58
|
-
gray: {
|
|
59
|
-
15: "#fafafa",
|
|
60
|
-
25: "#f5f5f5",
|
|
61
|
-
50: "#f0f0f0",
|
|
62
|
-
100: "#dedede",
|
|
63
|
-
200: "#cfcfcf",
|
|
64
|
-
300: "#bababa",
|
|
65
|
-
400: "#a3a3a3",
|
|
66
|
-
500: "#737373",
|
|
67
|
-
600: "#616161",
|
|
68
|
-
700: "#4a4a4a",
|
|
69
|
-
800: "#333333",
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
borderRadius: {
|
|
73
|
-
sm: '4px',
|
|
74
|
-
},
|
|
75
|
-
backgroundImage: {
|
|
76
|
-
'arrow-right-up-line': "url('solidus_admin/arrow_right_up_line.svg')",
|
|
77
|
-
'arrow-down-s-fill-gray-700': "url('solidus_admin/arrow_down_s_fill_gray_700.svg')",
|
|
78
|
-
'arrow-down-s-fill-red-400': "url('solidus_admin/arrow_down_s_fill_red_400.svg')",
|
|
79
|
-
},
|
|
80
|
-
boxShadow: {
|
|
81
|
-
sm: '0px 1px 2px 0px rgba(0, 0, 0, 0.04)',
|
|
82
|
-
base: '0px 4px 8px 0px rgba(0, 0, 0, 0.08), 0px 2px 4px -1px rgba(0, 0, 0, 0.04)'
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
plugins: [
|
|
87
|
-
require('@tailwindcss/forms')({ strategy: 'class' }),
|
|
88
|
-
require('@tailwindcss/aspect-ratio'),
|
|
89
|
-
require('@tailwindcss/typography'),
|
|
90
|
-
require('@tailwindcss/container-queries'),
|
|
91
|
-
plugin(({ addVariant }) => addVariant('hidden', '&([hidden])')),
|
|
92
|
-
plugin(({ addVariant }) => addVariant('visible', '&:not([hidden])')),
|
|
93
|
-
plugin(({ addVariant }) => addVariant('search-cancel', '&::-webkit-search-cancel-button')),
|
|
94
|
-
]
|
|
95
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
# Customizing tailwind
|
|
2
|
-
|
|
3
|
-
Solidus Admin uses [Tailwind CSS](https://tailwindcss.com/) for styling. The
|
|
4
|
-
benefit of using Tailwind is that it allows you to customize the look and feel
|
|
5
|
-
of the admin without having to write any CSS. By leveraging utility classes,
|
|
6
|
-
you can easily change the colors, fonts, and spacing in use.
|
|
7
|
-
|
|
8
|
-
Solidus Admin sets up Tailwind in a way that allows customization. When you
|
|
9
|
-
install `solidus_admin`, its compiled CSS file is generated at
|
|
10
|
-
`app/assets/builds/solidus_admin/tailwind.css`. As we'll see below, there are
|
|
11
|
-
different ways in which you can add your styles to it. There are a couple of
|
|
12
|
-
tasks you can run to recompile the CSS file:
|
|
13
|
-
|
|
14
|
-
- `bin/rails solidus_admin:tailwindcss:build` - compiles the CSS file once.
|
|
15
|
-
- `bin/rails solidus_admin:tailwindcss:watch` - compiles the CSS file and
|
|
16
|
-
watches for changes.
|
|
17
|
-
|
|
18
|
-
When deploying to production, the build task is automatically added as part of
|
|
19
|
-
the assets precompilation process.
|
|
20
|
-
|
|
21
|
-
### Adding new paths to Tailwind
|
|
22
|
-
|
|
23
|
-
Tailwind generates its CSS by scanning a configured set of paths for CSS
|
|
24
|
-
classes. By default, Solidus Admin will add to this list the following globs
|
|
25
|
-
from your host application:
|
|
26
|
-
|
|
27
|
-
- `app/components/solidus_admin/**/*.rb`
|
|
28
|
-
- `app/views/solidus_admin/**/*.{erb,haml,html,slim}`
|
|
29
|
-
- `app/helpers/solidus_admin/**/*.rb`
|
|
30
|
-
- `app/assets/javascripts/solidus_admin/**/*.js`
|
|
31
|
-
- `public/solidus_admin/*.html`
|
|
32
|
-
|
|
33
|
-
If that flexibility is not enough, you can add your own paths by appending the
|
|
34
|
-
`SolidusAdmin::Config.tailwind_content` setting:
|
|
35
|
-
|
|
36
|
-
```ruby
|
|
37
|
-
# config/initializers/solidus_admin.rb
|
|
38
|
-
SolidusAdmin::Config.tailwind_content << Rails.root.join("app/my/custom/path/**/*.rb")
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
> ⚠ Remember to re-run the `build` or `watch` tasks after changing this setting.
|
|
42
|
-
|
|
43
|
-
### Adding custom CSS
|
|
44
|
-
|
|
45
|
-
If you need advanced Tailwind customization, you can also create your own CSS
|
|
46
|
-
file and append it to the Solidus Admin's default one. Be aware that's
|
|
47
|
-
[considered a last-resort option](https://tailwindcss.com/docs/reusing-styles)
|
|
48
|
-
according to Tailwind's philosophy, and most of the time you should be ok by
|
|
49
|
-
making use of the available Tailwind classes.
|
|
50
|
-
|
|
51
|
-
In case you need to do it, you can append your CSS file by pushing it to the
|
|
52
|
-
`SolidusAdmin.tailwind_stylesheets` array:
|
|
53
|
-
|
|
54
|
-
```ruby
|
|
55
|
-
# config/initializers/solidus_admin.rb
|
|
56
|
-
SolidusAdmin.tailwind_stylesheets << Rails.root.join("app/my/custom/path/my_styles.css")
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
> ⚠ Remember to re-run the `build` or `watch` tasks after changing this setting.
|
|
60
|
-
|
|
61
|
-
## Acquiring full control over Tailwind configuration
|
|
62
|
-
|
|
63
|
-
For very advanced use cases, it's possible to bail out of the Solidus Admin's
|
|
64
|
-
managed Tailwind configuration and get a grip on it yourself. This is not
|
|
65
|
-
recommended, as it will make your app more brittle to future changes in Solidus
|
|
66
|
-
Admin, so do it at your own risk!
|
|
67
|
-
|
|
68
|
-
There are a couple of tasks you can run for that:
|
|
69
|
-
|
|
70
|
-
- `bin/rails solidus_admin:tailwindcss:override_config` - copies the default
|
|
71
|
-
Tailwind configuration file to `config/solidus_admin/tailwind.config.js.erb`.
|
|
72
|
-
- `bin/rails solidus_admin:tailwindcss:override_stylesheet` - copies the
|
|
73
|
-
default Tailwind stylesheet file to
|
|
74
|
-
`app/assets/stylesheets/solidus_admin/application.tailwind.css.erb`.
|
|
75
|
-
|
|
76
|
-
Notice that, unlike in a regular Tailwind setup, the config and stylesheet
|
|
77
|
-
files are ERB templates. This is because they need to be able to access the
|
|
78
|
-
Solidus Admin and application paths.
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "tailwindcss-rails"
|
|
4
|
-
require "fileutils"
|
|
5
|
-
|
|
6
|
-
module SolidusAdmin
|
|
7
|
-
# @api private
|
|
8
|
-
module Tailwindcss
|
|
9
|
-
module_function
|
|
10
|
-
|
|
11
|
-
def run(args = "")
|
|
12
|
-
config_file_path = compile_to_tempfile(
|
|
13
|
-
[config_app_path, config_engine_path].find(&:exist?),
|
|
14
|
-
"tailwind.config.js"
|
|
15
|
-
)
|
|
16
|
-
stylesheet_file_path = compile_to_tempfile(
|
|
17
|
-
[stylesheet_app_path, stylesheet_engine_path].find(&:exist?),
|
|
18
|
-
"application.tailwind.css"
|
|
19
|
-
)
|
|
20
|
-
|
|
21
|
-
system "#{::Tailwindcss::Engine.root.join('exe/tailwindcss')} \
|
|
22
|
-
-i #{stylesheet_file_path} \
|
|
23
|
-
-o #{Rails.root.join('app/assets/builds/solidus_admin/tailwind.css')} \
|
|
24
|
-
-c #{config_file_path} \
|
|
25
|
-
#{args}"
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
def config_app_path
|
|
29
|
-
Rails.root.join("config/solidus_admin/tailwind.config.js.erb")
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
def config_engine_path
|
|
33
|
-
SolidusAdmin::Engine.root.join("config/solidus_admin/tailwind.config.js.erb")
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
def stylesheet_app_path
|
|
37
|
-
Rails.root.join("app/assets/stylesheets/solidus_admin/application.tailwind.css.erb")
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
def stylesheet_engine_path
|
|
41
|
-
SolidusAdmin::Engine.root.join("app/assets/stylesheets/solidus_admin/application.tailwind.css.erb")
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
def compile_to_tempfile(erb_path, name)
|
|
45
|
-
Rails.root.join("tmp/solidus_admin/#{name}").tap do |file|
|
|
46
|
-
content = ERB.new(File.read(erb_path)).result
|
|
47
|
-
|
|
48
|
-
file.dirname.mkpath
|
|
49
|
-
file.write(content)
|
|
50
|
-
end
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
def copy_file(src, dst)
|
|
54
|
-
FileUtils.mkdir_p(File.dirname(dst))
|
|
55
|
-
FileUtils.cp(src, dst)
|
|
56
|
-
end
|
|
57
|
-
end
|
|
58
|
-
end
|
data/lib/tasks/tailwindcss.rake
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
namespace :solidus_admin do
|
|
4
|
-
namespace :tailwindcss do
|
|
5
|
-
require "solidus_admin/tailwindcss"
|
|
6
|
-
|
|
7
|
-
desc "Build Solidus Admin's Tailwind's css"
|
|
8
|
-
task build: :environment do
|
|
9
|
-
SolidusAdmin::Tailwindcss.run
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
desc <<~DESC
|
|
13
|
-
Watch and build Solidus Admin's Tailwind css on file changes
|
|
14
|
-
|
|
15
|
-
It needs to be re-run whenever:
|
|
16
|
-
|
|
17
|
-
- `SolidusAdmin::Config.tailwind_content` is updated
|
|
18
|
-
- `SolidusAdmin::Config.tailwind_stylesheets` is updated
|
|
19
|
-
- `bin/rails solidus_admin:tailwindcss:override_config` is run
|
|
20
|
-
- `bin/rails solidus_admin:tailwindcss:override_stylesheet` is run
|
|
21
|
-
- The override files are updated
|
|
22
|
-
DESC
|
|
23
|
-
task watch: :environment do
|
|
24
|
-
SolidusAdmin::Tailwindcss.run("-w")
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
desc <<~DESC
|
|
28
|
-
Override Solidus Admin's Tailwindcss configuration
|
|
29
|
-
|
|
30
|
-
It copies the config file from the engine to the app, so it can be customized.
|
|
31
|
-
DESC
|
|
32
|
-
task override_config: :environment do
|
|
33
|
-
SolidusAdmin::Tailwindcss.copy_file(
|
|
34
|
-
SolidusAdmin::Tailwindcss.config_engine_path,
|
|
35
|
-
SolidusAdmin::Tailwindcss.config_app_path
|
|
36
|
-
)
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
desc <<~DESC
|
|
40
|
-
Override Solidus Admin's Tailwind's stylesheet
|
|
41
|
-
|
|
42
|
-
It copies the stylesheet file from the engine to the app, so it can be customized.
|
|
43
|
-
DESC
|
|
44
|
-
task override_stylesheet: :environment do
|
|
45
|
-
SolidusAdmin::Tailwindcss.copy_file(
|
|
46
|
-
SolidusAdmin::Tailwindcss.stylesheet_engine_path,
|
|
47
|
-
SolidusAdmin::Tailwindcss.stylesheet_app_path
|
|
48
|
-
)
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
if Rake::Task.task_defined?("assets:precompile")
|
|
54
|
-
Rake::Task["assets:precompile"].enhance(["solidus_admin:tailwindcss:build"])
|
|
55
|
-
end
|
/data/app/components/solidus_admin/{sidebar/account_nav → layout/navigation/account}/component.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|