@robert.tools/atom-text 0.0.0-stage → 1.0.1
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/LICENSE +21 -0
- package/README.md +52 -2
- package/dist/index.d.ts +0 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/package.json +68 -5
- package/src/index.css +8 -0
- package/src/index.njk +22 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Robert Willemelis
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,53 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 🗂️ @robert.tools/atom-text
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A component to provide text elements.
|
|
4
|
+
|
|
5
|
+
## 📜 Usage
|
|
6
|
+
|
|
7
|
+
### 🟢 Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @robert.tools/atom-text
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### 📝 Sample usage
|
|
14
|
+
|
|
15
|
+
#### prerequisites
|
|
16
|
+
|
|
17
|
+
- define css variables
|
|
18
|
+
|
|
19
|
+
#### Template
|
|
20
|
+
|
|
21
|
+
Use the text component as shown below:
|
|
22
|
+
|
|
23
|
+
```html
|
|
24
|
+
{{ component("atom/text", {}) }}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
#### CSS
|
|
28
|
+
|
|
29
|
+
Use the basic styling
|
|
30
|
+
|
|
31
|
+
```css
|
|
32
|
+
@import '@robert.tools/atom-text/index.css';
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
#### TypeScript
|
|
36
|
+
|
|
37
|
+
Include TypeScript by importing the component
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
import * as AtomText from '@robert.tools/atom-text';
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## ⚖️ Notes
|
|
44
|
+
|
|
45
|
+
This software is hand-crafted, test-driven and assisted by AI tools. I know each
|
|
46
|
+
line of my code. ✌️
|
|
47
|
+
|
|
48
|
+
| Tool | Comment |
|
|
49
|
+
| --- | --- |
|
|
50
|
+
|  | Test-driven development with Jest |
|
|
51
|
+
|  | Part of the robert.tools ecosystem |
|
|
52
|
+
|  | Code completion |
|
|
53
|
+
|  | chatGPT research |
|
package/dist/index.d.ts
ADDED
|
File without changes
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,69 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
"name": "@robert.tools/atom-text",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "A component to provide text elements.",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"default": "./dist/index.js"
|
|
10
|
+
},
|
|
11
|
+
"./index.njk": "./src/index.njk",
|
|
12
|
+
"./index.css": "./src/index.css"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"src/index.njk",
|
|
17
|
+
"src/index.css"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"init": "robi init",
|
|
21
|
+
"release": "robi release",
|
|
22
|
+
"status": "robi status",
|
|
23
|
+
"version": "robi version",
|
|
24
|
+
"verbose": "robi verbose",
|
|
25
|
+
"pub": "npm whoami && npm publish --access public",
|
|
26
|
+
"build": "rm -rf dist && tsc -p tsconfig.build.json",
|
|
27
|
+
"test": "jest --coverage --runInBand --verbose --no-watchman",
|
|
28
|
+
"lint": "eslint .",
|
|
29
|
+
"check": "npm run lint && npm test && npm run build",
|
|
30
|
+
"prepublishOnly": "npm run check"
|
|
31
|
+
},
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "git+https://github.com/willi84/atom-text.git"
|
|
35
|
+
},
|
|
36
|
+
"bugs": {
|
|
37
|
+
"url": "https://github.com/willi84/atom-text/issues"
|
|
38
|
+
},
|
|
39
|
+
"homepage": "https://github.com/willi84/atom-text#readme",
|
|
40
|
+
"keywords": [
|
|
41
|
+
"typescript",
|
|
42
|
+
"node",
|
|
43
|
+
"atom-text",
|
|
44
|
+
"robert.tools"
|
|
45
|
+
],
|
|
46
|
+
"author": "Robert Willemelis",
|
|
47
|
+
"license": "MIT",
|
|
48
|
+
"engines": {
|
|
49
|
+
"node": ">=22"
|
|
50
|
+
},
|
|
51
|
+
"publishConfig": {
|
|
52
|
+
"access": "public",
|
|
53
|
+
"registry": "https://registry.npmjs.org/"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@robert.tools/setup": "^1.3.0",
|
|
57
|
+
"@types/jest": "^29.5.14",
|
|
58
|
+
"@types/node": "^24.0.0",
|
|
59
|
+
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
60
|
+
"@typescript-eslint/parser": "^8.0.0",
|
|
61
|
+
"eslint": "^9.0.0",
|
|
62
|
+
"eslint-config-prettier": "^10.1.8",
|
|
63
|
+
"eslint-plugin-prettier": "^5.5.6",
|
|
64
|
+
"jest": "^29.7.0",
|
|
65
|
+
"jest-environment-jsdom": "^29.6.2",
|
|
66
|
+
"ts-jest": "^29.4.0",
|
|
67
|
+
"typescript": "^5.9.0"
|
|
68
|
+
}
|
|
69
|
+
}
|
package/src/index.css
ADDED
package/src/index.njk
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{% set tag = params.tag or "span" %}
|
|
2
|
+
{% set css_base = params.css or "text--standard" %}
|
|
3
|
+
{% set css_modifier = params.css_modifier or "" %}
|
|
4
|
+
{% set css = (css_base ~ " " ~ css_modifier) | trim %}
|
|
5
|
+
|
|
6
|
+
{% set text = (params.prefix or "") ~ params.text ~ (params.suffix or "") %}
|
|
7
|
+
|
|
8
|
+
{% if params.text is defined %}
|
|
9
|
+
{% if tag == 'span' %}
|
|
10
|
+
<span class="{{css}}" data-component="text.atom">{{ text }}</span>
|
|
11
|
+
{% elif tag == 'h1' %}
|
|
12
|
+
<h1 class="{{css}}" data-component="text.atom">{{ text }}</h1>
|
|
13
|
+
{% elif tag == 'h2' %}
|
|
14
|
+
<h2 class="{{css}}" data-component="text.atom">{{ text }}</h2>
|
|
15
|
+
{% elif tag == 'h3' %}
|
|
16
|
+
<h3 class="{{css}}" data-component="text.atom">{{ text }}</h3>
|
|
17
|
+
{% elif tag == 'p' %}
|
|
18
|
+
<p class="{{css}}" data-component="text.atom">{{ text }}</p>
|
|
19
|
+
{% else %}
|
|
20
|
+
{{ text }}
|
|
21
|
+
{% endif %}
|
|
22
|
+
{% endif %}
|