amateras 0.10.1 → 0.10.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 (174) hide show
  1. package/README.md +29 -25
  2. package/build/core.js +1 -0
  3. package/build/css.js +1 -0
  4. package/build/for.js +1 -0
  5. package/build/i18n.js +1 -0
  6. package/build/idb.js +1 -0
  7. package/build/if.js +1 -0
  8. package/build/import-map.js +1 -0
  9. package/build/markdown.js +1 -0
  10. package/build/match.js +1 -0
  11. package/build/meta.js +1 -0
  12. package/build/prefetch.js +1 -0
  13. package/build/router.js +1 -0
  14. package/build/signal.js +1 -0
  15. package/build/ui.js +1 -0
  16. package/build/widget.js +1 -0
  17. package/package.json +7 -5
  18. package/packages/core/package.json +19 -0
  19. package/packages/core/src/env.browser.ts +21 -0
  20. package/packages/core/src/env.node.ts +21 -0
  21. package/packages/core/src/global.ts +5 -0
  22. package/packages/core/src/index.ts +184 -0
  23. package/packages/core/src/lib/hmr.ts +145 -0
  24. package/packages/core/src/lib/symbols.ts +2 -0
  25. package/packages/core/src/structure/ElementProto.ts +95 -0
  26. package/packages/core/src/structure/GlobalState.ts +9 -0
  27. package/packages/core/src/structure/NodeProto.ts +18 -0
  28. package/packages/core/src/structure/Proto.ts +90 -0
  29. package/packages/core/src/structure/ProxyProto.ts +20 -0
  30. package/packages/core/src/structure/TextProto.ts +22 -0
  31. package/packages/core/src/structure/WidgetEvent.ts +17 -0
  32. package/packages/css/README.md +128 -0
  33. package/packages/css/package.json +15 -0
  34. package/packages/css/src/ext/colors/amber.ts +25 -0
  35. package/packages/css/src/ext/colors/blackwhite.ts +13 -0
  36. package/packages/css/src/ext/colors/blue.ts +25 -0
  37. package/packages/css/src/ext/colors/cyan.ts +25 -0
  38. package/packages/css/src/ext/colors/emerald.ts +25 -0
  39. package/packages/css/src/ext/colors/fuchsia.ts +25 -0
  40. package/packages/css/src/ext/colors/gray.ts +25 -0
  41. package/packages/css/src/ext/colors/green.ts +25 -0
  42. package/packages/css/src/ext/colors/indigo.ts +25 -0
  43. package/packages/css/src/ext/colors/lime.ts +25 -0
  44. package/packages/css/src/ext/colors/neutral.ts +25 -0
  45. package/packages/css/src/ext/colors/orange.ts +25 -0
  46. package/packages/css/src/ext/colors/pink.ts +25 -0
  47. package/packages/css/src/ext/colors/purple.ts +25 -0
  48. package/packages/css/src/ext/colors/red.ts +25 -0
  49. package/packages/css/src/ext/colors/rose.ts +25 -0
  50. package/packages/css/src/ext/colors/sky.ts +25 -0
  51. package/packages/css/src/ext/colors/slate.ts +25 -0
  52. package/packages/css/src/ext/colors/stone.ts +25 -0
  53. package/packages/css/src/ext/colors/teal.ts +25 -0
  54. package/packages/css/src/ext/colors/violet.ts +25 -0
  55. package/packages/css/src/ext/colors/yellow.ts +25 -0
  56. package/packages/css/src/ext/colors/zinc.ts +25 -0
  57. package/packages/css/src/ext/colors.ts +23 -0
  58. package/packages/css/src/ext/keyframes.ts +37 -0
  59. package/packages/css/src/ext/property.ts +68 -0
  60. package/packages/css/src/ext/variable.ts +51 -0
  61. package/packages/css/src/index.ts +103 -0
  62. package/packages/css/src/lib/cache.ts +27 -0
  63. package/packages/css/src/lib/colorAssign.ts +6 -0
  64. package/packages/css/src/lib/createRule.ts +31 -0
  65. package/packages/css/src/lib/utils.ts +1 -0
  66. package/packages/css/src/structure/$CSS.ts +4 -0
  67. package/packages/css/src/structure/$CSSKeyframes.ts +13 -0
  68. package/packages/css/src/structure/$CSSProperty.ts +21 -0
  69. package/packages/css/src/structure/$CSSRule.ts +39 -0
  70. package/packages/css/src/structure/$CSSVariable.ts +34 -0
  71. package/packages/css/src/types.ts +300 -0
  72. package/packages/for/package.json +15 -0
  73. package/packages/for/src/global.ts +7 -0
  74. package/packages/for/src/index.ts +15 -0
  75. package/packages/for/src/structure/For.ts +74 -0
  76. package/packages/hmr/package.json +13 -0
  77. package/packages/hmr/src/index.ts +27 -0
  78. package/packages/i18n/README.md +73 -0
  79. package/packages/i18n/package.json +15 -0
  80. package/packages/i18n/src/index.ts +78 -0
  81. package/packages/i18n/src/structure/I18n.ts +51 -0
  82. package/packages/i18n/src/structure/I18nDictionary.ts +31 -0
  83. package/packages/i18n/src/structure/I18nTranslation.ts +51 -0
  84. package/packages/i18n/src/types.ts +77 -0
  85. package/packages/idb/README.md +127 -0
  86. package/packages/idb/package.json +16 -0
  87. package/packages/idb/src/core.ts +6 -0
  88. package/packages/idb/src/index.ts +17 -0
  89. package/packages/idb/src/lib/$IDBRequest.ts +8 -0
  90. package/packages/idb/src/structure/$IDB.ts +63 -0
  91. package/packages/idb/src/structure/$IDBCursor.ts +34 -0
  92. package/packages/idb/src/structure/$IDBIndex.ts +48 -0
  93. package/packages/idb/src/structure/$IDBStore.ts +103 -0
  94. package/packages/idb/src/structure/$IDBStoreBase.ts +30 -0
  95. package/packages/idb/src/structure/$IDBTransaction.ts +38 -0
  96. package/packages/idb/src/structure/builder/$IDBBuilder.ts +229 -0
  97. package/packages/idb/src/structure/builder/$IDBStoreBuilder.ts +100 -0
  98. package/packages/if/package.json +15 -0
  99. package/packages/if/src/global.ts +15 -0
  100. package/packages/if/src/index.ts +51 -0
  101. package/packages/if/src/structure/Condition.ts +44 -0
  102. package/packages/if/src/structure/ConditionStatement.ts +25 -0
  103. package/packages/if/src/structure/Else.ts +6 -0
  104. package/packages/if/src/structure/ElseIf.ts +6 -0
  105. package/packages/if/src/structure/If.ts +6 -0
  106. package/packages/markdown/README.md +53 -0
  107. package/packages/markdown/package.json +15 -0
  108. package/packages/markdown/src/index.ts +3 -0
  109. package/packages/markdown/src/lib/type.ts +26 -0
  110. package/packages/markdown/src/lib/util.ts +21 -0
  111. package/packages/markdown/src/structure/Markdown.ts +57 -0
  112. package/packages/markdown/src/structure/MarkdownLexer.ts +111 -0
  113. package/packages/markdown/src/structure/MarkdownParser.ts +34 -0
  114. package/packages/markdown/src/syntax/alert.ts +46 -0
  115. package/packages/markdown/src/syntax/blockquote.ts +35 -0
  116. package/packages/markdown/src/syntax/bold.ts +11 -0
  117. package/packages/markdown/src/syntax/code.ts +11 -0
  118. package/packages/markdown/src/syntax/codeblock.ts +44 -0
  119. package/packages/markdown/src/syntax/heading.ts +14 -0
  120. package/packages/markdown/src/syntax/horizontalRule.ts +11 -0
  121. package/packages/markdown/src/syntax/image.ts +23 -0
  122. package/packages/markdown/src/syntax/italic.ts +11 -0
  123. package/packages/markdown/src/syntax/link.ts +46 -0
  124. package/packages/markdown/src/syntax/list.ts +121 -0
  125. package/packages/markdown/src/syntax/table.ts +67 -0
  126. package/packages/markdown/src/syntax/text.ts +19 -0
  127. package/packages/match/package.json +15 -0
  128. package/packages/match/src/global.ts +14 -0
  129. package/packages/match/src/index.ts +33 -0
  130. package/packages/match/src/structure/Case.ts +15 -0
  131. package/packages/match/src/structure/Default.ts +12 -0
  132. package/packages/match/src/structure/Match.ts +78 -0
  133. package/packages/meta/package.json +14 -0
  134. package/packages/meta/src/index.ts +36 -0
  135. package/packages/meta/src/lib/resolveMeta.ts +27 -0
  136. package/packages/meta/src/types.ts +36 -0
  137. package/packages/prefetch/package.json +14 -0
  138. package/packages/prefetch/src/index.ts +70 -0
  139. package/packages/router/README.md +18 -0
  140. package/packages/router/package.json +16 -0
  141. package/packages/router/src/global.ts +22 -0
  142. package/packages/router/src/index.ts +106 -0
  143. package/packages/router/src/structure/Link.ts +17 -0
  144. package/packages/router/src/structure/NavLink.ts +19 -0
  145. package/packages/router/src/structure/Page.ts +30 -0
  146. package/packages/router/src/structure/Route.ts +123 -0
  147. package/packages/router/src/structure/RouteGroup.ts +24 -0
  148. package/packages/router/src/structure/RouteNode.ts +54 -0
  149. package/packages/router/src/structure/RouteSlot.ts +34 -0
  150. package/packages/router/src/structure/Router.ts +192 -0
  151. package/packages/router/src/structure/RouterConstructor.ts +18 -0
  152. package/packages/router/src/types.ts +41 -0
  153. package/packages/signal/README.md +93 -0
  154. package/packages/signal/package.json +15 -0
  155. package/packages/signal/src/index.ts +97 -0
  156. package/packages/signal/src/lib/track.ts +18 -0
  157. package/packages/signal/src/structure/Signal.ts +59 -0
  158. package/packages/ui/package.json +14 -0
  159. package/packages/ui/src/index.ts +4 -0
  160. package/packages/ui/src/lib/slideshowAnimations.ts +39 -0
  161. package/packages/ui/src/structure/Radio.ts +77 -0
  162. package/packages/ui/src/structure/Slide.ts +11 -0
  163. package/packages/ui/src/structure/Slideshow.ts +99 -0
  164. package/packages/utils/package.json +18 -0
  165. package/packages/utils/src/global.ts +39 -0
  166. package/packages/utils/src/index.bun.ts +3 -0
  167. package/packages/utils/src/index.ts +2 -0
  168. package/packages/utils/src/lib/debugger.ts +14 -0
  169. package/packages/utils/src/lib/utils.ts +119 -0
  170. package/packages/utils/src/structure/UID.ts +18 -0
  171. package/packages/widget/README.md +29 -0
  172. package/packages/widget/package.json +14 -0
  173. package/packages/widget/src/index.ts +82 -0
  174. package/packages/widget/src/structure/Widget.ts +42 -0
@@ -0,0 +1,25 @@
1
+ import { colorAssign } from "../../lib/colorAssign";
2
+
3
+ const _fuchsia = {
4
+ 50: '#fdf4ff',
5
+ 100: '#fae8ff',
6
+ 200: '#f5d0fe',
7
+ 300: '#f0abfc',
8
+ 400: '#e879f9',
9
+ 500: '#d946ef',
10
+ 600: '#c026d3',
11
+ 700: '#a21caf',
12
+ 800: '#86198f',
13
+ 900: '#701a75',
14
+ 950: '#4a044e',
15
+ } as const;
16
+
17
+ colorAssign('fuchsia', _fuchsia);
18
+
19
+ declare global {
20
+ export namespace $ {
21
+ export namespace color {
22
+ export const fuchsia: typeof _fuchsia;
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,25 @@
1
+ import { colorAssign } from "../../lib/colorAssign";
2
+
3
+ const _gray = {
4
+ 50: '#f9fafb',
5
+ 100: '#f3f4f6',
6
+ 200: '#e5e7eb',
7
+ 300: '#d1d5db',
8
+ 400: '#9ca3af',
9
+ 500: '#6b7280',
10
+ 600: '#4b5563',
11
+ 700: '#374151',
12
+ 800: '#1f2937',
13
+ 900: '#111827',
14
+ 950: '#030712',
15
+ } as const;
16
+
17
+ colorAssign('gray', _gray);
18
+
19
+ declare global {
20
+ export namespace $ {
21
+ export namespace color {
22
+ export const gray: typeof _gray;
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,25 @@
1
+ import { colorAssign } from "../../lib/colorAssign";
2
+
3
+ const _green = {
4
+ 50: '#f0fdf4',
5
+ 100: '#dcfce7',
6
+ 200: '#bbf7d0',
7
+ 300: '#86efac',
8
+ 400: '#4ade80',
9
+ 500: '#22c55e',
10
+ 600: '#16a34a',
11
+ 700: '#15803d',
12
+ 800: '#166534',
13
+ 900: '#14532d',
14
+ 950: '#052e16',
15
+ } as const;
16
+
17
+ colorAssign('green', _green);
18
+
19
+ declare global {
20
+ export namespace $ {
21
+ export namespace color {
22
+ export const green: typeof _green;
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,25 @@
1
+ import { colorAssign } from "../../lib/colorAssign";
2
+
3
+ const _indigo = {
4
+ 50: '#eef2ff',
5
+ 100: '#e0e7ff',
6
+ 200: '#c7d2fe',
7
+ 300: '#a5b4fc',
8
+ 400: '#818cf8',
9
+ 500: '#6366f1',
10
+ 600: '#4f46e5',
11
+ 700: '#4338ca',
12
+ 800: '#3730a3',
13
+ 900: '#312e81',
14
+ 950: '#1e1b4b',
15
+ } as const;
16
+
17
+ colorAssign('indigo', _indigo);
18
+
19
+ declare global {
20
+ export namespace $ {
21
+ export namespace color {
22
+ export const indigo: typeof _indigo;
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,25 @@
1
+ import { colorAssign } from "../../lib/colorAssign";
2
+
3
+ const _lime = {
4
+ 50: '#f7fee7',
5
+ 100: '#ecfccb',
6
+ 200: '#d9f99d',
7
+ 300: '#bef264',
8
+ 400: '#a3e635',
9
+ 500: '#84cc16',
10
+ 600: '#65a30d',
11
+ 700: '#4d7c0f',
12
+ 800: '#3f6212',
13
+ 900: '#365314',
14
+ 950: '#1a2e05',
15
+ } as const;
16
+
17
+ colorAssign('lime', _lime);
18
+
19
+ declare global {
20
+ export namespace $ {
21
+ export namespace color {
22
+ export const lime: typeof _lime;
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,25 @@
1
+ import { colorAssign } from "../../lib/colorAssign";
2
+
3
+ const _neutral = {
4
+ 50: '#fafafa',
5
+ 100: '#f5f5f5',
6
+ 200: '#e5e5e5',
7
+ 300: '#d4d4d4',
8
+ 400: '#a3a3a3',
9
+ 500: '#737373',
10
+ 600: '#525252',
11
+ 700: '#404040',
12
+ 800: '#262626',
13
+ 900: '#171717',
14
+ 950: '#0a0a0a',
15
+ } as const;
16
+
17
+ colorAssign('neutral', _neutral);
18
+
19
+ declare global {
20
+ export namespace $ {
21
+ export namespace color {
22
+ export const neutral: typeof _neutral;
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,25 @@
1
+ import { colorAssign } from "../../lib/colorAssign";
2
+
3
+ const _orange = {
4
+ 50: '#fff7ed',
5
+ 100: '#ffedd5',
6
+ 200: '#fed7aa',
7
+ 300: '#fdba74',
8
+ 400: '#fb923c',
9
+ 500: '#f97316',
10
+ 600: '#ea580c',
11
+ 700: '#c2410c',
12
+ 800: '#9a3412',
13
+ 900: '#7c2d12',
14
+ 950: '#431407',
15
+ } as const;
16
+
17
+ colorAssign('orange', _orange);
18
+
19
+ declare global {
20
+ export namespace $ {
21
+ export namespace color {
22
+ export const orange: typeof _orange;
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,25 @@
1
+ import { colorAssign } from "../../lib/colorAssign";
2
+
3
+ const _pink = {
4
+ 50: '#fdf2f8',
5
+ 100: '#fce7f3',
6
+ 200: '#fbcfe8',
7
+ 300: '#f9a8d4',
8
+ 400: '#f472b6',
9
+ 500: '#ec4899',
10
+ 600: '#db2777',
11
+ 700: '#be185d',
12
+ 800: '#9d174d',
13
+ 900: '#831843',
14
+ 950: '#500724',
15
+ } as const;
16
+
17
+ colorAssign('pink', _pink);
18
+
19
+ declare global {
20
+ export namespace $ {
21
+ export namespace color {
22
+ export const pink: typeof _pink;
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,25 @@
1
+ import { colorAssign } from "../../lib/colorAssign";
2
+
3
+ const _purple = {
4
+ 50: '#faf5ff',
5
+ 100: '#f3e8ff',
6
+ 200: '#e9d5ff',
7
+ 300: '#d8b4fe',
8
+ 400: '#c084fc',
9
+ 500: '#a855f7',
10
+ 600: '#9333ea',
11
+ 700: '#7e22ce',
12
+ 800: '#6b21a8',
13
+ 900: '#581c87',
14
+ 950: '#3b0764',
15
+ } as const;
16
+
17
+ colorAssign('purple', _purple);
18
+
19
+ declare global {
20
+ export namespace $ {
21
+ export namespace color {
22
+ export const purple: typeof _purple;
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,25 @@
1
+ import { colorAssign } from "../../lib/colorAssign";
2
+
3
+ const _red = {
4
+ 50: '#fef2f2',
5
+ 100: '#fee2e2',
6
+ 200: '#fecaca',
7
+ 300: '#fca5a5',
8
+ 400: '#f87171',
9
+ 500: '#ef4444',
10
+ 600: '#dc2626',
11
+ 700: '#b91c1c',
12
+ 800: '#991b1b',
13
+ 900: '#7f1d1d',
14
+ 950: '#450a0a',
15
+ } as const;
16
+
17
+ colorAssign('red', _red);
18
+
19
+ declare global {
20
+ export namespace $ {
21
+ export namespace color {
22
+ export const red: typeof _red;
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,25 @@
1
+ import { colorAssign } from "../../lib/colorAssign";
2
+
3
+ const _rose = {
4
+ 50: '#fff1f2',
5
+ 100: '#ffe4e6',
6
+ 200: '#fecdd3',
7
+ 300: '#fda4af',
8
+ 400: '#fb7185',
9
+ 500: '#f43f5e',
10
+ 600: '#e11d48',
11
+ 700: '#be123c',
12
+ 800: '#9f1239',
13
+ 900: '#881337',
14
+ 950: '#4c0519',
15
+ } as const;
16
+
17
+ colorAssign('rose', _rose);
18
+
19
+ declare global {
20
+ export namespace $ {
21
+ export namespace color {
22
+ export const rose: typeof _rose;
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,25 @@
1
+ import { colorAssign } from "../../lib/colorAssign";
2
+
3
+ const _sky = {
4
+ 50: '#f0f9ff',
5
+ 100: '#e0f2fe',
6
+ 200: '#bae6fd',
7
+ 300: '#7dd3fc',
8
+ 400: '#38bdf8',
9
+ 500: '#0ea5e9',
10
+ 600: '#0284c7',
11
+ 700: '#0369a1',
12
+ 800: '#075985',
13
+ 900: '#0c4a6e',
14
+ 950: '#082f49',
15
+ } as const;
16
+
17
+ colorAssign('sky', _sky);
18
+
19
+ declare global {
20
+ export namespace $ {
21
+ export namespace color {
22
+ export const sky: typeof _sky;
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,25 @@
1
+ import { colorAssign } from "../../lib/colorAssign";
2
+
3
+ const _slate = {
4
+ 50: '#f8fafc',
5
+ 100: '#f1f5f9',
6
+ 200: '#e2e8f0',
7
+ 300: '#cbd5e1',
8
+ 400: '#94a3b8',
9
+ 500: '#64748b',
10
+ 600: '#475569',
11
+ 700: '#334155',
12
+ 800: '#1e293b',
13
+ 900: '#0f172a',
14
+ 950: '#020617',
15
+ } as const
16
+
17
+ colorAssign('slate', _slate);
18
+
19
+ declare global {
20
+ export namespace $ {
21
+ export namespace color {
22
+ export const slate: typeof _slate;
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,25 @@
1
+ import { colorAssign } from "../../lib/colorAssign";
2
+
3
+ const _stone = {
4
+ 50: '#fafaf9',
5
+ 100: '#f5f5f4',
6
+ 200: '#e7e5e4',
7
+ 300: '#d6d3d1',
8
+ 400: '#a8a29e',
9
+ 500: '#78716c',
10
+ 600: '#57534e',
11
+ 700: '#44403c',
12
+ 800: '#292524',
13
+ 900: '#1c1917',
14
+ 950: '#0c0a09',
15
+ } as const;
16
+
17
+ colorAssign('stone', _stone);
18
+
19
+ declare global {
20
+ export namespace $ {
21
+ export namespace color {
22
+ export const stone: typeof _stone;
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,25 @@
1
+ import { colorAssign } from "../../lib/colorAssign";
2
+
3
+ const _teal = {
4
+ 50: '#f0fdfa',
5
+ 100: '#ccfbf1',
6
+ 200: '#99f6e4',
7
+ 300: '#5eead4',
8
+ 400: '#2dd4bf',
9
+ 500: '#14b8a6',
10
+ 600: '#0d9488',
11
+ 700: '#0f766e',
12
+ 800: '#115e59',
13
+ 900: '#134e4a',
14
+ 950: '#042f2e',
15
+ } as const;
16
+
17
+ colorAssign('teal', _teal);
18
+
19
+ declare global {
20
+ export namespace $ {
21
+ export namespace color {
22
+ export const teal: typeof _teal;
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,25 @@
1
+ import { colorAssign } from "../../lib/colorAssign";
2
+
3
+ const _violet = {
4
+ 50: '#f5f3ff',
5
+ 100: '#ede9fe',
6
+ 200: '#ddd6fe',
7
+ 300: '#c4b5fd',
8
+ 400: '#a78bfa',
9
+ 500: '#8b5cf6',
10
+ 600: '#7c3aed',
11
+ 700: '#6d28d9',
12
+ 800: '#5b21b6',
13
+ 900: '#4c1d95',
14
+ 950: '#2e1065',
15
+ } as const;
16
+
17
+ colorAssign('violet', _violet);
18
+
19
+ declare global {
20
+ export namespace $ {
21
+ export namespace color {
22
+ export const violet: typeof _violet;
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,25 @@
1
+ import { colorAssign } from "../../lib/colorAssign";
2
+
3
+ const _yellow = {
4
+ 50: '#fefce8',
5
+ 100: '#fef9c3',
6
+ 200: '#fef08a',
7
+ 300: '#fde047',
8
+ 400: '#facc15',
9
+ 500: '#eab308',
10
+ 600: '#ca8a04',
11
+ 700: '#a16207',
12
+ 800: '#854d0e',
13
+ 900: '#713f12',
14
+ 950: '#422006',
15
+ } as const;
16
+
17
+ colorAssign('yellow', _yellow);
18
+
19
+ declare global {
20
+ export namespace $ {
21
+ export namespace color {
22
+ export const yellow: typeof _yellow;
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,25 @@
1
+ import { colorAssign } from "../../lib/colorAssign";
2
+
3
+ const _zinc = {
4
+ 50: '#fafafa',
5
+ 100: '#f4f4f5',
6
+ 200: '#e4e4e7',
7
+ 300: '#d4d4d8',
8
+ 400: '#a1a1aa',
9
+ 500: '#71717a',
10
+ 600: '#52525b',
11
+ 700: '#3f3f46',
12
+ 800: '#27272a',
13
+ 900: '#18181b',
14
+ 950: '#09090b',
15
+ } as const;
16
+
17
+ colorAssign('zinc', _zinc);
18
+
19
+ declare global {
20
+ export namespace $ {
21
+ export namespace color {
22
+ export const zinc: typeof _zinc;
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,23 @@
1
+ import './colors/amber';
2
+ import './colors/blackwhite';
3
+ import './colors/blue';
4
+ import './colors/cyan';
5
+ import './colors/emerald';
6
+ import './colors/fuchsia';
7
+ import './colors/gray';
8
+ import './colors/green';
9
+ import './colors/indigo';
10
+ import './colors/lime';
11
+ import './colors/neutral';
12
+ import './colors/orange';
13
+ import './colors/pink';
14
+ import './colors/purple';
15
+ import './colors/red';
16
+ import './colors/rose';
17
+ import './colors/sky';
18
+ import './colors/slate';
19
+ import './colors/stone';
20
+ import './colors/teal';
21
+ import './colors/violet';
22
+ import './colors/yellow';
23
+ import './colors/zinc';
@@ -0,0 +1,37 @@
1
+ import { cssGlobalRuleSet } from "#lib/cache";
2
+ import { createRule } from "#lib/createRule";
3
+ import { $CSSKeyframes } from "#structure/$CSSKeyframes";
4
+ import { _Object_assign, _Object_entries, _Object_fromEntries, map } from "@amateras/utils";
5
+ import { UID } from "@amateras/utils";
6
+
7
+ declare global {
8
+ export namespace $ {
9
+ export namespace css {
10
+ export function keyframes<T extends { [key: string]: $.CSSKeyframesMap }>(options: T): { [key in keyof T]: $CSSKeyframes };
11
+ }
12
+
13
+ export interface CSSValueMap {
14
+ keyframes: $CSSKeyframes
15
+ }
16
+
17
+ export type CSSKeyframesMap = { [key: string]: $.CSSDeclarationMap } | { from?: $.CSSDeclarationMap, to?: $.CSSDeclarationMap }
18
+ }
19
+ }
20
+
21
+ const KEYFRAMES_AT = '@keyframes ';
22
+
23
+ _Object_assign($.css, {
24
+ keyframes(options: $.CSSKeyframesMap) {
25
+ return _Object_fromEntries(
26
+ map(
27
+ _Object_entries(options), (([name, value]) => {
28
+ let rule = createRule(() => `${KEYFRAMES_AT}${name}_${UID.generate('css-keyframes')}`, value);
29
+ cssGlobalRuleSet.add(rule);
30
+ return [name, new $CSSKeyframes(rule.selector.replace(`${KEYFRAMES_AT} `, ''))];
31
+ })
32
+ )
33
+ )
34
+ }
35
+ })
36
+
37
+ export * from "#structure/$CSSKeyframes";
@@ -0,0 +1,68 @@
1
+ import { cssGlobalRuleSet } from "#lib/cache";
2
+ import { createRule } from "#lib/createRule";
3
+ import { camelCaseToDash } from "#lib/utils";
4
+ import { $CSSProperty } from "#structure/$CSSProperty";
5
+ import { _Object_assign, _Object_entries, forEach, isString, isUndefined } from "@amateras/utils";
6
+ import { UID } from "@amateras/utils";
7
+
8
+ declare global {
9
+ export namespace $ {
10
+ export namespace css {
11
+ export function property<T extends $.CSSPropertyMap>(resolver: T): { [key in keyof T]: $CSSProperty }
12
+ export function property(syntax: $.CSSPropertySyntax, initialValue: string | number, inherits?: boolean): $CSSProperty
13
+ }
14
+
15
+ export interface CSSValueMap {
16
+ property: $CSSProperty
17
+ }
18
+
19
+ export type CSSPropertySyntax =
20
+ '<angle>' | '<color>' | '<custom-ident>' |
21
+ '<image>' | '<integer>' | '<length>' |
22
+ '<length-percentage>' | '<number>' | '<percentage>' |
23
+ '<resolution>' | '<string>' | '<time>' |
24
+ '<transform-function>' | '<transform-list>' | '<url>' |
25
+ 'auto' | '*' | string & {}
26
+
27
+ export type CSSPropertyMap = {
28
+ [key: string]:
29
+ [$.CSSPropertySyntax, string | number, boolean]
30
+ | [$.CSSPropertySyntax, string | number]
31
+ | ['*']
32
+ }
33
+ }
34
+ }
35
+
36
+ _Object_assign($.css, {
37
+ property(resolver: $.CSSPropertyMap | string, initialValue?: string | number, inherits?: boolean) {
38
+ let id = UID.generate('css-property', {lettercase: 'lower'})
39
+ if (isString(resolver)) {
40
+ if (isUndefined(initialValue) || isUndefined(inherits)) throw 'Register CSS Property Error';
41
+ let name = `--${id}`;
42
+ let property = new $CSSProperty({ name, syntax: resolver, initialValue: `${initialValue}`, inherits });
43
+ let rule = createRule(() => `@property ${name}`, {
44
+ syntax: `'${resolver}'`,
45
+ inherits: `${inherits ?? true}`,
46
+ ...(initialValue ? { initialValue } : {})
47
+ }, false)
48
+ cssGlobalRuleSet.add(rule)
49
+ return property;
50
+ } else {
51
+ let propertyMap = {};
52
+ forEach(_Object_entries(resolver), ([key, [syntax, initialValue, inherits]]) => {
53
+ let name = `--${camelCaseToDash(key)}-${id}`
54
+ let property = new $CSSProperty({ name, syntax, initialValue: `${initialValue}`, inherits });
55
+ _Object_assign(propertyMap, { [key]: property });
56
+ let rule = createRule(() => `@property ${name}`, {
57
+ syntax: `'${syntax}'`,
58
+ inherits: `${inherits ?? true}`,
59
+ ...(initialValue ? { initialValue } : {})
60
+ }, false)
61
+ cssGlobalRuleSet.add(rule)
62
+ })
63
+ return propertyMap;
64
+ }
65
+ }
66
+ })
67
+
68
+ export * from "#structure/$CSSProperty";
@@ -0,0 +1,51 @@
1
+ import { $CSSVariable } from "#structure/$CSSVariable";
2
+ import { _Object_assign, _Object_entries, _Object_fromEntries, isObject, map } from "@amateras/utils";
3
+ import { camelCaseToDash } from "../lib/utils";
4
+ import { UID } from "@amateras/utils";
5
+
6
+ declare global {
7
+ export namespace $ {
8
+ export namespace css {
9
+ export function variable<V extends string>(value: V): $CSSVariable<V>;
10
+ export function variable<T extends $.CSSVariableType>(options: T): { [key in keyof T]: $CSSVariable<T[key]> }
11
+ }
12
+
13
+ export interface CSSValueMap {
14
+ variable: $CSSVariable
15
+ }
16
+
17
+ export type CSSVariableType<T = any> = { [key in keyof T]: $.CSSValue }
18
+ }
19
+ }
20
+
21
+
22
+ _Object_assign($.css, {
23
+ variable<T extends $.CSSVariableType | string>(options: T) {
24
+ let id = UID.generate('css-variable', {lettercase: 'lower'})
25
+ if (isObject(options)) {
26
+ const variables = _Object_fromEntries(
27
+ map(_Object_entries(options), (([key, value]) => [
28
+ key, new $CSSVariable(`--${camelCaseToDash(key)}_${id}`, `${value}`)
29
+ ])
30
+ ))
31
+
32
+ $.CSS({
33
+ ':root': _Object_fromEntries(
34
+ map(_Object_entries(variables), (
35
+ ([_, {name, value}]) => [
36
+ name, value
37
+ ])
38
+ )
39
+ )
40
+ })
41
+
42
+ return variables;
43
+ } else {
44
+ const variable = new $CSSVariable(`--${id}`, options);
45
+ $.CSS({':root': {[variable.name]: variable.value}});
46
+ return variable;
47
+ }
48
+ }
49
+ })
50
+
51
+ export * from "#structure/$CSSVariable";