app/components/solidus_admin/ui/button/component.rb in solidus_admin-0.0.2 vs app/components/solidus_admin/ui/button/component.rb in solidus_admin-0.1.0

- old
+ new

@@ -1,67 +1,67 @@ # frozen_string_literal: true class SolidusAdmin::UI::Button::Component < SolidusAdmin::BaseComponent SIZES = { - s: %w[ + s: %{ h-7 w-7 p-1 text-xs font-semibold leading-none - ], - m: %w[ + }, + m: %{ h-9 w-9 p-1.5 text-sm font-semibold leading-none - ], - l: %w[ + }, + l: %{ h-12 w-12 p-2 text-base font-semibold leading-none - ], + }, } TEXT_PADDINGS = { - s: %w[px-1.5 w-auto], - m: %w[px-3 w-auto], - l: %w[px-4 w-auto], + s: %{px-1.5 w-auto}, + m: %{px-3 w-auto}, + l: %{px-4 w-auto}, } ICON_SIZES = { - s: %w[w-[1.4em] h-[1.4em]], - m: %w[w-[1.35em] h-[1.35em]], - l: %w[w-[1.5em] h-[1.5em]], + s: %{w-[1.4em] h-[1.4em]}, + m: %{w-[1.35em] h-[1.35em]}, + l: %{w-[1.5em] h-[1.5em]}, } SCHEMES = { - primary: %w[ + primary: %{ text-white bg-black hover:text-white hover:bg-gray-600 - active:text-white active:bg-gray-800 + active:text-white active:bg-gray-800 aria-current:text-white aria-current:bg-gray-800 focus:text-white focus:bg-gray-700 - disabled:text-gray-400 disabled:bg-gray-100 disabled:cursor-not-allowed - aria-disabled:text-gray-400 aria-disabled:bg-gray-100 aria-disabled:aria-disabled:cursor-not-allowed - ], - secondary: %w[ + disabled:text-gray-400 disabled:bg-gray-100 + aria-disabled:text-gray-400 aria-disabled:bg-gray-100 + }, + secondary: %{ text-gray-700 bg-white border border-1 border-gray-200 hover:bg-gray-50 - active:bg-gray-100 + active:bg-gray-100 aria-current:bg-gray-100 focus:bg-gray-50 - disabled:text-gray-300 disabled:bg-white disabled:cursor-not-allowed - aria-disabled:text-gray-300 aria-disabled:bg-white aria-disabled:cursor-not-allowed - ], - danger: %w[ + disabled:text-gray-300 disabled:bg-white + aria-disabled:text-gray-300 aria-disabled:bg-white + }, + danger: %{ text-red-500 bg-white border border-1 border-red-500 hover:bg-red-500 hover:border-red-600 hover:text-white - active:bg-red-600 active:border-red-700 active:text-white + active:bg-red-600 active:border-red-700 active:text-white aria-current:bg-red-600 aria-current:border-red-700 aria-current:text-white focus:bg-red-50 focus:bg-red-500 focus:border-red-600 focus:text-white - disabled:text-red-300 disabled:bg-white disabled:border-red-200 disabled:cursor-not-allowed - aria-disabled:text-red-300 aria-disabled:bg-white aria-disabled:border-red-200 aria-disabled:cursor-not-allowed - ], - ghost: %w[ + disabled:text-red-300 disabled:bg-white disabled:border-red-200 + aria-disabled:text-red-300 aria-disabled:bg-white aria-disabled:border-red-200 + }, + ghost: %{ text-gray-700 bg-transparent hover:bg-gray-50 - active:bg-gray-100 + active:bg-gray-100 aria-current:bg-gray-100 focus:bg-gray-50 focus:ring-gray-300 focus:ring-2 - disabled:text-gray-300 disabled:bg-transparent disabled:border-gray-300 disabled:cursor-not-allowed - aria-disabled:text-gray-300 aria-disabled:bg-transparent aria-disabled:border-gray-300 aria-disabled:cursor-not-allowed - ], + disabled:text-gray-300 disabled:bg-transparent disabled:border-gray-300 + aria-disabled:text-gray-300 aria-disabled:bg-transparent aria-disabled:border-gray-300 + }, } def initialize( tag: :button, text: nil,