@pairbo/ui-kit 0.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/.husky/pre-commit +1 -0
- package/.prettierignore +16 -0
- package/.prettierrc.json +17 -0
- package/README.md +61 -0
- package/cspell.json +9 -0
- package/dev.html +101 -0
- package/docs/README.md +1 -0
- package/docs/_includes/component.njk +16 -0
- package/docs/_includes/default.njk +39 -0
- package/docs/_includes/sidebar.njk +16 -0
- package/docs/eleventy.config.mjs +72 -0
- package/docs/pages/components/message-selector.md +17 -0
- package/docs/pages/fabric-example.html +46 -0
- package/docs/pages/fabric-example.js +28 -0
- package/docs/pages/index.md +76 -0
- package/eslint.config.mjs +32 -0
- package/ignote_temp +3 -0
- package/index.html +162 -0
- package/lint-stage.confg.js +6 -0
- package/package.json +66 -0
- package/pages/card-selection.html +65 -0
- package/pages/drawer.html +47 -0
- package/pages/editor.html +45 -0
- package/pages/page-mgn.html +51 -0
- package/pages/test_build.html +47 -0
- package/public/Greeting Card from Pairbo.png +0 -0
- package/scripts/plop/plopfile.js +51 -0
- package/scripts/plop/templates/components/component.hbs +34 -0
- package/scripts/plop/templates/components/define.hbs +10 -0
- package/scripts/plop/templates/components/styles.hbs +7 -0
- package/src/components/button/button.component.ts +93 -0
- package/src/components/button/button.styles.ts +273 -0
- package/src/components/button/button.ts +10 -0
- package/src/components/button-group/button-group.component.ts +36 -0
- package/src/components/button-group/button-group.styles.ts +7 -0
- package/src/components/button-group/button-group.ts +10 -0
- package/src/components/card-selection/card-selection.component.ts +43 -0
- package/src/components/card-selection/card-selection.styles.ts +7 -0
- package/src/components/card-selection/card-selection.ts +10 -0
- package/src/components/category/category.component.ts +91 -0
- package/src/components/category/category.styles.ts +27 -0
- package/src/components/category/category.ts +10 -0
- package/src/components/category-image/category-image.component.ts +38 -0
- package/src/components/category-image/category-image.styles.ts +11 -0
- package/src/components/category-image/category-image.ts +10 -0
- package/src/components/drawer/drawer.component.ts +82 -0
- package/src/components/drawer/drawer.styles.ts +54 -0
- package/src/components/drawer/drawer.ts +10 -0
- package/src/components/editor/editor.component.ts +135 -0
- package/src/components/editor/editor.styles.ts +13 -0
- package/src/components/editor/editor.ts +10 -0
- package/src/components/fabric-example/fabric-example.component.ts +268 -0
- package/src/components/fabric-example/fabric-example.styles.ts +23 -0
- package/src/components/fabric-example/fabric-example.test.ts +0 -0
- package/src/components/fabric-example/fabric-example.ts +12 -0
- package/src/components/image-slider/editor-card-slider.component.ts +136 -0
- package/src/components/image-slider/editor-card-slider.styles.ts +46 -0
- package/src/components/image-slider/editor-card-slider.ts +9 -0
- package/src/components/main.ts +17 -0
- package/src/components/message-selector/message-selector.component.ts +154 -0
- package/src/components/message-selector/message-selector.styles.ts +16 -0
- package/src/components/message-selector/message-selector.test.ts +64 -0
- package/src/components/message-selector/message-selector.ts +13 -0
- package/src/components/page-manager/page-manager.component.ts +228 -0
- package/src/components/page-manager/page-manager.styles.ts +9 -0
- package/src/components/page-manager/page-manager.ts +10 -0
- package/src/components/radio-button/radio-button.component.ts +118 -0
- package/src/components/radio-button/radio-button.styles.ts +13 -0
- package/src/components/radio-button/radio-button.ts +10 -0
- package/src/components/radio-group/radio-group.component.ts +203 -0
- package/src/components/radio-group/radio-group.styles.ts +19 -0
- package/src/components/radio-group/radio-group.ts +10 -0
- package/src/components/selector/selector.component.ts +115 -0
- package/src/components/selector/selector.styles.ts +9 -0
- package/src/components/selector/selector.ts +10 -0
- package/src/components/textarea/textarea.component.ts +234 -0
- package/src/components/textarea/textarea.styles.ts +178 -0
- package/src/components/textarea/textarea.ts +10 -0
- package/src/components/type-form/type-form.component.ts +121 -0
- package/src/components/type-form/type-form.styles.ts +7 -0
- package/src/components/type-form/type-form.ts +10 -0
- package/src/declaration.d.ts +44 -0
- package/src/events/events.ts +1 -0
- package/src/events/pbo-category-card-select.ts +7 -0
- package/src/internal/form.ts +376 -0
- package/src/internal/pairbo-element.ts +85 -0
- package/src/internal/slots.ts +54 -0
- package/src/internal/watch.ts +79 -0
- package/src/styles/component.styles.ts +17 -0
- package/src/styles/form-control.styles.ts +59 -0
- package/src/themes/default.css +414 -0
- package/temp +20 -0
- package/tsconfig.json +28 -0
- package/vite.config.ts +26 -0
package/index.html
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<title>Development</title>
|
|
6
|
+
|
|
7
|
+
<link rel="stylesheet" href="src/themes/default.css">
|
|
8
|
+
<script type="module" src="src/components/main.ts"></script>
|
|
9
|
+
|
|
10
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
11
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
12
|
+
<link
|
|
13
|
+
href="https://fonts.googleapis.com/css2?family=Kablammo&family=Monsieur+La+Doulaise&family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap"
|
|
14
|
+
rel="stylesheet">
|
|
15
|
+
|
|
16
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.20.0/cdn/themes/light.css" />
|
|
17
|
+
<script type="module"
|
|
18
|
+
src="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.20.0/cdn/shoelace-autoloader.js"></script>
|
|
19
|
+
|
|
20
|
+
<script>
|
|
21
|
+
(() => {
|
|
22
|
+
document.documentElement.classList.toggle('pbo-theme-default', true);
|
|
23
|
+
})();
|
|
24
|
+
</script>
|
|
25
|
+
</head>
|
|
26
|
+
|
|
27
|
+
<body>
|
|
28
|
+
<a href="/index.html">Home</a>
|
|
29
|
+
<a href="/pages/editor.html">Editor</a>
|
|
30
|
+
<a href="/pages/card-selection.html">Card Selection</a>
|
|
31
|
+
<div style="
|
|
32
|
+
height: 100vh;
|
|
33
|
+
width: 100vw;
|
|
34
|
+
padding-left: auto;
|
|
35
|
+
padding-right: auto;
|
|
36
|
+
margin-left: auto;
|
|
37
|
+
margin-right: auto;
|
|
38
|
+
">
|
|
39
|
+
<div style="
|
|
40
|
+
height: 60%;
|
|
41
|
+
width: 60%;
|
|
42
|
+
position: absolute;
|
|
43
|
+
top: 50%;
|
|
44
|
+
left: 50%;
|
|
45
|
+
transform: translate(-50%, -50%);
|
|
46
|
+
display: flex;
|
|
47
|
+
flex-direction: column;
|
|
48
|
+
align-items: center;
|
|
49
|
+
">
|
|
50
|
+
<fabric-example backgroundUrl="./public/Greeting Card from Pairbo.png" alignment="right"></fabric-example>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
<textarea id="message"></textarea>
|
|
54
|
+
<input type="color" id="color" value="#000000" />
|
|
55
|
+
<select name="alignment" id="alignment">
|
|
56
|
+
<option value="left">Left</option>
|
|
57
|
+
<option value="center">Center</option>
|
|
58
|
+
<option value="right">Right</option>
|
|
59
|
+
</select>
|
|
60
|
+
<!-- Example usage -->
|
|
61
|
+
<pbo-selector .fonts='${[
|
|
62
|
+
{ value: "helvetica", label: "Helvetica", font: "Helvetica, Arial, sans-serif" },
|
|
63
|
+
{ value: "georgia", label: "Georgia", font: "Georgia, serif" }
|
|
64
|
+
]}'></pbo-selector>
|
|
65
|
+
|
|
66
|
+
<div style="display: inline-flex; flex-direction: column; gap:1rem">
|
|
67
|
+
<pbo-button outline>
|
|
68
|
+
<div>Click me</div>
|
|
69
|
+
</pbo-button>
|
|
70
|
+
|
|
71
|
+
<pbo-button-group>
|
|
72
|
+
<pbo-button outline>
|
|
73
|
+
left
|
|
74
|
+
</pbo-button>
|
|
75
|
+
<pbo-button outline>
|
|
76
|
+
center
|
|
77
|
+
</pbo-button>
|
|
78
|
+
<pbo-button>
|
|
79
|
+
right
|
|
80
|
+
</pbo-button>
|
|
81
|
+
</pbo-button-group>
|
|
82
|
+
|
|
83
|
+
<pbo-radio-button aria-disabled="true" disabled>
|
|
84
|
+
disabled
|
|
85
|
+
</pbo-radio-button>
|
|
86
|
+
|
|
87
|
+
<pbo-radio-button checked>
|
|
88
|
+
focused
|
|
89
|
+
</pbo-radio-button>
|
|
90
|
+
|
|
91
|
+
<form>
|
|
92
|
+
<input type="text" name="name" />
|
|
93
|
+
<input type="email" name="email" />
|
|
94
|
+
|
|
95
|
+
<input type="radio" name="align" />
|
|
96
|
+
<input type="radio" name="align" />
|
|
97
|
+
<input type="radio" name="align" />
|
|
98
|
+
<pbo-radio-group required id="alignment-group">
|
|
99
|
+
<pbo-radio-button value="left" size="small" circle>Left</pbo-radio-button>
|
|
100
|
+
<pbo-radio-button value="center">Center</pbo-radio-button>
|
|
101
|
+
<pbo-radio-button value="right">Right</pbo-radio-button>
|
|
102
|
+
</pbo-radio-group>
|
|
103
|
+
|
|
104
|
+
<pbo-radio-group required id="color-group">
|
|
105
|
+
<pbo-radio-button value="white" size="small" circle>White</pbo-radio-button>
|
|
106
|
+
<pbo-radio-button value="black">Black</pbo-radio-button>
|
|
107
|
+
</pbo-radio-group>
|
|
108
|
+
<pbo-textarea required rows="12" resize="none"></pbo-textarea>
|
|
109
|
+
<sl-radio-group required>
|
|
110
|
+
<sl-radio value="left">Left</sl-radio>
|
|
111
|
+
<sl-radio value="center">Center</sl-radio>
|
|
112
|
+
<sl-radio value="right">Right</sl-radio>
|
|
113
|
+
</sl-radio-group>
|
|
114
|
+
<button type="submit">Submit</button>
|
|
115
|
+
</form>
|
|
116
|
+
<pbo-button circle>Circle</pbo-button>
|
|
117
|
+
</div>
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
<script>
|
|
121
|
+
const textareaEl = document.querySelector("pbo-textarea");
|
|
122
|
+
textareaEl.addEventListener("pbo-input", () => {
|
|
123
|
+
fabricExample.message = textareaEl.value;
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
const message = document.getElementById("message");
|
|
127
|
+
const fabricExample = document.querySelector("fabric-example");
|
|
128
|
+
message.addEventListener("input", e => {
|
|
129
|
+
fabricExample.message = message.value;
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
const color = document.getElementById("color");
|
|
133
|
+
color.addEventListener("input", e => {
|
|
134
|
+
fabricExample.color = color.value;
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
const element = document.getElementById("alignment");
|
|
138
|
+
element.addEventListener("pbo-change", e => {
|
|
139
|
+
fabricExample.alignment = element.value;
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
const alignmentGroup = document.getElementById("alignment-group");
|
|
143
|
+
alignmentGroup.addEventListener("pbo-change", e => {
|
|
144
|
+
console.log(alignmentGroup.value);
|
|
145
|
+
fabricExample.alignment = alignmentGroup.value;
|
|
146
|
+
fabricExample.setAttribute("alignment", alignmentGroup.value);
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
const colorGroup = document.getElementById("color-group");
|
|
150
|
+
colorGroup.addEventListener("pbo-change", e => {
|
|
151
|
+
console.log(colorGroup.value);
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
const slGroupEl = document.querySelector("sl-radio-group");
|
|
155
|
+
slGroupEl.addEventListener("sl-change", e => {
|
|
156
|
+
console.log({ e })
|
|
157
|
+
console.log(slGroupEl.value);
|
|
158
|
+
});
|
|
159
|
+
</script>
|
|
160
|
+
</body>
|
|
161
|
+
|
|
162
|
+
</html>
|
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pairbo/ui-kit",
|
|
3
|
+
"version": "0.0.01",
|
|
4
|
+
"description": "",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": {
|
|
7
|
+
"types": "./dist/src/components/main.d.ts",
|
|
8
|
+
"import": "./dist/pairbo.umd.js"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"type": "module",
|
|
12
|
+
"scripts": {
|
|
13
|
+
"dev": "vite",
|
|
14
|
+
"build": "vite build",
|
|
15
|
+
"preview": "vite preview",
|
|
16
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
17
|
+
"prepare": "husky",
|
|
18
|
+
"eleventy": "eleventy --config=./docs/eleventy.config.mjs",
|
|
19
|
+
"eleventy:serve": "eleventy --serve --config=./docs/eleventy.config.mjs",
|
|
20
|
+
"create": "plop --plopfile scripts/plop/plopfile.js"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [],
|
|
23
|
+
"author": "",
|
|
24
|
+
"license": "ISC",
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@11ty/eleventy": "^3.0.0",
|
|
27
|
+
"@eslint/js": "^9.20.0",
|
|
28
|
+
"@open-wc/testing": "^4.0.0",
|
|
29
|
+
"@types/mocha": "^10.0.10",
|
|
30
|
+
"@types/sinon": "^17.0.3",
|
|
31
|
+
"@typescript-eslint/eslint-plugin": "^8.24.0",
|
|
32
|
+
"@typescript-eslint/parser": "^8.24.0",
|
|
33
|
+
"eslint": "^8.57.1",
|
|
34
|
+
"eslint-config-prettier": "^10.0.1",
|
|
35
|
+
"eslint-config-standard": "^17.1.0",
|
|
36
|
+
"eslint-plugin-import": "^2.31.0",
|
|
37
|
+
"eslint-plugin-lit": "^1.15.0",
|
|
38
|
+
"eslint-plugin-n": "^16.6.2",
|
|
39
|
+
"eslint-plugin-prettier": "^5.2.3",
|
|
40
|
+
"eslint-plugin-promise": "^6.6.0",
|
|
41
|
+
"globals": "^15.14.0",
|
|
42
|
+
"husky": "^9.1.7",
|
|
43
|
+
"lint-staged": "^15.4.3",
|
|
44
|
+
"plop": "^4.0.1",
|
|
45
|
+
"prettier": "^3.5.0",
|
|
46
|
+
"sinon": "^19.0.2",
|
|
47
|
+
"typescript": "^5.7.3",
|
|
48
|
+
"typescript-eslint": "^8.24.0",
|
|
49
|
+
"vite": "^6.1.0",
|
|
50
|
+
"vite-plugin-dts": "^4.5.0"
|
|
51
|
+
},
|
|
52
|
+
"lint-staged": {
|
|
53
|
+
"*.{ts,js}": [
|
|
54
|
+
"eslint --max-warnings 0 --fix --no-warn-ignored",
|
|
55
|
+
"prettier --write"
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
"dependencies": {
|
|
59
|
+
"@splidejs/splide": "^4.1.4",
|
|
60
|
+
"choices.js": "^11.0.3",
|
|
61
|
+
"fabric": "^6.5.4",
|
|
62
|
+
"lit": "^3.2.1",
|
|
63
|
+
"markdown-it": "^14.1.0",
|
|
64
|
+
"markdown-it-attrs": "^4.3.1"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<title>Development</title>
|
|
6
|
+
|
|
7
|
+
<link rel="stylesheet" href="../src/themes/default.css">
|
|
8
|
+
<script type="module" src="../src/components/main.ts"></script>
|
|
9
|
+
|
|
10
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
11
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
12
|
+
<link
|
|
13
|
+
href="https://fonts.googleapis.com/css2?family=Kablammo&family=Monsieur+La+Doulaise&family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap"
|
|
14
|
+
rel="stylesheet">
|
|
15
|
+
|
|
16
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.20.0/cdn/themes/light.css" />
|
|
17
|
+
<script type="module"
|
|
18
|
+
src="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.20.0/cdn/shoelace-autoloader.js"></script>
|
|
19
|
+
|
|
20
|
+
<script>
|
|
21
|
+
(() => {
|
|
22
|
+
document.documentElement.classList.toggle('pbo-theme-default', true);
|
|
23
|
+
})();
|
|
24
|
+
</script>
|
|
25
|
+
</head>
|
|
26
|
+
|
|
27
|
+
<body>
|
|
28
|
+
<div class="container">
|
|
29
|
+
<pbo-category>
|
|
30
|
+
<h1 slot="title">Title</h1>
|
|
31
|
+
</pbo-category>
|
|
32
|
+
</div>
|
|
33
|
+
</body>
|
|
34
|
+
|
|
35
|
+
<script>
|
|
36
|
+
const categoryEl = document.querySelector('pbo-category');
|
|
37
|
+
|
|
38
|
+
categoryEl.cards = [
|
|
39
|
+
{ cover_url: "https://picsum.photos/id/1/300/400", id: "1" },
|
|
40
|
+
{ cover_url: "https://picsum.photos/id/10/300/400", id: "10" },
|
|
41
|
+
{ cover_url: "https://picsum.photos/id/14/300/400", id: "10" },
|
|
42
|
+
{ cover_url: "https://picsum.photos/id/20/300/400", id: "10" },
|
|
43
|
+
{ cover_url: "https://picsum.photos/id/30/300/400", id: "10" },
|
|
44
|
+
{ cover_url: "https://picsum.photos/id/40/300/400", id: "10" },
|
|
45
|
+
{ cover_url: "https://picsum.photos/id/100/300/400", id: "100" },
|
|
46
|
+
]
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
<style>
|
|
50
|
+
body {
|
|
51
|
+
height: 100vh;
|
|
52
|
+
width: 100vw;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.container {
|
|
56
|
+
height: 100%;
|
|
57
|
+
width: 100%;
|
|
58
|
+
padding-left: auto;
|
|
59
|
+
padding-right: auto;
|
|
60
|
+
margin-left: auto;
|
|
61
|
+
margin-right: auto;
|
|
62
|
+
}
|
|
63
|
+
</style>
|
|
64
|
+
|
|
65
|
+
</html>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<title>Development</title>
|
|
6
|
+
|
|
7
|
+
<link rel="stylesheet" href="../src/themes/default.css">
|
|
8
|
+
<script type="module" src="../src/components/main.ts"></script>
|
|
9
|
+
|
|
10
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
11
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
12
|
+
<link
|
|
13
|
+
href="https://fonts.googleapis.com/css2?family=Kablammo&family=Monsieur+La+Doulaise&family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap"
|
|
14
|
+
rel="stylesheet">
|
|
15
|
+
|
|
16
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.20.0/cdn/themes/light.css" />
|
|
17
|
+
<script type="module"
|
|
18
|
+
src="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.20.0/cdn/shoelace-autoloader.js"></script>
|
|
19
|
+
|
|
20
|
+
<script>
|
|
21
|
+
(() => {
|
|
22
|
+
document.documentElement.classList.toggle('pbo-theme-default', true);
|
|
23
|
+
})();
|
|
24
|
+
</script>
|
|
25
|
+
</head>
|
|
26
|
+
|
|
27
|
+
<body>
|
|
28
|
+
<div class="container">
|
|
29
|
+
<pbo-drawer>
|
|
30
|
+
<div part="body">
|
|
31
|
+
<pbo-page-manager></pbo-page-manager>
|
|
32
|
+
</div>
|
|
33
|
+
</pbo-drawer>
|
|
34
|
+
</div>
|
|
35
|
+
<button>Toggle modal</button>
|
|
36
|
+
</body>
|
|
37
|
+
|
|
38
|
+
<script>
|
|
39
|
+
const buttonEl = document.querySelector('button');
|
|
40
|
+
const modalEl = document.querySelector('pbo-drawer');
|
|
41
|
+
buttonEl.addEventListener('click', () => {
|
|
42
|
+
modalEl.show();
|
|
43
|
+
});
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
</html>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<title>Development</title>
|
|
6
|
+
|
|
7
|
+
<link rel="stylesheet" href="../src/themes/default.css">
|
|
8
|
+
<script type="module" src="../src/components/main.ts"></script>
|
|
9
|
+
|
|
10
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
11
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
12
|
+
<link
|
|
13
|
+
href="https://fonts.googleapis.com/css2?family=Kablammo&family=Monsieur+La+Doulaise&family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap"
|
|
14
|
+
rel="stylesheet">
|
|
15
|
+
|
|
16
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.20.0/cdn/themes/light.css" />
|
|
17
|
+
<script type="module"
|
|
18
|
+
src="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.20.0/cdn/shoelace-autoloader.js"></script>
|
|
19
|
+
|
|
20
|
+
<script>
|
|
21
|
+
(() => {
|
|
22
|
+
document.documentElement.classList.toggle('pbo-theme-default', true);
|
|
23
|
+
})();
|
|
24
|
+
</script>
|
|
25
|
+
</head>
|
|
26
|
+
|
|
27
|
+
<body>
|
|
28
|
+
<div class="container">
|
|
29
|
+
<pbo-editor></pbo-editor>
|
|
30
|
+
</div>
|
|
31
|
+
</body>
|
|
32
|
+
|
|
33
|
+
<style>
|
|
34
|
+
.container {
|
|
35
|
+
height: 100%;
|
|
36
|
+
width: 100%;
|
|
37
|
+
padding-left: auto;
|
|
38
|
+
padding-right: auto;
|
|
39
|
+
margin-left: auto;
|
|
40
|
+
margin-right: auto;
|
|
41
|
+
}
|
|
42
|
+
</style>
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
</html>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<title>Development</title>
|
|
6
|
+
|
|
7
|
+
<link rel="stylesheet" href="../src/themes/default.css">
|
|
8
|
+
<script type="module" src="../src/components/main.ts"></script>
|
|
9
|
+
|
|
10
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
11
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
12
|
+
<link
|
|
13
|
+
href="https://fonts.googleapis.com/css2?family=Kablammo&family=Monsieur+La+Doulaise&family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap"
|
|
14
|
+
rel="stylesheet">
|
|
15
|
+
|
|
16
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.20.0/cdn/themes/light.css" />
|
|
17
|
+
<script type="module"
|
|
18
|
+
src="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.20.0/cdn/shoelace-autoloader.js"></script>
|
|
19
|
+
|
|
20
|
+
<script>
|
|
21
|
+
(() => {
|
|
22
|
+
document.documentElement.classList.toggle('pbo-theme-default', true);
|
|
23
|
+
})();
|
|
24
|
+
</script>
|
|
25
|
+
</head>
|
|
26
|
+
|
|
27
|
+
<body>
|
|
28
|
+
<div class="container">
|
|
29
|
+
<pbo-page-manager></pbo-page-manager>
|
|
30
|
+
</div>
|
|
31
|
+
</body>
|
|
32
|
+
|
|
33
|
+
<style>
|
|
34
|
+
html,
|
|
35
|
+
body {
|
|
36
|
+
height: 100vh;
|
|
37
|
+
width: 100wh;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.container {
|
|
41
|
+
height: 100%;
|
|
42
|
+
width: 100%;
|
|
43
|
+
padding-left: auto;
|
|
44
|
+
padding-right: auto;
|
|
45
|
+
margin-left: auto;
|
|
46
|
+
margin-right: auto;
|
|
47
|
+
}
|
|
48
|
+
</style>
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
</html>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<title>Development</title>
|
|
6
|
+
|
|
7
|
+
<link rel="stylesheet" href="../src/themes/default.css">
|
|
8
|
+
<script src="https://cdn.jsdelivr.net/npm/@pairbo/ui-kit/dist/pairbo.umd.js"></script>
|
|
9
|
+
|
|
10
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
11
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
12
|
+
<link
|
|
13
|
+
href="https://fonts.googleapis.com/css2?family=Kablammo&family=Monsieur+La+Doulaise&family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap"
|
|
14
|
+
rel="stylesheet">
|
|
15
|
+
|
|
16
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.20.0/cdn/themes/light.css" />
|
|
17
|
+
<script type="module"
|
|
18
|
+
src="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.20.0/cdn/shoelace-autoloader.js"></script>
|
|
19
|
+
|
|
20
|
+
<script>
|
|
21
|
+
(() => {
|
|
22
|
+
document.documentElement.classList.toggle('pbo-theme-default', true);
|
|
23
|
+
})();
|
|
24
|
+
</script>
|
|
25
|
+
</head>
|
|
26
|
+
|
|
27
|
+
<body>
|
|
28
|
+
<div class="container">
|
|
29
|
+
<pbo-drawer>
|
|
30
|
+
<div part="body">
|
|
31
|
+
<pbo-page-manager></pbo-page-manager>
|
|
32
|
+
</div>
|
|
33
|
+
</pbo-drawer>
|
|
34
|
+
</div>
|
|
35
|
+
<button>Toggle modal</button>
|
|
36
|
+
</body>
|
|
37
|
+
|
|
38
|
+
<script>
|
|
39
|
+
const buttonEl = document.querySelector('button');
|
|
40
|
+
const modalEl = document.querySelector('pbo-drawer');
|
|
41
|
+
buttonEl.addEventListener('click', () => {
|
|
42
|
+
modalEl.show();
|
|
43
|
+
});
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
</html>
|
|
Binary file
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export default function (plop) {
|
|
2
|
+
plop.setHelper("tagWithoutPrefix", tag => tag.replace(/^pbo-/, ""));
|
|
3
|
+
plop.setGenerator("controller", {
|
|
4
|
+
description: "application controller logic",
|
|
5
|
+
prompts: [
|
|
6
|
+
{
|
|
7
|
+
type: "input",
|
|
8
|
+
name: "tag",
|
|
9
|
+
message: "Tag name? (e.g. pbo-button)",
|
|
10
|
+
validate: value => {
|
|
11
|
+
if (!value || value.length === 0) {
|
|
12
|
+
return "Tag is required";
|
|
13
|
+
}
|
|
14
|
+
// start with pairbo- and include only a-z + dashes
|
|
15
|
+
if (!/^pbo-[a-z-]+$/.test(value)) {
|
|
16
|
+
return "Tag must start with 'pbo-' and contain only lowercase letters and dashes";
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// No double dashes or ending dash
|
|
20
|
+
if (value.includes("--") || value.endsWith("-")) {
|
|
21
|
+
return "Tag cannot contain double dashes or end with a dash";
|
|
22
|
+
}
|
|
23
|
+
return true;
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
actions: [
|
|
28
|
+
{
|
|
29
|
+
type: "add",
|
|
30
|
+
path: "../../src/components/{{ tagWithoutPrefix tag }}/{{ tagWithoutPrefix tag }}.ts",
|
|
31
|
+
templateFile: "templates/components/define.hbs",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
type: "add",
|
|
35
|
+
path: "../../src/components/{{ tagWithoutPrefix tag }}/{{ tagWithoutPrefix tag }}.styles.ts",
|
|
36
|
+
templateFile: "templates/components/styles.hbs",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
type: "add",
|
|
40
|
+
path: "../../src/components/{{ tagWithoutPrefix tag }}/{{ tagWithoutPrefix tag }}.component.ts",
|
|
41
|
+
templateFile: "templates/components/component.hbs",
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
type: "modify",
|
|
45
|
+
path: "../../src/components/main.ts",
|
|
46
|
+
pattern: /\/\* plop:component \*\//,
|
|
47
|
+
template: `export { default as {{ properCase tag }} } from './{{ tagWithoutPrefix tag }}/{{ tagWithoutPrefix tag }}.js';\n/* plop:component */`,
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
});
|
|
51
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { customElement, property } from "lit/decorators.js";
|
|
2
|
+
import { html, LitElement } from "lit";
|
|
3
|
+
import type { CSSResultGroup } from "lit";
|
|
4
|
+
import componentStyles from "../../styles/component.styles.js";
|
|
5
|
+
import PairboElement from "../../internal/pairbo-element.js";
|
|
6
|
+
import styles from "./{{ tagWithoutPrefix tag }}.styles.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @summary Short summary of the component's intended use.
|
|
10
|
+
* @status experimental
|
|
11
|
+
*
|
|
12
|
+
* @dependency pbo-example
|
|
13
|
+
*
|
|
14
|
+
* @event pbo-event-name - Emitted as an example.
|
|
15
|
+
*
|
|
16
|
+
* @slot - The default slot.
|
|
17
|
+
* @slot example - An example slot.
|
|
18
|
+
*
|
|
19
|
+
* @csspart base - The component's base wrapper.
|
|
20
|
+
*
|
|
21
|
+
* @cssproperty --example - An example CSS custom property.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
@customElement("{{ tag}}")
|
|
25
|
+
export default class {{ properCase tag }} extends PairboElement {
|
|
26
|
+
static styles: CSSResultGroup = [componentStyles, styles];
|
|
27
|
+
|
|
28
|
+
/** An example attribute. */
|
|
29
|
+
@property() attr = 'example';
|
|
30
|
+
|
|
31
|
+
render() {
|
|
32
|
+
return html` <slot></slot> `;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {{ properCase tag }} from "./{{ tagWithoutPrefix tag }}.component.js";
|
|
2
|
+
|
|
3
|
+
export * from "./{{ tagWithoutPrefix tag }}.component.js";
|
|
4
|
+
export default {{ properCase tag }};
|
|
5
|
+
|
|
6
|
+
declare global {
|
|
7
|
+
interface HTMLElementTagNameMap {
|
|
8
|
+
"{{ tag }}": {{ properCase tag }};
|
|
9
|
+
}
|
|
10
|
+
}
|