free-astro-components 0.0.26 → 0.0.28

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/README.md CHANGED
@@ -11,20 +11,28 @@ Explore and utilize a variety of components that can help you build your web pro
11
11
  ### Available Components
12
12
 
13
13
  - **Icons**
14
- - A set of customizable icons for various uses.
14
+ - A set of icons for various uses.
15
15
  - **Buttons**
16
16
  - Stylish and functional buttons for your web applications.
17
17
  - **Controls**
18
- - **Checkbox**: A customizable checkbox component.
19
- - **Radio**: A flexible radio button component.
18
+ - **Checkbox**: A checkbox component.
19
+ - **Radio**: A radio button component.
20
20
  - **Switch**: A toggle switch component for user interactions.
21
+ - **Input**
22
+ - A versatile input component for user text entry.
23
+ - **Textarea**
24
+ - A textarea component for larger text input.
25
+ - **Select**
26
+ - A select dropdown component.
21
27
 
22
28
  ## Getting Started
23
29
 
24
30
  1. **Visit the Website:**
31
+
25
32
  - [Explore the Collection](https://free-astro-components.vercel.app/)
26
33
 
27
34
  2. **Installation:**
35
+
28
36
  - To use these components in your Astro.js project, follow the instructions on the website.
29
37
 
30
38
  3. **Usage:**
@@ -44,4 +52,4 @@ This project is licensed under the MIT License.
44
52
 
45
53
  ## Contact
46
54
 
47
- For any questions or support, please reach out to [dventura017@gmail.com] or open an issue on the [GitHub repository](https://github.com/denv17/free-astro-components.git).
55
+ For any questions or support, please reach out to [dventura017@gmail.com] or open an issue on the [GitHub repository](https://github.com/denv17/free-astro-components.git).
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "A collection of free Astro components",
4
4
  "author": "Denis Ventura",
5
5
  "type": "module",
6
- "version": "0.0.26",
6
+ "version": "0.0.28",
7
7
  "exports": {
8
8
  ".": {
9
9
  "import": {
@@ -25,7 +25,7 @@ const checkboxClasses = [
25
25
  <style>
26
26
  .ac-checkbox-wrapper {
27
27
  align-items: center;
28
- color: rgb(var(--ac-gray-400));
28
+ color: rgb(var(--ac-color-500));
29
29
  cursor: pointer;
30
30
  display: inline-flex;
31
31
  font-family: var(--ac-font-sans);
@@ -75,7 +75,7 @@ const checkboxClasses = [
75
75
  }
76
76
 
77
77
  &:checked + .ac-checkbox-label {
78
- color: rgb(var(--ac-dark));
78
+ color: rgb(var(--ac-color-700));
79
79
  }
80
80
 
81
81
  &:checked:hover + .ac-checkbox-label {
@@ -101,12 +101,12 @@ const inputClasses = ['ac-input', statusClasses, className]
101
101
 
102
102
  .ac-input {
103
103
  appearance: none;
104
- background-color: rgb(var(--ac-white));
104
+ background-color: rgb(var(--ac-color-100));
105
105
  background-image: none;
106
- border-color: rgb(var(--ac-gray-100));
106
+ border-color: rgb(var(--ac-color-200));
107
107
  border-radius: var(--ac-input-border-radius);
108
108
  border-width: var(--ac-border-2);
109
- color: var(--ac-dark);
109
+ color: var(--ac-color-700);
110
110
  font-size: var(--ac-text-base);
111
111
  height: var(--ac-input-height);
112
112
  line-height: var(--ac-leading-normal);
@@ -116,7 +116,7 @@ const inputClasses = ['ac-input', statusClasses, className]
116
116
  width: 100%;
117
117
 
118
118
  &:hover {
119
- border-color: rgb(var(--ac-gray-200));
119
+ border-color: rgb(var(--ac-color-300));
120
120
  }
121
121
 
122
122
  &:focus {
@@ -125,7 +125,7 @@ const inputClasses = ['ac-input', statusClasses, className]
125
125
  }
126
126
 
127
127
  &:disabled {
128
- background-color: rgb(var(--ac-gray-100));
128
+ background-color: rgb(var(--ac-color-200));
129
129
  }
130
130
 
131
131
  &.ac-input--error {
@@ -134,13 +134,13 @@ const inputClasses = ['ac-input', statusClasses, className]
134
134
  }
135
135
 
136
136
  .ac-input-label {
137
- color: rgb(var(--ac-gray-400));
137
+ color: rgb(var(--ac-color-500));
138
138
  font-size: var(--ac-text-sm);
139
139
  }
140
140
 
141
141
  .ac-input-helper-text {
142
142
  align-items: center;
143
- color: rgb(var(--ac-gray-300));
143
+ color: rgb(var(--ac-color-400));
144
144
  display: flex;
145
145
  font-size: var(--ac-text-sm);
146
146
  gap: var(--ac-spacing-1);
@@ -153,7 +153,7 @@ const inputClasses = ['ac-input', statusClasses, className]
153
153
  }
154
154
 
155
155
  .ac-input-icon {
156
- color: rgb(var(--ac-gray-300));
156
+ color: rgb(var(--ac-color-400));
157
157
  height: var(--ac-spacing-6);
158
158
  position: absolute;
159
159
  top: 50%;
@@ -173,7 +173,7 @@ const inputClasses = ['ac-input', statusClasses, className]
173
173
  appearance: none;
174
174
  background-color: transparent;
175
175
  border: none;
176
- color: rgb(var(--ac-gray-300));
176
+ color: rgb(var(--ac-color-400));
177
177
  cursor: pointer;
178
178
  height: var(--ac-spacing-6);
179
179
  padding: 0;
@@ -20,7 +20,7 @@ const radioClasses = ['ac-radio', error ? 'ac-radio--error' : '', className]
20
20
  <style>
21
21
  .ac-radio-wrapper {
22
22
  align-items: center;
23
- color: rgb(var(--ac-gray-400));
23
+ color: rgb(var(--ac-color-500));
24
24
  cursor: pointer;
25
25
  display: inline-flex;
26
26
  font-family: var(--ac-font-sans);
@@ -60,7 +60,7 @@ const radioClasses = ['ac-radio', error ? 'ac-radio--error' : '', className]
60
60
  &:checked {
61
61
  background-color: rgb(var(--ac-primary));
62
62
  border-color: rgb(var(--ac-primary));
63
- box-shadow: inset 0 0 0 4px rgb(var(--ac-white));
63
+ box-shadow: inset 0 0 0 4px rgb(var(--ac-color-100));
64
64
  }
65
65
 
66
66
  &:checked:hover {
@@ -69,7 +69,7 @@ const radioClasses = ['ac-radio', error ? 'ac-radio--error' : '', className]
69
69
  }
70
70
 
71
71
  &:checked + .ac-radio-label {
72
- color: rgb(var(--ac-dark));
72
+ color: rgb(var(--ac-color-700));
73
73
  }
74
74
 
75
75
  &:checked:hover + .ac-radio-label {
@@ -141,12 +141,12 @@ const selectClasses = [
141
141
 
142
142
  .ac-select {
143
143
  appearance: none;
144
- background-color: rgb(var(--ac-white));
144
+ background-color: rgb(var(--ac-color-100));
145
145
  background-image: none;
146
- border-color: rgb(var(--ac-gray-100));
146
+ border-color: rgb(var(--ac-color-200));
147
147
  border-radius: var(--ac-select-border-radius);
148
148
  border-width: var(--ac-border-2);
149
- color: rgb(var(--ac-gray-300));
149
+ color: rgb(var(--ac-color-400));
150
150
  cursor: pointer;
151
151
  font-size: var(--ac-text-base);
152
152
  font-weight: var(--ac-font-normal);
@@ -158,7 +158,7 @@ const selectClasses = [
158
158
  width: 100%;
159
159
 
160
160
  &.is-selected {
161
- color: rgb(var(--ac-dark));
161
+ color: rgb(var(--ac-color-700));
162
162
  }
163
163
 
164
164
  &.is-open,
@@ -167,7 +167,7 @@ const selectClasses = [
167
167
  }
168
168
 
169
169
  &:hover {
170
- border-color: rgb(var(--ac-gray-200));
170
+ border-color: rgb(var(--ac-color-300));
171
171
  }
172
172
 
173
173
  &:focus,
@@ -178,7 +178,7 @@ const selectClasses = [
178
178
  }
179
179
 
180
180
  &:disabled {
181
- background-color: rgb(var(--ac-gray-100));
181
+ background-color: rgb(var(--ac-color-200));
182
182
  }
183
183
 
184
184
  &.ac-select--error,
@@ -188,13 +188,13 @@ const selectClasses = [
188
188
  }
189
189
 
190
190
  .ac-select-label {
191
- color: rgb(var(--ac-gray-400));
191
+ color: rgb(var(--ac-color-500));
192
192
  font-size: var(--ac-text-sm);
193
193
  }
194
194
 
195
195
  .ac-select-helper-text {
196
196
  align-items: center;
197
- color: rgb(var(--ac-gray-300));
197
+ color: rgb(var(--ac-color-400));
198
198
  display: flex;
199
199
  font-size: var(--ac-text-sm);
200
200
  gap: var(--ac-spacing-1);
@@ -207,7 +207,7 @@ const selectClasses = [
207
207
  }
208
208
 
209
209
  .ac-select-icon {
210
- color: rgb(var(--ac-gray-300));
210
+ color: rgb(var(--ac-color-400));
211
211
  position: absolute;
212
212
  right: var(--ac-select-padding);
213
213
  top: 50%;
@@ -228,7 +228,7 @@ const selectClasses = [
228
228
  z-index: 1;
229
229
 
230
230
  > div {
231
- background-color: rgb(var(--ac-white));
231
+ background-color: rgb(var(--ac-color-100));
232
232
  border-radius: var(--ac-select-border-radius);
233
233
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
234
234
  list-style: none;
@@ -240,7 +240,7 @@ const selectClasses = [
240
240
 
241
241
  .ac-select-list {
242
242
  -ms-overflow-style: none;
243
- border-color: rgb(var(--ac-gray-100));
243
+ border-color: rgb(var(--ac-color-200));
244
244
  border-radius: var(--ac-rounded-xl);
245
245
  border-width: var(--ac-border-1);
246
246
  display: flex;
@@ -255,9 +255,9 @@ const selectClasses = [
255
255
 
256
256
  > li > button {
257
257
  align-items: center;
258
- background-color: rgb(var(--ac-white));
258
+ background-color: rgb(var(--ac-color-100));
259
259
  border-radius: var(--ac-rounded-lg);
260
- color: rgb(var(--ac-gray-400));
260
+ color: rgb(var(--ac-color-500));
261
261
  cursor: pointer;
262
262
  display: flex;
263
263
  font-size: var(--ac-text-sm);
@@ -288,7 +288,7 @@ const selectClasses = [
288
288
 
289
289
  &.is-selected {
290
290
  background-color: rgba(var(--ac-primary), 0.1);
291
- color: rgb(var(--ac-dark));
291
+ color: rgb(var(--ac-color-700));
292
292
 
293
293
  > svg {
294
294
  opacity: 1;
@@ -18,7 +18,7 @@ const switchClasses = ['ac-switch', className].filter(Boolean).join(' ')
18
18
  <style>
19
19
  .ac-switch-wrapper {
20
20
  align-items: center;
21
- color: rgb(var(--ac-gray-400));
21
+ color: rgb(var(--ac-color-500));
22
22
  cursor: pointer;
23
23
  display: inline-flex;
24
24
  font-family: var(--ac-font-sans);
@@ -36,7 +36,7 @@ const switchClasses = ['ac-switch', className].filter(Boolean).join(' ')
36
36
 
37
37
  .ac-switch {
38
38
  appearance: none;
39
- background-color: rgb(var(--ac-white));
39
+ background-color: transparent;
40
40
  border-color: rgb(var(--ac-primary));
41
41
  border-radius: var(--ac-rounded-full);
42
42
  border-style: solid;
@@ -72,7 +72,7 @@ const switchClasses = ['ac-switch', className].filter(Boolean).join(' ')
72
72
  }
73
73
 
74
74
  &:checked + .ac-switch-dot:first-of-type + .ac-switch-label {
75
- color: rgb(var(--ac-dark));
75
+ color: rgb(var(--ac-color-700));
76
76
  }
77
77
 
78
78
  &:checked + .ac-switch-dot {
@@ -86,12 +86,12 @@ const inputClasses = ['ac-textarea', statusClasses, className]
86
86
 
87
87
  .ac-textarea {
88
88
  appearance: none;
89
- background-color: rgb(var(--ac-white));
89
+ background-color: rgb(var(--ac-color-100));
90
90
  background-image: none;
91
- border-color: rgb(var(--ac-gray-100));
91
+ border-color: rgb(var(--ac-color-200));
92
92
  border-radius: var(--ac-textarea-border-radius);
93
93
  border-width: var(--ac-border-2);
94
- color: var(--ac-dark);
94
+ color: var(--ac-color-700);
95
95
  font-family: var(--ac-font-sans);
96
96
  font-size: var(--ac-text-base);
97
97
  form-sizing: content;
@@ -102,7 +102,7 @@ const inputClasses = ['ac-textarea', statusClasses, className]
102
102
  width: 100%;
103
103
 
104
104
  &:hover {
105
- border-color: rgb(var(--ac-gray-200));
105
+ border-color: rgb(var(--ac-color-300));
106
106
  }
107
107
 
108
108
  &:focus {
@@ -111,7 +111,7 @@ const inputClasses = ['ac-textarea', statusClasses, className]
111
111
  }
112
112
 
113
113
  &:disabled {
114
- background-color: rgb(var(--ac-gray-100));
114
+ background-color: rgb(var(--ac-color-200));
115
115
  }
116
116
 
117
117
  &.ac-textarea--error {
@@ -120,13 +120,13 @@ const inputClasses = ['ac-textarea', statusClasses, className]
120
120
  }
121
121
 
122
122
  .ac-textarea-label {
123
- color: rgb(var(--ac-gray-400));
123
+ color: rgb(var(--ac-color-500));
124
124
  font-size: var(--ac-text-sm);
125
125
  }
126
126
 
127
127
  .ac-textarea-helper-text {
128
128
  align-items: center;
129
- color: rgb(var(--ac-gray-300));
129
+ color: rgb(var(--ac-color-400));
130
130
  display: flex;
131
131
  font-size: var(--ac-text-sm);
132
132
  gap: var(--ac-spacing-1);
@@ -139,7 +139,7 @@ const inputClasses = ['ac-textarea', statusClasses, className]
139
139
  }
140
140
 
141
141
  .ac-textarea-icon {
142
- color: rgb(var(--ac-gray-300));
142
+ color: rgb(var(--ac-color-400));
143
143
  height: var(--ac-spacing-6);
144
144
  position: absolute;
145
145
  top: var(--ac-textarea-padding-y);
package/src/css/input.css CHANGED
@@ -5,9 +5,9 @@
5
5
  }
6
6
 
7
7
  input::placeholder {
8
- color: rgb(var(--ac-gray-300));
8
+ color: rgb(var(--ac-color-400));
9
9
  }
10
10
 
11
11
  .ac-input-wrapper .ac-input:read-only {
12
- background-color: rgb(var(--ac-gray-100));
12
+ background-color: rgb(var(--ac-color-200));
13
13
  }
package/src/css/main.css CHANGED
@@ -95,6 +95,28 @@
95
95
  --ac-rounded-full: 9999px;
96
96
  }
97
97
 
98
+ .dark,
99
+ [data-theme='dark'] {
100
+ --ac-color-100: var(--ac-dark);
101
+ --ac-color-200: var(--ac-gray-500);
102
+ --ac-color-300: var(--ac-gray-400);
103
+ --ac-color-400: var(--ac-gray-300);
104
+ --ac-color-500: var(--ac-gray-200);
105
+ --ac-color-600: var(--ac-gray-100);
106
+ --ac-color-700: var(--ac-white);
107
+ }
108
+
109
+ .light,
110
+ [data-theme='light'] {
111
+ --ac-color-100: var(--ac-white);
112
+ --ac-color-200: var(--ac-gray-100);
113
+ --ac-color-300: var(--ac-gray-200);
114
+ --ac-color-400: var(--ac-gray-300);
115
+ --ac-color-500: var(--ac-gray-400);
116
+ --ac-color-600: var(--ac-gray-500);
117
+ --ac-color-700: var(--ac-dark);
118
+ }
119
+
98
120
  *,
99
121
  ::before,
100
122
  ::after {
@@ -6,9 +6,9 @@
6
6
  }
7
7
 
8
8
  textarea::placeholder {
9
- color: rgb(var(--ac-gray-300));
9
+ color: rgb(var(--ac-color-400));
10
10
  }
11
11
 
12
12
  .ac-textarea-wrapper .ac-textarea:read-only {
13
- background-color: rgb(var(--ac-gray-100));
13
+ background-color: rgb(var(--ac-color-200));
14
14
  }
@@ -3,13 +3,19 @@ import '../css/main.css'
3
3
 
4
4
  interface Props {
5
5
  title: string
6
+ class?: string
6
7
  }
7
8
 
8
- const { title } = Astro.props
9
+ const { title, class: className = 'dark' } = Astro.props
10
+
11
+ const colorScheme = {
12
+ light: 'light',
13
+ dark: 'dark',
14
+ }[className]
9
15
  ---
10
16
 
11
17
  <!doctype html>
12
- <html lang="en">
18
+ <html lang="en" class={className} style={`color-scheme: ${colorScheme};`}>
13
19
  <head>
14
20
  <meta charset="UTF-8" />
15
21
  <meta name="description" content="Astro description" />
@@ -70,92 +70,74 @@ import Button from '../components/Button.astro'
70
70
  <Button variant="dark" icon="arrow-right" disabled />
71
71
  </div>
72
72
 
73
- <div class="dark-bg">
74
- <p>Secondary buttons</p>
75
- <div>
76
- <Button size="small" icon="arrow-right" label="Primary Button" />
77
- <Button icon="arrow-right" label="Primary Button" />
78
- <Button size="small" icon="arrow-right" />
79
- <Button icon="arrow-right" />
80
- <Button
81
- variant="secondary"
82
- size="small"
83
- icon="arrow-right"
84
- label="Primary Button"
85
- />
86
- <Button
87
- variant="secondary"
88
- icon="arrow-right"
89
- label="Primary Button"
90
- />
91
- <Button variant="secondary" size="small" icon="arrow-right" />
92
- <Button variant="secondary" icon="arrow-right" />
93
- </div>
94
- <div>
95
- <Button
96
- variant="secondary"
97
- size="small"
98
- icon="arrow-right"
99
- label="Primary Button"
100
- disabled
101
- />
102
- <Button
103
- variant="secondary"
104
- icon="arrow-right"
105
- label="Primary Button"
106
- disabled
107
- />
108
- <Button
109
- variant="secondary"
110
- size="small"
111
- icon="arrow-right"
112
- disabled
113
- />
114
- <Button variant="secondary" icon="arrow-right" disabled />
115
- </div>
116
- <p>light buttons</p>
117
- <div>
118
- <Button
119
- variant="light"
120
- size="small"
121
- icon="arrow-right"
122
- label="light Button"
123
- />
124
- <Button variant="light" icon="arrow-right" label="light Button" />
125
- <Button variant="light" size="small" icon="arrow-right" />
126
- <Button variant="light" icon="arrow-right" />
127
- </div>
128
- <div>
129
- <Button
130
- variant="light"
131
- size="small"
132
- icon="arrow-right"
133
- label="light Button"
134
- disabled
135
- />
136
- <Button
137
- variant="light"
138
- icon="arrow-right"
139
- label="light Button"
140
- disabled
141
- />
142
- <Button variant="light" size="small" icon="arrow-right" disabled />
143
- <Button variant="light" icon="arrow-right" disabled />
144
- </div>
73
+ <p>Secondary buttons</p>
74
+ <div>
75
+ <Button size="small" icon="arrow-right" label="Primary Button" />
76
+ <Button icon="arrow-right" label="Primary Button" />
77
+ <Button size="small" icon="arrow-right" />
78
+ <Button icon="arrow-right" />
79
+ <Button
80
+ variant="secondary"
81
+ size="small"
82
+ icon="arrow-right"
83
+ label="Primary Button"
84
+ />
85
+ <Button variant="secondary" icon="arrow-right" label="Primary Button" />
86
+ <Button variant="secondary" size="small" icon="arrow-right" />
87
+ <Button variant="secondary" icon="arrow-right" />
88
+ </div>
89
+ <div>
90
+ <Button
91
+ variant="secondary"
92
+ size="small"
93
+ icon="arrow-right"
94
+ label="Primary Button"
95
+ disabled
96
+ />
97
+ <Button
98
+ variant="secondary"
99
+ icon="arrow-right"
100
+ label="Primary Button"
101
+ disabled
102
+ />
103
+ <Button variant="secondary" size="small" icon="arrow-right" disabled />
104
+ <Button variant="secondary" icon="arrow-right" disabled />
105
+ </div>
106
+ <p>light buttons</p>
107
+ <div>
108
+ <Button
109
+ variant="light"
110
+ size="small"
111
+ icon="arrow-right"
112
+ label="light Button"
113
+ />
114
+ <Button variant="light" icon="arrow-right" label="light Button" />
115
+ <Button variant="light" size="small" icon="arrow-right" />
116
+ <Button variant="light" icon="arrow-right" />
117
+ </div>
118
+ <div>
119
+ <Button
120
+ variant="light"
121
+ size="small"
122
+ icon="arrow-right"
123
+ label="light Button"
124
+ disabled
125
+ />
126
+ <Button
127
+ variant="light"
128
+ icon="arrow-right"
129
+ label="light Button"
130
+ disabled
131
+ />
132
+ <Button variant="light" size="small" icon="arrow-right" disabled />
133
+ <Button variant="light" icon="arrow-right" disabled />
145
134
  </div>
146
135
  </div>
147
136
  </main>
148
137
  </Layout>
149
138
 
150
139
  <style>
151
- /*@import '../css/preflight.css';*/
152
140
  .content {
153
141
  padding: var(--ac-spacing-8);
154
142
  }
155
-
156
- .dark-bg {
157
- background-color: rgb(var(--ac-dark));
158
- color: rgb(var(--ac-white));
159
- padding: var(--ac-spacing-8);
160
- }
161
143
  </style>
@@ -64,8 +64,6 @@ import Switch from '../components/Switch.astro'
64
64
  </Layout>
65
65
 
66
66
  <style>
67
- /*@import '../css/preflight.css';*/
68
-
69
67
  .content {
70
68
  padding: var(--ac-spacing-8);
71
69
  }