amateras 0.2.0 → 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.
- package/README.md +19 -3
- package/ext/css/src/index.ts +102 -45
- package/ext/css/src/lib/colorAssign.ts +6 -0
- package/ext/css/src/lib/colors/amber.ts +25 -0
- package/ext/css/src/lib/colors/blackwhite.ts +13 -0
- package/ext/css/src/lib/colors/blue.ts +25 -0
- package/ext/css/src/lib/colors/cyan.ts +25 -0
- package/ext/css/src/lib/colors/emerald.ts +25 -0
- package/ext/css/src/lib/colors/fuchsia.ts +25 -0
- package/ext/css/src/lib/colors/gray.ts +25 -0
- package/ext/css/src/lib/colors/green.ts +25 -0
- package/ext/css/src/lib/colors/indigo.ts +25 -0
- package/ext/css/src/lib/colors/lime.ts +25 -0
- package/ext/css/src/lib/colors/neutral.ts +25 -0
- package/ext/css/src/lib/colors/orange.ts +25 -0
- package/ext/css/src/lib/colors/pink.ts +25 -0
- package/ext/css/src/lib/colors/purple.ts +25 -0
- package/ext/css/src/lib/colors/red.ts +25 -0
- package/ext/css/src/lib/colors/rose.ts +25 -0
- package/ext/css/src/lib/colors/sky.ts +25 -0
- package/ext/css/src/lib/colors/slate.ts +25 -0
- package/ext/css/src/lib/colors/stone.ts +25 -0
- package/ext/css/src/lib/colors/teal.ts +25 -0
- package/ext/css/src/lib/colors/violet.ts +25 -0
- package/ext/css/src/lib/colors/yellow.ts +25 -0
- package/ext/css/src/lib/colors/zinc.ts +25 -0
- package/ext/css/src/lib/colors.ts +23 -0
- package/ext/css/src/structure/$CSSKeyframesRule.ts +1 -5
- package/ext/css/src/structure/$CSSMediaRule.ts +3 -23
- package/ext/css/src/structure/$CSSRule.ts +6 -18
- package/ext/css/src/structure/$CSSStyleRule.ts +10 -12
- package/ext/html/node/$Anchor.ts +31 -1
- package/ext/html/node/$Image.ts +54 -1
- package/ext/html/node/$Input.ts +154 -1
- package/ext/html/node/$OptGroup.ts +8 -1
- package/ext/html/node/$Option.ts +25 -1
- package/ext/html/node/$Select.ts +61 -1
- package/ext/router/index.ts +6 -4
- package/ext/router/node/Route.ts +2 -2
- package/ext/router/node/Router.ts +49 -15
- package/ext/router/node/RouterAnchor.ts +1 -1
- package/ext/ssr/index.ts +4 -4
- package/package.json +3 -1
- package/src/core.ts +19 -15
- package/src/global.ts +4 -0
- package/src/lib/assign.ts +4 -3
- package/src/lib/assignHelper.ts +1 -1
- package/src/lib/native.ts +14 -3
- package/src/node/$Element.ts +128 -24
- package/src/node/$HTMLElement.ts +70 -1
- package/src/node/$Node.ts +101 -30
- package/src/node/node.ts +2 -1
- package/src/structure/Signal.ts +3 -3
- package/ext/css/src/structure/$CSSKeyframeRule.ts +0 -14
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')
|
|
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')
|
|
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';
|
package/ext/css/src/index.ts
CHANGED
|
@@ -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,12 +7,11 @@ 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: $
|
|
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;
|
|
@@ -29,7 +28,7 @@ declare module 'amateras/node/$Element' {
|
|
|
29
28
|
}
|
|
30
29
|
|
|
31
30
|
const generatedIds = new Set<string>();
|
|
32
|
-
function generateId(lettercase
|
|
31
|
+
function generateId(lettercase: 'any' | 'lower' | 'upper' = 'any'): string {
|
|
33
32
|
const id = randomId({lettercase: lettercase});
|
|
34
33
|
if (generatedIds.has(id)) return generateId(lettercase);
|
|
35
34
|
generatedIds.add(id);
|
|
@@ -37,16 +36,18 @@ function generateId(lettercase?: 'any' | 'lower' | 'upper'): string {
|
|
|
37
36
|
}
|
|
38
37
|
|
|
39
38
|
const stylesheet = $.stylesheet;
|
|
39
|
+
const cssTextMap = new Map<string, $CSSOptions>
|
|
40
40
|
|
|
41
|
-
function processCSSOptions<T extends $CSSStyleRule
|
|
41
|
+
function processCSSOptions<T extends $CSSStyleRule>(
|
|
42
42
|
rule: T,
|
|
43
|
-
options: $
|
|
44
|
-
context: string[] = [],
|
|
43
|
+
options: $CSSOptions,
|
|
45
44
|
): T {
|
|
46
45
|
for (const [key, value] of _Object_entries(options)) {
|
|
47
46
|
if (isUndefined(value)) continue;
|
|
48
|
-
if (
|
|
49
|
-
|
|
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) );
|
|
50
51
|
else {
|
|
51
52
|
const declaration = new $CSSDeclaration(key, `${value}`);
|
|
52
53
|
rule.declarations.set(declaration.key, declaration);
|
|
@@ -55,56 +56,90 @@ function processCSSOptions<T extends $CSSStyleRule | $CSSKeyframeRule>(
|
|
|
55
56
|
return rule;
|
|
56
57
|
}
|
|
57
58
|
|
|
58
|
-
|
|
59
|
-
|
|
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);
|
|
60
64
|
if (selector.startsWith('@keyframes')) return createKeyframesRule(selector.replace('@keyframes ', ''), options as $CSSKeyframesType)
|
|
61
|
-
return createStyleRule(
|
|
65
|
+
return createStyleRule(selector, options);
|
|
62
66
|
}
|
|
63
67
|
|
|
64
|
-
function createStyleRule<T extends $CSSRule>(
|
|
65
|
-
function createStyleRule<T extends $CSSOptions>(
|
|
66
|
-
function createStyleRule<T extends $CSSOptions>(
|
|
67
|
-
|
|
68
|
-
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);
|
|
69
72
|
}
|
|
70
73
|
|
|
71
|
-
function createMediaRule(
|
|
72
|
-
const rule = new $CSSMediaRule(
|
|
74
|
+
function createMediaRule(selector: string, options: $CSSOptions, context?: string) {
|
|
75
|
+
const rule = new $CSSMediaRule(selector);
|
|
73
76
|
// create media rule from $.CSS
|
|
74
|
-
if (
|
|
77
|
+
if (!context) forEach(_Object_entries(options), ([key, value]) => rule.rules.add( createRule(key, value) ))
|
|
75
78
|
// create from $.css
|
|
76
|
-
else rule.
|
|
79
|
+
else rule.rules.add( createStyleRule(context, options) );
|
|
77
80
|
return rule;
|
|
78
81
|
}
|
|
79
82
|
|
|
80
83
|
function createKeyframesRule(name: string, options: $CSSKeyframesType) {
|
|
81
84
|
const rule = new $CSSKeyframesRule(name);
|
|
82
|
-
_Object_entries(options)
|
|
83
|
-
rule.
|
|
85
|
+
forEach(_Object_entries(options), ([key, value]) => {
|
|
86
|
+
rule.rules.add( processCSSOptions(new $CSSStyleRule(key), value) );
|
|
84
87
|
})
|
|
85
88
|
return rule;
|
|
86
89
|
}
|
|
87
90
|
|
|
88
|
-
function insertRule(rule: $CSSRule
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
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'
|
|
95
127
|
}
|
|
96
128
|
|
|
97
129
|
_Object_assign($, {
|
|
98
130
|
css(options: $CSSOptions) {
|
|
99
131
|
if (_instanceof(options, $CSSRule)) return options;
|
|
132
|
+
const cssText = _JSON_stringify(options);
|
|
133
|
+
const cacheRule = cssTextMap.get(cssText);
|
|
134
|
+
if (cacheRule) return cacheRule;
|
|
100
135
|
const className = `.${generateId()}`;
|
|
101
|
-
const rule = createStyleRule(
|
|
102
|
-
|
|
136
|
+
const rule = createStyleRule(className, options);
|
|
137
|
+
cssTextMap.set(_JSON_stringify(options), rule);
|
|
103
138
|
return insertRule( rule );
|
|
104
139
|
},
|
|
105
140
|
CSS(options: $CSSSelectorType | $CSSMediaRule) {
|
|
106
141
|
return _Object_entries(options).map(([selector, declarations]) => {
|
|
107
|
-
return insertRule( createRule(selector, declarations
|
|
142
|
+
return insertRule( createRule(selector, declarations) );
|
|
108
143
|
})
|
|
109
144
|
}
|
|
110
145
|
})
|
|
@@ -143,31 +178,30 @@ _Object_assign($.css, {
|
|
|
143
178
|
|
|
144
179
|
_Object_assign($Element.prototype, {
|
|
145
180
|
css(this: $Element, ...options: $CSSOptions[]) {
|
|
146
|
-
|
|
181
|
+
forEach(options, options => {
|
|
147
182
|
const rule = $.css(options);
|
|
148
|
-
this.addClass(rule.
|
|
183
|
+
this.addClass(rule.selector.replace(/^./, ''));
|
|
149
184
|
})
|
|
150
185
|
return this;
|
|
151
186
|
}
|
|
152
187
|
})
|
|
153
188
|
|
|
154
189
|
export * from "#structure/$CSSDeclaration";
|
|
155
|
-
export * from "#structure/$CSSKeyframeRule";
|
|
156
190
|
export * from "#structure/$CSSKeyframesRule";
|
|
157
191
|
export * from "#structure/$CSSMediaRule";
|
|
158
192
|
export * from "#structure/$CSSRule";
|
|
159
193
|
export * from "#structure/$CSSStyleRule";
|
|
160
194
|
export * from "#structure/$CSSVariable";
|
|
161
195
|
|
|
162
|
-
type $CSSOptions = $CSSDeclarationType | $CSSSelectorType | $CSSStyleRule | $CSSMediaSelectorType<true>;
|
|
163
|
-
type $CSSValueType = '' | 'unset' | 'initial' | 'inherit' | string & {} | number | $CSSVariable
|
|
164
|
-
type $CSSDeclarationType = { [key in keyof $CSSDeclarationMap]?: $CSSDeclarationMap[key] }
|
|
165
|
-
type $CSSSelectorType = { [key: string & {}]: $CSSOptions }
|
|
166
|
-
type $CSSMediaSelectorType<Nested extends boolean> = { [key: `@media ${string}`]: Nested extends true ? $CSSOptions : $CSSSelectorType | $CSSMediaSelectorType<Nested> }
|
|
167
|
-
type $CSSVariableType<T = any> = { [key in keyof T]: $CSSValueType }
|
|
168
|
-
type $CSSVariableConditionType<T extends $CSSVariableType | string> = T extends string ? { [key: string]: $CSSValueType } : { [key: string]:
|
|
169
|
-
type $CSSKeyframesSelectorType = { [key: `@keyframes ${string}`]: $CSSKeyframesType }
|
|
170
|
-
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 }
|
|
171
205
|
|
|
172
206
|
type $CSSDeclarationMap = {
|
|
173
207
|
[key in keyof CSSStyleDeclaration]: $CSSValueType;
|
|
@@ -325,6 +359,12 @@ type $CSSDeclarationMap = {
|
|
|
325
359
|
marginLeft?: string;
|
|
326
360
|
marginRight?: string;
|
|
327
361
|
marginTop?: string;
|
|
362
|
+
marginBlock?: string;
|
|
363
|
+
marginBlockStart?: string;
|
|
364
|
+
marginBlockEnd?: string;
|
|
365
|
+
marginInline?: string;
|
|
366
|
+
marginInlineStart?: string;
|
|
367
|
+
marginInlineEnd?: string;
|
|
328
368
|
mask?: string;
|
|
329
369
|
maskClip?: string;
|
|
330
370
|
maskComposite?: string;
|
|
@@ -361,6 +401,12 @@ type $CSSDeclarationMap = {
|
|
|
361
401
|
paddingLeft?: string;
|
|
362
402
|
paddingRight?: string;
|
|
363
403
|
paddingTop?: string;
|
|
404
|
+
paddingBlock?: string;
|
|
405
|
+
paddingBlockStart?: string;
|
|
406
|
+
paddingBlockEnd?: string;
|
|
407
|
+
paddingInline?: string;
|
|
408
|
+
paddingInlineStart?: string;
|
|
409
|
+
paddingInlineEnd?: string;
|
|
364
410
|
pageBreakAfter?: 'auto' | 'always' | 'avoid' | 'left' | 'right';
|
|
365
411
|
pageBreakBefore?: 'auto' | 'always' | 'avoid' | 'left' | 'right';
|
|
366
412
|
pageBreakInside?: 'auto' | 'avoid';
|
|
@@ -379,6 +425,17 @@ type $CSSDeclarationMap = {
|
|
|
379
425
|
rowGap?: string;
|
|
380
426
|
scale?: string;
|
|
381
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;
|
|
382
439
|
shapeRendering?: 'auto' | 'optimizeSpeed' | 'crispEdges' | 'geometricPrecision';
|
|
383
440
|
stopColor?: string;
|
|
384
441
|
stopOpacity?: string;
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { colorAssign } from "../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 module 'amateras/core' {
|
|
20
|
+
export namespace $ {
|
|
21
|
+
export namespace color {
|
|
22
|
+
export const purple: typeof _purple;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|