fulldev-ui 0.2.13 → 0.3.0-beta.1

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 (102) hide show
  1. package/.astro/settings.json +5 -0
  2. package/.astro/types.d.ts +3 -12
  3. package/.env +1 -0
  4. package/astro.config.mjs +1 -2
  5. package/package.json +4 -7
  6. package/src/_archive/Childmorphic.ts +8 -0
  7. package/src/_archive/getAllCollections.ts +10 -0
  8. package/src/_archive/getCollectionCascade.ts +33 -0
  9. package/src/_archive/getPathname.ts +18 -0
  10. package/src/_archive/staticPageSchema.ts +124 -0
  11. package/src/_archive/transform/transform.ts +25 -0
  12. package/src/_archive/transform/transformCasing.ts +24 -0
  13. package/src/_archive/transform/transformReferences.ts +54 -0
  14. package/src/_archive/transform/transformSelfs.ts +20 -0
  15. package/src/_archive/transform/transformUnderscores.ts +19 -0
  16. package/src/components/_Block.astro +2 -0
  17. package/src/components/{_Tag.astro → _Component.astro} +18 -9
  18. package/src/components/{segment → _archive}/Body.astro +7 -5
  19. package/src/components/{segment → _archive}/Main.astro +4 -4
  20. package/src/components/{segment → _archive}/Nav.astro +4 -4
  21. package/src/components/{structure → _archive}/Row.astro +4 -4
  22. package/src/components/_todo/Footer.astro +66 -0
  23. package/src/components/{segment → _todo}/Form.astro +6 -6
  24. package/src/components/{segment → _todo}/Prose.astro +10 -10
  25. package/src/components/{segment → _todo}/Writeup.astro +4 -4
  26. package/src/components/{segment → _todo}/todo.md +3 -1
  27. package/src/components/base/Badge.astro +6 -6
  28. package/src/components/base/Button.astro +37 -28
  29. package/src/components/base/Checkbox.astro +3 -4
  30. package/src/components/base/Icon.astro +5 -5
  31. package/src/components/base/Image.astro +19 -52
  32. package/src/components/base/Input.astro +12 -7
  33. package/src/components/base/Logo.astro +4 -4
  34. package/src/components/base/Radio.astro +3 -4
  35. package/src/components/base/Rating.astro +5 -5
  36. package/src/components/base/Select.astro +6 -6
  37. package/src/components/base/SelectOption.astro +1 -1
  38. package/src/components/base/Switch.astro +8 -7
  39. package/src/components/base/Textarea.astro +4 -3
  40. package/src/components/segment/Box.astro +41 -0
  41. package/src/components/segment/Card.astro +21 -35
  42. package/src/components/segment/Deck.astro +20 -16
  43. package/src/components/{structure → segment}/Group.astro +8 -7
  44. package/src/components/segment/Header.astro +18 -7
  45. package/src/components/segment/Section.astro +39 -37
  46. package/src/components/typography/Heading.astro +24 -26
  47. package/src/components/typography/Label.astro +17 -11
  48. package/src/components/typography/Link.astro +5 -5
  49. package/src/components/typography/List.astro +9 -6
  50. package/src/components/typography/ListItem.astro +5 -5
  51. package/src/components/typography/Paragraph.astro +17 -11
  52. package/src/components/typography/Tagline.astro +6 -5
  53. package/src/components/typography/Text.astro +40 -0
  54. package/src/{layouts → components/utility}/Layout.astro +6 -6
  55. package/src/content/config.ts +14 -0
  56. package/src/content/pages/index.md +1 -0
  57. package/src/css/color.css +88 -0
  58. package/src/css/props/align.scss +20 -0
  59. package/src/css/props/frame.scss +153 -0
  60. package/src/css/props/mask +1 -0
  61. package/src/css/props/position.scss +33 -0
  62. package/src/css/props/ratio +1 -0
  63. package/src/css/props/structure.scss +228 -0
  64. package/src/css/props/variant.scss +130 -0
  65. package/src/css/radix.css +281 -0
  66. package/src/css/size.css +334 -0
  67. package/src/css/styles.css +2 -2
  68. package/src/index.ts +13 -34
  69. package/src/integration/integration.ts +45 -0
  70. package/src/schemas/collection.ts +87 -0
  71. package/src/blocks/todo.md +0 -12
  72. package/src/components/_Plural.astro +0 -27
  73. package/src/components/base/Buttons.astro +0 -15
  74. package/src/components/base/Images.astro +0 -15
  75. package/src/components/segment/Footer.astro +0 -14
  76. package/src/components/structure/Bento.astro +0 -35
  77. package/src/components/structure/Carousel.astro +0 -43
  78. package/src/components/structure/Grid.astro +0 -30
  79. package/src/components/structure/Masonry.astro +0 -39
  80. package/src/components/structure/Split.astro +0 -41
  81. package/src/components/structure/Spread.astro +0 -48
  82. package/src/components/structure/Stack.astro +0 -90
  83. package/src/components/structure/todo.md +0 -5
  84. package/src/css/colors.css +0 -197
  85. package/src/css/main.css +0 -3
  86. package/src/css/sizes.css +0 -217
  87. package/src/layouts/todo.md +0 -2
  88. package/src/schemas/attributesSchema.ts +0 -125
  89. package/src/schemas/htmlAttributesSchema.ts +0 -126
  90. package/src/schemas/pageSchema.ts +0 -185
  91. package/src/schemas/staticPageSchema.ts +0 -124
  92. package/src/types/Childmorphic.ts +0 -8
  93. package/src/types/Pluralmorphic.ts +0 -7
  94. package/src/types/Structuremorphic.ts +0 -18
  95. package/src/utils/getAllCollections.ts +0 -10
  96. package/src/utils/getCollectionCascade.ts +0 -33
  97. package/src/utils/getPathname.ts +0 -18
  98. package/src/utils/transform/transform.ts +0 -25
  99. package/src/utils/transform/transformCasing.ts +0 -24
  100. package/src/utils/transform/transformReferences.ts +0 -54
  101. package/src/utils/transform/transformSelfs.ts +0 -20
  102. package/src/utils/transform/transformUnderscores.ts +0 -19
@@ -0,0 +1,334 @@
1
+ :root {
2
+ --space-sm-1: 3px;
3
+ --space-sm-2: 6px;
4
+ --space-sm-3: 12px;
5
+ --space-sm-4: 24px;
6
+ --space-sm-5: 48px;
7
+ --space-sm-6: 72px;
8
+ --space-md-1: 4px;
9
+ --space-md-2: 8px;
10
+ --space-md-3: 16px;
11
+ --space-md-4: 32px;
12
+ --space-md-5: 64px;
13
+ --space-md-6: 96px;
14
+ --space-lg-1: 5px;
15
+ --space-lg-2: 10px;
16
+ --space-lg-3: 20px;
17
+ --space-lg-4: 40px;
18
+ --space-lg-5: 80px;
19
+ --space-lg-6: 120px;
20
+
21
+ --element-sm-1: 6px;
22
+ --element-sm-2: 9px;
23
+ --element-sm-3: 12px;
24
+ --element-md-1: 8px;
25
+ --element-md-2: 12px;
26
+ --element-md-3: 16px;
27
+ --element-lg-1: 10px;
28
+ --element-lg-2: 16px;
29
+ --element-lg-3: 20px;
30
+
31
+ --text-label-sm: 12px;
32
+ --text-label-md: 14px;
33
+ --text-label-lg: 16px;
34
+
35
+ --text-body-xs: 12px;
36
+ --text-body-sm: 14px;
37
+ --text-body-md: 16px;
38
+ --text-body-lg: 18px;
39
+ --text-body-xl: 20px;
40
+
41
+ --text-heading-xs: 16px;
42
+ --text-heading-sm: 18px;
43
+ --text-heading-md: 20px;
44
+ --text-heading-lg: 24px;
45
+ --text-heading-xl: 30px;
46
+ --text-heading-2xl: 36px;
47
+ --text-heading-3xl: 48px;
48
+ --text-heading-4xl: 48px;
49
+ --text-heading-5xl: 60px;
50
+
51
+ @media (min-width: 768px) {
52
+ --text-heading-xs: 16px;
53
+ --text-heading-sm: 20px;
54
+ --text-heading-md: 24px;
55
+ --text-heading-lg: 30px;
56
+ --text-heading-xl: 36px;
57
+ --text-heading-2xl: 48px;
58
+ --text-heading-3xl: 60px;
59
+ --text-heading-4xl: 72px;
60
+ --text-heading-5xl: 96px;
61
+ }
62
+ }
63
+
64
+ .compact {
65
+ --space-sm-1: 3px;
66
+ --space-sm-2: 6px;
67
+ --space-sm-3: 9px;
68
+ --space-sm-4: 12px;
69
+ --space-sm-5: 15px;
70
+ --space-sm-6: 18px;
71
+ --space-md-1: 4px;
72
+ --space-md-2: 8px;
73
+ --space-md-3: 12px;
74
+ --space-md-4: 16px;
75
+ --space-md-5: 20px;
76
+ --space-md-6: 24px;
77
+ --space-lg-1: 5px;
78
+ --space-lg-2: 10px;
79
+ --space-lg-3: 15px;
80
+ --space-lg-4: 20px;
81
+ --space-lg-5: 25px;
82
+ --space-lg-6: 30px;
83
+
84
+ --element-sm-1: 6px;
85
+ --element-sm-2: 8px;
86
+ --element-sm-3: 10px;
87
+ --element-md-1: 8px;
88
+ --element-md-2: 10px;
89
+ --element-md-3: 12px;
90
+ --element-lg-1: 10px;
91
+ --element-lg-2: 12px;
92
+ --element-lg-3: 14px;
93
+
94
+ --text-heading-xs: 16px;
95
+ --text-heading-sm: 18px;
96
+ --text-heading-md: 20px;
97
+ --text-heading-lg: 24px;
98
+ --text-heading-xl: 30px;
99
+ --text-heading-2xl: 30px;
100
+ --text-heading-3xl: 30px;
101
+ --text-heading-4xl: 30px;
102
+ --text-heading-5xl: 30px;
103
+ }
104
+
105
+ /* --------------------------- */
106
+ /* Generate sizes */
107
+ /* --------------------------- */
108
+
109
+ .size-xs,
110
+ .size-xs
111
+ .compact:not(.size-xs [class*='size-'] .compact):not(
112
+ .size-xs [class*='size-'].compact
113
+ ) {
114
+ --space-1: var(--space-sm-1);
115
+ --space-2: var(--space-sm-2);
116
+ --space-3: var(--space-sm-3);
117
+ --space-4: var(--space-sm-4);
118
+ --space-5: var(--space-sm-5);
119
+ --space-6: var(--space-sm-6);
120
+
121
+ --element-1: var(--element-sm-1);
122
+ --element-2: var(--element-sm-2);
123
+ --element-3: var(--element-sm-3);
124
+
125
+ --radius-1: calc(var(--border-radius, 1) * var(--element-sm-1));
126
+ --radius-2: calc(var(--border-radius, 1) * var(--element-sm-2));
127
+ --radius-3: calc(var(--border-radius, 1) * var(--element-sm-3));
128
+
129
+ --text-label: var(--text-label-sm);
130
+ --text-body: var(--text-body-xs);
131
+ --text-heading: var(--text-heading-xs);
132
+ }
133
+
134
+ .size-sm,
135
+ .size-sm
136
+ .compact:not(.size-sm [class*='size-'] .compact):not(
137
+ .size-sm [class*='size-'].compact
138
+ ) {
139
+ --space-1: var(--space-sm-1);
140
+ --space-2: var(--space-sm-2);
141
+ --space-3: var(--space-sm-3);
142
+ --space-4: var(--space-sm-4);
143
+ --space-5: var(--space-sm-5);
144
+ --space-6: var(--space-sm-6);
145
+
146
+ --element-1: var(--element-sm-1);
147
+ --element-2: var(--element-sm-2);
148
+ --element-3: var(--element-sm-3);
149
+
150
+ --radius-1: calc(var(--border-radius, 1) * var(--element-sm-1));
151
+ --radius-2: calc(var(--border-radius, 1) * var(--element-sm-2));
152
+ --radius-3: calc(var(--border-radius, 1) * var(--element-sm-3));
153
+
154
+ --text-label: var(--text-label-sm);
155
+ --text-body: var(--text-body-sm);
156
+ --text-heading: var(--text-heading-sm);
157
+ }
158
+
159
+ :where(:root),
160
+ :where(.compact),
161
+ .size-md,
162
+ .size-md
163
+ .compact:not(.size-md [class*='size-'] .compact):not(
164
+ .size-md [class*='size-'].compact
165
+ ) {
166
+ --space-1: var(--space-md-1);
167
+ --space-2: var(--space-md-2);
168
+ --space-3: var(--space-md-3);
169
+ --space-4: var(--space-md-4);
170
+ --space-5: var(--space-md-5);
171
+ --space-6: var(--space-md-6);
172
+
173
+ --element-1: var(--element-md-1);
174
+ --element-2: var(--element-md-2);
175
+ --element-3: var(--element-md-3);
176
+
177
+ --radius-1: calc(var(--border-radius, 1) * var(--element-md-1));
178
+ --radius-2: calc(var(--border-radius, 1) * var(--element-md-2));
179
+ --radius-3: calc(var(--border-radius, 1) * var(--element-md-3));
180
+
181
+ --text-label: var(--text-label-md);
182
+ --text-body: var(--text-body-md);
183
+ --text-heading: var(--text-heading-md);
184
+ }
185
+
186
+ .size-lg,
187
+ .size-lg
188
+ .compact:not(.size-lg [class*='size-'] .compact):not(
189
+ .size-lg [class*='size-'].compact
190
+ ) {
191
+ --space-1: var(--space-lg-1);
192
+ --space-2: var(--space-lg-2);
193
+ --space-3: var(--space-lg-3);
194
+ --space-4: var(--space-lg-4);
195
+ --space-5: var(--space-lg-5);
196
+ --space-6: var(--space-lg-6);
197
+
198
+ --element-1: var(--element-lg-1);
199
+ --element-2: var(--element-lg-2);
200
+ --element-3: var(--element-lg-3);
201
+
202
+ --radius-1: calc(var(--border-radius, 1) * var(--element-lg-1));
203
+ --radius-2: calc(var(--border-radius, 1) * var(--element-lg-2));
204
+ --radius-3: calc(var(--border-radius, 1) * var(--element-lg-3));
205
+
206
+ --text-label: var(--text-label-lg);
207
+ --text-body: var(--text-body-lg);
208
+ --text-heading: var(--text-heading-lg);
209
+ }
210
+
211
+ .size-xl,
212
+ .size-xl
213
+ .compact:not(.size-xl [class*='size-'] .compact):not(
214
+ .size-xl [class*='size-'].compact
215
+ ) {
216
+ --space-1: var(--space-lg-1);
217
+ --space-2: var(--space-lg-2);
218
+ --space-3: var(--space-lg-3);
219
+ --space-4: var(--space-lg-4);
220
+ --space-5: var(--space-lg-5);
221
+ --space-6: var(--space-lg-6);
222
+
223
+ --element-1: var(--element-lg-1);
224
+ --element-2: var(--element-lg-2);
225
+ --element-3: var(--element-lg-3);
226
+
227
+ --radius-1: calc(var(--border-radius, 1) * var(--element-lg-1));
228
+ --radius-2: calc(var(--border-radius, 1) * var(--element-lg-2));
229
+ --radius-3: calc(var(--border-radius, 1) * var(--element-lg-3));
230
+
231
+ --text-label: var(--text-label-lg);
232
+ --text-body: var(--text-body-xl);
233
+ --text-heading: var(--text-heading-xl);
234
+ }
235
+
236
+ .size-2xl,
237
+ .size-2xl
238
+ .compact:not(.size-2xl [class*='size-'] .compact):not(
239
+ .size-2xl [class*='size-'].compact
240
+ ) {
241
+ --space-1: var(--space-lg-1);
242
+ --space-2: var(--space-lg-2);
243
+ --space-3: var(--space-lg-3);
244
+ --space-4: var(--space-lg-4);
245
+ --space-5: var(--space-lg-5);
246
+ --space-6: var(--space-lg-6);
247
+
248
+ --element-1: var(--element-lg-1);
249
+ --element-2: var(--element-lg-2);
250
+ --element-3: var(--element-lg-3);
251
+
252
+ --radius-1: calc(var(--border-radius, 1) * var(--element-lg-1));
253
+ --radius-2: calc(var(--border-radius, 1) * var(--element-lg-2));
254
+ --radius-3: calc(var(--border-radius, 1) * var(--element-lg-3));
255
+
256
+ --text-label: var(--text-label-lg);
257
+ --text-body: var(--text-body-xl);
258
+ --text-heading: var(--text-heading-2xl);
259
+ }
260
+
261
+ .size-3xl,
262
+ .size-3xl
263
+ .compact:not(.size-3xl [class*='size-'] .compact):not(
264
+ .size-3xl [class*='size-'].compact
265
+ ) {
266
+ --space-1: var(--space-lg-1);
267
+ --space-2: var(--space-lg-2);
268
+ --space-3: var(--space-lg-3);
269
+ --space-4: var(--space-lg-4);
270
+ --space-5: var(--space-lg-5);
271
+ --space-6: var(--space-lg-6);
272
+
273
+ --element-1: var(--element-lg-1);
274
+ --element-2: var(--element-lg-2);
275
+ --element-3: var(--element-lg-3);
276
+
277
+ --radius-1: calc(var(--border-radius, 1) * var(--element-lg-1));
278
+ --radius-2: calc(var(--border-radius, 1) * var(--element-lg-2));
279
+ --radius-3: calc(var(--border-radius, 1) * var(--element-lg-3));
280
+
281
+ --text-label: var(--text-label-lg);
282
+ --text-body: var(--text-body-xl);
283
+ --text-heading: var(--text-heading-3xl);
284
+ }
285
+
286
+ .size-4xl,
287
+ .size-4xl
288
+ .compact:not(.size-4xl [class*='size-'] .compact):not(
289
+ .size-4xl [class*='size-'].compact
290
+ ) {
291
+ --space-1: var(--space-lg-1);
292
+ --space-2: var(--space-lg-2);
293
+ --space-3: var(--space-lg-3);
294
+ --space-4: var(--space-lg-4);
295
+ --space-5: var(--space-lg-5);
296
+ --space-6: var(--space-lg-6);
297
+
298
+ --element-1: var(--element-lg-1);
299
+ --element-2: var(--element-lg-2);
300
+ --element-3: var(--element-lg-3);
301
+
302
+ --radius-1: calc(var(--border-radius, 1) * var(--element-lg-1));
303
+ --radius-2: calc(var(--border-radius, 1) * var(--element-lg-2));
304
+ --radius-3: calc(var(--border-radius, 1) * var(--element-lg-3));
305
+
306
+ --text-label: var(--text-label-lg);
307
+ --text-body: var(--text-body-xl);
308
+ --text-heading: var(--text-heading-4xl);
309
+ }
310
+
311
+ .size-5xl,
312
+ .size-5xl
313
+ .compact:not(.size-5xl [class*='size-'] .compact):not(
314
+ .size-5xl [class*='size-'].compact
315
+ ) {
316
+ --space-1: var(--space-lg-1);
317
+ --space-2: var(--space-lg-2);
318
+ --space-3: var(--space-lg-3);
319
+ --space-4: var(--space-lg-4);
320
+ --space-5: var(--space-lg-5);
321
+ --space-6: var(--space-lg-6);
322
+
323
+ --element-1: var(--element-lg-1);
324
+ --element-2: var(--element-lg-2);
325
+ --element-3: var(--element-lg-3);
326
+
327
+ --radius-1: calc(var(--border-radius, 1) * var(--element-lg-1));
328
+ --radius-2: calc(var(--border-radius, 1) * var(--element-lg-2));
329
+ --radius-3: calc(var(--border-radius, 1) * var(--element-lg-3));
330
+
331
+ --text-label: var(--text-label-lg);
332
+ --text-body: var(--text-body-xl);
333
+ --text-heading: var(--text-heading-5xl);
334
+ }
@@ -6,8 +6,8 @@
6
6
  --font-family: 'IBM Plex Sans', sans-serif;
7
7
  --font-weight: 400;
8
8
 
9
- --heading-font-family: var(--font-family);
10
- --heading-font-weight: 700;
9
+ --text-heading-font-family: var(--font-family);
10
+ --text-heading-font-weight: 700;
11
11
 
12
12
  --button-font-family: var(--font-family);
13
13
  --button-font-weight: 500;
package/src/index.ts CHANGED
@@ -1,20 +1,9 @@
1
- // Utils
2
- export * from './utils/getAllCollections'
3
- export * from './utils/getPathname'
4
- export * from './utils/transform/transform'
5
- export * from './utils/transform/transformCasing'
6
- export * from './utils/transform/transformReferences'
7
- export * from './utils/transform/transformSelfs'
8
- export * from './utils/transform/transformUnderscores'
9
-
10
- // Schemas
11
- export * from './schemas/attributesSchema'
12
- export * from './schemas/pageSchema'
1
+ // Schemas and utils
2
+ export * from './schemas/collection'
13
3
 
14
4
  // Base components
15
5
  export { default as Badge } from './components/base/Badge.astro'
16
6
  export { default as Button } from './components/base/Button.astro'
17
- export { default as Buttons } from './components/base/Buttons.astro'
18
7
  export { default as Checkbox } from './components/base/Checkbox.astro'
19
8
  export { default as Icon } from './components/base/Icon.astro'
20
9
  export { default as Image } from './components/base/Image.astro'
@@ -36,36 +25,26 @@ export { default as List } from './components/typography/List.astro'
36
25
  export { default as ListItem } from './components/typography/ListItem.astro'
37
26
  export { default as Paragraph } from './components/typography/Paragraph.astro'
38
27
  export { default as Tagline } from './components/typography/Tagline.astro'
39
-
40
- // Structure components
41
- export { default as Bento } from './components/structure/Bento.astro'
42
- export { default as Carousel } from './components/structure/Carousel.astro'
43
- export { default as Grid } from './components/structure/Grid.astro'
44
- export { default as Group } from './components/structure/Group.astro'
45
- export { default as Masonry } from './components/structure/Masonry.astro'
46
- export { default as Row } from './components/structure/Row.astro'
47
- export { default as Split } from './components/structure/Split.astro'
48
- export { default as Spread } from './components/structure/Spread.astro'
49
- export { default as Stack } from './components/structure/Stack.astro'
28
+ export { default as Text } from './components/typography/Text.astro'
50
29
 
51
30
  // Segment components
52
- export { default as Body } from './components/segment/Body.astro'
31
+ export { default as Body } from './components/_archive/Body.astro'
32
+ export { default as Main } from './components/_archive/Main.astro'
33
+ export { default as Nav } from './components/_archive/Nav.astro'
34
+ export { default as Footer } from './components/_todo/Footer.astro'
35
+ export { default as Form } from './components/_todo/Form.astro'
36
+ export { default as Prose } from './components/_todo/Prose.astro'
37
+ export { default as Writeup } from './components/_todo/Writeup.astro'
38
+ export { default as Box } from './components/segment/Box.astro'
53
39
  export { default as Card } from './components/segment/Card.astro'
54
40
  export { default as Deck } from './components/segment/Deck.astro'
55
- export { default as Footer } from './components/segment/Footer.astro'
56
- export { default as Form } from './components/segment/Form.astro'
41
+ export { default as Group } from './components/segment/Group.astro'
57
42
  export { default as Header } from './components/segment/Header.astro'
58
- export { default as Main } from './components/segment/Main.astro'
59
- export { default as Nav } from './components/segment/Nav.astro'
60
- export { default as Prose } from './components/segment/Prose.astro'
61
43
  export { default as Section } from './components/segment/Section.astro'
62
- export { default as Writeup } from './components/segment/Writeup.astro'
63
44
 
64
45
  // Utility components
65
46
  export { default as Block } from './components/_Block.astro'
66
47
  export { default as Blocks } from './components/_Blocks.astro'
67
48
  export { default as Children } from './components/_Children.astro'
68
49
  export { default as Head } from './components/utility/Head.astro'
69
-
70
- // Layouts
71
- export { default as Layout } from './layouts/Layout.astro'
50
+ export { default as Layout } from './components/utility/Layout.astro'
@@ -6,6 +6,51 @@ const defaultConfig = {
6
6
  layer: 'fulldev',
7
7
  }
8
8
 
9
+ interface Config {
10
+ layer: string
11
+ prefix: string
12
+ screen: string
13
+ styled: boolean
14
+ responsive: boolean
15
+ colors: {
16
+ gray: {
17
+ background: string
18
+ backgroundPanel: string
19
+ backgroundElement: string
20
+ backgroundHover: string
21
+ backgroundActive: string
22
+
23
+ border: string
24
+ borderElement: string
25
+ borderHover: string
26
+
27
+ solid: string
28
+ solidHover: string
29
+
30
+ text: string
31
+ textContrast: string
32
+ }
33
+ accent: {
34
+ background: string
35
+ backgroundPanel: string
36
+ backgroundElement: string
37
+ backgroundHover: string
38
+ backgroundActive: string
39
+
40
+ border: string
41
+ borderElement: string
42
+ borderHover: string
43
+
44
+ solid: string
45
+ solidHover: string
46
+
47
+ text: string
48
+ textContrast: string
49
+ }
50
+ }
51
+ tailwind: {}
52
+ }
53
+
9
54
  export default function fulluiIntegration(
10
55
  userConfig: any = {}
11
56
  ): AstroIntegration {
@@ -0,0 +1,87 @@
1
+ import type { ZodRawShape } from 'astro/zod'
2
+ import {
3
+ reference,
4
+ z,
5
+ type AnyEntryMap,
6
+ type ContentEntryMap,
7
+ type DataEntryMap,
8
+ type ValidContentEntrySlug,
9
+ } from 'astro:content'
10
+
11
+ export const pathSchema = <C extends keyof AnyEntryMap>(collection: C) =>
12
+ z
13
+ .string()
14
+ .transform((value) => {
15
+ const fullpath = value.split(`${collection}/`).pop()
16
+ const slug = fullpath?.split('.').shift()
17
+ return slug
18
+ })
19
+ .pipe(reference(collection))
20
+
21
+ const buttonSchema = z
22
+ .object({
23
+ text: z.string(),
24
+ html: z.string(),
25
+ href: z.string(),
26
+ })
27
+ .partial()
28
+ .passthrough()
29
+
30
+ const baseSchema = z
31
+ .object({
32
+ image: z.string(),
33
+ images: z.string().array(),
34
+ rating: z.number(),
35
+ badge: z.string(),
36
+ tagline: z.string(),
37
+ heading: z.string(),
38
+ paragraph: z.string(),
39
+ list: z.string().array(),
40
+ price: z.string().or(z.number()),
41
+ button: buttonSchema,
42
+ buttons: buttonSchema.array(),
43
+ })
44
+ .partial()
45
+ .passthrough()
46
+
47
+ const blockSchema = <R extends ZodRawShape>(references: R) =>
48
+ baseSchema
49
+ .extend({
50
+ card: baseSchema,
51
+ cards: baseSchema.array(),
52
+ })
53
+ .extend(references)
54
+ .partial()
55
+ .passthrough()
56
+
57
+ export const pageSchema = <R extends ZodRawShape>(references: R) =>
58
+ baseSchema
59
+ .extend({
60
+ title: z.string(),
61
+ description: z.string(),
62
+ block: blockSchema(references),
63
+ blocks: z.object({}).catchall(blockSchema(references)).partial(),
64
+ head: z
65
+ .object({
66
+ title: z.string(),
67
+ description: z.string(),
68
+ image: z.string().optional(),
69
+ })
70
+ .partial(),
71
+ })
72
+ .extend(references)
73
+ .partial()
74
+ .passthrough()
75
+
76
+ export type Reference<C extends keyof AnyEntryMap> =
77
+ C extends keyof ContentEntryMap
78
+ ? {
79
+ collection: C
80
+ slug: ValidContentEntrySlug<C>
81
+ }
82
+ : C extends keyof DataEntryMap
83
+ ? {
84
+ collection: C
85
+ id: keyof DataEntryMap[C]
86
+ }
87
+ : never
@@ -1,12 +0,0 @@
1
- Add config files here for blocks. These should contain the following things:
2
-
3
- - schema for in CMS
4
- - default values
5
- - schema for all possible props, cms and defaults combined
6
-
7
- Each block should have it's own config file, because this aligns with how astro and markdown workk; they utilize folder structure.
8
- We might need a folder for 'hero' for example, to add all possible hero's.
9
-
10
-
11
- example:
12
- Hero component should choose which hero. Could also be a local hero. similar behaviour as blocks, but then only hero's.
@@ -1,27 +0,0 @@
1
- ---
2
- import { listify } from 'radash'
3
- import { isNumber, isString, pickBy } from 'remeda'
4
-
5
- interface Props {
6
- component: any
7
- [defaults: string]: any
8
- [items: number]: object | string
9
- }
10
-
11
- const { component: Component, ...rest } = Astro.props
12
-
13
- const defaults = pickBy(rest, (v, key) => !isNumber(parseInt(key as string)))
14
-
15
- const items = pickBy(rest, (v, key) => isNumber(parseInt(key as string)))
16
- const array = listify(items, (k, value) => value)
17
- const mapped = array.map((item) => (isString(item) ? { html: item } : item))
18
- ---
19
-
20
- {
21
- mapped.map((item) => (
22
- <Component
23
- {...defaults}
24
- {...item}
25
- />
26
- ))
27
- }
@@ -1,15 +0,0 @@
1
- ---
2
- import type { ComponentProps } from 'astro/types'
3
- import type { Pluralmorphic } from '../../types/Pluralmorphic'
4
- import Plural from '../_Plural.astro'
5
- import Button from './Button.astro'
6
-
7
- type Props = Pluralmorphic<ComponentProps<typeof Button>>
8
-
9
- const { props } = Astro
10
- ---
11
-
12
- <Plural
13
- component={Button}
14
- {...props}
15
- />
@@ -1,15 +0,0 @@
1
- ---
2
- import type { ComponentProps } from 'astro/types'
3
- import type { Pluralmorphic } from '../../types/Pluralmorphic'
4
- import Plural from '../_Plural.astro'
5
- import Image from './Image.astro'
6
-
7
- type Props = Pluralmorphic<ComponentProps<typeof Image>>
8
-
9
- const { props } = Astro
10
- ---
11
-
12
- <Plural
13
- component={Image}
14
- {...props}
15
- />
@@ -1,14 +0,0 @@
1
- ---
2
- import type { ComponentProps, HTMLTag, Polymorphic } from 'astro/types'
3
- import type Tag from '../_Tag.astro'
4
-
5
- type Props<As extends HTMLTag = 'footer'> = Polymorphic<{ as: As }> &
6
- ComponentProps<typeof Tag>
7
-
8
- const {
9
- as = 'footer',
10
- direction = 'horizontal',
11
- density = 'compact',
12
- ...rest
13
- } = Astro.props
14
- ---
@@ -1,35 +0,0 @@
1
- ---
2
- import type { ComponentProps, HTMLTag, Polymorphic } from 'astro/types'
3
- import Tag from '../_Tag.astro'
4
-
5
- type Props<As extends HTMLTag = 'div'> = Polymorphic<{ as: As }> &
6
- ComponentProps<typeof Tag>
7
-
8
- const { ...rest } = Astro.props
9
- ---
10
-
11
- <Tag
12
- class:list={['bento']}
13
- {...rest}
14
- >
15
- <slot />
16
- </Tag>
17
-
18
- <style is:global lang="scss">
19
- @import '../../css/utils.scss';
20
-
21
- @include component('bento') {
22
- display: grid;
23
- position: relative;
24
- grid-template-columns: 1fr;
25
- width: 100%;
26
-
27
- @media (min-width: 1024px) {
28
- grid-template-columns: 1fr 1fr 1fr;
29
-
30
- & > *:nth-child(2n) {
31
- grid-column-start: span 2;
32
- }
33
- }
34
- }
35
- </style>