From ee93649e78b2db7337be8e6906fdcfd0a691722f Mon Sep 17 00:00:00 2001 From: Cirdes Date: Thu, 8 Aug 2024 13:23:19 +0000 Subject: [PATCH] Adding Combobox to the menu --- app/views/components/shared/menu.rb | 75 +---------------------------- 1 file changed, 1 insertion(+), 74 deletions(-) diff --git a/app/views/components/shared/menu.rb b/app/views/components/shared/menu.rb index bbc1b07..fde2fdf 100644 --- a/app/views/components/shared/menu.rb +++ b/app/views/components/shared/menu.rb @@ -39,31 +39,6 @@ def view_template menu_link(component) end end - - # COMPONENTS COMING SOON - h4(class: "mb-1 mt-4 rounded-md px-2 py-1 text-sm font-semibold flex items-center gap-x-2") do - plain "Coming Soon" - Badge(variant: :primary, size: :sm) { components_coming_soon.count.to_s } - svg( - xmlns: "http://www.w3.org/2000/svg", - viewbox: "0 0 24 24", - fill: "currentColor", - class: "w-4 h-4 text-amber-400" - ) do |s| - s.path( - fill_rule: "evenodd", - d: - "M9 4.5a.75.75 0 01.721.544l.813 2.846a3.75 3.75 0 002.576 2.576l2.846.813a.75.75 0 010 1.442l-2.846.813a3.75 3.75 0 00-2.576 2.576l-.813 2.846a.75.75 0 01-1.442 0l-.813-2.846a3.75 3.75 0 00-2.576-2.576l-2.846-.813a.75.75 0 010-1.442l2.846-.813A3.75 3.75 0 007.466 7.89l.813-2.846A.75.75 0 019 4.5zM18 1.5a.75.75 0 01.728.568l.258 1.036c.236.94.97 1.674 1.91 1.91l1.036.258a.75.75 0 010 1.456l-1.036.258c-.94.236-1.674.97-1.91 1.91l-.258 1.036a.75.75 0 01-1.456 0l-.258-1.036a2.625 2.625 0 00-1.91-1.91l-1.036-.258a.75.75 0 010-1.456l1.036-.258a2.625 2.625 0 001.91-1.91l.258-1.036A.75.75 0 0118 1.5zM16.5 15a.75.75 0 01.712.513l.394 1.183c.15.447.5.799.948.948l1.183.395a.75.75 0 010 1.422l-1.183.395c-.447.15-.799.5-.948.948l-.395 1.183a.75.75 0 01-1.422 0l-.395-1.183a1.5 1.5 0 00-.948-.948l-1.183-.395a.75.75 0 010-1.422l1.183-.395c.447-.15.799-.5.948-.948l.395-1.183A.75.75 0 0116.5 15z", - clip_rule: "evenodd" - ) - end - end - - div(class: "grid grid-flow-row auto-rows-max text-sm") do - components_coming_soon.each do |component| - menu_link(component) - end - end end end @@ -99,6 +74,7 @@ def components {name: "Checkbox", path: helpers.docs_checkbox_path}, {name: "Codeblock", path: helpers.docs_codeblock_path}, {name: "Collapsible", path: helpers.docs_collapsible_path}, + {name: "Combobox", path: helpers.docs_combobox_path}, {name: "Command", path: helpers.docs_command_path}, {name: "Context Menu", path: helpers.docs_context_menu_path}, {name: "Date Picker", path: helpers.docs_date_picker_path}, @@ -120,37 +96,6 @@ def components ] end - def components_coming_soon - [ - {name: "Autosave", path: "#"}, - {name: "Carousel", path: "#"}, - {name: "Chart", path: "#"}, - {name: "Clipboard", path: "#"}, - {name: "Color Picker", path: "#"}, - {name: "Combobox", path: "#"}, - {name: "Data Table", path: "#"}, - {name: "Form", path: "#"}, - {name: "Menu Bar", path: "#"}, - {name: "Multi Select", path: "#"}, - {name: "Navigation Menu", path: "#"}, - {name: "Progress", path: "#"}, - {name: "Radio Group", path: "#"}, - {name: "Read more", path: "#"}, - {name: "Rich text editor", path: "#"}, - {name: "Scroll Area", path: "#"}, - {name: "Select", path: "#"}, - {name: "Separator", path: "#"}, - {name: "Skeleton Loader", path: "#"}, - {name: "Slider", path: "#"}, - {name: "Switch", path: "#"}, - {name: "Textarea (Autogrow)", path: "#"}, - {name: "Toast (Swipe to dismiss)", path: "#"}, - {name: "Toggle", path: "#"}, - {name: "Turbo Dialog / Modal", path: "#"}, - {name: "Video Player", path: "#"} - ] - end - def menu_link(component) component[:premium] ||= false current_path = component[:path] == helpers.request.path @@ -168,22 +113,4 @@ def main_link(name, path) name end end - - def premium_status(component) - if component[:premium] - svg( - xmlns: "http://www.w3.org/2000/svg", - viewbox: "0 0 24 24", - fill: "currentColor", - class: "w-3 h-3 text-violet-500 ml-2" - ) do |s| - s.path( - fill_rule: "evenodd", - d: - "M12 1.5a5.25 5.25 0 00-5.25 5.25v3a3 3 0 00-3 3v6.75a3 3 0 003 3h10.5a3 3 0 003-3v-6.75a3 3 0 00-3-3v-3c0-2.9-2.35-5.25-5.25-5.25zm3.75 8.25v-3a3.75 3.75 0 10-7.5 0v3h7.5z", - clip_rule: "evenodd" - ) - end - end - end end