amateras 0.1.1 → 0.3.0

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 (68) hide show
  1. package/README.md +25 -8
  2. package/ext/css/src/index.ts +103 -49
  3. package/ext/css/src/lib/colorAssign.ts +6 -0
  4. package/ext/css/src/lib/colors/amber.ts +25 -0
  5. package/ext/css/src/lib/colors/blackwhite.ts +13 -0
  6. package/ext/css/src/lib/colors/blue.ts +25 -0
  7. package/ext/css/src/lib/colors/cyan.ts +25 -0
  8. package/ext/css/src/lib/colors/emerald.ts +25 -0
  9. package/ext/css/src/lib/colors/fuchsia.ts +25 -0
  10. package/ext/css/src/lib/colors/gray.ts +25 -0
  11. package/ext/css/src/lib/colors/green.ts +25 -0
  12. package/ext/css/src/lib/colors/indigo.ts +25 -0
  13. package/ext/css/src/lib/colors/lime.ts +25 -0
  14. package/ext/css/src/lib/colors/neutral.ts +25 -0
  15. package/ext/css/src/lib/colors/orange.ts +25 -0
  16. package/ext/css/src/lib/colors/pink.ts +25 -0
  17. package/ext/css/src/lib/colors/purple.ts +25 -0
  18. package/ext/css/src/lib/colors/red.ts +25 -0
  19. package/ext/css/src/lib/colors/rose.ts +25 -0
  20. package/ext/css/src/lib/colors/sky.ts +25 -0
  21. package/ext/css/src/lib/colors/slate.ts +25 -0
  22. package/ext/css/src/lib/colors/stone.ts +25 -0
  23. package/ext/css/src/lib/colors/teal.ts +25 -0
  24. package/ext/css/src/lib/colors/violet.ts +25 -0
  25. package/ext/css/src/lib/colors/yellow.ts +25 -0
  26. package/ext/css/src/lib/colors/zinc.ts +25 -0
  27. package/ext/css/src/lib/colors.ts +23 -0
  28. package/ext/css/src/structure/$CSSKeyframesRule.ts +2 -5
  29. package/ext/css/src/structure/$CSSMediaRule.ts +3 -23
  30. package/ext/css/src/structure/$CSSRule.ts +6 -18
  31. package/ext/css/src/structure/$CSSStyleRule.ts +10 -12
  32. package/ext/html/html.ts +24 -58
  33. package/ext/html/node/$Anchor.ts +49 -0
  34. package/ext/html/node/$Canvas.ts +16 -0
  35. package/ext/html/node/$Dialog.ts +16 -0
  36. package/ext/html/node/$Form.ts +16 -0
  37. package/ext/html/node/$Image.ts +72 -0
  38. package/ext/html/node/$Input.ts +169 -0
  39. package/ext/html/node/$Label.ts +16 -0
  40. package/ext/html/node/$Media.ts +16 -0
  41. package/ext/html/node/$OptGroup.ts +23 -0
  42. package/ext/html/node/$Option.ts +40 -0
  43. package/ext/html/node/$Select.ts +76 -0
  44. package/ext/html/node/$TextArea.ts +16 -0
  45. package/ext/router/README.md +81 -0
  46. package/ext/router/index.ts +66 -0
  47. package/ext/router/node/Page.ts +27 -0
  48. package/ext/router/node/Route.ts +53 -0
  49. package/ext/router/node/Router.ts +138 -0
  50. package/ext/router/node/RouterAnchor.ts +8 -0
  51. package/ext/ssr/env.ts +61 -0
  52. package/ext/ssr/index.ts +47 -0
  53. package/ext/ssr/package.json +10 -0
  54. package/package.json +8 -4
  55. package/src/core.ts +43 -30
  56. package/src/global.ts +6 -0
  57. package/src/lib/assign.ts +4 -3
  58. package/src/lib/assignHelper.ts +11 -13
  59. package/src/lib/native.ts +14 -3
  60. package/src/node/$Element.ts +204 -23
  61. package/src/node/$HTMLElement.ts +76 -0
  62. package/src/node/$Node.ts +145 -53
  63. package/src/node/node.ts +8 -6
  64. package/src/structure/Signal.ts +4 -4
  65. package/tsconfig.json +1 -1
  66. package/ext/css/src/structure/$CSSKeyframeRule.ts +0 -13
  67. package/ext/html/node/$HTMLElement.ts +0 -7
  68. package/ext/html/node/type.ts +0 -96
package/README.md CHANGED
@@ -23,7 +23,9 @@ const paragraphStyle = $.css({
23
23
 
24
24
  $('p').css(paragraphStyle).content([
25
25
  'Amateras is a ',
26
- $('span').css({ color: 'blue', fontWeight: 700 }).content('DOM Utility Library.')
26
+ $('span')
27
+ .css({ color: 'blue', fontWeight: 700 })
28
+ .content('DOM Utility Library.')
27
29
  ])
28
30
  ```
29
31
 
@@ -34,7 +36,8 @@ import 'amateras';
34
36
  const count$ = $.signal(0);
35
37
 
36
38
  $(document.body).content([
37
- $('button').content('Click me')
39
+ $('button')
40
+ .content('Click me')
38
41
  .class('class1', 'class2')
39
42
  .on('click', () => count$(oldValue => oldValue + 1)),
40
43
  $('p').content($`Clicked ${count$} times.`)
@@ -43,7 +46,7 @@ $(document.body).content([
43
46
 
44
47
  ## State Management
45
48
  ```ts
46
- import 'amateras'
49
+ import 'amateras';
47
50
 
48
51
  const count$ = $.signal(0);
49
52
  const doubleCount$ = $.compute(() => count() * 2);
@@ -56,6 +59,19 @@ $(document.body).content([
56
59
  ])
57
60
  ```
58
61
 
62
+ ## HTMLElement Methods Import
63
+ ```ts
64
+ import 'amateras';
65
+ import 'amateras/html';
66
+
67
+ // without html package
68
+ $('a').attr({ href: '/user' });
69
+ $('img').attr({ src: '/profile.jpg' });
70
+ // with html package
71
+ $('a').href('/user');
72
+ $('img').src('/profile.jpg');
73
+ ```
74
+
59
75
  ## Custom Components
60
76
  ```ts
61
77
  import 'amateras';
@@ -83,8 +99,9 @@ $(document.body).content([
83
99
  ```
84
100
 
85
101
  ## Packages
86
- |-|-|
87
- |Package name|Size|Size(gzip)|Description|
88
- |amateras|5.56 kB|2.35 kB|Core
89
- |amateras/html|0.66 kB|0.28 kB|Import HTMLElement types and methods|
90
- |[amateras/css](./ext/css/README.md)|3.74 kB|1.40 kB|Style in JS|
102
+ | Package name | Size | Size(gzip) | Description |
103
+ | --- | --- | --- | --- |
104
+ | amateras | 5.50 kB | 2.26 kB | Core |
105
+ | amateras/html | 0.97 kB | 0.26 kB | Import HTMLElement types and methods |
106
+ | [amateras/css](./ext/css/README.md) | 3.45 kB | 1.29 kB | Style in JS |
107
+ | [amateras/router](./ext/router/README.md) | 2.92 kB | 1.27 kB | Amateras Router |
@@ -1,4 +1,4 @@
1
- import { _instanceof, _Object_assign, _Object_entries, _Object_fromEntries, isObject, isUndefined } from "amateras/lib/native";
1
+ import { _Array_from, _instanceof, _JSON_stringify, _Object_assign, _Object_entries, _Object_fromEntries, forEach, isObject, isUndefined } from "amateras/lib/native";
2
2
  import { randomId } from "amateras/lib/randomId";
3
3
  import { $Element } from "amateras/node/$Element";
4
4
  import { $CSSDeclaration } from "#structure/$CSSDeclaration";
@@ -7,18 +7,16 @@ import { $CSSRule } from "#structure/$CSSRule";
7
7
  import { $CSSStyleRule } from "#structure/$CSSStyleRule";
8
8
  import { $CSSKeyframesRule } from "#structure/$CSSKeyframesRule";
9
9
  import { $CSSVariable } from "#structure/$CSSVariable";
10
- import { $CSSKeyframeRule } from "#structure/$CSSKeyframeRule";
11
10
 
12
11
  declare module 'amateras/core' {
13
12
  export namespace $ {
14
13
  export function css(options: $CSSOptions): $CSSStyleRule
15
- export function CSS(options: $CSSSelectorType | $CSSMediaSelectorType<false> | $CSSKeyframesSelectorType): void
14
+ export function CSS(options: $CSSMediaSelectorType<false> | $CSSSelectorType | $CSSKeyframesSelectorType): void
16
15
 
17
16
  export namespace css {
18
17
  export function variables(value: string): $CSSVariable;
19
18
  export function variables<T extends $CSSVariableType>(options: T, conditions?: $CSSVariableConditionType<T>): { [key in keyof T]: $CSSVariable }
20
19
  export function keyframes<T extends { [key: string]: $CSSKeyframesType }>(options: T): { [key in keyof T]: $CSSKeyframesRule };
21
- export const stylesheet: CSSStyleSheet;
22
20
  }
23
21
  }
24
22
  }
@@ -30,25 +28,26 @@ declare module 'amateras/node/$Element' {
30
28
  }
31
29
 
32
30
  const generatedIds = new Set<string>();
33
- function generateId(lettercase?: 'any' | 'lower' | 'upper'): string {
31
+ function generateId(lettercase: 'any' | 'lower' | 'upper' = 'any'): string {
34
32
  const id = randomId({lettercase: lettercase});
35
33
  if (generatedIds.has(id)) return generateId(lettercase);
36
34
  generatedIds.add(id);
37
35
  return id;
38
36
  }
39
37
 
40
- const stylesheet = new CSSStyleSheet();
41
- document.adoptedStyleSheets.push(stylesheet);
38
+ const stylesheet = $.stylesheet;
39
+ const cssTextMap = new Map<string, $CSSOptions>
42
40
 
43
- function processCSSOptions<T extends $CSSStyleRule | $CSSKeyframeRule>(
41
+ function processCSSOptions<T extends $CSSStyleRule>(
44
42
  rule: T,
45
- options: $CSSDeclarationType | $CSSSelectorType | $CSSMediaSelectorType<boolean>,
46
- context: string[] = [],
43
+ options: $CSSOptions,
47
44
  ): T {
48
45
  for (const [key, value] of _Object_entries(options)) {
49
46
  if (isUndefined(value)) continue;
50
- if (isObject(value) && !_instanceof(value, $CSSKeyframesRule) && !_instanceof(value, $CSSVariable))
51
- rule.addRule( createRule(key, value, context) );
47
+ else if (_instanceof(value, $CSSStyleRule)) rule.rules.add( value.clone(key) );
48
+ else if (_instanceof(value, $CSSDeclaration)) rule.declarations.set(value.key, value);
49
+ else if (isObject(value) && !_instanceof(value, $CSSKeyframesRule, $CSSVariable))
50
+ rule.rules.add( createRule(key, value, rule.selector) );
52
51
  else {
53
52
  const declaration = new $CSSDeclaration(key, `${value}`);
54
53
  rule.declarations.set(declaration.key, declaration);
@@ -57,62 +56,95 @@ function processCSSOptions<T extends $CSSStyleRule | $CSSKeyframeRule>(
57
56
  return rule;
58
57
  }
59
58
 
60
- function createRule(selector: string, options: $CSSOptions, context: string[] = [], global = false) {
61
- if (selector.startsWith('@media')) return createMediaRule(selector.replace('@media ', ''), options, context, global);
59
+ /** Create rule with several type depend on selector content.
60
+ * @param context - for media rule creation, it should be style rule selector same as nested parent of media rule.
61
+ */
62
+ function createRule(selector: string, options: $CSSOptions, context?: string) {
63
+ if (selector.startsWith('@media')) return createMediaRule(selector, options, context);
62
64
  if (selector.startsWith('@keyframes')) return createKeyframesRule(selector.replace('@keyframes ', ''), options as $CSSKeyframesType)
63
- return createStyleRule(options, [...context, selector]);
65
+ return createStyleRule(selector, options);
64
66
  }
65
67
 
66
- function createStyleRule<T extends $CSSRule>(options: T, context?: string[]): T;
67
- function createStyleRule<T extends $CSSOptions>(options: T, context?: string[]): $CSSStyleRule;
68
- function createStyleRule<T extends $CSSOptions>(options: T, context: string[] = []) {
69
- if (_instanceof(options, $CSSRule)) return options;
70
- return processCSSOptions(new $CSSStyleRule(context), options, context);
68
+ function createStyleRule<T extends $CSSRule>(selector: string, options: T): T;
69
+ function createStyleRule<T extends $CSSOptions>(selector: string, options: T): $CSSStyleRule;
70
+ function createStyleRule<T extends $CSSOptions>(selector: string, options: T) {
71
+ return processCSSOptions(new $CSSStyleRule(selector), options);
71
72
  }
72
73
 
73
- function createMediaRule(condition: string, options: $CSSOptions, context: string[] = [], global: boolean) {
74
- const rule = new $CSSMediaRule(condition);
74
+ function createMediaRule(selector: string, options: $CSSOptions, context?: string) {
75
+ const rule = new $CSSMediaRule(selector);
75
76
  // create media rule from $.CSS
76
- if (global) _Object_entries(options).forEach(([key, value]) => rule.addRule( createRule(key, value, context) ))
77
+ if (!context) forEach(_Object_entries(options), ([key, value]) => rule.rules.add( createRule(key, value) ))
77
78
  // create from $.css
78
- else rule.addRule( createStyleRule(options, context) );
79
+ else rule.rules.add( createStyleRule(context, options) );
79
80
  return rule;
80
81
  }
81
82
 
82
83
  function createKeyframesRule(name: string, options: $CSSKeyframesType) {
83
84
  const rule = new $CSSKeyframesRule(name);
84
- _Object_entries(options).forEach(([key, value]) => {
85
- rule.addRule( processCSSOptions(new $CSSKeyframeRule(key), value) );
85
+ forEach(_Object_entries(options), ([key, value]) => {
86
+ rule.rules.add( processCSSOptions(new $CSSStyleRule(key), value) );
86
87
  })
87
88
  return rule;
88
89
  }
89
90
 
90
- function insertRule(rule: $CSSRule, recursive = false) {
91
- if (_instanceof(rule, $CSSStyleRule) && !CSS.supports(`selector(${rule.selector})`)) return rule;
92
- stylesheet.insertRule(rule.css, stylesheet.cssRules.length);
93
- if (_instanceof(rule, $CSSKeyframesRule)) return rule;
94
- if (!_instanceof(rule, $CSSMediaRule)) rule.rules.forEach(rule => insertRule(rule));
95
- else if (!recursive) rule.mediaRules.forEach(rule => insertRule(rule, true));
96
- return rule;
91
+ function insertRule(rule: $CSSRule) {
92
+ cssText(rule).forEach(text => {
93
+ const selector = text.match(/^(.+?) {/)?.[1];
94
+ if (!selector) return;
95
+ if (!selector.startsWith('@') && selector.split(',').find(str => !CSS.supports(`selector(${str})`))) return;
96
+ stylesheet.insertRule(text, stylesheet.cssRules.length);
97
+ })
98
+ return rule
99
+ }
100
+
101
+ function cssText(rule: $CSSRule, context: string = '', mediaContext: string[] = []): string[] {
102
+ if (_instanceof(rule, $CSSStyleRule)) {
103
+ const split = (str: string) => str.split(',');
104
+ const selectors = split(rule.selector);
105
+ const selector = split(context).map(ctx => selectors.map(selector => `${ctx ? ctx + ' ' : ''}${selector}`)).join(', ').replaceAll(' &', '');
106
+ const text = `${selector} { ${_Array_from(rule.declarations).map(([_, dec]) => `${dec}`).join(' ')} }`
107
+ return [text, ..._Array_from(rule.rules).map(childRule => cssText(childRule, selector)).flat()]
108
+ }
109
+ if (_instanceof(rule, $CSSMediaRule)) {
110
+ const condition = [...mediaContext, rule.condition];
111
+ const media: string[] = [], style: string[] = []
112
+ forEach(
113
+ _Array_from(rule.rules)
114
+ .map(childRule => {
115
+ return cssText(childRule, '', condition)
116
+ })
117
+ .flat(),
118
+ (childText => childText.startsWith('@media') ? media.push(childText) : style.push(childText))
119
+ );
120
+ const text = `@media ${condition.join(' and ')} { ${style.join('\n')} }`
121
+ return [text, ...media]
122
+ }
123
+ if (_instanceof(rule, $CSSKeyframesRule)) {
124
+ return [`@keyframes ${rule.name} { ${_Array_from(rule.rules).map(childRule => cssText(childRule, context)).join('\n')} }`]
125
+ }
126
+ throw '$CSS RULE TYPE ERROR'
97
127
  }
98
128
 
99
129
  _Object_assign($, {
100
130
  css(options: $CSSOptions) {
101
131
  if (_instanceof(options, $CSSRule)) return options;
132
+ const cssText = _JSON_stringify(options);
133
+ const cacheRule = cssTextMap.get(cssText);
134
+ if (cacheRule) return cacheRule;
102
135
  const className = `.${generateId()}`;
103
- const rule = createStyleRule(options, [className]);
104
- rule.className = className;
136
+ const rule = createStyleRule(className, options);
137
+ cssTextMap.set(_JSON_stringify(options), rule);
105
138
  return insertRule( rule );
106
139
  },
107
140
  CSS(options: $CSSSelectorType | $CSSMediaRule) {
108
141
  return _Object_entries(options).map(([selector, declarations]) => {
109
- return insertRule( createRule(selector, declarations, [], true) );
142
+ return insertRule( createRule(selector, declarations) );
110
143
  })
111
144
  }
112
145
  })
113
146
 
114
147
  _Object_assign($.css, {
115
- stylesheet: stylesheet,
116
148
  variables<T extends $CSSVariableType | string>(options: T, conditions?: $CSSVariableConditionType<T>) {
117
149
  if (isObject(options)) {
118
150
  const variables = _Object_fromEntries(_Object_entries(options).map(([key, value]) => [
@@ -146,31 +178,30 @@ _Object_assign($.css, {
146
178
 
147
179
  _Object_assign($Element.prototype, {
148
180
  css(this: $Element, ...options: $CSSOptions[]) {
149
- options.forEach(options => {
181
+ forEach(options, options => {
150
182
  const rule = $.css(options);
151
- this.addClass(rule.context[0]?.slice(1) as string);
183
+ this.addClass(rule.selector.replace(/^./, ''));
152
184
  })
153
185
  return this;
154
186
  }
155
187
  })
156
188
 
157
189
  export * from "#structure/$CSSDeclaration";
158
- export * from "#structure/$CSSKeyframeRule";
159
190
  export * from "#structure/$CSSKeyframesRule";
160
191
  export * from "#structure/$CSSMediaRule";
161
192
  export * from "#structure/$CSSRule";
162
193
  export * from "#structure/$CSSStyleRule";
163
194
  export * from "#structure/$CSSVariable";
164
195
 
165
- type $CSSOptions = $CSSDeclarationType | $CSSSelectorType | $CSSStyleRule | $CSSMediaSelectorType<true>;
166
- type $CSSValueType = '' | 'unset' | 'initial' | 'inherit' | string & {} | number | $CSSVariable
167
- type $CSSDeclarationType = { [key in keyof $CSSDeclarationMap]?: $CSSDeclarationMap[key] }
168
- type $CSSSelectorType = { [key: string & {}]: $CSSOptions }
169
- type $CSSMediaSelectorType<Nested extends boolean> = { [key: `@media ${string}`]: Nested extends true ? $CSSOptions : $CSSSelectorType | $CSSMediaSelectorType<Nested> }
170
- type $CSSVariableType<T = any> = { [key in keyof T]: $CSSValueType }
171
- type $CSSVariableConditionType<T extends $CSSVariableType | string> = T extends string ? { [key: string]: $CSSValueType } : { [key: string]: $CSSVariableType<T> }
172
- type $CSSKeyframesSelectorType = { [key: `@keyframes ${string}`]: $CSSKeyframesType }
173
- type $CSSKeyframesType = { [key: `${number}%`]: $CSSDeclarationType } | { from?: $CSSDeclarationType, to?: $CSSDeclarationType }
196
+ export type $CSSOptions = $CSSDeclarationType | $CSSSelectorType | $CSSStyleRule | $CSSMediaSelectorType<true>;
197
+ export type $CSSValueType = '' | 'unset' | 'initial' | 'inherit' | string & {} | number | $CSSVariable
198
+ export type $CSSDeclarationType = { [key in keyof $CSSDeclarationMap]?: $CSSDeclarationMap[key] } | { [key: string]: $CSSValueType }
199
+ export type $CSSSelectorType = { [key: string & {}]: $CSSOptions }
200
+ export type $CSSMediaSelectorType<Nested extends boolean> = { [key: `@media ${string}`]: Nested extends true ? $CSSOptions : $CSSSelectorType | $CSSMediaSelectorType<Nested> }
201
+ export type $CSSVariableType<T = any> = { [key in keyof T]: $CSSValueType }
202
+ export type $CSSVariableConditionType<T extends $CSSVariableType | string> = T extends string ? { [key: string]: $CSSValueType } : { [key: string]: Partial<$CSSVariableType<T>> }
203
+ export type $CSSKeyframesSelectorType = { [key: `@keyframes ${string}`]: $CSSKeyframesType }
204
+ export type $CSSKeyframesType = { [key: `${number}%`]: $CSSDeclarationType } | { from?: $CSSDeclarationType, to?: $CSSDeclarationType }
174
205
 
175
206
  type $CSSDeclarationMap = {
176
207
  [key in keyof CSSStyleDeclaration]: $CSSValueType;
@@ -328,6 +359,12 @@ type $CSSDeclarationMap = {
328
359
  marginLeft?: string;
329
360
  marginRight?: string;
330
361
  marginTop?: string;
362
+ marginBlock?: string;
363
+ marginBlockStart?: string;
364
+ marginBlockEnd?: string;
365
+ marginInline?: string;
366
+ marginInlineStart?: string;
367
+ marginInlineEnd?: string;
331
368
  mask?: string;
332
369
  maskClip?: string;
333
370
  maskComposite?: string;
@@ -364,6 +401,12 @@ type $CSSDeclarationMap = {
364
401
  paddingLeft?: string;
365
402
  paddingRight?: string;
366
403
  paddingTop?: string;
404
+ paddingBlock?: string;
405
+ paddingBlockStart?: string;
406
+ paddingBlockEnd?: string;
407
+ paddingInline?: string;
408
+ paddingInlineStart?: string;
409
+ paddingInlineEnd?: string;
367
410
  pageBreakAfter?: 'auto' | 'always' | 'avoid' | 'left' | 'right';
368
411
  pageBreakBefore?: 'auto' | 'always' | 'avoid' | 'left' | 'right';
369
412
  pageBreakInside?: 'auto' | 'avoid';
@@ -382,6 +425,17 @@ type $CSSDeclarationMap = {
382
425
  rowGap?: string;
383
426
  scale?: string;
384
427
  scrollBehavior?: 'auto' | 'smooth';
428
+ scrollMargin?: string;
429
+ scrollMarginBottom?: string;
430
+ scrollMarginLeft?: string;
431
+ scrollMarginRight?: string;
432
+ scrollMarginTop?: string;
433
+ scrollMarginBlock?: string;
434
+ scrollMarginBlockStart?: string;
435
+ scrollMarginBlockEnd?: string;
436
+ scrollMarginInline?: string;
437
+ scrollMarginInlineStart?: string;
438
+ scrollMarginInlineEnd?: string;
385
439
  shapeRendering?: 'auto' | 'optimizeSpeed' | 'crispEdges' | 'geometricPrecision';
386
440
  stopColor?: string;
387
441
  stopOpacity?: string;
@@ -0,0 +1,6 @@
1
+ import { _Object_assign } from "../../../../src/lib/native";
2
+
3
+ export function colorAssign(key: string, colors: {[key: number]: string}) {
4
+ if (!$.color) _Object_assign($, {color: {}});
5
+ _Object_assign($.color, {[key]: colors})
6
+ }
@@ -0,0 +1,25 @@
1
+ import { colorAssign } from "../colorAssign";
2
+
3
+ const _amber = {
4
+ 50: '#fffbeb',
5
+ 100: '#fef3c7',
6
+ 200: '#fde68a',
7
+ 300: '#fcd34d',
8
+ 400: '#fbbf24',
9
+ 500: '#f59e0b',
10
+ 600: '#d97706',
11
+ 700: '#b45309',
12
+ 800: '#92400e',
13
+ 900: '#78350f',
14
+ 950: '#451a03',
15
+ } as const;
16
+
17
+ colorAssign('amber', _amber);
18
+
19
+ declare module 'amateras/core' {
20
+ export namespace $ {
21
+ export namespace color {
22
+ export const amber: typeof _amber;
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,13 @@
1
+ import { colorAssign } from "../colorAssign";
2
+
3
+ colorAssign('black', '#000000');
4
+ colorAssign('white', '#ffffff');
5
+
6
+ declare module 'amateras/core' {
7
+ export namespace $ {
8
+ export namespace color {
9
+ export const black: '#000000';
10
+ export const white: '#ffffff';
11
+ }
12
+ }
13
+ }
@@ -0,0 +1,25 @@
1
+ import { colorAssign } from "../colorAssign";
2
+
3
+ const _blue = {
4
+ 50: '#eff6ff',
5
+ 100: '#dbeafe',
6
+ 200: '#bfdbfe',
7
+ 300: '#93c5fd',
8
+ 400: '#60a5fa',
9
+ 500: '#3b82f6',
10
+ 600: '#2563eb',
11
+ 700: '#1d4ed8',
12
+ 800: '#1e40af',
13
+ 900: '#1e3a8a',
14
+ 950: '#172554',
15
+ } as const;
16
+
17
+ colorAssign('blue', _blue);
18
+
19
+ declare module 'amateras/core' {
20
+ export namespace $ {
21
+ export namespace color {
22
+ export const blue: typeof _blue;
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,25 @@
1
+ import { colorAssign } from "../colorAssign";
2
+
3
+ const _cyan = {
4
+ 50: '#ecfeff',
5
+ 100: '#cffafe',
6
+ 200: '#a5f3fc',
7
+ 300: '#67e8f9',
8
+ 400: '#22d3ee',
9
+ 500: '#06b6d4',
10
+ 600: '#0891b2',
11
+ 700: '#0e7490',
12
+ 800: '#155e75',
13
+ 900: '#164e63',
14
+ 950: '#083344',
15
+ } as const;
16
+
17
+ colorAssign('cyan', _cyan);
18
+
19
+ declare module 'amateras/core' {
20
+ export namespace $ {
21
+ export namespace color {
22
+ export const cyan: typeof _cyan;
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,25 @@
1
+ import { colorAssign } from "../colorAssign";
2
+
3
+ const _emerald = {
4
+ 50: '#ecfdf5',
5
+ 100: '#d1fae5',
6
+ 200: '#a7f3d0',
7
+ 300: '#6ee7b7',
8
+ 400: '#34d399',
9
+ 500: '#10b981',
10
+ 600: '#059669',
11
+ 700: '#047857',
12
+ 800: '#065f46',
13
+ 900: '#064e3b',
14
+ 950: '#022c22',
15
+ } as const;
16
+
17
+ colorAssign('emerald', _emerald);
18
+
19
+ declare module 'amateras/core' {
20
+ export namespace $ {
21
+ export namespace color {
22
+ export const emerald: typeof _emerald;
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,25 @@
1
+ import { colorAssign } from "../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 module 'amateras/core' {
20
+ export namespace $ {
21
+ export namespace color {
22
+ export const fuchsia: typeof _fuchsia;
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,25 @@
1
+ import { colorAssign } from "../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 module 'amateras/core' {
20
+ export namespace $ {
21
+ export namespace color {
22
+ export const gray: typeof _gray;
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,25 @@
1
+ import { colorAssign } from "../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 module 'amateras/core' {
20
+ export namespace $ {
21
+ export namespace color {
22
+ export const green: typeof _green;
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,25 @@
1
+ import { colorAssign } from "../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 module 'amateras/core' {
20
+ export namespace $ {
21
+ export namespace color {
22
+ export const indigo: typeof _indigo;
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,25 @@
1
+ import { colorAssign } from "../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 module 'amateras/core' {
20
+ export namespace $ {
21
+ export namespace color {
22
+ export const lime: typeof _lime;
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,25 @@
1
+ import { colorAssign } from "../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 module 'amateras/core' {
20
+ export namespace $ {
21
+ export namespace color {
22
+ export const neutral: typeof _neutral;
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,25 @@
1
+ import { colorAssign } from "../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 module 'amateras/core' {
20
+ export namespace $ {
21
+ export namespace color {
22
+ export const orange: typeof _orange;
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,25 @@
1
+ import { colorAssign } from "../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 module 'amateras/core' {
20
+ export namespace $ {
21
+ export namespace color {
22
+ export const pink: typeof _pink;
23
+ }
24
+ }
25
+ }