@redvars/peacock 3.1.0 → 3.1.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/.rollup.cache/E/git/redvars/peacock/components/dist/src/avatar/avatar.css.js +3 -3
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/avatar/avatar.css.js.map +1 -1
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/avatar/avatar.d.ts +0 -6
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/avatar/avatar.js +0 -6
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/avatar/avatar.js.map +1 -1
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/avatar/p-avatar.d.ts +10 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/avatar/p-avatar.js +17 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/avatar/p-avatar.js.map +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/badge/badge.css.d.ts +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/badge/badge.css.js +33 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/badge/badge.css.js.map +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/badge/badge.d.ts +9 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/badge/badge.js +37 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/badge/badge.js.map +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/badge/index.d.ts +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/badge/index.js +2 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/badge/index.js.map +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/badge/p-badge.d.ts +8 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/badge/p-badge.js +15 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/badge/p-badge.js.map +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/icon/icon.d.ts +0 -6
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/icon/icon.js +0 -7
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/icon/icon.js.map +1 -1
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/icon/p-icon.d.ts +8 -1
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/icon/p-icon.js +11 -4
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/icon/p-icon.js.map +1 -1
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/index.d.ts +3 -2
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/index.js +3 -2
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/index.js.map +1 -1
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/link/index.d.ts +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/link/index.js +2 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/link/index.js.map +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/link/link.css.d.ts +2 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/link/link.css.js +36 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/link/link.css.js.map +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/link/link.d.ts +12 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/link/link.js +18 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/link/link.js.map +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/peacock-loader.js +31 -2
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/peacock-loader.js.map +1 -1
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/styleMixins.css.d.ts +9 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/styleMixins.css.js +46 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/styleMixins.css.js.map +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/text/text.css.d.ts +2 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/text/text.css.js +70 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/text/text.css.js.map +1 -0
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/utils.d.ts +0 -1
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/utils.js +0 -7
- package/.rollup.cache/E/git/redvars/peacock/components/dist/src/utils.js.map +1 -1
- package/.rollup.cache/E/git/redvars/peacock/components/dist/tsconfig.tsbuildinfo +1 -1
- package/{demo → assets}/tokens.css +60 -48
- package/copyDesignFiles.js +11 -0
- package/custom-elements-manifest.config.mjs +10 -22
- package/custom-elements.md +61 -137
- package/demo/index.html +21 -8
- package/dist/assets/styles/tokens.css +8 -1
- package/dist/{icon-1wpxQtrZ.js → avatar-GQwWRGRw.js} +94 -17
- package/dist/avatar-GQwWRGRw.js.map +1 -0
- package/dist/avatar-jfcIDB8G.js +424 -0
- package/dist/avatar-jfcIDB8G.js.map +1 -0
- package/dist/component/avatar.js +12 -8
- package/dist/component/avatar.js.map +1 -1
- package/dist/component/{Icon.js → icon.js} +96 -9
- package/dist/component/icon.js.map +1 -0
- package/dist/directive-CKEA2P55.js +70 -0
- package/dist/directive-CKEA2P55.js.map +1 -0
- package/dist/index.js +40 -61
- package/dist/index.js.map +1 -1
- package/dist/peacock-loader.js +132 -3
- package/dist/peacock-loader.js.map +1 -1
- package/dist/src/avatar/avatar.d.ts +0 -6
- package/dist/src/avatar/p-avatar.d.ts +10 -0
- package/dist/src/badge/badge.css.d.ts +1 -0
- package/dist/src/badge/badge.d.ts +9 -0
- package/dist/src/badge/index.d.ts +1 -0
- package/dist/src/badge/p-badge.d.ts +8 -0
- package/dist/src/icon/icon.d.ts +0 -6
- package/dist/src/icon/p-icon.d.ts +8 -1
- package/dist/src/index.d.ts +3 -2
- package/dist/src/link/link.css.d.ts +2 -0
- package/dist/src/styleMixins.css.d.ts +9 -0
- package/dist/src/text/text.css.d.ts +2 -0
- package/dist/src/utils.d.ts +0 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/web-types.json +78 -0
- package/package.json +15 -7
- package/readme-gen.mjs +15 -2
- package/readme.md +190 -0
- package/rollup.config.js +12 -8
- package/src/avatar/avatar.css.ts +2 -2
- package/src/avatar/avatar.ts +0 -6
- package/src/avatar/demo/index.html +2 -2
- package/src/avatar/p-avatar.ts +12 -0
- package/src/badge/badge.css.ts +33 -0
- package/src/badge/badge.ts +29 -0
- package/src/badge/demo/index.html +54 -0
- package/src/badge/index.ts +1 -0
- package/src/badge/p-badge.ts +10 -0
- package/src/icon/demo/index.html +4 -4
- package/src/icon/icon.ts +1 -7
- package/src/icon/p-icon.ts +8 -1
- package/src/index.ts +3 -2
- package/src/link/link.css.ts +36 -0
- package/src/peacock-loader.ts +40 -2
- package/src/styleMixins.css.ts +55 -0
- package/src/styles.d.ts +11 -0
- package/src/text/text.css.ts +76 -0
- package/src/utils.ts +0 -8
- package/tsconfig.json +1 -1
- package/README.md +0 -46
- package/dist/component/Icon.js.map +0 -1
- package/dist/icon-1wpxQtrZ.js.map +0 -1
- package/dist/src/LoaderUtils.js +0 -81
- package/dist/src/LoaderUtils.js.map +0 -1
- package/dist/src/avatar/avatar.css.js +0 -41
- package/dist/src/avatar/avatar.css.js.map +0 -1
- package/dist/src/avatar/avatar.js +0 -49
- package/dist/src/avatar/avatar.js.map +0 -1
- package/dist/src/avatar/index.js +0 -2
- package/dist/src/avatar/index.js.map +0 -1
- package/dist/src/icon/datasource.js +0 -20
- package/dist/src/icon/datasource.js.map +0 -1
- package/dist/src/icon/icon.css.js +0 -22
- package/dist/src/icon/icon.css.js.map +0 -1
- package/dist/src/icon/icon.js +0 -124
- package/dist/src/icon/icon.js.map +0 -1
- package/dist/src/icon/index.js +0 -2
- package/dist/src/icon/index.js.map +0 -1
- package/dist/src/icon/p-icon.js +0 -15
- package/dist/src/icon/p-icon.js.map +0 -1
- package/dist/src/index.js +0 -3
- package/dist/src/index.js.map +0 -1
- package/dist/src/peacock-loader.js +0 -16
- package/dist/src/peacock-loader.js.map +0 -1
- package/dist/src/utils.js +0 -101
- package/dist/src/utils.js.map +0 -1
- package/dist/test/icon.test.js +0 -14
- package/dist/test/icon.test.js.map +0 -1
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
|
+
"name": "@redvars/peacock",
|
|
4
|
+
"version": "3.1.0",
|
|
5
|
+
"description-markup": "markdown",
|
|
6
|
+
"contributions": {
|
|
7
|
+
"html": {
|
|
8
|
+
"elements": [
|
|
9
|
+
{
|
|
10
|
+
"name": "p-avatar",
|
|
11
|
+
"description": "The Avatar component is used to represent user, and displays the profile picture, initials or fallback icon.\n---\n\n\n### **CSS Properties:**\n - **--avatar-background-color** - Controls the color of the avatar. _(default: undefined)_\n- **--avatar-size** - Controls the size of the avatar. _(default: undefined)_",
|
|
12
|
+
"doc-url": "",
|
|
13
|
+
"attributes": [
|
|
14
|
+
{ "name": "name", "value": { "type": "string", "default": "''" } },
|
|
15
|
+
{ "name": "src", "value": { "type": "string | undefined" } }
|
|
16
|
+
],
|
|
17
|
+
"events": [],
|
|
18
|
+
"js": {
|
|
19
|
+
"properties": [
|
|
20
|
+
{ "name": "name", "type": "string" },
|
|
21
|
+
{ "name": "src", "type": "string | undefined" }
|
|
22
|
+
],
|
|
23
|
+
"events": []
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "p-icon",
|
|
28
|
+
"description": "Icons are visual symbols used to represent ideas, objects, or actions.\n---\n\n\n### **Events:**\n - **icon-error**\n\n### **CSS Properties:**\n - **--icon-color** - Controls the color of the icon. _(default: undefined)_\n- **--icon-size** - Controls the size of the icon. Defaults to \"1rem\" _(default: 1rem)_",
|
|
29
|
+
"doc-url": "",
|
|
30
|
+
"attributes": [
|
|
31
|
+
{ "name": "name", "value": { "type": "string | undefined" } },
|
|
32
|
+
{ "name": "src", "value": { "type": "string | undefined" } },
|
|
33
|
+
{
|
|
34
|
+
"name": "provider",
|
|
35
|
+
"value": {
|
|
36
|
+
"type": "'material-symbols' | 'carbon' | undefined",
|
|
37
|
+
"default": "'material-symbols'"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
"events": [{ "name": "icon-error", "type": "CustomEvent" }],
|
|
42
|
+
"js": {
|
|
43
|
+
"properties": [
|
|
44
|
+
{ "name": "name", "type": "string | undefined" },
|
|
45
|
+
{ "name": "src", "type": "string | undefined" },
|
|
46
|
+
{
|
|
47
|
+
"name": "provider",
|
|
48
|
+
"type": "'material-symbols' | 'carbon' | undefined"
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
"events": [{ "name": "icon-error", "type": "CustomEvent" }]
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
"css": {
|
|
57
|
+
"properties": [
|
|
58
|
+
{
|
|
59
|
+
"name": "--avatar-background-color",
|
|
60
|
+
"description": "Controls the color of the avatar."
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "--avatar-size",
|
|
64
|
+
"description": "Controls the size of the avatar."
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "--icon-color",
|
|
68
|
+
"description": "Controls the color of the icon."
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "--icon-size",
|
|
72
|
+
"description": "Controls the size of the icon. Defaults to \"1rem\""
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
"pseudo-elements": []
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
package/package.json
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"name": "@redvars/peacock",
|
|
3
3
|
"description": "The foundation for beautiful user interfaces",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
|
-
"version": "3.1.
|
|
5
|
+
"version": "3.1.1",
|
|
6
6
|
"type": "module",
|
|
7
|
-
"main": "dist/
|
|
8
|
-
"module": "dist/
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"module": "dist/index.js",
|
|
9
9
|
"keywords": [
|
|
10
10
|
"peacock",
|
|
11
11
|
"lit",
|
|
@@ -13,16 +13,17 @@
|
|
|
13
13
|
],
|
|
14
14
|
"exports": {
|
|
15
15
|
".": "./dist/src/index.js",
|
|
16
|
-
"./
|
|
16
|
+
"./icon.js": "./dist/src/index.js"
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|
|
19
19
|
"analyze": "cem analyze --config \"./custom-elements-manifest.config.mjs\" && node readme-gen.mjs",
|
|
20
|
-
"start": "
|
|
21
|
-
"build": "rollup -c && npm run analyze -- --exclude dist",
|
|
20
|
+
"start": "npm run copy_design_files && rollup -c && concurrently -k -r \"rollup -c -w\" \"web-dev-server\"",
|
|
21
|
+
"build": "npm run copy_design_files && rollup -c && npm run analyze -- --exclude dist",
|
|
22
22
|
"prepublish": "rollup -c && npm run analyze -- --exclude dist",
|
|
23
23
|
"lint": "eslint --ext .ts,.html . --ignore-path .gitignore && prettier \"**/*.ts\" --check --ignore-path .gitignore",
|
|
24
24
|
"format": "eslint --ext .ts,.html . --fix --ignore-path .gitignore && prettier \"**/*.ts\" --write --ignore-path .gitignore",
|
|
25
25
|
"prepare": "husky",
|
|
26
|
+
"copy_design_files": "node copyDesignFiles.js",
|
|
26
27
|
"test": "tsc && wtr --coverage",
|
|
27
28
|
"test:watch": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wtr --watch\""
|
|
28
29
|
},
|
|
@@ -44,13 +45,19 @@
|
|
|
44
45
|
"@web/dev-server": "^0.4.6",
|
|
45
46
|
"@web/test-runner": "^0.18.2",
|
|
46
47
|
"concurrently": "^8.2.2",
|
|
48
|
+
"custom-element-jet-brains-integration": "^1.7.0",
|
|
47
49
|
"eslint": "^8.57.0",
|
|
48
50
|
"eslint-config-prettier": "^9.1.0",
|
|
49
51
|
"husky": "^9.0.11",
|
|
50
52
|
"lint-staged": "^15.2.7",
|
|
51
53
|
"prettier": "^3.3.2",
|
|
52
54
|
"rollup-plugin-copy": "^3.5.0",
|
|
55
|
+
"rollup-plugin-import-css": "^4.1.2",
|
|
56
|
+
"rollup-plugin-sass": "^1.15.3",
|
|
57
|
+
"rollup-plugin-scss": "^4.0.1",
|
|
58
|
+
"rollup-plugin-scss-lit": "^2.1.0",
|
|
53
59
|
"rollup-plugin-summary": "^3.0.1",
|
|
60
|
+
"sass": "^1.97.2",
|
|
54
61
|
"tslib": "^2.6.3",
|
|
55
62
|
"typescript": "^5.5.3",
|
|
56
63
|
"unplugin-jsdelivr": "^1.0.0"
|
|
@@ -92,5 +99,6 @@
|
|
|
92
99
|
"prettier --write"
|
|
93
100
|
]
|
|
94
101
|
},
|
|
95
|
-
"customElements": "dist/custom-elements.json"
|
|
102
|
+
"customElements": "dist/custom-elements.json",
|
|
103
|
+
"web-types": "dist/web-types.json"
|
|
96
104
|
}
|
package/readme-gen.mjs
CHANGED
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import { customElementsManifestToMarkdown } from '@custom-elements-manifest/to-markdown';
|
|
3
3
|
|
|
4
|
-
const
|
|
4
|
+
const customElements = JSON.parse(
|
|
5
5
|
fs.readFileSync('./dist/custom-elements.json', 'utf-8'),
|
|
6
6
|
);
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
customElements.modules = customElements.modules.filter(module =>
|
|
9
|
+
module.declarations.find(d => d.customElement),
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
const markdown = customElementsManifestToMarkdown(customElements, {
|
|
8
13
|
private: 'hidden',
|
|
14
|
+
omitSections: [
|
|
15
|
+
'mixins',
|
|
16
|
+
'variables',
|
|
17
|
+
'functions',
|
|
18
|
+
'exports',
|
|
19
|
+
'staticFields',
|
|
20
|
+
'staticMethods',
|
|
21
|
+
],
|
|
9
22
|
});
|
|
10
23
|
|
|
11
24
|
fs.writeFileSync('./custom-elements.md', markdown);
|
package/readme.md
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
# Peacock
|
|
2
|
+
**The foundation for beautiful user interfaces.**
|
|
3
|
+
|
|
4
|
+
[](https://github.com/goatui/components/actions?workflow=Build)
|
|
5
|
+
[](/LICENSE)
|
|
6
|
+

|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<div align="center">
|
|
10
|
+
<img alt="Peacock LOGO" src="./logo.png" width="210">
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
Peacock gives you the tools and foundation to build beautiful, usable product interfaces. It’s the system you use to craft your own component library.
|
|
14
|
+
|
|
15
|
+
## What is Peacock?
|
|
16
|
+
Peacock is more than just a collection of components; it is an aesthetic philosophy. Like its avian namesake, it provides the core elements (the primitives) that allow the full, vibrant display (the design) to be unveiled.
|
|
17
|
+
|
|
18
|
+
**Opinionated Beauty:** We deliver pre-styled, beautiful components that follow modern design trends, significantly reducing the boilerplate needed to achieve a professional look.
|
|
19
|
+
|
|
20
|
+
**Foundation First:** Similar to projects like `shadcn/ui`, Peacock focuses on providing the foundational primitives, ensuring maximum flexibility for customization without sacrificing initial polish.
|
|
21
|
+
|
|
22
|
+
**Seamless Integration:** Designed with modern web frameworks in mind (e.g., React, Vue), integrating Peacock into your existing project structure is fast, efficient, and empowering.
|
|
23
|
+
|
|
24
|
+
## Key Features
|
|
25
|
+
Vibrant & Consistent Design System: Every component—from buttons and cards to complex data tables—shares a cohesive, high-quality visual language.
|
|
26
|
+
|
|
27
|
+
**Highly Extensible:** The component structure is designed for easy overwriting and theme customization, allowing you to quickly adapt the style to your specific brand identity.
|
|
28
|
+
|
|
29
|
+
**Built for Accessibility:** Focus on semantic HTML and proper ARIA attributes to ensure that your beautiful interfaces are accessible to all users.
|
|
30
|
+
|
|
31
|
+
**Responsive by Default:** Components are built with responsiveness baked in, guaranteeing a graceful display across all screen sizes and devices.
|
|
32
|
+
|
|
33
|
+
## Documentation
|
|
34
|
+
Visit [https://peacock.redvars.com](https://goatui.com) to view the documentation.
|
|
35
|
+
|
|
36
|
+
## Getting Started
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
```html
|
|
40
|
+
<!doctype html>
|
|
41
|
+
<html lang='en'>
|
|
42
|
+
<head>
|
|
43
|
+
<meta charset='utf-8' />
|
|
44
|
+
<meta name='viewport' content='width=device-width' />
|
|
45
|
+
<title>Goat UI Component</title>
|
|
46
|
+
|
|
47
|
+
<link href="https://cdn.jsdelivr.net/npm/@redvars/components@3.1.0/dist/assets/styles/tokens.css" rel='stylesheet' />
|
|
48
|
+
|
|
49
|
+
<script type='module'
|
|
50
|
+
src='https://cdn.jsdelivr.net/npm/@redvars/components@3.1.0/dist/peacock-loader.js'></script>
|
|
51
|
+
|
|
52
|
+
<!-- Default font : Noto Sans and Noto Sans Mono -->
|
|
53
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
54
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
55
|
+
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+Mono:wght@100..900&family=Noto+Sans:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet">
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
</head>
|
|
59
|
+
<body>
|
|
60
|
+
<p-avatar name="Shivaji Varma"></p-icon>
|
|
61
|
+
|
|
62
|
+
</body>
|
|
63
|
+
</html>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
# Components
|
|
67
|
+
|
|
68
|
+
- 🟢 ready (feature complete for now)
|
|
69
|
+
- 🟡 beta (changes possible, not feature complete)
|
|
70
|
+
- 🔴 not ready (unstyled / no functions)
|
|
71
|
+
- 🔵 planned (created, but empty files)
|
|
72
|
+
|
|
73
|
+
## Input Controls
|
|
74
|
+
|
|
75
|
+
Input controls are UI design elements that allow users to input information into the system. They are essential for
|
|
76
|
+
collecting data and enabling user interactions. Some common examples of input controls include text fields, dropdown
|
|
77
|
+
menus, checkboxes, and radio buttons.
|
|
78
|
+
|
|
79
|
+
| Name | Component | State |
|
|
80
|
+
|------------------------------------------------------------|----------------------|-------|
|
|
81
|
+
| [Code editor](https://peacock.redvars.com/components/code-editor) | p-card-editor | 🟢 |
|
|
82
|
+
| Color picker | p-color-picker | 🔴 |
|
|
83
|
+
| [Checkbox](https://peacock.redvars.com/components/checkbox) | p-checkbox | 🟢 |
|
|
84
|
+
| [Date picker](https://peacock.redvars.com/components/date-picker) | p-date-picker | 🟡 |
|
|
85
|
+
| Date Time picker | p-datetime-picker | 🔴 |
|
|
86
|
+
| [Form control](https://peacock.redvars.com/components/form-control) | p-form-control | 🟡 |
|
|
87
|
+
| File picker | p-file-picker | 🔴 |
|
|
88
|
+
| [HTML editor](https://peacock.redvars.com/components/html-editor) | p-html-editor | 🟢 |
|
|
89
|
+
| [Input](https://peacock.redvars.com/components/input) | p-input | 🟢 |
|
|
90
|
+
| [Input URL](https://peacock.redvars.com/components/input-url) | p-input-url | 🟢 |
|
|
91
|
+
| Month picker | p-month-picker | 🔴 |
|
|
92
|
+
| [Number](https://peacock.redvars.com/components/number) | p-number | 🟢 |
|
|
93
|
+
| [Select](https://peacock.redvars.com/components/select) | p-select | 🟢 |
|
|
94
|
+
| [Textarea](https://peacock.redvars.com/components/textarea) | p-textarea | 🟢 |
|
|
95
|
+
| [Time picker](https://peacock.redvars.com/components/time-picker) | p-time-picker | 🟡 |
|
|
96
|
+
| [URL input](https://peacock.redvars.com/components/url-input) | p-url-input. | 🔴 |
|
|
97
|
+
| Week picker | p-week-picker | 🔴 |
|
|
98
|
+
|
|
99
|
+
## Navigation
|
|
100
|
+
|
|
101
|
+
Navigational components are UI elements that help users move around the app or website. They provide users with a clear
|
|
102
|
+
and intuitive way to navigate through different sections and pages. Some common examples of navigational components
|
|
103
|
+
include menus, tabs, and breadcrumbs.
|
|
104
|
+
|
|
105
|
+
| Name | Component | State |
|
|
106
|
+
|--------------------------------------------------------|-----------------|-------|
|
|
107
|
+
| [Breadcrumb](https://peacock.redvars.com/components/breadcrumb) | p-breadcrumb | 🟢 |
|
|
108
|
+
| [Dropdown](https://peacock.redvars.com/components/dropdown) | p-dropdown | 🟡 |
|
|
109
|
+
| [Menu](https://peacock.redvars.com/components/menu) | p-menu | 🟡 |
|
|
110
|
+
| [Tabs](https://peacock.redvars.com/components/tabs) | p-tabs | 🟢 |
|
|
111
|
+
|
|
112
|
+
## Informational
|
|
113
|
+
|
|
114
|
+
Informational components are UI elements that provide information to users. They communicate important messages,
|
|
115
|
+
updates, or instructions within the app or website. Some common examples of informational components include
|
|
116
|
+
notifications, tooltips, and progress bars.
|
|
117
|
+
|
|
118
|
+
| Name | Component | State |
|
|
119
|
+
|----------------------------------------------------------------------------------|---------------------------|-------|
|
|
120
|
+
| [Badge](https://peacock.redvars.com/components/badge) | p-badge | 🟢 |
|
|
121
|
+
| [Progress](https://peacock.redvars.com/components/progress) | p-progress | 🟢 |
|
|
122
|
+
| [Spinner](https://peacock.redvars.com/components/spinner) | p-spinner | 🟢 |
|
|
123
|
+
| [Tooltip](https://peacock.redvars.com/components/tooltip) | p-tooltip | 🟢 |
|
|
124
|
+
| [Notification](https://peacock.redvars.com/components/notification) | p-notification | 🟢 |
|
|
125
|
+
| [Notification Manager](https://peacock.redvars.com/components/notification-manager) | p-notification-manager | 🟢 |
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
## Containers
|
|
129
|
+
|
|
130
|
+
Containers are UI elements that group similar content together, making it easier for users to navigate and scan through
|
|
131
|
+
the interface. Examples of common containers include cards, carousels, and accordions, which provide structure and
|
|
132
|
+
organization to the content.
|
|
133
|
+
|
|
134
|
+
| Name | Component | State |
|
|
135
|
+
|------------------------------------------------------|----------------|-------|
|
|
136
|
+
| [Accordion](https://peacock.redvars.com/components/accordion) | p-accordion | 🟢 |
|
|
137
|
+
| Card | p-card | 🟡 |
|
|
138
|
+
|
|
139
|
+
## General
|
|
140
|
+
|
|
141
|
+
These components are used for general purpose. They include
|
|
142
|
+
|
|
143
|
+
| Name | Component | State |
|
|
144
|
+
|----------------------------------------------------------------------------|---------------------------|-------|
|
|
145
|
+
| [Avatar](https://peacock.redvars.com/components/avatar) | p-avatar | 🟢 |
|
|
146
|
+
| [Button](https://peacock.redvars.com/components/button) | p-button | 🟢 |
|
|
147
|
+
| [Button Group](https://peacock.redvars.com/components/button-group) | p-button-group | 🟢 |
|
|
148
|
+
| [Calendar](https://peacock.redvars.com/components/calendar) | p-calendar | 🟢 |
|
|
149
|
+
| Card Select | p-cardselect | 🔴 |
|
|
150
|
+
| [Code Highlighter](https://peacock.redvars.com/components/code-highlighter) | p-card-highlighter | 🟢 |
|
|
151
|
+
| Column | p-col | 🔴 |
|
|
152
|
+
| [Empty State](https://peacock.redvars.com/components/empty-state) | p-empty-state | 🟡 |
|
|
153
|
+
| [Flow Designer ](https://peacock.redvars.com/components/flow-designer) | p-flow-designer | 🔵 |
|
|
154
|
+
| Grid | p-grid | 🔴 |
|
|
155
|
+
| Group | p-group | 🔴 |
|
|
156
|
+
| [Header](https://peacock.redvars.com/components/header) | p-header | 🟢 |
|
|
157
|
+
| [Icon](https://peacock.redvars.com/components/icon) | p-icon | 🟢 |
|
|
158
|
+
| [Link](https://peacock.redvars.com/components/link) | p-link | 🟢 |
|
|
159
|
+
| [Modal](https://peacock.redvars.com/components/modal) | p-modal | 🟢 |
|
|
160
|
+
| [Notification Manager](https://peacock.redvars.com/components/notification-manager) | p-notification-manager | 🟡 |
|
|
161
|
+
| Observer | p-observer | 🔴 |
|
|
162
|
+
| Pagination | p-pagination | 🔴 |
|
|
163
|
+
| Radio Group | p-radiogroup | 🔴 |
|
|
164
|
+
| Row | p-row | 🔴 |
|
|
165
|
+
| [Slider](https://peacock.redvars.com/components/slider) | p-slider | 🟡 |
|
|
166
|
+
| Spoiler | p-spoiler | 🔴 |
|
|
167
|
+
| Stepper | p-stepper | 🔴 |
|
|
168
|
+
| [Table](https://peacock.redvars.com/components/table) | p-table | 🟡 |
|
|
169
|
+
| [Tag](https://peacock.redvars.com/components/tag) / Chip | p-tag | 🟢 |
|
|
170
|
+
| [Text](https://peacock.redvars.com/components/text) | p-text | 🟢 |
|
|
171
|
+
| [Tree View](https://peacock.redvars.com/components/tree-view) | p-tree-view | 🟡 |
|
|
172
|
+
| [Toggle](https://peacock.redvars.com/components/toggle) | p-toggle | 🟢 |
|
|
173
|
+
|
|
174
|
+
## Charts
|
|
175
|
+
|
|
176
|
+
These components are used to display data in a graphical format. They include
|
|
177
|
+
|
|
178
|
+
| Name | Component | State |
|
|
179
|
+
|----------------------------------------------------------------|---------------------|-------|
|
|
180
|
+
| [Doughnut Chart](https://peacock.redvars.com/components/chart-doughnut) | p-chart-doughnut | 🟢 |
|
|
181
|
+
| [Pie Chart ](https://peacock.redvars.com/components/chart-pie) | p-chart-pie | 🟢 |
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
## 📄 License
|
|
185
|
+
|
|
186
|
+
Peacock is open-source software licensed under the [Apache-2.0 License](LICENSE).
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
Made with 💖 by [shivajivarma](https://shivajivarma.com).
|
package/rollup.config.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import typescript from '@rollup/plugin-typescript';
|
|
2
2
|
import { nodeResolve } from '@rollup/plugin-node-resolve';
|
|
3
|
+
import css from 'rollup-plugin-import-css';
|
|
3
4
|
import copy from 'rollup-plugin-copy';
|
|
4
5
|
|
|
5
6
|
export default [
|
|
@@ -12,15 +13,8 @@ export default [
|
|
|
12
13
|
},
|
|
13
14
|
plugins: [
|
|
14
15
|
typescript(), // The plugin loads options from tsconfig.json by default
|
|
16
|
+
css(),
|
|
15
17
|
nodeResolve(),
|
|
16
|
-
copy({
|
|
17
|
-
targets: [
|
|
18
|
-
{
|
|
19
|
-
src: '../design-tokens/dist/**',
|
|
20
|
-
dest: 'dist/assets/styles/',
|
|
21
|
-
},
|
|
22
|
-
],
|
|
23
|
-
}),
|
|
24
18
|
],
|
|
25
19
|
},
|
|
26
20
|
{
|
|
@@ -33,7 +27,17 @@ export default [
|
|
|
33
27
|
},
|
|
34
28
|
plugins: [
|
|
35
29
|
typescript(), // The plugin loads options from tsconfig.json by default
|
|
30
|
+
css(),
|
|
36
31
|
nodeResolve(),
|
|
32
|
+
|
|
33
|
+
copy({
|
|
34
|
+
targets: [
|
|
35
|
+
{
|
|
36
|
+
src: '../readme.md',
|
|
37
|
+
dest: './',
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
}),
|
|
37
41
|
],
|
|
38
42
|
},
|
|
39
43
|
];
|
package/src/avatar/avatar.css.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { css, unsafeCSS } from 'lit';
|
|
2
|
-
import { getTypography } from '../
|
|
2
|
+
import { getTypography } from '../styleMixins.css.js';
|
|
3
3
|
|
|
4
4
|
export const styles = css`
|
|
5
5
|
:host {
|
|
@@ -26,7 +26,7 @@ export const styles = css`
|
|
|
26
26
|
color: var(--avatar-text-color);
|
|
27
27
|
width: var(--avatar-size);
|
|
28
28
|
height: var(--avatar-size);
|
|
29
|
-
${
|
|
29
|
+
${getTypography('body-large-emphasized')}
|
|
30
30
|
background-color: var(--avatar-background-color);
|
|
31
31
|
|
|
32
32
|
font-size: calc(var(--avatar-size) * 0.4);
|
package/src/avatar/avatar.ts
CHANGED
|
@@ -3,12 +3,6 @@ import { property } from 'lit/decorators.js';
|
|
|
3
3
|
import { classMap } from 'lit/directives/class-map.js';
|
|
4
4
|
import { styles } from './avatar.css.js';
|
|
5
5
|
|
|
6
|
-
/**
|
|
7
|
-
* @summary Icons are visual symbols used to represent ideas, objects, or actions.
|
|
8
|
-
*
|
|
9
|
-
* @cssprop --icon-color - Controls the color of the icon.
|
|
10
|
-
* @cssprop --icon-size - Controls the size of the icon.
|
|
11
|
-
*/
|
|
12
6
|
export class Avatar extends LitElement {
|
|
13
7
|
static styles = [styles];
|
|
14
8
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset='utf-8'>
|
|
5
5
|
<meta name='viewport' content='width=device-width, initial-scale=1.0, viewport-fit=cover' />
|
|
6
|
-
<link rel='stylesheet' href='/
|
|
6
|
+
<link rel='stylesheet' href='/dist/assets/styles/tokens.css' />
|
|
7
7
|
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+Mono:wght@100..900&family=Noto+Sans:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet">
|
|
8
8
|
|
|
9
9
|
<style>
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
<p-avatar name='Shivaji Varma'></p-avatar>
|
|
19
19
|
|
|
20
20
|
<script type='module'>
|
|
21
|
-
import { Avatar } from '/dist/
|
|
21
|
+
import { Avatar } from '/dist/index.js';
|
|
22
22
|
|
|
23
23
|
window.customElements.define('p-avatar', Avatar);
|
|
24
24
|
</script>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { customElement } from 'lit/decorators.js';
|
|
2
|
+
import { Avatar } from './avatar.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @summary The Avatar component is used to represent user, and displays the profile picture, initials or fallback icon.
|
|
6
|
+
*
|
|
7
|
+
* @cssprop --avatar-background-color - Controls the color of the avatar.
|
|
8
|
+
* @cssprop --avatar-size - Controls the size of the avatar.
|
|
9
|
+
* @cssprop --avatar-text-color - Controls the color of the text inside the avatar.
|
|
10
|
+
*/
|
|
11
|
+
@customElement('p-avatar')
|
|
12
|
+
export class PAvatar extends Avatar {}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
import { getTypography } from '../styleMixins.css.js';
|
|
3
|
+
|
|
4
|
+
export const styles = css`
|
|
5
|
+
:host {
|
|
6
|
+
display: inline-block;
|
|
7
|
+
--badge-color: var(--global-badge-color);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.badge {
|
|
11
|
+
pointer-events: none;
|
|
12
|
+
z-index: var(--z-index-badge);
|
|
13
|
+
color: var(--color-white);
|
|
14
|
+
display: flex;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
align-items: center;
|
|
17
|
+
background-color: var(--badge-color);
|
|
18
|
+
border-radius: var(--shape-corner-full);
|
|
19
|
+
|
|
20
|
+
&.has-content {
|
|
21
|
+
height: 1rem;
|
|
22
|
+
min-width: 1rem;
|
|
23
|
+
padding-inline: var(--spacing-050);
|
|
24
|
+
${getTypography('label-small')};
|
|
25
|
+
color: var(--color-on-error);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&:not(.has-content) {
|
|
29
|
+
height: 6px;
|
|
30
|
+
width: 6px;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { html, LitElement } from 'lit';
|
|
2
|
+
import { property, state } from 'lit/decorators.js';
|
|
3
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
4
|
+
import { styles } from './badge.css.js';
|
|
5
|
+
|
|
6
|
+
export class Badge extends LitElement {
|
|
7
|
+
static styles = [styles];
|
|
8
|
+
|
|
9
|
+
@property({ type: String, reflect: true }) name: string = '';
|
|
10
|
+
|
|
11
|
+
@property({ type: String, reflect: true }) src?: string;
|
|
12
|
+
|
|
13
|
+
@state()
|
|
14
|
+
slotHasContent = false;
|
|
15
|
+
|
|
16
|
+
render() {
|
|
17
|
+
return html`<div
|
|
18
|
+
class=${classMap({ badge: true, 'has-content': this.slotHasContent })}
|
|
19
|
+
>
|
|
20
|
+
<slot @slotchange=${this.#handleSlotChange}></slot>
|
|
21
|
+
</div>`;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
#handleSlotChange(event: { target: any }) {
|
|
25
|
+
const slot = event.target;
|
|
26
|
+
// Check assignedElements length
|
|
27
|
+
this.slotHasContent = slot.assignedElements().length > 0;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang='en-GB'>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset='utf-8'>
|
|
5
|
+
<meta name='viewport' content='width=device-width, initial-scale=1.0, viewport-fit=cover' />
|
|
6
|
+
<link rel='stylesheet' href='/dist/assets/styles/tokens.css' />
|
|
7
|
+
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+Mono:wght@100..900&family=Noto+Sans:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet">
|
|
8
|
+
|
|
9
|
+
<style>
|
|
10
|
+
body {
|
|
11
|
+
background: #fafafa;
|
|
12
|
+
}
|
|
13
|
+
</style>
|
|
14
|
+
</head>
|
|
15
|
+
<body>
|
|
16
|
+
|
|
17
|
+
<style>
|
|
18
|
+
.badge-wrapper {
|
|
19
|
+
position: relative;
|
|
20
|
+
display: inline-flex;
|
|
21
|
+
width: 1.5rem;
|
|
22
|
+
height: 1.5rem;
|
|
23
|
+
align-items: center;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.badge-anchor-simple {
|
|
28
|
+
position: absolute;
|
|
29
|
+
top: 0;
|
|
30
|
+
right: 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.badge-anchor {
|
|
34
|
+
position: absolute;
|
|
35
|
+
top: -2px;
|
|
36
|
+
left: calc(100% - 12px);
|
|
37
|
+
}
|
|
38
|
+
</style>
|
|
39
|
+
|
|
40
|
+
<div class="badge-wrapper">
|
|
41
|
+
<p-icon name="notifications"></p-icon>
|
|
42
|
+
<p-badge class="badge-anchor-simple"></p-badge>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
<p-avatar name='Shivaji Varma'></p-avatar>
|
|
47
|
+
|
|
48
|
+
<script type='module'>
|
|
49
|
+
import { Icon, Badge } from '/dist/index.js';
|
|
50
|
+
window.customElements.define('p-icon', Icon);
|
|
51
|
+
window.customElements.define('p-badge', Badge);
|
|
52
|
+
</script>
|
|
53
|
+
</body>
|
|
54
|
+
</html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Badge } from './badge.js';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { customElement } from 'lit/decorators.js';
|
|
2
|
+
import { Badge } from './badge.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @summary The badge component is used to display a small amount of information to the user.
|
|
6
|
+
*
|
|
7
|
+
* @cssprop --badge-color - Controls the color of the badge.
|
|
8
|
+
*/
|
|
9
|
+
@customElement('p-badge')
|
|
10
|
+
export class PBadge extends Badge {}
|
package/src/icon/demo/index.html
CHANGED
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
<body>
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
<
|
|
17
|
-
<
|
|
16
|
+
<p-icon></p-icon>
|
|
17
|
+
<p-icon provider='carbon' name='logo--github'></p-icon>
|
|
18
18
|
|
|
19
19
|
<script type='module'>
|
|
20
|
-
import { Icon } from '/dist/
|
|
20
|
+
import { Icon } from '/dist/index.js';
|
|
21
21
|
|
|
22
|
-
window.customElements.define('
|
|
22
|
+
window.customElements.define('p-icon', Icon);
|
|
23
23
|
</script>
|
|
24
24
|
</body>
|
|
25
25
|
</html>
|
package/src/icon/icon.ts
CHANGED
|
@@ -5,16 +5,10 @@ import { fetchIcon, fetchSVG } from './datasource.js';
|
|
|
5
5
|
import { sanitizeSvg } from '../utils.js';
|
|
6
6
|
import { styles } from './icon.css.js';
|
|
7
7
|
|
|
8
|
-
/**
|
|
9
|
-
* @summary Icons are visual symbols used to represent ideas, objects, or actions.
|
|
10
|
-
*
|
|
11
|
-
* @cssprop --icon-color - Controls the color of the icon.
|
|
12
|
-
* @cssprop [--icon-size=1rem] - Controls the size of the icon. Defaults to "1rem"
|
|
13
|
-
*/
|
|
14
8
|
export class Icon extends LitElement {
|
|
15
9
|
static styles = [styles];
|
|
16
10
|
|
|
17
|
-
@property({ type: String, reflect: true }) name?: string
|
|
11
|
+
@property({ type: String, reflect: true }) name?: string;
|
|
18
12
|
|
|
19
13
|
@property({ type: String, reflect: true }) src?: string;
|
|
20
14
|
|
package/src/icon/p-icon.ts
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { customElement } from 'lit/decorators.js';
|
|
2
2
|
import { Icon } from './icon.js';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* @name Icon
|
|
6
|
+
* @summary Icons are visual symbols used to represent ideas, objects, or actions.
|
|
7
|
+
*
|
|
8
|
+
* @cssprop --icon-color - Controls the color of the icon.
|
|
9
|
+
* @cssprop [--icon-size=1rem] - Controls the size of the icon. Defaults to "1rem"
|
|
10
|
+
*/
|
|
4
11
|
@customElement('p-icon')
|
|
5
|
-
export class
|
|
12
|
+
export class PIcon extends Icon {}
|
package/src/index.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export { Icon } from './icon/
|
|
2
|
-
export { Avatar } from './avatar/
|
|
1
|
+
export { Icon } from './icon/index.js';
|
|
2
|
+
export { Avatar } from './avatar/index.js';
|
|
3
|
+
export { Badge } from './badge/index.js';
|