vira 0.0.0 → 0.1.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.
- package/LICENSE-CC0 +121 -0
- package/LICENSE-MIT +21 -0
- package/dist/element-book/all-element-book-entries.d.ts +1 -0
- package/dist/element-book/all-element-book-entries.js +13 -0
- package/dist/element-book/book-helpers/create-element-book-url.d.ts +1 -0
- package/dist/element-book/book-helpers/create-element-book-url.js +14 -0
- package/dist/element-book/vira-book-app.element.d.ts +1 -0
- package/dist/element-book/vira-book-app.element.js +44 -0
- package/dist/elements/define-vira-element.d.ts +3 -0
- package/dist/elements/define-vira-element.js +13 -0
- package/dist/elements/index.d.ts +4 -0
- package/dist/elements/index.js +20 -0
- package/dist/elements/vira-button/vira-button.element.d.ts +11 -0
- package/dist/elements/vira-button/vira-button.element.js +116 -0
- package/dist/elements/vira-icon/vira-icon.element.d.ts +6 -0
- package/dist/elements/vira-icon/vira-icon.element.js +40 -0
- package/dist/icons/icon-color-css-vars.d.ts +5 -0
- package/dist/icons/icon-color-css-vars.js +20 -0
- package/dist/icons/icon-svg.d.ts +9 -0
- package/dist/icons/icon-svg.js +11 -0
- package/dist/icons/icon-svgs/element-16.icon.d.ts +1 -0
- package/dist/icons/icon-svgs/element-16.icon.js +21 -0
- package/dist/icons/icon-svgs/element-24.icon.d.ts +1 -0
- package/dist/icons/icon-svgs/element-24.icon.js +21 -0
- package/dist/icons/index.d.ts +8 -0
- package/dist/icons/index.js +27 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +20 -0
- package/dist/styles/disabled.d.ts +1 -0
- package/dist/styles/disabled.js +8 -0
- package/dist/styles/durations.d.ts +10 -0
- package/dist/styles/durations.js +14 -0
- package/dist/styles/focus.d.ts +20 -0
- package/dist/styles/focus.js +35 -0
- package/dist/styles/index.d.ts +5 -0
- package/dist/styles/index.js +21 -0
- package/dist/styles/native-styles.d.ts +1 -0
- package/dist/styles/native-styles.js +16 -0
- package/dist/styles/user-select.d.ts +1 -0
- package/dist/styles/user-select.js +9 -0
- package/dist/util/index.d.ts +1 -0
- package/dist/util/index.js +17 -0
- package/dist/util/number.d.ts +2 -0
- package/dist/util/number.js +11 -0
- package/package.json +48 -10
package/LICENSE-CC0
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
CC0 1.0 Universal
|
|
2
|
+
|
|
3
|
+
Creative Commons Legal Code
|
|
4
|
+
|
|
5
|
+
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
|
|
6
|
+
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
|
|
7
|
+
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
|
|
8
|
+
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
|
|
9
|
+
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
|
|
10
|
+
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
|
|
11
|
+
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
|
|
12
|
+
HEREUNDER.
|
|
13
|
+
|
|
14
|
+
Statement of Purpose
|
|
15
|
+
|
|
16
|
+
The laws of most jurisdictions throughout the world automatically confer
|
|
17
|
+
exclusive Copyright and Related Rights (defined below) upon the creator
|
|
18
|
+
and subsequent owner(s) (each and all, an "owner") of an original work of
|
|
19
|
+
authorship and/or a database (each, a "Work").
|
|
20
|
+
|
|
21
|
+
Certain owners wish to permanently relinquish those rights to a Work for
|
|
22
|
+
the purpose of contributing to a commons of creative, cultural and
|
|
23
|
+
scientific works ("Commons") that the public can reliably and without fear
|
|
24
|
+
of later claims of infringement build upon, modify, incorporate in other
|
|
25
|
+
works, reuse and redistribute as freely as possible in any form whatsoever
|
|
26
|
+
and for any purposes, including without limitation commercial purposes.
|
|
27
|
+
These owners may contribute to the Commons to promote the ideal of a free
|
|
28
|
+
culture and the further production of creative, cultural and scientific
|
|
29
|
+
works, or to gain reputation or greater distribution for their Work in
|
|
30
|
+
part through the use and efforts of others.
|
|
31
|
+
|
|
32
|
+
For these and/or other purposes and motivations, and without any
|
|
33
|
+
expectation of additional consideration or compensation, the person
|
|
34
|
+
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
|
|
35
|
+
is an owner of Copyright and Related Rights in the Work, voluntarily
|
|
36
|
+
elects to apply CC0 to the Work and publicly distribute the Work under its
|
|
37
|
+
terms, with knowledge of his or her Copyright and Related Rights in the
|
|
38
|
+
Work and the meaning and intended legal effect of CC0 on those rights.
|
|
39
|
+
|
|
40
|
+
1. Copyright and Related Rights. A Work made available under CC0 may be
|
|
41
|
+
protected by copyright and related or neighboring rights ("Copyright and
|
|
42
|
+
Related Rights"). Copyright and Related Rights include, but are not
|
|
43
|
+
limited to, the following:
|
|
44
|
+
|
|
45
|
+
i. the right to reproduce, adapt, distribute, perform, display,
|
|
46
|
+
communicate, and translate a Work;
|
|
47
|
+
ii. moral rights retained by the original author(s) and/or performer(s);
|
|
48
|
+
iii. publicity and privacy rights pertaining to a person's image or
|
|
49
|
+
likeness depicted in a Work;
|
|
50
|
+
iv. rights protecting against unfair competition in regards to a Work,
|
|
51
|
+
subject to the limitations in paragraph 4(a), below;
|
|
52
|
+
v. rights protecting the extraction, dissemination, use and reuse of data
|
|
53
|
+
in a Work;
|
|
54
|
+
vi. database rights (such as those arising under Directive 96/9/EC of the
|
|
55
|
+
European Parliament and of the Council of 11 March 1996 on the legal
|
|
56
|
+
protection of databases, and under any national implementation
|
|
57
|
+
thereof, including any amended or successor version of such
|
|
58
|
+
directive); and
|
|
59
|
+
vii. other similar, equivalent or corresponding rights throughout the
|
|
60
|
+
world based on applicable law or treaty, and any national
|
|
61
|
+
implementations thereof.
|
|
62
|
+
|
|
63
|
+
2. Waiver. To the greatest extent permitted by, but not in contravention
|
|
64
|
+
of, applicable law, Affirmer hereby overtly, fully, permanently,
|
|
65
|
+
irrevocably and unconditionally waives, abandons, and surrenders all of
|
|
66
|
+
Affirmer's Copyright and Related Rights and associated claims and causes
|
|
67
|
+
of action, whether now known or unknown (including existing as well as
|
|
68
|
+
future claims and causes of action), in the Work (i) in all territories
|
|
69
|
+
worldwide, (ii) for the maximum duration provided by applicable law or
|
|
70
|
+
treaty (including future time extensions), (iii) in any current or future
|
|
71
|
+
medium and for any number of copies, and (iv) for any purpose whatsoever,
|
|
72
|
+
including without limitation commercial, advertising or promotional
|
|
73
|
+
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
|
|
74
|
+
member of the public at large and to the detriment of Affirmer's heirs and
|
|
75
|
+
successors, fully intending that such Waiver shall not be subject to
|
|
76
|
+
revocation, rescission, cancellation, termination, or any other legal or
|
|
77
|
+
equitable action to disrupt the quiet enjoyment of the Work by the public
|
|
78
|
+
as contemplated by Affirmer's express Statement of Purpose.
|
|
79
|
+
|
|
80
|
+
3. Public License Fallback. Should any part of the Waiver for any reason
|
|
81
|
+
be judged legally invalid or ineffective under applicable law, then the
|
|
82
|
+
Waiver shall be preserved to the maximum extent permitted taking into
|
|
83
|
+
account Affirmer's express Statement of Purpose. In addition, to the
|
|
84
|
+
extent the Waiver is so judged Affirmer hereby grants to each affected
|
|
85
|
+
person a royalty-free, non transferable, non sublicensable, non exclusive,
|
|
86
|
+
irrevocable and unconditional license to exercise Affirmer's Copyright and
|
|
87
|
+
Related Rights in the Work (i) in all territories worldwide, (ii) for the
|
|
88
|
+
maximum duration provided by applicable law or treaty (including future
|
|
89
|
+
time extensions), (iii) in any current or future medium and for any number
|
|
90
|
+
of copies, and (iv) for any purpose whatsoever, including without
|
|
91
|
+
limitation commercial, advertising or promotional purposes (the
|
|
92
|
+
"License"). The License shall be deemed effective as of the date CC0 was
|
|
93
|
+
applied by Affirmer to the Work. Should any part of the License for any
|
|
94
|
+
reason be judged legally invalid or ineffective under applicable law, such
|
|
95
|
+
partial invalidity or ineffectiveness shall not invalidate the remainder
|
|
96
|
+
of the License, and in such case Affirmer hereby affirms that he or she
|
|
97
|
+
will not (i) exercise any of his or her remaining Copyright and Related
|
|
98
|
+
Rights in the Work or (ii) assert any associated claims and causes of
|
|
99
|
+
action with respect to the Work, in either case contrary to Affirmer's
|
|
100
|
+
express Statement of Purpose.
|
|
101
|
+
|
|
102
|
+
4. Limitations and Disclaimers.
|
|
103
|
+
|
|
104
|
+
a. No trademark or patent rights held by Affirmer are waived, abandoned,
|
|
105
|
+
surrendered, licensed or otherwise affected by this document.
|
|
106
|
+
b. Affirmer offers the Work as-is and makes no representations or
|
|
107
|
+
warranties of any kind concerning the Work, express, implied,
|
|
108
|
+
statutory or otherwise, including without limitation warranties of
|
|
109
|
+
title, merchantability, fitness for a particular purpose, non
|
|
110
|
+
infringement, or the absence of latent or other defects, accuracy, or
|
|
111
|
+
the present or absence of errors, whether or not discoverable, all to
|
|
112
|
+
the greatest extent permissible under applicable law.
|
|
113
|
+
c. Affirmer disclaims responsibility for clearing rights of other persons
|
|
114
|
+
that may apply to the Work or any use thereof, including without
|
|
115
|
+
limitation any person's Copyright and Related Rights in the Work.
|
|
116
|
+
Further, Affirmer disclaims responsibility for obtaining any necessary
|
|
117
|
+
consents, permissions or other rights required for any use of the
|
|
118
|
+
Work.
|
|
119
|
+
d. Affirmer understands and acknowledges that Creative Commons is not a
|
|
120
|
+
party to this document and has no duty or obligation with respect to
|
|
121
|
+
this CC0 or use of the Work.
|
package/LICENSE-MIT
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 electrovir
|
|
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.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const allElementBookEntries: (import("element-book").ElementBookChapter | import("element-book").ElementBookPage<{}>)[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.allElementBookEntries = void 0;
|
|
4
|
+
const elements_book_1 = require("../elements/elements.book");
|
|
5
|
+
const vira_button_element_book_1 = require("../elements/vira-button/vira-button.element.book");
|
|
6
|
+
const vira_icon_element_book_1 = require("../elements/vira-icon/vira-icon.element.book");
|
|
7
|
+
const icons_book_1 = require("../icons/icons.book");
|
|
8
|
+
exports.allElementBookEntries = [
|
|
9
|
+
elements_book_1.elementsBookChapter,
|
|
10
|
+
...icons_book_1.iconBookEntries,
|
|
11
|
+
...vira_button_element_book_1.viraButtonBookEntries,
|
|
12
|
+
...vira_icon_element_book_1.viraIconBookEntries,
|
|
13
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createElementBookUrl(...urlParts: ReadonlyArray<string>): string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createElementBookUrl = void 0;
|
|
4
|
+
const common_1 = require("@augment-vir/common");
|
|
5
|
+
const potentialBasePath = '/vira';
|
|
6
|
+
function createElementBookUrl(...urlParts) {
|
|
7
|
+
const hasBasePath = globalThis.location.pathname.startsWith(potentialBasePath);
|
|
8
|
+
const allParts = [
|
|
9
|
+
hasBasePath ? potentialBasePath : '',
|
|
10
|
+
...urlParts,
|
|
11
|
+
].filter(common_1.isTruthy);
|
|
12
|
+
return (0, common_1.joinUrlParts)(...allParts);
|
|
13
|
+
}
|
|
14
|
+
exports.createElementBookUrl = createElementBookUrl;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ViraBookApp: import("element-vir").DeclarativeElementDefinition<"vira-book-app", {}, {}, {}, "vira-book-app-", "vira-book-app-", import("lit-html").HTMLTemplateResult>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ViraBookApp = void 0;
|
|
4
|
+
const element_book_1 = require("element-book");
|
|
5
|
+
const element_vir_1 = require("element-vir");
|
|
6
|
+
const all_element_book_entries_1 = require("./all-element-book-entries");
|
|
7
|
+
exports.ViraBookApp = (0, element_vir_1.defineElementNoInputs)({
|
|
8
|
+
tagName: 'vira-book-app',
|
|
9
|
+
styles: (0, element_vir_1.css) `
|
|
10
|
+
:host {
|
|
11
|
+
display: block;
|
|
12
|
+
height: 100%;
|
|
13
|
+
width: 100%;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
${element_book_1.ElementBookApp} {
|
|
17
|
+
height: 100%;
|
|
18
|
+
width: 100%;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
h1 {
|
|
22
|
+
margin: 0;
|
|
23
|
+
margin-bottom: 16px;
|
|
24
|
+
padding: 0;
|
|
25
|
+
margin-left: 16px;
|
|
26
|
+
}
|
|
27
|
+
`,
|
|
28
|
+
renderCallback() {
|
|
29
|
+
return (0, element_vir_1.html) `
|
|
30
|
+
<${element_book_1.ElementBookApp}
|
|
31
|
+
${(0, element_vir_1.assign)(element_book_1.ElementBookApp, {
|
|
32
|
+
internalRouterConfig: {
|
|
33
|
+
basePath: 'vira',
|
|
34
|
+
useInternalRouter: true,
|
|
35
|
+
},
|
|
36
|
+
entries: all_element_book_entries_1.allElementBookEntries,
|
|
37
|
+
themeColor: '#33ccff',
|
|
38
|
+
})}
|
|
39
|
+
>
|
|
40
|
+
<h1 slot=${element_book_1.ElementBookSlotName.NavHeader}>Vira</h1>
|
|
41
|
+
</${element_book_1.ElementBookApp}>
|
|
42
|
+
`;
|
|
43
|
+
},
|
|
44
|
+
});
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const ViraTagNamePrefix = "vira-";
|
|
2
|
+
export type ViraTagName = `${typeof ViraTagNamePrefix}${string}`;
|
|
3
|
+
export declare const defineViraElement: <InputsGeneric extends {}>() => <TagName extends `vira-${string}`, StateInit extends {}, EventsInit extends {}, HostClassKeys extends `${TagName}-${string}`, CssVarKeys extends `${TagName}-${string}`, RenderOutput extends any>(inputs: import("element-vir").DeclarativeElementInit<TagName, InputsGeneric, StateInit, EventsInit, HostClassKeys, CssVarKeys, RenderOutput>) => import("element-vir").DeclarativeElementDefinition<TagName, InputsGeneric, StateInit, EventsInit, HostClassKeys, CssVarKeys, RenderOutput>, defineViraElementNoInputs: <TagName_1 extends `vira-${string}`, Inputs extends {}, StateInit_1 extends {}, EventsInit_1 extends {}, HostClassKeys_1 extends `${TagName_1}-${string}`, CssVarKeys_1 extends `${TagName_1}-${string}`, RenderOutput_1 extends any>(inputs: import("element-vir").DeclarativeElementInit<TagName_1, Inputs, StateInit_1, EventsInit_1, HostClassKeys_1, CssVarKeys_1, RenderOutput_1>) => import("element-vir").DeclarativeElementDefinition<TagName_1, Inputs, StateInit_1, EventsInit_1, HostClassKeys_1, CssVarKeys_1, RenderOutput_1>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.defineViraElementNoInputs = exports.defineViraElement = exports.ViraTagNamePrefix = void 0;
|
|
5
|
+
const element_vir_1 = require("element-vir");
|
|
6
|
+
exports.ViraTagNamePrefix = `vira-`;
|
|
7
|
+
_a = (0, element_vir_1.wrapDefineElement)({
|
|
8
|
+
assertInputs: (inputs) => {
|
|
9
|
+
if (!inputs.tagName.startsWith(exports.ViraTagNamePrefix)) {
|
|
10
|
+
throw new Error(`Tag name should start with '${exports.ViraTagNamePrefix}' but got '${inputs.tagName}'`);
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
}), exports.defineViraElement = _a.defineElement, exports.defineViraElementNoInputs = _a.defineElementNoInputs;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/** This file is automatically updated by update-element-exports.ts */
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
__exportStar(require("./define-vira-element"), exports);
|
|
19
|
+
__exportStar(require("./vira-button/vira-button.element"), exports);
|
|
20
|
+
__exportStar(require("./vira-icon/vira-icon.element"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ViraIconSvg } from '../../icons';
|
|
2
|
+
export declare enum ViraButtonStyleEnum {
|
|
3
|
+
Default = "vira-button-default",
|
|
4
|
+
Outline = "vira-button-outline"
|
|
5
|
+
}
|
|
6
|
+
export declare const ViraButton: import("element-vir").DeclarativeElementDefinition<"vira-button", {
|
|
7
|
+
text?: string;
|
|
8
|
+
icon?: undefined | ViraIconSvg;
|
|
9
|
+
disabled?: boolean | undefined;
|
|
10
|
+
buttonStyle?: ViraButtonStyleEnum | undefined;
|
|
11
|
+
}, {}, {}, "vira-button-outline-style" | "vira-button-disabled", "vira-button-primary-color" | "vira-button-primary-hover-color" | "vira-button-primary-active-color" | "vira-button-secondary-color" | "vira-button-internal-foreground-color" | "vira-button-internal-background-color", import("lit-html").HTMLTemplateResult>;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ViraButton = exports.ViraButtonStyleEnum = void 0;
|
|
4
|
+
const element_vir_1 = require("element-vir");
|
|
5
|
+
const styles_1 = require("../../styles");
|
|
6
|
+
const disabled_1 = require("../../styles/disabled");
|
|
7
|
+
const durations_1 = require("../../styles/durations");
|
|
8
|
+
const focus_1 = require("../../styles/focus");
|
|
9
|
+
const native_styles_1 = require("../../styles/native-styles");
|
|
10
|
+
const define_vira_element_1 = require("../define-vira-element");
|
|
11
|
+
const vira_icon_element_1 = require("../vira-icon/vira-icon.element");
|
|
12
|
+
var ViraButtonStyleEnum;
|
|
13
|
+
(function (ViraButtonStyleEnum) {
|
|
14
|
+
ViraButtonStyleEnum["Default"] = "vira-button-default";
|
|
15
|
+
ViraButtonStyleEnum["Outline"] = "vira-button-outline";
|
|
16
|
+
})(ViraButtonStyleEnum = exports.ViraButtonStyleEnum || (exports.ViraButtonStyleEnum = {}));
|
|
17
|
+
exports.ViraButton = (0, define_vira_element_1.defineViraElement)()({
|
|
18
|
+
tagName: 'vira-button',
|
|
19
|
+
hostClasses: {
|
|
20
|
+
'vira-button-outline-style': ({ inputs }) => inputs.buttonStyle === ViraButtonStyleEnum.Outline,
|
|
21
|
+
'vira-button-disabled': ({ inputs }) => !!inputs.disabled,
|
|
22
|
+
},
|
|
23
|
+
cssVars: {
|
|
24
|
+
/** On the default button style this is the background color. */
|
|
25
|
+
'vira-button-primary-color': '#0A89FF',
|
|
26
|
+
'vira-button-primary-hover-color': '#59B1FF',
|
|
27
|
+
'vira-button-primary-active-color': '#007FF6',
|
|
28
|
+
/** On the default button style this is the text color. */
|
|
29
|
+
'vira-button-secondary-color': 'white',
|
|
30
|
+
'vira-button-internal-foreground-color': '',
|
|
31
|
+
'vira-button-internal-background-color': '',
|
|
32
|
+
},
|
|
33
|
+
styles: ({ hostClasses, cssVars }) => (0, element_vir_1.css) `
|
|
34
|
+
:host {
|
|
35
|
+
font-weight: bold;
|
|
36
|
+
display: inline-flex;
|
|
37
|
+
position: relative;
|
|
38
|
+
vertical-align: middle;
|
|
39
|
+
align-items: center;
|
|
40
|
+
box-sizing: border-box;
|
|
41
|
+
${styles_1.noUserSelect};
|
|
42
|
+
${cssVars['vira-button-internal-background-color'].name}: ${cssVars['vira-button-primary-color'].value};
|
|
43
|
+
${cssVars['vira-button-internal-foreground-color'].name}: ${cssVars['vira-button-secondary-color'].value};
|
|
44
|
+
${focus_1.viraFocusCssVars['vira-focus-outline-color'].name}: ${cssVars['vira-button-primary-hover-color'].value}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
:host(:hover) button,
|
|
48
|
+
button:hover {
|
|
49
|
+
${cssVars['vira-button-internal-background-color'].name}: ${cssVars['vira-button-primary-hover-color'].value};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
:host(:active) button,
|
|
53
|
+
button:active {
|
|
54
|
+
${cssVars['vira-button-internal-background-color'].name}: ${cssVars['vira-button-primary-active-color'].value};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
${hostClasses['vira-button-disabled'].selector} {
|
|
58
|
+
${disabled_1.viraDisabledStyles};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
${hostClasses['vira-button-outline-style'].selector} button {
|
|
62
|
+
color: ${cssVars['vira-button-internal-background-color'].value};
|
|
63
|
+
background-color: transparent;
|
|
64
|
+
border-color: currentColor;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
button {
|
|
68
|
+
${native_styles_1.removeNativeFormStyles};
|
|
69
|
+
position: relative;
|
|
70
|
+
width: 100%;
|
|
71
|
+
height: 100%;
|
|
72
|
+
outline: none;
|
|
73
|
+
border: 2px solid transparent;
|
|
74
|
+
box-sizing: border-box;
|
|
75
|
+
display: inline-flex;
|
|
76
|
+
justify-content: center;
|
|
77
|
+
align-items: center;
|
|
78
|
+
border-radius: 8px;
|
|
79
|
+
background-color: ${cssVars['vira-button-internal-background-color'].value};
|
|
80
|
+
color: ${cssVars['vira-button-internal-foreground-color'].value};
|
|
81
|
+
padding: 5px 10px;
|
|
82
|
+
transition: color ${durations_1.viraAnimationDurations['vira-interaction-animation-duration'].value},
|
|
83
|
+
background-color
|
|
84
|
+
${durations_1.viraAnimationDurations['vira-interaction-animation-duration'].value},
|
|
85
|
+
border-color ${durations_1.viraAnimationDurations['vira-interaction-animation-duration'].value};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
${(0, focus_1.createFocusStyles)({
|
|
89
|
+
mainSelector: 'button:focus:focus-visible:not(:active)',
|
|
90
|
+
elementBorderSize: 2,
|
|
91
|
+
})}
|
|
92
|
+
|
|
93
|
+
button ${vira_icon_element_1.ViraIcon} + .text-template {
|
|
94
|
+
margin-left: 8px;
|
|
95
|
+
}
|
|
96
|
+
`,
|
|
97
|
+
renderCallback: ({ inputs }) => {
|
|
98
|
+
const iconTemplate = inputs.icon
|
|
99
|
+
? (0, element_vir_1.html) `
|
|
100
|
+
<${vira_icon_element_1.ViraIcon}
|
|
101
|
+
${(0, element_vir_1.assign)(vira_icon_element_1.ViraIcon, {
|
|
102
|
+
icon: inputs.icon,
|
|
103
|
+
})}
|
|
104
|
+
></${vira_icon_element_1.ViraIcon}>
|
|
105
|
+
`
|
|
106
|
+
: '';
|
|
107
|
+
const textTemplate = inputs.text
|
|
108
|
+
? (0, element_vir_1.html) `
|
|
109
|
+
<span class="text-template">${inputs.text}</span>
|
|
110
|
+
`
|
|
111
|
+
: '';
|
|
112
|
+
return (0, element_vir_1.html) `
|
|
113
|
+
<button>${iconTemplate} ${textTemplate}</button>
|
|
114
|
+
`;
|
|
115
|
+
},
|
|
116
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ViraIconSvg } from '../../icons/icon-svg';
|
|
2
|
+
export declare const ViraIcon: import("element-vir").DeclarativeElementDefinition<"vira-icon", {
|
|
3
|
+
icon: ViraIconSvg | undefined;
|
|
4
|
+
/** Ignores the given icon's embedded size and causes the <svg> element to fill its parent. */
|
|
5
|
+
fitContainer?: boolean | undefined;
|
|
6
|
+
}, {}, {}, "vira-icon-fit-container", `vira-icon-${string}`, import("lit-html").TemplateResult | "">;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ViraIcon = void 0;
|
|
4
|
+
const element_vir_1 = require("element-vir");
|
|
5
|
+
const icon_color_css_vars_1 = require("../../icons/icon-color-css-vars");
|
|
6
|
+
const define_vira_element_1 = require("../define-vira-element");
|
|
7
|
+
exports.ViraIcon = (0, define_vira_element_1.defineViraElement)()({
|
|
8
|
+
tagName: 'vira-icon',
|
|
9
|
+
hostClasses: {
|
|
10
|
+
/** Ignores the given icon's embedded size and causes the <svg> element to fill its parent. */
|
|
11
|
+
'vira-icon-fit-container': ({ inputs }) => !!inputs.fitContainer,
|
|
12
|
+
},
|
|
13
|
+
styles: ({ hostClasses }) => (0, element_vir_1.css) `
|
|
14
|
+
:host {
|
|
15
|
+
display: inline-block;
|
|
16
|
+
color: ${icon_color_css_vars_1.viraIconColorCssVars['vira-icon-color'].value};
|
|
17
|
+
fill: ${icon_color_css_vars_1.viraIconColorCssVars['vira-icon-fill-color'].value};
|
|
18
|
+
stroke: ${icon_color_css_vars_1.viraIconColorCssVars['vira-icon-stroke-color'].value};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
svg {
|
|
22
|
+
/*
|
|
23
|
+
svg is set to inline by default which causes weird padding under the image.
|
|
24
|
+
See: https://stackoverflow.com/a/34952703
|
|
25
|
+
*/
|
|
26
|
+
display: block;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
${hostClasses['vira-icon-fit-container'].selector} svg {
|
|
30
|
+
height: 100%;
|
|
31
|
+
width: 100%;
|
|
32
|
+
}
|
|
33
|
+
`,
|
|
34
|
+
renderCallback: ({ inputs }) => {
|
|
35
|
+
if (!inputs.icon) {
|
|
36
|
+
return '';
|
|
37
|
+
}
|
|
38
|
+
return inputs.icon.svgTemplate;
|
|
39
|
+
},
|
|
40
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.viraIconColorCssVars = void 0;
|
|
4
|
+
const lit_css_vars_1 = require("lit-css-vars");
|
|
5
|
+
const genericIconColorCssVar = (0, lit_css_vars_1.defineCssVars)({
|
|
6
|
+
/**
|
|
7
|
+
* Specifies the icon color as a whole. This will color both the icon stroke and icon fill
|
|
8
|
+
* colors unless those respective CSS vars are specifically overridden. This CSS var value
|
|
9
|
+
* defaults to "currentColor", so in most cases you don't even need to override this variable,
|
|
10
|
+
* you just need to change the icon's "color" property.
|
|
11
|
+
*/
|
|
12
|
+
'vira-icon-color': 'currentColor',
|
|
13
|
+
});
|
|
14
|
+
const specificIconCssVars = (0, lit_css_vars_1.defineCssVars)({
|
|
15
|
+
/** To be used for coloring an icon's stroke. */
|
|
16
|
+
'vira-icon-stroke-color': genericIconColorCssVar['vira-icon-color'].value,
|
|
17
|
+
/** To be used for coloring an icon's fill. */
|
|
18
|
+
'vira-icon-fill-color': genericIconColorCssVar['vira-icon-color'].value,
|
|
19
|
+
});
|
|
20
|
+
exports.viraIconColorCssVars = { ...genericIconColorCssVar, ...specificIconCssVars };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defineIcon = void 0;
|
|
4
|
+
function defineIcon({ name, svgTemplate, }) {
|
|
5
|
+
const iconSvg = {
|
|
6
|
+
name,
|
|
7
|
+
svgTemplate,
|
|
8
|
+
};
|
|
9
|
+
return iconSvg;
|
|
10
|
+
}
|
|
11
|
+
exports.defineIcon = defineIcon;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Element16Icon: import("../icon-svg").ViraIconSvg;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Element16Icon = void 0;
|
|
4
|
+
const element_vir_1 = require("element-vir");
|
|
5
|
+
const icon_svg_1 = require("../icon-svg");
|
|
6
|
+
exports.Element16Icon = (0, icon_svg_1.defineIcon)({
|
|
7
|
+
name: 'Element16Icon',
|
|
8
|
+
svgTemplate: (0, element_vir_1.html) `
|
|
9
|
+
<svg
|
|
10
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
11
|
+
xml:space="preserve"
|
|
12
|
+
fill="none"
|
|
13
|
+
width="16"
|
|
14
|
+
height="16"
|
|
15
|
+
viewBox="0 0 16 16"
|
|
16
|
+
stroke-width="1px"
|
|
17
|
+
>
|
|
18
|
+
<path d="M4 5 1 8l3 3m8-6 3 3-3 3m-5 0 2-6" />
|
|
19
|
+
</svg>
|
|
20
|
+
`,
|
|
21
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Element24Icon: import("../icon-svg").ViraIconSvg;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Element24Icon = void 0;
|
|
4
|
+
const element_vir_1 = require("element-vir");
|
|
5
|
+
const icon_svg_1 = require("../icon-svg");
|
|
6
|
+
exports.Element24Icon = (0, icon_svg_1.defineIcon)({
|
|
7
|
+
name: 'Element24Icon',
|
|
8
|
+
svgTemplate: (0, element_vir_1.html) `
|
|
9
|
+
<svg
|
|
10
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
11
|
+
xml:space="preserve"
|
|
12
|
+
viewBox="0 0 24 24"
|
|
13
|
+
fill="none"
|
|
14
|
+
width="24"
|
|
15
|
+
height="24"
|
|
16
|
+
stroke-width="1px"
|
|
17
|
+
>
|
|
18
|
+
<path d="m7 7-5 5 5 5M17 7l5 5-5 5m-6 0 2-10" />
|
|
19
|
+
</svg>
|
|
20
|
+
`,
|
|
21
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** This file is automatically updated by update-icon-exports.ts */
|
|
2
|
+
export * from './icon-svg';
|
|
3
|
+
export * from './icon-svgs/element-16.icon';
|
|
4
|
+
export * from './icon-svgs/element-24.icon';
|
|
5
|
+
export declare const allIconsByName: {
|
|
6
|
+
readonly Element16Icon: import("./icon-svg").ViraIconSvg;
|
|
7
|
+
readonly Element24Icon: import("./icon-svg").ViraIconSvg;
|
|
8
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/** This file is automatically updated by update-icon-exports.ts */
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.allIconsByName = void 0;
|
|
19
|
+
const element_16_icon_1 = require("./icon-svgs/element-16.icon");
|
|
20
|
+
const element_24_icon_1 = require("./icon-svgs/element-24.icon");
|
|
21
|
+
__exportStar(require("./icon-svg"), exports);
|
|
22
|
+
__exportStar(require("./icon-svgs/element-16.icon"), exports);
|
|
23
|
+
__exportStar(require("./icon-svgs/element-24.icon"), exports);
|
|
24
|
+
exports.allIconsByName = {
|
|
25
|
+
Element16Icon: element_16_icon_1.Element16Icon,
|
|
26
|
+
Element24Icon: element_24_icon_1.Element24Icon,
|
|
27
|
+
};
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./elements"), exports);
|
|
18
|
+
__exportStar(require("./icons"), exports);
|
|
19
|
+
__exportStar(require("./styles"), exports);
|
|
20
|
+
__exportStar(require("./util"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const viraDisabledStyles: import("element-vir").CSSResult;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.viraDisabledStyles = void 0;
|
|
4
|
+
const element_vir_1 = require("element-vir");
|
|
5
|
+
exports.viraDisabledStyles = (0, element_vir_1.css) `
|
|
6
|
+
pointer-events: none;
|
|
7
|
+
opacity: 0.3;
|
|
8
|
+
`;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const viraAnimationDurations: import("lit-css-vars").CssVarDefinitions<{
|
|
2
|
+
/** A longer duration to emphasize the animation. */
|
|
3
|
+
'vira-pretty-animation-duration': string;
|
|
4
|
+
/**
|
|
5
|
+
* This duration is very short to ensure snappy responses to user interactions.
|
|
6
|
+
*
|
|
7
|
+
* A duration of 84ms gives us 5 frames on a 60Hz screen.
|
|
8
|
+
*/
|
|
9
|
+
'vira-interaction-animation-duration': string;
|
|
10
|
+
}>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.viraAnimationDurations = void 0;
|
|
4
|
+
const lit_css_vars_1 = require("lit-css-vars");
|
|
5
|
+
exports.viraAnimationDurations = (0, lit_css_vars_1.defineCssVars)({
|
|
6
|
+
/** A longer duration to emphasize the animation. */
|
|
7
|
+
'vira-pretty-animation-duration': '300ms',
|
|
8
|
+
/**
|
|
9
|
+
* This duration is very short to ensure snappy responses to user interactions.
|
|
10
|
+
*
|
|
11
|
+
* A duration of 84ms gives us 5 frames on a 60Hz screen.
|
|
12
|
+
*/
|
|
13
|
+
'vira-interaction-animation-duration': '84ms',
|
|
14
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const viraFocusCssVars: import("lit-css-vars").CssVarDefinitions<{
|
|
2
|
+
'vira-focus-outline-color': string;
|
|
3
|
+
}>;
|
|
4
|
+
/**
|
|
5
|
+
* Create styles that look like an outline for the given selector.
|
|
6
|
+
*
|
|
7
|
+
* It is recommended to use the pseudo selectors ":focus:focus-visible:not(:active)" to preventing
|
|
8
|
+
* clicking from creating focus styles in Chrome.
|
|
9
|
+
*/
|
|
10
|
+
export declare function createFocusStyles({ mainSelector, elementBorderSize, outlineGap, outlineWidth, }: {
|
|
11
|
+
mainSelector: string;
|
|
12
|
+
/**
|
|
13
|
+
* ElementBorderSize here is used to fix the outline when the element these styles are attached
|
|
14
|
+
* to has a border. The dev must specify that border size here for the offsets to be calculated
|
|
15
|
+
* correctly.
|
|
16
|
+
*/
|
|
17
|
+
elementBorderSize: number;
|
|
18
|
+
outlineGap?: number;
|
|
19
|
+
outlineWidth?: number;
|
|
20
|
+
}): import("element-vir").CSSResult;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createFocusStyles = exports.viraFocusCssVars = void 0;
|
|
4
|
+
const element_vir_1 = require("element-vir");
|
|
5
|
+
const lit_1 = require("lit");
|
|
6
|
+
const lit_css_vars_1 = require("lit-css-vars");
|
|
7
|
+
const number_1 = require("../util/number");
|
|
8
|
+
exports.viraFocusCssVars = (0, lit_css_vars_1.defineCssVars)({
|
|
9
|
+
'vira-focus-outline-color': 'blue',
|
|
10
|
+
});
|
|
11
|
+
/**
|
|
12
|
+
* Create styles that look like an outline for the given selector.
|
|
13
|
+
*
|
|
14
|
+
* It is recommended to use the pseudo selectors ":focus:focus-visible:not(:active)" to preventing
|
|
15
|
+
* clicking from creating focus styles in Chrome.
|
|
16
|
+
*/
|
|
17
|
+
function createFocusStyles({ mainSelector, elementBorderSize, outlineGap = 2, outlineWidth = 3, }) {
|
|
18
|
+
const outlineSpacing = (0, lit_1.unsafeCSS)((0, number_1.toPixel)(outlineWidth + outlineGap + elementBorderSize));
|
|
19
|
+
return (0, element_vir_1.css) `
|
|
20
|
+
${(0, lit_1.unsafeCSS)(mainSelector)}::after {
|
|
21
|
+
content: '';
|
|
22
|
+
top: calc(${outlineSpacing} * -1);
|
|
23
|
+
left: calc(${outlineSpacing} * -1);
|
|
24
|
+
position: absolute;
|
|
25
|
+
width: calc(100% + calc(${outlineSpacing} * 2));
|
|
26
|
+
height: calc(100% + calc(${outlineSpacing} * 2));
|
|
27
|
+
box-sizing: border-box;
|
|
28
|
+
pointer-events: none;
|
|
29
|
+
border: ${outlineWidth}px solid ${exports.viraFocusCssVars['vira-focus-outline-color'].value};
|
|
30
|
+
border-radius: 12px;
|
|
31
|
+
z-index: 100;
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
34
|
+
}
|
|
35
|
+
exports.createFocusStyles = createFocusStyles;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./disabled"), exports);
|
|
18
|
+
__exportStar(require("./durations"), exports);
|
|
19
|
+
__exportStar(require("./focus"), exports);
|
|
20
|
+
__exportStar(require("./native-styles"), exports);
|
|
21
|
+
__exportStar(require("./user-select"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const removeNativeFormStyles: import("element-vir").CSSResult;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.removeNativeFormStyles = void 0;
|
|
4
|
+
const element_vir_1 = require("element-vir");
|
|
5
|
+
exports.removeNativeFormStyles = (0, element_vir_1.css) `
|
|
6
|
+
background: none;
|
|
7
|
+
padding: 0;
|
|
8
|
+
margin: 0;
|
|
9
|
+
border: none;
|
|
10
|
+
font: inherit;
|
|
11
|
+
color: inherit;
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
text-transform: inherit;
|
|
14
|
+
text-decoration: inherit;
|
|
15
|
+
-webkit-tap-highlight-color: transparent;
|
|
16
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const noUserSelect: import("element-vir").CSSResult;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.noUserSelect = void 0;
|
|
4
|
+
const element_vir_1 = require("element-vir");
|
|
5
|
+
exports.noUserSelect = (0, element_vir_1.css) `
|
|
6
|
+
-webkit-touch-callout: none; /* iOS Safari */
|
|
7
|
+
-webkit-user-select: none; /* Safari */
|
|
8
|
+
user-select: none; /* Non-prefixed version, currently supported by Chrome, Edge, Opera and Firefox */
|
|
9
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './number';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./number"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toPercent = exports.toPixel = void 0;
|
|
4
|
+
function toPixel(value) {
|
|
5
|
+
return `${value}px`;
|
|
6
|
+
}
|
|
7
|
+
exports.toPixel = toPixel;
|
|
8
|
+
function toPercent(value) {
|
|
9
|
+
return `${value}%`;
|
|
10
|
+
}
|
|
11
|
+
exports.toPercent = toPercent;
|
package/package.json
CHANGED
|
@@ -1,12 +1,50 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
"name": "vira",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"keywords": [],
|
|
6
|
+
"homepage": "https://github.com/electrovir/vira",
|
|
7
|
+
"bugs": {
|
|
8
|
+
"url": "https://github.com/electrovir/vira/issues"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/electrovir/vira"
|
|
13
|
+
},
|
|
14
|
+
"license": "(MIT or CC0 1.0)",
|
|
15
|
+
"author": {
|
|
16
|
+
"name": "electrovir",
|
|
17
|
+
"url": "https://github.com/electrovir"
|
|
18
|
+
},
|
|
19
|
+
"main": "dist/index.js",
|
|
20
|
+
"types": "dist/index.d.ts",
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "virmator frontend build",
|
|
23
|
+
"compile": "rm -rf dist && virmator compile",
|
|
24
|
+
"preview": "virmator frontend preview",
|
|
25
|
+
"start": "virmator frontend",
|
|
26
|
+
"test": "virmator test-web",
|
|
27
|
+
"test:all": "npm test",
|
|
28
|
+
"test:coverage": "npm run test",
|
|
29
|
+
"test:docs": "virmator code-in-markdown check"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"element-vir": "^13.0.0",
|
|
33
|
+
"lit-css-vars": "^2.0.2"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@augment-vir/browser-testing": "^14.2.0",
|
|
37
|
+
"@augment-vir/node-js": "^14.2.0",
|
|
38
|
+
"@open-wc/testing": "^3.1.8",
|
|
39
|
+
"@types/mocha": "^10.0.1",
|
|
40
|
+
"@web/dev-server-esbuild": "^0.4.1",
|
|
41
|
+
"@web/test-runner": "^0.16.1",
|
|
42
|
+
"@web/test-runner-commands": "^0.7.0",
|
|
43
|
+
"@web/test-runner-playwright": "^0.10.0",
|
|
44
|
+
"@web/test-runner-visual-regression": "^0.8.0",
|
|
45
|
+
"istanbul-smart-text-reporter": "^1.1.1",
|
|
46
|
+
"typescript": "^5.0.4",
|
|
47
|
+
"vite": "^4.3.9",
|
|
48
|
+
"vite-tsconfig-paths": "^4.2.0"
|
|
49
|
+
}
|
|
12
50
|
}
|