shadcn-ui 0.0.1
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 +7 -0
- data/.editorconfig +10 -0
- data/.prettierignore +43 -0
- data/.prettierrc.json +28 -0
- data/.rspec +1 -0
- data/.ruby-version +1 -0
- data/.vscode/settings.json +11 -0
- data/CHANGELOG.md +6 -0
- data/CODE_OF_CONDUCT.md +113 -0
- data/LICENSE.md +18 -0
- data/Procfile.dev +2 -0
- data/README.md +90 -0
- data/Rakefile +12 -0
- data/app/assets/builds/.keep +0 -0
- data/app/assets/config/manifest.js +5 -0
- data/app/assets/images/.keep +0 -0
- data/app/assets/stylesheets/application.scss +42 -0
- data/app/assets/stylesheets/application.tailwind.css +92 -0
- data/app/assets/stylesheets/lambda.light.scss +136 -0
- data/app/channels/application_cable/channel.rb +4 -0
- data/app/channels/application_cable/connection.rb +4 -0
- data/app/controllers/application_controller.rb +8 -0
- data/app/controllers/components_controller.rb +7 -0
- data/app/controllers/concerns/.keep +0 -0
- data/app/helpers/application_helper.rb +2 -0
- data/app/helpers/components/accordion_helper.rb +5 -0
- data/app/helpers/components/alert_dialog_helper.rb +6 -0
- data/app/helpers/components/alert_helper.rb +11 -0
- data/app/helpers/components/badge_helper.rb +20 -0
- data/app/helpers/components/button_helper.rb +20 -0
- data/app/helpers/components/card_helper.rb +5 -0
- data/app/helpers/components/checkbox_helper.rb +5 -0
- data/app/helpers/components/collapsible_helper.rb +6 -0
- data/app/helpers/components/dialog_helper.rb +14 -0
- data/app/helpers/components/dropdown_menu_helper.rb +23 -0
- data/app/helpers/components/hover_card_helper.rb +15 -0
- data/app/helpers/components/popover_helper.rb +15 -0
- data/app/helpers/components/seperator_helper.rb +6 -0
- data/app/helpers/components/textarea_helper.rb +13 -0
- data/app/helpers/components/toast_helper.rb +5 -0
- data/app/helpers/components/toggle_helper.rb +6 -0
- data/app/helpers/components/tooltip_helper.rb +15 -0
- data/app/helpers/components_helper.rb +7 -0
- data/app/helpers/examples_helper.rb +41 -0
- data/app/javascript/application.js +3 -0
- data/app/javascript/controllers/application.js +9 -0
- data/app/javascript/controllers/hello_controller.js +7 -0
- data/app/javascript/controllers/highlight_controller.js +9 -0
- data/app/javascript/controllers/index.js +11 -0
- data/app/javascript/controllers/tabs_controller.js +72 -0
- data/app/javascript/controllers/ui/accordion_controller.js +128 -0
- data/app/javascript/controllers/ui/checkbox_controller.js +17 -0
- data/app/javascript/controllers/ui/collapsible_controller.js +28 -0
- data/app/javascript/controllers/ui/dialog_controller.js +92 -0
- data/app/javascript/controllers/ui/dropdown_controller.js +25 -0
- data/app/javascript/controllers/ui/hover-card_controller.js +39 -0
- data/app/javascript/controllers/ui/popover_controller.js +27 -0
- data/app/javascript/controllers/ui/toast_controller.js +43 -0
- data/app/javascript/controllers/ui/toggle_controller.js +15 -0
- data/app/javascript/controllers/ui/tooltip_controller.js +3 -0
- data/app/javascript/controllers/ui/transition_controller.js +8 -0
- data/app/jobs/application_job.rb +7 -0
- data/app/mailers/application_mailer.rb +4 -0
- data/app/models/application_record.rb +3 -0
- data/app/models/concerns/.keep +0 -0
- data/app/views/application/index.html.erb +0 -0
- data/app/views/components/ui/_accordion.html.erb +40 -0
- data/app/views/components/ui/_alert.html.erb +55 -0
- data/app/views/components/ui/_alert_dialog.html.erb +20 -0
- data/app/views/components/ui/_badge.html.erb +1 -0
- data/app/views/components/ui/_button.html.erb +11 -0
- data/app/views/components/ui/_card.html.erb +13 -0
- data/app/views/components/ui/_checkbox.html.erb +37 -0
- data/app/views/components/ui/_collapsible.html.erb +38 -0
- data/app/views/components/ui/_dialog.html.erb +69 -0
- data/app/views/components/ui/_dropdown_menu.html.erb +9 -0
- data/app/views/components/ui/_hover_card.html.erb +18 -0
- data/app/views/components/ui/_popover.html.erb +19 -0
- data/app/views/components/ui/_separator.html.erb +4 -0
- data/app/views/components/ui/_textarea.html.erb +9 -0
- data/app/views/components/ui/_toast.html.erb +34 -0
- data/app/views/components/ui/_toggle.html.erb +3 -0
- data/app/views/components/ui/_tooltip.html.erb +18 -0
- data/app/views/components/ui/shared/_dialog_background.html.erb +7 -0
- data/app/views/components/ui/shared/_menu_item.html.erb +6 -0
- data/app/views/examples/authentication/index.html.erb +148 -0
- data/app/views/examples/components/accordion.html.erb +17 -0
- data/app/views/examples/components/alert-dialog.html.erb +24 -0
- data/app/views/examples/components/alert.html.erb +22 -0
- data/app/views/examples/components/badge.html.erb +30 -0
- data/app/views/examples/components/button.html.erb +33 -0
- data/app/views/examples/components/card.html.erb +156 -0
- data/app/views/examples/components/checkbox.html.erb +8 -0
- data/app/views/examples/components/collapsible.html.erb +24 -0
- data/app/views/examples/components/dialog/_usage.html.erb +28 -0
- data/app/views/examples/components/dialog/code/form.erb +48 -0
- data/app/views/examples/components/dialog/code/notifications.erb +83 -0
- data/app/views/examples/components/dialog/code/preview.erb +14 -0
- data/app/views/examples/components/dialog/code/usage.erb +8 -0
- data/app/views/examples/components/dialog.html.erb +148 -0
- data/app/views/examples/components/dropdown-menu.html.erb +26 -0
- data/app/views/examples/components/hover-card.html.erb +24 -0
- data/app/views/examples/components/popover.html.erb +34 -0
- data/app/views/examples/components/separator.html.erb +33 -0
- data/app/views/examples/components/textarea.html.erb +12 -0
- data/app/views/examples/components/toast.html.erb +15 -0
- data/app/views/examples/components/toggle.html.erb +12 -0
- data/app/views/examples/components/tooltip.html.erb +23 -0
- data/app/views/layouts/_sidebar.html.erb +270 -0
- data/app/views/layouts/application.html.erb +33 -0
- data/app/views/layouts/component.html.erb +35 -0
- data/app/views/layouts/documentation/_breadcrumb.html.erb +17 -0
- data/app/views/layouts/documentation/_component_header.html.erb +11 -0
- data/app/views/layouts/documentation/_examples.html.erb +80 -0
- data/app/views/layouts/documentation/_preview.html.erb +90 -0
- data/app/views/layouts/mailer.html.erb +13 -0
- data/app/views/layouts/mailer.text.erb +1 -0
- data/app/views/layouts/shared/_header.html.erb +164 -0
- data/config/application.rb +37 -0
- data/config/boot.rb +4 -0
- data/config/cable.yml +11 -0
- data/config/credentials.yml.enc +1 -0
- data/config/database.yml +25 -0
- data/config/environment.rb +5 -0
- data/config/environments/development.rb +70 -0
- data/config/environments/production.rb +93 -0
- data/config/environments/test.rb +60 -0
- data/config/importmap.rb +13 -0
- data/config/initializers/assets.rb +12 -0
- data/config/initializers/content_security_policy.rb +25 -0
- data/config/initializers/filter_parameter_logging.rb +8 -0
- data/config/initializers/inflections.rb +16 -0
- data/config/initializers/permissions_policy.rb +11 -0
- data/config/locales/en.yml +33 -0
- data/config/puma.rb +43 -0
- data/config/render.yml +9 -0
- data/config/routes.rb +7 -0
- data/config/storage.yml +34 -0
- data/config/tailwind.config.js +86 -0
- data/config.ru +6 -0
- data/db/seeds.rb +7 -0
- data/lib/assets/.keep +0 -0
- data/lib/generators/shadcn_ui_generator.rb +32 -0
- data/lib/shadcn-ui/shadcn-ui.rb +8 -0
- data/lib/shadcn-ui/version.rb +3 -0
- data/lib/tasks/.keep +0 -0
- data/log/.keep +0 -0
- data/package-lock.json +1014 -0
- data/package.json +8 -0
- data/public/404.html +67 -0
- data/public/422.html +67 -0
- data/public/500.html +66 -0
- data/public/android-chrome-192x192.png +0 -0
- data/public/android-chrome-512x512.png +0 -0
- data/public/apple-touch-icon-precomposed.png +0 -0
- data/public/apple-touch-icon.png +0 -0
- data/public/favicon-16x16.png +0 -0
- data/public/favicon-32x32.png +0 -0
- data/public/favicon.ico +0 -0
- data/public/og.jpg +0 -0
- data/public/robots.txt +1 -0
- data/sig/shadcn-ui.rbs +4 -0
- data/storage/.keep +0 -0
- data/tmp/.keep +0 -0
- data/tmp/pids/.keep +0 -0
- data/tmp/storage/.keep +0 -0
- data/vendor/.keep +0 -0
- data/vendor/javascript/.keep +0 -0
- metadata +214 -0
@@ -0,0 +1,25 @@
|
|
1
|
+
// Inspired By: https://github.com/stimulus-components/stimulus-dropdown/blob/master/src/index.ts
|
2
|
+
import { Controller } from "@hotwired/stimulus";
|
3
|
+
import { useTransition } from "stimulus-use";
|
4
|
+
|
5
|
+
export default class extends Controller {
|
6
|
+
// menuTarget: HTMLElement
|
7
|
+
// toggleTransition: (event?: Event) => void
|
8
|
+
// leave: (event?: Event) => void
|
9
|
+
// transitioned: false
|
10
|
+
// static targets = ['menu']
|
11
|
+
// connect (): void {
|
12
|
+
// useTransition(this, {
|
13
|
+
// element: this.menuTarget
|
14
|
+
// })
|
15
|
+
// }
|
16
|
+
// toggle (): void {
|
17
|
+
// this.toggleTransition()
|
18
|
+
// }
|
19
|
+
// hide (event: Event): void {
|
20
|
+
// // @ts-ignore
|
21
|
+
// if (!this.element.contains(event.target) && !this.menuTarget.classList.contains('hidden')) {
|
22
|
+
// this.leave()
|
23
|
+
// }
|
24
|
+
// }
|
25
|
+
}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
// Inspired by: https://github.com/excid3/tailwindcss-stimulus-components/blob/master/src/popover.js
|
2
|
+
|
3
|
+
import { Controller } from "@hotwired/stimulus";
|
4
|
+
import { createPopper } from "@popperjs/core";
|
5
|
+
import { useDebounce } from "stimulus-use";
|
6
|
+
import { useHover } from "stimulus-use";
|
7
|
+
|
8
|
+
export default class UIHoverCardController extends Controller {
|
9
|
+
static debounces = ["mouseEnter", "mouseLeave"];
|
10
|
+
static targets = ["content", "wrapper", "trigger"];
|
11
|
+
|
12
|
+
connect() {
|
13
|
+
useDebounce(this);
|
14
|
+
useHover(this, { element: this.triggerTarget });
|
15
|
+
this.popperInstance = createPopper(this.triggerTarget, this.contentTarget, {
|
16
|
+
placement: this.contentTarget.dataset.side || "bottom",
|
17
|
+
modifiers: [
|
18
|
+
{
|
19
|
+
name: "offset",
|
20
|
+
options: {
|
21
|
+
offset: [0, 8],
|
22
|
+
},
|
23
|
+
},
|
24
|
+
],
|
25
|
+
});
|
26
|
+
}
|
27
|
+
|
28
|
+
mouseEnter() {
|
29
|
+
this.popperInstance.update();
|
30
|
+
this.contentTarget.dataset.state = "open";
|
31
|
+
this.contentTarget.classList.remove("hidden");
|
32
|
+
}
|
33
|
+
|
34
|
+
mouseLeave() {
|
35
|
+
this.popperInstance.update();
|
36
|
+
this.contentTarget.dataset.state = "closed";
|
37
|
+
this.contentTarget.classList.add("hidden");
|
38
|
+
}
|
39
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
// Inspired by: https://github.com/excid3/tailwindcss-stimulus-components/blob/master/src/popover.js
|
2
|
+
|
3
|
+
import { Controller } from "@hotwired/stimulus";
|
4
|
+
import { createPopper } from "@popperjs/core";
|
5
|
+
|
6
|
+
export default class extends Controller {
|
7
|
+
static values = {
|
8
|
+
dismissAfter: Number,
|
9
|
+
};
|
10
|
+
static targets = ["content", "wrapper", "trigger"];
|
11
|
+
|
12
|
+
// Sets the popover offset using Stimulus data map objects.
|
13
|
+
|
14
|
+
connect() {
|
15
|
+
this.popperInstance = createPopper(this.triggerTarget, this.contentTarget, {
|
16
|
+
placement: this.contentTarget.dataset.side || "bottom",
|
17
|
+
modifiers: [
|
18
|
+
{
|
19
|
+
name: "offset",
|
20
|
+
options: {
|
21
|
+
offset: [0, 8],
|
22
|
+
},
|
23
|
+
},
|
24
|
+
],
|
25
|
+
});
|
26
|
+
}
|
27
|
+
}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
import { Controller } from "@hotwired/stimulus";
|
2
|
+
|
3
|
+
export default class UIToastController extends Controller {
|
4
|
+
static targets = ["item"];
|
5
|
+
|
6
|
+
connect() {
|
7
|
+
setTimeout(() => {
|
8
|
+
this.openAll();
|
9
|
+
}, 1000);
|
10
|
+
|
11
|
+
this.closeAll();
|
12
|
+
}
|
13
|
+
|
14
|
+
openAll() {
|
15
|
+
const toastElements = document.querySelectorAll("[data-ui--toast-target='item']");
|
16
|
+
toastElements.forEach((toastElement) => {
|
17
|
+
toastElement.dataset.state = "open";
|
18
|
+
toastElement.classList.remove("hidden");
|
19
|
+
});
|
20
|
+
}
|
21
|
+
|
22
|
+
closeAll() {
|
23
|
+
const toastElements = document.querySelectorAll("[data-ui--toast-target='item']");
|
24
|
+
toastElements.forEach((toastElement) => {
|
25
|
+
setTimeout(() => {
|
26
|
+
toastElement.dataset.state = "closed";
|
27
|
+
toastElement.classList.add("hidden");
|
28
|
+
}, toastElement.dataset.duration);
|
29
|
+
});
|
30
|
+
}
|
31
|
+
|
32
|
+
test() {
|
33
|
+
const $this = this;
|
34
|
+
this.closeAll();
|
35
|
+
setTimeout(() => {
|
36
|
+
$this.openAll();
|
37
|
+
setTimeout(() => {
|
38
|
+
$this.closeAll();
|
39
|
+
}, 3000);
|
40
|
+
}, 1000);
|
41
|
+
}
|
42
|
+
close() {}
|
43
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
// Inspired by: https://github.com/excid3/tailwindcss-stimulus-components/blob/master/src/popover.js
|
2
|
+
|
3
|
+
import { Controller } from "@hotwired/stimulus";
|
4
|
+
|
5
|
+
export default class UIToggleController extends Controller {
|
6
|
+
connect() {}
|
7
|
+
|
8
|
+
toggle() {
|
9
|
+
if (this.element.dataset.state == "on") {
|
10
|
+
this.element.dataset.state = "off";
|
11
|
+
} else {
|
12
|
+
this.element.dataset.state = "on";
|
13
|
+
}
|
14
|
+
}
|
15
|
+
}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
class ApplicationJob < ActiveJob::Base
|
2
|
+
# Automatically retry jobs that encountered a deadlock
|
3
|
+
# retry_on ActiveRecord::Deadlocked
|
4
|
+
|
5
|
+
# Most jobs are safe to ignore if the underlying records are no longer available
|
6
|
+
# discard_on ActiveJob::DeserializationError
|
7
|
+
end
|
File without changes
|
File without changes
|
@@ -0,0 +1,40 @@
|
|
1
|
+
<div
|
2
|
+
class="w-full"
|
3
|
+
data-orientation="vertical">
|
4
|
+
<div
|
5
|
+
data-orientation="vertical"
|
6
|
+
class="border-b st-accordion"
|
7
|
+
data-controller="ui--accordion">
|
8
|
+
<h3
|
9
|
+
data-orientation="vertical"
|
10
|
+
class="flex">
|
11
|
+
<a
|
12
|
+
href="content-1"
|
13
|
+
data-action="ui--accordion#toggle"
|
14
|
+
aria-expanded="true"
|
15
|
+
data-orientation="vertical"
|
16
|
+
class="flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180">
|
17
|
+
<%= title %><svg
|
18
|
+
xmlns="http://www.w3.org/2000/svg"
|
19
|
+
width="24"
|
20
|
+
height="24"
|
21
|
+
viewBox="0 0 24 24"
|
22
|
+
fill="none"
|
23
|
+
stroke="currentColor"
|
24
|
+
stroke-width="2"
|
25
|
+
stroke-linecap="round"
|
26
|
+
stroke-linejoin="round"
|
27
|
+
class="h-4 w-4 shrink-0 transition-transform duration-200">
|
28
|
+
<polyline points="6 9 12 15 18 9"></polyline>
|
29
|
+
</svg>
|
30
|
+
</a>
|
31
|
+
</h3>
|
32
|
+
<div
|
33
|
+
data-accordion-id="content-1"
|
34
|
+
role="region"
|
35
|
+
data-orientation="vertical"
|
36
|
+
class="st-accordion__content overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down">
|
37
|
+
<div class="pb-4 pt-0"><%= description %></div>
|
38
|
+
</div>
|
39
|
+
</div>
|
40
|
+
</div>
|
@@ -0,0 +1,55 @@
|
|
1
|
+
<div
|
2
|
+
role="alert"
|
3
|
+
class="<%= alert_classes %> relative w-full rounded-lg border p-4 [&:has(svg)]:pl-11 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4">
|
4
|
+
<!--prettier-ignore-->
|
5
|
+
<% case variant %>
|
6
|
+
<% when :default %>
|
7
|
+
<svg
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
9
|
+
width="24"
|
10
|
+
height="24"
|
11
|
+
viewBox="0 0 24 24"
|
12
|
+
fill="none"
|
13
|
+
stroke="currentColor"
|
14
|
+
stroke-width="2"
|
15
|
+
stroke-linecap="round"
|
16
|
+
stroke-linejoin="round"
|
17
|
+
class="h-4 w-4">
|
18
|
+
<polyline points="4 17 10 11 4 5"></polyline>
|
19
|
+
<line
|
20
|
+
x1="12"
|
21
|
+
x2="20"
|
22
|
+
y1="19"
|
23
|
+
y2="19"></line>
|
24
|
+
</svg>
|
25
|
+
<% when :error, :alert %>
|
26
|
+
<svg
|
27
|
+
xmlns="http://www.w3.org/2000/svg"
|
28
|
+
width="24"
|
29
|
+
height="24"
|
30
|
+
viewBox="0 0 24 24"
|
31
|
+
fill="none"
|
32
|
+
stroke="currentColor"
|
33
|
+
stroke-width="2"
|
34
|
+
stroke-linecap="round"
|
35
|
+
stroke-linejoin="round"
|
36
|
+
class="h-4 w-4">
|
37
|
+
<circle
|
38
|
+
cx="12"
|
39
|
+
cy="12"
|
40
|
+
r="10"></circle>
|
41
|
+
<line
|
42
|
+
x1="12"
|
43
|
+
x2="12"
|
44
|
+
y1="8"
|
45
|
+
y2="12"></line>
|
46
|
+
<line
|
47
|
+
x1="12"
|
48
|
+
x2="12.01"
|
49
|
+
y1="16"
|
50
|
+
y2="16"></line>
|
51
|
+
</svg>
|
52
|
+
<% end %>
|
53
|
+
<h5 class="mb-1 font-medium leading-none tracking-tight"><%= title %></h5>
|
54
|
+
<div class="text-sm [&_p]:leading-relaxed"><%= description %></div>
|
55
|
+
</div>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<div data-controller="ui--dialog">
|
2
|
+
<%= render "components/ui/shared/dialog_background", as: "backdrop" %>
|
3
|
+
|
4
|
+
<%= trigger %>
|
5
|
+
<div
|
6
|
+
role="alertdialog"
|
7
|
+
data-state="closed"
|
8
|
+
class="hidden fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full"
|
9
|
+
tabindex="-1"
|
10
|
+
style="pointer-events: auto"
|
11
|
+
data-ui--dialog-target="dialog">
|
12
|
+
<div class="flex flex-col space-y-2 text-center sm:text-left">
|
13
|
+
<h2 class="text-lg font-semibold"><%= label %></h2>
|
14
|
+
<p class="text-sm text-muted-foreground"><%= description %></p>
|
15
|
+
</div>
|
16
|
+
<div class="flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2">
|
17
|
+
<%= cancel %> <%= continue %>
|
18
|
+
</div>
|
19
|
+
</div>
|
20
|
+
</div>
|
@@ -0,0 +1 @@
|
|
1
|
+
<div class="<%= badge_classes %>"><%= text %></div>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<!--prettier-ignore-->
|
2
|
+
<% case as %>
|
3
|
+
<% when :link %>
|
4
|
+
<%= link_to href, class: button_classes, data: data do %>
|
5
|
+
<%= text %>
|
6
|
+
<% end %>
|
7
|
+
<% when :button %>
|
8
|
+
<%= button_tag class: button_classes, data: data do %>
|
9
|
+
<%= text %>
|
10
|
+
<% end %>
|
11
|
+
<% end %>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<div class="rounded-lg border bg-card text-card-foreground shadow-sm w-[350px]">
|
2
|
+
<% if title || subtitle %>
|
3
|
+
<div class="flex flex-col space-y-1.5 p-6">
|
4
|
+
<% if title %>
|
5
|
+
<h3 class="text-2xl font-semibold leading-none tracking-tight"><%= title %></h3>
|
6
|
+
<% end %> <% if subtitle %>
|
7
|
+
<p class="text-sm text-muted-foreground"><%= subtitle %></p>
|
8
|
+
<% end %>
|
9
|
+
</div>
|
10
|
+
<% end %>
|
11
|
+
<div class="p-0 <%= "p-6 pt-0" if !block && title %> <%= "p-6" if !block && !title %> "><%= body %></div>
|
12
|
+
<% if footer %><footer class="mx-6 mb-6"><%= footer %></footer><% end %>
|
13
|
+
</div>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
<div data-controller="ui--checkbox">
|
2
|
+
<div class="flex items-center space-x-2">
|
3
|
+
<button
|
4
|
+
type="button"
|
5
|
+
role="checkbox"
|
6
|
+
aria-checked="false"
|
7
|
+
data-state="unchecked"
|
8
|
+
value="on"
|
9
|
+
class="peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground"
|
10
|
+
for="<%= name %>"
|
11
|
+
data-action="click->ui--checkbox#toggle">
|
12
|
+
<span
|
13
|
+
class="flex items-center justify-center text-current hidden"
|
14
|
+
style="pointer-events: none">
|
15
|
+
<svg
|
16
|
+
xmlns="http://www.w3.org/2000/svg"
|
17
|
+
width="24"
|
18
|
+
height="24"
|
19
|
+
viewBox="0 0 24 24"
|
20
|
+
fill="none"
|
21
|
+
stroke="currentColor"
|
22
|
+
stroke-width="2"
|
23
|
+
stroke-linecap="round"
|
24
|
+
stroke-linejoin="round"
|
25
|
+
class="h-4 w-4">
|
26
|
+
<polyline points="20 6 9 17 4 12"></polyline>
|
27
|
+
</svg>
|
28
|
+
</span>
|
29
|
+
</button>
|
30
|
+
<label
|
31
|
+
for="<%= name %>"
|
32
|
+
data-action="click->ui--checkbox#toggle"
|
33
|
+
class="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70">
|
34
|
+
<%= label %>
|
35
|
+
</label>
|
36
|
+
</div>
|
37
|
+
</div>
|
@@ -0,0 +1,38 @@
|
|
1
|
+
<div
|
2
|
+
data-state="closed"
|
3
|
+
class="w-[350px] space-y-2"
|
4
|
+
data-controller="ui--collapsible">
|
5
|
+
<div
|
6
|
+
class="flex items-center justify-between space-x-4 px-4"
|
7
|
+
data-action="click->ui--collapsible#toggle">
|
8
|
+
<h4 class="text-sm font-semibold"><%= trigger %></h4>
|
9
|
+
<button
|
10
|
+
class="inline-flex items-center justify-center text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 hover:bg-accent hover:text-accent-foreground h-9 rounded-md w-9 p-0"
|
11
|
+
type="button"
|
12
|
+
aria-expanded="false"
|
13
|
+
data-state="closed">
|
14
|
+
<svg
|
15
|
+
xmlns="http://www.w3.org/2000/svg"
|
16
|
+
width="24"
|
17
|
+
height="24"
|
18
|
+
viewBox="0 0 24 24"
|
19
|
+
fill="none"
|
20
|
+
stroke="currentColor"
|
21
|
+
stroke-width="2"
|
22
|
+
stroke-linecap="round"
|
23
|
+
stroke-linejoin="round"
|
24
|
+
class="h-4 w-4">
|
25
|
+
<path d="m7 15 5 5 5-5"></path>
|
26
|
+
<path d="m7 9 5-5 5 5"></path>
|
27
|
+
</svg>
|
28
|
+
<span class="sr-only">Toggle</span>
|
29
|
+
</button>
|
30
|
+
</div>
|
31
|
+
<%= yield :preview %>
|
32
|
+
<div
|
33
|
+
data-ui--collapsible-target="item"
|
34
|
+
data-state="closed"
|
35
|
+
class="space-y-2 hidden">
|
36
|
+
<%= yield :body %>
|
37
|
+
</div>
|
38
|
+
</div>
|
@@ -0,0 +1,69 @@
|
|
1
|
+
<div data-controller="ui--dialog">
|
2
|
+
<div data-action="click->ui--dialog#open"><%= content_for(:dialog_trigger) %></div>
|
3
|
+
|
4
|
+
<%= render "components/ui/shared/dialog_background", as: "modal" %>
|
5
|
+
|
6
|
+
<div
|
7
|
+
role="dialog"
|
8
|
+
data-state="closed"
|
9
|
+
data-ui--dialog-target="dialog"
|
10
|
+
class="hidden fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full sm:max-w-[425px]"
|
11
|
+
tabindex="-1"
|
12
|
+
style="pointer-events: auto">
|
13
|
+
<div><%= content_for(:dialog_content) %></div>
|
14
|
+
<button
|
15
|
+
data-ui--dialog-target="closeButton"
|
16
|
+
type="button"
|
17
|
+
class="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">
|
18
|
+
<svg
|
19
|
+
xmlns="http://www.w3.org/2000/svg"
|
20
|
+
width="24"
|
21
|
+
height="24"
|
22
|
+
viewBox="0 0 24 24"
|
23
|
+
fill="none"
|
24
|
+
stroke="currentColor"
|
25
|
+
stroke-width="2"
|
26
|
+
stroke-linecap="round"
|
27
|
+
stroke-linejoin="round"
|
28
|
+
class="h-4 w-4">
|
29
|
+
<line
|
30
|
+
x1="18"
|
31
|
+
x2="6"
|
32
|
+
y1="6"
|
33
|
+
y2="18"></line>
|
34
|
+
<line
|
35
|
+
x1="6"
|
36
|
+
x2="18"
|
37
|
+
y1="6"
|
38
|
+
y2="18"></line>
|
39
|
+
</svg>
|
40
|
+
<span class="sr-only">Close</span>
|
41
|
+
</button>
|
42
|
+
</div>
|
43
|
+
</div>
|
44
|
+
<!-- <div data-controller="ui--dialog">
|
45
|
+
<div
|
46
|
+
data-ui--dialog-target="modal"
|
47
|
+
data-state="closed"
|
48
|
+
class="hidden fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"
|
49
|
+
style="pointer-events: auto"
|
50
|
+
data-aria-hidden="true"
|
51
|
+
aria-hidden="true"></div>
|
52
|
+
|
53
|
+
<%#= trigger %>
|
54
|
+
<div
|
55
|
+
role="alertdialog"
|
56
|
+
data-state="closed"
|
57
|
+
class="hidden fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full"
|
58
|
+
tabindex="-1"
|
59
|
+
style="pointer-events: auto"
|
60
|
+
data-ui--dialog-target="dialog">
|
61
|
+
<div class="flex flex-col space-y-2 text-center sm:text-left">
|
62
|
+
<h2 class="text-lg font-semibold"><%#= label %></h2>
|
63
|
+
<p class="text-sm text-muted-foreground"><%#= description %></p>
|
64
|
+
</div>
|
65
|
+
<div class="flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2">
|
66
|
+
<%#= cancel %> <%#= continue %>
|
67
|
+
</div>
|
68
|
+
</div>
|
69
|
+
</div> -->
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<%= render_popover do %>
|
2
|
+
<%= popover_trigger do %>
|
3
|
+
<%= content_for(:dropdown_menu_trigger) %>
|
4
|
+
<% end %>
|
5
|
+
<%= popover_content class: "p-1 w-56" do %>
|
6
|
+
<% if content_for?(:dropdown_menu_label) %><div class="px-2 py-1.5 text-sm font-semibold"><%= content_for(:dropdown_menu_label) %></div><% end %>
|
7
|
+
<%= content_for(:dropdown_menu_content) %>
|
8
|
+
<% end %>
|
9
|
+
<% end %>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<div data-controller="ui--hover-card">
|
2
|
+
<div class="hover_card-trigger"
|
3
|
+
data-ui--hover-card-target="trigger">
|
4
|
+
<%= content_for(:hover_card_trigger) %>
|
5
|
+
</div>
|
6
|
+
|
7
|
+
<div class="hover_card-wrapper" data-ui--hover-card-target="wrapper">
|
8
|
+
<div data-side="bottom"
|
9
|
+
data-ui--hover-card-target="content"
|
10
|
+
data-align="center"
|
11
|
+
data-state="closed"
|
12
|
+
role="dialog"
|
13
|
+
class="hidden z-50 rounded-md border bg-hover_card p-4 text-hover_card-foreground shadow-md outline-none <%= content_for(:hover_card_content_class) %>"
|
14
|
+
tabindex="-1">
|
15
|
+
<%= content_for(:hover_card_content) %>
|
16
|
+
</div>
|
17
|
+
</div>
|
18
|
+
</div>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<div data-controller="ui--popover">
|
2
|
+
<div class="popover-trigger" data-ui--popover-target="trigger" data-action="click->ui--popover#toggle">
|
3
|
+
<%= content_for(:popover_trigger) %>
|
4
|
+
</div>
|
5
|
+
|
6
|
+
<div class="popover-wrapper" data-ui--popover-target="wrapper">
|
7
|
+
<div
|
8
|
+
date-side="bottom"
|
9
|
+
data-controller="ui--transition"
|
10
|
+
data-ui--popover-target="content"
|
11
|
+
data-align="center"
|
12
|
+
data-state="closed"
|
13
|
+
role="dialog"
|
14
|
+
class="hidden z-50 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none <%= content_for(:popover_content_class) %>"
|
15
|
+
tabindex=" -1 ">
|
16
|
+
<%= content_for(:popover_content) %>
|
17
|
+
</div>
|
18
|
+
</div>
|
19
|
+
</div>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<textarea
|
2
|
+
class="flex min-h-[80px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 <%= options[:class] %>"
|
3
|
+
placeholder="<%= options[:placeholder] %>"
|
4
|
+
name="<%= name %>"
|
5
|
+
id="<% id %>"
|
6
|
+
<%= options[:disabled] ? "disabled" : "" %>"
|
7
|
+
<%= options[:required] ? "required" : "" %>
|
8
|
+
<%= options[:readonly] ? "readonly" : "" %>
|
9
|
+
<%= options[:rows] ? "rows" : "" %>></textarea>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<div role="region" aria-label="Notifications (F8)" tabindex="-1" style="" data-controller="ui--toast #{data[:controller]}">
|
2
|
+
<span aria-hidden="true" tabindex="0" style="position: fixed; border: 0px; width: 1px; height: 1px; padding: 0px; margin: -1px; overflow: hidden; clip: rect(0px, 0px, 0px, 0px); white-space: nowrap; overflow-wrap: normal;"></span>
|
3
|
+
<ol tabindex="-1" class="fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]">
|
4
|
+
<li role="status"
|
5
|
+
aria-live="off"
|
6
|
+
aria-atomic="true"
|
7
|
+
tabindex="0"
|
8
|
+
data-state="closed"
|
9
|
+
data-ui--toast-target="item"
|
10
|
+
data-swipe-direction="right"
|
11
|
+
data-duration="5000"
|
12
|
+
class="toast-item hidden group pointer-events-auto relative flex w-full items-center
|
13
|
+
justify-between space-x-4 overflow-hidden rounded-md p-6 pr-8 shadow-lg
|
14
|
+
transition-all
|
15
|
+
data-[swipe=cancel]:translate-x-0
|
16
|
+
data-[swipe=move]:transition-none
|
17
|
+
data-[state=open]:animate-in
|
18
|
+
data-[state=closed]:animate-out
|
19
|
+
data-[swipe=end]:animate-out
|
20
|
+
data-[state=closed]:fade-out-80
|
21
|
+
data-[state=open]:slide-in-from-top-full
|
22
|
+
data-[state=open]:sm:slide-in-from-bottom-full
|
23
|
+
border bg-background"
|
24
|
+
style="user-select: none; touch-action: none;">
|
25
|
+
<div class="grid gap-1">
|
26
|
+
<div class="text-sm font-semibold"><%= header %></div>
|
27
|
+
<div class="text-sm opacity-90"><%= description %></div>
|
28
|
+
</div>
|
29
|
+
<%= action %>
|
30
|
+
<button data-action="ui--toast#closeAll" type="button" class="absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600" toast-close="" data-radix-toast-announce-exclude=""><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="h-4 w-4"><line x1="18" x2="6" y1="6" y2="18"></line><line x1="6" x2="18" y1="6" y2="18"></line></svg></button>
|
31
|
+
</li>
|
32
|
+
</ol>
|
33
|
+
<span aria-hidden="true" tabindex="0" style="position: fixed; border: 0px; width: 1px; height: 1px; padding: 0px; margin: -1px; overflow: hidden; clip: rect(0px, 0px, 0px, 0px); white-space: nowrap; overflow-wrap: normal;"></span>
|
34
|
+
</div>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<div data-controller="ui--tooltip">
|
2
|
+
<div class="tooltip-trigger"
|
3
|
+
data-ui--tooltip-target="trigger">
|
4
|
+
<%= content_for(:tooltip_trigger) %>
|
5
|
+
</div>
|
6
|
+
|
7
|
+
<div class="tooltip-wrapper" data-ui--tooltip-target="wrapper">
|
8
|
+
<div data-side="top"
|
9
|
+
data-ui--tooltip-target="content"
|
10
|
+
data-align="center"
|
11
|
+
data-state="closed"
|
12
|
+
role="dialog"
|
13
|
+
class="hidden z-50 rounded-md border bg-tooltip p-4 text-tooltip-foreground shadow-md outline-none <%= content_for(:tooltip_content_class) %>"
|
14
|
+
tabindex="-1">
|
15
|
+
<%= content_for(:tooltip_content) %>
|
16
|
+
</div>
|
17
|
+
</div>
|
18
|
+
</div>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<div
|
2
|
+
data-ui--dialog-target="<%= as %>"
|
3
|
+
data-state="closed"
|
4
|
+
class="hidden fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"
|
5
|
+
style="pointer-events: auto"
|
6
|
+
data-aria-hidden="true"
|
7
|
+
aria-hidden="true"></div>
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<div
|
2
|
+
role="menuitem"
|
3
|
+
class="relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50"
|
4
|
+
data-orientation="vertical">
|
5
|
+
<%= content %>
|
6
|
+
</div>
|