css-zero 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +300 -102
  3. data/app/assets/stylesheets/_reset.css +1 -1
  4. data/app/assets/stylesheets/colors.css +0 -26
  5. data/app/assets/stylesheets/transform.css +32 -40
  6. data/app/assets/stylesheets/transition.css +2 -7
  7. data/app/assets/stylesheets/zutilities.css +43 -9
  8. data/lib/css-zero.rb +3 -6
  9. data/lib/css_zero/engine.rb +4 -0
  10. data/lib/css_zero/version.rb +1 -3
  11. data/lib/generators/css_zero/add/USAGE +8 -0
  12. data/lib/generators/css_zero/add/add_generator.rb +28 -0
  13. data/lib/generators/css_zero/add/resources.yml +27 -0
  14. data/lib/generators/css_zero/add/templates/app/assets/images/chevron-down.svg +1 -0
  15. data/lib/generators/css_zero/add/templates/app/assets/images/loader-circle.svg +1 -0
  16. data/lib/generators/css_zero/add/templates/app/assets/images/select-arrow.svg +1 -0
  17. data/lib/generators/css_zero/add/templates/app/assets/images/x.svg +1 -0
  18. data/lib/generators/css_zero/add/templates/app/assets/stylesheets/accordion.css +44 -0
  19. data/lib/generators/css_zero/add/templates/app/assets/stylesheets/alert.css +18 -0
  20. data/lib/generators/css_zero/add/templates/app/assets/stylesheets/alert_dialog.css +59 -0
  21. data/lib/generators/css_zero/add/templates/app/assets/stylesheets/badge.css +30 -0
  22. data/{app/assets/stylesheets/buttons.css → lib/generators/css_zero/add/templates/app/assets/stylesheets/button.css} +32 -14
  23. data/lib/generators/css_zero/add/templates/app/assets/stylesheets/card.css +6 -0
  24. data/lib/generators/css_zero/add/templates/app/assets/stylesheets/dialog.css +64 -0
  25. data/lib/generators/css_zero/add/templates/app/assets/stylesheets/input.css +51 -0
  26. data/lib/generators/css_zero/add/templates/app/assets/stylesheets/progress.css +45 -0
  27. data/lib/generators/css_zero/add/templates/app/assets/stylesheets/switch.css +41 -0
  28. data/lib/generators/css_zero/add/templates/app/assets/stylesheets/table.css +27 -0
  29. data/lib/generators/css_zero/add/templates/app/javascript/controllers/dialog_control_controller.js +17 -0
  30. data/lib/generators/css_zero/install/USAGE +5 -0
  31. data/lib/generators/css_zero/install/install_generator.rb +9 -0
  32. data/lib/generators/css_zero/install/templates/app/assets/stylesheets/base.css +46 -0
  33. metadata +25 -5
  34. data/app/assets/stylesheets/dialog.css +0 -33
  35. data/app/assets/stylesheets/inputs.css +0 -54
@@ -23,7 +23,7 @@
23
23
  .self-center { align-self: center; }
24
24
 
25
25
  .gap { column-gap: var(--column-gap, 1rem); row-gap: var(--row-gap, 1rem); }
26
- .gap-small { column-gap: 0.5rem; row-gap: 0.5rem; }
26
+ .gap-sm { column-gap: 0.5rem; row-gap: 0.5rem; }
27
27
 
28
28
  /****************************************************************
29
29
  * Text
@@ -51,6 +51,7 @@
51
51
  .opacity-75 { opacity: var(--opacity-75); }
52
52
  .opacity-50 { opacity: var(--opacity-50); }
53
53
 
54
+ .leading-none { line-height: var(--leading-none); }
54
55
  .leading-tight { line-height: var(--leading-tight); }
55
56
  .leading-normal { line-height: var(--leading-normal); }
56
57
 
@@ -91,16 +92,18 @@
91
92
  *****************************************************************/
92
93
  .colorize-black { filter: var(--color-filter-text); }
93
94
  .colorize-white { filter: var(--color-filter-text-reversed); }
95
+ .colorize-negative { filter: var(--color-filter-negative); }
96
+ .colorize-positive { filter: var(--color-filter-positive); }
94
97
 
95
98
  /****************************************************************
96
99
  * Border
97
100
  *****************************************************************/
98
- .border-0 { border: 0; }
99
- .border { border: var(--border-size, 1px) solid var(--border-color, var(--color-border)); }
100
- .border-t { border-top: var(--border-size, 1px) solid var(--border-color, var(--color-border)); }
101
- .border-b { border-bottom: var(--border-size, 1px) solid var(--border-color, var(--color-border)); }
102
- .border-l { border-left: var(--border-size, 1px) solid var(--border-color, var(--color-border)); }
103
- .border-r { border-right: var(--border-size, 1px) solid var(--border-color, var(--color-border)); }
101
+ .border-0 { border-width: 0; }
102
+ .border { border-width: var(--border-size, 1px); }
103
+ .border-bs { border-block-start-width: var(--border-size, 1px); }
104
+ .border-be { border-block-end-width: var(--border-size, 1px); }
105
+ .border-is { border-inline-start-width: var(--border-size, 1px); }
106
+ .border-ie { border-inline-end-width: var(--border-size, 1px); }
104
107
 
105
108
  .rounded-none { border-radius: none; }
106
109
  .rounded-sm { border-radius: var(--rounded-sm); }
@@ -140,8 +143,8 @@
140
143
  .h-full { block-size: 100%; }
141
144
  .w-full { inline-size: 100%; }
142
145
 
143
- .overflow-x-auto { overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; }
144
- .overflow-y-auto { overflow-y: auto; scroll-snap-type: y mandatory; scroll-behavior: smooth; }
146
+ .overflow-x-auto { overflow-x: auto; scroll-snap-type: x mandatory; }
147
+ .overflow-y-auto { overflow-y: auto; scroll-snap-type: y mandatory; }
145
148
  .overflow-hidden { overflow: hidden; }
146
149
 
147
150
  /****************************************************************
@@ -283,6 +286,37 @@
283
286
  .pie-8 { padding-inline-end: var(--size-8); }
284
287
  .pie-10 { padding-inline-end: var(--size-10); }
285
288
 
289
+ /****************************************************************
290
+ * Grid system
291
+ *****************************************************************/
292
+ .grid { display: grid; }
293
+
294
+ .grid-cols-1 { grid-template-columns: var(--grid-1); }
295
+ .grid-cols-2 { grid-template-columns: var(--grid-2); }
296
+ .grid-cols-3 { grid-template-columns: var(--grid-3); }
297
+ .grid-cols-4 { grid-template-columns: var(--grid-4); }
298
+ .grid-cols-5 { grid-template-columns: var(--grid-5); }
299
+ .grid-cols-6 { grid-template-columns: var(--grid-6); }
300
+ .grid-cols-7 { grid-template-columns: var(--grid-7); }
301
+ .grid-cols-8 { grid-template-columns: var(--grid-8); }
302
+ .grid-cols-9 { grid-template-columns: var(--grid-9); }
303
+ .grid-cols-10 { grid-template-columns: var(--grid-10); }
304
+ .grid-cols-11 { grid-template-columns: var(--grid-11); }
305
+ .grid-cols-12 { grid-template-columns: var(--grid-12); }
306
+
307
+ .col-span-1 { grid-column: var(--span-1); }
308
+ .col-span-2 { grid-column: var(--span-2); }
309
+ .col-span-3 { grid-column: var(--span-3); }
310
+ .col-span-4 { grid-column: var(--span-4); }
311
+ .col-span-5 { grid-column: var(--span-5); }
312
+ .col-span-6 { grid-column: var(--span-6); }
313
+ .col-span-7 { grid-column: var(--span-7); }
314
+ .col-span-8 { grid-column: var(--span-8); }
315
+ .col-span-9 { grid-column: var(--span-9); }
316
+ .col-span-10 { grid-column: var(--span-10); }
317
+ .col-span-11 { grid-column: var(--span-11); }
318
+ .col-span-12 { grid-column: var(--span-12); }
319
+
286
320
  /****************************************************************
287
321
  * Accessibility
288
322
  *****************************************************************/
data/lib/css-zero.rb CHANGED
@@ -1,8 +1,5 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "css_zero/version"
4
-
5
1
  module CssZero
6
- class Engine < ::Rails::Engine
7
- end
8
2
  end
3
+
4
+ require "css_zero/version"
5
+ require "css_zero/engine"
@@ -0,0 +1,4 @@
1
+ module CssZero
2
+ class Engine < ::Rails::Engine
3
+ end
4
+ end
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module CssZero
4
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
5
3
  end
@@ -0,0 +1,8 @@
1
+ Description:
2
+ This will add components into your project.
3
+
4
+ Components:
5
+ accordion alert alert_dialog badge button card dialog input progress switch table
6
+
7
+ Example:
8
+ bin/rails generate css_zero:add [components...]
@@ -0,0 +1,28 @@
1
+ require "rails/generators/named_base"
2
+
3
+ class CssZero::AddGenerator < Rails::Generators::Base
4
+ source_root File.expand_path("templates", __dir__)
5
+
6
+ argument :components, type: :array, banner: "[components]"
7
+
8
+ def add_components
9
+ components.each { |component| copy_resources_for(component) }
10
+ end
11
+
12
+ private
13
+ def copy_resources_for(component)
14
+ if resources.has_key?(component)
15
+ resources[component].each { |resource| copy_file(resource) }
16
+ else
17
+ say_status :invalid, component, :red
18
+ end
19
+ end
20
+
21
+ def resources
22
+ @resources ||= YAML.load_file(resources_path)
23
+ end
24
+
25
+ def resources_path
26
+ File.expand_path "resources.yml", __dir__
27
+ end
28
+ end
@@ -0,0 +1,27 @@
1
+ accordion:
2
+ - app/assets/stylesheets/accordion.css
3
+ - app/assets/images/chevron-down.svg
4
+ alert:
5
+ - app/assets/stylesheets/alert.css
6
+ alert_dialog:
7
+ - app/assets/stylesheets/alert_dialog.css
8
+ - app/javascript/controllers/dialog_control_controller.js
9
+ badge:
10
+ - app/assets/stylesheets/badge.css
11
+ button:
12
+ - app/assets/stylesheets/button.css
13
+ - app/assets/images/loader-circle.svg
14
+ card:
15
+ - app/assets/stylesheets/card.css
16
+ dialog:
17
+ - app/assets/stylesheets/dialog.css
18
+ - app/assets/images/x.svg
19
+ input:
20
+ - app/assets/stylesheets/input.css
21
+ - app/assets/images/select-arrow.svg
22
+ progress:
23
+ - app/assets/stylesheets/progress.css
24
+ switch:
25
+ - app/assets/stylesheets/switch.css
26
+ table:
27
+ - app/assets/stylesheets/table.css
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m6 9 6 6 6-6"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12a9 9 0 1 1-6.219-8.56"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#71717a" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m6 9 6 6 6-6"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>
@@ -0,0 +1,44 @@
1
+ :where(.accordion) {
2
+ inline-size: var(--size-full);
3
+
4
+ details {
5
+ border-block-end-width: var(--border);
6
+ transition: padding var(--time-150) var(--ease-in-out);
7
+
8
+ &[open] {
9
+ padding-block-end: var(--size-4);
10
+ }
11
+
12
+ &[open] summary::after {
13
+ transform: var(--rotate-180);
14
+ }
15
+ }
16
+
17
+ summary {
18
+ align-items: center;
19
+ cursor: pointer;
20
+ display: flex;
21
+ font-weight: var(--font-medium);
22
+ justify-content: space-between;
23
+ padding-block: var(--size-4);
24
+
25
+ &:focus-visible {
26
+ outline: var(--border-2) solid var(--color-border-darker);
27
+ outline-offset: var(--border-2);
28
+ }
29
+
30
+ &::-webkit-details-marker {
31
+ display: none;
32
+ }
33
+
34
+ &::after {
35
+ background-image: url("chevron-down.svg");
36
+ background-size: cover;
37
+ block-size: var(--size-4);
38
+ content: "";
39
+ filter: var(--color-filter-text);
40
+ inline-size: var(--size-4);
41
+ transition: transform var(--time-200) var(--ease-in-out);
42
+ }
43
+ }
44
+ }
@@ -0,0 +1,18 @@
1
+ .alert {
2
+ border-color: var(--alert-border-color, var(--color-border));
3
+ border-radius: var(--rounded-lg);
4
+ border-width: var(--border);
5
+ color: var(--alert-color, var(--color-text));
6
+ padding: var(--size-4);
7
+ inline-size: var(--size-full);
8
+
9
+ img:not([class]) {
10
+ filter: var(--alert-icon-color, var(--color-filter-text-reversed));
11
+ }
12
+ }
13
+
14
+ .alert--negative {
15
+ --alert-border-color: var(--color-negative);
16
+ --alert-color: var(--color-negative);
17
+ --alert-icon-color: var(--color-filter-negative);
18
+ }
@@ -0,0 +1,59 @@
1
+ .alert-dialog {
2
+ background-color: var(--color-bg);
3
+ border-width: var(--border);
4
+ border-radius: var(--rounded-lg);
5
+ box-shadow: var(--shadow-lg);
6
+ color: var(--color-text);
7
+ inline-size: var(--size-full);
8
+ margin: auto;
9
+ max-inline-size: var(--width-lg);
10
+ padding: var(--size-6);
11
+
12
+ &::backdrop {
13
+ background-color: rgba(0, 0, 0, .8);
14
+ }
15
+
16
+ /* Setup animation */
17
+ opacity: 0;
18
+ transform: var(--scale-95);
19
+ transition-behavior: allow-discrete;
20
+ transition-duration: var(--time-150);
21
+ transition-property: display overlay opacity transform;
22
+
23
+ &::backdrop {
24
+ opacity: 0;
25
+ transition-behavior: allow-discrete;
26
+ transition-duration: var(--time-150);
27
+ transition-property: display overlay opacity;
28
+ }
29
+
30
+ /* In animation */
31
+ &[open] {
32
+ opacity: 1; transform: var(--scale-100);
33
+ }
34
+
35
+ &[open]::backdrop {
36
+ opacity: 1;
37
+ }
38
+
39
+ /* Out animation */
40
+ @starting-style {
41
+ &[open] {
42
+ opacity: 0; transform: var(--scale-95);
43
+ }
44
+
45
+ &[open]::backdrop {
46
+ opacity: 0;
47
+ }
48
+ }
49
+
50
+ /* Small screens */
51
+ @media (width < 40rem) {
52
+ border-radius: 0;
53
+ }
54
+ }
55
+
56
+ /* Prevent page scroll when alert dialog is open */
57
+ html:has(.alert-dialog[open]) {
58
+ overflow: hidden;
59
+ }
@@ -0,0 +1,30 @@
1
+ .badge {
2
+ background-color: var(--badge-background, var(--color-primary));
3
+ border-radius: var(--rounded-full);
4
+ border-width: var(--badge-border-width, 0);
5
+ color: var(--badge-color, var(--color-text-reversed));
6
+ font-size: var(--text-xs);
7
+ font-weight: var(--font-semibold);
8
+ padding: var(--size-0_5) var(--size-2_5);
9
+ }
10
+
11
+ .badge--secondary {
12
+ --badge-background: var(--color-secondary);
13
+ --badge-color: var(--color-text);
14
+ }
15
+
16
+ .badge--outline {
17
+ --badge-background: transparent;
18
+ --badge-color: var(--color-text);
19
+ --btn-border-width: var(--border);
20
+ }
21
+
22
+ .badge--positive {
23
+ --badge-background: var(--color-positive);
24
+ --badge-color: white;
25
+ }
26
+
27
+ .badge--negative {
28
+ --badge-background: var(--color-negative);
29
+ --badge-color: white;
30
+ }
@@ -1,16 +1,17 @@
1
1
  .btn {
2
2
  align-items: center;
3
3
  background-color: var(--btn-background, var(--color-primary));
4
- border-radius: var(--btn-border-radius, var(--rounded-md));
5
- border: 1px solid var(--btn-border-color, transparent);
4
+ border-color: var(--color-border);
5
+ border-radius: var(--rounded-md);
6
+ border-width: var(--btn-border-width, 0);
6
7
  color: var(--btn-color, var(--color-text-reversed));
7
- column-gap: var(--btn-gap, var(--size-2));
8
8
  cursor: pointer;
9
9
  display: inline-flex;
10
- font-size: var(--btn-font-size, var(--text-sm));
11
- font-weight: var(--btn-font-weight, var(--font-medium));
10
+ font-size: var(--text-sm);
11
+ font-weight: var(--font-medium);
12
+ gap: var(--size-2);
12
13
  justify-content: center;
13
- padding: var(--btn-padding, .5rem 1rem);
14
+ padding: var(--size-2) var(--size-4);
14
15
  text-align: center;
15
16
  white-space: nowrap;
16
17
 
@@ -19,7 +20,7 @@
19
20
  }
20
21
 
21
22
  &:focus-visible {
22
- outline: 2px solid var(--color-selected);
23
+ outline: var(--border-2) solid var(--color-border-darker);
23
24
  outline-offset: var(--border-2);
24
25
  }
25
26
 
@@ -36,8 +37,8 @@
36
37
  }
37
38
 
38
39
  .btn--outline {
39
- --btn-background: transparent;
40
- --btn-border-color: var(--color-border);
40
+ --btn-background: var(--color-bg);
41
+ --btn-border-width: var(--border);
41
42
  --btn-color: var(--color-text);
42
43
  --btn-icon-color: var(--color-filter-text);
43
44
  }
@@ -48,12 +49,29 @@
48
49
  --btn-icon-color: var(--color-filter-text);
49
50
  }
50
51
 
51
- .btn--positive {
52
- --btn-background: var(--color-positive);
53
- --btn-color: white;
54
- }
55
-
56
52
  .btn--negative {
57
53
  --btn-background: var(--color-negative);
58
54
  --btn-color: white;
59
55
  }
56
+
57
+ .btn--loading {
58
+ [aria-busy] &:disabled {
59
+ position: relative;
60
+
61
+ > * {
62
+ visibility: hidden;
63
+ }
64
+
65
+ &::after {
66
+ animation: var(--animate-spin);
67
+ background-image: url("loader-circle.svg");
68
+ background-size: cover;
69
+ block-size: var(--size-4);
70
+ content: "";
71
+ filter: var(--btn-icon-color, var(--color-filter-text-reversed));
72
+ inline-size: var(--size-4);
73
+ margin-inline: auto;
74
+ position: absolute;
75
+ }
76
+ }
77
+ }
@@ -0,0 +1,6 @@
1
+ .card {
2
+ border-radius: var(--rounded-lg);
3
+ border-width: var(--border);
4
+ padding: var(--size-6);
5
+ shadow: var(--shadow-sm);
6
+ }
@@ -0,0 +1,64 @@
1
+ .dialog {
2
+ background-color: var(--color-bg);
3
+ border-width: var(--border);
4
+ border-radius: var(--rounded-lg);
5
+ box-shadow: var(--shadow-lg);
6
+ color: var(--color-text);
7
+ inline-size: var(--size-full);
8
+ margin: auto;
9
+ max-inline-size: var(--width-lg);
10
+ padding: var(--size-6);
11
+
12
+ &::backdrop {
13
+ background-color: rgba(0, 0, 0, .8);
14
+ }
15
+
16
+ /* Setup animation */
17
+ opacity: 0;
18
+ transform: var(--scale-95);
19
+ transition-behavior: allow-discrete;
20
+ transition-duration: var(--time-150);
21
+ transition-property: display overlay opacity transform;
22
+
23
+ &::backdrop {
24
+ opacity: 0;
25
+ transition-behavior: allow-discrete;
26
+ transition-duration: var(--time-150);
27
+ transition-property: display overlay opacity;
28
+ }
29
+
30
+ /* In animation */
31
+ &:popover-open {
32
+ opacity: 1; transform: var(--scale-100);
33
+ }
34
+
35
+ &:popover-open::backdrop {
36
+ opacity: 1;
37
+ }
38
+
39
+ /* Out animation */
40
+ @starting-style {
41
+ &:popover-open {
42
+ opacity: 0; transform: var(--scale-95);
43
+ }
44
+
45
+ &:popover-open::backdrop {
46
+ opacity: 0;
47
+ }
48
+ }
49
+
50
+ /* Small screens */
51
+ @media (width < 40rem) {
52
+ border-radius: 0;
53
+ }
54
+ }
55
+
56
+ .dialog__close {
57
+ position: absolute;
58
+ inset: var(--size-4) var(--size-4) auto auto;
59
+ }
60
+
61
+ /* Prevent page scroll when dialog is open */
62
+ html:has(.dialog:popover-open) {
63
+ overflow: hidden;
64
+ }
@@ -0,0 +1,51 @@
1
+ .input {
2
+ appearance: none;
3
+ background-color: var(--color-bg);
4
+ border-color: var(--color-border);
5
+ border-radius: var(--rounded-md);
6
+ border-width: var(--border);
7
+ box-shadow: var(--shadow-xs);
8
+ font-size: var(--text-sm);
9
+ inline-size: var(--size-full);
10
+ padding: var(--size-2) var(--size-3);
11
+
12
+ &:is(select):not([multiple], [size]) {
13
+ background-image: url("select-arrow.svg");
14
+ background-position: center right var(--size-2);
15
+ background-repeat: no-repeat;
16
+ background-size: var(--size-4) auto;
17
+ }
18
+
19
+ &::file-selector-button {
20
+ font-weight: var(--font-medium);
21
+ margin-inline-end: var(--size-2);
22
+ }
23
+
24
+ &::placeholder {
25
+ color: var(--color-text-subtle);
26
+ }
27
+
28
+ &:user-invalid {
29
+ border-color: var(--color-negative);
30
+ }
31
+
32
+ &:disabled {
33
+ cursor: not-allowed;
34
+ opacity: var(--opacity-50);
35
+ }
36
+ }
37
+
38
+ .range {
39
+ accent-color: var(--color-primary);
40
+ }
41
+
42
+ .checkbox, .radio {
43
+ accent-color: var(--color-primary);
44
+ transform: scale(1.15);
45
+ }
46
+
47
+ /* Keyboard navigation */
48
+ :is(.input, .range, .checkbox, .radio):focus-visible {
49
+ outline: var(--border-2) solid var(--color-border-darker);
50
+ outline-offset: var(--border-2);
51
+ }
@@ -0,0 +1,45 @@
1
+ .progress {
2
+ --track: var(--color-secondary);
3
+ --progress: var(--color-primary);
4
+
5
+ background-color: var(--track);
6
+ border-radius: var(--rounded-full);
7
+ block-size: var(--size-4);
8
+ inline-size: var(--size-full);
9
+ overflow: hidden;
10
+
11
+ &:indeterminate {
12
+ background: linear-gradient(to right, var(--track) 45%, var(--progress) 0%, var(--progress) 55%, var(--track) 0%);
13
+ background-size: 225% 100%;
14
+ background-position: right;
15
+ animation: progress-loading 2s infinite ease;
16
+ }
17
+
18
+ /* Safari/Chromium */
19
+ &::-webkit-progress-bar {
20
+ background-color: var(--track);
21
+ }
22
+
23
+ &::-webkit-progress-value {
24
+ background-color: var(--progress);
25
+ }
26
+
27
+ &:indeterminate::-webkit-progress-bar {
28
+ background-color: transparent;
29
+ }
30
+
31
+ /* Firefox */
32
+ &::-moz-progress-bar {
33
+ background-color: var(--progress);
34
+ }
35
+
36
+ &:indeterminate::-moz-progress-bar {
37
+ background-color: transparent;
38
+ }
39
+ }
40
+
41
+ @keyframes progress-loading {
42
+ 50% {
43
+ background-position: left;
44
+ }
45
+ }
@@ -0,0 +1,41 @@
1
+ .switch {
2
+ appearance: none;
3
+ background-color: var(--color-border);
4
+ border-color: transparent;
5
+ border-radius: var(--rounded-full);
6
+ border-width: var(--border-2);
7
+ block-size: var(--size-6);
8
+ cursor: pointer;
9
+ inline-size: var(--size-11);
10
+ transition-duration: var(--time-150);
11
+ transition-property: var(--transition-colors);
12
+ transition-timing-function: var(--ease-in-out);
13
+
14
+ &:checked {
15
+ background-color: var(--color-primary);
16
+ }
17
+
18
+ &:checked::before {
19
+ margin-inline-start: var(--size-5);
20
+ }
21
+
22
+ &::before {
23
+ aspect-ratio: 1;
24
+ background-color: var(--color-text-reversed);
25
+ block-size: var(--size-full);
26
+ border-radius: var(--rounded-full);
27
+ content: "";
28
+ display: block;
29
+ transition: margin var(--time-150) var(--ease-in-out);
30
+ }
31
+
32
+ &:focus-visible {
33
+ outline: var(--border-2) solid var(--color-border-darker);
34
+ outline-offset: var(--border-2);
35
+ }
36
+
37
+ &:disabled {
38
+ cursor: not-allowed;
39
+ opacity: var(--opacity-50);
40
+ }
41
+ }
@@ -0,0 +1,27 @@
1
+ :where(.table) {
2
+ font-size: var(--text-sm);
3
+ inline-size: var(--size-full);
4
+
5
+ thead {
6
+ color: var(--color-text-subtle);
7
+ }
8
+
9
+ tbody tr {
10
+ border-block-start-width: var(--border);
11
+ }
12
+
13
+ th {
14
+ font-weight: var(--font-medium);
15
+ text-align: left;
16
+ }
17
+
18
+ th, td {
19
+ padding: var(--size-4);
20
+ }
21
+
22
+ tfoot {
23
+ background-color: var(--color-secondary);
24
+ border-block-start-width: var(--border);
25
+ font-weight: var(--font-medium);
26
+ }
27
+ }
@@ -0,0 +1,17 @@
1
+ import { Controller } from "@hotwired/stimulus"
2
+
3
+ export default class extends Controller {
4
+ static values = { target: String }
5
+
6
+ close() {
7
+ document.getElementById(this.targetValue).close()
8
+ }
9
+
10
+ show() {
11
+ document.getElementById(this.targetValue).show()
12
+ }
13
+
14
+ showModal() {
15
+ document.getElementById(this.targetValue).showModal()
16
+ }
17
+ }