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.
Files changed (99) hide show
  1. package/CHANGELOG.md +436 -0
  2. package/CODE-SPLITTING-GUIDE.md +274 -0
  3. package/COMPONENTS-GALLERY.html +143 -8
  4. package/HTML-VS-REACT.md +289 -0
  5. package/QUICKSTART-REACT.md +293 -0
  6. package/REACT-SUPPORT-SUMMARY.md +235 -0
  7. package/README.md +261 -12
  8. package/bin/cli.js +100 -759
  9. package/bin/commands/create.js +288 -0
  10. package/bin/commands/gallery.js +42 -0
  11. package/bin/commands/insert.js +123 -0
  12. package/bin/commands/list.js +73 -0
  13. package/package.json +10 -3
  14. package/src/component-choices.js +7 -0
  15. package/src/components-registry.js +112 -0
  16. package/src/format-utils.js +49 -0
  17. package/src/generator.js +83 -594
  18. package/src/generators/color-schemes.js +78 -0
  19. package/src/generators/color-utils.js +108 -0
  20. package/src/generators/component-filters.js +151 -0
  21. package/src/generators/html-generators.js +180 -0
  22. package/src/generators/validation.js +43 -0
  23. package/src/index.js +2 -1
  24. package/src/inserter.js +55 -233
  25. package/src/inserters/backup-utils.js +20 -0
  26. package/src/inserters/component-loader.js +68 -0
  27. package/src/inserters/html-utils.js +31 -0
  28. package/src/inserters/indentation-utils.js +90 -0
  29. package/src/inserters/validation-utils.js +49 -0
  30. package/src/react-component-choices.js +97 -0
  31. package/src/react-component-templates.js +182 -0
  32. package/src/react-file-operations.js +172 -0
  33. package/src/react-generator.js +219 -0
  34. package/src/react-templates.js +418 -0
  35. package/src/templates/basic-components-templates.js +157 -0
  36. package/src/templates/form-components-templates.js +194 -0
  37. package/src/templates/interactive-components-templates.js +139 -0
  38. package/src/utils/file-utils.js +97 -0
  39. package/src/utils/path-utils.js +32 -0
  40. package/src/utils/string-utils.js +51 -0
  41. package/src/utils/template-loader.js +91 -0
  42. package/templates/_shared/PATTERNS.md +246 -0
  43. package/templates/_shared/README.md +74 -0
  44. package/templates/_shared/base.css +18 -0
  45. package/templates/blackjack/index.html +1 -1
  46. package/templates/breakout/index.html +1 -1
  47. package/templates/connect-four/index.html +1 -1
  48. package/templates/dice-game/index.html +1 -1
  49. package/templates/flappy-bird/index.html +1 -1
  50. package/templates/pong/index.html +1 -1
  51. package/templates/skeleton/index.html +4 -4
  52. package/templates/slot-machine/index.html +1 -1
  53. package/templates/tetris/index.html +1 -1
  54. package/templates-react/README.md +126 -0
  55. package/templates-react/alert/Alert.css +158 -0
  56. package/templates-react/alert/Alert.example.jsx +106 -0
  57. package/templates-react/alert/Alert.jsx +61 -0
  58. package/templates-react/badge/Badge.css +196 -0
  59. package/templates-react/badge/Badge.example.jsx +182 -0
  60. package/templates-react/badge/Badge.jsx +44 -0
  61. package/templates-react/button/Button.css +88 -0
  62. package/templates-react/button/Button.example.jsx +40 -0
  63. package/templates-react/button/Button.jsx +29 -0
  64. package/templates-react/card/Card.css +86 -0
  65. package/templates-react/card/Card.example.jsx +49 -0
  66. package/templates-react/card/Card.jsx +35 -0
  67. package/templates-react/checkbox/Checkbox.css +217 -0
  68. package/templates-react/checkbox/Checkbox.example.jsx +141 -0
  69. package/templates-react/checkbox/Checkbox.jsx +82 -0
  70. package/templates-react/counter/Counter.css +99 -0
  71. package/templates-react/counter/Counter.example.jsx +45 -0
  72. package/templates-react/counter/Counter.jsx +70 -0
  73. package/templates-react/dropdown/Dropdown.css +237 -0
  74. package/templates-react/dropdown/Dropdown.example.jsx +98 -0
  75. package/templates-react/dropdown/Dropdown.jsx +154 -0
  76. package/templates-react/form/Form.css +128 -0
  77. package/templates-react/form/Form.example.jsx +64 -0
  78. package/templates-react/form/Form.jsx +125 -0
  79. package/templates-react/input/Input.css +113 -0
  80. package/templates-react/input/Input.example.jsx +82 -0
  81. package/templates-react/input/Input.jsx +87 -0
  82. package/templates-react/modal/Modal.css +152 -0
  83. package/templates-react/modal/Modal.example.jsx +90 -0
  84. package/templates-react/modal/Modal.jsx +46 -0
  85. package/templates-react/navbar/Navbar.css +139 -0
  86. package/templates-react/navbar/Navbar.example.jsx +37 -0
  87. package/templates-react/navbar/Navbar.jsx +62 -0
  88. package/templates-react/progress/Progress.css +247 -0
  89. package/templates-react/progress/Progress.example.jsx +244 -0
  90. package/templates-react/progress/Progress.jsx +79 -0
  91. package/templates-react/switch/Switch.css +244 -0
  92. package/templates-react/switch/Switch.example.jsx +221 -0
  93. package/templates-react/switch/Switch.jsx +98 -0
  94. package/templates-react/todo-list/TodoList.css +236 -0
  95. package/templates-react/todo-list/TodoList.example.jsx +15 -0
  96. package/templates-react/todo-list/TodoList.jsx +84 -0
  97. package/templates-react/tooltip/Tooltip.css +165 -0
  98. package/templates-react/tooltip/Tooltip.example.jsx +166 -0
  99. package/templates-react/tooltip/Tooltip.jsx +176 -0
@@ -0,0 +1,158 @@
1
+ .alert {
2
+ display: flex;
3
+ align-items: flex-start;
4
+ justify-content: space-between;
5
+ padding: 1rem 1.25rem;
6
+ border-radius: 0.5rem;
7
+ margin-bottom: 1rem;
8
+ border: 1px solid;
9
+ animation: slideIn 0.3s ease;
10
+ }
11
+
12
+ @keyframes slideIn {
13
+ from {
14
+ opacity: 0;
15
+ transform: translateY(-10px);
16
+ }
17
+ to {
18
+ opacity: 1;
19
+ transform: translateY(0);
20
+ }
21
+ }
22
+
23
+ .alert-content {
24
+ display: flex;
25
+ align-items: flex-start;
26
+ flex: 1;
27
+ gap: 0.75rem;
28
+ }
29
+
30
+ .alert-icon {
31
+ font-size: 1.25rem;
32
+ font-weight: bold;
33
+ flex-shrink: 0;
34
+ width: 24px;
35
+ height: 24px;
36
+ display: flex;
37
+ align-items: center;
38
+ justify-content: center;
39
+ }
40
+
41
+ .alert-text {
42
+ flex: 1;
43
+ }
44
+
45
+ .alert-title {
46
+ font-weight: 600;
47
+ font-size: 1rem;
48
+ margin-bottom: 0.25rem;
49
+ }
50
+
51
+ .alert-message {
52
+ font-size: 0.875rem;
53
+ line-height: 1.5;
54
+ }
55
+
56
+ .alert-close {
57
+ background: none;
58
+ border: none;
59
+ font-size: 1.5rem;
60
+ line-height: 1;
61
+ cursor: pointer;
62
+ padding: 0;
63
+ margin-left: 1rem;
64
+ opacity: 0.6;
65
+ transition: opacity 0.2s ease;
66
+ flex-shrink: 0;
67
+ }
68
+
69
+ .alert-close:hover {
70
+ opacity: 1;
71
+ }
72
+
73
+ /* Success Alert */
74
+ .alert-success {
75
+ background: #ecfdf5;
76
+ border-color: #10b981;
77
+ color: #065f46;
78
+ }
79
+
80
+ .alert-success .alert-icon {
81
+ color: #10b981;
82
+ }
83
+
84
+ .alert-success .alert-close {
85
+ color: #065f46;
86
+ }
87
+
88
+ /* Error Alert */
89
+ .alert-error {
90
+ background: #fef2f2;
91
+ border-color: #ef4444;
92
+ color: #991b1b;
93
+ }
94
+
95
+ .alert-error .alert-icon {
96
+ color: #ef4444;
97
+ }
98
+
99
+ .alert-error .alert-close {
100
+ color: #991b1b;
101
+ }
102
+
103
+ /* Warning Alert */
104
+ .alert-warning {
105
+ background: #fffbeb;
106
+ border-color: #f59e0b;
107
+ color: #92400e;
108
+ }
109
+
110
+ .alert-warning .alert-icon {
111
+ color: #f59e0b;
112
+ }
113
+
114
+ .alert-warning .alert-close {
115
+ color: #92400e;
116
+ }
117
+
118
+ /* Info Alert */
119
+ .alert-info {
120
+ background: #eff6ff;
121
+ border-color: ##PRIMARY_COLOR##;
122
+ color: #1e40af;
123
+ }
124
+
125
+ .alert-info .alert-icon {
126
+ color: ##PRIMARY_COLOR##;
127
+ }
128
+
129
+ .alert-info .alert-close {
130
+ color: #1e40af;
131
+ }
132
+
133
+ /* Dark mode support */
134
+ @media (prefers-color-scheme: dark) {
135
+ .alert-success {
136
+ background: #064e3b;
137
+ color: #d1fae5;
138
+ border-color: #059669;
139
+ }
140
+
141
+ .alert-error {
142
+ background: #7f1d1d;
143
+ color: #fecaca;
144
+ border-color: #dc2626;
145
+ }
146
+
147
+ .alert-warning {
148
+ background: #78350f;
149
+ color: #fef3c7;
150
+ border-color: #d97706;
151
+ }
152
+
153
+ .alert-info {
154
+ background: #1e3a8a;
155
+ color: #dbeafe;
156
+ border-color: ##PRIMARY_COLOR##;
157
+ }
158
+ }
@@ -0,0 +1,106 @@
1
+ import { useState } from 'react';
2
+ import Alert from './Alert';
3
+
4
+ function AlertExample() {
5
+ const [alerts, setAlerts] = useState({
6
+ success: true,
7
+ error: true,
8
+ warning: true,
9
+ info: true
10
+ });
11
+
12
+ const handleClose = (type) => {
13
+ set Alerts({ ...alerts, [type]: false });
14
+ };
15
+
16
+ const resetAlerts = () => {
17
+ setAlerts({
18
+ success: true,
19
+ error: true,
20
+ warning: true,
21
+ info: true
22
+ });
23
+ };
24
+
25
+ return (
26
+ <div style={{ maxWidth: '600px', padding: '2rem' }}>
27
+ <h2>Alert Component Examples</h2>
28
+
29
+ <button
30
+ onClick={resetAlerts}
31
+ style={{
32
+ padding: '0.5rem 1rem',
33
+ marginBottom: '1.5rem',
34
+ background: '#667eea',
35
+ color: 'white',
36
+ border: 'none',
37
+ borderRadius: '0.5rem',
38
+ cursor: 'pointer'
39
+ }}
40
+ >
41
+ Reset Alerts
42
+ </button>
43
+
44
+ {/* Success Alert */}
45
+ {alerts.success && (
46
+ <Alert
47
+ type="success"
48
+ title="Success!"
49
+ onClose={() => handleClose('success')}
50
+ >
51
+ Your changes have been saved successfully.
52
+ </Alert>
53
+ )}
54
+
55
+ {/* Error Alert */}
56
+ {alerts.error && (
57
+ <Alert
58
+ type="error"
59
+ title="Error"
60
+ onClose={() => handleClose('error')}
61
+ >
62
+ Something went wrong. Please try again.
63
+ </Alert>
64
+ )}
65
+
66
+ {/* Warning Alert */}
67
+ {alerts.warning && (
68
+ <Alert
69
+ type="warning"
70
+ title="Warning"
71
+ onClose={() => handleClose('warning')}
72
+ >
73
+ This action cannot be undone. Please proceed with caution.
74
+ </Alert>
75
+ )}
76
+
77
+ {/* Info Alert */}
78
+ {alerts.info && (
79
+ <Alert
80
+ type="info"
81
+ title="Information"
82
+ onClose={() => handleClose('info')}
83
+ >
84
+ Check out our new features in the latest update!
85
+ </Alert>
86
+ )}
87
+
88
+ {/* Alert without title */}
89
+ <Alert type="success">
90
+ Quick success message without a title.
91
+ </Alert>
92
+
93
+ {/* Non-dismissible Alert */}
94
+ <Alert type="info" dismissible={false}>
95
+ This alert cannot be closed.
96
+ </Alert>
97
+
98
+ {/* Alert with custom icon */}
99
+ <Alert type="success" icon="🎉" title="Celebration!">
100
+ You've reached a new milestone!
101
+ </Alert>
102
+ </div>
103
+ );
104
+ }
105
+
106
+ export default AlertExample;
@@ -0,0 +1,61 @@
1
+
2
+ import { useState } from 'react';
3
+
4
+ function Alert({
5
+ type = 'info',
6
+ title,
7
+ children,
8
+ onClose,
9
+ dismissible = true,
10
+ icon: customIcon,
11
+ className = ''
12
+ }) {
13
+ const [isVisible, setIsVisible] = useState(true);
14
+
15
+ const icons = {
16
+ success: '✓',
17
+ error: '✕',
18
+ warning: '⚠',
19
+ info: 'ℹ'
20
+ };
21
+
22
+ const handleClose = () => {
23
+ setIsVisible(false);
24
+ if (onClose) {
25
+ onClose();
26
+ }
27
+ };
28
+
29
+ if (!isVisible) {
30
+ return null;
31
+ }
32
+
33
+ const icon = customIcon !== undefined ? customIcon : icons[type];
34
+
35
+ return (
36
+ <div className={`alert alert-${type} ${className}`} role="alert">
37
+ <div className="alert-content">
38
+ {icon && (
39
+ <span className="alert-icon">{icon}</span>
40
+ )}
41
+
42
+ <div className="alert-text">
43
+ {title && <div className="alert-title">{title}</div>}
44
+ {children && <div className="alert-message">{children}</div>}
45
+ </div>
46
+ </div>
47
+
48
+ {dismissible && (
49
+ <button
50
+ className="alert-close"
51
+ onClick={handleClose}
52
+ aria-label="Close alert"
53
+ >
54
+ ×
55
+ </button>
56
+ )}
57
+ </div>
58
+ );
59
+ }
60
+
61
+ export default Alert;
@@ -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;