velvetkit 0.4.1 → 0.5.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/CHANGELOG.md +143 -2
- data/lib/velvetkit/version.rb +1 -1
- data/registry/app/components/ui/accordion/trigger.rb +1 -1
- data/registry/app/components/ui/badge.rb +1 -1
- data/registry/app/components/ui/base.rb +2 -2
- data/registry/app/components/ui/button.rb +1 -1
- data/registry/app/components/ui/card/action.html.erb +1 -0
- data/registry/app/components/ui/card/action.rb +14 -0
- data/registry/app/components/ui/card/content.html.erb +1 -1
- data/registry/app/components/ui/card/content.rb +4 -2
- data/registry/app/components/ui/card/description.html.erb +1 -1
- data/registry/app/components/ui/card/description.rb +4 -2
- data/registry/app/components/ui/card/footer.html.erb +1 -1
- data/registry/app/components/ui/card/footer.rb +4 -2
- data/registry/app/components/ui/card/header.html.erb +1 -1
- data/registry/app/components/ui/card/header.rb +9 -2
- data/registry/app/components/ui/card/title.html.erb +1 -1
- data/registry/app/components/ui/card/title.rb +4 -2
- data/registry/app/components/ui/card.html.erb +1 -1
- data/registry/app/components/ui/card.rb +49 -3
- data/registry/app/components/ui/carousel.html.erb +7 -0
- data/registry/app/components/ui/carousel.rb +60 -0
- data/registry/app/components/ui/chart.html.erb +3 -3
- data/registry/app/components/ui/chart.rb +18 -10
- data/registry/app/components/ui/checkbox.html.erb +6 -0
- data/registry/app/components/ui/checkbox.rb +11 -4
- data/registry/app/components/ui/fieldset.html.erb +6 -0
- data/registry/app/components/ui/fieldset.rb +76 -0
- data/registry/app/components/ui/gallery/image.rb +14 -1
- data/registry/app/components/ui/gallery.html.erb +32 -3
- data/registry/app/components/ui/gallery.rb +46 -7
- data/registry/app/components/ui/link.rb +1 -1
- data/registry/app/components/ui/menu/item.rb +1 -1
- data/registry/app/components/ui/radio_group/item.html.erb +1 -1
- data/registry/app/components/ui/radio_group/item.rb +5 -1
- data/registry/app/components/ui/radio_group.html.erb +1 -1
- data/registry/app/components/ui/radio_group.rb +42 -2
- data/registry/app/components/ui/scrubber.html.erb +18 -0
- data/registry/app/components/ui/scrubber.rb +62 -0
- data/registry/app/components/ui/select.html.erb +1 -1
- data/registry/app/components/ui/select.rb +16 -1
- data/registry/app/components/ui/selection_bar.html.erb +7 -0
- data/registry/app/components/ui/selection_bar.rb +75 -0
- data/registry/app/components/ui/sidebar/group_label.rb +1 -1
- data/registry/app/components/ui/sidebar/inset.rb +5 -2
- data/registry/app/components/ui/sidebar/menu_button.rb +24 -9
- data/registry/app/components/ui/sidebar/menu_item.html.erb +1 -1
- data/registry/app/components/ui/sidebar/menu_item.rb +31 -5
- data/registry/app/components/ui/sidebar/menu_sub.rb +59 -0
- data/registry/app/components/ui/sidebar.html.erb +3 -3
- data/registry/app/components/ui/sidebar.rb +91 -13
- data/registry/app/components/ui/switch.rb +2 -2
- data/registry/app/components/ui/table/column.html.erb +1 -1
- data/registry/app/components/ui/table/column.rb +26 -2
- data/registry/app/components/ui/table/head.html.erb +1 -1
- data/registry/app/components/ui/table/head.rb +15 -2
- data/registry/app/components/ui/table/row.html.erb +1 -1
- data/registry/app/components/ui/table/row.rb +19 -5
- data/registry/app/components/ui/table.html.erb +2 -2
- data/registry/app/components/ui/table.rb +29 -4
- data/registry/app/components/ui/tabs/trigger.rb +1 -1
- data/registry/app/components/ui/toggle_group.html.erb +1 -1
- data/registry/app/components/ui/toggle_group.rb +26 -3
- data/registry/app/javascript/controllers/ui/carousel_controller.ts +63 -0
- data/registry/app/javascript/controllers/ui/file_field_controller.ts +1 -1
- data/registry/app/javascript/controllers/ui/gallery_controller.ts +52 -14
- data/registry/app/javascript/controllers/ui/scrubber_controller.ts +188 -0
- data/registry/app/javascript/controllers/ui/selection_bar_controller.ts +122 -0
- data/registry/app/javascript/controllers/ui/sidebar_controller.ts +102 -32
- data/registry/components.yml +12 -4
- data/registry/config/locales/velvetkit.en.yml +16 -0
- data/registry/icons/lucide/arrow-down.svg +16 -0
- data/registry/icons/lucide/arrow-up.svg +16 -0
- data/registry/icons/lucide/image.svg +17 -0
- data/registry/icons/lucide/star.svg +15 -0
- data/registry/icons/phosphor/arrow-down.svg +2 -0
- data/registry/icons/phosphor/arrow-up.svg +2 -0
- data/registry/icons/phosphor/image.svg +2 -0
- data/registry/icons/phosphor/star.svg +2 -0
- data/registry/icons/tabler/arrow-down.svg +18 -0
- data/registry/icons/tabler/arrow-up.svg +18 -0
- data/registry/icons/tabler/photo.svg +19 -0
- data/registry/icons/tabler/star.svg +16 -0
- data/registry/icons.yml +4 -0
- data/registry/test/components/previews/ui/card_preview/edge_to_edge.html.erb +19 -0
- data/registry/test/components/previews/ui/card_preview/image.html.erb +12 -0
- data/registry/test/components/previews/ui/card_preview/just_content.html.erb +10 -0
- data/registry/test/components/previews/ui/card_preview/open_bill.html.erb +18 -0
- data/registry/test/components/previews/ui/card_preview/playground.html.erb +17 -0
- data/registry/test/components/previews/ui/card_preview/settings_form.html.erb +15 -24
- data/registry/test/components/previews/ui/card_preview/sign_in.html.erb +23 -0
- data/registry/test/components/previews/ui/card_preview/small.html.erb +17 -0
- data/registry/test/components/previews/ui/card_preview/spacing.html.erb +13 -0
- data/registry/test/components/previews/ui/card_preview/stats.html.erb +11 -0
- data/registry/test/components/previews/ui/card_preview/team.html.erb +21 -0
- data/registry/test/components/previews/ui/card_preview.rb +42 -28
- data/registry/test/components/previews/ui/carousel_preview/highlights.html.erb +17 -0
- data/registry/test/components/previews/ui/carousel_preview.rb +22 -0
- data/registry/test/components/previews/ui/chart_preview/whole_dollars.html.erb +19 -0
- data/registry/test/components/previews/ui/chart_preview.rb +7 -1
- data/registry/test/components/previews/ui/checkbox_preview/in_form.html.erb +2 -3
- data/registry/test/components/previews/ui/fieldset_preview/block_of_fields.html.erb +18 -0
- data/registry/test/components/previews/ui/fieldset_preview/groups.html.erb +14 -0
- data/registry/test/components/previews/ui/fieldset_preview/model_errors.html.erb +22 -0
- data/registry/test/components/previews/ui/fieldset_preview/playground.html.erb +5 -0
- data/registry/test/components/previews/ui/fieldset_preview.rb +24 -0
- data/registry/test/components/previews/ui/gallery_preview/grid.html.erb +25 -0
- data/registry/test/components/previews/ui/gallery_preview.rb +3 -0
- data/registry/test/components/previews/ui/scrubber_preview/default.html.erb +24 -0
- data/registry/test/components/previews/ui/scrubber_preview.rb +6 -0
- data/registry/test/components/previews/ui/selection_bar_preview/floating.html.erb +16 -0
- data/registry/test/components/previews/ui/selection_bar_preview/table.html.erb +26 -0
- data/registry/test/components/previews/ui/selection_bar_preview.rb +9 -0
- data/registry/test/components/previews/ui/sidebar_preview/_shell.html.erb +5 -4
- data/registry/test/components/previews/ui/sidebar_preview/pill_links.html.erb +52 -0
- data/registry/test/components/previews/ui/sidebar_preview.rb +3 -0
- data/registry/test/components/previews/ui/table_preview/selectable.html.erb +26 -0
- data/registry/test/components/previews/ui/table_preview/sortable.html.erb +20 -0
- data/registry/test/components/previews/ui/table_preview/sticky_header.html.erb +13 -0
- data/registry/test/components/previews/ui/table_preview.rb +9 -0
- data/registry/test/components/ui/button_test.rb +2 -2
- data/registry/test/components/ui/card/action_test.rb +19 -0
- data/registry/test/components/ui/card/content_test.rb +1 -11
- data/registry/test/components/ui/card/footer_test.rb +3 -2
- data/registry/test/components/ui/card/header_test.rb +3 -4
- data/registry/test/components/ui/card/title_test.rb +3 -4
- data/registry/test/components/ui/card_test.rb +63 -2
- data/registry/test/components/ui/carousel_test.rb +38 -0
- data/registry/test/components/ui/chart_test.rb +20 -0
- data/registry/test/components/ui/checkbox_test.rb +11 -2
- data/registry/test/components/ui/fieldset_test.rb +119 -0
- data/registry/test/components/ui/gallery_test.rb +40 -5
- data/registry/test/components/ui/link_test.rb +1 -1
- data/registry/test/components/ui/number_input_test.rb +1 -1
- data/registry/test/components/ui/radio_group_test.rb +106 -0
- data/registry/test/components/ui/scrubber_test.rb +43 -0
- data/registry/test/components/ui/select_test.rb +21 -0
- data/registry/test/components/ui/selection_bar_test.rb +46 -0
- data/registry/test/components/ui/sidebar/menu_button_test.rb +9 -0
- data/registry/test/components/ui/sidebar_test.rb +79 -1
- data/registry/test/components/ui/switch_test.rb +4 -4
- data/registry/test/components/ui/toggle_group_test.rb +45 -0
- metadata +60 -5
- data/registry/test/components/previews/ui/card_preview/complete.html.erb +0 -31
- data/registry/test/components/previews/ui/card_preview/default.html.erb +0 -7
- data/registry/test/components/previews/ui/card_preview/with_footer.html.erb +0 -13
- data/registry/test/components/previews/ui/card_preview/with_header.html.erb +0 -11
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "test_helper"
|
|
4
|
+
|
|
5
|
+
class UI::SelectionBarTest < ViewComponent::TestCase
|
|
6
|
+
def setup_fixtures(*); end
|
|
7
|
+
def teardown_fixtures(*); end
|
|
8
|
+
|
|
9
|
+
def test_starts_hidden_and_watches_the_list_it_names
|
|
10
|
+
render_inline(UI::SelectionBar.new(for: "customers"))
|
|
11
|
+
bar = page.find("[data-slot=selection-bar][role=region][aria-label='Selection']", visible: :all)
|
|
12
|
+
assert bar[:hidden]
|
|
13
|
+
assert_equal "ui--selection-bar", bar[:"data-controller"]
|
|
14
|
+
assert_equal "customers", bar[:"data-ui--selection-bar-for-value"]
|
|
15
|
+
assert_equal "%{count} selected", bar[:"data-ui--selection-bar-other-value"]
|
|
16
|
+
assert_includes bar[:class], "sticky"
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def test_clear_button_and_live_count
|
|
20
|
+
render_inline(UI::SelectionBar.new(for: "photos"))
|
|
21
|
+
assert_selector "button[aria-label='Clear selection'][data-action='ui--selection-bar#clear'] svg[data-icon='x']", visible: :all
|
|
22
|
+
assert_selector "p[aria-live=polite][data-ui--selection-bar-target=count]", visible: :all
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def test_actions_and_placement
|
|
26
|
+
render_inline(UI::SelectionBar.new(for: "photos", placement: :floating, label: "Chosen photos", class: "bottom-8")) do |bar|
|
|
27
|
+
bar.with_action { "<button>Archive</button>".html_safe }
|
|
28
|
+
bar.with_action { "<button>Delete</button>".html_safe }
|
|
29
|
+
end
|
|
30
|
+
bar = page.find("[data-slot=selection-bar]", visible: :all)
|
|
31
|
+
assert_equal "Chosen photos", bar[:"aria-label"]
|
|
32
|
+
assert_equal "floating", bar[:"data-placement"]
|
|
33
|
+
assert_includes bar[:class], "rounded-full"
|
|
34
|
+
assert_includes bar[:class], "bottom-8"
|
|
35
|
+
assert_equal %w[Archive Delete], bar.all("div button", visible: :all).map { |b| b.text(:all) }
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def test_checkbox_for_any_list
|
|
39
|
+
render_inline(UI::SelectionBar.checkbox(:item, name: "ids[]", value: "cat-2", form: "selection", label: "Select Curled up", class: "rounded-full"))
|
|
40
|
+
box = page.find("input[type=checkbox]")
|
|
41
|
+
assert_equal "item", box[:"data-selection"]
|
|
42
|
+
assert_equal "selection", box[:form]
|
|
43
|
+
assert_equal "Select Curled up", box[:"aria-label"]
|
|
44
|
+
assert_includes box[:class], "rounded-full"
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -23,6 +23,15 @@ class UI::Sidebar::MenuButtonTest < ViewComponent::TestCase
|
|
|
23
23
|
assert_includes classes, "hover:bg-sidebar-accent"
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
+
def test_pill_shape_fills_the_current_page
|
|
27
|
+
render_inline(UI::Sidebar::MenuButton.new("#", active: true, shape: :pill)) { "Photos" }
|
|
28
|
+
link = page.find("a", text: "Photos")
|
|
29
|
+
assert_equal "pill", link[:"data-shape"]
|
|
30
|
+
assert_includes link[:class], "rounded-full"
|
|
31
|
+
assert_includes link[:class], "h-10"
|
|
32
|
+
refute_includes link[:class].split, "bg-accent"
|
|
33
|
+
end
|
|
34
|
+
|
|
26
35
|
def test_allows_aria_current
|
|
27
36
|
render_inline(UI::Sidebar::MenuButton.new("#", current: "page")) { "Dashboard" }
|
|
28
37
|
link = page.find("a", text: "Dashboard")
|
|
@@ -26,7 +26,69 @@ class UI::SidebarTest < ViewComponent::TestCase
|
|
|
26
26
|
render_sidebar
|
|
27
27
|
aside = page.find("aside[data-ui--sidebar-target='sidebar']")
|
|
28
28
|
assert_equal "expanded", aside[:"data-state"]
|
|
29
|
-
|
|
29
|
+
# Empty while open: the collapsed styles hang off "icon" and "offcanvas".
|
|
30
|
+
assert_equal "", aside[:"data-collapsible"]
|
|
31
|
+
assert_equal "icon", aside[:"data-collapsible-mode"]
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def test_collapsed_says_how
|
|
35
|
+
render_sidebar(collapsible: :offcanvas, state: :collapsed)
|
|
36
|
+
aside = page.find("aside")
|
|
37
|
+
assert_equal "collapsed", aside[:"data-state"]
|
|
38
|
+
assert_equal "offcanvas", aside[:"data-collapsible"]
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def test_a_sidebar_that_cannot_collapse_stays_open
|
|
42
|
+
render_sidebar(collapsible: :none, state: :collapsed)
|
|
43
|
+
assert_equal "expanded", page.find("aside")[:"data-state"]
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def test_starts_as_the_reader_last_left_it
|
|
47
|
+
vc_test_request.set_header("HTTP_COOKIE", "ui_sidebar_main_sidebar=collapsed")
|
|
48
|
+
render_sidebar(id: "main-sidebar")
|
|
49
|
+
aside = page.find("aside#main-sidebar")
|
|
50
|
+
assert_equal "collapsed", aside[:"data-state"]
|
|
51
|
+
assert_equal "ui_sidebar_main_sidebar", aside[:"data-cookie"]
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def test_a_drawer_with_a_backdrop_on_phones
|
|
55
|
+
render_sidebar
|
|
56
|
+
assert_selector "[data-slot=sidebar-backdrop][data-action='click->ui--sidebar#close']", visible: :all
|
|
57
|
+
container = page.find("[data-slot=sidebar-container]")
|
|
58
|
+
assert_includes container[:class], "group-data-[mobile=open]:translate-x-0"
|
|
59
|
+
assert_includes container[:class], "md:sticky"
|
|
60
|
+
assert_includes container[:class], "md:max-h-full"
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def test_sub_menu_opens_for_its_current_page
|
|
64
|
+
render_inline(UI::Sidebar.new) do |sidebar|
|
|
65
|
+
sidebar.with_sidebar_content do |content|
|
|
66
|
+
content.with_sidebar_group do |group|
|
|
67
|
+
group.with_menu do |menu|
|
|
68
|
+
menu.with_menu_item do |item|
|
|
69
|
+
item.with_menu_button("/albums", shape: :pill) { "Albums" }
|
|
70
|
+
item.with_sub_menu(name: "Albums") do |sub|
|
|
71
|
+
sub.with_item("/albums/1") { "Coast" }
|
|
72
|
+
sub.with_item("/albums/2", active: true) { "Garden" }
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
menu.with_menu_item do |item|
|
|
76
|
+
item.with_menu_button("/places") { "Places" }
|
|
77
|
+
item.with_sub_menu(name: "Places") { |sub| sub.with_item("/places/1") { "Lisbon" } }
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
toggles = page.all("button[data-action='ui--sidebar#toggleSub']")
|
|
85
|
+
assert_equal %w[true false], toggles.map { |toggle| toggle[:"aria-expanded"] }
|
|
86
|
+
assert_equal "Show the links under Albums", toggles.first[:"aria-label"]
|
|
87
|
+
albums = page.find("ul##{toggles.first[:"aria-controls"]}")
|
|
88
|
+
assert_selector "a[href='/albums/2'][aria-current=page]", text: "Garden"
|
|
89
|
+
assert_nil albums[:hidden]
|
|
90
|
+
assert page.find("ul##{toggles.last[:"aria-controls"]}", visible: :all)[:hidden]
|
|
91
|
+
assert_selector "a[data-shape=pill]", text: "Albums"
|
|
30
92
|
end
|
|
31
93
|
|
|
32
94
|
def test_custom_id_preserved
|
|
@@ -40,4 +102,20 @@ class UI::SidebarTest < ViewComponent::TestCase
|
|
|
40
102
|
assert_includes classes, "custom-sidebar"
|
|
41
103
|
assert_includes classes, "peer"
|
|
42
104
|
end
|
|
105
|
+
|
|
106
|
+
def test_inset_classes_replace_the_ones_they_clash_with
|
|
107
|
+
render_inline(UI::Sidebar::Inset.new(class: "bg-transparent md:peer-data-[variant=inset]:shadow-none")) { "Main" }
|
|
108
|
+
classes = page.find("main")[:class].split
|
|
109
|
+
assert_includes classes, "bg-transparent"
|
|
110
|
+
refute_includes classes, "bg-background"
|
|
111
|
+
refute_includes classes, "md:peer-data-[variant=inset]:shadow-sm"
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# An inset or floating sidebar pads its panel, so collapsed it's that much wider.
|
|
115
|
+
def test_a_padded_sidebar_keeps_room_for_its_icons_when_collapsed
|
|
116
|
+
render_sidebar(variant: :inset, state: :collapsed)
|
|
117
|
+
assert_includes page.find("aside")[:class], "md:data-[variant=inset]:data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+1rem)]"
|
|
118
|
+
assert_includes page.find("[data-slot=sidebar-container]")[:class],
|
|
119
|
+
"md:group-data-[variant=inset]:group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+1rem)]"
|
|
120
|
+
end
|
|
43
121
|
end
|
|
@@ -87,12 +87,12 @@ class UI::SwitchTest < ViewComponent::TestCase
|
|
|
87
87
|
def test_track_span_has_focus_ring_via_peer_focus_visible
|
|
88
88
|
render_inline(UI::Switch.new(name: "notify"))
|
|
89
89
|
track = page.all("span", visible: :all).find { |s|
|
|
90
|
-
s[:class].to_s.include?("peer-focus:ring-2")
|
|
90
|
+
s[:class].to_s.include?("peer-focus-visible:ring-2")
|
|
91
91
|
}
|
|
92
|
-
assert track, "track span with peer-focus:ring-2 should exist"
|
|
92
|
+
assert track, "track span with peer-focus-visible:ring-2 should exist"
|
|
93
93
|
classes = track[:class].split
|
|
94
|
-
assert_includes classes, "peer-focus:ring-primary"
|
|
95
|
-
assert_includes classes, "peer-focus:ring-offset-1"
|
|
94
|
+
assert_includes classes, "peer-focus-visible:ring-primary"
|
|
95
|
+
assert_includes classes, "peer-focus-visible:ring-offset-1"
|
|
96
96
|
end
|
|
97
97
|
|
|
98
98
|
# ── Thumb ────────────────────────────────────────────────────────────────────
|
|
@@ -159,4 +159,49 @@ class UI::ToggleGroupTest < ViewComponent::TestCase
|
|
|
159
159
|
refute_includes root[:class].split, "w-fit"
|
|
160
160
|
assert_selector "label.flex-1[data-test-id='a'][data-slot='toggle-group-item']"
|
|
161
161
|
end
|
|
162
|
+
|
|
163
|
+
def test_a_legend_makes_the_fieldset_the_group
|
|
164
|
+
render_inline(UI::ToggleGroup.new(name: "view", label: "View", legend: "Layout", hint: "How results are shown.")) do |group|
|
|
165
|
+
group.with_item(value: "list", label: "List")
|
|
166
|
+
end
|
|
167
|
+
fieldset = page.find("fieldset[role='radiogroup'][aria-label='View']")
|
|
168
|
+
assert_equal "#{fieldset[:id]}-legend", fieldset[:"aria-labelledby"]
|
|
169
|
+
assert_selector "fieldset > div[data-slot='toggle-group']:not([role]):not([aria-label])"
|
|
170
|
+
assert_selector "[role='radiogroup']", count: 1
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
def test_a_multiple_group_in_a_fieldset_is_a_group
|
|
174
|
+
render_inline(UI::ToggleGroup.new(name: "styles", multiple: true, legend: "Styles")) do |group|
|
|
175
|
+
group.with_item(value: "bold", label: "Bold")
|
|
176
|
+
end
|
|
177
|
+
assert_selector "fieldset[role='group']:not([aria-required])"
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
def test_a_bound_group_shows_the_models_error
|
|
181
|
+
record = Struct.new(:align) do
|
|
182
|
+
include ActiveModel::Validations
|
|
183
|
+
def self.model_name = ActiveModel::Name.new(self, nil, "Post")
|
|
184
|
+
validates :align, presence: true
|
|
185
|
+
end.new(nil).tap(&:validate)
|
|
186
|
+
form = ActionView::Helpers::FormBuilder.new(:post, record, vc_test_controller.view_context, {})
|
|
187
|
+
render_inline(UI::ToggleGroup.new(form: form, field: :align, label: "Alignment")) do |group|
|
|
188
|
+
group.with_item(value: "left", label: "Left")
|
|
189
|
+
end
|
|
190
|
+
assert_selector "fieldset[role='radiogroup'][aria-invalid='true'][aria-label='Alignment']"
|
|
191
|
+
assert_selector "p.text-destructive", text: "Align can't be blank"
|
|
192
|
+
assert_no_selector "legend"
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
def test_renders_no_whitespace_around_itself
|
|
196
|
+
render_group
|
|
197
|
+
assert rendered_content.start_with?("<div"), rendered_content[0, 20].inspect
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
def test_your_aria_attributes_move_to_the_fieldset
|
|
201
|
+
render_inline(UI::ToggleGroup.new(name: "view", hint: "How results are shown.", aria: { labelledby: "view-heading" })) do |group|
|
|
202
|
+
group.with_item(value: "list", label: "List")
|
|
203
|
+
end
|
|
204
|
+
assert_selector "fieldset[role='radiogroup'][aria-labelledby='view-heading']"
|
|
205
|
+
assert_no_selector "div[data-slot='toggle-group'][aria-labelledby]"
|
|
206
|
+
end
|
|
162
207
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: velvetkit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Rathan Kumar
|
|
@@ -95,6 +95,8 @@ files:
|
|
|
95
95
|
- registry/app/components/ui/button_to.rb
|
|
96
96
|
- registry/app/components/ui/card.html.erb
|
|
97
97
|
- registry/app/components/ui/card.rb
|
|
98
|
+
- registry/app/components/ui/card/action.html.erb
|
|
99
|
+
- registry/app/components/ui/card/action.rb
|
|
98
100
|
- registry/app/components/ui/card/content.html.erb
|
|
99
101
|
- registry/app/components/ui/card/content.rb
|
|
100
102
|
- registry/app/components/ui/card/description.html.erb
|
|
@@ -105,6 +107,8 @@ files:
|
|
|
105
107
|
- registry/app/components/ui/card/header.rb
|
|
106
108
|
- registry/app/components/ui/card/title.html.erb
|
|
107
109
|
- registry/app/components/ui/card/title.rb
|
|
110
|
+
- registry/app/components/ui/carousel.html.erb
|
|
111
|
+
- registry/app/components/ui/carousel.rb
|
|
108
112
|
- registry/app/components/ui/chart.html.erb
|
|
109
113
|
- registry/app/components/ui/chart.rb
|
|
110
114
|
- registry/app/components/ui/checkbox.html.erb
|
|
@@ -141,6 +145,8 @@ files:
|
|
|
141
145
|
- registry/app/components/ui/divider.rb
|
|
142
146
|
- registry/app/components/ui/empty_state.html.erb
|
|
143
147
|
- registry/app/components/ui/empty_state.rb
|
|
148
|
+
- registry/app/components/ui/fieldset.html.erb
|
|
149
|
+
- registry/app/components/ui/fieldset.rb
|
|
144
150
|
- registry/app/components/ui/file_field.html.erb
|
|
145
151
|
- registry/app/components/ui/file_field.rb
|
|
146
152
|
- registry/app/components/ui/form_field.html.erb
|
|
@@ -212,8 +218,12 @@ files:
|
|
|
212
218
|
- registry/app/components/ui/radio_group/item.rb
|
|
213
219
|
- registry/app/components/ui/scan_input.html.erb
|
|
214
220
|
- registry/app/components/ui/scan_input.rb
|
|
221
|
+
- registry/app/components/ui/scrubber.html.erb
|
|
222
|
+
- registry/app/components/ui/scrubber.rb
|
|
215
223
|
- registry/app/components/ui/select.html.erb
|
|
216
224
|
- registry/app/components/ui/select.rb
|
|
225
|
+
- registry/app/components/ui/selection_bar.html.erb
|
|
226
|
+
- registry/app/components/ui/selection_bar.rb
|
|
217
227
|
- registry/app/components/ui/session_tabs.html.erb
|
|
218
228
|
- registry/app/components/ui/session_tabs.rb
|
|
219
229
|
- registry/app/components/ui/session_tabs/add.html.erb
|
|
@@ -246,6 +256,7 @@ files:
|
|
|
246
256
|
- registry/app/components/ui/sidebar/menu_button.rb
|
|
247
257
|
- registry/app/components/ui/sidebar/menu_item.html.erb
|
|
248
258
|
- registry/app/components/ui/sidebar/menu_item.rb
|
|
259
|
+
- registry/app/components/ui/sidebar/menu_sub.rb
|
|
249
260
|
- registry/app/components/ui/sidebar/trigger.html.erb
|
|
250
261
|
- registry/app/components/ui/sidebar/trigger.rb
|
|
251
262
|
- registry/app/components/ui/sidebar/wrapper.html.erb
|
|
@@ -329,6 +340,7 @@ files:
|
|
|
329
340
|
- registry/app/javascript/controllers/ui/accordion_controller.ts
|
|
330
341
|
- registry/app/javascript/controllers/ui/alert_controller.ts
|
|
331
342
|
- registry/app/javascript/controllers/ui/banner_controller.ts
|
|
343
|
+
- registry/app/javascript/controllers/ui/carousel_controller.ts
|
|
332
344
|
- registry/app/javascript/controllers/ui/chart_controller.ts
|
|
333
345
|
- registry/app/javascript/controllers/ui/command_controller.ts
|
|
334
346
|
- registry/app/javascript/controllers/ui/confirm_dialog_controller.ts
|
|
@@ -346,7 +358,9 @@ files:
|
|
|
346
358
|
- registry/app/javascript/controllers/ui/popover_controller.ts
|
|
347
359
|
- registry/app/javascript/controllers/ui/progress_controller.ts
|
|
348
360
|
- registry/app/javascript/controllers/ui/scan_input_controller.ts
|
|
361
|
+
- registry/app/javascript/controllers/ui/scrubber_controller.ts
|
|
349
362
|
- registry/app/javascript/controllers/ui/select_controller.ts
|
|
363
|
+
- registry/app/javascript/controllers/ui/selection_bar_controller.ts
|
|
350
364
|
- registry/app/javascript/controllers/ui/session_tabs_controller.ts
|
|
351
365
|
- registry/app/javascript/controllers/ui/sidebar_controller.ts
|
|
352
366
|
- registry/app/javascript/controllers/ui/slider_controller.ts
|
|
@@ -367,8 +381,10 @@ files:
|
|
|
367
381
|
- registry/icons/lucide/align-center.svg
|
|
368
382
|
- registry/icons/lucide/align-left.svg
|
|
369
383
|
- registry/icons/lucide/align-right.svg
|
|
384
|
+
- registry/icons/lucide/arrow-down.svg
|
|
370
385
|
- registry/icons/lucide/arrow-left.svg
|
|
371
386
|
- registry/icons/lucide/arrow-right.svg
|
|
387
|
+
- registry/icons/lucide/arrow-up.svg
|
|
372
388
|
- registry/icons/lucide/badge-check.svg
|
|
373
389
|
- registry/icons/lucide/bar-chart-3.svg
|
|
374
390
|
- registry/icons/lucide/bell.svg
|
|
@@ -400,6 +416,7 @@ files:
|
|
|
400
416
|
- registry/icons/lucide/graduation-cap.svg
|
|
401
417
|
- registry/icons/lucide/grip-vertical.svg
|
|
402
418
|
- registry/icons/lucide/home.svg
|
|
419
|
+
- registry/icons/lucide/image.svg
|
|
403
420
|
- registry/icons/lucide/inbox.svg
|
|
404
421
|
- registry/icons/lucide/info.svg
|
|
405
422
|
- registry/icons/lucide/italic.svg
|
|
@@ -433,6 +450,7 @@ files:
|
|
|
433
450
|
- registry/icons/lucide/settings.svg
|
|
434
451
|
- registry/icons/lucide/shield-check.svg
|
|
435
452
|
- registry/icons/lucide/shield.svg
|
|
453
|
+
- registry/icons/lucide/star.svg
|
|
436
454
|
- registry/icons/lucide/store.svg
|
|
437
455
|
- registry/icons/lucide/sun-moon.svg
|
|
438
456
|
- registry/icons/lucide/sun.svg
|
|
@@ -451,8 +469,10 @@ files:
|
|
|
451
469
|
- registry/icons/lucide/zoom-out.svg
|
|
452
470
|
- registry/icons/phosphor/LICENSE
|
|
453
471
|
- registry/icons/phosphor/arrow-clockwise.svg
|
|
472
|
+
- registry/icons/phosphor/arrow-down.svg
|
|
454
473
|
- registry/icons/phosphor/arrow-left.svg
|
|
455
474
|
- registry/icons/phosphor/arrow-right.svg
|
|
475
|
+
- registry/icons/phosphor/arrow-up.svg
|
|
456
476
|
- registry/icons/phosphor/barcode.svg
|
|
457
477
|
- registry/icons/phosphor/bell.svg
|
|
458
478
|
- registry/icons/phosphor/book-open.svg
|
|
@@ -487,6 +507,7 @@ files:
|
|
|
487
507
|
- registry/icons/phosphor/graduation-cap.svg
|
|
488
508
|
- registry/icons/phosphor/grid-four.svg
|
|
489
509
|
- registry/icons/phosphor/house.svg
|
|
510
|
+
- registry/icons/phosphor/image.svg
|
|
490
511
|
- registry/icons/phosphor/info.svg
|
|
491
512
|
- registry/icons/phosphor/kanban.svg
|
|
492
513
|
- registry/icons/phosphor/keyboard.svg
|
|
@@ -516,6 +537,7 @@ files:
|
|
|
516
537
|
- registry/icons/phosphor/speaker-x.svg
|
|
517
538
|
- registry/icons/phosphor/spinner.svg
|
|
518
539
|
- registry/icons/phosphor/squares-four.svg
|
|
540
|
+
- registry/icons/phosphor/star.svg
|
|
519
541
|
- registry/icons/phosphor/storefront.svg
|
|
520
542
|
- registry/icons/phosphor/sun.svg
|
|
521
543
|
- registry/icons/phosphor/text-align-center.svg
|
|
@@ -538,8 +560,10 @@ files:
|
|
|
538
560
|
- registry/icons/tabler/align-center.svg
|
|
539
561
|
- registry/icons/tabler/align-left.svg
|
|
540
562
|
- registry/icons/tabler/align-right.svg
|
|
563
|
+
- registry/icons/tabler/arrow-down.svg
|
|
541
564
|
- registry/icons/tabler/arrow-left.svg
|
|
542
565
|
- registry/icons/tabler/arrow-right.svg
|
|
566
|
+
- registry/icons/tabler/arrow-up.svg
|
|
543
567
|
- registry/icons/tabler/barcode.svg
|
|
544
568
|
- registry/icons/tabler/bell.svg
|
|
545
569
|
- registry/icons/tabler/bold.svg
|
|
@@ -588,6 +612,7 @@ files:
|
|
|
588
612
|
- registry/icons/tabler/news.svg
|
|
589
613
|
- registry/icons/tabler/package.svg
|
|
590
614
|
- registry/icons/tabler/percentage.svg
|
|
615
|
+
- registry/icons/tabler/photo.svg
|
|
591
616
|
- registry/icons/tabler/player-pause.svg
|
|
592
617
|
- registry/icons/tabler/plus.svg
|
|
593
618
|
- registry/icons/tabler/printer.svg
|
|
@@ -603,6 +628,7 @@ files:
|
|
|
603
628
|
- registry/icons/tabler/shield-check.svg
|
|
604
629
|
- registry/icons/tabler/shield.svg
|
|
605
630
|
- registry/icons/tabler/sitemap.svg
|
|
631
|
+
- registry/icons/tabler/star.svg
|
|
606
632
|
- registry/icons/tabler/sun-moon.svg
|
|
607
633
|
- registry/icons/tabler/sun.svg
|
|
608
634
|
- registry/icons/tabler/trash.svg
|
|
@@ -664,11 +690,19 @@ files:
|
|
|
664
690
|
- registry/test/components/previews/ui/button_to_preview/variants.html.erb
|
|
665
691
|
- registry/test/components/previews/ui/button_to_preview/with_icon.html.erb
|
|
666
692
|
- registry/test/components/previews/ui/card_preview.rb
|
|
667
|
-
- registry/test/components/previews/ui/card_preview/
|
|
668
|
-
- registry/test/components/previews/ui/card_preview/
|
|
693
|
+
- registry/test/components/previews/ui/card_preview/edge_to_edge.html.erb
|
|
694
|
+
- registry/test/components/previews/ui/card_preview/image.html.erb
|
|
695
|
+
- registry/test/components/previews/ui/card_preview/just_content.html.erb
|
|
696
|
+
- registry/test/components/previews/ui/card_preview/open_bill.html.erb
|
|
697
|
+
- registry/test/components/previews/ui/card_preview/playground.html.erb
|
|
669
698
|
- registry/test/components/previews/ui/card_preview/settings_form.html.erb
|
|
670
|
-
- registry/test/components/previews/ui/card_preview/
|
|
671
|
-
- registry/test/components/previews/ui/card_preview/
|
|
699
|
+
- registry/test/components/previews/ui/card_preview/sign_in.html.erb
|
|
700
|
+
- registry/test/components/previews/ui/card_preview/small.html.erb
|
|
701
|
+
- registry/test/components/previews/ui/card_preview/spacing.html.erb
|
|
702
|
+
- registry/test/components/previews/ui/card_preview/stats.html.erb
|
|
703
|
+
- registry/test/components/previews/ui/card_preview/team.html.erb
|
|
704
|
+
- registry/test/components/previews/ui/carousel_preview.rb
|
|
705
|
+
- registry/test/components/previews/ui/carousel_preview/highlights.html.erb
|
|
672
706
|
- registry/test/components/previews/ui/chart_preview.rb
|
|
673
707
|
- registry/test/components/previews/ui/chart_preview/cash_flow.html.erb
|
|
674
708
|
- registry/test/components/previews/ui/chart_preview/donut.html.erb
|
|
@@ -677,6 +711,7 @@ files:
|
|
|
677
711
|
- registry/test/components/previews/ui/chart_preview/sales.html.erb
|
|
678
712
|
- registry/test/components/previews/ui/chart_preview/stock.html.erb
|
|
679
713
|
- registry/test/components/previews/ui/chart_preview/takings.html.erb
|
|
714
|
+
- registry/test/components/previews/ui/chart_preview/whole_dollars.html.erb
|
|
680
715
|
- registry/test/components/previews/ui/checkbox_preview.rb
|
|
681
716
|
- registry/test/components/previews/ui/checkbox_preview/in_form.html.erb
|
|
682
717
|
- registry/test/components/previews/ui/checkbox_preview/states.html.erb
|
|
@@ -725,6 +760,11 @@ files:
|
|
|
725
760
|
- registry/test/components/previews/ui/empty_state_preview/outline.html.erb
|
|
726
761
|
- registry/test/components/previews/ui/empty_state_preview/with_actions.html.erb
|
|
727
762
|
- registry/test/components/previews/ui/empty_state_preview/with_media.html.erb
|
|
763
|
+
- registry/test/components/previews/ui/fieldset_preview.rb
|
|
764
|
+
- registry/test/components/previews/ui/fieldset_preview/block_of_fields.html.erb
|
|
765
|
+
- registry/test/components/previews/ui/fieldset_preview/groups.html.erb
|
|
766
|
+
- registry/test/components/previews/ui/fieldset_preview/model_errors.html.erb
|
|
767
|
+
- registry/test/components/previews/ui/fieldset_preview/playground.html.erb
|
|
728
768
|
- registry/test/components/previews/ui/file_field_preview.rb
|
|
729
769
|
- registry/test/components/previews/ui/file_field_preview/multiple_files.html.erb
|
|
730
770
|
- registry/test/components/previews/ui/file_field_preview/product_photos.html.erb
|
|
@@ -735,6 +775,7 @@ files:
|
|
|
735
775
|
- registry/test/components/previews/ui/form_field_preview/default.html.erb
|
|
736
776
|
- registry/test/components/previews/ui/form_field_preview/model_errors.html.erb
|
|
737
777
|
- registry/test/components/previews/ui/gallery_preview.rb
|
|
778
|
+
- registry/test/components/previews/ui/gallery_preview/grid.html.erb
|
|
738
779
|
- registry/test/components/previews/ui/gallery_preview/hover_zoom.html.erb
|
|
739
780
|
- registry/test/components/previews/ui/gallery_preview/landscape.html.erb
|
|
740
781
|
- registry/test/components/previews/ui/gallery_preview/product_page.html.erb
|
|
@@ -823,6 +864,8 @@ files:
|
|
|
823
864
|
- registry/test/components/previews/ui/scan_input_preview/stock_count.html.erb
|
|
824
865
|
- registry/test/components/previews/ui/scan_input_preview/ticket_check_in.html.erb
|
|
825
866
|
- registry/test/components/previews/ui/scan_input_preview/till.html.erb
|
|
867
|
+
- registry/test/components/previews/ui/scrubber_preview.rb
|
|
868
|
+
- registry/test/components/previews/ui/scrubber_preview/default.html.erb
|
|
826
869
|
- registry/test/components/previews/ui/select_preview.rb
|
|
827
870
|
- registry/test/components/previews/ui/select_preview/default.html.erb
|
|
828
871
|
- registry/test/components/previews/ui/select_preview/long_list.html.erb
|
|
@@ -830,6 +873,9 @@ files:
|
|
|
830
873
|
- registry/test/components/previews/ui/select_preview/server_search.html.erb
|
|
831
874
|
- registry/test/components/previews/ui/select_preview/sizes.html.erb
|
|
832
875
|
- registry/test/components/previews/ui/select_preview/states.html.erb
|
|
876
|
+
- registry/test/components/previews/ui/selection_bar_preview.rb
|
|
877
|
+
- registry/test/components/previews/ui/selection_bar_preview/floating.html.erb
|
|
878
|
+
- registry/test/components/previews/ui/selection_bar_preview/table.html.erb
|
|
833
879
|
- registry/test/components/previews/ui/session_tabs_preview.rb
|
|
834
880
|
- registry/test/components/previews/ui/session_tabs_preview/handling_events.html.erb
|
|
835
881
|
- registry/test/components/previews/ui/session_tabs_preview/saved_views.html.erb
|
|
@@ -845,6 +891,7 @@ files:
|
|
|
845
891
|
- registry/test/components/previews/ui/sidebar_preview/_shell.html.erb
|
|
846
892
|
- registry/test/components/previews/ui/sidebar_preview/collapsible.html.erb
|
|
847
893
|
- registry/test/components/previews/ui/sidebar_preview/default.html.erb
|
|
894
|
+
- registry/test/components/previews/ui/sidebar_preview/pill_links.html.erb
|
|
848
895
|
- registry/test/components/previews/ui/sidebar_preview/with_dropdown_header.html.erb
|
|
849
896
|
- registry/test/components/previews/ui/sidebar_preview/with_groups.html.erb
|
|
850
897
|
- registry/test/components/previews/ui/skeleton_preview.rb
|
|
@@ -883,6 +930,9 @@ files:
|
|
|
883
930
|
- registry/test/components/previews/ui/table_preview.rb
|
|
884
931
|
- registry/test/components/previews/ui/table_preview/customers.html.erb
|
|
885
932
|
- registry/test/components/previews/ui/table_preview/empty.html.erb
|
|
933
|
+
- registry/test/components/previews/ui/table_preview/selectable.html.erb
|
|
934
|
+
- registry/test/components/previews/ui/table_preview/sortable.html.erb
|
|
935
|
+
- registry/test/components/previews/ui/table_preview/sticky_header.html.erb
|
|
886
936
|
- registry/test/components/previews/ui/table_preview/with_caption.html.erb
|
|
887
937
|
- registry/test/components/previews/ui/tabs_preview.rb
|
|
888
938
|
- registry/test/components/previews/ui/tabs_preview/default.html.erb
|
|
@@ -949,12 +999,14 @@ files:
|
|
|
949
999
|
- registry/test/components/ui/breadcrumb_test.rb
|
|
950
1000
|
- registry/test/components/ui/button_test.rb
|
|
951
1001
|
- registry/test/components/ui/button_to_test.rb
|
|
1002
|
+
- registry/test/components/ui/card/action_test.rb
|
|
952
1003
|
- registry/test/components/ui/card/content_test.rb
|
|
953
1004
|
- registry/test/components/ui/card/description_test.rb
|
|
954
1005
|
- registry/test/components/ui/card/footer_test.rb
|
|
955
1006
|
- registry/test/components/ui/card/header_test.rb
|
|
956
1007
|
- registry/test/components/ui/card/title_test.rb
|
|
957
1008
|
- registry/test/components/ui/card_test.rb
|
|
1009
|
+
- registry/test/components/ui/carousel_test.rb
|
|
958
1010
|
- registry/test/components/ui/chart_test.rb
|
|
959
1011
|
- registry/test/components/ui/checkbox_test.rb
|
|
960
1012
|
- registry/test/components/ui/collapsible_test.rb
|
|
@@ -969,6 +1021,7 @@ files:
|
|
|
969
1021
|
- registry/test/components/ui/dialog_test.rb
|
|
970
1022
|
- registry/test/components/ui/divider_test.rb
|
|
971
1023
|
- registry/test/components/ui/empty_state_test.rb
|
|
1024
|
+
- registry/test/components/ui/fieldset_test.rb
|
|
972
1025
|
- registry/test/components/ui/file_field_test.rb
|
|
973
1026
|
- registry/test/components/ui/form_field/messages_test.rb
|
|
974
1027
|
- registry/test/components/ui/form_field_test.rb
|
|
@@ -1000,7 +1053,9 @@ files:
|
|
|
1000
1053
|
- registry/test/components/ui/radio_group/item_test.rb
|
|
1001
1054
|
- registry/test/components/ui/radio_group_test.rb
|
|
1002
1055
|
- registry/test/components/ui/scan_input_test.rb
|
|
1056
|
+
- registry/test/components/ui/scrubber_test.rb
|
|
1003
1057
|
- registry/test/components/ui/select_test.rb
|
|
1058
|
+
- registry/test/components/ui/selection_bar_test.rb
|
|
1004
1059
|
- registry/test/components/ui/session_tabs/add_test.rb
|
|
1005
1060
|
- registry/test/components/ui/session_tabs_test.rb
|
|
1006
1061
|
- registry/test/components/ui/sheet/content_test.rb
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
<div class="max-w-sm">
|
|
2
|
-
<%= render(UI::Card.new) do |card| %>
|
|
3
|
-
<% card.with_header do |header| %>
|
|
4
|
-
<% header.with_title { "Team Members" } %>
|
|
5
|
-
<% header.with_description { "Manage your team and permissions." } %>
|
|
6
|
-
<% end %>
|
|
7
|
-
<% card.with_content do %>
|
|
8
|
-
<div class="space-y-3">
|
|
9
|
-
<div class="flex items-center gap-3">
|
|
10
|
-
<div class="h-8 w-8 rounded-full bg-primary/10 flex items-center justify-center text-xs font-medium text-primary">JD</div>
|
|
11
|
-
<div>
|
|
12
|
-
<p class="text-sm font-medium">John Doe</p>
|
|
13
|
-
<p class="text-xs text-muted-foreground">Admin</p>
|
|
14
|
-
</div>
|
|
15
|
-
</div>
|
|
16
|
-
<div class="flex items-center gap-3">
|
|
17
|
-
<div class="h-8 w-8 rounded-full bg-primary/10 flex items-center justify-center text-xs font-medium text-primary">AS</div>
|
|
18
|
-
<div>
|
|
19
|
-
<p class="text-sm font-medium">Alice Smith</p>
|
|
20
|
-
<p class="text-xs text-muted-foreground">Editor</p>
|
|
21
|
-
</div>
|
|
22
|
-
</div>
|
|
23
|
-
</div>
|
|
24
|
-
<% end %>
|
|
25
|
-
<% card.with_footer do %>
|
|
26
|
-
<div class="flex gap-2 w-full">
|
|
27
|
-
<%= render(UI::Button.new(variant: :outline, size: :sm, class: "w-full")) { "Invite Member" } %>
|
|
28
|
-
</div>
|
|
29
|
-
<% end %>
|
|
30
|
-
<% end %>
|
|
31
|
-
</div>
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<div class="max-w-sm">
|
|
2
|
-
<%= render(UI::Card.new) do |card| %>
|
|
3
|
-
<% card.with_content do %>
|
|
4
|
-
<p class="text-sm text-muted-foreground">Card with body content and a footer containing actions.</p>
|
|
5
|
-
<% end %>
|
|
6
|
-
<% card.with_footer do %>
|
|
7
|
-
<div class="flex gap-2">
|
|
8
|
-
<%= render(UI::Button.new(variant: :primary, size: :sm)) { "Save" } %>
|
|
9
|
-
<%= render(UI::Button.new(variant: :outline, size: :sm)) { "Cancel" } %>
|
|
10
|
-
</div>
|
|
11
|
-
<% end %>
|
|
12
|
-
<% end %>
|
|
13
|
-
</div>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
<div class="max-w-sm">
|
|
2
|
-
<%= render(UI::Card.new) do |card| %>
|
|
3
|
-
<% card.with_header do |header| %>
|
|
4
|
-
<% header.with_title { "Notifications" } %>
|
|
5
|
-
<% header.with_description { "Configure how you receive notifications." } %>
|
|
6
|
-
<% end %>
|
|
7
|
-
<% card.with_content do %>
|
|
8
|
-
<p class="text-sm text-muted-foreground">Card with a header containing a title and description.</p>
|
|
9
|
-
<% end %>
|
|
10
|
-
<% end %>
|
|
11
|
-
</div>
|