shadcn-ui 0.0.13 → 0.0.15
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/app/helpers/components/date_picker_helper.rb +10 -0
- data/app/helpers/components/filter_helper.rb +1 -1
- data/app/helpers/components/table_helper.rb +6 -6
- data/app/javascript/controllers/ui/date-picker_controller.js +766 -0
- data/app/javascript/controllers/ui/select_controller.js +130 -0
- data/app/javascript/utils/bodyScrollLock.js +289 -0
- data/app/javascript/utils/iso_date.js +198 -0
- data/app/views/components/ui/_card.html.erb +1 -1
- data/app/views/components/ui/_date_picker.html.erb +13 -0
- data/app/views/components/ui/_filter.html.erb +16 -13
- data/app/views/components/ui/_list.html.erb +4 -4
- data/app/views/examples/components/accordion/code/_usage.erb +3 -3
- data/app/views/examples/components/date-picker/_usage.html.erb +19 -0
- data/app/views/examples/components/date-picker/code/_preview.erb +1 -0
- data/app/views/examples/components/date-picker/code/_usage.erb +1 -0
- data/app/views/examples/components/date-picker.html.erb +22 -0
- data/app/views/examples/components/dropdown-menu/code/_preview.erb +2 -2
- data/app/views/examples/components/dropdown-menu/code/_usage.erb +1 -1
- data/app/views/layouts/shared/_components.html.erb +1 -1
- data/config/importmap.rb +4 -1
- data/lib/shadcn-ui/version.rb +1 -1
- data/shadcn-ui.gemspec +1 -1
- metadata +14 -4
@@ -0,0 +1,19 @@
|
|
1
|
+
<p class="leading-7 [&:not(:first-child)]:mt-6">The Dropdown Menu component introduces:</p>
|
2
|
+
|
3
|
+
<ul class="my-6 ml-6 list-disc [&>li]:mt-2 text-sm">
|
4
|
+
<li><%= code("app/helpers/components/date_picker.rb") %></li>
|
5
|
+
<li><%= code("app/views/components/ui/_date_picker.html.erb") %></li>
|
6
|
+
<li><%= code("app/javascript/controllers/ui/date-picker_controller.js") %></li>
|
7
|
+
</ul>
|
8
|
+
|
9
|
+
<p class="leading-7 [&:not(:first-child)]:mt-6">
|
10
|
+
The method <%= code("render_date_picker") %> defined in <%= code("app/helpers/components/date_picker.rb") %>
|
11
|
+
accepts a block for the two inner components. Each of those accepts a block for their respective content.</p>
|
12
|
+
|
13
|
+
<p class="leading-7 [&:not(:first-child)]:mt-6">
|
14
|
+
Within the block, you can use the following methods:</p>
|
15
|
+
|
16
|
+
<ul class="my-6 ml-6 list-disc [&>li]:mt-2 text-sm">
|
17
|
+
<li> - accepts an argument for the label section of the dropdown menu. This is optional.</li>
|
18
|
+
<li> - an arbitrary amount of these can be used for each menu item you want to include. This method either accepts a string or a block for the content you want.</li>
|
19
|
+
</ul>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= render_date_picker name: 'date', value:'2024-05-01' %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= render_date_picker name: 'date', value:'2024-05-01' %>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<%= render_component_header title: "Date Picker",
|
2
|
+
description: "Displays a calendar to pick a date — triggered by a button." %>
|
3
|
+
|
4
|
+
<%= content_for :preview, flush: true do %>
|
5
|
+
<%= render_date_picker name: 'date', value:'2024-05-01' %>
|
6
|
+
<% end %>
|
7
|
+
|
8
|
+
<% content_for :code, flush: true do %>
|
9
|
+
<%= code_partial("date-picker/preview", :erb) %>
|
10
|
+
<% end %>
|
11
|
+
|
12
|
+
<%= render_preview %>
|
13
|
+
|
14
|
+
<h2 class="font-heading scroll-m-20 border-b pb-2 text-2xl font-semibold tracking-tight first:mt-0" id="installation">Installation</h2>
|
15
|
+
<%= code_sample(language: "sh") do %>
|
16
|
+
rails generate shadcn-ui date-picker
|
17
|
+
<% end %>
|
18
|
+
|
19
|
+
<h2 class="font-heading mt-12 scroll-m-20 border-b pb-2 mb-2 text-2xl font-semibold tracking-tight first:mt-0" id="usage">Usage</h2>
|
20
|
+
<%= code_partial("date-picker/usage", :erb) %>
|
21
|
+
|
22
|
+
<%= render_usage("date-picker") %>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
<%= render_dropdown_menu do %>
|
2
2
|
<%= dropdown_menu_trigger do %>
|
3
3
|
<%= render_button "Open Dropdown", variant: :outline %>
|
4
4
|
<% end %>
|
@@ -8,7 +8,7 @@
|
|
8
8
|
<%= render_separator class: "my-1" %>
|
9
9
|
<%= dropdown_menu_item "Profile" %>
|
10
10
|
<%= dropdown_menu_item do %>
|
11
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="
|
11
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-4 h-4 mr-2">
|
12
12
|
<rect width="20" height="14" x="2" y="5" rx="2"></rect><line x1="2" x2="22" y1="10" y2="10"></line>
|
13
13
|
</svg>
|
14
14
|
<span>Billing</span>
|
@@ -31,7 +31,7 @@
|
|
31
31
|
<%#= sidebar_link "Command", "/docs/components/command" %>
|
32
32
|
<%#= sidebar_link "Context Menu", "/docs/components/context-menu" %>
|
33
33
|
<%#= sidebar_link "Data Table", "/docs/components/data-table" %>
|
34
|
-
|
34
|
+
<%= sidebar_link "✅ 📖 Date Picker", "/docs/components/date-picker" %>
|
35
35
|
<%= sidebar_link "✅ 📖 Dialog", "/docs/components/dialog" %>
|
36
36
|
<%= sidebar_link "✅ 📖 Dropdown Menu", "/docs/components/dropdown-menu" %>
|
37
37
|
<%= sidebar_link "✅ 📖 Dropzone", "/docs/components/dropzone" %>
|
data/config/importmap.rb
CHANGED
@@ -4,10 +4,13 @@ pin "application", preload: true
|
|
4
4
|
pin "@hotwired/turbo-rails", to: "turbo.min.js", preload: true
|
5
5
|
pin "@hotwired/stimulus", to: "https://ga.jspm.io/npm:@hotwired/stimulus@3.2.1/dist/stimulus.js"
|
6
6
|
pin "@hotwired/stimulus-loading", to: "stimulus-loading.js", preload: true
|
7
|
+
|
7
8
|
pin_all_from "app/javascript/controllers", under: "controllers"
|
9
|
+
pin_all_from "app/javascript/utils", under: "utils"
|
10
|
+
|
8
11
|
pin "@kanety/stimulus-static-actions", to: "https://ga.jspm.io/npm:@kanety/stimulus-static-actions@1.0.1/dist/index.modern.js", preload: true
|
9
12
|
pin "highlight.js", to: "https://ga.jspm.io/npm:highlight.js@11.8.0/es/index.js", preload: true
|
10
|
-
pin "stimulus-use", to: "https://ga.jspm.io/npm:stimulus-use@0.
|
13
|
+
pin "stimulus-use", to: "https://ga.jspm.io/npm:stimulus-use@0.52.2/dist/index.js", preload: true
|
11
14
|
pin "stimulus-dropdown", to: "https://ga.jspm.io/npm:stimulus-dropdown@2.1.0/dist/stimulus-dropdown.mjs", preload: true
|
12
15
|
pin "hotkeys-js", to: "https://ga.jspm.io/npm:hotkeys-js@3.10.4/dist/hotkeys.esm.js", preload: true
|
13
16
|
pin "@popperjs/core", to: "https://ga.jspm.io/npm:@popperjs/core@2.11.8/lib/index.js", preload: true
|
data/lib/shadcn-ui/version.rb
CHANGED
data/shadcn-ui.gemspec
CHANGED
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
|
|
32
32
|
spec.require_paths = ["lib"]
|
33
33
|
|
34
34
|
# Uncomment to register a new dependency of your gem
|
35
|
-
spec.add_dependency "tailwind_merge", "~> 0.
|
35
|
+
spec.add_dependency "tailwind_merge", "~> 0.12"
|
36
36
|
|
37
37
|
# For more information and examples about making a new gem, check out our
|
38
38
|
# guide at: https://bundler.io/guides/creating_gem.html
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shadcn-ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Avi Flombaum
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tailwind_merge
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.12'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0.
|
26
|
+
version: '0.12'
|
27
27
|
description: This gem is a documentation site and gem that will copy components from
|
28
28
|
the shadcn-ui library into a Ruby on Rails application.
|
29
29
|
email:
|
@@ -70,6 +70,7 @@ files:
|
|
70
70
|
- app/helpers/components/checkbox_helper.rb
|
71
71
|
- app/helpers/components/collapsible_helper.rb
|
72
72
|
- app/helpers/components/combobox_helper.rb
|
73
|
+
- app/helpers/components/date_picker_helper.rb
|
73
74
|
- app/helpers/components/dialog_helper.rb
|
74
75
|
- app/helpers/components/dropdown_menu_helper.rb
|
75
76
|
- app/helpers/components/dropzone_helper.rb
|
@@ -105,12 +106,14 @@ files:
|
|
105
106
|
- app/javascript/controllers/ui/accordion_controller.js
|
106
107
|
- app/javascript/controllers/ui/checkbox_controller.js
|
107
108
|
- app/javascript/controllers/ui/collapsible_controller.js
|
109
|
+
- app/javascript/controllers/ui/date-picker_controller.js
|
108
110
|
- app/javascript/controllers/ui/dialog_controller.js
|
109
111
|
- app/javascript/controllers/ui/dropdown_controller.js
|
110
112
|
- app/javascript/controllers/ui/dropzone_controller.js
|
111
113
|
- app/javascript/controllers/ui/filter_controller.js
|
112
114
|
- app/javascript/controllers/ui/hover-card_controller.js
|
113
115
|
- app/javascript/controllers/ui/popover_controller.js
|
116
|
+
- app/javascript/controllers/ui/select_controller.js
|
114
117
|
- app/javascript/controllers/ui/sheet_controller.js
|
115
118
|
- app/javascript/controllers/ui/slider_controller.js
|
116
119
|
- app/javascript/controllers/ui/switch_controller.js
|
@@ -119,6 +122,8 @@ files:
|
|
119
122
|
- app/javascript/controllers/ui/toggle_controller.js
|
120
123
|
- app/javascript/controllers/ui/tooltip_controller.js
|
121
124
|
- app/javascript/controllers/ui/transition_controller.js
|
125
|
+
- app/javascript/utils/bodyScrollLock.js
|
126
|
+
- app/javascript/utils/iso_date.js
|
122
127
|
- app/jobs/application_job.rb
|
123
128
|
- app/mailers/application_mailer.rb
|
124
129
|
- app/models/application_record.rb
|
@@ -134,6 +139,7 @@ files:
|
|
134
139
|
- app/views/components/ui/_collapsible.html.erb
|
135
140
|
- app/views/components/ui/_combobox.html.erb
|
136
141
|
- app/views/components/ui/_command.html.erb
|
142
|
+
- app/views/components/ui/_date_picker.html.erb
|
137
143
|
- app/views/components/ui/_dialog.html.erb
|
138
144
|
- app/views/components/ui/_dropdown_menu.html.erb
|
139
145
|
- app/views/components/ui/_dropzone.html.erb
|
@@ -211,6 +217,10 @@ files:
|
|
211
217
|
- app/views/examples/components/combobox/_usage.html.erb
|
212
218
|
- app/views/examples/components/combobox/code/_preview.erb
|
213
219
|
- app/views/examples/components/combobox/code/_usage.erb
|
220
|
+
- app/views/examples/components/date-picker.html.erb
|
221
|
+
- app/views/examples/components/date-picker/_usage.html.erb
|
222
|
+
- app/views/examples/components/date-picker/code/_preview.erb
|
223
|
+
- app/views/examples/components/date-picker/code/_usage.erb
|
214
224
|
- app/views/examples/components/dialog.html.erb
|
215
225
|
- app/views/examples/components/dialog/_usage.html.erb
|
216
226
|
- app/views/examples/components/dialog/code/_form.erb
|