Previews

No matching results.

x
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
<!DOCTYPE html>
<html>
<head>
<title>Demo</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="csrf-param" content="authenticity_token" />
<meta name="csrf-token" content="HvGiL9kCOdDVouszjn7VLWxcjjekeVXDIP0XPIG-K_S3IODxK07qmmQuU8UmC2qlC_tbXyOq6uHHu60aVzTtQA" />
<!-- ATTENTION: The following line is required for Turbo dialog works see: https://github.com/hotwired/turbo/issues/1191#issuecomment-1952959217 -->
<meta name="turbo-prefetch" content="false">
<link rel="stylesheet" href="/assets/monaco-editor-d026e4e8.css" />
<link rel="stylesheet" href="/assets/tailwind-e1c99e10.css" data-turbo-track="reload" />
<link rel="stylesheet" href="/assets/elevate-b9e6a9e3.css" />
<script type="importmap" data-turbo-track="reload">
{
"imports": {
"application": "/assets/application-e52719f5.js",
"monaco_environment": "/assets/monaco_environment-7d1d7ad9.js",
"@hotwired/turbo-rails": "/assets/turbo.min-9fd88cd5.js",
"@hotwired/stimulus": "/assets/stimulus.min-4b1e420e.js",
"elevate": "/assets/elevate-77c908f2.js",
"@rails/request.js": "/assets/@rails--request.js-22cecb25.js",
"date-fns": "/assets/date-fns-20af076e.js",
"date-fns-tz": "/assets/date-fns-tz-52b54186.js",
"flatpickr": "/assets/flatpickr-bc43d5e1.js",
"flatpickr/dist/plugins/confirmDate/confirmDate": "/assets/flatpickr--confirmDate-5274819e.js",
"intl-tel-input": "/assets/intl-tel-input-8efbd706.js",
"nanostores": "/assets/nanostores-84ef9e44.js",
"sortablejs": "/assets/sortablejs-764cc38c.js",
"tom-select": "/assets/tom-select-d8b91703.js",
"@37signals/lexxy": "/assets/@37signals--lexxy-ee545715.js",
"monaco-editor": "https://esm.sh/monaco-editor@0.56.0"
}
}
</script>
<link rel="modulepreload" href="/assets/application-e52719f5.js">
<link rel="modulepreload" href="/assets/monaco_environment-7d1d7ad9.js">
<link rel="modulepreload" href="/assets/turbo.min-9fd88cd5.js">
<link rel="modulepreload" href="/assets/stimulus.min-4b1e420e.js">
<link rel="modulepreload" href="/assets/elevate-77c908f2.js">
<link rel="modulepreload" href="/assets/@rails--request.js-22cecb25.js">
<link rel="modulepreload" href="/assets/date-fns-20af076e.js">
<link rel="modulepreload" href="/assets/date-fns-tz-52b54186.js">
<link rel="modulepreload" href="/assets/flatpickr-bc43d5e1.js">
<link rel="modulepreload" href="/assets/flatpickr--confirmDate-5274819e.js">
<link rel="modulepreload" href="/assets/intl-tel-input-8efbd706.js">
<link rel="modulepreload" href="/assets/nanostores-84ef9e44.js">
<link rel="modulepreload" href="/assets/sortablejs-764cc38c.js">
<link rel="modulepreload" href="/assets/tom-select-d8b91703.js">
<script type="module">
import "application"
</script>
</head>
<body>
<div id="elevate-toast-host" data-controller="toast" data-turbo-permanent="true" data-toast-position-value="top-center" data-toast-layout-value="default" data-toast-auto-dismiss-duration-value="4000" data-toast-limit-value="3" data-toast-gap-value="14" class="elevate-toast elevate-toast--position--top-center">
<ol data-toast-target="container" class="relative flex flex-col-reverse sm:flex-col gap-0 pointer-events-auto [&>li]:pointer-events-auto" style="height: 0px;"></ol>
<div data-toast-target="livePolite" role="status" aria-live="polite" aria-atomic="true" class="sr-only"></div>
<div data-toast-target="liveAssertive" role="alert" aria-live="assertive" aria-atomic="true" class="sr-only"></div>
<template data-toast-template data-toast-type="default">
<li class="toast-item">
<div class="elevate-toast--content">
<div class="elevate-toast--row">
<div class="elevate-toast--plate elevate-toast--plate--default"
aria-hidden="true">
<span class="elevate-toast--plate-icon elevate-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewbox="0 0 18 18" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" focusable="false" aria-hidden="true">
<circle cx="9" cy="9" r="7.4"></circle>
<circle cx="9" cy="9" r="1.4" fill="currentColor" stroke="none"></circle>
</svg>
</span>
</div>
<div class="elevate-toast--text">
<p class="elevate-toast--title" data-toast-slot="message"></p>
<p class="elevate-toast--description" data-toast-slot="description"></p>
</div>
<button type="button" class="elevate-toast--close" data-toast-slot="close" aria-label="Close">
<span class="elevate-toast--close-icon elevate-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewbox="0 0 14 14" fill="none" focusable="false" aria-hidden="true">
<path d="M3.5 3.5 L10.5 10.5 M10.5 3.5 L3.5 10.5" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"></path>
</svg>
</span>
</button>
</div>
</div>
</li>
</template>
<template data-toast-template data-toast-type="success">
<li class="toast-item">
<div class="elevate-toast--content">
<div class="elevate-toast--row">
<div class="elevate-toast--plate elevate-toast--plate--success"
aria-hidden="true">
<span class="elevate-toast--plate-icon elevate-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewbox="0 0 18 18" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" focusable="false" aria-hidden="true">
<circle cx="9" cy="9" r="7.4"></circle>
<path d="M5.6 9.2 L8 11.6 L12.4 6.8"></path>
</svg>
</span>
</div>
<div class="elevate-toast--text">
<p class="elevate-toast--title" data-toast-slot="message"></p>
<p class="elevate-toast--description" data-toast-slot="description"></p>
</div>
<button type="button" class="elevate-toast--close" data-toast-slot="close" aria-label="Close">
<span class="elevate-toast--close-icon elevate-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewbox="0 0 14 14" fill="none" focusable="false" aria-hidden="true">
<path d="M3.5 3.5 L10.5 10.5 M10.5 3.5 L3.5 10.5" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"></path>
</svg>
</span>
</button>
</div>
</div>
</li>
</template>
<template data-toast-template data-toast-type="error">
<li class="toast-item">
<div class="elevate-toast--content">
<div class="elevate-toast--row">
<div class="elevate-toast--plate elevate-toast--plate--error"
aria-hidden="true">
<span class="elevate-toast--plate-icon elevate-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewbox="0 0 18 18" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" focusable="false" aria-hidden="true">
<circle cx="9" cy="9" r="7.4"></circle>
<path d="M6.2 6.2 L11.8 11.8 M11.8 6.2 L6.2 11.8"></path>
</svg>
</span>
</div>
<div class="elevate-toast--text">
<p class="elevate-toast--title" data-toast-slot="message"></p>
<p class="elevate-toast--description" data-toast-slot="description"></p>
</div>
<button type="button" class="elevate-toast--close" data-toast-slot="close" aria-label="Close">
<span class="elevate-toast--close-icon elevate-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewbox="0 0 14 14" fill="none" focusable="false" aria-hidden="true">
<path d="M3.5 3.5 L10.5 10.5 M10.5 3.5 L3.5 10.5" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"></path>
</svg>
</span>
</button>
</div>
</div>
</li>
</template>
<template data-toast-template data-toast-type="info">
<li class="toast-item">
<div class="elevate-toast--content">
<div class="elevate-toast--row">
<div class="elevate-toast--plate elevate-toast--plate--info"
aria-hidden="true">
<span class="elevate-toast--plate-icon elevate-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewbox="0 0 18 18" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" focusable="false" aria-hidden="true">
<circle cx="9" cy="9" r="7.4"></circle>
<path d="M9 8 L9 12.4"></path>
<circle cx="9" cy="5.6" r="0.5" fill="currentColor" stroke="none"></circle>
</svg>
</span>
</div>
<div class="elevate-toast--text">
<p class="elevate-toast--title" data-toast-slot="message"></p>
<p class="elevate-toast--description" data-toast-slot="description"></p>
</div>
<button type="button" class="elevate-toast--close" data-toast-slot="close" aria-label="Close">
<span class="elevate-toast--close-icon elevate-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewbox="0 0 14 14" fill="none" focusable="false" aria-hidden="true">
<path d="M3.5 3.5 L10.5 10.5 M10.5 3.5 L3.5 10.5" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"></path>
</svg>
</span>
</button>
</div>
</div>
</li>
</template>
<template data-toast-template data-toast-type="warning">
<li class="toast-item">
<div class="elevate-toast--content">
<div class="elevate-toast--row">
<div class="elevate-toast--plate elevate-toast--plate--warning"
aria-hidden="true">
<span class="elevate-toast--plate-icon elevate-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewbox="0 0 18 18" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" focusable="false" aria-hidden="true">
<path d="M9 2.4 L16.2 14.6 L1.8 14.6 Z"></path>
<path d="M9 7.2 L9 10.6"></path>
<circle cx="9" cy="12.6" r="0.5" fill="currentColor" stroke="none"></circle>
</svg>
</span>
</div>
<div class="elevate-toast--text">
<p class="elevate-toast--title" data-toast-slot="message"></p>
<p class="elevate-toast--description" data-toast-slot="description"></p>
</div>
<button type="button" class="elevate-toast--close" data-toast-slot="close" aria-label="Close">
<span class="elevate-toast--close-icon elevate-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewbox="0 0 14 14" fill="none" focusable="false" aria-hidden="true">
<path d="M3.5 3.5 L10.5 10.5 M10.5 3.5 L3.5 10.5" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"></path>
</svg>
</span>
</button>
</div>
</div>
</li>
</template>
<template data-toast-template data-toast-type="danger">
<li class="toast-item">
<div class="elevate-toast--content">
<div class="elevate-toast--row">
<div class="elevate-toast--plate elevate-toast--plate--danger"
aria-hidden="true">
<span class="elevate-toast--plate-icon elevate-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewbox="0 0 18 18" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" focusable="false" aria-hidden="true">
<path d="M9 1.8 L15.6 5.4 L15.6 10 C15.6 13.4 12.6 15.6 9 16.6 C5.4 15.6 2.4 13.4 2.4 10 L2.4 5.4 Z"></path>
<path d="M9 6.4 L9 10"></path>
<circle cx="9" cy="12" r="0.5" fill="currentColor" stroke="none"></circle>
</svg>
</span>
</div>
<div class="elevate-toast--text">
<p class="elevate-toast--title" data-toast-slot="message"></p>
<p class="elevate-toast--description" data-toast-slot="description"></p>
</div>
<button type="button" class="elevate-toast--close" data-toast-slot="close" aria-label="Close">
<span class="elevate-toast--close-icon elevate-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewbox="0 0 14 14" fill="none" focusable="false" aria-hidden="true">
<path d="M3.5 3.5 L10.5 10.5 M10.5 3.5 L3.5 10.5" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"></path>
</svg>
</span>
</button>
</div>
</div>
</li>
</template>
<template data-toast-template data-toast-type="loading">
<li class="toast-item">
<div class="elevate-toast--content">
<div class="elevate-toast--row">
<div class="elevate-toast--plate elevate-toast--plate--loading"
role="progressbar" aria-label="Loading…">
<span class="elevate-toast--plate-icon elevate-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewbox="0 0 18 18" fill="none" focusable="false" aria-hidden="true">
<circle cx="9" cy="9" r="7" stroke="currentColor" stroke-opacity="0.2" stroke-width="1.6"></circle>
<path d="M9 2 A7 7 0 0 1 16 9" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"></path>
</svg>
</span>
</div>
<div class="elevate-toast--text">
<p class="elevate-toast--title" data-toast-slot="message"></p>
<p class="elevate-toast--description" data-toast-slot="description"></p>
</div>
<button type="button" class="elevate-toast--close" data-toast-slot="close" aria-label="Close">
<span class="elevate-toast--close-icon elevate-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewbox="0 0 14 14" fill="none" focusable="false" aria-hidden="true">
<path d="M3.5 3.5 L10.5 10.5 M10.5 3.5 L3.5 10.5" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"></path>
</svg>
</span>
</button>
</div>
</div>
</li>
</template>
<template data-toast-template-rich>
<li class="toast-item">
<div class="elevate-toast--content elevate-toast--content--rich">
<div data-toast-slot="content"></div>
<button type="button" class="elevate-toast--close elevate-toast--close--floating" data-toast-slot="close" aria-label="Close"><span class="elevate-toast--close-icon elevate-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewbox="0 0 14 14" fill="none" focusable="false" aria-hidden="true">
<path d="M3.5 3.5 L10.5 10.5 M10.5 3.5 L3.5 10.5" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"></path>
</svg>
</span></button></div>
</li>
</template>
</div>
<main class="container mx-auto mt-12 px-5">
<form data-controller="elevate-hotwire" data-elevate-hotwire-values-value="{"elevate_lookbook_user":{"id":null,"first_name":null,"last_name":null,"phone":null,"email":null,"amount":null,"website":null,"country":null,"birth_date":null,"appointment_at":null,"code_snippet":null,"bio":null,"preferred_time":null,"newsletter":false,"marketing_emails":null,"terms_accepted":false,"privacy_policy_accepted":false,"interests":null,"notification_preferences":[],"favorite_color":"#22c55e","errors":{"_is_valid":true},"warnings":{"_is_valid":true},"suggested_values":{"first_name":"Oscar Botyglot","country":"france","birth_date":"2026-10-17","appointment_at":"2026-10-18T14:13:51.864Z","code_snippet":"# Sample Ruby code\nclass HelloWorld\n def greet(name)\n puts \"Hello, #{name}!\"\n end\nend\n\nhello = HelloWorld.new\nhello.greet(\"World\")\n","phone":"+33 1 23 45 67 89","amount":1234.56,"bio":"Passionate software developer with expertise in Ruby on Rails and Vue.js. Always eager to learn new technologies and share knowledge with the community.","preferred_time":"2026-10-17T14:30:00.000Z","newsletter":true,"marketing_emails":true,"terms_accepted":true,"privacy_policy_accepted":true,"interests":["ruby","javascript"],"notification_preferences":["email","push"]}}}" data-elevate-hotwire-validation-url-value="/elevate/users" id="new_elevate_lookbook_user_form" class="form elevate_lookbook_user-form" action="/elevate/users" accept-charset="UTF-8" method="post"><input type="hidden" name="authenticity_token" value="Nr6xYAviHy7vZsgfazoSwkEATIdmnuVIzc8V8RiSlLK9PGgjkZmpwhKERbdWzCD6kr15Ms3vTLAXLTtJb6wvrQ" autocomplete="off" />
<div class="form__field">
<div class="flex items-center">
<label for="elevate_lookbook_user_favorite_color" id="elevate_lookbook_user_favorite_color_label">Favorite color</label>
</div>
<div class="input-block" id="elevate_lookbook_user_favorite_color__wrapper" data-controller="elevate-hotwire-field" data-elevate-hotwire-field-elevate-hotwire-outlet="form" data-elevate-hotwire-field-name-value="elevate_lookbook_user[favorite_color]">
<input autocomplete="off" data-elevate-hotwire-field-target="hidden" type="hidden" value="#22c55e" name="elevate_lookbook_user[favorite_color]" />
<div class="botyglot--form-component--field--wrapper">
<input class="botyglot--form-component--field--input" data-elevate-hotwire-field-target="input" type="color" list="elevate_lookbook_user_favorite_color__swatches" id="elevate_lookbook_user_favorite_color" />
</div>
</div>
<datalist id="elevate_lookbook_user_favorite_color__swatches">
<option value="#ef4444"></option>
<option value="#f97316"></option>
<option value="#eab308"></option>
<option value="#22c55e"></option>
<option value="#3b82f6"></option>
<option value="#8b5cf6"></option>
</datalist>
</div>
</form>
</main>
</body>
</html>
1
2
3
4
5
<%- url = Elevate::Engine.routes.url_helpers.users_path -%>
<%= elevate_form_with(model: user, url: url, scope: :elevate_lookbook_user) do |form| %>
<%= render Elevate::Form::ColorComponent.new(form: form, field_name: :favorite_color, label_text: "Favorite color", swatches: swatches) %>
<% end %>

app/components/elevate/form/autocomplete.css

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
@layer components {
.input-block:has(select.custom-autocomplete) {
@apply grid grid-cols-[auto_1fr_auto] items-stretch;
}
.input-block:has(select.custom-autocomplete) .ts-wrapper { @apply row-start-1 col-span-full; }
.input-block:has(.input-block__prepend):has(.input-block__append) .ts-wrapper { @apply col-start-2; }
.input-block:has(.input-block__prepend):not(:has(.input-block__append)) .ts-wrapper { @apply col-[2/-1]; }
.input-block:not(:has(.input-block__prepend)):has(.input-block__append) .ts-wrapper { @apply col-[1/3]; }
.input-block:has(select.custom-autocomplete) .input-block__prepend { @apply row-start-1 col-start-1; }
.input-block:has(select.custom-autocomplete) .input-block__append { @apply row-start-1 col-start-3; }
.input-block:has(select.custom-autocomplete) .input-block__error-feedback,
.input-block:has(select.custom-autocomplete) .input-block__warning-feedback { @apply row-start-2 col-span-full; }
.input-block .ts-wrapper {
@apply relative;
}
.input-block .ts-control {
@apply flex items-center w-full min-h-[38px] rounded-[4px] border-0 py-1.5 px-3
text-gray-900 bg-white ring-1 ring-inset ring-gray-300
sm:text-sm sm:leading-6
transition-colors duration-150 ease-in-out cursor-text;
}
.input-block .ts-control input {
@apply text-gray-900 bg-transparent border-0 shadow-none outline-none;
}
.input-block .ts-control input::placeholder {
@apply text-gray-400;
}
.input-block .ts-wrapper.single .ts-control {
@apply cursor-pointer [--ts-pr-caret:2rem];
}
.input-block .ts-wrapper.single .ts-control::after {
@apply content-[''] absolute top-1/2 right-3.5 w-3 h-3 -translate-y-1/2
bg-no-repeat bg-center pointer-events-none transition-transform duration-150 ease-in-out;
background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%2012%2012%22%20fill%3D%22none%22%20stroke%3D%22%236B7280%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M2.75%204.5%206%207.75%209.25%204.5%22%2F%3E%3C%2Fsvg%3E");
}
.input-block .ts-wrapper.single.dropdown-active .ts-control::after {
@apply -translate-y-1/2 rotate-180;
}
/* On focus, TomSelect puts its search input back into the flex flow with a
7rem min-width, wrapping the control onto a second line next to a long
selected value. The single-mode input is read-only while a value is
selected, so it can collapse instead of claiming space. */
.input-block .ts-wrapper.single .ts-control {
@apply flex-nowrap;
}
.input-block .ts-wrapper.single .ts-control > input {
@apply min-w-0;
}
.input-block .ts-wrapper.focus .ts-control {
@apply ring-2 ring-inset ring-primary-700 outline-none;
}
.input-block .custom-autocomplete.input--has-prepend .ts-control { @apply rounded-l-none; }
.input-block .custom-autocomplete.input--has-append .ts-control { @apply rounded-r-none; }
.input-block .ts-dropdown {
@apply absolute z-50 mt-1 py-1 w-full
bg-white border border-gray-300 rounded-md shadow-lg
max-h-60 overflow-auto;
}
.input-block .ts-dropdown .option {
@apply px-3 py-2 text-sm text-gray-900 cursor-pointer;
}
.input-block .ts-dropdown .option.active {
@apply bg-primary-100 text-primary-700;
}
.input-block .ts-dropdown .no-results {
@apply px-3 py-2 text-sm text-gray-500;
}
.input-block .ts-dropdown .option[data-value=""] {
@apply hidden;
}
.input-block .ts-dropdown .option[aria-disabled="true"] {
@apply text-gray-400 cursor-not-allowed;
}
.input-block .ts-wrapper .clear-button {
@apply flex items-center justify-center w-5 h-5 rounded-full
text-gray-400 hover:text-gray-700 hover:bg-gray-100;
}
.input-block .ts-wrapper.has-items .clear-button {
@apply opacity-100;
}
.input-block .ts-wrapper.plugin-clear_button:not(.has-items) {
@apply [--ts-pr-clear-button:0px];
}
.input-block .ts-wrapper.input-block__field--invalid,
.input-block .ts-wrapper.input-block__field--warning {
@apply pr-0! bg-none! shadow-none! ring-0! text-inherit!;
}
.input-block .ts-wrapper.input-block__field--invalid .ts-control {
@apply ring-red-500 ring-2 text-red-900;
}
.input-block .ts-wrapper.input-block__field--invalid.focus .ts-control {
@apply ring-red-500;
}
.input-block .ts-wrapper.input-block__field--warning .ts-control {
@apply ring-amber-500 ring-2 text-amber-900;
}
.input-block .ts-wrapper.input-block__field--warning.focus .ts-control {
@apply ring-amber-500;
}
.input-block .ts-wrapper.disabled .ts-control {
@apply bg-gray-100 text-gray-500 opacity-60;
}
.input-block .ts-wrapper.disabled .ts-control,
.input-block .ts-wrapper.disabled .ts-control * {
@apply cursor-not-allowed!;
}
.input-block .ts-wrapper.disabled .clear-button {
@apply hidden;
}
/* Multi-select (TomSelect `multi`) — removable tags. */
.input-block .ts-wrapper.multi .ts-control {
@apply flex-wrap gap-1.5 py-1.5;
}
.input-block .ts-wrapper.multi .ts-control > .item {
/* pr-1.5! beats TomSelect's base `.plugin-remove_button .item{padding-right:0!important}`. */
@apply inline-flex items-center gap-1 overflow-hidden rounded-md
bg-primary-100 text-primary-700 ring-1 ring-inset ring-primary-200
text-xs font-medium leading-5 pl-2 pr-1.5! py-1
transition-colors duration-100;
}
.input-block .ts-wrapper.multi .ts-control > .item.active {
@apply bg-primary-200 ring-primary-400;
}
.input-block .ts-wrapper.multi .ts-control > .item .remove {
/* m-0 p-0 border-0 strip TomSelect's base remove-button padding/margin/border-left,
which otherwise push the cross out past the tag edge. */
@apply flex items-center justify-center shrink-0 w-4 h-4 rounded-full border-0 m-0 p-0
text-primary-700/50 no-underline transition-colors duration-100
hover:text-primary-800 hover:bg-primary-200;
}
.input-block .ts-wrapper.multi .ts-control > .item .remove > svg {
@apply w-2.5 h-2.5;
}
/* Count / overflow summary — "N selected" (count mode) or "+N" (tag mode). */
.input-block .ts-count-display {
@apply inline-flex items-center text-sm leading-6;
}
.input-block .ts-count-display:empty {
@apply hidden;
}
/* Count mode: the "N selected" summary replaces the tags. */
.input-block .ts-wrapper.multi .ts-control.count-active {
@apply gap-0;
}
.input-block .ts-wrapper.multi .ts-control.count-active > .item {
@apply hidden!;
}
.input-block .ts-wrapper.multi .ts-control.count-active .ts-count-display {
@apply font-medium text-gray-700;
}
/* Tag mode overflow: render the "+N" as a subtle neutral pill. */
.input-block .ts-wrapper.multi .ts-control:not(.count-active) .ts-count-display {
@apply rounded-md bg-gray-100 text-gray-600 text-xs font-medium
leading-5 px-2 py-0.5;
}
/* checkbox_options plugin — a checkbox per dropdown option. */
.input-block .ts-wrapper.multi .ts-dropdown .option {
@apply flex items-center gap-2.5;
}
.input-block .ts-wrapper.multi .ts-dropdown .option input[type="checkbox"] {
@apply w-4 h-4 shrink-0 rounded border-gray-300 pointer-events-none;
accent-color: theme("colors.primary.700", currentColor);
}
/* Mouse hover + already-selected rows in the dropdown. */
.input-block .ts-wrapper.multi .ts-dropdown .option:hover {
@apply bg-gray-50;
}
.input-block .ts-wrapper.multi .ts-dropdown .option.selected {
@apply text-primary-700 font-medium;
}
}

app/components/elevate/form/checkbox.css

1
2
3
4
5
6
7
8
9
@layer components {
.checkbox {
@apply absolute -mb-0.5 top-1.5 left-0;
}
.checkbox__container {
@apply relative block mt-2 mb-2 pl-6 leading-loose;
}
}

app/components/elevate/form/field.css

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
@layer components {
.botyglot--form-component--wrapper {
@apply flex flex-col w-full;
}
.botyglot--form-component--field--wrapper {
@apply flex w-full items-stretch rounded-[4px] bg-white outline-1 -outline-offset-1 outline-gray-300 focus-within:outline-2 focus-within:-outline-offset-2 focus-within:outline-indigo-600;
}
.botyglot--form-component--field--prepend, .botyglot--form-component--field--append {
@apply shrink-0 flex items-center justify-center text-base text-gray-900 select-none bg-white border border-gray-300 px-3;
}
.botyglot--form-component--field--prepend {
@apply rounded-l-[4px];
}
.botyglot--form-component--field--append {
@apply rounded-r-[4px];
}
.botyglot--form-component--field--input {
@apply block min-w-0 w-full grow placeholder:text-gray-400 text-base py-2 px-2 text-black focus:outline-none disabled:text-gray-400 disabled:cursor-not-allowed disabled:bg-gray-50;
}
.botyglot--form-component--field--input[readonly] {
@apply bg-gray-50 text-gray-400 cursor-not-allowed focus:outline-none;
}
.botyglot--form-component--field--wrapper:has(input:disabled) {
@apply bg-gray-50;
}
.botyglot--form-component--field--wrapper:has(input:disabled) .botyglot--form-component--field--prepend,
.botyglot--form-component--field--wrapper:has(input:disabled) .botyglot--form-component--field--append {
@apply bg-gray-50 text-gray-400;
}
/* Readonly styles */
.botyglot--form-component--field--wrapper:has(input[readonly]) {
@apply bg-gray-50;
}
.botyglot--form-component--field--wrapper:has(input[readonly]) .botyglot--form-component--field--prepend,
.botyglot--form-component--field--wrapper:has(input[readonly]) .botyglot--form-component--field--append {
@apply bg-gray-50 text-gray-400;
}
/* Error styles */
.botyglot--form-component--field--invalid {
@apply outline-red-500 text-red-900;
}
.botyglot--form-component--field--wrapper:has(.botyglot--form-component--field--invalid) {
@apply outline-red-500 outline-2 -outline-offset-2 rounded-[4px];
}
.botyglot--form-component--field--wrapper:has(.botyglot--form-component--field--invalid) .botyglot--form-component--field--prepend,
.botyglot--form-component--field--wrapper:has(.botyglot--form-component--field--invalid) .botyglot--form-component--field--append {
@apply border-red-500 text-red-900;
}
/* Warning styles */
.botyglot--form-component--field--warning {
@apply outline-orange-500 text-orange-900 rounded-[4px];
}
.botyglot--form-component--field--wrapper:has(.botyglot--form-component--field--warning) {
@apply outline-orange-500 outline-2 -outline-offset-2;
}
.botyglot--form-component--field--wrapper:has(.botyglot--form-component--field--warning) .botyglot--form-component--field--prepend,
.botyglot--form-component--field--wrapper:has(.botyglot--form-component--field--warning) .botyglot--form-component--field--append {
@apply border-orange-500 text-orange-900;
}
.input-block__error-feedback {
@apply w-full text-red-500;
}
/* Native colour input: same height as a text field, swatch fills the box */
input[type="color"].botyglot--form-component--field--input {
@apply h-10 p-1 cursor-pointer disabled:cursor-not-allowed;
}
input[type="color"].botyglot--form-component--field--input[readonly] {
@apply pointer-events-none;
}
input[type="color"].botyglot--form-component--field--input::-webkit-color-swatch-wrapper {
@apply p-0;
}
input[type="color"].botyglot--form-component--field--input::-webkit-color-swatch,
input[type="color"].botyglot--form-component--field--input::-moz-color-swatch {
@apply border-0 rounded-[3px];
}
}

app/components/elevate/form/file_upload.css

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/* File upload — the native `file_field` rendered by the Hotwire leaf.
`:user-invalid` (not `:invalid`) drives the error state: a required field
is invalid from page load, and painting every empty required dropzone red
before the user has touched anything is noise. `:user-invalid` only matches
after an interaction or a failed submit attempt. */
@layer components {
/* --- Plain variant: the native file input ------------------------------ */
/* `::file-selector-button` (Tailwind's `file:` variant) is what turns the
stock "Choose File / No file chosen" into something that belongs to the
design system — no wrapper markup, no JS. */
.form__file-input {
@apply block w-full mb-2 p-0 overflow-hidden text-xs leading-9 text-secondary-700
bg-white cursor-pointer rounded-xs border border-secondary-200
transition-colors
file:mr-3 file:h-9 file:px-4 file:border-0 file:border-r
file:border-secondary-200 file:bg-secondary-100 file:text-xs
file:font-medium file:text-secondary-900 file:cursor-pointer
file:transition-colors;
}
.form__file-input:hover:not(:disabled) {
@apply border-primary-400;
}
.form__file-input:hover:not(:disabled)::file-selector-button {
@apply bg-primary-100 text-primary-700;
}
.form__file-input:focus-visible {
@apply outline-none border-primary-400 ring-2 ring-inset ring-primary-200;
}
.form__file-input:user-invalid {
@apply border-danger-500;
}
.form__file-input:disabled {
@apply cursor-not-allowed opacity-50 bg-secondary-100;
}
.form__file-input:disabled::file-selector-button {
@apply cursor-not-allowed;
}
/* --- Dropzone variant -------------------------------------------------- */
/* The real input is stretched transparently over the whole zone, so the
browser handles click-to-browse, drag-&-drop and the constraint-validation
bubble natively — and anchors that bubble to the visible box rather than
to an off-screen 1px element. */
.form__file-dropzone {
@apply relative mb-2 rounded-xs border border-dashed border-secondary-200
bg-white transition-colors;
}
.form__file-dropzone__input {
@apply absolute inset-0 w-full h-full opacity-0 cursor-pointer;
}
.form__file-dropzone__content {
@apply flex flex-col items-center justify-center gap-1 w-full px-4 py-6
text-xs text-secondary-700;
}
.form__file-dropzone__filename {
@apply font-medium text-secondary-900;
}
.form__file-dropzone:hover {
@apply bg-primary-100;
}
.form__file-dropzone--dragging {
@apply border-solid border-primary-700 bg-primary-100;
}
.form__file-dropzone:has(.form__file-dropzone__input:focus-visible) {
@apply border-primary-400 ring-2 ring-inset ring-primary-200;
}
.form__file-dropzone:has(.form__file-dropzone__input:user-invalid) {
@apply border-danger-500;
}
.form__file-dropzone--disabled {
@apply opacity-50 bg-secondary-100;
}
.form__file-dropzone--disabled:hover {
@apply bg-secondary-100;
}
.form__file-dropzone--disabled .form__file-dropzone__input {
@apply cursor-not-allowed;
}
}

app/components/elevate/form/inputs.css

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
@layer components {
.overflow-guard {
@apply w-full;
}
.input-block {
@apply mb-4 mt-2 relative flex flex-wrap w-full items-stretch;
}
.input-block__text {
@apply flex items-center mb-0 rounded border border-solid text-center whitespace-nowrap text-base font-normal py-1.5 px-3;
color: #495057;
background-color: #e9ecef;
border-color: #ced4da;
}
.input-block__append, .input-block__prepend {
@apply flex text-center mb-0 border border-solid py-1.5 px-3 text-base font-normal leading-normal whitespace-nowrap rounded;
color: #495057;
background-color: #e9ecef;
border-color: #ced4da;
}
.input-block__error-feedback {
@apply w-full mt-1;
font-size: 80%;
color: #dc3545;
}
.input-block__warning-feedback {
@apply block w-full mt-1 text-xs text-[#e5a54b];
}
.input-block__field {
@apply relative flex-auto block py-1.5 px-3 leading-normal bg-clip-padding border-0 ring-1 ring-inset ring-gray-300 rounded-[4px];
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.input-block__field--invalid {
@apply bg-no-repeat ring-1 ring-inset ring-red-300 focus:ring-2 focus:ring-inset focus:ring-red-500 border-0;
background-position: right 1rem center, center right 2.25rem;
background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
padding-right: 3rem !important;
color: #e40000 !important;
}
.checkbox {
@apply absolute -mb-0.5 top-1.5 left-0;
}
.checkbox__container {
@apply relative block mt-2 mb-2 pl-6 leading-loose;
}
.editor {
min-height: 300px;
}
/* Override bootstrap border-radius changes */
.input-block .input-block__prepend {
border-radius: 4px 0 0 4px !important;
}
.input-block .input-block__append {
border-radius: 0 4px 4px 0 !important;
}
.input-block:not(.input--has-prepend):not(.input-block__append):not(.invalid-feedback) {
border-top-left-radius: 4px !important;
border-bottom-left-radius: 4px !important;
}
.input-block:not(.input--has-prepend):not(.input-block__append):not(.invalid-feedback) {
border-top-right-radius: 4px !important;
border-bottom-right-radius: 4px !important;
}
.component-class:has(dd table) {
@apply sm:grid-cols-2;
}
.button_to {
margin-bottom: 0;
}
.tel-input-block {
@apply flex-col;
}
.tel-input-block:has(.tel-input__error-feedback) {
color: #dc3545;
}
}

app/components/elevate/form/label.css

1
2
3
4
5
@layer components {
.botyglot-label {
@apply inline-block px-2 py-1;
}
}

app/components/elevate/form/multi_check.css

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
@layer components {
.multi_check__wrapper {
@apply mt-4 divide-y divide-gray-200 border-b border-t border-gray-200;
}
.multi_check__flex-container {
@apply relative flex items-start py-4;
}
.multi_check__checkbox-container {
@apply min-w-0 flex-1 text-sm leading-6;
}
.multi_check__checkbox-input {
@apply h-4! w-4! rounded! border-gray-300! text-indigo-600! focus:ring-indigo-600!;
}
.multi_check__label-container {
@apply ml-3 flex h-6 items-center;
}
.multi_check__label-text {
@apply select-none font-medium text-gray-900;
}
}

app/components/elevate/form/submit_form.css

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
@layer components {
.form__field {
@apply mb-3;
}
.form-validation {
@apply relative flex w-fit items-center gap-x-3 mt-5;
}
.form-validation .form-validation__global-error {
@apply size-6 rounded-full border-0 bg-danger-700 p-0 text-white text-[13px] font-semibold flex items-center justify-center cursor-pointer select-none appearance-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-danger-700;
}
.form-validation button[type="submit"].elevate-button--size-s {
@apply h-[36px] px-[14px] text-[13px] rounded-[9px];
}
.form-validation button[type="submit"]:disabled {
@apply bg-chip text-ink-subtle cursor-not-allowed brightness-100;
}
form[aria-busy="true"] .form-validation button[type="submit"],
form[aria-busy="true"] .form-validation button[type="submit"]:disabled {
@apply text-transparent cursor-progress bg-primary-700 opacity-90 bg-no-repeat animate-submit-dots
[background-image:radial-gradient(circle,var(--color-white)_2.5px,transparent_3px),radial-gradient(circle,var(--color-white)_2.5px,transparent_3px),radial-gradient(circle,var(--color-white)_2.5px,transparent_3px)]
[background-size:8px_8px];
}
.form-validation__tooltip {
@apply absolute bottom-full right-0 z-20 mb-[8px] w-max max-w-[320px] list-none select-none rounded-[9px] border border-danger-200 bg-danger-50 px-[12px] py-[8px] text-[12.5px] font-medium leading-[1.4] text-danger-800 shadow-[0_10px_28px_color-mix(in_srgb,var(--color-danger-800)_18%,transparent)];
}
.form-validation__tooltip--below {
@apply top-full bottom-auto mt-[8px] mb-0;
}
.form-validation__tooltip--start {
@apply left-0 right-auto;
}
.form-validation__tooltip li {
@apply flex items-center gap-[8px] py-[3px] before:content-[''] before:size-[6px] before:shrink-0 before:rounded-full before:bg-danger-700;
}
}

app/components/elevate/form/toggle_switch_component.css

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
@layer components {
.toggle_switch_component__global-container {
margin-bottom: 0.5rem;
}
.toggle_switch_component__label {
display: flex;
flex-wrap: wrap;
align-items: center;
position: relative;
margin-bottom: 1em;
cursor: pointer;
gap: 1ch;
}
.toggle_switch_component__input {
position: absolute;
opacity: 0;
width: 100%;
height: 100%;
}
.toggle_switch_component__display {
--offset: 0.25em;
--diameter: 1.8em;
display: inline-flex;
align-items: center;
justify-content: space-around;
box-sizing: content-box;
width: calc(var(--diameter) * 2 + var(--offset) * 2);
height: calc(var(--diameter) + var(--offset) * 2);
border: 0.1em solid #ccc;
position: relative;
border-radius: 100vw;
background-color: #fbe4e2;
transition: 250ms;
}
.toggle_switch_component__display::before {
content: "";
z-index: 2;
position: absolute;
top: 50%;
left: var(--offset);
box-sizing: border-box;
width: var(--diameter);
height: var(--diameter);
border: 0.1em solid #ccc;
border-radius: 50%;
background-color: white;
transform: translate(0, -50%);
will-change: transform;
transition: inherit;
}
.toggle_switch_component__label:focus .toggle_switch_component__display,
.toggle_switch_component__input:focus + .toggle_switch_component__display {
outline: 1px dotted #212121;
outline: 1px auto -webkit-focus-ring-color;
outline-offset: 2px;
}
.toggle_switch_component__label:focus,
.toggle_switch_component__label:focus:not(:focus-visible) .toggle_switch_component__display,
.toggle_switch_component__input:focus:not(:focus-visible) + .toggle_switch_component__display {
outline: 0;
}
.toggle_switch_component__label[aria-pressed="true"] .toggle_switch_component__display,
.toggle_switch_component__input:checked + .toggle_switch_component__display {
background-color: #e3f5eb;
}
.toggle_switch_component__label[aria-pressed="true"] .toggle_switch_component__display::before,
.toggle_switch_component__input:checked + .toggle_switch_component__display::before {
transform: translate(100%, -50%);
}
.toggle_switch_component__label[disabled] .toggle_switch_component__display,
.toggle_switch_component__input:disabled + .toggle_switch_component__display {
opacity: 0.6;
filter: grayscale(40%);
cursor: not-allowed;
}
.toggle_switch_component__label[read] .toggle_switch_component__display,
.toggle_switch_component__input:disabled + .toggle_switch_component__display {
opacity: 0.6;
filter: grayscale(40%);
cursor: not-allowed;
}
.toggle_switch_component__global-container .input-block__field--invalid {
border: 0px !important;
}
}

No assets to display.