@bookklik/senangstart-css 0.1.1 → 0.1.2

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 (137) hide show
  1. package/.github/workflows/deploy-docs.yml +55 -0
  2. package/dist/senangstart-css.js +503 -0
  3. package/dist/senangstart-css.min.js +375 -0
  4. package/docs/.vitepress/cache/deps/_metadata.json +52 -0
  5. package/docs/.vitepress/cache/deps/chunk-2CLQ7TTZ.js +9719 -0
  6. package/docs/.vitepress/cache/deps/chunk-2CLQ7TTZ.js.map +7 -0
  7. package/docs/.vitepress/cache/deps/chunk-LE5NDSFD.js +12824 -0
  8. package/docs/.vitepress/cache/deps/chunk-LE5NDSFD.js.map +7 -0
  9. package/docs/.vitepress/cache/deps/package.json +3 -0
  10. package/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js +4505 -0
  11. package/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js.map +7 -0
  12. package/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js +583 -0
  13. package/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js.map +7 -0
  14. package/docs/.vitepress/cache/deps/vitepress___@vueuse_integrations_useFocusTrap.js +1333 -0
  15. package/docs/.vitepress/cache/deps/vitepress___@vueuse_integrations_useFocusTrap.js.map +7 -0
  16. package/docs/.vitepress/cache/deps/vitepress___mark__js_src_vanilla__js.js +1665 -0
  17. package/docs/.vitepress/cache/deps/vitepress___mark__js_src_vanilla__js.js.map +7 -0
  18. package/docs/.vitepress/cache/deps/vitepress___minisearch.js +1813 -0
  19. package/docs/.vitepress/cache/deps/vitepress___minisearch.js.map +7 -0
  20. package/docs/.vitepress/cache/deps/vue.js +347 -0
  21. package/docs/.vitepress/cache/deps/vue.js.map +7 -0
  22. package/docs/.vitepress/config.js +108 -0
  23. package/docs/.vitepress/dist/404.html +22 -0
  24. package/docs/.vitepress/dist/assets/app.BTYj1wZj.js +1 -0
  25. package/docs/.vitepress/dist/assets/chunks/@localSearchIndexroot.DmMP4oUp.js +1 -0
  26. package/docs/.vitepress/dist/assets/chunks/VPLocalSearchBox.jxQ0k_uL.js +9 -0
  27. package/docs/.vitepress/dist/assets/chunks/framework.qISVh_QZ.js +19 -0
  28. package/docs/.vitepress/dist/assets/chunks/theme.B9Wtbwgj.js +2 -0
  29. package/docs/.vitepress/dist/assets/examples_cards.md.D4i0phvj.js +84 -0
  30. package/docs/.vitepress/dist/assets/examples_cards.md.D4i0phvj.lean.js +1 -0
  31. package/docs/.vitepress/dist/assets/examples_forms.md.BnsjqHST.js +169 -0
  32. package/docs/.vitepress/dist/assets/examples_forms.md.BnsjqHST.lean.js +1 -0
  33. package/docs/.vitepress/dist/assets/examples_hero.md.CCcb2x8Y.js +118 -0
  34. package/docs/.vitepress/dist/assets/examples_hero.md.CCcb2x8Y.lean.js +1 -0
  35. package/docs/.vitepress/dist/assets/examples_index.md.CcyXbirn.js +52 -0
  36. package/docs/.vitepress/dist/assets/examples_index.md.CcyXbirn.lean.js +1 -0
  37. package/docs/.vitepress/dist/assets/examples_navigation.md.CppyHbnP.js +106 -0
  38. package/docs/.vitepress/dist/assets/examples_navigation.md.CppyHbnP.lean.js +1 -0
  39. package/docs/.vitepress/dist/assets/guide_cdn.md.CANCjnm5.js +30 -0
  40. package/docs/.vitepress/dist/assets/guide_cdn.md.CANCjnm5.lean.js +1 -0
  41. package/docs/.vitepress/dist/assets/guide_cli.md.zXEKk-bu.js +44 -0
  42. package/docs/.vitepress/dist/assets/guide_cli.md.zXEKk-bu.lean.js +1 -0
  43. package/docs/.vitepress/dist/assets/guide_configuration.md.D2JZzhKm.js +79 -0
  44. package/docs/.vitepress/dist/assets/guide_configuration.md.D2JZzhKm.lean.js +1 -0
  45. package/docs/.vitepress/dist/assets/guide_getting-started.md.tO7bvmZd.js +47 -0
  46. package/docs/.vitepress/dist/assets/guide_getting-started.md.tO7bvmZd.lean.js +1 -0
  47. package/docs/.vitepress/dist/assets/guide_index.md.C1xk2lBl.js +3 -0
  48. package/docs/.vitepress/dist/assets/guide_index.md.C1xk2lBl.lean.js +1 -0
  49. package/docs/.vitepress/dist/assets/guide_natural-scale.md.D1oVRN5V.js +22 -0
  50. package/docs/.vitepress/dist/assets/guide_natural-scale.md.D1oVRN5V.lean.js +1 -0
  51. package/docs/.vitepress/dist/assets/guide_philosophy.md.DPyyMH8d.js +7 -0
  52. package/docs/.vitepress/dist/assets/guide_philosophy.md.DPyyMH8d.lean.js +1 -0
  53. package/docs/.vitepress/dist/assets/guide_responsive.md.wksOAMT5.js +57 -0
  54. package/docs/.vitepress/dist/assets/guide_responsive.md.wksOAMT5.lean.js +1 -0
  55. package/docs/.vitepress/dist/assets/guide_states.md.DRjYOZDJ.js +77 -0
  56. package/docs/.vitepress/dist/assets/guide_states.md.DRjYOZDJ.lean.js +1 -0
  57. package/docs/.vitepress/dist/assets/guide_tri-attribute.md.CoFqfmPZ.js +45 -0
  58. package/docs/.vitepress/dist/assets/guide_tri-attribute.md.CoFqfmPZ.lean.js +1 -0
  59. package/docs/.vitepress/dist/assets/index.md.CUZJzNzP.js +7 -0
  60. package/docs/.vitepress/dist/assets/index.md.CUZJzNzP.lean.js +1 -0
  61. package/docs/.vitepress/dist/assets/inter-italic-cyrillic-ext.r48I6akx.woff2 +0 -0
  62. package/docs/.vitepress/dist/assets/inter-italic-cyrillic.By2_1cv3.woff2 +0 -0
  63. package/docs/.vitepress/dist/assets/inter-italic-greek-ext.1u6EdAuj.woff2 +0 -0
  64. package/docs/.vitepress/dist/assets/inter-italic-greek.DJ8dCoTZ.woff2 +0 -0
  65. package/docs/.vitepress/dist/assets/inter-italic-latin-ext.CN1xVJS-.woff2 +0 -0
  66. package/docs/.vitepress/dist/assets/inter-italic-latin.C2AdPX0b.woff2 +0 -0
  67. package/docs/.vitepress/dist/assets/inter-italic-vietnamese.BSbpV94h.woff2 +0 -0
  68. package/docs/.vitepress/dist/assets/inter-roman-cyrillic-ext.BBPuwvHQ.woff2 +0 -0
  69. package/docs/.vitepress/dist/assets/inter-roman-cyrillic.C5lxZ8CY.woff2 +0 -0
  70. package/docs/.vitepress/dist/assets/inter-roman-greek-ext.CqjqNYQ-.woff2 +0 -0
  71. package/docs/.vitepress/dist/assets/inter-roman-greek.BBVDIX6e.woff2 +0 -0
  72. package/docs/.vitepress/dist/assets/inter-roman-latin-ext.4ZJIpNVo.woff2 +0 -0
  73. package/docs/.vitepress/dist/assets/inter-roman-latin.Di8DUHzh.woff2 +0 -0
  74. package/docs/.vitepress/dist/assets/inter-roman-vietnamese.BjW4sHH5.woff2 +0 -0
  75. package/docs/.vitepress/dist/assets/reference_breakpoints.md.BEhuwXBS.js +48 -0
  76. package/docs/.vitepress/dist/assets/reference_breakpoints.md.BEhuwXBS.lean.js +1 -0
  77. package/docs/.vitepress/dist/assets/reference_colors.md.Do4abjs1.js +29 -0
  78. package/docs/.vitepress/dist/assets/reference_colors.md.Do4abjs1.lean.js +1 -0
  79. package/docs/.vitepress/dist/assets/reference_layout.md.DqSoofMZ.js +13 -0
  80. package/docs/.vitepress/dist/assets/reference_layout.md.DqSoofMZ.lean.js +1 -0
  81. package/docs/.vitepress/dist/assets/reference_space.md.luOYAfQg.js +24 -0
  82. package/docs/.vitepress/dist/assets/reference_space.md.luOYAfQg.lean.js +1 -0
  83. package/docs/.vitepress/dist/assets/reference_spacing.md.DdsDhDhS.js +32 -0
  84. package/docs/.vitepress/dist/assets/reference_spacing.md.DdsDhDhS.lean.js +1 -0
  85. package/docs/.vitepress/dist/assets/reference_visual.md.DZFvxgPk.js +22 -0
  86. package/docs/.vitepress/dist/assets/reference_visual.md.DZFvxgPk.lean.js +1 -0
  87. package/docs/.vitepress/dist/assets/style.BuMqNgkb.css +1 -0
  88. package/docs/.vitepress/dist/examples/cards.html +108 -0
  89. package/docs/.vitepress/dist/examples/forms.html +193 -0
  90. package/docs/.vitepress/dist/examples/hero.html +142 -0
  91. package/docs/.vitepress/dist/examples/index.html +76 -0
  92. package/docs/.vitepress/dist/examples/navigation.html +130 -0
  93. package/docs/.vitepress/dist/guide/cdn.html +54 -0
  94. package/docs/.vitepress/dist/guide/cli.html +68 -0
  95. package/docs/.vitepress/dist/guide/configuration.html +103 -0
  96. package/docs/.vitepress/dist/guide/getting-started.html +71 -0
  97. package/docs/.vitepress/dist/guide/index.html +27 -0
  98. package/docs/.vitepress/dist/guide/natural-scale.html +46 -0
  99. package/docs/.vitepress/dist/guide/philosophy.html +31 -0
  100. package/docs/.vitepress/dist/guide/responsive.html +81 -0
  101. package/docs/.vitepress/dist/guide/states.html +101 -0
  102. package/docs/.vitepress/dist/guide/tri-attribute.html +69 -0
  103. package/docs/.vitepress/dist/hashmap.json +1 -0
  104. package/docs/.vitepress/dist/index.html +31 -0
  105. package/docs/.vitepress/dist/reference/breakpoints.html +72 -0
  106. package/docs/.vitepress/dist/reference/colors.html +53 -0
  107. package/docs/.vitepress/dist/reference/layout.html +37 -0
  108. package/docs/.vitepress/dist/reference/space.html +48 -0
  109. package/docs/.vitepress/dist/reference/spacing.html +56 -0
  110. package/docs/.vitepress/dist/reference/visual.html +46 -0
  111. package/docs/.vitepress/dist/vp-icons.css +1 -0
  112. package/docs/.vitepress/theme/custom.css +65 -0
  113. package/docs/.vitepress/theme/index.js +4 -0
  114. package/docs/examples/cards.md +116 -0
  115. package/docs/examples/forms.md +207 -0
  116. package/docs/examples/hero.md +150 -0
  117. package/docs/examples/index.md +87 -0
  118. package/docs/examples/navigation.md +144 -0
  119. package/docs/guide/cdn.md +110 -0
  120. package/docs/guide/cli.md +174 -0
  121. package/docs/guide/configuration.md +152 -0
  122. package/docs/guide/getting-started.md +130 -0
  123. package/docs/guide/index.md +64 -0
  124. package/docs/guide/natural-scale.md +123 -0
  125. package/docs/guide/philosophy.md +103 -0
  126. package/docs/guide/responsive.md +129 -0
  127. package/docs/guide/states.md +162 -0
  128. package/docs/guide/tri-attribute.md +187 -0
  129. package/docs/index.md +64 -0
  130. package/docs/reference/breakpoints.md +131 -0
  131. package/docs/reference/colors.md +106 -0
  132. package/docs/reference/layout.md +115 -0
  133. package/docs/reference/space.md +121 -0
  134. package/docs/reference/spacing.md +74 -0
  135. package/docs/reference/visual.md +160 -0
  136. package/package.json +7 -13
  137. package/scripts/build-dist.js +49 -0
@@ -0,0 +1,375 @@
1
+ (function() {
2
+ 'use strict';
3
+ const defaultConfig = {
4
+ theme: {
5
+ spacing: {
6
+ 'none': '0px',
7
+ 'tiny': '4px',
8
+ 'small': '8px',
9
+ 'medium': '16px',
10
+ 'big': '32px',
11
+ 'giant': '64px',
12
+ 'vast': '128px'
13
+ },
14
+ radius: {
15
+ 'none': '0px',
16
+ 'small': '4px',
17
+ 'medium': '8px',
18
+ 'big': '16px',
19
+ 'round': '9999px'
20
+ },
21
+ shadow: {
22
+ 'none': 'none',
23
+ 'small': '0 1px 2px rgba(0,0,0,0.05)',
24
+ 'medium': '0 4px 6px rgba(0,0,0,0.1)',
25
+ 'big': '0 10px 15px rgba(0,0,0,0.15)',
26
+ 'giant': '0 25px 50px rgba(0,0,0,0.25)'
27
+ },
28
+ fontSize: {
29
+ 'tiny': '12px',
30
+ 'small': '14px',
31
+ 'medium': '16px',
32
+ 'big': '20px',
33
+ 'giant': '32px',
34
+ 'vast': '48px'
35
+ },
36
+ fontWeight: {
37
+ 'normal': '400',
38
+ 'medium': '500',
39
+ 'bold': '700'
40
+ },
41
+ screens: {
42
+ 'mob': '480px',
43
+ 'tab': '768px',
44
+ 'lap': '1024px',
45
+ 'desk': '1280px'
46
+ },
47
+ colors: {
48
+ 'white': '#FFFFFF',
49
+ 'black': '#000000',
50
+ 'grey': '#6B7280',
51
+ 'dark': '#3E4A5D',
52
+ 'light': '#DBEAFE',
53
+ 'primary': '#2563EB',
54
+ 'secondary': '#DBEAFE',
55
+ 'success': '#10B981',
56
+ 'warning': '#F59E0B',
57
+ 'danger': '#EF4444'
58
+ },
59
+ zIndex: {
60
+ 'base': '0',
61
+ 'low': '10',
62
+ 'mid': '50',
63
+ 'high': '100',
64
+ 'top': '9999'
65
+ }
66
+ }
67
+ };
68
+ function loadInlineConfig() {
69
+ const configEl = document.querySelector('script[type="senangstart/config"]');
70
+ if (!configEl) return {};
71
+ try {
72
+ return JSON.parse(configEl.textContent);
73
+ } catch (e) {
74
+ console.error('[SenangStart] Invalid config JSON:', e);
75
+ return {};
76
+ }
77
+ }
78
+ function mergeConfig(user) {
79
+ const merged = JSON.parse(JSON.stringify(defaultConfig));
80
+ if (user.theme) {
81
+ for (const key of Object.keys(merged.theme)) {
82
+ if (user.theme[key]) {
83
+ merged.theme[key] = { ...merged.theme[key], ...user.theme[key] };
84
+ }
85
+ }
86
+ }
87
+ return merged;
88
+ }
89
+ function generateCSSVariables(config) {
90
+ const { theme } = config;
91
+ let css = ':root {\n';
92
+ for (const [key, value] of Object.entries(theme.spacing)) {
93
+ css += ` --s-${key}: ${value};\n`;
94
+ }
95
+ for (const [key, value] of Object.entries(theme.radius)) {
96
+ css += ` --r-${key}: ${value};\n`;
97
+ }
98
+ for (const [key, value] of Object.entries(theme.shadow)) {
99
+ css += ` --shadow-${key}: ${value};\n`;
100
+ }
101
+ for (const [key, value] of Object.entries(theme.fontSize)) {
102
+ css += ` --font-${key}: ${value};\n`;
103
+ }
104
+ for (const [key, value] of Object.entries(theme.fontWeight)) {
105
+ css += ` --fw-${key}: ${value};\n`;
106
+ }
107
+ for (const [key, value] of Object.entries(theme.colors)) {
108
+ css += ` --c-${key}: ${value};\n`;
109
+ }
110
+ for (const [key, value] of Object.entries(theme.zIndex)) {
111
+ css += ` --z-${key}: ${value};\n`;
112
+ }
113
+ css += '}\n\n';
114
+ css += '*, *::before, *::after { box-sizing: border-box; }\n\n';
115
+ return css;
116
+ }
117
+ const layoutKeywords = {
118
+ 'flex': 'display: flex;',
119
+ 'grid': 'display: grid;',
120
+ 'block': 'display: block;',
121
+ 'inline': 'display: inline-block;',
122
+ 'hidden': 'display: none;',
123
+ 'row': 'flex-direction: row;',
124
+ 'col': 'flex-direction: column;',
125
+ 'row-reverse': 'flex-direction: row-reverse;',
126
+ 'col-reverse': 'flex-direction: column-reverse;',
127
+ 'center': 'justify-content: center; align-items: center;',
128
+ 'start': 'justify-content: flex-start; align-items: flex-start;',
129
+ 'end': 'justify-content: flex-end; align-items: flex-end;',
130
+ 'between': 'justify-content: space-between;',
131
+ 'around': 'justify-content: space-around;',
132
+ 'evenly': 'justify-content: space-evenly;',
133
+ 'wrap': 'flex-wrap: wrap;',
134
+ 'nowrap': 'flex-wrap: nowrap;',
135
+ 'absolute': 'position: absolute;',
136
+ 'relative': 'position: relative;',
137
+ 'fixed': 'position: fixed;',
138
+ 'sticky': 'position: sticky;'
139
+ };
140
+ const breakpoints = ['mob', 'tab', 'lap', 'desk'];
141
+ const states = ['hover', 'focus', 'active', 'disabled'];
142
+ function parseToken(raw) {
143
+ const token = {
144
+ raw,
145
+ breakpoint: null,
146
+ state: null,
147
+ property: null,
148
+ value: null,
149
+ isArbitrary: false
150
+ };
151
+ const parts = raw.split(':');
152
+ let idx = 0;
153
+ if (breakpoints.includes(parts[0])) {
154
+ token.breakpoint = parts[0];
155
+ idx++;
156
+ }
157
+ if (states.includes(parts[idx])) {
158
+ token.state = parts[idx];
159
+ idx++;
160
+ }
161
+ if (idx < parts.length) {
162
+ token.property = parts[idx];
163
+ idx++;
164
+ }
165
+ if (idx < parts.length) {
166
+ let value = parts.slice(idx).join(':');
167
+ const arbitraryMatch = value.match(/^\[(.+)\]$/);
168
+ if (arbitraryMatch) {
169
+ token.value = arbitraryMatch[1].replace(/_/g, ' ');
170
+ token.isArbitrary = true;
171
+ } else {
172
+ token.value = value;
173
+ }
174
+ }
175
+ return token;
176
+ }
177
+ function generateLayoutRule(token) {
178
+ const { property, value } = token;
179
+ if (property === 'z') {
180
+ return `z-index: var(--z-${value});`;
181
+ }
182
+ if (property === 'overflow') {
183
+ return `overflow: ${value};`;
184
+ }
185
+ return layoutKeywords[property] || '';
186
+ }
187
+ function generateSpaceRule(token) {
188
+ const { property, value, isArbitrary } = token;
189
+ if (value === 'auto') {
190
+ const autoMap = {
191
+ 'm': 'margin: auto;',
192
+ 'm-x': 'margin-left: auto; margin-right: auto;',
193
+ 'm-y': 'margin-top: auto; margin-bottom: auto;',
194
+ 'm-t': 'margin-top: auto;',
195
+ 'm-r': 'margin-right: auto;',
196
+ 'm-b': 'margin-bottom: auto;',
197
+ 'm-l': 'margin-left: auto;'
198
+ };
199
+ return autoMap[property] || '';
200
+ }
201
+ const cssValue = isArbitrary ? value : `var(--s-${value})`;
202
+ const map = {
203
+ 'p': `padding: ${cssValue};`,
204
+ 'p-t': `padding-top: ${cssValue};`,
205
+ 'p-r': `padding-right: ${cssValue};`,
206
+ 'p-b': `padding-bottom: ${cssValue};`,
207
+ 'p-l': `padding-left: ${cssValue};`,
208
+ 'p-x': `padding-left: ${cssValue}; padding-right: ${cssValue};`,
209
+ 'p-y': `padding-top: ${cssValue}; padding-bottom: ${cssValue};`,
210
+ 'm': `margin: ${cssValue};`,
211
+ 'm-t': `margin-top: ${cssValue};`,
212
+ 'm-r': `margin-right: ${cssValue};`,
213
+ 'm-b': `margin-bottom: ${cssValue};`,
214
+ 'm-l': `margin-left: ${cssValue};`,
215
+ 'm-x': `margin-left: ${cssValue}; margin-right: ${cssValue};`,
216
+ 'm-y': `margin-top: ${cssValue}; margin-bottom: ${cssValue};`,
217
+ 'g': `gap: ${cssValue};`,
218
+ 'g-x': `column-gap: ${cssValue};`,
219
+ 'g-y': `row-gap: ${cssValue};`,
220
+ 'w': `width: ${cssValue};`,
221
+ 'h': `height: ${cssValue};`,
222
+ 'min-w': `min-width: ${cssValue};`,
223
+ 'max-w': `max-width: ${cssValue};`,
224
+ 'min-h': `min-height: ${cssValue};`,
225
+ 'max-h': `max-height: ${cssValue};`
226
+ };
227
+ return map[property] || '';
228
+ }
229
+ function generateVisualRule(token) {
230
+ const { property, value, isArbitrary } = token;
231
+ const rules = {
232
+ 'bg': () => {
233
+ const cssValue = isArbitrary ? value : `var(--c-${value})`;
234
+ return `background-color: ${cssValue};`;
235
+ },
236
+ 'text': () => {
237
+ if (['left', 'center', 'right'].includes(value)) {
238
+ return `text-align: ${value};`;
239
+ }
240
+ const cssValue = isArbitrary ? value : `var(--c-${value})`;
241
+ return `color: ${cssValue};`;
242
+ },
243
+ 'text-size': () => {
244
+ const cssValue = isArbitrary ? value : `var(--font-${value})`;
245
+ return `font-size: ${cssValue};`;
246
+ },
247
+ 'font': () => `font-weight: var(--fw-${value});`,
248
+ 'border': () => {
249
+ const cssValue = isArbitrary ? value : `var(--c-${value})`;
250
+ return `border-color: ${cssValue}; border-style: solid;`;
251
+ },
252
+ 'border-w': () => {
253
+ const cssValue = isArbitrary ? value : `var(--s-${value})`;
254
+ return `border-width: ${cssValue}; border-style: solid;`;
255
+ },
256
+ 'rounded': () => `border-radius: var(--r-${value});`,
257
+ 'shadow': () => `box-shadow: var(--shadow-${value});`,
258
+ 'opacity': () => `opacity: ${value};`
259
+ };
260
+ const gen = rules[property];
261
+ return gen ? gen() : '';
262
+ }
263
+ function generateRule(raw, attrType) {
264
+ if (attrType === 'layout' && layoutKeywords[raw]) {
265
+ return `[layout~="${raw}"] { ${layoutKeywords[raw]} }\n`;
266
+ }
267
+ const token = parseToken(raw);
268
+ let cssDeclaration = '';
269
+ switch (attrType) {
270
+ case 'layout':
271
+ cssDeclaration = generateLayoutRule(token);
272
+ break;
273
+ case 'space':
274
+ cssDeclaration = generateSpaceRule(token);
275
+ break;
276
+ case 'visual':
277
+ cssDeclaration = generateVisualRule(token);
278
+ break;
279
+ }
280
+ if (!cssDeclaration) return '';
281
+ let selector = `[${attrType}~="${raw}"]`;
282
+ if (token.state) {
283
+ selector += `:${token.state}`;
284
+ }
285
+ return `${selector} { ${cssDeclaration} }\n`;
286
+ }
287
+ function scanDOM() {
288
+ const tokens = {
289
+ layout: new Set(),
290
+ space: new Set(),
291
+ visual: new Set()
292
+ };
293
+ const elements = document.querySelectorAll('[layout], [space], [visual]');
294
+ elements.forEach(el => {
295
+ ['layout', 'space', 'visual'].forEach(attr => {
296
+ const value = el.getAttribute(attr);
297
+ if (value) {
298
+ value.split(/\s+/).forEach(token => {
299
+ if (token) tokens[attr].add(token);
300
+ });
301
+ }
302
+ });
303
+ });
304
+ return tokens;
305
+ }
306
+ function compileCSS(tokens, config) {
307
+ let css = generateCSSVariables(config);
308
+ const baseRules = [];
309
+ const mediaRules = {
310
+ mob: [],
311
+ tab: [],
312
+ lap: [],
313
+ desk: []
314
+ };
315
+ for (const [attrType, values] of Object.entries(tokens)) {
316
+ for (const raw of values) {
317
+ const rule = generateRule(raw, attrType);
318
+ if (rule) {
319
+ const bpMatch = raw.match(/^(mob|tab|lap|desk):/);
320
+ if (bpMatch) {
321
+ mediaRules[bpMatch[1]].push(rule);
322
+ } else {
323
+ baseRules.push(rule);
324
+ }
325
+ }
326
+ }
327
+ }
328
+ css += baseRules.join('');
329
+ const { screens } = config.theme;
330
+ for (const [bp, rules] of Object.entries(mediaRules)) {
331
+ if (rules.length > 0) {
332
+ css += `\n@media (min-width: ${screens[bp]}) {\n`;
333
+ css += rules.map(r => ' ' + r).join('');
334
+ css += '}\n';
335
+ }
336
+ }
337
+ return css;
338
+ }
339
+ function injectStyles(css) {
340
+ let styleEl = document.getElementById('senangstart-jit');
341
+ if (!styleEl) {
342
+ styleEl = document.createElement('style');
343
+ styleEl.id = 'senangstart-jit';
344
+ document.head.appendChild(styleEl);
345
+ }
346
+ styleEl.textContent = css;
347
+ }
348
+ function init() {
349
+ const userConfig = loadInlineConfig();
350
+ const config = mergeConfig(userConfig);
351
+ const tokens = scanDOM();
352
+ const css = compileCSS(tokens, config);
353
+ injectStyles(css);
354
+ const observer = new MutationObserver(() => {
355
+ const newTokens = scanDOM();
356
+ const newCSS = compileCSS(newTokens, config);
357
+ injectStyles(newCSS);
358
+ });
359
+ observer.observe(document.body, {
360
+ childList: true,
361
+ subtree: true,
362
+ attributes: true,
363
+ attributeFilter: ['layout', 'space', 'visual']
364
+ });
365
+ console.log('%c[SenangStart CSS]%c JIT runtime initialized ✓',
366
+ 'color: #2563EB; font-weight: bold;',
367
+ 'color: #10B981;'
368
+ );
369
+ }
370
+ if (document.readyState === 'loading') {
371
+ document.addEventListener('DOMContentLoaded', init);
372
+ } else {
373
+ init();
374
+ }
375
+ })();
@@ -0,0 +1,52 @@
1
+ {
2
+ "hash": "503d8545",
3
+ "configHash": "7a659af5",
4
+ "lockfileHash": "148e5d09",
5
+ "browserHash": "31430ee1",
6
+ "optimized": {
7
+ "vue": {
8
+ "src": "../../../../node_modules/vue/dist/vue.runtime.esm-bundler.js",
9
+ "file": "vue.js",
10
+ "fileHash": "bb09d08e",
11
+ "needsInterop": false
12
+ },
13
+ "vitepress > @vue/devtools-api": {
14
+ "src": "../../../../node_modules/@vue/devtools-api/dist/index.js",
15
+ "file": "vitepress___@vue_devtools-api.js",
16
+ "fileHash": "1792716f",
17
+ "needsInterop": false
18
+ },
19
+ "vitepress > @vueuse/core": {
20
+ "src": "../../../../node_modules/@vueuse/core/index.mjs",
21
+ "file": "vitepress___@vueuse_core.js",
22
+ "fileHash": "97e57308",
23
+ "needsInterop": false
24
+ },
25
+ "vitepress > @vueuse/integrations/useFocusTrap": {
26
+ "src": "../../../../node_modules/@vueuse/integrations/useFocusTrap.mjs",
27
+ "file": "vitepress___@vueuse_integrations_useFocusTrap.js",
28
+ "fileHash": "4a67da49",
29
+ "needsInterop": false
30
+ },
31
+ "vitepress > mark.js/src/vanilla.js": {
32
+ "src": "../../../../node_modules/mark.js/src/vanilla.js",
33
+ "file": "vitepress___mark__js_src_vanilla__js.js",
34
+ "fileHash": "ffe975a7",
35
+ "needsInterop": false
36
+ },
37
+ "vitepress > minisearch": {
38
+ "src": "../../../../node_modules/minisearch/dist/es/index.js",
39
+ "file": "vitepress___minisearch.js",
40
+ "fileHash": "da3112be",
41
+ "needsInterop": false
42
+ }
43
+ },
44
+ "chunks": {
45
+ "chunk-2CLQ7TTZ": {
46
+ "file": "chunk-2CLQ7TTZ.js"
47
+ },
48
+ "chunk-LE5NDSFD": {
49
+ "file": "chunk-LE5NDSFD.js"
50
+ }
51
+ }
52
+ }