@awesomeness-js/server 1.1.7 → 1.1.8
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/index.js +101 -101
- package/package.json +1 -1
- package/src/koa/routeRequest.js +87 -26
- package/example-site/example.awesomenessjs.com/components/example/index.js +0 -3
- package/example-site/example.awesomenessjs.com/components/notCommonExample/_.css +0 -1
- package/example-site/example.awesomenessjs.com/components/notCommonExample/index.js +0 -3
- package/ui/README.md +0 -438
- package/ui/awesomeness-ui.instructions.md +0 -156
- package/ui/build.js +0 -119
- package/ui/commonComponent.test.js +0 -27
- package/ui/components/blogPost/all.css +0 -371
- package/ui/components/blogPost/headerImage.js +0 -153
- package/ui/components/blogPost/index.js +0 -45
- package/ui/components/blogPost/marked.js +0 -74
- package/ui/components/blogPost/md.js +0 -73
- package/ui/components/blogPost/parseAwesomeness.jQuery.js +0 -47
- package/ui/components/blogPost/readme.md +0 -8
- package/ui/components/colors/README.md +0 -65
- package/ui/components/colors/dynamic.css +0 -1884
- package/ui/components/colors/dynamic.css.js +0 -135
- package/ui/components/colors/dynamic.css.php +0 -79
- package/ui/components/colors/example.js +0 -133
- package/ui/components/colors/index.js +0 -65
- package/ui/components/colors/map.js +0 -13
- package/ui/components/colors/random.js +0 -17
- package/ui/components/colors/tailwind-colors.css +0 -247
- package/ui/components/insertIntoList/insertIntoList.jquery.js +0 -150
- package/ui/components/statusPage/index.css +0 -120
- package/ui/components/statusPage/index.js +0 -39
- package/ui/components/tag/category.js +0 -8
- package/ui/components/tag/index.js +0 -33
- package/ui/components/tag/list.js +0 -42
- package/ui/components/tag/map.js +0 -64
- package/ui/components/tag/tagMap.css +0 -60
- package/ui/components/tag/tags.css +0 -20
- package/ui/core/css/_normalize.css +0 -57
- package/ui/core/css/dynamic/flex.js +0 -36
- package/ui/core/css/dynamic/grid.js +0 -185
- package/ui/core/css/dynamic/shortcuts.js +0 -48
- package/ui/core/css/dynamic/spacing.js +0 -61
- package/ui/core/css/dynamic/text.js +0 -80
- package/ui/core/css/dynamic/width.js +0 -75
- package/ui/core/css/dynamic.js +0 -40
- package/ui/core/js/app/api.js +0 -143
- package/ui/core/js/app/init.js +0 -88
- package/ui/core/js/app/initDarkMode.js +0 -26
- package/ui/core/js/app/initialScroll.js +0 -28
- package/ui/core/js/app/meta/update/components.js +0 -65
- package/ui/core/js/app/meta/update/pages.js +0 -86
- package/ui/core/js/app/metaUpdates.js +0 -10
- package/ui/core/js/app/page.js +0 -319
- package/ui/core/js/app/resize.js +0 -52
- package/ui/core/js/app/state/back.js +0 -16
- package/ui/core/js/app/state/create.js +0 -50
- package/ui/core/js/app/state/get.js +0 -5
- package/ui/core/js/app/state/init.js +0 -25
- package/ui/core/js/app.js +0 -41
- package/ui/core/js/jquery-3.7.1.min.js +0 -2
- package/ui/core/public/app.css +0 -1
- package/ui/core/public/app.js +0 -975
- package/ui/core/public/favicon.ico +0 -0
- package/ui/core/public/index.html +0 -40
package/ui/README.md
DELETED
|
@@ -1,438 +0,0 @@
|
|
|
1
|
-
# Awesomeness UI
|
|
2
|
-
|
|
3
|
-
Awesomeness UI is a utility-first CSS framework focused on responsive, dynamic layouts using a consistent, JS-driven class generator. It replaces traditional media queries with intuitive `app-size-*` modifiers.
|
|
4
|
-
|
|
5
|
-
**Awesomeness UI** is a utility-first CSS framework focused on creating **responsive, grid-based layouts** using predictable, reusable class names. It avoids media queries by using automatically applied screen-size classes.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## 📐 Responsive Foundation
|
|
10
|
-
|
|
11
|
-
Your layout responds to screen size using `app-size-*` classes:
|
|
12
|
-
|
|
13
|
-
```html
|
|
14
|
-
<body class="app-size-p">
|
|
15
|
-
<div id="app"></div>
|
|
16
|
-
</body>
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
These classes (`app-size-p`, `app-size-t`, etc.) are added dynamically based on the screen width, so you can target styles like this:
|
|
20
|
-
|
|
21
|
-
```html
|
|
22
|
-
<div class="grid-1-p grid-2-t grid-4-d grid-6-xl">...</div>
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
**Size keys:**
|
|
26
|
-
- `p` → phone
|
|
27
|
-
- `t` → tablet
|
|
28
|
-
- `d` → desktop
|
|
29
|
-
- `xl` → extra large
|
|
30
|
-
|
|
31
|
-
---
|
|
32
|
-
|
|
33
|
-
## 🧩 Core Class System
|
|
34
|
-
|
|
35
|
-
Here’s a breakdown of the key layout utilities:
|
|
36
|
-
|
|
37
|
-
### 🧱 `grid-*`
|
|
38
|
-
|
|
39
|
-
Defines how many equal-width columns a container has.
|
|
40
|
-
|
|
41
|
-
```html
|
|
42
|
-
<div class="grid-3">...</div>
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
Responsive:
|
|
46
|
-
|
|
47
|
-
```html
|
|
48
|
-
<div class="grid-1-p grid-2-t grid-4-d grid-4-xl">...</div>
|
|
49
|
-
<div class="grid-3 grid-1-p"> three on all except phone </div>
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
---
|
|
53
|
-
|
|
54
|
-
### ↔️ `span-*`
|
|
55
|
-
|
|
56
|
-
Defines how many columns a child should span.
|
|
57
|
-
|
|
58
|
-
```html
|
|
59
|
-
<div class="span-2">Spans 2 columns</div>
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
Also available:
|
|
63
|
-
- `.span-full` → spans full width
|
|
64
|
-
- `.row-span-*` → spans rows
|
|
65
|
-
- `.row-span-full` → full-height span
|
|
66
|
-
|
|
67
|
-
Responsive variant:
|
|
68
|
-
|
|
69
|
-
```html
|
|
70
|
-
<div class="span-1-p span-2-t span-3-d">...</div>
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
---
|
|
74
|
-
|
|
75
|
-
### 🔄 `justify-*`
|
|
76
|
-
|
|
77
|
-
Controls horizontal alignment **inside grid containers**.
|
|
78
|
-
|
|
79
|
-
```css
|
|
80
|
-
.justify-center → center content
|
|
81
|
-
.justify-start → left-align
|
|
82
|
-
.justify-end → right-align
|
|
83
|
-
.justify-between → space-between
|
|
84
|
-
.justify-around → space-around
|
|
85
|
-
.justify-evenly → space-evenly
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
```html
|
|
89
|
-
<div class="justify-center-p justify-end-d">...</div>
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
---
|
|
93
|
-
|
|
94
|
-
### ↕️ `align-*`
|
|
95
|
-
|
|
96
|
-
Controls vertical alignment (applies to grid items).
|
|
97
|
-
|
|
98
|
-
```css
|
|
99
|
-
.align-center → vertically center items
|
|
100
|
-
.align-start → align top
|
|
101
|
-
.align-end → align bottom
|
|
102
|
-
.align-stretch → stretch to fill
|
|
103
|
-
.align-baseline → align text baseline
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
---
|
|
107
|
-
|
|
108
|
-
### 🎯 `start-*`, `end-*`
|
|
109
|
-
|
|
110
|
-
Control where grid items begin or end:
|
|
111
|
-
|
|
112
|
-
```css
|
|
113
|
-
.start-2 → grid-column-start: 2
|
|
114
|
-
.end-4 → grid-column-end: 4
|
|
115
|
-
.row-start-1 → grid-row-start: 1
|
|
116
|
-
.row-end-3 → grid-row-end: 3
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
Responsive:
|
|
120
|
-
|
|
121
|
-
```html
|
|
122
|
-
<div class="start-1-p start-3-d">...</div>
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
---
|
|
126
|
-
|
|
127
|
-
### 🔢 `order-*`
|
|
128
|
-
|
|
129
|
-
Controls item order inside a flex/grid container.
|
|
130
|
-
|
|
131
|
-
```html
|
|
132
|
-
<div class="order-1">First</div>
|
|
133
|
-
<div class="order-2">Second</div>
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
Responsive:
|
|
137
|
-
|
|
138
|
-
```html
|
|
139
|
-
<div class="order-1-p order-3-d">...</div>
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
---
|
|
143
|
-
|
|
144
|
-
### 📏 `gap-*`, `gap-x-*`, `gap-y-*`
|
|
145
|
-
|
|
146
|
-
Spacing between grid rows and columns.
|
|
147
|
-
|
|
148
|
-
```css
|
|
149
|
-
.gap-10 → gap: 10px
|
|
150
|
-
.gap-x-20 → column-gap: 20px
|
|
151
|
-
.gap-y-5 → row-gap: 5px
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
Responsive:
|
|
155
|
-
|
|
156
|
-
```html
|
|
157
|
-
<div class="gap-4-p gap-10-d">...</div>
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
---
|
|
161
|
-
## 🎨 Dynamic Color Utilities
|
|
162
|
-
|
|
163
|
-
This system auto-generates utility classes for applying color styles using predefined CSS variables (`--colorName-shade`), supporting background, border, and text colors.
|
|
164
|
-
|
|
165
|
-
### ✅ Class Patterns
|
|
166
|
-
|
|
167
|
-
Each utility follows this pattern:
|
|
168
|
-
|
|
169
|
-
```
|
|
170
|
-
.{prefix}-{color}-{shade}
|
|
171
|
-
.{prefix}-{color}-{shade}--hover:hover
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
Where:
|
|
175
|
-
- `{prefix}` = `bg`, `border`, or `text`
|
|
176
|
-
- `{color}` = one of the supported color names (see below)
|
|
177
|
-
- `{shade}` = one of the supported shades (e.g., `100`, `500`, `950`)
|
|
178
|
-
|
|
179
|
-
### ✨ Examples
|
|
180
|
-
|
|
181
|
-
```html
|
|
182
|
-
<div class="bg-blue-500 text-white border-blue-700">Primary</div>
|
|
183
|
-
<div class="bg-gray-100--hover hoverable-box">Hover Me</div>
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
### 🎨 Available Color Names
|
|
187
|
-
|
|
188
|
-
```
|
|
189
|
-
red, orange, amber, yellow, lime, green, emerald, teal, cyan, sky,
|
|
190
|
-
blue, indigo, violet, purple, fuchsia, pink, rose,
|
|
191
|
-
slate, gray, zinc, neutral, stone
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
### 🌗 Shades
|
|
195
|
-
|
|
196
|
-
```
|
|
197
|
-
50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
### 🖤 Black and White
|
|
201
|
-
|
|
202
|
-
```html
|
|
203
|
-
<div class="bg-black text-white border-white">Dark Card</div>
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
### 🧠 Notes
|
|
207
|
-
|
|
208
|
-
- All colors use CSS variables, such as `--blue-500`, so you can theme or dark-mode easily.
|
|
209
|
-
- `--hover` suffix variants enable hover state styling directly via class names.
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
## Core
|
|
213
|
-
location: /awesomeness-ui/core
|
|
214
|
-
|
|
215
|
-
The core folder is what it takes to load a super minimalistic Awesomeness UI
|
|
216
|
-
|
|
217
|
-
Available tools
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
## Components
|
|
222
|
-
location: /awesomeness-ui/components
|
|
223
|
-
|
|
224
|
-
Each folder within this directory is a `component`
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
#### Rules
|
|
228
|
-
- Each component should have a unique name
|
|
229
|
-
- Each component can have any number of files and folders
|
|
230
|
-
- Each js file should export default a single function
|
|
231
|
-
- Each component "should" have an `index.js` file at the root level
|
|
232
|
-
- It does not need to, such as a css only component or jQuery plugin
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
#### Component Dependencies
|
|
236
|
-
|
|
237
|
-
Components can depend on other components.
|
|
238
|
-
To use a component in another component, you can import it like this:
|
|
239
|
-
|
|
240
|
-
```js
|
|
241
|
-
// awesomeness import 'card';
|
|
242
|
-
// awesomeness import 'insertIntoList';
|
|
243
|
-
```
|
|
244
|
-
This will import the `card` and `insertIntoList` components.
|
|
245
|
-
All of its css, functions / methods, IIFs / jQuery plugins and sub-components will be available at the expected namespace.
|
|
246
|
-
|
|
247
|
-
```js
|
|
248
|
-
|
|
249
|
-
const $list = $(`<div class="example-list"></div>`)
|
|
250
|
-
.appendTo('body');
|
|
251
|
-
|
|
252
|
-
const $card = ui.card();
|
|
253
|
-
|
|
254
|
-
$card.insertIntoList($list);
|
|
255
|
-
|
|
256
|
-
```
|
|
257
|
-
|
|
258
|
-
---
|
|
259
|
-
### JS
|
|
260
|
-
|
|
261
|
-
The functions will be available in the browser at the `ui` namespace
|
|
262
|
-
```js
|
|
263
|
-
ui._example()
|
|
264
|
-
```
|
|
265
|
-
|
|
266
|
-
---
|
|
267
|
-
#### Basic Components
|
|
268
|
-
|
|
269
|
-
index.js files are available at the root level of the component namespace
|
|
270
|
-
[/awesomeness-ui/components/_example/index.js](/awesomeness-ui/components/example/index.js)
|
|
271
|
-
```js
|
|
272
|
-
ui._example()
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
other files will be available at the component namespace
|
|
276
|
-
[/awesomeness-ui/components/_example/grid.js](/awesomeness-ui/components/example/grid.js)
|
|
277
|
-
```js
|
|
278
|
-
ui._example.grid()
|
|
279
|
-
```
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
---
|
|
283
|
-
#### Complex Components
|
|
284
|
-
|
|
285
|
-
complex components can have any number of sub folders
|
|
286
|
-
[/awesomeness-ui/components/example/subComponent/index.js](/awesomeness-ui/components/example/subComponent/index.js)
|
|
287
|
-
```js
|
|
288
|
-
ui._example.subComponent()
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
sub components can have any number of files
|
|
292
|
-
[/awesomeness-ui/components/example/subComponent/simpleTest.js](/awesomeness-ui/components/example/subComponent/simpleTest.js)
|
|
293
|
-
```js
|
|
294
|
-
ui._example.subComponent.deep.simpleTest()
|
|
295
|
-
```
|
|
296
|
-
|
|
297
|
-
:warning: **Name Conflicts**
|
|
298
|
-
If you have multiple files with the same name in a component, they will conflict. Example:
|
|
299
|
-
|
|
300
|
-
```
|
|
301
|
-
awesomeness-ui/components/test/someMethod.js
|
|
302
|
-
awesomeness-ui/components/test/someMethod/index.js
|
|
303
|
-
```
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
---
|
|
307
|
-
#### IIFs
|
|
308
|
-
|
|
309
|
-
IIFs will not be available on `ui` but will be executed immediately when received in browser
|
|
310
|
-
|
|
311
|
-
This works well for **jQuery plugins** and loading **3rd party libraries**
|
|
312
|
-
|
|
313
|
-
[/awesomeness-ui/components/example/jQuery_example.js](/awesomeness-ui/components/example/example.jQuery.js)
|
|
314
|
-
|
|
315
|
-
---
|
|
316
|
-
|
|
317
|
-
### CSS
|
|
318
|
-
|
|
319
|
-
:warning: All CSS is available globally.
|
|
320
|
-
Do not **pollute** the global namespace.
|
|
321
|
-
Prefix all classes with the component name.
|
|
322
|
-
|
|
323
|
-
e.g.,
|
|
324
|
-
|
|
325
|
-
```css
|
|
326
|
-
|
|
327
|
-
.componentName-container {
|
|
328
|
-
background-color: red;
|
|
329
|
-
color: white;
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
.componentName-button {
|
|
333
|
-
background-color: blue;
|
|
334
|
-
color: white;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
```
|
|
338
|
-
|
|
339
|
-
*Files names do not matter you can name them whatever you want*
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
---
|
|
343
|
-
## PAGES
|
|
344
|
-
|
|
345
|
-
Pages can be located anywhere your router expects a `/pages/` directory.
|
|
346
|
-
|
|
347
|
-
Each page is a folder containing the following
|
|
348
|
-
|
|
349
|
-
```
|
|
350
|
-
your-site/
|
|
351
|
-
└── pages/
|
|
352
|
-
└── example/
|
|
353
|
-
├── _info.js
|
|
354
|
-
├── getData.js
|
|
355
|
-
├── js/
|
|
356
|
-
│ └── init.js
|
|
357
|
-
└── css/
|
|
358
|
-
└── example.css
|
|
359
|
-
```
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
#### /_info.js
|
|
363
|
-
|
|
364
|
-
_info.js exports an object used by the router to determine what it needs to send back, and who can interact with it.
|
|
365
|
-
|
|
366
|
-
the `components` array allows the page to pull, and load each component prior to rendering any page content.
|
|
367
|
-
|
|
368
|
-
```js
|
|
369
|
-
export default {
|
|
370
|
-
version: 1,
|
|
371
|
-
name: '',
|
|
372
|
-
description: '',
|
|
373
|
-
permissions: [ '*' ],
|
|
374
|
-
components: [
|
|
375
|
-
'heroWordsOverText'
|
|
376
|
-
]
|
|
377
|
-
};
|
|
378
|
-
|
|
379
|
-
```
|
|
380
|
-
|
|
381
|
-
#### /getData.js
|
|
382
|
-
|
|
383
|
-
```js
|
|
384
|
-
|
|
385
|
-
export default async function getData(awesomenessRequest) {
|
|
386
|
-
|
|
387
|
-
const {
|
|
388
|
-
data, // payload sent by the client
|
|
389
|
-
user // user information - set by the server
|
|
390
|
-
} = awesomenessRequest;
|
|
391
|
-
|
|
392
|
-
// do payload cleaning and validation here
|
|
393
|
-
|
|
394
|
-
// do user validation here
|
|
395
|
-
|
|
396
|
-
// return data to the client
|
|
397
|
-
|
|
398
|
-
return { page: 'template' };
|
|
399
|
-
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
```
|
|
403
|
-
|
|
404
|
-
#### /scripts/init.js
|
|
405
|
-
|
|
406
|
-
example:
|
|
407
|
-
|
|
408
|
-
```js
|
|
409
|
-
app.pages.examplePage.init = function(responseFromGetData){
|
|
410
|
-
|
|
411
|
-
// do stuff with data
|
|
412
|
-
|
|
413
|
-
// state management
|
|
414
|
-
app.state.create({
|
|
415
|
-
title: 'Example Page',
|
|
416
|
-
url: '/example-page',
|
|
417
|
-
reload:function(){ app.page('examplePage'); }
|
|
418
|
-
});
|
|
419
|
-
|
|
420
|
-
// do stuff with the DOM
|
|
421
|
-
|
|
422
|
-
};
|
|
423
|
-
```
|
|
424
|
-
|
|
425
|
-
#### /css/example.css
|
|
426
|
-
|
|
427
|
-
Optionally, you can add a css file to the page.
|
|
428
|
-
|
|
429
|
-
Ideally, you should use component who have their own css files, but if you need to add a page specific css file, you can do so here.
|
|
430
|
-
|
|
431
|
-
```css
|
|
432
|
-
|
|
433
|
-
.example-page {
|
|
434
|
-
background-color: red;
|
|
435
|
-
color: white;
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
```
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: "Awesomeness UI HTML Instructions"
|
|
3
|
-
description: "Instructions for generating HTML using the Awesomeness UI utility-first CSS system."
|
|
4
|
-
applyTo: "awesomeness-ui/components/**/*.js"
|
|
5
|
-
---
|
|
6
|
-
# HTML Generation with Custom Utility Classes
|
|
7
|
-
|
|
8
|
-
You are generating HTML using a custom utility-first CSS system (similar to Tailwind CSS). The system provides classes for layout, spacing, positioning, text, alignment, and responsive design.
|
|
9
|
-
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
## 📦 General Guidelines
|
|
13
|
-
|
|
14
|
-
- **Class Structure:** Use utility classes directly in `class` attributes. Do **not** write raw CSS or `<style>` tags.
|
|
15
|
-
- **Responsiveness:** Wrap responsive styles in containers with `.app-size-{size}`:
|
|
16
|
-
- `xl` = extra-large
|
|
17
|
-
- `d` = desktop
|
|
18
|
-
- `t` = tablet
|
|
19
|
-
- `p` = phone
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
## 🧱 Utility Class Reference (Quick)
|
|
24
|
-
|
|
25
|
-
### ✅ Grid & Layout
|
|
26
|
-
- `.grid`, `.grid-{n}`, `.grid-rows-{n}`
|
|
27
|
-
- `.span-{n}`, `.row-span-{n}`, `.start-{n}`, `.end-{n}`
|
|
28
|
-
- `.gap-{px}`, `.gap-x-{px}`, `.gap-y-{px}`
|
|
29
|
-
|
|
30
|
-
### ✅ Alignment
|
|
31
|
-
- Justify: `.justify-center`, `.justify-between`, etc.
|
|
32
|
-
- Align: `.align-start`, `.align-stretch`, etc.
|
|
33
|
-
- Self: `.justify-self-center`, `.grid.center`, etc.
|
|
34
|
-
|
|
35
|
-
### ✅ Spacing
|
|
36
|
-
- Margin: `.m{px}`, `.mt{px}`, `.mlr{px}`, etc.
|
|
37
|
-
- Padding: `.p{px}`, `.ptb{px}`, `.pr{px}`, etc.
|
|
38
|
-
|
|
39
|
-
### ✅ Sizing
|
|
40
|
-
- `.width{percent}`, `.height{percent}`
|
|
41
|
-
- `.width-{px}`, `.max-height-{px}`, `.span{1-12}`
|
|
42
|
-
|
|
43
|
-
### ✅ Text
|
|
44
|
-
- Align: `.text-center`, `.text-right`
|
|
45
|
-
- Weight: `.text-300`, `.text-900`
|
|
46
|
-
- Size: `.text-xs`, `.text-xl`, `.text-xxxl`
|
|
47
|
-
|
|
48
|
-
### ✅ Position
|
|
49
|
-
- `.absolute`, `.relative`, `.sticky`, `.fl`, `.fr`
|
|
50
|
-
|
|
51
|
-
### ✅ Responsive Variants
|
|
52
|
-
All classes may have a `-{size}` variant scoped under `.app-size-{size}` container:
|
|
53
|
-
```html
|
|
54
|
-
<div class="app-size-p">
|
|
55
|
-
<div class="text-center-p p20-p">Mobile Friendly</div>
|
|
56
|
-
</div>
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
---
|
|
61
|
-
## 🎨 Dynamic Color Utilities
|
|
62
|
-
|
|
63
|
-
This system auto-generates utility classes for applying color styles using predefined CSS variables (`--colorName-shade`), supporting background, border, and text colors.
|
|
64
|
-
|
|
65
|
-
### ✅ Class Patterns
|
|
66
|
-
|
|
67
|
-
Each utility follows this pattern:
|
|
68
|
-
|
|
69
|
-
```
|
|
70
|
-
.{prefix}-{color}-{shade}
|
|
71
|
-
.{prefix}-{color}-{shade}--hover:hover
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
Where:
|
|
75
|
-
- `{prefix}` = `bg`, `border`, or `text`
|
|
76
|
-
- `{color}` = one of the supported color names (see below)
|
|
77
|
-
- `{shade}` = one of the supported shades (e.g., `100`, `500`, `950`)
|
|
78
|
-
|
|
79
|
-
### ✨ Examples
|
|
80
|
-
|
|
81
|
-
```html
|
|
82
|
-
<div class="bg-blue-500 text-white border-blue-700">Primary</div>
|
|
83
|
-
<div class="bg-gray-100--hover hoverable-box">Hover Me</div>
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
### 🎨 Available Color Names
|
|
87
|
-
|
|
88
|
-
```
|
|
89
|
-
red, orange, amber, yellow, lime, green, emerald, teal, cyan, sky,
|
|
90
|
-
blue, indigo, violet, purple, fuchsia, pink, rose,
|
|
91
|
-
slate, gray, zinc, neutral, stone
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
### 🌗 Shades
|
|
95
|
-
|
|
96
|
-
```
|
|
97
|
-
50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
### 🖤 Black and White
|
|
101
|
-
|
|
102
|
-
```html
|
|
103
|
-
<div class="bg-black text-white border-white">Dark Card</div>
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
### 🧠 Notes
|
|
107
|
-
|
|
108
|
-
- All colors use CSS variables, such as `--blue-500`, so you can theme or dark-mode easily.
|
|
109
|
-
- `--hover` suffix variants enable hover state styling directly via class names.
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
### Example Prompt
|
|
113
|
-
|
|
114
|
-
Generate HTML for a responsive product grid. It should:
|
|
115
|
-
|
|
116
|
-
Display as 4 cards per row on desktop, 2 per row on tablet, and 1 per row on phone
|
|
117
|
-
|
|
118
|
-
Each card includes:
|
|
119
|
-
|
|
120
|
-
Product image
|
|
121
|
-
|
|
122
|
-
Title (bold, large text)
|
|
123
|
-
|
|
124
|
-
Description (smaller gray text)
|
|
125
|
-
|
|
126
|
-
Price (medium weight, prominent color)
|
|
127
|
-
|
|
128
|
-
“Add to Cart” button with hover effect
|
|
129
|
-
|
|
130
|
-
Apply appropriate spacing, alignment, and sizing
|
|
131
|
-
|
|
132
|
-
### Example Response
|
|
133
|
-
|
|
134
|
-
```html
|
|
135
|
-
<div class="grid grid-1-p grid-2-t grid-4-d gap-20 p40">
|
|
136
|
-
<!-- Card -->
|
|
137
|
-
<div class="bg-white border-gray-200 p20">
|
|
138
|
-
<img src="https://via.placeholder.com/300x200" class="width-100 mb10" alt="Product">
|
|
139
|
-
<div class="text-xl text-900 mb5">Product Title</div>
|
|
140
|
-
<div class="text-sm text-gray-600 mb10">Short product description goes here.</div>
|
|
141
|
-
<div class="text-md text-blue-700 text-500 mb15">$29.99</div>
|
|
142
|
-
<button class="bg-blue-500 text-white p10 bg-blue-600--hover">Add to Cart</button>
|
|
143
|
-
</div>
|
|
144
|
-
|
|
145
|
-
<!-- Repeat as needed -->
|
|
146
|
-
<div class="bg-white border-gray-200 p20">
|
|
147
|
-
<img src="https://via.placeholder.com/300x200" class="width-100 mb10" alt="Product">
|
|
148
|
-
<div class="text-xl text-900 mb5">Another Product</div>
|
|
149
|
-
<div class="text-sm text-gray-600 mb10">Another short description.</div>
|
|
150
|
-
<div class="text-md text-blue-700 text-500 mb15">$39.99</div>
|
|
151
|
-
<button class="bg-blue-500 text-white p10 bg-blue-600--hover">Add to Cart</button>
|
|
152
|
-
</div>
|
|
153
|
-
|
|
154
|
-
<!-- Add more cards as needed -->
|
|
155
|
-
</div>
|
|
156
|
-
```
|
package/ui/build.js
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { writeFileSync, readFileSync } from 'fs';
|
|
2
|
-
import { join } from 'path';
|
|
3
|
-
import { build, getAllFiles, combineFiles } from '@awesomeness-js/utils';
|
|
4
|
-
import { dynamicCSS } from './core/css/dynamic.js';
|
|
5
|
-
import { fileURLToPath } from 'url';
|
|
6
|
-
import { dirname } from 'path';
|
|
7
|
-
import cssnano from 'cssnano';
|
|
8
|
-
import postcss from 'postcss';
|
|
9
|
-
|
|
10
|
-
async function minifyCSS(cssString) {
|
|
11
|
-
|
|
12
|
-
try {
|
|
13
|
-
|
|
14
|
-
// Process the CSS using PostCSS and cssnano plugin
|
|
15
|
-
const result = await postcss([ cssnano ]).process(cssString, { from: undefined });
|
|
16
|
-
|
|
17
|
-
return result.css; // The minified CSS
|
|
18
|
-
|
|
19
|
-
} catch (error) {
|
|
20
|
-
|
|
21
|
-
console.error('Error minifying CSS:', error);
|
|
22
|
-
|
|
23
|
-
return null;
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
async function buildUI(){
|
|
31
|
-
|
|
32
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
33
|
-
const __dirname = dirname(__filename);
|
|
34
|
-
const coreDir = join(__dirname, 'core');
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
await build({
|
|
38
|
-
src: './awesomeness-ui/components',
|
|
39
|
-
dest: './ui-intellisense.js',
|
|
40
|
-
dts: false,
|
|
41
|
-
fileTypes: [ 'js' ],
|
|
42
|
-
ignore: [
|
|
43
|
-
'*.iif.js',
|
|
44
|
-
'*.jquery.js',
|
|
45
|
-
'*.jQuery.js',
|
|
46
|
-
'*.test.js',
|
|
47
|
-
'*.css',
|
|
48
|
-
'*.css.js'
|
|
49
|
-
]
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const cssBuilds = getAllFiles('.', {
|
|
54
|
-
dir: './awesomeness-ui/components',
|
|
55
|
-
fileTypes: [
|
|
56
|
-
'css.js'
|
|
57
|
-
]
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
if(cssBuilds.length > 0){
|
|
62
|
-
|
|
63
|
-
await Promise.all(cssBuilds.map(async (file) => {
|
|
64
|
-
|
|
65
|
-
try {
|
|
66
|
-
|
|
67
|
-
const { cssBuild } = await import(`../${file}`);
|
|
68
|
-
|
|
69
|
-
await cssBuild();
|
|
70
|
-
|
|
71
|
-
} catch (e) {
|
|
72
|
-
|
|
73
|
-
console.error(`Error importing CSS build file: ${file}`, e);
|
|
74
|
-
|
|
75
|
-
return;
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}));
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
// must be done in order
|
|
86
|
-
let js = `
|
|
87
|
-
/**
|
|
88
|
-
* This file is auto-generated by Awesomeness UI build script.
|
|
89
|
-
* It consolidates UI functions for use in the application.
|
|
90
|
-
* Do not edit manually.
|
|
91
|
-
*/
|
|
92
|
-
window.ui = {};
|
|
93
|
-
|
|
94
|
-
`;
|
|
95
|
-
|
|
96
|
-
js += readFileSync(join(coreDir, 'js', 'jquery-3.7.1.min.js'), 'utf8');
|
|
97
|
-
js += "\n " + readFileSync(join(coreDir, 'js', 'app.js'), 'utf8');
|
|
98
|
-
js += "\n " + combineFiles(join(coreDir, 'js', 'app'), 'js');
|
|
99
|
-
|
|
100
|
-
writeFileSync(join(coreDir, 'public', 'app.js'), js);
|
|
101
|
-
|
|
102
|
-
let css = "";
|
|
103
|
-
|
|
104
|
-
css += combineFiles(join(coreDir, 'css'), 'css');
|
|
105
|
-
|
|
106
|
-
css += "\n";
|
|
107
|
-
|
|
108
|
-
// dynamic css
|
|
109
|
-
css += dynamicCSS();
|
|
110
|
-
|
|
111
|
-
const cssMini = await minifyCSS(css);
|
|
112
|
-
|
|
113
|
-
writeFileSync(join(coreDir, 'public', 'app.css'), cssMini);
|
|
114
|
-
|
|
115
|
-
return true;
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export default buildUI;
|