shadcn-ui 0.0.2 → 0.0.4
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/.env +1 -0
- data/Rakefile +6 -3
- data/app/assets/stylesheets/{application.scss → application.css} +0 -27
- data/app/assets/stylesheets/application.tailwind.css +32 -160
- data/app/assets/stylesheets/shadcn.css +216 -0
- data/app/helpers/components/accordion_helper.rb +14 -1
- data/app/helpers/components/alert_helper.rb +4 -2
- data/app/helpers/components/button_helper.rb +2 -1
- data/app/helpers/components/card_helper.rb +1 -1
- data/app/helpers/components/checkbox_helper.rb +2 -2
- data/app/helpers/components/collapsible_helper.rb +8 -0
- data/app/helpers/components/input_helper.rb +1 -1
- data/app/helpers/components/sheet_helper.rb +9 -0
- data/app/helpers/components/slider_helper.rb +1 -1
- data/app/helpers/components_helper.rb +11 -0
- data/app/helpers/examples_helper.rb +7 -3
- data/app/javascript/controllers/highlight_controller.js +0 -1
- data/app/javascript/controllers/ui/popover_controller.js +6 -2
- data/app/views/application/index.html.erb +625 -17
- data/app/views/components/ui/_accordion.html.erb +2 -2
- data/app/views/components/ui/_alert.html.erb +15 -3
- data/app/views/components/ui/_card.html.erb +7 -1
- data/app/views/components/ui/_checkbox.html.erb +2 -1
- data/app/views/components/ui/_collapsible.html.erb +2 -6
- data/app/views/components/ui/_filter.html.erb +2 -1
- data/app/views/components/ui/_sheet.html.erb +1 -1
- data/app/views/documentation/generators.html.md +21 -0
- data/app/views/documentation/helpers.html.md +54 -0
- data/app/views/documentation/index.html.md +22 -0
- data/app/views/documentation/installation.html.md +130 -2
- data/app/views/documentation/javascript.html.md +8 -0
- data/app/views/examples/components/accordion/_usage.html.erb +15 -0
- data/app/views/examples/components/accordion/code/_block.html.erb +8 -0
- data/app/views/examples/components/accordion/code/_description.html.erb +7 -0
- data/app/views/examples/components/accordion/code/_preview.erb +3 -0
- data/app/views/examples/components/accordion/code/_usage.erb +16 -0
- data/app/views/examples/components/accordion.html.erb +37 -3
- data/app/views/examples/components/alert/_usage.html.erb +10 -0
- data/app/views/examples/components/alert/code/_attention.erb +3 -0
- data/app/views/examples/components/alert/code/_destructive.erb +2 -0
- data/app/views/examples/components/alert/code/_info.erb +3 -0
- data/app/views/examples/components/alert/code/_no_icon.erb +3 -0
- data/app/views/examples/components/alert/code/_preview.erb +2 -0
- data/app/views/examples/components/alert/code/_success.erb +3 -0
- data/app/views/examples/components/alert/code/_usage.erb +1 -0
- data/app/views/examples/components/alert-dialog/code/_preview.erb +6 -0
- data/app/views/examples/components/alert-dialog/code/_usage.erb +0 -0
- data/app/views/examples/components/alert-dialog.html.erb +8 -11
- data/app/views/examples/components/alert.html.erb +90 -8
- data/app/views/examples/components/badge/_usage.html.erb +10 -0
- data/app/views/examples/components/badge/code/_preview.erb +5 -0
- data/app/views/examples/components/badge/code/_usage.erb +1 -0
- data/app/views/examples/components/badge.html.erb +12 -17
- data/app/views/examples/components/button/_usage.html.erb +19 -0
- data/app/views/examples/components/button/code/_preview.erb +13 -0
- data/app/views/examples/components/button/code/_usage.erb +6 -0
- data/app/views/examples/components/button.html.erb +12 -20
- data/app/views/examples/components/card/_usage.html.erb +21 -0
- data/app/views/examples/components/card/code/_form.erb +72 -0
- data/app/views/examples/components/card/code/_notifications.erb +61 -0
- data/app/views/examples/components/card/code/_preview.erb +6 -0
- data/app/views/examples/components/card/code/_usage.erb +3 -0
- data/app/views/examples/components/card.html.erb +31 -143
- data/app/views/examples/components/checkbox/_usage.html.erb +9 -0
- data/app/views/examples/components/checkbox/code/_preview.erb +2 -0
- data/app/views/examples/components/checkbox/code/_usage.erb +1 -0
- data/app/views/examples/components/checkbox.html.erb +15 -1
- data/app/views/examples/components/collapsible/_usage.html.erb +16 -0
- data/app/views/examples/components/collapsible/code/_preview.erb +9 -0
- data/app/views/examples/components/collapsible/code/_usage.erb +7 -0
- data/app/views/examples/components/collapsible.html.erb +12 -10
- data/app/views/examples/components/dialog.html.erb +6 -15
- data/app/views/examples/components/dropdown-menu/_usage.html.erb +19 -0
- data/app/views/examples/components/dropdown-menu/code/_preview.erb +19 -0
- data/app/views/examples/components/dropdown-menu/code/_usage.erb +13 -0
- data/app/views/examples/components/dropdown-menu.html.erb +29 -15
- data/app/views/examples/components/filter/_usage.html.erb +14 -0
- data/app/views/examples/components/filter/code/_icon.html.erb +7 -0
- data/app/views/examples/components/filter/code/_preview.erb +3 -0
- data/app/views/examples/components/filter/code/_usage.erb +5 -0
- data/app/views/examples/components/filter.html.erb +27 -7
- data/app/views/examples/components/hover-card/_usage.html.erb +15 -0
- data/app/views/examples/components/hover-card/code/_preview.erb +13 -0
- data/app/views/examples/components/hover-card/code/_usage.erb +6 -0
- data/app/views/examples/components/hover-card.html.erb +12 -14
- data/app/views/examples/components/input/_usage.html.erb +10 -0
- data/app/views/examples/components/input/code/_borderless.erb +3 -0
- data/app/views/examples/components/input/code/_preview.erb +1 -0
- data/app/views/examples/components/input/code/_usage.erb +1 -0
- data/app/views/examples/components/input.html.erb +17 -3
- data/app/views/examples/components/label/_usage.html.erb +9 -0
- data/app/views/examples/components/label/code/_preview.erb +5 -0
- data/app/views/examples/components/label/code/_usage.erb +1 -0
- data/app/views/examples/components/label.html.erb +14 -5
- data/app/views/examples/components/popover/_usage.html.erb +12 -0
- data/app/views/examples/components/popover/code/_form.erb +23 -0
- data/app/views/examples/components/popover/code/_preview.erb +13 -0
- data/app/views/examples/components/popover/code/_usage.erb +7 -0
- data/app/views/examples/components/popover.html.erb +28 -24
- data/app/views/examples/components/progress/_usage.erb +9 -0
- data/app/views/examples/components/progress/code/_preview.erb +1 -0
- data/app/views/examples/components/progress/code/_usage.erb +1 -0
- data/app/views/examples/components/progress.html.erb +12 -2
- data/app/views/examples/components/separator/_usage.html.erb +10 -0
- data/app/views/examples/components/separator/code/_fancy.erb +21 -0
- data/app/views/examples/components/separator/code/_preview.erb +1 -0
- data/app/views/examples/components/separator/code/_usage.erb +1 -0
- data/app/views/examples/components/separator.html.erb +26 -19
- data/app/views/examples/components/sheet/_usage.html.erb +38 -0
- data/app/views/examples/components/sheet/code/_mobile_menu.erb +17 -0
- data/app/views/examples/components/sheet/code/_preview.erb +22 -0
- data/app/views/examples/components/sheet/code/_usage.erb +7 -0
- data/app/views/examples/components/sheet.html.erb +17 -10
- data/app/views/examples/components/skeleton/_usage.html.erb +9 -0
- data/app/views/examples/components/skeleton/code/_preview.erb +1 -0
- data/app/views/examples/components/skeleton/code/_usage.erb +1 -0
- data/app/views/examples/components/skeleton.html.erb +16 -2
- data/app/views/examples/components/slider/_usage.html.erb +11 -0
- data/app/views/examples/components/slider/code/_preview.erb +3 -0
- data/app/views/examples/components/slider/code/_usage.erb +1 -0
- data/app/views/examples/components/slider.html.erb +16 -2
- data/app/views/examples/components/textarea/_usage.html.erb +9 -0
- data/app/views/examples/components/textarea/code/_preview.erb +1 -0
- data/app/views/examples/components/textarea/code/_usage.erb +1 -0
- data/app/views/examples/components/textarea.html.erb +16 -2
- data/app/views/examples/components/toast/_usage.html.erb +11 -0
- data/app/views/examples/components/toast/code/_preview.erb +3 -0
- data/app/views/examples/components/toast/code/_usage.erb +2 -0
- data/app/views/examples/components/toast.html.erb +12 -4
- data/app/views/examples/components/toggle/_usage.html.erb +10 -0
- data/app/views/examples/components/toggle/code/_preview.erb +1 -0
- data/app/views/examples/components/toggle/code/_usage.erb +1 -0
- data/app/views/examples/components/toggle.html.erb +16 -2
- data/app/views/examples/components/tooltip/_usage.html.erb +11 -0
- data/app/views/examples/components/tooltip/code/_preview.erb +12 -0
- data/app/views/examples/components/tooltip/code/_usage.erb +7 -0
- data/app/views/examples/components/tooltip.html.erb +16 -13
- data/app/views/layouts/shared/_components.html.erb +44 -41
- data/config/environments/production.rb +4 -4
- data/config/shadcn.tailwind.js +98 -0
- data/config/tailwind.config.js +13 -74
- data/lib/components.json +7 -3
- data/lib/generators/shadcn-ui_generator.rb +201 -0
- data/lib/shadcn-ui/version.rb +1 -1
- data/package-lock.json +90 -3
- data/package.json +4 -0
- metadata +97 -9
- data/lib/generators/shadcn_ui_generator.rb +0 -81
- /data/app/assets/stylesheets/{lambda.light.scss → lambda.light.css} +0 -0
- /data/app/views/examples/components/dialog/code/{form.erb → _form.erb} +0 -0
- /data/app/views/examples/components/dialog/code/{notifications.erb → _notifications.erb} +0 -0
- /data/app/views/examples/components/dialog/code/{preview.erb → _preview.erb} +0 -0
- /data/app/views/examples/components/dialog/code/{usage.erb → _usage.erb} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c7353625f737a5deeed84e83a9718a6201e151541995c11bedbeaa8b2f49234d
|
4
|
+
data.tar.gz: 6399387bda38280d3d1be1208f5ac7796d7370cc902d8a658c742c1bcb64186b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb839cd93e13cf9ea774d8d7dd1596bedd48ba02d570c65c8a125be616cbdae81a9f29fd46de71c13150b4a35c8709b5d57b813d21b74ee33076ead527cff827
|
7
|
+
data.tar.gz: e9a6a20f2f23bbc542800bb1bfe6cd1c6bbc08ed6f586590e61f956dff5973aab0b711c912e1b9305c06c019f1045a9ba74a3174d34a3b46ce933bb47a9ec8cb
|
data/Rakefile
CHANGED
@@ -1,11 +1,14 @@
|
|
1
1
|
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
2
2
|
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
3
3
|
require "bundler/gem_tasks"
|
4
|
-
require "rspec/core/rake_task"
|
5
4
|
|
6
|
-
|
5
|
+
if ENV["RAILS_ENV"] != "production"
|
6
|
+
require "rspec/core/rake_task"
|
7
7
|
|
8
|
-
|
8
|
+
RSpec::Core::RakeTask.new(:spec)
|
9
|
+
|
10
|
+
task default: :spec
|
11
|
+
end
|
9
12
|
|
10
13
|
require_relative "config/application"
|
11
14
|
|
@@ -13,30 +13,3 @@
|
|
13
13
|
*=
|
14
14
|
*= require_self
|
15
15
|
*/
|
16
|
-
.st-accordion {
|
17
|
-
.st-accordion__icon:before {
|
18
|
-
content: "▼";
|
19
|
-
display: inline-block;
|
20
|
-
margin-right: 5px;
|
21
|
-
font-size: 80%;
|
22
|
-
text-decoration: none;
|
23
|
-
transform: rotate(-90deg);
|
24
|
-
}
|
25
|
-
.st-accordion__icon--opened:before {
|
26
|
-
transform: rotate(0deg);
|
27
|
-
}
|
28
|
-
|
29
|
-
.st-accordion__content:not(.st-accordion__content--visible) {
|
30
|
-
height: 0;
|
31
|
-
opacity: 0;
|
32
|
-
visibility: hidden;
|
33
|
-
overflow: hidden;
|
34
|
-
transition: all 0.2s;
|
35
|
-
}
|
36
|
-
.st-accordion__content.st-accordion__content--visible {
|
37
|
-
opacity: 1;
|
38
|
-
visibility: visible;
|
39
|
-
overflow: hidden;
|
40
|
-
transition: all 0.2s;
|
41
|
-
}
|
42
|
-
}
|
@@ -1,182 +1,42 @@
|
|
1
|
+
@import "shadcn.css";
|
2
|
+
|
1
3
|
@tailwind base;
|
2
4
|
@tailwind components;
|
3
5
|
@tailwind utilities;
|
4
6
|
|
5
7
|
@layer base {
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
--muted-foreground: 215.4 16.3% 46.9%;
|
13
|
-
|
14
|
-
--popover: 0 0% 100%;
|
15
|
-
--popover-foreground: 222.2 47.4% 11.2%;
|
16
|
-
|
17
|
-
--border: 214.3 31.8% 91.4%;
|
18
|
-
--input: 214.3 31.8% 91.4%;
|
19
|
-
|
20
|
-
--card: 0 0% 100%;
|
21
|
-
--card-foreground: 222.2 47.4% 11.2%;
|
22
|
-
|
23
|
-
--primary: 222.2 47.4% 11.2%;
|
24
|
-
--primary-foreground: 210 40% 98%;
|
25
|
-
|
26
|
-
--secondary: 210 40% 96.1%;
|
27
|
-
--secondary-foreground: 222.2 47.4% 11.2%;
|
28
|
-
|
29
|
-
--accent: 210 40% 96.1%;
|
30
|
-
--accent-foreground: 222.2 47.4% 11.2%;
|
31
|
-
|
32
|
-
--destructive: 0 100% 50%;
|
33
|
-
--destructive-foreground: 210 40% 98%;
|
34
|
-
|
35
|
-
--ring: 215 20.2% 65.1%;
|
36
|
-
|
37
|
-
--radius: 0.5rem;
|
8
|
+
.container {
|
9
|
+
margin-left: auto;
|
10
|
+
margin-right: auto;
|
11
|
+
padding-left: 2rem;
|
12
|
+
padding-right: 2rem;
|
13
|
+
width: 100%;
|
38
14
|
}
|
39
15
|
|
40
|
-
|
41
|
-
--
|
42
|
-
--foreground: 213 31% 91%;
|
43
|
-
|
44
|
-
--muted: 223 47% 11%;
|
45
|
-
--muted-foreground: 215.4 16.3% 56.9%;
|
46
|
-
|
47
|
-
--accent: 216 34% 17%;
|
48
|
-
--accent-foreground: 210 40% 98%;
|
49
|
-
|
50
|
-
--popover: 224 71% 4%;
|
51
|
-
--popover-foreground: 215 20.2% 65.1%;
|
52
|
-
|
53
|
-
--border: 216 34% 17%;
|
54
|
-
--input: 216 34% 17%;
|
55
|
-
|
56
|
-
--card: 224 71% 4%;
|
57
|
-
--card-foreground: 213 31% 91%;
|
58
|
-
|
59
|
-
--primary: 210 40% 98%;
|
60
|
-
--primary-foreground: 222.2 47.4% 1.2%;
|
61
|
-
|
62
|
-
--secondary: 222.2 47.4% 11.2%;
|
63
|
-
--secondary-foreground: 210 40% 98%;
|
64
|
-
|
65
|
-
--destructive: 0 63% 31%;
|
66
|
-
--destructive-foreground: 210 40% 98%;
|
67
|
-
|
68
|
-
--ring: 216 34% 17%;
|
69
|
-
|
70
|
-
--radius: 0.5rem;
|
71
|
-
}
|
72
|
-
}
|
73
|
-
|
74
|
-
@layer base {
|
75
|
-
* {
|
76
|
-
@apply border-border;
|
77
|
-
}
|
78
|
-
body {
|
79
|
-
@apply bg-background text-foreground;
|
80
|
-
font-feature-settings:
|
81
|
-
"rlig" 1,
|
82
|
-
"calt" 1;
|
83
|
-
}
|
84
|
-
|
85
|
-
.code-sample {
|
86
|
-
@apply max-h-[650px] overflow-x-auto rounded-lg border bg-zinc-950 dark:bg-zinc-900;
|
87
|
-
}
|
88
|
-
|
89
|
-
.code-sample span {
|
90
|
-
@apply bg-zinc-950;
|
16
|
+
:root {
|
17
|
+
--pink: 301 98% 50% 0.88;
|
91
18
|
}
|
92
19
|
}
|
93
|
-
input[type="range"] {
|
94
|
-
display: inline-block;
|
95
|
-
vertical-align: middle;
|
96
|
-
font-size: 1em;
|
97
|
-
font-family: Arial, sans-serif;
|
98
|
-
}
|
99
|
-
|
100
|
-
/* input[type="range"]:focus,
|
101
|
-
input[type="number"]:focus {
|
102
|
-
box-shadow: 0 0 3px 1px #4b81dd;
|
103
|
-
outline: none;
|
104
|
-
} */
|
105
|
-
|
106
|
-
input[type="range"] {
|
107
|
-
-webkit-appearance: none;
|
108
|
-
margin-right: 15px;
|
109
|
-
width: 200px;
|
110
|
-
height: 7px;
|
111
|
-
background: #f4f4f5;
|
112
|
-
border-radius: 5px;
|
113
|
-
background-image: linear-gradient(#000, #000);
|
114
|
-
background-repeat: no-repeat;
|
115
|
-
}
|
116
|
-
|
117
|
-
/* Input Thumb */
|
118
|
-
input[type="range"]::-webkit-slider-thumb {
|
119
|
-
-webkit-appearance: none;
|
120
|
-
height: 20px;
|
121
|
-
width: 20px;
|
122
|
-
border-radius: 50%;
|
123
|
-
background: #fff;
|
124
|
-
cursor: ew-resize;
|
125
|
-
box-shadow: 0 0 2px 0 #000;
|
126
|
-
transition: background 0.3s ease-in-out;
|
127
|
-
}
|
128
|
-
|
129
|
-
input[type="range"]::-moz-range-thumb {
|
130
|
-
-webkit-appearance: none;
|
131
|
-
height: 20px;
|
132
|
-
width: 20px;
|
133
|
-
border-radius: 50%;
|
134
|
-
background: #fff;
|
135
|
-
cursor: ew-resize;
|
136
|
-
box-shadow: 0 0 2px 0 #000;
|
137
|
-
transition: background 0.3s ease-in-out;
|
138
|
-
}
|
139
20
|
|
140
|
-
|
141
|
-
-
|
142
|
-
height: 20px;
|
143
|
-
width: 20px;
|
144
|
-
border-radius: 50%;
|
145
|
-
background: #fff;
|
146
|
-
cursor: ew-resize;
|
147
|
-
box-shadow: 0 0 2px 0 #000;
|
148
|
-
transition: background 0.3s ease-in-out;
|
21
|
+
article.documentation h1 {
|
22
|
+
@apply scroll-m-20 text-4xl font-bold tracking-tight;
|
149
23
|
}
|
150
24
|
|
151
|
-
|
152
|
-
|
25
|
+
article.documentation p + h1 {
|
26
|
+
@apply mt-12;
|
153
27
|
}
|
154
|
-
|
155
|
-
|
156
|
-
background: #a1a1aa;
|
28
|
+
article.documentation h2 {
|
29
|
+
@apply scroll-m-20 text-3xl font-bold tracking-tight my-8;
|
157
30
|
}
|
158
31
|
|
159
|
-
|
160
|
-
|
161
|
-
} */
|
162
|
-
|
163
|
-
input[type="range"]::-moz-range-track {
|
164
|
-
-webkit-appearance: none;
|
165
|
-
box-shadow: none;
|
166
|
-
border: none;
|
167
|
-
background: transparent;
|
32
|
+
article.documentation h3 {
|
33
|
+
@apply scroll-m-20 text-2xl font-bold tracking-tight my-4;
|
168
34
|
}
|
169
35
|
|
170
|
-
|
171
|
-
-
|
172
|
-
box-shadow: none;
|
173
|
-
border: none;
|
174
|
-
background: transparent;
|
36
|
+
article.documentation h4 {
|
37
|
+
@apply scroll-m-20 text-xl font-bold tracking-tight my-2;
|
175
38
|
}
|
176
39
|
|
177
|
-
article.documentation h1 {
|
178
|
-
@apply scroll-m-20 text-4xl font-bold tracking-tight;
|
179
|
-
}
|
180
40
|
article.documentation subtitle {
|
181
41
|
@apply text-lg text-muted-foreground;
|
182
42
|
}
|
@@ -191,3 +51,15 @@ article.documentation :where(code):not(:where([class~="not-prose"] *)):before {
|
|
191
51
|
article.documentation :where(code):not(:where([class~="not-prose"] *)):after {
|
192
52
|
content: "";
|
193
53
|
}
|
54
|
+
|
55
|
+
article.documentation p a {
|
56
|
+
@apply underline hover:text-pink;
|
57
|
+
}
|
58
|
+
|
59
|
+
article.documentation pre {
|
60
|
+
@apply max-h-[650px] overflow-x-auto rounded-lg border bg-zinc-950 dark:bg-zinc-900 text-white py-4 px-8 rounded-lg my-4;
|
61
|
+
}
|
62
|
+
|
63
|
+
article.documentation p > code {
|
64
|
+
@apply text-white bg-black p-1 rounded;
|
65
|
+
}
|
@@ -0,0 +1,216 @@
|
|
1
|
+
@layer base {
|
2
|
+
:root {
|
3
|
+
--font-sans: "Inter var";
|
4
|
+
--background: 0 0% 100%;
|
5
|
+
--foreground: 222.2 47.4% 11.2%;
|
6
|
+
|
7
|
+
--muted: 210 40% 96.1%;
|
8
|
+
--muted-foreground: 215.4 16.3% 46.9%;
|
9
|
+
|
10
|
+
--popover: 0 0% 100%;
|
11
|
+
--popover-foreground: 222.2 47.4% 11.2%;
|
12
|
+
|
13
|
+
--border: 214.3 31.8% 91.4%;
|
14
|
+
--input: 214.3 31.8% 91.4%;
|
15
|
+
|
16
|
+
--card: 0 0% 100%;
|
17
|
+
--card-foreground: 222.2 47.4% 11.2%;
|
18
|
+
|
19
|
+
--primary: 222.2 47.4% 11.2%;
|
20
|
+
--primary-foreground: 210 40% 98%;
|
21
|
+
|
22
|
+
--secondary: 210 40% 96.1%;
|
23
|
+
--secondary-foreground: 222.2 47.4% 11.2%;
|
24
|
+
|
25
|
+
--accent: 210 40% 96.1%;
|
26
|
+
--accent-foreground: 222.2 47.4% 11.2%;
|
27
|
+
|
28
|
+
--destructive: 0 100% 50%;
|
29
|
+
--destructive-foreground: 210 40% 98%;
|
30
|
+
|
31
|
+
--success: 132, 95.3%, 33.3%, 0.74;
|
32
|
+
--success-foreground: 109 55% 28%;
|
33
|
+
|
34
|
+
--info: 223 78% 42%;
|
35
|
+
--info-foreground: 225 100% 50%;
|
36
|
+
|
37
|
+
--attention: 45 90% 45%;
|
38
|
+
--attention-foreground: 60 98.4% 48.8% 0.82;
|
39
|
+
|
40
|
+
--ring: 215 20.2% 65.1%;
|
41
|
+
|
42
|
+
--radius: 0.5rem;
|
43
|
+
}
|
44
|
+
|
45
|
+
.dark {
|
46
|
+
--background: 224 71% 4%;
|
47
|
+
--foreground: 213 31% 91%;
|
48
|
+
|
49
|
+
--muted: 223 47% 11%;
|
50
|
+
--muted-foreground: 215.4 16.3% 56.9%;
|
51
|
+
|
52
|
+
--accent: 216 34% 17%;
|
53
|
+
--accent-foreground: 210 40% 98%;
|
54
|
+
|
55
|
+
--popover: 224 71% 4%;
|
56
|
+
--popover-foreground: 215 20.2% 65.1%;
|
57
|
+
|
58
|
+
--border: 216 34% 17%;
|
59
|
+
--input: 216 34% 17%;
|
60
|
+
|
61
|
+
--card: 224 71% 4%;
|
62
|
+
--card-foreground: 213 31% 91%;
|
63
|
+
|
64
|
+
--primary: 210 40% 98%;
|
65
|
+
--primary-foreground: 222.2 47.4% 1.2%;
|
66
|
+
|
67
|
+
--secondary: 222.2 47.4% 11.2%;
|
68
|
+
--secondary-foreground: 210 40% 98%;
|
69
|
+
|
70
|
+
--destructive: 0 63% 31%;
|
71
|
+
--destructive-foreground: 210 40% 98%;
|
72
|
+
|
73
|
+
--attention: 45, 90%, 45%, 0.8;
|
74
|
+
--attention-foreground: 60 98.4% 48.8% 0.82;
|
75
|
+
|
76
|
+
--success: 109 55% 28%;
|
77
|
+
--success-foreground: 109 55% 28%;
|
78
|
+
|
79
|
+
--ring: 216 34% 17%;
|
80
|
+
|
81
|
+
--radius: 0.5rem;
|
82
|
+
}
|
83
|
+
}
|
84
|
+
|
85
|
+
@layer base {
|
86
|
+
* {
|
87
|
+
@apply border-border;
|
88
|
+
}
|
89
|
+
body {
|
90
|
+
@apply bg-background text-foreground;
|
91
|
+
font-feature-settings:
|
92
|
+
"rlig" 1,
|
93
|
+
"calt" 1;
|
94
|
+
}
|
95
|
+
|
96
|
+
.code-sample {
|
97
|
+
@apply max-h-[650px] min-h-[350px] overflow-x-auto rounded-lg border bg-zinc-950 dark:bg-zinc-900;
|
98
|
+
}
|
99
|
+
|
100
|
+
.code-sample pre {
|
101
|
+
@apply min-h-[350px];
|
102
|
+
}
|
103
|
+
|
104
|
+
.code-sample span {
|
105
|
+
@apply bg-zinc-950;
|
106
|
+
}
|
107
|
+
}
|
108
|
+
input[type="range"] {
|
109
|
+
display: inline-block;
|
110
|
+
vertical-align: middle;
|
111
|
+
font-size: 1em;
|
112
|
+
font-family: Arial, sans-serif;
|
113
|
+
}
|
114
|
+
|
115
|
+
/* input[type="range"]:focus,
|
116
|
+
input[type="number"]:focus {
|
117
|
+
box-shadow: 0 0 3px 1px #4b81dd;
|
118
|
+
outline: none;
|
119
|
+
} */
|
120
|
+
|
121
|
+
input[type="range"] {
|
122
|
+
-webkit-appearance: none;
|
123
|
+
margin-right: 15px;
|
124
|
+
width: 200px;
|
125
|
+
height: 7px;
|
126
|
+
background: #f4f4f5;
|
127
|
+
border-radius: 5px;
|
128
|
+
background-image: linear-gradient(#000, #000);
|
129
|
+
background-repeat: no-repeat;
|
130
|
+
}
|
131
|
+
|
132
|
+
/* Input Thumb */
|
133
|
+
input[type="range"]::-webkit-slider-thumb {
|
134
|
+
-webkit-appearance: none;
|
135
|
+
height: 20px;
|
136
|
+
width: 20px;
|
137
|
+
border-radius: 50%;
|
138
|
+
background: #fff;
|
139
|
+
cursor: ew-resize;
|
140
|
+
box-shadow: 0 0 2px 0 #000;
|
141
|
+
transition: background 0.3s ease-in-out;
|
142
|
+
}
|
143
|
+
|
144
|
+
input[type="range"]::-moz-range-thumb {
|
145
|
+
-webkit-appearance: none;
|
146
|
+
height: 20px;
|
147
|
+
width: 20px;
|
148
|
+
border-radius: 50%;
|
149
|
+
background: #fff;
|
150
|
+
cursor: ew-resize;
|
151
|
+
box-shadow: 0 0 2px 0 #000;
|
152
|
+
transition: background 0.3s ease-in-out;
|
153
|
+
}
|
154
|
+
|
155
|
+
input[type="range"]::-ms-thumb {
|
156
|
+
-webkit-appearance: none;
|
157
|
+
height: 20px;
|
158
|
+
width: 20px;
|
159
|
+
border-radius: 50%;
|
160
|
+
background: #fff;
|
161
|
+
cursor: ew-resize;
|
162
|
+
box-shadow: 0 0 2px 0 #000;
|
163
|
+
transition: background 0.3s ease-in-out;
|
164
|
+
}
|
165
|
+
|
166
|
+
/* input[type="range"]::-webkit-slider-thumb:hover {
|
167
|
+
background: #a1a1aa;
|
168
|
+
}
|
169
|
+
|
170
|
+
input[type="range"]::-moz-range-thumb:hover {
|
171
|
+
background: #a1a1aa;
|
172
|
+
}
|
173
|
+
|
174
|
+
input[type="range"]::-ms-thumb:hover {
|
175
|
+
background: #a1a1aa;
|
176
|
+
} */
|
177
|
+
|
178
|
+
input[type="range"]::-moz-range-track {
|
179
|
+
-webkit-appearance: none;
|
180
|
+
box-shadow: none;
|
181
|
+
border: none;
|
182
|
+
background: transparent;
|
183
|
+
}
|
184
|
+
|
185
|
+
input[type="range"]::-ms-track {
|
186
|
+
-webkit-appearance: none;
|
187
|
+
box-shadow: none;
|
188
|
+
border: none;
|
189
|
+
background: transparent;
|
190
|
+
}
|
191
|
+
|
192
|
+
.st-accordion .st-accordion__icon:before {
|
193
|
+
content: "▼";
|
194
|
+
display: inline-block;
|
195
|
+
margin-right: 5px;
|
196
|
+
font-size: 80%;
|
197
|
+
text-decoration: none;
|
198
|
+
transform: rotate(-90deg);
|
199
|
+
}
|
200
|
+
.st-accordion .st-accordion__icon--opened:before {
|
201
|
+
transform: rotate(0deg);
|
202
|
+
}
|
203
|
+
|
204
|
+
.st-accordion .st-accordion__content:not(.st-accordion__content--visible) {
|
205
|
+
height: 0;
|
206
|
+
opacity: 0;
|
207
|
+
visibility: hidden;
|
208
|
+
overflow: hidden;
|
209
|
+
transition: all 0.2s;
|
210
|
+
}
|
211
|
+
.st-accordion .st-accordion__content.st-accordion__content--visible {
|
212
|
+
opacity: 1;
|
213
|
+
visibility: visible;
|
214
|
+
overflow: hidden;
|
215
|
+
transition: all 0.2s;
|
216
|
+
}
|
@@ -1,5 +1,18 @@
|
|
1
1
|
module Components::AccordionHelper
|
2
|
-
def
|
2
|
+
def accordion_title(&block)
|
3
|
+
content_for :title, capture(&block), flush: true
|
4
|
+
end
|
5
|
+
|
6
|
+
def accordion_description(&block)
|
7
|
+
content_for :description, capture(&block), flush: true
|
8
|
+
end
|
9
|
+
|
10
|
+
def render_accordion(title: nil, description: nil, &block)
|
11
|
+
if title && !description
|
12
|
+
content_for :description, capture(&block), flush: true
|
13
|
+
elsif !title && !description
|
14
|
+
capture(&block)
|
15
|
+
end
|
3
16
|
render "components/ui/accordion", title: title, description: description
|
4
17
|
end
|
5
18
|
end
|
@@ -1,11 +1,13 @@
|
|
1
1
|
module Components::AlertHelper
|
2
|
-
def render_alert(title:, description:, variant: :default)
|
2
|
+
def render_alert(title:, description:, variant: :default, icon: true)
|
3
3
|
alert_classes = case variant.to_sym
|
4
4
|
when :default
|
5
5
|
"[&>svg]:text-foreground bg-background text-foreground"
|
6
6
|
when :error, :danger, :alert, :destructive
|
7
7
|
"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"
|
8
|
+
else
|
9
|
+
"border-#{variant}/50 text-#{variant} dark:border-#{variant} [&>svg]:text-#{variant}"
|
8
10
|
end
|
9
|
-
render "components/ui/alert", title
|
11
|
+
render "components/ui/alert", title:, description:, alert_classes:, variant:, icon:
|
10
12
|
end
|
11
13
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Components::ButtonHelper
|
2
|
-
def render_button(label = "",
|
2
|
+
def render_button(label = "", text: nil, variant: :default, as: :button, href: nil, data: {}, **options, &block)
|
3
3
|
button_classes = " inline-flex items-center justify-center rounded-md 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 h-10 px-4 py-2 "
|
4
4
|
varianet_classes = case variant.to_sym
|
5
5
|
when :default
|
@@ -15,6 +15,7 @@ module Components::ButtonHelper
|
|
15
15
|
end
|
16
16
|
button_classes << " #{varianet_classes} #{options[:class]}"
|
17
17
|
text = label if label.present?
|
18
|
+
text = capture(&block) if block
|
18
19
|
render "components/ui/button", text:, button_classes:, as:, href:, data:, **options
|
19
20
|
end
|
20
21
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Components::CardHelper
|
2
|
-
def render_card(
|
2
|
+
def render_card(title: nil, subtitle: nil, body: nil, footer: nil, **options, &block)
|
3
3
|
render "components/ui/card", title: title, subtitle: subtitle, footer: footer, body: (block ? capture(&block) : body), block:, options: options
|
4
4
|
end
|
5
5
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Components::CheckboxHelper
|
2
|
-
def render_checkbox(label:, name
|
3
|
-
render "components/ui/checkbox", name: name, label: label
|
2
|
+
def render_checkbox(label:, name:, **options)
|
3
|
+
render "components/ui/checkbox", name: name, label: label, options: options
|
4
4
|
end
|
5
5
|
end
|
@@ -1,4 +1,12 @@
|
|
1
1
|
module Components::CollapsibleHelper
|
2
|
+
def collapsible_preview(&block)
|
3
|
+
content_for :preview, capture(&block) if block
|
4
|
+
end
|
5
|
+
|
6
|
+
def collapsible_body(&block)
|
7
|
+
content_for :body, capture(&block) if block
|
8
|
+
end
|
9
|
+
|
2
10
|
def render_collapsible(**options, &block)
|
3
11
|
content = capture(&block) if block
|
4
12
|
render "components/ui/collapsible", content: content, **options
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Components::InputHelper
|
2
2
|
def render_input(name:, label: false, id: nil, type: :text, value: nil, **options)
|
3
3
|
options[:class] = "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 #{options[:class]} "
|
4
|
-
options[:class] << case options[:
|
4
|
+
options[:class] << case options[:variant]
|
5
5
|
when :borderless
|
6
6
|
" border-0 focus-visible:outline-none focus-visible:shadow-none focus-visible:ring-transparent"
|
7
7
|
else
|
@@ -17,4 +17,13 @@ module Components::SheetHelper
|
|
17
17
|
def sheet_content(&block)
|
18
18
|
content_for :sheet_content, capture(&block), flush: true
|
19
19
|
end
|
20
|
+
|
21
|
+
def direction_class(direction)
|
22
|
+
mappings = {
|
23
|
+
"left": 'left-0',
|
24
|
+
"right": 'right-0'
|
25
|
+
}
|
26
|
+
|
27
|
+
mappings[direction.to_sym]
|
28
|
+
end
|
20
29
|
end
|
@@ -4,4 +4,15 @@ module ComponentsHelper
|
|
4
4
|
OUTLINE_CLASSES = " border border-input bg-background hover:bg-accent hover:text-accent-foreground "
|
5
5
|
GHOST_CLASSES = " hover:bg-accent hover:text-accent-foreground "
|
6
6
|
DESTRUCTIVE_CLASSES = " bg-destructive text-destructive-foreground hover:bg-destructive/90 "
|
7
|
+
|
8
|
+
module Button
|
9
|
+
PRIMARY = " bg-primary text-primary-foreground hover:bg-primary/80 "
|
10
|
+
SECONDARY = " bg-secondary text-secondary-foreground hover:bg-secondary/80 "
|
11
|
+
OUTLINE = " border border-input bg-background hover:bg-accent hover:text-accent-foreground "
|
12
|
+
GHOST = " hover:bg-accent hover:text-accent-foreground "
|
13
|
+
DESTRUCTIVE = " bg-destructive text-destructive-foreground hover:bg-destructive/90 "
|
14
|
+
end
|
15
|
+
|
16
|
+
module Alert
|
17
|
+
end
|
7
18
|
end
|
@@ -15,18 +15,22 @@ module ExamplesHelper
|
|
15
15
|
render "examples/components/#{name}/usage"
|
16
16
|
end
|
17
17
|
|
18
|
+
def render_code_preview(name)
|
19
|
+
render "examples/components/#{name}/code/preview"
|
20
|
+
end
|
21
|
+
|
18
22
|
def code_partial(name, language)
|
23
|
+
component, partial = name.split("/")
|
19
24
|
content_tag :pre, class: "code-sample py-4 px-4", data: {controller: "highlight"} do
|
20
25
|
content_tag :code, class: "language-#{language}" do
|
21
|
-
html_escape(File.read(Rails.root.join("app", "views", "examples", "components", "#{
|
26
|
+
html_escape(File.read(Rails.root.join("app", "views", "examples", "components", "#{component}/code/_#{partial}.erb")))
|
22
27
|
end
|
23
28
|
end
|
24
29
|
end
|
25
30
|
|
26
31
|
def code_sample(content = "", language:, &block)
|
27
|
-
content_tag :pre, class: "code-sample px-4 my-2 pb-5", data: {controller: "highlight"} do
|
32
|
+
content_tag :pre, class: "code-sample px-4 my-2 pb-5 min-h-fit", data: {controller: "highlight"} do
|
28
33
|
content_tag :code, class: "language-#{language}" do
|
29
|
-
content
|
30
34
|
yield if block
|
31
35
|
end
|
32
36
|
end
|