wilday_ui 0.5.6 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -0
- data/app/assets/builds/wilday_ui/index.js +223 -0
- data/app/assets/builds/wilday_ui/index.js.map +3 -3
- data/app/assets/stylesheets/wilday_ui/components/button/features/clipboard.css +108 -0
- data/app/assets/stylesheets/wilday_ui/components/button/features/confirmation.css +136 -0
- data/app/assets/stylesheets/wilday_ui/components/button/features/gradients.css +109 -0
- data/app/assets/stylesheets/wilday_ui/components/button/features/variants.css +5 -0
- data/app/assets/stylesheets/wilday_ui/components/button/index.css +4 -0
- data/app/assets/stylesheets/wilday_ui/tokens/colors.css +109 -0
- data/app/helpers/wilday_ui/application_helper.rb +1 -0
- data/app/helpers/wilday_ui/components/button_helper.rb +170 -20
- data/app/helpers/wilday_ui/theme_helper.rb +19 -0
- data/app/javascript/wilday_ui/controllers/clipboard_controller.js +76 -0
- data/app/javascript/wilday_ui/controllers/confirmation_controller.js +216 -0
- data/app/javascript/wilday_ui/controllers/index.js +4 -1
- data/app/views/wilday_ui/_button.html.erb +1 -0
- data/lib/wilday_ui/config/theme.rb +6 -6
- data/lib/wilday_ui/version.rb +1 -1
- metadata +9 -2
@@ -0,0 +1,108 @@
|
|
1
|
+
.w-button-feedback {
|
2
|
+
position: absolute;
|
3
|
+
padding: 0.5rem 1rem;
|
4
|
+
background: rgba(0, 0, 0, 0.8);
|
5
|
+
color: white;
|
6
|
+
border-radius: 4px;
|
7
|
+
font-size: 0.875rem;
|
8
|
+
pointer-events: none;
|
9
|
+
opacity: 0;
|
10
|
+
transition: opacity 0.2s ease;
|
11
|
+
z-index: 50;
|
12
|
+
white-space: nowrap;
|
13
|
+
}
|
14
|
+
|
15
|
+
/* Basic positions */
|
16
|
+
.w-button-feedback-top {
|
17
|
+
bottom: 100%;
|
18
|
+
left: 50%;
|
19
|
+
transform: translateX(-50%);
|
20
|
+
margin-bottom: 0.5rem;
|
21
|
+
}
|
22
|
+
|
23
|
+
.w-button-feedback-bottom {
|
24
|
+
top: 100%;
|
25
|
+
left: 50%;
|
26
|
+
transform: translateX(-50%);
|
27
|
+
margin-top: 0.5rem;
|
28
|
+
}
|
29
|
+
|
30
|
+
.w-button-feedback-left {
|
31
|
+
right: 100%;
|
32
|
+
top: 50%;
|
33
|
+
transform: translateY(-50%);
|
34
|
+
margin-right: 0.5rem;
|
35
|
+
}
|
36
|
+
|
37
|
+
.w-button-feedback-right {
|
38
|
+
left: 100%;
|
39
|
+
top: 50%;
|
40
|
+
transform: translateY(-50%);
|
41
|
+
margin-left: 0.5rem;
|
42
|
+
}
|
43
|
+
|
44
|
+
/* Start/End modifiers */
|
45
|
+
.w-button-feedback-top.w-button-feedback-start,
|
46
|
+
.w-button-feedback-bottom.w-button-feedback-start {
|
47
|
+
left: 0;
|
48
|
+
transform: translateX(0);
|
49
|
+
}
|
50
|
+
|
51
|
+
.w-button-feedback-top.w-button-feedback-end,
|
52
|
+
.w-button-feedback-bottom.w-button-feedback-end {
|
53
|
+
left: auto;
|
54
|
+
right: 0;
|
55
|
+
transform: translateX(0);
|
56
|
+
}
|
57
|
+
|
58
|
+
.w-button-feedback-left.w-button-feedback-start,
|
59
|
+
.w-button-feedback-right.w-button-feedback-start {
|
60
|
+
top: 0;
|
61
|
+
transform: translateY(0);
|
62
|
+
}
|
63
|
+
|
64
|
+
.w-button-feedback-left.w-button-feedback-end,
|
65
|
+
.w-button-feedback-right.w-button-feedback-end {
|
66
|
+
top: auto;
|
67
|
+
bottom: 0;
|
68
|
+
transform: translateY(0);
|
69
|
+
}
|
70
|
+
|
71
|
+
/* Show state */
|
72
|
+
.w-button-feedback-show {
|
73
|
+
opacity: 1;
|
74
|
+
}
|
75
|
+
|
76
|
+
/* Optional: Add arrow indicators */
|
77
|
+
.w-button-feedback::before {
|
78
|
+
content: "";
|
79
|
+
position: absolute;
|
80
|
+
width: 8px;
|
81
|
+
height: 8px;
|
82
|
+
background: inherit;
|
83
|
+
transform: rotate(45deg);
|
84
|
+
}
|
85
|
+
|
86
|
+
.w-button-feedback-top::before {
|
87
|
+
bottom: -4px;
|
88
|
+
left: 50%;
|
89
|
+
margin-left: -4px;
|
90
|
+
}
|
91
|
+
|
92
|
+
.w-button-feedback-bottom::before {
|
93
|
+
top: -4px;
|
94
|
+
left: 50%;
|
95
|
+
margin-left: -4px;
|
96
|
+
}
|
97
|
+
|
98
|
+
.w-button-feedback-left::before {
|
99
|
+
right: -4px;
|
100
|
+
top: 50%;
|
101
|
+
margin-top: -4px;
|
102
|
+
}
|
103
|
+
|
104
|
+
.w-button-feedback-right::before {
|
105
|
+
left: -4px;
|
106
|
+
top: 50%;
|
107
|
+
margin-top: -4px;
|
108
|
+
}
|
@@ -0,0 +1,136 @@
|
|
1
|
+
.w-button-confirmation-dialog {
|
2
|
+
padding: 0;
|
3
|
+
border: none;
|
4
|
+
border-radius: 0.5rem;
|
5
|
+
box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
|
6
|
+
max-width: 28rem;
|
7
|
+
width: 90vw;
|
8
|
+
background: var(--w-color-light-50, #ffffff);
|
9
|
+
}
|
10
|
+
|
11
|
+
.w-button-confirmation-dialog::backdrop {
|
12
|
+
background-color: rgb(0 0 0 / 0.4);
|
13
|
+
backdrop-filter: blur(4px);
|
14
|
+
}
|
15
|
+
|
16
|
+
.w-button-confirmation-dialog-content {
|
17
|
+
padding: 1.5rem;
|
18
|
+
}
|
19
|
+
|
20
|
+
.w-button-confirmation-dialog-icon {
|
21
|
+
margin-bottom: 1rem;
|
22
|
+
width: 2.5rem;
|
23
|
+
height: 2.5rem;
|
24
|
+
}
|
25
|
+
|
26
|
+
.w-button-confirmation-dialog-icon svg {
|
27
|
+
width: 100%;
|
28
|
+
height: 100%;
|
29
|
+
}
|
30
|
+
|
31
|
+
.w-button-confirmation-dialog-icon.info {
|
32
|
+
color: var(--w-color-info-500);
|
33
|
+
}
|
34
|
+
|
35
|
+
.w-button-confirmation-dialog-icon.success {
|
36
|
+
color: var(--w-color-success-500);
|
37
|
+
}
|
38
|
+
|
39
|
+
.w-button-confirmation-dialog-icon.warning {
|
40
|
+
color: var(--w-color-warning-500);
|
41
|
+
}
|
42
|
+
|
43
|
+
.w-button-confirmation-dialog-icon.danger {
|
44
|
+
color: var(--w-color-danger-500);
|
45
|
+
}
|
46
|
+
|
47
|
+
.w-button-confirmation-dialog-title {
|
48
|
+
font-size: 1.125rem;
|
49
|
+
font-weight: 600;
|
50
|
+
color: var(--w-color-dark-800, #1f2937); /* Darker text for better contrast */
|
51
|
+
margin-bottom: 0.5rem;
|
52
|
+
}
|
53
|
+
|
54
|
+
.w-button-confirmation-dialog-message {
|
55
|
+
color: var(--w-color-dark-600, #4b5563); /* Adjusted for better readability */
|
56
|
+
margin-bottom: 1.5rem;
|
57
|
+
line-height: 1.5;
|
58
|
+
}
|
59
|
+
|
60
|
+
.w-button-confirmation-dialog-actions {
|
61
|
+
display: flex;
|
62
|
+
justify-content: flex-end;
|
63
|
+
gap: 0.75rem;
|
64
|
+
}
|
65
|
+
|
66
|
+
/* Mobile Responsive Styles */
|
67
|
+
@media (max-width: 640px) {
|
68
|
+
.w-button-confirmation-dialog {
|
69
|
+
width: 95vw; /* Slightly wider on mobile */
|
70
|
+
margin: 1rem;
|
71
|
+
max-height: 90vh; /* Prevent overflow on small screens */
|
72
|
+
overflow-y: auto; /* Allow scrolling if content is too tall */
|
73
|
+
position: fixed;
|
74
|
+
top: 50%;
|
75
|
+
left: 50%;
|
76
|
+
transform: translate(-50%, -50%);
|
77
|
+
margin: 0;
|
78
|
+
}
|
79
|
+
|
80
|
+
.w-button-confirmation-dialog-content {
|
81
|
+
padding: 1rem; /* Slightly smaller padding on mobile */
|
82
|
+
}
|
83
|
+
|
84
|
+
.w-button-confirmation-dialog-actions {
|
85
|
+
flex-direction: column-reverse; /* Stack buttons vertically */
|
86
|
+
gap: 0.5rem; /* Smaller gap between buttons */
|
87
|
+
padding: 1rem; /* Add padding around buttons */
|
88
|
+
}
|
89
|
+
|
90
|
+
.w-button-confirmation-dialog-actions button {
|
91
|
+
width: 100%; /* Full width buttons */
|
92
|
+
margin: 0; /* Remove any margins */
|
93
|
+
}
|
94
|
+
|
95
|
+
.w-button-confirmation-dialog-icon {
|
96
|
+
margin-bottom: 0.75rem; /* Slightly reduced spacing */
|
97
|
+
width: 2rem; /* Slightly smaller icon */
|
98
|
+
height: 2rem;
|
99
|
+
}
|
100
|
+
|
101
|
+
.w-button-confirmation-dialog-title {
|
102
|
+
font-size: 1rem; /* Slightly smaller title */
|
103
|
+
}
|
104
|
+
|
105
|
+
.w-button-confirmation-dialog-message {
|
106
|
+
font-size: 0.875rem; /* Slightly smaller message text */
|
107
|
+
}
|
108
|
+
}
|
109
|
+
|
110
|
+
/* Handle very small screens */
|
111
|
+
@media (max-width: 360px) {
|
112
|
+
.w-button-confirmation-dialog {
|
113
|
+
width: 98vw;
|
114
|
+
margin: 0.5rem;
|
115
|
+
}
|
116
|
+
}
|
117
|
+
|
118
|
+
/* Handle landscape orientation */
|
119
|
+
@media (max-height: 600px) and (orientation: landscape) {
|
120
|
+
.w-button-confirmation-dialog {
|
121
|
+
max-height: 95vh;
|
122
|
+
display: flex;
|
123
|
+
flex-direction: row;
|
124
|
+
}
|
125
|
+
|
126
|
+
.w-button-confirmation-dialog-content {
|
127
|
+
flex: 1;
|
128
|
+
padding: 1rem;
|
129
|
+
}
|
130
|
+
|
131
|
+
.w-button-confirmation-dialog-actions {
|
132
|
+
padding: 1rem;
|
133
|
+
flex-direction: column;
|
134
|
+
justify-content: center;
|
135
|
+
}
|
136
|
+
}
|
@@ -0,0 +1,109 @@
|
|
1
|
+
/* Predefined gradient variations */
|
2
|
+
.w-button-gradient-blue {
|
3
|
+
background: linear-gradient(135deg, #60a5fa, #3b82f6);
|
4
|
+
color: white;
|
5
|
+
}
|
6
|
+
|
7
|
+
.w-button-gradient-blue:hover {
|
8
|
+
background: linear-gradient(135deg, #3b82f6, #2563eb);
|
9
|
+
}
|
10
|
+
|
11
|
+
.w-button-gradient-purple {
|
12
|
+
background: linear-gradient(135deg, #c084fc, #a855f7);
|
13
|
+
color: white;
|
14
|
+
}
|
15
|
+
|
16
|
+
.w-button-gradient-purple:hover {
|
17
|
+
background: linear-gradient(135deg, #a855f7, #9333ea);
|
18
|
+
}
|
19
|
+
|
20
|
+
.w-button-gradient-green {
|
21
|
+
background: linear-gradient(135deg, #4ade80, #22c55e);
|
22
|
+
color: white;
|
23
|
+
}
|
24
|
+
|
25
|
+
.w-button-gradient-green:hover {
|
26
|
+
background: linear-gradient(135deg, #22c55e, #16a34a);
|
27
|
+
}
|
28
|
+
|
29
|
+
.w-button-gradient-sunset {
|
30
|
+
background: linear-gradient(135deg, #f97316, #ef4444);
|
31
|
+
color: white;
|
32
|
+
}
|
33
|
+
|
34
|
+
.w-button-gradient-sunset:hover {
|
35
|
+
background: linear-gradient(135deg, #ef4444, #dc2626);
|
36
|
+
}
|
37
|
+
|
38
|
+
/* New gradients */
|
39
|
+
.w-button-gradient-ocean {
|
40
|
+
background: linear-gradient(135deg, #0ea5e9, #2563eb);
|
41
|
+
color: white;
|
42
|
+
}
|
43
|
+
|
44
|
+
.w-button-gradient-ocean:hover {
|
45
|
+
background: linear-gradient(135deg, #0284c7, #1d4ed8);
|
46
|
+
}
|
47
|
+
|
48
|
+
.w-button-gradient-rose {
|
49
|
+
background: linear-gradient(135deg, #fb7185, #e11d48);
|
50
|
+
color: white;
|
51
|
+
}
|
52
|
+
|
53
|
+
.w-button-gradient-rose:hover {
|
54
|
+
background: linear-gradient(135deg, #f43f5e, #be123c);
|
55
|
+
}
|
56
|
+
|
57
|
+
.w-button-gradient-amber {
|
58
|
+
background: linear-gradient(135deg, #fbbf24, #d97706);
|
59
|
+
color: white;
|
60
|
+
}
|
61
|
+
|
62
|
+
.w-button-gradient-amber:hover {
|
63
|
+
background: linear-gradient(135deg, #f59e0b, #b45309);
|
64
|
+
}
|
65
|
+
|
66
|
+
.w-button-gradient-emerald {
|
67
|
+
background: linear-gradient(135deg, #34d399, #059669);
|
68
|
+
color: white;
|
69
|
+
}
|
70
|
+
|
71
|
+
.w-button-gradient-emerald:hover {
|
72
|
+
background: linear-gradient(135deg, #10b981, #047857);
|
73
|
+
}
|
74
|
+
|
75
|
+
.w-button-gradient-indigo {
|
76
|
+
background: linear-gradient(135deg, #818cf8, #4f46e5);
|
77
|
+
color: white;
|
78
|
+
}
|
79
|
+
|
80
|
+
.w-button-gradient-indigo:hover {
|
81
|
+
background: linear-gradient(135deg, #6366f1, #4338ca);
|
82
|
+
}
|
83
|
+
|
84
|
+
.w-button-gradient-slate {
|
85
|
+
background: linear-gradient(135deg, #64748b, #334155);
|
86
|
+
color: white;
|
87
|
+
}
|
88
|
+
|
89
|
+
.w-button-gradient-slate:hover {
|
90
|
+
background: linear-gradient(135deg, #475569, #1e293b);
|
91
|
+
}
|
92
|
+
|
93
|
+
/* Custom gradient support */
|
94
|
+
.w-button-gradient-custom {
|
95
|
+
transition: all 0.3s ease;
|
96
|
+
color: white;
|
97
|
+
}
|
98
|
+
|
99
|
+
.w-button-gradient-custom:hover {
|
100
|
+
filter: brightness(0.9);
|
101
|
+
transform: translateY(-1px);
|
102
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
103
|
+
}
|
104
|
+
|
105
|
+
.w-button-gradient-custom:active {
|
106
|
+
filter: brightness(0.85);
|
107
|
+
transform: translateY(0);
|
108
|
+
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
|
109
|
+
}
|
@@ -152,6 +152,11 @@ a.w-button.w-button-no-underline:hover {
|
|
152
152
|
color: #000000;
|
153
153
|
}
|
154
154
|
|
155
|
+
/* Override underline for plain buttons */
|
156
|
+
a.w-button-plain.w-button-underline {
|
157
|
+
text-decoration: none;
|
158
|
+
}
|
159
|
+
|
155
160
|
.w-button-plain:focus-visible {
|
156
161
|
outline: 2px solid #1a1a1a;
|
157
162
|
outline-offset: 2px;
|
@@ -7,6 +7,10 @@
|
|
7
7
|
*= require ./features/icons
|
8
8
|
*= require ./features/loading
|
9
9
|
*= require ./features/dropdown
|
10
|
+
*= require ./features/gradients
|
11
|
+
*= require ./features/clipboard
|
12
|
+
*= require ./features/confirmation
|
13
|
+
*= require ../../tokens/colors
|
10
14
|
*/
|
11
15
|
|
12
16
|
/* Your direct CSS code can go here */
|
@@ -0,0 +1,109 @@
|
|
1
|
+
:root {
|
2
|
+
/* Primary Colors */
|
3
|
+
--w-color-primary-50: #e5f0ff;
|
4
|
+
--w-color-primary-100: #cce0ff;
|
5
|
+
--w-color-primary-200: #99c2ff;
|
6
|
+
--w-color-primary-300: #66a3ff;
|
7
|
+
--w-color-primary-400: #3385ff;
|
8
|
+
--w-color-primary-500: #0066ff;
|
9
|
+
--w-color-primary-600: #0052cc;
|
10
|
+
--w-color-primary-700: #003d99;
|
11
|
+
--w-color-primary-800: #002966;
|
12
|
+
--w-color-primary-900: #001433;
|
13
|
+
|
14
|
+
/* Secondary Colors */
|
15
|
+
--w-color-secondary-50: #f8f9fa;
|
16
|
+
--w-color-secondary-100: #e9ecef;
|
17
|
+
--w-color-secondary-200: #dee2e6;
|
18
|
+
--w-color-secondary-300: #ced4da;
|
19
|
+
--w-color-secondary-400: #adb5bd;
|
20
|
+
--w-color-secondary-500: #6c757d;
|
21
|
+
--w-color-secondary-600: #5a6268;
|
22
|
+
--w-color-secondary-700: #495057;
|
23
|
+
--w-color-secondary-800: #343a40;
|
24
|
+
--w-color-secondary-900: #212529;
|
25
|
+
|
26
|
+
/* Success Colors */
|
27
|
+
--w-color-success-50: #ecfdf5;
|
28
|
+
--w-color-success-100: #d1fae5;
|
29
|
+
--w-color-success-200: #a7f3d0;
|
30
|
+
--w-color-success-300: #6ee7b7;
|
31
|
+
--w-color-success-400: #34d399;
|
32
|
+
--w-color-success-500: #10b981;
|
33
|
+
--w-color-success-600: #059669;
|
34
|
+
--w-color-success-700: #047857;
|
35
|
+
--w-color-success-800: #065f46;
|
36
|
+
--w-color-success-900: #064e3b;
|
37
|
+
|
38
|
+
/* Danger Colors */
|
39
|
+
--w-color-danger-50: #fee2e2;
|
40
|
+
--w-color-danger-100: #fecaca;
|
41
|
+
--w-color-danger-200: #fca5a5;
|
42
|
+
--w-color-danger-300: #f87171;
|
43
|
+
--w-color-danger-400: #ef4444;
|
44
|
+
--w-color-danger-500: #dc2626;
|
45
|
+
--w-color-danger-600: #b91c1c;
|
46
|
+
--w-color-danger-700: #991b1b;
|
47
|
+
--w-color-danger-800: #7f1d1d;
|
48
|
+
--w-color-danger-900: #450a0a;
|
49
|
+
|
50
|
+
/* Warning Colors */
|
51
|
+
--w-color-warning-50: #fffbeb;
|
52
|
+
--w-color-warning-100: #fef3c7;
|
53
|
+
--w-color-warning-200: #fde68a;
|
54
|
+
--w-color-warning-300: #fcd34d;
|
55
|
+
--w-color-warning-400: #fbbf24;
|
56
|
+
--w-color-warning-500: #f59e0b;
|
57
|
+
--w-color-warning-600: #d97706;
|
58
|
+
--w-color-warning-700: #b45309;
|
59
|
+
--w-color-warning-800: #92400e;
|
60
|
+
--w-color-warning-900: #78350f;
|
61
|
+
|
62
|
+
/* Info Colors */
|
63
|
+
--w-color-info-50: #eff6ff;
|
64
|
+
--w-color-info-100: #dbeafe;
|
65
|
+
--w-color-info-200: #bfdbfe;
|
66
|
+
--w-color-info-300: #93c5fd;
|
67
|
+
--w-color-info-400: #60a5fa;
|
68
|
+
--w-color-info-500: #3b82f6;
|
69
|
+
--w-color-info-600: #2563eb;
|
70
|
+
--w-color-info-700: #1d4ed8;
|
71
|
+
--w-color-info-800: #1e40af;
|
72
|
+
--w-color-info-900: #1e3a8a;
|
73
|
+
|
74
|
+
/* Light Colors */
|
75
|
+
--w-color-light-50: #ffffff;
|
76
|
+
--w-color-light-100: #f8f9fa;
|
77
|
+
--w-color-light-200: #f1f3f5;
|
78
|
+
--w-color-light-300: #e9ecef;
|
79
|
+
--w-color-light-400: #dee2e6;
|
80
|
+
--w-color-light-500: #ced4da;
|
81
|
+
--w-color-light-600: #adb5bd;
|
82
|
+
--w-color-light-700: #868e96;
|
83
|
+
--w-color-light-800: #495057;
|
84
|
+
--w-color-light-900: #212529;
|
85
|
+
|
86
|
+
/* Dark Colors */
|
87
|
+
--w-color-dark-50: #f9fafb;
|
88
|
+
--w-color-dark-100: #f3f4f6;
|
89
|
+
--w-color-dark-200: #e5e7eb;
|
90
|
+
--w-color-dark-300: #d1d5db;
|
91
|
+
--w-color-dark-400: #1f2937;
|
92
|
+
--w-color-dark-500: #111827;
|
93
|
+
--w-color-dark-600: #0f172a;
|
94
|
+
--w-color-dark-700: #0a0f1a;
|
95
|
+
--w-color-dark-800: #060912;
|
96
|
+
--w-color-dark-900: #030509;
|
97
|
+
|
98
|
+
/* Link Colors */
|
99
|
+
--w-color-link-50: #eff6ff;
|
100
|
+
--w-color-link-100: #dbeafe;
|
101
|
+
--w-color-link-200: #bfdbfe;
|
102
|
+
--w-color-link-300: #93c5fd;
|
103
|
+
--w-color-link-400: #60a5fa;
|
104
|
+
--w-color-link-500: #2563eb;
|
105
|
+
--w-color-link-600: #1d4ed8;
|
106
|
+
--w-color-link-700: #1e40af;
|
107
|
+
--w-color-link-800: #1e3a8a;
|
108
|
+
--w-color-link-900: #1e3a8a;
|
109
|
+
}
|