amateras 0.3.0 → 0.4.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 (42) hide show
  1. package/README.md +6 -4
  2. package/ext/css/README.md +19 -0
  3. package/ext/css/src/index.ts +347 -331
  4. package/ext/css/src/lib/colorAssign.ts +1 -1
  5. package/ext/css/src/structure/$CSSContainerRule.ts +13 -0
  6. package/ext/css/src/structure/$CSSRule.ts +1 -1
  7. package/ext/css/src/structure/$CSSStyleRule.ts +0 -7
  8. package/ext/css/src/structure/$CSSVariable.ts +3 -3
  9. package/ext/html/html.ts +1 -13
  10. package/ext/i18n/README.md +53 -0
  11. package/ext/i18n/package.json +10 -0
  12. package/ext/i18n/src/index.ts +54 -0
  13. package/ext/i18n/src/node/I18nText.ts +35 -0
  14. package/ext/i18n/src/structure/I18n.ts +40 -0
  15. package/ext/i18n/src/structure/I18nDictionary.ts +31 -0
  16. package/ext/markdown/index.ts +123 -0
  17. package/ext/router/index.ts +8 -1
  18. package/ext/router/node/Page.ts +1 -0
  19. package/ext/router/node/Route.ts +2 -1
  20. package/ext/router/node/Router.ts +33 -22
  21. package/ext/ssr/index.ts +4 -2
  22. package/ext/ui/lib/VirtualScroll.ts +24 -0
  23. package/ext/ui/node/Accordian.ts +97 -0
  24. package/ext/ui/node/Tabs.ts +114 -0
  25. package/ext/ui/node/Toast.ts +16 -0
  26. package/ext/ui/node/Waterfall.ts +73 -0
  27. package/ext/ui/package.json +11 -0
  28. package/package.json +4 -7
  29. package/src/core.ts +21 -8
  30. package/src/lib/assign.ts +8 -9
  31. package/src/lib/assignHelper.ts +1 -1
  32. package/src/lib/chain.ts +3 -0
  33. package/src/lib/debounce.ts +7 -0
  34. package/src/lib/env.ts +2 -0
  35. package/src/lib/native.ts +22 -35
  36. package/src/lib/randomId.ts +1 -1
  37. package/src/lib/sleep.ts +1 -1
  38. package/src/node/$Element.ts +182 -20
  39. package/src/node/$HTMLElement.ts +24 -0
  40. package/src/node/$Node.ts +75 -52
  41. package/src/node/$Virtual.ts +58 -0
  42. package/src/{node/node.ts → node.ts} +2 -5
package/README.md CHANGED
@@ -99,9 +99,11 @@ $(document.body).content([
99
99
  ```
100
100
 
101
101
  ## Packages
102
+ The packages size result using Vite 7.0 with default bundle settings, polyfills code size included.
102
103
  | Package name | Size | Size(gzip) | Description |
103
104
  | --- | --- | --- | --- |
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 |
105
+ | amateras | 5.71 kB | 2.48 kB | Core |
106
+ | amateras/html | 0.97 kB | 0.25 kB | Import HTMLElement types and methods |
107
+ | [amateras/css](./ext/css/README.md) | 3.65 kB | 1.41 kB | Style in JS |
108
+ | [amateras/router](./ext/router/README.md) | 3.74 kB | 1.69 kB | Amateras Router |
109
+ | [amateras/i18n](./ext/i18n/README.md) | 1.49 kB | 0.57 kB | I18n translations |
package/ext/css/README.md CHANGED
@@ -106,4 +106,23 @@ $(document.body).content([
106
106
  $('h1').class('title').content('A red color title.')
107
107
  ])
108
108
 
109
+ ```
110
+
111
+ ### CSS Colors Preset
112
+ You can import colors preset from `amateras/color/COLOR_NAME` or `amateras/colors` path. These colors are reference from Tailwind colors, read the [documentation](https://tailwindcss.com/docs/colors) to know about the concepts.
113
+ ```ts
114
+ // import black and white color preset
115
+ import 'amateras/color/blackwhite';
116
+ $.color.black; // '#000000'
117
+ $.color.white; // '#ffffff'
118
+
119
+ // import slate colors preset
120
+ import 'amateras/color/slate';
121
+ $.color.slate[100]; // '#f1f5f9'
122
+ $.color.slate[200]; // '#e2e8f0'
123
+
124
+ // import all colors preset
125
+ import 'amateras/colors';
126
+ $.color.red[600]; // '#dc2626'
127
+ $.color.zinc[500]; // '#71717a'
109
128
  ```