create-template-html-css 2.0.4 → 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 +436 -0
- package/CODE-SPLITTING-GUIDE.md +274 -0
- package/COMPONENTS-GALLERY.html +143 -8
- package/HTML-VS-REACT.md +289 -0
- package/QUICKSTART-REACT.md +293 -0
- package/REACT-SUPPORT-SUMMARY.md +235 -0
- package/README.md +261 -12
- package/bin/cli.js +100 -759
- package/bin/commands/create.js +288 -0
- package/bin/commands/gallery.js +42 -0
- package/bin/commands/insert.js +123 -0
- package/bin/commands/list.js +73 -0
- package/package.json +10 -3
- package/src/component-choices.js +7 -0
- package/src/components-registry.js +112 -0
- package/src/format-utils.js +49 -0
- package/src/generator.js +83 -594
- package/src/generators/color-schemes.js +78 -0
- package/src/generators/color-utils.js +108 -0
- package/src/generators/component-filters.js +151 -0
- package/src/generators/html-generators.js +180 -0
- package/src/generators/validation.js +43 -0
- package/src/index.js +2 -1
- package/src/inserter.js +55 -233
- package/src/inserters/backup-utils.js +20 -0
- package/src/inserters/component-loader.js +68 -0
- package/src/inserters/html-utils.js +31 -0
- package/src/inserters/indentation-utils.js +90 -0
- package/src/inserters/validation-utils.js +49 -0
- package/src/react-component-choices.js +97 -0
- package/src/react-component-templates.js +182 -0
- package/src/react-file-operations.js +172 -0
- package/src/react-generator.js +219 -0
- package/src/react-templates.js +418 -0
- 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/src/utils/file-utils.js +97 -0
- package/src/utils/path-utils.js +32 -0
- package/src/utils/string-utils.js +51 -0
- package/src/utils/template-loader.js +91 -0
- package/templates/_shared/PATTERNS.md +246 -0
- package/templates/_shared/README.md +74 -0
- package/templates/_shared/base.css +18 -0
- package/templates/blackjack/index.html +1 -1
- package/templates/breakout/index.html +1 -1
- package/templates/connect-four/index.html +1 -1
- package/templates/dice-game/index.html +1 -1
- package/templates/flappy-bird/index.html +1 -1
- package/templates/pong/index.html +1 -1
- package/templates/skeleton/index.html +4 -4
- package/templates/slot-machine/index.html +1 -1
- package/templates/tetris/index.html +1 -1
- package/templates-react/README.md +126 -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.css +88 -0
- package/templates-react/button/Button.example.jsx +40 -0
- package/templates-react/button/Button.jsx +29 -0
- package/templates-react/card/Card.css +86 -0
- package/templates-react/card/Card.example.jsx +49 -0
- package/templates-react/card/Card.jsx +35 -0
- 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.css +99 -0
- package/templates-react/counter/Counter.example.jsx +45 -0
- package/templates-react/counter/Counter.jsx +70 -0
- 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.css +128 -0
- package/templates-react/form/Form.example.jsx +64 -0
- package/templates-react/form/Form.jsx +125 -0
- 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.css +152 -0
- package/templates-react/modal/Modal.example.jsx +90 -0
- package/templates-react/modal/Modal.jsx +46 -0
- 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.css +236 -0
- package/templates-react/todo-list/TodoList.example.jsx +15 -0
- package/templates-react/todo-list/TodoList.jsx +84 -0
- 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,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,88 @@
|
|
|
1
|
+
/* Button Styles */
|
|
2
|
+
.btn {
|
|
3
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
|
|
4
|
+
font-weight: 600;
|
|
5
|
+
border: none;
|
|
6
|
+
border-radius: 8px;
|
|
7
|
+
cursor: pointer;
|
|
8
|
+
transition: all 0.3s ease;
|
|
9
|
+
outline: none;
|
|
10
|
+
display: inline-flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
gap: 8px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/* Size Variations */
|
|
17
|
+
.btn-small {
|
|
18
|
+
padding: 8px 16px;
|
|
19
|
+
font-size: 14px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.btn-medium {
|
|
23
|
+
padding: 12px 24px;
|
|
24
|
+
font-size: 16px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.btn-large {
|
|
28
|
+
padding: 16px 32px;
|
|
29
|
+
font-size: 18px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* Variant Styles - Primary */
|
|
33
|
+
.btn-primary {
|
|
34
|
+
background: linear-gradient(135deg, {{primaryColor}} 0%, {{secondaryColor}} 100%);
|
|
35
|
+
color: white;
|
|
36
|
+
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.btn-primary:hover:not(:disabled) {
|
|
40
|
+
transform: translateY(-2px);
|
|
41
|
+
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.btn-primary:active:not(:disabled) {
|
|
45
|
+
transform: translateY(0);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* Variant Styles - Secondary */
|
|
49
|
+
.btn-secondary {
|
|
50
|
+
background: transparent;
|
|
51
|
+
color: {{primaryColor}};
|
|
52
|
+
border: 2px solid {{primaryColor}};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.btn-secondary:hover:not(:disabled) {
|
|
56
|
+
background: {{primaryColor}};
|
|
57
|
+
color: white;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* Variant Styles - Danger */
|
|
61
|
+
.btn-danger {
|
|
62
|
+
background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
|
|
63
|
+
color: white;
|
|
64
|
+
box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.btn-danger:hover:not(:disabled) {
|
|
68
|
+
transform: translateY(-2px);
|
|
69
|
+
box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* Variant Styles - Success */
|
|
73
|
+
.btn-success {
|
|
74
|
+
background: linear-gradient(135deg, #51cf66 0%, #37b24d 100%);
|
|
75
|
+
color: white;
|
|
76
|
+
box-shadow: 0 4px 15px rgba(81, 207, 102, 0.3);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.btn-success:hover:not(:disabled) {
|
|
80
|
+
transform: translateY(-2px);
|
|
81
|
+
box-shadow: 0 6px 20px rgba(81, 207, 102, 0.4);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* Disabled State */
|
|
85
|
+
.btn:disabled {
|
|
86
|
+
opacity: 0.5;
|
|
87
|
+
cursor: not-allowed;
|
|
88
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
|
|
2
|
+
import Button from './Button';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Example usage of Button component
|
|
6
|
+
*/
|
|
7
|
+
const ButtonExample = () => {
|
|
8
|
+
const handleClick = () => {
|
|
9
|
+
console.log('Button clicked!');
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<div style={{ padding: '40px', display: 'flex', flexDirection: 'column', gap: '20px' }}>
|
|
14
|
+
<h2>Button Component Examples</h2>
|
|
15
|
+
|
|
16
|
+
<div style={{ display: 'flex', gap: '10px', flexWrap: 'wrap' }}>
|
|
17
|
+
<h3 style={{ width: '100%' }}>Variants</h3>
|
|
18
|
+
<Button variant="primary" onClick={handleClick}>Primary Button</Button>
|
|
19
|
+
<Button variant="secondary" onClick={handleClick}>Secondary Button</Button>
|
|
20
|
+
<Button variant="success" onClick={handleClick}>Success Button</Button>
|
|
21
|
+
<Button variant="danger" onClick={handleClick}>Danger Button</Button>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<div style={{ display: 'flex', gap: '10px', flexWrap: 'wrap' }}>
|
|
25
|
+
<h3 style={{ width: '100%' }}>Sizes</h3>
|
|
26
|
+
<Button size="small" onClick={handleClick}>Small</Button>
|
|
27
|
+
<Button size="medium" onClick={handleClick}>Medium</Button>
|
|
28
|
+
<Button size="large" onClick={handleClick}>Large</Button>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<div style={{ display: 'flex', gap: '10px', flexWrap: 'wrap' }}>
|
|
32
|
+
<h3 style={{ width: '100%' }}>States</h3>
|
|
33
|
+
<Button onClick={handleClick}>Enabled</Button>
|
|
34
|
+
<Button disabled>Disabled</Button>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export default ButtonExample;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
|
|
2
|
+
import './Button.css';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Button Component
|
|
6
|
+
* A customizable button component with various styles and states
|
|
7
|
+
*/
|
|
8
|
+
const Button = ({
|
|
9
|
+
children,
|
|
10
|
+
variant = 'primary',
|
|
11
|
+
size = 'medium',
|
|
12
|
+
disabled = false,
|
|
13
|
+
onClick,
|
|
14
|
+
type = 'button',
|
|
15
|
+
className = ''
|
|
16
|
+
}) => {
|
|
17
|
+
return (
|
|
18
|
+
<button
|
|
19
|
+
type={type}
|
|
20
|
+
className={`btn btn-${variant} btn-${size} ${className}`}
|
|
21
|
+
disabled={disabled}
|
|
22
|
+
onClick={onClick}
|
|
23
|
+
>
|
|
24
|
+
{children}
|
|
25
|
+
</button>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default Button;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/* Card Styles */
|
|
2
|
+
.card {
|
|
3
|
+
background: white;
|
|
4
|
+
border-radius: 12px;
|
|
5
|
+
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
transition: all 0.3s ease;
|
|
8
|
+
cursor: pointer;
|
|
9
|
+
max-width: 400px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.card:hover {
|
|
13
|
+
transform: translateY(-5px);
|
|
14
|
+
box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.card-image {
|
|
18
|
+
width: 100%;
|
|
19
|
+
height: 200px;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
position: relative;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.card-image img {
|
|
25
|
+
width: 100%;
|
|
26
|
+
height: 100%;
|
|
27
|
+
object-fit: cover;
|
|
28
|
+
transition: transform 0.3s ease;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.card:hover .card-image img {
|
|
32
|
+
transform: scale(1.05);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.card-content {
|
|
36
|
+
padding: 24px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.card-title {
|
|
40
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
|
|
41
|
+
font-size: 24px;
|
|
42
|
+
font-weight: 700;
|
|
43
|
+
margin: 0 0 12px 0;
|
|
44
|
+
color: #2d3748;
|
|
45
|
+
background: linear-gradient(135deg, {{primaryColor}} 0%, {{secondaryColor}} 100%);
|
|
46
|
+
-webkit-background-clip: text;
|
|
47
|
+
-webkit-text-fill-color: transparent;
|
|
48
|
+
background-clip: text;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.card-description {
|
|
52
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
|
|
53
|
+
font-size: 16px;
|
|
54
|
+
line-height: 1.6;
|
|
55
|
+
color: #4a5568;
|
|
56
|
+
margin: 0;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.card-footer {
|
|
60
|
+
padding: 16px 24px;
|
|
61
|
+
border-top: 1px solid #e2e8f0;
|
|
62
|
+
background: #f7fafc;
|
|
63
|
+
display: flex;
|
|
64
|
+
justify-content: space-between;
|
|
65
|
+
align-items: center;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* Dark Mode Support */
|
|
69
|
+
@media (prefers-color-scheme: dark) {
|
|
70
|
+
.card {
|
|
71
|
+
background: #2d3748;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.card-title {
|
|
75
|
+
color: #e2e8f0;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.card-description {
|
|
79
|
+
color: #cbd5e0;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.card-footer {
|
|
83
|
+
background: #1a202c;
|
|
84
|
+
border-top-color: #4a5568;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
|
|
2
|
+
import Card from './Card';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Example usage of Card component
|
|
6
|
+
*/
|
|
7
|
+
const CardExample = () => {
|
|
8
|
+
const handleCardClick = () => {
|
|
9
|
+
console.log('Card clicked!');
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<div style={{ padding: '40px', display: 'flex', gap: '20px', flexWrap: 'wrap' }}>
|
|
14
|
+
<Card
|
|
15
|
+
title="Beautiful Mountain"
|
|
16
|
+
description="Explore the breathtaking views of mountain landscapes and discover the beauty of nature."
|
|
17
|
+
image="https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=400&h=200&fit=crop"
|
|
18
|
+
imageAlt="Mountain landscape"
|
|
19
|
+
footer={
|
|
20
|
+
<button style={{ padding: '8px 16px', background: '#3182ce', color: 'white', border: 'none', borderRadius: '6px' }}>
|
|
21
|
+
Learn More
|
|
22
|
+
</button>
|
|
23
|
+
}
|
|
24
|
+
onClick={handleCardClick}
|
|
25
|
+
/>
|
|
26
|
+
|
|
27
|
+
<Card
|
|
28
|
+
title="Ocean Sunset"
|
|
29
|
+
description="Watch the sun set over the endless horizon and feel the peaceful ocean breeze."
|
|
30
|
+
image="https://images.unsplash.com/photo-1505142468610-359e7d316be0?w=400&h=200&fit=crop"
|
|
31
|
+
imageAlt="Ocean sunset"
|
|
32
|
+
footer={
|
|
33
|
+
<button style={{ padding: '8px 16px', background: '#3182ce', color: 'white', border: 'none', borderRadius: '6px' }}>
|
|
34
|
+
Learn More
|
|
35
|
+
</button>
|
|
36
|
+
}
|
|
37
|
+
onClick={handleCardClick}
|
|
38
|
+
/>
|
|
39
|
+
|
|
40
|
+
<Card
|
|
41
|
+
title="Card Without Image"
|
|
42
|
+
description="This card demonstrates how the component looks without an image. It still maintains the same elegant design."
|
|
43
|
+
footer={<span style={{ color: '#718096' }}>No image variant</span>}
|
|
44
|
+
/>
|
|
45
|
+
</div>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export default CardExample;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
|
|
2
|
+
import './Card.css';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Card Component
|
|
6
|
+
* A versatile card component for displaying content
|
|
7
|
+
*/
|
|
8
|
+
const Card = ({
|
|
9
|
+
title,
|
|
10
|
+
description,
|
|
11
|
+
image,
|
|
12
|
+
imageAlt = '',
|
|
13
|
+
footer,
|
|
14
|
+
onClick,
|
|
15
|
+
className = '',
|
|
16
|
+
children
|
|
17
|
+
}) => {
|
|
18
|
+
return (
|
|
19
|
+
<div className={`card ${className}`} onClick={onClick}>
|
|
20
|
+
{image && (
|
|
21
|
+
<div className="card-image">
|
|
22
|
+
<img src={image} alt={imageAlt} />
|
|
23
|
+
</div>
|
|
24
|
+
)}
|
|
25
|
+
<div className="card-content">
|
|
26
|
+
{title && <h3 className="card-title">{title}</h3>}
|
|
27
|
+
{description && <p className="card-description">{description}</p>}
|
|
28
|
+
{children}
|
|
29
|
+
</div>
|
|
30
|
+
{footer && <div className="card-footer">{footer}</div>}
|
|
31
|
+
</div>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export default Card;
|
|
@@ -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
|
+
}
|