~repos /atoms-element

#js

git clone https://pyrossh.dev/repos/atoms-element.git

A simple web component library for defining your custom elements. It works on both client and server.



file:

__snapshots__/index.test.js.snap



// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`compileTw 1`] = `
"
.text-white {
color: rgba(255, 255, 255, 1);
}
.font-bold {
font-weight: 700;
}
.border {
border-width: 1px;
}
.border-black {
border-color: rgba(0, 0, 0, 1);
}
.p-4 {
padding: 1rem;
}
.m-4 {
margin: 1rem;
}
.w-20 {
width: 5rem;
}
.h-20 {
height: 5rem;
}
"
`;
exports[`createElement with attrs and hooks 1`] = `
"
<div>
<div>
<span>perPage: 5</span> </div> </div> <span>Count: 3</span> <button>Set</button> "
`;
exports[`createElement without attrs 1`] = `" <div></div>"`;
exports[`createPage 1`] = `
"
<!DOCTYPE html>
<html lang=\\"en\\">
<head>
<meta charset=\\"utf-8\\" />
<meta http-equiv=\\"x-ua-compatible\\" content=\\"ie=edge\\" />
<meta http-equiv=\\"Content-Type\\" content=\\"text/html; charset=utf-8\\">
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=5.0, shrink-to-fit=no\\">
<link rel=\\"sitemap\\" type=\\"application/xml\\" href=\\"/sitemap.xml\\" />
<link rel=\\"icon\\" type=\\"image/png\\" href=\\"/assets/icon.png\\" />
<title>123</title> <meta name=\\"title\\" content=\\"123\\"/> <meta name=\\"description\\" content=\\"123\\"/>
<style id=\\"global\\">
*, ::before, ::after {
box-sizing: border-box;
border-width: 0;
border-style: solid;
border-color: #e5e7eb;
}
hr {
height: 0;
color: inherit;
border-top-width: 1px;
}
abbr[title] {
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
}
b, strong {
font-weight: bolder;
}
code, kbd, samp, pre {
font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
font-size: 1em;
}
small {
font-size: 80%;
}
sub, sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
table {
text-indent: 0;
border-color: inherit;
border-collapse: collapse;
}
button, input, optgroup, select, textarea {
font-size: 100%;
margin: 0;
padding: 0;
line-height: inherit;
color: inherit;
}
button, select {
}
button, [type='button'], [type='reset'], [type='submit'] {
}
::-moz-focus-inner {
border-style: none;
padding: 0;
}
:-moz-focusring {
outline: 1px dotted ButtonText;
}
:-moz-ui-invalid {
box-shadow: none;
}
legend {
padding: 0;
}
progress {
vertical-align: baseline;
}
::-webkit-inner-spin-button, ::-webkit-outer-spin-button {
height: auto;
}
[type='search'] {
-webkit-appearance: textfield;
outline-offset: -2px;
}
::-webkit-search-decoration {
-webkit-appearance: none;
}
::-webkit-file-upload-button {
-webkit-appearance: button;
font: inherit;
}
summary {
display: list-item;
}
blockquote, dl, dd, h1, h2, h3, h4, h5, h6, hr, figure, p, pre {
margin: 0;
}
button {
background-image: none;
outline: 1px dotted, 5px auto -webkit-focus-ring-color;
}
fieldset {
margin: 0;
padding: 0;
}
ol, ul {
list-style: none;
margin: 0;
padding: 0;
}
img {
border-style: solid;
}
textarea {
resize: vertical;
}
input::-moz-placeholder, textarea::-moz-placeholder {
opacity: 1;
color: #9ca3af;
}
input:-ms-input-placeholder, textarea:-ms-input-placeholder {
opacity: 1;
color: #9ca3af;
}
input::placeholder, textarea::placeholder {
opacity: 1;
color: #9ca3af;
}
button, [role='button'] {
cursor: pointer;
}
h1, h2, h3, h4, h5, h6 {
font-size: inherit;
font-weight: inherit;
}
a {
color: inherit;
text-decoration: inherit;
}
pre, code, kbd, samp {
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}
img, svg, video, canvas, audio, iframe, embed, object {
display: block;
vertical-align: middle;
}
img, video {
max-width: 100%;
height: auto;
}
html {
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
line-height: 1.5;
-webkit-text-size-adjust: 100%;
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
width: 100%;
height: 100%;
}
body {
margin: 0px;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
line-height: 1.4;
background-color: white;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
flex: 1 1 0%;
min-width: 320px;
min-height: 100vh;
font-weight: 400;
color: rgba(44, 62, 80, 1);
direction: ltr;
font-synthesis: none;
text-rendering: optimizeLegibility;
}
.flex {
display: flex;
}
.flex-1 {
flex: 1;
}
.flex-col {
flex-direction: column;
}
.mt-20 {
margin-top: 5rem;
}
.items-center {
align-items: center;
}
.text-5xl {
font-size: 3rem;
line-height: 1;
}
</style>
<script type=\\"module\\"><script>
</head>
<body>
<div>
<app-header></app-header> <main class=\\"flex flex-1 flex-col mt-20 items-center\\">
<h1 class=\\"text-5xl\\">123</h1> </main> </div>
<script>
window.props = {\\"config\\":{\\"title\\":\\"123\\"}};
</script>
<script type=\\"module\\"><script>
</body>
</html>
"
`;
exports[`css 1`] = `
"button {
color: magenta;
font-size: 10px;
font-size: 64px;
color: black;
color: navy;
}
container {
flex: 1;
align-items: center;
justify-content: center;
}
"
`;
exports[`render attribute keys 1`] = `
"
<div>
<app-counter name=\\"123\\" perPage=\\"1\\"></app-counter> </div>"
`;
exports[`render attributes within quotes 1`] = `
"
<div>
<app-counter name=\\"123\\" class=\\"high\\" age=\\"1\\" details1=\\"{'name':'123','address':{'street':'1'}}\\" items=\\"[1,2,3]\\"></app-counter> </div>"
`;
exports[`render multi template 1`] = `
"
<div>
<app-item meta=\\"{'index':1}\\">
<button>+</button> </app-item> <app-item meta=\\"{'index':2}\\">
<button>+</button> </app-item> </div>"
`;
exports[`render single template 1`] = `" <div>NoCountry false</div>"`;
exports[`render unsafeHTML 1`] = `" <div><div><p class=\\"123\\">this is unsafe</p></div></div>"`;
exports[`renderHtml 1`] = `
"
<div>
<app-counter name=\\"123\\" class=\\"abc high\\" age=\\"1\\" details1=\\"{'name':'123','address':{'street':'1'}}\\" items=\\"[1,2,3]\\"></app-counter> </div>"
`;