create-template-html-css 2.1.0 → 2.2.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.
- package/CHANGELOG.md +131 -0
- package/CODE-SPLITTING-GUIDE.md +274 -0
- package/COMPONENTS-GALLERY.html +143 -8
- package/README.md +71 -3
- package/bin/cli.js +2 -0
- package/bin/commands/create.js +16 -0
- package/package.json +1 -1
- package/src/react-component-choices.js +53 -1
- package/src/react-component-templates.js +182 -0
- package/src/react-generator.js +15 -4
- package/src/react-templates.js +192 -124
- package/src/templates/basic-components-templates.js +157 -0
- package/src/templates/form-components-templates.js +194 -0
- package/src/templates/interactive-components-templates.js +139 -0
- package/templates-react/alert/Alert.css +158 -0
- package/templates-react/alert/Alert.example.jsx +106 -0
- package/templates-react/alert/Alert.jsx +61 -0
- package/templates-react/badge/Badge.css +196 -0
- package/templates-react/badge/Badge.example.jsx +182 -0
- package/templates-react/badge/Badge.jsx +44 -0
- package/templates-react/button/Button.example.jsx +1 -1
- package/templates-react/button/Button.jsx +1 -1
- package/templates-react/card/Card.example.jsx +1 -1
- package/templates-react/card/Card.jsx +1 -1
- package/templates-react/checkbox/Checkbox.css +217 -0
- package/templates-react/checkbox/Checkbox.example.jsx +141 -0
- package/templates-react/checkbox/Checkbox.jsx +82 -0
- package/templates-react/counter/Counter.example.jsx +1 -1
- package/templates-react/counter/Counter.jsx +1 -1
- package/templates-react/dropdown/Dropdown.css +237 -0
- package/templates-react/dropdown/Dropdown.example.jsx +98 -0
- package/templates-react/dropdown/Dropdown.jsx +154 -0
- package/templates-react/form/Form.example.jsx +0 -1
- package/templates-react/form/Form.jsx +1 -1
- package/templates-react/input/Input.css +113 -0
- package/templates-react/input/Input.example.jsx +82 -0
- package/templates-react/input/Input.jsx +87 -0
- package/templates-react/modal/Modal.example.jsx +1 -1
- package/templates-react/modal/Modal.jsx +1 -1
- package/templates-react/navbar/Navbar.css +139 -0
- package/templates-react/navbar/Navbar.example.jsx +37 -0
- package/templates-react/navbar/Navbar.jsx +62 -0
- package/templates-react/progress/Progress.css +247 -0
- package/templates-react/progress/Progress.example.jsx +244 -0
- package/templates-react/progress/Progress.jsx +79 -0
- package/templates-react/switch/Switch.css +244 -0
- package/templates-react/switch/Switch.example.jsx +221 -0
- package/templates-react/switch/Switch.jsx +98 -0
- package/templates-react/todo-list/TodoList.example.jsx +1 -1
- package/templates-react/todo-list/TodoList.jsx +1 -1
- package/templates-react/tooltip/Tooltip.css +165 -0
- package/templates-react/tooltip/Tooltip.example.jsx +166 -0
- package/templates-react/tooltip/Tooltip.jsx +176 -0
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
.badge {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
font-weight: 600;
|
|
6
|
+
line-height: 1;
|
|
7
|
+
white-space: nowrap;
|
|
8
|
+
border-radius: 0.25rem;
|
|
9
|
+
transition: all 0.2s ease;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/* Sizes */
|
|
13
|
+
.badge-small {
|
|
14
|
+
padding: 0.125rem 0.375rem;
|
|
15
|
+
font-size: 0.75rem;
|
|
16
|
+
min-width: 1.25rem;
|
|
17
|
+
height: 1.25rem;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.badge-medium {
|
|
21
|
+
padding: 0.25rem 0.5rem;
|
|
22
|
+
font-size: 0.875rem;
|
|
23
|
+
min-width: 1.5rem;
|
|
24
|
+
height: 1.5rem;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.badge-large {
|
|
28
|
+
padding: 0.375rem 0.625rem;
|
|
29
|
+
font-size: 1rem;
|
|
30
|
+
min-width: 2rem;
|
|
31
|
+
height: 2rem;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* Variants */
|
|
35
|
+
.badge-default {
|
|
36
|
+
background-color: #6b7280;
|
|
37
|
+
color: white;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.badge-primary {
|
|
41
|
+
background-color: ##PRIMARY_COLOR##;
|
|
42
|
+
color: white;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.badge-secondary {
|
|
46
|
+
background-color: ##SECONDARY_COLOR##;
|
|
47
|
+
color: white;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.badge-success {
|
|
51
|
+
background-color: #10b981;
|
|
52
|
+
color: white;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.badge-warning {
|
|
56
|
+
background-color: #f59e0b;
|
|
57
|
+
color: white;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.badge-error {
|
|
61
|
+
background-color: #ef4444;
|
|
62
|
+
color: white;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.badge-info {
|
|
66
|
+
background-color: #3b82f6;
|
|
67
|
+
color: white;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* Pill shape */
|
|
71
|
+
.badge-pill {
|
|
72
|
+
border-radius: 9999px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* Dot badge */
|
|
76
|
+
.badge-dot {
|
|
77
|
+
padding: 0;
|
|
78
|
+
min-width: 0.5rem;
|
|
79
|
+
width: 0.5rem;
|
|
80
|
+
height: 0.5rem;
|
|
81
|
+
border-radius: 50%;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.badge-dot.badge-small {
|
|
85
|
+
width: 0.375rem;
|
|
86
|
+
height: 0.375rem;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.badge-dot.badge-large {
|
|
90
|
+
width: 0.625rem;
|
|
91
|
+
height: 0.625rem;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/* Position for dot badges */
|
|
95
|
+
.badge-top-right {
|
|
96
|
+
position: absolute;
|
|
97
|
+
top: 0;
|
|
98
|
+
right: 0;
|
|
99
|
+
transform: translate(50%, -50%);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.badge-top-left {
|
|
103
|
+
position: absolute;
|
|
104
|
+
top: 0;
|
|
105
|
+
left: 0;
|
|
106
|
+
transform: translate(-50%, -50%);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.badge-bottom-right {
|
|
110
|
+
position: absolute;
|
|
111
|
+
bottom: 0;
|
|
112
|
+
right: 0;
|
|
113
|
+
transform: translate(50%, 50%);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.badge-bottom-left {
|
|
117
|
+
position: absolute;
|
|
118
|
+
bottom: 0;
|
|
119
|
+
left: 0;
|
|
120
|
+
transform: translate(-50%, 50%);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/* Outline variants */
|
|
124
|
+
.badge-outline {
|
|
125
|
+
background-color: transparent;
|
|
126
|
+
border: 2px solid currentColor;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.badge-outline.badge-default {
|
|
130
|
+
color: #6b7280;
|
|
131
|
+
border-color: #6b7280;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.badge-outline.badge-primary {
|
|
135
|
+
color: ##PRIMARY_COLOR##;
|
|
136
|
+
border-color: ##PRIMARY_COLOR##;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.badge-outline.badge-secondary {
|
|
140
|
+
color: ##SECONDARY_COLOR##;
|
|
141
|
+
border-color: ##SECONDARY_COLOR##;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.badge-outline.badge-success {
|
|
145
|
+
color: #10b981;
|
|
146
|
+
border-color: #10b981;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.badge-outline.badge-warning {
|
|
150
|
+
color: #f59e0b;
|
|
151
|
+
border-color: #f59e0b;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.badge-outline.badge-error {
|
|
155
|
+
color: #ef4444;
|
|
156
|
+
border-color: #ef4444;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.badge-outline.badge-info {
|
|
160
|
+
color: #3b82f6;
|
|
161
|
+
border-color: #3b82f6;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/* Animation */
|
|
165
|
+
@keyframes pulse {
|
|
166
|
+
0%, 100% {
|
|
167
|
+
opacity: 1;
|
|
168
|
+
}
|
|
169
|
+
50% {
|
|
170
|
+
opacity: 0.5;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.badge-pulse {
|
|
175
|
+
animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/* Dark Mode Support */
|
|
179
|
+
@media (prefers-color-scheme: dark) {
|
|
180
|
+
.badge-default {
|
|
181
|
+
background-color: #9ca3af;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.badge-primary {
|
|
185
|
+
background-color: ##SECONDARY_COLOR##;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.badge-secondary {
|
|
189
|
+
background-color: ##PRIMARY_COLOR##;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.badge-outline.badge-default {
|
|
193
|
+
color: #d1d5db;
|
|
194
|
+
border-color: #d1d5db;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
|
|
2
|
+
import Badge from './Badge';
|
|
3
|
+
|
|
4
|
+
function BadgeExample() {
|
|
5
|
+
return (
|
|
6
|
+
<div style={{ padding: '2rem', maxWidth: '800px', margin: '0 auto' }}>
|
|
7
|
+
<h1>Badge Component Examples</h1>
|
|
8
|
+
|
|
9
|
+
<section style={{ marginBottom: '3rem' }}>
|
|
10
|
+
<h2>Basic Badges</h2>
|
|
11
|
+
<div style={{ display: 'flex', gap: '1rem', flexWrap: 'wrap', alignItems: 'center' }}>
|
|
12
|
+
<Badge>Default</Badge>
|
|
13
|
+
<Badge variant="primary">Primary</Badge>
|
|
14
|
+
<Badge variant="secondary">Secondary</Badge>
|
|
15
|
+
<Badge variant="success">Success</Badge>
|
|
16
|
+
<Badge variant="warning">Warning</Badge>
|
|
17
|
+
<Badge variant="error">Error</Badge>
|
|
18
|
+
<Badge variant="info">Info</Badge>
|
|
19
|
+
</div>
|
|
20
|
+
</section>
|
|
21
|
+
|
|
22
|
+
<section style={{ marginBottom: '3rem' }}>
|
|
23
|
+
<h2>Sizes</h2>
|
|
24
|
+
<div style={{ display: 'flex', gap: '1rem', flexWrap: 'wrap', alignItems: 'center' }}>
|
|
25
|
+
<Badge size="small" variant="primary">Small</Badge>
|
|
26
|
+
<Badge size="medium" variant="primary">Medium</Badge>
|
|
27
|
+
<Badge size="large" variant="primary">Large</Badge>
|
|
28
|
+
</div>
|
|
29
|
+
</section>
|
|
30
|
+
|
|
31
|
+
<section style={{ marginBottom: '3rem' }}>
|
|
32
|
+
<h2>Pill Shape</h2>
|
|
33
|
+
<div style={{ display: 'flex', gap: '1rem', flexWrap: 'wrap', alignItems: 'center' }}>
|
|
34
|
+
<Badge pill variant="success">New</Badge>
|
|
35
|
+
<Badge pill variant="info">Beta</Badge>
|
|
36
|
+
<Badge pill variant="warning">Hot</Badge>
|
|
37
|
+
<Badge pill variant="error">Sale</Badge>
|
|
38
|
+
</div>
|
|
39
|
+
</section>
|
|
40
|
+
|
|
41
|
+
<section style={{ marginBottom: '3rem' }}>
|
|
42
|
+
<h2>Count Badges</h2>
|
|
43
|
+
<div style={{ display: 'flex', gap: '2rem', flexWrap: 'wrap', alignItems: 'center' }}>
|
|
44
|
+
<div style={{ position: 'relative', display: 'inline-block' }}>
|
|
45
|
+
<button style={buttonStyle}>
|
|
46
|
+
Messages
|
|
47
|
+
</button>
|
|
48
|
+
<Badge count={5} variant="error" size="small" />
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<div style={{ position: 'relative', display: 'inline-block' }}>
|
|
52
|
+
<button style={buttonStyle}>
|
|
53
|
+
Notifications
|
|
54
|
+
</button>
|
|
55
|
+
<Badge count={99} variant="primary" size="small" />
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<div style={{ position: 'relative', display: 'inline-block' }}>
|
|
59
|
+
<button style={buttonStyle}>
|
|
60
|
+
Inbox
|
|
61
|
+
</button>
|
|
62
|
+
<Badge count={150} maxCount={99} variant="error" size="small" />
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
<div style={{ position: 'relative', display: 'inline-block' }}>
|
|
66
|
+
<button style={buttonStyle}>
|
|
67
|
+
Updates
|
|
68
|
+
</button>
|
|
69
|
+
<Badge count={0} showZero variant="info" size="small" />
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
</section>
|
|
73
|
+
|
|
74
|
+
<section style={{ marginBottom: '3rem' }}>
|
|
75
|
+
<h2>Dot Badges</h2>
|
|
76
|
+
<div style={{ display: 'flex', gap: '2rem', flexWrap: 'wrap', alignItems: 'center' }}>
|
|
77
|
+
<div style={{ position: 'relative', display: 'inline-block' }}>
|
|
78
|
+
<button style={buttonStyle}>Online</button>
|
|
79
|
+
<Badge dot variant="success" />
|
|
80
|
+
</div>
|
|
81
|
+
|
|
82
|
+
<div style={{ position: 'relative', display: 'inline-block' }}>
|
|
83
|
+
<button style={buttonStyle}>Busy</button>
|
|
84
|
+
<Badge dot variant="error" />
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
<div style={{ position: 'relative', display: 'inline-block' }}>
|
|
88
|
+
<button style={buttonStyle}>Away</button>
|
|
89
|
+
<Badge dot variant="warning" />
|
|
90
|
+
</div>
|
|
91
|
+
|
|
92
|
+
<div style={{ position: 'relative', display: 'inline-block' }}>
|
|
93
|
+
<button style={buttonStyle}>Offline</button>
|
|
94
|
+
<Badge dot variant="default" />
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
</section>
|
|
98
|
+
|
|
99
|
+
<section style={{ marginBottom: '3rem' }}>
|
|
100
|
+
<h2>Dot Positions</h2>
|
|
101
|
+
<div style={{ display: 'flex', gap: '2rem', flexWrap: 'wrap', alignItems: 'center' }}>
|
|
102
|
+
<div style={{ position: 'relative', display: 'inline-block' }}>
|
|
103
|
+
<div style={avatarStyle}>👤</div>
|
|
104
|
+
<Badge dot variant="success" position="top-right" />
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
<div style={{ position: 'relative', display: 'inline-block' }}>
|
|
108
|
+
<div style={avatarStyle}>👤</div>
|
|
109
|
+
<Badge dot variant="error" position="top-left" />
|
|
110
|
+
</div>
|
|
111
|
+
|
|
112
|
+
<div style={{ position: 'relative', display: 'inline-block' }}>
|
|
113
|
+
<div style={avatarStyle}>👤</div>
|
|
114
|
+
<Badge dot variant="warning" position="bottom-right" />
|
|
115
|
+
</div>
|
|
116
|
+
|
|
117
|
+
<div style={{ position: 'relative', display: 'inline-block' }}>
|
|
118
|
+
<div style={avatarStyle}>👤</div>
|
|
119
|
+
<Badge dot variant="info" position="bottom-left" />
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
</section>
|
|
123
|
+
|
|
124
|
+
<section style={{ marginBottom: '3rem' }}>
|
|
125
|
+
<h2>Use Cases</h2>
|
|
126
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '1.5rem' }}>
|
|
127
|
+
<div>
|
|
128
|
+
<h3 style={{ fontSize: '1rem', marginBottom: '0.5rem' }}>Status Labels</h3>
|
|
129
|
+
<div style={{ display: 'flex', gap: '0.5rem', flexWrap: 'wrap' }}>
|
|
130
|
+
<Badge variant="success">Active</Badge>
|
|
131
|
+
<Badge variant="warning">Pending</Badge>
|
|
132
|
+
<Badge variant="error">Inactive</Badge>
|
|
133
|
+
<Badge variant="info">Draft</Badge>
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
|
|
137
|
+
<div>
|
|
138
|
+
<h3 style={{ fontSize: '1rem', marginBottom: '0.5rem' }}>Categories</h3>
|
|
139
|
+
<div style={{ display: 'flex', gap: '0.5rem', flexWrap: 'wrap' }}>
|
|
140
|
+
<Badge pill variant="primary">JavaScript</Badge>
|
|
141
|
+
<Badge pill variant="secondary">React</Badge>
|
|
142
|
+
<Badge pill variant="info">TypeScript</Badge>
|
|
143
|
+
<Badge pill variant="success">Node.js</Badge>
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
|
|
147
|
+
<div>
|
|
148
|
+
<h3 style={{ fontSize: '1rem', marginBottom: '0.5rem' }}>Priority Levels</h3>
|
|
149
|
+
<div style={{ display: 'flex', gap: '0.5rem', flexWrap: 'wrap' }}>
|
|
150
|
+
<Badge variant="error" size="small">High</Badge>
|
|
151
|
+
<Badge variant="warning" size="small">Medium</Badge>
|
|
152
|
+
<Badge variant="success" size="small">Low</Badge>
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
</section>
|
|
157
|
+
</div>
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
const buttonStyle = {
|
|
162
|
+
padding: '0.5rem 1rem',
|
|
163
|
+
backgroundColor: '#3b82f6',
|
|
164
|
+
color: 'white',
|
|
165
|
+
border: 'none',
|
|
166
|
+
borderRadius: '0.375rem',
|
|
167
|
+
cursor: 'pointer',
|
|
168
|
+
fontSize: '0.875rem'
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
const avatarStyle = {
|
|
172
|
+
width: '48px',
|
|
173
|
+
height: '48px',
|
|
174
|
+
borderRadius: '50%',
|
|
175
|
+
backgroundColor: '#e5e7eb',
|
|
176
|
+
display: 'flex',
|
|
177
|
+
alignItems: 'center',
|
|
178
|
+
justifyContent: 'center',
|
|
179
|
+
fontSize: '1.5rem'
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
export default BadgeExample;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
|
|
2
|
+
import './Badge.css';
|
|
3
|
+
|
|
4
|
+
function Badge({
|
|
5
|
+
children,
|
|
6
|
+
variant = 'default',
|
|
7
|
+
size = 'medium',
|
|
8
|
+
dot = false,
|
|
9
|
+
pill = false,
|
|
10
|
+
position = 'top-right',
|
|
11
|
+
count = null,
|
|
12
|
+
maxCount = 99,
|
|
13
|
+
showZero = false,
|
|
14
|
+
className = ''
|
|
15
|
+
}) {
|
|
16
|
+
const getBadgeContent = () => {
|
|
17
|
+
if (dot) return null;
|
|
18
|
+
if (count !== null) {
|
|
19
|
+
if (count === 0 && !showZero) return null;
|
|
20
|
+
if (count > maxCount) return `${maxCount}+`;
|
|
21
|
+
return count;
|
|
22
|
+
}
|
|
23
|
+
return children;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const badgeContent = getBadgeContent();
|
|
27
|
+
const isEmpty = badgeContent === null;
|
|
28
|
+
|
|
29
|
+
if (isEmpty && !dot) return null;
|
|
30
|
+
|
|
31
|
+
const badgeClasses = [
|
|
32
|
+
'badge',
|
|
33
|
+
`badge-${variant}`,
|
|
34
|
+
`badge-${size}`,
|
|
35
|
+
pill ? 'badge-pill' : '',
|
|
36
|
+
dot ? 'badge-dot' : '',
|
|
37
|
+
position ? `badge-${position}` : '',
|
|
38
|
+
className
|
|
39
|
+
].filter(Boolean).join(' ');
|
|
40
|
+
|
|
41
|
+
return <span className={badgeClasses}>{badgeContent}</span>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export default Badge;
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
.checkbox-container {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 0.25rem;
|
|
5
|
+
margin-bottom: 1rem;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.checkbox-wrapper {
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
gap: 0.5rem;
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.checkbox-input-wrapper {
|
|
16
|
+
position: relative;
|
|
17
|
+
display: inline-flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.checkbox-input-wrapper.small {
|
|
23
|
+
width: 1rem;
|
|
24
|
+
height: 1rem;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.checkbox-input-wrapper.medium {
|
|
28
|
+
width: 1.25rem;
|
|
29
|
+
height: 1.25rem;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.checkbox-input-wrapper.large {
|
|
33
|
+
width: 1.5rem;
|
|
34
|
+
height: 1.5rem;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.checkbox-input {
|
|
38
|
+
position: absolute;
|
|
39
|
+
opacity: 0;
|
|
40
|
+
width: 100%;
|
|
41
|
+
height: 100%;
|
|
42
|
+
cursor: pointer;
|
|
43
|
+
z-index: 1;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.checkbox-input:disabled {
|
|
47
|
+
cursor: not-allowed;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.checkbox-custom {
|
|
51
|
+
position: relative;
|
|
52
|
+
width: 100%;
|
|
53
|
+
height: 100%;
|
|
54
|
+
border: 2px solid #d1d5db;
|
|
55
|
+
border-radius: 0.25rem;
|
|
56
|
+
background-color: white;
|
|
57
|
+
transition: all 0.2s ease;
|
|
58
|
+
display: flex;
|
|
59
|
+
align-items: center;
|
|
60
|
+
justify-content: center;
|
|
61
|
+
pointer-events: none;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.checkbox-custom svg {
|
|
65
|
+
width: 70%;
|
|
66
|
+
height: 70%;
|
|
67
|
+
stroke-width: 3;
|
|
68
|
+
opacity: 0;
|
|
69
|
+
transition: opacity 0.15s ease;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.checkbox-input:checked + .checkbox-custom svg,
|
|
73
|
+
.checkbox-custom.indeterminate svg {
|
|
74
|
+
opacity: 1;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.checkbox-input:hover:not(:disabled) + .checkbox-custom {
|
|
78
|
+
border-color: ##PRIMARY_COLOR##;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.checkbox-input:focus + .checkbox-custom {
|
|
82
|
+
outline: 2px solid ##PRIMARY_COLOR##;
|
|
83
|
+
outline-offset: 2px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.checkbox-input:checked + .checkbox-custom,
|
|
87
|
+
.checkbox-custom.indeterminate {
|
|
88
|
+
background-color: ##PRIMARY_COLOR##;
|
|
89
|
+
border-color: ##PRIMARY_COLOR##;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.checkbox-input:checked + .checkbox-custom svg,
|
|
93
|
+
.checkbox-custom.indeterminate svg {
|
|
94
|
+
stroke: white;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.checkbox-input.primary:checked + .checkbox-custom,
|
|
98
|
+
.checkbox-input.primary + .checkbox-custom.indeterminate {
|
|
99
|
+
background-color: ##PRIMARY_COLOR##;
|
|
100
|
+
border-color: ##PRIMARY_COLOR##;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.checkbox-input.secondary:checked + .checkbox-custom,
|
|
104
|
+
.checkbox-input.secondary + .checkbox-custom.indeterminate {
|
|
105
|
+
background-color: ##SECONDARY_COLOR##;
|
|
106
|
+
border-color: ##SECONDARY_COLOR##;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.checkbox-input.success:checked + .checkbox-custom,
|
|
110
|
+
.checkbox-input.success + .checkbox-custom.indeterminate {
|
|
111
|
+
background-color: #10b981;
|
|
112
|
+
border-color: #10b981;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.checkbox-input.error:checked + .checkbox-custom,
|
|
116
|
+
.checkbox-input.error + .checkbox-custom.indeterminate {
|
|
117
|
+
background-color: #ef4444;
|
|
118
|
+
border-color: #ef4444;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.checkbox-input:disabled + .checkbox-custom {
|
|
122
|
+
background-color: #f3f4f6;
|
|
123
|
+
border-color: #d1d5db;
|
|
124
|
+
opacity: 0.6;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.checkbox-input:disabled:checked + .checkbox-custom {
|
|
128
|
+
background-color: #9ca3af;
|
|
129
|
+
border-color: #9ca3af;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.checkbox-label {
|
|
133
|
+
user-select: none;
|
|
134
|
+
cursor: pointer;
|
|
135
|
+
color: #374151;
|
|
136
|
+
font-size: 0.875rem;
|
|
137
|
+
line-height: 1.25rem;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.checkbox-input:disabled ~ .checkbox-label {
|
|
141
|
+
color: #9ca3af;
|
|
142
|
+
cursor: not-allowed;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.checkbox-helper-text {
|
|
146
|
+
font-size: 0.75rem;
|
|
147
|
+
color: #6b7280;
|
|
148
|
+
margin-left: 1.75rem;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.checkbox-error .checkbox-custom {
|
|
152
|
+
border-color: #ef4444;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.checkbox-error-message {
|
|
156
|
+
font-size: 0.75rem;
|
|
157
|
+
color: #ef4444;
|
|
158
|
+
margin-left: 1.75rem;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/* Animation for checkbox check */
|
|
162
|
+
@keyframes checkboxCheck {
|
|
163
|
+
0% {
|
|
164
|
+
transform: scale(0.8);
|
|
165
|
+
opacity: 0;
|
|
166
|
+
}
|
|
167
|
+
50% {
|
|
168
|
+
transform: scale(1.1);
|
|
169
|
+
}
|
|
170
|
+
100% {
|
|
171
|
+
transform: scale(1);
|
|
172
|
+
opacity: 1;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.checkbox-input:checked + .checkbox-custom svg {
|
|
177
|
+
animation: checkboxCheck 0.2s ease;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/* Dark Mode Support */
|
|
181
|
+
@media (prefers-color-scheme: dark) {
|
|
182
|
+
.checkbox-custom {
|
|
183
|
+
background-color: #1f2937;
|
|
184
|
+
border-color: #4b5563;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.checkbox-input:hover:not(:disabled) + .checkbox-custom {
|
|
188
|
+
border-color: ##SECONDARY_COLOR##;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.checkbox-input:focus + .checkbox-custom {
|
|
192
|
+
outline-color: ##SECONDARY_COLOR##;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.checkbox-input:checked + .checkbox-custom,
|
|
196
|
+
.checkbox-custom.indeterminate {
|
|
197
|
+
background-color: ##SECONDARY_COLOR##;
|
|
198
|
+
border-color: ##SECONDARY_COLOR##;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.checkbox-input:disabled + .checkbox-custom {
|
|
202
|
+
background-color: #111827;
|
|
203
|
+
border-color: #374151;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.checkbox-label {
|
|
207
|
+
color: #e5e7eb;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.checkbox-input:disabled ~ .checkbox-label {
|
|
211
|
+
color: #6b7280;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.checkbox-helper-text {
|
|
215
|
+
color: #9ca3af;
|
|
216
|
+
}
|
|
217
|
+
}
|