css-zero 0.0.93 → 0.0.95
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -13
- data/lib/css_zero/version.rb +1 -1
- data/lib/generators/css_zero/add/templates/app/assets/stylesheets/avatar.css +1 -0
- data/lib/generators/css_zero/add/templates/app/assets/stylesheets/button.css +3 -4
- data/lib/generators/css_zero/add/templates/app/assets/stylesheets/carousel.css +11 -3
- data/lib/generators/css_zero/add/templates/app/assets/stylesheets/dialog.css +7 -17
- data/lib/generators/css_zero/add/templates/app/assets/stylesheets/popover.css +3 -3
- data/lib/generators/css_zero/add/templates/app/assets/stylesheets/sheet.css +7 -17
- data/lib/generators/css_zero/add/templates/app/assets/stylesheets/switch.css +3 -3
- data/lib/generators/css_zero/add/templates/app/assets/stylesheets/toggle.css +1 -1
- data/lib/generators/css_zero/add/templates/app/assets/stylesheets/zcombobox.css +4 -4
- data/lib/generators/css_zero/add/templates/app/javascript/controllers/carousel_controller.js +2 -18
- data/lib/generators/css_zero/add/templates/app/javascript/controllers/command_controller.js +2 -2
- data/lib/generators/css_zero/add/templates/app/javascript/controllers/datepicker_controller.js +1 -2
- data/lib/generators/css_zero/add/templates/app/javascript/controllers/dialog_controller.js +4 -0
- data/lib/generators/css_zero/add/templates/app/javascript/controllers/otp_input_controller.js +1 -3
- data/lib/generators/css_zero/add/templates/app/javascript/controllers/popover_controller.js +9 -1
- data/lib/generators/css_zero/add/templates/app/javascript/controllers/revealable_input_controller.js +1 -1
- data/lib/generators/css_zero/add/templates/app/javascript/controllers/tabs_controller.js +1 -1
- data/lib/generators/css_zero/add/templates/app/javascript/controllers/web_share_controller.js +1 -3
- data/lib/generators/css_zero/install/install_generator.rb +1 -1
- data/lib/generators/css_zero/scaffold/templates/_form.html.erb.tt +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz: '
|
3
|
+
metadata.gz: 7c56f270130722e9912c5271b2700f89b19f1debe15c19a2c2394c9bba4d169c
|
4
|
+
data.tar.gz: '0803ceaa8816e61105de7e64b9c31df4063c1b7defde89fffb3162052dd1a5db'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c2d8bf42bb152ae84264e48a190734f9d06d9cc065cb22432c1f0a9c48256d207b06859c6947f820e2c0979443af5e8b71ea0c9746dbd5c9ee08b04ee5ff63f
|
7
|
+
data.tar.gz: 0baceaccc306e73770beb3a8bfaff1f2564ef9a3e7b1688e5060654886883ba235f4fb93a2327b869177139ed86ba7203da07fb72e9195a00df07fb8cc86bb4a
|
data/README.md
CHANGED
@@ -22,29 +22,21 @@ Add the additional components you need. (Optional)
|
|
22
22
|
bin/rails generate css_zero:add --help
|
23
23
|
```
|
24
24
|
|
25
|
-
## Usage
|
26
|
-
|
27
|
-
Check the [CSS files](app/assets/stylesheets) in the repository to see the available variables and utility classes.
|
28
|
-
|
29
25
|
## Components
|
30
26
|
|
31
27
|
[<img src="https://github.com/user-attachments/assets/3a7fbd1e-5cc8-4476-a60c-52bc28efca29">](https://csszero.lazaronixon.com)
|
32
28
|
|
33
|
-
##
|
34
|
-
|
35
|
-
This gem implements custom templates for scaffolds and authentication.
|
29
|
+
## Utility classes and variables
|
36
30
|
|
37
|
-
|
38
|
-
bin/rails generate scaffold contacts name email phone
|
39
|
-
```
|
31
|
+
Check the [CSS files](app/assets/stylesheets) in the repository to see the available variables and utility classes.
|
40
32
|
|
41
33
|
## Icons
|
42
34
|
|
43
|
-
|
35
|
+
If you're looking for high-quality icons, I recommend checking out [Lucide](https://lucide.dev).
|
44
36
|
|
45
|
-
##
|
37
|
+
## Scaffold
|
46
38
|
|
47
|
-
|
39
|
+
This gem implements custom templates for scaffolds and authentication.
|
48
40
|
|
49
41
|
## Development
|
50
42
|
|
data/lib/css_zero/version.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
.btn {
|
2
2
|
--btn-background: var(--color-bg);
|
3
|
+
--hover-color: oklch(from var(--btn-background) calc(l * .95) c h);
|
3
4
|
|
4
5
|
align-items: center;
|
5
6
|
background-color: var(--btn-background);
|
@@ -24,7 +25,7 @@
|
|
24
25
|
}
|
25
26
|
|
26
27
|
&:hover {
|
27
|
-
background-color: var(--btn-hover-color,
|
28
|
+
background-color: var(--btn-hover-color, var(--hover-color));
|
28
29
|
}
|
29
30
|
|
30
31
|
&:focus-visible {
|
@@ -84,9 +85,7 @@
|
|
84
85
|
}
|
85
86
|
|
86
87
|
[aria-busy] .btn--loading:disabled {
|
87
|
-
> * {
|
88
|
-
visibility: hidden;
|
89
|
-
}
|
88
|
+
> * { visibility: hidden; }
|
90
89
|
|
91
90
|
&::after {
|
92
91
|
filter: var(--btn-icon-color, var(--color-filter-text));
|
@@ -6,14 +6,22 @@
|
|
6
6
|
|
7
7
|
.carousel__content {
|
8
8
|
display: flex;
|
9
|
-
gap: var(--size-
|
9
|
+
gap: var(--size-4);
|
10
10
|
inline-size: var(--size-full);
|
11
|
-
overflow: hidden;
|
11
|
+
overflow-x: hidden;
|
12
|
+
scroll-behavior: smooth;
|
12
13
|
scroll-snap-type: x mandatory;
|
14
|
+
|
15
|
+
@supports (-moz-appearance: none) {
|
16
|
+
scroll-behavior: auto;
|
17
|
+
}
|
13
18
|
}
|
14
19
|
|
15
20
|
.carousel__item {
|
16
|
-
|
21
|
+
--items: var(--carousel-items, 1);
|
22
|
+
--items-gap: calc(100% - 1rem * (var(--items) - 1));
|
23
|
+
|
24
|
+
flex: 0 0 calc(var(--items-gap) / var(--items));
|
17
25
|
padding: var(--size-1);
|
18
26
|
scroll-snap-stop: always;
|
19
27
|
scroll-snap-align: start;
|
@@ -12,7 +12,7 @@
|
|
12
12
|
background-color: rgba(0, 0, 0, .8);
|
13
13
|
}
|
14
14
|
|
15
|
-
/*
|
15
|
+
/* Final state of exit animation and setup */
|
16
16
|
opacity: 0;
|
17
17
|
transform: var(--scale-95);
|
18
18
|
transition-behavior: allow-discrete;
|
@@ -26,24 +26,14 @@
|
|
26
26
|
transition-property: display, overlay, opacity;
|
27
27
|
}
|
28
28
|
|
29
|
-
/*
|
30
|
-
&[open] {
|
31
|
-
|
32
|
-
}
|
33
|
-
|
34
|
-
&[open]::backdrop {
|
35
|
-
opacity: 1;
|
36
|
-
}
|
29
|
+
/* Final state of entry animation */
|
30
|
+
&[open] { opacity: 1; transform: var(--scale-100); }
|
31
|
+
&[open]::backdrop { opacity: 1; }
|
37
32
|
|
38
|
-
/*
|
33
|
+
/* Initial state of entry animation */
|
39
34
|
@starting-style {
|
40
|
-
&[open] {
|
41
|
-
|
42
|
-
}
|
43
|
-
|
44
|
-
&[open]::backdrop {
|
45
|
-
opacity: 0;
|
46
|
-
}
|
35
|
+
&[open] { opacity: 0; transform: var(--scale-95); }
|
36
|
+
&[open]::backdrop { opacity: 0; }
|
47
37
|
}
|
48
38
|
|
49
39
|
/* Drawer component on mobile */
|
@@ -6,19 +6,19 @@
|
|
6
6
|
color: var(--color-text);
|
7
7
|
inline-size: var(--popover-size, max-content);
|
8
8
|
|
9
|
-
/*
|
9
|
+
/* Final state of exit animation and setup */
|
10
10
|
opacity: 0;
|
11
11
|
transform: var(--scale-95);
|
12
12
|
transition-behavior: allow-discrete;
|
13
13
|
transition-duration: var(--time-150);
|
14
14
|
transition-property: display, overlay, opacity, transform;
|
15
15
|
|
16
|
-
/*
|
16
|
+
/* Final state of entry animation */
|
17
17
|
&:popover-open {
|
18
18
|
opacity: 1; transform: var(--scale-100);
|
19
19
|
}
|
20
20
|
|
21
|
-
/*
|
21
|
+
/* Initial state of entry animation */
|
22
22
|
@starting-style {
|
23
23
|
&:popover-open {
|
24
24
|
opacity: 0; transform: var(--scale-95);
|
@@ -12,7 +12,7 @@
|
|
12
12
|
background-color: rgba(0, 0, 0, .8);
|
13
13
|
}
|
14
14
|
|
15
|
-
/*
|
15
|
+
/* Final state of exit animation and setup */
|
16
16
|
transform: var(--sheet-transform);
|
17
17
|
transition-behavior: allow-discrete;
|
18
18
|
transition-duration: var(--time-500);
|
@@ -25,24 +25,14 @@
|
|
25
25
|
transition-property: display, overlay, opacity;
|
26
26
|
}
|
27
27
|
|
28
|
-
/*
|
29
|
-
&[open] {
|
30
|
-
|
31
|
-
}
|
32
|
-
|
33
|
-
&[open]::backdrop {
|
34
|
-
opacity: 1;
|
35
|
-
}
|
28
|
+
/* Final state of entry animation */
|
29
|
+
&[open] { transform: translateX(0); }
|
30
|
+
&[open]::backdrop { opacity: 1; }
|
36
31
|
|
37
|
-
/*
|
32
|
+
/* Initial state of entry animation */
|
38
33
|
@starting-style {
|
39
|
-
&[open] {
|
40
|
-
|
41
|
-
}
|
42
|
-
|
43
|
-
&[open]::backdrop {
|
44
|
-
opacity: 0;
|
45
|
-
}
|
34
|
+
&[open] { transform: var(--sheet-transform); }
|
35
|
+
&[open]::backdrop { opacity: 0;}
|
46
36
|
}
|
47
37
|
|
48
38
|
@media (width >= 40rem) {
|
@@ -4,9 +4,9 @@
|
|
4
4
|
border-color: transparent;
|
5
5
|
border-radius: var(--rounded-full);
|
6
6
|
border-width: var(--border-2);
|
7
|
-
block-size: var(--size-
|
7
|
+
block-size: var(--size-5);
|
8
8
|
cursor: pointer;
|
9
|
-
inline-size: var(--size-
|
9
|
+
inline-size: var(--size-9);
|
10
10
|
transition-duration: var(--time-150);
|
11
11
|
transition-property: var(--transition-colors);
|
12
12
|
|
@@ -15,7 +15,7 @@
|
|
15
15
|
}
|
16
16
|
|
17
17
|
&:checked::before {
|
18
|
-
margin-inline-start: var(--size-
|
18
|
+
margin-inline-start: var(--size-4);
|
19
19
|
}
|
20
20
|
|
21
21
|
&::before {
|
@@ -25,19 +25,19 @@
|
|
25
25
|
font-size: var(--text-sm);
|
26
26
|
line-height: inherit;
|
27
27
|
|
28
|
-
/*
|
28
|
+
/* Final state of exit animation and setup */
|
29
29
|
opacity: 0;
|
30
30
|
transform: var(--scale-95);
|
31
31
|
transition-behavior: allow-discrete;
|
32
32
|
transition-duration: var(--time-150);
|
33
33
|
transition-property: display, opacity, transform;
|
34
34
|
|
35
|
-
/*
|
35
|
+
/* Final state of entry animation */
|
36
36
|
.dropdown-active & {
|
37
37
|
opacity: 1; transform: var(--scale-100);
|
38
38
|
}
|
39
39
|
|
40
|
-
/*
|
40
|
+
/* Initial state of entry animation */
|
41
41
|
@starting-style {
|
42
42
|
.dropdown-active & {
|
43
43
|
opacity: 0; transform: var(--scale-95);
|
@@ -119,6 +119,6 @@
|
|
119
119
|
border-color: var(--color-negative);
|
120
120
|
}
|
121
121
|
|
122
|
-
[data-controller
|
122
|
+
[data-controller~="combobox"] {
|
123
123
|
clip: rect(0 0 0 0); position: absolute;
|
124
124
|
}
|
data/lib/generators/css_zero/add/templates/app/javascript/controllers/carousel_controller.js
CHANGED
@@ -4,26 +4,10 @@ export default class extends Controller {
|
|
4
4
|
static targets = [ "content" ]
|
5
5
|
|
6
6
|
next() {
|
7
|
-
this.contentTarget.
|
7
|
+
this.contentTarget.scrollBy(100, 0)
|
8
8
|
}
|
9
9
|
|
10
10
|
prev() {
|
11
|
-
this.contentTarget.
|
12
|
-
}
|
13
|
-
|
14
|
-
get #nextPosition() {
|
15
|
-
return this.#scrollLeft + this.#slideSize
|
16
|
-
}
|
17
|
-
|
18
|
-
get #prevPosition() {
|
19
|
-
return this.#scrollLeft - this.#slideSize
|
20
|
-
}
|
21
|
-
|
22
|
-
get #scrollLeft() {
|
23
|
-
return this.contentTarget.scrollLeft
|
24
|
-
}
|
25
|
-
|
26
|
-
get #slideSize() {
|
27
|
-
return this.contentTarget.clientWidth
|
11
|
+
this.contentTarget.scrollBy(-100, 0)
|
28
12
|
}
|
29
13
|
}
|
@@ -38,13 +38,13 @@ export default class extends Controller {
|
|
38
38
|
}
|
39
39
|
|
40
40
|
#reset() {
|
41
|
-
this.listTarget.querySelectorAll(`.${this.selectedClass}`).forEach(
|
41
|
+
this.listTarget.querySelectorAll(`.${this.selectedClass}`).forEach(element => {
|
42
42
|
element.classList.remove(this.selectedClass)
|
43
43
|
})
|
44
44
|
}
|
45
45
|
|
46
46
|
#selectMatches(value) {
|
47
|
-
this.listTarget.querySelectorAll(`[data-value*="${value.toLowerCase()}"]`).forEach(
|
47
|
+
this.listTarget.querySelectorAll(`[data-value*="${value.toLowerCase()}"]`).forEach(element => {
|
48
48
|
element.classList.add(this.selectedClass)
|
49
49
|
})
|
50
50
|
}
|
data/lib/generators/css_zero/add/templates/app/javascript/controllers/datepicker_controller.js
CHANGED
@@ -4,8 +4,7 @@ import flatpickr from "https://esm.sh/flatpickr@4.6.13?standalone"
|
|
4
4
|
export default class extends Controller {
|
5
5
|
static targets = [ "details" ]
|
6
6
|
static values = {
|
7
|
-
type: String,
|
8
|
-
disable: Array,
|
7
|
+
type: String, disable: Array,
|
9
8
|
mode: { type: String, default: "single" },
|
10
9
|
dateFormat: { type: String, default: "F d, Y" },
|
11
10
|
dateTimeFormat: { type: String, default: "F d, Y H:i" }
|
@@ -24,13 +24,21 @@ export default class extends Controller {
|
|
24
24
|
}
|
25
25
|
|
26
26
|
hide() {
|
27
|
-
|
27
|
+
this.menuTarget.hidePopover()
|
28
|
+
}
|
29
|
+
|
30
|
+
toggle() {
|
31
|
+
this.menuTarget.togglePopover()
|
28
32
|
}
|
29
33
|
|
30
34
|
showLater() {
|
31
35
|
this.#showTimer = setTimeout(() => this.show(), 700)
|
32
36
|
}
|
33
37
|
|
38
|
+
hideClear() {
|
39
|
+
clearTimeout(this.#showTimer); this.hide();
|
40
|
+
}
|
41
|
+
|
34
42
|
orient() {
|
35
43
|
computePosition(this.buttonTarget, this.menuTarget, this.#options).then(({x, y}) => {
|
36
44
|
this.menuTarget.style.insetInlineStart = `${x}px`
|
@@ -29,7 +29,7 @@ export default class extends Controller {
|
|
29
29
|
}
|
30
30
|
}
|
31
31
|
|
32
|
-
#showCurrentTab(
|
32
|
+
#showCurrentTab() {
|
33
33
|
this.buttonTargets.forEach((element, index) => {
|
34
34
|
element.ariaSelected = index === this.indexValue
|
35
35
|
element.tabIndex = index === this.indexValue ? 0 : -1
|
@@ -12,13 +12,13 @@
|
|
12
12
|
<%% end %>
|
13
13
|
|
14
14
|
<% attributes.each do |attribute| -%>
|
15
|
-
<div class="flex flex-col gap-half mbe-4">
|
15
|
+
<div class="flex flex-col items-start gap-half mbe-4">
|
16
16
|
<% if attribute.password_digest? -%>
|
17
17
|
<%%= form.label :password, class: "text-sm font-medium leading-none" %>
|
18
18
|
<%%= form.password_field :password, class: "input" %>
|
19
19
|
</div>
|
20
20
|
|
21
|
-
<div class="flex flex-col gap-half mbe-4">
|
21
|
+
<div class="flex flex-col items-start gap-half mbe-4">
|
22
22
|
<%%= form.label :password_confirmation, class: "text-sm font-medium leading-none" %>
|
23
23
|
<%%= form.password_field :password_confirmation, class: "input" %>
|
24
24
|
<% elsif attribute.attachments? -%>
|
@@ -29,7 +29,7 @@
|
|
29
29
|
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, rows: "auto", class: "input" %>
|
30
30
|
<% elsif attribute.field_type == :checkbox -%>
|
31
31
|
<%%= form.label :<%= attribute.column_name %>, class: "text-sm font-medium leading-none" %>
|
32
|
-
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, class: "
|
32
|
+
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, class: "checkbox" %>
|
33
33
|
<% else -%>
|
34
34
|
<%%= form.label :<%= attribute.column_name %>, class: "text-sm font-medium leading-none" %>
|
35
35
|
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, class: "input" %>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: css-zero
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.95
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lázaro Nixon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-01-
|
11
|
+
date: 2025-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: lazaronixon@hotmail.com
|