vitrail 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 312798c45b2a5b4b22730f4bb0498815c147b005e82cb51d68061f948dcd4216
4
+ data.tar.gz: b8c4622f8165a3386819eba59d2a1286ff592bc52931528ca65f127d6205b604
5
+ SHA512:
6
+ metadata.gz: 9b65dda5b28707b151271840076bd64600dff682f3a12633c6ca49c6766a06ea8afb23899374685ccf19948189d8310fe4aef3bfc8560ad4a2f389cacc2e1032
7
+ data.tar.gz: c2ae283445b15cea794085076e86eb2e73897afe9184a5c09a824485ad5fd19b005ac2477bd5f67b186c5f4f0aa203fed0254e08f398e2c35a18d31e69a801fc
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright Guillaume CABANEL
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,46 @@
1
+ # Vitrail
2
+ Kuartz's Design system view components.
3
+
4
+ ## Installation
5
+ Add this line to your application's Gemfile:
6
+
7
+ ```ruby
8
+ gem "vitrail"
9
+ ```
10
+
11
+ And then execute:
12
+ ```bash
13
+ $ bundle
14
+ ```
15
+
16
+ Or install it yourself as:
17
+ ```bash
18
+ $ gem install vitrail
19
+ ```
20
+
21
+ In `config/tailwind.config.js`,
22
+
23
+ - add before `module.exports`
24
+ ```js
25
+ const execSync = require('child_process').execSync
26
+ const output = execSync('bundle show vitrail', { encoding: 'utf-8' })
27
+ ```
28
+
29
+ - add as last item of `content`:
30
+ ```js
31
+ content: [
32
+ // ...
33
+ output.trim() + '/app/components/**/*.{erb,haml,html,rb}'
34
+ ],
35
+ ```
36
+
37
+
38
+ ## Development
39
+
40
+ watch tailwindcss changes with:
41
+ ```bash
42
+ tailwindcss_watch
43
+ ```
44
+
45
+ ## License
46
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ require "bundler/setup"
2
+
3
+ APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
4
+ load "rails/tasks/engine.rake"
5
+
6
+ load "rails/tasks/statistics.rake"
7
+
8
+ require "bundler/gem_tasks"
@@ -0,0 +1 @@
1
+ //= link_directory ../stylesheets/vitrail .css
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
+ * files in this directory. Styles in this file should be added after the last require_* statement.
11
+ * It is generally better to create a new file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,730 @@
1
+ /*
2
+ ! tailwindcss v3.3.5 | MIT License | https://tailwindcss.com
3
+ */
4
+
5
+ /*
6
+ 1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
7
+ 2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
8
+ */
9
+
10
+ *,
11
+ ::before,
12
+ ::after {
13
+ box-sizing: border-box;
14
+ /* 1 */
15
+ border-width: 0;
16
+ /* 2 */
17
+ border-style: solid;
18
+ /* 2 */
19
+ border-color: #e5e7eb;
20
+ /* 2 */
21
+ }
22
+
23
+ ::before,
24
+ ::after {
25
+ --tw-content: '';
26
+ }
27
+
28
+ /*
29
+ 1. Use a consistent sensible line-height in all browsers.
30
+ 2. Prevent adjustments of font size after orientation changes in iOS.
31
+ 3. Use a more readable tab size.
32
+ 4. Use the user's configured `sans` font-family by default.
33
+ 5. Use the user's configured `sans` font-feature-settings by default.
34
+ 6. Use the user's configured `sans` font-variation-settings by default.
35
+ */
36
+
37
+ html {
38
+ line-height: 1.5;
39
+ /* 1 */
40
+ -webkit-text-size-adjust: 100%;
41
+ /* 2 */
42
+ -moz-tab-size: 4;
43
+ /* 3 */
44
+ -o-tab-size: 4;
45
+ tab-size: 4;
46
+ /* 3 */
47
+ font-family: Inter var, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
48
+ /* 4 */
49
+ font-feature-settings: normal;
50
+ /* 5 */
51
+ font-variation-settings: normal;
52
+ /* 6 */
53
+ }
54
+
55
+ /*
56
+ 1. Remove the margin in all browsers.
57
+ 2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.
58
+ */
59
+
60
+ body {
61
+ margin: 0;
62
+ /* 1 */
63
+ line-height: inherit;
64
+ /* 2 */
65
+ }
66
+
67
+ /*
68
+ 1. Add the correct height in Firefox.
69
+ 2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
70
+ 3. Ensure horizontal rules are visible by default.
71
+ */
72
+
73
+ hr {
74
+ height: 0;
75
+ /* 1 */
76
+ color: inherit;
77
+ /* 2 */
78
+ border-top-width: 1px;
79
+ /* 3 */
80
+ }
81
+
82
+ /*
83
+ Add the correct text decoration in Chrome, Edge, and Safari.
84
+ */
85
+
86
+ abbr:where([title]) {
87
+ -webkit-text-decoration: underline dotted;
88
+ text-decoration: underline dotted;
89
+ }
90
+
91
+ /*
92
+ Remove the default font size and weight for headings.
93
+ */
94
+
95
+ h1,
96
+ h2,
97
+ h3,
98
+ h4,
99
+ h5,
100
+ h6 {
101
+ font-size: inherit;
102
+ font-weight: inherit;
103
+ }
104
+
105
+ /*
106
+ Reset links to optimize for opt-in styling instead of opt-out.
107
+ */
108
+
109
+ a {
110
+ color: inherit;
111
+ text-decoration: inherit;
112
+ }
113
+
114
+ /*
115
+ Add the correct font weight in Edge and Safari.
116
+ */
117
+
118
+ b,
119
+ strong {
120
+ font-weight: bolder;
121
+ }
122
+
123
+ /*
124
+ 1. Use the user's configured `mono` font family by default.
125
+ 2. Correct the odd `em` font sizing in all browsers.
126
+ */
127
+
128
+ code,
129
+ kbd,
130
+ samp,
131
+ pre {
132
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
133
+ /* 1 */
134
+ font-size: 1em;
135
+ /* 2 */
136
+ }
137
+
138
+ /*
139
+ Add the correct font size in all browsers.
140
+ */
141
+
142
+ small {
143
+ font-size: 80%;
144
+ }
145
+
146
+ /*
147
+ Prevent `sub` and `sup` elements from affecting the line height in all browsers.
148
+ */
149
+
150
+ sub,
151
+ sup {
152
+ font-size: 75%;
153
+ line-height: 0;
154
+ position: relative;
155
+ vertical-align: baseline;
156
+ }
157
+
158
+ sub {
159
+ bottom: -0.25em;
160
+ }
161
+
162
+ sup {
163
+ top: -0.5em;
164
+ }
165
+
166
+ /*
167
+ 1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
168
+ 2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
169
+ 3. Remove gaps between table borders by default.
170
+ */
171
+
172
+ table {
173
+ text-indent: 0;
174
+ /* 1 */
175
+ border-color: inherit;
176
+ /* 2 */
177
+ border-collapse: collapse;
178
+ /* 3 */
179
+ }
180
+
181
+ /*
182
+ 1. Change the font styles in all browsers.
183
+ 2. Remove the margin in Firefox and Safari.
184
+ 3. Remove default padding in all browsers.
185
+ */
186
+
187
+ button,
188
+ input,
189
+ optgroup,
190
+ select,
191
+ textarea {
192
+ font-family: inherit;
193
+ /* 1 */
194
+ font-feature-settings: inherit;
195
+ /* 1 */
196
+ font-variation-settings: inherit;
197
+ /* 1 */
198
+ font-size: 100%;
199
+ /* 1 */
200
+ font-weight: inherit;
201
+ /* 1 */
202
+ line-height: inherit;
203
+ /* 1 */
204
+ color: inherit;
205
+ /* 1 */
206
+ margin: 0;
207
+ /* 2 */
208
+ padding: 0;
209
+ /* 3 */
210
+ }
211
+
212
+ /*
213
+ Remove the inheritance of text transform in Edge and Firefox.
214
+ */
215
+
216
+ button,
217
+ select {
218
+ text-transform: none;
219
+ }
220
+
221
+ /*
222
+ 1. Correct the inability to style clickable types in iOS and Safari.
223
+ 2. Remove default button styles.
224
+ */
225
+
226
+ button,
227
+ [type='button'],
228
+ [type='reset'],
229
+ [type='submit'] {
230
+ -webkit-appearance: button;
231
+ /* 1 */
232
+ background-color: transparent;
233
+ /* 2 */
234
+ background-image: none;
235
+ /* 2 */
236
+ }
237
+
238
+ /*
239
+ Use the modern Firefox focus style for all focusable elements.
240
+ */
241
+
242
+ :-moz-focusring {
243
+ outline: auto;
244
+ }
245
+
246
+ /*
247
+ Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)
248
+ */
249
+
250
+ :-moz-ui-invalid {
251
+ box-shadow: none;
252
+ }
253
+
254
+ /*
255
+ Add the correct vertical alignment in Chrome and Firefox.
256
+ */
257
+
258
+ progress {
259
+ vertical-align: baseline;
260
+ }
261
+
262
+ /*
263
+ Correct the cursor style of increment and decrement buttons in Safari.
264
+ */
265
+
266
+ ::-webkit-inner-spin-button,
267
+ ::-webkit-outer-spin-button {
268
+ height: auto;
269
+ }
270
+
271
+ /*
272
+ 1. Correct the odd appearance in Chrome and Safari.
273
+ 2. Correct the outline style in Safari.
274
+ */
275
+
276
+ [type='search'] {
277
+ -webkit-appearance: textfield;
278
+ /* 1 */
279
+ outline-offset: -2px;
280
+ /* 2 */
281
+ }
282
+
283
+ /*
284
+ Remove the inner padding in Chrome and Safari on macOS.
285
+ */
286
+
287
+ ::-webkit-search-decoration {
288
+ -webkit-appearance: none;
289
+ }
290
+
291
+ /*
292
+ 1. Correct the inability to style clickable types in iOS and Safari.
293
+ 2. Change font properties to `inherit` in Safari.
294
+ */
295
+
296
+ ::-webkit-file-upload-button {
297
+ -webkit-appearance: button;
298
+ /* 1 */
299
+ font: inherit;
300
+ /* 2 */
301
+ }
302
+
303
+ /*
304
+ Add the correct display in Chrome and Safari.
305
+ */
306
+
307
+ summary {
308
+ display: list-item;
309
+ }
310
+
311
+ /*
312
+ Removes the default spacing and border for appropriate elements.
313
+ */
314
+
315
+ blockquote,
316
+ dl,
317
+ dd,
318
+ h1,
319
+ h2,
320
+ h3,
321
+ h4,
322
+ h5,
323
+ h6,
324
+ hr,
325
+ figure,
326
+ p,
327
+ pre {
328
+ margin: 0;
329
+ }
330
+
331
+ fieldset {
332
+ margin: 0;
333
+ padding: 0;
334
+ }
335
+
336
+ legend {
337
+ padding: 0;
338
+ }
339
+
340
+ ol,
341
+ ul,
342
+ menu {
343
+ list-style: none;
344
+ margin: 0;
345
+ padding: 0;
346
+ }
347
+
348
+ /*
349
+ Reset default styling for dialogs.
350
+ */
351
+
352
+ dialog {
353
+ padding: 0;
354
+ }
355
+
356
+ /*
357
+ Prevent resizing textareas horizontally by default.
358
+ */
359
+
360
+ textarea {
361
+ resize: vertical;
362
+ }
363
+
364
+ /*
365
+ 1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
366
+ 2. Set the default placeholder color to the user's configured gray 400 color.
367
+ */
368
+
369
+ input::-moz-placeholder, textarea::-moz-placeholder {
370
+ opacity: 1;
371
+ /* 1 */
372
+ color: #9ca3af;
373
+ /* 2 */
374
+ }
375
+
376
+ input::placeholder,
377
+ textarea::placeholder {
378
+ opacity: 1;
379
+ /* 1 */
380
+ color: #9ca3af;
381
+ /* 2 */
382
+ }
383
+
384
+ /*
385
+ Set the default cursor for buttons.
386
+ */
387
+
388
+ button,
389
+ [role="button"] {
390
+ cursor: pointer;
391
+ }
392
+
393
+ /*
394
+ Make sure disabled buttons don't get the pointer cursor.
395
+ */
396
+
397
+ :disabled {
398
+ cursor: default;
399
+ }
400
+
401
+ /*
402
+ 1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)
403
+ 2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
404
+ This can trigger a poorly considered lint error in some tools but is included by design.
405
+ */
406
+
407
+ img,
408
+ svg,
409
+ video,
410
+ canvas,
411
+ audio,
412
+ iframe,
413
+ embed,
414
+ object {
415
+ display: block;
416
+ /* 1 */
417
+ vertical-align: middle;
418
+ /* 2 */
419
+ }
420
+
421
+ /*
422
+ Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)
423
+ */
424
+
425
+ img,
426
+ video {
427
+ max-width: 100%;
428
+ height: auto;
429
+ }
430
+
431
+ /* Make elements with the HTML hidden attribute stay hidden by default */
432
+
433
+ [hidden] {
434
+ display: none;
435
+ }
436
+
437
+ [type='text'],[type='email'],[type='url'],[type='password'],[type='number'],[type='date'],[type='datetime-local'],[type='month'],[type='search'],[type='tel'],[type='time'],[type='week'],[multiple],textarea,select {
438
+ -webkit-appearance: none;
439
+ -moz-appearance: none;
440
+ appearance: none;
441
+ background-color: #fff;
442
+ border-color: #6b7280;
443
+ border-width: 1px;
444
+ border-radius: 0px;
445
+ padding-top: 0.5rem;
446
+ padding-right: 0.75rem;
447
+ padding-bottom: 0.5rem;
448
+ padding-left: 0.75rem;
449
+ font-size: 1rem;
450
+ line-height: 1.5rem;
451
+ --tw-shadow: 0 0 #0000;
452
+ }
453
+
454
+ [type='text']:focus, [type='email']:focus, [type='url']:focus, [type='password']:focus, [type='number']:focus, [type='date']:focus, [type='datetime-local']:focus, [type='month']:focus, [type='search']:focus, [type='tel']:focus, [type='time']:focus, [type='week']:focus, [multiple]:focus, textarea:focus, select:focus {
455
+ outline: 2px solid transparent;
456
+ outline-offset: 2px;
457
+ --tw-ring-inset: var(--tw-empty,/*!*/ /*!*/);
458
+ --tw-ring-offset-width: 0px;
459
+ --tw-ring-offset-color: #fff;
460
+ --tw-ring-color: #2563eb;
461
+ --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
462
+ --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
463
+ box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
464
+ border-color: #2563eb;
465
+ }
466
+
467
+ input::-moz-placeholder, textarea::-moz-placeholder {
468
+ color: #6b7280;
469
+ opacity: 1;
470
+ }
471
+
472
+ input::placeholder,textarea::placeholder {
473
+ color: #6b7280;
474
+ opacity: 1;
475
+ }
476
+
477
+ ::-webkit-datetime-edit-fields-wrapper {
478
+ padding: 0;
479
+ }
480
+
481
+ ::-webkit-date-and-time-value {
482
+ min-height: 1.5em;
483
+ }
484
+
485
+ ::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field {
486
+ padding-top: 0;
487
+ padding-bottom: 0;
488
+ }
489
+
490
+ select {
491
+ background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
492
+ background-position: right 0.5rem center;
493
+ background-repeat: no-repeat;
494
+ background-size: 1.5em 1.5em;
495
+ padding-right: 2.5rem;
496
+ -webkit-print-color-adjust: exact;
497
+ print-color-adjust: exact;
498
+ }
499
+
500
+ [multiple] {
501
+ background-image: initial;
502
+ background-position: initial;
503
+ background-repeat: unset;
504
+ background-size: initial;
505
+ padding-right: 0.75rem;
506
+ -webkit-print-color-adjust: unset;
507
+ print-color-adjust: unset;
508
+ }
509
+
510
+ [type='checkbox'],[type='radio'] {
511
+ -webkit-appearance: none;
512
+ -moz-appearance: none;
513
+ appearance: none;
514
+ padding: 0;
515
+ -webkit-print-color-adjust: exact;
516
+ print-color-adjust: exact;
517
+ display: inline-block;
518
+ vertical-align: middle;
519
+ background-origin: border-box;
520
+ -webkit-user-select: none;
521
+ -moz-user-select: none;
522
+ user-select: none;
523
+ flex-shrink: 0;
524
+ height: 1rem;
525
+ width: 1rem;
526
+ color: #2563eb;
527
+ background-color: #fff;
528
+ border-color: #6b7280;
529
+ border-width: 1px;
530
+ --tw-shadow: 0 0 #0000;
531
+ }
532
+
533
+ [type='checkbox'] {
534
+ border-radius: 0px;
535
+ }
536
+
537
+ [type='radio'] {
538
+ border-radius: 100%;
539
+ }
540
+
541
+ [type='checkbox']:focus,[type='radio']:focus {
542
+ outline: 2px solid transparent;
543
+ outline-offset: 2px;
544
+ --tw-ring-inset: var(--tw-empty,/*!*/ /*!*/);
545
+ --tw-ring-offset-width: 2px;
546
+ --tw-ring-offset-color: #fff;
547
+ --tw-ring-color: #2563eb;
548
+ --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
549
+ --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
550
+ box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
551
+ }
552
+
553
+ [type='checkbox']:checked,[type='radio']:checked {
554
+ border-color: transparent;
555
+ background-color: currentColor;
556
+ background-size: 100% 100%;
557
+ background-position: center;
558
+ background-repeat: no-repeat;
559
+ }
560
+
561
+ [type='checkbox']:checked {
562
+ background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
563
+ }
564
+
565
+ [type='radio']:checked {
566
+ background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e");
567
+ }
568
+
569
+ [type='checkbox']:checked:hover,[type='checkbox']:checked:focus,[type='radio']:checked:hover,[type='radio']:checked:focus {
570
+ border-color: transparent;
571
+ background-color: currentColor;
572
+ }
573
+
574
+ [type='checkbox']:indeterminate {
575
+ background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3e%3c/svg%3e");
576
+ border-color: transparent;
577
+ background-color: currentColor;
578
+ background-size: 100% 100%;
579
+ background-position: center;
580
+ background-repeat: no-repeat;
581
+ }
582
+
583
+ [type='checkbox']:indeterminate:hover,[type='checkbox']:indeterminate:focus {
584
+ border-color: transparent;
585
+ background-color: currentColor;
586
+ }
587
+
588
+ [type='file'] {
589
+ background: unset;
590
+ border-color: inherit;
591
+ border-width: 0;
592
+ border-radius: 0;
593
+ padding: 0;
594
+ font-size: unset;
595
+ line-height: inherit;
596
+ }
597
+
598
+ [type='file']:focus {
599
+ outline: 1px solid ButtonText;
600
+ outline: 1px auto -webkit-focus-ring-color;
601
+ }
602
+
603
+ *, ::before, ::after {
604
+ --tw-border-spacing-x: 0;
605
+ --tw-border-spacing-y: 0;
606
+ --tw-translate-x: 0;
607
+ --tw-translate-y: 0;
608
+ --tw-rotate: 0;
609
+ --tw-skew-x: 0;
610
+ --tw-skew-y: 0;
611
+ --tw-scale-x: 1;
612
+ --tw-scale-y: 1;
613
+ --tw-pan-x: ;
614
+ --tw-pan-y: ;
615
+ --tw-pinch-zoom: ;
616
+ --tw-scroll-snap-strictness: proximity;
617
+ --tw-gradient-from-position: ;
618
+ --tw-gradient-via-position: ;
619
+ --tw-gradient-to-position: ;
620
+ --tw-ordinal: ;
621
+ --tw-slashed-zero: ;
622
+ --tw-numeric-figure: ;
623
+ --tw-numeric-spacing: ;
624
+ --tw-numeric-fraction: ;
625
+ --tw-ring-inset: ;
626
+ --tw-ring-offset-width: 0px;
627
+ --tw-ring-offset-color: #fff;
628
+ --tw-ring-color: rgb(59 130 246 / 0.5);
629
+ --tw-ring-offset-shadow: 0 0 #0000;
630
+ --tw-ring-shadow: 0 0 #0000;
631
+ --tw-shadow: 0 0 #0000;
632
+ --tw-shadow-colored: 0 0 #0000;
633
+ --tw-blur: ;
634
+ --tw-brightness: ;
635
+ --tw-contrast: ;
636
+ --tw-grayscale: ;
637
+ --tw-hue-rotate: ;
638
+ --tw-invert: ;
639
+ --tw-saturate: ;
640
+ --tw-sepia: ;
641
+ --tw-drop-shadow: ;
642
+ --tw-backdrop-blur: ;
643
+ --tw-backdrop-brightness: ;
644
+ --tw-backdrop-contrast: ;
645
+ --tw-backdrop-grayscale: ;
646
+ --tw-backdrop-hue-rotate: ;
647
+ --tw-backdrop-invert: ;
648
+ --tw-backdrop-opacity: ;
649
+ --tw-backdrop-saturate: ;
650
+ --tw-backdrop-sepia: ;
651
+ }
652
+
653
+ ::backdrop {
654
+ --tw-border-spacing-x: 0;
655
+ --tw-border-spacing-y: 0;
656
+ --tw-translate-x: 0;
657
+ --tw-translate-y: 0;
658
+ --tw-rotate: 0;
659
+ --tw-skew-x: 0;
660
+ --tw-skew-y: 0;
661
+ --tw-scale-x: 1;
662
+ --tw-scale-y: 1;
663
+ --tw-pan-x: ;
664
+ --tw-pan-y: ;
665
+ --tw-pinch-zoom: ;
666
+ --tw-scroll-snap-strictness: proximity;
667
+ --tw-gradient-from-position: ;
668
+ --tw-gradient-via-position: ;
669
+ --tw-gradient-to-position: ;
670
+ --tw-ordinal: ;
671
+ --tw-slashed-zero: ;
672
+ --tw-numeric-figure: ;
673
+ --tw-numeric-spacing: ;
674
+ --tw-numeric-fraction: ;
675
+ --tw-ring-inset: ;
676
+ --tw-ring-offset-width: 0px;
677
+ --tw-ring-offset-color: #fff;
678
+ --tw-ring-color: rgb(59 130 246 / 0.5);
679
+ --tw-ring-offset-shadow: 0 0 #0000;
680
+ --tw-ring-shadow: 0 0 #0000;
681
+ --tw-shadow: 0 0 #0000;
682
+ --tw-shadow-colored: 0 0 #0000;
683
+ --tw-blur: ;
684
+ --tw-brightness: ;
685
+ --tw-contrast: ;
686
+ --tw-grayscale: ;
687
+ --tw-hue-rotate: ;
688
+ --tw-invert: ;
689
+ --tw-saturate: ;
690
+ --tw-sepia: ;
691
+ --tw-drop-shadow: ;
692
+ --tw-backdrop-blur: ;
693
+ --tw-backdrop-brightness: ;
694
+ --tw-backdrop-contrast: ;
695
+ --tw-backdrop-grayscale: ;
696
+ --tw-backdrop-hue-rotate: ;
697
+ --tw-backdrop-invert: ;
698
+ --tw-backdrop-opacity: ;
699
+ --tw-backdrop-saturate: ;
700
+ --tw-backdrop-sepia: ;
701
+ }
702
+
703
+ .p-20 {
704
+ padding: 5rem;
705
+ }
706
+
707
+ .px-8 {
708
+ padding-left: 2rem;
709
+ padding-right: 2rem;
710
+ }
711
+
712
+ .py-4 {
713
+ padding-top: 1rem;
714
+ padding-bottom: 1rem;
715
+ }
716
+
717
+ .text-blue-700 {
718
+ --tw-text-opacity: 1;
719
+ color: rgb(29 78 216 / var(--tw-text-opacity));
720
+ }
721
+
722
+ /*
723
+
724
+ @layer components {
725
+ .btn-primary {
726
+ @apply py-2 px-4 bg-blue-200;
727
+ }
728
+ }
729
+
730
+ */
@@ -0,0 +1,13 @@
1
+ @tailwind base;
2
+ @tailwind components;
3
+ @tailwind utilities;
4
+
5
+ /*
6
+
7
+ @layer components {
8
+ .btn-primary {
9
+ @apply py-2 px-4 bg-blue-200;
10
+ }
11
+ }
12
+
13
+ */
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Vitrail
4
+ class BaseComponent < ViewComponent::Base
5
+ private attr_reader :html_options, :custom_classes
6
+
7
+ def initialize(**html_options)
8
+ super
9
+
10
+ @custom_classes = html_options.delete(:class) || ""
11
+ @html_options = html_options.stringify_keys
12
+ end
13
+
14
+ private
15
+
16
+ def local_classes
17
+ ""
18
+ end
19
+
20
+ def html_attributes
21
+ ActionView::Helpers::TagHelper::TagBuilder.new(view_context).
22
+ attributes(html_options)
23
+ end
24
+
25
+ def html_classes
26
+ [local_classes, custom_classes].reject(&:blank?).join(" ")
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Vitrail
4
+ class Title < BaseComponent
5
+ erb_template <<~ERB.squish
6
+ <h<%= level %> class="<%= html_classes %>" <%= html_attributes %>>
7
+ <%= content %>
8
+ </h<%= level %>>
9
+ ERB
10
+
11
+ LEVEL_CLASSES = {
12
+ 1 => "mt-10 mb-4 text-2xl xl:text-3xl font-bold tracking-tight text-slate-900",
13
+ 2 => "mt-8 mb-2 text-xl xl:text-2xl font-bold tracking-tight text-slate-900",
14
+ 3 => "mt-4 mb-1 xl:text-lg font-semibold tracking-tight text-slate-800"
15
+ }.freeze
16
+ private_constant :LEVEL_CLASSES
17
+
18
+ private attr_reader :level
19
+
20
+ def initialize(level: 1, **html_options)
21
+ super(**html_options)
22
+ @level = level
23
+ end
24
+
25
+ private
26
+
27
+ def local_classes = LEVEL_CLASSES[level]
28
+ end
29
+ end
@@ -0,0 +1,4 @@
1
+ module Vitrail
2
+ class ApplicationController < ActionController::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module Vitrail
2
+ module ApplicationHelper
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module Vitrail
2
+ class ApplicationJob < ActiveJob::Base
3
+ end
4
+ end
@@ -0,0 +1,6 @@
1
+ module Vitrail
2
+ class ApplicationMailer < ActionMailer::Base
3
+ default from: "from@example.com"
4
+ layout "mailer"
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ module Vitrail
2
+ class ApplicationRecord < ActiveRecord::Base
3
+ self.abstract_class = true
4
+ end
5
+ end
@@ -0,0 +1,15 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Vitrail</title>
5
+ <%= csrf_meta_tags %>
6
+ <%= csp_meta_tag %>
7
+
8
+ <%= stylesheet_link_tag "vitrail", "data-turbo-track": "reload" %>
9
+ </head>
10
+ <body>
11
+ <main class="p-20">
12
+ <%= yield %>
13
+ </main>
14
+ </body>
15
+ </html>
@@ -0,0 +1,15 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Vitrail</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <%= csrf_meta_tags %>
7
+ <%= csp_meta_tag %>
8
+
9
+ <%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %>
10
+ <%= stylesheet_link_tag "vitrail/application" %>
11
+ </head>
12
+ <body class="px-8 py-4 margin-x-auto">
13
+ <%= yield %>
14
+ </body>
15
+ </html>
data/config/routes.rb ADDED
@@ -0,0 +1,3 @@
1
+ Vitrail::Engine.routes.draw do
2
+ mount Lookbook::Engine, at: "/"
3
+ end
@@ -0,0 +1,22 @@
1
+ const defaultTheme = require('tailwindcss/defaultTheme')
2
+
3
+ module.exports = {
4
+ content: [
5
+ './app/views/**/*.{erb,html,slim}',
6
+ './app/components/**/*.{erb,html,slim}',
7
+ './test/components/previews/**/*.{rb,erb,html,slim}'
8
+ ],
9
+ theme: {
10
+ extend: {
11
+ fontFamily: {
12
+ sans: ['Inter var', ...defaultTheme.fontFamily.sans],
13
+ },
14
+ },
15
+ },
16
+ plugins: [
17
+ require('@tailwindcss/forms'),
18
+ require('@tailwindcss/aspect-ratio'),
19
+ require('@tailwindcss/typography'),
20
+ require('@tailwindcss/container-queries'),
21
+ ]
22
+ }
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :vitrail do
3
+ # # Task goes here
4
+ # end
@@ -0,0 +1,20 @@
1
+ module Vitrail
2
+ class Engine < ::Rails::Engine
3
+ isolate_namespace Vitrail
4
+
5
+ initializer "vitrail.precompile" do |app|
6
+ app.config.assets.precompile += %w[vitrail_manifest]
7
+ end
8
+
9
+ initializer "vitrail.lookbook" do |app|
10
+ app.config.lookbook.preview_paths << Vitrail::Engine.root.join("test/components/previews")
11
+ app.config.lookbook.preview_layout = "vitrail/component_preview"
12
+ app.config.lookbook.project_name = "Vitrail"
13
+ app.config.lookbook.project_logo = false
14
+ app.config.lookbook.ui_favicon = false
15
+ app.config.lookbook.preview_collection_label = "Components"
16
+ app.config.lookbook.ui_theme = "zinc"
17
+ app.config.lookbook.preview_inspector.drawer_panels = [:source]
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,3 @@
1
+ module Vitrail
2
+ VERSION = "0.1.0"
3
+ end
data/lib/vitrail.rb ADDED
@@ -0,0 +1,6 @@
1
+ require "vitrail/version"
2
+ require "vitrail/engine"
3
+
4
+ module Vitrail
5
+ # Your code goes here...
6
+ end
metadata ADDED
@@ -0,0 +1,125 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vitrail
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Guillaume CABANEL
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2023-11-15 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 7.0.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 7.0.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: view_component
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 3.0.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 3.0.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: tailwindcss-rails
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '2.0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '2.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: lookbook
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 2.1.1
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 2.1.1
69
+ description: Kuartz design system view components
70
+ email:
71
+ - guillaume@kuartz.fr
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - MIT-LICENSE
77
+ - README.md
78
+ - Rakefile
79
+ - app/assets/config/vitrail_manifest.js
80
+ - app/assets/stylesheets/vitrail.tailwind.css
81
+ - app/assets/stylesheets/vitrail/application.css
82
+ - app/assets/stylesheets/vitrail/vitrail.css
83
+ - app/components/vitrail/base_component.rb
84
+ - app/components/vitrail/title.rb
85
+ - app/controllers/vitrail/application_controller.rb
86
+ - app/helpers/vitrail/application_helper.rb
87
+ - app/jobs/vitrail/application_job.rb
88
+ - app/mailers/vitrail/application_mailer.rb
89
+ - app/models/vitrail/application_record.rb
90
+ - app/views/layouts/vitrail/application.html.erb
91
+ - app/views/layouts/vitrail/component_preview.html.erb
92
+ - config/routes.rb
93
+ - config/tailwind.config.js
94
+ - lib/tasks/vitrail_tasks.rake
95
+ - lib/vitrail.rb
96
+ - lib/vitrail/engine.rb
97
+ - lib/vitrail/version.rb
98
+ homepage: https://github.com/kuartz-org/vitrail
99
+ licenses:
100
+ - MIT
101
+ metadata:
102
+ allowed_push_host: https://rubygems.org
103
+ homepage_uri: https://github.com/kuartz-org/vitrail
104
+ source_code_uri: https://github.com/kuartz-org/vitrail
105
+ changelog_uri: https://github.com/kuartz-org/vitrail/blob/main/CHANGELOG.md
106
+ post_install_message:
107
+ rdoc_options: []
108
+ require_paths:
109
+ - lib
110
+ required_ruby_version: !ruby/object:Gem::Requirement
111
+ requirements:
112
+ - - ">="
113
+ - !ruby/object:Gem::Version
114
+ version: '0'
115
+ required_rubygems_version: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - ">="
118
+ - !ruby/object:Gem::Version
119
+ version: '0'
120
+ requirements: []
121
+ rubygems_version: 3.4.14
122
+ signing_key:
123
+ specification_version: 4
124
+ summary: Kuartz design system
125
+ test_files: []