@bookklik/senangstart-css 0.2.7 → 0.2.9
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/dist/senangstart-css.js +9052 -2142
- package/dist/senangstart-css.min.js +1207 -119
- package/dist/senangstart-tw.js +170 -73
- package/dist/senangstart-tw.min.js +1 -1
- package/docs/guide/configuration.md +2 -2
- package/docs/guide/states.md +60 -0
- package/docs/ms/guide/configuration.md +2 -2
- package/docs/ms/guide/states.md +60 -0
- package/docs/ms/reference/colors.md +2 -2
- package/docs/ms/reference/space/height.md +10 -10
- package/docs/ms/reference/space/width.md +12 -12
- package/docs/public/assets/senangstart-css.min.js +1207 -119
- package/docs/public/llms.txt +28 -0
- package/docs/reference/colors.md +2 -2
- package/docs/reference/space/height.md +10 -10
- package/docs/reference/space/width.md +12 -12
- package/package.json +1 -1
- package/public/senangstart.css +1196 -0
- package/scripts/convert-tailwind.js +191 -68
- package/scripts/generate-llms-txt.js +28 -0
- package/src/cdn/senangstart-engine.js +36 -2268
- package/src/cdn/tw-conversion-engine.js +203 -74
- package/src/compiler/generators/css.js +309 -249
- package/src/compiler/parser.js +14 -4
- package/src/compiler/tokenizer.js +0 -1
- package/src/config/defaults.js +1 -1
- package/src/core/constants.js +5 -3
- package/src/core/tokenizer-core.js +3 -58
- package/src/definitions/index.js +3 -2
- package/src/definitions/layout.js +6 -2
- package/src/definitions/space.js +45 -19
- package/src/index.js +47 -0
- package/src/utils/common.js +27 -0
- package/templates/senangstart.config.js +1 -1
- package/tests/helpers/test-utils.js +1 -1
- package/tests/integration/compiler.test.js +12 -1
- package/tests/unit/compiler/generators/css.coverage.test.js +833 -0
- package/tests/unit/compiler/generators/css.test.js +1418 -1
- package/tests/unit/compiler/generators/preflight.test.js +31 -0
- package/tests/unit/compiler/parser.test.js +26 -0
- package/tests/unit/config/defaults.test.js +2 -2
- package/tests/unit/convert-tailwind.cli.test.js +95 -0
- package/tests/unit/convert-tailwind.coverage.test.js +225 -0
- package/tests/unit/convert-tailwind.test.js +49 -20
- package/tests/unit/core/tokenizer-core.test.js +102 -0
- package/tests/unit/definitions/index.test.js +108 -0
- package/tests/unit/definitions/layout_definitions.test.js +40 -0
- package/tests/unit/utils/common.test.js +26 -0
- package/scripts/bundle-jit.js +0 -45
package/docs/public/llms.txt
CHANGED
|
@@ -73,6 +73,34 @@ Example: `space="p:small tab:p:medium lap:p:big"`
|
|
|
73
73
|
- `active:`, `disabled:`, `group-hover:`
|
|
74
74
|
- `dark:`: `visual="bg:white dark:bg:slate-900"`
|
|
75
75
|
|
|
76
|
+
## State Capabilities & Interaction
|
|
77
|
+
|
|
78
|
+
React to parent ("Group") or sibling ("Peer") states across all attributes.
|
|
79
|
+
|
|
80
|
+
### 1. Group Capabilities
|
|
81
|
+
Add these to the `layout` attribute of a parent element:
|
|
82
|
+
- `hoverable`: Adds `:hover` support.
|
|
83
|
+
- `focusable`: Adds `:focus-within` support.
|
|
84
|
+
- `pressable`: Adds `:active` support.
|
|
85
|
+
- `expandable`: Reacts to `[aria-expanded="true"]`.
|
|
86
|
+
- `selectable`: Reacts to `[aria-selected="true"]`.
|
|
87
|
+
|
|
88
|
+
**Example:**
|
|
89
|
+
```html
|
|
90
|
+
<div layout="flex hoverable" visual="bg:white">
|
|
91
|
+
<p visual="text:grey hover:text:primary">Hover parent to change me</p>
|
|
92
|
+
</div>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### 2. Peer Interactions
|
|
96
|
+
Use `interact="[id]"` on the trigger and `listens="[id]"` on the receiver.
|
|
97
|
+
|
|
98
|
+
**Example:**
|
|
99
|
+
```html
|
|
100
|
+
<button layout="hoverable" interact="my-menu">Trigger</button>
|
|
101
|
+
<div layout="hidden hover:block" listens="my-menu">Target</div>
|
|
102
|
+
```
|
|
103
|
+
|
|
76
104
|
## Configuration
|
|
77
105
|
Use `senangstart.config.js` to override defaults.
|
|
78
106
|
```js
|
package/docs/reference/colors.md
CHANGED
|
@@ -12,7 +12,7 @@ Complete reference for the color palette.
|
|
|
12
12
|
| `dark` | #3E4A5D | **Brand dark** |
|
|
13
13
|
| `light` | #DBEAFE | **Brand light** |
|
|
14
14
|
| `primary` | #2563EB | **Brand primary** |
|
|
15
|
-
| `secondary` | #
|
|
15
|
+
| `secondary` | #1E40AF | **Brand secondary** |
|
|
16
16
|
| `success` | #10B981 | Positive feedback |
|
|
17
17
|
| `warning` | #F59E0B | Cautions |
|
|
18
18
|
| `danger` | #EF4444 | Errors |
|
|
@@ -104,7 +104,7 @@ Add custom colors in `senangstart.config.js`:
|
|
|
104
104
|
export default {
|
|
105
105
|
theme: {
|
|
106
106
|
colors: {
|
|
107
|
-
'brand': '#
|
|
107
|
+
'brand': '#38BDF8',
|
|
108
108
|
'accent': '#EC4899',
|
|
109
109
|
'muted': '#9CA3AF',
|
|
110
110
|
'surface': '#F9FAFB'
|
|
@@ -17,16 +17,16 @@ space="h:[value]"
|
|
|
17
17
|
|
|
18
18
|
## Scale Values
|
|
19
19
|
|
|
20
|
-
`none`, `thin`, `regular`, `thick`, `tiny`, `tiny-2x`, `small`, `small-2x`, `small-3x`, `small-4x`, `medium`, `medium-2x`, `medium-3x`, `medium-4x`, `large`, `large-2x`, `large-3x`, `large-4x`, `big`, `big-2x`, `big-3x`, `big-4x`, `giant`, `giant-2x`, `giant-3x`, `giant-4x`, `vast`, `vast-2x`, `vast-3x`, `vast-4x`, `vast-5x`, `vast-6x`, `vast-7x`, `vast-8x`, `vast-9x`, `vast-10x`, `min`, `max`, `fit`
|
|
20
|
+
`none`, `thin`, `regular`, `thick`, `tiny`, `tiny-2x`, `small`, `small-2x`, `small-3x`, `small-4x`, `medium`, `medium-2x`, `medium-3x`, `medium-4x`, `large`, `large-2x`, `large-3x`, `large-4x`, `big`, `big-2x`, `big-3x`, `big-4x`, `giant`, `giant-2x`, `giant-3x`, `giant-4x`, `vast`, `vast-2x`, `vast-3x`, `vast-4x`, `vast-5x`, `vast-6x`, `vast-7x`, `vast-8x`, `vast-9x`, `vast-10x`, `min`, `max`, `fit`, `full`, `half`, `third`, `third-2x`, `quarter`, `quarter-2x`, `quarter-3x`, `1/1`, `1/2`, `1/3`, `2/3`, `1/4`, `2/4`, `3/4`
|
|
21
21
|
|
|
22
22
|
## Examples
|
|
23
23
|
|
|
24
24
|
```html
|
|
25
|
+
<div space="h:full">Full height</div>
|
|
26
|
+
<div space="h:half">Half height</div>
|
|
25
27
|
<div space="h:[100vh]">Full viewport height</div>
|
|
26
28
|
<div space="min-h:[400px]">Min height</div>
|
|
27
29
|
<div space="h:max">Content height</div>
|
|
28
|
-
<div space="max-h:max">Max content height</div>
|
|
29
|
-
<div space="min-h:min">Min content height</div>
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
## Preview
|
|
@@ -36,11 +36,11 @@ space="h:[value]"
|
|
|
36
36
|
### Height Control
|
|
37
37
|
|
|
38
38
|
<div layout="flex col" space="g:medium">
|
|
39
|
-
<p space="m:none" visual="text:neutral-600 dark:text:neutral-400 text-sm"><code>space="h:
|
|
39
|
+
<p space="m:none" visual="text:neutral-600 dark:text:neutral-400 text-sm"><code>space="h:full"</code> - Set fixed heights</p>
|
|
40
40
|
<div layout="flex" space="g:small p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium" style="height: 120px;">
|
|
41
|
-
<div space="h:
|
|
42
|
-
<div space="h:
|
|
43
|
-
<div space="h:
|
|
41
|
+
<div space="h:full p:small" visual="bg:primary text:white rounded:small" layout="flex center">h:full</div>
|
|
42
|
+
<div space="h:third-2x p:small" visual="bg:primary text:white rounded:small" layout="flex center">h:third-2x</div>
|
|
43
|
+
<div space="h:half p:small" visual="bg:primary text:white rounded:small" layout="flex center">h:half</div>
|
|
44
44
|
</div>
|
|
45
45
|
</div>
|
|
46
46
|
|
|
@@ -49,9 +49,9 @@ space="h:[value]"
|
|
|
49
49
|
|
|
50
50
|
```html
|
|
51
51
|
<div layout="flex" space="g:small p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium" style="height: 120px;">
|
|
52
|
-
<div space="h:
|
|
53
|
-
<div space="h:
|
|
54
|
-
<div space="h:
|
|
52
|
+
<div space="h:full p:small" visual="bg:primary text:white rounded:small" layout="flex center">h:full</div>
|
|
53
|
+
<div space="h:third-2x p:small" visual="bg:primary text:white rounded:small" layout="flex center">h:third-2x</div>
|
|
54
|
+
<div space="h:half p:small" visual="bg:primary text:white rounded:small" layout="flex center">h:half</div>
|
|
55
55
|
</div>
|
|
56
56
|
```
|
|
57
57
|
|
|
@@ -17,17 +17,17 @@ space="w:[value]"
|
|
|
17
17
|
|
|
18
18
|
## Scale Values
|
|
19
19
|
|
|
20
|
-
`none`, `thin`, `regular`, `thick`, `tiny`, `tiny-2x`, `small`, `small-2x`, `small-3x`, `small-4x`, `medium`, `medium-2x`, `medium-3x`, `medium-4x`, `large`, `large-2x`, `large-3x`, `large-4x`, `big`, `big-2x`, `big-3x`, `big-4x`, `giant`, `giant-2x`, `giant-3x`, `giant-4x`, `vast`, `vast-2x`, `vast-3x`, `vast-4x`, `vast-5x`, `vast-6x`, `vast-7x`, `vast-8x`, `vast-9x`, `vast-10x`, `min`, `max`, `fit`
|
|
20
|
+
`none`, `thin`, `regular`, `thick`, `tiny`, `tiny-2x`, `small`, `small-2x`, `small-3x`, `small-4x`, `medium`, `medium-2x`, `medium-3x`, `medium-4x`, `large`, `large-2x`, `large-3x`, `large-4x`, `big`, `big-2x`, `big-3x`, `big-4x`, `giant`, `giant-2x`, `giant-3x`, `giant-4x`, `vast`, `vast-2x`, `vast-3x`, `vast-4x`, `vast-5x`, `vast-6x`, `vast-7x`, `vast-8x`, `vast-9x`, `vast-10x`, `min`, `max`, `fit`, `full`, `half`, `third`, `third-2x`, `quarter`, `quarter-2x`, `quarter-3x`, `1/1`, `1/2`, `1/3`, `2/3`, `1/4`, `2/4`, `3/4`
|
|
21
21
|
|
|
22
22
|
## Examples
|
|
23
23
|
|
|
24
24
|
```html
|
|
25
|
-
<div space="w:
|
|
25
|
+
<div space="w:full">Full width</div>
|
|
26
|
+
<div space="w:half">Half width</div>
|
|
27
|
+
<div space="w:third">Third width</div>
|
|
28
|
+
<div space="w:quarter-3x">Three quarters</div>
|
|
26
29
|
<div space="max-w:[1200px]">Max width container</div>
|
|
27
|
-
<div space="min-w:[300px]">Min width</div>
|
|
28
30
|
<div space="w:max">Content width</div>
|
|
29
|
-
<div space="max-w:max">Max content width</div>
|
|
30
|
-
<div space="min-w:min">Min content width</div>
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
## Preview
|
|
@@ -37,11 +37,11 @@ space="w:[value]"
|
|
|
37
37
|
### Width Control
|
|
38
38
|
|
|
39
39
|
<div layout="flex col" space="g:medium">
|
|
40
|
-
<p space="m:none" visual="text:neutral-600 dark:text:neutral-400 text-sm"><code>space="w:
|
|
40
|
+
<p space="m:none" visual="text:neutral-600 dark:text:neutral-400 text-sm"><code>space="w:full"</code> - Set fixed or percentage widths</p>
|
|
41
41
|
<div layout="flex col" space="g:small p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium">
|
|
42
|
-
<div space="w:
|
|
43
|
-
<div space="w:
|
|
44
|
-
<div space="w:
|
|
42
|
+
<div space="w:full p:small" visual="bg:primary text:white rounded:small">w:full</div>
|
|
43
|
+
<div space="w:quarter-3x p:small" visual="bg:primary text:white rounded:small">w:quarter-3x</div>
|
|
44
|
+
<div space="w:half p:small" visual="bg:primary text:white rounded:small">w:half</div>
|
|
45
45
|
</div>
|
|
46
46
|
</div>
|
|
47
47
|
|
|
@@ -50,9 +50,9 @@ space="w:[value]"
|
|
|
50
50
|
|
|
51
51
|
```html
|
|
52
52
|
<div layout="flex col" space="g:small p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium">
|
|
53
|
-
<div space="w:
|
|
54
|
-
<div space="w:
|
|
55
|
-
<div space="w:
|
|
53
|
+
<div space="w:full p:small" visual="bg:primary text:white rounded:small">w:full</div>
|
|
54
|
+
<div space="w:quarter-3x p:small" visual="bg:primary text:white rounded:small">w:quarter-3x</div>
|
|
55
|
+
<div space="w:half p:small" visual="bg:primary text:white rounded:small">w:half</div>
|
|
56
56
|
</div>
|
|
57
57
|
```
|
|
58
58
|
|